summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:01:57 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:01:57 +0000
commitcab56836b146bc129f1ad43f0393d95a9deca63a (patch)
tree4f4e655319bbac78fca170da05275c127429b460 /sysdeps
parent04ac1241a4cd004872282c2c82ec37fa33925292 (diff)
parent82dd75a7f436a19047325d62182590c9f9e23a78 (diff)
Merge branch 't/tls' into refs/top-bases/t/tls-threadvar
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/aarch64/Implies1
-rw-r--r--sysdeps/aarch64/Makefile12
-rw-r--r--sysdeps/aarch64/__longjmp.S8
-rw-r--r--sysdeps/aarch64/atomic-machine.h7
-rw-r--r--sysdeps/aarch64/backtrace.c1
-rw-r--r--sysdeps/aarch64/bits/endian.h2
-rw-r--r--sysdeps/aarch64/bits/fenv.h10
-rw-r--r--sysdeps/aarch64/bits/fp-fast.h34
-rw-r--r--sysdeps/aarch64/bits/link.h2
-rw-r--r--sysdeps/aarch64/bits/mathdef.h39
-rw-r--r--sysdeps/aarch64/bits/setjmp.h2
-rw-r--r--sysdeps/aarch64/bits/string.h24
-rw-r--r--sysdeps/aarch64/bits/wordsize.h28
-rw-r--r--sysdeps/aarch64/crti.S7
-rw-r--r--sysdeps/aarch64/crtn.S2
-rw-r--r--sysdeps/aarch64/dl-irel.h7
-rw-r--r--sysdeps/aarch64/dl-machine.h255
-rw-r--r--sysdeps/aarch64/dl-sysdep.h2
-rw-r--r--sysdeps/aarch64/dl-tls.h5
-rw-r--r--sysdeps/aarch64/dl-tlsdesc.S265
-rw-r--r--sysdeps/aarch64/dl-tlsdesc.h14
-rw-r--r--sysdeps/aarch64/dl-trampoline.S20
-rw-r--r--sysdeps/aarch64/dl-tunables.list25
-rw-r--r--sysdeps/aarch64/e_sqrtl.c39
-rw-r--r--sysdeps/aarch64/fpu/Makefile14
-rw-r--r--sysdeps/aarch64/fpu/e_sqrt.c6
-rw-r--r--sysdeps/aarch64/fpu/e_sqrtf.c6
-rw-r--r--sysdeps/aarch64/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/aarch64/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/aarch64/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/aarch64/fpu/fegetenv.c2
-rw-r--r--sysdeps/aarch64/fpu/fegetexcept.c2
-rw-r--r--sysdeps/aarch64/fpu/fegetmode.c27
-rw-r--r--sysdeps/aarch64/fpu/fegetround.c2
-rw-r--r--sysdeps/aarch64/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/aarch64/fpu/fesetenv.c2
-rw-r--r--sysdeps/aarch64/fpu/fesetexcept.c34
-rw-r--r--sysdeps/aarch64/fpu/fesetmode.c34
-rw-r--r--sysdeps/aarch64/fpu/fesetround.c2
-rw-r--r--sysdeps/aarch64/fpu/feupdateenv.c2
-rw-r--r--sysdeps/aarch64/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/aarch64/fpu/fpu_control.h19
-rw-r--r--sysdeps/aarch64/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/aarch64/fpu/fsetexcptflg.c2
-rw-r--r--sysdeps/aarch64/fpu/ftestexcept.c2
-rw-r--r--sysdeps/aarch64/fpu/get-rounding-mode.h2
-rw-r--r--sysdeps/aarch64/fpu/math-barriers.h27
-rw-r--r--sysdeps/aarch64/fpu/math_private.h43
-rw-r--r--sysdeps/aarch64/fpu/s_ceil.c15
-rw-r--r--sysdeps/aarch64/fpu/s_ceilf.c15
-rw-r--r--sysdeps/aarch64/fpu/s_floor.c15
-rw-r--r--sysdeps/aarch64/fpu/s_floorf.c15
-rw-r--r--sysdeps/aarch64/fpu/s_fma.c29
-rw-r--r--sysdeps/aarch64/fpu/s_fmaf.c16
-rw-r--r--sysdeps/aarch64/fpu/s_fmax.c15
-rw-r--r--sysdeps/aarch64/fpu/s_fmaxf.c17
-rw-r--r--sysdeps/aarch64/fpu/s_fmin.c33
-rw-r--r--sysdeps/aarch64/fpu/s_fminf.c16
-rw-r--r--sysdeps/aarch64/fpu/s_frint.c49
-rw-r--r--sysdeps/aarch64/fpu/s_frintf.c24
-rw-r--r--sysdeps/aarch64/fpu/s_llrint.c23
-rw-r--r--sysdeps/aarch64/fpu/s_llrintf.c26
-rw-r--r--sysdeps/aarch64/fpu/s_llround.c15
-rw-r--r--sysdeps/aarch64/fpu/s_llroundf.c17
-rw-r--r--sysdeps/aarch64/fpu/s_lrint.c82
-rw-r--r--sysdeps/aarch64/fpu/s_lrintf.c24
-rw-r--r--sysdeps/aarch64/fpu/s_lround.c39
-rw-r--r--sysdeps/aarch64/fpu/s_lroundf.c16
-rw-r--r--sysdeps/aarch64/fpu/s_nearbyint.c15
-rw-r--r--sysdeps/aarch64/fpu/s_nearbyintf.c15
-rw-r--r--sysdeps/aarch64/fpu/s_rint.c15
-rw-r--r--sysdeps/aarch64/fpu/s_rintf.c15
-rw-r--r--sysdeps/aarch64/fpu/s_round.c15
-rw-r--r--sysdeps/aarch64/fpu/s_roundf.c15
-rw-r--r--sysdeps/aarch64/fpu/s_trunc.c15
-rw-r--r--sysdeps/aarch64/fpu/s_truncf.c15
-rw-r--r--sysdeps/aarch64/jmpbuf-offsets.h2
-rw-r--r--sysdeps/aarch64/jmpbuf-unwind.h5
-rw-r--r--sysdeps/aarch64/ldsodefs.h3
-rw-r--r--sysdeps/aarch64/libc-tls.c2
-rw-r--r--sysdeps/aarch64/libm-test-ulps272
-rw-r--r--sysdeps/aarch64/libm-test-ulps-name1
-rw-r--r--sysdeps/aarch64/linkmap.h2
-rw-r--r--sysdeps/aarch64/machine-gmon.h2
-rw-r--r--sysdeps/aarch64/math-tests.h2
-rw-r--r--sysdeps/aarch64/mcount.c2
-rw-r--r--sysdeps/aarch64/memchr.S157
-rw-r--r--sysdeps/aarch64/memcmp.S221
-rw-r--r--sysdeps/aarch64/memcpy.S379
-rw-r--r--sysdeps/aarch64/memmove.S313
-rw-r--r--sysdeps/aarch64/memset-reg.h30
-rw-r--r--sysdeps/aarch64/memset.S367
-rw-r--r--sysdeps/aarch64/memusage.h2
-rw-r--r--sysdeps/aarch64/multiarch/Makefile4
-rw-r--r--sysdeps/aarch64/multiarch/ifunc-impl-list.c57
-rw-r--r--sysdeps/aarch64/multiarch/init-arch.h25
-rw-r--r--sysdeps/aarch64/multiarch/memcpy.c47
-rw-r--r--sysdeps/aarch64/multiarch/memcpy_falkor.S191
-rw-r--r--sysdeps/aarch64/multiarch/memcpy_generic.S44
-rw-r--r--sysdeps/aarch64/multiarch/memcpy_thunderx.S336
-rw-r--r--sysdeps/aarch64/multiarch/memcpy_thunderx2.S27
-rw-r--r--sysdeps/aarch64/multiarch/memmove.c44
-rw-r--r--sysdeps/aarch64/multiarch/memmove_falkor.S225
-rw-r--r--sysdeps/aarch64/multiarch/memset.c41
-rw-r--r--sysdeps/aarch64/multiarch/memset_falkor.S53
-rw-r--r--sysdeps/aarch64/multiarch/memset_generic.S27
-rw-r--r--sysdeps/aarch64/multiarch/rtld-memset.S23
-rw-r--r--sysdeps/aarch64/nptl/Makefile2
-rw-r--r--sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h71
-rw-r--r--sysdeps/aarch64/nptl/bits/pthreadtypes.h174
-rw-r--r--sysdeps/aarch64/nptl/bits/semaphore.h10
-rw-r--r--sysdeps/aarch64/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/aarch64/nptl/pthread_spin_lock.c24
-rw-r--r--sysdeps/aarch64/nptl/pthreaddef.h2
-rw-r--r--sysdeps/aarch64/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/aarch64/nptl/tls.h15
-rw-r--r--sysdeps/aarch64/rawmemchr.S42
-rw-r--r--sysdeps/aarch64/setjmp.S7
-rw-r--r--sysdeps/aarch64/sfp-machine.h (renamed from sysdeps/aarch64/soft-fp/sfp-machine.h)0
-rw-r--r--sysdeps/aarch64/soft-fp/e_sqrtl.c39
-rw-r--r--sysdeps/aarch64/sotruss-lib.c2
-rw-r--r--sysdeps/aarch64/stackinfo.h2
-rw-r--r--sysdeps/aarch64/start.S42
-rw-r--r--sysdeps/aarch64/stpcpy.S2
-rw-r--r--sysdeps/aarch64/strchr.S3
-rw-r--r--sysdeps/aarch64/strchrnul.S3
-rw-r--r--sysdeps/aarch64/strcmp.S35
-rw-r--r--sysdeps/aarch64/strcpy.S4
-rw-r--r--sysdeps/aarch64/string_private.h2
-rw-r--r--sysdeps/aarch64/strlen.S9
-rw-r--r--sysdeps/aarch64/strncmp.S100
-rw-r--r--sysdeps/aarch64/strnlen.S5
-rw-r--r--sysdeps/aarch64/strrchr.S3
-rw-r--r--sysdeps/aarch64/sysdep.h90
-rw-r--r--sysdeps/aarch64/tls-macros.h2
-rw-r--r--sysdeps/aarch64/tlsdesc.c130
-rw-r--r--sysdeps/aarch64/tlsdesc.sym3
-rw-r--r--sysdeps/aarch64/tst-audit.h2
-rw-r--r--sysdeps/alpha/Implies1
-rw-r--r--sysdeps/alpha/Makefile14
-rw-r--r--sysdeps/alpha/Versions6
-rw-r--r--sysdeps/alpha/__longjmp.S2
-rw-r--r--sysdeps/alpha/_mcount.S2
-rw-r--r--sysdeps/alpha/add_n.S2
-rw-r--r--sysdeps/alpha/addmul_1.S2
-rw-r--r--sysdeps/alpha/alphaev5/add_n.S2
-rw-r--r--sysdeps/alpha/alphaev5/lshift.S2
-rw-r--r--sysdeps/alpha/alphaev5/rshift.S2
-rw-r--r--sysdeps/alpha/alphaev5/sub_n.S2
-rw-r--r--sysdeps/alpha/alphaev6/addmul_1.S2
-rw-r--r--sysdeps/alpha/alphaev6/fpu/e_sqrt.S2
-rw-r--r--sysdeps/alpha/alphaev6/fpu/e_sqrtf.S2
-rw-r--r--sysdeps/alpha/alphaev6/memcpy.S2
-rw-r--r--sysdeps/alpha/alphaev6/memset.S2
-rw-r--r--sysdeps/alpha/alphaev6/stxcpy.S2
-rw-r--r--sysdeps/alpha/alphaev6/stxncpy.S2
-rw-r--r--sysdeps/alpha/alphaev67/ffs.S2
-rw-r--r--sysdeps/alpha/alphaev67/ffsll.S2
-rw-r--r--sysdeps/alpha/alphaev67/rawmemchr.S2
-rw-r--r--sysdeps/alpha/alphaev67/stpcpy.S2
-rw-r--r--sysdeps/alpha/alphaev67/stpncpy.S2
-rw-r--r--sysdeps/alpha/alphaev67/strcat.S2
-rw-r--r--sysdeps/alpha/alphaev67/strchr.S2
-rw-r--r--sysdeps/alpha/alphaev67/strlen.S2
-rw-r--r--sysdeps/alpha/alphaev67/strncat.S2
-rw-r--r--sysdeps/alpha/alphaev67/strrchr.S2
-rw-r--r--sysdeps/alpha/atomic-machine.h9
-rw-r--r--sysdeps/alpha/backtrace.c1
-rw-r--r--sysdeps/alpha/bb_init_func.S86
-rw-r--r--sysdeps/alpha/bits/link.h2
-rw-r--r--sysdeps/alpha/bits/mathdef.h22
-rw-r--r--sysdeps/alpha/bits/setjmp.h2
-rw-r--r--sysdeps/alpha/bzero.S2
-rw-r--r--sysdeps/alpha/crti.S4
-rw-r--r--sysdeps/alpha/crtn.S2
-rw-r--r--sysdeps/alpha/div.S2
-rw-r--r--sysdeps/alpha/div_libc.h2
-rw-r--r--sysdeps/alpha/divl.S2
-rw-r--r--sysdeps/alpha/divq.S2
-rw-r--r--sysdeps/alpha/divqu.S2
-rw-r--r--sysdeps/alpha/dl-machine.h9
-rw-r--r--sysdeps/alpha/dl-procinfo.c2
-rw-r--r--sysdeps/alpha/dl-procinfo.h11
-rw-r--r--sysdeps/alpha/dl-sysdep.h2
-rw-r--r--sysdeps/alpha/dl-tls.h5
-rw-r--r--sysdeps/alpha/dl-trampoline.S2
-rw-r--r--sysdeps/alpha/e_sqrtl.c49
-rw-r--r--sysdeps/alpha/ffs.S2
-rw-r--r--sysdeps/alpha/fpu/bits/fenv.h10
-rw-r--r--sysdeps/alpha/fpu/bits/mathinline.h125
-rw-r--r--sysdeps/alpha/fpu/cabsf.c4
-rw-r--r--sysdeps/alpha/fpu/cargf.c4
-rw-r--r--sysdeps/alpha/fpu/cfloat-compat.h12
-rw-r--r--sysdeps/alpha/fpu/cimagf.c4
-rw-r--r--sysdeps/alpha/fpu/conjf.c4
-rw-r--r--sysdeps/alpha/fpu/crealf.c4
-rw-r--r--sysdeps/alpha/fpu/e_sqrt.c2
-rw-r--r--sysdeps/alpha/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/alpha/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/alpha/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/alpha/fpu/fegetenv.c2
-rw-r--r--sysdeps/alpha/fpu/fegetexcept.c2
-rw-r--r--sysdeps/alpha/fpu/fegetmode.c33
-rw-r--r--sysdeps/alpha/fpu/fegetround.c2
-rw-r--r--sysdeps/alpha/fpu/feholdexcpt.c4
-rw-r--r--sysdeps/alpha/fpu/fenv_libc.h2
-rw-r--r--sysdeps/alpha/fpu/fesetenv.c2
-rw-r--r--sysdeps/alpha/fpu/fesetexcept.c31
-rw-r--r--sysdeps/alpha/fpu/fesetmode.c44
-rw-r--r--sysdeps/alpha/fpu/fesetround.c2
-rw-r--r--sysdeps/alpha/fpu/feupdateenv.c2
-rw-r--r--sysdeps/alpha/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/alpha/fpu/fpu_control.h2
-rw-r--r--sysdeps/alpha/fpu/fsetexcptflg.c2
-rw-r--r--sysdeps/alpha/fpu/ftestexcept.c2
-rw-r--r--sysdeps/alpha/fpu/get-rounding-mode.h2
-rw-r--r--sysdeps/alpha/fpu/libm-test-ulps260
-rw-r--r--sysdeps/alpha/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/alpha/fpu/math-barriers.h28
-rw-r--r--sysdeps/alpha/fpu/math_private.h32
-rw-r--r--sysdeps/alpha/fpu/s_cacosf.c15
-rw-r--r--sysdeps/alpha/fpu/s_cacoshf.c14
-rw-r--r--sysdeps/alpha/fpu/s_casinf.c16
-rw-r--r--sysdeps/alpha/fpu/s_casinhf.c16
-rw-r--r--sysdeps/alpha/fpu/s_catanf.c16
-rw-r--r--sysdeps/alpha/fpu/s_catanhf.c16
-rw-r--r--sysdeps/alpha/fpu/s_ccosf.c16
-rw-r--r--sysdeps/alpha/fpu/s_ccoshf.c16
-rw-r--r--sysdeps/alpha/fpu/s_ceil.c57
-rw-r--r--sysdeps/alpha/fpu/s_ceilf.c54
-rw-r--r--sysdeps/alpha/fpu/s_cexpf.c16
-rw-r--r--sysdeps/alpha/fpu/s_clog10f.c16
-rw-r--r--sysdeps/alpha/fpu/s_clogf.c16
-rw-r--r--sysdeps/alpha/fpu/s_copysign.c15
-rw-r--r--sysdeps/alpha/fpu/s_copysignf.c5
-rw-r--r--sysdeps/alpha/fpu/s_cpowf.c16
-rw-r--r--sysdeps/alpha/fpu/s_cprojf.c16
-rw-r--r--sysdeps/alpha/fpu/s_csinf.c16
-rw-r--r--sysdeps/alpha/fpu/s_csinhf.c16
-rw-r--r--sysdeps/alpha/fpu/s_csqrtf.c16
-rw-r--r--sysdeps/alpha/fpu/s_ctanf.c16
-rw-r--r--sysdeps/alpha/fpu/s_ctanhf.c16
-rw-r--r--sysdeps/alpha/fpu/s_fabs.c12
-rw-r--r--sysdeps/alpha/fpu/s_fabsf.c5
-rw-r--r--sysdeps/alpha/fpu/s_floor.c58
-rw-r--r--sysdeps/alpha/fpu/s_floorf.c55
-rw-r--r--sysdeps/alpha/fpu/s_fma.c2
-rw-r--r--sysdeps/alpha/fpu/s_fmax.S57
-rw-r--r--sysdeps/alpha/fpu/s_fmaxf.S1
-rw-r--r--sysdeps/alpha/fpu/s_fmin.S57
-rw-r--r--sysdeps/alpha/fpu/s_fminf.S1
-rw-r--r--sysdeps/alpha/fpu/s_isnan.c3
-rw-r--r--sysdeps/alpha/fpu/s_lrint.c17
-rw-r--r--sysdeps/alpha/fpu/s_lrintf.c7
-rw-r--r--sysdeps/alpha/fpu/s_lround.c17
-rw-r--r--sysdeps/alpha/fpu/s_lroundf.c7
-rw-r--r--sysdeps/alpha/fpu/s_nearbyint.c25
-rw-r--r--sysdeps/alpha/fpu/s_rint.c15
-rw-r--r--sysdeps/alpha/fpu/s_rintf.c8
-rw-r--r--sysdeps/alpha/fpu/s_trunc.c52
-rw-r--r--sysdeps/alpha/fpu/s_truncf.c44
-rw-r--r--sysdeps/alpha/gccframe.h2
-rw-r--r--sysdeps/alpha/hp-timing.h2
-rw-r--r--sysdeps/alpha/htonl.S2
-rw-r--r--sysdeps/alpha/htons.S2
-rw-r--r--sysdeps/alpha/jmpbuf-offsets.h2
-rw-r--r--sysdeps/alpha/jmpbuf-unwind.h2
-rw-r--r--sysdeps/alpha/ldiv.S2
-rw-r--r--sysdeps/alpha/ldsodefs.h2
-rw-r--r--sysdeps/alpha/libc-tls.c2
-rw-r--r--sysdeps/alpha/local-soft-fp.h (renamed from sysdeps/alpha/soft-fp/local-soft-fp.h)0
-rw-r--r--sysdeps/alpha/lshift.S2
-rw-r--r--sysdeps/alpha/machine-gmon.h2
-rw-r--r--sysdeps/alpha/memchr.c7
-rw-r--r--sysdeps/alpha/memset.S2
-rw-r--r--sysdeps/alpha/memusage.h2
-rw-r--r--sysdeps/alpha/mul_1.S2
-rw-r--r--sysdeps/alpha/nptl/Makefile2
-rw-r--r--sysdeps/alpha/nptl/bits/pthreadtypes-arch.h61
-rw-r--r--sysdeps/alpha/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/alpha/nptl/pthread_spin_lock.S2
-rw-r--r--sysdeps/alpha/nptl/pthread_spin_trylock.S2
-rw-r--r--sysdeps/alpha/nptl/pthreaddef.h2
-rw-r--r--sysdeps/alpha/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/alpha/nptl/tls.h15
-rw-r--r--sysdeps/alpha/nscd-types.h2
-rw-r--r--sysdeps/alpha/ots_add.c (renamed from sysdeps/alpha/soft-fp/ots_add.c)2
-rw-r--r--sysdeps/alpha/ots_cmp.c (renamed from sysdeps/alpha/soft-fp/ots_cmp.c)2
-rw-r--r--sysdeps/alpha/ots_cmpe.c (renamed from sysdeps/alpha/soft-fp/ots_cmpe.c)2
-rw-r--r--sysdeps/alpha/ots_cvtqux.c (renamed from sysdeps/alpha/soft-fp/ots_cvtqux.c)2
-rw-r--r--sysdeps/alpha/ots_cvtqx.c (renamed from sysdeps/alpha/soft-fp/ots_cvtqx.c)2
-rw-r--r--sysdeps/alpha/ots_cvttx.c (renamed from sysdeps/alpha/soft-fp/ots_cvttx.c)2
-rw-r--r--sysdeps/alpha/ots_cvtxq.c (renamed from sysdeps/alpha/soft-fp/ots_cvtxq.c)2
-rw-r--r--sysdeps/alpha/ots_cvtxt.c (renamed from sysdeps/alpha/soft-fp/ots_cvtxt.c)2
-rw-r--r--sysdeps/alpha/ots_div.c (renamed from sysdeps/alpha/soft-fp/ots_div.c)2
-rw-r--r--sysdeps/alpha/ots_mul.c (renamed from sysdeps/alpha/soft-fp/ots_mul.c)2
-rw-r--r--sysdeps/alpha/ots_nintxq.c (renamed from sysdeps/alpha/soft-fp/ots_nintxq.c)2
-rw-r--r--sysdeps/alpha/ots_sub.c (renamed from sysdeps/alpha/soft-fp/ots_sub.c)2
-rw-r--r--sysdeps/alpha/rawmemchr.S2
-rw-r--r--sysdeps/alpha/reml.S2
-rw-r--r--sysdeps/alpha/remq.S2
-rw-r--r--sysdeps/alpha/remqu.S2
-rw-r--r--sysdeps/alpha/rshift.S2
-rw-r--r--sysdeps/alpha/setjmp.S3
-rw-r--r--sysdeps/alpha/sfp-machine.h99
-rw-r--r--sysdeps/alpha/soft-fp/Makefile11
-rw-r--r--sysdeps/alpha/soft-fp/Versions8
-rw-r--r--sysdeps/alpha/soft-fp/e_sqrtl.c49
-rw-r--r--sysdeps/alpha/soft-fp/sfp-machine.h99
-rw-r--r--sysdeps/alpha/sotruss-lib.c2
-rw-r--r--sysdeps/alpha/stackinfo.h2
-rw-r--r--sysdeps/alpha/start.S2
-rw-r--r--sysdeps/alpha/stpcpy.S2
-rw-r--r--sysdeps/alpha/stpncpy.S2
-rw-r--r--sysdeps/alpha/strcat.S2
-rw-r--r--sysdeps/alpha/strchr.S2
-rw-r--r--sysdeps/alpha/strcmp.S2
-rw-r--r--sysdeps/alpha/strcpy.S2
-rw-r--r--sysdeps/alpha/strlen.S2
-rw-r--r--sysdeps/alpha/strncat.S2
-rw-r--r--sysdeps/alpha/strncmp.S2
-rw-r--r--sysdeps/alpha/strncpy.S2
-rw-r--r--sysdeps/alpha/strrchr.S2
-rw-r--r--sysdeps/alpha/stxcpy.S2
-rw-r--r--sysdeps/alpha/stxncpy.S2
-rw-r--r--sysdeps/alpha/sub_n.S2
-rw-r--r--sysdeps/alpha/submul_1.S2
-rw-r--r--sysdeps/alpha/tst-audit.h2
-rw-r--r--sysdeps/alpha/udiv_qrnnd.S2
-rw-r--r--sysdeps/arm/Makefile9
-rw-r--r--sysdeps/arm/__longjmp.S42
-rw-r--r--sysdeps/arm/add_n.S29
-rw-r--r--sysdeps/arm/addmul_1.S20
-rw-r--r--sysdeps/arm/aeabi_assert.c2
-rw-r--r--sysdeps/arm/aeabi_atexit.c2
-rw-r--r--sysdeps/arm/aeabi_errno_addr.c2
-rw-r--r--sysdeps/arm/aeabi_lcsts.c2
-rw-r--r--sysdeps/arm/aeabi_localeconv.c2
-rw-r--r--sysdeps/arm/aeabi_math.c2
-rw-r--r--sysdeps/arm/aeabi_mb_cur_max.c2
-rw-r--r--sysdeps/arm/aeabi_memclr.c8
-rw-r--r--sysdeps/arm/aeabi_memcpy.c2
-rw-r--r--sysdeps/arm/aeabi_memmove.c2
-rw-r--r--sysdeps/arm/aeabi_memset.c2
-rw-r--r--sysdeps/arm/aeabi_sighandlers.S2
-rw-r--r--sysdeps/arm/aeabi_unwind_cpp_pr1.c2
-rw-r--r--sysdeps/arm/arm-features.h2
-rw-r--r--sysdeps/arm/arm-ifunc.h33
-rw-r--r--sysdeps/arm/arm-mcount.S5
-rw-r--r--sysdeps/arm/arm-unwind-resume.S2
-rw-r--r--sysdeps/arm/armv6/rawmemchr.S20
-rw-r--r--sysdeps/arm/armv6/strchr.S20
-rw-r--r--sysdeps/arm/armv6/strcpy.S57
-rw-r--r--sysdeps/arm/armv6/strlen.S20
-rw-r--r--sysdeps/arm/armv6/strrchr.S8
-rw-r--r--sysdeps/arm/armv6t2/ffs.S2
-rw-r--r--sysdeps/arm/armv6t2/ffsll.S2
-rw-r--r--sysdeps/arm/armv6t2/memchr.S34
-rw-r--r--sysdeps/arm/armv6t2/strlen.S50
-rw-r--r--sysdeps/arm/armv7/multiarch/Makefile3
-rw-r--r--sysdeps/arm/armv7/multiarch/ifunc-impl-list.c7
-rw-r--r--sysdeps/arm/armv7/multiarch/ifunc-memchr.h28
-rw-r--r--sysdeps/arm/armv7/multiarch/ifunc-memcpy.h37
-rw-r--r--sysdeps/arm/armv7/multiarch/memchr.c35
-rw-r--r--sysdeps/arm/armv7/multiarch/memchr_neon.S202
-rw-r--r--sysdeps/arm/armv7/multiarch/memchr_noneon.S5
-rw-r--r--sysdeps/arm/armv7/multiarch/memcpy.S76
-rw-r--r--sysdeps/arm/armv7/multiarch/memcpy.c35
-rw-r--r--sysdeps/arm/armv7/multiarch/memcpy_arm.S10
-rw-r--r--sysdeps/arm/armv7/multiarch/memcpy_impl.S585
-rw-r--r--sysdeps/arm/armv7/multiarch/memcpy_neon.S8
-rw-r--r--sysdeps/arm/armv7/multiarch/memcpy_vfp.S4
-rw-r--r--sysdeps/arm/armv7/multiarch/rtld-memchr.S1
-rw-r--r--sysdeps/arm/armv7/multiarch/rtld-memcpy.S1
-rw-r--r--sysdeps/arm/armv7/strcmp.S118
-rw-r--r--sysdeps/arm/atomic-machine.h7
-rw-r--r--sysdeps/arm/backtrace.c2
-rw-r--r--sysdeps/arm/bits/fenv.h10
-rw-r--r--sysdeps/arm/bits/link.h2
-rw-r--r--sysdeps/arm/bits/mathdef.h55
-rw-r--r--sysdeps/arm/bits/setjmp.h2
-rw-r--r--sysdeps/arm/bsd-_setjmp.S2
-rw-r--r--sysdeps/arm/bsd-setjmp.S2
-rw-r--r--sysdeps/arm/crti.S4
-rw-r--r--sysdeps/arm/crtn.S2
-rw-r--r--sysdeps/arm/dl-irel.h2
-rw-r--r--sysdeps/arm/dl-lookupcfg.h4
-rw-r--r--sysdeps/arm/dl-machine.h91
-rw-r--r--sysdeps/arm/dl-sysdep.h2
-rw-r--r--sysdeps/arm/dl-tls.h5
-rw-r--r--sysdeps/arm/dl-tlsdesc.S110
-rw-r--r--sysdeps/arm/dl-tlsdesc.h6
-rw-r--r--sysdeps/arm/dl-trampoline.S2
-rw-r--r--sysdeps/arm/e_sqrt.c45
-rw-r--r--sysdeps/arm/e_sqrtf.c45
-rw-r--r--sysdeps/arm/fclrexcpt.c2
-rw-r--r--sysdeps/arm/fedisblxcpt.c2
-rw-r--r--sysdeps/arm/feenablxcpt.c2
-rw-r--r--sysdeps/arm/fegetenv.c2
-rw-r--r--sysdeps/arm/fegetexcept.c2
-rw-r--r--sysdeps/arm/fegetmode.c29
-rw-r--r--sysdeps/arm/fegetround.c2
-rw-r--r--sysdeps/arm/feholdexcpt.c2
-rw-r--r--sysdeps/arm/fenv_private.h2
-rw-r--r--sysdeps/arm/fesetenv.c2
-rw-r--r--sysdeps/arm/fesetexcept.c38
-rw-r--r--sysdeps/arm/fesetmode.c45
-rw-r--r--sysdeps/arm/fesetround.c2
-rw-r--r--sysdeps/arm/feupdateenv.c2
-rw-r--r--sysdeps/arm/fgetexcptflg.c2
-rw-r--r--sysdeps/arm/find_exidx.c2
-rw-r--r--sysdeps/arm/fix-fp-int-convert-overflow.h2
-rw-r--r--sysdeps/arm/fpu_control.h13
-rw-r--r--sysdeps/arm/fraiseexcpt.c2
-rw-r--r--sysdeps/arm/frame.h27
-rw-r--r--sysdeps/arm/fsetexcptflg.c2
-rw-r--r--sysdeps/arm/ftestexcept.c2
-rw-r--r--sysdeps/arm/gcc-compat.h2
-rw-r--r--sysdeps/arm/gccframe.h2
-rw-r--r--sysdeps/arm/get-rounding-mode.h2
-rw-r--r--sysdeps/arm/gmp-mparam.h2
-rw-r--r--sysdeps/arm/include/bits/setjmp.h2
-rw-r--r--sysdeps/arm/jmpbuf-unwind.h2
-rw-r--r--sysdeps/arm/ldbl-classify-compat.h8
-rw-r--r--sysdeps/arm/ldsodefs.h2
-rw-r--r--sysdeps/arm/libc-tls.c2
-rw-r--r--sysdeps/arm/libm-test-ulps204
-rw-r--r--sysdeps/arm/libm-test-ulps-name1
-rw-r--r--sysdeps/arm/machine-gmon.h6
-rw-r--r--sysdeps/arm/math-tests.h2
-rw-r--r--sysdeps/arm/math_private.h4
-rw-r--r--sysdeps/arm/memcpy.S126
-rw-r--r--sysdeps/arm/memmove.S126
-rw-r--r--sysdeps/arm/memset.S29
-rw-r--r--sysdeps/arm/memusage.h2
-rw-r--r--sysdeps/arm/nacl/Implies2
-rw-r--r--sysdeps/arm/nacl/Makefile33
-rw-r--r--sysdeps/arm/nacl/____longjmp_chk.S47
-rw-r--r--sysdeps/arm/nacl/aeabi_read_tp.S44
-rw-r--r--sysdeps/arm/nacl/arm-features.h43
-rw-r--r--sysdeps/arm/nacl/dl-machine.h53
-rw-r--r--sysdeps/arm/nacl/dl-trampoline.S278
-rw-r--r--sysdeps/arm/nacl/include/bits/setjmp.h38
-rw-r--r--sysdeps/arm/nacl/libc.abilist1836
-rw-r--r--sysdeps/arm/nacl/shlib-versions4
-rw-r--r--sysdeps/arm/nacl/start.c1
-rw-r--r--sysdeps/arm/nacl/sysdep.h69
-rw-r--r--sysdeps/arm/nacl/tls.h2
-rw-r--r--sysdeps/arm/nacl/uname-values.h20
-rw-r--r--sysdeps/arm/nofpu/Implies1
-rw-r--r--sysdeps/arm/nptl/Makefile2
-rw-r--r--sysdeps/arm/nptl/bits/pthreadtypes-arch.h71
-rw-r--r--sysdeps/arm/nptl/bits/pthreadtypes.h189
-rw-r--r--sysdeps/arm/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/arm/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/arm/nptl/pthread_spin_lock.c23
-rw-r--r--sysdeps/arm/nptl/pthreaddef.h2
-rw-r--r--sysdeps/arm/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/arm/nptl/tls.h15
-rw-r--r--sysdeps/arm/preconfigure1
-rw-r--r--sysdeps/arm/preconfigure.ac1
-rw-r--r--sysdeps/arm/s_fma.c5
-rw-r--r--sysdeps/arm/s_fmaf.c5
-rw-r--r--sysdeps/arm/setfpucw.c2
-rw-r--r--sysdeps/arm/setjmp.S38
-rw-r--r--sysdeps/arm/sotruss-lib.c2
-rw-r--r--sysdeps/arm/stackinfo.h2
-rw-r--r--sysdeps/arm/start.S6
-rw-r--r--sysdeps/arm/strlen.S8
-rw-r--r--sysdeps/arm/submul_1.S20
-rw-r--r--sysdeps/arm/sys/ucontext.h72
-rw-r--r--sysdeps/arm/sysdep.h54
-rw-r--r--sysdeps/arm/tlsdesc.c122
-rw-r--r--sysdeps/arm/tst-armtlsdescloc.c2
-rw-r--r--sysdeps/arm/tst-armtlsdesclocmod.c2
-rw-r--r--sysdeps/arm/tst-audit.h2
-rw-r--r--sysdeps/arm/unwind-dw2-fde-glibc.c2
-rw-r--r--sysdeps/arm/unwind-resume.h2
-rw-r--r--sysdeps/arm/unwind.h2
-rw-r--r--sysdeps/generic/Makefile2
-rw-r--r--sysdeps/generic/_G_config.h60
-rw-r--r--sysdeps/generic/_itoa.h4
-rw-r--r--sysdeps/generic/abort-instr.h2
-rw-r--r--sysdeps/generic/aio_misc.h4
-rw-r--r--sysdeps/generic/atomic-machine.h2
-rw-r--r--sysdeps/generic/bits/hwcap.h23
-rw-r--r--sysdeps/generic/device-nrs.h2
-rw-r--r--sysdeps/generic/dirstream.h2
-rw-r--r--sysdeps/generic/dl-cache.h5
-rw-r--r--sysdeps/generic/dl-dtprocnum.h2
-rw-r--r--sysdeps/generic/dl-dtv.h38
-rw-r--r--sysdeps/generic/dl-fcntl.h21
-rw-r--r--sysdeps/generic/dl-fileid.h2
-rw-r--r--sysdeps/generic/dl-fptr.h2
-rw-r--r--sysdeps/generic/dl-hash.h2
-rw-r--r--sysdeps/generic/dl-irel.h2
-rw-r--r--sysdeps/generic/dl-librecon.h2
-rw-r--r--sysdeps/generic/dl-lookupcfg.h2
-rw-r--r--sysdeps/generic/dl-machine.h9
-rw-r--r--sysdeps/generic/dl-mman.h2
-rw-r--r--sysdeps/generic/dl-osinfo.h2
-rw-r--r--sysdeps/generic/dl-procinfo.h5
-rw-r--r--sysdeps/generic/dl-procruntime.c1
-rw-r--r--sysdeps/generic/dl-prop.h54
-rw-r--r--sysdeps/generic/dl-sysdep.h2
-rw-r--r--sysdeps/generic/dl-unistd.h2
-rw-r--r--sysdeps/generic/dwarf2.h2
-rw-r--r--sysdeps/generic/elide.h2
-rw-r--r--sysdeps/generic/eloop-threshold.h2
-rw-r--r--sysdeps/generic/exit-thread.h2
-rw-r--r--sysdeps/generic/fd_to_filename.h2
-rw-r--r--sysdeps/generic/fips-private.h2
-rw-r--r--sysdeps/generic/fix-fp-int-compare-invalid.h27
-rw-r--r--sysdeps/generic/fix-fp-int-convert-overflow.h4
-rw-r--r--sysdeps/generic/fix-int-fp-convert-zero.h2
-rw-r--r--sysdeps/generic/float128-abi.h1
-rw-r--r--sysdeps/generic/fpu_control.h2
-rw-r--r--sysdeps/generic/frame.h23
-rw-r--r--sysdeps/generic/framestate.c2
-rw-r--r--sysdeps/generic/gcc-compat.h2
-rw-r--r--sysdeps/generic/gccframe.h2
-rw-r--r--sysdeps/generic/get-rounding-mode.h2
-rw-r--r--sysdeps/generic/gmp-mparam.h2
-rw-r--r--sysdeps/generic/hp-timing-common.h2
-rw-r--r--sysdeps/generic/hp-timing.h2
-rw-r--r--sysdeps/generic/ifreq.h14
-rw-r--r--sysdeps/generic/ifunc-init.h54
-rw-r--r--sysdeps/generic/ifunc-sel.h2
-rw-r--r--sysdeps/generic/internal-signals.h62
-rw-r--r--sysdeps/generic/inttypes.h2
-rw-r--r--sysdeps/generic/ldbl-classify-compat.h33
-rw-r--r--sysdeps/generic/ldconfig.h4
-rw-r--r--sysdeps/generic/ldsodefs.h369
-rw-r--r--sysdeps/generic/libc-lock.h2
-rw-r--r--sysdeps/generic/libc-mmap.h2
-rw-r--r--sysdeps/generic/libc-start.h31
-rw-r--r--sysdeps/generic/libc-tsd.h2
-rw-r--r--sysdeps/generic/libm-alias-double.h72
-rw-r--r--sysdeps/generic/libm-alias-float.h53
-rw-r--r--sysdeps/generic/libm-alias-float128.h55
-rw-r--r--sysdeps/generic/libm-alias-ldouble.h65
-rw-r--r--sysdeps/generic/libm-test-ulps-name1
-rw-r--r--sysdeps/generic/libnsl.abilist (renamed from sysdeps/generic/libcidn.abilist)0
-rw-r--r--sysdeps/generic/libutil.abilist0
-rw-r--r--sysdeps/generic/link_map.h1
-rw-r--r--sysdeps/generic/localplt.data11
-rw-r--r--sysdeps/generic/machine-gmon.h2
-rw-r--r--sysdeps/generic/machine-lock.h14
-rw-r--r--sysdeps/generic/machine-sp.h2
-rw-r--r--sysdeps/generic/malloc-alignment.h31
-rw-r--r--sysdeps/generic/malloc-machine.h22
-rw-r--r--sysdeps/generic/malloc-sysdep.h2
-rw-r--r--sysdeps/generic/math-barriers.h37
-rw-r--r--sysdeps/generic/math-nan-payload-double.h29
-rw-r--r--sysdeps/generic/math-nan-payload-float.h28
-rw-r--r--sysdeps/generic/math-tests-arch.h2
-rw-r--r--sysdeps/generic/math-tests.h61
-rw-r--r--sysdeps/generic/math-type-macros-double.h49
-rw-r--r--sysdeps/generic/math-type-macros-float.h52
-rw-r--r--sysdeps/generic/math-type-macros-float128.h49
-rw-r--r--sysdeps/generic/math-type-macros-ldouble.h49
-rw-r--r--sysdeps/generic/math-type-macros.h134
-rw-r--r--sysdeps/generic/math_ldbl.h10
-rw-r--r--sysdeps/generic/math_private.h532
-rw-r--r--sysdeps/generic/math_private_calls.h124
-rw-r--r--sysdeps/generic/memcopy.h2
-rw-r--r--sysdeps/generic/memusage.h2
-rw-r--r--sysdeps/generic/nan-high-order-bit.h27
-rw-r--r--sysdeps/generic/net/if.h2
-rw-r--r--sysdeps/generic/netinet/if_ether.h5
-rw-r--r--sysdeps/generic/netinet/in_systm.h10
-rw-r--r--sysdeps/generic/netinet/ip.h48
-rw-r--r--sysdeps/generic/netinet/tcp.h34
-rw-r--r--sysdeps/generic/nfs/nfs.h2
-rw-r--r--sysdeps/generic/not-cancel.h55
-rw-r--r--sysdeps/generic/not-errno.h19
-rw-r--r--sysdeps/generic/nscd-types.h2
-rw-r--r--sysdeps/generic/pagecopy.h2
-rw-r--r--sysdeps/generic/profil-counter.h2
-rw-r--r--sysdeps/generic/pty-private.h2
-rw-r--r--sysdeps/generic/register-dump.h2
-rw-r--r--sysdeps/generic/safe-fatal.h2
-rw-r--r--sysdeps/generic/setjmpP.h24
-rw-r--r--sysdeps/generic/sigcontextinfo.h7
-rw-r--r--sysdeps/generic/siglist.h26
-rw-r--r--sysdeps/generic/sigset-cvt-mask.h4
-rw-r--r--sysdeps/generic/sigsetops.h76
-rw-r--r--sysdeps/generic/stackinfo.h2
-rw-r--r--sysdeps/generic/startup.h23
-rw-r--r--sysdeps/generic/stdint.h125
-rw-r--r--sysdeps/generic/stdio-lock.h7
-rw-r--r--sysdeps/generic/string_private.h2
-rw-r--r--sysdeps/generic/symbol-hacks.h12
-rw-r--r--sysdeps/generic/sys/ptrace.h2
-rw-r--r--sysdeps/generic/sys/swap.h2
-rw-r--r--sysdeps/generic/sys/sysinfo.h2
-rw-r--r--sysdeps/generic/sys/sysmacros.h30
-rw-r--r--sysdeps/generic/sys/ucontext.h28
-rw-r--r--sysdeps/generic/sysdep.h2
-rw-r--r--sysdeps/generic/thread_state.h6
-rw-r--r--sysdeps/generic/tininess.h2
-rw-r--r--sysdeps/generic/tls-setup.h22
-rw-r--r--sysdeps/generic/tls.h8
-rw-r--r--sysdeps/generic/tst-stack-align.h2
-rw-r--r--sysdeps/generic/unsecvars.h8
-rw-r--r--sysdeps/generic/unwind-dw2-fde-glibc.c2
-rw-r--r--sysdeps/generic/unwind-dw2-fde.c6
-rw-r--r--sysdeps/generic/unwind-dw2-fde.h2
-rw-r--r--sysdeps/generic/unwind-dw2.c2
-rw-r--r--sysdeps/generic/unwind-pe.h2
-rw-r--r--sysdeps/generic/unwind-resume.h2
-rw-r--r--sysdeps/generic/unwind.h2
-rw-r--r--sysdeps/generic/utmp-equal.h2
-rw-r--r--sysdeps/gnu/Makefile2
-rw-r--r--sysdeps/gnu/bits/ipc.h2
-rw-r--r--sysdeps/gnu/bits/msq.h6
-rw-r--r--sysdeps/gnu/bits/sem.h2
-rw-r--r--sysdeps/gnu/bits/shm.h6
-rw-r--r--sysdeps/gnu/bits/utmp.h15
-rw-r--r--sysdeps/gnu/bits/utmpx.h4
-rw-r--r--sysdeps/gnu/configure4
-rw-r--r--sysdeps/gnu/errlist-compat.awk2
-rw-r--r--sysdeps/gnu/errlist.awk23
-rw-r--r--sysdeps/gnu/errlist.c114
-rw-r--r--sysdeps/gnu/getutmp.c2
-rw-r--r--sysdeps/gnu/glob-lstat-compat.c38
-rw-r--r--sysdeps/gnu/glob64-lstat-compat.c48
-rw-r--r--sysdeps/gnu/glob64.c10
-rw-r--r--sysdeps/gnu/globfree64.c10
-rw-r--r--sysdeps/gnu/ifaddrs.c4
-rw-r--r--sysdeps/gnu/ldsodefs.h2
-rw-r--r--sysdeps/gnu/net/if.h2
-rw-r--r--sysdeps/gnu/netinet/ip_icmp.h58
-rw-r--r--sysdeps/gnu/netinet/tcp.h187
-rw-r--r--sysdeps/gnu/netinet/udp.h23
-rw-r--r--sysdeps/gnu/siglist.c2
-rw-r--r--sysdeps/gnu/sys/mtio.h2
-rw-r--r--sysdeps/gnu/unwind-resume.c5
-rw-r--r--sysdeps/gnu/updwtmp.c2
-rw-r--r--sysdeps/gnu/utmp_file.c2
-rw-r--r--sysdeps/gnu/utmpx.h2
-rw-r--r--sysdeps/hppa/Makefile2
-rw-r--r--sysdeps/hppa/__longjmp.c11
-rw-r--r--sysdeps/hppa/add_n.S2
-rw-r--r--sysdeps/hppa/bits/link.h2
-rw-r--r--sysdeps/hppa/bits/setjmp.h2
-rw-r--r--sysdeps/hppa/bsd-_setjmp.S2
-rw-r--r--sysdeps/hppa/bsd-setjmp.S2
-rw-r--r--sysdeps/hppa/crti.S101
-rw-r--r--sysdeps/hppa/crtn.S23
-rw-r--r--sysdeps/hppa/dl-fptr.c71
-rw-r--r--sysdeps/hppa/dl-fptr.h7
-rw-r--r--sysdeps/hppa/dl-irel.h2
-rw-r--r--sysdeps/hppa/dl-lookupcfg.h5
-rw-r--r--sysdeps/hppa/dl-machine.h53
-rw-r--r--sysdeps/hppa/dl-symaddr.c4
-rw-r--r--sysdeps/hppa/dl-tls.h5
-rw-r--r--sysdeps/hppa/dl-trampoline.S24
-rw-r--r--sysdeps/hppa/fpu/bits/fenv.h10
-rw-r--r--sysdeps/hppa/fpu/bits/mathdef.h43
-rw-r--r--sysdeps/hppa/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/hppa/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/hppa/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/hppa/fpu/fegetenv.c2
-rw-r--r--sysdeps/hppa/fpu/fegetexcept.c2
-rw-r--r--sysdeps/hppa/fpu/fegetmode.c27
-rw-r--r--sysdeps/hppa/fpu/fegetround.c2
-rw-r--r--sysdeps/hppa/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/hppa/fpu/fesetenv.c2
-rw-r--r--sysdeps/hppa/fpu/fesetexcept.c35
-rw-r--r--sysdeps/hppa/fpu/fesetmode.c36
-rw-r--r--sysdeps/hppa/fpu/fesetround.c2
-rw-r--r--sysdeps/hppa/fpu/feupdateenv.c2
-rw-r--r--sysdeps/hppa/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/hppa/fpu/fpu_control.h2
-rw-r--r--sysdeps/hppa/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/hppa/fpu/fsetexcptflg.c2
-rw-r--r--sysdeps/hppa/fpu/ftestexcept.c2
-rw-r--r--sysdeps/hppa/fpu/libm-test-ulps878
-rw-r--r--sysdeps/hppa/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/hppa/frame.h27
-rw-r--r--sysdeps/hppa/gccframe.h2
-rw-r--r--sysdeps/hppa/get-rounding-mode.h2
-rw-r--r--sysdeps/hppa/hppa1.1/addmul_1.S2
-rw-r--r--sysdeps/hppa/hppa1.1/mul_1.S2
-rw-r--r--sysdeps/hppa/hppa1.1/s_signbit.c2
-rw-r--r--sysdeps/hppa/hppa1.1/submul_1.S2
-rw-r--r--sysdeps/hppa/hppa1.1/udiv_qrnnd.S2
-rw-r--r--sysdeps/hppa/jmpbuf-offsets.h2
-rw-r--r--sysdeps/hppa/jmpbuf-unwind.h2
-rw-r--r--sysdeps/hppa/ldsodefs.h2
-rw-r--r--sysdeps/hppa/libc-tls.c2
-rw-r--r--sysdeps/hppa/libgcc-compat.c2
-rw-r--r--sysdeps/hppa/lshift.S2
-rw-r--r--sysdeps/hppa/machine-gmon.h2
-rw-r--r--sysdeps/hppa/math-tests.h22
-rw-r--r--sysdeps/hppa/math_private.h28
-rw-r--r--sysdeps/hppa/memusage.h2
-rw-r--r--sysdeps/hppa/nan-high-order-bit.h27
-rw-r--r--sysdeps/hppa/nptl/Makefile2
-rw-r--r--sysdeps/hppa/nptl/bits/pthreadtypes-arch.h91
-rw-r--r--sysdeps/hppa/nptl/bits/pthreadtypes.h230
-rw-r--r--sysdeps/hppa/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/hppa/nptl/jmpbuf-unwind.h2
-rw-r--r--sysdeps/hppa/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/hppa/nptl/pthread_spin_init.c2
-rw-r--r--sysdeps/hppa/nptl/pthread_spin_lock.c23
-rw-r--r--sysdeps/hppa/nptl/pthread_spin_unlock.c2
-rw-r--r--sysdeps/hppa/nptl/pthreaddef.h2
-rw-r--r--sysdeps/hppa/nptl/tcb-offsets.sym2
-rw-r--r--sysdeps/hppa/nptl/tls.h15
-rw-r--r--sysdeps/hppa/nptl/tst-oddstacklimit.c2
-rw-r--r--sysdeps/hppa/rshift.S2
-rw-r--r--sysdeps/hppa/setjmp.S3
-rw-r--r--sysdeps/hppa/sotruss-lib.c2
-rw-r--r--sysdeps/hppa/stackinfo.h2
-rw-r--r--sysdeps/hppa/start.S29
-rw-r--r--sysdeps/hppa/sub_n.S2
-rw-r--r--sysdeps/hppa/sysdep.h2
-rw-r--r--sysdeps/hppa/tst-audit.h2
-rw-r--r--sysdeps/hppa/udiv_qrnnd.S2
-rw-r--r--sysdeps/htl/Implies1
-rw-r--r--sysdeps/htl/Makeconfig11
-rw-r--r--sysdeps/htl/Makefile7
-rw-r--r--sysdeps/htl/Subdirs1
-rw-r--r--sysdeps/htl/Versions15
-rw-r--r--sysdeps/htl/bits/cancelation.h50
-rw-r--r--sysdeps/htl/bits/pthread-np.h26
-rw-r--r--sysdeps/htl/bits/pthread.h36
-rw-r--r--sysdeps/htl/bits/pthreadtypes.h131
-rw-r--r--sysdeps/htl/bits/semaphore.h47
-rw-r--r--sysdeps/htl/bits/thread-shared-types.h24
-rw-r--r--sysdeps/htl/bits/types/__pthread_key.h24
-rw-r--r--sysdeps/htl/bits/types/struct___pthread_attr.h45
-rw-r--r--sysdeps/htl/bits/types/struct___pthread_barrier.h38
-rw-r--r--sysdeps/htl/bits/types/struct___pthread_barrierattr.h31
-rw-r--r--sysdeps/htl/bits/types/struct___pthread_cond.h38
-rw-r--r--sysdeps/htl/bits/types/struct___pthread_condattr.h33
-rw-r--r--sysdeps/htl/bits/types/struct___pthread_mutex.h61
-rw-r--r--sysdeps/htl/bits/types/struct___pthread_mutexattr.h40
-rw-r--r--sysdeps/htl/bits/types/struct___pthread_once.h33
-rw-r--r--sysdeps/htl/bits/types/struct___pthread_rwlock.h45
-rw-r--r--sysdeps/htl/bits/types/struct___pthread_rwlockattr.h31
-rw-r--r--sysdeps/htl/flockfile.c31
-rw-r--r--sysdeps/htl/fork.h29
-rw-r--r--sysdeps/htl/ftrylockfile.c35
-rw-r--r--sysdeps/htl/funlockfile.c32
-rw-r--r--sysdeps/htl/libc-lockP.h180
-rw-r--r--sysdeps/htl/old_pt-atfork.c26
-rw-r--r--sysdeps/htl/pt-atfork.c33
-rw-r--r--sysdeps/htl/pt-attr-destroy.c27
-rw-r--r--sysdeps/htl/pt-attr-getdetachstate.c29
-rw-r--r--sysdeps/htl/pt-attr-getguardsize.c27
-rw-r--r--sysdeps/htl/pt-attr-getinheritsched.c29
-rw-r--r--sysdeps/htl/pt-attr-getschedparam.c33
-rw-r--r--sysdeps/htl/pt-attr-getschedpolicy.c29
-rw-r--r--sysdeps/htl/pt-attr-getscope.c29
-rw-r--r--sysdeps/htl/pt-attr-getstack.c31
-rw-r--r--sysdeps/htl/pt-attr-getstackaddr.c28
-rw-r--r--sysdeps/htl/pt-attr-getstacksize.c28
-rw-r--r--sysdeps/htl/pt-attr-init.c28
-rw-r--r--sysdeps/htl/pt-attr-setdetachstate.c38
-rw-r--r--sysdeps/htl/pt-attr-setguardsize.c27
-rw-r--r--sysdeps/htl/pt-attr-setinheritsched.c38
-rw-r--r--sysdeps/htl/pt-attr-setschedparam.c38
-rw-r--r--sysdeps/htl/pt-attr-setschedpolicy.c42
-rw-r--r--sysdeps/htl/pt-attr-setscope.c41
-rw-r--r--sysdeps/htl/pt-attr-setstack.c50
-rw-r--r--sysdeps/htl/pt-attr-setstackaddr.c28
-rw-r--r--sysdeps/htl/pt-attr-setstacksize.c28
-rw-r--r--sysdeps/htl/pt-attr.c39
-rw-r--r--sysdeps/htl/pt-barrier-destroy.c26
-rw-r--r--sysdeps/htl/pt-barrier-init.c51
-rw-r--r--sysdeps/htl/pt-barrier-wait.c68
-rw-r--r--sysdeps/htl/pt-barrier.c24
-rw-r--r--sysdeps/htl/pt-barrierattr-destroy.c26
-rw-r--r--sysdeps/htl/pt-barrierattr-getpshared.c28
-rw-r--r--sysdeps/htl/pt-barrierattr-init.c27
-rw-r--r--sysdeps/htl/pt-barrierattr-setpshared.c37
-rw-r--r--sysdeps/htl/pt-cond-brdcast.c44
-rw-r--r--sysdeps/htl/pt-cond-destroy.c28
-rw-r--r--sysdeps/htl/pt-cond-init.c45
-rw-r--r--sysdeps/htl/pt-cond-signal.c42
-rw-r--r--sysdeps/htl/pt-cond-timedwait.c178
-rw-r--r--sysdeps/htl/pt-cond-wait.c38
-rw-r--r--sysdeps/htl/pt-cond.c27
-rw-r--r--sysdeps/htl/pt-condattr-destroy.c28
-rw-r--r--sysdeps/htl/pt-condattr-getclock.c29
-rw-r--r--sysdeps/htl/pt-condattr-getpshared.c27
-rw-r--r--sysdeps/htl/pt-condattr-init.c29
-rw-r--r--sysdeps/htl/pt-condattr-setclock.c51
-rw-r--r--sysdeps/htl/pt-condattr-setpshared.c37
-rw-r--r--sysdeps/htl/pt-destroy-specific.c77
-rw-r--r--sysdeps/htl/pt-equal.c30
-rw-r--r--sysdeps/htl/pt-getconcurrency.c26
-rw-r--r--sysdeps/htl/pt-getcpuclockid.c35
-rw-r--r--sysdeps/htl/pt-getschedparam.c31
-rw-r--r--sysdeps/htl/pt-getspecific.c38
-rw-r--r--sysdeps/htl/pt-init-specific.c30
-rw-r--r--sysdeps/htl/pt-key-create.c110
-rw-r--r--sysdeps/htl/pt-key-delete.c63
-rw-r--r--sysdeps/htl/pt-key.h77
-rw-r--r--sysdeps/htl/pt-kill.c33
-rw-r--r--sysdeps/htl/pt-mutex-destroy.c38
-rw-r--r--sysdeps/htl/pt-mutex-getprioceiling.c28
-rw-r--r--sysdeps/htl/pt-mutex-init.c48
-rw-r--r--sysdeps/htl/pt-mutex-lock.c36
-rw-r--r--sysdeps/htl/pt-mutex-setprioceiling.c28
-rw-r--r--sysdeps/htl/pt-mutex-timedlock.c195
-rw-r--r--sysdeps/htl/pt-mutex-transfer-np.c66
-rw-r--r--sysdeps/htl/pt-mutex-trylock.c111
-rw-r--r--sysdeps/htl/pt-mutex-unlock.c107
-rw-r--r--sysdeps/htl/pt-mutexattr-destroy.c27
-rw-r--r--sysdeps/htl/pt-mutexattr-getprioceiling.c29
-rw-r--r--sysdeps/htl/pt-mutexattr-getprotocol.c27
-rw-r--r--sysdeps/htl/pt-mutexattr-getpshared.c27
-rw-r--r--sysdeps/htl/pt-mutexattr-gettype.c27
-rw-r--r--sysdeps/htl/pt-mutexattr-init.c28
-rw-r--r--sysdeps/htl/pt-mutexattr-setprioceiling.c28
-rw-r--r--sysdeps/htl/pt-mutexattr-setprotocol.c40
-rw-r--r--sysdeps/htl/pt-mutexattr-setpshared.c37
-rw-r--r--sysdeps/htl/pt-mutexattr-settype.c37
-rw-r--r--sysdeps/htl/pt-mutexattr.c41
-rw-r--r--sysdeps/htl/pt-once.c44
-rw-r--r--sysdeps/htl/pt-rwlock-attr.c24
-rw-r--r--sysdeps/htl/pt-rwlock-destroy.c28
-rw-r--r--sysdeps/htl/pt-rwlock-init.c44
-rw-r--r--sysdeps/htl/pt-rwlock-rdlock.c34
-rw-r--r--sysdeps/htl/pt-rwlock-timedrdlock.c120
-rw-r--r--sysdeps/htl/pt-rwlock-timedwrlock.c103
-rw-r--r--sysdeps/htl/pt-rwlock-tryrdlock.c55
-rw-r--r--sysdeps/htl/pt-rwlock-trywrlock.c45
-rw-r--r--sysdeps/htl/pt-rwlock-unlock.c98
-rw-r--r--sysdeps/htl/pt-rwlock-wrlock.c36
-rw-r--r--sysdeps/htl/pt-rwlockattr-destroy.c26
-rw-r--r--sysdeps/htl/pt-rwlockattr-getpshared.c27
-rw-r--r--sysdeps/htl/pt-rwlockattr-init.c27
-rw-r--r--sysdeps/htl/pt-rwlockattr-setpshared.c37
-rw-r--r--sysdeps/htl/pt-setconcurrency.c33
-rw-r--r--sysdeps/htl/pt-setschedparam.c30
-rw-r--r--sysdeps/htl/pt-setschedprio.c28
-rw-r--r--sysdeps/htl/pt-setspecific.c50
-rw-r--r--sysdeps/htl/pt-spin.c50
-rw-r--r--sysdeps/htl/pt-startup.c24
-rw-r--r--sysdeps/htl/pthread-functions.h140
-rw-r--r--sysdeps/htl/pthread.h883
-rw-r--r--sysdeps/htl/pthreadP.h74
-rw-r--r--sysdeps/htl/raise.c51
-rw-r--r--sysdeps/htl/sem-close.c31
-rw-r--r--sysdeps/htl/sem-destroy.c37
-rw-r--r--sysdeps/htl/sem-getvalue.c32
-rw-r--r--sysdeps/htl/sem-init.c45
-rw-r--r--sysdeps/htl/sem-open.c31
-rw-r--r--sysdeps/htl/sem-post.c61
-rw-r--r--sysdeps/htl/sem-timedwait.c98
-rw-r--r--sysdeps/htl/sem-trywait.c41
-rw-r--r--sysdeps/htl/sem-unlink.c31
-rw-r--r--sysdeps/htl/sem-wait.c31
-rw-r--r--sysdeps/htl/shm-directory.h30
-rw-r--r--sysdeps/htl/threads.h1
-rw-r--r--sysdeps/htl/timer_routines.h46
-rw-r--r--sysdeps/hurd/htl/pt-kill.c51
-rw-r--r--sysdeps/hurd/include/hurd.h7
-rw-r--r--sysdeps/hurd/include/hurd/fd.h12
-rw-r--r--sysdeps/hurd/include/hurd/port.h11
-rw-r--r--sysdeps/hurd/include/hurd/signal.h18
-rw-r--r--sysdeps/hurd/stdc-predef.h63
-rw-r--r--sysdeps/i386/Implies1
-rw-r--r--sysdeps/i386/Makefile58
-rw-r--r--sysdeps/i386/__longjmp.S75
-rw-r--r--sysdeps/i386/add_n.S29
-rw-r--r--sysdeps/i386/addmul_1.S2
-rw-r--r--sysdeps/i386/asm-syntax.h2
-rw-r--r--sysdeps/i386/atomic-machine.h3
-rw-r--r--sysdeps/i386/backtrace.c2
-rw-r--r--sysdeps/i386/bsd-_setjmp.S23
-rw-r--r--sysdeps/i386/bsd-setjmp.S23
-rw-r--r--sysdeps/i386/cacheinfo.c2
-rw-r--r--sysdeps/i386/configure43
-rw-r--r--sysdeps/i386/configure.ac33
-rw-r--r--sysdeps/i386/crti.S8
-rw-r--r--sysdeps/i386/crtn.S2
-rw-r--r--sysdeps/i386/dl-cet.c67
-rw-r--r--sysdeps/i386/dl-irel.h2
-rw-r--r--sysdeps/i386/dl-lookupcfg.h5
-rw-r--r--sysdeps/i386/dl-machine.h72
-rw-r--r--sysdeps/i386/dl-procinfo.c39
-rw-r--r--sysdeps/i386/dl-procinfo.h109
-rw-r--r--sysdeps/i386/dl-tls.h5
-rw-r--r--sysdeps/i386/dl-tlsdesc.S13
-rw-r--r--sysdeps/i386/dl-tlsdesc.h5
-rw-r--r--sysdeps/i386/dl-trampoline.S74
-rw-r--r--sysdeps/i386/ffs.c2
-rw-r--r--sysdeps/i386/fpu/e_acosh.S2
-rw-r--r--sysdeps/i386/fpu/e_acoshf.S2
-rw-r--r--sysdeps/i386/fpu/e_acoshl.S2
-rw-r--r--sysdeps/i386/fpu/e_atanh.S2
-rw-r--r--sysdeps/i386/fpu/e_atanhf.S2
-rw-r--r--sysdeps/i386/fpu/e_atanhl.S3
-rw-r--r--sysdeps/i386/fpu/e_exp2f.S52
-rw-r--r--sysdeps/i386/fpu/e_expf.S74
-rw-r--r--sysdeps/i386/fpu/e_expl.S10
-rw-r--r--sysdeps/i386/fpu/e_hypot.S2
-rw-r--r--sysdeps/i386/fpu/e_hypotf.S2
-rw-r--r--sysdeps/i386/fpu/e_log10l.S1
-rw-r--r--sysdeps/i386/fpu/e_log2f.S69
-rw-r--r--sysdeps/i386/fpu/e_log2l.S1
-rw-r--r--sysdeps/i386/fpu/e_logf.S93
-rw-r--r--sysdeps/i386/fpu/e_logl.S1
-rw-r--r--sysdeps/i386/fpu/e_pow.S2
-rw-r--r--sysdeps/i386/fpu/e_powf.S392
-rw-r--r--sysdeps/i386/fpu/e_powl.S41
-rw-r--r--sysdeps/i386/fpu/e_scalbl.S16
-rw-r--r--sysdeps/i386/fpu/fclrexcpt.c4
-rw-r--r--sysdeps/i386/fpu/fedisblxcpt.c4
-rw-r--r--sysdeps/i386/fpu/feenablxcpt.c4
-rw-r--r--sysdeps/i386/fpu/fegetenv.c4
-rw-r--r--sysdeps/i386/fpu/fegetexcept.c2
-rw-r--r--sysdeps/i386/fpu/fegetmode.c32
-rw-r--r--sysdeps/i386/fpu/fegetround.c2
-rw-r--r--sysdeps/i386/fpu/feholdexcpt.c4
-rw-r--r--sysdeps/i386/fpu/fenv_private.h64
-rw-r--r--sysdeps/i386/fpu/fesetenv.c4
-rw-r--r--sysdeps/i386/fpu/fesetexcept.c31
-rw-r--r--sysdeps/i386/fpu/fesetmode.c54
-rw-r--r--sysdeps/i386/fpu/fesetround.c4
-rw-r--r--sysdeps/i386/fpu/feupdateenv.c4
-rw-r--r--sysdeps/i386/fpu/fgetexcptflg.c4
-rw-r--r--sysdeps/i386/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/i386/fpu/fsetexcptflg.c4
-rw-r--r--sysdeps/i386/fpu/ftestexcept.c4
-rw-r--r--sysdeps/i386/fpu/i386-math-asm.h2
-rw-r--r--sysdeps/i386/fpu/k_rem_pio2l.c3
-rw-r--r--sysdeps/i386/fpu/libm-test-ulps1396
-rw-r--r--sysdeps/i386/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/i386/fpu/math-tests.h2
-rw-r--r--sysdeps/i386/fpu/s_asinh.S5
-rw-r--r--sysdeps/i386/fpu/s_asinhf.S5
-rw-r--r--sysdeps/i386/fpu/s_asinhl.S6
-rw-r--r--sysdeps/i386/fpu/s_atan.S3
-rw-r--r--sysdeps/i386/fpu/s_atanf.S3
-rw-r--r--sysdeps/i386/fpu/s_atanl.c3
-rw-r--r--sysdeps/i386/fpu/s_cbrt.S5
-rw-r--r--sysdeps/i386/fpu/s_cbrtf.S5
-rw-r--r--sysdeps/i386/fpu/s_cbrtl.S6
-rw-r--r--sysdeps/i386/fpu/s_ceil.S15
-rw-r--r--sysdeps/i386/fpu/s_ceilf.S15
-rw-r--r--sysdeps/i386/fpu/s_ceill.S20
-rw-r--r--sysdeps/i386/fpu/s_copysign.S3
-rw-r--r--sysdeps/i386/fpu/s_copysignf.S3
-rw-r--r--sysdeps/i386/fpu/s_copysignl.S3
-rw-r--r--sysdeps/i386/fpu/s_expm1.S5
-rw-r--r--sysdeps/i386/fpu/s_expm1f.S5
-rw-r--r--sysdeps/i386/fpu/s_f32xaddf64.c42
-rw-r--r--sysdeps/i386/fpu/s_f32xdivf64.c29
-rw-r--r--sysdeps/i386/fpu/s_f32xmulf64.c29
-rw-r--r--sysdeps/i386/fpu/s_f32xsubf64.c42
-rw-r--r--sysdeps/i386/fpu/s_fabs.S3
-rw-r--r--sysdeps/i386/fpu/s_fabsf.S3
-rw-r--r--sysdeps/i386/fpu/s_fabsl.S3
-rw-r--r--sysdeps/i386/fpu/s_fdim.S51
-rw-r--r--sysdeps/i386/fpu/s_fdim.c48
-rw-r--r--sysdeps/i386/fpu/s_fdimf.S51
-rw-r--r--sysdeps/i386/fpu/s_fdiml.S51
-rw-r--r--sysdeps/i386/fpu/s_floor.S15
-rw-r--r--sysdeps/i386/fpu/s_floorf.S15
-rw-r--r--sysdeps/i386/fpu/s_floorl.S20
-rw-r--r--sysdeps/i386/fpu/s_fmax.S5
-rw-r--r--sysdeps/i386/fpu/s_fmaxf.S5
-rw-r--r--sysdeps/i386/fpu/s_fmaxl.S35
-rw-r--r--sysdeps/i386/fpu/s_fmin.S5
-rw-r--r--sysdeps/i386/fpu/s_fminf.S5
-rw-r--r--sysdeps/i386/fpu/s_fminl.S45
-rw-r--r--sysdeps/i386/fpu/s_fpclassifyl.c4
-rw-r--r--sysdeps/i386/fpu/s_frexp.S5
-rw-r--r--sysdeps/i386/fpu/s_frexpf.S5
-rw-r--r--sysdeps/i386/fpu/s_frexpl.S14
-rw-r--r--sysdeps/i386/fpu/s_isnanl.c4
-rw-r--r--sysdeps/i386/fpu/s_llrint.S5
-rw-r--r--sysdeps/i386/fpu/s_llrintf.S5
-rw-r--r--sysdeps/i386/fpu/s_llrintl.S5
-rw-r--r--sysdeps/i386/fpu/s_log1pl.S1
-rw-r--r--sysdeps/i386/fpu/s_logb.S3
-rw-r--r--sysdeps/i386/fpu/s_logbf.S3
-rw-r--r--sysdeps/i386/fpu/s_logbl.c3
-rw-r--r--sysdeps/i386/fpu/s_lrint.S5
-rw-r--r--sysdeps/i386/fpu/s_lrintf.S5
-rw-r--r--sysdeps/i386/fpu/s_lrintl.S5
-rw-r--r--sysdeps/i386/fpu/s_nearbyint.S7
-rw-r--r--sysdeps/i386/fpu/s_nearbyintf.S7
-rw-r--r--sysdeps/i386/fpu/s_nearbyintl.S7
-rw-r--r--sysdeps/i386/fpu/s_nextafterl.c10
-rw-r--r--sysdeps/i386/fpu/s_nexttoward.c3
-rw-r--r--sysdeps/i386/fpu/s_nexttowardf.c3
-rw-r--r--sysdeps/i386/fpu/s_remquo.S3
-rw-r--r--sysdeps/i386/fpu/s_remquof.S3
-rw-r--r--sysdeps/i386/fpu/s_remquol.S3
-rw-r--r--sysdeps/i386/fpu/s_rint.S3
-rw-r--r--sysdeps/i386/fpu/s_rintf.S3
-rw-r--r--sysdeps/i386/fpu/s_rintl.c3
-rw-r--r--sysdeps/i386/fpu/s_trunc.S17
-rw-r--r--sysdeps/i386/fpu/s_truncf.S17
-rw-r--r--sysdeps/i386/fpu/s_truncl.S20
-rw-r--r--sysdeps/i386/fpu/w_sqrt.c4
-rw-r--r--sysdeps/i386/fpu/w_sqrt_compat.c9
-rw-r--r--sysdeps/i386/gccframe.h2
-rw-r--r--sysdeps/i386/gmp-mparam.h2
-rw-r--r--sysdeps/i386/htl/bits/pthreadtypes-arch.h22
-rw-r--r--sysdeps/i386/htl/machine-sp.h29
-rw-r--r--sysdeps/i386/htl/pt-machdep.h28
-rw-r--r--sysdeps/i386/htonl.S2
-rw-r--r--sysdeps/i386/htons.S2
-rw-r--r--sysdeps/i386/i386-mcount.S4
-rw-r--r--sysdeps/i386/i586/add_n.S2
-rw-r--r--sysdeps/i386/i586/addmul_1.S2
-rw-r--r--sysdeps/i386/i586/init-arch.h2
-rw-r--r--sysdeps/i386/i586/lshift.S2
-rw-r--r--sysdeps/i386/i586/memcopy.h2
-rw-r--r--sysdeps/i386/i586/memcpy.S2
-rw-r--r--sysdeps/i386/i586/memset.S9
-rw-r--r--sysdeps/i386/i586/mul_1.S2
-rw-r--r--sysdeps/i386/i586/rshift.S2
-rw-r--r--sysdeps/i386/i586/strchr.S2
-rw-r--r--sysdeps/i386/i586/strcpy.S30
-rw-r--r--sysdeps/i386/i586/strlen.S2
-rw-r--r--sysdeps/i386/i586/sub_n.S2
-rw-r--r--sysdeps/i386/i586/submul_1.S2
-rw-r--r--sysdeps/i386/i686/Makefile2
-rw-r--r--sysdeps/i386/i686/add_n.S29
-rw-r--r--sysdeps/i386/i686/dl-hash.h3
-rw-r--r--sysdeps/i386/i686/ffs.c2
-rw-r--r--sysdeps/i386/i686/fpu/e_logf.S30
-rw-r--r--sysdeps/i386/i686/fpu/e_logl.S1
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/Makefile10
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c3
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_exp2f.c39
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S22
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S325
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c3
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_expf.c39
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c3
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_log2f.c42
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c3
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_logf.c42
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c3
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/e_powf.c45
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/libm-test-ulps1388
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/libm-test-ulps-name1
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.S5
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/s_cosf.c5
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/s_sincosf-sse2.S5
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/s_sincosf.c5
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S5
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/s_sinf.c5
-rw-r--r--sysdeps/i386/i686/fpu/s_fdim.S43
-rw-r--r--sysdeps/i386/i686/fpu/s_fdimf.S43
-rw-r--r--sysdeps/i386/i686/fpu/s_fdiml.S43
-rw-r--r--sysdeps/i386/i686/fpu/s_fmax.S5
-rw-r--r--sysdeps/i386/i686/fpu/s_fmaxf.S5
-rw-r--r--sysdeps/i386/i686/fpu/s_fmaxl.S34
-rw-r--r--sysdeps/i386/i686/fpu/s_fmin.S5
-rw-r--r--sysdeps/i386/i686/fpu/s_fminf.S5
-rw-r--r--sysdeps/i386/i686/fpu/s_fminl.S32
-rw-r--r--sysdeps/i386/i686/hp-timing.h2
-rw-r--r--sysdeps/i386/i686/init-arch.h2
-rw-r--r--sysdeps/i386/i686/memcmp.S6
-rw-r--r--sysdeps/i386/i686/memcpy.S2
-rw-r--r--sysdeps/i386/i686/memmove.S2
-rw-r--r--sysdeps/i386/i686/mempcpy.S2
-rw-r--r--sysdeps/i386/i686/memset.S9
-rw-r--r--sysdeps/i386/i686/memusage.h2
-rw-r--r--sysdeps/i386/i686/multiarch/Makefile14
-rw-r--r--sysdeps/i386/i686/multiarch/bcopy-ia32.S20
-rw-r--r--sysdeps/i386/i686/multiarch/bcopy.S59
-rw-r--r--sysdeps/i386/i686/multiarch/bcopy.c30
-rw-r--r--sysdeps/i386/i686/multiarch/bzero-ia32.S38
-rw-r--r--sysdeps/i386/i686/multiarch/bzero.S62
-rw-r--r--sysdeps/i386/i686/multiarch/bzero.c32
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-defines.sym19
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-impl-list.c6
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-memmove.h45
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-memset.h40
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h40
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h40
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-sse2.h34
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-sse4_2.h34
-rw-r--r--sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h39
-rw-r--r--sysdeps/i386/i686/multiarch/memchr-ia32.S35
-rw-r--r--sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S12
-rw-r--r--sysdeps/i386/i686/multiarch/memchr-sse2.S12
-rw-r--r--sysdeps/i386/i686/multiarch/memchr.S65
-rw-r--r--sysdeps/i386/i686/multiarch/memchr.c32
-rw-r--r--sysdeps/i386/i686/multiarch/memcmp-ia32.S35
-rw-r--r--sysdeps/i386/i686/multiarch/memcmp-sse4.S8
-rw-r--r--sysdeps/i386/i686/multiarch/memcmp-ssse3.S2
-rw-r--r--sysdeps/i386/i686/multiarch/memcmp.S62
-rw-r--r--sysdeps/i386/i686/multiarch/memcmp.c32
-rw-r--r--sysdeps/i386/i686/multiarch/memcpy-ia32.S31
-rw-r--r--sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S22
-rw-r--r--sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S18
-rw-r--r--sysdeps/i386/i686/multiarch/memcpy-ssse3.S44
-rw-r--r--sysdeps/i386/i686/multiarch/memcpy.S78
-rw-r--r--sysdeps/i386/i686/multiarch/memcpy.c32
-rw-r--r--sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S21
-rw-r--r--sysdeps/i386/i686/multiarch/memcpy_chk.S50
-rw-r--r--sysdeps/i386/i686/multiarch/memcpy_chk.c31
-rw-r--r--sysdeps/i386/i686/multiarch/memmove-ia32.S31
-rw-r--r--sysdeps/i386/i686/multiarch/memmove.S89
-rw-r--r--sysdeps/i386/i686/multiarch/memmove.c32
-rw-r--r--sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S21
-rw-r--r--sysdeps/i386/i686/multiarch/memmove_chk.S94
-rw-r--r--sysdeps/i386/i686/multiarch/memmove_chk.c31
-rw-r--r--sysdeps/i386/i686/multiarch/mempcpy-ia32.S37
-rw-r--r--sysdeps/i386/i686/multiarch/mempcpy.S81
-rw-r--r--sysdeps/i386/i686/multiarch/mempcpy.c38
-rw-r--r--sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S21
-rw-r--r--sysdeps/i386/i686/multiarch/mempcpy_chk.S50
-rw-r--r--sysdeps/i386/i686/multiarch/mempcpy_chk.c31
-rw-r--r--sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S2
-rw-r--r--sysdeps/i386/i686/multiarch/memrchr-sse2.S2
-rw-r--r--sysdeps/i386/i686/multiarch/memrchr.S45
-rw-r--r--sysdeps/i386/i686/multiarch/memrchr.c32
-rw-r--r--sysdeps/i386/i686/multiarch/memset-ia32.S33
-rw-r--r--sysdeps/i386/i686/multiarch/memset-sse2-rep.S12
-rw-r--r--sysdeps/i386/i686/multiarch/memset-sse2.S14
-rw-r--r--sysdeps/i386/i686/multiarch/memset.S75
-rw-r--r--sysdeps/i386/i686/multiarch/memset.c30
-rw-r--r--sysdeps/i386/i686/multiarch/memset_chk-nonshared.S21
-rw-r--r--sysdeps/i386/i686/multiarch/memset_chk.S82
-rw-r--r--sysdeps/i386/i686/multiarch/memset_chk.c32
-rw-r--r--sysdeps/i386/i686/multiarch/rawmemchr-ia32.S35
-rw-r--r--sysdeps/i386/i686/multiarch/rawmemchr.S65
-rw-r--r--sysdeps/i386/i686/multiarch/rawmemchr.c35
-rw-r--r--sysdeps/i386/i686/multiarch/s_fma-fma.c2
-rw-r--r--sysdeps/i386/i686/multiarch/s_fma.c5
-rw-r--r--sysdeps/i386/i686/multiarch/s_fmaf-fma.c2
-rw-r--r--sysdeps/i386/i686/multiarch/s_fmaf.c5
-rw-r--r--sysdeps/i386/i686/multiarch/stpcpy-ia32.S39
-rw-r--r--sysdeps/i386/i686/multiarch/stpcpy.S9
-rw-r--r--sysdeps/i386/i686/multiarch/stpcpy.c36
-rw-r--r--sysdeps/i386/i686/multiarch/stpncpy-ia32.S37
-rw-r--r--sysdeps/i386/i686/multiarch/stpncpy.S8
-rw-r--r--sysdeps/i386/i686/multiarch/stpncpy.c34
-rw-r--r--sysdeps/i386/i686/multiarch/strcasecmp.S39
-rw-r--r--sysdeps/i386/i686/multiarch/strcasecmp.c35
-rw-r--r--sysdeps/i386/i686/multiarch/strcasecmp_l.S7
-rw-r--r--sysdeps/i386/i686/multiarch/strcasecmp_l.c35
-rw-r--r--sysdeps/i386/i686/multiarch/strcat-ia32.S33
-rw-r--r--sysdeps/i386/i686/multiarch/strcat-sse2.S10
-rw-r--r--sysdeps/i386/i686/multiarch/strcat-ssse3.S2
-rw-r--r--sysdeps/i386/i686/multiarch/strcat.S92
-rw-r--r--sysdeps/i386/i686/multiarch/strcat.c30
-rw-r--r--sysdeps/i386/i686/multiarch/strchr-ia32.S35
-rw-r--r--sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S2
-rw-r--r--sysdeps/i386/i686/multiarch/strchr-sse2.S2
-rw-r--r--sysdeps/i386/i686/multiarch/strchr.S57
-rw-r--r--sysdeps/i386/i686/multiarch/strchr.c32
-rw-r--r--sysdeps/i386/i686/multiarch/strcmp-ia32.S33
-rw-r--r--sysdeps/i386/i686/multiarch/strcmp-sse4.S2
-rw-r--r--sysdeps/i386/i686/multiarch/strcmp-ssse3.S2
-rw-r--r--sysdeps/i386/i686/multiarch/strcmp.S95
-rw-r--r--sysdeps/i386/i686/multiarch/strcmp.c30
-rw-r--r--sysdeps/i386/i686/multiarch/strcpy-ia32.S33
-rw-r--r--sysdeps/i386/i686/multiarch/strcpy-sse2.S8
-rw-r--r--sysdeps/i386/i686/multiarch/strcpy-ssse3.S2
-rw-r--r--sysdeps/i386/i686/multiarch/strcpy.S116
-rw-r--r--sysdeps/i386/i686/multiarch/strcpy.c30
-rw-r--r--sysdeps/i386/i686/multiarch/strcspn-c.c6
-rw-r--r--sysdeps/i386/i686/multiarch/strcspn-ia32.S33
-rw-r--r--sysdeps/i386/i686/multiarch/strcspn.S75
-rw-r--r--sysdeps/i386/i686/multiarch/strcspn.c30
-rw-r--r--sysdeps/i386/i686/multiarch/strlen-ia32.S30
-rw-r--r--sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S2
-rw-r--r--sysdeps/i386/i686/multiarch/strlen-sse2.S2
-rw-r--r--sysdeps/i386/i686/multiarch/strlen.S60
-rw-r--r--sysdeps/i386/i686/multiarch/strlen.c30
-rw-r--r--sysdeps/i386/i686/multiarch/strncase.S39
-rw-r--r--sysdeps/i386/i686/multiarch/strncase.c35
-rw-r--r--sysdeps/i386/i686/multiarch/strncase_l.S7
-rw-r--r--sysdeps/i386/i686/multiarch/strncase_l.c35
-rw-r--r--sysdeps/i386/i686/multiarch/strncat-c.c7
-rw-r--r--sysdeps/i386/i686/multiarch/strncat.S5
-rw-r--r--sysdeps/i386/i686/multiarch/strncat.c30
-rw-r--r--sysdeps/i386/i686/multiarch/strncmp-c.c2
-rw-r--r--sysdeps/i386/i686/multiarch/strncmp.S5
-rw-r--r--sysdeps/i386/i686/multiarch/strncmp.c30
-rw-r--r--sysdeps/i386/i686/multiarch/strncpy.S5
-rw-r--r--sysdeps/i386/i686/multiarch/strncpy.c30
-rw-r--r--sysdeps/i386/i686/multiarch/strnlen.S37
-rw-r--r--sysdeps/i386/i686/multiarch/strnlen.c34
-rw-r--r--sysdeps/i386/i686/multiarch/strpbrk-ia32.S33
-rw-r--r--sysdeps/i386/i686/multiarch/strpbrk.S5
-rw-r--r--sysdeps/i386/i686/multiarch/strpbrk.c30
-rw-r--r--sysdeps/i386/i686/multiarch/strrchr-ia32.S35
-rw-r--r--sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S2
-rw-r--r--sysdeps/i386/i686/multiarch/strrchr-sse2.S2
-rw-r--r--sysdeps/i386/i686/multiarch/strrchr.S57
-rw-r--r--sysdeps/i386/i686/multiarch/strrchr.c32
-rw-r--r--sysdeps/i386/i686/multiarch/strspn-ia32.S33
-rw-r--r--sysdeps/i386/i686/multiarch/strspn.S56
-rw-r--r--sysdeps/i386/i686/multiarch/strspn.c30
-rw-r--r--sysdeps/i386/i686/multiarch/varshift.c4
-rw-r--r--sysdeps/i386/i686/multiarch/wcschr-sse2.S2
-rw-r--r--sysdeps/i386/i686/multiarch/wcschr.S36
-rw-r--r--sysdeps/i386/i686/multiarch/wcschr.c33
-rw-r--r--sysdeps/i386/i686/multiarch/wcscmp-sse2.S2
-rw-r--r--sysdeps/i386/i686/multiarch/wcscmp.S39
-rw-r--r--sysdeps/i386/i686/multiarch/wcscmp.c33
-rw-r--r--sysdeps/i386/i686/multiarch/wcscpy-ssse3.S2
-rw-r--r--sysdeps/i386/i686/multiarch/wcscpy.S36
-rw-r--r--sysdeps/i386/i686/multiarch/wcscpy.c44
-rw-r--r--sysdeps/i386/i686/multiarch/wcslen-sse2.S2
-rw-r--r--sysdeps/i386/i686/multiarch/wcslen.S37
-rw-r--r--sysdeps/i386/i686/multiarch/wcslen.c31
-rw-r--r--sysdeps/i386/i686/multiarch/wcsrchr-sse2.S2
-rw-r--r--sysdeps/i386/i686/multiarch/wcsrchr.S35
-rw-r--r--sysdeps/i386/i686/multiarch/wcsrchr.c30
-rw-r--r--sysdeps/i386/i686/multiarch/wmemcmp.S40
-rw-r--r--sysdeps/i386/i686/multiarch/wmemcmp.c30
-rw-r--r--sysdeps/i386/i686/nptl/tls.h2
-rw-r--r--sysdeps/i386/i686/pthread_spin_trylock.S2
-rw-r--r--sysdeps/i386/i686/stack-aliasing.h7
-rw-r--r--sysdeps/i386/i686/strcmp.S2
-rw-r--r--sysdeps/i386/i686/strtok.S244
-rw-r--r--sysdeps/i386/i686/strtok_r.S5
-rw-r--r--sysdeps/i386/i686/tst-stack-align.h2
-rw-r--r--sysdeps/i386/init-arch.h2
-rw-r--r--sysdeps/i386/jmpbuf-offsets.h2
-rw-r--r--sysdeps/i386/jmpbuf-unwind.h2
-rw-r--r--sysdeps/i386/ldbl2mpn.c2
-rw-r--r--sysdeps/i386/ldsodefs.h41
-rw-r--r--sysdeps/i386/lshift.S2
-rw-r--r--sysdeps/i386/machine-gmon.h10
-rw-r--r--sysdeps/i386/malloc-alignment.h24
-rw-r--r--sysdeps/i386/memchr.S2
-rw-r--r--sysdeps/i386/memcmp.S2
-rw-r--r--sysdeps/i386/memcopy.h2
-rw-r--r--sysdeps/i386/memcpy.S2
-rw-r--r--sysdeps/i386/memcpy_chk.S2
-rw-r--r--sysdeps/i386/memmove_chk.S2
-rw-r--r--sysdeps/i386/mempcpy_chk.S2
-rw-r--r--sysdeps/i386/memset.S2
-rw-r--r--sysdeps/i386/memset_chk.S2
-rw-r--r--sysdeps/i386/memusage.h2
-rw-r--r--sysdeps/i386/mul_1.S2
-rw-r--r--sysdeps/i386/nptl/Makefile8
-rw-r--r--sysdeps/i386/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/i386/nptl/pthread_spin_init.c2
-rw-r--r--sysdeps/i386/nptl/pthread_spin_lock.S2
-rw-r--r--sysdeps/i386/nptl/pthread_spin_unlock.S2
-rw-r--r--sysdeps/i386/nptl/pthreaddef.h2
-rw-r--r--sysdeps/i386/nptl/tcb-offsets.sym6
-rw-r--r--sysdeps/i386/nptl/tls.h52
-rw-r--r--sysdeps/i386/pthread_spin_trylock.S2
-rw-r--r--sysdeps/i386/rawmemchr.S2
-rw-r--r--sysdeps/i386/rshift.S2
-rw-r--r--sysdeps/i386/setfpucw.c4
-rw-r--r--sysdeps/i386/setjmp.S23
-rw-r--r--sysdeps/i386/stackinfo.h2
-rw-r--r--sysdeps/i386/start.S16
-rw-r--r--sysdeps/i386/stpcpy.S2
-rw-r--r--sysdeps/i386/stpncpy.S2
-rw-r--r--sysdeps/i386/strcat.S2
-rw-r--r--sysdeps/i386/strchr.S2
-rw-r--r--sysdeps/i386/strchrnul.S2
-rw-r--r--sysdeps/i386/strcspn.S2
-rw-r--r--sysdeps/i386/string-inlines.c206
-rw-r--r--sysdeps/i386/strlen.S2
-rw-r--r--sysdeps/i386/strlen.c2
-rw-r--r--sysdeps/i386/strpbrk.S2
-rw-r--r--sysdeps/i386/strrchr.S2
-rw-r--r--sysdeps/i386/strspn.S2
-rw-r--r--sysdeps/i386/strtok.S358
-rw-r--r--sysdeps/i386/strtok_r.S5
-rw-r--r--sysdeps/i386/sub_n.S28
-rw-r--r--sysdeps/i386/submul_1.S2
-rw-r--r--sysdeps/i386/symbol-hacks.h21
-rw-r--r--sysdeps/i386/sys/ucontext.h103
-rw-r--r--sysdeps/i386/sysdep.h47
-rw-r--r--sysdeps/i386/tlsdesc.c3
-rw-r--r--sysdeps/i386/tst-audit.h2
-rw-r--r--sysdeps/i386/tst-audit3.c2
-rw-r--r--sysdeps/i386/tst-audit3.h2
-rw-r--r--sysdeps/i386/tst-auditmod3a.c2
-rw-r--r--sysdeps/i386/tst-auditmod3b.c2
-rwxr-xr-xsysdeps/i386/tst-ld-sse-use.sh2
-rw-r--r--sysdeps/i386/tst-stack-align.h2
-rw-r--r--sysdeps/ia64/Implies1
-rw-r--r--sysdeps/ia64/Makeconfig2
-rw-r--r--sysdeps/ia64/Makefile5
-rw-r--r--sysdeps/ia64/_mcount.S2
-rw-r--r--sysdeps/ia64/atomic-machine.h5
-rw-r--r--sysdeps/ia64/backtrace.c1
-rw-r--r--sysdeps/ia64/bits/byteswap-16.h42
-rw-r--r--sysdeps/ia64/bits/byteswap.h100
-rw-r--r--sysdeps/ia64/bits/fenv.h10
-rw-r--r--sysdeps/ia64/bits/floatn.h119
-rw-r--r--sysdeps/ia64/bits/fp-logb.h24
-rw-r--r--sysdeps/ia64/bits/huge_vall.h41
-rw-r--r--sysdeps/ia64/bits/link.h2
-rw-r--r--sysdeps/ia64/bits/mathdef.h36
-rw-r--r--sysdeps/ia64/bits/xtitypes.h2
-rw-r--r--sysdeps/ia64/bzero.S2
-rw-r--r--sysdeps/ia64/crti.S4
-rw-r--r--sysdeps/ia64/crtn.S2
-rw-r--r--sysdeps/ia64/dl-dtprocnum.h2
-rw-r--r--sysdeps/ia64/dl-fptr.h2
-rw-r--r--sysdeps/ia64/dl-lookupcfg.h2
-rw-r--r--sysdeps/ia64/dl-machine.h9
-rw-r--r--sysdeps/ia64/dl-sysdep.h2
-rw-r--r--sysdeps/ia64/dl-tls.h5
-rw-r--r--sysdeps/ia64/dl-trampoline.S2
-rw-r--r--sysdeps/ia64/float128-abi.h2
-rw-r--r--sysdeps/ia64/fpu/bits/math-finite.h2
-rw-r--r--sysdeps/ia64/fpu/bits/mathinline.h53
-rw-r--r--sysdeps/ia64/fpu/e_acos.S1
-rw-r--r--sysdeps/ia64/fpu/e_acosf.S1
-rw-r--r--sysdeps/ia64/fpu/e_acosh.S1
-rw-r--r--sysdeps/ia64/fpu/e_acoshf.S1
-rw-r--r--sysdeps/ia64/fpu/e_acoshl.S1
-rw-r--r--sysdeps/ia64/fpu/e_acosl.S1
-rw-r--r--sysdeps/ia64/fpu/e_asin.S1
-rw-r--r--sysdeps/ia64/fpu/e_asinf.S1
-rw-r--r--sysdeps/ia64/fpu/e_asinl.S1
-rw-r--r--sysdeps/ia64/fpu/e_atan2.S1
-rw-r--r--sysdeps/ia64/fpu/e_atan2f.S1
-rw-r--r--sysdeps/ia64/fpu/e_atanh.S1
-rw-r--r--sysdeps/ia64/fpu/e_atanhf.S1
-rw-r--r--sysdeps/ia64/fpu/e_atanhl.S1
-rw-r--r--sysdeps/ia64/fpu/e_cosh.S1
-rw-r--r--sysdeps/ia64/fpu/e_coshf.S1
-rw-r--r--sysdeps/ia64/fpu/e_coshl.S1
-rw-r--r--sysdeps/ia64/fpu/e_exp.S1
-rw-r--r--sysdeps/ia64/fpu/e_exp10.S7
-rw-r--r--sysdeps/ia64/fpu/e_exp10f.S7
-rw-r--r--sysdeps/ia64/fpu/e_exp10l.S7
-rw-r--r--sysdeps/ia64/fpu/e_exp2.S1
-rw-r--r--sysdeps/ia64/fpu/e_exp2f.S11
-rw-r--r--sysdeps/ia64/fpu/e_exp2f_data.c (renamed from sysdeps/i386/fpu/halfulp.c)0
-rw-r--r--sysdeps/ia64/fpu/e_exp2l.S1
-rw-r--r--sysdeps/ia64/fpu/e_expf.S7
-rw-r--r--sysdeps/ia64/fpu/e_fmod.S1
-rw-r--r--sysdeps/ia64/fpu/e_fmodf.S1
-rw-r--r--sysdeps/ia64/fpu/e_fmodl.S1
-rw-r--r--sysdeps/ia64/fpu/e_hypot.S1
-rw-r--r--sysdeps/ia64/fpu/e_hypotf.S1
-rw-r--r--sysdeps/ia64/fpu/e_hypotl.S1
-rw-r--r--sysdeps/ia64/fpu/e_lgamma_r.c2
-rw-r--r--sysdeps/ia64/fpu/e_lgammaf_r.c2
-rw-r--r--sysdeps/ia64/fpu/e_lgammal_r.c2
-rw-r--r--sysdeps/ia64/fpu/e_log.S2
-rw-r--r--sysdeps/ia64/fpu/e_log2.S1
-rw-r--r--sysdeps/ia64/fpu/e_log2f.S11
-rw-r--r--sysdeps/ia64/fpu/e_log2f_data.c (renamed from sysdeps/i386/fpu/mpexp.c)0
-rw-r--r--sysdeps/ia64/fpu/e_log2l.S1
-rw-r--r--sysdeps/ia64/fpu/e_logf.S8
-rw-r--r--sysdeps/ia64/fpu/e_logf_data.c (renamed from sysdeps/i386/fpu/mplog.c)0
-rw-r--r--sysdeps/ia64/fpu/e_logl.S2
-rw-r--r--sysdeps/ia64/fpu/e_pow.S1
-rw-r--r--sysdeps/ia64/fpu/e_powf.S11
-rw-r--r--sysdeps/ia64/fpu/e_powf_log2_data.c (renamed from sysdeps/i386/fpu/slowexp.c)0
-rw-r--r--sysdeps/ia64/fpu/e_powl.S1
-rw-r--r--sysdeps/ia64/fpu/e_remainder.S1
-rw-r--r--sysdeps/ia64/fpu/e_remainderf.S1
-rw-r--r--sysdeps/ia64/fpu/e_remainderl.S1
-rw-r--r--sysdeps/ia64/fpu/e_sinh.S1
-rw-r--r--sysdeps/ia64/fpu/e_sinhf.S1
-rw-r--r--sysdeps/ia64/fpu/e_sinhl.S1
-rw-r--r--sysdeps/ia64/fpu/e_sqrt.S1
-rw-r--r--sysdeps/ia64/fpu/e_sqrtf.S1
-rw-r--r--sysdeps/ia64/fpu/e_sqrtf128.c1
-rw-r--r--sysdeps/ia64/fpu/e_sqrtl.S1
-rw-r--r--sysdeps/ia64/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/ia64/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/ia64/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/ia64/fpu/fegetenv.c2
-rw-r--r--sysdeps/ia64/fpu/fegetexcept.c2
-rw-r--r--sysdeps/ia64/fpu/fegetmode.c26
-rw-r--r--sysdeps/ia64/fpu/fegetround.c2
-rw-r--r--sysdeps/ia64/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/ia64/fpu/fesetenv.c2
-rw-r--r--sysdeps/ia64/fpu/fesetexcept.c31
-rw-r--r--sysdeps/ia64/fpu/fesetmode.c42
-rw-r--r--sysdeps/ia64/fpu/fesetround.c2
-rw-r--r--sysdeps/ia64/fpu/feupdateenv.c2
-rw-r--r--sysdeps/ia64/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/ia64/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/ia64/fpu/fsetexcptflg.c2
-rw-r--r--sysdeps/ia64/fpu/ftestexcept.c2
-rw-r--r--sysdeps/ia64/fpu/get-rounding-mode.h2
-rw-r--r--sysdeps/ia64/fpu/lgamma-compat.h2
-rw-r--r--sysdeps/ia64/fpu/libm-symbols.h42
-rw-r--r--sysdeps/ia64/fpu/libm-test-ulps1978
-rw-r--r--sysdeps/ia64/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/ia64/fpu/libm_error.c8
-rw-r--r--sysdeps/ia64/fpu/libm_sincos.S1
-rw-r--r--sysdeps/ia64/fpu/libm_sincosf.S1
-rw-r--r--sysdeps/ia64/fpu/libm_sincosl.S1
-rw-r--r--sysdeps/ia64/fpu/libm_support.h39
-rw-r--r--sysdeps/ia64/fpu/math_errf.c (renamed from sysdeps/i386/fpu/slowpow.c)0
-rw-r--r--sysdeps/ia64/fpu/math_ldbl.h40
-rw-r--r--sysdeps/ia64/fpu/printf_fphex.c2
-rw-r--r--sysdeps/ia64/fpu/s_asinh.S1
-rw-r--r--sysdeps/ia64/fpu/s_asinhf.S1
-rw-r--r--sysdeps/ia64/fpu/s_asinhl.S1
-rw-r--r--sysdeps/ia64/fpu/s_atan.S1
-rw-r--r--sysdeps/ia64/fpu/s_atanf.S1
-rw-r--r--sysdeps/ia64/fpu/s_atanl.S2
-rw-r--r--sysdeps/ia64/fpu/s_cbrt.S1
-rw-r--r--sysdeps/ia64/fpu/s_cbrtf.S1
-rw-r--r--sysdeps/ia64/fpu/s_cbrtl.S1
-rw-r--r--sysdeps/ia64/fpu/s_ceil.S1
-rw-r--r--sysdeps/ia64/fpu/s_ceilf.S1
-rw-r--r--sysdeps/ia64/fpu/s_ceill.S1
-rw-r--r--sysdeps/ia64/fpu/s_copysign.S8
-rw-r--r--sysdeps/ia64/fpu/s_cos.S2
-rw-r--r--sysdeps/ia64/fpu/s_cosf.S2
-rw-r--r--sysdeps/ia64/fpu/s_cosl.S2
-rw-r--r--sysdeps/ia64/fpu/s_erf.S1
-rw-r--r--sysdeps/ia64/fpu/s_erfc.S1
-rw-r--r--sysdeps/ia64/fpu/s_erfcf.S1
-rw-r--r--sysdeps/ia64/fpu/s_erfcl.S1
-rw-r--r--sysdeps/ia64/fpu/s_erff.S1
-rw-r--r--sysdeps/ia64/fpu/s_erfl.S1
-rw-r--r--sysdeps/ia64/fpu/s_expm1.S1
-rw-r--r--sysdeps/ia64/fpu/s_expm1f.S1
-rw-r--r--sysdeps/ia64/fpu/s_expm1l.S2
-rw-r--r--sysdeps/ia64/fpu/s_fabs.S1
-rw-r--r--sysdeps/ia64/fpu/s_fabsf.S1
-rw-r--r--sysdeps/ia64/fpu/s_fabsl.S1
-rw-r--r--sysdeps/ia64/fpu/s_fdim.S1
-rw-r--r--sysdeps/ia64/fpu/s_fdimf.S1
-rw-r--r--sysdeps/ia64/fpu/s_fdiml.S1
-rw-r--r--sysdeps/ia64/fpu/s_finite.S2
-rw-r--r--sysdeps/ia64/fpu/s_floor.S1
-rw-r--r--sysdeps/ia64/fpu/s_floorf.S1
-rw-r--r--sysdeps/ia64/fpu/s_floorl.S1
-rw-r--r--sysdeps/ia64/fpu/s_fma.S1
-rw-r--r--sysdeps/ia64/fpu/s_fmaf.S1
-rw-r--r--sysdeps/ia64/fpu/s_fmal.S1
-rw-r--r--sysdeps/ia64/fpu/s_fmax.S1
-rw-r--r--sysdeps/ia64/fpu/s_fmaxf.S1
-rw-r--r--sysdeps/ia64/fpu/s_fmaxl.S1
-rw-r--r--sysdeps/ia64/fpu/s_fpclassify.S2
-rw-r--r--sysdeps/ia64/fpu/s_frexp.c1
-rw-r--r--sysdeps/ia64/fpu/s_frexpf.c1
-rw-r--r--sysdeps/ia64/fpu/s_frexpl.c1
-rw-r--r--sysdeps/ia64/fpu/s_isinf.S2
-rw-r--r--sysdeps/ia64/fpu/s_isnan.S2
-rw-r--r--sysdeps/ia64/fpu/s_ldexp.c1
-rw-r--r--sysdeps/ia64/fpu/s_ldexpf.c1
-rw-r--r--sysdeps/ia64/fpu/s_ldexpl.c1
-rw-r--r--sysdeps/ia64/fpu/s_log1p.S1
-rw-r--r--sysdeps/ia64/fpu/s_log1pf.S1
-rw-r--r--sysdeps/ia64/fpu/s_log1pl.S1
-rw-r--r--sysdeps/ia64/fpu/s_logb.S1
-rw-r--r--sysdeps/ia64/fpu/s_logbf.S1
-rw-r--r--sysdeps/ia64/fpu/s_logbl.S1
-rw-r--r--sysdeps/ia64/fpu/s_matherrf.c5
-rw-r--r--sysdeps/ia64/fpu/s_matherrl.c5
-rw-r--r--sysdeps/ia64/fpu/s_modf.S1
-rw-r--r--sysdeps/ia64/fpu/s_modff.S1
-rw-r--r--sysdeps/ia64/fpu/s_modfl.S1
-rw-r--r--sysdeps/ia64/fpu/s_nearbyint.S1
-rw-r--r--sysdeps/ia64/fpu/s_nearbyintf.S1
-rw-r--r--sysdeps/ia64/fpu/s_nearbyintl.S2
-rw-r--r--sysdeps/ia64/fpu/s_nextafter.S1
-rw-r--r--sysdeps/ia64/fpu/s_nextafterf.S1
-rw-r--r--sysdeps/ia64/fpu/s_nextafterl.S1
-rw-r--r--sysdeps/ia64/fpu/s_rint.S1
-rw-r--r--sysdeps/ia64/fpu/s_rintf.S1
-rw-r--r--sysdeps/ia64/fpu/s_rintl.S1
-rw-r--r--sysdeps/ia64/fpu/s_round.S1
-rw-r--r--sysdeps/ia64/fpu/s_roundf.S1
-rw-r--r--sysdeps/ia64/fpu/s_roundl.S1
-rw-r--r--sysdeps/ia64/fpu/s_scalblnf.c1
-rw-r--r--sysdeps/ia64/fpu/s_scalbn.c2
-rw-r--r--sysdeps/ia64/fpu/s_scalbnf.c2
-rw-r--r--sysdeps/ia64/fpu/s_scalbnl.c2
-rw-r--r--sysdeps/ia64/fpu/s_signbit.S2
-rw-r--r--sysdeps/ia64/fpu/s_tan.S1
-rw-r--r--sysdeps/ia64/fpu/s_tanf.S1
-rw-r--r--sysdeps/ia64/fpu/s_tanh.S1
-rw-r--r--sysdeps/ia64/fpu/s_tanhf.S1
-rw-r--r--sysdeps/ia64/fpu/s_tanhl.S1
-rw-r--r--sysdeps/ia64/fpu/s_tanl.S1
-rw-r--r--sysdeps/ia64/fpu/s_trunc.S1
-rw-r--r--sysdeps/ia64/fpu/s_truncf.S1
-rw-r--r--sysdeps/ia64/fpu/s_truncl.S1
-rw-r--r--sysdeps/ia64/fpu/sfp-machine.h100
-rw-r--r--sysdeps/ia64/fpu/w_acos.c2
-rw-r--r--sysdeps/ia64/fpu/w_acos_compat.c (renamed from sysdeps/ia64/fpu/k_rem_pio2.c)0
-rw-r--r--sysdeps/ia64/fpu/w_acosf_compat.c (renamed from sysdeps/ia64/fpu/halfulp.c)0
-rw-r--r--sysdeps/ia64/fpu/w_acosh.c2
-rw-r--r--sysdeps/ia64/fpu/w_acosh_compat.c (renamed from sysdeps/ia64/fpu/k_rem_pio2l.c)0
-rw-r--r--sysdeps/ia64/fpu/w_acoshf.c2
-rw-r--r--sysdeps/ia64/fpu/w_acoshf_compat.c (renamed from sysdeps/ia64/fpu/w_scalb.c)0
-rw-r--r--sysdeps/ia64/fpu/w_acoshl.c2
-rw-r--r--sysdeps/ia64/fpu/w_acoshl_compat.c (renamed from sysdeps/ia64/fpu/w_scalbf.c)0
-rw-r--r--sysdeps/ia64/fpu/w_acosl_compat.c (renamed from sysdeps/ia64/fpu/mpexp.c)0
-rw-r--r--sysdeps/ia64/fpu/w_asin.c2
-rw-r--r--sysdeps/ia64/fpu/w_asin_compat.c (renamed from sysdeps/ia64/fpu/w_scalbl.c)0
-rw-r--r--sysdeps/ia64/fpu/w_asinf.c2
-rw-r--r--sysdeps/ia64/fpu/w_asinf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_asinl.c2
-rw-r--r--sysdeps/ia64/fpu/w_asinl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_atan2.c2
-rw-r--r--sysdeps/ia64/fpu/w_atan2_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_atan2f.c2
-rw-r--r--sysdeps/ia64/fpu/w_atan2f_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_atan2l.c2
-rw-r--r--sysdeps/ia64/fpu/w_atan2l_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_atanh.c2
-rw-r--r--sysdeps/ia64/fpu/w_atanh_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_atanhf.c2
-rw-r--r--sysdeps/ia64/fpu/w_atanhf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_atanhl.c2
-rw-r--r--sysdeps/ia64/fpu/w_atanhl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_cosh.c2
-rw-r--r--sysdeps/ia64/fpu/w_cosh_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_coshf.c2
-rw-r--r--sysdeps/ia64/fpu/w_coshf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_coshl.c2
-rw-r--r--sysdeps/ia64/fpu/w_coshl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_exp.c2
-rw-r--r--sysdeps/ia64/fpu/w_exp10.c2
-rw-r--r--sysdeps/ia64/fpu/w_exp10_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_exp10f.c2
-rw-r--r--sysdeps/ia64/fpu/w_exp10f_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_exp10l.c2
-rw-r--r--sysdeps/ia64/fpu/w_exp10l_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_exp2.c2
-rw-r--r--sysdeps/ia64/fpu/w_exp2_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_exp2f.c2
-rw-r--r--sysdeps/ia64/fpu/w_exp2f_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_exp2l.c2
-rw-r--r--sysdeps/ia64/fpu/w_exp2l_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_exp_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_expf.c2
-rw-r--r--sysdeps/ia64/fpu/w_expf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_expl.c2
-rw-r--r--sysdeps/ia64/fpu/w_expl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_fmod.c2
-rw-r--r--sysdeps/ia64/fpu/w_fmod_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_fmodf.c2
-rw-r--r--sysdeps/ia64/fpu/w_fmodf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_fmodl.c2
-rw-r--r--sysdeps/ia64/fpu/w_fmodl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_hypot.c2
-rw-r--r--sysdeps/ia64/fpu/w_hypot_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_hypotf.c2
-rw-r--r--sysdeps/ia64/fpu/w_hypotf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_hypotl.c2
-rw-r--r--sysdeps/ia64/fpu/w_hypotl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_lgamma_main.c1
-rw-r--r--sysdeps/ia64/fpu/w_lgamma_r.c2
-rw-r--r--sysdeps/ia64/fpu/w_lgamma_r_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_lgammaf_main.c1
-rw-r--r--sysdeps/ia64/fpu/w_lgammaf_r.c2
-rw-r--r--sysdeps/ia64/fpu/w_lgammaf_r_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_lgammal_main.c1
-rw-r--r--sysdeps/ia64/fpu/w_lgammal_r.c2
-rw-r--r--sysdeps/ia64/fpu/w_lgammal_r_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_log.c2
-rw-r--r--sysdeps/ia64/fpu/w_log10.c2
-rw-r--r--sysdeps/ia64/fpu/w_log10_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_log10f.c2
-rw-r--r--sysdeps/ia64/fpu/w_log10f_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_log10l.c2
-rw-r--r--sysdeps/ia64/fpu/w_log10l_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_log1p.c2
-rw-r--r--sysdeps/ia64/fpu/w_log1pf.c2
-rw-r--r--sysdeps/ia64/fpu/w_log1pl.c2
-rw-r--r--sysdeps/ia64/fpu/w_log2.c2
-rw-r--r--sysdeps/ia64/fpu/w_log2_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_log2f.c2
-rw-r--r--sysdeps/ia64/fpu/w_log2f_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_log2l.c2
-rw-r--r--sysdeps/ia64/fpu/w_log2l_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_log_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_logf.c2
-rw-r--r--sysdeps/ia64/fpu/w_logf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_logl.c2
-rw-r--r--sysdeps/ia64/fpu/w_logl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_pow.c2
-rw-r--r--sysdeps/ia64/fpu/w_pow_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_powf.c2
-rw-r--r--sysdeps/ia64/fpu/w_powf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_powl.c2
-rw-r--r--sysdeps/ia64/fpu/w_powl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_remainder.c2
-rw-r--r--sysdeps/ia64/fpu/w_remainder_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_remainderf.c2
-rw-r--r--sysdeps/ia64/fpu/w_remainderf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_remainderl.c2
-rw-r--r--sysdeps/ia64/fpu/w_remainderl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_scalb_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_scalbf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_scalbl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_scalblnf.c2
-rw-r--r--sysdeps/ia64/fpu/w_sinh.c2
-rw-r--r--sysdeps/ia64/fpu/w_sinh_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_sinhf.c2
-rw-r--r--sysdeps/ia64/fpu/w_sinhf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_sinhl.c2
-rw-r--r--sysdeps/ia64/fpu/w_sinhl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_sqrt.c2
-rw-r--r--sysdeps/ia64/fpu/w_sqrt_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_sqrtf.c2
-rw-r--r--sysdeps/ia64/fpu/w_sqrtf_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_sqrtl.c2
-rw-r--r--sysdeps/ia64/fpu/w_sqrtl_compat.c1
-rw-r--r--sysdeps/ia64/fpu/w_tgamma.S1835
-rw-r--r--sysdeps/ia64/fpu/w_tgamma.c (renamed from sysdeps/ia64/fpu/mplog.c)0
-rw-r--r--sysdeps/ia64/fpu/w_tgamma_compat.S1836
-rw-r--r--sysdeps/ia64/fpu/w_tgammaf.S1330
-rw-r--r--sysdeps/ia64/fpu/w_tgammaf.c (renamed from sysdeps/ia64/fpu/slowexp.c)0
-rw-r--r--sysdeps/ia64/fpu/w_tgammaf_compat.S1331
-rw-r--r--sysdeps/ia64/fpu/w_tgammal.S4487
-rw-r--r--sysdeps/ia64/fpu/w_tgammal.c (renamed from sysdeps/ia64/fpu/slowpow.c)0
-rw-r--r--sysdeps/ia64/fpu/w_tgammal_compat.S4488
-rw-r--r--sysdeps/ia64/gccframe.h2
-rw-r--r--sysdeps/ia64/hp-timing.h2
-rw-r--r--sysdeps/ia64/htonl.S2
-rw-r--r--sysdeps/ia64/htons.S2
-rw-r--r--sysdeps/ia64/ieee754.h2
-rw-r--r--sysdeps/ia64/jmpbuf-unwind.h2
-rw-r--r--sysdeps/ia64/ldsodefs.h2
-rw-r--r--sysdeps/ia64/libc-tls.c2
-rw-r--r--sysdeps/ia64/machine-gmon.h2
-rw-r--r--sysdeps/ia64/math-tests.h25
-rw-r--r--sysdeps/ia64/memccpy.S2
-rw-r--r--sysdeps/ia64/memchr.S6
-rw-r--r--sysdeps/ia64/memcmp.S2
-rw-r--r--sysdeps/ia64/memcpy.S2
-rw-r--r--sysdeps/ia64/memmove.S2
-rw-r--r--sysdeps/ia64/memset.S2
-rw-r--r--sysdeps/ia64/memusage.h2
-rw-r--r--sysdeps/ia64/nptl/Makefile5
-rw-r--r--sysdeps/ia64/nptl/bits/pthreadtypes-arch.h63
-rw-r--r--sysdeps/ia64/nptl/bits/pthreadtypes.h177
-rw-r--r--sysdeps/ia64/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/ia64/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/ia64/nptl/pthread_spin_lock.c2
-rw-r--r--sysdeps/ia64/nptl/pthread_spin_trylock.c2
-rw-r--r--sysdeps/ia64/nptl/pthread_spin_unlock.c2
-rw-r--r--sysdeps/ia64/nptl/pthreaddef.h2
-rw-r--r--sysdeps/ia64/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/ia64/nptl/tls.h17
-rw-r--r--sysdeps/ia64/sched_cpucount.c2
-rw-r--r--sysdeps/ia64/softpipe.h2
-rw-r--r--sysdeps/ia64/sotruss-lib.c2
-rw-r--r--sysdeps/ia64/stackinfo.h7
-rw-r--r--sysdeps/ia64/start.S2
-rw-r--r--sysdeps/ia64/strcat.c26
-rw-r--r--sysdeps/ia64/strchr.S2
-rw-r--r--sysdeps/ia64/strcmp.S2
-rw-r--r--sysdeps/ia64/strcpy.S2
-rw-r--r--sysdeps/ia64/strlen.S2
-rw-r--r--sysdeps/ia64/strncmp.S2
-rw-r--r--sysdeps/ia64/strncpy.S2
-rw-r--r--sysdeps/ia64/sysdep.h2
-rw-r--r--sysdeps/ia64/tst-audit.h2
-rw-r--r--sysdeps/ieee754/bits/huge_val.h53
-rw-r--r--sysdeps/ieee754/bits/huge_valf.h51
-rw-r--r--sysdeps/ieee754/bits/inf.h29
-rw-r--r--sysdeps/ieee754/bits/nan.h52
-rw-r--r--sysdeps/ieee754/dbl-64/Makefile6
-rw-r--r--sysdeps/ieee754/dbl-64/MathLib.h2
-rw-r--r--sysdeps/ieee754/dbl-64/asincos.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/atnat.h2
-rw-r--r--sysdeps/ieee754/dbl-64/atnat2.h2
-rw-r--r--sysdeps/ieee754/dbl-64/branred.c2
-rw-r--r--sysdeps/ieee754/dbl-64/branred.h2
-rw-r--r--sysdeps/ieee754/dbl-64/dbl2mpn.c2
-rw-r--r--sysdeps/ieee754/dbl-64/dla.h6
-rw-r--r--sysdeps/ieee754/dbl-64/doasin.c2
-rw-r--r--sysdeps/ieee754/dbl-64/doasin.h2
-rw-r--r--sysdeps/ieee754/dbl-64/dosincos.c2
-rw-r--r--sysdeps/ieee754/dbl-64/dosincos.h2
-rw-r--r--sysdeps/ieee754/dbl-64/e_acosh.c6
-rw-r--r--sysdeps/ieee754/dbl-64/e_asin.c7
-rw-r--r--sysdeps/ieee754/dbl-64/e_atan2.c5
-rw-r--r--sysdeps/ieee754/dbl-64/e_atanh.c4
-rw-r--r--sysdeps/ieee754/dbl-64/e_cosh.c5
-rw-r--r--sysdeps/ieee754/dbl-64/e_exp.c150
-rw-r--r--sysdeps/ieee754/dbl-64/e_exp10.c2
-rw-r--r--sysdeps/ieee754/dbl-64/e_exp2.c4
-rw-r--r--sysdeps/ieee754/dbl-64/e_fmod.c10
-rw-r--r--sysdeps/ieee754/dbl-64/e_gamma_r.c10
-rw-r--r--sysdeps/ieee754/dbl-64/e_hypot.c13
-rw-r--r--sysdeps/ieee754/dbl-64/e_j0.c11
-rw-r--r--sysdeps/ieee754/dbl-64/e_j1.c12
-rw-r--r--sysdeps/ieee754/dbl-64/e_jn.c22
-rw-r--r--sysdeps/ieee754/dbl-64/e_lgamma_r.c5
-rw-r--r--sysdeps/ieee754/dbl-64/e_log.c129
-rw-r--r--sysdeps/ieee754/dbl-64/e_log10.c6
-rw-r--r--sysdeps/ieee754/dbl-64/e_log2.c4
-rw-r--r--sysdeps/ieee754/dbl-64/e_pow.c197
-rw-r--r--sysdeps/ieee754/dbl-64/e_rem_pio2.c4
-rw-r--r--sysdeps/ieee754/dbl-64/e_remainder.c2
-rw-r--r--sysdeps/ieee754/dbl-64/e_sinh.c6
-rw-r--r--sysdeps/ieee754/dbl-64/e_sqrt.c3
-rw-r--r--sysdeps/ieee754/dbl-64/eexp.tbl172
-rw-r--r--sysdeps/ieee754/dbl-64/gamma_product.c34
-rw-r--r--sysdeps/ieee754/dbl-64/gamma_productf.c3
-rw-r--r--sysdeps/ieee754/dbl-64/halfulp.c152
-rw-r--r--sysdeps/ieee754/dbl-64/k_rem_pio2.c20
-rw-r--r--sysdeps/ieee754/dbl-64/lgamma_neg.c3
-rw-r--r--sysdeps/ieee754/dbl-64/lgamma_product.c34
-rw-r--r--sysdeps/ieee754/dbl-64/mpa-arch.h2
-rw-r--r--sysdeps/ieee754/dbl-64/mpa.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mpa.h33
-rw-r--r--sysdeps/ieee754/dbl-64/mpatan.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mpatan.h2
-rw-r--r--sysdeps/ieee754/dbl-64/mpatan2.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mpexp.c163
-rw-r--r--sysdeps/ieee754/dbl-64/mplog.c65
-rw-r--r--sysdeps/ieee754/dbl-64/mpn2dbl.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mpsqrt.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mpsqrt.h2
-rw-r--r--sysdeps/ieee754/dbl-64/mptan.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mydefs.h2
-rw-r--r--sysdeps/ieee754/dbl-64/powtwo.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/root.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/s_asinh.c12
-rw-r--r--sysdeps/ieee754/dbl-64/s_atan.c10
-rw-r--r--sysdeps/ieee754/dbl-64/s_cbrt.c9
-rw-r--r--sysdeps/ieee754/dbl-64/s_ceil.c20
-rw-r--r--sysdeps/ieee754/dbl-64/s_copysign.c9
-rw-r--r--sysdeps/ieee754/dbl-64/s_erf.c19
-rw-r--r--sysdeps/ieee754/dbl-64/s_expm1.c19
-rw-r--r--sysdeps/ieee754/dbl-64/s_f32xaddf64.c30
-rw-r--r--sysdeps/ieee754/dbl-64/s_f32xdivf64.c30
-rw-r--r--sysdeps/ieee754/dbl-64/s_f32xmulf64.c30
-rw-r--r--sysdeps/ieee754/dbl-64/s_f32xsubf64.c30
-rw-r--r--sysdeps/ieee754/dbl-64/s_fabs.c7
-rw-r--r--sysdeps/ieee754/dbl-64/s_fadd.c34
-rw-r--r--sysdeps/ieee754/dbl-64/s_fdiv.c34
-rw-r--r--sysdeps/ieee754/dbl-64/s_finite.c5
-rw-r--r--sysdeps/ieee754/dbl-64/s_floor.c21
-rw-r--r--sysdeps/ieee754/dbl-64/s_fma.c11
-rw-r--r--sysdeps/ieee754/dbl-64/s_fmaf.c6
-rw-r--r--sysdeps/ieee754/dbl-64/s_fmul.c34
-rw-r--r--sysdeps/ieee754/dbl-64/s_fpclassify.c4
-rw-r--r--sysdeps/ieee754/dbl-64/s_frexp.c9
-rw-r--r--sysdeps/ieee754/dbl-64/s_fromfp.c5
-rw-r--r--sysdeps/ieee754/dbl-64/s_fromfp_main.c83
-rw-r--r--sysdeps/ieee754/dbl-64/s_fromfpx.c5
-rw-r--r--sysdeps/ieee754/dbl-64/s_fsub.c34
-rw-r--r--sysdeps/ieee754/dbl-64/s_getpayload.c36
-rw-r--r--sysdeps/ieee754/dbl-64/s_isinf.c3
-rw-r--r--sysdeps/ieee754/dbl-64/s_isnan.c7
-rw-r--r--sysdeps/ieee754/dbl-64/s_issignaling.c9
-rw-r--r--sysdeps/ieee754/dbl-64/s_llrint.c12
-rw-r--r--sysdeps/ieee754/dbl-64/s_llround.c13
-rw-r--r--sysdeps/ieee754/dbl-64/s_log1p.c14
-rw-r--r--sysdeps/ieee754/dbl-64/s_logb.c6
-rw-r--r--sysdeps/ieee754/dbl-64/s_lrint.c12
-rw-r--r--sysdeps/ieee754/dbl-64/s_lround.c13
-rw-r--r--sysdeps/ieee754/dbl-64/s_modf.c11
-rw-r--r--sysdeps/ieee754/dbl-64/s_nearbyint.c12
-rw-r--r--sysdeps/ieee754/dbl-64/s_nextup.c56
-rw-r--r--sysdeps/ieee754/dbl-64/s_remquo.c11
-rw-r--r--sysdeps/ieee754/dbl-64/s_rint.c7
-rw-r--r--sysdeps/ieee754/dbl-64/s_round.c27
-rw-r--r--sysdeps/ieee754/dbl-64/s_roundeven.c105
-rw-r--r--sysdeps/ieee754/dbl-64/s_setpayload.c4
-rw-r--r--sysdeps/ieee754/dbl-64/s_setpayload_main.c70
-rw-r--r--sysdeps/ieee754/dbl-64/s_setpayloadsig.c4
-rw-r--r--sysdeps/ieee754/dbl-64/s_signbit.c2
-rw-r--r--sysdeps/ieee754/dbl-64/s_sin.c904
-rw-r--r--sysdeps/ieee754/dbl-64/s_sincos.c118
-rw-r--r--sysdeps/ieee754/dbl-64/s_tan.c10
-rw-r--r--sysdeps/ieee754/dbl-64/s_tanh.c8
-rw-r--r--sysdeps/ieee754/dbl-64/s_totalorder.c53
-rw-r--r--sysdeps/ieee754/dbl-64/s_totalordermag.c48
-rw-r--r--sysdeps/ieee754/dbl-64/s_trunc.c11
-rw-r--r--sysdeps/ieee754/dbl-64/s_ufromfp.c5
-rw-r--r--sysdeps/ieee754/dbl-64/s_ufromfpx.c5
-rw-r--r--sysdeps/ieee754/dbl-64/sincos32.c2
-rw-r--r--sysdeps/ieee754/dbl-64/sincos32.h4
-rw-r--r--sysdeps/ieee754/dbl-64/sincostab.c2
-rw-r--r--sysdeps/ieee754/dbl-64/slowexp.c86
-rw-r--r--sysdeps/ieee754/dbl-64/slowpow.c125
-rw-r--r--sysdeps/ieee754/dbl-64/t_exp.c2
-rw-r--r--sysdeps/ieee754/dbl-64/uasncs.h2
-rw-r--r--sysdeps/ieee754/dbl-64/uatan.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/uexp.h5
-rw-r--r--sysdeps/ieee754/dbl-64/uexp.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/ulog.h96
-rw-r--r--sysdeps/ieee754/dbl-64/ulog.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/upow.h2
-rw-r--r--sysdeps/ieee754/dbl-64/upow.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/urem.h2
-rw-r--r--sysdeps/ieee754/dbl-64/usncs.h2
-rw-r--r--sysdeps/ieee754/dbl-64/utan.h2
-rw-r--r--sysdeps/ieee754/dbl-64/utan.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/w_exp.c38
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c4
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c2
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c2
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c16
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c3
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c18
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c12
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c32
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c3
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c3
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c7
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c15
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c9
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c9
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c7
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c16
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c9
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c7
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_round.c15
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c71
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_setpayload_main.c54
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c49
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c46
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c9
-rw-r--r--sysdeps/ieee754/dbl-64/x2y2m1.c34
-rw-r--r--sysdeps/ieee754/dbl-64/x2y2m1f.c2
-rw-r--r--sysdeps/ieee754/float128/Makeconfig4
-rw-r--r--sysdeps/ieee754/float128/Makefile12
-rw-r--r--sysdeps/ieee754/float128/Versions51
-rw-r--r--sysdeps/ieee754/float128/e_acosf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_acoshf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_asinf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_atan2f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_atanhf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_coshf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_exp10f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_expf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_fmodf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_gammaf128_r.c2
-rw-r--r--sysdeps/ieee754/float128/e_hypotf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_ilogbf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_j0f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_j1f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_jnf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_lgammaf128_r.c2
-rw-r--r--sysdeps/ieee754/float128/e_log10f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_log2f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_logf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_powf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_rem_pio2f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_remainderf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_scalbf128.c1
-rw-r--r--sysdeps/ieee754/float128/e_sinhf128.c2
-rw-r--r--sysdeps/ieee754/float128/float1282mpn.c20
-rw-r--r--sysdeps/ieee754/float128/float128_private.h366
-rw-r--r--sysdeps/ieee754/float128/gamma_productf128.c2
-rw-r--r--sysdeps/ieee754/float128/ieee754_float128.h140
-rw-r--r--sysdeps/ieee754/float128/k_cosf128.c2
-rw-r--r--sysdeps/ieee754/float128/k_sincosf128.c2
-rw-r--r--sysdeps/ieee754/float128/k_sinf128.c2
-rw-r--r--sysdeps/ieee754/float128/k_tanf128.c2
-rw-r--r--sysdeps/ieee754/float128/lgamma_negf128.c2
-rw-r--r--sysdeps/ieee754/float128/lgamma_productf128.c2
-rw-r--r--sysdeps/ieee754/float128/math-nan-payload-float128.h34
-rw-r--r--sysdeps/ieee754/float128/mpn2float128.c54
-rw-r--r--sysdeps/ieee754/float128/s_asinhf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_atanf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_cbrtf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_ceilf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_copysignf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_cosf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_erff128.c2
-rw-r--r--sysdeps/ieee754/float128/s_expm1f128.c2
-rw-r--r--sysdeps/ieee754/float128/s_f32addf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_f32divf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_f32mulf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_f32subf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_f64addf128.c10
-rw-r--r--sysdeps/ieee754/float128/s_f64divf128.c10
-rw-r--r--sysdeps/ieee754/float128/s_f64mulf128.c10
-rw-r--r--sysdeps/ieee754/float128/s_f64subf128.c10
-rw-r--r--sysdeps/ieee754/float128/s_f64xaddf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_f64xdivf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_f64xmulf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_f64xsubf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_fabsf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_finitef128.c2
-rw-r--r--sysdeps/ieee754/float128/s_floorf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_fmaf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_fpclassifyf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_frexpf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_fromfpf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_fromfpxf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_getpayloadf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_isinff128.c2
-rw-r--r--sysdeps/ieee754/float128/s_isnanf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_issignalingf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_llrintf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_llroundf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_log1pf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_logbf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_lrintf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_lroundf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_modff128.c2
-rw-r--r--sysdeps/ieee754/float128/s_nearbyintf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_nextafterf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_nexttowardf128.c1
-rw-r--r--sysdeps/ieee754/float128/s_nextupf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_remquof128.c2
-rw-r--r--sysdeps/ieee754/float128/s_rintf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_roundevenf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_roundf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_scalblnf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_scalbnf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_setpayloadf128.c5
-rw-r--r--sysdeps/ieee754/float128/s_setpayloadsigf128.c5
-rw-r--r--sysdeps/ieee754/float128/s_signbitf128.c37
-rw-r--r--sysdeps/ieee754/float128/s_significandf128.c1
-rw-r--r--sysdeps/ieee754/float128/s_sincosf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_sinf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_tanf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_tanhf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_totalorderf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_totalordermagf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_truncf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_ufromfpf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_ufromfpxf128.c6
-rw-r--r--sysdeps/ieee754/float128/strfromf128.c36
-rw-r--r--sysdeps/ieee754/float128/strtof128.c51
-rw-r--r--sysdeps/ieee754/float128/strtof128_l.c58
-rw-r--r--sysdeps/ieee754/float128/strtof128_nan.c26
-rw-r--r--sysdeps/ieee754/float128/t_sincosf128.c2
-rw-r--r--sysdeps/ieee754/float128/wcstof128.c27
-rw-r--r--sysdeps/ieee754/float128/wcstof128_l.c27
-rw-r--r--sysdeps/ieee754/float128/wcstof128_nan.c23
-rw-r--r--sysdeps/ieee754/float128/x2y2m1f128.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_acosf.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_acoshf.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_asinf.c3
-rw-r--r--sysdeps/ieee754/flt-32/e_atan2f.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_atanhf.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_coshf.c1
-rw-r--r--sysdeps/ieee754/flt-32/e_exp2f.c182
-rw-r--r--sysdeps/ieee754/flt-32/e_exp2f_data.c44
-rw-r--r--sysdeps/ieee754/flt-32/e_expf.c202
-rw-r--r--sysdeps/ieee754/flt-32/e_fmodf.c6
-rw-r--r--sysdeps/ieee754/flt-32/e_gammaf_r.c8
-rw-r--r--sysdeps/ieee754/flt-32/e_hypotf.c6
-rw-r--r--sysdeps/ieee754/flt-32/e_j0f.c11
-rw-r--r--sysdeps/ieee754/flt-32/e_j1f.c12
-rw-r--r--sysdeps/ieee754/flt-32/e_jnf.c10
-rw-r--r--sysdeps/ieee754/flt-32/e_lgammaf_r.c5
-rw-r--r--sysdeps/ieee754/flt-32/e_log10f.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_log2f.c157
-rw-r--r--sysdeps/ieee754/flt-32/e_log2f_data.c44
-rw-r--r--sysdeps/ieee754/flt-32/e_logf.c157
-rw-r--r--sysdeps/ieee754/flt-32/e_logf_data.c44
-rw-r--r--sysdeps/ieee754/flt-32/e_powf.c450
-rw-r--r--sysdeps/ieee754/flt-32/e_powf_log2_data.c45
-rw-r--r--sysdeps/ieee754/flt-32/e_rem_pio2f.c6
-rw-r--r--sysdeps/ieee754/flt-32/e_remainderf.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_sinhf.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_sqrtf.c2
-rw-r--r--sysdeps/ieee754/flt-32/k_rem_pio2f.c21
-rw-r--r--sysdeps/ieee754/flt-32/k_sinf.c1
-rw-r--r--sysdeps/ieee754/flt-32/k_tanf.c1
-rw-r--r--sysdeps/ieee754/flt-32/lgamma_negf.c3
-rw-r--r--sysdeps/ieee754/flt-32/math_config.h164
-rw-r--r--sysdeps/ieee754/flt-32/math_errf.c76
-rw-r--r--sysdeps/ieee754/flt-32/mpn2flt.c2
-rw-r--r--sysdeps/ieee754/flt-32/s_asinhf.c8
-rw-r--r--sysdeps/ieee754/flt-32/s_atanf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_cbrtf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_ceilf.c12
-rw-r--r--sysdeps/ieee754/flt-32/s_copysignf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_cosf.c171
-rw-r--r--sysdeps/ieee754/flt-32/s_erff.c11
-rw-r--r--sysdeps/ieee754/flt-32/s_expm1f.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_fabsf.c3
-rw-r--r--sysdeps/ieee754/flt-32/s_finitef.c2
-rw-r--r--sysdeps/ieee754/flt-32/s_floorf.c14
-rw-r--r--sysdeps/ieee754/flt-32/s_fpclassifyf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_frexpf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_fromfpf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_fromfpf_main.c83
-rw-r--r--sysdeps/ieee754/flt-32/s_fromfpxf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_getpayloadf.c35
-rw-r--r--sysdeps/ieee754/flt-32/s_isnanf.c2
-rw-r--r--sysdeps/ieee754/flt-32/s_issignalingf.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_llrintf.c8
-rw-r--r--sysdeps/ieee754/flt-32/s_llroundf.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_log1pf.c19
-rw-r--r--sysdeps/ieee754/flt-32/s_logbf.c3
-rw-r--r--sysdeps/ieee754/flt-32/s_lrintf.c8
-rw-r--r--sysdeps/ieee754/flt-32/s_lroundf.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_modff.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_nearbyintf.c8
-rw-r--r--sysdeps/ieee754/flt-32/s_nextafterf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_nextupf.c48
-rw-r--r--sysdeps/ieee754/flt-32/s_remquof.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_rintf.c3
-rw-r--r--sysdeps/ieee754/flt-32/s_roundevenf.c70
-rw-r--r--sysdeps/ieee754/flt-32/s_roundf.c14
-rw-r--r--sysdeps/ieee754/flt-32/s_setpayloadf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_setpayloadf_main.c54
-rw-r--r--sysdeps/ieee754/flt-32/s_setpayloadsigf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_signbitf.c2
-rw-r--r--sysdeps/ieee754/flt-32/s_sincosf.c175
-rw-r--r--sysdeps/ieee754/flt-32/s_sincosf.h155
-rw-r--r--sysdeps/ieee754/flt-32/s_sinf.c177
-rw-r--r--sysdeps/ieee754/flt-32/s_tanf.c3
-rw-r--r--sysdeps/ieee754/flt-32/s_tanhf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_totalorderf.c48
-rw-r--r--sysdeps/ieee754/flt-32/s_totalordermagf.c46
-rw-r--r--sysdeps/ieee754/flt-32/s_truncf.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_ufromfpf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_ufromfpxf.c5
-rw-r--r--sysdeps/ieee754/flt-32/t_exp2f.h351
-rw-r--r--sysdeps/ieee754/flt-32/w_exp2f.c (renamed from sysdeps/m68k/m680x0/fpu/halfulp.c)0
-rw-r--r--sysdeps/ieee754/flt-32/w_expf.c35
-rw-r--r--sysdeps/ieee754/flt-32/w_log2f.c (renamed from sysdeps/m68k/m680x0/fpu/mpexp.c)0
-rw-r--r--sysdeps/ieee754/flt-32/w_logf.c (renamed from sysdeps/m68k/m680x0/fpu/mplog.c)0
-rw-r--r--sysdeps/ieee754/flt-32/w_powf.c (renamed from sysdeps/m68k/m680x0/fpu/slowexp.c)0
-rw-r--r--sysdeps/ieee754/ieee754.h2
-rw-r--r--sysdeps/ieee754/k_standard.c71
-rw-r--r--sysdeps/ieee754/k_standardf.c5
-rw-r--r--sysdeps/ieee754/k_standardl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/Makeconfig4
-rw-r--r--sysdeps/ieee754/ldbl-128/bits/floatn.h97
-rw-r--r--sysdeps/ieee754/ldbl-128/bits/long-double.h20
-rw-r--r--sysdeps/ieee754/ldbl-128/e_acoshl.c18
-rw-r--r--sysdeps/ieee754/ldbl-128/e_acosl.c152
-rw-r--r--sysdeps/ieee754/ldbl-128/e_asinl.c107
-rw-r--r--sysdeps/ieee754/ldbl-128/e_atan2l.c30
-rw-r--r--sysdeps/ieee754/ldbl-128/e_atanhl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128/e_coshl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/e_exp10l.c18
-rw-r--r--sysdeps/ieee754/ldbl-128/e_expl.c51
-rw-r--r--sysdeps/ieee754/ldbl-128/e_fmodl.c16
-rw-r--r--sysdeps/ieee754/ldbl-128/e_gammal_r.c125
-rw-r--r--sysdeps/ieee754/ldbl-128/e_hypotl.c21
-rw-r--r--sysdeps/ieee754/ldbl-128/e_ilogbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/e_j0l.c877
-rw-r--r--sysdeps/ieee754/ldbl-128/e_j1l.c876
-rw-r--r--sysdeps/ieee754/ldbl-128/e_jnl.c77
-rw-r--r--sysdeps/ieee754/ldbl-128/e_lgammal_r.c932
-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.c241
-rw-r--r--sysdeps/ieee754/ldbl-128/e_powl.c120
-rw-r--r--sysdeps/ieee754/ldbl-128/e_rem_pio2l.c18
-rw-r--r--sysdeps/ieee754/ldbl-128/e_remainderl.c12
-rw-r--r--sysdeps/ieee754/ldbl-128/e_sinhl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128/float128-abi.h2
-rw-r--r--sysdeps/ieee754/ldbl-128/gamma_productl.c44
-rw-r--r--sysdeps/ieee754/ldbl-128/ieee754.h2
-rw-r--r--sysdeps/ieee754/ldbl-128/k_cosl.c56
-rw-r--r--sysdeps/ieee754/ldbl-128/k_sincosl.c71
-rw-r--r--sysdeps/ieee754/ldbl-128/k_sinl.c57
-rw-r--r--sysdeps/ieee754/ldbl-128/k_tanl.c44
-rw-r--r--sysdeps/ieee754/ldbl-128/ldbl2mpn.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/lgamma_negl.c760
-rw-r--r--sysdeps/ieee754/ldbl-128/lgamma_productl.c62
-rw-r--r--sysdeps/ieee754/ldbl-128/math-nan-payload-ldouble.h32
-rw-r--r--sysdeps/ieee754/ldbl-128/math_ldbl.h52
-rw-r--r--sysdeps/ieee754/ldbl-128/mpn2ldbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/printf_fphex.c90
-rw-r--r--sysdeps/ieee754/ldbl-128/printf_fphex_macros.h104
-rw-r--r--sysdeps/ieee754/ldbl-128/s_asinhl.c22
-rw-r--r--sysdeps/ieee754/ldbl-128/s_atanl.c206
-rw-r--r--sysdeps/ieee754/ldbl-128/s_cbrtl.c33
-rw-r--r--sysdeps/ieee754/ldbl-128/s_ceill.c42
-rw-r--r--sysdeps/ieee754/ldbl-128/s_copysignl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_cosl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_daddl.c37
-rw-r--r--sysdeps/ieee754/ldbl-128/s_ddivl.c37
-rw-r--r--sysdeps/ieee754/ldbl-128/s_dmull.c37
-rw-r--r--sysdeps/ieee754/ldbl-128/s_dsubl.c37
-rw-r--r--sysdeps/ieee754/ldbl-128/s_erfl.c922
-rw-r--r--sysdeps/ieee754/ldbl-128/s_expm1l.c62
-rw-r--r--sysdeps/ieee754/ldbl-128/s_f64xaddf128.c38
-rw-r--r--sysdeps/ieee754/ldbl-128/s_f64xdivf128.c38
-rw-r--r--sysdeps/ieee754/ldbl-128/s_f64xmulf128.c38
-rw-r--r--sysdeps/ieee754/ldbl-128/s_f64xsubf128.c38
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fabsl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_faddl.c33
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fdivl.c33
-rw-r--r--sysdeps/ieee754/ldbl-128/s_finitel.c8
-rw-r--r--sysdeps/ieee754/ldbl-128/s_floorl.c44
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fma.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fmal.c60
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fmull.c33
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fpclassifyl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/s_frexpl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fromfpl_main.c91
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fsubl.c33
-rw-r--r--sysdeps/ieee754/ldbl-128/s_getpayloadl.c59
-rw-r--r--sysdeps/ieee754/ldbl-128/s_isinfl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_isnanl.c8
-rw-r--r--sysdeps/ieee754/ldbl-128/s_issignalingl.c9
-rw-r--r--sysdeps/ieee754/ldbl-128/s_llrintl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128/s_llroundl.c15
-rw-r--r--sysdeps/ieee754/ldbl-128/s_log1pl.c119
-rw-r--r--sysdeps/ieee754/ldbl-128/s_logbl.c11
-rw-r--r--sysdeps/ieee754/ldbl-128/s_lrintl.c29
-rw-r--r--sysdeps/ieee754/ldbl-128/s_lroundl.c15
-rw-r--r--sysdeps/ieee754/ldbl-128/s_modfl.c9
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nearbyintl.c22
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nextafterl.c14
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nexttoward.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nexttowardf.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nextupl.c58
-rw-r--r--sysdeps/ieee754/ldbl-128/s_remquol.c19
-rw-r--r--sysdeps/ieee754/ldbl-128/s_rintl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128/s_roundevenl.c104
-rw-r--r--sysdeps/ieee754/ldbl-128/s_roundl.c52
-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_setpayloadl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c70
-rw-r--r--sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_signbitl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_sincosl.c11
-rw-r--r--sysdeps/ieee754/ldbl-128/s_sinl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_tanhl.c14
-rw-r--r--sysdeps/ieee754/ldbl-128/s_tanl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_totalorderl.c56
-rw-r--r--sysdeps/ieee754/ldbl-128/s_totalordermagl.c50
-rw-r--r--sysdeps/ieee754/ldbl-128/s_truncl.c11
-rw-r--r--sysdeps/ieee754/ldbl-128/s_ufromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_ufromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h33
-rw-r--r--sysdeps/ieee754/ldbl-128/strtold_l.c32
-rw-r--r--sysdeps/ieee754/ldbl-128/t_expl.h1864
-rw-r--r--sysdeps/ieee754/ldbl-128/t_sincosl.c671
-rw-r--r--sysdeps/ieee754/ldbl-128/w_expl.c42
-rw-r--r--sysdeps/ieee754/ldbl-128/x2y2m1l.c57
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/Makefile22
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/Versions123
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf_size.c32
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h64
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/strfromf128.c20
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/strtof128.c20
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/strtof128_l.c20
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ibm128.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ieee128.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/wcstof128.c20
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/wcstof128_l.c20
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/Makefile6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h58
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_acoshl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_acosl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_asinl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_atanhl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_exp10l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_expl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_fmodl.c25
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_hypotl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_j0l.c865
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_j1l.c887
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_jnl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c993
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_log10l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_log2l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_logl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_powl.c43
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_remainderl.c8
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_sinhl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/gamma_productl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/ieee754.h2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_cosl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_sincosl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_sinl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_tanl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h29
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/math_ldbl.h64
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/printf_fphex.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_asinhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_atanl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c104
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ceill.c58
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_daddl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ddivl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_dmull.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_dsubl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_erfl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_expm1l.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fabsl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_faddl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fdivl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_floorl.c51
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fmal.c243
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fmull.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_frexpl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c147
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fsubl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c35
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c60
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_llrintl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_llroundl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_log1pl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_lrintl.c17
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_lroundl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_modfl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c111
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nextupl.c79
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_remquol.c6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_rintl.c21
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c70
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_roundl.c76
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c60
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_signbitl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_sincosl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_tanhl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c63
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c65
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_truncl.c56
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h30
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/strtold_l.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/t_expl.h970
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/t_sincosl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c230
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c21
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c84
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c21
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c30
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c73
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/w_expl.c21
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/w_log1pl.c23
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/w_scalblnl.c23
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c34
-rw-r--r--sysdeps/ieee754/ldbl-64-128/e_ilogbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_asinhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_atanl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_cbrtl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_ceill.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_copysignl.c11
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_cosl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_erfl.c6
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_expm1l.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_fabsl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_finitel.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_floorl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_fmal.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_frexpl.c11
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_isinfl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_isnanl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_llrintl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_llroundl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_log1pl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_logbl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_lrintl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_lroundl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_modfl.c11
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_nextafterl.c3
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_remquol.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_rintl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_roundl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_scalblnl.c4
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_scalbnl.c4
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_signbitl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_sincosl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_sinl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_tanhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_tanl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_truncl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/strtold_l.c39
-rw-r--r--sysdeps/ieee754/ldbl-64-128/w_expl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/w_log1pl.c23
-rw-r--r--sysdeps/ieee754/ldbl-64-128/w_scalblnl.c27
-rw-r--r--sysdeps/ieee754/ldbl-96/Makefile21
-rw-r--r--sysdeps/ieee754/ldbl-96/bits/iscanonical.h54
-rw-r--r--sysdeps/ieee754/ldbl-96/bits/long-double.h20
-rw-r--r--sysdeps/ieee754/ldbl-96/e_acoshl.c6
-rw-r--r--sysdeps/ieee754/ldbl-96/e_asinl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/e_atanhl.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/e_coshl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/e_gammal_r.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/e_hypotl.c23
-rw-r--r--sysdeps/ieee754/ldbl-96/e_j0l.c17
-rw-r--r--sysdeps/ieee754/ldbl-96/e_j1l.c19
-rw-r--r--sysdeps/ieee754/ldbl-96/e_jnl.c9
-rw-r--r--sysdeps/ieee754/ldbl-96/e_lgammal_r.c6
-rw-r--r--sysdeps/ieee754/ldbl-96/e_rem_pio2l.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/e_sinhl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/gamma_product.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/gamma_productl.c36
-rw-r--r--sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h5
-rw-r--r--sysdeps/ieee754/ldbl-96/k_cosl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/k_sinl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/k_tanl.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/ldbl2mpn.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/lgamma_negl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/lgamma_product.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/lgamma_productl.c38
-rw-r--r--sysdeps/ieee754/ldbl-96/math-nan-payload-ldouble.h29
-rw-r--r--sysdeps/ieee754/ldbl-96/math_ldbl.h40
-rw-r--r--sysdeps/ieee754/ldbl-96/mpn2ldbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/printf_fphex.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/s_asinhl.c8
-rw-r--r--sysdeps/ieee754/ldbl-96/s_cbrtl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_copysignl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_cosl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_daddl.c33
-rw-r--r--sysdeps/ieee754/ldbl-96/s_ddivl.c33
-rw-r--r--sysdeps/ieee754/ldbl-96/s_dmull.c33
-rw-r--r--sysdeps/ieee754/ldbl-96/s_dsubl.c33
-rw-r--r--sysdeps/ieee754/ldbl-96/s_erfl.c10
-rw-r--r--sysdeps/ieee754/ldbl-96/s_faddl.c31
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fdivl.c31
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fma.c20
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fmal.c6
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fmull.c31
-rw-r--r--sysdeps/ieee754/ldbl-96/s_frexpl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fromfpl_main.c85
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fsubl.c31
-rw-r--r--sysdeps/ieee754/ldbl-96/s_getpayloadl.c34
-rw-r--r--sysdeps/ieee754/ldbl-96/s_iscanonicall.c44
-rw-r--r--sysdeps/ieee754/ldbl-96/s_issignalingl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_llrintl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_llroundl.c11
-rw-r--r--sysdeps/ieee754/ldbl-96/s_lrintl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_lroundl.c11
-rw-r--r--sysdeps/ieee754/ldbl-96/s_modfl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nexttoward.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nexttowardf.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nextupl.c86
-rw-r--r--sysdeps/ieee754/ldbl-96/s_remquol.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_roundevenl.c126
-rw-r--r--sysdeps/ieee754/ldbl-96/s_roundl.c25
-rw-r--r--sysdeps/ieee754/ldbl-96/s_setpayloadl.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/s_setpayloadl_main.c69
-rw-r--r--sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/s_signbitl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/s_sincosl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_sinl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_tanhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-96/s_tanl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_totalorderl.c59
-rw-r--r--sysdeps/ieee754/ldbl-96/s_totalordermagl.c53
-rw-r--r--sysdeps/ieee754/ldbl-96/s_ufromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_ufromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h30
-rw-r--r--sysdeps/ieee754/ldbl-96/strtold_l.c17
-rw-r--r--sysdeps/ieee754/ldbl-96/t_sincosl.c2
-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/w_expl.c34
-rw-r--r--sysdeps/ieee754/ldbl-96/x2y2m1.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/x2y2m1l.c38
-rw-r--r--sysdeps/ieee754/ldbl-opt/Makefile37
-rw-r--r--sysdeps/ieee754/ldbl-opt/Versions6
-rw-r--r--sysdeps/ieee754/ldbl-opt/bits/long-double.h24
-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/libm-alias-double.h72
-rw-r--r--sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h69
-rw-r--r--sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h3
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-compat.c10
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-compat.h22
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-dadd.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-dmul.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-dsub.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fadd.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fmul.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fsub.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c2
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-llogb.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c27
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-nextup.c27
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-pow10.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c2
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c4
-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/nldbl-ufromfp.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c2
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_asinh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_atan.c5
-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_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_cbrt.c5
-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_ceil.c5
-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.c31
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clog10l.c40
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clogl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_copysign.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_erf.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_expm1.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fabs.c5
-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_floor.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fma.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmal.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_frexp.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ldexp.c31
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ldexpl.c37
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_llrint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_llround.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_log1p.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_logb.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_lrint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_lround.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_modf.c6
-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_nearbyint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nextafter.c3
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_remquo.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_rint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_round.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_scalbln.c9
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_scalbn.c9
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_significand.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_significandl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_sin.c14
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_sincos.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_tan.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_tanh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_trunc.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c1
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acos.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acosh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acoshl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acosl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_asin.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_asinl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atan2.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atan2l.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atanh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atanhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_cosh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_coshl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10_compat.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10l.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c17
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_fmod.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_fmodl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_hypot.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_hypotl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_ilogb.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_ilogbl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j0.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j0l.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j1.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j1l.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_jn.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_jnl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_lgamma_r.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_lgammal_r.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log10.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log10l.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log2.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log2l.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_logl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_pow.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_powl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_remainder.c7
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_remainder_compat.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_remainderl.c7
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c19
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_scalb.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_scalb_compat.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_scalbl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sinh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sinhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sqrt.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sqrtl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_tgamma.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_tgammal.c5
-rw-r--r--sysdeps/ieee754/s_lib_version.c19
-rw-r--r--sysdeps/ieee754/s_matherr.c8
-rw-r--r--sysdeps/ieee754/soft-fp/Makefile (renamed from sysdeps/aarch64/soft-fp/Makefile)0
-rw-r--r--sysdeps/ieee754/soft-fp/s_daddl.c59
-rw-r--r--sysdeps/ieee754/soft-fp/s_ddivl.c59
-rw-r--r--sysdeps/ieee754/soft-fp/s_dmull.c59
-rw-r--r--sysdeps/ieee754/soft-fp/s_dsubl.c59
-rw-r--r--sysdeps/ieee754/soft-fp/s_fadd.c56
-rw-r--r--sysdeps/ieee754/soft-fp/s_faddl.c55
-rw-r--r--sysdeps/ieee754/soft-fp/s_fdiv.c56
-rw-r--r--sysdeps/ieee754/soft-fp/s_fdivl.c55
-rw-r--r--sysdeps/ieee754/soft-fp/s_fma.c68
-rw-r--r--sysdeps/ieee754/soft-fp/s_fmaf.c68
-rw-r--r--sysdeps/ieee754/soft-fp/s_fmal.c66
-rw-r--r--sysdeps/ieee754/soft-fp/s_fmul.c56
-rw-r--r--sysdeps/ieee754/soft-fp/s_fmull.c55
-rw-r--r--sysdeps/ieee754/soft-fp/s_fsub.c56
-rw-r--r--sysdeps/ieee754/soft-fp/s_fsubl.c55
-rw-r--r--sysdeps/init_array/crti.S14
-rw-r--r--sysdeps/init_array/elf-init.c2
-rw-r--r--sysdeps/init_array/gmon-start.c2
-rw-r--r--sysdeps/init_array/pt-crti.S2
-rw-r--r--sysdeps/m68k/Makefile19
-rw-r--r--sysdeps/m68k/__longjmp.c2
-rw-r--r--sysdeps/m68k/asm-syntax.h2
-rw-r--r--sysdeps/m68k/backtrace.c2
-rw-r--r--sysdeps/m68k/bits/byteswap.h88
-rw-r--r--sysdeps/m68k/bits/fenv.h131
-rw-r--r--sysdeps/m68k/bits/link.h2
-rw-r--r--sysdeps/m68k/bits/setjmp.h2
-rw-r--r--sysdeps/m68k/bsd-_setjmp.c2
-rw-r--r--sysdeps/m68k/bsd-setjmp.c2
-rw-r--r--sysdeps/m68k/coldfire/atomic-machine.h5
-rw-r--r--sysdeps/m68k/coldfire/fpu/bits/mathinline.h44
-rw-r--r--sysdeps/m68k/coldfire/fpu/e_sqrt.c2
-rw-r--r--sysdeps/m68k/coldfire/fpu/e_sqrtf.c2
-rw-r--r--sysdeps/m68k/coldfire/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/m68k/coldfire/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/m68k/coldfire/fpu/math_private.h10
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_fabs.c10
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_fabsf.c6
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_lrint.c10
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_lrintf.c6
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_rint.c10
-rw-r--r--sysdeps/m68k/coldfire/fpu/s_rintf.c6
-rw-r--r--sysdeps/m68k/coldfire/ldbl-classify-compat.h8
-rw-r--r--sysdeps/m68k/coldfire/math-tests.h29
-rw-r--r--sysdeps/m68k/coldfire/nofpu/Implies1
-rw-r--r--sysdeps/m68k/coldfire/nofpu/s_fma.c1
-rw-r--r--sysdeps/m68k/coldfire/nofpu/s_fmaf.c1
-rw-r--r--sysdeps/m68k/coldfire/sysdep.h2
-rw-r--r--sysdeps/m68k/crti.S4
-rw-r--r--sysdeps/m68k/crtn.S2
-rw-r--r--sysdeps/m68k/dl-machine.h11
-rw-r--r--sysdeps/m68k/dl-tls.h5
-rw-r--r--sysdeps/m68k/dl-trampoline.S2
-rw-r--r--sysdeps/m68k/ffs.c2
-rw-r--r--sysdeps/m68k/fpu/bits/fenv.h87
-rw-r--r--sysdeps/m68k/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/m68k/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/m68k/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/m68k/fpu/fegetenv.c2
-rw-r--r--sysdeps/m68k/fpu/fegetexcept.c2
-rw-r--r--sysdeps/m68k/fpu/fegetmode.c27
-rw-r--r--sysdeps/m68k/fpu/fegetround.c2
-rw-r--r--sysdeps/m68k/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/m68k/fpu/fesetenv.c2
-rw-r--r--sysdeps/m68k/fpu/fesetexcept.c31
-rw-r--r--sysdeps/m68k/fpu/fesetmode.c32
-rw-r--r--sysdeps/m68k/fpu/fesetround.c2
-rw-r--r--sysdeps/m68k/fpu/feupdateenv.c2
-rw-r--r--sysdeps/m68k/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/m68k/fpu/fsetexcptflg.c2
-rw-r--r--sysdeps/m68k/fpu/ftestexcept.c2
-rw-r--r--sysdeps/m68k/fpu_control.h2
-rw-r--r--sysdeps/m68k/gccframe.h2
-rw-r--r--sysdeps/m68k/jmpbuf-unwind.h2
-rw-r--r--sysdeps/m68k/ldsodefs.h2
-rw-r--r--sysdeps/m68k/libc-tls.c2
-rw-r--r--sysdeps/m68k/m680x0/add_n.S2
-rw-r--r--sysdeps/m68k/m680x0/bits/flt-eval-method.h25
-rw-r--r--sysdeps/m68k/m680x0/bits/fp-logb.h24
-rw-r--r--sysdeps/m68k/m680x0/bits/huge_vall.h41
-rw-r--r--sysdeps/m68k/m680x0/bits/mathdef.h37
-rw-r--r--sysdeps/m68k/m680x0/fpu/bits/mathinline.h257
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_acos.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_atan2.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_exp2f_data.c (renamed from sysdeps/m68k/m680x0/fpu/slowpow.c)0
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_fmod.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_ilogb.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_log2f_data.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_logf_data.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_pow.c6
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/e_scalb.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/k_rem_pio2l.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/libm-test-ulps8
-rw-r--r--sysdeps/m68k/m680x0/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/m68k/m680x0/fpu/math-barriers.h37
-rw-r--r--sysdeps/m68k/m680x0/fpu/math_errf.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/math_private.h20
-rw-r--r--sysdeps/m68k/m680x0/fpu/mathimpl.h38
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_atan.c36
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_atan_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_atanf.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_atanl.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ccosh.c76
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ccosh_template.c68
-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_ceil.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ceil_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ceilf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ceill.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cexp.c136
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cexp_template.c129
-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_cos.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cos_template.c30
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cosf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cosl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csin.c67
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csin_template.c59
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinf.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinh.c69
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinh_template.c62
-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/m680x0/fpu/s_expm1.c29
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_expm1_template.c30
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_expm1f.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_expm1l.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_fabs.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_fabs_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_fabsf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_fabsl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_floor.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_floor_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_floorf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_floorl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_frexp.c55
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_frexp_template.c45
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_frexpf.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_frexpl.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_isinf.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_llrint.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_llrintf.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_llrintl.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_log1p.c38
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_log1pf.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_log1pl.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_lrint.c39
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_lrint_template.c28
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_lrintf.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_lrintl.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_modf.c55
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_modf_template.c43
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_modff.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_modfl.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nearbyint.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nearbyintf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nearbyintl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nextafterl.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_remquo.c48
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_remquo_template.c36
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_remquof.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_remquol.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_rint.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_rint_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_rintf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_rintl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_scalbn.c2
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_significand.c23
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_significandf.c6
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_significandl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sin.c40
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sin_template.c30
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sincos.c36
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sincos_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sincosf.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sincosl.c5
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sinf.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_sinl.c7
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tan.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tan_template.c30
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanh.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanh_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanhf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanhl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_tanl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_trunc.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_trunc_template.c26
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_truncf.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_truncl.c4
-rw-r--r--sysdeps/m68k/m680x0/fpu/w_exp2f.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/w_expf.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/w_log2f.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/w_logf.c1
-rw-r--r--sysdeps/m68k/m680x0/fpu/w_powf.c1
-rw-r--r--sysdeps/m68k/m680x0/lshift.S2
-rw-r--r--sysdeps/m68k/m680x0/m68020/addmul_1.S2
-rw-r--r--sysdeps/m68k/m680x0/m68020/atomic-machine.h19
-rw-r--r--sysdeps/m68k/m680x0/m68020/bits/string.h24
-rw-r--r--sysdeps/m68k/m680x0/m68020/mul_1.S2
-rw-r--r--sysdeps/m68k/m680x0/m68020/string_private.h2
-rw-r--r--sysdeps/m68k/m680x0/m68020/submul_1.S2
-rw-r--r--sysdeps/m68k/m680x0/rshift.S2
-rw-r--r--sysdeps/m68k/m680x0/sub_n.S2
-rw-r--r--sysdeps/m68k/m680x0/sysdep.h2
-rw-r--r--sysdeps/m68k/memchr.S2
-rw-r--r--sysdeps/m68k/memcopy.h2
-rw-r--r--sysdeps/m68k/memusage.h2
-rw-r--r--sysdeps/m68k/nptl/Makefile2
-rw-r--r--sysdeps/m68k/nptl/bits/pthreadtypes-arch.h63
-rw-r--r--sysdeps/m68k/nptl/bits/pthreadtypes.h180
-rw-r--r--sysdeps/m68k/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/m68k/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/m68k/nptl/pthread_spin_lock.c24
-rw-r--r--sysdeps/m68k/nptl/pthreaddef.h2
-rw-r--r--sysdeps/m68k/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/m68k/nptl/tls.h15
-rw-r--r--sysdeps/m68k/preconfigure6
-rw-r--r--sysdeps/m68k/rawmemchr.S2
-rw-r--r--sysdeps/m68k/setjmp.c2
-rw-r--r--sysdeps/m68k/sotruss-lib.c2
-rw-r--r--sysdeps/m68k/stackinfo.h2
-rw-r--r--sysdeps/m68k/start.S4
-rw-r--r--sysdeps/m68k/strchr.S2
-rw-r--r--sysdeps/m68k/strchrnul.S2
-rw-r--r--sysdeps/m68k/symbol-hacks.h21
-rw-r--r--sysdeps/m68k/sys/ucontext.h82
-rw-r--r--sysdeps/m68k/sysdep.h2
-rw-r--r--sysdeps/m68k/tls-macros.h2
-rw-r--r--sysdeps/m68k/tst-audit.h2
-rw-r--r--sysdeps/m68k/wcpcpy.c2
-rw-r--r--sysdeps/m68k/wcpcpy_chk.c2
-rw-r--r--sysdeps/mach/Makefile28
-rw-r--r--sysdeps/mach/_strerror.c2
-rw-r--r--sysdeps/mach/adjtime.c2
-rw-r--r--sysdeps/mach/configure2
-rw-r--r--sysdeps/mach/configure.ac2
-rw-r--r--sysdeps/mach/getloadavg.c2
-rw-r--r--sysdeps/mach/getpagesize.c2
-rw-r--r--sysdeps/mach/getsysstats.c6
-rw-r--r--sysdeps/mach/gettimeofday.c2
-rw-r--r--sysdeps/mach/htl/Implies1
-rw-r--r--sysdeps/mach/htl/bits/spin-lock-inline.h87
-rw-r--r--sysdeps/mach/htl/bits/types/__pthread_spinlock_t.h34
-rw-r--r--sysdeps/mach/htl/pt-block.c38
-rw-r--r--sysdeps/mach/htl/pt-spin.c31
-rw-r--r--sysdeps/mach/htl/pt-stack-alloc.c67
-rw-r--r--sysdeps/mach/htl/pt-thread-alloc.c94
-rw-r--r--sysdeps/mach/htl/pt-thread-start.c53
-rw-r--r--sysdeps/mach/htl/pt-thread-terminate.c82
-rw-r--r--sysdeps/mach/htl/pt-timedblock.c65
-rw-r--r--sysdeps/mach/htl/pt-wakeup.c37
-rw-r--r--sysdeps/mach/hurd/Makefile15
-rw-r--r--sysdeps/mach/hurd/Versions23
-rw-r--r--sysdeps/mach/hurd/_exit.c2
-rw-r--r--sysdeps/mach/hurd/accept.c2
-rw-r--r--sysdeps/mach/hurd/accept4.c2
-rw-r--r--sysdeps/mach/hurd/access.c134
-rw-r--r--sysdeps/mach/hurd/adjtime.c6
-rw-r--r--sysdeps/mach/hurd/bind.c2
-rw-r--r--sysdeps/mach/hurd/bits/errno.h705
-rw-r--r--sysdeps/mach/hurd/bits/fcntl.h4
-rw-r--r--sysdeps/mach/hurd/bits/ioctls.h2
-rw-r--r--sysdeps/mach/hurd/bits/local_lim.h11
-rw-r--r--sysdeps/mach/hurd/bits/param.h4
-rw-r--r--sysdeps/mach/hurd/bits/posix_opt.h54
-rw-r--r--sysdeps/mach/hurd/bits/socket.h41
-rw-r--r--sysdeps/mach/hurd/bits/stat.h7
-rw-r--r--sysdeps/mach/hurd/bits/statfs.h18
-rw-r--r--sysdeps/mach/hurd/bits/statvfs.h18
-rw-r--r--sysdeps/mach/hurd/bits/sysmacros.h60
-rw-r--r--sysdeps/mach/hurd/bits/types/error_t.h29
-rw-r--r--sysdeps/mach/hurd/bits/typesizes.h2
-rw-r--r--sysdeps/mach/hurd/brk.c2
-rw-r--r--sysdeps/mach/hurd/chdir.c2
-rw-r--r--sysdeps/mach/hurd/check_fds.c2
-rw-r--r--sysdeps/mach/hurd/check_native.c1
-rw-r--r--sysdeps/mach/hurd/check_pf.c1
-rw-r--r--sysdeps/mach/hurd/chflags.c2
-rw-r--r--sysdeps/mach/hurd/chmod.c3
-rw-r--r--sysdeps/mach/hurd/chown.c2
-rw-r--r--sysdeps/mach/hurd/chroot.c2
-rw-r--r--sysdeps/mach/hurd/clock.c2
-rw-r--r--sysdeps/mach/hurd/close.c2
-rw-r--r--sysdeps/mach/hurd/closedir.c2
-rw-r--r--sysdeps/mach/hurd/configure4
-rw-r--r--sysdeps/mach/hurd/configure.ac8
-rw-r--r--sysdeps/mach/hurd/connect.c2
-rw-r--r--sysdeps/mach/hurd/cthreads.c23
-rw-r--r--sysdeps/mach/hurd/device-nrs.h2
-rw-r--r--sysdeps/mach/hurd/dirfd.c7
-rw-r--r--sysdeps/mach/hurd/dirstream.h2
-rw-r--r--sysdeps/mach/hurd/dl-execstack.c3
-rw-r--r--sysdeps/mach/hurd/dl-fcntl.h22
-rw-r--r--sysdeps/mach/hurd/dl-mman.h2
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c123
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.h2
-rw-r--r--sysdeps/mach/hurd/dl-unistd.h12
-rw-r--r--sysdeps/mach/hurd/dup2.c2
-rw-r--r--sysdeps/mach/hurd/dup3.c2
-rw-r--r--sysdeps/mach/hurd/eloop-threshold.h2
-rw-r--r--sysdeps/mach/hurd/enbl-secure.c9
-rw-r--r--sysdeps/mach/hurd/errlist.c2
-rw-r--r--sysdeps/mach/hurd/errno-loc.c20
-rw-r--r--sysdeps/mach/hurd/errno.c1
-rw-r--r--sysdeps/mach/hurd/errnos.awk218
-rw-r--r--sysdeps/mach/hurd/euidaccess.c33
-rw-r--r--sysdeps/mach/hurd/execve.c38
-rw-r--r--sysdeps/mach/hurd/faccessat.c183
-rw-r--r--sysdeps/mach/hurd/fchdir.c2
-rw-r--r--sysdeps/mach/hurd/fchflags.c2
-rw-r--r--sysdeps/mach/hurd/fchmod.c2
-rw-r--r--sysdeps/mach/hurd/fchmodat.c2
-rw-r--r--sysdeps/mach/hurd/fchown.c2
-rw-r--r--sysdeps/mach/hurd/fchownat.c2
-rw-r--r--sysdeps/mach/hurd/fcntl.c7
-rw-r--r--sysdeps/mach/hurd/fdatasync.c2
-rw-r--r--sysdeps/mach/hurd/fdopendir.c2
-rw-r--r--sysdeps/mach/hurd/fexecve.c7
-rw-r--r--sysdeps/mach/hurd/fgetxattr.c2
-rw-r--r--sysdeps/mach/hurd/flistxattr.c2
-rw-r--r--sysdeps/mach/hurd/flock.c2
-rw-r--r--sysdeps/mach/hurd/fork.c62
-rw-r--r--sysdeps/mach/hurd/fpathconf.c2
-rw-r--r--sysdeps/mach/hurd/fremovexattr.c2
-rw-r--r--sysdeps/mach/hurd/fsetxattr.c2
-rw-r--r--sysdeps/mach/hurd/fstatfs.c2
-rw-r--r--sysdeps/mach/hurd/fstatfs64.c2
-rw-r--r--sysdeps/mach/hurd/fstatvfs.c2
-rw-r--r--sysdeps/mach/hurd/fstatvfs64.c2
-rw-r--r--sysdeps/mach/hurd/fsync.c2
-rw-r--r--sysdeps/mach/hurd/ftruncate.c2
-rw-r--r--sysdeps/mach/hurd/ftruncate64.c34
-rw-r--r--sysdeps/mach/hurd/futimens.c50
-rw-r--r--sysdeps/mach/hurd/futimes.c28
-rw-r--r--sysdeps/mach/hurd/futimesat.c45
-rw-r--r--sysdeps/mach/hurd/fxstat.c2
-rw-r--r--sysdeps/mach/hurd/fxstat64.c2
-rw-r--r--sysdeps/mach/hurd/fxstatat.c2
-rw-r--r--sysdeps/mach/hurd/fxstatat64.c2
-rw-r--r--sysdeps/mach/hurd/gai_misc.h67
-rw-r--r--sysdeps/mach/hurd/getclktck.c2
-rw-r--r--sysdeps/mach/hurd/getcwd.c11
-rw-r--r--sysdeps/mach/hurd/getdomain.c2
-rw-r--r--sysdeps/mach/hurd/getdtsz.c2
-rw-r--r--sysdeps/mach/hurd/getegid.c2
-rw-r--r--sysdeps/mach/hurd/geteuid.c2
-rw-r--r--sysdeps/mach/hurd/getgid.c2
-rw-r--r--sysdeps/mach/hurd/getgroups.c2
-rw-r--r--sysdeps/mach/hurd/gethostid.c2
-rw-r--r--sysdeps/mach/hurd/gethostname.c2
-rw-r--r--sysdeps/mach/hurd/getitimer.c2
-rw-r--r--sysdeps/mach/hurd/getlogin.c2
-rw-r--r--sysdeps/mach/hurd/getlogin_r.c2
-rw-r--r--sysdeps/mach/hurd/getpeername.c2
-rw-r--r--sysdeps/mach/hurd/getpgid.c2
-rw-r--r--sysdeps/mach/hurd/getpid.c2
-rw-r--r--sysdeps/mach/hurd/getppid.c2
-rw-r--r--sysdeps/mach/hurd/getpriority.c2
-rw-r--r--sysdeps/mach/hurd/getresgid.c19
-rw-r--r--sysdeps/mach/hurd/getresuid.c19
-rw-r--r--sysdeps/mach/hurd/getrlimit.c2
-rw-r--r--sysdeps/mach/hurd/getrusage.c2
-rw-r--r--sysdeps/mach/hurd/getsid.c2
-rw-r--r--sysdeps/mach/hurd/getsockname.c2
-rw-r--r--sysdeps/mach/hurd/getsockopt.c2
-rw-r--r--sysdeps/mach/hurd/getuid.c2
-rw-r--r--sysdeps/mach/hurd/getxattr.c2
-rw-r--r--sysdeps/mach/hurd/group_member.c2
-rw-r--r--sysdeps/mach/hurd/hp-timing.h21
-rw-r--r--sysdeps/mach/hurd/htl/Implies2
-rw-r--r--sysdeps/mach/hurd/htl/bits/pthread-np.h37
-rw-r--r--sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h49
-rw-r--r--sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c28
-rw-r--r--sysdeps/mach/hurd/htl/pt-attr-setstacksize.c28
-rw-r--r--sysdeps/mach/hurd/htl/pt-docancel.c66
-rw-r--r--sysdeps/mach/hurd/htl/pt-hurd-cond-timedwait.c169
-rw-r--r--sysdeps/mach/hurd/htl/pt-hurd-cond-wait.c40
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-consistent.c47
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-destroy.c37
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c34
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-init.c57
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-lock.c80
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c35
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-timedlock.c78
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c76
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-trylock.c84
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-unlock.c91
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex.h90
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-destroy.c33
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-getprioceiling.c34
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-getprotocol.c31
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-getpshared.c31
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c34
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-gettype.c31
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-init.c39
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-setprioceiling.c34
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c33
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c34
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-setrobust.c36
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-settype.c35
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr.c1
-rw-r--r--sysdeps/mach/hurd/htl/pt-sigstate-destroy.c26
-rw-r--r--sysdeps/mach/hurd/htl/pt-sigstate-init.c44
-rw-r--r--sysdeps/mach/hurd/htl/pt-sigstate.c70
-rw-r--r--sysdeps/mach/hurd/htl/pt-sysdep.c100
-rw-r--r--sysdeps/mach/hurd/htl/pt-sysdep.h65
-rw-r--r--sysdeps/mach/hurd/i386/Implies2
-rw-r--r--sysdeps/mach/hurd/i386/Makefile96
-rw-r--r--sysdeps/mach/hurd/i386/____longjmp_chk.S6
-rw-r--r--sysdeps/mach/hurd/i386/bits/sigcontext.h10
-rw-r--r--sysdeps/mach/hurd/i386/c++-types.data67
-rw-r--r--sysdeps/mach/hurd/i386/exc2signal.c3
-rw-r--r--sysdeps/mach/hurd/i386/htl/Implies2
-rw-r--r--sysdeps/mach/hurd/i386/htl/pt-machdep.c82
-rw-r--r--sysdeps/mach/hurd/i386/htl/pt-setup.c110
-rw-r--r--sysdeps/mach/hurd/i386/init-first.c84
-rw-r--r--sysdeps/mach/hurd/i386/intr-msg.h2
-rw-r--r--sysdeps/mach/hurd/i386/ioperm.c2
-rw-r--r--sysdeps/mach/hurd/i386/jmp_buf-macros.h6
-rw-r--r--sysdeps/mach/hurd/i386/ld.abilist25
-rw-r--r--sysdeps/mach/hurd/i386/libBrokenLocale.abilist1
-rw-r--r--sysdeps/mach/hurd/i386/libanl.abilist4
-rw-r--r--sysdeps/mach/hurd/i386/libc.abilist2306
-rw-r--r--sysdeps/mach/hurd/i386/libcrypt.abilist7
-rw-r--r--sysdeps/mach/hurd/i386/libdl.abilist9
-rw-r--r--sysdeps/mach/hurd/i386/libm.abilist1070
-rw-r--r--sysdeps/mach/hurd/i386/libnsl.abilist121
-rw-r--r--sysdeps/mach/hurd/i386/libpthread.abilist149
-rw-r--r--sysdeps/mach/hurd/i386/libresolv.abilist91
-rw-r--r--sysdeps/mach/hurd/i386/librt.abilist42
-rw-r--r--sysdeps/mach/hurd/i386/libutil.abilist6
-rw-r--r--sysdeps/mach/hurd/i386/localplt.data64
-rw-r--r--sysdeps/mach/hurd/i386/longjmp-ts.c2
-rw-r--r--sysdeps/mach/hurd/i386/sigcontextinfo.h7
-rw-r--r--sysdeps/mach/hurd/i386/signal-defines.sym6
-rw-r--r--sysdeps/mach/hurd/i386/sigreturn.c7
-rw-r--r--sysdeps/mach/hurd/i386/static-start.S2
-rw-r--r--sysdeps/mach/hurd/i386/sys/io.h2
-rw-r--r--sysdeps/mach/hurd/i386/tls.h79
-rw-r--r--sysdeps/mach/hurd/i386/tlsdesc.sym19
-rw-r--r--sysdeps/mach/hurd/i386/trampoline.c4
-rw-r--r--sysdeps/mach/hurd/if_index.c9
-rw-r--r--sysdeps/mach/hurd/ifreq.c4
-rw-r--r--sysdeps/mach/hurd/ifreq.h16
-rw-r--r--sysdeps/mach/hurd/ioctl.c3
-rw-r--r--sysdeps/mach/hurd/isatty.c2
-rw-r--r--sysdeps/mach/hurd/jmp-unwind.c2
-rw-r--r--sysdeps/mach/hurd/kernel-features.h6
-rw-r--r--sysdeps/mach/hurd/kill.c3
-rw-r--r--sysdeps/mach/hurd/lchmod.c2
-rw-r--r--sysdeps/mach/hurd/lchown.c2
-rw-r--r--sysdeps/mach/hurd/lgetxattr.c2
-rw-r--r--sysdeps/mach/hurd/libc-lock.h216
-rw-r--r--sysdeps/mach/hurd/libc-start.h31
-rw-r--r--sysdeps/mach/hurd/libc-tsd.h34
-rw-r--r--sysdeps/mach/hurd/libhurduser.abilist0
-rw-r--r--sysdeps/mach/hurd/link.c2
-rw-r--r--sysdeps/mach/hurd/linkat.c2
-rw-r--r--sysdeps/mach/hurd/listen.c2
-rw-r--r--sysdeps/mach/hurd/listxattr.c2
-rw-r--r--sysdeps/mach/hurd/llistxattr.c2
-rw-r--r--sysdeps/mach/hurd/lremovexattr.c2
-rw-r--r--sysdeps/mach/hurd/lseek.c14
-rw-r--r--sysdeps/mach/hurd/lseek64.c2
-rw-r--r--sysdeps/mach/hurd/lsetxattr.c2
-rw-r--r--sysdeps/mach/hurd/lutimes.c23
-rw-r--r--sysdeps/mach/hurd/lxstat.c2
-rw-r--r--sysdeps/mach/hurd/lxstat64.c2
-rw-r--r--sysdeps/mach/hurd/malloc-machine.h31
-rw-r--r--sysdeps/mach/hurd/mig-reply.c45
-rw-r--r--sysdeps/mach/hurd/mkdir.c3
-rw-r--r--sysdeps/mach/hurd/mkdirat.c2
-rw-r--r--sysdeps/mach/hurd/mlock.c2
-rw-r--r--sysdeps/mach/hurd/mlockall.c42
-rw-r--r--sysdeps/mach/hurd/mmap.c23
-rw-r--r--sysdeps/mach/hurd/mmap64.c7
-rw-r--r--sysdeps/mach/hurd/munlock.c2
-rw-r--r--sysdeps/mach/hurd/munlockall.c40
-rw-r--r--sysdeps/mach/hurd/net/ethernet.h11
-rw-r--r--sysdeps/mach/hurd/net/if_arp.h5
-rw-r--r--sysdeps/mach/hurd/net/if_ether.h2
-rw-r--r--sysdeps/mach/hurd/net/if_ppp.h169
-rw-r--r--sysdeps/mach/hurd/net/route.h14
-rw-r--r--sysdeps/mach/hurd/not-errno.h21
-rw-r--r--sysdeps/mach/hurd/open.c2
-rw-r--r--sysdeps/mach/hurd/openat.c4
-rw-r--r--sysdeps/mach/hurd/opendir.c7
-rw-r--r--sysdeps/mach/hurd/pathconf.c2
-rw-r--r--sysdeps/mach/hurd/pipe.c23
-rw-r--r--sysdeps/mach/hurd/pipe2.c59
-rw-r--r--sysdeps/mach/hurd/poll.c2
-rw-r--r--sysdeps/mach/hurd/ppoll.c2
-rw-r--r--sysdeps/mach/hurd/pread.c2
-rw-r--r--sysdeps/mach/hurd/pread64.c3
-rw-r--r--sysdeps/mach/hurd/profil.c24
-rw-r--r--sysdeps/mach/hurd/pselect.c2
-rw-r--r--sysdeps/mach/hurd/ptrace.c4
-rw-r--r--sysdeps/mach/hurd/ptsname.c25
-rw-r--r--sysdeps/mach/hurd/pwrite.c2
-rw-r--r--sysdeps/mach/hurd/pwrite64.c2
-rw-r--r--sysdeps/mach/hurd/read.c3
-rw-r--r--sysdeps/mach/hurd/readdir.c2
-rw-r--r--sysdeps/mach/hurd/readdir64.c3
-rw-r--r--sysdeps/mach/hurd/readdir64_r.c2
-rw-r--r--sysdeps/mach/hurd/readdir_r.c2
-rw-r--r--sysdeps/mach/hurd/readlink.c2
-rw-r--r--sysdeps/mach/hurd/readlinkat.c2
-rw-r--r--sysdeps/mach/hurd/reboot.c7
-rw-r--r--sysdeps/mach/hurd/recv.c10
-rw-r--r--sysdeps/mach/hurd/recvfrom.c2
-rw-r--r--sysdeps/mach/hurd/recvmsg.c6
-rw-r--r--sysdeps/mach/hurd/removexattr.c2
-rw-r--r--sysdeps/mach/hurd/rename.c2
-rw-r--r--sysdeps/mach/hurd/renameat.c6
-rw-r--r--sysdeps/mach/hurd/revoke.c6
-rw-r--r--sysdeps/mach/hurd/rewinddir.c4
-rw-r--r--sysdeps/mach/hurd/rmdir.c2
-rw-r--r--sysdeps/mach/hurd/sbrk.c2
-rw-r--r--sysdeps/mach/hurd/seekdir.c7
-rw-r--r--sysdeps/mach/hurd/select.c2
-rw-r--r--sysdeps/mach/hurd/send.c6
-rw-r--r--sysdeps/mach/hurd/sendfile.c6
-rw-r--r--sysdeps/mach/hurd/sendfile64.c7
-rw-r--r--sysdeps/mach/hurd/sendmsg.c2
-rw-r--r--sysdeps/mach/hurd/sendto.c2
-rw-r--r--sysdeps/mach/hurd/setdomain.c2
-rw-r--r--sysdeps/mach/hurd/setegid.c2
-rw-r--r--sysdeps/mach/hurd/seteuid.c2
-rw-r--r--sysdeps/mach/hurd/setgid.c2
-rw-r--r--sysdeps/mach/hurd/setgroups.c2
-rw-r--r--sysdeps/mach/hurd/sethostid.c2
-rw-r--r--sysdeps/mach/hurd/sethostname.c2
-rw-r--r--sysdeps/mach/hurd/setitimer.c4
-rw-r--r--sysdeps/mach/hurd/setlogin.c2
-rw-r--r--sysdeps/mach/hurd/setpgid.c12
-rw-r--r--sysdeps/mach/hurd/setpriority.c2
-rw-r--r--sysdeps/mach/hurd/setregid.c2
-rw-r--r--sysdeps/mach/hurd/setresgid.c2
-rw-r--r--sysdeps/mach/hurd/setresuid.c2
-rw-r--r--sysdeps/mach/hurd/setreuid.c2
-rw-r--r--sysdeps/mach/hurd/setrlimit.c3
-rw-r--r--sysdeps/mach/hurd/setsid.c12
-rw-r--r--sysdeps/mach/hurd/setsockopt.c2
-rw-r--r--sysdeps/mach/hurd/settimeofday.c2
-rw-r--r--sysdeps/mach/hurd/setuid.c2
-rw-r--r--sysdeps/mach/hurd/setxattr.c2
-rw-r--r--sysdeps/mach/hurd/shutdown.c2
-rw-r--r--sysdeps/mach/hurd/sigaction.c2
-rw-r--r--sysdeps/mach/hurd/sigaltstack.c9
-rw-r--r--sysdeps/mach/hurd/siglist.h2
-rw-r--r--sysdeps/mach/hurd/sigpending.c2
-rw-r--r--sysdeps/mach/hurd/sigprocmask.c3
-rw-r--r--sysdeps/mach/hurd/sigstack.c4
-rw-r--r--sysdeps/mach/hurd/sigsuspend.c3
-rw-r--r--sysdeps/mach/hurd/sigwait.c2
-rw-r--r--sysdeps/mach/hurd/socket.c17
-rw-r--r--sysdeps/mach/hurd/socketpair.c29
-rw-r--r--sysdeps/mach/hurd/spawni.c80
-rw-r--r--sysdeps/mach/hurd/statfs.c2
-rw-r--r--sysdeps/mach/hurd/statfs64.c2
-rw-r--r--sysdeps/mach/hurd/statfsconv.c2
-rw-r--r--sysdeps/mach/hurd/statvfs.c2
-rw-r--r--sysdeps/mach/hurd/statvfs64.c2
-rw-r--r--sysdeps/mach/hurd/symlink.c2
-rw-r--r--sysdeps/mach/hurd/symlinkat.c2
-rw-r--r--sysdeps/mach/hurd/sync.c2
-rw-r--r--sysdeps/mach/hurd/syncfs.c2
-rw-r--r--sysdeps/mach/hurd/sysconf.c2
-rw-r--r--sysdeps/mach/hurd/sysdep-cancel.h9
-rw-r--r--sysdeps/mach/hurd/telldir.c2
-rw-r--r--sysdeps/mach/hurd/times.c2
-rw-r--r--sysdeps/mach/hurd/tls.h23
-rw-r--r--sysdeps/mach/hurd/tmpfile.c2
-rw-r--r--sysdeps/mach/hurd/truncate.c2
-rw-r--r--sysdeps/mach/hurd/truncate64.c42
-rw-r--r--sysdeps/mach/hurd/ttyname.c2
-rw-r--r--sysdeps/mach/hurd/ttyname_r.c2
-rw-r--r--sysdeps/mach/hurd/umask.c2
-rw-r--r--sysdeps/mach/hurd/uname.c2
-rw-r--r--sysdeps/mach/hurd/unlink.c2
-rw-r--r--sysdeps/mach/hurd/unlinkat.c2
-rw-r--r--sysdeps/mach/hurd/utime-helper.c154
-rw-r--r--sysdeps/mach/hurd/utimensat.c46
-rw-r--r--sysdeps/mach/hurd/utimes.c24
-rw-r--r--sysdeps/mach/hurd/wait4.c5
-rw-r--r--sysdeps/mach/hurd/write.c3
-rw-r--r--sysdeps/mach/hurd/x86/dl-sysdep.c21
-rw-r--r--sysdeps/mach/hurd/xmknod.c2
-rw-r--r--sysdeps/mach/hurd/xmknodat.c7
-rw-r--r--sysdeps/mach/hurd/xstat.c2
-rw-r--r--sysdeps/mach/hurd/xstat64.c2
-rw-r--r--sysdeps/mach/hurd/xstatconv.c2
-rw-r--r--sysdeps/mach/i386/bits/mach/param.h25
-rw-r--r--sysdeps/mach/i386/machine-lock.h14
-rw-r--r--sysdeps/mach/i386/machine-sp.h2
-rw-r--r--sysdeps/mach/i386/syscall.S5
-rw-r--r--sysdeps/mach/i386/sysdep.h2
-rw-r--r--sysdeps/mach/i386/thread_state.h4
-rw-r--r--sysdeps/mach/include/lock-intern.h14
-rw-r--r--sysdeps/mach/include/mach-shortcuts-hidden.h15
-rw-r--r--sysdeps/mach/include/mach.h8
-rw-r--r--sysdeps/mach/include/mach/mach_traps.h23
-rw-r--r--sysdeps/mach/include/mach/mig_support.h8
-rw-r--r--sysdeps/mach/include/mach_error.h6
-rw-r--r--sysdeps/mach/libc-lock.h185
-rw-r--r--sysdeps/mach/libmachuser.abilist0
-rw-r--r--sysdeps/mach/mprotect.c5
-rw-r--r--sysdeps/mach/msync.c4
-rw-r--r--sysdeps/mach/munmap.c5
-rw-r--r--sysdeps/mach/nanosleep.c2
-rw-r--r--sysdeps/mach/pagecopy.h6
-rw-r--r--sysdeps/mach/readonly-area.c2
-rw-r--r--sysdeps/mach/sched_yield.c2
-rw-r--r--sysdeps/mach/sleep.c2
-rw-r--r--sysdeps/mach/strerror_l.c15
-rw-r--r--sysdeps/mach/sys/reboot.h6
-rw-r--r--sysdeps/mach/sysdep.h2
-rw-r--r--sysdeps/mach/thread_state.h5
-rw-r--r--sysdeps/mach/usleep.c2
-rw-r--r--sysdeps/mach/xpg-strerror.c2
-rw-r--r--sysdeps/microblaze/Implies1
-rw-r--r--sysdeps/microblaze/__longjmp.S2
-rw-r--r--sysdeps/microblaze/_mcount.S2
-rw-r--r--sysdeps/microblaze/asm-syntax.h2
-rw-r--r--sysdeps/microblaze/atomic-machine.h11
-rw-r--r--sysdeps/microblaze/backtrace.c4
-rw-r--r--sysdeps/microblaze/backtrace_linux.c2
-rw-r--r--sysdeps/microblaze/bits/endian.h2
-rw-r--r--sysdeps/microblaze/bits/fenv.h10
-rw-r--r--sysdeps/microblaze/bits/link.h2
-rw-r--r--sysdeps/microblaze/bits/setjmp.h4
-rw-r--r--sysdeps/microblaze/bsd-_setjmp.S2
-rw-r--r--sysdeps/microblaze/bsd-setjmp.S2
-rw-r--r--sysdeps/microblaze/crti.S4
-rw-r--r--sysdeps/microblaze/crtn.S2
-rw-r--r--sysdeps/microblaze/dl-machine.h5
-rw-r--r--sysdeps/microblaze/dl-tls.h5
-rw-r--r--sysdeps/microblaze/dl-trampoline.S2
-rw-r--r--sysdeps/microblaze/gccframe.h2
-rw-r--r--sysdeps/microblaze/jmpbuf-unwind.h2
-rw-r--r--sysdeps/microblaze/ldbl-classify-compat.h8
-rw-r--r--sysdeps/microblaze/ldsodefs.h2
-rw-r--r--sysdeps/microblaze/libc-tls.c2
-rw-r--r--sysdeps/microblaze/libm-test-ulps203
-rw-r--r--sysdeps/microblaze/libm-test-ulps-name1
-rw-r--r--sysdeps/microblaze/machine-gmon.h2
-rw-r--r--sysdeps/microblaze/math_private.h39
-rw-r--r--sysdeps/microblaze/memusage.h2
-rw-r--r--sysdeps/microblaze/nptl/Makefile2
-rw-r--r--sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h72
-rw-r--r--sysdeps/microblaze/nptl/bits/pthreadtypes.h181
-rw-r--r--sysdeps/microblaze/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/microblaze/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/microblaze/nptl/pthread_spin_lock.c24
-rw-r--r--sysdeps/microblaze/nptl/pthreaddef.h2
-rw-r--r--sysdeps/microblaze/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/microblaze/nptl/tls.h15
-rw-r--r--sysdeps/microblaze/s_fma.c1
-rw-r--r--sysdeps/microblaze/s_fmaf.c1
-rw-r--r--sysdeps/microblaze/setjmp.S2
-rw-r--r--sysdeps/microblaze/sotruss-lib.c2
-rw-r--r--sysdeps/microblaze/stackinfo.h2
-rw-r--r--sysdeps/microblaze/start.S2
-rw-r--r--sysdeps/microblaze/sysdep.h2
-rw-r--r--sysdeps/microblaze/tls-macros.h2
-rw-r--r--sysdeps/microblaze/tst-audit.h2
-rw-r--r--sysdeps/mips/Makefile8
-rw-r--r--sysdeps/mips/__longjmp.c2
-rw-r--r--sysdeps/mips/add_n.S2
-rw-r--r--sysdeps/mips/addmul_1.S2
-rw-r--r--sysdeps/mips/atomic-machine.h367
-rw-r--r--sysdeps/mips/backtrace.c1
-rw-r--r--sysdeps/mips/bits/dlfcn.h2
-rw-r--r--sysdeps/mips/bits/fenv.h10
-rw-r--r--sysdeps/mips/bits/ipctypes.h2
-rw-r--r--sysdeps/mips/bits/link.h2
-rw-r--r--sysdeps/mips/bits/mathdef.h43
-rw-r--r--sysdeps/mips/bits/nan.h67
-rw-r--r--sysdeps/mips/bits/setjmp.h10
-rw-r--r--sysdeps/mips/bits/wordsize.h12
-rw-r--r--sysdeps/mips/bsd-_setjmp.S2
-rw-r--r--sysdeps/mips/bsd-setjmp.S2
-rw-r--r--sysdeps/mips/dl-dtprocnum.h2
-rw-r--r--sysdeps/mips/dl-machine-reject-phdr.h2
-rw-r--r--sysdeps/mips/dl-machine.h22
-rw-r--r--sysdeps/mips/dl-procinfo.c2
-rw-r--r--sysdeps/mips/dl-procinfo.h11
-rw-r--r--sysdeps/mips/dl-tls.h5
-rw-r--r--sysdeps/mips/dl-trampoline.c6
-rw-r--r--sysdeps/mips/fpregdef.h2
-rw-r--r--sysdeps/mips/fpu/e_sqrt.c2
-rw-r--r--sysdeps/mips/fpu/e_sqrtf.c2
-rw-r--r--sysdeps/mips/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/mips/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/mips/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/mips/fpu/fegetenv.c2
-rw-r--r--sysdeps/mips/fpu/fegetexcept.c2
-rw-r--r--sysdeps/mips/fpu/fegetmode.c27
-rw-r--r--sysdeps/mips/fpu/fegetround.c2
-rw-r--r--sysdeps/mips/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/mips/fpu/fenv_libc.h2
-rw-r--r--sysdeps/mips/fpu/fesetenv.c2
-rw-r--r--sysdeps/mips/fpu/fesetexcept.c32
-rw-r--r--sysdeps/mips/fpu/fesetmode.c38
-rw-r--r--sysdeps/mips/fpu/fesetround.c2
-rw-r--r--sysdeps/mips/fpu/feupdateenv.c2
-rw-r--r--sysdeps/mips/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/mips/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/mips/fpu/fsetexcptflg.c2
-rw-r--r--sysdeps/mips/fpu/ftestexcept.c2
-rw-r--r--sysdeps/mips/fpu_control.h2
-rw-r--r--sysdeps/mips/gccframe.h2
-rw-r--r--sysdeps/mips/ieee754/bits/floatn.h97
-rw-r--r--sysdeps/mips/ieee754/bits/long-double.h23
-rw-r--r--sysdeps/mips/ieee754/ieee754.h2
-rw-r--r--sysdeps/mips/ieee754/s_fma.c5
-rw-r--r--sysdeps/mips/ieee754/s_fmaf.c5
-rw-r--r--sysdeps/mips/ieee754/s_fmal.c2
-rw-r--r--sysdeps/mips/include/sys/asm.h8
-rw-r--r--sysdeps/mips/jmpbuf-unwind.h2
-rw-r--r--sysdeps/mips/ldbl-classify-compat.h8
-rw-r--r--sysdeps/mips/ldsodefs.h2
-rw-r--r--sysdeps/mips/libc-tls.c2
-rw-r--r--sysdeps/mips/localplt.data3
-rw-r--r--sysdeps/mips/lshift.S2
-rw-r--r--sysdeps/mips/machine-gmon.h2
-rw-r--r--sysdeps/mips/math-tests.h16
-rw-r--r--sysdeps/mips/math_private.h14
-rw-r--r--sysdeps/mips/memcpy.S6
-rw-r--r--sysdeps/mips/memset.S4
-rw-r--r--sysdeps/mips/memusage.h2
-rw-r--r--sysdeps/mips/mips32/crti.S15
-rw-r--r--sysdeps/mips/mips32/crtn.S2
-rw-r--r--sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h2
-rw-r--r--sysdeps/mips/mips32/fpu/fpucw-helpers.c2
-rw-r--r--sysdeps/mips/mips32/libm-test-ulps204
-rw-r--r--sysdeps/mips/mips32/libm-test-ulps-name1
-rw-r--r--sysdeps/mips/mips32/nofpu/Implies1
-rw-r--r--sysdeps/mips/mips32/sfp-machine.h14
-rw-r--r--sysdeps/mips/mips64/__longjmp.c2
-rw-r--r--sysdeps/mips/mips64/add_n.S2
-rw-r--r--sysdeps/mips/mips64/addmul_1.S2
-rw-r--r--sysdeps/mips/mips64/bsd-_setjmp.S2
-rw-r--r--sysdeps/mips/mips64/bsd-setjmp.S2
-rw-r--r--sysdeps/mips/mips64/e_sqrtl.c2
-rw-r--r--sysdeps/mips/mips64/gmp-mparam.h2
-rw-r--r--sysdeps/mips/mips64/libm-test-ulps284
-rw-r--r--sysdeps/mips/mips64/libm-test-ulps-name1
-rw-r--r--sysdeps/mips/mips64/lshift.S2
-rw-r--r--sysdeps/mips/mips64/mul_1.S2
-rw-r--r--sysdeps/mips/mips64/n32/crti.S15
-rw-r--r--sysdeps/mips/mips64/n32/crtn.S2
-rw-r--r--sysdeps/mips/mips64/n32/fpu/s_fma.c1
-rw-r--r--sysdeps/mips/mips64/n32/nofpu/Implies1
-rw-r--r--sysdeps/mips/mips64/n64/crti.S15
-rw-r--r--sysdeps/mips/mips64/n64/crtn.S2
-rw-r--r--sysdeps/mips/mips64/n64/fpu/s_fma.c1
-rw-r--r--sysdeps/mips/mips64/n64/nofpu/Implies1
-rw-r--r--sysdeps/mips/mips64/rshift.S2
-rw-r--r--sysdeps/mips/mips64/setjmp.S3
-rw-r--r--sysdeps/mips/mips64/setjmp_aux.c7
-rw-r--r--sysdeps/mips/mips64/sfp-machine.h14
-rw-r--r--sysdeps/mips/mips64/sub_n.S2
-rw-r--r--sysdeps/mips/mips64/submul_1.S2
-rw-r--r--sysdeps/mips/mul_1.S2
-rw-r--r--sysdeps/mips/nan-high-order-bit.h32
-rw-r--r--sysdeps/mips/nptl/Makefile3
-rw-r--r--sysdeps/mips/nptl/bits/pthreadtypes-arch.h89
-rw-r--r--sysdeps/mips/nptl/bits/pthreadtypes.h237
-rw-r--r--sysdeps/mips/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/mips/nptl/pthread-offsets.h13
-rw-r--r--sysdeps/mips/nptl/pthread_spin_lock.c23
-rw-r--r--sysdeps/mips/nptl/pthreaddef.h2
-rw-r--r--sysdeps/mips/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/mips/nptl/tls.h16
-rw-r--r--sysdeps/mips/preconfigure2
-rw-r--r--sysdeps/mips/regdef.h2
-rw-r--r--sysdeps/mips/rshift.S2
-rw-r--r--sysdeps/mips/setjmp.S3
-rw-r--r--sysdeps/mips/setjmp_aux.c7
-rw-r--r--sysdeps/mips/sgidefs.h2
-rw-r--r--sysdeps/mips/sotruss-lib.c2
-rw-r--r--sysdeps/mips/stackinfo.h2
-rw-r--r--sysdeps/mips/start.S2
-rw-r--r--sysdeps/mips/strcmp.S2
-rw-r--r--sysdeps/mips/sub_n.S2
-rw-r--r--sysdeps/mips/submul_1.S2
-rw-r--r--sysdeps/mips/sys/asm.h2
-rw-r--r--sysdeps/mips/sys/fpregdef.h2
-rw-r--r--sysdeps/mips/sys/regdef.h2
-rw-r--r--sysdeps/mips/sys/tas.h2
-rw-r--r--sysdeps/mips/sys/ucontext.h134
-rw-r--r--sysdeps/mips/tst-abi-fp32mod.c2
-rw-r--r--sysdeps/mips/tst-abi-fp64amod.c2
-rw-r--r--sysdeps/mips/tst-abi-fp64mod.c2
-rw-r--r--sysdeps/mips/tst-abi-fpxxmod.c2
-rw-r--r--sysdeps/mips/tst-abi-fpxxomod.c2
-rw-r--r--sysdeps/mips/tst-abi-interlink.c2
-rw-r--r--sysdeps/mips/tst-audit.h2
-rw-r--r--sysdeps/mips/tst-mode-switch-1.c9
-rw-r--r--sysdeps/mips/tst-mode-switch-2.c9
-rw-r--r--sysdeps/mips/tst-mode-switch-3.c9
-rw-r--r--sysdeps/nacl/Implies3
-rw-r--r--sysdeps/nacl/Makefile144
-rw-r--r--sysdeps/nacl/Subdirs3
-rw-r--r--sysdeps/nacl/Versions23
-rw-r--r--sysdeps/nacl/_exit.c35
-rw-r--r--sysdeps/nacl/access.c28
-rw-r--r--sysdeps/nacl/backtrace.c1
-rw-r--r--sysdeps/nacl/bits/dirent.h52
-rw-r--r--sysdeps/nacl/bits/fcntl.h145
-rw-r--r--sysdeps/nacl/bits/local_lim.h64
-rw-r--r--sysdeps/nacl/bits/mman.h24
-rw-r--r--sysdeps/nacl/bits/param.h23
-rw-r--r--sysdeps/nacl/bits/posix_opt.h210
-rw-r--r--sysdeps/nacl/bits/stat.h147
-rw-r--r--sysdeps/nacl/bits/typesizes.h72
-rw-r--r--sysdeps/nacl/brk.c93
-rw-r--r--sysdeps/nacl/chdir.c28
-rw-r--r--sysdeps/nacl/check_fds.c23
-rw-r--r--sysdeps/nacl/chmod.c28
-rw-r--r--sysdeps/nacl/clock.c29
-rw-r--r--sysdeps/nacl/clock_getres.c28
-rw-r--r--sysdeps/nacl/clock_gettime.c29
-rw-r--r--sysdeps/nacl/configure18
-rw-r--r--sysdeps/nacl/configure.ac18
-rw-r--r--sysdeps/nacl/createthread.c49
-rw-r--r--sysdeps/nacl/dl-fileid.h8
-rw-r--r--sysdeps/nacl/dl-map-segments.h264
-rw-r--r--sysdeps/nacl/dl-osinfo.h34
-rw-r--r--sysdeps/nacl/dl-sysdep-open.h40
-rw-r--r--sysdeps/nacl/dl-sysdep.c112
-rw-r--r--sysdeps/nacl/dl-sysdep.h30
-rw-r--r--sysdeps/nacl/dl-unmap-segments.h65
-rw-r--r--sysdeps/nacl/dl-writev.h45
-rw-r--r--sysdeps/nacl/dup.c30
-rw-r--r--sysdeps/nacl/dup2.c31
-rw-r--r--sysdeps/nacl/entry.h6
-rw-r--r--sysdeps/nacl/errnos.awk87
-rw-r--r--sysdeps/nacl/euidaccess.c29
-rw-r--r--sysdeps/nacl/exit-thread.h80
-rw-r--r--sysdeps/nacl/fchdir.c28
-rw-r--r--sysdeps/nacl/fchmod.c28
-rw-r--r--sysdeps/nacl/fdopendir.c32
-rw-r--r--sysdeps/nacl/fork.c3
-rw-r--r--sysdeps/nacl/ftruncate.c32
-rw-r--r--sysdeps/nacl/ftruncate64.c1
-rw-r--r--sysdeps/nacl/futex-internal.h248
-rw-r--r--sysdeps/nacl/fxstat.c45
-rw-r--r--sysdeps/nacl/fxstat64.c1
-rw-r--r--sysdeps/nacl/getcwd.c56
-rw-r--r--sysdeps/nacl/getdents.c29
-rw-r--r--sysdeps/nacl/getdents64.c1
-rw-r--r--sysdeps/nacl/getdtsz.c29
-rw-r--r--sysdeps/nacl/gethostname.c45
-rw-r--r--sysdeps/nacl/getpagesize.c1
-rw-r--r--sysdeps/nacl/getpid.c32
-rw-r--r--sysdeps/nacl/getsysstats.c65
-rw-r--r--sysdeps/nacl/gettimeofday.c40
-rw-r--r--sysdeps/nacl/glob.c2
-rw-r--r--sysdeps/nacl/glob64.c1
-rw-r--r--sysdeps/nacl/ifaddrs.c2
-rw-r--r--sysdeps/nacl/init-first.c27
-rw-r--r--sysdeps/nacl/iofdopen.c26
-rw-r--r--sysdeps/nacl/irt.sed12
-rw-r--r--sysdeps/nacl/isatty.c38
-rw-r--r--sysdeps/nacl/kernel-features.h28
-rw-r--r--sysdeps/nacl/ld.abilist11
-rw-r--r--sysdeps/nacl/ldsodefs.h35
-rw-r--r--sysdeps/nacl/libBrokenLocale.abilist2
-rw-r--r--sysdeps/nacl/libanl.abilist5
-rw-r--r--sysdeps/nacl/libc-start.c4
-rw-r--r--sysdeps/nacl/libcrypt.abilist8
-rw-r--r--sysdeps/nacl/libdl.abilist10
-rw-r--r--sysdeps/nacl/libm.abilist374
-rw-r--r--sysdeps/nacl/libpthread.abilist175
-rw-r--r--sysdeps/nacl/libresolv.abilist92
-rw-r--r--sysdeps/nacl/librt.abilist36
-rw-r--r--sysdeps/nacl/libutil.abilist7
-rw-r--r--sysdeps/nacl/link.c28
-rw-r--r--sysdeps/nacl/lll_timedlock_wait.c53
-rw-r--r--sysdeps/nacl/lll_timedwait_tid.c61
-rw-r--r--sysdeps/nacl/lowlevellock-futex.h90
-rw-r--r--sysdeps/nacl/lowlevellock.h41
-rw-r--r--sysdeps/nacl/lseek.c43
-rw-r--r--sysdeps/nacl/lseek64.c1
-rw-r--r--sysdeps/nacl/lxstat.c46
-rw-r--r--sysdeps/nacl/lxstat64.c1
-rw-r--r--sysdeps/nacl/mkdir.c28
-rw-r--r--sysdeps/nacl/mmap.c49
-rw-r--r--sysdeps/nacl/mmap64.c1
-rw-r--r--sysdeps/nacl/mprotect.c33
-rw-r--r--sysdeps/nacl/munmap.c32
-rwxr-xr-xsysdeps/nacl/nacl-after-link.sh69
-rw-r--r--sysdeps/nacl/nacl-interface-list.h45
-rw-r--r--sysdeps/nacl/nacl-interface-table.c43
-rw-r--r--sysdeps/nacl/nacl-interfaces.c165
-rw-r--r--sysdeps/nacl/nacl-interfaces.h116
-rw-r--r--sysdeps/nacl/nacl-interfaces.mk.in25
-rwxr-xr-xsysdeps/nacl/nacl-test-wrapper.sh280
-rw-r--r--sysdeps/nacl/nacl_interface_ext_supply.c42
-rw-r--r--sysdeps/nacl/nacl_interface_query.c49
-rw-r--r--sysdeps/nacl/nanosleep.c33
-rw-r--r--sysdeps/nacl/open.c52
-rw-r--r--sysdeps/nacl/open64.c1
-rw-r--r--sysdeps/nacl/preconfigure7
-rw-r--r--sysdeps/nacl/profil.c2
-rw-r--r--sysdeps/nacl/pthread-pids.h68
-rw-r--r--sysdeps/nacl/pthread_condattr_setclock.c42
-rw-r--r--sysdeps/nacl/readdir.c11
-rw-r--r--sysdeps/nacl/readdir64.c1
-rw-r--r--sysdeps/nacl/readdir64_r.c1
-rw-r--r--sysdeps/nacl/readdir_r.c8
-rw-r--r--sysdeps/nacl/readlink.c32
-rw-r--r--sysdeps/nacl/rename.c27
-rw-r--r--sysdeps/nacl/rmdir.c28
-rw-r--r--sysdeps/nacl/sched_yield.c31
-rw-r--r--sysdeps/nacl/shlib-versions9
-rw-r--r--sysdeps/nacl/sigaction.c11
-rw-r--r--sysdeps/nacl/sprofil.c2
-rw-r--r--sysdeps/nacl/start.c77
-rw-r--r--sysdeps/nacl/symlink.c28
-rw-r--r--sysdeps/nacl/tls.h41
-rw-r--r--sysdeps/nacl/truncate.c32
-rw-r--r--sysdeps/nacl/truncate64.c1
-rw-r--r--sysdeps/nacl/uname-values.h32
-rw-r--r--sysdeps/nacl/unlink.c28
-rw-r--r--sysdeps/nacl/utimes.c29
-rw-r--r--sysdeps/nacl/xstat.c45
-rw-r--r--sysdeps/nacl/xstat64.c1
-rw-r--r--sysdeps/nacl/xstatconv.c76
-rw-r--r--sysdeps/nacl/xstatconv.h32
-rw-r--r--sysdeps/nios2/Implies1
-rw-r--r--sysdeps/nios2/Makefile9
-rw-r--r--sysdeps/nios2/__longjmp.S2
-rw-r--r--sysdeps/nios2/backtrace.c1
-rw-r--r--sysdeps/nios2/bits/fenv.h10
-rw-r--r--sysdeps/nios2/bits/link.h2
-rw-r--r--sysdeps/nios2/bits/setjmp.h2
-rw-r--r--sysdeps/nios2/crti.S4
-rw-r--r--sysdeps/nios2/crtn.S2
-rw-r--r--sysdeps/nios2/dl-init.c3
-rw-r--r--sysdeps/nios2/dl-machine.h5
-rw-r--r--sysdeps/nios2/dl-sysdep.h2
-rw-r--r--sysdeps/nios2/dl-tls.h5
-rw-r--r--sysdeps/nios2/dl-trampoline.S2
-rw-r--r--sysdeps/nios2/gccframe.h2
-rw-r--r--sysdeps/nios2/gmp-mparam.h2
-rw-r--r--sysdeps/nios2/jmpbuf-offsets.h2
-rw-r--r--sysdeps/nios2/jmpbuf-unwind.h2
-rw-r--r--sysdeps/nios2/ldbl-classify-compat.h8
-rw-r--r--sysdeps/nios2/ldsodefs.h2
-rw-r--r--sysdeps/nios2/libc-tls.c2
-rw-r--r--sysdeps/nios2/libm-test-ulps48
-rw-r--r--sysdeps/nios2/libm-test-ulps-name1
-rw-r--r--sysdeps/nios2/machine-gmon.h2
-rw-r--r--sysdeps/nios2/math-tests.h2
-rw-r--r--sysdeps/nios2/math_private.h38
-rw-r--r--sysdeps/nios2/memusage.h2
-rw-r--r--sysdeps/nios2/nptl/Makefile2
-rw-r--r--sysdeps/nios2/nptl/bits/pthreadtypes-arch.h72
-rw-r--r--sysdeps/nios2/nptl/bits/pthreadtypes.h189
-rw-r--r--sysdeps/nios2/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/nios2/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/nios2/nptl/pthread_spin_lock.c24
-rw-r--r--sysdeps/nios2/nptl/pthreaddef.h2
-rw-r--r--sysdeps/nios2/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/nios2/nptl/tls.h15
-rw-r--r--sysdeps/nios2/s_fma.c1
-rw-r--r--sysdeps/nios2/s_fmaf.c1
-rw-r--r--sysdeps/nios2/setjmp.S2
-rw-r--r--sysdeps/nios2/sotruss-lib.c2
-rw-r--r--sysdeps/nios2/stackinfo.h2
-rw-r--r--sysdeps/nios2/start.S2
-rw-r--r--sysdeps/nios2/sysdep.h2
-rw-r--r--sysdeps/nios2/tst-audit.h2
-rw-r--r--sysdeps/nptl/Makeconfig11
-rw-r--r--sysdeps/nptl/Makefile2
-rw-r--r--sysdeps/nptl/aio_misc.h2
-rw-r--r--sysdeps/nptl/allocrtsig.c2
-rw-r--r--sysdeps/nptl/bits/pthreadtypes.h121
-rw-r--r--sysdeps/nptl/bits/thread-shared-types.h178
-rw-r--r--sysdeps/nptl/fork.c190
-rw-r--r--sysdeps/nptl/fork.h33
-rw-r--r--sysdeps/nptl/futex-internal.h4
-rw-r--r--sysdeps/nptl/gai_misc.h2
-rw-r--r--sysdeps/nptl/internaltypes.h21
-rw-r--r--sysdeps/nptl/jmp-unwind.c2
-rw-r--r--sysdeps/nptl/libc-lock.h2
-rw-r--r--sysdeps/nptl/libc-lockP.h4
-rw-r--r--sysdeps/nptl/librt-cancellation.c2
-rw-r--r--sysdeps/nptl/lowlevellock-futex.h2
-rw-r--r--sysdeps/nptl/lowlevellock.h87
-rw-r--r--sysdeps/nptl/malloc-machine.h37
-rw-r--r--sysdeps/nptl/nptl-signals.h22
-rw-r--r--sysdeps/nptl/pthread-functions.h4
-rw-r--r--sysdeps/nptl/pthread.h7
-rw-r--r--sysdeps/nptl/setxid.h2
-rw-r--r--sysdeps/nptl/shm-directory.h2
-rw-r--r--sysdeps/nptl/sigfillset.c20
-rw-r--r--sysdeps/nptl/stdio-lock.h7
-rw-r--r--sysdeps/nptl/sys/procfs.h2
-rw-r--r--sysdeps/nptl/threads.h207
-rw-r--r--sysdeps/nptl/timer_routines.h51
-rw-r--r--sysdeps/nptl/unwind-forcedunwind.c7
-rw-r--r--sysdeps/posix/alarm.c2
-rw-r--r--sysdeps/posix/clock.c2
-rw-r--r--sysdeps/posix/clock_getres.c4
-rw-r--r--sysdeps/posix/closedir.c4
-rw-r--r--sysdeps/posix/ctermid.c2
-rw-r--r--sysdeps/posix/cuserid.c2
-rw-r--r--sysdeps/posix/dirfd.c7
-rw-r--r--sysdeps/posix/dirstream.h2
-rw-r--r--sysdeps/posix/dl-fileid.h2
-rw-r--r--sysdeps/posix/dup.c6
-rw-r--r--sysdeps/posix/dup2.c2
-rw-r--r--sysdeps/posix/euidaccess.c2
-rw-r--r--sysdeps/posix/fdopendir.c4
-rw-r--r--sysdeps/posix/flock.c2
-rw-r--r--sysdeps/posix/fpathconf.c23
-rw-r--r--sysdeps/posix/gai_strerror.c2
-rw-r--r--sysdeps/posix/getaddrinfo.c718
-rw-r--r--sysdeps/posix/getcwd.c22
-rw-r--r--sysdeps/posix/getdtsz.c2
-rw-r--r--sysdeps/posix/gethostname.c4
-rw-r--r--sysdeps/posix/getpagesize.c2
-rw-r--r--sysdeps/posix/gettimeofday.c2
-rw-r--r--sysdeps/posix/isatty.c2
-rw-r--r--sysdeps/posix/isfdtype.c2
-rw-r--r--sysdeps/posix/killpg.c2
-rw-r--r--sysdeps/posix/libc_fatal.c28
-rw-r--r--sysdeps/posix/mkfifo.c2
-rw-r--r--sysdeps/posix/mkfifoat.c2
-rw-r--r--sysdeps/posix/nice.c2
-rw-r--r--sysdeps/posix/open64.c2
-rw-r--r--sysdeps/posix/opendir.c159
-rw-r--r--sysdeps/posix/pathconf.c23
-rw-r--r--sysdeps/posix/pause.c18
-rw-r--r--sysdeps/posix/posix_fallocate.c2
-rw-r--r--sysdeps/posix/posix_fallocate64.c2
-rw-r--r--sysdeps/posix/pread.c2
-rw-r--r--sysdeps/posix/pread64.c3
-rw-r--r--sysdeps/posix/preadv.c91
-rw-r--r--sysdeps/posix/preadv2.c42
-rw-r--r--sysdeps/posix/preadv64.c31
-rw-r--r--sysdeps/posix/preadv64v2.c41
-rw-r--r--sysdeps/posix/preadv_common.c85
-rw-r--r--sysdeps/posix/profil.c3
-rw-r--r--sysdeps/posix/pwrite.c2
-rw-r--r--sysdeps/posix/pwrite64.c2
-rw-r--r--sysdeps/posix/pwritev.c79
-rw-r--r--sysdeps/posix/pwritev2.c42
-rw-r--r--sysdeps/posix/pwritev64.c31
-rw-r--r--sysdeps/posix/pwritev64v2.c42
-rw-r--r--sysdeps/posix/pwritev_common.c74
-rw-r--r--sysdeps/posix/raise.c2
-rw-r--r--sysdeps/posix/readdir.c7
-rw-r--r--sysdeps/posix/readdir_r.c7
-rw-r--r--sysdeps/posix/readv.c3
-rw-r--r--sysdeps/posix/remove.c2
-rw-r--r--sysdeps/posix/rename.c2
-rw-r--r--sysdeps/posix/rewinddir.c2
-rw-r--r--sysdeps/posix/seekdir.c2
-rw-r--r--sysdeps/posix/shm-directory.c2
-rw-r--r--sysdeps/posix/shm-directory.h2
-rw-r--r--sysdeps/posix/shm_open.c38
-rw-r--r--sysdeps/posix/shm_unlink.c2
-rw-r--r--sysdeps/posix/sigblock.c3
-rw-r--r--sysdeps/posix/sigignore.c7
-rw-r--r--sysdeps/posix/sigintr.c3
-rw-r--r--sysdeps/posix/signal.c14
-rw-r--r--sysdeps/posix/sigpause.c28
-rw-r--r--sysdeps/posix/sigset.c61
-rw-r--r--sysdeps/posix/sigsetmask.c2
-rw-r--r--sysdeps/posix/sigsuspend.c2
-rw-r--r--sysdeps/posix/sigwait.c2
-rw-r--r--sysdeps/posix/sleep.c2
-rw-r--r--sysdeps/posix/spawni.c357
-rw-r--r--sysdeps/posix/sprofil.c3
-rw-r--r--sysdeps/posix/sysconf.c5
-rw-r--r--sysdeps/posix/system.c3
-rw-r--r--sysdeps/posix/sysv_signal.c7
-rw-r--r--sysdeps/posix/telldir.c2
-rw-r--r--sysdeps/posix/tempname.c2
-rw-r--r--sysdeps/posix/time.c2
-rw-r--r--sysdeps/posix/timespec_get.c2
-rw-r--r--sysdeps/posix/truncate.c2
-rw-r--r--sysdeps/posix/ttyname.c5
-rw-r--r--sysdeps/posix/ttyname_r.c5
-rw-r--r--sysdeps/posix/ulimit.c2
-rw-r--r--sysdeps/posix/usleep.c2
-rw-r--r--sysdeps/posix/utime.c3
-rw-r--r--sysdeps/posix/utimes.c3
-rw-r--r--sysdeps/posix/wait.c4
-rw-r--r--sysdeps/posix/wait3.c6
-rw-r--r--sysdeps/posix/waitid.c4
-rw-r--r--sysdeps/posix/writev.c3
-rw-r--r--sysdeps/powerpc/Makefile19
-rw-r--r--sysdeps/powerpc/Versions3
-rw-r--r--sysdeps/powerpc/atomic-machine.h8
-rw-r--r--sysdeps/powerpc/bits/endian.h2
-rw-r--r--sysdeps/powerpc/bits/fenv.h11
-rw-r--r--sysdeps/powerpc/bits/fenvinline.h18
-rw-r--r--sysdeps/powerpc/bits/floatn.h122
-rw-r--r--sysdeps/powerpc/bits/fp-fast.h39
-rw-r--r--sysdeps/powerpc/bits/hwcap.h7
-rw-r--r--sysdeps/powerpc/bits/link.h2
-rw-r--r--sysdeps/powerpc/bits/mathdef.h46
-rw-r--r--sysdeps/powerpc/bits/mathinline.h76
-rw-r--r--sysdeps/powerpc/bits/setjmp.h2
-rw-r--r--sysdeps/powerpc/cpu-features.c39
-rw-r--r--sysdeps/powerpc/cpu-features.h28
-rw-r--r--sysdeps/powerpc/dl-procinfo.c61
-rw-r--r--sysdeps/powerpc/dl-procinfo.h50
-rw-r--r--sysdeps/powerpc/dl-tls.c2
-rw-r--r--sysdeps/powerpc/dl-tls.h5
-rw-r--r--sysdeps/powerpc/dl-tunables.list28
-rw-r--r--sysdeps/powerpc/ffs.c2
-rw-r--r--sysdeps/powerpc/fpu/e_hypot.c21
-rw-r--r--sysdeps/powerpc/fpu/e_hypotf.c14
-rw-r--r--sysdeps/powerpc/fpu/e_rem_pio2f.c2
-rw-r--r--sysdeps/powerpc/fpu/e_sqrt.c2
-rw-r--r--sysdeps/powerpc/fpu/e_sqrtf.c2
-rw-r--r--sysdeps/powerpc/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/powerpc/fpu/fe_mask.c2
-rw-r--r--sysdeps/powerpc/fpu/fe_nomask.c2
-rw-r--r--sysdeps/powerpc/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/powerpc/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/powerpc/fpu/fegetenv.c2
-rw-r--r--sysdeps/powerpc/fpu/fegetexcept.c2
-rw-r--r--sysdeps/powerpc/fpu/fegetmode.c26
-rw-r--r--sysdeps/powerpc/fpu/fegetround.c2
-rw-r--r--sysdeps/powerpc/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/powerpc/fpu/fenv_const.c6
-rw-r--r--sysdeps/powerpc/fpu/fenv_libc.h2
-rw-r--r--sysdeps/powerpc/fpu/fenv_private.h163
-rw-r--r--sysdeps/powerpc/fpu/fesetenv.c2
-rw-r--r--sysdeps/powerpc/fpu/fesetexcept.c42
-rw-r--r--sysdeps/powerpc/fpu/fesetmode.c49
-rw-r--r--sysdeps/powerpc/fpu/fesetround.c2
-rw-r--r--sysdeps/powerpc/fpu/feupdateenv.c2
-rw-r--r--sysdeps/powerpc/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h28
-rw-r--r--sysdeps/powerpc/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/powerpc/fpu/fsetexcptflg.c8
-rw-r--r--sysdeps/powerpc/fpu/ftestexcept.c2
-rw-r--r--sysdeps/powerpc/fpu/k_cosf.c2
-rw-r--r--sysdeps/powerpc/fpu/k_rem_pio2f.c2
-rw-r--r--sysdeps/powerpc/fpu/k_sinf.c2
-rw-r--r--sysdeps/powerpc/fpu/libm-test-ulps1053
-rw-r--r--sysdeps/powerpc/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/powerpc/fpu/math-barriers.h28
-rw-r--r--sysdeps/powerpc/fpu/math_ldbl.h25
-rw-r--r--sysdeps/powerpc/fpu/math_private.h33
-rw-r--r--sysdeps/powerpc/fpu/s_cosf.c5
-rw-r--r--sysdeps/powerpc/fpu/s_fabs.S13
-rw-r--r--sysdeps/powerpc/fpu/s_fdim.c30
-rw-r--r--sysdeps/powerpc/fpu/s_fdimf.c26
-rw-r--r--sysdeps/powerpc/fpu/s_float_bitwise.h2
-rw-r--r--sysdeps/powerpc/fpu/s_fma.S12
-rw-r--r--sysdeps/powerpc/fpu/s_fmaf.S7
-rw-r--r--sysdeps/powerpc/fpu/s_fmax.S42
-rw-r--r--sysdeps/powerpc/fpu/s_fmaxf.S1
-rw-r--r--sysdeps/powerpc/fpu/s_fmin.S42
-rw-r--r--sysdeps/powerpc/fpu/s_fminf.S1
-rw-r--r--sysdeps/powerpc/fpu/s_isnan.c2
-rw-r--r--sysdeps/powerpc/fpu/s_rint.c9
-rw-r--r--sysdeps/powerpc/fpu/s_rintf.c5
-rw-r--r--sysdeps/powerpc/fpu/s_sinf.c5
-rw-r--r--sysdeps/powerpc/fpu/tst-setcontext-fpscr.c8
-rw-r--r--sysdeps/powerpc/fpu_control.h2
-rw-r--r--sysdeps/powerpc/gccframe.h2
-rw-r--r--sysdeps/powerpc/hwcapinfo.c2
-rw-r--r--sysdeps/powerpc/hwcapinfo.h2
-rw-r--r--sysdeps/powerpc/ifunc-sel.h19
-rw-r--r--sysdeps/powerpc/jmpbuf-offsets.h2
-rw-r--r--sysdeps/powerpc/jmpbuf-unwind.h2
-rw-r--r--sysdeps/powerpc/ldsodefs.h3
-rw-r--r--sysdeps/powerpc/libc-tls.c2
-rw-r--r--sysdeps/powerpc/locale-defines.sym4
-rw-r--r--sysdeps/powerpc/longjmp.c2
-rw-r--r--sysdeps/powerpc/machine-gmon.h2
-rw-r--r--sysdeps/powerpc/math-tests.h8
-rw-r--r--sysdeps/powerpc/memusage.h2
-rw-r--r--sysdeps/powerpc/mod-tlsopt-powerpc.c49
-rw-r--r--sysdeps/powerpc/nofpu/Makefile43
-rw-r--r--sysdeps/powerpc/nofpu/atomic-feclearexcept.c2
-rw-r--r--sysdeps/powerpc/nofpu/atomic-feholdexcept.c2
-rw-r--r--sysdeps/powerpc/nofpu/atomic-feupdateenv.c2
-rw-r--r--sysdeps/powerpc/nofpu/fclrexcpt.c2
-rw-r--r--sysdeps/powerpc/nofpu/fedisblxcpt.c2
-rw-r--r--sysdeps/powerpc/nofpu/feenablxcpt.c2
-rw-r--r--sysdeps/powerpc/nofpu/fegetenv.c2
-rw-r--r--sysdeps/powerpc/nofpu/fegetexcept.c2
-rw-r--r--sysdeps/powerpc/nofpu/fegetmode.c33
-rw-r--r--sysdeps/powerpc/nofpu/fegetround.c2
-rw-r--r--sysdeps/powerpc/nofpu/feholdexcpt.c2
-rw-r--r--sysdeps/powerpc/nofpu/fenv_const.c6
-rw-r--r--sysdeps/powerpc/nofpu/fesetenv.c2
-rw-r--r--sysdeps/powerpc/nofpu/fesetexcept.c28
-rw-r--r--sysdeps/powerpc/nofpu/fesetmode.c34
-rw-r--r--sysdeps/powerpc/nofpu/fesetround.c2
-rw-r--r--sysdeps/powerpc/nofpu/feupdateenv.c2
-rw-r--r--sysdeps/powerpc/nofpu/fgetexcptflg.c2
-rw-r--r--sysdeps/powerpc/nofpu/flt-rounds.c2
-rw-r--r--sysdeps/powerpc/nofpu/fraiseexcpt.c2
-rw-r--r--sysdeps/powerpc/nofpu/fsetexcptflg.c2
-rw-r--r--sysdeps/powerpc/nofpu/ftestexcept.c2
-rw-r--r--sysdeps/powerpc/nofpu/get-rounding-mode.h2
-rw-r--r--sysdeps/powerpc/nofpu/libm-test-ulps343
-rw-r--r--sysdeps/powerpc/nofpu/libm-test-ulps-name1
-rw-r--r--sysdeps/powerpc/nofpu/sfp-machine.h (renamed from sysdeps/powerpc/soft-fp/sfp-machine.h)0
-rw-r--r--sysdeps/powerpc/nofpu/sim-full.c2
-rw-r--r--sysdeps/powerpc/nofpu/soft-supp.h2
-rw-r--r--sysdeps/powerpc/nofpu/sqrtdf2.c53
-rw-r--r--sysdeps/powerpc/nofpu/sqrtsf2.c53
-rw-r--r--sysdeps/powerpc/novmx-longjmp.c2
-rw-r--r--sysdeps/powerpc/novmx-sigjmp.c2
-rw-r--r--sysdeps/powerpc/novmxsetjmp.h4
-rw-r--r--sysdeps/powerpc/nptl/Makefile2
-rw-r--r--sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h81
-rw-r--r--sysdeps/powerpc/nptl/elide.h14
-rw-r--r--sysdeps/powerpc/nptl/pthread-offsets.h15
-rw-r--r--sysdeps/powerpc/nptl/pthread_spin_lock.c2
-rw-r--r--sysdeps/powerpc/nptl/pthread_spin_trylock.c2
-rw-r--r--sysdeps/powerpc/nptl/pthread_spin_unlock.c2
-rw-r--r--sysdeps/powerpc/nptl/pthreaddef.h2
-rw-r--r--sysdeps/powerpc/nptl/tcb-offsets.sym4
-rw-r--r--sysdeps/powerpc/nptl/tls.h15
-rw-r--r--sysdeps/powerpc/power4/fpu/Makefile2
-rw-r--r--sysdeps/powerpc/power4/fpu/mpa-arch.h2
-rw-r--r--sysdeps/powerpc/power4/fpu/mpa.c2
-rw-r--r--sysdeps/powerpc/power4/wordcopy.c2
-rw-r--r--sysdeps/powerpc/power5+/fpu/s_modf.c15
-rw-r--r--sysdeps/powerpc/power5+/fpu/s_modff.c5
-rw-r--r--sysdeps/powerpc/power6/wcschr.c2
-rw-r--r--sysdeps/powerpc/power6/wcscpy.c2
-rw-r--r--sysdeps/powerpc/power6/wcsrchr.c2
-rw-r--r--sysdeps/powerpc/power6/wordcopy.c2
-rw-r--r--sysdeps/powerpc/power7/fpu/s_logb.c15
-rw-r--r--sysdeps/powerpc/power7/fpu/s_logbf.c5
-rw-r--r--sysdeps/powerpc/power7/fpu/s_logbl.c26
-rw-r--r--sysdeps/powerpc/powerpc32/405/memcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/405/memcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc32/405/memset.S2
-rw-r--r--sysdeps/powerpc/powerpc32/405/strcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/405/strcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc32/405/strlen.S2
-rw-r--r--sysdeps/powerpc/powerpc32/405/strncmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/476/memset.S2
-rw-r--r--sysdeps/powerpc/powerpc32/Implies-after (renamed from sysdeps/powerpc/Implies)0
-rw-r--r--sysdeps/powerpc/powerpc32/__longjmp-common.S2
-rw-r--r--sysdeps/powerpc/powerpc32/__longjmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/a2/memcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc32/add_n.S2
-rw-r--r--sysdeps/powerpc/powerpc32/addmul_1.S2
-rw-r--r--sysdeps/powerpc/powerpc32/atomic-machine.h22
-rw-r--r--sysdeps/powerpc/powerpc32/backtrace.c21
-rw-r--r--sysdeps/powerpc/powerpc32/bits/wordsize.h3
-rw-r--r--sysdeps/powerpc/powerpc32/bsd-_setjmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/bsd-setjmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/bzero.S2
-rw-r--r--sysdeps/powerpc/powerpc32/cell/memcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc32/crti.S4
-rw-r--r--sysdeps/powerpc/powerpc32/crtn.S2
-rw-r--r--sysdeps/powerpc/powerpc32/dl-irel.h2
-rw-r--r--sysdeps/powerpc/powerpc32/dl-machine.c2
-rw-r--r--sysdeps/powerpc/powerpc32/dl-machine.h10
-rw-r--r--sysdeps/powerpc/powerpc32/dl-start.S2
-rw-r--r--sysdeps/powerpc/powerpc32/dl-trampoline.S2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feclearexcept.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feholdexcept.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feupdateenv.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fclrexcpt.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fe_note_change.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fedisblxcpt.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/feenablxcpt.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fegetenv.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fegetexcept.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fegetmode.c37
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fegetround.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c6
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fenv_libc.h2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fesetenv.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c37
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fesetmode.c43
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fesetround.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fetestexceptflag.c25
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_from_prctl.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_from_spe.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_to_prctl.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_to_spe.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fgetexcptflg.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/flt-rounds.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcept-soft.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcpt.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fsetexcptflg.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/ftestexcept.c2
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/s_fabsf.S5
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/spe-raise.c2
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S2
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/__longjmp.S6
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/fix-int-fp-convert-zero.h2
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/fprrest.S2
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/fprsave.S2
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_ceil.S30
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_ceilf.S22
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_copysign.S18
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_copysignl.S25
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fabs.S5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fabsl.S23
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fdim.c5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_floor.S30
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_floorf.S22
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fma.S5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fmax.S5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_fmin.S5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_isnan.S2
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_llrint.c12
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_llrintf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_llround.c12
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_llroundf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_lrint.S16
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_lround.S16
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S21
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S13
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_rint.S21
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_rintf.S13
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_round.S21
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_roundf.S13
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_trunc.S30
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_truncf.S22
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/setjmp-common.S2
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/setjmp.S3
-rw-r--r--sysdeps/powerpc/powerpc32/gprrest0.S2
-rw-r--r--sysdeps/powerpc/powerpc32/gprrest1.S2
-rw-r--r--sysdeps/powerpc/powerpc32/gprsave0.S2
-rw-r--r--sysdeps/powerpc/powerpc32/gprsave1.S2
-rw-r--r--sysdeps/powerpc/powerpc32/libgcc-compat.S2
-rw-r--r--sysdeps/powerpc/powerpc32/lshift.S2
-rw-r--r--sysdeps/powerpc/powerpc32/memset.S4
-rw-r--r--sysdeps/powerpc/powerpc32/mul_1.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile8
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot.c3
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf.c3
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil.c13
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c15
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c18
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c12
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-power5+.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor.c13
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-power5+.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c18
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c12
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c26
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c19
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-power6.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint.c13
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-power6.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power5+.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power6.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround.c13
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llroundf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-ppc32.c7
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c14
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-power6x.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint.c13
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrintf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power5+.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power6x.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround.c13
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lroundf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-power5+.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c7
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c15
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-power5+.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round-power5+.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round.c13
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf-power5+.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc.c13
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf.c5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-power5.S31
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-ppc32.S31
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt.c40
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-power5.S26
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-ppc32.S26
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf.c32
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S13
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S5
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S21
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S109
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S101
-rw-r--r--sysdeps/powerpc/powerpc32/power4/hp-timing.h2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/memcmp.S14
-rw-r--r--sysdeps/powerpc/powerpc32/power4/memcopy.h2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/memcpy.S4
-rw-r--r--sysdeps/powerpc/powerpc32/power4/memset.S4
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h4
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memchr-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c12
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-a2.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-cell.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-power6.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c25
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memmove-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memmove-ppc.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c12
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c16
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memset-power6.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memset-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memset.c16
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c13
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memset.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/rtld-strchr.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/rtld-strnlen.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strchr-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strchr-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c14
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strlen-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c12
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strncase-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c14
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-power7.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c15
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c2
-rw-r--r--sysdeps/powerpc/powerpc32/power4/strncmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S13
-rw-r--r--sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S5
-rw-r--r--sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S13
-rw-r--r--sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S5
-rw-r--r--sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S16
-rw-r--r--sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S16
-rw-r--r--sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S13
-rw-r--r--sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S5
-rw-r--r--sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S13
-rw-r--r--sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S5
-rw-r--r--sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S107
-rw-r--r--sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S99
-rw-r--r--sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S21
-rw-r--r--sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S13
-rw-r--r--sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S5
-rw-r--r--sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S16
-rw-r--r--sysdeps/powerpc/powerpc32/power6/memcpy.S6
-rw-r--r--sysdeps/powerpc/powerpc32/power6/memset.S6
-rw-r--r--sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S16
-rw-r--r--sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S16
-rw-r--r--sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power7/memchr.S13
-rw-r--r--sysdeps/powerpc/powerpc32/power7/memcmp.S14
-rw-r--r--sysdeps/powerpc/powerpc32/power7/memcpy.S4
-rw-r--r--sysdeps/powerpc/powerpc32/power7/mempcpy.S4
-rw-r--r--sysdeps/powerpc/powerpc32/power7/memrchr.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power7/memset.S4
-rw-r--r--sysdeps/powerpc/powerpc32/power7/rawmemchr.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power7/strcasecmp.S4
-rw-r--r--sysdeps/powerpc/powerpc32/power7/strchr.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power7/strchrnul.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power7/strlen.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power7/strncmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power7/strnlen.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power9/multiarch/Implies2
-rw-r--r--sysdeps/powerpc/powerpc32/ppc-mcount.S29
-rw-r--r--sysdeps/powerpc/powerpc32/register-dump.h2
-rw-r--r--sysdeps/powerpc/powerpc32/rshift.S2
-rw-r--r--sysdeps/powerpc/powerpc32/setjmp-common.S2
-rw-r--r--sysdeps/powerpc/powerpc32/setjmp.S3
-rw-r--r--sysdeps/powerpc/powerpc32/start.S2
-rw-r--r--sysdeps/powerpc/powerpc32/stpcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc32/strchr.S2
-rw-r--r--sysdeps/powerpc/powerpc32/strcmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/strcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc32/strlen.S2
-rw-r--r--sysdeps/powerpc/powerpc32/strncmp.S2
-rw-r--r--sysdeps/powerpc/powerpc32/sub_n.S2
-rw-r--r--sysdeps/powerpc/powerpc32/submul_1.S2
-rw-r--r--sysdeps/powerpc/powerpc32/symbol-hacks.h21
-rw-r--r--sysdeps/powerpc/powerpc32/sysdep.h11
-rw-r--r--sysdeps/powerpc/powerpc32/tst-audit.h2
-rw-r--r--sysdeps/powerpc/powerpc64/970/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/Makefile12
-rw-r--r--sysdeps/powerpc/powerpc64/__longjmp-common.S7
-rw-r--r--sysdeps/powerpc/powerpc64/__longjmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/a2/memcpy.S10
-rw-r--r--sysdeps/powerpc/powerpc64/addmul_1.S4
-rw-r--r--sysdeps/powerpc/powerpc64/atomic-machine.h36
-rw-r--r--sysdeps/powerpc/powerpc64/backtrace.c21
-rw-r--r--sysdeps/powerpc/powerpc64/be/970/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/Implies-after5
-rw-r--r--sysdeps/powerpc/powerpc64/be/a2/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/cell/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/fpu/Implies (renamed from sysdeps/powerpc/powerpc64/power4/fpu/Implies)0
-rw-r--r--sysdeps/powerpc/powerpc64/be/fpu/multiarch/Implies (renamed from sysdeps/powerpc/powerpc64/power4/fpu/multiarch/Implies)0
-rw-r--r--sysdeps/powerpc/powerpc64/be/multiarch/Implies (renamed from sysdeps/powerpc/powerpc64/power4/multiarch/Implies)0
-rw-r--r--sysdeps/powerpc/powerpc64/be/power4/Implies3
-rw-r--r--sysdeps/powerpc/powerpc64/be/power4/fpu/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power4/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power4/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power5+/Implies5
-rw-r--r--sysdeps/powerpc/powerpc64/be/power5+/fpu/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/be/power5+/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power5+/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power5/Implies3
-rw-r--r--sysdeps/powerpc/powerpc64/be/power5/fpu/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/be/power5/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power5/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power6/Implies3
-rw-r--r--sysdeps/powerpc/powerpc64/be/power6/fpu/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/be/power6/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power6/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power6x/Implies3
-rw-r--r--sysdeps/powerpc/powerpc64/be/power6x/fpu/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/be/power6x/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power6x/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power7/Implies3
-rw-r--r--sysdeps/powerpc/powerpc64/be/power7/fpu/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/be/power7/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power7/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power8/Implies3
-rw-r--r--sysdeps/powerpc/powerpc64/be/power8/fpu/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/be/power8/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power8/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power9/Implies3
-rw-r--r--sysdeps/powerpc/powerpc64/be/power9/fpu/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/be/power9/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/be/power9/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/bits/wordsize.h3
-rw-r--r--sysdeps/powerpc/powerpc64/bzero.S2
-rw-r--r--sysdeps/powerpc/powerpc64/cell/memcpy.S10
-rw-r--r--sysdeps/powerpc/powerpc64/crti.S4
-rw-r--r--sysdeps/powerpc/powerpc64/crtn.S2
-rw-r--r--sysdeps/powerpc/powerpc64/dl-dtprocnum.h2
-rw-r--r--sysdeps/powerpc/powerpc64/dl-irel.h2
-rw-r--r--sysdeps/powerpc/powerpc64/dl-machine.c31
-rw-r--r--sysdeps/powerpc/powerpc64/dl-machine.h63
-rw-r--r--sysdeps/powerpc/powerpc64/dl-trampoline.S6
-rw-r--r--sysdeps/powerpc/powerpc64/entry.h2
-rw-r--r--sysdeps/powerpc/powerpc64/ffsll.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile44
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c21
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf.c32
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c3
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c3
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c13
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S4
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S4
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c15
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c24
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c32
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c29
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c16
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c13
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S4
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c31
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c16
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S16
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c41
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c27
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c21
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c47
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c23
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S31
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c47
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c7
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c14
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c7
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c15
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c13
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S4
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S4
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-ppc64.c24
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c32
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c13
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S4
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S4
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c1
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_ceil.S32
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_ceilf.S24
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_copysign.S20
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_copysignl.S14
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_fabs.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_fabsl.S9
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_fdim.c5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_floor.S32
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_floorf.S24
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_fma.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_fmax.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_fmin.S5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_isnan.S4
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_llrint.S28
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_llrintf.S37
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_llround.S18
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_llroundf.S7
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S23
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S15
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_rint.S23
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_rintf.S15
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_round.S23
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_roundf.S15
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_trunc.S32
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_truncf.S24
-rw-r--r--sysdeps/powerpc/powerpc64/hp-timing.h2
-rw-r--r--sysdeps/powerpc/powerpc64/le/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/le/Implies-before6
-rw-r--r--sysdeps/powerpc/powerpc64/le/Makefile84
-rw-r--r--sysdeps/powerpc/powerpc64/le/configure75
-rw-r--r--sysdeps/powerpc/powerpc64/le/configure.ac48
-rw-r--r--sysdeps/powerpc/powerpc64/le/fpu/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c56
-rw-r--r--sysdeps/powerpc/powerpc64/le/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile6
-rw-r--r--sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128-power9.c35
-rw-r--r--sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128-ppc64le.c35
-rw-r--r--sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128.c31
-rw-r--r--sysdeps/powerpc/powerpc64/le/fpu/sfp-machine.h115
-rw-r--r--sysdeps/powerpc/powerpc64/le/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/le/power7/Implies13
-rw-r--r--sysdeps/powerpc/powerpc64/le/power7/fpu/Implies5
-rw-r--r--sysdeps/powerpc/powerpc64/le/power7/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/le/power7/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/le/power8/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/le/power8/fpu/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/le/power8/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/le/power8/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/le/power9/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/le/power9/fpu/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/le/power9/fpu/e_sqrtf128.c36
-rw-r--r--sysdeps/powerpc/powerpc64/le/power9/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/le/power9/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/lshift.S4
-rw-r--r--sysdeps/powerpc/powerpc64/memcpy.S12
-rw-r--r--sysdeps/powerpc/powerpc64/memset.S12
-rw-r--r--sysdeps/powerpc/powerpc64/mul_1.S4
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/Makefile36
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/bcopy.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/bzero.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c64
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/init-arch.h2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memchr.c5
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp.c19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S176
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy.c25
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memmove.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/mempcpy.c16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c3
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memrchr.c11
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power4.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power6.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-power8.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S18
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c12
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpcpy-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c6
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpcpy.c16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S23
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpncpy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpncpy.c19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S22
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp-ppc64.c21
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c32
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S21
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S33
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasestr-ppc64.c34
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasestr.c37
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcat-power7.c4
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c8
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcat-ppc64.c4
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcat.c16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchr.c17
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchrnul.c5
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S22
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S22
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp.c22
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcpy-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcpy.c16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S23
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcspn.c35
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strlen.c11
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase-ppc64.c21
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase.c27
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c8
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase_l.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c31
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncat.c7
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S21
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S23
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S25
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp.c25
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S23
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncpy.c18
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S26
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strnlen.c19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S24
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c8
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr.c15
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S23
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c25
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strspn.c35
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S25
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strstr.c12
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcschr.c19
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcscpy.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/power4/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/power4/memcmp.S22
-rw-r--r--sysdeps/powerpc/powerpc64/power4/memcpy.S11
-rw-r--r--sysdeps/powerpc/powerpc64/power4/memset.S13
-rw-r--r--sysdeps/powerpc/powerpc64/power4/strncmp.S10
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/Implies4
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S15
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S7
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S15
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S7
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S28
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_llroundf.S1
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S15
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S7
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S15
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S7
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power5/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/power5/fpu/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power5/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power5/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power6/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/power6/fpu/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power6/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S23
-rw-r--r--sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power6/memcpy.S11
-rw-r--r--sysdeps/powerpc/powerpc64/power6/memset.S15
-rw-r--r--sysdeps/powerpc/powerpc64/power6/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/fpu/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S28
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S28
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/fpu/s_llroundf.S1
-rw-r--r--sysdeps/powerpc/powerpc64/power6x/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power7/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/add_n.S12
-rw-r--r--sysdeps/powerpc/powerpc64/power7/fpu/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power7/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memchr.S22
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memcmp.S32
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memcpy.S76
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memmove.S139
-rw-r--r--sysdeps/powerpc/powerpc64/power7/mempcpy.S11
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memrchr.S10
-rw-r--r--sysdeps/powerpc/powerpc64/power7/memset.S13
-rw-r--r--sysdeps/powerpc/powerpc64/power7/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power7/rawmemchr.S10
-rw-r--r--sysdeps/powerpc/powerpc64/power7/stpncpy.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strcasecmp.S7
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strchr.S10
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strchrnul.S13
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strcmp.S10
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strlen.S10
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strncmp.S10
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strncpy.S48
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strnlen.S10
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strrchr.S11
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c2
-rw-r--r--sysdeps/powerpc/powerpc64/power7/strstr.S32
-rw-r--r--sysdeps/powerpc/powerpc64/power7/sub_n.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/Makefile3
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S303
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S509
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S4
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S28
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S28
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_llroundf.S1
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S520
-rw-r--r--sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c1
-rw-r--r--sysdeps/powerpc/powerpc64/power8/memchr.S335
-rw-r--r--sysdeps/powerpc/powerpc64/power8/memcmp.S1447
-rw-r--r--sysdeps/powerpc/powerpc64/power8/memrchr.S345
-rw-r--r--sysdeps/powerpc/powerpc64/power8/memset.S84
-rw-r--r--sysdeps/powerpc/powerpc64/power8/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power8/stpcpy.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power8/stpncpy.S6
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strcasecmp.S457
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strcasestr-ppc64.c29
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strcasestr.S538
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strchr.S377
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strchrnul.S23
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strcmp.S40
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strcpy.S167
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strcspn.S20
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strlen.S290
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strncase.S20
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strncmp.S10
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strncpy.S176
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strnlen.S425
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strrchr.S468
-rw-r--r--sysdeps/powerpc/powerpc64/power8/strspn.S202
-rw-r--r--sysdeps/powerpc/powerpc64/power9/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/power9/fpu/Implies2
-rw-r--r--sysdeps/powerpc/powerpc64/power9/fpu/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power9/multiarch/Implies1
-rw-r--r--sysdeps/powerpc/powerpc64/power9/strcmp.S268
-rw-r--r--sysdeps/powerpc/powerpc64/power9/strncmp.S379
-rw-r--r--sysdeps/powerpc/powerpc64/ppc-mcount.S6
-rw-r--r--sysdeps/powerpc/powerpc64/register-dump.h2
-rw-r--r--sysdeps/powerpc/powerpc64/setjmp-bug21895.c51
-rw-r--r--sysdeps/powerpc/powerpc64/setjmp-common.S13
-rw-r--r--sysdeps/powerpc/powerpc64/setjmp.S2
-rw-r--r--sysdeps/powerpc/powerpc64/start.S6
-rw-r--r--sysdeps/powerpc/powerpc64/strchr.S10
-rw-r--r--sysdeps/powerpc/powerpc64/strcmp.S10
-rw-r--r--sysdeps/powerpc/powerpc64/strcspn.S127
-rw-r--r--sysdeps/powerpc/powerpc64/strlen.S10
-rw-r--r--sysdeps/powerpc/powerpc64/strncmp.S10
-rw-r--r--sysdeps/powerpc/powerpc64/strpbrk.S135
-rw-r--r--sysdeps/powerpc/powerpc64/strspn.S144
-rw-r--r--sysdeps/powerpc/powerpc64/strtok.S226
-rw-r--r--sysdeps/powerpc/powerpc64/strtok_r.S24
-rw-r--r--sysdeps/powerpc/powerpc64/submul_1.S2
-rw-r--r--sysdeps/powerpc/powerpc64/sysdep.h222
-rw-r--r--sysdeps/powerpc/powerpc64/tls-macros.h6
-rw-r--r--sysdeps/powerpc/powerpc64/tst-audit.h2
-rw-r--r--sysdeps/powerpc/powerpc64/tst-setjmp-bug21895-static.c75
-rw-r--r--sysdeps/powerpc/preconfigure6
-rw-r--r--sysdeps/powerpc/sched_cpucount.c2
-rw-r--r--sysdeps/powerpc/sigjmp.c2
-rw-r--r--sysdeps/powerpc/sotruss-lib.c2
-rw-r--r--sysdeps/powerpc/stackinfo.h2
-rw-r--r--sysdeps/powerpc/strcat.c33
-rw-r--r--sysdeps/powerpc/sys/platform/ppc.h20
-rw-r--r--sysdeps/powerpc/sysdep.h6
-rw-r--r--sysdeps/powerpc/test-arith.c2
-rw-r--r--sysdeps/powerpc/test-get_hwcap-static.c2
-rw-r--r--sysdeps/powerpc/test-get_hwcap.c25
-rw-r--r--sysdeps/powerpc/test-gettimebase.c5
-rw-r--r--sysdeps/powerpc/tst-set_ppr.c102
-rw-r--r--sysdeps/powerpc/tst-stack-align.h2
-rw-r--r--sysdeps/powerpc/tst-tlsifunc-static.c19
-rw-r--r--sysdeps/powerpc/tst-tlsifunc.c129
-rw-r--r--sysdeps/powerpc/tst-tlsopt-powerpc.c47
-rw-r--r--sysdeps/pthread/Makefile2
-rw-r--r--sysdeps/pthread/aio_cancel.c2
-rw-r--r--sysdeps/pthread/aio_error.c2
-rw-r--r--sysdeps/pthread/aio_fsync.c2
-rw-r--r--sysdeps/pthread/aio_misc.c11
-rw-r--r--sysdeps/pthread/aio_misc.h39
-rw-r--r--sysdeps/pthread/aio_notify.c22
-rw-r--r--sysdeps/pthread/aio_read.c2
-rw-r--r--sysdeps/pthread/aio_read64.c2
-rw-r--r--sysdeps/pthread/aio_suspend.c5
-rw-r--r--sysdeps/pthread/aio_write.c2
-rw-r--r--sysdeps/pthread/aio_write64.c2
-rw-r--r--sysdeps/pthread/allocalim.h9
-rw-r--r--sysdeps/pthread/bits/sigthread.h5
-rw-r--r--sysdeps/pthread/bits/types/sigevent_t.h18
-rw-r--r--sysdeps/pthread/flockfile.c4
-rw-r--r--sysdeps/pthread/ftrylockfile.c2
-rw-r--r--sysdeps/pthread/funlockfile.c3
-rw-r--r--sysdeps/pthread/lio_listio.c18
-rw-r--r--sysdeps/pthread/lio_listio64.c2
-rw-r--r--sysdeps/pthread/posix-timer.h4
-rw-r--r--sysdeps/pthread/semaphore.h5
-rw-r--r--sysdeps/pthread/timer_create.c4
-rw-r--r--sysdeps/pthread/timer_delete.c2
-rw-r--r--sysdeps/pthread/timer_getoverr.c2
-rw-r--r--sysdeps/pthread/timer_gettime.c4
-rw-r--r--sysdeps/pthread/timer_routines.c40
-rw-r--r--sysdeps/pthread/timer_settime.c6
-rw-r--r--sysdeps/pthread/tst-timer.c3
-rw-r--r--sysdeps/riscv/Implies5
-rw-r--r--sysdeps/riscv/Makefile7
-rw-r--r--sysdeps/riscv/__longjmp.S57
-rw-r--r--sysdeps/riscv/bits/endian.h5
-rw-r--r--sysdeps/riscv/bits/fenv.h74
-rw-r--r--sysdeps/riscv/bits/link.h56
-rw-r--r--sysdeps/riscv/bits/setjmp.h39
-rw-r--r--sysdeps/riscv/bits/wordsize.h29
-rw-r--r--sysdeps/riscv/bsd-_setjmp.c1
-rw-r--r--sysdeps/riscv/bsd-setjmp.c1
-rw-r--r--sysdeps/riscv/configure4
-rw-r--r--sysdeps/riscv/configure.ac4
-rw-r--r--sysdeps/riscv/dl-machine.h323
-rw-r--r--sysdeps/riscv/dl-tls.h (renamed from sysdeps/tile/dl-tls.h)19
-rw-r--r--sysdeps/riscv/dl-trampoline.S90
-rw-r--r--sysdeps/riscv/e_sqrtl.c37
-rw-r--r--sysdeps/riscv/fpu_control.h74
-rw-r--r--sysdeps/riscv/gccframe.h (renamed from sysdeps/tile/gccframe.h)6
-rw-r--r--sysdeps/riscv/jmpbuf-offsets.h23
-rw-r--r--sysdeps/riscv/jmpbuf-unwind.h (renamed from sysdeps/tile/jmpbuf-unwind.h)14
-rw-r--r--sysdeps/riscv/ldsodefs.h47
-rw-r--r--sysdeps/riscv/libc-tls.c32
-rw-r--r--sysdeps/riscv/linkmap.h4
-rw-r--r--sysdeps/riscv/machine-gmon.h37
-rw-r--r--sysdeps/riscv/math-tests.h42
-rw-r--r--sysdeps/riscv/memusage.h21
-rw-r--r--sysdeps/riscv/nofpu/Implies1
-rw-r--r--sysdeps/riscv/nofpu/libm-test-ulps2198
-rw-r--r--sysdeps/riscv/nofpu/libm-test-ulps-name1
-rw-r--r--sysdeps/riscv/nptl/Makefile26
-rw-r--r--sysdeps/riscv/nptl/bits/pthreadtypes-arch.h68
-rw-r--r--sysdeps/riscv/nptl/bits/semaphore.h33
-rw-r--r--sysdeps/riscv/nptl/libc-lowlevellock.c8
-rw-r--r--sysdeps/riscv/nptl/nptl-sysdep.S2
-rw-r--r--sysdeps/riscv/nptl/pthread-offsets.h24
-rw-r--r--sysdeps/riscv/nptl/pthreaddef.h (renamed from sysdeps/tile/nptl/pthreaddef.h)8
-rw-r--r--sysdeps/riscv/nptl/tcb-offsets.sym6
-rw-r--r--sysdeps/riscv/nptl/tls.h146
-rw-r--r--sysdeps/riscv/preconfigure71
-rw-r--r--sysdeps/riscv/rv64/Implies-after1
-rw-r--r--sysdeps/riscv/rv64/rvd/Implies3
-rw-r--r--sysdeps/riscv/rv64/rvd/libm-test-ulps2198
-rw-r--r--sysdeps/riscv/rv64/rvd/libm-test-ulps-name1
-rw-r--r--sysdeps/riscv/rv64/rvd/s_ceil.c52
-rw-r--r--sysdeps/riscv/rv64/rvd/s_floor.c52
-rw-r--r--sysdeps/riscv/rv64/rvd/s_llrint.c30
-rw-r--r--sysdeps/riscv/rv64/rvd/s_llround.c30
-rw-r--r--sysdeps/riscv/rv64/rvd/s_lrint.c30
-rw-r--r--sysdeps/riscv/rv64/rvd/s_lround.c30
-rw-r--r--sysdeps/riscv/rv64/rvd/s_nearbyint.c52
-rw-r--r--sysdeps/riscv/rv64/rvd/s_rint.c52
-rw-r--r--sysdeps/riscv/rv64/rvd/s_round.c52
-rw-r--r--sysdeps/riscv/rv64/rvd/s_roundeven.c53
-rw-r--r--sysdeps/riscv/rv64/rvd/s_trunc.c52
-rw-r--r--sysdeps/riscv/rv64/rvf/Implies1
-rw-r--r--sysdeps/riscv/rv64/rvf/s_llrintf.c30
-rw-r--r--sysdeps/riscv/rv64/rvf/s_llroundf.c30
-rw-r--r--sysdeps/riscv/rv64/rvf/s_lrintf.c31
-rw-r--r--sysdeps/riscv/rv64/rvf/s_lroundf.c31
-rw-r--r--sysdeps/riscv/rvd/e_sqrt.c27
-rw-r--r--sysdeps/riscv/rvd/s_copysign.c28
-rw-r--r--sysdeps/riscv/rvd/s_finite.c28
-rw-r--r--sysdeps/riscv/rvd/s_fma.c30
-rw-r--r--sysdeps/riscv/rvd/s_fmax.c35
-rw-r--r--sysdeps/riscv/rvd/s_fmin.c35
-rw-r--r--sysdeps/riscv/rvd/s_fpclassify.c36
-rw-r--r--sysdeps/riscv/rvd/s_isinf.c29
-rw-r--r--sysdeps/riscv/rvd/s_isnan.c28
-rw-r--r--sysdeps/riscv/rvd/s_issignaling.c27
-rw-r--r--sysdeps/riscv/rvf/e_sqrtf.c27
-rw-r--r--sysdeps/riscv/rvf/fclrexcpt.c28
-rw-r--r--sysdeps/riscv/rvf/fegetenv.c32
-rw-r--r--sysdeps/riscv/rvf/fegetmode.c27
-rw-r--r--sysdeps/riscv/rvf/fegetround.c29
-rw-r--r--sysdeps/riscv/rvf/feholdexcpt.c30
-rw-r--r--sysdeps/riscv/rvf/fesetenv.c30
-rw-r--r--sysdeps/riscv/rvf/fesetexcept.c26
-rw-r--r--sysdeps/riscv/rvf/fesetmode.c31
-rw-r--r--sysdeps/riscv/rvf/fesetround.c39
-rw-r--r--sysdeps/riscv/rvf/feupdateenv.c30
-rw-r--r--sysdeps/riscv/rvf/fgetexcptflg.c30
-rw-r--r--sysdeps/riscv/rvf/fraiseexcpt.c30
-rw-r--r--sysdeps/riscv/rvf/fsetexcptflg.c30
-rw-r--r--sysdeps/riscv/rvf/ftestexcept.c27
-rw-r--r--sysdeps/riscv/rvf/get-rounding-mode.h32
-rw-r--r--sysdeps/riscv/rvf/math_private.h161
-rw-r--r--sysdeps/riscv/rvf/s_ceilf.c52
-rw-r--r--sysdeps/riscv/rvf/s_copysignf.c28
-rw-r--r--sysdeps/riscv/rvf/s_finitef.c28
-rw-r--r--sysdeps/riscv/rvf/s_floorf.c52
-rw-r--r--sysdeps/riscv/rvf/s_fmaf.c30
-rw-r--r--sysdeps/riscv/rvf/s_fmaxf.c35
-rw-r--r--sysdeps/riscv/rvf/s_fminf.c35
-rw-r--r--sysdeps/riscv/rvf/s_fpclassifyf.c36
-rw-r--r--sysdeps/riscv/rvf/s_isinff.c29
-rw-r--r--sysdeps/riscv/rvf/s_isnanf.c28
-rw-r--r--sysdeps/riscv/rvf/s_issignalingf.c27
-rw-r--r--sysdeps/riscv/rvf/s_nearbyintf.c52
-rw-r--r--sysdeps/riscv/rvf/s_rintf.c52
-rw-r--r--sysdeps/riscv/rvf/s_roundevenf.c52
-rw-r--r--sysdeps/riscv/rvf/s_roundf.c52
-rw-r--r--sysdeps/riscv/rvf/s_truncf.c52
-rw-r--r--sysdeps/riscv/setjmp.S74
-rw-r--r--sysdeps/riscv/sfp-machine.h101
-rw-r--r--sysdeps/riscv/sotruss-lib.c51
-rw-r--r--sysdeps/riscv/stackinfo.h33
-rw-r--r--sysdeps/riscv/start.S81
-rw-r--r--sysdeps/riscv/sys/asm.h63
-rw-r--r--sysdeps/riscv/tininess.h1
-rw-r--r--sysdeps/riscv/tls-macros.h47
-rw-r--r--sysdeps/riscv/tst-audit.h23
-rw-r--r--sysdeps/s390/Makefile31
-rw-r--r--sysdeps/s390/asm-syntax.h2
-rw-r--r--sysdeps/s390/atomic-machine.h171
-rw-r--r--sysdeps/s390/bits/byteswap-16.h65
-rw-r--r--sysdeps/s390/bits/byteswap.h134
-rw-r--r--sysdeps/s390/bits/flt-eval-method.h24
-rw-r--r--sysdeps/s390/bits/link.h31
-rw-r--r--sysdeps/s390/bits/mathdef.h36
-rw-r--r--sysdeps/s390/bits/setjmp.h2
-rw-r--r--sysdeps/s390/bits/string.h252
-rw-r--r--sysdeps/s390/bits/xtitypes.h2
-rw-r--r--sysdeps/s390/configure135
-rw-r--r--sysdeps/s390/configure.ac55
-rw-r--r--sysdeps/s390/dl-irel.h2
-rw-r--r--sysdeps/s390/dl-procinfo.c11
-rw-r--r--sysdeps/s390/dl-procinfo.h16
-rw-r--r--sysdeps/s390/dl-tls.h5
-rw-r--r--sysdeps/s390/ffs.c2
-rw-r--r--sysdeps/s390/fix-fp-int-convert-overflow.h2
-rw-r--r--sysdeps/s390/fpu/bits/fenv.h10
-rw-r--r--sysdeps/s390/fpu/bits/mathinline.h100
-rw-r--r--sysdeps/s390/fpu/e_sqrt.c2
-rw-r--r--sysdeps/s390/fpu/e_sqrtf.c2
-rw-r--r--sysdeps/s390/fpu/e_sqrtl.c2
-rw-r--r--sysdeps/s390/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/s390/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/s390/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/s390/fpu/fegetenv.c2
-rw-r--r--sysdeps/s390/fpu/fegetexcept.c2
-rw-r--r--sysdeps/s390/fpu/fegetmode.c27
-rw-r--r--sysdeps/s390/fpu/fegetround.c2
-rw-r--r--sysdeps/s390/fpu/feholdexcpt.c4
-rw-r--r--sysdeps/s390/fpu/fenv_libc.h2
-rw-r--r--sysdeps/s390/fpu/fesetenv.c4
-rw-r--r--sysdeps/s390/fpu/fesetexcept.c33
-rw-r--r--sysdeps/s390/fpu/fesetmode.c39
-rw-r--r--sysdeps/s390/fpu/fesetround.c2
-rw-r--r--sysdeps/s390/fpu/fetestexceptflag.c31
-rw-r--r--sysdeps/s390/fpu/feupdateenv.c2
-rw-r--r--sysdeps/s390/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/s390/fpu/fix-fp-int-compare-invalid.h36
-rw-r--r--sysdeps/s390/fpu/fpu_control.h2
-rw-r--r--sysdeps/s390/fpu/fraiseexcpt.c43
-rw-r--r--sysdeps/s390/fpu/fsetexcptflg.c5
-rw-r--r--sysdeps/s390/fpu/ftestexcept.c2
-rw-r--r--sysdeps/s390/fpu/get-rounding-mode.h2
-rw-r--r--sysdeps/s390/fpu/libm-test-ulps416
-rw-r--r--sysdeps/s390/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/s390/fpu/s_fma.c10
-rw-r--r--sysdeps/s390/fpu/s_fmaf.c5
-rw-r--r--sysdeps/s390/gccframe.h2
-rw-r--r--sysdeps/s390/gconv-modules50
-rw-r--r--sysdeps/s390/gmp-mparam.h2
-rw-r--r--sysdeps/s390/iso-8859-1_cp037_z900.c (renamed from sysdeps/s390/s390-64/iso-8859-1_cp037_z900.c)99
-rw-r--r--sysdeps/s390/jmpbuf-offsets.h2
-rw-r--r--sysdeps/s390/jmpbuf-unwind.h2
-rw-r--r--sysdeps/s390/ldsodefs.h2
-rw-r--r--sysdeps/s390/libc-tls.c2
-rw-r--r--sysdeps/s390/linkmap.h4
-rw-r--r--sysdeps/s390/longjmp.c3
-rw-r--r--sysdeps/s390/machine-gmon.h2
-rw-r--r--sysdeps/s390/mempcpy.S19
-rw-r--r--sysdeps/s390/memusage.h2
-rw-r--r--sysdeps/s390/multiarch/8bit-generic.c402
-rw-r--r--sysdeps/s390/multiarch/Makefile17
-rw-r--r--sysdeps/s390/multiarch/gconv_simple.c1266
-rw-r--r--sysdeps/s390/multiarch/gen-8bit.sh6
-rw-r--r--sysdeps/s390/multiarch/iconv/skeleton.c21
-rw-r--r--sysdeps/s390/multiarch/ifunc-impl-list.c9
-rw-r--r--sysdeps/s390/multiarch/ifunc-resolve.h86
-rw-r--r--sysdeps/s390/multiarch/memccpy-c.c2
-rw-r--r--sysdeps/s390/multiarch/memccpy-vx.S2
-rw-r--r--sysdeps/s390/multiarch/memccpy.c2
-rw-r--r--sysdeps/s390/multiarch/memchr-vx.S2
-rw-r--r--sysdeps/s390/multiarch/memchr.c7
-rw-r--r--sysdeps/s390/multiarch/mempcpy.c32
-rw-r--r--sysdeps/s390/multiarch/memrchr-c.c2
-rw-r--r--sysdeps/s390/multiarch/memrchr-vx.S2
-rw-r--r--sysdeps/s390/multiarch/memrchr.c2
-rw-r--r--sysdeps/s390/multiarch/rawmemchr-c.c2
-rw-r--r--sysdeps/s390/multiarch/rawmemchr-vx.S2
-rw-r--r--sysdeps/s390/multiarch/rawmemchr.c7
-rw-r--r--sysdeps/s390/multiarch/stpcpy-c.c2
-rw-r--r--sysdeps/s390/multiarch/stpcpy-vx.S2
-rw-r--r--sysdeps/s390/multiarch/stpcpy.c11
-rw-r--r--sysdeps/s390/multiarch/stpncpy-c.c2
-rw-r--r--sysdeps/s390/multiarch/stpncpy-vx.S2
-rw-r--r--sysdeps/s390/multiarch/stpncpy.c8
-rw-r--r--sysdeps/s390/multiarch/strcat-c.c2
-rw-r--r--sysdeps/s390/multiarch/strcat-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strcat.c6
-rw-r--r--sysdeps/s390/multiarch/strchr-c.c2
-rw-r--r--sysdeps/s390/multiarch/strchr-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strchr.c8
-rw-r--r--sysdeps/s390/multiarch/strchrnul-c.c2
-rw-r--r--sysdeps/s390/multiarch/strchrnul-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strchrnul.c2
-rw-r--r--sysdeps/s390/multiarch/strcmp-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strcmp.c9
-rw-r--r--sysdeps/s390/multiarch/strcpy-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strcpy.c7
-rw-r--r--sysdeps/s390/multiarch/strcspn-c.c2
-rw-r--r--sysdeps/s390/multiarch/strcspn-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strcspn.c8
-rw-r--r--sysdeps/s390/multiarch/strlen-c.c2
-rw-r--r--sysdeps/s390/multiarch/strlen-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strlen.c6
-rw-r--r--sysdeps/s390/multiarch/strncat-c.c4
-rw-r--r--sysdeps/s390/multiarch/strncat-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strncat.c2
-rw-r--r--sysdeps/s390/multiarch/strncmp-c.c2
-rw-r--r--sysdeps/s390/multiarch/strncmp-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strncmp.c11
-rw-r--r--sysdeps/s390/multiarch/strncpy-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strncpy.c9
-rw-r--r--sysdeps/s390/multiarch/strnlen-c.c2
-rw-r--r--sysdeps/s390/multiarch/strnlen-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strnlen.c9
-rw-r--r--sysdeps/s390/multiarch/strpbrk-c.c2
-rw-r--r--sysdeps/s390/multiarch/strpbrk-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strpbrk.c8
-rw-r--r--sysdeps/s390/multiarch/strrchr-c.c2
-rw-r--r--sysdeps/s390/multiarch/strrchr-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strrchr.c8
-rw-r--r--sysdeps/s390/multiarch/strspn-c.c2
-rw-r--r--sysdeps/s390/multiarch/strspn-vx.S2
-rw-r--r--sysdeps/s390/multiarch/strspn.c8
-rw-r--r--sysdeps/s390/multiarch/utf16-utf32-z9.c48
-rw-r--r--sysdeps/s390/multiarch/utf8-utf16-z9.c50
-rw-r--r--sysdeps/s390/multiarch/utf8-utf32-z9.c50
-rw-r--r--sysdeps/s390/multiarch/wcpcpy-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcpcpy-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcpcpy.c2
-rw-r--r--sysdeps/s390/multiarch/wcpncpy-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcpncpy-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcpncpy.c2
-rw-r--r--sysdeps/s390/multiarch/wcscat-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcscat-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcscat.c2
-rw-r--r--sysdeps/s390/multiarch/wcschr-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcschr-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcschr.c9
-rw-r--r--sysdeps/s390/multiarch/wcschrnul-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcschrnul-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcschrnul.c2
-rw-r--r--sysdeps/s390/multiarch/wcscmp-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcscmp-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcscmp.c6
-rw-r--r--sysdeps/s390/multiarch/wcscpy-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcscpy-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcscpy.c2
-rw-r--r--sysdeps/s390/multiarch/wcscspn-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcscspn-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcscspn.c2
-rw-r--r--sysdeps/s390/multiarch/wcslen-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcslen-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcslen.c2
-rw-r--r--sysdeps/s390/multiarch/wcsncat-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcsncat-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcsncat.c2
-rw-r--r--sysdeps/s390/multiarch/wcsncmp-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcsncmp-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcsncmp.c2
-rw-r--r--sysdeps/s390/multiarch/wcsncpy-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcsncpy-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcsncpy.c2
-rw-r--r--sysdeps/s390/multiarch/wcsnlen-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcsnlen-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcsnlen.c2
-rw-r--r--sysdeps/s390/multiarch/wcspbrk-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcspbrk-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcspbrk.c6
-rw-r--r--sysdeps/s390/multiarch/wcsrchr-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcsrchr-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcsrchr.c2
-rw-r--r--sysdeps/s390/multiarch/wcsspn-c.c2
-rw-r--r--sysdeps/s390/multiarch/wcsspn-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wcsspn.c6
-rw-r--r--sysdeps/s390/multiarch/wmemchr-c.c2
-rw-r--r--sysdeps/s390/multiarch/wmemchr-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wmemchr.c9
-rw-r--r--sysdeps/s390/multiarch/wmemcmp-c.c2
-rw-r--r--sysdeps/s390/multiarch/wmemcmp-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wmemcmp.c2
-rw-r--r--sysdeps/s390/multiarch/wmemset-c.c2
-rw-r--r--sysdeps/s390/multiarch/wmemset-vx.S2
-rw-r--r--sysdeps/s390/multiarch/wmemset.c9
-rw-r--r--sysdeps/s390/nptl/Makefile5
-rw-r--r--sysdeps/s390/nptl/bits/pthreadtypes-arch.h79
-rw-r--r--sysdeps/s390/nptl/bits/pthreadtypes.h248
-rw-r--r--sysdeps/s390/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/s390/nptl/pthread-offsets.h15
-rw-r--r--sysdeps/s390/nptl/pthread_spin_init.c19
-rw-r--r--sysdeps/s390/nptl/pthread_spin_lock.c32
-rw-r--r--sysdeps/s390/nptl/pthread_spin_trylock.c32
-rw-r--r--sysdeps/s390/nptl/pthread_spin_unlock.c32
-rw-r--r--sysdeps/s390/nptl/pthreaddef.h2
-rw-r--r--sysdeps/s390/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/s390/nptl/tls.h21
-rw-r--r--sysdeps/s390/s390-32/Makefile2
-rw-r--r--sysdeps/s390/s390-32/__longjmp.c2
-rw-r--r--sysdeps/s390/s390-32/add_n.S2
-rw-r--r--sysdeps/s390/s390-32/addmul_1.S2
-rw-r--r--sysdeps/s390/s390-32/backtrace.c2
-rw-r--r--sysdeps/s390/s390-32/bcopy.S2
-rw-r--r--sysdeps/s390/s390-32/bits/wordsize.h12
-rw-r--r--sysdeps/s390/s390-32/bzero.S2
-rw-r--r--sysdeps/s390/s390-32/crti.S4
-rw-r--r--sysdeps/s390/s390-32/crtn.S2
-rw-r--r--sysdeps/s390/s390-32/dl-machine.h38
-rw-r--r--sysdeps/s390/s390-32/dl-sysdep.h2
-rw-r--r--sysdeps/s390/s390-32/dl-trampoline.S136
-rw-r--r--sysdeps/s390/s390-32/dl-trampoline.h230
-rw-r--r--sysdeps/s390/s390-32/memchr.S2
-rw-r--r--sysdeps/s390/s390-32/memcmp.S2
-rw-r--r--sysdeps/s390/s390-32/memcpy.S67
-rw-r--r--sysdeps/s390/s390-32/memset.S2
-rw-r--r--sysdeps/s390/s390-32/mul_1.S2
-rw-r--r--sysdeps/s390/s390-32/multiarch/memchr.c2
-rw-r--r--sysdeps/s390/s390-32/multiarch/memcmp-s390.S5
-rw-r--r--sysdeps/s390/s390-32/multiarch/memcmp.c9
-rw-r--r--sysdeps/s390/s390-32/multiarch/memcpy-s390.S38
-rw-r--r--sysdeps/s390/s390-32/multiarch/memcpy.c7
-rw-r--r--sysdeps/s390/s390-32/multiarch/memset-s390.S5
-rw-r--r--sysdeps/s390/s390-32/multiarch/memset.c7
-rw-r--r--sysdeps/s390/s390-32/multiarch/strcmp.c2
-rw-r--r--sysdeps/s390/s390-32/multiarch/strcpy.c2
-rw-r--r--sysdeps/s390/s390-32/multiarch/strncpy.c2
-rw-r--r--sysdeps/s390/s390-32/s390-mcount.S4
-rw-r--r--sysdeps/s390/s390-32/setjmp.S44
-rw-r--r--sysdeps/s390/s390-32/start.S9
-rw-r--r--sysdeps/s390/s390-32/strcmp.S2
-rw-r--r--sysdeps/s390/s390-32/strcpy.S2
-rw-r--r--sysdeps/s390/s390-32/strncpy.S2
-rw-r--r--sysdeps/s390/s390-32/sub_n.S2
-rw-r--r--sysdeps/s390/s390-32/symbol-hacks.h21
-rw-r--r--sysdeps/s390/s390-32/sysdep.h10
-rw-r--r--sysdeps/s390/s390-32/tls-macros.h22
-rw-r--r--sysdeps/s390/s390-32/tst-audit.h2
-rw-r--r--sysdeps/s390/s390-64/Makefile83
-rw-r--r--sysdeps/s390/s390-64/__longjmp.c2
-rw-r--r--sysdeps/s390/s390-64/add_n.S2
-rw-r--r--sysdeps/s390/s390-64/backtrace.c2
-rw-r--r--sysdeps/s390/s390-64/bcopy.S2
-rw-r--r--sysdeps/s390/s390-64/bits/wordsize.h12
-rw-r--r--sysdeps/s390/s390-64/bzero.S2
-rw-r--r--sysdeps/s390/s390-64/crti.S4
-rw-r--r--sysdeps/s390/s390-64/crtn.S2
-rw-r--r--sysdeps/s390/s390-64/dl-machine.h38
-rw-r--r--sysdeps/s390/s390-64/dl-trampoline.S132
-rw-r--r--sysdeps/s390/s390-64/dl-trampoline.h224
-rw-r--r--sysdeps/s390/s390-64/memchr.S2
-rw-r--r--sysdeps/s390/s390-64/memcmp.S2
-rw-r--r--sysdeps/s390/s390-64/memcpy.S51
-rw-r--r--sysdeps/s390/s390-64/memset.S2
-rw-r--r--sysdeps/s390/s390-64/multiarch/memchr.c2
-rw-r--r--sysdeps/s390/s390-64/multiarch/memcmp-s390x.S5
-rw-r--r--sysdeps/s390/s390-64/multiarch/memcmp.c9
-rw-r--r--sysdeps/s390/s390-64/multiarch/memcpy-s390x.S36
-rw-r--r--sysdeps/s390/s390-64/multiarch/memcpy.c7
-rw-r--r--sysdeps/s390/s390-64/multiarch/memset-s390x.S5
-rw-r--r--sysdeps/s390/s390-64/multiarch/memset.c7
-rw-r--r--sysdeps/s390/s390-64/multiarch/strcmp.c2
-rw-r--r--sysdeps/s390/s390-64/multiarch/strcpy.c2
-rw-r--r--sysdeps/s390/s390-64/multiarch/strncpy.c2
-rw-r--r--sysdeps/s390/s390-64/s390x-mcount.S4
-rw-r--r--sysdeps/s390/s390-64/setjmp.S44
-rw-r--r--sysdeps/s390/s390-64/start.S9
-rw-r--r--sysdeps/s390/s390-64/strcmp.S2
-rw-r--r--sysdeps/s390/s390-64/strcpy.S2
-rw-r--r--sysdeps/s390/s390-64/strncpy.S2
-rw-r--r--sysdeps/s390/s390-64/sub_n.S2
-rw-r--r--sysdeps/s390/s390-64/sysdep.h4
-rw-r--r--sysdeps/s390/s390-64/tls-macros.h10
-rw-r--r--sysdeps/s390/s390-64/tst-audit.h2
-rw-r--r--sysdeps/s390/s390-64/utf16-utf32-z9.c337
-rw-r--r--sysdeps/s390/s390-64/utf8-utf16-z9.c471
-rw-r--r--sysdeps/s390/s390-64/utf8-utf32-z9.c511
-rw-r--r--sysdeps/s390/sotruss-lib.c2
-rw-r--r--sysdeps/s390/stackinfo.h2
-rw-r--r--sysdeps/s390/string_private.h2
-rw-r--r--sysdeps/s390/utf16-utf32-z9.c819
-rw-r--r--sysdeps/s390/utf8-utf16-z9.c942
-rw-r--r--sysdeps/s390/utf8-utf32-z9.c983
-rw-r--r--sysdeps/sh/Implies1
-rw-r--r--sysdeps/sh/Makefile4
-rw-r--r--sysdeps/sh/____longjmp_chk.S2
-rw-r--r--sysdeps/sh/_mcount.S2
-rw-r--r--sysdeps/sh/backtrace.c1
-rw-r--r--sysdeps/sh/bits/fenv.h10
-rw-r--r--sysdeps/sh/bits/huge_val.h54
-rw-r--r--sysdeps/sh/bits/link.h2
-rw-r--r--sysdeps/sh/bits/setjmp.h2
-rw-r--r--sysdeps/sh/bsd-_setjmp.S2
-rw-r--r--sysdeps/sh/bsd-setjmp.S2
-rw-r--r--sysdeps/sh/crti.S4
-rw-r--r--sysdeps/sh/crtn.S2
-rw-r--r--sysdeps/sh/dl-machine.h9
-rw-r--r--sysdeps/sh/dl-tls.h5
-rw-r--r--sysdeps/sh/dl-trampoline.S2
-rw-r--r--sysdeps/sh/fpu_control.h2
-rw-r--r--sysdeps/sh/gccframe.h2
-rw-r--r--sysdeps/sh/gmp-mparam.h2
-rw-r--r--sysdeps/sh/jmpbuf-offsets.h2
-rw-r--r--sysdeps/sh/jmpbuf-unwind.h2
-rw-r--r--sysdeps/sh/ldbl-classify-compat.h8
-rw-r--r--sysdeps/sh/ldsodefs.h2
-rw-r--r--sysdeps/sh/libc-tls.c2
-rw-r--r--sysdeps/sh/libm-test-ulps547
-rw-r--r--sysdeps/sh/libm-test-ulps-name1
-rw-r--r--sysdeps/sh/machine-gmon.h2
-rw-r--r--sysdeps/sh/math_private.h10
-rw-r--r--sysdeps/sh/memcpy.S2
-rw-r--r--sysdeps/sh/memset.S2
-rw-r--r--sysdeps/sh/memusage.h2
-rw-r--r--sysdeps/sh/nofpu/Implies1
-rw-r--r--sysdeps/sh/nptl/bits/pthreadtypes-arch.h71
-rw-r--r--sysdeps/sh/nptl/bits/pthreadtypes.h189
-rw-r--r--sysdeps/sh/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/sh/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/sh/nptl/pthread_spin_init.c2
-rw-r--r--sysdeps/sh/nptl/pthread_spin_lock.c2
-rw-r--r--sysdeps/sh/nptl/pthread_spin_trylock.S2
-rw-r--r--sysdeps/sh/nptl/pthread_spin_unlock.S2
-rw-r--r--sysdeps/sh/nptl/pthreaddef.h2
-rw-r--r--sysdeps/sh/nptl/tcb-offsets.sym4
-rw-r--r--sysdeps/sh/nptl/tls.h15
-rw-r--r--sysdeps/sh/preconfigure10
-rw-r--r--sysdeps/sh/s_fma.c5
-rw-r--r--sysdeps/sh/s_fmaf.c5
-rw-r--r--sysdeps/sh/sfp-machine.h (renamed from sysdeps/sh/soft-fp/sfp-machine.h)0
-rw-r--r--sysdeps/sh/sh3/__longjmp.S2
-rw-r--r--sysdeps/sh/sh3/setjmp.S3
-rw-r--r--sysdeps/sh/sh4/__longjmp.S2
-rw-r--r--sysdeps/sh/sh4/bits/mathdef.h46
-rw-r--r--sysdeps/sh/sh4/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/sh/sh4/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/sh/sh4/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/sh/sh4/fpu/fegetenv.c2
-rw-r--r--sysdeps/sh/sh4/fpu/fegetexcept.c2
-rw-r--r--sysdeps/sh/sh4/fpu/fegetmode.c27
-rw-r--r--sysdeps/sh/sh4/fpu/fegetround.c2
-rw-r--r--sysdeps/sh/sh4/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/sh/sh4/fpu/fesetenv.c2
-rw-r--r--sysdeps/sh/sh4/fpu/fesetexcept.c32
-rw-r--r--sysdeps/sh/sh4/fpu/fesetmode.c38
-rw-r--r--sysdeps/sh/sh4/fpu/fesetround.c2
-rw-r--r--sysdeps/sh/sh4/fpu/feupdateenv.c2
-rw-r--r--sysdeps/sh/sh4/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/sh/sh4/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/sh/sh4/fpu/fsetexcptflg.c2
-rw-r--r--sysdeps/sh/sh4/fpu/ftestexcept.c2
-rw-r--r--sysdeps/sh/sh4/setjmp.S3
-rw-r--r--sysdeps/sh/sotruss-lib.c2
-rw-r--r--sysdeps/sh/stackinfo.h2
-rw-r--r--sysdeps/sh/start.S2
-rw-r--r--sysdeps/sh/strlen.S2
-rw-r--r--sysdeps/sh/sysdep.h2
-rw-r--r--sysdeps/sh/tst-audit.h2
-rw-r--r--sysdeps/sparc/Makefile4
-rw-r--r--sysdeps/sparc/backtrace.c2
-rw-r--r--sysdeps/sparc/bits/huge_vall.h47
-rw-r--r--sysdeps/sparc/bits/hwcap.h3
-rw-r--r--sysdeps/sparc/bits/link.h2
-rw-r--r--sysdeps/sparc/bits/mathdef.h38
-rw-r--r--sysdeps/sparc/bits/string.h31
-rw-r--r--sysdeps/sparc/configure42
-rw-r--r--sysdeps/sparc/configure.ac29
-rw-r--r--sysdeps/sparc/crti.S4
-rw-r--r--sysdeps/sparc/crtn.S2
-rw-r--r--sysdeps/sparc/dl-dtprocnum.h2
-rw-r--r--sysdeps/sparc/dl-procinfo.c6
-rw-r--r--sysdeps/sparc/dl-procinfo.h7
-rw-r--r--sysdeps/sparc/dl-sysdep.h2
-rw-r--r--sysdeps/sparc/dl-tls.h5
-rw-r--r--sysdeps/sparc/fpu/bits/fenv.h10
-rw-r--r--sysdeps/sparc/fpu/bits/mathinline.h290
-rw-r--r--sysdeps/sparc/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/sparc/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/sparc/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/sparc/fpu/fegetenv.c2
-rw-r--r--sysdeps/sparc/fpu/fegetexcept.c2
-rw-r--r--sysdeps/sparc/fpu/fegetmode.c26
-rw-r--r--sysdeps/sparc/fpu/fegetround.c2
-rw-r--r--sysdeps/sparc/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/sparc/fpu/fesetenv.c2
-rw-r--r--sysdeps/sparc/fpu/fesetexcept.c31
-rw-r--r--sysdeps/sparc/fpu/fesetmode.c38
-rw-r--r--sysdeps/sparc/fpu/fesetround.c2
-rw-r--r--sysdeps/sparc/fpu/feupdateenv.c2
-rw-r--r--sysdeps/sparc/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/sparc/fpu/fpu_control.h2
-rw-r--r--sysdeps/sparc/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/sparc/fpu/fsetexcptflg.c2
-rw-r--r--sysdeps/sparc/fpu/ftestexcept.c2
-rw-r--r--sysdeps/sparc/fpu/libm-test-ulps264
-rw-r--r--sysdeps/sparc/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/sparc/gccframe.h2
-rw-r--r--sysdeps/sparc/ldsodefs.h2
-rw-r--r--sysdeps/sparc/machine-gmon.h6
-rw-r--r--sysdeps/sparc/memusage.h2
-rw-r--r--sysdeps/sparc/nptl/bits/pthreadtypes-arch.h81
-rw-r--r--sysdeps/sparc/nptl/bits/pthreadtypes.h228
-rw-r--r--sysdeps/sparc/nptl/bits/semaphore.h2
-rw-r--r--sysdeps/sparc/nptl/pthread-offsets.h15
-rw-r--r--sysdeps/sparc/nptl/tcb-offsets.sym1
-rw-r--r--sysdeps/sparc/nptl/tls.h18
-rw-r--r--sysdeps/sparc/sparc-ifunc.h171
-rw-r--r--sysdeps/sparc/sparc-mcount.S4
-rw-r--r--sysdeps/sparc/sparc32/Implies1
-rw-r--r--sysdeps/sparc/sparc32/Makefile25
-rw-r--r--sysdeps/sparc/sparc32/Versions6
-rw-r--r--sysdeps/sparc/sparc32/__longjmp.S2
-rw-r--r--sysdeps/sparc/sparc32/add_n.S2
-rw-r--r--sysdeps/sparc/sparc32/addmul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/alloca.S2
-rw-r--r--sysdeps/sparc/sparc32/atomic-machine.h5
-rw-r--r--sysdeps/sparc/sparc32/bits/setjmp.h2
-rw-r--r--sysdeps/sparc/sparc32/bits/wordsize.h3
-rw-r--r--sysdeps/sparc/sparc32/divrem.m48
-rw-r--r--sysdeps/sparc/sparc32/dl-irel.h2
-rw-r--r--sysdeps/sparc/sparc32/dl-machine.h14
-rw-r--r--sysdeps/sparc/sparc32/dl-plt.h2
-rw-r--r--sysdeps/sparc/sparc32/dl-trampoline.S2
-rw-r--r--sysdeps/sparc/sparc32/e_sqrt.c2
-rw-r--r--sysdeps/sparc/sparc32/fpu/e_sqrtl.c2
-rw-r--r--sysdeps/sparc/sparc32/fpu/s_copysign.S9
-rw-r--r--sysdeps/sparc/sparc32/fpu/s_copysignf.S5
-rw-r--r--sysdeps/sparc/sparc32/fpu/s_fabs.S6
-rw-r--r--sysdeps/sparc/sparc32/fpu/s_fabsf.S5
-rw-r--r--sysdeps/sparc/sparc32/fpu/s_fabsl.c3
-rw-r--r--sysdeps/sparc/sparc32/fpu/s_fdim.S42
-rw-r--r--sysdeps/sparc/sparc32/fpu/s_fdimf.S35
-rw-r--r--sysdeps/sparc/sparc32/fpu/s_signbit.S4
-rw-r--r--sysdeps/sparc/sparc32/fpu/s_signbitl.S2
-rw-r--r--sysdeps/sparc/sparc32/fpu/w_sqrt.S53
-rw-r--r--sysdeps/sparc/sparc32/fpu/w_sqrtf.S51
-rw-r--r--sysdeps/sparc/sparc32/ieee754.h2
-rw-r--r--sysdeps/sparc/sparc32/jmpbuf-offsets.h2
-rw-r--r--sysdeps/sparc/sparc32/jmpbuf-unwind.h2
-rw-r--r--sysdeps/sparc/sparc32/lowlevellock.c2
-rw-r--r--sysdeps/sparc/sparc32/lshift.S2
-rw-r--r--sysdeps/sparc/sparc32/memchr.S2
-rw-r--r--sysdeps/sparc/sparc32/memcpy.S2
-rw-r--r--sysdeps/sparc/sparc32/memset.S2
-rw-r--r--sysdeps/sparc/sparc32/mul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/pthread_spin_lock.S2
-rw-r--r--sysdeps/sparc/sparc32/pthread_spin_trylock.S2
-rw-r--r--sysdeps/sparc/sparc32/pthreaddef.h2
-rw-r--r--sysdeps/sparc/sparc32/q_add.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_add.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_cmp.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_cmp.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_cmpe.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_cmpe.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_div.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_div.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_dtoq.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_dtoq.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_feq.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_feq.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_fge.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_fge.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_fgt.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_fgt.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_fle.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_fle.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_flt.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_flt.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_fne.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_fne.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_itoq.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_itoq.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_lltoq.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_lltoq.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_mul.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_mul.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_neg.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_neg.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_qtod.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_qtod.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_qtoi.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_qtoi.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_qtoll.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_qtoll.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_qtos.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_qtos.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_qtou.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_qtou.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_qtoull.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_qtoull.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_sqrt.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_sqrt.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_stoq.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_stoq.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_sub.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_sub.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_ulltoq.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_util.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_util.c)2
-rw-r--r--sysdeps/sparc/sparc32/q_utoq.c (renamed from sysdeps/sparc/sparc32/soft-fp/q_utoq.c)2
-rw-r--r--sysdeps/sparc/sparc32/rem.S2
-rw-r--r--sysdeps/sparc/sparc32/rshift.S2
-rw-r--r--sysdeps/sparc/sparc32/sdiv.S2
-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_post.c2
-rw-r--r--sysdeps/sparc/sparc32/sem_wait.c93
-rw-r--r--sysdeps/sparc/sparc32/sem_waitcommon.c2
-rw-r--r--sysdeps/sparc/sparc32/setjmp.S3
-rw-r--r--sysdeps/sparc/sparc32/sfp-machine.h218
-rw-r--r--sysdeps/sparc/sparc32/soft-fp/Makefile29
-rw-r--r--sysdeps/sparc/sparc32/soft-fp/Versions8
-rw-r--r--sysdeps/sparc/sparc32/soft-fp/sfp-machine.h218
-rw-r--r--sysdeps/sparc/sparc32/sparcv8/addmul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv8/mul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv8/submul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv8/udiv.S1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/Makefile11
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/addmul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/atomic-machine.h5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/cpu_relax.S1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/cpu_relax.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile34
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S61
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S62
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S58
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S59
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S8
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c37
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.c32
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.c30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S34
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c24
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c29
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c3
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S32
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c24
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c27
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S61
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S62
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S58
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S59
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c14
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c13
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S28
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S28
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S24
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c32
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S17
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S9
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c32
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c32
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.c30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S57
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S53
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S49
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S47
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S92
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S83
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S6
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S40
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S35
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S92
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S83
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S45
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S40
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S45
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S40
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S9
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S72
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S18
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S10
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S9
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S64
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S56
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt.S51
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf.S50
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/hp-timing.h2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/memmove.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/mul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-memmove-niagara7.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S33
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memmove-ultra1.S4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara7.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memmove.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/rtld-memmove.c1
-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/sparc32/sparcv9/submul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/udiv.S1
-rw-r--r--sysdeps/sparc/sparc32/start.S6
-rw-r--r--sysdeps/sparc/sparc32/stpcpy.S2
-rw-r--r--sysdeps/sparc/sparc32/strcat.S2
-rw-r--r--sysdeps/sparc/sparc32/strchr.S2
-rw-r--r--sysdeps/sparc/sparc32/strcmp.S2
-rw-r--r--sysdeps/sparc/sparc32/strcpy.S2
-rw-r--r--sysdeps/sparc/sparc32/strlen.S2
-rw-r--r--sysdeps/sparc/sparc32/sub_n.S2
-rw-r--r--sysdeps/sparc/sparc32/submul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/tst-audit.h2
-rw-r--r--sysdeps/sparc/sparc32/udiv.S3
-rw-r--r--sysdeps/sparc/sparc32/urem.S2
-rw-r--r--sysdeps/sparc/sparc64/Implies1
-rw-r--r--sysdeps/sparc/sparc64/Makefile37
-rw-r--r--sysdeps/sparc/sparc64/Versions6
-rw-r--r--sysdeps/sparc/sparc64/add_n.S2
-rw-r--r--sysdeps/sparc/sparc64/addmul_1.S2
-rw-r--r--sysdeps/sparc/sparc64/align-cpy.S2
-rw-r--r--sysdeps/sparc/sparc64/atomic-machine.h5
-rw-r--r--sysdeps/sparc/sparc64/bits/wordsize.h3
-rw-r--r--sysdeps/sparc/sparc64/cpu_relax.S67
-rw-r--r--sysdeps/sparc/sparc64/cpu_relax.c38
-rw-r--r--sysdeps/sparc/sparc64/dl-irel.h2
-rw-r--r--sysdeps/sparc/sparc64/dl-machine.h12
-rw-r--r--sysdeps/sparc/sparc64/dl-plt.h2
-rw-r--r--sysdeps/sparc/sparc64/dl-trampoline.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/e_sqrtl.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/Makefile44
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S57
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S59
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c23
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S56
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S58
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c23
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c37
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c33
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S57
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S59
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c23
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S56
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S58
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c23
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c26
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c26
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S26
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S27
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S26
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S27
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c37
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c33
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c37
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c33
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S17
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c40
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S17
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c40
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S4
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S3
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S4
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S3
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S4
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S4
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S23
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c37
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c28
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S53
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c23
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S52
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c23
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_ceil.S83
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_ceilf.S81
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_copysign.S5
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_copysignf.S5
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fabs.c4
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fabsf.c4
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fabsl.c4
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fdim.S32
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fdimf.S31
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_finite.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_finitef.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_floor.S83
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_floorf.S81
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fmax.S36
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fmaxf.S36
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fmin.S36
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fminf.S36
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_isinf.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_isinff.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_isnan.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_isnanf.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_lrint.S7
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_lrintf.S7
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_nearbyint.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_nearbyintf.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_rint.S5
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_rintf.S5
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_signbit.S4
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_signbitf.S3
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_trunc.S55
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_truncf.S54
-rw-r--r--sysdeps/sparc/sparc64/fpu/w_sqrt.S48
-rw-r--r--sysdeps/sparc/sparc64/fpu/w_sqrtf.S48
-rw-r--r--sysdeps/sparc/sparc64/hp-timing.h2
-rw-r--r--sysdeps/sparc/sparc64/jmpbuf-unwind.h9
-rw-r--r--sysdeps/sparc/sparc64/lshift.S2
-rw-r--r--sysdeps/sparc/sparc64/memchr.S2
-rw-r--r--sysdeps/sparc/sparc64/memcmp.S2
-rw-r--r--sysdeps/sparc/sparc64/memcpy.S2
-rw-r--r--sysdeps/sparc/sparc64/memmove.S186
-rw-r--r--sysdeps/sparc/sparc64/memset.S2
-rw-r--r--sysdeps/sparc/sparc64/mul_1.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/Makefile8
-rw-r--r--sysdeps/sparc/sparc64/multiarch/add_n-generic.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/add_n-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/add_n.S56
-rw-r--r--sysdeps/sparc/sparc64/multiarch/add_n.c28
-rw-r--r--sysdeps/sparc/sparc64/multiarch/addmul_1-generic.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/addmul_1-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/addmul_1.S56
-rw-r--r--sysdeps/sparc/sparc64/multiarch/addmul_1.c28
-rw-r--r--sysdeps/sparc/sparc64/multiarch/bzero.c33
-rw-r--r--sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c15
-rw-r--r--sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h43
-rw-r--r--sysdeps/sparc/sparc64/multiarch/ifunc-memmove.h31
-rw-r--r--sysdeps/sparc/sparc64/multiarch/ifunc-memset.h37
-rw-r--r--sysdeps/sparc/sparc64/multiarch/md5-crop.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memcpy-memmove-niagara7.S980
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S33
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memcpy.S167
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memcpy.c33
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memmove-ultra1.S4
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memmove.c33
-rw-r--r--sysdeps/sparc/sparc64/multiarch/mempcpy.c39
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memset-niagara1.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memset-niagara4.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memset-niagara7.S334
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memset-ultra1.S30
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memset.S124
-rw-r--r--sysdeps/sparc/sparc64/multiarch/memset.c33
-rw-r--r--sysdeps/sparc/sparc64/multiarch/mul_1-generic.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/mul_1-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/mul_1.S56
-rw-r--r--sysdeps/sparc/sparc64/multiarch/mul_1.c28
-rw-r--r--sysdeps/sparc/sparc64/multiarch/rtld-memmove.c1
-rw-r--r--sysdeps/sparc/sparc64/multiarch/sha256-block.c16
-rw-r--r--sysdeps/sparc/sparc64/multiarch/sha256-crop.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/sha512-block.c16
-rw-r--r--sysdeps/sparc/sparc64/multiarch/sha512-crop.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/sub_n-generic.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/sub_n-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/sub_n.S56
-rw-r--r--sysdeps/sparc/sparc64/multiarch/sub_n.c28
-rw-r--r--sysdeps/sparc/sparc64/multiarch/submul_1-generic.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/submul_1-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/multiarch/submul_1.S56
-rw-r--r--sysdeps/sparc/sparc64/multiarch/submul_1.c28
-rw-r--r--sysdeps/sparc/sparc64/pthread_spin_lock.S2
-rw-r--r--sysdeps/sparc/sparc64/pthread_spin_trylock.S2
-rw-r--r--sysdeps/sparc/sparc64/pthread_spin_unlock.S2
-rw-r--r--sysdeps/sparc/sparc64/pthreaddef.h2
-rw-r--r--sysdeps/sparc/sparc64/qp_add.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_add.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_cmp.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_cmp.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_cmpe.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_cmpe.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_div.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_div.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_dtoq.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_feq.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_feq.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_fge.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_fge.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_fgt.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_fgt.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_fle.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_fle.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_flt.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_flt.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_fne.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_fne.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_itoq.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_itoq.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_mul.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_mul.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_neg.S (renamed from sysdeps/sparc/sparc64/soft-fp/qp_neg.S)2
-rw-r--r--sysdeps/sparc/sparc64/qp_qtod.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_qtod.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_qtoi.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_qtos.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_qtos.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_qtoui.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_qtoux.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_qtox.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_qtox.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_sqrt.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_sqrt.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_stoq.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_stoq.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_sub.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_sub.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_uitoq.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_util.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_util.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_uxtoq.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c)2
-rw-r--r--sysdeps/sparc/sparc64/qp_xtoq.c (renamed from sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c)2
-rw-r--r--sysdeps/sparc/sparc64/rawmemchr.S2
-rw-r--r--sysdeps/sparc/sparc64/rshift.S2
-rw-r--r--sysdeps/sparc/sparc64/rtld-memmove.c2
-rw-r--r--sysdeps/sparc/sparc64/sfp-machine.h147
-rw-r--r--sysdeps/sparc/sparc64/soft-fp/Makefile33
-rw-r--r--sysdeps/sparc/sparc64/soft-fp/Versions8
-rw-r--r--sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c79
-rw-r--r--sysdeps/sparc/sparc64/soft-fp/s_frexpl.c51
-rw-r--r--sysdeps/sparc/sparc64/soft-fp/s_scalblnl.c52
-rw-r--r--sysdeps/sparc/sparc64/soft-fp/s_scalbnl.c52
-rw-r--r--sysdeps/sparc/sparc64/soft-fp/sfp-machine.h147
-rw-r--r--sysdeps/sparc/sparc64/start.S6
-rw-r--r--sysdeps/sparc/sparc64/stpcpy.S2
-rw-r--r--sysdeps/sparc/sparc64/stpncpy.S2
-rw-r--r--sysdeps/sparc/sparc64/strcat.S2
-rw-r--r--sysdeps/sparc/sparc64/strchr.S2
-rw-r--r--sysdeps/sparc/sparc64/strcmp.S2
-rw-r--r--sysdeps/sparc/sparc64/strcpy.S2
-rw-r--r--sysdeps/sparc/sparc64/strcspn.S2
-rw-r--r--sysdeps/sparc/sparc64/strlen.S2
-rw-r--r--sysdeps/sparc/sparc64/strncmp.S2
-rw-r--r--sysdeps/sparc/sparc64/strncpy.S2
-rw-r--r--sysdeps/sparc/sparc64/strpbrk.S2
-rw-r--r--sysdeps/sparc/sparc64/strspn.S2
-rw-r--r--sysdeps/sparc/sparc64/sub_n.S2
-rw-r--r--sysdeps/sparc/sparc64/submul_1.S2
-rw-r--r--sysdeps/sparc/sparc64/tst-audit.h2
-rw-r--r--sysdeps/sparc/stackinfo.h2
-rw-r--r--sysdeps/sparc/sysdep.h2
-rw-r--r--sysdeps/tile/Implies2
-rw-r--r--sysdeps/tile/Makefile13
-rw-r--r--sysdeps/tile/Versions6
-rw-r--r--sysdeps/tile/__longjmp.S57
-rw-r--r--sysdeps/tile/__tls_get_addr.S152
-rw-r--r--sysdeps/tile/_mcount.S87
-rw-r--r--sysdeps/tile/abort-instr.h2
-rw-r--r--sysdeps/tile/atomic-machine.h86
-rw-r--r--sysdeps/tile/backtrace.c1
-rw-r--r--sysdeps/tile/bits/byteswap.h37
-rw-r--r--sysdeps/tile/bits/endian.h11
-rw-r--r--sysdeps/tile/bits/fenv.h45
-rw-r--r--sysdeps/tile/bits/link.h57
-rw-r--r--sysdeps/tile/bits/mathdef.h54
-rw-r--r--sysdeps/tile/bits/mathinline.h44
-rw-r--r--sysdeps/tile/bits/setjmp.h36
-rw-r--r--sysdeps/tile/bsd-_setjmp.S1
-rw-r--r--sysdeps/tile/bsd-setjmp.S1
-rw-r--r--sysdeps/tile/bzero.S30
-rw-r--r--sysdeps/tile/configure7
-rw-r--r--sysdeps/tile/configure.ac6
-rw-r--r--sysdeps/tile/crti.S124
-rw-r--r--sysdeps/tile/crtn.S55
-rw-r--r--sysdeps/tile/dl-lookupcfg.h27
-rw-r--r--sysdeps/tile/dl-machine.h919
-rw-r--r--sysdeps/tile/dl-runtime.c159
-rw-r--r--sysdeps/tile/dl-start.S114
-rw-r--r--sysdeps/tile/dl-tls.c27
-rw-r--r--sysdeps/tile/dl-trampoline.S193
-rw-r--r--sysdeps/tile/ffs.c36
-rw-r--r--sysdeps/tile/ffsll.c32
-rw-r--r--sysdeps/tile/jmpbuf-offsets.h62
-rw-r--r--sysdeps/tile/ldsodefs.h40
-rw-r--r--sysdeps/tile/libm-test-ulps394
-rw-r--r--sysdeps/tile/machine-gmon.h25
-rw-r--r--sysdeps/tile/math_private.h44
-rw-r--r--sysdeps/tile/memcmp.c357
-rw-r--r--sysdeps/tile/memcopy.h33
-rw-r--r--sysdeps/tile/nptl/Makefile20
-rw-r--r--sysdeps/tile/nptl/bits/pthreadtypes.h228
-rw-r--r--sysdeps/tile/nptl/bits/semaphore.h41
-rw-r--r--sysdeps/tile/nptl/pthread_spin_lock.c56
-rw-r--r--sysdeps/tile/nptl/pthread_spin_trylock.c32
-rw-r--r--sysdeps/tile/nptl/pthread_spin_unlock.c33
-rw-r--r--sysdeps/tile/nptl/tcb-offsets.sym17
-rw-r--r--sysdeps/tile/nptl/tls.h199
-rw-r--r--sysdeps/tile/preconfigure12
-rw-r--r--sysdeps/tile/s_fma.c1
-rw-r--r--sysdeps/tile/s_fmaf.c1
-rw-r--r--sysdeps/tile/setjmp.S46
-rw-r--r--sysdeps/tile/sfp-machine.h99
-rw-r--r--sysdeps/tile/sotruss-lib.c49
-rw-r--r--sysdeps/tile/stackguard-macros.h20
-rw-r--r--sysdeps/tile/stackinfo.h48
-rw-r--r--sysdeps/tile/start.S203
-rw-r--r--sysdeps/tile/sysdep.h110
-rw-r--r--sysdeps/tile/tilegx/Implies1
-rw-r--r--sysdeps/tile/tilegx/Makefile35
-rw-r--r--sysdeps/tile/tilegx/atomic-machine.h60
-rw-r--r--sysdeps/tile/tilegx/bits/wordsize.h8
-rw-r--r--sysdeps/tile/tilegx/memchr.c73
-rw-r--r--sysdeps/tile/tilegx/memcpy.c272
-rw-r--r--sysdeps/tile/tilegx/memset.c151
-rw-r--r--sysdeps/tile/tilegx/memusage.h31
-rw-r--r--sysdeps/tile/tilegx/rawmemchr.c45
-rw-r--r--sysdeps/tile/tilegx/strcasestr.c53
-rw-r--r--sysdeps/tile/tilegx/strchr.c67
-rw-r--r--sysdeps/tile/tilegx/strchrnul.c64
-rw-r--r--sysdeps/tile/tilegx/string-endian.h58
-rw-r--r--sysdeps/tile/tilegx/strlen.c39
-rw-r--r--sysdeps/tile/tilegx/strnlen.c57
-rw-r--r--sysdeps/tile/tilegx/strrchr.c68
-rw-r--r--sysdeps/tile/tilegx/strstr.c270
-rw-r--r--sysdeps/tile/tilegx/tilegx32/Implies3
-rw-r--r--sysdeps/tile/tilegx/tilegx64/Implies3
-rw-r--r--sysdeps/tile/tilepro/Implies2
-rw-r--r--sysdeps/tile/tilepro/atomic-machine.h88
-rw-r--r--sysdeps/tile/tilepro/bits/wordsize.h3
-rw-r--r--sysdeps/tile/tilepro/memchr.c72
-rw-r--r--sysdeps/tile/tilepro/memcpy.S397
-rw-r--r--sysdeps/tile/tilepro/memset.c151
-rw-r--r--sysdeps/tile/tilepro/memusage.h29
-rw-r--r--sysdeps/tile/tilepro/rawmemchr.c45
-rw-r--r--sysdeps/tile/tilepro/strchr.c68
-rw-r--r--sysdeps/tile/tilepro/strchrnul.c65
-rw-r--r--sysdeps/tile/tilepro/strlen.c39
-rw-r--r--sysdeps/tile/tilepro/strrchr.c73
-rw-r--r--sysdeps/tile/tls-macros.h84
-rw-r--r--sysdeps/tile/tst-audit.h23
-rw-r--r--sysdeps/tile/wordcopy.c437
-rw-r--r--sysdeps/unix/Makefile2
-rw-r--r--sysdeps/unix/alpha/Makefile1
-rw-r--r--sysdeps/unix/alpha/getegid.S2
-rw-r--r--sysdeps/unix/alpha/geteuid.S2
-rw-r--r--sysdeps/unix/alpha/getppid.S2
-rw-r--r--sysdeps/unix/alpha/pipe.S2
-rw-r--r--sysdeps/unix/alpha/sysdep.S2
-rw-r--r--sysdeps/unix/alpha/sysdep.h2
-rw-r--r--sysdeps/unix/arm/sysdep.S2
-rw-r--r--sysdeps/unix/arm/sysdep.h2
-rw-r--r--sysdeps/unix/bsd/bits/signum.h60
-rw-r--r--sysdeps/unix/bsd/bits/sockaddr.h7
-rw-r--r--sysdeps/unix/bsd/ftime.c2
-rw-r--r--sysdeps/unix/bsd/getpt.c2
-rw-r--r--sysdeps/unix/bsd/gtty.c4
-rw-r--r--sysdeps/unix/bsd/stty.c4
-rw-r--r--sysdeps/unix/bsd/tcdrain.c2
-rw-r--r--sysdeps/unix/bsd/tcflow.c4
-rw-r--r--sysdeps/unix/bsd/tcflush.c2
-rw-r--r--sysdeps/unix/bsd/tcgetattr.c3
-rw-r--r--sysdeps/unix/bsd/tcgetpgrp.c2
-rw-r--r--sysdeps/unix/bsd/tcsendbrk.c2
-rw-r--r--sysdeps/unix/bsd/tcsetattr.c2
-rw-r--r--sysdeps/unix/bsd/tcsetpgrp.c2
-rw-r--r--sysdeps/unix/bsd/ualarm.c2
-rw-r--r--sysdeps/unix/bsd/unlockpt.c4
-rw-r--r--sysdeps/unix/bsd/wait.c4
-rw-r--r--sysdeps/unix/bsd/wait3.c4
-rw-r--r--sysdeps/unix/bsd/waitpid.c4
-rw-r--r--sysdeps/unix/clock_gettime.c6
-rw-r--r--sysdeps/unix/clock_nanosleep.c6
-rw-r--r--sysdeps/unix/clock_settime.c5
-rw-r--r--sysdeps/unix/get_child_max.c2
-rw-r--r--sysdeps/unix/getlogin.c2
-rw-r--r--sysdeps/unix/getlogin_r.c7
-rw-r--r--sysdeps/unix/getpagesize.c2
-rw-r--r--sysdeps/unix/grantpt.c2
-rw-r--r--sysdeps/unix/i386/sysdep.S2
-rw-r--r--sysdeps/unix/i386/sysdep.h2
-rw-r--r--sysdeps/unix/ifreq.c2
-rw-r--r--sysdeps/unix/make-syscalls.sh23
-rw-r--r--sysdeps/unix/mips/mips32/sysdep.h2
-rw-r--r--sysdeps/unix/mips/mips64/n32/sysdep.h2
-rw-r--r--sysdeps/unix/mips/mips64/n64/sysdep.h2
-rw-r--r--sysdeps/unix/mips/pipe.S2
-rw-r--r--sysdeps/unix/mips/sysdep.S2
-rw-r--r--sysdeps/unix/mips/sysdep.h2
-rw-r--r--sysdeps/unix/powerpc/sysdep.h2
-rw-r--r--sysdeps/unix/pt-fcntl.c49
-rw-r--r--sysdeps/unix/sh/sysdep.S2
-rw-r--r--sysdeps/unix/sh/sysdep.h2
-rw-r--r--sysdeps/unix/sockatmark.c2
-rw-r--r--sysdeps/unix/stime.c2
-rw-r--r--sysdeps/unix/syscall-template.S14
-rw-r--r--sysdeps/unix/syscall.S2
-rw-r--r--sysdeps/unix/syscalls.list2
-rw-r--r--sysdeps/unix/sysdep.h91
-rw-r--r--sysdeps/unix/sysv/linux/Makefile187
-rw-r--r--sysdeps/unix/sysv/linux/Versions9
-rw-r--r--sysdeps/unix/sysv/linux/_G_config.h63
-rw-r--r--sysdeps/unix/sysv/linux/_exit.c2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/Makefile3
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/__read_tp.S2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/arch-fork.h28
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h10
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h51
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/bits/ipc.h2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/bits/local_lim.h2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h34
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/clone.S31
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/configure4
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/cpu-features.c83
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/cpu-features.h61
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/dl-cache.h17
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c81
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h57
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/dl-static.c2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/getcontext.S5
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/gettimeofday.c71
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/init-first.c14
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/ioctl.S3
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/ipc_priv.h21
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/kernel-features.h18
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/kernel_rt_sigframe.h4
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/ld.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/ldconfig.h4
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/ldsodefs.h5
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libc-__read_tp.S2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libc-start.c28
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libc-vdso.h2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libc.abilist59
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libdl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libm.abilist635
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libnsl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libpthread.abilist23
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libresolv.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/librt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libthread_db.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/localplt.data12
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/makecontext.c12
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/mmap.c34
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/pt-vfork.c2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/readelflib.c2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/setcontext.S3
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sigaction.c60
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h7
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/swapcontext.S3
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sys/elf.h2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sys/procfs.h4
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h85
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h44
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sys/user.h2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sysconf.c55
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h134
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sysdep.c2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sysdep.h18
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/ucontext-internal.h2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/vfork.S19
-rw-r--r--sysdeps/unix/sysv/linux/accept.c9
-rw-r--r--sysdeps/unix/sysv/linux/accept4.c70
-rw-r--r--sysdeps/unix/sysv/linux/access.c32
-rw-r--r--sysdeps/unix/sysv/linux/adjtime.c2
-rw-r--r--sysdeps/unix/sysv/linux/aio_misc.h2
-rw-r--r--sysdeps/unix/sysv/linux/aio_sigqueue.c3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Makefile19
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Versions3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/adjtime.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/arch-fork.h28
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/dirent.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/epoll.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/errno.h44
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/eventfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/inotify.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/ioctls.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/ipc.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/local_lim.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/msq.h3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/netdb.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h175
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/resource.h55
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/sem.h3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/semaphore.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/sigaction.h13
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/signalfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/signum.h71
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/sigstack.h34
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/socket_type.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/statfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/termios.h23
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/timerfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/typesizes.h5
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/wordsize.h14
-rw-r--r--sysdeps/unix/sysv/linux/alpha/brk.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/clone.S38
-rw-r--r--sysdeps/unix/sysv/linux/alpha/creat.c8
-rw-r--r--sysdeps/unix/sysv/linux/alpha/dl-auxv.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/fxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/fxstatat.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getdents.c8
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getdents64.c9
-rw-r--r--sysdeps/unix/sysv/linux/alpha/gethostname.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getrlimit64.c56
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getsysstats.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/glob-lstat-compat.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/glob.c51
-rw-r--r--sysdeps/unix/sysv/linux/alpha/globfree.c37
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ioperm.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ipc_priv.h33
-rw-r--r--sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/kernel-features.h49
-rw-r--r--sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h21
-rw-r--r--sysdeps/unix/sysv/linux/alpha/kernel_stat.h1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/kernel_termios.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ld.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libc.abilist93
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libm.abilist644
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libpthread.abilist35
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/librt.abilist7
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/localplt.data34
-rw-r--r--sysdeps/unix/sysv/linux/alpha/lxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/makecontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/msgctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/oldglob.c10
-rw-r--r--sysdeps/unix/sysv/linux/alpha/pt-vfork.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/register-dump.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/rt_sigaction.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/select.c53
-rw-r--r--sysdeps/unix/sysv/linux/alpha/semctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/setfpucw.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/setrlimit64.c53
-rw-r--r--sysdeps/unix/sysv/linux/alpha/shmctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sigaction.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h7
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sigprocmask.c3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sigsuspend.S32
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sizes.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sys/acct.h6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sys/io.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sys/procfs.h4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sys/ucontext.h58
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sys/user.h3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list23
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sysconf.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h174
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym14
-rw-r--r--sysdeps/unix/sysv/linux/alpha/vfork.S17
-rw-r--r--sysdeps/unix/sysv/linux/alpha/xstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/xstatconv.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/xstatconv.h2
-rw-r--r--sysdeps/unix/sysv/linux/alphasort64.c48
-rw-r--r--sysdeps/unix/sysv/linux/arch-fork.h49
-rw-r--r--sysdeps/unix/sysv/linux/arm/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/arm/Versions3
-rw-r--r--sysdeps/unix/sysv/linux/arm/____longjmp_chk.S2
-rw-r--r--sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S2
-rw-r--r--sysdeps/unix/sysv/linux/arm/alphasort64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/arch-fork.h27
-rw-r--r--sysdeps/unix/sysv/linux/arm/arm-features.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/atomic-machine.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/bits/hwcap.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/arm/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/arm/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/arm/clone.S22
-rw-r--r--sysdeps/unix/sysv/linux/arm/dl-cache.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/dl-machine.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/dl-procinfo.c4
-rw-r--r--sysdeps/unix/sysv/linux/arm/dl-procinfo.h4
-rw-r--r--sysdeps/unix/sysv/linux/arm/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/ftruncate64.c36
-rw-r--r--sysdeps/unix/sysv/linux/arm/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/arm/getdents64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/glob64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/init-first.c2
-rw-r--r--sysdeps/unix/sysv/linux/arm/ioperm.c2
-rw-r--r--sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/arm/kernel-features.h36
-rw-r--r--sysdeps/unix/sysv/linux/arm/ld.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/arm/ldconfig.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/ldsodefs.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/libc-do-syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/arm/libc-vdso.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/libc.abilist63
-rw-r--r--sysdeps/unix/sysv/linux/arm/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/libdl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/libm.abilist399
-rw-r--r--sysdeps/unix/sysv/linux/arm/libnsl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/libpthread.abilist25
-rw-r--r--sysdeps/unix/sysv/linux/arm/libresolv.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/arm/librt.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/arm/libthread_db.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/localplt.data13
-rw-r--r--sysdeps/unix/sysv/linux/arm/makecontext.c2
-rw-r--r--sysdeps/unix/sysv/linux/arm/mmap.c18
-rw-r--r--sysdeps/unix/sysv/linux/arm/msgctl.c33
-rw-r--r--sysdeps/unix/sysv/linux/arm/oldgetrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/oldsetrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/posix_fadvise.c30
-rw-r--r--sysdeps/unix/sysv/linux/arm/posix_fadvise64.c38
-rw-r--r--sysdeps/unix/sysv/linux/arm/pread.c36
-rw-r--r--sysdeps/unix/sysv/linux/arm/pread64.c37
-rw-r--r--sysdeps/unix/sysv/linux/arm/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/pwrite.c36
-rw-r--r--sysdeps/unix/sysv/linux/arm/pwrite64.c38
-rw-r--r--sysdeps/unix/sysv/linux/arm/readahead.c37
-rw-r--r--sysdeps/unix/sysv/linux/arm/readdir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/readdir64_r.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/readelflib.c2
-rw-r--r--sysdeps/unix/sysv/linux/arm/register-dump.h4
-rw-r--r--sysdeps/unix/sysv/linux/arm/scandir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/semctl.c54
-rw-r--r--sysdeps/unix/sysv/linux/arm/setcontext.S9
-rw-r--r--sysdeps/unix/sysv/linux/arm/setegid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/seteuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setgroups.c2
-rw-r--r--sysdeps/unix/sysv/linux/arm/setregid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setresgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setresuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setreuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/shmctl.c34
-rw-r--r--sysdeps/unix/sysv/linux/arm/sigaction.c81
-rw-r--r--sysdeps/unix/sysv/linux/arm/sigcontextinfo.h13
-rw-r--r--sysdeps/unix/sysv/linux/arm/sigrestorer.S2
-rw-r--r--sysdeps/unix/sysv/linux/arm/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/elf.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/io.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/ptrace.h208
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/ucontext.h88
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/user.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/arm/syscalls.list20
-rw-r--r--sysdeps/unix/sysv/linux/arm/sysdep-cancel.h241
-rw-r--r--sysdeps/unix/sysv/linux/arm/sysdep.S2
-rw-r--r--sysdeps/unix/sysv/linux/arm/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/arm/tls.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/truncate64.c35
-rw-r--r--sysdeps/unix/sysv/linux/arm/umount.c30
-rw-r--r--sysdeps/unix/sysv/linux/arm/versionsort64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/vfork.S17
-rw-r--r--sysdeps/unix/sysv/linux/bind.c2
-rw-r--r--sysdeps/unix/sysv/linux/bits/dirent.h4
-rw-r--r--sysdeps/unix/sysv/linux/bits/epoll.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/errno.h45
-rw-r--r--sysdeps/unix/sysv/linux/bits/eventfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/fcntl-linux.h89
-rw-r--r--sysdeps/unix/sysv/linux/bits/in.h43
-rw-r--r--sysdeps/unix/sysv/linux/bits/inotify.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/ioctl-types.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/ioctls.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/ipc.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/local_lim.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/mman-linux.h117
-rw-r--r--sysdeps/unix/sysv/linux/bits/mman-shared.h76
-rw-r--r--sysdeps/unix/sysv/linux/bits/mqueue.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/msq.h3
-rw-r--r--sysdeps/unix/sysv/linux/bits/param.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/poll.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/posix_opt.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/ptrace-shared.h85
-rw-r--r--sysdeps/unix/sysv/linux/bits/resource.h111
-rw-r--r--sysdeps/unix/sysv/linux/bits/sched.h131
-rw-r--r--sysdeps/unix/sysv/linux/bits/sem.h3
-rw-r--r--sysdeps/unix/sysv/linux/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/bits/sigaction.h13
-rw-r--r--sysdeps/unix/sysv/linux/bits/sigcontext.h7
-rw-r--r--sysdeps/unix/sysv/linux/bits/sigevent-consts.h41
-rw-r--r--sysdeps/unix/sysv/linux/bits/siginfo-arch.h7
-rw-r--r--sysdeps/unix/sysv/linux/bits/siginfo-consts-arch.h7
-rw-r--r--sysdeps/unix/sysv/linux/bits/siginfo-consts.h191
-rw-r--r--sysdeps/unix/sysv/linux/bits/siginfo.h341
-rw-r--r--sysdeps/unix/sysv/linux/bits/signalfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/signum.h93
-rw-r--r--sysdeps/unix/sysv/linux/bits/sigset.h124
-rw-r--r--sysdeps/unix/sysv/linux/bits/sigstack.h34
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h77
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket_type.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/ss_flags.h35
-rw-r--r--sysdeps/unix/sysv/linux/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/statfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/statvfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/sys_errlist.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/termios.h4
-rw-r--r--sysdeps/unix/sysv/linux/bits/time.h70
-rw-r--r--sysdeps/unix/sysv/linux/bits/timerfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/timex.h3
-rw-r--r--sysdeps/unix/sysv/linux/bits/types/__sigset_t.h10
-rw-r--r--sysdeps/unix/sysv/linux/bits/types/sigevent_t.h48
-rw-r--r--sysdeps/unix/sysv/linux/bits/types/siginfo_t.h151
-rw-r--r--sysdeps/unix/sysv/linux/bits/types/stack_t.h33
-rw-r--r--sysdeps/unix/sysv/linux/bits/uio-ext.h53
-rw-r--r--sysdeps/unix/sysv/linux/bits/uio.h77
-rw-r--r--sysdeps/unix/sysv/linux/bits/uio_lim.h32
-rw-r--r--sysdeps/unix/sysv/linux/bits/utsname.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/waitflags.h12
-rw-r--r--sysdeps/unix/sysv/linux/check_native.c17
-rw-r--r--sysdeps/unix/sysv/linux/check_pf.c17
-rw-r--r--sysdeps/unix/sysv/linux/clock.c2
-rw-r--r--sysdeps/unix/sysv/linux/clock_getcpuclockid.c2
-rw-r--r--sysdeps/unix/sysv/linux/clock_getres.c2
-rw-r--r--sysdeps/unix/sysv/linux/clock_gettime.c2
-rw-r--r--sysdeps/unix/sysv/linux/clock_nanosleep.c2
-rw-r--r--sysdeps/unix/sysv/linux/clock_settime.c2
-rw-r--r--sysdeps/unix/sysv/linux/close.c (renamed from sysdeps/nacl/close.c)10
-rw-r--r--sysdeps/unix/sysv/linux/close_nocancel.c28
-rw-r--r--sysdeps/unix/sysv/linux/cmsg_nxthdr.c3
-rw-r--r--sysdeps/unix/sysv/linux/configure62
-rw-r--r--sysdeps/unix/sysv/linux/configure.ac10
-rw-r--r--sysdeps/unix/sysv/linux/connect.c7
-rw-r--r--sysdeps/unix/sysv/linux/copy_file_range.c46
-rw-r--r--sysdeps/unix/sysv/linux/creat.c40
-rw-r--r--sysdeps/unix/sysv/linux/creat64.c41
-rw-r--r--sysdeps/unix/sysv/linux/createthread.c29
-rw-r--r--sysdeps/unix/sysv/linux/default-sched.h2
-rw-r--r--sysdeps/unix/sysv/linux/device-nrs.h4
-rw-r--r--sysdeps/unix/sysv/linux/dl-execstack.c10
-rw-r--r--sysdeps/unix/sysv/linux/dl-librecon.h4
-rw-r--r--sysdeps/unix/sysv/linux/dl-openat64.c6
-rw-r--r--sysdeps/unix/sysv/linux/dl-origin.c2
-rw-r--r--sysdeps/unix/sysv/linux/dl-osinfo.h2
-rw-r--r--sysdeps/unix/sysv/linux/dl-sysdep.c9
-rw-r--r--sysdeps/unix/sysv/linux/dl-sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/dl-vdso.c3
-rw-r--r--sysdeps/unix/sysv/linux/dl-vdso.h6
-rw-r--r--sysdeps/unix/sysv/linux/dl-writev.h2
-rw-r--r--sysdeps/unix/sysv/linux/epoll_pwait.c2
-rw-r--r--sysdeps/unix/sysv/linux/epoll_wait.c (renamed from sysdeps/unix/sysv/linux/generic/epoll_wait.c)10
-rw-r--r--sysdeps/unix/sysv/linux/errqueue.h16
-rw-r--r--sysdeps/unix/sysv/linux/eventfd.c51
-rw-r--r--sysdeps/unix/sysv/linux/eventfd_read.c2
-rw-r--r--sysdeps/unix/sysv/linux/eventfd_write.c2
-rw-r--r--sysdeps/unix/sysv/linux/exit-thread.h2
-rw-r--r--sysdeps/unix/sysv/linux/faccessat.c2
-rw-r--r--sysdeps/unix/sysv/linux/fallocate.c13
-rw-r--r--sysdeps/unix/sysv/linux/fallocate64.c16
-rw-r--r--sysdeps/unix/sysv/linux/fatal-prepare.h2
-rw-r--r--sysdeps/unix/sysv/linux/fchmodat.c2
-rw-r--r--sysdeps/unix/sysv/linux/fcntl.c119
-rw-r--r--sysdeps/unix/sysv/linux/fcntl64.c63
-rw-r--r--sysdeps/unix/sysv/linux/fcntl_nocancel.c65
-rw-r--r--sysdeps/unix/sysv/linux/fd_to_filename.h2
-rw-r--r--sysdeps/unix/sysv/linux/fdatasync.c (renamed from sysdeps/nacl/fdatasync.c)9
-rw-r--r--sysdeps/unix/sysv/linux/fexecve.c18
-rw-r--r--sysdeps/unix/sysv/linux/filter-nr-syscalls.awk35
-rw-r--r--sysdeps/unix/sysv/linux/fips-private.h8
-rw-r--r--sysdeps/unix/sysv/linux/fpathconf.c2
-rw-r--r--sysdeps/unix/sysv/linux/fstatfs64.c24
-rw-r--r--sysdeps/unix/sysv/linux/fstatvfs.c8
-rw-r--r--sysdeps/unix/sysv/linux/fstatvfs64.c9
-rw-r--r--sysdeps/unix/sysv/linux/fsync.c (renamed from sysdeps/nacl/fsync.c)9
-rw-r--r--sysdeps/unix/sysv/linux/ftruncate.c35
-rw-r--r--sysdeps/unix/sysv/linux/ftruncate64.c24
-rw-r--r--sysdeps/unix/sysv/linux/futex-internal.h2
-rw-r--r--sysdeps/unix/sysv/linux/futimens.c9
-rw-r--r--sysdeps/unix/sysv/linux/futimes.c2
-rw-r--r--sysdeps/unix/sysv/linux/futimesat.c3
-rw-r--r--sysdeps/unix/sysv/linux/fxstat.c6
-rw-r--r--sysdeps/unix/sysv/linux/fxstat64.c4
-rw-r--r--sysdeps/unix/sysv/linux/fxstatat.c4
-rw-r--r--sysdeps/unix/sysv/linux/fxstatat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/gai_sigqueue.c3
-rw-r--r--sysdeps/unix/sysv/linux/gen-syscall-h.awk81
-rw-r--r--sysdeps/unix/sysv/linux/generic/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/generic/____longjmp_chk.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/access.c31
-rw-r--r--sysdeps/unix/sysv/linux/generic/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/generic/bits/msq.h3
-rw-r--r--sysdeps/unix/sysv/linux/generic/bits/sem.h3
-rw-r--r--sysdeps/unix/sysv/linux/generic/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/generic/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/generic/bits/statfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/generic/bits/typesizes.h7
-rw-r--r--sysdeps/unix/sysv/linux/generic/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/chmod.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/chown.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/creat.c37
-rw-r--r--sysdeps/unix/sysv/linux/generic/dl-origin.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/dup2.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/epoll_create.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/futimesat.c3
-rw-r--r--sysdeps/unix/sysv/linux/generic/getdents.c1
-rw-r--r--sysdeps/unix/sysv/linux/generic/getdents64.c37
-rw-r--r--sysdeps/unix/sysv/linux/generic/inotify_init.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/kernel_stat.h6
-rw-r--r--sysdeps/unix/sysv/linux/generic/lchown.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/link.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/lxstat.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/mkdir.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/open.c62
-rw-r--r--sysdeps/unix/sysv/linux/generic/open64.c44
-rw-r--r--sysdeps/unix/sysv/linux/generic/pause.c39
-rw-r--r--sysdeps/unix/sysv/linux/generic/pipe.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/readlink.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/readlink_chk.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/recv.c32
-rw-r--r--sysdeps/unix/sysv/linux/generic/rename.c29
-rw-r--r--sysdeps/unix/sysv/linux/generic/rmdir.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/select.c62
-rw-r--r--sysdeps/unix/sysv/linux/generic/send.c30
-rw-r--r--sysdeps/unix/sysv/linux/generic/symlink.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/syscalls.list20
-rw-r--r--sysdeps/unix/sysv/linux/generic/sysctl.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/sysdep.h16
-rw-r--r--sysdeps/unix/sysv/linux/generic/umount.c30
-rw-r--r--sysdeps/unix/sysv/linux/generic/unlink.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/ustat.c32
-rw-r--r--sysdeps/unix/sysv/linux/generic/utimes.c3
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c86
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c5
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c31
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c32
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c36
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c37
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c115
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c46
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c38
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c15
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c40
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h2
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c37
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c37
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c34
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c38
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c38
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c36
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c35
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c37
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c38
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c5
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c31
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/truncate64.c31
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c15
-rw-r--r--sysdeps/unix/sysv/linux/generic/xmknod.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/xstat.c4
-rw-r--r--sysdeps/unix/sysv/linux/gentempfd.c35
-rw-r--r--sysdeps/unix/sysv/linux/getclktck.c2
-rw-r--r--sysdeps/unix/sysv/linux/getcwd.c14
-rw-r--r--sysdeps/unix/sysv/linux/getdents.c350
-rw-r--r--sysdeps/unix/sysv/linux/getdents64.c79
-rw-r--r--sysdeps/unix/sysv/linux/getdirentries.c23
-rw-r--r--sysdeps/unix/sysv/linux/getdirentries64.c42
-rw-r--r--sysdeps/unix/sysv/linux/getdtsz.c2
-rw-r--r--sysdeps/unix/sysv/linux/getentropy.c73
-rw-r--r--sysdeps/unix/sysv/linux/gethostid.c62
-rw-r--r--sysdeps/unix/sysv/linux/getipv4sourcefilter.c2
-rw-r--r--sysdeps/unix/sysv/linux/getloadavg.c8
-rw-r--r--sysdeps/unix/sysv/linux/getlogin.c2
-rw-r--r--sysdeps/unix/sysv/linux/getlogin_r.c51
-rw-r--r--sysdeps/unix/sysv/linux/getpagesize.c2
-rw-r--r--sysdeps/unix/sysv/linux/getpeername.c2
-rw-r--r--sysdeps/unix/sysv/linux/getpid.c64
-rw-r--r--sysdeps/unix/sysv/linux/getpriority.c2
-rw-r--r--sysdeps/unix/sysv/linux/getpt.c4
-rw-r--r--sysdeps/unix/sysv/linux/getrandom.c43
-rw-r--r--sysdeps/unix/sysv/linux/getrlimit.c56
-rw-r--r--sysdeps/unix/sysv/linux/getrlimit64.c65
-rw-r--r--sysdeps/unix/sysv/linux/getsockname.c2
-rw-r--r--sysdeps/unix/sysv/linux/getsockopt.c2
-rw-r--r--sysdeps/unix/sysv/linux/getsourcefilter.c3
-rw-r--r--sysdeps/unix/sysv/linux/getsourcefilter.h20
-rw-r--r--sysdeps/unix/sysv/linux/getsysstats.c27
-rw-r--r--sysdeps/unix/sysv/linux/gettimeofday.c2
-rw-r--r--sysdeps/unix/sysv/linux/glob-lstat-compat.c47
-rw-r--r--sysdeps/unix/sysv/linux/glob.c31
-rw-r--r--sysdeps/unix/sysv/linux/glob64-lstat-compat.c56
-rw-r--r--sysdeps/unix/sysv/linux/glob64.c51
-rw-r--r--sysdeps/unix/sysv/linux/globfree.c30
-rw-r--r--sysdeps/unix/sysv/linux/globfree64.c36
-rw-r--r--sysdeps/unix/sysv/linux/grantpt.c6
-rw-r--r--sysdeps/unix/sysv/linux/hppa/Makefile7
-rw-r--r--sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c4
-rw-r--r--sysdeps/unix/sysv/linux/hppa/arch-fork.h32
-rw-r--r--sysdeps/unix/sysv/linux/hppa/atomic-machine.h27
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/epoll.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/errno.h41
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/eventfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/inotify.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/ioctls.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/ipc.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/mman.h18
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/msq.h3
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/sem.h3
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/shm.h5
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/sigaction.h13
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/signalfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/signum.h112
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/socket_type.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/timerfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/clone.S32
-rw-r--r--sysdeps/unix/sysv/linux/hppa/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/getcontext.S16
-rw-r--r--sysdeps/unix/sysv/linux/hppa/getdents64.c1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/internaltypes.h78
-rw-r--r--sysdeps/unix/sysv/linux/hppa/ipc_priv.h21
-rw-r--r--sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/hppa/kernel-features.h25
-rw-r--r--sysdeps/unix/sysv/linux/hppa/kernel_stat.h3
-rw-r--r--sysdeps/unix/sysv/linux/hppa/ld.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libc.abilist74
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libm.abilist400
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libpthread.abilist31
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/hppa/librt.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/localplt.data24
-rw-r--r--sysdeps/unix/sysv/linux/hppa/makecontext.c2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/mmap.c49
-rw-r--r--sysdeps/unix/sysv/linux/hppa/profil-counter.h4
-rw-r--r--sysdeps/unix/sysv/linux/hppa/pt-vfork.S31
-rw-r--r--sysdeps/unix/sysv/linux/hppa/pthread.h105
-rw-r--r--sysdeps/unix/sysv/linux/hppa/pthread_cond_broadcast.c40
-rw-r--r--sysdeps/unix/sysv/linux/hppa/pthread_cond_destroy.c40
-rw-r--r--sysdeps/unix/sysv/linux/hppa/pthread_cond_init.c40
-rw-r--r--sysdeps/unix/sysv/linux/hppa/pthread_cond_signal.c40
-rw-r--r--sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c41
-rw-r--r--sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c40
-rw-r--r--sysdeps/unix/sysv/linux/hppa/setcontext.S13
-rw-r--r--sysdeps/unix/sysv/linux/hppa/swapcontext.c2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sys/ucontext.h42
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscall.c2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscalls.list24
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h279
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sysdep.c2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sysdep.h19
-rw-r--r--sysdeps/unix/sysv/linux/hppa/umount.c1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/utimes.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/Makefile29
-rw-r--r--sysdeps/unix/sysv/linux/i386/Versions2
-rw-r--r--sysdeps/unix/sysv/linux/i386/____longjmp_chk.S41
-rw-r--r--sysdeps/unix/sysv/linux/i386/_exit.S2
-rw-r--r--sysdeps/unix/sysv/linux/i386/alphasort64.c48
-rw-r--r--sysdeps/unix/sysv/linux/i386/arch-fork.h27
-rw-r--r--sysdeps/unix/sysv/linux/i386/brk.c7
-rw-r--r--sysdeps/unix/sysv/linux/i386/clone.S24
-rw-r--r--sysdeps/unix/sysv/linux/i386/configure39
-rw-r--r--sysdeps/unix/sysv/linux/i386/configure.ac17
-rw-r--r--sysdeps/unix/sysv/linux/i386/dl-librecon.h2
-rw-r--r--sysdeps/unix/sysv/linux/i386/dl-procinfo.h11
-rw-r--r--sysdeps/unix/sysv/linux/i386/dl-sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/i386/fcntl.c61
-rw-r--r--sysdeps/unix/sysv/linux/i386/fxstat.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/fxstatat.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/get_clockfreq.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/i386/getdents64.c39
-rw-r--r--sysdeps/unix/sysv/linux/i386/getmsg.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/getrlimit64.c25
-rw-r--r--sysdeps/unix/sysv/linux/i386/gettimeofday.c16
-rw-r--r--sysdeps/unix/sysv/linux/i386/glob64.c54
-rw-r--r--sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S20
-rw-r--r--sysdeps/unix/sysv/linux/i386/init-first.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/i386/kernel-features.h40
-rw-r--r--sysdeps/unix/sysv/linux/i386/ld.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/i386/ldconfig.h2
-rw-r--r--sysdeps/unix/sysv/linux/i386/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/i386/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/i386/libc-do-syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/i386/libc-lowlevellock.S2
-rw-r--r--sysdeps/unix/sysv/linux/i386/libc.abilist91
-rw-r--r--sysdeps/unix/sysv/linux/i386/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/i386/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/i386/libm.abilist673
-rw-r--r--sysdeps/unix/sysv/linux/i386/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/i386/libpthread.abilist35
-rw-r--r--sysdeps/unix/sysv/linux/i386/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/i386/librt.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/i386/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/i386/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/i386/localplt.data13
-rw-r--r--sysdeps/unix/sysv/linux/i386/lockf64.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/lowlevellock.S44
-rw-r--r--sysdeps/unix/sysv/linux/i386/lowlevellock.h78
-rw-r--r--sysdeps/unix/sysv/linux/i386/lowlevelrobustlock.S232
-rw-r--r--sysdeps/unix/sysv/linux/i386/lxstat.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/makecontext.S16
-rw-r--r--sysdeps/unix/sysv/linux/i386/mmap.c36
-rw-r--r--sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c57
-rw-r--r--sysdeps/unix/sysv/linux/i386/posix_fadvise64.S92
-rw-r--r--sysdeps/unix/sysv/linux/i386/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S241
-rw-r--r--sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S216
-rw-r--r--sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S973
-rw-r--r--sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S641
-rw-r--r--sysdeps/unix/sysv/linux/i386/putmsg.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/readdir64.c43
-rw-r--r--sysdeps/unix/sysv/linux/i386/readdir64_r.c43
-rw-r--r--sysdeps/unix/sysv/linux/i386/readelflib.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/register-dump.h2
-rw-r--r--sysdeps/unix/sysv/linux/i386/scandir64.c136
-rw-r--r--sysdeps/unix/sysv/linux/i386/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/i386/setegid.c35
-rw-r--r--sysdeps/unix/sysv/linux/i386/seteuid.c35
-rw-r--r--sysdeps/unix/sysv/linux/i386/setgid.c34
-rw-r--r--sysdeps/unix/sysv/linux/i386/setgroups.c37
-rw-r--r--sysdeps/unix/sysv/linux/i386/setregid.c34
-rw-r--r--sysdeps/unix/sysv/linux/i386/setresgid.c36
-rw-r--r--sysdeps/unix/sysv/linux/i386/setresuid.c36
-rw-r--r--sysdeps/unix/sysv/linux/i386/setreuid.c35
-rw-r--r--sysdeps/unix/sysv/linux/i386/setuid.c35
-rw-r--r--sysdeps/unix/sysv/linux/i386/sigaction.c80
-rw-r--r--sysdeps/unix/sysv/linux/i386/sigcontextinfo.h32
-rw-r--r--sysdeps/unix/sysv/linux/i386/smp.h10
-rw-r--r--sysdeps/unix/sysv/linux/i386/startup.h36
-rw-r--r--sysdeps/unix/sysv/linux/i386/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/i386/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/i386/syscalls.list3
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep-cancel.h153
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.h34
-rw-r--r--sysdeps/unix/sysv/linux/i386/time.c16
-rw-r--r--sysdeps/unix/sysv/linux/i386/tst-bz21269.c235
-rw-r--r--sysdeps/unix/sysv/linux/i386/versionsort64.c48
-rw-r--r--sysdeps/unix/sysv/linux/i386/vfork.S78
-rw-r--r--sysdeps/unix/sysv/linux/i386/xstat.c6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/Versions3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/__longjmp.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/__start_context.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/arch-fork.h31
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/ipc.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/local_lim.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/msq.h3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/sem.h3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/setjmp.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/sigaction.h13
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h11
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/siginfo-arch.h17
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/siginfo-consts-arch.h45
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/siginfo.h360
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/sigstack.h38
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/brk.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/clone2.S28
-rw-r--r--sysdeps/unix/sysv/linux/ia64/configure4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/configure.ac4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/dl-cache.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/dl-static.c2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/dl-sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/get_clockfreq.c3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/has_cpuclock.c8
-rw-r--r--sysdeps/unix/sysv/linux/ia64/ioperm.c2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/ipc_priv.h21
-rw-r--r--sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/kernel-features.h23
-rw-r--r--sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h7
-rw-r--r--sysdeps/unix/sysv/linux/ia64/kernel_stat.h3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/ld.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/ldconfig.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/ldsodefs.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libc.abilist84
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libm.abilist672
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libpthread.abilist31
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/librt.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/ia64/localplt.data11
-rw-r--r--sysdeps/unix/sysv/linux/ia64/makecontext.c4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/mmap_internal.h29
-rw-r--r--sysdeps/unix/sysv/linux/ia64/pipe.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/pt-vfork.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/readelflib.c2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/register-dump.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/setjmp.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sigaction.c45
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym24
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h8
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sigpending.c36
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sigprocmask.c3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/swapcontext.c2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sys/io.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sys/procfs.h5
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sys/ptrace.h77
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sys/rse.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sys/ucontext.h63
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sys/user.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/syscalls.list22
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sysconf.c2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h223
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sysdep.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/system.c2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/tst-setcontext2.c24
-rw-r--r--sysdeps/unix/sysv/linux/ia64/tst-setcontext4.c26
-rw-r--r--sysdeps/unix/sysv/linux/ia64/ucontext_i.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/umount.c29
-rw-r--r--sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/vfork.S22
-rw-r--r--sysdeps/unix/sysv/linux/ia64/wordexp.c2
-rw-r--r--sysdeps/unix/sysv/linux/if_index.c14
-rw-r--r--sysdeps/unix/sysv/linux/ifaddrs.c26
-rw-r--r--sysdeps/unix/sysv/linux/ifreq.c2
-rw-r--r--sysdeps/unix/sysv/linux/include/bits/syscall.h3
-rw-r--r--sysdeps/unix/sysv/linux/include/sys/sysinfo.h7
-rw-r--r--sysdeps/unix/sysv/linux/include/sys/timex.h5
-rw-r--r--sysdeps/unix/sysv/linux/internal-signals.h91
-rw-r--r--sysdeps/unix/sysv/linux/internal_statvfs.c199
-rw-r--r--sysdeps/unix/sysv/linux/internal_statvfs.h26
-rw-r--r--sysdeps/unix/sysv/linux/ipc_ops.h30
-rw-r--r--sysdeps/unix/sysv/linux/ipc_priv.h23
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h148
-rw-r--r--sysdeps/unix/sysv/linux/kernel-posix-timers.h2
-rw-r--r--sysdeps/unix/sysv/linux/kernel_sigaction.h31
-rw-r--r--sysdeps/unix/sysv/linux/kernel_stat.h3
-rw-r--r--sysdeps/unix/sysv/linux/kernel_termios.h2
-rw-r--r--sysdeps/unix/sysv/linux/lddlibc4.c4
-rw-r--r--sysdeps/unix/sysv/linux/ldsodefs.h8
-rw-r--r--sysdeps/unix/sysv/linux/libc_fatal.c12
-rw-r--r--sysdeps/unix/sysv/linux/linux_fsinfo.h2
-rw-r--r--sysdeps/unix/sysv/linux/listen.c2
-rw-r--r--sysdeps/unix/sysv/linux/llseek.c46
-rw-r--r--sysdeps/unix/sysv/linux/lowlevellock-futex.h21
-rw-r--r--sysdeps/unix/sysv/linux/lseek.c57
-rw-r--r--sysdeps/unix/sysv/linux/lseek64.c54
-rw-r--r--sysdeps/unix/sysv/linux/lutimes.c10
-rw-r--r--sysdeps/unix/sysv/linux/lxstat.c6
-rw-r--r--sysdeps/unix/sysv/linux/lxstat64.c4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/Makefile9
-rw-r--r--sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/alphasort64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/arch-fork.h28
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/poll.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/sockaddr.h42
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/clone.S29
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h5
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/fpu/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist63
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libdl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist399
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libnsl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist25
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libresolv.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libthread_db.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/localplt.data18
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/nofpu/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/dl-static.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getdents64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getpagesize.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getsysstats.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/glob64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/init-first.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/kernel-features.h33
-rw-r--r--sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h22
-rw-r--r--sysdeps/unix/sysv/linux/m68k/ldsodefs.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/localplt.data16
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist79
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist404
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist35
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/localplt.data19
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/makecontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m68k-helpers.S2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m68k-vdso.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m68k-vdso.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/mmap.S42
-rw-r--r--sysdeps/unix/sysv/linux/m68k/mmap64.c5
-rw-r--r--sysdeps/unix/sysv/linux/m68k/mmap_internal.h29
-rw-r--r--sysdeps/unix/sysv/linux/m68k/mremap.S3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/readdir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/readdir64_r.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/register-dump.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/scandir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/semtimedop.S69
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setegid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/seteuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setgroups.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setregid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setresgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setresuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setreuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h7
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sys/reg.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sys/ucontext.h94
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sys/user.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h138
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep.S2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/versionsort64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/vfork.S22
-rw-r--r--sysdeps/unix/sysv/linux/makedev.c40
-rw-r--r--sysdeps/unix/sysv/linux/malloc-sysdep.h10
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/Makefile3
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/____longjmp_chk.S2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/arch-fork.h27
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/clock-compat.c31
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/clone.S3
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/futimesat.c30
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/getsysstats.c2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/kernel-features.h58
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/kernel_stat.h5
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/ld.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libc.abilist49
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libdl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libm.abilist397
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libnsl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libpthread.abilist22
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libresolv.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/librt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libthread_db.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/localplt.data15
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/mmap.S50
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/msgctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/pt-vfork.S50
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/semctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/setgroups.c1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/shmctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/sigcontextinfo.h9
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h92
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/sys/user.h2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/syscalls.list12
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h158
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/sysdep.S2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/sysdep.h46
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/vfork.S3
-rw-r--r--sysdeps/unix/sysv/linux/mips/Makefile44
-rw-r--r--sysdeps/unix/sysv/linux/mips/Versions4
-rw-r--r--sysdeps/unix/sysv/linux/mips/____longjmp_chk.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/_test_and_set.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/arch-fork.h1
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/epoll.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/errno.h43
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/eventfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/inotify.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/ipc.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/local_lim.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/msq.h3
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/poll.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/resource.h49
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sem.h3
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sigaction.h13
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sigcontext.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/siginfo-arch.h13
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/siginfo.h344
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/signalfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/signum.h96
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sigstack.h54
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/socket_type.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/statfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/termios.h4
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/timerfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/types/stack_t.h33
-rw-r--r--sysdeps/unix/sysv/linux/mips/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/clone.S31
-rw-r--r--sysdeps/unix/sysv/linux/mips/configure8
-rw-r--r--sysdeps/unix/sysv/linux/mips/dl-cache.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/dl-static.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/getcontext.S39
-rw-r--r--sysdeps/unix/sysv/linux/mips/getrlimit64.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/getsysstats.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/init-first.c44
-rw-r--r--sysdeps/unix/sysv/linux/mips/ipc_priv.h1
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel-features.h45
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel_sigaction.h48
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel_stat.h3
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel_termios.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/ldsodefs.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/libc-abis2
-rw-r--r--sysdeps/unix/sysv/linux/mips/libc-vdso.h33
-rw-r--r--sysdeps/unix/sysv/linux/mips/makecontext.S36
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/Makefile12
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/Versions3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/accept4.c30
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/bug-getcontext-mips-gp.c63
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist77
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/ftruncate64.c36
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/ld.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libBrokenLocale.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libcidn.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libcrypt.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libdl.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libm.abilist402
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libnss_compat.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libnss_db.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libnss_dns.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libnss_files.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libnss_hesiod.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libnss_nis.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libnss_nisplus.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist33
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libresolv.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/librt.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libthread_db.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips-syscall5.S35
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips-syscall6.S35
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips-syscall7.S35
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h46
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c33
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c33
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c33
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/mmap.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist77
-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/readahead.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c29
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c29
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c33
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/sysdep.h181
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/truncate64.c35
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/Makefile10
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/ftruncate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/getdents64.c112
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h32
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libm.abilist638
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libnsl.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist32
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/librt.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/llseek.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/msgctl.c19
-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/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist86
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/lseek.c36
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/mmap.c35
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/mmap_internal.h28
-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.list7
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h19
-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/glob64.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist84
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/mmap64.c1
-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.c36
-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/preadv64.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h19
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/recv.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/semctl.c40
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/send.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/shmctl.c19
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/syscalls.list18
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h249
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/truncate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/umount.c30
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/xstat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/pread.c54
-rw-r--r--sysdeps/unix/sysv/linux/mips/pread64.c50
-rw-r--r--sysdeps/unix/sysv/linux/mips/pwrite.c54
-rw-r--r--sysdeps/unix/sysv/linux/mips/pwrite64.c51
-rw-r--r--sysdeps/unix/sysv/linux/mips/readelflib.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/register-dump.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/setcontext.S53
-rw-r--r--sysdeps/unix/sysv/linux/mips/setrlimit64.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/sigaction.c116
-rw-r--r--sysdeps/unix/sysv/linux/mips/sigcontextinfo.h12
-rw-r--r--sysdeps/unix/sysv/linux/mips/swapcontext.S81
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/cachectl.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/sysmips.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/ucontext.h110
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/user.h3
-rw-r--r--sysdeps/unix/sysv/linux/mips/syscalls.list8
-rw-r--r--sysdeps/unix/sysv/linux/mips/sysdep-cancel.h190
-rw-r--r--sysdeps/unix/sysv/linux/mips/ustat.c23
-rw-r--r--sysdeps/unix/sysv/linux/mips/vfork.S35
-rw-r--r--sysdeps/unix/sysv/linux/mips/xstatconv.c4
-rw-r--r--sysdeps/unix/sysv/linux/mlock2.c40
-rw-r--r--sysdeps/unix/sysv/linux/mmap.c52
-rw-r--r--sysdeps/unix/sysv/linux/mmap64.c59
-rw-r--r--sysdeps/unix/sysv/linux/mmap_internal.h49
-rw-r--r--sysdeps/unix/sysv/linux/mq_close.c2
-rw-r--r--sysdeps/unix/sysv/linux/mq_getattr.c2
-rw-r--r--sysdeps/unix/sysv/linux/mq_notify.c4
-rw-r--r--sysdeps/unix/sysv/linux/mq_open.c2
-rw-r--r--sysdeps/unix/sysv/linux/mq_receive.c2
-rw-r--r--sysdeps/unix/sysv/linux/mq_send.c2
-rw-r--r--sysdeps/unix/sysv/linux/mq_timedreceive.c34
-rw-r--r--sysdeps/unix/sysv/linux/mq_timedsend.c33
-rw-r--r--sysdeps/unix/sysv/linux/mq_unlink.c2
-rw-r--r--sysdeps/unix/sysv/linux/msgctl.c47
-rw-r--r--sysdeps/unix/sysv/linux/msgget.c13
-rw-r--r--sysdeps/unix/sysv/linux/msgrcv.c28
-rw-r--r--sysdeps/unix/sysv/linux/msgsnd.c11
-rw-r--r--sysdeps/unix/sysv/linux/msync.c26
-rw-r--r--sysdeps/unix/sysv/linux/nanosleep.c31
-rw-r--r--sysdeps/unix/sysv/linux/nanosleep_nocancel.c29
-rw-r--r--sysdeps/unix/sysv/linux/net/ethernet.h13
-rw-r--r--sysdeps/unix/sysv/linux/net/if_arp.h8
-rw-r--r--sysdeps/unix/sysv/linux/net/if_packet.h2
-rw-r--r--sysdeps/unix/sysv/linux/net/if_ppp.h12
-rw-r--r--sysdeps/unix/sysv/linux/net/if_shaper.h8
-rw-r--r--sysdeps/unix/sysv/linux/net/if_slip.h2
-rw-r--r--sysdeps/unix/sysv/linux/net/ppp_defs.h4
-rw-r--r--sysdeps/unix/sysv/linux/net/route.h14
-rw-r--r--sysdeps/unix/sysv/linux/netash/ash.h2
-rw-r--r--sysdeps/unix/sysv/linux/netatalk/at.h2
-rw-r--r--sysdeps/unix/sysv/linux/netax25/ax25.h2
-rw-r--r--sysdeps/unix/sysv/linux/neteconet/ec.h2
-rw-r--r--sysdeps/unix/sysv/linux/netinet/if_ether.h18
-rw-r--r--sysdeps/unix/sysv/linux/netinet/if_fddi.h12
-rw-r--r--sysdeps/unix/sysv/linux/netinet/if_tr.h38
-rw-r--r--sysdeps/unix/sysv/linux/netipx/ipx.h11
-rw-r--r--sysdeps/unix/sysv/linux/netiucv/iucv.h12
-rw-r--r--sysdeps/unix/sysv/linux/netlink_assert_response.c3
-rw-r--r--sysdeps/unix/sysv/linux/netlinkaccess.h15
-rw-r--r--sysdeps/unix/sysv/linux/netpacket/packet.h2
-rw-r--r--sysdeps/unix/sysv/linux/netrom/netrom.h2
-rw-r--r--sysdeps/unix/sysv/linux/netrose/rose.h5
-rw-r--r--sysdeps/unix/sysv/linux/nios2/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/nios2/arch-fork.h33
-rw-r--r--sysdeps/unix/sysv/linux/nios2/atomic-machine.h5
-rw-r--r--sysdeps/unix/sysv/linux/nios2/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/nios2/cacheflush.c2
-rw-r--r--sysdeps/unix/sysv/linux/nios2/clone.S33
-rw-r--r--sysdeps/unix/sysv/linux/nios2/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/nios2/ipc_priv.h21
-rw-r--r--sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/nios2/kernel-features.h31
-rw-r--r--sysdeps/unix/sysv/linux/nios2/kernel_rt_sigframe.h4
-rw-r--r--sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h8
-rw-r--r--sysdeps/unix/sysv/linux/nios2/ld.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libc.abilist49
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libdl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libm.abilist397
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libnsl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libpthread.abilist22
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libresolv.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/librt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libthread_db.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/localplt.data21
-rw-r--r--sysdeps/unix/sysv/linux/nios2/makecontext.c2
-rw-r--r--sysdeps/unix/sysv/linux/nios2/pt-vfork.S1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/setcontext.S14
-rw-r--r--sysdeps/unix/sysv/linux/nios2/sigcontextinfo.h4
-rw-r--r--sysdeps/unix/sysv/linux/nios2/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/nios2/sys/cachectl.h5
-rw-r--r--sysdeps/unix/sysv/linux/nios2/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/nios2/sys/ucontext.h35
-rw-r--r--sysdeps/unix/sysv/linux/nios2/sys/user.h2
-rw-r--r--sysdeps/unix/sysv/linux/nios2/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h141
-rw-r--r--sysdeps/unix/sysv/linux/nios2/sysdep.S2
-rw-r--r--sysdeps/unix/sysv/linux/nios2/sysdep.h6
-rw-r--r--sysdeps/unix/sysv/linux/nios2/vfork.S12
-rw-r--r--sysdeps/unix/sysv/linux/not-cancel.h122
-rw-r--r--sysdeps/unix/sysv/linux/not-errno.h35
-rw-r--r--sysdeps/unix/sysv/linux/nptl-signals.h33
-rw-r--r--sysdeps/unix/sysv/linux/nscd_setup_thread.c2
-rw-r--r--sysdeps/unix/sysv/linux/ntp_gettime.c2
-rw-r--r--sysdeps/unix/sysv/linux/ntp_gettimex.c2
-rw-r--r--sysdeps/unix/sysv/linux/olddirent.h (renamed from sysdeps/unix/sysv/linux/i386/olddirent.h)5
-rw-r--r--sysdeps/unix/sysv/linux/oldglob.c46
-rw-r--r--sysdeps/unix/sysv/linux/open.c51
-rw-r--r--sysdeps/unix/sysv/linux/open64.c28
-rw-r--r--sysdeps/unix/sysv/linux/open64_nocancel.c54
-rw-r--r--sysdeps/unix/sysv/linux/open_by_handle_at.c37
-rw-r--r--sysdeps/unix/sysv/linux/open_nocancel.c46
-rw-r--r--sysdeps/unix/sysv/linux/openat.c33
-rw-r--r--sysdeps/unix/sysv/linux/openat64.c58
-rw-r--r--sysdeps/unix/sysv/linux/openat64_nocancel.c51
-rw-r--r--sysdeps/unix/sysv/linux/openat_nocancel.c43
-rw-r--r--sysdeps/unix/sysv/linux/opendir.c20
-rw-r--r--sysdeps/unix/sysv/linux/opensock.c4
-rw-r--r--sysdeps/unix/sysv/linux/pathconf.c4
-rw-r--r--sysdeps/unix/sysv/linux/pathconf.h14
-rw-r--r--sysdeps/unix/sysv/linux/pause.c34
-rw-r--r--sysdeps/unix/sysv/linux/pause_nocancel.c33
-rw-r--r--sysdeps/unix/sysv/linux/personality.c2
-rw-r--r--sysdeps/unix/sysv/linux/pkey_get.c26
-rw-r--r--sysdeps/unix/sysv/linux/pkey_mprotect.c37
-rw-r--r--sysdeps/unix/sysv/linux/pkey_set.c26
-rw-r--r--sysdeps/unix/sysv/linux/poll.c (renamed from sysdeps/unix/sysv/linux/generic/poll.c)8
-rw-r--r--sysdeps/unix/sysv/linux/posix_fadvise.c50
-rw-r--r--sysdeps/unix/sysv/linux/posix_fadvise64.c47
-rw-r--r--sysdeps/unix/sysv/linux/posix_fallocate.c8
-rw-r--r--sysdeps/unix/sysv/linux/posix_fallocate64.c18
-rw-r--r--sysdeps/unix/sysv/linux/posix_madvise.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/arch-fork.h1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/environments.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/ipc.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/msq.h3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/ppc.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h236
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/sem.h3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h34
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/termios.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h14
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/dl-static.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/elision-conf.c77
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/elision-conf.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/elision-lock.c14
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/elision-timed.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/elision-trylock.c11
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/elision-unlock.c21
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/force-elision.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/getdents64.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/gettimeofday.c62
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/htm.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/init-first.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/ioctl.c9
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/ipc_priv.h23
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/kernel-features.h60
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h9
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/kernel_termios.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/ldconfig.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/ldsodefs.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/libc-start.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/libc-start.h30
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/libc-vdso.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/lowlevellock.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/not-errno.h30
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile13
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/____longjmp_chk.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/alphasort64.c3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S21
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/nofpu/Implies1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist80
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist409
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data11
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c36
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist36
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/context-e500.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist80
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist409
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data11
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise.c39
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c55
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c34
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c35
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c35
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c36
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/scandir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h118
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h20
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c34
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/versionsort64.c3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S28
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/970/Implies2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/a2/Implies2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/970/Implies2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/a2/Implies2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/cell/Implies2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/cell/fpu/Implies1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/cell/Implies2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/cell/fpu/Implies1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S25
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/configure28
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/dl-cache.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c65
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/Implies1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/float128-abi.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/fpu/Implies1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale-le.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl-le.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist61
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist66
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt-le.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl-le.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist674
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist407
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl-le.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist23
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist30
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv-le.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/librt-le.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db-le.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil-le.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data11
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S28
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c30
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h147
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h29
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/umount.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S25
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/pthread_mutex_cond_lock.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/pthread_mutex_lock.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/pthread_mutex_timedlock.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/pthread_mutex_trylock.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/readdir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/readdir64_r.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/readelflib.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sys/procfs.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h182
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h105
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sys/user.h3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/syscalls.list3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sysconf.c75
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sysdep.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/test-powerpc-linux-sysconf.c73
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/time.c69
-rw-r--r--sysdeps/unix/sysv/linux/ppoll.c31
-rw-r--r--sysdeps/unix/sysv/linux/pread.c27
-rw-r--r--sysdeps/unix/sysv/linux/pread64.c25
-rw-r--r--sysdeps/unix/sysv/linux/preadv.c78
-rw-r--r--sysdeps/unix/sysv/linux/preadv2.c58
-rw-r--r--sysdeps/unix/sysv/linux/preadv64.c60
-rw-r--r--sysdeps/unix/sysv/linux/preadv64v2.c59
-rw-r--r--sysdeps/unix/sysv/linux/prlimit.c27
-rw-r--r--sysdeps/unix/sysv/linux/prof-freq.c2
-rw-r--r--sysdeps/unix/sysv/linux/pselect.c2
-rw-r--r--sysdeps/unix/sysv/linux/pt-raise.c23
-rw-r--r--sysdeps/unix/sysv/linux/pthread-pids.h4
-rw-r--r--sysdeps/unix/sysv/linux/pthread_getaffinity.c2
-rw-r--r--sysdeps/unix/sysv/linux/pthread_getcpuclockid.c2
-rw-r--r--sysdeps/unix/sysv/linux/pthread_getname.c8
-rw-r--r--sysdeps/unix/sysv/linux/pthread_kill.c13
-rw-r--r--sysdeps/unix/sysv/linux/pthread_setaffinity.c2
-rw-r--r--sysdeps/unix/sysv/linux/pthread_setname.c8
-rw-r--r--sysdeps/unix/sysv/linux/pthread_sigmask.c2
-rw-r--r--sysdeps/unix/sysv/linux/pthread_sigqueue.c17
-rw-r--r--sysdeps/unix/sysv/linux/ptrace.c2
-rw-r--r--sysdeps/unix/sysv/linux/ptsname.c28
-rw-r--r--sysdeps/unix/sysv/linux/pwrite.c27
-rw-r--r--sysdeps/unix/sysv/linux/pwrite64.c25
-rw-r--r--sysdeps/unix/sysv/linux/pwritev.c78
-rw-r--r--sysdeps/unix/sysv/linux/pwritev2.c54
-rw-r--r--sysdeps/unix/sysv/linux/pwritev64.c60
-rw-r--r--sysdeps/unix/sysv/linux/pwritev64v2.c58
-rw-r--r--sysdeps/unix/sysv/linux/raise.c58
-rw-r--r--sysdeps/unix/sysv/linux/read.c (renamed from sysdeps/nacl/read.c)13
-rw-r--r--sysdeps/unix/sysv/linux/read_nocancel.c28
-rw-r--r--sysdeps/unix/sysv/linux/readahead.c26
-rw-r--r--sysdeps/unix/sysv/linux/readdir.c23
-rw-r--r--sysdeps/unix/sysv/linux/readdir64.c52
-rw-r--r--sysdeps/unix/sysv/linux/readdir64_r.c48
-rw-r--r--sysdeps/unix/sysv/linux/readdir_r.c23
-rw-r--r--sysdeps/unix/sysv/linux/readonly-area.c4
-rw-r--r--sysdeps/unix/sysv/linux/readv.c29
-rw-r--r--sysdeps/unix/sysv/linux/reboot.c2
-rw-r--r--sysdeps/unix/sysv/linux/recv.c9
-rw-r--r--sysdeps/unix/sysv/linux/recvfrom.c7
-rw-r--r--sysdeps/unix/sysv/linux/recvmmsg.c67
-rw-r--r--sysdeps/unix/sysv/linux/recvmsg.c15
-rw-r--r--sysdeps/unix/sysv/linux/rename.c35
-rw-r--r--sysdeps/unix/sysv/linux/renameat.c34
-rw-r--r--sysdeps/unix/sysv/linux/renameat2.c44
-rw-r--r--sysdeps/unix/sysv/linux/riscv/Implies1
-rw-r--r--sysdeps/unix/sysv/linux/riscv/Makefile25
-rw-r--r--sysdeps/unix/sysv/linux/riscv/Versions11
-rw-r--r--sysdeps/unix/sysv/linux/riscv/atomic-machine.h194
-rw-r--r--sysdeps/unix/sysv/linux/riscv/bits/fcntl.h62
-rw-r--r--sysdeps/unix/sysv/linux/riscv/bits/mman.h40
-rw-r--r--sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h32
-rw-r--r--sysdeps/unix/sysv/linux/riscv/clone.S86
-rwxr-xr-xsysdeps/unix/sysv/linux/riscv/configure219
-rw-r--r--sysdeps/unix/sysv/linux/riscv/configure.ac38
-rw-r--r--sysdeps/unix/sysv/linux/riscv/dl-cache.h75
-rw-r--r--sysdeps/unix/sysv/linux/riscv/dl-static.c (renamed from sysdeps/unix/sysv/linux/tile/dl-static.c)6
-rw-r--r--sysdeps/unix/sysv/linux/riscv/flush-icache.c73
-rw-r--r--sysdeps/unix/sysv/linux/riscv/getcontext.S77
-rw-r--r--sysdeps/unix/sysv/linux/riscv/init-first.c58
-rw-r--r--sysdeps/unix/sysv/linux/riscv/ipc_priv.h21
-rw-r--r--sysdeps/unix/sysv/linux/riscv/kernel-features.h23
-rw-r--r--sysdeps/unix/sysv/linux/riscv/ldconfig.h36
-rw-r--r--sysdeps/unix/sysv/linux/riscv/ldd-rewrite.sed1
-rw-r--r--sysdeps/unix/sysv/linux/riscv/ldsodefs.h32
-rw-r--r--sysdeps/unix/sysv/linux/riscv/libc-vdso.h38
-rw-r--r--sysdeps/unix/sysv/linux/riscv/localplt.data19
-rw-r--r--sysdeps/unix/sysv/linux/riscv/makecontext.c78
-rw-r--r--sysdeps/unix/sysv/linux/riscv/profil-counter.h31
-rw-r--r--sysdeps/unix/sysv/linux/riscv/pt-vfork.S1
-rw-r--r--sysdeps/unix/sysv/linux/riscv/readelflib.c97
-rw-r--r--sysdeps/unix/sysv/linux/riscv/register-dump.h63
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/Implies3
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/c++-types.data (renamed from sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/c++-types.data)0
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h53
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist9
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libanl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist2102
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libcrypt.abilist7
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libdl.abilist9
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist1021
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libnsl.abilist120
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist237
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libresolv.abilist79
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/librt.abilist35
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libthread_db.abilist40
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/riscv/setcontext.S114
-rw-r--r--sysdeps/unix/sysv/linux/riscv/shlib-versions9
-rw-r--r--sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h22
-rw-r--r--sysdeps/unix/sysv/linux/riscv/swapcontext.S125
-rw-r--r--sysdeps/unix/sysv/linux/riscv/sys/cachectl.h32
-rw-r--r--sysdeps/unix/sysv/linux/riscv/sys/procfs.h114
-rw-r--r--sysdeps/unix/sysv/linux/riscv/sys/ucontext.h110
-rw-r--r--sysdeps/unix/sysv/linux/riscv/sys/user.h23
-rw-r--r--sysdeps/unix/sysv/linux/riscv/syscall.c35
-rw-r--r--sysdeps/unix/sysv/linux/riscv/sysdep.S51
-rw-r--r--sysdeps/unix/sysv/linux/riscv/sysdep.h325
-rw-r--r--sysdeps/unix/sysv/linux/riscv/ucontext-macros.h49
-rw-r--r--sysdeps/unix/sysv/linux/riscv/ucontext_i.sym31
-rw-r--r--sysdeps/unix/sysv/linux/riscv/vfork.S44
-rw-r--r--sysdeps/unix/sysv/linux/s390/Makefile9
-rw-r--r--sysdeps/unix/sysv/linux/s390/arch-fork.h29
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/elfclass.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/environments.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/hwcap.h5
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/ipc.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/msq.h3
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/sem.h3
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/sigaction.h15
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/siginfo.h341
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/statfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/typesizes.h7
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/utmp.h11
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/utmpx.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/dl-procinfo.h5
-rw-r--r--sysdeps/unix/sysv/linux/s390/elision-conf.c74
-rw-r--r--sysdeps/unix/sysv/linux/s390/elision-conf.h4
-rw-r--r--sysdeps/unix/sysv/linux/s390/elision-lock.c100
-rw-r--r--sysdeps/unix/sysv/linux/s390/elision-timed.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/elision-trylock.c79
-rw-r--r--sysdeps/unix/sysv/linux/s390/elision-unlock.c41
-rw-r--r--sysdeps/unix/sysv/linux/s390/force-elision.h4
-rw-r--r--sysdeps/unix/sysv/linux/s390/fpu/s_fma.c5
-rw-r--r--sysdeps/unix/sysv/linux/s390/htm.h187
-rw-r--r--sysdeps/unix/sysv/linux/s390/init-first.c8
-rw-r--r--sysdeps/unix/sysv/linux/s390/jmp-unwind.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/kernel-features.h32
-rw-r--r--sysdeps/unix/sysv/linux/s390/kernel_sigaction.h32
-rw-r--r--sysdeps/unix/sysv/linux/s390/ldconfig.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/s390/libc-vdso.h4
-rw-r--r--sysdeps/unix/sysv/linux/s390/localplt.data11
-rw-r--r--sysdeps/unix/sysv/linux/s390/longjmp_chk.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/lowlevellock.h8
-rw-r--r--sysdeps/unix/sysv/linux/s390/mmap_internal.h32
-rw-r--r--sysdeps/unix/sysv/linux/s390/pt-longjmp.c6
-rw-r--r--sysdeps/unix/sysv/linux/s390/pthread_mutex_cond_lock.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/pthread_mutex_lock.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/pthread_mutex_timedlock.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/pthread_mutex_trylock.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/readelflib.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/Makefile12
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S43
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/alphasort64.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/clone.S18
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getdents64.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getutent.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getutid.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getutline.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/glob64-lstat-compat.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist90
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist643
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist36
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libutil.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/login.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/login32.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/mmap.S74
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S81
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/oldglob.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/scandir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setegid.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/seteuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setgroups.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setregid.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setresgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setresuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setreuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setuid.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/syscall.S14
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h139
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h39
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/versionsort64.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/vfork.S14
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S12
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/clone.S20
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/configure4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/dl-cache.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist84
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libdl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist641
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libnsl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist32
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libresolv.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/mmap.S78
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c43
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c36
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/syscall.S14
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list14
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h152
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h39
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/vfork.S15
-rw-r--r--sysdeps/unix/sysv/linux/s390/semtimedop.c14
-rw-r--r--sysdeps/unix/sysv/linux/s390/sigcontextinfo.h7
-rw-r--r--sysdeps/unix/sysv/linux/s390/sys/elf.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/sys/ptrace.h175
-rw-r--r--sysdeps/unix/sysv/linux/s390/sys/ucontext.h60
-rw-r--r--sysdeps/unix/sysv/linux/s390/sys/user.h2
-rw-r--r--sysdeps/unix/sysv/linux/s390/sysconf.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/system.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c178
-rw-r--r--sysdeps/unix/sysv/linux/safe-fatal.h2
-rw-r--r--sysdeps/unix/sysv/linux/scandir64.c139
-rw-r--r--sysdeps/unix/sysv/linux/sched_getaffinity.c2
-rw-r--r--sysdeps/unix/sysv/linux/sched_getcpu.c2
-rw-r--r--sysdeps/unix/sysv/linux/sched_setaffinity.c6
-rw-r--r--sysdeps/unix/sysv/linux/scsi/scsi.h2
-rw-r--r--sysdeps/unix/sysv/linux/scsi/scsi_ioctl.h2
-rw-r--r--sysdeps/unix/sysv/linux/scsi/sg.h2
-rw-r--r--sysdeps/unix/sysv/linux/select.c71
-rw-r--r--sysdeps/unix/sysv/linux/semctl.c73
-rw-r--r--sysdeps/unix/sysv/linux/semget.c13
-rw-r--r--sysdeps/unix/sysv/linux/semop.c12
-rw-r--r--sysdeps/unix/sysv/linux/semtimedop.c15
-rw-r--r--sysdeps/unix/sysv/linux/send.c11
-rw-r--r--sysdeps/unix/sysv/linux/sendmmsg.c66
-rw-r--r--sysdeps/unix/sysv/linux/sendmsg.c15
-rw-r--r--sysdeps/unix/sysv/linux/sendto.c7
-rw-r--r--sysdeps/unix/sysv/linux/setegid.c7
-rw-r--r--sysdeps/unix/sysv/linux/seteuid.c7
-rw-r--r--sysdeps/unix/sysv/linux/setgid.c6
-rw-r--r--sysdeps/unix/sysv/linux/setgroups.c7
-rw-r--r--sysdeps/unix/sysv/linux/setipv4sourcefilter.c2
-rw-r--r--sysdeps/unix/sysv/linux/setregid.c6
-rw-r--r--sysdeps/unix/sysv/linux/setresgid.c6
-rw-r--r--sysdeps/unix/sysv/linux/setresuid.c6
-rw-r--r--sysdeps/unix/sysv/linux/setreuid.c6
-rw-r--r--sysdeps/unix/sysv/linux/setrlimit.c60
-rw-r--r--sysdeps/unix/sysv/linux/setrlimit64.c53
-rw-r--r--sysdeps/unix/sysv/linux/setsockopt.c2
-rw-r--r--sysdeps/unix/sysv/linux/setsourcefilter.c7
-rw-r--r--sysdeps/unix/sysv/linux/setuid.c6
-rw-r--r--sysdeps/unix/sysv/linux/sh/____longjmp_chk.S2
-rw-r--r--sysdeps/unix/sysv/linux/sh/arch-fork.h28
-rw-r--r--sysdeps/unix/sysv/linux/sh/atomic-machine.h5
-rw-r--r--sysdeps/unix/sysv/linux/sh/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/sh/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/sh/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/sh/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/sh/clone.S51
-rw-r--r--sysdeps/unix/sysv/linux/sh/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/sh/kernel-features.h72
-rw-r--r--sysdeps/unix/sysv/linux/sh/kernel_sigaction.h8
-rw-r--r--sysdeps/unix/sysv/linux/sh/ld.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sh/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sh/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sh/libc.abilist74
-rw-r--r--sysdeps/unix/sysv/linux/sh/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sh/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sh/libm.abilist400
-rw-r--r--sysdeps/unix/sysv/linux/sh/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sh/libpthread.abilist31
-rw-r--r--sysdeps/unix/sysv/linux/sh/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sh/librt.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/sh/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sh/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sh/localplt.data25
-rw-r--r--sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h2
-rw-r--r--sysdeps/unix/sysv/linux/sh/makecontext.S4
-rw-r--r--sysdeps/unix/sysv/linux/sh/pipe.S2
-rw-r--r--sysdeps/unix/sysv/linux/sh/pread.c43
-rw-r--r--sysdeps/unix/sysv/linux/sh/pread64.c43
-rw-r--r--sysdeps/unix/sysv/linux/sh/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/sh/pwrite.c43
-rw-r--r--sysdeps/unix/sysv/linux/sh/pwrite64.c44
-rw-r--r--sysdeps/unix/sysv/linux/sh/setegid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/seteuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/setgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/setgroups.c2
-rw-r--r--sysdeps/unix/sysv/linux/sh/setregid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/setresgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/setresuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/setreuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/setuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/register-dump.h2
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym32
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/register-dump.h4
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym32
-rw-r--r--sysdeps/unix/sysv/linux/sh/sigcontextinfo.h7
-rw-r--r--sysdeps/unix/sysv/linux/sh/smp.h2
-rw-r--r--sysdeps/unix/sysv/linux/sh/sys/procfs.h4
-rw-r--r--sysdeps/unix/sysv/linux/sh/sys/ucontext.h143
-rw-r--r--sysdeps/unix/sysv/linux/sh/sys/user.h3
-rw-r--r--sysdeps/unix/sysv/linux/sh/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/sh/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/sh/sysdep-cancel.h169
-rw-r--r--sysdeps/unix/sysv/linux/sh/sysdep.S2
-rw-r--r--sysdeps/unix/sysv/linux/sh/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/sh/vfork.S23
-rw-r--r--sysdeps/unix/sysv/linux/shm-directory.c8
-rw-r--r--sysdeps/unix/sysv/linux/shmat.c19
-rw-r--r--sysdeps/unix/sysv/linux/shmctl.c61
-rw-r--r--sysdeps/unix/sysv/linux/shmdt.c14
-rw-r--r--sysdeps/unix/sysv/linux/shmget.c15
-rw-r--r--sysdeps/unix/sysv/linux/shutdown.c2
-rw-r--r--sysdeps/unix/sysv/linux/sigaction.c30
-rw-r--r--sysdeps/unix/sysv/linux/siglist.h2
-rw-r--r--sysdeps/unix/sysv/linux/signalfd.c28
-rw-r--r--sysdeps/unix/sysv/linux/sigpending.c2
-rw-r--r--sysdeps/unix/sysv/linux/sigprocmask.c12
-rw-r--r--sysdeps/unix/sysv/linux/sigqueue.c12
-rw-r--r--sysdeps/unix/sysv/linux/sigset-cvt-mask.h2
-rw-r--r--sysdeps/unix/sysv/linux/sigsetops.h108
-rw-r--r--sysdeps/unix/sysv/linux/sigstack.c2
-rw-r--r--sysdeps/unix/sysv/linux/sigsuspend.c6
-rw-r--r--sysdeps/unix/sysv/linux/sigtimedwait.c34
-rw-r--r--sysdeps/unix/sysv/linux/sigwait.c97
-rw-r--r--sysdeps/unix/sysv/linux/sigwaitinfo.c50
-rw-r--r--sysdeps/unix/sysv/linux/sizes.h2
-rw-r--r--sysdeps/unix/sysv/linux/socket.c2
-rw-r--r--sysdeps/unix/sysv/linux/socketcall.h2
-rw-r--r--sysdeps/unix/sysv/linux/socketpair.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/arch-fork.h27
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/environments.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/epoll.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/errno.h44
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/eventfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/inotify.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/ioctls.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/ipc.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/local_lim.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/msq.h3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/poll.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/resource.h49
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/sem.h3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/setjmp.h38
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/sigaction.h25
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h7
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/siginfo-arch.h12
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/siginfo-consts-arch.h12
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/siginfo.h352
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/signalfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/signum.h72
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/sigstack.h34
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/socket_type.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/termios.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/timerfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/typesizes.h7
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/wordsize.h17
-rw-r--r--sysdeps/unix/sysv/linux/sparc/dl-cache.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/getrlimit64.c24
-rw-r--r--sysdeps/unix/sysv/linux/sparc/getshmlba.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/getsysstats.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/kernel-features.h52
-rw-r--r--sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h10
-rw-r--r--sysdeps/unix/sysv/linux/sparc/kernel_termios.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/lowlevellock.h42
-rw-r--r--sysdeps/unix/sysv/linux/sparc/readelflib.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/alphasort64.c3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h26
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/clone.S22
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/getdents64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist90
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist647
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist35
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data12
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/scandir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S15
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setgroups.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/setuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c52
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sigcontextinfo.h13
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h111
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/ucontext_i.sym1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/versionsort64.c3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S22
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/Makefile5
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/____longjmp_chk.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/__start_context.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h26
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/brk.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/clone.S21
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/configure4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/dl-cache.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c11
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h41
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist83
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libdl.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist637
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libnsl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist31
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libresolv.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist7
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libthread_db.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data12
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c32
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/pause.c9
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c54
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c49
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sigcontextinfo.h10
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c33
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sizes.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/swapcontext.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list10
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h109
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/ucontext_i.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S22
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/xstatconv.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sys/ptrace.h74
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sys/ucontext.h291
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sys/user.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/syscalls.list3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/system.c2
-rw-r--r--sysdeps/unix/sysv/linux/spawni.c411
-rw-r--r--sysdeps/unix/sysv/linux/speed.c2
-rw-r--r--sysdeps/unix/sysv/linux/splice.c27
-rw-r--r--sysdeps/unix/sysv/linux/statfs64.c25
-rw-r--r--sysdeps/unix/sysv/linux/statvfs.c8
-rw-r--r--sysdeps/unix/sysv/linux/statvfs64.c9
-rw-r--r--sysdeps/unix/sysv/linux/statx.c41
-rw-r--r--sysdeps/unix/sysv/linux/sync_file_range.c37
-rw-r--r--sysdeps/unix/sysv/linux/sys/acct.h36
-rw-r--r--sysdeps/unix/sysv/linux/sys/epoll.h12
-rw-r--r--sysdeps/unix/sysv/linux/sys/eventfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/fanotify.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/fsuid.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/inotify.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/kd.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/klog.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/mount.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/pci.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/personality.h5
-rw-r--r--sysdeps/unix/sysv/linux/sys/prctl.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/procfs.h4
-rw-r--r--sysdeps/unix/sysv/linux/sys/ptrace.h87
-rw-r--r--sysdeps/unix/sysv/linux/sys/quota.h172
-rw-r--r--sysdeps/unix/sysv/linux/sys/raw.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/reboot.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/signalfd.h5
-rw-r--r--sysdeps/unix/sysv/linux/sys/swap.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/syscall.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/sysctl.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/sysinfo.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/sysmacros.h65
-rw-r--r--sysdeps/unix/sysv/linux/sys/timerfd.h9
-rw-r--r--sysdeps/unix/sysv/linux/sys/timex.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/ultrasound.h1
-rw-r--r--sysdeps/unix/sysv/linux/syscall-names.list602
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list22
-rw-r--r--sysdeps/unix/sysv/linux/sysconf.c8
-rw-r--r--sysdeps/unix/sysv/linux/sysctl.c2
-rw-r--r--sysdeps/unix/sysv/linux/sysdep-cancel.h64
-rw-r--r--sysdeps/unix/sysv/linux/sysdep-vdso.h2
-rw-r--r--sysdeps/unix/sysv/linux/sysdep.h45
-rw-r--r--sysdeps/unix/sysv/linux/system.c2
-rw-r--r--sysdeps/unix/sysv/linux/tcdrain.c2
-rw-r--r--sysdeps/unix/sysv/linux/tcflow.c2
-rw-r--r--sysdeps/unix/sysv/linux/tcflush.c2
-rw-r--r--sysdeps/unix/sysv/linux/tcgetattr.c3
-rw-r--r--sysdeps/unix/sysv/linux/tcsendbrk.c2
-rw-r--r--sysdeps/unix/sysv/linux/tcsetattr.c5
-rw-r--r--sysdeps/unix/sysv/linux/tee.c26
-rw-r--r--sysdeps/unix/sysv/linux/test-errno-linux.c181
-rw-r--r--sysdeps/unix/sysv/linux/tile/Implies1
-rw-r--r--sysdeps/unix/sysv/linux/tile/Makefile28
-rw-r--r--sysdeps/unix/sysv/linux/tile/Versions18
-rw-r--r--sysdeps/unix/sysv/linux/tile/arch-fork.h29
-rw-r--r--sysdeps/unix/sysv/linux/tile/bits/environments.h100
-rw-r--r--sysdeps/unix/sysv/linux/tile/bits/local_lim.h100
-rw-r--r--sysdeps/unix/sysv/linux/tile/bits/mman.h40
-rw-r--r--sysdeps/unix/sysv/linux/tile/bits/sigaction.h77
-rw-r--r--sysdeps/unix/sysv/linux/tile/bits/siginfo.h347
-rw-r--r--sysdeps/unix/sysv/linux/tile/cacheflush.c34
-rw-r--r--sysdeps/unix/sysv/linux/tile/clone.S222
-rw-r--r--sysdeps/unix/sysv/linux/tile/getcontext.S95
-rw-r--r--sysdeps/unix/sysv/linux/tile/init-first.c48
-rw-r--r--sysdeps/unix/sysv/linux/tile/kernel-features.h33
-rw-r--r--sysdeps/unix/sysv/linux/tile/ldsodefs.h32
-rw-r--r--sysdeps/unix/sysv/linux/tile/libc-vdso.h42
-rw-r--r--sysdeps/unix/sysv/linux/tile/makecontext.c67
-rw-r--r--sysdeps/unix/sysv/linux/tile/profil-counter.h26
-rw-r--r--sysdeps/unix/sysv/linux/tile/pt-vfork.c1
-rw-r--r--sysdeps/unix/sysv/linux/tile/set_dataplane.c36
-rw-r--r--sysdeps/unix/sysv/linux/tile/setcontext.S206
-rw-r--r--sysdeps/unix/sysv/linux/tile/shlib-versions2
-rw-r--r--sysdeps/unix/sysv/linux/tile/sigcontextinfo.h27
-rw-r--r--sysdeps/unix/sysv/linux/tile/swapcontext.S89
-rw-r--r--sysdeps/unix/sysv/linux/tile/sys/cachectl.h36
-rw-r--r--sysdeps/unix/sysv/linux/tile/sys/dataplane.h33
-rw-r--r--sysdeps/unix/sysv/linux/tile/sys/procfs.h128
-rw-r--r--sysdeps/unix/sysv/linux/tile/sys/ptrace.h194
-rw-r--r--sysdeps/unix/sysv/linux/tile/sys/reg.h2
-rw-r--r--sysdeps/unix/sysv/linux/tile/sys/ucontext.h70
-rw-r--r--sysdeps/unix/sysv/linux/tile/sys/user.h1
-rw-r--r--sysdeps/unix/sysv/linux/tile/syscall.S32
-rw-r--r--sysdeps/unix/sysv/linux/tile/sysconf.c75
-rw-r--r--sysdeps/unix/sysv/linux/tile/sysdep-cancel.h154
-rw-r--r--sysdeps/unix/sysv/linux/tile/sysdep.c33
-rw-r--r--sysdeps/unix/sysv/linux/tile/sysdep.h239
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/configure4
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/configure.ac4
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S41
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/ldconfig.h26
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/ldd-rewrite.sed1
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/register-dump.h123
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/sched_getcpu.c87
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Implies4
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Makefile1
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/c++-types.data67
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/ld.abilist10
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libBrokenLocale.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libanl.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist2096
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libcrypt.abilist8
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libdl.abilist10
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist375
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libnsl.abilist122
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libpthread.abilist226
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libresolv.abilist92
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/librt.abilist41
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libthread_db.abilist41
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libutil.abilist7
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Implies4
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Makefile1
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/ld.abilist10
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libBrokenLocale.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libanl.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist2096
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libcrypt.abilist8
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libdl.abilist10
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist375
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libnsl.abilist122
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libpthread.abilist226
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libresolv.abilist92
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/librt.abilist41
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libthread_db.abilist41
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libutil.abilist7
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/Implies3
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/c++-types.data67
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/ld.abilist10
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/ldconfig.h25
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libBrokenLocale.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libanl.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist2096
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libcrypt.abilist8
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libdl.abilist10
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist375
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libnsl.abilist122
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libpthread.abilist226
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libresolv.abilist92
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/librt.abilist41
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libthread_db.abilist41
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libutil.abilist7
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/register-dump.h111
-rw-r--r--sysdeps/unix/sysv/linux/tile/ucontext_i.h42
-rw-r--r--sysdeps/unix/sysv/linux/tile/vfork.S77
-rw-r--r--sysdeps/unix/sysv/linux/tile/waitpid.S18
-rw-r--r--sysdeps/unix/sysv/linux/time.c2
-rw-r--r--sysdeps/unix/sysv/linux/timer_create.c2
-rw-r--r--sysdeps/unix/sysv/linux/timer_delete.c2
-rw-r--r--sysdeps/unix/sysv/linux/timer_getoverr.c2
-rw-r--r--sysdeps/unix/sysv/linux/timer_gettime.c2
-rw-r--r--sysdeps/unix/sysv/linux/timer_routines.c2
-rw-r--r--sysdeps/unix/sysv/linux/timer_settime.c2
-rw-r--r--sysdeps/unix/sysv/linux/times.c29
-rw-r--r--sysdeps/unix/sysv/linux/timespec_get.c2
-rw-r--r--sysdeps/unix/sysv/linux/truncate.c35
-rw-r--r--sysdeps/unix/sysv/linux/truncate64.c28
-rw-r--r--sysdeps/unix/sysv/linux/tst-affinity-pid.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-affinity.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-align-clone.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-clone.c7
-rw-r--r--sysdeps/unix/sysv/linux/tst-clone2.c146
-rw-r--r--sysdeps/unix/sysv/linux/tst-clone3.c96
-rw-r--r--sysdeps/unix/sysv/linux/tst-fallocate-common.c98
-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-fanotify.c16
-rw-r--r--sysdeps/unix/sysv/linux/tst-getpid2.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-memfd_create.c121
-rw-r--r--sysdeps/unix/sysv/linux/tst-mlock2.c66
-rw-r--r--sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c97
-rw-r--r--sysdeps/unix/sysv/linux/tst-ofdlocks.c81
-rw-r--r--sysdeps/unix/sysv/linux/tst-personality.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-pkey.c399
-rw-r--r--sysdeps/unix/sysv/linux/tst-quota.c58
-rw-r--r--sysdeps/unix/sysv/linux/tst-rlimit-infinity.c173
-rw-r--r--sysdeps/unix/sysv/linux/tst-setgetname.c17
-rw-r--r--sysdeps/unix/sysv/linux/tst-signal-numbers.sh86
-rw-r--r--sysdeps/unix/sysv/linux/tst-skeleton-affinity.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-skeleton-thread-affinity.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-sync_file_range.c132
-rw-r--r--sysdeps/unix/sysv/linux/tst-syscall-list.sh99
-rw-r--r--sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c27
-rw-r--r--sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c40
-rw-r--r--sysdeps/unix/sysv/linux/tst-thread-affinity-pthread.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-thread-affinity-pthread2.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-thread-affinity-sched.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-ttyname.c577
-rw-r--r--sysdeps/unix/sysv/linux/ttyname.c63
-rw-r--r--sysdeps/unix/sysv/linux/ttyname.h48
-rw-r--r--sysdeps/unix/sysv/linux/ttyname_r.c64
-rw-r--r--sysdeps/unix/sysv/linux/umount.S12
-rw-r--r--sysdeps/unix/sysv/linux/umount.c30
-rw-r--r--sysdeps/unix/sysv/linux/unlockpt.c2
-rw-r--r--sysdeps/unix/sysv/linux/updwtmp.c2
-rw-r--r--sysdeps/unix/sysv/linux/ustat.c50
-rw-r--r--sysdeps/unix/sysv/linux/utimensat.c9
-rw-r--r--sysdeps/unix/sysv/linux/utimes.c3
-rw-r--r--sysdeps/unix/sysv/linux/utmp_file.c2
-rw-r--r--sysdeps/unix/sysv/linux/versionsort64.c48
-rw-r--r--sysdeps/unix/sysv/linux/vmsplice.c27
-rw-r--r--sysdeps/unix/sysv/linux/wait.c4
-rw-r--r--sysdeps/unix/sysv/linux/waitid.c2
-rw-r--r--sysdeps/unix/sysv/linux/waitpid.c3
-rw-r--r--sysdeps/unix/sysv/linux/waitpid_nocancel.c34
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/creat64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/fallocate.c34
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/ftruncate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/fxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c2
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/getdents.c4
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/getdents64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/getdirentries.c3
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/getdirentries64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/glob64.c2
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/lxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/mmap.c40
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/mmap64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/open64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/openat.c11
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/openat64.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.c66
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/pread64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/preadv.c64
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/preadv64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/pwritev.c64
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/pwritev64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/readdir.c7
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/readdir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c4
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/syscalls.list14
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/truncate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/xstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/write.c (renamed from sysdeps/nacl/write.c)10
-rw-r--r--sysdeps/unix/sysv/linux/write_nocancel.c28
-rw-r--r--sysdeps/unix/sysv/linux/writev.c29
-rw-r--r--sysdeps/unix/sysv/linux/x86/Implies1
-rw-r--r--sysdeps/unix/sysv/linux/x86/Makefile29
-rw-r--r--sysdeps/unix/sysv/linux/x86/arch-pkey.h40
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/environments.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/epoll.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/fcntl.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/ipctypes.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/msq.h3
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/sem.h3
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/shm.h3
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/sigcontext.h18
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h17
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/siginfo.h360
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/sysctl.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/typesizes.h7
-rw-r--r--sysdeps/unix/sysv/linux/x86/cpu-features.c46
-rw-r--r--sysdeps/unix/sysv/linux/x86/dl-cet.h55
-rw-r--r--sysdeps/unix/sysv/linux/x86/dl-sysdep.c21
-rw-r--r--sysdeps/unix/sysv/linux/x86/elision-conf.c81
-rw-r--r--sysdeps/unix/sysv/linux/x86/elision-conf.h3
-rw-r--r--sysdeps/unix/sysv/linux/x86/elision-lock.c30
-rw-r--r--sysdeps/unix/sysv/linux/x86/elision-timed.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86/elision-trylock.c20
-rw-r--r--sysdeps/unix/sysv/linux/x86/elision-unlock.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86/force-elision.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/gettimeofday.c30
-rw-r--r--sysdeps/unix/sysv/linux/x86/include/asm/prctl.h32
-rw-r--r--sysdeps/unix/sysv/linux/x86/jmp_buf-ssp.sym5
-rw-r--r--sysdeps/unix/sysv/linux/x86/libc-vdso.h5
-rw-r--r--sysdeps/unix/sysv/linux/x86/pkey_get.c33
-rw-r--r--sysdeps/unix/sysv/linux/x86/pkey_set.c35
-rw-r--r--sysdeps/unix/sysv/linux/x86/pthread_mutex_cond_lock.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86/pthread_mutex_lock.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86/pthread_mutex_trylock.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86/setjmpP.h128
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/debugreg.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/elf.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/io.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/perm.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/ptrace.h198
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/reg.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/ucontext.h108
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/user.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/vm86.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/sysconf.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86/time.c26
-rw-r--r--sysdeps/unix/sysv/linux/x86/tst-cet-property-1.c44
-rw-r--r--sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c63
-rw-r--r--sysdeps/unix/sysv/linux/x86/tst-cet-property-dep-2.S63
-rw-r--r--sysdeps/unix/sysv/linux/x86/tst-cet-setcontext-1.c127
-rw-r--r--sysdeps/unix/sysv/linux/x86/tst-saved_mask-1.c55
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/configure4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h10
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/ld.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libc.abilist80
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libdl.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libm.abilist671
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libnsl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist30
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libresolv.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/librt.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libthread_db.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/mmap.c37
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/mmap_internal.h42
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S41
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/__start_context.S79
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/arch-fork.h27
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/cancellation.S25
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/clone.S20
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/compat-timer.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/dl-cache.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/getcontext.S52
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/init-first.c4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/ipc_priv.h32
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/kernel-features.h22
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/kernel_stat.h3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/ldconfig.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/libmvec.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/lowlevellock.S44
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/lowlevellock.h84
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S306
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/makecontext.c42
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S177
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S161
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S623
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S555
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/recv.c33
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/register-dump.h4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/send.c31
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/setcontext.S135
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigaction.c63
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h12
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigpending.c36
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigprocmask.c3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/swapcontext.S173
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/syscalls.list18
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h109
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.S2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h269
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/timer_create.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/timer_delete.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/timer_gettime.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/timer_settime.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/umount.c30
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/vfork.S58
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/Makefile5
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/configure4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/dl-cache.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/getcpu.c31
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/glob.c1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libBrokenLocale.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libanl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist62
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libcrypt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libdl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist669
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libnsl.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist23
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libresolv.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libthread_db.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/llseek.S1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/lseek.S2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list5
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/times.c26
-rw-r--r--sysdeps/unix/sysv/linux/xmknod.c2
-rw-r--r--sysdeps/unix/sysv/linux/xmknodat.c2
-rw-r--r--sysdeps/unix/sysv/linux/xstat.c6
-rw-r--r--sysdeps/unix/sysv/linux/xstat64.c4
-rw-r--r--sysdeps/unix/sysv/linux/xstatconv.c8
-rw-r--r--sysdeps/unix/sysv/linux/xstatconv.h2
-rw-r--r--sysdeps/unix/x86_64/sysdep.S2
-rw-r--r--sysdeps/unix/x86_64/sysdep.h2
-rw-r--r--sysdeps/wordsize-32/Makefile7
-rw-r--r--sysdeps/wordsize-32/bits/wordsize.h7
-rw-r--r--sysdeps/wordsize-32/divdi3-symbol-hacks.h31
-rw-r--r--sysdeps/wordsize-32/divdi3.c2
-rw-r--r--sysdeps/wordsize-32/llabs.c2
-rw-r--r--sysdeps/wordsize-32/lldiv.c2
-rw-r--r--sysdeps/wordsize-32/strtoimax.c2
-rw-r--r--sysdeps/wordsize-32/strtoumax.c3
-rw-r--r--sysdeps/wordsize-32/symbol-hacks.h31
-rw-r--r--sysdeps/wordsize-32/wcstoimax.c2
-rw-r--r--sysdeps/wordsize-32/wcstoumax.c2
-rw-r--r--sysdeps/wordsize-64/bits/wordsize.h5
-rw-r--r--sysdeps/wordsize-64/glob.c8
-rw-r--r--sysdeps/wordsize-64/glob64.c1
-rw-r--r--sysdeps/wordsize-64/labs.c2
-rw-r--r--sysdeps/wordsize-64/ldiv.c2
-rw-r--r--sysdeps/wordsize-64/strtoimax.c2
-rw-r--r--sysdeps/wordsize-64/strtoumax.c3
-rw-r--r--sysdeps/wordsize-64/tst-writev.c4
-rw-r--r--sysdeps/wordsize-64/wcstoimax.c2
-rw-r--r--sysdeps/wordsize-64/wcstoumax.c2
-rw-r--r--sysdeps/x86/Makeconfig1
-rw-r--r--sysdeps/x86/Makefile89
-rw-r--r--sysdeps/x86/__longjmp_cancel.S20
-rw-r--r--sysdeps/x86/bits/byteswap-16.h49
-rw-r--r--sysdeps/x86/bits/byteswap.h155
-rw-r--r--sysdeps/x86/bits/floatn.h121
-rw-r--r--sysdeps/x86/bits/flt-eval-method.h33
-rw-r--r--sysdeps/x86/bits/fp-logb.h24
-rw-r--r--sysdeps/x86/bits/huge_vall.h41
-rw-r--r--sysdeps/x86/bits/indirect-return.h37
-rw-r--r--sysdeps/x86/bits/link.h2
-rw-r--r--sysdeps/x86/bits/mathdef.h59
-rw-r--r--sysdeps/x86/bits/pthreadtypes.h258
-rw-r--r--sysdeps/x86/bits/select.h2
-rw-r--r--sysdeps/x86/bits/semaphore.h2
-rw-r--r--sysdeps/x86/bits/setjmp.h2
-rw-r--r--sysdeps/x86/bits/string.h1994
-rw-r--r--sysdeps/x86/bits/wordsize.h4
-rw-r--r--sysdeps/x86/bits/xtitypes.h2
-rw-r--r--sysdeps/x86/cacheinfo.c791
-rw-r--r--sysdeps/x86/cet-tunables.h29
-rw-r--r--sysdeps/x86/check-cet.awk53
-rw-r--r--sysdeps/x86/configure69
-rw-r--r--sysdeps/x86/configure.ac46
-rw-r--r--sysdeps/x86/cpu-features-offsets.sym17
-rw-r--r--sysdeps/x86/cpu-features.c504
-rw-r--r--sysdeps/x86/cpu-features.h319
-rw-r--r--sysdeps/x86/cpu-tunables.c385
-rw-r--r--sysdeps/x86/dl-cet.c346
-rw-r--r--sysdeps/x86/dl-get-cpu-features.c2
-rw-r--r--sysdeps/x86/dl-hwcap.h77
-rw-r--r--sysdeps/x86/dl-procinfo.c88
-rw-r--r--sysdeps/x86/dl-procinfo.h48
-rw-r--r--sysdeps/x86/dl-procruntime.c68
-rw-r--r--sysdeps/x86/dl-prop.h164
-rw-r--r--sysdeps/x86/dl-tunables.list40
-rw-r--r--sysdeps/x86/elide.h32
-rw-r--r--sysdeps/x86/float128-abi.h2
-rw-r--r--sysdeps/x86/fpu/Makefile9
-rw-r--r--sysdeps/x86/fpu/bits/fenv.h18
-rw-r--r--sysdeps/x86/fpu/bits/math-vector.h2
-rw-r--r--sysdeps/x86/fpu/bits/mathinline.h650
-rw-r--r--sysdeps/x86/fpu/e_sqrtf128.c47
-rw-r--r--sysdeps/x86/fpu/fix-fp-int-compare-invalid.h32
-rw-r--r--sysdeps/x86/fpu/include/bits/fenv.h17
-rw-r--r--sysdeps/x86/fpu/math-barriers.h61
-rw-r--r--sysdeps/x86/fpu/powl_helper.c7
-rw-r--r--sysdeps/x86/fpu/sfp-machine.h209
-rw-r--r--sysdeps/x86/fpu/test-fenv-clear-sse.c2
-rw-r--r--sysdeps/x86/fpu/test-fenv-sse-2.c2
-rw-r--r--sysdeps/x86/fpu/test-fenv-sse.c2
-rw-r--r--sysdeps/x86/fpu/test-fenv-x87.c2
-rw-r--r--sysdeps/x86/fpu/test-flt-eval-method-387.c1
-rw-r--r--sysdeps/x86/fpu/test-flt-eval-method-sse.c1
-rw-r--r--sysdeps/x86/fpu/test-math-vector-sincos.h98
-rw-r--r--sysdeps/x86/fpu_control.h2
-rw-r--r--sysdeps/x86/init-arch.h3
-rw-r--r--sysdeps/x86/jmp_buf-ssp.sym1
-rw-r--r--sysdeps/x86/ldsodefs.h66
-rw-r--r--sysdeps/x86/libc-start.c30
-rw-r--r--sysdeps/x86/libc-start.h25
-rw-r--r--sysdeps/x86/link_map.h26
-rw-r--r--sysdeps/x86/longjmp.c45
-rw-r--r--sysdeps/x86/math-tests.h25
-rw-r--r--sysdeps/x86/nptl/bits/pthreadtypes-arch.h106
-rw-r--r--sysdeps/x86/nptl/pt-longjmp.c71
-rw-r--r--sysdeps/x86/nptl/tls-setup.h23
-rw-r--r--sysdeps/x86/rtld-global-offsets.sym7
-rw-r--r--sysdeps/x86/string_private.h2
-rw-r--r--sysdeps/x86/sysdep.h104
-rw-r--r--sysdeps/x86/tst-cet-legacy-1.c44
-rw-r--r--sysdeps/x86/tst-cet-legacy-2.c64
-rw-r--r--sysdeps/x86/tst-cet-legacy-2a.c1
-rw-r--r--sysdeps/x86/tst-cet-legacy-3.c37
-rw-r--r--sysdeps/x86/tst-cet-legacy-4.c56
-rw-r--r--sysdeps/x86/tst-cet-legacy-4a.c1
-rw-r--r--sysdeps/x86/tst-cet-legacy-4b.c1
-rw-r--r--sysdeps/x86/tst-cet-legacy-4c.c1
-rw-r--r--sysdeps/x86/tst-cet-legacy-mod-1.c24
-rw-r--r--sysdeps/x86/tst-cet-legacy-mod-2.c24
-rw-r--r--sysdeps/x86/tst-cet-legacy-mod-4.c2
-rw-r--r--sysdeps/x86/tst-get-cpu-features.c2
-rw-r--r--sysdeps/x86_64/Implies1
-rw-r--r--sysdeps/x86_64/Makefile82
-rw-r--r--sysdeps/x86_64/__longjmp.S46
-rw-r--r--sysdeps/x86_64/_mcount.S65
-rw-r--r--sysdeps/x86_64/add_n.S2
-rw-r--r--sysdeps/x86_64/addmul_1.S2
-rw-r--r--sysdeps/x86_64/atomic-machine.h13
-rw-r--r--sysdeps/x86_64/backtrace.c133
-rw-r--r--sysdeps/x86_64/bsd-_setjmp.S2
-rw-r--r--sysdeps/x86_64/bsd-setjmp.S2
-rw-r--r--sysdeps/x86_64/cacheinfo.c665
-rw-r--r--sysdeps/x86_64/configure60
-rw-r--r--sysdeps/x86_64/configure.ac46
-rw-r--r--sysdeps/x86_64/crti.S8
-rw-r--r--sysdeps/x86_64/crtn.S2
-rw-r--r--sysdeps/x86_64/dl-irel.h2
-rw-r--r--sysdeps/x86_64/dl-lookupcfg.h5
-rw-r--r--sysdeps/x86_64/dl-machine.h64
-rw-r--r--sysdeps/x86_64/dl-procinfo.c16
-rw-r--r--sysdeps/x86_64/dl-tls.c53
-rw-r--r--sysdeps/x86_64/dl-tls.h8
-rw-r--r--sysdeps/x86_64/dl-tlsdesc.S24
-rw-r--r--sysdeps/x86_64/dl-tlsdesc.h4
-rw-r--r--sysdeps/x86_64/dl-trampoline.S103
-rw-r--r--sysdeps/x86_64/dl-trampoline.h182
-rw-r--r--sysdeps/x86_64/ffs.c2
-rw-r--r--sysdeps/x86_64/ffsll.c2
-rw-r--r--sysdeps/x86_64/fpu/Makefile190
-rw-r--r--sysdeps/x86_64/fpu/dla.h8
-rw-r--r--sysdeps/x86_64/fpu/e_expf.S339
-rw-r--r--sysdeps/x86_64/fpu/e_expl.S10
-rw-r--r--sysdeps/x86_64/fpu/e_log10l.S1
-rw-r--r--sysdeps/x86_64/fpu/e_log2l.S1
-rw-r--r--sysdeps/x86_64/fpu/e_logl.S1
-rw-r--r--sysdeps/x86_64/fpu/e_powl.S45
-rw-r--r--sysdeps/x86_64/fpu/e_scalbl.S13
-rw-r--r--sysdeps/x86_64/fpu/e_sqrt.c2
-rw-r--r--sysdeps/x86_64/fpu/e_sqrtf.c2
-rw-r--r--sysdeps/x86_64/fpu/fclrexcpt.c2
-rw-r--r--sysdeps/x86_64/fpu/fedisblxcpt.c2
-rw-r--r--sysdeps/x86_64/fpu/feenablxcpt.c2
-rw-r--r--sysdeps/x86_64/fpu/fegetenv.c2
-rw-r--r--sysdeps/x86_64/fpu/fegetexcept.c2
-rw-r--r--sysdeps/x86_64/fpu/fegetmode.c28
-rw-r--r--sysdeps/x86_64/fpu/fegetround.c2
-rw-r--r--sysdeps/x86_64/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/x86_64/fpu/fesetenv.c2
-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/fesetround.c2
-rw-r--r--sysdeps/x86_64/fpu/feupdateenv.c2
-rw-r--r--sysdeps/x86_64/fpu/fgetexcptflg.c2
-rw-r--r--sysdeps/x86_64/fpu/fraiseexcpt.c2
-rw-r--r--sysdeps/x86_64/fpu/fsetexcptflg.c2
-rw-r--r--sysdeps/x86_64/fpu/ftestexcept.c2
-rw-r--r--sysdeps/x86_64/fpu/k_rem_pio2l.c1
-rw-r--r--sysdeps/x86_64/fpu/libm-test-ulps792
-rw-r--r--sysdeps/x86_64/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/x86_64/fpu/math-tests-arch.h10
-rw-r--r--sysdeps/x86_64/fpu/math_ldbl.h31
-rw-r--r--sysdeps/x86_64/fpu/math_private.h32
-rw-r--r--sysdeps/x86_64/fpu/multiarch/Makefile91
-rw-r--r--sysdeps/x86_64/fpu/multiarch/doasin-fma.c4
-rw-r--r--sysdeps/x86_64/fpu/multiarch/dosincos-fma.c6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_asin-fma.c11
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_asin.c54
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_atan2-fma.c10
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_atan2.c35
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_exp-avx.c1
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_exp-fma.c5
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c1
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_exp.c35
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_exp2f-fma.c3
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_exp2f.c40
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_expf-fma.c3
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_expf.c43
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_log-avx.c4
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_log-fma.c4
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_log-fma4.c4
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_log.c35
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_log2f-fma.c3
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_log2f.c43
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_logf-fma.c3
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_logf.c43
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_pow-fma.c5
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c1
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_pow.c34
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_powf-fma.c3
-rw-r--r--sysdeps/x86_64/fpu/multiarch/e_powf.c46
-rw-r--r--sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c4
-rw-r--r--sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h43
-rw-r--r--sysdeps/x86_64/fpu/multiarch/ifunc-fma.h34
-rw-r--r--sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h39
-rw-r--r--sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h39
-rw-r--r--sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h45
-rw-r--r--sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-sse4_1.h38
-rw-r--r--sysdeps/x86_64/fpu/multiarch/ifunc-sse4_1.h33
-rw-r--r--sysdeps/x86_64/fpu/multiarch/mpa-fma.c14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/mpatan-fma.c10
-rw-r--r--sysdeps/x86_64/fpu/multiarch/mpatan2-fma.c9
-rw-r--r--sysdeps/x86_64/fpu/multiarch/mpexp-avx.c9
-rw-r--r--sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c9
-rw-r--r--sysdeps/x86_64/fpu/multiarch/mplog-avx.c8
-rw-r--r--sysdeps/x86_64/fpu/multiarch/mplog-fma4.c8
-rw-r--r--sysdeps/x86_64/fpu/multiarch/mpsqrt-fma.c8
-rw-r--r--sysdeps/x86_64/fpu/multiarch/mptan-fma.c7
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_atan-avx.c2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_atan-fma.c9
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_atan.c33
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_ceil-sse4_1.S25
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_ceil.S38
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_ceil.c31
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_ceilf-sse4_1.S25
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_ceilf.S38
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_ceilf.c31
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_cosf-fma.c2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_cosf-sse2.c2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_cosf.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_floor-sse4_1.S25
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_floor.S38
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_floor.c31
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_floorf-sse4_1.S25
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_floorf.S38
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_floorf.c31
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_fma.c5
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_fmaf.c5
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_nearbyint-sse4_1.S25
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_nearbyint.S38
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_nearbyint.c32
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_nearbyintf-sse4_1.S25
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S38
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c32
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_rint-sse4_1.S25
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_rint.S38
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_rint.c31
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_rintf-sse4_1.S25
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_rintf.S38
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_rintf.c31
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_sin-fma.c11
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_sin.c57
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_sincosf-fma.c240
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_sincosf-sse2.S2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_sincosf.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_sinf-fma.c2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_sinf-sse2.c2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_sinf.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_tan-avx.c2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_tan-fma.c8
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_tan.c33
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_trunc-c.c2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_trunc-sse4_1.S25
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_trunc.c31
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_truncf-c.c2
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_truncf-sse4_1.S25
-rw-r--r--sysdeps/x86_64/fpu/multiarch/s_truncf.c31
-rw-r--r--sysdeps/x86_64/fpu/multiarch/sincos32-fma.c15
-rw-r--r--sysdeps/x86_64/fpu/multiarch/slowexp-avx.c9
-rw-r--r--sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c9
-rw-r--r--sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c11
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core_sse4.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core_avx2.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core-avx2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core_avx512.S14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core_sse4.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core_avx2.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core-avx2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log2_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log2_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log2_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log2_core_sse4.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log4_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log4_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log4_core_avx2.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log8_core-avx2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core_sse4.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core_avx2.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core-avx2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core_sse4.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core_avx2.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core-avx2.S23
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.c27
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core_avx512.S14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S66
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S108
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core-avx2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S187
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core-avx2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core_avx512.S14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core_sse4.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core_avx2.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core-avx2.S23
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core_sse4.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core_avx2.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core-avx2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core_sse4.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core_avx2.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core-avx2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core_sse4.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core_avx2.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core-avx2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S283
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S92
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S164
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core-avx2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core.S37
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core_avx512.S14
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core-sse2.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core_sse4.S6
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core-sse.S20
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core.S36
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core.c28
-rw-r--r--sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core_avx2.S6
-rw-r--r--sysdeps/x86_64/fpu/printf_fphex.c2
-rw-r--r--sysdeps/x86_64/fpu/s_ceill.S18
-rw-r--r--sysdeps/x86_64/fpu/s_copysign.S5
-rw-r--r--sysdeps/x86_64/fpu/s_copysignf.S5
-rw-r--r--sysdeps/x86_64/fpu/s_copysignl.S3
-rw-r--r--sysdeps/x86_64/fpu/s_cosf.S533
-rw-r--r--sysdeps/x86_64/fpu/s_fabs.c5
-rw-r--r--sysdeps/x86_64/fpu/s_fabsf.c5
-rw-r--r--sysdeps/x86_64/fpu/s_fabsl.S5
-rw-r--r--sysdeps/x86_64/fpu/s_fdiml.S43
-rw-r--r--sysdeps/x86_64/fpu/s_floorl.S18
-rw-r--r--sysdeps/x86_64/fpu/s_fmax.S24
-rw-r--r--sysdeps/x86_64/fpu/s_fmaxf.S24
-rw-r--r--sysdeps/x86_64/fpu/s_fmaxl.S34
-rw-r--r--sysdeps/x86_64/fpu/s_fmin.S24
-rw-r--r--sysdeps/x86_64/fpu/s_fminf.S24
-rw-r--r--sysdeps/x86_64/fpu/s_fminl.S32
-rw-r--r--sysdeps/x86_64/fpu/s_llrint.S7
-rw-r--r--sysdeps/x86_64/fpu/s_llrintf.S7
-rw-r--r--sysdeps/x86_64/fpu/s_llrintl.S7
-rw-r--r--sysdeps/x86_64/fpu/s_log1pl.S1
-rw-r--r--sysdeps/x86_64/fpu/s_nearbyintl.S7
-rw-r--r--sysdeps/x86_64/fpu/s_signbit.S2
-rw-r--r--sysdeps/x86_64/fpu/s_signbitf.S2
-rw-r--r--sysdeps/x86_64/fpu/s_sincosf.S10
-rw-r--r--sysdeps/x86_64/fpu/s_sinf.S559
-rw-r--r--sysdeps/x86_64/fpu/s_truncl.S18
-rw-r--r--sysdeps/x86_64/fpu/svml_d_cos2_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_cos4_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_cos4_core_avx.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_cos8_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_exp2_core.S4
-rw-r--r--sysdeps/x86_64/fpu/svml_d_exp4_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_exp4_core_avx.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_exp8_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_exp_data.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_exp_data.h2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_log2_core.S4
-rw-r--r--sysdeps/x86_64/fpu/svml_d_log4_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_log4_core_avx.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_log8_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_log_data.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_log_data.h2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_pow2_core.S4
-rw-r--r--sysdeps/x86_64/fpu/svml_d_pow4_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_pow4_core_avx.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_pow8_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_pow_data.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_pow_data.h2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_sin2_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_sin4_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_sin4_core_avx.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_sin8_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_sincos2_core.S85
-rw-r--r--sysdeps/x86_64/fpu/svml_d_sincos4_core.S127
-rw-r--r--sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S122
-rw-r--r--sysdeps/x86_64/fpu/svml_d_sincos8_core.S170
-rw-r--r--sysdeps/x86_64/fpu/svml_d_trig_data.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_trig_data.h2
-rw-r--r--sysdeps/x86_64/fpu/svml_d_wrapper_impl.h71
-rw-r--r--sysdeps/x86_64/fpu/svml_finite_alias.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_cosf16_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_cosf4_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_cosf8_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_cosf8_core_avx.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_expf16_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_expf4_core.S4
-rw-r--r--sysdeps/x86_64/fpu/svml_s_expf8_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_expf8_core_avx.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_expf_data.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_expf_data.h2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_logf16_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_logf4_core.S4
-rw-r--r--sysdeps/x86_64/fpu/svml_s_logf8_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_logf8_core_avx.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_logf_data.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_logf_data.h2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_powf16_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_powf4_core.S4
-rw-r--r--sysdeps/x86_64/fpu/svml_s_powf8_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_powf8_core_avx.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_powf_data.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_powf_data.h2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_sincosf16_core.S268
-rw-r--r--sysdeps/x86_64/fpu/svml_s_sincosf4_core.S128
-rw-r--r--sysdeps/x86_64/fpu/svml_s_sincosf8_core.S175
-rw-r--r--sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S181
-rw-r--r--sysdeps/x86_64/fpu/svml_s_sinf16_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_sinf4_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_sinf8_core.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_sinf8_core_avx.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_trig_data.S2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_trig_data.h2
-rw-r--r--sysdeps/x86_64/fpu/svml_s_wrapper_impl.h83
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-avx-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-avx-mod.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-avx.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2-mod.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512-mod.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias-mod.c25
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-alias.c29
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c1
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c43
-rw-r--r--sysdeps/x86_64/fpu/test-double-libmvec-sincos.c44
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c8
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen2.c28
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c12
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen4-avx2.c33
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen4-avx2.h25
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c12
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen4.c30
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen4.h21
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c12
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen8.c30
-rw-r--r--sysdeps/x86_64/fpu/test-double-vlen8.h21
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-avx-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-avx-mod.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-avx.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2-mod.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512-mod.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias-mod.c25
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-alias.c29
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512-main.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c1
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c42
-rw-r--r--sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c44
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c12
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen16.c30
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen16.h21
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c12
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen4.c28
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c15
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen8-avx2.c33
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen8-avx2.h25
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c12
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen8.c30
-rw-r--r--sysdeps/x86_64/fpu/test-float-vlen8.h21
-rw-r--r--sysdeps/x86_64/fpu/test-libmvec-alias-mod.c66
-rw-r--r--sysdeps/x86_64/fpu/x86_64-math-asm.h2
-rw-r--r--sysdeps/x86_64/hp-timing.h2
-rw-r--r--sysdeps/x86_64/htonl.S2
-rw-r--r--sysdeps/x86_64/ifuncmain8.c2
-rw-r--r--sysdeps/x86_64/ifuncmod8.c3
-rw-r--r--sysdeps/x86_64/jmpbuf-offsets.h2
-rw-r--r--sysdeps/x86_64/jmpbuf-unwind.h2
-rw-r--r--sysdeps/x86_64/ldsodefs.h56
-rw-r--r--sysdeps/x86_64/localplt.data13
-rw-r--r--sysdeps/x86_64/lshift.S2
-rw-r--r--sysdeps/x86_64/machine-gmon.h2
-rw-r--r--sysdeps/x86_64/memchr.S103
-rw-r--r--sysdeps/x86_64/memcmp.S2
-rw-r--r--sysdeps/x86_64/memcopy.h1
-rw-r--r--sysdeps/x86_64/memcpy.S585
-rw-r--r--sysdeps/x86_64/memcpy_chk.S4
-rw-r--r--sysdeps/x86_64/memmove.S71
-rw-r--r--sysdeps/x86_64/memmove.c26
-rw-r--r--sysdeps/x86_64/memmove_chk.S33
-rw-r--r--sysdeps/x86_64/mempcpy.S9
-rw-r--r--sysdeps/x86_64/mempcpy_chk.S4
-rw-r--r--sysdeps/x86_64/memrchr.S38
-rw-r--r--sysdeps/x86_64/memset.S137
-rw-r--r--sysdeps/x86_64/memset_chk.S2
-rw-r--r--sysdeps/x86_64/memusage.h2
-rw-r--r--sysdeps/x86_64/mul_1.S2
-rw-r--r--sysdeps/x86_64/multiarch/Makefile61
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-avx2.h36
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-defines.sym20
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-impl-list.c340
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-memcmp.h45
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-memmove.h81
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-memset.h69
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-sse4_2.h34
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-strcasecmp.h43
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-unaligned-ssse3.h40
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-wmemset.h42
-rw-r--r--sysdeps/x86_64/multiarch/memchr-avx2.S340
-rw-r--r--sysdeps/x86_64/multiarch/memchr-sse2.S28
-rw-r--r--sysdeps/x86_64/multiarch/memchr.c35
-rw-r--r--sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S429
-rw-r--r--sysdeps/x86_64/multiarch/memcmp-sse2.S31
-rw-r--r--sysdeps/x86_64/multiarch/memcmp-sse4.S4
-rw-r--r--sysdeps/x86_64/multiarch/memcmp-ssse3.S2
-rw-r--r--sysdeps/x86_64/multiarch/memcmp.S67
-rw-r--r--sysdeps/x86_64/multiarch/memcmp.c37
-rw-r--r--sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S376
-rw-r--r--sysdeps/x86_64/multiarch/memcpy-avx512-no-vzeroupper.S408
-rw-r--r--sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S175
-rw-r--r--sysdeps/x86_64/multiarch/memcpy-ssse3-back.S29
-rw-r--r--sysdeps/x86_64/multiarch/memcpy-ssse3.S147
-rw-r--r--sysdeps/x86_64/multiarch/memcpy.S89
-rw-r--r--sysdeps/x86_64/multiarch/memcpy.c39
-rw-r--r--sysdeps/x86_64/multiarch/memcpy_chk-nonshared.S21
-rw-r--r--sysdeps/x86_64/multiarch/memcpy_chk.S56
-rw-r--r--sysdeps/x86_64/multiarch/memcpy_chk.c31
-rw-r--r--sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms.S12
-rw-r--r--sysdeps/x86_64/multiarch/memmove-avx-unaligned.S22
-rw-r--r--sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S405
-rw-r--r--sysdeps/x86_64/multiarch/memmove-avx512-unaligned-erms.S12
-rw-r--r--sysdeps/x86_64/multiarch/memmove-sse2-unaligned-erms.S33
-rw-r--r--sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S565
-rw-r--r--sysdeps/x86_64/multiarch/memmove.c58
-rw-r--r--sysdeps/x86_64/multiarch/memmove_chk-nonshared.S21
-rw-r--r--sysdeps/x86_64/multiarch/memmove_chk.c37
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S22
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy-avx512-no-vzeroupper.S22
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy-ssse3-back.S4
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy-ssse3.S4
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy.S86
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy.c42
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy_chk-nonshared.S21
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy_chk.S56
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy_chk.c31
-rw-r--r--sysdeps/x86_64/multiarch/memrchr-avx2.S359
-rw-r--r--sysdeps/x86_64/multiarch/memrchr-sse2.S26
-rw-r--r--sysdeps/x86_64/multiarch/memrchr.c31
-rw-r--r--sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms.S22
-rw-r--r--sysdeps/x86_64/multiarch/memset-avx2.S168
-rw-r--r--sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S6
-rw-r--r--sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S24
-rw-r--r--sysdeps/x86_64/multiarch/memset-sse2-unaligned-erms.S41
-rw-r--r--sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S274
-rw-r--r--sysdeps/x86_64/multiarch/memset.S64
-rw-r--r--sysdeps/x86_64/multiarch/memset.c35
-rw-r--r--sysdeps/x86_64/multiarch/memset_chk-nonshared.S21
-rw-r--r--sysdeps/x86_64/multiarch/memset_chk.S49
-rw-r--r--sysdeps/x86_64/multiarch/memset_chk.c31
-rw-r--r--sysdeps/x86_64/multiarch/rawmemchr-avx2.S4
-rw-r--r--sysdeps/x86_64/multiarch/rawmemchr-sse2.S29
-rw-r--r--sysdeps/x86_64/multiarch/rawmemchr.c38
-rw-r--r--sysdeps/x86_64/multiarch/sched_cpucount.c2
-rw-r--r--sysdeps/x86_64/multiarch/stpcpy-sse2.S33
-rw-r--r--sysdeps/x86_64/multiarch/stpcpy.S9
-rw-r--r--sysdeps/x86_64/multiarch/stpcpy.c42
-rw-r--r--sysdeps/x86_64/multiarch/stpncpy-c.c9
-rw-r--r--sysdeps/x86_64/multiarch/stpncpy.S8
-rw-r--r--sysdeps/x86_64/multiarch/stpncpy.c38
-rw-r--r--sysdeps/x86_64/multiarch/strcasecmp.c39
-rw-r--r--sysdeps/x86_64/multiarch/strcasecmp_l-avx.S22
-rw-r--r--sysdeps/x86_64/multiarch/strcasecmp_l-sse2.S23
-rw-r--r--sysdeps/x86_64/multiarch/strcasecmp_l-sse4_2.S21
-rw-r--r--sysdeps/x86_64/multiarch/strcasecmp_l.S8
-rw-r--r--sysdeps/x86_64/multiarch/strcasecmp_l.c40
-rw-r--r--sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S2
-rw-r--r--sysdeps/x86_64/multiarch/strcat-sse2.S28
-rw-r--r--sysdeps/x86_64/multiarch/strcat-ssse3.S2
-rw-r--r--sysdeps/x86_64/multiarch/strcat.S85
-rw-r--r--sysdeps/x86_64/multiarch/strcat.c35
-rw-r--r--sysdeps/x86_64/multiarch/strchr-avx2.S254
-rw-r--r--sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S2
-rw-r--r--sysdeps/x86_64/multiarch/strchr-sse2.S28
-rw-r--r--sysdeps/x86_64/multiarch/strchr.S57
-rw-r--r--sysdeps/x86_64/multiarch/strchr.c55
-rw-r--r--sysdeps/x86_64/multiarch/strchrnul-avx2.S3
-rw-r--r--sysdeps/x86_64/multiarch/strchrnul-sse2.S26
-rw-r--r--sysdeps/x86_64/multiarch/strchrnul.c34
-rw-r--r--sysdeps/x86_64/multiarch/strcmp-avx2.S847
-rw-r--r--sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S2
-rw-r--r--sysdeps/x86_64/multiarch/strcmp-sse2.S28
-rw-r--r--sysdeps/x86_64/multiarch/strcmp-sse42.S39
-rw-r--r--sysdeps/x86_64/multiarch/strcmp-sse4_2.S21
-rw-r--r--sysdeps/x86_64/multiarch/strcmp.S209
-rw-r--r--sysdeps/x86_64/multiarch/strcmp.c59
-rw-r--r--sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S6
-rw-r--r--sysdeps/x86_64/multiarch/strcpy-sse2.S28
-rw-r--r--sysdeps/x86_64/multiarch/strcpy-ssse3.S2
-rw-r--r--sysdeps/x86_64/multiarch/strcpy.S99
-rw-r--r--sysdeps/x86_64/multiarch/strcpy.c35
-rw-r--r--sysdeps/x86_64/multiarch/strcspn-c.c4
-rw-r--r--sysdeps/x86_64/multiarch/strcspn-sse2.S28
-rw-r--r--sysdeps/x86_64/multiarch/strcspn.S69
-rw-r--r--sysdeps/x86_64/multiarch/strcspn.c35
-rw-r--r--sysdeps/x86_64/multiarch/strlen-avx2.S393
-rw-r--r--sysdeps/x86_64/multiarch/strlen-sse2.S23
-rw-r--r--sysdeps/x86_64/multiarch/strlen.c34
-rw-r--r--sysdeps/x86_64/multiarch/strncase.c35
-rw-r--r--sysdeps/x86_64/multiarch/strncase_l-avx.S22
-rw-r--r--sysdeps/x86_64/multiarch/strncase_l-sse2.S23
-rw-r--r--sysdeps/x86_64/multiarch/strncase_l-sse4_2.S21
-rw-r--r--sysdeps/x86_64/multiarch/strncase_l.S8
-rw-r--r--sysdeps/x86_64/multiarch/strncase_l.c40
-rw-r--r--sysdeps/x86_64/multiarch/strncat-c.c8
-rw-r--r--sysdeps/x86_64/multiarch/strncat.S5
-rw-r--r--sysdeps/x86_64/multiarch/strncat.c35
-rw-r--r--sysdeps/x86_64/multiarch/strncmp-avx2.S3
-rw-r--r--sysdeps/x86_64/multiarch/strncmp-sse2.S30
-rw-r--r--sysdeps/x86_64/multiarch/strncmp-sse4_2.S21
-rw-r--r--sysdeps/x86_64/multiarch/strncmp-ssse3.S34
-rw-r--r--sysdeps/x86_64/multiarch/strncmp.S5
-rw-r--r--sysdeps/x86_64/multiarch/strncmp.c60
-rw-r--r--sysdeps/x86_64/multiarch/strncpy-c.c7
-rw-r--r--sysdeps/x86_64/multiarch/strncpy.S5
-rw-r--r--sysdeps/x86_64/multiarch/strncpy.c35
-rw-r--r--sysdeps/x86_64/multiarch/strnlen-avx2.S4
-rw-r--r--sysdeps/x86_64/multiarch/strnlen-sse2.S28
-rw-r--r--sysdeps/x86_64/multiarch/strnlen.c39
-rw-r--r--sysdeps/x86_64/multiarch/strpbrk-c.c12
-rw-r--r--sysdeps/x86_64/multiarch/strpbrk-sse2.S29
-rw-r--r--sysdeps/x86_64/multiarch/strpbrk.S5
-rw-r--r--sysdeps/x86_64/multiarch/strpbrk.c35
-rw-r--r--sysdeps/x86_64/multiarch/strrchr-avx2.S235
-rw-r--r--sysdeps/x86_64/multiarch/strrchr-sse2.S28
-rw-r--r--sysdeps/x86_64/multiarch/strrchr.c34
-rw-r--r--sysdeps/x86_64/multiarch/strspn-c.c4
-rw-r--r--sysdeps/x86_64/multiarch/strspn-sse2.S28
-rw-r--r--sysdeps/x86_64/multiarch/strspn.S50
-rw-r--r--sysdeps/x86_64/multiarch/strspn.c35
-rw-r--r--sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S2
-rw-r--r--sysdeps/x86_64/multiarch/strstr.c2
-rw-r--r--sysdeps/x86_64/multiarch/test-multiarch.c4
-rw-r--r--sysdeps/x86_64/multiarch/varshift.c2
-rw-r--r--sysdeps/x86_64/multiarch/varshift.h2
-rw-r--r--sysdeps/x86_64/multiarch/wcschr-avx2.S3
-rw-r--r--sysdeps/x86_64/multiarch/wcschr-sse2.S30
-rw-r--r--sysdeps/x86_64/multiarch/wcschr.c39
-rw-r--r--sysdeps/x86_64/multiarch/wcscmp-avx2.S4
-rw-r--r--sysdeps/x86_64/multiarch/wcscmp-sse2.S23
-rw-r--r--sysdeps/x86_64/multiarch/wcscmp.c37
-rw-r--r--sysdeps/x86_64/multiarch/wcscpy-ssse3.S2
-rw-r--r--sysdeps/x86_64/multiarch/wcscpy.S40
-rw-r--r--sysdeps/x86_64/multiarch/wcscpy.c44
-rw-r--r--sysdeps/x86_64/multiarch/wcslen-avx2.S4
-rw-r--r--sysdeps/x86_64/multiarch/wcslen-sse2.S26
-rw-r--r--sysdeps/x86_64/multiarch/wcslen.c31
-rw-r--r--sysdeps/x86_64/multiarch/wcsncmp-avx2.S5
-rw-r--r--sysdeps/x86_64/multiarch/wcsncmp-sse2.c20
-rw-r--r--sysdeps/x86_64/multiarch/wcsncmp.c31
-rw-r--r--sysdeps/x86_64/multiarch/wcsnlen-avx2.S5
-rw-r--r--sysdeps/x86_64/multiarch/wcsnlen-c.c9
-rw-r--r--sysdeps/x86_64/multiarch/wcsnlen-sse4_1.S5
-rw-r--r--sysdeps/x86_64/multiarch/wcsnlen.c51
-rw-r--r--sysdeps/x86_64/multiarch/wcsrchr-avx2.S3
-rw-r--r--sysdeps/x86_64/multiarch/wcsrchr-sse2.S23
-rw-r--r--sysdeps/x86_64/multiarch/wcsrchr.c29
-rw-r--r--sysdeps/x86_64/multiarch/wmemchr-avx2.S4
-rw-r--r--sysdeps/x86_64/multiarch/wmemchr-sse2.S4
-rw-r--r--sysdeps/x86_64/multiarch/wmemchr.c39
-rw-r--r--sysdeps/x86_64/multiarch/wmemcmp-avx2-movbe.S4
-rw-r--r--sysdeps/x86_64/multiarch/wmemcmp.S44
-rw-r--r--sysdeps/x86_64/multiarch/wmemcmp.c30
-rw-r--r--sysdeps/x86_64/multiarch/wmemset.c40
-rw-r--r--sysdeps/x86_64/multiarch/wmemset_chk-nonshared.S21
-rw-r--r--sysdeps/x86_64/multiarch/wmemset_chk.c31
-rw-r--r--sysdeps/x86_64/nptl/Makefile2
-rw-r--r--sysdeps/x86_64/nptl/pthread-offsets.h5
-rw-r--r--sysdeps/x86_64/nptl/pthread_spin_lock.S2
-rw-r--r--sysdeps/x86_64/nptl/pthread_spin_trylock.S2
-rw-r--r--sysdeps/x86_64/nptl/pthread_spin_unlock.S2
-rw-r--r--sysdeps/x86_64/nptl/pthreaddef.h2
-rw-r--r--sysdeps/x86_64/nptl/tcb-offsets.sym6
-rw-r--r--sysdeps/x86_64/nptl/tls.h59
-rw-r--r--sysdeps/x86_64/rawmemchr.S7
-rw-r--r--sysdeps/x86_64/rshift.S2
-rw-r--r--sysdeps/x86_64/rtld-offsets.sym6
-rw-r--r--sysdeps/x86_64/sched_cpucount.c2
-rw-r--r--sysdeps/x86_64/setjmp.S27
-rw-r--r--sysdeps/x86_64/stackinfo.h2
-rw-r--r--sysdeps/x86_64/start.S19
-rw-r--r--sysdeps/x86_64/strcasecmp_l-nonascii.c2
-rw-r--r--sysdeps/x86_64/strcat.S2
-rw-r--r--sysdeps/x86_64/strchr.S2
-rw-r--r--sysdeps/x86_64/strchrnul.S2
-rw-r--r--sysdeps/x86_64/strcmp.S4
-rw-r--r--sysdeps/x86_64/strcpy.S2
-rw-r--r--sysdeps/x86_64/strcspn.S7
-rw-r--r--sysdeps/x86_64/strlen.S63
-rw-r--r--sysdeps/x86_64/strncase_l-nonascii.c2
-rw-r--r--sysdeps/x86_64/strpbrk.S1
-rw-r--r--sysdeps/x86_64/strrchr.S2
-rw-r--r--sysdeps/x86_64/strspn.S2
-rw-r--r--sysdeps/x86_64/strtok.S208
-rw-r--r--sysdeps/x86_64/strtok_r.S5
-rw-r--r--sysdeps/x86_64/sub_n.S2
-rw-r--r--sysdeps/x86_64/submul_1.S2
-rw-r--r--sysdeps/x86_64/sysdep.h55
-rw-r--r--sysdeps/x86_64/tls_get_addr.S61
-rw-r--r--sysdeps/x86_64/tlsdesc.c3
-rw-r--r--sysdeps/x86_64/tlsdesc.sym3
-rw-r--r--sysdeps/x86_64/tst-audit.h2
-rw-r--r--sysdeps/x86_64/tst-audit10-aux.c41
-rw-r--r--sysdeps/x86_64/tst-audit10.c38
-rw-r--r--sysdeps/x86_64/tst-audit4-aux.c39
-rw-r--r--sysdeps/x86_64/tst-audit4.c45
-rw-r--r--sysdeps/x86_64/tst-auditmod10a.c2
-rw-r--r--sysdeps/x86_64/tst-auditmod10b.c4
-rw-r--r--sysdeps/x86_64/tst-auditmod3b.c2
-rw-r--r--sysdeps/x86_64/tst-auditmod4b.c2
-rw-r--r--sysdeps/x86_64/tst-auditmod5b.c2
-rw-r--r--sysdeps/x86_64/tst-auditmod6b.c2
-rw-r--r--sysdeps/x86_64/tst-auditmod6c.c2
-rw-r--r--sysdeps/x86_64/tst-auditmod7b.c2
-rw-r--r--sysdeps/x86_64/tst-avx-aux.c47
-rw-r--r--sysdeps/x86_64/tst-avx.c49
-rw-r--r--sysdeps/x86_64/tst-avx512-aux.c48
-rw-r--r--sysdeps/x86_64/tst-avx512.c57
-rw-r--r--sysdeps/x86_64/tst-avx512mod.c48
-rw-r--r--sysdeps/x86_64/tst-avxmod.c48
-rw-r--r--sysdeps/x86_64/tst-mallocalign1.c2
-rw-r--r--sysdeps/x86_64/tst-platform-1.c29
-rw-r--r--sysdeps/x86_64/tst-platformmod-1.c23
-rw-r--r--sysdeps/x86_64/tst-platformmod-2.c23
-rw-r--r--sysdeps/x86_64/tst-quad1.c2
-rw-r--r--sysdeps/x86_64/tst-quadmod1.S8
-rw-r--r--sysdeps/x86_64/tst-quadmod2.S8
-rw-r--r--sysdeps/x86_64/tst-sse.c46
-rw-r--r--sysdeps/x86_64/tst-ssemod.c46
-rw-r--r--sysdeps/x86_64/tst-stack-align.h2
-rw-r--r--sysdeps/x86_64/tst-x86_64-1.c26
-rw-r--r--sysdeps/x86_64/tst-x86_64mod-1.c22
-rw-r--r--sysdeps/x86_64/wcschr.S2
-rw-r--r--sysdeps/x86_64/wcscmp.S4
-rw-r--r--sysdeps/x86_64/wcslen.S2
-rw-r--r--sysdeps/x86_64/wcsrchr.S2
-rw-r--r--sysdeps/x86_64/wmemset.S1
-rw-r--r--sysdeps/x86_64/wmemset_chk.S33
-rw-r--r--sysdeps/x86_64/wordcopy.c1
-rw-r--r--sysdeps/x86_64/x32/dl-machine.h2
-rw-r--r--sysdeps/x86_64/x32/fpu/s_lrint.S5
-rw-r--r--sysdeps/x86_64/x32/fpu/s_lrintf.S5
-rw-r--r--sysdeps/x86_64/x32/fpu/s_lrintl.S5
-rw-r--r--sysdeps/x86_64/x32/gmp-mparam.h2
-rw-r--r--sysdeps/x86_64/x32/nptl/tls.h46
-rw-r--r--sysdeps/x86_64/x32/sysdep.h2
9047 files changed, 165663 insertions, 126019 deletions
diff --git a/sysdeps/aarch64/Implies b/sysdeps/aarch64/Implies
index e5adf4d63c..a1d5e2e742 100644
--- a/sysdeps/aarch64/Implies
+++ b/sysdeps/aarch64/Implies
@@ -3,4 +3,3 @@ ieee754/ldbl-128
ieee754/dbl-64/wordsize-64
ieee754/dbl-64
ieee754/flt-32
-aarch64/soft-fp
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile
index 06323550e9..94baaf52dd 100644
--- a/sysdeps/aarch64/Makefile
+++ b/sysdeps/aarch64/Makefile
@@ -1,9 +1,5 @@
long-double-fcts = yes
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
-
ifeq ($(subdir),elf)
sysdep-dl-routines += tlsdesc dl-tlsdesc
gen-as-const-headers += dl-link.sym
@@ -12,3 +8,11 @@ endif
ifeq ($(subdir),csu)
gen-as-const-headers += tlsdesc.sym
endif
+
+ifeq ($(subdir),gmon)
+CFLAGS-mcount.c += -mgeneral-regs-only
+endif
+
+ifeq ($(subdir),math)
+CPPFLAGS += -I../soft-fp
+endif
diff --git a/sysdeps/aarch64/__longjmp.S b/sysdeps/aarch64/__longjmp.S
index 65116be557..3365bd70f9 100644
--- a/sysdeps/aarch64/__longjmp.S
+++ b/sysdeps/aarch64/__longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -46,6 +46,8 @@ ENTRY (__longjmp)
cfi_offset(d14, JB_D14<<3)
cfi_offset(d15, JB_D15<<3)
+ DELOUSE (0)
+
ldp x19, x20, [x0, #JB_X19<<3]
ldp x21, x22, [x0, #JB_X21<<3]
ldp x23, x24, [x0, #JB_X23<<3]
@@ -53,7 +55,7 @@ ENTRY (__longjmp)
ldp x27, x28, [x0, #JB_X27<<3]
#ifdef PTR_DEMANGLE
ldp x29, x4, [x0, #JB_X29<<3]
- PTR_DEMANGLE (x30, x4, x3, x2)
+ PTR_DEMANGLE (30, 4, 3, 2)
#else
ldp x29, x30, [x0, #JB_X29<<3]
#endif
@@ -98,7 +100,7 @@ ENTRY (__longjmp)
cfi_same_value(d15)
#ifdef PTR_DEMANGLE
ldr x4, [x0, #JB_SP<<3]
- PTR_DEMANGLE (x5, x4, x3, x2)
+ PTR_DEMANGLE (5, 4, 3, 2)
#else
ldr x5, [x0, #JB_SP<<3]
#endif
diff --git a/sysdeps/aarch64/atomic-machine.h b/sysdeps/aarch64/atomic-machine.h
index 28c80dc42d..63b24e625c 100644
--- a/sysdeps/aarch64/atomic-machine.h
+++ b/sysdeps/aarch64/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -38,6 +38,7 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 1
#define USE_ATOMIC_COMPILER_BUILTINS 1
+#define ATOMIC_EXCHANGE_USES_CAS 0
/* Compare and exchange.
For all "bool" routines, we return FALSE if exchange succesful. */
@@ -115,10 +116,6 @@ typedef uintmax_t uatomic_max_t;
/* Compare and exchange with "release" semantics, ie barrier before. */
-# define atomic_compare_and_exchange_bool_rel(mem, new, old) \
- __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
- mem, new, old, __ATOMIC_RELEASE)
-
# define atomic_compare_and_exchange_val_rel(mem, new, old) \
__atomic_val_bysize (__arch_compare_and_exchange_val, int, \
mem, new, old, __ATOMIC_RELEASE)
diff --git a/sysdeps/aarch64/backtrace.c b/sysdeps/aarch64/backtrace.c
deleted file mode 100644
index 27ce597b39..0000000000
--- a/sysdeps/aarch64/backtrace.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/x86_64/backtrace.c>
diff --git a/sysdeps/aarch64/bits/endian.h b/sysdeps/aarch64/bits/endian.h
index a32ebc0d80..1f18733422 100644
--- a/sysdeps/aarch64/bits/endian.h
+++ b/sysdeps/aarch64/bits/endian.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/bits/fenv.h b/sysdeps/aarch64/bits/fenv.h
index aced0d33b2..8a0f481f79 100644
--- a/sysdeps/aarch64/bits/fenv.h
+++ b/sysdeps/aarch64/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -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/sysdeps/aarch64/bits/fp-fast.h b/sysdeps/aarch64/bits/fp-fast.h
new file mode 100644
index 0000000000..3ce12210b7
--- /dev/null
+++ b/sysdeps/aarch64/bits/fp-fast.h
@@ -0,0 +1,34 @@
+/* Define FP_FAST_* macros. AArch64 version.
+ Copyright (C) 2016-2018 Free Software 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/fp-fast.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __USE_ISOC99
+
+/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l}
+ builtins are supported. */
+# define FP_FAST_FMA 1
+# define FP_FAST_FMAF 1
+
+# ifdef __FP_FAST_FMAL
+# define FP_FAST_FMAL 1
+# endif
+
+#endif
diff --git a/sysdeps/aarch64/bits/link.h b/sysdeps/aarch64/bits/link.h
index 0bf961519e..5a7fc1ccd4 100644
--- a/sysdeps/aarch64/bits/link.h
+++ b/sysdeps/aarch64/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/bits/mathdef.h b/sysdeps/aarch64/bits/mathdef.h
deleted file mode 100644
index db992fccc1..0000000000
--- a/sysdeps/aarch64/bits/mathdef.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* GCC does not promote `float' values to `double'. */
-typedef float float_t; /* `float' expressions are evaluated as
- `float'. */
-typedef double double_t; /* `double' expressions are evaluated as
- `double'. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647)
-# define FP_ILOGBNAN (2147483647)
-
-# define FP_FAST_FMA 1
-# define FP_FAST_FMAF 1
-
-#endif /* ISO C99 */
diff --git a/sysdeps/aarch64/bits/setjmp.h b/sysdeps/aarch64/bits/setjmp.h
index fff8616c60..1685f1076a 100644
--- a/sysdeps/aarch64/bits/setjmp.h
+++ b/sysdeps/aarch64/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/bits/string.h b/sysdeps/aarch64/bits/string.h
deleted file mode 100644
index 0a508f72c0..0000000000
--- a/sysdeps/aarch64/bits/string.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Optimized, inlined string functions. AArch64 version.
- Copyright (C) 2015-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 _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* AArch64 uses the aligned string inline ABI. */
-#define _STRING_INLINE_unaligned 0
diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
new file mode 100644
index 0000000000..ea7eecdf92
--- /dev/null
+++ b/sysdeps/aarch64/bits/wordsize.h
@@ -0,0 +1,28 @@
+/* Determine the wordsize from the preprocessor defines.
+
+ Copyright (C) 2016-2018 Free Software 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 __LP64__
+# define __WORDSIZE 64
+#else
+# define __WORDSIZE 32
+# define __WORDSIZE32_SIZE_ULONG 1
+# define __WORDSIZE32_PTRDIFF_LONG 1
+#endif
+
+#define __WORDSIZE_TIME64_COMPAT32 0
diff --git a/sysdeps/aarch64/crti.S b/sysdeps/aarch64/crti.S
index 53ccb42587..2b213758b2 100644
--- a/sysdeps/aarch64/crti.S
+++ b/sysdeps/aarch64/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for AArch64.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -39,6 +39,7 @@
they can be called as functions. The symbols _init and _fini are
magic and cause the linker to emit DT_INIT and DT_FINI. */
+#include <sysdep.h>
#include <libc-symbols.h>
#ifndef PREINIT_FUNCTION
@@ -60,7 +61,7 @@
.type call_weak_fn, %function
call_weak_fn:
adrp x0, :got:PREINIT_FUNCTION
- ldr x0, [x0, #:got_lo12:PREINIT_FUNCTION]
+ ldr PTR_REG (0), [x0, #:got_lo12:PREINIT_FUNCTION]
cbz x0, 1f
b PREINIT_FUNCTION
1:
@@ -71,6 +72,7 @@ call_weak_fn:
.section .init,"ax",%progbits
.align 2
.global _init
+ .hidden _init
.type _init, %function
_init:
stp x29, x30, [sp, -16]!
@@ -84,6 +86,7 @@ _init:
.section .fini,"ax",%progbits
.align 2
.global _fini
+ .hidden _fini
.type _fini, %function
_fini:
stp x29, x30, [sp, -16]!
diff --git a/sysdeps/aarch64/crtn.S b/sysdeps/aarch64/crtn.S
index 33d5f3d822..d72300af80 100644
--- a/sysdeps/aarch64/crtn.S
+++ b/sysdeps/aarch64/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for AArch64.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/dl-irel.h b/sysdeps/aarch64/dl-irel.h
index 63a8e506eb..5889ee187b 100644
--- a/sysdeps/aarch64/dl-irel.h
+++ b/sysdeps/aarch64/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
AArch64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <unistd.h>
#include <ldsodefs.h>
+#include <sysdep.h>
#define ELF_MACHINE_IRELA 1
@@ -30,7 +31,7 @@ static inline ElfW(Addr)
__attribute ((always_inline))
elf_ifunc_invoke (ElfW(Addr) addr)
{
- return ((ElfW(Addr) (*) (unsigned long int)) (addr)) (GLRO(dl_hwcap));
+ return ((ElfW(Addr) (*) (uint64_t)) (addr)) (GLRO(dl_hwcap));
}
static inline void
@@ -40,7 +41,7 @@ elf_irela (const ElfW(Rela) *reloc)
ElfW(Addr) *const reloc_addr = (void *) reloc->r_offset;
const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
- if (__glibc_likely (r_type == R_AARCH64_IRELATIVE))
+ if (__glibc_likely (r_type == AARCH64_R(IRELATIVE)))
{
ElfW(Addr) value = elf_ifunc_invoke (reloc->r_addend);
*reloc_addr = value;
diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h
index 282805e396..4935aa7c54 100644
--- a/sysdeps/aarch64/dl-machine.h
+++ b/sysdeps/aarch64/dl-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -21,9 +21,11 @@
#define ELF_MACHINE_NAME "aarch64"
+#include <sysdep.h>
#include <tls.h>
#include <dl-tlsdesc.h>
#include <dl-irel.h>
+#include <cpu-features.c>
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int __attribute__ ((unused))
@@ -49,26 +51,11 @@ elf_machine_load_address (void)
/* To figure out the load address we use the definition that for any symbol:
dynamic_addr(symbol) = static_addr(symbol) + load_addr
- The choice of symbol is arbitrary. The static address we obtain
- by constructing a non GOT reference to the symbol, the dynamic
- address of the symbol we compute using adrp/add to compute the
- symbol's address relative to the PC.
- This depends on 32bit relocations being resolved at link time
- and that the static address fits in the 32bits. */
-
- ElfW(Addr) static_addr;
- ElfW(Addr) dynamic_addr;
-
- asm (" \n"
-" adrp %1, _dl_start; \n"
-" add %1, %1, #:lo12:_dl_start \n"
-" ldr %w0, 1f \n"
-" b 2f \n"
-"1: \n"
-" .word _dl_start \n"
-"2: \n"
- : "=r" (static_addr), "=r" (dynamic_addr));
- return dynamic_addr - static_addr;
+ _DYNAMIC sysmbol is used here as its link-time address stored in
+ the special unrelocated first GOT entry. */
+
+ extern ElfW(Dyn) _DYNAMIC[] attribute_hidden;
+ return (ElfW(Addr)) &_DYNAMIC - elf_machine_dynamic ();
}
/* Set up the loaded object described by L so its unrelocated PLT
@@ -115,97 +102,117 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
}
}
- if (l->l_info[ADDRIDX (DT_TLSDESC_GOT)] && lazy)
- *(ElfW(Addr)*)(D_PTR (l, l_info[ADDRIDX (DT_TLSDESC_GOT)]) + l->l_addr)
- = (ElfW(Addr)) &_dl_tlsdesc_resolve_rela;
-
return lazy;
}
/* Initial entry point for the dynamic linker. The C function
_dl_start is the real entry point, its return value is the user
program's entry point */
+#ifdef __LP64__
+# define RTLD_START RTLD_START_1 ("x", "3", "sp")
+#else
+# define RTLD_START RTLD_START_1 ("w", "2", "wsp")
+#endif
-#define RTLD_START asm ("\
-.text \n\
-.globl _start \n\
-.type _start, %function \n\
-.globl _dl_start_user \n\
-.type _dl_start_user, %function \n\
-_start: \n\
- mov x0, sp \n\
- bl _dl_start \n\
- // returns user entry point in x0 \n\
- mov x21, x0 \n\
-_dl_start_user: \n\
- // get the original arg count \n\
- ldr x1, [sp] \n\
- // get the argv address \n\
- add x2, sp, #8 \n\
- // get _dl_skip_args to see if we were \n\
- // invoked as an executable \n\
- adrp x4, _dl_skip_args \n\
- ldr w4, [x4, #:lo12:_dl_skip_args] \n\
- // do we need to adjust argc/argv \n\
- cmp w4, 0 \n\
- beq .L_done_stack_adjust \n\
- // subtract _dl_skip_args from original arg count \n\
- sub x1, x1, x4 \n\
- // store adjusted argc back to stack \n\
- str x1, [sp] \n\
- // find the first unskipped argument \n\
- mov x3, x2 \n\
- add x4, x2, x4, lsl #3 \n\
- // shuffle argv down \n\
-1: ldr x5, [x4], #8 \n\
- str x5, [x3], #8 \n\
- cmp x5, #0 \n\
- bne 1b \n\
- // shuffle envp down \n\
-1: ldr x5, [x4], #8 \n\
- str x5, [x3], #8 \n\
- cmp x5, #0 \n\
- bne 1b \n\
- // shuffle auxv down \n\
-1: ldp x0, x5, [x4, #16]! \n\
- stp x0, x5, [x3], #16 \n\
- cmp x0, #0 \n\
- bne 1b \n\
- // Update _dl_argv \n\
- adrp x3, _dl_argv \n\
- str x2, [x3, #:lo12:_dl_argv] \n\
-.L_done_stack_adjust: \n\
- // compute envp \n\
- add x3, x2, x1, lsl #3 \n\
- add x3, x3, #8 \n\
- adrp x16, _rtld_local \n\
- add x16, x16, #:lo12:_rtld_local \n\
- ldr x0, [x16] \n\
- bl _dl_init \n\
- // load the finalizer function \n\
- adrp x0, _dl_fini \n\
- add x0, x0, #:lo12:_dl_fini \n\
- // jump to the user_s entry point \n\
- br x21 \n\
+
+#define RTLD_START_1(PTR, PTR_SIZE_LOG, PTR_SP) asm ("\
+.text \n\
+.globl _start \n\
+.type _start, %function \n\
+.globl _dl_start_user \n\
+.type _dl_start_user, %function \n\
+_start: \n\
+ mov " PTR "0, " PTR_SP " \n\
+ bl _dl_start \n\
+ // returns user entry point in x0 \n\
+ mov x21, x0 \n\
+_dl_start_user: \n\
+ // get the original arg count \n\
+ ldr " PTR "1, [sp] \n\
+ // get the argv address \n\
+ add " PTR "2, " PTR_SP ", #(1<<" PTR_SIZE_LOG ") \n\
+ // get _dl_skip_args to see if we were \n\
+ // invoked as an executable \n\
+ adrp x4, _dl_skip_args \n\
+ ldr w4, [x4, #:lo12:_dl_skip_args] \n\
+ // do we need to adjust argc/argv \n\
+ cmp w4, 0 \n\
+ beq .L_done_stack_adjust \n\
+ // subtract _dl_skip_args from original arg count \n\
+ sub " PTR "1, " PTR "1, " PTR "4 \n\
+ // store adjusted argc back to stack \n\
+ str " PTR "1, [sp] \n\
+ // find the first unskipped argument \n\
+ mov " PTR "3, " PTR "2 \n\
+ add " PTR "4, " PTR "2, " PTR "4, lsl #" PTR_SIZE_LOG " \n\
+ // shuffle argv down \n\
+1: ldr " PTR "5, [x4], #(1<<" PTR_SIZE_LOG ") \n\
+ str " PTR "5, [x3], #(1<<" PTR_SIZE_LOG ") \n\
+ cmp " PTR "5, #0 \n\
+ bne 1b \n\
+ // shuffle envp down \n\
+1: ldr " PTR "5, [x4], #(1<<" PTR_SIZE_LOG ") \n\
+ str " PTR "5, [x3], #(1<<" PTR_SIZE_LOG ") \n\
+ cmp " PTR "5, #0 \n\
+ bne 1b \n\
+ // shuffle auxv down \n\
+1: ldp " PTR "0, " PTR "5, [x4, #(2<<" PTR_SIZE_LOG ")]! \n\
+ stp " PTR "0, " PTR "5, [x3], #(2<<" PTR_SIZE_LOG ") \n\
+ cmp " PTR "0, #0 \n\
+ bne 1b \n\
+ // Update _dl_argv \n\
+ adrp x3, __GI__dl_argv \n\
+ str " PTR "2, [x3, #:lo12:__GI__dl_argv] \n\
+.L_done_stack_adjust: \n\
+ // compute envp \n\
+ add " PTR "3, " PTR "2, " PTR "1, lsl #" PTR_SIZE_LOG " \n\
+ add " PTR "3, " PTR "3, #(1<<" PTR_SIZE_LOG ") \n\
+ adrp x16, _rtld_local \n\
+ add " PTR "16, " PTR "16, #:lo12:_rtld_local \n\
+ ldr " PTR "0, [x16] \n\
+ bl _dl_init \n\
+ // load the finalizer function \n\
+ adrp x0, _dl_fini \n\
+ add " PTR "0, " PTR "0, #:lo12:_dl_fini \n\
+ // jump to the user_s entry point \n\
+ br x21 \n\
");
#define elf_machine_type_class(type) \
- ((((type) == R_AARCH64_JUMP_SLOT || \
- (type) == R_AARCH64_TLS_DTPMOD || \
- (type) == R_AARCH64_TLS_DTPREL || \
- (type) == R_AARCH64_TLS_TPREL || \
- (type) == R_AARCH64_TLSDESC) * ELF_RTYPE_CLASS_PLT) \
- | (((type) == R_AARCH64_COPY) * ELF_RTYPE_CLASS_COPY) \
- | (((type) == R_AARCH64_GLOB_DAT) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA))
+ ((((type) == AARCH64_R(JUMP_SLOT) \
+ || (type) == AARCH64_R(TLS_DTPMOD) \
+ || (type) == AARCH64_R(TLS_DTPREL) \
+ || (type) == AARCH64_R(TLS_TPREL) \
+ || (type) == AARCH64_R(TLSDESC)) * ELF_RTYPE_CLASS_PLT) \
+ | (((type) == AARCH64_R(COPY)) * ELF_RTYPE_CLASS_COPY) \
+ | (((type) == AARCH64_R(GLOB_DAT)) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA))
-#define ELF_MACHINE_JMP_SLOT R_AARCH64_JUMP_SLOT
+#define ELF_MACHINE_JMP_SLOT AARCH64_R(JUMP_SLOT)
/* AArch64 uses RELA not REL */
#define ELF_MACHINE_NO_REL 1
#define ELF_MACHINE_NO_RELA 0
+#define DL_PLATFORM_INIT dl_platform_init ()
+
+static inline void __attribute__ ((unused))
+dl_platform_init (void)
+{
+ if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
+ /* Avoid an empty string which would disturb us. */
+ GLRO(dl_platform) = NULL;
+
+#ifdef SHARED
+ /* init_cpu_features has been called early from __libc_start_main in
+ static executable. */
+ init_cpu_features (&GLRO(dl_aarch64_cpu_features));
+#endif
+}
+
+
static inline ElfW(Addr)
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const ElfW(Rela) *reloc,
ElfW(Addr) *reloc_addr,
ElfW(Addr) value)
@@ -237,9 +244,9 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
void *const reloc_addr_arg, int skip_ifunc)
{
ElfW(Addr) *const reloc_addr = reloc_addr_arg;
- const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
+ const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info);
- if (__builtin_expect (r_type == R_AARCH64_RELATIVE, 0))
+ if (__builtin_expect (r_type == AARCH64_R(RELATIVE), 0))
*reloc_addr = map->l_addr + reloc->r_addend;
else if (__builtin_expect (r_type == R_AARCH64_NONE, 0))
return;
@@ -247,7 +254,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
{
const ElfW(Sym) *const refsym = sym;
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- ElfW(Addr) value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ ElfW(Addr) value = SYMBOL_ADDRESS (sym_map, sym, true);
if (sym != NULL
&& __glibc_unlikely (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC)
@@ -257,7 +264,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
switch (r_type)
{
- case R_AARCH64_COPY:
+ case AARCH64_R(COPY):
if (sym == NULL)
break;
@@ -272,18 +279,21 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
RTLD_PROGNAME, strtab + refsym->st_name);
}
memcpy (reloc_addr_arg, (void *) value,
- MIN (sym->st_size, refsym->st_size));
+ sym->st_size < refsym->st_size
+ ? sym->st_size : refsym->st_size);
break;
- case R_AARCH64_RELATIVE:
- case R_AARCH64_GLOB_DAT:
- case R_AARCH64_JUMP_SLOT:
- case R_AARCH64_ABS32:
- case R_AARCH64_ABS64:
+ case AARCH64_R(RELATIVE):
+ case AARCH64_R(GLOB_DAT):
+ case AARCH64_R(JUMP_SLOT):
+ case AARCH64_R(ABS32):
+#ifdef __LP64__
+ case AARCH64_R(ABS64):
+#endif
*reloc_addr = value + reloc->r_addend;
break;
- case R_AARCH64_TLSDESC:
+ case AARCH64_R(TLSDESC):
{
struct tlsdesc volatile *td =
(struct tlsdesc volatile *)reloc_addr;
@@ -318,7 +328,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
break;
}
- case R_AARCH64_TLS_DTPMOD:
+ case AARCH64_R(TLS_DTPMOD):
#ifdef RTLD_BOOTSTRAP
*reloc_addr = 1;
#else
@@ -329,12 +339,12 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
#endif
break;
- case R_AARCH64_TLS_DTPREL:
+ case AARCH64_R(TLS_DTPREL):
if (sym)
*reloc_addr = sym->st_value + reloc->r_addend;
break;
- case R_AARCH64_TLS_TPREL:
+ case AARCH64_R(TLS_TPREL):
if (sym)
{
CHECK_STATIC_TLS (map, sym_map);
@@ -343,7 +353,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
}
break;
- case R_AARCH64_IRELATIVE:
+ case AARCH64_R(IRELATIVE):
value = map->l_addr + reloc->r_addend;
value = elf_ifunc_invoke (value);
*reloc_addr = value;
@@ -374,25 +384,34 @@ elf_machine_lazy_rel (struct link_map *map,
int skip_ifunc)
{
ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset);
- const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
+ const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info);
/* Check for unexpected PLT reloc type. */
- if (__builtin_expect (r_type == R_AARCH64_JUMP_SLOT, 1))
+ if (__builtin_expect (r_type == AARCH64_R(JUMP_SLOT), 1))
{
if (__builtin_expect (map->l_mach.plt, 0) == 0)
*reloc_addr += l_addr;
else
*reloc_addr = map->l_mach.plt;
}
- else if (__builtin_expect (r_type == R_AARCH64_TLSDESC, 1))
+ else if (__builtin_expect (r_type == AARCH64_R(TLSDESC), 1))
{
- struct tlsdesc volatile *td =
- (struct tlsdesc volatile *)reloc_addr;
+ const Elf_Symndx symndx = ELFW (R_SYM) (reloc->r_info);
+ const ElfW (Sym) *symtab = (const void *)D_PTR (map, l_info[DT_SYMTAB]);
+ const ElfW (Sym) *sym = &symtab[symndx];
+ const struct r_found_version *version = NULL;
+
+ if (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL)
+ {
+ const ElfW (Half) *vernum =
+ (const void *)D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]);
+ version = &map->l_versions[vernum[symndx] & 0x7fff];
+ }
- td->arg = (void*)reloc;
- td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)])
- + map->l_addr);
+ /* Always initialize TLS descriptors completely, because lazy
+ initialization requires synchronization at every TLS access. */
+ elf_machine_rela (map, reloc, sym, version, reloc_addr, skip_ifunc);
}
- else if (__glibc_unlikely (r_type == R_AARCH64_IRELATIVE))
+ else if (__glibc_unlikely (r_type == AARCH64_R(IRELATIVE)))
{
ElfW(Addr) value = map->l_addr + reloc->r_addend;
if (__glibc_likely (!skip_ifunc))
diff --git a/sysdeps/aarch64/dl-sysdep.h b/sysdeps/aarch64/dl-sysdep.h
index 9c05d4b0dc..a0e6a2eed1 100644
--- a/sysdeps/aarch64/dl-sysdep.h
+++ b/sysdeps/aarch64/dl-sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/dl-tls.h b/sysdeps/aarch64/dl-tls.h
index 71265c5341..153fded939 100644
--- a/sysdeps/aarch64/dl-tls.h
+++ b/sysdeps/aarch64/dl-tls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -25,6 +25,3 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S
index 05be370abb..43a62ef307 100644
--- a/sysdeps/aarch64/dl-tlsdesc.S
+++ b/sysdeps/aarch64/dl-tlsdesc.S
@@ -1,6 +1,6 @@
/* Thread-local storage handling in the ELF dynamic linker.
AArch64 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -74,34 +74,12 @@
cfi_startproc
.align 2
_dl_tlsdesc_return:
- ldr x0, [x0, #8]
+ DELOUSE (0)
+ ldr PTR_REG (0), [x0, #PTR_SIZE]
RET
cfi_endproc
.size _dl_tlsdesc_return, .-_dl_tlsdesc_return
- /* Same as _dl_tlsdesc_return but with synchronization for
- lazy relocation.
- Prototype:
- _dl_tlsdesc_return_lazy (tlsdesc *) ;
- */
- .hidden _dl_tlsdesc_return_lazy
- .global _dl_tlsdesc_return_lazy
- .type _dl_tlsdesc_return_lazy,%function
- cfi_startproc
- .align 2
-_dl_tlsdesc_return_lazy:
- /* The ldar here happens after the load from [x0] at the call site
- (that is generated by the compiler as part of the TLS access ABI),
- so it reads the same value (this function is the final value of
- td->entry) and thus it synchronizes with the release store to
- td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load
- from [x0,#8] here happens after the initialization of td->arg. */
- ldar xzr, [x0]
- ldr x0, [x0, #8]
- RET
- cfi_endproc
- .size _dl_tlsdesc_return_lazy, .-_dl_tlsdesc_return_lazy
-
/* Handler for undefined weak TLS symbols.
Prototype:
_dl_tlsdesc_undefweak (tlsdesc *);
@@ -119,16 +97,10 @@ _dl_tlsdesc_return_lazy:
_dl_tlsdesc_undefweak:
str x1, [sp, #-16]!
cfi_adjust_cfa_offset (16)
- /* The ldar here happens after the load from [x0] at the call site
- (that is generated by the compiler as part of the TLS access ABI),
- so it reads the same value (this function is the final value of
- td->entry) and thus it synchronizes with the release store to
- td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load
- from [x0,#8] here happens after the initialization of td->arg. */
- ldar xzr, [x0]
- ldr x0, [x0, #8]
+ DELOUSE (0)
+ ldr PTR_REG (0), [x0, #PTR_SIZE]
mrs x1, tpidr_el0
- sub x0, x0, x1
+ sub PTR_REG (0), PTR_REG (0), PTR_REG (1)
ldr x1, [sp], #16
cfi_adjust_cfa_offset (-16)
RET
@@ -151,7 +123,7 @@ _dl_tlsdesc_undefweak:
_dl_tlsdesc_dynamic (struct tlsdesc *tdp)
{
struct tlsdesc_dynamic_arg *td = tdp->arg;
- dtv_t *dtv = *(dtv_t **)((char *)__thread_pointer + DTV_OFFSET);
+ dtv_t *dtv = *(dtv_t **)((char *)__thread_pointer + TCBHEAD_DTV);
if (__builtin_expect (td->gen_count <= dtv[0].counter
&& (dtv[td->tlsinfo.ti_module].pointer.val
!= TLS_DTV_UNALLOCATED),
@@ -170,46 +142,37 @@ _dl_tlsdesc_undefweak:
cfi_startproc
.align 2
_dl_tlsdesc_dynamic:
-# define NSAVEXREGPAIRS 2
- stp x29, x30, [sp,#-(32+16*NSAVEXREGPAIRS)]!
- cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
- mov x29, sp
+ DELOUSE (0)
/* Save just enough registers to support fast path, if we fall
into slow path we will save additional registers. */
-
- stp x1, x2, [sp, #32+16*0]
- stp x3, x4, [sp, #32+16*1]
+ stp x1, x2, [sp, #-32]!
+ stp x3, x4, [sp, #16]
+ cfi_adjust_cfa_offset (32)
+ cfi_rel_offset (x1, 0)
+ cfi_rel_offset (x2, 8)
+ cfi_rel_offset (x3, 16)
+ cfi_rel_offset (x4, 24)
mrs x4, tpidr_el0
- /* The ldar here happens after the load from [x0] at the call site
- (that is generated by the compiler as part of the TLS access ABI),
- so it reads the same value (this function is the final value of
- td->entry) and thus it synchronizes with the release store to
- td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load
- from [x0,#8] here happens after the initialization of td->arg. */
- ldar xzr, [x0]
- ldr x1, [x0,#8]
- ldr x0, [x4]
- ldr x3, [x1,#16]
- ldr x2, [x0]
- cmp x3, x2
+ ldr PTR_REG (1), [x0,#TLSDESC_ARG]
+ ldr PTR_REG (0), [x4,#TCBHEAD_DTV]
+ ldr PTR_REG (3), [x1,#TLSDESC_GEN_COUNT]
+ ldr PTR_REG (2), [x0,#DTV_COUNTER]
+ cmp PTR_REG (3), PTR_REG (2)
b.hi 2f
- ldr x2, [x1]
- add x0, x0, x2, lsl #4
- ldr x0, [x0]
- cmn x0, #0x1
+ /* Load r2 = td->tlsinfo.ti_module and r3 = td->tlsinfo.ti_offset. */
+ ldp PTR_REG (2), PTR_REG (3), [x1,#TLSDESC_MODID]
+ add PTR_REG (0), PTR_REG (0), PTR_REG (2), lsl #(PTR_LOG_SIZE + 1)
+ ldr PTR_REG (0), [x0] /* Load val member of DTV entry. */
+ cmp PTR_REG (0), #TLS_DTV_UNALLOCATED
b.eq 2f
- ldr x1, [x1,#8]
- add x0, x0, x1
- sub x0, x0, x4
+ sub PTR_REG (3), PTR_REG (3), PTR_REG (4)
+ add PTR_REG (0), PTR_REG (0), PTR_REG (3)
1:
- ldp x1, x2, [sp, #32+16*0]
- ldp x3, x4, [sp, #32+16*1]
-
- ldp x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
- cfi_adjust_cfa_offset (-32-16*NSAVEXREGPAIRS)
-# undef NSAVEXREGPAIRS
+ ldp x3, x4, [sp, #16]
+ ldp x1, x2, [sp], #32
+ cfi_adjust_cfa_offset (-32)
RET
2:
/* This is the slow path. We need to call __tls_get_addr() which
@@ -217,15 +180,33 @@ _dl_tlsdesc_dynamic:
callee will trash. */
/* Save the remaining registers that we must treat as caller save. */
-# define NSAVEXREGPAIRS 7
- stp x5, x6, [sp, #-16*NSAVEXREGPAIRS]!
+# define NSAVEXREGPAIRS 8
+ stp x29, x30, [sp,#-16*NSAVEXREGPAIRS]!
cfi_adjust_cfa_offset (16*NSAVEXREGPAIRS)
- stp x7, x8, [sp, #16*1]
- stp x9, x10, [sp, #16*2]
- stp x11, x12, [sp, #16*3]
- stp x13, x14, [sp, #16*4]
- stp x15, x16, [sp, #16*5]
- stp x17, x18, [sp, #16*6]
+ cfi_rel_offset (x29, 0)
+ cfi_rel_offset (x30, 8)
+ mov x29, sp
+ stp x5, x6, [sp, #16*1]
+ stp x7, x8, [sp, #16*2]
+ stp x9, x10, [sp, #16*3]
+ stp x11, x12, [sp, #16*4]
+ stp x13, x14, [sp, #16*5]
+ stp x15, x16, [sp, #16*6]
+ stp x17, x18, [sp, #16*7]
+ cfi_rel_offset (x5, 16*1)
+ cfi_rel_offset (x6, 16*1+8)
+ cfi_rel_offset (x7, 16*2)
+ cfi_rel_offset (x8, 16*2+8)
+ cfi_rel_offset (x9, 16*3)
+ cfi_rel_offset (x10, 16*3+8)
+ cfi_rel_offset (x11, 16*4)
+ cfi_rel_offset (x12, 16*4+8)
+ cfi_rel_offset (x13, 16*5)
+ cfi_rel_offset (x14, 16*5+8)
+ cfi_rel_offset (x15, 16*6)
+ cfi_rel_offset (x16, 16*6+8)
+ cfi_rel_offset (x17, 16*7)
+ cfi_rel_offset (x18, 16*7+8)
SAVE_Q_REGISTERS
@@ -233,134 +214,24 @@ _dl_tlsdesc_dynamic:
bl __tls_get_addr
mrs x1, tpidr_el0
- sub x0, x0, x1
+ sub PTR_REG (0), PTR_REG (0), PTR_REG (1)
RESTORE_Q_REGISTERS
- ldp x7, x8, [sp, #16*1]
- ldp x9, x10, [sp, #16*2]
- ldp x11, x12, [sp, #16*3]
- ldp x13, x14, [sp, #16*4]
- ldp x15, x16, [sp, #16*5]
- ldp x17, x18, [sp, #16*6]
- ldp x5, x6, [sp], #16*NSAVEXREGPAIRS
+ ldp x5, x6, [sp, #16*1]
+ ldp x7, x8, [sp, #16*2]
+ ldp x9, x10, [sp, #16*3]
+ ldp x11, x12, [sp, #16*4]
+ ldp x13, x14, [sp, #16*5]
+ ldp x15, x16, [sp, #16*6]
+ ldp x17, x18, [sp, #16*7]
+
+ ldp x29, x30, [sp], #16*NSAVEXREGPAIRS
cfi_adjust_cfa_offset (-16*NSAVEXREGPAIRS)
+ cfi_restore (x29)
+ cfi_restore (x30)
b 1b
cfi_endproc
.size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic
# undef NSAVEXREGPAIRS
#endif
-
- /* This function is a wrapper for a lazy resolver for TLS_DESC
- RELA relocations.
- When the actual resolver returns, it will have adjusted the
- TLS descriptor such that we can tail-call it for it to return
- the TP offset of the symbol. */
-
- .hidden _dl_tlsdesc_resolve_rela
- .global _dl_tlsdesc_resolve_rela
- .type _dl_tlsdesc_resolve_rela,%function
- cfi_startproc
- .align 2
-_dl_tlsdesc_resolve_rela:
-#define NSAVEXREGPAIRS 9
- stp x29, x30, [sp, #-(32+16*NSAVEXREGPAIRS)]!
- cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
- mov x29, sp
- stp x1, x4, [sp, #32+16*0]
- stp x5, x6, [sp, #32+16*1]
- stp x7, x8, [sp, #32+16*2]
- stp x9, x10, [sp, #32+16*3]
- stp x11, x12, [sp, #32+16*4]
- stp x13, x14, [sp, #32+16*5]
- stp x15, x16, [sp, #32+16*6]
- stp x17, x18, [sp, #32+16*7]
- str x0, [sp, #32+16*8]
-
- SAVE_Q_REGISTERS
-
- ldr x1, [x3, #8]
- bl _dl_tlsdesc_resolve_rela_fixup
-
- RESTORE_Q_REGISTERS
-
- ldr x0, [sp, #32+16*8]
- ldr x1, [x0]
- blr x1
-
- ldp x1, x4, [sp, #32+16*0]
- ldp x5, x6, [sp, #32+16*1]
- ldp x7, x8, [sp, #32+16*2]
- ldp x9, x10, [sp, #32+16*3]
- ldp x11, x12, [sp, #32+16*4]
- ldp x13, x14, [sp, #32+16*5]
- ldp x15, x16, [sp, #32+16*6]
- ldp x17, x18, [sp, #32+16*7]
- ldp x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
- cfi_adjust_cfa_offset (-32-16*NSAVEXREGPAIRS)
- ldp x2, x3, [sp], #16
- cfi_adjust_cfa_offset (-16)
- RET
-#undef NSAVEXREGPAIRS
- cfi_endproc
- .size _dl_tlsdesc_resolve_rela, .-_dl_tlsdesc_resolve_rela
-
- /* This function is a placeholder for lazy resolving of TLS
- relocations. Once some thread starts resolving a TLS
- relocation, it sets up the TLS descriptor to use this
- resolver, such that other threads that would attempt to
- resolve it concurrently may skip the call to the original lazy
- resolver and go straight to a condition wait.
-
- When the actual resolver returns, it will have adjusted the
- TLS descriptor such that we can tail-call it for it to return
- the TP offset of the symbol. */
-
- .hidden _dl_tlsdesc_resolve_hold
- .global _dl_tlsdesc_resolve_hold
- .type _dl_tlsdesc_resolve_hold,%function
- cfi_startproc
- .align 2
-_dl_tlsdesc_resolve_hold:
-#define NSAVEXREGPAIRS 10
-1:
- stp x29, x30, [sp, #-(32+16*NSAVEXREGPAIRS)]!
- cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
- mov x29, sp
- stp x1, x2, [sp, #32+16*0]
- stp x3, x4, [sp, #32+16*1]
- stp x5, x6, [sp, #32+16*2]
- stp x7, x8, [sp, #32+16*3]
- stp x9, x10, [sp, #32+16*4]
- stp x11, x12, [sp, #32+16*5]
- stp x13, x14, [sp, #32+16*6]
- stp x15, x16, [sp, #32+16*7]
- stp x17, x18, [sp, #32+16*8]
- str x0, [sp, #32+16*9]
-
- SAVE_Q_REGISTERS
-
- adr x1, 1b
- bl _dl_tlsdesc_resolve_hold_fixup
-
- RESTORE_Q_REGISTERS
-
- ldr x0, [sp, #32+16*9]
- ldr x1, [x0]
- blr x1
-
- ldp x1, x2, [sp, #32+16*0]
- ldp x3, x4, [sp, #32+16*1]
- ldp x5, x6, [sp, #32+16*2]
- ldp x7, x8, [sp, #32+16*3]
- ldp x9, x10, [sp, #32+16*4]
- ldp x11, x12, [sp, #32+16*5]
- ldp x13, x14, [sp, #32+16*6]
- ldp x15, x16, [sp, #32+16*7]
- ldp x17, x18, [sp, #32+16*8]
- ldp x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
- cfi_adjust_cfa_offset (-32-16*NSAVEXREGPAIRS)
- RET
- cfi_endproc
- .size _dl_tlsdesc_resolve_hold, .-_dl_tlsdesc_resolve_hold
-#undef NSAVEXREGPAIRS
diff --git a/sysdeps/aarch64/dl-tlsdesc.h b/sysdeps/aarch64/dl-tlsdesc.h
index 8532469fd9..6dc80ad66c 100644
--- a/sysdeps/aarch64/dl-tlsdesc.h
+++ b/sysdeps/aarch64/dl-tlsdesc.h
@@ -1,6 +1,6 @@
/* Thread-local storage descriptor handling in the ELF dynamic linker.
AArch64 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -46,20 +46,10 @@ extern ptrdiff_t attribute_hidden
_dl_tlsdesc_return (struct tlsdesc *);
extern ptrdiff_t attribute_hidden
-_dl_tlsdesc_return_lazy (struct tlsdesc *);
-
-extern ptrdiff_t attribute_hidden
_dl_tlsdesc_undefweak (struct tlsdesc *);
-extern ptrdiff_t attribute_hidden
-_dl_tlsdesc_resolve_rela (struct tlsdesc *);
-
-extern ptrdiff_t attribute_hidden
-_dl_tlsdesc_resolve_hold (struct tlsdesc *);
-
# ifdef SHARED
-extern void *internal_function _dl_make_tlsdesc_dynamic (struct link_map *,
- size_t);
+extern void *_dl_make_tlsdesc_dynamic (struct link_map *, size_t);
extern ptrdiff_t attribute_hidden
_dl_tlsdesc_dynamic (struct tlsdesc *);
diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S
index 947a51579f..a86d0722d4 100644
--- a/sysdeps/aarch64/dl-trampoline.S
+++ b/sysdeps/aarch64/dl-trampoline.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -22,9 +22,13 @@
#include "dl-link.h"
#define ip0 x16
+#define ip0l PTR_REG (16)
#define ip1 x17
#define lr x30
+/* RELA relocatons are 3 pointers */
+#define RELA_SIZE (PTR_SIZE * 3)
+
.text
.globl _dl_runtime_resolve
.type _dl_runtime_resolve, #function
@@ -79,7 +83,7 @@ _dl_runtime_resolve:
cfi_rel_offset (q1, 80+7*16)
/* Get pointer to linker struct. */
- ldr x0, [ip0, #-8]
+ ldr PTR_REG (0), [ip0, #-PTR_SIZE]
/* Prepare to call _dl_fixup(). */
ldr x1, [sp, 80+8*16] /* Recover &PLTGOT[n] */
@@ -87,7 +91,7 @@ _dl_runtime_resolve:
sub x1, x1, ip0
add x1, x1, x1, lsl #1
lsl x1, x1, #3
- sub x1, x1, #192
+ sub x1, x1, #(RELA_SIZE<<3)
lsr x1, x1, #3
/* Call fixup routine. */
@@ -191,7 +195,7 @@ _dl_runtime_profile:
stp x0, x1, [x29, #OFFSET_RG + DL_OFFSET_RG_SP]
/* Get pointer to linker struct. */
- ldr x0, [ip0, #-8]
+ ldr PTR_REG (0), [ip0, #-PTR_SIZE]
/* Prepare to call _dl_profile_fixup(). */
ldr x1, [x29, OFFSET_PLTGOTN] /* Recover &PLTGOT[n] */
@@ -199,7 +203,7 @@ _dl_runtime_profile:
sub x1, x1, ip0
add x1, x1, x1, lsl #1
lsl x1, x1, #3
- sub x1, x1, #192
+ sub x1, x1, #(RELA_SIZE<<3)
lsr x1, x1, #3
stp x0, x1, [x29, #OFFSET_SAVED_CALL_X0]
@@ -210,8 +214,8 @@ _dl_runtime_profile:
add x4, x29, #OFFSET_FS /* address of framesize */
bl _dl_profile_fixup
- ldr ip0, [x29, #OFFSET_FS] /* framesize == 0 */
- cmp ip0, #0
+ ldr ip0l, [x29, #OFFSET_FS] /* framesize == 0 */
+ cmp ip0l, #0
bge 1f
cfi_remember_state
@@ -243,7 +247,7 @@ _dl_runtime_profile:
1:
/* The new frame size is in ip0. */
- sub x1, x29, ip0
+ sub PTR_REG (1), PTR_REG (29), ip0l
and sp, x1, #0xfffffffffffffff0
str x0, [x29, #OFFSET_T1]
diff --git a/sysdeps/aarch64/dl-tunables.list b/sysdeps/aarch64/dl-tunables.list
new file mode 100644
index 0000000000..f6a88168cc
--- /dev/null
+++ b/sysdeps/aarch64/dl-tunables.list
@@ -0,0 +1,25 @@
+# aarch64 specific tunables.
+# Copyright (C) 2017-2018 Free Software 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/>.
+
+glibc {
+ tune {
+ cpu {
+ type: STRING
+ }
+ }
+}
diff --git a/sysdeps/aarch64/e_sqrtl.c b/sysdeps/aarch64/e_sqrtl.c
new file mode 100644
index 0000000000..1dc1cbf003
--- /dev/null
+++ b/sysdeps/aarch64/e_sqrtl.c
@@ -0,0 +1,39 @@
+/* long double square root in software floating-point emulation.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com) and
+ Jakub Jelinek (jj@ultra.linux.cz).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <stdlib.h>
+#include <soft-fp.h>
+#include <quad.h>
+
+long double
+__ieee754_sqrtl (const long double a)
+{
+ FP_DECL_EX;
+ FP_DECL_Q(A); FP_DECL_Q(C);
+ long double c;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q(A, a);
+ FP_SQRT_Q(C, A);
+ FP_PACK_Q(c, C);
+ FP_HANDLE_EXCEPTIONS;
+ return c;
+}
+strong_alias (__ieee754_sqrtl, __sqrtl_finite)
diff --git a/sysdeps/aarch64/fpu/Makefile b/sysdeps/aarch64/fpu/Makefile
new file mode 100644
index 0000000000..4a182bd6d6
--- /dev/null
+++ b/sysdeps/aarch64/fpu/Makefile
@@ -0,0 +1,14 @@
+ifeq ($(subdir),math)
+CFLAGS-e_sqrtf.c += -fno-math-errno
+CFLAGS-e_sqrt.c += -fno-math-errno
+CFLAGS-s_lroundf.c += -fno-math-errno
+CFLAGS-s_lround.c += -fno-math-errno
+CFLAGS-s_llroundf.c += -fno-math-errno
+CFLAGS-s_llround.c += -fno-math-errno
+# GCC 4.9 and 5 requires the flag to correct emits a f{max,min}nm
+# for a __builtin_{fmax,fmin}{f}.
+CFLAGS-s_fmax.c += -ffinite-math-only
+CFLAGS-s_fmaxf.c += -ffinite-math-only
+CFLAGS-s_fmin.c += -ffinite-math-only
+CFLAGS-s_fminf.c += -ffinite-math-only
+endif
diff --git a/sysdeps/aarch64/fpu/e_sqrt.c b/sysdeps/aarch64/fpu/e_sqrt.c
index 2759fb186d..32f1e26803 100644
--- a/sysdeps/aarch64/fpu/e_sqrt.c
+++ b/sysdeps/aarch64/fpu/e_sqrt.c
@@ -1,5 +1,5 @@
/* Square root of floating point number.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,8 +21,6 @@
double
__ieee754_sqrt (double d)
{
- double res;
- asm ("fsqrt %d0, %d1" : "=w" (res) : "w" (d));
- return res;
+ return __builtin_sqrt (d);
}
strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/sysdeps/aarch64/fpu/e_sqrtf.c b/sysdeps/aarch64/fpu/e_sqrtf.c
index e7ce19a38c..87f557cb10 100644
--- a/sysdeps/aarch64/fpu/e_sqrtf.c
+++ b/sysdeps/aarch64/fpu/e_sqrtf.c
@@ -1,5 +1,5 @@
/* Single-precision floating point square root.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,8 +21,6 @@
float
__ieee754_sqrtf (float s)
{
- float res;
- asm ("fsqrt %s0, %s1" : "=w" (res) : "w" (s));
- return res;
+ return __builtin_sqrtf (s);
}
strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/sysdeps/aarch64/fpu/fclrexcpt.c b/sysdeps/aarch64/fpu/fclrexcpt.c
index 8c0f09a82d..9328518f1e 100644
--- a/sysdeps/aarch64/fpu/fclrexcpt.c
+++ b/sysdeps/aarch64/fpu/fclrexcpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/fedisblxcpt.c b/sysdeps/aarch64/fpu/fedisblxcpt.c
index bf9592847f..125751f8b4 100644
--- a/sysdeps/aarch64/fpu/fedisblxcpt.c
+++ b/sysdeps/aarch64/fpu/fedisblxcpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/feenablxcpt.c b/sysdeps/aarch64/fpu/feenablxcpt.c
index dff1050e66..6c72b42fc9 100644
--- a/sysdeps/aarch64/fpu/feenablxcpt.c
+++ b/sysdeps/aarch64/fpu/feenablxcpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/fegetenv.c b/sysdeps/aarch64/fpu/fegetenv.c
index c10975f6a2..1559e90977 100644
--- a/sysdeps/aarch64/fpu/fegetenv.c
+++ b/sysdeps/aarch64/fpu/fegetenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/fegetexcept.c b/sysdeps/aarch64/fpu/fegetexcept.c
index 4a4cccd5ff..1f994ead0d 100644
--- a/sysdeps/aarch64/fpu/fegetexcept.c
+++ b/sysdeps/aarch64/fpu/fegetexcept.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/fegetmode.c b/sysdeps/aarch64/fpu/fegetmode.c
new file mode 100644
index 0000000000..65dcb22d89
--- /dev/null
+++ b/sysdeps/aarch64/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. AArch64 version.
+ Copyright (C) 2016-2018 Free Software 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/aarch64/fpu/fegetround.c b/sysdeps/aarch64/fpu/fegetround.c
index 94ad920543..10082eed90 100644
--- a/sysdeps/aarch64/fpu/fegetround.c
+++ b/sysdeps/aarch64/fpu/fegetround.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/feholdexcpt.c b/sysdeps/aarch64/fpu/feholdexcpt.c
index b9cf0ebd6e..4f7a58e379 100644
--- a/sysdeps/aarch64/fpu/feholdexcpt.c
+++ b/sysdeps/aarch64/fpu/feholdexcpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/fesetenv.c b/sysdeps/aarch64/fpu/fesetenv.c
index ca87bb60d6..2a63cf0c96 100644
--- a/sysdeps/aarch64/fpu/fesetenv.c
+++ b/sysdeps/aarch64/fpu/fesetenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/fesetexcept.c b/sysdeps/aarch64/fpu/fesetexcept.c
new file mode 100644
index 0000000000..c97a38b483
--- /dev/null
+++ b/sysdeps/aarch64/fpu/fesetexcept.c
@@ -0,0 +1,34 @@
+/* Set given exception flags. AArch64 version.
+ Copyright (C) 2016-2018 Free Software 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_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..6f6b8c197d
--- /dev/null
+++ b/sysdeps/aarch64/fpu/fesetmode.c
@@ -0,0 +1,34 @@
+/* Install given floating-point control modes. AArch64 version.
+ Copyright (C) 2016-2018 Free Software 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/fesetround.c b/sysdeps/aarch64/fpu/fesetround.c
index 645efe7804..4c2ed3d7ac 100644
--- a/sysdeps/aarch64/fpu/fesetround.c
+++ b/sysdeps/aarch64/fpu/fesetround.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/feupdateenv.c b/sysdeps/aarch64/fpu/feupdateenv.c
index 53d2b36cfa..2aaf5d13cd 100644
--- a/sysdeps/aarch64/fpu/feupdateenv.c
+++ b/sysdeps/aarch64/fpu/feupdateenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/fgetexcptflg.c b/sysdeps/aarch64/fpu/fgetexcptflg.c
index 8089a2c9fb..cfc7113e04 100644
--- a/sysdeps/aarch64/fpu/fgetexcptflg.c
+++ b/sysdeps/aarch64/fpu/fgetexcptflg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/fpu_control.h b/sysdeps/aarch64/fpu/fpu_control.h
index 7e74445872..2d36170c05 100644
--- a/sysdeps/aarch64/fpu/fpu_control.h
+++ b/sysdeps/aarch64/fpu/fpu_control.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -19,19 +19,28 @@
#ifndef _AARCH64_FPU_CONTROL_H
#define _AARCH64_FPU_CONTROL_H
+#include <features.h>
+
/* Macros for accessing the FPCR and FPSR. */
-#define _FPU_GETCW(fpcr) \
+#if __GNUC_PREREQ (6,0)
+# define _FPU_GETCW(fpcr) (fpcr = __builtin_aarch64_get_fpcr ())
+# define _FPU_SETCW(fpcr) __builtin_aarch64_set_fpcr (fpcr)
+# define _FPU_GETFPSR(fpsr) (fpsr = __builtin_aarch64_get_fpsr ())
+# define _FPU_SETFPSR(fpsr) __builtin_aarch64_set_fpsr (fpsr)
+#else
+# define _FPU_GETCW(fpcr) \
__asm__ __volatile__ ("mrs %0, fpcr" : "=r" (fpcr))
-#define _FPU_SETCW(fpcr) \
+# define _FPU_SETCW(fpcr) \
__asm__ __volatile__ ("msr fpcr, %0" : : "r" (fpcr))
-#define _FPU_GETFPSR(fpsr) \
+# define _FPU_GETFPSR(fpsr) \
__asm__ __volatile__ ("mrs %0, fpsr" : "=r" (fpsr))
-#define _FPU_SETFPSR(fpsr) \
+# define _FPU_SETFPSR(fpsr) \
__asm__ __volatile__ ("msr fpsr, %0" : : "r" (fpsr))
+#endif
/* Reserved bits should be preserved when modifying register
contents. These two masks indicate which bits in each of FPCR and
diff --git a/sysdeps/aarch64/fpu/fraiseexcpt.c b/sysdeps/aarch64/fpu/fraiseexcpt.c
index 4e00fbba42..bc26156323 100644
--- a/sysdeps/aarch64/fpu/fraiseexcpt.c
+++ b/sysdeps/aarch64/fpu/fraiseexcpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/fsetexcptflg.c b/sysdeps/aarch64/fpu/fsetexcptflg.c
index 890f1d655c..45d96af7e9 100644
--- a/sysdeps/aarch64/fpu/fsetexcptflg.c
+++ b/sysdeps/aarch64/fpu/fsetexcptflg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/ftestexcept.c b/sysdeps/aarch64/fpu/ftestexcept.c
index cedbce456f..84223259c8 100644
--- a/sysdeps/aarch64/fpu/ftestexcept.c
+++ b/sysdeps/aarch64/fpu/ftestexcept.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/get-rounding-mode.h b/sysdeps/aarch64/fpu/get-rounding-mode.h
index 0b23363025..ab29c5b908 100644
--- a/sysdeps/aarch64/fpu/get-rounding-mode.h
+++ b/sysdeps/aarch64/fpu/get-rounding-mode.h
@@ -1,6 +1,6 @@
/* Determine floating-point rounding mode within libc. AArch64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/fpu/math-barriers.h b/sysdeps/aarch64/fpu/math-barriers.h
new file mode 100644
index 0000000000..7db937bbf4
--- /dev/null
+++ b/sysdeps/aarch64/fpu/math-barriers.h
@@ -0,0 +1,27 @@
+/* Control when floating-point expressions are evaluated. AArch64 version.
+ Copyright (C) 2014-2018 Free Software 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 AARCH64_MATH_BARRIERS_H
+#define AARCH64_MATH_BARRIERS_H 1
+
+#define math_opt_barrier(x) \
+ ({ __typeof (x) __x = (x); __asm ("" : "+w" (__x)); __x; })
+#define math_force_eval(x) \
+ ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "w" (__x)); })
+
+#endif
diff --git a/sysdeps/aarch64/fpu/math_private.h b/sysdeps/aarch64/fpu/math_private.h
index fd8eb1fb56..fcd02c0654 100644
--- a/sysdeps/aarch64/fpu/math_private.h
+++ b/sysdeps/aarch64/fpu/math_private.h
@@ -1,5 +1,5 @@
/* Private floating point rounding and exceptions handling. AArch64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,27 +22,6 @@
#include <fenv.h>
#include <fpu_control.h>
-#define math_opt_barrier(x) \
-({ __typeof (x) __x = (x); __asm ("" : "+w" (__x)); __x; })
-#define math_force_eval(x) \
-({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "w" (__x)); })
-
-extern __always_inline double
-__ieee754_sqrt (double d)
-{
- double res;
- asm __volatile__ ("fsqrt %d0, %d1" : "=w" (res) : "w" (d));
- return res;
-}
-
-extern __always_inline float
-__ieee754_sqrtf (float s)
-{
- float res;
- asm __volatile__ ("fsqrt %s0, %s1" : "=w" (res) : "w" (s));
- return res;
-}
-
static __always_inline void
libc_feholdexcept_aarch64 (fenv_t *envp)
{
@@ -319,6 +298,26 @@ libc_feresetround_noex_aarch64_ctx (struct rm_ctx *ctx)
#define libc_feresetround_noexf_ctx libc_feresetround_noex_aarch64_ctx
#define libc_feresetround_noexl_ctx libc_feresetround_noex_aarch64_ctx
+/* Hack: only include the large arm_neon.h when needed. */
+#ifdef _MATH_CONFIG_H
+# include <arm_neon.h>
+
+/* ACLE intrinsics for frintn and fcvtns instructions. */
+# define TOINT_INTRINSICS 1
+
+static inline double_t
+roundtoint (double_t x)
+{
+ return vget_lane_f64 (vrndn_f64 (vld1_f64 (&x)), 0);
+}
+
+static inline uint64_t
+converttoint (double_t x)
+{
+ return vcvtnd_s64_f64 (x);
+}
+#endif
+
#include_next <math_private.h>
#endif
diff --git a/sysdeps/aarch64/fpu/s_ceil.c b/sysdeps/aarch64/fpu/s_ceil.c
index 60c444d70a..4e3b5fdc4d 100644
--- a/sysdeps/aarch64/fpu/s_ceil.c
+++ b/sysdeps/aarch64/fpu/s_ceil.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC ceil
-#define INSN "frintp"
-#include <s_frint.c>
+#include <math.h>
+#include <libm-alias-double.h>
+
+double
+__ceil (double x)
+{
+ return __builtin_ceil (x);
+}
+
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/aarch64/fpu/s_ceilf.c b/sysdeps/aarch64/fpu/s_ceilf.c
index 1f1fb0677a..d01dadc246 100644
--- a/sysdeps/aarch64/fpu/s_ceilf.c
+++ b/sysdeps/aarch64/fpu/s_ceilf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC ceilf
-#define INSN "frintp"
-#include <s_frintf.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__ceilf (float x)
+{
+ return __builtin_ceilf (x);
+}
+
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/aarch64/fpu/s_floor.c b/sysdeps/aarch64/fpu/s_floor.c
index c490a27b66..7258246896 100644
--- a/sysdeps/aarch64/fpu/s_floor.c
+++ b/sysdeps/aarch64/fpu/s_floor.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC floor
-#define INSN "frintm"
-#include <s_frint.c>
+#include <math.h>
+#include <libm-alias-double.h>
+
+double
+__floor (double x)
+{
+ return __builtin_floor (x);
+}
+
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/aarch64/fpu/s_floorf.c b/sysdeps/aarch64/fpu/s_floorf.c
index ec81683058..bd197013ad 100644
--- a/sysdeps/aarch64/fpu/s_floorf.c
+++ b/sysdeps/aarch64/fpu/s_floorf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC floorf
-#define INSN "frintm"
-#include <s_frintf.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__floorf (float x)
+{
+ return __builtin_floorf (x);
+}
+
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/aarch64/fpu/s_fma.c b/sysdeps/aarch64/fpu/s_fma.c
index 3320ba6989..4f3d6c4a51 100644
--- a/sysdeps/aarch64/fpu/s_fma.c
+++ b/sysdeps/aarch64/fpu/s_fma.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -17,29 +17,12 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-double.h>
-#ifndef FUNC
-# define FUNC fma
-#endif
-
-#ifndef TYPE
-# define TYPE double
-# define REGS "d"
-#else
-# ifndef REGS
-# error REGS not defined
-# endif
-#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-TYPE
-__CONCATX(__,FUNC) (TYPE x, TYPE y, TYPE z)
+double
+__fma (double x, double y, double z)
{
- TYPE result;
- asm ( "fmadd" "\t%" REGS "0, %" REGS "1, %" REGS "2, %" REGS "3"
- : "=w" (result) : "w" (x), "w" (y), "w" (z) );
- return result;
+ return __builtin_fma (x, y, z);
}
-weak_alias (__CONCATX(__,FUNC), FUNC)
+libm_alias_double (__fma, fma)
diff --git a/sysdeps/aarch64/fpu/s_fmaf.c b/sysdeps/aarch64/fpu/s_fmaf.c
index e35512c31b..197cf7bd06 100644
--- a/sysdeps/aarch64/fpu/s_fmaf.c
+++ b/sysdeps/aarch64/fpu/s_fmaf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,7 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC fmaf
-#define TYPE float
-#define REGS "s"
-#include <s_fma.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__fmaf (float x, float y, float z)
+{
+ return __builtin_fmaf (x, y, z);
+}
+
+libm_alias_float (__fma, fma)
diff --git a/sysdeps/aarch64/fpu/s_fmax.c b/sysdeps/aarch64/fpu/s_fmax.c
index bc41ec44f6..65de8ceab3 100644
--- a/sysdeps/aarch64/fpu/s_fmax.c
+++ b/sysdeps/aarch64/fpu/s_fmax.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC fmax
-#define INSN "fmaxnm"
-#include <s_fmin.c>
+#include <math.h>
+#include <libm-alias-double.h>
+
+double
+__fmax (double x, double y)
+{
+ return __builtin_fmax (x, y);
+}
+
+libm_alias_double (__fmax, fmax)
diff --git a/sysdeps/aarch64/fpu/s_fmaxf.c b/sysdeps/aarch64/fpu/s_fmaxf.c
index 6a234bbeaf..2056700426 100644
--- a/sysdeps/aarch64/fpu/s_fmaxf.c
+++ b/sysdeps/aarch64/fpu/s_fmaxf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,8 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC fmaxf
-#define INSN "fmaxnm"
-#define TYPE float
-#define REGS "s"
-#include <s_fmin.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__fmaxf (float x, float y)
+{
+ return __builtin_fmaxf (x, y);
+}
+
+libm_alias_float (__fmax, fmax)
diff --git a/sysdeps/aarch64/fpu/s_fmin.c b/sysdeps/aarch64/fpu/s_fmin.c
index 695abafb9b..a42b565498 100644
--- a/sysdeps/aarch64/fpu/s_fmin.c
+++ b/sysdeps/aarch64/fpu/s_fmin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -17,33 +17,12 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-double.h>
-#ifndef FUNC
-# define FUNC fmin
-#endif
-
-#ifndef INSN
-# define INSN "fminnm"
-#endif
-
-#ifndef TYPE
-# define TYPE double
-# define REGS "d"
-#else
-# ifndef REGS
-# error REGS not defined
-# endif
-#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-TYPE
-__CONCATX(__,FUNC) (TYPE x, TYPE y)
+double
+__fmin (double x, double y)
{
- TYPE result;
- asm ( INSN "\t%" REGS "0, %" REGS "1, %" REGS "2"
- : "=w" (result) : "w" (x), "w" (y) );
- return result;
+ return __builtin_fmin (x, y);
}
-weak_alias (__CONCATX(__,FUNC), FUNC)
+libm_alias_double (__fmin, fmin)
diff --git a/sysdeps/aarch64/fpu/s_fminf.c b/sysdeps/aarch64/fpu/s_fminf.c
index 78609575bb..028f88543f 100644
--- a/sysdeps/aarch64/fpu/s_fminf.c
+++ b/sysdeps/aarch64/fpu/s_fminf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,7 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC fminf
-#define TYPE float
-#define REGS "s"
-#include <s_fmin.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__fminf (float x, float y)
+{
+ return __builtin_fminf (x, y);
+}
+
+libm_alias_float (__fmin, fmin)
diff --git a/sysdeps/aarch64/fpu/s_frint.c b/sysdeps/aarch64/fpu/s_frint.c
deleted file mode 100644
index 321c8ef50d..0000000000
--- a/sysdeps/aarch64/fpu/s_frint.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* 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 <math.h>
-
-#ifndef FUNC
-# error FUNC not defined
-#endif
-
-#ifndef TYPE
-# define TYPE double
-# define REGS "d"
-#else
-# ifndef REGS
-# error REGS not defined
-# endif
-#endif
-
-#ifndef INSN
-# error INSN not defined
-#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-TYPE
-__CONCATX(__,FUNC) (TYPE x)
-{
- TYPE result;
- asm ( INSN "\t%" REGS "0, %" REGS "1" :
- "=w" (result) : "w" (x) );
- return result;
-}
-
-weak_alias (__CONCATX(__,FUNC), FUNC)
diff --git a/sysdeps/aarch64/fpu/s_frintf.c b/sysdeps/aarch64/fpu/s_frintf.c
deleted file mode 100644
index a284eafa4c..0000000000
--- a/sysdeps/aarch64/fpu/s_frintf.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (C) 2011-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 FUNC
-# error FUNC not defined
-#endif
-#define TYPE float
-#define REGS "s"
-#include <s_frint.c>
diff --git a/sysdeps/aarch64/fpu/s_llrint.c b/sysdeps/aarch64/fpu/s_llrint.c
index 9769311b1b..287dc8974c 100644
--- a/sysdeps/aarch64/fpu/s_llrint.c
+++ b/sysdeps/aarch64/fpu/s_llrint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC llrint
-#define OTYPE long long int
-#include <s_lrint.c>
+#include <math.h>
+#include <math-barriers.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+
+long long int
+__llrint (double x)
+{
+ double r = __builtin_rint (x);
+
+ /* Prevent gcc from calling llrint directly when compiled with
+ -fno-math-errno by inserting a barrier. */
+
+ math_opt_barrier (r);
+ return r;
+}
+
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/aarch64/fpu/s_llrintf.c b/sysdeps/aarch64/fpu/s_llrintf.c
index 51024a986c..70d6c0ca84 100644
--- a/sysdeps/aarch64/fpu/s_llrintf.c
+++ b/sysdeps/aarch64/fpu/s_llrintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,8 +16,22 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC llrintf
-#define ITYPE float
-#define IREGS "s"
-#define OTYPE long long int
-#include <s_lrint.c>
+#include <math.h>
+#include <math-barriers.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+
+long long int
+__llrintf (float x)
+{
+ float r = __builtin_rintf (x);
+
+ /* Prevent gcc from calling llrintf directly when compiled with
+ -fno-math-errno by inserting a barrier. */
+
+
+ math_opt_barrier (r);
+ return r;
+}
+
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/aarch64/fpu/s_llround.c b/sysdeps/aarch64/fpu/s_llround.c
index dd2b3a2e16..d6ff708f41 100644
--- a/sysdeps/aarch64/fpu/s_llround.c
+++ b/sysdeps/aarch64/fpu/s_llround.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC llround
-#define OTYPE long long int
-#include <s_lround.c>
+#include <math.h>
+#include <libm-alias-double.h>
+
+long long int
+__llround (double x)
+{
+ return __builtin_llround (x);
+}
+
+libm_alias_double (__llround, llround)
diff --git a/sysdeps/aarch64/fpu/s_llroundf.c b/sysdeps/aarch64/fpu/s_llroundf.c
index 8b5d263d91..4cb2caf8b5 100644
--- a/sysdeps/aarch64/fpu/s_llroundf.c
+++ b/sysdeps/aarch64/fpu/s_llroundf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,8 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC llroundf
-#define ITYPE float
-#define IREGS "s"
-#define OTYPE long long int
-#include <s_lround.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+long long int
+__llroundf (float x)
+{
+ return __builtin_llroundf (x);
+}
+
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/aarch64/fpu/s_lrint.c b/sysdeps/aarch64/fpu/s_lrint.c
index e51de0fc2d..d6ef066e45 100644
--- a/sysdeps/aarch64/fpu/s_lrint.c
+++ b/sysdeps/aarch64/fpu/s_lrint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -17,37 +17,73 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <get-rounding-mode.h>
+#include <stdint.h>
+#include <math-barriers.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
-#ifndef FUNC
-# define FUNC lrint
-#endif
+# define IREG_SIZE 64
+
+# ifdef __ILP32__
+# define OREG_SIZE 32
+# else
+# define OREG_SIZE 64
+# endif
-#ifndef ITYPE
-# define ITYPE double
# define IREGS "d"
+
+#if OREG_SIZE == 32
+# define OREGS "w"
#else
-# ifndef IREGS
-# error IREGS not defined
-# endif
+# define OREGS "x"
#endif
-#ifndef OTYPE
-# define OTYPE long int
+
+long int
+__lrint (double x)
+{
+
+#if IREG_SIZE == 64 && OREG_SIZE == 32
+ long int result;
+
+ if (__builtin_fabs (x) > INT32_MAX)
+ {
+ /* Converting large values to a 32 bit int may cause the frintx/fcvtza
+ sequence to set both FE_INVALID and FE_INEXACT. To avoid this
+ check the rounding mode and do a single instruction with the
+ appropriate rounding mode. */
+
+ switch (get_rounding_mode ())
+ {
+ case FE_TONEAREST:
+ asm volatile ("fcvtns" "\t%" OREGS "0, %" IREGS "1"
+ : "=r" (result) : "w" (x));
+ break;
+ case FE_UPWARD:
+ asm volatile ("fcvtps" "\t%" OREGS "0, %" IREGS "1"
+ : "=r" (result) : "w" (x));
+ break;
+ case FE_DOWNWARD:
+ asm volatile ("fcvtms" "\t%" OREGS "0, %" IREGS "1"
+ : "=r" (result) : "w" (x));
+ break;
+ case FE_TOWARDZERO:
+ default:
+ asm volatile ("fcvtzs" "\t%" OREGS "0, %" IREGS "1"
+ : "=r" (result) : "w" (x));
+ }
+ return result;
+ }
#endif
-#define OREGS "x"
+ double r = __builtin_rint (x);
-#define __CONCATX(a,b) __CONCAT(a,b)
+ /* Prevent gcc from calling lrint directly when compiled with
+ -fno-math-errno by inserting a barrier. */
-OTYPE
-__CONCATX(__,FUNC) (ITYPE x)
-{
- OTYPE result;
- ITYPE temp;
- asm ( "frintx" "\t%" IREGS "1, %" IREGS "2\n\t"
- "fcvtzs" "\t%" OREGS "0, %" IREGS "1"
- : "=r" (result), "=w" (temp) : "w" (x) );
- return result;
+ math_opt_barrier (r);
+ return r;
}
-weak_alias (__CONCATX(__,FUNC), FUNC)
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/aarch64/fpu/s_lrintf.c b/sysdeps/aarch64/fpu/s_lrintf.c
index b603510375..fa42d68dd1 100644
--- a/sysdeps/aarch64/fpu/s_lrintf.c
+++ b/sysdeps/aarch64/fpu/s_lrintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,7 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC lrintf
-#define ITYPE float
-#define IREGS "s"
-#include <s_lrint.c>
+#include <math.h>
+#include <math-barriers.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+
+long int
+__lrintf (float x)
+{
+ float r = __builtin_rintf (x);
+
+ /* Prevent gcc from calling lrintf directly when compiled with
+ -fno-math-errno by inserting a barrier. */
+
+ math_opt_barrier (r);
+ return r;
+}
+
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/aarch64/fpu/s_lround.c b/sysdeps/aarch64/fpu/s_lround.c
index a14d347142..d8e9fc4664 100644
--- a/sysdeps/aarch64/fpu/s_lround.c
+++ b/sysdeps/aarch64/fpu/s_lround.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -17,35 +17,12 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-double.h>
-#ifndef FUNC
-# define FUNC lround
-#endif
+long int
+__lround (double x)
+ {
+ return __builtin_lround (x);
+ }
-#ifndef ITYPE
-# define ITYPE double
-# define IREGS "d"
-#else
-# ifndef IREGS
-# error IREGS not defined
-# endif
-#endif
-
-#ifndef OTYPE
-# define OTYPE long int
-#endif
-
-#define OREGS "x"
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-OTYPE
-__CONCATX(__,FUNC) (ITYPE x)
-{
- OTYPE result;
- asm ( "fcvtas" "\t%" OREGS "0, %" IREGS "1"
- : "=r" (result) : "w" (x) );
- return result;
-}
-
-weak_alias (__CONCATX(__,FUNC), FUNC)
+libm_alias_double (__lround, lround)
diff --git a/sysdeps/aarch64/fpu/s_lroundf.c b/sysdeps/aarch64/fpu/s_lroundf.c
index e3a3fba937..9a76dbf24a 100644
--- a/sysdeps/aarch64/fpu/s_lroundf.c
+++ b/sysdeps/aarch64/fpu/s_lroundf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,7 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC lroundf
-#define ITYPE float
-#define IREGS "s"
-#include <s_lround.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+long int
+__lroundf (float x)
+{
+ return __builtin_lroundf (x);
+}
+
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/aarch64/fpu/s_nearbyint.c b/sysdeps/aarch64/fpu/s_nearbyint.c
index 3be8059c1b..477e1a8cfe 100644
--- a/sysdeps/aarch64/fpu/s_nearbyint.c
+++ b/sysdeps/aarch64/fpu/s_nearbyint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC nearbyint
-#define INSN "frinti"
-#include <s_frint.c>
+#include <math.h>
+#include <libm-alias-double.h>
+
+double
+__nearbyint (double x)
+{
+ return __builtin_nearbyint (x);
+}
+
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/aarch64/fpu/s_nearbyintf.c b/sysdeps/aarch64/fpu/s_nearbyintf.c
index e544e5597e..4edab204a9 100644
--- a/sysdeps/aarch64/fpu/s_nearbyintf.c
+++ b/sysdeps/aarch64/fpu/s_nearbyintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC nearbyintf
-#define INSN "frinti"
-#include <s_frintf.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__nearbyintf (float x)
+{
+ return __builtin_nearbyintf (x);
+}
+
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/aarch64/fpu/s_rint.c b/sysdeps/aarch64/fpu/s_rint.c
index d12c1a7c46..eb4232af00 100644
--- a/sysdeps/aarch64/fpu/s_rint.c
+++ b/sysdeps/aarch64/fpu/s_rint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC rint
-#define INSN "frintx"
-#include <s_frint.c>
+#include <math.h>
+#include <libm-alias-double.h>
+
+double
+__rint (double x)
+{
+ return __builtin_rint (x);
+}
+
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/aarch64/fpu/s_rintf.c b/sysdeps/aarch64/fpu/s_rintf.c
index 375be92734..9ebfcb45b4 100644
--- a/sysdeps/aarch64/fpu/s_rintf.c
+++ b/sysdeps/aarch64/fpu/s_rintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC rintf
-#define INSN "frintx"
-#include <s_frintf.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__rintf (float x)
+{
+ return __builtin_rintf (x);
+}
+
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/aarch64/fpu/s_round.c b/sysdeps/aarch64/fpu/s_round.c
index 239ca1b434..275b00f318 100644
--- a/sysdeps/aarch64/fpu/s_round.c
+++ b/sysdeps/aarch64/fpu/s_round.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC round
-#define INSN "frinta"
-#include <s_frint.c>
+#include <math.h>
+#include <libm-alias-double.h>
+
+double
+__round (double x)
+{
+ return __builtin_round (x);
+}
+
+libm_alias_double (__round, round)
diff --git a/sysdeps/aarch64/fpu/s_roundf.c b/sysdeps/aarch64/fpu/s_roundf.c
index eb13586dc5..201ffc54db 100644
--- a/sysdeps/aarch64/fpu/s_roundf.c
+++ b/sysdeps/aarch64/fpu/s_roundf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC roundf
-#define INSN "frinta"
-#include <s_frintf.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__roundf (float x)
+{
+ return __builtin_roundf (x);
+}
+
+libm_alias_float (__round, round)
diff --git a/sysdeps/aarch64/fpu/s_trunc.c b/sysdeps/aarch64/fpu/s_trunc.c
index 7107a1b18b..22f44f1e04 100644
--- a/sysdeps/aarch64/fpu/s_trunc.c
+++ b/sysdeps/aarch64/fpu/s_trunc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC trunc
-#define INSN "frintz"
-#include <s_frint.c>
+#include <math.h>
+#include <libm-alias-double.h>
+
+double
+__trunc (double x)
+{
+ return __builtin_trunc (x);
+}
+
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/aarch64/fpu/s_truncf.c b/sysdeps/aarch64/fpu/s_truncf.c
index b08c1cb304..3771b6d6bf 100644
--- a/sysdeps/aarch64/fpu/s_truncf.c
+++ b/sysdeps/aarch64/fpu/s_truncf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC truncf
-#define INSN "frintz"
-#include <s_frintf.c>
+#include <math.h>
+#include <libm-alias-float.h>
+
+float
+__truncf (float x)
+{
+ return __builtin_truncf (x);
+}
+
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/aarch64/jmpbuf-offsets.h b/sysdeps/aarch64/jmpbuf-offsets.h
index 37f551a56b..a7096f2f69 100644
--- a/sysdeps/aarch64/jmpbuf-offsets.h
+++ b/sysdeps/aarch64/jmpbuf-offsets.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/jmpbuf-unwind.h b/sysdeps/aarch64/jmpbuf-unwind.h
index 3e0a37db4e..9309e7b0ea 100644
--- a/sysdeps/aarch64/jmpbuf-unwind.h
+++ b/sysdeps/aarch64/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -27,7 +27,8 @@
((void *) (address) < (void *) demangle (jmpbuf[JB_SP]))
#define _JMPBUF_CFA_UNWINDS_ADJ(jmpbuf, context, adj) \
- _JMPBUF_UNWINDS_ADJ (jmpbuf, (void *) _Unwind_GetCFA (context), adj)
+ _JMPBUF_UNWINDS_ADJ (jmpbuf, (void *) (uintptr_t) _Unwind_GetCFA (context), \
+ adj)
#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
diff --git a/sysdeps/aarch64/ldsodefs.h b/sysdeps/aarch64/ldsodefs.h
index 7c02e89371..600b721234 100644
--- a/sysdeps/aarch64/ldsodefs.h
+++ b/sysdeps/aarch64/ldsodefs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -20,6 +20,7 @@
#define _AARCH64_LDSODEFS_H 1
#include <elf.h>
+#include <cpu-features.h>
struct La_aarch64_regs;
struct La_aarch64_retval;
diff --git a/sysdeps/aarch64/libc-tls.c b/sysdeps/aarch64/libc-tls.c
index f43c75f9b5..f2a2e1c0d3 100644
--- a/sysdeps/aarch64/libc-tls.c
+++ b/sysdeps/aarch64/libc-tls.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/libm-test-ulps b/sysdeps/aarch64/libm-test-ulps
index bc5795b361..be06085154 100644
--- a/sysdeps/aarch64/libm-test-ulps
+++ b/sysdeps/aarch64/libm-test-ulps
@@ -40,9 +40,9 @@ ildouble: 2
ldouble: 2
Function: "acosh_downward":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 3
ldouble: 3
@@ -252,36 +252,36 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "cacos_downward":
double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "cacos_towardzero":
double: 5
@@ -300,17 +300,17 @@ ildouble: 3
ldouble: 3
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -332,12 +332,12 @@ ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-ildouble: 2
-ldouble: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
Function: Real part of "cacosh_towardzero":
double: 5
@@ -348,28 +348,28 @@ ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Real part of "cacosh_upward":
double: 4
float: 4
idouble: 4
ifloat: 4
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
Function: "carg":
double: 1
@@ -412,18 +412,18 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -432,8 +432,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "casin_towardzero":
double: 3
@@ -452,25 +452,25 @@ ildouble: 5
ldouble: 5
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -488,14 +488,14 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -516,23 +516,25 @@ ildouble: 3
ldouble: 3
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
ildouble: 3
ldouble: 3
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -547,9 +549,9 @@ ldouble: 1
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -563,25 +565,27 @@ ldouble: 3
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
Function: Real part of "catan_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catan_upward":
double: 3
@@ -600,7 +604,9 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -623,9 +629,9 @@ ldouble: 2
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -639,17 +645,19 @@ ldouble: 2
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
idouble: 4
-ifloat: 3
+ifloat: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "cbrt":
double: 3
@@ -900,18 +908,18 @@ 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
Function: Real part of "clog10_downward":
double: 5
-float: 4
+float: 5
idouble: 5
-ifloat: 4
+ifloat: 5
ildouble: 3
ldouble: 3
@@ -1004,7 +1012,9 @@ ildouble: 2
ldouble: 2
Function: "cos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -1323,9 +1333,9 @@ ldouble: 3
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -1339,9 +1349,9 @@ ldouble: 4
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1363,9 +1373,9 @@ ldouble: 5
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 5
ldouble: 5
@@ -1395,9 +1405,9 @@ ldouble: 3
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
idouble: 4
-ifloat: 1
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1575,15 +1585,21 @@ ldouble: 2
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "expm1":
double: 1
@@ -1683,9 +1699,9 @@ ldouble: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 4
ldouble: 4
@@ -1910,55 +1926,27 @@ ildouble: 1
ldouble: 1
Function: "log_towardzero":
-float: 1
-ifloat: 1
+float: 2
+ifloat: 2
ildouble: 2
ldouble: 2
Function: "log_upward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 1
ldouble: 1
Function: "pow":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 2
ldouble: 2
-Function: "pow10":
-double: 2
-idouble: 2
-ildouble: 2
-ldouble: 2
-
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
Function: "pow_downward":
double: 1
float: 1
@@ -1984,7 +1972,9 @@ ildouble: 2
ldouble: 2
Function: "sin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2014,7 +2004,9 @@ ildouble: 3
ldouble: 3
Function: "sincos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2179,9 +2171,9 @@ ldouble: 3
Function: "y0_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 4
ldouble: 4
@@ -2195,9 +2187,9 @@ ldouble: 3
Function: "y0_upward":
double: 2
-float: 3
+float: 5
idouble: 2
-ifloat: 3
+ifloat: 5
ildouble: 3
ldouble: 3
@@ -2235,17 +2227,17 @@ ldouble: 5
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 5
ldouble: 5
Function: "yn_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 5
ldouble: 5
@@ -2259,9 +2251,9 @@ ldouble: 5
Function: "yn_upward":
double: 4
-float: 3
+float: 5
idouble: 4
-ifloat: 3
+ifloat: 5
ildouble: 5
ldouble: 5
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/linkmap.h b/sysdeps/aarch64/linkmap.h
index 5aefb4cfeb..6852f343a1 100644
--- a/sysdeps/aarch64/linkmap.h
+++ b/sysdeps/aarch64/linkmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/machine-gmon.h b/sysdeps/aarch64/machine-gmon.h
index 3d923f91ce..dd12a25416 100644
--- a/sysdeps/aarch64/machine-gmon.h
+++ b/sysdeps/aarch64/machine-gmon.h
@@ -1,5 +1,5 @@
/* AArch64 definitions for profiling support.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/aarch64/math-tests.h b/sysdeps/aarch64/math-tests.h
index a3e1efae97..46cc33741f 100644
--- a/sysdeps/aarch64/math-tests.h
+++ b/sysdeps/aarch64/math-tests.h
@@ -1,5 +1,5 @@
/* Configuration for math tests. AArch64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/aarch64/mcount.c b/sysdeps/aarch64/mcount.c
index ca596ee986..515c6bde25 100644
--- a/sysdeps/aarch64/mcount.c
+++ b/sysdeps/aarch64/mcount.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/memchr.S b/sysdeps/aarch64/memchr.S
new file mode 100644
index 0000000000..e422aef090
--- /dev/null
+++ b/sysdeps/aarch64/memchr.S
@@ -0,0 +1,157 @@
+/* memchr - find a character in a memory zone
+
+ Copyright (C) 2015-2018 Free Software 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/memcmp.S b/sysdeps/aarch64/memcmp.S
index ae2d997973..743bc078bb 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -1,6 +1,6 @@
/* memcmp - compare memory
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -22,129 +22,132 @@
/* Assumptions:
*
- * ARMv8-a, AArch64
+ * ARMv8-a, AArch64, unaligned accesses.
*/
/* Parameters and result. */
#define src1 x0
#define src2 x1
#define limit x2
-#define result x0
+#define result w0
/* Internal variables. */
#define data1 x3
#define data1w w3
-#define data2 x4
-#define data2w w4
-#define has_nul x5
-#define diff x6
-#define endloop x7
-#define tmp1 x8
-#define tmp2 x9
-#define tmp3 x10
-#define pos x11
-#define limit_wd x12
-#define mask x13
+#define data1h x4
+#define data2 x5
+#define data2w w5
+#define data2h x6
+#define tmp1 x7
+#define tmp2 x8
ENTRY_ALIGN (memcmp, 6)
- cbz limit, L(ret0)
- eor tmp1, src1, src2
- tst tmp1, #7
- b.ne L(misaligned8)
- ands tmp1, src1, #7
- b.ne L(mutual_align)
- add limit_wd, limit, #7
- lsr limit_wd, limit_wd, #3
- /* Start of performance-critical section -- one 64B cache line. */
-L(loop_aligned):
- ldr data1, [src1], #8
- ldr data2, [src2], #8
-L(start_realigned):
- subs limit_wd, limit_wd, #1
- eor diff, data1, data2 /* Non-zero if differences found. */
- csinv endloop, diff, xzr, ne /* Last Dword or differences. */
- cbz endloop, L(loop_aligned)
- /* End of performance-critical section -- one 64B cache line. */
-
- /* Not reached the limit, must have found a diff. */
- cbnz limit_wd, L(not_limit)
-
- /* Limit % 8 == 0 => all bytes significant. */
- ands limit, limit, #7
- b.eq L(not_limit)
-
- lsl limit, limit, #3 /* Bits -> bytes. */
- mov mask, #~0
-#ifdef __AARCH64EB__
- lsr mask, mask, limit
-#else
- lsl mask, mask, limit
-#endif
- bic data1, data1, mask
- bic data2, data2, mask
-
- orr diff, diff, mask
-L(not_limit):
-
-#ifndef __AARCH64EB__
- rev diff, diff
+ DELOUSE (0)
+ DELOUSE (1)
+ DELOUSE (2)
+
+ subs limit, limit, 8
+ b.lo L(less8)
+
+ ldr data1, [src1], 8
+ ldr data2, [src2], 8
+ cmp data1, data2
+ b.ne L(return)
+
+ subs limit, limit, 8
+ b.gt L(more16)
+
+ ldr data1, [src1, limit]
+ ldr data2, [src2, limit]
+ b L(return)
+
+L(more16):
+ ldr data1, [src1], 8
+ ldr data2, [src2], 8
+ cmp data1, data2
+ bne L(return)
+
+ /* Jump directly to comparing the last 16 bytes for 32 byte (or less)
+ strings. */
+ subs limit, limit, 16
+ b.ls L(last_bytes)
+
+ /* We overlap loads between 0-32 bytes at either side of SRC1 when we
+ try to align, so limit it only to strings larger than 128 bytes. */
+ cmp limit, 96
+ b.ls L(loop16)
+
+ /* Align src1 and adjust src2 with bytes not yet done. */
+ and tmp1, src1, 15
+ add limit, limit, tmp1
+ sub src1, src1, tmp1
+ sub src2, src2, tmp1
+
+ /* Loop performing 16 bytes per iteration using aligned src1.
+ Limit is pre-decremented by 16 and must be larger than zero.
+ Exit if <= 16 bytes left to do or if the data is not equal. */
+ .p2align 4
+L(loop16):
+ ldp data1, data1h, [src1], 16
+ ldp data2, data2h, [src2], 16
+ subs limit, limit, 16
+ ccmp data1, data2, 0, hi
+ ccmp data1h, data2h, 0, eq
+ b.eq L(loop16)
+
+ cmp data1, data2
+ bne L(return)
+ mov data1, data1h
+ mov data2, data2h
+ cmp data1, data2
+ bne L(return)
+
+ /* Compare last 1-16 bytes using unaligned access. */
+L(last_bytes):
+ add src1, src1, limit
+ add src2, src2, limit
+ ldp data1, data1h, [src1]
+ ldp data2, data2h, [src2]
+ cmp data1, data2
+ bne L(return)
+ mov data1, data1h
+ mov data2, data2h
+ cmp data1, data2
+
+ /* Compare data bytes and set return value to 0, -1 or 1. */
+L(return):
+#ifndef __AARCH64EB__
rev data1, data1
rev data2, data2
#endif
- /* The MS-non-zero bit of DIFF marks either the first bit
- that is different, or the end of the significant data.
- Shifting left now will bring the critical information into the
- top bits. */
- clz pos, diff
- lsl data1, data1, pos
- lsl data2, data2, pos
- /* But we need to zero-extend (char is unsigned) the value and then
- perform a signed 32-bit subtraction. */
- lsr data1, data1, #56
- sub result, data1, data2, lsr #56
- RET
-
-L(mutual_align):
- /* Sources are mutually aligned, but are not currently at an
- alignment boundary. Round down the addresses and then mask off
- the bytes that precede the start point. */
- bic src1, src1, #7
- bic src2, src2, #7
- add limit, limit, tmp1 /* Adjust the limit for the extra. */
- lsl tmp1, tmp1, #3 /* Bytes beyond alignment -> bits. */
- ldr data1, [src1], #8
- neg tmp1, tmp1 /* Bits to alignment -64. */
- ldr data2, [src2], #8
- mov tmp2, #~0
-#ifdef __AARCH64EB__
- /* Big-endian. Early bytes are at MSB. */
- lsl tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */
-#else
- /* Little-endian. Early bytes are at LSB. */
- lsr tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */
-#endif
- add limit_wd, limit, #7
- orr data1, data1, tmp2
- orr data2, data2, tmp2
- lsr limit_wd, limit_wd, #3
- b L(start_realigned)
-
-L(ret0):
- mov result, #0
- RET
-
- .p2align 6
-L(misaligned8):
- sub limit, limit, #1
-1:
- /* Perhaps we can do better than this. */
- ldrb data1w, [src1], #1
- ldrb data2w, [src2], #1
- subs limit, limit, #1
- ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
- b.eq 1b
- sub result, data1, data2
- RET
+ cmp data1, data2
+L(ret_eq):
+ cset result, ne
+ cneg result, result, lo
+ ret
+
+ .p2align 4
+ /* Compare up to 8 bytes. Limit is [-8..-1]. */
+L(less8):
+ adds limit, limit, 4
+ b.lo L(less4)
+ ldr data1w, [src1], 4
+ ldr data2w, [src2], 4
+ cmp data1w, data2w
+ b.ne L(return)
+ sub limit, limit, 4
+L(less4):
+ adds limit, limit, 4
+ beq L(ret_eq)
+L(byte_loop):
+ ldrb data1w, [src1], 1
+ ldrb data2w, [src2], 1
+ subs limit, limit, 1
+ ccmp data1w, data2w, 0, ne /* NZCV = 0b0000. */
+ b.eq L(byte_loop)
+ sub result, data1w, data2w
+ ret
+
END (memcmp)
#undef bcmp
weak_alias (memcmp, bcmp)
diff --git a/sysdeps/aarch64/memcpy.S b/sysdeps/aarch64/memcpy.S
index 442f390426..7e1163e6a0 100644
--- a/sysdeps/aarch64/memcpy.S
+++ b/sysdeps/aarch64/memcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,161 +16,252 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <sysdep.h>
+
/* Assumptions:
*
- * ARMv8-a, AArch64
- * Unaligned accesses
+ * ARMv8-a, AArch64, unaligned accesses.
*
*/
#define dstin x0
#define src x1
#define count x2
-#define tmp1 x3
-#define tmp1w w3
-#define tmp2 x4
-#define tmp2w w4
-#define tmp3 x5
-#define tmp3w w5
-#define dst x6
-
-#define A_l x7
-#define A_h x8
-#define B_l x9
-#define B_h x10
-#define C_l x11
-#define C_h x12
-#define D_l x13
-#define D_h x14
+#define dst x3
+#define srcend x4
+#define dstend x5
+#define A_l x6
+#define A_lw w6
+#define A_h x7
+#define A_hw w7
+#define B_l x8
+#define B_lw w8
+#define B_h x9
+#define C_l x10
+#define C_h x11
+#define D_l x12
+#define D_h x13
+#define E_l src
+#define E_h count
+#define F_l srcend
+#define F_h dst
+#define G_l count
+#define G_h dst
+#define tmp1 x14
-#include <sysdep.h>
+/* Copies are split into 3 main cases: small copies of up to 16 bytes,
+ medium copies of 17..96 bytes which are fully unrolled. Large copies
+ of more than 96 bytes align the destination and use an unrolled loop
+ processing 64 bytes per iteration.
+ In order to share code with memmove, small and medium copies read all
+ data before writing, allowing any kind of overlap. So small, medium
+ and large backwards memmoves are handled by falling through into memcpy.
+ Overlapping large forward memmoves use a loop that copies backwards.
+*/
-ENTRY_ALIGN (memcpy, 6)
-
- mov dst, dstin
- cmp count, #64
- b.ge L(cpy_not_short)
- cmp count, #15
- b.le L(tail15tiny)
-
- /* Deal with small copies quickly by dropping straight into the
- * exit block. */
-L(tail63):
- /* Copy up to 48 bytes of data. At this point we only need the
- * bottom 6 bits of count to be accurate. */
- ands tmp1, count, #0x30
- b.eq L(tail15)
- add dst, dst, tmp1
- add src, src, tmp1
- cmp tmp1w, #0x20
- b.eq 1f
- b.lt 2f
- ldp A_l, A_h, [src, #-48]
- stp A_l, A_h, [dst, #-48]
-1:
- ldp A_l, A_h, [src, #-32]
- stp A_l, A_h, [dst, #-32]
-2:
- ldp A_l, A_h, [src, #-16]
- stp A_l, A_h, [dst, #-16]
-
-L(tail15):
- ands count, count, #15
- beq 1f
- add src, src, count
- ldp A_l, A_h, [src, #-16]
- add dst, dst, count
- stp A_l, A_h, [dst, #-16]
-1:
- RET
-
-L(tail15tiny):
- /* Copy up to 15 bytes of data. Does not assume additional data
- being copied. */
- tbz count, #3, 1f
- ldr tmp1, [src], #8
- str tmp1, [dst], #8
+#ifndef MEMMOVE
+# define MEMMOVE memmove
+#endif
+#ifndef MEMCPY
+# define MEMCPY memcpy
+#endif
+
+ENTRY_ALIGN (MEMMOVE, 6)
+
+ DELOUSE (0)
+ DELOUSE (1)
+ DELOUSE (2)
+
+ sub tmp1, dstin, src
+ cmp count, 96
+ ccmp tmp1, count, 2, hi
+ b.lo L(move_long)
+
+ /* Common case falls through into memcpy. */
+END (MEMMOVE)
+libc_hidden_builtin_def (MEMMOVE)
+ENTRY (MEMCPY)
+
+ DELOUSE (0)
+ DELOUSE (1)
+ DELOUSE (2)
+
+ prfm PLDL1KEEP, [src]
+ add srcend, src, count
+ add dstend, dstin, count
+ cmp count, 16
+ b.ls L(copy16)
+ cmp count, 96
+ b.hi L(copy_long)
+
+ /* Medium copies: 17..96 bytes. */
+ sub tmp1, count, 1
+ ldp A_l, A_h, [src]
+ tbnz tmp1, 6, L(copy96)
+ ldp D_l, D_h, [srcend, -16]
+ tbz tmp1, 5, 1f
+ ldp B_l, B_h, [src, 16]
+ ldp C_l, C_h, [srcend, -32]
+ stp B_l, B_h, [dstin, 16]
+ stp C_l, C_h, [dstend, -32]
1:
- tbz count, #2, 1f
- ldr tmp1w, [src], #4
- str tmp1w, [dst], #4
+ stp A_l, A_h, [dstin]
+ stp D_l, D_h, [dstend, -16]
+ ret
+
+ .p2align 4
+ /* Small copies: 0..16 bytes. */
+L(copy16):
+ cmp count, 8
+ b.lo 1f
+ ldr A_l, [src]
+ ldr A_h, [srcend, -8]
+ str A_l, [dstin]
+ str A_h, [dstend, -8]
+ ret
+ .p2align 4
1:
- tbz count, #1, 1f
- ldrh tmp1w, [src], #2
- strh tmp1w, [dst], #2
+ tbz count, 2, 1f
+ ldr A_lw, [src]
+ ldr A_hw, [srcend, -4]
+ str A_lw, [dstin]
+ str A_hw, [dstend, -4]
+ ret
+
+ /* Copy 0..3 bytes. Use a branchless sequence that copies the same
+ byte 3 times if count==1, or the 2nd byte twice if count==2. */
1:
- tbz count, #0, 1f
- ldrb tmp1w, [src]
- strb tmp1w, [dst]
+ cbz count, 2f
+ lsr tmp1, count, 1
+ ldrb A_lw, [src]
+ ldrb A_hw, [srcend, -1]
+ ldrb B_lw, [src, tmp1]
+ strb A_lw, [dstin]
+ strb B_lw, [dstin, tmp1]
+ strb A_hw, [dstend, -1]
+2: ret
+
+ .p2align 4
+ /* Copy 64..96 bytes. Copy 64 bytes from the start and
+ 32 bytes from the end. */
+L(copy96):
+ ldp B_l, B_h, [src, 16]
+ ldp C_l, C_h, [src, 32]
+ ldp D_l, D_h, [src, 48]
+ ldp E_l, E_h, [srcend, -32]
+ ldp F_l, F_h, [srcend, -16]
+ stp A_l, A_h, [dstin]
+ stp B_l, B_h, [dstin, 16]
+ stp C_l, C_h, [dstin, 32]
+ stp D_l, D_h, [dstin, 48]
+ stp E_l, E_h, [dstend, -32]
+ stp F_l, F_h, [dstend, -16]
+ ret
+
+ /* Align DST to 16 byte alignment so that we don't cross cache line
+ boundaries on both loads and stores. There are at least 96 bytes
+ to copy, so copy 16 bytes unaligned and then align. The loop
+ copies 64 bytes per iteration and prefetches one iteration ahead. */
+
+ .p2align 4
+L(copy_long):
+ and tmp1, dstin, 15
+ bic dst, dstin, 15
+ ldp D_l, D_h, [src]
+ sub src, src, tmp1
+ add count, count, tmp1 /* Count is now 16 too large. */
+ ldp A_l, A_h, [src, 16]
+ stp D_l, D_h, [dstin]
+ ldp B_l, B_h, [src, 32]
+ ldp C_l, C_h, [src, 48]
+ ldp D_l, D_h, [src, 64]!
+ subs count, count, 128 + 16 /* Test and readjust count. */
+ b.ls L(last64)
+L(loop64):
+ stp A_l, A_h, [dst, 16]
+ ldp A_l, A_h, [src, 16]
+ stp B_l, B_h, [dst, 32]
+ ldp B_l, B_h, [src, 32]
+ stp C_l, C_h, [dst, 48]
+ ldp C_l, C_h, [src, 48]
+ stp D_l, D_h, [dst, 64]!
+ ldp D_l, D_h, [src, 64]!
+ subs count, count, 64
+ b.hi L(loop64)
+
+ /* Write the last full set of 64 bytes. The remainder is at most 64
+ bytes, so it is safe to always copy 64 bytes from the end even if
+ there is just 1 byte left. */
+L(last64):
+ ldp E_l, E_h, [srcend, -64]
+ stp A_l, A_h, [dst, 16]
+ ldp A_l, A_h, [srcend, -48]
+ stp B_l, B_h, [dst, 32]
+ ldp B_l, B_h, [srcend, -32]
+ stp C_l, C_h, [dst, 48]
+ ldp C_l, C_h, [srcend, -16]
+ stp D_l, D_h, [dst, 64]
+ stp E_l, E_h, [dstend, -64]
+ stp A_l, A_h, [dstend, -48]
+ stp B_l, B_h, [dstend, -32]
+ stp C_l, C_h, [dstend, -16]
+ ret
+
+ .p2align 4
+L(move_long):
+ cbz tmp1, 3f
+
+ add srcend, src, count
+ add dstend, dstin, count
+
+ /* Align dstend to 16 byte alignment so that we don't cross cache line
+ boundaries on both loads and stores. There are at least 96 bytes
+ to copy, so copy 16 bytes unaligned and then align. The loop
+ copies 64 bytes per iteration and prefetches one iteration ahead. */
+
+ and tmp1, dstend, 15
+ ldp D_l, D_h, [srcend, -16]
+ sub srcend, srcend, tmp1
+ sub count, count, tmp1
+ ldp A_l, A_h, [srcend, -16]
+ stp D_l, D_h, [dstend, -16]
+ ldp B_l, B_h, [srcend, -32]
+ ldp C_l, C_h, [srcend, -48]
+ ldp D_l, D_h, [srcend, -64]!
+ sub dstend, dstend, tmp1
+ subs count, count, 128
+ b.ls 2f
+
+ nop
1:
- RET
-
-L(cpy_not_short):
- /* We don't much care about the alignment of DST, but we want SRC
- * to be 128-bit (16 byte) aligned so that we don't cross cache line
- * boundaries on both loads and stores. */
- neg tmp2, src
- ands tmp2, tmp2, #15 /* Bytes to reach alignment. */
- b.eq 2f
- sub count, count, tmp2
- /* Copy more data than needed; it's faster than jumping
- * around copying sub-Quadword quantities. We know that
- * it can't overrun. */
- ldp A_l, A_h, [src]
- add src, src, tmp2
- stp A_l, A_h, [dst]
- add dst, dst, tmp2
- /* There may be less than 63 bytes to go now. */
- cmp count, #63
- b.le L(tail63)
+ stp A_l, A_h, [dstend, -16]
+ ldp A_l, A_h, [srcend, -16]
+ stp B_l, B_h, [dstend, -32]
+ ldp B_l, B_h, [srcend, -32]
+ stp C_l, C_h, [dstend, -48]
+ ldp C_l, C_h, [srcend, -48]
+ stp D_l, D_h, [dstend, -64]!
+ ldp D_l, D_h, [srcend, -64]!
+ subs count, count, 64
+ b.hi 1b
+
+ /* Write the last full set of 64 bytes. The remainder is at most 64
+ bytes, so it is safe to always copy 64 bytes from the start even if
+ there is just 1 byte left. */
2:
- subs count, count, #128
- b.ge L(cpy_body_large)
- /* Less than 128 bytes to copy, so handle 64 here and then jump
- * to the tail. */
- ldp A_l, A_h, [src]
- ldp B_l, B_h, [src, #16]
- ldp C_l, C_h, [src, #32]
- ldp D_l, D_h, [src, #48]
- stp A_l, A_h, [dst]
- stp B_l, B_h, [dst, #16]
- stp C_l, C_h, [dst, #32]
- stp D_l, D_h, [dst, #48]
- tst count, #0x3f
- add src, src, #64
- add dst, dst, #64
- b.ne L(tail63)
- RET
-
- /* Critical loop. Start at a new cache line boundary. Assuming
- * 64 bytes per line this ensures the entire loop is in one line. */
- .p2align 6
-L(cpy_body_large):
- /* There are at least 128 bytes to copy. */
- ldp A_l, A_h, [src, #0]
- sub dst, dst, #16 /* Pre-bias. */
- ldp B_l, B_h, [src, #16]
- ldp C_l, C_h, [src, #32]
- ldp D_l, D_h, [src, #48]! /* src += 64 - Pre-bias. */
-1:
- stp A_l, A_h, [dst, #16]
- ldp A_l, A_h, [src, #16]
- stp B_l, B_h, [dst, #32]
- ldp B_l, B_h, [src, #32]
- stp C_l, C_h, [dst, #48]
- ldp C_l, C_h, [src, #48]
- stp D_l, D_h, [dst, #64]!
- ldp D_l, D_h, [src, #64]!
- subs count, count, #64
- b.ge 1b
- stp A_l, A_h, [dst, #16]
- stp B_l, B_h, [dst, #32]
- stp C_l, C_h, [dst, #48]
- stp D_l, D_h, [dst, #64]
- add src, src, #16
- add dst, dst, #64 + 16
- tst count, #0x3f
- b.ne L(tail63)
- RET
-END (memcpy)
-libc_hidden_builtin_def (memcpy)
+ ldp G_l, G_h, [src, 48]
+ stp A_l, A_h, [dstend, -16]
+ ldp A_l, A_h, [src, 32]
+ stp B_l, B_h, [dstend, -32]
+ ldp B_l, B_h, [src, 16]
+ stp C_l, C_h, [dstend, -48]
+ ldp C_l, C_h, [src]
+ stp D_l, D_h, [dstend, -64]
+ stp G_l, G_h, [dstin, 48]
+ stp A_l, A_h, [dstin, 32]
+ stp B_l, B_h, [dstin, 16]
+ stp C_l, C_h, [dstin]
+3: ret
+
+END (MEMCPY)
+libc_hidden_builtin_def (MEMCPY)
diff --git a/sysdeps/aarch64/memmove.S b/sysdeps/aarch64/memmove.S
index dd91db0ff6..0feeac8414 100644
--- a/sysdeps/aarch64/memmove.S
+++ b/sysdeps/aarch64/memmove.S
@@ -1,312 +1 @@
-/* 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/>. */
-
-#include <sysdep.h>
-
-/* Assumptions:
- *
- * ARMv8-a, AArch64
- * Unaligned accesses
- */
-
-/* Parameters and result. */
-#define dstin x0
-#define src x1
-#define count x2
-#define tmp1 x3
-#define tmp1w w3
-#define tmp2 x4
-#define tmp2w w4
-#define tmp3 x5
-#define tmp3w w5
-#define dst x6
-
-#define A_l x7
-#define A_h x8
-#define B_l x9
-#define B_h x10
-#define C_l x11
-#define C_h x12
-#define D_l x13
-#define D_h x14
-
-ENTRY_ALIGN (memmove, 6)
-
- cmp dstin, src
- b.lo L(downwards)
- add tmp1, src, count
- cmp dstin, tmp1
- b.hs memcpy /* No overlap. */
-
- /* Upwards move with potential overlap.
- * Need to move from the tail backwards. SRC and DST point one
- * byte beyond the remaining data to move. */
- add dst, dstin, count
- add src, src, count
- cmp count, #64
- b.ge L(mov_not_short_up)
-
- /* Deal with small moves quickly by dropping straight into the
- * exit block. */
-L(tail63up):
- /* Move up to 48 bytes of data. At this point we only need the
- * bottom 6 bits of count to be accurate. */
- ands tmp1, count, #0x30
- b.eq L(tail15up)
- sub dst, dst, tmp1
- sub src, src, tmp1
- cmp tmp1w, #0x20
- b.eq 1f
- b.lt 2f
- ldp A_l, A_h, [src, #32]
- stp A_l, A_h, [dst, #32]
-1:
- ldp A_l, A_h, [src, #16]
- stp A_l, A_h, [dst, #16]
-2:
- ldp A_l, A_h, [src]
- stp A_l, A_h, [dst]
-L(tail15up):
- /* Move up to 15 bytes of data. Does not assume additional data
- * being moved. */
- tbz count, #3, 1f
- ldr tmp1, [src, #-8]!
- str tmp1, [dst, #-8]!
-1:
- tbz count, #2, 1f
- ldr tmp1w, [src, #-4]!
- str tmp1w, [dst, #-4]!
-1:
- tbz count, #1, 1f
- ldrh tmp1w, [src, #-2]!
- strh tmp1w, [dst, #-2]!
-1:
- tbz count, #0, 1f
- ldrb tmp1w, [src, #-1]
- strb tmp1w, [dst, #-1]
-1:
- RET
-
-L(mov_not_short_up):
- /* We don't much care about the alignment of DST, but we want SRC
- * to be 128-bit (16 byte) aligned so that we don't cross cache line
- * boundaries on both loads and stores. */
- ands tmp2, src, #15 /* Bytes to reach alignment. */
- b.eq 2f
- sub count, count, tmp2
- /* Move enough data to reach alignment; unlike memcpy, we have to
- * be aware of the overlap, which means we can't move data twice. */
- tbz tmp2, #3, 1f
- ldr tmp1, [src, #-8]!
- str tmp1, [dst, #-8]!
-1:
- tbz tmp2, #2, 1f
- ldr tmp1w, [src, #-4]!
- str tmp1w, [dst, #-4]!
-1:
- tbz tmp2, #1, 1f
- ldrh tmp1w, [src, #-2]!
- strh tmp1w, [dst, #-2]!
-1:
- tbz tmp2, #0, 1f
- ldrb tmp1w, [src, #-1]!
- strb tmp1w, [dst, #-1]!
-1:
-
- /* There may be less than 63 bytes to go now. */
- cmp count, #63
- b.le L(tail63up)
-2:
- subs count, count, #128
- b.ge L(mov_body_large_up)
- /* Less than 128 bytes to move, so handle 64 here and then jump
- * to the tail. */
- ldp A_l, A_h, [src, #-64]!
- ldp B_l, B_h, [src, #16]
- ldp C_l, C_h, [src, #32]
- ldp D_l, D_h, [src, #48]
- stp A_l, A_h, [dst, #-64]!
- stp B_l, B_h, [dst, #16]
- stp C_l, C_h, [dst, #32]
- stp D_l, D_h, [dst, #48]
- tst count, #0x3f
- b.ne L(tail63up)
- RET
-
- /* Critical loop. Start at a new Icache line boundary. Assuming
- * 64 bytes per line this ensures the entire loop is in one line. */
- .p2align 6
-L(mov_body_large_up):
- /* There are at least 128 bytes to move. */
- ldp A_l, A_h, [src, #-16]
- ldp B_l, B_h, [src, #-32]
- ldp C_l, C_h, [src, #-48]
- ldp D_l, D_h, [src, #-64]!
-1:
- stp A_l, A_h, [dst, #-16]
- ldp A_l, A_h, [src, #-16]
- stp B_l, B_h, [dst, #-32]
- ldp B_l, B_h, [src, #-32]
- stp C_l, C_h, [dst, #-48]
- ldp C_l, C_h, [src, #-48]
- stp D_l, D_h, [dst, #-64]!
- ldp D_l, D_h, [src, #-64]!
- subs count, count, #64
- b.ge 1b
- stp A_l, A_h, [dst, #-16]
- stp B_l, B_h, [dst, #-32]
- stp C_l, C_h, [dst, #-48]
- stp D_l, D_h, [dst, #-64]!
- tst count, #0x3f
- b.ne L(tail63up)
- RET
-
-L(downwards):
- /* For a downwards move we can safely use memcpy provided that
- * DST is more than 16 bytes away from SRC. */
- sub tmp1, src, #16
- cmp dstin, tmp1
- b.ls memcpy /* May overlap, but not critically. */
-
- mov dst, dstin /* Preserve DSTIN for return value. */
- cmp count, #64
- b.ge L(mov_not_short_down)
-
- /* Deal with small moves quickly by dropping straight into the
- * exit block. */
-L(tail63down):
- /* Move up to 48 bytes of data. At this point we only need the
- * bottom 6 bits of count to be accurate. */
- ands tmp1, count, #0x30
- b.eq L(tail15down)
- add dst, dst, tmp1
- add src, src, tmp1
- cmp tmp1w, #0x20
- b.eq 1f
- b.lt 2f
- ldp A_l, A_h, [src, #-48]
- stp A_l, A_h, [dst, #-48]
-1:
- ldp A_l, A_h, [src, #-32]
- stp A_l, A_h, [dst, #-32]
-2:
- ldp A_l, A_h, [src, #-16]
- stp A_l, A_h, [dst, #-16]
-L(tail15down):
- /* Move up to 15 bytes of data. Does not assume additional data
- being moved. */
- tbz count, #3, 1f
- ldr tmp1, [src], #8
- str tmp1, [dst], #8
-1:
- tbz count, #2, 1f
- ldr tmp1w, [src], #4
- str tmp1w, [dst], #4
-1:
- tbz count, #1, 1f
- ldrh tmp1w, [src], #2
- strh tmp1w, [dst], #2
-1:
- tbz count, #0, 1f
- ldrb tmp1w, [src]
- strb tmp1w, [dst]
-1:
- RET
-
-L(mov_not_short_down):
- /* We don't much care about the alignment of DST, but we want SRC
- * to be 128-bit (16 byte) aligned so that we don't cross cache line
- * boundaries on both loads and stores. */
- neg tmp2, src
- ands tmp2, tmp2, #15 /* Bytes to reach alignment. */
- b.eq 2f
- sub count, count, tmp2
- /* Move enough data to reach alignment; unlike memcpy, we have to
- * be aware of the overlap, which means we can't move data twice. */
- tbz tmp2, #3, 1f
- ldr tmp1, [src], #8
- str tmp1, [dst], #8
-1:
- tbz tmp2, #2, 1f
- ldr tmp1w, [src], #4
- str tmp1w, [dst], #4
-1:
- tbz tmp2, #1, 1f
- ldrh tmp1w, [src], #2
- strh tmp1w, [dst], #2
-1:
- tbz tmp2, #0, 1f
- ldrb tmp1w, [src], #1
- strb tmp1w, [dst], #1
-1:
-
- /* There may be less than 63 bytes to go now. */
- cmp count, #63
- b.le L(tail63down)
-2:
- subs count, count, #128
- b.ge L(mov_body_large_down)
- /* Less than 128 bytes to move, so handle 64 here and then jump
- * to the tail. */
- ldp A_l, A_h, [src]
- ldp B_l, B_h, [src, #16]
- ldp C_l, C_h, [src, #32]
- ldp D_l, D_h, [src, #48]
- stp A_l, A_h, [dst]
- stp B_l, B_h, [dst, #16]
- stp C_l, C_h, [dst, #32]
- stp D_l, D_h, [dst, #48]
- tst count, #0x3f
- add src, src, #64
- add dst, dst, #64
- b.ne L(tail63down)
- RET
-
- /* Critical loop. Start at a new cache line boundary. Assuming
- * 64 bytes per line this ensures the entire loop is in one line. */
- .p2align 6
-L(mov_body_large_down):
- /* There are at least 128 bytes to move. */
- ldp A_l, A_h, [src, #0]
- sub dst, dst, #16 /* Pre-bias. */
- ldp B_l, B_h, [src, #16]
- ldp C_l, C_h, [src, #32]
- ldp D_l, D_h, [src, #48]! /* src += 64 - Pre-bias. */
-1:
- stp A_l, A_h, [dst, #16]
- ldp A_l, A_h, [src, #16]
- stp B_l, B_h, [dst, #32]
- ldp B_l, B_h, [src, #32]
- stp C_l, C_h, [dst, #48]
- ldp C_l, C_h, [src, #48]
- stp D_l, D_h, [dst, #64]!
- ldp D_l, D_h, [src, #64]!
- subs count, count, #64
- b.ge 1b
- stp A_l, A_h, [dst, #16]
- stp B_l, B_h, [dst, #32]
- stp C_l, C_h, [dst, #48]
- stp D_l, D_h, [dst, #64]
- add src, src, #16
- add dst, dst, #64 + 16
- tst count, #0x3f
- b.ne L(tail63down)
- RET
-END (memmove)
-
-libc_hidden_builtin_def (memmove)
+/* memmove is part of memcpy.S. */
diff --git a/sysdeps/aarch64/memset-reg.h b/sysdeps/aarch64/memset-reg.h
new file mode 100644
index 0000000000..ac7c083867
--- /dev/null
+++ b/sysdeps/aarch64/memset-reg.h
@@ -0,0 +1,30 @@
+/* Register aliases for memset to be used across implementations.
+ Copyright (C) 2017-2018 Free Software 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 dstin x0
+#define val x1
+#define valw w1
+#define count x2
+#define dst x3
+#define dstend x4
+#define tmp1 x5
+#define tmp1w w5
+#define tmp2 x6
+#define tmp2w w6
+#define zva_len x7
+#define zva_lenw w7
diff --git a/sysdeps/aarch64/memset.S b/sysdeps/aarch64/memset.S
index e49f4d6faf..4a45459361 100644
--- a/sysdeps/aarch64/memset.S
+++ b/sysdeps/aarch64/memset.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,214 +16,175 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <sysdep.h>
+#include "memset-reg.h"
+
+#ifndef MEMSET
+# define MEMSET memset
+#endif
+
/* Assumptions:
*
- * ARMv8-a, AArch64
- * Unaligned accesses
+ * ARMv8-a, AArch64, unaligned accesses
*
*/
-#include <sysdep.h>
-
-/* By default we assume that the DC instruction can be used to zero
- data blocks more efficiently. In some circumstances this might be
- unsafe, for example in an asymmetric multiprocessor environment with
- different DC clear lengths (neither the upper nor lower lengths are
- safe to use). The feature can be disabled by defining DONT_USE_DC.
-
- If code may be run in a virtualized environment, then define
- MAYBE_VIRT. This will cause the code to cache the system register
- values rather than re-reading them each call. */
-
-#define dstin x0
-#define val w1
-#define count x2
-#define tmp1 x3
-#define tmp1w w3
-#define tmp2 x4
-#define tmp2w w4
-#define zva_len_x x5
-#define zva_len w5
-#define zva_bits_x x6
-
-#define A_l x7
-#define A_lw w7
-#define dst x8
-#define tmp3w w9
-
-ENTRY_ALIGN (__memset, 6)
-
- mov dst, dstin /* Preserve return value. */
- ands A_lw, val, #255
-#ifndef DONT_USE_DC
- b.eq L(zero_mem)
-#endif
- orr A_lw, A_lw, A_lw, lsl #8
- orr A_lw, A_lw, A_lw, lsl #16
- orr A_l, A_l, A_l, lsl #32
-L(tail_maybe_long):
- cmp count, #64
- b.ge L(not_short)
-L(tail_maybe_tiny):
- cmp count, #15
- b.le L(tail15tiny)
-L(tail63):
- ands tmp1, count, #0x30
- b.eq L(tail15)
- add dst, dst, tmp1
- cmp tmp1w, #0x20
- b.eq 1f
- b.lt 2f
- stp A_l, A_l, [dst, #-48]
-1:
- stp A_l, A_l, [dst, #-32]
-2:
- stp A_l, A_l, [dst, #-16]
-
-L(tail15):
- and count, count, #15
- add dst, dst, count
- stp A_l, A_l, [dst, #-16] /* Repeat some/all of last store. */
- RET
-
-L(tail15tiny):
- /* Set up to 15 bytes. Does not assume earlier memory
- being set. */
- tbz count, #3, 1f
- str A_l, [dst], #8
-1:
- tbz count, #2, 1f
- str A_lw, [dst], #4
-1:
- tbz count, #1, 1f
- strh A_lw, [dst], #2
-1:
- tbz count, #0, 1f
- strb A_lw, [dst]
-1:
- RET
-
- /* Critical loop. Start at a new cache line boundary. Assuming
- * 64 bytes per line, this ensures the entire loop is in one line. */
- .p2align 6
-L(not_short):
- neg tmp2, dst
- ands tmp2, tmp2, #15
- b.eq 2f
- /* Bring DST to 128-bit (16-byte) alignment. We know that there's
- * more than that to set, so we simply store 16 bytes and advance by
- * the amount required to reach alignment. */
- sub count, count, tmp2
- stp A_l, A_l, [dst]
- add dst, dst, tmp2
- /* There may be less than 63 bytes to go now. */
- cmp count, #63
- b.le L(tail63)
-2:
- sub dst, dst, #16 /* Pre-bias. */
- sub count, count, #64
-1:
- stp A_l, A_l, [dst, #16]
- stp A_l, A_l, [dst, #32]
- stp A_l, A_l, [dst, #48]
- stp A_l, A_l, [dst, #64]!
- subs count, count, #64
- b.ge 1b
- tst count, #0x3f
- add dst, dst, #16
- b.ne L(tail63)
- RET
-
-#ifndef DONT_USE_DC
- /* For zeroing memory, check to see if we can use the ZVA feature to
- * zero entire 'cache' lines. */
-L(zero_mem):
- mov A_l, #0
- cmp count, #63
- b.le L(tail_maybe_tiny)
- neg tmp2, dst
- ands tmp2, tmp2, #15
- b.eq 1f
- sub count, count, tmp2
- stp A_l, A_l, [dst]
- add dst, dst, tmp2
- cmp count, #63
- b.le L(tail63)
-1:
- /* For zeroing small amounts of memory, it's not worth setting up
- * the line-clear code. */
- cmp count, #128
- b.lt L(not_short)
-#ifdef MAYBE_VIRT
- /* For efficiency when virtualized, we cache the ZVA capability. */
- adrp tmp2, L(cache_clear)
- ldr zva_len, [tmp2, #:lo12:L(cache_clear)]
- tbnz zva_len, #31, L(not_short)
- cbnz zva_len, L(zero_by_line)
- mrs tmp1, dczid_el0
- tbz tmp1, #4, 1f
- /* ZVA not available. Remember this for next time. */
- mov zva_len, #~0
- str zva_len, [tmp2, #:lo12:L(cache_clear)]
- b L(not_short)
-1:
- mov tmp3w, #4
- and zva_len, tmp1w, #15 /* Safety: other bits reserved. */
- lsl zva_len, tmp3w, zva_len
- str zva_len, [tmp2, #:lo12:L(cache_clear)]
+ENTRY_ALIGN (MEMSET, 6)
+
+ DELOUSE (0)
+ DELOUSE (2)
+
+ dup v0.16B, valw
+ add dstend, dstin, count
+
+ cmp count, 96
+ b.hi L(set_long)
+ cmp count, 16
+ b.hs L(set_medium)
+ mov val, v0.D[0]
+
+ /* Set 0..15 bytes. */
+ tbz count, 3, 1f
+ str val, [dstin]
+ str val, [dstend, -8]
+ ret
+ nop
+1: tbz count, 2, 2f
+ str valw, [dstin]
+ str valw, [dstend, -4]
+ ret
+2: cbz count, 3f
+ strb valw, [dstin]
+ tbz count, 1, 3f
+ strh valw, [dstend, -2]
+3: ret
+
+ /* Set 17..96 bytes. */
+L(set_medium):
+ str q0, [dstin]
+ tbnz count, 6, L(set96)
+ str q0, [dstend, -16]
+ tbz count, 5, 1f
+ str q0, [dstin, 16]
+ str q0, [dstend, -32]
+1: ret
+
+ .p2align 4
+ /* Set 64..96 bytes. Write 64 bytes from the start and
+ 32 bytes from the end. */
+L(set96):
+ str q0, [dstin, 16]
+ stp q0, q0, [dstin, 32]
+ stp q0, q0, [dstend, -32]
+ ret
+
+ .p2align 3
+ nop
+L(set_long):
+ and valw, valw, 255
+ bic dst, dstin, 15
+ str q0, [dstin]
+ cmp count, 256
+ ccmp valw, 0, 0, cs
+ b.eq L(try_zva)
+L(no_zva):
+ sub count, dstend, dst /* Count is 16 too large. */
+ add dst, dst, 16
+ sub count, count, 64 + 16 /* Adjust count and bias for loop. */
+1: stp q0, q0, [dst], 64
+ stp q0, q0, [dst, -32]
+L(tail64):
+ subs count, count, 64
+ b.hi 1b
+2: stp q0, q0, [dstend, -64]
+ stp q0, q0, [dstend, -32]
+ ret
+
+L(try_zva):
+#ifdef ZVA_MACRO
+ zva_macro
#else
+ .p2align 3
mrs tmp1, dczid_el0
- tbnz tmp1, #4, L(not_short)
- mov tmp3w, #4
- and zva_len, tmp1w, #15 /* Safety: other bits reserved. */
- lsl zva_len, tmp3w, zva_len
-#endif
-
-L(zero_by_line):
- /* Compute how far we need to go to become suitably aligned. We're
- * already at quad-word alignment. */
- cmp count, zva_len_x
- b.lt L(not_short) /* Not enough to reach alignment. */
- sub zva_bits_x, zva_len_x, #1
- neg tmp2, dst
- ands tmp2, tmp2, zva_bits_x
- b.eq 1f /* Already aligned. */
- /* Not aligned, check that there's enough to copy after alignment. */
- sub tmp1, count, tmp2
- cmp tmp1, #64
- ccmp tmp1, zva_len_x, #8, ge /* NZCV=0b1000 */
- b.lt L(not_short)
- /* We know that there's at least 64 bytes to zero and that it's safe
- * to overrun by 64 bytes. */
- mov count, tmp1
-2:
- stp A_l, A_l, [dst]
- stp A_l, A_l, [dst, #16]
- stp A_l, A_l, [dst, #32]
- subs tmp2, tmp2, #64
- stp A_l, A_l, [dst, #48]
- add dst, dst, #64
- b.ge 2b
- /* We've overrun a bit, so adjust dst downwards. */
- add dst, dst, tmp2
-1:
- sub count, count, zva_len_x
-3:
- dc zva, dst
- add dst, dst, zva_len_x
- subs count, count, zva_len_x
- b.ge 3b
- ands count, count, zva_bits_x
- b.ne L(tail_maybe_long)
- RET
-#ifdef MAYBE_VIRT
- .bss
- .p2align 2
-L(cache_clear):
- .space 4
+ tbnz tmp1w, 4, L(no_zva)
+ and tmp1w, tmp1w, 15
+ cmp tmp1w, 4 /* ZVA size is 64 bytes. */
+ b.ne L(zva_128)
+
+ /* Write the first and last 64 byte aligned block using stp rather
+ than using DC ZVA. This is faster on some cores.
+ */
+L(zva_64):
+ str q0, [dst, 16]
+ stp q0, q0, [dst, 32]
+ bic dst, dst, 63
+ stp q0, q0, [dst, 64]
+ stp q0, q0, [dst, 96]
+ sub count, dstend, dst /* Count is now 128 too large. */
+ sub count, count, 128+64+64 /* Adjust count and bias for loop. */
+ add dst, dst, 128
+ nop
+1: dc zva, dst
+ add dst, dst, 64
+ subs count, count, 64
+ b.hi 1b
+ stp q0, q0, [dst, 0]
+ stp q0, q0, [dst, 32]
+ stp q0, q0, [dstend, -64]
+ stp q0, q0, [dstend, -32]
+ ret
+
+ .p2align 3
+L(zva_128):
+ cmp tmp1w, 5 /* ZVA size is 128 bytes. */
+ b.ne L(zva_other)
+
+ str q0, [dst, 16]
+ stp q0, q0, [dst, 32]
+ stp q0, q0, [dst, 64]
+ stp q0, q0, [dst, 96]
+ bic dst, dst, 127
+ sub count, dstend, dst /* Count is now 128 too large. */
+ sub count, count, 128+128 /* Adjust count and bias for loop. */
+ add dst, dst, 128
+1: dc zva, dst
+ add dst, dst, 128
+ subs count, count, 128
+ b.hi 1b
+ stp q0, q0, [dstend, -128]
+ stp q0, q0, [dstend, -96]
+ stp q0, q0, [dstend, -64]
+ stp q0, q0, [dstend, -32]
+ ret
+
+L(zva_other):
+ mov tmp2w, 4
+ lsl zva_lenw, tmp2w, tmp1w
+ add tmp1, zva_len, 64 /* Max alignment bytes written. */
+ cmp count, tmp1
+ blo L(no_zva)
+
+ sub tmp2, zva_len, 1
+ add tmp1, dst, zva_len
+ add dst, dst, 16
+ subs count, tmp1, dst /* Actual alignment bytes to write. */
+ bic tmp1, tmp1, tmp2 /* Aligned dc zva start address. */
+ beq 2f
+1: stp q0, q0, [dst], 64
+ stp q0, q0, [dst, -32]
+ subs count, count, 64
+ b.hi 1b
+2: mov dst, tmp1
+ sub count, dstend, tmp1 /* Remaining bytes to write. */
+ subs count, count, zva_len
+ b.lo 4f
+3: dc zva, dst
+ add dst, dst, zva_len
+ subs count, count, zva_len
+ b.hs 3b
+4: add count, count, zva_len
+ b L(tail64)
#endif
-#endif /* DONT_USE_DC */
-END (__memset)
-weak_alias (__memset, memset)
-libc_hidden_builtin_def (memset)
+END (MEMSET)
+libc_hidden_builtin_def (MEMSET)
diff --git a/sysdeps/aarch64/memusage.h b/sysdeps/aarch64/memusage.h
index 70bf2ce859..874f3b5b3d 100644
--- a/sysdeps/aarch64/memusage.h
+++ b/sysdeps/aarch64/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/multiarch/Makefile b/sysdeps/aarch64/multiarch/Makefile
new file mode 100644
index 0000000000..57ffdf7238
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/Makefile
@@ -0,0 +1,4 @@
+ifeq ($(subdir),string)
+sysdep_routines += memcpy_generic memcpy_thunderx memcpy_thunderx2 \
+ memcpy_falkor memmove_falkor memset_generic memset_falkor
+endif
diff --git a/sysdeps/aarch64/multiarch/ifunc-impl-list.c b/sysdeps/aarch64/multiarch/ifunc-impl-list.c
new file mode 100644
index 0000000000..e55be80103
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/ifunc-impl-list.c
@@ -0,0 +1,57 @@
+/* Enumerate available IFUNC implementations of a function. AARCH64 version.
+ Copyright (C) 2017-2018 Free Software 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 <assert.h>
+#include <string.h>
+#include <wchar.h>
+#include <ldsodefs.h>
+#include <ifunc-impl-list.h>
+#include <init-arch.h>
+#include <stdio.h>
+
+/* Maximum number of IFUNC implementations. */
+#define MAX_IFUNC 4
+
+size_t
+__libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+ size_t max)
+{
+ assert (max >= MAX_IFUNC);
+
+ size_t i = 0;
+
+ INIT_ARCH ();
+
+ /* Support sysdeps/aarch64/multiarch/memcpy.c and memmove.c. */
+ IFUNC_IMPL (i, name, memcpy,
+ IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_thunderx)
+ IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_thunderx2)
+ IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_falkor)
+ IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_generic))
+ IFUNC_IMPL (i, name, memmove,
+ IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_thunderx)
+ IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_falkor)
+ IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_generic))
+ IFUNC_IMPL (i, name, memset,
+ /* Enable this on non-falkor processors too so that other cores
+ can do a comparative analysis with __memset_generic. */
+ IFUNC_IMPL_ADD (array, i, memset, (zva_size == 64), __memset_falkor)
+ IFUNC_IMPL_ADD (array, i, memset, 1, __memset_generic))
+
+ return i;
+}
diff --git a/sysdeps/aarch64/multiarch/init-arch.h b/sysdeps/aarch64/multiarch/init-arch.h
new file mode 100644
index 0000000000..d1e5703cb2
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/init-arch.h
@@ -0,0 +1,25 @@
+/* Define INIT_ARCH so that midr is initialized before use by IFUNCs.
+ This file is part of the GNU C Library.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <ldsodefs.h>
+
+#define INIT_ARCH() \
+ uint64_t __attribute__((unused)) midr = \
+ GLRO(dl_aarch64_cpu_features).midr_el1; \
+ unsigned __attribute__((unused)) zva_size = \
+ GLRO(dl_aarch64_cpu_features).zva_size;
diff --git a/sysdeps/aarch64/multiarch/memcpy.c b/sysdeps/aarch64/multiarch/memcpy.c
new file mode 100644
index 0000000000..4a04a63b0f
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memcpy.c
@@ -0,0 +1,47 @@
+/* Multiple versions of memcpy. AARCH64 version.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+
+#if IS_IN (libc)
+/* Redefine memcpy so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias, below. */
+# undef memcpy
+# define memcpy __redirect_memcpy
+# include <string.h>
+# include <init-arch.h>
+
+extern __typeof (__redirect_memcpy) __libc_memcpy;
+
+extern __typeof (__redirect_memcpy) __memcpy_generic attribute_hidden;
+extern __typeof (__redirect_memcpy) __memcpy_thunderx attribute_hidden;
+extern __typeof (__redirect_memcpy) __memcpy_thunderx2 attribute_hidden;
+extern __typeof (__redirect_memcpy) __memcpy_falkor attribute_hidden;
+
+libc_ifunc (__libc_memcpy,
+ (IS_THUNDERX (midr)
+ ? __memcpy_thunderx
+ : (IS_FALKOR (midr) || IS_PHECDA (midr)
+ ? __memcpy_falkor
+ : (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr)
+ ? __memcpy_thunderx2
+ : __memcpy_generic))));
+
+# undef memcpy
+strong_alias (__libc_memcpy, memcpy);
+#endif
diff --git a/sysdeps/aarch64/multiarch/memcpy_falkor.S b/sysdeps/aarch64/multiarch/memcpy_falkor.S
new file mode 100644
index 0000000000..cdc2de4750
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memcpy_falkor.S
@@ -0,0 +1,191 @@
+/* Optimized memcpy for Qualcomm Falkor processor.
+ Copyright (C) 2017-2018 Free Software 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, falkor, unaligned accesses. */
+
+#define dstin x0
+#define src x1
+#define count x2
+#define dst x3
+#define srcend x4
+#define dstend x5
+#define tmp1 x14
+#define A_x x6
+#define B_x x7
+#define A_w w6
+#define B_w w7
+
+#define A_q q0
+#define B_q q1
+#define C_q q2
+#define D_q q3
+#define E_q q4
+#define F_q q5
+#define G_q q6
+
+/* Copies are split into 3 main cases:
+
+ 1. Small copies of up to 32 bytes
+ 2. Medium copies of 33..128 bytes which are fully unrolled
+ 3. Large copies of more than 128 bytes.
+
+ Large copies align the sourceto a quad word and use an unrolled loop
+ processing 64 bytes per iteration.
+
+ FALKOR-SPECIFIC DESIGN:
+
+ The smallest copies (32 bytes or less) focus on optimal pipeline usage,
+ which is why the redundant copies of 0-3 bytes have been replaced with
+ conditionals, since the former would unnecessarily break across multiple
+ issue groups. The medium copy group has been enlarged to 128 bytes since
+ bumping up the small copies up to 32 bytes allows us to do that without
+ cost and also allows us to reduce the size of the prep code before loop64.
+
+ The copy loop uses only one register q0. This is to ensure that all loads
+ hit a single hardware prefetcher which can get correctly trained to prefetch
+ a single stream.
+
+ The non-temporal stores help optimize cache utilization. */
+
+#if IS_IN (libc)
+ENTRY_ALIGN (__memcpy_falkor, 6)
+
+ cmp count, 32
+ add srcend, src, count
+ add dstend, dstin, count
+ b.ls L(copy32)
+ ldr A_q, [src]
+ cmp count, 128
+ str A_q, [dstin]
+ b.hi L(copy_long)
+
+ /* Medium copies: 33..128 bytes. */
+ sub tmp1, count, 1
+ ldr A_q, [src, 16]
+ ldr B_q, [srcend, -32]
+ ldr C_q, [srcend, -16]
+ tbz tmp1, 6, 1f
+ ldr D_q, [src, 32]
+ ldr E_q, [src, 48]
+ str D_q, [dstin, 32]
+ str E_q, [dstin, 48]
+ ldr F_q, [srcend, -64]
+ ldr G_q, [srcend, -48]
+ str F_q, [dstend, -64]
+ str G_q, [dstend, -48]
+1:
+ str A_q, [dstin, 16]
+ str B_q, [dstend, -32]
+ str C_q, [dstend, -16]
+ ret
+
+ .p2align 4
+ /* Small copies: 0..32 bytes. */
+L(copy32):
+ /* 16-32 */
+ cmp count, 16
+ b.lo 1f
+ ldr A_q, [src]
+ ldr B_q, [srcend, -16]
+ str A_q, [dstin]
+ str B_q, [dstend, -16]
+ ret
+ .p2align 4
+1:
+ /* 8-15 */
+ tbz count, 3, 1f
+ ldr A_x, [src]
+ ldr B_x, [srcend, -8]
+ str A_x, [dstin]
+ str B_x, [dstend, -8]
+ ret
+ .p2align 4
+1:
+ /* 4-7 */
+ tbz count, 2, 1f
+ ldr A_w, [src]
+ ldr B_w, [srcend, -4]
+ str A_w, [dstin]
+ str B_w, [dstend, -4]
+ ret
+ .p2align 4
+1:
+ /* 2-3 */
+ tbz count, 1, 1f
+ ldrh A_w, [src]
+ ldrh B_w, [srcend, -2]
+ strh A_w, [dstin]
+ strh B_w, [dstend, -2]
+ ret
+ .p2align 4
+1:
+ /* 0-1 */
+ tbz count, 0, 1f
+ ldrb A_w, [src]
+ strb A_w, [dstin]
+1:
+ ret
+
+ /* Align SRC to 16 bytes and copy; that way at least one of the
+ accesses is aligned throughout the copy sequence.
+
+ The count is off by 0 to 15 bytes, but this is OK because we trim
+ off the last 64 bytes to copy off from the end. Due to this the
+ loop never runs out of bounds. */
+ .p2align 6
+L(copy_long):
+ sub count, count, 64 + 16
+ and tmp1, src, 15
+ bic src, src, 15
+ sub dst, dstin, tmp1
+ add count, count, tmp1
+
+L(loop64):
+ ldr A_q, [src, 16]!
+ str A_q, [dst, 16]
+ ldr A_q, [src, 16]!
+ subs count, count, 64
+ str A_q, [dst, 32]
+ ldr A_q, [src, 16]!
+ str A_q, [dst, 48]
+ ldr A_q, [src, 16]!
+ str A_q, [dst, 64]!
+ b.hi L(loop64)
+
+ /* Write the last full set of 64 bytes. The remainder is at most 64
+ bytes, so it is safe to always copy 64 bytes from the end even if
+ there is just 1 byte left. */
+L(last64):
+ ldr E_q, [srcend, -64]
+ str E_q, [dstend, -64]
+ ldr D_q, [srcend, -48]
+ str D_q, [dstend, -48]
+ ldr C_q, [srcend, -32]
+ str C_q, [dstend, -32]
+ ldr B_q, [srcend, -16]
+ str B_q, [dstend, -16]
+ ret
+
+END (__memcpy_falkor)
+libc_hidden_builtin_def (__memcpy_falkor)
+#endif
diff --git a/sysdeps/aarch64/multiarch/memcpy_generic.S b/sysdeps/aarch64/multiarch/memcpy_generic.S
new file mode 100644
index 0000000000..4bc81f4ce5
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memcpy_generic.S
@@ -0,0 +1,44 @@
+/* A Generic Optimized memcpy implementation for AARCH64.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* The actual memcpy and memmove code is in ../memcpy.S. If we are
+ building libc this file defines __memcpy_generic and __memmove_generic.
+ Otherwise the include of ../memcpy.S will define the normal __memcpy
+ and__memmove entry points. */
+
+#include <sysdep.h>
+
+#if IS_IN (libc)
+
+# define MEMCPY __memcpy_generic
+# define MEMMOVE __memmove_generic
+
+/* Do not hide the generic versions of memcpy and memmove, we use them
+ internally. */
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+
+# ifdef SHARED
+/* It doesn't make sense to send libc-internal memcpy calls through a PLT. */
+ .globl __GI_memcpy; __GI_memcpy = __memcpy_generic
+ .globl __GI_memmove; __GI_memmove = __memmove_generic
+# endif
+
+#endif
+
+#include "../memcpy.S"
diff --git a/sysdeps/aarch64/multiarch/memcpy_thunderx.S b/sysdeps/aarch64/multiarch/memcpy_thunderx.S
new file mode 100644
index 0000000000..de494d933d
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memcpy_thunderx.S
@@ -0,0 +1,336 @@
+/* A Thunderx Optimized memcpy implementation for AARCH64.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* The actual code in this memcpy and memmove should be identical to the
+ generic version except for the code under '#ifdef THUNDERX'. This is
+ to make is easier to keep this version and the generic version in sync
+ for changes that are not specific to thunderx. */
+
+#include <sysdep.h>
+
+/* Assumptions:
+ *
+ * ARMv8-a, AArch64, unaligned accesses.
+ *
+ */
+
+#define dstin x0
+#define src x1
+#define count x2
+#define dst x3
+#define srcend x4
+#define dstend x5
+#define A_l x6
+#define A_lw w6
+#define A_h x7
+#define A_hw w7
+#define B_l x8
+#define B_lw w8
+#define B_h x9
+#define C_l x10
+#define C_h x11
+#define D_l x12
+#define D_h x13
+#define E_l src
+#define E_h count
+#define F_l srcend
+#define F_h dst
+#define G_l count
+#define G_h dst
+#define tmp1 x14
+
+/* Copies are split into 3 main cases: small copies of up to 16 bytes,
+ medium copies of 17..96 bytes which are fully unrolled. Large copies
+ of more than 96 bytes align the destination and use an unrolled loop
+ processing 64 bytes per iteration.
+ In order to share code with memmove, small and medium copies read all
+ data before writing, allowing any kind of overlap. So small, medium
+ and large backwards memmoves are handled by falling through into memcpy.
+ Overlapping large forward memmoves use a loop that copies backwards.
+*/
+
+#ifndef MEMMOVE
+# define MEMMOVE memmove
+#endif
+#ifndef MEMCPY
+# define MEMCPY memcpy
+#endif
+
+#if IS_IN (libc)
+
+# ifndef USE_THUNDERX2
+# undef MEMCPY
+# define MEMCPY __memcpy_thunderx
+# undef MEMMOVE
+# define MEMMOVE __memmove_thunderx
+# define USE_THUNDERX
+# endif
+
+ENTRY_ALIGN (MEMMOVE, 6)
+
+ DELOUSE (0)
+ DELOUSE (1)
+ DELOUSE (2)
+
+ sub tmp1, dstin, src
+ cmp count, 96
+ ccmp tmp1, count, 2, hi
+ b.lo L(move_long)
+
+ /* Common case falls through into memcpy. */
+END (MEMMOVE)
+libc_hidden_builtin_def (MEMMOVE)
+ENTRY (MEMCPY)
+
+ DELOUSE (0)
+ DELOUSE (1)
+ DELOUSE (2)
+
+ prfm PLDL1KEEP, [src]
+ add srcend, src, count
+ add dstend, dstin, count
+ cmp count, 16
+ b.ls L(copy16)
+ cmp count, 96
+ b.hi L(copy_long)
+
+ /* Medium copies: 17..96 bytes. */
+ sub tmp1, count, 1
+ ldp A_l, A_h, [src]
+ tbnz tmp1, 6, L(copy96)
+ ldp D_l, D_h, [srcend, -16]
+ tbz tmp1, 5, 1f
+ ldp B_l, B_h, [src, 16]
+ ldp C_l, C_h, [srcend, -32]
+ stp B_l, B_h, [dstin, 16]
+ stp C_l, C_h, [dstend, -32]
+1:
+ stp A_l, A_h, [dstin]
+ stp D_l, D_h, [dstend, -16]
+ ret
+
+ .p2align 4
+ /* Small copies: 0..16 bytes. */
+L(copy16):
+ cmp count, 8
+ b.lo 1f
+ ldr A_l, [src]
+ ldr A_h, [srcend, -8]
+ str A_l, [dstin]
+ str A_h, [dstend, -8]
+ ret
+ .p2align 4
+1:
+ tbz count, 2, 1f
+ ldr A_lw, [src]
+ ldr A_hw, [srcend, -4]
+ str A_lw, [dstin]
+ str A_hw, [dstend, -4]
+ ret
+
+ /* Copy 0..3 bytes. Use a branchless sequence that copies the same
+ byte 3 times if count==1, or the 2nd byte twice if count==2. */
+1:
+ cbz count, 2f
+ lsr tmp1, count, 1
+ ldrb A_lw, [src]
+ ldrb A_hw, [srcend, -1]
+ ldrb B_lw, [src, tmp1]
+ strb A_lw, [dstin]
+ strb B_lw, [dstin, tmp1]
+ strb A_hw, [dstend, -1]
+2: ret
+
+ .p2align 4
+ /* Copy 64..96 bytes. Copy 64 bytes from the start and
+ 32 bytes from the end. */
+L(copy96):
+ ldp B_l, B_h, [src, 16]
+ ldp C_l, C_h, [src, 32]
+ ldp D_l, D_h, [src, 48]
+ ldp E_l, E_h, [srcend, -32]
+ ldp F_l, F_h, [srcend, -16]
+ stp A_l, A_h, [dstin]
+ stp B_l, B_h, [dstin, 16]
+ stp C_l, C_h, [dstin, 32]
+ stp D_l, D_h, [dstin, 48]
+ stp E_l, E_h, [dstend, -32]
+ stp F_l, F_h, [dstend, -16]
+ ret
+
+ /* Align DST to 16 byte alignment so that we don't cross cache line
+ boundaries on both loads and stores. There are at least 96 bytes
+ to copy, so copy 16 bytes unaligned and then align. The loop
+ copies 64 bytes per iteration and prefetches one iteration ahead. */
+
+ .p2align 4
+L(copy_long):
+
+# if defined(USE_THUNDERX) || defined (USE_THUNDERX2)
+
+ /* On thunderx, large memcpy's are helped by software prefetching.
+ This loop is identical to the one below it but with prefetching
+ instructions included. For loops that are less than 32768 bytes,
+ the prefetching does not help and slow the code down so we only
+ use the prefetching loop for the largest memcpys. */
+
+ cmp count, #32768
+ b.lo L(copy_long_without_prefetch)
+ and tmp1, dstin, 15
+ bic dst, dstin, 15
+ ldp D_l, D_h, [src]
+ sub src, src, tmp1
+# if defined(USE_THUNDERX)
+ prfm pldl1strm, [src, 384]
+# elif defined(USE_THUNDERX2)
+ prfm pldl1strm, [src, 256]
+# endif
+ add count, count, tmp1 /* Count is now 16 too large. */
+ ldp A_l, A_h, [src, 16]
+ stp D_l, D_h, [dstin]
+ ldp B_l, B_h, [src, 32]
+ ldp C_l, C_h, [src, 48]
+ ldp D_l, D_h, [src, 64]!
+ subs count, count, 128 + 16 /* Test and readjust count. */
+
+L(prefetch_loop64):
+# if defined(USE_THUNDERX)
+ tbz src, #6, 1f
+ prfm pldl1strm, [src, 512]
+1:
+# elif defined(USE_THUNDERX2)
+ prfm pldl1strm, [src, 256]
+# endif
+ stp A_l, A_h, [dst, 16]
+ ldp A_l, A_h, [src, 16]
+ stp B_l, B_h, [dst, 32]
+ ldp B_l, B_h, [src, 32]
+ stp C_l, C_h, [dst, 48]
+ ldp C_l, C_h, [src, 48]
+ stp D_l, D_h, [dst, 64]!
+ ldp D_l, D_h, [src, 64]!
+ subs count, count, 64
+ b.hi L(prefetch_loop64)
+ b L(last64)
+
+L(copy_long_without_prefetch):
+# endif
+
+ and tmp1, dstin, 15
+ bic dst, dstin, 15
+ ldp D_l, D_h, [src]
+ sub src, src, tmp1
+ add count, count, tmp1 /* Count is now 16 too large. */
+ ldp A_l, A_h, [src, 16]
+ stp D_l, D_h, [dstin]
+ ldp B_l, B_h, [src, 32]
+ ldp C_l, C_h, [src, 48]
+ ldp D_l, D_h, [src, 64]!
+ subs count, count, 128 + 16 /* Test and readjust count. */
+ b.ls L(last64)
+L(loop64):
+ stp A_l, A_h, [dst, 16]
+ ldp A_l, A_h, [src, 16]
+ stp B_l, B_h, [dst, 32]
+ ldp B_l, B_h, [src, 32]
+ stp C_l, C_h, [dst, 48]
+ ldp C_l, C_h, [src, 48]
+ stp D_l, D_h, [dst, 64]!
+ ldp D_l, D_h, [src, 64]!
+ subs count, count, 64
+ b.hi L(loop64)
+
+ /* Write the last full set of 64 bytes. The remainder is at most 64
+ bytes, so it is safe to always copy 64 bytes from the end even if
+ there is just 1 byte left. */
+L(last64):
+ ldp E_l, E_h, [srcend, -64]
+ stp A_l, A_h, [dst, 16]
+ ldp A_l, A_h, [srcend, -48]
+ stp B_l, B_h, [dst, 32]
+ ldp B_l, B_h, [srcend, -32]
+ stp C_l, C_h, [dst, 48]
+ ldp C_l, C_h, [srcend, -16]
+ stp D_l, D_h, [dst, 64]
+ stp E_l, E_h, [dstend, -64]
+ stp A_l, A_h, [dstend, -48]
+ stp B_l, B_h, [dstend, -32]
+ stp C_l, C_h, [dstend, -16]
+ ret
+
+ .p2align 4
+L(move_long):
+ cbz tmp1, 3f
+
+ add srcend, src, count
+ add dstend, dstin, count
+
+ /* Align dstend to 16 byte alignment so that we don't cross cache line
+ boundaries on both loads and stores. There are at least 96 bytes
+ to copy, so copy 16 bytes unaligned and then align. The loop
+ copies 64 bytes per iteration and prefetches one iteration ahead. */
+
+ and tmp1, dstend, 15
+ ldp D_l, D_h, [srcend, -16]
+ sub srcend, srcend, tmp1
+ sub count, count, tmp1
+ ldp A_l, A_h, [srcend, -16]
+ stp D_l, D_h, [dstend, -16]
+ ldp B_l, B_h, [srcend, -32]
+ ldp C_l, C_h, [srcend, -48]
+ ldp D_l, D_h, [srcend, -64]!
+ sub dstend, dstend, tmp1
+ subs count, count, 128
+ b.ls 2f
+
+ nop
+1:
+ stp A_l, A_h, [dstend, -16]
+ ldp A_l, A_h, [srcend, -16]
+ stp B_l, B_h, [dstend, -32]
+ ldp B_l, B_h, [srcend, -32]
+ stp C_l, C_h, [dstend, -48]
+ ldp C_l, C_h, [srcend, -48]
+ stp D_l, D_h, [dstend, -64]!
+ ldp D_l, D_h, [srcend, -64]!
+ subs count, count, 64
+ b.hi 1b
+
+ /* Write the last full set of 64 bytes. The remainder is at most 64
+ bytes, so it is safe to always copy 64 bytes from the start even if
+ there is just 1 byte left. */
+2:
+ ldp G_l, G_h, [src, 48]
+ stp A_l, A_h, [dstend, -16]
+ ldp A_l, A_h, [src, 32]
+ stp B_l, B_h, [dstend, -32]
+ ldp B_l, B_h, [src, 16]
+ stp C_l, C_h, [dstend, -48]
+ ldp C_l, C_h, [src]
+ stp D_l, D_h, [dstend, -64]
+ stp G_l, G_h, [dstin, 48]
+ stp A_l, A_h, [dstin, 32]
+ stp B_l, B_h, [dstin, 16]
+ stp C_l, C_h, [dstin]
+3: ret
+
+END (MEMCPY)
+libc_hidden_builtin_def (MEMCPY)
+
+#endif
diff --git a/sysdeps/aarch64/multiarch/memcpy_thunderx2.S b/sysdeps/aarch64/multiarch/memcpy_thunderx2.S
new file mode 100644
index 0000000000..8501abf725
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memcpy_thunderx2.S
@@ -0,0 +1,27 @@
+/* A Thunderx2 Optimized memcpy implementation for AARCH64.
+ Copyright (C) 2018 Free Software 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/>. */
+
+/* The actual code in this memcpy and memmove is in memcpy_thunderx.S.
+ The only real differences are with the prefetching instructions. */
+
+#define MEMCPY __memcpy_thunderx2
+#define MEMMOVE __memmove_thunderx2
+#define USE_THUNDERX2
+
+#include "memcpy_thunderx.S"
diff --git a/sysdeps/aarch64/multiarch/memmove.c b/sysdeps/aarch64/multiarch/memmove.c
new file mode 100644
index 0000000000..e69d816291
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memmove.c
@@ -0,0 +1,44 @@
+/* Multiple versions of memmove. AARCH64 version.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+
+#if IS_IN (libc)
+/* Redefine memmove so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias, below. */
+# undef memmove
+# define memmove __redirect_memmove
+# include <string.h>
+# include <init-arch.h>
+
+extern __typeof (__redirect_memmove) __libc_memmove;
+
+extern __typeof (__redirect_memmove) __memmove_generic attribute_hidden;
+extern __typeof (__redirect_memmove) __memmove_thunderx attribute_hidden;
+extern __typeof (__redirect_memmove) __memmove_falkor attribute_hidden;
+
+libc_ifunc (__libc_memmove,
+ (IS_THUNDERX (midr)
+ ? __memmove_thunderx
+ : (IS_FALKOR (midr) || IS_PHECDA (midr)
+ ? __memmove_falkor
+ : __memmove_generic)));
+
+# undef memmove
+strong_alias (__libc_memmove, memmove);
+#endif
diff --git a/sysdeps/aarch64/multiarch/memmove_falkor.S b/sysdeps/aarch64/multiarch/memmove_falkor.S
new file mode 100644
index 0000000000..5163f68e53
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memmove_falkor.S
@@ -0,0 +1,225 @@
+/* Copyright (C) 2017-2018 Free Software 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, falkor, unaligned accesses. */
+
+#define dstin x0
+#define src x1
+#define count x2
+#define dst x3
+#define srcend x4
+#define dstend x5
+#define A_x x6
+#define B_x x7
+#define A_w w6
+#define B_w w7
+#define tmp1 x14
+
+#define Q_q q6
+#define A_q q22
+#define B_q q18
+#define C_q q19
+#define D_q q20
+#define E_q q21
+#define F_q q17
+#define G_q q23
+
+/* RATIONALE:
+
+ The move has 4 distinct parts:
+ * Small moves of 16 bytes and under
+ * Medium sized moves of 17-96 bytes
+ * Large moves where the source address is higher than the destination
+ (forward copies)
+ * Large moves where the destination address is higher than the source
+ (copy backward, or move).
+
+ We use only two registers q6 and q22 for the moves and move 32 bytes at a
+ time to correctly train the hardware prefetcher for better throughput. */
+ENTRY_ALIGN (__memmove_falkor, 6)
+
+ sub tmp1, dstin, src
+ add srcend, src, count
+ add dstend, dstin, count
+ cmp count, 96
+ ccmp tmp1, count, 2, hi
+ b.lo L(move_long)
+
+ cmp count, 16
+ b.ls L(copy16)
+ cmp count, 96
+ b.hi L(copy_long)
+
+ /* Medium copies: 17..96 bytes. */
+ sub tmp1, count, 1
+ ldr A_q, [src]
+ tbnz tmp1, 6, L(copy96)
+ ldr D_q, [srcend, -16]
+ tbz tmp1, 5, 1f
+ ldr B_q, [src, 16]
+ ldr C_q, [srcend, -32]
+ str B_q, [dstin, 16]
+ str C_q, [dstend, -32]
+1:
+ str A_q, [dstin]
+ str D_q, [dstend, -16]
+ ret
+
+ .p2align 4
+ /* Small copies: 0..16 bytes. */
+L(copy16):
+ cmp count, 8
+ b.lo 1f
+ ldr A_x, [src]
+ ldr B_x, [srcend, -8]
+ str A_x, [dstin]
+ str B_x, [dstend, -8]
+ ret
+ .p2align 4
+1:
+ /* 4-7 */
+ tbz count, 2, 1f
+ ldr A_w, [src]
+ ldr B_w, [srcend, -4]
+ str A_w, [dstin]
+ str B_w, [dstend, -4]
+ ret
+ .p2align 4
+1:
+ /* 2-3 */
+ tbz count, 1, 1f
+ ldrh A_w, [src]
+ ldrh B_w, [srcend, -2]
+ strh A_w, [dstin]
+ strh B_w, [dstend, -2]
+ ret
+ .p2align 4
+1:
+ /* 0-1 */
+ tbz count, 0, 1f
+ ldrb A_w, [src]
+ strb A_w, [dstin]
+1: ret
+
+ .p2align 4
+ /* Copy 64..96 bytes. Copy 64 bytes from the start and
+ 32 bytes from the end. */
+L(copy96):
+ ldr B_q, [src, 16]
+ ldr C_q, [src, 32]
+ ldr D_q, [src, 48]
+ ldr E_q, [srcend, -32]
+ ldr F_q, [srcend, -16]
+ str A_q, [dstin]
+ str B_q, [dstin, 16]
+ str C_q, [dstin, 32]
+ str D_q, [dstin, 48]
+ str E_q, [dstend, -32]
+ str F_q, [dstend, -16]
+ ret
+
+ /* Align SRC to 16 byte alignment so that we don't cross cache line
+ boundaries on both loads and stores. There are at least 96 bytes
+ to copy, so copy 16 bytes unaligned and then align. The loop
+ copies 32 bytes per iteration and prefetches one iteration ahead. */
+
+ .p2align 4
+L(copy_long):
+ ldr A_q, [src]
+ and tmp1, src, 15
+ bic src, src, 15
+ sub dst, dstin, tmp1
+ add count, count, tmp1 /* Count is now 16 too large. */
+ ldr Q_q, [src, 16]!
+ str A_q, [dstin]
+ ldr A_q, [src, 16]!
+ subs count, count, 32 + 64 + 16 /* Test and readjust count. */
+ b.ls L(last64)
+
+L(loop64):
+ subs count, count, 32
+ str Q_q, [dst, 16]
+ ldr Q_q, [src, 16]!
+ str A_q, [dst, 32]!
+ ldr A_q, [src, 16]!
+ b.hi L(loop64)
+
+ /* Write the last full set of 64 bytes. The remainder is at most 64
+ bytes and at least 33 bytes, so it is safe to always copy 64 bytes
+ from the end. */
+L(last64):
+ ldr C_q, [srcend, -64]
+ str Q_q, [dst, 16]
+ ldr B_q, [srcend, -48]
+ str A_q, [dst, 32]
+ ldr A_q, [srcend, -32]
+ ldr D_q, [srcend, -16]
+ str C_q, [dstend, -64]
+ str B_q, [dstend, -48]
+ str A_q, [dstend, -32]
+ str D_q, [dstend, -16]
+ ret
+
+ .p2align 4
+L(move_long):
+ cbz tmp1, 3f
+
+ /* Align SRCEND to 16 byte alignment so that we don't cross cache line
+ boundaries on both loads and stores. There are at least 96 bytes
+ to copy, so copy 16 bytes unaligned and then align. The loop
+ copies 32 bytes per iteration and prefetches one iteration ahead. */
+
+ ldr A_q, [srcend, -16]
+ and tmp1, srcend, 15
+ sub srcend, srcend, tmp1
+ ldr Q_q, [srcend, -16]!
+ str A_q, [dstend, -16]
+ sub count, count, tmp1
+ ldr A_q, [srcend, -16]!
+ sub dstend, dstend, tmp1
+ subs count, count, 32 + 64
+ b.ls 2f
+
+1:
+ subs count, count, 32
+ str Q_q, [dstend, -16]
+ ldr Q_q, [srcend, -16]!
+ str A_q, [dstend, -32]!
+ ldr A_q, [srcend, -16]!
+ b.hi 1b
+
+ /* Write the last full set of 64 bytes. The remainder is at most 64
+ bytes and at least 33 bytes, so it is safe to always copy 64 bytes
+ from the start. */
+2:
+ ldr C_q, [src, 48]
+ str Q_q, [dstend, -16]
+ ldr B_q, [src, 32]
+ str A_q, [dstend, -32]
+ ldr A_q, [src, 16]
+ ldr D_q, [src]
+ str C_q, [dstin, 48]
+ str B_q, [dstin, 32]
+ str A_q, [dstin, 16]
+ str D_q, [dstin]
+3: ret
+
+END (__memmove_falkor)
+libc_hidden_builtin_def (__memmove_falkor)
diff --git a/sysdeps/aarch64/multiarch/memset.c b/sysdeps/aarch64/multiarch/memset.c
new file mode 100644
index 0000000000..d74ed3a549
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memset.c
@@ -0,0 +1,41 @@
+/* Multiple versions of memset. AARCH64 version.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+
+#if IS_IN (libc)
+/* Redefine memset so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias, below. */
+# undef memset
+# define memset __redirect_memset
+# include <string.h>
+# include <init-arch.h>
+
+extern __typeof (__redirect_memset) __libc_memset;
+
+extern __typeof (__redirect_memset) __memset_falkor attribute_hidden;
+extern __typeof (__redirect_memset) __memset_generic attribute_hidden;
+
+libc_ifunc (__libc_memset,
+ ((IS_FALKOR (midr) || IS_PHECDA (midr)) && zva_size == 64
+ ? __memset_falkor
+ : __memset_generic));
+
+# undef memset
+strong_alias (__libc_memset, memset);
+#endif
diff --git a/sysdeps/aarch64/multiarch/memset_falkor.S b/sysdeps/aarch64/multiarch/memset_falkor.S
new file mode 100644
index 0000000000..16849a5afb
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memset_falkor.S
@@ -0,0 +1,53 @@
+/* Memset for falkor.
+ Copyright (C) 2017-2018 Free Software 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 <memset-reg.h>
+
+/* Reading dczid_el0 is expensive on falkor so move it into the ifunc
+ resolver and assume ZVA size of 64 bytes. The IFUNC resolver takes care to
+ use this function only when ZVA is enabled. */
+
+#if IS_IN (libc)
+.macro zva_macro
+ .p2align 4
+ /* Write the first and last 64 byte aligned block using stp rather
+ than using DC ZVA. This is faster on some cores. */
+ str q0, [dst, 16]
+ stp q0, q0, [dst, 32]
+ bic dst, dst, 63
+ stp q0, q0, [dst, 64]
+ stp q0, q0, [dst, 96]
+ sub count, dstend, dst /* Count is now 128 too large. */
+ sub count, count, 128+64+64 /* Adjust count and bias for loop. */
+ add dst, dst, 128
+1: dc zva, dst
+ add dst, dst, 64
+ subs count, count, 64
+ b.hi 1b
+ stp q0, q0, [dst, 0]
+ stp q0, q0, [dst, 32]
+ stp q0, q0, [dstend, -64]
+ stp q0, q0, [dstend, -32]
+ ret
+.endm
+
+# define ZVA_MACRO zva_macro
+# define MEMSET __memset_falkor
+# include <sysdeps/aarch64/memset.S>
+#endif
diff --git a/sysdeps/aarch64/multiarch/memset_generic.S b/sysdeps/aarch64/multiarch/memset_generic.S
new file mode 100644
index 0000000000..345a88b94f
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memset_generic.S
@@ -0,0 +1,27 @@
+/* Memset for aarch64, default version for internal use.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define MEMSET __memset_generic
+/* Add a hidden definition for use within libc.so. */
+# ifdef SHARED
+ .globl __GI_memset; __GI_memset = __memset_generic
+# endif
+# include <sysdeps/aarch64/memset.S>
+#endif
diff --git a/sysdeps/aarch64/multiarch/rtld-memset.S b/sysdeps/aarch64/multiarch/rtld-memset.S
new file mode 100644
index 0000000000..8cdc6e1f50
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/rtld-memset.S
@@ -0,0 +1,23 @@
+/* Memset for aarch64, for the dynamic linker.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (rtld)
+# define MEMSET memset
+# include <sysdeps/aarch64/memset.S>
+#endif
diff --git a/sysdeps/aarch64/nptl/Makefile b/sysdeps/aarch64/nptl/Makefile
index 486aeca81e..bebbdef871 100644
--- a/sysdeps/aarch64/nptl/Makefile
+++ b/sysdeps/aarch64/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# Copyright (C) 2005-2018 Free Software Foundation, Inc.
#
# This file is part of the GNU C Library.
#
diff --git a/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h b/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..008aa7e0c7
--- /dev/null
+++ b/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,71 @@
+/* Copyright (C) 2002-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <endian.h>
+
+#ifdef __ILP32__
+# define __SIZEOF_PTHREAD_ATTR_T 32
+# define __SIZEOF_PTHREAD_MUTEX_T 32
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+# define __SIZEOF_PTHREAD_CONDATTR_T 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 48
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+#else
+# define __SIZEOF_PTHREAD_ATTR_T 64
+# define __SIZEOF_PTHREAD_MUTEX_T 48
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 8
+# define __SIZEOF_PTHREAD_CONDATTR_T 8
+# define __SIZEOF_PTHREAD_RWLOCK_T 56
+# define __SIZEOF_PTHREAD_BARRIER_T 32
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 8
+#endif
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+
+/* Definitions for internal mutex struct. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
+#define __PTHREAD_MUTEX_USE_UNION 0
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+ int __cur_writer;
+ int __shared;
+ unsigned long int __pad1;
+ unsigned long int __pad2;
+ unsigned int __flags;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/aarch64/nptl/bits/pthreadtypes.h b/sysdeps/aarch64/nptl/bits/pthreadtypes.h
deleted file mode 100644
index 13984a718d..0000000000
--- a/sysdeps/aarch64/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* Copyright (C) 2002-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 _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <endian.h>
-
-#define __SIZEOF_PTHREAD_ATTR_T 64
-#define __SIZEOF_PTHREAD_MUTEX_T 48
-#define __SIZEOF_PTHREAD_MUTEXATTR_T 8
-#define __SIZEOF_PTHREAD_COND_T 48
-#define __SIZEOF_PTHREAD_COND_COMPAT_T 48
-#define __SIZEOF_PTHREAD_CONDATTR_T 8
-#define __SIZEOF_PTHREAD_RWLOCK_T 56
-#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-#define __SIZEOF_PTHREAD_BARRIER_T 32
-#define __SIZEOF_PTHREAD_BARRIERATTR_T 8
-
-
-/* Thread identifiers. The structure of the attribute type is not
- exposed on purpose. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t1
-#endif
-
-typedef struct __pthread_internal_list
-{
- struct __pthread_internal_list *__prev;
- struct __pthread_internal_list *__next;
-} __pthread_list_t;
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is not exposed on purpose. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
- unsigned int __nusers;
- int __kind;
- int __spins;
- __pthread_list_t __list;
-#define __PTHREAD_MUTEX_HAVE_PREV 1
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- long int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- int __writer;
- int __shared;
- unsigned long int __pad1;
- unsigned long int __pad2;
- unsigned int __flags;
- } __data;
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/aarch64/nptl/bits/semaphore.h b/sysdeps/aarch64/nptl/bits/semaphore.h
index 3cc5b37847..18f8aae532 100644
--- a/sysdeps/aarch64/nptl/bits/semaphore.h
+++ b/sysdeps/aarch64/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -21,7 +21,11 @@
#endif
-#define __SIZEOF_SEM_T 32
+#ifdef __ILP32__
+# define __SIZEOF_SEM_T 16
+#else
+# define __SIZEOF_SEM_T 32
+#endif
/* Value returned if `sem_open' failed. */
@@ -31,5 +35,5 @@
typedef union
{
char __size[__SIZEOF_SEM_T];
- long int __align;
+ long long int __align;
} sem_t;
diff --git a/sysdeps/aarch64/nptl/pthread-offsets.h b/sysdeps/aarch64/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..16c6b0d9fd
--- /dev/null
+++ b/sysdeps/aarch64/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 12
+#define __PTHREAD_MUTEX_KIND_OFFSET 16
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 24
diff --git a/sysdeps/aarch64/nptl/pthread_spin_lock.c b/sysdeps/aarch64/nptl/pthread_spin_lock.c
deleted file mode 100644
index 21a54b8215..0000000000
--- a/sysdeps/aarch64/nptl/pthread_spin_lock.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (C) 2008-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 SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
-
-/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because
- it will resolve to this very file. Using "sysdeps/.." as reference to the
- top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
diff --git a/sysdeps/aarch64/nptl/pthreaddef.h b/sysdeps/aarch64/nptl/pthreaddef.h
index 5aa8d561e7..32f729ada1 100644
--- a/sysdeps/aarch64/nptl/pthreaddef.h
+++ b/sysdeps/aarch64/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/nptl/tcb-offsets.sym b/sysdeps/aarch64/nptl/tcb-offsets.sym
index 0677aeabff..238647dd47 100644
--- a/sysdeps/aarch64/nptl/tcb-offsets.sym
+++ b/sysdeps/aarch64/nptl/tcb-offsets.sym
@@ -2,6 +2,5 @@
#include <tls.h>
PTHREAD_MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads)
-PTHREAD_PID_OFFSET offsetof (struct pthread, pid)
PTHREAD_TID_OFFSET offsetof (struct pthread, tid)
PTHREAD_SIZEOF sizeof (struct pthread)
diff --git a/sysdeps/aarch64/nptl/tls.h b/sysdeps/aarch64/nptl/tls.h
index 95ea3f9a1a..200334f84a 100644
--- a/sysdeps/aarch64/nptl/tls.h
+++ b/sysdeps/aarch64/nptl/tls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -25,17 +25,7 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
@@ -119,6 +109,7 @@ typedef struct
descr->member[idx] = (value)
/* Get and set the global scope generation counter in struct pthread. */
+# define THREAD_GSCOPE_IN_TCB 1
# define THREAD_GSCOPE_FLAG_UNUSED 0
# define THREAD_GSCOPE_FLAG_USED 1
# define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/aarch64/rawmemchr.S b/sysdeps/aarch64/rawmemchr.S
new file mode 100644
index 0000000000..de3c05f337
--- /dev/null
+++ b/sysdeps/aarch64/rawmemchr.S
@@ -0,0 +1,42 @@
+/* rawmemchr - find a character in a memory zone
+
+ Copyright (C) 2015-2018 Free Software 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>
+
+/* Special case rawmemchr (s, 0) as strlen, otherwise tailcall memchr.
+ Call strlen without setting up a full frame - it preserves x14/x15.
+*/
+
+ENTRY (__rawmemchr)
+ cbz w1, L(do_strlen)
+ mov x2, -1
+ b __memchr
+
+L(do_strlen):
+ mov x15, x30
+ cfi_return_column (x15)
+ mov x14, x0
+ bl __strlen
+ add x0, x14, x0
+ ret x15
+
+END (__rawmemchr)
+weak_alias (__rawmemchr, rawmemchr)
+libc_hidden_builtin_def (__rawmemchr)
diff --git a/sysdeps/aarch64/setjmp.S b/sysdeps/aarch64/setjmp.S
index 22f4368ee6..d8838e7b54 100644
--- a/sysdeps/aarch64/setjmp.S
+++ b/sysdeps/aarch64/setjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -33,6 +33,7 @@ END (_setjmp)
libc_hidden_def (_setjmp)
ENTRY (__sigsetjmp)
+ DELOUSE (0)
1:
stp x19, x20, [x0, #JB_X19<<3]
@@ -42,7 +43,7 @@ ENTRY (__sigsetjmp)
stp x27, x28, [x0, #JB_X27<<3]
#ifdef PTR_MANGLE
- PTR_MANGLE (x4, x30, x3, x2)
+ PTR_MANGLE (4, 30, 3, 2)
stp x29, x4, [x0, #JB_X29<<3]
#else
stp x29, x30, [x0, #JB_X29<<3]
@@ -57,7 +58,7 @@ ENTRY (__sigsetjmp)
stp d14, d15, [x0, #JB_D14<<3]
#ifdef PTR_MANGLE
mov x4, sp
- PTR_MANGLE (x5, x4, x3, x2)
+ PTR_MANGLE (5, 4, 3, 2)
str x5, [x0, #JB_SP<<3]
#else
mov x2, sp
diff --git a/sysdeps/aarch64/soft-fp/sfp-machine.h b/sysdeps/aarch64/sfp-machine.h
index 3e969952fa..3e969952fa 100644
--- a/sysdeps/aarch64/soft-fp/sfp-machine.h
+++ b/sysdeps/aarch64/sfp-machine.h
diff --git a/sysdeps/aarch64/soft-fp/e_sqrtl.c b/sysdeps/aarch64/soft-fp/e_sqrtl.c
deleted file mode 100644
index 5d3919b6a2..0000000000
--- a/sysdeps/aarch64/soft-fp/e_sqrtl.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* long double square root in software floating-point emulation.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <stdlib.h>
-#include <soft-fp.h>
-#include <quad.h>
-
-long double
-__ieee754_sqrtl (const long double a)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(C);
- long double c;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_Q(A, a);
- FP_SQRT_Q(C, A);
- FP_PACK_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
-strong_alias (__ieee754_sqrtl, __sqrtl_finite)
diff --git a/sysdeps/aarch64/sotruss-lib.c b/sysdeps/aarch64/sotruss-lib.c
index 65174402b8..5dafacc21f 100644
--- a/sysdeps/aarch64/sotruss-lib.c
+++ b/sysdeps/aarch64/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for AArch64.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/stackinfo.h b/sysdeps/aarch64/stackinfo.h
index 78f3262033..7e666fbe18 100644
--- a/sysdeps/aarch64/stackinfo.h
+++ b/sysdeps/aarch64/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
index efe24749f7..bad000f555 100644
--- a/sysdeps/aarch64/start.S
+++ b/sysdeps/aarch64/start.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <sysdep.h>
+
/* This is the canonical entry point, usually the first thing in the text
segment.
@@ -25,7 +27,7 @@
At this entry point, most registers' values are unspecified, except:
- x0 Contains a function pointer to be registered with `atexit'.
+ x0/w0 Contains a function pointer to be registered with `atexit'.
This is how the dynamic linker arranges to have DT_FINI
functions called for shared libraries that have been loaded
before this code runs.
@@ -52,26 +54,35 @@ _start:
mov x5, x0
/* Load argc and a pointer to argv */
- ldr x1, [sp, #0]
- add x2, sp, #8
+ ldr PTR_REG (1), [sp, #0]
+ add x2, sp, #PTR_SIZE
/* Setup stack limit in argument register */
mov x6, sp
-#ifdef SHARED
+#ifdef PIC
+# ifdef SHARED
adrp x0, :got:main
- ldr x0, [x0, #:got_lo12:main]
+ ldr PTR_REG (0), [x0, #:got_lo12:main]
adrp x3, :got:__libc_csu_init
- ldr x3, [x3, #:got_lo12:__libc_csu_init]
+ ldr PTR_REG (3), [x3, #:got_lo12:__libc_csu_init]
adrp x4, :got:__libc_csu_fini
- ldr x4, [x4, #:got_lo12:__libc_csu_fini]
+ ldr PTR_REG (4), [x4, #:got_lo12:__libc_csu_fini]
+# else
+ adrp x0, __wrap_main
+ add x0, x0, :lo12:__wrap_main
+ adrp x3, __libc_csu_init
+ add x3, x3, :lo12:__libc_csu_init
+ adrp x4, __libc_csu_fini
+ add x4, x4, :lo12:__libc_csu_fini
+# endif
#else
/* Set up the other arguments in registers */
- ldr x0, =main
- ldr x3, =__libc_csu_init
- ldr x4, =__libc_csu_fini
+ MOVL (0, main)
+ MOVL (3, __libc_csu_init)
+ MOVL (4, __libc_csu_fini)
#endif
/* __libc_start_main (main, argc, argv, init, fini, rtld_fini,
@@ -83,6 +94,15 @@ _start:
/* should never get here....*/
bl abort
+#if defined PIC && !defined SHARED
+ /* When main is not defined in the executable but in a shared library
+ then a wrapper is needed in crt1.o of the static-pie enabled libc,
+ because crt1.o and rcrt1.o share code and the later must avoid the
+ use of GOT relocations before __libc_start_main is called. */
+__wrap_main:
+ b main
+#endif
+
/* Define a symbol for the first piece of initialized data. */
.data
.globl __data_start
diff --git a/sysdeps/aarch64/stpcpy.S b/sysdeps/aarch64/stpcpy.S
index cbbf26c499..dcf1356bda 100644
--- a/sysdeps/aarch64/stpcpy.S
+++ b/sysdeps/aarch64/stpcpy.S
@@ -1,5 +1,5 @@
/* stpcpy - copy a string returning pointer to end.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/aarch64/strchr.S b/sysdeps/aarch64/strchr.S
index 5e3aecf4c2..c27465220b 100644
--- a/sysdeps/aarch64/strchr.S
+++ b/sysdeps/aarch64/strchr.S
@@ -1,6 +1,6 @@
/* strchr - find a character in a string
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -62,6 +62,7 @@
/* Locals and temporaries. */
ENTRY (strchr)
+ DELOUSE (0)
mov wtmp2, #0x0401
movk wtmp2, #0x4010, lsl #16
dup vrepchr.16b, chrin
diff --git a/sysdeps/aarch64/strchrnul.S b/sysdeps/aarch64/strchrnul.S
index a624c8d2ef..e13ace5b7e 100644
--- a/sysdeps/aarch64/strchrnul.S
+++ b/sysdeps/aarch64/strchrnul.S
@@ -1,6 +1,6 @@
/* strchrnul - find a character or nul in a string
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -60,6 +60,7 @@
identify exactly which byte is causing the termination. */
ENTRY (__strchrnul)
+ DELOUSE (0)
/* Magic constant 0x40100401 to allow us to identify which lane
matches the termination condition. */
mov wtmp2, #0x0401
diff --git a/sysdeps/aarch64/strcmp.S b/sysdeps/aarch64/strcmp.S
index ba0ccb409b..267aa4b551 100644
--- a/sysdeps/aarch64/strcmp.S
+++ b/sysdeps/aarch64/strcmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -49,6 +49,8 @@
/* Start of performance-critical section -- one 64B cache line. */
ENTRY_ALIGN(strcmp, 6)
+ DELOUSE (0)
+ DELOUSE (1)
eor tmp1, src1, src2
mov zeroones, #REP8_01
tst tmp1, #7
@@ -70,6 +72,7 @@ L(start_realigned):
cbz syndrome, L(loop_aligned)
/* End of performance-critical section -- one 64B cache line. */
+L(end):
#ifndef __AARCH64EB__
rev syndrome, syndrome
rev data1, data1
@@ -143,12 +146,38 @@ L(mutual_align):
b L(start_realigned)
L(misaligned8):
- /* We can do better than this. */
+ /* Align SRC1 to 8 bytes and then compare 8 bytes at a time, always
+ checking to make sure that we don't access beyond page boundary in
+ SRC2. */
+ tst src1, #7
+ b.eq L(loop_misaligned)
+L(do_misaligned):
ldrb data1w, [src1], #1
ldrb data2w, [src2], #1
cmp data1w, #1
ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
- b.eq L(misaligned8)
+ b.ne L(done)
+ tst src1, #7
+ b.ne L(do_misaligned)
+
+L(loop_misaligned):
+ /* Test if we are within the last dword of the end of a 4K page. If
+ yes then jump back to the misaligned loop to copy a byte at a time. */
+ and tmp1, src2, #0xff8
+ eor tmp1, tmp1, #0xff8
+ cbz tmp1, L(do_misaligned)
+ ldr data1, [src1], #8
+ ldr data2, [src2], #8
+
+ sub tmp1, data1, zeroones
+ orr tmp2, data1, #REP8_7f
+ eor diff, data1, data2 /* Non-zero if differences found. */
+ bic has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
+ orr syndrome, diff, has_nul
+ cbz syndrome, L(loop_misaligned)
+ b L(end)
+
+L(done):
sub result, data1, data2
RET
END(strcmp)
diff --git a/sysdeps/aarch64/strcpy.S b/sysdeps/aarch64/strcpy.S
index 0694199372..0449fcb04e 100644
--- a/sysdeps/aarch64/strcpy.S
+++ b/sysdeps/aarch64/strcpy.S
@@ -1,5 +1,5 @@
/* strcpy/stpcpy - copy a string returning pointer to start/end.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -91,6 +91,8 @@
#define MIN_PAGE_SIZE (1 << MIN_PAGE_P2)
ENTRY_ALIGN (STRCPY, 6)
+ DELOUSE (0)
+ DELOUSE (1)
/* For moderately short strings, the fastest way to do the copy is to
calculate the length of the string in the same way as strlen, then
essentially do a memcpy of the result. This avoids the need for
diff --git a/sysdeps/aarch64/string_private.h b/sysdeps/aarch64/string_private.h
index 8b194a41a6..ba6297417a 100644
--- a/sysdeps/aarch64/string_private.h
+++ b/sysdeps/aarch64/string_private.h
@@ -1,5 +1,5 @@
/* Define _STRING_ARCH_unaligned. AArch64 version.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/aarch64/strlen.S b/sysdeps/aarch64/strlen.S
index 9b4d1da60c..32292e3b6e 100644
--- a/sysdeps/aarch64/strlen.S
+++ b/sysdeps/aarch64/strlen.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -84,7 +84,9 @@
whether the first fetch, which may be misaligned, crosses a page
boundary. */
-ENTRY_ALIGN (strlen, 6)
+ENTRY_ALIGN (__strlen, 6)
+ DELOUSE (0)
+ DELOUSE (1)
and tmp1, srcin, MIN_PAGE_SIZE - 1
mov zeroones, REP8_01
cmp tmp1, MIN_PAGE_SIZE - 16
@@ -213,5 +215,6 @@ L(page_cross):
csel data1, data1, tmp4, eq
csel data2, data2, tmp2, eq
b L(page_cross_entry)
-END (strlen)
+END (__strlen)
+weak_alias (__strlen, strlen)
libc_hidden_builtin_def (strlen)
diff --git a/sysdeps/aarch64/strncmp.S b/sysdeps/aarch64/strncmp.S
index f6a17fdba2..759c752fc2 100644
--- a/sysdeps/aarch64/strncmp.S
+++ b/sysdeps/aarch64/strncmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -49,15 +49,19 @@
#define limit_wd x13
#define mask x14
#define endloop x15
+#define count mask
ENTRY_ALIGN_AND_PAD (strncmp, 6, 7)
+ DELOUSE (0)
+ DELOUSE (1)
+ DELOUSE (2)
cbz limit, L(ret0)
eor tmp1, src1, src2
mov zeroones, #REP8_01
tst tmp1, #7
+ and count, src1, #7
b.ne L(misaligned8)
- ands tmp1, src1, #7
- b.ne L(mutual_align)
+ cbnz count, L(mutual_align)
/* Calculate the number of full and partial words -1. */
sub limit_wd, limit, #1 /* limit != 0, so no underflow. */
lsr limit_wd, limit_wd, #3 /* Convert to Dwords. */
@@ -162,43 +166,107 @@ L(mutual_align):
bic src1, src1, #7
bic src2, src2, #7
ldr data1, [src1], #8
- neg tmp3, tmp1, lsl #3 /* 64 - bits(bytes beyond align). */
+ neg tmp3, count, lsl #3 /* 64 - bits(bytes beyond align). */
ldr data2, [src2], #8
mov tmp2, #~0
sub limit_wd, limit, #1 /* limit != 0, so no underflow. */
#ifdef __AARCH64EB__
/* Big-endian. Early bytes are at MSB. */
- lsl tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */
+ lsl tmp2, tmp2, tmp3 /* Shift (count & 63). */
#else
/* Little-endian. Early bytes are at LSB. */
- lsr tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */
+ lsr tmp2, tmp2, tmp3 /* Shift (count & 63). */
#endif
and tmp3, limit_wd, #7
lsr limit_wd, limit_wd, #3
/* Adjust the limit. Only low 3 bits used, so overflow irrelevant. */
- add limit, limit, tmp1
- add tmp3, tmp3, tmp1
+ add limit, limit, count
+ add tmp3, tmp3, count
orr data1, data1, tmp2
orr data2, data2, tmp2
add limit_wd, limit_wd, tmp3, lsr #3
b L(start_realigned)
-L(ret0):
- mov result, #0
- RET
-
.p2align 6
+ /* Don't bother with dwords for up to 16 bytes. */
L(misaligned8):
- sub limit, limit, #1
-1:
+ cmp limit, #16
+ b.hs L(try_misaligned_words)
+
+L(byte_loop):
/* Perhaps we can do better than this. */
ldrb data1w, [src1], #1
ldrb data2w, [src2], #1
subs limit, limit, #1
- ccmp data1w, #1, #0, cs /* NZCV = 0b0000. */
+ ccmp data1w, #1, #0, hi /* NZCV = 0b0000. */
ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
- b.eq 1b
+ b.eq L(byte_loop)
+L(done):
sub result, data1, data2
RET
+
+ /* Align the SRC1 to a dword by doing a bytewise compare and then do
+ the dword loop. */
+L(try_misaligned_words):
+ lsr limit_wd, limit, #3
+ cbz count, L(do_misaligned)
+
+ neg count, count
+ and count, count, #7
+ sub limit, limit, count
+ lsr limit_wd, limit, #3
+
+L(page_end_loop):
+ ldrb data1w, [src1], #1
+ ldrb data2w, [src2], #1
+ cmp data1w, #1
+ ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
+ b.ne L(done)
+ subs count, count, #1
+ b.hi L(page_end_loop)
+
+L(do_misaligned):
+ /* Prepare ourselves for the next page crossing. Unlike the aligned
+ loop, we fetch 1 less dword because we risk crossing bounds on
+ SRC2. */
+ mov count, #8
+ subs limit_wd, limit_wd, #1
+ b.lo L(done_loop)
+L(loop_misaligned):
+ and tmp2, src2, #0xff8
+ eor tmp2, tmp2, #0xff8
+ cbz tmp2, L(page_end_loop)
+
+ ldr data1, [src1], #8
+ ldr data2, [src2], #8
+ sub tmp1, data1, zeroones
+ orr tmp2, data1, #REP8_7f
+ eor diff, data1, data2 /* Non-zero if differences found. */
+ bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
+ ccmp diff, #0, #0, eq
+ b.ne L(not_limit)
+ subs limit_wd, limit_wd, #1
+ b.pl L(loop_misaligned)
+
+L(done_loop):
+ /* We found a difference or a NULL before the limit was reached. */
+ and limit, limit, #7
+ cbz limit, L(not_limit)
+ /* Read the last word. */
+ sub src1, src1, 8
+ sub src2, src2, 8
+ ldr data1, [src1, limit]
+ ldr data2, [src2, limit]
+ sub tmp1, data1, zeroones
+ orr tmp2, data1, #REP8_7f
+ eor diff, data1, data2 /* Non-zero if differences found. */
+ bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
+ ccmp diff, #0, #0, eq
+ b.ne L(not_limit)
+
+L(ret0):
+ mov result, #0
+ RET
+
END (strncmp)
libc_hidden_builtin_def (strncmp)
diff --git a/sysdeps/aarch64/strnlen.S b/sysdeps/aarch64/strnlen.S
index 4cce45f905..0f190e83e2 100644
--- a/sysdeps/aarch64/strnlen.S
+++ b/sysdeps/aarch64/strnlen.S
@@ -1,6 +1,6 @@
/* strnlen - calculate the length of a string with limit.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -50,6 +50,9 @@
#define REP8_80 0x8080808080808080
ENTRY_ALIGN_AND_PAD (__strnlen, 6, 9)
+ DELOUSE (0)
+ DELOUSE (1)
+ DELOUSE (2)
cbz limit, L(hit_limit)
mov zeroones, #REP8_01
bic src, srcin, #15
diff --git a/sysdeps/aarch64/strrchr.S b/sysdeps/aarch64/strrchr.S
index 44c1917a20..aa334ede53 100644
--- a/sysdeps/aarch64/strrchr.S
+++ b/sysdeps/aarch64/strrchr.S
@@ -1,6 +1,6 @@
/* strrchr: find the last instance of a character in a string.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -68,6 +68,7 @@
identify exactly which byte is causing the termination, and why. */
ENTRY(strrchr)
+ DELOUSE (0)
cbz x1, L(null_search)
/* Magic constant 0x40100401 to allow us to identify which lane
matches the requested byte. Magic constant 0x80200802 used
diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h
index 6b728ec651..5b30709436 100644
--- a/sysdeps/aarch64/sysdep.h
+++ b/sysdeps/aarch64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,8 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _AARCH64_SYSDEP_H
+#define _AARCH64_SYSDEP_H
+
#include <sysdeps/generic/sysdep.h>
+#ifdef __LP64__
+# define AARCH64_R(NAME) R_AARCH64_ ## NAME
+# define PTR_REG(n) x##n
+# define PTR_LOG_SIZE 3
+# define DELOUSE(n)
+#else
+# define AARCH64_R(NAME) R_AARCH64_P32_ ## NAME
+# define PTR_REG(n) w##n
+# define PTR_LOG_SIZE 2
+# define DELOUSE(n) mov w##n, w##n
+#endif
+
+#define PTR_SIZE (1<<PTR_LOG_SIZE)
+
#ifdef __ASSEMBLER__
/* Syntactic details of assembler. */
@@ -66,9 +83,38 @@
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
# define CALL_MCOUNT \
- str x30, [sp, #-16]!; \
+ str x30, [sp, #-80]!; \
+ cfi_adjust_cfa_offset (80); \
+ cfi_rel_offset (x30, 0); \
+ stp x0, x1, [sp, #16]; \
+ cfi_rel_offset (x0, 16); \
+ cfi_rel_offset (x1, 24); \
+ stp x2, x3, [sp, #32]; \
+ cfi_rel_offset (x2, 32); \
+ cfi_rel_offset (x3, 40); \
+ stp x4, x5, [sp, #48]; \
+ cfi_rel_offset (x4, 48); \
+ cfi_rel_offset (x5, 56); \
+ stp x6, x7, [sp, #64]; \
+ cfi_rel_offset (x6, 64); \
+ cfi_rel_offset (x7, 72); \
+ mov x0, x30; \
bl mcount; \
- ldr x30, [sp], #16 ;
+ ldp x0, x1, [sp, #16]; \
+ cfi_restore (x0); \
+ cfi_restore (x1); \
+ ldp x2, x3, [sp, #32]; \
+ cfi_restore (x2); \
+ cfi_restore (x3); \
+ ldp x4, x5, [sp, #48]; \
+ cfi_restore (x4); \
+ cfi_restore (x5); \
+ ldp x6, x7, [sp, #64]; \
+ cfi_restore (x6); \
+ cfi_restore (x7); \
+ ldr x30, [sp], #80; \
+ cfi_adjust_cfa_offset (-80); \
+ cfi_restore (x30);
#else
# define CALL_MCOUNT /* Do nothing. */
#endif
@@ -78,16 +124,32 @@
# define L(name) .L##name
#endif
-/* Load or store to/from a pc-relative EXPR into/from R, using T. */
-#define LDST_PCREL(OP, R, T, EXPR) \
- adrp T, EXPR; \
- OP R, [T, #:lo12:EXPR];\
-
-/* Load or store to/from a got-relative EXPR into/from R, using T. */
-#define LDST_GLOBAL(OP, R, T, EXPR) \
- adrp T, :got:EXPR; \
- ldr T, [T, #:got_lo12:EXPR];\
- OP R, [T];
+/* Load or store to/from a pc-relative EXPR into/from R, using T.
+ Note R and T are register numbers and not register names. */
+#define LDST_PCREL(OP, R, T, EXPR) \
+ adrp x##T, EXPR; \
+ OP PTR_REG (R), [x##T, #:lo12:EXPR]; \
+
+/* Load or store to/from a got-relative EXPR into/from R, using T.
+ Note R and T are register numbers and not register names. */
+#define LDST_GLOBAL(OP, R, T, EXPR) \
+ adrp x##T, :got:EXPR; \
+ ldr PTR_REG (T), [x##T, #:got_lo12:EXPR]; \
+ OP PTR_REG (R), [x##T];
+
+/* Load an immediate into R.
+ Note R is a register number and not a register name. */
+#ifdef __LP64__
+# define MOVL(R, NAME) \
+ movz PTR_REG (R), #:abs_g3:NAME; \
+ movk PTR_REG (R), #:abs_g2_nc:NAME; \
+ movk PTR_REG (R), #:abs_g1_nc:NAME; \
+ movk PTR_REG (R), #:abs_g0_nc:NAME;
+#else
+# define MOVL(R, NAME) \
+ movz PTR_REG (R), #:abs_g1:NAME; \
+ movk PTR_REG (R), #:abs_g0_nc:NAME;
+#endif
/* Since C identifiers are not normally prefixed with an underscore
on this system, the asm identifier `syscall_error' intrudes on the
@@ -96,3 +158,5 @@
#define mcount _mcount
#endif /* __ASSEMBLER__ */
+
+#endif /* _AARCH64_SYSDEP_H */
diff --git a/sysdeps/aarch64/tls-macros.h b/sysdeps/aarch64/tls-macros.h
index 2080a4dfa4..cc58a7d6bf 100644
--- a/sysdeps/aarch64/tls-macros.h
+++ b/sysdeps/aarch64/tls-macros.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/aarch64/tlsdesc.c b/sysdeps/aarch64/tlsdesc.c
index ac3a9f4591..357465f23d 100644
--- a/sysdeps/aarch64/tlsdesc.c
+++ b/sysdeps/aarch64/tlsdesc.c
@@ -1,6 +1,6 @@
/* Manage TLS descriptors. AArch64 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -18,143 +18,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <link.h>
#include <ldsodefs.h>
-#include <elf/dynamic-link.h>
#include <tls.h>
#include <dl-tlsdesc.h>
#include <dl-unmap-segments.h>
+#define _dl_tlsdesc_resolve_hold 0
#include <tlsdeschtab.h>
-#include <atomic.h>
-
-/* The following functions take an entry_check_offset argument. It's
- computed by the caller as an offset between its entry point and the
- call site, such that by adding the built-in return address that is
- implicitly passed to the function with this offset, we can easily
- obtain the caller's entry point to compare with the entry point
- given in the TLS descriptor. If it's changed, we want to return
- immediately. */
-
-/* This function is used to lazily resolve TLS_DESC RELA relocations.
- The argument location is used to hold a pointer to the relocation. */
-
-void
-attribute_hidden
-_dl_tlsdesc_resolve_rela_fixup (struct tlsdesc *td, struct link_map *l)
-{
- const ElfW(Rela) *reloc = atomic_load_relaxed (&td->arg);
-
- /* After GL(dl_load_lock) is grabbed only one caller can see td->entry in
- initial state in _dl_tlsdesc_resolve_early_return_p, other concurrent
- callers will return and retry calling td->entry. The updated td->entry
- synchronizes with the single writer so all read accesses here can use
- relaxed order. */
- if (_dl_tlsdesc_resolve_early_return_p
- (td, (void*)(D_PTR (l, l_info[ADDRIDX (DT_TLSDESC_PLT)]) + l->l_addr)))
- return;
-
- /* The code below was borrowed from _dl_fixup(),
- except for checking for STB_LOCAL. */
- const ElfW(Sym) *const symtab
- = (const void *) D_PTR (l, l_info[DT_SYMTAB]);
- const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]);
- const ElfW(Sym) *sym = &symtab[ELFW(R_SYM) (reloc->r_info)];
- lookup_t result;
-
- /* Look up the target symbol. If the normal lookup rules are not
- used don't look in the global scope. */
- if (ELFW(ST_BIND) (sym->st_info) != STB_LOCAL
- && __builtin_expect (ELFW(ST_VISIBILITY) (sym->st_other), 0) == 0)
- {
- const struct r_found_version *version = NULL;
-
- if (l->l_info[VERSYMIDX (DT_VERSYM)] != NULL)
- {
- const ElfW(Half) *vernum =
- (const void *) D_PTR (l, l_info[VERSYMIDX (DT_VERSYM)]);
- ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)] & 0x7fff;
- version = &l->l_versions[ndx];
- if (version->hash == 0)
- version = NULL;
- }
-
- result = _dl_lookup_symbol_x (strtab + sym->st_name, l, &sym,
- l->l_scope, version, ELF_RTYPE_CLASS_PLT,
- DL_LOOKUP_ADD_DEPENDENCY, NULL);
- }
- else
- {
- /* We already found the symbol. The module (and therefore its load
- address) is also known. */
- result = l;
- }
-
- if (!sym)
- {
- atomic_store_relaxed (&td->arg, (void *) reloc->r_addend);
- /* This release store synchronizes with the ldar acquire load
- instruction in _dl_tlsdesc_undefweak. */
- atomic_store_release (&td->entry, _dl_tlsdesc_undefweak);
- }
- else
- {
-# ifndef SHARED
- CHECK_STATIC_TLS (l, result);
-# else
- if (!TRY_STATIC_TLS (l, result))
- {
- void *p = _dl_make_tlsdesc_dynamic (result, sym->st_value
- + reloc->r_addend);
- atomic_store_relaxed (&td->arg, p);
- /* This release store synchronizes with the ldar acquire load
- instruction in _dl_tlsdesc_dynamic. */
- atomic_store_release (&td->entry, _dl_tlsdesc_dynamic);
- }
- else
-# endif
- {
- void *p = (void*) (sym->st_value + result->l_tls_offset
- + reloc->r_addend);
- atomic_store_relaxed (&td->arg, p);
- /* This release store synchronizes with the ldar acquire load
- instruction in _dl_tlsdesc_return_lazy. */
- atomic_store_release (&td->entry, _dl_tlsdesc_return_lazy);
- }
- }
-
- _dl_tlsdesc_wake_up_held_fixups ();
-}
-
-/* This function is used to avoid busy waiting for other threads to
- complete the lazy relocation. Once another thread wins the race to
- relocate a TLS descriptor, it sets the descriptor up such that this
- function is called to wait until the resolver releases the
- lock. */
-
-void
-attribute_hidden
-_dl_tlsdesc_resolve_hold_fixup (struct tlsdesc *td, void *caller)
-{
- /* Maybe we're lucky and can return early. */
- if (caller != atomic_load_relaxed (&td->entry))
- return;
-
- /* Locking here will stop execution until the running resolver runs
- _dl_tlsdesc_wake_up_held_fixups(), releasing the lock.
-
- FIXME: We'd be better off waiting on a condition variable, such
- that we didn't have to hold the lock throughout the relocation
- processing. */
- __rtld_lock_lock_recursive (GL(dl_load_lock));
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
-}
-
/* Unmap the dynamic object, but also release its TLS descriptor table
if there is one. */
void
-internal_function
_dl_unmap (struct link_map *map)
{
_dl_unmap_segments (map);
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index 63766af612..a06a719779 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -13,3 +13,6 @@ TLSDESC_ARG offsetof(struct tlsdesc, arg)
TLSDESC_GEN_COUNT offsetof(struct tlsdesc_dynamic_arg, gen_count)
TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
+TCBHEAD_DTV offsetof(tcbhead_t, dtv)
+DTV_COUNTER offsetof(dtv_t, counter)
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
diff --git a/sysdeps/aarch64/tst-audit.h b/sysdeps/aarch64/tst-audit.h
index 8ed01484e3..fd4f38f613 100644
--- a/sysdeps/aarch64/tst-audit.h
+++ b/sysdeps/aarch64/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. AArch64 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/Implies b/sysdeps/alpha/Implies
index d03783b127..18fc4f339d 100644
--- a/sysdeps/alpha/Implies
+++ b/sysdeps/alpha/Implies
@@ -4,4 +4,3 @@ ieee754/ldbl-128
ieee754/dbl-64/wordsize-64
ieee754/dbl-64
ieee754/flt-32
-alpha/soft-fp
diff --git a/sysdeps/alpha/Makefile b/sysdeps/alpha/Makefile
index 9c6ca6db74..0651414b03 100644
--- a/sysdeps/alpha/Makefile
+++ b/sysdeps/alpha/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1993-2016 Free Software Foundation, Inc.
+# Copyright (C) 1993-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Brendan Kehoe (brendan@zen.org).
@@ -60,3 +60,15 @@ sysdep-CFLAGS += -mieee -mfp-rounding-mode=d
# libc.so requires about 16k for the small data area, which is well
# below the 64k maximum.
pic-ccflag = -fpic
+
+# Software floating-point emulation.
+
+ifeq ($(subdir),soft-fp)
+sysdep_routines += ots_add ots_sub ots_mul ots_div ots_cmp ots_cmpe \
+ ots_cvtxq ots_cvtqx ots_cvtqux ots_cvttx ots_cvtxt ots_nintxq \
+ fraiseexcpt
+endif
+
+ifeq ($(subdir),math)
+CPPFLAGS += -I../soft-fp
+endif
diff --git a/sysdeps/alpha/Versions b/sysdeps/alpha/Versions
index ae8fde7b23..f9946abf14 100644
--- a/sysdeps/alpha/Versions
+++ b/sysdeps/alpha/Versions
@@ -4,6 +4,12 @@ libc {
__divqu; __remqu; __divqs; __remqs; __divlu; __remlu; __divls;
__remls; __divl; __reml; __divq; __remq; __divqu; __remqu;
}
+ GLIBC_2.3.4 {
+ _OtsAddX; _OtsSubX; _OtsMulX; _OtsDivX;
+ _OtsEqlX; _OtsNeqX; _OtsLssX; _OtsLeqX; _OtsGtrX; _OtsGeqX;
+ _OtsCvtQX; _OtsCvtQUX; _OtsCvtXQ; _OtsNintXQ;
+ _OtsConvertFloatTX; _OtsConvertFloatXT;
+ }
}
libm {
GLIBC_2.0 {
diff --git a/sysdeps/alpha/__longjmp.S b/sysdeps/alpha/__longjmp.S
index 7fe20adc0f..b082d46768 100644
--- a/sysdeps/alpha/__longjmp.S
+++ b/sysdeps/alpha/__longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/_mcount.S b/sysdeps/alpha/_mcount.S
index 46e7b55965..34c8cb4faf 100644
--- a/sysdeps/alpha/_mcount.S
+++ b/sysdeps/alpha/_mcount.S
@@ -1,5 +1,5 @@
/* Machine-specific calling sequence for `mcount' profiling function. alpha
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
Contributed by David Mosberger (davidm@cs.arizona.edu).
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/add_n.S b/sysdeps/alpha/add_n.S
index 23ae40278a..5e79946beb 100644
--- a/sysdeps/alpha/add_n.S
+++ b/sysdeps/alpha/add_n.S
@@ -1,7 +1,7 @@
# Alpha __mpn_add_n -- Add two limb vectors of the same length > 0 and
# store sum in a third limb vector.
- # Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1995-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/addmul_1.S b/sysdeps/alpha/addmul_1.S
index 7afef97d7b..857826cf4b 100644
--- a/sysdeps/alpha/addmul_1.S
+++ b/sysdeps/alpha/addmul_1.S
@@ -1,7 +1,7 @@
# Alpha 21064 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
# the result to a second limb vector.
- # Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1992-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/alphaev5/add_n.S b/sysdeps/alpha/alphaev5/add_n.S
index 7ff77d3574..fe2830ebf2 100644
--- a/sysdeps/alpha/alphaev5/add_n.S
+++ b/sysdeps/alpha/alphaev5/add_n.S
@@ -1,7 +1,7 @@
# Alpha __mpn_add_n -- Add two limb vectors of the same length > 0 and
# store sum in a third limb vector.
- # Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1995-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/alphaev5/lshift.S b/sysdeps/alpha/alphaev5/lshift.S
index bb4f6c2424..62d2806bbd 100644
--- a/sysdeps/alpha/alphaev5/lshift.S
+++ b/sysdeps/alpha/alphaev5/lshift.S
@@ -1,6 +1,6 @@
# Alpha EV5 __mpn_lshift --
- # Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/alphaev5/rshift.S b/sysdeps/alpha/alphaev5/rshift.S
index f3a6b139cf..bcda73c42b 100644
--- a/sysdeps/alpha/alphaev5/rshift.S
+++ b/sysdeps/alpha/alphaev5/rshift.S
@@ -1,6 +1,6 @@
# Alpha EV5 __mpn_rshift --
- # Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/alphaev5/sub_n.S b/sysdeps/alpha/alphaev5/sub_n.S
index 50c4134501..fa2e3e4b73 100644
--- a/sysdeps/alpha/alphaev5/sub_n.S
+++ b/sysdeps/alpha/alphaev5/sub_n.S
@@ -1,7 +1,7 @@
# Alpha __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
# store difference in a third limb vector.
- # Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1995-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/alphaev6/addmul_1.S b/sysdeps/alpha/alphaev6/addmul_1.S
index f8e3c47f5b..0912f1bc49 100644
--- a/sysdeps/alpha/alphaev6/addmul_1.S
+++ b/sysdeps/alpha/alphaev6/addmul_1.S
@@ -1,7 +1,7 @@
# Alpha ev6 mpn_addmul_1 -- Multiply a limb vector with a limb and add
# the result to a second limb vector.
#
- # Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ # Copyright (C) 2000-2018 Free Software Foundation, Inc.
#
# This file is part of the GNU MP Library.
#
diff --git a/sysdeps/alpha/alphaev6/fpu/e_sqrt.S b/sysdeps/alpha/alphaev6/fpu/e_sqrt.S
index dd983a66b2..b5923e67b3 100644
--- a/sysdeps/alpha/alphaev6/fpu/e_sqrt.S
+++ b/sysdeps/alpha/alphaev6/fpu/e_sqrt.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S b/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S
index 9dd5363dbd..a7f25e1abe 100644
--- a/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S
+++ b/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/alphaev6/memcpy.S b/sysdeps/alpha/alphaev6/memcpy.S
index da889e5bdb..7cf94d8bb7 100644
--- a/sysdeps/alpha/alphaev6/memcpy.S
+++ b/sysdeps/alpha/alphaev6/memcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
diff --git a/sysdeps/alpha/alphaev6/memset.S b/sysdeps/alpha/alphaev6/memset.S
index c116a8e6d9..e1a2525e82 100644
--- a/sysdeps/alpha/alphaev6/memset.S
+++ b/sysdeps/alpha/alphaev6/memset.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/alphaev6/stxcpy.S b/sysdeps/alpha/alphaev6/stxcpy.S
index 7493dcde8e..33e8e8de9c 100644
--- a/sysdeps/alpha/alphaev6/stxcpy.S
+++ b/sysdeps/alpha/alphaev6/stxcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/alphaev6/stxncpy.S b/sysdeps/alpha/alphaev6/stxncpy.S
index ab31270509..ed582a4e7c 100644
--- a/sysdeps/alpha/alphaev6/stxncpy.S
+++ b/sysdeps/alpha/alphaev6/stxncpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/alphaev67/ffs.S b/sysdeps/alpha/alphaev67/ffs.S
index 8e9ec78209..d715c321eb 100644
--- a/sysdeps/alpha/alphaev67/ffs.S
+++ b/sysdeps/alpha/alphaev67/ffs.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/alphaev67/ffsll.S b/sysdeps/alpha/alphaev67/ffsll.S
index b674e84d27..f555eb5137 100644
--- a/sysdeps/alpha/alphaev67/ffsll.S
+++ b/sysdeps/alpha/alphaev67/ffsll.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/alphaev67/rawmemchr.S b/sysdeps/alpha/alphaev67/rawmemchr.S
index 13b7b3c29c..09df8f7a4c 100644
--- a/sysdeps/alpha/alphaev67/rawmemchr.S
+++ b/sysdeps/alpha/alphaev67/rawmemchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/alphaev67/stpcpy.S b/sysdeps/alpha/alphaev67/stpcpy.S
index 6137b5e0d2..47da958810 100644
--- a/sysdeps/alpha/alphaev67/stpcpy.S
+++ b/sysdeps/alpha/alphaev67/stpcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@redhat.com>.
diff --git a/sysdeps/alpha/alphaev67/stpncpy.S b/sysdeps/alpha/alphaev67/stpncpy.S
index a839cc0cc4..f0de95992a 100644
--- a/sysdeps/alpha/alphaev67/stpncpy.S
+++ b/sysdeps/alpha/alphaev67/stpncpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@redhat.com)
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/alphaev67/strcat.S b/sysdeps/alpha/alphaev67/strcat.S
index c12eba2173..03f2ad0bdd 100644
--- a/sysdeps/alpha/alphaev67/strcat.S
+++ b/sysdeps/alpha/alphaev67/strcat.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@tamu.edu>, 1996.
EV67 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/alphaev67/strchr.S b/sysdeps/alpha/alphaev67/strchr.S
index 0b23709832..536799e0e2 100644
--- a/sysdeps/alpha/alphaev67/strchr.S
+++ b/sysdeps/alpha/alphaev67/strchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@tamu.edu>, 1996.
EV67 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/alphaev67/strlen.S b/sysdeps/alpha/alphaev67/strlen.S
index e589373ccc..26bdd53d51 100644
--- a/sysdeps/alpha/alphaev67/strlen.S
+++ b/sysdeps/alpha/alphaev67/strlen.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by David Mosberger (davidm@cs.arizona.edu).
EV67 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/alphaev67/strncat.S b/sysdeps/alpha/alphaev67/strncat.S
index 4705b842a9..667d447e98 100644
--- a/sysdeps/alpha/alphaev67/strncat.S
+++ b/sysdeps/alpha/alphaev67/strncat.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@tamu.edu>, 1996.
EV67 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/alphaev67/strrchr.S b/sysdeps/alpha/alphaev67/strrchr.S
index 54b816d1f0..b6629a37d7 100644
--- a/sysdeps/alpha/alphaev67/strrchr.S
+++ b/sysdeps/alpha/alphaev67/strrchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
EV67 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/atomic-machine.h b/sysdeps/alpha/atomic-machine.h
index d96cb7aa93..c33c6ddec3 100644
--- a/sysdeps/alpha/atomic-machine.h
+++ b/sysdeps/alpha/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -45,6 +45,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 1
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
#ifdef UP
# define __MB /* nothing */
@@ -210,10 +213,6 @@ typedef uintmax_t uatomic_max_t;
/* Compare and exchange with "release" semantics, ie barrier before. */
-#define atomic_compare_and_exchange_bool_rel(mem, new, old) \
- __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
- mem, new, old, __MB, "")
-
#define atomic_compare_and_exchange_val_rel(mem, new, old) \
__atomic_val_bysize (__arch_compare_and_exchange_val, int, \
mem, new, old, __MB, "")
diff --git a/sysdeps/alpha/backtrace.c b/sysdeps/alpha/backtrace.c
deleted file mode 100644
index 27ce597b39..0000000000
--- a/sysdeps/alpha/backtrace.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/x86_64/backtrace.c>
diff --git a/sysdeps/alpha/bb_init_func.S b/sysdeps/alpha/bb_init_func.S
deleted file mode 100644
index 997a28952f..0000000000
--- a/sysdeps/alpha/bb_init_func.S
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
- Contributed by David Mosberger (davidm@cs.arizona.edu).
- 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/>. */
-
-/* __bb_init_func is invoked at the beginning of each function, before
- any registers have been saved. It is therefore safe to use any
- caller-saved (call-used) registers (except for argument registers
- a1-a5). */
-
-#include <sysdep.h>
-
-/*
- * These offsets should match with "struct bb" declared in gcc/libgcc2.c.
- */
-#define ZERO_WORD 0x00
-#define NEXT 0x20
-
- .set noat
- .set noreorder
-
-ENTRY(__bb_init_func)
- .prologue 0
-
- ldq t0, ZERO_WORD(a0) /* t0 <- blocks->zero_word */
- beq t0, init /* not initialized yet -> */
- ret
-
-END(__bb_init_func)
-
- .ent init
-init:
- .frame sp, 0x38, ra, 0
- subq sp, 0x38, sp
- .prologue 0
-
- stq pv, 0x30(sp)
- br pv, 1f
-1: ldgp gp, 0(pv)
-
- ldiq t1, __bb_head
- lda t3, _gmonparam
- ldq t2, 0(t1)
- ldl t3, 0(t3) /* t3 = _gmonparam.state */
- lda t0, 1
- stq t0, ZERO_WORD(a0) /* blocks->zero_word = 1 */
- stq t2, NEXT(a0) /* blocks->next = __bb_head */
- stq a0, 0(t1)
- bne t2, $leave
- beq t3, $leave /* t3 == GMON_PROF_ON? yes -> */
-
- /* also need to initialize destructor: */
- stq ra, 0x00(sp)
- lda a0, __bb_exit_func
- stq a1, 0x08(sp)
- lda pv, atexit
- stq a2, 0x10(sp)
- stq a3, 0x18(sp)
- stq a4, 0x20(sp)
- stq a5, 0x28(sp)
- jsr ra, (pv), atexit
- ldq ra, 0x00(sp)
- ldq a1, 0x08(sp)
- ldq a2, 0x10(sp)
- ldq a3, 0x18(sp)
- ldq a4, 0x20(sp)
- ldq a5, 0x28(sp)
-
-$leave: ldq pv, 0x30(sp)
- addq sp, 0x38, sp
- ret
-
- .end init
diff --git a/sysdeps/alpha/bits/link.h b/sysdeps/alpha/bits/link.h
index 7fe5fb4690..0043e21553 100644
--- a/sysdeps/alpha/bits/link.h
+++ b/sysdeps/alpha/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/bits/mathdef.h b/sysdeps/alpha/bits/mathdef.h
index ed70ad8dbd..91880c6d70 100644
--- a/sysdeps/alpha/bits/mathdef.h
+++ b/sysdeps/alpha/bits/mathdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software 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,26 +15,10 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#ifndef _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <complex.h> instead"
#endif
-/* FIXME! This file describes properties of the compiler, not the machine;
- it should not be part of libc! */
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* Alpha has "float" and "double" operations. */
-typedef float float_t; /* float expressions are evaluated as float. */
-typedef double double_t; /* double expressions are evaluated as double. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647)
-# define FP_ILOGBNAN (2147483647)
-
-#endif /* ISO C99 && MATH_H */
-
#if defined _COMPLEX_H && !defined _COMPLEX_H_MATHDEF
# define _COMPLEX_H_MATHDEF 1
# if defined(__GNUC__) && !__GNUC_PREREQ(3,4)
diff --git a/sysdeps/alpha/bits/setjmp.h b/sysdeps/alpha/bits/setjmp.h
index 75567aead3..f8c832ac3e 100644
--- a/sysdeps/alpha/bits/setjmp.h
+++ b/sysdeps/alpha/bits/setjmp.h
@@ -1,5 +1,5 @@
/* Define the machine-dependent type `jmp_buf'. Alpha version.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/bzero.S b/sysdeps/alpha/bzero.S
index e603e42d90..f322dd6900 100644
--- a/sysdeps/alpha/bzero.S
+++ b/sysdeps/alpha/bzero.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/crti.S b/sysdeps/alpha/crti.S
index 068ed64c5e..bcce1e9055 100644
--- a/sysdeps/alpha/crti.S
+++ b/sysdeps/alpha/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for Alpha.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -67,6 +67,7 @@
.section .init, "ax", @progbits
.globl _init
+ .hidden _init
.type _init, @function
.usepv _init, std
_init:
@@ -89,6 +90,7 @@ _init:
.section .fini, "ax", @progbits
.globl _fini
+ .hidden _fini
.type _fini,@function
.usepv _fini,std
_fini:
diff --git a/sysdeps/alpha/crtn.S b/sysdeps/alpha/crtn.S
index 24363f3f6b..a34564088c 100644
--- a/sysdeps/alpha/crtn.S
+++ b/sysdeps/alpha/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for Alpha.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/div.S b/sysdeps/alpha/div.S
index aa19ad738e..519c72148a 100644
--- a/sysdeps/alpha/div.S
+++ b/sysdeps/alpha/div.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>.
diff --git a/sysdeps/alpha/div_libc.h b/sysdeps/alpha/div_libc.h
index 930f096560..4b5cfb30c0 100644
--- a/sysdeps/alpha/div_libc.h
+++ b/sysdeps/alpha/div_libc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/divl.S b/sysdeps/alpha/divl.S
index 0bad711269..0e6b299707 100644
--- a/sysdeps/alpha/divl.S
+++ b/sysdeps/alpha/divl.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/divq.S b/sysdeps/alpha/divq.S
index 3a74d0be25..a232554ca7 100644
--- a/sysdeps/alpha/divq.S
+++ b/sysdeps/alpha/divq.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/divqu.S b/sysdeps/alpha/divqu.S
index c934862658..ae12c4e846 100644
--- a/sysdeps/alpha/divqu.S
+++ b/sysdeps/alpha/divqu.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h
index 25a63c798c..810ca30fa4 100644
--- a/sysdeps/alpha/dl-machine.h
+++ b/sysdeps/alpha/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. Alpha version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>.
@@ -260,6 +260,7 @@ dl_platform_init (void)
rather than the dynamic linker. */
static inline Elf64_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf64_Rela *reloc,
Elf64_Addr *got_addr, Elf64_Addr value)
{
@@ -418,7 +419,7 @@ elf_machine_rela (struct link_map *map,
if (sym_map)
{
sym_raw_value += sym->st_value;
- sym_value = sym_raw_value + sym_map->l_addr;
+ sym_value += SYMBOL_ADDRESS (sym_map, sym, true);
}
if (r_type == R_ALPHA_GLOB_DAT)
@@ -434,11 +435,11 @@ elf_machine_rela (struct link_map *map,
RESOLVE_CONFLICT_FIND_MAP (map, reloc_addr);
reloc = ((const Elf64_Rela *) D_PTR (map, l_info[DT_JMPREL]))
+ (r_type >> 8);
- elf_machine_fixup_plt (map, 0, reloc, reloc_addr, sym_value);
+ elf_machine_fixup_plt (map, 0, 0, 0, reloc, reloc_addr, sym_value);
}
#else
else if (r_type == R_ALPHA_JMP_SLOT)
- elf_machine_fixup_plt (map, 0, reloc, reloc_addr, sym_value);
+ elf_machine_fixup_plt (map, 0, 0, 0, reloc, reloc_addr, sym_value);
#endif
#ifndef RTLD_BOOTSTRAP
else if (r_type == R_ALPHA_REFQUAD)
diff --git a/sysdeps/alpha/dl-procinfo.c b/sysdeps/alpha/dl-procinfo.c
index 910d86f019..aba378093f 100644
--- a/sysdeps/alpha/dl-procinfo.c
+++ b/sysdeps/alpha/dl-procinfo.c
@@ -1,5 +1,5 @@
/* Data for Alpha version of processor capability information.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2008.
diff --git a/sysdeps/alpha/dl-procinfo.h b/sysdeps/alpha/dl-procinfo.h
index 97d9d62df0..c33af2ce2f 100644
--- a/sysdeps/alpha/dl-procinfo.h
+++ b/sysdeps/alpha/dl-procinfo.h
@@ -1,5 +1,5 @@
/* Alpha version of processor capability information handling macros.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2008.
@@ -28,13 +28,6 @@
#define _DL_PLATFORMS_COUNT 5
-static inline const char *
-__attribute__ ((unused))
-_dl_platform_string (int idx)
-{
- return GLRO(dl_alpha_platforms)[idx];
-};
-
static inline int
__attribute__ ((unused, always_inline))
_dl_string_platform (const char *str)
@@ -44,7 +37,7 @@ _dl_string_platform (const char *str)
if (str != NULL)
for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
{
- if (strcmp (str, _dl_platform_string (i)) == 0)
+ if (strcmp (str, GLRO(dl_alpha_platforms)[i]) == 0)
return i;
}
return -1;
diff --git a/sysdeps/alpha/dl-sysdep.h b/sysdeps/alpha/dl-sysdep.h
index c1fed08bbf..257517be2a 100644
--- a/sysdeps/alpha/dl-sysdep.h
+++ b/sysdeps/alpha/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. Alpha version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/dl-tls.h b/sysdeps/alpha/dl-tls.h
index 5f4e4cf4a6..cfd6e4454a 100644
--- a/sysdeps/alpha/dl-tls.h
+++ b/sysdeps/alpha/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. Alpha version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,3 @@ typedef struct
} tls_index;
extern void *__tls_get_addr (tls_index *ti);
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/alpha/dl-trampoline.S b/sysdeps/alpha/dl-trampoline.S
index 89ffa5d8ea..b326b37ace 100644
--- a/sysdeps/alpha/dl-trampoline.S
+++ b/sysdeps/alpha/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. Alpha version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/e_sqrtl.c b/sysdeps/alpha/e_sqrtl.c
new file mode 100644
index 0000000000..689681adfc
--- /dev/null
+++ b/sysdeps/alpha/e_sqrtl.c
@@ -0,0 +1,49 @@
+/* long double square root in software floating-point emulation.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com) and
+ Jakub Jelinek (jj@ultra.linux.cz).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <stdlib.h>
+#include <soft-fp.h>
+#include <quad.h>
+#include <shlib-compat.h>
+
+long double
+__ieee754_sqrtl (const long double a)
+{
+ FP_DECL_EX;
+ FP_DECL_Q(A); FP_DECL_Q(C);
+ long double c;
+ long _round = 4; /* dynamic rounding */
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q(A, a);
+ FP_SQRT_Q(C, A);
+ FP_PACK_Q(c, C);
+ FP_HANDLE_EXCEPTIONS;
+ return c;
+}
+
+/* ??? We forgot to add this symbol in 2.15. Getting this into 2.18 isn't as
+ straight-forward as just adding the alias, since a generic Versions file
+ includes the 2.15 version and the linker uses the first one it sees. */
+#if SHLIB_COMPAT (libm, GLIBC_2_15, GLIBC_2_18)
+versioned_symbol (libm, __ieee754_sqrtl, __sqrtl_finite, GLIBC_2_18);
+#else
+strong_alias(__ieee754_sqrtl, __sqrtl_finite)
+#endif
diff --git a/sysdeps/alpha/ffs.S b/sysdeps/alpha/ffs.S
index a4482f0568..158a78135f 100644
--- a/sysdeps/alpha/ffs.S
+++ b/sysdeps/alpha/ffs.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Contributed by David Mosberger (davidm@cs.arizona.edu).
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/fpu/bits/fenv.h b/sysdeps/alpha/fpu/bits/fenv.h
index b7da4a0eae..d4e0f73bc6 100644
--- a/sysdeps/alpha/fpu/bits/fenv.h
+++ b/sysdeps/alpha/fpu/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -131,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/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h
deleted file mode 100644
index d8ae1f4526..0000000000
--- a/sysdeps/alpha/fpu/bits/mathinline.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Inline math functions for Alpha.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Mosberger-Tang.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_inline
-#endif
-
-#if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0)
-# undef isgreater
-# undef isgreaterequal
-# undef isless
-# undef islessequal
-# undef islessgreater
-# undef isunordered
-# define isunordered(u, v) \
- (__extension__ \
- ({ double __r, __u = (u), __v = (v); \
- __asm ("cmptun/su %1,%2,%0\n\ttrapb" \
- : "=&f" (__r) : "f" (__u), "f"(__v)); \
- __r != 0; }))
-#endif /* ISO C99 */
-
-#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
- && defined __OPTIMIZE__
-
-#if !__GNUC_PREREQ (4, 0)
-# define __inline_copysign(NAME, TYPE) \
-__MATH_INLINE TYPE \
-__NTH (NAME (TYPE __x, TYPE __y)) \
-{ \
- TYPE __z; \
- __asm ("cpys %1, %2, %0" : "=f" (__z) : "f" (__y), "f" (__x)); \
- return __z; \
-}
-
-__inline_copysign (__copysignf, float)
-__inline_copysign (copysignf, float)
-__inline_copysign (__copysign, double)
-__inline_copysign (copysign, double)
-
-# undef __inline_copysign
-#endif
-
-
-#if !__GNUC_PREREQ (2, 8)
-# define __inline_fabs(NAME, TYPE) \
-__MATH_INLINE TYPE \
-__NTH (NAME (TYPE __x)) \
-{ \
- TYPE __z; \
- __asm ("cpys $f31, %1, %0" : "=f" (__z) : "f" (__x)); \
- return __z; \
-}
-
-__inline_fabs (__fabsf, float)
-__inline_fabs (fabsf, float)
-__inline_fabs (__fabs, double)
-__inline_fabs (fabs, double)
-
-# undef __inline_fabs
-#endif
-
-#ifdef __USE_ISOC99
-
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-#if !__GNUC_PREREQ (4, 0)
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
-#else
- return __builtin_signbitf (__x);
-#endif
-}
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-#if !__GNUC_PREREQ (4, 0)
- __extension__ union { double __d; long __i; } __u = { __d: __x };
- return __u.__i < 0;
-#else
- return __builtin_signbit (__x);
-#endif
-}
-
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-#if !__GNUC_PREREQ (4, 0)
- __extension__ union {
- long double __d;
- long __i[sizeof(long double)/sizeof(long)];
- } __u = { __d: __x };
- return __u.__i[sizeof(long double)/sizeof(long) - 1] < 0;
-#else
- return __builtin_signbitl (__x);
-#endif
-}
-#endif /* C99 */
-
-#endif /* __NO_MATH_INLINES */
diff --git a/sysdeps/alpha/fpu/cabsf.c b/sysdeps/alpha/fpu/cabsf.c
index ae336bc9e5..3297bdd4d6 100644
--- a/sysdeps/alpha/fpu/cabsf.c
+++ b/sysdeps/alpha/fpu/cabsf.c
@@ -1,5 +1,5 @@
/* Return the complex absolute value of float complex value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,4 +38,4 @@ __c2_cabsf (c2_cfloat_decl (z))
return __hypotf (c2_cfloat_real (z), c2_cfloat_imag (z));
}
-cfloat_versions (cabsf);
+cfloat_versions (cabs);
diff --git a/sysdeps/alpha/fpu/cargf.c b/sysdeps/alpha/fpu/cargf.c
index d798a5b56b..be303fcd54 100644
--- a/sysdeps/alpha/fpu/cargf.c
+++ b/sysdeps/alpha/fpu/cargf.c
@@ -1,5 +1,5 @@
/* Compute argument of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,4 +38,4 @@ __c2_cargf (c2_cfloat_decl (x))
return __atan2f (c2_cfloat_imag (x), c2_cfloat_real (x));
}
-cfloat_versions (cargf);
+cfloat_versions (carg);
diff --git a/sysdeps/alpha/fpu/cfloat-compat.h b/sysdeps/alpha/fpu/cfloat-compat.h
index e837df0998..6833447335 100644
--- a/sysdeps/alpha/fpu/cfloat-compat.h
+++ b/sysdeps/alpha/fpu/cfloat-compat.h
@@ -1,5 +1,5 @@
/* Compatibility macros for old and new Alpha complex float ABI.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -43,6 +43,7 @@ typedef union { double d; _Complex float cf; } c1_compat;
/* Get the proper symbol versions defined for each function. */
#include <shlib-compat.h>
+#include <libm-alias-float.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_3_4)
#define cfloat_versions_compat(func) \
@@ -52,7 +53,8 @@ typedef union { double d; _Complex float cf; } c1_compat;
#endif
#define cfloat_versions(func) \
- cfloat_versions_compat(func); \
- versioned_symbol (libm, __c2_##func, func, GLIBC_2_3_4); \
- extern typeof(__c2_##func) __##func attribute_hidden; \
- strong_alias (__c2_##func, __##func)
+ cfloat_versions_compat(func##f); \
+ versioned_symbol (libm, __c2_##func##f, func##f, GLIBC_2_3_4); \
+ extern typeof(__c2_##func##f) __##func##f attribute_hidden; \
+ strong_alias (__c2_##func##f, __##func##f); \
+ libm_alias_float_other (__##func, func)
diff --git a/sysdeps/alpha/fpu/cimagf.c b/sysdeps/alpha/fpu/cimagf.c
index 66174281b9..4851032802 100644
--- a/sysdeps/alpha/fpu/cimagf.c
+++ b/sysdeps/alpha/fpu/cimagf.c
@@ -1,5 +1,5 @@
/* Return imaginary part of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,4 +37,4 @@ __c2_cimagf (c2_cfloat_decl (z))
return c2_cfloat_imag (z);
}
-cfloat_versions (cimagf);
+cfloat_versions (cimag);
diff --git a/sysdeps/alpha/fpu/conjf.c b/sysdeps/alpha/fpu/conjf.c
index 0591487052..b6f5731315 100644
--- a/sysdeps/alpha/fpu/conjf.c
+++ b/sysdeps/alpha/fpu/conjf.c
@@ -1,5 +1,5 @@
/* Return complex conjugate of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,4 +39,4 @@ __c2_conjf (c2_cfloat_decl (z))
return c2_cfloat_return (r);
}
-cfloat_versions (conjf);
+cfloat_versions (conj);
diff --git a/sysdeps/alpha/fpu/crealf.c b/sysdeps/alpha/fpu/crealf.c
index 811e78f38a..3ea623418f 100644
--- a/sysdeps/alpha/fpu/crealf.c
+++ b/sysdeps/alpha/fpu/crealf.c
@@ -1,5 +1,5 @@
/* Return real part of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,4 +37,4 @@ __c2_crealf (c2_cfloat_decl (z))
return c2_cfloat_real (z);
}
-cfloat_versions (crealf);
+cfloat_versions (creal);
diff --git a/sysdeps/alpha/fpu/e_sqrt.c b/sysdeps/alpha/fpu/e_sqrt.c
index a03f105fc8..f57fc679d8 100644
--- a/sysdeps/alpha/fpu/e_sqrt.c
+++ b/sysdeps/alpha/fpu/e_sqrt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Contributed by David Mosberger (davidm@cs.arizona.edu).
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/fpu/fclrexcpt.c b/sysdeps/alpha/fpu/fclrexcpt.c
index 4903b046e1..943d829710 100644
--- a/sysdeps/alpha/fpu/fclrexcpt.c
+++ b/sysdeps/alpha/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997.
diff --git a/sysdeps/alpha/fpu/fedisblxcpt.c b/sysdeps/alpha/fpu/fedisblxcpt.c
index 14d8429073..3b8fe0b2e1 100644
--- a/sysdeps/alpha/fpu/fedisblxcpt.c
+++ b/sysdeps/alpha/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
diff --git a/sysdeps/alpha/fpu/feenablxcpt.c b/sysdeps/alpha/fpu/feenablxcpt.c
index df72c00cdb..65a0516fde 100644
--- a/sysdeps/alpha/fpu/feenablxcpt.c
+++ b/sysdeps/alpha/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
diff --git a/sysdeps/alpha/fpu/fegetenv.c b/sysdeps/alpha/fpu/fegetenv.c
index 70db2f9f37..df2e940585 100644
--- a/sysdeps/alpha/fpu/fegetenv.c
+++ b/sysdeps/alpha/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997
diff --git a/sysdeps/alpha/fpu/fegetexcept.c b/sysdeps/alpha/fpu/fegetexcept.c
index 71c3ba92c9..9eef8ec1a5 100644
--- a/sysdeps/alpha/fpu/fegetexcept.c
+++ b/sysdeps/alpha/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
diff --git a/sysdeps/alpha/fpu/fegetmode.c b/sysdeps/alpha/fpu/fegetmode.c
new file mode 100644
index 0000000000..7008154701
--- /dev/null
+++ b/sysdeps/alpha/fpu/fegetmode.c
@@ -0,0 +1,33 @@
+/* Store current floating-point control modes. Alpha version.
+ Copyright (C) 2016-2018 Free Software 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/fegetround.c b/sysdeps/alpha/fpu/fegetround.c
index 6a1d93dd52..8202a896ec 100644
--- a/sysdeps/alpha/fpu/fegetround.c
+++ b/sysdeps/alpha/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997
diff --git a/sysdeps/alpha/fpu/feholdexcpt.c b/sysdeps/alpha/fpu/feholdexcpt.c
index 019d30b5a2..5095d78045 100644
--- a/sysdeps/alpha/fpu/feholdexcpt.c
+++ b/sysdeps/alpha/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997
@@ -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/fenv_libc.h b/sysdeps/alpha/fpu/fenv_libc.h
index e9908cb7b9..68f3d70309 100644
--- a/sysdeps/alpha/fpu/fenv_libc.h
+++ b/sysdeps/alpha/fpu/fenv_libc.h
@@ -1,5 +1,5 @@
/* Internal libc stuff for floating point environment routines.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/fpu/fesetenv.c b/sysdeps/alpha/fpu/fesetenv.c
index 0a3aeb61ca..1494d504d3 100644
--- a/sysdeps/alpha/fpu/fesetenv.c
+++ b/sysdeps/alpha/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997
diff --git a/sysdeps/alpha/fpu/fesetexcept.c b/sysdeps/alpha/fpu/fesetexcept.c
new file mode 100644
index 0000000000..ee9c393557
--- /dev/null
+++ b/sysdeps/alpha/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. Alpha version.
+ Copyright (C) 2016-2018 Free Software 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..a892d33473
--- /dev/null
+++ b/sysdeps/alpha/fpu/fesetmode.c
@@ -0,0 +1,44 @@
+/* Install given floating-point control modes. Alpha version.
+ Copyright (C) 2016-2018 Free Software 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/fesetround.c b/sysdeps/alpha/fpu/fesetround.c
index fb6b8da16d..1da6459e3b 100644
--- a/sysdeps/alpha/fpu/fesetround.c
+++ b/sysdeps/alpha/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997
diff --git a/sysdeps/alpha/fpu/feupdateenv.c b/sysdeps/alpha/fpu/feupdateenv.c
index 89050f58f3..3f2e8f41a5 100644
--- a/sysdeps/alpha/fpu/feupdateenv.c
+++ b/sysdeps/alpha/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997.
diff --git a/sysdeps/alpha/fpu/fgetexcptflg.c b/sysdeps/alpha/fpu/fgetexcptflg.c
index 18a52ff6a5..d4e6844ffe 100644
--- a/sysdeps/alpha/fpu/fgetexcptflg.c
+++ b/sysdeps/alpha/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997.
diff --git a/sysdeps/alpha/fpu/fpu_control.h b/sysdeps/alpha/fpu/fpu_control.h
index 29f17b198c..3a16ba5a1c 100644
--- a/sysdeps/alpha/fpu/fpu_control.h
+++ b/sysdeps/alpha/fpu/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word bits. Alpha-mapped-to-Intel version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Olaf Flebbe.
diff --git a/sysdeps/alpha/fpu/fsetexcptflg.c b/sysdeps/alpha/fpu/fsetexcptflg.c
index 84041c5578..409d1f7aeb 100644
--- a/sysdeps/alpha/fpu/fsetexcptflg.c
+++ b/sysdeps/alpha/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997.
diff --git a/sysdeps/alpha/fpu/ftestexcept.c b/sysdeps/alpha/fpu/ftestexcept.c
index 958b216b5b..f2eb7ded9a 100644
--- a/sysdeps/alpha/fpu/ftestexcept.c
+++ b/sysdeps/alpha/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1997.
diff --git a/sysdeps/alpha/fpu/get-rounding-mode.h b/sysdeps/alpha/fpu/get-rounding-mode.h
index 9d891de19e..7cd7d55a04 100644
--- a/sysdeps/alpha/fpu/get-rounding-mode.h
+++ b/sysdeps/alpha/fpu/get-rounding-mode.h
@@ -1,5 +1,5 @@
/* Determine floating-point rounding mode within libc. Alpha version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/fpu/libm-test-ulps b/sysdeps/alpha/fpu/libm-test-ulps
index 6ec37f72ac..12a6127ddf 100644
--- a/sysdeps/alpha/fpu/libm-test-ulps
+++ b/sysdeps/alpha/fpu/libm-test-ulps
@@ -250,36 +250,36 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "cacos_downward":
double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "cacos_towardzero":
double: 5
@@ -298,17 +298,17 @@ ildouble: 3
ldouble: 3
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -330,12 +330,12 @@ ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-ildouble: 2
-ldouble: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
Function: Real part of "cacosh_towardzero":
double: 5
@@ -346,28 +346,28 @@ ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Real part of "cacosh_upward":
double: 4
float: 4
idouble: 4
ifloat: 4
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
Function: "carg":
float: 1
@@ -408,18 +408,18 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -428,8 +428,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "casin_towardzero":
double: 3
@@ -448,25 +448,25 @@ ildouble: 5
ldouble: 5
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -484,14 +484,14 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -512,23 +512,25 @@ ildouble: 3
ldouble: 3
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
ildouble: 3
ldouble: 3
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -543,9 +545,9 @@ ldouble: 1
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -559,25 +561,27 @@ ldouble: 3
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
Function: Real part of "catan_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catan_upward":
double: 3
@@ -596,7 +600,9 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -619,9 +625,9 @@ ldouble: 2
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -635,17 +641,19 @@ ldouble: 2
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
idouble: 4
-ifloat: 3
+ifloat: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "cbrt":
double: 3
@@ -903,9 +911,9 @@ ldouble: 2
Function: Real part of "clog10_downward":
double: 5
-float: 4
+float: 5
idouble: 5
-ifloat: 4
+ifloat: 5
ildouble: 3
ldouble: 3
@@ -1061,9 +1069,9 @@ ldouble: 3
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
ildouble: 4
ldouble: 4
@@ -1317,9 +1325,9 @@ ldouble: 3
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -1333,9 +1341,9 @@ ldouble: 4
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1357,9 +1365,9 @@ ldouble: 5
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 5
ldouble: 5
@@ -1373,9 +1381,9 @@ ldouble: 5
Function: Real part of "ctanh":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -1389,9 +1397,9 @@ ldouble: 3
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
idouble: 4
-ifloat: 1
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1569,15 +1577,21 @@ ldouble: 2
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "expm1":
double: 1
@@ -1677,9 +1691,9 @@ ldouble: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 4
ldouble: 4
@@ -1709,9 +1723,9 @@ ldouble: 4
Function: "j1_downward":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 4
ldouble: 4
@@ -1923,36 +1937,6 @@ ifloat: 1
ildouble: 2
ldouble: 2
-Function: "pow10":
-double: 2
-idouble: 2
-ildouble: 2
-ldouble: 2
-
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
Function: "pow_downward":
double: 1
float: 1
@@ -2173,9 +2157,9 @@ ldouble: 3
Function: "y0_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 4
ldouble: 4
@@ -2189,9 +2173,9 @@ ldouble: 3
Function: "y0_upward":
double: 3
-float: 4
+float: 5
idouble: 3
-ifloat: 4
+ifloat: 5
ildouble: 3
ldouble: 3
@@ -2229,17 +2213,17 @@ ldouble: 5
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 5
ldouble: 5
Function: "yn_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 5
ldouble: 5
@@ -2253,9 +2237,9 @@ ldouble: 5
Function: "yn_upward":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
ildouble: 5
ldouble: 5
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/math-barriers.h b/sysdeps/alpha/fpu/math-barriers.h
new file mode 100644
index 0000000000..27a64d789d
--- /dev/null
+++ b/sysdeps/alpha/fpu/math-barriers.h
@@ -0,0 +1,28 @@
+/* Control when floating-point expressions are evaluated. Alpha version.
+ Copyright (C) 2014-2018 Free Software 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 ALPHA_MATH_BARRIERS_H
+#define ALPHA_MATH_BARRIERS_H 1
+
+/* Generic code forces values to memory; we don't need to do that. */
+#define math_opt_barrier(x) \
+ ({ __typeof (x) __x = (x); __asm ("" : "+frm" (__x)); __x; })
+#define math_force_eval(x) \
+ ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "frm" (__x)); })
+
+#endif
diff --git a/sysdeps/alpha/fpu/math_private.h b/sysdeps/alpha/fpu/math_private.h
index 9e06e25dc6..c71447abf0 100644
--- a/sysdeps/alpha/fpu/math_private.h
+++ b/sysdeps/alpha/fpu/math_private.h
@@ -13,38 +13,6 @@
# define __isnanf __isnanf
#endif
-/* Generic code forces values to memory; we don't need to do that. */
-#define math_opt_barrier(x) \
- ({ __typeof (x) __x = (x); __asm ("" : "+frm" (__x)); __x; })
-#define math_force_eval(x) \
- ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "frm" (__x)); })
-
#include_next <math_private.h>
-#ifdef __alpha_fix__
-extern __always_inline double
-__ieee754_sqrt (double d)
-{
- double ret;
-# ifdef _IEEE_FP_INEXACT
- asm ("sqrtt/suid %1,%0" : "=f"(ret) : "f"(d));
-# else
- asm ("sqrtt/sud %1,%0" : "=f"(ret) : "f"(d));
-# endif
- return ret;
-}
-
-extern __always_inline float
-__ieee754_sqrtf (float d)
-{
- float ret;
-# ifdef _IEEE_FP_INEXACT
- asm ("sqrts/suid %1,%0" : "=f"(ret) : "f"(d));
-# else
- asm ("sqrts/sud %1,%0" : "=f"(ret) : "f"(d));
-# endif
- return ret;
-}
-#endif /* FIX */
-
#endif /* ALPHA_MATH_PRIVATE_H */
diff --git a/sysdeps/alpha/fpu/s_cacosf.c b/sysdeps/alpha/fpu/s_cacosf.c
index 25e21bb43f..91c4fb28fc 100644
--- a/sysdeps/alpha/fpu/s_cacosf.c
+++ b/sysdeps/alpha/fpu/s_cacosf.c
@@ -1,5 +1,5 @@
/* Return arc cosine of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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
@@ -47,4 +54,4 @@ __c2_cacosf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (cacosf);
+cfloat_versions (cacos);
diff --git a/sysdeps/alpha/fpu/s_cacoshf.c b/sysdeps/alpha/fpu/s_cacoshf.c
index 43b6542ce6..a66ab27a2e 100644
--- a/sysdeps/alpha/fpu/s_cacoshf.c
+++ b/sysdeps/alpha/fpu/s_cacoshf.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole cosine of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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
@@ -47,4 +53,4 @@ __c2_cacoshf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (cacoshf);
+cfloat_versions (cacosh);
diff --git a/sysdeps/alpha/fpu/s_casinf.c b/sysdeps/alpha/fpu/s_casinf.c
index f85f524c48..1ce6a68ba3 100644
--- a/sysdeps/alpha/fpu/s_casinf.c
+++ b/sysdeps/alpha/fpu/s_casinf.c
@@ -1,5 +1,5 @@
/* Return arc sine of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_casinf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (casinf);
+cfloat_versions (casin);
diff --git a/sysdeps/alpha/fpu/s_casinhf.c b/sysdeps/alpha/fpu/s_casinhf.c
index 720294ea00..02cafe649b 100644
--- a/sysdeps/alpha/fpu/s_casinhf.c
+++ b/sysdeps/alpha/fpu/s_casinhf.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole sine of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_casinhf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (casinhf);
+cfloat_versions (casinh);
diff --git a/sysdeps/alpha/fpu/s_catanf.c b/sysdeps/alpha/fpu/s_catanf.c
index 76c1718dff..2ed7e941d5 100644
--- a/sysdeps/alpha/fpu/s_catanf.c
+++ b/sysdeps/alpha/fpu/s_catanf.c
@@ -1,5 +1,5 @@
/* Return arc tangent of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_catanf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (catanf);
+cfloat_versions (catan);
diff --git a/sysdeps/alpha/fpu/s_catanhf.c b/sysdeps/alpha/fpu/s_catanhf.c
index 18148ddafb..da783d2454 100644
--- a/sysdeps/alpha/fpu/s_catanhf.c
+++ b/sysdeps/alpha/fpu/s_catanhf.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole tangent of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_catanhf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (catanhf);
+cfloat_versions (catanh);
diff --git a/sysdeps/alpha/fpu/s_ccosf.c b/sysdeps/alpha/fpu/s_ccosf.c
index 886be62edf..2ec5aaaef7 100644
--- a/sysdeps/alpha/fpu/s_ccosf.c
+++ b/sysdeps/alpha/fpu/s_ccosf.c
@@ -1,5 +1,5 @@
/* Return cosine of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_ccosf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (ccosf);
+cfloat_versions (ccos);
diff --git a/sysdeps/alpha/fpu/s_ccoshf.c b/sysdeps/alpha/fpu/s_ccoshf.c
index 16f49de6d4..5259949a4d 100644
--- a/sysdeps/alpha/fpu/s_ccoshf.c
+++ b/sysdeps/alpha/fpu/s_ccoshf.c
@@ -1,5 +1,5 @@
/* Return hyperbole cosine of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_ccoshf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (ccoshf);
+cfloat_versions (ccosh);
diff --git a/sysdeps/alpha/fpu/s_ceil.c b/sysdeps/alpha/fpu/s_ceil.c
deleted file mode 100644
index c1ff864d4b..0000000000
--- a/sysdeps/alpha/fpu/s_ceil.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <math_ldbl_opt.h>
-
-/* Use the -inf rounding mode conversion instructions to implement
- ceil, via something akin to -floor(-x). This is much faster than
- playing with the fpcr to achieve +inf rounding mode. */
-
-double
-__ceil (double x)
-{
- if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
- {
- double tmp1, new_x;
-
- new_x = -x;
- __asm (
-#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
-#else
- "cvttq/svm %2,%1\n\t"
-#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1)
- : "f"(new_x));
-
- /* Fix up the negation we did above, as well as handling -0 properly. */
- x = copysign(new_x, x);
- }
- return x;
-}
-
-weak_alias (__ceil, ceil)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__ceil, __ceill)
-weak_alias (__ceil, ceill)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0);
-#endif
diff --git a/sysdeps/alpha/fpu/s_ceilf.c b/sysdeps/alpha/fpu/s_ceilf.c
deleted file mode 100644
index 7e63a6fe94..0000000000
--- a/sysdeps/alpha/fpu/s_ceilf.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-
-/* Use the -inf rounding mode conversion instructions to implement
- ceil, via something akin to -floor(-x). This is much faster than
- playing with the fpcr to achieve +inf rounding mode. */
-
-float
-__ceilf (float x)
-{
- if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
- {
- /* Note that Alpha S_Floating is stored in registers in a
- restricted T_Floating format, so we don't even need to
- convert back to S_Floating in the end. The initial
- conversion to T_Floating is needed to handle denormals. */
-
- float tmp1, tmp2, new_x;
-
- new_x = -x;
- __asm ("cvtst/s %3,%2\n\t"
-#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
-#else
- "cvttq/svm %2,%1\n\t"
-#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
- : "f"(new_x));
-
- /* Fix up the negation we did above, as well as handling -0 properly. */
- x = copysignf(new_x, x);
- }
- return x;
-}
-
-weak_alias (__ceilf, ceilf)
diff --git a/sysdeps/alpha/fpu/s_cexpf.c b/sysdeps/alpha/fpu/s_cexpf.c
index 2ae519c687..dcf9ad1c79 100644
--- a/sysdeps/alpha/fpu/s_cexpf.c
+++ b/sysdeps/alpha/fpu/s_cexpf.c
@@ -1,5 +1,5 @@
/* Return exponent of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_cexpf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (cexpf);
+cfloat_versions (cexp);
diff --git a/sysdeps/alpha/fpu/s_clog10f.c b/sysdeps/alpha/fpu/s_clog10f.c
index 1ab0730e0e..9906107b73 100644
--- a/sysdeps/alpha/fpu/s_clog10f.c
+++ b/sysdeps/alpha/fpu/s_clog10f.c
@@ -1,5 +1,5 @@
/* Return base 10 logarithm of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,17 +21,22 @@
#include <complex.h>
#include <math.h>
+#include <libm-alias-float.h>
#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))
@@ -58,3 +63,4 @@ compat_symbol (libm, __c1_clog10f_2, __clog10f, GLIBC_2_1);
versioned_symbol (libm, __c2_clog10f, clog10f, GLIBC_2_3_4);
extern typeof(__c2_clog10f) __clog10f attribute_hidden;
strong_alias (__c2_clog10f, __clog10f)
+libm_alias_float_other (__c2_clog10, clog10)
diff --git a/sysdeps/alpha/fpu/s_clogf.c b/sysdeps/alpha/fpu/s_clogf.c
index 185948f650..4afb73c822 100644
--- a/sysdeps/alpha/fpu/s_clogf.c
+++ b/sysdeps/alpha/fpu/s_clogf.c
@@ -1,5 +1,5 @@
/* Return natural logarithm of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_clogf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (clogf);
+cfloat_versions (clog);
diff --git a/sysdeps/alpha/fpu/s_copysign.c b/sysdeps/alpha/fpu/s_copysign.c
index 1b5a6e8ae2..493615a896 100644
--- a/sysdeps/alpha/fpu/s_copysign.c
+++ b/sysdeps/alpha/fpu/s_copysign.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
double
__copysign (double x, double y)
@@ -25,15 +26,7 @@ __copysign (double x, double y)
return __builtin_copysign (x, y);
}
-weak_alias (__copysign, copysign)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__copysign, __copysignl)
-weak_alias (__copysign, copysignl)
-#endif
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+libm_alias_double (__copysign, copysign)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
#endif
diff --git a/sysdeps/alpha/fpu/s_copysignf.c b/sysdeps/alpha/fpu/s_copysignf.c
index 5b2e8cb554..b92b6d4d77 100644
--- a/sysdeps/alpha/fpu/s_copysignf.c
+++ b/sysdeps/alpha/fpu/s_copysignf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-float.h>
float
__copysignf (float x, float y)
@@ -24,4 +25,4 @@ __copysignf (float x, float y)
return __builtin_copysignf (x, y);
}
-weak_alias (__copysignf, copysignf)
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/alpha/fpu/s_cpowf.c b/sysdeps/alpha/fpu/s_cpowf.c
index 686c3971f9..72f5586840 100644
--- a/sysdeps/alpha/fpu/s_cpowf.c
+++ b/sysdeps/alpha/fpu/s_cpowf.c
@@ -1,5 +1,5 @@
/* Return power of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_cpowf (c2_cfloat_decl (x), c2_cfloat_decl (c))
return c2_cfloat_return (r);
}
-cfloat_versions (cpowf);
+cfloat_versions (cpow);
diff --git a/sysdeps/alpha/fpu/s_cprojf.c b/sysdeps/alpha/fpu/s_cprojf.c
index 30a24a8910..7557f25f1a 100644
--- a/sysdeps/alpha/fpu/s_cprojf.c
+++ b/sysdeps/alpha/fpu/s_cprojf.c
@@ -1,5 +1,5 @@
/* Return projection of complex float value to Riemann sphere.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_cprojf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (cprojf);
+cfloat_versions (cproj);
diff --git a/sysdeps/alpha/fpu/s_csinf.c b/sysdeps/alpha/fpu/s_csinf.c
index abe2d3ab45..3c2d38a026 100644
--- a/sysdeps/alpha/fpu/s_csinf.c
+++ b/sysdeps/alpha/fpu/s_csinf.c
@@ -1,5 +1,5 @@
/* Return sine of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_csinf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (csinf);
+cfloat_versions (csin);
diff --git a/sysdeps/alpha/fpu/s_csinhf.c b/sysdeps/alpha/fpu/s_csinhf.c
index a6d470a438..9d4e8cb537 100644
--- a/sysdeps/alpha/fpu/s_csinhf.c
+++ b/sysdeps/alpha/fpu/s_csinhf.c
@@ -1,5 +1,5 @@
/* Return hyperbole sine of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_csinhf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (csinhf);
+cfloat_versions (csinh);
diff --git a/sysdeps/alpha/fpu/s_csqrtf.c b/sysdeps/alpha/fpu/s_csqrtf.c
index c7a18d75d7..dc6057fbda 100644
--- a/sysdeps/alpha/fpu/s_csqrtf.c
+++ b/sysdeps/alpha/fpu/s_csqrtf.c
@@ -1,5 +1,5 @@
/* Return square root of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_csqrtf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (csqrtf);
+cfloat_versions (csqrt);
diff --git a/sysdeps/alpha/fpu/s_ctanf.c b/sysdeps/alpha/fpu/s_ctanf.c
index ee02f31c28..a00f0bfb57 100644
--- a/sysdeps/alpha/fpu/s_ctanf.c
+++ b/sysdeps/alpha/fpu/s_ctanf.c
@@ -1,5 +1,5 @@
/* Return tangent of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_ctanf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (ctanf);
+cfloat_versions (ctan);
diff --git a/sysdeps/alpha/fpu/s_ctanhf.c b/sysdeps/alpha/fpu/s_ctanhf.c
index cb99279de6..34f30d65ff 100644
--- a/sysdeps/alpha/fpu/s_ctanhf.c
+++ b/sysdeps/alpha/fpu/s_ctanhf.c
@@ -1,5 +1,5 @@
/* Return hyperbole tangent of complex float value.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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))
@@ -47,4 +51,4 @@ __c2_ctanhf (c2_cfloat_decl (x))
return c2_cfloat_return (r);
}
-cfloat_versions (ctanhf);
+cfloat_versions (ctanh);
diff --git a/sysdeps/alpha/fpu/s_fabs.c b/sysdeps/alpha/fpu/s_fabs.c
index 97ea250ab3..08b3134c91 100644
--- a/sysdeps/alpha/fpu/s_fabs.c
+++ b/sysdeps/alpha/fpu/s_fabs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
double
__fabs (double x)
@@ -25,11 +26,4 @@ __fabs (double x)
return __builtin_fabs (x);
}
-weak_alias (__fabs, fabs)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fabs, __fabsl)
-weak_alias (__fabs, fabsl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fabs, fabsl, GLIBC_2_0);
-#endif
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/alpha/fpu/s_fabsf.c b/sysdeps/alpha/fpu/s_fabsf.c
index e13e3650bf..5d90e0d661 100644
--- a/sysdeps/alpha/fpu/s_fabsf.c
+++ b/sysdeps/alpha/fpu/s_fabsf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-float.h>
float
__fabsf (float x)
@@ -24,4 +25,4 @@ __fabsf (float x)
return __builtin_fabsf (x);
}
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/alpha/fpu/s_floor.c b/sysdeps/alpha/fpu/s_floor.c
deleted file mode 100644
index 1a6f8c4617..0000000000
--- a/sysdeps/alpha/fpu/s_floor.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <math_ldbl_opt.h>
-
-
-/* Use the -inf rounding mode conversion instructions to implement
- floor. We note when the exponent is large enough that the value
- must be integral, as this avoids unpleasant integer overflows. */
-
-double
-__floor (double x)
-{
- if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
- {
- double tmp1, new_x;
-
- __asm (
-#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
-#else
- "cvttq/svm %2,%1\n\t"
-#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1)
- : "f"(x));
-
- /* floor(-0) == -0, and in general we'll always have the same
- sign as our input. */
- x = copysign(new_x, x);
- }
- return x;
-}
-
-weak_alias (__floor, floor)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__floor, __floorl)
-weak_alias (__floor, floorl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/alpha/fpu/s_floorf.c b/sysdeps/alpha/fpu/s_floorf.c
deleted file mode 100644
index 8cd80e2b42..0000000000
--- a/sysdeps/alpha/fpu/s_floorf.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-
-
-/* Use the -inf rounding mode conversion instructions to implement
- floor. We note when the exponent is large enough that the value
- must be integral, as this avoids unpleasant integer overflows. */
-
-float
-__floorf (float x)
-{
- if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
- {
- /* Note that Alpha S_Floating is stored in registers in a
- restricted T_Floating format, so we don't even need to
- convert back to S_Floating in the end. The initial
- conversion to T_Floating is needed to handle denormals. */
-
- float tmp1, tmp2, new_x;
-
- __asm ("cvtst/s %3,%2\n\t"
-#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
-#else
- "cvttq/svm %2,%1\n\t"
-#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
- : "f"(x));
-
- /* floor(-0) == -0, and in general we'll always have the same
- sign as our input. */
- x = copysignf(new_x, x);
- }
- return x;
-}
-
-weak_alias (__floorf, floorf)
diff --git a/sysdeps/alpha/fpu/s_fma.c b/sysdeps/alpha/fpu/s_fma.c
new file mode 100644
index 0000000000..8f62605870
--- /dev/null
+++ b/sysdeps/alpha/fpu/s_fma.c
@@ -0,0 +1,2 @@
+/* Always use dbl-64 version because long double is emulated in software. */
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/sysdeps/alpha/fpu/s_fmax.S b/sysdeps/alpha/fpu/s_fmax.S
deleted file mode 100644
index dbe979e37c..0000000000
--- a/sysdeps/alpha/fpu/s_fmax.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
- .set noat
- .set noreorder
-
- .text
-ENTRY (__fmax)
- .prologue 0
-
- cmptun/su $f16, $f16, $f10
- cmptun/su $f17, $f17, $f11
- fmov $f17, $f0
- unop
-
- trapb
- fbne $f10, $ret
- fmov $f16, $f0
- fbne $f11, $ret
-
- cmptlt/su $f16, $f17, $f11
- trapb
- fcmovne $f11, $f17, $f0
-$ret: ret
-
-END (__fmax)
-
-/* Given the in-register format of single-precision, this works there too. */
-strong_alias (__fmax, __fmaxf)
-weak_alias (__fmaxf, fmaxf)
-
-weak_alias (__fmax, fmax)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fmax, __fmaxl)
-weak_alias (__fmaxl, fmaxl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/alpha/fpu/s_fmaxf.S b/sysdeps/alpha/fpu/s_fmaxf.S
deleted file mode 100644
index 3c2d62bb81..0000000000
--- a/sysdeps/alpha/fpu/s_fmaxf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* __fmaxf is in s_fmax.c */
diff --git a/sysdeps/alpha/fpu/s_fmin.S b/sysdeps/alpha/fpu/s_fmin.S
deleted file mode 100644
index f43228387a..0000000000
--- a/sysdeps/alpha/fpu/s_fmin.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
- .set noat
- .set noreorder
-
- .text
-ENTRY (__fmin)
- .prologue 0
-
- cmptun/su $f16, $f16, $f10
- cmptun/su $f17, $f17, $f11
- fmov $f17, $f0
- unop
-
- trapb
- fbne $f10, $ret
- fmov $f16, $f0
- fbne $f11, $ret
-
- cmptlt/su $f17, $f16, $f11
- trapb
- fcmovne $f11, $f17, $f0
-$ret: ret
-
-END (__fmin)
-
-/* Given the in-register format of single-precision, this works there too. */
-strong_alias (__fmin, __fminf)
-weak_alias (__fminf, fminf)
-
-weak_alias (__fmin, fmin)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fmin, __fminl)
-weak_alias (__fminl, fminl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/alpha/fpu/s_fminf.S b/sysdeps/alpha/fpu/s_fminf.S
deleted file mode 100644
index 10ab7fe53c..0000000000
--- a/sysdeps/alpha/fpu/s_fminf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* __fminf is in s_fmin.c */
diff --git a/sysdeps/alpha/fpu/s_isnan.c b/sysdeps/alpha/fpu/s_isnan.c
index e048a8fa1e..a8b20db204 100644
--- a/sysdeps/alpha/fpu/s_isnan.c
+++ b/sysdeps/alpha/fpu/s_isnan.c
@@ -1,5 +1,5 @@
/* Return 1 if argument is a NaN, else 0.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,7 @@
#define __GI___isnanf not__GI___isnanf
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#undef __isnanf
diff --git a/sysdeps/alpha/fpu/s_lrint.c b/sysdeps/alpha/fpu/s_lrint.c
index daa2363fe9..02470eeda7 100644
--- a/sysdeps/alpha/fpu/s_lrint.c
+++ b/sysdeps/alpha/fpu/s_lrint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#define llrint not_llrint
#include <math.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
#undef __llrint
#undef llrint
@@ -33,15 +34,5 @@ __lrint (double x)
}
strong_alias (__lrint, __llrint)
-weak_alias (__lrint, lrint)
-weak_alias (__llrint, llrint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-strong_alias (__lrint, __llrintl)
-weak_alias (__lrintl, lrintl)
-weak_alias (__llrintl, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
-#endif
+libm_alias_double (__lrint, lrint)
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/alpha/fpu/s_lrintf.c b/sysdeps/alpha/fpu/s_lrintf.c
index f866325c19..125c0b1cf0 100644
--- a/sysdeps/alpha/fpu/s_lrintf.c
+++ b/sysdeps/alpha/fpu/s_lrintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#define __llrintf not___llrintf
#define llrintf not_llrintf
#include <math.h>
+#include <libm-alias-float.h>
#undef __llrintf
#undef llrintf
@@ -34,5 +35,5 @@ __lrintf (float x)
}
strong_alias (__lrintf, __llrintf)
-weak_alias (__lrintf, lrintf)
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__lrint, lrint)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/alpha/fpu/s_lround.c b/sysdeps/alpha/fpu/s_lround.c
index 8a1b68c3fe..e2aeb707af 100644
--- a/sysdeps/alpha/fpu/s_lround.c
+++ b/sysdeps/alpha/fpu/s_lround.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#define llround not_llround
#include <math.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
#undef __llround
#undef llround
@@ -33,15 +34,5 @@ __lround (double x)
}
strong_alias (__lround, __llround)
-weak_alias (__lround, lround)
-weak_alias (__llround, llround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lround, __lroundl)
-strong_alias (__lround, __llroundl)
-weak_alias (__lroundl, lroundl)
-weak_alias (__llroundl, llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
-#endif
+libm_alias_double (__lround, lround)
+libm_alias_double (__llround, llround)
diff --git a/sysdeps/alpha/fpu/s_lroundf.c b/sysdeps/alpha/fpu/s_lroundf.c
index c9da0d3728..34f56e4700 100644
--- a/sysdeps/alpha/fpu/s_lroundf.c
+++ b/sysdeps/alpha/fpu/s_lroundf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#define __llroundf not___llroundf
#define llroundf not_llroundf
#include <math.h>
+#include <libm-alias-float.h>
#undef __llroundf
#undef llroundf
@@ -33,5 +34,5 @@ __lroundf (float x)
}
strong_alias (__lroundf, __llroundf)
-weak_alias (__lroundf, lroundf)
-weak_alias (__llroundf, llroundf)
+libm_alias_float (__lround, lround)
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/alpha/fpu/s_nearbyint.c b/sysdeps/alpha/fpu/s_nearbyint.c
deleted file mode 100644
index 899e14341f..0000000000
--- a/sysdeps/alpha/fpu/s_nearbyint.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math_ldbl_opt.h>
-
-#include <sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c>
-
-#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_rint.c
index f33fe72c11..d3bcf1829a 100644
--- a/sysdeps/alpha/fpu/s_rint.c
+++ b/sysdeps/alpha/fpu/s_rint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
@@ -18,11 +18,15 @@
#include <math.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
double
__rint (double x)
{
+ if (isnan (x))
+ return x + x;
+
if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
{
double tmp1, new_x;
@@ -38,11 +42,4 @@ __rint (double x)
return x;
}
-weak_alias (__rint, rint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
-#endif
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/alpha/fpu/s_rintf.c b/sysdeps/alpha/fpu/s_rintf.c
index 1400dfe8d7..0cc912d843 100644
--- a/sysdeps/alpha/fpu/s_rintf.c
+++ b/sysdeps/alpha/fpu/s_rintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
@@ -17,11 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-float.h>
float
__rintf (float x)
{
+ if (isnanf (x))
+ return x + x;
+
if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
{
/* Note that Alpha S_Floating is stored in registers in a
@@ -44,4 +48,4 @@ __rintf (float x)
return x;
}
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/alpha/fpu/s_trunc.c b/sysdeps/alpha/fpu/s_trunc.c
deleted file mode 100644
index 16cb114a72..0000000000
--- a/sysdeps/alpha/fpu/s_trunc.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <math_ldbl_opt.h>
-
-
-/* Use the chopped rounding mode conversion instructions to implement trunc. */
-
-double
-__trunc (double x)
-{
- double two52 = copysign (0x1.0p52, x);
- double r, tmp;
-
- __asm (
-#ifdef _IEEE_FP_INEXACT
- "addt/suic %2, %3, %1\n\tsubt/suic %1, %3, %0"
-#else
- "addt/suc %2, %3, %1\n\tsubt/suc %1, %3, %0"
-#endif
- : "=&f"(r), "=&f"(tmp)
- : "f"(x), "f"(two52));
-
- /* trunc(-0) == -0, and in general we'll always have the same
- sign as our input. */
- return copysign (r, x);
-}
-
-weak_alias (__trunc, trunc)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__trunc, __truncl)
-weak_alias (__trunc, truncl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/alpha/fpu/s_truncf.c b/sysdeps/alpha/fpu/s_truncf.c
deleted file mode 100644
index 2290f28295..0000000000
--- a/sysdeps/alpha/fpu/s_truncf.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-
-
-/* Use the chopped rounding mode conversion instructions to implement trunc. */
-
-float
-__truncf (float x)
-{
- float two23 = copysignf (0x1.0p23, x);
- float r, tmp;
-
- __asm (
-#ifdef _IEEE_FP_INEXACT
- "adds/suic %2, %3, %1\n\tsubs/suic %1, %3, %0"
-#else
- "adds/suc %2, %3, %1\n\tsubs/suc %1, %3, %0"
-#endif
- : "=&f"(r), "=&f"(tmp)
- : "f"(x), "f"(two23));
-
- /* trunc(-0) == -0, and in general we'll always have the same
- sign as our input. */
- return copysignf (r, x);
-}
-
-weak_alias (__truncf, truncf)
diff --git a/sysdeps/alpha/gccframe.h b/sysdeps/alpha/gccframe.h
index f76bbe7006..bb24310b72 100644
--- a/sysdeps/alpha/gccframe.h
+++ b/sysdeps/alpha/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. alpha version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/hp-timing.h b/sysdeps/alpha/hp-timing.h
index 6d1e9fd9b3..62284e003a 100644
--- a/sysdeps/alpha/hp-timing.h
+++ b/sysdeps/alpha/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. Alpha version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@redhat.com>, 2001.
diff --git a/sysdeps/alpha/htonl.S b/sysdeps/alpha/htonl.S
index d790325cf5..5344c33405 100644
--- a/sysdeps/alpha/htonl.S
+++ b/sysdeps/alpha/htonl.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/htons.S b/sysdeps/alpha/htons.S
index 8c9470c5c5..6d082b9ba7 100644
--- a/sysdeps/alpha/htons.S
+++ b/sysdeps/alpha/htons.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/jmpbuf-offsets.h b/sysdeps/alpha/jmpbuf-offsets.h
index 86e8da2a17..83a5d59c12 100644
--- a/sysdeps/alpha/jmpbuf-offsets.h
+++ b/sysdeps/alpha/jmpbuf-offsets.h
@@ -1,5 +1,5 @@
/* Private macros for accessing __jmp_buf contents. Alpha version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/jmpbuf-unwind.h b/sysdeps/alpha/jmpbuf-unwind.h
index 37d679d1b5..431ad47bb8 100644
--- a/sysdeps/alpha/jmpbuf-unwind.h
+++ b/sysdeps/alpha/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/alpha/ldiv.S b/sysdeps/alpha/ldiv.S
index c90873c1d5..1ed25fa96e 100644
--- a/sysdeps/alpha/ldiv.S
+++ b/sysdeps/alpha/ldiv.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>.
diff --git a/sysdeps/alpha/ldsodefs.h b/sysdeps/alpha/ldsodefs.h
index 0ca6530946..2d41649b26 100644
--- a/sysdeps/alpha/ldsodefs.h
+++ b/sysdeps/alpha/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/libc-tls.c b/sysdeps/alpha/libc-tls.c
index f244e456cf..8d384d3e9e 100644
--- a/sysdeps/alpha/libc-tls.c
+++ b/sysdeps/alpha/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. Alpha version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/soft-fp/local-soft-fp.h b/sysdeps/alpha/local-soft-fp.h
index d562e0829e..d562e0829e 100644
--- a/sysdeps/alpha/soft-fp/local-soft-fp.h
+++ b/sysdeps/alpha/local-soft-fp.h
diff --git a/sysdeps/alpha/lshift.S b/sysdeps/alpha/lshift.S
index 91bd3405d3..adbe0b8fa6 100644
--- a/sysdeps/alpha/lshift.S
+++ b/sysdeps/alpha/lshift.S
@@ -1,6 +1,6 @@
# Alpha 21064 __mpn_lshift --
- # Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/machine-gmon.h b/sysdeps/alpha/machine-gmon.h
index 99e9dd8f42..5f537530f6 100644
--- a/sysdeps/alpha/machine-gmon.h
+++ b/sysdeps/alpha/machine-gmon.h
@@ -1,5 +1,5 @@
/* Machine-specific calling sequence for `mcount' profiling function. alpha
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/memchr.c b/sysdeps/alpha/memchr.c
index cfa036c62b..11b0c736ca 100644
--- a/sysdeps/alpha/memchr.c
+++ b/sysdeps/alpha/memchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,7 +53,10 @@ __memchr (const void *s, int xc, size_t n)
/* Align the source, and decrement the count by the number
of bytes searched in the first word. */
s_align = (const word *)((word)s & -8);
- n += ((word)s & 7);
+ {
+ size_t inc = n + ((word)s & 7);
+ n = inc | -(inc < n);
+ }
/* Deal with misalignment in the first word for the comparison. */
mask = (1ul << ((word)s & 7)) - 1;
diff --git a/sysdeps/alpha/memset.S b/sysdeps/alpha/memset.S
index 447044a252..9bf5283981 100644
--- a/sysdeps/alpha/memset.S
+++ b/sysdeps/alpha/memset.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/memusage.h b/sysdeps/alpha/memusage.h
index 4b3bb0cb5b..858826cca9 100644
--- a/sysdeps/alpha/memusage.h
+++ b/sysdeps/alpha/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/mul_1.S b/sysdeps/alpha/mul_1.S
index fd06303235..a547b94e1f 100644
--- a/sysdeps/alpha/mul_1.S
+++ b/sysdeps/alpha/mul_1.S
@@ -1,7 +1,7 @@
# Alpha 21064 __mpn_mul_1 -- Multiply a limb vector with a limb and store
# the result in a second limb vector.
- # Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1992-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/nptl/Makefile b/sysdeps/alpha/nptl/Makefile
index 137b2e565e..8e63e8ad55 100644
--- a/sysdeps/alpha/nptl/Makefile
+++ b/sysdeps/alpha/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
# The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/nptl/bits/pthreadtypes-arch.h b/sysdeps/alpha/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..1ea7f4e4cf
--- /dev/null
+++ b/sysdeps/alpha/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,61 @@
+/* Machine-specific pthread type layouts. Alpha version.
+ Copyright (C) 2003-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#define __SIZEOF_PTHREAD_ATTR_T 56
+#define __SIZEOF_PTHREAD_MUTEX_T 40
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCK_T 56
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIER_T 32
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Definitions for internal mutex struct. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
+#define __PTHREAD_MUTEX_USE_UNION 0
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+ int __cur_writer;
+ int __shared;
+ unsigned long int __pad1;
+ unsigned long int __pad2;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned int __flags;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/alpha/nptl/pthread-offsets.h b/sysdeps/alpha/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..16c6b0d9fd
--- /dev/null
+++ b/sysdeps/alpha/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 12
+#define __PTHREAD_MUTEX_KIND_OFFSET 16
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 24
diff --git a/sysdeps/alpha/nptl/pthread_spin_lock.S b/sysdeps/alpha/nptl/pthread_spin_lock.S
index 6d132777a3..3ca52184d1 100644
--- a/sysdeps/alpha/nptl/pthread_spin_lock.S
+++ b/sysdeps/alpha/nptl/pthread_spin_lock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@twiddle.net>, 2003.
diff --git a/sysdeps/alpha/nptl/pthread_spin_trylock.S b/sysdeps/alpha/nptl/pthread_spin_trylock.S
index 55d179c506..bac54339a2 100644
--- a/sysdeps/alpha/nptl/pthread_spin_trylock.S
+++ b/sysdeps/alpha/nptl/pthread_spin_trylock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@twiddle.net>, 2003.
diff --git a/sysdeps/alpha/nptl/pthreaddef.h b/sysdeps/alpha/nptl/pthreaddef.h
index c3d760ba1e..f505583600 100644
--- a/sysdeps/alpha/nptl/pthreaddef.h
+++ b/sysdeps/alpha/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/nptl/tcb-offsets.sym b/sysdeps/alpha/nptl/tcb-offsets.sym
index c21a791040..1005621b37 100644
--- a/sysdeps/alpha/nptl/tcb-offsets.sym
+++ b/sysdeps/alpha/nptl/tcb-offsets.sym
@@ -10,5 +10,4 @@
#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - sizeof(struct pthread))
MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
-PID_OFFSET thread_offsetof (pid)
TID_OFFSET thread_offsetof (tid)
diff --git a/sysdeps/alpha/nptl/tls.h b/sysdeps/alpha/nptl/tls.h
index 90d98e124d..482c8f855c 100644
--- a/sysdeps/alpha/nptl/tls.h
+++ b/sysdeps/alpha/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/Alpha version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,17 +25,7 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
/* Get system call information. */
# include <sysdep.h>
@@ -113,6 +103,7 @@ typedef struct
descr->member[idx] = (value)
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/alpha/nscd-types.h b/sysdeps/alpha/nscd-types.h
index 36c35c634e..1caa10bc3c 100644
--- a/sysdeps/alpha/nscd-types.h
+++ b/sysdeps/alpha/nscd-types.h
@@ -1,5 +1,5 @@
/* Types for the NSCD implementation. Alpha version.
- Copyright (c) 2000-2016 Free Software Foundation, Inc.
+ Copyright (c) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/soft-fp/ots_add.c b/sysdeps/alpha/ots_add.c
index a855d7087e..5c6fd68204 100644
--- a/sysdeps/alpha/soft-fp/ots_add.c
+++ b/sysdeps/alpha/ots_add.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: addition.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_cmp.c b/sysdeps/alpha/ots_cmp.c
index 4626cdc032..77e8161385 100644
--- a/sysdeps/alpha/soft-fp/ots_cmp.c
+++ b/sysdeps/alpha/ots_cmp.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: comparison.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_cmpe.c b/sysdeps/alpha/ots_cmpe.c
index 69c8f32d8f..a1ddcc32b1 100644
--- a/sysdeps/alpha/soft-fp/ots_cmpe.c
+++ b/sysdeps/alpha/ots_cmpe.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: comparison.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_cvtqux.c b/sysdeps/alpha/ots_cvtqux.c
index 5771dcc166..d723c46512 100644
--- a/sysdeps/alpha/soft-fp/ots_cvtqux.c
+++ b/sysdeps/alpha/ots_cvtqux.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: unsigned integer to float conversion.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_cvtqx.c b/sysdeps/alpha/ots_cvtqx.c
index a177ca55aa..84151775a1 100644
--- a/sysdeps/alpha/soft-fp/ots_cvtqx.c
+++ b/sysdeps/alpha/ots_cvtqx.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: signed integer to float conversion.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_cvttx.c b/sysdeps/alpha/ots_cvttx.c
index 1038ec0fae..582e22e79e 100644
--- a/sysdeps/alpha/soft-fp/ots_cvttx.c
+++ b/sysdeps/alpha/ots_cvttx.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: floating point extension.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_cvtxq.c b/sysdeps/alpha/ots_cvtxq.c
index bbf7d1e543..567008cbeb 100644
--- a/sysdeps/alpha/soft-fp/ots_cvtxq.c
+++ b/sysdeps/alpha/ots_cvtxq.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: float to integer conversion.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_cvtxt.c b/sysdeps/alpha/ots_cvtxt.c
index 2e7ca5e057..c70cb4b51c 100644
--- a/sysdeps/alpha/soft-fp/ots_cvtxt.c
+++ b/sysdeps/alpha/ots_cvtxt.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: floating point truncation.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_div.c b/sysdeps/alpha/ots_div.c
index b3d5ccf6de..345ae3a73a 100644
--- a/sysdeps/alpha/soft-fp/ots_div.c
+++ b/sysdeps/alpha/ots_div.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: division.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_mul.c b/sysdeps/alpha/ots_mul.c
index df4503ba08..f88764d325 100644
--- a/sysdeps/alpha/soft-fp/ots_mul.c
+++ b/sysdeps/alpha/ots_mul.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: multiplication.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_nintxq.c b/sysdeps/alpha/ots_nintxq.c
index 0491ddf04c..0e206dda61 100644
--- a/sysdeps/alpha/soft-fp/ots_nintxq.c
+++ b/sysdeps/alpha/ots_nintxq.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: convert to fortran nearest.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/soft-fp/ots_sub.c b/sysdeps/alpha/ots_sub.c
index 442442e4a2..526626872b 100644
--- a/sysdeps/alpha/soft-fp/ots_sub.c
+++ b/sysdeps/alpha/ots_sub.c
@@ -1,5 +1,5 @@
/* Software floating-point emulation: subtraction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/alpha/rawmemchr.S b/sysdeps/alpha/rawmemchr.S
index 498efde5bd..0f94ce7e8a 100644
--- a/sysdeps/alpha/rawmemchr.S
+++ b/sysdeps/alpha/rawmemchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/reml.S b/sysdeps/alpha/reml.S
index 1857da98a8..485e215765 100644
--- a/sysdeps/alpha/reml.S
+++ b/sysdeps/alpha/reml.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@twiddle.net>
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/remq.S b/sysdeps/alpha/remq.S
index ace555ccee..505883953d 100644
--- a/sysdeps/alpha/remq.S
+++ b/sysdeps/alpha/remq.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/remqu.S b/sysdeps/alpha/remqu.S
index 6dc082c25e..46414a16e6 100644
--- a/sysdeps/alpha/remqu.S
+++ b/sysdeps/alpha/remqu.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/rshift.S b/sysdeps/alpha/rshift.S
index 52664ba948..b76803c604 100644
--- a/sysdeps/alpha/rshift.S
+++ b/sysdeps/alpha/rshift.S
@@ -1,6 +1,6 @@
# Alpha 21064 __mpn_rshift --
- # Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/setjmp.S b/sysdeps/alpha/setjmp.S
index e85bd52301..cfa53c9114 100644
--- a/sysdeps/alpha/setjmp.S
+++ b/sysdeps/alpha/setjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -96,6 +96,7 @@ $sigsetjmp_local:
#endif
END(__sigsetjmp)
+hidden_def (__sigsetjmp)
/* Put these traditional entry points in the same file so that we can
elide much of the nonsense in trying to jmp to the real function. */
diff --git a/sysdeps/alpha/sfp-machine.h b/sysdeps/alpha/sfp-machine.h
new file mode 100644
index 0000000000..848881ba33
--- /dev/null
+++ b/sysdeps/alpha/sfp-machine.h
@@ -0,0 +1,99 @@
+/* Machine-dependent software floating-point definitions.
+ Alpha userland IEEE 128-bit version.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com),
+ Jakub Jelinek (jj@ultra.linux.cz) and
+ David S. Miller (davem@redhat.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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>
+
+#define _FP_W_TYPE_SIZE 64
+#define _FP_W_TYPE unsigned long
+#define _FP_WS_TYPE signed long
+#define _FP_I_TYPE long
+
+#define _FP_MUL_MEAT_S(R,X,Y) \
+ _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y)
+#define _FP_MUL_MEAT_D(R,X,Y) \
+ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y) \
+ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
+#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
+#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1)
+#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1
+#define _FP_NANSIGN_S 0
+#define _FP_NANSIGN_D 0
+#define _FP_NANSIGN_Q 0
+
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
+
+/* Alpha Architecture Handbook, 4.7.10.4 sez that we should prefer any
+ type of NaN in Fb, then Fa. */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do { \
+ R##_s = Y##_s; \
+ _FP_FRAC_COPY_##wc(R,X); \
+ R##_c = FP_CLS_NAN; \
+ } while (0)
+
+/* Rounding mode settings. */
+#define FP_RND_NEAREST FE_TONEAREST
+#define FP_RND_ZERO FE_TOWARDZERO
+#define FP_RND_PINF FE_UPWARD
+#define FP_RND_MINF FE_DOWNWARD
+
+/* Obtain the current rounding mode. It's given as an argument to
+ all the Ots functions, with 4 meaning "dynamic". */
+#define FP_ROUNDMODE _round
+
+/* Exception flags. */
+#define FP_EX_INVALID FE_INVALID
+#define FP_EX_OVERFLOW FE_OVERFLOW
+#define FP_EX_UNDERFLOW FE_UNDERFLOW
+#define FP_EX_DIVZERO FE_DIVBYZERO
+#define FP_EX_INEXACT FE_INEXACT
+
+#define _FP_TININESS_AFTER_ROUNDING 1
+
+#define FP_INIT_ROUNDMODE \
+do { \
+ if (__builtin_expect (_round == 4, 0)) \
+ { \
+ unsigned long t; \
+ __asm__ __volatile__("excb; mf_fpcr %0" : "=f"(t)); \
+ _round = (t >> FPCR_ROUND_SHIFT) & 3; \
+ } \
+} while (0)
+
+/* We copy the libm function into libc for soft-fp. */
+extern int __feraiseexcept (int __excepts) attribute_hidden;
+
+#define FP_HANDLE_EXCEPTIONS \
+do { \
+ if (__builtin_expect (_fex, 0)) \
+ __feraiseexcept (_fex); \
+} while (0)
+
+#define FP_TRAPPING_EXCEPTIONS \
+ ((__ieee_get_fp_control () & SWCR_ENABLE_MASK) << SWCR_ENABLE_SHIFT)
diff --git a/sysdeps/alpha/soft-fp/Makefile b/sysdeps/alpha/soft-fp/Makefile
deleted file mode 100644
index 83baa7c49d..0000000000
--- a/sysdeps/alpha/soft-fp/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Software floating-point emulation.
-
-ifeq ($(subdir),soft-fp)
-sysdep_routines += ots_add ots_sub ots_mul ots_div ots_cmp ots_cmpe \
- ots_cvtxq ots_cvtqx ots_cvtqux ots_cvttx ots_cvtxt ots_nintxq \
- fraiseexcpt
-endif
-
-ifeq ($(subdir),math)
-CPPFLAGS += -I../soft-fp
-endif
diff --git a/sysdeps/alpha/soft-fp/Versions b/sysdeps/alpha/soft-fp/Versions
deleted file mode 100644
index 3901287115..0000000000
--- a/sysdeps/alpha/soft-fp/Versions
+++ /dev/null
@@ -1,8 +0,0 @@
-libc {
- GLIBC_2.3.4 {
- _OtsAddX; _OtsSubX; _OtsMulX; _OtsDivX;
- _OtsEqlX; _OtsNeqX; _OtsLssX; _OtsLeqX; _OtsGtrX; _OtsGeqX;
- _OtsCvtQX; _OtsCvtQUX; _OtsCvtXQ; _OtsNintXQ;
- _OtsConvertFloatTX; _OtsConvertFloatXT;
- }
-}
diff --git a/sysdeps/alpha/soft-fp/e_sqrtl.c b/sysdeps/alpha/soft-fp/e_sqrtl.c
deleted file mode 100644
index 1971591453..0000000000
--- a/sysdeps/alpha/soft-fp/e_sqrtl.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* long double square root in software floating-point emulation.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <stdlib.h>
-#include <soft-fp.h>
-#include <quad.h>
-#include <shlib-compat.h>
-
-long double
-__ieee754_sqrtl (const long double a)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(C);
- long double c;
- long _round = 4; /* dynamic rounding */
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_Q(A, a);
- FP_SQRT_Q(C, A);
- FP_PACK_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
-
-/* ??? We forgot to add this symbol in 2.15. Getting this into 2.18 isn't as
- straight-forward as just adding the alias, since a generic Versions file
- includes the 2.15 version and the linker uses the first one it sees. */
-#if SHLIB_COMPAT (libm, GLIBC_2_15, GLIBC_2_18)
-versioned_symbol (libm, __ieee754_sqrtl, __sqrtl_finite, GLIBC_2_18);
-#else
-strong_alias(__ieee754_sqrtl, __sqrtl_finite)
-#endif
diff --git a/sysdeps/alpha/soft-fp/sfp-machine.h b/sysdeps/alpha/soft-fp/sfp-machine.h
deleted file mode 100644
index 09e9683b78..0000000000
--- a/sysdeps/alpha/soft-fp/sfp-machine.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Machine-dependent software floating-point definitions.
- Alpha userland IEEE 128-bit version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com),
- Jakub Jelinek (jj@ultra.linux.cz) and
- David S. Miller (davem@redhat.com).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-#define _FP_W_TYPE_SIZE 64
-#define _FP_W_TYPE unsigned long
-#define _FP_WS_TYPE signed long
-#define _FP_I_TYPE long
-
-#define _FP_MUL_MEAT_S(R,X,Y) \
- _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y)
-#define _FP_MUL_MEAT_D(R,X,Y) \
- _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_Q(R,X,Y) \
- _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
-#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
-#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
-
-#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
-#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1)
-#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1
-#define _FP_NANSIGN_S 0
-#define _FP_NANSIGN_D 0
-#define _FP_NANSIGN_Q 0
-
-#define _FP_KEEPNANFRACP 1
-#define _FP_QNANNEGATEDP 0
-
-/* Alpha Architecture Handbook, 4.7.10.4 sez that we should prefer any
- type of NaN in Fb, then Fa. */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
- do { \
- R##_s = Y##_s; \
- _FP_FRAC_COPY_##wc(R,X); \
- R##_c = FP_CLS_NAN; \
- } while (0)
-
-/* Rounding mode settings. */
-#define FP_RND_NEAREST FE_TONEAREST
-#define FP_RND_ZERO FE_TOWARDZERO
-#define FP_RND_PINF FE_UPWARD
-#define FP_RND_MINF FE_DOWNWARD
-
-/* Obtain the current rounding mode. It's given as an argument to
- all the Ots functions, with 4 meaning "dynamic". */
-#define FP_ROUNDMODE _round
-
-/* Exception flags. */
-#define FP_EX_INVALID FE_INVALID
-#define FP_EX_OVERFLOW FE_OVERFLOW
-#define FP_EX_UNDERFLOW FE_UNDERFLOW
-#define FP_EX_DIVZERO FE_DIVBYZERO
-#define FP_EX_INEXACT FE_INEXACT
-
-#define _FP_TININESS_AFTER_ROUNDING 1
-
-#define FP_INIT_ROUNDMODE \
-do { \
- if (__builtin_expect (_round == 4, 0)) \
- { \
- unsigned long t; \
- __asm__ __volatile__("excb; mf_fpcr %0" : "=f"(t)); \
- _round = (t >> FPCR_ROUND_SHIFT) & 3; \
- } \
-} while (0)
-
-/* We copy the libm function into libc for soft-fp. */
-extern int __feraiseexcept (int __excepts) attribute_hidden;
-
-#define FP_HANDLE_EXCEPTIONS \
-do { \
- if (__builtin_expect (_fex, 0)) \
- __feraiseexcept (_fex); \
-} while (0)
-
-#define FP_TRAPPING_EXCEPTIONS \
- ((__ieee_get_fp_control () & SWCR_ENABLE_MASK) << SWCR_ENABLE_SHIFT)
diff --git a/sysdeps/alpha/sotruss-lib.c b/sysdeps/alpha/sotruss-lib.c
index 3d82a9dd89..084d0e52e4 100644
--- a/sysdeps/alpha/sotruss-lib.c
+++ b/sysdeps/alpha/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for Alpha.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/stackinfo.h b/sysdeps/alpha/stackinfo.h
index 9dff9f2bad..d846da10d4 100644
--- a/sysdeps/alpha/stackinfo.h
+++ b/sysdeps/alpha/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/start.S b/sysdeps/alpha/start.S
index f1a27c3324..5de8ceeca7 100644
--- a/sysdeps/alpha/start.S
+++ b/sysdeps/alpha/start.S
@@ -1,5 +1,5 @@
/* Startup code for Alpha/ELF.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>
diff --git a/sysdeps/alpha/stpcpy.S b/sysdeps/alpha/stpcpy.S
index 0470c314da..0122e494a1 100644
--- a/sysdeps/alpha/stpcpy.S
+++ b/sysdeps/alpha/stpcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1996.
diff --git a/sysdeps/alpha/stpncpy.S b/sysdeps/alpha/stpncpy.S
index de1e90b03e..0c2ffc441d 100644
--- a/sysdeps/alpha/stpncpy.S
+++ b/sysdeps/alpha/stpncpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu)
diff --git a/sysdeps/alpha/strcat.S b/sysdeps/alpha/strcat.S
index 1de80e1c4e..046c7b8ee3 100644
--- a/sysdeps/alpha/strcat.S
+++ b/sysdeps/alpha/strcat.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1996.
diff --git a/sysdeps/alpha/strchr.S b/sysdeps/alpha/strchr.S
index 6e4ef61866..772e2b5fb1 100644
--- a/sysdeps/alpha/strchr.S
+++ b/sysdeps/alpha/strchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu)
diff --git a/sysdeps/alpha/strcmp.S b/sysdeps/alpha/strcmp.S
index 719950a496..00ff115b99 100644
--- a/sysdeps/alpha/strcmp.S
+++ b/sysdeps/alpha/strcmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/strcpy.S b/sysdeps/alpha/strcpy.S
index 30b6dec19e..cad0d51041 100644
--- a/sysdeps/alpha/strcpy.S
+++ b/sysdeps/alpha/strcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1996.
diff --git a/sysdeps/alpha/strlen.S b/sysdeps/alpha/strlen.S
index 72c83a46ff..76efb9b050 100644
--- a/sysdeps/alpha/strlen.S
+++ b/sysdeps/alpha/strlen.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Contributed by David Mosberger (davidm@cs.arizona.edu).
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/strncat.S b/sysdeps/alpha/strncat.S
index 67d4690560..a4faf4c914 100644
--- a/sysdeps/alpha/strncat.S
+++ b/sysdeps/alpha/strncat.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1996.
diff --git a/sysdeps/alpha/strncmp.S b/sysdeps/alpha/strncmp.S
index 48309301a6..ebe9268c6f 100644
--- a/sysdeps/alpha/strncmp.S
+++ b/sysdeps/alpha/strncmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/strncpy.S b/sysdeps/alpha/strncpy.S
index ecd610cc8b..fdb8e4b34d 100644
--- a/sysdeps/alpha/strncpy.S
+++ b/sysdeps/alpha/strncpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/strrchr.S b/sysdeps/alpha/strrchr.S
index e7a18d36fb..235b8b39a1 100644
--- a/sysdeps/alpha/strrchr.S
+++ b/sysdeps/alpha/strrchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/alpha/stxcpy.S b/sysdeps/alpha/stxcpy.S
index ba6c9f74dd..2f32dfda9d 100644
--- a/sysdeps/alpha/stxcpy.S
+++ b/sysdeps/alpha/stxcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/stxncpy.S b/sysdeps/alpha/stxncpy.S
index c5d997ab22..690459cd60 100644
--- a/sysdeps/alpha/stxncpy.S
+++ b/sysdeps/alpha/stxncpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/sub_n.S b/sysdeps/alpha/sub_n.S
index a916ef1d72..5a4a9b9dad 100644
--- a/sysdeps/alpha/sub_n.S
+++ b/sysdeps/alpha/sub_n.S
@@ -1,7 +1,7 @@
# Alpha __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
# store difference in a third limb vector.
- # Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1995-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/submul_1.S b/sysdeps/alpha/submul_1.S
index 63f60c14ae..cea29eda44 100644
--- a/sysdeps/alpha/submul_1.S
+++ b/sysdeps/alpha/submul_1.S
@@ -1,7 +1,7 @@
# Alpha 21064 __mpn_submul_1 -- Multiply a limb vector with a limb and
# subtract the result from a second limb vector.
- # Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1992-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/alpha/tst-audit.h b/sysdeps/alpha/tst-audit.h
index 3fe369a547..f12a720782 100644
--- a/sysdeps/alpha/tst-audit.h
+++ b/sysdeps/alpha/tst-audit.h
@@ -1,5 +1,5 @@
/* Definitions for testing PLT entry/exit auditing. Alpha version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/alpha/udiv_qrnnd.S b/sysdeps/alpha/udiv_qrnnd.S
index 3bb52d7ecd..b0453ff87c 100644
--- a/sysdeps/alpha/udiv_qrnnd.S
+++ b/sysdeps/alpha/udiv_qrnnd.S
@@ -1,6 +1,6 @@
# Alpha 21064 __udiv_qrnnd
- # Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ # Copyright (C) 1992-2018 Free Software Foundation, Inc.
# This file is part of the GNU MP Library.
diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile
index 2849aeda42..ad2042b93a 100644
--- a/sysdeps/arm/Makefile
+++ b/sysdeps/arm/Makefile
@@ -51,11 +51,6 @@ sysdep_routines += $(aeabi_constants) $(aeabi_routines)
static-only-routines += $(aeabi_constants) aeabi_read_tp
shared-only-routines += libc-aeabi_read_tp
-# In order for unwinding to fail when it falls out of main, we need a
-# cantunwind marker. There's one in start.S. To make sure we reach it, add
-# unwind tables for __libc_start_main.
-CFLAGS-libc-start.c += -fexceptions
-
sysdep_routines += arm-unwind-resume
shared-only-routines += arm-unwind-resume
endif
@@ -64,10 +59,6 @@ ifeq ($(subdir),gmon)
sysdep_routines += arm-mcount
endif
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
-
ifeq ($(subdir),rt)
librt-sysdep_routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
librt-shared-only-routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
diff --git a/sysdeps/arm/__longjmp.S b/sysdeps/arm/__longjmp.S
index 0f50268693..b2cbbb9e3a 100644
--- a/sysdeps/arm/__longjmp.S
+++ b/sysdeps/arm/__longjmp.S
@@ -1,5 +1,5 @@
/* longjmp for ARM.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,8 +28,7 @@ ENTRY (__longjmp)
mov ip, r0
#ifdef CHECK_SP
- sfi_breg ip, \
- ldr r4, [\B] /* jmpbuf's sp */
+ ldr r4, [ip] /* jmpbuf's sp */
cfi_undefined (r4)
#ifdef PTR_DEMANGLE
PTR_DEMANGLE (r4, r4, a3, a4)
@@ -38,28 +37,22 @@ ENTRY (__longjmp)
#endif
#ifdef PTR_DEMANGLE
- sfi_breg ip, \
- ldr a4, [\B], #4
+ ldr a4, [ip], #4
PTR_DEMANGLE (a4, a4, a3, r4)
cfi_undefined (r4)
- sfi_breg ip, \
- ldr r4, [\B], #4
+ ldr r4, [ip], #4
PTR_DEMANGLE2 (r4, r4, a3)
#else
- sfi_breg ip, \
- ldr a4, [\B], #4
- sfi_breg ip, \
- ldr r4, [\B], #4
+ ldr a4, [ip], #4
+ ldr r4, [ip], #4
cfi_undefined (r4)
#endif
/* longjmp probe expects longjmp first argument (4@r0), second
argument (-4@r1), and target address (4@r4), respectively. */
LIBC_PROBE (longjmp, 3, 4@r0, -4@r1, 4@r4)
- sfi_sp \
mov sp, a4
mov lr, r4
- sfi_breg ip, \
- ldmia \B!, JMP_BUF_REGLIST
+ ldmia ip!, JMP_BUF_REGLIST
cfi_restore (v1)
cfi_restore (v2)
cfi_restore (v3)
@@ -97,8 +90,7 @@ ENTRY (__longjmp)
/* Restore the VFP registers. */
/* Following instruction is vldmia ip!, {d8-d15}. */
- sfi_breg r12, \
- ldc p11, cr8, [\B], #64
+ ldc p11, cr8, [r12], #64
.Lno_vfp:
#ifndef ARM_ASSUME_NO_IWMMXT
@@ -107,18 +99,12 @@ ENTRY (__longjmp)
/* Restore the call-preserved iWMMXt registers. */
/* Following instructions are wldrd wr10, [ip], #8 (etc.) */
- sfi_breg r12, \
- ldcl p1, cr10, [\B], #8
- sfi_breg r12, \
- ldcl p1, cr11, [\B], #8
- sfi_breg r12, \
- ldcl p1, cr12, [\B], #8
- sfi_breg r12, \
- ldcl p1, cr13, [\B], #8
- sfi_breg r12, \
- ldcl p1, cr14, [\B], #8
- sfi_breg r12, \
- ldcl p1, cr15, [\B], #8
+ ldcl p1, cr10, [r12], #8
+ ldcl p1, cr11, [r12], #8
+ ldcl p1, cr12, [r12], #8
+ ldcl p1, cr13, [r12], #8
+ ldcl p1, cr14, [r12], #8
+ ldcl p1, cr15, [r12], #8
.Lno_iwmmxt:
#endif
diff --git a/sysdeps/arm/add_n.S b/sysdeps/arm/add_n.S
index aacc5c1e6f..e8e744c3c0 100644
--- a/sysdeps/arm/add_n.S
+++ b/sysdeps/arm/add_n.S
@@ -1,5 +1,5 @@
/* mpn_add_n -- add (or subtract) bignums.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -52,40 +52,31 @@ ENTRY (FUNC)
add lr, r1, r3, lsl #2 /* compute end src1 */
beq 1f
- sfi_breg r1, \
- ldr r4, [\B], #4 /* do one to make count even */
- sfi_breg r2, \
- ldr r5, [\B], #4
+ ldr r4, [r1], #4 /* do one to make count even */
+ ldr r5, [r2], #4
OPC r4, r4, r5
teq r1, lr /* end of count? (preserve carry) */
- sfi_breg r0, \
- str r4, [\B], #4
+ str r4, [r0], #4
beq 9f
1:
tst r3, #2 /* count & 2 == 2? */
beq 2f
- sfi_breg r1, \
- ldm \B!, { r4, r5 } /* do two to make count 0 mod 4 */
- sfi_breg r2, \
- ldm \B!, { r6, r7 }
+ ldm r1!, { r4, r5 } /* do two to make count 0 mod 4 */
+ ldm r2!, { r6, r7 }
OPC r4, r4, r6
OPC r5, r5, r7
teq r1, lr /* end of count? */
- sfi_breg r0, \
- stm \B!, { r4, r5 }
+ stm r0!, { r4, r5 }
beq 9f
2:
- sfi_breg r1, \
- ldm \B!, { r3, r5, r7, r10 } /* do four each loop */
- sfi_breg r2, \
- ldm \B!, { r4, r6, r8, ip }
+ ldm r1!, { r3, r5, r7, r10 } /* do four each loop */
+ ldm r2!, { r4, r6, r8, ip }
OPC r3, r3, r4
OPC r5, r5, r6
OPC r7, r7, r8
OPC r10, r10, ip
teq r1, lr
- sfi_breg r0, \
- stm \B!, { r3, r5, r7, r10 }
+ stm r0!, { r3, r5, r7, r10 }
bne 2b
9:
diff --git a/sysdeps/arm/addmul_1.S b/sysdeps/arm/addmul_1.S
index f39dd14637..40d873690e 100644
--- a/sysdeps/arm/addmul_1.S
+++ b/sysdeps/arm/addmul_1.S
@@ -1,5 +1,5 @@
/* mpn_addmul_1 -- multiply and accumulate bignums.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,21 +37,16 @@ ENTRY (__mpn_addmul_1)
cfi_rel_offset (r6, 8)
cfi_rel_offset (r7, 12)
- sfi_breg r1, \
- ldr r6, [\B], #4
- sfi_breg r0, \
- ldr r5, [\B]
+ ldr r6, [r1], #4
+ ldr r5, [r0]
mov r4, #0 /* init carry in */
b 1f
0:
- sfi_breg r1, \
- ldr r6, [\B], #4 /* load next ul */
+ ldr r6, [r1], #4 /* load next ul */
adds r7, r4, r5 /* (out, c) = cl + lpl */
- sfi_breg r0, \
- ldr r5, [\B, #4] /* load next rl */
+ ldr r5, [r0, #4] /* load next rl */
adc r4, ip, #0 /* cl = hpl + c */
- sfi_breg r0, \
- str r7, [\B], #4
+ str r7, [r0], #4
1:
mov ip, #0 /* zero-extend rl */
umlal r5, ip, r6, r3 /* (hpl, lpl) = ul * vl + rl */
@@ -59,8 +54,7 @@ ENTRY (__mpn_addmul_1)
bne 0b
adds r4, r4, r5 /* (out, c) = cl + llpl */
- sfi_breg r0, \
- str r4, [\B]
+ str r4, [r0]
adc r0, ip, #0 /* return hpl + c */
pop { r4, r5, r6, r7 }
diff --git a/sysdeps/arm/aeabi_assert.c b/sysdeps/arm/aeabi_assert.c
index 8ba0d7c93b..22cf43efcf 100644
--- a/sysdeps/arm/aeabi_assert.c
+++ b/sysdeps/arm/aeabi_assert.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_atexit.c b/sysdeps/arm/aeabi_atexit.c
index 0913e14018..e30df8625e 100644
--- a/sysdeps/arm/aeabi_atexit.c
+++ b/sysdeps/arm/aeabi_atexit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_errno_addr.c b/sysdeps/arm/aeabi_errno_addr.c
index dd45652b4f..5c7dc40114 100644
--- a/sysdeps/arm/aeabi_errno_addr.c
+++ b/sysdeps/arm/aeabi_errno_addr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_lcsts.c b/sysdeps/arm/aeabi_lcsts.c
index b438889716..a37cb88495 100644
--- a/sysdeps/arm/aeabi_lcsts.c
+++ b/sysdeps/arm/aeabi_lcsts.c
@@ -1,5 +1,5 @@
/* Link-time constants for ARM EABI.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_localeconv.c b/sysdeps/arm/aeabi_localeconv.c
index 2636e952ae..3f56742a63 100644
--- a/sysdeps/arm/aeabi_localeconv.c
+++ b/sysdeps/arm/aeabi_localeconv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_math.c b/sysdeps/arm/aeabi_math.c
index d1fcac1a52..b0c153d4f6 100644
--- a/sysdeps/arm/aeabi_math.c
+++ b/sysdeps/arm/aeabi_math.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_mb_cur_max.c b/sysdeps/arm/aeabi_mb_cur_max.c
index 8bdbc88c76..16d009adf6 100644
--- a/sysdeps/arm/aeabi_mb_cur_max.c
+++ b/sysdeps/arm/aeabi_mb_cur_max.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_memclr.c b/sysdeps/arm/aeabi_memclr.c
index 197bac4b6b..b2f65e5fb9 100644
--- a/sysdeps/arm/aeabi_memclr.c
+++ b/sysdeps/arm/aeabi_memclr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software 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,12 +17,12 @@
#include <string.h>
-/* Clear memory. Can't alias to bzero because it's not defined in the
- same translation unit. */
+/* Set memory like memset, but different argument order and no return
+ value required. Also only integer caller-saves may be used. */
void
__aeabi_memclr (void *dest, size_t n)
{
- __bzero (dest, n);
+ memset (dest, 0, n);
}
/* Versions of the above which may assume memory alignment. */
diff --git a/sysdeps/arm/aeabi_memcpy.c b/sysdeps/arm/aeabi_memcpy.c
index a89bb81252..2fa915684f 100644
--- a/sysdeps/arm/aeabi_memcpy.c
+++ b/sysdeps/arm/aeabi_memcpy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_memmove.c b/sysdeps/arm/aeabi_memmove.c
index e95af8a66a..920ff8e2c1 100644
--- a/sysdeps/arm/aeabi_memmove.c
+++ b/sysdeps/arm/aeabi_memmove.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_memset.c b/sysdeps/arm/aeabi_memset.c
index 608c07c183..4eb990e0cb 100644
--- a/sysdeps/arm/aeabi_memset.c
+++ b/sysdeps/arm/aeabi_memset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_sighandlers.S b/sysdeps/arm/aeabi_sighandlers.S
index 53b3b6c205..342e04a259 100644
--- a/sysdeps/arm/aeabi_sighandlers.S
+++ b/sysdeps/arm/aeabi_sighandlers.S
@@ -1,5 +1,5 @@
/* Link-time constants for ARM EABI - signal handlers.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/aeabi_unwind_cpp_pr1.c b/sysdeps/arm/aeabi_unwind_cpp_pr1.c
index 88eed1c863..ef0b9b6fe5 100644
--- a/sysdeps/arm/aeabi_unwind_cpp_pr1.c
+++ b/sysdeps/arm/aeabi_unwind_cpp_pr1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/arm-features.h b/sysdeps/arm/arm-features.h
index fe6a6b72d6..69c4f9d604 100644
--- a/sysdeps/arm/arm-features.h
+++ b/sysdeps/arm/arm-features.h
@@ -1,5 +1,5 @@
/* Macros to test for CPU features on ARM. Generic ARM version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/arm-ifunc.h b/sysdeps/arm/arm-ifunc.h
new file mode 100644
index 0000000000..80f4f0e3a3
--- /dev/null
+++ b/sysdeps/arm/arm-ifunc.h
@@ -0,0 +1,33 @@
+/* Common definition for ifunc resolvers. Linux/ARM version.
+ This file is part of the GNU C Library.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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>
+#include <ifunc-init.h>
+
+#define INIT_ARCH()
+
+#define arm_libc_ifunc_redirected(redirected_name, name, expr) \
+ __ifunc (redirected_name, name, expr(hwcap), int hwcap, INIT_ARCH)
+
+#if defined SHARED
+# define arm_libc_ifunc_hidden_def(redirect_name, name) \
+ __hidden_ver1 (name, __GI_##name, redirect_name) \
+ __attribute__ ((visibility ("hidden")))
+#else
+# define arm_libc_ifunc_hidden_def(redirect_name, name)
+#endif
diff --git a/sysdeps/arm/arm-mcount.S b/sysdeps/arm/arm-mcount.S
index d690d7c397..23ea080cf9 100644
--- a/sysdeps/arm/arm-mcount.S
+++ b/sysdeps/arm/arm-mcount.S
@@ -1,5 +1,5 @@
/* Implementation of profiling support. ARM EABI version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -90,8 +90,7 @@ ENTRY(__mcount_arm_compat)
cfi_rel_offset (lr, 20)
movs r0, fp
ittt ne
- sfi_breg r0, \
- ldrne r0, [\B, #-4]
+ ldrne r0, [r0, #-4]
movsne r1, lr
blne __mcount_internal
# if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
diff --git a/sysdeps/arm/arm-unwind-resume.S b/sysdeps/arm/arm-unwind-resume.S
index c9ac904021..3433617e48 100644
--- a/sysdeps/arm/arm-unwind-resume.S
+++ b/sysdeps/arm/arm-unwind-resume.S
@@ -1,5 +1,5 @@
/* _Unwind_Resume wrapper for ARM EABI.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/armv6/rawmemchr.S b/sysdeps/arm/armv6/rawmemchr.S
index 2fda9a8c9b..6c9d6de3b1 100644
--- a/sysdeps/arm/armv6/rawmemchr.S
+++ b/sysdeps/arm/armv6/rawmemchr.S
@@ -1,5 +1,5 @@
/* rawmemchr -- find a byte within an unsized memory block.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,8 +25,7 @@ ENTRY (__rawmemchr)
@ r0 = start of string
@ r1 = character to match
@ returns a pointer to the match, which must be present.
- sfi_breg r0, \
- ldrb r2, [\B] @ load first byte asap
+ ldrb r2, [r0] @ load first byte asap
@ To cater to long strings, we want to search through a few
@ characters until we reach an aligned pointer. To cater to
@@ -42,8 +41,7 @@ ENTRY (__rawmemchr)
bxeq lr
@ Loop until we find ...
-1: sfi_breg r0, \
- ldrb r2, [\B, #1]!
+1: ldrb r2, [r0, #1]!
subs r3, r3, #1 @ ... the alignment point
it ne
cmpne r2, r1 @ ... or C
@@ -56,16 +54,15 @@ ENTRY (__rawmemchr)
add r0, r0, #1
@ So now we're aligned.
- sfi_breg r0, \
- ldrd r2, r3, [\B], #8
+ ldrd r2, r3, [r0], #8
orr r1, r1, r1, lsl #8 @ Replicate C to all bytes
#ifdef ARCH_HAS_T2
movw ip, #0x0101
- sfi_pld r0, #64
+ pld [r0, #64]
movt ip, #0x0101
#else
ldr ip, =0x01010101
- sfi_pld r0, #64
+ pld [r0, #64]
#endif
orr r1, r1, r1, lsl #16
@@ -77,11 +74,10 @@ ENTRY (__rawmemchr)
eor r3, r3, r1
uqsub8 r2, ip, r2 @ Find C
uqsub8 r3, ip, r3
- sfi_pld r0, #128
+ pld [r0, #128]
orrs r3, r3, r2 @ Test both words for found
it eq
- sfi_breg r0, \
- ldrdeq r2, r3, [\B], #8
+ ldrdeq r2, r3, [r0], #8
beq 2b
@ Found something. Disambiguate between first and second words.
diff --git a/sysdeps/arm/armv6/strchr.S b/sysdeps/arm/armv6/strchr.S
index 06e00376c0..d7f75fa840 100644
--- a/sysdeps/arm/armv6/strchr.S
+++ b/sysdeps/arm/armv6/strchr.S
@@ -1,5 +1,5 @@
/* strchr -- find the first instance of C in a nul-terminated string.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,8 +25,7 @@ ENTRY (strchr)
@ r0 = start of string
@ r1 = character to match
@ returns NULL for no match, or a pointer to the match
- sfi_breg r0, \
- ldrb r2, [\B] @ load the first byte asap
+ ldrb r2, [r0] @ load the first byte asap
uxtb r1, r1
@ To cater to long strings, we want to search through a few
@@ -43,8 +42,7 @@ ENTRY (strchr)
beq 99f
@ Loop until we find ...
-1: sfi_breg r0, \
- ldrb r2, [\B, #1]!
+1: ldrb r2, [r0, #1]!
subs r3, r3, #1 @ ... the aligment point
it ne
cmpne r2, r1 @ ... or the character
@@ -67,16 +65,15 @@ ENTRY (strchr)
cfi_rel_offset (r6, 8)
cfi_rel_offset (r7, 12)
- sfi_breg r0, \
- ldrd r2, r3, [\B], #8
+ ldrd r2, r3, [r0], #8
orr r1, r1, r1, lsl #8 @ Replicate C to all bytes
#ifdef ARCH_HAS_T2
movw ip, #0x0101
- sfi_pld r0, #64
+ pld [r0, #64]
movt ip, #0x0101
#else
ldr ip, =0x01010101
- sfi_pld r0, #64
+ pld [r0, #64]
#endif
orr r1, r1, r1, lsl #16
@@ -90,14 +87,13 @@ ENTRY (strchr)
uqsub8 r5, ip, r3
eor r7, r3, r1
uqsub8 r6, ip, r6 @ Find C
- sfi_pld r0, #128 @ Prefetch 2 lines ahead
+ pld [r0, #128] @ Prefetch 2 lines ahead
uqsub8 r7, ip, r7
orr r4, r4, r6 @ Combine found for EOS and C
orr r5, r5, r7
orrs r6, r4, r5 @ Combine the two words
it eq
- sfi_breg r0, \
- ldrdeq r2, r3, [\B], #8
+ ldrdeq r2, r3, [r0], #8
beq 2b
@ Found something. Disambiguate between first and second words.
diff --git a/sysdeps/arm/armv6/strcpy.S b/sysdeps/arm/armv6/strcpy.S
index c0484a3cf9..10c5c575ad 100644
--- a/sysdeps/arm/armv6/strcpy.S
+++ b/sysdeps/arm/armv6/strcpy.S
@@ -1,5 +1,5 @@
/* strcpy -- copy a nul-terminated string.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,8 +44,8 @@ ENTRY (strcpy)
@ Signal strcpy with DEST in IP.
mov ip, r0
0:
- sfi_pld r0
- sfi_pld r1
+ pld [r0, #0]
+ pld [r1, #0]
@ To cater to long strings, we want 8 byte alignment in the source.
@ To cater to small strings, we don't want to start that right away.
@@ -54,11 +54,9 @@ ENTRY (strcpy)
rsb r3, r3, #16
@ Loop until we find ...
-1: sfi_breg r1, \
- ldrb r2, [\B], #1
+1: ldrb r2, [r1], #1
subs r3, r3, #1 @ ... the alignment point
- sfi_breg r0, \
- strb r2, [\B], #1
+ strb r2, [r0], #1
it ne
cmpne r2, #0 @ ... or EOS
bne 1b
@@ -68,10 +66,9 @@ ENTRY (strcpy)
beq .Lreturn
@ Load the next two words asap
- sfi_breg r1, \
- ldrd r2, r3, [\B], #8
- sfi_pld r0, #64
- sfi_pld r1, #64
+ ldrd r2, r3, [r1], #8
+ pld [r0, #64]
+ pld [r1, #64]
@ For longer strings, we actaully need a stack frame.
push { r4, r5, r6, r7 }
@@ -99,18 +96,15 @@ ENTRY (strcpy)
.balign 16
2: uqsub8 r4, r7, r2 @ Find EOS
uqsub8 r5, r7, r3
- sfi_pld r1, #128
+ pld [r1, #128]
cmp r4, #0 @ EOS in first word?
- sfi_pld r0, #128
+ pld [r0, #128]
bne 3f
- sfi_breg r0, \
- str r2, [\B], #4
+ str r2, [r0], #4
cmp r5, #0 @ EOS in second word?
bne 4f
- sfi_breg r0, \
- str r3, [\B], #4
- sfi_breg r1, \
- ldrd r2, r3, [\B], #8
+ str r3, [r0], #4
+ ldrd r2, r3, [r1], #8
b 2b
3: sub r1, r1, #4 @ backup to first word
@@ -120,11 +114,9 @@ ENTRY (strcpy)
@ Note that we generally back up and re-read source bytes,
@ but we'll not re-write dest bytes.
.Lbyte_loop:
- sfi_breg r1, \
- ldrb r2, [\B], #1
+ ldrb r2, [r1], #1
cmp r2, #0
- sfi_breg r0, \
- strb r2, [\B], #1
+ strb r2, [r0], #1
bne .Lbyte_loop
pop { r4, r5, r6, r7 }
@@ -169,8 +161,7 @@ ENTRY (strcpy)
@ Store a few bytes from the first word.
@ At the same time we align r0 and shift out bytes from r2.
.rept 4-\unalign
- sfi_breg r0, \
- strb r2, [\B], #1
+ strb r2, [r0], #1
lsr r2, r2, #8
.endr
#ifdef __ARMEB__
@@ -185,23 +176,20 @@ ENTRY (strcpy)
orr r2, r2, r3, lsh_gt #(\unalign*8)
@ Save leftover bytes from the two words
lsh_ls r6, r3, #((4-\unalign)*8)
- sfi_breg r0, \
- str r2, [\B], #4
+ str r2, [r0], #4
@ The "real" start of the unaligned copy loop.
- sfi_breg r1, \
- ldrd r2, r3, [\B], #8 @ Load 8 more bytes
+ ldrd r2, r3, [r1], #8 @ Load 8 more bytes
uqsub8 r4, r7, r2 @ Find EOS
- sfi_pld r1, #128
+ pld [r1, #128]
uqsub8 r5, r7, r3
- sfi_pld r0, #128
+ pld [r0, #128]
cmp r4, #0 @ EOS in first word?
bne 3f
@ Combine the leftover and the first word
orr r6, r6, r2, lsh_gt #(\unalign*8)
@ Discard used bytes from the first word.
lsh_ls r2, r2, #((4-\unalign)*8)
- sfi_breg r0, \
- str r6, [\B], #4
+ str r6, [r0], #4
b 1b
@ Found EOS in one of the words; adjust backward
3: sub r1, r1, #4
@@ -212,8 +200,7 @@ ENTRY (strcpy)
rev r2, r2
#endif
.rept \unalign
- sfi_breg r0, \
- strb r2, [\B], #1
+ strb r2, [r0], #1
lsr r2, r2, #8
.endr
b .Lbyte_loop
diff --git a/sysdeps/arm/armv6/strlen.S b/sysdeps/arm/armv6/strlen.S
index d235333062..1fb91342a3 100644
--- a/sysdeps/arm/armv6/strlen.S
+++ b/sysdeps/arm/armv6/strlen.S
@@ -1,5 +1,5 @@
/* strlen -- find the length of a nul-terminated string.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,8 +23,7 @@
ENTRY (strlen)
@ r0 = start of string
- sfi_breg r0, \
- ldrb r2, [\B] @ load the first byte asap
+ ldrb r2, [r0] @ load the first byte asap
@ To cater to long strings, we want to search through a few
@ characters until we reach an aligned pointer. To cater to
@@ -39,8 +38,7 @@ ENTRY (strlen)
beq 99f
@ Loop until we find ...
-1: sfi_breg r0, \
- ldrb r2, [\B, #1]!
+1: ldrb r2, [r0, #1]!
subs r3, r3, #1 @ ... the aligment point
it ne
cmpne r2, #0 @ ... or EOS
@@ -52,15 +50,14 @@ ENTRY (strlen)
add r0, r0, #1
@ So now we're aligned.
- sfi_breg r0, \
- ldrd r2, r3, [\B], #8
+ ldrd r2, r3, [r0], #8
#ifdef ARCH_HAS_T2
movw ip, #0x0101
- sfi_pld r0, #64
+ pld [r0, #64]
movt ip, #0x0101
#else
ldr ip, =0x01010101
- sfi_pld r0, #64
+ pld [r0, #64]
#endif
@ Loop searching for EOS, 8 bytes at a time.
@@ -70,11 +67,10 @@ ENTRY (strlen)
.balign 16
2: uqsub8 r2, ip, r2 @ Find EOS
uqsub8 r3, ip, r3
- sfi_pld r0, #128 @ Prefetch 2 lines ahead
+ pld [r0, #128] @ Prefetch 2 lines ahead
orrs r3, r3, r2 @ Combine the two words
it eq
- sfi_breg r0, \
- ldrdeq r2, r3, [\B], #8
+ ldrdeq r2, r3, [r0], #8
beq 2b
@ Found something. Disambiguate between first and second words.
diff --git a/sysdeps/arm/armv6/strrchr.S b/sysdeps/arm/armv6/strrchr.S
index 4c3cb39e81..892dd2b1dd 100644
--- a/sysdeps/arm/armv6/strrchr.S
+++ b/sysdeps/arm/armv6/strrchr.S
@@ -1,5 +1,5 @@
/* strrchr -- find the last occurence of C in a nul-terminated string
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,8 +33,7 @@ ENTRY (strrchr)
@ Loop a few times until we're aligned.
tst r3, #7
beq 2f
-1: sfi_breg r3, \
- ldrb r2, [\B], #1
+1: ldrb r2, [r3], #1
cmp r2, r1 @ Find the character
it eq
subeq r0, r3, #1
@@ -65,8 +64,7 @@ ENTRY (strrchr)
@ Loop searching for EOS and C, 8 bytes at a time.
@ Any time we find a match in a word, we copy the address of
@ the word to r0, and the found bits to r2.
-3: sfi_breg r3, \
- ldrd r4, r5, [\B], #8
+3: ldrd r4, r5, [r3], #8
@ Subtracting (unsigned saturating) from 1 means result of 1 for
@ any byte that was originally zero and 0 otherwise. Therefore
@ we consider the lsb of each byte the "found" bit.
diff --git a/sysdeps/arm/armv6t2/ffs.S b/sysdeps/arm/armv6t2/ffs.S
index 951a54ec88..0f8d806436 100644
--- a/sysdeps/arm/armv6t2/ffs.S
+++ b/sysdeps/arm/armv6t2/ffs.S
@@ -1,5 +1,5 @@
/* ffs -- find first set bit in an int, from least significant end.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/armv6t2/ffsll.S b/sysdeps/arm/armv6t2/ffsll.S
index 36a55434a7..3b8404ec9e 100644
--- a/sysdeps/arm/armv6t2/ffsll.S
+++ b/sysdeps/arm/armv6t2/ffsll.S
@@ -1,5 +1,5 @@
/* ffsll -- find first set bit in a long long, from least significant end.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/armv6t2/memchr.S b/sysdeps/arm/armv6t2/memchr.S
index ded52dc21e..1d6eee0a11 100644
--- a/sysdeps/arm/armv6t2/memchr.S
+++ b/sysdeps/arm/armv6t2/memchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Code contributed by Dave Gilbert <david.gilbert@linaro.org>
@@ -42,12 +42,8 @@
.syntax unified
.text
-#ifdef NO_THUMB
- .arm
-#else
.thumb
.thumb_func
-#endif
.global memchr
.type memchr,%function
ENTRY(memchr)
@@ -65,8 +61,7 @@ ENTRY(memchr)
@ Work up to an aligned point
5:
- sfi_breg r0, \
- ldrb r3, [\B],#1
+ ldrb r3, [r0],#1
subs r2, r2, #1
cmp r3, r1
beq 50f @ If it matches exit found
@@ -91,24 +86,15 @@ ENTRY(memchr)
movs r3, #0
15:
- sfi_breg r0, \
- ldrd r4,r5, [\B],#8
-#ifndef NO_THUMB
+ ldrd r4,r5, [r0],#8
subs r6, r6, #8
-#endif
eor r4,r4, r1 @ Get it so that r4,r5 have 00's where the bytes match the target
eor r5,r5, r1
uadd8 r4, r4, r7 @ Parallel add 0xff - sets the GE bits for anything that wasn't 0
sel r4, r3, r7 @ bytes are 00 for none-00 bytes, or ff for 00 bytes - NOTE INVERSION
uadd8 r5, r5, r7 @ Parallel add 0xff - sets the GE bits for anything that wasn't 0
sel r5, r4, r7 @ chained....bytes are 00 for none-00 bytes, or ff for 00 bytes - NOTE INVERSION
-#ifndef NO_THUMB
cbnz r5, 60f
-#else
- cmp r5, #0
- bne 60f
- subs r6, r6, #8
-#endif
bne 15b @ (Flags from the subs above) If not run out of bytes then go around again
pop {r4,r5,r6,r7}
@@ -122,25 +108,13 @@ ENTRY(memchr)
and r2,r2,#7 @ Leave the count remaining as the number after the double words have been done
20:
-#ifndef NO_THUMB
cbz r2, 40f @ 0 length or hit the end already then not found
-#else
- cmp r2, #0
- beq 40f
-#endif
21: @ Post aligned section, or just a short call
- sfi_breg r0, \
- ldrb r3,[\B],#1
-#ifndef NO_THUMB
+ ldrb r3,[r0],#1
subs r2,r2,#1
eor r3,r3,r1 @ r3 = 0 if match - doesn't break flags from sub
cbz r3, 50f
-#else
- eors r3, r3, r1
- beq 50f
- subs r2, r2, #1
-#endif
bne 21b @ on r2 flags
40:
diff --git a/sysdeps/arm/armv6t2/strlen.S b/sysdeps/arm/armv6t2/strlen.S
index 4f320de570..a34ef20e9d 100644
--- a/sysdeps/arm/armv6t2/strlen.S
+++ b/sysdeps/arm/armv6t2/strlen.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
*/
-#include <arm-features.h> /* This might #define NO_THUMB. */
+#include <arm-features.h>
#include <sysdep.h>
#ifdef __ARMEB__
@@ -32,24 +32,8 @@
#define S2HI lsl
#endif
-#ifndef NO_THUMB
/* This code is best on Thumb. */
.thumb
-#else
-/* Using bne.w explicitly is desirable in Thumb mode because it helps
- align the following label without a nop. In ARM mode there is no
- such difference. */
-.macro bne.w label
- bne \label
-.endm
-
-/* This clobbers the condition codes, which the real Thumb cbnz instruction
- does not do. But it doesn't matter for any of the uses here. */
-.macro cbnz reg, label
- cmp \reg, #0
- bne \label
-.endm
-#endif
/* Parameters and result. */
#define srcin r0
@@ -67,7 +51,7 @@
.text
.p2align 6
ENTRY(strlen)
- sfi_pld srcin, #0
+ pld [srcin, #0]
strd r4, r5, [sp, #-8]!
cfi_adjust_cfa_offset (8)
cfi_rel_offset (r4, 0)
@@ -76,15 +60,14 @@ ENTRY(strlen)
bic src, srcin, #7
mvn const_m1, #0
ands tmp1, srcin, #7 /* (8 - bytes) to alignment. */
- sfi_pld src, #32
+ pld [src, #32]
bne.w .Lmisaligned8
mov const_0, #0
mov result, #-8
.Lloop_aligned:
/* Bytes 0-7. */
- sfi_breg src, \
- ldrd data1a, data1b, [\B]
- sfi_pld src, #64
+ ldrd data1a, data1b, [src]
+ pld [src, #64]
add result, result, #8
.Lstart_realigned:
uadd8 data1a, data1a, const_m1 /* Saturating GE<0:3> set. */
@@ -94,8 +77,7 @@ ENTRY(strlen)
cbnz data1b, .Lnull_found
/* Bytes 8-15. */
- sfi_breg src, \
- ldrd data1a, data1b, [\B, #8]
+ ldrd data1a, data1b, [src, #8]
uadd8 data1a, data1a, const_m1 /* Saturating GE<0:3> set. */
add result, result, #8
sel data1a, const_0, const_m1 /* Select based on GE<0:3>. */
@@ -104,8 +86,7 @@ ENTRY(strlen)
cbnz data1b, .Lnull_found
/* Bytes 16-23. */
- sfi_breg src, \
- ldrd data1a, data1b, [\B, #16]
+ ldrd data1a, data1b, [src, #16]
uadd8 data1a, data1a, const_m1 /* Saturating GE<0:3> set. */
add result, result, #8
sel data1a, const_0, const_m1 /* Select based on GE<0:3>. */
@@ -114,8 +95,7 @@ ENTRY(strlen)
cbnz data1b, .Lnull_found
/* Bytes 24-31. */
- sfi_breg src, \
- ldrd data1a, data1b, [\B, #24]
+ ldrd data1a, data1b, [src, #24]
add src, src, #32
uadd8 data1a, data1a, const_m1 /* Saturating GE<0:3> set. */
add result, result, #8
@@ -143,24 +123,16 @@ ENTRY(strlen)
.Lmisaligned8:
cfi_restore_state
- sfi_breg src, \
- ldrd data1a, data1b, [\B]
+ ldrd data1a, data1b, [src]
and tmp2, tmp1, #3
rsb result, tmp1, #0
lsl tmp2, tmp2, #3 /* Bytes -> bits. */
tst tmp1, #4
- sfi_pld src, #64
+ pld [src, #64]
S2HI tmp2, const_m1, tmp2
-#ifdef NO_THUMB
- mvn tmp1, tmp2
- orr data1a, data1a, tmp1
- itt ne
- orrne data1b, data1b, tmp1
-#else
orn data1a, data1a, tmp2
itt ne
ornne data1b, data1b, tmp2
-#endif
movne data1a, const_m1
mov const_0, #0
b .Lstart_realigned
diff --git a/sysdeps/arm/armv7/multiarch/Makefile b/sysdeps/arm/armv7/multiarch/Makefile
index e834cc937f..6e5851f897 100644
--- a/sysdeps/arm/armv7/multiarch/Makefile
+++ b/sysdeps/arm/armv7/multiarch/Makefile
@@ -1,3 +1,4 @@
ifeq ($(subdir),string)
-sysdep_routines += memcpy_neon memcpy_vfp
+sysdep_routines += memcpy_neon memcpy_vfp memchr_neon memcpy_arm \
+ memchr_noneon
endif
diff --git a/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c b/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c
index d7088f2a22..48e43da66e 100644
--- a/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c
+++ b/sysdeps/arm/armv7/multiarch/ifunc-impl-list.c
@@ -1,5 +1,5 @@
/* Enumerate available IFUNC implementations of a function. ARM version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,6 +34,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
bool use_neon = true;
#ifdef __ARM_NEON__
# define __memcpy_neon memcpy
+# define __memchr_neon memchr
#else
use_neon = (GLRO(dl_hwcap) & HWCAP_ARM_NEON) != 0;
#endif
@@ -52,5 +53,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
#endif
IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_arm));
+ IFUNC_IMPL (i, name, memchr,
+ IFUNC_IMPL_ADD (array, i, memchr, use_neon, __memchr_neon)
+ IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_noneon));
+
return i;
}
diff --git a/sysdeps/arm/armv7/multiarch/ifunc-memchr.h b/sysdeps/arm/armv7/multiarch/ifunc-memchr.h
new file mode 100644
index 0000000000..75495824f4
--- /dev/null
+++ b/sysdeps/arm/armv7/multiarch/ifunc-memchr.h
@@ -0,0 +1,28 @@
+/* Common definition for memchr resolver.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+__typeof (REDIRECT_NAME) OPTIMIZE (neon) attribute_hidden;
+__typeof (REDIRECT_NAME) OPTIMIZE (noneon) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (int hwcap)
+{
+ if (hwcap & HWCAP_ARM_NEON)
+ return OPTIMIZE (neon);
+ return OPTIMIZE (noneon);
+}
diff --git a/sysdeps/arm/armv7/multiarch/ifunc-memcpy.h b/sysdeps/arm/armv7/multiarch/ifunc-memcpy.h
new file mode 100644
index 0000000000..7e6f73ff4d
--- /dev/null
+++ b/sysdeps/arm/armv7/multiarch/ifunc-memcpy.h
@@ -0,0 +1,37 @@
+/* Common definition for memcpy resolver.
+ Copyright (C) 2017-2018 Free Software 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__
+__typeof (REDIRECT_NAME) OPTIMIZE (arm) attribute_hidden;
+#endif
+__typeof (REDIRECT_NAME) OPTIMIZE (vfp) attribute_hidden;
+__typeof (REDIRECT_NAME) OPTIMIZE (neon) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (int hwcap)
+{
+ if (hwcap & HWCAP_ARM_NEON)
+ return OPTIMIZE (neon);
+#ifdef __SOFTFP__
+ if (hwcap & HWCAP_ARM_VFP)
+ return OPTIMIZE (vfp);
+ return OPTIMIZE (arm);
+#else
+ return OPTIMIZE (vfp);
+#endif
+}
diff --git a/sysdeps/arm/armv7/multiarch/memchr.c b/sysdeps/arm/armv7/multiarch/memchr.c
new file mode 100644
index 0000000000..ff1cc5d203
--- /dev/null
+++ b/sysdeps/arm/armv7/multiarch/memchr.c
@@ -0,0 +1,35 @@
+/* Multiple versions of memchr.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* For __ARM_NEON__ memchr_neon.S defines memchr directly and ifunc
+ is not used. */
+#if IS_IN (libc) && !defined (__ARM_NEON__)
+# define memchr __redirect_memchr
+# include <string.h>
+# undef memchr
+
+# include <arm-ifunc.h>
+
+# define SYMBOL_NAME memchr
+# include "ifunc-memchr.h"
+
+arm_libc_ifunc_redirected (__redirect_memchr, memchr, IFUNC_SELECTOR);
+
+arm_libc_ifunc_hidden_def (__redirect_memchr, memchr);
+#endif
diff --git a/sysdeps/arm/armv7/multiarch/memchr_neon.S b/sysdeps/arm/armv7/multiarch/memchr_neon.S
new file mode 100644
index 0000000000..6fbf9b8898
--- /dev/null
+++ b/sysdeps/arm/armv7/multiarch/memchr_neon.S
@@ -0,0 +1,202 @@
+/* memchr implemented using NEON.
+ Copyright (C) 2011-2018 Free Software 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>
+
+/* For __ARM_NEON__ this file defines memchr. */
+#ifndef __ARM_NEON__
+# define memchr __memchr_neon
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(a)
+#endif
+
+ .arch armv7-a
+ .fpu neon
+
+
+/* Arguments */
+#define srcin r0
+#define chrin r1
+#define cntin r2
+
+/* Retval */
+#define result r0 /* Live range does not overlap with srcin */
+
+/* Working registers */
+#define src r1 /* Live range does not overlap with chrin */
+#define tmp r3
+#define synd r0 /* No overlap with srcin or result */
+#define soff r12
+
+/* Working NEON registers */
+#define vrepchr q0
+#define vdata0 q1
+#define vdata0_0 d2 /* Lower half of vdata0 */
+#define vdata0_1 d3 /* Upper half of vdata0 */
+#define vdata1 q2
+#define vdata1_0 d4 /* Lower half of vhas_chr0 */
+#define vdata1_1 d5 /* Upper half of vhas_chr0 */
+#define vrepmask q3
+#define vrepmask0 d6
+#define vrepmask1 d7
+#define vend q4
+#define vend0 d8
+#define vend1 d9
+
+/*
+ * Core algorithm:
+ *
+ * For each 32-byte chunk we calculate a 32-bit syndrome value, with one bit per
+ * byte. Each bit is set if the relevant byte matched the requested character
+ * and cleared otherwise. 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.
+ */
+
+ .thumb_func
+ .p2align 4,,15
+
+ENTRY(memchr)
+ /* Use a simple loop if there are less than 8 bytes to search. */
+ cmp cntin, #7
+ bhi .Llargestr
+ and chrin, chrin, #0xff
+
+.Lsmallstr:
+ subs cntin, cntin, #1
+ blo .Lnotfound /* Return not found if reached end. */
+ ldrb tmp, [srcin], #1
+ cmp tmp, chrin
+ bne .Lsmallstr /* Loop again if not found. */
+ /* Otherwise fixup address and return. */
+ sub result, srcin, #1
+ bx lr
+
+
+.Llargestr:
+ vdup.8 vrepchr, chrin /* Duplicate char across all lanes. */
+ /*
+ * Magic constant 0x8040201008040201 allows us to identify which lane
+ * matches the requested byte.
+ */
+ movw tmp, #0x0201
+ movt tmp, #0x0804
+ lsl soff, tmp, #4
+ vmov vrepmask0, tmp, soff
+ vmov vrepmask1, tmp, soff
+ /* Work with aligned 32-byte chunks */
+ bic src, srcin, #31
+ ands soff, srcin, #31
+ beq .Lloopintro /* Go straight to main loop if it's aligned. */
+
+ /*
+ * 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.
+ */
+ vld1.8 {vdata0, vdata1}, [src:256]!
+ sub tmp, soff, #32
+ adds cntin, cntin, tmp
+ vceq.i8 vdata0, vdata0, vrepchr
+ vceq.i8 vdata1, vdata1, vrepchr
+ vand vdata0, vdata0, vrepmask
+ vand vdata1, vdata1, vrepmask
+ vpadd.i8 vdata0_0, vdata0_0, vdata0_1
+ vpadd.i8 vdata1_0, vdata1_0, vdata1_1
+ vpadd.i8 vdata0_0, vdata0_0, vdata1_0
+ vpadd.i8 vdata0_0, vdata0_0, vdata0_0
+ vmov synd, vdata0_0[0]
+
+ /* Clear the soff lower bits */
+ lsr synd, synd, soff
+ lsl synd, synd, soff
+ /* The first block can also be the last */
+ bls .Lmasklast
+ /* Have we found something already? */
+ cbnz synd, .Ltail
+
+
+.Lloopintro:
+ vpush {vend}
+ /* 264/265 correspond to d8/d9 for q4 */
+ cfi_adjust_cfa_offset (16)
+ cfi_rel_offset (264, 0)
+ cfi_rel_offset (265, 8)
+ .p2align 3,,7
+.Lloop:
+ vld1.8 {vdata0, vdata1}, [src:256]!
+ subs cntin, cntin, #32
+ vceq.i8 vdata0, vdata0, vrepchr
+ vceq.i8 vdata1, vdata1, vrepchr
+ /* If we're out of data we finish regardless of the result. */
+ bls .Lend
+ /* Use a fast check for the termination condition. */
+ vorr vend, vdata0, vdata1
+ vorr vend0, vend0, vend1
+ vmov synd, tmp, vend0
+ orrs synd, synd, tmp
+ /* We're not out of data, loop if we haven't found the character. */
+ beq .Lloop
+
+.Lend:
+ vpop {vend}
+ cfi_adjust_cfa_offset (-16)
+ cfi_restore (264)
+ cfi_restore (265)
+
+ /* Termination condition found, let's calculate the syndrome value. */
+ vand vdata0, vdata0, vrepmask
+ vand vdata1, vdata1, vrepmask
+ vpadd.i8 vdata0_0, vdata0_0, vdata0_1
+ vpadd.i8 vdata1_0, vdata1_0, vdata1_1
+ vpadd.i8 vdata0_0, vdata0_0, vdata1_0
+ vpadd.i8 vdata0_0, vdata0_0, vdata0_0
+ vmov synd, vdata0_0[0]
+ cbz synd, .Lnotfound
+ bhi .Ltail /* Uses the condition code from
+ subs cntin, cntin, #32 above. */
+
+
+.Lmasklast:
+ /* Clear the (-cntin) upper bits to avoid out-of-bounds matches. */
+ neg cntin, cntin
+ lsl synd, synd, cntin
+ lsrs synd, synd, cntin
+ it eq
+ moveq src, #0 /* If no match, set src to 0 so the retval is 0. */
+
+
+.Ltail:
+ /* Count the trailing zeros using bit reversing */
+ rbit synd, synd
+ /* Compensate the last post-increment */
+ sub src, src, #32
+ /* Count the leading zeros */
+ clz synd, synd
+ /* Compute the potential result and return */
+ add result, src, synd
+ bx lr
+
+
+.Lnotfound:
+ /* Set result to NULL if not found and return */
+ mov result, #0
+ bx lr
+
+END(memchr)
+libc_hidden_builtin_def (memchr)
diff --git a/sysdeps/arm/armv7/multiarch/memchr_noneon.S b/sysdeps/arm/armv7/multiarch/memchr_noneon.S
new file mode 100644
index 0000000000..b1fb54018d
--- /dev/null
+++ b/sysdeps/arm/armv7/multiarch/memchr_noneon.S
@@ -0,0 +1,5 @@
+#define memchr __memchr_noneon
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/arm/armv6t2/memchr.S>
diff --git a/sysdeps/arm/armv7/multiarch/memcpy.S b/sysdeps/arm/armv7/multiarch/memcpy.S
deleted file mode 100644
index 01ba9e5733..0000000000
--- a/sysdeps/arm/armv7/multiarch/memcpy.S
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Multiple versions of memcpy
- All versions must be listed in ifunc-impl-list.c.
- 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/>. */
-
-/* Thumb requires excess IT instructions here. */
-#define NO_THUMB
-#include <sysdep.h>
-#include <rtld-global-offsets.h>
-
-#if IS_IN (libc)
-/* Under __ARM_NEON__, memcpy_neon.S defines the name memcpy. */
-# ifndef __ARM_NEON__
- .text
-ENTRY(memcpy)
- .type memcpy, %gnu_indirect_function
-# ifdef __SOFTFP__
- ldr r1, .Lmemcpy_arm
- tst r0, #HWCAP_ARM_VFP
- ldrne r1, .Lmemcpy_vfp
-# else
- ldr r1, .Lmemcpy_vfp
-# endif
- tst r0, #HWCAP_ARM_NEON
- ldrne r1, .Lmemcpy_neon
-1:
- add r0, r1, pc
- DO_RET(lr)
-
-# ifdef __SOFTFP__
-.Lmemcpy_arm:
- .long C_SYMBOL_NAME(__memcpy_arm) - 1b - PC_OFS
-# endif
-.Lmemcpy_neon:
- .long C_SYMBOL_NAME(__memcpy_neon) - 1b - PC_OFS
-.Lmemcpy_vfp:
- .long C_SYMBOL_NAME(__memcpy_vfp) - 1b - PC_OFS
-
-END(memcpy)
-
-libc_hidden_builtin_def (memcpy)
-#endif /* Not __ARM_NEON__. */
-
-/* These versions of memcpy are defined not to clobber any VFP or NEON
- registers so they must always call the ARM variant of the memcpy code. */
-strong_alias (__memcpy_arm, __aeabi_memcpy)
-strong_alias (__memcpy_arm, __aeabi_memcpy4)
-strong_alias (__memcpy_arm, __aeabi_memcpy8)
-libc_hidden_def (__memcpy_arm)
-
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
-#undef weak_alias
-#define weak_alias(x, y)
-#undef libc_hidden_def
-#define libc_hidden_def(name)
-
-#define memcpy __memcpy_arm
-
-#endif
-
-#include "memcpy_impl.S"
diff --git a/sysdeps/arm/armv7/multiarch/memcpy.c b/sysdeps/arm/armv7/multiarch/memcpy.c
new file mode 100644
index 0000000000..02776b6fe6
--- /dev/null
+++ b/sysdeps/arm/armv7/multiarch/memcpy.c
@@ -0,0 +1,35 @@
+/* Multiple versions of memcpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* For __ARM_NEON__ memchr_neon.S defines memchr directly and ifunc
+ is not used. */
+#if IS_IN (libc) && !defined (__ARM_NEON__)
+# define memcpy __redirect_memcpy
+# include <string.h>
+# undef memcpy
+
+# include <arm-ifunc.h>
+
+# define SYMBOL_NAME memcpy
+# include "ifunc-memcpy.h"
+
+arm_libc_ifunc_redirected (__redirect_memcpy, memcpy, IFUNC_SELECTOR);
+
+arm_libc_ifunc_hidden_def (__redirect_memcpy, memcpy);
+#endif
diff --git a/sysdeps/arm/armv7/multiarch/memcpy_arm.S b/sysdeps/arm/armv7/multiarch/memcpy_arm.S
new file mode 100644
index 0000000000..e4a9a68c42
--- /dev/null
+++ b/sysdeps/arm/armv7/multiarch/memcpy_arm.S
@@ -0,0 +1,10 @@
+#define memcpy __memcpy_arm
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(a)
+#include "memcpy_impl.S"
+
+/* These versions of memcpy are defined not to clobber any VFP or NEON
+ registers so they must always call the ARM variant of the memcpy code. */
+strong_alias (__memcpy_arm, __aeabi_memcpy)
+strong_alias (__memcpy_arm, __aeabi_memcpy4)
+strong_alias (__memcpy_arm, __aeabi_memcpy8)
diff --git a/sysdeps/arm/armv7/multiarch/memcpy_impl.S b/sysdeps/arm/armv7/multiarch/memcpy_impl.S
index a1f6266c88..2de172635c 100644
--- a/sysdeps/arm/armv7/multiarch/memcpy_impl.S
+++ b/sysdeps/arm/armv7/multiarch/memcpy_impl.S
@@ -1,5 +1,5 @@
/* NEON/VFP/ARM version of memcpy optimized for Cortex-A15.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -226,71 +226,40 @@
#ifdef USE_VFP
.macro cpy_line_vfp vreg, base
- sfi_breg dst, \
- vstr \vreg, [\B, #\base]
- sfi_breg src, \
- vldr \vreg, [\B, #\base]
- sfi_breg dst, \
- vstr d0, [\B, #\base + 8]
- sfi_breg src, \
- vldr d0, [\B, #\base + 8]
- sfi_breg dst, \
- vstr d1, [\B, #\base + 16]
- sfi_breg src, \
- vldr d1, [\B, #\base + 16]
- sfi_breg dst, \
- vstr d2, [\B, #\base + 24]
- sfi_breg src, \
- vldr d2, [\B, #\base + 24]
- sfi_breg dst, \
- vstr \vreg, [\B, #\base + 32]
- sfi_breg src, \
- vldr \vreg, [\B, #\base + prefetch_lines * 64 - 32]
- sfi_breg dst, \
- vstr d0, [\B, #\base + 40]
- sfi_breg src, \
- vldr d0, [\B, #\base + 40]
- sfi_breg dst, \
- vstr d1, [\B, #\base + 48]
- sfi_breg src, \
- vldr d1, [\B, #\base + 48]
- sfi_breg dst, \
- vstr d2, [\B, #\base + 56]
- sfi_breg src, \
- vldr d2, [\B, #\base + 56]
+ vstr \vreg, [dst, #\base]
+ vldr \vreg, [src, #\base]
+ vstr d0, [dst, #\base + 8]
+ vldr d0, [src, #\base + 8]
+ vstr d1, [dst, #\base + 16]
+ vldr d1, [src, #\base + 16]
+ vstr d2, [dst, #\base + 24]
+ vldr d2, [src, #\base + 24]
+ vstr \vreg, [dst, #\base + 32]
+ vldr \vreg, [src, #\base + prefetch_lines * 64 - 32]
+ vstr d0, [dst, #\base + 40]
+ vldr d0, [src, #\base + 40]
+ vstr d1, [dst, #\base + 48]
+ vldr d1, [src, #\base + 48]
+ vstr d2, [dst, #\base + 56]
+ vldr d2, [src, #\base + 56]
.endm
.macro cpy_tail_vfp vreg, base
- sfi_breg dst, \
- vstr \vreg, [\B, #\base]
- sfi_breg src, \
- vldr \vreg, [\B, #\base]
- sfi_breg dst, \
- vstr d0, [\B, #\base + 8]
- sfi_breg src, \
- vldr d0, [\B, #\base + 8]
- sfi_breg dst, \
- vstr d1, [\B, #\base + 16]
- sfi_breg src, \
- vldr d1, [\B, #\base + 16]
- sfi_breg dst, \
- vstr d2, [\B, #\base + 24]
- sfi_breg src, \
- vldr d2, [\B, #\base + 24]
- sfi_breg dst, \
- vstr \vreg, [\B, #\base + 32]
- sfi_breg dst, \
- vstr d0, [\B, #\base + 40]
- sfi_breg src, \
- vldr d0, [\B, #\base + 40]
- sfi_breg dst, \
- vstr d1, [\B, #\base + 48]
- sfi_breg src, \
- vldr d1, [\B, #\base + 48]
- sfi_breg dst, \
- vstr d2, [\B, #\base + 56]
- sfi_breg src, \
- vldr d2, [\B, #\base + 56]
+ vstr \vreg, [dst, #\base]
+ vldr \vreg, [src, #\base]
+ vstr d0, [dst, #\base + 8]
+ vldr d0, [src, #\base + 8]
+ vstr d1, [dst, #\base + 16]
+ vldr d1, [src, #\base + 16]
+ vstr d2, [dst, #\base + 24]
+ vldr d2, [src, #\base + 24]
+ vstr \vreg, [dst, #\base + 32]
+ vstr d0, [dst, #\base + 40]
+ vldr d0, [src, #\base + 40]
+ vstr d1, [dst, #\base + 48]
+ vldr d1, [src, #\base + 48]
+ vstr d2, [dst, #\base + 56]
+ vldr d2, [src, #\base + 56]
.endm
#endif
@@ -307,7 +276,7 @@ ENTRY(memcpy)
#ifdef USE_NEON
/* These need an extra layer of macro just to work around a
bug in the assembler's parser when an operand starts with
- a {...}. http://sourceware.org/bugzilla/show_bug.cgi?id=15647
+ a {...}. https://sourceware.org/bugzilla/show_bug.cgi?id=15647
tracks that bug; it was not fixed as of binutils-2.23.2. */
.macro neon_load_d0 reg
vld1.8 {d0}, [\reg]!
@@ -316,26 +285,16 @@ ENTRY(memcpy)
vst1.8 {d0}, [\reg]!
.endm
- /* These are used by the NaCl sfi_breg macro. */
- .macro _sfi_breg_dmask_neon_load_d0 reg
- _sfi_dmask \reg
- .endm
- .macro _sfi_breg_dmask_neon_store_d0 reg
- _sfi_dmask \reg
- .endm
-
and tmp1, count, #0x38
.macro dispatch_step i
- sfi_breg src, neon_load_d0 \B
- sfi_breg dst, neon_store_d0 \B
+ neon_load_d0 src
+ neon_store_d0 dst
.endm
dispatch_7_dword
tst count, #4
- sfi_breg src, \
- ldrne tmp1, [\B], #4
- sfi_breg dst, \
- strne tmp1, [\B], #4
+ ldrne tmp1, [src], #4
+ strne tmp1, [dst], #4
#else
/* Copy up to 15 full words of data. May not be aligned. */
/* Cannot use VFP for unaligned data. */
@@ -344,23 +303,17 @@ ENTRY(memcpy)
add src, src, tmp1
/* Jump directly into the sequence below at the correct offset. */
.macro dispatch_step i
- sfi_breg src, \
- ldr tmp1, [\B, #-(\i * 4)]
- sfi_breg dst, \
- str tmp1, [\B, #-(\i * 4)]
+ ldr tmp1, [src, #-(\i * 4)]
+ str tmp1, [dst, #-(\i * 4)]
.endm
dispatch_15_word
#endif
lsls count, count, #31
- sfi_breg src, \
- ldrhcs tmp1, [\B], #2
- sfi_breg src, \
- ldrbne src, [\B] /* Src is dead, use as a scratch. */
- sfi_breg dst, \
- strhcs tmp1, [\B], #2
- sfi_breg dst, \
- strbne src, [\B]
+ ldrhcs tmp1, [src], #2
+ ldrbne src, [src] /* Src is dead, use as a scratch. */
+ strhcs tmp1, [dst], #2
+ strbne src, [dst]
bx lr
.Lcpy_not_short:
@@ -388,19 +341,13 @@ ENTRY(memcpy)
beq 1f
rsbs tmp2, tmp2, #0
sub count, count, tmp2, lsr #29
- sfi_breg src, \
- ldrmi tmp1, [\B], #4
- sfi_breg dst, \
- strmi tmp1, [\B], #4
+ ldrmi tmp1, [src], #4
+ strmi tmp1, [dst], #4
lsls tmp2, tmp2, #2
- sfi_breg src, \
- ldrhcs tmp1, [\B], #2
- sfi_breg src, \
- ldrbne tmp2, [\B], #1
- sfi_breg dst, \
- strhcs tmp1, [\B], #2
- sfi_breg dst, \
- strbne tmp2, [\B], #1
+ ldrhcs tmp1, [src], #2
+ ldrbne tmp2, [src], #1
+ strhcs tmp1, [dst], #2
+ strbne tmp2, [dst], #1
1:
subs tmp2, count, #64 /* Use tmp2 for count. */
@@ -412,40 +359,24 @@ ENTRY(memcpy)
.Lcpy_body_medium: /* Count in tmp2. */
#ifdef USE_VFP
1:
- sfi_breg src, \
- vldr d0, [\B, #0]
+ vldr d0, [src, #0]
subs tmp2, tmp2, #64
- sfi_breg src, \
- vldr d1, [\B, #8]
- sfi_breg dst, \
- vstr d0, [\B, #0]
- sfi_breg src, \
- vldr d0, [\B, #16]
- sfi_breg dst, \
- vstr d1, [\B, #8]
- sfi_breg src, \
- vldr d1, [\B, #24]
- sfi_breg dst, \
- vstr d0, [\B, #16]
- sfi_breg src, \
- vldr d0, [\B, #32]
- sfi_breg dst, \
- vstr d1, [\B, #24]
- sfi_breg src, \
- vldr d1, [\B, #40]
- sfi_breg dst, \
- vstr d0, [\B, #32]
- sfi_breg src, \
- vldr d0, [\B, #48]
- sfi_breg dst, \
- vstr d1, [\B, #40]
- sfi_breg src, \
- vldr d1, [\B, #56]
- sfi_breg dst, \
- vstr d0, [\B, #48]
+ vldr d1, [src, #8]
+ vstr d0, [dst, #0]
+ vldr d0, [src, #16]
+ vstr d1, [dst, #8]
+ vldr d1, [src, #24]
+ vstr d0, [dst, #16]
+ vldr d0, [src, #32]
+ vstr d1, [dst, #24]
+ vldr d1, [src, #40]
+ vstr d0, [dst, #32]
+ vldr d0, [src, #48]
+ vstr d1, [dst, #40]
+ vldr d1, [src, #56]
+ vstr d0, [dst, #48]
add src, src, #64
- sfi_breg dst, \
- vstr d1, [\B, #56]
+ vstr d1, [dst, #56]
add dst, dst, #64
bge 1b
tst tmp2, #0x3f
@@ -456,48 +387,30 @@ ENTRY(memcpy)
add dst, dst, tmp1
add src, src, tmp1
.macro dispatch_step i
- sfi_breg src, \
- vldr d0, [\B, #-(\i * 8)]
- sfi_breg dst, \
- vstr d0, [\B, #-(\i * 8)]
+ vldr d0, [src, #-(\i * 8)]
+ vstr d0, [dst, #-(\i * 8)]
.endm
dispatch_7_dword
#else
sub src, src, #8
sub dst, dst, #8
1:
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #8]
- sfi_breg dst, \
- strd A_l, A_h, [\B, #8]
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #16]
- sfi_breg dst, \
- strd A_l, A_h, [\B, #16]
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #24]
- sfi_breg dst, \
- strd A_l, A_h, [\B, #24]
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #32]
- sfi_breg dst, \
- strd A_l, A_h, [\B, #32]
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #40]
- sfi_breg dst, \
- strd A_l, A_h, [\B, #40]
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #48]
- sfi_breg dst, \
- strd A_l, A_h, [\B, #48]
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #56]
- sfi_breg dst, \
- strd A_l, A_h, [\B, #56]
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #64]!
- sfi_breg dst, \
- strd A_l, A_h, [\B, #64]!
+ ldrd A_l, A_h, [src, #8]
+ strd A_l, A_h, [dst, #8]
+ ldrd A_l, A_h, [src, #16]
+ strd A_l, A_h, [dst, #16]
+ ldrd A_l, A_h, [src, #24]
+ strd A_l, A_h, [dst, #24]
+ ldrd A_l, A_h, [src, #32]
+ strd A_l, A_h, [dst, #32]
+ ldrd A_l, A_h, [src, #40]
+ strd A_l, A_h, [dst, #40]
+ ldrd A_l, A_h, [src, #48]
+ strd A_l, A_h, [dst, #48]
+ ldrd A_l, A_h, [src, #56]
+ strd A_l, A_h, [dst, #56]
+ ldrd A_l, A_h, [src, #64]!
+ strd A_l, A_h, [dst, #64]!
subs tmp2, tmp2, #64
bge 1b
tst tmp2, #0x3f
@@ -524,28 +437,20 @@ ENTRY(memcpy)
add dst, dst, tmp1
add src, src, tmp1
.macro dispatch_step i
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #-(\i * 8)]
- sfi_breg dst, \
- strd A_l, A_h, [\B, #-(\i * 8)]
+ ldrd A_l, A_h, [src, #-(\i * 8)]
+ strd A_l, A_h, [dst, #-(\i * 8)]
.endm
dispatch_7_dword
#endif
tst tmp2, #4
- sfi_breg src, \
- ldrne tmp1, [\B], #4
- sfi_breg dst, \
- strne tmp1, [\B], #4
+ ldrne tmp1, [src], #4
+ strne tmp1, [dst], #4
lsls tmp2, tmp2, #31 /* Count (tmp2) now dead. */
- sfi_breg src, \
- ldrhcs tmp1, [\B], #2
- sfi_breg src, \
- ldrbne tmp2, [\B]
- sfi_breg dst, \
- strhcs tmp1, [\B], #2
- sfi_breg dst, \
- strbne tmp2, [\B]
+ ldrhcs tmp1, [src], #2
+ ldrbne tmp2, [src]
+ strhcs tmp1, [dst], #2
+ strbne tmp2, [dst]
.Ldone:
ldr tmp2, [sp], #FRAME_SIZE
@@ -565,23 +470,15 @@ ENTRY(memcpy)
copy position into a register. This should act like a PLD
operation but we won't have to repeat the transfer. */
- sfi_breg src, \
- vldr d3, [\B, #0]
- sfi_breg src, \
- vldr d4, [\B, #64]
- sfi_breg src, \
- vldr d5, [\B, #128]
- sfi_breg src, \
- vldr d6, [\B, #192]
- sfi_breg src, \
- vldr d7, [\B, #256]
-
- sfi_breg src, \
- vldr d0, [\B, #8]
- sfi_breg src, \
- vldr d1, [\B, #16]
- sfi_breg src, \
- vldr d2, [\B, #24]
+ vldr d3, [src, #0]
+ vldr d4, [src, #64]
+ vldr d5, [src, #128]
+ vldr d6, [src, #192]
+ vldr d7, [src, #256]
+
+ vldr d0, [src, #8]
+ vldr d1, [src, #16]
+ vldr d2, [src, #24]
add src, src, #32
subs tmp2, tmp2, #prefetch_lines * 64 * 2
@@ -606,31 +503,19 @@ ENTRY(memcpy)
add src, src, #3 * 64
add dst, dst, #3 * 64
cpy_tail_vfp d6, 0
- sfi_breg dst, \
- vstr d7, [\B, #64]
- sfi_breg src, \
- vldr d7, [\B, #64]
- sfi_breg dst, \
- vstr d0, [\B, #64 + 8]
- sfi_breg src, \
- vldr d0, [\B, #64 + 8]
- sfi_breg dst, \
- vstr d1, [\B, #64 + 16]
- sfi_breg src, \
- vldr d1, [\B, #64 + 16]
- sfi_breg dst, \
- vstr d2, [\B, #64 + 24]
- sfi_breg src, \
- vldr d2, [\B, #64 + 24]
- sfi_breg dst, \
- vstr d7, [\B, #64 + 32]
+ vstr d7, [dst, #64]
+ vldr d7, [src, #64]
+ vstr d0, [dst, #64 + 8]
+ vldr d0, [src, #64 + 8]
+ vstr d1, [dst, #64 + 16]
+ vldr d1, [src, #64 + 16]
+ vstr d2, [dst, #64 + 24]
+ vldr d2, [src, #64 + 24]
+ vstr d7, [dst, #64 + 32]
add src, src, #96
- sfi_breg dst, \
- vstr d0, [\B, #64 + 40]
- sfi_breg dst, \
- vstr d1, [\B, #64 + 48]
- sfi_breg dst, \
- vstr d2, [\B, #64 + 56]
+ vstr d0, [dst, #64 + 40]
+ vstr d1, [dst, #64 + 48]
+ vstr d2, [dst, #64 + 56]
add dst, dst, #128
add tmp2, tmp2, #prefetch_lines * 64
b .Lcpy_body_medium
@@ -641,83 +526,59 @@ ENTRY(memcpy)
/* Pre-bias src and dst. */
sub src, src, #8
sub dst, dst, #8
- sfi_pld src, #8
- sfi_pld src, #72
+ pld [src, #8]
+ pld [src, #72]
subs tmp2, tmp2, #64
- sfi_pld src, #136
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #8]
+ pld [src, #136]
+ ldrd A_l, A_h, [src, #8]
strd B_l, B_h, [sp, #8]
cfi_rel_offset (B_l, 8)
cfi_rel_offset (B_h, 12)
- sfi_breg src, \
- ldrd B_l, B_h, [\B, #16]
+ ldrd B_l, B_h, [src, #16]
strd C_l, C_h, [sp, #16]
cfi_rel_offset (C_l, 16)
cfi_rel_offset (C_h, 20)
- sfi_breg src, \
- ldrd C_l, C_h, [\B, #24]
+ ldrd C_l, C_h, [src, #24]
strd D_l, D_h, [sp, #24]
cfi_rel_offset (D_l, 24)
cfi_rel_offset (D_h, 28)
- sfi_pld src, #200
- sfi_breg src, \
- ldrd D_l, D_h, [\B, #32]!
+ pld [src, #200]
+ ldrd D_l, D_h, [src, #32]!
b 1f
.p2align 6
2:
- sfi_pld src, #232
- sfi_breg dst, \
- strd A_l, A_h, [\B, #40]
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #40]
- sfi_breg dst, \
- strd B_l, B_h, [\B, #48]
- sfi_breg src, \
- ldrd B_l, B_h, [\B, #48]
- sfi_breg dst, \
- strd C_l, C_h, [\B, #56]
- sfi_breg src, \
- ldrd C_l, C_h, [\B, #56]
- sfi_breg dst, \
- strd D_l, D_h, [\B, #64]!
- sfi_breg src, \
- ldrd D_l, D_h, [\B, #64]!
+ pld [src, #232]
+ strd A_l, A_h, [dst, #40]
+ ldrd A_l, A_h, [src, #40]
+ strd B_l, B_h, [dst, #48]
+ ldrd B_l, B_h, [src, #48]
+ strd C_l, C_h, [dst, #56]
+ ldrd C_l, C_h, [src, #56]
+ strd D_l, D_h, [dst, #64]!
+ ldrd D_l, D_h, [src, #64]!
subs tmp2, tmp2, #64
1:
- sfi_breg dst, \
- strd A_l, A_h, [\B, #8]
- sfi_breg src, \
- ldrd A_l, A_h, [\B, #8]
- sfi_breg dst, \
- strd B_l, B_h, [\B, #16]
- sfi_breg src, \
- ldrd B_l, B_h, [\B, #16]
- sfi_breg dst, \
- strd C_l, C_h, [\B, #24]
- sfi_breg src, \
- ldrd C_l, C_h, [\B, #24]
- sfi_breg dst, \
- strd D_l, D_h, [\B, #32]
- sfi_breg src, \
- ldrd D_l, D_h, [\B, #32]
+ strd A_l, A_h, [dst, #8]
+ ldrd A_l, A_h, [src, #8]
+ strd B_l, B_h, [dst, #16]
+ ldrd B_l, B_h, [src, #16]
+ strd C_l, C_h, [dst, #24]
+ ldrd C_l, C_h, [src, #24]
+ strd D_l, D_h, [dst, #32]
+ ldrd D_l, D_h, [src, #32]
bcs 2b
/* Save the remaining bytes and restore the callee-saved regs. */
- sfi_breg dst, \
- strd A_l, A_h, [\B, #40]
+ strd A_l, A_h, [dst, #40]
add src, src, #40
- sfi_breg dst, \
- strd B_l, B_h, [\B, #48]
+ strd B_l, B_h, [dst, #48]
ldrd B_l, B_h, [sp, #8]
cfi_restore (B_l)
cfi_restore (B_h)
- sfi_breg dst, \
- strd C_l, C_h, [\B, #56]
+ strd C_l, C_h, [dst, #56]
ldrd C_l, C_h, [sp, #16]
cfi_restore (C_l)
cfi_restore (C_h)
- sfi_breg dst, \
- strd D_l, D_h, [\B, #64]
+ strd D_l, D_h, [dst, #64]
ldrd D_l, D_h, [sp, #24]
cfi_restore (D_l)
cfi_restore (D_h)
@@ -734,35 +595,29 @@ ENTRY(memcpy)
cfi_remember_state
.Lcpy_notaligned:
- sfi_pld src
- sfi_pld src, #64
+ pld [src, #0]
+ pld [src, #64]
/* There's at least 64 bytes to copy, but there is no mutual
alignment. */
/* Bring DST to 64-bit alignment. */
lsls tmp2, dst, #29
- sfi_pld src, #(2 * 64)
+ pld [src, #(2 * 64)]
beq 1f
rsbs tmp2, tmp2, #0
sub count, count, tmp2, lsr #29
- sfi_breg src, \
- ldrmi tmp1, [\B], #4
- sfi_breg dst, \
- strmi tmp1, [\B], #4
+ ldrmi tmp1, [src], #4
+ strmi tmp1, [dst], #4
lsls tmp2, tmp2, #2
- sfi_breg src, \
- ldrbne tmp1, [\B], #1
- sfi_breg src, \
- ldrhcs tmp2, [\B], #2
- sfi_breg dst, \
- strbne tmp1, [\B], #1
- sfi_breg dst, \
- strhcs tmp2, [\B], #2
+ ldrbne tmp1, [src], #1
+ ldrhcs tmp2, [src], #2
+ strbne tmp1, [dst], #1
+ strhcs tmp2, [dst], #2
1:
- sfi_pld src, #(3 * 64)
+ pld [src, #(3 * 64)]
subs count, count, #64
ldrmi tmp2, [sp], #FRAME_SIZE
bmi .Ltail63unaligned
- sfi_pld src, #(4 * 64)
+ pld [src, #(4 * 64)]
#ifdef USE_NEON
/* These need an extra layer of macro just to work around a
@@ -775,132 +630,88 @@ ENTRY(memcpy)
vst1.8 {\reglist}, [ALIGN (\basereg, 64)]!
.endm
- /* These are used by the NaCl sfi_breg macro. */
- .macro _sfi_breg_dmask_neon_load_multi reg
- _sfi_dmask \reg
- .endm
- .macro _sfi_breg_dmask_neon_store_multi reg
- _sfi_dmask \reg
- .endm
-
- sfi_breg src, neon_load_multi d0-d3, \B
- sfi_breg src, neon_load_multi d4-d7, \B
+ neon_load_multi d0-d3, src
+ neon_load_multi d4-d7, src
subs count, count, #64
bmi 2f
1:
- sfi_pld src, #(4 * 64)
- sfi_breg dst, neon_store_multi d0-d3, \B
- sfi_breg src, neon_load_multi d0-d3, \B
- sfi_breg dst, neon_store_multi d4-d7, \B
- sfi_breg src, neon_load_multi d4-d7, \B
+ pld [src, #(4 * 64)]
+ neon_store_multi d0-d3, dst
+ neon_load_multi d0-d3, src
+ neon_store_multi d4-d7, dst
+ neon_load_multi d4-d7, src
subs count, count, #64
bpl 1b
2:
- sfi_breg dst, neon_store_multi d0-d3, \B
- sfi_breg dst, neon_store_multi d4-d7, \B
+ neon_store_multi d0-d3, dst
+ neon_store_multi d4-d7, dst
ands count, count, #0x3f
#else
/* Use an SMS style loop to maximize the I/O bandwidth. */
sub src, src, #4
sub dst, dst, #8
subs tmp2, count, #64 /* Use tmp2 for count. */
- sfi_breg src, \
- ldr A_l, [\B, #4]
- sfi_breg src, \
- ldr A_h, [\B, #8]
+ ldr A_l, [src, #4]
+ ldr A_h, [src, #8]
strd B_l, B_h, [sp, #8]
cfi_rel_offset (B_l, 8)
cfi_rel_offset (B_h, 12)
- sfi_breg src, \
- ldr B_l, [\B, #12]
- sfi_breg src, \
- ldr B_h, [\B, #16]
+ ldr B_l, [src, #12]
+ ldr B_h, [src, #16]
strd C_l, C_h, [sp, #16]
cfi_rel_offset (C_l, 16)
cfi_rel_offset (C_h, 20)
- sfi_breg src, \
- ldr C_l, [\B, #20]
- sfi_breg src, \
- ldr C_h, [\B, #24]
+ ldr C_l, [src, #20]
+ ldr C_h, [src, #24]
strd D_l, D_h, [sp, #24]
cfi_rel_offset (D_l, 24)
cfi_rel_offset (D_h, 28)
- sfi_breg src, \
- ldr D_l, [\B, #28]
- sfi_breg src, \
- ldr D_h, [\B, #32]!
+ ldr D_l, [src, #28]
+ ldr D_h, [src, #32]!
b 1f
.p2align 6
2:
- sfi_pld src, #(5 * 64) - (32 - 4)
- sfi_breg dst, \
- strd A_l, A_h, [\B, #40]
- sfi_breg src, \
- ldr A_l, [\B, #36]
- sfi_breg src, \
- ldr A_h, [\B, #40]
- sfi_breg dst, \
- strd B_l, B_h, [\B, #48]
- sfi_breg src, \
- ldr B_l, [\B, #44]
- sfi_breg src, \
- ldr B_h, [\B, #48]
- sfi_breg dst, \
- strd C_l, C_h, [\B, #56]
- sfi_breg src, \
- ldr C_l, [\B, #52]
- sfi_breg src, \
- ldr C_h, [\B, #56]
- sfi_breg dst, \
- strd D_l, D_h, [\B, #64]!
- sfi_breg src, \
- ldr D_l, [\B, #60]
- sfi_breg src, \
- ldr D_h, [\B, #64]!
+ pld [src, #(5 * 64) - (32 - 4)]
+ strd A_l, A_h, [dst, #40]
+ ldr A_l, [src, #36]
+ ldr A_h, [src, #40]
+ strd B_l, B_h, [dst, #48]
+ ldr B_l, [src, #44]
+ ldr B_h, [src, #48]
+ strd C_l, C_h, [dst, #56]
+ ldr C_l, [src, #52]
+ ldr C_h, [src, #56]
+ strd D_l, D_h, [dst, #64]!
+ ldr D_l, [src, #60]
+ ldr D_h, [src, #64]!
subs tmp2, tmp2, #64
1:
- sfi_breg dst, \
- strd A_l, A_h, [\B, #8]
- sfi_breg src, \
- ldr A_l, [\B, #4]
- sfi_breg src, \
- ldr A_h, [\B, #8]
- sfi_breg dst, \
- strd B_l, B_h, [\B, #16]
- sfi_breg src, \
- ldr B_l, [\B, #12]
- sfi_breg src, \
- ldr B_h, [\B, #16]
- sfi_breg dst, \
- strd C_l, C_h, [\B, #24]
- sfi_breg src, \
- ldr C_l, [\B, #20]
- sfi_breg src, \
- ldr C_h, [\B, #24]
- sfi_breg dst, \
- strd D_l, D_h, [\B, #32]
- sfi_breg src, \
- ldr D_l, [\B, #28]
- sfi_breg src, \
- ldr D_h, [\B, #32]
+ strd A_l, A_h, [dst, #8]
+ ldr A_l, [src, #4]
+ ldr A_h, [src, #8]
+ strd B_l, B_h, [dst, #16]
+ ldr B_l, [src, #12]
+ ldr B_h, [src, #16]
+ strd C_l, C_h, [dst, #24]
+ ldr C_l, [src, #20]
+ ldr C_h, [src, #24]
+ strd D_l, D_h, [dst, #32]
+ ldr D_l, [src, #28]
+ ldr D_h, [src, #32]
bcs 2b
/* Save the remaining bytes and restore the callee-saved regs. */
- sfi_breg dst, \
- strd A_l, A_h, [\B, #40]
+ strd A_l, A_h, [dst, #40]
add src, src, #36
- sfi_breg dst, \
- strd B_l, B_h, [\B, #48]
+ strd B_l, B_h, [dst, #48]
ldrd B_l, B_h, [sp, #8]
cfi_restore (B_l)
cfi_restore (B_h)
- sfi_breg dst, \
- strd C_l, C_h, [\B, #56]
+ strd C_l, C_h, [dst, #56]
ldrd C_l, C_h, [sp, #16]
cfi_restore (C_l)
cfi_restore (C_h)
- sfi_breg dst, \
- strd D_l, D_h, [\B, #64]
+ strd D_l, D_h, [dst, #64]
ldrd D_l, D_h, [sp, #24]
cfi_restore (D_l)
cfi_restore (D_h)
diff --git a/sysdeps/arm/armv7/multiarch/memcpy_neon.S b/sysdeps/arm/armv7/multiarch/memcpy_neon.S
index e60d1cc0e1..1a8d8bbe9e 100644
--- a/sysdeps/arm/armv7/multiarch/memcpy_neon.S
+++ b/sysdeps/arm/armv7/multiarch/memcpy_neon.S
@@ -1,8 +1,8 @@
-#ifdef __ARM_NEON__
-/* Under __ARM_NEON__, this file defines memcpy directly. */
-libc_hidden_builtin_def (memcpy)
-#else
+/* For __ARM_NEON__ this file defines memcpy. */
+#ifndef __ARM_NEON__
# define memcpy __memcpy_neon
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(a)
#endif
#define MEMCPY_NEON
diff --git a/sysdeps/arm/armv7/multiarch/memcpy_vfp.S b/sysdeps/arm/armv7/multiarch/memcpy_vfp.S
index e008c041ed..d1e9ede439 100644
--- a/sysdeps/arm/armv7/multiarch/memcpy_vfp.S
+++ b/sysdeps/arm/armv7/multiarch/memcpy_vfp.S
@@ -1,7 +1,9 @@
-/* Under __ARM_NEON__, memcpy_neon.S defines memcpy directly
+/* Under __ARM_NEON__ memcpy_neon.S defines memcpy directly
and the __memcpy_vfp code will never be used. */
#ifndef __ARM_NEON__
# define MEMCPY_VFP
# define memcpy __memcpy_vfp
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(a)
# include "memcpy_impl.S"
#endif
diff --git a/sysdeps/arm/armv7/multiarch/rtld-memchr.S b/sysdeps/arm/armv7/multiarch/rtld-memchr.S
new file mode 100644
index 0000000000..ae8e5f04c4
--- /dev/null
+++ b/sysdeps/arm/armv7/multiarch/rtld-memchr.S
@@ -0,0 +1 @@
+#include <sysdeps/arm/armv6t2/memchr.S>
diff --git a/sysdeps/arm/armv7/multiarch/rtld-memcpy.S b/sysdeps/arm/armv7/multiarch/rtld-memcpy.S
new file mode 100644
index 0000000000..ca2387531b
--- /dev/null
+++ b/sysdeps/arm/armv7/multiarch/rtld-memcpy.S
@@ -0,0 +1 @@
+#include <sysdeps/arm/armv7/multiarch/memcpy_impl.S>
diff --git a/sysdeps/arm/armv7/strcmp.S b/sysdeps/arm/armv7/strcmp.S
index 5bcaf21ee2..2626fdf72e 100644
--- a/sysdeps/arm/armv7/strcmp.S
+++ b/sysdeps/arm/armv7/strcmp.S
@@ -1,5 +1,5 @@
/* strcmp implementation for ARMv7-A, optimized for Cortex-A15.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -83,8 +83,6 @@
#define syndrome tmp2
-#ifndef NO_THUMB
-/* This code is best on Thumb. */
.thumb
/* In Thumb code we can't use MVN with a register shift, but we do have ORN. */
@@ -94,27 +92,6 @@
.macro apply_mask data_reg, mask_reg
orn \data_reg, \data_reg, \mask_reg
.endm
-#else
-/* In ARM code we don't have ORN, but we can use MVN with a register shift. */
-.macro prepare_mask mask_reg, nbits_reg
- mvn \mask_reg, const_m1, S2HI \nbits_reg
-.endm
-.macro apply_mask data_reg, mask_reg
- orr \data_reg, \data_reg, \mask_reg
-.endm
-
-/* These clobber the condition codes, which the real Thumb cbz/cbnz
- instructions do not. But it doesn't matter for any of the uses here. */
-.macro cbz reg, label
- cmp \reg, #0
- beq \label
-.endm
-.macro cbnz reg, label
- cmp \reg, #0
- bne \label
-.endm
-#endif
-
/* Macro to compute and return the result value for word-aligned
cases. */
@@ -178,10 +155,8 @@
#endif
ENTRY (strcmp)
#if STRCMP_PRECHECK == 1
- sfi_breg src1, \
- ldrb r2, [\B]
- sfi_breg src2, \
- ldrb r3, [\B]
+ ldrb r2, [src1]
+ ldrb r3, [src2]
cmp r2, #1
it cs
cmpcs r2, r3
@@ -211,11 +186,9 @@ ENTRY (strcmp)
and tmp2, tmp1, #3
bic src2, src2, #7
lsl tmp2, tmp2, #3 /* Bytes -> bits. */
- sfi_breg src1, \
- ldrd data1a, data1b, [\B], #16
+ ldrd data1a, data1b, [src1], #16
tst tmp1, #4
- sfi_breg src2, \
- ldrd data2a, data2b, [\B], #16
+ ldrd data2a, data2b, [src2], #16
prepare_mask tmp1, tmp2
apply_mask data1a, tmp1
apply_mask data2a, tmp1
@@ -231,10 +204,8 @@ ENTRY (strcmp)
.p2align 5,,12 /* Don't start in the tail bytes of a cache line. */
.p2align 2 /* Always word aligned. */
.Lloop_aligned8:
- sfi_breg src1, \
- ldrd data1a, data1b, [\B], #16
- sfi_breg src2, \
- ldrd data2a, data2b, [\B], #16
+ ldrd data1a, data1b, [src1], #16
+ ldrd data2a, data2b, [src2], #16
.Lstart_realigned8:
uadd8 syndrome_b, data1a, const_m1 /* Only want GE bits, */
eor syndrome_a, data1a, data2a
@@ -245,10 +216,8 @@ ENTRY (strcmp)
sel syndrome_b, syndrome_b, const_m1
cbnz syndrome_b, .Ldiff_in_b
- sfi_breg src1, \
- ldrd data1a, data1b, [\B, #-8]
- sfi_breg src2, \
- ldrd data2a, data2b, [\B, #-8]
+ ldrd data1a, data1b, [src1, #-8]
+ ldrd data2a, data2b, [src2, #-8]
uadd8 syndrome_b, data1a, const_m1 /* Only want GE bits, */
eor syndrome_a, data1a, data2a
sel syndrome_a, syndrome_a, const_m1
@@ -279,19 +248,15 @@ ENTRY (strcmp)
/* Unrolled by a factor of 2, to reduce the number of post-increment
operations. */
.Lloop_aligned4:
- sfi_breg src1, \
- ldr data1, [\B], #8
- sfi_breg src2, \
- ldr data2, [\B], #8
+ ldr data1, [src1], #8
+ ldr data2, [src2], #8
.Lstart_realigned4:
uadd8 syndrome, data1, const_m1 /* Only need GE bits. */
eor syndrome, data1, data2
sel syndrome, syndrome, const_m1
cbnz syndrome, .Laligned4_done
- sfi_breg src1, \
- ldr data1, [\B, #-4]
- sfi_breg src2, \
- ldr data2, [\B, #-4]
+ ldr data1, [src1, #-4]
+ ldr data2, [src2, #-4]
uadd8 syndrome, data1, const_m1
eor syndrome, data1, data2
sel syndrome, syndrome, const_m1
@@ -307,11 +272,9 @@ ENTRY (strcmp)
masking off the unwanted loaded data to prevent a difference. */
lsl tmp1, tmp1, #3 /* Bytes -> bits. */
bic src1, src1, #3
- sfi_breg src1, \
- ldr data1, [\B], #8
+ ldr data1, [src1], #8
bic src2, src2, #3
- sfi_breg src2, \
- ldr data2, [\B], #8
+ ldr data2, [src2], #8
prepare_mask tmp1, tmp1
apply_mask data1, tmp1
@@ -324,30 +287,26 @@ ENTRY (strcmp)
sub src2, src2, tmp1
bic src1, src1, #3
lsls tmp1, tmp1, #31
- sfi_breg src1, \
- ldr data1, [\B], #4
+ ldr data1, [src1], #4
beq .Laligned_m2
bcs .Laligned_m1
#if STRCMP_PRECHECK == 0
- sfi_breg src2, \
- ldrb data2, [\B, #1]
+ ldrb data2, [src2, #1]
uxtb tmp1, data1, ror #BYTE1_OFFSET
subs tmp1, tmp1, data2
bne .Lmisaligned_exit
cbz data2, .Lmisaligned_exit
.Laligned_m2:
- sfi_breg src2, \
- ldrb data2, [\B, #2]
+ ldrb data2, [src2, #2]
uxtb tmp1, data1, ror #BYTE2_OFFSET
subs tmp1, tmp1, data2
bne .Lmisaligned_exit
cbz data2, .Lmisaligned_exit
.Laligned_m1:
- sfi_breg src2, \
- ldrb data2, [\B, #3]
+ ldrb data2, [src2, #3]
uxtb tmp1, data1, ror #BYTE3_OFFSET
subs tmp1, tmp1, data2
bne .Lmisaligned_exit
@@ -356,16 +315,14 @@ ENTRY (strcmp)
#else /* STRCMP_PRECHECK */
/* If we've done the pre-check, then we don't need to check the
first byte again here. */
- sfi_breg src2, \
- ldrb data2, [\B, #2]
+ ldrb data2, [src2, #2]
uxtb tmp1, data1, ror #BYTE2_OFFSET
subs tmp1, tmp1, data2
bne .Lmisaligned_exit
cbz data2, .Lmisaligned_exit
.Laligned_m2:
- sfi_breg src2, \
- ldrb data2, [\B, #3]
+ ldrb data2, [src2, #3]
uxtb tmp1, data1, ror #BYTE3_OFFSET
subs tmp1, tmp1, data2
bne .Lmisaligned_exit
@@ -391,13 +348,11 @@ ENTRY (strcmp)
cfi_restore_state
/* src1 is word aligned, but src2 has no common alignment
with it. */
- sfi_breg src1, \
- ldr data1, [\B], #4
+ ldr data1, [src1], #4
lsls tmp1, src2, #31 /* C=src2[1], Z=src2[0]. */
bic src2, src2, #3
- sfi_breg src2, \
- ldr data2, [\B], #4
+ ldr data2, [src2], #4
bhi .Loverlap1 /* C=1, Z=0 => src2[1:0] = 0b11. */
bcs .Loverlap2 /* C=1, Z=1 => src2[1:0] = 0b10. */
@@ -409,13 +364,11 @@ ENTRY (strcmp)
sel syndrome, syndrome, const_m1
bne 4f
cbnz syndrome, 5f
- sfi_breg src2, \
- ldr data2, [\B], #4
+ ldr data2, [src2], #4
eor tmp1, tmp1, data1
cmp tmp1, data2, S2HI #24
bne 6f
- sfi_breg src1, \
- ldr data1, [\B], #4
+ ldr data1, [src1], #4
b .Loverlap3
4:
S2LO data2, data2, #8
@@ -427,8 +380,7 @@ ENTRY (strcmp)
/* We can only get here if the MSB of data1 contains 0, so
fast-path the exit. */
- sfi_breg src2, \
- ldrb result, [\B]
+ ldrb result, [src2]
ldrd r4, r5, [sp], #16
cfi_remember_state
cfi_def_cfa_offset (0)
@@ -454,13 +406,11 @@ ENTRY (strcmp)
sel syndrome, syndrome, const_m1
bne 4f
cbnz syndrome, 5f
- sfi_breg src2, \
- ldr data2, [\B], #4
+ ldr data2, [src2], #4
eor tmp1, tmp1, data1
cmp tmp1, data2, S2HI #16
bne 6f
- sfi_breg src1, \
- ldr data1, [\B], #4
+ ldr data1, [src1], #4
b .Loverlap2
4:
S2LO data2, data2, #16
@@ -469,8 +419,7 @@ ENTRY (strcmp)
ands syndrome, syndrome, const_m1, S2LO #16
bne .Lstrcmp_done_equal
- sfi_breg src2, \
- ldrh data2, [\B]
+ ldrh data2, [src2]
S2LO data1, data1, #16
#ifdef __ARM_BIG_ENDIAN
lsl data2, data2, #16
@@ -490,13 +439,11 @@ ENTRY (strcmp)
sel syndrome, syndrome, const_m1
bne 4f
cbnz syndrome, 5f
- sfi_breg src2, \
- ldr data2, [\B], #4
+ ldr data2, [src2], #4
eor tmp1, tmp1, data1
cmp tmp1, data2, S2HI #8
bne 6f
- sfi_breg src1, \
- ldr data1, [\B], #4
+ ldr data1, [src1], #4
b .Loverlap1
4:
S2LO data2, data2, #24
@@ -504,8 +451,7 @@ ENTRY (strcmp)
5:
tst syndrome, #LSB
bne .Lstrcmp_done_equal
- sfi_breg src2, \
- ldr data2, [\B]
+ ldr data2, [src2]
6:
S2LO data1, data1, #8
bic data2, data2, #MSB
diff --git a/sysdeps/arm/atomic-machine.h b/sysdeps/arm/atomic-machine.h
index dd5e7141a4..ddc30198bf 100644
--- a/sysdeps/arm/atomic-machine.h
+++ b/sysdeps/arm/atomic-machine.h
@@ -1,5 +1,5 @@
/* Atomic operations. Pure ARM version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,6 +35,7 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+#define ATOMIC_EXCHANGE_USES_CAS 1
void __arm_link_error (void);
@@ -87,10 +88,6 @@ void __arm_link_error (void);
/* Compare and exchange with "release" semantics, ie barrier before. */
-# define atomic_compare_and_exchange_bool_rel(mem, new, old) \
- __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
- mem, new, old, __ATOMIC_RELEASE)
-
# define atomic_compare_and_exchange_val_rel(mem, new, old) \
__atomic_val_bysize (__arch_compare_and_exchange_val, int, \
mem, new, old, __ATOMIC_RELEASE)
diff --git a/sysdeps/arm/backtrace.c b/sysdeps/arm/backtrace.c
index a06a01a996..e27d3d1391 100644
--- a/sysdeps/arm/backtrace.c
+++ b/sysdeps/arm/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kazu Hirata <kazu@codesourcery.com>, 2008.
diff --git a/sysdeps/arm/bits/fenv.h b/sysdeps/arm/bits/fenv.h
index 8e89fc1819..766b310efd 100644
--- a/sysdeps/arm/bits/fenv.h
+++ b/sysdeps/arm/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -80,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/bits/link.h b/sysdeps/arm/bits/link.h
index 6446decaf3..97ddca79f7 100644
--- a/sysdeps/arm/bits/link.h
+++ b/sysdeps/arm/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/bits/mathdef.h b/sysdeps/arm/bits/mathdef.h
deleted file mode 100644
index ae0bcb7bf5..0000000000
--- a/sysdeps/arm/bits/mathdef.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* 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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* GCC does not promote `float' values to `double'. */
-typedef float float_t; /* `float' expressions are evaluated as
- `float'. */
-typedef double double_t; /* `double' expressions are evaluated as
- `double'. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647)
-# define FP_ILOGBNAN (2147483647)
-
-/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l}
- builtins are supported. */
-# ifdef __FP_FAST_FMA
-# define FP_FAST_FMA 1
-# endif
-
-# ifdef __FP_FAST_FMAF
-# define FP_FAST_FMAF 1
-# endif
-
-# ifdef __FP_FAST_FMAL
-# define FP_FAST_FMAL 1
-# endif
-
-#endif /* ISO C99 */
-
-#ifndef __NO_LONG_DOUBLE_MATH
-/* Signal that we do not really have a `long double'. This disables the
- declaration of all the `long double' function variants. */
-# define __NO_LONG_DOUBLE_MATH 1
-#endif
diff --git a/sysdeps/arm/bits/setjmp.h b/sysdeps/arm/bits/setjmp.h
index ba0ea9208e..952a623111 100644
--- a/sysdeps/arm/bits/setjmp.h
+++ b/sysdeps/arm/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/bsd-_setjmp.S b/sysdeps/arm/bsd-_setjmp.S
index 51d3d975c7..ae93d3d97d 100644
--- a/sysdeps/arm/bsd-_setjmp.S
+++ b/sysdeps/arm/bsd-_setjmp.S
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. ARM version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/bsd-setjmp.S b/sysdeps/arm/bsd-setjmp.S
index f8a5229a27..06efc79b85 100644
--- a/sysdeps/arm/bsd-setjmp.S
+++ b/sysdeps/arm/bsd-setjmp.S
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. ARM version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/crti.S b/sysdeps/arm/crti.S
index abbc76d572..a1424d0333 100644
--- a/sysdeps/arm/crti.S
+++ b/sysdeps/arm/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for ARM.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -78,6 +78,7 @@ call_weak_fn:
.section .init,"ax",%progbits
.p2align 2
.globl _init
+ .hidden _init
.type _init, %function
_init:
push {r3, lr}
@@ -90,6 +91,7 @@ _init:
.section .fini,"ax",%progbits
.p2align 2
.globl _fini
+ .hidden _fini
.type _fini, %function
_fini:
push {r3, lr}
diff --git a/sysdeps/arm/crtn.S b/sysdeps/arm/crtn.S
index b8c2359d2f..26027693ce 100644
--- a/sysdeps/arm/crtn.S
+++ b/sysdeps/arm/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for ARM.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/dl-irel.h b/sysdeps/arm/dl-irel.h
index d5374e79f5..a7b6456075 100644
--- a/sysdeps/arm/dl-irel.h
+++ b/sysdeps/arm/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
ARM version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/dl-lookupcfg.h b/sysdeps/arm/dl-lookupcfg.h
index 460dc2b187..7e8fafc8a6 100644
--- a/sysdeps/arm/dl-lookupcfg.h
+++ b/sysdeps/arm/dl-lookupcfg.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,6 @@
struct link_map;
-extern void internal_function _dl_unmap (struct link_map *map);
+extern void _dl_unmap (struct link_map *map);
#define DL_UNMAP(map) _dl_unmap (map)
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index 0905adda7a..1a4fd3f17b 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. ARM version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,14 +53,29 @@ elf_machine_dynamic (void)
static inline Elf32_Addr __attribute__ ((unused))
elf_machine_load_address (void)
{
- extern Elf32_Addr internal_function __dl_start (void *) asm ("_dl_start");
- Elf32_Addr got_addr = (Elf32_Addr) &__dl_start;
Elf32_Addr pcrel_addr;
+#ifdef SHARED
+ extern Elf32_Addr __dl_start (void *) asm ("_dl_start");
+ Elf32_Addr got_addr = (Elf32_Addr) &__dl_start;
+ asm ("adr %0, _dl_start" : "=r" (pcrel_addr));
+#else
+ extern Elf32_Addr __dl_relocate_static_pie (void *)
+ asm ("_dl_relocate_static_pie") attribute_hidden;
+ Elf32_Addr got_addr = (Elf32_Addr) &__dl_relocate_static_pie;
+ asm ("adr %0, _dl_relocate_static_pie" : "=r" (pcrel_addr));
+#endif
#ifdef __thumb__
- /* Clear the low bit of the funciton address. */
+ /* Clear the low bit of the function address.
+
+ NOTE: got_addr is from GOT table whose lsb is always set by linker if it's
+ Thumb function address. PCREL_ADDR comes from PC-relative calculation
+ which will finish during assembling. GAS assembler before the fix for
+ PR gas/21458 was not setting the lsb but does after that. Always do the
+ strip for both, so the code works with various combinations of glibc and
+ Binutils. */
got_addr &= ~(Elf32_Addr) 1;
+ pcrel_addr &= ~(Elf32_Addr) 1;
#endif
- asm ("adr %0, _dl_start" : "=r" (pcrel_addr));
return pcrel_addr - got_addr;
}
@@ -112,10 +127,6 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
got[2] = (Elf32_Addr) &_dl_runtime_resolve;
}
- if (l->l_info[ADDRIDX (DT_TLSDESC_GOT)] && lazy)
- *(Elf32_Addr*)(D_PTR (l, l_info[ADDRIDX (DT_TLSDESC_GOT)]) + l->l_addr)
- = (Elf32_Addr) &_dl_tlsdesc_lazy_resolver;
-
return lazy;
}
@@ -263,6 +274,7 @@ dl_platform_init (void)
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rel *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
@@ -380,7 +392,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
{
const Elf32_Sym *const refsym = sym;
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
@@ -440,7 +452,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
binding found in the user program or a loaded library
rather than the dynamic linker's built-in definitions
used while loading those libraries. */
- value -= map->l_addr + refsym->st_value;
+ value -= SYMBOL_ADDRESS (map, refsym, true);
# endif
/* Support relocations on mis-aligned offsets. */
((struct unaligned *) reloc_addr)->x += value;
@@ -448,8 +460,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
}
case R_ARM_TLS_DESC:
{
- struct tlsdesc volatile *td =
- (struct tlsdesc volatile *)reloc_addr;
+ struct tlsdesc *td = (struct tlsdesc *)reloc_addr;
# ifndef RTLD_BOOTSTRAP
if (! sym)
@@ -542,7 +553,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *const refsym = sym;
# endif
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
@@ -578,32 +589,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
case R_ARM_ABS32:
*reloc_addr = value + reloc->r_addend;
break;
-# ifdef RESOLVE_CONFLICT_FIND_MAP
- case R_ARM_TLS_DESC:
- {
- struct tlsdesc volatile *td =
- (struct tlsdesc volatile *) reloc_addr;
-
- RESOLVE_CONFLICT_FIND_MAP (map, reloc_addr);
-
- /* Make sure we know what's going on. */
- assert (td->entry
- == (void *) (D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)])
- + map->l_addr));
- assert (map->l_info[ADDRIDX (DT_TLSDESC_GOT)]);
-
- /* Set up the lazy resolver and store the pointer to our link
- map in _GLOBAL_OFFSET_TABLE[1] now as for a prelinked
- binary elf_machine_runtime_setup() is not called and hence
- neither has been initialized. */
- *(Elf32_Addr *) (D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_GOT)])
- + map->l_addr)
- = (Elf32_Addr) &_dl_tlsdesc_lazy_resolver;
- ((Elf32_Addr *) D_PTR (map, l_info[DT_PLTGOT]))[1]
- = (Elf32_Addr) map;
- }
- break;
-# endif /* RESOLVE_CONFLICT_FIND_MAP */
case R_ARM_PC24:
relocate_pc24 (map, value, reloc_addr, reloc->r_addend);
break;
@@ -679,17 +664,21 @@ elf_machine_lazy_rel (struct link_map *map,
}
else if (__builtin_expect (r_type == R_ARM_TLS_DESC, 1))
{
- struct tlsdesc volatile *td =
- (struct tlsdesc volatile *)reloc_addr;
-
- /* The linker must have given us the parameter we need in the
- first GOT entry, and left the second one empty. The latter
- will have been preset by the prelinker if used though.
- We fill it with the resolver address. */
- assert (td->entry == 0
- || map->l_info[VALIDX (DT_GNU_PRELINKED)] != NULL);
- td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)])
- + map->l_addr);
+ const Elf_Symndx symndx = ELFW (R_SYM) (reloc->r_info);
+ const ElfW (Sym) *symtab = (const void *)D_PTR (map, l_info[DT_SYMTAB]);
+ const ElfW (Sym) *sym = &symtab[symndx];
+ const struct r_found_version *version = NULL;
+
+ if (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL)
+ {
+ const ElfW (Half) *vernum =
+ (const void *)D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]);
+ version = &map->l_versions[vernum[symndx] & 0x7fff];
+ }
+
+ /* Always initialize TLS descriptors completely, because lazy
+ initialization requires synchronization at every TLS access. */
+ elf_machine_rel (map, reloc, sym, version, reloc_addr, skip_ifunc);
}
else
_dl_reloc_bad_type (map, r_type, 1);
diff --git a/sysdeps/arm/dl-sysdep.h b/sysdeps/arm/dl-sysdep.h
index f4b55da765..eef6b38162 100644
--- a/sysdeps/arm/dl-sysdep.h
+++ b/sysdeps/arm/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. Alpha version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/dl-tls.h b/sysdeps/arm/dl-tls.h
index ed2efe8c18..b591c6b095 100644
--- a/sysdeps/arm/dl-tls.h
+++ b/sysdeps/arm/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. ARM version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,3 @@ typedef struct dl_tls_index
extern void *__tls_get_addr (tls_index *ti);
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/arm/dl-tlsdesc.S b/sysdeps/arm/dl-tlsdesc.S
index 0429b0106c..056e17d52d 100644
--- a/sysdeps/arm/dl-tlsdesc.S
+++ b/sysdeps/arm/dl-tlsdesc.S
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. ARM version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,8 +32,7 @@
eabi_fnstart
.align 2
_dl_tlsdesc_return:
- sfi_breg r0, \
- ldr r0, [\B]
+ ldr r0, [r0]
BX (lr)
eabi_fnend
cfi_endproc
@@ -92,30 +91,23 @@ _dl_tlsdesc_dynamic:
cfi_rel_offset (r3,4)
cfi_rel_offset (r4,8)
cfi_rel_offset (lr,12)
- sfi_breg r0, \
- ldr r1, [\B] /* td */
+ ldr r1, [r0] /* td */
GET_TLS (lr)
mov r4, r0 /* r4 = tp */
- sfi_breg r0, \
- ldr r0, [\B]
- sfi_breg r1, \
- ldr r2, [\B, #8] /* gen_count */
- sfi_breg r0, \
- ldr r3, [\B]
+ ldr r0, [r0]
+ ldr r2, [r1, #8] /* gen_count */
+ ldr r3, [r0]
cmp r2, r3
bhi 1f
- sfi_breg r1, \
- ldr r3, [\B]
+ ldr r3, [r1]
#ifndef ARM_NO_INDEX_REGISTER
ldr r2, [r0, r3, lsl #3]
#else
add lr, r0, r3, lsl #3
- sfi_breg lr, \
- ldr r2, [\B]
+ ldr r2, [lr]
#endif
cmn r2, #1
ittt ne
- sfi_breg r1, \
ldrne r3, [r1, #4]
addne r3, r2, r3
rsbne r0, r4, r3
@@ -140,89 +132,3 @@ _dl_tlsdesc_dynamic:
cfi_endproc
.size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic
#endif /* SHARED */
-
-/* lazy resolved for tls descriptors. */
- .hidden _dl_tlsdesc_lazy_resolver
- .global _dl_tlsdesc_lazy_resolver
- .type _dl_tlsdesc_lazy_resolver,#function
- cfi_startproc
- eabi_fnstart
- .align 2
-_dl_tlsdesc_lazy_resolver:
- /* r0 points at the tlsdesc,
- r1 points at the GOT
- r2 was pushed by the trampoline and used as a temp,
- we need to pop it here.
- We push the remaining call-clobbered registers here, and also
- R1 -- to keep the stack correctly aligned. */
- /* Tell the unwinder that r2 has already been pushed. */
- eabi_save ({r2})
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (r2, 0)
- eabi_save ({r0,r1,r3,ip,lr})
- push {r0, r1, r3, ip, lr}
- cfi_adjust_cfa_offset (20)
- cfi_rel_offset (r0, 0)
- cfi_rel_offset (r1, 4)
- cfi_rel_offset (r3, 8)
- cfi_rel_offset (ip, 12)
- cfi_rel_offset (lr, 16)
- bl _dl_tlsdesc_lazy_resolver_fixup
- pop {r0, r1, r3, ip, lr}
- cfi_adjust_cfa_offset (-20)
- cfi_restore (lr)
- cfi_restore (ip)
- cfi_restore (r3)
- cfi_restore (r1)
- cfi_restore (r0)
- pop {r2}
- cfi_adjust_cfa_offset (-4)
- cfi_restore (r2)
- sfi_breg r0, \
- ldr r1, [\B, #4]
- BX (r1)
- eabi_fnend
- cfi_endproc
- .size _dl_tlsdesc_lazy_resolver, .-_dl_tlsdesc_lazy_resolver
-
-/* Holder for lazy tls descriptors being resolve in another thread.
-
- Our calling convention is to clobber r0, r1 and the processor
- flags. All others that are modified must be saved */
- .hidden _dl_tlsdesc_resolve_hold
- .global _dl_tlsdesc_resolve_hold
- .type _dl_tlsdesc_resolve_hold,#function
- cfi_startproc
- eabi_fnstart
- .align 2
-_dl_tlsdesc_resolve_hold:
- /* r0 is saved so its original value can be used after the call and
- r1 is saved only to keep the stack aligned. (r0 points to the tls
- descriptor, it is passed to _dl_tlsdesc_resolve_hold_fixup which
- is a void function that may clobber r0, later r0 is used to load
- the new resolver.) */
- eabi_save ({r0,r1,r2,r3,ip,lr})
- push {r0, r1, r2, r3, ip, lr}
- cfi_adjust_cfa_offset (24)
- cfi_rel_offset (r0, 0)
- cfi_rel_offset (r1, 4)
- cfi_rel_offset (r2, 8)
- cfi_rel_offset (r3, 12)
- cfi_rel_offset (ip, 16)
- cfi_rel_offset (lr, 20)
- adr r1, _dl_tlsdesc_resolve_hold
- bl _dl_tlsdesc_resolve_hold_fixup
- pop {r0, r1, r2, r3, ip, lr}
- cfi_adjust_cfa_offset (-24)
- cfi_restore (lr)
- cfi_restore (ip)
- cfi_restore (r3)
- cfi_restore (r2)
- cfi_restore (r1)
- cfi_restore (r0)
- sfi_breg r0, \
- ldr r1, [\B, #4]
- BX (r1)
- eabi_fnend
- cfi_endproc
- .size _dl_tlsdesc_resolve_hold, .-_dl_tlsdesc_resolve_hold
diff --git a/sysdeps/arm/dl-tlsdesc.h b/sysdeps/arm/dl-tlsdesc.h
index b4949943cc..fc8c5b4ee6 100644
--- a/sysdeps/arm/dl-tlsdesc.h
+++ b/sysdeps/arm/dl-tlsdesc.h
@@ -1,6 +1,6 @@
/* Thread-local storage descriptor handling in the ELF dynamic linker.
ARM version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -48,9 +48,7 @@ struct tlsdesc_dynamic_arg
extern ptrdiff_t attribute_hidden
_dl_tlsdesc_return(struct tlsdesc *),
- _dl_tlsdesc_undefweak(struct tlsdesc *),
- _dl_tlsdesc_resolve_hold(struct tlsdesc *),
- _dl_tlsdesc_lazy_resolver(struct tlsdesc *);
+ _dl_tlsdesc_undefweak(struct tlsdesc *);
# ifdef SHARED
extern void *_dl_make_tlsdesc_dynamic (struct link_map *map, size_t ti_offset);
diff --git a/sysdeps/arm/dl-trampoline.S b/sysdeps/arm/dl-trampoline.S
index 3c75be738e..c731b01286 100644
--- a/sysdeps/arm/dl-trampoline.S
+++ b/sysdeps/arm/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. ARM version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/e_sqrt.c b/sysdeps/arm/e_sqrt.c
new file mode 100644
index 0000000000..44e0414306
--- /dev/null
+++ b/sysdeps/arm/e_sqrt.c
@@ -0,0 +1,45 @@
+/* Compute square root for double. ARM version.
+ Copyright (C) 2016-2018 Free Software 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..e7c3072235
--- /dev/null
+++ b/sysdeps/arm/e_sqrtf.c
@@ -0,0 +1,45 @@
+/* Compute square root for float. ARM version.
+ Copyright (C) 2016-2018 Free Software 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/fclrexcpt.c b/sysdeps/arm/fclrexcpt.c
index 4db79bf1f6..61933581d1 100644
--- a/sysdeps/arm/fclrexcpt.c
+++ b/sysdeps/arm/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/fedisblxcpt.c b/sysdeps/arm/fedisblxcpt.c
index f16a3e8961..d4d683b027 100644
--- a/sysdeps/arm/fedisblxcpt.c
+++ b/sysdeps/arm/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>, 2001.
diff --git a/sysdeps/arm/feenablxcpt.c b/sysdeps/arm/feenablxcpt.c
index f4e36f582e..a0d70455ab 100644
--- a/sysdeps/arm/feenablxcpt.c
+++ b/sysdeps/arm/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>, 2001.
diff --git a/sysdeps/arm/fegetenv.c b/sysdeps/arm/fegetenv.c
index ac2db2d99c..3b0af8da59 100644
--- a/sysdeps/arm/fegetenv.c
+++ b/sysdeps/arm/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/fegetexcept.c b/sysdeps/arm/fegetexcept.c
index 42ae7554f2..c788b603e8 100644
--- a/sysdeps/arm/fegetexcept.c
+++ b/sysdeps/arm/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get floating-point exceptions.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>, 2001
diff --git a/sysdeps/arm/fegetmode.c b/sysdeps/arm/fegetmode.c
new file mode 100644
index 0000000000..c2297e26e7
--- /dev/null
+++ b/sysdeps/arm/fegetmode.c
@@ -0,0 +1,29 @@
+/* Store current floating-point control modes. ARM version.
+ Copyright (C) 2016-2018 Free Software 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/fegetround.c b/sysdeps/arm/fegetround.c
index cdc4f934f9..610fb16827 100644
--- a/sysdeps/arm/fegetround.c
+++ b/sysdeps/arm/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/feholdexcpt.c b/sysdeps/arm/feholdexcpt.c
index 2a0edfdd94..8c146af1c4 100644
--- a/sysdeps/arm/feholdexcpt.c
+++ b/sysdeps/arm/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/fenv_private.h b/sysdeps/arm/fenv_private.h
index b28a50f8b5..55157c8ae2 100644
--- a/sysdeps/arm/fenv_private.h
+++ b/sysdeps/arm/fenv_private.h
@@ -1,5 +1,5 @@
/* Private floating point rounding and exceptions handling. ARM VFP version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/fesetenv.c b/sysdeps/arm/fesetenv.c
index 6dbce2abc5..6c3475a479 100644
--- a/sysdeps/arm/fesetenv.c
+++ b/sysdeps/arm/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/fesetexcept.c b/sysdeps/arm/fesetexcept.c
new file mode 100644
index 0000000000..38557aaaac
--- /dev/null
+++ b/sysdeps/arm/fesetexcept.c
@@ -0,0 +1,38 @@
+/* Set given exception flags. ARM version.
+ Copyright (C) 2016-2018 Free Software 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..1ba825416e
--- /dev/null
+++ b/sysdeps/arm/fesetmode.c
@@ -0,0 +1,45 @@
+/* Install given floating-point control modes. ARM version.
+ Copyright (C) 2016-2018 Free Software 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/fesetround.c b/sysdeps/arm/fesetround.c
index ec6bc2d047..379dfdca9d 100644
--- a/sysdeps/arm/fesetround.c
+++ b/sysdeps/arm/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/feupdateenv.c b/sysdeps/arm/feupdateenv.c
index 8ec7b2912a..de71695c23 100644
--- a/sysdeps/arm/feupdateenv.c
+++ b/sysdeps/arm/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/arm/fgetexcptflg.c b/sysdeps/arm/fgetexcptflg.c
index fb43ef4c83..8e831e979d 100644
--- a/sysdeps/arm/fgetexcptflg.c
+++ b/sysdeps/arm/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/arm/find_exidx.c b/sysdeps/arm/find_exidx.c
index 657d67ec96..f6f2290aaf 100644
--- a/sysdeps/arm/find_exidx.c
+++ b/sysdeps/arm/find_exidx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/fix-fp-int-convert-overflow.h b/sysdeps/arm/fix-fp-int-convert-overflow.h
index c5ec50a433..3942e5b2c2 100644
--- a/sysdeps/arm/fix-fp-int-convert-overflow.h
+++ b/sysdeps/arm/fix-fp-int-convert-overflow.h
@@ -1,5 +1,5 @@
/* Fix for conversion of floating point to integer overflow. ARM version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/fpu_control.h b/sysdeps/arm/fpu_control.h
index 0fe532a797..6b1b176eae 100644
--- a/sysdeps/arm/fpu_control.h
+++ b/sysdeps/arm/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word definitions. ARM VFP version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,12 +53,19 @@ extern fpu_control_t __fpu_control;
typedef unsigned int fpu_control_t;
/* Macros for accessing the hardware control word. */
+#ifdef __SOFTFP__
/* This is fmrx %0, fpscr. */
-#define _FPU_GETCW(cw) \
+# define _FPU_GETCW(cw) \
__asm__ __volatile__ ("mrc p10, 7, %0, cr1, cr0, 0" : "=r" (cw))
/* This is fmxr fpscr, %0. */
-#define _FPU_SETCW(cw) \
+# define _FPU_SETCW(cw) \
__asm__ __volatile__ ("mcr p10, 7, %0, cr1, cr0, 0" : : "r" (cw))
+#else
+# define _FPU_GETCW(cw) \
+ __asm__ __volatile__ ("vmrs %0, fpscr" : "=r" (cw))
+# define _FPU_SETCW(cw) \
+ __asm__ __volatile__ ("vmsr fpscr, %0" : : "r" (cw))
+#endif
/* Default control word set at startup. */
extern fpu_control_t __fpu_control;
diff --git a/sysdeps/arm/fraiseexcpt.c b/sysdeps/arm/fraiseexcpt.c
index 0317e2a745..2558b21204 100644
--- a/sysdeps/arm/fraiseexcpt.c
+++ b/sysdeps/arm/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/frame.h b/sysdeps/arm/frame.h
deleted file mode 100644
index 6b96aee542..0000000000
--- a/sysdeps/arm/frame.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Definition of stack frame structure. ARM/APCS version.
- Copyright (C) 2000-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 is the APCS stack backtrace structure. */
-struct layout
-{
- struct layout *next;
- void *sp;
- void *return_address;
-};
-
-#define FIRST_FRAME_POINTER ADVANCE_STACK_FRAME (__builtin_frame_address (0))
diff --git a/sysdeps/arm/fsetexcptflg.c b/sysdeps/arm/fsetexcptflg.c
index dd7507b48e..409ed2e98f 100644
--- a/sysdeps/arm/fsetexcptflg.c
+++ b/sysdeps/arm/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/ftestexcept.c b/sysdeps/arm/ftestexcept.c
index d871a9b6fc..3927c03acd 100644
--- a/sysdeps/arm/ftestexcept.c
+++ b/sysdeps/arm/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/gcc-compat.h b/sysdeps/arm/gcc-compat.h
index fdff40bad7..99bc8c4fa5 100644
--- a/sysdeps/arm/gcc-compat.h
+++ b/sysdeps/arm/gcc-compat.h
@@ -1,5 +1,5 @@
/* Macros for checking required GCC compatibility. ARM version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/gccframe.h b/sysdeps/arm/gccframe.h
index bf045b1100..dcfc60bac6 100644
--- a/sysdeps/arm/gccframe.h
+++ b/sysdeps/arm/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. arm version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/get-rounding-mode.h b/sysdeps/arm/get-rounding-mode.h
index 796f1584c9..303147b507 100644
--- a/sysdeps/arm/get-rounding-mode.h
+++ b/sysdeps/arm/get-rounding-mode.h
@@ -1,5 +1,5 @@
/* Determine floating-point rounding mode within libc. ARM version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/gmp-mparam.h b/sysdeps/arm/gmp-mparam.h
index 6fa7a65a8c..2efeda260e 100644
--- a/sysdeps/arm/gmp-mparam.h
+++ b/sysdeps/arm/gmp-mparam.h
@@ -1,6 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright (C) 1991-2016 Free Software Foundation, Inc.
+Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/arm/include/bits/setjmp.h b/sysdeps/arm/include/bits/setjmp.h
index 66751213b5..b9e14d7477 100644
--- a/sysdeps/arm/include/bits/setjmp.h
+++ b/sysdeps/arm/include/bits/setjmp.h
@@ -1,5 +1,5 @@
/* Private jmp_buf-related definitions. ARM EABI version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/jmpbuf-unwind.h b/sysdeps/arm/jmpbuf-unwind.h
index 25ea810b31..d7405b7643 100644
--- a/sysdeps/arm/jmpbuf-unwind.h
+++ b/sysdeps/arm/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/ldbl-classify-compat.h b/sysdeps/arm/ldbl-classify-compat.h
new file mode 100644
index 0000000000..f3f10607ca
--- /dev/null
+++ b/sysdeps/arm/ldbl-classify-compat.h
@@ -0,0 +1,8 @@
+#ifndef ARM_LDBL_CLASSIFY_COMPAT_H
+#define ARM_LDBL_CLASSIFY_COMPAT_H 1
+
+/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
+ when built without long double support. */
+#define LDBL_CLASSIFY_COMPAT 1
+
+#endif
diff --git a/sysdeps/arm/ldsodefs.h b/sysdeps/arm/ldsodefs.h
index 1e9e25218e..ce5d625c56 100644
--- a/sysdeps/arm/ldsodefs.h
+++ b/sysdeps/arm/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/libc-tls.c b/sysdeps/arm/libc-tls.c
index 8422296348..15bc3dad11 100644
--- a/sysdeps/arm/libc-tls.c
+++ b/sysdeps/arm/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. ARM version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/libm-test-ulps b/sysdeps/arm/libm-test-ulps
index aa3d696863..e62cca3e03 100644
--- a/sysdeps/arm/libm-test-ulps
+++ b/sysdeps/arm/libm-test-ulps
@@ -184,15 +184,15 @@ idouble: 1
ifloat: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: Imaginary part of "cacos_downward":
@@ -202,9 +202,9 @@ idouble: 5
ifloat: 3
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: Imaginary part of "cacos_towardzero":
@@ -220,15 +220,15 @@ idouble: 2
ifloat: 2
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Imaginary part of "cacosh":
@@ -244,10 +244,10 @@ idouble: 5
ifloat: 3
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: Real part of "cacosh_towardzero":
double: 5
@@ -256,9 +256,9 @@ idouble: 5
ifloat: 3
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: Real part of "cacosh_upward":
@@ -268,9 +268,9 @@ idouble: 4
ifloat: 4
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: "carg":
@@ -302,16 +302,16 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "casin_downward":
double: 5
@@ -332,21 +332,21 @@ idouble: 5
ifloat: 3
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Imaginary part of "casinh":
@@ -363,9 +363,9 @@ ifloat: 3
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
Function: Real part of "casinh_towardzero":
double: 5
@@ -380,19 +380,21 @@ idouble: 3
ifloat: 1
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Imaginary part of "catan":
@@ -403,9 +405,9 @@ ifloat: 1
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "catan_downward":
double: 2
@@ -415,18 +417,20 @@ ifloat: 2
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Real part of "catan_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Imaginary part of "catan_upward":
@@ -442,7 +446,9 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Real part of "catanh_downward":
@@ -459,9 +465,9 @@ ifloat: 2
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "catanh_towardzero":
double: 1
@@ -471,12 +477,14 @@ ifloat: 2
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
idouble: 4
-ifloat: 3
+ifloat: 4
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "cbrt":
@@ -671,9 +679,9 @@ ifloat: 2
Function: Real part of "clog10_downward":
double: 5
-float: 4
+float: 5
idouble: 5
-ifloat: 4
+ifloat: 5
Function: Imaginary part of "clog10_downward":
double: 2
@@ -742,7 +750,9 @@ idouble: 1
ifloat: 2
Function: "cos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "cos_downward":
@@ -789,9 +799,9 @@ ifloat: 2
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
Function: Imaginary part of "cpow":
float: 2
@@ -977,9 +987,9 @@ ifloat: 1
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Real part of "ctan_downward":
double: 6
@@ -989,9 +999,9 @@ ifloat: 5
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Real part of "ctan_towardzero":
double: 5
@@ -1007,9 +1017,9 @@ ifloat: 2
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
Function: Imaginary part of "ctan_upward":
double: 2
@@ -1019,9 +1029,9 @@ ifloat: 3
Function: Real part of "ctanh":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "ctanh":
double: 2
@@ -1031,9 +1041,9 @@ ifloat: 2
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
idouble: 4
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "ctanh_downward":
double: 6
@@ -1165,15 +1175,21 @@ ifloat: 1
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "expm1":
double: 1
@@ -1247,9 +1263,9 @@ ifloat: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
Function: "j0_towardzero":
double: 3
@@ -1271,9 +1287,9 @@ ifloat: 2
Function: "j1_downward":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
Function: "j1_towardzero":
double: 3
@@ -1426,29 +1442,9 @@ idouble: 1
ifloat: 2
Function: "pow":
+double: 1
float: 1
-ifloat: 1
-
-Function: "pow10":
-double: 2
-idouble: 2
-
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
+idouble: 1
ifloat: 1
Function: "pow_downward":
@@ -1470,7 +1466,9 @@ idouble: 1
ifloat: 1
Function: "sin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "sin_downward":
@@ -1492,7 +1490,9 @@ idouble: 1
ifloat: 2
Function: "sincos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "sincos_downward":
@@ -1615,9 +1615,9 @@ ifloat: 1
Function: "y0_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
Function: "y0_towardzero":
double: 3
@@ -1627,9 +1627,9 @@ ifloat: 3
Function: "y0_upward":
double: 3
-float: 4
+float: 5
idouble: 3
-ifloat: 4
+ifloat: 5
Function: "y1":
double: 3
@@ -1657,15 +1657,15 @@ ifloat: 2
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
Function: "yn_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
Function: "yn_towardzero":
double: 3
@@ -1675,8 +1675,8 @@ ifloat: 3
Function: "yn_upward":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
# end of automatic generation
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/machine-gmon.h b/sysdeps/arm/machine-gmon.h
index 48a8ff4744..a288c33bbe 100644
--- a/sysdeps/arm/machine-gmon.h
+++ b/sysdeps/arm/machine-gmon.h
@@ -1,5 +1,5 @@
/* Machine-dependent definitions for profiling support. ARM EABI version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,9 +24,9 @@
/* We must not pollute the global namespace. */
#define mcount_internal __mcount_internal
-extern void mcount_internal (u_long frompc, u_long selfpc) internal_function;
+extern void mcount_internal (u_long frompc, u_long selfpc);
#define _MCOUNT_DECL(frompc, selfpc) \
- void internal_function mcount_internal (u_long frompc, u_long selfpc)
+ void mcount_internal (u_long frompc, u_long selfpc)
/* Define MCOUNT as empty since we have the implementation in another file. */
diff --git a/sysdeps/arm/math-tests.h b/sysdeps/arm/math-tests.h
index a62b82246e..d4d68f39c9 100644
--- a/sysdeps/arm/math-tests.h
+++ b/sysdeps/arm/math-tests.h
@@ -1,5 +1,5 @@
/* Configuration for math tests. ARM version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/math_private.h b/sysdeps/arm/math_private.h
index d39e9ee24a..c175b15601 100644
--- a/sysdeps/arm/math_private.h
+++ b/sysdeps/arm/math_private.h
@@ -1,10 +1,6 @@
#ifndef ARM_MATH_PRIVATE_H
#define ARM_MATH_PRIVATE_H 1
-/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
- when built without long double support. */
-#define LDBL_CLASSIFY_COMPAT 1
-
#include "fenv_private.h"
#include_next <math_private.h>
diff --git a/sysdeps/arm/memcpy.S b/sysdeps/arm/memcpy.S
index db8ba50af3..cba8609813 100644
--- a/sysdeps/arm/memcpy.S
+++ b/sysdeps/arm/memcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by MontaVista Software, Inc. (written by Nicolas Pitre)
@@ -70,7 +70,7 @@ ENTRY(memcpy)
subs r2, r2, #4
blt 8f
ands ip, r0, #3
- PLD( sfi_pld r1, #0 )
+ PLD( pld [r1, #0] )
bne 9f
ands ip, r1, #3
bne 10f
@@ -97,19 +97,17 @@ ENTRY(memcpy)
CALGN( bx r4 )
#endif
- PLD( sfi_pld r1, #0 )
+ PLD( pld [r1, #0] )
2: PLD( subs r2, r2, #96 )
- PLD( sfi_pld r1, #28 )
+ PLD( pld [r1, #28] )
PLD( blt 4f )
- PLD( sfi_pld r1, #60 )
- PLD( sfi_pld r1, #92 )
+ PLD( pld [r1, #60] )
+ PLD( pld [r1, #92] )
-3: PLD( sfi_pld r1, #124 )
-4: sfi_breg r1, \
- ldmia \B!, {r3, r4, r5, r6, r7, r8, ip, lr}
+3: PLD( pld [r1, #124] )
+4: ldmia r1!, {r3, r4, r5, r6, r7, r8, ip, lr}
subs r2, r2, #32
- sfi_breg r0, \
- stmia \B!, {r3, r4, r5, r6, r7, r8, ip, lr}
+ stmia r0!, {r3, r4, r5, r6, r7, r8, ip, lr}
bge 3b
PLD( cmn r2, #96 )
PLD( bge 4b )
@@ -136,26 +134,19 @@ ENTRY(memcpy)
.p2align ARM_BX_ALIGN_LOG2
6: nop
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r3, [\B], #4
+ ldr r3, [r1], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r4, [\B], #4
+ ldr r4, [r1], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r5, [\B], #4
+ ldr r5, [r1], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r6, [\B], #4
+ ldr r6, [r1], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r7, [\B], #4
+ ldr r7, [r1], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r8, [\B], #4
+ ldr r8, [r1], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr lr, [\B], #4
+ ldr lr, [r1], #4
#ifndef ARM_ALWAYS_BX
add pc, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
@@ -172,26 +163,19 @@ ENTRY(memcpy)
.p2align ARM_BX_ALIGN_LOG2
66: nop
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r3, [\B], #4
+ str r3, [r0], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r4, [\B], #4
+ str r4, [r0], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r5, [\B], #4
+ str r5, [r0], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r6, [\B], #4
+ str r6, [r0], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r7, [\B], #4
+ str r7, [r0], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r8, [\B], #4
+ str r8, [r0], #4
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str lr, [\B], #4
+ str lr, [r0], #4
#ifdef ARM_ALWAYS_BX
pop {r10}
@@ -209,18 +193,12 @@ ENTRY(memcpy)
cfi_restore (r8)
8: movs r2, r2, lsl #31
- sfi_breg r1, \
- ldrbne r3, [\B], #1
- sfi_breg r1, \
- ldrbcs r4, [\B], #1
- sfi_breg r1, \
- ldrbcs ip, [\B]
- sfi_breg r0, \
- strbne r3, [\B], #1
- sfi_breg r0, \
- strbcs r4, [\B], #1
- sfi_breg r0, \
- strbcs ip, [\B]
+ ldrbne r3, [r1], #1
+ ldrbcs r4, [r1], #1
+ ldrbcs ip, [r1]
+ strbne r3, [r0], #1
+ strbcs r4, [r0], #1
+ strbcs ip, [r0]
#if ((defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)) \
|| defined (ARM_ALWAYS_BX))
@@ -237,27 +215,20 @@ ENTRY(memcpy)
9: rsb ip, ip, #4
cmp ip, #2
- sfi_breg r1, \
- ldrbgt r3, [\B], #1
- sfi_breg r1, \
- ldrbge r4, [\B], #1
- sfi_breg r1, \
- ldrb lr, [\B], #1
- sfi_breg r0, \
- strbgt r3, [\B], #1
- sfi_breg r0, \
- strbge r4, [\B], #1
+ ldrbgt r3, [r1], #1
+ ldrbge r4, [r1], #1
+ ldrb lr, [r1], #1
+ strbgt r3, [r0], #1
+ strbge r4, [r0], #1
subs r2, r2, ip
- sfi_breg r0, \
- strb lr, [\B], #1
+ strb lr, [r0], #1
blt 8b
ands ip, r1, #3
beq 1b
10: bic r1, r1, #3
cmp ip, #2
- sfi_breg r1, \
- ldr lr, [\B], #4
+ ldr lr, [r1], #4
beq 17f
bgt 18f
@@ -281,20 +252,18 @@ ENTRY(memcpy)
cfi_rel_offset (r8, 12)
cfi_rel_offset (r10, 16)
- PLD( sfi_pld r1, #0 )
+ PLD( pld [r1, #0] )
PLD( subs r2, r2, #96 )
- PLD( sfi_pld r1, #28 )
+ PLD( pld [r1, #28] )
PLD( blt 13f )
- PLD( sfi_pld r1, #60 )
- PLD( sfi_pld r1, #92 )
+ PLD( pld [r1, #60] )
+ PLD( pld [r1, #92] )
-12: PLD( sfi_pld r1, #124 )
-13: sfi_breg r1, \
- ldmia \B!, {r4, r5, r6, r7}
+12: PLD( pld [r1, #124] )
+13: ldmia r1!, {r4, r5, r6, r7}
mov r3, lr, PULL #\pull
subs r2, r2, #32
- sfi_breg r1, \
- ldmia \B!, {r8, r10, ip, lr}
+ ldmia r1!, {r8, r10, ip, lr}
orr r3, r3, r4, PUSH #\push
mov r4, r4, PULL #\pull
orr r4, r4, r5, PUSH #\push
@@ -310,8 +279,7 @@ ENTRY(memcpy)
orr r10, r10, ip, PUSH #\push
mov ip, ip, PULL #\pull
orr ip, ip, lr, PUSH #\push
- sfi_breg r0, \
- stmia \B!, {r3, r4, r5, r6, r7, r8, r10, ip}
+ stmia r0!, {r3, r4, r5, r6, r7, r8, r10, ip}
bge 12b
PLD( cmn r2, #96 )
PLD( bge 13b )
@@ -328,12 +296,10 @@ ENTRY(memcpy)
beq 16f
15: mov r3, lr, PULL #\pull
- sfi_breg r1, \
- ldr lr, [\B], #4
+ ldr lr, [r1], #4
subs ip, ip, #4
orr r3, r3, lr, PUSH #\push
- sfi_breg r0, \
- str r3, [\B], #4
+ str r3, [r0], #4
bgt 15b
CALGN( cmp r2, #0 )
CALGN( bge 11b )
diff --git a/sysdeps/arm/memmove.S b/sysdeps/arm/memmove.S
index 96b2366e92..74d3042043 100644
--- a/sysdeps/arm/memmove.S
+++ b/sysdeps/arm/memmove.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by MontaVista Software, Inc. (written by Nicolas Pitre)
@@ -87,7 +87,7 @@ ENTRY(memmove)
subs r2, r2, #4
blt 8f
ands ip, r0, #3
- PLD( sfi_pld r1, #-4 )
+ PLD( pld [r1, #-4] )
bne 9f
ands ip, r1, #3
bne 10f
@@ -113,19 +113,17 @@ ENTRY(memmove)
CALGN( bx r4 )
#endif
- PLD( sfi_pld r1, #-4 )
+ PLD( pld [r1, #-4] )
2: PLD( subs r2, r2, #96 )
- PLD( sfi_pld r1, #-32 )
+ PLD( pld [r1, #-32] )
PLD( blt 4f )
- PLD( sfi_pld r1, #-64 )
- PLD( sfi_pld r1, #-96 )
+ PLD( pld [r1, #-64] )
+ PLD( pld [r1, #-96] )
-3: PLD( sfi_pld r1, #-128 )
-4: sfi_breg r1, \
- ldmdb \B!, {r3, r4, r5, r6, r7, r8, ip, lr}
+3: PLD( pld [r1, #-128] )
+4: ldmdb r1!, {r3, r4, r5, r6, r7, r8, ip, lr}
subs r2, r2, #32
- sfi_breg r0, \
- stmdb \B!, {r3, r4, r5, r6, r7, r8, ip, lr}
+ stmdb r0!, {r3, r4, r5, r6, r7, r8, ip, lr}
bge 3b
PLD( cmn r2, #96 )
PLD( bge 4b )
@@ -152,26 +150,19 @@ ENTRY(memmove)
.p2align ARM_BX_ALIGN_LOG2
6: nop
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r3, [\B, #-4]!
+ ldr r3, [r1, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r4, [\B, #-4]!
+ ldr r4, [r1, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r5, [\B, #-4]!
+ ldr r5, [r1, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r6, [\B, #-4]!
+ ldr r6, [r1, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r7, [\B, #-4]!
+ ldr r7, [r1, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr r8, [\B, #-4]!
+ ldr r8, [r1, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r1, \
- ldr lr, [\B, #-4]!
+ ldr lr, [r1, #-4]!
#ifndef ARM_ALWAYS_BX
add pc, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
@@ -188,26 +179,19 @@ ENTRY(memmove)
.p2align ARM_BX_ALIGN_LOG2
66: nop
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r3, [\B, #-4]!
+ str r3, [r0, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r4, [\B, #-4]!
+ str r4, [r0, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r5, [\B, #-4]!
+ str r5, [r0, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r6, [\B, #-4]!
+ str r6, [r0, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r7, [\B, #-4]!
+ str r7, [r0, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str r8, [\B, #-4]!
+ str r8, [r0, #-4]!
.p2align ARM_BX_ALIGN_LOG2
- sfi_breg r0, \
- str lr, [\B, #-4]!
+ str lr, [r0, #-4]!
#ifdef ARM_ALWAYS_BX
pop {r10}
@@ -225,18 +209,12 @@ ENTRY(memmove)
cfi_restore (r8)
8: movs r2, r2, lsl #31
- sfi_breg r1, \
- ldrbne r3, [\B, #-1]!
- sfi_breg r1, \
- ldrbcs r4, [\B, #-1]!
- sfi_breg r1, \
- ldrbcs ip, [\B, #-1]
- sfi_breg r0, \
- strbne r3, [\B, #-1]!
- sfi_breg r0, \
- strbcs r4, [\B, #-1]!
- sfi_breg r0, \
- strbcs ip, [\B, #-1]
+ ldrbne r3, [r1, #-1]!
+ ldrbcs r4, [r1, #-1]!
+ ldrbcs ip, [r1, #-1]
+ strbne r3, [r0, #-1]!
+ strbcs r4, [r0, #-1]!
+ strbcs ip, [r0, #-1]
#if ((defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)) \
|| defined (ARM_ALWAYS_BX))
@@ -252,27 +230,20 @@ ENTRY(memmove)
cfi_restore_state
9: cmp ip, #2
- sfi_breg r1, \
- ldrbgt r3, [\B, #-1]!
- sfi_breg r1, \
- ldrbge r4, [\B, #-1]!
- sfi_breg r1, \
- ldrb lr, [\B, #-1]!
- sfi_breg r0, \
- strbgt r3, [\B, #-1]!
- sfi_breg r0, \
- strbge r4, [\B, #-1]!
+ ldrbgt r3, [r1, #-1]!
+ ldrbge r4, [r1, #-1]!
+ ldrb lr, [r1, #-1]!
+ strbgt r3, [r0, #-1]!
+ strbge r4, [r0, #-1]!
subs r2, r2, ip
- sfi_breg r0, \
- strb lr, [\B, #-1]!
+ strb lr, [r0, #-1]!
blt 8b
ands ip, r1, #3
beq 1b
10: bic r1, r1, #3
cmp ip, #2
- sfi_breg r1, \
- ldr r3, [\B, #0]
+ ldr r3, [r1, #0]
beq 17f
blt 18f
@@ -296,20 +267,18 @@ ENTRY(memmove)
cfi_rel_offset (r8, 12)
cfi_rel_offset (r10, 16)
- PLD( sfi_pld r1, #-4 )
+ PLD( pld [r1, #-4] )
PLD( subs r2, r2, #96 )
- PLD( sfi_pld r1, #-32 )
+ PLD( pld [r1, #-32] )
PLD( blt 13f )
- PLD( sfi_pld r1, #-64 )
- PLD( sfi_pld r1, #-96 )
+ PLD( pld [r1, #-64] )
+ PLD( pld [r1, #-96] )
-12: PLD( sfi_pld r1, #-128 )
-13: sfi_breg r1, \
- ldmdb \B!, {r7, r8, r10, ip}
+12: PLD( pld [r1, #-128] )
+13: ldmdb r1!, {r7, r8, r10, ip}
mov lr, r3, PUSH #\push
subs r2, r2, #32
- sfi_breg r1, \
- ldmdb \B!, {r3, r4, r5, r6}
+ ldmdb r1!, {r3, r4, r5, r6}
orr lr, lr, ip, PULL #\pull
mov ip, ip, PUSH #\push
orr ip, ip, r10, PULL #\pull
@@ -325,8 +294,7 @@ ENTRY(memmove)
orr r5, r5, r4, PULL #\pull
mov r4, r4, PUSH #\push
orr r4, r4, r3, PULL #\pull
- sfi_breg r0, \
- stmdb \B!, {r4 - r8, r10, ip, lr}
+ stmdb r0!, {r4 - r8, r10, ip, lr}
bge 12b
PLD( cmn r2, #96 )
PLD( bge 13b )
@@ -343,12 +311,10 @@ ENTRY(memmove)
beq 16f
15: mov lr, r3, PUSH #\push
- sfi_breg r1, \
- ldr r3, [\B, #-4]!
+ ldr r3, [r1, #-4]!
subs ip, ip, #4
orr lr, lr, r3, PULL #\pull
- sfi_breg r0, \
- str lr, [\B, #-4]!
+ str lr, [r0, #-4]!
bgt 15b
CALGN( cmp r2, #0 )
CALGN( bge 11b )
diff --git a/sysdeps/arm/memset.S b/sysdeps/arm/memset.S
index c11857f55c..6ab173cca0 100644
--- a/sysdeps/arm/memset.S
+++ b/sysdeps/arm/memset.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>
@@ -32,8 +32,7 @@ ENTRY(memset)
1:
tst r3, #3 @ aligned yet?
- sfi_breg r3, \
- strbne r1, [\B], #1
+ strbne r1, [r3], #1
subne r2, r2, #1
bne 1b
@@ -44,33 +43,25 @@ ENTRY(memset)
1:
subs r2, r2, #8
- sfi_breg r3, \
- stmiacs \B!, {r1, ip} @ store up to 32 bytes per loop iteration
+ stmiacs r3!, {r1, ip} @ store up to 32 bytes per loop iteration
subscs r2, r2, #8
- sfi_breg r3, \
- stmiacs \B!, {r1, ip}
+ stmiacs r3!, {r1, ip}
subscs r2, r2, #8
- sfi_breg r3, \
- stmiacs \B!, {r1, ip}
+ stmiacs r3!, {r1, ip}
subscs r2, r2, #8
- sfi_breg r3, \
- stmiacs \B!, {r1, ip}
+ stmiacs r3!, {r1, ip}
bcs 1b
and r2, r2, #7
2:
subs r2, r2, #1 @ store up to 4 bytes per loop iteration
- sfi_breg r3, \
- strbcs r1, [\B], #1
+ strbcs r1, [r3], #1
subscs r2, r2, #1
- sfi_breg r3, \
- strbcs r1, [\B], #1
+ strbcs r1, [r3], #1
subscs r2, r2, #1
- sfi_breg r3, \
- strbcs r1, [\B], #1
+ strbcs r1, [r3], #1
subscs r2, r2, #1
- sfi_breg r3, \
- strbcs r1, [\B], #1
+ strbcs r1, [r3], #1
bcs 2b
DO_RET(lr)
diff --git a/sysdeps/arm/memusage.h b/sysdeps/arm/memusage.h
index 592a751618..5222d33d5c 100644
--- a/sysdeps/arm/memusage.h
+++ b/sysdeps/arm/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/nacl/Implies b/sysdeps/arm/nacl/Implies
deleted file mode 100644
index 2294208dba..0000000000
--- a/sysdeps/arm/nacl/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-arm/nptl
-init_array
diff --git a/sysdeps/arm/nacl/Makefile b/sysdeps/arm/nacl/Makefile
deleted file mode 100644
index ccec4a7442..0000000000
--- a/sysdeps/arm/nacl/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-# Makefile fragment for ARM/NaCl configurations.
-
-# Copyright (C) 2015-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/>.
-
-# sysdeps/nacl/Makefile needs this set to the architecture suffix used in
-# the NaCl SDK.
-nacl-sdk-arch = arm
-
-# We don't really support TLSDESC, even though the compiler thinks it does.
-have-arm-tls-desc = no
-
-ifeq ($(subdir),csu)
-sysdep_routines += aeabi_read_tp
-endif
-
-ifeq ($(subdir),elf)
-sysdep-rtld-routines += aeabi_read_tp
-endif
diff --git a/sysdeps/arm/nacl/____longjmp_chk.S b/sysdeps/arm/nacl/____longjmp_chk.S
deleted file mode 100644
index afc8ee6468..0000000000
--- a/sysdeps/arm/nacl/____longjmp_chk.S
+++ /dev/null
@@ -1,47 +0,0 @@
-/* longjmp that validates stack addresses. ARM/NaCl version.
- Copyright (C) 2015-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>
-
- .section .rodata.str1.1,"aMS",%progbits,1
- .type longjmp_msg,%object
-longjmp_msg:
- .string "longjmp causes uninitialized stack frame"
- .size longjmp_msg, .-longjmp_msg
-
- .text
-
-/* We don't have sigaltstack and so any longjmp must be to an outer frame. */
-.macro check_sp reg
- cmp sp, \reg
- bls .Lok
-#ifdef PIC
- movw r0, #:lower16:longjmp_msg-(.LPIC0+8)
- movt r0, #:upper16:longjmp_msg-(.LPIC0+8)
-.LPIC0: add r0, r0, pc
-#else
- movw r0, #:lower16:longjmp_msg
- movt r0, #:upper16:longjmp_msg
-#endif
- b HIDDEN_JUMPTARGET(__fortify_fail)
-.Lok:
-.endm
-
-#define CHECK_SP(reg) check_sp reg
-#define __longjmp ____longjmp_chk
-#include <__longjmp.S>
diff --git a/sysdeps/arm/nacl/aeabi_read_tp.S b/sysdeps/arm/nacl/aeabi_read_tp.S
deleted file mode 100644
index 03186858d3..0000000000
--- a/sysdeps/arm/nacl/aeabi_read_tp.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* ARM EABI helper function for reading the thread pointer. NaCl version.
- Copyright (C) 2015-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 with other
- programs, and to distribute those programs without any restriction
- coming from the use of this file. (The GNU Lesser General Public
- License restrictions do apply in other respects; for example, they
- cover modification of the file, and distribution when not linked
- into another program.)
-
- Note that people who make modified versions of this file are not
- obligated to grant this special exception for their modified
- versions; it is their choice whether to do so. The GNU Lesser
- General Public License gives permission to release a modified
- version without this exception; this exception also makes it
- possible to release a modified version which carries forward this
- exception.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-/* GCC will emit calls to this routine under -mtp=soft. */
-
- .hidden __aeabi_read_tp
-ENTRY (__aeabi_read_tp)
- ldr r0, [r9]
- sfi_bx lr
-END (__aeabi_read_tp)
diff --git a/sysdeps/arm/nacl/arm-features.h b/sysdeps/arm/nacl/arm-features.h
deleted file mode 100644
index 4ebe1b4b4c..0000000000
--- a/sysdeps/arm/nacl/arm-features.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Macros to test for CPU features on ARM. NaCl version.
- Copyright (C) 2015-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 _NACL_ARM_FEATURES_H
-#define _NACL_ARM_FEATURES_H 1
-
-#ifdef __SOFTFP__
-# error NaCl should always have VFP enabled
-#endif
-
-/* NaCl does not support iWMMXt at all. */
-#define ARM_ASSUME_NO_IWMMXT 1
-
-/* NaCl does not allow instructions to target the pc register. */
-#define ARM_ALWAYS_BX 1
-
-/* Computed branch targets must be bundle-aligned, which is to 16 bytes. */
-#define ARM_BX_ALIGN_LOG2 4
-
-/* Two-register addressing modes are never allowed. */
-#define ARM_NO_INDEX_REGISTER 1
-
-/* Only ARM mode code is allowed, never Thumb mode. */
-#define NO_THUMB
-
-#include_next <arm-features.h>
-
-#endif /* arm-features.h */
diff --git a/sysdeps/arm/nacl/dl-machine.h b/sysdeps/arm/nacl/dl-machine.h
deleted file mode 100644
index 530d2352dd..0000000000
--- a/sysdeps/arm/nacl/dl-machine.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Machine-dependent ELF dynamic relocation inline functions. ARM/NaCl version.
- Copyright (C) 2015-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 dl_machine_h
-
-/* This is only needed for handling TEXTRELs and NaCl will never
- support TEXTRELs at all. */
-#define CLEAR_CACHE(start, end) __builtin_trap ()
-
-#endif
-
-/* The rest is just machine-specific.
- This #include is outside the #ifndef because the parts of
- dl-machine.h used only by dynamic-link.h are outside the guard. */
-#include <sysdeps/arm/dl-machine.h>
-
-#ifdef dl_machine_h
-
-/* Initial entry point code for the dynamic linker.
- The C function `_dl_start' is the real entry point;
- its return value is the user program's entry point. */
-#undef RTLD_START
-#define RTLD_START asm ("\
-.text\n\
-.globl _start\n\
-.type _start, %function\n\
-.p2align 4\n\
-_start:\n\
- @ r0 has the pointer to the info block (see nacl_startup.h)\n\
- mov r1, sp @ Save stack base for __libc_stack_end.\n\
- push {r0-r3} @ Push those, maintaining alignment to 16.\n\
- mov r0, sp @ Pointer to {info, sp} is argument.\n\
- sfi_bl _dl_start\n\
- pop {r1-r4} @ Restore stack, getting info block into r1.\n\
- mov lr, #0 @ Return address for noreturn call.\n\
- b _dl_start_user");
-
-#endif
diff --git a/sysdeps/arm/nacl/dl-trampoline.S b/sysdeps/arm/nacl/dl-trampoline.S
deleted file mode 100644
index 147bd43e78..0000000000
--- a/sysdeps/arm/nacl/dl-trampoline.S
+++ /dev/null
@@ -1,278 +0,0 @@
-/* PLT trampolines. ARM/NaCl version.
- Copyright (C) 2015-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>
-
- .syntax unified
- .text
-
-@ Change &GOT[n+3] into 8*n. Note relocs are 8 bytes each.
-.macro compute_reloc_arg pltgot, got2
- sub r1, \pltgot, \got2 @ r1 = &GOT[n+3] - &GOT[2] = 4*(n-1)
- sub r1, r1, #4 @ r1 = 4*n
- add r1, r1, r1 @ r1 *= 2 = 8*n
-.endm
-
- CFI_SECTIONS
- .globl _dl_runtime_resolve
- .type _dl_runtime_resolve, %function
- .p2align 4
-_dl_runtime_resolve:
- cfi_startproc
- cfi_adjust_cfa_offset (8)
-
- @ We get called with:
- @ lr contains the return address from this call
- @ stack[1] contains &GOT[n+3] (pointer to function)
- @ stack[0] points to &GOT[2]
-
- ldr ip, [sp] @ ip gets &GOT[2]
-
- @ Save the argument registers and the return address.
- @ r4 doesn't need to be saved, but it makes the total
- @ adjustment to sp (including the two words pushed by
- @ the PLT code) an even eight words, so sp stays aligned.
- push {r0-r4, lr}
- cfi_adjust_cfa_offset (24)
- cfi_rel_offset (r0, 0)
- cfi_rel_offset (r1, 4)
- cfi_rel_offset (r2, 8)
- cfi_rel_offset (r3, 12)
- cfi_rel_offset (r4, 16)
- cfi_rel_offset (lr, 20)
-
- ldr r1, [sp, #28] @ r1 gets &GOT[n+3]
-
- @ Get the 'struct link_map *' for the first argument to _dl_fixup.
- sfi_breg ip, ldr r0, [\B, #-4]
-
- @ Get the reloc offset for the second argument to _dl_fixup.
- compute_reloc_arg r1, ip
-
- @ This does the real work, and returns the real call target.
- sfi_bl _dl_fixup
- mov ip, r0
-
- @ Restore the saved registers.
- pop {r0-r4, lr}
- cfi_adjust_cfa_offset (-24)
- cfi_restore (r0)
- cfi_restore (r1)
- cfi_restore (r2)
- cfi_restore (r3)
- cfi_restore (r4)
- cfi_restore (lr)
-
- @ Now compensate for the two words pushed by the PLT code.
- sfi_sp add sp, #8
- cfi_adjust_cfa_offset (-8)
-
- @ Finally, jump to the newfound call target.
- sfi_bx ip
-
- cfi_endproc
- .size _dl_runtime_resolve, .-_dl_runtime_resolve
-
-#ifndef PROF
- .globl _dl_runtime_profile
- .type _dl_runtime_profile, #function
- .p2align 4
-_dl_runtime_profile:
- cfi_startproc
- cfi_adjust_cfa_offset (8)
-
- @ We get called with:
- @ lr contains the return address from this call
- @ stack[1] contains &GOT[n+3] (pointer to function)
- @ stack[0] points to &GOT[2]
-
- @ Stack layout:
- @ sp + 204 framesize returned from pltenter
- @ sp + 12 La_arm_regs
- @ sp + 4 Saved two arguments to _dl_profile_fixup
- @ sp + 0 outgoing argument to _dl_profile_fixup
- @ For now, we only save the general purpose registers.
-# define PLTEXIT_ARGS 4
-# define LA_ARM_REGS (PLTEXIT_ARGS + 8)
-# define LA_ARM_REGS_SIZE (4 * (4 + 1 + 1 + 42))
-# define PLTENTER_FRAMESIZE (LA_ARM_REGS + LA_ARM_REGS_SIZE)
-# define FRAMESIZE (((PLTENTER_FRAMESIZE + 4) + 15) & -16)
-
- @ The NaCl ABI requires that sp be aligned to 16 bytes at call
- @ sites. Assuming that was met on entry to the PLT, sp is
- @ now exactly 8 bytes misaligned.
- sfi_sp sub sp, #(FRAMESIZE - 8)
- cfi_def_cfa_offset (FRAMESIZE)
-
- @ Store the argument registers in La_arm_regs.
- strd r0, r1, [sp, #LA_ARM_REGS]
- cfi_offset (r0, LA_ARM_REGS + 0)
- cfi_offset (r1, LA_ARM_REGS + 4)
- strd r2, r3, [sp, #(LA_ARM_REGS + 8)]
- cfi_offset (r2, LA_ARM_REGS + 8)
- cfi_offset (r3, LA_ARM_REGS + 12)
-
- ldr ip, [sp, #(FRAMESIZE - 8)] @ ip gets &GOT[2]
- ldr r3, [sp, #(FRAMESIZE - 4)] @ r3 gets &GOT[n+3]
-
- @ Recover the incoming sp and lr and save those in La_arm_regs.
- add r0, sp, #FRAMESIZE
- mov r1, lr
- strd r0, r1, [sp, #(LA_ARM_REGS + 16)]
- cfi_offset (sp, LA_ARM_REGS + 16)
- cfi_offset (lr, LA_ARM_REGS + 20)
-
- @ Get the 'struct link_map *' for the first arg to _dl_profile_fixup.
- sfi_breg ip, ldr r0, [\B, #-4]
-
- @ Get the reloc offset for the second argument to _dl_profile_fixup.
- compute_reloc_arg r3, ip
-
- @ The third argument is the original return address, still in lr.
- mov r2, lr
-
- @ Compute the fourth argument, the La_arm_regs pointer.
- add r3, sp, #PLTEXIT_ARGS
-
- @ Compute the fifth argument, the address of the 'framesize'
- @ out parameter, and store it at the top of the stack.
- add ip, sp, #PLTENTER_FRAMESIZE
- str ip, [sp]
-
- @ Save away the first two arguments, which we will need
- @ again for _dl_call_pltexit, below.
- strd r0, r1, [sp, #PLTEXIT_ARGS]
-
- @ This does the real work, and returns the real call target.
- sfi_bl _dl_profile_fixup
-
- @ The address to call is now in r0.
-
- @ Check whether we're wrapping this function,
- @ i.e. if the framesize out parameter is >= 0.
- ldr ip, [sp, #PLTENTER_FRAMESIZE]
- cmp ip, #0
- bge 1f
- cfi_remember_state
-
- @ Save _dl_profile_fixup's return value: the real call target.
- mov ip, r0
-
- @ Restore the registers from the La_arm_regs (perhaps as modified
- @ by audit modules' pltenter functions).
- add r1, sp, #LA_ARM_REGS
- sfi_sp sfi_breg r1, ldmia \B, {r0-r3, sp, lr}
- cfi_def_cfa_offset (0)
- cfi_restore (r0)
- cfi_restore (r1)
- cfi_restore (r2)
- cfi_restore (r3)
- cfi_restore (sp)
- cfi_restore (lr)
-
- @ Finally, jump to the newfound call target.
- sfi_bx ip
-
-1: cfi_restore_state
- @ The new frame size is in ip.
-
- @ Save the fp in the stack slot previously used for the fifth
- @ argument to _dl_profile_fixup.
- str fp, [sp]
- cfi_offset (fp, 0)
-
- @ Save the result of _dl_profile_fixup, the real call target.
- @ We'll reuse the stack slot just used for the 'framesize'
- @ out parameter to _dl_profile_fixup.
- str r0, [sp, #PLTENTER_FRAMESIZE]
-
- @ Stack layout:
- @ fp + 264 call target
- @ fp + 72 La_arm_regs
- @ fp + 68 Saved two arguments to _dl_profile_fixup
- @ fp + 64 saved fp
- @ fp + 0 La_arm_retval
- @ sp..fp copied incoming stack space (plus alignment)
- @ For now, we only save the general purpose registers.
-# define FP_LA_ARM_RETVAL 0
-# define LA_ARM_RETVAL_SIZE (4 * (4 + 12))
-# define FP_SAVED_FP LA_ARM_RETVAL_SIZE
-# define FP_PLTEXIT_ARGS (FP_SAVED_FP + 4)
-# define FP_LA_ARM_REGS (FP_PLTEXIT_ARGS + 8)
-# define FP_CALL_TARGET (FP_LA_ARM_REGS + LA_ARM_REGS_SIZE)
-# define FP_FRAMESIZE (FP_CALL_TARGET + 4)
-
- sub fp, sp, #(FP_FRAMESIZE - FRAMESIZE)
- cfi_def_cfa (fp, FP_FRAMESIZE)
-
- sub r1, fp, ip
- @ This doesn't need sfi_sp because we just include the
- @ sandboxing mask along with the alignment mask.
- bic sp, r1, #0xc000000f
-
- @ Copy the stack arguments. The audit modules' pltenter
- @ function(s) decided how much needs to be copied.
- @ Load the sp as modified by pltenter functions, rather
- @ than what we think the incoming sp was (fp + FP_FRAMESIZE).
- sfi_breg fp, ldr r1, [\B, #(FP_LA_ARM_REGS + 16)]
- mov r0, sp
- mov r2, ip
- sfi_bl memcpy
-
- @ Load up the arguments from La_arm_regs and call the user's function.
- sfi_breg fp, ldr ip, [\B, #FP_CALL_TARGET]
- sfi_breg fp, ldrd r0, r1, [\B, #FP_LA_ARM_REGS]
- sfi_breg fp, ldrd r2, r3, [\B, #(FP_LA_ARM_REGS + 8)]
- sfi_blx ip
-
- @ Stash the return value registers in La_arm_retval.
- sfi_breg fp, strd r0, r1, [\B, #FP_LA_ARM_RETVAL]
- sfi_breg fp, strd r2, r3, [\B, #(FP_LA_ARM_RETVAL + 8)]
-
- @ Call pltexit. We saved the first two arguments earlier--they
- @ are the same ones passed to _dl_profile_fixup. The latter two
- @ arguments are La_arm_regs and La_arm_retval blocks, respectively.
- sfi_breg fp, ldrd r0, r1, [\B, #FP_PLTEXIT_ARGS]
- add r2, fp, #FP_LA_ARM_REGS
- add r3, fp, #FP_LA_ARM_RETVAL
- sfi_bl _dl_call_pltexit
-
- @ Reload the saved return value registers for the caller.
- sfi_breg fp, ldrd r0, r1, [\B, #FP_LA_ARM_RETVAL]
- sfi_breg fp, ldrd r2, r3, [\B, #(FP_LA_ARM_RETVAL + 8)]
-
- @ Unwind the frame.
- sfi_sp mov sp, fp
- cfi_def_cfa_register (sp)
- ldr fp, [sp, #FP_SAVED_FP]
- cfi_restore (fp)
- @ Reload the lr and sp values from La_arm_regs, where they
- @ might have been modified by pltenter functions, rather than
- @ computing what we think the incoming value was.
- ldr lr, [sp, #(FP_LA_ARM_REGS + 20)]
- cfi_restore (lr)
- sfi_sp ldr sp, [sp, #(FP_LA_ARM_REGS + 16)]
- cfi_def_cfa_offset (0)
-
- @ Finally, return to the caller.
- sfi_bx lr
-
- cfi_endproc
- .size _dl_runtime_profile, .-_dl_runtime_profile
-#endif
- .previous
diff --git a/sysdeps/arm/nacl/include/bits/setjmp.h b/sysdeps/arm/nacl/include/bits/setjmp.h
deleted file mode 100644
index 6b6a235871..0000000000
--- a/sysdeps/arm/nacl/include/bits/setjmp.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Private jmp_buf-related definitions. NaCl/ARM version.
- Copyright (C) 2015-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 _INCLUDE_BITS_SETJMP_H
-#define _INCLUDE_BITS_SETJMP_H 1
-
-#ifndef __ASSEMBLER__
-/* Get the public declarations. */
-# include <sysdeps/arm/bits/setjmp.h>
-#endif
-
-/* Register list for a ldm/stm instruction to load/store
- the general registers from a __jmp_buf.
-
- The generic ARM definition includes r9 (v6), which is not
- permitted under NaCl. We add r3 even though it's call-clobbered,
- just to keep the size the same as the generic version. */
-#define JMP_BUF_REGLIST {r3, v1-v5, sl, fp}
-
-/* Index of __jmp_buf where the sp register resides. */
-#define __JMP_BUF_SP 0
-
-#endif /* include/bits/setjmp.h */
diff --git a/sysdeps/arm/nacl/libc.abilist b/sysdeps/arm/nacl/libc.abilist
deleted file mode 100644
index 561441e548..0000000000
--- a/sysdeps/arm/nacl/libc.abilist
+++ /dev/null
@@ -1,1836 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 _Exit F
-GLIBC_2.22 _IO_2_1_stderr_ D 0xa0
-GLIBC_2.22 _IO_2_1_stdin_ D 0xa0
-GLIBC_2.22 _IO_2_1_stdout_ D 0xa0
-GLIBC_2.22 _IO_adjust_column F
-GLIBC_2.22 _IO_adjust_wcolumn F
-GLIBC_2.22 _IO_default_doallocate F
-GLIBC_2.22 _IO_default_finish F
-GLIBC_2.22 _IO_default_pbackfail F
-GLIBC_2.22 _IO_default_uflow F
-GLIBC_2.22 _IO_default_xsgetn F
-GLIBC_2.22 _IO_default_xsputn F
-GLIBC_2.22 _IO_do_write F
-GLIBC_2.22 _IO_doallocbuf F
-GLIBC_2.22 _IO_fclose F
-GLIBC_2.22 _IO_fdopen F
-GLIBC_2.22 _IO_feof F
-GLIBC_2.22 _IO_ferror F
-GLIBC_2.22 _IO_fflush F
-GLIBC_2.22 _IO_fgetpos F
-GLIBC_2.22 _IO_fgetpos64 F
-GLIBC_2.22 _IO_fgets F
-GLIBC_2.22 _IO_file_attach F
-GLIBC_2.22 _IO_file_close F
-GLIBC_2.22 _IO_file_close_it F
-GLIBC_2.22 _IO_file_doallocate F
-GLIBC_2.22 _IO_file_finish F
-GLIBC_2.22 _IO_file_fopen F
-GLIBC_2.22 _IO_file_init F
-GLIBC_2.22 _IO_file_jumps D 0x54
-GLIBC_2.22 _IO_file_open F
-GLIBC_2.22 _IO_file_overflow F
-GLIBC_2.22 _IO_file_read F
-GLIBC_2.22 _IO_file_seek F
-GLIBC_2.22 _IO_file_seekoff F
-GLIBC_2.22 _IO_file_setbuf F
-GLIBC_2.22 _IO_file_stat F
-GLIBC_2.22 _IO_file_sync F
-GLIBC_2.22 _IO_file_underflow F
-GLIBC_2.22 _IO_file_write F
-GLIBC_2.22 _IO_file_xsputn F
-GLIBC_2.22 _IO_flockfile F
-GLIBC_2.22 _IO_flush_all F
-GLIBC_2.22 _IO_flush_all_linebuffered F
-GLIBC_2.22 _IO_fopen F
-GLIBC_2.22 _IO_fprintf F
-GLIBC_2.22 _IO_fputs F
-GLIBC_2.22 _IO_fread F
-GLIBC_2.22 _IO_free_backup_area F
-GLIBC_2.22 _IO_free_wbackup_area F
-GLIBC_2.22 _IO_fsetpos F
-GLIBC_2.22 _IO_fsetpos64 F
-GLIBC_2.22 _IO_ftell F
-GLIBC_2.22 _IO_ftrylockfile F
-GLIBC_2.22 _IO_funlockfile F
-GLIBC_2.22 _IO_fwrite F
-GLIBC_2.22 _IO_getc F
-GLIBC_2.22 _IO_getline F
-GLIBC_2.22 _IO_getline_info F
-GLIBC_2.22 _IO_gets F
-GLIBC_2.22 _IO_init F
-GLIBC_2.22 _IO_init_marker F
-GLIBC_2.22 _IO_init_wmarker F
-GLIBC_2.22 _IO_iter_begin F
-GLIBC_2.22 _IO_iter_end F
-GLIBC_2.22 _IO_iter_file F
-GLIBC_2.22 _IO_iter_next F
-GLIBC_2.22 _IO_least_wmarker F
-GLIBC_2.22 _IO_link_in F
-GLIBC_2.22 _IO_list_all D 0x4
-GLIBC_2.22 _IO_list_lock F
-GLIBC_2.22 _IO_list_resetlock F
-GLIBC_2.22 _IO_list_unlock F
-GLIBC_2.22 _IO_marker_delta F
-GLIBC_2.22 _IO_marker_difference F
-GLIBC_2.22 _IO_padn F
-GLIBC_2.22 _IO_peekc_locked F
-GLIBC_2.22 _IO_popen F
-GLIBC_2.22 _IO_printf F
-GLIBC_2.22 _IO_proc_close F
-GLIBC_2.22 _IO_proc_open F
-GLIBC_2.22 _IO_putc F
-GLIBC_2.22 _IO_puts F
-GLIBC_2.22 _IO_remove_marker F
-GLIBC_2.22 _IO_seekmark F
-GLIBC_2.22 _IO_seekoff F
-GLIBC_2.22 _IO_seekpos F
-GLIBC_2.22 _IO_seekwmark F
-GLIBC_2.22 _IO_setb F
-GLIBC_2.22 _IO_setbuffer F
-GLIBC_2.22 _IO_setvbuf F
-GLIBC_2.22 _IO_sgetn F
-GLIBC_2.22 _IO_sprintf F
-GLIBC_2.22 _IO_sputbackc F
-GLIBC_2.22 _IO_sputbackwc F
-GLIBC_2.22 _IO_sscanf F
-GLIBC_2.22 _IO_str_init_readonly F
-GLIBC_2.22 _IO_str_init_static F
-GLIBC_2.22 _IO_str_overflow F
-GLIBC_2.22 _IO_str_pbackfail F
-GLIBC_2.22 _IO_str_seekoff F
-GLIBC_2.22 _IO_str_underflow F
-GLIBC_2.22 _IO_sungetc F
-GLIBC_2.22 _IO_sungetwc F
-GLIBC_2.22 _IO_switch_to_get_mode F
-GLIBC_2.22 _IO_switch_to_main_wget_area F
-GLIBC_2.22 _IO_switch_to_wbackup_area F
-GLIBC_2.22 _IO_switch_to_wget_mode F
-GLIBC_2.22 _IO_un_link F
-GLIBC_2.22 _IO_ungetc F
-GLIBC_2.22 _IO_unsave_markers F
-GLIBC_2.22 _IO_unsave_wmarkers F
-GLIBC_2.22 _IO_vfprintf F
-GLIBC_2.22 _IO_vfscanf F
-GLIBC_2.22 _IO_vsprintf F
-GLIBC_2.22 _IO_wdefault_doallocate F
-GLIBC_2.22 _IO_wdefault_finish F
-GLIBC_2.22 _IO_wdefault_pbackfail F
-GLIBC_2.22 _IO_wdefault_uflow F
-GLIBC_2.22 _IO_wdefault_xsgetn F
-GLIBC_2.22 _IO_wdefault_xsputn F
-GLIBC_2.22 _IO_wdo_write F
-GLIBC_2.22 _IO_wdoallocbuf F
-GLIBC_2.22 _IO_wfile_jumps D 0x54
-GLIBC_2.22 _IO_wfile_overflow F
-GLIBC_2.22 _IO_wfile_seekoff F
-GLIBC_2.22 _IO_wfile_sync F
-GLIBC_2.22 _IO_wfile_underflow F
-GLIBC_2.22 _IO_wfile_xsputn F
-GLIBC_2.22 _IO_wmarker_delta F
-GLIBC_2.22 _IO_wsetb F
-GLIBC_2.22 __aeabi_MB_CUR_MAX F
-GLIBC_2.22 __aeabi_assert F
-GLIBC_2.22 __aeabi_atexit F
-GLIBC_2.22 __aeabi_errno_addr F
-GLIBC_2.22 __aeabi_localeconv F
-GLIBC_2.22 __aeabi_memclr F
-GLIBC_2.22 __aeabi_memclr4 F
-GLIBC_2.22 __aeabi_memclr8 F
-GLIBC_2.22 __aeabi_memcpy F
-GLIBC_2.22 __aeabi_memcpy4 F
-GLIBC_2.22 __aeabi_memcpy8 F
-GLIBC_2.22 __aeabi_memmove F
-GLIBC_2.22 __aeabi_memmove4 F
-GLIBC_2.22 __aeabi_memmove8 F
-GLIBC_2.22 __aeabi_memset F
-GLIBC_2.22 __aeabi_memset4 F
-GLIBC_2.22 __aeabi_memset8 F
-GLIBC_2.22 __after_morecore_hook D 0x4
-GLIBC_2.22 __argz_count F
-GLIBC_2.22 __argz_next F
-GLIBC_2.22 __argz_stringify F
-GLIBC_2.22 __asprintf F
-GLIBC_2.22 __asprintf_chk F
-GLIBC_2.22 __assert F
-GLIBC_2.22 __assert_fail F
-GLIBC_2.22 __assert_perror_fail F
-GLIBC_2.22 __backtrace F
-GLIBC_2.22 __backtrace_symbols F
-GLIBC_2.22 __backtrace_symbols_fd F
-GLIBC_2.22 __bsd_getpgrp F
-GLIBC_2.22 __bzero F
-GLIBC_2.22 __check_rhosts_file D 0x4
-GLIBC_2.22 __chk_fail F
-GLIBC_2.22 __close F
-GLIBC_2.22 __confstr_chk F
-GLIBC_2.22 __connect F
-GLIBC_2.22 __ctype_b_loc F
-GLIBC_2.22 __ctype_get_mb_cur_max F
-GLIBC_2.22 __ctype_tolower_loc F
-GLIBC_2.22 __ctype_toupper_loc F
-GLIBC_2.22 __curbrk D 0x4
-GLIBC_2.22 __cxa_at_quick_exit F
-GLIBC_2.22 __cxa_atexit F
-GLIBC_2.22 __cxa_finalize F
-GLIBC_2.22 __cxa_thread_atexit_impl F
-GLIBC_2.22 __cyg_profile_func_enter F
-GLIBC_2.22 __cyg_profile_func_exit F
-GLIBC_2.22 __daylight D 0x4
-GLIBC_2.22 __dcgettext F
-GLIBC_2.22 __default_morecore F
-GLIBC_2.22 __dgettext F
-GLIBC_2.22 __dprintf_chk F
-GLIBC_2.22 __dup2 F
-GLIBC_2.22 __duplocale F
-GLIBC_2.22 __environ D 0x4
-GLIBC_2.22 __fbufsize F
-GLIBC_2.22 __fcntl F
-GLIBC_2.22 __fdelt_chk F
-GLIBC_2.22 __fdelt_warn F
-GLIBC_2.22 __ffs F
-GLIBC_2.22 __fgets_chk F
-GLIBC_2.22 __fgets_unlocked_chk F
-GLIBC_2.22 __fgetws_chk F
-GLIBC_2.22 __fgetws_unlocked_chk F
-GLIBC_2.22 __finite F
-GLIBC_2.22 __finitef F
-GLIBC_2.22 __finitel F
-GLIBC_2.22 __flbf F
-GLIBC_2.22 __fork F
-GLIBC_2.22 __fpending F
-GLIBC_2.22 __fprintf_chk F
-GLIBC_2.22 __fpu_control D 0x4
-GLIBC_2.22 __fpurge F
-GLIBC_2.22 __fread_chk F
-GLIBC_2.22 __fread_unlocked_chk F
-GLIBC_2.22 __freadable F
-GLIBC_2.22 __freading F
-GLIBC_2.22 __free_hook D 0x4
-GLIBC_2.22 __freelocale F
-GLIBC_2.22 __fsetlocking F
-GLIBC_2.22 __fwprintf_chk F
-GLIBC_2.22 __fwritable F
-GLIBC_2.22 __fwriting F
-GLIBC_2.22 __fxstat F
-GLIBC_2.22 __fxstat64 F
-GLIBC_2.22 __fxstatat F
-GLIBC_2.22 __fxstatat64 F
-GLIBC_2.22 __getauxval F
-GLIBC_2.22 __getcwd_chk F
-GLIBC_2.22 __getdelim F
-GLIBC_2.22 __getdomainname_chk F
-GLIBC_2.22 __getgroups_chk F
-GLIBC_2.22 __gethostname_chk F
-GLIBC_2.22 __getlogin_r_chk F
-GLIBC_2.22 __getpagesize F
-GLIBC_2.22 __getpgid F
-GLIBC_2.22 __getpid F
-GLIBC_2.22 __gets_chk F
-GLIBC_2.22 __gettimeofday F
-GLIBC_2.22 __getwd_chk F
-GLIBC_2.22 __gmtime_r F
-GLIBC_2.22 __gnu_Unwind_Find_exidx F
-GLIBC_2.22 __gnu_mcount_nc F
-GLIBC_2.22 __h_errno_location F
-GLIBC_2.22 __isalnum_l F
-GLIBC_2.22 __isalpha_l F
-GLIBC_2.22 __isascii_l F
-GLIBC_2.22 __isblank_l F
-GLIBC_2.22 __iscntrl_l F
-GLIBC_2.22 __isctype F
-GLIBC_2.22 __isdigit_l F
-GLIBC_2.22 __isgraph_l F
-GLIBC_2.22 __isinf F
-GLIBC_2.22 __isinff F
-GLIBC_2.22 __isinfl F
-GLIBC_2.22 __islower_l F
-GLIBC_2.22 __isnan F
-GLIBC_2.22 __isnanf F
-GLIBC_2.22 __isnanl F
-GLIBC_2.22 __isoc99_fscanf F
-GLIBC_2.22 __isoc99_fwscanf F
-GLIBC_2.22 __isoc99_scanf F
-GLIBC_2.22 __isoc99_sscanf F
-GLIBC_2.22 __isoc99_swscanf F
-GLIBC_2.22 __isoc99_vfscanf F
-GLIBC_2.22 __isoc99_vfwscanf F
-GLIBC_2.22 __isoc99_vscanf F
-GLIBC_2.22 __isoc99_vsscanf F
-GLIBC_2.22 __isoc99_vswscanf F
-GLIBC_2.22 __isoc99_vwscanf F
-GLIBC_2.22 __isoc99_wscanf F
-GLIBC_2.22 __isprint_l F
-GLIBC_2.22 __ispunct_l F
-GLIBC_2.22 __isspace_l F
-GLIBC_2.22 __isupper_l F
-GLIBC_2.22 __iswalnum_l F
-GLIBC_2.22 __iswalpha_l F
-GLIBC_2.22 __iswblank_l F
-GLIBC_2.22 __iswcntrl_l F
-GLIBC_2.22 __iswctype F
-GLIBC_2.22 __iswctype_l F
-GLIBC_2.22 __iswdigit_l F
-GLIBC_2.22 __iswgraph_l F
-GLIBC_2.22 __iswlower_l F
-GLIBC_2.22 __iswprint_l F
-GLIBC_2.22 __iswpunct_l F
-GLIBC_2.22 __iswspace_l F
-GLIBC_2.22 __iswupper_l F
-GLIBC_2.22 __iswxdigit_l F
-GLIBC_2.22 __isxdigit_l F
-GLIBC_2.22 __ivaliduser F
-GLIBC_2.22 __libc_allocate_rtsig F
-GLIBC_2.22 __libc_calloc F
-GLIBC_2.22 __libc_current_sigrtmax F
-GLIBC_2.22 __libc_current_sigrtmin F
-GLIBC_2.22 __libc_free F
-GLIBC_2.22 __libc_freeres F
-GLIBC_2.22 __libc_init_first F
-GLIBC_2.22 __libc_mallinfo F
-GLIBC_2.22 __libc_malloc F
-GLIBC_2.22 __libc_mallopt F
-GLIBC_2.22 __libc_memalign F
-GLIBC_2.22 __libc_pvalloc F
-GLIBC_2.22 __libc_realloc F
-GLIBC_2.22 __libc_start_main F
-GLIBC_2.22 __libc_valloc F
-GLIBC_2.22 __longjmp_chk F
-GLIBC_2.22 __lseek F
-GLIBC_2.22 __lxstat F
-GLIBC_2.22 __lxstat64 F
-GLIBC_2.22 __malloc_hook D 0x4
-GLIBC_2.22 __malloc_initialize_hook D 0x4
-GLIBC_2.22 __mbrlen F
-GLIBC_2.22 __mbrtowc F
-GLIBC_2.22 __mbsnrtowcs_chk F
-GLIBC_2.22 __mbsrtowcs_chk F
-GLIBC_2.22 __mbstowcs_chk F
-GLIBC_2.22 __memalign_hook D 0x4
-GLIBC_2.22 __memcpy_chk F
-GLIBC_2.22 __memmove_chk F
-GLIBC_2.22 __mempcpy F
-GLIBC_2.22 __mempcpy_chk F
-GLIBC_2.22 __mempcpy_small F
-GLIBC_2.22 __memset_chk F
-GLIBC_2.22 __monstartup F
-GLIBC_2.22 __morecore D 0x4
-GLIBC_2.22 __nanosleep F
-GLIBC_2.22 __newlocale F
-GLIBC_2.22 __nl_langinfo_l F
-GLIBC_2.22 __nss_configure_lookup F
-GLIBC_2.22 __nss_database_lookup F
-GLIBC_2.22 __nss_group_lookup F
-GLIBC_2.22 __nss_hostname_digits_dots F
-GLIBC_2.22 __nss_hosts_lookup F
-GLIBC_2.22 __nss_next F
-GLIBC_2.22 __nss_passwd_lookup F
-GLIBC_2.22 __obstack_printf_chk F
-GLIBC_2.22 __obstack_vprintf_chk F
-GLIBC_2.22 __open F
-GLIBC_2.22 __open64 F
-GLIBC_2.22 __open64_2 F
-GLIBC_2.22 __open_2 F
-GLIBC_2.22 __openat64_2 F
-GLIBC_2.22 __openat_2 F
-GLIBC_2.22 __overflow F
-GLIBC_2.22 __pipe F
-GLIBC_2.22 __poll F
-GLIBC_2.22 __poll_chk F
-GLIBC_2.22 __posix_getopt F
-GLIBC_2.22 __ppoll_chk F
-GLIBC_2.22 __pread64 F
-GLIBC_2.22 __pread64_chk F
-GLIBC_2.22 __pread_chk F
-GLIBC_2.22 __printf_chk F
-GLIBC_2.22 __printf_fp F
-GLIBC_2.22 __profile_frequency F
-GLIBC_2.22 __progname D 0x4
-GLIBC_2.22 __progname_full D 0x4
-GLIBC_2.22 __ptsname_r_chk F
-GLIBC_2.22 __pwrite64 F
-GLIBC_2.22 __rawmemchr F
-GLIBC_2.22 __rcmd_errstr D 0x4
-GLIBC_2.22 __read F
-GLIBC_2.22 __read_chk F
-GLIBC_2.22 __readlink_chk F
-GLIBC_2.22 __readlinkat_chk F
-GLIBC_2.22 __realloc_hook D 0x4
-GLIBC_2.22 __realpath_chk F
-GLIBC_2.22 __recv_chk F
-GLIBC_2.22 __recvfrom_chk F
-GLIBC_2.22 __register_atfork F
-GLIBC_2.22 __res_init F
-GLIBC_2.22 __res_nclose F
-GLIBC_2.22 __res_ninit F
-GLIBC_2.22 __res_randomid F
-GLIBC_2.22 __res_state F
-GLIBC_2.22 __sbrk F
-GLIBC_2.22 __sched_cpualloc F
-GLIBC_2.22 __sched_cpucount F
-GLIBC_2.22 __sched_cpufree F
-GLIBC_2.22 __sched_get_priority_max F
-GLIBC_2.22 __sched_get_priority_min F
-GLIBC_2.22 __sched_getparam F
-GLIBC_2.22 __sched_getscheduler F
-GLIBC_2.22 __sched_setscheduler F
-GLIBC_2.22 __sched_yield F
-GLIBC_2.22 __select F
-GLIBC_2.22 __send F
-GLIBC_2.22 __setpgid F
-GLIBC_2.22 __sigaction F
-GLIBC_2.22 __sigaddset F
-GLIBC_2.22 __sigdelset F
-GLIBC_2.22 __sigismember F
-GLIBC_2.22 __signbit F
-GLIBC_2.22 __signbitf F
-GLIBC_2.22 __sigpause F
-GLIBC_2.22 __sigsetjmp F
-GLIBC_2.22 __sigsuspend F
-GLIBC_2.22 __snprintf_chk F
-GLIBC_2.22 __sprintf_chk F
-GLIBC_2.22 __stack_chk_fail F
-GLIBC_2.22 __stpcpy F
-GLIBC_2.22 __stpcpy_chk F
-GLIBC_2.22 __stpcpy_small F
-GLIBC_2.22 __stpncpy F
-GLIBC_2.22 __stpncpy_chk F
-GLIBC_2.22 __strcasecmp F
-GLIBC_2.22 __strcasecmp_l F
-GLIBC_2.22 __strcasestr F
-GLIBC_2.22 __strcat_chk F
-GLIBC_2.22 __strcoll_l F
-GLIBC_2.22 __strcpy_chk F
-GLIBC_2.22 __strcpy_small F
-GLIBC_2.22 __strcspn_c1 F
-GLIBC_2.22 __strcspn_c2 F
-GLIBC_2.22 __strcspn_c3 F
-GLIBC_2.22 __strdup F
-GLIBC_2.22 __strerror_r F
-GLIBC_2.22 __strfmon_l F
-GLIBC_2.22 __strftime_l F
-GLIBC_2.22 __strncasecmp_l F
-GLIBC_2.22 __strncat_chk F
-GLIBC_2.22 __strncpy_chk F
-GLIBC_2.22 __strndup F
-GLIBC_2.22 __strpbrk_c2 F
-GLIBC_2.22 __strpbrk_c3 F
-GLIBC_2.22 __strsep_1c F
-GLIBC_2.22 __strsep_2c F
-GLIBC_2.22 __strsep_3c F
-GLIBC_2.22 __strsep_g F
-GLIBC_2.22 __strspn_c1 F
-GLIBC_2.22 __strspn_c2 F
-GLIBC_2.22 __strspn_c3 F
-GLIBC_2.22 __strtod_internal F
-GLIBC_2.22 __strtod_l F
-GLIBC_2.22 __strtof_internal F
-GLIBC_2.22 __strtof_l F
-GLIBC_2.22 __strtok_r F
-GLIBC_2.22 __strtok_r_1c F
-GLIBC_2.22 __strtol_internal F
-GLIBC_2.22 __strtol_l F
-GLIBC_2.22 __strtold_internal F
-GLIBC_2.22 __strtold_l F
-GLIBC_2.22 __strtoll_internal F
-GLIBC_2.22 __strtoll_l F
-GLIBC_2.22 __strtoul_internal F
-GLIBC_2.22 __strtoul_l F
-GLIBC_2.22 __strtoull_internal F
-GLIBC_2.22 __strtoull_l F
-GLIBC_2.22 __strverscmp F
-GLIBC_2.22 __strxfrm_l F
-GLIBC_2.22 __swprintf_chk F
-GLIBC_2.22 __sysconf F
-GLIBC_2.22 __syslog_chk F
-GLIBC_2.22 __sysv_signal F
-GLIBC_2.22 __timezone D 0x4
-GLIBC_2.22 __toascii_l F
-GLIBC_2.22 __tolower_l F
-GLIBC_2.22 __toupper_l F
-GLIBC_2.22 __towctrans F
-GLIBC_2.22 __towctrans_l F
-GLIBC_2.22 __towlower_l F
-GLIBC_2.22 __towupper_l F
-GLIBC_2.22 __ttyname_r_chk F
-GLIBC_2.22 __tzname D 0x8
-GLIBC_2.22 __uflow F
-GLIBC_2.22 __underflow F
-GLIBC_2.22 __uselocale F
-GLIBC_2.22 __vasprintf_chk F
-GLIBC_2.22 __vdprintf_chk F
-GLIBC_2.22 __vfork F
-GLIBC_2.22 __vfprintf_chk F
-GLIBC_2.22 __vfscanf F
-GLIBC_2.22 __vfwprintf_chk F
-GLIBC_2.22 __vprintf_chk F
-GLIBC_2.22 __vsnprintf F
-GLIBC_2.22 __vsnprintf_chk F
-GLIBC_2.22 __vsprintf_chk F
-GLIBC_2.22 __vsscanf F
-GLIBC_2.22 __vswprintf_chk F
-GLIBC_2.22 __vsyslog_chk F
-GLIBC_2.22 __vwprintf_chk F
-GLIBC_2.22 __wait F
-GLIBC_2.22 __waitpid F
-GLIBC_2.22 __wcpcpy_chk F
-GLIBC_2.22 __wcpncpy_chk F
-GLIBC_2.22 __wcrtomb_chk F
-GLIBC_2.22 __wcscasecmp_l F
-GLIBC_2.22 __wcscat_chk F
-GLIBC_2.22 __wcscoll_l F
-GLIBC_2.22 __wcscpy_chk F
-GLIBC_2.22 __wcsftime_l F
-GLIBC_2.22 __wcsncasecmp_l F
-GLIBC_2.22 __wcsncat_chk F
-GLIBC_2.22 __wcsncpy_chk F
-GLIBC_2.22 __wcsnrtombs_chk F
-GLIBC_2.22 __wcsrtombs_chk F
-GLIBC_2.22 __wcstod_internal F
-GLIBC_2.22 __wcstod_l F
-GLIBC_2.22 __wcstof_internal F
-GLIBC_2.22 __wcstof_l F
-GLIBC_2.22 __wcstol_internal F
-GLIBC_2.22 __wcstol_l F
-GLIBC_2.22 __wcstold_internal F
-GLIBC_2.22 __wcstold_l F
-GLIBC_2.22 __wcstoll_internal F
-GLIBC_2.22 __wcstoll_l F
-GLIBC_2.22 __wcstombs_chk F
-GLIBC_2.22 __wcstoul_internal F
-GLIBC_2.22 __wcstoul_l F
-GLIBC_2.22 __wcstoull_internal F
-GLIBC_2.22 __wcstoull_l F
-GLIBC_2.22 __wcsxfrm_l F
-GLIBC_2.22 __wctomb_chk F
-GLIBC_2.22 __wctrans_l F
-GLIBC_2.22 __wctype_l F
-GLIBC_2.22 __wmemcpy_chk F
-GLIBC_2.22 __wmemmove_chk F
-GLIBC_2.22 __wmempcpy_chk F
-GLIBC_2.22 __wmemset_chk F
-GLIBC_2.22 __woverflow F
-GLIBC_2.22 __wprintf_chk F
-GLIBC_2.22 __write F
-GLIBC_2.22 __wuflow F
-GLIBC_2.22 __wunderflow F
-GLIBC_2.22 __xmknod F
-GLIBC_2.22 __xmknodat F
-GLIBC_2.22 __xpg_basename F
-GLIBC_2.22 __xpg_sigpause F
-GLIBC_2.22 __xpg_strerror_r F
-GLIBC_2.22 __xstat F
-GLIBC_2.22 __xstat64 F
-GLIBC_2.22 _dl_mcount_wrapper F
-GLIBC_2.22 _dl_mcount_wrapper_check F
-GLIBC_2.22 _environ D 0x4
-GLIBC_2.22 _exit F
-GLIBC_2.22 _flushlbf F
-GLIBC_2.22 _libc_intl_domainname D 0x5
-GLIBC_2.22 _longjmp F
-GLIBC_2.22 _mcleanup F
-GLIBC_2.22 _nl_default_dirname D 0xe
-GLIBC_2.22 _nl_domain_bindings D 0x4
-GLIBC_2.22 _nl_msg_cat_cntr D 0x4
-GLIBC_2.22 _obstack_allocated_p F
-GLIBC_2.22 _obstack_begin F
-GLIBC_2.22 _obstack_begin_1 F
-GLIBC_2.22 _obstack_free F
-GLIBC_2.22 _obstack_memory_used F
-GLIBC_2.22 _obstack_newchunk F
-GLIBC_2.22 _res D 0x200
-GLIBC_2.22 _res_hconf D 0x30
-GLIBC_2.22 _setjmp F
-GLIBC_2.22 _sys_siglist D 0x80
-GLIBC_2.22 _tolower F
-GLIBC_2.22 _toupper F
-GLIBC_2.22 a64l F
-GLIBC_2.22 abort F
-GLIBC_2.22 abs F
-GLIBC_2.22 accept F
-GLIBC_2.22 accept4 F
-GLIBC_2.22 access F
-GLIBC_2.22 acct F
-GLIBC_2.22 addmntent F
-GLIBC_2.22 addseverity F
-GLIBC_2.22 adjtime F
-GLIBC_2.22 advance F
-GLIBC_2.22 alarm F
-GLIBC_2.22 aligned_alloc F
-GLIBC_2.22 alphasort F
-GLIBC_2.22 alphasort64 F
-GLIBC_2.22 argp_err_exit_status D 0x4
-GLIBC_2.22 argp_error F
-GLIBC_2.22 argp_failure F
-GLIBC_2.22 argp_help F
-GLIBC_2.22 argp_parse F
-GLIBC_2.22 argp_program_bug_address D 0x4
-GLIBC_2.22 argp_program_version D 0x4
-GLIBC_2.22 argp_program_version_hook D 0x4
-GLIBC_2.22 argp_state_help F
-GLIBC_2.22 argp_usage F
-GLIBC_2.22 argz_add F
-GLIBC_2.22 argz_add_sep F
-GLIBC_2.22 argz_append F
-GLIBC_2.22 argz_count F
-GLIBC_2.22 argz_create F
-GLIBC_2.22 argz_create_sep F
-GLIBC_2.22 argz_delete F
-GLIBC_2.22 argz_extract F
-GLIBC_2.22 argz_insert F
-GLIBC_2.22 argz_next F
-GLIBC_2.22 argz_replace F
-GLIBC_2.22 argz_stringify F
-GLIBC_2.22 asctime F
-GLIBC_2.22 asctime_r F
-GLIBC_2.22 asprintf F
-GLIBC_2.22 atof F
-GLIBC_2.22 atoi F
-GLIBC_2.22 atol F
-GLIBC_2.22 atoll F
-GLIBC_2.22 backtrace F
-GLIBC_2.22 backtrace_symbols F
-GLIBC_2.22 backtrace_symbols_fd F
-GLIBC_2.22 basename F
-GLIBC_2.22 bcmp F
-GLIBC_2.22 bcopy F
-GLIBC_2.22 bind F
-GLIBC_2.22 bind_textdomain_codeset F
-GLIBC_2.22 bindtextdomain F
-GLIBC_2.22 brk F
-GLIBC_2.22 bsd_signal F
-GLIBC_2.22 bsearch F
-GLIBC_2.22 btowc F
-GLIBC_2.22 bzero F
-GLIBC_2.22 c16rtomb F
-GLIBC_2.22 c32rtomb F
-GLIBC_2.22 calloc F
-GLIBC_2.22 canonicalize_file_name F
-GLIBC_2.22 catclose F
-GLIBC_2.22 catgets F
-GLIBC_2.22 catopen F
-GLIBC_2.22 cfgetispeed F
-GLIBC_2.22 cfgetospeed F
-GLIBC_2.22 cfmakeraw F
-GLIBC_2.22 cfree F
-GLIBC_2.22 cfsetispeed F
-GLIBC_2.22 cfsetospeed F
-GLIBC_2.22 cfsetspeed F
-GLIBC_2.22 chdir F
-GLIBC_2.22 chflags F
-GLIBC_2.22 chmod F
-GLIBC_2.22 chown F
-GLIBC_2.22 chroot F
-GLIBC_2.22 clearenv F
-GLIBC_2.22 clearerr F
-GLIBC_2.22 clearerr_unlocked F
-GLIBC_2.22 clock F
-GLIBC_2.22 clock_getcpuclockid F
-GLIBC_2.22 clock_getres F
-GLIBC_2.22 clock_gettime F
-GLIBC_2.22 clock_nanosleep F
-GLIBC_2.22 clock_settime F
-GLIBC_2.22 close F
-GLIBC_2.22 closedir F
-GLIBC_2.22 closelog F
-GLIBC_2.22 confstr F
-GLIBC_2.22 connect F
-GLIBC_2.22 copysign F
-GLIBC_2.22 copysignf F
-GLIBC_2.22 copysignl F
-GLIBC_2.22 creat F
-GLIBC_2.22 creat64 F
-GLIBC_2.22 ctermid F
-GLIBC_2.22 ctime F
-GLIBC_2.22 ctime_r F
-GLIBC_2.22 cuserid F
-GLIBC_2.22 daemon F
-GLIBC_2.22 daylight D 0x4
-GLIBC_2.22 dcgettext F
-GLIBC_2.22 dcngettext F
-GLIBC_2.22 dgettext F
-GLIBC_2.22 difftime F
-GLIBC_2.22 dirfd F
-GLIBC_2.22 dirname F
-GLIBC_2.22 div F
-GLIBC_2.22 dl_iterate_phdr F
-GLIBC_2.22 dngettext F
-GLIBC_2.22 dprintf F
-GLIBC_2.22 drand48 F
-GLIBC_2.22 drand48_r F
-GLIBC_2.22 dup F
-GLIBC_2.22 dup2 F
-GLIBC_2.22 dup3 F
-GLIBC_2.22 duplocale F
-GLIBC_2.22 dysize F
-GLIBC_2.22 eaccess F
-GLIBC_2.22 ecvt F
-GLIBC_2.22 ecvt_r F
-GLIBC_2.22 endaliasent F
-GLIBC_2.22 endfsent F
-GLIBC_2.22 endgrent F
-GLIBC_2.22 endhostent F
-GLIBC_2.22 endmntent F
-GLIBC_2.22 endnetent F
-GLIBC_2.22 endnetgrent F
-GLIBC_2.22 endprotoent F
-GLIBC_2.22 endpwent F
-GLIBC_2.22 endservent F
-GLIBC_2.22 endsgent F
-GLIBC_2.22 endspent F
-GLIBC_2.22 endttyent F
-GLIBC_2.22 endusershell F
-GLIBC_2.22 endutent F
-GLIBC_2.22 endutxent F
-GLIBC_2.22 environ D 0x4
-GLIBC_2.22 envz_add F
-GLIBC_2.22 envz_entry F
-GLIBC_2.22 envz_get F
-GLIBC_2.22 envz_merge F
-GLIBC_2.22 envz_remove F
-GLIBC_2.22 envz_strip F
-GLIBC_2.22 erand48 F
-GLIBC_2.22 erand48_r F
-GLIBC_2.22 err F
-GLIBC_2.22 error F
-GLIBC_2.22 error_at_line F
-GLIBC_2.22 error_message_count D 0x4
-GLIBC_2.22 error_one_per_line D 0x4
-GLIBC_2.22 error_print_progname D 0x4
-GLIBC_2.22 errx F
-GLIBC_2.22 ether_aton F
-GLIBC_2.22 ether_aton_r F
-GLIBC_2.22 ether_hostton F
-GLIBC_2.22 ether_line F
-GLIBC_2.22 ether_ntoa F
-GLIBC_2.22 ether_ntoa_r F
-GLIBC_2.22 ether_ntohost F
-GLIBC_2.22 euidaccess F
-GLIBC_2.22 execl F
-GLIBC_2.22 execle F
-GLIBC_2.22 execlp F
-GLIBC_2.22 execv F
-GLIBC_2.22 execve F
-GLIBC_2.22 execvp F
-GLIBC_2.22 execvpe F
-GLIBC_2.22 exit F
-GLIBC_2.22 faccessat F
-GLIBC_2.22 fchdir F
-GLIBC_2.22 fchflags F
-GLIBC_2.22 fchmod F
-GLIBC_2.22 fchmodat F
-GLIBC_2.22 fchown F
-GLIBC_2.22 fchownat F
-GLIBC_2.22 fclose F
-GLIBC_2.22 fcloseall F
-GLIBC_2.22 fcntl F
-GLIBC_2.22 fcvt F
-GLIBC_2.22 fcvt_r F
-GLIBC_2.22 fdatasync F
-GLIBC_2.22 fdopen F
-GLIBC_2.22 fdopendir F
-GLIBC_2.22 feof F
-GLIBC_2.22 feof_unlocked F
-GLIBC_2.22 ferror F
-GLIBC_2.22 ferror_unlocked F
-GLIBC_2.22 fexecve F
-GLIBC_2.22 fflush F
-GLIBC_2.22 fflush_unlocked F
-GLIBC_2.22 ffs F
-GLIBC_2.22 ffsl F
-GLIBC_2.22 ffsll F
-GLIBC_2.22 fgetc F
-GLIBC_2.22 fgetc_unlocked F
-GLIBC_2.22 fgetgrent F
-GLIBC_2.22 fgetgrent_r F
-GLIBC_2.22 fgetpos F
-GLIBC_2.22 fgetpos64 F
-GLIBC_2.22 fgetpwent F
-GLIBC_2.22 fgetpwent_r F
-GLIBC_2.22 fgets F
-GLIBC_2.22 fgets_unlocked F
-GLIBC_2.22 fgetsgent F
-GLIBC_2.22 fgetsgent_r F
-GLIBC_2.22 fgetspent F
-GLIBC_2.22 fgetspent_r F
-GLIBC_2.22 fgetwc F
-GLIBC_2.22 fgetwc_unlocked F
-GLIBC_2.22 fgetws F
-GLIBC_2.22 fgetws_unlocked F
-GLIBC_2.22 fgetxattr F
-GLIBC_2.22 fileno F
-GLIBC_2.22 fileno_unlocked F
-GLIBC_2.22 finite F
-GLIBC_2.22 finitef F
-GLIBC_2.22 finitel F
-GLIBC_2.22 flistxattr F
-GLIBC_2.22 flock F
-GLIBC_2.22 flockfile F
-GLIBC_2.22 fmemopen F
-GLIBC_2.22 fmtmsg F
-GLIBC_2.22 fnmatch F
-GLIBC_2.22 fopen F
-GLIBC_2.22 fopen64 F
-GLIBC_2.22 fopencookie F
-GLIBC_2.22 fork F
-GLIBC_2.22 fpathconf F
-GLIBC_2.22 fprintf F
-GLIBC_2.22 fputc F
-GLIBC_2.22 fputc_unlocked F
-GLIBC_2.22 fputs F
-GLIBC_2.22 fputs_unlocked F
-GLIBC_2.22 fputwc F
-GLIBC_2.22 fputwc_unlocked F
-GLIBC_2.22 fputws F
-GLIBC_2.22 fputws_unlocked F
-GLIBC_2.22 fread F
-GLIBC_2.22 fread_unlocked F
-GLIBC_2.22 free F
-GLIBC_2.22 freeaddrinfo F
-GLIBC_2.22 freeifaddrs F
-GLIBC_2.22 freelocale F
-GLIBC_2.22 fremovexattr F
-GLIBC_2.22 freopen F
-GLIBC_2.22 freopen64 F
-GLIBC_2.22 frexp F
-GLIBC_2.22 frexpf F
-GLIBC_2.22 frexpl F
-GLIBC_2.22 fscanf F
-GLIBC_2.22 fseek F
-GLIBC_2.22 fseeko F
-GLIBC_2.22 fseeko64 F
-GLIBC_2.22 fsetpos F
-GLIBC_2.22 fsetpos64 F
-GLIBC_2.22 fsetxattr F
-GLIBC_2.22 fstatfs F
-GLIBC_2.22 fstatfs64 F
-GLIBC_2.22 fstatvfs F
-GLIBC_2.22 fstatvfs64 F
-GLIBC_2.22 fsync F
-GLIBC_2.22 ftell F
-GLIBC_2.22 ftello F
-GLIBC_2.22 ftello64 F
-GLIBC_2.22 ftime F
-GLIBC_2.22 ftok F
-GLIBC_2.22 ftruncate F
-GLIBC_2.22 ftruncate64 F
-GLIBC_2.22 ftrylockfile F
-GLIBC_2.22 fts_children F
-GLIBC_2.22 fts_close F
-GLIBC_2.22 fts_open F
-GLIBC_2.22 fts_read F
-GLIBC_2.22 fts_set F
-GLIBC_2.22 ftw F
-GLIBC_2.22 ftw64 F
-GLIBC_2.22 funlockfile F
-GLIBC_2.22 futimens F
-GLIBC_2.22 futimes F
-GLIBC_2.22 futimesat F
-GLIBC_2.22 fwide F
-GLIBC_2.22 fwprintf F
-GLIBC_2.22 fwrite F
-GLIBC_2.22 fwrite_unlocked F
-GLIBC_2.22 fwscanf F
-GLIBC_2.22 gai_strerror F
-GLIBC_2.22 gcvt F
-GLIBC_2.22 get_avphys_pages F
-GLIBC_2.22 get_current_dir_name F
-GLIBC_2.22 get_nprocs F
-GLIBC_2.22 get_nprocs_conf F
-GLIBC_2.22 get_phys_pages F
-GLIBC_2.22 getaddrinfo F
-GLIBC_2.22 getaliasbyname F
-GLIBC_2.22 getaliasbyname_r F
-GLIBC_2.22 getaliasent F
-GLIBC_2.22 getaliasent_r F
-GLIBC_2.22 getauxval F
-GLIBC_2.22 getc F
-GLIBC_2.22 getc_unlocked F
-GLIBC_2.22 getchar F
-GLIBC_2.22 getchar_unlocked F
-GLIBC_2.22 getcontext F
-GLIBC_2.22 getcwd F
-GLIBC_2.22 getdate F
-GLIBC_2.22 getdate_err D 0x4
-GLIBC_2.22 getdate_r F
-GLIBC_2.22 getdelim F
-GLIBC_2.22 getdomainname F
-GLIBC_2.22 getdtablesize F
-GLIBC_2.22 getegid F
-GLIBC_2.22 getenv F
-GLIBC_2.22 geteuid F
-GLIBC_2.22 getfsent F
-GLIBC_2.22 getfsfile F
-GLIBC_2.22 getfsspec F
-GLIBC_2.22 getgid F
-GLIBC_2.22 getgrent F
-GLIBC_2.22 getgrent_r F
-GLIBC_2.22 getgrgid F
-GLIBC_2.22 getgrgid_r F
-GLIBC_2.22 getgrnam F
-GLIBC_2.22 getgrnam_r F
-GLIBC_2.22 getgrouplist F
-GLIBC_2.22 getgroups F
-GLIBC_2.22 gethostbyaddr F
-GLIBC_2.22 gethostbyaddr_r F
-GLIBC_2.22 gethostbyname F
-GLIBC_2.22 gethostbyname2 F
-GLIBC_2.22 gethostbyname2_r F
-GLIBC_2.22 gethostbyname_r F
-GLIBC_2.22 gethostent F
-GLIBC_2.22 gethostent_r F
-GLIBC_2.22 gethostid F
-GLIBC_2.22 gethostname F
-GLIBC_2.22 getifaddrs F
-GLIBC_2.22 getipv4sourcefilter F
-GLIBC_2.22 getitimer F
-GLIBC_2.22 getline F
-GLIBC_2.22 getloadavg F
-GLIBC_2.22 getlogin F
-GLIBC_2.22 getlogin_r F
-GLIBC_2.22 getmntent F
-GLIBC_2.22 getmntent_r F
-GLIBC_2.22 getnameinfo F
-GLIBC_2.22 getnetbyaddr F
-GLIBC_2.22 getnetbyaddr_r F
-GLIBC_2.22 getnetbyname F
-GLIBC_2.22 getnetbyname_r F
-GLIBC_2.22 getnetent F
-GLIBC_2.22 getnetent_r F
-GLIBC_2.22 getnetgrent F
-GLIBC_2.22 getnetgrent_r F
-GLIBC_2.22 getopt F
-GLIBC_2.22 getopt_long F
-GLIBC_2.22 getopt_long_only F
-GLIBC_2.22 getpagesize F
-GLIBC_2.22 getpass F
-GLIBC_2.22 getpeername F
-GLIBC_2.22 getpgid F
-GLIBC_2.22 getpgrp F
-GLIBC_2.22 getpid F
-GLIBC_2.22 getppid F
-GLIBC_2.22 getpriority F
-GLIBC_2.22 getprotobyname F
-GLIBC_2.22 getprotobyname_r F
-GLIBC_2.22 getprotobynumber F
-GLIBC_2.22 getprotobynumber_r F
-GLIBC_2.22 getprotoent F
-GLIBC_2.22 getprotoent_r F
-GLIBC_2.22 getpt F
-GLIBC_2.22 getpw F
-GLIBC_2.22 getpwent F
-GLIBC_2.22 getpwent_r F
-GLIBC_2.22 getpwnam F
-GLIBC_2.22 getpwnam_r F
-GLIBC_2.22 getpwuid F
-GLIBC_2.22 getpwuid_r F
-GLIBC_2.22 getresgid F
-GLIBC_2.22 getresuid F
-GLIBC_2.22 getrlimit F
-GLIBC_2.22 getrlimit64 F
-GLIBC_2.22 getrusage F
-GLIBC_2.22 gets F
-GLIBC_2.22 getservbyname F
-GLIBC_2.22 getservbyname_r F
-GLIBC_2.22 getservbyport F
-GLIBC_2.22 getservbyport_r F
-GLIBC_2.22 getservent F
-GLIBC_2.22 getservent_r F
-GLIBC_2.22 getsgent F
-GLIBC_2.22 getsgent_r F
-GLIBC_2.22 getsgnam F
-GLIBC_2.22 getsgnam_r F
-GLIBC_2.22 getsid F
-GLIBC_2.22 getsockname F
-GLIBC_2.22 getsockopt F
-GLIBC_2.22 getsourcefilter F
-GLIBC_2.22 getspent F
-GLIBC_2.22 getspent_r F
-GLIBC_2.22 getspnam F
-GLIBC_2.22 getspnam_r F
-GLIBC_2.22 getsubopt F
-GLIBC_2.22 gettext F
-GLIBC_2.22 gettimeofday F
-GLIBC_2.22 getttyent F
-GLIBC_2.22 getttynam F
-GLIBC_2.22 getuid F
-GLIBC_2.22 getusershell F
-GLIBC_2.22 getutent F
-GLIBC_2.22 getutent_r F
-GLIBC_2.22 getutid F
-GLIBC_2.22 getutid_r F
-GLIBC_2.22 getutline F
-GLIBC_2.22 getutline_r F
-GLIBC_2.22 getutmp F
-GLIBC_2.22 getutmpx F
-GLIBC_2.22 getutxent F
-GLIBC_2.22 getutxid F
-GLIBC_2.22 getutxline F
-GLIBC_2.22 getw F
-GLIBC_2.22 getwc F
-GLIBC_2.22 getwc_unlocked F
-GLIBC_2.22 getwchar F
-GLIBC_2.22 getwchar_unlocked F
-GLIBC_2.22 getwd F
-GLIBC_2.22 getxattr F
-GLIBC_2.22 glob F
-GLIBC_2.22 glob64 F
-GLIBC_2.22 glob_pattern_p F
-GLIBC_2.22 globfree F
-GLIBC_2.22 globfree64 F
-GLIBC_2.22 gmtime F
-GLIBC_2.22 gmtime_r F
-GLIBC_2.22 gnu_get_libc_release F
-GLIBC_2.22 gnu_get_libc_version F
-GLIBC_2.22 grantpt F
-GLIBC_2.22 group_member F
-GLIBC_2.22 gsignal F
-GLIBC_2.22 gtty F
-GLIBC_2.22 h_errlist D 0x14
-GLIBC_2.22 h_nerr D 0x4
-GLIBC_2.22 hasmntopt F
-GLIBC_2.22 hcreate F
-GLIBC_2.22 hcreate_r F
-GLIBC_2.22 hdestroy F
-GLIBC_2.22 hdestroy_r F
-GLIBC_2.22 herror F
-GLIBC_2.22 hsearch F
-GLIBC_2.22 hsearch_r F
-GLIBC_2.22 hstrerror F
-GLIBC_2.22 htonl F
-GLIBC_2.22 htons F
-GLIBC_2.22 iconv F
-GLIBC_2.22 iconv_close F
-GLIBC_2.22 iconv_open F
-GLIBC_2.22 if_freenameindex F
-GLIBC_2.22 if_indextoname F
-GLIBC_2.22 if_nameindex F
-GLIBC_2.22 if_nametoindex F
-GLIBC_2.22 imaxabs F
-GLIBC_2.22 imaxdiv F
-GLIBC_2.22 in6addr_any D 0x10
-GLIBC_2.22 in6addr_loopback D 0x10
-GLIBC_2.22 index F
-GLIBC_2.22 inet6_opt_append F
-GLIBC_2.22 inet6_opt_find F
-GLIBC_2.22 inet6_opt_finish F
-GLIBC_2.22 inet6_opt_get_val F
-GLIBC_2.22 inet6_opt_init F
-GLIBC_2.22 inet6_opt_next F
-GLIBC_2.22 inet6_opt_set_val F
-GLIBC_2.22 inet6_option_alloc F
-GLIBC_2.22 inet6_option_append F
-GLIBC_2.22 inet6_option_find F
-GLIBC_2.22 inet6_option_init F
-GLIBC_2.22 inet6_option_next F
-GLIBC_2.22 inet6_option_space F
-GLIBC_2.22 inet6_rth_add F
-GLIBC_2.22 inet6_rth_getaddr F
-GLIBC_2.22 inet6_rth_init F
-GLIBC_2.22 inet6_rth_reverse F
-GLIBC_2.22 inet6_rth_segments F
-GLIBC_2.22 inet6_rth_space F
-GLIBC_2.22 inet_addr F
-GLIBC_2.22 inet_aton F
-GLIBC_2.22 inet_lnaof F
-GLIBC_2.22 inet_makeaddr F
-GLIBC_2.22 inet_netof F
-GLIBC_2.22 inet_network F
-GLIBC_2.22 inet_nsap_addr F
-GLIBC_2.22 inet_nsap_ntoa F
-GLIBC_2.22 inet_ntoa F
-GLIBC_2.22 inet_ntop F
-GLIBC_2.22 inet_pton F
-GLIBC_2.22 initgroups F
-GLIBC_2.22 initstate F
-GLIBC_2.22 initstate_r F
-GLIBC_2.22 innetgr F
-GLIBC_2.22 insque F
-GLIBC_2.22 ioctl F
-GLIBC_2.22 iruserok F
-GLIBC_2.22 iruserok_af F
-GLIBC_2.22 isalnum F
-GLIBC_2.22 isalnum_l F
-GLIBC_2.22 isalpha F
-GLIBC_2.22 isalpha_l F
-GLIBC_2.22 isascii F
-GLIBC_2.22 isatty F
-GLIBC_2.22 isblank F
-GLIBC_2.22 isblank_l F
-GLIBC_2.22 iscntrl F
-GLIBC_2.22 iscntrl_l F
-GLIBC_2.22 isctype F
-GLIBC_2.22 isdigit F
-GLIBC_2.22 isdigit_l F
-GLIBC_2.22 isfdtype F
-GLIBC_2.22 isgraph F
-GLIBC_2.22 isgraph_l F
-GLIBC_2.22 isinf F
-GLIBC_2.22 isinff F
-GLIBC_2.22 isinfl F
-GLIBC_2.22 islower F
-GLIBC_2.22 islower_l F
-GLIBC_2.22 isnan F
-GLIBC_2.22 isnanf F
-GLIBC_2.22 isnanl F
-GLIBC_2.22 isprint F
-GLIBC_2.22 isprint_l F
-GLIBC_2.22 ispunct F
-GLIBC_2.22 ispunct_l F
-GLIBC_2.22 isspace F
-GLIBC_2.22 isspace_l F
-GLIBC_2.22 isupper F
-GLIBC_2.22 isupper_l F
-GLIBC_2.22 iswalnum F
-GLIBC_2.22 iswalnum_l F
-GLIBC_2.22 iswalpha F
-GLIBC_2.22 iswalpha_l F
-GLIBC_2.22 iswblank F
-GLIBC_2.22 iswblank_l F
-GLIBC_2.22 iswcntrl F
-GLIBC_2.22 iswcntrl_l F
-GLIBC_2.22 iswctype F
-GLIBC_2.22 iswctype_l F
-GLIBC_2.22 iswdigit F
-GLIBC_2.22 iswdigit_l F
-GLIBC_2.22 iswgraph F
-GLIBC_2.22 iswgraph_l F
-GLIBC_2.22 iswlower F
-GLIBC_2.22 iswlower_l F
-GLIBC_2.22 iswprint F
-GLIBC_2.22 iswprint_l F
-GLIBC_2.22 iswpunct F
-GLIBC_2.22 iswpunct_l F
-GLIBC_2.22 iswspace F
-GLIBC_2.22 iswspace_l F
-GLIBC_2.22 iswupper F
-GLIBC_2.22 iswupper_l F
-GLIBC_2.22 iswxdigit F
-GLIBC_2.22 iswxdigit_l F
-GLIBC_2.22 isxdigit F
-GLIBC_2.22 isxdigit_l F
-GLIBC_2.22 jrand48 F
-GLIBC_2.22 jrand48_r F
-GLIBC_2.22 kill F
-GLIBC_2.22 killpg F
-GLIBC_2.22 l64a F
-GLIBC_2.22 labs F
-GLIBC_2.22 lchmod F
-GLIBC_2.22 lchown F
-GLIBC_2.22 lckpwdf F
-GLIBC_2.22 lcong48 F
-GLIBC_2.22 lcong48_r F
-GLIBC_2.22 ldexp F
-GLIBC_2.22 ldexpf F
-GLIBC_2.22 ldexpl F
-GLIBC_2.22 ldiv F
-GLIBC_2.22 lfind F
-GLIBC_2.22 lgetxattr F
-GLIBC_2.22 link F
-GLIBC_2.22 linkat F
-GLIBC_2.22 listen F
-GLIBC_2.22 listxattr F
-GLIBC_2.22 llabs F
-GLIBC_2.22 lldiv F
-GLIBC_2.22 llistxattr F
-GLIBC_2.22 loc1 D 0x4
-GLIBC_2.22 loc2 D 0x4
-GLIBC_2.22 localeconv F
-GLIBC_2.22 localtime F
-GLIBC_2.22 localtime_r F
-GLIBC_2.22 lockf F
-GLIBC_2.22 lockf64 F
-GLIBC_2.22 locs D 0x4
-GLIBC_2.22 longjmp F
-GLIBC_2.22 lrand48 F
-GLIBC_2.22 lrand48_r F
-GLIBC_2.22 lremovexattr F
-GLIBC_2.22 lsearch F
-GLIBC_2.22 lseek F
-GLIBC_2.22 lseek64 F
-GLIBC_2.22 lsetxattr F
-GLIBC_2.22 lutimes F
-GLIBC_2.22 madvise F
-GLIBC_2.22 makecontext F
-GLIBC_2.22 mallinfo F
-GLIBC_2.22 malloc F
-GLIBC_2.22 malloc_get_state F
-GLIBC_2.22 malloc_info F
-GLIBC_2.22 malloc_set_state F
-GLIBC_2.22 malloc_stats F
-GLIBC_2.22 malloc_trim F
-GLIBC_2.22 malloc_usable_size F
-GLIBC_2.22 mallopt F
-GLIBC_2.22 mallwatch D 0x4
-GLIBC_2.22 mblen F
-GLIBC_2.22 mbrlen F
-GLIBC_2.22 mbrtoc16 F
-GLIBC_2.22 mbrtoc32 F
-GLIBC_2.22 mbrtowc F
-GLIBC_2.22 mbsinit F
-GLIBC_2.22 mbsnrtowcs F
-GLIBC_2.22 mbsrtowcs F
-GLIBC_2.22 mbstowcs F
-GLIBC_2.22 mbtowc F
-GLIBC_2.22 mcheck F
-GLIBC_2.22 mcheck_check_all F
-GLIBC_2.22 mcheck_pedantic F
-GLIBC_2.22 memalign F
-GLIBC_2.22 memccpy F
-GLIBC_2.22 memchr F
-GLIBC_2.22 memcmp F
-GLIBC_2.22 memcpy F
-GLIBC_2.22 memfrob F
-GLIBC_2.22 memmem F
-GLIBC_2.22 memmove F
-GLIBC_2.22 mempcpy F
-GLIBC_2.22 memrchr F
-GLIBC_2.22 memset F
-GLIBC_2.22 mincore F
-GLIBC_2.22 mkdir F
-GLIBC_2.22 mkdirat F
-GLIBC_2.22 mkdtemp F
-GLIBC_2.22 mkfifo F
-GLIBC_2.22 mkfifoat F
-GLIBC_2.22 mkostemp F
-GLIBC_2.22 mkostemp64 F
-GLIBC_2.22 mkostemps F
-GLIBC_2.22 mkostemps64 F
-GLIBC_2.22 mkstemp F
-GLIBC_2.22 mkstemp64 F
-GLIBC_2.22 mkstemps F
-GLIBC_2.22 mkstemps64 F
-GLIBC_2.22 mktemp F
-GLIBC_2.22 mktime F
-GLIBC_2.22 mlock F
-GLIBC_2.22 mlockall F
-GLIBC_2.22 mmap F
-GLIBC_2.22 mmap64 F
-GLIBC_2.22 modf F
-GLIBC_2.22 modff F
-GLIBC_2.22 modfl F
-GLIBC_2.22 moncontrol F
-GLIBC_2.22 monstartup F
-GLIBC_2.22 mprobe F
-GLIBC_2.22 mprotect F
-GLIBC_2.22 mrand48 F
-GLIBC_2.22 mrand48_r F
-GLIBC_2.22 msgctl F
-GLIBC_2.22 msgget F
-GLIBC_2.22 msgrcv F
-GLIBC_2.22 msgsnd F
-GLIBC_2.22 msync F
-GLIBC_2.22 mtrace F
-GLIBC_2.22 munlock F
-GLIBC_2.22 munlockall F
-GLIBC_2.22 munmap F
-GLIBC_2.22 muntrace F
-GLIBC_2.22 nacl_interface_ext_supply F
-GLIBC_2.22 nacl_interface_query F
-GLIBC_2.22 nanosleep F
-GLIBC_2.22 newlocale F
-GLIBC_2.22 nftw F
-GLIBC_2.22 nftw64 F
-GLIBC_2.22 ngettext F
-GLIBC_2.22 nice F
-GLIBC_2.22 nl_langinfo F
-GLIBC_2.22 nl_langinfo_l F
-GLIBC_2.22 nrand48 F
-GLIBC_2.22 nrand48_r F
-GLIBC_2.22 ntohl F
-GLIBC_2.22 ntohs F
-GLIBC_2.22 obstack_alloc_failed_handler D 0x4
-GLIBC_2.22 obstack_exit_failure D 0x4
-GLIBC_2.22 obstack_free F
-GLIBC_2.22 obstack_printf F
-GLIBC_2.22 obstack_vprintf F
-GLIBC_2.22 on_exit F
-GLIBC_2.22 open F
-GLIBC_2.22 open64 F
-GLIBC_2.22 open_memstream F
-GLIBC_2.22 open_wmemstream F
-GLIBC_2.22 openat F
-GLIBC_2.22 openat64 F
-GLIBC_2.22 opendir F
-GLIBC_2.22 openlog F
-GLIBC_2.22 optarg D 0x4
-GLIBC_2.22 opterr D 0x4
-GLIBC_2.22 optind D 0x4
-GLIBC_2.22 optopt D 0x4
-GLIBC_2.22 parse_printf_format F
-GLIBC_2.22 pathconf F
-GLIBC_2.22 pause F
-GLIBC_2.22 pclose F
-GLIBC_2.22 perror F
-GLIBC_2.22 pipe F
-GLIBC_2.22 pipe2 F
-GLIBC_2.22 poll F
-GLIBC_2.22 popen F
-GLIBC_2.22 posix_fadvise F
-GLIBC_2.22 posix_fadvise64 F
-GLIBC_2.22 posix_fallocate F
-GLIBC_2.22 posix_fallocate64 F
-GLIBC_2.22 posix_madvise F
-GLIBC_2.22 posix_memalign F
-GLIBC_2.22 posix_openpt F
-GLIBC_2.22 posix_spawn F
-GLIBC_2.22 posix_spawn_file_actions_addclose F
-GLIBC_2.22 posix_spawn_file_actions_adddup2 F
-GLIBC_2.22 posix_spawn_file_actions_addopen F
-GLIBC_2.22 posix_spawn_file_actions_destroy F
-GLIBC_2.22 posix_spawn_file_actions_init F
-GLIBC_2.22 posix_spawnattr_destroy F
-GLIBC_2.22 posix_spawnattr_getflags F
-GLIBC_2.22 posix_spawnattr_getpgroup F
-GLIBC_2.22 posix_spawnattr_getschedparam F
-GLIBC_2.22 posix_spawnattr_getschedpolicy F
-GLIBC_2.22 posix_spawnattr_getsigdefault F
-GLIBC_2.22 posix_spawnattr_getsigmask F
-GLIBC_2.22 posix_spawnattr_init F
-GLIBC_2.22 posix_spawnattr_setflags F
-GLIBC_2.22 posix_spawnattr_setpgroup F
-GLIBC_2.22 posix_spawnattr_setschedparam F
-GLIBC_2.22 posix_spawnattr_setschedpolicy F
-GLIBC_2.22 posix_spawnattr_setsigdefault F
-GLIBC_2.22 posix_spawnattr_setsigmask F
-GLIBC_2.22 posix_spawnp F
-GLIBC_2.22 ppoll F
-GLIBC_2.22 pread F
-GLIBC_2.22 pread64 F
-GLIBC_2.22 preadv F
-GLIBC_2.22 preadv64 F
-GLIBC_2.22 printf F
-GLIBC_2.22 printf_size F
-GLIBC_2.22 printf_size_info F
-GLIBC_2.22 profil F
-GLIBC_2.22 program_invocation_name D 0x4
-GLIBC_2.22 program_invocation_short_name D 0x4
-GLIBC_2.22 pselect F
-GLIBC_2.22 psiginfo F
-GLIBC_2.22 psignal F
-GLIBC_2.22 pthread_attr_destroy F
-GLIBC_2.22 pthread_attr_getdetachstate F
-GLIBC_2.22 pthread_attr_getinheritsched F
-GLIBC_2.22 pthread_attr_getschedparam F
-GLIBC_2.22 pthread_attr_getschedpolicy F
-GLIBC_2.22 pthread_attr_getscope F
-GLIBC_2.22 pthread_attr_init F
-GLIBC_2.22 pthread_attr_setdetachstate F
-GLIBC_2.22 pthread_attr_setinheritsched F
-GLIBC_2.22 pthread_attr_setschedparam F
-GLIBC_2.22 pthread_attr_setschedpolicy F
-GLIBC_2.22 pthread_attr_setscope F
-GLIBC_2.22 pthread_cond_broadcast F
-GLIBC_2.22 pthread_cond_destroy F
-GLIBC_2.22 pthread_cond_init F
-GLIBC_2.22 pthread_cond_signal F
-GLIBC_2.22 pthread_cond_timedwait F
-GLIBC_2.22 pthread_cond_wait F
-GLIBC_2.22 pthread_condattr_destroy F
-GLIBC_2.22 pthread_condattr_init F
-GLIBC_2.22 pthread_equal F
-GLIBC_2.22 pthread_exit F
-GLIBC_2.22 pthread_getschedparam F
-GLIBC_2.22 pthread_mutex_destroy F
-GLIBC_2.22 pthread_mutex_init F
-GLIBC_2.22 pthread_mutex_lock F
-GLIBC_2.22 pthread_mutex_unlock F
-GLIBC_2.22 pthread_self F
-GLIBC_2.22 pthread_setcancelstate F
-GLIBC_2.22 pthread_setcanceltype F
-GLIBC_2.22 pthread_setschedparam F
-GLIBC_2.22 ptrace F
-GLIBC_2.22 ptsname F
-GLIBC_2.22 ptsname_r F
-GLIBC_2.22 putc F
-GLIBC_2.22 putc_unlocked F
-GLIBC_2.22 putchar F
-GLIBC_2.22 putchar_unlocked F
-GLIBC_2.22 putenv F
-GLIBC_2.22 putgrent F
-GLIBC_2.22 putpwent F
-GLIBC_2.22 puts F
-GLIBC_2.22 putsgent F
-GLIBC_2.22 putspent F
-GLIBC_2.22 pututline F
-GLIBC_2.22 pututxline F
-GLIBC_2.22 putw F
-GLIBC_2.22 putwc F
-GLIBC_2.22 putwc_unlocked F
-GLIBC_2.22 putwchar F
-GLIBC_2.22 putwchar_unlocked F
-GLIBC_2.22 pvalloc F
-GLIBC_2.22 pwrite F
-GLIBC_2.22 pwrite64 F
-GLIBC_2.22 pwritev F
-GLIBC_2.22 pwritev64 F
-GLIBC_2.22 qecvt F
-GLIBC_2.22 qecvt_r F
-GLIBC_2.22 qfcvt F
-GLIBC_2.22 qfcvt_r F
-GLIBC_2.22 qgcvt F
-GLIBC_2.22 qsort F
-GLIBC_2.22 qsort_r F
-GLIBC_2.22 quick_exit F
-GLIBC_2.22 raise F
-GLIBC_2.22 rand F
-GLIBC_2.22 rand_r F
-GLIBC_2.22 random F
-GLIBC_2.22 random_r F
-GLIBC_2.22 rawmemchr F
-GLIBC_2.22 rcmd F
-GLIBC_2.22 rcmd_af F
-GLIBC_2.22 re_comp F
-GLIBC_2.22 re_compile_fastmap F
-GLIBC_2.22 re_compile_pattern F
-GLIBC_2.22 re_exec F
-GLIBC_2.22 re_match F
-GLIBC_2.22 re_match_2 F
-GLIBC_2.22 re_search F
-GLIBC_2.22 re_search_2 F
-GLIBC_2.22 re_set_registers F
-GLIBC_2.22 re_set_syntax F
-GLIBC_2.22 re_syntax_options D 0x4
-GLIBC_2.22 read F
-GLIBC_2.22 readdir F
-GLIBC_2.22 readdir64 F
-GLIBC_2.22 readdir64_r F
-GLIBC_2.22 readdir_r F
-GLIBC_2.22 readlink F
-GLIBC_2.22 readlinkat F
-GLIBC_2.22 readv F
-GLIBC_2.22 realloc F
-GLIBC_2.22 realpath F
-GLIBC_2.22 reboot F
-GLIBC_2.22 recv F
-GLIBC_2.22 recvfrom F
-GLIBC_2.22 recvmmsg F
-GLIBC_2.22 recvmsg F
-GLIBC_2.22 regcomp F
-GLIBC_2.22 regerror F
-GLIBC_2.22 regexec F
-GLIBC_2.22 regfree F
-GLIBC_2.22 register_printf_function F
-GLIBC_2.22 register_printf_modifier F
-GLIBC_2.22 register_printf_specifier F
-GLIBC_2.22 register_printf_type F
-GLIBC_2.22 remap_file_pages F
-GLIBC_2.22 remove F
-GLIBC_2.22 removexattr F
-GLIBC_2.22 remque F
-GLIBC_2.22 rename F
-GLIBC_2.22 renameat F
-GLIBC_2.22 revoke F
-GLIBC_2.22 rewind F
-GLIBC_2.22 rewinddir F
-GLIBC_2.22 rexec F
-GLIBC_2.22 rexec_af F
-GLIBC_2.22 rexecoptions D 0x4
-GLIBC_2.22 rindex F
-GLIBC_2.22 rmdir F
-GLIBC_2.22 rpmatch F
-GLIBC_2.22 rresvport F
-GLIBC_2.22 rresvport_af F
-GLIBC_2.22 ruserok F
-GLIBC_2.22 ruserok_af F
-GLIBC_2.22 ruserpass F
-GLIBC_2.22 sbrk F
-GLIBC_2.22 scalbn F
-GLIBC_2.22 scalbnf F
-GLIBC_2.22 scalbnl F
-GLIBC_2.22 scandir F
-GLIBC_2.22 scandir64 F
-GLIBC_2.22 scandirat F
-GLIBC_2.22 scandirat64 F
-GLIBC_2.22 scanf F
-GLIBC_2.22 sched_get_priority_max F
-GLIBC_2.22 sched_get_priority_min F
-GLIBC_2.22 sched_getaffinity F
-GLIBC_2.22 sched_getparam F
-GLIBC_2.22 sched_getscheduler F
-GLIBC_2.22 sched_rr_get_interval F
-GLIBC_2.22 sched_setaffinity F
-GLIBC_2.22 sched_setparam F
-GLIBC_2.22 sched_setscheduler F
-GLIBC_2.22 sched_yield F
-GLIBC_2.22 secure_getenv F
-GLIBC_2.22 seed48 F
-GLIBC_2.22 seed48_r F
-GLIBC_2.22 seekdir F
-GLIBC_2.22 select F
-GLIBC_2.22 semctl F
-GLIBC_2.22 semget F
-GLIBC_2.22 semop F
-GLIBC_2.22 semtimedop F
-GLIBC_2.22 send F
-GLIBC_2.22 sendfile F
-GLIBC_2.22 sendfile64 F
-GLIBC_2.22 sendmmsg F
-GLIBC_2.22 sendmsg F
-GLIBC_2.22 sendto F
-GLIBC_2.22 setaliasent F
-GLIBC_2.22 setbuf F
-GLIBC_2.22 setbuffer F
-GLIBC_2.22 setcontext F
-GLIBC_2.22 setdomainname F
-GLIBC_2.22 setegid F
-GLIBC_2.22 setenv F
-GLIBC_2.22 seteuid F
-GLIBC_2.22 setfsent F
-GLIBC_2.22 setgid F
-GLIBC_2.22 setgrent F
-GLIBC_2.22 setgroups F
-GLIBC_2.22 sethostent F
-GLIBC_2.22 sethostid F
-GLIBC_2.22 sethostname F
-GLIBC_2.22 setipv4sourcefilter F
-GLIBC_2.22 setitimer F
-GLIBC_2.22 setjmp F
-GLIBC_2.22 setlinebuf F
-GLIBC_2.22 setlocale F
-GLIBC_2.22 setlogin F
-GLIBC_2.22 setlogmask F
-GLIBC_2.22 setmntent F
-GLIBC_2.22 setnetent F
-GLIBC_2.22 setnetgrent F
-GLIBC_2.22 setpgid F
-GLIBC_2.22 setpgrp F
-GLIBC_2.22 setpriority F
-GLIBC_2.22 setprotoent F
-GLIBC_2.22 setpwent F
-GLIBC_2.22 setregid F
-GLIBC_2.22 setresgid F
-GLIBC_2.22 setresuid F
-GLIBC_2.22 setreuid F
-GLIBC_2.22 setrlimit F
-GLIBC_2.22 setrlimit64 F
-GLIBC_2.22 setservent F
-GLIBC_2.22 setsgent F
-GLIBC_2.22 setsid F
-GLIBC_2.22 setsockopt F
-GLIBC_2.22 setsourcefilter F
-GLIBC_2.22 setspent F
-GLIBC_2.22 setstate F
-GLIBC_2.22 setstate_r F
-GLIBC_2.22 settimeofday F
-GLIBC_2.22 setttyent F
-GLIBC_2.22 setuid F
-GLIBC_2.22 setusershell F
-GLIBC_2.22 setutent F
-GLIBC_2.22 setutxent F
-GLIBC_2.22 setvbuf F
-GLIBC_2.22 setxattr F
-GLIBC_2.22 sgetsgent F
-GLIBC_2.22 sgetsgent_r F
-GLIBC_2.22 sgetspent F
-GLIBC_2.22 sgetspent_r F
-GLIBC_2.22 shmat F
-GLIBC_2.22 shmctl F
-GLIBC_2.22 shmdt F
-GLIBC_2.22 shmget F
-GLIBC_2.22 shutdown F
-GLIBC_2.22 sigaction F
-GLIBC_2.22 sigaddset F
-GLIBC_2.22 sigaltstack F
-GLIBC_2.22 sigandset F
-GLIBC_2.22 sigblock F
-GLIBC_2.22 sigdelset F
-GLIBC_2.22 sigemptyset F
-GLIBC_2.22 sigfillset F
-GLIBC_2.22 siggetmask F
-GLIBC_2.22 sighold F
-GLIBC_2.22 sigignore F
-GLIBC_2.22 siginterrupt F
-GLIBC_2.22 sigisemptyset F
-GLIBC_2.22 sigismember F
-GLIBC_2.22 siglongjmp F
-GLIBC_2.22 signal F
-GLIBC_2.22 sigorset F
-GLIBC_2.22 sigpause F
-GLIBC_2.22 sigpending F
-GLIBC_2.22 sigprocmask F
-GLIBC_2.22 sigqueue F
-GLIBC_2.22 sigrelse F
-GLIBC_2.22 sigreturn F
-GLIBC_2.22 sigset F
-GLIBC_2.22 sigsetmask F
-GLIBC_2.22 sigstack F
-GLIBC_2.22 sigsuspend F
-GLIBC_2.22 sigtimedwait F
-GLIBC_2.22 sigwait F
-GLIBC_2.22 sigwaitinfo F
-GLIBC_2.22 sleep F
-GLIBC_2.22 snprintf F
-GLIBC_2.22 sockatmark F
-GLIBC_2.22 socket F
-GLIBC_2.22 socketpair F
-GLIBC_2.22 sprintf F
-GLIBC_2.22 sprofil F
-GLIBC_2.22 srand F
-GLIBC_2.22 srand48 F
-GLIBC_2.22 srand48_r F
-GLIBC_2.22 srandom F
-GLIBC_2.22 srandom_r F
-GLIBC_2.22 sscanf F
-GLIBC_2.22 ssignal F
-GLIBC_2.22 sstk F
-GLIBC_2.22 statfs F
-GLIBC_2.22 statfs64 F
-GLIBC_2.22 statvfs F
-GLIBC_2.22 statvfs64 F
-GLIBC_2.22 stderr D 0x4
-GLIBC_2.22 stdin D 0x4
-GLIBC_2.22 stdout D 0x4
-GLIBC_2.22 step F
-GLIBC_2.22 stime F
-GLIBC_2.22 stpcpy F
-GLIBC_2.22 stpncpy F
-GLIBC_2.22 strcasecmp F
-GLIBC_2.22 strcasecmp_l F
-GLIBC_2.22 strcasestr F
-GLIBC_2.22 strcat F
-GLIBC_2.22 strchr F
-GLIBC_2.22 strchrnul F
-GLIBC_2.22 strcmp F
-GLIBC_2.22 strcoll F
-GLIBC_2.22 strcoll_l F
-GLIBC_2.22 strcpy F
-GLIBC_2.22 strcspn F
-GLIBC_2.22 strdup F
-GLIBC_2.22 strerror F
-GLIBC_2.22 strerror_l F
-GLIBC_2.22 strerror_r F
-GLIBC_2.22 strfmon F
-GLIBC_2.22 strfmon_l F
-GLIBC_2.22 strfry F
-GLIBC_2.22 strftime F
-GLIBC_2.22 strftime_l F
-GLIBC_2.22 strlen F
-GLIBC_2.22 strncasecmp F
-GLIBC_2.22 strncasecmp_l F
-GLIBC_2.22 strncat F
-GLIBC_2.22 strncmp F
-GLIBC_2.22 strncpy F
-GLIBC_2.22 strndup F
-GLIBC_2.22 strnlen F
-GLIBC_2.22 strpbrk F
-GLIBC_2.22 strptime F
-GLIBC_2.22 strptime_l F
-GLIBC_2.22 strrchr F
-GLIBC_2.22 strsep F
-GLIBC_2.22 strsignal F
-GLIBC_2.22 strspn F
-GLIBC_2.22 strstr F
-GLIBC_2.22 strtod F
-GLIBC_2.22 strtod_l F
-GLIBC_2.22 strtof F
-GLIBC_2.22 strtof_l F
-GLIBC_2.22 strtoimax F
-GLIBC_2.22 strtok F
-GLIBC_2.22 strtok_r F
-GLIBC_2.22 strtol F
-GLIBC_2.22 strtol_l F
-GLIBC_2.22 strtold F
-GLIBC_2.22 strtold_l F
-GLIBC_2.22 strtoll F
-GLIBC_2.22 strtoll_l F
-GLIBC_2.22 strtoq F
-GLIBC_2.22 strtoul F
-GLIBC_2.22 strtoul_l F
-GLIBC_2.22 strtoull F
-GLIBC_2.22 strtoull_l F
-GLIBC_2.22 strtoumax F
-GLIBC_2.22 strtouq F
-GLIBC_2.22 strverscmp F
-GLIBC_2.22 strxfrm F
-GLIBC_2.22 strxfrm_l F
-GLIBC_2.22 stty F
-GLIBC_2.22 swab F
-GLIBC_2.22 swapcontext F
-GLIBC_2.22 swprintf F
-GLIBC_2.22 swscanf F
-GLIBC_2.22 symlink F
-GLIBC_2.22 symlinkat F
-GLIBC_2.22 sync F
-GLIBC_2.22 syncfs F
-GLIBC_2.22 sys_sigabbrev D 0x80
-GLIBC_2.22 sys_siglist D 0x80
-GLIBC_2.22 syscall F
-GLIBC_2.22 sysconf F
-GLIBC_2.22 syslog F
-GLIBC_2.22 system F
-GLIBC_2.22 sysv_signal F
-GLIBC_2.22 tcdrain F
-GLIBC_2.22 tcflow F
-GLIBC_2.22 tcflush F
-GLIBC_2.22 tcgetattr F
-GLIBC_2.22 tcgetpgrp F
-GLIBC_2.22 tcgetsid F
-GLIBC_2.22 tcsendbreak F
-GLIBC_2.22 tcsetattr F
-GLIBC_2.22 tcsetpgrp F
-GLIBC_2.22 tdelete F
-GLIBC_2.22 tdestroy F
-GLIBC_2.22 telldir F
-GLIBC_2.22 tempnam F
-GLIBC_2.22 textdomain F
-GLIBC_2.22 tfind F
-GLIBC_2.22 time F
-GLIBC_2.22 timegm F
-GLIBC_2.22 timelocal F
-GLIBC_2.22 times F
-GLIBC_2.22 timespec_get F
-GLIBC_2.22 timezone D 0x4
-GLIBC_2.22 tmpfile F
-GLIBC_2.22 tmpfile64 F
-GLIBC_2.22 tmpnam F
-GLIBC_2.22 tmpnam_r F
-GLIBC_2.22 toascii F
-GLIBC_2.22 tolower F
-GLIBC_2.22 tolower_l F
-GLIBC_2.22 toupper F
-GLIBC_2.22 toupper_l F
-GLIBC_2.22 towctrans F
-GLIBC_2.22 towctrans_l F
-GLIBC_2.22 towlower F
-GLIBC_2.22 towlower_l F
-GLIBC_2.22 towupper F
-GLIBC_2.22 towupper_l F
-GLIBC_2.22 tr_break F
-GLIBC_2.22 truncate F
-GLIBC_2.22 truncate64 F
-GLIBC_2.22 tsearch F
-GLIBC_2.22 ttyname F
-GLIBC_2.22 ttyname_r F
-GLIBC_2.22 ttyslot F
-GLIBC_2.22 twalk F
-GLIBC_2.22 tzname D 0x8
-GLIBC_2.22 tzset F
-GLIBC_2.22 ualarm F
-GLIBC_2.22 ulckpwdf F
-GLIBC_2.22 ulimit F
-GLIBC_2.22 umask F
-GLIBC_2.22 uname F
-GLIBC_2.22 ungetc F
-GLIBC_2.22 ungetwc F
-GLIBC_2.22 unlink F
-GLIBC_2.22 unlinkat F
-GLIBC_2.22 unlockpt F
-GLIBC_2.22 unsetenv F
-GLIBC_2.22 updwtmp F
-GLIBC_2.22 updwtmpx F
-GLIBC_2.22 uselocale F
-GLIBC_2.22 usleep F
-GLIBC_2.22 ustat F
-GLIBC_2.22 utime F
-GLIBC_2.22 utimensat F
-GLIBC_2.22 utimes F
-GLIBC_2.22 utmpname F
-GLIBC_2.22 utmpxname F
-GLIBC_2.22 valloc F
-GLIBC_2.22 vasprintf F
-GLIBC_2.22 vdprintf F
-GLIBC_2.22 verr F
-GLIBC_2.22 verrx F
-GLIBC_2.22 versionsort F
-GLIBC_2.22 versionsort64 F
-GLIBC_2.22 vfork F
-GLIBC_2.22 vfprintf F
-GLIBC_2.22 vfscanf F
-GLIBC_2.22 vfwprintf F
-GLIBC_2.22 vfwscanf F
-GLIBC_2.22 vhangup F
-GLIBC_2.22 vlimit F
-GLIBC_2.22 vprintf F
-GLIBC_2.22 vscanf F
-GLIBC_2.22 vsnprintf F
-GLIBC_2.22 vsprintf F
-GLIBC_2.22 vsscanf F
-GLIBC_2.22 vswprintf F
-GLIBC_2.22 vswscanf F
-GLIBC_2.22 vsyslog F
-GLIBC_2.22 vtimes F
-GLIBC_2.22 vwarn F
-GLIBC_2.22 vwarnx F
-GLIBC_2.22 vwprintf F
-GLIBC_2.22 vwscanf F
-GLIBC_2.22 wait F
-GLIBC_2.22 wait3 F
-GLIBC_2.22 wait4 F
-GLIBC_2.22 waitid F
-GLIBC_2.22 waitpid F
-GLIBC_2.22 warn F
-GLIBC_2.22 warnx F
-GLIBC_2.22 wcpcpy F
-GLIBC_2.22 wcpncpy F
-GLIBC_2.22 wcrtomb F
-GLIBC_2.22 wcscasecmp F
-GLIBC_2.22 wcscasecmp_l F
-GLIBC_2.22 wcscat F
-GLIBC_2.22 wcschr F
-GLIBC_2.22 wcschrnul F
-GLIBC_2.22 wcscmp F
-GLIBC_2.22 wcscoll F
-GLIBC_2.22 wcscoll_l F
-GLIBC_2.22 wcscpy F
-GLIBC_2.22 wcscspn F
-GLIBC_2.22 wcsdup F
-GLIBC_2.22 wcsftime F
-GLIBC_2.22 wcsftime_l F
-GLIBC_2.22 wcslen F
-GLIBC_2.22 wcsncasecmp F
-GLIBC_2.22 wcsncasecmp_l F
-GLIBC_2.22 wcsncat F
-GLIBC_2.22 wcsncmp F
-GLIBC_2.22 wcsncpy F
-GLIBC_2.22 wcsnlen F
-GLIBC_2.22 wcsnrtombs F
-GLIBC_2.22 wcspbrk F
-GLIBC_2.22 wcsrchr F
-GLIBC_2.22 wcsrtombs F
-GLIBC_2.22 wcsspn F
-GLIBC_2.22 wcsstr F
-GLIBC_2.22 wcstod F
-GLIBC_2.22 wcstod_l F
-GLIBC_2.22 wcstof F
-GLIBC_2.22 wcstof_l F
-GLIBC_2.22 wcstoimax F
-GLIBC_2.22 wcstok F
-GLIBC_2.22 wcstol F
-GLIBC_2.22 wcstol_l F
-GLIBC_2.22 wcstold F
-GLIBC_2.22 wcstold_l F
-GLIBC_2.22 wcstoll F
-GLIBC_2.22 wcstoll_l F
-GLIBC_2.22 wcstombs F
-GLIBC_2.22 wcstoq F
-GLIBC_2.22 wcstoul F
-GLIBC_2.22 wcstoul_l F
-GLIBC_2.22 wcstoull F
-GLIBC_2.22 wcstoull_l F
-GLIBC_2.22 wcstoumax F
-GLIBC_2.22 wcstouq F
-GLIBC_2.22 wcswcs F
-GLIBC_2.22 wcswidth F
-GLIBC_2.22 wcsxfrm F
-GLIBC_2.22 wcsxfrm_l F
-GLIBC_2.22 wctob F
-GLIBC_2.22 wctomb F
-GLIBC_2.22 wctrans F
-GLIBC_2.22 wctrans_l F
-GLIBC_2.22 wctype F
-GLIBC_2.22 wctype_l F
-GLIBC_2.22 wcwidth F
-GLIBC_2.22 wmemchr F
-GLIBC_2.22 wmemcmp F
-GLIBC_2.22 wmemcpy F
-GLIBC_2.22 wmemmove F
-GLIBC_2.22 wmempcpy F
-GLIBC_2.22 wmemset F
-GLIBC_2.22 wordexp F
-GLIBC_2.22 wordfree F
-GLIBC_2.22 wprintf F
-GLIBC_2.22 write F
-GLIBC_2.22 writev F
-GLIBC_2.22 wscanf F
diff --git a/sysdeps/arm/nacl/shlib-versions b/sysdeps/arm/nacl/shlib-versions
deleted file mode 100644
index 9d94784282..0000000000
--- a/sysdeps/arm/nacl/shlib-versions
+++ /dev/null
@@ -1,4 +0,0 @@
-# Library=version Earliest symbol set (optional)
-# --------------- ------------------------------
-
-ld=ld-nacl-arm.so.1
diff --git a/sysdeps/arm/nacl/start.c b/sysdeps/arm/nacl/start.c
deleted file mode 100644
index 25f6fd774a..0000000000
--- a/sysdeps/arm/nacl/start.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/nacl/start.c>
diff --git a/sysdeps/arm/nacl/sysdep.h b/sysdeps/arm/nacl/sysdep.h
deleted file mode 100644
index 98fb41f1d0..0000000000
--- a/sysdeps/arm/nacl/sysdep.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Assembler macros for ARM/NaCl.
- Copyright (C) 2015-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 _ARM_NACL_SYSDEP_H
-#define _ARM_NACL_SYSDEP_H 1
-
-#ifdef __ASSEMBLER__
-
-# ifndef NO_THUMB
-# define NO_THUMB
-# endif
-# define ARM_SFI_MACROS 1
-
-/* The compiler driver primes the assembler with a standard set of
- macros that includes sfi_breg and sfi_sp. The sfi_pld macro is
- redundant with sfi_breg, but libc code uses it so as not to run
- afoul of the assembler's parsing bug in versions prior to 2.23.2.
- NaCl never uses an assembler that has this bug. */
-
-.macro sfi_pld basereg, offset=#0
- sfi_breg \basereg, pld [\basereg, \offset]
-.endm
-
-#endif
-
-#include <sysdeps/arm/sysdep.h>
-
-#ifdef __ASSEMBLER__
-
-# undef eabi_fnstart
-# define eabi_fnstart
-# undef eabi_fnend
-# define eabi_fnend
-# undef eabi_save
-# define eabi_save(...)
-# undef eabi_cantunwind
-# define eabi_cantunwind
-# undef eabi_pad
-# define eabi_pad(n)
-
-/* NaCl has its own special way of getting the thread pointer. */
-# undef GET_TLS
-# define GET_TLS(tmp) ldr r0, [r9]
-
-/* Rather than macroizing the code any more, we can just define a few
- mnemonics as macros here. */
-# define bl sfi_bl
-# define bx sfi_bx
-# define blx sfi_blx
-# define bxeq sfi_bxeq /* Only condition now in use. */
-
-#endif /* __ASSEMBLER__ */
-
-#endif /* sysdep.h */
diff --git a/sysdeps/arm/nacl/tls.h b/sysdeps/arm/nacl/tls.h
deleted file mode 100644
index 646e7a9d06..0000000000
--- a/sysdeps/arm/nacl/tls.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <sysdeps/arm/nptl/tls.h>
-#include <sysdeps/nacl/tls.h>
diff --git a/sysdeps/arm/nacl/uname-values.h b/sysdeps/arm/nacl/uname-values.h
deleted file mode 100644
index 923971a3cd..0000000000
--- a/sysdeps/arm/nacl/uname-values.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Constant values for the uname function to return. NaCl/ARM version.
- Copyright (C) 2015-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 UNAME_MACHINE "arm"
-#include <sysdeps/nacl/uname-values.h>
diff --git a/sysdeps/arm/nofpu/Implies b/sysdeps/arm/nofpu/Implies
new file mode 100644
index 0000000000..abcbadb25f
--- /dev/null
+++ b/sysdeps/arm/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/arm/nptl/Makefile b/sysdeps/arm/nptl/Makefile
index 5770217e47..d796f22aa6 100644
--- a/sysdeps/arm/nptl/Makefile
+++ b/sysdeps/arm/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# Copyright (C) 2005-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
# The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/nptl/bits/pthreadtypes-arch.h b/sysdeps/arm/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..1e8718f19c
--- /dev/null
+++ b/sysdeps/arm/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,71 @@
+/* Copyright (C) 2002-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <endian.h>
+
+#define __SIZEOF_PTHREAD_ATTR_T 36
+#define __SIZEOF_PTHREAD_MUTEX_T 24
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCK_T 32
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIER_T 20
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Data structure for mutex handling. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1
+#define __PTHREAD_MUTEX_USE_UNION 1
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+#else
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ unsigned char __shared;
+ unsigned char __pad1;
+ unsigned char __pad2;
+#endif
+ int __cur_writer;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/arm/nptl/bits/pthreadtypes.h b/sysdeps/arm/nptl/bits/pthreadtypes.h
deleted file mode 100644
index afb5392c8f..0000000000
--- a/sysdeps/arm/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/* Copyright (C) 2002-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 _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <endian.h>
-
-#define __SIZEOF_PTHREAD_ATTR_T 36
-#define __SIZEOF_PTHREAD_MUTEX_T 24
-#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-#define __SIZEOF_PTHREAD_COND_T 48
-#define __SIZEOF_PTHREAD_COND_COMPAT_T 12
-#define __SIZEOF_PTHREAD_CONDATTR_T 4
-#define __SIZEOF_PTHREAD_RWLOCK_T 32
-#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-#define __SIZEOF_PTHREAD_BARRIER_T 20
-#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-
-
-/* Thread identifiers. The structure of the attribute type is not
- exposed on purpose. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is not exposed on purpose. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- long int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- long int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
-#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned char __pad1;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
-#else
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- unsigned char __shared;
- unsigned char __pad1;
- unsigned char __pad2;
-#endif
- int __writer;
- } __data;
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/arm/nptl/bits/semaphore.h b/sysdeps/arm/nptl/bits/semaphore.h
index f9498c8e75..1b38b6e81e 100644
--- a/sysdeps/arm/nptl/bits/semaphore.h
+++ b/sysdeps/arm/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/nptl/pthread-offsets.h b/sysdeps/arm/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..9617354dc7
--- /dev/null
+++ b/sysdeps/arm/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+#define __PTHREAD_MUTEX_KIND_OFFSET 12
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 20
diff --git a/sysdeps/arm/nptl/pthread_spin_lock.c b/sysdeps/arm/nptl/pthread_spin_lock.c
deleted file mode 100644
index ddb5411aa3..0000000000
--- a/sysdeps/arm/nptl/pthread_spin_lock.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 2008-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 SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
-
-/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because
- it will resolve to this very file. Using "sysdeps/.." as reference to the
- top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
diff --git a/sysdeps/arm/nptl/pthreaddef.h b/sysdeps/arm/nptl/pthreaddef.h
index 4e42a7f7df..f8d821d6f2 100644
--- a/sysdeps/arm/nptl/pthreaddef.h
+++ b/sysdeps/arm/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/nptl/tcb-offsets.sym b/sysdeps/arm/nptl/tcb-offsets.sym
index 92cc441d3d..bf9c0a1c17 100644
--- a/sysdeps/arm/nptl/tcb-offsets.sym
+++ b/sysdeps/arm/nptl/tcb-offsets.sym
@@ -7,5 +7,4 @@
#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - sizeof(struct pthread))
MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
-PID_OFFSET thread_offsetof (pid)
TID_OFFSET thread_offsetof (tid)
diff --git a/sysdeps/arm/nptl/tls.h b/sysdeps/arm/nptl/tls.h
index 1ef57d2a87..ca0352dafc 100644
--- a/sysdeps/arm/nptl/tls.h
+++ b/sysdeps/arm/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/ARM version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,17 +25,7 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
@@ -110,6 +100,7 @@ typedef struct
descr->member[idx] = (value)
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/arm/preconfigure b/sysdeps/arm/preconfigure
index 33e9501c4f..d803256d9f 100644
--- a/sysdeps/arm/preconfigure
+++ b/sysdeps/arm/preconfigure
@@ -52,4 +52,5 @@ $as_echo "$as_me: WARNING: arm/preconfigure: Did not find ARM architecture type;
esac
machine=arm/$machine
+ with_fp_cond="!defined __SOFTFP__"
esac
diff --git a/sysdeps/arm/preconfigure.ac b/sysdeps/arm/preconfigure.ac
index 20de5bcfea..43d014031d 100644
--- a/sysdeps/arm/preconfigure.ac
+++ b/sysdeps/arm/preconfigure.ac
@@ -47,4 +47,5 @@ arm*)
esac
machine=arm/$machine
+ with_fp_cond="!defined __SOFTFP__"
esac
diff --git a/sysdeps/arm/s_fma.c b/sysdeps/arm/s_fma.c
deleted file mode 100644
index dc4e27bfc1..0000000000
--- a/sysdeps/arm/s_fma.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef __SOFTFP__
-# include <soft-fp/fmadf4.c>
-#else
-# include <sysdeps/ieee754/dbl-64/s_fma.c>
-#endif
diff --git a/sysdeps/arm/s_fmaf.c b/sysdeps/arm/s_fmaf.c
deleted file mode 100644
index 550d8b85d3..0000000000
--- a/sysdeps/arm/s_fmaf.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef __SOFTFP__
-# include <soft-fp/fmasf4.c>
-#else
-# include <sysdeps/ieee754/dbl-64/s_fmaf.c>
-#endif
diff --git a/sysdeps/arm/setfpucw.c b/sysdeps/arm/setfpucw.c
index b44fc5f15d..4ae14a565d 100644
--- a/sysdeps/arm/setfpucw.c
+++ b/sysdeps/arm/setfpucw.c
@@ -1,5 +1,5 @@
/* Set the FPU control word.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/setjmp.S b/sysdeps/arm/setjmp.S
index 79d3dc37d2..dc8081abe6 100644
--- a/sysdeps/arm/setjmp.S
+++ b/sysdeps/arm/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for ARM.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,20 +36,15 @@ ENTRY (__sigsetjmp)
#ifdef PTR_MANGLE
mov a4, sp
PTR_MANGLE2 (a4, a4, a3)
- sfi_breg ip, \
- str a4, [\B], #4
+ str a4, [ip], #4
PTR_MANGLE2 (a4, lr, a3)
- sfi_breg ip, \
- str a4, [\B], #4
+ str a4, [ip], #4
#else
- sfi_breg ip, \
- str sp, [\B], #4
- sfi_breg ip, \
- str lr, [\B], #4
+ str sp, [ip], #4
+ str lr, [ip], #4
#endif
/* Save registers */
- sfi_breg ip, \
- stmia \B!, JMP_BUF_REGLIST
+ stmia ip!, JMP_BUF_REGLIST
#if !defined ARM_ASSUME_NO_IWMMXT || defined __SOFTFP__
# define NEED_HWCAP 1
@@ -80,8 +75,7 @@ ENTRY (__sigsetjmp)
Don't use VFP instructions directly because this code
is used in non-VFP multilibs. */
/* Following instruction is vstmia ip!, {d8-d15}. */
- sfi_breg ip, \
- stc p11, cr8, [\B], #64
+ stc p11, cr8, [ip], #64
.Lno_vfp:
#ifndef ARM_ASSUME_NO_IWMMXT
@@ -90,18 +84,12 @@ ENTRY (__sigsetjmp)
/* Save the call-preserved iWMMXt registers. */
/* Following instructions are wstrd wr10, [ip], #8 (etc.) */
- sfi_breg r12, \
- stcl p1, cr10, [\B], #8
- sfi_breg r12, \
- stcl p1, cr11, [\B], #8
- sfi_breg r12, \
- stcl p1, cr12, [\B], #8
- sfi_breg r12, \
- stcl p1, cr13, [\B], #8
- sfi_breg r12, \
- stcl p1, cr14, [\B], #8
- sfi_breg r12, \
- stcl p1, cr15, [\B], #8
+ stcl p1, cr10, [r12], #8
+ stcl p1, cr11, [r12], #8
+ stcl p1, cr12, [r12], #8
+ stcl p1, cr13, [r12], #8
+ stcl p1, cr14, [r12], #8
+ stcl p1, cr15, [r12], #8
.Lno_iwmmxt:
#endif
diff --git a/sysdeps/arm/sotruss-lib.c b/sysdeps/arm/sotruss-lib.c
index 01b056eef4..843ff9c2e0 100644
--- a/sysdeps/arm/sotruss-lib.c
+++ b/sysdeps/arm/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for ARM.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/stackinfo.h b/sysdeps/arm/stackinfo.h
index 88bead9e24..4da1fffe84 100644
--- a/sysdeps/arm/stackinfo.h
+++ b/sysdeps/arm/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/start.S b/sysdeps/arm/start.S
index 077a8a6444..adef090717 100644
--- a/sysdeps/arm/start.S
+++ b/sysdeps/arm/start.S
@@ -1,5 +1,5 @@
/* Startup code for ARM & ELF
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -89,7 +89,7 @@ _start:
/* Push rtld_fini */
push { a1 }
-#ifdef SHARED
+#ifdef PIC
ldr sl, .L_GOT
adr a4, .L_GOT
add sl, sl, a4
@@ -127,7 +127,7 @@ _start:
/* should never get here....*/
bl abort
-#ifdef SHARED
+#ifdef PIC
.align 2
.L_GOT:
.word _GLOBAL_OFFSET_TABLE_ - .L_GOT
diff --git a/sysdeps/arm/strlen.S b/sysdeps/arm/strlen.S
index 36c77c7dac..382d1d24f7 100644
--- a/sysdeps/arm/strlen.S
+++ b/sysdeps/arm/strlen.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Code contributed by Matthew Wilcox <willy@odie.barnet.ac.uk>
@@ -30,8 +30,7 @@
ENTRY(strlen)
bic r1, r0, $3 @ addr of word containing first byte
- sfi_breg r1, \
- ldr r2, [\B], $4 @ get the first word
+ ldr r2, [r1], $4 @ get the first word
ands r3, r0, $3 @ how many bytes are duff?
rsb r0, r3, $0 @ get - that number into counter.
beq Laligned @ skip into main check routine if no
@@ -55,8 +54,7 @@ Laligned: @ here, we have a word in r2. Does it
tstne r2, $0x00ff0000 @
tstne r2, $0xff000000 @
addne r0, r0, $4 @ if not, the string is 4 bytes longer
- sfi_breg r1, \
- ldrne r2, [\B], $4 @ and we continue to the next word
+ ldrne r2, [r1], $4 @ and we continue to the next word
bne Laligned @
Llastword: @ drop through to here once we find a
#ifdef __ARMEB__
diff --git a/sysdeps/arm/submul_1.S b/sysdeps/arm/submul_1.S
index b4a3c97945..e3c7f41b7f 100644
--- a/sysdeps/arm/submul_1.S
+++ b/sysdeps/arm/submul_1.S
@@ -1,5 +1,5 @@
/* mpn_submul_1 -- multiply and subtract bignums.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,24 +37,19 @@ ENTRY (__mpn_submul_1)
cfi_rel_offset (r6, 8)
cfi_rel_offset (r7, 12)
- sfi_breg r1, \
- ldr r6, [\B], #4
- sfi_breg r0, \
- ldr r7, [\B]
+ ldr r6, [r1], #4
+ ldr r7, [r0]
mov r4, #0 /* init carry in */
b 1f
0:
- sfi_breg r1, \
- ldr r6, [\B], #4 /* load next ul */
+ ldr r6, [r1], #4 /* load next ul */
adds r5, r5, r4 /* (lpl, c) = lpl + cl */
adc r4, ip, #0 /* cl = hpl + c */
subs r5, r7, r5 /* (lpl, !c) = rl - lpl */
- sfi_breg r0, \
- ldr r7, [\B, #4] /* load next rl */
+ ldr r7, [r0, #4] /* load next rl */
it cc
addcc r4, r4, #1 /* cl += !c */
- sfi_breg r0, \
- str r5, [\B], #4
+ str r5, [r0], #4
1:
umull r5, ip, r6, r3 /* (hpl, lpl) = ul * vl */
subs r2, r2, #1
@@ -63,8 +58,7 @@ ENTRY (__mpn_submul_1)
adds r5, r5, r4 /* (lpl, c) = lpl + cl */
adc r4, ip, #0 /* cl = hpl + c */
subs r5, r7, r5 /* (lpl, !c) = rl - lpl */
- sfi_breg r0, \
- str r5, [\B], #4
+ str r5, [r0], #4
it cc
addcc r4, r4, #1 /* cl += !c */
mov r0, r4 /* return carry */
diff --git a/sysdeps/arm/sys/ucontext.h b/sysdeps/arm/sys/ucontext.h
index 744cb538cf..ababe5a062 100644
--- a/sysdeps/arm/sys/ucontext.h
+++ b/sysdeps/arm/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,74 +21,90 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
typedef int greg_t;
/* Number of general registers. */
-#define NGREG 16
+#define __NGREG 16
+#ifdef __USE_MISC
+# define NGREG __NGREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
+#ifdef __USE_MISC
/* Number of each register is the `gregset_t' array. */
enum
{
R0 = 0,
-#define R0 R0
+# define R0 R0
R1 = 1,
-#define R1 R1
+# define R1 R1
R2 = 2,
-#define R2 R2
+# define R2 R2
R3 = 3,
-#define R3 R3
+# define R3 R3
R4 = 4,
-#define R4 R4
+# define R4 R4
R5 = 5,
-#define R5 R5
+# define R5 R5
R6 = 6,
-#define R6 R6
+# define R6 R6
R7 = 7,
-#define R7 R7
+# define R7 R7
R8 = 8,
-#define R8 R8
+# define R8 R8
R9 = 9,
-#define R9 R9
+# define R9 R9
R10 = 10,
-#define R10 R10
+# define R10 R10
R11 = 11,
-#define R11 R11
+# define R11 R11
R12 = 12,
-#define R12 R12
+# define R12 R12
R13 = 13,
-#define R13 R13
+# define R13 R13
R14 = 14,
-#define R14 R14
+# define R14 R14
R15 = 15,
-#define R15 R15
+# define R15 R15
};
+#endif
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
/* Structure to describe FPU registers. */
-typedef struct fpregset
+typedef struct
{
} fpregset_t;
/* Context to describe whole processor state. */
typedef struct
{
- gregset_t gregs;
- fpregset_t fpregs;
+ gregset_t __ctx(gregs);
+ fpregset_t __ctx(fpregs);
} mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
- __sigset_t uc_sigmask;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
+ sigset_t uc_sigmask;
stack_t uc_stack;
mcontext_t uc_mcontext;
- long int uc_filler[5];
+ long int __glibc_reserved1[5];
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/arm/sysdep.h b/sysdeps/arm/sysdep.h
index 29008b4ba0..21673feea2 100644
--- a/sysdeps/arm/sysdep.h
+++ b/sysdeps/arm/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for ARM.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -150,7 +150,6 @@
second version uses it. */
# define LDST_INDEXED_NOINDEX(OP, R, T, X, Y) \
add T, X, Y; \
- sfi_breg T, \
OP R, [T]
# define LDST_INDEXED_INDEX(OP, R, X, Y) \
OP R, [X, Y]
@@ -198,7 +197,7 @@
# define LDR_GLOBAL(R, T, SYMBOL, CONSTANT) \
movw T, #:lower16:SYMBOL; \
movt T, #:upper16:SYMBOL; \
- sfi_breg T, ldr R, [\B, $CONSTANT]
+ ldr R, [T, $CONSTANT]
# elif defined (ARCH_HAS_T2) && defined (PIC) && ARM_PCREL_MOVW_OK
# define LDR_GLOBAL(R, T, SYMBOL, CONSTANT) \
movw R, #:lower16:_GLOBAL_OFFSET_TABLE_ - 97f - PC_OFS; \
@@ -212,7 +211,7 @@
97: add R, R, pc; \
98: LDST_PC_INDEXED (ldr, T, T, T); \
LDST_INDEXED (ldr, R, T, R, T); \
- sfi_breg R, ldr R, [\B, $CONSTANT]
+ ldr R, [R, $CONSTANT]
# else
# define LDR_GLOBAL(R, T, SYMBOL, CONSTANT) \
ldr T, 99f; \
@@ -277,53 +276,6 @@
cfi_restore_state
# endif /* ARCH_HAS_HARD_TP */
-# ifndef ARM_SFI_MACROS
-# define ARM_SFI_MACROS 1
-/* This assembly macro is prepended to any load/store instruction,
- pulling the base register out of the addressing mode syntax and
- making it the first operand of the macro. For example:
- ldr r0, [r1]
- becomes:
- sfi_breg r1, ldr r0, [\B]
- The \B stands in for the base register that is the first operand
- to the macro, so we can avoid error-prone repetition of the base
- register in two places on the line.
-
- This is used for all memory access through a base register other
- than PC or SP. It's intended to support SFI schemes such as
- Native Client, where the OS will enforce that all load/store
- instructions use a special form. In any such configuration,
- another sysdep.h file will have defined ARM_SFI_MACROS and
- provided its own assembly macros with the same interface. */
-
- .macro sfi_breg basereg, insn, operands:vararg
- .macro _sfi_breg_doit B
- \insn \operands
- .endm
- _sfi_breg_doit \basereg
- .purgem _sfi_breg_doit
- .endm
-
-/* This assembly macro replaces the "pld" instruction.
- The syntax:
- sfi_pld REGISTER, #OFFSET
- is exactly equivalent to:
- sfi_breg REGISTER, pld [\B, #OFFSET]
- (and ", #OFFSET" is optional). We have a separate macro
- only to work around a bug in GAS versions prior to 2.23.2,
- that misparses the sfi_breg macro expansion in this case. */
-
- .macro sfi_pld basereg, offset=#0
- pld [\basereg, \offset]
- .endm
-
-/* This macro precedes any instruction that directly changes the SP.
- It's not needed for push/pop or for any kind of load or store that
- implicitly changes the SP via the ! syntax. */
-# define sfi_sp /* Nothing to do. */
-
-# endif
-
/* These are the directives used for EABI unwind info.
Wrap them in macros so another configuration's sysdep.h
file can define them away if it doesn't use EABI unwind info. */
diff --git a/sysdeps/arm/tlsdesc.c b/sysdeps/arm/tlsdesc.c
index 3f6f132647..d142d7a2c9 100644
--- a/sysdeps/arm/tlsdesc.c
+++ b/sysdeps/arm/tlsdesc.c
@@ -1,5 +1,5 @@
/* Manage TLS descriptors. ARM version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software 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,135 +16,17 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <link.h>
#include <ldsodefs.h>
-#include <elf/dynamic-link.h>
#include <tls.h>
#include <dl-tlsdesc.h>
#include <dl-unmap-segments.h>
+#define _dl_tlsdesc_resolve_hold 0
#include <tlsdeschtab.h>
-/* This function is used to lazily resolve TLS_DESC REL relocations
- Besides the TLS descriptor itself, we get the module's got address
- as the second parameter. */
-
-void
-attribute_hidden
-_dl_tlsdesc_lazy_resolver_fixup (struct tlsdesc volatile *td,
- Elf32_Addr *got)
-{
- struct link_map *l = (struct link_map *)got[1];
- lookup_t result;
- unsigned long value;
-
- if (_dl_tlsdesc_resolve_early_return_p
- (td, (void*)(D_PTR (l, l_info[ADDRIDX (DT_TLSDESC_PLT)]) + l->l_addr)))
- return;
-
- if (td->argument.value & 0x80000000)
- {
- /* A global symbol, this is the symbol index. */
- /* The code below was borrowed from _dl_fixup(). */
- const Elf_Symndx symndx = td->argument.value ^ 0x80000000;
- const ElfW(Sym) *const symtab
- = (const void *) D_PTR (l, l_info[DT_SYMTAB]);
- const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]);
- const ElfW(Sym) *sym = &symtab[symndx];
-
- /* Look up the target symbol. If the normal lookup rules are not
- used don't look in the global scope. */
- if (ELFW(ST_BIND) (sym->st_info) != STB_LOCAL
- && __builtin_expect (ELFW(ST_VISIBILITY) (sym->st_other), 0) == 0)
- {
- const struct r_found_version *version = NULL;
-
- if (l->l_info[VERSYMIDX (DT_VERSYM)] != NULL)
- {
- const ElfW(Half) *vernum =
- (const void *) D_PTR (l, l_info[VERSYMIDX (DT_VERSYM)]);
- ElfW(Half) ndx = vernum[symndx] & 0x7fff;
- version = &l->l_versions[ndx];
- if (version->hash == 0)
- version = NULL;
- }
-
- result = _dl_lookup_symbol_x
- (strtab + sym->st_name, l, &sym,
- l->l_scope, version, ELF_RTYPE_CLASS_PLT,
- DL_LOOKUP_ADD_DEPENDENCY, NULL);
- if (sym)
- value = sym->st_value;
- else
- {
- td->entry = _dl_tlsdesc_undefweak;
- goto done;
- }
- }
- else
- {
- /* We already found the symbol. The module (and therefore its load
- address) is also known. */
- result = l;
- value = sym->st_value;
- }
- }
- else
- {
- /* A local symbol, this is the offset within our tls section.
- */
- value = td->argument.value;
- result = l;
- }
-
-#ifndef SHARED
- CHECK_STATIC_TLS (l, result);
-#else
- if (!TRY_STATIC_TLS (l, result))
- {
- td->argument.pointer = _dl_make_tlsdesc_dynamic (result, value);
- td->entry = _dl_tlsdesc_dynamic;
- }
- else
-#endif
- {
- td->argument.value = value + result->l_tls_offset;
- td->entry = _dl_tlsdesc_return;
- }
-
- done:
- _dl_tlsdesc_wake_up_held_fixups ();
-}
-
-/* This function is used to avoid busy waiting for other threads to
- complete the lazy relocation. Once another thread wins the race to
- relocate a TLS descriptor, it sets the descriptor up such that this
- function is called to wait until the resolver releases the
- lock. */
-
-void
-attribute_hidden
-_dl_tlsdesc_resolve_hold_fixup (struct tlsdesc volatile *td,
- void *caller)
-{
- /* Maybe we're lucky and can return early. */
- if (caller != td->entry)
- return;
-
- /* Locking here will stop execution until the running resolver runs
- _dl_tlsdesc_wake_up_held_fixups(), releasing the lock.
-
- FIXME: We'd be better off waiting on a condition variable, such
- that we didn't have to hold the lock throughout the relocation
- processing. */
- __rtld_lock_lock_recursive (GL(dl_load_lock));
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
-}
-
/* Unmap the dynamic object, but also release its TLS descriptor table
if there is one. */
void
-internal_function
_dl_unmap (struct link_map *map)
{
_dl_unmap_segments (map);
diff --git a/sysdeps/arm/tst-armtlsdescloc.c b/sysdeps/arm/tst-armtlsdescloc.c
index ba4834a5ce..11324306b6 100644
--- a/sysdeps/arm/tst-armtlsdescloc.c
+++ b/sysdeps/arm/tst-armtlsdescloc.c
@@ -1,5 +1,5 @@
/* ARM immediate binding GNU TLS descriptor relocation test.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/tst-armtlsdesclocmod.c b/sysdeps/arm/tst-armtlsdesclocmod.c
index d923e2945d..f5e3104911 100644
--- a/sysdeps/arm/tst-armtlsdesclocmod.c
+++ b/sysdeps/arm/tst-armtlsdesclocmod.c
@@ -1,5 +1,5 @@
/* DSO used for ARM immediate binding GNU TLS descriptor relocation test.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/tst-audit.h b/sysdeps/arm/tst-audit.h
index c0afe39cd8..b501211da5 100644
--- a/sysdeps/arm/tst-audit.h
+++ b/sysdeps/arm/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. ARM version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/arm/unwind-dw2-fde-glibc.c b/sysdeps/arm/unwind-dw2-fde-glibc.c
index ef76c05396..8e0751fc29 100644
--- a/sysdeps/arm/unwind-dw2-fde-glibc.c
+++ b/sysdeps/arm/unwind-dw2-fde-glibc.c
@@ -1,5 +1,5 @@
/* Dummy exception handling and frame unwind runtime interface routines.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/arm/unwind-resume.h b/sysdeps/arm/unwind-resume.h
index 736cc835a8..ab7683c53f 100644
--- a/sysdeps/arm/unwind-resume.h
+++ b/sysdeps/arm/unwind-resume.h
@@ -1,5 +1,5 @@
/* Definitions for unwind-resume.c. ARM (EABI) version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/arm/unwind.h b/sysdeps/arm/unwind.h
index 6e32b3ac99..a856b97501 100644
--- a/sysdeps/arm/unwind.h
+++ b/sysdeps/arm/unwind.h
@@ -1,5 +1,5 @@
/* Header file for the ARM EABI unwinder
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is free software; you can redistribute it and/or modify it
diff --git a/sysdeps/generic/Makefile b/sysdeps/generic/Makefile
index f68ac6893c..d287bfafc6 100644
--- a/sysdeps/generic/Makefile
+++ b/sysdeps/generic/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-2016 Free Software Foundation, Inc.
+# Copyright (C) 1992-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/_G_config.h b/sysdeps/generic/_G_config.h
index f44a3d4eee..7c917bf64c 100644
--- a/sysdeps/generic/_G_config.h
+++ b/sysdeps/generic/_G_config.h
@@ -1,57 +1,15 @@
-/* This file is needed by libio to define various configuration parameters.
- These are always the same in the GNU C library. */
+/* Configuration parameters for stdio - generic version. */
-#ifndef _G_config_h
-#define _G_config_h 1
-
-/* Define types for libio in terms of the standard internal type names. */
-
-#include <bits/types.h>
-#define __need_size_t
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-# define __need_wchar_t
-#endif
-#define __need_NULL
-#include <stddef.h>
-#define __need_mbstate_t
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-# define __need_wint_t
-#endif
-#include <wchar.h>
-typedef struct
-{
- __off_t __pos;
- __mbstate_t __state;
-} _G_fpos_t;
-typedef struct
-{
- __off64_t __pos;
- __mbstate_t __state;
-} _G_fpos64_t;
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-# include <gconv.h>
-typedef union
-{
- struct __gconv_info __cd;
- struct
- {
- struct __gconv_info __cd;
- struct __gconv_step_data __data;
- } __combined;
-} _G_iconv_t;
-#endif
-
-
-/* These library features are always available in the GNU C library. */
-#define _G_va_list __gnuc_va_list
+#ifndef __G_CONFIG_H
+#define __G_CONFIG_H 1
+/* Define to 1 if the operating system supports mmap, 0 otherwise.
+ This function is required by POSIX but might still be unavailable,
+ for instance when the hardware lacks support for virtual memory. */
#define _G_HAVE_MMAP 1
-#define _G_IO_IO_FILE_VERSION 0x20001
-
-/* This is defined by <bits/stat.h> if `st_blksize' exists. */
-#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
-
-#define _G_BUFSIZ 8192
+/* Define to 1 if the operating system supports mremap, 0 otherwise.
+ This function is currently a Linux-specific extension. */
+#define _G_HAVE_MREMAP 0
#endif /* _G_config.h */
diff --git a/sysdeps/generic/_itoa.h b/sysdeps/generic/_itoa.h
index 462cc09529..d54d0155c9 100644
--- a/sysdeps/generic/_itoa.h
+++ b/sysdeps/generic/_itoa.h
@@ -1,5 +1,5 @@
/* Internal function for converting integers to ASCII.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -46,7 +46,7 @@ extern char *_itoa (unsigned long long int value, char *buflim,
extern const char _itoa_upper_digits[];
extern const char _itoa_lower_digits[];
-#if IS_IN (libc) || IS_IN (rtld)
+#if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN)
hidden_proto (_itoa_upper_digits)
hidden_proto (_itoa_lower_digits)
#endif
diff --git a/sysdeps/generic/abort-instr.h b/sysdeps/generic/abort-instr.h
index 7e96e11e7f..c86516889e 100644
--- a/sysdeps/generic/abort-instr.h
+++ b/sysdeps/generic/abort-instr.h
@@ -1,5 +1,5 @@
/* Magic instruction to crash quickly and reliably. Generic/stub version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/aio_misc.h b/sysdeps/generic/aio_misc.h
index 56f872fc48..0cd030bf53 100644
--- a/sysdeps/generic/aio_misc.h
+++ b/sysdeps/generic/aio_misc.h
@@ -1,5 +1,5 @@
/* Internal declarations for <aio.h> functions implementation. Stub version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -41,7 +41,7 @@ typedef union
/* Send the signal. */
extern int __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
- internal_function;
+ attribute_hidden;
#endif /* aio_misc.h */
diff --git a/sysdeps/generic/atomic-machine.h b/sysdeps/generic/atomic-machine.h
index 6c04ad54a4..15f33901fd 100644
--- a/sysdeps/generic/atomic-machine.h
+++ b/sysdeps/generic/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/generic/bits/hwcap.h b/sysdeps/generic/bits/hwcap.h
deleted file mode 100644
index 39839ff27b..0000000000
--- a/sysdeps/generic/bits/hwcap.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Defines for bits in AT_HWCAP.
- 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/>. */
-
-#ifndef _SYS_AUXV_H
-# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
-#endif
-
-/* No bits defined for this architecture. */
diff --git a/sysdeps/generic/device-nrs.h b/sysdeps/generic/device-nrs.h
index 236d821c81..03040d6ad1 100644
--- a/sysdeps/generic/device-nrs.h
+++ b/sysdeps/generic/device-nrs.h
@@ -1,5 +1,5 @@
/* Device numbers of devices used in the implementation. Generic version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dirstream.h b/sysdeps/generic/dirstream.h
index b41bbdc023..399f00e458 100644
--- a/sysdeps/generic/dirstream.h
+++ b/sysdeps/generic/dirstream.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
index eb2f900ae5..cf43f1cf3b 100644
--- a/sysdeps/generic/dl-cache.h
+++ b/sysdeps/generic/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -100,5 +100,4 @@ struct cache_file_new
(((addr) + __alignof__ (struct cache_file_new) -1) \
& (~(__alignof__ (struct cache_file_new) - 1)))
-extern int _dl_cache_libcmp (const char *p1, const char *p2)
- internal_function attribute_hidden;
+extern int _dl_cache_libcmp (const char *p1, const char *p2) attribute_hidden;
diff --git a/sysdeps/generic/dl-dtprocnum.h b/sysdeps/generic/dl-dtprocnum.h
index 35d00529b4..dc2839b720 100644
--- a/sysdeps/generic/dl-dtprocnum.h
+++ b/sysdeps/generic/dl-dtprocnum.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
new file mode 100644
index 0000000000..b2346b2b65
--- /dev/null
+++ b/sysdeps/generic/dl-dtv.h
@@ -0,0 +1,38 @@
+/* Generic declarations for DTV-based TLS handling in the dynamic linker.
+ Copyright (C) 2002-2018 Free Software 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 _DL_DTV_H
+#define _DL_DTV_H
+
+struct dtv_pointer
+{
+ void *val; /* Pointer to data, or TLS_DTV_UNALLOCATED. */
+ void *to_free; /* Unaligned pointer, for deallocation. */
+};
+
+/* Type for the dtv. */
+typedef union dtv
+{
+ size_t counter;
+ struct dtv_pointer pointer;
+} dtv_t;
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
+
+#endif /* _DLT_DTV_H */
diff --git a/sysdeps/generic/dl-fcntl.h b/sysdeps/generic/dl-fcntl.h
new file mode 100644
index 0000000000..607bb36731
--- /dev/null
+++ b/sysdeps/generic/dl-fcntl.h
@@ -0,0 +1,21 @@
+/* Functions with hidden attribute internal to ld.so, which are declared
+ in include/fcntl.h. Generic version.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+extern __typeof (__open) __open attribute_hidden;
+extern __typeof (__fcntl) __fcntl attribute_hidden;
diff --git a/sysdeps/generic/dl-fileid.h b/sysdeps/generic/dl-fileid.h
index 7cfeefaff7..a7e2fcdfb7 100644
--- a/sysdeps/generic/dl-fileid.h
+++ b/sysdeps/generic/dl-fileid.h
@@ -1,5 +1,5 @@
/* File identity for the dynamic linker. Stub version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dl-fptr.h b/sysdeps/generic/dl-fptr.h
index df0abba642..faea7a92cb 100644
--- a/sysdeps/generic/dl-fptr.h
+++ b/sysdeps/generic/dl-fptr.h
@@ -1,5 +1,5 @@
/* Function descriptors. Generic version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dl-hash.h b/sysdeps/generic/dl-hash.h
index 6f2c408a42..1fe2efbddb 100644
--- a/sysdeps/generic/dl-hash.h
+++ b/sysdeps/generic/dl-hash.h
@@ -1,5 +1,5 @@
/* Compute hash value for given string according to ELF standard.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dl-irel.h b/sysdeps/generic/dl-irel.h
index 411943c6a6..3c3365f29f 100644
--- a/sysdeps/generic/dl-irel.h
+++ b/sysdeps/generic/dl-irel.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF indirect relocation inline functions.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dl-librecon.h b/sysdeps/generic/dl-librecon.h
index 2f617177a7..5f2601d47b 100644
--- a/sysdeps/generic/dl-librecon.h
+++ b/sysdeps/generic/dl-librecon.h
@@ -1,5 +1,5 @@
/* Optional code to distinguish library flavours.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/generic/dl-lookupcfg.h b/sysdeps/generic/dl-lookupcfg.h
index 3ac1f46869..e7d3717014 100644
--- a/sysdeps/generic/dl-lookupcfg.h
+++ b/sysdeps/generic/dl-lookupcfg.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dl-machine.h b/sysdeps/generic/dl-machine.h
index 041c99e221..fc0f2141f5 100644
--- a/sysdeps/generic/dl-machine.h
+++ b/sysdeps/generic/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. Stub version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -51,10 +51,11 @@ elf_machine_load_address (void)
/* Fixup a PLT entry to bounce directly to the function at VALUE. */
-static inline Elf32_Addr
+static inline ElfW(Addr)
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
- const Elf32_Rel *reloc,
- Elf32_Addr *reloc_addr, Elf32_Addr value)
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
+ const ElfW(Rel) *reloc,
+ ElfW(Addr) *reloc_addr, ElfW(Addr) value)
{
return *reloc_addr = value;
}
diff --git a/sysdeps/generic/dl-mman.h b/sysdeps/generic/dl-mman.h
index 66ffdb2e42..2fd6051b65 100644
--- a/sysdeps/generic/dl-mman.h
+++ b/sysdeps/generic/dl-mman.h
@@ -1,6 +1,6 @@
/* Functions with hidden attribute internal to ld.so, which are declared
in include/sys/mman.h. Generic version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dl-osinfo.h b/sysdeps/generic/dl-osinfo.h
index 2489e7b6d8..931b3710f1 100644
--- a/sysdeps/generic/dl-osinfo.h
+++ b/sysdeps/generic/dl-osinfo.h
@@ -1,5 +1,5 @@
/* Operating system specific code for generic dynamic loader functions.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dl-procinfo.h b/sysdeps/generic/dl-procinfo.h
index 578a350627..70a74bdd37 100644
--- a/sysdeps/generic/dl-procinfo.h
+++ b/sysdeps/generic/dl-procinfo.h
@@ -1,5 +1,5 @@
/* Stub version of processor capability information handling macros.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -26,9 +26,6 @@
/* There are no hardware capabilities defined. */
#define _dl_hwcap_string(idx) ""
-/* There are no different platforms defined. */
-#define _dl_platform_string(idx) ""
-
/* By default there is no important hardware capability. */
#define HWCAP_IMPORTANT (0)
diff --git a/sysdeps/generic/dl-procruntime.c b/sysdeps/generic/dl-procruntime.c
new file mode 100644
index 0000000000..a056184690
--- /dev/null
+++ b/sysdeps/generic/dl-procruntime.c
@@ -0,0 +1 @@
+/* No architecture specific definitions. */
diff --git a/sysdeps/generic/dl-prop.h b/sysdeps/generic/dl-prop.h
new file mode 100644
index 0000000000..a2b1d38c79
--- /dev/null
+++ b/sysdeps/generic/dl-prop.h
@@ -0,0 +1,54 @@
+/* Support for GNU properties. Generic version.
+ Copyright (C) 2018 Free Software 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 _DL_PROP_H
+#define _DL_PROP_H
+
+/* The following functions are used by the dynamic loader and the
+ dlopen machinery to process PT_NOTE entries in the binary or
+ shared object. The notes can be used to change the behaviour of
+ the loader, and as such offer a flexible mechanism for hooking in
+ various checks related to ABI tags or implementing "flag day" ABI
+ transitions. */
+
+static inline void __attribute__ ((always_inline))
+_rtld_main_check (struct link_map *m, const char *program)
+{
+}
+
+static inline void __attribute__ ((always_inline))
+_dl_open_check (struct link_map *m)
+{
+}
+
+#ifdef FILEBUF_SIZE
+static inline int __attribute__ ((always_inline))
+_dl_process_pt_note (struct link_map *l, const ElfW(Phdr) *ph,
+ int fd, struct filebuf *fbp)
+{
+ return 0;
+}
+#endif
+
+static inline int __attribute__ ((always_inline))
+_rtld_process_pt_note (struct link_map *l, const ElfW(Phdr) *ph)
+{
+ return 0;
+}
+
+#endif /* _DL_PROP_H */
diff --git a/sysdeps/generic/dl-sysdep.h b/sysdeps/generic/dl-sysdep.h
index df36113253..2cb8565b5b 100644
--- a/sysdeps/generic/dl-sysdep.h
+++ b/sysdeps/generic/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. Generic version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dl-unistd.h b/sysdeps/generic/dl-unistd.h
index df6376e01f..8040b4b34a 100644
--- a/sysdeps/generic/dl-unistd.h
+++ b/sysdeps/generic/dl-unistd.h
@@ -1,6 +1,6 @@
/* Functions with hidden attribute internal to ld.so, which are declared
in include/unistd.h. Generic version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/dwarf2.h b/sysdeps/generic/dwarf2.h
index 027a012c0c..12219ad8bf 100644
--- a/sysdeps/generic/dwarf2.h
+++ b/sysdeps/generic/dwarf2.h
@@ -1,6 +1,6 @@
/* Declarations and definitions of codes relating to the DWARF2 symbolic
debugging information format.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
Contributed by Gary Funck (gary@intrepid.com). Derived from the
DWARF 1 implementation written by Ron Guilmette (rfg@monkeys.com).
diff --git a/sysdeps/generic/elide.h b/sysdeps/generic/elide.h
index 39e28924bf..ea383a2f6b 100644
--- a/sysdeps/generic/elide.h
+++ b/sysdeps/generic/elide.h
@@ -1,5 +1,5 @@
/* elide.h: Fallback noop lock elision support.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/eloop-threshold.h b/sysdeps/generic/eloop-threshold.h
index 9dd2fdd840..34391a2ee1 100644
--- a/sysdeps/generic/eloop-threshold.h
+++ b/sysdeps/generic/eloop-threshold.h
@@ -1,5 +1,5 @@
/* Threshold at which to diagnose ELOOP. Generic version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/exit-thread.h b/sysdeps/generic/exit-thread.h
index 10c5aa4adf..af14a4fdfd 100644
--- a/sysdeps/generic/exit-thread.h
+++ b/sysdeps/generic/exit-thread.h
@@ -1,5 +1,5 @@
/* Call to terminate the current thread. Stub version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/fd_to_filename.h b/sysdeps/generic/fd_to_filename.h
index 61d4a3cec6..bacfe5bf52 100644
--- a/sysdeps/generic/fd_to_filename.h
+++ b/sysdeps/generic/fd_to_filename.h
@@ -1,5 +1,5 @@
/* Query filename corresponding to an open FD. Generic version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/fips-private.h b/sysdeps/generic/fips-private.h
index 25a3e210bf..6a60bc5827 100644
--- a/sysdeps/generic/fips-private.h
+++ b/sysdeps/generic/fips-private.h
@@ -1,5 +1,5 @@
/* Dummy implementation of FIPS compliance status test.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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..484adcd2cd
--- /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-2018 Free Software 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/fix-fp-int-convert-overflow.h b/sysdeps/generic/fix-fp-int-convert-overflow.h
index fb681147c0..d0a4ba9150 100644
--- a/sysdeps/generic/fix-fp-int-convert-overflow.h
+++ b/sysdeps/generic/fix-fp-int-convert-overflow.h
@@ -1,5 +1,5 @@
/* Fix for conversion of floating point to integer overflow. Generic version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,5 +29,7 @@
#define FIX_DBL_LLONG_CONVERT_OVERFLOW 0
#define FIX_LDBL_LONG_CONVERT_OVERFLOW 0
#define FIX_LDBL_LLONG_CONVERT_OVERFLOW 0
+#define FIX_FLT128_LONG_CONVERT_OVERFLOW 0
+#define FIX_FLT128_LLONG_CONVERT_OVERFLOW 0
#endif /* fix-fp-int-convert-overflow.h */
diff --git a/sysdeps/generic/fix-int-fp-convert-zero.h b/sysdeps/generic/fix-int-fp-convert-zero.h
index 01414aa00a..43ad6fda84 100644
--- a/sysdeps/generic/fix-int-fp-convert-zero.h
+++ b/sysdeps/generic/fix-int-fp-convert-zero.h
@@ -1,5 +1,5 @@
/* Fix for conversion of integer 0 to floating point. Generic version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/float128-abi.h b/sysdeps/generic/float128-abi.h
new file mode 100644
index 0000000000..dfcf083c27
--- /dev/null
+++ b/sysdeps/generic/float128-abi.h
@@ -0,0 +1 @@
+/* No _Float128 ABI support by default. */
diff --git a/sysdeps/generic/fpu_control.h b/sysdeps/generic/fpu_control.h
index 297288f3a7..8a7d8fb808 100644
--- a/sysdeps/generic/fpu_control.h
+++ b/sysdeps/generic/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word definitions. Stub version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/frame.h b/sysdeps/generic/frame.h
deleted file mode 100644
index 958dcc0495..0000000000
--- a/sysdeps/generic/frame.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Definition of stack frame structure. Generic version.
- Copyright (C) 2000-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/>. */
-
-struct layout
-{
- void *next;
- void *return_address;
-};
diff --git a/sysdeps/generic/framestate.c b/sysdeps/generic/framestate.c
index 2f10ce7559..807447364e 100644
--- a/sysdeps/generic/framestate.c
+++ b/sysdeps/generic/framestate.c
@@ -1,5 +1,5 @@
/* __frame_state_for unwinder helper function wrapper.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2001.
diff --git a/sysdeps/generic/gcc-compat.h b/sysdeps/generic/gcc-compat.h
index d776614119..404e082748 100644
--- a/sysdeps/generic/gcc-compat.h
+++ b/sysdeps/generic/gcc-compat.h
@@ -1,5 +1,5 @@
/* Macros for checking required GCC compatibility. Generic version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/gccframe.h b/sysdeps/generic/gccframe.h
index 33c60b0cf3..5467b5549e 100644
--- a/sysdeps/generic/gccframe.h
+++ b/sysdeps/generic/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. Generic version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/get-rounding-mode.h b/sysdeps/generic/get-rounding-mode.h
index 4a58e6a5a5..8d55ad7d7e 100644
--- a/sysdeps/generic/get-rounding-mode.h
+++ b/sysdeps/generic/get-rounding-mode.h
@@ -1,5 +1,5 @@
/* Determine floating-point rounding mode within libc. Generic version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/gmp-mparam.h b/sysdeps/generic/gmp-mparam.h
index baf1560400..3b8ff3fedb 100644
--- a/sysdeps/generic/gmp-mparam.h
+++ b/sysdeps/generic/gmp-mparam.h
@@ -1,5 +1,5 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright (C) 1991-2016 Free Software Foundation, Inc.
+Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/generic/hp-timing-common.h b/sysdeps/generic/hp-timing-common.h
index 257cdd3e55..505c6bf5d2 100644
--- a/sysdeps/generic/hp-timing-common.h
+++ b/sysdeps/generic/hp-timing-common.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. Generic version.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h
index 6ca7f7d03f..e2c02c2bc0 100644
--- a/sysdeps/generic/hp-timing.h
+++ b/sysdeps/generic/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. Generic version.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/generic/ifreq.h b/sysdeps/generic/ifreq.h
index 5ff0ef8805..4b7b93e9a4 100644
--- a/sysdeps/generic/ifreq.h
+++ b/sysdeps/generic/ifreq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>.
@@ -23,18 +23,6 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
-static inline struct ifreq *
-__if_nextreq (struct ifreq *ifr)
-{
-#ifdef _HAVE_SA_LEN
- if (ifr->ifr_addr.sa_len > sizeof ifr->ifr_addr)
- return (struct ifreq *) ((char *) &ifr->ifr_addr + ifr->ifr_addr.sa_len);
-#endif
- return ifr + 1;
-}
-
-extern void __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd);
-
static inline void
__if_freereq (struct ifreq *ifreqs, int num_ifs)
diff --git a/sysdeps/generic/ifunc-init.h b/sysdeps/generic/ifunc-init.h
new file mode 100644
index 0000000000..241e416179
--- /dev/null
+++ b/sysdeps/generic/ifunc-init.h
@@ -0,0 +1,54 @@
+/* IFUNC generic definitions.
+ This file is part of the GNU C Library.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/>. */
+
+/* These macros are used to implement ifunc selection in C. To implement
+ an ifunc function, foo, which returns the address of __foo_impl1 or
+ __foo_impl2:
+
+ #define foo __redirect_foo
+ #include <foo.h>
+ #undef foo
+ #define SYMBOL_NAME foo
+ #include <ifunc-init.h>
+
+ extern __typeof (REDIRECT_NAME) OPTIMIZE (impl1) attribute_hidden;
+ extern __typeof (REDIRECT_NAME) OPTIMIZE (impl2) attribute_hidden;
+
+ static inline void *
+ foo_selector (void)
+ {
+ if (condition)
+ return OPTIMIZE (impl2);
+
+ return OPTIMIZE (impl1);
+ }
+
+ libc_ifunc_redirected (__redirect_foo, foo, IFUNC_SELECTOR ());
+*/
+
+#define PASTER1(x,y) x##_##y
+#define EVALUATOR1(x,y) PASTER1 (x,y)
+#define PASTER2(x,y) __##x##_##y
+#define EVALUATOR2(x,y) PASTER2 (x,y)
+
+/* Basically set '__redirect_<symbol>' to use as type definition,
+ '__<symbol>_<variant>' as the optimized implementation and
+ '<symbol>_ifunc_selector' as the IFUNC selector. */
+#define REDIRECT_NAME EVALUATOR1 (__redirect, SYMBOL_NAME)
+#define OPTIMIZE(name) EVALUATOR2 (SYMBOL_NAME, name)
+#define IFUNC_SELECTOR EVALUATOR1 (SYMBOL_NAME, ifunc_selector)
diff --git a/sysdeps/generic/ifunc-sel.h b/sysdeps/generic/ifunc-sel.h
index 6a27b69c5b..1fff4059cc 100644
--- a/sysdeps/generic/ifunc-sel.h
+++ b/sysdeps/generic/ifunc-sel.h
@@ -5,6 +5,7 @@
extern int global;
static inline void *
+inhibit_stack_protector
ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
{
switch (global)
@@ -19,6 +20,7 @@ ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
}
static inline void *
+inhibit_stack_protector
ifunc_one (int (*f1) (void))
{
return f1;
diff --git a/sysdeps/generic/internal-signals.h b/sysdeps/generic/internal-signals.h
new file mode 100644
index 0000000000..5282cffce0
--- /dev/null
+++ b/sysdeps/generic/internal-signals.h
@@ -0,0 +1,62 @@
+/* Special use of signals internally. Stub version.
+ Copyright (C) 2014-2018 Free Software 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 __INTERNAL_SIGNALS_H
+# define __INTERNAL_SIGNALS_H
+
+#include <signal.h>
+#include <sigsetops.h>
+#include <stdbool.h>
+
+static inline bool
+__is_internal_signal (int sig)
+{
+ return false;
+}
+
+static inline void
+__clear_internal_signals (sigset_t *set)
+{
+}
+
+static inline int
+__libc_signal_block_all (sigset_t *set)
+{
+ sigset_t allset;
+ __sigfillset (&allset);
+ return __sigprocmask (SIG_BLOCK, &allset, set);
+}
+
+static inline int
+__libc_signal_block_app (sigset_t *set)
+{
+ sigset_t allset;
+ __sigfillset (&allset);
+ __clear_internal_signals (&allset);
+ return __sigprocmask (SIG_BLOCK, &allset, set);
+}
+
+/* Restore current process signal mask. */
+static inline int
+__libc_signal_restore_set (const sigset_t *set)
+{
+ return __sigprocmask (SIG_SETMASK, set, NULL);
+}
+
+
+#endif /* __INTERNAL_SIGNALS_H */
diff --git a/sysdeps/generic/inttypes.h b/sysdeps/generic/inttypes.h
index 1207bf2e73..69f8cb17a5 100644
--- a/sysdeps/generic/inttypes.h
+++ b/sysdeps/generic/inttypes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/ldbl-classify-compat.h b/sysdeps/generic/ldbl-classify-compat.h
new file mode 100644
index 0000000000..d77ca18275
--- /dev/null
+++ b/sysdeps/generic/ldbl-classify-compat.h
@@ -0,0 +1,33 @@
+/* Specify whether there should be compat symbol aliases for some
+ classification functions. Generic version.
+ Copyright (C) 2015-2018 Free Software 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 _LDBL_CLASSIFY_COMPAT_H
+#define _LDBL_CLASSIFY_COMPAT_H 1
+
+/* If defined to 1, enable __finitel, __isinfl, and __isnanl function
+ aliases for binary compatibility when built without long double
+ support. If defined to 0, or if long double does not have the same
+ format as double, there are no such aliases. New ports should use
+ the default definition of this as 0, as such
+ implementation-namespace functions should only have one exported
+ name per floating-point format, not one per floating-point
+ type. */
+#define LDBL_CLASSIFY_COMPAT 0
+
+#endif /* ldbl-classify-compat.h */
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
index 07600b7596..59e20dc3ef 100644
--- a/sysdeps/generic/ldconfig.h
+++ b/sysdeps/generic/ldconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999.
@@ -42,6 +42,8 @@
#define FLAG_MIPS_LIB32_NAN2008 0x0c00
#define FLAG_MIPS64_LIBN32_NAN2008 0x0d00
#define FLAG_MIPS64_LIBN64_NAN2008 0x0e00
+#define FLAG_RISCV_FLOAT_ABI_SOFT 0x0f00
+#define FLAG_RISCV_FLOAT_ABI_DOUBLE 0x1000
/* Name of auxiliary cache. */
#define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 2733ac8268..95dc87519b 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,14 +66,21 @@ __BEGIN_DECLS
/* Result of the lookup functions and how to retrieve the base address. */
typedef struct link_map *lookup_t;
#define LOOKUP_VALUE(map) map
-#define LOOKUP_VALUE_ADDRESS(map) ((map) ? (map)->l_addr : 0)
+#define LOOKUP_VALUE_ADDRESS(map, set) ((set) || (map) ? (map)->l_addr : 0)
+
+/* Calculate the address of symbol REF using the base address from map MAP,
+ if non-NULL. Don't check for NULL map if MAP_SET is TRUE. */
+#define SYMBOL_ADDRESS(map, ref, map_set) \
+ ((ref) == NULL ? 0 \
+ : (__glibc_unlikely ((ref)->st_shndx == SHN_ABS) ? 0 \
+ : LOOKUP_VALUE_ADDRESS (map, map_set)) + (ref)->st_value)
/* On some architectures a pointer to a function is not just a pointer
to the actual code of the function but rather an architecture
specific descriptor. */
#ifndef ELF_FUNCTION_PTR_IS_SPECIAL
# define DL_SYMBOL_ADDRESS(map, ref) \
- (void *) (LOOKUP_VALUE_ADDRESS (map) + ref->st_value)
+ (void *) SYMBOL_ADDRESS (map, ref, false)
# define DL_LOOKUP_ADDRESS(addr) ((ElfW(Addr)) (addr))
# define DL_CALL_DT_INIT(map, start, argc, argv, env) \
((init_t) (start)) (argc, argv, env)
@@ -88,6 +95,19 @@ typedef struct link_map *lookup_t;
|| (ADDR) < (L)->l_addr + (SYM)->st_value + (SYM)->st_size) \
&& ((MATCHSYM) == NULL || (MATCHSYM)->st_value < (SYM)->st_value))
+/* According to the ELF gABI no STV_HIDDEN or STV_INTERNAL symbols are
+ expected to be present in dynamic symbol tables as they should have
+ been either removed or converted to STB_LOCAL binding by the static
+ linker. However some GNU binutils versions produce such symbols in
+ some cases. To prevent such symbols present in a buggy binary from
+ preempting global symbols we filter them out with this predicate. */
+static __always_inline bool
+dl_symbol_visibility_binds_local_p (const ElfW(Sym) *sym)
+{
+ return (ELFW(ST_VISIBILITY) (sym->st_other) == STV_HIDDEN
+ || ELFW(ST_VISIBILITY) (sym->st_other) == STV_INTERNAL);
+}
+
/* Unmap a loaded object, called by _dl_close (). */
#ifndef DL_UNMAP_IS_SPECIAL
# define DL_UNMAP(map) _dl_unmap_segments (map)
@@ -235,11 +255,14 @@ struct audit_ifaces
/* Test whether given NAME matches any of the names of the given object. */
extern int _dl_name_match_p (const char *__name, const struct link_map *__map)
- internal_function attribute_hidden;
+ attribute_hidden;
/* Compute next higher prime number. */
extern unsigned long int _dl_higher_prime_number (unsigned long int n)
- internal_function attribute_hidden;
+ attribute_hidden;
+
+/* A stripped down strtoul-like implementation. */
+uint64_t _dl_strtoul (const char *, char **) attribute_hidden;
/* Function used as argument for `_dl_receive_error' function. The
arguments are the error code, error string, and the objname the
@@ -344,10 +367,6 @@ struct rtld_global
/* List of search directories. */
EXTERN struct r_search_path_elem *_dl_all_dirs;
-#ifdef _LIBC_REENTRANT
- EXTERN void **(*_dl_error_catch_tsd) (void) __attribute__ ((const));
-#endif
-
/* Structure describing the dynamic linker itself. We need to
reserve memory for the data the audit libraries need. */
EXTERN struct link_map _dl_rtld_map;
@@ -361,10 +380,17 @@ struct rtld_global
EXTERN void (*_dl_rtld_unlock_recursive) (void *);
#endif
+ /* Get architecture specific definitions. */
+#define PROCINFO_DECL
+#ifndef PROCINFO_CLASS
+# define PROCINFO_CLASS EXTERN
+#endif
+#include <dl-procruntime.c>
+
/* If loading a shared object requires that we make the stack executable
when it was not, we do it by calling this function.
It returns an errno code or zero on success. */
- EXTERN int (*_dl_make_stack_executable_hook) (void **) internal_function;
+ EXTERN int (*_dl_make_stack_executable_hook) (void **);
/* Prevailing state of the stack, PF_X indicating it's executable. */
EXTERN ElfW(Word) _dl_stack_flags;
@@ -416,6 +442,9 @@ struct rtld_global
size_t count;
void *list[50];
} *_dl_scope_free_list;
+#if !THREAD_GSCOPE_IN_TCB
+ EXTERN int _dl_thread_gscope_count;
+#endif
#ifdef SHARED
};
# define __rtld_global_attribute__
@@ -506,17 +535,17 @@ struct rtld_global_ro
/* Mask for hardware capabilities that are available. */
EXTERN uint64_t _dl_hwcap;
+#if !HAVE_TUNABLES
/* Mask for important hardware capabilities we honour. */
EXTERN uint64_t _dl_hwcap_mask;
+#endif
+#ifdef HAVE_AUX_VECTOR
/* Pointer to the auxv list supplied to the program at startup. */
EXTERN ElfW(auxv_t) *_dl_auxv;
+#endif
/* Get architecture specific definitions. */
-#define PROCINFO_DECL
-#ifndef PROCINFO_CLASS
-# define PROCINFO_CLASS EXTERN
-#endif
#include <dl-procinfo.c>
/* Names of shared object for which the RPATH should be ignored. */
@@ -539,7 +568,11 @@ struct rtld_global_ro
/* Map of shared object to be prelink traced. */
EXTERN struct link_map *_dl_trace_prelink_map;
- /* All search directories defined at startup. */
+ /* All search directories defined at startup. This is assigned a
+ non-NULL pointer by the ld.so startup code (after initialization
+ to NULL), so this can also serve as an indicator whether a copy
+ of ld.so is initialized and active. See the rtld_active function
+ below. */
EXTERN struct r_search_path_elem *_dl_init_all_dirs;
#ifdef NEED_DL_SYSINFO
@@ -568,19 +601,11 @@ struct rtld_global_ro
PLT relocations in libc.so. */
void (*_dl_debug_printf) (const char *, ...)
__attribute__ ((__format__ (__printf__, 1, 2)));
- int (internal_function *_dl_catch_error) (const char **, const char **,
- bool *, void (*) (void *), void *);
- void (internal_function *_dl_signal_error) (int, const char *, const char *,
- const char *);
void (*_dl_mcount) (ElfW(Addr) frompc, ElfW(Addr) selfpc);
- lookup_t (internal_function *_dl_lookup_symbol_x) (const char *,
- struct link_map *,
- const ElfW(Sym) **,
- struct r_scope_elem *[],
- const struct r_found_version *,
- int, int,
- struct link_map *);
- int (*_dl_check_caller) (const void *, enum allowmask);
+ lookup_t (*_dl_lookup_symbol_x) (const char *, struct link_map *,
+ const ElfW(Sym) **, struct r_scope_elem *[],
+ const struct r_found_version *, int, int,
+ struct link_map *);
void *(*_dl_open) (const char *file, int mode, const void *caller_dlopen,
Lmid_t nsid, int argc, char *argv[], char *env[]);
void (*_dl_close) (void *map);
@@ -617,16 +642,9 @@ extern const ElfW(Phdr) *_dl_phdr;
extern size_t _dl_phnum;
#endif
-#if IS_IN (rtld)
-/* This is the initial value of GL(dl_error_catch_tsd).
- A non-TLS libpthread will change it. */
-extern void **_dl_initial_error_catch_tsd (void) __attribute__ ((const))
- attribute_hidden;
-#endif
-
/* This is the initial value of GL(dl_make_stack_executable_hook).
A threads library can change it. */
-extern int _dl_make_stack_executable (void **stack_endp) internal_function;
+extern int _dl_make_stack_executable (void **stack_endp);
rtld_hidden_proto (_dl_make_stack_executable)
/* Variable pointing to the end of the stack (or close to it). This value
@@ -690,9 +708,20 @@ extern void _dl_debug_printf_c (const char *fmt, ...)
/* Write a message on the specified descriptor FD. The parameters are
interpreted as for a `printf' call. */
+#if IS_IN (rtld) || !defined (SHARED)
extern void _dl_dprintf (int fd, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)))
attribute_hidden;
+#else
+__attribute__ ((always_inline, __format__ (__printf__, 2, 3)))
+static inline void
+_dl_dprintf (int fd, const char *fmt, ...)
+{
+ /* Use local declaration to avoid includign <stdio.h>. */
+ extern int __dprintf(int fd, const char *format, ...) attribute_hidden;
+ __dprintf (fd, fmt, __builtin_va_arg_pack ());
+}
+#endif
/* Write a message on the specified descriptor standard output. The
parameters are interpreted as for a `printf' call. */
@@ -715,41 +744,118 @@ extern void _dl_dprintf (int fd, const char *fmt, ...)
while (1)
-/* This function is called by all the internal dynamic linker functions
- when they encounter an error. ERRCODE is either an `errno' code or
- zero; OBJECT is the name of the problematical shared object, or null if
- it is a general problem; ERRSTRING is a string describing the specific
- problem. */
+/* An exception raised by the _dl_signal_error function family and
+ caught by _dl_catch_error function family. Exceptions themselves
+ are copied as part of the raise operation, but the strings are
+ not. */
+struct dl_exception
+{
+ const char *objname;
+ const char *errstring;
+
+ /* This buffer typically stores both objname and errstring
+ above. */
+ char *message_buffer;
+};
+
+/* Creates a new exception. This calls malloc; if allocation fails,
+ dummy values are inserted. OBJECT is the name of the problematical
+ shared object, or null if its a general problem. ERRSTRING is a
+ string describing the specific problem. */
+void _dl_exception_create (struct dl_exception *, const char *object,
+ const char *errstring)
+ __attribute__ ((nonnull (1, 3)));
+rtld_hidden_proto (_dl_exception_create)
+
+/* Like _dl_exception_create, but create errstring from a format
+ string FMT. Currently, only "%s" and "%%" are supported as format
+ directives. */
+void _dl_exception_create_format (struct dl_exception *, const char *objname,
+ const char *fmt, ...)
+ __attribute__ ((nonnull (1, 3), format (printf, 3, 4)));
+rtld_hidden_proto (_dl_exception_create_format)
+
+/* Deallocate the exception, freeing allocated buffers (if
+ possible). */
+void _dl_exception_free (struct dl_exception *)
+ __attribute__ ((nonnull (1)));
+rtld_hidden_proto (_dl_exception_free)
+
+/* This function is called by all the internal dynamic linker
+ functions when they encounter an error. ERRCODE is either an
+ `errno' code or zero; it specifies the return value of
+ _dl_catch_error. OCCASION is included in the error message if the
+ process is terminated immediately. */
+void _dl_signal_exception (int errcode, struct dl_exception *,
+ const char *occasion)
+ __attribute__ ((__noreturn__));
+libc_hidden_proto (_dl_signal_exception)
+
+/* Like _dl_signal_exception, but creates the exception first. */
extern void _dl_signal_error (int errcode, const char *object,
- const char *occurred, const char *errstring)
- internal_function __attribute__ ((__noreturn__)) attribute_hidden;
+ const char *occasion, const char *errstring)
+ __attribute__ ((__noreturn__));
+libc_hidden_proto (_dl_signal_error)
+
+/* Like _dl_signal_exception, but may return when called in the
+ context of _dl_receive_error. This is only used during ld.so
+ bootstrap. In static and profiled builds, this is equivalent to
+ _dl_signal_exception. */
+#if IS_IN (rtld)
+extern void _dl_signal_cexception (int errcode, struct dl_exception *,
+ const char *occasion) attribute_hidden;
+#else
+__attribute__ ((always_inline))
+static inline void
+_dl_signal_cexception (int errcode, struct dl_exception *exception,
+ const char *occasion)
+{
+ _dl_signal_exception (errcode, exception, occasion);
+}
+#endif
-/* Like _dl_signal_error, but may return when called in the context of
- _dl_receive_error. */
+/* See _dl_signal_cexception above. */
+#if IS_IN (rtld)
extern void _dl_signal_cerror (int errcode, const char *object,
- const char *occation, const char *errstring)
- internal_function attribute_hidden;
+ const char *occasion, const char *errstring)
+ attribute_hidden;
+#else
+__attribute__ ((always_inline))
+static inline void
+_dl_signal_cerror (int errcode, const char *object,
+ const char *occasion, const char *errstring)
+{
+ _dl_signal_error (errcode, object, occasion, errstring);
+}
+#endif
/* Call OPERATE, receiving errors from `dl_signal_cerror'. Unlike
`_dl_catch_error' the operation is resumed after the OPERATE
function returns.
ARGS is passed as argument to OPERATE. */
extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *),
- void *args)
- internal_function attribute_hidden;
-
-/* Call OPERATE, catching errors from `dl_signal_error'. If there is no
- error, *ERRSTRING is set to null. If there is an error, *ERRSTRING is
- set to a string constructed from the strings passed to _dl_signal_error,
- and the error code passed is the return value and *OBJNAME is set to
- the object name which experienced the problems. ERRSTRING if nonzero
- points to a malloc'ed string which the caller has to free after use.
- ARGS is passed as argument to OPERATE. MALLOCEDP is set to true only
- if the returned string is allocated using the libc's malloc. */
+ void *args) attribute_hidden;
+
+/* Call OPERATE, catching errors from `_dl_signal_error' and related
+ functions. If there is no error, *ERRSTRING is set to null. If
+ there is an error, *ERRSTRING is set to a string constructed from
+ the strings passed to _dl_signal_error, and the error code passed
+ is the return value and *OBJNAME is set to the object name which
+ experienced the problems. ERRSTRING if nonzero points to a
+ malloc'ed string which the caller has to free after use. ARGS is
+ passed as argument to OPERATE. MALLOCEDP is set to true only if
+ the returned string is allocated using the libc's malloc. */
extern int _dl_catch_error (const char **objname, const char **errstring,
bool *mallocedp, void (*operate) (void *),
- void *args)
- internal_function attribute_hidden;
+ void *args);
+libc_hidden_proto (_dl_catch_error)
+
+/* Call OPERATE (ARGS). If no error occurs, set *EXCEPTION to zero.
+ Otherwise, store a copy of the raised exception in *EXCEPTION,
+ which has to be freed by _dl_exception_free. */
+int _dl_catch_exception (struct dl_exception *exception,
+ void (*operate) (void *), void *args);
+libc_hidden_proto (_dl_catch_exception)
/* Open the shared object NAME and map in its segments.
LOADER's DT_RPATH is used in searching for NAME.
@@ -757,8 +863,7 @@ extern int _dl_catch_error (const char **objname, const char **errstring,
extern struct link_map *_dl_map_object (struct link_map *loader,
const char *name,
int type, int trace_mode, int mode,
- Lmid_t nsid)
- internal_function attribute_hidden;
+ Lmid_t nsid) attribute_hidden;
/* Call _dl_map_object on the dependencies of MAP, and set up
MAP->l_searchlist. PRELOADS points to a vector of NPRELOADS previously
@@ -768,11 +873,10 @@ extern void _dl_map_object_deps (struct link_map *map,
struct link_map **preloads,
unsigned int npreloads, int trace_mode,
int open_mode)
- internal_function attribute_hidden;
+ attribute_hidden;
/* Cache the locations of MAP's hash table. */
-extern void _dl_setup_hash (struct link_map *map)
- internal_function attribute_hidden;
+extern void _dl_setup_hash (struct link_map *map) attribute_hidden;
/* Collect the directories in the search path for LOADER's dependencies.
@@ -781,8 +885,7 @@ extern void _dl_setup_hash (struct link_map *map)
by a previous call with COUNTING set, and SI must point to SI->dls_size
bytes to be used in filling in the result. */
extern void _dl_rtld_di_serinfo (struct link_map *loader,
- Dl_serinfo *si, bool counting)
- internal_function;
+ Dl_serinfo *si, bool counting);
/* Search loaded objects' symbol tables for a definition of the symbol
@@ -813,22 +916,18 @@ extern lookup_t _dl_lookup_symbol_x (const char *undef,
const struct r_found_version *version,
int type_class, int flags,
struct link_map *skip_map)
- internal_function attribute_hidden;
-
+ attribute_hidden;
-/* Look up symbol NAME in MAP's scope and return its run-time address. */
-extern ElfW(Addr) _dl_symbol_value (struct link_map *map, const char *name)
- internal_function;
/* Add the new link_map NEW to the end of the namespace list. */
extern void _dl_add_to_namespace_list (struct link_map *new, Lmid_t nsid)
- internal_function attribute_hidden;
+ attribute_hidden;
/* Allocate a `struct link_map' for a new object being loaded. */
extern struct link_map *_dl_new_object (char *realname, const char *libname,
int type, struct link_map *loader,
int mode, Lmid_t nsid)
- internal_function attribute_hidden;
+ attribute_hidden;
/* Relocate the given object (if it hasn't already been).
SCOPE is passed to _dl_lookup_symbol in symbol lookups.
@@ -839,15 +938,14 @@ extern void _dl_relocate_object (struct link_map *map,
attribute_hidden;
/* Protect PT_GNU_RELRO area. */
-extern void _dl_protect_relro (struct link_map *map)
- internal_function attribute_hidden;
+extern void _dl_protect_relro (struct link_map *map) attribute_hidden;
/* Call _dl_signal_error with a message about an unhandled reloc type.
TYPE is the result of ELFW(R_TYPE) (r_info), i.e. an R_<CPU>_* value.
PLT is nonzero if this was a PLT reloc; it just affects the message. */
extern void _dl_reloc_bad_type (struct link_map *map,
unsigned int type, int plt)
- internal_function attribute_hidden __attribute__ ((__noreturn__));
+ attribute_hidden __attribute__ ((__noreturn__));
/* Resolve conflicts if prelinking. */
extern void _dl_resolve_conflicts (struct link_map *l,
@@ -858,28 +956,25 @@ extern void _dl_resolve_conflicts (struct link_map *l,
/* Check the version dependencies of all objects available through
MAP. If VERBOSE print some more diagnostics. */
extern int _dl_check_all_versions (struct link_map *map, int verbose,
- int trace_mode)
- internal_function attribute_hidden;
+ int trace_mode) attribute_hidden;
/* Check the version dependencies for MAP. If VERBOSE print some more
diagnostics. */
extern int _dl_check_map_versions (struct link_map *map, int verbose,
- int trace_mode)
- internal_function attribute_hidden;
+ int trace_mode) attribute_hidden;
/* Initialize the object in SCOPE by calling the constructors with
ARGC, ARGV, and ENV as the parameters. */
extern void _dl_init (struct link_map *main_map, int argc, char **argv,
- char **env) internal_function attribute_hidden;
+ char **env) attribute_hidden;
/* Call the finalizer functions of all shared objects whose
initializer functions have completed. */
-extern void _dl_fini (void) internal_function;
+extern void _dl_fini (void) attribute_hidden;
/* Sort array MAPS according to dependencies of the contained objects. */
-extern void _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used,
- Lmid_t ns)
- internal_function attribute_hidden;
+extern void _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
+ char *used, bool for_fini) attribute_hidden;
/* The dynamic linker calls this function before and having changing
any shared object mappings. The `r_state' member of `struct r_debug'
@@ -892,15 +987,14 @@ rtld_hidden_proto (_dl_debug_state)
argument is the run-time load address of the dynamic linker, to be put
in the `r_ldbase' member. Returns the address of the structure. */
extern struct r_debug *_dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns)
- internal_function attribute_hidden;
+ attribute_hidden;
/* Initialize the basic data structure for the search paths. */
-extern void _dl_init_paths (const char *library_path)
- internal_function attribute_hidden;
+extern void _dl_init_paths (const char *library_path) attribute_hidden;
/* Gather the information needed to install the profiling tables and start
the timers. */
-extern void _dl_start_profile (void) internal_function attribute_hidden;
+extern void _dl_start_profile (void) attribute_hidden;
/* The actual functions used to keep book on the calls. */
extern void _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc);
@@ -912,25 +1006,22 @@ rtld_hidden_proto (_dl_mcount)
extern void _dl_mcount_wrapper (void *selfpc);
/* Show the members of the auxiliary array passed up from the kernel. */
-extern void _dl_show_auxv (void)
- internal_function attribute_hidden;
+extern void _dl_show_auxv (void) attribute_hidden;
/* Return all environment variables starting with `LD_', one after the
other. */
-extern char *_dl_next_ld_env_entry (char ***position)
- internal_function attribute_hidden;
+extern char *_dl_next_ld_env_entry (char ***position) attribute_hidden;
/* Return an array with the names of the important hardware capabilities. */
extern const struct r_strlenpair *_dl_important_hwcaps (const char *platform,
size_t paltform_len,
size_t *sz,
size_t *max_capstrlen)
- internal_function attribute_hidden;
+ attribute_hidden;
/* Look up NAME in ld.so.cache and return the file name stored there,
or null if none is found. Caller must free returned string. */
-extern char *_dl_load_cache_lookup (const char *name)
- internal_function attribute_hidden;
+extern char *_dl_load_cache_lookup (const char *name) attribute_hidden;
/* If the system does not support MAP_COPY we cannot leave the file open
all the time since this would create problems when the file is replaced.
@@ -942,8 +1033,7 @@ extern void _dl_unload_cache (void) attribute_hidden;
most convenient manner available. *SIZEP gets the size of the
file. On error MAP_FAILED is returned. */
extern void *_dl_sysdep_read_whole_file (const char *file, size_t *sizep,
- int prot)
- internal_function attribute_hidden;
+ int prot) attribute_hidden;
/* System-specific function to do initial startup for the dynamic linker.
After this, file access calls and getenv must work. This is responsible
@@ -956,45 +1046,57 @@ extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
ElfW(auxv_t) *auxv))
attribute_hidden;
-extern void _dl_sysdep_start_cleanup (void)
- internal_function attribute_hidden;
+extern void _dl_sysdep_start_cleanup (void) attribute_hidden;
/* Determine next available module ID. */
-extern size_t _dl_next_tls_modid (void) internal_function attribute_hidden;
+extern size_t _dl_next_tls_modid (void) attribute_hidden;
/* Count the modules with TLS segments. */
-extern size_t _dl_count_modids (void) internal_function attribute_hidden;
+extern size_t _dl_count_modids (void) attribute_hidden;
/* Calculate offset of the TLS blocks in the static TLS block. */
-extern void _dl_determine_tlsoffset (void) internal_function attribute_hidden;
+extern void _dl_determine_tlsoffset (void) attribute_hidden;
+
+#ifndef SHARED
+/* Set up the TCB for statically linked applications. This is called
+ early during startup because we always use TLS (for errno and the
+ stack protector, among other things). */
+void __libc_setup_tls (void);
+
+# if ENABLE_STATIC_PIE
+/* Relocate static executable with PIE. */
+extern void _dl_relocate_static_pie (void) attribute_hidden;
+
+/* Get a pointer to _dl_main_map. */
+extern struct link_map * _dl_get_dl_main_map (void)
+ __attribute__ ((visibility ("hidden")));
+# else
+# define _dl_relocate_static_pie()
+# endif
+#endif
-/* Set up the data structures for TLS, when they were not set up at startup.
- Returns nonzero on malloc failure.
- This is called from _dl_map_object_from_fd or by libpthread. */
-extern int _dl_tls_setup (void) internal_function;
-rtld_hidden_proto (_dl_tls_setup)
+/* Initialization of libpthread for statically linked applications.
+ If libpthread is not linked in, this is an empty function. */
+void __pthread_initialize_minimal (void) weak_function;
/* Allocate memory for static TLS block (unless MEM is nonzero) and dtv. */
-extern void *_dl_allocate_tls (void *mem) internal_function;
+extern void *_dl_allocate_tls (void *mem);
rtld_hidden_proto (_dl_allocate_tls)
/* Get size and alignment requirements of the static TLS block. */
-extern void _dl_get_tls_static_info (size_t *sizep, size_t *alignp)
- internal_function;
+extern void _dl_get_tls_static_info (size_t *sizep, size_t *alignp);
-extern void _dl_allocate_static_tls (struct link_map *map)
- internal_function attribute_hidden;
+extern void _dl_allocate_static_tls (struct link_map *map) attribute_hidden;
/* These are internal entry points to the two halves of _dl_allocate_tls,
only used within rtld.c itself at startup time. */
-extern void *_dl_allocate_tls_storage (void)
- internal_function attribute_hidden;
-extern void *_dl_allocate_tls_init (void *) internal_function;
+extern void *_dl_allocate_tls_storage (void) attribute_hidden;
+extern void *_dl_allocate_tls_init (void *);
rtld_hidden_proto (_dl_allocate_tls_init)
/* Deallocate memory allocated with _dl_allocate_tls. */
-extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb) internal_function;
+extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb);
rtld_hidden_proto (_dl_deallocate_tls)
extern void _dl_nothread_init_static_tls (struct link_map *) attribute_hidden;
@@ -1003,15 +1105,11 @@ extern void _dl_nothread_init_static_tls (struct link_map *) attribute_hidden;
extern const char *_dl_get_origin (void) attribute_hidden;
/* Count DSTs. */
-extern size_t _dl_dst_count (const char *name, int is_path) attribute_hidden;
+extern size_t _dl_dst_count (const char *name) attribute_hidden;
/* Substitute DST values. */
extern char *_dl_dst_substitute (struct link_map *l, const char *name,
- char *result, int is_path) attribute_hidden;
-
-/* Check validity of the caller. */
-extern int _dl_check_caller (const void *caller, enum allowmask mask)
- attribute_hidden;
+ char *result) attribute_hidden;
/* Open the shared object NAME, relocate it, and run its initializer if it
hasn't already been run. MODE is as for `dlopen' (see <dlfcn.h>). If
@@ -1038,22 +1136,37 @@ extern struct link_map *_dl_update_slotinfo (unsigned long int req_modid)
extern void *_dl_tls_get_addr_soft (struct link_map *l) attribute_hidden;
extern int _dl_addr_inside_object (struct link_map *l, const ElfW(Addr) addr)
- internal_function attribute_hidden;
+ attribute_hidden;
/* Show show of an object. */
extern void _dl_show_scope (struct link_map *new, int from)
attribute_hidden;
-extern struct link_map *_dl_find_dso_for_object (const ElfW(Addr) addr)
- internal_function;
+extern struct link_map *_dl_find_dso_for_object (const ElfW(Addr) addr);
rtld_hidden_proto (_dl_find_dso_for_object)
/* Initialization which is normally done by the dynamic linker. */
-extern void _dl_non_dynamic_init (void) internal_function;
+extern void _dl_non_dynamic_init (void)
+ attribute_hidden;
/* Used by static binaries to check the auxiliary vector. */
-extern void _dl_aux_init (ElfW(auxv_t) *av) internal_function;
+extern void _dl_aux_init (ElfW(auxv_t) *av)
+ attribute_hidden;
+/* Return true if the ld.so copy in this namespace is actually active
+ and working. If false, the dl_open/dlfcn hooks have to be used to
+ call into the outer dynamic linker (which happens after static
+ dlopen). */
+#ifdef SHARED
+static inline bool
+rtld_active (void)
+{
+ /* The default-initialized variable does not have a non-zero
+ dl_init_all_dirs member, so this allows us to recognize an
+ initialized and active ld.so copy. */
+ return GLRO(dl_init_all_dirs) != NULL;
+}
+#endif
__END_DECLS
diff --git a/sysdeps/generic/libc-lock.h b/sysdeps/generic/libc-lock.h
index d5a541e209..4f21f9c8c0 100644
--- a/sysdeps/generic/libc-lock.h
+++ b/sysdeps/generic/libc-lock.h
@@ -1,5 +1,5 @@
/* libc-internal interface for mutex locks. Stub version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/libc-mmap.h b/sysdeps/generic/libc-mmap.h
index e2e0ca36b9..8de70ebf57 100644
--- a/sysdeps/generic/libc-mmap.h
+++ b/sysdeps/generic/libc-mmap.h
@@ -1,5 +1,5 @@
/* Internal logic for dealing with mmap quirks.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/libc-start.h b/sysdeps/generic/libc-start.h
new file mode 100644
index 0000000000..e0361f655a
--- /dev/null
+++ b/sysdeps/generic/libc-start.h
@@ -0,0 +1,31 @@
+/* Generic definitions for libc main startup.
+ Copyright (C) 2017-2018 Free Software 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 _LIBC_START_H
+#define _LIBC_START_H
+
+#ifndef SHARED
+/* By default we perform STT_GNU_IFUNC resolution *before* TLS
+ initialization, and this means you cannot, without machine
+ knowledge, access TLS from an IFUNC resolver. */
+#define ARCH_SETUP_IREL() apply_irel ()
+#define ARCH_SETUP_TLS() __libc_setup_tls ()
+#define ARCH_APPLY_IREL()
+#endif /* ! SHARED */
+
+#endif /* _LIBC_START_H */
diff --git a/sysdeps/generic/libc-tsd.h b/sysdeps/generic/libc-tsd.h
index eef55ef3ad..73e792dd0a 100644
--- a/sysdeps/generic/libc-tsd.h
+++ b/sysdeps/generic/libc-tsd.h
@@ -1,5 +1,5 @@
/* libc-internal interface for thread-specific data. Stub or TLS version.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/libm-alias-double.h b/sysdeps/generic/libm-alias-double.h
new file mode 100644
index 0000000000..b97d2f8c36
--- /dev/null
+++ b/sysdeps/generic/libm-alias-double.h
@@ -0,0 +1,72 @@
+/* Define aliases for libm double functions.
+ Copyright (C) 2017-2018 Free Software 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 _LIBM_ALIAS_DOUBLE_H
+#define _LIBM_ALIAS_DOUBLE_H
+
+#include <bits/floatn.h>
+
+#if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64
+# define libm_alias_double_other_r_f64(from, to, r) \
+ weak_alias (from ## r, to ## f64 ## r)
+#else
+# define libm_alias_double_other_r_f64(from, to, r)
+#endif
+
+#if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X
+# define libm_alias_double_other_r_f32x(from, to, r) \
+ weak_alias (from ## r, to ## f32x ## r)
+#else
+# define libm_alias_double_other_r_f32x(from, to, r)
+#endif
+
+/* Define _FloatN / _FloatNx aliases for a double libm function that
+ has internal name FROM ## R and public names TO ## suffix ## R for
+ each suffix of a supported _FloatN / _FloatNx floating-point type
+ with the same format as double. */
+#define libm_alias_double_other_r(from, to, r) \
+ libm_alias_double_other_r_f64 (from, to, r); \
+ libm_alias_double_other_r_f32x (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_double_other(from, to) \
+ libm_alias_double_other_r (from, to, )
+
+/* Define aliases for a double libm function that has internal name
+ FROM ## R and public names TO ## suffix ## R for each suffix of a
+ supported floating-point type with the same format as double. This
+ should only be used for functions where such public names exist for
+ _FloatN types, not for implementation-namespace exported names
+ (where there is one name per format, not per type) or for
+ obsolescent functions not provided for _FloatN types. */
+#ifdef NO_LONG_DOUBLE
+# define libm_alias_double_r(from, to, r) \
+ weak_alias (from ## r, to ## r) \
+ strong_alias (from ## r, from ## l ## r) \
+ weak_alias (from ## r, to ## l ## r); \
+ libm_alias_double_other_r (from, to, r)
+#else
+# define libm_alias_double_r(from, to, r) \
+ weak_alias (from ## r, to ## r); \
+ libm_alias_double_other_r (from, to, r)
+#endif
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_double(from, to) libm_alias_double_r (from, to, )
+
+#endif
diff --git a/sysdeps/generic/libm-alias-float.h b/sysdeps/generic/libm-alias-float.h
new file mode 100644
index 0000000000..50e464f270
--- /dev/null
+++ b/sysdeps/generic/libm-alias-float.h
@@ -0,0 +1,53 @@
+/* Define aliases for libm float functions.
+ Copyright (C) 2017-2018 Free Software 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 _LIBM_ALIAS_FLOAT_H
+#define _LIBM_ALIAS_FLOAT_H
+
+#include <bits/floatn.h>
+
+/* Define _FloatN / _FloatNx aliases for a float libm function that
+ has internal name FROM ## f ## R and public names TO ## suffix ## R
+ for each suffix of a supported _FloatN / _FloatNx floating-point
+ type with the same format as float. */
+#if __HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32
+# define libm_alias_float_other_r(from, to, r) \
+ weak_alias (from ## f ## r, to ## f32 ## r)
+#else
+# define libm_alias_float_other_r(from, to, r)
+#endif
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_float_other(from, to) \
+ libm_alias_float_other_r (from, to, )
+
+/* Define aliases for a float libm function that has internal name
+ FROM ## f ## R and public names TO ## suffix ## R for each suffix
+ of a supported floating-point type with the same format as float.
+ This should only be used for functions where such public names
+ exist for _FloatN types, not for implementation-namespace exported
+ names (where there is one name per format, not per type) or for
+ obsolescent functions not provided for _FloatN types. */
+#define libm_alias_float_r(from, to, r) \
+ weak_alias (from ## f ## r, to ## f ## r); \
+ libm_alias_float_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_float(from, to) libm_alias_float_r (from, to, )
+
+#endif
diff --git a/sysdeps/generic/libm-alias-float128.h b/sysdeps/generic/libm-alias-float128.h
new file mode 100644
index 0000000000..3a3ff50ff7
--- /dev/null
+++ b/sysdeps/generic/libm-alias-float128.h
@@ -0,0 +1,55 @@
+/* Define aliases for libm _Float128 functions.
+ Copyright (C) 2017-2018 Free Software 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 _LIBM_ALIAS_FLOAT128_H
+#define _LIBM_ALIAS_FLOAT128_H
+
+#include <bits/floatn.h>
+
+/* Define _FloatN / _FloatNx aliases (other than that for _Float128)
+ for a _Float128 libm function that has internal name FROM ## f128
+ ## R and public names TO ## suffix ## R for each suffix of a
+ supported _FloatN / _FloatNx floating-point type with the same
+ format as _Float128. */
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define libm_alias_float128_other_r(from, to, r) \
+ weak_alias (from ## f128 ## r, to ## f64x ## r)
+#else
+# define libm_alias_float128_other_r(from, to, r)
+#endif
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_float128_other(from, to) \
+ libm_alias_float128_other_r (from, to, )
+
+/* Define aliases for a _Float128 libm function that has internal name
+ FROM ## f128 ## R and public names TO ## suffix ## R for each
+ suffix of a supported floating-point type with the same format as
+ _Float128. This should only be used for functions where such
+ public names exist for _FloatN types, not for
+ implementation-namespace exported names (where there is one name
+ per format, not per type) or for obsolescent functions not provided
+ for _FloatN types. */
+#define libm_alias_float128_r(from, to, r) \
+ weak_alias (from ## f128 ## r, to ## f128 ## r); \
+ libm_alias_float128_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_float128(from, to) libm_alias_float128_r (from, to, )
+
+#endif
diff --git a/sysdeps/generic/libm-alias-ldouble.h b/sysdeps/generic/libm-alias-ldouble.h
new file mode 100644
index 0000000000..7abfe30121
--- /dev/null
+++ b/sysdeps/generic/libm-alias-ldouble.h
@@ -0,0 +1,65 @@
+/* Define aliases for libm long double functions.
+ Copyright (C) 2017-2018 Free Software 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 _LIBM_ALIAS_LDOUBLE_H
+#define _LIBM_ALIAS_LDOUBLE_H
+
+#include <bits/floatn.h>
+
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# define libm_alias_ldouble_other_r_f128(from, to, r) \
+ weak_alias (from ## l ## r, to ## f128 ## r)
+#else
+# define libm_alias_ldouble_other_r_f128(from, to, r)
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define libm_alias_ldouble_other_r_f64x(from, to, r) \
+ weak_alias (from ## l ## r, to ## f64x ## r)
+#else
+# define libm_alias_ldouble_other_r_f64x(from, to, r)
+#endif
+
+/* Define _FloatN / _FloatNx aliases for a long double libm function
+ that has internal name FROM ## l ## R and public names TO ## suffix
+ ## R for each suffix of a supported _FloatN / _FloatNx
+ floating-point type with the same format as long double. */
+#define libm_alias_ldouble_other_r(from, to, r) \
+ libm_alias_ldouble_other_r_f128 (from, to, r); \
+ libm_alias_ldouble_other_r_f64x (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_ldouble_other(from, to) \
+ libm_alias_ldouble_other_r (from, to, )
+
+/* Define aliases for a long double libm function that has internal
+ name FROM ## l ## R and public names TO ## suffix ## R for each
+ suffix of a supported floating-point type with the same format as
+ long double. This should only be used for functions where such
+ public names exist for _FloatN types, not for
+ implementation-namespace exported names (where there is one name
+ per format, not per type) or for obsolescent functions not provided
+ for _FloatN types. */
+#define libm_alias_ldouble_r(from, to, r) \
+ weak_alias (from ## l ## r, to ## l ## r); \
+ libm_alias_ldouble_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_ldouble(from, to) libm_alias_ldouble_r (from, to, )
+
+#endif
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/libcidn.abilist b/sysdeps/generic/libnsl.abilist
index e69de29bb2..e69de29bb2 100644
--- a/sysdeps/generic/libcidn.abilist
+++ b/sysdeps/generic/libnsl.abilist
diff --git a/sysdeps/generic/libutil.abilist b/sysdeps/generic/libutil.abilist
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sysdeps/generic/libutil.abilist
diff --git a/sysdeps/generic/link_map.h b/sysdeps/generic/link_map.h
new file mode 100644
index 0000000000..a056184690
--- /dev/null
+++ b/sysdeps/generic/link_map.h
@@ -0,0 +1 @@
+/* No architecture specific definitions. */
diff --git a/sysdeps/generic/localplt.data b/sysdeps/generic/localplt.data
index 1a40cf9841..2d5c66ae28 100644
--- a/sysdeps/generic/localplt.data
+++ b/sysdeps/generic/localplt.data
@@ -7,11 +7,14 @@ libc.so: malloc
libc.so: memalign
libc.so: realloc
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
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/generic/machine-gmon.h b/sysdeps/generic/machine-gmon.h
index 0bacaa95be..2463ad388e 100644
--- a/sysdeps/generic/machine-gmon.h
+++ b/sysdeps/generic/machine-gmon.h
@@ -1,5 +1,5 @@
/* Machine-dependent definitions for profiling support. Generic GCC 2 version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/machine-lock.h b/sysdeps/generic/machine-lock.h
index 71e299eb5e..b3e6724ed3 100644
--- a/sysdeps/generic/machine-lock.h
+++ b/sysdeps/generic/machine-lock.h
@@ -1,5 +1,5 @@
/* Machine-specific definition for spin locks. Stub version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,9 +34,9 @@ typedef volatile int __spin_lock_t;
/* Unlock LOCK. */
-void __spin_unlock (__spin_lock_t *__lock);
+extern void __spin_unlock (__spin_lock_t *__lock);
-#ifdef __USE_EXTERN_INLINES
+#if defined __USE_EXTERN_INLINES && defined _LIBC
_EXTERN_INLINE void
__spin_unlock (__spin_lock_t *__lock)
{
@@ -46,9 +46,9 @@ __spin_unlock (__spin_lock_t *__lock)
/* Try to lock LOCK; return nonzero if we locked it, zero if another has. */
-int __spin_try_lock (__spin_lock_t *__lock);
+extern int __spin_try_lock (__spin_lock_t *__lock);
-#ifdef __USE_EXTERN_INLINES
+#if defined __USE_EXTERN_INLINES && defined _LIBC
_EXTERN_INLINE int
__spin_try_lock (__spin_lock_t *__lock)
{
@@ -61,9 +61,9 @@ __spin_try_lock (__spin_lock_t *__lock)
/* Return nonzero if LOCK is locked. */
-int __spin_lock_locked (__spin_lock_t *__lock);
+extern int __spin_lock_locked (__spin_lock_t *__lock);
-#ifdef __USE_EXTERN_INLINES
+#if defined __USE_EXTERN_INLINES && defined _LIBC
_EXTERN_INLINE int
__spin_lock_locked (__spin_lock_t *__lock)
{
diff --git a/sysdeps/generic/machine-sp.h b/sysdeps/generic/machine-sp.h
index 0bc90f3d5b..6be9d26f59 100644
--- a/sysdeps/generic/machine-sp.h
+++ b/sysdeps/generic/machine-sp.h
@@ -1,5 +1,5 @@
/* Machine-specific function to return the stack pointer. Stub version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/malloc-alignment.h b/sysdeps/generic/malloc-alignment.h
new file mode 100644
index 0000000000..d60c74e89a
--- /dev/null
+++ b/sysdeps/generic/malloc-alignment.h
@@ -0,0 +1,31 @@
+/* Define MALLOC_ALIGNMENT for malloc. Generic version.
+ Copyright (C) 2017-2018 Free Software 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 _GENERIC_MALLOC_ALIGNMENT_H
+#define _GENERIC_MALLOC_ALIGNMENT_H
+
+/* MALLOC_ALIGNMENT is the minimum alignment for malloc'ed chunks. It
+ must be a power of two at least 2 * SIZE_SZ, even on machines for
+ which smaller alignments would suffice. It may be defined as larger
+ than this though. Note however that code and data structures are
+ optimized for the case of 8-byte alignment. */
+#define MALLOC_ALIGNMENT (2 * SIZE_SZ < __alignof__ (long double) \
+ ? __alignof__ (long double) : 2 * SIZE_SZ)
+
+
+#endif /* !defined(_GENERIC_MALLOC_ALIGNMENT_H) */
diff --git a/sysdeps/generic/malloc-machine.h b/sysdeps/generic/malloc-machine.h
index 1ed2d50a20..68ca3c7bc4 100644
--- a/sysdeps/generic/malloc-machine.h
+++ b/sysdeps/generic/malloc-machine.h
@@ -1,6 +1,6 @@
/* Basic platform-independent macro definitions for mutexes,
thread-specific data and parameters for malloc.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,25 +21,7 @@
#define _GENERIC_MALLOC_MACHINE_H
#include <atomic.h>
-
-#ifndef mutex_init /* No threads, provide dummy macros */
-
-# define NO_THREADS
-
-/* The mutex functions used to do absolutely nothing, i.e. lock,
- trylock and unlock would always just return 0. However, even
- without any concurrently active threads, a mutex can be used
- legitimately as an `in use' flag. To make the code that is
- protected by a mutex async-signal safe, these macros would have to
- be based on atomic test-and-set operations, for example. */
-typedef int mutex_t;
-
-# define mutex_init(m) (*(m) = 0)
-# define mutex_lock(m) ({ *(m) = 1; 0; })
-# define mutex_trylock(m) (*(m) ? 1 : ((*(m) = 1), 0))
-# define mutex_unlock(m) (*(m) = 0)
-
-#endif /* !defined mutex_init */
+#include <malloc-alignment.h>
#ifndef atomic_full_barrier
# define atomic_full_barrier() __asm ("" ::: "memory")
diff --git a/sysdeps/generic/malloc-sysdep.h b/sysdeps/generic/malloc-sysdep.h
index 09b70ae9dc..890684d900 100644
--- a/sysdeps/generic/malloc-sysdep.h
+++ b/sysdeps/generic/malloc-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific malloc support functions. Generic version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/math-barriers.h b/sysdeps/generic/math-barriers.h
new file mode 100644
index 0000000000..425173149c
--- /dev/null
+++ b/sysdeps/generic/math-barriers.h
@@ -0,0 +1,37 @@
+/* Control when floating-point expressions are evaluated. Generic version.
+ Copyright (C) 2007-2018 Free Software 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_BARRIERS_H
+#define _MATH_BARRIERS_H 1
+
+/* math_opt_barrier evaluates and returns its floating-point argument
+ and ensures that the evaluation of any expression using the result
+ of math_opt_barrier is not moved before the call. math_force_eval
+ ensures that its floating-point argument is evaluated for its side
+ effects even if its value is apparently unused, and that the
+ evaluation of its argument is not moved after the call. Both these
+ macros are used to ensure the correct ordering of floating-point
+ expression evaluations with respect to accesses to the
+ floating-point environment. */
+
+#define math_opt_barrier(x) \
+ ({ __typeof (x) __x = (x); __asm ("" : "+m" (__x)); __x; })
+#define math_force_eval(x) \
+ ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "m" (__x)); })
+
+#endif /* math-barriers.h */
diff --git a/sysdeps/generic/math-nan-payload-double.h b/sysdeps/generic/math-nan-payload-double.h
new file mode 100644
index 0000000000..cfcc53a7b6
--- /dev/null
+++ b/sysdeps/generic/math-nan-payload-double.h
@@ -0,0 +1,29 @@
+/* NaN payload handling for double.
+ Copyright (C) 1997-2018 Free Software 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 SET_NAN_PAYLOAD(flt, mant) \
+ do \
+ { \
+ union ieee754_double u; \
+ u.d = (flt); \
+ u.ieee_nan.mantissa0 = (mant) >> 32; \
+ u.ieee_nan.mantissa1 = (mant); \
+ if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0) \
+ (flt) = u.d; \
+ } \
+ while (0)
diff --git a/sysdeps/generic/math-nan-payload-float.h b/sysdeps/generic/math-nan-payload-float.h
new file mode 100644
index 0000000000..2a4ff8ca64
--- /dev/null
+++ b/sysdeps/generic/math-nan-payload-float.h
@@ -0,0 +1,28 @@
+/* NaN payload handling for float.
+ Copyright (C) 1997-2018 Free Software 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 SET_NAN_PAYLOAD(flt, mant) \
+ do \
+ { \
+ union ieee754_float u; \
+ u.f = (flt); \
+ u.ieee_nan.mantissa = (mant); \
+ if (u.ieee.mantissa != 0) \
+ (flt) = u.f; \
+ } \
+ while (0)
diff --git a/sysdeps/generic/math-tests-arch.h b/sysdeps/generic/math-tests-arch.h
index 47f14ba9fb..4d0268897c 100644
--- a/sysdeps/generic/math-tests-arch.h
+++ b/sysdeps/generic/math-tests-arch.h
@@ -1,5 +1,5 @@
/* Runtime architecture check for math tests.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/math-tests.h b/sysdeps/generic/math-tests.h
index 9393229a36..cf9eff4691 100644
--- a/sysdeps/generic/math-tests.h
+++ b/sysdeps/generic/math-tests.h
@@ -1,5 +1,5 @@
/* Configuration for math tests. Generic version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,6 +16,23 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <bits/floatn.h>
+
+/* Expand the appropriate macro for whether to enable tests for a
+ given type. */
+#if __HAVE_DISTINCT_FLOAT128
+# define MATH_TESTS_TG(PREFIX, ARGS, TYPE) \
+ (sizeof (TYPE) == sizeof (float) ? PREFIX ## float ARGS \
+ : sizeof (TYPE) == sizeof (double) ? PREFIX ## double ARGS \
+ : __builtin_types_compatible_p (TYPE, _Float128) ? PREFIX ## float128 ARGS \
+ : PREFIX ## long_double ARGS)
+# else
+# define MATH_TESTS_TG(PREFIX, ARGS, TYPE) \
+ (sizeof (TYPE) == sizeof (float) ? PREFIX ## float ARGS \
+ : sizeof (TYPE) == sizeof (double) ? PREFIX ## double ARGS \
+ : PREFIX ## long_double ARGS)
+#endif
+
/* Indicate whether to run tests involving sNaN values for the float, double,
and long double C data types, respectively. All are run unless
overridden. */
@@ -28,12 +45,12 @@
#ifndef SNAN_TESTS_long_double
# define SNAN_TESTS_long_double 1
#endif
+#ifndef SNAN_TESTS_float128
+# define SNAN_TESTS_float128 1
+#endif
/* Return nonzero value if to run tests involving sNaN values for X. */
-#define SNAN_TESTS(x) \
- (sizeof (x) == sizeof (float) ? SNAN_TESTS_float \
- : sizeof (x) == sizeof (double) ? SNAN_TESTS_double \
- : SNAN_TESTS_long_double)
+#define SNAN_TESTS(x) MATH_TESTS_TG (SNAN_TESTS_, , x)
/* Indicate whether to run tests involving type casts of sNaN values. These
are run unless overridden. */
@@ -41,6 +58,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. */
@@ -53,11 +78,12 @@
#ifndef ROUNDING_TESTS_long_double
# define ROUNDING_TESTS_long_double(MODE) 1
#endif
+#ifndef ROUNDING_TESTS_float128
+# define ROUNDING_TESTS_float128(MODE) 1
+#endif
-#define ROUNDING_TESTS(TYPE, MODE) \
- (sizeof (TYPE) == sizeof (float) ? ROUNDING_TESTS_float (MODE) \
- : sizeof (TYPE) == sizeof (double) ? ROUNDING_TESTS_double (MODE) \
- : ROUNDING_TESTS_long_double (MODE))
+#define ROUNDING_TESTS(TYPE, MODE) \
+ MATH_TESTS_TG (ROUNDING_TESTS_, (MODE), TYPE)
/* Indicate whether to run tests of floating-point exceptions for a
given floating-point type, given that the exception macros are
@@ -71,11 +97,11 @@
#ifndef EXCEPTION_TESTS_long_double
# define EXCEPTION_TESTS_long_double 1
#endif
+#ifndef EXCEPTION_TESTS_float128
+# define EXCEPTION_TESTS_float128 1
+#endif
-#define EXCEPTION_TESTS(TYPE) \
- (sizeof (TYPE) == sizeof (float) ? EXCEPTION_TESTS_float \
- : sizeof (TYPE) == sizeof (double) ? EXCEPTION_TESTS_double \
- : EXCEPTION_TESTS_long_double)
+#define EXCEPTION_TESTS(TYPE) MATH_TESTS_TG (EXCEPTION_TESTS_, , TYPE)
/* Indicate whether the given exception trap(s) can be enabled
in feenableexcept. If non-zero, the traps are always supported.
@@ -87,3 +113,12 @@
# define EXCEPTION_ENABLE_SUPPORTED(EXCEPT) \
(EXCEPTION_TESTS_float || EXCEPTION_TESTS_double)
#endif
+
+/* Indicate whether exception traps, if enabled, occur whenever an
+ exception flag is set explicitly, so it is not possible to set flag
+ bits with traps enabled without causing traps to be taken. If
+ traps cannot be enabled, the value of this macro does not
+ matter. */
+#ifndef EXCEPTION_SET_FORCES_TRAP
+# define EXCEPTION_SET_FORCES_TRAP 0
+#endif
diff --git a/sysdeps/generic/math-type-macros-double.h b/sysdeps/generic/math-type-macros-double.h
new file mode 100644
index 0000000000..be5d94488f
--- /dev/null
+++ b/sysdeps/generic/math-type-macros-double.h
@@ -0,0 +1,49 @@
+/* Helper macros for double variants of type generic functions of libm.
+ Copyright (C) 2016-2018 Free Software 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
+
+#include <libm-alias-double.h>
+#include <math-nan-payload-double.h>
+
+#ifndef declare_mgen_alias
+# define declare_mgen_alias(from, to) libm_alias_double (from, to)
+#endif
+
+#ifndef declare_mgen_alias_r
+# define declare_mgen_alias_r(from, to) libm_alias_double_r (from, to, _r)
+#endif
+
+/* Supply the generic macros. */
+#include <math-type-macros.h>
+
+/* Do not use the type-generic wrapper templates if compatibility with
+ SVID error handling is needed. */
+#include <math/math-svid-compat.h>
+#define __USE_WRAPPER_TEMPLATE !LIBM_SVID_COMPAT
+
+#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..1f280950cd
--- /dev/null
+++ b/sysdeps/generic/math-type-macros-float.h
@@ -0,0 +1,52 @@
+/* Helper macros for float variants of type generic functions of libm.
+ Copyright (C) 2016-2018 Free Software 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
+
+#include <libm-alias-float.h>
+#include <math-nan-payload-float.h>
+
+#ifndef declare_mgen_alias
+# define declare_mgen_alias(from, to) libm_alias_float (from, to)
+#endif
+
+#ifndef declare_mgen_alias_r
+# define declare_mgen_alias_r(from, to) libm_alias_float_r (from, to, _r)
+#endif
+
+/* Supply the generic macros. */
+#include <math-type-macros.h>
+
+/* Do not use the type-generic wrapper templates if compatibility with
+ SVID error handling is needed. */
+#include <math/math-svid-compat.h>
+#define __USE_WRAPPER_TEMPLATE !LIBM_SVID_COMPAT
+
+#endif
diff --git a/sysdeps/generic/math-type-macros-float128.h b/sysdeps/generic/math-type-macros-float128.h
new file mode 100644
index 0000000000..c36785fbe3
--- /dev/null
+++ b/sysdeps/generic/math-type-macros-float128.h
@@ -0,0 +1,49 @@
+/* Helper macros for _Float128 variants of type generic functions of libm.
+ Copyright (C) 2017-2018 Free Software 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_FLOAT128
+#define _MATH_TYPE_MACROS_FLOAT128
+
+#define M_LIT(c) __f128 (c)
+#define M_PFX FLT128
+#define M_SUF(c) c ## f128
+#define FLOAT _Float128
+#define M_STRTO_NAN __strtof128_nan
+
+#define CFLOAT __CFLOAT128
+
+#define M_MLIT(c) c ## f128
+
+#include <libm-alias-float128.h>
+#include <math-nan-payload-float128.h>
+
+#ifndef declare_mgen_alias
+# define declare_mgen_alias(from, to) libm_alias_float128 (from, to)
+#endif
+
+#ifndef declare_mgen_alias_r
+# define declare_mgen_alias_r(from, to) libm_alias_float128_r (from, to, _r)
+#endif
+
+/* Supply the generic macros. */
+#include <math-type-macros.h>
+
+/* Use the type-generic wrapper templates. */
+#define __USE_WRAPPER_TEMPLATE 1
+
+#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..300dd18f94
--- /dev/null
+++ b/sysdeps/generic/math-type-macros-ldouble.h
@@ -0,0 +1,49 @@
+/* Helper macros for long double variants of type generic functions of libm.
+ Copyright (C) 2016-2018 Free Software 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
+
+#include <libm-alias-ldouble.h>
+#include <math-nan-payload-ldouble.h>
+
+#ifndef declare_mgen_alias
+# define declare_mgen_alias(from, to) libm_alias_ldouble (from, to)
+#endif
+
+#ifndef declare_mgen_alias_r
+# define declare_mgen_alias_r(from, to) libm_alias_ldouble_r (from, to, _r)
+#endif
+
+/* Supply the generic macros. */
+#include <math-type-macros.h>
+
+/* Do not use the type-generic wrapper templates if compatibility with
+ SVID error handling is needed. */
+#include <math/math-svid-compat.h>
+#define __USE_WRAPPER_TEMPLATE !LIBM_SVID_COMPAT
+
+#endif
diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
new file mode 100644
index 0000000000..5250815253
--- /dev/null
+++ b/sysdeps/generic/math-type-macros.h
@@ -0,0 +1,134 @@
+/* Helper macros for type generic function implementations within libm.
+ Copyright (C) 2016-2018 Free Software 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.
+
+ declare_mgen_alias(from,to)
+ This exposes the appropriate symbol(s) for a
+ function f of type FLOAT.
+
+ declare_mgen_alias_r(from,to)
+ This exposes the appropriate symbol(s) for a
+ function f_r of type FLOAT.
+
+ SET_NAN_PAYLOAD(flt, mant)
+ Set the NaN payload bits of the variable FLT of type FLOAT to
+ the mantissa MANT. */
+
+#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
+#ifndef declare_mgen_alias
+# error "declare_mgen_alias must be defined."
+#endif
+#ifndef declare_mgen_alias_r
+# error "declare_mgen_alias_r must be defined."
+#endif
+#ifndef SET_NAN_PAYLOAD
+# error "SET_NAN_PAYLOAD must be defined."
+#endif
+
+#ifndef declare_mgen_finite_alias_x
+#define declare_mgen_finite_alias_x(from, to) \
+ strong_alias (from, to ## _finite)
+#endif
+
+#ifndef declare_mgen_finite_alias_s
+# define declare_mgen_finite_alias_s(from,to) \
+ declare_mgen_finite_alias_x (from, to)
+#endif
+
+#ifndef declare_mgen_finite_alias
+# define declare_mgen_finite_alias(from, to) \
+ declare_mgen_finite_alias_s (M_SUF (from), M_SUF (to))
+#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_MIN_EXP __M_CONCATX (M_PFX, _MIN_EXP)
+#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 (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
+
+#endif /* _MATH_TYPE_MACROS */
diff --git a/sysdeps/generic/math_ldbl.h b/sysdeps/generic/math_ldbl.h
index f0b97ef8f9..4e7ee7912e 100644
--- a/sysdeps/generic/math_ldbl.h
+++ b/sysdeps/generic/math_ldbl.h
@@ -1,5 +1,7 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+#ifndef _MATH_LDBL_H_
+#define _MATH_LDBL_H_ 1
+
+/* Any machine with a 'long double' distinct from 'double' must
+ override this header. */
-/* This is empty. Any machine using long double type will override this header. */
+#endif
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index cf1865dac8..1212abaf47 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -20,9 +20,11 @@
#include <stdint.h>
#include <sys/types.h>
#include <fenv.h>
-#include <float.h>
#include <get-rounding-mode.h>
+/* Gather machine dependent _Floatn support. */
+#include <bits/floatn.h>
+
/* The original fdlibm code used statements like:
n0 = ((*(int*)&one)>>29)^1; * index of high word *
ix0 = *(n0+(int*)&x); * high word of x *
@@ -37,30 +39,30 @@
/* A union which permits us to convert between a double and two 32 bit
ints. */
-#if __FLOAT_WORD_ORDER == BIG_ENDIAN
+#if __FLOAT_WORD_ORDER == __BIG_ENDIAN
typedef union
{
double value;
struct
{
- u_int32_t msw;
- u_int32_t lsw;
+ uint32_t msw;
+ uint32_t lsw;
} parts;
uint64_t word;
} ieee_double_shape_type;
#endif
-#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
+#if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN
typedef union
{
double value;
struct
{
- u_int32_t lsw;
- u_int32_t msw;
+ uint32_t lsw;
+ uint32_t msw;
} parts;
uint64_t word;
} ieee_double_shape_type;
@@ -158,7 +160,7 @@ do { \
typedef union
{
float value;
- u_int32_t word;
+ uint32_t word;
} ieee_float_shape_type;
/* Get a 32 bit int from a float. */
@@ -181,307 +183,85 @@ do { \
} while (0)
#endif
+/* We need to guarantee an expansion of name when building
+ ldbl-128 files as another type (e.g _Float128). */
+#define mathx_hidden_def(name) hidden_def(name)
+
/* Get long double macros from a separate header. */
#include <math_ldbl.h>
-/* ieee style elementary functions */
-extern double __ieee754_sqrt (double);
-extern double __ieee754_acos (double);
-extern double __ieee754_acosh (double);
-extern double __ieee754_log (double);
-extern double __ieee754_atanh (double);
-extern double __ieee754_asin (double);
-extern double __ieee754_atan2 (double,double);
-extern double __ieee754_exp (double);
-extern double __ieee754_exp2 (double);
-extern double __ieee754_exp10 (double);
-extern double __ieee754_cosh (double);
-extern double __ieee754_fmod (double,double);
-extern double __ieee754_pow (double,double);
-extern double __ieee754_lgamma_r (double,int *);
-extern double __ieee754_gamma_r (double,int *);
-extern double __ieee754_lgamma (double);
-extern double __ieee754_gamma (double);
-extern double __ieee754_log10 (double);
-extern double __ieee754_log2 (double);
-extern double __ieee754_sinh (double);
-extern double __ieee754_hypot (double,double);
-extern double __ieee754_j0 (double);
-extern double __ieee754_j1 (double);
-extern double __ieee754_y0 (double);
-extern double __ieee754_y1 (double);
-extern double __ieee754_jn (int,double);
-extern double __ieee754_yn (int,double);
-extern double __ieee754_remainder (double,double);
-extern int32_t __ieee754_rem_pio2 (double,double*);
-extern double __ieee754_scalb (double,double);
-extern int __ieee754_ilogb (double);
-
-/* fdlibm kernel function */
-extern double __kernel_standard (double,double,int);
-extern float __kernel_standard_f (float,float,int);
-extern long double __kernel_standard_l (long double,long double,int);
-extern double __kernel_sin (double,double,int);
-extern double __kernel_cos (double,double);
-extern double __kernel_tan (double,double,int);
-extern int __kernel_rem_pio2 (double*,double*,int,int,int, const int32_t*);
-
-/* internal functions. */
-extern double __copysign (double x, double __y);
-
-extern inline double __copysign (double x, double y)
-{ return __builtin_copysign (x, y); }
-
-/* ieee style elementary float functions */
-extern float __ieee754_sqrtf (float);
-extern float __ieee754_acosf (float);
-extern float __ieee754_acoshf (float);
-extern float __ieee754_logf (float);
-extern float __ieee754_atanhf (float);
-extern float __ieee754_asinf (float);
-extern float __ieee754_atan2f (float,float);
-extern float __ieee754_expf (float);
-extern float __ieee754_exp2f (float);
-extern float __ieee754_exp10f (float);
-extern float __ieee754_coshf (float);
-extern float __ieee754_fmodf (float,float);
-extern float __ieee754_powf (float,float);
-extern float __ieee754_lgammaf_r (float,int *);
-extern float __ieee754_gammaf_r (float,int *);
-extern float __ieee754_lgammaf (float);
-extern float __ieee754_gammaf (float);
-extern float __ieee754_log10f (float);
-extern float __ieee754_log2f (float);
-extern float __ieee754_sinhf (float);
-extern float __ieee754_hypotf (float,float);
-extern float __ieee754_j0f (float);
-extern float __ieee754_j1f (float);
-extern float __ieee754_y0f (float);
-extern float __ieee754_y1f (float);
-extern float __ieee754_jnf (int,float);
-extern float __ieee754_ynf (int,float);
-extern float __ieee754_remainderf (float,float);
-extern int32_t __ieee754_rem_pio2f (float,float*);
-extern float __ieee754_scalbf (float,float);
-extern int __ieee754_ilogbf (float);
-
-
-/* float versions of fdlibm kernel functions */
-extern float __kernel_sinf (float,float,int);
-extern float __kernel_cosf (float,float);
-extern float __kernel_tanf (float,float,int);
-extern int __kernel_rem_pio2f (float*,float*,int,int,int, const int32_t*);
-
-/* internal functions. */
-extern float __copysignf (float x, float __y);
-
-extern inline float __copysignf (float x, float y)
-{ return __builtin_copysignf (x, y); }
-
-/* ieee style elementary long double functions */
-extern long double __ieee754_sqrtl (long double);
-extern long double __ieee754_acosl (long double);
-extern long double __ieee754_acoshl (long double);
-extern long double __ieee754_logl (long double);
-extern long double __ieee754_atanhl (long double);
-extern long double __ieee754_asinl (long double);
-extern long double __ieee754_atan2l (long double,long double);
-extern long double __ieee754_expl (long double);
-extern long double __ieee754_exp2l (long double);
-extern long double __ieee754_exp10l (long double);
-extern long double __ieee754_coshl (long double);
-extern long double __ieee754_fmodl (long double,long double);
-extern long double __ieee754_powl (long double,long double);
-extern long double __ieee754_lgammal_r (long double,int *);
-extern long double __ieee754_gammal_r (long double,int *);
-extern long double __ieee754_lgammal (long double);
-extern long double __ieee754_gammal (long double);
-extern long double __ieee754_log10l (long double);
-extern long double __ieee754_log2l (long double);
-extern long double __ieee754_sinhl (long double);
-extern long double __ieee754_hypotl (long double,long double);
-extern long double __ieee754_j0l (long double);
-extern long double __ieee754_j1l (long double);
-extern long double __ieee754_y0l (long double);
-extern long double __ieee754_y1l (long double);
-extern long double __ieee754_jnl (int,long double);
-extern long double __ieee754_ynl (int,long double);
-extern long double __ieee754_remainderl (long double,long double);
-extern int __ieee754_rem_pio2l (long double,long double*);
-extern long double __ieee754_scalbl (long double,long double);
-extern int __ieee754_ilogbl (long double);
-
-/* long double versions of fdlibm kernel functions */
-extern long double __kernel_sinl (long double,long double,int);
-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 */
-extern int __finitel (long double);
-extern int __ilogbl (long double);
-extern int __isinfl (long double);
-extern int __isnanl (long double);
-extern long double __atanl (long double);
-extern long double __copysignl (long double, long double);
-extern long double __expm1l (long double);
-extern long double __floorl (long double);
-extern long double __frexpl (long double, int *);
-extern long double __ldexpl (long double, int);
-extern long double __log1pl (long double);
-extern long double __nanl (const char *);
-extern long double __rintl (long double);
-extern long double __scalbnl (long double, int);
-extern long double __sqrtl (long double x);
-extern long double fabsl (long double x);
-extern void __sincosl (long double, long double *, long double *);
-extern long double __logbl (long double x);
-extern long double __significandl (long double x);
-
-extern inline long double __copysignl (long double x, long double y)
-{ return __builtin_copysignl (x, y); }
+/* Include function declarations for each floating-point. */
+#define _Mdouble_ double
+#define _MSUF_
+#include <math_private_calls.h>
+#undef _MSUF_
+#undef _Mdouble_
+
+#define _Mdouble_ float
+#define _MSUF_ f
+#define __MATH_DECLARING_FLOAT
+#include <math_private_calls.h>
+#undef __MATH_DECLARING_FLOAT
+#undef _MSUF_
+#undef _Mdouble_
+
+#define _Mdouble_ long double
+#define _MSUF_ l
+#define __MATH_DECLARING_LONG_DOUBLE
+#include <math_private_calls.h>
+#undef __MATH_DECLARING_LONG_DOUBLE
+#undef _MSUF_
+#undef _Mdouble_
+
+#if __HAVE_DISTINCT_FLOAT128
+# define _Mdouble_ _Float128
+# define _MSUF_ f128
+# define __MATH_DECLARING_FLOATN
+# include <math_private_calls.h>
+# undef __MATH_DECLARING_FLOATN
+# undef _MSUF_
+# undef _Mdouble_
+#endif
+
+#if __HAVE_DISTINCT_FLOAT128
+
+/* __builtin_isinf_sign is broken in GCC < 7 for float128. */
+# if ! __GNUC_PREREQ (7, 0)
+# include <ieee754_float128.h>
+extern inline int
+__isinff128 (_Float128 x)
+{
+ int64_t hx, lx;
+ GET_FLOAT128_WORDS64 (hx, lx, x);
+ lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL;
+ lx |= -lx;
+ return ~(lx >> 63) & (hx >> 62);
+}
+# endif
+extern inline _Float128
+fabsf128 (_Float128 x)
+{
+ return __builtin_fabsf128 (x);
+}
#endif
+
+
/* Prototypes for functions of the IBM Accurate Mathematical Library. */
-extern double __exp1 (double __x, double __xx, double __error);
+extern double __exp1 (double __x, double __xx);
extern double __sin (double __x);
extern double __cos (double __x);
extern int __branred (double __x, double *__a, double *__aa);
extern void __doasin (double __x, double __dx, double __v[]);
extern void __dubsin (double __x, double __dx, double __v[]);
extern void __dubcos (double __x, double __dx, double __v[]);
-extern double __halfulp (double __x, double __y);
extern double __sin32 (double __x, double __res, double __res1);
extern double __cos32 (double __x, double __res, double __res1);
extern double __mpsin (double __x, double __dx, bool __range_reduce);
extern double __mpcos (double __x, double __dx, bool __range_reduce);
-extern double __slowexp (double __x);
-extern double __slowpow (double __x, double __y, double __z);
extern void __docos (double __x, double __dx, double __v[]);
-/* Return X^2 + Y^2 - 1, computed without large cancellation error.
- It is given that 1 > X >= Y >= epsilon / 2, and that X^2 + Y^2 >=
- 0.5. */
-extern float __x2y2m1f (float x, float y);
-extern double __x2y2m1 (double x, double y);
-extern long double __x2y2m1l (long double x, long double y);
-
-/* 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
- approximation to the product and *EPS is set to indicate the
- approximate error in the return value. X is such that all the
- values X + 1, ..., X + N - 1 are exactly representable, and X_EPS /
- X is small enough that factors quadratic in it can be
- neglected. */
-extern float __gamma_productf (float x, float x_eps, int n, float *eps);
-extern double __gamma_product (double x, double x_eps, int n, double *eps);
-extern long double __gamma_productl (long double x, long double x_eps,
- int n, long double *eps);
-
-/* Compute lgamma of a negative argument X, if it is in a range
- (depending on the floating-point format) for which expansion around
- zeros is used, setting *SIGNGAMP accordingly. */
-extern float __lgamma_negf (float x, int *signgamp);
-extern double __lgamma_neg (double x, int *signgamp);
-extern long double __lgamma_negl (long double x, int *signgamp);
-
-/* 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
- all the values X + 1, ..., X + N - 1 are exactly representable, and
- X_EPS / X is small enough that factors quadratic in it can be
- neglected. */
-extern double __lgamma_product (double t, double x, double x_eps, int n);
-extern long double __lgamma_productl (long double t, long double x,
- long double x_eps, int n);
-
-#ifndef math_opt_barrier
-# define math_opt_barrier(x) \
-({ __typeof (x) __x = (x); __asm ("" : "+m" (__x)); __x; })
-# define math_force_eval(x) \
-({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "m" (__x)); })
-#endif
-
-/* math_narrow_eval reduces its floating-point argument to the range
- and precision of its semantic type. (The original evaluation may
- still occur with excess range and precision, so the result may be
- affected by double rounding.) */
-#if FLT_EVAL_METHOD == 0
-# define math_narrow_eval(x) (x)
-#else
-# if FLT_EVAL_METHOD == 1
-# define excess_precision(type) __builtin_types_compatible_p (type, float)
-# else
-# define excess_precision(type) (__builtin_types_compatible_p (type, float) \
- || __builtin_types_compatible_p (type, \
- double))
-# endif
-# define math_narrow_eval(x) \
- ({ \
- __typeof (x) math_narrow_eval_tmp = (x); \
- if (excess_precision (__typeof (math_narrow_eval_tmp))) \
- __asm__ ("" : "+m" (math_narrow_eval_tmp)); \
- math_narrow_eval_tmp; \
- })
-#endif
-
-#define fabs_tg(x) __builtin_choose_expr \
- (__builtin_types_compatible_p (__typeof (x), float), \
- __builtin_fabsf (x), \
- __builtin_choose_expr \
- (__builtin_types_compatible_p (__typeof (x), double), \
- __builtin_fabs (x), __builtin_fabsl (x)))
-#define min_of_type(type) __builtin_choose_expr \
- (__builtin_types_compatible_p (type, float), \
- FLT_MIN, \
- __builtin_choose_expr \
- (__builtin_types_compatible_p (type, double), \
- DBL_MIN, LDBL_MIN))
-
-/* If X (which is not a NaN) is subnormal, force an underflow
- exception. */
-#define math_check_force_underflow(x) \
- do \
- { \
- __typeof (x) force_underflow_tmp = (x); \
- if (fabs_tg (force_underflow_tmp) \
- < min_of_type (__typeof (force_underflow_tmp))) \
- { \
- __typeof (force_underflow_tmp) force_underflow_tmp2 \
- = force_underflow_tmp * force_underflow_tmp; \
- math_force_eval (force_underflow_tmp2); \
- } \
- } \
- while (0)
-/* Likewise, but X is also known to be nonnegative. */
-#define math_check_force_underflow_nonneg(x) \
- do \
- { \
- __typeof (x) force_underflow_tmp = (x); \
- if (force_underflow_tmp \
- < min_of_type (__typeof (force_underflow_tmp))) \
- { \
- __typeof (force_underflow_tmp) force_underflow_tmp2 \
- = force_underflow_tmp * force_underflow_tmp; \
- math_force_eval (force_underflow_tmp2); \
- } \
- } \
- while (0)
-/* Likewise, for both real and imaginary parts of a complex
- result. */
-#define math_check_force_underflow_complex(x) \
- do \
- { \
- __typeof (x) force_underflow_complex_tmp = (x); \
- math_check_force_underflow (__real__ force_underflow_complex_tmp); \
- math_check_force_underflow (__imag__ force_underflow_complex_tmp); \
- } \
- while (0)
-
/* The standards only specify one variant of the fenv.h interfaces.
But at least for some architectures we can be more efficient if we
know what operations are going to be performed. Therefore we
@@ -632,7 +412,7 @@ default_libc_feupdateenv_test (fenv_t *e, int ex)
# define libc_feresetroundl libc_feupdateenvl
#endif
-/* ... and a version that may also discard exceptions. */
+/* ... and a version that also discards exceptions. */
#ifndef libc_feresetround_noex
# define libc_feresetround_noex libc_fesetenv
@@ -648,33 +428,6 @@ default_libc_feupdateenv_test (fenv_t *e, int ex)
# define HAVE_RM_CTX 0
#endif
-#if HAVE_RM_CTX
-/* Set/Restore Rounding Modes only when necessary. If defined, these functions
- set/restore floating point state only if the state needed within the lexical
- block is different from the current state. This saves a lot of time when
- the floating point unit is much slower than the fixed point units. */
-
-# ifndef libc_feholdsetround_noex_ctx
-# define libc_feholdsetround_noex_ctx libc_feholdsetround_ctx
-# endif
-# ifndef libc_feholdsetround_noexf_ctx
-# define libc_feholdsetround_noexf_ctx libc_feholdsetroundf_ctx
-# endif
-# ifndef libc_feholdsetround_noexl_ctx
-# define libc_feholdsetround_noexl_ctx libc_feholdsetroundl_ctx
-# endif
-
-# ifndef libc_feresetround_noex_ctx
-# define libc_feresetround_noex_ctx libc_fesetenv_ctx
-# endif
-# ifndef libc_feresetround_noexf_ctx
-# define libc_feresetround_noexf_ctx libc_fesetenvf_ctx
-# endif
-# ifndef libc_feresetround_noexl_ctx
-# define libc_feresetround_noexl_ctx libc_fesetenvl_ctx
-# endif
-
-#else
/* Default implementation using standard fenv functions.
Avoid unnecessary rounding mode changes by first checking the
@@ -682,7 +435,7 @@ default_libc_feupdateenv_test (fenv_t *e, int ex)
important for performance. */
static __always_inline void
-libc_feholdsetround_ctx (struct rm_ctx *ctx, int round)
+default_libc_feholdsetround_ctx (struct rm_ctx *ctx, int round)
{
ctx->updated_status = false;
@@ -696,7 +449,7 @@ libc_feholdsetround_ctx (struct rm_ctx *ctx, int round)
}
static __always_inline void
-libc_feresetround_ctx (struct rm_ctx *ctx)
+default_libc_feresetround_ctx (struct rm_ctx *ctx)
{
/* Restore the rounding mode if updated. */
if (__glibc_unlikely (ctx->updated_status))
@@ -704,10 +457,11 @@ libc_feresetround_ctx (struct rm_ctx *ctx)
}
static __always_inline void
-libc_feholdsetround_noex_ctx (struct rm_ctx *ctx, int round)
+default_libc_feholdsetround_noex_ctx (struct rm_ctx *ctx, int round)
{
- /* Save exception flags and rounding mode. */
- __fegetenv (&ctx->env);
+ /* Save exception flags and rounding mode, and disable exception
+ traps. */
+ __feholdexcept (&ctx->env);
/* Update rounding mode only if different. */
if (__glibc_unlikely (round != get_rounding_mode ()))
@@ -715,12 +469,45 @@ libc_feholdsetround_noex_ctx (struct rm_ctx *ctx, int round)
}
static __always_inline void
-libc_feresetround_noex_ctx (struct rm_ctx *ctx)
+default_libc_feresetround_noex_ctx (struct rm_ctx *ctx)
{
/* Restore exception flags and rounding mode. */
__fesetenv (&ctx->env);
}
+#if HAVE_RM_CTX
+/* Set/Restore Rounding Modes only when necessary. If defined, these functions
+ set/restore floating point state only if the state needed within the lexical
+ block is different from the current state. This saves a lot of time when
+ the floating point unit is much slower than the fixed point units. */
+
+# ifndef libc_feholdsetround_noex_ctx
+# define libc_feholdsetround_noex_ctx libc_feholdsetround_ctx
+# endif
+# ifndef libc_feholdsetround_noexf_ctx
+# define libc_feholdsetround_noexf_ctx libc_feholdsetroundf_ctx
+# endif
+# ifndef libc_feholdsetround_noexl_ctx
+# define libc_feholdsetround_noexl_ctx libc_feholdsetroundl_ctx
+# endif
+
+# ifndef libc_feresetround_noex_ctx
+# define libc_feresetround_noex_ctx libc_fesetenv_ctx
+# endif
+# ifndef libc_feresetround_noexf_ctx
+# define libc_feresetround_noexf_ctx libc_fesetenvf_ctx
+# endif
+# ifndef libc_feresetround_noexl_ctx
+# define libc_feresetround_noexl_ctx libc_fesetenvl_ctx
+# endif
+
+#else
+
+# define libc_feholdsetround_ctx default_libc_feholdsetround_ctx
+# define libc_feresetround_ctx default_libc_feresetround_ctx
+# define libc_feholdsetround_noex_ctx default_libc_feholdsetround_noex_ctx
+# define libc_feresetround_noex_ctx default_libc_feresetround_noex_ctx
+
# define libc_feholdsetroundf_ctx libc_feholdsetround_ctx
# define libc_feholdsetroundl_ctx libc_feholdsetround_ctx
# define libc_feresetroundf_ctx libc_feresetround_ctx
@@ -760,7 +547,7 @@ libc_feresetround_noex_ctx (struct rm_ctx *ctx)
the value at the start of the block. The exception mode must be preserved.
Exceptions raised within the block must be discarded, and exception flags
are restored to the value at the start of the block.
- Non-stop mode may be enabled inside the block. */
+ Non-stop mode must be enabled inside the block. */
#define SET_RESTORE_ROUND_NOEX(RM) \
SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_noex, \
@@ -777,11 +564,94 @@ 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))
+/* When no floating-point exceptions are defined in <fenv.h>, make
+ feraiseexcept ignore its argument so that unconditional
+ feraiseexcept calls do not cause errors for undefined exceptions.
+ Define it to expand to a void expression so that any calls testing
+ the result of feraiseexcept do produce errors. */
+#if FE_ALL_EXCEPT == 0
+# define feraiseexcept(excepts) ((void) 0)
+# define __feraiseexcept(excepts) ((void) 0)
+#endif
+
+/* Similarly, most <fenv.h> functions have trivial implementations in
+ the absence of support for floating-point exceptions and rounding
+ modes. */
+
+#if !FE_HAVE_ROUNDING_MODES
+# if FE_ALL_EXCEPT == 0
+extern inline int
+fegetenv (fenv_t *__e)
+{
+ return 0;
+}
+
+extern inline int
+__fegetenv (fenv_t *__e)
+{
+ return 0;
+}
+
+extern inline int
+feholdexcept (fenv_t *__e)
+{
+ return 0;
+}
+
+extern inline int
+__feholdexcept (fenv_t *__e)
+{
+ return 0;
+}
+
+extern inline int
+fesetenv (const fenv_t *__e)
+{
+ return 0;
+}
+
+extern inline int
+__fesetenv (const fenv_t *__e)
+{
+ return 0;
+}
+
+extern inline int
+feupdateenv (const fenv_t *__e)
+{
+ return 0;
+}
+
+extern inline int
+__feupdateenv (const fenv_t *__e)
+{
+ return 0;
+}
+# endif
+
+extern inline int
+fegetround (void)
+{
+ return FE_TONEAREST;
+}
+
+extern inline int
+__fegetround (void)
+{
+ return FE_TONEAREST;
+}
+
+extern inline int
+fesetround (int __d)
+{
+ return 0;
+}
+
+extern inline int
+__fesetround (int __d)
+{
+ return 0;
+}
+#endif
#endif /* _MATH_PRIVATE_H_ */
diff --git a/sysdeps/generic/math_private_calls.h b/sysdeps/generic/math_private_calls.h
new file mode 100644
index 0000000000..16b4ea3736
--- /dev/null
+++ b/sysdeps/generic/math_private_calls.h
@@ -0,0 +1,124 @@
+/* Private function declarations for libm.
+ Copyright (C) 2011-2018 Free Software 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 __MSUF_X(x, suffix) x ## suffix
+#define __MSUF_S(...) __MSUF_X (__VA_ARGS__)
+#define __MSUF(x) __MSUF_S (x, _MSUF_)
+
+#define __MSUF_R_X(x, suffix) x ## suffix ## _r
+#define __MSUF_R_S(...) __MSUF_R_X (__VA_ARGS__)
+#define __MSUF_R(x) __MSUF_R_S (x, _MSUF_)
+
+/* IEEE style elementary functions. */
+extern _Mdouble_ __MSUF (__ieee754_acos) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_acosh) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_asin) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_atan2) (_Mdouble_, _Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_atanh) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_cosh) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_exp) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_exp10) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_exp2) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_fmod) (_Mdouble_, _Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_gamma) (_Mdouble_);
+extern _Mdouble_ __MSUF_R (__ieee754_gamma) (_Mdouble_, int *);
+extern _Mdouble_ __MSUF (__ieee754_hypot) (_Mdouble_, _Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_j0) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_j1) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_jn) (int, _Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_lgamma) (_Mdouble_);
+extern _Mdouble_ __MSUF_R (__ieee754_lgamma) (_Mdouble_, int *);
+extern _Mdouble_ __MSUF (__ieee754_log) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_log10) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_log2) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_pow) (_Mdouble_, _Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_remainder) (_Mdouble_, _Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_sinh) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_sqrt) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_y0) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_y1) (_Mdouble_);
+extern _Mdouble_ __MSUF (__ieee754_yn) (int, _Mdouble_);
+
+extern _Mdouble_ __MSUF (__ieee754_scalb) (_Mdouble_, _Mdouble_);
+extern int __MSUF (__ieee754_ilogb) (_Mdouble_);
+
+extern int32_t __MSUF (__ieee754_rem_pio2) (_Mdouble_, _Mdouble_ *);
+
+/* fdlibm kernel functions. */
+extern _Mdouble_ __MSUF (__kernel_sin) (_Mdouble_, _Mdouble_, int);
+extern _Mdouble_ __MSUF (__kernel_cos) (_Mdouble_, _Mdouble_);
+extern _Mdouble_ __MSUF (__kernel_tan) (_Mdouble_, _Mdouble_, int);
+
+#if defined __MATH_DECLARING_LONG_DOUBLE || defined __MATH_DECLARING_FLOATN
+extern void __MSUF (__kernel_sincos) (_Mdouble_, _Mdouble_,
+ _Mdouble_ *, _Mdouble_ *, int);
+#endif
+
+#if !defined __MATH_DECLARING_LONG_DOUBLE || defined __MATH_DECLARING_FLOATN
+extern int __MSUF (__kernel_rem_pio2) (_Mdouble_ *, _Mdouble_ *, int,
+ int, int, const int32_t *);
+#endif
+
+/* Internal functions. */
+#if !defined __MATH_DECLARING_LONG_DOUBLE || !defined NO_LONG_DOUBLE
+extern _Mdouble_ __MSUF (__copysign) (_Mdouble_ x, _Mdouble_ __y);
+
+extern inline _Mdouble_
+__MSUF (__copysign) (_Mdouble_ x, _Mdouble_ __y)
+{
+ return __MSUF (__builtin_copysign) (x, __y);
+}
+#endif
+
+/* Return X^2 + Y^2 - 1, computed without large cancellation error.
+ It is given that 1 > X >= Y >= epsilon / 2, and that X^2 + Y^2 >=
+ 0.5. */
+extern _Mdouble_ __MSUF (__x2y2m1) (_Mdouble_ x, _Mdouble_ y);
+
+/* 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
+ approximation to the product and *EPS is set to indicate the
+ approximate error in the return value. X is such that all the
+ values X + 1, ..., X + N - 1 are exactly representable, and X_EPS /
+ X is small enough that factors quadratic in it can be
+ neglected. */
+extern _Mdouble_ __MSUF (__gamma_product) (_Mdouble_ x, _Mdouble_ x_eps,
+ int n, _Mdouble_ *eps);
+
+/* Compute lgamma of a negative argument X, if it is in a range
+ (depending on the floating-point format) for which expansion around
+ zeros is used, setting *SIGNGAMP accordingly. */
+extern _Mdouble_ __MSUF (__lgamma_neg) (_Mdouble_ x, int *signgamp);
+
+/* 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
+ all the values X + 1, ..., X + N - 1 are exactly representable, and
+ X_EPS / X is small enough that factors quadratic in it can be
+ neglected. */
+#if !defined __MATH_DECLARING_FLOAT
+extern _Mdouble_ __MSUF (__lgamma_product) (_Mdouble_ t, _Mdouble_ x,
+ _Mdouble_ x_eps, int n);
+#endif
+
+#undef __MSUF_X
+#undef __MSUF_S
+#undef __MSUF
+
+#undef __MSUF_R_X
+#undef __MSUF_R_S
+#undef __MSUF_R
diff --git a/sysdeps/generic/memcopy.h b/sysdeps/generic/memcopy.h
index fe9aa60857..c0d8da3568 100644
--- a/sysdeps/generic/memcopy.h
+++ b/sysdeps/generic/memcopy.h
@@ -1,5 +1,5 @@
/* memcopy.h -- definitions for memory copy functions. Generic C version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/sysdeps/generic/memusage.h b/sysdeps/generic/memusage.h
index a8dbd2359f..2887ff1be3 100644
--- a/sysdeps/generic/memusage.h
+++ b/sysdeps/generic/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/nan-high-order-bit.h b/sysdeps/generic/nan-high-order-bit.h
new file mode 100644
index 0000000000..8ff3bcffa1
--- /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-2018 Free Software 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/net/if.h b/sysdeps/generic/net/if.h
index 6ddd86342a..61c34620d0 100644
--- a/sysdeps/generic/net/if.h
+++ b/sysdeps/generic/net/if.h
@@ -1,5 +1,5 @@
/* net/if.h -- declarations for inquiring about network interfaces
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/netinet/if_ether.h b/sysdeps/generic/netinet/if_ether.h
index c106a41c82..7f33d220d0 100644
--- a/sysdeps/generic/netinet/if_ether.h
+++ b/sysdeps/generic/netinet/if_ether.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#define __NETINET_IF_ETHER_H 1
#include <sys/types.h>
+#include <stdint.h>
#define ETH_ALEN 6 /* Octets in one ethernet address. */
@@ -26,7 +27,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..76c11c6763 100644
--- a/sysdeps/generic/netinet/in_systm.h
+++ b/sysdeps/generic/netinet/in_systm.h
@@ -1,5 +1,5 @@
/* System specific type definitions for networking code.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,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..821349458d 100644
--- a/sysdeps/generic/netinet/ip.h
+++ b/sysdeps/generic/netinet/ip.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,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/nfs/nfs.h b/sysdeps/generic/nfs/nfs.h
index 6e1d64c4b5..8b78de8289 100644
--- a/sysdeps/generic/nfs/nfs.h
+++ b/sysdeps/generic/nfs/nfs.h
@@ -1,5 +1,5 @@
/* <nfs/nfs.h> -- ill-specified NFS-related definitions
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/not-cancel.h b/sysdeps/generic/not-cancel.h
index d703bb228f..d9f8a75dbd 100644
--- a/sysdeps/generic/not-cancel.h
+++ b/sysdeps/generic/not-cancel.h
@@ -1,5 +1,5 @@
/* Uncancelable versions of cancelable interfaces. Generic version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -17,38 +17,41 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef NOT_CANCEL_H
+# define NOT_CANCEL_H
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <time.h>
+#include <sys/uio.h>
+
/* By default we have none. Map the name to the normal functions. */
-#define open_not_cancel(name, flags, mode) \
- __libc_open (name, flags, mode)
-#define open_not_cancel_2(name, flags) \
- __libc_open (name, flags)
-#define openat_not_cancel(fd, name, flags, mode) \
- __openat (fd, name, flags, mode)
-#define openat_not_cancel_3(fd, name, flags) \
- __openat (fd, name, flags, 0)
-#define openat64_not_cancel(fd, name, flags, mode) \
- __openat64 (fd, name, flags, mode)
-#define openat64_not_cancel_3(fd, name, flags) \
- __openat64 (fd, name, flags, 0)
-#define close_not_cancel(fd) \
+#define __open_nocancel(...) \
+ __open (__VA_ARGS__)
+#define __open64_nocancel(...) \
+ __open64 (__VA_ARGS__)
+#define __openat_nocancel(...) \
+ __openat (__VA_ARGS__)
+#define __openat64_nocancel(...) \
+ __openat64 (__VA_ARGS__)
+#define __close_nocancel(fd) \
__close (fd)
-#define close_not_cancel_no_status(fd) \
+#define __close_nocancel_nostatus(fd) \
(void) __close (fd)
-#define read_not_cancel(fd, buf, n) \
+#define __read_nocancel(fd, buf, n) \
__read (fd, buf, n)
-#define write_not_cancel(fd, buf, n) \
+#define __write_nocancel(fd, buf, n) \
__write (fd, buf, n)
-#define writev_not_cancel_no_status(fd, iov, n) \
+#define __writev_nocancel_nostatus(fd, iov, n) \
(void) __writev (fd, iov, n)
-#define fcntl_not_cancel(fd, cmd, val) \
- __fcntl (fd, cmd, val)
-# define waitpid_not_cancel(pid, stat_loc, options) \
+# define __waitpid_nocancel(pid, stat_loc, options) \
__waitpid (pid, stat_loc, options)
-#define pause_not_cancel() \
+#define __pause_nocancel() \
__pause ()
-#define nanosleep_not_cancel(requested_time, remaining) \
+#define __nanosleep_nocancel(requested_time, remaining) \
__nanosleep (requested_time, remaining)
-#define sigsuspend_not_cancel(set) \
- __sigsuspend (set)
+#define __fcntl64_nocancel(fd, cmd, ...) \
+ __fcntl64 (fd, cmd, __VA_ARGS__)
-#define NO_CANCELLATION 1
+#endif /* NOT_CANCEL_H */
diff --git a/sysdeps/generic/not-errno.h b/sysdeps/generic/not-errno.h
new file mode 100644
index 0000000000..93617a3266
--- /dev/null
+++ b/sysdeps/generic/not-errno.h
@@ -0,0 +1,19 @@
+/* Syscall wrapper that do not set errno. Generic version.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+extern __typeof (__access) __access_noerrno attribute_hidden;
diff --git a/sysdeps/generic/nscd-types.h b/sysdeps/generic/nscd-types.h
index 3874f3339f..724f3de4eb 100644
--- a/sysdeps/generic/nscd-types.h
+++ b/sysdeps/generic/nscd-types.h
@@ -1,5 +1,5 @@
/* Types for the NSCD implementation. Generic version.
- Copyright (c) 2000-2016 Free Software Foundation, Inc.
+ Copyright (c) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/pagecopy.h b/sysdeps/generic/pagecopy.h
index 6ab29ce91d..1c5910702e 100644
--- a/sysdeps/generic/pagecopy.h
+++ b/sysdeps/generic/pagecopy.h
@@ -1,5 +1,5 @@
/* Macros for copying by pages; used in memcpy, memmove.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/profil-counter.h b/sysdeps/generic/profil-counter.h
index 514245888a..a6fd39ace8 100644
--- a/sysdeps/generic/profil-counter.h
+++ b/sysdeps/generic/profil-counter.h
@@ -1,5 +1,5 @@
/* Machine-dependent SIGPROF signal handler. "Generic" version w/ sigcontext
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/pty-private.h b/sysdeps/generic/pty-private.h
index 955e77f106..9d453a57d0 100644
--- a/sysdeps/generic/pty-private.h
+++ b/sysdeps/generic/pty-private.h
@@ -1,5 +1,5 @@
/* Internal defenitions and declarations for pseudo terminal functions.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
diff --git a/sysdeps/generic/register-dump.h b/sysdeps/generic/register-dump.h
index 831dbc53db..6ac099a932 100644
--- a/sysdeps/generic/register-dump.h
+++ b/sysdeps/generic/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/generic/safe-fatal.h b/sysdeps/generic/safe-fatal.h
index 22ab3560ea..60f798a0a5 100644
--- a/sysdeps/generic/safe-fatal.h
+++ b/sysdeps/generic/safe-fatal.h
@@ -1,5 +1,5 @@
/* Crash the process immediately, without possibility of deadlock. Generic.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/setjmpP.h b/sysdeps/generic/setjmpP.h
new file mode 100644
index 0000000000..b30d105cd0
--- /dev/null
+++ b/sysdeps/generic/setjmpP.h
@@ -0,0 +1,24 @@
+/* Internal header file for <setjmp.h>. Generic version.
+ Copyright (C) 2017-2018 Free Software 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 _SETJMPP_H
+#define _SETJMPP_H 1
+
+#include <setjmp.h>
+
+#endif /* setjmpP.h */
diff --git a/sysdeps/generic/sigcontextinfo.h b/sysdeps/generic/sigcontextinfo.h
index 035986dd1b..3e199416f8 100644
--- a/sysdeps/generic/sigcontextinfo.h
+++ b/sysdeps/generic/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -18,9 +18,4 @@
/* In general we cannot provide any information. */
#define SIGCONTEXT struct sigcontext *
-#define SIGCONTEXT_EXTRA_ARGS
#define GET_PC(ctx) ((void *) 0)
-#define GET_FRAME(ctx) ((void *) 0)
-#define GET_STACK(ctx) ((void *) 0)
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/generic/siglist.h b/sysdeps/generic/siglist.h
index 49b86eaf90..99d05b25d0 100644
--- a/sysdeps/generic/siglist.h
+++ b/sysdeps/generic/siglist.h
@@ -1,5 +1,5 @@
/* Canonical list of all signal names.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,8 @@
/* This file is included multiple times. */
-/* Standard signals */
+/* Standard signals, in the numerical order defined in
+ bits/signum-generic.h. */
init_sig (SIGHUP, "HUP", N_("Hangup"))
init_sig (SIGINT, "INT", N_("Interrupt"))
init_sig (SIGQUIT, "QUIT", N_("Quit"))
@@ -34,6 +35,7 @@
init_sig (SIGFPE, "FPE", N_("Floating point exception"))
init_sig (SIGKILL, "KILL", N_("Killed"))
init_sig (SIGBUS, "BUS", N_("Bus error"))
+ init_sig (SIGSYS, "SYS", N_("Bad system call"))
init_sig (SIGSEGV, "SEGV", N_("Segmentation fault"))
init_sig (SIGPIPE, "PIPE", N_("Broken pipe"))
init_sig (SIGALRM, "ALRM", N_("Alarm clock"))
@@ -45,32 +47,28 @@
init_sig (SIGCHLD, "CHLD", N_("Child exited"))
init_sig (SIGTTIN, "TTIN", N_("Stopped (tty input)"))
init_sig (SIGTTOU, "TTOU", N_("Stopped (tty output)"))
- init_sig (SIGIO, "IO", N_("I/O possible"))
+ init_sig (SIGPOLL, "POLL", N_("I/O possible"))
init_sig (SIGXCPU, "XCPU", N_("CPU time limit exceeded"))
init_sig (SIGXFSZ, "XFSZ", N_("File size limit exceeded"))
init_sig (SIGVTALRM, "VTALRM", N_("Virtual timer expired"))
init_sig (SIGPROF, "PROF", N_("Profiling timer expired"))
init_sig (SIGUSR1, "USR1", N_("User defined signal 1"))
init_sig (SIGUSR2, "USR2", N_("User defined signal 2"))
+ init_sig (SIGWINCH, "WINCH", N_("Window changed"))
-/* Variations */
+/* Signals that are not present on all supported platforms. */
#ifdef SIGEMT
init_sig (SIGEMT, "EMT", N_("EMT trap"))
#endif
-#ifdef SIGSYS
- init_sig (SIGSYS, "SYS", N_("Bad system call"))
-#endif
#ifdef SIGSTKFLT
init_sig (SIGSTKFLT, "STKFLT", N_("Stack fault"))
#endif
-#ifdef SIGINFO
- init_sig (SIGINFO, "INFO", N_("Information request"))
-#elif defined(SIGPWR) && (!defined(SIGLOST) || (SIGPWR != SIGLOST))
+#ifdef SIGPWR
init_sig (SIGPWR, "PWR", N_("Power failure"))
#endif
-#ifdef SIGLOST
- init_sig (SIGLOST, "LOST", N_("Resource lost"))
+#if defined SIGINFO && (!defined SIGPWR || SIGPWR != SIGINFO)
+ init_sig (SIGINFO, "INFO", N_("Information request"))
#endif
-#ifdef SIGWINCH
- init_sig (SIGWINCH, "WINCH", N_("Window changed"))
+#if defined SIGLOST && (!defined SIGPWR || SIGPWR != SIGLOST)
+ init_sig (SIGLOST, "LOST", N_("Resource lost"))
#endif
diff --git a/sysdeps/generic/sigset-cvt-mask.h b/sysdeps/generic/sigset-cvt-mask.h
index 78a8fa5896..ad4b8b2d2d 100644
--- a/sysdeps/generic/sigset-cvt-mask.h
+++ b/sysdeps/generic/sigset-cvt-mask.h
@@ -1,6 +1,6 @@
/* Convert between lowlevel sigmask and libc representation of sigset_t.
Generic version.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Joe Keane <jgk@jgk.org>.
@@ -20,6 +20,8 @@
/* Convert between an old-style 32-bit signal mask and a POSIX sigset_t. */
+#include <sigsetops.h>
+
/* Perform *SET = MASK. Unused bits of *SET are set to 0.
Returns zero for success or -1 for errors (from sigaddset/sigemptyset). */
static inline int __attribute__ ((unused))
diff --git a/sysdeps/generic/sigsetops.h b/sysdeps/generic/sigsetops.h
new file mode 100644
index 0000000000..52b0e79071
--- /dev/null
+++ b/sysdeps/generic/sigsetops.h
@@ -0,0 +1,76 @@
+/* __sigset_t manipulators. Generic/BSD version.
+ Copyright (C) 1991-2018 Free Software 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 _SIGSETOPS_H
+#define _SIGSETOPS_H 1
+
+#include <signal.h>
+
+/* Return a mask that includes SIG only. The cast to `sigset_t' avoids
+ overflow if `sigset_t' is wider than `int'. */
+# define __sigmask(sig) (((__sigset_t) 1) << ((sig) - 1))
+
+#define __sigemptyset(set) \
+ (__extension__ ({ \
+ *(set) = (__sigset_t) 0; \
+ 0; \
+ }))
+#define __sigfillset(set) \
+ (__extension__ ({ \
+ *(set) = ~(__sigset_t) 0; \
+ 0; \
+ }))
+
+# define __sigisemptyset(set) \
+ (*(set) == (__sigset_t) 0)
+
+# define __sigandset(dest, left, right) \
+ (__extension__ ({ \
+ *(dest) = *(left) & *(right); \
+ 0; \
+ }))
+
+# define __sigorset(dest, left, right) \
+ (__extension__ ({ \
+ *(dest) = *(left) | *(right); \
+ 0; \
+ }))
+
+/* These macros needn't check for a bogus signal number;
+ checking is done in the non-__ versions. */
+# define __sigismember(set, sig) \
+ (__extension__ ({ \
+ __sigset_t __mask = __sigmask (sig); \
+ *(set) & __mask ? 1 : 0; \
+ }))
+
+# define __sigaddset(set, sig) \
+ (__extension__ ({ \
+ __sigset_t __mask = __sigmask (sig); \
+ *(set) |= __mask; \
+ 0; \
+ }))
+
+# define __sigdelset(set, sig) \
+ (__extension__ ({ \
+ __sigset_t __mask = __sigmask (sig); \
+ *(set) &= ~__mask; \
+ 0; \
+ }))
+
+#endif
diff --git a/sysdeps/generic/stackinfo.h b/sysdeps/generic/stackinfo.h
index d510c59c74..d6bf544a11 100644
--- a/sysdeps/generic/stackinfo.h
+++ b/sysdeps/generic/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/startup.h b/sysdeps/generic/startup.h
new file mode 100644
index 0000000000..b1e0118604
--- /dev/null
+++ b/sysdeps/generic/startup.h
@@ -0,0 +1,23 @@
+/* Generic definitions of functions used by static libc main startup.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* Targets should override this file if the default definitions below
+ will not work correctly very early before TLS is initialized. */
+
+/* Use macro instead of inline function to avoid including <stdio.h>. */
+#define _startup_fatal(message) __libc_fatal ((message))
diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h
index 442762728b..11fb0ebef9 100644
--- a/sysdeps/generic/stdint.h
+++ b/sysdeps/generic/stdint.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,66 +22,34 @@
#ifndef _STDINT_H
#define _STDINT_H 1
-#include <features.h>
+#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
+#include <bits/types.h>
#include <bits/wchar.h>
#include <bits/wordsize.h>
/* Exact integral types. */
/* Signed. */
-
-/* There is some amount of overlap with <sys/types.h> as known by inet code */
-#ifndef __int8_t_defined
-# define __int8_t_defined
-typedef signed char int8_t;
-typedef short int int16_t;
-typedef int int32_t;
-# if __WORDSIZE == 64
-typedef long int int64_t;
-# else
-__extension__
-typedef long long int int64_t;
-# endif
-#endif
+#include <bits/stdint-intn.h>
/* Unsigned. */
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-#ifndef __uint32_t_defined
-typedef unsigned int uint32_t;
-# define __uint32_t_defined
-#endif
-#if __WORDSIZE == 64
-typedef unsigned long int uint64_t;
-#else
-__extension__
-typedef unsigned long long int uint64_t;
-#endif
+#include <bits/stdint-uintn.h>
/* Small types. */
/* Signed. */
-typedef signed char int_least8_t;
-typedef short int int_least16_t;
-typedef int int_least32_t;
-#if __WORDSIZE == 64
-typedef long int int_least64_t;
-#else
-__extension__
-typedef long long int int_least64_t;
-#endif
+typedef __int_least8_t int_least8_t;
+typedef __int_least16_t int_least16_t;
+typedef __int_least32_t int_least32_t;
+typedef __int_least64_t int_least64_t;
/* Unsigned. */
-typedef unsigned char uint_least8_t;
-typedef unsigned short int uint_least16_t;
-typedef unsigned int uint_least32_t;
-#if __WORDSIZE == 64
-typedef unsigned long int uint_least64_t;
-#else
-__extension__
-typedef unsigned long long int uint_least64_t;
-#endif
+typedef __uint_least8_t uint_least8_t;
+typedef __uint_least16_t uint_least16_t;
+typedef __uint_least32_t uint_least32_t;
+typedef __uint_least64_t uint_least64_t;
/* Fast types. */
@@ -130,15 +98,8 @@ typedef unsigned int uintptr_t;
/* Largest integral types. */
-#if __WORDSIZE == 64
-typedef long int intmax_t;
-typedef unsigned long int uintmax_t;
-#else
-__extension__
-typedef long long int intmax_t;
-__extension__
-typedef unsigned long long int uintmax_t;
-#endif
+typedef __intmax_t intmax_t;
+typedef __uintmax_t uintmax_t;
# if __WORDSIZE == 64
@@ -248,8 +209,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 +226,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 +273,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/stdio-lock.h b/sysdeps/generic/stdio-lock.h
index 69090a1409..4a40618545 100644
--- a/sysdeps/generic/stdio-lock.h
+++ b/sysdeps/generic/stdio-lock.h
@@ -1,5 +1,5 @@
/* Thread package specific definitions of stream lock type. Generic version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,7 @@
#include <libc-lock.h>
__libc_lock_define_recursive (typedef, _IO_lock_t)
+#define _IO_lock_t_defined 1
/* We need recursive (counting) mutexes. */
#ifdef _LIBC_LOCK_RECURSIVE_INITIALIZER
@@ -49,13 +50,13 @@ __libc_lock_define_recursive (typedef, _IO_lock_t)
# ifdef __EXCEPTIONS
# define _IO_acquire_lock(_fp) \
do { \
- _IO_FILE *_IO_acquire_lock_file \
+ FILE *_IO_acquire_lock_file \
__attribute__((cleanup (_IO_acquire_lock_fct))) \
= (_fp); \
_IO_flockfile (_IO_acquire_lock_file);
# define _IO_acquire_lock_clear_flags2(_fp) \
do { \
- _IO_FILE *_IO_acquire_lock_file \
+ FILE *_IO_acquire_lock_file \
__attribute__((cleanup (_IO_acquire_lock_clear_flags2_fct))) \
= (_fp); \
_IO_flockfile (_IO_acquire_lock_file);
diff --git a/sysdeps/generic/string_private.h b/sysdeps/generic/string_private.h
index c880aae4f2..4e152efce6 100644
--- a/sysdeps/generic/string_private.h
+++ b/sysdeps/generic/string_private.h
@@ -1,5 +1,5 @@
/* Define _STRING_ARCH_unaligned. Generic version.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h
index ce576c9fd2..d614c099c9 100644
--- a/sysdeps/generic/symbol-hacks.h
+++ b/sysdeps/generic/symbol-hacks.h
@@ -4,4 +4,16 @@
asm ("memmove = __GI_memmove");
asm ("memset = __GI_memset");
asm ("memcpy = __GI_memcpy");
+
+/* Some targets do not use __stack_chk_fail_local. In libc.so,
+ redirect __stack_chk_fail to a hidden reference
+ __stack_chk_fail_local, to avoid the PLT reference.
+ __stack_chk_fail itself is a global symbol, exported from libc.so,
+ and cannot be made hidden. */
+
+# if IS_IN (libc) && defined SHARED && \
+ defined STACK_PROTECTOR_LEVEL && STACK_PROTECTOR_LEVEL > 0
+asm (".hidden __stack_chk_fail_local\n"
+ "__stack_chk_fail = __stack_chk_fail_local");
+# endif
#endif
diff --git a/sysdeps/generic/sys/ptrace.h b/sysdeps/generic/sys/ptrace.h
index baf4f7a440..268b4313e1 100644
--- a/sysdeps/generic/sys/ptrace.h
+++ b/sysdeps/generic/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Generic version; constants are common.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/sys/swap.h b/sysdeps/generic/sys/swap.h
index 40cdea89bc..ee684a44b4 100644
--- a/sysdeps/generic/sys/swap.h
+++ b/sysdeps/generic/sys/swap.h
@@ -1,5 +1,5 @@
/* Calls to enable and disable swapping on specified locations. Unix version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/sys/sysinfo.h b/sysdeps/generic/sys/sysinfo.h
index 5c1a8c662c..625550cb47 100644
--- a/sysdeps/generic/sys/sysinfo.h
+++ b/sysdeps/generic/sys/sysinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/sys/sysmacros.h b/sysdeps/generic/sys/sysmacros.h
deleted file mode 100644
index 4cc59616fb..0000000000
--- a/sysdeps/generic/sys/sysmacros.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Definitions of macros to access `dev_t' values.
- 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/>. */
-
-#ifndef _SYS_SYSMACROS_H
-#define _SYS_SYSMACROS_H 1
-
-/* For compatibility we provide alternative names.
-
- The problem here is that compilers other than GCC probably don't
- have the `long long' type and so `dev_t' is actually an array. */
-#define major(dev) ((int)(((unsigned int) (dev) >> 8) & 0xff))
-#define minor(dev) ((int)((dev) & 0xff))
-#define makedev(major, minor) (((major) << 8) | (minor))
-
-#endif /* sys/sysmacros.h */
diff --git a/sysdeps/generic/sys/ucontext.h b/sysdeps/generic/sys/ucontext.h
index f08cec04cc..0191f0306d 100644
--- a/sysdeps/generic/sys/ucontext.h
+++ b/sysdeps/generic/sys/ucontext.h
@@ -1,5 +1,5 @@
/* Data structures for user-level context switching. Generic version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software 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,28 +17,38 @@
<http://www.gnu.org/licenses/>. */
/* This file's definitions suffice for any platform where all
- the machine-specific state is described in `struct sigcontext'. */
+ the machine-specific state is described in `struct sigcontext', but
+ use of struct sigcontext does not conform to POSIX namespace
+ requirements. */
#ifndef _SYS_UCONTEXT_H
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+#include <bits/types/sigset_t.h>
#include <bits/sigcontext.h>
+#include <bits/types/stack_t.h>
+
typedef struct sigcontext mcontext_t;
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
+ sigset_t uc_sigmask;
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/generic/sysdep.h b/sysdeps/generic/sysdep.h
index 4c45702628..934d4da839 100644
--- a/sysdeps/generic/sysdep.h
+++ b/sysdeps/generic/sysdep.h
@@ -1,5 +1,5 @@
/* Generic asm macros used on many machines.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/thread_state.h b/sysdeps/generic/thread_state.h
index b168e20246..99b7c923e8 100644
--- a/sysdeps/generic/thread_state.h
+++ b/sysdeps/generic/thread_state.h
@@ -1,5 +1,5 @@
/* Mach thread state definitions for machine-independent code. Stub version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,11 @@
/* Replace <machine> with "i386" or "mips" or whatever. */
+/* This lets the kernel define architecture-specific registers for a new
+ thread. */
#define MACHINE_NEW_THREAD_STATE_FLAVOR <machine>_NEW_THREAD_STATE
+/* This makes the kernel load all architectures-specific registers for the
+ thread. */
#define MACHINE_THREAD_STATE_FLAVOR <machine>_THREAD_STATE
#define MACHINE_THREAD_STATE_COUNT <machine>_THREAD_STATE_COUNT
diff --git a/sysdeps/generic/tininess.h b/sysdeps/generic/tininess.h
index 2d459dcce1..bb3ab28152 100644
--- a/sysdeps/generic/tininess.h
+++ b/sysdeps/generic/tininess.h
@@ -1,6 +1,6 @@
/* Specify architecture-specific rules for determining tininess of
floating-point results. Generic version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/tls-setup.h b/sysdeps/generic/tls-setup.h
new file mode 100644
index 0000000000..8d0c36d2b8
--- /dev/null
+++ b/sysdeps/generic/tls-setup.h
@@ -0,0 +1,22 @@
+/* Definitions to set up thread-local data. Generic version.
+ Copyright (C) 2018 Free Software 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/>. */
+
+static inline void __attribute__ ((always_inline))
+tls_setup_tcbhead (struct pthread *pd)
+{
+}
diff --git a/sysdeps/generic/tls.h b/sysdeps/generic/tls.h
index 5126a50198..01cbbeb7ba 100644
--- a/sysdeps/generic/tls.h
+++ b/sysdeps/generic/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. Generic version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -71,4 +71,10 @@
This macro returns the address of the DTV of the current thread.
This normally is done using the thread register which points
to the dtv or the TCB (from which the DTV can found).
+
+
+ THREAD_GSCOPE_IN_TCB
+
+ This should be set to 1 if the global scope flag is stored within the TCB.
+ When set to 0, GL(_dl_thread_gscope_count) will be defined to store it.
*/
diff --git a/sysdeps/generic/tst-stack-align.h b/sysdeps/generic/tst-stack-align.h
index 372509adef..e5cb331048 100644
--- a/sysdeps/generic/tst-stack-align.h
+++ b/sysdeps/generic/tst-stack-align.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/unsecvars.h b/sysdeps/generic/unsecvars.h
index d5b8119c9c..5ea8a4a259 100644
--- a/sysdeps/generic/unsecvars.h
+++ b/sysdeps/generic/unsecvars.h
@@ -1,14 +1,22 @@
+#if !HAVE_TUNABLES
+# define GLIBC_TUNABLES_ENVVAR "GLIBC_TUNABLES\0"
+#else
+# define GLIBC_TUNABLES_ENVVAR
+#endif
+
/* Environment variable to be removed for SUID programs. The names are
all stuffed in a single string which means they have to be terminated
with a '\0' explicitly. */
#define UNSECURE_ENVVARS \
"GCONV_PATH\0" \
"GETCONF_DIR\0" \
+ GLIBC_TUNABLES_ENVVAR \
"HOSTALIASES\0" \
"LD_AUDIT\0" \
"LD_DEBUG\0" \
"LD_DEBUG_OUTPUT\0" \
"LD_DYNAMIC_WEAK\0" \
+ "LD_HWCAP_MASK\0" \
"LD_LIBRARY_PATH\0" \
"LD_ORIGIN_PATH\0" \
"LD_PRELOAD\0" \
diff --git a/sysdeps/generic/unwind-dw2-fde-glibc.c b/sysdeps/generic/unwind-dw2-fde-glibc.c
index e09fd4ce4b..3b374b8982 100644
--- a/sysdeps/generic/unwind-dw2-fde-glibc.c
+++ b/sysdeps/generic/unwind-dw2-fde-glibc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/generic/unwind-dw2-fde.c b/sysdeps/generic/unwind-dw2-fde.c
index 6a64cbd254..80bcf61370 100644
--- a/sysdeps/generic/unwind-dw2-fde.c
+++ b/sysdeps/generic/unwind-dw2-fde.c
@@ -1,5 +1,5 @@
/* Subroutines needed for unwinding stack frames for exception handling. */
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
Contributed by Jason Merrill <jason@cygnus.com>.
This file is part of the GNU C Library.
@@ -202,6 +202,7 @@ __deregister_frame_info_bases (void *begin)
{
struct object **p;
struct object *ob = 0;
+ struct fde_vector *tofree = NULL;
/* If .eh_frame is empty, we haven't registered. */
if (*(uword *) begin == 0)
@@ -225,7 +226,7 @@ __deregister_frame_info_bases (void *begin)
{
ob = *p;
*p = ob->next;
- free (ob->u.sort);
+ tofree = ob->u.sort;
goto out;
}
}
@@ -244,6 +245,7 @@ __deregister_frame_info_bases (void *begin)
out:
__gthread_mutex_unlock (&object_mutex);
+ free (tofree);
return (void *) ob;
}
hidden_def (__deregister_frame_info_bases)
diff --git a/sysdeps/generic/unwind-dw2-fde.h b/sysdeps/generic/unwind-dw2-fde.h
index 9b55e73e77..869448bfb1 100644
--- a/sysdeps/generic/unwind-dw2-fde.h
+++ b/sysdeps/generic/unwind-dw2-fde.h
@@ -1,5 +1,5 @@
/* Subroutines needed for unwinding stack frames for exception handling. */
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
Contributed by Jason Merrill <jason@cygnus.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/generic/unwind-dw2.c b/sysdeps/generic/unwind-dw2.c
index b6bb5fa1d9..082609b34a 100644
--- a/sysdeps/generic/unwind-dw2.c
+++ b/sysdeps/generic/unwind-dw2.c
@@ -1,5 +1,5 @@
/* DWARF2 exception handling and frame unwind runtime interface routines.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/generic/unwind-pe.h b/sysdeps/generic/unwind-pe.h
index c3a98ab816..4a791ac93f 100644
--- a/sysdeps/generic/unwind-pe.h
+++ b/sysdeps/generic/unwind-pe.h
@@ -1,5 +1,5 @@
/* Exception handling and frame unwind runtime interface routines.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/generic/unwind-resume.h b/sysdeps/generic/unwind-resume.h
index fd6e80cef8..3807e6eadb 100644
--- a/sysdeps/generic/unwind-resume.h
+++ b/sysdeps/generic/unwind-resume.h
@@ -1,5 +1,5 @@
/* Definitions for unwind-resume.c. Generic version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/generic/unwind.h b/sysdeps/generic/unwind.h
index 23325468ad..aad9c10154 100644
--- a/sysdeps/generic/unwind.h
+++ b/sysdeps/generic/unwind.h
@@ -1,5 +1,5 @@
/* Exception handling and frame unwind runtime interface routines.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/generic/utmp-equal.h b/sysdeps/generic/utmp-equal.h
index 0eeedbbcf4..8b5c2e2cd2 100644
--- a/sysdeps/generic/utmp-equal.h
+++ b/sysdeps/generic/utmp-equal.h
@@ -1,5 +1,5 @@
/* Helper function for utmp functions to see if two entries are equal.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>
and Paul Janzen <pcj@primenet.com>, 1996.
diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
index c135ca9c36..ae0c3fc0aa 100644
--- a/sysdeps/gnu/Makefile
+++ b/sysdeps/gnu/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1996-2016 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/gnu/bits/ipc.h b/sysdeps/gnu/bits/ipc.h
index c28b4e8207..8ca9d59d34 100644
--- a/sysdeps/gnu/bits/ipc.h
+++ b/sysdeps/gnu/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/gnu/bits/msq.h b/sysdeps/gnu/bits/msq.h
index 8fc484f43d..0a4a67d5e9 100644
--- a/sysdeps/gnu/bits/msq.h
+++ b/sysdeps/gnu/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -43,8 +43,8 @@ struct msqid_ds
__time_t msg_stime; /* time of last msgsnd command */
__time_t msg_rtime; /* time of last msgrcv command */
__time_t msg_ctime; /* time of last change */
- struct wait_queue *__wwait; /* ??? */
- struct wait_queue *__rwait; /* ??? */
+ struct __wait_queue *__wwait; /* ??? */
+ struct __wait_queue *__rwait; /* ??? */
unsigned short int __msg_cbytes;/* current number of bytes on queue */
msgqnum_t msg_qnum; /* number of messages currently on queue */
msglen_t msg_qbytes; /* max number of bytes allowed on queue */
diff --git a/sysdeps/gnu/bits/sem.h b/sysdeps/gnu/bits/sem.h
index e24452e0b1..3c88176dfc 100644
--- a/sysdeps/gnu/bits/sem.h
+++ b/sysdeps/gnu/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/gnu/bits/shm.h b/sysdeps/gnu/bits/shm.h
index f5e139f11c..895c49b269 100644
--- a/sysdeps/gnu/bits/shm.h
+++ b/sysdeps/gnu/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -49,7 +49,7 @@ typedef unsigned short int shmatt_t;
struct shmid_ds
{
struct ipc_perm shm_perm; /* operation permission struct */
- int shm_segsz; /* size of segment in bytes */
+ size_t shm_segsz; /* size of segment in bytes */
__time_t shm_atime; /* time of last shmat() */
__time_t shm_dtime; /* time of last shmdt() */
__time_t shm_ctime; /* time of last change by shmctl() */
@@ -58,7 +58,7 @@ struct shmid_ds
shmatt_t shm_nattch; /* number of current attaches */
unsigned short int __shm_npages; /* size of segment (pages) */
unsigned long int *__shm_pages; /* array of ptrs to frames -> SHMMAX */
- struct vm_area_struct *__attaches; /* descriptors for attaches */
+ struct __vm_area_struct *__attaches; /* descriptors for attaches */
};
#ifdef __USE_MISC
diff --git a/sysdeps/gnu/bits/utmp.h b/sysdeps/gnu/bits/utmp.h
index 2a1ffcbf6f..47a6082eac 100644
--- a/sysdeps/gnu/bits/utmp.h
+++ b/sysdeps/gnu/bits/utmp.h
@@ -1,5 +1,5 @@
/* The `struct utmp' type, describing entries in the utmp file. GNU version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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;
@@ -59,16 +59,19 @@ struct utmp
{
short int ut_type; /* Type of login. */
pid_t ut_pid; /* Process ID of login process. */
- char ut_line[UT_LINESIZE]; /* Devicename. */
+ char ut_line[UT_LINESIZE]
+ __attribute_nonstring__; /* Devicename. */
char ut_id[4]; /* Inittab ID. */
- char ut_user[UT_NAMESIZE]; /* Username. */
- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
+ char ut_user[UT_NAMESIZE]
+ __attribute_nonstring__; /* Username. */
+ char ut_host[UT_HOSTSIZE]
+ __attribute_nonstring__; /* Hostname for remote login. */
struct exit_status ut_exit; /* Exit status of a process marked
as DEAD_PROCESS. */
/* 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..2a77efc607 100644
--- a/sysdeps/gnu/bits/utmpx.h
+++ b/sysdeps/gnu/bits/utmpx.h
@@ -1,5 +1,5 @@
/* Structures and definitions for the user accounting database. GNU version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,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/configure b/sysdeps/gnu/configure
index 71243ad0c6..c15d1087e8 100644
--- a/sysdeps/gnu/configure
+++ b/sysdeps/gnu/configure
@@ -9,8 +9,8 @@
test -n "$libc_cv_slibdir" ||
case "$prefix" in
/usr | /usr/)
- libc_cv_slibdir=/lib
- libc_cv_rtlddir=/lib
+ libc_cv_slibdir='/lib'
+ libc_cv_rtlddir='/lib'
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib';
# Locale data can be shared between 32-bit and 64-bit libraries.
diff --git a/sysdeps/gnu/errlist-compat.awk b/sysdeps/gnu/errlist-compat.awk
index 202de93cc5..ba1257ffab 100644
--- a/sysdeps/gnu/errlist-compat.awk
+++ b/sysdeps/gnu/errlist-compat.awk
@@ -1,5 +1,5 @@
# awk script to generate errlist-compat.c
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/gnu/errlist.awk b/sysdeps/gnu/errlist.awk
index 19bd676a90..9a5adf86a6 100644
--- a/sysdeps/gnu/errlist.awk
+++ b/sysdeps/gnu/errlist.awk
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2016 Free Software Foundation, Inc.
+# Copyright (C) 1991-2018 Free Software 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,10 +16,8 @@
# <http://www.gnu.org/licenses/>.
# errno.texi contains lines like:
-# @comment errno.h
-# @comment POSIX.1: Function not implemented
# @deftypevr Macro int ENOSYS
-# @comment errno 78
+# @errno{ENOSYS, 78, Function not implemented}
# Descriptive paragraph...
# @end deftypevr
@@ -61,22 +59,14 @@ BEGIN {
print " [0] = N_(\"Success\"),"
}
-$1 == "@comment" && $2 == "errno.h" { errnoh=1; next }
-errnoh == 1 && $1 == "@comment" \
+/^@errno\{/ \
{
- ++errnoh;
etext = $3;
for (i = 4; i <= NF; ++i)
etext = etext " " $i;
- next;
- }
-errnoh == 2 && $1 == "@deftypevr" && $2 == "Macro" && $3 == "int" \
- {
- e = $4; errnoh++; next;
- }
-errnoh == 3 && $1 == "@comment" && $2 == "errno" \
- {
- errno = $3 + 0;
+ etext = substr(etext, 1, length(etext)-1)
+ e = substr($1, 8, length($1)-8)
+ errno = substr($2, 1, length($2)-1) + 0
if (alias[e])
printf "#if defined (%s) && %s != %s\n", e, e, alias[e];
else
@@ -102,7 +92,6 @@ errnoh == 4 \
# This magic tag in C comments gets them copied into libc.pot.
desc = desc "\nTRANS" ($0 != "" ? " " : "") $0; next
}
-{ errnoh=0 }
END {
print " };";
print "";
diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c
index a9a5960503..31ebfa9491 100644
--- a/sysdeps/gnu/errlist.c
+++ b/sysdeps/gnu/errlist.c
@@ -21,7 +21,7 @@ const char *const _sys_errlist_internal[ERRLIST_SIZE] =
[0] = N_("Success"),
#ifdef EPERM
/*
-TRANS Operation not permitted; only the owner of the file (or other resource)
+TRANS Only the owner of the file (or other resource)
TRANS or processes with special privileges can perform the operation. */
[ERR_REMAP (EPERM)] = N_("Operation not permitted"),
# if EPERM > ERR_MAX
@@ -31,7 +31,7 @@ TRANS or processes with special privileges can perform the operation. */
#endif
#ifdef ENOENT
/*
-TRANS No such file or directory. This is a ``file doesn't exist'' error
+TRANS This is a ``file doesn't exist'' error
TRANS for ordinary files that are referenced in contexts where they are
TRANS expected to already exist. */
[ERR_REMAP (ENOENT)] = N_("No such file or directory"),
@@ -51,7 +51,7 @@ TRANS No process matches the specified process ID. */
#endif
#ifdef EINTR
/*
-TRANS Interrupted function call; an asynchronous signal occurred and prevented
+TRANS An asynchronous signal occurred and prevented
TRANS completion of the call. When this happens, you should try the call
TRANS again.
TRANS
@@ -66,7 +66,7 @@ TRANS Primitives}. */
#endif
#ifdef EIO
/*
-TRANS Input/output error; usually used for physical read or write errors. */
+TRANS Usually used for physical read or write errors. */
[ERR_REMAP (EIO)] = N_("Input/output error"),
# if EIO > ERR_MAX
# undef ERR_MAX
@@ -75,7 +75,7 @@ TRANS Input/output error; usually used for physical read or write errors. */
#endif
#ifdef ENXIO
/*
-TRANS No such device or address. The system tried to use the device
+TRANS The system tried to use the device
TRANS represented by a file you specified, and it couldn't find the device.
TRANS This can mean that the device file was installed incorrectly, or that
TRANS the physical device is missing or not correctly attached to the
@@ -88,7 +88,7 @@ TRANS computer. */
#endif
#ifdef E2BIG
/*
-TRANS Argument list too long; used when the arguments passed to a new program
+TRANS Used when the arguments passed to a new program
TRANS being executed with one of the @code{exec} functions (@pxref{Executing a
TRANS File}) occupy too much memory space. This condition never arises on
TRANS @gnuhurdsystems{}. */
@@ -110,7 +110,7 @@ TRANS @code{exec} functions; see @ref{Executing a File}. */
#endif
#ifdef EBADF
/*
-TRANS Bad file descriptor; for example, I/O on a descriptor that has been
+TRANS For example, I/O on a descriptor that has been
TRANS closed or reading from a descriptor open only for writing (or vice
TRANS versa). */
[ERR_REMAP (EBADF)] = N_("Bad file descriptor"),
@@ -121,7 +121,7 @@ TRANS versa). */
#endif
#ifdef ECHILD
/*
-TRANS There are no child processes. This error happens on operations that are
+TRANS This error happens on operations that are
TRANS supposed to manipulate child processes, when there aren't any processes
TRANS to manipulate. */
[ERR_REMAP (ECHILD)] = N_("No child processes"),
@@ -132,7 +132,7 @@ TRANS to manipulate. */
#endif
#ifdef EDEADLK
/*
-TRANS Deadlock avoided; allocating a system resource would have resulted in a
+TRANS Allocating a system resource would have resulted in a
TRANS deadlock situation. The system does not guarantee that it will notice
TRANS all such situations. This error means you got lucky and the system
TRANS noticed; it might just hang. @xref{File Locks}, for an example. */
@@ -144,7 +144,7 @@ TRANS noticed; it might just hang. @xref{File Locks}, for an example. */
#endif
#ifdef ENOMEM
/*
-TRANS No memory available. The system cannot allocate more virtual memory
+TRANS The system cannot allocate more virtual memory
TRANS because its capacity is full. */
[ERR_REMAP (ENOMEM)] = N_("Cannot allocate memory"),
# if ENOMEM > ERR_MAX
@@ -154,7 +154,7 @@ TRANS because its capacity is full. */
#endif
#ifdef EACCES
/*
-TRANS Permission denied; the file permissions do not allow the attempted operation. */
+TRANS The file permissions do not allow the attempted operation. */
[ERR_REMAP (EACCES)] = N_("Permission denied"),
# if EACCES > ERR_MAX
# undef ERR_MAX
@@ -163,7 +163,7 @@ TRANS Permission denied; the file permissions do not allow the attempted operati
#endif
#ifdef EFAULT
/*
-TRANS Bad address; an invalid pointer was detected.
+TRANS An invalid pointer was detected.
TRANS On @gnuhurdsystems{}, this error never happens; you get a signal instead. */
[ERR_REMAP (EFAULT)] = N_("Bad address"),
# if EFAULT > ERR_MAX
@@ -184,7 +184,7 @@ TRANS system in Unix gives this error. */
#endif
#ifdef EBUSY
/*
-TRANS Resource busy; a system resource that can't be shared is already in use.
+TRANS A system resource that can't be shared is already in use.
TRANS For example, if you try to delete a file that is the root of a currently
TRANS mounted filesystem, you get this error. */
[ERR_REMAP (EBUSY)] = N_("Device or resource busy"),
@@ -195,7 +195,7 @@ TRANS mounted filesystem, you get this error. */
#endif
#ifdef EEXIST
/*
-TRANS File exists; an existing file was specified in a context where it only
+TRANS An existing file was specified in a context where it only
TRANS makes sense to specify a new file. */
[ERR_REMAP (EEXIST)] = N_("File exists"),
# if EEXIST > ERR_MAX
@@ -235,7 +235,7 @@ TRANS A file that isn't a directory was specified when a directory is required.
#endif
#ifdef EISDIR
/*
-TRANS File is a directory; you cannot open a directory for writing,
+TRANS You cannot open a directory for writing,
TRANS or create or remove hard links to it. */
[ERR_REMAP (EISDIR)] = N_("Is a directory"),
# if EISDIR > ERR_MAX
@@ -245,7 +245,7 @@ TRANS or create or remove hard links to it. */
#endif
#ifdef EINVAL
/*
-TRANS Invalid argument. This is used to indicate various kinds of problems
+TRANS This is used to indicate various kinds of problems
TRANS with passing the wrong argument to a library function. */
[ERR_REMAP (EINVAL)] = N_("Invalid argument"),
# if EINVAL > ERR_MAX
@@ -304,7 +304,7 @@ TRANS is not an error on @gnuhurdsystems{}; the text is copied as necessary. */
#endif
#ifdef EFBIG
/*
-TRANS File too big; the size of a file would be larger than allowed by the system. */
+TRANS The size of a file would be larger than allowed by the system. */
[ERR_REMAP (EFBIG)] = N_("File too large"),
# if EFBIG > ERR_MAX
# undef ERR_MAX
@@ -313,7 +313,7 @@ TRANS File too big; the size of a file would be larger than allowed by the syste
#endif
#ifdef ENOSPC
/*
-TRANS No space left on device; write operation on a file failed because the
+TRANS Write operation on a file failed because the
TRANS disk is full. */
[ERR_REMAP (ENOSPC)] = N_("No space left on device"),
# if ENOSPC > ERR_MAX
@@ -341,7 +341,7 @@ TRANS An attempt was made to modify something on a read-only file system. */
#endif
#ifdef EMLINK
/*
-TRANS Too many links; the link count of a single file would become too large.
+TRANS The link count of a single file would become too large.
TRANS @code{rename} can cause this error if the file being renamed already has
TRANS as many links as it can take (@pxref{Renaming Files}). */
[ERR_REMAP (EMLINK)] = N_("Too many links"),
@@ -352,7 +352,7 @@ TRANS as many links as it can take (@pxref{Renaming Files}). */
#endif
#ifdef EPIPE
/*
-TRANS Broken pipe; there is no process reading from the other end of a pipe.
+TRANS There is no process reading from the other end of a pipe.
TRANS Every library function that returns this error code also generates a
TRANS @code{SIGPIPE} signal; this signal terminates the program if not handled
TRANS or blocked. Thus, your program will never actually see @code{EPIPE}
@@ -365,7 +365,7 @@ TRANS unless it has handled or blocked @code{SIGPIPE}. */
#endif
#ifdef EDOM
/*
-TRANS Domain error; used by mathematical functions when an argument value does
+TRANS Used by mathematical functions when an argument value does
TRANS not fall into the domain over which the function is defined. */
[ERR_REMAP (EDOM)] = N_("Numerical argument out of domain"),
# if EDOM > ERR_MAX
@@ -375,7 +375,7 @@ TRANS not fall into the domain over which the function is defined. */
#endif
#ifdef ERANGE
/*
-TRANS Range error; used by mathematical functions when the result value is
+TRANS Used by mathematical functions when the result value is
TRANS not representable because of overflow or underflow. */
[ERR_REMAP (ERANGE)] = N_("Numerical result out of range"),
# if ERANGE > ERR_MAX
@@ -385,7 +385,7 @@ TRANS not representable because of overflow or underflow. */
#endif
#ifdef EAGAIN
/*
-TRANS Resource temporarily unavailable; the call might work if you try again
+TRANS The call might work if you try again
TRANS later. The macro @code{EWOULDBLOCK} is another name for @code{EAGAIN};
TRANS they are always the same in @theglibc{}.
TRANS
@@ -672,8 +672,7 @@ TRANS The socket has already been shut down. */
# endif
#endif
#ifdef ETOOMANYREFS
-/*
-TRANS ??? */
+/* */
[ERR_REMAP (ETOOMANYREFS)] = N_("Too many references: cannot splice"),
# if ETOOMANYREFS > ERR_MAX
# undef ERR_MAX
@@ -781,7 +780,7 @@ TRANS The user's disk quota was exceeded. */
#endif
#ifdef ESTALE
/*
-TRANS Stale file handle. This indicates an internal confusion in the
+TRANS This indicates an internal confusion in the
TRANS file system which is due to file system rearrangements on the server host
TRANS for NFS file systems or corruption in other file systems.
TRANS Repairing this condition usually requires unmounting, possibly repairing
@@ -805,8 +804,7 @@ TRANS properly on @gnuhurdsystems{}, making this error code impossible.) */
# endif
#endif
#ifdef EBADRPC
-/*
-TRANS ??? */
+/* */
[ERR_REMAP (EBADRPC)] = N_("RPC struct is bad"),
# if EBADRPC > ERR_MAX
# undef ERR_MAX
@@ -814,8 +812,7 @@ TRANS ??? */
# endif
#endif
#ifdef ERPCMISMATCH
-/*
-TRANS ??? */
+/* */
[ERR_REMAP (ERPCMISMATCH)] = N_("RPC version wrong"),
# if ERPCMISMATCH > ERR_MAX
# undef ERR_MAX
@@ -823,8 +820,7 @@ TRANS ??? */
# endif
#endif
#ifdef EPROGUNAVAIL
-/*
-TRANS ??? */
+/* */
[ERR_REMAP (EPROGUNAVAIL)] = N_("RPC program not available"),
# if EPROGUNAVAIL > ERR_MAX
# undef ERR_MAX
@@ -832,8 +828,7 @@ TRANS ??? */
# endif
#endif
#ifdef EPROGMISMATCH
-/*
-TRANS ??? */
+/* */
[ERR_REMAP (EPROGMISMATCH)] = N_("RPC program version wrong"),
# if EPROGMISMATCH > ERR_MAX
# undef ERR_MAX
@@ -841,8 +836,7 @@ TRANS ??? */
# endif
#endif
#ifdef EPROCUNAVAIL
-/*
-TRANS ??? */
+/* */
[ERR_REMAP (EPROCUNAVAIL)] = N_("RPC bad procedure for program"),
# if EPROCUNAVAIL > ERR_MAX
# undef ERR_MAX
@@ -851,7 +845,7 @@ TRANS ??? */
#endif
#ifdef ENOLCK
/*
-TRANS No locks available. This is used by the file locking facilities; see
+TRANS This is used by the file locking facilities; see
TRANS @ref{File Locks}. This error is never generated by @gnuhurdsystems{}, but
TRANS it can result from an operation to an NFS server running another
TRANS operating system. */
@@ -863,7 +857,7 @@ TRANS operating system. */
#endif
#ifdef EFTYPE
/*
-TRANS Inappropriate file type or format. The file was the wrong type for the
+TRANS The file was the wrong type for the
TRANS operation, or a data file had the wrong format.
TRANS
TRANS On some systems @code{chmod} returns this error if you try to set the
@@ -875,8 +869,7 @@ TRANS sticky bit on a non-directory file; @pxref{Setting Permissions}. */
# endif
#endif
#ifdef EAUTH
-/*
-TRANS ??? */
+/* */
[ERR_REMAP (EAUTH)] = N_("Authentication error"),
# if EAUTH > ERR_MAX
# undef ERR_MAX
@@ -884,8 +877,7 @@ TRANS ??? */
# endif
#endif
#ifdef ENEEDAUTH
-/*
-TRANS ??? */
+/* */
[ERR_REMAP (ENEEDAUTH)] = N_("Need authenticator"),
# if ENEEDAUTH > ERR_MAX
# undef ERR_MAX
@@ -894,7 +886,7 @@ TRANS ??? */
#endif
#ifdef ENOSYS
/*
-TRANS Function not implemented. This indicates that the function called is
+TRANS This indicates that the function called is
TRANS not implemented at all, either in the C library itself or in the
TRANS operating system. When you get this error, you can be sure that this
TRANS particular function will always fail with @code{ENOSYS} unless you
@@ -907,7 +899,7 @@ TRANS install a new version of the C library or the operating system. */
#endif
#if defined (ENOTSUP) && ENOTSUP != EOPNOTSUPP
/*
-TRANS Not supported. A function returns this error when certain parameter
+TRANS A function returns this error when certain parameter
TRANS values are valid, but the functionality they request is not available.
TRANS This can mean that the function does not implement a particular command
TRANS or option value or flag bit at all. For functions that operate on some
@@ -1088,7 +1080,7 @@ TRANS This error code has no purpose. */
#endif
#ifdef ECANCELED
/*
-TRANS Operation canceled; an asynchronous operation was canceled before it
+TRANS An asynchronous operation was canceled before it
TRANS completed. @xref{Asynchronous I/O}. When you call @code{aio_cancel},
TRANS the normal result is for the operations affected to complete with this
TRANS error; @pxref{Cancel AIO Operations}. */
@@ -1098,6 +1090,22 @@ TRANS error; @pxref{Cancel AIO Operations}. */
# define ERR_MAX ECANCELED
# endif
#endif
+#ifdef EOWNERDEAD
+/* */
+ [ERR_REMAP (EOWNERDEAD)] = N_("Owner died"),
+# if EOWNERDEAD > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX EOWNERDEAD
+# endif
+#endif
+#ifdef ENOTRECOVERABLE
+/* */
+ [ERR_REMAP (ENOTRECOVERABLE)] = N_("State not recoverable"),
+# if ENOTRECOVERABLE > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX ENOTRECOVERABLE
+# endif
+#endif
#ifdef ERESTART
/* */
[ERR_REMAP (ERESTART)] = N_("Interrupted system call should be restarted"),
@@ -1442,22 +1450,6 @@ TRANS error; @pxref{Cancel AIO Operations}. */
# define ERR_MAX EKEYREJECTED
# endif
#endif
-#ifdef EOWNERDEAD
-/* */
- [ERR_REMAP (EOWNERDEAD)] = N_("Owner died"),
-# if EOWNERDEAD > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX EOWNERDEAD
-# endif
-#endif
-#ifdef ENOTRECOVERABLE
-/* */
- [ERR_REMAP (ENOTRECOVERABLE)] = N_("State not recoverable"),
-# if ENOTRECOVERABLE > ERR_MAX
-# undef ERR_MAX
-# define ERR_MAX ENOTRECOVERABLE
-# endif
-#endif
#ifdef ERFKILL
/* */
[ERR_REMAP (ERFKILL)] = N_("Operation not possible due to RF-kill"),
diff --git a/sysdeps/gnu/getutmp.c b/sysdeps/gnu/getutmp.c
index 755ce3ede3..39b27321ad 100644
--- a/sysdeps/gnu/getutmp.c
+++ b/sysdeps/gnu/getutmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/gnu/glob-lstat-compat.c b/sysdeps/gnu/glob-lstat-compat.c
new file mode 100644
index 0000000000..7cb52d4fee
--- /dev/null
+++ b/sysdeps/gnu/glob-lstat-compat.c
@@ -0,0 +1,38 @@
+/* Compat glob which does not use gl_lstat for GLOB_ALTDIRFUNC.
+ GNU version
+ Copyright (C) 2017-2018 Free Software 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/stat.h>
+#include <shlib-compat.h>
+
+#define glob64 __no_glob64_decl
+#include <glob.h>
+#undef glob64
+
+#define __glob __glob_lstat_compat
+
+#define GLOB_ATTRIBUTE attribute_compat_text_section
+
+/* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */
+#define GLOB_NO_LSTAT
+
+#include <posix/glob.c>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_27)
+compat_symbol (libc, __glob_lstat_compat, glob, GLIBC_2_0);
+#endif
diff --git a/sysdeps/gnu/glob64-lstat-compat.c b/sysdeps/gnu/glob64-lstat-compat.c
new file mode 100644
index 0000000000..e237407e0b
--- /dev/null
+++ b/sysdeps/gnu/glob64-lstat-compat.c
@@ -0,0 +1,48 @@
+/* Compat glob which does not use gl_lstat for GLOB_ALTDIRFUNC.
+ GNU version
+ Copyright (C) 2017-2018 Free Software 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 <dirent.h>
+#include <glob.h>
+#include <sys/stat.h>
+#include <shlib-compat.h>
+
+#define dirent dirent64
+#define __readdir(dirp) __readdir64 (dirp)
+
+#define glob_t glob64_t
+#define __glob __glob64_lstat_compat
+#define globfree globfree64
+
+#undef stat
+#define stat stat64
+#undef __stat
+#define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
+
+#define COMPILE_GLOB64 1
+
+#define GLOB_ATTRIBUTE attribute_compat_text_section
+
+/* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */
+#define GLOB_NO_LSTAT
+
+#include <posix/glob.c>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_27)
+compat_symbol (libc, __glob64_lstat_compat, glob64, GLIBC_2_1);
+#endif
diff --git a/sysdeps/gnu/glob64.c b/sysdeps/gnu/glob64.c
index d1e4e6f0d5..42b5b225ca 100644
--- a/sysdeps/gnu/glob64.c
+++ b/sysdeps/gnu/glob64.c
@@ -6,8 +6,7 @@
#define __readdir(dirp) __readdir64 (dirp)
#define glob_t glob64_t
-#define glob(pattern, flags, errfunc, pglob) \
- glob64 (pattern, flags, errfunc, pglob)
+#define __glob __glob64
#define globfree(pglob) globfree64 (pglob)
#undef stat
@@ -15,11 +14,10 @@
#undef __stat
#define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
-#define NO_GLOB_PATTERN_P 1
-
#define COMPILE_GLOB64 1
#include <posix/glob.c>
-libc_hidden_def (glob64)
-libc_hidden_def (globfree64)
+libc_hidden_def (__glob64)
+versioned_symbol (libc, __glob64, glob64, GLIBC_2_27);
+libc_hidden_ver (__glob64, glob64)
diff --git a/sysdeps/gnu/globfree64.c b/sysdeps/gnu/globfree64.c
new file mode 100644
index 0000000000..f092d0bf8b
--- /dev/null
+++ b/sysdeps/gnu/globfree64.c
@@ -0,0 +1,10 @@
+#include <dirent.h>
+#include <glob.h>
+#include <sys/stat.h>
+
+#define glob_t glob64_t
+#define globfree(pglob) globfree64 (pglob)
+
+#include <posix/globfree.c>
+
+libc_hidden_def (globfree64)
diff --git a/sysdeps/gnu/ifaddrs.c b/sysdeps/gnu/ifaddrs.c
index b60fa7dd28..945070f9d1 100644
--- a/sysdeps/gnu/ifaddrs.c
+++ b/sysdeps/gnu/ifaddrs.c
@@ -1,5 +1,5 @@
/* getifaddrs -- get names and addresses of all network interfaces
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -151,6 +151,7 @@ __getifaddrs (struct ifaddrs **ifap)
return 0;
}
weak_alias (__getifaddrs, getifaddrs)
+libc_hidden_def (__getifaddrs)
#ifndef getifaddrs
libc_hidden_weak (getifaddrs)
#endif
@@ -161,4 +162,5 @@ __freeifaddrs (struct ifaddrs *ifa)
free (ifa);
}
weak_alias (__freeifaddrs, freeifaddrs)
+libc_hidden_def (__freeifaddrs)
libc_hidden_weak (freeifaddrs)
diff --git a/sysdeps/gnu/ldsodefs.h b/sysdeps/gnu/ldsodefs.h
index 2a1d2f7fcf..1896ed2b89 100644
--- a/sysdeps/gnu/ldsodefs.h
+++ b/sysdeps/gnu/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects. GNU.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/gnu/net/if.h b/sysdeps/gnu/net/if.h
index bbc2094942..89e55dad02 100644
--- a/sysdeps/gnu/net/if.h
+++ b/sysdeps/gnu/net/if.h
@@ -1,5 +1,5 @@
/* net/if.h -- declarations for inquiring about network interfaces
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/gnu/netinet/ip_icmp.h b/sysdeps/gnu/netinet/ip_icmp.h
index 4f7c1b1b60..bb998e0233 100644
--- a/sysdeps/gnu/netinet/ip_icmp.h
+++ b/sysdeps/gnu/netinet/ip_icmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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..44a72e929e 100644
--- a/sysdeps/gnu/netinet/tcp.h
+++ b/sysdeps/gnu/netinet/tcp.h
@@ -69,12 +69,19 @@
connections. */
#define TCP_SAVED_SYN 28 /* Get SYN headers recorded for
connection. */
+#define TCP_REPAIR_WINDOW 29 /* Get/set window parameters. */
+#define TCP_FASTOPEN_CONNECT 30 /* Attempt FastOpen with connect. */
+#define TCP_ULP 31 /* Attach a ULP to a TCP connection. */
+#define TCP_MD5SIG_EXT 32 /* TCP MD5 Signature with extensions. */
+#define TCP_FASTOPEN_KEY 33 /* Set the key for Fast Open (cookie). */
+#define TCP_FASTOPEN_NO_COOKIE 34 /* Enable TFO without a TFO cookie. */
#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 +92,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,65 +216,69 @@ 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;
};
/* For TCP_MD5SIG socket option. */
#define TCP_MD5SIG_MAXKEYLEN 80
+/* tcp_md5sig extension flags for TCP_MD5SIG_EXT. */
+#define TCP_MD5SIG_FLAG_PREFIX 1 /* Address prefix length. */
+
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). */
+ uint8_t tcpm_flags; /* Extension flags. */
+ uint8_t tcpm_prefixlen; /* Address prefix. */
+ uint16_t tcpm_keylen; /* Key length. */
+ uint32_t __tcpm_pad; /* 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 +309,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 bcc3213dc2..eddd248655 100644
--- a/sysdeps/gnu/netinet/udp.h
+++ b/sysdeps/gnu/netinet/udp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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;
};
};
};
@@ -87,6 +86,8 @@ struct udphdr
#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
+#define UDP_ENCAP_GTP0 4 /* GSM TS 09.60 */
+#define UDP_ENCAP_GTP1U 5 /* 3GPP TS 29.060 */
#define SOL_UDP 17 /* sockopt level for UDP */
diff --git a/sysdeps/gnu/siglist.c b/sysdeps/gnu/siglist.c
index bc69e5fcd1..0b2e40a47a 100644
--- a/sysdeps/gnu/siglist.c
+++ b/sysdeps/gnu/siglist.c
@@ -1,5 +1,5 @@
/* Define list of all signal numbers and their names.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/gnu/sys/mtio.h b/sysdeps/gnu/sys/mtio.h
index 3d175ae1e0..182767a39d 100644
--- a/sysdeps/gnu/sys/mtio.h
+++ b/sysdeps/gnu/sys/mtio.h
@@ -1,5 +1,5 @@
/* Structures and definitions for magnetic tape I/O control commands.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/gnu/unwind-resume.c b/sysdeps/gnu/unwind-resume.c
index 5d25e73dd1..9283d925de 100644
--- a/sysdeps/gnu/unwind-resume.c
+++ b/sysdeps/gnu/unwind-resume.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
@@ -35,13 +35,14 @@ __libgcc_s_init (void)
void *resume, *personality;
void *handle;
+ /* See include/dlfcn.h. Use of __libc_dlopen requires RTLD_NOW. */
handle = __libc_dlopen (LIBGCC_S_SO);
if (handle == NULL
|| (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
|| (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL)
__libc_fatal (LIBGCC_S_SO
- " must be installed for pthread_cancel to work\n");
+ " must be installed for unwinding to work\n");
#ifdef PTR_MANGLE
PTR_MANGLE (resume);
diff --git a/sysdeps/gnu/updwtmp.c b/sysdeps/gnu/updwtmp.c
index f6734a6346..e00e8aa33d 100644
--- a/sysdeps/gnu/updwtmp.c
+++ b/sysdeps/gnu/updwtmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
diff --git a/sysdeps/gnu/utmp_file.c b/sysdeps/gnu/utmp_file.c
index d658283adf..592dba3594 100644
--- a/sysdeps/gnu/utmp_file.c
+++ b/sysdeps/gnu/utmp_file.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
diff --git a/sysdeps/gnu/utmpx.h b/sysdeps/gnu/utmpx.h
index 3c45ba37f8..c435d89719 100644
--- a/sysdeps/gnu/utmpx.h
+++ b/sysdeps/gnu/utmpx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/Makefile b/sysdeps/hppa/Makefile
index 08098a8d20..e62838baf0 100644
--- a/sysdeps/hppa/Makefile
+++ b/sysdeps/hppa/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2000-2016 Free Software Foundation, Inc.
+# Copyright (C) 2000-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by David Huggins-Daines (dhd@debian.org)
diff --git a/sysdeps/hppa/__longjmp.c b/sysdeps/hppa/__longjmp.c
index bc14a51c0f..a90678d55f 100644
--- a/sysdeps/hppa/__longjmp.c
+++ b/sysdeps/hppa/__longjmp.c
@@ -1,5 +1,5 @@
/* longjmp for PA-RISC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,15 +24,15 @@
void
__longjmp (__jmp_buf env, int val)
{
+#ifdef CHECK_SP
+ CHECK_SP (env[0].__jmp_buf.__sp);
+#endif
+
/* We must use one of the non-callee saves registers
for env. */
register unsigned long r26 asm ("r26") = (unsigned long)&env[0];
register unsigned long r25 asm ("r25") = (unsigned long)(val == 0 ? 1 : val);
-#ifdef CHECK_SP
- CHECK_SP (env[0].__jmp_buf.__sp);
-#endif
-
asm volatile(
/* Set return value. */
"copy %0, %%r28\n\t"
@@ -79,6 +79,7 @@ __longjmp (__jmp_buf env, int val)
: /* No outputs. */
: "r" (r25), "r" (r26)
: /* No point in clobbers. */ );
+
/* Avoid `volatile function does return' warnings. */
for (;;);
}
diff --git a/sysdeps/hppa/add_n.S b/sysdeps/hppa/add_n.S
index 0c5745774e..10f9368acb 100644
--- a/sysdeps/hppa/add_n.S
+++ b/sysdeps/hppa/add_n.S
@@ -1,7 +1,7 @@
;! HP-PA __mpn_add_n -- Add two limb vectors of the same length > 0 and store
;! sum in a third limb vector.
-;! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+;! Copyright (C) 1992-2018 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
diff --git a/sysdeps/hppa/bits/link.h b/sysdeps/hppa/bits/link.h
index f83e107191..e070db11ab 100644
--- a/sysdeps/hppa/bits/link.h
+++ b/sysdeps/hppa/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/bits/setjmp.h b/sysdeps/hppa/bits/setjmp.h
index 93b2c74c86..f36c4ced57 100644
--- a/sysdeps/hppa/bits/setjmp.h
+++ b/sysdeps/hppa/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/bsd-_setjmp.S b/sysdeps/hppa/bsd-_setjmp.S
index 51321d2bd4..843f8ed933 100644
--- a/sysdeps/hppa/bsd-_setjmp.S
+++ b/sysdeps/hppa/bsd-_setjmp.S
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. HPPA version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/bsd-setjmp.S b/sysdeps/hppa/bsd-setjmp.S
index 49b2ff7bb7..75681ad82d 100644
--- a/sysdeps/hppa/bsd-setjmp.S
+++ b/sysdeps/hppa/bsd-setjmp.S
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. HPPA version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/crti.S b/sysdeps/hppa/crti.S
index 6e2bc7d2ba..28550e5758 100644
--- a/sysdeps/hppa/crti.S
+++ b/sysdeps/hppa/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for HPPA
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -49,28 +49,111 @@
# define PREINIT_FUNCTION_WEAK 1
#endif
+#if PREINIT_FUNCTION_WEAK
+ weak_extern (PREINIT_FUNCTION)
+#else
+ .hidden PREINIT_FUNCTION
+#endif
+
+
+/* If we have working .init_array support, we want to keep the .init
+ section empty (apart from the mandatory prologue/epilogue. This
+ ensures that the default unwind conventions (return-pointer in b0,
+ frame state in ar.pfs, etc.) will do the Right Thing. To ensure
+ an empty .init section, we register gmon_initializer() via the
+ .init_array.
+
+ --davidm 02/10/29 */
+
+#if PREINIT_FUNCTION_WEAK
+/* This blob of assembly code is one simple C function:
+
+static void
+__attribute__ ((used))
+gmon_initializer (void)
+{
+ extern void weak_function __gmon_start__ (void);
+
+ if (__gmon_start__)
+ (*__gmon_start__)();
+}
+
+In a final executable, PLABEL32 relocations for function pointers are
+resolved at link time. Typically, binutils/ld resolves __gmon_start__
+using an external shared library. __gmon_start__ is always called if
+it is found at link time. If __gmon_start__ is not found at runtime
+due to a library update, then the function pointer will point at a null
+function descriptor and calling it will cause a segmentation fault.
+So, we call __canonicalize_funcptr_for_compare to obtain the canonicalized
+address of __gmon_start__ and skip calling __gmon_start__ if it is zero.
+
+ */
+ .type __canonicalize_funcptr_for_compare,@function
+ .type $$dyncall,@function
+
+ .section .data.rel.ro,"aw",@progbits
+ .align 4
+.LC0:
+ .type __gmon_start__,@function
+ .word P%__gmon_start__
+
+ .text
+ .align 4
+ .type gmon_initializer,@function
+gmon_initializer:
+ .PROC
+ .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=4
+ .ENTRY
+ stw %r2,-20(%r30)
+ stwm %r4,64(%r30)
+ stw %r3,-60(%r30)
+ addil LT'.LC0,%r19
+ ldw RT'.LC0(%r1),%r28
+ ldw 0(%r28),%r3
+ comib,= 0,%r3,1f
+ copy %r19,%r4
+ stw %r19,-32(%r30)
+ bl __canonicalize_funcptr_for_compare,%r2
+ copy %r3,%r26
+ comib,= 0,%r28,1f
+ copy %r4,%r19
+ copy %r3,%r22
+ .CALL ARGW0=GR
+ bl $$dyncall,%r31
+ copy %r31,%r2
+1:
+ ldw -84(%r30),%r2
+ ldw -60(%r30),%r3
+ bv %r0(%r2)
+ ldwm -64(%r30),%r4
+ .EXIT
+ .PROCEND
+ .size gmon_initializer, .-gmon_initializer
+
+# undef PREINIT_FUNCTION
+# define PREINIT_FUNCTION gmon_initializer
+#endif
+
+ .section .init_array, "aw"
+ .word P% PREINIT_FUNCTION
+
+
/* _init prologue. */
.section .init, "ax", %progbits
.align 4
.globl _init
+ .hidden _init
.type _init,@function
_init:
stw %rp,-20(%sp)
stwm %r4,64(%sp)
stw %r19,-32(%sp)
-#if PREINIT_FUNCTION_WEAK
- bl PREINIT_FUNCTION,%rp
- copy %r19,%r4 /* delay slot */
-#else
- bl PREINIT_FUNCTION,%rp
- copy %r19,%r4 /* delay slot */
-#endif
- copy %r4,%r19
/* _fini prologue. */
.section .fini,"ax",%progbits
.align 4
.globl _fini
+ .hidden _fini
.type _fini,@function
_fini:
stw %rp,-20(%sp)
diff --git a/sysdeps/hppa/crtn.S b/sysdeps/hppa/crtn.S
index acd41d3ec8..69562d00b4 100644
--- a/sysdeps/hppa/crtn.S
+++ b/sysdeps/hppa/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for HPPA
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,27 +38,6 @@
/* crtn.S puts function epilogues in the .init and .fini sections
corresponding to the prologues in crti.S. */
-/* Note that we cannot have a weak undefined __gmon_start__, because
- that would require this to be PIC, and the linker is currently not
- able to generate a proper procedure descriptor for _init. Sad but
- true. Anyway, HPPA is one of those horrible architectures where
- making the comparison and indirect call is quite expensive (see the
- comment in sysdeps/generic/initfini.c). */
- .text
- .align 4
- .weak __gmon_start__
- .type __gmon_start__,@function
-__gmon_start__:
- .proc
- .callinfo
- .entry
- bv,n %r0(%r2)
- .exit
- .procend
-
-/* Here is the tail end of _init. We put __gmon_start before this so
- that the assembler creates the .PARISC.unwind section for us, ie.
- with the right attributes. */
.section .init, "ax", @progbits
ldw -84(%sp),%rp
copy %r4,%r19
diff --git a/sysdeps/hppa/dl-fptr.c b/sysdeps/hppa/dl-fptr.c
index 083242b7e3..17b93538c3 100644
--- a/sysdeps/hppa/dl-fptr.c
+++ b/sysdeps/hppa/dl-fptr.c
@@ -1,5 +1,5 @@
/* Manage function descriptors. Generic version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,6 +28,7 @@
#include <dl-fptr.h>
#include <dl-unmap-segments.h>
#include <atomic.h>
+#include <libc-pointer-arith.h>
#ifndef ELF_MACHINE_BOOT_FPTR_TABLE_LEN
/* ELF_MACHINE_BOOT_FPTR_TABLE_LEN should be greater than the number of
@@ -181,24 +182,29 @@ make_fdesc (ElfW(Addr) ip, ElfW(Addr) gp)
static inline ElfW(Addr) * __attribute__ ((always_inline))
make_fptr_table (struct link_map *map)
{
- const ElfW(Sym) *symtab
- = (const void *) D_PTR (map, l_info[DT_SYMTAB]);
+ const ElfW(Sym) *symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]);
const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
ElfW(Addr) *fptr_table;
size_t size;
size_t len;
+ const ElfW(Sym) *symtabend;
- /* XXX Apparently the only way to find out the size of the dynamic
- symbol section is to assume that the string table follows right
- afterwards... */
- len = ((strtab - (char *) symtab)
+ /* Determine the end of the dynamic symbol table using the hash. */
+ if (map->l_info[DT_HASH] != NULL)
+ symtabend = (symtab + ((Elf_Symndx *) D_PTR (map, l_info[DT_HASH]))[1]);
+ else
+ /* There is no direct way to determine the number of symbols in the
+ dynamic symbol table and no hash table is present. The ELF
+ binary is ill-formed but what shall we do? Use the beginning of
+ the string table which generally follows the symbol table. */
+ symtabend = (const ElfW(Sym) *) strtab;
+
+ len = (((char *) symtabend - (char *) symtab)
/ map->l_info[DT_SYMENT]->d_un.d_val);
- size = ((len * sizeof (fptr_table[0]) + GLRO(dl_pagesize) - 1)
- & -GLRO(dl_pagesize));
- /* XXX We don't support here in the moment systems without MAP_ANON.
- There probably are none for IA-64. In case this is proven wrong
- we will have to open /dev/null here and use the file descriptor
- instead of the hard-coded -1. */
+ size = ALIGN_UP (len * sizeof (fptr_table[0]), GLRO(dl_pagesize));
+
+ /* We don't support systems without MAP_ANON. We avoid using malloc
+ because this might get called before malloc is setup. */
fptr_table = __mmap (NULL, size,
PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE,
-1, 0);
@@ -323,30 +329,52 @@ elf_machine_resolve (void)
Elf32_Addr addr;
asm ("b,l 1f,%0\n"
-" depi 0,31,2,%0\n"
-"1: addil L'_dl_runtime_resolve - ($PIC_pcrel$0 - 8),%0\n"
-" ldo R'_dl_runtime_resolve - ($PIC_pcrel$0 - 12)(%%r1),%0\n"
+" addil L'_dl_runtime_resolve - ($PIC_pcrel$0 - 1),%0\n"
+"1: ldo R'_dl_runtime_resolve - ($PIC_pcrel$0 - 5)(%%r1),%0\n"
: "=r" (addr) : : "r1");
return addr;
}
+static inline int
+_dl_read_access_allowed (unsigned int *addr)
+{
+ int result;
+
+ asm ("proberi (%1),3,%0" : "=r" (result) : "r" (addr) : );
+
+ return result;
+}
+
ElfW(Addr)
_dl_lookup_address (const void *address)
{
ElfW(Addr) addr = (ElfW(Addr)) address;
unsigned int *desc, *gptr;
- /* Check for special cases. */
- if ((int) addr == -1
- || (unsigned int) addr < 4096
- || !((unsigned int) addr & 2))
+ /* Return ADDR if the least-significant two bits of ADDR are not consistent
+ with ADDR being a linker defined function pointer. The normal value for
+ a code address in a backtrace is 3. */
+ if (((unsigned int) addr & 3) != 2)
+ return addr;
+
+ /* Handle special case where ADDR points to page 0. */
+ if ((unsigned int) addr < 4096)
return addr;
/* Clear least-significant two bits from descriptor address. */
desc = (unsigned int *) ((unsigned int) addr & ~3);
+ if (!_dl_read_access_allowed (desc))
+ return addr;
- /* Check if descriptor requires resolution. The following trampoline is
+ /* Load first word of candidate descriptor. It should be a pointer
+ with word alignment and point to memory that can be read. */
+ gptr = (unsigned int *) desc[0];
+ if (((unsigned int) gptr & 3) != 0
+ || !_dl_read_access_allowed (gptr))
+ return addr;
+
+ /* See if descriptor requires resolution. The following trampoline is
used in each global offset table for function resolution:
ldw 0(r20),r22
@@ -358,7 +386,6 @@ _dl_lookup_address (const void *address)
.word "_dl_runtime_resolve ltp"
got: .word _DYNAMIC
.word "struct link map address" */
- gptr = (unsigned int *) desc[0];
if (gptr[0] == 0xea9f1fdd /* b,l .-12,r20 */
&& gptr[1] == 0xd6801c1e /* depwi 0,31,2,r20 */
&& (ElfW(Addr)) gptr[2] == elf_machine_resolve ())
diff --git a/sysdeps/hppa/dl-fptr.h b/sysdeps/hppa/dl-fptr.h
index 8ecfedacfc..81ae07a480 100644
--- a/sysdeps/hppa/dl-fptr.h
+++ b/sysdeps/hppa/dl-fptr.h
@@ -1,5 +1,5 @@
/* Function descriptors. HPPA version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,9 +31,8 @@ extern void _dl_fptr_init (void);
#define ELF_MACHINE_LOAD_ADDRESS(var, symbol) \
asm ( \
" b,l 1f,%0\n" \
-" depi 0,31,2,%0\n" \
-"1: addil L'" #symbol " - ($PIC_pcrel$0 - 8),%0\n" \
-" ldo R'" #symbol " - ($PIC_pcrel$0 - 12)(%%r1),%0\n" \
+" addil L'" #symbol " - ($PIC_pcrel$0 - 1),%0\n" \
+"1: ldo R'" #symbol " - ($PIC_pcrel$0 - 5)(%%r1),%0\n" \
: "=&r" (var) : : "r1");
#endif /* !dl_hppa_fptr_h */
diff --git a/sysdeps/hppa/dl-irel.h b/sysdeps/hppa/dl-irel.h
index b01a99d799..d144b658a2 100644
--- a/sysdeps/hppa/dl-irel.h
+++ b/sysdeps/hppa/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
HP-PARISC version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/dl-lookupcfg.h b/sysdeps/hppa/dl-lookupcfg.h
index 3f1d14aa2f..38db345936 100644
--- a/sysdeps/hppa/dl-lookupcfg.h
+++ b/sysdeps/hppa/dl-lookupcfg.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -73,7 +73,8 @@ void attribute_hidden _dl_unmap (struct link_map *map);
/* Construct a fixup value from the address and linkmap */
#define DL_FIXUP_MAKE_VALUE(map, addr) \
- ((struct fdesc) { (addr), (map)->l_info[DT_PLTGOT]->d_un.d_ptr })
+ (map) ? ((struct fdesc) { (addr), (map)->l_info[DT_PLTGOT]->d_un.d_ptr }) \
+ : ((struct fdesc) { 0, 0 })
/* Extract the code address from a fixup value */
#define DL_FIXUP_VALUE_CODE_ADDR(value) ((value).ip)
diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
index 9404211819..5f4e0d3823 100644
--- a/sysdeps/hppa/dl-machine.h
+++ b/sysdeps/hppa/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. PA-RISC version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
Contributed by David Huggins-Daines <dhd@debian.org>
This file is part of the GNU C Library.
@@ -62,7 +62,7 @@ __hppa_init_bootstrap_fdesc_table (struct link_map *map)
}
#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
- __hppa_init_bootstrap_fdesc_table (&bootstrap_map); \
+ __hppa_init_bootstrap_fdesc_table (BOOTSTRAP_MAP); \
_dl_fptr_init();
/* Return nonzero iff ELF header is compatible with the running host. */
@@ -81,10 +81,9 @@ elf_machine_dynamic (void)
{
Elf32_Addr dynamic;
- asm ("b,l 1f,%0\n"
-" depi 0,31,2,%0\n"
-"1: addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 8),%0\n"
-" ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 12)(%%r1),%0\n"
+ asm ("bl 1f,%0\n"
+" addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 1),%0\n"
+"1: ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 5)(%%r1),%0\n"
: "=r" (dynamic) : : "r1");
return dynamic;
@@ -100,10 +99,9 @@ elf_machine_load_address (void)
Elf32_Addr dynamic;
asm (
-" b,l 1f,%0\n"
-" depi 0,31,2,%0\n"
-"1: addil L'_DYNAMIC - ($PIC_pcrel$0 - 8),%0\n"
-" ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%%r1),%0\n"
+" bl 1f,%0\n"
+" addil L'_DYNAMIC - ($PIC_pcrel$0 - 1),%0\n"
+"1: ldo R'_DYNAMIC - ($PIC_pcrel$0 - 5)(%%r1),%0\n"
: "=r" (dynamic) : : "r1");
return dynamic - elf_machine_dynamic ();
@@ -112,6 +110,7 @@ elf_machine_load_address (void)
/* Fixup a PLT entry to bounce directly to the function at VALUE. */
static inline struct fdesc __attribute__ ((always_inline))
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, struct fdesc value)
{
@@ -302,6 +301,10 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
#define ARCH_LA_PLTENTER hppa_gnu_pltenter
#define ARCH_LA_PLTEXIT hppa_gnu_pltexit
+/* Adjust DL_STACK_END to get value we want in __libc_stack_end. */
+#define DL_STACK_END(cookie) \
+ ((void *) (((long) (cookie)) + 0x160))
+
/* Initial entry point code for the dynamic linker.
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
@@ -334,14 +337,13 @@ asm ( \
just like a branch reloc. This sequence gets us the \
runtime address of _DYNAMIC. */ \
" bl 0f,%r19\n" \
-" depi 0,31,2,%r19\n" /* clear priviledge bits */ \
-"0: addil L'_DYNAMIC - ($PIC_pcrel$0 - 8),%r19\n" \
-" ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%r1),%r26\n" \
+" addil L'_DYNAMIC - ($PIC_pcrel$0 - 1),%r19\n" \
+"0: ldo R'_DYNAMIC - ($PIC_pcrel$0 - 5)(%r1),%r26\n" \
\
/* The link time address is stored in the first entry of the \
GOT. */ \
-" addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 16),%r19\n" \
-" ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 20)(%r1),%r20\n" \
+" addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 9),%r19\n" \
+" ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 13)(%r1),%r20\n" \
\
" sub %r26,%r20,%r20\n" /* Calculate load offset */ \
\
@@ -401,11 +403,6 @@ asm ( \
/* Save the entry point in %r3. */ \
" copy %ret0,%r3\n" \
\
- /* Remember the lowest stack address. */ \
-" addil LT'__libc_stack_end,%r19\n" \
-" ldw RT'__libc_stack_end(%r1),%r20\n" \
-" stw %sp,0(%r20)\n" \
- \
/* See if we were called as a command with the executable file \
name as an extra leading argument. */ \
" addil LT'_dl_skip_args,%r19\n" \
@@ -565,7 +562,7 @@ elf_machine_rela (struct link_map *map,
if (sym_map)
{
- value = sym ? sym_map->l_addr + sym->st_value : 0;
+ value = SYMBOL_ADDRESS (sym_map, sym, true);
value += reloc->r_addend;
}
else
@@ -589,8 +586,8 @@ elf_machine_rela (struct link_map *map,
case R_PARISC_DIR21L:
{
unsigned int insn = *(unsigned int *)reloc_addr;
- value = sym_map->l_addr + sym->st_value
- + ((reloc->r_addend + 0x1000) & -0x2000);
+ value = (SYMBOL_ADDRESS (sym_map, sym, true)
+ + ((reloc->r_addend + 0x1000) & -0x2000));
value = value >> 11;
insn = (insn &~ 0x1fffff) | reassemble_21 (value);
*(unsigned int *)reloc_addr = insn;
@@ -600,8 +597,8 @@ elf_machine_rela (struct link_map *map,
case R_PARISC_DIR14R:
{
unsigned int insn = *(unsigned int *)reloc_addr;
- value = ((sym_map->l_addr + sym->st_value) & 0x7ff)
- + (((reloc->r_addend & 0x1fff) ^ 0x1000) - 0x1000);
+ value = ((SYMBOL_ADDRESS (sym_map, sym, true) & 0x7ff)
+ + (((reloc->r_addend & 0x1fff) ^ 0x1000) - 0x1000));
insn = (insn &~ 0x3fff) | reassemble_14 (value);
*(unsigned int *)reloc_addr = insn;
}
@@ -653,13 +650,13 @@ elf_machine_rela (struct link_map *map,
case R_PARISC_IPLT:
if (__builtin_expect (sym_map != NULL, 1))
{
- elf_machine_fixup_plt (NULL, sym_map, reloc, reloc_addr,
+ elf_machine_fixup_plt (NULL, sym_map, NULL, NULL, reloc, reloc_addr,
DL_FIXUP_MAKE_VALUE(sym_map, value));
}
else
{
/* If we get here, it's a (weak) undefined sym. */
- elf_machine_fixup_plt (NULL, map, reloc, reloc_addr,
+ elf_machine_fixup_plt (NULL, map, NULL, NULL, reloc, reloc_addr,
DL_FIXUP_MAKE_VALUE(map, value));
}
return;
@@ -693,7 +690,7 @@ elf_machine_rela (struct link_map *map,
/* During relocation all TLS symbols are defined and used.
Therefore the offset is already correct. */
if (sym != NULL)
- *reloc_addr = sym->st_value;
+ *reloc_addr = sym->st_value + reloc->r_addend;
return;
case R_PARISC_TLS_TPREL32:
diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c
index e03a9489ad..4615dfc5b8 100644
--- a/sysdeps/hppa/dl-symaddr.c
+++ b/sysdeps/hppa/dl-symaddr.c
@@ -1,5 +1,5 @@
/* Get the symbol address. HPPA version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@ void *
_dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref)
{
/* Find the "ip" from the "map" and symbol "ref" */
- Elf32_Addr value = (map ? map->l_addr : 0) + ref->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (map, ref, false);
/* On hppa, we have to return the pointer to function descriptor.
This involves an "| 2" to inform $$dyncall that this is a plabel32 */
diff --git a/sysdeps/hppa/dl-tls.h b/sysdeps/hppa/dl-tls.h
index 58b9280848..9a2ed59701 100644
--- a/sysdeps/hppa/dl-tls.h
+++ b/sysdeps/hppa/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. hppa version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,3 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/hppa/dl-trampoline.S b/sysdeps/hppa/dl-trampoline.S
index 8123dbea83..7ee4331cc2 100644
--- a/sysdeps/hppa/dl-trampoline.S
+++ b/sysdeps/hppa/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. hppa version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -82,6 +82,21 @@ _dl_runtime_resolve:
bl _dl_fixup,%rp
copy %r21,%r19 /* set fixup func ltp */
+ /* While the linker will set a function pointer to NULL when it
+ encounters an undefined weak function, we need to dynamically
+ detect removed weak functions. The issue arises because a weak
+ __gmon_start__ function was added to shared executables to work
+ around issues in _init that are now resolved. The presence of
+ __gmon_start__ in every shared library breaks the linker
+ `--as-needed' option. This __gmon_start__ function does nothing
+ but removal is tricky. Depending on the binding, removal can
+ cause an application using it to fault. The call to _dl_fixup
+ returns NULL when a function isn't resolved. In order to help
+ with __gmon_start__ removal, we return directly to the caller
+ when _dl_fixup returns NULL. This check could be removed when
+ BZ 19170 is fixed. */
+ comib,= 0,%r28,1f
+
/* Load up the returned func descriptor */
copy %r28, %r22
copy %r29, %r19
@@ -107,6 +122,13 @@ _dl_runtime_resolve:
/* Jump to new function, but return to previous function */
bv %r0(%r22)
ldw -20(%sp),%rp
+
+1:
+ /* Return to previous function */
+ ldw -148(%sp),%rp
+ bv %r0(%rp)
+ ldo -128(%sp),%sp
+
.EXIT
.PROCEND
cfi_endproc
diff --git a/sysdeps/hppa/fpu/bits/fenv.h b/sysdeps/hppa/fpu/bits/fenv.h
index cae9daeb04..fe7474de1b 100644
--- a/sysdeps/hppa/fpu/bits/fenv.h
+++ b/sysdeps/hppa/fpu/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>
@@ -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/bits/mathdef.h b/sysdeps/hppa/fpu/bits/mathdef.h
deleted file mode 100644
index 99c9cffd25..0000000000
--- a/sysdeps/hppa/fpu/bits/mathdef.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* GCC does not promote `float' values to `double'. */
-typedef float float_t; /* `float' expressions are evaluated as
- `float'. */
-typedef double double_t; /* `double' expressions are evaluated as
- `double'. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647)
-# define FP_ILOGBNAN (2147483647)
-
-#endif /* ISO C99 */
-
-#ifndef __NO_LONG_DOUBLE_MATH
-/* On hppa `long double' and `double' are 64-bits. So, libm is built
- with NO_LONG_DOUBLE defined. The following define ensures the library
- and headers are consistent. This disables the declaration of all the
- `long double' function variants. */
-# define __NO_LONG_DOUBLE_MATH 1
-#endif
diff --git a/sysdeps/hppa/fpu/fclrexcpt.c b/sysdeps/hppa/fpu/fclrexcpt.c
index 97da0b5596..49c1778712 100644
--- a/sysdeps/hppa/fpu/fclrexcpt.c
+++ b/sysdeps/hppa/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/fedisblxcpt.c b/sysdeps/hppa/fpu/fedisblxcpt.c
index 7b062604aa..bd03b6b644 100644
--- a/sysdeps/hppa/fpu/fedisblxcpt.c
+++ b/sysdeps/hppa/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/feenablxcpt.c b/sysdeps/hppa/fpu/feenablxcpt.c
index dffbf9440c..62fec44dde 100644
--- a/sysdeps/hppa/fpu/feenablxcpt.c
+++ b/sysdeps/hppa/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/fegetenv.c b/sysdeps/hppa/fpu/fegetenv.c
index ec6a963bf2..06c7374a3f 100644
--- a/sysdeps/hppa/fpu/fegetenv.c
+++ b/sysdeps/hppa/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/fegetexcept.c b/sysdeps/hppa/fpu/fegetexcept.c
index e4702502bf..6f58b7d31c 100644
--- a/sysdeps/hppa/fpu/fegetexcept.c
+++ b/sysdeps/hppa/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/fegetmode.c b/sysdeps/hppa/fpu/fegetmode.c
new file mode 100644
index 0000000000..7e2e06b67b
--- /dev/null
+++ b/sysdeps/hppa/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. HPPA version.
+ Copyright (C) 2016-2018 Free Software 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/fegetround.c b/sysdeps/hppa/fpu/fegetround.c
index 80fabe7d6c..bb82a2e922 100644
--- a/sysdeps/hppa/fpu/fegetround.c
+++ b/sysdeps/hppa/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/feholdexcpt.c b/sysdeps/hppa/fpu/feholdexcpt.c
index 98b4b15036..7ae1f3cab9 100644
--- a/sysdeps/hppa/fpu/feholdexcpt.c
+++ b/sysdeps/hppa/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/fesetenv.c b/sysdeps/hppa/fpu/fesetenv.c
index 8916e32b85..2cf05f85f5 100644
--- a/sysdeps/hppa/fpu/fesetenv.c
+++ b/sysdeps/hppa/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
Based on the m68k version by
diff --git a/sysdeps/hppa/fpu/fesetexcept.c b/sysdeps/hppa/fpu/fesetexcept.c
new file mode 100644
index 0000000000..eeb0a36223
--- /dev/null
+++ b/sysdeps/hppa/fpu/fesetexcept.c
@@ -0,0 +1,35 @@
+/* Set given exception flags. HPPA version.
+ Copyright (C) 2016-2018 Free Software 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..cf03bf72d4
--- /dev/null
+++ b/sysdeps/hppa/fpu/fesetmode.c
@@ -0,0 +1,36 @@
+/* Install given floating-point control modes. HPPA version.
+ Copyright (C) 2016-2018 Free Software 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/fesetround.c b/sysdeps/hppa/fpu/fesetround.c
index 6a444aa077..36ca40801d 100644
--- a/sysdeps/hppa/fpu/fesetround.c
+++ b/sysdeps/hppa/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/feupdateenv.c b/sysdeps/hppa/fpu/feupdateenv.c
index 17a2dcd957..be88c0205d 100644
--- a/sysdeps/hppa/fpu/feupdateenv.c
+++ b/sysdeps/hppa/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/fgetexcptflg.c b/sysdeps/hppa/fpu/fgetexcptflg.c
index c8f7490dcd..2c9aa4e774 100644
--- a/sysdeps/hppa/fpu/fgetexcptflg.c
+++ b/sysdeps/hppa/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/fpu_control.h b/sysdeps/hppa/fpu/fpu_control.h
index 5ea8cbc7de..afe355b825 100644
--- a/sysdeps/hppa/fpu/fpu_control.h
+++ b/sysdeps/hppa/fpu/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word definitions. HP-PARISC version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/fpu/fraiseexcpt.c b/sysdeps/hppa/fpu/fraiseexcpt.c
index b6cc6a1017..5fffad4f27 100644
--- a/sysdeps/hppa/fpu/fraiseexcpt.c
+++ b/sysdeps/hppa/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>
diff --git a/sysdeps/hppa/fpu/fsetexcptflg.c b/sysdeps/hppa/fpu/fsetexcptflg.c
index 58350d1a89..0fdd56a40c 100644
--- a/sysdeps/hppa/fpu/fsetexcptflg.c
+++ b/sysdeps/hppa/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/ftestexcept.c b/sysdeps/hppa/fpu/ftestexcept.c
index ae5b66b50a..fd6548e58d 100644
--- a/sysdeps/hppa/fpu/ftestexcept.c
+++ b/sysdeps/hppa/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
diff --git a/sysdeps/hppa/fpu/libm-test-ulps b/sysdeps/hppa/fpu/libm-test-ulps
index 3f1f2fa414..d0c4dea001 100644
--- a/sysdeps/hppa/fpu/libm-test-ulps
+++ b/sysdeps/hppa/fpu/libm-test-ulps
@@ -1,6 +1,10 @@
# Begin of automatic generation
# Maximal error of functions:
+Function: "acos":
+float: 1
+ifloat: 1
+
Function: "acos_downward":
double: 1
float: 1
@@ -15,30 +19,36 @@ ifloat: 1
Function: "acos_upward":
double: 1
-idouble: 1
-
-Function: "acosh":
-double: 1
float: 1
idouble: 1
ifloat: 1
+Function: "acosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
Function: "acosh_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Function: "acosh_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Function: "acosh_upward":
-double: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asin":
float: 1
-idouble: 1
ifloat: 1
Function: "asin_downward":
@@ -66,10 +76,10 @@ idouble: 1
ifloat: 1
Function: "asinh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: "asinh_towardzero":
double: 2
@@ -78,9 +88,13 @@ idouble: 2
ifloat: 2
Function: "asinh_upward":
-double: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "atan":
float: 1
-idouble: 2
ifloat: 1
Function: "atan2":
@@ -107,9 +121,9 @@ ifloat: 2
Function: "atan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Function: "atan_towardzero":
double: 1
@@ -119,33 +133,49 @@ ifloat: 1
Function: "atan_upward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Function: "atanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "atanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "atanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "cabs":
double: 1
-float: 1
idouble: 1
-ifloat: 1
-Function: "atanh_downward":
+Function: "cabs_downward":
double: 1
-float: 1
idouble: 1
-ifloat: 1
-Function: "atanh_towardzero":
+Function: "cabs_towardzero":
double: 1
-float: 1
idouble: 1
-ifloat: 1
-Function: "atanh_upward":
+Function: "cabs_upward":
double: 1
-float: 1
idouble: 1
-ifloat: 1
Function: Real part of "cacos":
double: 1
@@ -154,15 +184,15 @@ idouble: 1
ifloat: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Real part of "cacos_downward":
-double: 1
+double: 3
float: 2
-idouble: 1
+idouble: 3
ifloat: 2
Function: Imaginary part of "cacos_downward":
@@ -172,9 +202,9 @@ idouble: 5
ifloat: 3
Function: Real part of "cacos_towardzero":
-double: 1
+double: 3
float: 2
-idouble: 1
+idouble: 3
ifloat: 2
Function: Imaginary part of "cacos_towardzero":
@@ -190,15 +220,15 @@ idouble: 2
ifloat: 2
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Imaginary part of "cacosh":
@@ -214,10 +244,10 @@ idouble: 5
ifloat: 3
Function: Imaginary part of "cacosh_downward":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: Real part of "cacosh_towardzero":
double: 5
@@ -226,9 +256,9 @@ idouble: 5
ifloat: 3
Function: Imaginary part of "cacosh_towardzero":
-double: 1
+double: 3
float: 2
-idouble: 1
+idouble: 3
ifloat: 2
Function: Real part of "cacosh_upward":
@@ -238,11 +268,15 @@ idouble: 4
ifloat: 4
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
+Function: "carg":
+float: 1
+ifloat: 1
+
Function: "carg_downward":
double: 1
float: 2
@@ -250,8 +284,10 @@ idouble: 1
ifloat: 2
Function: "carg_towardzero":
-float: 1
-ifloat: 1
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
Function: "carg_upward":
double: 1
@@ -268,16 +304,16 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "casin_downward":
double: 5
@@ -298,16 +334,16 @@ idouble: 5
ifloat: 3
Function: Real part of "casin_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
Function: Real part of "casinh":
double: 5
@@ -333,9 +369,9 @@ ifloat: 3
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
Function: Real part of "casinh_towardzero":
double: 5
@@ -350,19 +386,21 @@ idouble: 3
ifloat: 1
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
Function: Imaginary part of "casinh_upward":
-double: 1
+double: 3
float: 2
-idouble: 1
+idouble: 3
ifloat: 2
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Imaginary part of "catan":
@@ -375,9 +413,9 @@ ldouble: 1
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "catan_downward":
double: 2
@@ -387,15 +425,15 @@ ifloat: 2
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Real part of "catan_upward":
double: 1
@@ -418,7 +456,9 @@ ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Real part of "catanh_downward":
@@ -435,9 +475,9 @@ ifloat: 2
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "catanh_towardzero":
double: 1
@@ -447,9 +487,9 @@ ifloat: 2
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
idouble: 4
-ifloat: 3
+ifloat: 4
Function: Imaginary part of "catanh_upward":
double: 1
@@ -458,29 +498,31 @@ idouble: 1
ifloat: 1
Function: "cbrt":
-double: 1
+double: 3
float: 1
-idouble: 1
+idouble: 3
ifloat: 1
ildouble: 1
ldouble: 1
Function: "cbrt_downward":
-double: 2
+double: 4
float: 1
-idouble: 2
+idouble: 4
ifloat: 1
Function: "cbrt_towardzero":
-double: 2
-idouble: 2
-
-Function: "cbrt_upward":
double: 3
float: 1
idouble: 3
ifloat: 1
+Function: "cbrt_upward":
+double: 5
+float: 1
+idouble: 5
+ifloat: 1
+
Function: Real part of "ccos":
double: 1
float: 1
@@ -593,71 +635,107 @@ float: 2
idouble: 1
ifloat: 2
-Function: Real part of "clog":
+Function: Real part of "cexp_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_downward":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Real part of "cexp_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Real part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "clog":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: Imaginary part of "clog":
float: 1
ifloat: 1
Function: Real part of "clog10":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: Imaginary part of "clog10":
double: 2
float: 2
idouble: 2
ifloat: 2
-
-Function: Imaginary part of "clog10":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
ildouble: 1
ldouble: 1
Function: Real part of "clog10_downward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
Function: Imaginary part of "clog10_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
Function: Real part of "clog10_towardzero":
-double: 3
-float: 2
-idouble: 3
-ifloat: 2
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
Function: Imaginary part of "clog10_towardzero":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
Function: Real part of "clog10_upward":
-double: 4
-float: 3
-idouble: 4
-ifloat: 3
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
Function: Imaginary part of "clog10_upward":
double: 2
-float: 2
+float: 4
idouble: 2
-ifloat: 2
+ifloat: 4
Function: Real part of "clog_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
Function: Imaginary part of "clog_downward":
double: 1
@@ -666,22 +744,22 @@ idouble: 1
ifloat: 2
Function: Real part of "clog_towardzero":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
Function: Imaginary part of "clog_towardzero":
double: 1
-float: 2
+float: 3
idouble: 1
-ifloat: 2
+ifloat: 3
Function: Real part of "clog_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
Function: Imaginary part of "clog_upward":
double: 2
@@ -703,10 +781,6 @@ float: 2
idouble: 1
ifloat: 2
-Function: "cos_tonearest":
-float: 1
-ifloat: 1
-
Function: "cos_towardzero":
double: 1
float: 1
@@ -731,12 +805,6 @@ float: 1
idouble: 1
ifloat: 1
-Function: "cosh_tonearest":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
Function: "cosh_towardzero":
double: 1
float: 1
@@ -751,9 +819,9 @@ ifloat: 2
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
ildouble: 2
ldouble: 2
@@ -832,9 +900,9 @@ idouble: 2
ifloat: 2
Function: Real part of "csin_upward":
-double: 1
+double: 2
float: 3
-idouble: 1
+idouble: 2
ifloat: 3
Function: Imaginary part of "csin_upward":
@@ -856,10 +924,10 @@ ildouble: 1
ldouble: 1
Function: Real part of "csinh_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Function: Imaginary part of "csinh_downward":
double: 2
@@ -892,52 +960,52 @@ idouble: 2
ifloat: 3
Function: Real part of "csqrt":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Imaginary part of "csqrt":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Real part of "csqrt_downward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
-
-Function: Imaginary part of "csqrt_downward":
double: 2
float: 2
idouble: 2
ifloat: 2
-Function: Real part of "csqrt_towardzero":
+Function: Imaginary part of "csqrt":
double: 2
float: 2
idouble: 2
ifloat: 2
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
Function: Imaginary part of "csqrt_towardzero":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
Function: Real part of "csqrt_upward":
-double: 3
-float: 2
-idouble: 3
-ifloat: 2
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
Function: Imaginary part of "csqrt_upward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: Real part of "ctan":
double: 1
@@ -947,9 +1015,9 @@ ifloat: 1
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 1
ldouble: 1
@@ -961,21 +1029,9 @@ ifloat: 5
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: Real part of "ctan_tonearest":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Imaginary part of "ctan_tonearest":
-double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Real part of "ctan_towardzero":
double: 5
@@ -991,9 +1047,9 @@ ifloat: 2
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
Function: Imaginary part of "ctan_upward":
double: 2
@@ -1003,9 +1059,9 @@ ifloat: 3
Function: Real part of "ctanh":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 1
ldouble: 1
@@ -1017,9 +1073,9 @@ ifloat: 2
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
idouble: 4
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "ctanh_downward":
double: 6
@@ -1027,18 +1083,6 @@ float: 5
idouble: 6
ifloat: 5
-Function: Real part of "ctanh_tonearest":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: Imaginary part of "ctanh_tonearest":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
Function: Real part of "ctanh_towardzero":
double: 2
float: 2
@@ -1065,47 +1109,59 @@ ifloat: 3
Function: "erf":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "erf_downward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "erf_towardzero":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "erf_upward":
-float: 1
-ifloat: 1
-
-Function: "erfc":
double: 1
float: 1
idouble: 1
ifloat: 1
+
+Function: "erfc":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
ildouble: 1
ldouble: 1
Function: "erfc_downward":
-double: 1
-float: 3
-idouble: 1
-ifloat: 3
+double: 5
+float: 6
+idouble: 5
+ifloat: 6
Function: "erfc_towardzero":
-double: 1
-float: 3
-idouble: 1
-ifloat: 3
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
Function: "erfc_upward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 5
+float: 6
+idouble: 5
+ifloat: 6
+
+Function: "exp":
+float: 1
+ifloat: 1
Function: "exp10":
double: 6
@@ -1116,22 +1172,42 @@ ildouble: 6
ldouble: 6
Function: "exp10_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp10_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp2":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: "exp10_tonearest":
+Function: "exp2_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
-Function: "exp10_towardzero":
+Function: "exp2_towardzero":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: "exp10_upward":
+Function: "exp2_upward":
double: 1
float: 1
idouble: 1
@@ -1169,17 +1245,11 @@ float: 1
idouble: 1
ifloat: 1
-Function: "expm1_tonearest":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
Function: "expm1_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Function: "expm1_upward":
double: 1
@@ -1188,28 +1258,28 @@ idouble: 1
ifloat: 1
Function: "gamma":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
Function: "gamma_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
Function: "gamma_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
Function: "gamma_upward":
-double: 1
-float: 3
-idouble: 1
-ifloat: 3
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
Function: "hypot":
double: 1
@@ -1239,9 +1309,9 @@ ldouble: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
Function: "j0_towardzero":
double: 3
@@ -1265,9 +1335,9 @@ ldouble: 1
Function: "j1_downward":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
Function: "j1_towardzero":
double: 3
@@ -1289,131 +1359,143 @@ ifloat: 5
ildouble: 4
ldouble: 4
+Function: "jn_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "jn_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "jn_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
Function: "lgamma":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
ildouble: 1
ldouble: 1
Function: "lgamma_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
Function: "lgamma_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
Function: "lgamma_upward":
-double: 1
-float: 3
-idouble: 1
-ifloat: 3
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
Function: "log":
float: 1
ifloat: 1
Function: "log10":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 1
ldouble: 1
Function: "log10_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
Function: "log10_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Function: "log10_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Function: "log1p":
-float: 1
-ifloat: 1
-
-Function: "log1p_downward":
double: 1
float: 1
idouble: 1
ifloat: 1
+Function: "log1p_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
Function: "log1p_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Function: "log1p_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: "log2_downward":
double: 2
float: 2
idouble: 2
ifloat: 2
-Function: "log2_towardzero":
-double: 1
+Function: "log2":
+double: 2
float: 1
-idouble: 1
+idouble: 2
ifloat: 1
-Function: "log2_upward":
+Function: "log2_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "log2_towardzero":
double: 2
float: 2
idouble: 2
ifloat: 2
-Function: "log_downward":
-float: 1
-ifloat: 1
-
-Function: "log_upward":
-float: 1
-ifloat: 1
-
-Function: "pow":
-float: 1
-ifloat: 1
+Function: "log2_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
-Function: "pow10":
-double: 1
-idouble: 1
+Function: "log_downward":
+float: 2
+ifloat: 2
-Function: "pow10_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+Function: "log_towardzero":
+float: 2
+ifloat: 2
-Function: "pow10_towardzero":
+Function: "log_upward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
-Function: "pow10_upward":
+Function: "pow":
double: 1
float: 1
idouble: 1
@@ -1425,10 +1507,6 @@ float: 1
idouble: 1
ifloat: 1
-Function: "pow_tonearest":
-float: 1
-ifloat: 1
-
Function: "pow_towardzero":
double: 1
float: 1
@@ -1442,7 +1520,9 @@ idouble: 1
ifloat: 1
Function: "sin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "sin_downward":
@@ -1451,10 +1531,6 @@ float: 2
idouble: 1
ifloat: 2
-Function: "sin_tonearest":
-float: 1
-ifloat: 1
-
Function: "sin_towardzero":
double: 1
float: 1
@@ -1489,31 +1565,39 @@ ifloat: 1
Function: "sincos_upward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+
+Function: "sinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Function: "sinh_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: "sinh_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Function: "sinh_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: "tan":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -1535,32 +1619,56 @@ float: 1
idouble: 1
ifloat: 1
+Function: "tanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
Function: "tanh_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: "tanh_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Function: "tanh_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: "tgamma":
-double: 4
+double: 3
float: 3
-idouble: 4
+idouble: 3
ifloat: 3
+
+Function: "tgamma":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
ildouble: 1
ldouble: 1
+Function: "tgamma_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "tgamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "tgamma_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
Function: "y0":
double: 2
float: 1
@@ -1571,9 +1679,9 @@ ldouble: 2
Function: "y0_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
Function: "y0_towardzero":
double: 3
@@ -1583,9 +1691,9 @@ ifloat: 3
Function: "y0_upward":
double: 3
-float: 4
+float: 5
idouble: 3
-ifloat: 4
+ifloat: 5
Function: "y1":
double: 3
@@ -1615,17 +1723,17 @@ ifloat: 2
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 3
ldouble: 3
Function: "yn_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
Function: "yn_towardzero":
double: 3
@@ -1635,8 +1743,8 @@ ifloat: 3
Function: "yn_upward":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
# end of automatic generation
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/frame.h b/sysdeps/hppa/frame.h
deleted file mode 100644
index 66777e44d7..0000000000
--- a/sysdeps/hppa/frame.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Definition of stack frame structure. HPPA version.
- Copyright (C) 2000-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/>. */
-
-/* PA stacks grow upwards. */
-#define INNER_THAN >
-
-/* FIXME: will verify this later */
-struct layout
-{
- void *next;
- void *return_address;
-};
diff --git a/sysdeps/hppa/gccframe.h b/sysdeps/hppa/gccframe.h
index 18cd40b172..4b8ec5cd9f 100644
--- a/sysdeps/hppa/gccframe.h
+++ b/sysdeps/hppa/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. hppa version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/get-rounding-mode.h b/sysdeps/hppa/get-rounding-mode.h
index 6f189fc023..7e1d03b3f7 100644
--- a/sysdeps/hppa/get-rounding-mode.h
+++ b/sysdeps/hppa/get-rounding-mode.h
@@ -1,5 +1,5 @@
/* Determine floating-point rounding mode within libc. HP-PARISC version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/hppa1.1/addmul_1.S b/sysdeps/hppa/hppa1.1/addmul_1.S
index 72a794aeb9..3dec0253bf 100644
--- a/sysdeps/hppa/hppa1.1/addmul_1.S
+++ b/sysdeps/hppa/hppa1.1/addmul_1.S
@@ -1,7 +1,7 @@
;! HP-PA-1.1 __mpn_addmul_1 -- Multiply a limb vector with a limb and
;! add the result to a second limb vector.
-;! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+;! Copyright (C) 1992-2018 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
diff --git a/sysdeps/hppa/hppa1.1/mul_1.S b/sysdeps/hppa/hppa1.1/mul_1.S
index 7d80056885..fcafd74002 100644
--- a/sysdeps/hppa/hppa1.1/mul_1.S
+++ b/sysdeps/hppa/hppa1.1/mul_1.S
@@ -1,7 +1,7 @@
;! HP-PA-1.1 __mpn_mul_1 -- Multiply a limb vector with a limb and store
;! the result in a second limb vector.
-;! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+;! Copyright (C) 1992-2018 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
diff --git a/sysdeps/hppa/hppa1.1/s_signbit.c b/sysdeps/hppa/hppa1.1/s_signbit.c
index 8ec4c77079..6139c5a6fd 100644
--- a/sysdeps/hppa/hppa1.1/s_signbit.c
+++ b/sysdeps/hppa/hppa1.1/s_signbit.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/hppa/hppa1.1/submul_1.S b/sysdeps/hppa/hppa1.1/submul_1.S
index d047ce98ad..cfcf2db85a 100644
--- a/sysdeps/hppa/hppa1.1/submul_1.S
+++ b/sysdeps/hppa/hppa1.1/submul_1.S
@@ -1,7 +1,7 @@
;! HP-PA-1.1 __mpn_submul_1 -- Multiply a limb vector with a limb and
;! subtract the result from a second limb vector.
-;! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+;! Copyright (C) 1992-2018 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
diff --git a/sysdeps/hppa/hppa1.1/udiv_qrnnd.S b/sysdeps/hppa/hppa1.1/udiv_qrnnd.S
index 4f7117f8b0..74069f7ace 100644
--- a/sysdeps/hppa/hppa1.1/udiv_qrnnd.S
+++ b/sysdeps/hppa/hppa1.1/udiv_qrnnd.S
@@ -1,7 +1,7 @@
;! HP-PA __udiv_qrnnd division support, used from longlong.h.
;! This version runs fast on PA 7000 and later.
-;! Copyright (C) 1993-2016 Free Software Foundation, Inc.
+;! Copyright (C) 1993-2018 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
diff --git a/sysdeps/hppa/jmpbuf-offsets.h b/sysdeps/hppa/jmpbuf-offsets.h
index fd2b341452..b01f47453f 100644
--- a/sysdeps/hppa/jmpbuf-offsets.h
+++ b/sysdeps/hppa/jmpbuf-offsets.h
@@ -1,5 +1,5 @@
/* Private macros for accessing __jmp_buf contents. HPPA version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/jmpbuf-unwind.h b/sysdeps/hppa/jmpbuf-unwind.h
index d5723803fd..9e38981389 100644
--- a/sysdeps/hppa/jmpbuf-unwind.h
+++ b/sysdeps/hppa/jmpbuf-unwind.h
@@ -1,5 +1,5 @@
/* Examine __jmp_buf for unwinding frames. HPPA version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/ldsodefs.h b/sysdeps/hppa/ldsodefs.h
index b120a218bc..292fdbef4e 100644
--- a/sysdeps/hppa/ldsodefs.h
+++ b/sysdeps/hppa/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/libc-tls.c b/sysdeps/hppa/libc-tls.c
index b58bd04c35..9e9aa94903 100644
--- a/sysdeps/hppa/libc-tls.c
+++ b/sysdeps/hppa/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. hppa version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/libgcc-compat.c b/sysdeps/hppa/libgcc-compat.c
index 077261072f..1438a8e0f0 100644
--- a/sysdeps/hppa/libgcc-compat.c
+++ b/sysdeps/hppa/libgcc-compat.c
@@ -1,5 +1,5 @@
/* pre-.hidden libgcc compatibility
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Randolph Chung
diff --git a/sysdeps/hppa/lshift.S b/sysdeps/hppa/lshift.S
index 7a795e29e1..ab23dd0ee8 100644
--- a/sysdeps/hppa/lshift.S
+++ b/sysdeps/hppa/lshift.S
@@ -1,6 +1,6 @@
;! HP-PA __mpn_lshift --
-;! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+;! Copyright (C) 1992-2018 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
diff --git a/sysdeps/hppa/machine-gmon.h b/sysdeps/hppa/machine-gmon.h
index 6afa4197e8..08b3c3a6b9 100644
--- a/sysdeps/hppa/machine-gmon.h
+++ b/sysdeps/hppa/machine-gmon.h
@@ -1,5 +1,5 @@
/* Machine-specific calling sequence for `mcount' profiling function. PA-RISC
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/math-tests.h b/sysdeps/hppa/math-tests.h
new file mode 100644
index 0000000000..2fb3a55899
--- /dev/null
+++ b/sysdeps/hppa/math-tests.h
@@ -0,0 +1,22 @@
+/* Configuration for math tests. hppa version.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* SNaN tests do not preserve payloads. */
+#define SNAN_TESTS_PRESERVE_PAYLOAD 0
+
+#include_next <math-tests.h>
diff --git a/sysdeps/hppa/math_private.h b/sysdeps/hppa/math_private.h
deleted file mode 100644
index 1acfb9ae4a..0000000000
--- a/sysdeps/hppa/math_private.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Internal math stuff. HPPA version.
- 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 HPPA_MATH_PRIVATE_H
-#define HPPA_MATH_PRIVATE_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_next <math_private.h>
-
-#endif
diff --git a/sysdeps/hppa/memusage.h b/sysdeps/hppa/memusage.h
index ffb923ad37..b82e665614 100644
--- a/sysdeps/hppa/memusage.h
+++ b/sysdeps/hppa/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/nan-high-order-bit.h b/sysdeps/hppa/nan-high-order-bit.h
new file mode 100644
index 0000000000..fa2ea53aa9
--- /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-2018 Free Software 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/Makefile b/sysdeps/hppa/nptl/Makefile
index 2dea713081..cac490cfd5 100644
--- a/sysdeps/hppa/nptl/Makefile
+++ b/sysdeps/hppa/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# Copyright (C) 2005-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
# The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h b/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..9af995716e
--- /dev/null
+++ b/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,91 @@
+/* Copyright (C) 2005-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+/* Linuxthread type sizes (bytes):
+ sizeof(pthread_attr_t) = 0x24 (36)
+ sizeof(pthread_barrier_t) = 0x30 (48)
+ sizeof(pthread_barrierattr_t) = 0x4 (4)
+ sizeof(pthread_cond_t) = 0x30 (48)
+ sizeof(pthread_condattr_t) = 0x4 (4)
+ sizeof(pthread_mutex_t) = 0x30 (48)
+ sizeof(pthread_mutexattr_t) = 0x4 (4)
+ sizeof(pthread_rwlock_t) = 0x40 (64)
+ sizeof(pthread_rwlockattr_t) = 0x8 (8)
+ sizeof(pthread_spinlock_t) = 0x10 (16) */
+
+#define __SIZEOF_PTHREAD_ATTR_T 36
+#define __SIZEOF_PTHREAD_MUTEX_T 48
+#define __SIZEOF_PTHREAD_BARRIER_T 48
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCK_T 64
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+
+/* The old 4-word 16-byte aligned lock. This is initalized
+ to all ones by the Linuxthreads PTHREAD_MUTEX_INITIALIZER.
+ Unused in NPTL. */
+#define __PTHREAD_COMPAT_PADDING_MID int __compat_padding[4];
+/* Two more words are left before the NPTL
+ pthread_mutex_t is larger than Linuxthreads. */
+#define __PTHREAD_COMPAT_PADDING_END int __reserved[2];
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1
+#define __PTHREAD_MUTEX_USE_UNION 1
+
+#define __LOCK_ALIGNMENT __attribute__ ((__aligned__(16)))
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ /* In the old Linuxthreads pthread_rwlock_t, this is the
+ start of the 4-word 16-byte aligned lock structure. The
+ next four words are all set to 1 by the Linuxthreads
+ PTHREAD_RWLOCK_INITIALIZER. We ignore them in NPTL. */
+ int __compat_padding[4] __attribute__ ((__aligned__(16)));
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+ int __cur_writer;
+ /* An unused word, reserved for future use. It was added
+ to maintain the location of the flags from the Linuxthreads
+ layout of this structure. */
+ int __reserved1;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __pad2;
+ unsigned char __pad1;
+ unsigned char __shared;
+ unsigned char __flags;
+ /* The NPTL pthread_rwlock_t is 4 words smaller than the
+ Linuxthreads version. One word is in the middle of the
+ structure, the other three are at the end. */
+ int __reserved2;
+ int __reserved3;
+ int __reserved4;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/hppa/nptl/bits/pthreadtypes.h b/sysdeps/hppa/nptl/bits/pthreadtypes.h
deleted file mode 100644
index 540802a70c..0000000000
--- a/sysdeps/hppa/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/* Copyright (C) 2005-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 _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-/* Linuxthread type sizes (bytes):
- sizeof(pthread_attr_t) = 0x24 (36)
- sizeof(pthread_barrier_t) = 0x30 (48)
- sizeof(pthread_barrierattr_t) = 0x4 (4)
- sizeof(pthread_cond_t) = 0x30 (48)
- sizeof(pthread_condattr_t) = 0x4 (4)
- sizeof(pthread_mutex_t) = 0x30 (48)
- sizeof(pthread_mutexattr_t) = 0x4 (4)
- sizeof(pthread_rwlock_t) = 0x40 (64)
- sizeof(pthread_rwlockattr_t) = 0x8 (8)
- sizeof(pthread_spinlock_t) = 0x10 (16) */
-
-#define __SIZEOF_PTHREAD_ATTR_T 36
-#define __SIZEOF_PTHREAD_BARRIER_T 48
-#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#define __SIZEOF_PTHREAD_COND_T 48
-#define __SIZEOF_PTHREAD_CONDATTR_T 4
-#define __SIZEOF_PTHREAD_MUTEX_T 48
-#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-#define __SIZEOF_PTHREAD_RWLOCK_T 64
-#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-
-/* Thread identifiers. The structure of the attribute type is not
- exposed on purpose. */
-typedef unsigned long int pthread_t;
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is not exposed on purpose. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock __attribute__ ((__aligned__(16)));
- unsigned int __count;
- int __owner;
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
- /* The old 4-word 16-byte aligned lock. This is initalized
- to all ones by the Linuxthreads PTHREAD_MUTEX_INITIALIZER.
- Unused in NPTL. */
- int __compat_padding[4];
- /* In the old structure there are 4 words left due to alignment.
- In NPTL two words are used. */
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
- /* Two more words are left before the NPTL
- pthread_mutex_t is larger than Linuxthreads. */
- int __reserved1;
- int __reserved2;
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- long int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is not exposed on purpose. However, this structure
- is exposed via PTHREAD_COND_INITIALIZER, and because of this, the
- Linuxthreads version sets the first four ints to one. In the NPTL
- version we must check, in every function using pthread_cond_t,
- for the static Linuxthreads initializer and clear the appropriate
- words. */
-typedef union
-{
- struct
- {
- /* In the old Linuxthreads pthread_cond_t, this is the
- start of the 4-word lock structure, the next four words
- are set all to 1 by the Linuxthreads
- PTHREAD_COND_INITIALIZER. */
- int __lock __attribute__ ((__aligned__(16)));
- /* Tracks the initialization of this structure:
- 0 initialized with NPTL PTHREAD_COND_INITIALIZER.
- 1 initialized with Linuxthreads PTHREAD_COND_INITIALIZER.
- 2 initialization in progress. */
- int __initializer;
- unsigned int __futex;
- void *__mutex;
- /* In the old Linuxthreads this would have been the start
- of the pthread_fastlock status word. */
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- /* The NPTL pthread_cond_t is exactly the same size as
- the Linuxthreads version, there are no words to spare. */
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- long int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- /* In the old Linuxthreads pthread_rwlock_t, this is the
- start of the 4-word 16-byte aligned lock structure. The
- next four words are all set to 1 by the Linuxthreads
- PTHREAD_RWLOCK_INITIALIZER. We ignore them in NPTL. */
- int __compat_padding[4] __attribute__ ((__aligned__(16)));
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- int __writer;
- /* An unused word, reserved for future use. It was added
- to maintain the location of the flags from the Linuxthreads
- layout of this structure. */
- int __reserved1;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __pad2;
- unsigned char __pad1;
- unsigned char __shared;
- unsigned char __flags;
- /* The NPTL pthread_rwlock_t is 4 words smaller than the
- Linuxthreads version. One word is in the middle of the
- structure, the other three are at the end. */
- int __reserved2;
- int __reserved3;
- int __reserved4;
- } __data;
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/hppa/nptl/bits/semaphore.h b/sysdeps/hppa/nptl/bits/semaphore.h
index 4cdac957fb..e6f75bf49b 100644
--- a/sysdeps/hppa/nptl/bits/semaphore.h
+++ b/sysdeps/hppa/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/nptl/jmpbuf-unwind.h b/sysdeps/hppa/nptl/jmpbuf-unwind.h
index 27c4f6f116..6ee404fd6f 100644
--- a/sysdeps/hppa/nptl/jmpbuf-unwind.h
+++ b/sysdeps/hppa/nptl/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/nptl/pthread-offsets.h b/sysdeps/hppa/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..8ae01b9d95
--- /dev/null
+++ b/sysdeps/hppa/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 32
+#define __PTHREAD_MUTEX_KIND_OFFSET 12
+#define __PTHREAD_MUTEX_SPINS_OFFSET 36
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 36
diff --git a/sysdeps/hppa/nptl/pthread_spin_init.c b/sysdeps/hppa/nptl/pthread_spin_init.c
index 2df0376d8b..eaf07bd717 100644
--- a/sysdeps/hppa/nptl/pthread_spin_init.c
+++ b/sysdeps/hppa/nptl/pthread_spin_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/nptl/pthread_spin_lock.c b/sysdeps/hppa/nptl/pthread_spin_lock.c
deleted file mode 100644
index 2dea818315..0000000000
--- a/sysdeps/hppa/nptl/pthread_spin_lock.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 2005-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 SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
-
-/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because
- it will resolve to this very file. Using "sysdeps/.." as reference to the
- top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
diff --git a/sysdeps/hppa/nptl/pthread_spin_unlock.c b/sysdeps/hppa/nptl/pthread_spin_unlock.c
index 6e4d71ecf1..1581247330 100644
--- a/sysdeps/hppa/nptl/pthread_spin_unlock.c
+++ b/sysdeps/hppa/nptl/pthread_spin_unlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/nptl/pthreaddef.h b/sysdeps/hppa/nptl/pthreaddef.h
index fa1ab4c697..cdb55687f5 100644
--- a/sysdeps/hppa/nptl/pthreaddef.h
+++ b/sysdeps/hppa/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/nptl/tcb-offsets.sym b/sysdeps/hppa/nptl/tcb-offsets.sym
index c2f326ee3d..6e852f35b1 100644
--- a/sysdeps/hppa/nptl/tcb-offsets.sym
+++ b/sysdeps/hppa/nptl/tcb-offsets.sym
@@ -3,7 +3,6 @@
RESULT offsetof (struct pthread, result)
TID offsetof (struct pthread, tid)
-PID offsetof (struct pthread, pid)
CANCELHANDLING offsetof (struct pthread, cancelhandling)
CLEANUP_JMP_BUF offsetof (struct pthread, cleanup_jmp_buf)
MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads)
@@ -14,6 +13,5 @@ MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock)
-- This way we get the offset of a member in the struct pthread that
-- preceeds the thread pointer (which points to the dtv).
#define thread_offsetof(mem) (unsigned int)(offsetof(struct pthread, mem) - sizeof(struct pthread))
-PID_THREAD_OFFSET thread_offsetof (pid)
TID_THREAD_OFFSET thread_offsetof (tid)
MULTIPLE_THREADS_THREAD_OFFSET thread_offsetof (header.multiple_threads)
diff --git a/sysdeps/hppa/nptl/tls.h b/sysdeps/hppa/nptl/tls.h
index 2e0c861e09..2b94e346c1 100644
--- a/sysdeps/hppa/nptl/tls.h
+++ b/sysdeps/hppa/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/hppa version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,17 +25,7 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
@@ -144,6 +134,7 @@ static inline void __set_cr27(struct pthread *cr27)
}
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/hppa/nptl/tst-oddstacklimit.c b/sysdeps/hppa/nptl/tst-oddstacklimit.c
index 7579235957..c8579dc0e2 100644
--- a/sysdeps/hppa/nptl/tst-oddstacklimit.c
+++ b/sysdeps/hppa/nptl/tst-oddstacklimit.c
@@ -1,6 +1,6 @@
/* Test NPTL with stack limit that is not a multiple of the page size.
HPPA version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/rshift.S b/sysdeps/hppa/rshift.S
index 82bb4ce461..882a5c3c3a 100644
--- a/sysdeps/hppa/rshift.S
+++ b/sysdeps/hppa/rshift.S
@@ -1,6 +1,6 @@
;! HP-PA __mpn_rshift --
-;! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+;! Copyright (C) 1992-2018 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
diff --git a/sysdeps/hppa/setjmp.S b/sysdeps/hppa/setjmp.S
index cdf65146ad..941ecb1d45 100644
--- a/sysdeps/hppa/setjmp.S
+++ b/sysdeps/hppa/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for HPPA.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -70,3 +70,4 @@ __sigsetjmp:
b __sigjmp_save
nop
.procend
+hidden_def (__sigsetjmp)
diff --git a/sysdeps/hppa/sotruss-lib.c b/sysdeps/hppa/sotruss-lib.c
index d7fd81b637..1530b13d34 100644
--- a/sysdeps/hppa/sotruss-lib.c
+++ b/sysdeps/hppa/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for HP-PARISC.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/hppa/stackinfo.h b/sysdeps/hppa/stackinfo.h
index fc680f323f..ae9d9f02a2 100644
--- a/sysdeps/hppa/stackinfo.h
+++ b/sysdeps/hppa/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/hppa/start.S b/sysdeps/hppa/start.S
index 90d4331f5a..c1d2bd4bb7 100644
--- a/sysdeps/hppa/start.S
+++ b/sysdeps/hppa/start.S
@@ -1,5 +1,5 @@
/* ELF startup code for HPPA.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -42,7 +42,7 @@
/* Have the linker create plabel words so we get PLABEL32
relocs and not 21/14. The use of 21/14 relocs is only
supported in the latest dynamic linker. */
-#ifdef SHARED
+#ifdef PIC
.section .data.rel.ro,"aw",@progbits
#else
.section .rodata,"a",@progbits
@@ -56,10 +56,6 @@
.word P%__libc_csu_fini
.Lp__libc_csu_init:
.word P%__libc_csu_init
-#ifdef SHARED
-.Lp__global:
- .word $global$
-#endif
.text
.align 4
@@ -99,9 +95,15 @@ _start:
/* argc and argv should be in 25 and 24 (2nd and 3rd argument) */
/* void (*rtld_fini) (void) (6th argument) */
stw %r23, -56(%sp)
+
/* Need to setup 1, 4, 5, and 7th arguments */
-#ifdef SHARED
+#ifdef PIC
+ /* Load $global$ address into %dp */
+ bl .+8, %dp
+ addil L'$global$-$PIC_pcrel$0+1, %dp
+ ldo R'$global$-$PIC_pcrel$0+5(%r1), %dp
+
/* load main (1st argument) */
addil LT'.Lpmain, %r19
ldw RT'.Lpmain(%r1), %r26
@@ -115,6 +117,10 @@ _start:
ldw RT'.Lp__libc_csu_fini(%r1), %r22
ldw 0(%r22), %r22
#else
+ /* Load $global$ address into %dp */
+ ldil L%$global$, %dp
+ ldo R%$global$(%dp), %dp
+
/* load main (1st argument) */
ldil LR'.Lpmain, %r26
ldw RR'.Lpmain(%r26), %r26
@@ -129,15 +135,6 @@ _start:
stw %r22, -52(%sp)
/* void *stack_end (7th argument) */
stw %sp, -60(%sp)
-
-#ifdef SHARED
- addil LT'.Lp__global, %r19
- ldw RT'.Lp__global(%r1), %dp
-#else
- /* load global */
- ldil L%$global$, %dp
- ldo R%$global$(%dp), %dp
-#endif
bl __libc_start_main,%r2
nop
/* die horribly if it returned (it shouldn't) */
diff --git a/sysdeps/hppa/sub_n.S b/sysdeps/hppa/sub_n.S
index 998e885c4c..d42001e798 100644
--- a/sysdeps/hppa/sub_n.S
+++ b/sysdeps/hppa/sub_n.S
@@ -1,7 +1,7 @@
;! HP-PA __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
;! store difference in a third limb vector.
-;! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+;! Copyright (C) 1992-2018 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
diff --git a/sysdeps/hppa/sysdep.h b/sysdeps/hppa/sysdep.h
index 46c22c41d4..4b139228a1 100644
--- a/sysdeps/hppa/sysdep.h
+++ b/sysdeps/hppa/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for HP/PA.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
diff --git a/sysdeps/hppa/tst-audit.h b/sysdeps/hppa/tst-audit.h
index 88eb06fd97..4ba373448c 100644
--- a/sysdeps/hppa/tst-audit.h
+++ b/sysdeps/hppa/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. HP-PARISC version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/hppa/udiv_qrnnd.S b/sysdeps/hppa/udiv_qrnnd.S
index e26e1fb61e..e7e850b98a 100644
--- a/sysdeps/hppa/udiv_qrnnd.S
+++ b/sysdeps/hppa/udiv_qrnnd.S
@@ -1,7 +1,7 @@
;! HP-PA __udiv_qrnnd division support, used from longlong.h.
;! This version runs fast on pre-PA7000 CPUs.
-;! Copyright (C) 1993-2016 Free Software Foundation, Inc.
+;! Copyright (C) 1993-2018 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
diff --git a/sysdeps/htl/Implies b/sysdeps/htl/Implies
new file mode 100644
index 0000000000..f1b3e8939c
--- /dev/null
+++ b/sysdeps/htl/Implies
@@ -0,0 +1 @@
+pthread
diff --git a/sysdeps/htl/Makeconfig b/sysdeps/htl/Makeconfig
new file mode 100644
index 0000000000..3af4c1de35
--- /dev/null
+++ b/sysdeps/htl/Makeconfig
@@ -0,0 +1,11 @@
+# Makeconfig fragment for Hurd libpthread add-on.
+# This gets included at the end of the main glibc Makeconfig.
+
+have-thread-library = yes
+
+shared-thread-library = $(common-objpfx)htl/libpthread_nonshared.a \
+ $(common-objpfx)htl/libpthread.so
+static-thread-library = $(common-objpfx)htl/libpthread.a
+bounded-thread-library = $(static-thread-library)
+
+rpath-dirs += htl
diff --git a/sysdeps/htl/Makefile b/sysdeps/htl/Makefile
new file mode 100644
index 0000000000..12bb54ebf4
--- /dev/null
+++ b/sysdeps/htl/Makefile
@@ -0,0 +1,7 @@
+ifeq ($(subdir),rt)
+librt-sysdep_routines += timer_routines
+endif
+
+ifeq ($(subdir),posix)
+CFLAGS-confstr.c += -DLIBPTHREAD_VERSION='"HTL $(version)"'
+endif
diff --git a/sysdeps/htl/Subdirs b/sysdeps/htl/Subdirs
new file mode 100644
index 0000000000..5215f33d98
--- /dev/null
+++ b/sysdeps/htl/Subdirs
@@ -0,0 +1 @@
+htl
diff --git a/sysdeps/htl/Versions b/sysdeps/htl/Versions
new file mode 100644
index 0000000000..3a3b1e8b3d
--- /dev/null
+++ b/sysdeps/htl/Versions
@@ -0,0 +1,15 @@
+libc {
+ GLIBC_2.2 {
+ # XXX
+ __vm_deallocate; __mach_port_insert_right; __mach_reply_port;
+ __mig_init; __vm_allocate; __mach_port_allocate;
+
+ # functions used in inline functions or macros
+ __pthread_spin_destroy; __pthread_spin_init; __pthread_spin_lock;
+ _pthread_spin_lock; __pthread_spin_trylock; __pthread_spin_unlock;
+
+ # p*
+ pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
+ pthread_spin_trylock; pthread_spin_unlock;
+ }
+}
diff --git a/sysdeps/htl/bits/cancelation.h b/sysdeps/htl/bits/cancelation.h
new file mode 100644
index 0000000000..436dfcbbfa
--- /dev/null
+++ b/sysdeps/htl/bits/cancelation.h
@@ -0,0 +1,50 @@
+/* Cancelation. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_CANCELATION_H
+#define _BITS_CANCELATION_H 1
+
+struct __pthread_cancelation_handler
+{
+ void (*__handler) (void *);
+ void *__arg;
+ struct __pthread_cancelation_handler *__next;
+};
+
+/* Returns the thread local location of the cleanup handler stack. */
+struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
+
+#define __pthread_cleanup_push(rt, rtarg) \
+ { \
+ struct __pthread_cancelation_handler **__handlers \
+ = __pthread_get_cleanup_stack (); \
+ struct __pthread_cancelation_handler __handler = \
+ { \
+ (rt), \
+ (rtarg), \
+ *__handlers \
+ }; \
+ *__handlers = &__handler;
+
+#define __pthread_cleanup_pop(execute) \
+ if (execute) \
+ __handler.__handler (__handler.__arg); \
+ *__handlers = __handler.__next; \
+ }
+
+#endif /* _BITS_CANCELATION_H */
diff --git a/sysdeps/htl/bits/pthread-np.h b/sysdeps/htl/bits/pthread-np.h
new file mode 100644
index 0000000000..b40f9baafe
--- /dev/null
+++ b/sysdeps/htl/bits/pthread-np.h
@@ -0,0 +1,26 @@
+/* Non-portable functions. Generic version.
+ Copyright (C) 2008-2018 Free Software 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/>. */
+
+/*
+ * Never include this file directly; use <pthread.h> or <cthreads.h> instead.
+ */
+
+#ifndef _BITS_PTHREAD_NP_H
+#define _BITS_PTHREAD_NP_H 1
+
+#endif /* bits/pthread-np.h */
diff --git a/sysdeps/htl/bits/pthread.h b/sysdeps/htl/bits/pthread.h
new file mode 100644
index 0000000000..3cbe5308e9
--- /dev/null
+++ b/sysdeps/htl/bits/pthread.h
@@ -0,0 +1,36 @@
+/* Pthread data structures. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_PTHREAD_H
+#define _BITS_PTHREAD_H 1
+
+typedef int __pthread_t;
+
+/* Return true if __T1 and __T2 both name the same thread. Otherwise,
+ false. */
+extern int __pthread_equal (__pthread_t __t1, __pthread_t __t2);
+
+#ifdef __USE_EXTERN_INLINES
+__extern_inline int
+__pthread_equal (__pthread_t __t1, __pthread_t __t2)
+{
+ return __t1 == __t2;
+}
+#endif
+
+#endif /* bits/pthread.h */
diff --git a/sysdeps/htl/bits/pthreadtypes.h b/sysdeps/htl/bits/pthreadtypes.h
new file mode 100644
index 0000000000..cb75fee490
--- /dev/null
+++ b/sysdeps/htl/bits/pthreadtypes.h
@@ -0,0 +1,131 @@
+/* Declaration of common pthread types for all architectures. Hurd version.
+ Copyright (C) 2000-2018 Free Software 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/>. */
+
+#if !defined _BITS_TYPES_H && !defined _PTHREAD_H
+# error "Never include <bits/pthreadtypes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef _BITS_PTHREADTYPES_H
+#define _BITS_PTHREADTYPES_H 1
+
+#include <bits/thread-shared-types.h>
+
+#include <features.h>
+
+#include <bits/types.h>
+
+__BEGIN_DECLS
+#include <bits/pthread.h>
+typedef __pthread_t pthread_t;
+
+/* Possible values for the process shared attribute. */
+enum __pthread_process_shared
+{
+ __PTHREAD_PROCESS_PRIVATE = 0,
+ __PTHREAD_PROCESS_SHARED
+};
+
+/* Possible values for the inheritsched attribute. */
+enum __pthread_inheritsched
+{
+ __PTHREAD_EXPLICIT_SCHED = 0,
+ __PTHREAD_INHERIT_SCHED
+};
+
+/* Possible values for the `contentionscope' attribute. */
+enum __pthread_contentionscope
+{
+ __PTHREAD_SCOPE_SYSTEM = 0,
+ __PTHREAD_SCOPE_PROCESS
+};
+
+/* Possible values for the `detachstate' attribute. */
+enum __pthread_detachstate
+{
+ __PTHREAD_CREATE_JOINABLE = 0,
+ __PTHREAD_CREATE_DETACHED
+};
+
+#include <bits/types/struct___pthread_attr.h>
+typedef struct __pthread_attr pthread_attr_t;
+
+enum __pthread_mutex_protocol
+{
+ __PTHREAD_PRIO_NONE = 0,
+ __PTHREAD_PRIO_INHERIT,
+ __PTHREAD_PRIO_PROTECT
+};
+
+enum __pthread_mutex_type
+{
+ __PTHREAD_MUTEX_TIMED,
+ __PTHREAD_MUTEX_ERRORCHECK,
+ __PTHREAD_MUTEX_RECURSIVE
+};
+
+enum __pthread_mutex_robustness
+{
+ __PTHREAD_MUTEX_STALLED,
+ __PTHREAD_MUTEX_ROBUST = 0x100
+};
+
+#include <bits/types/struct___pthread_mutexattr.h>
+typedef struct __pthread_mutexattr pthread_mutexattr_t;
+
+#include <bits/types/struct___pthread_mutex.h>
+typedef struct __pthread_mutex pthread_mutex_t;
+
+#include <bits/types/struct___pthread_condattr.h>
+typedef struct __pthread_condattr pthread_condattr_t;
+
+#include <bits/types/struct___pthread_cond.h>
+typedef struct __pthread_cond pthread_cond_t;
+
+#ifdef __USE_XOPEN2K
+# include <bits/types/__pthread_spinlock_t.h>
+typedef __pthread_spinlock_t pthread_spinlock_t;
+#endif /* XPG6. */
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+
+# include <bits/types/struct___pthread_rwlockattr.h>
+typedef struct __pthread_rwlockattr pthread_rwlockattr_t;
+
+# include <bits/types/struct___pthread_rwlock.h>
+typedef struct __pthread_rwlock pthread_rwlock_t;
+
+#endif /* __USE_UNIX98 || __USE_XOPEN2K */
+
+#ifdef __USE_XOPEN2K
+
+# include <bits/types/struct___pthread_barrierattr.h>
+typedef struct __pthread_barrierattr pthread_barrierattr_t;
+
+# include <bits/types/struct___pthread_barrier.h>
+typedef struct __pthread_barrier pthread_barrier_t;
+
+#endif /* __USE_XOPEN2K */
+
+#include <bits/types/__pthread_key.h>
+typedef __pthread_key pthread_key_t;
+
+#include <bits/types/struct___pthread_once.h>
+typedef struct __pthread_once pthread_once_t;
+
+__END_DECLS
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/htl/bits/semaphore.h b/sysdeps/htl/bits/semaphore.h
new file mode 100644
index 0000000000..55a6a04517
--- /dev/null
+++ b/sysdeps/htl/bits/semaphore.h
@@ -0,0 +1,47 @@
+/* Semaphore type. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 _BITS_SEMAPHORE_H
+#define _BITS_SEMAPHORE_H 1
+
+#ifndef _SEMAPHORE_H
+# error Never include <bits/semaphore.h> directly.
+#endif
+
+#include <bits/types/__pthread_spinlock_t.h>
+#include <bits/pthread.h>
+
+/* User visible part of a semaphore. */
+struct __semaphore
+{
+ __pthread_spinlock_t __lock;
+ struct __pthread *__queue;
+ int __pshared;
+ int __value;
+ void *__data;
+};
+
+typedef struct __semaphore sem_t;
+
+#define SEM_FAILED ((void *) 0)
+
+/* Initializer for a semaphore. */
+#define __SEMAPHORE_INITIALIZER(pshared, value) \
+ { __PTHREAD_SPIN_LOCK_INITIALIZER, NULL, (pshared), (value), NULL }
+
+#endif /* bits/semaphore.h */
diff --git a/sysdeps/htl/bits/thread-shared-types.h b/sysdeps/htl/bits/thread-shared-types.h
new file mode 100644
index 0000000000..054cbf201f
--- /dev/null
+++ b/sysdeps/htl/bits/thread-shared-types.h
@@ -0,0 +1,24 @@
+/* Common threading primitives definitions for both POSIX and C11.
+ Copyright (C) 2017-2018 Free Software 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 _THREAD_SHARED_TYPES_H
+#define _THREAD_SHARED_TYPES_H 1
+
+#include <bits/pthreadtypes-arch.h>
+
+#endif /* _THREAD_SHARED_TYPES_H */
diff --git a/sysdeps/htl/bits/types/__pthread_key.h b/sysdeps/htl/bits/types/__pthread_key.h
new file mode 100644
index 0000000000..8d33e15d97
--- /dev/null
+++ b/sysdeps/htl/bits/types/__pthread_key.h
@@ -0,0 +1,24 @@
+/* Thread specific data. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_TYPES___PTHREAD_KEY_H
+#define _BITS_TYPES___PTHREAD_KEY_H 1
+
+typedef int __pthread_key;
+
+#endif /* bits/types/__pthread_key.h */
diff --git a/sysdeps/htl/bits/types/struct___pthread_attr.h b/sysdeps/htl/bits/types/struct___pthread_attr.h
new file mode 100644
index 0000000000..3c78291cbf
--- /dev/null
+++ b/sysdeps/htl/bits/types/struct___pthread_attr.h
@@ -0,0 +1,45 @@
+/* Thread attribute type. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_ATTR
+#define _BITS_TYPES_STRUCT___PTHREAD_ATTR 1
+
+#include <bits/types/struct_sched_param.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+enum __pthread_detachstate;
+enum __pthread_inheritsched;
+enum __pthread_contentionscope;
+
+/* This structure describes the attributes of a POSIX thread. Note
+ that not all of them are supported on all systems. */
+struct __pthread_attr
+{
+ struct sched_param __schedparam;
+ void *__stackaddr;
+ size_t __stacksize;
+ size_t __guardsize;
+ enum __pthread_detachstate __detachstate;
+ enum __pthread_inheritsched __inheritsched;
+ enum __pthread_contentionscope __contentionscope;
+ int __schedpolicy;
+};
+
+#endif /* bits/types/struct___pthread_attr.h */
diff --git a/sysdeps/htl/bits/types/struct___pthread_barrier.h b/sysdeps/htl/bits/types/struct___pthread_barrier.h
new file mode 100644
index 0000000000..113b624671
--- /dev/null
+++ b/sysdeps/htl/bits/types/struct___pthread_barrier.h
@@ -0,0 +1,38 @@
+/* Thread barrier attribute type. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_BARRIER_H
+#define _BITS_TYPES_STRUCT___PTHREAD_BARRIER_H 1
+
+#include <bits/types/__pthread_spinlock_t.h>
+
+/* This structure describes the attributes of a POSIX barrier. */
+struct __pthread_barrier
+{
+ __pthread_spinlock_t __lock;
+ struct __pthread *__queue; /* List of waiters. */
+ unsigned __pending; /* Number of that still need to wait on
+ barrier. */
+ unsigned __count; /* Number of threads that must wait before
+ barrier is passed. */
+ struct __pthread_barrierattr *__attr;
+ void *__data;
+};
+
+
+#endif /* bits/types/struct___pthread_barrier.h */
diff --git a/sysdeps/htl/bits/types/struct___pthread_barrierattr.h b/sysdeps/htl/bits/types/struct___pthread_barrierattr.h
new file mode 100644
index 0000000000..639ef5d5ef
--- /dev/null
+++ b/sysdeps/htl/bits/types/struct___pthread_barrierattr.h
@@ -0,0 +1,31 @@
+/* Thread barrier attribute type. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_BARRIERATTR_H
+#define _BITS_TYPES_STRUCT___PTHREAD_BARRIERATTR_H 1
+
+enum __pthread_process_shared;
+
+/* This structure describes the attributes of a POSIX thread barrier.
+ Note that not all of them are supported on all systems. */
+struct __pthread_barrierattr
+{
+ enum __pthread_process_shared __pshared;
+};
+
+#endif /* bits/types/struct___pthread_barrierattr.h */
diff --git a/sysdeps/htl/bits/types/struct___pthread_cond.h b/sysdeps/htl/bits/types/struct___pthread_cond.h
new file mode 100644
index 0000000000..86215191b4
--- /dev/null
+++ b/sysdeps/htl/bits/types/struct___pthread_cond.h
@@ -0,0 +1,38 @@
+/* Condition type. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_COND_H
+#define _BITS_TYPES_STRUCT___PTHREAD_COND_H 1
+
+#include <bits/types/__pthread_spinlock_t.h>
+
+/* User visible part of a condition variable. */
+struct __pthread_cond
+{
+ __pthread_spinlock_t __lock;
+ struct __pthread *__queue;
+ struct __pthread_condattr *__attr;
+ struct __pthread_condimpl *__impl;
+ void *__data;
+};
+
+/* Initializer for a condition variable. */
+#define __PTHREAD_COND_INITIALIZER \
+ { __PTHREAD_SPIN_LOCK_INITIALIZER, NULL, NULL, NULL, NULL }
+
+#endif /* bits/types/struct___pthread_cond.h */
diff --git a/sysdeps/htl/bits/types/struct___pthread_condattr.h b/sysdeps/htl/bits/types/struct___pthread_condattr.h
new file mode 100644
index 0000000000..3297e984e3
--- /dev/null
+++ b/sysdeps/htl/bits/types/struct___pthread_condattr.h
@@ -0,0 +1,33 @@
+/* Condition attribute type. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_CONDATTR
+#define _BITS_TYPES_STRUCT___PTHREAD_CONDATTR 1
+
+#include <bits/types.h>
+
+enum __pthread_process_shared;
+
+/* User visible part of a condition attribute variable. */
+struct __pthread_condattr
+{
+ enum __pthread_process_shared __pshared;
+ __clockid_t __clock;
+};
+
+#endif /* bits/types/struct___pthread_condattr.h */
diff --git a/sysdeps/htl/bits/types/struct___pthread_mutex.h b/sysdeps/htl/bits/types/struct___pthread_mutex.h
new file mode 100644
index 0000000000..564e6a3159
--- /dev/null
+++ b/sysdeps/htl/bits/types/struct___pthread_mutex.h
@@ -0,0 +1,61 @@
+/* Mutex type. Generic version.
+
+ Copyright (C) 2000-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_MUTEX_H
+#define _BITS_TYPES_STRUCT___PTHREAD_MUTEX_H 1
+
+#include <bits/types/__pthread_spinlock_t.h>
+#include <bits/types/struct___pthread_mutexattr.h>
+
+/* User visible part of a mutex. */
+struct __pthread_mutex
+{
+ __pthread_spinlock_t __held;
+ __pthread_spinlock_t __lock;
+ /* In cthreads, mutex_init does not initialized thre third
+ pointer, as such, we cannot rely on its value for anything. */
+ char *__cthreadscompat1;
+ struct __pthread *__queue;
+ struct __pthread_mutexattr *__attr;
+ void *__data;
+ /* Up to this point, we are completely compatible with cthreads
+ and what libc expects. */
+ void *__owner;
+ unsigned __locks;
+ /* If NULL then the default attributes apply. */
+};
+
+/* Initializer for a mutex. N.B. this also happens to be compatible
+ with the cthread mutex initializer. */
+#define __PTHREAD_MUTEX_INITIALIZER \
+ { __PTHREAD_SPIN_LOCK_INITIALIZER, __PTHREAD_SPIN_LOCK_INITIALIZER, 0, 0, 0, 0, 0, 0 }
+
+#define __PTHREAD_ERRORCHECK_MUTEXATTR ((struct __pthread_mutexattr *) ((unsigned long) __PTHREAD_MUTEX_ERRORCHECK + 1))
+
+#define __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER \
+ { __PTHREAD_SPIN_LOCK_INITIALIZER, __PTHREAD_SPIN_LOCK_INITIALIZER, 0, 0, \
+ __PTHREAD_ERRORCHECK_MUTEXATTR, 0, 0, 0 }
+
+#define __PTHREAD_RECURSIVE_MUTEXATTR ((struct __pthread_mutexattr *) ((unsigned long) __PTHREAD_MUTEX_RECURSIVE + 1))
+
+#define __PTHREAD_RECURSIVE_MUTEX_INITIALIZER \
+ { __PTHREAD_SPIN_LOCK_INITIALIZER, __PTHREAD_SPIN_LOCK_INITIALIZER, 0, 0, \
+ __PTHREAD_RECURSIVE_MUTEXATTR, 0, 0, 0 }
+
+#endif /* bits/types/struct___pthread_mutex.h */
diff --git a/sysdeps/htl/bits/types/struct___pthread_mutexattr.h b/sysdeps/htl/bits/types/struct___pthread_mutexattr.h
new file mode 100644
index 0000000000..239b366ab5
--- /dev/null
+++ b/sysdeps/htl/bits/types/struct___pthread_mutexattr.h
@@ -0,0 +1,40 @@
+/* Mutex attribute type. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_MUTEXATTR_H
+#define _BITS_TYPES_STRUCT___PTHREAD_MUTEXATTR_H 1
+
+enum __pthread_mutex_protocol;
+enum __pthread_process_shared;
+enum __pthread_mutex_type;
+
+/* This structure describes the attributes of a POSIX mutex
+ attribute. */
+struct __pthread_mutexattr
+{
+ int __prioceiling;
+ enum __pthread_mutex_protocol __protocol;
+ enum __pthread_process_shared __pshared;
+ enum __pthread_mutex_type __mutex_type;
+};
+
+/* Attributes for a recursive mutex. */
+extern const struct __pthread_mutexattr __pthread_errorcheck_mutexattr;
+extern const struct __pthread_mutexattr __pthread_recursive_mutexattr;
+
+#endif /* bits/types/struct___pthread_mutexattr.h */
diff --git a/sysdeps/htl/bits/types/struct___pthread_once.h b/sysdeps/htl/bits/types/struct___pthread_once.h
new file mode 100644
index 0000000000..99fa43b0cb
--- /dev/null
+++ b/sysdeps/htl/bits/types/struct___pthread_once.h
@@ -0,0 +1,33 @@
+/* Dynamic package initialization data structures. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_ONCE_H
+#define _BITS_TYPES_STRUCT___PTHREAD_ONCE_H 1
+
+#include <bits/types/__pthread_spinlock_t.h>
+
+struct __pthread_once
+{
+ int __run;
+ __pthread_spinlock_t __lock;
+};
+
+#define __PTHREAD_ONCE_INIT \
+ (struct __pthread_once) { 0, __PTHREAD_SPIN_LOCK_INITIALIZER }
+
+#endif /* bits/types/struct___pthread_once.h */
diff --git a/sysdeps/htl/bits/types/struct___pthread_rwlock.h b/sysdeps/htl/bits/types/struct___pthread_rwlock.h
new file mode 100644
index 0000000000..8bac46a28a
--- /dev/null
+++ b/sysdeps/htl/bits/types/struct___pthread_rwlock.h
@@ -0,0 +1,45 @@
+/* rwlock type. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_RWLOCK_H
+#define _BITS_TYPES_STRUCT___PTHREAD_RWLOCK_H
+
+#include <bits/types/__pthread_spinlock_t.h>
+
+/* User visible part of a rwlock. If __held is not held and readers
+ is 0, then the lock is unlocked. If __held is held and readers is
+ 0, then the lock is held by a writer. If __held is held and
+ readers is greater than 0, then the lock is held by READERS
+ readers. */
+struct __pthread_rwlock
+{
+ __pthread_spinlock_t __held;
+ __pthread_spinlock_t __lock;
+ int __readers;
+ struct __pthread *__readerqueue;
+ struct __pthread *__writerqueue;
+ struct __pthread_rwlockattr *__attr;
+ void *__data;
+};
+
+/* Initializer for a rwlock. */
+#define __PTHREAD_RWLOCK_INITIALIZER \
+ { __PTHREAD_SPIN_LOCK_INITIALIZER, __PTHREAD_SPIN_LOCK_INITIALIZER, 0, 0, 0, 0, 0 }
+
+
+#endif /* bits/types/struct___pthread_rwlock.h */
diff --git a/sysdeps/htl/bits/types/struct___pthread_rwlockattr.h b/sysdeps/htl/bits/types/struct___pthread_rwlockattr.h
new file mode 100644
index 0000000000..8bafba6ac3
--- /dev/null
+++ b/sysdeps/htl/bits/types/struct___pthread_rwlockattr.h
@@ -0,0 +1,31 @@
+/* Thread rwlock attribute type. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_RWLOCKATTR_H
+#define _BITS_TYPES_STRUCT___PTHREAD_RWLOCKATTR_H 1
+
+enum __pthread_process_shared;
+
+/* This structure describes the attributes of a POSIX thread rwlock.
+ Note that not all of them are supported on all systems. */
+struct __pthread_rwlockattr
+{
+ enum __pthread_process_shared __pshared;
+};
+
+#endif /* bits/types/struct___pthread_rwlockattr.h */
diff --git a/sysdeps/htl/flockfile.c b/sysdeps/htl/flockfile.c
new file mode 100644
index 0000000000..f9df093767
--- /dev/null
+++ b/sysdeps/htl/flockfile.c
@@ -0,0 +1,31 @@
+/* Lock I/O stream. Hurd version.
+ Copyright (C) 2002-2018 Free Software 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 <libc-lock.h>
+
+
+void
+__flockfile (FILE *stream)
+{
+#ifdef SHARED
+ __libc_ptf_call (_IO_flockfile, (stream), 0);
+#endif
+}
+weak_alias (__flockfile, _IO_flockfile)
+weak_alias (__flockfile, flockfile)
diff --git a/sysdeps/htl/fork.h b/sysdeps/htl/fork.h
new file mode 100644
index 0000000000..f944a741ee
--- /dev/null
+++ b/sysdeps/htl/fork.h
@@ -0,0 +1,29 @@
+/* Register fork handlers. Generic version.
+ Copyright (C) 2002-2018 Free Software 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/>. */
+
+/* Function to call to unregister fork handlers. */
+extern void __unregister_atfork (void *dso_handle) attribute_hidden;
+#define UNREGISTER_ATFORK(dso_handle) __unregister_atfork (dso_handle)
+
+
+/* C library side function to register new fork handlers. */
+extern int __register_atfork (void (*__prepare) (void),
+ void (*__parent) (void),
+ void (*__child) (void),
+ void *dso_handle);
+libc_hidden_proto (__register_atfork)
diff --git a/sysdeps/htl/ftrylockfile.c b/sysdeps/htl/ftrylockfile.c
new file mode 100644
index 0000000000..7de42c7b3d
--- /dev/null
+++ b/sysdeps/htl/ftrylockfile.c
@@ -0,0 +1,35 @@
+/* Try locking I/O stream. Hurd version
+ Copyright (C) 2002-2018 Free Software 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 <pthread.h>
+#include <stdio.h>
+#include <stdio-lock.h>
+
+
+int
+__ftrylockfile (FILE *stream)
+{
+#ifdef SHARED
+ return __libc_ptf_call (_IO_ftrylockfile, (stream), 0);
+#else
+ return 0;
+#endif
+}
+weak_alias (__ftrylockfile, _IO_ftrylockfile)
+weak_alias (__ftrylockfile, ftrylockfile)
diff --git a/sysdeps/htl/funlockfile.c b/sysdeps/htl/funlockfile.c
new file mode 100644
index 0000000000..bc7da12c34
--- /dev/null
+++ b/sysdeps/htl/funlockfile.c
@@ -0,0 +1,32 @@
+/* Unlock I/O stream. Hurd version.
+ Copyright (C) 2002-2018 Free Software 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 <stdio.h>
+#include <stdio-lock.h>
+
+
+void
+__funlockfile (FILE *stream)
+{
+#ifdef SHARED
+ __libc_ptf_call (_IO_funlockfile, (stream), 0);
+#endif
+}
+weak_alias (__funlockfile, _IO_funlockfile)
+weak_alias (__funlockfile, funlockfile)
diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h
new file mode 100644
index 0000000000..944c0e5931
--- /dev/null
+++ b/sysdeps/htl/libc-lockP.h
@@ -0,0 +1,180 @@
+/* Private libc-internal interface for mutex locks.
+ Copyright (C) 2015-2018 Free Software 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 _BITS_LIBC_LOCKP_H
+#define _BITS_LIBC_LOCKP_H 1
+
+#include <pthread.h>
+#include <pthread-functions.h>
+
+/* Type for key to thread-specific data. */
+typedef pthread_key_t __libc_key_t;
+
+/* If we check for a weakly referenced symbol and then perform a
+ normal jump to it te code generated for some platforms in case of
+ PIC is unnecessarily slow. What would happen is that the function
+ is first referenced as data and then it is called indirectly
+ through the PLT. We can make this a direct jump. */
+#ifdef __PIC__
+# define __libc_maybe_call(FUNC, ARGS, ELSE) \
+ (__extension__ ({ __typeof (FUNC) *_fn = (FUNC); \
+ _fn != NULL ? (*_fn) ARGS : ELSE; }))
+#else
+# define __libc_maybe_call(FUNC, ARGS, ELSE) \
+ (FUNC != NULL ? FUNC ARGS : ELSE)
+#endif
+
+/* Call thread functions through the function pointer table. */
+#if defined SHARED && IS_IN (libc)
+# define PTFAVAIL(NAME) __libc_pthread_functions_init
+# define __libc_ptf_call(FUNC, ARGS, ELSE) \
+ (__libc_pthread_functions_init ? PTHFCT_CALL (ptr_##FUNC, ARGS) : ELSE)
+# define __libc_ptf_call_always(FUNC, ARGS) \
+ PTHFCT_CALL (ptr_##FUNC, ARGS)
+#elif IS_IN (libpthread)
+# define PTFAVAIL(NAME) 1
+# define __libc_ptf_call(FUNC, ARGS, ELSE) \
+ FUNC ARGS
+# define __libc_ptf_call_always(FUNC, ARGS) \
+ FUNC ARGS
+#else
+# define PTFAVAIL(NAME) (NAME != NULL)
+# define __libc_ptf_call(FUNC, ARGS, ELSE) \
+ __libc_maybe_call (FUNC, ARGS, ELSE)
+# define __libc_ptf_call_always(FUNC, ARGS) \
+ FUNC ARGS
+#endif
+
+/* Create thread-specific key. */
+#define __libc_key_create(KEY, DESTRUCTOR) \
+ __libc_ptf_call (__pthread_key_create, (KEY, DESTRUCTOR), 1)
+
+/* Get thread-specific data. */
+#define __libc_getspecific(KEY) \
+ __libc_ptf_call (__pthread_getspecific, (KEY), NULL)
+
+/* Set thread-specific data. */
+#define __libc_setspecific(KEY, VALUE) \
+ __libc_ptf_call (__pthread_setspecific, (KEY, VALUE), 0)
+
+
+/* Functions that are used by this file and are internal to the GNU C
+ library. */
+
+extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
+ const pthread_mutexattr_t *__mutex_attr);
+
+extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr);
+
+extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr);
+
+extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr,
+ int __kind);
+
+extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock,
+ const pthread_rwlockattr_t *__attr);
+
+extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_key_create (pthread_key_t *__key,
+ void (*__destr_function) (void *));
+
+extern int __pthread_setspecific (pthread_key_t __key,
+ const void *__pointer);
+
+extern void *__pthread_getspecific (pthread_key_t __key);
+
+extern int __pthread_once (pthread_once_t *__once_control,
+ void (*__init_routine) (void));
+
+extern int __pthread_atfork (void (*__prepare) (void),
+ void (*__parent) (void),
+ void (*__child) (void));
+
+
+
+/* Make the pthread functions weak so that we can elide them from
+ single-threaded processes. */
+#if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread)
+# ifdef weak_extern
+weak_extern (__pthread_mutex_init)
+weak_extern (__pthread_mutex_destroy)
+weak_extern (__pthread_mutex_lock)
+weak_extern (__pthread_mutex_trylock)
+weak_extern (__pthread_mutex_unlock)
+weak_extern (__pthread_mutexattr_init)
+weak_extern (__pthread_mutexattr_destroy)
+weak_extern (__pthread_mutexattr_settype)
+weak_extern (__pthread_rwlock_init)
+weak_extern (__pthread_rwlock_destroy)
+weak_extern (__pthread_rwlock_rdlock)
+weak_extern (__pthread_rwlock_tryrdlock)
+weak_extern (__pthread_rwlock_wrlock)
+weak_extern (__pthread_rwlock_trywrlock)
+weak_extern (__pthread_rwlock_unlock)
+weak_extern (__pthread_key_create)
+weak_extern (__pthread_setspecific)
+weak_extern (__pthread_getspecific)
+weak_extern (__pthread_once)
+weak_extern (__pthread_initialize)
+weak_extern (__pthread_atfork)
+weak_extern (__pthread_setcancelstate)
+# else
+# pragma weak __pthread_mutex_init
+# pragma weak __pthread_mutex_destroy
+# pragma weak __pthread_mutex_lock
+# pragma weak __pthread_mutex_trylock
+# pragma weak __pthread_mutex_unlock
+# pragma weak __pthread_mutexattr_init
+# pragma weak __pthread_mutexattr_destroy
+# pragma weak __pthread_mutexattr_settype
+# pragma weak __pthread_rwlock_destroy
+# pragma weak __pthread_rwlock_rdlock
+# pragma weak __pthread_rwlock_tryrdlock
+# pragma weak __pthread_rwlock_wrlock
+# pragma weak __pthread_rwlock_trywrlock
+# pragma weak __pthread_rwlock_unlock
+# pragma weak __pthread_key_create
+# pragma weak __pthread_setspecific
+# pragma weak __pthread_getspecific
+# pragma weak __pthread_once
+# pragma weak __pthread_initialize
+# pragma weak __pthread_atfork
+# pragma weak __pthread_setcancelstate
+# endif
+#endif
+
+#endif /* bits/libc-lockP.h */
diff --git a/sysdeps/htl/old_pt-atfork.c b/sysdeps/htl/old_pt-atfork.c
new file mode 100644
index 0000000000..f1d177867a
--- /dev/null
+++ b/sysdeps/htl/old_pt-atfork.c
@@ -0,0 +1,26 @@
+/* Register fork handlers. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <shlib-compat.h>
+
+#if SHLIB_COMPAT(libpthread, GLIBC_2_12, GLIBC_2_23)
+# define pthread_atfork __dyn_pthread_atfork
+# include "pt-atfork.c"
+# undef pthread_atfork
+compat_symbol (libpthread, __dyn_pthread_atfork, pthread_atfork, GLIBC_2_12);
+#endif
diff --git a/sysdeps/htl/pt-atfork.c b/sysdeps/htl/pt-atfork.c
new file mode 100644
index 0000000000..0d308bd8db
--- /dev/null
+++ b/sysdeps/htl/pt-atfork.c
@@ -0,0 +1,33 @@
+/* Register fork handlers. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+#include <fork.h>
+
+/* This is defined by newer gcc version unique for each module. */
+extern void *__dso_handle __attribute__ ((__weak__, __visibility__ ("hidden")));
+
+int
+pthread_atfork (void (*prepare) (void),
+ void (*parent) (void),
+ void (*child) (void))
+{
+ return __register_atfork (prepare, parent, child,
+ &__dso_handle == NULL ? NULL : __dso_handle);
+}
diff --git a/sysdeps/htl/pt-attr-destroy.c b/sysdeps/htl/pt-attr-destroy.c
new file mode 100644
index 0000000000..46b4dab299
--- /dev/null
+++ b/sysdeps/htl/pt-attr-destroy.c
@@ -0,0 +1,27 @@
+/* pthread_attr_destroy. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_destroy (pthread_attr_t *attr)
+{
+ return 0;
+}
+strong_alias (__pthread_attr_destroy, pthread_attr_destroy);
diff --git a/sysdeps/htl/pt-attr-getdetachstate.c b/sysdeps/htl/pt-attr-getdetachstate.c
new file mode 100644
index 0000000000..cb6fca7143
--- /dev/null
+++ b/sysdeps/htl/pt-attr-getdetachstate.c
@@ -0,0 +1,29 @@
+/* pthread_attr_getdetachstate. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate)
+{
+ *detachstate = attr->__detachstate;
+ return 0;
+}
+
+strong_alias (__pthread_attr_getdetachstate, pthread_attr_getdetachstate);
diff --git a/sysdeps/htl/pt-attr-getguardsize.c b/sysdeps/htl/pt-attr-getguardsize.c
new file mode 100644
index 0000000000..9dcffe7278
--- /dev/null
+++ b/sysdeps/htl/pt-attr-getguardsize.c
@@ -0,0 +1,27 @@
+/* pthread_attr_getguardsize. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_attr_getguardsize (const pthread_attr_t *attr, size_t * guardsize)
+{
+ *guardsize = attr->__guardsize;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-attr-getinheritsched.c b/sysdeps/htl/pt-attr-getinheritsched.c
new file mode 100644
index 0000000000..f36491d8f8
--- /dev/null
+++ b/sysdeps/htl/pt-attr-getinheritsched.c
@@ -0,0 +1,29 @@
+/* pthread_attr_getinheritsched. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_getinheritsched (const pthread_attr_t *attr, int *inheritsched)
+{
+ *inheritsched = attr->__inheritsched;
+ return 0;
+}
+
+strong_alias (__pthread_attr_getinheritsched, pthread_attr_getinheritsched);
diff --git a/sysdeps/htl/pt-attr-getschedparam.c b/sysdeps/htl/pt-attr-getschedparam.c
new file mode 100644
index 0000000000..a7cf7edee8
--- /dev/null
+++ b/sysdeps/htl/pt-attr-getschedparam.c
@@ -0,0 +1,33 @@
+/* pthread_attr_getschedparam. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <sched.h>
+#include <string.h>
+
+#include <pt-internal.h>
+
+int
+__pthread_attr_getschedparam (const pthread_attr_t *attr,
+ struct sched_param *param)
+{
+ memcpy (param, &attr->__schedparam, sizeof *param);
+ return 0;
+}
+
+strong_alias (__pthread_attr_getschedparam, pthread_attr_getschedparam);
diff --git a/sysdeps/htl/pt-attr-getschedpolicy.c b/sysdeps/htl/pt-attr-getschedpolicy.c
new file mode 100644
index 0000000000..708a100f8b
--- /dev/null
+++ b/sysdeps/htl/pt-attr-getschedpolicy.c
@@ -0,0 +1,29 @@
+/* pthread_attr_getschedpolicy. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy)
+{
+ *policy = attr->__schedpolicy;
+ return 0;
+}
+
+strong_alias (__pthread_attr_getschedpolicy, pthread_attr_getschedpolicy);
diff --git a/sysdeps/htl/pt-attr-getscope.c b/sysdeps/htl/pt-attr-getscope.c
new file mode 100644
index 0000000000..80d2060922
--- /dev/null
+++ b/sysdeps/htl/pt-attr-getscope.c
@@ -0,0 +1,29 @@
+/* pthread_attr_getscope. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_getscope (const pthread_attr_t *attr, int *contentionscope)
+{
+ *contentionscope = attr->__contentionscope;
+ return 0;
+}
+
+strong_alias (__pthread_attr_getscope, pthread_attr_getscope);
diff --git a/sysdeps/htl/pt-attr-getstack.c b/sysdeps/htl/pt-attr-getstack.c
new file mode 100644
index 0000000000..6d8b286889
--- /dev/null
+++ b/sysdeps/htl/pt-attr-getstack.c
@@ -0,0 +1,31 @@
+/* pthread_attr_getstack. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+#include <pthreadP.h>
+
+int
+__pthread_attr_getstack (const pthread_attr_t *attr,
+ void **stackaddr, size_t * stacksize)
+{
+ __pthread_attr_getstackaddr (attr, stackaddr);
+ __pthread_attr_getstacksize (attr, stacksize);
+ return 0;
+}
+weak_alias (__pthread_attr_getstack, pthread_attr_getstack)
diff --git a/sysdeps/htl/pt-attr-getstackaddr.c b/sysdeps/htl/pt-attr-getstackaddr.c
new file mode 100644
index 0000000000..6f2507a0c1
--- /dev/null
+++ b/sysdeps/htl/pt-attr-getstackaddr.c
@@ -0,0 +1,28 @@
+/* pthread_attr_getstackaddr. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_getstackaddr (const pthread_attr_t *attr, void **stackaddr)
+{
+ *stackaddr = attr->__stackaddr;
+ return 0;
+}
+strong_alias (__pthread_attr_getstackaddr, pthread_attr_getstackaddr)
diff --git a/sysdeps/htl/pt-attr-getstacksize.c b/sysdeps/htl/pt-attr-getstacksize.c
new file mode 100644
index 0000000000..824d363538
--- /dev/null
+++ b/sysdeps/htl/pt-attr-getstacksize.c
@@ -0,0 +1,28 @@
+/* pthread_attr_getstacksize. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_getstacksize (const pthread_attr_t *attr, size_t * stacksize)
+{
+ *stacksize = attr->__stacksize;
+ return 0;
+}
+strong_alias (__pthread_attr_getstacksize, pthread_attr_getstacksize)
diff --git a/sysdeps/htl/pt-attr-init.c b/sysdeps/htl/pt-attr-init.c
new file mode 100644
index 0000000000..e996a98bee
--- /dev/null
+++ b/sysdeps/htl/pt-attr-init.c
@@ -0,0 +1,28 @@
+/* pthread_attr_init. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_init (pthread_attr_t *attr)
+{
+ *attr = __pthread_default_attr;
+ return 0;
+}
+strong_alias (__pthread_attr_init, pthread_attr_init);
diff --git a/sysdeps/htl/pt-attr-setdetachstate.c b/sysdeps/htl/pt-attr-setdetachstate.c
new file mode 100644
index 0000000000..5eb2e75a5d
--- /dev/null
+++ b/sysdeps/htl/pt-attr-setdetachstate.c
@@ -0,0 +1,38 @@
+/* pthread_attr_setdetachstate. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate)
+{
+ switch (detachstate)
+ {
+ case PTHREAD_CREATE_DETACHED:
+ case PTHREAD_CREATE_JOINABLE:
+ attr->__detachstate = detachstate;
+ break;
+ default:
+ return EINVAL;
+ }
+
+ return 0;
+}
+
+strong_alias (__pthread_attr_setdetachstate, pthread_attr_setdetachstate);
diff --git a/sysdeps/htl/pt-attr-setguardsize.c b/sysdeps/htl/pt-attr-setguardsize.c
new file mode 100644
index 0000000000..d067910703
--- /dev/null
+++ b/sysdeps/htl/pt-attr-setguardsize.c
@@ -0,0 +1,27 @@
+/* pthread_attr_setguardsize. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_attr_setguardsize (pthread_attr_t *attr, size_t guardsize)
+{
+ attr->__guardsize = guardsize;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-attr-setinheritsched.c b/sysdeps/htl/pt-attr-setinheritsched.c
new file mode 100644
index 0000000000..a72d87f795
--- /dev/null
+++ b/sysdeps/htl/pt-attr-setinheritsched.c
@@ -0,0 +1,38 @@
+/* pthread_attr_setinheritsched. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched)
+{
+ switch (inheritsched)
+ {
+ case PTHREAD_INHERIT_SCHED:
+ case PTHREAD_EXPLICIT_SCHED:
+ attr->__inheritsched = inheritsched;
+ break;
+ default:
+ return EINVAL;
+ }
+
+ return 0;
+}
+
+strong_alias (__pthread_attr_setinheritsched, pthread_attr_setinheritsched);
diff --git a/sysdeps/htl/pt-attr-setschedparam.c b/sysdeps/htl/pt-attr-setschedparam.c
new file mode 100644
index 0000000000..e6494d47df
--- /dev/null
+++ b/sysdeps/htl/pt-attr-setschedparam.c
@@ -0,0 +1,38 @@
+/* pthread_attr_getschedparam. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <sched.h>
+#include <string.h>
+
+#include <pt-internal.h>
+
+int
+__pthread_attr_setschedparam (pthread_attr_t *attr,
+ const struct sched_param *param)
+{
+ if (memcmp (param, &__pthread_default_attr.__schedparam, sizeof *param) == 0)
+ {
+ memcpy (&attr->__schedparam, param, sizeof *param);
+ return 0;
+ }
+
+ return ENOTSUP;
+}
+
+strong_alias (__pthread_attr_setschedparam, pthread_attr_setschedparam);
diff --git a/sysdeps/htl/pt-attr-setschedpolicy.c b/sysdeps/htl/pt-attr-setschedpolicy.c
new file mode 100644
index 0000000000..9c20ceef16
--- /dev/null
+++ b/sysdeps/htl/pt-attr-setschedpolicy.c
@@ -0,0 +1,42 @@
+/* pthread_attr_getschedpolicy. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy)
+{
+ switch (policy)
+ {
+ case SCHED_OTHER:
+ attr->__schedpolicy = policy;
+ break;
+
+ case SCHED_FIFO:
+ case SCHED_RR:
+ return ENOTSUP;
+
+ default:
+ return EINVAL;
+ }
+
+ return 0;
+}
+
+strong_alias (__pthread_attr_setschedpolicy, pthread_attr_setschedpolicy);
diff --git a/sysdeps/htl/pt-attr-setscope.c b/sysdeps/htl/pt-attr-setscope.c
new file mode 100644
index 0000000000..8884009d6b
--- /dev/null
+++ b/sysdeps/htl/pt-attr-setscope.c
@@ -0,0 +1,41 @@
+/* pthread_attr_setscope. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_setscope (pthread_attr_t *attr, int contentionscope)
+{
+ if (contentionscope == __pthread_default_attr.__contentionscope)
+ {
+ attr->__contentionscope = contentionscope;
+ return 0;
+ }
+
+ switch (contentionscope)
+ {
+ case PTHREAD_SCOPE_PROCESS:
+ case PTHREAD_SCOPE_SYSTEM:
+ return ENOTSUP;
+ default:
+ return EINVAL;
+ }
+}
+
+strong_alias (__pthread_attr_setscope, pthread_attr_setscope);
diff --git a/sysdeps/htl/pt-attr-setstack.c b/sysdeps/htl/pt-attr-setstack.c
new file mode 100644
index 0000000000..f18025b264
--- /dev/null
+++ b/sysdeps/htl/pt-attr-setstack.c
@@ -0,0 +1,50 @@
+/* pthread_attr_setstack. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <assert.h>
+
+#include <pt-internal.h>
+#include <pthreadP.h>
+
+int
+__pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, size_t stacksize)
+{
+ int err;
+ size_t s;
+
+ /* pthread_attr_setstack should always succeed, thus we set the size
+ first as it is more discriminating. */
+ __pthread_attr_getstacksize (attr, &s);
+
+ err = __pthread_attr_setstacksize (attr, stacksize);
+ if (err)
+ return err;
+
+ err = __pthread_attr_setstackaddr (attr, stackaddr);
+ if (err)
+ {
+ int e = __pthread_attr_setstacksize (attr, s);
+ assert_perror (e);
+
+ return err;
+ }
+
+ return 0;
+}
+strong_alias (__pthread_attr_setstack, pthread_attr_setstack)
diff --git a/sysdeps/htl/pt-attr-setstackaddr.c b/sysdeps/htl/pt-attr-setstackaddr.c
new file mode 100644
index 0000000000..491005bcc1
--- /dev/null
+++ b/sysdeps/htl/pt-attr-setstackaddr.c
@@ -0,0 +1,28 @@
+/* pthread_attr_setstackaddr. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr)
+{
+ attr->__stackaddr = stackaddr;
+ return 0;
+}
+strong_alias (__pthread_attr_setstackaddr, pthread_attr_setstackaddr)
diff --git a/sysdeps/htl/pt-attr-setstacksize.c b/sysdeps/htl/pt-attr-setstacksize.c
new file mode 100644
index 0000000000..38bec3f7c7
--- /dev/null
+++ b/sysdeps/htl/pt-attr-setstacksize.c
@@ -0,0 +1,28 @@
+/* pthread_attr_setstacksize. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize)
+{
+ attr->__stacksize = stacksize;
+ return 0;
+}
+strong_alias (__pthread_attr_setstacksize, pthread_attr_setstacksize)
diff --git a/sysdeps/htl/pt-attr.c b/sysdeps/htl/pt-attr.c
new file mode 100644
index 0000000000..77ecc73465
--- /dev/null
+++ b/sysdeps/htl/pt-attr.c
@@ -0,0 +1,39 @@
+/* Default attributes. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <sched.h>
+#include <stddef.h>
+#include <limits.h>
+
+#include <pt-internal.h>
+
+const struct __pthread_attr __pthread_default_attr = {
+ __schedparam: { sched_priority: 0 },
+ __stacksize: 0,
+ __stackaddr: NULL,
+#ifdef PAGESIZE
+ __guardsize: PAGESIZE,
+#else
+ __guardsize: 1,
+#endif /* PAGESIZE */
+ __detachstate: PTHREAD_CREATE_JOINABLE,
+ __inheritsched: PTHREAD_EXPLICIT_SCHED,
+ __contentionscope: PTHREAD_SCOPE_SYSTEM,
+ __schedpolicy: SCHED_OTHER
+};
diff --git a/sysdeps/htl/pt-barrier-destroy.c b/sysdeps/htl/pt-barrier-destroy.c
new file mode 100644
index 0000000000..77b156b059
--- /dev/null
+++ b/sysdeps/htl/pt-barrier-destroy.c
@@ -0,0 +1,26 @@
+/* pthread_barrier_destroy. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_barrier_destroy (pthread_barrier_t *barrier)
+{
+ return 0;
+}
diff --git a/sysdeps/htl/pt-barrier-init.c b/sysdeps/htl/pt-barrier-init.c
new file mode 100644
index 0000000000..7d46624fbe
--- /dev/null
+++ b/sysdeps/htl/pt-barrier-init.c
@@ -0,0 +1,51 @@
+/* pthread_barrier_init. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <string.h>
+#include <assert.h>
+
+#include <pt-internal.h>
+
+int
+pthread_barrier_init (pthread_barrier_t *barrier,
+ const pthread_barrierattr_t *attr, unsigned count)
+{
+ if (count == 0)
+ return EINVAL;
+
+ memset (barrier, 0, sizeof *barrier);
+
+ barrier->__lock = PTHREAD_SPINLOCK_INITIALIZER;
+ barrier->__pending = count;
+ barrier->__count = count;
+
+ if (attr == NULL
+ || memcmp (attr, &__pthread_default_barrierattr, sizeof (*attr) == 0))
+ /* Use the default attributes. */
+ return 0;
+
+ /* Non-default attributes. */
+
+ barrier->__attr = malloc (sizeof *attr);
+ if (barrier->__attr == NULL)
+ return ENOMEM;
+
+ *barrier->__attr = *attr;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-barrier-wait.c b/sysdeps/htl/pt-barrier-wait.c
new file mode 100644
index 0000000000..a9565c9805
--- /dev/null
+++ b/sysdeps/htl/pt-barrier-wait.c
@@ -0,0 +1,68 @@
+/* pthread_barrier_wait. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <assert.h>
+
+#include <pt-internal.h>
+
+int
+pthread_barrier_wait (pthread_barrier_t *barrier)
+{
+ __pthread_spin_lock (&barrier->__lock);
+ if (--barrier->__pending == 0)
+ {
+ barrier->__pending = barrier->__count;
+
+ if (barrier->__count > 1)
+ {
+ struct __pthread *wakeup;
+ unsigned n = 0;
+
+ __pthread_queue_iterate (barrier->__queue, wakeup)
+ n++;
+
+ {
+ struct __pthread *wakeups[n];
+ unsigned i = 0;
+
+ __pthread_dequeuing_iterate (barrier->__queue, wakeup)
+ wakeups[i++] = wakeup;
+
+ barrier->__queue = NULL;
+ __pthread_spin_unlock (&barrier->__lock);
+
+ for (i = 0; i < n; i++)
+ __pthread_wakeup (wakeups[i]);
+ }
+ }
+
+ return PTHREAD_BARRIER_SERIAL_THREAD;
+ }
+ else
+ {
+ struct __pthread *self = _pthread_self ();
+
+ /* Add ourselves to the list of waiters. */
+ __pthread_enqueue (&barrier->__queue, self);
+ __pthread_spin_unlock (&barrier->__lock);
+
+ __pthread_block (self);
+ return 0;
+ }
+}
diff --git a/sysdeps/htl/pt-barrier.c b/sysdeps/htl/pt-barrier.c
new file mode 100644
index 0000000000..f9d25e8b29
--- /dev/null
+++ b/sysdeps/htl/pt-barrier.c
@@ -0,0 +1,24 @@
+/* Default barrier attributes. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+const struct __pthread_barrierattr __pthread_default_barrierattr = {
+ __pshared: PTHREAD_PROCESS_PRIVATE
+};
diff --git a/sysdeps/htl/pt-barrierattr-destroy.c b/sysdeps/htl/pt-barrierattr-destroy.c
new file mode 100644
index 0000000000..5c179fd78d
--- /dev/null
+++ b/sysdeps/htl/pt-barrierattr-destroy.c
@@ -0,0 +1,26 @@
+/* pthread_barrierattr_destroy. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_barrierattr_destroy (pthread_barrierattr_t *attr)
+{
+ return 0;
+}
diff --git a/sysdeps/htl/pt-barrierattr-getpshared.c b/sysdeps/htl/pt-barrierattr-getpshared.c
new file mode 100644
index 0000000000..5f259c5b31
--- /dev/null
+++ b/sysdeps/htl/pt-barrierattr-getpshared.c
@@ -0,0 +1,28 @@
+/* pthread_barrierattr_getpshared. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_barrierattr_getpshared (const pthread_barrierattr_t *attr,
+ int *pshared)
+{
+ *pshared = attr->__pshared;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-barrierattr-init.c b/sysdeps/htl/pt-barrierattr-init.c
new file mode 100644
index 0000000000..38e36d9dfd
--- /dev/null
+++ b/sysdeps/htl/pt-barrierattr-init.c
@@ -0,0 +1,27 @@
+/* pthread_barrierattr_init. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_barrierattr_init (pthread_barrierattr_t *attr)
+{
+ *attr = __pthread_default_barrierattr;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-barrierattr-setpshared.c b/sysdeps/htl/pt-barrierattr-setpshared.c
new file mode 100644
index 0000000000..c3aed869ca
--- /dev/null
+++ b/sysdeps/htl/pt-barrierattr-setpshared.c
@@ -0,0 +1,37 @@
+/* pthread_barrierattr_setpshared. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, int pshared)
+{
+ switch (pshared)
+ {
+ case PTHREAD_PROCESS_PRIVATE:
+ attr->__pshared = pshared;
+ return 0;
+
+ case PTHREAD_PROCESS_SHARED:
+ return ENOTSUP;
+
+ default:
+ return EINVAL;
+ }
+}
diff --git a/sysdeps/htl/pt-cond-brdcast.c b/sysdeps/htl/pt-cond-brdcast.c
new file mode 100644
index 0000000000..129fb0466b
--- /dev/null
+++ b/sysdeps/htl/pt-cond-brdcast.c
@@ -0,0 +1,44 @@
+/* Broadcast a condition. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <pt-internal.h>
+
+/* Unblock all threads that are blocked on condition variable COND. */
+int
+__pthread_cond_broadcast (pthread_cond_t *cond)
+{
+ struct __pthread *wakeup;
+
+ __pthread_spin_lock (&cond->__lock);
+ while ((wakeup = cond->__queue))
+ {
+ __pthread_dequeue (wakeup);
+ __pthread_spin_unlock (&cond->__lock);
+ /* Wake it up without spin held, so it may have a chance to really
+ preempt us */
+ __pthread_wakeup (wakeup);
+ __pthread_spin_lock (&cond->__lock);
+ }
+ __pthread_spin_unlock (&cond->__lock);
+
+ return 0;
+}
+
+strong_alias (__pthread_cond_broadcast, pthread_cond_broadcast);
diff --git a/sysdeps/htl/pt-cond-destroy.c b/sysdeps/htl/pt-cond-destroy.c
new file mode 100644
index 0000000000..b78853d1aa
--- /dev/null
+++ b/sysdeps/htl/pt-cond-destroy.c
@@ -0,0 +1,28 @@
+/* pthread_cond_destroy. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_cond_destroy (pthread_cond_t *cond)
+{
+ return 0;
+}
+
+strong_alias (__pthread_cond_destroy, pthread_cond_destroy);
diff --git a/sysdeps/htl/pt-cond-init.c b/sysdeps/htl/pt-cond-init.c
new file mode 100644
index 0000000000..4c112e2789
--- /dev/null
+++ b/sysdeps/htl/pt-cond-init.c
@@ -0,0 +1,45 @@
+/* pthread_cond_init. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <assert.h>
+#include <string.h>
+
+#include <pt-internal.h>
+
+int
+__pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t * attr)
+{
+ *cond = (pthread_cond_t) __PTHREAD_COND_INITIALIZER;
+
+ if (attr == NULL
+ || memcmp (attr, &__pthread_default_condattr, sizeof (*attr) == 0))
+ /* Use the default attributes. */
+ return 0;
+
+ /* Non-default attributes. */
+
+ cond->__attr = malloc (sizeof *attr);
+ if (cond->__attr == NULL)
+ return ENOMEM;
+
+ *cond->__attr = *attr;
+ return 0;
+}
+
+strong_alias (__pthread_cond_init, pthread_cond_init);
diff --git a/sysdeps/htl/pt-cond-signal.c b/sysdeps/htl/pt-cond-signal.c
new file mode 100644
index 0000000000..3fae03d33b
--- /dev/null
+++ b/sysdeps/htl/pt-cond-signal.c
@@ -0,0 +1,42 @@
+/* Signal a condition. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <pt-internal.h>
+
+/* Unblock at least one of the threads that are blocked on condition
+ variable COND. */
+int
+__pthread_cond_signal (pthread_cond_t *cond)
+{
+ struct __pthread *wakeup;
+
+ __pthread_spin_lock (&cond->__lock);
+ wakeup = cond->__queue;
+ if (wakeup != NULL)
+ __pthread_dequeue (wakeup);
+ __pthread_spin_unlock (&cond->__lock);
+
+ if (wakeup != NULL)
+ __pthread_wakeup (wakeup);
+
+ return 0;
+}
+
+strong_alias (__pthread_cond_signal, pthread_cond_signal);
diff --git a/sysdeps/htl/pt-cond-timedwait.c b/sysdeps/htl/pt-cond-timedwait.c
new file mode 100644
index 0000000000..66051af417
--- /dev/null
+++ b/sysdeps/htl/pt-cond-timedwait.c
@@ -0,0 +1,178 @@
+/* Wait on a condition. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <pt-internal.h>
+#include <pthreadP.h>
+
+extern int __pthread_cond_timedwait_internal (pthread_cond_t *cond,
+ pthread_mutex_t *mutex,
+ const struct timespec *abstime);
+
+int
+__pthread_cond_timedwait (pthread_cond_t *cond,
+ pthread_mutex_t *mutex,
+ const struct timespec *abstime)
+{
+ return __pthread_cond_timedwait_internal (cond, mutex, abstime);
+}
+
+strong_alias (__pthread_cond_timedwait, pthread_cond_timedwait);
+
+struct cancel_ctx
+{
+ struct __pthread *wakeup;
+ pthread_cond_t *cond;
+};
+
+static void
+cancel_hook (void *arg)
+{
+ struct cancel_ctx *ctx = arg;
+ struct __pthread *wakeup = ctx->wakeup;
+ pthread_cond_t *cond = ctx->cond;
+ int unblock;
+
+ __pthread_spin_lock (&cond->__lock);
+ /* The thread only needs to be awaken if it's blocking or about to block.
+ If it was already unblocked, it's not queued any more. */
+ unblock = wakeup->prevp != NULL;
+ if (unblock)
+ __pthread_dequeue (wakeup);
+ __pthread_spin_unlock (&cond->__lock);
+
+ if (unblock)
+ __pthread_wakeup (wakeup);
+}
+
+/* Block on condition variable COND until ABSTIME. As a GNU
+ extension, if ABSTIME is NULL, then wait forever. MUTEX should be
+ held by the calling thread. On return, MUTEX will be held by the
+ calling thread. */
+int
+__pthread_cond_timedwait_internal (pthread_cond_t *cond,
+ pthread_mutex_t *mutex,
+ const struct timespec *abstime)
+{
+ error_t err;
+ int cancelled, oldtype, drain;
+ clockid_t clock_id = __pthread_default_condattr.__clock;
+
+ if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000))
+ return EINVAL;
+
+ struct __pthread *self = _pthread_self ();
+ struct cancel_ctx ctx;
+ ctx.wakeup = self;
+ ctx.cond = cond;
+
+ /* Test for a pending cancellation request, switch to deferred mode for
+ safer resource handling, and prepare the hook to call in case we're
+ cancelled while blocking. Once CANCEL_LOCK is released, the cancellation
+ hook can be called by another thread at any time. Whatever happens,
+ this function must exit with MUTEX locked.
+
+ This function contains inline implementations of pthread_testcancel and
+ pthread_setcanceltype to reduce locking overhead. */
+ __pthread_mutex_lock (&self->cancel_lock);
+ cancelled = (self->cancel_state == PTHREAD_CANCEL_ENABLE)
+ && self->cancel_pending;
+
+ if (!cancelled)
+ {
+ self->cancel_hook = cancel_hook;
+ self->cancel_hook_arg = &ctx;
+ oldtype = self->cancel_type;
+
+ if (oldtype != PTHREAD_CANCEL_DEFERRED)
+ self->cancel_type = PTHREAD_CANCEL_DEFERRED;
+
+ /* Add ourselves to the list of waiters. This is done while setting
+ the cancellation hook to simplify the cancellation procedure, i.e.
+ if the thread is queued, it can be cancelled, otherwise it is
+ already unblocked, progressing on the return path. */
+ __pthread_spin_lock (&cond->__lock);
+ __pthread_enqueue (&cond->__queue, self);
+ if (cond->__attr != NULL)
+ clock_id = cond->__attr->__clock;
+ __pthread_spin_unlock (&cond->__lock);
+ }
+ __pthread_mutex_unlock (&self->cancel_lock);
+
+ if (cancelled)
+ __pthread_exit (PTHREAD_CANCELED);
+
+ /* Release MUTEX before blocking. */
+ __pthread_mutex_unlock (mutex);
+
+ /* Block the thread. */
+ if (abstime != NULL)
+ err = __pthread_timedblock (self, abstime, clock_id);
+ else
+ {
+ err = 0;
+ __pthread_block (self);
+ }
+
+ __pthread_spin_lock (&cond->__lock);
+ if (self->prevp == NULL)
+ {
+ /* Another thread removed us from the list of waiters, which means a
+ wakeup message has been sent. It was either consumed while we were
+ blocking, or queued after we timed out and before we acquired the
+ condition lock, in which case the message queue must be drained. */
+ if (!err)
+ drain = 0;
+ else
+ {
+ assert (err == ETIMEDOUT);
+ drain = 1;
+ }
+ }
+ else
+ {
+ /* We're still in the list of waiters. Noone attempted to wake us up,
+ i.e. we timed out. */
+ assert (err == ETIMEDOUT);
+ __pthread_dequeue (self);
+ drain = 0;
+ }
+ __pthread_spin_unlock (&cond->__lock);
+
+ if (drain)
+ __pthread_block (self);
+
+ /* We're almost done. Remove the unblock hook, restore the previous
+ cancellation type, and check for a pending cancellation request. */
+ __pthread_mutex_lock (&self->cancel_lock);
+ self->cancel_hook = NULL;
+ self->cancel_hook_arg = NULL;
+ self->cancel_type = oldtype;
+ cancelled = (self->cancel_state == PTHREAD_CANCEL_ENABLE)
+ && self->cancel_pending;
+ __pthread_mutex_unlock (&self->cancel_lock);
+
+ /* Reacquire MUTEX before returning/cancelling. */
+ __pthread_mutex_lock (mutex);
+
+ if (cancelled)
+ __pthread_exit (PTHREAD_CANCELED);
+
+ return err;
+}
diff --git a/sysdeps/htl/pt-cond-wait.c b/sysdeps/htl/pt-cond-wait.c
new file mode 100644
index 0000000000..cc4b0d1af9
--- /dev/null
+++ b/sysdeps/htl/pt-cond-wait.c
@@ -0,0 +1,38 @@
+/* Wait on a condition. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <pt-internal.h>
+
+/* Implemented in pt-cond-timedwait.c. */
+extern int __pthread_cond_timedwait_internal (pthread_cond_t *cond,
+ pthread_mutex_t *mutex,
+ const struct timespec *abstime);
+
+
+/* Block on condition variable COND. MUTEX should be held by the
+ calling thread. On return, MUTEX will be held by the calling
+ thread. */
+int
+__pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)
+{
+ return __pthread_cond_timedwait_internal (cond, mutex, 0);
+}
+
+strong_alias (__pthread_cond_wait, pthread_cond_wait);
diff --git a/sysdeps/htl/pt-cond.c b/sysdeps/htl/pt-cond.c
new file mode 100644
index 0000000000..ec73549fa3
--- /dev/null
+++ b/sysdeps/htl/pt-cond.c
@@ -0,0 +1,27 @@
+/* Default condition attributes. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <time.h>
+
+#include <pt-internal.h>
+
+const struct __pthread_condattr __pthread_default_condattr = {
+ __pshared: PTHREAD_PROCESS_PRIVATE,
+ __clock: CLOCK_REALTIME
+};
diff --git a/sysdeps/htl/pt-condattr-destroy.c b/sysdeps/htl/pt-condattr-destroy.c
new file mode 100644
index 0000000000..19502fa6a5
--- /dev/null
+++ b/sysdeps/htl/pt-condattr-destroy.c
@@ -0,0 +1,28 @@
+/* pthread_condattr_destroy. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_condattr_destroy (pthread_condattr_t *cond)
+{
+ return 0;
+}
+
+strong_alias (__pthread_condattr_destroy, pthread_condattr_destroy);
diff --git a/sysdeps/htl/pt-condattr-getclock.c b/sysdeps/htl/pt-condattr-getclock.c
new file mode 100644
index 0000000000..023d007695
--- /dev/null
+++ b/sysdeps/htl/pt-condattr-getclock.c
@@ -0,0 +1,29 @@
+/* pthread_condattr_getclock. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <time.h>
+
+#include <pt-internal.h>
+
+int
+pthread_condattr_getclock (const pthread_condattr_t *attr, clockid_t * clock)
+{
+ *clock = attr->__clock;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-condattr-getpshared.c b/sysdeps/htl/pt-condattr-getpshared.c
new file mode 100644
index 0000000000..5351c38788
--- /dev/null
+++ b/sysdeps/htl/pt-condattr-getpshared.c
@@ -0,0 +1,27 @@
+/* pthread_condattr_getpshared. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared)
+{
+ *pshared = attr->__pshared;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-condattr-init.c b/sysdeps/htl/pt-condattr-init.c
new file mode 100644
index 0000000000..687f4d8b12
--- /dev/null
+++ b/sysdeps/htl/pt-condattr-init.c
@@ -0,0 +1,29 @@
+/* pthread_condattr_init. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_condattr_init (pthread_condattr_t *attr)
+{
+ *attr = __pthread_default_condattr;
+ return 0;
+}
+
+strong_alias (__pthread_condattr_init, pthread_condattr_init);
diff --git a/sysdeps/htl/pt-condattr-setclock.c b/sysdeps/htl/pt-condattr-setclock.c
new file mode 100644
index 0000000000..a6e37e6e5c
--- /dev/null
+++ b/sysdeps/htl/pt-condattr-setclock.c
@@ -0,0 +1,51 @@
+/* pthread_condattr_setclock. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t clock)
+{
+ /* Only a few clocks are allowed. CLOCK_REALTIME is always allowed.
+ CLOCK_MONOTONIC only if the kernel has the necessary support. */
+ if (clock == CLOCK_MONOTONIC)
+ {
+ /* Check whether the clock is available. */
+ static int avail;
+
+ if (avail == 0)
+ {
+ struct timespec ts;
+ int res;
+
+ res = clock_gettime (CLOCK_MONOTONIC, &ts);
+ avail = res < 0 ? -1 : 1;
+ }
+
+ if (avail < 0)
+ /* Not available. */
+ return EINVAL;
+ }
+ else if (clock != CLOCK_REALTIME)
+ return EINVAL;
+
+ attr->__clock = clock;
+
+ return 0;
+}
diff --git a/sysdeps/htl/pt-condattr-setpshared.c b/sysdeps/htl/pt-condattr-setpshared.c
new file mode 100644
index 0000000000..e1d3f682e3
--- /dev/null
+++ b/sysdeps/htl/pt-condattr-setpshared.c
@@ -0,0 +1,37 @@
+/* pthread_condattr_setpshared. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared)
+{
+ switch (pshared)
+ {
+ case PTHREAD_PROCESS_PRIVATE:
+ attr->__pshared = pshared;
+ return 0;
+
+ case PTHREAD_PROCESS_SHARED:
+ return ENOTSUP;
+
+ default:
+ return EINVAL;
+ }
+}
diff --git a/sysdeps/htl/pt-destroy-specific.c b/sysdeps/htl/pt-destroy-specific.c
new file mode 100644
index 0000000000..84f724abe2
--- /dev/null
+++ b/sysdeps/htl/pt-destroy-specific.c
@@ -0,0 +1,77 @@
+/* __pthread_destory_specific. Hurd version.
+ Copyright (C) 2002-2018 Free Software 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 <stdlib.h>
+
+#include <pt-internal.h>
+
+void
+__pthread_destroy_specific (struct __pthread *thread)
+{
+ int i;
+ int seen_one;
+
+ /* Check if there is any thread specific data. */
+ if (thread->thread_specifics == NULL)
+ return;
+
+ __pthread_key_lock_ready ();
+
+ /* Iterate and call the destructors on any thread specific data. */
+ for (;;)
+ {
+ seen_one = 0;
+
+ __pthread_mutex_lock (&__pthread_key_lock);
+
+ for (i = 0; i < __pthread_key_count && i < thread->thread_specifics_size;
+ i++)
+ {
+ void *value;
+
+ if (__pthread_key_destructors[i] == PTHREAD_KEY_INVALID)
+ continue;
+
+ value = thread->thread_specifics[i];
+ if (value != NULL)
+ {
+ thread->thread_specifics[i] = 0;
+
+ if (__pthread_key_destructors[i])
+ {
+ seen_one = 1;
+ __pthread_key_destructors[i] (value);
+ }
+ }
+ }
+
+ __pthread_mutex_unlock (&__pthread_key_lock);
+
+ if (!seen_one)
+ break;
+
+ /* This may take a very long time. Let those blocking on
+ pthread_key_create or pthread_key_delete make progress. */
+ sched_yield ();
+ }
+
+ free (thread->thread_specifics);
+ thread->thread_specifics = 0;
+ thread->thread_specifics_size = 0;
+}
diff --git a/sysdeps/htl/pt-equal.c b/sysdeps/htl/pt-equal.c
new file mode 100644
index 0000000000..e8391ebfb6
--- /dev/null
+++ b/sysdeps/htl/pt-equal.c
@@ -0,0 +1,30 @@
+/* Default attributes. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <pt-internal.h>
+
+/* Return true if __T1 and __T2 both name the same thread. Otherwise,
+ false. */
+int
+__pthread_equal (pthread_t __t1, pthread_t __t2)
+{
+ return __t1 == __t2;
+}
+
+strong_alias (__pthread_equal, pthread_equal);
diff --git a/sysdeps/htl/pt-getconcurrency.c b/sysdeps/htl/pt-getconcurrency.c
new file mode 100644
index 0000000000..95eba06ba2
--- /dev/null
+++ b/sysdeps/htl/pt-getconcurrency.c
@@ -0,0 +1,26 @@
+/* Get the current level of desired concurrency. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_getconcurrency (void)
+{
+ return __pthread_concurrency;
+}
diff --git a/sysdeps/htl/pt-getcpuclockid.c b/sysdeps/htl/pt-getcpuclockid.c
new file mode 100644
index 0000000000..e6cdeda70a
--- /dev/null
+++ b/sysdeps/htl/pt-getcpuclockid.c
@@ -0,0 +1,35 @@
+/* Return a thread's cpu clockid. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <time.h>
+
+#include <pt-internal.h>
+
+int
+pthread_getcpuclockid (pthread_t thread, clockid_t *clock)
+{
+#ifdef CLOCK_THREAD_CPUTIME_ID
+ *clock = CLOCK_THREAD_CPUTIME_ID;
+ return 0;
+#else
+ return ENOSYS;
+#endif
+}
+
+stub_warning (pthread_getcpuclockid)
diff --git a/sysdeps/htl/pt-getschedparam.c b/sysdeps/htl/pt-getschedparam.c
new file mode 100644
index 0000000000..92fb62ef53
--- /dev/null
+++ b/sysdeps/htl/pt-getschedparam.c
@@ -0,0 +1,31 @@
+/* Get the scheduling parameters for a thread. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_getschedparam (pthread_t thread, int *policy,
+ struct sched_param *param)
+{
+ *policy = SCHED_OTHER;
+ param->sched_priority = 0;
+ return 0;
+}
+
+strong_alias (__pthread_getschedparam, pthread_getschedparam);
diff --git a/sysdeps/htl/pt-getspecific.c b/sysdeps/htl/pt-getspecific.c
new file mode 100644
index 0000000000..a0227a67f6
--- /dev/null
+++ b/sysdeps/htl/pt-getspecific.c
@@ -0,0 +1,38 @@
+/* pthread_getspecific. Hurd version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+void *
+__pthread_getspecific (pthread_key_t key)
+{
+ struct __pthread *self;
+
+ if (key < 0 || key >= __pthread_key_count
+ || __pthread_key_destructors[key] == PTHREAD_KEY_INVALID)
+ return NULL;
+
+ self = _pthread_self ();
+ if (key >= self->thread_specifics_size)
+ return 0;
+
+ return self->thread_specifics[key];
+}
+strong_alias (__pthread_getspecific, pthread_getspecific);
diff --git a/sysdeps/htl/pt-init-specific.c b/sysdeps/htl/pt-init-specific.c
new file mode 100644
index 0000000000..bf0b5878db
--- /dev/null
+++ b/sysdeps/htl/pt-init-specific.c
@@ -0,0 +1,30 @@
+/* __pthread_init_specific. Hurd version.
+ Copyright (C) 2002-2018 Free Software 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 <stdlib.h>
+
+#include <pt-internal.h>
+
+error_t
+__pthread_init_specific (struct __pthread *thread)
+{
+ thread->thread_specifics = 0;
+ thread->thread_specifics_size = 0;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-key-create.c b/sysdeps/htl/pt-key-create.c
new file mode 100644
index 0000000000..a295bc78d9
--- /dev/null
+++ b/sysdeps/htl/pt-key-create.c
@@ -0,0 +1,110 @@
+/* pthread_key_create. Hurd version.
+ Copyright (C) 2002-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+
+#include <pt-internal.h>
+#include <pthreadP.h>
+
+pthread_mutex_t __pthread_key_lock;
+
+void (**__pthread_key_destructors) (void *arg);
+int __pthread_key_size;
+int __pthread_key_count;
+int __pthread_key_invalid_count;
+
+int
+__pthread_key_create (pthread_key_t *key, void (*destructor) (void *))
+{
+ /* Where to look for the next key slot. */
+ static int index;
+
+ __pthread_key_lock_ready ();
+
+ __pthread_mutex_lock (&__pthread_key_lock);
+
+do_search:
+ /* Use the search hint and try to find a free slot. */
+ for (; index < __pthread_key_count
+ && __pthread_key_destructors[index] != PTHREAD_KEY_INVALID; index++)
+ ;
+
+ /* See if we actually found a free element. */
+ if (index < __pthread_key_count)
+ {
+ assert (__pthread_key_destructors[index] == PTHREAD_KEY_INVALID);
+ assert (__pthread_key_invalid_count > 0);
+
+ __pthread_key_invalid_count--;
+ __pthread_key_destructors[index] = destructor;
+ *key = index++;
+
+ __pthread_mutex_unlock (&__pthread_key_lock);
+ return 0;
+ }
+
+ assert (index == __pthread_key_count);
+
+ /* No space at the end. */
+ if (__pthread_key_size == __pthread_key_count)
+ {
+ /* See if it is worth looking for a free element. */
+ if (__pthread_key_invalid_count > 4
+ && __pthread_key_invalid_count > __pthread_key_size / 8)
+ {
+ index = 0;
+ goto do_search;
+ }
+
+
+ /* Resize the array. */
+ {
+ void *t;
+ int newsize;
+
+ if (__pthread_key_size == 0)
+ newsize = 8;
+ else
+ newsize = __pthread_key_size * 2;
+
+ t = realloc (__pthread_key_destructors,
+ newsize * sizeof (*__pthread_key_destructors));
+ if (t == NULL)
+ {
+ __pthread_mutex_unlock (&__pthread_key_lock);
+ return ENOMEM;
+ }
+
+ __pthread_key_size = newsize;
+ __pthread_key_destructors = t;
+ }
+ }
+
+ __pthread_key_destructors[index] = destructor;
+ *key = index;
+
+ index++;
+ __pthread_key_count++;
+
+ __pthread_mutex_unlock (&__pthread_key_lock);
+ return 0;
+}
+strong_alias (__pthread_key_create, pthread_key_create)
+hidden_def (__pthread_key_create)
diff --git a/sysdeps/htl/pt-key-delete.c b/sysdeps/htl/pt-key-delete.c
new file mode 100644
index 0000000000..b65e5f1810
--- /dev/null
+++ b/sysdeps/htl/pt-key-delete.c
@@ -0,0 +1,63 @@
+/* pthread_key_delete. Hurd version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_key_delete (pthread_key_t key)
+{
+ error_t err = 0;
+
+ __pthread_key_lock_ready ();
+
+ __pthread_mutex_lock (&__pthread_key_lock);
+
+ if (key < 0 || key >= __pthread_key_count
+ || __pthread_key_destructors[key] == PTHREAD_KEY_INVALID)
+ err = EINVAL;
+ else
+ {
+ int i;
+
+ __pthread_key_destructors[key] = PTHREAD_KEY_INVALID;
+ __pthread_key_invalid_count++;
+
+ __pthread_rwlock_rdlock (&__pthread_threads_lock);
+ for (i = 0; i < __pthread_num_threads; ++i)
+ {
+ struct __pthread *t;
+
+ t = __pthread_threads[i];
+
+ if (t == NULL)
+ continue;
+
+ /* Just remove the key, no need to care whether it was
+ already there. */
+ if (key < t->thread_specifics_size)
+ t->thread_specifics[key] = 0;
+ }
+ __pthread_rwlock_unlock (&__pthread_threads_lock);
+ }
+
+ __pthread_mutex_unlock (&__pthread_key_lock);
+
+ return err;
+}
diff --git a/sysdeps/htl/pt-key.h b/sysdeps/htl/pt-key.h
new file mode 100644
index 0000000000..893adccd2e
--- /dev/null
+++ b/sysdeps/htl/pt-key.h
@@ -0,0 +1,77 @@
+/* pthread_key internal declatations for the Hurd version.
+ Copyright (C) 2002-2018 Free Software 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 <libc-lockP.h>
+#include <pthreadP.h>
+
+#define PTHREAD_KEY_MEMBERS \
+ void **thread_specifics; /* This is only resized by the thread, and always growing */ \
+ unsigned thread_specifics_size; /* Number of entries in thread_specifics */
+
+#define PTHREAD_KEY_INVALID (void *) (-1)
+
+
+/* __PTHREAD_KEY_DESTRUCTORS is an array of destructors with
+ __PTHREAD_KEY_SIZE elements. If an element with index less than
+ __PTHREAD_KEY_COUNT is invalid, it shall contain the value
+ PTHREAD_KEY_INVALID which shall be distinct from NULL.
+
+ Normally, we just add new keys to the end of the array and realloc
+ it as necessary. The pthread_key_create routine may decide to
+ rescan the array if __PTHREAD_KEY_FREE is large. */
+extern void (**__pthread_key_destructors) (void *arg);
+extern int __pthread_key_size;
+extern int __pthread_key_count;
+/* Number of invalid elements in the array. Does not include elements
+ for which memory has been allocated but which have not yet been
+ used (i.e. those elements with indexes greater than
+ __PTHREAD_KEY_COUNT). */
+extern int __pthread_key_invalid_count;
+
+/* Protects the above variables. This must be a recursive lock: the
+ destructors may call pthread_key_delete. */
+extern pthread_mutex_t __pthread_key_lock;
+
+#include <assert.h>
+
+static inline void
+__pthread_key_lock_ready (void)
+{
+ static pthread_once_t o = PTHREAD_ONCE_INIT;
+
+ void do_init (void)
+ {
+ int err;
+ pthread_mutexattr_t attr;
+
+ err = __pthread_mutexattr_init (&attr);
+ assert_perror (err);
+
+ err = __pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
+ assert_perror (err);
+
+ err = _pthread_mutex_init (&__pthread_key_lock, &attr);
+ assert_perror (err);
+
+ err = __pthread_mutexattr_destroy (&attr);
+ assert_perror (err);
+ }
+
+ __pthread_once (&o, do_init);
+}
diff --git a/sysdeps/htl/pt-kill.c b/sysdeps/htl/pt-kill.c
new file mode 100644
index 0000000000..7f7a39eb57
--- /dev/null
+++ b/sysdeps/htl/pt-kill.c
@@ -0,0 +1,33 @@
+/* pthread-kill.c - Generic pthread-kill implementation.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
+ Written by Neal H. Walfield <neal@gnu.org>.
+
+ This file is part of the GNU Hurd.
+
+ The GNU Hurd is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 3 of
+ the License, or (at your option) any later version.
+
+ The GNU Hurd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <pthreadP.h>
+#include "sig-internal.h"
+
+int
+__pthread_kill (pthread_t tid, int signo)
+{
+ siginfo_t si;
+ memset (&si, 0, sizeof (si));
+ si.si_signo = signo;
+
+ return pthread_kill_siginfo_np (tid, si);
+}
+strong_alias (__pthread_kill, pthread_kill)
diff --git a/sysdeps/htl/pt-mutex-destroy.c b/sysdeps/htl/pt-mutex-destroy.c
new file mode 100644
index 0000000000..ab9dd20da9
--- /dev/null
+++ b/sysdeps/htl/pt-mutex-destroy.c
@@ -0,0 +1,38 @@
+/* Destroy a mutex. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+
+#include <pt-internal.h>
+
+int
+_pthread_mutex_destroy (pthread_mutex_t *mutex)
+{
+ if (mutex->__attr == __PTHREAD_ERRORCHECK_MUTEXATTR
+ || mutex->__attr == __PTHREAD_RECURSIVE_MUTEXATTR)
+ /* Static attributes. */
+ ;
+ else
+ free (mutex->__attr);
+
+ return 0;
+}
+
+strong_alias (_pthread_mutex_destroy, pthread_mutex_destroy);
diff --git a/sysdeps/htl/pt-mutex-getprioceiling.c b/sysdeps/htl/pt-mutex-getprioceiling.c
new file mode 100644
index 0000000000..de91329444
--- /dev/null
+++ b/sysdeps/htl/pt-mutex-getprioceiling.c
@@ -0,0 +1,28 @@
+/* Get a mutex' priority ceiling. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_mutex_getprioceiling (const pthread_mutex_t *mutex, int *prioceiling)
+{
+ return ENOSYS;
+}
+
+stub_warning (pthread_mutex_getprioceiling)
diff --git a/sysdeps/htl/pt-mutex-init.c b/sysdeps/htl/pt-mutex-init.c
new file mode 100644
index 0000000000..664fd607c1
--- /dev/null
+++ b/sysdeps/htl/pt-mutex-init.c
@@ -0,0 +1,48 @@
+/* Initialize a mutex. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <string.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include <pt-internal.h>
+
+int
+_pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
+{
+ *mutex = (pthread_mutex_t) __PTHREAD_MUTEX_INITIALIZER;
+
+ if (attr == NULL
+ || memcmp (attr, &__pthread_default_mutexattr, sizeof (*attr) == 0))
+ /* The default attributes. */
+ return 0;
+
+ if (mutex->__attr == NULL
+ || mutex->__attr == __PTHREAD_ERRORCHECK_MUTEXATTR
+ || mutex->__attr == __PTHREAD_RECURSIVE_MUTEXATTR)
+ mutex->__attr = malloc (sizeof *attr);
+
+ if (mutex->__attr == NULL)
+ return ENOMEM;
+
+ *mutex->__attr = *attr;
+ return 0;
+}
+
+strong_alias (_pthread_mutex_init, pthread_mutex_init);
diff --git a/sysdeps/htl/pt-mutex-lock.c b/sysdeps/htl/pt-mutex-lock.c
new file mode 100644
index 0000000000..84b8b3518e
--- /dev/null
+++ b/sysdeps/htl/pt-mutex-lock.c
@@ -0,0 +1,36 @@
+/* Lock a mutex. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <assert.h>
+
+#include <pt-internal.h>
+
+/* Implemented in pt-mutex-timedlock.c. */
+extern int __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex,
+ const struct timespec *abstime);
+
+/* Lock MUTEX, block if we can't get it. */
+int
+__pthread_mutex_lock (struct __pthread_mutex *mutex)
+{
+ return __pthread_mutex_timedlock_internal (mutex, 0);
+}
+
+strong_alias (__pthread_mutex_lock, _pthread_mutex_lock);
+strong_alias (__pthread_mutex_lock, pthread_mutex_lock);
diff --git a/sysdeps/htl/pt-mutex-setprioceiling.c b/sysdeps/htl/pt-mutex-setprioceiling.c
new file mode 100644
index 0000000000..5b1af84f68
--- /dev/null
+++ b/sysdeps/htl/pt-mutex-setprioceiling.c
@@ -0,0 +1,28 @@
+/* Set a mutex' priority ceiling. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prio, int *oldprio)
+{
+ return ENOSYS;
+}
+
+stub_warning (pthread_mutex_setprioceiling)
diff --git a/sysdeps/htl/pt-mutex-timedlock.c b/sysdeps/htl/pt-mutex-timedlock.c
new file mode 100644
index 0000000000..942ccc9b75
--- /dev/null
+++ b/sysdeps/htl/pt-mutex-timedlock.c
@@ -0,0 +1,195 @@
+/* Lock a mutex with a timeout. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <assert.h>
+
+#include <pt-internal.h>
+
+#define LOSE do { * (int *) 0 = 0; } while (1)
+
+/* Try to lock MUTEX, block until *ABSTIME if it is already held. As
+ a GNU extension, if TIMESPEC is NULL then wait forever. */
+int
+__pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex,
+ const struct timespec *abstime)
+{
+ error_t err;
+ int drain;
+ struct __pthread *self;
+ const struct __pthread_mutexattr *attr = mutex->__attr;
+
+ if (attr == __PTHREAD_ERRORCHECK_MUTEXATTR)
+ attr = &__pthread_errorcheck_mutexattr;
+ if (attr == __PTHREAD_RECURSIVE_MUTEXATTR)
+ attr = &__pthread_recursive_mutexattr;
+
+ __pthread_spin_lock (&mutex->__lock);
+ if (__pthread_spin_trylock (&mutex->__held) == 0)
+ /* Successfully acquired the lock. */
+ {
+#ifdef ALWAYS_TRACK_MUTEX_OWNER
+# ifndef NDEBUG
+ self = _pthread_self ();
+ if (self != NULL)
+ /* The main thread may take a lock before the library is fully
+ initialized, in particular, before the main thread has a
+ TCB. */
+ {
+ assert (mutex->__owner == NULL);
+ mutex->__owner = _pthread_self ();
+ }
+# endif
+#endif
+
+ if (attr != NULL)
+ switch (attr->__mutex_type)
+ {
+ case PTHREAD_MUTEX_NORMAL:
+ break;
+
+ case PTHREAD_MUTEX_RECURSIVE:
+ mutex->__locks = 1;
+ case PTHREAD_MUTEX_ERRORCHECK:
+ mutex->__owner = _pthread_self ();
+ break;
+
+ default:
+ LOSE;
+ }
+
+ __pthread_spin_unlock (&mutex->__lock);
+ return 0;
+ }
+
+ /* The lock is busy. */
+
+ self = _pthread_self ();
+ assert (self);
+
+ if (attr == NULL || attr->__mutex_type == PTHREAD_MUTEX_NORMAL)
+ {
+#if defined(ALWAYS_TRACK_MUTEX_OWNER)
+ assert (mutex->__owner != self);
+#endif
+ }
+ else
+ {
+ switch (attr->__mutex_type)
+ {
+ case PTHREAD_MUTEX_ERRORCHECK:
+ if (mutex->__owner == self)
+ {
+ __pthread_spin_unlock (&mutex->__lock);
+ return EDEADLK;
+ }
+ break;
+
+ case PTHREAD_MUTEX_RECURSIVE:
+ if (mutex->__owner == self)
+ {
+ mutex->__locks++;
+ __pthread_spin_unlock (&mutex->__lock);
+ return 0;
+ }
+ break;
+
+ default:
+ LOSE;
+ }
+ }
+
+#if !defined(ALWAYS_TRACK_MUTEX_OWNER)
+ if (attr != NULL && attr->__mutex_type != PTHREAD_MUTEX_NORMAL)
+#endif
+ assert (mutex->__owner);
+
+ if (abstime != NULL && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000))
+ return EINVAL;
+
+ /* Add ourselves to the queue. */
+ __pthread_enqueue (&mutex->__queue, self);
+ __pthread_spin_unlock (&mutex->__lock);
+
+ /* Block the thread. */
+ if (abstime != NULL)
+ err = __pthread_timedblock (self, abstime, CLOCK_REALTIME);
+ else
+ {
+ err = 0;
+ __pthread_block (self);
+ }
+
+ __pthread_spin_lock (&mutex->__lock);
+ if (self->prevp == NULL)
+ /* Another thread removed us from the queue, which means a wakeup message
+ has been sent. It was either consumed while we were blocking, or
+ queued after we timed out and before we acquired the mutex lock, in
+ which case the message queue must be drained. */
+ drain = err ? 1 : 0;
+ else
+ {
+ /* We're still in the queue. Noone attempted to wake us up, i.e. we
+ timed out. */
+ __pthread_dequeue (self);
+ drain = 0;
+ }
+ __pthread_spin_unlock (&mutex->__lock);
+
+ if (drain)
+ __pthread_block (self);
+
+ if (err)
+ {
+ assert (err == ETIMEDOUT);
+ return err;
+ }
+
+#if !defined(ALWAYS_TRACK_MUTEX_OWNER)
+ if (attr != NULL && attr->__mutex_type != PTHREAD_MUTEX_NORMAL)
+#endif
+ {
+ assert (mutex->__owner == self);
+ }
+
+ if (attr != NULL)
+ switch (attr->__mutex_type)
+ {
+ case PTHREAD_MUTEX_NORMAL:
+ break;
+
+ case PTHREAD_MUTEX_RECURSIVE:
+ assert (mutex->__locks == 0);
+ mutex->__locks = 1;
+ case PTHREAD_MUTEX_ERRORCHECK:
+ mutex->__owner = self;
+ break;
+
+ default:
+ LOSE;
+ }
+
+ return 0;
+}
+
+int
+pthread_mutex_timedlock (struct __pthread_mutex *mutex,
+ const struct timespec *abstime)
+{
+ return __pthread_mutex_timedlock_internal (mutex, abstime);
+}
diff --git a/sysdeps/htl/pt-mutex-transfer-np.c b/sysdeps/htl/pt-mutex-transfer-np.c
new file mode 100644
index 0000000000..e208ac1b58
--- /dev/null
+++ b/sysdeps/htl/pt-mutex-transfer-np.c
@@ -0,0 +1,66 @@
+/* Transfer ownership of a mutex. Generic version.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
+ Written by Neal H. Walfield <neal@gnu.org>.
+
+ This file is part of the GNU Hurd.
+
+ The GNU Hurd is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 3 of
+ the License, or (at your option) any later version.
+
+ The GNU Hurd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <pthread.h>
+#include <assert.h>
+
+#include <pt-internal.h>
+
+int
+__pthread_mutex_transfer_np (struct __pthread_mutex *mutex, pthread_t tid)
+{
+ assert (mutex->__owner == _pthread_self ());
+
+ struct __pthread *thread = __pthread_getid (tid);
+ const struct __pthread_mutexattr *attr = mutex->__attr;
+
+ if (thread == NULL)
+ return ESRCH;
+
+ if (thread == _pthread_self ())
+ return 0;
+
+ if (attr == __PTHREAD_ERRORCHECK_MUTEXATTR)
+ attr = &__pthread_errorcheck_mutexattr;
+ if (attr == __PTHREAD_RECURSIVE_MUTEXATTR)
+ attr = &__pthread_recursive_mutexattr;
+
+ if (attr != NULL && attr->__mutex_type == PTHREAD_MUTEX_ERRORCHECK)
+ {
+
+ if (mutex->__owner != _pthread_self ())
+ return EPERM;
+
+ mutex->__owner = thread;
+ }
+
+#ifndef NDEBUG
+# if !defined(ALWAYS_TRACK_MUTEX_OWNER)
+ if (attr != NULL && attr->__mutex_type != PTHREAD_MUTEX_NORMAL)
+# endif
+ {
+ mutex->__owner = thread;
+ }
+#endif
+
+ return 0;
+}
+
+strong_alias (__pthread_mutex_transfer_np, pthread_mutex_transfer_np)
diff --git a/sysdeps/htl/pt-mutex-trylock.c b/sysdeps/htl/pt-mutex-trylock.c
new file mode 100644
index 0000000000..e9ad4f3204
--- /dev/null
+++ b/sysdeps/htl/pt-mutex-trylock.c
@@ -0,0 +1,111 @@
+/* Try to Lock a mutex. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+#define LOSE do { * (int *) 0 = 0; } while (1)
+
+/* Lock MUTEX, return EBUSY if we can't get it. */
+int
+__pthread_mutex_trylock (struct __pthread_mutex *mutex)
+{
+ int err;
+ struct __pthread *self;
+ const struct __pthread_mutexattr *attr = mutex->__attr;
+
+ if (attr == __PTHREAD_ERRORCHECK_MUTEXATTR)
+ attr = &__pthread_errorcheck_mutexattr;
+ if (attr == __PTHREAD_RECURSIVE_MUTEXATTR)
+ attr = &__pthread_recursive_mutexattr;
+
+ __pthread_spin_lock (&mutex->__lock);
+ if (__pthread_spin_trylock (&mutex->__held) == 0)
+ /* Acquired the lock. */
+ {
+#if defined(ALWAYS_TRACK_MUTEX_OWNER)
+# ifndef NDEBUG
+ self = _pthread_self ();
+ if (self != NULL)
+ /* The main thread may take a lock before the library is fully
+ initialized, in particular, before the main thread has a
+ TCB. */
+ {
+ assert (mutex->__owner == NULL);
+ mutex->__owner = _pthread_self ();
+ }
+# endif
+#endif
+
+ if (attr != NULL)
+ switch (attr->__mutex_type)
+ {
+ case PTHREAD_MUTEX_NORMAL:
+ break;
+
+ case PTHREAD_MUTEX_RECURSIVE:
+ mutex->__locks = 1;
+ case PTHREAD_MUTEX_ERRORCHECK:
+ mutex->__owner = _pthread_self ();
+ break;
+
+ default:
+ LOSE;
+ }
+
+ __pthread_spin_unlock (&mutex->__lock);
+ return 0;
+ }
+
+ err = EBUSY;
+
+ if (attr != NULL)
+ {
+ self = _pthread_self ();
+ switch (attr->__mutex_type)
+ {
+ case PTHREAD_MUTEX_NORMAL:
+ break;
+
+ case PTHREAD_MUTEX_ERRORCHECK:
+ /* We could check if MUTEX->OWNER is SELF, however, POSIX
+ does not permit pthread_mutex_trylock to return EDEADLK
+ instead of EBUSY, only pthread_mutex_lock. */
+ break;
+
+ case PTHREAD_MUTEX_RECURSIVE:
+ if (mutex->__owner == self)
+ {
+ mutex->__locks++;
+ err = 0;
+ }
+ break;
+
+ default:
+ LOSE;
+ }
+ }
+
+ __pthread_spin_unlock (&mutex->__lock);
+
+ return err;
+}
+
+strong_alias (__pthread_mutex_trylock, _pthread_mutex_trylock);
+strong_alias (__pthread_mutex_trylock, pthread_mutex_trylock);
diff --git a/sysdeps/htl/pt-mutex-unlock.c b/sysdeps/htl/pt-mutex-unlock.c
new file mode 100644
index 0000000000..b5ea05584f
--- /dev/null
+++ b/sysdeps/htl/pt-mutex-unlock.c
@@ -0,0 +1,107 @@
+/* Unlock a mutex. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <pt-internal.h>
+
+#define LOSE do { * (int *) 0 = 0; } while (1)
+
+/* Unlock MUTEX, rescheduling a waiting thread. */
+int
+__pthread_mutex_unlock (pthread_mutex_t *mutex)
+{
+ struct __pthread *wakeup;
+ const struct __pthread_mutexattr *attr = mutex->__attr;
+
+ if (attr == __PTHREAD_ERRORCHECK_MUTEXATTR)
+ attr = &__pthread_errorcheck_mutexattr;
+ if (attr == __PTHREAD_RECURSIVE_MUTEXATTR)
+ attr = &__pthread_recursive_mutexattr;
+
+ __pthread_spin_lock (&mutex->__lock);
+
+ if (attr == NULL || attr->__mutex_type == PTHREAD_MUTEX_NORMAL)
+ {
+#if defined(ALWAYS_TRACK_MUTEX_OWNER)
+# ifndef NDEBUG
+ if (_pthread_self ())
+ {
+ assert (mutex->__owner);
+ assert (mutex->__owner == _pthread_self ());
+ mutex->__owner = NULL;
+ }
+# endif
+#endif
+ }
+ else
+ switch (attr->__mutex_type)
+ {
+ case PTHREAD_MUTEX_ERRORCHECK:
+ case PTHREAD_MUTEX_RECURSIVE:
+ if (mutex->__owner != _pthread_self ())
+ {
+ __pthread_spin_unlock (&mutex->__lock);
+ return EPERM;
+ }
+
+ if (attr->__mutex_type == PTHREAD_MUTEX_RECURSIVE)
+ if (--mutex->__locks > 0)
+ {
+ __pthread_spin_unlock (&mutex->__lock);
+ return 0;
+ }
+
+ mutex->__owner = 0;
+ break;
+
+ default:
+ LOSE;
+ }
+
+
+ if (mutex->__queue == NULL)
+ {
+ __pthread_spin_unlock (&mutex->__held);
+ __pthread_spin_unlock (&mutex->__lock);
+ return 0;
+ }
+
+ wakeup = mutex->__queue;
+ __pthread_dequeue (wakeup);
+
+#ifndef NDEBUG
+# if !defined (ALWAYS_TRACK_MUTEX_OWNER)
+ if (attr != NULL && attr->__mutex_type != PTHREAD_MUTEX_NORMAL)
+# endif
+ {
+ mutex->__owner = wakeup;
+ }
+#endif
+
+ /* We do not unlock MUTEX->held: we are transferring the ownership
+ to the thread that we are waking up. */
+
+ __pthread_spin_unlock (&mutex->__lock);
+ __pthread_wakeup (wakeup);
+
+ return 0;
+}
+
+strong_alias (__pthread_mutex_unlock, _pthread_mutex_unlock);
+strong_alias (__pthread_mutex_unlock, pthread_mutex_unlock);
diff --git a/sysdeps/htl/pt-mutexattr-destroy.c b/sysdeps/htl/pt-mutexattr-destroy.c
new file mode 100644
index 0000000000..bf0be76aad
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr-destroy.c
@@ -0,0 +1,27 @@
+/* pthread_mutexattr_destroy. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_mutexattr_destroy (pthread_mutexattr_t *attr)
+{
+ return 0;
+}
+weak_alias (__pthread_mutexattr_destroy, pthread_mutexattr_destroy)
diff --git a/sysdeps/htl/pt-mutexattr-getprioceiling.c b/sysdeps/htl/pt-mutexattr-getprioceiling.c
new file mode 100644
index 0000000000..4305450a26
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr-getprioceiling.c
@@ -0,0 +1,29 @@
+/* pthread_mutexattr_getprioceiling. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr,
+ int *prioceiling)
+{
+ return ENOSYS;
+}
+
+stub_warning (pthread_mutexattr_getprioceiling)
diff --git a/sysdeps/htl/pt-mutexattr-getprotocol.c b/sysdeps/htl/pt-mutexattr-getprotocol.c
new file mode 100644
index 0000000000..9163677e3b
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr-getprotocol.c
@@ -0,0 +1,27 @@
+/* pthread_mutexattr_getprotocol. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr, int *protocol)
+{
+ *protocol = attr->__protocol;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-mutexattr-getpshared.c b/sysdeps/htl/pt-mutexattr-getpshared.c
new file mode 100644
index 0000000000..2ef0c2ddbe
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr-getpshared.c
@@ -0,0 +1,27 @@
+/* pthread_mutexattr_getpshared. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr, int *pshared)
+{
+ *pshared = attr->__pshared;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-mutexattr-gettype.c b/sysdeps/htl/pt-mutexattr-gettype.c
new file mode 100644
index 0000000000..cfbbb01c53
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr-gettype.c
@@ -0,0 +1,27 @@
+/* pthread_mutexattr_gettype. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type)
+{
+ *type = attr->__mutex_type;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-mutexattr-init.c b/sysdeps/htl/pt-mutexattr-init.c
new file mode 100644
index 0000000000..deaf59e316
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr-init.c
@@ -0,0 +1,28 @@
+/* pthread_mutexattr_init. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_mutexattr_init (pthread_mutexattr_t *attr)
+{
+ *attr = __pthread_default_mutexattr;
+ return 0;
+}
+weak_alias (__pthread_mutexattr_init, pthread_mutexattr_init)
diff --git a/sysdeps/htl/pt-mutexattr-setprioceiling.c b/sysdeps/htl/pt-mutexattr-setprioceiling.c
new file mode 100644
index 0000000000..b1d458991d
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr-setprioceiling.c
@@ -0,0 +1,28 @@
+/* pthread_mutexattr_setprioceiling. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr, int prioceiling)
+{
+ return ENOSYS;
+}
+
+stub_warning (pthread_mutexattr_setprioceiling)
diff --git a/sysdeps/htl/pt-mutexattr-setprotocol.c b/sysdeps/htl/pt-mutexattr-setprotocol.c
new file mode 100644
index 0000000000..2449db8d54
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr-setprotocol.c
@@ -0,0 +1,40 @@
+/* pthread_mutexattr_setprotocol. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol)
+{
+ if (protocol == __pthread_default_mutexattr.__protocol)
+ {
+ attr->__protocol = protocol;
+ return 0;
+ }
+
+ switch (protocol)
+ {
+ case PTHREAD_PRIO_NONE:
+ case PTHREAD_PRIO_INHERIT:
+ case PTHREAD_PRIO_PROTECT:
+ return ENOTSUP;
+ default:
+ return EINVAL;
+ }
+}
diff --git a/sysdeps/htl/pt-mutexattr-setpshared.c b/sysdeps/htl/pt-mutexattr-setpshared.c
new file mode 100644
index 0000000000..f3136436ec
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr-setpshared.c
@@ -0,0 +1,37 @@
+/* pthread_mutexattr_setpshared. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared)
+{
+ switch (pshared)
+ {
+ case PTHREAD_PROCESS_PRIVATE:
+ attr->__pshared = pshared;
+ return 0;
+
+ case PTHREAD_PROCESS_SHARED:
+ return ENOTSUP;
+
+ default:
+ return EINVAL;
+ }
+}
diff --git a/sysdeps/htl/pt-mutexattr-settype.c b/sysdeps/htl/pt-mutexattr-settype.c
new file mode 100644
index 0000000000..00d86954f6
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr-settype.c
@@ -0,0 +1,37 @@
+/* pthread_mutexattr_settype. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type)
+{
+ switch (type)
+ {
+ case PTHREAD_MUTEX_NORMAL:
+ case PTHREAD_MUTEX_ERRORCHECK:
+ case PTHREAD_MUTEX_RECURSIVE:
+ attr->__mutex_type = type;
+ return 0;
+
+ default:
+ return EINVAL;
+ }
+}
+weak_alias (__pthread_mutexattr_settype, pthread_mutexattr_settype)
diff --git a/sysdeps/htl/pt-mutexattr.c b/sysdeps/htl/pt-mutexattr.c
new file mode 100644
index 0000000000..195ba8ff01
--- /dev/null
+++ b/sysdeps/htl/pt-mutexattr.c
@@ -0,0 +1,41 @@
+/* Default mutex attributes. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <pt-internal.h>
+
+const struct __pthread_mutexattr __pthread_default_mutexattr = {
+ __prioceiling: 0,
+ __protocol: PTHREAD_PRIO_NONE,
+ __pshared: PTHREAD_PROCESS_PRIVATE,
+ __mutex_type: PTHREAD_MUTEX_DEFAULT
+};
+
+const struct __pthread_mutexattr __pthread_errorcheck_mutexattr = {
+ __prioceiling: 0,
+ __protocol: PTHREAD_PRIO_NONE,
+ __pshared: PTHREAD_PROCESS_PRIVATE,
+ __mutex_type: PTHREAD_MUTEX_ERRORCHECK
+};
+
+const struct __pthread_mutexattr __pthread_recursive_mutexattr = {
+ __prioceiling: 0,
+ __protocol: PTHREAD_PRIO_NONE,
+ __pshared: PTHREAD_PROCESS_PRIVATE,
+ __mutex_type: PTHREAD_MUTEX_RECURSIVE
+};
diff --git a/sysdeps/htl/pt-once.c b/sysdeps/htl/pt-once.c
new file mode 100644
index 0000000000..7ab929db6c
--- /dev/null
+++ b/sysdeps/htl/pt-once.c
@@ -0,0 +1,44 @@
+/* pthread_once. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <atomic.h>
+
+#include <pt-internal.h>
+
+int
+__pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
+{
+ atomic_full_barrier ();
+ if (once_control->__run == 0)
+ {
+ __pthread_spin_lock (&once_control->__lock);
+
+ if (once_control->__run == 0)
+ {
+ init_routine ();
+ atomic_full_barrier ();
+ once_control->__run = 1;
+ }
+
+ __pthread_spin_unlock (&once_control->__lock);
+ }
+
+ return 0;
+}
+strong_alias (__pthread_once, pthread_once);
diff --git a/sysdeps/htl/pt-rwlock-attr.c b/sysdeps/htl/pt-rwlock-attr.c
new file mode 100644
index 0000000000..b5a7122cec
--- /dev/null
+++ b/sysdeps/htl/pt-rwlock-attr.c
@@ -0,0 +1,24 @@
+/* Default rwlock attributes. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+const struct __pthread_rwlockattr __pthread_default_rwlockattr = {
+ __pshared: PTHREAD_PROCESS_PRIVATE
+};
diff --git a/sysdeps/htl/pt-rwlock-destroy.c b/sysdeps/htl/pt-rwlock-destroy.c
new file mode 100644
index 0000000000..122aa74d55
--- /dev/null
+++ b/sysdeps/htl/pt-rwlock-destroy.c
@@ -0,0 +1,28 @@
+/* Destroy a rwlock. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+_pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
+{
+ return 0;
+}
+
+strong_alias (_pthread_rwlock_destroy, pthread_rwlock_destroy);
diff --git a/sysdeps/htl/pt-rwlock-init.c b/sysdeps/htl/pt-rwlock-init.c
new file mode 100644
index 0000000000..527b0ec62f
--- /dev/null
+++ b/sysdeps/htl/pt-rwlock-init.c
@@ -0,0 +1,44 @@
+/* Initialize a rwlock. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <string.h>
+#include <pt-internal.h>
+
+int
+_pthread_rwlock_init (pthread_rwlock_t *rwlock,
+ const pthread_rwlockattr_t *attr)
+{
+ *rwlock = (pthread_rwlock_t) __PTHREAD_RWLOCK_INITIALIZER;
+
+ if (attr == NULL
+ || memcmp (attr, &__pthread_default_rwlockattr, sizeof (*attr) == 0))
+ /* Use the default attributes. */
+ return 0;
+
+ /* Non-default attributes. */
+
+ rwlock->__attr = malloc (sizeof *attr);
+ if (rwlock->__attr == NULL)
+ return ENOMEM;
+
+ *rwlock->__attr = *attr;
+ return 0;
+}
+
+strong_alias (_pthread_rwlock_init, pthread_rwlock_init);
diff --git a/sysdeps/htl/pt-rwlock-rdlock.c b/sysdeps/htl/pt-rwlock-rdlock.c
new file mode 100644
index 0000000000..db57c1e844
--- /dev/null
+++ b/sysdeps/htl/pt-rwlock-rdlock.c
@@ -0,0 +1,34 @@
+/* Acquire a rwlock for reading. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+/* Implemented in pt-rwlock-timedrdlock.c. */
+extern int __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock
+ *rwlock,
+ const struct timespec
+ *abstime);
+
+/* Acquire RWLOCK for reading, block if we can't get it. */
+int
+__pthread_rwlock_rdlock (struct __pthread_rwlock *rwlock)
+{
+ return __pthread_rwlock_timedrdlock_internal (rwlock, 0);
+}
+weak_alias (__pthread_rwlock_rdlock, pthread_rwlock_rdlock);
diff --git a/sysdeps/htl/pt-rwlock-timedrdlock.c b/sysdeps/htl/pt-rwlock-timedrdlock.c
new file mode 100644
index 0000000000..82ae89296c
--- /dev/null
+++ b/sysdeps/htl/pt-rwlock-timedrdlock.c
@@ -0,0 +1,120 @@
+/* Acquire a rwlock for reading. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <assert.h>
+
+#include <pt-internal.h>
+
+/* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if
+ it is already held. As a GNU extension, if TIMESPEC is NULL then
+ wait forever. */
+int
+__pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *rwlock,
+ const struct timespec *abstime)
+{
+ error_t err;
+ int drain;
+ struct __pthread *self;
+
+ __pthread_spin_lock (&rwlock->__lock);
+ if (__pthread_spin_trylock (&rwlock->__held) == 0)
+ /* Successfully acquired the lock. */
+ {
+ assert (rwlock->__readerqueue == 0);
+ assert (rwlock->__writerqueue == 0);
+ assert (rwlock->__readers == 0);
+
+ rwlock->__readers = 1;
+ __pthread_spin_unlock (&rwlock->__lock);
+ return 0;
+ }
+ else
+ /* Lock is held, but is held by a reader? */
+ if (rwlock->__readers > 0)
+ /* Just add ourself to number of readers. */
+ {
+ assert (rwlock->__readerqueue == 0);
+ rwlock->__readers++;
+ __pthread_spin_unlock (&rwlock->__lock);
+ return 0;
+ }
+
+ /* The lock is busy. */
+
+ /* Better be blocked by a writer. */
+ assert (rwlock->__readers == 0);
+
+ if (abstime != NULL && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000))
+ return EINVAL;
+
+ self = _pthread_self ();
+
+ /* Add ourself to the queue. */
+ __pthread_enqueue (&rwlock->__readerqueue, self);
+ __pthread_spin_unlock (&rwlock->__lock);
+
+ /* Block the thread. */
+ if (abstime != NULL)
+ err = __pthread_timedblock (self, abstime, CLOCK_REALTIME);
+ else
+ {
+ err = 0;
+ __pthread_block (self);
+ }
+
+ __pthread_spin_lock (&rwlock->__lock);
+ if (self->prevp == NULL)
+ /* Another thread removed us from the queue, which means a wakeup message
+ has been sent. It was either consumed while we were blocking, or
+ queued after we timed out and before we acquired the rwlock lock, in
+ which case the message queue must be drained. */
+ drain = err ? 1 : 0;
+ else
+ {
+ /* We're still in the queue. Noone attempted to wake us up, i.e. we
+ timed out. */
+ __pthread_dequeue (self);
+ drain = 0;
+ }
+ __pthread_spin_unlock (&rwlock->__lock);
+
+ if (drain)
+ __pthread_block (self);
+
+ if (err)
+ {
+ assert (err == ETIMEDOUT);
+ return err;
+ }
+
+ /* The reader count has already been increment by whoever woke us
+ up. */
+
+ assert (rwlock->__readers > 0);
+
+ return 0;
+}
+
+int
+__pthread_rwlock_timedrdlock (struct __pthread_rwlock *rwlock,
+ const struct timespec *abstime)
+{
+ return __pthread_rwlock_timedrdlock_internal (rwlock, abstime);
+}
+weak_alias (__pthread_rwlock_timedrdlock, pthread_rwlock_timedrdlock)
diff --git a/sysdeps/htl/pt-rwlock-timedwrlock.c b/sysdeps/htl/pt-rwlock-timedwrlock.c
new file mode 100644
index 0000000000..4452dd9af4
--- /dev/null
+++ b/sysdeps/htl/pt-rwlock-timedwrlock.c
@@ -0,0 +1,103 @@
+/* Acquire a rwlock for writing. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <assert.h>
+
+#include <pt-internal.h>
+
+/* Acquire RWLOCK for writing blocking until *ABSTIME if we cannot get
+ it. As a special GNU extension, if ABSTIME is NULL then the wait
+ shall not time out. */
+int
+__pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock,
+ const struct timespec *abstime)
+{
+ error_t err;
+ int drain;
+ struct __pthread *self;
+
+ __pthread_spin_lock (&rwlock->__lock);
+ if (__pthread_spin_trylock (&rwlock->__held) == 0)
+ /* Successfully acquired the lock. */
+ {
+ assert (rwlock->__readerqueue == 0);
+ assert (rwlock->__writerqueue == 0);
+ assert (rwlock->__readers == 0);
+
+ __pthread_spin_unlock (&rwlock->__lock);
+ return 0;
+ }
+
+ /* The lock is busy. */
+
+ if (abstime != NULL && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000))
+ return EINVAL;
+
+ self = _pthread_self ();
+
+ /* Add ourselves to the queue. */
+ __pthread_enqueue (&rwlock->__writerqueue, self);
+ __pthread_spin_unlock (&rwlock->__lock);
+
+ /* Block the thread. */
+ if (abstime != NULL)
+ err = __pthread_timedblock (self, abstime, CLOCK_REALTIME);
+ else
+ {
+ err = 0;
+ __pthread_block (self);
+ }
+
+ __pthread_spin_lock (&rwlock->__lock);
+ if (self->prevp == NULL)
+ /* Another thread removed us from the queue, which means a wakeup message
+ has been sent. It was either consumed while we were blocking, or
+ queued after we timed out and before we acquired the rwlock lock, in
+ which case the message queue must be drained. */
+ drain = err ? 1 : 0;
+ else
+ {
+ /* We're still in the queue. Noone attempted to wake us up, i.e. we
+ timed out. */
+ __pthread_dequeue (self);
+ drain = 0;
+ }
+ __pthread_spin_unlock (&rwlock->__lock);
+
+ if (drain)
+ __pthread_block (self);
+
+ if (err)
+ {
+ assert (err == ETIMEDOUT);
+ return err;
+ }
+
+ assert (rwlock->__readers == 0);
+
+ return 0;
+}
+
+int
+__pthread_rwlock_timedwrlock (struct __pthread_rwlock *rwlock,
+ const struct timespec *abstime)
+{
+ return __pthread_rwlock_timedwrlock_internal (rwlock, abstime);
+}
+weak_alias (__pthread_rwlock_timedwrlock, pthread_rwlock_timedwrlock)
diff --git a/sysdeps/htl/pt-rwlock-tryrdlock.c b/sysdeps/htl/pt-rwlock-tryrdlock.c
new file mode 100644
index 0000000000..f5a29514ae
--- /dev/null
+++ b/sysdeps/htl/pt-rwlock-tryrdlock.c
@@ -0,0 +1,55 @@
+/* Try to acquire a rwlock for reading. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <assert.h>
+
+#include <pt-internal.h>
+
+/* Try to acquire RWLOCK. */
+int
+pthread_rwlock_tryrdlock (struct __pthread_rwlock *rwlock)
+{
+ __pthread_spin_lock (&rwlock->__lock);
+ if (__pthread_spin_trylock (&rwlock->__held) == 0)
+ /* Successfully acquired the lock. */
+ {
+ assert (rwlock->__readerqueue == 0);
+ assert (rwlock->__writerqueue == 0);
+ assert (rwlock->__readers == 0);
+
+ rwlock->__readers = 1;
+ __pthread_spin_unlock (&rwlock->__lock);
+ return 0;
+ }
+ else
+ /* Lock is held, but is held by a reader? */
+ if (rwlock->__readers > 0)
+ {
+ assert (rwlock->__readerqueue == 0);
+ rwlock->__readers++;
+ __pthread_spin_unlock (&rwlock->__lock);
+ return 0;
+ }
+
+ /* The lock is busy. */
+
+ __pthread_spin_unlock (&rwlock->__lock);
+
+ return EBUSY;
+}
diff --git a/sysdeps/htl/pt-rwlock-trywrlock.c b/sysdeps/htl/pt-rwlock-trywrlock.c
new file mode 100644
index 0000000000..9b0b3269f8
--- /dev/null
+++ b/sysdeps/htl/pt-rwlock-trywrlock.c
@@ -0,0 +1,45 @@
+/* Try to acquire a rwlock for writing. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <assert.h>
+
+#include <pt-internal.h>
+
+/* Try to acquire RWLOCK for writing. */
+int
+pthread_rwlock_trywrlock (struct __pthread_rwlock *rwlock)
+{
+ __pthread_spin_lock (&rwlock->__lock);
+ if (__pthread_spin_trylock (&rwlock->__held) == 0)
+ /* Successfully acquired the lock. */
+ {
+ assert (rwlock->__readerqueue == 0);
+ assert (rwlock->__writerqueue == 0);
+ assert (rwlock->__readers == 0);
+
+ __pthread_spin_unlock (&rwlock->__lock);
+ return 0;
+ }
+
+ /* The lock is busy. */
+
+ __pthread_spin_unlock (&rwlock->__lock);
+
+ return EBUSY;
+}
diff --git a/sysdeps/htl/pt-rwlock-unlock.c b/sysdeps/htl/pt-rwlock-unlock.c
new file mode 100644
index 0000000000..44b26d2b1c
--- /dev/null
+++ b/sysdeps/htl/pt-rwlock-unlock.c
@@ -0,0 +1,98 @@
+/* Unlock a rwlock. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 <pt-internal.h>
+
+/* Unlock *RWLOCK, rescheduling a waiting writer thread or, if there
+ are no threads waiting for a write lock, rescheduling the reader
+ threads. */
+int
+__pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
+{
+ struct __pthread *wakeup;
+
+ __pthread_spin_lock (&rwlock->__lock);
+
+ assert (__pthread_spin_trylock (&rwlock->__held) == EBUSY);
+
+ if (rwlock->__readers > 1)
+ /* There are other readers. */
+ {
+ rwlock->__readers--;
+ __pthread_spin_unlock (&rwlock->__lock);
+ return 0;
+ }
+
+ if (rwlock->__readers == 1)
+ /* Last reader. */
+ rwlock->__readers = 0;
+
+
+ /* Wake someone else up. Try the writer queue first, then the
+ reader queue if that is empty. */
+
+ if (rwlock->__writerqueue)
+ {
+ wakeup = rwlock->__writerqueue;
+ __pthread_dequeue (wakeup);
+
+ /* We do not unlock RWLOCK->held: we are transferring the ownership
+ to the thread that we are waking up. */
+
+ __pthread_spin_unlock (&rwlock->__lock);
+ __pthread_wakeup (wakeup);
+
+ return 0;
+ }
+
+ if (rwlock->__readerqueue)
+ {
+ unsigned n = 0;
+
+ __pthread_queue_iterate (rwlock->__readerqueue, wakeup)
+ n++;
+
+ {
+ struct __pthread *wakeups[n];
+ unsigned i = 0;
+
+ __pthread_dequeuing_iterate (rwlock->__readerqueue, wakeup)
+ wakeups[i++] = wakeup;
+
+ rwlock->__readers += n;
+ rwlock->__readerqueue = 0;
+
+ __pthread_spin_unlock (&rwlock->__lock);
+
+ for (i = 0; i < n; i++)
+ __pthread_wakeup (wakeups[i]);
+ }
+
+ return 0;
+ }
+
+
+ /* Noone is waiting. Just unlock it. */
+
+ __pthread_spin_unlock (&rwlock->__held);
+ __pthread_spin_unlock (&rwlock->__lock);
+ return 0;
+}
+weak_alias (__pthread_rwlock_unlock, pthread_rwlock_unlock);
diff --git a/sysdeps/htl/pt-rwlock-wrlock.c b/sysdeps/htl/pt-rwlock-wrlock.c
new file mode 100644
index 0000000000..5eacc7a195
--- /dev/null
+++ b/sysdeps/htl/pt-rwlock-wrlock.c
@@ -0,0 +1,36 @@
+/* Acquire a rwlock for writing. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <assert.h>
+
+#include <pt-internal.h>
+
+/* Implemented in pt-rwlock-timedwrlock.c. */
+extern int __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock
+ *rwlock,
+ const struct timespec
+ *abstime);
+
+/* Acquire RWLOCK for writing. */
+int
+__pthread_rwlock_wrlock (struct __pthread_rwlock *rwlock)
+{
+ return __pthread_rwlock_timedwrlock_internal (rwlock, 0);
+}
+weak_alias (__pthread_rwlock_wrlock, pthread_rwlock_wrlock);
diff --git a/sysdeps/htl/pt-rwlockattr-destroy.c b/sysdeps/htl/pt-rwlockattr-destroy.c
new file mode 100644
index 0000000000..6b5a5b5051
--- /dev/null
+++ b/sysdeps/htl/pt-rwlockattr-destroy.c
@@ -0,0 +1,26 @@
+/* pthread_rwlockattr_destroy. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr)
+{
+ return 0;
+}
diff --git a/sysdeps/htl/pt-rwlockattr-getpshared.c b/sysdeps/htl/pt-rwlockattr-getpshared.c
new file mode 100644
index 0000000000..22991a2736
--- /dev/null
+++ b/sysdeps/htl/pt-rwlockattr-getpshared.c
@@ -0,0 +1,27 @@
+/* pthread_rwlockattr_getpshared. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, int *pshared)
+{
+ *pshared = attr->__pshared;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-rwlockattr-init.c b/sysdeps/htl/pt-rwlockattr-init.c
new file mode 100644
index 0000000000..fb7e5ef74d
--- /dev/null
+++ b/sysdeps/htl/pt-rwlockattr-init.c
@@ -0,0 +1,27 @@
+/* pthread_rwlockattr_init. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_rwlockattr_init (pthread_rwlockattr_t *attr)
+{
+ *attr = __pthread_default_rwlockattr;
+ return 0;
+}
diff --git a/sysdeps/htl/pt-rwlockattr-setpshared.c b/sysdeps/htl/pt-rwlockattr-setpshared.c
new file mode 100644
index 0000000000..3ec15147cd
--- /dev/null
+++ b/sysdeps/htl/pt-rwlockattr-setpshared.c
@@ -0,0 +1,37 @@
+/* pthread_rwlockattr_setpshared. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared)
+{
+ switch (pshared)
+ {
+ case PTHREAD_PROCESS_PRIVATE:
+ attr->__pshared = pshared;
+ return 0;
+
+ case PTHREAD_PROCESS_SHARED:
+ return ENOTSUP;
+
+ default:
+ return EINVAL;
+ }
+}
diff --git a/sysdeps/htl/pt-setconcurrency.c b/sysdeps/htl/pt-setconcurrency.c
new file mode 100644
index 0000000000..e2d4499add
--- /dev/null
+++ b/sysdeps/htl/pt-setconcurrency.c
@@ -0,0 +1,33 @@
+/* Set the desired level of concurrency. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int __pthread_concurrency;
+
+int
+pthread_setconcurrency (int new_level)
+{
+ if (new_level < 0)
+ return EINVAL;
+
+ __pthread_concurrency = new_level;
+
+ return 0;
+}
diff --git a/sysdeps/htl/pt-setschedparam.c b/sysdeps/htl/pt-setschedparam.c
new file mode 100644
index 0000000000..513aeeab46
--- /dev/null
+++ b/sysdeps/htl/pt-setschedparam.c
@@ -0,0 +1,30 @@
+/* Set the scheduling parameters for a thread. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_setschedparam (pthread_t thread, int policy,
+ const struct sched_param *param)
+{
+ return ENOSYS;
+}
+
+strong_alias (__pthread_setschedparam, pthread_setschedparam);
+stub_warning (pthread_setschedparam)
diff --git a/sysdeps/htl/pt-setschedprio.c b/sysdeps/htl/pt-setschedprio.c
new file mode 100644
index 0000000000..bede66bdbc
--- /dev/null
+++ b/sysdeps/htl/pt-setschedprio.c
@@ -0,0 +1,28 @@
+/* Set the scheduling priority of a thread. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+pthread_setschedprio (pthread_t thread, int prio)
+{
+ return ENOSYS;
+}
+
+stub_warning (pthread_setschedprio)
diff --git a/sysdeps/htl/pt-setspecific.c b/sysdeps/htl/pt-setspecific.c
new file mode 100644
index 0000000000..a46a12f157
--- /dev/null
+++ b/sysdeps/htl/pt-setspecific.c
@@ -0,0 +1,50 @@
+/* pthread_setspecific. Generic version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_setspecific (pthread_key_t key, const void *value)
+{
+ struct __pthread *self = _pthread_self ();
+
+ if (key < 0 || key >= __pthread_key_count
+ || __pthread_key_destructors[key] == PTHREAD_KEY_INVALID)
+ return EINVAL;
+
+ if (key >= self->thread_specifics_size)
+ {
+ /* Amortize reallocation cost. */
+ int newsize = 2 * key + 1;
+ void **new = realloc (self->thread_specifics,
+ newsize * sizeof (new[0]));
+ if (new == NULL)
+ return ENOMEM;
+
+ memset (&new[self->thread_specifics_size], 0,
+ (newsize - self->thread_specifics_size) * sizeof (new[0]));
+ self->thread_specifics = new;
+ self->thread_specifics_size = newsize;
+ }
+
+ self->thread_specifics[key] = (void *) value;
+ return 0;
+}
+strong_alias (__pthread_setspecific, pthread_setspecific);
diff --git a/sysdeps/htl/pt-spin.c b/sysdeps/htl/pt-spin.c
new file mode 100644
index 0000000000..33bcd3facc
--- /dev/null
+++ b/sysdeps/htl/pt-spin.c
@@ -0,0 +1,50 @@
+/* Spin locks.
+ Copyright (C) 2000-2018 Free Software 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 <sched.h>
+
+/* The default for single processor machines; don't spin, it's
+ pointless. */
+#ifndef __PTHREAD_SPIN_COUNT
+# define __PTHREAD_SPIN_COUNT 1
+#endif
+
+/* The number of times to spin while trying to lock a spin lock object
+ before yielding the processor. */
+int __pthread_spin_count = __PTHREAD_SPIN_COUNT;
+
+
+/* Lock the spin lock object LOCK. If the lock is held by another
+ thread spin until it becomes available. */
+int
+_pthread_spin_lock (__pthread_spinlock_t *lock)
+{
+ int i;
+
+ while (1)
+ {
+ for (i = 0; i < __pthread_spin_count; i++)
+ {
+ if (__pthread_spin_trylock (lock) == 0)
+ return 0;
+ }
+
+ __sched_yield ();
+ }
+}
diff --git a/sysdeps/htl/pt-startup.c b/sysdeps/htl/pt-startup.c
new file mode 100644
index 0000000000..2b7f53c299
--- /dev/null
+++ b/sysdeps/htl/pt-startup.c
@@ -0,0 +1,24 @@
+/* Thread initialization. Generic version.
+ Copyright (C) 2008-2018 Free Software 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 <pt-internal.h>
+
+void
+__pthread_startup (void)
+{
+}
diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h
new file mode 100644
index 0000000000..a0d06cc039
--- /dev/null
+++ b/sysdeps/htl/pthread-functions.h
@@ -0,0 +1,140 @@
+/* Declaration of libc stubs for pthread functions. Hurd version.
+ Copyright (C) 2003-2018 Free Software 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 _PTHREAD_FUNCTIONS_H
+#define _PTHREAD_FUNCTIONS_H 1
+
+#include <pthread.h>
+
+int __pthread_attr_destroy (pthread_attr_t *);
+int __pthread_attr_init (pthread_attr_t *);
+int __pthread_attr_getdetachstate (const pthread_attr_t *, int *);
+int __pthread_attr_setdetachstate (pthread_attr_t *, int);
+int __pthread_attr_getinheritsched (const pthread_attr_t *, int *);
+int __pthread_attr_setinheritsched (pthread_attr_t *, int);
+int __pthread_attr_getschedparam (const pthread_attr_t *,
+ struct sched_param *);
+int __pthread_attr_setschedparam (pthread_attr_t *,
+ const struct sched_param *);
+int __pthread_attr_getschedpolicy (const pthread_attr_t *, int *);
+int __pthread_attr_setschedpolicy (pthread_attr_t *, int);
+int __pthread_attr_getscope (const pthread_attr_t *, int *);
+int __pthread_attr_setscope (pthread_attr_t *, int);
+int __pthread_condattr_destroy (pthread_condattr_t *);
+int __pthread_condattr_init (pthread_condattr_t *);
+int __pthread_cond_broadcast (pthread_cond_t *);
+int __pthread_cond_destroy (pthread_cond_t *);
+int __pthread_cond_init (pthread_cond_t *,
+ const pthread_condattr_t *);
+int __pthread_cond_signal (pthread_cond_t *);
+int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *);
+int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *,
+ const struct timespec *);
+int __pthread_equal (pthread_t, pthread_t);
+void __pthread_exit (void *);
+int __pthread_getschedparam (pthread_t, int *, struct sched_param *);
+int __pthread_setschedparam (pthread_t, int,
+ const struct sched_param *);
+int _pthread_mutex_destroy (pthread_mutex_t *);
+int _pthread_mutex_init (pthread_mutex_t *,
+ const pthread_mutexattr_t *);
+int __pthread_mutex_lock (pthread_mutex_t *);
+int __pthread_mutex_trylock (pthread_mutex_t *);
+int __pthread_mutex_unlock (pthread_mutex_t *);
+pthread_t __pthread_self (void);
+int __pthread_setcancelstate (int, int *);
+int __pthread_setcanceltype (int, int *);
+struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
+int __pthread_once (pthread_once_t *, void (*) (void));
+int __pthread_rwlock_rdlock (pthread_rwlock_t *);
+int __pthread_rwlock_wrlock (pthread_rwlock_t *);
+int __pthread_rwlock_unlock (pthread_rwlock_t *);
+int __pthread_key_create (pthread_key_t *, void (*) (void *));
+void *__pthread_getspecific (pthread_key_t);
+int __pthread_setspecific (pthread_key_t, const void *);
+
+void _cthreads_flockfile (FILE *);
+void _cthreads_funlockfile (FILE *);
+int _cthreads_ftrylockfile (FILE *);
+
+/* Data type shared with libc. The libc uses it to pass on calls to
+ the thread functions. Wine pokes directly into this structure,
+ so if possible avoid breaking it and append new hooks to the end. */
+struct pthread_functions
+{
+ int (*ptr_pthread_attr_destroy) (pthread_attr_t *);
+ int (*ptr_pthread_attr_init) (pthread_attr_t *);
+ int (*ptr_pthread_attr_getdetachstate) (const pthread_attr_t *, int *);
+ int (*ptr_pthread_attr_setdetachstate) (pthread_attr_t *, int);
+ int (*ptr_pthread_attr_getinheritsched) (const pthread_attr_t *, int *);
+ int (*ptr_pthread_attr_setinheritsched) (pthread_attr_t *, int);
+ int (*ptr_pthread_attr_getschedparam) (const pthread_attr_t *,
+ struct sched_param *);
+ int (*ptr_pthread_attr_setschedparam) (pthread_attr_t *,
+ const struct sched_param *);
+ int (*ptr_pthread_attr_getschedpolicy) (const pthread_attr_t *, int *);
+ int (*ptr_pthread_attr_setschedpolicy) (pthread_attr_t *, int);
+ int (*ptr_pthread_attr_getscope) (const pthread_attr_t *, int *);
+ int (*ptr_pthread_attr_setscope) (pthread_attr_t *, int);
+ int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
+ int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
+ int (*ptr_pthread_cond_broadcast) (pthread_cond_t *);
+ int (*ptr_pthread_cond_destroy) (pthread_cond_t *);
+ int (*ptr_pthread_cond_init) (pthread_cond_t *,
+ const pthread_condattr_t *);
+ int (*ptr_pthread_cond_signal) (pthread_cond_t *);
+ int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *);
+ int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *,
+ const struct timespec *);
+ int (*ptr_pthread_equal) (pthread_t, pthread_t);
+ void (*ptr___pthread_exit) (void *);
+ int (*ptr_pthread_getschedparam) (pthread_t, int *, struct sched_param *);
+ int (*ptr_pthread_setschedparam) (pthread_t, int,
+ const struct sched_param *);
+ int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *);
+ int (*ptr_pthread_mutex_init) (pthread_mutex_t *,
+ const pthread_mutexattr_t *);
+ int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
+ int (*ptr_pthread_mutex_trylock) (pthread_mutex_t *);
+ int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
+ pthread_t (*ptr_pthread_self) (void);
+ int (*ptr___pthread_setcancelstate) (int, int *);
+ int (*ptr_pthread_setcanceltype) (int, int *);
+ struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void);
+ int (*ptr_pthread_once) (pthread_once_t *, void (*) (void));
+ int (*ptr_pthread_rwlock_rdlock) (pthread_rwlock_t *);
+ int (*ptr_pthread_rwlock_wrlock) (pthread_rwlock_t *);
+ int (*ptr_pthread_rwlock_unlock) (pthread_rwlock_t *);
+ int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *));
+ void *(*ptr___pthread_getspecific) (pthread_key_t);
+ int (*ptr___pthread_setspecific) (pthread_key_t, const void *);
+ void (*ptr__IO_flockfile) (FILE *);
+ void (*ptr__IO_funlockfile) (FILE *);
+ int (*ptr__IO_ftrylockfile) (FILE *);
+};
+
+/* Variable in libc.so. */
+extern struct pthread_functions __libc_pthread_functions attribute_hidden;
+extern int __libc_pthread_functions_init attribute_hidden;
+
+void __libc_pthread_init (const struct pthread_functions *functions);
+
+#define PTHFCT_CALL(fct, params) \
+ __libc_pthread_functions.fct params
+
+#endif /* pthread-functions.h */
diff --git a/sysdeps/htl/pthread.h b/sysdeps/htl/pthread.h
new file mode 100644
index 0000000000..3672fcdc0c
--- /dev/null
+++ b/sysdeps/htl/pthread.h
@@ -0,0 +1,883 @@
+/* Posix threads. Hurd version.
+ Copyright (C) 2000-2018 Free Software 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/>. */
+
+/*
+ * POSIX Threads Extension: ??? <pthread.h>
+ */
+
+#ifndef _PTHREAD_H
+#define _PTHREAD_H 1
+
+#include <features.h>
+
+#include <sys/cdefs.h>
+#ifndef __extern_inline
+/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. */
+# if !defined __cplusplus || __GNUC_PREREQ (4,3)
+# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
+# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
+# if __GNUC_PREREQ (4,3)
+# define __extern_always_inline \
+ extern __always_inline __attribute__ ((__gnu_inline__, __artificial__))
+# else
+# define __extern_always_inline \
+ extern __always_inline __attribute__ ((__gnu_inline__))
+# endif
+# else
+# define __extern_inline extern __inline
+# define __extern_always_inline extern __always_inline
+# endif
+# endif
+#endif
+
+#include <sched.h>
+#include <time.h>
+
+__BEGIN_DECLS
+
+#include <bits/pthreadtypes.h>
+
+#include <bits/pthread.h>
+
+/* Possible values for the process shared attribute. */
+#define PTHREAD_PROCESS_PRIVATE __PTHREAD_PROCESS_PRIVATE
+#define PTHREAD_PROCESS_SHARED __PTHREAD_PROCESS_SHARED
+
+
+/* Thread attributes. */
+
+/* Possible values for the inheritsched attribute. */
+#define PTHREAD_EXPLICIT_SCHED __PTHREAD_EXPLICIT_SCHED
+#define PTHREAD_INHERIT_SCHED __PTHREAD_INHERIT_SCHED
+
+/* Possible values for the `contentionscope' attribute. */
+#define PTHREAD_SCOPE_SYSTEM __PTHREAD_SCOPE_SYSTEM
+#define PTHREAD_SCOPE_PROCESS __PTHREAD_SCOPE_PROCESS
+
+/* Possible values for the `detachstate' attribute. */
+#define PTHREAD_CREATE_JOINABLE __PTHREAD_CREATE_JOINABLE
+#define PTHREAD_CREATE_DETACHED __PTHREAD_CREATE_DETACHED
+
+#include <bits/types/struct___pthread_attr.h>
+
+/* Initialize the thread attribute object in *ATTR to the default
+ values. */
+extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1));
+
+/* Destroy the thread attribute object in *ATTR. */
+extern int pthread_attr_destroy (pthread_attr_t *__attr)
+ __THROW __nonnull ((1));
+
+
+/* Return the value of the inheritsched attribute in *ATTR in
+ *INHERITSCHED. */
+extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr,
+ int *__restrict __inheritsched)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the inheritsched attribute in *ATTR to
+ INHERITSCHED. */
+extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
+ int __inheritsched)
+ __THROW __nonnull ((1));
+
+
+/* Return the value of the schedparam attribute in *ATTR in *PARAM. */
+extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
+ struct sched_param *__restrict __param)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the schedparam attribute in *ATTR to PARAM. */
+extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
+ const struct sched_param *__restrict
+ __param) __THROW __nonnull ((1, 2));
+
+
+/* Return the value of the schedpolicy attribute in *ATTR to *POLICY. */
+extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr,
+ int *__restrict __policy)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the schedpolicy attribute in *ATTR to POLICY. */
+extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr,
+ int __policy)
+ __THROW __nonnull ((1));
+
+
+/* Return the value of the contentionscope attribute in *ATTR in
+ *CONTENTIONSCOPE. */
+extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr,
+ int *__restrict __contentionscope)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the contentionscope attribute in *ATTR to
+ CONTENTIONSCOPE. */
+extern int pthread_attr_setscope (pthread_attr_t *__attr,
+ int __contentionscope)
+ __THROW __nonnull ((1));
+
+
+/* Return the value of the stackaddr attribute in *ATTR in
+ *STACKADDR. */
+extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr,
+ void **__restrict __stackaddr)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the stackaddr attribute in *ATTR to STACKADDR. */
+extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
+ void *__stackaddr)
+ __THROW __nonnull ((1));
+
+
+#ifdef __USE_XOPEN2K
+/* Return the value of the stackaddr and stacksize attributes in *ATTR
+ in *STACKADDR and *STACKSIZE respectively. */
+extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr,
+ void **__restrict __stackaddr,
+ size_t *__restrict __stacksize)
+ __THROW __nonnull ((1, 2, 3));
+
+/* Set the value of the stackaddr and stacksize attributes in *ATTR to
+ STACKADDR and STACKSIZE respectively. */
+extern int pthread_attr_setstack (pthread_attr_t *__attr,
+ void *__stackaddr,
+ size_t __stacksize)
+ __THROW __nonnull ((1));
+#endif
+
+
+/* Return the value of the detachstate attribute in *ATTR in
+ *DETACHSTATE. */
+extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr,
+ int *__detachstate)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the detachstate attribute in *ATTR to
+ DETACHSTATE. */
+extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
+ int __detachstate)
+ __THROW __nonnull ((1));
+
+
+/* Return the value of the guardsize attribute in *ATTR in
+ *GUARDSIZE. */
+extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict __attr,
+ size_t *__restrict __guardsize)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the guardsize attribute in *ATTR to GUARDSIZE. */
+extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
+ size_t __guardsize)
+ __THROW __nonnull ((1));
+
+
+/* Return the value of the stacksize attribute in *ATTR in
+ *STACKSIZE. */
+extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr,
+ size_t *__restrict __stacksize)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the stacksize attribute in *ATTR to STACKSIZE. */
+extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
+ size_t __stacksize)
+ __THROW __nonnull ((1));
+
+#ifdef __USE_GNU
+/* Initialize thread attribute *ATTR with attributes corresponding to the
+ already running thread THREAD. It shall be called on an uninitialized ATTR
+ and destroyed with pthread_attr_destroy when no longer needed. */
+extern int pthread_getattr_np (pthread_t __thr, pthread_attr_t *__attr)
+ __THROW __nonnull ((2));
+#endif
+
+
+/* Create a thread with attributes given by ATTR, executing
+ START_ROUTINE with argument ARG. */
+extern int pthread_create (pthread_t *__restrict __threadp,
+ __const pthread_attr_t *__restrict __attr,
+ void *(*__start_routine)(void *),
+ void *__restrict __arg) __THROWNL __nonnull ((1, 3));
+
+/* Terminate the current thread and make STATUS available to any
+ thread that might join us. */
+extern void pthread_exit (void *__status) __attribute__ ((__noreturn__));
+
+/* Make calling thread wait for termination of thread THREAD. Return
+ the exit status of the thread in *STATUS. */
+extern int pthread_join (pthread_t __threadp, void **__status);
+
+/* Indicate that the storage for THREAD can be reclaimed when it
+ terminates. */
+extern int pthread_detach (pthread_t __threadp);
+
+/* Compare thread IDs T1 and T2. Return nonzero if they are equal, 0
+ if they are not. */
+extern int pthread_equal (pthread_t __t1, pthread_t __t2);
+
+#ifdef __USE_EXTERN_INLINES
+
+__extern_inline int
+pthread_equal (pthread_t __t1, pthread_t __t2)
+{
+ return __pthread_equal (__t1, __t2);
+}
+
+#endif /* Use extern inlines. */
+
+
+/* Return the thread ID of the calling thread. */
+extern pthread_t pthread_self (void) __THROW;
+
+
+/* Mutex attributes. */
+
+#define PTHREAD_PRIO_NONE_NP __PTHREAD_PRIO_NONE
+#define PTHREAD_PRIO_INHERIT_NP __PTHREAD_PRIO_INHERIT
+#define PTHREAD_PRIO_PROTECT_NP __PTHREAD_PRIO_PROTECT
+#ifdef __USE_UNIX98
+# define PTHREAD_PRIO_NONE PTHREAD_PRIO_NONE_NP
+# define PTHREAD_PRIO_INHERIT PTHREAD_PRIO_INHERIT_NP
+# define PTHREAD_PRIO_PROTECT PTHREAD_PRIO_PROTECT_NP
+#endif
+
+#define PTHREAD_MUTEX_TIMED_NP __PTHREAD_MUTEX_TIMED
+#define PTHREAD_MUTEX_ERRORCHECK_NP __PTHREAD_MUTEX_ERRORCHECK
+#define PTHREAD_MUTEX_RECURSIVE_NP __PTHREAD_MUTEX_RECURSIVE
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
+# define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_TIMED_NP
+# define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP
+# define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
+# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
+#endif
+#ifdef __USE_GNU
+/* For compatibility. */
+# define PTHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_TIMED_NP
+#endif
+
+#ifdef __USE_XOPEN2K
+# define PTHREAD_MUTEX_STALLED __PTHREAD_MUTEX_STALLED
+# define PTHREAD_MUTEX_ROBUST __PTHREAD_MUTEX_ROBUST
+#endif
+
+#include <bits/types/struct___pthread_mutexattr.h>
+
+/* Initialize the mutex attribute object in *ATTR to the default
+ values. */
+extern int pthread_mutexattr_init(pthread_mutexattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Destroy the mutex attribute structure in *ATTR. */
+extern int pthread_mutexattr_destroy(pthread_mutexattr_t *__attr)
+ __THROW __nonnull ((1));
+
+
+#ifdef __USE_UNIX98
+/* Return the value of the prioceiling attribute in *ATTR in
+ *PRIOCEILING. */
+extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict __attr,
+ int *__restrict __prioceiling)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the prioceiling attribute in *ATTR to
+ PRIOCEILING. */
+extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *__attr,
+ int __prioceiling)
+ __THROW __nonnull ((1));
+
+
+/* Return the value of the protocol attribute in *ATTR in
+ *PROTOCOL. */
+extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict __attr,
+ int *__restrict __protocol)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the protocol attribute in *ATTR to PROTOCOL. */
+extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *__attr,
+ int __protocol)
+ __THROW __nonnull ((1));
+#endif
+
+#ifdef __USE_XOPEN2K
+/* Get the robustness flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
+ int *__robustness)
+ __THROW __nonnull ((1, 2));
+# ifdef __USE_GNU
+extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr,
+ int *__robustness)
+ __THROW __nonnull ((1, 2));
+# endif
+
+/* Set the robustness flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
+ int __robustness)
+ __THROW __nonnull ((1));
+# ifdef __USE_GNU
+extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
+ int __robustness)
+ __THROW __nonnull ((1));
+# endif
+#endif
+
+
+/* Return the value of the process shared attribute in *ATTR in
+ *PSHARED. */
+extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr,
+ int *__restrict __pshared)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the process shared attribute in *ATTR to
+ PSHARED. */
+extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr,
+ int __pshared)
+ __THROW __nonnull ((1));
+
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
+/* Return the value of the type attribute in *ATTR in *TYPE. */
+extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict __attr,
+ int *__restrict __type)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the type attribute in *ATTR to TYPE. */
+extern int pthread_mutexattr_settype(pthread_mutexattr_t *__attr,
+ int __type)
+ __THROW __nonnull ((1));
+#endif
+
+
+/* Mutexes. */
+
+#include <bits/types/struct___pthread_mutex.h>
+
+#define PTHREAD_MUTEX_INITIALIZER __PTHREAD_MUTEX_INITIALIZER
+/* Static initializer for recursive mutexes. */
+
+#ifdef __USE_GNU
+# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+ __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
+# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+ __PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#endif
+
+/* Create a mutex with attributes given by ATTR and store it in
+ *__MUTEX. */
+extern int pthread_mutex_init (struct __pthread_mutex *__restrict __mutex,
+ const pthread_mutexattr_t *__restrict __attr)
+ __THROW __nonnull ((1));
+
+/* Destroy the mutex __MUTEX. */
+extern int pthread_mutex_destroy (struct __pthread_mutex *__mutex)
+ __THROW __nonnull ((1));
+
+/* Wait until lock for MUTEX becomes available and lock it. */
+extern int pthread_mutex_lock (pthread_mutex_t *__mutex);
+
+/* Try to lock MUTEX. */
+extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
+ __THROWNL __nonnull ((1));
+
+#ifdef __USE_XOPEN2K
+/* Try to lock MUTEX, block until *ABSTIME if it is already held. */
+extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict __mutex,
+ const struct timespec *__restrict __abstime)
+ __THROWNL __nonnull ((1, 2));
+#endif
+
+/* Unlock MUTEX. */
+extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
+ __THROWNL __nonnull ((1));
+
+/* Transfer ownership of the mutex MUTEX to the thread TID. The
+ caller must own the lock. */
+extern int __pthread_mutex_transfer_np (struct __pthread_mutex *__mutex,
+ pthread_t __tid)
+ __THROWNL __nonnull ((1));
+
+
+#ifdef __USE_UNIX98
+/* Return the priority ceiling of mutex *MUTEX in *PRIOCEILING. */
+extern int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict __mutex,
+ int *__restrict __prioceiling)
+ __THROW __nonnull ((1, 2));
+
+/* After acquiring the mutex *MUTEX, set its priority ceiling to PRIO
+ and return the old priority ceiling in *OLDPRIO. Before returning,
+ release the mutex. */
+extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
+ int __prio, int *__restrict __oldprio)
+ __THROW __nonnull ((1, 3));
+#endif
+
+#ifdef __USE_XOPEN2K8
+
+/* Declare the state protected by robust mutex MTXP as consistent. */
+extern int pthread_mutex_consistent (pthread_mutex_t *__mtxp)
+ __THROW __nonnull ((1));
+
+# ifdef __USE_GNU
+extern int pthread_mutex_consistent_np (pthread_mutex_t *__mtxp)
+ __THROW __nonnull ((1));
+# endif
+#endif
+
+
+
+/* Condition attributes. */
+
+#include <bits/types/struct___pthread_condattr.h>
+
+/* Initialize the condition attribute in *ATTR to the default
+ values. */
+extern int pthread_condattr_init (pthread_condattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Destroy the condition attribute structure in *ATTR. */
+extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
+ __THROW __nonnull ((1));
+
+
+#ifdef __USE_XOPEN2K
+/* Return the value of the clock attribute in *ATTR in *CLOCK_ID. */
+extern int pthread_condattr_getclock (const pthread_condattr_t *__restrict __attr,
+ __clockid_t *__restrict __clock_id)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the clock attribute in *ATTR to CLOCK_ID. */
+extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
+ __clockid_t __clock_id)
+ __THROW __nonnull ((1));
+#endif
+
+
+/* Return the value of the process shared attribute in *ATTR in
+ *PSHARED. */
+extern int pthread_condattr_getpshared (const pthread_condattr_t *__restrict __attr,
+ int *__restrict __pshared)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the process shared attribute in *ATTR to
+ PSHARED. */
+extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
+ int __pshared)
+ __THROW __nonnull ((1));
+
+
+/* Condition variables. */
+
+#include <bits/types/struct___pthread_cond.h>
+
+#define PTHREAD_COND_INITIALIZER __PTHREAD_COND_INITIALIZER
+
+extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
+ const pthread_condattr_t *__restrict __attr)
+ __THROW __nonnull ((1));
+
+extern int pthread_cond_destroy (pthread_cond_t *__cond)
+ __THROW __nonnull ((1));
+
+/* Unblock at least one of the threads that are blocked on condition
+ variable COND. */
+extern int pthread_cond_signal (pthread_cond_t *__cond)
+ __THROWNL __nonnull ((1));
+
+/* Unblock all threads that are blocked on condition variable COND. */
+extern int pthread_cond_broadcast (pthread_cond_t *__cond)
+ __THROWNL __nonnull ((1));
+
+/* Block on condition variable COND. MUTEX should be held by the
+ calling thread. On success, MUTEX will be held by the calling
+ thread. */
+extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex)
+ __nonnull ((1, 2));
+
+/* Block on condition variable COND. MUTEX should be held by the
+ calling thread. On success, MUTEX will be held by the calling
+ thread. If the time specified by ABSTIME passes, ETIMEDOUT is
+ returned, and MUTEX will nevertheless be held. */
+extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict __abstime)
+ __nonnull ((1, 2, 3));
+
+
+/* Spin locks. */
+
+#ifdef __USE_XOPEN2K
+
+# include <bits/types/__pthread_spinlock_t.h>
+
+# define PTHREAD_SPINLOCK_INITIALIZER __PTHREAD_SPIN_LOCK_INITIALIZER
+
+/* Destroy the spin lock object LOCK. */
+extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
+ __nonnull ((1));
+
+/* Initialize the spin lock object LOCK. PSHARED determines whether
+ the spin lock can be operated upon by multiple processes. */
+extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
+ __nonnull ((1));
+
+/* Lock the spin lock object LOCK. If the lock is held by another
+ thread spin until it becomes available. */
+extern int pthread_spin_lock (pthread_spinlock_t *__lock)
+ __nonnull ((1));
+
+/* Lock the spin lock object LOCK. Fail if the lock is held by
+ another thread. */
+extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
+ __nonnull ((1));
+
+/* Unlock the spin lock object LOCK. */
+extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
+ __nonnull ((1));
+
+# if defined __USE_EXTERN_INLINES && defined _LIBC
+
+# include <bits/spin-lock-inline.h>
+
+__extern_inline int
+pthread_spin_destroy (pthread_spinlock_t *__lock)
+{
+ return __pthread_spin_destroy (__lock);
+}
+
+__extern_inline int
+pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
+{
+ return __pthread_spin_init (__lock, __pshared);
+}
+
+__extern_inline int
+pthread_spin_lock (pthread_spinlock_t *__lock)
+{
+ return __pthread_spin_lock (__lock);
+}
+
+__extern_inline int
+pthread_spin_trylock (pthread_spinlock_t *__lock)
+{
+ return __pthread_spin_trylock (__lock);
+}
+
+__extern_inline int
+pthread_spin_unlock (pthread_spinlock_t *__lock)
+{
+ return __pthread_spin_unlock (__lock);
+}
+
+# endif /* Use extern inlines. */
+
+#endif /* XPG6. */
+
+
+/* rwlock attributes. */
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+
+# include <bits/types/struct___pthread_rwlockattr.h>
+
+/* Initialize rwlock attribute object in *ATTR to the default
+ values. */
+extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Destroy the rwlock attribute object in *ATTR. */
+extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
+ __THROW __nonnull ((1));
+
+
+/* Return the value of the process shared attribute in *ATTR in
+ *PSHARED. */
+extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict __attr,
+ int *__restrict __pshared)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the process shared atrribute in *ATTR to
+ PSHARED. */
+extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
+ int __pshared)
+ __THROW __nonnull ((1));
+
+/* Return current setting of reader/writer preference. */
+extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t *
+ __restrict __attr,
+ int *__restrict __pref)
+ __THROW __nonnull ((1, 2));
+
+/* Set reader/write preference. */
+extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
+ int __pref) __THROW __nonnull ((1));
+
+
+/* rwlocks. */
+
+# include <bits/types/struct___pthread_rwlock.h>
+
+# define PTHREAD_RWLOCK_INITIALIZER __PTHREAD_RWLOCK_INITIALIZER
+/* Create a rwlock object with attributes given by ATTR and strore the
+ result in *RWLOCK. */
+extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
+ const pthread_rwlockattr_t *__restrict __attr)
+ __THROW __nonnull ((1));
+
+/* Destroy the rwlock *RWLOCK. */
+extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
+ __THROW __nonnull ((1));
+
+/* Acquire the rwlock *RWLOCK for reading. */
+extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
+ __THROWNL __nonnull ((1));
+
+/* Acquire the rwlock *RWLOCK for reading. */
+extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
+ __THROWNL __nonnull ((1));
+
+# ifdef __USE_XOPEN2K
+/* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if
+ it is already held. */
+extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict __rwlock,
+ const struct timespec *__restrict __abstime)
+ __THROWNL __nonnull ((1, 2));
+# endif
+
+/* Acquire the rwlock *RWLOCK for writing. */
+extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
+ __THROWNL __nonnull ((1));
+
+/* Try to acquire the rwlock *RWLOCK for writing. */
+extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
+ __THROWNL __nonnull ((1));
+
+# ifdef __USE_XOPEN2K
+/* Acquire the rwlock *RWLOCK for writing blocking until *ABSTIME if
+ it is already held. */
+extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict __rwlock,
+ const struct timespec *__restrict __abstime)
+ __THROWNL __nonnull ((1, 2));
+# endif
+
+/* Release the lock held by the current thread on *RWLOCK. */
+extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
+ __THROWNL __nonnull ((1));
+
+#endif /* __USE_UNIX98 || __USE_XOPEN2K */
+
+
+
+/* Cancelation. */
+
+/* Register a cleanup handler. */
+extern void pthread_cleanup_push (void (*__routine) (void *), void *__arg);
+
+/* Unregister a cleanup handler. */
+extern void pthread_cleanup_pop (int __execute);
+
+#include <bits/cancelation.h>
+
+#define pthread_cleanup_push(rt, rtarg) __pthread_cleanup_push(rt, rtarg)
+#define pthread_cleanup_pop(execute) __pthread_cleanup_pop(execute)
+
+#define PTHREAD_CANCEL_DISABLE 0
+#define PTHREAD_CANCEL_ENABLE 1
+
+/* Return the calling thread's cancelation state in *OLDSTATE and set
+ its state to STATE. */
+extern int pthread_setcancelstate (int __state, int *__oldstate);
+
+#define PTHREAD_CANCEL_DEFERRED 0
+#define PTHREAD_CANCEL_ASYNCHRONOUS 1
+
+/* Return the calling thread's cancelation type in *OLDTYPE and set
+ its type to TYPE. */
+extern int pthread_setcanceltype (int __type, int *__oldtype);
+
+/* Value returned by pthread_join if the target thread was
+ canceled. */
+#define PTHREAD_CANCELED ((void *) -1)
+
+/* Cancel THEAD. */
+extern int pthread_cancel (pthread_t __thr);
+
+/* Add an explicit cancelation point. */
+extern void pthread_testcancel (void);
+
+
+/* Barriers attributes. */
+
+#ifdef __USE_XOPEN2K
+
+# include <bits/types/struct___pthread_barrierattr.h>
+
+/* Initialize barrier attribute object in *ATTR to the default
+ values. */
+extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
+ __THROW __nonnull ((1));
+
+/* Destroy the barrier attribute object in *ATTR. */
+extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
+ __THROW __nonnull ((1));
+
+
+/* Return the value of the process shared attribute in *ATTR in
+ *PSHARED. */
+extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restrict __attr,
+ int *__restrict __pshared)
+ __THROW __nonnull ((1, 2));
+
+/* Set the value of the process shared atrribute in *ATTR to
+ PSHARED. */
+extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
+ int __pshared)
+ __THROW __nonnull ((1));
+
+
+/* Barriers. */
+
+# include <bits/types/struct___pthread_barrier.h>
+
+/* Returned by pthread_barrier_wait to exactly one thread each time a
+ barrier is passed. */
+# define PTHREAD_BARRIER_SERIAL_THREAD -1
+
+/* Initialize barrier BARRIER. */
+extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
+ const pthread_barrierattr_t *__restrict __attr,
+ unsigned __count)
+ __THROW __nonnull ((1));
+
+/* Destroy barrier BARRIER. */
+extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
+ __THROW __nonnull ((1));
+
+/* Wait on barrier BARRIER. */
+extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
+ __THROWNL __nonnull ((1));
+
+#endif /* __USE_XOPEN2K */
+
+
+
+/* Thread specific data. */
+
+#include <bits/types/__pthread_key.h>
+
+/* Create a thread specific data key in KEY visible to all threads.
+ On thread destruction, DESTRUCTOR shall be called with the thread
+ specific data associate with KEY if it is not NULL. */
+extern int pthread_key_create (pthread_key_t *__key,
+ void (*__destructor) (void *))
+ __THROW __nonnull ((1));
+
+/* Delete the thread specific data key KEY. The associated destructor
+ function is not called. */
+extern int pthread_key_delete (pthread_key_t __key) __THROW;
+
+/* Return the caller thread's thread specific value of KEY. */
+extern void *pthread_getspecific (pthread_key_t __key) __THROW;
+
+/* Set the caller thread's thread specific value of KEY to VALUE. */
+extern int pthread_setspecific (pthread_key_t __key, const void *__value)
+ __THROW;
+
+
+/* Dynamic package initialization. */
+
+#include <bits/types/struct___pthread_once.h>
+
+#define PTHREAD_ONCE_INIT __PTHREAD_ONCE_INIT
+
+/* Call INIT_ROUTINE if this function has never been called with
+ *ONCE_CONTROL, otherwise do nothing. */
+extern int pthread_once (pthread_once_t *__once_control,
+ void (*__init_routine) (void)) __nonnull ((1, 2));
+
+
+/* Concurrency. */
+
+#ifdef __USE_UNIX98
+/* Set the desired concurrency level to NEW_LEVEL. */
+extern int pthread_setconcurrency (int __new_level) __THROW;
+
+/* Get the current concurrency level. */
+extern int pthread_getconcurrency (void) __THROW;
+#endif
+
+
+/* Forking. */
+
+/* Register the function PREPARE to be run before the process forks,
+ the function PARENT to be run after a fork in the parent and the
+ function CHILD to be run in the child after the fork. If no
+ handling is desired then any of PREPARE, PARENT and CHILD may be
+ NULL. The prepare handles will be called in the reverse order
+ which they were registered and the parent and child handlers in the
+ order in which they were registered. */
+extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void),
+ void (*__child) (void)) __THROW;
+
+
+/* Signals (should be in <signal.h>). */
+
+/* Send signal SIGNO to thread THREAD. */
+extern int pthread_kill (pthread_t __thr, int __signo) __THROW;
+
+
+/* Time. */
+
+#ifdef __USE_XOPEN2K
+/* Return the thread cpu clock. */
+extern int pthread_getcpuclockid (pthread_t __thr, __clockid_t *__clock)
+ __THROW __nonnull ((2));
+#endif
+
+
+/* Scheduling. */
+
+/* Return thread THREAD's scheduling paramters. */
+extern int pthread_getschedparam (pthread_t __thr, int *__restrict __policy,
+ struct sched_param *__restrict __param)
+ __THROW __nonnull ((2, 3));
+
+/* Set thread THREAD's scheduling paramters. */
+extern int pthread_setschedparam (pthread_t __thr, int __policy,
+ const struct sched_param *__param)
+ __THROW __nonnull ((3));
+
+/* Set thread THREAD's scheduling priority. */
+extern int pthread_setschedprio (pthread_t __thr, int __prio) __THROW;
+
+#ifdef __USE_GNU
+/* Yield the processor to another thread or process.
+ This function is similar to the POSIX `sched_yield' function but
+ might be differently implemented in the case of a m-on-n thread
+ implementation. */
+extern int pthread_yield (void) __THROW;
+#endif
+
+
+/* Kernel-specific interfaces. */
+
+#include <bits/pthread-np.h>
+
+
+__END_DECLS
+
+#endif /* pthread.h */
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
new file mode 100644
index 0000000000..132ac1718e
--- /dev/null
+++ b/sysdeps/htl/pthreadP.h
@@ -0,0 +1,74 @@
+/* Declarations of internal pthread functions used by libc. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 _PTHREADP_H
+#define _PTHREADP_H 1
+
+#include <pthread.h>
+
+/* These represent the interface used by glibc itself. */
+
+extern pthread_t __pthread_self (void);
+extern int __pthread_kill (pthread_t threadid, int signo);
+extern struct __pthread **__pthread_threads;
+
+extern int _pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr);
+extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
+extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
+
+extern int __pthread_cond_broadcast (pthread_cond_t *cond);
+
+typedef struct __cthread *__cthread_t;
+typedef int __cthread_key_t;
+typedef void * (*__cthread_fn_t)(void *__arg);
+
+__cthread_t __cthread_fork (__cthread_fn_t, void *);
+int __pthread_create (pthread_t *newthread,
+ const pthread_attr_t *attr,
+ void *(*start_routine) (void *), void *arg);
+
+void __cthread_detach (__cthread_t);
+int __pthread_detach (pthread_t __threadp);
+void __pthread_exit (void *value) __attribute__ ((__noreturn__));
+int __cthread_keycreate (__cthread_key_t *);
+int __cthread_getspecific (__cthread_key_t, void **);
+int __cthread_setspecific (__cthread_key_t, void *);
+int __pthread_key_create (pthread_key_t *key, void (*destr) (void *));
+void *__pthread_getspecific (pthread_key_t key);
+int __pthread_setspecific (pthread_key_t key, const void *value);
+
+int __pthread_setcancelstate (int state, int *oldstate);
+
+int __pthread_getattr_np (pthread_t, pthread_attr_t *);
+int __pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr,
+ void **__restrict __stackaddr);
+int __pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr);
+int __pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr,
+ size_t *__restrict __stacksize);
+int __pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize);
+int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
+ size_t __stacksize);
+int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *);
+struct __pthread_cancelation_handler **___pthread_get_cleanup_stack (void) attribute_hidden;
+
+#if IS_IN (libpthread)
+hidden_proto (__pthread_key_create)
+hidden_proto (_pthread_mutex_init)
+#endif
+
+#endif /* pthreadP.h */
diff --git a/sysdeps/htl/raise.c b/sysdeps/htl/raise.c
new file mode 100644
index 0000000000..d2f21c8a3f
--- /dev/null
+++ b/sysdeps/htl/raise.c
@@ -0,0 +1,51 @@
+/* raise.c - Generic raise implementation.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
+ Written by Neal H. Walfield <neal@gnu.org>.
+
+ This file is part of the GNU Hurd.
+
+ The GNU Hurd is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 3 of
+ the License, or (at your option) any later version.
+
+ The GNU Hurd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <pthreadP.h>
+#include <signal.h>
+#include <unistd.h>
+
+#pragma weak __pthread_kill
+#pragma weak __pthread_self
+#pragma weak __pthread_threads
+int
+raise (int signo)
+{
+ /* According to POSIX, if we implement threads (and we do), then
+ "the effect of the raise() function shall be equivalent to
+ calling: pthread_kill(pthread_self(), sig);" */
+
+ if (__pthread_kill != NULL && __pthread_threads != NULL)
+ {
+ int err;
+ err = __pthread_kill (__pthread_self (), signo);
+ if (err)
+ {
+ errno = err;
+ return -1;
+ }
+ return 0;
+ }
+ else
+ return __kill (__getpid (), signo);
+}
+
+libc_hidden_def (raise)
+weak_alias (raise, gsignal)
diff --git a/sysdeps/htl/sem-close.c b/sysdeps/htl/sem-close.c
new file mode 100644
index 0000000000..002367feb4
--- /dev/null
+++ b/sysdeps/htl/sem-close.c
@@ -0,0 +1,31 @@
+/* Close a named semaphore. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 <semaphore.h>
+#include <errno.h>
+
+#include <pt-internal.h>
+
+int
+__sem_close (sem_t *sem)
+{
+ errno = EOPNOTSUPP;
+ return -1;
+}
+
+strong_alias (__sem_close, sem_close);
diff --git a/sysdeps/htl/sem-destroy.c b/sysdeps/htl/sem-destroy.c
new file mode 100644
index 0000000000..f43bc7eeef
--- /dev/null
+++ b/sysdeps/htl/sem-destroy.c
@@ -0,0 +1,37 @@
+/* Destroy a semaphore. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 <semaphore.h>
+#include <errno.h>
+
+#include <pt-internal.h>
+
+int
+__sem_destroy (sem_t *sem)
+{
+ if (sem->__queue)
+ /* There are threads waiting on *SEM. */
+ {
+ errno = EBUSY;
+ return -1;
+ }
+
+ return 0;
+}
+
+strong_alias (__sem_destroy, sem_destroy);
diff --git a/sysdeps/htl/sem-getvalue.c b/sysdeps/htl/sem-getvalue.c
new file mode 100644
index 0000000000..a63e573013
--- /dev/null
+++ b/sysdeps/htl/sem-getvalue.c
@@ -0,0 +1,32 @@
+/* Get the value of a semaphore. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 <semaphore.h>
+#include <pt-internal.h>
+
+int
+__sem_getvalue (sem_t *restrict sem, int *restrict value)
+{
+ __pthread_spin_lock (&sem->__lock);
+ *value = sem->__value;
+ __pthread_spin_unlock (&sem->__lock);
+
+ return 0;
+}
+
+strong_alias (__sem_getvalue, sem_getvalue);
diff --git a/sysdeps/htl/sem-init.c b/sysdeps/htl/sem-init.c
new file mode 100644
index 0000000000..b05534e793
--- /dev/null
+++ b/sysdeps/htl/sem-init.c
@@ -0,0 +1,45 @@
+/* Initialize a semaphore. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 <semaphore.h>
+#include <errno.h>
+
+#include <pt-internal.h>
+
+int
+__sem_init (sem_t *sem, int pshared, unsigned value)
+{
+ if (pshared != 0)
+ {
+ errno = EOPNOTSUPP;
+ return -1;
+ }
+
+#ifdef SEM_VALUE_MAX
+ if (value > SEM_VALUE_MAX)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+#endif
+
+ *sem = (sem_t) __SEMAPHORE_INITIALIZER (pshared, value);
+ return 0;
+}
+
+strong_alias (__sem_init, sem_init);
diff --git a/sysdeps/htl/sem-open.c b/sysdeps/htl/sem-open.c
new file mode 100644
index 0000000000..21f631de65
--- /dev/null
+++ b/sysdeps/htl/sem-open.c
@@ -0,0 +1,31 @@
+/* Open a named semaphore. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 <semaphore.h>
+#include <errno.h>
+
+#include <pt-internal.h>
+
+sem_t *
+__sem_open (const char *name, int open_flags, ...)
+{
+ errno = EOPNOTSUPP;
+ return SEM_FAILED;
+}
+
+strong_alias (__sem_open, sem_open);
diff --git a/sysdeps/htl/sem-post.c b/sysdeps/htl/sem-post.c
new file mode 100644
index 0000000000..95d4203c06
--- /dev/null
+++ b/sysdeps/htl/sem-post.c
@@ -0,0 +1,61 @@
+/* Post a semaphore. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 <semaphore.h>
+#include <assert.h>
+
+#include <pt-internal.h>
+
+int
+__sem_post (sem_t *sem)
+{
+ struct __pthread *wakeup;
+
+ __pthread_spin_lock (&sem->__lock);
+ if (sem->__value > 0)
+ /* Do a quick up. */
+ {
+ assert (sem->__queue == NULL);
+ sem->__value++;
+ __pthread_spin_unlock (&sem->__lock);
+ return 0;
+ }
+
+ if (sem->__queue == NULL)
+ /* No one waiting. */
+ {
+ sem->__value = 1;
+ __pthread_spin_unlock (&sem->__lock);
+ return 0;
+ }
+
+ /* Wake someone up. */
+
+ /* First dequeue someone. */
+ wakeup = sem->__queue;
+ __pthread_dequeue (wakeup);
+
+ /* Then drop the lock and transfer control. */
+ __pthread_spin_unlock (&sem->__lock);
+
+ __pthread_wakeup (wakeup);
+
+ return 0;
+}
+
+strong_alias (__sem_post, sem_post);
diff --git a/sysdeps/htl/sem-timedwait.c b/sysdeps/htl/sem-timedwait.c
new file mode 100644
index 0000000000..803a5c04f4
--- /dev/null
+++ b/sysdeps/htl/sem-timedwait.c
@@ -0,0 +1,98 @@
+/* Wait on a semaphore with a timeout. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 <semaphore.h>
+#include <errno.h>
+#include <assert.h>
+
+#include <pt-internal.h>
+
+int
+__sem_timedwait_internal (sem_t *restrict sem,
+ const struct timespec *restrict timeout)
+{
+ error_t err;
+ int drain;
+ struct __pthread *self;
+
+ __pthread_spin_lock (&sem->__lock);
+ if (sem->__value > 0)
+ /* Successful down. */
+ {
+ sem->__value--;
+ __pthread_spin_unlock (&sem->__lock);
+ return 0;
+ }
+
+ if (timeout != NULL && (timeout->tv_nsec < 0 || timeout->tv_nsec >= 1000000000))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* Add ourselves to the queue. */
+ self = _pthread_self ();
+
+ __pthread_enqueue (&sem->__queue, self);
+ __pthread_spin_unlock (&sem->__lock);
+
+ /* Block the thread. */
+ if (timeout != NULL)
+ err = __pthread_timedblock (self, timeout, CLOCK_REALTIME);
+ else
+ {
+ err = 0;
+ __pthread_block (self);
+ }
+
+ __pthread_spin_lock (&sem->__lock);
+ if (self->prevp == NULL)
+ /* Another thread removed us from the queue, which means a wakeup message
+ has been sent. It was either consumed while we were blocking, or
+ queued after we timed out and before we acquired the semaphore lock, in
+ which case the message queue must be drained. */
+ drain = err ? 1 : 0;
+ else
+ {
+ /* We're still in the queue. Noone attempted to wake us up, i.e. we
+ timed out. */
+ __pthread_dequeue (self);
+ drain = 0;
+ }
+ __pthread_spin_unlock (&sem->__lock);
+
+ if (drain)
+ __pthread_block (self);
+
+ if (err)
+ {
+ assert (err == ETIMEDOUT);
+ errno = err;
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+__sem_timedwait (sem_t *restrict sem, const struct timespec *restrict timeout)
+{
+ return __sem_timedwait_internal (sem, timeout);
+}
+
+weak_alias (__sem_timedwait, sem_timedwait);
diff --git a/sysdeps/htl/sem-trywait.c b/sysdeps/htl/sem-trywait.c
new file mode 100644
index 0000000000..bb12dd8b2e
--- /dev/null
+++ b/sysdeps/htl/sem-trywait.c
@@ -0,0 +1,41 @@
+/* Lock a semaphore if it does not require blocking. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 <semaphore.h>
+#include <errno.h>
+
+#include <pt-internal.h>
+
+int
+__sem_trywait (sem_t *sem)
+{
+ __pthread_spin_lock (&sem->__lock);
+ if (sem->__value > 0)
+ /* Successful down. */
+ {
+ sem->__value--;
+ __pthread_spin_unlock (&sem->__lock);
+ return 0;
+ }
+ __pthread_spin_unlock (&sem->__lock);
+
+ errno = EAGAIN;
+ return -1;
+}
+
+strong_alias (__sem_trywait, sem_trywait);
diff --git a/sysdeps/htl/sem-unlink.c b/sysdeps/htl/sem-unlink.c
new file mode 100644
index 0000000000..c669db5447
--- /dev/null
+++ b/sysdeps/htl/sem-unlink.c
@@ -0,0 +1,31 @@
+/* Unlink a named semaphore. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 <semaphore.h>
+#include <errno.h>
+
+#include <pt-internal.h>
+
+int
+__sem_unlink (const char *name)
+{
+ errno = EOPNOTSUPP;
+ return -1;
+}
+
+strong_alias (__sem_unlink, sem_unlink);
diff --git a/sysdeps/htl/sem-wait.c b/sysdeps/htl/sem-wait.c
new file mode 100644
index 0000000000..9fcd22781b
--- /dev/null
+++ b/sysdeps/htl/sem-wait.c
@@ -0,0 +1,31 @@
+/* Wait on a semaphore. Generic version.
+ Copyright (C) 2005-2018 Free Software 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 <semaphore.h>
+#include <pt-internal.h>
+
+extern int __sem_timedwait_internal (sem_t *restrict sem,
+ const struct timespec *restrict timeout);
+
+int
+__sem_wait (sem_t *sem)
+{
+ return __sem_timedwait_internal (sem, 0);
+}
+
+strong_alias (__sem_wait, sem_wait);
diff --git a/sysdeps/htl/shm-directory.h b/sysdeps/htl/shm-directory.h
new file mode 100644
index 0000000000..cddd5e5144
--- /dev/null
+++ b/sysdeps/htl/shm-directory.h
@@ -0,0 +1,30 @@
+/* Header for directory for shm/sem files. libpthread version.
+ Copyright (C) 2014-2018 Free Software 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 _SHM_DIRECTORY_H
+
+#include <sysdeps/posix/shm-directory.h>
+
+/* For libpthread the __shm_directory function lives in libpthread.
+ We don't want PLT calls from there. But it's also used from
+ librt, so it cannot just be declared hidden. */
+
+#if IS_IN (libpthread)
+hidden_proto (__shm_directory)
+#endif
+#endif /* shm-directory.h */
diff --git a/sysdeps/htl/threads.h b/sysdeps/htl/threads.h
new file mode 100644
index 0000000000..3c04fbcc79
--- /dev/null
+++ b/sysdeps/htl/threads.h
@@ -0,0 +1 @@
+#error "HTL does not implement ISO C threads"
diff --git a/sysdeps/htl/timer_routines.h b/sysdeps/htl/timer_routines.h
new file mode 100644
index 0000000000..a8134f510f
--- /dev/null
+++ b/sysdeps/htl/timer_routines.h
@@ -0,0 +1,46 @@
+/* Helper code for POSIX timer implementation on Hurd.
+ Copyright (C) 2000-2018 Free Software 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 _TIMER_ROUTINES_H
+#define _TIMER_ROUTINES_H 1
+
+#include <bits/pthreadtypes.h>
+
+/* Compare two pthread_attr_t thread attributes for exact equality.
+ Returns 1 if they are equal, otherwise zero if they are not equal
+ or contain illegal values. This version is Hurd-specific for
+ performance reason. One could use the access functions to get the
+ values of all the fields of the attribute structure. */
+static inline int
+thread_attr_compare (const pthread_attr_t * left, const pthread_attr_t * right)
+{
+ struct __pthread_attr *ileft = (struct __pthread_attr *) left;
+ struct __pthread_attr *iright = (struct __pthread_attr *) right;
+
+ return ileft->__schedparam.sched_priority
+ == iright->__schedparam.sched_priority
+ && ileft->__stackaddr == iright->__stackaddr
+ && ileft->__stacksize == iright->__stacksize
+ && ileft->__guardsize == iright->__guardsize
+ && ileft->__detachstate == iright->__detachstate
+ && ileft->__inheritsched == iright->__inheritsched
+ && ileft->__contentionscope == iright->__contentionscope
+ && ileft->__schedpolicy == iright->__schedpolicy;
+}
+
+#endif /* timer_routines.h */
diff --git a/sysdeps/hurd/htl/pt-kill.c b/sysdeps/hurd/htl/pt-kill.c
new file mode 100644
index 0000000000..c5060e785d
--- /dev/null
+++ b/sysdeps/hurd/htl/pt-kill.c
@@ -0,0 +1,51 @@
+/* pthread_kill. Hurd version.
+ Copyright (C) 2002-2018 Free Software 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 <assert.h>
+#include <signal.h>
+#include <hurd/signal.h>
+
+#include <pt-internal.h>
+
+int
+__pthread_kill (pthread_t thread, int sig)
+{
+ struct __pthread *pthread;
+ struct hurd_signal_detail detail;
+ struct hurd_sigstate *ss;
+
+ /* Lookup the thread structure for THREAD. */
+ pthread = __pthread_getid (thread);
+ if (pthread == NULL)
+ return ESRCH;
+
+ ss = _hurd_thread_sigstate (pthread->kernel_thread);
+ assert (ss);
+
+ if (sig == 0)
+ return 0;
+
+ detail.exc = 0;
+ detail.code = sig;
+ detail.error = 0;
+
+ __spin_lock (&ss->lock);
+ return _hurd_raise_signal (ss, sig, &detail);
+}
+strong_alias (__pthread_kill, pthread_kill)
diff --git a/sysdeps/hurd/include/hurd.h b/sysdeps/hurd/include/hurd.h
new file mode 100644
index 0000000000..d29f580d5b
--- /dev/null
+++ b/sysdeps/hurd/include/hurd.h
@@ -0,0 +1,7 @@
+#ifndef _HURD_H
+#include_next <hurd.h>
+#ifndef _ISOMAC
+libc_hidden_proto (_hurd_exec_paths)
+libc_hidden_proto (_hurd_init)
+#endif
+#endif
diff --git a/sysdeps/hurd/include/hurd/fd.h b/sysdeps/hurd/include/hurd/fd.h
new file mode 100644
index 0000000000..1f3ac380a0
--- /dev/null
+++ b/sysdeps/hurd/include/hurd/fd.h
@@ -0,0 +1,12 @@
+#ifndef _HURD_FD_H
+#include_next <hurd/fd.h>
+#ifndef _ISOMAC
+libc_hidden_proto (_hurd_intern_fd)
+libc_hidden_proto (_hurd_fd_error)
+libc_hidden_proto (_hurd_fd_error_signal)
+# ifdef _HURD_FD_H_HIDDEN_DEF
+libc_hidden_def (_hurd_fd_error)
+libc_hidden_def (_hurd_fd_error_signal)
+# endif
+#endif
+#endif
diff --git a/sysdeps/hurd/include/hurd/port.h b/sysdeps/hurd/include/hurd/port.h
new file mode 100644
index 0000000000..ca1d2d111a
--- /dev/null
+++ b/sysdeps/hurd/include/hurd/port.h
@@ -0,0 +1,11 @@
+#ifndef _HURD_PORT_H
+#include_next <hurd/port.h>
+#ifndef _ISOMAC
+libc_hidden_proto (_hurd_port_locked_get)
+libc_hidden_proto (_hurd_port_locked_set)
+#ifdef _HURD_PORT_H_HIDDEN_DEF
+libc_hidden_def (_hurd_port_locked_get)
+libc_hidden_def (_hurd_port_locked_set)
+#endif
+#endif
+#endif
diff --git a/sysdeps/hurd/include/hurd/signal.h b/sysdeps/hurd/include/hurd/signal.h
new file mode 100644
index 0000000000..8ceab328c5
--- /dev/null
+++ b/sysdeps/hurd/include/hurd/signal.h
@@ -0,0 +1,18 @@
+#ifndef _HURD_SIGNAL_H
+extern struct hurd_sigstate *_hurd_self_sigstate (void) __attribute__ ((__const__));
+#ifndef _ISOMAC
+libc_hidden_proto (_hurd_self_sigstate)
+#endif
+
+#include_next <hurd/signal.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (_hurd_exception2signal)
+libc_hidden_proto (_hurd_intr_rpc_mach_msg)
+libc_hidden_proto (_hurd_thread_sigstate)
+libc_hidden_proto (_hurd_raise_signal)
+#endif
+#ifdef _HURD_SIGNAL_H_HIDDEN_DEF
+libc_hidden_def (_hurd_self_sigstate)
+#endif
+#endif
diff --git a/sysdeps/hurd/stdc-predef.h b/sysdeps/hurd/stdc-predef.h
new file mode 100644
index 0000000000..4c11188224
--- /dev/null
+++ b/sysdeps/hurd/stdc-predef.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 2018 Free Software 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 _STDC_PREDEF_H
+#define _STDC_PREDEF_H 1
+
+/* This header is separate from features.h so that the compiler can
+ include it implicitly at the start of every compilation. It must
+ not itself include <features.h> or any other header that includes
+ <features.h> because the implicit include comes before any feature
+ test macros that may be defined in a source file before it first
+ explicitly includes a system header. GCC knows the name of this
+ header in order to preinclude it. */
+
+/* glibc's intent is to support the IEC 559 math functionality, real
+ and complex. If the GCC (4.9 and later) predefined macros
+ specifying compiler intent are available, use them to determine
+ whether the overall intent is to support these features; otherwise,
+ presume an older compiler has intent to support these features and
+ define these macros by default. */
+
+#ifdef __GCC_IEC_559
+# if __GCC_IEC_559 > 0
+# define __STDC_IEC_559__ 1
+# endif
+#else
+# define __STDC_IEC_559__ 1
+#endif
+
+#ifdef __GCC_IEC_559_COMPLEX
+# if __GCC_IEC_559_COMPLEX > 0
+# define __STDC_IEC_559_COMPLEX__ 1
+# endif
+#else
+# define __STDC_IEC_559_COMPLEX__ 1
+#endif
+
+/* wchar_t uses Unicode 10.0.0. Version 10.0 of the Unicode Standard is
+ synchronized with ISO/IEC 10646:2017, fifth edition, plus
+ the following additions from Amendment 1 to the fifth edition:
+ - 56 emoji characters
+ - 285 hentaigana
+ - 3 additional Zanabazar Square characters */
+#define __STDC_ISO_10646__ 201706L
+
+/* We do not support C11 <threads.h>. */
+#define __STDC_NO_THREADS__ 1
+
+#endif
diff --git a/sysdeps/i386/Implies b/sysdeps/i386/Implies
index 20b2dffc29..76cb207173 100644
--- a/sysdeps/i386/Implies
+++ b/sysdeps/i386/Implies
@@ -1,5 +1,6 @@
x86
wordsize-32
+ieee754/float128
ieee754/ldbl-96
ieee754/dbl-64
ieee754/flt-32
diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
index 168512fc32..c0a4fe15d4 100644
--- a/sysdeps/i386/Makefile
+++ b/sysdeps/i386/Makefile
@@ -5,6 +5,14 @@ asm-CPPFLAGS += -DGAS_SYNTAX
# The i386 `long double' is a distinct type we support.
long-double-fcts = yes
+ifeq ($(subdir),math)
+# These functions change the rounding mode internally and need to
+# update both the SSE2 rounding mode and the 387 rounding mode. See
+# the handling of MATH_SET_BOTH_ROUNDING_MODES in
+# sysdeps/i386/fpu/fenv_private.h.
+CFLAGS-e_gamma_r.c += -DMATH_SET_BOTH_ROUNDING_MODES
+endif
+
ifeq ($(subdir),string)
sysdep_routines += cacheinfo
endif
@@ -19,50 +27,10 @@ CFLAGS-dl-load.c += -Wno-unused
CFLAGS-dl-reloc.c += -Wno-unused
endif
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -fexceptions
-endif
-
-# Most of the glibc routines don't ever call user defined callbacks
-# nor use any FPU or SSE* and as such don't need bigger %esp alignment
-# than 4 bytes.
-# Lots of routines in math will use FPU, so make math subdir an exception
-# here.
-# In gcc 4.6 (and maybe earlier?) giving -mpreferred-stack-boundary=2 is
-# an error, so don't try to reduce it here like we used to. We still
-# explicit set -mpreferred-stack-boundary=4 the places where it matters,
-# in case an older compiler defaulted to 2.
-ifeq ($(subdir),math)
-sysdep-CFLAGS += -mpreferred-stack-boundary=4
-else
ifeq ($(subdir),csu)
-sysdep-CFLAGS += -mpreferred-stack-boundary=4
gen-as-const-headers += link-defines.sym
else
-# Likewise, any function which calls user callbacks
-uses-callbacks += -mpreferred-stack-boundary=4
-# Likewise, any stack alignment tests
-stack-align-test-flags += -malign-double -mpreferred-stack-boundary=4
-endif
-endif
-
-# And a couple of other routines
-ifeq ($(subdir),stdlib)
-CFLAGS-exit.c += -mpreferred-stack-boundary=4
-CFLAGS-cxa_finalize.c += -mpreferred-stack-boundary=4
-endif
-ifeq ($(subdir),elf)
-CFLAGS-dl-init.c += -mpreferred-stack-boundary=4
-CFLAGS-dl-fini.c += -mpreferred-stack-boundary=4
-CFLAGS-dl-open.c += -mpreferred-stack-boundary=4
-CFLAGS-dl-close.c += -mpreferred-stack-boundary=4
-CFLAGS-dl-error.c += -mpreferred-stack-boundary=4
-endif
-ifeq ($(subdir),dlfcn)
-CFLAGS-dlopen.c += -mpreferred-stack-boundary=4
-CFLAGS-dlopenold.c += -mpreferred-stack-boundary=4
-CFLAGS-dlclose.c += -mpreferred-stack-boundary=4
-CFLAGS-dlerror.c += -mpreferred-stack-boundary=4
+stack-align-test-flags += -malign-double
endif
ifneq (,$(filter -mno-tls-direct-seg-refs,$(CFLAGS)))
@@ -84,16 +52,20 @@ ifeq ($(subdir),csu)
gen-as-const-headers += tlsdesc.sym
endif
-ifeq ($(subdir),elf)
# Make sure no code in ld.so uses mm/xmm/ymm/zmm registers on i386 since
# the first 3 mm/xmm/ymm/zmm registers are used to pass vector parameters
# which must be preserved.
+# With SSE disabled, ensure -fpmath is not set to use sse either.
+rtld-CFLAGS += -mno-sse -mno-mmx -mfpmath=387
+ifeq ($(subdir),elf)
CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
- -mno-sse -mno-mmx)
+ $(rtld-CFLAGS))
tests-special += $(objpfx)tst-ld-sse-use.out
$(objpfx)tst-ld-sse-use.out: ../sysdeps/i386/tst-ld-sse-use.sh $(objpfx)ld.so
@echo "Checking ld.so for SSE register use. This will take a few seconds..."
$(BASH) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@; \
$(evaluate-test)
+else
+CFLAGS-.os += $(if $(filter rtld-%.os,$(@F)), $(rtld-CFLAGS))
endif
diff --git a/sysdeps/i386/__longjmp.S b/sysdeps/i386/__longjmp.S
index 36c692209e..6e98ed538d 100644
--- a/sysdeps/i386/__longjmp.S
+++ b/sysdeps/i386/__longjmp.S
@@ -1,5 +1,5 @@
/* longjmp for i386.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,14 +18,55 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
+#include <jmp_buf-ssp.h>
#include <asm-syntax.h>
#include <stap-probe.h>
+/* Don't restore shadow stack register if
+ 1. Shadow stack isn't enabled. Or
+ 2. __longjmp is defined for __longjmp_cancel.
+ */
+#if !SHSTK_ENABLED || defined __longjmp
+# undef SHADOW_STACK_POINTER_OFFSET
+#endif
+
.text
ENTRY (__longjmp)
#ifdef PTR_DEMANGLE
movl 4(%esp), %eax /* User's jmp_buf in %eax. */
+# ifdef SHADOW_STACK_POINTER_OFFSET
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+ /* Check if Shadow Stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %gs:FEATURE_1_OFFSET
+ jz L(skip_ssp)
+# else
+ xorl %edx, %edx
+# endif
+ /* Check and adjust the Shadow-Stack-Pointer. */
+ rdsspd %edx
+ /* And compare it with the saved ssp value. */
+ subl SHADOW_STACK_POINTER_OFFSET(%eax), %edx
+ je L(skip_ssp)
+ /* Count the number of frames to adjust and adjust it
+ with incssp instruction. The instruction can adjust
+ the ssp by [0..255] value only thus use a loop if
+ the number of frames is bigger than 255. */
+ negl %edx
+ shrl $2, %edx
+ /* NB: We saved Shadow-Stack-Pointer of setjmp. Since we are
+ restoring Shadow-Stack-Pointer of setjmp's caller, we
+ need to unwind shadow stack by one more frame. */
+ addl $1, %edx
+ movl $255, %ebx
+L(loop):
+ cmpl %ebx, %edx
+ cmovb %edx, %ebx
+ incsspd %ebx
+ subl %ebx, %edx
+ ja L(loop)
+L(skip_ssp):
+# endif
/* Save the return address now. */
movl (JB_PC*4)(%eax), %edx
/* Get the stack pointer. */
@@ -56,6 +97,38 @@ ENTRY (__longjmp)
#else
movl 4(%esp), %ecx /* User's jmp_buf in %ecx. */
movl 8(%esp), %eax /* Second argument is return value. */
+# ifdef SHADOW_STACK_POINTER_OFFSET
+# if IS_IN (libc) && defined SHARED
+ /* Check if Shadow Stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %gs:FEATURE_1_OFFSET
+ jz L(skip_ssp)
+# endif
+ /* Check and adjust the Shadow-Stack-Pointer. */
+ xorl %edx, %edx
+ /* Get the current ssp. */
+ rdsspd %edx
+ /* And compare it with the saved ssp value. */
+ subl SHADOW_STACK_POINTER_OFFSET(%ecx), %edx
+ je L(skip_ssp)
+ /* Count the number of frames to adjust and adjust it
+ with incssp instruction. The instruction can adjust
+ the ssp by [0..255] value only thus use a loop if
+ the number of frames is bigger than 255. */
+ negl %edx
+ shrl $2, %edx
+ /* NB: We saved Shadow-Stack-Pointer of setjmp. Since we are
+ restoring Shadow-Stack-Pointer of setjmp's caller, we
+ need to unwind shadow stack by one more frame. */
+ addl $1, %edx
+ movl $255, %ebx
+L(loop):
+ cmpl %ebx, %edx
+ cmovb %edx, %ebx
+ incsspd %ebx
+ subl %ebx, %edx
+ ja L(loop)
+L(skip_ssp):
+# endif
/* Save the return address now. */
movl (JB_PC*4)(%ecx), %edx
LIBC_PROBE (longjmp, 3, 4@%ecx, -4@%eax, 4@%edx)
diff --git a/sysdeps/i386/add_n.S b/sysdeps/i386/add_n.S
index 5ef5afc378..998858469c 100644
--- a/sysdeps/i386/add_n.S
+++ b/sysdeps/i386/add_n.S
@@ -1,6 +1,6 @@
/* Add two limb vectors of the same length > 0 and store sum in a third
limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
along with the GNU MP Library; see the file COPYING.LIB. If not,
see <http://www.gnu.org/licenses/>. */
-#include "sysdep.h"
+#include <sysdep.h>
#include "asm-syntax.h"
#define PARMS 4+8 /* space for 2 saved regs */
@@ -40,6 +40,13 @@ ENTRY (__mpn_add_n)
cfi_rel_offset (esi, 0)
movl S2(%esp),%edx
movl SIZE(%esp),%ecx
+
+#if IBT_ENABLED
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+#endif
+
movl %ecx,%eax
shrl $3,%ecx /* compute count for unrolled loop */
negl %eax
@@ -51,6 +58,9 @@ ENTRY (__mpn_add_n)
subl %eax,%esi /* ... by a constant when we ... */
subl %eax,%edx /* ... enter the loop */
shrl $2,%eax /* restore previous value */
+#if IBT_ENABLED
+ leal -4(,%eax,4),%ebx /* Count for 4-byte endbr32 */
+#endif
#ifdef PIC
/* Calculate start address in loop for PIC. Due to limitations in some
assemblers, Loop-L0-3 cannot be put into the leal */
@@ -65,29 +75,39 @@ L(0): leal (%eax,%eax,8),%eax
/* Calculate start address in loop for non-PIC. */
leal (L(oop) - 3)(%eax,%eax,8),%eax
#endif
+#if IBT_ENABLED
+ addl %ebx,%eax /* Adjust for endbr32 */
+#endif
jmp *%eax /* jump into loop */
ALIGN (3)
L(oop): movl (%esi),%eax
adcl (%edx),%eax
movl %eax,(%edi)
+ _CET_ENDBR
movl 4(%esi),%eax
adcl 4(%edx),%eax
movl %eax,4(%edi)
+ _CET_ENDBR
movl 8(%esi),%eax
adcl 8(%edx),%eax
movl %eax,8(%edi)
+ _CET_ENDBR
movl 12(%esi),%eax
adcl 12(%edx),%eax
movl %eax,12(%edi)
+ _CET_ENDBR
movl 16(%esi),%eax
adcl 16(%edx),%eax
movl %eax,16(%edi)
+ _CET_ENDBR
movl 20(%esi),%eax
adcl 20(%edx),%eax
movl %eax,20(%edi)
+ _CET_ENDBR
movl 24(%esi),%eax
adcl 24(%edx),%eax
movl %eax,24(%edi)
+ _CET_ENDBR
movl 28(%esi),%eax
adcl 28(%edx),%eax
movl %eax,28(%edi)
@@ -100,6 +120,11 @@ L(oop): movl (%esi),%eax
sbbl %eax,%eax
negl %eax
+#if IBT_ENABLED
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#endif
popl %esi
cfi_adjust_cfa_offset (-4)
cfi_restore (esi)
diff --git a/sysdeps/i386/addmul_1.S b/sysdeps/i386/addmul_1.S
index f211263702..36f6ff2697 100644
--- a/sysdeps/i386/addmul_1.S
+++ b/sysdeps/i386/addmul_1.S
@@ -1,6 +1,6 @@
/* i80386 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
the result to a second limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/i386/asm-syntax.h b/sysdeps/i386/asm-syntax.h
index ef87d69f53..398a0621cc 100644
--- a/sysdeps/i386/asm-syntax.h
+++ b/sysdeps/i386/asm-syntax.h
@@ -1,5 +1,5 @@
/* Definitions for x86 syntax variations.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in the GNU MP Library.
diff --git a/sysdeps/i386/atomic-machine.h b/sysdeps/i386/atomic-machine.h
index ce62b335af..272da5dd8f 100644
--- a/sysdeps/i386/atomic-machine.h
+++ b/sysdeps/i386/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -56,6 +56,7 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+#define ATOMIC_EXCHANGE_USES_CAS 0
#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
diff --git a/sysdeps/i386/backtrace.c b/sysdeps/i386/backtrace.c
index 1ec51aaf43..da033379e7 100644
--- a/sysdeps/i386/backtrace.c
+++ b/sysdeps/i386/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/i386/bsd-_setjmp.S b/sysdeps/i386/bsd-_setjmp.S
index d97964a641..db47df0ba1 100644
--- a/sysdeps/i386/bsd-_setjmp.S
+++ b/sysdeps/i386/bsd-_setjmp.S
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. i386 version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,12 +22,18 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
+#include <jmp_buf-ssp.h>
#include <stap-probe.h>
#define PARMS 4 /* no space for saved regs */
#define JMPBUF PARMS
#define SIGMSK JMPBUF+4
+/* Don't save shadow stack register if shadow stack isn't enabled. */
+#if !SHSTK_ENABLED
+# undef SHADOW_STACK_POINTER_OFFSET
+#endif
+
ENTRY (_setjmp)
xorl %eax, %eax
@@ -51,6 +57,21 @@ ENTRY (_setjmp)
movl %ebp, (JB_BP*4)(%edx) /* Save caller's frame pointer. */
movl %eax, JB_SIZE(%edx) /* No signal mask set. */
+#ifdef SHADOW_STACK_POINTER_OFFSET
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+ /* Check if Shadow Stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %gs:FEATURE_1_OFFSET
+ jz L(skip_ssp)
+# else
+ xorl %ecx, %ecx
+# endif
+ /* Get the current Shadow-Stack-Pointer and save it. */
+ rdsspd %ecx
+ movl %ecx, SHADOW_STACK_POINTER_OFFSET(%edx)
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+L(skip_ssp):
+# endif
+#endif
ret
END (_setjmp)
libc_hidden_def (_setjmp)
diff --git a/sysdeps/i386/bsd-setjmp.S b/sysdeps/i386/bsd-setjmp.S
index a6e7c1ab88..1290d0d82b 100644
--- a/sysdeps/i386/bsd-setjmp.S
+++ b/sysdeps/i386/bsd-setjmp.S
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. i386 version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,12 +22,18 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
+#include <jmp_buf-ssp.h>
#include <stap-probe.h>
#define PARMS 4 /* no space for saved regs */
#define JMPBUF PARMS
#define SIGMSK JMPBUF+4
+/* Don't save shadow stack register if shadow stack isn't enabled. */
+#if !SHSTK_ENABLED
+# undef SHADOW_STACK_POINTER_OFFSET
+#endif
+
ENTRY (setjmp)
/* Note that we have to use a non-exported symbol in the next
jump since otherwise gas will emit it as a jump through the
@@ -51,6 +57,21 @@ ENTRY (setjmp)
#endif
movl %ecx, (JB_PC*4)(%eax)
movl %ebp, (JB_BP*4)(%eax) /* Save caller's frame pointer. */
+#ifdef SHADOW_STACK_POINTER_OFFSET
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+ /* Check if Shadow Stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %gs:FEATURE_1_OFFSET
+ jz L(skip_ssp)
+# else
+ xorl %ecx, %ecx
+# endif
+ /* Get the current Shadow-Stack-Pointer and save it. */
+ rdsspd %ecx
+ movl %ecx, SHADOW_STACK_POINTER_OFFSET(%eax)
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+L(skip_ssp):
+# endif
+#endif
/* Call __sigjmp_save. */
pushl $1
diff --git a/sysdeps/i386/cacheinfo.c b/sysdeps/i386/cacheinfo.c
index 0b50c6d346..f15fe0779a 100644
--- a/sysdeps/i386/cacheinfo.c
+++ b/sysdeps/i386/cacheinfo.c
@@ -1,3 +1,3 @@
#define DISABLE_PREFETCHW
-#include <sysdeps/x86_64/cacheinfo.c>
+#include <sysdeps/x86/cacheinfo.c>
diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure
index 9515719daa..90c63caf35 100644
--- a/sysdeps/i386/configure
+++ b/sysdeps/i386/configure
@@ -26,7 +26,7 @@ libc_compiler_builtin_inlined=no
cat > conftest.c <<EOF
int _start (void) { int a, b, c; __sync_val_compare_and_swap (&a, b, c); return 0; }
EOF
-if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
-O0 -nostdlib -nostartfiles
-S conftest.c -o - | fgrep "__sync_val_compare_and_swap"
1>&5'
@@ -50,6 +50,39 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_compiler_builtin_inlined" >&5
$as_echo "$libc_compiler_builtin_inlined" >&6; }
+if test "$static_pie" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker static PIE support" >&5
+$as_echo_n "checking for linker static PIE support... " >&6; }
+if ${libc_cv_ld_static_pie+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.s <<\EOF
+ .text
+ .global _start
+_start:
+ movl _start@GOT(%ebx), %eax
+EOF
+ libc_cv_pie_option="-Wl,-pie"
+ libc_cv_ld_static_pie=no
+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostartfiles -nostdlib $no_ssp $libc_cv_pie_option -o conftest conftest.s 1>&5'
+ { { 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
+ if $READELF -r conftest | grep 'There are no relocations in this file.' > /dev/null; then
+ libc_cv_ld_static_pie=yes
+ fi
+ fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ld_static_pie" >&5
+$as_echo "$libc_cv_ld_static_pie" >&6; }
+ if test "$libc_cv_ld_static_pie" != yes; then
+ as_fn_error $? "linker support for static PIE needed" "$LINENO" 5
+ fi
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Intel MPX support" >&5
$as_echo_n "checking for Intel MPX support... " >&6; }
if ${libc_cv_asm_mpx+:} false; then :
@@ -72,13 +105,15 @@ rm -f conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_mpx" >&5
$as_echo "$libc_cv_asm_mpx" >&6; }
-if test $libc_cv_asm_mpx == yes; then
+if test $libc_cv_asm_mpx = yes; then
$as_echo "#define HAVE_MPX_SUPPORT 1" >>confdefs.h
fi
-$as_echo "#define USE_REGPARMS 1" >>confdefs.h
+$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
-$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
+if test x"$multi_arch" != xno; then
+ $as_echo "#define NO_HIDDEN_EXTERN_FUNC_IN_PIE 1" >>confdefs.h
+fi
diff --git a/sysdeps/i386/configure.ac b/sysdeps/i386/configure.ac
index f8f9e44909..6d2068d2b3 100644
--- a/sysdeps/i386/configure.ac
+++ b/sysdeps/i386/configure.ac
@@ -30,6 +30,29 @@ LIBC_COMPILER_BUILTIN_INLINED(
*** Please use host i786, i686, i586, or i486.
*** For example: /source/glibc/configure CFLAGS='-O2 -march=i686' ...])])
+dnl Check if linker can convert "movl main@GOT(%ebx), %eax" to
+dnl "leal main@GOTOFF(%ebx), %eax" for static PIE.
+if test "$static_pie" = yes; then
+ AC_CACHE_CHECK(for linker static PIE support, libc_cv_ld_static_pie, [dnl
+cat > conftest.s <<\EOF
+ .text
+ .global _start
+_start:
+ movl _start@GOT(%ebx), %eax
+EOF
+ libc_cv_pie_option="-Wl,-pie"
+ libc_cv_ld_static_pie=no
+ if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostartfiles -nostdlib $no_ssp $libc_cv_pie_option -o conftest conftest.s 1>&AS_MESSAGE_LOG_FD); then
+ if $READELF -r conftest | grep 'There are no relocations in this file.' > /dev/null; then
+ libc_cv_ld_static_pie=yes
+ fi
+ fi
+rm -f conftest*])
+ if test "$libc_cv_ld_static_pie" != yes; then
+ AC_MSG_ERROR([linker support for static PIE needed])
+ fi
+fi
+
dnl Check whether asm supports Intel MPX
AC_CACHE_CHECK(for Intel MPX support, libc_cv_asm_mpx, [dnl
cat > conftest.s <<\EOF
@@ -41,12 +64,16 @@ else
libc_cv_asm_mpx=no
fi
rm -f conftest*])
-if test $libc_cv_asm_mpx == yes; then
+if test $libc_cv_asm_mpx = yes; then
AC_DEFINE(HAVE_MPX_SUPPORT)
fi
-AC_DEFINE(USE_REGPARMS)
-
dnl It is always possible to access static and hidden symbols in an
dnl position independent way.
AC_DEFINE(PI_STATIC_AND_HIDDEN)
+
+dnl When multi-arch is enabled, all external functions must be called
+dnl via PIC PLT in PIE, which requires setting up EBX register.
+if test x"$multi_arch" != xno; then
+ AC_DEFINE(NO_HIDDEN_EXTERN_FUNC_IN_PIE)
+fi
diff --git a/sysdeps/i386/crti.S b/sysdeps/i386/crti.S
index 2fbc5711e3..65ddc1c934 100644
--- a/sysdeps/i386/crti.S
+++ b/sysdeps/i386/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for x86.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,8 +58,10 @@
.section .init,"ax",@progbits
.p2align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
+ _CET_ENDBR
pushl %ebx
/* Maintain 16-byte stack alignment for called functions. */
subl $8, %esp
@@ -68,7 +70,7 @@ _init:
movl PREINIT_FUNCTION@GOT(%ebx), %eax
testl %eax, %eax
je .Lno_weak_fn
- call PREINIT_FUNCTION@PLT
+ call *%eax
.Lno_weak_fn:
#else
call PREINIT_FUNCTION
@@ -77,8 +79,10 @@ _init:
.section .fini,"ax",@progbits
.p2align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
+ _CET_ENDBR
pushl %ebx
subl $8, %esp
LOAD_PIC_REG (bx)
diff --git a/sysdeps/i386/crtn.S b/sysdeps/i386/crtn.S
index 1445f03ccc..e3a0f1e310 100644
--- a/sysdeps/i386/crtn.S
+++ b/sysdeps/i386/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for x86.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/dl-cet.c b/sysdeps/i386/dl-cet.c
new file mode 100644
index 0000000000..5d9a4e8d51
--- /dev/null
+++ b/sysdeps/i386/dl-cet.c
@@ -0,0 +1,67 @@
+/* Linux/i386 CET initializers function.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 LINKAGE static inline
+#define _dl_cet_check cet_check
+#include <sysdeps/x86/dl-cet.c>
+#undef _dl_cet_check
+
+#ifdef SHARED
+void
+_dl_cet_check (struct link_map *main_map, const char *program)
+{
+ cet_check (main_map, program);
+
+ if ((GL(dl_x86_feature_1)[0] & GNU_PROPERTY_X86_FEATURE_1_SHSTK))
+ {
+ /* Replace _dl_runtime_resolve and _dl_runtime_profile with
+ _dl_runtime_resolve_shstk and _dl_runtime_profile_shstk,
+ respectively if SHSTK is enabled. */
+ extern void _dl_runtime_resolve (Elf32_Word) attribute_hidden;
+ extern void _dl_runtime_resolve_shstk (Elf32_Word) attribute_hidden;
+ extern void _dl_runtime_profile (Elf32_Word) attribute_hidden;
+ extern void _dl_runtime_profile_shstk (Elf32_Word) attribute_hidden;
+ unsigned int i;
+ struct link_map *l;
+ Elf32_Addr *got;
+
+ if (main_map->l_info[DT_JMPREL])
+ {
+ got = (Elf32_Addr *) D_PTR (main_map, l_info[DT_PLTGOT]);
+ if (got[2] == (Elf32_Addr) &_dl_runtime_resolve)
+ got[2] = (Elf32_Addr) &_dl_runtime_resolve_shstk;
+ else if (got[2] == (Elf32_Addr) &_dl_runtime_profile)
+ got[2] = (Elf32_Addr) &_dl_runtime_profile_shstk;
+ }
+
+ i = main_map->l_searchlist.r_nlist;
+ while (i-- > 0)
+ {
+ l = main_map->l_initfini[i];
+ if (l->l_info[DT_JMPREL])
+ {
+ got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
+ if (got[2] == (Elf32_Addr) &_dl_runtime_resolve)
+ got[2] = (Elf32_Addr) &_dl_runtime_resolve_shstk;
+ else if (got[2] == (Elf32_Addr) &_dl_runtime_profile)
+ got[2] = (Elf32_Addr) &_dl_runtime_profile_shstk;
+ }
+ }
+ }
+}
+#endif
diff --git a/sysdeps/i386/dl-irel.h b/sysdeps/i386/dl-irel.h
index bfdf1b3375..55303180c7 100644
--- a/sysdeps/i386/dl-irel.h
+++ b/sysdeps/i386/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
i386 version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/dl-lookupcfg.h b/sysdeps/i386/dl-lookupcfg.h
index 033b475889..5399cf25ab 100644
--- a/sysdeps/i386/dl-lookupcfg.h
+++ b/sysdeps/i386/dl-lookupcfg.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,7 +26,6 @@
struct link_map;
-extern void _dl_unmap (struct link_map *map)
- internal_function attribute_hidden;
+extern void _dl_unmap (struct link_map *map) attribute_hidden;
#define DL_UNMAP(map) _dl_unmap (map)
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 130bcf56a9..1afdcbd9ea 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. i386 version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -150,9 +150,11 @@ extern ElfW(Addr) _dl_profile_fixup (struct link_map *l,
.globl _start\n\
.globl _dl_start_user\n\
_start:\n\
- # Note that _dl_start gets the parameter in %eax.\n\
movl %esp, %eax\n\
+ subl $12, %esp\n\
+ pushl %eax\n\
call _dl_start\n\
+ addl $16, %esp\n\
_dl_start_user:\n\
# Save the user entry point address in %edi.\n\
movl %eax, %edi\n\
@@ -175,17 +177,20 @@ _dl_start_user:\n\
# switch stacks if it moves these contents over.\n\
" RTLD_START_SPECIAL_INIT "\n\
# Load the parameters again.\n\
- # (eax, edx, ecx, *--esp) = (_dl_loaded, argc, argv, envp)\n\
+ # (eax, edx, ecx, esi) = (_dl_loaded, argc, argv, envp)\n\
movl _rtld_local@GOTOFF(%ebx), %eax\n\
leal 8(%esp,%edx,4), %esi\n\
leal 4(%esp), %ecx\n\
movl %esp, %ebp\n\
# Make sure _dl_init is run with 16 byte aligned stack.\n\
andl $-16, %esp\n\
- pushl %eax\n\
- pushl %eax\n\
+ subl $12, %esp\n\
pushl %ebp\n\
+ # Arguments for _dl_init.\n\
pushl %esi\n\
+ pushl %ecx\n\
+ pushl %edx\n\
+ pushl %eax\n\
# Clear %ebp, so that even constructors have terminated backchain.\n\
xorl %ebp, %ebp\n\
# Call the function to run the initializers.\n\
@@ -193,7 +198,7 @@ _dl_start_user:\n\
# Pass our finalizer function to the user in %edx, as per ELF ABI.\n\
leal _dl_fini@GOTOFF(%ebx), %edx\n\
# Restore %esp _start expects.\n\
- movl (%esp), %esp\n\
+ movl 16(%esp), %esp\n\
# Jump to the user's entry point.\n\
jmp *%edi\n\
.previous\n\
@@ -233,15 +238,20 @@ _dl_start_user:\n\
static inline void __attribute__ ((unused))
dl_platform_init (void)
{
+#if IS_IN (rtld)
+ /* init_cpu_features has been called early from __libc_start_main in
+ static executable. */
+ init_cpu_features (&GLRO(dl_x86_cpu_features));
+#else
if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
/* Avoid an empty string which would disturb us. */
GLRO(dl_platform) = NULL;
-
- init_cpu_features (&GLRO(dl_x86_cpu_features));
+#endif
}
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rel *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
@@ -310,14 +320,29 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
const Elf32_Sym *const refsym = sym;
# endif
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
if (sym != NULL
- && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
- 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
- && __builtin_expect (!skip_ifunc, 1))
- value = ((Elf32_Addr (*) (void)) value) ();
+ && __glibc_unlikely (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC)
+ && __glibc_likely (sym->st_shndx != SHN_UNDEF)
+ && __glibc_likely (!skip_ifunc))
+ {
+# 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_error_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)
{
@@ -430,8 +455,8 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
/* This can happen in trace mode if an object could not be
found. */
break;
- if (__builtin_expect (sym->st_size > refsym->st_size, 0)
- || (__builtin_expect (sym->st_size < refsym->st_size, 0)
+ if (__glibc_unlikely (sym->st_size > refsym->st_size)
+ || (__glibc_unlikely(sym->st_size < refsym->st_size)
&& GLRO(dl_verbose)))
{
const char *strtab;
@@ -475,12 +500,12 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *const refsym = sym;
# endif
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
if (sym != NULL
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
- && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
- && __builtin_expect (!skip_ifunc, 1))
+ && __glibc_likely (sym->st_shndx != SHN_UNDEF)
+ && __glibc_unlikely (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC)
+ && __glibc_likely (!skip_ifunc))
value = ((Elf32_Addr (*) (void)) value) ();
switch (ELF32_R_TYPE (reloc->r_info))
@@ -575,8 +600,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
/* This can happen in trace mode if an object could not be
found. */
break;
- if (__builtin_expect (sym->st_size > refsym->st_size, 0)
- || (__builtin_expect (sym->st_size < refsym->st_size, 0)
+ if (__glibc_unlikely (sym->st_size > refsym->st_size)
+ || (__glibc_unlikely (sym->st_size < refsym->st_size)
&& GLRO(dl_verbose)))
{
const char *strtab;
@@ -637,7 +662,8 @@ elf_machine_lazy_rel (struct link_map *map,
/* Check for unexpected PLT reloc type. */
if (__glibc_likely (r_type == R_386_JMP_SLOT))
{
- if (__builtin_expect (map->l_mach.plt, 0) == 0)
+ /* Prelink has been deprecated. */
+ if (__glibc_likely (map->l_mach.plt == 0))
*reloc_addr += l_addr;
else
*reloc_addr = (map->l_mach.plt
diff --git a/sysdeps/i386/dl-procinfo.c b/sysdeps/i386/dl-procinfo.c
index ffa6b9da0a..cd779e3078 100644
--- a/sysdeps/i386/dl-procinfo.c
+++ b/sysdeps/i386/dl-procinfo.c
@@ -1,5 +1,5 @@
/* Data for i386 version of processor capability information.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -17,10 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* This information must be kept in sync with the _DL_HWCAP_COUNT and
- _DL_PLATFORM_COUNT definitions in procinfo.h.
-
- If anything should be added here check whether the size of each string
+/* If anything should be added here check whether the size of each string
is still ok with the given array size.
All the #ifdefs in the definitions are quite irritating but
@@ -43,21 +40,7 @@
# define PROCINFO_CLASS
#endif
-#if !IS_IN (ldconfig)
-# if !defined PROCINFO_DECL && defined SHARED
- ._dl_x86_cpu_features
-# else
-PROCINFO_CLASS struct cpu_features _dl_x86_cpu_features
-# endif
-# ifndef PROCINFO_DECL
-= { }
-# endif
-# if !defined SHARED || defined PROCINFO_DECL
-;
-# else
-,
-# endif
-#endif
+#include <sysdeps/x86/dl-procinfo.c>
#if !defined PROCINFO_DECL && defined SHARED
._dl_x86_cap_flags
@@ -78,21 +61,5 @@ PROCINFO_CLASS const char _dl_x86_cap_flags[32][8]
,
#endif
-#if !defined PROCINFO_DECL && defined SHARED
- ._dl_x86_platforms
-#else
-PROCINFO_CLASS const char _dl_x86_platforms[4][5]
-#endif
-#ifndef PROCINFO_DECL
-= {
- "i386", "i486", "i586", "i686"
- }
-#endif
-#if !defined SHARED || defined PROCINFO_DECL
-;
-#else
-,
-#endif
-
#undef PROCINFO_DECL
#undef PROCINFO_CLASS
diff --git a/sysdeps/i386/dl-procinfo.h b/sysdeps/i386/dl-procinfo.h
deleted file mode 100644
index 9fbb58847e..0000000000
--- a/sysdeps/i386/dl-procinfo.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* i386 version of processor capability information handling macros.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 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/>. */
-
-#ifndef _DL_PROCINFO_H
-#define _DL_PROCINFO_H 1
-#include <ldsodefs.h>
-
-#define _DL_HWCAP_COUNT 32
-
-#define _DL_PLATFORMS_COUNT 4
-
-/* Start at 48 to reserve some space. */
-#define _DL_FIRST_PLATFORM 48
-/* Mask to filter out platforms. */
-#define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \
- << _DL_FIRST_PLATFORM)
-
-enum
-{
- HWCAP_I386_FPU = 1 << 0,
- HWCAP_I386_VME = 1 << 1,
- HWCAP_I386_DE = 1 << 2,
- HWCAP_I386_PSE = 1 << 3,
- HWCAP_I386_TSC = 1 << 4,
- HWCAP_I386_MSR = 1 << 5,
- HWCAP_I386_PAE = 1 << 6,
- HWCAP_I386_MCE = 1 << 7,
- HWCAP_I386_CX8 = 1 << 8,
- HWCAP_I386_APIC = 1 << 9,
- HWCAP_I386_SEP = 1 << 11,
- HWCAP_I386_MTRR = 1 << 12,
- HWCAP_I386_PGE = 1 << 13,
- HWCAP_I386_MCA = 1 << 14,
- HWCAP_I386_CMOV = 1 << 15,
- HWCAP_I386_FCMOV = 1 << 16,
- HWCAP_I386_MMX = 1 << 23,
- HWCAP_I386_OSFXSR = 1 << 24,
- HWCAP_I386_XMM = 1 << 25,
- HWCAP_I386_XMM2 = 1 << 26,
- HWCAP_I386_AMD3D = 1 << 31,
-
- /* XXX Which others to add here? */
- HWCAP_IMPORTANT = (HWCAP_I386_XMM2)
-
-};
-
-/* We cannot provide a general printing function. */
-#define _dl_procinfo(type, word) -1
-
-static inline const char *
-__attribute__ ((unused))
-_dl_hwcap_string (int idx)
-{
- return GLRO(dl_x86_cap_flags)[idx];
-};
-
-static inline const char *
-__attribute__ ((unused))
-_dl_platform_string (int idx)
-{
- return GLRO(dl_x86_platforms)[idx - _DL_FIRST_PLATFORM];
-};
-
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_hwcap (const char *str)
-{
- int i;
-
- for (i = 0; i < _DL_HWCAP_COUNT; i++)
- {
- if (strcmp (str, GLRO(dl_x86_cap_flags)[i]) == 0)
- return i;
- }
- return -1;
-};
-
-static inline int
-__attribute__ ((unused, always_inline))
-_dl_string_platform (const char *str)
-{
- int i;
-
- if (str != NULL)
- for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
- {
- if (strcmp (str, GLRO(dl_x86_platforms)[i]) == 0)
- return _DL_FIRST_PLATFORM + i;
- }
- return -1;
-};
-
-#endif /* dl-procinfo.h */
diff --git a/sysdeps/i386/dl-tls.h b/sysdeps/i386/dl-tls.h
index 1a8c358bfc..1123dd7e6a 100644
--- a/sysdeps/i386/dl-tls.h
+++ b/sysdeps/i386/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. i386 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -59,6 +59,3 @@ rtld_hidden_def (___tls_get_addr)
# endif
#endif
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/i386/dl-tlsdesc.S b/sysdeps/i386/dl-tlsdesc.S
index 7c189ab93d..128f0af318 100644
--- a/sysdeps/i386/dl-tlsdesc.S
+++ b/sysdeps/i386/dl-tlsdesc.S
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. i386 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,6 +37,7 @@
cfi_startproc
.align 16
_dl_tlsdesc_return:
+ _CET_ENDBR
movl 4(%eax), %eax
ret
cfi_endproc
@@ -58,6 +59,7 @@ _dl_tlsdesc_return:
cfi_startproc
.align 16
_dl_tlsdesc_undefweak:
+ _CET_ENDBR
movl 4(%eax), %eax
subl %gs:0, %eax
ret
@@ -99,6 +101,7 @@ _dl_tlsdesc_dynamic (struct tlsdesc *tdp)
cfi_startproc
.align 16
_dl_tlsdesc_dynamic:
+ _CET_ENDBR
/* Like all TLS resolvers, preserve call-clobbered registers.
We need two scratch regs anyway. */
subl $28, %esp
@@ -126,7 +129,11 @@ _dl_tlsdesc_dynamic:
.p2align 4,,7
.Lslow:
cfi_adjust_cfa_offset (28)
+#ifdef NO_RTLD_HIDDEN
+ call JUMPTARGET (___tls_get_addr)
+#else
call HIDDEN_JUMPTARGET (___tls_get_addr)
+#endif
jmp .Lret
cfi_endproc
.size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic
@@ -150,6 +157,7 @@ _dl_tlsdesc_dynamic:
.align 16
_dl_tlsdesc_resolve_abs_plus_addend:
0:
+ _CET_ENDBR
pushl %eax
cfi_adjust_cfa_offset (4)
pushl %ecx
@@ -188,6 +196,7 @@ _dl_tlsdesc_resolve_abs_plus_addend:
.align 16
_dl_tlsdesc_resolve_rel:
0:
+ _CET_ENDBR
pushl %eax
cfi_adjust_cfa_offset (4)
pushl %ecx
@@ -226,6 +235,7 @@ _dl_tlsdesc_resolve_rel:
.align 16
_dl_tlsdesc_resolve_rela:
0:
+ _CET_ENDBR
pushl %eax
cfi_adjust_cfa_offset (4)
pushl %ecx
@@ -264,6 +274,7 @@ _dl_tlsdesc_resolve_rela:
.align 16
_dl_tlsdesc_resolve_hold:
0:
+ _CET_ENDBR
pushl %eax
cfi_adjust_cfa_offset (4)
pushl %ecx
diff --git a/sysdeps/i386/dl-tlsdesc.h b/sysdeps/i386/dl-tlsdesc.h
index 02c4a71d76..c8a1e05615 100644
--- a/sysdeps/i386/dl-tlsdesc.h
+++ b/sysdeps/i386/dl-tlsdesc.h
@@ -1,6 +1,6 @@
/* Thread-local storage descriptor handling in the ELF dynamic linker.
i386 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -51,8 +51,7 @@ extern ptrdiff_t attribute_hidden __attribute__ ((regparm (1)))
# ifdef SHARED
extern void *_dl_make_tlsdesc_dynamic (struct link_map *map,
- size_t ti_offset)
- internal_function attribute_hidden;
+ size_t ti_offset) attribute_hidden;
extern ptrdiff_t attribute_hidden __attribute__ ((regparm (1)))
_dl_tlsdesc_dynamic (struct tlsdesc *);
diff --git a/sysdeps/i386/dl-trampoline.S b/sysdeps/i386/dl-trampoline.S
index 6a024c8edc..6dc0319216 100644
--- a/sysdeps/i386/dl-trampoline.S
+++ b/sysdeps/i386/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. i386 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,6 +32,7 @@
.align 16
_dl_runtime_resolve:
cfi_adjust_cfa_offset (8)
+ _CET_ENDBR
pushl %eax # Preserve registers otherwise clobbered.
cfi_adjust_cfa_offset (4)
pushl %ecx
@@ -50,14 +51,85 @@ _dl_runtime_resolve:
cfi_endproc
.size _dl_runtime_resolve, .-_dl_runtime_resolve
+# The SHSTK compatible version.
+ .text
+ .globl _dl_runtime_resolve_shstk
+ .type _dl_runtime_resolve_shstk, @function
+ cfi_startproc
+ .align 16
+_dl_runtime_resolve_shstk:
+ cfi_adjust_cfa_offset (8)
+ _CET_ENDBR
+ pushl %eax # Preserve registers otherwise clobbered.
+ cfi_adjust_cfa_offset (4)
+ pushl %edx
+ cfi_adjust_cfa_offset (4)
+ movl 12(%esp), %edx # Copy args pushed by PLT in register. Note
+ movl 8(%esp), %eax # that `fixup' takes its parameters in regs.
+ call _dl_fixup # Call resolver.
+ movl (%esp), %edx # Get register content back.
+ movl %eax, %ecx # Store the function address.
+ movl 4(%esp), %eax # Get register content back.
+ addl $16, %esp # Adjust stack: PLT1 + PLT2 + %eax + %edx
+ cfi_adjust_cfa_offset (-16)
+ jmp *%ecx # Jump to function address.
+ cfi_endproc
+ .size _dl_runtime_resolve_shstk, .-_dl_runtime_resolve_shstk
#ifndef PROF
+# The SHSTK compatible version.
+ .globl _dl_runtime_profile_shstk
+ .type _dl_runtime_profile_shstk, @function
+ cfi_startproc
+ .align 16
+_dl_runtime_profile_shstk:
+ cfi_adjust_cfa_offset (8)
+ _CET_ENDBR
+ pushl %esp
+ cfi_adjust_cfa_offset (4)
+ addl $8, (%esp) # Account for the pushed PLT data
+ pushl %ebp
+ cfi_adjust_cfa_offset (4)
+ pushl %eax # Preserve registers otherwise clobbered.
+ cfi_adjust_cfa_offset (4)
+ pushl %ecx
+ cfi_adjust_cfa_offset (4)
+ pushl %edx
+ cfi_adjust_cfa_offset (4)
+ movl %esp, %ecx
+ subl $8, %esp
+ cfi_adjust_cfa_offset (8)
+ movl $-1, 4(%esp)
+ leal 4(%esp), %edx
+ movl %edx, (%esp)
+ pushl %ecx # Address of the register structure
+ cfi_adjust_cfa_offset (4)
+ movl 40(%esp), %ecx # Load return address
+ movl 36(%esp), %edx # Copy args pushed by PLT in register. Note
+ movl 32(%esp), %eax # that `fixup' takes its parameters in regs.
+ call _dl_profile_fixup # Call resolver.
+ cfi_adjust_cfa_offset (-8)
+ movl (%esp), %edx
+ testl %edx, %edx
+ jns 1f
+ movl 4(%esp), %edx # Get register content back.
+ movl %eax, %ecx # Store the function address.
+ movl 12(%esp), %eax # Get register content back.
+ # Adjust stack: PLT1 + PLT2 + %esp + %ebp + %eax + %ecx + %edx
+ # + free.
+ addl $32, %esp
+ cfi_adjust_cfa_offset (-32)
+ jmp *%ecx # Jump to function address.
+ cfi_endproc
+ .size _dl_runtime_profile_shstk, .-_dl_runtime_profile_shstk
+
.globl _dl_runtime_profile
.type _dl_runtime_profile, @function
cfi_startproc
.align 16
_dl_runtime_profile:
cfi_adjust_cfa_offset (8)
+ _CET_ENDBR
pushl %esp
cfi_adjust_cfa_offset (4)
addl $8, (%esp) # Account for the pushed PLT data
diff --git a/sysdeps/i386/ffs.c b/sysdeps/i386/ffs.c
index 559ee98273..d28d78e272 100644
--- a/sysdeps/i386/ffs.c
+++ b/sysdeps/i386/ffs.c
@@ -1,7 +1,7 @@
/* ffs -- find first set bit in a word, counted from least significant end.
For Intel 80x86, x>=3.
This file is part of the GNU C Library.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
Contributed by Torbjorn Granlund (tege@sics.se).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/fpu/e_acosh.S b/sysdeps/i386/fpu/e_acosh.S
index f560d255f3..8d37247a2b 100644
--- a/sysdeps/i386/fpu/e_acosh.S
+++ b/sysdeps/i386/fpu/e_acosh.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/sysdeps/i386/fpu/e_acoshf.S b/sysdeps/i386/fpu/e_acoshf.S
index ff6f25371b..964c08603d 100644
--- a/sysdeps/i386/fpu/e_acoshf.S
+++ b/sysdeps/i386/fpu/e_acoshf.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/sysdeps/i386/fpu/e_acoshl.S b/sysdeps/i386/fpu/e_acoshl.S
index 6a353119b5..8c6921eb84 100644
--- a/sysdeps/i386/fpu/e_acoshl.S
+++ b/sysdeps/i386/fpu/e_acoshl.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/sysdeps/i386/fpu/e_atanh.S b/sysdeps/i386/fpu/e_atanh.S
index 2242040499..8cb7bc7c66 100644
--- a/sysdeps/i386/fpu/e_atanh.S
+++ b/sysdeps/i386/fpu/e_atanh.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arctanh function.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/sysdeps/i386/fpu/e_atanhf.S b/sysdeps/i386/fpu/e_atanhf.S
index e338e65981..cf27dbe565 100644
--- a/sysdeps/i386/fpu/e_atanhf.S
+++ b/sysdeps/i386/fpu/e_atanhf.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arctanh function.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/sysdeps/i386/fpu/e_atanhl.S b/sysdeps/i386/fpu/e_atanhl.S
index dc5ca51a4b..bd1f096470 100644
--- a/sysdeps/i386/fpu/e_atanhl.S
+++ b/sysdeps/i386/fpu/e_atanhl.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arctanh function.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -121,6 +121,7 @@ ENTRY(__ieee754_atanhl)
cmpl $0, 4(%esp)
je 7b
6: fldt 4(%esp)
+ fadd %st(0)
ret
END(__ieee754_atanhl)
strong_alias (__ieee754_atanhl, __atanhl_finite)
diff --git a/sysdeps/i386/fpu/e_exp2f.S b/sysdeps/i386/fpu/e_exp2f.S
deleted file mode 100644
index 30623cd850..0000000000
--- a/sysdeps/i386/fpu/e_exp2f.S
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>.
- * Public domain.
- */
-
-#include <machine/asm.h>
-#include <i386-math-asm.h>
-
-DEFINE_FLT_MIN
-
-#ifdef PIC
-# define MO(op) op##@GOTOFF(%ecx)
-#else
-# define MO(op) op
-#endif
-
- .text
-ENTRY(__ieee754_exp2f)
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
- flds 4(%esp)
-/* I added the following ugly construct because exp(+-Inf) resulted
- in NaN. The ugliness results from the bright minds at Intel.
- For the i686 the code can be written better.
- -- drepper@cygnus.com. */
- fxam /* Is NaN or +-Inf? */
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 1f /* Is +-Inf, jump. */
- fld %st
- frndint /* int(x) */
- fsubr %st,%st(1) /* fract(x) */
- fxch
- f2xm1 /* 2^(fract(x)) - 1 */
- fld1
- faddp /* 2^(fract(x)) */
- fscale /* e^x */
- fstp %st(1)
- FLT_NARROW_EVAL_UFLOW_NONNEG_NAN
- ret
-
-1: testl $0x200, %eax /* Test sign. */
- jz 2f /* If positive, jump. */
- fstp %st
- fldz /* Set result to 0. */
-2: ret
-END (__ieee754_exp2f)
-strong_alias (__ieee754_exp2f, __exp2f_finite)
diff --git a/sysdeps/i386/fpu/e_expf.S b/sysdeps/i386/fpu/e_expf.S
deleted file mode 100644
index 65cb4ec204..0000000000
--- a/sysdeps/i386/fpu/e_expf.S
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>.
- */
-
-#include <machine/asm.h>
-#include <i386-math-asm.h>
-
-DEFINE_FLT_MIN
-
-#ifdef PIC
-# define MO(op) op##@GOTOFF(%ecx)
-#else
-# define MO(op) op
-#endif
-
- .text
-/* e^x = 2^(x * log2(e)) */
-ENTRY(__ieee754_expf)
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
- flds 4(%esp)
-/* I added the following ugly construct because exp(+-Inf) resulted
- in NaN. The ugliness results from the bright minds at Intel.
- For the i686 the code can be written better.
- -- drepper@cygnus.com. */
- fxam /* Is NaN or +-Inf? */
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 1f /* Is +-Inf, jump. */
- fldl2e
- fmulp /* x * log2(e) */
- fld %st
- frndint /* int(x * log2(e)) */
- fsubr %st,%st(1) /* fract(x * log2(e)) */
- fxch
- f2xm1 /* 2^(fract(x * log2(e))) - 1 */
- fld1
- faddp /* 2^(fract(x * log2(e))) */
- fscale /* e^x */
- fstp %st(1)
- FLT_NARROW_EVAL_UFLOW_NONNEG_NAN
- ret
-
-1: testl $0x200, %eax /* Test sign. */
- jz 2f /* If positive, jump. */
- fstp %st
- fldz /* Set result to 0. */
-2: ret
-END (__ieee754_expf)
-
-
-ENTRY(__expf_finite)
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
- fldl2e
- fmuls 4(%esp) /* x * log2(e) */
- fld %st
- frndint /* int(x * log2(e)) */
- fsubr %st,%st(1) /* fract(x * log2(e)) */
- fxch
- f2xm1 /* 2^(fract(x * log2(e))) - 1 */
- fld1
- faddp /* 2^(fract(x * log2(e))) */
- fscale /* e^x */
- fstp %st(1)
- FLT_NARROW_EVAL_UFLOW_NONNEG
- ret
-END(__expf_finite)
diff --git a/sysdeps/i386/fpu/e_expl.S b/sysdeps/i386/fpu/e_expl.S
index 64e0d96839..18a627e9da 100644
--- a/sysdeps/i386/fpu/e_expl.S
+++ b/sysdeps/i386/fpu/e_expl.S
@@ -22,6 +22,7 @@
* -- moshier@na-net.ornl.gov
*/
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
#include <i386-math-asm.h>
@@ -102,7 +103,7 @@ ENTRY(IEEE754_EXPL)
/* Below -64.0 (may be -NaN or -Inf). */
andb %ah, %dh
cmpb $0x01, %dh
- je 2f /* Is +-NaN, jump. */
+ je 6f /* Is +-NaN, jump. */
jmp 1f /* -large, possibly -Inf. */
4: /* In range -64.0 to 64.0 (may be +-0 but not NaN or +-Inf). */
@@ -144,7 +145,7 @@ ENTRY(IEEE754_EXPL)
cmpb $0x05, %dh
je 1f /* Is +-Inf, jump. */
cmpb $0x01, %dh
- je 2f /* Is +-NaN, jump. */
+ je 6f /* Is +-NaN, jump. */
/* Overflow or underflow; saturate. */
fstp %st
fldt MO(csat)
@@ -214,10 +215,13 @@ ENTRY(IEEE754_EXPL)
fldz /* Set result to 0. */
#endif
2: ret
+6: /* NaN argument. */
+ fadd %st
+ ret
END(IEEE754_EXPL)
#ifdef USE_AS_EXPM1L
libm_hidden_def (__expm1l)
-weak_alias (__expm1l, expm1l)
+libm_alias_ldouble (__expm1, expm1)
#else
strong_alias (IEEE754_EXPL, EXPL_FINITE)
#endif
diff --git a/sysdeps/i386/fpu/e_hypot.S b/sysdeps/i386/fpu/e_hypot.S
index 0ca788407f..5b7deb356a 100644
--- a/sysdeps/i386/fpu/e_hypot.S
+++ b/sysdeps/i386/fpu/e_hypot.S
@@ -1,5 +1,5 @@
/* Compute the hypothenuse of X and Y.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/i386/fpu/e_hypotf.S b/sysdeps/i386/fpu/e_hypotf.S
index 58b883bea8..8e394c9c7f 100644
--- a/sysdeps/i386/fpu/e_hypotf.S
+++ b/sysdeps/i386/fpu/e_hypotf.S
@@ -1,5 +1,5 @@
/* Compute the hypothenuse of X and Y.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/i386/fpu/e_log10l.S b/sysdeps/i386/fpu/e_log10l.S
index 45b9c6d21d..9326b19796 100644
--- a/sysdeps/i386/fpu/e_log10l.S
+++ b/sysdeps/i386/fpu/e_log10l.S
@@ -65,6 +65,7 @@ ENTRY(__ieee754_log10l)
3: jp 4b // in case x is ±Inf
fstp %st(1)
fstp %st(1)
+ fadd %st(0)
ret
END(__ieee754_log10l)
strong_alias (__ieee754_log10l, __log10l_finite)
diff --git a/sysdeps/i386/fpu/e_log2f.S b/sysdeps/i386/fpu/e_log2f.S
deleted file mode 100644
index 344eeb495e..0000000000
--- a/sysdeps/i386/fpu/e_log2f.S
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Adapted for use as log2 by Ulrich Drepper <drepper@cygnus.com>.
- * Public domain.
- *
- * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
- */
-
-#include <machine/asm.h>
-
- .section .rodata.cst8,"aM",@progbits,8
-
- .p2align 3
- .type one,@object
-one: .double 1.0
- ASM_SIZE_DIRECTIVE(one)
- /* It is not important that this constant is precise. It is only
- a value which is known to be on the safe side for using the
- fyl2xp1 instruction. */
- .type limit,@object
-limit: .double 0.29
- ASM_SIZE_DIRECTIVE(limit)
-
-
-#ifdef PIC
-# define MO(op) op##@GOTOFF(%edx)
-#else
-# define MO(op) op
-#endif
-
- .text
-ENTRY(__ieee754_log2f)
-#ifdef PIC
- LOAD_PIC_REG (dx)
-#endif
- fldl MO(one)
- flds 4(%esp) // x : 1
- fxam
- fnstsw
- fld %st // x : x : 1
- sahf
- jc 3f // in case x is NaN or ±Inf
-4: fsub %st(2), %st // x-1 : x : 1
- fld %st // x-1 : x-1 : x : 1
- fabs // |x-1| : x-1 : x : 1
- fcompl MO(limit) // x-1 : x : 1
- fnstsw // x-1 : x : 1
- andb $0x45, %ah
- jz 2f
- fxam
- fnstsw
- andb $0x45, %ah
- cmpb $0x40, %ah
- jne 5f
- fabs // log2(1) is +0 in all rounding modes.
-5: fstp %st(1) // x-1 : 1
- fyl2xp1 // log(x)
- ret
-
-2: fstp %st(0) // x : 1
- fyl2x // log(x)
- ret
-
-3: jp 4b // in case x is ±Inf
- fstp %st(1)
- fstp %st(1)
- ret
-END (__ieee754_log2f)
-strong_alias (__ieee754_log2f, __log2f_finite)
diff --git a/sysdeps/i386/fpu/e_log2l.S b/sysdeps/i386/fpu/e_log2l.S
index 0f5f7e5789..73e62ea908 100644
--- a/sysdeps/i386/fpu/e_log2l.S
+++ b/sysdeps/i386/fpu/e_log2l.S
@@ -64,6 +64,7 @@ ENTRY(__ieee754_log2l)
3: jp 4b // in case x is ±Inf
fstp %st(1)
fstp %st(1)
+ fadd %st(0)
ret
END (__ieee754_log2l)
strong_alias (__ieee754_log2l, __log2l_finite)
diff --git a/sysdeps/i386/fpu/e_logf.S b/sysdeps/i386/fpu/e_logf.S
deleted file mode 100644
index de967a31f5..0000000000
--- a/sysdeps/i386/fpu/e_logf.S
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- * Adapted for float by Ulrich Drepper <drepper@cygnus.com>.
- *
- * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
- */
-
-#include <machine/asm.h>
-
- .section .rodata.cst8,"aM",@progbits,8
-
- .p2align 3
- .type one,@object
-one: .double 1.0
- ASM_SIZE_DIRECTIVE(one)
- /* It is not important that this constant is precise. It is only
- a value which is known to be on the safe side for using the
- fyl2xp1 instruction. */
- .type limit,@object
-limit: .double 0.29
- ASM_SIZE_DIRECTIVE(limit)
-
-
-#ifdef PIC
-# define MO(op) op##@GOTOFF(%edx)
-#else
-# define MO(op) op
-#endif
-
- .text
-ENTRY(__ieee754_logf)
- fldln2 // log(2)
- flds 4(%esp) // x : log(2)
- fxam
- fnstsw
-#ifdef PIC
- LOAD_PIC_REG (dx)
-#endif
- fld %st // x : x : log(2)
- sahf
- jc 3f // in case x is NaN or +-Inf
-4: fsubl MO(one) // x-1 : x : log(2)
- fld %st // x-1 : x-1 : x : log(2)
- fabs // |x-1| : x-1 : x : log(2)
- fcompl MO(limit) // x-1 : x : log(2)
- fnstsw // x-1 : x : log(2)
- andb $0x45, %ah
- jz 2f
- fxam
- fnstsw
- andb $0x45, %ah
- cmpb $0x40, %ah
- jne 5f
- fabs // log(1) is +0 in all rounding modes.
-5: fstp %st(1) // x-1 : log(2)
- fyl2xp1 // log(x)
- ret
-
-2: fstp %st(0) // x : log(2)
- fyl2x // log(x)
- ret
-
-3: jp 4b // in case x is +-Inf
- fstp %st(1)
- fstp %st(1)
- ret
-END (__ieee754_logf)
-
-ENTRY(__logf_finite)
- fldln2 // log(2)
- flds 4(%esp) // x : log(2)
-#ifdef PIC
- LOAD_PIC_REG (dx)
-#endif
- fld %st // x : x : log(2)
- fsubl MO(one) // x-1 : x : log(2)
- fld %st // x-1 : x-1 : x : log(2)
- fabs // |x-1| : x-1 : x : log(2)
- fcompl MO(limit) // x-1 : x : log(2)
- fnstsw // x-1 : x : log(2)
- andb $0x45, %ah
- jz 2b
- fxam
- fnstsw
- andb $0x45, %ah
- cmpb $0x40, %ah
- jne 6f
- fabs // log(1) is +0 in all rounding modes.
-6: fstp %st(1) // x-1 : log(2)
- fyl2xp1 // log(x)
- ret
-END(__logf_finite)
diff --git a/sysdeps/i386/fpu/e_logl.S b/sysdeps/i386/fpu/e_logl.S
index 7a6d370e8f..53127d704e 100644
--- a/sysdeps/i386/fpu/e_logl.S
+++ b/sysdeps/i386/fpu/e_logl.S
@@ -67,6 +67,7 @@ ENTRY(__ieee754_logl)
3: jp 4b // in case x is +-Inf
fstp %st(1)
fstp %st(1)
+ fadd %st(0)
ret
END (__ieee754_logl)
diff --git a/sysdeps/i386/fpu/e_pow.S b/sysdeps/i386/fpu/e_pow.S
index 5773394b0e..b11bc9596e 100644
--- a/sysdeps/i386/fpu/e_pow.S
+++ b/sysdeps/i386/fpu/e_pow.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of pow function.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/sysdeps/i386/fpu/e_powf.S b/sysdeps/i386/fpu/e_powf.S
deleted file mode 100644
index ee96c704dc..0000000000
--- a/sysdeps/i386/fpu/e_powf.S
+++ /dev/null
@@ -1,392 +0,0 @@
-/* ix87 specific implementation of pow function.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <machine/asm.h>
-#include <i386-math-asm.h>
-
- .section .rodata.cst8,"aM",@progbits,8
-
- .p2align 3
- .type one,@object
-one: .double 1.0
- ASM_SIZE_DIRECTIVE(one)
- .type limit,@object
-limit: .double 0.29
- ASM_SIZE_DIRECTIVE(limit)
- .type p31,@object
-p31: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x41
- ASM_SIZE_DIRECTIVE(p31)
-
- .section .rodata.cst16,"aM",@progbits,16
-
- .p2align 3
- .type infinity,@object
-inf_zero:
-infinity:
- .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
- ASM_SIZE_DIRECTIVE(infinity)
- .type zero,@object
-zero: .double 0.0
- ASM_SIZE_DIRECTIVE(zero)
- .type minf_mzero,@object
-minf_mzero:
-minfinity:
- .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff
-mzero:
- .byte 0, 0, 0, 0, 0, 0, 0, 0x80
- ASM_SIZE_DIRECTIVE(minf_mzero)
-DEFINE_FLT_MIN
-
-#ifdef PIC
-# define MO(op) op##@GOTOFF(%ecx)
-# define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
-#else
-# define MO(op) op
-# define MOX(op,x,f) op(,x,f)
-#endif
-
- .text
-ENTRY(__ieee754_powf)
- flds 8(%esp) // y
- fxam
-
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
-
- fnstsw
- movb %ah, %dl
- andb $0x45, %ah
- cmpb $0x40, %ah // is y == 0 ?
- je 11f
-
- cmpb $0x05, %ah // is y == ±inf ?
- je 12f
-
- cmpb $0x01, %ah // is y == NaN ?
- je 30f
-
- flds 4(%esp) // x : y
-
- subl $4, %esp
- cfi_adjust_cfa_offset (4)
-
- fxam
- fnstsw
- movb %ah, %dh
- andb $0x45, %ah
- cmpb $0x40, %ah
- je 20f // x is ±0
-
- cmpb $0x05, %ah
- je 15f // x is ±inf
-
- cmpb $0x01, %ah
- je 33f // x is NaN
-
- fxch // y : x
-
- /* fistpl raises invalid exception for |y| >= 1L<<31. */
- fld %st // y : y : x
- fabs // |y| : y : x
- fcompl MO(p31) // y : x
- fnstsw
- sahf
- jnc 2f
-
- /* First see whether `y' is a natural number. In this case we
- can use a more precise algorithm. */
- fld %st // y : y : x
- fistpl (%esp) // y : x
- fildl (%esp) // int(y) : y : x
- fucomp %st(1) // y : x
- fnstsw
- sahf
- jne 3f
-
- /* OK, we have an integer value for y. */
- popl %edx
- cfi_adjust_cfa_offset (-4)
- orl $0, %edx
- fstp %st(0) // x
- jns 4f // y >= 0, jump
- fdivrl MO(one) // 1/x (now referred to as x)
- negl %edx
-4: fldl MO(one) // 1 : x
- fxch
-
- /* If y is even, take the absolute value of x. Otherwise,
- ensure all intermediate values that might overflow have the
- sign of x. */
- testb $1, %dl
- jnz 6f
- fabs
-
-6: shrl $1, %edx
- jnc 5f
- fxch
- fabs
- fmul %st(1) // x : ST*x
- fxch
-5: fld %st // x : x : ST*x
- fabs // |x| : x : ST*x
- fmulp // |x|*x : ST*x
- testl %edx, %edx
- jnz 6b
- fstp %st(0) // ST*x
- FLT_NARROW_EVAL_UFLOW_NONNAN
- ret
-
- /* y is ±NAN */
-30: flds 4(%esp) // x : y
- fldl MO(one) // 1.0 : x : y
- fucomp %st(1) // x : y
- fnstsw
- sahf
- je 31f
- fxch // y : x
-31: fstp %st(1)
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
-2: /* y is a large integer (so even). */
- fxch // x : y
- fabs // |x| : y
- fxch // y : x
- .align ALIGNARG(4)
-3: /* y is a real number. */
- fxch // x : y
- fldl MO(one) // 1.0 : x : y
- fldl MO(limit) // 0.29 : 1.0 : x : y
- fld %st(2) // x : 0.29 : 1.0 : x : y
- fsub %st(2) // x-1 : 0.29 : 1.0 : x : y
- fabs // |x-1| : 0.29 : 1.0 : x : y
- fucompp // 1.0 : x : y
- fnstsw
- fxch // x : 1.0 : y
- sahf
- ja 7f
- fsub %st(1) // x-1 : 1.0 : y
- fyl2xp1 // log2(x) : y
- jmp 8f
-
-7: fyl2x // log2(x) : y
-8: fmul %st(1) // y*log2(x) : y
- fst %st(1) // y*log2(x) : y*log2(x)
- frndint // int(y*log2(x)) : y*log2(x)
- fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x))
- fxch // fract(y*log2(x)) : int(y*log2(x))
- f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x))
- faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x))
- fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x))
-32: addl $4, %esp
- cfi_adjust_cfa_offset (-4)
- fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x))
- FLT_NARROW_EVAL_UFLOW_NONNAN
- ret
-
- /* x is NaN. */
- cfi_adjust_cfa_offset (4)
-33: addl $4, %esp
- cfi_adjust_cfa_offset (-4)
- fstp %st(1)
- ret
-
- // pow(x,±0) = 1
- .align ALIGNARG(4)
-11: fstp %st(0) // pop y
- fldl MO(one)
- ret
-
- // y == ±inf
- .align ALIGNARG(4)
-12: fstp %st(0) // pop y
- fldl MO(one) // 1
- flds 4(%esp) // x : 1
- fabs // abs(x) : 1
- fucompp // < 1, == 1, or > 1
- fnstsw
- andb $0x45, %ah
- cmpb $0x45, %ah
- je 13f // jump if x is NaN
-
- cmpb $0x40, %ah
- je 14f // jump if |x| == 1
-
- shlb $1, %ah
- xorb %ah, %dl
- andl $2, %edx
- fldl MOX(inf_zero, %edx, 4)
- ret
-
- .align ALIGNARG(4)
-14: fldl MO(one)
- ret
-
- .align ALIGNARG(4)
-13: flds 4(%esp) // load x == NaN
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
- // x is ±inf
-15: fstp %st(0) // y
- testb $2, %dh
- jz 16f // jump if x == +inf
-
- // fistpl raises invalid exception for |y| >= 1L<<31, so test
- // that (in which case y is certainly even) before testing
- // whether y is odd.
- fld %st // y : y
- fabs // |y| : y
- fcompl MO(p31) // y
- fnstsw
- sahf
- jnc 16f
-
- // We must find out whether y is an odd integer.
- fld %st // y : y
- fistpl (%esp) // y
- fildl (%esp) // int(y) : y
- fucompp // <empty>
- fnstsw
- sahf
- jne 17f
-
- // OK, the value is an integer.
- popl %edx
- cfi_adjust_cfa_offset (-4)
- testb $1, %dl
- jz 18f // jump if not odd
- // It's an odd integer.
- shrl $31, %edx
- fldl MOX(minf_mzero, %edx, 8)
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
-16: fcompl MO(zero)
- addl $4, %esp
- cfi_adjust_cfa_offset (-4)
- fnstsw
- shrl $5, %eax
- andl $8, %eax
- fldl MOX(inf_zero, %eax, 1)
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
-17: shll $30, %edx // sign bit for y in right position
- addl $4, %esp
- cfi_adjust_cfa_offset (-4)
-18: shrl $31, %edx
- fldl MOX(inf_zero, %edx, 8)
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
- // x is ±0
-20: fstp %st(0) // y
- testb $2, %dl
- jz 21f // y > 0
-
- // x is ±0 and y is < 0. We must find out whether y is an odd integer.
- testb $2, %dh
- jz 25f
-
- // fistpl raises invalid exception for |y| >= 1L<<31, so test
- // that (in which case y is certainly even) before testing
- // whether y is odd.
- fld %st // y : y
- fabs // |y| : y
- fcompl MO(p31) // y
- fnstsw
- sahf
- jnc 25f
-
- fld %st // y : y
- fistpl (%esp) // y
- fildl (%esp) // int(y) : y
- fucompp // <empty>
- fnstsw
- sahf
- jne 26f
-
- // OK, the value is an integer.
- popl %edx
- cfi_adjust_cfa_offset (-4)
- testb $1, %dl
- jz 27f // jump if not odd
- // It's an odd integer.
- // Raise divide-by-zero exception and get minus infinity value.
- fldl MO(one)
- fdivl MO(zero)
- fchs
- ret
-
- cfi_adjust_cfa_offset (4)
-25: fstp %st(0)
-26: addl $4, %esp
- cfi_adjust_cfa_offset (-4)
-27: // Raise divide-by-zero exception and get infinity value.
- fldl MO(one)
- fdivl MO(zero)
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
- // x is ±0 and y is > 0. We must find out whether y is an odd integer.
-21: testb $2, %dh
- jz 22f
-
- // fistpl raises invalid exception for |y| >= 1L<<31, so test
- // that (in which case y is certainly even) before testing
- // whether y is odd.
- fcoml MO(p31) // y
- fnstsw
- sahf
- jnc 22f
-
- fld %st // y : y
- fistpl (%esp) // y
- fildl (%esp) // int(y) : y
- fucompp // <empty>
- fnstsw
- sahf
- jne 23f
-
- // OK, the value is an integer.
- popl %edx
- cfi_adjust_cfa_offset (-4)
- testb $1, %dl
- jz 24f // jump if not odd
- // It's an odd integer.
- fldl MO(mzero)
- ret
-
- cfi_adjust_cfa_offset (4)
-22: fstp %st(0)
-23: addl $4, %esp // Don't use pop.
- cfi_adjust_cfa_offset (-4)
-24: fldl MO(zero)
- ret
-
-END(__ieee754_powf)
-strong_alias (__ieee754_powf, __powf_finite)
diff --git a/sysdeps/i386/fpu/e_powl.S b/sysdeps/i386/fpu/e_powl.S
index 77d2abfaea..51a0c334f0 100644
--- a/sysdeps/i386/fpu/e_powl.S
+++ b/sysdeps/i386/fpu/e_powl.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of pow function.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -26,9 +26,9 @@
.type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- .type p3,@object
-p3: .byte 0, 0, 0, 0, 0, 0, 0x20, 0x40
- ASM_SIZE_DIRECTIVE(p3)
+ .type p2,@object
+p2: .byte 0, 0, 0, 0, 0, 0, 0x10, 0x40
+ ASM_SIZE_DIRECTIVE(p2)
.type p63,@object
p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
ASM_SIZE_DIRECTIVE(p63)
@@ -146,11 +146,11 @@ ENTRY(__ieee754_powl)
jmp 3f
9: /* OK, we have an integer value for y. Unless very small
- (we use < 8), use the algorithm for real exponent to avoid
+ (we use < 4), use the algorithm for real exponent to avoid
accumulation of errors. */
fld %st // y : y : x
fabs // |y| : y : x
- fcompl MO(p3) // y : x
+ fcompl MO(p2) // y : x
fnstsw
sahf
jnc 3f
@@ -201,15 +201,21 @@ ENTRY(__ieee754_powl)
fucomp %st(1) // x : y
fnstsw
sahf
- je 31f
- fxch // y : x
-31: fstp %st(1)
+ je 33f
+31: /* At least one argument NaN, and result should be NaN. */
+ faddp
+ ret
+33: jp 31b
+ /* pow (1, NaN); check if the NaN signaling. */
+ testb $0x40, 23(%esp)
+ jz 31b
+ fstp %st(1)
ret
cfi_adjust_cfa_offset (8)
32: addl $8, %esp
cfi_adjust_cfa_offset (-8)
- fstp %st(1)
+ faddp
ret
cfi_adjust_cfa_offset (8)
@@ -241,12 +247,24 @@ ENTRY(__ieee754_powl)
cfi_adjust_cfa_offset (-36)
ret
- // pow(x,±0) = 1
+ // pow(x,±0) = 1, unless x is sNaN
.align ALIGNARG(4)
11: fstp %st(0) // pop y
+ fldt 4(%esp) // x
+ fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 112f // x is NaN
+111: fstp %st(0)
fldl MO(one)
ret
+112: testb $0x40, 11(%esp)
+ jnz 111b
+ fadd %st(0)
+ ret
+
// y == ±inf
.align ALIGNARG(4)
12: fstp %st(0) // pop y
@@ -274,6 +292,7 @@ ENTRY(__ieee754_powl)
.align ALIGNARG(4)
13: fldt 4(%esp) // load x == NaN
+ fadd %st(0)
ret
cfi_adjust_cfa_offset (8)
diff --git a/sysdeps/i386/fpu/e_scalbl.S b/sysdeps/i386/fpu/e_scalbl.S
index d10b22ea83..896f599cb0 100644
--- a/sysdeps/i386/fpu/e_scalbl.S
+++ b/sysdeps/i386/fpu/e_scalbl.S
@@ -45,7 +45,7 @@ ENTRY(__ieee754_scalbl)
fnstsw
andl $0x4500, %eax
cmpl $0x0100, %eax
- je 3f
+ je 2f
fld %st(1)
frndint
fcomp %st(2)
@@ -76,18 +76,8 @@ ENTRY(__ieee754_scalbl)
fldl MOX(zero_nan, %eax, 1)
ret
- /* The result is NaN, but we must not raise an exception.
- So use a variable. */
-2: fstp %st
- fstp %st
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
- fldl MO(nan)
- ret
-
- /* The first parameter is a NaN. Return it. */
-3: fstp %st(1)
+ /* The result is NaN; raise an exception for sNaN arguments. */
+2: faddp
ret
/* Return NaN and raise the invalid exception. */
diff --git a/sysdeps/i386/fpu/fclrexcpt.c b/sysdeps/i386/fpu/fclrexcpt.c
index 68a8f863d6..8463b102e7 100644
--- a/sysdeps/i386/fpu/fclrexcpt.c
+++ b/sysdeps/i386/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -41,7 +41,7 @@ __feclearexcept (int excepts)
__asm__ ("fldenv %0" : : "m" (*&temp));
/* If the CPU supports SSE, we clear the MXCSR as well. */
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
{
unsigned int xnew_exc;
diff --git a/sysdeps/i386/fpu/fedisblxcpt.c b/sysdeps/i386/fpu/fedisblxcpt.c
index 07fd4cfacb..e2738e6d6c 100644
--- a/sysdeps/i386/fpu/fedisblxcpt.c
+++ b/sysdeps/i386/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999.
@@ -38,7 +38,7 @@ fedisableexcept (int excepts)
__asm__ ("fldcw %0" : : "m" (*&new_exc));
/* If the CPU supports SSE we set the MXCSR as well. */
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
{
unsigned int xnew_exc;
diff --git a/sysdeps/i386/fpu/feenablxcpt.c b/sysdeps/i386/fpu/feenablxcpt.c
index 0d0377d21a..a4d9862666 100644
--- a/sysdeps/i386/fpu/feenablxcpt.c
+++ b/sysdeps/i386/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999.
@@ -38,7 +38,7 @@ feenableexcept (int excepts)
__asm__ ("fldcw %0" : : "m" (*&new_exc));
/* If the CPU supports SSE we set the MXCSR as well. */
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
{
unsigned int xnew_exc;
diff --git a/sysdeps/i386/fpu/fegetenv.c b/sysdeps/i386/fpu/fegetenv.c
index b4b384fe19..2a1a8507ba 100644
--- a/sysdeps/i386/fpu/fegetenv.c
+++ b/sysdeps/i386/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -31,7 +31,7 @@ __fegetenv (fenv_t *envp)
would block all exceptions. */
__asm__ ("fldenv %0" : : "m" (*envp));
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
__asm__ ("stmxcsr %0" : "=m" (envp->__eip));
/* Success. */
diff --git a/sysdeps/i386/fpu/fegetexcept.c b/sysdeps/i386/fpu/fegetexcept.c
index 9d3d090a30..bb43a20bc0 100644
--- a/sysdeps/i386/fpu/fegetexcept.c
+++ b/sysdeps/i386/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999.
diff --git a/sysdeps/i386/fpu/fegetmode.c b/sysdeps/i386/fpu/fegetmode.c
new file mode 100644
index 0000000000..86de9f5548
--- /dev/null
+++ b/sysdeps/i386/fpu/fegetmode.c
@@ -0,0 +1,32 @@
+/* Store current floating-point control modes. i386 version.
+ Copyright (C) 2016-2018 Free Software 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 (HAS_CPU_FEATURE (SSE))
+ __asm__ ("stmxcsr %0" : "=m" (modep->__mxcsr));
+ return 0;
+}
diff --git a/sysdeps/i386/fpu/fegetround.c b/sysdeps/i386/fpu/fegetround.c
index 8c83d8e017..291ad80f5a 100644
--- a/sysdeps/i386/fpu/fegetround.c
+++ b/sysdeps/i386/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/i386/fpu/feholdexcpt.c b/sysdeps/i386/fpu/feholdexcpt.c
index a345db3513..270554df31 100644
--- a/sysdeps/i386/fpu/feholdexcpt.c
+++ b/sysdeps/i386/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -30,7 +30,7 @@ __feholdexcept (fenv_t *envp)
__asm__ volatile ("fnstenv %0; fnclex" : "=m" (*envp));
/* If the CPU supports SSE we set the MXCSR as well. */
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
{
unsigned int xwork;
diff --git a/sysdeps/i386/fpu/fenv_private.h b/sysdeps/i386/fpu/fenv_private.h
index e20e1f1662..637dae5f05 100644
--- a/sysdeps/i386/fpu/fenv_private.h
+++ b/sysdeps/i386/fpu/fenv_private.h
@@ -1,39 +1,10 @@
#ifndef FENV_PRIVATE_H
#define FENV_PRIVATE_H 1
+#include <bits/floatn.h>
#include <fenv.h>
#include <fpu_control.h>
-#ifdef __SSE2_MATH__
-# define math_opt_barrier(x) \
- ({ __typeof(x) __x; \
- if (sizeof (x) <= sizeof (double)) \
- __asm ("" : "=x" (__x) : "0" (x)); \
- else \
- __asm ("" : "=t" (__x) : "0" (x)); \
- __x; })
-# define math_force_eval(x) \
- do { \
- if (sizeof (x) <= sizeof (double)) \
- __asm __volatile ("" : : "x" (x)); \
- else \
- __asm __volatile ("" : : "f" (x)); \
- } while (0)
-#else
-# define math_opt_barrier(x) \
- ({ __typeof (x) __x; \
- __asm ("" : "=t" (__x) : "0" (x)); \
- __x; })
-# define math_force_eval(x) \
- do { \
- __typeof (x) __x = (x); \
- if (sizeof (x) <= sizeof (double)) \
- __asm __volatile ("" : : "m" (__x)); \
- else \
- __asm __volatile ("" : : "f" (__x)); \
- } while (0)
-#endif
-
/* This file is used by both the 32- and 64-bit ports. The 64-bit port
has a field in the fenv_t for the mxcsr; the 32-bit port does not.
Instead, we (ab)use the only 32-bit field extant in the struct. */
@@ -322,6 +293,21 @@ libc_feresetround_387 (fenv_t *e)
# define libc_feholdsetround_53bit libc_feholdsetround_387_53bit
#endif
+#ifdef __x86_64__
+/* The SSE rounding mode is used by soft-fp (libgcc and glibc) on
+ x86_64, so that must be set for float128 computations. */
+# define SET_RESTORE_ROUNDF128(RM) \
+ SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_sse, libc_feresetround_sse)
+# define libc_feholdexcept_setroundf128 libc_feholdexcept_setround_sse
+# define libc_feupdateenv_testf128 libc_feupdateenv_test_sse
+#else
+/* The 387 rounding mode is used by soft-fp for 32-bit, but whether
+ 387 or SSE exceptions are used depends on whether libgcc was built
+ for SSE math, which is not known when glibc is being built. */
+# define libc_feholdexcept_setroundf128 default_libc_feholdexcept_setround
+# define libc_feupdateenv_testf128 default_libc_feupdateenv_test
+#endif
+
/* We have support for rounding mode context. */
#define HAVE_RM_CTX 1
@@ -474,11 +460,19 @@ libc_feupdateenv_387_ctx (struct rm_ctx *ctx)
#endif /* __SSE_MATH__ */
#ifdef __SSE2_MATH__
-# define libc_feholdexcept_setround_ctx libc_feholdexcept_setround_sse_ctx
-# define libc_fesetenv_ctx libc_fesetenv_sse_ctx
-# define libc_feupdateenv_ctx libc_feupdateenv_sse_ctx
-# define libc_feholdsetround_ctx libc_feholdsetround_sse_ctx
-# define libc_feresetround_ctx libc_feresetround_sse_ctx
+# if defined (__x86_64__) || !defined (MATH_SET_BOTH_ROUNDING_MODES)
+# define libc_feholdexcept_setround_ctx libc_feholdexcept_setround_sse_ctx
+# define libc_fesetenv_ctx libc_fesetenv_sse_ctx
+# define libc_feupdateenv_ctx libc_feupdateenv_sse_ctx
+# define libc_feholdsetround_ctx libc_feholdsetround_sse_ctx
+# define libc_feresetround_ctx libc_feresetround_sse_ctx
+# else
+# define libc_feholdexcept_setround_ctx default_libc_feholdexcept_setround_ctx
+# define libc_fesetenv_ctx default_libc_fesetenv_ctx
+# define libc_feupdateenv_ctx default_libc_feupdateenv_ctx
+# define libc_feholdsetround_ctx default_libc_feholdsetround_ctx
+# define libc_feresetround_ctx default_libc_feresetround_ctx
+# endif
#else
# define libc_feholdexcept_setround_ctx libc_feholdexcept_setround_387_ctx
# define libc_feupdateenv_ctx libc_feupdateenv_387_ctx
diff --git a/sysdeps/i386/fpu/fesetenv.c b/sysdeps/i386/fpu/fesetenv.c
index 0d8f435f0b..6df6849da4 100644
--- a/sysdeps/i386/fpu/fesetenv.c
+++ b/sysdeps/i386/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -79,7 +79,7 @@ __fesetenv (const fenv_t *envp)
__asm__ ("fldenv %0" : : "m" (temp));
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
{
unsigned int mxcsr;
__asm__ ("stmxcsr %0" : "=m" (mxcsr));
diff --git a/sysdeps/i386/fpu/fesetexcept.c b/sysdeps/i386/fpu/fesetexcept.c
new file mode 100644
index 0000000000..180b93f60b
--- /dev/null
+++ b/sysdeps/i386/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. i386 version.
+ Copyright (C) 2016-2018 Free Software 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..9aad6ea99f
--- /dev/null
+++ b/sysdeps/i386/fpu/fesetmode.c
@@ -0,0 +1,54 @@
+/* Install given floating-point control modes. i386 version.
+ Copyright (C) 2016-2018 Free Software 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 (HAS_CPU_FEATURE (SSE))
+ {
+ 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/fesetround.c b/sysdeps/i386/fpu/fesetround.c
index 1c1b2fcf26..d260046c65 100644
--- a/sysdeps/i386/fpu/fesetround.c
+++ b/sysdeps/i386/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -37,7 +37,7 @@ __fesetround (int round)
__asm__ ("fldcw %0" : : "m" (*&cw));
/* If the CPU supports SSE we set the MXCSR as well. */
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
{
unsigned int xcw;
diff --git a/sysdeps/i386/fpu/feupdateenv.c b/sysdeps/i386/fpu/feupdateenv.c
index 9d225cf8bb..db3ff96dfa 100644
--- a/sysdeps/i386/fpu/feupdateenv.c
+++ b/sysdeps/i386/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -32,7 +32,7 @@ __feupdateenv (const fenv_t *envp)
__asm__ ("fnstsw %0" : "=m" (*&temp));
/* If the CPU supports SSE we test the MXCSR as well. */
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
__asm__ ("stmxcsr %0" : "=m" (*&xtemp));
temp = (temp | xtemp) & FE_ALL_EXCEPT;
diff --git a/sysdeps/i386/fpu/fgetexcptflg.c b/sysdeps/i386/fpu/fgetexcptflg.c
index 1cb1ebb3fb..39d1f7df3a 100644
--- a/sysdeps/i386/fpu/fgetexcptflg.c
+++ b/sysdeps/i386/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -34,7 +34,7 @@ __fegetexceptflag (fexcept_t *flagp, int excepts)
*flagp = temp & excepts & FE_ALL_EXCEPT;
/* If the CPU supports SSE, we clear the MXCSR as well. */
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
{
unsigned int sse_exc;
diff --git a/sysdeps/i386/fpu/fraiseexcpt.c b/sysdeps/i386/fpu/fraiseexcpt.c
index ad980cca32..6c781df218 100644
--- a/sysdeps/i386/fpu/fraiseexcpt.c
+++ b/sysdeps/i386/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/i386/fpu/fsetexcptflg.c b/sysdeps/i386/fpu/fsetexcptflg.c
index cea473e293..21e70251cf 100644
--- a/sysdeps/i386/fpu/fsetexcptflg.c
+++ b/sysdeps/i386/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -41,7 +41,7 @@ __fesetexceptflag (const fexcept_t *flagp, int excepts)
__asm__ ("fldenv %0" : : "m" (*&temp));
/* If the CPU supports SSE, we set the MXCSR as well. */
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
{
unsigned int xnew_exc;
diff --git a/sysdeps/i386/fpu/ftestexcept.c b/sysdeps/i386/fpu/ftestexcept.c
index 0f7408fad0..c1b5e90356 100644
--- a/sysdeps/i386/fpu/ftestexcept.c
+++ b/sysdeps/i386/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -32,7 +32,7 @@ fetestexcept (int excepts)
__asm__ ("fnstsw %0" : "=a" (temp));
/* If the CPU supports SSE we test the MXCSR as well. */
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
__asm__ ("stmxcsr %0" : "=m" (*&xtemp));
return (temp | xtemp) & excepts & FE_ALL_EXCEPT;
diff --git a/sysdeps/i386/fpu/i386-math-asm.h b/sysdeps/i386/fpu/i386-math-asm.h
index 20307d3a4a..87025b522e 100644
--- a/sysdeps/i386/fpu/i386-math-asm.h
+++ b/sysdeps/i386/fpu/i386-math-asm.h
@@ -1,5 +1,5 @@
/* Helper macros for x86 libm functions.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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 b/sysdeps/i386/fpu/libm-test-ulps
index 84da4753eb..e83bae71b4 100644
--- a/sysdeps/i386/fpu/libm-test-ulps
+++ b/sysdeps/i386/fpu/libm-test-ulps
@@ -3,2187 +3,2767 @@
# Maximal error of functions:
Function: "acos":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "acos_downward":
+float128: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "acos_towardzero":
+float128: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "acos_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "acosh":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 4
ldouble: 2
Function: "acosh_downward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 6
ldouble: 4
Function: "acosh_towardzero":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 6
ldouble: 4
Function: "acosh_upward":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 4
ldouble: 3
Function: "asin":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "asin_downward":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "asin_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "asin_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "asinh":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "asinh_downward":
double: 1
float: 1
+float128: 4
idouble: 1
+ifloat: 1
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "asinh_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
+ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "asinh_upward":
double: 1
float: 1
+float128: 4
idouble: 1
ifloat: 1
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "atan":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan2":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan2_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atan2_towardzero":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "atan2_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atan_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atan_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atanh":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "atanh_downward":
double: 1
float: 1
+float128: 4
idouble: 1
ifloat: 1
-ildouble: 3
+ifloat128: 4
+ildouble: 4
ldouble: 4
Function: "atanh_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 5
ldouble: 3
Function: "atanh_upward":
double: 1
float: 1
+float128: 4
idouble: 1
ifloat: 1
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "cabs":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_downward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "cacos":
double: 1
-float: 1
+float: 2
+float128: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "cacos":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "cacos_downward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos_downward":
-double: 4
+double: 5
float: 3
-idouble: 4
+float128: 6
+idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 6
+ldouble: 6
Function: Real part of "cacos_towardzero":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos_towardzero":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Real part of "cacos_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 7
+float: 7
+float128: 7
+idouble: 7
+ifloat: 7
+ifloat128: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacosh":
double: 1
-float: 1
+float: 2
+float128: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "cacosh_downward":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 2
-ldouble: 2
+double: 2
+float: 2
+float128: 4
+idouble: 2
+ifloat: 2
+ifloat128: 4
+ildouble: 3
+ldouble: 3
Function: Real part of "cacosh_towardzero":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_towardzero":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Real part of "cacosh_upward":
-double: 4
+double: 5
float: 4
-idouble: 4
+float128: 6
+idouble: 5
ifloat: 4
+ifloat128: 6
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 4
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ifloat128: 4
+ildouble: 3
+ldouble: 3
Function: "carg":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "carg_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "carg_towardzero":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "carg_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "casin":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "casin":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 2
-ldouble: 2
-
-Function: Real part of "casin_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+float128: 3
+idouble: 3
+ifloat: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
Function: Imaginary part of "casin_downward":
-double: 4
+double: 5
float: 3
-idouble: 4
+float128: 6
+idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 6
+ldouble: 6
Function: Real part of "casin_towardzero":
-double: 1
+double: 3
float: 1
-idouble: 1
+float128: 3
+idouble: 3
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "casin_towardzero":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Real part of "casin_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 7
+float: 7
+float128: 7
+idouble: 7
+ifloat: 7
+ifloat128: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "casinh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "casinh":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "casinh_downward":
-double: 4
+double: 5
float: 3
-idouble: 4
+float128: 6
+idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "casinh_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 3
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Real part of "casinh_towardzero":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Imaginary part of "casinh_towardzero":
-double: 1
+double: 3
float: 1
-idouble: 1
+float128: 3
+idouble: 3
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 7
+float: 7
+float128: 7
+idouble: 7
+ifloat: 7
+ifloat128: 7
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "casinh_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
+Function: Real part of "catan":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
Function: Imaginary part of "catan":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "catan_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "catan_downward":
double: 2
float: 1
+float128: 2
idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Real part of "catan_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "catan_towardzero":
double: 2
float: 1
+float128: 2
idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Real part of "catan_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "catan_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "catanh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "catanh_downward":
double: 2
float: 1
+float128: 2
idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "catanh_towardzero":
double: 2
float: 1
+float128: 2
idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "catanh_upward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 4
+float: 4
+float128: 4
+idouble: 4
+ifloat: 4
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "cbrt":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "cbrt_downward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: "cbrt_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "cbrt_upward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: Real part of "ccos":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "ccos":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "ccos_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccos_downward":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccos_towardzero":
double: 1
-float: 1
+float: 2
+float128: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccos_towardzero":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccos_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "ccos_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "ccosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "ccosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "ccosh_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccosh_downward":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccosh_towardzero":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 2
+float: 3
+float128: 2
+idouble: 2
+ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccosh_towardzero":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccosh_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "ccosh_upward":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "cexp":
double: 2
float: 1
+float128: 1
idouble: 2
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "cexp":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "cexp_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "cexp_downward":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "cexp_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "cexp_towardzero":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "cexp_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cexp_upward":
double: 3
float: 2
+float128: 3
idouble: 3
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog":
double: 2
-float: 1
+float: 3
+float128: 2
idouble: 2
-ifloat: 1
+ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "clog":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "clog10":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 4
+float128: 2
+idouble: 3
+ifloat: 4
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Imaginary part of "clog10":
-double: 1
-idouble: 1
+double: 2
+float: 1
+float128: 2
+idouble: 2
+ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "clog10_downward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 4
+float: 4
+float128: 3
+idouble: 4
+ifloat: 4
+ifloat128: 3
ildouble: 8
ldouble: 8
Function: Imaginary part of "clog10_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog10_towardzero":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 5
+float: 5
+float128: 4
+idouble: 5
+ifloat: 5
+ifloat128: 4
ildouble: 8
ldouble: 8
Function: Imaginary part of "clog10_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog10_upward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 4
+float: 5
+float128: 4
+idouble: 4
+ifloat: 5
+ifloat128: 4
ildouble: 7
ldouble: 7
Function: Imaginary part of "clog10_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog_downward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Imaginary part of "clog_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "clog_towardzero":
double: 3
-float: 3
+float: 4
+float128: 3
idouble: 3
-ifloat: 3
+ifloat: 4
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Imaginary part of "clog_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "clog_upward":
double: 2
float: 3
+float128: 4
idouble: 2
ifloat: 3
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "clog_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "cos":
+double: 1
float: 1
+float128: 1
+idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cos_downward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "cos_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cos_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "cosh":
double: 1
float: 1
+float128: 1
idouble: 1
+ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cosh_downward":
double: 2
float: 1
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 3
Function: "cosh_towardzero":
double: 2
float: 1
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cosh_upward":
double: 4
float: 2
-idouble: 1
-ifloat: 1
+float128: 3
+idouble: 4
+ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 3
Function: Real part of "cpow":
double: 2
float: 5
+float128: 4
idouble: 2
ifloat: 5
+ifloat128: 4
ildouble: 3
ldouble: 3
Function: Imaginary part of "cpow":
float: 2
+float128: 1
ifloat: 2
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: Real part of "cpow_downward":
double: 5
float: 8
+float128: 6
idouble: 5
ifloat: 8
+ifloat128: 6
ildouble: 7
ldouble: 7
Function: Imaginary part of "cpow_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "cpow_towardzero":
double: 5
float: 8
+float128: 6
idouble: 5
ifloat: 8
+ifloat128: 6
ildouble: 7
ldouble: 7
Function: Imaginary part of "cpow_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "cpow_upward":
double: 4
float: 1
+float128: 3
idouble: 4
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cpow_upward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "csin":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "csin":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
Function: Real part of "csin_downward":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csin_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csin_towardzero":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csin_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csin_upward":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "csin_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Real part of "csinh":
+float: 1
+float128: 1
+ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "csinh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "csinh_downward":
-double: 1
+double: 2
float: 1
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csinh_downward":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csinh_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csinh_towardzero":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csinh_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "csinh_upward":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "csqrt":
-double: 1
-idouble: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "csqrt":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "csqrt_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 4
+float: 4
+float128: 4
+idouble: 4
+ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "csqrt_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Real part of "csqrt_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Imaginary part of "csqrt_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Real part of "csqrt_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 4
+float: 4
+float128: 4
+idouble: 4
+ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "csqrt_upward":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Real part of "ctan":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "ctan":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: Real part of "ctan_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 6
+float: 5
+float128: 4
+idouble: 6
+ifloat: 5
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
+float128: 5
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Real part of "ctan_towardzero":
-double: 3
-float: 2
-idouble: 3
-ifloat: 2
+double: 5
+float: 3
+float128: 4
+idouble: 5
+ifloat: 3
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "ctan_towardzero":
double: 2
float: 3
+float128: 5
idouble: 2
ifloat: 3
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Real part of "ctan_upward":
double: 3
-float: 2
+float: 4
+float128: 5
idouble: 3
-ifloat: 2
+ifloat: 4
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: Imaginary part of "ctan_upward":
double: 2
float: 1
+float128: 5
idouble: 2
ifloat: 1
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: Real part of "ctanh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: Imaginary part of "ctanh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Real part of "ctanh_downward":
double: 2
float: 2
+float128: 5
idouble: 2
ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Imaginary part of "ctanh_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 6
+float: 5
+float128: 4
+idouble: 6
+ifloat: 5
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Real part of "ctanh_towardzero":
double: 2
float: 3
+float128: 5
idouble: 2
ifloat: 3
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Imaginary part of "ctanh_towardzero":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 5
+float: 3
+float128: 3
+idouble: 5
+ifloat: 3
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "ctanh_upward":
double: 2
-float: 1
+float: 2
+float128: 5
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: Imaginary part of "ctanh_upward":
double: 3
-float: 2
+float: 3
+float128: 5
idouble: 3
-ifloat: 2
+ifloat: 3
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: "erf":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "erf_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "erf_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "erf_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "erfc":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 2
+float128: 2
+idouble: 3
+ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "erfc_downward":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 5
+float: 6
+float128: 5
+idouble: 5
+ifloat: 6
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "erfc_towardzero":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 4
+float128: 4
+idouble: 3
+ifloat: 4
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "erfc_upward":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 5
+float: 6
+float128: 5
+idouble: 5
+ifloat: 6
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "exp":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp10":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "exp10_downward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "exp10_towardzero":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "exp10_upward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "exp2":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp2_downward":
+float128: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp2_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp2_upward":
+float: 1
+float128: 2
+ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 2
ldouble: 2
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "expm1":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "expm1_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "expm1_towardzero":
double: 1
float: 1
+float128: 4
idouble: 1
ifloat: 1
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "expm1_upward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "gamma":
-double: 3
-float: 2
-idouble: 3
-ifloat: 2
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
ildouble: 4
ldouble: 4
Function: "gamma_downward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
ildouble: 7
ldouble: 7
Function: "gamma_towardzero":
-double: 4
-float: 2
-idouble: 4
-ifloat: 2
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
ildouble: 7
ldouble: 7
Function: "gamma_upward":
-double: 3
-float: 4
-idouble: 3
-ifloat: 4
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
ildouble: 5
ldouble: 5
Function: "hypot":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "hypot_downward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "hypot_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "hypot_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "j0":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "j0_downward":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 2
+float: 4
+float128: 4
+idouble: 2
+ifloat: 4
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "j0_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+float128: 2
+idouble: 3
+ifloat: 2
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: "j0_upward":
-double: 1
+double: 3
float: 3
-idouble: 1
+float128: 5
+idouble: 3
ifloat: 3
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "j1":
double: 2
-float: 1
+float: 2
+float128: 4
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 4
ildouble: 1
ldouble: 1
Function: "j1_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+float128: 4
+idouble: 3
+ifloat: 3
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "j1_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+float128: 4
+idouble: 3
+ifloat: 2
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "j1_upward":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 3
+float: 5
+float128: 3
+idouble: 3
+ifloat: 5
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "jn":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 4
+float: 4
+float128: 7
+idouble: 4
+ifloat: 4
+ifloat128: 7
ildouble: 4
ldouble: 4
Function: "jn_downward":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 5
+float: 5
+float128: 8
+idouble: 5
+ifloat: 5
+ifloat128: 8
ildouble: 4
ldouble: 4
Function: "jn_towardzero":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 5
+float: 5
+float128: 8
+idouble: 5
+ifloat: 5
+ifloat128: 8
ildouble: 5
ldouble: 5
Function: "jn_upward":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 5
+float: 5
+float128: 7
+idouble: 5
+ifloat: 5
+ifloat128: 7
ildouble: 5
ldouble: 5
Function: "lgamma":
-double: 3
-float: 2
-idouble: 3
-ifloat: 2
+double: 4
+float: 3
+float128: 5
+idouble: 4
+ifloat: 3
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "lgamma_downward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 5
+float128: 8
+idouble: 5
+ifloat: 5
+ifloat128: 8
ildouble: 7
ldouble: 7
Function: "lgamma_towardzero":
-double: 4
-float: 2
-idouble: 4
-ifloat: 2
+double: 5
+float: 4
+float128: 5
+idouble: 5
+ifloat: 4
+ifloat128: 5
ildouble: 7
ldouble: 7
Function: "lgamma_upward":
-double: 3
-float: 4
-idouble: 3
-ifloat: 4
+double: 5
+float: 5
+float128: 8
+idouble: 5
+ifloat: 5
+ifloat128: 8
ildouble: 5
ldouble: 5
Function: "log":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log10":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log10_downward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "log10_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "log10_upward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log1p":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "log1p_downward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "log1p_towardzero":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "log1p_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "log2":
double: 1
+float: 1
+float128: 2
idouble: 1
+ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "log2_downward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "log2_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log2_upward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log_downward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "log_towardzero":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "log_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "pow":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
-Function: "pow10":
-double: 1
-idouble: 1
-ildouble: 1
-ldouble: 1
-
-Function: "pow10_downward":
+Function: "pow_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 2
+ildouble: 4
+ldouble: 4
-Function: "pow10_towardzero":
+Function: "pow_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 2
+ildouble: 4
+ldouble: 4
-Function: "pow10_upward":
+Function: "pow_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
-ildouble: 2
-ldouble: 2
-
-Function: "pow_downward":
-double: 1
-idouble: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
-Function: "pow_towardzero":
-double: 1
-idouble: 1
-ildouble: 1
-ldouble: 1
-
-Function: "pow_upward":
-double: 1
-idouble: 1
-ildouble: 2
-ldouble: 2
-
Function: "sin":
+double: 1
float: 1
+float128: 1
+idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "sin_downward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "sin_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "sin_upward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "sincos":
+double: 1
float: 1
+float128: 1
+idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "sincos_downward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "sincos_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "sincos_upward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "sinh":
-double: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "sinh_downward":
-double: 2
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 4
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
+ildouble: 5
ldouble: 5
Function: "sinh_towardzero":
double: 2
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 3
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
+ildouble: 4
ldouble: 4
Function: "sinh_upward":
double: 4
-float: 2
-idouble: 1
-ifloat: 1
-ildouble: 4
+float: 3
+float128: 4
+idouble: 4
+ifloat: 3
+ifloat128: 4
+ildouble: 5
ldouble: 5
Function: "tan":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "tan_downward":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "tan_towardzero":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "tan_upward":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "tanh":
-double: 1
-idouble: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "tanh_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+float128: 4
+idouble: 3
+ifloat: 3
+ifloat128: 4
ildouble: 7
ldouble: 4
Function: "tanh_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "tanh_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 5
-ldouble: 4
-
-Function: "tgamma":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
+ildouble: 5
+ldouble: 4
+
+Function: "tgamma":
+double: 5
+float: 4
+float128: 4
+idouble: 5
+ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "tgamma_downward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 6
+float: 5
+float128: 5
+idouble: 6
+ifloat: 5
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "tgamma_towardzero":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 6
+float: 4
+float128: 5
+idouble: 6
+ifloat: 4
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "tgamma_upward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 5
+float: 4
+float128: 4
+idouble: 5
+ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "y0":
-double: 1
+double: 2
float: 1
-idouble: 1
+float128: 3
+idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "y0_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 4
+float128: 4
+idouble: 3
+ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "y0_towardzero":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: "y0_upward":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 3
+float: 5
+float128: 3
+idouble: 3
+ifloat: 5
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "y1":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 2
+idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "y1_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+float128: 4
+idouble: 3
+ifloat: 3
+ifloat128: 4
ildouble: 7
ldouble: 7
Function: "y1_towardzero":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: "y1_upward":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 7
+float: 3
+float128: 5
+idouble: 7
+ifloat: 3
+ifloat128: 5
ildouble: 7
ldouble: 7
Function: "yn":
-double: 2
+double: 3
float: 3
-idouble: 2
+float128: 5
+idouble: 3
ifloat: 3
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "yn_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 4
+float128: 5
+idouble: 3
+ifloat: 4
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "yn_towardzero":
double: 3
float: 3
+float128: 5
idouble: 3
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "yn_upward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 4
+float: 5
+float128: 5
+idouble: 4
+ifloat: 5
+ifloat128: 5
ildouble: 4
ldouble: 4
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/fpu/math-tests.h b/sysdeps/i386/fpu/math-tests.h
index 80492fe632..6aba8414d4 100644
--- a/sysdeps/i386/fpu/math-tests.h
+++ b/sysdeps/i386/fpu/math-tests.h
@@ -1,5 +1,5 @@
/* Configuration for math tests. 32-bit x86 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/fpu/s_asinh.S b/sysdeps/i386/fpu/s_asinh.S
index 6a6e5b9004..2a03a588ac 100644
--- a/sysdeps/i386/fpu/s_asinh.S
+++ b/sysdeps/i386/fpu/s_asinh.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
+#include <libm-alias-double.h>
.section .rodata
@@ -136,4 +137,4 @@ ENTRY(__asinh)
fchs
4: ret
END(__asinh)
-weak_alias (__asinh, asinh)
+libm_alias_double (__asinh, asinh)
diff --git a/sysdeps/i386/fpu/s_asinhf.S b/sysdeps/i386/fpu/s_asinhf.S
index 31f25192f3..bc082f0e7b 100644
--- a/sysdeps/i386/fpu/s_asinhf.S
+++ b/sysdeps/i386/fpu/s_asinhf.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
+#include <libm-alias-float.h>
.section .rodata
@@ -136,4 +137,4 @@ ENTRY(__asinhf)
fchs
4: ret
END(__asinhf)
-weak_alias (__asinhf, asinhf)
+libm_alias_float (__asinh, asinh)
diff --git a/sysdeps/i386/fpu/s_asinhl.S b/sysdeps/i386/fpu/s_asinhl.S
index c9d5714bee..21cb30a9e6 100644
--- a/sysdeps/i386/fpu/s_asinhl.S
+++ b/sysdeps/i386/fpu/s_asinhl.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -17,6 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
.section .rodata
@@ -88,6 +89,7 @@ ENTRY(__asinhl)
4: ret
7: fldt 4(%esp)
+ fadd %st
ret
6: faddl MO(one)
@@ -140,4 +142,4 @@ ENTRY(__asinhl)
fchs
4: ret
END(__asinhl)
-weak_alias (__asinhl, asinhl)
+libm_alias_ldouble (__asinh, asinh)
diff --git a/sysdeps/i386/fpu/s_atan.S b/sysdeps/i386/fpu/s_atan.S
index 644de78feb..0102281be9 100644
--- a/sysdeps/i386/fpu/s_atan.S
+++ b/sysdeps/i386/fpu/s_atan.S
@@ -5,6 +5,7 @@
#include <machine/asm.h>
#include <i386-math-asm.h>
+#include <libm-alias-double.h>
RCSID("$NetBSD: s_atan.S,v 1.4 1995/05/08 23:50:41 jtc Exp $")
@@ -27,4 +28,4 @@ ENTRY(__atan)
DBL_CHECK_FORCE_UFLOW
ret
END (__atan)
-weak_alias (__atan, atan)
+libm_alias_double (__atan, atan)
diff --git a/sysdeps/i386/fpu/s_atanf.S b/sysdeps/i386/fpu/s_atanf.S
index 0589c1135e..15ecd345d9 100644
--- a/sysdeps/i386/fpu/s_atanf.S
+++ b/sysdeps/i386/fpu/s_atanf.S
@@ -5,6 +5,7 @@
#include <machine/asm.h>
#include <i386-math-asm.h>
+#include <libm-alias-float.h>
RCSID("$NetBSD: s_atanf.S,v 1.3 1995/05/08 23:51:33 jtc Exp $")
@@ -27,4 +28,4 @@ ENTRY(__atanf)
FLT_CHECK_FORCE_UFLOW
ret
END (__atanf)
-weak_alias (__atanf, atanf)
+libm_alias_float (__atan, atan)
diff --git a/sysdeps/i386/fpu/s_atanl.c b/sysdeps/i386/fpu/s_atanl.c
index b7dba88aad..2b02ac1e32 100644
--- a/sysdeps/i386/fpu/s_atanl.c
+++ b/sysdeps/i386/fpu/s_atanl.c
@@ -6,6 +6,7 @@
*/
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double
__atanl (long double x)
@@ -19,4 +20,4 @@ __atanl (long double x)
return res;
}
-weak_alias (__atanl, atanl)
+libm_alias_ldouble (__atan, atan)
diff --git a/sysdeps/i386/fpu/s_cbrt.S b/sysdeps/i386/fpu/s_cbrt.S
index 6e7e99d9e8..abce211322 100644
--- a/sysdeps/i386/fpu/s_cbrt.S
+++ b/sysdeps/i386/fpu/s_cbrt.S
@@ -1,5 +1,5 @@
/* Compute cubic root of double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dirk Alboth <dirka@uni-paderborn.de> and
Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,7 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
+#include <libm-alias-double.h>
.section .rodata
@@ -197,4 +198,4 @@ ENTRY(__cbrt)
1: fldl 4(%esp)
ret
END(__cbrt)
-weak_alias (__cbrt, cbrt)
+libm_alias_double (__cbrt, cbrt)
diff --git a/sysdeps/i386/fpu/s_cbrtf.S b/sysdeps/i386/fpu/s_cbrtf.S
index 0a9db49523..0bdb2f32ec 100644
--- a/sysdeps/i386/fpu/s_cbrtf.S
+++ b/sysdeps/i386/fpu/s_cbrtf.S
@@ -1,5 +1,5 @@
/* Compute cubic root of float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dirk Alboth <dirka@uni-paderborn.de> and
Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,7 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
+#include <libm-alias-float.h>
.section .rodata
@@ -174,4 +175,4 @@ ENTRY(__cbrtf)
1: flds 4(%esp)
ret
END(__cbrtf)
-weak_alias (__cbrtf, cbrtf)
+libm_alias_float (__cbrt, cbrt)
diff --git a/sysdeps/i386/fpu/s_cbrtl.S b/sysdeps/i386/fpu/s_cbrtl.S
index 3bf170075b..0328c96f6b 100644
--- a/sysdeps/i386/fpu/s_cbrtl.S
+++ b/sysdeps/i386/fpu/s_cbrtl.S
@@ -1,5 +1,5 @@
/* Compute cubic root of long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dirk Alboth <dirka@uni-paderborn.de> and
Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
.section .rodata
@@ -223,6 +224,7 @@ ENTRY(__cbrtl)
/* Return the argument. */
1: fldt 4(%esp)
+ fadd %st
ret
END(__cbrtl)
-weak_alias (__cbrtl, cbrtl)
+libm_alias_ldouble (__cbrt, cbrt)
diff --git a/sysdeps/i386/fpu/s_ceil.S b/sysdeps/i386/fpu/s_ceil.S
index f32fa26d34..9287ab0673 100644
--- a/sysdeps/i386/fpu/s_ceil.S
+++ b/sysdeps/i386/fpu/s_ceil.S
@@ -4,15 +4,16 @@
*/
#include <machine/asm.h>
+#include <libm-alias-double.h>
RCSID("$NetBSD: s_ceil.S,v 1.4 1995/05/08 23:52:13 jtc Exp $")
ENTRY(__ceil)
fldl 4(%esp)
- subl $8,%esp
- cfi_adjust_cfa_offset (8)
+ subl $32,%esp
+ cfi_adjust_cfa_offset (32)
- fstcw 4(%esp) /* store fpu control word */
+ fnstenv 4(%esp) /* store fpu environment */
/* We use here %edx although only the low 1 bits are defined.
But none of the operations should care and they are faster
@@ -25,10 +26,10 @@ ENTRY(__ceil)
frndint /* round */
- fldcw 4(%esp) /* restore original control word */
+ fldenv 4(%esp) /* restore original environment */
- addl $8,%esp
- cfi_adjust_cfa_offset (-8)
+ addl $32,%esp
+ cfi_adjust_cfa_offset (-32)
ret
END (__ceil)
-weak_alias (__ceil, ceil)
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/i386/fpu/s_ceilf.S b/sysdeps/i386/fpu/s_ceilf.S
index 4fe703b179..2a6e3db273 100644
--- a/sysdeps/i386/fpu/s_ceilf.S
+++ b/sysdeps/i386/fpu/s_ceilf.S
@@ -4,15 +4,16 @@
*/
#include <machine/asm.h>
+#include <libm-alias-float.h>
RCSID("$NetBSD: s_ceilf.S,v 1.3 1995/05/08 23:52:44 jtc Exp $")
ENTRY(__ceilf)
flds 4(%esp)
- subl $8,%esp
- cfi_adjust_cfa_offset (8)
+ subl $32,%esp
+ cfi_adjust_cfa_offset (32)
- fstcw 4(%esp) /* store fpu control word */
+ fnstenv 4(%esp) /* store fpu environment */
/* We use here %edx although only the low 1 bits are defined.
But none of the operations should care and they are faster
@@ -25,10 +26,10 @@ ENTRY(__ceilf)
frndint /* round */
- fldcw 4(%esp) /* restore original control word */
+ fldenv 4(%esp) /* restore original environment */
- addl $8,%esp
- cfi_adjust_cfa_offset (-8)
+ addl $32,%esp
+ cfi_adjust_cfa_offset (-32)
ret
END (__ceilf)
-weak_alias (__ceilf, ceilf)
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/i386/fpu/s_ceill.S b/sysdeps/i386/fpu/s_ceill.S
index 4b272c522a..70d5c6ce0c 100644
--- a/sysdeps/i386/fpu/s_ceill.S
+++ b/sysdeps/i386/fpu/s_ceill.S
@@ -4,16 +4,17 @@
* Public domain.
*/
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
RCSID("$NetBSD: $")
ENTRY(__ceill)
fldt 4(%esp)
- subl $8,%esp
- cfi_adjust_cfa_offset (8)
+ subl $32,%esp
+ cfi_adjust_cfa_offset (32)
- fstcw 4(%esp) /* store fpu control word */
+ fnstenv 4(%esp) /* store fpu environment */
/* We use here %edx although only the low 1 bits are defined.
But none of the operations should care and they are faster
@@ -26,10 +27,15 @@ ENTRY(__ceill)
frndint /* round */
- fldcw 4(%esp) /* restore original control word */
+ /* Preserve "invalid" exceptions from sNaN input. */
+ fnstsw
+ andl $0x1, %eax
+ orl %eax, 8(%esp)
- addl $8,%esp
- cfi_adjust_cfa_offset (-8)
+ fldenv 4(%esp) /* restore original environment */
+
+ addl $32,%esp
+ cfi_adjust_cfa_offset (-32)
ret
END (__ceill)
-weak_alias (__ceill, ceill)
+libm_alias_ldouble (__ceil, ceil)
diff --git a/sysdeps/i386/fpu/s_copysign.S b/sysdeps/i386/fpu/s_copysign.S
index 2520a94427..1434d407a7 100644
--- a/sysdeps/i386/fpu/s_copysign.S
+++ b/sysdeps/i386/fpu/s_copysign.S
@@ -4,6 +4,7 @@
*/
#include <machine/asm.h>
+#include <libm-alias-double.h>
RCSID("$NetBSD: s_copysign.S,v 1.4 1995/05/08 23:53:02 jtc Exp $")
@@ -17,4 +18,4 @@ ENTRY(__copysign)
fldl 4(%esp)
ret
END (__copysign)
-weak_alias (__copysign, copysign)
+libm_alias_double (__copysign, copysign)
diff --git a/sysdeps/i386/fpu/s_copysignf.S b/sysdeps/i386/fpu/s_copysignf.S
index 57b1a6f119..a05b749f1b 100644
--- a/sysdeps/i386/fpu/s_copysignf.S
+++ b/sysdeps/i386/fpu/s_copysignf.S
@@ -4,6 +4,7 @@
*/
#include <machine/asm.h>
+#include <libm-alias-float.h>
RCSID("$NetBSD: s_copysignf.S,v 1.3 1995/05/08 23:53:25 jtc Exp $")
@@ -17,4 +18,4 @@ ENTRY(__copysignf)
flds 4(%esp)
ret
END (__copysignf)
-weak_alias (__copysignf, copysignf)
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/i386/fpu/s_copysignl.S b/sysdeps/i386/fpu/s_copysignl.S
index 2163e7b014..671ce683ba 100644
--- a/sysdeps/i386/fpu/s_copysignl.S
+++ b/sysdeps/i386/fpu/s_copysignl.S
@@ -4,6 +4,7 @@
* Public domain.
*/
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
RCSID("$NetBSD: $")
@@ -18,4 +19,4 @@ ENTRY(__copysignl)
fldt 4(%esp)
ret
END (__copysignl)
-weak_alias (__copysignl, copysignl)
+libm_alias_ldouble (__copysign, copysign)
diff --git a/sysdeps/i386/fpu/s_expm1.S b/sysdeps/i386/fpu/s_expm1.S
index 0bd227ee7a..2a7c41e72f 100644
--- a/sysdeps/i386/fpu/s_expm1.S
+++ b/sysdeps/i386/fpu/s_expm1.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of exp(x)-1.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
Based on code by John C. Bowman <bowman@ipp-garching.mpg.de>.
@@ -24,6 +24,7 @@
#include <sysdep.h>
#include <machine/asm.h>
#include <i386-math-asm.h>
+#include <libm-alias-double.h>
.section .rodata
@@ -110,4 +111,4 @@ ENTRY(__expm1)
fldl MO(minus1) // Set result to -1.0.
3: ret
END(__expm1)
-weak_alias (__expm1, expm1)
+libm_alias_double (__expm1, expm1)
diff --git a/sysdeps/i386/fpu/s_expm1f.S b/sysdeps/i386/fpu/s_expm1f.S
index 669140eb75..5acf374c4b 100644
--- a/sysdeps/i386/fpu/s_expm1f.S
+++ b/sysdeps/i386/fpu/s_expm1f.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of exp(x)-1.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
Based on code by John C. Bowman <bowman@ipp-garching.mpg.de>.
@@ -24,6 +24,7 @@
#include <sysdep.h>
#include <machine/asm.h>
#include <i386-math-asm.h>
+#include <libm-alias-float.h>
.section .rodata
@@ -110,4 +111,4 @@ ENTRY(__expm1f)
fldl MO(minus1) // Set result to -1.0.
3: ret
END(__expm1f)
-weak_alias (__expm1f, expm1f)
+libm_alias_float (__expm1, expm1)
diff --git a/sysdeps/i386/fpu/s_f32xaddf64.c b/sysdeps/i386/fpu/s_f32xaddf64.c
new file mode 100644
index 0000000000..9d5e85b409
--- /dev/null
+++ b/sysdeps/i386/fpu/s_f32xaddf64.c
@@ -0,0 +1,42 @@
+/* Add _Float64 values, converting the result to _Float32x. i386 version.
+ Copyright (C) 2018 Free Software 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 <fpu_control.h>
+#include <math-narrow-eval.h>
+#include <math_private.h>
+#include <math-narrow.h>
+
+_Float32x
+__f32xaddf64 (_Float64 x, _Float64 y)
+{
+ /* To avoid double rounding, set double precision for the addition.
+ math_narrow_eval is still needed to eliminate excess range in the
+ case of overflow. If the result of the addition is in the
+ subnormal range for double, it is exact, so no issues of double
+ rounding for subnormals arise. */
+ fpu_control_t cw, cw_double;
+ _FPU_GETCW (cw);
+ cw_double = (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE;
+ _FPU_SETCW (cw_double);
+ _Float32x ret = math_narrow_eval (x + y);
+ _FPU_SETCW (cw);
+ CHECK_NARROW_ADD (ret, x, y);
+ return ret;
+}
+libm_alias_float32x_float64 (add)
diff --git a/sysdeps/i386/fpu/s_f32xdivf64.c b/sysdeps/i386/fpu/s_f32xdivf64.c
new file mode 100644
index 0000000000..77f965a290
--- /dev/null
+++ b/sysdeps/i386/fpu/s_f32xdivf64.c
@@ -0,0 +1,29 @@
+/* Divide _Float64 values, converting the result to _Float32x. i386 version.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+_Float32x
+__f32xdivf64 (_Float64 x, _Float64 y)
+{
+ /* To avoid double rounding, use round-to-odd on long double. */
+ NARROW_DIV_ROUND_TO_ODD ((long double) x, (long double) y, double,
+ union ieee854_long_double, l, mantissa1);
+}
+libm_alias_float32x_float64 (div)
diff --git a/sysdeps/i386/fpu/s_f32xmulf64.c b/sysdeps/i386/fpu/s_f32xmulf64.c
new file mode 100644
index 0000000000..7710fa47a8
--- /dev/null
+++ b/sysdeps/i386/fpu/s_f32xmulf64.c
@@ -0,0 +1,29 @@
+/* Multiply _Float64 values, converting the result to _Float32x. i386 version.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+_Float32x
+__f32xmulf64 (_Float64 x, _Float64 y)
+{
+ /* To avoid double rounding, use round-to-odd on long double. */
+ NARROW_MUL_ROUND_TO_ODD ((long double) x, (long double) y, double,
+ union ieee854_long_double, l, mantissa1);
+}
+libm_alias_float32x_float64 (mul)
diff --git a/sysdeps/i386/fpu/s_f32xsubf64.c b/sysdeps/i386/fpu/s_f32xsubf64.c
new file mode 100644
index 0000000000..3f41acfdc9
--- /dev/null
+++ b/sysdeps/i386/fpu/s_f32xsubf64.c
@@ -0,0 +1,42 @@
+/* Subtract _Float64 values, converting the result to _Float32x. i386 version.
+ Copyright (C) 2018 Free Software 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 <fpu_control.h>
+#include <math-narrow-eval.h>
+#include <math_private.h>
+#include <math-narrow.h>
+
+_Float32x
+__f32xsubf64 (_Float64 x, _Float64 y)
+{
+ /* To avoid double rounding, set double precision for the subtraction.
+ math_narrow_eval is still needed to eliminate excess range in the
+ case of overflow. If the result of the subtraction is in the
+ subnormal range for double, it is exact, so no issues of double
+ rounding for subnormals arise. */
+ fpu_control_t cw, cw_double;
+ _FPU_GETCW (cw);
+ cw_double = (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE;
+ _FPU_SETCW (cw_double);
+ _Float32x ret = math_narrow_eval (x - y);
+ _FPU_SETCW (cw);
+ CHECK_NARROW_SUB (ret, x, y);
+ return ret;
+}
+libm_alias_float32x_float64 (sub)
diff --git a/sysdeps/i386/fpu/s_fabs.S b/sysdeps/i386/fpu/s_fabs.S
index 23ae9dccb9..c623eb526c 100644
--- a/sysdeps/i386/fpu/s_fabs.S
+++ b/sysdeps/i386/fpu/s_fabs.S
@@ -1,4 +1,5 @@
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__fabs)
@@ -6,4 +7,4 @@ ENTRY(__fabs)
fabs
ret
END(__fabs)
-weak_alias (__fabs, fabs)
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/i386/fpu/s_fabsf.S b/sysdeps/i386/fpu/s_fabsf.S
index c0407a8839..3185946ec1 100644
--- a/sysdeps/i386/fpu/s_fabsf.S
+++ b/sysdeps/i386/fpu/s_fabsf.S
@@ -1,4 +1,5 @@
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__fabsf)
@@ -6,4 +7,4 @@ ENTRY(__fabsf)
fabs
ret
END(__fabsf)
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/i386/fpu/s_fabsl.S b/sysdeps/i386/fpu/s_fabsl.S
index a12a3e050b..6642ed4151 100644
--- a/sysdeps/i386/fpu/s_fabsl.S
+++ b/sysdeps/i386/fpu/s_fabsl.S
@@ -1,3 +1,4 @@
+#include <libm-alias-ldouble.h>
#include <sysdep.h>
.text
@@ -6,4 +7,4 @@ ENTRY(__fabsl)
fabs
ret
END(__fabsl)
-weak_alias (__fabsl, fabsl)
+libm_alias_ldouble (__fabs, fabs)
diff --git a/sysdeps/i386/fpu/s_fdim.S b/sysdeps/i386/fpu/s_fdim.S
deleted file mode 100644
index d62069b039..0000000000
--- a/sysdeps/i386/fpu/s_fdim.S
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Compute positive difference.
- 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 <sysdep.h>
-
- .text
-ENTRY(__fdim)
- fldl 4(%esp) // x
- fldl 12(%esp) // x : y
-
- fucom %st(1)
- fnstsw
- sahf
- jp 1f
-
- jc 3f
-
- fstp %st(1)
- fldz
- jmp 2f
-
-3: fsubrp %st, %st(1)
- ret
-
-1: fxam
- fnstsw
- andb $0x45, %ah
- cmpb $0x01, %ah
- je 2f
-
- fxch
-2: fstp %st(1)
- ret
-END(__fdim)
-weak_alias (__fdim, fdim)
diff --git a/sysdeps/i386/fpu/s_fdim.c b/sysdeps/i386/fpu/s_fdim.c
new file mode 100644
index 0000000000..b8fefe7d18
--- /dev/null
+++ b/sysdeps/i386/fpu/s_fdim.c
@@ -0,0 +1,48 @@
+/* Return positive difference between arguments. i386 version.
+ Copyright (C) 1997-2018 Free Software 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 <fpu_control.h>
+#include <math.h>
+#include <math-narrow-eval.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+
+double
+__fdim (double x, double y)
+{
+ if (islessequal (x, y))
+ return 0.0;
+
+ /* To avoid double rounding, set double precision for the
+ subtraction. math_narrow_eval is still needed to eliminate
+ excess range in the case of overflow. If the result of the
+ subtraction is in the subnormal range for double, it is exact, so
+ no issues of double rounding for subnormals arise. */
+ fpu_control_t cw, cw_double;
+ _FPU_GETCW (cw);
+ cw_double = (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE;
+ _FPU_SETCW (cw_double);
+ double r = math_narrow_eval (x - y);
+ _FPU_SETCW (cw);
+ if (isinf (r) && !isinf (x) && !isinf (y))
+ __set_errno (ERANGE);
+
+ return r;
+}
+libm_alias_double (__fdim, fdim)
diff --git a/sysdeps/i386/fpu/s_fdimf.S b/sysdeps/i386/fpu/s_fdimf.S
deleted file mode 100644
index d2bd29a233..0000000000
--- a/sysdeps/i386/fpu/s_fdimf.S
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Compute positive difference.
- 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 <sysdep.h>
-
- .text
-ENTRY(__fdimf)
- flds 4(%esp) // x
- flds 8(%esp) // x : y
-
- fucom %st(1)
- fnstsw
- sahf
- jp 1f
-
- jc 3f
-
- fstp %st(1)
- fldz
- jmp 2f
-
-3: fsubrp %st, %st(1)
- ret
-
-1: fxam
- fnstsw
- andb $0x45, %ah
- cmpb $0x01, %ah
- je 2f
-
- fxch
-2: fstp %st(1)
- ret
-END(__fdimf)
-weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/i386/fpu/s_fdiml.S b/sysdeps/i386/fpu/s_fdiml.S
deleted file mode 100644
index df6e9c047a..0000000000
--- a/sysdeps/i386/fpu/s_fdiml.S
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Compute positive difference.
- 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 <sysdep.h>
-
- .text
-ENTRY(__fdiml)
- fldt 4(%esp) // x
- fldt 16(%esp) // x : y
-
- fucom %st(1)
- fnstsw
- sahf
- jp 1f
-
- jc 3f
-
- fstp %st(1)
- fldz
- jmp 2f
-
-3: fsubrp %st, %st(1)
- ret
-
-1: fxam
- fnstsw
- andb $0x45, %ah
- cmpb $0x01, %ah
- je 2f
-
- fxch
-2: fstp %st(1)
- ret
-END(__fdiml)
-weak_alias (__fdiml, fdiml)
diff --git a/sysdeps/i386/fpu/s_floor.S b/sysdeps/i386/fpu/s_floor.S
index 2d6287dc79..f3cd66e77f 100644
--- a/sysdeps/i386/fpu/s_floor.S
+++ b/sysdeps/i386/fpu/s_floor.S
@@ -4,15 +4,16 @@
*/
#include <machine/asm.h>
+#include <libm-alias-double.h>
RCSID("$NetBSD: s_floor.S,v 1.4 1995/05/09 00:01:59 jtc Exp $")
ENTRY(__floor)
fldl 4(%esp)
- subl $8,%esp
- cfi_adjust_cfa_offset (8)
+ subl $32,%esp
+ cfi_adjust_cfa_offset (32)
- fstcw 4(%esp) /* store fpu control word */
+ fnstenv 4(%esp) /* store fpu environment */
/* We use here %edx although only the low 1 bits are defined.
But none of the operations should care and they are faster
@@ -25,10 +26,10 @@ ENTRY(__floor)
frndint /* round */
- fldcw 4(%esp) /* restore original control word */
+ fldenv 4(%esp) /* restore original environment */
- addl $8,%esp
- cfi_adjust_cfa_offset (-8)
+ addl $32,%esp
+ cfi_adjust_cfa_offset (-32)
ret
END (__floor)
-weak_alias (__floor, floor)
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/i386/fpu/s_floorf.S b/sysdeps/i386/fpu/s_floorf.S
index e969fbe587..656eeb698f 100644
--- a/sysdeps/i386/fpu/s_floorf.S
+++ b/sysdeps/i386/fpu/s_floorf.S
@@ -4,15 +4,16 @@
*/
#include <machine/asm.h>
+#include <libm-alias-float.h>
RCSID("$NetBSD: s_floorf.S,v 1.3 1995/05/09 00:04:32 jtc Exp $")
ENTRY(__floorf)
flds 4(%esp)
- subl $8,%esp
- cfi_adjust_cfa_offset (8)
+ subl $32,%esp
+ cfi_adjust_cfa_offset (32)
- fstcw 4(%esp) /* store fpu control word */
+ fnstenv 4(%esp) /* store fpu environment */
/* We use here %edx although only the low 1 bits are defined.
But none of the operations should care and they are faster
@@ -25,10 +26,10 @@ ENTRY(__floorf)
frndint /* round */
- fldcw 4(%esp) /* restore original control word */
+ fldenv 4(%esp) /* restore original environment */
- addl $8,%esp
- cfi_adjust_cfa_offset (-8)
+ addl $32,%esp
+ cfi_adjust_cfa_offset (-32)
ret
END (__floorf)
-weak_alias (__floorf, floorf)
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/i386/fpu/s_floorl.S b/sysdeps/i386/fpu/s_floorl.S
index 1206554c4a..f85b542f9b 100644
--- a/sysdeps/i386/fpu/s_floorl.S
+++ b/sysdeps/i386/fpu/s_floorl.S
@@ -4,16 +4,17 @@
* Public domain.
*/
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
RCSID("$NetBSD: $")
ENTRY(__floorl)
fldt 4(%esp)
- subl $8,%esp
- cfi_adjust_cfa_offset (8)
+ subl $32,%esp
+ cfi_adjust_cfa_offset (32)
- fstcw 4(%esp) /* store fpu control word */
+ fnstenv 4(%esp) /* store fpu environment */
/* We use here %edx although only the low 1 bits are defined.
But none of the operations should care and they are faster
@@ -26,10 +27,15 @@ ENTRY(__floorl)
frndint /* round */
- fldcw 4(%esp) /* restore original control word */
+ /* Preserve "invalid" exceptions from sNaN input. */
+ fnstsw
+ andl $0x1, %eax
+ orl %eax, 8(%esp)
- addl $8,%esp
- cfi_adjust_cfa_offset (-8)
+ fldenv 4(%esp) /* restore original environment */
+
+ addl $32,%esp
+ cfi_adjust_cfa_offset (-32)
ret
END (__floorl)
-weak_alias (__floorl, floorl)
+libm_alias_ldouble (__floor, floor)
diff --git a/sysdeps/i386/fpu/s_fmax.S b/sysdeps/i386/fpu/s_fmax.S
index a6a236f1e1..91387da5d8 100644
--- a/sysdeps/i386/fpu/s_fmax.S
+++ b/sysdeps/i386/fpu/s_fmax.S
@@ -1,5 +1,5 @@
/* Compute maximum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__fmax)
@@ -40,4 +41,4 @@ ENTRY(__fmax)
ret
END(__fmax)
-weak_alias (__fmax, fmax)
+libm_alias_double (__fmax, fmax)
diff --git a/sysdeps/i386/fpu/s_fmaxf.S b/sysdeps/i386/fpu/s_fmaxf.S
index 2cbdbccb87..dbedc96d7f 100644
--- a/sysdeps/i386/fpu/s_fmaxf.S
+++ b/sysdeps/i386/fpu/s_fmaxf.S
@@ -1,5 +1,5 @@
/* Compute maximum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__fmaxf)
@@ -40,4 +41,4 @@ ENTRY(__fmaxf)
ret
END(__fmaxf)
-weak_alias (__fmaxf, fmaxf)
+libm_alias_float (__fmax, fmax)
diff --git a/sysdeps/i386/fpu/s_fmaxl.S b/sysdeps/i386/fpu/s_fmaxl.S
index a38a1946bc..4c6b64fb1d 100644
--- a/sysdeps/i386/fpu/s_fmaxl.S
+++ b/sysdeps/i386/fpu/s_fmaxl.S
@@ -1,5 +1,5 @@
/* Compute maximum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -17,6 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-ldouble.h>
#include <sysdep.h>
.text
@@ -28,7 +29,13 @@ ENTRY(__fmaxl)
andb $0x45, %ah
cmpb $0x01, %ah
- je 1f // y == NaN
+ je 2f // y == NaN
+
+ fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 3f // x == NaN
fucom %st(1)
fnstsw
@@ -39,5 +46,27 @@ ENTRY(__fmaxl)
1: fstp %st(1)
ret
+
+2: // st(1) is a NaN; st(0) may or may not be.
+ fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 4f
+ // st(1) is a NaN; st(0) is not. Test if st(1) is signaling.
+ testb $0x40, 23(%esp)
+ jz 4f
+ fstp %st(1)
+ ret
+
+3: // st(0) is a NaN; st(1) is not. Test if st(0) is signaling.
+ testb $0x40, 11(%esp)
+ jz 4f
+ fstp %st(0)
+ ret
+
+4: // Both arguments are NaNs, or one is a signaling NaN.
+ faddp
+ ret
END(__fmaxl)
-weak_alias (__fmaxl, fmaxl)
+libm_alias_ldouble (__fmax, fmax)
diff --git a/sysdeps/i386/fpu/s_fmin.S b/sysdeps/i386/fpu/s_fmin.S
index 022d9cf9f6..7c07c07ae6 100644
--- a/sysdeps/i386/fpu/s_fmin.S
+++ b/sysdeps/i386/fpu/s_fmin.S
@@ -1,5 +1,5 @@
/* Compute minimum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__fmin)
@@ -40,4 +41,4 @@ ENTRY(__fmin)
ret
END(__fmin)
-weak_alias (__fmin, fmin)
+libm_alias_double (__fmin, fmin)
diff --git a/sysdeps/i386/fpu/s_fminf.S b/sysdeps/i386/fpu/s_fminf.S
index 5ba4ddb138..b3b5cb63d6 100644
--- a/sysdeps/i386/fpu/s_fminf.S
+++ b/sysdeps/i386/fpu/s_fminf.S
@@ -1,5 +1,5 @@
/* Compute minimum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__fminf)
@@ -40,4 +41,4 @@ ENTRY(__fminf)
ret
END(__fminf)
-weak_alias (__fminf, fminf)
+libm_alias_float (__fmin, fmin)
diff --git a/sysdeps/i386/fpu/s_fminl.S b/sysdeps/i386/fpu/s_fminl.S
index fb5169b8f2..b1f87005a2 100644
--- a/sysdeps/i386/fpu/s_fminl.S
+++ b/sysdeps/i386/fpu/s_fminl.S
@@ -1,5 +1,5 @@
/* Compute minimum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -17,27 +17,56 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-ldouble.h>
#include <sysdep.h>
.text
ENTRY(__fminl)
- fldt 4(%esp) // x
- fldt 16(%esp) // x : y
+ fldt 16(%esp) // y
+ fxam
+ fnstsw
+ fldt 4(%esp) // y : x
+
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 2f // y == NaN
fxam
fnstsw
andb $0x45, %ah
cmpb $0x01, %ah
- je 1f // y == NaN
+ je 3f // x == NaN
fucom %st(1)
fnstsw
sahf
- jc 2f
+ jc 1f
+
+ fxch %st(1)
+1: fstp %st(1)
+
+ ret
-1: fxch %st(1)
-2: fstp %st(1)
+2: // st(1) is a NaN; st(0) may or may not be.
+ fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 4f
+ // st(1) is a NaN; st(0) is not. Test if st(1) is signaling.
+ testb $0x40, 23(%esp)
+ jz 4f
+ fstp %st(1)
+ ret
+
+3: // st(0) is a NaN; st(1) is not. Test if st(0) is signaling.
+ testb $0x40, 11(%esp)
+ jz 4f
+ fstp %st(0)
+ ret
+4: // Both arguments are NaNs, or one is a signaling NaN.
+ faddp
ret
END(__fminl)
-weak_alias (__fminl, fminl)
+libm_alias_ldouble (__fmin, fmin)
diff --git a/sysdeps/i386/fpu/s_fpclassifyl.c b/sysdeps/i386/fpu/s_fpclassifyl.c
index 4971f16fff..44110bbfca 100644
--- a/sysdeps/i386/fpu/s_fpclassifyl.c
+++ b/sysdeps/i386/fpu/s_fpclassifyl.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -25,7 +25,7 @@
int
__fpclassifyl (long double x)
{
- u_int32_t ex, hx, lx;
+ uint32_t ex, hx, lx;
int retval = FP_NORMAL;
GET_LDOUBLE_WORDS (ex, hx, lx, x);
diff --git a/sysdeps/i386/fpu/s_frexp.S b/sysdeps/i386/fpu/s_frexp.S
index 23f15dddb3..d5d9d5386c 100644
--- a/sysdeps/i386/fpu/s_frexp.S
+++ b/sysdeps/i386/fpu/s_frexp.S
@@ -1,5 +1,5 @@
/* ix87 specific frexp implementation for double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
+#include <libm-alias-double.h>
.section .rodata
@@ -80,4 +81,4 @@ ENTRY (__frexp)
ret
END (__frexp)
-weak_alias (__frexp, frexp)
+libm_alias_double (__frexp, frexp)
diff --git a/sysdeps/i386/fpu/s_frexpf.S b/sysdeps/i386/fpu/s_frexpf.S
index 5e3288bede..e45185cdd4 100644
--- a/sysdeps/i386/fpu/s_frexpf.S
+++ b/sysdeps/i386/fpu/s_frexpf.S
@@ -1,5 +1,5 @@
/* ix87 specific frexp implementation for float.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
+#include <libm-alias-float.h>
.section .rodata
@@ -77,4 +78,4 @@ ENTRY (__frexpf)
ret
END (__frexpf)
-weak_alias (__frexpf, frexpf)
+libm_alias_float (__frexp, frexp)
diff --git a/sysdeps/i386/fpu/s_frexpl.S b/sysdeps/i386/fpu/s_frexpl.S
index f687ab3c2e..52e3e4627c 100644
--- a/sysdeps/i386/fpu/s_frexpl.S
+++ b/sysdeps/i386/fpu/s_frexpl.S
@@ -1,5 +1,5 @@
/* ix87 specific frexp implementation for long double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -17,6 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
.section .rodata
@@ -50,7 +51,7 @@ ENTRY (__frexpl)
jz 1f
xorl %ecx, %ecx
cmpl $0x7fff, %eax
- je 1f
+ je 3f
cmpl $0, %eax
jne 2f
@@ -81,5 +82,12 @@ ENTRY (__frexpl)
movl %ecx, (%eax)
ret
+
+ /* Infinity or NaN; ensure signaling NaNs are quieted. */
+3: movl EXPP(%esp), %eax
+ fldt VAL0(%esp)
+ fadd %st
+ movl %ecx, (%eax)
+ ret
END (__frexpl)
-weak_alias (__frexpl, frexpl)
+libm_alias_ldouble (__frexp, frexp)
diff --git a/sysdeps/i386/fpu/s_isnanl.c b/sysdeps/i386/fpu/s_isnanl.c
index 816396d8fb..fb97317bc9 100644
--- a/sysdeps/i386/fpu/s_isnanl.c
+++ b/sysdeps/i386/fpu/s_isnanl.c
@@ -35,9 +35,9 @@ int __isnanl(long double x)
extended format has the normally implicit 1 explicit
present. Sigh! */
lx |= hx & 0x7fffffff;
- se |= (u_int32_t)(lx|(-lx))>>31;
+ se |= (uint32_t)(lx|(-lx))>>31;
se = 0xfffe - se;
- return (int)((u_int32_t)(se))>>16;
+ return (int)((uint32_t)(se))>>16;
}
hidden_def (__isnanl)
weak_alias (__isnanl, isnanl)
diff --git a/sysdeps/i386/fpu/s_llrint.S b/sysdeps/i386/fpu/s_llrint.S
index 0c2b99ec0b..888d2a6231 100644
--- a/sysdeps/i386/fpu/s_llrint.S
+++ b/sysdeps/i386/fpu/s_llrint.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__llrint)
@@ -33,4 +34,4 @@ ENTRY(__llrint)
cfi_adjust_cfa_offset (-4)
ret
END(__llrint)
-weak_alias (__llrint, llrint)
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/i386/fpu/s_llrintf.S b/sysdeps/i386/fpu/s_llrintf.S
index 72d1e69528..42a4ef1fb1 100644
--- a/sysdeps/i386/fpu/s_llrintf.S
+++ b/sysdeps/i386/fpu/s_llrintf.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__llrintf)
@@ -33,4 +34,4 @@ ENTRY(__llrintf)
cfi_adjust_cfa_offset (-4)
ret
END(__llrintf)
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/i386/fpu/s_llrintl.S b/sysdeps/i386/fpu/s_llrintl.S
index a256ca252b..6728e713b8 100644
--- a/sysdeps/i386/fpu/s_llrintl.S
+++ b/sysdeps/i386/fpu/s_llrintl.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-ldouble.h>
#include <sysdep.h>
.text
@@ -33,4 +34,4 @@ ENTRY(__llrintl)
cfi_adjust_cfa_offset (-4)
ret
END(__llrintl)
-weak_alias (__llrintl, llrintl)
+libm_alias_ldouble (__llrint, llrint)
diff --git a/sysdeps/i386/fpu/s_log1pl.S b/sysdeps/i386/fpu/s_log1pl.S
index 98965fa48c..0fd05cbdb3 100644
--- a/sysdeps/i386/fpu/s_log1pl.S
+++ b/sysdeps/i386/fpu/s_log1pl.S
@@ -70,6 +70,7 @@ ENTRY(__log1pl)
3: jp 4b // in case x is ±Inf
fstp %st(1)
fstp %st(1)
+ fadd %st(0)
ret
END (__log1pl)
diff --git a/sysdeps/i386/fpu/s_logb.S b/sysdeps/i386/fpu/s_logb.S
index f78c091c8a..d4b3a4714f 100644
--- a/sysdeps/i386/fpu/s_logb.S
+++ b/sysdeps/i386/fpu/s_logb.S
@@ -4,6 +4,7 @@
*/
#include <machine/asm.h>
+#include <libm-alias-double.h>
RCSID("$NetBSD: s_logb.S,v 1.4 1995/05/09 00:14:30 jtc Exp $")
@@ -13,4 +14,4 @@ ENTRY(__logb)
fstp %st
ret
END (__logb)
-weak_alias (__logb, logb)
+libm_alias_double (__logb, logb)
diff --git a/sysdeps/i386/fpu/s_logbf.S b/sysdeps/i386/fpu/s_logbf.S
index 91eb3d2925..175daf52a1 100644
--- a/sysdeps/i386/fpu/s_logbf.S
+++ b/sysdeps/i386/fpu/s_logbf.S
@@ -4,6 +4,7 @@
*/
#include <machine/asm.h>
+#include <libm-alias-float.h>
RCSID("$NetBSD: s_logbf.S,v 1.3 1995/05/09 00:15:12 jtc Exp $")
@@ -13,4 +14,4 @@ ENTRY(__logbf)
fstp %st
ret
END (__logbf)
-weak_alias (__logbf, logbf)
+libm_alias_float (__logb, logb)
diff --git a/sysdeps/i386/fpu/s_logbl.c b/sysdeps/i386/fpu/s_logbl.c
index 391e2db489..601d873594 100644
--- a/sysdeps/i386/fpu/s_logbl.c
+++ b/sysdeps/i386/fpu/s_logbl.c
@@ -4,6 +4,7 @@
* Public domain.
*/
+#include <libm-alias-ldouble.h>
#include <math_private.h>
long double
@@ -16,4 +17,4 @@ __logbl (long double x)
return res;
}
-weak_alias (__logbl, logbl)
+libm_alias_ldouble (__logb, logb)
diff --git a/sysdeps/i386/fpu/s_lrint.S b/sysdeps/i386/fpu/s_lrint.S
index 263248c7c2..8373b25bcd 100644
--- a/sysdeps/i386/fpu/s_lrint.S
+++ b/sysdeps/i386/fpu/s_lrint.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__lrint)
@@ -31,4 +32,4 @@ ENTRY(__lrint)
cfi_adjust_cfa_offset (-4)
ret
END(__lrint)
-weak_alias (__lrint, lrint)
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/i386/fpu/s_lrintf.S b/sysdeps/i386/fpu/s_lrintf.S
index 1bd84fe10b..d2f0aa78e6 100644
--- a/sysdeps/i386/fpu/s_lrintf.S
+++ b/sysdeps/i386/fpu/s_lrintf.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__lrintf)
@@ -31,4 +32,4 @@ ENTRY(__lrintf)
cfi_adjust_cfa_offset (-4)
ret
END(__lrintf)
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/i386/fpu/s_lrintl.S b/sysdeps/i386/fpu/s_lrintl.S
index 31acc3e232..28b7219f6e 100644
--- a/sysdeps/i386/fpu/s_lrintl.S
+++ b/sysdeps/i386/fpu/s_lrintl.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-ldouble.h>
#include <sysdep.h>
.text
@@ -31,4 +32,4 @@ ENTRY(__lrintl)
cfi_adjust_cfa_offset (-4)
ret
END(__lrintl)
-weak_alias (__lrintl, lrintl)
+libm_alias_ldouble (__lrint, lrint)
diff --git a/sysdeps/i386/fpu/s_nearbyint.S b/sysdeps/i386/fpu/s_nearbyint.S
index 8da8ae9792..11fb61b242 100644
--- a/sysdeps/i386/fpu/s_nearbyint.S
+++ b/sysdeps/i386/fpu/s_nearbyint.S
@@ -5,20 +5,17 @@
/* Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. */
#include <machine/asm.h>
+#include <libm-alias-double.h>
ENTRY(__nearbyint)
fldl 4(%esp)
subl $32, %esp
cfi_adjust_cfa_offset (32)
fnstenv 4(%esp)
- movl 4(%esp), %eax
- orl $0x20, %eax
- movl %eax, (%esp)
- fldcw (%esp)
frndint
fldenv 4(%esp)
addl $32, %esp
cfi_adjust_cfa_offset (-32)
ret
END (__nearbyint)
-weak_alias (__nearbyint, nearbyint)
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/i386/fpu/s_nearbyintf.S b/sysdeps/i386/fpu/s_nearbyintf.S
index 0c51f72364..169d06d80b 100644
--- a/sysdeps/i386/fpu/s_nearbyintf.S
+++ b/sysdeps/i386/fpu/s_nearbyintf.S
@@ -5,20 +5,17 @@
/* Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. */
#include <machine/asm.h>
+#include <libm-alias-float.h>
ENTRY(__nearbyintf)
flds 4(%esp)
subl $32, %esp
cfi_adjust_cfa_offset (32)
fnstenv 4(%esp)
- movl 4(%esp), %eax
- orl $0x20, %eax
- movl %eax, (%esp)
- fldcw (%esp)
frndint
fldenv 4(%esp)
addl $32, %esp
cfi_adjust_cfa_offset (-32)
ret
END (__nearbyintf)
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/i386/fpu/s_nearbyintl.S b/sysdeps/i386/fpu/s_nearbyintl.S
index b260ab5914..852e1f6524 100644
--- a/sysdeps/i386/fpu/s_nearbyintl.S
+++ b/sysdeps/i386/fpu/s_nearbyintl.S
@@ -4,6 +4,7 @@
*/
/* Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. */
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
ENTRY(__nearbyintl)
@@ -11,10 +12,6 @@ ENTRY(__nearbyintl)
subl $32, %esp
cfi_adjust_cfa_offset (32)
fnstenv 4(%esp)
- movl 4(%esp), %eax
- orl $0x20, %eax
- movl %eax, (%esp)
- fldcw (%esp)
frndint
fnstsw
andl $0x1, %eax
@@ -24,4 +21,4 @@ ENTRY(__nearbyintl)
cfi_adjust_cfa_offset (-32)
ret
END (__nearbyintl)
-weak_alias (__nearbyintl, nearbyintl)
+libm_alias_ldouble (__nearbyint, nearbyint)
diff --git a/sysdeps/i386/fpu/s_nextafterl.c b/sysdeps/i386/fpu/s_nextafterl.c
index 188dc2129a..d6e3025bb2 100644
--- a/sysdeps/i386/fpu/s_nextafterl.c
+++ b/sysdeps/i386/fpu/s_nextafterl.c
@@ -28,12 +28,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double __nextafterl(long double x, long double y)
{
- u_int32_t hx,hy,ix,iy;
- u_int32_t lx,ly;
+ uint32_t hx,hy,ix,iy;
+ uint32_t lx,ly;
int32_t esx,esy;
GET_LDOUBLE_WORDS(esx,hx,lx,x);
@@ -86,7 +88,7 @@ long double __nextafterl(long double x, long double y)
if(esy>=0||(esx>esy||((esx==esy)&&(hx>hy||((hx==hy)&&(lx>ly)))))){
/* x < y, x -= ulp */
if(lx==0) {
- if (hx <= 0x80000000) {
+ if (hx <= 0x80000000 && esx != 0xffff8000) {
esx -= 1;
hx = hx - 1;
if ((esx&0x7fff) > 0)
@@ -120,6 +122,6 @@ long double __nextafterl(long double x, long double y)
SET_LDOUBLE_WORDS(x,esx,hx,lx);
return x;
}
-weak_alias (__nextafterl, nextafterl)
+libm_alias_ldouble (__nextafter, nextafter)
strong_alias (__nextafterl, __nexttowardl)
weak_alias (__nextafterl, nexttowardl)
diff --git a/sysdeps/i386/fpu/s_nexttoward.c b/sysdeps/i386/fpu/s_nexttoward.c
index 0b47044760..3594db5a4c 100644
--- a/sysdeps/i386/fpu/s_nexttoward.c
+++ b/sysdeps/i386/fpu/s_nexttoward.c
@@ -28,13 +28,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <float.h>
double __nexttoward(double x, long double y)
{
int32_t hx,ix,iy;
- u_int32_t lx,hy,ly,esy;
+ uint32_t lx,hy,ly,esy;
EXTRACT_WORDS(hx,lx,x);
GET_LDOUBLE_WORDS(esy,hy,ly,y);
diff --git a/sysdeps/i386/fpu/s_nexttowardf.c b/sysdeps/i386/fpu/s_nexttowardf.c
index e1156d1e4f..6e11ace223 100644
--- a/sysdeps/i386/fpu/s_nexttowardf.c
+++ b/sysdeps/i386/fpu/s_nexttowardf.c
@@ -20,13 +20,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <float.h>
float __nexttowardf(float x, long double y)
{
int32_t hx,ix,iy;
- u_int32_t hy,ly,esy;
+ uint32_t hy,ly,esy;
GET_FLOAT_WORD(hx,x);
GET_LDOUBLE_WORDS(esy,hy,ly,y);
diff --git a/sysdeps/i386/fpu/s_remquo.S b/sysdeps/i386/fpu/s_remquo.S
index 341285db30..ac911727a8 100644
--- a/sysdeps/i386/fpu/s_remquo.S
+++ b/sysdeps/i386/fpu/s_remquo.S
@@ -5,6 +5,7 @@
*/
#include <machine/asm.h>
+#include <libm-alias-double.h>
#define PARMS 4 /* no space for saved regs */
#define DVDND PARMS
@@ -42,4 +43,4 @@ ENTRY (__remquo)
ret
END (__remquo)
-weak_alias (__remquo, remquo)
+libm_alias_double (__remquo, remquo)
diff --git a/sysdeps/i386/fpu/s_remquof.S b/sysdeps/i386/fpu/s_remquof.S
index 62063f068f..0b4a74596a 100644
--- a/sysdeps/i386/fpu/s_remquof.S
+++ b/sysdeps/i386/fpu/s_remquof.S
@@ -5,6 +5,7 @@
*/
#include <machine/asm.h>
+#include <libm-alias-float.h>
#define PARMS 4 /* no space for saved regs */
#define DVDND PARMS
@@ -42,4 +43,4 @@ ENTRY (__remquof)
ret
END (__remquof)
-weak_alias (__remquof, remquof)
+libm_alias_float (__remquo, remquo)
diff --git a/sysdeps/i386/fpu/s_remquol.S b/sysdeps/i386/fpu/s_remquol.S
index f3d84fc7c2..f02cc10465 100644
--- a/sysdeps/i386/fpu/s_remquol.S
+++ b/sysdeps/i386/fpu/s_remquol.S
@@ -4,6 +4,7 @@
* Public domain.
*/
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
#define PARMS 4 /* no space for saved regs */
@@ -42,4 +43,4 @@ ENTRY (__remquol)
ret
END (__remquol)
-weak_alias (__remquol, remquol)
+libm_alias_ldouble (__remquo, remquo)
diff --git a/sysdeps/i386/fpu/s_rint.S b/sysdeps/i386/fpu/s_rint.S
index be36c5f0ca..b4ab01940f 100644
--- a/sysdeps/i386/fpu/s_rint.S
+++ b/sysdeps/i386/fpu/s_rint.S
@@ -4,6 +4,7 @@
*/
#include <machine/asm.h>
+#include <libm-alias-double.h>
RCSID("$NetBSD: s_rint.S,v 1.4 1995/05/09 00:16:08 jtc Exp $")
@@ -12,4 +13,4 @@ ENTRY(__rint)
frndint
ret
END (__rint)
-weak_alias (__rint, rint)
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/i386/fpu/s_rintf.S b/sysdeps/i386/fpu/s_rintf.S
index 2b358c1cf1..f6d11047c7 100644
--- a/sysdeps/i386/fpu/s_rintf.S
+++ b/sysdeps/i386/fpu/s_rintf.S
@@ -4,6 +4,7 @@
*/
#include <machine/asm.h>
+#include <libm-alias-float.h>
RCSID("$NetBSD: s_rintf.S,v 1.3 1995/05/09 00:17:22 jtc Exp $")
@@ -12,4 +13,4 @@ ENTRY(__rintf)
frndint
ret
END (__rintf)
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/i386/fpu/s_rintl.c b/sysdeps/i386/fpu/s_rintl.c
index 66af9cb675..5900435af9 100644
--- a/sysdeps/i386/fpu/s_rintl.c
+++ b/sysdeps/i386/fpu/s_rintl.c
@@ -4,6 +4,7 @@
* Public domain.
*/
+#include <libm-alias-ldouble.h>
#include <math_private.h>
long double
@@ -15,4 +16,4 @@ __rintl (long double x)
return res;
}
-weak_alias (__rintl, rintl)
+libm_alias_ldouble (__rint, rint)
diff --git a/sysdeps/i386/fpu/s_trunc.S b/sysdeps/i386/fpu/s_trunc.S
index a15e5e5f16..a87687fe2b 100644
--- a/sysdeps/i386/fpu/s_trunc.S
+++ b/sysdeps/i386/fpu/s_trunc.S
@@ -1,5 +1,5 @@
/* Truncate double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,20 +18,21 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
+#include <libm-alias-double.h>
ENTRY(__trunc)
fldl 4(%esp)
- subl $8, %esp
- cfi_adjust_cfa_offset (8)
- fstcw 4(%esp)
+ subl $32, %esp
+ cfi_adjust_cfa_offset (32)
+ fnstenv 4(%esp)
movl $0xc00, %edx
orl 4(%esp), %edx
movl %edx, (%esp)
fldcw (%esp)
frndint
- fldcw 4(%esp)
- addl $8, %esp
- cfi_adjust_cfa_offset (-8)
+ fldenv 4(%esp)
+ addl $32, %esp
+ cfi_adjust_cfa_offset (-32)
ret
END(__trunc)
-weak_alias (__trunc, trunc)
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/i386/fpu/s_truncf.S b/sysdeps/i386/fpu/s_truncf.S
index cbf257a949..14d2a81835 100644
--- a/sysdeps/i386/fpu/s_truncf.S
+++ b/sysdeps/i386/fpu/s_truncf.S
@@ -1,5 +1,5 @@
/* Truncate float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,20 +18,21 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
+#include <libm-alias-float.h>
ENTRY(__truncf)
flds 4(%esp)
- subl $8, %esp
- cfi_adjust_cfa_offset (8)
- fstcw 4(%esp)
+ subl $32, %esp
+ cfi_adjust_cfa_offset (32)
+ fnstenv 4(%esp)
movl $0xc00, %edx
orl 4(%esp), %edx
movl %edx, (%esp)
fldcw (%esp)
frndint
- fldcw 4(%esp)
- addl $8, %esp
- cfi_adjust_cfa_offset (-8)
+ fldenv 4(%esp)
+ addl $32, %esp
+ cfi_adjust_cfa_offset (-32)
ret
END(__truncf)
-weak_alias (__truncf, truncf)
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/i386/fpu/s_truncl.S b/sysdeps/i386/fpu/s_truncl.S
index f92b474d49..98a14cdb37 100644
--- a/sysdeps/i386/fpu/s_truncl.S
+++ b/sysdeps/i386/fpu/s_truncl.S
@@ -1,5 +1,5 @@
/* Truncate long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -17,21 +17,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
ENTRY(__truncl)
fldt 4(%esp)
- subl $8, %esp
- cfi_adjust_cfa_offset (8)
- fstcw 4(%esp)
+ subl $32, %esp
+ cfi_adjust_cfa_offset (32)
+ fnstenv 4(%esp)
movl $0xc00, %edx
orl 4(%esp), %edx
movl %edx, (%esp)
fldcw (%esp)
frndint
- fldcw 4(%esp)
- addl $8, %esp
- cfi_adjust_cfa_offset (-8)
+ fnstsw
+ andl $0x1, %eax
+ orl %eax, 8(%esp)
+ fldenv 4(%esp)
+ addl $32, %esp
+ cfi_adjust_cfa_offset (-32)
ret
END(__truncl)
-weak_alias (__truncl, truncl)
+libm_alias_ldouble (__trunc, trunc)
diff --git a/sysdeps/i386/fpu/w_sqrt.c b/sysdeps/i386/fpu/w_sqrt.c
index 19b5074179..8bef04e68a 100644
--- a/sysdeps/i386/fpu/w_sqrt.c
+++ b/sysdeps/i386/fpu/w_sqrt.c
@@ -1,8 +1,10 @@
/* The inline __ieee754_sqrt is not correctly rounding; it's OK for
most internal uses in glibc, but not for sqrt itself. */
+#define NO_MATH_REDIRECT
#define __ieee754_sqrt __avoid_ieee754_sqrt
#include <math.h>
#include <math_private.h>
#undef __ieee754_sqrt
extern double __ieee754_sqrt (double);
-#include <math/w_sqrt.c>
+#include <math-type-macros-double.h>
+#include <w_sqrt_template.c>
diff --git a/sysdeps/i386/fpu/w_sqrt_compat.c b/sysdeps/i386/fpu/w_sqrt_compat.c
new file mode 100644
index 0000000000..dd485f4b88
--- /dev/null
+++ b/sysdeps/i386/fpu/w_sqrt_compat.c
@@ -0,0 +1,9 @@
+/* The inline __ieee754_sqrt is not correctly rounding; it's OK for
+ most internal uses in glibc, but not for sqrt itself. */
+#define NO_MATH_REDIRECT
+#define __ieee754_sqrt __avoid_ieee754_sqrt
+#include <math.h>
+#include <math_private.h>
+#undef __ieee754_sqrt
+extern double __ieee754_sqrt (double);
+#include <math/w_sqrt_compat.c>
diff --git a/sysdeps/i386/gccframe.h b/sysdeps/i386/gccframe.h
index 1145aee6f9..6935604092 100644
--- a/sysdeps/i386/gccframe.h
+++ b/sysdeps/i386/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. i386 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/gmp-mparam.h b/sysdeps/i386/gmp-mparam.h
index c72b1f9f11..695ab9fdc4 100644
--- a/sysdeps/i386/gmp-mparam.h
+++ b/sysdeps/i386/gmp-mparam.h
@@ -1,6 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright (C) 1991-2016 Free Software Foundation, Inc.
+Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/i386/htl/bits/pthreadtypes-arch.h b/sysdeps/i386/htl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..75ba63223f
--- /dev/null
+++ b/sysdeps/i386/htl/bits/pthreadtypes-arch.h
@@ -0,0 +1,22 @@
+/* Machine-specific pthread type layouts. Hurd i386 version.
+ Copyright (C) 2002-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/i386/htl/machine-sp.h b/sysdeps/i386/htl/machine-sp.h
new file mode 100644
index 0000000000..8470f2fa97
--- /dev/null
+++ b/sysdeps/i386/htl/machine-sp.h
@@ -0,0 +1,29 @@
+/* Machine-specific function to return the stack pointer. i386 version.
+ Copyright (C) 1994-2018 Free Software 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 _MACHINE_SP_H
+#define _MACHINE_SP_H
+
+/* Return the current stack pointer. */
+
+#define __thread_stack_pointer() ({ \
+ register void *__sp__ asm("esp"); \
+ __sp__; \
+})
+
+#endif /* machine-sp.h */
diff --git a/sysdeps/i386/htl/pt-machdep.h b/sysdeps/i386/htl/pt-machdep.h
new file mode 100644
index 0000000000..e99d3476d6
--- /dev/null
+++ b/sysdeps/i386/htl/pt-machdep.h
@@ -0,0 +1,28 @@
+/* Machine dependent pthreads internal defenitions. i386 version.
+ Copyright (C) 2000-2018 Free Software 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 _PT_MACHDEP_H
+#define _PT_MACHDEP_H 1
+
+struct pthread_mcontext
+{
+ void *pc;
+ void *sp;
+};
+
+#endif /* pt-machdep.h */
diff --git a/sysdeps/i386/htonl.S b/sysdeps/i386/htonl.S
index cab81f5cb3..52ef295f9b 100644
--- a/sysdeps/i386/htonl.S
+++ b/sysdeps/i386/htonl.S
@@ -1,5 +1,5 @@
/* Change byte order in word. For Intel 80x86, x >= 4.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/htons.S b/sysdeps/i386/htons.S
index 0ca108266f..5b572737da 100644
--- a/sysdeps/i386/htons.S
+++ b/sysdeps/i386/htons.S
@@ -1,5 +1,5 @@
/* Change byte order in word. For Intel 80x86, x >= 3.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/i386-mcount.S b/sysdeps/i386/i386-mcount.S
index 94fb95e7ed..3db2fcdf6b 100644
--- a/sysdeps/i386/i386-mcount.S
+++ b/sysdeps/i386/i386-mcount.S
@@ -1,5 +1,5 @@
-/* i386-specific implemetation of profiling support.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* i386-specific implementation of profiling support.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/i386/i586/add_n.S b/sysdeps/i386/i586/add_n.S
index 22e9c41f5c..1d4a7412c6 100644
--- a/sysdeps/i386/i586/add_n.S
+++ b/sysdeps/i386/i586/add_n.S
@@ -1,6 +1,6 @@
/* Pentium __mpn_add_n -- Add two limb vectors of the same length > 0 and store
sum in a third limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/i386/i586/addmul_1.S b/sysdeps/i386/i586/addmul_1.S
index 9ab4d7d94b..2acd5a7791 100644
--- a/sysdeps/i386/i586/addmul_1.S
+++ b/sysdeps/i386/i586/addmul_1.S
@@ -1,6 +1,6 @@
/* Pentium __mpn_addmul_1 -- Multiply a limb vector with a limb and add
the result to a second limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/i386/i586/init-arch.h b/sysdeps/i386/i586/init-arch.h
index 756c0d7895..72fb46c61e 100644
--- a/sysdeps/i386/i586/init-arch.h
+++ b/sysdeps/i386/i586/init-arch.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/i586/lshift.S b/sysdeps/i386/i586/lshift.S
index 66d9233d8a..04ea65a7c4 100644
--- a/sysdeps/i386/i586/lshift.S
+++ b/sysdeps/i386/i586/lshift.S
@@ -1,5 +1,5 @@
/* Pentium optimized __mpn_lshift --
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/i586/memcopy.h b/sysdeps/i386/i586/memcopy.h
index 78f628b89e..65420b0421 100644
--- a/sysdeps/i386/i586/memcopy.h
+++ b/sysdeps/i386/i586/memcopy.h
@@ -1,5 +1,5 @@
/* memcopy.h -- definitions for memory copy functions. Pentium version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
Contributed by Torbjorn Granlund (tege@sics.se).
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i586/memcpy.S b/sysdeps/i386/i586/memcpy.S
index 25cf98da09..7e3dee69d8 100644
--- a/sysdeps/i386/i586/memcpy.S
+++ b/sysdeps/i386/i586/memcpy.S
@@ -1,5 +1,5 @@
/* Highly optimized version for i586.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/i386/i586/memset.S b/sysdeps/i386/i586/memset.S
index 3590ad1183..480fc70a50 100644
--- a/sysdeps/i386/i586/memset.S
+++ b/sysdeps/i386/i586/memset.S
@@ -1,6 +1,6 @@
/* memset/bzero -- set memory area to CH/0
Highly optimized version for ix86, x>=5.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund, <tege@matematik.su.se>
@@ -112,10 +112,3 @@ L(2): shrl $2, %ecx /* convert byte count to longword count */
ret
END (memset)
libc_hidden_builtin_def (memset)
-
-#if defined SHARED && IS_IN (libc) && !defined __memset_chk \
- && !defined USE_AS_BZERO
-strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
- .section .gnu.warning.__memset_zero_constant_len_parameter
- .string "memset used with constant zero length parameter; this could be due to transposed parameters"
-#endif
diff --git a/sysdeps/i386/i586/mul_1.S b/sysdeps/i386/i586/mul_1.S
index b7958b5e7e..d75d767e6b 100644
--- a/sysdeps/i386/i586/mul_1.S
+++ b/sysdeps/i386/i586/mul_1.S
@@ -1,6 +1,6 @@
/* Pentium __mpn_mul_1 -- Multiply a limb vector with a limb and store
the result in a second limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/i386/i586/rshift.S b/sysdeps/i386/i586/rshift.S
index 3bb9b49c80..929dfd67a4 100644
--- a/sysdeps/i386/i586/rshift.S
+++ b/sysdeps/i386/i586/rshift.S
@@ -1,5 +1,5 @@
/* Pentium optimized __mpn_rshift --
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/i386/i586/strchr.S b/sysdeps/i386/i586/strchr.S
index 497e32133d..ac3afb6d95 100644
--- a/sysdeps/i386/i586/strchr.S
+++ b/sysdeps/i386/i586/strchr.S
@@ -1,6 +1,6 @@
/* Find character CH in a NUL terminated string.
Highly optimized version for ix85, x>=5.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
diff --git a/sysdeps/i386/i586/strcpy.S b/sysdeps/i386/i586/strcpy.S
index 93ff5ac74d..19bed86b45 100644
--- a/sysdeps/i386/i586/strcpy.S
+++ b/sysdeps/i386/i586/strcpy.S
@@ -1,5 +1,5 @@
/* strcpy/stpcpy implementation for i586.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -53,41 +53,35 @@ ENTRY (STRCPY)
cfi_rel_offset (ebx, 0)
andl $3, %ecx
-#ifdef PIC
- call 2f
- cfi_adjust_cfa_offset (4)
-2: popl %edx
- cfi_adjust_cfa_offset (-4)
- /* 0xb is the distance between 2: and 1: but we avoid writing
- 1f-2b because the assembler generates worse code. */
- leal 0xb(%edx,%ecx,8), %ecx
-#else
- leal 1f(,%ecx,8), %ecx
-#endif
-
- jmp *%ecx
+ cmpb $2, %cl
+ je L(Src2)
+ ja L(Src3)
+ cmpb $1, %cl
+ je L(Src1)
- .align 8
-1:
+L(Src0):
orb (%esi), %al
jz L(end)
stosb
xorl %eax, %eax
incl %esi
+L(Src1):
orb (%esi), %al
jz L(end)
stosb
xorl %eax, %eax
incl %esi
+L(Src2):
orb (%esi), %al
jz L(end)
stosb
xorl %eax, %eax
incl %esi
-L(1): movl (%esi), %ecx
+L(Src3):
+ movl (%esi), %ecx
leal 4(%esi),%esi
subl %ecx, %eax
@@ -107,7 +101,7 @@ L(1): movl (%esi), %ecx
movl %edx, (%edi)
leal 4(%edi),%edi
- jmp L(1)
+ jmp L(Src3)
L(3): movl %ecx, %edx
diff --git a/sysdeps/i386/i586/strlen.S b/sysdeps/i386/i586/strlen.S
index 707b6888f9..da05d2b494 100644
--- a/sysdeps/i386/i586/strlen.S
+++ b/sysdeps/i386/i586/strlen.S
@@ -1,6 +1,6 @@
/* strlen -- Compute length of NUL terminated string.
Highly optimized version for ix86, x>=5.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
diff --git a/sysdeps/i386/i586/sub_n.S b/sysdeps/i386/i586/sub_n.S
index 671abca018..7c3b8fcac3 100644
--- a/sysdeps/i386/i586/sub_n.S
+++ b/sysdeps/i386/i586/sub_n.S
@@ -1,6 +1,6 @@
/* Pentium __mpn_sub_n -- Subtract two limb vectors of the same length > 0
and store difference in a third limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/i386/i586/submul_1.S b/sysdeps/i386/i586/submul_1.S
index cf9208b3d8..cd213e8234 100644
--- a/sysdeps/i386/i586/submul_1.S
+++ b/sysdeps/i386/i586/submul_1.S
@@ -1,6 +1,6 @@
/* Pentium __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
the result from a second limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
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/add_n.S b/sysdeps/i386/i686/add_n.S
index 9c89cc02cc..0c95919d30 100644
--- a/sysdeps/i386/i686/add_n.S
+++ b/sysdeps/i386/i686/add_n.S
@@ -1,6 +1,6 @@
/* Add two limb vectors of the same length > 0 and store sum in a third
limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
along with the GNU MP Library; see the file COPYING.LIB. If not,
see <http://www.gnu.org/licenses/>. */
-#include "sysdep.h"
+#include <sysdep.h>
#include "asm-syntax.h"
#define PARMS 4+8 /* space for 2 saved regs */
@@ -44,6 +44,13 @@ ENTRY (__mpn_add_n)
cfi_rel_offset (esi, 0)
movl S2(%esp),%edx
movl SIZE(%esp),%ecx
+
+#if IBT_ENABLED
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+#endif
+
movl %ecx,%eax
shrl $3,%ecx /* compute count for unrolled loop */
negl %eax
@@ -55,6 +62,9 @@ ENTRY (__mpn_add_n)
subl %eax,%esi /* ... by a constant when we ... */
subl %eax,%edx /* ... enter the loop */
shrl $2,%eax /* restore previous value */
+#if IBT_ENABLED
+ leal -4(,%eax,4),%ebx /* Count for 4-byte endbr32 */
+#endif
#ifdef PIC
/* Calculate start address in loop for PIC. */
leal (L(oop)-L(0)-3)(%eax,%eax,8),%eax
@@ -64,29 +74,39 @@ L(0):
/* Calculate start address in loop for non-PIC. */
leal (L(oop) - 3)(%eax,%eax,8),%eax
#endif
+#if IBT_ENABLED
+ addl %ebx,%eax /* Adjust for endbr32 */
+#endif
jmp *%eax /* jump into loop */
ALIGN (3)
L(oop): movl (%esi),%eax
adcl (%edx),%eax
movl %eax,(%edi)
+ _CET_ENDBR
movl 4(%esi),%eax
adcl 4(%edx),%eax
movl %eax,4(%edi)
+ _CET_ENDBR
movl 8(%esi),%eax
adcl 8(%edx),%eax
movl %eax,8(%edi)
+ _CET_ENDBR
movl 12(%esi),%eax
adcl 12(%edx),%eax
movl %eax,12(%edi)
+ _CET_ENDBR
movl 16(%esi),%eax
adcl 16(%edx),%eax
movl %eax,16(%edi)
+ _CET_ENDBR
movl 20(%esi),%eax
adcl 20(%edx),%eax
movl %eax,20(%edi)
+ _CET_ENDBR
movl 24(%esi),%eax
adcl 24(%edx),%eax
movl %eax,24(%edi)
+ _CET_ENDBR
movl 28(%esi),%eax
adcl 28(%edx),%eax
movl %eax,28(%edi)
@@ -99,6 +119,11 @@ L(oop): movl (%esi),%eax
sbbl %eax,%eax
negl %eax
+#if IBT_ENABLED
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#endif
popl %esi
cfi_adjust_cfa_offset (-4)
cfi_restore (esi)
diff --git a/sysdeps/i386/i686/dl-hash.h b/sysdeps/i386/i686/dl-hash.h
index 8ba85d2a71..34b625450a 100644
--- a/sysdeps/i386/i686/dl-hash.h
+++ b/sysdeps/i386/i686/dl-hash.h
@@ -1,5 +1,5 @@
/* Compute hash alue for given string according to ELF standard.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -26,6 +26,7 @@
would be much slower than the generic C implementation. So don't
use it. */
static unsigned int
+__attribute__ ((unused))
_dl_elf_hash (const char *name)
{
unsigned int result;
diff --git a/sysdeps/i386/i686/ffs.c b/sysdeps/i386/i686/ffs.c
index b5da4d4266..540c8bde62 100644
--- a/sysdeps/i386/i686/ffs.c
+++ b/sysdeps/i386/i686/ffs.c
@@ -1,7 +1,7 @@
/* ffs -- find first set bit in a word, counted from least significant end.
For Intel 80x86, x>=6.
This file is part of the GNU C Library.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/i686/fpu/e_logf.S b/sysdeps/i386/i686/fpu/e_logf.S
deleted file mode 100644
index 6fd39d50d3..0000000000
--- a/sysdeps/i386/i686/fpu/e_logf.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- * Adapted for float by Ulrich Drepper <drepper@cygnus.com>.
- *
- * Adapted for i686 instructions.
- */
-
-#include <machine/asm.h>
-
-
- .text
-ENTRY(__ieee754_logf)
- fldln2 // log(2)
- flds 4(%esp) // x : log(2)
- fucomi %st
- jp 3f
- fyl2x // log(x)
- ret
-
-3: fstp %st(1)
- ret
-END (__ieee754_logf)
-
-ENTRY(__logf_finite)
- fldln2 // log(2)
- flds 4(%esp) // x : log(2)
- fyl2x // log(x)
- ret
-END(__logf_finite)
diff --git a/sysdeps/i386/i686/fpu/e_logl.S b/sysdeps/i386/i686/fpu/e_logl.S
index e9ecbcd472..7e3bc8d817 100644
--- a/sysdeps/i386/i686/fpu/e_logl.S
+++ b/sysdeps/i386/i686/fpu/e_logl.S
@@ -64,6 +64,7 @@ ENTRY(__ieee754_logl)
ret
3: fstp %st(1)
+ fadd %st(0)
ret
END (__ieee754_logl)
diff --git a/sysdeps/i386/i686/fpu/multiarch/Makefile b/sysdeps/i386/i686/fpu/multiarch/Makefile
index 7d9089232f..c0fa9761d3 100644
--- a/sysdeps/i386/i686/fpu/multiarch/Makefile
+++ b/sysdeps/i386/i686/fpu/multiarch/Makefile
@@ -1,4 +1,10 @@
ifeq ($(subdir),math)
-libm-sysdep_routines += e_expf-sse2 e_expf-ia32 s_sinf-sse2 s_cosf-sse2 \
- s_sincosf-sse2
+libm-sysdep_routines += e_exp2f-sse2 e_expf-sse2 e_logf-sse2 e_log2f-sse2 \
+ e_powf-sse2 s_sinf-sse2 s_cosf-sse2 s_sincosf-sse2
+
+CFLAGS-e_exp2f-sse2.c = -msse2 -mfpmath=sse
+CFLAGS-e_expf-sse2.c = -msse2 -mfpmath=sse
+CFLAGS-e_log2f-sse2.c = -msse2 -mfpmath=sse
+CFLAGS-e_logf-sse2.c = -msse2 -mfpmath=sse
+CFLAGS-e_powf-sse2.c = -msse2 -mfpmath=sse
endif
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c b/sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c
new file mode 100644
index 0000000000..dc3138dc24
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c
@@ -0,0 +1,3 @@
+#define __exp2f __exp2f_sse2
+
+#include <sysdeps/ieee754/flt-32/e_exp2f.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_exp2f.c b/sysdeps/i386/i686/fpu/multiarch/e_exp2f.c
new file mode 100644
index 0000000000..d656414990
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_exp2f.c
@@ -0,0 +1,39 @@
+/* Multiple versions of exp2f.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+extern float __redirect_exp2f (float);
+
+#define SYMBOL_NAME exp2f
+#include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_exp2f, __exp2f, IFUNC_SELECTOR ());
+
+#include <libm-alias-float.h>
+#ifdef SHARED
+# include <shlib-compat.h>
+versioned_symbol (libm, __exp2f, exp2f, GLIBC_2_27);
+libm_alias_float_other (__exp2, exp2)
+#else
+libm_alias_float (__exp2, exp2)
+#endif
+
+strong_alias (__exp2f, __ieee754_exp2f)
+strong_alias (__exp2f, __exp2f_finite)
+
+#define __exp2f __exp2f_ia32
+#include <sysdeps/ieee754/flt-32/e_exp2f.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S b/sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S
deleted file mode 100644
index 2f679f5d72..0000000000
--- a/sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- 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/>. */
-
-#define __ieee754_expf __ieee754_expf_ia32
-#define __expf_finite __expf_finite_ia32
-
-#include <sysdeps/i386/fpu/e_expf.S>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S b/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S
deleted file mode 100644
index caedc1fdb0..0000000000
--- a/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S
+++ /dev/null
@@ -1,325 +0,0 @@
-/* SSE2 version of __ieee754_expf and __expf_finite
- 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/>. */
-
-
-#include <sysdep.h>
-
-/* Short algorithm description:
- *
- * Let K = 64 (table size).
- * e^x = 2^(x/log(2)) = 2^n * T[j] * (1 + P(y))
- * where
- * x = m*log(2)/K + y, y in [0.0..log(2)/K]
- * m = n*K + j, m,n,j - signed integer, j in [0..K-1]
- * values of 2^(j/K) are tabulated as T[j].
- *
- * P(y) is a minimax polynomial approximation of expf(x)-1
- * on small interval [0.0..log(2)/K].
- *
- * P(y) = P3*y*y*y*y + P2*y*y*y + P1*y*y + P0*y, calculated as
- * z = y*y; P(y) = (P3*z + P1)*z + (P2*z + P0)*y
- *
- * Special cases:
- * __ieee754_expf_sse2(NaN) = NaN
- * __ieee754_expf_sse2(+INF) = +INF
- * __ieee754_expf_sse2(-INF) = 0
- * __ieee754_expf_sse2(x) = 1 for subnormals
- * for finite argument, only __ieee754_expf_sse2(0)=1 is exact
- * __ieee754_expf_sse2(x) overflows if x>700
- * __ieee754_expf_sse2(x) underflows if x<-700
- *
- * Note:
- * For |x|<700, __ieee754_expf_sse2 computes result in double precision,
- * with accuracy a bit more than needed for expf, and does not round it
- * to single precision.
- */
-
-
-#ifdef PIC
-# define MO1(symbol) L(symbol)##@GOTOFF(%edx)
-# define MO2(symbol,reg2,_scale) L(symbol)##@GOTOFF(%edx,reg2,_scale)
-#else
-# define MO1(symbol) L(symbol)
-# define MO2(symbol,reg2,_scale) L(symbol)(,reg2,_scale)
-#endif
-
- .text
-ENTRY(__ieee754_expf_sse2)
- /* Input: single precision x on stack at address 4(%esp) */
-
-#ifdef PIC
- LOAD_PIC_REG(dx)
-#endif
-
- cvtss2sd 4(%esp), %xmm1 /* Convert x to double precision */
- mov 4(%esp), %ecx /* Copy x */
- movsd MO1(DP_KLN2), %xmm2 /* DP K/log(2) */
- movsd MO1(DP_P2), %xmm3 /* DP P2 */
- movl %ecx, %eax /* x */
- mulsd %xmm1, %xmm2 /* DP x*K/log(2) */
- andl $0x7fffffff, %ecx /* |x| */
- cmpl $0x442f0000, %ecx /* |x|<700 ? */
- movsd MO1(DP_P3), %xmm4 /* DP P3 */
- addsd MO1(DP_RS), %xmm2 /* DP x*K/log(2)+RS */
- jae L(special_paths)
-
- /* Here if |x|<700 */
- cmpl $0x31800000, %ecx /* |x|<2^(-28) ? */
- jb L(small_arg)
-
- /* Main path: here if 2^(-28)<=|x|<700 */
- cvtsd2ss %xmm2, %xmm2 /* SP x*K/log(2)+RS */
- movd %xmm2, %eax /* bits of n*K+j with trash */
- subss MO1(SP_RS), %xmm2 /* SP t=round(x*K/log(2)) */
- movl %eax, %ecx /* n*K+j with trash */
- cvtss2sd %xmm2, %xmm2 /* DP t */
- andl $0x3f, %eax /* bits of j */
- mulsd MO1(DP_NLN2K), %xmm2 /* DP -t*log(2)/K */
- andl $0xffffffc0, %ecx /* bits of n */
-#ifdef __AVX__
- vaddsd %xmm1, %xmm2, %xmm0 /* DP y=x-t*log(2)/K */
- vmulsd %xmm0, %xmm0, %xmm2 /* DP z=y*y */
-#else
- addsd %xmm1, %xmm2 /* DP y=x-t*log(2)/K */
- movaps %xmm2, %xmm0 /* DP y */
- mulsd %xmm2, %xmm2 /* DP z=y*y */
-#endif
- mulsd %xmm2, %xmm4 /* DP P3*z */
- addl $0xffc0, %ecx /* bits of n + DP exponent bias */
- mulsd %xmm2, %xmm3 /* DP P2*z */
- shrl $2, %ecx /* High 2 bytes of DP 2^n */
- pxor %xmm1, %xmm1 /* clear %xmm1 */
- addsd MO1(DP_P1), %xmm4 /* DP P3*z+P1 */
- addsd MO1(DP_P0), %xmm3 /* DP P2*z+P0 */
- pinsrw $3, %ecx, %xmm1 /* DP 2^n */
- mulsd %xmm2, %xmm4 /* DP (P3*z+P1)*z */
- mulsd %xmm3, %xmm0 /* DP (P2*z+P0)*y */
- addsd %xmm4, %xmm0 /* DP P(y) */
- mulsd MO2(DP_T,%eax,8), %xmm0 /* DP P(y)*T[j] */
- addsd MO2(DP_T,%eax,8), %xmm0 /* DP T[j]*(P(y)+1) */
- mulsd %xmm1, %xmm0 /* DP result=2^n*(T[j]*(P(y)+1)) */
- cvtsd2ss %xmm0, %xmm1
-
- lea -4(%esp), %esp /* Borrow 4 bytes of stack frame */
- movss %xmm1, 0(%esp) /* Move result from sse... */
- flds 0(%esp) /* ...to FPU. */
- lea 4(%esp), %esp /* Return back 4 bytes of stack frame */
- ret
-
- .p2align 4
-L(small_arg):
- /* Here if 0<=|x|<2^(-28) */
- movss 4(%esp), %xmm0 /* load x */
- addss MO1(SP_ONE), %xmm0 /* 1.0 + x */
- /* Return 1.0 with inexact raised, except for x==0 */
- jmp L(epilogue)
-
- .p2align 4
-L(special_paths):
- /* Here if x is NaN, or Inf, or finite |x|>=700 */
- movss 4(%esp), %xmm0 /* load x */
-
- cmpl $0x7f800000, %ecx /* |x| is finite ? */
- jae L(arg_inf_or_nan)
-
- /* Here if finite |x|>=700 */
- testl $0x80000000, %eax /* sign of x nonzero ? */
- je L(res_overflow)
-
- /* Here if finite x<=-700 */
- movss MO1(SP_SMALL), %xmm0 /* load small value 2^(-100) */
- mulss %xmm0, %xmm0 /* Return underflowed result (zero or subnormal) */
- jmp L(epilogue)
-
- .p2align 4
-L(res_overflow):
- /* Here if finite x>=700 */
- movss MO1(SP_LARGE), %xmm0 /* load large value 2^100 */
- mulss %xmm0, %xmm0 /* Return overflowed result (Inf or max normal) */
- jmp L(epilogue)
-
- .p2align 4
-L(arg_inf_or_nan):
- /* Here if |x| is Inf or NAN */
- jne L(arg_nan) /* |x| is Inf ? */
-
- /* Here if |x| is Inf */
- shrl $31, %eax /* Get sign bit of x */
- movss MO2(SP_INF_0,%eax,4), %xmm0/* return zero or Inf, depending on sign of x */
- jmp L(epilogue)
-
- .p2align 4
-L(arg_nan):
- /* Here if |x| is NaN */
- addss %xmm0, %xmm0 /* Return x+x (raise invalid) */
-
- .p2align 4
-L(epilogue):
- lea -4(%esp), %esp /* Borrow 4 bytes of stack frame */
- movss %xmm0, 0(%esp) /* Move result from sse... */
- flds 0(%esp) /* ...to FPU. */
- lea 4(%esp), %esp /* Return back 4 bytes of stack frame */
- ret
-END(__ieee754_expf_sse2)
-
- .section .rodata, "a"
- .p2align 3
-L(DP_T): /* table of double precision values 2^(j/K) for j=[0..K-1] */
- .long 0x00000000, 0x3ff00000
- .long 0x3e778061, 0x3ff02c9a
- .long 0xd3158574, 0x3ff059b0
- .long 0x18759bc8, 0x3ff08745
- .long 0x6cf9890f, 0x3ff0b558
- .long 0x32d3d1a2, 0x3ff0e3ec
- .long 0xd0125b51, 0x3ff11301
- .long 0xaea92de0, 0x3ff1429a
- .long 0x3c7d517b, 0x3ff172b8
- .long 0xeb6fcb75, 0x3ff1a35b
- .long 0x3168b9aa, 0x3ff1d487
- .long 0x88628cd6, 0x3ff2063b
- .long 0x6e756238, 0x3ff2387a
- .long 0x65e27cdd, 0x3ff26b45
- .long 0xf51fdee1, 0x3ff29e9d
- .long 0xa6e4030b, 0x3ff2d285
- .long 0x0a31b715, 0x3ff306fe
- .long 0xb26416ff, 0x3ff33c08
- .long 0x373aa9cb, 0x3ff371a7
- .long 0x34e59ff7, 0x3ff3a7db
- .long 0x4c123422, 0x3ff3dea6
- .long 0x21f72e2a, 0x3ff4160a
- .long 0x6061892d, 0x3ff44e08
- .long 0xb5c13cd0, 0x3ff486a2
- .long 0xd5362a27, 0x3ff4bfda
- .long 0x769d2ca7, 0x3ff4f9b2
- .long 0x569d4f82, 0x3ff5342b
- .long 0x36b527da, 0x3ff56f47
- .long 0xdd485429, 0x3ff5ab07
- .long 0x15ad2148, 0x3ff5e76f
- .long 0xb03a5585, 0x3ff6247e
- .long 0x82552225, 0x3ff66238
- .long 0x667f3bcd, 0x3ff6a09e
- .long 0x3c651a2f, 0x3ff6dfb2
- .long 0xe8ec5f74, 0x3ff71f75
- .long 0x564267c9, 0x3ff75feb
- .long 0x73eb0187, 0x3ff7a114
- .long 0x36cf4e62, 0x3ff7e2f3
- .long 0x994cce13, 0x3ff82589
- .long 0x9b4492ed, 0x3ff868d9
- .long 0x422aa0db, 0x3ff8ace5
- .long 0x99157736, 0x3ff8f1ae
- .long 0xb0cdc5e5, 0x3ff93737
- .long 0x9fde4e50, 0x3ff97d82
- .long 0x82a3f090, 0x3ff9c491
- .long 0x7b5de565, 0x3ffa0c66
- .long 0xb23e255d, 0x3ffa5503
- .long 0x5579fdbf, 0x3ffa9e6b
- .long 0x995ad3ad, 0x3ffae89f
- .long 0xb84f15fb, 0x3ffb33a2
- .long 0xf2fb5e47, 0x3ffb7f76
- .long 0x904bc1d2, 0x3ffbcc1e
- .long 0xdd85529c, 0x3ffc199b
- .long 0x2e57d14b, 0x3ffc67f1
- .long 0xdcef9069, 0x3ffcb720
- .long 0x4a07897c, 0x3ffd072d
- .long 0xdcfba487, 0x3ffd5818
- .long 0x03db3285, 0x3ffda9e6
- .long 0x337b9b5f, 0x3ffdfc97
- .long 0xe78b3ff6, 0x3ffe502e
- .long 0xa2a490da, 0x3ffea4af
- .long 0xee615a27, 0x3ffefa1b
- .long 0x5b6e4540, 0x3fff5076
- .long 0x819e90d8, 0x3fffa7c1
- .type L(DP_T), @object
- ASM_SIZE_DIRECTIVE(L(DP_T))
-
- .section .rodata.cst8,"aM",@progbits,8
- .p2align 3
-L(DP_KLN2): /* double precision K/log(2) */
- .long 0x652b82fe, 0x40571547
- .type L(DP_KLN2), @object
- ASM_SIZE_DIRECTIVE(L(DP_KLN2))
-
- .p2align 3
-L(DP_NLN2K): /* double precision -log(2)/K */
- .long 0xfefa39ef, 0xbf862e42
- .type L(DP_NLN2K), @object
- ASM_SIZE_DIRECTIVE(L(DP_NLN2K))
-
- .p2align 3
-L(DP_RS): /* double precision 2^23+2^22 */
- .long 0x00000000, 0x41680000
- .type L(DP_RS), @object
- ASM_SIZE_DIRECTIVE(L(DP_RS))
-
- .p2align 3
-L(DP_P3): /* double precision polynomial coefficient P3 */
- .long 0xeb78fa85, 0x3fa56420
- .type L(DP_P3), @object
- ASM_SIZE_DIRECTIVE(L(DP_P3))
-
- .p2align 3
-L(DP_P1): /* double precision polynomial coefficient P1 */
- .long 0x008d6118, 0x3fe00000
- .type L(DP_P1), @object
- ASM_SIZE_DIRECTIVE(L(DP_P1))
-
- .p2align 3
-L(DP_P2): /* double precision polynomial coefficient P2 */
- .long 0xda752d4f, 0x3fc55550
- .type L(DP_P2), @object
- ASM_SIZE_DIRECTIVE(L(DP_P2))
-
- .p2align 3
-L(DP_P0): /* double precision polynomial coefficient P0 */
- .long 0xffffe7c6, 0x3fefffff
- .type L(DP_P0), @object
- ASM_SIZE_DIRECTIVE(L(DP_P0))
-
- .p2align 2
-L(SP_INF_0):
- .long 0x7f800000 /* single precision Inf */
- .long 0 /* single precision zero */
- .type L(SP_INF_0), @object
- ASM_SIZE_DIRECTIVE(L(SP_INF_0))
-
- .section .rodata.cst4,"aM",@progbits,4
- .p2align 2
-L(SP_RS): /* single precision 2^23+2^22 */
- .long 0x4b400000
- .type L(SP_RS), @object
- ASM_SIZE_DIRECTIVE(L(SP_RS))
-
- .p2align 2
-L(SP_SMALL): /* single precision small value 2^(-100) */
- .long 0x0d800000
- .type L(SP_SMALL), @object
- ASM_SIZE_DIRECTIVE(L(SP_SMALL))
-
- .p2align 2
-L(SP_LARGE): /* single precision large value 2^100 */
- .long 0x71800000
- .type L(SP_LARGE), @object
- ASM_SIZE_DIRECTIVE(L(SP_LARGE))
-
- .p2align 2
-L(SP_ONE): /* single precision 1.0 */
- .long 0x3f800000
- .type L(SP_ONE), @object
- ASM_SIZE_DIRECTIVE(L(SP_ONE))
-
-strong_alias (__ieee754_expf_sse2, __expf_finite_sse2)
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c b/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c
new file mode 100644
index 0000000000..7c758e6556
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c
@@ -0,0 +1,3 @@
+#define __expf __expf_sse2
+
+#include <sysdeps/ieee754/flt-32/e_expf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_expf.c b/sysdeps/i386/i686/fpu/multiarch/e_expf.c
index aebd491967..1f7c35701b 100644
--- a/sysdeps/i386/i686/fpu/multiarch/e_expf.c
+++ b/sysdeps/i386/i686/fpu/multiarch/e_expf.c
@@ -1,5 +1,5 @@
-/* Multiple versions of expf
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Multiple versions of expf.
+ Copyright (C) 2012-2018 Free Software 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,22 +16,27 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <init-arch.h>
+extern float __redirect_expf (float);
-extern double __ieee754_expf_sse2 (double);
-extern double __ieee754_expf_ia32 (double);
+#define SYMBOL_NAME expf
+#include "ifunc-sse2.h"
-double __ieee754_expf (double);
-libm_ifunc (__ieee754_expf,
- HAS_CPU_FEATURE (SSE2)
- ? __ieee754_expf_sse2
- : __ieee754_expf_ia32);
+libc_ifunc_redirected (__redirect_expf, __expf, IFUNC_SELECTOR ());
-extern double __expf_finite_sse2 (double);
-extern double __expf_finite_ia32 (double);
+#include <libm-alias-float.h>
+#ifdef SHARED
+__hidden_ver1 (__expf_ia32, __GI___expf, __redirect_expf)
+ __attribute__ ((visibility ("hidden")));
-double __expf_finite (double);
-libm_ifunc (__expf_finite,
- HAS_CPU_FEATURE (SSE2)
- ? __expf_finite_sse2
- : __expf_finite_ia32);
+# include <shlib-compat.h>
+versioned_symbol (libm, __expf, expf, GLIBC_2_27);
+libm_alias_float_other (__exp, exp)
+#else
+libm_alias_float (__exp, exp)
+#endif
+
+strong_alias (__expf, __ieee754_expf)
+strong_alias (__expf, __expf_finite)
+
+#define __expf __expf_ia32
+#include <sysdeps/ieee754/flt-32/e_expf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c b/sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c
new file mode 100644
index 0000000000..a9ed25e399
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c
@@ -0,0 +1,3 @@
+#define __log2f __log2f_sse2
+
+#include <sysdeps/ieee754/flt-32/e_log2f.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_log2f.c b/sysdeps/i386/i686/fpu/multiarch/e_log2f.c
new file mode 100644
index 0000000000..3dacaa609e
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_log2f.c
@@ -0,0 +1,42 @@
+/* Multiple versions of log2f.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+extern float __redirect_log2f (float);
+
+#define SYMBOL_NAME log2f
+#include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_log2f, __log2f, IFUNC_SELECTOR ());
+
+#include <libm-alias-float.h>
+#ifdef SHARED
+__hidden_ver1 (__log2f_ia32, __GI___log2f, __redirect_log2f)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __log2f, log2f, GLIBC_2_27);
+libm_alias_float_other (__log2, log2)
+#else
+libm_alias_float (__log2, log2)
+#endif
+
+strong_alias (__log2f, __ieee754_log2f)
+strong_alias (__log2f, __log2f_finite)
+
+#define __log2f __log2f_ia32
+#include <sysdeps/ieee754/flt-32/e_log2f.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c b/sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c
new file mode 100644
index 0000000000..11621fc122
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c
@@ -0,0 +1,3 @@
+#define __logf __logf_sse2
+
+#include <sysdeps/ieee754/flt-32/e_logf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_logf.c b/sysdeps/i386/i686/fpu/multiarch/e_logf.c
new file mode 100644
index 0000000000..1ce90e2e05
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_logf.c
@@ -0,0 +1,42 @@
+/* Multiple versions of logf.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+extern float __redirect_logf (float);
+
+#define SYMBOL_NAME logf
+#include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_logf, __logf, IFUNC_SELECTOR ());
+
+#include <libm-alias-float.h>
+#ifdef SHARED
+__hidden_ver1 (__logf_ia32, __GI___logf, __redirect_logf)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __logf, logf, GLIBC_2_27);
+libm_alias_float_other (__log, log)
+#else
+libm_alias_float (__log, log)
+#endif
+
+strong_alias (__logf, __ieee754_logf)
+strong_alias (__logf, __logf_finite)
+
+#define __logf __logf_ia32
+#include <sysdeps/ieee754/flt-32/e_logf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c b/sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c
new file mode 100644
index 0000000000..c56f6ee89f
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c
@@ -0,0 +1,3 @@
+#define __powf __powf_sse2
+
+#include <sysdeps/ieee754/flt-32/e_powf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_powf.c b/sysdeps/i386/i686/fpu/multiarch/e_powf.c
new file mode 100644
index 0000000000..edec68eac6
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_powf.c
@@ -0,0 +1,45 @@
+/* Multiple versions of powf.
+ Copyright (C) 2017-2018 Free Software 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 powf __redirect_powf
+#define __DECL_SIMD___redirect_powf
+#include <math.h>
+#undef powf
+
+#define SYMBOL_NAME powf
+#include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_powf, __powf, IFUNC_SELECTOR ());
+
+#include <libm-alias-float.h>
+#ifdef SHARED
+__hidden_ver1 (__powf_ia32, __GI___powf, __redirect_powf)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __powf, powf, GLIBC_2_27);
+libm_alias_float_other (__pow, pow)
+#else
+libm_alias_float (__pow, pow)
+#endif
+
+strong_alias (__powf, __ieee754_powf)
+strong_alias (__powf, __powf_finite)
+
+#define __powf __powf_ia32
+#include <sysdeps/ieee754/flt-32/e_powf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
index bbb644a591..8a51503bc5 100644
--- a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
+++ b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
@@ -3,1524 +3,1953 @@
# Maximal error of functions:
Function: "acos":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "acos_downward":
+float128: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "acos_towardzero":
+float128: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "acos_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "acosh":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 4
ldouble: 2
Function: "acosh_downward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 6
ldouble: 4
Function: "acosh_towardzero":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 6
ldouble: 4
Function: "acosh_upward":
double: 1
+float128: 2
idouble: 1
-ildouble: 4
+ifloat128: 2
+ildouble: 5
ldouble: 3
Function: "asin":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "asin_downward":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "asin_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "asin_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "asinh":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "asinh_downward":
double: 1
float: 1
+float128: 4
idouble: 1
+ifloat: 1
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "asinh_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
+ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "asinh_upward":
double: 1
float: 1
+float128: 4
idouble: 1
ifloat: 1
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "atan":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan2":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan2_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atan2_towardzero":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "atan2_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atan_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atan_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atanh":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "atanh_downward":
double: 1
float: 1
+float128: 4
idouble: 1
ifloat: 1
-ildouble: 3
+ifloat128: 4
+ildouble: 4
ldouble: 4
Function: "atanh_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 5
ldouble: 3
Function: "atanh_upward":
double: 1
float: 1
+float128: 4
idouble: 1
ifloat: 1
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "cabs":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_downward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "cacos":
double: 1
-float: 1
+float: 2
+float128: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "cacos":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "cacos_downward":
-double: 1
+double: 2
float: 1
-idouble: 1
+float128: 3
+idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos_downward":
-double: 4
+double: 5
float: 3
-idouble: 4
+float128: 6
+idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 6
+ldouble: 6
Function: Real part of "cacos_towardzero":
-double: 1
+double: 2
float: 1
-idouble: 1
+float128: 3
+idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos_towardzero":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Real part of "cacos_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 7
+float: 7
+float128: 7
+idouble: 7
+ifloat: 7
+ifloat128: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacosh":
double: 1
-float: 1
+float: 2
+float128: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "cacosh_downward":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 2
-ldouble: 2
+double: 2
+float: 2
+float128: 4
+idouble: 2
+ifloat: 2
+ifloat128: 4
+ildouble: 3
+ldouble: 3
Function: Real part of "cacosh_towardzero":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_towardzero":
-double: 1
+double: 2
float: 1
-idouble: 1
+float128: 3
+idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Real part of "cacosh_upward":
-double: 4
+double: 5
float: 4
-idouble: 4
+float128: 6
+idouble: 5
ifloat: 4
+ifloat128: 6
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 4
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ifloat128: 4
+ildouble: 3
+ldouble: 3
Function: "carg":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "carg_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "carg_towardzero":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "carg_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "casin":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "casin":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 2
-ldouble: 2
-
-Function: Real part of "casin_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+float128: 3
+idouble: 3
+ifloat: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
Function: Imaginary part of "casin_downward":
-double: 4
+double: 5
float: 3
-idouble: 4
+float128: 6
+idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 6
+ldouble: 6
Function: Real part of "casin_towardzero":
-double: 1
+double: 3
float: 1
-idouble: 1
+float128: 3
+idouble: 3
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "casin_towardzero":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Real part of "casin_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 7
+float: 7
+float128: 7
+idouble: 7
+ifloat: 7
+ifloat128: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "casinh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "casinh":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "casinh_downward":
-double: 4
+double: 5
float: 3
-idouble: 4
+float128: 6
+idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "casinh_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 3
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Real part of "casinh_towardzero":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Imaginary part of "casinh_towardzero":
-double: 1
+double: 3
float: 1
-idouble: 1
+float128: 3
+idouble: 3
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 7
+float: 7
+float128: 7
+idouble: 7
+ifloat: 7
+ifloat128: 7
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "casinh_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
+Function: Real part of "catan":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
Function: Imaginary part of "catan":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "catan_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "catan_downward":
double: 2
float: 1
+float128: 2
idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Real part of "catan_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "catan_towardzero":
double: 2
float: 1
+float128: 2
idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Real part of "catan_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "catan_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "catanh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "catanh_downward":
double: 2
float: 1
+float128: 2
idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "catanh_towardzero":
double: 2
float: 1
+float128: 2
idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "catanh_upward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 4
+float: 4
+float128: 4
+idouble: 4
+ifloat: 4
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "cbrt":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "cbrt_downward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: "cbrt_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "cbrt_upward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: Real part of "ccos":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "ccos":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "ccos_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccos_downward":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccos_towardzero":
double: 1
-float: 1
+float: 2
+float128: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccos_towardzero":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccos_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "ccos_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "ccosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "ccosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "ccosh_downward":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccosh_downward":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccosh_towardzero":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 2
+float: 3
+float128: 2
+idouble: 2
+ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccosh_towardzero":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccosh_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "ccosh_upward":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "cexp":
double: 2
float: 1
+float128: 1
idouble: 2
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "cexp":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "cexp_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "cexp_downward":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "cexp_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "cexp_towardzero":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "cexp_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cexp_upward":
double: 3
float: 2
+float128: 3
idouble: 3
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog":
double: 2
-float: 1
+float: 3
+float128: 2
idouble: 2
-ifloat: 1
+ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "clog":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "clog10":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 4
+float128: 2
+idouble: 3
+ifloat: 4
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Imaginary part of "clog10":
-double: 1
-idouble: 1
+double: 2
+float: 1
+float128: 2
+idouble: 2
+ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "clog10_downward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 4
+float: 4
+float128: 3
+idouble: 4
+ifloat: 4
+ifloat128: 3
ildouble: 8
ldouble: 8
Function: Imaginary part of "clog10_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog10_towardzero":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 5
+float: 5
+float128: 4
+idouble: 5
+ifloat: 5
+ifloat128: 4
ildouble: 8
ldouble: 8
Function: Imaginary part of "clog10_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog10_upward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
-ildouble: 7
-ldouble: 7
+double: 4
+float: 5
+float128: 4
+idouble: 4
+ifloat: 5
+ifloat128: 4
+ildouble: 8
+ldouble: 8
Function: Imaginary part of "clog10_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog_downward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Imaginary part of "clog_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "clog_towardzero":
double: 3
-float: 3
+float: 4
+float128: 3
idouble: 3
-ifloat: 3
+ifloat: 4
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Imaginary part of "clog_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "clog_upward":
double: 2
float: 3
+float128: 4
idouble: 2
ifloat: 3
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "clog_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "cos":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cos_downward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "cos_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cos_upward":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "cosh":
double: 1
float: 1
+float128: 1
idouble: 1
+ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cosh_downward":
double: 2
float: 1
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 3
Function: "cosh_towardzero":
double: 2
float: 1
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cosh_upward":
double: 4
float: 2
-idouble: 1
-ifloat: 1
+float128: 3
+idouble: 4
+ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 3
Function: Real part of "cpow":
double: 2
float: 5
+float128: 4
idouble: 2
ifloat: 5
+ifloat128: 4
ildouble: 3
ldouble: 3
Function: Imaginary part of "cpow":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: Real part of "cpow_downward":
double: 5
float: 8
+float128: 6
idouble: 5
ifloat: 8
+ifloat128: 6
ildouble: 7
ldouble: 7
Function: Imaginary part of "cpow_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "cpow_towardzero":
double: 5
float: 8
+float128: 6
idouble: 5
ifloat: 8
+ifloat128: 6
ildouble: 7
ldouble: 7
Function: Imaginary part of "cpow_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "cpow_upward":
double: 4
float: 1
+float128: 3
idouble: 4
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cpow_upward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "csin":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "csin":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
Function: Real part of "csin_downward":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csin_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csin_towardzero":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csin_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csin_upward":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csin_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "csinh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "csinh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "csinh_downward":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csinh_downward":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csinh_towardzero":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csinh_towardzero":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csinh_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Imaginary part of "csinh_upward":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csqrt":
-double: 1
-idouble: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "csqrt":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "csqrt_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 4
+float: 4
+float128: 4
+idouble: 4
+ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "csqrt_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Real part of "csqrt_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Imaginary part of "csqrt_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Real part of "csqrt_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 4
+float: 4
+float128: 4
+idouble: 4
+ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "csqrt_upward":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Real part of "ctan":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "ctan":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: Real part of "ctan_downward":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 6
+float: 5
+float128: 4
+idouble: 6
+ifloat: 5
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "ctan_downward":
double: 2
float: 2
+float128: 5
idouble: 2
ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Real part of "ctan_towardzero":
-double: 3
-float: 1
-idouble: 3
-ifloat: 1
+double: 5
+float: 3
+float128: 4
+idouble: 5
+ifloat: 3
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "ctan_towardzero":
double: 2
-float: 1
+float: 2
+float128: 5
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Real part of "ctan_upward":
double: 3
-float: 2
+float: 4
+float128: 5
idouble: 3
-ifloat: 2
+ifloat: 4
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: Imaginary part of "ctan_upward":
double: 2
float: 1
+float128: 5
idouble: 2
ifloat: 1
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: Real part of "ctanh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: Imaginary part of "ctanh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Real part of "ctanh_downward":
double: 2
float: 2
+float128: 5
idouble: 2
ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Imaginary part of "ctanh_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 6
+float: 5
+float128: 4
+idouble: 6
+ifloat: 5
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Real part of "ctanh_towardzero":
double: 2
-float: 1
+float: 2
+float128: 5
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Imaginary part of "ctanh_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 5
+float: 3
+float128: 3
+idouble: 5
+ifloat: 3
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "ctanh_upward":
double: 2
-float: 1
+float: 2
+float128: 5
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: Imaginary part of "ctanh_upward":
double: 3
-float: 2
+float: 3
+float128: 5
idouble: 3
-ifloat: 2
+ifloat: 3
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: "erf":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "erf_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "erf_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "erf_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "erfc":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 2
+float128: 2
+idouble: 3
+ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "erfc_downward":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 5
+float: 6
+float128: 5
+idouble: 5
+ifloat: 6
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "erfc_towardzero":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 4
+float128: 4
+idouble: 3
+ifloat: 4
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "erfc_upward":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 5
+float: 6
+float128: 5
+idouble: 5
+ifloat: 6
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "exp":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp10":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "exp10_downward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "exp10_towardzero":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "exp10_upward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "exp2":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp2_downward":
+float128: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp2_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp2_upward":
+float: 1
+float128: 2
+ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 2
ldouble: 2
@@ -1534,642 +1963,789 @@ ldouble: 1
Function: "expm1":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "expm1_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "expm1_towardzero":
double: 1
float: 1
+float128: 4
idouble: 1
ifloat: 1
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "expm1_upward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "gamma":
-double: 3
+double: 4
float: 3
-idouble: 3
+idouble: 4
ifloat: 3
ildouble: 4
ldouble: 4
Function: "gamma_downward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
ildouble: 7
ldouble: 7
Function: "gamma_towardzero":
-double: 4
+double: 5
float: 4
-idouble: 4
+idouble: 5
ifloat: 4
ildouble: 7
ldouble: 7
Function: "gamma_upward":
-double: 3
-float: 4
-idouble: 3
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 6
+ldouble: 6
Function: "hypot":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "hypot_downward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "hypot_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "hypot_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "j0":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "j0_downward":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 2
+float: 4
+float128: 4
+idouble: 2
+ifloat: 4
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "j0_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+float128: 2
+idouble: 3
+ifloat: 2
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: "j0_upward":
-double: 1
+double: 3
float: 3
-idouble: 1
+float128: 5
+idouble: 3
ifloat: 3
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "j1":
double: 2
-float: 1
+float: 2
+float128: 4
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 4
ildouble: 1
ldouble: 1
Function: "j1_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+float128: 4
+idouble: 3
+ifloat: 3
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "j1_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+float128: 4
+idouble: 3
+ifloat: 2
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "j1_upward":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 3
+float: 5
+float128: 3
+idouble: 3
+ifloat: 5
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "jn":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 4
+float: 4
+float128: 7
+idouble: 4
+ifloat: 4
+ifloat128: 7
ildouble: 4
ldouble: 4
Function: "jn_downward":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 5
+float: 5
+float128: 8
+idouble: 5
+ifloat: 5
+ifloat128: 8
ildouble: 4
ldouble: 4
Function: "jn_towardzero":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 5
+float: 5
+float128: 8
+idouble: 5
+ifloat: 5
+ifloat128: 8
ildouble: 5
ldouble: 5
Function: "jn_upward":
-double: 2
-float: 3
-idouble: 2
-ifloat: 3
+double: 5
+float: 5
+float128: 7
+idouble: 5
+ifloat: 5
+ifloat128: 7
ildouble: 5
ldouble: 5
Function: "lgamma":
-double: 3
+double: 4
float: 3
-idouble: 3
+float128: 5
+idouble: 4
ifloat: 3
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "lgamma_downward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 5
+float128: 8
+idouble: 5
+ifloat: 5
+ifloat128: 8
ildouble: 7
ldouble: 7
Function: "lgamma_towardzero":
-double: 4
+double: 5
float: 4
-idouble: 4
+float128: 5
+idouble: 5
ifloat: 4
+ifloat128: 5
ildouble: 7
ldouble: 7
Function: "lgamma_upward":
-double: 3
-float: 4
-idouble: 3
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 5
+float128: 8
+idouble: 5
+ifloat: 5
+ifloat128: 8
+ildouble: 6
+ldouble: 6
Function: "log":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log10":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log10_downward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "log10_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "log10_upward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log1p":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "log1p_downward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "log1p_towardzero":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "log1p_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "log2":
double: 1
+float: 1
+float128: 2
idouble: 1
+ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "log2_downward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "log2_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log2_upward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log_downward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "log_towardzero":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "log_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "pow":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
-Function: "pow10":
-double: 1
-idouble: 1
-ildouble: 1
-ldouble: 1
-
-Function: "pow10_downward":
+Function: "pow_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 2
+ildouble: 4
+ldouble: 4
-Function: "pow10_towardzero":
+Function: "pow_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 2
+ildouble: 4
+ldouble: 4
-Function: "pow10_upward":
+Function: "pow_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
-ildouble: 2
-ldouble: 2
-
-Function: "pow_downward":
-double: 1
-idouble: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
-Function: "pow_towardzero":
-double: 1
-idouble: 1
-ildouble: 1
-ldouble: 1
-
-Function: "pow_upward":
+Function: "sin":
double: 1
+float128: 1
idouble: 1
-ildouble: 2
-ldouble: 2
-
-Function: "sin":
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "sin_downward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "sin_towardzero":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "sin_upward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "sincos":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "sincos_downward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "sincos_towardzero":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "sincos_upward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "sinh":
-double: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "sinh_downward":
-double: 2
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 4
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
+ildouble: 5
ldouble: 5
Function: "sinh_towardzero":
double: 2
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 3
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
+ildouble: 4
ldouble: 4
Function: "sinh_upward":
double: 4
-float: 2
-idouble: 1
-ifloat: 1
-ildouble: 4
+float: 3
+float128: 4
+idouble: 4
+ifloat: 3
+ifloat128: 4
+ildouble: 5
ldouble: 5
Function: "tan":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "tan_downward":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "tan_towardzero":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "tan_upward":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "tanh":
-double: 1
-idouble: 1
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "tanh_downward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+float128: 4
+idouble: 3
+ifloat: 3
+ifloat128: 4
ildouble: 7
ldouble: 4
Function: "tanh_towardzero":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "tanh_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 5
-ldouble: 4
-
-Function: "tgamma":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 5
-ldouble: 5
+ldouble: 4
-Function: "tgamma_downward":
-double: 3
+Function: "tgamma":
+double: 5
float: 4
-idouble: 3
+float128: 4
+idouble: 5
ifloat: 4
+ifloat128: 4
+ildouble: 5
+ldouble: 5
+
+Function: "tgamma_downward":
+double: 6
+float: 5
+float128: 5
+idouble: 6
+ifloat: 5
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "tgamma_towardzero":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 6
+float: 5
+float128: 5
+idouble: 6
+ifloat: 5
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "tgamma_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 6
+float128: 4
+idouble: 5
+ifloat: 6
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "y0":
-double: 1
+double: 2
float: 1
-idouble: 1
+float128: 3
+idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "y0_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 4
+float128: 4
+idouble: 3
+ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "y0_towardzero":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: "y0_upward":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+double: 3
+float: 5
+float128: 3
+idouble: 3
+ifloat: 5
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "y1":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 2
+idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "y1_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 4
+float128: 4
+idouble: 3
+ifloat: 4
+ifloat128: 4
ildouble: 7
ldouble: 7
Function: "y1_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 2
+idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: "y1_upward":
-double: 1
+double: 7
float: 3
-idouble: 1
+float128: 5
+idouble: 7
ifloat: 3
+ifloat128: 5
ildouble: 7
ldouble: 7
Function: "yn":
-double: 2
+double: 3
float: 3
-idouble: 2
+float128: 5
+idouble: 3
ifloat: 3
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "yn_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 4
+float128: 5
+idouble: 3
+ifloat: 4
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "yn_towardzero":
double: 3
float: 3
+float128: 5
idouble: 3
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "yn_upward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 4
+float: 5
+float128: 5
+idouble: 4
+ifloat: 5
+ifloat128: 5
ildouble: 4
ldouble: 4
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/i686/fpu/multiarch/s_cosf-sse2.S b/sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.S
index 66c247e9d0..ffd639e70b 100644
--- a/sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.S
+++ b/sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.S
@@ -1,5 +1,5 @@
/* Optimized with sse2 version of cosf
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software 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,8 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#define __need_Emath
-#include <bits/errno.h>
+#include <errno.h>
/* Short algorithm description:
*
diff --git a/sysdeps/i386/i686/fpu/multiarch/s_cosf.c b/sysdeps/i386/i686/fpu/multiarch/s_cosf.c
index f46695a2e7..a4556a478d 100644
--- a/sysdeps/i386/i686/fpu/multiarch/s_cosf.c
+++ b/sysdeps/i386/i686/fpu/multiarch/s_cosf.c
@@ -1,5 +1,5 @@
/* Multiple versions of cosf
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software 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,13 +17,14 @@
<http://www.gnu.org/licenses/>. */
#include <init-arch.h>
+#include <libm-alias-float.h>
extern float __cosf_sse2 (float);
extern float __cosf_ia32 (float);
float __cosf (float);
libm_ifunc (__cosf, HAS_CPU_FEATURE (SSE2) ? __cosf_sse2 : __cosf_ia32);
-weak_alias (__cosf, cosf);
+libm_alias_float (__cos, cos);
#define COSF __cosf_ia32
#include <sysdeps/ieee754/flt-32/s_cosf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/s_sincosf-sse2.S b/sysdeps/i386/i686/fpu/multiarch/s_sincosf-sse2.S
index 93c6dd65b4..67855395bb 100644
--- a/sysdeps/i386/i686/fpu/multiarch/s_sincosf-sse2.S
+++ b/sysdeps/i386/i686/fpu/multiarch/s_sincosf-sse2.S
@@ -1,5 +1,5 @@
/* Optimized with sse2 version of sincosf
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software 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,8 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#define __need_Emath
-#include <bits/errno.h>
+#include <errno.h>
/* Short algorithm description:
*
diff --git a/sysdeps/i386/i686/fpu/multiarch/s_sincosf.c b/sysdeps/i386/i686/fpu/multiarch/s_sincosf.c
index 7338793e9c..5f21f5c0ed 100644
--- a/sysdeps/i386/i686/fpu/multiarch/s_sincosf.c
+++ b/sysdeps/i386/i686/fpu/multiarch/s_sincosf.c
@@ -1,5 +1,5 @@
/* Multiple versions of sincosf
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <init-arch.h>
+#include <libm-alias-float.h>
extern void __sincosf_sse2 (float, float *, float *);
extern void __sincosf_ia32 (float, float *, float *);
@@ -24,7 +25,7 @@ void __sincosf (float, float *, float *);
libm_ifunc (__sincosf,
HAS_CPU_FEATURE (SSE2) ? __sincosf_sse2 : __sincosf_ia32);
-weak_alias (__sincosf, sincosf);
+libm_alias_float (__sincos, sincos);
#define SINCOSF __sincosf_ia32
#include <sysdeps/ieee754/flt-32/s_sincosf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S b/sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S
index fbcce73d03..4d20fdbead 100644
--- a/sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S
+++ b/sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S
@@ -1,5 +1,5 @@
/* Optimized with sse2 version of sinf
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software 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,8 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#define __need_Emath
-#include <bits/errno.h>
+#include <errno.h>
/* Short algorithm description:
*
diff --git a/sysdeps/i386/i686/fpu/multiarch/s_sinf.c b/sysdeps/i386/i686/fpu/multiarch/s_sinf.c
index 4d1d2f41f1..80a7ffaa1e 100644
--- a/sysdeps/i386/i686/fpu/multiarch/s_sinf.c
+++ b/sysdeps/i386/i686/fpu/multiarch/s_sinf.c
@@ -1,5 +1,5 @@
/* Multiple versions of sinf
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software 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,12 +17,13 @@
<http://www.gnu.org/licenses/>. */
#include <init-arch.h>
+#include <libm-alias-float.h>
extern float __sinf_sse2 (float);
extern float __sinf_ia32 (float);
float __sinf (float);
libm_ifunc (__sinf, HAS_CPU_FEATURE (SSE2) ? __sinf_sse2 : __sinf_ia32);
-weak_alias (__sinf, sinf);
+libm_alias_float (__sin, sin);
#define SINF __sinf_ia32
#include <sysdeps/ieee754/flt-32/s_sinf.c>
diff --git a/sysdeps/i386/i686/fpu/s_fdim.S b/sysdeps/i386/i686/fpu/s_fdim.S
deleted file mode 100644
index 2cbf815f98..0000000000
--- a/sysdeps/i386/i686/fpu/s_fdim.S
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Compute positive difference.
- 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 <sysdep.h>
-
- .text
-ENTRY(__fdim)
- fldl 4(%esp) // x
- fldl 12(%esp) // x : y
-
- fucomi %st(1), %st
- jp 1f
-
- jc 3f
- fstp %st(1)
- fldz
- jmp 2f
-
-3: fsubrp %st, %st(1)
- ret
-
-1: fucomi %st(0), %st
- fcmovnu %st(1), %st
-2: fstp %st(1)
- ret
-END(__fdim)
-weak_alias (__fdim, fdim)
diff --git a/sysdeps/i386/i686/fpu/s_fdimf.S b/sysdeps/i386/i686/fpu/s_fdimf.S
deleted file mode 100644
index 291433f275..0000000000
--- a/sysdeps/i386/i686/fpu/s_fdimf.S
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Compute positive difference.
- 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 <sysdep.h>
-
- .text
-ENTRY(__fdimf)
- flds 4(%esp) // x
- flds 8(%esp) // x : y
-
- fucomi %st(1), %st
- jp 1f
-
- jc 3f
- fstp %st(1)
- fldz
- jmp 2f
-
-3: fsubrp %st, %st(1)
- ret
-
-1: fucomi %st(0), %st
- fcmovnu %st(1), %st
-2: fstp %st(1)
- ret
-END(__fdimf)
-weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/i386/i686/fpu/s_fdiml.S b/sysdeps/i386/i686/fpu/s_fdiml.S
deleted file mode 100644
index 8cdfedef0a..0000000000
--- a/sysdeps/i386/i686/fpu/s_fdiml.S
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Compute positive difference.
- 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 <sysdep.h>
-
- .text
-ENTRY(__fdiml)
- fldt 4(%esp) // x
- fldt 16(%esp) // x : y
-
- fucomi %st(1), %st
- jp 1f
-
- jc 3f
- fstp %st(1)
- fldz
- jmp 2f
-
-3: fsubrp %st, %st(1)
- ret
-
-1: fucomi %st(0), %st
- fcmovnu %st(1), %st
-2: fstp %st(1)
- ret
-END(__fdiml)
-weak_alias (__fdiml, fdiml)
diff --git a/sysdeps/i386/i686/fpu/s_fmax.S b/sysdeps/i386/i686/fpu/s_fmax.S
index 71be4a5db1..501573edc2 100644
--- a/sysdeps/i386/i686/fpu/s_fmax.S
+++ b/sysdeps/i386/i686/fpu/s_fmax.S
@@ -1,5 +1,5 @@
/* Compute maximum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__fmax)
@@ -36,4 +37,4 @@ ENTRY(__fmax)
ret
END(__fmax)
-weak_alias (__fmax, fmax)
+libm_alias_double (__fmax, fmax)
diff --git a/sysdeps/i386/i686/fpu/s_fmaxf.S b/sysdeps/i386/i686/fpu/s_fmaxf.S
index 8fa796a8a3..a167b6c73d 100644
--- a/sysdeps/i386/i686/fpu/s_fmaxf.S
+++ b/sysdeps/i386/i686/fpu/s_fmaxf.S
@@ -1,5 +1,5 @@
/* Compute maximum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__fmaxf)
@@ -36,4 +37,4 @@ ENTRY(__fmaxf)
ret
END(__fmaxf)
-weak_alias (__fmaxf, fmaxf)
+libm_alias_float (__fmax, fmax)
diff --git a/sysdeps/i386/i686/fpu/s_fmaxl.S b/sysdeps/i386/i686/fpu/s_fmaxl.S
index e5dcd26923..c9c62c71c8 100644
--- a/sysdeps/i386/i686/fpu/s_fmaxl.S
+++ b/sysdeps/i386/i686/fpu/s_fmaxl.S
@@ -1,5 +1,5 @@
/* Compute maximum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,22 +18,42 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-ldouble.h>
.text
ENTRY(__fmaxl)
fldt 4(%esp) // x
fldt 16(%esp) // x : y
- fucomi %st(0), %st
- fcmovu %st(1), %st // now %st contains y if not NaN, x otherwise
-
- fxch
-
fucomi %st(1), %st
+ jp 2f
fcmovb %st(1), %st
fstp %st(1)
ret
+
+2: // Unordered.
+ fucomi %st(0), %st
+ jp 3f
+ // st(1) is a NaN; st(0) is not. Test if st(1) is signaling.
+ testb $0x40, 11(%esp)
+ jz 4f
+ fstp %st(1)
+ ret
+
+3: // st(0) is a NaN; st(1) may or may not be.
+ fxch
+ fucomi %st(0), %st
+ jp 4f
+ // st(1) is a NaN; st(0) is not. Test if st(1) is signaling.
+ testb $0x40, 23(%esp)
+ jz 4f
+ fstp %st(1)
+ ret
+
+4: // Both arguments are NaNs, or one is a signaling NaN.
+ faddp
+ ret
END(__fmaxl)
-weak_alias (__fmaxl, fmaxl)
+libm_alias_ldouble (__fmax, fmax)
diff --git a/sysdeps/i386/i686/fpu/s_fmin.S b/sysdeps/i386/i686/fpu/s_fmin.S
index 9c8f5af050..26208279bb 100644
--- a/sysdeps/i386/i686/fpu/s_fmin.S
+++ b/sysdeps/i386/i686/fpu/s_fmin.S
@@ -1,5 +1,5 @@
/* Compute minimum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__fmin)
@@ -34,4 +35,4 @@ ENTRY(__fmin)
ret
END(__fmin)
-weak_alias (__fmin, fmin)
+libm_alias_double (__fmin, fmin)
diff --git a/sysdeps/i386/i686/fpu/s_fminf.S b/sysdeps/i386/i686/fpu/s_fminf.S
index b071915399..d9b6d0d4be 100644
--- a/sysdeps/i386/i686/fpu/s_fminf.S
+++ b/sysdeps/i386/i686/fpu/s_fminf.S
@@ -1,5 +1,5 @@
/* Compute minimum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__fminf)
@@ -34,4 +35,4 @@ ENTRY(__fminf)
ret
END(__fminf)
-weak_alias (__fminf, fminf)
+libm_alias_float (__fmin, fmin)
diff --git a/sysdeps/i386/i686/fpu/s_fminl.S b/sysdeps/i386/i686/fpu/s_fminl.S
index ddbd81115e..a22d0d7c1b 100644
--- a/sysdeps/i386/i686/fpu/s_fminl.S
+++ b/sysdeps/i386/i686/fpu/s_fminl.S
@@ -1,5 +1,5 @@
/* Compute minimum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -17,6 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-ldouble.h>
#include <sysdep.h>
.text
@@ -24,14 +25,35 @@ ENTRY(__fminl)
fldt 4(%esp) // x
fldt 16(%esp) // x : y
- fucomi %st(0), %st
- fcmovu %st(1), %st // now %st contains y if not NaN, x otherwise
-
fucomi %st(1), %st
+ jp 2f
fcmovnb %st(1), %st
fstp %st(1)
ret
+
+2: // Unordered.
+ fucomi %st(0), %st
+ jp 3f
+ // st(1) is a NaN; st(0) is not. Test if st(1) is signaling.
+ testb $0x40, 11(%esp)
+ jz 4f
+ fstp %st(1)
+ ret
+
+3: // st(0) is a NaN; st(1) may or may not be.
+ fxch
+ fucomi %st(0), %st
+ jp 4f
+ // st(1) is a NaN; st(0) is not. Test if st(1) is signaling.
+ testb $0x40, 23(%esp)
+ jz 4f
+ fstp %st(1)
+ ret
+
+4: // Both arguments are NaNs, or one is a signaling NaN.
+ faddp
+ ret
END(__fminl)
-weak_alias (__fminl, fminl)
+libm_alias_ldouble (__fmin, fmin)
diff --git a/sysdeps/i386/i686/hp-timing.h b/sysdeps/i386/i686/hp-timing.h
index 58e53c395f..59af526fdb 100644
--- a/sysdeps/i386/i686/hp-timing.h
+++ b/sysdeps/i386/i686/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. i686 version.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/i386/i686/init-arch.h b/sysdeps/i386/i686/init-arch.h
index 36c83738d8..ab99392b58 100644
--- a/sysdeps/i386/i686/init-arch.h
+++ b/sysdeps/i386/i686/init-arch.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index 1dbeadffc3..3259076cd7 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -1,5 +1,5 @@
/* Compare two memory blocks for differences in the first COUNT bytes.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -80,7 +80,7 @@ L(not_1):
LOAD_JUMP_TABLE_ENTRY (L(table_32bytes), %ecx)
addl %ecx, %edx
addl %ecx, %esi
- jmp *%ebx
+ _CET_NOTRACK jmp *%ebx
ALIGN (4)
L(28bytes):
@@ -326,7 +326,7 @@ L(32bytesormore):
LOAD_JUMP_TABLE_ENTRY (L(table_32bytes), %ecx)
addl %ecx, %edx
addl %ecx, %esi
- jmp *%ebx
+ _CET_NOTRACK jmp *%ebx
L(load_ecx_28):
addl $0x4, %edx
diff --git a/sysdeps/i386/i686/memcpy.S b/sysdeps/i386/i686/memcpy.S
index 7346b3f16f..a0f1f5efe7 100644
--- a/sysdeps/i386/i686/memcpy.S
+++ b/sysdeps/i386/i686/memcpy.S
@@ -1,7 +1,7 @@
/* Copy memory block and return pointer to beginning of destination block
For Intel 80x86, x>=6.
This file is part of the GNU C Library.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/i686/memmove.S b/sysdeps/i386/i686/memmove.S
index 3b2e34628a..014c9f0ec1 100644
--- a/sysdeps/i386/i686/memmove.S
+++ b/sysdeps/i386/i686/memmove.S
@@ -1,7 +1,7 @@
/* Copy memory block and return pointer to beginning of destination block
For Intel 80x86, x>=6.
This file is part of the GNU C Library.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 2003.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/i686/mempcpy.S b/sysdeps/i386/i686/mempcpy.S
index 9661ce30d6..1051ea5cc8 100644
--- a/sysdeps/i386/i686/mempcpy.S
+++ b/sysdeps/i386/i686/mempcpy.S
@@ -1,7 +1,7 @@
/* Copy memory block and return pointer to following byte.
For Intel 80x86, x>=6.
This file is part of the GNU C Library.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/i686/memset.S b/sysdeps/i386/i686/memset.S
index 9d1c1739f8..63826e8828 100644
--- a/sysdeps/i386/i686/memset.S
+++ b/sysdeps/i386/i686/memset.S
@@ -1,6 +1,6 @@
/* memset/bzero -- set memory area to CH/0
Highly optimized version for ix86, x>=6.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
@@ -91,10 +91,3 @@ ENTRY (memset)
ret
END (memset)
libc_hidden_builtin_def (memset)
-
-#if defined SHARED && IS_IN (libc) && !defined __memset_chk \
- && !defined USE_AS_BZERO
-strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
- .section .gnu.warning.__memset_zero_constant_len_parameter
- .string "memset used with constant zero length parameter; this could be due to transposed parameters"
-#endif
diff --git a/sysdeps/i386/i686/memusage.h b/sysdeps/i386/i686/memusage.h
index 72e5d9cd67..a359fc6561 100644
--- a/sysdeps/i386/i686/memusage.h
+++ b/sysdeps/i386/i686/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile
index 700010d969..bf75a9947f 100644
--- a/sysdeps/i386/i686/multiarch/Makefile
+++ b/sysdeps/i386/i686/multiarch/Makefile
@@ -1,6 +1,5 @@
ifeq ($(subdir),csu)
tests += test-multiarch
-gen-as-const-headers += ifunc-defines.sym
endif
ifeq ($(subdir),string)
@@ -25,7 +24,13 @@ sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \
strcasecmp_l-sse4 strncase_l-sse4 \
bcopy-sse2-unaligned memcpy-sse2-unaligned \
mempcpy-sse2-unaligned memmove-sse2-unaligned \
- strcspn-c strpbrk-c strspn-c
+ strcspn-c strpbrk-c strspn-c \
+ bcopy-ia32 bzero-ia32 rawmemchr-ia32 \
+ memchr-ia32 memcmp-ia32 memcpy-ia32 memmove-ia32 \
+ mempcpy-ia32 memset-ia32 strcat-ia32 strchr-ia32 \
+ strrchr-ia32 strcpy-ia32 strcmp-ia32 strcspn-ia32 \
+ strpbrk-ia32 strspn-ia32 strlen-ia32 stpcpy-ia32 \
+ stpncpy-ia32
CFLAGS-varshift.c += -msse4
CFLAGS-strcspn-c.c += -msse4
CFLAGS-strpbrk-c.c += -msse4
@@ -43,3 +48,8 @@ libm-sysdep_routines += s_fma-fma s_fmaf-fma
CFLAGS-s_fma-fma.c += -mavx -mfpmath=sse
CFLAGS-s_fmaf-fma.c += -mavx -mfpmath=sse
endif
+
+ifeq ($(subdir),debug)
+sysdep_routines += memcpy_chk-nonshared mempcpy_chk-nonshared \
+ memmove_chk-nonshared memset_chk-nonshared
+endif
diff --git a/sysdeps/i386/i686/multiarch/bcopy-ia32.S b/sysdeps/i386/i686/multiarch/bcopy-ia32.S
new file mode 100644
index 0000000000..5809cad860
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/bcopy-ia32.S
@@ -0,0 +1,20 @@
+/* bcopy optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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 bcopy __bcopy_ia32
+#include <sysdeps/i386/i686/bcopy.S>
diff --git a/sysdeps/i386/i686/multiarch/bcopy.S b/sysdeps/i386/i686/multiarch/bcopy.S
deleted file mode 100644
index d5b408dfb8..0000000000
--- a/sysdeps/i386/i686/multiarch/bcopy.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Multiple versions of bcopy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib. */
-#if IS_IN (libc)
- .text
-ENTRY(bcopy)
- .type bcopy, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__bcopy_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__bcopy_sse2_unaligned)
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__bcopy_ssse3)
- HAS_CPU_FEATURE (Fast_Rep_String)
- jz 2f
- LOAD_FUNC_GOT_EAX (__bcopy_ssse3_rep)
-2: ret
-END(bcopy)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __bcopy_ia32, @function; \
- .p2align 4; \
- .globl __bcopy_ia32; \
- .hidden __bcopy_ia32; \
- __bcopy_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __bcopy_ia32, .-__bcopy_ia32
-
-#endif
-
-#include "../bcopy.S"
diff --git a/sysdeps/i386/i686/multiarch/bcopy.c b/sysdeps/i386/i686/multiarch/bcopy.c
new file mode 100644
index 0000000000..e27a02d1a5
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/bcopy.c
@@ -0,0 +1,30 @@
+/* Multiple versions of bcopy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define bcopy __redirect_bcopy
+# include <string.h>
+# undef bcopy
+
+# define SYMBOL_NAME bcopy
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_bcopy, bcopy, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/bzero-ia32.S b/sysdeps/i386/i686/multiarch/bzero-ia32.S
new file mode 100644
index 0000000000..68ff9e1e90
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/bzero-ia32.S
@@ -0,0 +1,38 @@
+/* bzero optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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>
+#include <init-arch.h>
+
+#if IS_IN (libc)
+# define __bzero __bzero_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI___bzero; __GI___bzero = __bzero
+# endif
+
+# undef weak_alias
+# define weak_alias(original, alias)
+
+# include <sysdeps/i386/i686/bzero.S>
+#endif
diff --git a/sysdeps/i386/i686/multiarch/bzero.S b/sysdeps/i386/i686/multiarch/bzero.S
deleted file mode 100644
index 3bad4178eb..0000000000
--- a/sysdeps/i386/i686/multiarch/bzero.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Multiple versions of bzero
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib. */
-#if IS_IN (libc)
- .text
-ENTRY(__bzero)
- .type __bzero, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__bzero_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX ( __bzero_sse2)
- HAS_CPU_FEATURE (Fast_Rep_String)
- jz 2f
- LOAD_FUNC_GOT_EAX (__bzero_sse2_rep)
-2: ret
-END(__bzero)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __bzero_ia32, @function; \
- .p2align 4; \
- .globl __bzero_ia32; \
- .hidden __bzero_ia32; \
- __bzero_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __bzero_ia32, .-__bzero_ia32
-
-# ifdef SHARED
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI___bzero; __GI___bzero = __bzero_ia32
-# endif
-#endif
-
-#include "../bzero.S"
diff --git a/sysdeps/i386/i686/multiarch/bzero.c b/sysdeps/i386/i686/multiarch/bzero.c
new file mode 100644
index 0000000000..4f1d739f28
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/bzero.c
@@ -0,0 +1,32 @@
+/* Multiple versions of bzero.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define bzero __redirect_bzero
+# include <string.h>
+# undef bzero
+
+# define SYMBOL_NAME bzero
+# include "ifunc-memset.h"
+
+libc_ifunc_redirected (__redirect_bzero, __bzero, IFUNC_SELECTOR ());
+
+weak_alias (__bzero, bzero)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/ifunc-defines.sym b/sysdeps/i386/i686/multiarch/ifunc-defines.sym
deleted file mode 100644
index 96e9cfaf61..0000000000
--- a/sysdeps/i386/i686/multiarch/ifunc-defines.sym
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "init-arch.h"
-#include <stddef.h>
-
---
-
-CPU_FEATURES_SIZE sizeof (struct cpu_features)
-CPUID_OFFSET offsetof (struct cpu_features, cpuid)
-CPUID_SIZE sizeof (struct cpuid_registers)
-CPUID_EAX_OFFSET offsetof (struct cpuid_registers, eax)
-CPUID_EBX_OFFSET offsetof (struct cpuid_registers, ebx)
-CPUID_ECX_OFFSET offsetof (struct cpuid_registers, ecx)
-CPUID_EDX_OFFSET offsetof (struct cpuid_registers, edx)
-FAMILY_OFFSET offsetof (struct cpu_features, family)
-MODEL_OFFSET offsetof (struct cpu_features, model)
-FEATURE_OFFSET offsetof (struct cpu_features, feature)
-FEATURE_SIZE sizeof (unsigned int)
-
-COMMON_CPUID_INDEX_1
-FEATURE_INDEX_1
diff --git a/sysdeps/i386/i686/multiarch/ifunc-impl-list.c b/sysdeps/i386/i686/multiarch/ifunc-impl-list.c
index ef30a95432..a926b04acd 100644
--- a/sysdeps/i386/i686/multiarch/ifunc-impl-list.c
+++ b/sysdeps/i386/i686/multiarch/ifunc-impl-list.c
@@ -1,5 +1,5 @@
/* Enumerate available IFUNC implementations of a function. i686 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -70,6 +70,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__memcmp_ssse3)
IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ia32))
+#ifdef SHARED
/* Support sysdeps/i386/i686/multiarch/memmove_chk.S. */
IFUNC_IMPL (i, name, __memmove_chk,
IFUNC_IMPL_ADD (array, i, __memmove_chk,
@@ -83,6 +84,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__memmove_chk_sse2_unaligned)
IFUNC_IMPL_ADD (array, i, __memmove_chk, 1,
__memmove_chk_ia32))
+#endif
/* Support sysdeps/i386/i686/multiarch/memmove.S. */
IFUNC_IMPL (i, name, memmove,
@@ -102,6 +104,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__memrchr_sse2)
IFUNC_IMPL_ADD (array, i, memrchr, 1, __memrchr_ia32))
+#ifdef SHARED
/* Support sysdeps/i386/i686/multiarch/memset_chk.S. */
IFUNC_IMPL (i, name, __memset_chk,
IFUNC_IMPL_ADD (array, i, __memset_chk,
@@ -112,6 +115,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__memset_chk_sse2)
IFUNC_IMPL_ADD (array, i, __memset_chk, 1,
__memset_chk_ia32))
+#endif
/* Support sysdeps/i386/i686/multiarch/memset.S. */
IFUNC_IMPL (i, name, memset,
diff --git a/sysdeps/i386/i686/multiarch/ifunc-memmove.h b/sysdeps/i386/i686/multiarch/ifunc-memmove.h
new file mode 100644
index 0000000000..f0e9756178
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/ifunc-memmove.h
@@ -0,0 +1,45 @@
+/* Common definition for memmove/memmove_chk ifunc selections.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3_rep) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Unaligned_Load))
+ return OPTIMIZE (sse2_unaligned);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+ {
+ if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Rep_String))
+ return OPTIMIZE (ssse3_rep);
+
+ return OPTIMIZE (ssse3);
+ }
+
+ return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/ifunc-memset.h b/sysdeps/i386/i686/multiarch/ifunc-memset.h
new file mode 100644
index 0000000000..e96609439a
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/ifunc-memset.h
@@ -0,0 +1,40 @@
+/* Common definition for memset/memset_chk ifunc selections.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_rep) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE2))
+ {
+ if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Rep_String))
+ return OPTIMIZE (sse2_rep);
+
+ return OPTIMIZE (sse2);
+ }
+
+ return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h b/sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h
new file mode 100644
index 0000000000..f5e7f1b846
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h
@@ -0,0 +1,40 @@
+/* Common definition for ifunc selections optimized with SSE2 and BSF.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_bsf) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE2))
+ {
+ if (CPU_FEATURES_ARCH_P (cpu_features, Slow_BSF))
+ return OPTIMIZE (sse2);
+
+ return OPTIMIZE (sse2_bsf);
+ }
+
+ return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h b/sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h
new file mode 100644
index 0000000000..a33fe44f50
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h
@@ -0,0 +1,40 @@
+/* Common definition for ifunc selections optimized with SSE2 and
+ SSSE3.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE2)
+ && CPU_FEATURES_ARCH_P (cpu_features, Fast_Rep_String))
+ return OPTIMIZE (sse2);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+ return OPTIMIZE (ssse3);
+
+ return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/ifunc-sse2.h b/sysdeps/i386/i686/multiarch/ifunc-sse2.h
new file mode 100644
index 0000000000..706c0329c9
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/ifunc-sse2.h
@@ -0,0 +1,34 @@
+/* Common definition for ifunc selections optimized with SSE2.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE2))
+ return OPTIMIZE (sse2);
+
+ return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/ifunc-sse4_2.h b/sysdeps/i386/i686/multiarch/ifunc-sse4_2.h
new file mode 100644
index 0000000000..de7fa2f185
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/ifunc-sse4_2.h
@@ -0,0 +1,34 @@
+/* Common definition for ifunc selections optimized with SSE4_2.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE4_2))
+ return OPTIMIZE (sse42);
+
+ return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h b/sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h
new file mode 100644
index 0000000000..bd772a9298
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h
@@ -0,0 +1,39 @@
+/* Common definition for ifunc selections optimized with SSSE3 and
+ SSE4_2.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse4_2) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE4_2))
+ return OPTIMIZE (sse4_2);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+ return OPTIMIZE (ssse3);
+
+ return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/memchr-ia32.S b/sysdeps/i386/i686/multiarch/memchr-ia32.S
new file mode 100644
index 0000000000..9c870e5b20
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memchr-ia32.S
@@ -0,0 +1,35 @@
+/* memchr optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define __memchr __memchr_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_memchr; __GI_memchr = __memchr
+# endif
+
+# undef weak_alias
+# define weak_alias(original, alias)
+#endif
+
+#include <sysdeps/i386/memchr.S>
diff --git a/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S b/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S
index 5d48898ffa..c8278ba36d 100644
--- a/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S
+++ b/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S
@@ -1,5 +1,5 @@
/* Optimized memchr with sse2
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -149,9 +149,15 @@ L(crosscache):
.p2align 4
L(unaligned_no_match):
# ifndef USE_AS_RAWMEMCHR
- sub $16, %edx
+ /* Calculate the last acceptable address and check for possible
+ addition overflow by using satured math:
+ edx = ecx + edx
+ edx |= -(edx < ecx) */
add %ecx, %edx
- jle L(return_null)
+ sbb %eax, %eax
+ or %eax, %edx
+ sub $16, %edx
+ jbe L(return_null)
add $16, %edi
# else
add $16, %edx
diff --git a/sysdeps/i386/i686/multiarch/memchr-sse2.S b/sysdeps/i386/i686/multiarch/memchr-sse2.S
index 83930b7d38..303242ceee 100644
--- a/sysdeps/i386/i686/multiarch/memchr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/memchr-sse2.S
@@ -1,5 +1,5 @@
/* Optimized memchr with sse2 without bsf
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -117,9 +117,13 @@ L(crosscache):
# ifndef USE_AS_RAWMEMCHR
jnz L(match_case2_prolog1)
- lea -16(%edx), %edx
- add %ecx, %edx
- jle L(return_null)
+ /* "ecx" is less than 16. Calculate "edx + ecx - 16" by using
+ "edx - (16 - ecx)" instead of "(edx + ecx) - 16" to void
+ possible addition overflow. */
+ neg %ecx
+ add $16, %ecx
+ sub %ecx, %edx
+ jbe L(return_null)
lea 16(%edi), %edi
# else
jnz L(match_case1_prolog1)
diff --git a/sysdeps/i386/i686/multiarch/memchr.S b/sysdeps/i386/i686/multiarch/memchr.S
deleted file mode 100644
index 08e7489f3e..0000000000
--- a/sysdeps/i386/i686/multiarch/memchr.S
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Multiple versions of memchr
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(__memchr)
- .type __memchr, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- HAS_ARCH_FEATURE (Slow_BSF)
- jz 3f
-
- LOAD_FUNC_GOT_EAX ( __memchr_sse2)
- ret
-
-2: LOAD_FUNC_GOT_EAX (__memchr_ia32)
- ret
-
-3: LOAD_FUNC_GOT_EAX (__memchr_sse2_bsf)
- ret
-END(__memchr)
-
-weak_alias(__memchr, memchr)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __memchr_ia32, @function; \
- .globl __memchr_ia32; \
- .p2align 4; \
- __memchr_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __memchr_ia32, .-__memchr_ia32
-
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_memchr; __GI_memchr = __memchr_ia32
-
-#endif
-#include "../../memchr.S"
diff --git a/sysdeps/i386/i686/multiarch/memchr.c b/sysdeps/i386/i686/multiarch/memchr.c
new file mode 100644
index 0000000000..32d10b9ed3
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memchr.c
@@ -0,0 +1,32 @@
+/* Multiple versions of memchr.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define memchr __redirect_memchr
+# include <string.h>
+# undef memchr
+
+# define SYMBOL_NAME memchr
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_memchr, __memchr, IFUNC_SELECTOR ());
+
+weak_alias (__memchr, memchr)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
new file mode 100644
index 0000000000..b468350474
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
@@ -0,0 +1,35 @@
+/* memcmp optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define memcmp __memcmp_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_memcmp; __GI_memcmp = memcmp
+# endif
+
+# undef weak_alias
+# define weak_alias(original, alias)
+#endif
+
+#include <sysdeps/i386/i686/memcmp.S>
diff --git a/sysdeps/i386/i686/multiarch/memcmp-sse4.S b/sysdeps/i386/i686/multiarch/memcmp-sse4.S
index e3e01600f8..bc2cb2729d 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-sse4.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-sse4.S
@@ -1,5 +1,5 @@
/* memcmp with SSE4.2, wmemcmp with SSE4.2
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -43,7 +43,7 @@
# define RETURN POP (%ebx); ret; CFI_PUSH (%ebx)
-# ifdef SHARED
+# ifdef PIC
# define JMPTBL(I, B) I - B
/* Load an entry in a jump table into EBX and branch to it. TABLE is a
@@ -59,7 +59,7 @@
absolute address. */ \
addl (%ebx,INDEX,SCALE), %ebx; \
/* We loaded the jump table and adjusted EDX/ESI. Go. */ \
- jmp *%ebx
+ _CET_NOTRACK jmp *%ebx
# else
# define JMPTBL(I, B) I
@@ -67,7 +67,7 @@
jump table with relative offsets. INDEX is a register contains the
index into the jump table. SCALE is the scale of INDEX. */
# define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
- jmp *TABLE(,INDEX,SCALE)
+ _CET_NOTRACK jmp *TABLE(,INDEX,SCALE)
# endif
diff --git a/sysdeps/i386/i686/multiarch/memcmp-ssse3.S b/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
index f59bfcb0c5..31a0b2908e 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
@@ -1,5 +1,5 @@
/* memcmp with SSSE3, wmemcmp with SSSE3
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/memcmp.S b/sysdeps/i386/i686/multiarch/memcmp.S
deleted file mode 100644
index 059a78baa7..0000000000
--- a/sysdeps/i386/i686/multiarch/memcmp.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Multiple versions of memcmp
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
- .text
-ENTRY(memcmp)
- .type memcmp, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__memcmp_ia32)
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memcmp_ssse3)
- HAS_CPU_FEATURE (SSE4_2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memcmp_sse4_2)
-2: ret
-END(memcmp)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __memcmp_ia32, @function; \
- .p2align 4; \
- .globl __memcmp_ia32; \
- .hidden __memcmp_ia32; \
- __memcmp_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __memcmp_ia32, .-__memcmp_ia32
-
-# ifdef SHARED
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_memcmp; __GI_memcmp = __memcmp_ia32
-# endif
-#endif
-
-#include "../memcmp.S"
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
new file mode 100644
index 0000000000..dd5a93a26c
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -0,0 +1,32 @@
+/* Multiple versions of memcmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define memcmp __redirect_memcmp
+# include <string.h>
+# undef memcmp
+
+# define SYMBOL_NAME memcmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
+
+weak_alias (memcmp, bcmp)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memcpy-ia32.S b/sysdeps/i386/i686/multiarch/memcpy-ia32.S
new file mode 100644
index 0000000000..fe772f0dac
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memcpy-ia32.S
@@ -0,0 +1,31 @@
+/* memcpy optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if defined SHARED && IS_IN (libc)
+# define memcpy __memcpy_ia32
+# define __memcpy_chk __memcpy_chk_ia32
+
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_memcpy; __GI_memcpy = memcpy
+#endif
+
+#include <sysdeps/i386/i686/memcpy.S>
diff --git a/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S b/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
index 76f34291a3..9aa17de99c 100644
--- a/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
+++ b/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
@@ -1,5 +1,5 @@
/* memcpy optimized with SSE2 unaligned memory access instructions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -56,7 +56,7 @@
# define RETURN RETURN_END; CFI_PUSH (%ebx)
.section .text.sse2,"ax",@progbits
-# if !defined USE_AS_BCOPY
+# if !defined USE_AS_BCOPY && defined SHARED
ENTRY (MEMCPY_CHK)
movl 12(%esp), %eax
cmpl %eax, 16(%esp)
@@ -72,7 +72,7 @@ ENTRY (MEMCPY)
cmp %edx, %eax
# ifdef USE_AS_MEMMOVE
- jg L(check_forward)
+ ja L(check_forward)
L(mm_len_0_or_more_backward):
/* Now do checks for lengths. We do [0..16], [16..32], [32..64], [64..128]
@@ -81,7 +81,7 @@ L(mm_len_0_or_more_backward):
jbe L(mm_len_0_16_bytes_backward)
cmpl $32, %ecx
- jg L(mm_len_32_or_more_backward)
+ ja L(mm_len_32_or_more_backward)
/* Copy [0..32] and return. */
movdqu (%eax), %xmm0
@@ -92,7 +92,7 @@ L(mm_len_0_or_more_backward):
L(mm_len_32_or_more_backward):
cmpl $64, %ecx
- jg L(mm_len_64_or_more_backward)
+ ja L(mm_len_64_or_more_backward)
/* Copy [0..64] and return. */
movdqu (%eax), %xmm0
@@ -107,7 +107,7 @@ L(mm_len_32_or_more_backward):
L(mm_len_64_or_more_backward):
cmpl $128, %ecx
- jg L(mm_len_128_or_more_backward)
+ ja L(mm_len_128_or_more_backward)
/* Copy [0..128] and return. */
movdqu (%eax), %xmm0
@@ -132,7 +132,7 @@ L(mm_len_128_or_more_backward):
add %ecx, %eax
cmp %edx, %eax
movl SRC(%esp), %eax
- jle L(forward)
+ jbe L(forward)
PUSH (%esi)
PUSH (%edi)
PUSH (%ebx)
@@ -157,7 +157,7 @@ L(mm_len_128_or_more_backward):
# ifdef SHARED_CACHE_SIZE_HALF
cmp $SHARED_CACHE_SIZE_HALF, %edi
# else
-# ifdef SHARED
+# ifdef PIC
PUSH (%ebx)
SETUP_PIC_REG (bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
@@ -269,7 +269,7 @@ L(check_forward):
add %edx, %ecx
cmp %eax, %ecx
movl LEN(%esp), %ecx
- jle L(forward)
+ jbe L(forward)
/* Now do checks for lengths. We do [0..16], [0..32], [0..64], [0..128]
separately. */
@@ -351,7 +351,7 @@ L(mm_len_128_or_more_forward):
# ifdef SHARED_CACHE_SIZE_HALF
cmp $SHARED_CACHE_SIZE_HALF, %edi
# else
-# ifdef SHARED
+# ifdef PIC
PUSH (%ebx)
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
@@ -469,7 +469,7 @@ L(forward):
# ifdef SHARED_CACHE_SIZE_HALF
cmp $SHARED_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_shared_cache_size_half@GOTOFF(%ebx), %ecx
diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
index 460c37e39a..129310bd8a 100644
--- a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
+++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
@@ -1,5 +1,5 @@
/* memcpy with SSSE3 and REP string.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -52,7 +52,7 @@
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
#define POP(REG) popl REG; CFI_POP (REG)
-#ifdef SHARED
+#ifdef PIC
# define PARMS 8 /* Preserve EBX. */
# define ENTRANCE PUSH (%ebx);
# define RETURN_END POP (%ebx); ret
@@ -71,7 +71,7 @@
absolute address. */ \
addl (%ebx,INDEX,SCALE), %ebx; \
/* We loaded the jump table. Go. */ \
- jmp *%ebx
+ _CET_NOTRACK jmp *%ebx
# define BRANCH_TO_JMPTBL_ENTRY_VALUE(TABLE) \
addl $(TABLE - .), %ebx
@@ -79,7 +79,7 @@
# define BRANCH_TO_JMPTBL_ENTRY_TAIL(TABLE, INDEX, SCALE) \
addl (%ebx,INDEX,SCALE), %ebx; \
/* We loaded the jump table. Go. */ \
- jmp *%ebx
+ _CET_NOTRACK jmp *%ebx
#else
# define PARMS 4
# define ENTRANCE
@@ -91,16 +91,16 @@
absolute offsets. INDEX is a register contains the index into the
jump table. SCALE is the scale of INDEX. */
# define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
- jmp *TABLE(,INDEX,SCALE)
+ _CET_NOTRACK jmp *TABLE(,INDEX,SCALE)
# define BRANCH_TO_JMPTBL_ENTRY_VALUE(TABLE)
# define BRANCH_TO_JMPTBL_ENTRY_TAIL(TABLE, INDEX, SCALE) \
- jmp *TABLE(,INDEX,SCALE)
+ _CET_NOTRACK jmp *TABLE(,INDEX,SCALE)
#endif
.section .text.ssse3,"ax",@progbits
-#if !defined USE_AS_BCOPY
+#if !defined USE_AS_BCOPY && defined SHARED
ENTRY (MEMCPY_CHK)
movl 12(%esp), %eax
cmpl %eax, 16(%esp)
@@ -160,7 +160,7 @@ L(48bytesormore):
#ifdef SHARED_CACHE_SIZE_HALF
cmp $SHARED_CACHE_SIZE_HALF, %ecx
#else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_shared_cache_size_half@GOTOFF(%ebx), %ecx
@@ -230,7 +230,7 @@ L(shl_0_gobble):
#ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
#else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
mov __x86_data_cache_size_half@GOTOFF(%ebx), %edi
diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
index c694dc3ca9..5ead569a5e 100644
--- a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
@@ -1,5 +1,5 @@
/* memcpy with SSSE3
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -51,7 +51,7 @@
# define PUSH(REG) pushl REG; CFI_PUSH (REG)
# define POP(REG) popl REG; CFI_POP (REG)
-# ifdef SHARED
+# ifdef PIC
# define PARMS 8 /* Preserve EBX. */
# define ENTRANCE PUSH (%ebx);
# define RETURN_END POP (%ebx); ret
@@ -71,7 +71,7 @@
absolute address. */ \
addl (%ebx, INDEX, SCALE), %ebx; \
/* We loaded the jump table. Go. */ \
- jmp *%ebx
+ _CET_NOTRACK jmp *%ebx
# else
# define PARMS 4
@@ -85,11 +85,11 @@
jump table. SCALE is the scale of INDEX. */
# define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
- jmp *TABLE(, INDEX, SCALE)
+ _CET_NOTRACK jmp *TABLE(, INDEX, SCALE)
# endif
.section .text.ssse3,"ax",@progbits
-# if !defined USE_AS_BCOPY
+# if !defined USE_AS_BCOPY && defined SHARED
ENTRY (MEMCPY_CHK)
movl 12(%esp), %eax
cmpl %eax, 16(%esp)
@@ -157,7 +157,7 @@ L(48bytesormore):
# ifdef SHARED_CACHE_SIZE_HALF
cmp $SHARED_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_shared_cache_size_half@GOTOFF(%ebx), %ecx
@@ -231,7 +231,7 @@ L(shl_0_gobble):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -390,7 +390,7 @@ L(shl_1):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -494,7 +494,7 @@ L(shl_2):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -598,7 +598,7 @@ L(shl_3):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -704,7 +704,7 @@ L(shl_4):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -810,7 +810,7 @@ L(shl_5):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -916,7 +916,7 @@ L(shl_6):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -1022,7 +1022,7 @@ L(shl_7):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -1126,7 +1126,7 @@ L(shl_8):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -1230,7 +1230,7 @@ L(shl_9):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -1335,7 +1335,7 @@ L(shl_10):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -1440,7 +1440,7 @@ L(shl_11):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -1545,7 +1545,7 @@ L(shl_12):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -1650,7 +1650,7 @@ L(shl_13):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -1755,7 +1755,7 @@ L(shl_14):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
@@ -1860,7 +1860,7 @@ L(shl_15):
# ifdef DATA_CACHE_SIZE_HALF
cmp $DATA_CACHE_SIZE_HALF, %ecx
# else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
diff --git a/sysdeps/i386/i686/multiarch/memcpy.S b/sysdeps/i386/i686/multiarch/memcpy.S
deleted file mode 100644
index 27913ea37a..0000000000
--- a/sysdeps/i386/i686/multiarch/memcpy.S
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Multiple versions of memcpy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
- DSO. In static binaries we need memcpy before the initialization
- happened. */
-#if defined SHARED && IS_IN (libc)
- .text
-ENTRY(memcpy)
- .type memcpy, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__memcpy_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memcpy_sse2_unaligned)
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memcpy_ssse3)
- HAS_CPU_FEATURE (Fast_Rep_String)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memcpy_ssse3_rep)
-2: ret
-END(memcpy)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __memcpy_ia32, @function; \
- .p2align 4; \
- .globl __memcpy_ia32; \
- .hidden __memcpy_ia32; \
- __memcpy_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __memcpy_ia32, .-__memcpy_ia32
-
-# undef ENTRY_CHK
-# define ENTRY_CHK(name) \
- .type __memcpy_chk_ia32, @function; \
- .globl __memcpy_chk_ia32; \
- .p2align 4; \
- __memcpy_chk_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END_CHK
-# define END_CHK(name) \
- cfi_endproc; .size __memcpy_chk_ia32, .-__memcpy_chk_ia32
-
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_memcpy; __GI_memcpy = __memcpy_ia32
-#endif
-
-#include "../memcpy.S"
diff --git a/sysdeps/i386/i686/multiarch/memcpy.c b/sysdeps/i386/i686/multiarch/memcpy.c
new file mode 100644
index 0000000000..b4a195686d
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memcpy.c
@@ -0,0 +1,32 @@
+/* Multiple versions of memcpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in lib and for
+ DSO. In static binaries we need memcpy before the initialization
+ happened. */
+#if defined SHARED && IS_IN (libc)
+# define memcpy __redirect_memcpy
+# include <string.h>
+# undef memcpy
+
+# define SYMBOL_NAME memcpy
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_memcpy, memcpy, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S b/sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S
new file mode 100644
index 0000000000..03f5bd95eb
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S
@@ -0,0 +1,21 @@
+/* Non-shared version of memcpy_chk for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/i386/memcpy_chk.S>
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memcpy_chk.S b/sysdeps/i386/i686/multiarch/memcpy_chk.S
deleted file mode 100644
index 39bc3c25be..0000000000
--- a/sysdeps/i386/i686/multiarch/memcpy_chk.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Multiple versions of __memcpy_chk
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
- DSO. There are no multiarch memcpy functions for static binaries.
- */
-#if IS_IN (libc)
-# ifdef SHARED
- .text
-ENTRY(__memcpy_chk)
- .type __memcpy_chk, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__memcpy_chk_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memcpy_chk_sse2_unaligned)
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memcpy_chk_ssse3)
- HAS_CPU_FEATURE (Fast_Rep_String)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memcpy_chk_ssse3_rep)
-2: ret
-END(__memcpy_chk)
-# else
-# include "../memcpy_chk.S"
-# endif
-#endif
diff --git a/sysdeps/i386/i686/multiarch/memcpy_chk.c b/sysdeps/i386/i686/multiarch/memcpy_chk.c
new file mode 100644
index 0000000000..c9b901a6dd
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memcpy_chk.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __memcpy_chk
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __memcpy_chk __redirect_memcpy_chk
+# include <string.h>
+# undef __memcpy_chk
+
+# define SYMBOL_NAME memcpy_chk
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_memcpy_chk, __memcpy_chk,
+ IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memmove-ia32.S b/sysdeps/i386/i686/multiarch/memmove-ia32.S
new file mode 100644
index 0000000000..334daaf897
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memmove-ia32.S
@@ -0,0 +1,31 @@
+/* memmove optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if defined SHARED && IS_IN (libc)
+# define memmove __memmove_ia32
+# define __memmove_chk __memmove_chk_ia32
+
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_memmove; __GI_memmove = memmove
+#endif
+
+#include <sysdeps/i386/i686/memmove.S>
diff --git a/sysdeps/i386/i686/multiarch/memmove.S b/sysdeps/i386/i686/multiarch/memmove.S
deleted file mode 100644
index 725a421eab..0000000000
--- a/sysdeps/i386/i686/multiarch/memmove.S
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Multiple versions of memmove
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib. */
-#if IS_IN (libc)
- .text
-ENTRY(memmove)
- .type memmove, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__memmove_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memmove_sse2_unaligned)
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memmove_ssse3)
- HAS_ARCH_FEATURE (Fast_Rep_String)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memmove_ssse3_rep)
-2: ret
-END(memmove)
-
-# ifdef SHARED
-# undef ENTRY
-# define ENTRY(name) \
- .type __memmove_ia32, @function; \
- .p2align 4; \
- .globl __memmove_ia32; \
- .hidden __memmove_ia32; \
- __memmove_ia32: cfi_startproc; \
- CALL_MCOUNT
-# else
-# undef ENTRY
-# define ENTRY(name) \
- .type __memmove_ia32, @function; \
- .globl __memmove_ia32; \
- .p2align 4; \
- __memmove_ia32: cfi_startproc; \
- CALL_MCOUNT
-# endif
-
-# undef END
-# define END(name) \
- cfi_endproc; .size __memmove_ia32, .-__memmove_ia32
-
-# undef ENTRY_CHK
-# define ENTRY_CHK(name) \
- .type __memmove_chk_ia32, @function; \
- .globl __memmove_chk_ia32; \
- .p2align 4; \
- __memmove_chk_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END_CHK
-# define END_CHK(name) \
- cfi_endproc; .size __memmove_chk_ia32, .-__memmove_chk_ia32
-
-# ifdef SHARED
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_memmove; __GI_memmove = __memmove_ia32
-# endif
-#endif
-
-#include "../memmove.S"
diff --git a/sysdeps/i386/i686/multiarch/memmove.c b/sysdeps/i386/i686/multiarch/memmove.c
new file mode 100644
index 0000000000..cdce982018
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memmove.c
@@ -0,0 +1,32 @@
+/* Multiple versions of memmove.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in lib and for
+ DSO. In static binaries we need memmove before the initialization
+ happened. */
+#if defined SHARED && IS_IN (libc)
+# define memmove __redirect_memmove
+# include <string.h>
+# undef memmove
+
+# define SYMBOL_NAME memmove
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_memmove, memmove, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S b/sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S
new file mode 100644
index 0000000000..7212641792
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S
@@ -0,0 +1,21 @@
+/* Non-shared version of memmmove_chk for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/i386/memmove_chk.S>
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memmove_chk.S b/sysdeps/i386/i686/multiarch/memmove_chk.S
deleted file mode 100644
index c27892d41b..0000000000
--- a/sysdeps/i386/i686/multiarch/memmove_chk.S
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Multiple versions of __memmove_chk
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib. */
-#if IS_IN (libc)
- .text
-ENTRY(__memmove_chk)
- .type __memmove_chk, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__memmove_chk_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memmove_chk_sse2_unaligned)
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memmove_chk_ssse3)
- HAS_CPU_FEATURE (Fast_Rep_String)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memmove_chk_ssse3_rep)
-2: ret
-END(__memmove_chk)
-
-# ifndef SHARED
- .type __memmove_chk_sse2_unaligned, @function
- .p2align 4;
-__memmove_chk_sse2_unaligned:
- cfi_startproc
- CALL_MCOUNT
- movl 12(%esp), %eax
- cmpl %eax, 16(%esp)
- jb __chk_fail
- jmp __memmove_sse2_unaligned
- cfi_endproc
- .size __memmove_chk_sse2_unaligned, .-__memmove_chk_sse2_unaligned
-
- .type __memmove_chk_ssse3, @function
- .p2align 4;
-__memmove_chk_ssse3:
- cfi_startproc
- CALL_MCOUNT
- movl 12(%esp), %eax
- cmpl %eax, 16(%esp)
- jb __chk_fail
- jmp __memmove_ssse3
- cfi_endproc
- .size __memmove_chk_ssse3, .-__memmove_chk_ssse3
-
- .type __memmove_chk_ssse3_rep, @function
- .p2align 4;
-__memmove_chk_ssse3_rep:
- cfi_startproc
- CALL_MCOUNT
- movl 12(%esp), %eax
- cmpl %eax, 16(%esp)
- jb __chk_fail
- jmp __memmove_ssse3_rep
- cfi_endproc
- .size __memmove_chk_ssse3_rep, .-__memmove_chk_ssse3_rep
-
- .type __memmove_chk_ia32, @function
- .p2align 4;
-__memmove_chk_ia32:
- cfi_startproc
- CALL_MCOUNT
- movl 12(%esp), %eax
- cmpl %eax, 16(%esp)
- jb __chk_fail
- jmp __memmove_ia32
- cfi_endproc
- .size __memmove_chk_ia32, .-__memmove_chk_ia32
-# endif
-#endif
diff --git a/sysdeps/i386/i686/multiarch/memmove_chk.c b/sysdeps/i386/i686/multiarch/memmove_chk.c
new file mode 100644
index 0000000000..0e9dc7e07f
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memmove_chk.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __memmove_chk
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __memmove_chk __redirect_memmove_chk
+# include <string.h>
+# undef __memmove_chk
+
+# define SYMBOL_NAME memmove_chk
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_memmove_chk, __memmove_chk,
+ IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/mempcpy-ia32.S b/sysdeps/i386/i686/multiarch/mempcpy-ia32.S
new file mode 100644
index 0000000000..0de1ae21f5
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/mempcpy-ia32.S
@@ -0,0 +1,37 @@
+/* mempcpy optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if defined SHARED && IS_IN (libc)
+# define __mempcpy __mempcpy_ia32
+# define __mempcpy_chk __mempcpy_chk_ia32
+
+# undef libc_hidden_def
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_def(name) \
+ .globl __GI___mempcpy; __GI___mempcpy = __mempcpy
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_mempcpy; __GI_mempcpy = __mempcpy
+
+# undef weak_alias
+# define weak_alias(original, alias)
+#endif
+
+#include <sysdeps/i386/i686/mempcpy.S>
diff --git a/sysdeps/i386/i686/multiarch/mempcpy.S b/sysdeps/i386/i686/multiarch/mempcpy.S
deleted file mode 100644
index 141ff2e395..0000000000
--- a/sysdeps/i386/i686/multiarch/mempcpy.S
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Multiple versions of mempcpy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
- DSO. In static binaries we need mempcpy before the initialization
- happened. */
-#if defined SHARED && IS_IN (libc)
- .text
-ENTRY(__mempcpy)
- .type __mempcpy, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__mempcpy_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__mempcpy_sse2_unaligned)
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__mempcpy_ssse3)
- HAS_CPU_FEATURE (Fast_Rep_String)
- jz 2f
- LOAD_FUNC_GOT_EAX (__mempcpy_ssse3_rep)
-2: ret
-END(__mempcpy)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __mempcpy_ia32, @function; \
- .p2align 4; \
- .globl __mempcpy_ia32; \
- .hidden __mempcpy_ia32; \
- __mempcpy_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __mempcpy_ia32, .-__mempcpy_ia32
-
-# undef ENTRY_CHK
-# define ENTRY_CHK(name) \
- .type __mempcpy_chk_ia32, @function; \
- .globl __mempcpy_chk_ia32; \
- .p2align 4; \
- __mempcpy_chk_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END_CHK
-# define END_CHK(name) \
- cfi_endproc; .size __mempcpy_chk_ia32, .-__mempcpy_chk_ia32
-
-# undef libc_hidden_def
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_def(name) \
- .globl __GI_mempcpy; __GI_mempcpy = __mempcpy_ia32
-# define libc_hidden_builtin_def(name) \
- .globl __GI___mempcpy; __GI___mempcpy = __mempcpy_ia32
-#endif
-
-#include "../mempcpy.S"
diff --git a/sysdeps/i386/i686/multiarch/mempcpy.c b/sysdeps/i386/i686/multiarch/mempcpy.c
new file mode 100644
index 0000000000..36d9baaa4b
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/mempcpy.c
@@ -0,0 +1,38 @@
+/* Multiple versions of mempcpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in lib and for
+ DSO. In static binaries we need memcpy before the initialization
+ happened. */
+#if defined SHARED && IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
+# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
+# include <string.h>
+# undef mempcpy
+# undef __mempcpy
+
+# define SYMBOL_NAME mempcpy
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_mempcpy, __mempcpy, IFUNC_SELECTOR ());
+
+weak_alias (__mempcpy, mempcpy)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S b/sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S
new file mode 100644
index 0000000000..219faebd29
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S
@@ -0,0 +1,21 @@
+/* Non-shared version of mempcpy_chk for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/i386/mempcpy_chk.S>
+#endif
diff --git a/sysdeps/i386/i686/multiarch/mempcpy_chk.S b/sysdeps/i386/i686/multiarch/mempcpy_chk.S
deleted file mode 100644
index 2788b663c2..0000000000
--- a/sysdeps/i386/i686/multiarch/mempcpy_chk.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Multiple versions of __mempcpy_chk
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
- DSO. There are no multiarch mempcpy functions for static binaries.
- */
-#if IS_IN (libc)
-# ifdef SHARED
- .text
-ENTRY(__mempcpy_chk)
- .type __mempcpy_chk, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__mempcpy_chk_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__mempcpy_chk_sse2_unaligned)
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__mempcpy_chk_ssse3)
- HAS_CPU_FEATURE (Fast_Rep_String)
- jz 2f
- LOAD_FUNC_GOT_EAX (__mempcpy_chk_ssse3_rep)
-2: ret
-END(__mempcpy_chk)
-# else
-# include "../mempcpy_chk.S"
-# endif
-#endif
diff --git a/sysdeps/i386/i686/multiarch/mempcpy_chk.c b/sysdeps/i386/i686/multiarch/mempcpy_chk.c
new file mode 100644
index 0000000000..956918b3a1
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/mempcpy_chk.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __mempcpy_chk
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __mempcpy_chk __redirect_mempcpy_chk
+# include <string.h>
+# undef __mempcpy_chk
+
+# define SYMBOL_NAME mempcpy_chk
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_mempcpy_chk, __mempcpy_chk,
+ IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S b/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S
index cf5555cf62..4cd00617ff 100644
--- a/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S
+++ b/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S
@@ -1,5 +1,5 @@
/* Optimized memrchr with sse2
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/memrchr-sse2.S b/sysdeps/i386/i686/multiarch/memrchr-sse2.S
index 5be8332438..2185945a6c 100644
--- a/sysdeps/i386/i686/multiarch/memrchr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/memrchr-sse2.S
@@ -1,5 +1,5 @@
/* Optimized memrchr with sse2 without bsf
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/memrchr.S
deleted file mode 100644
index bc1ff805af..0000000000
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Multiple versions of memrchr
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(__memrchr)
- .type __memrchr, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- HAS_ARCH_FEATURE (Slow_BSF)
- jz 3f
-
- LOAD_FUNC_GOT_EAX (__memrchr_sse2)
- ret
-
-2: LOAD_FUNC_GOT_EAX (__memrchr_ia32)
- ret
-
-3: LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf)
- ret
-END(__memrchr)
-
-weak_alias(__memrchr, memrchr)
-#endif
diff --git a/sysdeps/i386/i686/multiarch/memrchr.c b/sysdeps/i386/i686/multiarch/memrchr.c
new file mode 100644
index 0000000000..1c0d9caf55
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memrchr.c
@@ -0,0 +1,32 @@
+/* Multiple versions of memrchr.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define memrchr __redirect_memrchr
+# include <string.h>
+# undef memrchr
+
+# define SYMBOL_NAME memrchr
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_memrchr, __memrchr, IFUNC_SELECTOR ());
+
+weak_alias (__memrchr, memrchr)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memset-ia32.S b/sysdeps/i386/i686/multiarch/memset-ia32.S
new file mode 100644
index 0000000000..c66ccd3f5f
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memset-ia32.S
@@ -0,0 +1,33 @@
+/* memset optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define memset __memset_ia32
+# define __memset_chk __memset_chk_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_memset; __GI_memset = memset
+# endif
+#endif
+
+#include <sysdeps/i386/i686/memset.S>
diff --git a/sysdeps/i386/i686/multiarch/memset-sse2-rep.S b/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
index 153ae6fdaf..8732aac0b9 100644
--- a/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
+++ b/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
@@ -1,5 +1,5 @@
/* memset with SSE2 and REP string.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -44,7 +44,7 @@
# define SETRTNVAL movl DEST(%esp), %eax
#endif
-#ifdef SHARED
+#ifdef PIC
# define ENTRANCE PUSH (%ebx);
# define RETURN_END POP (%ebx); ret
# define RETURN RETURN_END; CFI_PUSH (%ebx)
@@ -63,7 +63,7 @@
add (%ebx,%ecx,4), %ebx; \
add %ecx, %edx; \
/* We loaded the jump table and adjusted EDX. Go. */ \
- jmp *%ebx
+ _CET_NOTRACK jmp *%ebx
#else
# define ENTRANCE
# define RETURN_END ret
@@ -75,7 +75,7 @@
absolute offsets. */
# define BRANCH_TO_JMPTBL_ENTRY(TABLE) \
add %ecx, %edx; \
- jmp *TABLE(,%ecx,4)
+ _CET_NOTRACK jmp *TABLE(,%ecx,4)
#endif
.section .text.sse2,"ax",@progbits
@@ -262,7 +262,7 @@ L(128bytesormore):
PUSH (%ebx)
mov $DATA_CACHE_SIZE, %ebx
#else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
mov __x86_data_cache_size@GOTOFF(%ebx), %ebx
@@ -274,7 +274,7 @@ L(128bytesormore):
mov %ebx, %edi
shr $4, %ebx
sub %ebx, %edi
-#if defined DATA_CACHE_SIZE || !defined SHARED
+#if defined DATA_CACHE_SIZE || !defined PIC
POP (%ebx)
#endif
/*
diff --git a/sysdeps/i386/i686/multiarch/memset-sse2.S b/sysdeps/i386/i686/multiarch/memset-sse2.S
index 4cac1c7b22..5c9eba1e65 100644
--- a/sysdeps/i386/i686/multiarch/memset-sse2.S
+++ b/sysdeps/i386/i686/multiarch/memset-sse2.S
@@ -1,5 +1,5 @@
/* memset with SSE2
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -44,7 +44,7 @@
# define SETRTNVAL movl DEST(%esp), %eax
#endif
-#ifdef SHARED
+#ifdef PIC
# define ENTRANCE PUSH (%ebx);
# define RETURN_END POP (%ebx); ret
# define RETURN RETURN_END; CFI_PUSH (%ebx)
@@ -63,7 +63,7 @@
add (%ebx,%ecx,4), %ebx; \
add %ecx, %edx; \
/* We loaded the jump table and adjusted EDX. Go. */ \
- jmp *%ebx
+ _CET_NOTRACK jmp *%ebx
#else
# define ENTRANCE
# define RETURN_END ret
@@ -75,7 +75,7 @@
absolute offsets. */
# define BRANCH_TO_JMPTBL_ENTRY(TABLE) \
add %ecx, %edx; \
- jmp *TABLE(,%ecx,4)
+ _CET_NOTRACK jmp *TABLE(,%ecx,4)
#endif
.section .text.sse2,"ax",@progbits
@@ -261,7 +261,7 @@ L(128bytesormore):
PUSH (%ebx)
mov $SHARED_CACHE_SIZE, %ebx
#else
-# ifdef SHARED
+# ifdef PIC
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
mov __x86_shared_cache_size@GOTOFF(%ebx), %ebx
@@ -279,7 +279,7 @@ L(128bytesormore):
# define RESTORE_EBX_STATE CFI_PUSH (%ebx)
cmp $DATA_CACHE_SIZE, %ecx
#else
-# ifdef SHARED
+# ifdef PIC
# define RESTORE_EBX_STATE
SETUP_PIC_REG(bx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
@@ -380,7 +380,7 @@ L(128bytesormore_nt):
jae L(128bytesormore_nt)
sfence
L(shared_cache_loop_end):
-#if defined DATA_CACHE_SIZE || !defined SHARED
+#if defined DATA_CACHE_SIZE || !defined PIC
POP (%ebx)
#endif
BRANCH_TO_JMPTBL_ENTRY (L(table_16_128bytes))
diff --git a/sysdeps/i386/i686/multiarch/memset.S b/sysdeps/i386/i686/multiarch/memset.S
deleted file mode 100644
index 268df0c873..0000000000
--- a/sysdeps/i386/i686/multiarch/memset.S
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Multiple versions of memset
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib. */
-#if IS_IN (libc)
- .text
-ENTRY(memset)
- .type memset, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__memset_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memset_sse2)
- HAS_CPU_FEATURE (Fast_Rep_String)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memset_sse2_rep)
-2: ret
-END(memset)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __memset_ia32, @function; \
- .globl __memset_ia32; \
- .p2align 4; \
- __memset_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __memset_ia32, .-__memset_ia32
-
-# undef ENTRY_CHK
-# define ENTRY_CHK(name) \
- .type __memset_chk_ia32, @function; \
- .globl __memset_chk_ia32; \
- .p2align 4; \
- __memset_chk_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END_CHK
-# define END_CHK(name) \
- cfi_endproc; .size __memset_chk_ia32, .-__memset_chk_ia32
-
-# ifdef SHARED
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_memset; __GI_memset = __memset_ia32
-# endif
-
-# undef strong_alias
-# define strong_alias(original, alias)
-#endif
-
-#include "../memset.S"
diff --git a/sysdeps/i386/i686/multiarch/memset.c b/sysdeps/i386/i686/multiarch/memset.c
new file mode 100644
index 0000000000..5c870c9e00
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memset.c
@@ -0,0 +1,30 @@
+/* Multiple versions of memset.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define memset __redirect_memset
+# include <string.h>
+# undef memset
+
+# define SYMBOL_NAME memset
+# include "ifunc-memset.h"
+
+libc_ifunc_redirected (__redirect_memset, memset, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memset_chk-nonshared.S b/sysdeps/i386/i686/multiarch/memset_chk-nonshared.S
new file mode 100644
index 0000000000..00e450ea0d
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memset_chk-nonshared.S
@@ -0,0 +1,21 @@
+/* Non-shared version of memset_chk for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/i386/memset_chk.S>
+#endif
diff --git a/sysdeps/i386/i686/multiarch/memset_chk.S b/sysdeps/i386/i686/multiarch/memset_chk.S
deleted file mode 100644
index d18b53f7e3..0000000000
--- a/sysdeps/i386/i686/multiarch/memset_chk.S
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Multiple versions of __memset_chk
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib. */
-#if IS_IN (libc)
- .text
-ENTRY(__memset_chk)
- .type __memset_chk, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__memset_chk_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memset_chk_sse2)
- HAS_CPU_FEATURE (Fast_Rep_String)
- jz 2f
- LOAD_FUNC_GOT_EAX (__memset_chk_sse2_rep)
-2: ret
-END(__memset_chk)
-
-# ifdef SHARED
-strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
- .section .gnu.warning.__memset_zero_constant_len_parameter
- .string "memset used with constant zero length parameter; this could be due to transposed parameters"
-# else
- .text
- .type __memset_chk_sse2, @function
- .p2align 4;
-__memset_chk_sse2:
- cfi_startproc
- CALL_MCOUNT
- movl 12(%esp), %eax
- cmpl %eax, 16(%esp)
- jb __chk_fail
- jmp __memset_sse2
- cfi_endproc
- .size __memset_chk_sse2, .-__memset_chk_sse2
-
- .type __memset_chk_sse2_rep, @function
- .p2align 4;
-__memset_chk_sse2_rep:
- cfi_startproc
- CALL_MCOUNT
- movl 12(%esp), %eax
- cmpl %eax, 16(%esp)
- jb __chk_fail
- jmp __memset_sse2_rep
- cfi_endproc
- .size __memset_chk_sse2_rep, .-__memset_chk_sse2_rep
-
- .type __memset_chk_ia32, @function
- .p2align 4;
-__memset_chk_ia32:
- cfi_startproc
- CALL_MCOUNT
- movl 12(%esp), %eax
- cmpl %eax, 16(%esp)
- jb __chk_fail
- jmp __memset_ia32
- cfi_endproc
- .size __memset_chk_ia32, .-__memset_chk_ia32
-# endif
-#endif
diff --git a/sysdeps/i386/i686/multiarch/memset_chk.c b/sysdeps/i386/i686/multiarch/memset_chk.c
new file mode 100644
index 0000000000..3bd580895d
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/memset_chk.c
@@ -0,0 +1,32 @@
+/* Multiple versions of __memset_chk
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __memset_chk __redirect_memset_chk
+# include <string.h>
+# undef __memset_chk
+
+# define SYMBOL_NAME memset_chk
+# include "ifunc-memset.h"
+
+libc_ifunc_redirected (__redirect_memset_chk, __memset_chk,
+ IFUNC_SELECTOR ());
+
+#endif
diff --git a/sysdeps/i386/i686/multiarch/rawmemchr-ia32.S b/sysdeps/i386/i686/multiarch/rawmemchr-ia32.S
new file mode 100644
index 0000000000..de34daf19e
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/rawmemchr-ia32.S
@@ -0,0 +1,35 @@
+/* rawmemchr optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define __rawmemchr __rawmemchr_ia32
+
+# ifdef SHARED
+# undef libc_hidden_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_def(name) \
+ .globl __GI___rawmemchr; __GI___rawmemchr = __rawmemchr
+# endif
+
+# undef weak_alias
+# define weak_alias(original, alias)
+#endif
+
+#include <sysdeps/i386/rawmemchr.S>
diff --git a/sysdeps/i386/i686/multiarch/rawmemchr.S b/sysdeps/i386/i686/multiarch/rawmemchr.S
deleted file mode 100644
index f53978348d..0000000000
--- a/sysdeps/i386/i686/multiarch/rawmemchr.S
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Multiple versions of rawmemchr
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(__rawmemchr)
- .type __rawmemchr, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- HAS_ARCH_FEATURE (Slow_BSF)
- jz 3f
-
- LOAD_FUNC_GOT_EAX (__rawmemchr_sse2)
- ret
-
-2: LOAD_FUNC_GOT_EAX (__rawmemchr_ia32)
- ret
-
-3: LOAD_FUNC_GOT_EAX (__rawmemchr_sse2_bsf)
- ret
-END(__rawmemchr)
-
-weak_alias(__rawmemchr, rawmemchr)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __rawmemchr_ia32, @function; \
- .globl __rawmemchr_ia32; \
- .p2align 4; \
- __rawmemchr_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __rawmemchr_ia32, .-__rawmemchr_ia32
-
-# undef libc_hidden_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_def(name) \
- .globl __GI___rawmemchr; __GI___rawmemchr = __rawmemchr_ia32
-
-#endif
-#include "../../rawmemchr.S"
diff --git a/sysdeps/i386/i686/multiarch/rawmemchr.c b/sysdeps/i386/i686/multiarch/rawmemchr.c
new file mode 100644
index 0000000000..9ac2bcf491
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/rawmemchr.c
@@ -0,0 +1,35 @@
+/* Multiple versions of rawmemchr.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define rawmemchr __redirect_rawmemchr
+# define __rawmemchr __redirect___rawmemchr
+# include <string.h>
+# undef rawmemchr
+# undef __rawmemchr
+
+# define SYMBOL_NAME rawmemchr
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_rawmemchr, __rawmemchr,
+ IFUNC_SELECTOR ());
+
+weak_alias (__rawmemchr, rawmemchr)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/s_fma-fma.c b/sysdeps/i386/i686/multiarch/s_fma-fma.c
index 60e5b9a32d..92daa48d18 100644
--- a/sysdeps/i386/i686/multiarch/s_fma-fma.c
+++ b/sysdeps/i386/i686/multiarch/s_fma-fma.c
@@ -1,5 +1,5 @@
/* FMA version of fma.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/s_fma.c b/sysdeps/i386/i686/multiarch/s_fma.c
index acc59a8c93..7f39f5fdc9 100644
--- a/sysdeps/i386/i686/multiarch/s_fma.c
+++ b/sysdeps/i386/i686/multiarch/s_fma.c
@@ -1,5 +1,5 @@
/* Multiple versions of fma.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -21,13 +21,14 @@
#include <math.h>
#include <init-arch.h>
+#include <libm-alias-double.h>
extern double __fma_ia32 (double x, double y, double z) attribute_hidden;
extern double __fma_fma (double x, double y, double z) attribute_hidden;
libm_ifunc (__fma,
HAS_ARCH_FEATURE (FMA_Usable) ? __fma_fma : __fma_ia32);
-weak_alias (__fma, fma)
+libm_alias_double (__fma, fma)
#define __fma __fma_ia32
diff --git a/sysdeps/i386/i686/multiarch/s_fmaf-fma.c b/sysdeps/i386/i686/multiarch/s_fmaf-fma.c
index ff2de65a80..f448ef7121 100644
--- a/sysdeps/i386/i686/multiarch/s_fmaf-fma.c
+++ b/sysdeps/i386/i686/multiarch/s_fmaf-fma.c
@@ -1,5 +1,5 @@
/* FMA version of fmaf.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/s_fmaf.c b/sysdeps/i386/i686/multiarch/s_fmaf.c
index a4b86cf39e..1ebb6e975e 100644
--- a/sysdeps/i386/i686/multiarch/s_fmaf.c
+++ b/sysdeps/i386/i686/multiarch/s_fmaf.c
@@ -1,5 +1,5 @@
/* Multiple versions of fmaf.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -21,13 +21,14 @@
#include <math.h>
#include <init-arch.h>
+#include <libm-alias-float.h>
extern float __fmaf_ia32 (float x, float y, float z) attribute_hidden;
extern float __fmaf_fma (float x, float y, float z) attribute_hidden;
libm_ifunc (__fmaf,
HAS_ARCH_FEATURE (FMA_Usable) ? __fmaf_fma : __fmaf_ia32);
-weak_alias (__fmaf, fmaf)
+libm_alias_float (__fma, fma)
#define __fmaf __fmaf_ia32
diff --git a/sysdeps/i386/i686/multiarch/stpcpy-ia32.S b/sysdeps/i386/i686/multiarch/stpcpy-ia32.S
new file mode 100644
index 0000000000..5274471841
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/stpcpy-ia32.S
@@ -0,0 +1,39 @@
+/* stpcpy optimized for i686.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define __stpcpy __stpcpy_ia32
+
+# ifdef SHARED
+# undef libc_hidden_def
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_def(name) \
+ .globl __GI___stpcpy; __GI___stpcpy = __stpcpy
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_stpcpy; __GI_stpcpy = __stpcpy
+# endif
+
+# undef weak_alias
+# define weak_alias(original, alias)
+#endif
+
+#include <sysdeps/i386/i586/stpcpy.S>
diff --git a/sysdeps/i386/i686/multiarch/stpcpy.S b/sysdeps/i386/i686/multiarch/stpcpy.S
deleted file mode 100644
index ee81ab6ae3..0000000000
--- a/sysdeps/i386/i686/multiarch/stpcpy.S
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Multiple versions of stpcpy
- All versions must be listed in ifunc-impl-list.c. */
-#define USE_AS_STPCPY
-#define STRCPY __stpcpy
-#include "strcpy.S"
-
-weak_alias (__stpcpy, stpcpy)
-libc_hidden_def (__stpcpy)
-libc_hidden_builtin_def (stpcpy)
diff --git a/sysdeps/i386/i686/multiarch/stpcpy.c b/sysdeps/i386/i686/multiarch/stpcpy.c
new file mode 100644
index 0000000000..cb0c3fc00d
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/stpcpy.c
@@ -0,0 +1,36 @@
+/* Multiple versions of stpcpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define stpcpy __redirect_stpcpy
+# define __stpcpy __redirect___stpcpy
+# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
+# include <string.h>
+# undef stpcpy
+# undef __stpcpy
+
+# define SYMBOL_NAME stpcpy
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_stpcpy, __stpcpy, IFUNC_SELECTOR ());
+
+weak_alias (__stpcpy, stpcpy)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/stpncpy-ia32.S b/sysdeps/i386/i686/multiarch/stpncpy-ia32.S
new file mode 100644
index 0000000000..f13349b681
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/stpncpy-ia32.S
@@ -0,0 +1,37 @@
+/* stpncpy optimized for i686.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define __stpncpy __stpncpy_ia32
+
+# ifdef SHARED
+# undef libc_hidden_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_def(name) \
+ .globl __GI___stpncpy; __GI___stpncpy = __stpncpy
+
+# undef weak_alias
+# define weak_alias(original, alias)
+# endif
+
+#endif
+
+#include <sysdeps/i386/stpncpy.S>
diff --git a/sysdeps/i386/i686/multiarch/stpncpy.S b/sysdeps/i386/i686/multiarch/stpncpy.S
deleted file mode 100644
index 2698ca6a8c..0000000000
--- a/sysdeps/i386/i686/multiarch/stpncpy.S
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Multiple versions of stpncpy
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCPY __stpncpy
-#define USE_AS_STPCPY
-#define USE_AS_STRNCPY
-#include "strcpy.S"
-
-weak_alias (__stpncpy, stpncpy)
diff --git a/sysdeps/i386/i686/multiarch/stpncpy.c b/sysdeps/i386/i686/multiarch/stpncpy.c
new file mode 100644
index 0000000000..3558e09fd5
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/stpncpy.c
@@ -0,0 +1,34 @@
+/* Multiple versions of stpncpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define stpncpy __redirect_stpncpy
+# define __stpncpy __redirect___stpncpy
+# include <string.h>
+# undef stpncpy
+# undef __stpncpy
+
+# define SYMBOL_NAME stpncpy
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_stpncpy, __stpncpy, IFUNC_SELECTOR ());
+
+weak_alias (__stpncpy, stpncpy)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strcasecmp.S b/sysdeps/i386/i686/multiarch/strcasecmp.S
deleted file mode 100644
index 61f17718bc..0000000000
--- a/sysdeps/i386/i686/multiarch/strcasecmp.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Entry point for multi-version x86 strcasecmp.
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-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>
-#include <init-arch.h>
-
- .text
-ENTRY(__strcasecmp)
- .type __strcasecmp, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__strcasecmp_ia32)
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__strcasecmp_ssse3)
- HAS_CPU_FEATURE (SSE4_2)
- jz 2f
- HAS_ARCH_FEATURE (Slow_SSE4_2)
- jnz 2f
- LOAD_FUNC_GOT_EAX (__strcasecmp_sse4_2)
-2: ret
-END(__strcasecmp)
-
-weak_alias (__strcasecmp, strcasecmp)
diff --git a/sysdeps/i386/i686/multiarch/strcasecmp.c b/sysdeps/i386/i686/multiarch/strcasecmp.c
new file mode 100644
index 0000000000..cccb1ff5ad
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strcasecmp.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strcasecmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcasecmp __redirect_strcasecmp
+# define __strcasecmp __redirect___strcasecmp
+# include <string.h>
+# undef strcasecmp
+# undef __strcasecmp
+
+# define SYMBOL_NAME strcasecmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strcasecmp, __strcasecmp,
+ IFUNC_SELECTOR ());
+
+weak_alias (__strcasecmp, strcasecmp)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strcasecmp_l.S b/sysdeps/i386/i686/multiarch/strcasecmp_l.S
deleted file mode 100644
index 711c09b0dc..0000000000
--- a/sysdeps/i386/i686/multiarch/strcasecmp_l.S
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Multiple versions of strcasecmp_l
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCMP __strcasecmp_l
-#define USE_AS_STRCASECMP_L
-#include "strcmp.S"
-
-weak_alias (__strcasecmp_l, strcasecmp_l)
diff --git a/sysdeps/i386/i686/multiarch/strcasecmp_l.c b/sysdeps/i386/i686/multiarch/strcasecmp_l.c
new file mode 100644
index 0000000000..87eb4960da
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strcasecmp_l.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strcasecmp_l.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcasecmp_l __redirect_strcasecmp_l
+# define __strcasecmp_l __redirect___strcasecmp_l
+# include <string.h>
+# undef strcasecmp_l
+# undef __strcasecmp_l
+
+# define SYMBOL_NAME strcasecmp_l
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strcasecmp_l, __strcasecmp_l,
+ IFUNC_SELECTOR ());
+
+weak_alias (__strcasecmp_l, strcasecmp_l)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strcat-ia32.S b/sysdeps/i386/i686/multiarch/strcat-ia32.S
new file mode 100644
index 0000000000..40fb703c1e
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strcat-ia32.S
@@ -0,0 +1,33 @@
+/* strcat optimized for i686.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strcat __strcat_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strcat; __GI_strcat = strcat
+# endif
+#endif
+
+#include <sysdeps/i386/strcat.S>
diff --git a/sysdeps/i386/i686/multiarch/strcat-sse2.S b/sysdeps/i386/i686/multiarch/strcat-sse2.S
index 924d1663c6..19d5f5f65d 100644
--- a/sysdeps/i386/i686/multiarch/strcat-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strcat-sse2.S
@@ -1,5 +1,5 @@
/* strcat with SSE2
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -34,7 +34,7 @@
# define PUSH(REG) pushl REG; CFI_PUSH (REG)
# define POP(REG) popl REG; CFI_POP (REG)
-# ifdef SHARED
+# ifdef PIC
# define JMPTBL(I, B) I - B
/* Load an entry in a jump table into ECX and branch to it. TABLE is a
@@ -50,7 +50,7 @@
absolute address. */ \
addl (%ecx,INDEX,SCALE), %ecx; \
/* We loaded the jump table and adjusted ECX. Go. */ \
- jmp *%ecx
+ _CET_NOTRACK jmp *%ecx
# else
# define JMPTBL(I, B) I
@@ -59,7 +59,7 @@
jump table. SCALE is the scale of INDEX. */
# define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
- jmp *TABLE(,INDEX,SCALE)
+ _CET_NOTRACK jmp *TABLE(,INDEX,SCALE)
# endif
# ifndef STRCAT
@@ -227,6 +227,8 @@ L(StartStrcpyPart):
pxor %xmm0, %xmm0
# ifdef USE_AS_STRNCAT
add %ecx, %ebx
+ sbb %edx, %edx
+ or %edx, %ebx
# endif
sub %ecx, %eax
jmp L(Unalign16Both)
diff --git a/sysdeps/i386/i686/multiarch/strcat-ssse3.S b/sysdeps/i386/i686/multiarch/strcat-ssse3.S
index ab2f8842a0..13ee7abf6d 100644
--- a/sysdeps/i386/i686/multiarch/strcat-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/strcat-ssse3.S
@@ -1,5 +1,5 @@
/* strcat with SSSE3
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/strcat.S b/sysdeps/i386/i686/multiarch/strcat.S
deleted file mode 100644
index d8f4132cf3..0000000000
--- a/sysdeps/i386/i686/multiarch/strcat.S
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Multiple versions of strcat
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#ifndef USE_AS_STRNCAT
-# ifndef STRCAT
-# define STRCAT strcat
-# endif
-#endif
-
-#ifdef USE_AS_STRNCAT
-# define STRCAT_SSSE3 __strncat_ssse3
-# define STRCAT_SSE2 __strncat_sse2
-# define STRCAT_IA32 __strncat_ia32
-# define __GI_STRCAT __GI_strncat
-#else
-# define STRCAT_SSSE3 __strcat_ssse3
-# define STRCAT_SSE2 __strcat_sse2
-# define STRCAT_IA32 __strcat_ia32
-# define __GI_STRCAT __GI_strcat
-#endif
-
-
-/* Define multiple versions only for the definition in libc. Don't
- define multiple versions for strncat in static library since we
- need strncat before the initialization happened. */
-#if IS_IN (libc)
-
- .text
-ENTRY(STRCAT)
- .type STRCAT, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (STRCAT_IA32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (STRCAT_SSE2)
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (STRCAT_SSSE3)
-2: ret
-END(STRCAT)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type STRCAT_IA32, @function; \
- .align 16; \
- .globl STRCAT_IA32; \
- .hidden STRCAT_IA32; \
- STRCAT_IA32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size STRCAT_IA32, .-STRCAT_IA32
-
-# ifdef SHARED
-# undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal strcat calls through a PLT.
- The speedup we get from using SSSE3 instruction is likely eaten away
- by the indirect call in the PLT. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_STRCAT; __GI_STRCAT = STRCAT_IA32
-# undef libc_hidden_def
-# define libc_hidden_def(name) \
- .globl __GI___STRCAT; __GI___STRCAT = STRCAT_IA32
-
-# endif
-#endif
-
-#ifndef USE_AS_STRNCAT
-# include "../../strcat.S"
-#endif
diff --git a/sysdeps/i386/i686/multiarch/strcat.c b/sysdeps/i386/i686/multiarch/strcat.c
new file mode 100644
index 0000000000..646539f5fc
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strcat.c
@@ -0,0 +1,30 @@
+/* Multiple versions of strcat.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcat __redirect_strcat
+# include <string.h>
+# undef strcat
+
+# define SYMBOL_NAME strcat
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strcat, strcat, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strchr-ia32.S b/sysdeps/i386/i686/multiarch/strchr-ia32.S
new file mode 100644
index 0000000000..fb6dfe70c9
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strchr-ia32.S
@@ -0,0 +1,35 @@
+/* strchr optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strchr __strchr_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strchr; __GI_strchr = strchr
+# endif
+
+# undef weak_alias
+# define weak_alias(original, alias)
+#endif
+
+#include <sysdeps/i386/i586/strchr.S>
diff --git a/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S b/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
index 1b48f3314d..20dffe9d09 100644
--- a/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
+++ b/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
@@ -1,5 +1,5 @@
/* strchr with SSE2 with bsf
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/strchr-sse2.S b/sysdeps/i386/i686/multiarch/strchr-sse2.S
index b6680d1e7a..3aebeff0a0 100644
--- a/sysdeps/i386/i686/multiarch/strchr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strchr-sse2.S
@@ -1,5 +1,5 @@
/* strchr SSE2 without bsf
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/strchr.S b/sysdeps/i386/i686/multiarch/strchr.S
deleted file mode 100644
index 18ea87209f..0000000000
--- a/sysdeps/i386/i686/multiarch/strchr.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Multiple versions of strchr
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(strchr)
- .type strchr, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__strchr_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__strchr_sse2_bsf)
- HAS_ARCH_FEATURE (Slow_BSF)
- jz 2f
- LOAD_FUNC_GOT_EAX (__strchr_sse2)
-2: ret
-END(strchr)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __strchr_ia32, @function; \
- .globl __strchr_ia32; \
- .p2align 4; \
- __strchr_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __strchr_ia32, .-__strchr_ia32
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_strchr; __GI_strchr = __strchr_ia32
-#endif
-
-#include "../../i586/strchr.S"
diff --git a/sysdeps/i386/i686/multiarch/strchr.c b/sysdeps/i386/i686/multiarch/strchr.c
new file mode 100644
index 0000000000..f5b462df2e
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strchr.c
@@ -0,0 +1,32 @@
+/* Multiple versions of strchr.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strchr __redirect_strchr
+# include <string.h>
+# undef strchr
+
+# define SYMBOL_NAME strchr
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_strchr, strchr, IFUNC_SELECTOR ());
+
+weak_alias (strchr, index)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strcmp-ia32.S b/sysdeps/i386/i686/multiarch/strcmp-ia32.S
new file mode 100644
index 0000000000..92865591e4
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strcmp-ia32.S
@@ -0,0 +1,33 @@
+/* strcmp optimized for i686.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strcmp __strcmp_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strcmp; __GI_strcmp = strcmp
+# endif
+#endif
+
+#include <sysdeps/i386/i686/strcmp.S>
diff --git a/sysdeps/i386/i686/multiarch/strcmp-sse4.S b/sysdeps/i386/i686/multiarch/strcmp-sse4.S
index 89efb38a40..2d189496b4 100644
--- a/sysdeps/i386/i686/multiarch/strcmp-sse4.S
+++ b/sysdeps/i386/i686/multiarch/strcmp-sse4.S
@@ -1,5 +1,5 @@
/* strcmp with SSE4.2
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/strcmp-ssse3.S b/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
index 777f0b7edc..8847162d6e 100644
--- a/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
@@ -1,5 +1,5 @@
/* strcmp with SSSE3
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/strcmp.S b/sysdeps/i386/i686/multiarch/strcmp.S
deleted file mode 100644
index 41d539ecb9..0000000000
--- a/sysdeps/i386/i686/multiarch/strcmp.S
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Multiple versions of strcmp
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#ifdef USE_AS_STRNCMP
-# define STRCMP strncmp
-# define __GI_STRCMP __GI_strncmp
-# define __STRCMP_IA32 __strncmp_ia32
-# define __STRCMP_SSSE3 __strncmp_ssse3
-# define __STRCMP_SSE4_2 __strncmp_sse4_2
-#elif defined USE_AS_STRCASECMP_L
-# define STRCMP __strcasecmp_l
-# define __GI_STRCMP __GI_strcasecmp_l
-# define __STRCMP_IA32 __strcasecmp_l_ia32
-# define __STRCMP_SSSE3 __strcasecmp_l_ssse3
-# define __STRCMP_SSE4_2 __strcasecmp_l_sse4_2
-#elif defined USE_AS_STRNCASECMP_L
-# define STRCMP __strncasecmp_l
-# define __GI_STRCMP __GI_strncasecmp_l
-# define __STRCMP_IA32 __strncasecmp_l_ia32
-# define __STRCMP_SSSE3 __strncasecmp_l_ssse3
-# define __STRCMP_SSE4_2 __strncasecmp_l_sse4_2
-#else
-# define STRCMP strcmp
-# define __GI_STRCMP __GI_strcmp
-# define __STRCMP_IA32 __strcmp_ia32
-# define __STRCMP_SSSE3 __strcmp_ssse3
-# define __STRCMP_SSE4_2 __strcmp_sse4_2
-#endif
-
-/* Define multiple versions only for the definition in libc. Don't
- define multiple versions for strncmp in static library since we
- need strncmp before the initialization happened. */
-#if (defined SHARED || !defined USE_AS_STRNCMP) && IS_IN (libc)
- .text
-ENTRY(STRCMP)
- .type STRCMP, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__STRCMP_IA32)
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__STRCMP_SSSE3)
- HAS_CPU_FEATURE (SSE4_2)
- jz 2f
- HAS_ARCH_FEATURE (Slow_SSE4_2)
- jnz 2f
- LOAD_FUNC_GOT_EAX (__STRCMP_SSE4_2)
-2: ret
-END(STRCMP)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __STRCMP_IA32, @function; \
- .p2align 4; \
- .globl __STRCMP_IA32; \
- .hidden __STRCMP_IA32; \
- __STRCMP_IA32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __STRCMP_IA32, .-__STRCMP_IA32
-
-# ifdef SHARED
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_STRCMP; __GI_STRCMP = __STRCMP_IA32
-# endif
-#endif
-
-#if !defined USE_AS_STRNCMP && !defined USE_AS_STRCASECMP_L \
- && !defined USE_AS_STRNCASECMP_L
-# include "../strcmp.S"
-#endif
diff --git a/sysdeps/i386/i686/multiarch/strcmp.c b/sysdeps/i386/i686/multiarch/strcmp.c
new file mode 100644
index 0000000000..3268662518
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strcmp.c
@@ -0,0 +1,30 @@
+/* Multiple versions of strcmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcmp __redirect_strcmp
+# include <string.h>
+# undef strcmp
+
+# define SYMBOL_NAME strcmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strcmp, strcmp, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strcpy-ia32.S b/sysdeps/i386/i686/multiarch/strcpy-ia32.S
new file mode 100644
index 0000000000..1c50edffc9
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strcpy-ia32.S
@@ -0,0 +1,33 @@
+/* strcpy optimized for i686.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strcpy __strcpy_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strcpy; __GI_strcpy = strcpy
+# endif
+#endif
+
+#include <sysdeps/i386/i586/strcpy.S>
diff --git a/sysdeps/i386/i686/multiarch/strcpy-sse2.S b/sysdeps/i386/i686/multiarch/strcpy-sse2.S
index 3baa559e01..3fc27d93d4 100644
--- a/sysdeps/i386/i686/multiarch/strcpy-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strcpy-sse2.S
@@ -1,5 +1,5 @@
/* strcpy with SSE2 and unaligned load
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -48,7 +48,7 @@
# define RETURN POP(%edi); POP(%esi); POP(%ebx); ret; \
CFI_PUSH(%ebx); CFI_PUSH(%esi); CFI_PUSH(%edi);
-# ifdef SHARED
+# ifdef PIC
# define JMPTBL(I, B) I - B
/* Load an entry in a jump table into ECX and branch to it. TABLE is a
@@ -65,7 +65,7 @@
absolute address. */ \
addl (%ecx,INDEX,SCALE), %ecx; \
/* We loaded the jump table and adjusted ECX. Go. */ \
- jmp *%ecx
+ _CET_NOTRACK jmp *%ecx
# else
# define JMPTBL(I, B) I
@@ -74,7 +74,7 @@
jump table. SCALE is the scale of INDEX. */
# define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
- jmp *TABLE(,INDEX,SCALE)
+ _CET_NOTRACK jmp *TABLE(,INDEX,SCALE)
# endif
.text
diff --git a/sysdeps/i386/i686/multiarch/strcpy-ssse3.S b/sysdeps/i386/i686/multiarch/strcpy-ssse3.S
index 10fda83e7b..5dda85530c 100644
--- a/sysdeps/i386/i686/multiarch/strcpy-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/strcpy-ssse3.S
@@ -1,5 +1,5 @@
/* strcpy with SSSE3
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/strcpy.S b/sysdeps/i386/i686/multiarch/strcpy.S
deleted file mode 100644
index 51525bc091..0000000000
--- a/sysdeps/i386/i686/multiarch/strcpy.S
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Multiple versions of strcpy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if !defined (USE_AS_STPCPY) && !defined (USE_AS_STRNCPY)
-# ifndef STRCPY
-# define STRCPY strcpy
-# endif
-#endif
-
-#ifdef USE_AS_STPCPY
-# ifdef USE_AS_STRNCPY
-# define STRCPY_SSSE3 __stpncpy_ssse3
-# define STRCPY_SSE2 __stpncpy_sse2
-# define STRCPY_IA32 __stpncpy_ia32
-# define __GI_STRCPY __GI_stpncpy
-# define __GI___STRCPY __GI___stpncpy
-# else
-# define STRCPY_SSSE3 __stpcpy_ssse3
-# define STRCPY_SSE2 __stpcpy_sse2
-# define STRCPY_IA32 __stpcpy_ia32
-# define __GI_STRCPY __GI_stpcpy
-# define __GI___STRCPY __GI___stpcpy
-# endif
-#else
-# ifdef USE_AS_STRNCPY
-# define STRCPY_SSSE3 __strncpy_ssse3
-# define STRCPY_SSE2 __strncpy_sse2
-# define STRCPY_IA32 __strncpy_ia32
-# define __GI_STRCPY __GI_strncpy
-# else
-# define STRCPY_SSSE3 __strcpy_ssse3
-# define STRCPY_SSE2 __strcpy_sse2
-# define STRCPY_IA32 __strcpy_ia32
-# define __GI_STRCPY __GI_strcpy
-# endif
-#endif
-
-
-/* Define multiple versions only for the definition in libc. Don't
- define multiple versions for strncpy in static library since we
- need strncpy before the initialization happened. */
-#if IS_IN (libc)
-
- .text
-ENTRY(STRCPY)
- .type STRCPY, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (STRCPY_IA32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (STRCPY_SSE2)
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (STRCPY_SSSE3)
-2: ret
-END(STRCPY)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type STRCPY_IA32, @function; \
- .align 16; \
- .globl STRCPY_IA32; \
- .hidden STRCPY_IA32; \
- STRCPY_IA32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size STRCPY_IA32, .-STRCPY_IA32
-
-# ifdef SHARED
-# undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal strcpy calls through a PLT.
- The speedup we get from using SSSE3 instruction is likely eaten away
- by the indirect call in the PLT. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_STRCPY; __GI_STRCPY = STRCPY_IA32
-# undef libc_hidden_def
-# define libc_hidden_def(name) \
- .globl __GI___STRCPY; __GI___STRCPY = STRCPY_IA32
-
-# endif
-#endif
-
-#ifdef USE_AS_STPCPY
-# ifdef USE_AS_STRNCPY
-# include "../../stpncpy.S"
-# else
-# include "../../i586/stpcpy.S"
-# endif
-#else
-# ifndef USE_AS_STRNCPY
-# include "../../i586/strcpy.S"
-# endif
-#endif
diff --git a/sysdeps/i386/i686/multiarch/strcpy.c b/sysdeps/i386/i686/multiarch/strcpy.c
new file mode 100644
index 0000000000..8c8769b152
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strcpy.c
@@ -0,0 +1,30 @@
+/* Multiple versions of strcpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcpy __redirect_strcpy
+# include <string.h>
+# undef strcpy
+
+# define SYMBOL_NAME strcpy
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strcpy, strcpy, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strcspn-c.c b/sysdeps/i386/i686/multiarch/strcspn-c.c
index 6d61e190a8..ec230fb383 100644
--- a/sysdeps/i386/i686/multiarch/strcspn-c.c
+++ b/sysdeps/i386/i686/multiarch/strcspn-c.c
@@ -1,2 +1,4 @@
-#define __strcspn_sse2 __strcspn_ia32
-#include <sysdeps/x86_64/multiarch/strcspn-c.c>
+#if IS_IN (libc)
+# define __strcspn_sse2 __strcspn_ia32
+# include <sysdeps/x86_64/multiarch/strcspn-c.c>
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strcspn-ia32.S b/sysdeps/i386/i686/multiarch/strcspn-ia32.S
new file mode 100644
index 0000000000..b31f5943d0
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strcspn-ia32.S
@@ -0,0 +1,33 @@
+/* strcspn optimized for i686.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strcspn __strcspn_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strcspn; __GI_strcspn = strcspn
+# endif
+#endif
+
+#include <sysdeps/i386/strcspn.S>
diff --git a/sysdeps/i386/i686/multiarch/strcspn.S b/sysdeps/i386/i686/multiarch/strcspn.S
deleted file mode 100644
index 4a7b177727..0000000000
--- a/sysdeps/i386/i686/multiarch/strcspn.S
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Multiple versions of strcspn
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-#include <sysdep.h>
-#include <init-arch.h>
-
-#ifdef USE_AS_STRPBRK
-#define STRCSPN_SSE42 __strpbrk_sse42
-#define STRCSPN_IA32 __strpbrk_ia32
-#define __GI_STRCSPN __GI_strpbrk
-#else
-#ifndef STRCSPN
-#define STRCSPN strcspn
-#define STRCSPN_SSE42 __strcspn_sse42
-#define STRCSPN_IA32 __strcspn_ia32
-#define __GI_STRCSPN __GI_strcspn
-#endif
-#endif
-
-/* Define multiple versions only for the definition in libc. Don't
- define multiple versions for strpbrk in static library since we
- need strpbrk before the initialization happened. */
-#if (defined SHARED || !defined USE_AS_STRPBRK) && IS_IN (libc)
- .text
-ENTRY(STRCSPN)
- .type STRCSPN, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (STRCSPN_IA32)
- HAS_CPU_FEATURE (SSE4_2)
- jz 2f
- LOAD_FUNC_GOT_EAX (STRCSPN_SSE42)
-2: ret
-END(STRCSPN)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type STRCSPN_IA32, @function; \
- .globl STRCSPN_IA32; \
- .p2align 4; \
- STRCSPN_IA32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size STRCSPN_IA32, .-STRCSPN_IA32
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_STRCSPN; __GI_STRCSPN = STRCSPN_IA32
-#endif
-
-#ifdef USE_AS_STRPBRK
-#include "../../strpbrk.S"
-#else
-#include "../../strcspn.S"
-#endif
diff --git a/sysdeps/i386/i686/multiarch/strcspn.c b/sysdeps/i386/i686/multiarch/strcspn.c
new file mode 100644
index 0000000000..852773b268
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strcspn.c
@@ -0,0 +1,30 @@
+/* Multiple versions of strcspn.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcspn __redirect_strcspn
+# include <string.h>
+# undef strcspn
+
+# define SYMBOL_NAME strcspn
+# include "ifunc-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strcspn, strcspn, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strlen-ia32.S b/sysdeps/i386/i686/multiarch/strlen-ia32.S
new file mode 100644
index 0000000000..1f2ad355e8
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strlen-ia32.S
@@ -0,0 +1,30 @@
+/* strlen optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if defined SHARED && IS_IN (libc)
+# define strlen __strlen_ia32
+
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strlen; __GI_strlen = strlen
+#endif
+
+#include <sysdeps/i386/i586/strlen.S>
diff --git a/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S b/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
index e4a82495ec..52ec1fbf72 100644
--- a/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
+++ b/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
@@ -1,5 +1,5 @@
/* strlen with SSE2 and BSF
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/strlen-sse2.S b/sysdeps/i386/i686/multiarch/strlen-sse2.S
index f7724f8a51..d5adf2810a 100644
--- a/sysdeps/i386/i686/multiarch/strlen-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strlen-sse2.S
@@ -1,5 +1,5 @@
/* strlen with SSE2
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/strlen.S b/sysdeps/i386/i686/multiarch/strlen.S
deleted file mode 100644
index 0218947c49..0000000000
--- a/sysdeps/i386/i686/multiarch/strlen.S
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Multiple versions of strlen
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc and for the
- DSO. In static binaries, we need strlen before the initialization
- happened. */
-#if defined SHARED && IS_IN (libc)
- .text
-ENTRY(strlen)
- .type strlen, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__strlen_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__strlen_sse2_bsf)
- HAS_ARCH_FEATURE (Slow_BSF)
- jz 2f
- LOAD_FUNC_GOT_EAX (__strlen_sse2)
-2: ret
-END(strlen)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __strlen_ia32, @function; \
- .globl __strlen_ia32; \
- .p2align 4; \
- __strlen_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __strlen_ia32, .-__strlen_ia32
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_strlen; __GI_strlen = __strlen_ia32
-#endif
-
-#include "../../i586/strlen.S"
diff --git a/sysdeps/i386/i686/multiarch/strlen.c b/sysdeps/i386/i686/multiarch/strlen.c
new file mode 100644
index 0000000000..02b97ddbb9
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strlen.c
@@ -0,0 +1,30 @@
+/* Multiple versions of strlen.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc.so. */
+#if defined SHARED && IS_IN (libc)
+# define strlen __redirect_strlen
+# include <string.h>
+# undef strlen
+
+# define SYMBOL_NAME strlen
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_strlen, strlen, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strncase.S b/sysdeps/i386/i686/multiarch/strncase.S
deleted file mode 100644
index 52d4ba5a2a..0000000000
--- a/sysdeps/i386/i686/multiarch/strncase.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Entry point for multi-version x86 strncasecmp.
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-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>
-#include <init-arch.h>
-
- .text
-ENTRY(__strncasecmp)
- .type __strncasecmp, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__strncasecmp_ia32)
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__strncasecmp_ssse3)
- HAS_CPU_FEATURE (SSE4_2)
- jz 2f
- HAS_ARCH_FEATURE (Slow_SSE4_2)
- jnz 2f
- LOAD_FUNC_GOT_EAX (__strncasecmp_sse4_2)
-2: ret
-END(__strncasecmp)
-
-weak_alias (__strncasecmp, strncasecmp)
diff --git a/sysdeps/i386/i686/multiarch/strncase.c b/sysdeps/i386/i686/multiarch/strncase.c
new file mode 100644
index 0000000000..12c3b82e12
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strncase.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strncasecmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strncasecmp __redirect_strncasecmp
+# define __strncasecmp __redirect___strncasecmp
+# include <string.h>
+# undef strncasecmp
+# undef __strncasecmp
+
+# define SYMBOL_NAME strncasecmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strncasecmp, __strncasecmp,
+ IFUNC_SELECTOR ());
+
+weak_alias (__strncasecmp, strncasecmp)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strncase_l.S b/sysdeps/i386/i686/multiarch/strncase_l.S
deleted file mode 100644
index 8a74ee8574..0000000000
--- a/sysdeps/i386/i686/multiarch/strncase_l.S
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Multiple versions of strncasecmp_l
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCMP __strncasecmp_l
-#define USE_AS_STRNCASECMP_L
-#include "strcmp.S"
-
-weak_alias (__strncasecmp_l, strncasecmp_l)
diff --git a/sysdeps/i386/i686/multiarch/strncase_l.c b/sysdeps/i386/i686/multiarch/strncase_l.c
new file mode 100644
index 0000000000..fa4d47a2c9
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strncase_l.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strncasecmp_l.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strncasecmp_l __redirect_strncasecmp_l
+# define __strncasecmp_l __redirect___strncasecmp_l
+# include <string.h>
+# undef strncasecmp_l
+# undef __strncasecmp_l
+
+# define SYMBOL_NAME strncasecmp_l
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strncasecmp_l, __strncasecmp_l,
+ IFUNC_SELECTOR ());
+
+weak_alias (__strncasecmp_l, strncasecmp_l)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strncat-c.c b/sysdeps/i386/i686/multiarch/strncat-c.c
index 132a000545..aa58a61846 100644
--- a/sysdeps/i386/i686/multiarch/strncat-c.c
+++ b/sysdeps/i386/i686/multiarch/strncat-c.c
@@ -1,8 +1,3 @@
#define STRNCAT __strncat_ia32
-#ifdef SHARED
-#undef libc_hidden_def
-#define libc_hidden_def(name) \
- __hidden_ver1 (__strncat_ia32, __GI___strncat, __strncat_ia32);
-#endif
-
+#define STRNCAT_PRIMARY
#include "string/strncat.c"
diff --git a/sysdeps/i386/i686/multiarch/strncat.S b/sysdeps/i386/i686/multiarch/strncat.S
deleted file mode 100644
index 5c1bf41453..0000000000
--- a/sysdeps/i386/i686/multiarch/strncat.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strncat
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCAT strncat
-#define USE_AS_STRNCAT
-#include "strcat.S"
diff --git a/sysdeps/i386/i686/multiarch/strncat.c b/sysdeps/i386/i686/multiarch/strncat.c
new file mode 100644
index 0000000000..479e74901b
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strncat.c
@@ -0,0 +1,30 @@
+/* Multiple versions of strcat.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strncat __redirect_strncat
+# include <string.h>
+# undef strncat
+
+# define SYMBOL_NAME strncat
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strncat, strncat, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strncmp-c.c b/sysdeps/i386/i686/multiarch/strncmp-c.c
index cc059da494..2e3eca9b2b 100644
--- a/sysdeps/i386/i686/multiarch/strncmp-c.c
+++ b/sysdeps/i386/i686/multiarch/strncmp-c.c
@@ -1,4 +1,4 @@
-#ifdef SHARED
+#if defined (SHARED) && IS_IN (libc)
# define STRNCMP __strncmp_ia32
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name) \
diff --git a/sysdeps/i386/i686/multiarch/strncmp.S b/sysdeps/i386/i686/multiarch/strncmp.S
deleted file mode 100644
index 150d4786d2..0000000000
--- a/sysdeps/i386/i686/multiarch/strncmp.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strncmp
- All versions must be listed in ifunc-impl-list.c. */
-#define USE_AS_STRNCMP
-#define STRCMP strncmp
-#include "strcmp.S"
diff --git a/sysdeps/i386/i686/multiarch/strncmp.c b/sysdeps/i386/i686/multiarch/strncmp.c
new file mode 100644
index 0000000000..b75c8dd557
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strncmp.c
@@ -0,0 +1,30 @@
+/* Multiple versions of strncmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc.so. */
+#if defined SHARED && IS_IN (libc)
+# define strncmp __redirect_strncmp
+# include <string.h>
+# undef strncmp
+
+# define SYMBOL_NAME strncmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strncmp, strncmp, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strncpy.S b/sysdeps/i386/i686/multiarch/strncpy.S
deleted file mode 100644
index 9c257efc6e..0000000000
--- a/sysdeps/i386/i686/multiarch/strncpy.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strncpy
- All versions must be listed in ifunc-impl-list.c. */
-#define USE_AS_STRNCPY
-#define STRCPY strncpy
-#include "strcpy.S"
diff --git a/sysdeps/i386/i686/multiarch/strncpy.c b/sysdeps/i386/i686/multiarch/strncpy.c
new file mode 100644
index 0000000000..80165aa957
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strncpy.c
@@ -0,0 +1,30 @@
+/* Multiple versions of strncpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strncpy __redirect_strncpy
+# include <string.h>
+# undef strncpy
+
+# define SYMBOL_NAME strncpy
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strncpy, strncpy, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strnlen.S b/sysdeps/i386/i686/multiarch/strnlen.S
deleted file mode 100644
index e77562d2cf..0000000000
--- a/sysdeps/i386/i686/multiarch/strnlen.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of strnlen
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(__strnlen)
- .type __strnlen, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__strnlen_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__strnlen_sse2)
-2: ret
-END(__strnlen)
-
-weak_alias(__strnlen, strnlen)
-#endif
diff --git a/sysdeps/i386/i686/multiarch/strnlen.c b/sysdeps/i386/i686/multiarch/strnlen.c
new file mode 100644
index 0000000000..916cd6ebf0
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strnlen.c
@@ -0,0 +1,34 @@
+/* Multiple versions of strnlen.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strnlen __redirect_strnlen
+# define __strnlen __redirect___strnlen
+# include <string.h>
+# undef __strnlen
+# undef strnlen
+
+# define SYMBOL_NAME strnlen
+# include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_strnlen, __strnlen, IFUNC_SELECTOR ());
+
+weak_alias (__strnlen, strnlen);
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strpbrk-ia32.S b/sysdeps/i386/i686/multiarch/strpbrk-ia32.S
new file mode 100644
index 0000000000..4c85c94f03
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strpbrk-ia32.S
@@ -0,0 +1,33 @@
+/* strpbrk optimized for i686.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strpbrk __strpbrk_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strpbrk; __GI_strpbrk = strpbrk
+# endif
+#endif
+
+#include <sysdeps/i386/strpbrk.S>
diff --git a/sysdeps/i386/i686/multiarch/strpbrk.S b/sysdeps/i386/i686/multiarch/strpbrk.S
deleted file mode 100644
index 7201d6376f..0000000000
--- a/sysdeps/i386/i686/multiarch/strpbrk.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strpbrk
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCSPN strpbrk
-#define USE_AS_STRPBRK
-#include "strcspn.S"
diff --git a/sysdeps/i386/i686/multiarch/strpbrk.c b/sysdeps/i386/i686/multiarch/strpbrk.c
new file mode 100644
index 0000000000..af609f5d4b
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strpbrk.c
@@ -0,0 +1,30 @@
+/* Multiple versions of strpbrk.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strpbrk __redirect_strpbrk
+# include <string.h>
+# undef strpbrk
+
+# define SYMBOL_NAME strpbrk
+# include "ifunc-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strpbrk, strpbrk, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strrchr-ia32.S b/sysdeps/i386/i686/multiarch/strrchr-ia32.S
new file mode 100644
index 0000000000..ada7248e28
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strrchr-ia32.S
@@ -0,0 +1,35 @@
+/* strrchr optimized for i686.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strrchr __strrchr_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strrchr; __GI_strrchr = strrchr
+# endif
+
+# undef weak_alias
+# define weak_alias(original, alias)
+#endif
+
+#include <sysdeps/i386/strrchr.S>
diff --git a/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S b/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S
index e2713ca3fe..59e7abc7bd 100644
--- a/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S
+++ b/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S
@@ -1,5 +1,5 @@
/* strrchr with SSE2 with bsf and bsr
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/strrchr-sse2.S b/sysdeps/i386/i686/multiarch/strrchr-sse2.S
index a0c536a5e2..bcb59bdb88 100644
--- a/sysdeps/i386/i686/multiarch/strrchr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strrchr-sse2.S
@@ -1,5 +1,5 @@
/* strrchr SSE2 without bsf and bsr
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/strrchr.S b/sysdeps/i386/i686/multiarch/strrchr.S
deleted file mode 100644
index 39305760e9..0000000000
--- a/sysdeps/i386/i686/multiarch/strrchr.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Multiple versions of strrchr
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(strrchr)
- .type strrchr, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__strrchr_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__strrchr_sse2_bsf)
- HAS_ARCH_FEATURE (Slow_BSF)
- jz 2f
- LOAD_FUNC_GOT_EAX (__strrchr_sse2)
-2: ret
-END(strrchr)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __strrchr_ia32, @function; \
- .globl __strrchr_ia32; \
- .p2align 4; \
- __strrchr_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __strrchr_ia32, .-__strrchr_ia32
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_strrchr; __GI_strrchr = __strrchr_ia32
-#endif
-
-#include "../../strrchr.S"
diff --git a/sysdeps/i386/i686/multiarch/strrchr.c b/sysdeps/i386/i686/multiarch/strrchr.c
new file mode 100644
index 0000000000..1edb7b90f1
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strrchr.c
@@ -0,0 +1,32 @@
+/* Multiple versions of strrchr.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strrchr __redirect_strrchr
+# include <string.h>
+# undef strrchr
+
+# define SYMBOL_NAME strrchr
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_strrchr, strrchr, IFUNC_SELECTOR ());
+
+weak_alias (strrchr, rindex)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strspn-ia32.S b/sysdeps/i386/i686/multiarch/strspn-ia32.S
new file mode 100644
index 0000000000..f3b60479dd
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strspn-ia32.S
@@ -0,0 +1,33 @@
+/* strspn optimized for i686.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strspn __strspn_ia32
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_strspn; __GI_strspn = strspn
+# endif
+#endif
+
+#include <sysdeps/i386/strspn.S>
diff --git a/sysdeps/i386/i686/multiarch/strspn.S b/sysdeps/i386/i686/multiarch/strspn.S
deleted file mode 100644
index 6ed4861efe..0000000000
--- a/sysdeps/i386/i686/multiarch/strspn.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Multiple versions of strspn
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
- .text
-ENTRY(strspn)
- .type strspn, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__strspn_ia32)
- HAS_CPU_FEATURE (SSE4_2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__strspn_sse42)
-2: ret
-END(strspn)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __strspn_ia32, @function; \
- .globl __strspn_ia32; \
- .p2align 4; \
-__strspn_ia32: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __strspn_ia32, .-__strspn_ia32
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_strspn; __GI_strspn = __strspn_ia32
-#endif
-
-#include "../../strspn.S"
diff --git a/sysdeps/i386/i686/multiarch/strspn.c b/sysdeps/i386/i686/multiarch/strspn.c
new file mode 100644
index 0000000000..3f3f08d7a3
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strspn.c
@@ -0,0 +1,30 @@
+/* Multiple versions of strspn.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strspn __redirect_strspn
+# include <string.h>
+# undef strspn
+
+# define SYMBOL_NAME strspn
+# include "ifunc-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strspn, strspn, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/varshift.c b/sysdeps/i386/i686/multiarch/varshift.c
index 7760b966e2..6742a35d41 100644
--- a/sysdeps/i386/i686/multiarch/varshift.c
+++ b/sysdeps/i386/i686/multiarch/varshift.c
@@ -1 +1,3 @@
-#include <sysdeps/x86_64/multiarch/varshift.c>
+#if IS_IN (libc)
+# include <sysdeps/x86_64/multiarch/varshift.c>
+#endif
diff --git a/sysdeps/i386/i686/multiarch/wcschr-sse2.S b/sysdeps/i386/i686/multiarch/wcschr-sse2.S
index 4bcc553569..3b0f813617 100644
--- a/sysdeps/i386/i686/multiarch/wcschr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/wcschr-sse2.S
@@ -1,5 +1,5 @@
/* wcschr with SSE2, without using bsf instructions
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/wcschr.S b/sysdeps/i386/i686/multiarch/wcschr.S
deleted file mode 100644
index b7f50e46ea..0000000000
--- a/sysdeps/i386/i686/multiarch/wcschr.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of wcschr
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(__wcschr)
- .type wcschr, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__wcschr_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__wcschr_sse2)
-2: ret
-END(__wcschr)
-weak_alias (__wcschr, wcschr)
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcschr.c b/sysdeps/i386/i686/multiarch/wcschr.c
new file mode 100644
index 0000000000..71446b4cf6
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/wcschr.c
@@ -0,0 +1,33 @@
+/* Multiple versions of wcschr.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wcschr __redirect_wcschr
+# define __wcschr __redirect___wcschr
+# include <wchar.h>
+# undef wcschr
+# undef __wcschr
+
+# define SYMBOL_NAME wcschr
+# include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_wcschr, __wcschr, IFUNC_SELECTOR ());
+weak_alias (__wcschr, wcschr);
+#endif
diff --git a/sysdeps/i386/i686/multiarch/wcscmp-sse2.S b/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
index ff57063b9b..00205b50fe 100644
--- a/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
+++ b/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
@@ -1,5 +1,5 @@
/* wcscmp with SSE2
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/wcscmp.S b/sysdeps/i386/i686/multiarch/wcscmp.S
deleted file mode 100644
index c7d7d51bdd..0000000000
--- a/sysdeps/i386/i686/multiarch/wcscmp.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Multiple versions of wcscmp
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc and for the
- DSO. In static binaries, we need wcscmp before the initialization
- happened. */
-#if IS_IN (libc)
- .text
-ENTRY(__wcscmp)
- .type __wcscmp, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__wcscmp_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__wcscmp_sse2)
-2: ret
-END(__wcscmp)
-weak_alias (__wcscmp, wcscmp)
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcscmp.c b/sysdeps/i386/i686/multiarch/wcscmp.c
new file mode 100644
index 0000000000..504806884b
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/wcscmp.c
@@ -0,0 +1,33 @@
+/* Multiple versions of wcscmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wcscmp __redirect_wcscmp
+# define __wcscmp __redirect___wcscmp
+# include <wchar.h>
+# undef wcscmp
+# undef __wcscmp
+
+# define SYMBOL_NAME wcscmp
+# include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_wcscmp, __wcscmp, IFUNC_SELECTOR ());
+weak_alias (__wcscmp, wcscmp);
+#endif
diff --git a/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S b/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S
index 09e538369f..f01b9f7c82 100644
--- a/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/wcscpy-ssse3.S
@@ -1,5 +1,5 @@
/* wcscpy with SSSE3
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/wcscpy.S b/sysdeps/i386/i686/multiarch/wcscpy.S
deleted file mode 100644
index 345511530c..0000000000
--- a/sysdeps/i386/i686/multiarch/wcscpy.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of wcscpy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
- .text
-ENTRY(wcscpy)
- .type wcscpy, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__wcscpy_ia32)
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__wcscpy_ssse3)
-2: ret
-END(wcscpy)
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcscpy.c b/sysdeps/i386/i686/multiarch/wcscpy.c
new file mode 100644
index 0000000000..be89ab81b0
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/wcscpy.c
@@ -0,0 +1,44 @@
+/* Multiple versions of wcscpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wcscpy __redirect_wcscpy
+# include <wchar.h>
+# undef wcscpy
+
+# define SYMBOL_NAME wcscpy
+#include <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+ return OPTIMIZE (ssse3);
+
+ return OPTIMIZE (ia32);
+}
+
+libc_ifunc_redirected (__redirect_wcscpy, wcscpy, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen-sse2.S b/sysdeps/i386/i686/multiarch/wcslen-sse2.S
index 897debb122..d0a0fbb3bf 100644
--- a/sysdeps/i386/i686/multiarch/wcslen-sse2.S
+++ b/sysdeps/i386/i686/multiarch/wcslen-sse2.S
@@ -1,5 +1,5 @@
/* wcslen with SSE2
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/wcslen.S
deleted file mode 100644
index 42e0c6b2c0..0000000000
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of wcslen
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(__wcslen)
- .type __wcslen, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__wcslen_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2: ret
-END(__wcslen)
-
-weak_alias(__wcslen, wcslen)
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.c b/sysdeps/i386/i686/multiarch/wcslen.c
new file mode 100644
index 0000000000..9f1b238a44
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/wcslen.c
@@ -0,0 +1,31 @@
+/* Multiple versions of wcslen.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define __wcslen __redirect_wcslen
+# include <wchar.h>
+# undef __wcslen
+
+# define SYMBOL_NAME wcslen
+# include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_wcslen, __wcslen, IFUNC_SELECTOR ());
+weak_alias (__wcslen, wcslen);
+#endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S b/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S
index e68004204a..7dfcd57b6d 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S
+++ b/sysdeps/i386/i686/multiarch/wcsrchr-sse2.S
@@ -1,5 +1,5 @@
/* wcsrchr with SSE2, without using bsf instructions.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/wcsrchr.S
deleted file mode 100644
index 5c9d8f7b5d..0000000000
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Multiple versions of wcsrchr
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(wcsrchr)
- .type wcsrchr, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2: ret
-END(wcsrchr)
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.c b/sysdeps/i386/i686/multiarch/wcsrchr.c
new file mode 100644
index 0000000000..4c39b5d906
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/wcsrchr.c
@@ -0,0 +1,30 @@
+/* Multiple versions of wcsrchr.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wcsrchr __redirect_wcsrchr
+# include <wchar.h>
+# undef wcsrchr
+
+# define SYMBOL_NAME wcsrchr
+# include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_wcsrchr, wcsrchr, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/multiarch/wmemcmp.S b/sysdeps/i386/i686/multiarch/wmemcmp.S
deleted file mode 100644
index ada6c693cb..0000000000
--- a/sysdeps/i386/i686/multiarch/wmemcmp.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Multiple versions of wmemcmp
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc. */
-
-#if IS_IN (libc)
- .text
-ENTRY(wmemcmp)
- .type wmemcmp, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__wmemcmp_ia32)
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- LOAD_FUNC_GOT_EAX (__wmemcmp_ssse3)
- HAS_CPU_FEATURE (SSE4_2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__wmemcmp_sse4_2)
-2: ret
-END(wmemcmp)
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wmemcmp.c b/sysdeps/i386/i686/multiarch/wmemcmp.c
new file mode 100644
index 0000000000..47f133b50e
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/wmemcmp.c
@@ -0,0 +1,30 @@
+/* Multiple versions of wmemcmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wmemcmp __redirect_wmemcmp
+# include <wchar.h>
+# undef wmemcmp
+
+# define SYMBOL_NAME wmemcmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_wmemcmp, wmemcmp, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/i386/i686/nptl/tls.h b/sysdeps/i386/i686/nptl/tls.h
index 06f425d5c1..b4945cbb42 100644
--- a/sysdeps/i386/i686/nptl/tls.h
+++ b/sysdeps/i386/i686/nptl/tls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/i386/i686/pthread_spin_trylock.S b/sysdeps/i386/i686/pthread_spin_trylock.S
index 52af4b34d6..bb738f18e0 100644
--- a/sysdeps/i386/i686/pthread_spin_trylock.S
+++ b/sysdeps/i386/i686/pthread_spin_trylock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/i386/i686/stack-aliasing.h b/sysdeps/i386/i686/stack-aliasing.h
index cbe276dc76..9ccb9d07e9 100644
--- a/sysdeps/i386/i686/stack-aliasing.h
+++ b/sysdeps/i386/i686/stack-aliasing.h
@@ -1,5 +1,5 @@
/* Define macros for stack address aliasing issues for NPTL. i686 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,11 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* It turns out that stack coloring is in general not good on P4s. Some
- applications will benefit. We will probably have a configuration option
- at some point. To enable coloring, set this to 128. */
-#define COLORING_INCREMENT 0
-
/* What is useful is to avoid the 64k aliasing problem which reliably
happens if all stacks use sizes which are a multiple of 64k. Tell
the stack allocator to disturb this by allocation one more page if
diff --git a/sysdeps/i386/i686/strcmp.S b/sysdeps/i386/i686/strcmp.S
index 0507bc4214..c98e175dcb 100644
--- a/sysdeps/i386/i686/strcmp.S
+++ b/sysdeps/i386/i686/strcmp.S
@@ -1,5 +1,5 @@
/* Highly optimized version for ix86, x>=6.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
diff --git a/sysdeps/i386/i686/strtok.S b/sysdeps/i386/i686/strtok.S
deleted file mode 100644
index 90b2fd6301..0000000000
--- a/sysdeps/i386/i686/strtok.S
+++ /dev/null
@@ -1,244 +0,0 @@
-/* strtok (str, delim) -- Return next DELIM separated token from STR.
- For Intel 80686.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 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/>. */
-
-#include <sysdep.h>
-#include "asm-syntax.h"
-
-/* This file can be used for three variants of the strtok function:
-
- strtok:
- INPUT PARAMETER:
- str (sp + 4)
- delim (sp + 8)
-
- strtok_r:
- INPUT PARAMETER:
- str (sp + 4)
- delim (sp + 8)
- save_ptr (sp + 12)
-
- We do a common implementation here. */
-
-#ifdef USE_AS_STRTOK_R
-# define SAVE_PTR 0(%ecx)
-#else
- .bss
- .local save_ptr
- .type save_ptr, @object
- .size save_ptr, 4
-save_ptr:
- .space 4
-
-# ifdef PIC
-# define SAVE_PTR save_ptr@GOTOFF(%ebx)
-# else
-# define SAVE_PTR save_ptr
-# endif
-
-# define FUNCTION strtok
-#endif
-
-#if !defined USE_AS_STRTOK_R && defined PIC
-# define PARMS 4+256+4 /* space for table and saved PIC register */
-#else
-# define PARMS 4+256 /* space for table */
-#endif
-#define RTN PARMS
-#define STR RTN
-#define DELIM STR+4
-#ifdef USE_AS_STRTOK_R
-# define SAVE DELIM+4
-#endif
-
- .text
-
-#if !defined USE_AS_STRTOK_R && defined PIC
-0: movl (%esp), %ebx
- ret
-#endif
-
-ENTRY (FUNCTION)
-
-#if !defined USE_AS_STRTOK_R && defined PIC
- pushl %ebx /* Save PIC register. */
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
- call 0b
- addl $_GLOBAL_OFFSET_TABLE_, %ebx
-#endif
-
- /* First we create a table with flags for all possible characters.
- For the ASCII (7bit/8bit) or ISO-8859-X character sets which are
- supported by the C string functions we have 256 characters.
- Before inserting marks for the stop characters we clear the whole
- table. */
- movl %edi, %edx
- subl $256, %esp
- cfi_adjust_cfa_offset (256)
- movl $64, %ecx
- movl %esp, %edi
- xorl %eax, %eax
- cld
- rep
- stosl
-
- /* Note: %ecx = 0 !!! */
- movl %edx, %edi
-
- movl STR(%esp), %edx /* Get start of string. */
-
-#ifdef USE_AS_STRTOK_R
- /* The value is stored in the third argument. */
- movl SAVE(%esp), %eax
- movl (%eax), %eax
-#else
- /* The value is in the local variable defined above. But
- we have to take care for PIC code. */
- movl SAVE_PTR, %eax
-#endif
-
- /* If the pointer is NULL we have to use the stored value of
- the last run. */
- cmpl $0, %edx
- cmove %eax, %edx
- testl %edx, %edx
- jz L(returnNULL)
- movl DELIM(%esp), %eax /* Get start of delimiter set. */
-
-/* For understanding the following code remember that %ecx == 0 now.
- Although all the following instruction only modify %cl we always
- have a correct zero-extended 32-bit value in %ecx. */
-
-L(2): movb (%eax), %cl /* get byte from stopset */
- testb %cl, %cl /* is NUL char? */
- jz L(1) /* yes => start compare loop */
- movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
-
- movb 1(%eax), %cl /* get byte from stopset */
- testb $0xff, %cl /* is NUL char? */
- jz L(1) /* yes => start compare loop */
- movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
-
- movb 2(%eax), %cl /* get byte from stopset */
- testb $0xff, %cl /* is NUL char? */
- jz L(1) /* yes => start compare loop */
- movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
-
- movb 3(%eax), %cl /* get byte from stopset */
- addl $4, %eax /* increment stopset pointer */
- movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
- testb $0xff, %cl /* is NUL char? */
- jnz L(2) /* no => process next dword from stopset */
-
-L(1): leal -4(%edx), %eax /* prepare loop */
-
- /* We use a neat trick for the following loop. Normally we would
- have to test for two termination conditions
- 1. a character in the stopset was found
- and
- 2. the end of the string was found
- As a sign that the character is in the stopset we store its
- value in the table. The value of NUL is NUL so the loop
- terminates for NUL in every case. */
-
-L(3): addl $4, %eax /* adjust pointer for full loop round */
-
- movb (%eax), %cl /* get byte from string */
- testb %cl, (%esp,%ecx) /* is it contained in stopset? */
- jz L(4) /* no => start of token */
-
- movb 1(%eax), %cl /* get byte from string */
- testb %cl, (%esp,%ecx) /* is it contained in stopset? */
- jz L(5) /* no => start of token */
-
- movb 2(%eax), %cl /* get byte from string */
- testb %cl, (%esp,%ecx) /* is it contained in stopset? */
- jz L(6) /* no => start of token */
-
- movb 3(%eax), %cl /* get byte from string */
- testb %cl, (%esp,%ecx) /* is it contained in stopset? */
- jnz L(3) /* yes => start of loop */
-
- incl %eax /* adjust pointer */
-L(6): incl %eax
-L(5): incl %eax
-
- /* Now we have to terminate the string. */
-
-L(4): leal -4(%eax), %edx /* We use %EDX for the next run. */
-
-L(7): addl $4, %edx /* adjust pointer for full loop round */
-
- movb (%edx), %cl /* get byte from string */
- cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */
- je L(8) /* yes => return */
-
- movb 1(%edx), %cl /* get byte from string */
- cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */
- je L(9) /* yes => return */
-
- movb 2(%edx), %cl /* get byte from string */
- cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */
- je L(10) /* yes => return */
-
- movb 3(%edx), %cl /* get byte from string */
- cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */
- jne L(7) /* no => start loop again */
-
- incl %edx /* adjust pointer */
-L(10): incl %edx
-L(9): incl %edx
-
-L(8): cmpl %eax, %edx
- je L(returnNULL) /* There was no token anymore. */
-
- movb $0, (%edx) /* Terminate string. */
-
- /* Are we at end of string? */
- cmpb $0, %cl
- leal 1(%edx), %ecx
- cmovne %ecx, %edx
-
- /* Store the pointer to the next character. */
-#ifdef USE_AS_STRTOK_R
- movl SAVE(%esp), %ecx
-#endif
- movl %edx, SAVE_PTR
-
-L(epilogue):
- /* Remove the stopset table. */
- addl $256, %esp
- cfi_adjust_cfa_offset (-256)
-#if !defined USE_AS_STRTOK_R && defined PIC
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#endif
- ret
-
-L(returnNULL):
- xorl %eax, %eax
-#ifdef USE_AS_STRTOK_R
- movl SAVE(%esp), %ecx
-#endif
- movl %edx, SAVE_PTR
- jmp L(epilogue)
-
-END (FUNCTION)
diff --git a/sysdeps/i386/i686/strtok_r.S b/sysdeps/i386/i686/strtok_r.S
deleted file mode 100644
index 353e076ba7..0000000000
--- a/sysdeps/i386/i686/strtok_r.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#define FUNCTION __strtok_r
-#define USE_AS_STRTOK_R 1
-#include <sysdeps/i386/i686/strtok.S>
-weak_alias (__strtok_r, strtok_r)
-strong_alias (__strtok_r, __GI___strtok_r)
diff --git a/sysdeps/i386/i686/tst-stack-align.h b/sysdeps/i386/i686/tst-stack-align.h
index 155d467ddb..975f26efd9 100644
--- a/sysdeps/i386/i686/tst-stack-align.h
+++ b/sysdeps/i386/i686/tst-stack-align.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/init-arch.h b/sysdeps/i386/init-arch.h
index 945352f252..043089ceb9 100644
--- a/sysdeps/i386/init-arch.h
+++ b/sysdeps/i386/init-arch.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/jmpbuf-offsets.h b/sysdeps/i386/jmpbuf-offsets.h
index 979d25c42f..7e1aed2224 100644
--- a/sysdeps/i386/jmpbuf-offsets.h
+++ b/sysdeps/i386/jmpbuf-offsets.h
@@ -1,5 +1,5 @@
/* Private macros for accessing __jmp_buf contents. i386 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/jmpbuf-unwind.h b/sysdeps/i386/jmpbuf-unwind.h
index 21c2191bcf..141a625c6a 100644
--- a/sysdeps/i386/jmpbuf-unwind.h
+++ b/sysdeps/i386/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/i386/ldbl2mpn.c b/sysdeps/i386/ldbl2mpn.c
index bf3353e406..8217f40f26 100644
--- a/sysdeps/i386/ldbl2mpn.c
+++ b/sysdeps/i386/ldbl2mpn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/ldsodefs.h b/sysdeps/i386/ldsodefs.h
deleted file mode 100644
index 8933ebd02e..0000000000
--- a/sysdeps/i386/ldsodefs.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Run-time dynamic linker data structures for loaded ELF shared objects.
- 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/>. */
-
-#ifndef _I386_LDSODEFS_H
-#define _I386_LDSODEFS_H 1
-
-#include <elf.h>
-#include <cpu-features.h>
-
-struct La_i86_regs;
-struct La_i86_retval;
-
-#define ARCH_PLTENTER_MEMBERS \
- Elf32_Addr (*i86_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \
- uintptr_t *, struct La_i86_regs *, \
- unsigned int *, const char *name, \
- long int *framesizep)
-
-#define ARCH_PLTEXIT_MEMBERS \
- unsigned int (*i86_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *, \
- uintptr_t *, const struct La_i86_regs *, \
- struct La_i86_retval *, const char *)
-
-#include_next <ldsodefs.h>
-
-#endif
diff --git a/sysdeps/i386/lshift.S b/sysdeps/i386/lshift.S
index ca292af979..2dce7c09dd 100644
--- a/sysdeps/i386/lshift.S
+++ b/sysdeps/i386/lshift.S
@@ -1,5 +1,5 @@
/* i80386 __mpn_lshift --
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/i386/machine-gmon.h b/sysdeps/i386/machine-gmon.h
index c6a8a93431..2cfdc6ef01 100644
--- a/sysdeps/i386/machine-gmon.h
+++ b/sysdeps/i386/machine-gmon.h
@@ -1,5 +1,5 @@
/* i386-specific implementation of profiling support.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -29,10 +29,12 @@
/* We must not pollute the global namespace. */
#define mcount_internal __mcount_internal
-extern void mcount_internal (u_long frompc, u_long selfpc) internal_function;
+extern void mcount_internal (u_long frompc, u_long selfpc)
+ __attribute__ ((regparm (2))) attribute_hidden;
-#define _MCOUNT_DECL(frompc, selfpc) \
-void internal_function mcount_internal (u_long frompc, u_long selfpc)
+#define _MCOUNT_DECL(frompc, selfpc) \
+ __attribute__ ((regparm (2))) \
+void mcount_internal (u_long frompc, u_long selfpc)
/* Define MCOUNT as empty since we have the implementation in another
diff --git a/sysdeps/i386/malloc-alignment.h b/sysdeps/i386/malloc-alignment.h
new file mode 100644
index 0000000000..b938be023d
--- /dev/null
+++ b/sysdeps/i386/malloc-alignment.h
@@ -0,0 +1,24 @@
+/* Define MALLOC_ALIGNMENT for malloc. i386 version.
+ Copyright (C) 2017-2018 Free Software 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 _I386_MALLOC_ALIGNMENT_H
+#define _I386_MALLOC_ALIGNMENT_H
+
+#define MALLOC_ALIGNMENT 16
+
+#endif /* !defined(_I386_MALLOC_ALIGNMENT_H) */
diff --git a/sysdeps/i386/memchr.S b/sysdeps/i386/memchr.S
index e8834349e6..ee5960a4cc 100644
--- a/sysdeps/i386/memchr.S
+++ b/sysdeps/i386/memchr.S
@@ -1,6 +1,6 @@
/* memchr (str, chr, len) -- Return pointer to first occurrence of CHR in STR
less than LEN. For Intel 80x86, x>=3.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index bc73005922..b57abacbe0 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -1,5 +1,5 @@
/* Compare two memory blocks for differences in the first COUNT bytes.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/memcopy.h b/sysdeps/i386/memcopy.h
index 2fe98fa98b..12bb39f945 100644
--- a/sysdeps/i386/memcopy.h
+++ b/sysdeps/i386/memcopy.h
@@ -1,5 +1,5 @@
/* memcopy.h -- definitions for memory copy functions. i386 version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/sysdeps/i386/memcpy.S b/sysdeps/i386/memcpy.S
index e6a8dd8a9d..0f8719087c 100644
--- a/sysdeps/i386/memcpy.S
+++ b/sysdeps/i386/memcpy.S
@@ -1,5 +1,5 @@
/* memcpy with REP MOVSB/STOSB
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/memcpy_chk.S b/sysdeps/i386/memcpy_chk.S
index c40c3d70f5..53064e91a2 100644
--- a/sysdeps/i386/memcpy_chk.S
+++ b/sysdeps/i386/memcpy_chk.S
@@ -1,5 +1,5 @@
/* Checking memcpy for i386.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/memmove_chk.S b/sysdeps/i386/memmove_chk.S
index 2bf59b7093..7f64fa8944 100644
--- a/sysdeps/i386/memmove_chk.S
+++ b/sysdeps/i386/memmove_chk.S
@@ -1,5 +1,5 @@
/* Checking memmove for i386
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/mempcpy_chk.S b/sysdeps/i386/mempcpy_chk.S
index e0bac6eee7..7674f9cb19 100644
--- a/sysdeps/i386/mempcpy_chk.S
+++ b/sysdeps/i386/mempcpy_chk.S
@@ -1,5 +1,5 @@
/* Checking mempcpy for i386
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/memset.S b/sysdeps/i386/memset.S
index 07b0911988..13fdee1d7e 100644
--- a/sysdeps/i386/memset.S
+++ b/sysdeps/i386/memset.S
@@ -1,5 +1,5 @@
/* memset with REP MOVSB/STOSB
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/memset_chk.S b/sysdeps/i386/memset_chk.S
index 5e593a2e84..d9cf5c04e3 100644
--- a/sysdeps/i386/memset_chk.S
+++ b/sysdeps/i386/memset_chk.S
@@ -1,5 +1,5 @@
/* Checking memset for i386.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/memusage.h b/sysdeps/i386/memusage.h
index 719275ca35..dd31dca423 100644
--- a/sysdeps/i386/memusage.h
+++ b/sysdeps/i386/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/mul_1.S b/sysdeps/i386/mul_1.S
index 6cb992b747..408bcdbaf9 100644
--- a/sysdeps/i386/mul_1.S
+++ b/sysdeps/i386/mul_1.S
@@ -1,6 +1,6 @@
/* i80386 __mpn_mul_1 -- Multiply a limb vector with a limb and store
the result in a second limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/i386/nptl/Makefile b/sysdeps/i386/nptl/Makefile
index eee3d75ed7..73024033ee 100644
--- a/sysdeps/i386/nptl/Makefile
+++ b/sysdeps/i386/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -18,9 +18,3 @@
ifeq ($(subdir),csu)
gen-as-const-headers += tcb-offsets.sym
endif
-
-ifeq ($(subdir),nptl)
-CFLAGS-pthread_create.c += -mpreferred-stack-boundary=4
-CFLAGS-tst-align.c += -mpreferred-stack-boundary=4
-CFLAGS-tst-align2.c += -mpreferred-stack-boundary=4
-endif
diff --git a/sysdeps/i386/nptl/pthread-offsets.h b/sysdeps/i386/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..9617354dc7
--- /dev/null
+++ b/sysdeps/i386/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+#define __PTHREAD_MUTEX_KIND_OFFSET 12
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 20
diff --git a/sysdeps/i386/nptl/pthread_spin_init.c b/sysdeps/i386/nptl/pthread_spin_init.c
index b9b33719fd..1c49df4f03 100644
--- a/sysdeps/i386/nptl/pthread_spin_init.c
+++ b/sysdeps/i386/nptl/pthread_spin_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/i386/nptl/pthread_spin_lock.S b/sysdeps/i386/nptl/pthread_spin_lock.S
index e311d957d4..1980fec75f 100644
--- a/sysdeps/i386/nptl/pthread_spin_lock.S
+++ b/sysdeps/i386/nptl/pthread_spin_lock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/nptl/pthread_spin_unlock.S b/sysdeps/i386/nptl/pthread_spin_unlock.S
index a552cf92c1..2e7108604c 100644
--- a/sysdeps/i386/nptl/pthread_spin_unlock.S
+++ b/sysdeps/i386/nptl/pthread_spin_unlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/i386/nptl/pthreaddef.h b/sysdeps/i386/nptl/pthreaddef.h
index c22a6e1d10..deacd92edf 100644
--- a/sysdeps/i386/nptl/pthreaddef.h
+++ b/sysdeps/i386/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/i386/nptl/tcb-offsets.sym b/sysdeps/i386/nptl/tcb-offsets.sym
index 7bdf161b29..2ec9e787c1 100644
--- a/sysdeps/i386/nptl/tcb-offsets.sym
+++ b/sysdeps/i386/nptl/tcb-offsets.sym
@@ -4,7 +4,6 @@
RESULT offsetof (struct pthread, result)
TID offsetof (struct pthread, tid)
-PID offsetof (struct pthread, pid)
CANCELHANDLING offsetof (struct pthread, cancelhandling)
CLEANUP_JMP_BUF offsetof (struct pthread, cleanup_jmp_buf)
MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
@@ -13,6 +12,5 @@ CLEANUP offsetof (struct pthread, cleanup)
CLEANUP_PREV offsetof (struct _pthread_cleanup_buffer, __prev)
MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock)
POINTER_GUARD offsetof (tcbhead_t, pointer_guard)
-#ifndef __ASSUME_PRIVATE_FUTEX
-PRIVATE_FUTEX offsetof (tcbhead_t, private_futex)
-#endif
+FEATURE_1_OFFSET offsetof (tcbhead_t, feature_1)
+SSP_BASE_OFFSET offsetof (tcbhead_t, ssp_base)
diff --git a/sysdeps/i386/nptl/tls.h b/sysdeps/i386/nptl/tls.h
index a6dfa9b377..12285d3217 100644
--- a/sysdeps/i386/nptl/tls.h
+++ b/sysdeps/i386/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. nptl/i386 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,21 +26,9 @@
# include <stdint.h>
# include <stdlib.h>
# include <sysdep.h>
-# include <libc-internal.h>
+# include <libc-pointer-arith.h> /* For cast_to_integer. */
# include <kernel-features.h>
-
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
-
+# include <dl-dtv.h>
typedef struct
{
@@ -53,17 +41,22 @@ typedef struct
uintptr_t stack_guard;
uintptr_t pointer_guard;
int gscope_flag;
-#ifndef __ASSUME_PRIVATE_FUTEX
- int private_futex;
-#else
- int __glibc_reserved1;
-#endif
+ /* Bit 0: X86_FEATURE_1_IBT.
+ Bit 1: X86_FEATURE_1_SHSTK.
+ */
+ unsigned int feature_1;
/* Reservation of some values for the TM ABI. */
- void *__private_tm[4];
+ void *__private_tm[3];
/* GCC split stack support. */
void *__private_ss;
+ /* The lowest address of shadow stack, */
+ unsigned long ssp_base;
} tcbhead_t;
+/* morestack.S in libgcc uses offset 0x30 to access __private_ss, */
+_Static_assert (offsetof (tcbhead_t, __private_ss) == 0x30,
+ "offset of __private_ss != 0x30");
+
# define TLS_MULTIPLE_THREADS_IN_TCB 1
#else /* __ASSEMBLER__ */
@@ -406,22 +399,6 @@ tls_fill_user_desc (union user_desc_init *desc,
abort (); })
-/* Call the user-provided thread function. */
-#define CALL_THREAD_FCT(descr) \
- ({ void *__res; \
- int __ignore1, __ignore2; \
- asm volatile ("pushl %%eax\n\t" \
- "pushl %%eax\n\t" \
- "pushl %%eax\n\t" \
- "pushl %%gs:%P4\n\t" \
- "call *%%gs:%P3\n\t" \
- "addl $16, %%esp" \
- : "=a" (__res), "=c" (__ignore1), "=d" (__ignore2) \
- : "i" (offsetof (struct pthread, start_routine)), \
- "i" (offsetof (struct pthread, arg))); \
- __res; })
-
-
/* Set the stack guard field in TCB head. */
#define THREAD_SET_STACK_GUARD(value) \
THREAD_SETMEM (THREAD_SELF, header.stack_guard, value)
@@ -439,6 +416,7 @@ tls_fill_user_desc (union user_desc_init *desc,
/* Get and set the global scope generation counter in the TCB head. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/i386/pthread_spin_trylock.S b/sysdeps/i386/pthread_spin_trylock.S
index 36979bdd1d..686dd8cd80 100644
--- a/sysdeps/i386/pthread_spin_trylock.S
+++ b/sysdeps/i386/pthread_spin_trylock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/i386/rawmemchr.S b/sysdeps/i386/rawmemchr.S
index 9696926bc7..89a0c18529 100644
--- a/sysdeps/i386/rawmemchr.S
+++ b/sysdeps/i386/rawmemchr.S
@@ -1,6 +1,6 @@
/* rawmemchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
diff --git a/sysdeps/i386/rshift.S b/sysdeps/i386/rshift.S
index d88979542f..532a7f5f70 100644
--- a/sysdeps/i386/rshift.S
+++ b/sysdeps/i386/rshift.S
@@ -1,5 +1,5 @@
/* i80386 __mpn_rshift --
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/i386/setfpucw.c b/sysdeps/i386/setfpucw.c
index 497a37b23c..931302bcd0 100644
--- a/sysdeps/i386/setfpucw.c
+++ b/sysdeps/i386/setfpucw.c
@@ -1,5 +1,5 @@
/* Set the FPU control word for x86.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,7 +39,7 @@ __setfpucw (fpu_control_t set)
__asm__ ("fldcw %0" : : "m" (*&cw));
/* If the CPU supports SSE, we set the MXCSR as well. */
- if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ if (HAS_CPU_FEATURE (SSE))
{
unsigned int xnew_exc;
diff --git a/sysdeps/i386/setjmp.S b/sysdeps/i386/setjmp.S
index a29da15d45..889337b8ae 100644
--- a/sysdeps/i386/setjmp.S
+++ b/sysdeps/i386/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for i386.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
+#include <jmp_buf-ssp.h>
#include <asm-syntax.h>
#include <stap-probe.h>
@@ -25,6 +26,11 @@
#define JMPBUF PARMS
#define SIGMSK JMPBUF+4
+/* Don't save shadow stack register if shadow stack isn't enabled. */
+#if !SHSTK_ENABLED
+# undef SHADOW_STACK_POINTER_OFFSET
+#endif
+
ENTRY (__sigsetjmp)
movl JMPBUF(%esp), %eax
@@ -46,6 +52,21 @@ ENTRY (__sigsetjmp)
movl %ecx, (JB_PC*4)(%eax)
movl %ebp, (JB_BP*4)(%eax) /* Save caller's frame pointer. */
+#ifdef SHADOW_STACK_POINTER_OFFSET
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+ /* Check if Shadow Stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %gs:FEATURE_1_OFFSET
+ jz L(skip_ssp)
+# else
+ xorl %ecx, %ecx
+# endif
+ /* Get the current Shadow-Stack-Pointer and save it. */
+ rdsspd %ecx
+ movl %ecx, SHADOW_STACK_POINTER_OFFSET(%eax)
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+L(skip_ssp):
+# endif
+#endif
#if IS_IN (rtld)
/* In ld.so we never save the signal mask. */
xorl %eax, %eax
diff --git a/sysdeps/i386/stackinfo.h b/sysdeps/i386/stackinfo.h
index 074cd77246..c6d97c0fd4 100644
--- a/sysdeps/i386/stackinfo.h
+++ b/sysdeps/i386/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/start.S b/sysdeps/i386/start.S
index 964e6d9e1e..91035fa83f 100644
--- a/sysdeps/i386/start.S
+++ b/sysdeps/i386/start.S
@@ -1,5 +1,5 @@
/* Startup code compliant to the ELF i386 ABI.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -81,7 +81,7 @@ _start:
pushl %edx /* Push address of the shared library
termination function. */
-#ifdef SHARED
+#ifdef PIC
/* Load PIC register. */
call 1f
addl $_GLOBAL_OFFSET_TABLE_, %ebx
@@ -95,7 +95,17 @@ _start:
pushl %ecx /* Push second argument: argv. */
pushl %esi /* Push first argument: argc. */
+# ifdef SHARED
pushl main@GOT(%ebx)
+# else
+ /* Avoid relocation in static PIE since _start is called before
+ it is relocated. Don't use "leal main@GOTOFF(%ebx), %eax"
+ since main may be in a shared object. Linker will convert
+ "movl main@GOT(%ebx), %eax" to "leal main@GOTOFF(%ebx), %eax"
+ if main is defined locally. */
+ movl main@GOT(%ebx), %eax
+ pushl %eax
+# endif
/* Call the user's main function, and exit with its value.
But let the libc call main. */
@@ -117,7 +127,7 @@ _start:
hlt /* Crash if somehow `exit' does return. */
-#ifdef SHARED
+#ifdef PIC
1: movl (%esp), %ebx
ret
#endif
diff --git a/sysdeps/i386/stpcpy.S b/sysdeps/i386/stpcpy.S
index 7999e954aa..82ca409c1f 100644
--- a/sysdeps/i386/stpcpy.S
+++ b/sysdeps/i386/stpcpy.S
@@ -1,6 +1,6 @@
/* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper (drepper@gnu.ai.mit.edu).
diff --git a/sysdeps/i386/stpncpy.S b/sysdeps/i386/stpncpy.S
index db808ef984..f81c8a2dbd 100644
--- a/sysdeps/i386/stpncpy.S
+++ b/sysdeps/i386/stpncpy.S
@@ -1,7 +1,7 @@
/* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
diff --git a/sysdeps/i386/strcat.S b/sysdeps/i386/strcat.S
index 3abc35b072..059f74259e 100644
--- a/sysdeps/i386/strcat.S
+++ b/sysdeps/i386/strcat.S
@@ -1,6 +1,6 @@
/* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
diff --git a/sysdeps/i386/strchr.S b/sysdeps/i386/strchr.S
index 34489f1104..ce0ece1106 100644
--- a/sysdeps/i386/strchr.S
+++ b/sysdeps/i386/strchr.S
@@ -1,6 +1,6 @@
/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
diff --git a/sysdeps/i386/strchrnul.S b/sysdeps/i386/strchrnul.S
index 638f989f80..80a4d2a9ab 100644
--- a/sysdeps/i386/strchrnul.S
+++ b/sysdeps/i386/strchrnul.S
@@ -1,7 +1,7 @@
/* strchrnul (str, chr) -- Return pointer to first occurrence of CHR in STR
or the final NUL byte.
For Intel 80x86, x>=3.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
diff --git a/sysdeps/i386/strcspn.S b/sysdeps/i386/strcspn.S
index 88eb029c14..4125d1cfb7 100644
--- a/sysdeps/i386/strcspn.S
+++ b/sysdeps/i386/strcspn.S
@@ -1,7 +1,7 @@
/* strcspn (str, ss) -- Return the length of the initial segment of STR
which contains no characters from SS.
For Intel 80x86, x>=3.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
diff --git a/sysdeps/i386/string-inlines.c b/sysdeps/i386/string-inlines.c
index c7de270c0a..2bfbd7fc7d 100644
--- a/sysdeps/i386/string-inlines.c
+++ b/sysdeps/i386/string-inlines.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software 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,50 +15,194 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* <bits/string.h> and <bits/string2.h> declare some extern inline
- functions. These functions are declared additionally here if
- inlining is not possible. */
-
-#undef __USE_STRING_INLINES
-#define __USE_STRING_INLINES
-#define _FORCE_INLINES
-#define __STRING_INLINE /* empty */
-#define __NO_INLINE__
-
-/* This is to avoid PLT entries for the x86 version. */
-#define __memcpy_g __memcpy_g_internal
-#define __strchr_g __strchr_g_internal
-
-#include <string.h>
-#undef index
-#undef rindex
-
-#undef __NO_INLINE__
-#include <bits/string.h>
-#include <bits/string2.h>
+#include <string/string-inlines.c>
+#if SHLIB_COMPAT (libc, GLIBC_2_1_1, GLIBC_2_26)
+/* Additional compatibility shims for the former
+ sysdeps/x86/bits/string.h. */
void *
-(__memcpy_c) (void *d, const void *s, size_t n)
+__old_memcpy_c (void *d, const void *s, size_t n)
{
return memcpy (d, s, n);
}
+strong_alias (__old_memcpy_c, __old_memcpy_g);
+strong_alias (__old_memcpy_c, __old_memcpy_by4);
+strong_alias (__old_memcpy_c, __old_memcpy_by2);
+compat_symbol (libc, __old_memcpy_c, __memcpy_c, GLIBC_2_1_1);
+compat_symbol (libc, __old_memcpy_g, __memcpy_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_memcpy_by4, __memcpy_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_memcpy_by2, __memcpy_by2, GLIBC_2_1_1);
void *
-__memset_cc (void *s, unsigned long int pattern, size_t n)
+__old_memset_cc (void *s, unsigned long int pattern, size_t n)
{
return memset (s, pattern & 0xff, n);
}
-strong_alias (__memset_cc, __memset_cg)
+strong_alias (__old_memset_cc, __old_memset_cg);
+strong_alias (__old_memset_cc, __old_memset_ccn_by2);
+strong_alias (__old_memset_cc, __old_memset_ccn_by4);
+compat_symbol (libc, __old_memset_cc, __memset_cc, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_cg, __memset_cg, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_ccn_by4, __memset_ccn_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_ccn_by2, __memset_ccn_by2, GLIBC_2_1_1);
void *
-__memset_gg (void *s, char c, size_t n)
+__old_memset_gg (void *s, char c, size_t n)
{
return memset (s, c, n);
}
+strong_alias (__old_memset_gg, __old_memset_gcn_by4);
+strong_alias (__old_memset_gg, __old_memset_gcn_by2);
+compat_symbol (libc, __old_memset_gg, __memset_gg, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_gcn_by4, __memset_gcn_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_gcn_by2, __memset_gcn_by2, GLIBC_2_1_1);
+
+size_t
+__old_strlen_g (const char *str)
+{
+ return strlen (str);
+}
+compat_symbol (libc, __old_strlen_g, __strlen_g, GLIBC_2_1_1);
+
+char *
+__old_strcpy_g (char *dest, const char *src)
+{
+ return strcpy (dest, src);
+}
+compat_symbol (libc, __old_strcpy_g, __strcpy_g, GLIBC_2_1_1);
+
+void *
+__old_mempcpy_byn (void *dest, const void *src, size_t len)
+{
+ return __mempcpy (dest, src, len);
+}
+strong_alias (__old_mempcpy_byn, __old_mempcpy_by4);
+strong_alias (__old_mempcpy_byn, __old_mempcpy_by2);
+compat_symbol (libc, __old_mempcpy_byn, __mempcpy_byn, GLIBC_2_1_1);
+compat_symbol (libc, __old_mempcpy_by4, __mempcpy_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_mempcpy_by2, __mempcpy_by2, GLIBC_2_1_1);
+
+char *
+__old_stpcpy_g (char *dest, const char *src)
+{
+ return __stpcpy (dest, src);
+}
+compat_symbol (libc, __old_stpcpy_g, __stpcpy_g, GLIBC_2_1_1);
+
+char *
+__old_strncpy_byn (char *dest, const char *src, size_t srclen, size_t n)
+{
+ return strncpy (dest, src, n);
+}
+strong_alias (__old_strncpy_byn, __old_strncpy_by4);
+strong_alias (__old_strncpy_byn, __old_strncpy_by2);
+compat_symbol (libc, __old_strncpy_byn, __strncpy_byn, GLIBC_2_1_1);
+compat_symbol (libc, __old_strncpy_by4, __strncpy_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_strncpy_by2, __strncpy_by2, GLIBC_2_1_1);
+
+char *
+__old_strncpy_gg (char *dest, const char *src, size_t n)
+{
+ return strncpy (dest, src, n);
+}
+compat_symbol (libc, __old_strncpy_gg, __strncpy_gg, GLIBC_2_1_1);
+
+/* __strcat_c took a third argument, which we ignore. */
+char *
+__old_strcat_g (char *dest, const char *src)
+{
+ return strcat (dest, src);
+}
+strong_alias (__old_strcat_g, __old_strcat_c);
+compat_symbol (libc, __old_strcat_g, __strcat_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strcat_c, __strcat_c, GLIBC_2_1_1);
+
+char *
+__old_strncat_g (char *dest, const char *src, size_t n)
+{
+ return __strncat (dest, src, n);
+}
+compat_symbol (libc, __old_strncat_g, __strncat_g, GLIBC_2_1_1);
+
+int
+__old_strcmp_gg (const char *s1, const char *s2)
+{
+ return strcmp (s1, s2);
+}
+compat_symbol (libc, __old_strcmp_gg, __strcmp_gg, GLIBC_2_1_1);
+
+int
+__old_strncmp_g (const char *s1, const char *s2, size_t n)
+{
+ return strncmp (s1, s2, n);
+}
+compat_symbol (libc, __old_strncmp_g, __strncmp_g, GLIBC_2_1_1);
+
+char *
+__old_strchr_g (const char *s, int c)
+{
+ return strchr (s, c);
+}
+strong_alias (__old_strchr_g, __old_strchr_c);
+compat_symbol (libc, __old_strchr_g, __strchr_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strchr_c, __strchr_c, GLIBC_2_1_1);
+
+char *
+__old_strchrnul_g (const char *s, int c)
+{
+ return __strchrnul (s, c);
+}
+strong_alias (__old_strchrnul_g, __old_strchrnul_c);
+compat_symbol (libc, __old_strchrnul_g, __strchrnul_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strchrnul_c, __strchrnul_c, GLIBC_2_1_1);
+
+char *
+__old_strrchr_g (const char *s, int c)
+{
+ return strrchr (s, c);
+}
+strong_alias (__old_strrchr_g, __old_strrchr_c);
+compat_symbol (libc, __old_strrchr_g, __strrchr_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strrchr_c, __strrchr_c, GLIBC_2_1_1);
+
+/* __strcspn_cg took a third argument, which we ignore. */
+size_t
+__old_strcspn_g (const char *s, const char *reject)
+{
+ return strcspn (s, reject);
+}
+strong_alias (__old_strcspn_g, __old_strcspn_cg);
+compat_symbol (libc, __old_strcspn_g, __strcspn_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strcspn_cg, __strcspn_cg, GLIBC_2_1_1);
+
+/* __strspn_cg took a third argument, which we ignore. */
+size_t
+__old_strspn_g (const char *s, const char *accept)
+{
+ return strspn (s, accept);
+}
+strong_alias (__old_strspn_g, __old_strspn_cg);
+compat_symbol (libc, __old_strspn_g, __strspn_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strspn_cg, __strspn_cg, GLIBC_2_1_1);
+
+/* __strpbrk_cg took a third argument, which we ignore. */
+const char *
+__old_strpbrk_g (const char *s, const char *accept)
+{
+ return strpbrk (s, accept);
+}
+strong_alias (__old_strpbrk_g, __old_strpbrk_cg);
+compat_symbol (libc, __old_strpbrk_g, __strpbrk_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strpbrk_cg, __strpbrk_cg, GLIBC_2_1_1);
+
+/* __strstr_cg took a third argument, which we ignore. */
+const char *
+__old_strstr_g (const char *s, const char *accept)
+{
+ return strstr (s, accept);
+}
+strong_alias (__old_strstr_g, __old_strstr_cg);
+compat_symbol (libc, __old_strstr_g, __strstr_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strstr_cg, __strstr_cg, GLIBC_2_1_1);
-#ifdef __memcpy_c
-# undef __memcpy_g
-strong_alias (__memcpy_g_internal, __memcpy_g)
-# undef __strchr_g
-strong_alias (__strchr_g_internal, __strchr_g)
#endif
diff --git a/sysdeps/i386/strlen.S b/sysdeps/i386/strlen.S
index 0d0326cefa..76e28f7375 100644
--- a/sysdeps/i386/strlen.S
+++ b/sysdeps/i386/strlen.S
@@ -1,6 +1,6 @@
/* strlen(str) -- determine the length of the string STR.
Optimized for Intel 80x86, x>=4.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/strlen.c b/sysdeps/i386/strlen.c
index 5506c8a40b..bcd1b7dae3 100644
--- a/sysdeps/i386/strlen.c
+++ b/sysdeps/i386/strlen.c
@@ -1,5 +1,5 @@
/* Determine the length of a string. For Intel 80x86, x>=3.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/sysdeps/i386/strpbrk.S b/sysdeps/i386/strpbrk.S
index ad2f02c3b8..05890a3546 100644
--- a/sysdeps/i386/strpbrk.S
+++ b/sysdeps/i386/strpbrk.S
@@ -1,7 +1,7 @@
/* strcspn (str, ss) -- Return the length of the initial segement of STR
which contains no characters from SS.
For Intel 80x86, x>=3.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/strrchr.S b/sysdeps/i386/strrchr.S
index 91f02440a8..6f4b507f19 100644
--- a/sysdeps/i386/strrchr.S
+++ b/sysdeps/i386/strrchr.S
@@ -1,6 +1,6 @@
/* strrchr (str, ch) -- Return pointer to last occurrence of CH in STR.
For Intel 80x86, x>=3.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
diff --git a/sysdeps/i386/strspn.S b/sysdeps/i386/strspn.S
index fd8f555f48..d7eb7e8b93 100644
--- a/sysdeps/i386/strspn.S
+++ b/sysdeps/i386/strspn.S
@@ -1,7 +1,7 @@
/* strcspn (str, ss) -- Return the length of the initial segment of STR
which contains only characters from SS.
For Intel 80x86, x>=3.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
diff --git a/sysdeps/i386/strtok.S b/sysdeps/i386/strtok.S
deleted file mode 100644
index a8a4fe45f2..0000000000
--- a/sysdeps/i386/strtok.S
+++ /dev/null
@@ -1,358 +0,0 @@
-/* strtok (str, delim) -- Return next DELIM separated token from STR.
- For Intel 80x86, x>=3.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include "asm-syntax.h"
-
-/* This file can be used for three variants of the strtok function:
-
- strtok:
- INPUT PARAMETER:
- str (sp + 4)
- delim (sp + 8)
-
- strtok_r:
- INPUT PARAMETER:
- str (sp + 4)
- delim (sp + 8)
- save_ptr (sp + 12)
-
- We do a common implementation here. */
-
-#ifdef USE_AS_STRTOK_R
-# define SAVE_PTR 0(%ecx)
-#else
- .bss
- .local save_ptr
- .type save_ptr, @object
- .size save_ptr, 4
-save_ptr:
- .space 4
-
-# ifdef PIC
-# define SAVE_PTR save_ptr@GOTOFF(%ebx)
-# else
-# define SAVE_PTR save_ptr
-# endif
-
-# define FUNCTION strtok
-#endif
-
-#define PARMS 4 /* no space for saved regs */
-#define RTN PARMS
-#define STR RTN
-#define DELIM STR+4
-#define SAVE DELIM+4
-
- .text
-ENTRY (FUNCTION)
-
- movl STR(%esp), %edx
- movl DELIM(%esp), %eax
-
-#if !defined USE_AS_STRTOK_R && defined PIC
- pushl %ebx /* Save PIC register. */
- cfi_adjust_cfa_offset (4)
- call L(here)
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
-L(here):
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebx
-#endif
-
- /* If the pointer is NULL we have to use the stored value of
- the last run. */
- cmpl $0, %edx
- jne L(1)
-
-#ifdef USE_AS_STRTOK_R
- /* The value is stored in the third argument. */
- movl SAVE(%esp), %edx
- movl (%edx), %edx
-#else
- /* The value is in the local variable defined above. But
- we have to take care for PIC code. */
- movl SAVE_PTR, %edx
-#endif
- testl %edx, %edx
- jz L(returnNULL)
-
-L(1):
- /* First we create a table with flags for all possible characters.
- For the ASCII (7bit/8bit) or ISO-8859-X character sets which are
- supported by the C string functions we have 256 characters.
- Before inserting marks for the stop characters we clear the whole
- table. The unrolled form is much faster than a loop. */
- xorl %ecx, %ecx /* %ecx = 0 !!! */
-
- pushl %ecx /* make a 256 bytes long block filled with 0 */
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl %ecx
- cfi_adjust_cfa_offset (4)
- pushl $0 /* These immediate values make the label 2 */
- cfi_adjust_cfa_offset (4)
- pushl $0 /* to be aligned on a 16 byte boundary to */
- cfi_adjust_cfa_offset (4)
- pushl $0 /* get a better performance of the loop. */
- cfi_adjust_cfa_offset (4)
- pushl $0
- cfi_adjust_cfa_offset (4)
- pushl $0
- cfi_adjust_cfa_offset (4)
- pushl $0
- cfi_adjust_cfa_offset (4)
-
-/* For understanding the following code remember that %ecx == 0 now.
- Although all the following instruction only modify %cl we always
- have a correct zero-extended 32-bit value in %ecx. */
-
-L(2): movb (%eax), %cl /* get byte from stopset */
- testb %cl, %cl /* is NUL char? */
- jz L(1_1) /* yes => start compare loop */
- movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
-
- movb 1(%eax), %cl /* get byte from stopset */
- testb $0xff, %cl /* is NUL char? */
- jz L(1_1) /* yes => start compare loop */
- movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
-
- movb 2(%eax), %cl /* get byte from stopset */
- testb $0xff, %cl /* is NUL char? */
- jz L(1_1) /* yes => start compare loop */
- movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
-
- movb 3(%eax), %cl /* get byte from stopset */
- addl $4, %eax /* increment stopset pointer */
- movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
- testb $0xff, %cl /* is NUL char? */
- jnz L(2) /* no => process next dword from stopset */
-
-L(1_1): leal -4(%edx), %eax /* prepare loop */
-
- /* We use a neat trick for the following loop. Normally we would
- have to test for two termination conditions
- 1. a character in the stopset was found
- and
- 2. the end of the string was found
- As a sign that the character is in the stopset we store its
- value in the table. The value of NUL is NUL so the loop
- terminates for NUL in every case. */
-
-L(3): addl $4, %eax /* adjust pointer for full loop round */
-
- movb (%eax), %cl /* get byte from string */
- testb %cl, (%esp,%ecx) /* is it contained in stopset? */
- jz L(4) /* no => start of token */
-
- movb 1(%eax), %cl /* get byte from string */
- testb %cl, (%esp,%ecx) /* is it contained in stopset? */
- jz L(5) /* no => start of token */
-
- movb 2(%eax), %cl /* get byte from string */
- testb %cl, (%esp,%ecx) /* is it contained in stopset? */
- jz L(6) /* no => start of token */
-
- movb 3(%eax), %cl /* get byte from string */
- testb %cl, (%esp,%ecx) /* is it contained in stopset? */
- jnz L(3) /* yes => start of loop */
-
- incl %eax /* adjust pointer */
-L(6): incl %eax
-L(5): incl %eax
-
- /* Now we have to terminate the string. */
-
-L(4): leal -4(%eax), %edx /* We use %EDX for the next run. */
-
-L(7): addl $4, %edx /* adjust pointer for full loop round */
-
- movb (%edx), %cl /* get byte from string */
- cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */
- je L(8) /* yes => return */
-
- movb 1(%edx), %cl /* get byte from string */
- cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */
- je L(9) /* yes => return */
-
- movb 2(%edx), %cl /* get byte from string */
- cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */
- je L(10) /* yes => return */
-
- movb 3(%edx), %cl /* get byte from string */
- cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */
- jne L(7) /* no => start loop again */
-
- incl %edx /* adjust pointer */
-L(10): incl %edx
-L(9): incl %edx
-
-L(8): /* Remove the stopset table. */
- addl $256, %esp
- cfi_adjust_cfa_offset (-256)
-
- cmpl %eax, %edx
- je L(returnNULL) /* There was no token anymore. */
-
- movb $0, (%edx) /* Terminate string. */
-
- /* Are we at end of string? */
- cmpb $0, %cl
- je L(11)
-
- incl %edx
-L(11):
-
- /* Store the pointer to the next character. */
-#ifdef USE_AS_STRTOK_R
- movl SAVE(%esp), %ecx
-#endif
- movl %edx, SAVE_PTR
-
-L(epilogue):
-#if !defined USE_AS_STRTOK_R && defined PIC
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#endif
- ret
-
-L(returnNULL):
- xorl %eax, %eax
-#ifdef USE_AS_STRTOK_R
- movl SAVE(%esp), %ecx
-#endif
- movl %edx, SAVE_PTR
- jmp L(epilogue)
-
-END (FUNCTION)
diff --git a/sysdeps/i386/strtok_r.S b/sysdeps/i386/strtok_r.S
deleted file mode 100644
index 508729370a..0000000000
--- a/sysdeps/i386/strtok_r.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#define FUNCTION __strtok_r
-#define USE_AS_STRTOK_R 1
-#include <sysdeps/i386/strtok.S>
-weak_alias (__strtok_r, strtok_r)
-strong_alias (__strtok_r, __GI___strtok_r)
diff --git a/sysdeps/i386/sub_n.S b/sysdeps/i386/sub_n.S
index 3b5340036a..ada0cf5ec9 100644
--- a/sysdeps/i386/sub_n.S
+++ b/sysdeps/i386/sub_n.S
@@ -1,6 +1,6 @@
/* i80386 __mpn_sub_n -- Add two limb vectors of the same length > 0 and store
sum in a third limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
along with the GNU MP Library; see the file COPYING.LIB. If not,
see <http://www.gnu.org/licenses/>. */
-#include "sysdep.h"
+#include <sysdep.h>
#include "asm-syntax.h"
#define PARMS 4+8 /* space for 2 saved regs */
@@ -40,6 +40,13 @@ ENTRY (__mpn_sub_n)
cfi_rel_offset (esi, 0)
movl S2(%esp),%edx
movl SIZE(%esp),%ecx
+
+#if IBT_ENABLED
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+#endif
+
movl %ecx,%eax
shrl $3,%ecx /* compute count for unrolled loop */
negl %eax
@@ -51,6 +58,9 @@ ENTRY (__mpn_sub_n)
subl %eax,%esi /* ... by a constant when we ... */
subl %eax,%edx /* ... enter the loop */
shrl $2,%eax /* restore previous value */
+#if defined __CET__ && (__CET__ & 1) != 0
+ leal -4(,%eax,4),%ebx /* Count for 4-byte endbr32 */
+#endif
#ifdef PIC
/* Calculate start address in loop for PIC. Due to limitations in some
assemblers, Loop-L0-3 cannot be put into the leal */
@@ -65,29 +75,38 @@ L(0): leal (%eax,%eax,8),%eax
/* Calculate start address in loop for non-PIC. */
leal (L(oop) - 3)(%eax,%eax,8),%eax
#endif
+#if defined __CET__ && (__CET__ & 1) != 0
+ addl %ebx,%eax /* Adjust for endbr32 */
+#endif
jmp *%eax /* jump into loop */
ALIGN (3)
L(oop): movl (%esi),%eax
sbbl (%edx),%eax
movl %eax,(%edi)
+ _CET_ENDBR
movl 4(%esi),%eax
sbbl 4(%edx),%eax
movl %eax,4(%edi)
+ _CET_ENDBR
movl 8(%esi),%eax
sbbl 8(%edx),%eax
movl %eax,8(%edi)
movl 12(%esi),%eax
sbbl 12(%edx),%eax
movl %eax,12(%edi)
+ _CET_ENDBR
movl 16(%esi),%eax
sbbl 16(%edx),%eax
movl %eax,16(%edi)
+ _CET_ENDBR
movl 20(%esi),%eax
sbbl 20(%edx),%eax
movl %eax,20(%edi)
+ _CET_ENDBR
movl 24(%esi),%eax
sbbl 24(%edx),%eax
movl %eax,24(%edi)
+ _CET_ENDBR
movl 28(%esi),%eax
sbbl 28(%edx),%eax
movl %eax,28(%edi)
@@ -100,6 +119,11 @@ L(oop): movl (%esi),%eax
sbbl %eax,%eax
negl %eax
+#if defined __CET__ && (__CET__ & 1) != 0
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+#endif
popl %esi
cfi_adjust_cfa_offset (-4)
cfi_restore (esi)
diff --git a/sysdeps/i386/submul_1.S b/sysdeps/i386/submul_1.S
index e1ae58f21f..17fbdcf539 100644
--- a/sysdeps/i386/submul_1.S
+++ b/sysdeps/i386/submul_1.S
@@ -1,6 +1,6 @@
/* i80386 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
the result from a second limb vector.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/i386/symbol-hacks.h b/sysdeps/i386/symbol-hacks.h
new file mode 100644
index 0000000000..c100fb902e
--- /dev/null
+++ b/sysdeps/i386/symbol-hacks.h
@@ -0,0 +1,21 @@
+/* Hacks needed for symbol manipulation. i386 version.
+ Copyright (C) 2017-2018 Free Software 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 <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
+
+#include_next "symbol-hacks.h"
diff --git a/sysdeps/i386/sys/ucontext.h b/sysdeps/i386/sys/ucontext.h
index d08e1a7f56..23cee16e80 100644
--- a/sysdeps/i386/sys/ucontext.h
+++ b/sysdeps/i386/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,99 +21,118 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
/* Type for general register. */
typedef int greg_t;
/* Number of general registers. */
-#define NGREG 19
+#define __NGREG 19
+#ifdef __USE_MISC
+# define NGREG __NGREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
+#ifdef __USE_MISC
/* Number of each register is the `gregset_t' array. */
enum
{
REG_GS = 0,
-#define REG_GS REG_GS
+# define REG_GS REG_GS
REG_FS,
-#define REG_FS REG_FS
+# define REG_FS REG_FS
REG_ES,
-#define REG_ES REG_ES
+# define REG_ES REG_ES
REG_DS,
-#define REG_DS REG_DS
+# define REG_DS REG_DS
REG_EDI,
-#define REG_EDI REG_EDI
+# define REG_EDI REG_EDI
REG_ESI,
-#define REG_ESI REG_ESI
+# define REG_ESI REG_ESI
REG_EBP,
-#define REG_EBP REG_EBP
+# define REG_EBP REG_EBP
REG_ESP,
-#define REG_ESP REG_ESP
+# define REG_ESP REG_ESP
REG_EBX,
-#define REG_EBX REG_EBX
+# define REG_EBX REG_EBX
REG_EDX,
-#define REG_EDX REG_EDX
+# define REG_EDX REG_EDX
REG_ECX,
-#define REG_ECX REG_ECX
+# define REG_ECX REG_ECX
REG_EAX,
-#define REG_EAX REG_EAX
+# define REG_EAX REG_EAX
REG_TRAPNO,
-#define REG_TRAPNO REG_TRAPNO
+# define REG_TRAPNO REG_TRAPNO
REG_ERR,
-#define REG_ERR REG_ERR
+# define REG_ERR REG_ERR
REG_EIP,
-#define REG_EIP REG_EIP
+# define REG_EIP REG_EIP
REG_CS,
-#define REG_CS REG_CS
+# define REG_CS REG_CS
REG_EFL,
-#define REG_EFL REG_EFL
+# define REG_EFL REG_EFL
REG_UESP,
-#define REG_UESP REG_UESP
+# define REG_UESP REG_UESP
REG_SS
-#define REG_SS REG_SS
+# define REG_SS REG_SS
};
+#endif
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+# define __ctxt(tag) tag
+#else
+# define __ctx(fld) __ ## fld
+# define __ctxt(tag) /* Empty. */
+#endif
/* Structure to describe FPU registers. */
-typedef struct fpregset
+typedef struct
{
union
{
- struct fpchip_state
+ struct __ctxt(fpchip_state)
{
- int state[27];
- int status;
- } fpchip_state;
+ int __ctx(state)[27];
+ int __ctx(status);
+ } __ctx(fpchip_state);
- struct fp_emul_space
+ struct __ctxt(fp_emul_space)
{
- char fp_emul[246];
- char fp_epad[2];
- } fp_emul_space;
+ char __ctx(fp_emul)[246];
+ char __ctx(fp_epad)[2];
+ } __ctx(fp_emul_space);
- int f_fpregs[62];
- } fp_reg_set;
+ int __ctx(f_fpregs)[62];
+ } __ctx(fp_reg_set);
- long int f_wregs[33];
+ long int __ctx(f_wregs)[33];
} fpregset_t;
/* Context to describe whole processor state. */
typedef struct
{
- gregset_t gregs;
- fpregset_t fpregs;
+ gregset_t __ctx(gregs);
+ fpregset_t __ctx(fpregs);
} mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
- __sigset_t uc_sigmask;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
+ sigset_t uc_sigmask;
stack_t uc_stack;
mcontext_t uc_mcontext;
- long int uc_filler[5];
+ long int __glibc_reserved1[5];
} ucontext_t;
+#undef __ctx
+#undef __ctxt
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/i386/sysdep.h b/sysdeps/i386/sysdep.h
index 95da385842..893a082602 100644
--- a/sysdeps/i386/sysdep.h
+++ b/sysdeps/i386/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for i386.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software 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,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdeps/generic/sysdep.h>
+#include <sysdeps/x86/sysdep.h>
#include <features.h> /* For __GNUC_PREREQ. */
@@ -39,32 +39,6 @@
/* Syntactic details of assembler. */
-/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */
-#define ALIGNARG(log2) 1<<log2
-#define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
-
-
-/* Define an entry point visible from C.
-
- There is currently a bug in gdb which prevents us from specifying
- incomplete stabs information. Fake some entries here which specify
- the current source file. */
-#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- .type C_SYMBOL_NAME(name),@function; \
- .align ALIGNARG(4); \
- C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- ASM_SIZE_DIRECTIVE(name)
-
-#define ENTRY_CHK(name) ENTRY (name)
-#define END_CHK(name) END (name)
-
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
/* The mcount code relies on a normal frame pointer being on the stack
@@ -77,12 +51,6 @@
#define CALL_MCOUNT /* Do nothing. */
#endif
-/* Since C identifiers are not normally prefixed with an underscore
- on this system, the asm identifier `syscall_error' intrudes on the
- C name space. Make sure we use an innocuous name. */
-#define syscall_error __syscall_error
-#define mcount _mcount
-
#define PSEUDO(name, syscall_name, args) \
.globl syscall_error; \
lose: SYSCALL_PIC_SETUP \
@@ -91,10 +59,6 @@ lose: SYSCALL_PIC_SETUP \
DO_CALL (syscall_name, args); \
jb lose
-#undef PSEUDO_END
-#define PSEUDO_END(name) \
- END (name)
-
# define SETUP_PIC_REG(reg) \
.ifndef GET_PC_THUNK(reg); \
.section .gnu.linkonce.t.GET_PC_THUNK(reg),"ax",@progbits; \
@@ -129,13 +93,6 @@ GET_PC_THUNK(reg): \
#define SYSCALL_PIC_SETUP /* Nothing. */
#endif
-/* Local label name for asm code. */
-#ifndef L
-#define L(name) .L##name
-#endif
-
-#define atom_text_section .section ".text.atom", "ax"
-
#else /* __ASSEMBLER__ */
# define SETUP_PIC_REG_STR(reg) \
diff --git a/sysdeps/i386/tlsdesc.c b/sysdeps/i386/tlsdesc.c
index 5b9a96f578..82fa8a1d35 100644
--- a/sysdeps/i386/tlsdesc.c
+++ b/sysdeps/i386/tlsdesc.c
@@ -1,5 +1,5 @@
/* Manage TLS descriptors. i386 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -256,7 +256,6 @@ _dl_tlsdesc_resolve_hold_fixup (struct tlsdesc volatile *td,
if there is one. */
void
-internal_function
_dl_unmap (struct link_map *map)
{
_dl_unmap_segments (map);
diff --git a/sysdeps/i386/tst-audit.h b/sysdeps/i386/tst-audit.h
index ab5e090184..d1b3187fb9 100644
--- a/sysdeps/i386/tst-audit.h
+++ b/sysdeps/i386/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. i386 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/i386/tst-audit3.c b/sysdeps/i386/tst-audit3.c
index d4a08649b7..ef5e92b12a 100644
--- a/sysdeps/i386/tst-audit3.c
+++ b/sysdeps/i386/tst-audit3.c
@@ -1,5 +1,5 @@
/* Test case for i386 preserved registers in dynamic linker.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/tst-audit3.h b/sysdeps/i386/tst-audit3.h
index 26c443e23e..99a42091f8 100644
--- a/sysdeps/i386/tst-audit3.h
+++ b/sysdeps/i386/tst-audit3.h
@@ -1,5 +1,5 @@
/* Test case for i386 preserved registers in dynamic linker.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/tst-auditmod3a.c b/sysdeps/i386/tst-auditmod3a.c
index 36242137d7..7810649757 100644
--- a/sysdeps/i386/tst-auditmod3a.c
+++ b/sysdeps/i386/tst-auditmod3a.c
@@ -1,5 +1,5 @@
/* Test case for i386 preserved registers in dynamic linker.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/tst-auditmod3b.c b/sysdeps/i386/tst-auditmod3b.c
index 9cc733bdb8..9eefe7678d 100644
--- a/sysdeps/i386/tst-auditmod3b.c
+++ b/sysdeps/i386/tst-auditmod3b.c
@@ -1,5 +1,5 @@
/* Test case for i386 preserved registers in dynamic linker.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/tst-ld-sse-use.sh b/sysdeps/i386/tst-ld-sse-use.sh
index 2863de6f8b..208a42c71a 100755
--- a/sysdeps/i386/tst-ld-sse-use.sh
+++ b/sysdeps/i386/tst-ld-sse-use.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# Make sure no code in ld.so uses xmm/ymm/zmm registers on i386.
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/i386/tst-stack-align.h b/sysdeps/i386/tst-stack-align.h
index 821cec860b..394ff7735a 100644
--- a/sysdeps/i386/tst-stack-align.h
+++ b/sysdeps/i386/tst-stack-align.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/Implies b/sysdeps/ia64/Implies
index 8524257020..22e4836e74 100644
--- a/sysdeps/ia64/Implies
+++ b/sysdeps/ia64/Implies
@@ -1,5 +1,6 @@
wordsize-64
# ia64 uses IEEE 754 floating point.
+ieee754/float128
ieee754/ldbl-96
ieee754/dbl-64
ieee754/flt-32
diff --git a/sysdeps/ia64/Makeconfig b/sysdeps/ia64/Makeconfig
index d1d3f6c95c..2f1abe868c 100644
--- a/sysdeps/ia64/Makeconfig
+++ b/sysdeps/ia64/Makeconfig
@@ -1,2 +1,4 @@
# ia64 does not provide crtbeginT.o, so use crtbegin.o.
+prectorT = $(+prector)
+
+float64x-alias-fcts = yes
diff --git a/sysdeps/ia64/Makefile b/sysdeps/ia64/Makefile
index 5ebca89afa..a4305d524d 100644
--- a/sysdeps/ia64/Makefile
+++ b/sysdeps/ia64/Makefile
@@ -1,6 +1,11 @@
# The ia64 `long double' is a distinct type we support.
long-double-fcts = yes
+ifeq ($(subdir),math)
+# sqrtf128 requires soft-fp.
+CPPFLAGS += -I../soft-fp
+endif
+
ifeq ($(subdir),gmon)
sysdep_routines += _mcount
endif
diff --git a/sysdeps/ia64/_mcount.S b/sysdeps/ia64/_mcount.S
index e4f624d4dd..c757ae7d32 100644
--- a/sysdeps/ia64/_mcount.S
+++ b/sysdeps/ia64/_mcount.S
@@ -1,5 +1,5 @@
/* Machine-specific calling sequence for `mcount' profiling function. ia64
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by David Mosberger <davidm@hpl.hp.com>
This file is part of the GNU C Library.
diff --git a/sysdeps/ia64/atomic-machine.h b/sysdeps/ia64/atomic-machine.h
index 78f62ab790..8297571345 100644
--- a/sysdeps/ia64/atomic-machine.h
+++ b/sysdeps/ia64/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -46,6 +46,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 1
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 0
+
#define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval) \
(abort (), 0)
diff --git a/sysdeps/ia64/backtrace.c b/sysdeps/ia64/backtrace.c
deleted file mode 100644
index 27ce597b39..0000000000
--- a/sysdeps/ia64/backtrace.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/x86_64/backtrace.c>
diff --git a/sysdeps/ia64/bits/byteswap-16.h b/sysdeps/ia64/bits/byteswap-16.h
deleted file mode 100644
index 9a2c46bd59..0000000000
--- a/sysdeps/ia64/bits/byteswap-16.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Macros to swap the order of bytes in 16-bit integer values.
- 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/>. */
-
-#ifndef _BITS_BYTESWAP_H
-# error "Never use <bits/byteswap-16.h> directly; include <byteswap.h> instead."
-#endif
-
-#if defined __GNUC__ && __GNUC__ >= 2
-# define __bswap_16(x) \
- (__extension__ \
- ({ unsigned short int __v, __x = (unsigned short int) (x); \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_16 (__x); \
- else \
- __asm__ __volatile__ ("shl %0 = %1, 48 ;;" \
- "mux1 %0 = %0, @rev ;;" \
- : "=r" (__v) \
- : "r" ((unsigned short int) (__x))); \
- __v; }))
-#else
-/* This is better than nothing. */
-static __inline unsigned short int
-__bswap_16 (unsigned short int __bsx)
-{
- return __bswap_constant_16 (__bsx);
-}
-#endif
diff --git a/sysdeps/ia64/bits/byteswap.h b/sysdeps/ia64/bits/byteswap.h
deleted file mode 100644
index 1dd488473f..0000000000
--- a/sysdeps/ia64/bits/byteswap.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Macros to swap the order of bytes in integer values.
- 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/>. */
-
-#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
-# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
-#endif
-
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H 1
-
-/* Swap bytes in 16 bit value. */
-#define __bswap_constant_16(x) \
- ((unsigned short int)((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
-
-/* Get __bswap_16. */
-#include <bits/byteswap-16.h>
-
-/* Swap bytes in 32 bit value. */
-#define __bswap_constant_32(x) \
- ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
- (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
-
-#if defined __GNUC__ && __GNUC__ >= 2
-# define __bswap_32(x) \
- (__extension__ \
- ({ unsigned int __v, __x = (x); \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_32 (__x); \
- else \
- __asm__ __volatile__ ("shl %0 = %1, 32 ;;" \
- "mux1 %0 = %0, @rev ;;" \
- : "=r" (__v) \
- : "r" ((unsigned int) (__x))); \
- __v; }))
-#else
-static __inline unsigned int
-__bswap_32 (unsigned int __bsx)
-{
- return __bswap_constant_32 (__bsx);
-}
-#endif
-
-
-/* Swap bytes in 64 bit value. */
-#if defined __GNUC__ && __GNUC__ >= 2
-# define __bswap_constant_64(x) \
- (__extension__ ((((x) & 0xff00000000000000ul) >> 56) \
- | (((x) & 0x00ff000000000000ul) >> 40) \
- | (((x) & 0x0000ff0000000000ul) >> 24) \
- | (((x) & 0x000000ff00000000ul) >> 8) \
- | (((x) & 0x00000000ff000000ul) << 8) \
- | (((x) & 0x0000000000ff0000ul) << 24) \
- | (((x) & 0x000000000000ff00ul) << 40) \
- | (((x) & 0x00000000000000fful) << 56)))
-
-# define __bswap_64(x) \
- (__extension__ \
- ({ unsigned long int __v, __x = (x); \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_64 (__x); \
- else \
- __asm__ __volatile__ ("mux1 %0 = %1, @rev ;;" \
- : "=r" (__v) \
- : "r" ((unsigned long int) (__x))); \
- __v; }))
-
-#else
-# define __bswap_constant_64(x) \
- ((((x) & 0xff00000000000000ul) >> 56) \
- | (((x) & 0x00ff000000000000ul) >> 40) \
- | (((x) & 0x0000ff0000000000ul) >> 24) \
- | (((x) & 0x000000ff00000000ul) >> 8) \
- | (((x) & 0x00000000ff000000ul) << 8) \
- | (((x) & 0x0000000000ff0000ul) << 24) \
- | (((x) & 0x000000000000ff00ul) << 40) \
- | (((x) & 0x00000000000000fful) << 56))
-
-static __inline unsigned long int
-__bswap_64 (unsigned long int __bsx)
-{
- return __bswap_constant_64 (__bsx);
-}
-#endif
-
-#endif /* _BITS_BYTESWAP_H */
diff --git a/sysdeps/ia64/bits/fenv.h b/sysdeps/ia64/bits/fenv.h
index 9bb20de27b..6e4f937981 100644
--- a/sysdeps/ia64/bits/fenv.h
+++ b/sysdeps/ia64/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/bits/floatn.h b/sysdeps/ia64/bits/floatn.h
new file mode 100644
index 0000000000..633ee10d65
--- /dev/null
+++ b/sysdeps/ia64/bits/floatn.h
@@ -0,0 +1,119 @@
+/* Macros to control TS 18661-3 glibc features on ia64.
+ Copyright (C) 2017-2018 Free Software 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 _BITS_FLOATN_H
+#define _BITS_FLOATN_H
+
+#include <features.h>
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the IEEE 754 binary128 format, and this
+ glibc includes corresponding *f128 interfaces for it. The required
+ libgcc support was added some time after the basic compiler
+ support. */
+#if __GNUC_PREREQ (4, 4)
+# define __HAVE_FLOAT128 1
+#else
+# define __HAVE_FLOAT128 0
+#endif
+
+/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
+ from the default float, double and long double types in this glibc. */
+#if __HAVE_FLOAT128
+# define __HAVE_DISTINCT_FLOAT128 1
+#else
+# define __HAVE_DISTINCT_FLOAT128 0
+#endif
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the right format for _Float64x, and this
+ glibc includes corresponding *f64x interfaces for it. */
+#define __HAVE_FLOAT64X 1
+
+/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
+ of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
+ the format of _Float128, which must be different from that of long
+ double. */
+#define __HAVE_FLOAT64X_LONG_DOUBLE 1
+
+#ifndef __ASSEMBLER__
+
+/* Defined to concatenate the literal suffix to be used with _Float128
+ types, if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* The literal suffix f128 exists only since GCC 7.0. */
+# define __f128(x) x##q
+# else
+# define __f128(x) x##f128
+# endif
+# endif
+
+/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* Add a typedef for older GCC compilers which don't natively support
+ _Complex _Float128. */
+typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
+# define __CFLOAT128 __cfloat128
+# else
+# define __CFLOAT128 _Complex _Float128
+# endif
+# endif
+
+/* The remaining of this file provides support for older compilers. */
+# if __HAVE_FLOAT128
+
+/* The type _Float128 exists only since GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+typedef __float128 _Float128;
+# endif
+
+/* __builtin_huge_valf128 doesn't exist before GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())
+# endif
+
+/* Older GCC has only a subset of built-in functions for _Float128 on
+ ia64, and __builtin_infq is not usable in static initializers.
+ Converting a narrower sNaN to _Float128 produces a quiet NaN, so
+ attempts to use _Float128 sNaNs will not work properly with older
+ compilers. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_copysignf128 __builtin_copysignq
+# define __builtin_fabsf128 __builtin_fabsq
+# define __builtin_inff128() ((_Float128) __builtin_inf ())
+# define __builtin_nanf128(x) ((_Float128) __builtin_nan (x))
+# define __builtin_nansf128(x) ((_Float128) __builtin_nans (x))
+# endif
+
+/* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
+ e.g.: __builtin_signbitf128, before GCC 6. However, there has never
+ been a __builtin_signbitf128 in GCC and the type-generic builtin is
+ only available since GCC 6. */
+# if !__GNUC_PREREQ (6, 0)
+# define __builtin_signbitf128 __signbitf128
+# endif
+
+# endif
+
+#endif /* !__ASSEMBLER__. */
+
+#include <bits/floatn-common.h>
+
+#endif /* _BITS_FLOATN_H */
diff --git a/sysdeps/ia64/bits/fp-logb.h b/sysdeps/ia64/bits/fp-logb.h
new file mode 100644
index 0000000000..e4cda10f44
--- /dev/null
+++ b/sysdeps/ia64/bits/fp-logb.h
@@ -0,0 +1,24 @@
+/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. IA64 version.
+ Copyright (C) 2016-2018 Free Software 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/fp-logb.h> directly; include <math.h> instead."
+#endif
+
+#define __FP_LOGB0_IS_MIN 1
+#define __FP_LOGBNAN_IS_MIN 0
diff --git a/sysdeps/ia64/bits/huge_vall.h b/sysdeps/ia64/bits/huge_vall.h
deleted file mode 100644
index 24281792f8..0000000000
--- a/sysdeps/ia64/bits/huge_vall.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* `HUGE_VALL' constant for ia64 (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 2000-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/huge_vall.h> directly; include <math.h> instead."
-#endif
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VALL (__builtin_huge_vall())
-#elif __GNUC_PREREQ(2,96)
-# define HUGE_VALL (__extension__ 0x1.0p32767L)
-#else
-
-# define __HUGE_VALL_bytes { 0,0,0,0,0,0,0, 0x80, 0xff, 0x7f, 0,0,0,0,0,0}
-
-# define __huge_vall_t union { unsigned char __c[16]; long double __ld; }
-# ifdef __GNUC__
-# define HUGE_VALL (__extension__ \
- ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld)
-# else /* Not GCC. */
-static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
-# define HUGE_VALL (__huge_vall.__ld)
-# endif /* GCC. */
-
-#endif /* GCC 2.95 */
diff --git a/sysdeps/ia64/bits/link.h b/sysdeps/ia64/bits/link.h
index b39db79dc2..abe558f350 100644
--- a/sysdeps/ia64/bits/link.h
+++ b/sysdeps/ia64/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/bits/mathdef.h b/sysdeps/ia64/bits/mathdef.h
deleted file mode 100644
index 5a31bd3db7..0000000000
--- a/sysdeps/ia64/bits/mathdef.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 2000-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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* The IA-64 architecture computes values with the precision of the
- used type. */
-typedef float float_t; /* `float' expressions are evaluated as
- `float'. */
-typedef double double_t; /* `double' expressions are evaluated as
- `double'. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647 - 1)
-# define FP_ILOGBNAN 2147483647
-
-#endif /* ISO C99 */
diff --git a/sysdeps/ia64/bits/xtitypes.h b/sysdeps/ia64/bits/xtitypes.h
index 65141bbb82..60ba7aff54 100644
--- a/sysdeps/ia64/bits/xtitypes.h
+++ b/sysdeps/ia64/bits/xtitypes.h
@@ -1,5 +1,5 @@
/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>. IA64
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/bzero.S b/sysdeps/ia64/bzero.S
index 34fe4438c6..96329eea9e 100644
--- a/sysdeps/ia64/bzero.S
+++ b/sysdeps/ia64/bzero.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard bzero() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop for Itanium <Dan.Pop@cern.ch>.
Rewritten for McKinley by Sverre Jarp, HP Labs/CERN <Sverre.Jarp@cern.ch>
diff --git a/sysdeps/ia64/crti.S b/sysdeps/ia64/crti.S
index 7861d8a36f..c46e297814 100644
--- a/sysdeps/ia64/crti.S
+++ b/sysdeps/ia64/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for IA64.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -129,6 +129,7 @@ gmon_initializer:
.section .init,"ax",@progbits
.global _init#
+ .hidden _init#
.proc _init#
_init:
.prologue
@@ -145,6 +146,7 @@ _init:
.section .fini,"ax",@progbits
.global _fini#
+ .hidden _fini#
.proc _fini#
_fini:
.prologue
diff --git a/sysdeps/ia64/crtn.S b/sysdeps/ia64/crtn.S
index 22b9015c80..bc41a94583 100644
--- a/sysdeps/ia64/crtn.S
+++ b/sysdeps/ia64/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for ARM.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/dl-dtprocnum.h b/sysdeps/ia64/dl-dtprocnum.h
index a0a4dcfeea..a02a6e134f 100644
--- a/sysdeps/ia64/dl-dtprocnum.h
+++ b/sysdeps/ia64/dl-dtprocnum.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions. IA-64 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/dl-fptr.h b/sysdeps/ia64/dl-fptr.h
index 95a4bb60f0..26617b7a7b 100644
--- a/sysdeps/ia64/dl-fptr.h
+++ b/sysdeps/ia64/dl-fptr.h
@@ -1,5 +1,5 @@
/* Function descriptors. IA64 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/dl-lookupcfg.h b/sysdeps/ia64/dl-lookupcfg.h
index c0e6200dd6..48f91202c4 100644
--- a/sysdeps/ia64/dl-lookupcfg.h
+++ b/sysdeps/ia64/dl-lookupcfg.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/dl-machine.h b/sysdeps/ia64/dl-machine.h
index 3e934fe30e..61d7bb5795 100644
--- a/sysdeps/ia64/dl-machine.h
+++ b/sysdeps/ia64/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. IA-64 version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -45,7 +45,7 @@ __ia64_init_bootstrap_fdesc_table (struct link_map *map)
}
#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
- __ia64_init_bootstrap_fdesc_table (&bootstrap_map);
+ __ia64_init_bootstrap_fdesc_table (BOOTSTRAP_MAP);
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int __attribute__ ((unused))
@@ -333,6 +333,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
/* Fixup a PLT entry to bounce directly to the function at VALUE. */
static inline struct fdesc __attribute__ ((always_inline))
elf_machine_fixup_plt (struct link_map *l, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf64_Rela *reloc,
Elf64_Addr *reloc_addr, struct fdesc value)
{
@@ -418,13 +419,13 @@ elf_machine_rela (struct link_map *map,
/* RESOLVE_MAP() will return NULL if it fail to locate the symbol. */
if ((sym_map = RESOLVE_MAP (&sym, version, r_type)))
{
- value = sym_map->l_addr + sym->st_value + reloc->r_addend;
+ value = SYMBOL_ADDRESS (sym_map, sym, true) + reloc->r_addend;
if (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_DIR64LSB))
;/* No adjustment. */
else if (r_type == R_IA64_IPLTLSB)
{
- elf_machine_fixup_plt (NULL, NULL, reloc, reloc_addr,
+ elf_machine_fixup_plt (NULL, NULL, NULL, NULL, reloc, reloc_addr,
DL_FIXUP_MAKE_VALUE (sym_map, value));
return;
}
diff --git a/sysdeps/ia64/dl-sysdep.h b/sysdeps/ia64/dl-sysdep.h
index 4a45e20630..0b571a5cc7 100644
--- a/sysdeps/ia64/dl-sysdep.h
+++ b/sysdeps/ia64/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. IA-64 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/dl-tls.h b/sysdeps/ia64/dl-tls.h
index bc008882bf..d589a5a233 100644
--- a/sysdeps/ia64/dl-tls.h
+++ b/sysdeps/ia64/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. IA-64 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,6 +28,3 @@
#define DONT_USE_TLS_INDEX 1
extern void *__tls_get_addr (size_t m, size_t offset);
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/ia64/dl-trampoline.S b/sysdeps/ia64/dl-trampoline.S
index b315e856f0..fc24c425bf 100644
--- a/sysdeps/ia64/dl-trampoline.S
+++ b/sysdeps/ia64/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. ia64 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/float128-abi.h b/sysdeps/ia64/float128-abi.h
new file mode 100644
index 0000000000..6b954cc673
--- /dev/null
+++ b/sysdeps/ia64/float128-abi.h
@@ -0,0 +1,2 @@
+/* ABI version for _Float128 ABI introduction. */
+#define FLOAT128_VERSION GLIBC_2.26
diff --git a/sysdeps/ia64/fpu/bits/math-finite.h b/sysdeps/ia64/fpu/bits/math-finite.h
index 9fb6d51c11..7f52bc388b 100644
--- a/sysdeps/ia64/fpu/bits/math-finite.h
+++ b/sysdeps/ia64/fpu/bits/math-finite.h
@@ -1,5 +1,5 @@
/* Entry points to finite-math-only compiler runs.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/fpu/bits/mathinline.h b/sysdeps/ia64/fpu/bits/mathinline.h
deleted file mode 100644
index b9db888ab6..0000000000
--- a/sysdeps/ia64/fpu/bits/mathinline.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Inline math functions for ia64.
- Copyright (C) 2004-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/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_inline
-#endif
-
-#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
-/* The gcc, version 2.7 or below, has problems with all this inlining
- code. So disable it for this version of the compiler. */
-# if __GNUC_PREREQ (2, 8)
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
- __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
- return __u.__i[1] < 0;
-}
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
- return (__u.__i[2] & 0x8000) != 0;
-}
-# endif
-#endif
diff --git a/sysdeps/ia64/fpu/e_acos.S b/sysdeps/ia64/fpu/e_acos.S
index c2b31ab85e..ad7901612c 100644
--- a/sysdeps/ia64/fpu/e_acos.S
+++ b/sysdeps/ia64/fpu/e_acos.S
@@ -822,6 +822,7 @@ acos_abs_gt_1:
}
;;
GLOBAL_LIBM_END(acos)
+libm_alias_double_other (acos, acos)
diff --git a/sysdeps/ia64/fpu/e_acosf.S b/sysdeps/ia64/fpu/e_acosf.S
index bdcac59d22..c0dac3df10 100644
--- a/sysdeps/ia64/fpu/e_acosf.S
+++ b/sysdeps/ia64/fpu/e_acosf.S
@@ -600,6 +600,7 @@ ACOSF_ABS_ONE:
}
GLOBAL_LIBM_END(acosf)
+libm_alias_float_other (acos, acos)
// Stack operations when calling error support.
diff --git a/sysdeps/ia64/fpu/e_acosh.S b/sysdeps/ia64/fpu/e_acosh.S
index fb25fa0053..f8c75e427d 100644
--- a/sysdeps/ia64/fpu/e_acosh.S
+++ b/sysdeps/ia64/fpu/e_acosh.S
@@ -1139,6 +1139,7 @@ ACOSH_LESS_ONE:
;;
GLOBAL_LIBM_END(acosh)
+libm_alias_double_other (acosh, acosh)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_acoshf.S b/sysdeps/ia64/fpu/e_acoshf.S
index 58ef5f2adb..4affbdf5f0 100644
--- a/sysdeps/ia64/fpu/e_acoshf.S
+++ b/sysdeps/ia64/fpu/e_acoshf.S
@@ -967,6 +967,7 @@ ACOSH_LESS_ONE:
;;
GLOBAL_LIBM_END(acoshf)
+libm_alias_float_other (acosh, acosh)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_acoshl.S b/sysdeps/ia64/fpu/e_acoshl.S
index 9bd556389b..b5c58884f2 100644
--- a/sysdeps/ia64/fpu/e_acoshl.S
+++ b/sysdeps/ia64/fpu/e_acoshl.S
@@ -1650,6 +1650,7 @@ acoshl_lt_pone:
};;
GLOBAL_LIBM_END(acoshl)
+libm_alias_ldouble_other (acosh, acosh)
diff --git a/sysdeps/ia64/fpu/e_acosl.S b/sysdeps/ia64/fpu/e_acosl.S
index 8c5155a2ec..107266b6a3 100644
--- a/sysdeps/ia64/fpu/e_acosl.S
+++ b/sysdeps/ia64/fpu/e_acosl.S
@@ -2481,6 +2481,7 @@ acosl_SPECIAL_CASES:
GLOBAL_LIBM_END(acosl)
+libm_alias_ldouble_other (acos, acos)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_asin.S b/sysdeps/ia64/fpu/e_asin.S
index f995c597f4..4de08e59d5 100644
--- a/sysdeps/ia64/fpu/e_asin.S
+++ b/sysdeps/ia64/fpu/e_asin.S
@@ -798,6 +798,7 @@ asin_abs_gt_1:
}
;;
GLOBAL_LIBM_END(asin)
+libm_alias_double_other (asin, asin)
diff --git a/sysdeps/ia64/fpu/e_asinf.S b/sysdeps/ia64/fpu/e_asinf.S
index 74a18dd24a..a4b7fc2f27 100644
--- a/sysdeps/ia64/fpu/e_asinf.S
+++ b/sysdeps/ia64/fpu/e_asinf.S
@@ -583,6 +583,7 @@ ASINF_ABS_ONE:
;;
GLOBAL_LIBM_END(asinf)
+libm_alias_float_other (asin, asin)
// Stack operations when calling error support.
// (1) (2)
diff --git a/sysdeps/ia64/fpu/e_asinl.S b/sysdeps/ia64/fpu/e_asinl.S
index 792a0c6578..18153d427f 100644
--- a/sysdeps/ia64/fpu/e_asinl.S
+++ b/sysdeps/ia64/fpu/e_asinl.S
@@ -2457,6 +2457,7 @@ SMALL_S:
GLOBAL_LIBM_END(asinl)
+libm_alias_ldouble_other (asin, asin)
diff --git a/sysdeps/ia64/fpu/e_atan2.S b/sysdeps/ia64/fpu/e_atan2.S
index 7a17fbfed4..1786794e7d 100644
--- a/sysdeps/ia64/fpu/e_atan2.S
+++ b/sysdeps/ia64/fpu/e_atan2.S
@@ -985,6 +985,7 @@ ATAN2_ERROR:
;;
}
GLOBAL_IEEE754_END(atan2)
+libm_alias_double_other (__atan2, atan2)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_atan2f.S b/sysdeps/ia64/fpu/e_atan2f.S
index 5ff561d7ca..6b318a5ced 100644
--- a/sysdeps/ia64/fpu/e_atan2f.S
+++ b/sysdeps/ia64/fpu/e_atan2f.S
@@ -826,6 +826,7 @@ ATAN2F_XY_INF_NAN_ZERO:
GLOBAL_IEEE754_END(atan2f)
+libm_alias_float_other (__atan2, atan2)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_atanh.S b/sysdeps/ia64/fpu/e_atanh.S
index 4ae5ee6926..45760af71d 100644
--- a/sysdeps/ia64/fpu/e_atanh.S
+++ b/sysdeps/ia64/fpu/e_atanh.S
@@ -1008,6 +1008,7 @@ atanh_ge_one:
;;
GLOBAL_LIBM_END(atanh)
+libm_alias_double_other (atanh, atanh)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_atanhf.S b/sysdeps/ia64/fpu/e_atanhf.S
index 1ec1408e35..3c550f9dc4 100644
--- a/sysdeps/ia64/fpu/e_atanhf.S
+++ b/sysdeps/ia64/fpu/e_atanhf.S
@@ -781,6 +781,7 @@ atanhf_ge_one:
;;
GLOBAL_LIBM_END(atanhf)
+libm_alias_float_other (atanh, atanh)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_atanhl.S b/sysdeps/ia64/fpu/e_atanhl.S
index 5d828d5ffa..96c6360a2b 100644
--- a/sysdeps/ia64/fpu/e_atanhl.S
+++ b/sysdeps/ia64/fpu/e_atanhl.S
@@ -1101,6 +1101,7 @@ atanhl_gt_one:
};;
GLOBAL_LIBM_END(atanhl)
+libm_alias_ldouble_other (atanh, atanh)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/e_cosh.S b/sysdeps/ia64/fpu/e_cosh.S
index 885456b389..dbac1804ff 100644
--- a/sysdeps/ia64/fpu/e_cosh.S
+++ b/sysdeps/ia64/fpu/e_cosh.S
@@ -811,6 +811,7 @@ COSH_UNORM:
;;
GLOBAL_IEEE754_END(cosh)
+libm_alias_double_other (__cosh, cosh)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_coshf.S b/sysdeps/ia64/fpu/e_coshf.S
index 97cb4e1771..51a87b840e 100644
--- a/sysdeps/ia64/fpu/e_coshf.S
+++ b/sysdeps/ia64/fpu/e_coshf.S
@@ -652,6 +652,7 @@ COSH_UNORM:
;;
GLOBAL_IEEE754_END(coshf)
+libm_alias_float_other (__cosh, cosh)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_coshl.S b/sysdeps/ia64/fpu/e_coshl.S
index 43da1ab04d..0d18f2d06a 100644
--- a/sysdeps/ia64/fpu/e_coshl.S
+++ b/sysdeps/ia64/fpu/e_coshl.S
@@ -1032,6 +1032,7 @@ COSH_HUGE:
;;
GLOBAL_IEEE754_END(coshl)
+libm_alias_ldouble_other (__cosh, cosh)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_exp.S b/sysdeps/ia64/fpu/e_exp.S
index f17bc26081..c8cebeb177 100644
--- a/sysdeps/ia64/fpu/e_exp.S
+++ b/sysdeps/ia64/fpu/e_exp.S
@@ -738,6 +738,7 @@ EXP_UNDERFLOW_ZERO:
;;
GLOBAL_IEEE754_END(exp)
+libm_alias_double_other (__exp, exp)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_exp10.S b/sysdeps/ia64/fpu/e_exp10.S
index eafa59dd7c..f12344bee3 100644
--- a/sysdeps/ia64/fpu/e_exp10.S
+++ b/sysdeps/ia64/fpu/e_exp10.S
@@ -87,6 +87,8 @@
// p6-p12
//
+#include <shlib-compat.h>
+
GR_TBL_START = r2
GR_LOG_TBL = r3
@@ -534,7 +536,10 @@ OUT_RANGE_exp10:
;;
GLOBAL_IEEE754_END(exp10)
-weak_alias (exp10, pow10)
+libm_alias_double_other (__exp10, exp10)
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
+compat_symbol (libm, exp10, pow10, GLIBC_2_2)
+#endif
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_exp10f.S b/sysdeps/ia64/fpu/e_exp10f.S
index fa54e9039f..67218c737f 100644
--- a/sysdeps/ia64/fpu/e_exp10f.S
+++ b/sysdeps/ia64/fpu/e_exp10f.S
@@ -86,6 +86,8 @@
// p6-p12
//
+#include <shlib-compat.h>
+
GR_TBL_START = r2
GR_LOG_TBL = r3
@@ -486,7 +488,10 @@ OUT_RANGE_exp10:
;;
GLOBAL_IEEE754_END(exp10f)
-weak_alias (exp10f, pow10f)
+libm_alias_float_other (__exp10, exp10)
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
+compat_symbol (libm, exp10f, pow10f, GLIBC_2_2)
+#endif
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_exp10l.S b/sysdeps/ia64/fpu/e_exp10l.S
index f72d547ebf..0cc54e2b58 100644
--- a/sysdeps/ia64/fpu/e_exp10l.S
+++ b/sysdeps/ia64/fpu/e_exp10l.S
@@ -85,6 +85,8 @@
// p6-p8, p11-p14
//
+#include <shlib-compat.h>
+
FR_X = f10
FR_Y = f1
@@ -747,7 +749,10 @@ OUT_RANGE_EXP10:
;;
GLOBAL_IEEE754_END(exp10l)
-weak_alias (exp10l, pow10l)
+libm_alias_ldouble_other (__exp10, exp10)
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
+compat_symbol (libm, exp10l, pow10l, GLIBC_2_2)
+#endif
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_exp2.S b/sysdeps/ia64/fpu/e_exp2.S
index 54f652e384..18711866a1 100644
--- a/sysdeps/ia64/fpu/e_exp2.S
+++ b/sysdeps/ia64/fpu/e_exp2.S
@@ -494,6 +494,7 @@ OUT_RANGE_exp2:
;;
GLOBAL_LIBM_END(exp2)
+libm_alias_double_other (exp2, exp2)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_exp2f.S b/sysdeps/ia64/fpu/e_exp2f.S
index 36354ae3bd..77bc6ea686 100644
--- a/sysdeps/ia64/fpu/e_exp2f.S
+++ b/sysdeps/ia64/fpu/e_exp2f.S
@@ -221,7 +221,7 @@ LOCAL_OBJECT_END(T_table)
.section .text
-GLOBAL_LIBM_ENTRY(exp2f)
+GLOBAL_LIBM_ENTRY(__exp2f)
{.mfi
@@ -468,7 +468,14 @@ OUT_RANGE_exp2:
}
;;
-GLOBAL_LIBM_END(exp2f)
+GLOBAL_LIBM_END(__exp2f)
+libm_alias_float_other (__exp2, exp2)
+#ifdef SHARED
+.symver __exp2f,exp2f@@GLIBC_2.27
+.weak __exp2f_compat
+.set __exp2f_compat,__exp2f
+.symver __exp2f_compat,exp2f@GLIBC_2.2
+#endif
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/i386/fpu/halfulp.c b/sysdeps/ia64/fpu/e_exp2f_data.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/i386/fpu/halfulp.c
+++ b/sysdeps/ia64/fpu/e_exp2f_data.c
diff --git a/sysdeps/ia64/fpu/e_exp2l.S b/sysdeps/ia64/fpu/e_exp2l.S
index 743ed3558b..c2912ab6de 100644
--- a/sysdeps/ia64/fpu/e_exp2l.S
+++ b/sysdeps/ia64/fpu/e_exp2l.S
@@ -746,6 +746,7 @@ OUT_RANGE_exp2l:
GLOBAL_LIBM_END(exp2l)
+libm_alias_ldouble_other (exp2, exp2)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_expf.S b/sysdeps/ia64/fpu/e_expf.S
index 75f918f78e..c95ccafee3 100644
--- a/sysdeps/ia64/fpu/e_expf.S
+++ b/sysdeps/ia64/fpu/e_expf.S
@@ -657,6 +657,13 @@ EXP_UNDERFLOW_ZERO:
;;
GLOBAL_IEEE754_END(expf)
+libm_alias_float_other (__exp, exp)
+#ifdef SHARED
+.symver expf,expf@@GLIBC_2.27
+.weak __expf_compat
+.set __expf_compat,__expf
+.symver __expf_compat,expf@GLIBC_2.2
+#endif
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_fmod.S b/sysdeps/ia64/fpu/e_fmod.S
index c29056e34a..3eaaf49fbb 100644
--- a/sysdeps/ia64/fpu/e_fmod.S
+++ b/sysdeps/ia64/fpu/e_fmod.S
@@ -499,6 +499,7 @@ FMOD_Y_ZERO:
}
GLOBAL_IEEE754_END(fmod)
+libm_alias_double_other (__fmod, fmod)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/e_fmodf.S b/sysdeps/ia64/fpu/e_fmodf.S
index f5aec469ca..149e27f1a1 100644
--- a/sysdeps/ia64/fpu/e_fmodf.S
+++ b/sysdeps/ia64/fpu/e_fmodf.S
@@ -514,6 +514,7 @@ EXP_ERROR_RETURN:
}
GLOBAL_IEEE754_END(fmodf)
+libm_alias_float_other (__fmod, fmod)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/e_fmodl.S b/sysdeps/ia64/fpu/e_fmodl.S
index 258e4ef8a6..3bd9b77812 100644
--- a/sysdeps/ia64/fpu/e_fmodl.S
+++ b/sysdeps/ia64/fpu/e_fmodl.S
@@ -606,6 +606,7 @@ FMOD_B_ZERO:
;;
GLOBAL_IEEE754_END(fmodl)
+libm_alias_ldouble_other (__fmod, fmod)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/e_hypot.S b/sysdeps/ia64/fpu/e_hypot.S
index 146bb2fb1b..34c2761dc3 100644
--- a/sysdeps/ia64/fpu/e_hypot.S
+++ b/sysdeps/ia64/fpu/e_hypot.S
@@ -385,6 +385,7 @@ GLOBAL_IEEE754_ENTRY(hypot)
(p9) br.ret.sptk b0;;
}
GLOBAL_IEEE754_END(hypot)
+libm_alias_double_other (__hypot, hypot)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/e_hypotf.S b/sysdeps/ia64/fpu/e_hypotf.S
index 43a2fe4a27..6c6f5782ff 100644
--- a/sysdeps/ia64/fpu/e_hypotf.S
+++ b/sysdeps/ia64/fpu/e_hypotf.S
@@ -338,6 +338,7 @@ GLOBAL_IEEE754_ENTRY(hypotf)
(p9) br.ret.sptk b0;;
}
GLOBAL_IEEE754_END(hypotf)
+libm_alias_float_other (__hypot, hypot)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/e_hypotl.S b/sysdeps/ia64/fpu/e_hypotl.S
index 07bb6860ed..9a3f31485f 100644
--- a/sysdeps/ia64/fpu/e_hypotl.S
+++ b/sysdeps/ia64/fpu/e_hypotl.S
@@ -422,6 +422,7 @@ GLOBAL_IEEE754_ENTRY(hypotl)
(p9) br.ret.sptk b0;;
}
GLOBAL_IEEE754_END(hypotl)
+libm_alias_ldouble_other (__hypot, hypot)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/e_lgamma_r.c b/sysdeps/ia64/fpu/e_lgamma_r.c
index cb9efbfe02..8ae6df3419 100644
--- a/sysdeps/ia64/fpu/e_lgamma_r.c
+++ b/sysdeps/ia64/fpu/e_lgamma_r.c
@@ -60,7 +60,7 @@ double __ieee754_lgamma_r(double x, int* signgam)
{
return __libm_lgamma(x, signgam, sizeof(*signgam));
}
-weak_alias (__ieee754_lgamma_r, lgamma_r)
+libm_alias_double_r (__ieee754_lgamma, lgamma, _r)
#ifndef _LIBC
double __ieee754_gamma_r(double x, int* signgam)
diff --git a/sysdeps/ia64/fpu/e_lgammaf_r.c b/sysdeps/ia64/fpu/e_lgammaf_r.c
index 44911aeabd..9af43702ad 100644
--- a/sysdeps/ia64/fpu/e_lgammaf_r.c
+++ b/sysdeps/ia64/fpu/e_lgammaf_r.c
@@ -60,7 +60,7 @@ float __ieee754_lgammaf_r(float x, int* signgam)
{
return __libm_lgammaf(x, signgam, sizeof(*signgam));
}
-weak_alias (__ieee754_lgammaf_r, lgammaf_r)
+libm_alias_float_r (__ieee754_lgamma, lgamma, _r)
#ifndef _LIBC
float __ieee754_gammaf_r(float x, int* signgam)
diff --git a/sysdeps/ia64/fpu/e_lgammal_r.c b/sysdeps/ia64/fpu/e_lgammal_r.c
index 4451201b77..1f227c86db 100644
--- a/sysdeps/ia64/fpu/e_lgammal_r.c
+++ b/sysdeps/ia64/fpu/e_lgammal_r.c
@@ -59,7 +59,7 @@ long double __ieee754_lgammal_r(long double x, int* signgam)
{
return __libm_lgammal(x, signgam, sizeof(*signgam));
}
-weak_alias (__ieee754_lgammal_r, lgammal_r)
+libm_alias_ldouble_r (__ieee754_lgamma, lgamma, _r)
#ifndef _LIBC
long double __ieee754_gammal_r(long double x, int* signgam)
diff --git a/sysdeps/ia64/fpu/e_log.S b/sysdeps/ia64/fpu/e_log.S
index 50eed956da..0b63ec43c5 100644
--- a/sysdeps/ia64/fpu/e_log.S
+++ b/sysdeps/ia64/fpu/e_log.S
@@ -1386,6 +1386,7 @@ GLOBAL_IEEE754_ENTRY(log10)
br.cond.sptk log_log10_common
};;
GLOBAL_IEEE754_END(log10)
+libm_alias_double_other (__log10, log10)
GLOBAL_IEEE754_ENTRY(log)
@@ -1668,6 +1669,7 @@ log_libm_err:
nop.i 0
};;
GLOBAL_IEEE754_END(log)
+libm_alias_double_other (__log, log)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_log2.S b/sysdeps/ia64/fpu/e_log2.S
index c2b37a65ce..17893a2ede 100644
--- a/sysdeps/ia64/fpu/e_log2.S
+++ b/sysdeps/ia64/fpu/e_log2.S
@@ -654,6 +654,7 @@ SPECIAL_LOG2:
}
GLOBAL_LIBM_END(log2)
+libm_alias_double_other (log2, log2)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_log2f.S b/sysdeps/ia64/fpu/e_log2f.S
index 2c3f18f360..5ca3bd61ea 100644
--- a/sysdeps/ia64/fpu/e_log2f.S
+++ b/sysdeps/ia64/fpu/e_log2f.S
@@ -252,7 +252,7 @@ LOCAL_OBJECT_END(T_table)
.section .text
-GLOBAL_LIBM_ENTRY(log2f)
+GLOBAL_LIBM_ENTRY(__log2f)
{ .mfi
alloc r32=ar.pfs,1,4,4,0
@@ -491,7 +491,14 @@ SPECIAL_log2f:
br.ret.sptk b0;;
}
-GLOBAL_LIBM_END(log2f)
+GLOBAL_LIBM_END(__log2f)
+libm_alias_float_other (__log2, log2)
+#ifdef SHARED
+.symver __log2f,log2f@@GLIBC_2.27
+.weak __log2f_compat
+.set __log2f_compat,__log2f
+.symver __log2f_compat,log2f@GLIBC_2.2
+#endif
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/i386/fpu/mpexp.c b/sysdeps/ia64/fpu/e_log2f_data.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/i386/fpu/mpexp.c
+++ b/sysdeps/ia64/fpu/e_log2f_data.c
diff --git a/sysdeps/ia64/fpu/e_log2l.S b/sysdeps/ia64/fpu/e_log2l.S
index 4d5a828f58..51bfd9a278 100644
--- a/sysdeps/ia64/fpu/e_log2l.S
+++ b/sysdeps/ia64/fpu/e_log2l.S
@@ -760,6 +760,7 @@ LOG2_PSEUDO_ZERO:
GLOBAL_IEEE754_END(log2l)
+libm_alias_ldouble_other (__log2, log2)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_logf.S b/sysdeps/ia64/fpu/e_logf.S
index 2dda2186d0..d299242198 100644
--- a/sysdeps/ia64/fpu/e_logf.S
+++ b/sysdeps/ia64/fpu/e_logf.S
@@ -842,6 +842,7 @@ GLOBAL_IEEE754_ENTRY(log10f)
br.cond.sptk logf_log10f_common
};;
GLOBAL_IEEE754_END(log10f)
+libm_alias_float_other (__log10, log10)
GLOBAL_IEEE754_ENTRY(logf)
{ .mfi
@@ -1088,6 +1089,13 @@ logf_libm_err:
nop.i 0
};;
GLOBAL_IEEE754_END(logf)
+libm_alias_float_other (__log, log)
+#ifdef SHARED
+.symver logf,logf@@GLIBC_2.27
+.weak __logf_compat
+.set __logf_compat,__logf
+.symver __logf_compat,logf@GLIBC_2.2
+#endif
// Stack operations when calling error support.
diff --git a/sysdeps/i386/fpu/mplog.c b/sysdeps/ia64/fpu/e_logf_data.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/i386/fpu/mplog.c
+++ b/sysdeps/ia64/fpu/e_logf_data.c
diff --git a/sysdeps/ia64/fpu/e_logl.S b/sysdeps/ia64/fpu/e_logl.S
index 996f64aaee..2ffe106a26 100644
--- a/sysdeps/ia64/fpu/e_logl.S
+++ b/sysdeps/ia64/fpu/e_logl.S
@@ -633,6 +633,7 @@ GLOBAL_IEEE754_ENTRY(logl)
;;
GLOBAL_IEEE754_END(logl)
+libm_alias_ldouble_other (__log, log)
GLOBAL_IEEE754_ENTRY(log10l)
@@ -1145,6 +1146,7 @@ LOGL_64_negative:
GLOBAL_IEEE754_END(log10l)
+libm_alias_ldouble_other (__log10, log10)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/e_pow.S b/sysdeps/ia64/fpu/e_pow.S
index 765f509695..3b402f3f14 100644
--- a/sysdeps/ia64/fpu/e_pow.S
+++ b/sysdeps/ia64/fpu/e_pow.S
@@ -2234,6 +2234,7 @@ POW_OVER_UNDER_ERROR:
;;
GLOBAL_LIBM_END(pow)
+libm_alias_double_other (pow, pow)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_powf.S b/sysdeps/ia64/fpu/e_powf.S
index d61bc79e5e..7449f8c7d5 100644
--- a/sysdeps/ia64/fpu/e_powf.S
+++ b/sysdeps/ia64/fpu/e_powf.S
@@ -868,7 +868,7 @@ data8 0xEAC0C6E7DD24392F , 0x00003FFF
LOCAL_OBJECT_END(pow_tbl2)
.section .text
-GLOBAL_LIBM_ENTRY(powf)
+GLOBAL_LIBM_ENTRY(__powf)
// Get exponent of x. Will be used to calculate K.
{ .mfi
@@ -2002,7 +2002,14 @@ POW_OVER_UNDER_ERROR:
}
;;
-GLOBAL_LIBM_END(powf)
+GLOBAL_LIBM_END(__powf)
+libm_alias_float_other (__pow, pow)
+#ifdef SHARED
+.symver __powf,powf@@GLIBC_2.27
+.weak __powf_compat
+.set __powf_compat,__powf
+.symver __powf_compat,powf@GLIBC_2.2
+#endif
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/i386/fpu/slowexp.c b/sysdeps/ia64/fpu/e_powf_log2_data.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/i386/fpu/slowexp.c
+++ b/sysdeps/ia64/fpu/e_powf_log2_data.c
diff --git a/sysdeps/ia64/fpu/e_powl.S b/sysdeps/ia64/fpu/e_powl.S
index 3f93f6090e..4596322f15 100644
--- a/sysdeps/ia64/fpu/e_powl.S
+++ b/sysdeps/ia64/fpu/e_powl.S
@@ -2755,6 +2755,7 @@ POWL_64_SQRT:
;;
GLOBAL_LIBM_END(powl)
+libm_alias_ldouble_other (pow, pow)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_remainder.S b/sysdeps/ia64/fpu/e_remainder.S
index 3cd5aac578..acefe7b9c9 100644
--- a/sysdeps/ia64/fpu/e_remainder.S
+++ b/sysdeps/ia64/fpu/e_remainder.S
@@ -529,6 +529,7 @@ EXP_ERROR_RETURN:
}
GLOBAL_IEEE754_END(remainder)
+libm_alias_double_other (__remainder, remainder)
weak_alias (__remainder, drem)
diff --git a/sysdeps/ia64/fpu/e_remainderf.S b/sysdeps/ia64/fpu/e_remainderf.S
index df4cfdddc8..5b8d029d9a 100644
--- a/sysdeps/ia64/fpu/e_remainderf.S
+++ b/sysdeps/ia64/fpu/e_remainderf.S
@@ -548,6 +548,7 @@ EXP_ERROR_RETURN:
}
GLOBAL_IEEE754_END(remainderf)
+libm_alias_float_other (__remainder, remainder)
weak_alias (__remainderf, dremf)
diff --git a/sysdeps/ia64/fpu/e_remainderl.S b/sysdeps/ia64/fpu/e_remainderl.S
index d9a9ee8d29..bdc2b8fae4 100644
--- a/sysdeps/ia64/fpu/e_remainderl.S
+++ b/sysdeps/ia64/fpu/e_remainderl.S
@@ -557,6 +557,7 @@ EXP_ERROR_RETURN:
}
GLOBAL_IEEE754_END(remainderl)
+libm_alias_ldouble_other (__remainder, remainder)
weak_alias (__remainderl, dreml)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_sinh.S b/sysdeps/ia64/fpu/e_sinh.S
index f60907b72b..2167c78edc 100644
--- a/sysdeps/ia64/fpu/e_sinh.S
+++ b/sysdeps/ia64/fpu/e_sinh.S
@@ -850,6 +850,7 @@ SINH_UNORM:
;;
GLOBAL_IEEE754_END(sinh)
+libm_alias_double_other (__sinh, sinh)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_sinhf.S b/sysdeps/ia64/fpu/e_sinhf.S
index 6d808cb478..08b873ecb7 100644
--- a/sysdeps/ia64/fpu/e_sinhf.S
+++ b/sysdeps/ia64/fpu/e_sinhf.S
@@ -689,6 +689,7 @@ SINH_UNORM:
;;
GLOBAL_IEEE754_END(sinhf)
+libm_alias_float_other (__sinh, sinh)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_sinhl.S b/sysdeps/ia64/fpu/e_sinhl.S
index b560999514..65cfbf4066 100644
--- a/sysdeps/ia64/fpu/e_sinhl.S
+++ b/sysdeps/ia64/fpu/e_sinhl.S
@@ -1054,6 +1054,7 @@ SINH_HUGE:
;;
GLOBAL_IEEE754_END(sinhl)
+libm_alias_ldouble_other (__sinh, sinh)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_sqrt.S b/sysdeps/ia64/fpu/e_sqrt.S
index da4e8ccb6d..38d8a505ee 100644
--- a/sysdeps/ia64/fpu/e_sqrt.S
+++ b/sysdeps/ia64/fpu/e_sqrt.S
@@ -252,6 +252,7 @@ GLOBAL_IEEE754_ENTRY(sqrt)
}
// END DOUBLE PRECISION MINIMUM LATENCY SQUARE ROOT ALGORITHM
GLOBAL_IEEE754_END(sqrt)
+libm_alias_double_other (__sqrt, sqrt)
// Stack operations when calling error support.
// (1) (2) (3) (call) (4)
diff --git a/sysdeps/ia64/fpu/e_sqrtf.S b/sysdeps/ia64/fpu/e_sqrtf.S
index d50ff012e4..6741bb49ac 100644
--- a/sysdeps/ia64/fpu/e_sqrtf.S
+++ b/sysdeps/ia64/fpu/e_sqrtf.S
@@ -203,6 +203,7 @@ GLOBAL_IEEE754_ENTRY(sqrtf)
// with the result equal to frcpa(x)
//
GLOBAL_IEEE754_END(sqrtf)
+libm_alias_float_other (__sqrt, sqrt)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/e_sqrtf128.c b/sysdeps/ia64/fpu/e_sqrtf128.c
new file mode 100644
index 0000000000..d5bcb79aaa
--- /dev/null
+++ b/sysdeps/ia64/fpu/e_sqrtf128.c
@@ -0,0 +1 @@
+#include <sysdeps/x86/fpu/e_sqrtf128.c>
diff --git a/sysdeps/ia64/fpu/e_sqrtl.S b/sysdeps/ia64/fpu/e_sqrtl.S
index 6aa402150f..e1c22344d0 100644
--- a/sysdeps/ia64/fpu/e_sqrtl.S
+++ b/sysdeps/ia64/fpu/e_sqrtl.S
@@ -221,6 +221,7 @@ alloc r32= ar.pfs,0,5,4,0
// END DOUBLE EXTENDED PRECISION MINIMUM LATENCY SQUARE ROOT ALGORITHM
GLOBAL_IEEE754_END(sqrtl)
+libm_alias_ldouble_other (__sqrt, sqrt)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/fclrexcpt.c b/sysdeps/ia64/fpu/fclrexcpt.c
index ec3b285f9f..546022f80a 100644
--- a/sysdeps/ia64/fpu/fclrexcpt.c
+++ b/sysdeps/ia64/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999 and
Jes Sorensen <Jes.Sorensen@cern.ch>, 2000
diff --git a/sysdeps/ia64/fpu/fedisblxcpt.c b/sysdeps/ia64/fpu/fedisblxcpt.c
index 488b8e5aa0..441eeb400a 100644
--- a/sysdeps/ia64/fpu/fedisblxcpt.c
+++ b/sysdeps/ia64/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jes Sorensen <Jes.Sorensen@cern.ch>, 2000.
diff --git a/sysdeps/ia64/fpu/feenablxcpt.c b/sysdeps/ia64/fpu/feenablxcpt.c
index 4a52f823a5..bb19aef6b7 100644
--- a/sysdeps/ia64/fpu/feenablxcpt.c
+++ b/sysdeps/ia64/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jes Sorensen <Jes.Sorensen@cern.ch>, 2000.
diff --git a/sysdeps/ia64/fpu/fegetenv.c b/sysdeps/ia64/fpu/fegetenv.c
index e490b2e7d9..9b304e4758 100644
--- a/sysdeps/ia64/fpu/fegetenv.c
+++ b/sysdeps/ia64/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
diff --git a/sysdeps/ia64/fpu/fegetexcept.c b/sysdeps/ia64/fpu/fegetexcept.c
index 7c59df7964..797a069b70 100644
--- a/sysdeps/ia64/fpu/fegetexcept.c
+++ b/sysdeps/ia64/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jes Sorensen <Jes.Sorensen@cern.ch>, 2000.
diff --git a/sysdeps/ia64/fpu/fegetmode.c b/sysdeps/ia64/fpu/fegetmode.c
new file mode 100644
index 0000000000..a2ab4feec8
--- /dev/null
+++ b/sysdeps/ia64/fpu/fegetmode.c
@@ -0,0 +1,26 @@
+/* Store current floating-point control modes. IA64 version.
+ Copyright (C) 2016-2018 Free Software 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/fegetround.c b/sysdeps/ia64/fpu/fegetround.c
index 11aa43929a..cd22788ff0 100644
--- a/sysdeps/ia64/fpu/fegetround.c
+++ b/sysdeps/ia64/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
diff --git a/sysdeps/ia64/fpu/feholdexcpt.c b/sysdeps/ia64/fpu/feholdexcpt.c
index 0b135a92cf..ac46449450 100644
--- a/sysdeps/ia64/fpu/feholdexcpt.c
+++ b/sysdeps/ia64/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999
diff --git a/sysdeps/ia64/fpu/fesetenv.c b/sysdeps/ia64/fpu/fesetenv.c
index 8e206ab8ce..8097c9fd16 100644
--- a/sysdeps/ia64/fpu/fesetenv.c
+++ b/sysdeps/ia64/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jes Sorensen <Jes.Sorensen@cern.ch>, 2000
diff --git a/sysdeps/ia64/fpu/fesetexcept.c b/sysdeps/ia64/fpu/fesetexcept.c
new file mode 100644
index 0000000000..c3c868dcfc
--- /dev/null
+++ b/sysdeps/ia64/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. IA64 version.
+ Copyright (C) 2016-2018 Free Software 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..7eda1d6469
--- /dev/null
+++ b/sysdeps/ia64/fpu/fesetmode.c
@@ -0,0 +1,42 @@
+/* Install given floating-point control modes. IA64 version.
+ Copyright (C) 2016-2018 Free Software 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/fesetround.c b/sysdeps/ia64/fpu/fesetround.c
index 418e1530ee..9c3ddf487d 100644
--- a/sysdeps/ia64/fpu/fesetround.c
+++ b/sysdeps/ia64/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
diff --git a/sysdeps/ia64/fpu/feupdateenv.c b/sysdeps/ia64/fpu/feupdateenv.c
index 36370c80e7..379027b8c4 100644
--- a/sysdeps/ia64/fpu/feupdateenv.c
+++ b/sysdeps/ia64/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
diff --git a/sysdeps/ia64/fpu/fgetexcptflg.c b/sysdeps/ia64/fpu/fgetexcptflg.c
index dd3422b3de..1a4f03eeb7 100644
--- a/sysdeps/ia64/fpu/fgetexcptflg.c
+++ b/sysdeps/ia64/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
diff --git a/sysdeps/ia64/fpu/fraiseexcpt.c b/sysdeps/ia64/fpu/fraiseexcpt.c
index d9cdca4985..455fdd0705 100644
--- a/sysdeps/ia64/fpu/fraiseexcpt.c
+++ b/sysdeps/ia64/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jes Sorensen <Jes.Sorensen@cern.ch>, 2000.
diff --git a/sysdeps/ia64/fpu/fsetexcptflg.c b/sysdeps/ia64/fpu/fsetexcptflg.c
index 58f8c1608b..d3022eb1bb 100644
--- a/sysdeps/ia64/fpu/fsetexcptflg.c
+++ b/sysdeps/ia64/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
diff --git a/sysdeps/ia64/fpu/ftestexcept.c b/sysdeps/ia64/fpu/ftestexcept.c
index c1bf50ee70..cedf2c001d 100644
--- a/sysdeps/ia64/fpu/ftestexcept.c
+++ b/sysdeps/ia64/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
diff --git a/sysdeps/ia64/fpu/get-rounding-mode.h b/sysdeps/ia64/fpu/get-rounding-mode.h
index 023d35b92c..8fdf9c084b 100644
--- a/sysdeps/ia64/fpu/get-rounding-mode.h
+++ b/sysdeps/ia64/fpu/get-rounding-mode.h
@@ -1,5 +1,5 @@
/* Return current rounding direction within libc. IA64 version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
diff --git a/sysdeps/ia64/fpu/lgamma-compat.h b/sysdeps/ia64/fpu/lgamma-compat.h
index c9580b36c6..784567edb2 100644
--- a/sysdeps/ia64/fpu/lgamma-compat.h
+++ b/sysdeps/ia64/fpu/lgamma-compat.h
@@ -1,5 +1,5 @@
/* ABI compatibility for lgamma functions. ia64 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/fpu/libm-symbols.h b/sysdeps/ia64/fpu/libm-symbols.h
index 3cbc6c41b0..4a551c9f17 100644
--- a/sysdeps/ia64/fpu/libm-symbols.h
+++ b/sysdeps/ia64/fpu/libm-symbols.h
@@ -1,58 +1,64 @@
-#include <sysdep.h>
-#undef ret /* get rid of the stupid "ret" macro; it breaks br.ret */
+#ifndef _ISOMAC
+# include <sysdep.h>
+# undef ret /* get rid of the stupid "ret" macro; it breaks br.ret */
+
+# include <libm-alias-float.h>
+# include <libm-alias-double.h>
+# include <libm-alias-ldouble.h>
/* Support for compatible assembler handling. */
-#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
+# define ASM_SIZE_DIRECTIVE(name) .size name,.-name
-#define LOCAL_LIBM_ENTRY(name) \
+# define LOCAL_LIBM_ENTRY(name) \
.proc name; \
name:
-#define LOCAL_LIBM_END(name) \
+# define LOCAL_LIBM_END(name) \
.endp name; \
ASM_SIZE_DIRECTIVE(name)
-#define RODATA .rodata
-#define LOCAL_OBJECT_START(name) \
+# define RODATA .rodata
+# define LOCAL_OBJECT_START(name) \
name:; \
.type name, @object
-#define LOCAL_OBJECT_END(name) \
+# define LOCAL_OBJECT_END(name) \
ASM_SIZE_DIRECTIVE(name)
-#define GLOBAL_LIBM_ENTRY(name) \
+# define GLOBAL_LIBM_ENTRY(name) \
LOCAL_LIBM_ENTRY(name); \
.global name
-#define GLOBAL_LIBM_END(name) LOCAL_LIBM_END(name)
+# define GLOBAL_LIBM_END(name) LOCAL_LIBM_END(name)
-#define INTERNAL_LIBM_ENTRY(name) \
+# define INTERNAL_LIBM_ENTRY(name) \
GLOBAL_LIBM_ENTRY(__libm_##name); \
.global __libm_##name
-#define INTERNAL_LIBM_END(name) GLOBAL_LIBM_END(__libm_##name)
+# define INTERNAL_LIBM_END(name) GLOBAL_LIBM_END(__libm_##name)
-#define WEAK_LIBM_ENTRY(name) \
+# define WEAK_LIBM_ENTRY(name) \
.align 32; \
LOCAL_LIBM_ENTRY(__##name); \
.global __##name; \
__##name:
-#define WEAK_LIBM_END(name) \
+# define WEAK_LIBM_END(name) \
weak_alias (__##name, name); \
.hidden __##name; \
LOCAL_LIBM_END(__##name); \
ASM_SIZE_DIRECTIVE(__##name); \
.type __##name, @function
-#define GLOBAL_IEEE754_ENTRY(name) \
+# define GLOBAL_IEEE754_ENTRY(name) \
WEAK_LIBM_ENTRY(name); \
.global __ieee754_##name; \
.hidden __ieee754_##name; \
__ieee754_##name:
-#define GLOBAL_IEEE754_END(name) \
+# define GLOBAL_IEEE754_END(name) \
WEAK_LIBM_END(name); \
ASM_SIZE_DIRECTIVE(__ieee754_##name); \
.type __ieee754_##name, @function
-#if defined ASSEMBLER && IS_IN (libc)
-# define __libm_error_support HIDDEN_JUMPTARGET(__libm_error_support)
+# if defined ASSEMBLER && IS_IN (libc)
+# define __libm_error_support HIDDEN_JUMPTARGET(__libm_error_support)
+# endif
#endif
diff --git a/sysdeps/ia64/fpu/libm-test-ulps b/sysdeps/ia64/fpu/libm-test-ulps
index 44230afd78..543cebcb63 100644
--- a/sysdeps/ia64/fpu/libm-test-ulps
+++ b/sysdeps/ia64/fpu/libm-test-ulps
@@ -1,552 +1,2396 @@
# Begin of automatic generation
# Maximal error of functions:
+Function: "acos":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+
+Function: "acos_downward":
+double: 1
+float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
+
+Function: "acos_upward":
+double: 1
+float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
+
+Function: "acosh":
+double: 1
+float128: 2
+idouble: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: "acosh_downward":
+float128: 3
+ifloat128: 3
+
+Function: "acosh_towardzero":
+float128: 2
+ifloat128: 2
+
+Function: "acosh_upward":
+float128: 2
+ifloat128: 2
+
+Function: "asin":
+float128: 1
+ifloat128: 1
+
Function: "asin_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "asin_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "asin_upward":
double: 1
float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: "asinh":
+double: 1
+float128: 3
+idouble: 1
+ifloat128: 3
+
+Function: "asinh_downward":
+float128: 4
+ifloat128: 4
+
+Function: "asinh_towardzero":
+float128: 2
+ifloat128: 2
+
+Function: "asinh_upward":
+float128: 4
+ifloat128: 4
+
+Function: "atan":
+float128: 1
+ifloat128: 1
+
+Function: "atan2":
+float128: 1
+ifloat128: 1
+
+Function: "atan2_downward":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: "atan2_towardzero":
+float: 1
+float128: 3
+ifloat: 1
+ifloat128: 3
+ildouble: 1
+ldouble: 1
+
+Function: "atan2_upward":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: "atan_downward":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: "atan_towardzero":
+float: 1
+float128: 1
+ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "atan_upward":
+double: 1
+float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: "atanh":
+float128: 3
+ifloat128: 3
+
+Function: "atanh_downward":
+float: 1
+float128: 4
+ifloat: 1
+ifloat128: 4
+
+Function: "atanh_towardzero":
+float: 1
+float128: 2
+ifloat: 1
+ifloat128: 2
+
+Function: "atanh_upward":
+float: 1
+float128: 4
+ifloat: 1
+ifloat128: 4
+
+Function: "cabs":
+float128: 1
+ifloat128: 1
+
+Function: "cabs_downward":
+double: 1
+float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cabs_towardzero":
+double: 1
+float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cabs_upward":
+double: 1
+float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "cacos":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cacos_downward":
+double: 1
+float: 1
+float128: 3
+idouble: 1
+ifloat: 1
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 6
+float128: 6
+idouble: 5
+ifloat: 6
+ifloat128: 6
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "cacos_towardzero":
+double: 1
+float: 1
+float128: 3
idouble: 1
+ifloat: 1
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cacos_towardzero":
+double: 4
+float: 5
+float128: 5
+idouble: 4
+ifloat: 5
+ifloat128: 5
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 2
+float128: 3
+idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
+Function: Imaginary part of "cacos_upward":
+double: 5
+float: 5
+float128: 7
+idouble: 5
+ifloat: 5
+ifloat128: 7
+ildouble: 5
+ldouble: 5
+
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacosh":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "cacosh_downward":
+double: 4
+float: 5
+float128: 5
+idouble: 4
+ifloat: 5
+ifloat128: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "cacosh_downward":
+double: 2
+float: 2
+float128: 4
+idouble: 2
+ifloat: 2
+ifloat128: 4
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 5
+float128: 5
+idouble: 4
+ifloat: 5
+ifloat128: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 1
+float: 1
+float128: 3
+idouble: 1
+ifloat: 1
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cacosh_upward":
+double: 4
+float: 3
+float128: 6
+idouble: 4
+ifloat: 3
+ifloat128: 6
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "cacosh_upward":
+double: 3
+float: 2
+float128: 4
+idouble: 3
+ifloat: 2
+ifloat128: 4
+ildouble: 3
+ldouble: 3
+
+Function: "carg":
+float128: 2
+ifloat128: 2
+
+Function: "carg_downward":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: "carg_towardzero":
+float: 1
+float128: 3
+ifloat: 1
+ifloat128: 3
+ildouble: 1
+ldouble: 1
+
+Function: "carg_upward":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "casin":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+float128: 3
+idouble: 3
+ifloat: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 6
+float128: 6
+idouble: 5
+ifloat: 6
+ifloat128: 6
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 2
+float128: 3
+idouble: 3
+ifloat: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_towardzero":
+double: 4
+float: 5
+float128: 5
+idouble: 4
+ifloat: 5
+ifloat128: 5
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "casin_upward":
+double: 2
+float: 1
+float128: 3
+idouble: 2
+ifloat: 1
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "casin_upward":
+double: 5
+float: 5
+float128: 7
+idouble: 5
+ifloat: 5
+ifloat128: 7
+ildouble: 5
+ldouble: 5
+
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "casinh":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
+Function: Real part of "casinh_downward":
+double: 5
+float: 6
+float128: 6
+idouble: 5
+ifloat: 6
+ifloat128: 6
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 2
+float128: 3
+idouble: 3
+ifloat: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "casinh_towardzero":
+double: 4
+float: 5
+float128: 5
+idouble: 4
+ifloat: 5
+ifloat128: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 2
+float128: 3
+idouble: 3
+ifloat: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "casinh_upward":
+double: 5
+float: 5
+float128: 7
+idouble: 5
+ifloat: 5
+ifloat128: 7
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "casinh_upward":
+double: 2
+float: 1
+float128: 3
+idouble: 2
+ifloat: 1
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catan":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+
Function: Imaginary part of "catan":
double: 1
float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "catan_downward":
+double: 1
+float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 1
+float128: 2
+idouble: 2
+ifloat: 1
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "catan_towardzero":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catan_upward":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "catan_upward":
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
Function: Real part of "catanh":
double: 1
float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 1
+float128: 2
+idouble: 2
+ifloat: 1
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "catanh_towardzero":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 4
+float128: 4
+idouble: 4
+ifloat: 4
+ifloat128: 4
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "catanh_upward":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: "cbrt":
+float128: 1
+ifloat128: 1
+
+Function: "cbrt_downward":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cbrt_towardzero":
+float: 1
+float128: 1
+ifloat: 1
+ifloat128: 1
+
+Function: "cbrt_upward":
+float: 1
+float128: 1
+ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "ccos":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "ccos":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
+Function: Real part of "ccos_downward":
+double: 3
+float: 1
+float128: 2
+idouble: 3
+ifloat: 1
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ccos_downward":
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ccos_towardzero":
+double: 3
+float: 1
+float128: 2
+idouble: 3
+ifloat: 1
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ccos_towardzero":
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ccos_upward":
+double: 1
+float: 2
+float128: 3
+idouble: 1
+ifloat: 2
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ccos_upward":
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
Function: Real part of "ccosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
Function: Imaginary part of "ccosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
+Function: Real part of "ccosh_downward":
+double: 3
+float: 2
+float128: 2
+idouble: 3
+ifloat: 2
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ccosh_downward":
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ccosh_towardzero":
+double: 3
+float: 2
+float128: 2
+idouble: 3
+ifloat: 2
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ccosh_upward":
+double: 1
+float: 2
+float128: 3
+idouble: 1
+ifloat: 2
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ccosh_upward":
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
Function: Real part of "cexp":
double: 2
float: 1
+float128: 1
idouble: 2
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "cexp":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
+Function: Real part of "cexp_downward":
+double: 4
+float: 2
+float128: 2
+idouble: 4
+ifloat: 2
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cexp_downward":
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "cexp_towardzero":
+double: 4
+float: 2
+float128: 2
+idouble: 4
+ifloat: 2
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cexp_towardzero":
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "cexp_upward":
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cexp_upward":
+double: 3
+float: 2
+float128: 3
+idouble: 3
+ifloat: 2
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
Function: Real part of "clog":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 1
-ldouble: 1
+double: 2
+float: 3
+float128: 2
+idouble: 2
+ifloat: 3
+ifloat128: 2
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "clog":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "clog10":
+double: 3
+float: 4
+float128: 2
+idouble: 3
+ifloat: 4
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "clog10":
+double: 2
+float: 1
+float128: 2
+idouble: 2
+ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "clog10_downward":
+double: 4
+float: 4
+float128: 3
+idouble: 4
+ifloat: 4
+ifloat128: 3
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "clog10_downward":
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "clog10_towardzero":
+double: 5
+float: 5
+float128: 4
+idouble: 5
+ifloat: 5
+ifloat128: 4
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "clog10_towardzero":
+double: 2
+float: 2
+float128: 3
+idouble: 2
+ifloat: 2
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "clog10_upward":
+double: 4
+float: 5
+float128: 4
+idouble: 4
+ifloat: 5
+ifloat128: 4
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "clog10_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "clog_downward":
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "clog_downward":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
-Function: Imaginary part of "clog10":
+Function: Real part of "clog_towardzero":
+double: 3
+float: 4
+float128: 3
+idouble: 3
+ifloat: 4
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "clog_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "clog_upward":
+double: 2
+float: 3
+float128: 4
+idouble: 2
+ifloat: 3
+ifloat128: 4
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "clog_upward":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "cos":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
Function: "cos_downward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
-Function: "cos_tonearest":
-double: 1
-idouble: 1
-
Function: "cos_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cos_upward":
+double: 1
+float128: 2
+idouble: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
+Function: "cosh":
+float128: 1
+ifloat128: 1
+
+Function: "cosh_downward":
+float128: 2
+ifloat128: 1
+
+Function: "cosh_towardzero":
+float128: 2
+ifloat128: 1
+
+Function: "cosh_upward":
+float128: 3
+ifloat128: 1
+
Function: Real part of "cpow":
double: 2
float: 5
+float128: 4
idouble: 2
ifloat: 5
+ifloat128: 4
ildouble: 3
ldouble: 3
Function: Imaginary part of "cpow":
float: 2
+float128: 1
ifloat: 2
+ifloat128: 1
ildouble: 4
ldouble: 4
+Function: Real part of "cpow_downward":
+double: 5
+float: 8
+float128: 6
+idouble: 5
+ifloat: 8
+ifloat128: 6
+ildouble: 7
+ldouble: 7
+
+Function: Imaginary part of "cpow_downward":
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "cpow_towardzero":
+double: 5
+float: 8
+float128: 6
+idouble: 5
+ifloat: 8
+ifloat128: 6
+ildouble: 7
+ldouble: 7
+
+Function: Imaginary part of "cpow_towardzero":
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "cpow_upward":
+double: 4
+float: 1
+float128: 3
+idouble: 4
+ifloat: 1
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cpow_upward":
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
Function: Real part of "csin":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "csin":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
-Function: Real part of "csinh":
-double: 1
+Function: Real part of "csin_downward":
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "csin_downward":
+double: 3
float: 1
-idouble: 1
+float128: 2
+idouble: 3
ifloat: 1
-ildouble: 1
-ldouble: 1
+ifloat128: 2
+ildouble: 3
+ldouble: 3
-Function: Imaginary part of "csinh":
-double: 1
+Function: Real part of "csin_towardzero":
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "csin_towardzero":
+double: 3
float: 1
-idouble: 1
+float128: 2
+idouble: 3
ifloat: 1
+ifloat128: 2
+ildouble: 3
+ldouble: 3
-Function: Real part of "csqrt":
+Function: Real part of "csin_upward":
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csin_upward":
double: 1
-float: 1
+float: 2
+float128: 3
idouble: 1
-ifloat: 1
+ifloat: 2
+ifloat128: 3
ildouble: 1
ldouble: 1
-Function: Imaginary part of "csqrt":
+Function: Real part of "csinh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
-Function: Real part of "ctan":
+Function: Imaginary part of "csinh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "csinh_downward":
+double: 3
+float: 1
+float128: 2
+idouble: 3
+ifloat: 1
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "csinh_downward":
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "csinh_towardzero":
+double: 3
+float: 1
+float128: 2
+idouble: 3
+ifloat: 1
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "csinh_towardzero":
+double: 3
+float: 3
+float128: 2
+idouble: 3
+ifloat: 3
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "csinh_upward":
+double: 1
+float: 2
+float128: 3
+idouble: 1
+ifloat: 2
+ifloat128: 3
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "csinh_upward":
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
-Function: Imaginary part of "ctan":
+Function: Real part of "csqrt":
double: 2
-float: 1
+float: 2
+float128: 2
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
-Function: Real part of "ctan_downward":
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+float128: 2
+idouble: 2
+ifloat: 2
+ifloat128: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csqrt_downward":
double: 4
float: 4
+float128: 4
idouble: 4
ifloat: 4
-ildouble: 2
-ldouble: 2
+ifloat128: 4
+ildouble: 4
+ldouble: 4
-Function: Imaginary part of "ctan_downward":
+Function: Imaginary part of "csqrt_downward":
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "csqrt_upward":
+double: 4
+float: 4
+float128: 4
+idouble: 4
+ifloat: 4
+ifloat128: 4
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "csqrt_upward":
double: 3
float: 2
+float128: 3
idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
-Function: Real part of "ctan_tonearest":
+Function: Real part of "ctan":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
-Function: Imaginary part of "ctan_tonearest":
+Function: Imaginary part of "ctan":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ctan_downward":
+double: 4
+float: 4
+float128: 4
+idouble: 4
+ifloat: 4
+ifloat128: 4
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ctan_downward":
+double: 3
+float: 2
+float128: 5
+idouble: 3
+ifloat: 2
+ifloat128: 5
ildouble: 2
ldouble: 2
Function: Real part of "ctan_towardzero":
double: 2
-float: 1
+float: 2
+float128: 4
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 4
ildouble: 2
ldouble: 2
Function: Imaginary part of "ctan_towardzero":
double: 3
float: 2
+float128: 5
idouble: 3
ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Real part of "ctan_upward":
double: 2
float: 3
+float128: 5
idouble: 2
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Imaginary part of "ctan_upward":
double: 6
float: 2
+float128: 5
idouble: 6
ifloat: 2
+ifloat128: 5
ildouble: 7
ldouble: 7
Function: Real part of "ctanh":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: Imaginary part of "ctanh":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Real part of "ctanh_downward":
double: 3
float: 2
+float128: 5
idouble: 3
ifloat: 2
+ifloat128: 5
ildouble: 1
ldouble: 1
Function: Imaginary part of "ctanh_downward":
double: 4
float: 4
+float128: 4
idouble: 4
ifloat: 4
-ildouble: 2
-ldouble: 2
-
-Function: Real part of "ctanh_tonearest":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 1
-ldouble: 1
-
-Function: Imaginary part of "ctanh_tonearest":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+ifloat128: 4
ildouble: 2
ldouble: 2
Function: Real part of "ctanh_towardzero":
double: 3
float: 2
+float128: 5
idouble: 3
ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Imaginary part of "ctanh_towardzero":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: Real part of "ctanh_upward":
double: 6
float: 2
+float128: 5
idouble: 6
ifloat: 2
+ifloat128: 5
ildouble: 7
ldouble: 7
Function: Imaginary part of "ctanh_upward":
double: 2
float: 3
+float128: 5
idouble: 2
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
+Function: "erf":
+float128: 1
+ifloat128: 1
+
+Function: "erf_downward":
+float128: 2
+ifloat128: 2
+
+Function: "erf_towardzero":
+float128: 1
+ifloat128: 1
+
+Function: "erf_upward":
+float128: 2
+ifloat128: 2
+
+Function: "erfc":
+float128: 2
+ifloat128: 2
+
+Function: "erfc_downward":
+double: 1
+float128: 5
+idouble: 1
+ifloat128: 5
+
+Function: "erfc_towardzero":
+double: 1
+float128: 4
+idouble: 1
+ifloat128: 4
+
+Function: "erfc_upward":
+double: 1
+float128: 5
+idouble: 1
+ifloat128: 5
+
+Function: "exp":
+float: 1
+float128: 1
+ifloat: 1
+ifloat128: 1
+
+Function: "exp10":
+float128: 2
+ifloat128: 2
+
+Function: "exp10_downward":
+float128: 3
+ifloat128: 3
+
+Function: "exp10_towardzero":
+float128: 3
+ifloat128: 3
+
+Function: "exp10_upward":
+float128: 3
+ifloat128: 3
+
+Function: "exp2":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "exp2_downward":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "exp2_towardzero":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "exp2_upward":
+double: 1
+float128: 2
+idouble: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
+
Function: "expm1":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "expm1_downward":
+float128: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
-Function: "expm1_tonearest":
+Function: "expm1_towardzero":
+float128: 4
+ifloat128: 4
+
+Function: "expm1_upward":
+float128: 3
+ifloat128: 3
+
+Function: "gamma":
+float: 1
+ifloat: 1
+
+Function: "gamma_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "gamma_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "gamma_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "hypot":
+float128: 1
+ifloat128: 1
+
+Function: "hypot_downward":
+double: 1
+float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "hypot_towardzero":
+double: 1
+float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "hypot_upward":
+double: 1
+float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "j0":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
+Function: "j0_downward":
+double: 6
+float: 4
+float128: 4
+idouble: 6
+ifloat: 4
+ifloat128: 4
+ildouble: 3
+ldouble: 3
+
+Function: "j0_towardzero":
+double: 2
+float: 1
+float128: 2
+idouble: 2
+ifloat: 1
+ifloat128: 2
+ildouble: 5
+ldouble: 5
+
+Function: "j0_upward":
+double: 3
+float: 2
+float128: 5
+idouble: 3
+ifloat: 2
+ifloat128: 5
+ildouble: 5
+ldouble: 5
+
Function: "j1":
double: 1
float: 2
+float128: 4
idouble: 1
ifloat: 2
+ifloat128: 4
ildouble: 1
ldouble: 1
+Function: "j1_downward":
+double: 3
+float: 2
+float128: 4
+idouble: 3
+ifloat: 2
+ifloat128: 4
+ildouble: 4
+ldouble: 4
+
+Function: "j1_towardzero":
+double: 3
+float: 2
+float128: 4
+idouble: 3
+ifloat: 2
+ifloat128: 4
+ildouble: 4
+ldouble: 4
+
+Function: "j1_upward":
+double: 3
+float: 4
+float128: 3
+idouble: 3
+ifloat: 4
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
Function: "jn":
double: 4
float: 4
+float128: 7
idouble: 4
ifloat: 4
+ifloat128: 7
+ildouble: 4
+ldouble: 4
+
+Function: "jn_downward":
+double: 4
+float: 5
+float128: 8
+idouble: 4
+ifloat: 5
+ifloat128: 8
ildouble: 4
ldouble: 4
+Function: "jn_towardzero":
+double: 4
+float: 5
+float128: 8
+idouble: 4
+ifloat: 5
+ifloat128: 8
+ildouble: 5
+ldouble: 5
+
+Function: "jn_upward":
+double: 5
+float: 4
+float128: 7
+idouble: 5
+ifloat: 4
+ifloat128: 7
+ildouble: 5
+ldouble: 5
+
+Function: "lgamma":
+float: 1
+float128: 5
+ifloat: 1
+ifloat128: 5
+
+Function: "lgamma_downward":
+double: 1
+float: 1
+float128: 8
+idouble: 1
+ifloat: 1
+ifloat128: 8
+
+Function: "lgamma_towardzero":
+double: 1
+float: 1
+float128: 5
+idouble: 1
+ifloat: 1
+ifloat128: 5
+
+Function: "lgamma_upward":
+double: 1
+float: 1
+float128: 8
+idouble: 1
+ifloat: 1
+ifloat128: 8
+
+Function: "log":
+float128: 1
+ifloat128: 1
+
+Function: "log10":
+float128: 1
+ifloat128: 1
+
+Function: "log10_downward":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "log10_towardzero":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "log10_upward":
+double: 1
+float: 1
+float128: 1
+idouble: 1
+ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
+
+Function: "log1p":
+float128: 2
+ifloat128: 2
+
+Function: "log1p_downward":
+double: 1
+float128: 3
+idouble: 1
+ifloat128: 3
+
+Function: "log1p_towardzero":
+double: 1
+float128: 3
+idouble: 1
+ifloat128: 3
+
+Function: "log1p_upward":
+double: 1
+float128: 2
+idouble: 1
+ifloat128: 2
+
+Function: "log2":
+float128: 2
+ifloat128: 2
+
+Function: "log2_downward":
+float128: 3
+ifloat128: 3
+
+Function: "log2_towardzero":
+float128: 1
+ifloat128: 1
+
+Function: "log2_upward":
+float128: 1
+ifloat128: 1
+
+Function: "log_downward":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+
+Function: "log_towardzero":
+double: 1
+float128: 2
+idouble: 1
+ifloat128: 2
+
+Function: "log_upward":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
+
+Function: "pow":
+float128: 2
+ifloat128: 2
+
Function: "pow_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
Function: "pow_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
+ildouble: 1
+ldouble: 1
Function: "pow_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "sin":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
Function: "sin_downward":
double: 1
+float: 1
+float128: 3
idouble: 1
+ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
-Function: "sin_tonearest":
-double: 1
-idouble: 1
-
Function: "sin_towardzero":
double: 1
+float: 1
+float128: 2
idouble: 1
+ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "sin_upward":
double: 1
+float: 1
+float128: 3
idouble: 1
+ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "sincos":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
+
+Function: "sincos_downward":
+double: 1
+float: 1
+float128: 3
+idouble: 1
+ifloat: 1
+ifloat128: 3
+
+Function: "sincos_towardzero":
+double: 1
+float: 1
+float128: 2
+idouble: 1
+ifloat: 1
+ifloat128: 2
+
+Function: "sincos_upward":
+double: 1
+float: 1
+float128: 3
+idouble: 1
+ifloat: 1
+ifloat128: 3
+
+Function: "sinh":
+float128: 2
+ifloat128: 2
+
+Function: "sinh_downward":
+float128: 3
+ifloat128: 3
+
+Function: "sinh_towardzero":
+float128: 3
+ifloat128: 3
+
+Function: "sinh_upward":
+float128: 4
+ifloat128: 4
+
+Function: "tan":
+float128: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
Function: "tan_downward":
+float128: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "tan_towardzero":
+float128: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "tan_upward":
+float128: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
+Function: "tanh":
+float128: 2
+ifloat128: 2
+
+Function: "tanh_downward":
+float128: 4
+ifloat128: 4
+
+Function: "tanh_towardzero":
+float128: 3
+ifloat128: 3
+
+Function: "tanh_upward":
+float128: 3
+ifloat128: 3
+
Function: "tgamma":
+float128: 4
+ifloat128: 4
+ildouble: 1
+ldouble: 1
+
+Function: "tgamma_downward":
+double: 1
+float: 1
+float128: 5
+idouble: 1
+ifloat: 1
+ifloat128: 5
+ildouble: 1
+ldouble: 1
+
+Function: "tgamma_towardzero":
+double: 1
+float: 1
+float128: 5
+idouble: 1
+ifloat: 1
+ifloat128: 5
+ildouble: 1
+ldouble: 1
+
+Function: "tgamma_upward":
+double: 1
+float: 1
+float128: 4
+idouble: 1
+ifloat: 1
+ifloat128: 4
ildouble: 1
ldouble: 1
Function: "y0":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
+Function: "y0_downward":
+double: 4
+float: 4
+float128: 4
+idouble: 4
+ifloat: 4
+ifloat128: 4
+ildouble: 4
+ldouble: 4
+
+Function: "y0_towardzero":
+double: 3
+float: 3
+float128: 3
+idouble: 3
+ifloat: 3
+ifloat128: 3
+ildouble: 5
+ldouble: 5
+
+Function: "y0_upward":
+double: 4
+float: 5
+float128: 3
+idouble: 4
+ifloat: 5
+ifloat128: 3
+ildouble: 3
+ldouble: 3
+
Function: "y1":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
+Function: "y1_downward":
+double: 9
+float: 2
+float128: 4
+idouble: 9
+ifloat: 2
+ifloat128: 4
+ildouble: 3
+ldouble: 3
+
+Function: "y1_towardzero":
+double: 3
+float: 2
+float128: 2
+idouble: 3
+ifloat: 2
+ifloat128: 2
+ildouble: 3
+ldouble: 3
+
+Function: "y1_upward":
+double: 4
+float: 2
+float128: 5
+idouble: 4
+ifloat: 2
+ifloat128: 5
+ildouble: 7
+ldouble: 7
+
Function: "yn":
double: 3
float: 3
+float128: 5
idouble: 3
ifloat: 3
-ildouble: 2
-ldouble: 2
+ifloat128: 5
+ildouble: 3
+ldouble: 3
+
+Function: "yn_downward":
+double: 4
+float: 4
+float128: 5
+idouble: 4
+ifloat: 4
+ifloat128: 5
+ildouble: 4
+ldouble: 4
+
+Function: "yn_towardzero":
+double: 3
+float: 3
+float128: 5
+idouble: 3
+ifloat: 3
+ifloat128: 5
+ildouble: 5
+ldouble: 5
+
+Function: "yn_upward":
+double: 4
+float: 5
+float128: 5
+idouble: 4
+ifloat: 5
+ifloat128: 5
+ildouble: 3
+ldouble: 3
# end of automatic generation
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/fpu/libm_error.c b/sysdeps/ia64/fpu/libm_error.c
index a9307dd4b5..34d1466e09 100644
--- a/sysdeps/ia64/fpu/libm_error.c
+++ b/sysdeps/ia64/fpu/libm_error.c
@@ -91,11 +91,19 @@
#include <stdio.h>
#include <stdlib.h>
#include "libm_support.h"
+#include <math-svid-compat.h>
#ifdef _LIBC
# define pmatherr matherr
# define pmatherrf matherrf
# define pmatherrl matherrl
+# if LIBM_SVID_COMPAT
+compat_symbol_reference (libm, matherrf, matherrf, GLIBC_2_2_3);
+compat_symbol_reference (libm, matherrl, matherrl, GLIBC_2_2_3);
+# else
+# define matherrf(EXC) ((void) (EXC), 0)
+# define matherrl(EXC) ((void) (EXC), 0)
+# endif
#else
_LIB_VERSION_TYPE
#if defined( __POSIX__ )
diff --git a/sysdeps/ia64/fpu/libm_sincos.S b/sysdeps/ia64/fpu/libm_sincos.S
index c2a9f7262e..85ccd5f56a 100644
--- a/sysdeps/ia64/fpu/libm_sincos.S
+++ b/sysdeps/ia64/fpu/libm_sincos.S
@@ -425,6 +425,7 @@ GLOBAL_IEEE754_ENTRY(sincos)
br.cond.sptk _CIS_COMMON
};;
GLOBAL_IEEE754_END(sincos)
+libm_alias_double_other (__sincos, sincos)
GLOBAL_LIBM_ENTRY(__libm_sincos)
// cis_GR_sig_inv_pi_by_16 = significand of 16/pi
diff --git a/sysdeps/ia64/fpu/libm_sincosf.S b/sysdeps/ia64/fpu/libm_sincosf.S
index 26e66fad6e..f38c247b4b 100644
--- a/sysdeps/ia64/fpu/libm_sincosf.S
+++ b/sysdeps/ia64/fpu/libm_sincosf.S
@@ -421,6 +421,7 @@ GLOBAL_IEEE754_ENTRY(sincosf)
br.cond.sptk _CISF_COMMON
};;
GLOBAL_IEEE754_END(sincosf)
+libm_alias_float_other (__sincos, sincos)
GLOBAL_LIBM_ENTRY(__libm_sincosf)
{ .mlx
diff --git a/sysdeps/ia64/fpu/libm_sincosl.S b/sysdeps/ia64/fpu/libm_sincosl.S
index 7fe92c549c..f76b54d3de 100644
--- a/sysdeps/ia64/fpu/libm_sincosl.S
+++ b/sysdeps/ia64/fpu/libm_sincosl.S
@@ -835,6 +835,7 @@ GLOBAL_IEEE754_ENTRY(sincosl)
br.cond.sptk _COMMON_SINCOSL
};;
GLOBAL_IEEE754_END(sincosl)
+libm_alias_ldouble_other (__sincos, sincos)
GLOBAL_LIBM_ENTRY(__libm_sincosl)
{ .mlx ///////////////////////////// 1 /////////////////
diff --git a/sysdeps/ia64/fpu/libm_support.h b/sysdeps/ia64/fpu/libm_support.h
index dc9c0a2648..4e7a66799d 100644
--- a/sysdeps/ia64/fpu/libm_support.h
+++ b/sysdeps/ia64/fpu/libm_support.h
@@ -83,6 +83,8 @@
#ifndef __LIBM_SUPPORT_H_INCLUDED__
#define __LIBM_SUPPORT_H_INCLUDED__
+#include <math-svid-compat.h>
+
#ifndef _LIBC
#if !(defined(_WIN32) || defined(_WIN64))
# pragma const_seg(".rodata") /* place constant data in text (code) section */
@@ -156,36 +158,8 @@ struct exceptionl
#endif
extern int MATHERR_F(struct exceptionf*);
-extern int MATHERR_D(struct EXC_DECL_D*);
extern int matherrl(struct exceptionl*);
-#ifndef _LIBC
-// Add code to support _LIB_VERSIONIMF
-typedef enum
-{
- _IEEE_ = -1, // IEEE-like behavior
- _SVID_, // SysV, Rel. 4 behavior
- _XOPEN_, // Unix98
- _POSIX_, // Posix
- _ISOC_ // ISO C9X
-} _LIB_VERSION_TYPE;
-#endif
-
-// This is a run-time variable and may affect
-// floating point behavior of the libm functions
-
-#if !defined( LIBM_BUILD )
-#if defined( _DLL )
-extern _LIB_VERSION_TYPE __declspec(dllimport) _LIB_VERSIONIMF;
-#else
-extern _LIB_VERSION_TYPE _LIB_VERSIONIMF;
-#endif /* _DLL */
-#else
-extern int (*pmatherrf)(struct exceptionf*);
-extern int (*pmatherr)(struct EXC_DECL_D*);
-extern int (*pmatherrl)(struct exceptionl*);
-#endif /* LIBM_BUILD */
-
/* memory format definitions (LITTLE_ENDIAN only) */
#if !(defined(SIZE_INT_32) || defined(SIZE_INT_64))
@@ -1031,15 +1005,6 @@ struct ker80 {
#endif
-/* error codes */
-
-#define DOMAIN 1 /* argument domain error */
-#define SING 2 /* argument singularity */
-#define OVERFLOW 3 /* overflow range error */
-#define UNDERFLOW 4 /* underflow range error */
-#define TLOSS 5 /* total loss of precision */
-#define PLOSS 6 /* partial loss of precision */
-
/* */
#define VOLATILE_32 /*volatile*/
diff --git a/sysdeps/i386/fpu/slowpow.c b/sysdeps/ia64/fpu/math_errf.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/i386/fpu/slowpow.c
+++ b/sysdeps/ia64/fpu/math_errf.c
diff --git a/sysdeps/ia64/fpu/math_ldbl.h b/sysdeps/ia64/fpu/math_ldbl.h
index 475ca795fa..6178169f95 100644
--- a/sysdeps/ia64/fpu/math_ldbl.h
+++ b/sysdeps/ia64/fpu/math_ldbl.h
@@ -1,11 +1,31 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+/* Manipulation of the bit representation of 'long double' quantities.
+ Copyright (C) 2000-2018 Free Software 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_LDBL_H_
+#define _MATH_LDBL_H_ 1
+
+#include <stdint.h>
+#include <endian.h>
/* A union which permits us to convert between a long double and
three 32 bit ints. */
-#if __FLOAT_WORD_ORDER == BIG_ENDIAN
+#if __FLOAT_WORD_ORDER == __BIG_ENDIAN
typedef union
{
@@ -15,22 +35,22 @@ typedef union
unsigned int empty0:32;
int sign_exponent:16;
unsigned int empty1:16;
- u_int32_t msw;
- u_int32_t lsw;
+ uint32_t msw;
+ uint32_t lsw;
} parts;
} ieee_long_double_shape_type;
#endif
-#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
+#if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN
typedef union
{
long double value;
struct
{
- u_int32_t lsw;
- u_int32_t msw;
+ uint32_t lsw;
+ uint32_t msw;
int sign_exponent:16;
unsigned int empty1:16;
unsigned int empty0:32;
@@ -98,3 +118,5 @@ do { \
se_u.parts.sign_exponent = (exp); \
(d) = se_u.value; \
} while (0)
+
+#endif /* math_ldbl.h */
diff --git a/sysdeps/ia64/fpu/printf_fphex.c b/sysdeps/ia64/fpu/printf_fphex.c
index 294aef84ba..ef35e78364 100644
--- a/sysdeps/ia64/fpu/printf_fphex.c
+++ b/sysdeps/ia64/fpu/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/fpu/s_asinh.S b/sysdeps/ia64/fpu/s_asinh.S
index c5aaee7072..b57c015b0b 100644
--- a/sysdeps/ia64/fpu/s_asinh.S
+++ b/sysdeps/ia64/fpu/s_asinh.S
@@ -1135,3 +1135,4 @@ ASINH_UNORM:
;;
GLOBAL_LIBM_END(asinh)
+libm_alias_double_other (asinh, asinh)
diff --git a/sysdeps/ia64/fpu/s_asinhf.S b/sysdeps/ia64/fpu/s_asinhf.S
index df616deae0..16c0fc4af1 100644
--- a/sysdeps/ia64/fpu/s_asinhf.S
+++ b/sysdeps/ia64/fpu/s_asinhf.S
@@ -935,3 +935,4 @@ ASINH_UNORM:
;;
GLOBAL_LIBM_END(asinhf)
+libm_alias_float_other (asinh, asinh)
diff --git a/sysdeps/ia64/fpu/s_asinhl.S b/sysdeps/ia64/fpu/s_asinhl.S
index 5b8e73b4dc..baace924f2 100644
--- a/sysdeps/ia64/fpu/s_asinhl.S
+++ b/sysdeps/ia64/fpu/s_asinhl.S
@@ -1342,3 +1342,4 @@ near_0:
};;
GLOBAL_LIBM_END(asinhl)
+libm_alias_ldouble_other (asinh, asinh)
diff --git a/sysdeps/ia64/fpu/s_atan.S b/sysdeps/ia64/fpu/s_atan.S
index 720ecad28a..598b42a687 100644
--- a/sysdeps/ia64/fpu/s_atan.S
+++ b/sysdeps/ia64/fpu/s_atan.S
@@ -751,3 +751,4 @@ GLOBAL_LIBM_ENTRY(atan)
}
GLOBAL_LIBM_END(atan)
+libm_alias_double_other (atan, atan)
diff --git a/sysdeps/ia64/fpu/s_atanf.S b/sysdeps/ia64/fpu/s_atanf.S
index 8d9e440ba2..cb3ca78220 100644
--- a/sysdeps/ia64/fpu/s_atanf.S
+++ b/sysdeps/ia64/fpu/s_atanf.S
@@ -553,3 +553,4 @@ ATANF_X_INF_NAN_ZERO:
;;
GLOBAL_LIBM_END(atanf)
+libm_alias_float_other (atan, atan)
diff --git a/sysdeps/ia64/fpu/s_atanl.S b/sysdeps/ia64/fpu/s_atanl.S
index fea68abfde..8d4951acf0 100644
--- a/sysdeps/ia64/fpu/s_atanl.S
+++ b/sysdeps/ia64/fpu/s_atanl.S
@@ -813,6 +813,7 @@ GLOBAL_IEEE754_ENTRY(atanl)
;;
GLOBAL_IEEE754_END(atanl)
+libm_alias_ldouble_other (__atan, atan)
GLOBAL_IEEE754_ENTRY(atan2l)
@@ -1953,6 +1954,7 @@ ATANL_ArgY_Not_INF:
;;
GLOBAL_IEEE754_END(atan2l)
+libm_alias_ldouble_other (__atan2, atan2)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/s_cbrt.S b/sysdeps/ia64/fpu/s_cbrt.S
index 7a74ac19be..783212383b 100644
--- a/sysdeps/ia64/fpu/s_cbrt.S
+++ b/sysdeps/ia64/fpu/s_cbrt.S
@@ -765,3 +765,4 @@ GLOBAL_LIBM_ENTRY(cbrt)
GLOBAL_LIBM_END(cbrt)
+libm_alias_double_other (cbrt, cbrt)
diff --git a/sysdeps/ia64/fpu/s_cbrtf.S b/sysdeps/ia64/fpu/s_cbrtf.S
index 5d51963f87..c0d102291c 100644
--- a/sysdeps/ia64/fpu/s_cbrtf.S
+++ b/sysdeps/ia64/fpu/s_cbrtf.S
@@ -759,3 +759,4 @@ GLOBAL_LIBM_ENTRY(cbrtf)
GLOBAL_LIBM_END(cbrtf)
+libm_alias_float_other (cbrt, cbrt)
diff --git a/sysdeps/ia64/fpu/s_cbrtl.S b/sysdeps/ia64/fpu/s_cbrtl.S
index 301c333ff7..bfd2d5a5a0 100644
--- a/sysdeps/ia64/fpu/s_cbrtl.S
+++ b/sysdeps/ia64/fpu/s_cbrtl.S
@@ -982,3 +982,4 @@ GLOBAL_LIBM_ENTRY(cbrtl)
;;
GLOBAL_LIBM_END(cbrtl)
+libm_alias_ldouble_other (cbrt, cbrt)
diff --git a/sysdeps/ia64/fpu/s_ceil.S b/sysdeps/ia64/fpu/s_ceil.S
index d1d2980618..9380608694 100644
--- a/sysdeps/ia64/fpu/s_ceil.S
+++ b/sysdeps/ia64/fpu/s_ceil.S
@@ -222,3 +222,4 @@ CEIL_UNORM:
;;
GLOBAL_LIBM_END(ceil)
+libm_alias_double_other (ceil, ceil)
diff --git a/sysdeps/ia64/fpu/s_ceilf.S b/sysdeps/ia64/fpu/s_ceilf.S
index 051534a202..b1789d0089 100644
--- a/sysdeps/ia64/fpu/s_ceilf.S
+++ b/sysdeps/ia64/fpu/s_ceilf.S
@@ -222,3 +222,4 @@ CEIL_UNORM:
;;
GLOBAL_LIBM_END(ceilf)
+libm_alias_float_other (ceil, ceil)
diff --git a/sysdeps/ia64/fpu/s_ceill.S b/sysdeps/ia64/fpu/s_ceill.S
index 71cb01d3fa..eb913d25e3 100644
--- a/sysdeps/ia64/fpu/s_ceill.S
+++ b/sysdeps/ia64/fpu/s_ceill.S
@@ -222,3 +222,4 @@ CEIL_UNORM:
;;
GLOBAL_LIBM_END(ceill)
+libm_alias_ldouble_other (ceil, ceil)
diff --git a/sysdeps/ia64/fpu/s_copysign.S b/sysdeps/ia64/fpu/s_copysign.S
index 592ffcf6e1..f6ec3dabeb 100644
--- a/sysdeps/ia64/fpu/s_copysign.S
+++ b/sysdeps/ia64/fpu/s_copysign.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,6 +32,6 @@ strong_alias (__copysign, __libm_copysign)
strong_alias (__copysign, __libm_copysignf)
strong_alias (__copysign, __libm_copysignl)
-weak_alias (__copysign, copysign)
-weak_alias (__copysignf, copysignf)
-weak_alias (__copysignl, copysignl)
+libm_alias_double (__copysign, copysign)
+libm_alias_float (__copysign, copysign)
+libm_alias_ldouble (__copysign, copysign)
diff --git a/sysdeps/ia64/fpu/s_cos.S b/sysdeps/ia64/fpu/s_cos.S
index 5f5cdc1d36..1c54b7e1b0 100644
--- a/sysdeps/ia64/fpu/s_cos.S
+++ b/sysdeps/ia64/fpu/s_cos.S
@@ -420,6 +420,7 @@ GLOBAL_IEEE754_ENTRY(sin)
;;
GLOBAL_IEEE754_END(sin)
+libm_alias_double_other (__sin, sin)
GLOBAL_IEEE754_ENTRY(cos)
@@ -707,6 +708,7 @@ _SINCOS_UNORM:
};;
GLOBAL_IEEE754_END(cos)
+libm_alias_double_other (__cos, cos)
//////////// x >= 2^27 - large arguments routine call ////////////
LOCAL_LIBM_ENTRY(__libm_callout_sincos)
diff --git a/sysdeps/ia64/fpu/s_cosf.S b/sysdeps/ia64/fpu/s_cosf.S
index 2dcdaa8879..42de260cd7 100644
--- a/sysdeps/ia64/fpu/s_cosf.S
+++ b/sysdeps/ia64/fpu/s_cosf.S
@@ -409,6 +409,7 @@ GLOBAL_IEEE754_ENTRY(sinf)
};;
GLOBAL_IEEE754_END(sinf)
+libm_alias_float_other (__sin, sin)
GLOBAL_IEEE754_ENTRY(cosf)
@@ -659,6 +660,7 @@ _SINCOSF_SPECIAL_ARGS:
};;
GLOBAL_IEEE754_END(cosf)
+libm_alias_float_other (__cos, cos)
//////////// x >= 2^24 - large arguments routine call ////////////
LOCAL_LIBM_ENTRY(__libm_callout_sincosf)
diff --git a/sysdeps/ia64/fpu/s_cosl.S b/sysdeps/ia64/fpu/s_cosl.S
index 8d71e50c1a..ed4b571fab 100644
--- a/sysdeps/ia64/fpu/s_cosl.S
+++ b/sysdeps/ia64/fpu/s_cosl.S
@@ -774,6 +774,7 @@ GLOBAL_IEEE754_ENTRY(sinl)
;;
GLOBAL_IEEE754_END(sinl)
+libm_alias_ldouble_other (__sin, sin)
GLOBAL_IEEE754_ENTRY(cosl)
{ .mlx
@@ -2288,6 +2289,7 @@ SINCOSL_SPECIAL:
}
GLOBAL_IEEE754_END(cosl)
+libm_alias_ldouble_other (__cos, cos)
// *******************************************************************
// *******************************************************************
diff --git a/sysdeps/ia64/fpu/s_erf.S b/sysdeps/ia64/fpu/s_erf.S
index 2ae2874cab..8e2355dfff 100644
--- a/sysdeps/ia64/fpu/s_erf.S
+++ b/sysdeps/ia64/fpu/s_erf.S
@@ -922,3 +922,4 @@ erf_denormal:
;;
GLOBAL_LIBM_END(erf)
+libm_alias_double_other (erf, erf)
diff --git a/sysdeps/ia64/fpu/s_erfc.S b/sysdeps/ia64/fpu/s_erfc.S
index cd26545264..95fa0ab534 100644
--- a/sysdeps/ia64/fpu/s_erfc.S
+++ b/sysdeps/ia64/fpu/s_erfc.S
@@ -1136,6 +1136,7 @@ GLOBAL_LIBM_ENTRY(erfc)
};;
GLOBAL_LIBM_END(erfc)
+libm_alias_double_other (erfc, erfc)
// call via (p15) br.cond.spnt __libm_error_region
// for x > ARG_ASYMP = 28.0
diff --git a/sysdeps/ia64/fpu/s_erfcf.S b/sysdeps/ia64/fpu/s_erfcf.S
index f9502d7e4a..88da077a3b 100644
--- a/sysdeps/ia64/fpu/s_erfcf.S
+++ b/sysdeps/ia64/fpu/s_erfcf.S
@@ -918,6 +918,7 @@ SPECIAL:
;;
GLOBAL_LIBM_END(erfcf)
+libm_alias_float_other (erfc, erfc)
// Call via (p10) br.cond.spnt __libm_error_region
diff --git a/sysdeps/ia64/fpu/s_erfcl.S b/sysdeps/ia64/fpu/s_erfcl.S
index aaa0bb0240..ff39c7ee3f 100644
--- a/sysdeps/ia64/fpu/s_erfcl.S
+++ b/sysdeps/ia64/fpu/s_erfcl.S
@@ -2003,6 +2003,7 @@ ERFC_RESULT:
};;
GLOBAL_LIBM_END(erfcl)
+libm_alias_ldouble_other (erfc, erfc)
// call via (p15) br.cond.spnt __libm_error_region
// for x > POS_ARG_ASYMP
diff --git a/sysdeps/ia64/fpu/s_erff.S b/sysdeps/ia64/fpu/s_erff.S
index a5cde66d5d..e20183664a 100644
--- a/sysdeps/ia64/fpu/s_erff.S
+++ b/sysdeps/ia64/fpu/s_erff.S
@@ -556,3 +556,4 @@ erff_denormal:
;;
GLOBAL_LIBM_END(erff)
+libm_alias_float_other (erf, erf)
diff --git a/sysdeps/ia64/fpu/s_erfl.S b/sysdeps/ia64/fpu/s_erfl.S
index 1fcb2127ea..8d58905c1c 100644
--- a/sysdeps/ia64/fpu/s_erfl.S
+++ b/sysdeps/ia64/fpu/s_erfl.S
@@ -1235,3 +1235,4 @@ _0_to_1o8:
GLOBAL_LIBM_END(erfl)
+libm_alias_ldouble_other (erf, erf)
diff --git a/sysdeps/ia64/fpu/s_expm1.S b/sysdeps/ia64/fpu/s_expm1.S
index f0b911e295..18d07e5bf9 100644
--- a/sysdeps/ia64/fpu/s_expm1.S
+++ b/sysdeps/ia64/fpu/s_expm1.S
@@ -831,6 +831,7 @@ EXPM1_CERTAIN_MINUS_ONE:
;;
GLOBAL_IEEE754_END(expm1)
+libm_alias_double_other (__expm1, expm1)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_expm1f.S b/sysdeps/ia64/fpu/s_expm1f.S
index 55264a9875..c324139ccc 100644
--- a/sysdeps/ia64/fpu/s_expm1f.S
+++ b/sysdeps/ia64/fpu/s_expm1f.S
@@ -612,6 +612,7 @@ EXPM1_CERTAIN_OVERFLOW:
;;
GLOBAL_IEEE754_END(expm1f)
+libm_alias_float_other (__expm1, expm1)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_expm1l.S b/sysdeps/ia64/fpu/s_expm1l.S
index 63bf39a3c1..4c9dcebeb3 100644
--- a/sysdeps/ia64/fpu/s_expm1l.S
+++ b/sysdeps/ia64/fpu/s_expm1l.S
@@ -677,6 +677,7 @@ GLOBAL_IEEE754_ENTRY(expm1l)
;;
GLOBAL_IEEE754_END(expm1l)
+libm_alias_ldouble_other (__expm1, expm1)
GLOBAL_IEEE754_ENTRY(expl)
@@ -1377,6 +1378,7 @@ EXP_64_UNSUPPORTED:
;;
GLOBAL_IEEE754_END(expl)
+libm_alias_ldouble_other (__exp, exp)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/s_fabs.S b/sysdeps/ia64/fpu/s_fabs.S
index 8bbdf9b084..f168a04c0e 100644
--- a/sysdeps/ia64/fpu/s_fabs.S
+++ b/sysdeps/ia64/fpu/s_fabs.S
@@ -80,3 +80,4 @@ GLOBAL_IEEE754_ENTRY(fabs)
}
GLOBAL_IEEE754_END(fabs)
+libm_alias_double_other (__fabs, fabs)
diff --git a/sysdeps/ia64/fpu/s_fabsf.S b/sysdeps/ia64/fpu/s_fabsf.S
index 546865fadc..b851ad0c8e 100644
--- a/sysdeps/ia64/fpu/s_fabsf.S
+++ b/sysdeps/ia64/fpu/s_fabsf.S
@@ -80,3 +80,4 @@ GLOBAL_IEEE754_ENTRY(fabsf)
}
GLOBAL_IEEE754_END(fabsf)
+libm_alias_float_other (__fabs, fabs)
diff --git a/sysdeps/ia64/fpu/s_fabsl.S b/sysdeps/ia64/fpu/s_fabsl.S
index 3794d19a8a..ca7812c4dc 100644
--- a/sysdeps/ia64/fpu/s_fabsl.S
+++ b/sysdeps/ia64/fpu/s_fabsl.S
@@ -80,3 +80,4 @@ GLOBAL_IEEE754_ENTRY(fabsl)
}
GLOBAL_IEEE754_END(fabsl)
+libm_alias_ldouble_other (__fabs, fabs)
diff --git a/sysdeps/ia64/fpu/s_fdim.S b/sysdeps/ia64/fpu/s_fdim.S
index a6bdf1f5f8..d962a7f9cc 100644
--- a/sysdeps/ia64/fpu/s_fdim.S
+++ b/sysdeps/ia64/fpu/s_fdim.S
@@ -163,6 +163,7 @@ FDIM_OVERFLOW:
;;
GLOBAL_LIBM_END(fdim)
+libm_alias_double_other (fdim, fdim)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_fdimf.S b/sysdeps/ia64/fpu/s_fdimf.S
index 10bc5a619a..88f67a53f7 100644
--- a/sysdeps/ia64/fpu/s_fdimf.S
+++ b/sysdeps/ia64/fpu/s_fdimf.S
@@ -163,6 +163,7 @@ FDIM_OVERFLOW:
;;
GLOBAL_LIBM_END(fdimf)
+libm_alias_float_other (fdim, fdim)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_fdiml.S b/sysdeps/ia64/fpu/s_fdiml.S
index a5c7396bbd..c23da7ebb0 100644
--- a/sysdeps/ia64/fpu/s_fdiml.S
+++ b/sysdeps/ia64/fpu/s_fdiml.S
@@ -163,6 +163,7 @@ FDIM_OVERFLOW:
;;
GLOBAL_LIBM_END(fdiml)
+libm_alias_ldouble_other (fdim, fdim)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_finite.S b/sysdeps/ia64/fpu/s_finite.S
index 595509f5d9..8784880097 100644
--- a/sysdeps/ia64/fpu/s_finite.S
+++ b/sysdeps/ia64/fpu/s_finite.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/fpu/s_floor.S b/sysdeps/ia64/fpu/s_floor.S
index 9ed9d6dcdb..35fa41be7e 100644
--- a/sysdeps/ia64/fpu/s_floor.S
+++ b/sysdeps/ia64/fpu/s_floor.S
@@ -214,3 +214,4 @@ FLOOR_UNORM:
;;
GLOBAL_IEEE754_END(floor)
+libm_alias_double_other (__floor, floor)
diff --git a/sysdeps/ia64/fpu/s_floorf.S b/sysdeps/ia64/fpu/s_floorf.S
index a3f2095931..8cd1ca6a1a 100644
--- a/sysdeps/ia64/fpu/s_floorf.S
+++ b/sysdeps/ia64/fpu/s_floorf.S
@@ -213,3 +213,4 @@ FLOOR_UNORM:
;;
GLOBAL_IEEE754_END(floorf)
+libm_alias_float_other (__floor, floor)
diff --git a/sysdeps/ia64/fpu/s_floorl.S b/sysdeps/ia64/fpu/s_floorl.S
index 345c4f30dd..8d495c0149 100644
--- a/sysdeps/ia64/fpu/s_floorl.S
+++ b/sysdeps/ia64/fpu/s_floorl.S
@@ -213,3 +213,4 @@ FLOOR_UNORM:
;;
GLOBAL_IEEE754_END(floorl)
+libm_alias_ldouble_other (__floor, floor)
diff --git a/sysdeps/ia64/fpu/s_fma.S b/sysdeps/ia64/fpu/s_fma.S
index 556f82a0d0..49e8059da2 100644
--- a/sysdeps/ia64/fpu/s_fma.S
+++ b/sysdeps/ia64/fpu/s_fma.S
@@ -69,3 +69,4 @@ GLOBAL_LIBM_ENTRY(fma)
;;
GLOBAL_LIBM_END(fma)
+libm_alias_double_other (fma, fma)
diff --git a/sysdeps/ia64/fpu/s_fmaf.S b/sysdeps/ia64/fpu/s_fmaf.S
index 132467593a..e59b634561 100644
--- a/sysdeps/ia64/fpu/s_fmaf.S
+++ b/sysdeps/ia64/fpu/s_fmaf.S
@@ -69,3 +69,4 @@ GLOBAL_LIBM_ENTRY(fmaf)
;;
GLOBAL_LIBM_END(fmaf)
+libm_alias_float_other (fma, fma)
diff --git a/sysdeps/ia64/fpu/s_fmal.S b/sysdeps/ia64/fpu/s_fmal.S
index 979fa9fb16..3547991955 100644
--- a/sysdeps/ia64/fpu/s_fmal.S
+++ b/sysdeps/ia64/fpu/s_fmal.S
@@ -69,3 +69,4 @@ GLOBAL_LIBM_ENTRY(fmal)
;;
GLOBAL_LIBM_END(fmal)
+libm_alias_ldouble_other (fma, fma)
diff --git a/sysdeps/ia64/fpu/s_fmax.S b/sysdeps/ia64/fpu/s_fmax.S
index bf0897457b..a5724514e8 100644
--- a/sysdeps/ia64/fpu/s_fmax.S
+++ b/sysdeps/ia64/fpu/s_fmax.S
@@ -112,3 +112,4 @@ GLOBAL_LIBM_ENTRY(fmax)
;;
GLOBAL_LIBM_END(fmax)
+libm_alias_double_other (fmax, fmax)
diff --git a/sysdeps/ia64/fpu/s_fmaxf.S b/sysdeps/ia64/fpu/s_fmaxf.S
index 30a78c708b..04f3f8847d 100644
--- a/sysdeps/ia64/fpu/s_fmaxf.S
+++ b/sysdeps/ia64/fpu/s_fmaxf.S
@@ -112,3 +112,4 @@ GLOBAL_LIBM_ENTRY(fmaxf)
;;
GLOBAL_LIBM_END(fmaxf)
+libm_alias_float_other (fmax, fmax)
diff --git a/sysdeps/ia64/fpu/s_fmaxl.S b/sysdeps/ia64/fpu/s_fmaxl.S
index a575cf00eb..9d5a1a76a4 100644
--- a/sysdeps/ia64/fpu/s_fmaxl.S
+++ b/sysdeps/ia64/fpu/s_fmaxl.S
@@ -112,3 +112,4 @@ GLOBAL_LIBM_ENTRY(fmaxl)
;;
GLOBAL_LIBM_END(fmaxl)
+libm_alias_ldouble_other (fmax, fmax)
diff --git a/sysdeps/ia64/fpu/s_fpclassify.S b/sysdeps/ia64/fpu/s_fpclassify.S
index 6d8a9bd216..edb4ae281e 100644
--- a/sysdeps/ia64/fpu/s_fpclassify.S
+++ b/sysdeps/ia64/fpu/s_fpclassify.S
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/fpu/s_frexp.c b/sysdeps/ia64/fpu/s_frexp.c
index 95421eafdd..43794ea308 100644
--- a/sysdeps/ia64/fpu/s_frexp.c
+++ b/sysdeps/ia64/fpu/s_frexp.c
@@ -65,3 +65,4 @@ double frexp(double x, int *y)
#endif
}
+libm_alias_double_other (frexp, frexp)
diff --git a/sysdeps/ia64/fpu/s_frexpf.c b/sysdeps/ia64/fpu/s_frexpf.c
index 03290b2846..fbdee846d9 100644
--- a/sysdeps/ia64/fpu/s_frexpf.c
+++ b/sysdeps/ia64/fpu/s_frexpf.c
@@ -65,3 +65,4 @@ float frexpf(float x, int *y)
#endif
}
+libm_alias_float_other (frexp, frexp)
diff --git a/sysdeps/ia64/fpu/s_frexpl.c b/sysdeps/ia64/fpu/s_frexpl.c
index f999e20361..7da92550b1 100644
--- a/sysdeps/ia64/fpu/s_frexpl.c
+++ b/sysdeps/ia64/fpu/s_frexpl.c
@@ -65,3 +65,4 @@ long double frexpl(long double x, int *y)
#endif
}
+libm_alias_ldouble_other (frexp, frexp)
diff --git a/sysdeps/ia64/fpu/s_isinf.S b/sysdeps/ia64/fpu/s_isinf.S
index 8c6d425f62..bf68b6910e 100644
--- a/sysdeps/ia64/fpu/s_isinf.S
+++ b/sysdeps/ia64/fpu/s_isinf.S
@@ -1,5 +1,5 @@
/* Test for inf/-inf
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jes Sorensen <jes@linuxcare.com>, October 2000.
diff --git a/sysdeps/ia64/fpu/s_isnan.S b/sysdeps/ia64/fpu/s_isnan.S
index df5aadec05..db992b7184 100644
--- a/sysdeps/ia64/fpu/s_isnan.S
+++ b/sysdeps/ia64/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* Test for NaN
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jes Sorensen <jes@linuxcare.com>, October 2000.
diff --git a/sysdeps/ia64/fpu/s_ldexp.c b/sysdeps/ia64/fpu/s_ldexp.c
index 6cf0ffc083..36e3a2d067 100644
--- a/sysdeps/ia64/fpu/s_ldexp.c
+++ b/sysdeps/ia64/fpu/s_ldexp.c
@@ -59,3 +59,4 @@ double ldexp(double x, int n)
#endif
}
+libm_alias_double_other (ldexp, ldexp)
diff --git a/sysdeps/ia64/fpu/s_ldexpf.c b/sysdeps/ia64/fpu/s_ldexpf.c
index 64e335b0ec..c56db0e0b3 100644
--- a/sysdeps/ia64/fpu/s_ldexpf.c
+++ b/sysdeps/ia64/fpu/s_ldexpf.c
@@ -59,3 +59,4 @@ float ldexpf(float x, int n)
#endif
}
+libm_alias_float_other (ldexp, ldexp)
diff --git a/sysdeps/ia64/fpu/s_ldexpl.c b/sysdeps/ia64/fpu/s_ldexpl.c
index aa6f2d7642..594e112562 100644
--- a/sysdeps/ia64/fpu/s_ldexpl.c
+++ b/sysdeps/ia64/fpu/s_ldexpl.c
@@ -59,3 +59,4 @@ long double ldexpl(long double x, int n)
#endif
}
+libm_alias_ldouble_other (ldexp, ldexp)
diff --git a/sysdeps/ia64/fpu/s_log1p.S b/sysdeps/ia64/fpu/s_log1p.S
index 94f9f872e9..02fa3ef49e 100644
--- a/sysdeps/ia64/fpu/s_log1p.S
+++ b/sysdeps/ia64/fpu/s_log1p.S
@@ -1047,6 +1047,7 @@ log_libm_err:
;;
GLOBAL_IEEE754_END(log1p)
+libm_alias_double_other (__log1p, log1p)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_log1pf.S b/sysdeps/ia64/fpu/s_log1pf.S
index b04b18ed74..45638b5b6f 100644
--- a/sysdeps/ia64/fpu/s_log1pf.S
+++ b/sysdeps/ia64/fpu/s_log1pf.S
@@ -733,6 +733,7 @@ log_libm_err:
;;
GLOBAL_IEEE754_END(log1pf)
+libm_alias_float_other (__log1p, log1p)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_log1pl.S b/sysdeps/ia64/fpu/s_log1pl.S
index 3c8be02826..e96782bbac 100644
--- a/sysdeps/ia64/fpu/s_log1pl.S
+++ b/sysdeps/ia64/fpu/s_log1pl.S
@@ -1145,6 +1145,7 @@ LOG1P_LT_Minus_1:
GLOBAL_IEEE754_END(log1pl)
+libm_alias_ldouble_other (__log1p, log1p)
LOCAL_LIBM_ENTRY(__libm_error_region)
.prologue
diff --git a/sysdeps/ia64/fpu/s_logb.S b/sysdeps/ia64/fpu/s_logb.S
index 7ee898712b..c73db8791e 100644
--- a/sysdeps/ia64/fpu/s_logb.S
+++ b/sysdeps/ia64/fpu/s_logb.S
@@ -218,6 +218,7 @@ LOGB_ZERO:
;;
GLOBAL_LIBM_END(logb)
+libm_alias_double_other (logb, logb)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_logbf.S b/sysdeps/ia64/fpu/s_logbf.S
index eefa270db9..72ecb390e5 100644
--- a/sysdeps/ia64/fpu/s_logbf.S
+++ b/sysdeps/ia64/fpu/s_logbf.S
@@ -218,6 +218,7 @@ LOGB_ZERO:
;;
GLOBAL_LIBM_END(logbf)
+libm_alias_float_other (logb, logb)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_logbl.S b/sysdeps/ia64/fpu/s_logbl.S
index e312c1b438..0100a3e9d7 100644
--- a/sysdeps/ia64/fpu/s_logbl.S
+++ b/sysdeps/ia64/fpu/s_logbl.S
@@ -218,6 +218,7 @@ LOGB_ZERO:
;;
GLOBAL_LIBM_END(logbl)
+libm_alias_ldouble_other (logb, logb)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_matherrf.c b/sysdeps/ia64/fpu/s_matherrf.c
index a47d4b89a2..5808c04573 100644
--- a/sysdeps/ia64/fpu/s_matherrf.c
+++ b/sysdeps/ia64/fpu/s_matherrf.c
@@ -13,8 +13,10 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
#include "libm_support.h"
+#if LIBM_SVID_COMPAT
int
weak_function
__matherrf(struct exceptionf *x)
@@ -23,4 +25,5 @@ __matherrf(struct exceptionf *x)
if(x->arg1!=x->arg1) return 0;
return n;
}
-weak_alias (__matherrf, matherrf)
+compat_symbol (libm, __matherrf, matherrf, GLIBC_2_2_3);
+#endif
diff --git a/sysdeps/ia64/fpu/s_matherrl.c b/sysdeps/ia64/fpu/s_matherrl.c
index 6fe92d7739..dc64b31e50 100644
--- a/sysdeps/ia64/fpu/s_matherrl.c
+++ b/sysdeps/ia64/fpu/s_matherrl.c
@@ -13,8 +13,10 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
#include "libm_support.h"
+#if LIBM_SVID_COMPAT
int
weak_function
__matherrl(struct exceptionl *x)
@@ -23,4 +25,5 @@ __matherrl(struct exceptionl *x)
if(x->arg1!=x->arg1) return 0;
return n;
}
-weak_alias (__matherrl, matherrl)
+compat_symbol (libm, __matherrl, matherrl, GLIBC_2_2_3);
+#endif
diff --git a/sysdeps/ia64/fpu/s_modf.S b/sysdeps/ia64/fpu/s_modf.S
index 4634acfb0d..2b6ca8eda7 100644
--- a/sysdeps/ia64/fpu/s_modf.S
+++ b/sysdeps/ia64/fpu/s_modf.S
@@ -276,3 +276,4 @@ MODF_DENORM:
}
GLOBAL_LIBM_END(modf)
+libm_alias_double_other (modf, modf)
diff --git a/sysdeps/ia64/fpu/s_modff.S b/sysdeps/ia64/fpu/s_modff.S
index 36e02be81b..31f43c60d9 100644
--- a/sysdeps/ia64/fpu/s_modff.S
+++ b/sysdeps/ia64/fpu/s_modff.S
@@ -276,3 +276,4 @@ MODF_DENORM:
}
GLOBAL_LIBM_END(modff)
+libm_alias_float_other (modf, modf)
diff --git a/sysdeps/ia64/fpu/s_modfl.S b/sysdeps/ia64/fpu/s_modfl.S
index e95d520b4b..3139999536 100644
--- a/sysdeps/ia64/fpu/s_modfl.S
+++ b/sysdeps/ia64/fpu/s_modfl.S
@@ -271,3 +271,4 @@ MODF_DENORM:
}
GLOBAL_LIBM_END(modfl)
+libm_alias_ldouble_other (modf, modf)
diff --git a/sysdeps/ia64/fpu/s_nearbyint.S b/sysdeps/ia64/fpu/s_nearbyint.S
index ec1ff22dbc..91508e8cc4 100644
--- a/sysdeps/ia64/fpu/s_nearbyint.S
+++ b/sysdeps/ia64/fpu/s_nearbyint.S
@@ -215,3 +215,4 @@ RINT_NOT_ROUND_NEAREST:
;;
GLOBAL_LIBM_END(nearbyint)
+libm_alias_double_other (nearbyint, nearbyint)
diff --git a/sysdeps/ia64/fpu/s_nearbyintf.S b/sysdeps/ia64/fpu/s_nearbyintf.S
index aac7b5c126..8a80fb0829 100644
--- a/sysdeps/ia64/fpu/s_nearbyintf.S
+++ b/sysdeps/ia64/fpu/s_nearbyintf.S
@@ -215,3 +215,4 @@ RINT_NOT_ROUND_NEAREST:
;;
GLOBAL_LIBM_END(nearbyintf)
+libm_alias_float_other (nearbyint, nearbyint)
diff --git a/sysdeps/ia64/fpu/s_nearbyintl.S b/sysdeps/ia64/fpu/s_nearbyintl.S
index 83adc07896..bf4e8a9afd 100644
--- a/sysdeps/ia64/fpu/s_nearbyintl.S
+++ b/sysdeps/ia64/fpu/s_nearbyintl.S
@@ -215,4 +215,4 @@ RINT_NOT_ROUND_NEAREST:
;;
GLOBAL_LIBM_END(__nearbyintl)
-weak_alias (__nearbyintl, nearbyintl)
+libm_alias_ldouble (__nearbyint, nearbyint)
diff --git a/sysdeps/ia64/fpu/s_nextafter.S b/sysdeps/ia64/fpu/s_nextafter.S
index 44a43c50b9..fa1d3f1633 100644
--- a/sysdeps/ia64/fpu/s_nextafter.S
+++ b/sysdeps/ia64/fpu/s_nextafter.S
@@ -431,6 +431,7 @@ NEXT_OVERFLOW:
;;
GLOBAL_LIBM_END(nextafter)
+libm_alias_double_other (nextafter, nextafter)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_nextafterf.S b/sysdeps/ia64/fpu/s_nextafterf.S
index 5769ce8f9b..ca8d6ab608 100644
--- a/sysdeps/ia64/fpu/s_nextafterf.S
+++ b/sysdeps/ia64/fpu/s_nextafterf.S
@@ -437,6 +437,7 @@ NEXT_OVERFLOW:
;;
GLOBAL_LIBM_END(nextafterf)
+libm_alias_float_other (nextafter, nextafter)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_nextafterl.S b/sysdeps/ia64/fpu/s_nextafterl.S
index d771a97389..cf2feba043 100644
--- a/sysdeps/ia64/fpu/s_nextafterl.S
+++ b/sysdeps/ia64/fpu/s_nextafterl.S
@@ -436,6 +436,7 @@ NEXT_OVERFLOW:
;;
GLOBAL_LIBM_END(nextafterl)
+libm_alias_ldouble_other (nextafter, nextafter)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_rint.S b/sysdeps/ia64/fpu/s_rint.S
index 1735d9b498..3a546d963f 100644
--- a/sysdeps/ia64/fpu/s_rint.S
+++ b/sysdeps/ia64/fpu/s_rint.S
@@ -227,3 +227,4 @@ RINT_NOT_ROUND_NEAREST:
;;
GLOBAL_IEEE754_END(rint)
+libm_alias_double_other (__rint, rint)
diff --git a/sysdeps/ia64/fpu/s_rintf.S b/sysdeps/ia64/fpu/s_rintf.S
index 05d6b411f2..1d9a538538 100644
--- a/sysdeps/ia64/fpu/s_rintf.S
+++ b/sysdeps/ia64/fpu/s_rintf.S
@@ -227,3 +227,4 @@ RINT_NOT_ROUND_NEAREST:
;;
GLOBAL_IEEE754_END(rintf)
+libm_alias_float_other (__rint, rint)
diff --git a/sysdeps/ia64/fpu/s_rintl.S b/sysdeps/ia64/fpu/s_rintl.S
index b5402149ec..8b6c87162b 100644
--- a/sysdeps/ia64/fpu/s_rintl.S
+++ b/sysdeps/ia64/fpu/s_rintl.S
@@ -227,3 +227,4 @@ RINT_NOT_ROUND_NEAREST:
;;
GLOBAL_IEEE754_END(rintl)
+libm_alias_ldouble_other (__rint, rint)
diff --git a/sysdeps/ia64/fpu/s_round.S b/sysdeps/ia64/fpu/s_round.S
index 821187522b..03afb1bf73 100644
--- a/sysdeps/ia64/fpu/s_round.S
+++ b/sysdeps/ia64/fpu/s_round.S
@@ -231,3 +231,4 @@ ROUND_UNORM:
;;
GLOBAL_LIBM_END(round)
+libm_alias_double_other (round, round)
diff --git a/sysdeps/ia64/fpu/s_roundf.S b/sysdeps/ia64/fpu/s_roundf.S
index c0351b4a4d..8de595472d 100644
--- a/sysdeps/ia64/fpu/s_roundf.S
+++ b/sysdeps/ia64/fpu/s_roundf.S
@@ -231,3 +231,4 @@ ROUND_UNORM:
;;
GLOBAL_LIBM_END(roundf)
+libm_alias_float_other (round, round)
diff --git a/sysdeps/ia64/fpu/s_roundl.S b/sysdeps/ia64/fpu/s_roundl.S
index 355eaf5057..8ec511f69f 100644
--- a/sysdeps/ia64/fpu/s_roundl.S
+++ b/sysdeps/ia64/fpu/s_roundl.S
@@ -231,3 +231,4 @@ ROUND_UNORM:
;;
GLOBAL_LIBM_END(roundl)
+libm_alias_ldouble_other (round, round)
diff --git a/sysdeps/ia64/fpu/s_scalblnf.c b/sysdeps/ia64/fpu/s_scalblnf.c
index ed92bfd989..d07069dccf 100644
--- a/sysdeps/ia64/fpu/s_scalblnf.c
+++ b/sysdeps/ia64/fpu/s_scalblnf.c
@@ -59,3 +59,4 @@ float scalblnf(float x, long int n)
#endif
}
+libm_alias_float_other (scalbln, scalbln)
diff --git a/sysdeps/ia64/fpu/s_scalbn.c b/sysdeps/ia64/fpu/s_scalbn.c
index 23e8d818b2..8bb7b2aa5e 100644
--- a/sysdeps/ia64/fpu/s_scalbn.c
+++ b/sysdeps/ia64/fpu/s_scalbn.c
@@ -60,4 +60,4 @@ double __scalbn(double x, int n)
}
-weak_alias (__scalbn, scalbn)
+libm_alias_double (__scalbn, scalbn)
diff --git a/sysdeps/ia64/fpu/s_scalbnf.c b/sysdeps/ia64/fpu/s_scalbnf.c
index ec2582cddc..ee2296064f 100644
--- a/sysdeps/ia64/fpu/s_scalbnf.c
+++ b/sysdeps/ia64/fpu/s_scalbnf.c
@@ -60,4 +60,4 @@ float __scalbnf(float x, int n)
}
-weak_alias (__scalbnf, scalbnf)
+libm_alias_float (__scalbn, scalbn)
diff --git a/sysdeps/ia64/fpu/s_scalbnl.c b/sysdeps/ia64/fpu/s_scalbnl.c
index 73ffb904b7..dca01cfb5f 100644
--- a/sysdeps/ia64/fpu/s_scalbnl.c
+++ b/sysdeps/ia64/fpu/s_scalbnl.c
@@ -60,4 +60,4 @@ long double __scalbnl(long double x, int n)
}
-weak_alias (__scalbnl, scalbnl)
+libm_alias_ldouble (__scalbn, scalbn)
diff --git a/sysdeps/ia64/fpu/s_signbit.S b/sysdeps/ia64/fpu/s_signbit.S
index 76193de326..015db97464 100644
--- a/sysdeps/ia64/fpu/s_signbit.S
+++ b/sysdeps/ia64/fpu/s_signbit.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/fpu/s_tan.S b/sysdeps/ia64/fpu/s_tan.S
index 050b4434e1..8305b8e91b 100644
--- a/sysdeps/ia64/fpu/s_tan.S
+++ b/sysdeps/ia64/fpu/s_tan.S
@@ -737,6 +737,7 @@ COMMON_PATH:
br.ret.sptk b0 ;;
}
GLOBAL_IEEE754_END(tan)
+libm_alias_double_other (__tan, tan)
LOCAL_LIBM_ENTRY(__libm_callout)
diff --git a/sysdeps/ia64/fpu/s_tanf.S b/sysdeps/ia64/fpu/s_tanf.S
index 7df762f621..a25bb943fe 100644
--- a/sysdeps/ia64/fpu/s_tanf.S
+++ b/sysdeps/ia64/fpu/s_tanf.S
@@ -550,6 +550,7 @@ Return_From_Huges:
;;
GLOBAL_IEEE754_END(tanf)
+libm_alias_float_other (__tan, tan)
LOCAL_LIBM_ENTRY(__libm_callout)
diff --git a/sysdeps/ia64/fpu/s_tanh.S b/sysdeps/ia64/fpu/s_tanh.S
index 393af1f8c2..56cc43dfea 100644
--- a/sysdeps/ia64/fpu/s_tanh.S
+++ b/sysdeps/ia64/fpu/s_tanh.S
@@ -982,3 +982,4 @@ _tanh_spec:
};;
GLOBAL_LIBM_END(tanh)
+libm_alias_double_other (tanh, tanh)
diff --git a/sysdeps/ia64/fpu/s_tanhf.S b/sysdeps/ia64/fpu/s_tanhf.S
index 4749477b40..ffbc9ea175 100644
--- a/sysdeps/ia64/fpu/s_tanhf.S
+++ b/sysdeps/ia64/fpu/s_tanhf.S
@@ -579,3 +579,4 @@ tanhf_denormal:
;;
GLOBAL_LIBM_END(tanhf)
+libm_alias_float_other (tanh, tanh)
diff --git a/sysdeps/ia64/fpu/s_tanhl.S b/sysdeps/ia64/fpu/s_tanhl.S
index 2ebd1e780e..1810e4daea 100644
--- a/sysdeps/ia64/fpu/s_tanhl.S
+++ b/sysdeps/ia64/fpu/s_tanhl.S
@@ -1342,3 +1342,4 @@ _0_to_1o8:
};;
GLOBAL_LIBM_END(tanhl)
+libm_alias_ldouble_other (tanh, tanh)
diff --git a/sysdeps/ia64/fpu/s_tanl.S b/sysdeps/ia64/fpu/s_tanl.S
index b59936c4a1..ab893fc2b4 100644
--- a/sysdeps/ia64/fpu/s_tanl.S
+++ b/sysdeps/ia64/fpu/s_tanl.S
@@ -3091,6 +3091,7 @@ TANL_UNSUPPORTED:
;;
GLOBAL_IEEE754_END(tanl)
+libm_alias_ldouble_other (__tan, tan)
LOCAL_LIBM_ENTRY(__libm_error_region)
diff --git a/sysdeps/ia64/fpu/s_trunc.S b/sysdeps/ia64/fpu/s_trunc.S
index b9ad03b5a8..e0aa3d33c5 100644
--- a/sysdeps/ia64/fpu/s_trunc.S
+++ b/sysdeps/ia64/fpu/s_trunc.S
@@ -164,3 +164,4 @@ TRUNC_UNORM:
;;
GLOBAL_LIBM_END(trunc)
+libm_alias_double_other (trunc, trunc)
diff --git a/sysdeps/ia64/fpu/s_truncf.S b/sysdeps/ia64/fpu/s_truncf.S
index ff40bc7101..b9a055b393 100644
--- a/sysdeps/ia64/fpu/s_truncf.S
+++ b/sysdeps/ia64/fpu/s_truncf.S
@@ -164,3 +164,4 @@ TRUNC_UNORM:
;;
GLOBAL_LIBM_END(truncf)
+libm_alias_float_other (trunc, trunc)
diff --git a/sysdeps/ia64/fpu/s_truncl.S b/sysdeps/ia64/fpu/s_truncl.S
index 1afa19ba2b..f73e7b46b9 100644
--- a/sysdeps/ia64/fpu/s_truncl.S
+++ b/sysdeps/ia64/fpu/s_truncl.S
@@ -164,3 +164,4 @@ TRUNC_UNORM:
;;
GLOBAL_LIBM_END(truncl)
+libm_alias_ldouble_other (trunc, trunc)
diff --git a/sysdeps/ia64/fpu/sfp-machine.h b/sysdeps/ia64/fpu/sfp-machine.h
new file mode 100644
index 0000000000..45e844d3da
--- /dev/null
+++ b/sysdeps/ia64/fpu/sfp-machine.h
@@ -0,0 +1,100 @@
+#define _FP_W_TYPE_SIZE 64
+#define _FP_W_TYPE unsigned long
+#define _FP_WS_TYPE signed long
+#define _FP_I_TYPE long
+
+typedef int TItype __attribute__ ((mode (TI)));
+typedef unsigned int UTItype __attribute__ ((mode (TI)));
+
+#define TI_BITS (__CHAR_BIT__ * (int)sizeof(TItype))
+
+/* The type of the result of a floating point comparison. This must
+ match `__libgcc_cmp_return__' in GCC for the target. */
+typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
+#define CMPtype __gcc_CMPtype
+
+#define _FP_MUL_MEAT_Q(R,X,Y) \
+ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S _FP_QNANBIT_S
+#define _FP_NANFRAC_D _FP_QNANBIT_D
+#define _FP_NANFRAC_E _FP_QNANBIT_E, 0
+#define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0
+
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
+
+#define _FP_NANSIGN_S 1
+#define _FP_NANSIGN_D 1
+#define _FP_NANSIGN_E 1
+#define _FP_NANSIGN_Q 1
+
+/* Here is something Intel misdesigned: the specs don't define
+ the case where we have two NaNs with same mantissas, but
+ different sign. Different operations pick up different NaNs. */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do { \
+ if (_FP_FRAC_GT_##wc(X, Y) \
+ || (_FP_FRAC_EQ_##wc(X,Y) && (OP == '+' || OP == '*'))) \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc(R,X); \
+ } \
+ else \
+ { \
+ R##_s = Y##_s; \
+ _FP_FRAC_COPY_##wc(R,Y); \
+ } \
+ R##_c = FP_CLS_NAN; \
+ } while (0)
+
+#define FP_EX_INVALID 0x01
+#define FP_EX_DENORM 0x02
+#define FP_EX_DIVZERO 0x04
+#define FP_EX_OVERFLOW 0x08
+#define FP_EX_UNDERFLOW 0x10
+#define FP_EX_INEXACT 0x20
+#define FP_EX_ALL \
+ (FP_EX_INVALID | FP_EX_DENORM | FP_EX_DIVZERO | FP_EX_OVERFLOW \
+ | FP_EX_UNDERFLOW | FP_EX_INEXACT)
+
+#define _FP_TININESS_AFTER_ROUNDING 1
+
+void __sfp_handle_exceptions (int);
+
+#define FP_HANDLE_EXCEPTIONS \
+ do { \
+ if (__builtin_expect (_fex, 0)) \
+ __sfp_handle_exceptions (_fex); \
+ } while (0);
+
+#define FP_TRAPPING_EXCEPTIONS (~_fcw & FP_EX_ALL)
+
+#define FP_RND_NEAREST 0
+#define FP_RND_ZERO 0xc00L
+#define FP_RND_PINF 0x800L
+#define FP_RND_MINF 0x400L
+
+#define FP_RND_MASK 0xc00L
+
+#define _FP_DECL_EX \
+ unsigned long int _fcw __attribute__ ((unused)) = FP_RND_NEAREST
+
+#define FP_INIT_ROUNDMODE \
+ do { \
+ __asm__ __volatile__ ("mov.m %0 = ar.fpsr" : "=r" (_fcw)); \
+ } while (0)
+
+#define FP_ROUNDMODE (_fcw & FP_RND_MASK)
+
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
+
+/* Define ALIASNAME as a strong alias for NAME. */
+#define strong_alias(name, aliasname) _strong_alias(name, aliasname)
+#define _strong_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name)));
diff --git a/sysdeps/ia64/fpu/w_acos.c b/sysdeps/ia64/fpu/w_acos.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_acos.c
+++ b/sysdeps/ia64/fpu/w_acos.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/k_rem_pio2.c b/sysdeps/ia64/fpu/w_acos_compat.c
index 41254ae60a..41254ae60a 100644
--- a/sysdeps/ia64/fpu/k_rem_pio2.c
+++ b/sysdeps/ia64/fpu/w_acos_compat.c
diff --git a/sysdeps/ia64/fpu/halfulp.c b/sysdeps/ia64/fpu/w_acosf_compat.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/ia64/fpu/halfulp.c
+++ b/sysdeps/ia64/fpu/w_acosf_compat.c
diff --git a/sysdeps/ia64/fpu/w_acosh.c b/sysdeps/ia64/fpu/w_acosh.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_acosh.c
+++ b/sysdeps/ia64/fpu/w_acosh.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/k_rem_pio2l.c b/sysdeps/ia64/fpu/w_acosh_compat.c
index 41254ae60a..41254ae60a 100644
--- a/sysdeps/ia64/fpu/k_rem_pio2l.c
+++ b/sysdeps/ia64/fpu/w_acosh_compat.c
diff --git a/sysdeps/ia64/fpu/w_acoshf.c b/sysdeps/ia64/fpu/w_acoshf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_acoshf.c
+++ b/sysdeps/ia64/fpu/w_acoshf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_scalb.c b/sysdeps/ia64/fpu/w_acoshf_compat.c
index 41254ae60a..41254ae60a 100644
--- a/sysdeps/ia64/fpu/w_scalb.c
+++ b/sysdeps/ia64/fpu/w_acoshf_compat.c
diff --git a/sysdeps/ia64/fpu/w_acoshl.c b/sysdeps/ia64/fpu/w_acoshl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_acoshl.c
+++ b/sysdeps/ia64/fpu/w_acoshl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_scalbf.c b/sysdeps/ia64/fpu/w_acoshl_compat.c
index 41254ae60a..41254ae60a 100644
--- a/sysdeps/ia64/fpu/w_scalbf.c
+++ b/sysdeps/ia64/fpu/w_acoshl_compat.c
diff --git a/sysdeps/ia64/fpu/mpexp.c b/sysdeps/ia64/fpu/w_acosl_compat.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/ia64/fpu/mpexp.c
+++ b/sysdeps/ia64/fpu/w_acosl_compat.c
diff --git a/sysdeps/ia64/fpu/w_asin.c b/sysdeps/ia64/fpu/w_asin.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_asin.c
+++ b/sysdeps/ia64/fpu/w_asin.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_scalbl.c b/sysdeps/ia64/fpu/w_asin_compat.c
index 41254ae60a..41254ae60a 100644
--- a/sysdeps/ia64/fpu/w_scalbl.c
+++ b/sysdeps/ia64/fpu/w_asin_compat.c
diff --git a/sysdeps/ia64/fpu/w_asinf.c b/sysdeps/ia64/fpu/w_asinf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_asinf.c
+++ b/sysdeps/ia64/fpu/w_asinf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_asinf_compat.c b/sysdeps/ia64/fpu/w_asinf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_asinf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_asinl.c b/sysdeps/ia64/fpu/w_asinl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_asinl.c
+++ b/sysdeps/ia64/fpu/w_asinl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_asinl_compat.c b/sysdeps/ia64/fpu/w_asinl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_asinl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atan2.c b/sysdeps/ia64/fpu/w_atan2.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_atan2.c
+++ b/sysdeps/ia64/fpu/w_atan2.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atan2_compat.c b/sysdeps/ia64/fpu/w_atan2_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_atan2_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atan2f.c b/sysdeps/ia64/fpu/w_atan2f.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_atan2f.c
+++ b/sysdeps/ia64/fpu/w_atan2f.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atan2f_compat.c b/sysdeps/ia64/fpu/w_atan2f_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_atan2f_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atan2l.c b/sysdeps/ia64/fpu/w_atan2l.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_atan2l.c
+++ b/sysdeps/ia64/fpu/w_atan2l.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atan2l_compat.c b/sysdeps/ia64/fpu/w_atan2l_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_atan2l_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atanh.c b/sysdeps/ia64/fpu/w_atanh.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_atanh.c
+++ b/sysdeps/ia64/fpu/w_atanh.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atanh_compat.c b/sysdeps/ia64/fpu/w_atanh_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_atanh_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atanhf.c b/sysdeps/ia64/fpu/w_atanhf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_atanhf.c
+++ b/sysdeps/ia64/fpu/w_atanhf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atanhf_compat.c b/sysdeps/ia64/fpu/w_atanhf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_atanhf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atanhl.c b/sysdeps/ia64/fpu/w_atanhl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_atanhl.c
+++ b/sysdeps/ia64/fpu/w_atanhl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_atanhl_compat.c b/sysdeps/ia64/fpu/w_atanhl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_atanhl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_cosh.c b/sysdeps/ia64/fpu/w_cosh.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_cosh.c
+++ b/sysdeps/ia64/fpu/w_cosh.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_cosh_compat.c b/sysdeps/ia64/fpu/w_cosh_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_cosh_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_coshf.c b/sysdeps/ia64/fpu/w_coshf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_coshf.c
+++ b/sysdeps/ia64/fpu/w_coshf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_coshf_compat.c b/sysdeps/ia64/fpu/w_coshf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_coshf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_coshl.c b/sysdeps/ia64/fpu/w_coshl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_coshl.c
+++ b/sysdeps/ia64/fpu/w_coshl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_coshl_compat.c b/sysdeps/ia64/fpu/w_coshl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_coshl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp.c b/sysdeps/ia64/fpu/w_exp.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_exp.c
+++ b/sysdeps/ia64/fpu/w_exp.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp10.c b/sysdeps/ia64/fpu/w_exp10.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_exp10.c
+++ b/sysdeps/ia64/fpu/w_exp10.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp10_compat.c b/sysdeps/ia64/fpu/w_exp10_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_exp10_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp10f.c b/sysdeps/ia64/fpu/w_exp10f.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_exp10f.c
+++ b/sysdeps/ia64/fpu/w_exp10f.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp10f_compat.c b/sysdeps/ia64/fpu/w_exp10f_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_exp10f_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp10l.c b/sysdeps/ia64/fpu/w_exp10l.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_exp10l.c
+++ b/sysdeps/ia64/fpu/w_exp10l.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp10l_compat.c b/sysdeps/ia64/fpu/w_exp10l_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_exp10l_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp2.c b/sysdeps/ia64/fpu/w_exp2.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_exp2.c
+++ b/sysdeps/ia64/fpu/w_exp2.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp2_compat.c b/sysdeps/ia64/fpu/w_exp2_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_exp2_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp2f.c b/sysdeps/ia64/fpu/w_exp2f.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_exp2f.c
+++ b/sysdeps/ia64/fpu/w_exp2f.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp2f_compat.c b/sysdeps/ia64/fpu/w_exp2f_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_exp2f_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp2l.c b/sysdeps/ia64/fpu/w_exp2l.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_exp2l.c
+++ b/sysdeps/ia64/fpu/w_exp2l.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp2l_compat.c b/sysdeps/ia64/fpu/w_exp2l_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_exp2l_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_exp_compat.c b/sysdeps/ia64/fpu/w_exp_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_exp_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_expf.c b/sysdeps/ia64/fpu/w_expf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_expf.c
+++ b/sysdeps/ia64/fpu/w_expf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_expf_compat.c b/sysdeps/ia64/fpu/w_expf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_expf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_expl.c b/sysdeps/ia64/fpu/w_expl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_expl.c
+++ b/sysdeps/ia64/fpu/w_expl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_expl_compat.c b/sysdeps/ia64/fpu/w_expl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_expl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_fmod.c b/sysdeps/ia64/fpu/w_fmod.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_fmod.c
+++ b/sysdeps/ia64/fpu/w_fmod.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_fmod_compat.c b/sysdeps/ia64/fpu/w_fmod_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_fmod_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_fmodf.c b/sysdeps/ia64/fpu/w_fmodf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_fmodf.c
+++ b/sysdeps/ia64/fpu/w_fmodf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_fmodf_compat.c b/sysdeps/ia64/fpu/w_fmodf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_fmodf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_fmodl.c b/sysdeps/ia64/fpu/w_fmodl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_fmodl.c
+++ b/sysdeps/ia64/fpu/w_fmodl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_fmodl_compat.c b/sysdeps/ia64/fpu/w_fmodl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_fmodl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_hypot.c b/sysdeps/ia64/fpu/w_hypot.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_hypot.c
+++ b/sysdeps/ia64/fpu/w_hypot.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_hypot_compat.c b/sysdeps/ia64/fpu/w_hypot_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_hypot_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_hypotf.c b/sysdeps/ia64/fpu/w_hypotf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_hypotf.c
+++ b/sysdeps/ia64/fpu/w_hypotf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_hypotf_compat.c b/sysdeps/ia64/fpu/w_hypotf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_hypotf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_hypotl.c b/sysdeps/ia64/fpu/w_hypotl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_hypotl.c
+++ b/sysdeps/ia64/fpu/w_hypotl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_hypotl_compat.c b/sysdeps/ia64/fpu/w_hypotl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_hypotl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_lgamma_main.c b/sysdeps/ia64/fpu/w_lgamma_main.c
index 3ad73b6756..2fd6dd1b04 100644
--- a/sysdeps/ia64/fpu/w_lgamma_main.c
+++ b/sysdeps/ia64/fpu/w_lgamma_main.c
@@ -69,6 +69,7 @@ double LGFUNC (lgamma) (double x)
compat_symbol (libm, __lgamma_compat, lgamma, LGAMMA_OLD_VER);
# else
versioned_symbol (libm, __ieee754_lgamma, lgamma, LGAMMA_NEW_VER);
+libm_alias_double_other (__ieee754_lgamma, lgamma)
# endif
# if GAMMA_ALIAS
strong_alias (LGFUNC (lgamma), __ieee754_gamma)
diff --git a/sysdeps/ia64/fpu/w_lgamma_r.c b/sysdeps/ia64/fpu/w_lgamma_r.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_lgamma_r.c
+++ b/sysdeps/ia64/fpu/w_lgamma_r.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_lgamma_r_compat.c b/sysdeps/ia64/fpu/w_lgamma_r_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_lgamma_r_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_lgammaf_main.c b/sysdeps/ia64/fpu/w_lgammaf_main.c
index 2f3dd41088..dc781aacab 100644
--- a/sysdeps/ia64/fpu/w_lgammaf_main.c
+++ b/sysdeps/ia64/fpu/w_lgammaf_main.c
@@ -69,6 +69,7 @@ float LGFUNC (lgammaf) (float x)
compat_symbol (libm, __lgammaf_compat, lgammaf, LGAMMA_OLD_VER);
# else
versioned_symbol (libm, __ieee754_lgammaf, lgammaf, LGAMMA_NEW_VER);
+libm_alias_float_other (__ieee754_lgamma, lgamma)
# endif
# if GAMMA_ALIAS
strong_alias (LGFUNC (lgammaf), __ieee754_gammaf)
diff --git a/sysdeps/ia64/fpu/w_lgammaf_r.c b/sysdeps/ia64/fpu/w_lgammaf_r.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_lgammaf_r.c
+++ b/sysdeps/ia64/fpu/w_lgammaf_r.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_lgammaf_r_compat.c b/sysdeps/ia64/fpu/w_lgammaf_r_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_lgammaf_r_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_lgammal_main.c b/sysdeps/ia64/fpu/w_lgammal_main.c
index 7879611d54..46e4d7f629 100644
--- a/sysdeps/ia64/fpu/w_lgammal_main.c
+++ b/sysdeps/ia64/fpu/w_lgammal_main.c
@@ -68,6 +68,7 @@ long double LGFUNC (lgammal) (long double x)
compat_symbol (libm, __lgammal_compat, lgammal, LGAMMA_OLD_VER);
# else
versioned_symbol (libm, __ieee754_lgammal, lgammal, LGAMMA_NEW_VER);
+libm_alias_ldouble_other (__ieee754_lgamma, lgamma)
# endif
# if GAMMA_ALIAS
strong_alias (LGFUNC (lgammal), __ieee754_gammal)
diff --git a/sysdeps/ia64/fpu/w_lgammal_r.c b/sysdeps/ia64/fpu/w_lgammal_r.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_lgammal_r.c
+++ b/sysdeps/ia64/fpu/w_lgammal_r.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_lgammal_r_compat.c b/sysdeps/ia64/fpu/w_lgammal_r_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_lgammal_r_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log.c b/sysdeps/ia64/fpu/w_log.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_log.c
+++ b/sysdeps/ia64/fpu/w_log.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log10.c b/sysdeps/ia64/fpu/w_log10.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_log10.c
+++ b/sysdeps/ia64/fpu/w_log10.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log10_compat.c b/sysdeps/ia64/fpu/w_log10_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_log10_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log10f.c b/sysdeps/ia64/fpu/w_log10f.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_log10f.c
+++ b/sysdeps/ia64/fpu/w_log10f.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log10f_compat.c b/sysdeps/ia64/fpu/w_log10f_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_log10f_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log10l.c b/sysdeps/ia64/fpu/w_log10l.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_log10l.c
+++ b/sysdeps/ia64/fpu/w_log10l.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log10l_compat.c b/sysdeps/ia64/fpu/w_log10l_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_log10l_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log1p.c b/sysdeps/ia64/fpu/w_log1p.c
index 82f2667b8d..0c15b166f8 100644
--- a/sysdeps/ia64/fpu/w_log1p.c
+++ b/sysdeps/ia64/fpu/w_log1p.c
@@ -1,5 +1,5 @@
/* Wrapper for __log1p that handles setting errno.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/fpu/w_log1pf.c b/sysdeps/ia64/fpu/w_log1pf.c
index 4ef6b36ac4..0840e72f4e 100644
--- a/sysdeps/ia64/fpu/w_log1pf.c
+++ b/sysdeps/ia64/fpu/w_log1pf.c
@@ -1,5 +1,5 @@
/* Wrapper for __log1pf that handles setting errno.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/fpu/w_log1pl.c b/sysdeps/ia64/fpu/w_log1pl.c
index 392ad6b323..d76b8f709c 100644
--- a/sysdeps/ia64/fpu/w_log1pl.c
+++ b/sysdeps/ia64/fpu/w_log1pl.c
@@ -1,5 +1,5 @@
/* Wrapper for __log1pl that handles setting errno.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/fpu/w_log2.c b/sysdeps/ia64/fpu/w_log2.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_log2.c
+++ b/sysdeps/ia64/fpu/w_log2.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log2_compat.c b/sysdeps/ia64/fpu/w_log2_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_log2_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log2f.c b/sysdeps/ia64/fpu/w_log2f.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_log2f.c
+++ b/sysdeps/ia64/fpu/w_log2f.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log2f_compat.c b/sysdeps/ia64/fpu/w_log2f_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_log2f_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log2l.c b/sysdeps/ia64/fpu/w_log2l.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_log2l.c
+++ b/sysdeps/ia64/fpu/w_log2l.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log2l_compat.c b/sysdeps/ia64/fpu/w_log2l_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_log2l_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_log_compat.c b/sysdeps/ia64/fpu/w_log_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_log_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_logf.c b/sysdeps/ia64/fpu/w_logf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_logf.c
+++ b/sysdeps/ia64/fpu/w_logf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_logf_compat.c b/sysdeps/ia64/fpu/w_logf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_logf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_logl.c b/sysdeps/ia64/fpu/w_logl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_logl.c
+++ b/sysdeps/ia64/fpu/w_logl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_logl_compat.c b/sysdeps/ia64/fpu/w_logl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_logl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_pow.c b/sysdeps/ia64/fpu/w_pow.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_pow.c
+++ b/sysdeps/ia64/fpu/w_pow.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_pow_compat.c b/sysdeps/ia64/fpu/w_pow_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_pow_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_powf.c b/sysdeps/ia64/fpu/w_powf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_powf.c
+++ b/sysdeps/ia64/fpu/w_powf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_powf_compat.c b/sysdeps/ia64/fpu/w_powf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_powf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_powl.c b/sysdeps/ia64/fpu/w_powl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_powl.c
+++ b/sysdeps/ia64/fpu/w_powl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_powl_compat.c b/sysdeps/ia64/fpu/w_powl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_powl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_remainder.c b/sysdeps/ia64/fpu/w_remainder.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_remainder.c
+++ b/sysdeps/ia64/fpu/w_remainder.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_remainder_compat.c b/sysdeps/ia64/fpu/w_remainder_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_remainder_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_remainderf.c b/sysdeps/ia64/fpu/w_remainderf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_remainderf.c
+++ b/sysdeps/ia64/fpu/w_remainderf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_remainderf_compat.c b/sysdeps/ia64/fpu/w_remainderf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_remainderf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_remainderl.c b/sysdeps/ia64/fpu/w_remainderl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_remainderl.c
+++ b/sysdeps/ia64/fpu/w_remainderl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_remainderl_compat.c b/sysdeps/ia64/fpu/w_remainderl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_remainderl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_scalb_compat.c b/sysdeps/ia64/fpu/w_scalb_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_scalb_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_scalbf_compat.c b/sysdeps/ia64/fpu/w_scalbf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_scalbf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_scalbl_compat.c b/sysdeps/ia64/fpu/w_scalbl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_scalbl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_scalblnf.c b/sysdeps/ia64/fpu/w_scalblnf.c
index 39f55f85b8..631fc9997b 100644
--- a/sysdeps/ia64/fpu/w_scalblnf.c
+++ b/sysdeps/ia64/fpu/w_scalblnf.c
@@ -1,5 +1,5 @@
/* Wrapper for __scalblnf handles setting errno.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/fpu/w_sinh.c b/sysdeps/ia64/fpu/w_sinh.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_sinh.c
+++ b/sysdeps/ia64/fpu/w_sinh.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sinh_compat.c b/sysdeps/ia64/fpu/w_sinh_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_sinh_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sinhf.c b/sysdeps/ia64/fpu/w_sinhf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_sinhf.c
+++ b/sysdeps/ia64/fpu/w_sinhf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sinhf_compat.c b/sysdeps/ia64/fpu/w_sinhf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_sinhf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sinhl.c b/sysdeps/ia64/fpu/w_sinhl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_sinhl.c
+++ b/sysdeps/ia64/fpu/w_sinhl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sinhl_compat.c b/sysdeps/ia64/fpu/w_sinhl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_sinhl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sqrt.c b/sysdeps/ia64/fpu/w_sqrt.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_sqrt.c
+++ b/sysdeps/ia64/fpu/w_sqrt.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sqrt_compat.c b/sysdeps/ia64/fpu/w_sqrt_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_sqrt_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sqrtf.c b/sysdeps/ia64/fpu/w_sqrtf.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_sqrtf.c
+++ b/sysdeps/ia64/fpu/w_sqrtf.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sqrtf_compat.c b/sysdeps/ia64/fpu/w_sqrtf_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_sqrtf_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sqrtl.c b/sysdeps/ia64/fpu/w_sqrtl.c
index 41254ae60a..1cc8931700 100644
--- a/sysdeps/ia64/fpu/w_sqrtl.c
+++ b/sysdeps/ia64/fpu/w_sqrtl.c
@@ -1 +1 @@
-/* Not needed. */
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_sqrtl_compat.c b/sysdeps/ia64/fpu/w_sqrtl_compat.c
new file mode 100644
index 0000000000..41254ae60a
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_sqrtl_compat.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ia64/fpu/w_tgamma.S b/sysdeps/ia64/fpu/w_tgamma.S
deleted file mode 100644
index 867815cf46..0000000000
--- a/sysdeps/ia64/fpu/w_tgamma.S
+++ /dev/null
@@ -1,1835 +0,0 @@
-.file "tgamma.s"
-
-
-// Copyright (c) 2001 - 2005, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2001 by the Intel Numerics Group, Intel Corporation
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// * The name of Intel Corporation may not be used to endorse or promote
-// products derived from this software without specific prior written
-// permission.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING,BUT NOT
-// LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT,INCIDENTAL,SPECIAL,
-// EXEMPLARY,OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA,OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-// OF LIABILITY,WHETHER IN CONTRACT,STRICT LIABILITY OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Intel Corporation is the author of this code,and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://www.intel.com/software/products/opensource/libraries/num.htm.
-//
-//*********************************************************************
-//
-// History:
-// 10/12/01 Initial version
-// 05/20/02 Cleaned up namespace and sf0 syntax
-// 02/10/03 Reordered header: .section, .global, .proc, .align
-// 04/04/03 Changed error codes for overflow and negative integers
-// 04/10/03 Changed code for overflow near zero handling
-// 03/31/05 Reformatted delimiters between data tables
-//
-//*********************************************************************
-//
-//*********************************************************************
-//
-// Function: tgamma(x) computes the principle value of the GAMMA
-// function of x.
-//
-//*********************************************************************
-//
-// Resources Used:
-//
-// Floating-Point Registers: f8-f15
-// f33-f87
-//
-// General Purpose Registers:
-// r8-r11
-// r14-r28
-// r32-r36
-// r37-r40 (Used to pass arguments to error handling routine)
-//
-// Predicate Registers: p6-p15
-//
-//*********************************************************************
-//
-// IEEE Special Conditions:
-//
-// tgamma(+inf) = +inf
-// tgamma(-inf) = QNaN
-// tgamma(+/-0) = +/-inf
-// tgamma(x<0, x - integer) = QNaN
-// tgamma(SNaN) = QNaN
-// tgamma(QNaN) = QNaN
-//
-//*********************************************************************
-//
-// Overview
-//
-// The method consists of three cases.
-//
-// If 2 <= x < OVERFLOW_BOUNDARY use case tgamma_regular;
-// else if 0 < x < 2 use case tgamma_from_0_to_2;
-// else if -(i+1) < x < -i, i = 0...184 use case tgamma_negatives;
-//
-// Case 2 <= x < OVERFLOW_BOUNDARY
-// -------------------------------
-// Here we use algorithm based on the recursive formula
-// GAMMA(x+1) = x*GAMMA(x). For that we subdivide interval
-// [2; OVERFLOW_BOUNDARY] into intervals [16*n; 16*(n+1)] and
-// approximate GAMMA(x) by polynomial of 22th degree on each
-// [16*n; 16*n+1], recursive formula is used to expand GAMMA(x)
-// to [16*n; 16*n+1]. In other words we need to find n, i and r
-// such that x = 16 * n + i + r where n and i are integer numbers
-// and r is fractional part of x. So GAMMA(x) = GAMMA(16*n+i+r) =
-// = (x-1)*(x-2)*...*(x-i)*GAMMA(x-i) =
-// = (x-1)*(x-2)*...*(x-i)*GAMMA(16*n+r) ~
-// ~ (x-1)*(x-2)*...*(x-i)*P22n(r).
-//
-// Step 1: Reduction
-// -----------------
-// N = [x] with truncate
-// r = x - N, note 0 <= r < 1
-//
-// n = N & ~0xF - index of table that contains coefficient of
-// polynomial approximation
-// i = N & 0xF - is used in recursive formula
-//
-//
-// Step 2: Approximation
-// ---------------------
-// We use factorized minimax approximation polynomials
-// P22n(r) = A22*(r^2+C01(n)*R+C00(n))*
-// *(r^2+C11(n)*R+C10(n))*...*(r^2+CA1(n)*R+CA0(n))
-//
-// Step 3: Recursion
-// -----------------
-// In case when i > 0 we need to multiply P22n(r) by product
-// R(i)=(x-1)*(x-2)*...*(x-i). To reduce number of fp-instructions
-// we can calculate R as follow:
-// R(i) = ((x-1)*(x-2))*((x-3)*(x-4))*...*((x-(i-1))*(x-i)) if i is
-// even or R = ((x-1)*(x-2))*((x-3)*(x-4))*...*((x-(i-2))*(x-(i-1)))*
-// *(i-1) if i is odd. In both cases we need to calculate
-// R2(i) = (x^2-3*x+2)*(x^2-7*x+12)*...*(x^2+x+2*j*(2*j-1)) =
-// = (x^2-3*x+2)*(x^2-7*x+12)*...*((x^2+x)+2*j*(2*(j-1)+(1-2*x))) =
-// = (RA+2*(2-RB))*(RA+4*(4-RB))*...*(RA+2*j*(2*(j-1)+RB))
-// where j = 1..[i/2], RA = x^2+x, RB = 1-2*x.
-//
-// Step 4: Reconstruction
-// ----------------------
-// Reconstruction is just simple multiplication i.e.
-// GAMMA(x) = P22n(r)*R(i)
-//
-// Case 0 < x < 2
-// --------------
-// To calculate GAMMA(x) on this interval we do following
-// if 1 <= x < 1.25 than GAMMA(x) = P15(x-1)
-// if 1.25 <= x < 1.5 than GAMMA(x) = P15(x-x_min) where
-// x_min is point of local minimum on [1; 2] interval.
-// if 1.5 <= x < 2.0 than GAMMA(x) = P15(x-1.5)
-// and
-// if 0 < x < 1 than GAMMA(x) = GAMMA(x+1)/x
-//
-// Case -(i+1) < x < -i, i = 0...184
-// ----------------------------------
-// Here we use the fact that GAMMA(-x) = PI/(x*GAMMA(x)*sin(PI*x)) and
-// so we need to calculate GAMMA(x), sin(PI*x)/PI. Calculation of
-// GAMMA(x) is described above.
-//
-// Step 1: Reduction
-// -----------------
-// Note that period of sin(PI*x) is 2 and range reduction for
-// sin(PI*x) is like to range reduction for GAMMA(x)
-// i.e r = x - [x] with exception of cases
-// when r > 0.5 (in such cases r = 1 - (x - [x])).
-//
-// Step 2: Approximation
-// ---------------------
-// To approximate sin(PI*x)/PI = sin(PI*(2*n+r))/PI =
-// = (-1)^n*sin(PI*r)/PI Taylor series is used.
-// sin(PI*r)/PI ~ S21(r).
-//
-// Step 3: Division
-// ----------------
-// To calculate 1/(x*GAMMA(x)*S21(r)) we use frcpa instruction
-// with following Newton-Raphson interations.
-//
-//
-//*********************************************************************
-
-GR_Sig = r8
-GR_TAG = r8
-GR_ad_Data = r9
-GR_SigRqLin = r10
-GR_iSig = r11
-GR_ExpOf1 = r11
-GR_ExpOf8 = r11
-
-
-GR_Sig2 = r14
-GR_Addr_Mask1 = r15
-GR_Sign_Exp = r16
-GR_Tbl_Offs = r17
-GR_Addr_Mask2 = r18
-GR_ad_Co = r19
-GR_Bit2 = r19
-GR_ad_Ce = r20
-GR_ad_Co7 = r21
-GR_NzOvfBound = r21
-GR_ad_Ce7 = r22
-GR_Tbl_Ind = r23
-GR_Tbl_16xInd = r24
-GR_ExpOf025 = r24
-GR_ExpOf05 = r25
-GR_0x30033 = r26
-GR_10 = r26
-GR_12 = r27
-GR_185 = r27
-GR_14 = r28
-GR_2 = r28
-GR_fpsr = r28
-
-GR_SAVE_B0 = r33
-GR_SAVE_PFS = r34
-GR_SAVE_GP = r35
-GR_SAVE_SP = r36
-
-GR_Parameter_X = r37
-GR_Parameter_Y = r38
-GR_Parameter_RESULT = r39
-GR_Parameter_TAG = r40
-
-
-
-FR_X = f10
-FR_Y = f1 // tgamma is single argument function
-FR_RESULT = f8
-
-FR_AbsX = f9
-FR_NormX = f9
-FR_r02 = f11
-FR_AbsXp1 = f12
-FR_X2pX = f13
-FR_1m2X = f14
-FR_Rq1 = f14
-FR_Xt = f15
-
-FR_r = f33
-FR_OvfBound = f34
-FR_Xmin = f35
-FR_2 = f36
-FR_Rcp1 = f36
-FR_Rcp3 = f36
-FR_4 = f37
-FR_5 = f38
-FR_6 = f39
-FR_8 = f40
-FR_10 = f41
-FR_12 = f42
-FR_14 = f43
-FR_GAMMA = f43
-FR_05 = f44
-
-FR_Rq2 = f45
-FR_Rq3 = f46
-FR_Rq4 = f47
-FR_Rq5 = f48
-FR_Rq6 = f49
-FR_Rq7 = f50
-FR_RqLin = f51
-
-FR_InvAn = f52
-
-FR_C01 = f53
-FR_A15 = f53
-FR_C11 = f54
-FR_A14 = f54
-FR_C21 = f55
-FR_A13 = f55
-FR_C31 = f56
-FR_A12 = f56
-FR_C41 = f57
-FR_A11 = f57
-FR_C51 = f58
-FR_A10 = f58
-FR_C61 = f59
-FR_A9 = f59
-FR_C71 = f60
-FR_A8 = f60
-FR_C81 = f61
-FR_A7 = f61
-FR_C91 = f62
-FR_A6 = f62
-FR_CA1 = f63
-FR_A5 = f63
-FR_C00 = f64
-FR_A4 = f64
-FR_rs2 = f64
-FR_C10 = f65
-FR_A3 = f65
-FR_rs3 = f65
-FR_C20 = f66
-FR_A2 = f66
-FR_rs4 = f66
-FR_C30 = f67
-FR_A1 = f67
-FR_rs7 = f67
-FR_C40 = f68
-FR_A0 = f68
-FR_rs8 = f68
-FR_C50 = f69
-FR_r2 = f69
-FR_C60 = f70
-FR_r3 = f70
-FR_C70 = f71
-FR_r4 = f71
-FR_C80 = f72
-FR_r7 = f72
-FR_C90 = f73
-FR_r8 = f73
-FR_CA0 = f74
-FR_An = f75
-
-FR_S21 = f76
-FR_S19 = f77
-FR_Rcp0 = f77
-FR_Rcp2 = f77
-FR_S17 = f78
-FR_S15 = f79
-FR_S13 = f80
-FR_S11 = f81
-FR_S9 = f82
-FR_S7 = f83
-FR_S5 = f84
-FR_S3 = f85
-
-FR_iXt = f86
-FR_rs = f87
-
-
-// Data tables
-//==============================================================
-RODATA
-.align 16
-
-LOCAL_OBJECT_START(tgamma_data)
-data8 0x406573FAE561F648 // overflow boundary (171.624376956302739927196)
-data8 0x3FDD8B618D5AF8FE // point of local minium (0.461632144968362356785)
-//
-//[2; 3]
-data8 0xEF0E85C9AE40ABE2,0x00004000 // C01
-data8 0xCA2049DDB4096DD8,0x00004000 // C11
-data8 0x99A203B4DC2D1A8C,0x00004000 // C21
-data8 0xBF5D9D9C0C295570,0x00003FFF // C31
-data8 0xE8DD037DEB833BAB,0x00003FFD // C41
-data8 0xB6AE39A2A36AA03A,0x0000BFFE // C51
-data8 0x804960DC2850277B,0x0000C000 // C61
-data8 0xD9F3973841C09F80,0x0000C000 // C71
-data8 0x9C198A676F8A2239,0x0000C001 // C81
-data8 0xC98B7DAE02BE3226,0x0000C001 // C91
-data8 0xE9CAF31AC69301BA,0x0000C001 // CA1
-data8 0xFBBDD58608A0D172,0x00004000 // C00
-data8 0xFDD0316D1E078301,0x00004000 // C10
-data8 0x8630B760468C15E4,0x00004001 // C20
-data8 0x93EDE20E47D9152E,0x00004001 // C30
-data8 0xA86F3A38C77D6B19,0x00004001 // C40
-//[16; 17]
-data8 0xF87F757F365EE813,0x00004000 // C01
-data8 0xECA84FBA92759DA4,0x00004000 // C11
-data8 0xD4E0A55E07A8E913,0x00004000 // C21
-data8 0xB0EB45E94C8A5F7B,0x00004000 // C31
-data8 0x8050D6B4F7C8617D,0x00004000 // C41
-data8 0x8471B111AA691E5A,0x00003FFF // C51
-data8 0xADAF462AF96585C9,0x0000BFFC // C61
-data8 0xD327C7A587A8C32B,0x0000BFFF // C71
-data8 0xDEF5192B4CF5E0F1,0x0000C000 // C81
-data8 0xBADD64BB205AEF02,0x0000C001 // C91
-data8 0x9330A24AA67D6860,0x0000C002 // CA1
-data8 0xF57EEAF36D8C47BE,0x00004000 // C00
-data8 0x807092E12A251B38,0x00004001 // C10
-data8 0x8C458F80DEE7ED1C,0x00004001 // C20
-data8 0x9F30C731DC77F1A6,0x00004001 // C30
-data8 0xBAC4E7E099C3A373,0x00004001 // C40
-//[32; 33]
-data8 0xC3059A415F142DEF,0x00004000 // C01
-data8 0xB9C1DAC24664587A,0x00004000 // C11
-data8 0xA7101D910992FFB2,0x00004000 // C21
-data8 0x8A9522B8E4AA0AB4,0x00004000 // C31
-data8 0xC76A271E4BA95DCC,0x00003FFF // C41
-data8 0xC5D6DE2A38DB7FF2,0x00003FFE // C51
-data8 0xDBA42086997818B2,0x0000BFFC // C61
-data8 0xB8EDDB1424C1C996,0x0000BFFF // C71
-data8 0xBF7372FB45524B5D,0x0000C000 // C81
-data8 0xA03DDE759131580A,0x0000C001 // C91
-data8 0xFDA6FC4022C1FFE3,0x0000C001 // CA1
-data8 0x9759ABF797B2533D,0x00004000 // C00
-data8 0x9FA160C6CF18CEC5,0x00004000 // C10
-data8 0xB0EFF1E3530E0FCD,0x00004000 // C20
-data8 0xCCD60D5C470165D1,0x00004000 // C30
-data8 0xF5E53F6307B0B1C1,0x00004000 // C40
-//[48; 49]
-data8 0xAABE577FBCE37F5E,0x00004000 // C01
-data8 0xA274CAEEB5DF7172,0x00004000 // C11
-data8 0x91B90B6646C1B924,0x00004000 // C21
-data8 0xF06718519CA256D9,0x00003FFF // C31
-data8 0xAA9EE181C0E30263,0x00003FFF // C41
-data8 0xA07BDB5325CB28D2,0x00003FFE // C51
-data8 0x86C8B873204F9219,0x0000BFFD // C61
-data8 0xB0192C5D3E4787D6,0x0000BFFF // C71
-data8 0xB1E0A6263D4C19EF,0x0000C000 // C81
-data8 0x93BA32A118EAC9AE,0x0000C001 // C91
-data8 0xE942A39CD9BEE887,0x0000C001 // CA1
-data8 0xE838B0957B0D3D0D,0x00003FFF // C00
-data8 0xF60E0F00074FCF34,0x00003FFF // C10
-data8 0x89869936AE00C2A5,0x00004000 // C20
-data8 0xA0FE4E8AA611207F,0x00004000 // C30
-data8 0xC3B1229CFF1DDAFE,0x00004000 // C40
-//[64; 65]
-data8 0x9C00DDF75CDC6183,0x00004000 // C01
-data8 0x9446AE9C0F6A833E,0x00004000 // C11
-data8 0x84ABC5083310B774,0x00004000 // C21
-data8 0xD9BA3A0977B1ED83,0x00003FFF // C31
-data8 0x989B18C99411D300,0x00003FFF // C41
-data8 0x886E66402318CE6F,0x00003FFE // C51
-data8 0x99028C2468F18F38,0x0000BFFD // C61
-data8 0xAB72D17DCD40CCE1,0x0000BFFF // C71
-data8 0xA9D9AC9BE42C2EF9,0x0000C000 // C81
-data8 0x8C11D983AA177AD2,0x0000C001 // C91
-data8 0xDC779E981C1F0F06,0x0000C001 // CA1
-data8 0xC1FD4AC85965E8D6,0x00003FFF // C00
-data8 0xCE3D2D909D389EC2,0x00003FFF // C10
-data8 0xE7F79980AD06F5D8,0x00003FFF // C20
-data8 0x88DD9F73C8680B5D,0x00004000 // C30
-data8 0xA7D6CB2CB2D46F9D,0x00004000 // C40
-//[80; 81]
-data8 0x91C7FF4E993430D0,0x00004000 // C01
-data8 0x8A6E7AB83E45A7E9,0x00004000 // C11
-data8 0xF72D6382E427BEA9,0x00003FFF // C21
-data8 0xC9E2E4F9B3B23ED6,0x00003FFF // C31
-data8 0x8BEFEF56AE05D775,0x00003FFF // C41
-data8 0xEE9666AB6A185560,0x00003FFD // C51
-data8 0xA6AFAF5CEFAEE04D,0x0000BFFD // C61
-data8 0xA877EAFEF1F9C880,0x0000BFFF // C71
-data8 0xA45BD433048ECA15,0x0000C000 // C81
-data8 0x86BD1636B774CC2E,0x0000C001 // C91
-data8 0xD3721BE006E10823,0x0000C001 // CA1
-data8 0xA97EFABA91854208,0x00003FFF // C00
-data8 0xB4AF0AEBB3F97737,0x00003FFF // C10
-data8 0xCC38241936851B0B,0x00003FFF // C20
-data8 0xF282A6261006EA84,0x00003FFF // C30
-data8 0x95B8E9DB1BD45BAF,0x00004000 // C40
-//[96; 97]
-data8 0x8A1FA3171B35A106,0x00004000 // C01
-data8 0x830D5B8843890F21,0x00004000 // C11
-data8 0xE98B0F1616677A23,0x00003FFF // C21
-data8 0xBDF8347F5F67D4EC,0x00003FFF // C31
-data8 0x825F15DE34EC055D,0x00003FFF // C41
-data8 0xD4846186B8AAC7BE,0x00003FFD // C51
-data8 0xB161093AB14919B1,0x0000BFFD // C61
-data8 0xA65758EEA4800EF4,0x0000BFFF // C71
-data8 0xA046B67536FA329C,0x0000C000 // C81
-data8 0x82BBEC1BCB9E9068,0x0000C001 // C91
-data8 0xCC9DE2B23BA91B0B,0x0000C001 // CA1
-data8 0x983B16148AF77F94,0x00003FFF // C00
-data8 0xA2A4D8EE90FEE5DD,0x00003FFF // C10
-data8 0xB89446FA37FF481C,0x00003FFF // C20
-data8 0xDC5572648485FB01,0x00003FFF // C30
-data8 0x88CD5D7DB976129A,0x00004000 // C40
-//[112; 113]
-data8 0x8417098FD62AC5E3,0x00004000 // C01
-data8 0xFA7896486B779CBB,0x00003FFF // C11
-data8 0xDEC98B14AF5EEBD1,0x00003FFF // C21
-data8 0xB48E153C6BF0B5A3,0x00003FFF // C31
-data8 0xF597B038BC957582,0x00003FFE // C41
-data8 0xBFC6F0884A415694,0x00003FFD // C51
-data8 0xBA075A1392BDB5E5,0x0000BFFD // C61
-data8 0xA4B79E01B44C7DB4,0x0000BFFF // C71
-data8 0x9D12FA7711BFAB0F,0x0000C000 // C81
-data8 0xFF24C47C8E108AB4,0x0000C000 // C91
-data8 0xC7325EC86562606A,0x0000C001 // CA1
-data8 0x8B47DCD9E1610938,0x00003FFF // C00
-data8 0x9518B111B70F88B8,0x00003FFF // C10
-data8 0xA9CC197206F68682,0x00003FFF // C20
-data8 0xCB98294CC0D7A6A6,0x00003FFF // C30
-data8 0xFE09493EA9165181,0x00003FFF // C40
-//[128; 129]
-data8 0xFE53D03442270D90,0x00003FFF // C01
-data8 0xF0F857BAEC1993E4,0x00003FFF // C11
-data8 0xD5FF6D70DBBC2FD3,0x00003FFF // C21
-data8 0xACDAA5F4988B1074,0x00003FFF // C31
-data8 0xE92E069F8AD75B54,0x00003FFE // C41
-data8 0xAEBB64645BD94234,0x00003FFD // C51
-data8 0xC13746249F39B43C,0x0000BFFD // C61
-data8 0xA36B74F5B6297A1F,0x0000BFFF // C71
-data8 0x9A77860DF180F6E5,0x0000C000 // C81
-data8 0xF9F8457D84410A0C,0x0000C000 // C91
-data8 0xC2BF44C649EB8597,0x0000C001 // CA1
-data8 0x81225E7489BCDC0E,0x00003FFF // C00
-data8 0x8A788A09CE0EED11,0x00003FFF // C10
-data8 0x9E2E6F86D1B1D89C,0x00003FFF // C20
-data8 0xBE6866B21CF6CCB5,0x00003FFF // C30
-data8 0xEE94426EC1486AAE,0x00003FFF // C40
-//[144; 145]
-data8 0xF6113E09732A6497,0x00003FFF // C01
-data8 0xE900D45931B04FC8,0x00003FFF // C11
-data8 0xCE9FD58F745EBA5D,0x00003FFF // C21
-data8 0xA663A9636C864C86,0x00003FFF // C31
-data8 0xDEBF5315896CE629,0x00003FFE // C41
-data8 0xA05FEA415EBD7737,0x00003FFD // C51
-data8 0xC750F112BD9C4031,0x0000BFFD // C61
-data8 0xA2593A35C51C6F6C,0x0000BFFF // C71
-data8 0x9848E1DA7FB40C8C,0x0000C000 // C81
-data8 0xF59FEE87A5759A4B,0x0000C000 // C91
-data8 0xBF00203909E45A1D,0x0000C001 // CA1
-data8 0xF1D8E157200127E5,0x00003FFE // C00
-data8 0x81DD5397CB08D487,0x00003FFF // C10
-data8 0x94C1DC271A8B766F,0x00003FFF // C20
-data8 0xB3AFAF9B5D6EDDCF,0x00003FFF // C30
-data8 0xE1FB4C57CA81BE1E,0x00003FFF // C40
-//[160; 161]
-data8 0xEEFFE5122AC72FFD,0x00003FFF // C01
-data8 0xE22F70BB52AD54B3,0x00003FFF // C11
-data8 0xC84FF021FE993EEA,0x00003FFF // C21
-data8 0xA0DA2208EB5B2752,0x00003FFF // C31
-data8 0xD5CDD2FCF8AD2DF5,0x00003FFE // C41
-data8 0x940BEC6DCD811A59,0x00003FFD // C51
-data8 0xCC954EF4FD4EBB81,0x0000BFFD // C61
-data8 0xA1712E29A8C04554,0x0000BFFF // C71
-data8 0x966B55DFB243521A,0x0000C000 // C81
-data8 0xF1E6A2B9CEDD0C4C,0x0000C000 // C91
-data8 0xBBC87BCC031012DB,0x0000C001 // CA1
-data8 0xE43974E6D2818583,0x00003FFE // C00
-data8 0xF5702A516B64C5B7,0x00003FFE // C10
-data8 0x8CEBCB1B32E19471,0x00003FFF // C20
-data8 0xAAC10F05BB77E0AF,0x00003FFF // C30
-data8 0xD776EFCAB205CC58,0x00003FFF // C40
-//[176; 177]
-data8 0xE8DA614119811E5D,0x00003FFF // C01
-data8 0xDC415E0288B223D8,0x00003FFF // C11
-data8 0xC2D2243E44EC970E,0x00003FFF // C21
-data8 0x9C086664B5307BEA,0x00003FFF // C31
-data8 0xCE03D7A08B461156,0x00003FFE // C41
-data8 0x894BE3BAAAB66ADC,0x00003FFD // C51
-data8 0xD131EDD71A702D4D,0x0000BFFD // C61
-data8 0xA0A907CDDBE10898,0x0000BFFF // C71
-data8 0x94CC3CD9C765C808,0x0000C000 // C81
-data8 0xEEA85F237815FC0D,0x0000C000 // C91
-data8 0xB8FA04B023E43F91,0x0000C001 // CA1
-data8 0xD8B2C7D9FCBD7EF9,0x00003FFE // C00
-data8 0xE9566E93AAE7E38F,0x00003FFE // C10
-data8 0x8646E78AABEF0255,0x00003FFF // C20
-data8 0xA32AEDB62E304345,0x00003FFF // C30
-data8 0xCE83E40280EE7DF0,0x00003FFF // C40
-//
-//[2; 3]
-data8 0xC44FB47E90584083,0x00004001 // C50
-data8 0xE863EE77E1C45981,0x00004001 // C60
-data8 0x8AC15BE238B9D70E,0x00004002 // C70
-data8 0xA5D94B6592350EF4,0x00004002 // C80
-data8 0xC379DB3E20A148B3,0x00004002 // C90
-data8 0xDACA49B73974F6C9,0x00004002 // CA0
-data8 0x810E496A1AFEC895,0x00003FE1 // An
-//[16; 17]
-data8 0xE17C0357AAF3F817,0x00004001 // C50
-data8 0x8BA8804750FBFBFE,0x00004002 // C60
-data8 0xB18EAB3CB64BEBEE,0x00004002 // C70
-data8 0xE90AB7015AF1C28F,0x00004002 // C80
-data8 0xA0AB97CE9E259196,0x00004003 // C90
-data8 0xF5E0E0A000C2D720,0x00004003 // CA0
-data8 0xD97F0F87EC791954,0x00004005 // An
-//[32; 33]
-data8 0x980C293F3696040D,0x00004001 // C50
-data8 0xC0DBFFBB948A9A4E,0x00004001 // C60
-data8 0xFAB54625E9A588A2,0x00004001 // C70
-data8 0xA7E08176D6050FBF,0x00004002 // C80
-data8 0xEBAAEC4952270A9F,0x00004002 // C90
-data8 0xB7479CDAD20550FE,0x00004003 // CA0
-data8 0xAACD45931C3FF634,0x00004054 // An
-//[48; 49]
-data8 0xF5180F0000419AD5,0x00004000 // C50
-data8 0x9D507D07BFBB2273,0x00004001 // C60
-data8 0xCEB53F7A13A383E3,0x00004001 // C70
-data8 0x8BAFEF9E0A49128F,0x00004002 // C80
-data8 0xC58EF912D39E228C,0x00004002 // C90
-data8 0x9A88118422BA208E,0x00004003 // CA0
-data8 0xBD6C0E2477EC12CB,0x000040AC // An
-//[64; 65]
-data8 0xD410AC48BF7748DA,0x00004000 // C50
-data8 0x89399B90AFEBD931,0x00004001 // C60
-data8 0xB596DF8F77EB8560,0x00004001 // C70
-data8 0xF6D9445A047FB4A6,0x00004001 // C80
-data8 0xAF52F0DD65221357,0x00004002 // C90
-data8 0x8989B45BFC881989,0x00004003 // CA0
-data8 0xB7FCAE86E6E10D5A,0x0000410B // An
-//[80; 81]
-data8 0xBE759740E3B5AA84,0x00004000 // C50
-data8 0xF8037B1B07D27609,0x00004000 // C60
-data8 0xA4F6F6C7F0977D4F,0x00004001 // C70
-data8 0xE131960233BF02C4,0x00004001 // C80
-data8 0xA06DF43D3922BBE2,0x00004002 // C90
-data8 0xFC266AB27255A360,0x00004002 // CA0
-data8 0xD9F4B012EDAFEF2F,0x0000416F // An
-//[96; 97]
-data8 0xAEFC84CDA8E1EAA6,0x00004000 // C50
-data8 0xE5009110DB5F3C8A,0x00004000 // C60
-data8 0x98F5F48738E7B232,0x00004001 // C70
-data8 0xD17EE64E21FFDC6B,0x00004001 // C80
-data8 0x9596F7A7E36145CC,0x00004002 // C90
-data8 0xEB64DBE50E125CAF,0x00004002 // CA0
-data8 0xA090530D79E32D2E,0x000041D8 // An
-//[112; 113]
-data8 0xA33AEA22A16B2655,0x00004000 // C50
-data8 0xD682B93BD7D7945C,0x00004000 // C60
-data8 0x8FC854C6E6E30CC3,0x00004001 // C70
-data8 0xC5754D828AFFDC7A,0x00004001 // C80
-data8 0x8D41216B397139C2,0x00004002 // C90
-data8 0xDE78D746848116E5,0x00004002 // CA0
-data8 0xB8A297A2DC0630DB,0x00004244 // An
-//[128; 129]
-data8 0x99EB00F11D95E292,0x00004000 // C50
-data8 0xCB005CB911EB779A,0x00004000 // C60
-data8 0x8879AA2FDFF3A37A,0x00004001 // C70
-data8 0xBBDA538AD40CAC2C,0x00004001 // C80
-data8 0x8696D849D311B9DE,0x00004002 // C90
-data8 0xD41E1C041481199F,0x00004002 // CA0
-data8 0xEBA1A43D34EE61EE,0x000042B3 // An
-//[144; 145]
-data8 0x924F822578AA9F3D,0x00004000 // C50
-data8 0xC193FAF9D3B36960,0x00004000 // C60
-data8 0x827AE3A6B68ED0CA,0x00004001 // C70
-data8 0xB3F52A27EED23F0B,0x00004001 // C80
-data8 0x811A079FB3C94D79,0x00004002 // C90
-data8 0xCB94415470B6F8D2,0x00004002 // CA0
-data8 0x80A0260DCB3EC9AC,0x00004326 // An
-//[160; 161]
-data8 0x8BF24091E88B331D,0x00004000 // C50
-data8 0xB9ADE01187E65201,0x00004000 // C60
-data8 0xFAE4508F6E7625FE,0x00004000 // C70
-data8 0xAD516668AD6D7367,0x00004001 // C80
-data8 0xF8F5FF171154F637,0x00004001 // C90
-data8 0xC461321268990C82,0x00004002 // CA0
-data8 0xC3B693F344B0E6FE,0x0000439A // An
-//
-//[176; 177]
-data8 0x868545EB42A258ED,0x00004000 // C50
-data8 0xB2EF04ACE8BA0E6E,0x00004000 // C60
-data8 0xF247D22C22E69230,0x00004000 // C70
-data8 0xA7A1AB93E3981A90,0x00004001 // C80
-data8 0xF10951733E2C697F,0x00004001 // C90
-data8 0xBE3359BFAD128322,0x00004002 // CA0
-data8 0x8000000000000000,0x00003fff
-//
-//[160; 161] for negatives
-data8 0xA76DBD55B2E32D71,0x00003C63 // 1/An
-//
-// sin(pi*x)/pi
-data8 0xBCBC4342112F52A2,0x00003FDE // S21
-data8 0xFAFCECB86536F655,0x0000BFE3 // S19
-data8 0x87E4C97F9CF09B92,0x00003FE9 // S17
-data8 0xEA124C68E704C5CB,0x0000BFED // S15
-data8 0x9BA38CFD59C8AA1D,0x00003FF2 // S13
-data8 0x99C0B552303D5B21,0x0000BFF6 // S11
-//
-//[176; 177] for negatives
-data8 0xBA5D5869211696FF,0x00003BEC // 1/An
-//
-// sin(pi*x)/pi
-data8 0xD63402E79A853175,0x00003FF9 // S9
-data8 0xC354723906DB36BA,0x0000BFFC // S7
-data8 0xCFCE5A015E236291,0x00003FFE // S5
-data8 0xD28D3312983E9918,0x0000BFFF // S3
-//
-//
-// [1.0;1.25]
-data8 0xA405530B067ECD3C,0x0000BFFC // A15
-data8 0xF5B5413F95E1C282,0x00003FFD // A14
-data8 0xC4DED71C782F76C8,0x0000BFFE // A13
-data8 0xECF7DDDFD27C9223,0x00003FFE // A12
-data8 0xFB73D31793068463,0x0000BFFE // A11
-data8 0xFF173B7E66FD1D61,0x00003FFE // A10
-data8 0xFFA5EF3959089E94,0x0000BFFE // A9
-data8 0xFF8153BD42E71A4F,0x00003FFE // A8
-data8 0xFEF9CAEE2CB5B533,0x0000BFFE // A7
-data8 0xFE3F02E5EDB6811E,0x00003FFE // A6
-data8 0xFB64074CED2658FB,0x0000BFFE // A5
-data8 0xFB52882A095B18A4,0x00003FFE // A4
-data8 0xE8508C7990A0DAC0,0x0000BFFE // A3
-data8 0xFD32C611D8A881D0,0x00003FFE // A2
-data8 0x93C467E37DB0C536,0x0000BFFE // A1
-data8 0x8000000000000000,0x00003FFF // A0
-//
-// [1.25;1.5]
-data8 0xD038092400619677,0x0000BFF7 // A15
-data8 0xEA6DE925E6EB8C8F,0x00003FF3 // A14
-data8 0xC53F83645D4597FC,0x0000BFF7 // A13
-data8 0xE366DB2FB27B7ECD,0x00003FF7 // A12
-data8 0xAC8FD5E11F6EEAD8,0x0000BFF8 // A11
-data8 0xFB14010FB3697785,0x00003FF8 // A10
-data8 0xB6F91CB5C371177B,0x0000BFF9 // A9
-data8 0x85A262C6F8FEEF71,0x00003FFA // A8
-data8 0xC038E6E3261568F9,0x0000BFFA // A7
-data8 0x8F4BDE8883232364,0x00003FFB // A6
-data8 0xBCFBBD5786537E9A,0x0000BFFB // A5
-data8 0xA4C08BAF0A559479,0x00003FFC // A4
-data8 0x85D74FA063E81476,0x0000BFFC // A3
-data8 0xDB629FB9BBDC1C4E,0x00003FFD // A2
-data8 0xF4F8FBC7C0C9D317,0x00003FC6 // A1
-data8 0xE2B6E4153A57746C,0x00003FFE // A0
-//
-// [1.25;1.5]
-data8 0x9533F9D3723B448C,0x0000BFF2 // A15
-data8 0xF1F75D3C561CBBAF,0x00003FF5 // A14
-data8 0xBA55A9A1FC883523,0x0000BFF8 // A13
-data8 0xB5D5E9E5104FA995,0x00003FFA // A12
-data8 0xFD84F35B70CD9AE2,0x0000BFFB // A11
-data8 0x87445235F4688CC5,0x00003FFD // A10
-data8 0xE7F236EBFB9F774E,0x0000BFFD // A9
-data8 0xA6605F2721F787CE,0x00003FFE // A8
-data8 0xCF579312AD7EAD72,0x0000BFFE // A7
-data8 0xE96254A2407A5EAC,0x00003FFE // A6
-data8 0xF41312A8572ED346,0x0000BFFE // A5
-data8 0xF9535027C1B1F795,0x00003FFE // A4
-data8 0xE7E82D0C613A8DE4,0x0000BFFE // A3
-data8 0xFD23CD9741B460B8,0x00003FFE // A2
-data8 0x93C30FD9781DBA88,0x0000BFFE // A1
-data8 0xFFFFF1781FDBEE84,0x00003FFE // A0
-LOCAL_OBJECT_END(tgamma_data)
-
-
-//==============================================================
-// Code
-//==============================================================
-
-.section .text
-GLOBAL_LIBM_ENTRY(tgamma)
-{ .mfi
- getf.exp GR_Sign_Exp = f8
- fma.s1 FR_1m2X = f8,f1,f8 // 2x
- addl GR_ad_Data = @ltoff(tgamma_data), gp
-}
-{ .mfi
- mov GR_ExpOf8 = 0x10002 // 8
- fcvt.fx.trunc.s1 FR_iXt = f8 // [x]
- mov GR_ExpOf05 = 0xFFFE // 0.5
-};;
-{ .mfi
- getf.sig GR_Sig = f8
- fma.s1 FR_2 = f1,f1,f1 // 2
- mov GR_Addr_Mask1 = 0x780
-}
-{ .mlx
- setf.exp FR_8 = GR_ExpOf8
- movl GR_10 = 0x4024000000000000
-};;
-{ .mfi
- ld8 GR_ad_Data = [GR_ad_Data]
- fcmp.lt.s1 p14,p15 = f8,f0
- tbit.z p12,p13 = GR_Sign_Exp,0x10 // p13 if x >= 2
-}
-{ .mlx
- and GR_Bit2 = 4,GR_Sign_Exp
- movl GR_12 = 0x4028000000000000
-};;
-{ .mfi
- setf.d FR_10 = GR_10
- fma.s1 FR_r02 = f8,f1,f0
- extr.u GR_Tbl_Offs = GR_Sig,58,6
-}
-{ .mfi
-(p12) mov GR_Addr_Mask1 = r0
- fma.s1 FR_NormX = f8,f1,f0
- cmp.ne p8,p0 = GR_Bit2,r0
-};;
-{ .mfi
-(p8) shladd GR_Tbl_Offs = GR_Tbl_Offs,4,r0
- fclass.m p10,p0 = f8,0x1E7 // Test x for NaTVal, NaN, +/-0, +/-INF
- tbit.nz p11,p0 = GR_Sign_Exp,1
-}
-{ .mlx
- add GR_Addr_Mask2 = GR_Addr_Mask1,GR_Addr_Mask1
- movl GR_14 = 0x402C000000000000
-};;
-.pred.rel "mutex",p14,p15
-{ .mfi
- setf.d FR_12 = GR_12
-(p14) fma.s1 FR_1m2X = f1,f1,FR_1m2X // RB=1-2|x|
- tbit.nz p8,p9 = GR_Sign_Exp,0
-}
-{ .mfi
- ldfpd FR_OvfBound,FR_Xmin = [GR_ad_Data],16
-(p15) fms.s1 FR_1m2X = f1,f1,FR_1m2X // RB=1-2|x|
-(p11) shladd GR_Tbl_Offs = GR_Tbl_Offs,2,r0
-};;
-.pred.rel "mutex",p9,p8
-{ .mfi
- setf.d FR_14 = GR_14
- fma.s1 FR_4 = FR_2,FR_2,f0
-(p8) and GR_Tbl_Offs = GR_Tbl_Offs, GR_Addr_Mask1
-}
-{ .mfi
- setf.exp FR_05 = GR_ExpOf05
- fma.s1 FR_6 = FR_2,FR_2,FR_2
-(p9) and GR_Tbl_Offs = GR_Tbl_Offs, GR_Addr_Mask2
-};;
-.pred.rel "mutex",p9,p8
-{ .mfi
-(p8) shladd GR_ad_Co = GR_Tbl_Offs,1,GR_ad_Data
- fcvt.xf FR_Xt = FR_iXt // [x]
-(p15) tbit.z.unc p11,p0 = GR_Sign_Exp,0x10 // p11 if 0 < x < 2
-}
-{ .mfi
-(p9) add GR_ad_Co = GR_ad_Data,GR_Tbl_Offs
- fma.s1 FR_5 = FR_2,FR_2,f1
-(p15) cmp.lt.unc p7,p6 = GR_ExpOf05,GR_Sign_Exp // p7 if 0 < x < 1
-};;
-{ .mfi
- add GR_ad_Ce = 16,GR_ad_Co
-(p11) frcpa.s1 FR_Rcp0,p0 = f1,f8
- sub GR_Tbl_Offs = GR_ad_Co,GR_ad_Data
-}
-{ .mfb
- ldfe FR_C01 = [GR_ad_Co],32
-(p7) fms.s1 FR_r02 = FR_r02,f1,f1
- // jump if x is NaTVal, NaN, +/-0, +/-INF
-(p10) br.cond.spnt tgamma_spec
-};;
-.pred.rel "mutex",p14,p15
-{ .mfi
- ldfe FR_C11 = [GR_ad_Ce],32
-(p14) fms.s1 FR_X2pX = f8,f8,f8 // RA=x^2+|x|
- shr GR_Tbl_Ind = GR_Tbl_Offs,8
-}
-{ .mfb
- ldfe FR_C21 = [GR_ad_Co],32
-(p15) fma.s1 FR_X2pX = f8,f8,f8 // RA=x^2+x
- // jump if 0 < x < 2
-(p11) br.cond.spnt tgamma_from_0_to_2
-};;
-{ .mfi
- ldfe FR_C31 = [GR_ad_Ce],32
- fma.s1 FR_Rq2 = FR_2,f1,FR_1m2X // 2 + B
- cmp.ltu p7,p0=0xB,GR_Tbl_Ind
-}
-{ .mfb
- ldfe FR_C41 = [GR_ad_Co],32
- fma.s1 FR_Rq3 = FR_2,FR_2,FR_1m2X // 4 + B
- // jump if GR_Tbl_Ind > 11, i.e |x| is more than 192
-(p7) br.cond.spnt tgamma_spec_res
-};;
-{ .mfi
- ldfe FR_C51 = [GR_ad_Ce],32
- fma.s1 FR_Rq4 = FR_6,f1,FR_1m2X // 6 + B
- shr GR_Tbl_Offs = GR_Tbl_Offs,1
-}
-{ .mfi
- ldfe FR_C61 = [GR_ad_Co],32
- fma.s1 FR_Rq5 = FR_4,FR_2,FR_1m2X // 8 + B
- nop.i 0
-};;
-{ .mfi
- ldfe FR_C71 = [GR_ad_Ce],32
-(p14) fms.s1 FR_r = FR_Xt,f1,f8 // r = |x| - [|x|]
- shr GR_Tbl_16xInd = GR_Tbl_Offs,3
-}
-{ .mfi
- ldfe FR_C81 = [GR_ad_Co],32
-(p15) fms.s1 FR_r = f8,f1,FR_Xt // r = x - [x]
- add GR_ad_Data = 0xC00,GR_ad_Data
-};;
-{ .mfi
- ldfe FR_C91 = [GR_ad_Ce],32
- fma.s1 FR_Rq6 = FR_5,FR_2,FR_1m2X // 10 + B
-(p14) mov GR_0x30033 = 0x30033
-}
-{ .mfi
- ldfe FR_CA1 = [GR_ad_Co],32
- fma.s1 FR_Rq7 = FR_6,FR_2,FR_1m2X // 12 + B
- sub GR_Tbl_Offs = GR_Tbl_Offs,GR_Tbl_16xInd
-};;
-{ .mfi
- ldfe FR_C00 = [GR_ad_Ce],32
- fma.s1 FR_Rq1 = FR_Rq1,FR_2,FR_X2pX // (x-1)*(x-2)
-(p13) cmp.eq.unc p8,p0 = r0,GR_Tbl_16xInd // index is 0 i.e. arg from [2;16)
-}
-{ .mfi
- ldfe FR_C10 = [GR_ad_Co],32
-(p14) fms.s1 FR_AbsX = f0,f0,FR_NormX // absolute value of argument
- add GR_ad_Co7 = GR_ad_Data,GR_Tbl_Offs
-};;
-{ .mfi
- ldfe FR_C20 = [GR_ad_Ce],32
- fma.s1 FR_Rq2 = FR_Rq2,FR_4,FR_X2pX // (x-3)*(x-4)
- add GR_ad_Ce7 = 16,GR_ad_Co7
-}
-{ .mfi
- ldfe FR_C30 = [GR_ad_Co],32
- fma.s1 FR_Rq3 = FR_Rq3,FR_6,FR_X2pX // (x-5)*(x-6)
- nop.i 0
-};;
-{ .mfi
- ldfe FR_C40 = [GR_ad_Ce],32
- fma.s1 FR_Rq4 = FR_Rq4,FR_8,FR_X2pX // (x-7)*(x-8)
-(p14) cmp.leu.unc p7,p0 = GR_0x30033,GR_Sign_Exp
-}
-{ .mfb
- ldfe FR_C50 = [GR_ad_Co7],32
- fma.s1 FR_Rq5 = FR_Rq5,FR_10,FR_X2pX // (x-9)*(x-10)
- // jump if x is less or equal to -2^52, i.e. x is big negative integer
-(p7) br.cond.spnt tgamma_singularity
-};;
-{ .mfi
- ldfe FR_C60 = [GR_ad_Ce7],32
- fma.s1 FR_C01 = FR_C01,f1,FR_r
- add GR_ad_Ce = 0x560,GR_ad_Data
-}
-{ .mfi
- ldfe FR_C70 = [GR_ad_Co7],32
- fma.s1 FR_rs = f0,f0,FR_r // reduced arg for sin(pi*x)
- add GR_ad_Co = 0x550,GR_ad_Data
-};;
-{ .mfi
- ldfe FR_C80 = [GR_ad_Ce7],32
- fma.s1 FR_C11 = FR_C11,f1,FR_r
- nop.i 0
-}
-{ .mfi
- ldfe FR_C90 = [GR_ad_Co7],32
- fma.s1 FR_C21 = FR_C21,f1,FR_r
- nop.i 0
-};;
-.pred.rel "mutex",p12,p13
-{ .mfi
-(p13) getf.sig GR_iSig = FR_iXt
- fcmp.lt.s1 p11,p0 = FR_05,FR_r
- mov GR_185 = 185
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_Rq6 = FR_Rq6,FR_12,FR_X2pX // (x-11)*(x-12)
- nop.i 0
-};;
-{ .mfi
- ldfe FR_CA0 = [GR_ad_Ce7],32
- fma.s1 FR_C31 = FR_C31,f1,FR_r
-(p12) mov GR_iSig = 0
-}
-{ .mfi
- ldfe FR_An = [GR_ad_Co7],0x80
- fma.s1 FR_C41 = FR_C41,f1,FR_r
- nop.i 0
-};;
-{ .mfi
-(p14) getf.sig GR_Sig = FR_r
- fma.s1 FR_C51 = FR_C51,f1,FR_r
-(p14) sub GR_iSig = r0,GR_iSig
-}
-{ .mfi
- ldfe FR_S21 = [GR_ad_Co],32
- fma.s1 FR_C61 = FR_C61,f1,FR_r
- nop.i 0
-};;
-{ .mfi
- ldfe FR_S19 = [GR_ad_Ce],32
- fma.s1 FR_C71 = FR_C71,f1,FR_r
- and GR_SigRqLin = 0xF,GR_iSig
-}
-{ .mfi
- ldfe FR_S17 = [GR_ad_Co],32
- fma.s1 FR_C81 = FR_C81,f1,FR_r
- mov GR_2 = 2
-};;
-{ .mfi
-(p14) ldfe FR_InvAn = [GR_ad_Co7]
- fma.s1 FR_C91 = FR_C91,f1,FR_r
- // if significand of r is 0 tnan argument is negative integer
-(p14) cmp.eq.unc p12,p0 = r0,GR_Sig
-}
-{ .mfb
-(p8) sub GR_SigRqLin = GR_SigRqLin,GR_2 // subtract 2 if 2 <= x < 16
- fma.s1 FR_CA1 = FR_CA1,f1,FR_r
- // jump if x is negative integer such that -2^52 < x < -185
-(p12) br.cond.spnt tgamma_singularity
-};;
-{ .mfi
- setf.sig FR_Xt = GR_SigRqLin
-(p11) fms.s1 FR_rs = f1,f1,FR_r
-(p14) cmp.ltu.unc p7,p0 = GR_185,GR_iSig
-}
-{ .mfb
- ldfe FR_S15 = [GR_ad_Ce],32
- fma.s1 FR_Rq7 = FR_Rq7,FR_14,FR_X2pX // (x-13)*(x-14)
- // jump if x is noninteger such that -2^52 < x < -185
-(p7) br.cond.spnt tgamma_underflow
-};;
-{ .mfi
- ldfe FR_S13 = [GR_ad_Co],48
- fma.s1 FR_C01 = FR_C01,FR_r,FR_C00
- and GR_Sig2 = 0xE,GR_SigRqLin
-}
-{ .mfi
- ldfe FR_S11 = [GR_ad_Ce],48
- fma.s1 FR_C11 = FR_C11,FR_r,FR_C10
- nop.i 0
-};;
-{ .mfi
- ldfe FR_S9 = [GR_ad_Co],32
- fma.s1 FR_C21 = FR_C21,FR_r,FR_C20
- // should we mul by polynomial of recursion?
- cmp.eq p13,p12 = r0,GR_SigRqLin
-}
-{ .mfi
- ldfe FR_S7 = [GR_ad_Ce],32
- fma.s1 FR_C31 = FR_C31,FR_r,FR_C30
- nop.i 0
-};;
-{ .mfi
- ldfe FR_S5 = [GR_ad_Co],32
- fma.s1 FR_C41 = FR_C41,FR_r,FR_C40
- nop.i 0
-}
-{ .mfi
- ldfe FR_S3 = [GR_ad_Ce],32
- fma.s1 FR_C51 = FR_C51,FR_r,FR_C50
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C61 = FR_C61,FR_r,FR_C60
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_C71 = FR_C71,FR_r,FR_C70
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C81 = FR_C81,FR_r,FR_C80
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_C91 = FR_C91,FR_r,FR_C90
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_CA1 = FR_CA1,FR_r,FR_CA0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_C01 = FR_C01,FR_C11,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C21 = FR_C21,FR_C31,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_rs2 = FR_rs,FR_rs,f0
-(p12) cmp.lt.unc p7,p0 = 2,GR_Sig2 // should mul by FR_Rq2?
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C41 = FR_C41,FR_C51,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p7) fma.s1 FR_Rq1 = FR_Rq1,FR_Rq2,f0
-(p12) cmp.lt.unc p9,p0 = 6,GR_Sig2 // should mul by FR_Rq4?
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C61 = FR_C61,FR_C71,f0
-(p15) cmp.eq p11,p0 = r0,r0
-}
-{ .mfi
- nop.m 0
-(p9) fma.s1 FR_Rq3 = FR_Rq3,FR_Rq4,f0
-(p12) cmp.lt.unc p8,p0 = 10,GR_Sig2 // should mul by FR_Rq6?
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C81 = FR_C81,FR_C91,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p8) fma.s1 FR_Rq5 = FR_Rq5,FR_Rq6,f0
-(p14) cmp.ltu p0,p11 = 0x9,GR_Tbl_Ind
-};;
-{ .mfi
- nop.m 0
- fcvt.xf FR_RqLin = FR_Xt
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p11) fma.s1 FR_CA1 = FR_CA1,FR_An,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_S21 = FR_S21,FR_rs2,FR_S19
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_S17 = FR_S17,FR_rs2,FR_S15
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C01 = FR_C01,FR_C21,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_rs4 = FR_rs2,FR_rs2,f0
-(p12) cmp.lt.unc p8,p0 = 4,GR_Sig2 // should mul by FR_Rq3?
-};;
-{ .mfi
- nop.m 0
-(p8) fma.s1 FR_Rq1 = FR_Rq1,FR_Rq3,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_S13 = FR_S13,FR_rs2,FR_S11
-(p12) cmp.lt.unc p9,p0 = 12,GR_Sig2 // should mul by FR_Rq7?
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C41 = FR_C41,FR_C61,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p9) fma.s1 FR_Rq5 = FR_Rq5,FR_Rq7,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C81 = FR_C81,FR_CA1,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_S9 = FR_S9,FR_rs2,FR_S7
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_S5 = FR_S5,FR_rs2,FR_S3
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_rs3 = FR_rs2,FR_rs,f0
-(p12) tbit.nz.unc p6,p0 = GR_SigRqLin,0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_rs8 = FR_rs4,FR_rs4,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_S21 = FR_S21,FR_rs4,FR_S17
- mov GR_ExpOf1 = 0x2FFFF
-}
-{ .mfi
- nop.m 0
-(p6) fms.s1 FR_RqLin = FR_AbsX,f1,FR_RqLin
-(p12) cmp.lt.unc p8,p0 = 8,GR_Sig2 // should mul by FR_Rq5?
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C01 = FR_C01,FR_C41,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p8) fma.s1 FR_Rq1 = FR_Rq1,FR_Rq5,f0
-(p14) cmp.gtu.unc p7,p0 = GR_Sign_Exp,GR_ExpOf1
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_S13 = FR_S13,FR_rs4,FR_S9
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p7) fma.s1 FR_C81 = FR_C81,FR_AbsX,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_AbsXp1 = f1,f1,FR_AbsX // |x|+1
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fcmp.lt.unc.s1 p0,p10 = FR_AbsX,FR_OvfBound // x >= overflow_boundary
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_rs7 = FR_rs4,FR_rs3,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_S5 = FR_S5,FR_rs3,FR_rs
- nop.i 0
-};;
-{ .mib
-(p14) cmp.lt p13,p0 = r0,r0 // set p13 to 0 if x < 0
-(p12) cmp.eq.unc p8,p9 = 1,GR_SigRqLin
-(p10) br.cond.spnt tgamma_spec_res
-};;
-{ .mfi
- getf.sig GR_Sig = FR_iXt
-(p6) fma.s1 FR_Rq1 = FR_Rq1,FR_RqLin,f0
- // should we mul by polynomial of recursion?
-(p15) cmp.eq.unc p0,p11 = r0,GR_SigRqLin
-}
-{ .mfb
- nop.m 0
- fma.s1 FR_GAMMA = FR_C01,FR_C81,f0
-(p11) br.cond.spnt tgamma_positives
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_S21 = FR_S21,FR_rs8,FR_S13
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p13) fma.d.s0 f8 = FR_C01,FR_C81,f0
-(p13) br.ret.spnt b0
-};;
-.pred.rel "mutex",p8,p9
-{ .mfi
- nop.m 0
-(p9) fma.s1 FR_GAMMA = FR_GAMMA,FR_Rq1,f0
- tbit.z p6,p7 = GR_Sig,0 // p6 if sin<0, p7 if sin>0
-}
-{ .mfi
- nop.m 0
-(p8) fma.s1 FR_GAMMA = FR_GAMMA,FR_RqLin,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_S21 = FR_S21,FR_rs7,FR_S5
- nop.i 0
-};;
-.pred.rel "mutex",p6,p7
-{ .mfi
- nop.m 0
-(p6) fnma.s1 FR_GAMMA = FR_GAMMA,FR_S21,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p7) fma.s1 FR_GAMMA = FR_GAMMA,FR_S21,f0
- mov GR_Sig2 = 1
-};;
-{ .mfi
- nop.m 0
- frcpa.s1 FR_Rcp0,p0 = f1,FR_GAMMA
- cmp.ltu p13,p0 = GR_Sign_Exp,GR_ExpOf1
-};;
-// NR method: ineration #1
-{ .mfi
-(p13) getf.exp GR_Sign_Exp = FR_AbsX
- fnma.s1 FR_Rcp1 = FR_Rcp0,FR_GAMMA,f1 // t = 1 - r0*x
-(p13) shl GR_Sig2 = GR_Sig2,63
-};;
-{ .mfi
-(p13) getf.sig GR_Sig = FR_AbsX
- nop.f 0
-(p13) mov GR_NzOvfBound = 0xFBFF
-};;
-{ .mfi
-(p13) cmp.ltu.unc p8,p0 = GR_Sign_Exp,GR_NzOvfBound // p8 <- overflow
- nop.f 0
-(p13) cmp.eq.unc p9,p0 = GR_Sign_Exp,GR_NzOvfBound
-};;
-{ .mfb
- nop.m 0
-(p13) fma.d.s0 FR_X = f1,f1,f8 // set deno & inexact flags
-(p8) br.cond.spnt tgamma_ovf_near_0 //tgamma_neg_overflow
-};;
-{ .mib
- nop.m 0
-(p9) cmp.eq.unc p8,p0 = GR_Sig,GR_Sig2
-(p8) br.cond.spnt tgamma_ovf_near_0_boundary //tgamma_neg_overflow
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_Rcp1 = FR_Rcp0,FR_Rcp1,FR_Rcp0
- nop.i 0
-};;
-// NR method: ineration #2
-{ .mfi
- nop.m 0
- fnma.s1 FR_Rcp2 = FR_Rcp1,FR_GAMMA,f1 // t = 1 - r1*x
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_Rcp2 = FR_Rcp1,FR_Rcp2,FR_Rcp1
- nop.i 0
-};;
-// NR method: ineration #3
-{ .mfi
- nop.m 0
- fnma.s1 FR_Rcp3 = FR_Rcp2,FR_GAMMA,f1 // t = 1 - r2*x
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p13) fma.s1 FR_Rcp2 = FR_Rcp2,FR_AbsXp1,f0
-(p14) cmp.ltu p10,p11 = 0x9,GR_Tbl_Ind
-};;
-.pred.rel "mutex",p10,p11
-{ .mfi
- nop.m 0
-(p10) fma.s1 FR_GAMMA = FR_Rcp2,FR_Rcp3,FR_Rcp2
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p11) fma.d.s0 f8 = FR_Rcp2,FR_Rcp3,FR_Rcp2
- nop.i 0
-};;
-{ .mfb
- nop.m 0
-(p10) fma.d.s0 f8 = FR_GAMMA,FR_InvAn,f0
- br.ret.sptk b0
-};;
-
-
-// here if x >= 3
-//--------------------------------------------------------------------
-.align 32
-tgamma_positives:
-.pred.rel "mutex",p8,p9
-{ .mfi
- nop.m 0
-(p9) fma.d.s0 f8 = FR_GAMMA,FR_Rq1,f0
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p8) fma.d.s0 f8 = FR_GAMMA,FR_RqLin,f0
- br.ret.sptk b0
-};;
-
-// here if 0 < x < 1
-//--------------------------------------------------------------------
-.align 32
-tgamma_from_0_to_2:
-{ .mfi
- getf.exp GR_Sign_Exp = FR_r02
- fms.s1 FR_r = FR_r02,f1,FR_Xmin
- mov GR_ExpOf025 = 0xFFFD
-}
-{ .mfi
- add GR_ad_Co = 0x1200,GR_ad_Data
-(p6) fnma.s1 FR_Rcp1 = FR_Rcp0,FR_NormX,f1 // t = 1 - r0*x
-(p6) mov GR_Sig2 = 1
-};;
-{ .mfi
-(p6) getf.sig GR_Sig = FR_NormX
- nop.f 0
-(p6) shl GR_Sig2 = GR_Sig2,63
-}
-{ .mfi
- add GR_ad_Ce = 0x1210,GR_ad_Data
- nop.f 0
-(p6) mov GR_NzOvfBound = 0xFBFF
-};;
-{ .mfi
- cmp.eq p8,p0 = GR_Sign_Exp,GR_ExpOf05 // r02 >= 1/2
- nop.f 0
- cmp.eq p9,p10 = GR_Sign_Exp,GR_ExpOf025 // r02 >= 1/4
-}
-{ .mfi
-(p6) cmp.ltu.unc p11,p0 = GR_Sign_Exp,GR_NzOvfBound // p11 <- overflow
- nop.f 0
-(p6) cmp.eq.unc p12,p0 = GR_Sign_Exp,GR_NzOvfBound
-};;
-.pred.rel "mutex",p8,p9
-{ .mfi
-(p8) add GR_ad_Co = 0x200,GR_ad_Co
-(p6) fma.d.s0 FR_X = f1,f1,f8 // set deno & inexact flags
-(p9) add GR_ad_Co = 0x100,GR_ad_Co
-}
-{ .mib
-(p8) add GR_ad_Ce = 0x200,GR_ad_Ce
-(p9) add GR_ad_Ce = 0x100,GR_ad_Ce
-(p11) br.cond.spnt tgamma_ovf_near_0 //tgamma_spec_res
-};;
-{ .mfi
- ldfe FR_A15 = [GR_ad_Co],32
- nop.f 0
-(p12) cmp.eq.unc p13,p0 = GR_Sig,GR_Sig2
-}
-{ .mfb
- ldfe FR_A14 = [GR_ad_Ce],32
- nop.f 0
-(p13) br.cond.spnt tgamma_ovf_near_0_boundary //tgamma_spec_res
-};;
-{ .mfi
- ldfe FR_A13 = [GR_ad_Co],32
- nop.f 0
- nop.i 0
-}
-{ .mfi
- ldfe FR_A12 = [GR_ad_Ce],32
- nop.f 0
- nop.i 0
-};;
-.pred.rel "mutex",p9,p10
-{ .mfi
- ldfe FR_A11 = [GR_ad_Co],32
-(p10) fma.s1 FR_r2 = FR_r02,FR_r02,f0
- nop.i 0
-}
-{ .mfi
- ldfe FR_A10 = [GR_ad_Ce],32
-(p9) fma.s1 FR_r2 = FR_r,FR_r,f0
- nop.i 0
-};;
-{ .mfi
- ldfe FR_A9 = [GR_ad_Co],32
-(p6) fma.s1 FR_Rcp1 = FR_Rcp0,FR_Rcp1,FR_Rcp0
- nop.i 0
-}
-{ .mfi
- ldfe FR_A8 = [GR_ad_Ce],32
-(p10) fma.s1 FR_r = f0,f0,FR_r02
- nop.i 0
-};;
-{ .mfi
- ldfe FR_A7 = [GR_ad_Co],32
- nop.f 0
- nop.i 0
-}
-{ .mfi
- ldfe FR_A6 = [GR_ad_Ce],32
- nop.f 0
- nop.i 0
-};;
-{ .mfi
- ldfe FR_A5 = [GR_ad_Co],32
- nop.f 0
- nop.i 0
-}
-{ .mfi
- ldfe FR_A4 = [GR_ad_Ce],32
- nop.f 0
- nop.i 0
-};;
-{ .mfi
- ldfe FR_A3 = [GR_ad_Co],32
- nop.f 0
- nop.i 0
-}
-{ .mfi
- ldfe FR_A2 = [GR_ad_Ce],32
- nop.f 0
- nop.i 0
-};;
-{ .mfi
- ldfe FR_A1 = [GR_ad_Co],32
- fma.s1 FR_r4 = FR_r2,FR_r2,f0
- nop.i 0
-}
-{ .mfi
- ldfe FR_A0 = [GR_ad_Ce],32
- nop.f 0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p6) fnma.s1 FR_Rcp2 = FR_Rcp1,FR_NormX,f1 // t = 1 - r1*x
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A15 = FR_A15,FR_r,FR_A14
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_A11 = FR_A11,FR_r,FR_A10
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_r8 = FR_r4,FR_r4,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p6) fma.s1 FR_Rcp2 = FR_Rcp1,FR_Rcp2,FR_Rcp1
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A7 = FR_A7,FR_r,FR_A6
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_A3 = FR_A3,FR_r,FR_A2
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A15 = FR_A15,FR_r,FR_A13
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_A11 = FR_A11,FR_r,FR_A9
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p6) fnma.s1 FR_Rcp3 = FR_Rcp2,FR_NormX,f1 // t = 1 - r1*x
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A7 = FR_A7,FR_r,FR_A5
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_A3 = FR_A3,FR_r,FR_A1
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A15 = FR_A15,FR_r,FR_A12
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_A11 = FR_A11,FR_r,FR_A8
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p6) fma.s1 FR_Rcp3 = FR_Rcp2,FR_Rcp3,FR_Rcp2
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A7 = FR_A7,FR_r,FR_A4
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_A3 = FR_A3,FR_r,FR_A0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A15 = FR_A15,FR_r4,FR_A11
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_A7 = FR_A7,FR_r4,FR_A3
- nop.i 0
-};;
-.pred.rel "mutex",p6,p7
-{ .mfi
- nop.m 0
-(p6) fma.s1 FR_A15 = FR_A15,FR_r8,FR_A7
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p7) fma.d.s0 f8 = FR_A15,FR_r8,FR_A7
- nop.i 0
-};;
-{ .mfb
- nop.m 0
-(p6) fma.d.s0 f8 = FR_A15,FR_Rcp3,f0
- br.ret.sptk b0
-};;
-
-// overflow
-//--------------------------------------------------------------------
-.align 32
-tgamma_ovf_near_0_boundary:
-.pred.rel "mutex",p14,p15
-{ .mfi
- mov GR_fpsr = ar.fpsr
- nop.f 0
-(p15) mov r8 = 0x7ff
-}
-{ .mfi
- nop.m 0
- nop.f 0
-(p14) mov r8 = 0xfff
-};;
-{ .mfi
- nop.m 0
- nop.f 0
- shl r8 = r8,52
-};;
-{ .mfi
- sub r8 = r8,r0,1
- nop.f 0
- extr.u GR_fpsr = GR_fpsr,10,2 // rounding mode
-};;
-.pred.rel "mutex",p14,p15
-{ .mfi
- // set p8 to 0 in case of overflow and to 1 otherwise
- // for negative arg:
- // no overflow if rounding mode either Z or +Inf, i.e.
- // GR_fpsr > 1
-(p14) cmp.lt p8,p0 = 1,GR_fpsr
- nop.f 0
- // for positive arg:
- // no overflow if rounding mode either Z or -Inf, i.e.
- // (GR_fpsr & 1) == 0
-(p15) tbit.z p0,p8 = GR_fpsr,0
-};;
-{ .mib
-(p8) setf.d f8 = r8 // set result to 0x7fefffffffffffff without
- // OVERFLOW flag raising
- nop.i 0
-(p8) br.ret.sptk b0
-};;
-.align 32
-tgamma_ovf_near_0:
-{ .mfi
- mov r8 = 0x1FFFE
- nop.f 0
- nop.i 0
-};;
-{ .mfi
- setf.exp f9 = r8
- fmerge.s FR_X = f8,f8
- mov GR_TAG = 258 // overflow
-};;
-.pred.rel "mutex",p14,p15
-{ .mfi
- nop.m 0
-(p15) fma.d.s0 f8 = f9,f9,f0 // Set I,O and +INF result
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p14) fnma.d.s0 f8 = f9,f9,f0 // Set I,O and -INF result
- br.cond.sptk tgamma_libm_err
-};;
-// overflow or absolute value of x is too big
-//--------------------------------------------------------------------
-.align 32
-tgamma_spec_res:
-{ .mfi
- mov GR_0x30033 = 0x30033
-(p14) fcmp.eq.unc.s1 p10,p11 = f8,FR_Xt
-(p15) mov r8 = 0x1FFFE
-};;
-{ .mfi
-(p15) setf.exp f9 = r8
- nop.f 0
- nop.i 0
-};;
-{ .mfb
-(p11) cmp.ltu.unc p7,p8 = GR_0x30033,GR_Sign_Exp
- nop.f 0
-(p10) br.cond.spnt tgamma_singularity
-};;
-.pred.rel "mutex",p7,p8
-{ .mbb
- nop.m 0
-(p7) br.cond.spnt tgamma_singularity
-(p8) br.cond.spnt tgamma_underflow
-};;
-{ .mfi
- nop.m 0
- fmerge.s FR_X = f8,f8
- mov GR_TAG = 258 // overflow
-}
-{ .mfb
- nop.m 0
-(p15) fma.d.s0 f8 = f9,f9,f0 // Set I,O and +INF result
- br.cond.sptk tgamma_libm_err
-};;
-
-// x is negative integer or +/-0
-//--------------------------------------------------------------------
-.align 32
-tgamma_singularity:
-{ .mfi
- nop.m 0
- fmerge.s FR_X = f8,f8
- mov GR_TAG = 259 // negative
-}
-{ .mfb
- nop.m 0
- frcpa.s0 f8,p0 = f0,f0
- br.cond.sptk tgamma_libm_err
-};;
-// x is negative noninteger with big absolute value
-//--------------------------------------------------------------------
-.align 32
-tgamma_underflow:
-{ .mmi
- getf.sig GR_Sig = FR_iXt
- mov r11 = 0x00001
- nop.i 0
-};;
-{ .mfi
- setf.exp f9 = r11
- nop.f 0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- nop.f 0
- tbit.z p6,p7 = GR_Sig,0
-};;
-.pred.rel "mutex",p6,p7
-{ .mfi
- nop.m 0
-(p6) fms.d.s0 f8 = f9,f9,f9
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p7) fma.d.s0 f8 = f9,f9,f9
- br.ret.sptk b0
-};;
-
-// x for natval, nan, +/-inf or +/-0
-//--------------------------------------------------------------------
-.align 32
-tgamma_spec:
-{ .mfi
- nop.m 0
- fclass.m p6,p0 = f8,0x1E1 // Test x for natval, nan, +inf
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fclass.m p7,p8 = f8,0x7 // +/-0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fmerge.s FR_X = f8,f8
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p6) fma.d.s0 f8 = f8,f1,f8
-(p6) br.ret.spnt b0
-};;
-.pred.rel "mutex",p7,p8
-{ .mfi
-(p7) mov GR_TAG = 259 // negative
-(p7) frcpa.s0 f8,p0 = f1,f8
- nop.i 0
-}
-{ .mib
- nop.m 0
- nop.i 0
-(p8) br.cond.spnt tgamma_singularity
-};;
-
-.align 32
-tgamma_libm_err:
-{ .mfi
- alloc r32 = ar.pfs,1,4,4,0
- nop.f 0
- mov GR_Parameter_TAG = GR_TAG
-};;
-
-GLOBAL_LIBM_END(tgamma)
-
-LOCAL_LIBM_ENTRY(__libm_error_region)
-.prologue
-{ .mfi
- add GR_Parameter_Y=-32,sp // Parameter 2 value
- nop.f 0
-.save ar.pfs,GR_SAVE_PFS
- mov GR_SAVE_PFS=ar.pfs // Save ar.pfs
-}
-{ .mfi
-.fframe 64
- add sp=-64,sp // Create new stack
- nop.f 0
- mov GR_SAVE_GP=gp // Save gp
-};;
-{ .mmi
- stfd [GR_Parameter_Y] = FR_Y,16 // STORE Parameter 2 on stack
- add GR_Parameter_X = 16,sp // Parameter 1 address
-.save b0, GR_SAVE_B0
- mov GR_SAVE_B0=b0 // Save b0
-};;
-.body
-{ .mib
- stfd [GR_Parameter_X] = FR_X // STORE Parameter 1 on stack
- add GR_Parameter_RESULT = 0,GR_Parameter_Y // Parameter 3 address
- nop.b 0
-}
-{ .mib
- stfd [GR_Parameter_Y] = FR_RESULT // STORE Parameter 3 on stack
- add GR_Parameter_Y = -16,GR_Parameter_Y
- br.call.sptk b0=__libm_error_support# // Call error handling function
-};;
-{ .mmi
- nop.m 0
- nop.m 0
- add GR_Parameter_RESULT = 48,sp
-};;
-{ .mmi
- ldfd f8 = [GR_Parameter_RESULT] // Get return result off stack
-.restore sp
- add sp = 64,sp // Restore stack pointer
- mov b0 = GR_SAVE_B0 // Restore return address
-};;
-{ .mib
- mov gp = GR_SAVE_GP // Restore gp
- mov ar.pfs = GR_SAVE_PFS // Restore ar.pfs
- br.ret.sptk b0 // Return
-};;
-
-LOCAL_LIBM_END(__libm_error_region)
-.type __libm_error_support#,@function
-.global __libm_error_support#
diff --git a/sysdeps/ia64/fpu/mplog.c b/sysdeps/ia64/fpu/w_tgamma.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/ia64/fpu/mplog.c
+++ b/sysdeps/ia64/fpu/w_tgamma.c
diff --git a/sysdeps/ia64/fpu/w_tgamma_compat.S b/sysdeps/ia64/fpu/w_tgamma_compat.S
new file mode 100644
index 0000000000..364c70f4a9
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_tgamma_compat.S
@@ -0,0 +1,1836 @@
+.file "tgamma.s"
+
+
+// Copyright (c) 2001 - 2005, Intel Corporation
+// All rights reserved.
+//
+// Contributed 2001 by the Intel Numerics Group, Intel Corporation
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// * The name of Intel Corporation may not be used to endorse or promote
+// products derived from this software without specific prior written
+// permission.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING,BUT NOT
+// LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT,INCIDENTAL,SPECIAL,
+// EXEMPLARY,OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA,OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY,WHETHER IN CONTRACT,STRICT LIABILITY OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Intel Corporation is the author of this code,and requests that all
+// problem reports or change requests be submitted to it directly at
+// http://www.intel.com/software/products/opensource/libraries/num.htm.
+//
+//*********************************************************************
+//
+// History:
+// 10/12/01 Initial version
+// 05/20/02 Cleaned up namespace and sf0 syntax
+// 02/10/03 Reordered header: .section, .global, .proc, .align
+// 04/04/03 Changed error codes for overflow and negative integers
+// 04/10/03 Changed code for overflow near zero handling
+// 03/31/05 Reformatted delimiters between data tables
+//
+//*********************************************************************
+//
+//*********************************************************************
+//
+// Function: tgamma(x) computes the principle value of the GAMMA
+// function of x.
+//
+//*********************************************************************
+//
+// Resources Used:
+//
+// Floating-Point Registers: f8-f15
+// f33-f87
+//
+// General Purpose Registers:
+// r8-r11
+// r14-r28
+// r32-r36
+// r37-r40 (Used to pass arguments to error handling routine)
+//
+// Predicate Registers: p6-p15
+//
+//*********************************************************************
+//
+// IEEE Special Conditions:
+//
+// tgamma(+inf) = +inf
+// tgamma(-inf) = QNaN
+// tgamma(+/-0) = +/-inf
+// tgamma(x<0, x - integer) = QNaN
+// tgamma(SNaN) = QNaN
+// tgamma(QNaN) = QNaN
+//
+//*********************************************************************
+//
+// Overview
+//
+// The method consists of three cases.
+//
+// If 2 <= x < OVERFLOW_BOUNDARY use case tgamma_regular;
+// else if 0 < x < 2 use case tgamma_from_0_to_2;
+// else if -(i+1) < x < -i, i = 0...184 use case tgamma_negatives;
+//
+// Case 2 <= x < OVERFLOW_BOUNDARY
+// -------------------------------
+// Here we use algorithm based on the recursive formula
+// GAMMA(x+1) = x*GAMMA(x). For that we subdivide interval
+// [2; OVERFLOW_BOUNDARY] into intervals [16*n; 16*(n+1)] and
+// approximate GAMMA(x) by polynomial of 22th degree on each
+// [16*n; 16*n+1], recursive formula is used to expand GAMMA(x)
+// to [16*n; 16*n+1]. In other words we need to find n, i and r
+// such that x = 16 * n + i + r where n and i are integer numbers
+// and r is fractional part of x. So GAMMA(x) = GAMMA(16*n+i+r) =
+// = (x-1)*(x-2)*...*(x-i)*GAMMA(x-i) =
+// = (x-1)*(x-2)*...*(x-i)*GAMMA(16*n+r) ~
+// ~ (x-1)*(x-2)*...*(x-i)*P22n(r).
+//
+// Step 1: Reduction
+// -----------------
+// N = [x] with truncate
+// r = x - N, note 0 <= r < 1
+//
+// n = N & ~0xF - index of table that contains coefficient of
+// polynomial approximation
+// i = N & 0xF - is used in recursive formula
+//
+//
+// Step 2: Approximation
+// ---------------------
+// We use factorized minimax approximation polynomials
+// P22n(r) = A22*(r^2+C01(n)*R+C00(n))*
+// *(r^2+C11(n)*R+C10(n))*...*(r^2+CA1(n)*R+CA0(n))
+//
+// Step 3: Recursion
+// -----------------
+// In case when i > 0 we need to multiply P22n(r) by product
+// R(i)=(x-1)*(x-2)*...*(x-i). To reduce number of fp-instructions
+// we can calculate R as follow:
+// R(i) = ((x-1)*(x-2))*((x-3)*(x-4))*...*((x-(i-1))*(x-i)) if i is
+// even or R = ((x-1)*(x-2))*((x-3)*(x-4))*...*((x-(i-2))*(x-(i-1)))*
+// *(i-1) if i is odd. In both cases we need to calculate
+// R2(i) = (x^2-3*x+2)*(x^2-7*x+12)*...*(x^2+x+2*j*(2*j-1)) =
+// = (x^2-3*x+2)*(x^2-7*x+12)*...*((x^2+x)+2*j*(2*(j-1)+(1-2*x))) =
+// = (RA+2*(2-RB))*(RA+4*(4-RB))*...*(RA+2*j*(2*(j-1)+RB))
+// where j = 1..[i/2], RA = x^2+x, RB = 1-2*x.
+//
+// Step 4: Reconstruction
+// ----------------------
+// Reconstruction is just simple multiplication i.e.
+// GAMMA(x) = P22n(r)*R(i)
+//
+// Case 0 < x < 2
+// --------------
+// To calculate GAMMA(x) on this interval we do following
+// if 1 <= x < 1.25 than GAMMA(x) = P15(x-1)
+// if 1.25 <= x < 1.5 than GAMMA(x) = P15(x-x_min) where
+// x_min is point of local minimum on [1; 2] interval.
+// if 1.5 <= x < 2.0 than GAMMA(x) = P15(x-1.5)
+// and
+// if 0 < x < 1 than GAMMA(x) = GAMMA(x+1)/x
+//
+// Case -(i+1) < x < -i, i = 0...184
+// ----------------------------------
+// Here we use the fact that GAMMA(-x) = PI/(x*GAMMA(x)*sin(PI*x)) and
+// so we need to calculate GAMMA(x), sin(PI*x)/PI. Calculation of
+// GAMMA(x) is described above.
+//
+// Step 1: Reduction
+// -----------------
+// Note that period of sin(PI*x) is 2 and range reduction for
+// sin(PI*x) is like to range reduction for GAMMA(x)
+// i.e r = x - [x] with exception of cases
+// when r > 0.5 (in such cases r = 1 - (x - [x])).
+//
+// Step 2: Approximation
+// ---------------------
+// To approximate sin(PI*x)/PI = sin(PI*(2*n+r))/PI =
+// = (-1)^n*sin(PI*r)/PI Taylor series is used.
+// sin(PI*r)/PI ~ S21(r).
+//
+// Step 3: Division
+// ----------------
+// To calculate 1/(x*GAMMA(x)*S21(r)) we use frcpa instruction
+// with following Newton-Raphson interations.
+//
+//
+//*********************************************************************
+
+GR_Sig = r8
+GR_TAG = r8
+GR_ad_Data = r9
+GR_SigRqLin = r10
+GR_iSig = r11
+GR_ExpOf1 = r11
+GR_ExpOf8 = r11
+
+
+GR_Sig2 = r14
+GR_Addr_Mask1 = r15
+GR_Sign_Exp = r16
+GR_Tbl_Offs = r17
+GR_Addr_Mask2 = r18
+GR_ad_Co = r19
+GR_Bit2 = r19
+GR_ad_Ce = r20
+GR_ad_Co7 = r21
+GR_NzOvfBound = r21
+GR_ad_Ce7 = r22
+GR_Tbl_Ind = r23
+GR_Tbl_16xInd = r24
+GR_ExpOf025 = r24
+GR_ExpOf05 = r25
+GR_0x30033 = r26
+GR_10 = r26
+GR_12 = r27
+GR_185 = r27
+GR_14 = r28
+GR_2 = r28
+GR_fpsr = r28
+
+GR_SAVE_B0 = r33
+GR_SAVE_PFS = r34
+GR_SAVE_GP = r35
+GR_SAVE_SP = r36
+
+GR_Parameter_X = r37
+GR_Parameter_Y = r38
+GR_Parameter_RESULT = r39
+GR_Parameter_TAG = r40
+
+
+
+FR_X = f10
+FR_Y = f1 // tgamma is single argument function
+FR_RESULT = f8
+
+FR_AbsX = f9
+FR_NormX = f9
+FR_r02 = f11
+FR_AbsXp1 = f12
+FR_X2pX = f13
+FR_1m2X = f14
+FR_Rq1 = f14
+FR_Xt = f15
+
+FR_r = f33
+FR_OvfBound = f34
+FR_Xmin = f35
+FR_2 = f36
+FR_Rcp1 = f36
+FR_Rcp3 = f36
+FR_4 = f37
+FR_5 = f38
+FR_6 = f39
+FR_8 = f40
+FR_10 = f41
+FR_12 = f42
+FR_14 = f43
+FR_GAMMA = f43
+FR_05 = f44
+
+FR_Rq2 = f45
+FR_Rq3 = f46
+FR_Rq4 = f47
+FR_Rq5 = f48
+FR_Rq6 = f49
+FR_Rq7 = f50
+FR_RqLin = f51
+
+FR_InvAn = f52
+
+FR_C01 = f53
+FR_A15 = f53
+FR_C11 = f54
+FR_A14 = f54
+FR_C21 = f55
+FR_A13 = f55
+FR_C31 = f56
+FR_A12 = f56
+FR_C41 = f57
+FR_A11 = f57
+FR_C51 = f58
+FR_A10 = f58
+FR_C61 = f59
+FR_A9 = f59
+FR_C71 = f60
+FR_A8 = f60
+FR_C81 = f61
+FR_A7 = f61
+FR_C91 = f62
+FR_A6 = f62
+FR_CA1 = f63
+FR_A5 = f63
+FR_C00 = f64
+FR_A4 = f64
+FR_rs2 = f64
+FR_C10 = f65
+FR_A3 = f65
+FR_rs3 = f65
+FR_C20 = f66
+FR_A2 = f66
+FR_rs4 = f66
+FR_C30 = f67
+FR_A1 = f67
+FR_rs7 = f67
+FR_C40 = f68
+FR_A0 = f68
+FR_rs8 = f68
+FR_C50 = f69
+FR_r2 = f69
+FR_C60 = f70
+FR_r3 = f70
+FR_C70 = f71
+FR_r4 = f71
+FR_C80 = f72
+FR_r7 = f72
+FR_C90 = f73
+FR_r8 = f73
+FR_CA0 = f74
+FR_An = f75
+
+FR_S21 = f76
+FR_S19 = f77
+FR_Rcp0 = f77
+FR_Rcp2 = f77
+FR_S17 = f78
+FR_S15 = f79
+FR_S13 = f80
+FR_S11 = f81
+FR_S9 = f82
+FR_S7 = f83
+FR_S5 = f84
+FR_S3 = f85
+
+FR_iXt = f86
+FR_rs = f87
+
+
+// Data tables
+//==============================================================
+RODATA
+.align 16
+
+LOCAL_OBJECT_START(tgamma_data)
+data8 0x406573FAE561F648 // overflow boundary (171.624376956302739927196)
+data8 0x3FDD8B618D5AF8FE // point of local minium (0.461632144968362356785)
+//
+//[2; 3]
+data8 0xEF0E85C9AE40ABE2,0x00004000 // C01
+data8 0xCA2049DDB4096DD8,0x00004000 // C11
+data8 0x99A203B4DC2D1A8C,0x00004000 // C21
+data8 0xBF5D9D9C0C295570,0x00003FFF // C31
+data8 0xE8DD037DEB833BAB,0x00003FFD // C41
+data8 0xB6AE39A2A36AA03A,0x0000BFFE // C51
+data8 0x804960DC2850277B,0x0000C000 // C61
+data8 0xD9F3973841C09F80,0x0000C000 // C71
+data8 0x9C198A676F8A2239,0x0000C001 // C81
+data8 0xC98B7DAE02BE3226,0x0000C001 // C91
+data8 0xE9CAF31AC69301BA,0x0000C001 // CA1
+data8 0xFBBDD58608A0D172,0x00004000 // C00
+data8 0xFDD0316D1E078301,0x00004000 // C10
+data8 0x8630B760468C15E4,0x00004001 // C20
+data8 0x93EDE20E47D9152E,0x00004001 // C30
+data8 0xA86F3A38C77D6B19,0x00004001 // C40
+//[16; 17]
+data8 0xF87F757F365EE813,0x00004000 // C01
+data8 0xECA84FBA92759DA4,0x00004000 // C11
+data8 0xD4E0A55E07A8E913,0x00004000 // C21
+data8 0xB0EB45E94C8A5F7B,0x00004000 // C31
+data8 0x8050D6B4F7C8617D,0x00004000 // C41
+data8 0x8471B111AA691E5A,0x00003FFF // C51
+data8 0xADAF462AF96585C9,0x0000BFFC // C61
+data8 0xD327C7A587A8C32B,0x0000BFFF // C71
+data8 0xDEF5192B4CF5E0F1,0x0000C000 // C81
+data8 0xBADD64BB205AEF02,0x0000C001 // C91
+data8 0x9330A24AA67D6860,0x0000C002 // CA1
+data8 0xF57EEAF36D8C47BE,0x00004000 // C00
+data8 0x807092E12A251B38,0x00004001 // C10
+data8 0x8C458F80DEE7ED1C,0x00004001 // C20
+data8 0x9F30C731DC77F1A6,0x00004001 // C30
+data8 0xBAC4E7E099C3A373,0x00004001 // C40
+//[32; 33]
+data8 0xC3059A415F142DEF,0x00004000 // C01
+data8 0xB9C1DAC24664587A,0x00004000 // C11
+data8 0xA7101D910992FFB2,0x00004000 // C21
+data8 0x8A9522B8E4AA0AB4,0x00004000 // C31
+data8 0xC76A271E4BA95DCC,0x00003FFF // C41
+data8 0xC5D6DE2A38DB7FF2,0x00003FFE // C51
+data8 0xDBA42086997818B2,0x0000BFFC // C61
+data8 0xB8EDDB1424C1C996,0x0000BFFF // C71
+data8 0xBF7372FB45524B5D,0x0000C000 // C81
+data8 0xA03DDE759131580A,0x0000C001 // C91
+data8 0xFDA6FC4022C1FFE3,0x0000C001 // CA1
+data8 0x9759ABF797B2533D,0x00004000 // C00
+data8 0x9FA160C6CF18CEC5,0x00004000 // C10
+data8 0xB0EFF1E3530E0FCD,0x00004000 // C20
+data8 0xCCD60D5C470165D1,0x00004000 // C30
+data8 0xF5E53F6307B0B1C1,0x00004000 // C40
+//[48; 49]
+data8 0xAABE577FBCE37F5E,0x00004000 // C01
+data8 0xA274CAEEB5DF7172,0x00004000 // C11
+data8 0x91B90B6646C1B924,0x00004000 // C21
+data8 0xF06718519CA256D9,0x00003FFF // C31
+data8 0xAA9EE181C0E30263,0x00003FFF // C41
+data8 0xA07BDB5325CB28D2,0x00003FFE // C51
+data8 0x86C8B873204F9219,0x0000BFFD // C61
+data8 0xB0192C5D3E4787D6,0x0000BFFF // C71
+data8 0xB1E0A6263D4C19EF,0x0000C000 // C81
+data8 0x93BA32A118EAC9AE,0x0000C001 // C91
+data8 0xE942A39CD9BEE887,0x0000C001 // CA1
+data8 0xE838B0957B0D3D0D,0x00003FFF // C00
+data8 0xF60E0F00074FCF34,0x00003FFF // C10
+data8 0x89869936AE00C2A5,0x00004000 // C20
+data8 0xA0FE4E8AA611207F,0x00004000 // C30
+data8 0xC3B1229CFF1DDAFE,0x00004000 // C40
+//[64; 65]
+data8 0x9C00DDF75CDC6183,0x00004000 // C01
+data8 0x9446AE9C0F6A833E,0x00004000 // C11
+data8 0x84ABC5083310B774,0x00004000 // C21
+data8 0xD9BA3A0977B1ED83,0x00003FFF // C31
+data8 0x989B18C99411D300,0x00003FFF // C41
+data8 0x886E66402318CE6F,0x00003FFE // C51
+data8 0x99028C2468F18F38,0x0000BFFD // C61
+data8 0xAB72D17DCD40CCE1,0x0000BFFF // C71
+data8 0xA9D9AC9BE42C2EF9,0x0000C000 // C81
+data8 0x8C11D983AA177AD2,0x0000C001 // C91
+data8 0xDC779E981C1F0F06,0x0000C001 // CA1
+data8 0xC1FD4AC85965E8D6,0x00003FFF // C00
+data8 0xCE3D2D909D389EC2,0x00003FFF // C10
+data8 0xE7F79980AD06F5D8,0x00003FFF // C20
+data8 0x88DD9F73C8680B5D,0x00004000 // C30
+data8 0xA7D6CB2CB2D46F9D,0x00004000 // C40
+//[80; 81]
+data8 0x91C7FF4E993430D0,0x00004000 // C01
+data8 0x8A6E7AB83E45A7E9,0x00004000 // C11
+data8 0xF72D6382E427BEA9,0x00003FFF // C21
+data8 0xC9E2E4F9B3B23ED6,0x00003FFF // C31
+data8 0x8BEFEF56AE05D775,0x00003FFF // C41
+data8 0xEE9666AB6A185560,0x00003FFD // C51
+data8 0xA6AFAF5CEFAEE04D,0x0000BFFD // C61
+data8 0xA877EAFEF1F9C880,0x0000BFFF // C71
+data8 0xA45BD433048ECA15,0x0000C000 // C81
+data8 0x86BD1636B774CC2E,0x0000C001 // C91
+data8 0xD3721BE006E10823,0x0000C001 // CA1
+data8 0xA97EFABA91854208,0x00003FFF // C00
+data8 0xB4AF0AEBB3F97737,0x00003FFF // C10
+data8 0xCC38241936851B0B,0x00003FFF // C20
+data8 0xF282A6261006EA84,0x00003FFF // C30
+data8 0x95B8E9DB1BD45BAF,0x00004000 // C40
+//[96; 97]
+data8 0x8A1FA3171B35A106,0x00004000 // C01
+data8 0x830D5B8843890F21,0x00004000 // C11
+data8 0xE98B0F1616677A23,0x00003FFF // C21
+data8 0xBDF8347F5F67D4EC,0x00003FFF // C31
+data8 0x825F15DE34EC055D,0x00003FFF // C41
+data8 0xD4846186B8AAC7BE,0x00003FFD // C51
+data8 0xB161093AB14919B1,0x0000BFFD // C61
+data8 0xA65758EEA4800EF4,0x0000BFFF // C71
+data8 0xA046B67536FA329C,0x0000C000 // C81
+data8 0x82BBEC1BCB9E9068,0x0000C001 // C91
+data8 0xCC9DE2B23BA91B0B,0x0000C001 // CA1
+data8 0x983B16148AF77F94,0x00003FFF // C00
+data8 0xA2A4D8EE90FEE5DD,0x00003FFF // C10
+data8 0xB89446FA37FF481C,0x00003FFF // C20
+data8 0xDC5572648485FB01,0x00003FFF // C30
+data8 0x88CD5D7DB976129A,0x00004000 // C40
+//[112; 113]
+data8 0x8417098FD62AC5E3,0x00004000 // C01
+data8 0xFA7896486B779CBB,0x00003FFF // C11
+data8 0xDEC98B14AF5EEBD1,0x00003FFF // C21
+data8 0xB48E153C6BF0B5A3,0x00003FFF // C31
+data8 0xF597B038BC957582,0x00003FFE // C41
+data8 0xBFC6F0884A415694,0x00003FFD // C51
+data8 0xBA075A1392BDB5E5,0x0000BFFD // C61
+data8 0xA4B79E01B44C7DB4,0x0000BFFF // C71
+data8 0x9D12FA7711BFAB0F,0x0000C000 // C81
+data8 0xFF24C47C8E108AB4,0x0000C000 // C91
+data8 0xC7325EC86562606A,0x0000C001 // CA1
+data8 0x8B47DCD9E1610938,0x00003FFF // C00
+data8 0x9518B111B70F88B8,0x00003FFF // C10
+data8 0xA9CC197206F68682,0x00003FFF // C20
+data8 0xCB98294CC0D7A6A6,0x00003FFF // C30
+data8 0xFE09493EA9165181,0x00003FFF // C40
+//[128; 129]
+data8 0xFE53D03442270D90,0x00003FFF // C01
+data8 0xF0F857BAEC1993E4,0x00003FFF // C11
+data8 0xD5FF6D70DBBC2FD3,0x00003FFF // C21
+data8 0xACDAA5F4988B1074,0x00003FFF // C31
+data8 0xE92E069F8AD75B54,0x00003FFE // C41
+data8 0xAEBB64645BD94234,0x00003FFD // C51
+data8 0xC13746249F39B43C,0x0000BFFD // C61
+data8 0xA36B74F5B6297A1F,0x0000BFFF // C71
+data8 0x9A77860DF180F6E5,0x0000C000 // C81
+data8 0xF9F8457D84410A0C,0x0000C000 // C91
+data8 0xC2BF44C649EB8597,0x0000C001 // CA1
+data8 0x81225E7489BCDC0E,0x00003FFF // C00
+data8 0x8A788A09CE0EED11,0x00003FFF // C10
+data8 0x9E2E6F86D1B1D89C,0x00003FFF // C20
+data8 0xBE6866B21CF6CCB5,0x00003FFF // C30
+data8 0xEE94426EC1486AAE,0x00003FFF // C40
+//[144; 145]
+data8 0xF6113E09732A6497,0x00003FFF // C01
+data8 0xE900D45931B04FC8,0x00003FFF // C11
+data8 0xCE9FD58F745EBA5D,0x00003FFF // C21
+data8 0xA663A9636C864C86,0x00003FFF // C31
+data8 0xDEBF5315896CE629,0x00003FFE // C41
+data8 0xA05FEA415EBD7737,0x00003FFD // C51
+data8 0xC750F112BD9C4031,0x0000BFFD // C61
+data8 0xA2593A35C51C6F6C,0x0000BFFF // C71
+data8 0x9848E1DA7FB40C8C,0x0000C000 // C81
+data8 0xF59FEE87A5759A4B,0x0000C000 // C91
+data8 0xBF00203909E45A1D,0x0000C001 // CA1
+data8 0xF1D8E157200127E5,0x00003FFE // C00
+data8 0x81DD5397CB08D487,0x00003FFF // C10
+data8 0x94C1DC271A8B766F,0x00003FFF // C20
+data8 0xB3AFAF9B5D6EDDCF,0x00003FFF // C30
+data8 0xE1FB4C57CA81BE1E,0x00003FFF // C40
+//[160; 161]
+data8 0xEEFFE5122AC72FFD,0x00003FFF // C01
+data8 0xE22F70BB52AD54B3,0x00003FFF // C11
+data8 0xC84FF021FE993EEA,0x00003FFF // C21
+data8 0xA0DA2208EB5B2752,0x00003FFF // C31
+data8 0xD5CDD2FCF8AD2DF5,0x00003FFE // C41
+data8 0x940BEC6DCD811A59,0x00003FFD // C51
+data8 0xCC954EF4FD4EBB81,0x0000BFFD // C61
+data8 0xA1712E29A8C04554,0x0000BFFF // C71
+data8 0x966B55DFB243521A,0x0000C000 // C81
+data8 0xF1E6A2B9CEDD0C4C,0x0000C000 // C91
+data8 0xBBC87BCC031012DB,0x0000C001 // CA1
+data8 0xE43974E6D2818583,0x00003FFE // C00
+data8 0xF5702A516B64C5B7,0x00003FFE // C10
+data8 0x8CEBCB1B32E19471,0x00003FFF // C20
+data8 0xAAC10F05BB77E0AF,0x00003FFF // C30
+data8 0xD776EFCAB205CC58,0x00003FFF // C40
+//[176; 177]
+data8 0xE8DA614119811E5D,0x00003FFF // C01
+data8 0xDC415E0288B223D8,0x00003FFF // C11
+data8 0xC2D2243E44EC970E,0x00003FFF // C21
+data8 0x9C086664B5307BEA,0x00003FFF // C31
+data8 0xCE03D7A08B461156,0x00003FFE // C41
+data8 0x894BE3BAAAB66ADC,0x00003FFD // C51
+data8 0xD131EDD71A702D4D,0x0000BFFD // C61
+data8 0xA0A907CDDBE10898,0x0000BFFF // C71
+data8 0x94CC3CD9C765C808,0x0000C000 // C81
+data8 0xEEA85F237815FC0D,0x0000C000 // C91
+data8 0xB8FA04B023E43F91,0x0000C001 // CA1
+data8 0xD8B2C7D9FCBD7EF9,0x00003FFE // C00
+data8 0xE9566E93AAE7E38F,0x00003FFE // C10
+data8 0x8646E78AABEF0255,0x00003FFF // C20
+data8 0xA32AEDB62E304345,0x00003FFF // C30
+data8 0xCE83E40280EE7DF0,0x00003FFF // C40
+//
+//[2; 3]
+data8 0xC44FB47E90584083,0x00004001 // C50
+data8 0xE863EE77E1C45981,0x00004001 // C60
+data8 0x8AC15BE238B9D70E,0x00004002 // C70
+data8 0xA5D94B6592350EF4,0x00004002 // C80
+data8 0xC379DB3E20A148B3,0x00004002 // C90
+data8 0xDACA49B73974F6C9,0x00004002 // CA0
+data8 0x810E496A1AFEC895,0x00003FE1 // An
+//[16; 17]
+data8 0xE17C0357AAF3F817,0x00004001 // C50
+data8 0x8BA8804750FBFBFE,0x00004002 // C60
+data8 0xB18EAB3CB64BEBEE,0x00004002 // C70
+data8 0xE90AB7015AF1C28F,0x00004002 // C80
+data8 0xA0AB97CE9E259196,0x00004003 // C90
+data8 0xF5E0E0A000C2D720,0x00004003 // CA0
+data8 0xD97F0F87EC791954,0x00004005 // An
+//[32; 33]
+data8 0x980C293F3696040D,0x00004001 // C50
+data8 0xC0DBFFBB948A9A4E,0x00004001 // C60
+data8 0xFAB54625E9A588A2,0x00004001 // C70
+data8 0xA7E08176D6050FBF,0x00004002 // C80
+data8 0xEBAAEC4952270A9F,0x00004002 // C90
+data8 0xB7479CDAD20550FE,0x00004003 // CA0
+data8 0xAACD45931C3FF634,0x00004054 // An
+//[48; 49]
+data8 0xF5180F0000419AD5,0x00004000 // C50
+data8 0x9D507D07BFBB2273,0x00004001 // C60
+data8 0xCEB53F7A13A383E3,0x00004001 // C70
+data8 0x8BAFEF9E0A49128F,0x00004002 // C80
+data8 0xC58EF912D39E228C,0x00004002 // C90
+data8 0x9A88118422BA208E,0x00004003 // CA0
+data8 0xBD6C0E2477EC12CB,0x000040AC // An
+//[64; 65]
+data8 0xD410AC48BF7748DA,0x00004000 // C50
+data8 0x89399B90AFEBD931,0x00004001 // C60
+data8 0xB596DF8F77EB8560,0x00004001 // C70
+data8 0xF6D9445A047FB4A6,0x00004001 // C80
+data8 0xAF52F0DD65221357,0x00004002 // C90
+data8 0x8989B45BFC881989,0x00004003 // CA0
+data8 0xB7FCAE86E6E10D5A,0x0000410B // An
+//[80; 81]
+data8 0xBE759740E3B5AA84,0x00004000 // C50
+data8 0xF8037B1B07D27609,0x00004000 // C60
+data8 0xA4F6F6C7F0977D4F,0x00004001 // C70
+data8 0xE131960233BF02C4,0x00004001 // C80
+data8 0xA06DF43D3922BBE2,0x00004002 // C90
+data8 0xFC266AB27255A360,0x00004002 // CA0
+data8 0xD9F4B012EDAFEF2F,0x0000416F // An
+//[96; 97]
+data8 0xAEFC84CDA8E1EAA6,0x00004000 // C50
+data8 0xE5009110DB5F3C8A,0x00004000 // C60
+data8 0x98F5F48738E7B232,0x00004001 // C70
+data8 0xD17EE64E21FFDC6B,0x00004001 // C80
+data8 0x9596F7A7E36145CC,0x00004002 // C90
+data8 0xEB64DBE50E125CAF,0x00004002 // CA0
+data8 0xA090530D79E32D2E,0x000041D8 // An
+//[112; 113]
+data8 0xA33AEA22A16B2655,0x00004000 // C50
+data8 0xD682B93BD7D7945C,0x00004000 // C60
+data8 0x8FC854C6E6E30CC3,0x00004001 // C70
+data8 0xC5754D828AFFDC7A,0x00004001 // C80
+data8 0x8D41216B397139C2,0x00004002 // C90
+data8 0xDE78D746848116E5,0x00004002 // CA0
+data8 0xB8A297A2DC0630DB,0x00004244 // An
+//[128; 129]
+data8 0x99EB00F11D95E292,0x00004000 // C50
+data8 0xCB005CB911EB779A,0x00004000 // C60
+data8 0x8879AA2FDFF3A37A,0x00004001 // C70
+data8 0xBBDA538AD40CAC2C,0x00004001 // C80
+data8 0x8696D849D311B9DE,0x00004002 // C90
+data8 0xD41E1C041481199F,0x00004002 // CA0
+data8 0xEBA1A43D34EE61EE,0x000042B3 // An
+//[144; 145]
+data8 0x924F822578AA9F3D,0x00004000 // C50
+data8 0xC193FAF9D3B36960,0x00004000 // C60
+data8 0x827AE3A6B68ED0CA,0x00004001 // C70
+data8 0xB3F52A27EED23F0B,0x00004001 // C80
+data8 0x811A079FB3C94D79,0x00004002 // C90
+data8 0xCB94415470B6F8D2,0x00004002 // CA0
+data8 0x80A0260DCB3EC9AC,0x00004326 // An
+//[160; 161]
+data8 0x8BF24091E88B331D,0x00004000 // C50
+data8 0xB9ADE01187E65201,0x00004000 // C60
+data8 0xFAE4508F6E7625FE,0x00004000 // C70
+data8 0xAD516668AD6D7367,0x00004001 // C80
+data8 0xF8F5FF171154F637,0x00004001 // C90
+data8 0xC461321268990C82,0x00004002 // CA0
+data8 0xC3B693F344B0E6FE,0x0000439A // An
+//
+//[176; 177]
+data8 0x868545EB42A258ED,0x00004000 // C50
+data8 0xB2EF04ACE8BA0E6E,0x00004000 // C60
+data8 0xF247D22C22E69230,0x00004000 // C70
+data8 0xA7A1AB93E3981A90,0x00004001 // C80
+data8 0xF10951733E2C697F,0x00004001 // C90
+data8 0xBE3359BFAD128322,0x00004002 // CA0
+data8 0x8000000000000000,0x00003fff
+//
+//[160; 161] for negatives
+data8 0xA76DBD55B2E32D71,0x00003C63 // 1/An
+//
+// sin(pi*x)/pi
+data8 0xBCBC4342112F52A2,0x00003FDE // S21
+data8 0xFAFCECB86536F655,0x0000BFE3 // S19
+data8 0x87E4C97F9CF09B92,0x00003FE9 // S17
+data8 0xEA124C68E704C5CB,0x0000BFED // S15
+data8 0x9BA38CFD59C8AA1D,0x00003FF2 // S13
+data8 0x99C0B552303D5B21,0x0000BFF6 // S11
+//
+//[176; 177] for negatives
+data8 0xBA5D5869211696FF,0x00003BEC // 1/An
+//
+// sin(pi*x)/pi
+data8 0xD63402E79A853175,0x00003FF9 // S9
+data8 0xC354723906DB36BA,0x0000BFFC // S7
+data8 0xCFCE5A015E236291,0x00003FFE // S5
+data8 0xD28D3312983E9918,0x0000BFFF // S3
+//
+//
+// [1.0;1.25]
+data8 0xA405530B067ECD3C,0x0000BFFC // A15
+data8 0xF5B5413F95E1C282,0x00003FFD // A14
+data8 0xC4DED71C782F76C8,0x0000BFFE // A13
+data8 0xECF7DDDFD27C9223,0x00003FFE // A12
+data8 0xFB73D31793068463,0x0000BFFE // A11
+data8 0xFF173B7E66FD1D61,0x00003FFE // A10
+data8 0xFFA5EF3959089E94,0x0000BFFE // A9
+data8 0xFF8153BD42E71A4F,0x00003FFE // A8
+data8 0xFEF9CAEE2CB5B533,0x0000BFFE // A7
+data8 0xFE3F02E5EDB6811E,0x00003FFE // A6
+data8 0xFB64074CED2658FB,0x0000BFFE // A5
+data8 0xFB52882A095B18A4,0x00003FFE // A4
+data8 0xE8508C7990A0DAC0,0x0000BFFE // A3
+data8 0xFD32C611D8A881D0,0x00003FFE // A2
+data8 0x93C467E37DB0C536,0x0000BFFE // A1
+data8 0x8000000000000000,0x00003FFF // A0
+//
+// [1.25;1.5]
+data8 0xD038092400619677,0x0000BFF7 // A15
+data8 0xEA6DE925E6EB8C8F,0x00003FF3 // A14
+data8 0xC53F83645D4597FC,0x0000BFF7 // A13
+data8 0xE366DB2FB27B7ECD,0x00003FF7 // A12
+data8 0xAC8FD5E11F6EEAD8,0x0000BFF8 // A11
+data8 0xFB14010FB3697785,0x00003FF8 // A10
+data8 0xB6F91CB5C371177B,0x0000BFF9 // A9
+data8 0x85A262C6F8FEEF71,0x00003FFA // A8
+data8 0xC038E6E3261568F9,0x0000BFFA // A7
+data8 0x8F4BDE8883232364,0x00003FFB // A6
+data8 0xBCFBBD5786537E9A,0x0000BFFB // A5
+data8 0xA4C08BAF0A559479,0x00003FFC // A4
+data8 0x85D74FA063E81476,0x0000BFFC // A3
+data8 0xDB629FB9BBDC1C4E,0x00003FFD // A2
+data8 0xF4F8FBC7C0C9D317,0x00003FC6 // A1
+data8 0xE2B6E4153A57746C,0x00003FFE // A0
+//
+// [1.25;1.5]
+data8 0x9533F9D3723B448C,0x0000BFF2 // A15
+data8 0xF1F75D3C561CBBAF,0x00003FF5 // A14
+data8 0xBA55A9A1FC883523,0x0000BFF8 // A13
+data8 0xB5D5E9E5104FA995,0x00003FFA // A12
+data8 0xFD84F35B70CD9AE2,0x0000BFFB // A11
+data8 0x87445235F4688CC5,0x00003FFD // A10
+data8 0xE7F236EBFB9F774E,0x0000BFFD // A9
+data8 0xA6605F2721F787CE,0x00003FFE // A8
+data8 0xCF579312AD7EAD72,0x0000BFFE // A7
+data8 0xE96254A2407A5EAC,0x00003FFE // A6
+data8 0xF41312A8572ED346,0x0000BFFE // A5
+data8 0xF9535027C1B1F795,0x00003FFE // A4
+data8 0xE7E82D0C613A8DE4,0x0000BFFE // A3
+data8 0xFD23CD9741B460B8,0x00003FFE // A2
+data8 0x93C30FD9781DBA88,0x0000BFFE // A1
+data8 0xFFFFF1781FDBEE84,0x00003FFE // A0
+LOCAL_OBJECT_END(tgamma_data)
+
+
+//==============================================================
+// Code
+//==============================================================
+
+.section .text
+GLOBAL_LIBM_ENTRY(tgamma)
+{ .mfi
+ getf.exp GR_Sign_Exp = f8
+ fma.s1 FR_1m2X = f8,f1,f8 // 2x
+ addl GR_ad_Data = @ltoff(tgamma_data), gp
+}
+{ .mfi
+ mov GR_ExpOf8 = 0x10002 // 8
+ fcvt.fx.trunc.s1 FR_iXt = f8 // [x]
+ mov GR_ExpOf05 = 0xFFFE // 0.5
+};;
+{ .mfi
+ getf.sig GR_Sig = f8
+ fma.s1 FR_2 = f1,f1,f1 // 2
+ mov GR_Addr_Mask1 = 0x780
+}
+{ .mlx
+ setf.exp FR_8 = GR_ExpOf8
+ movl GR_10 = 0x4024000000000000
+};;
+{ .mfi
+ ld8 GR_ad_Data = [GR_ad_Data]
+ fcmp.lt.s1 p14,p15 = f8,f0
+ tbit.z p12,p13 = GR_Sign_Exp,0x10 // p13 if x >= 2
+}
+{ .mlx
+ and GR_Bit2 = 4,GR_Sign_Exp
+ movl GR_12 = 0x4028000000000000
+};;
+{ .mfi
+ setf.d FR_10 = GR_10
+ fma.s1 FR_r02 = f8,f1,f0
+ extr.u GR_Tbl_Offs = GR_Sig,58,6
+}
+{ .mfi
+(p12) mov GR_Addr_Mask1 = r0
+ fma.s1 FR_NormX = f8,f1,f0
+ cmp.ne p8,p0 = GR_Bit2,r0
+};;
+{ .mfi
+(p8) shladd GR_Tbl_Offs = GR_Tbl_Offs,4,r0
+ fclass.m p10,p0 = f8,0x1E7 // Test x for NaTVal, NaN, +/-0, +/-INF
+ tbit.nz p11,p0 = GR_Sign_Exp,1
+}
+{ .mlx
+ add GR_Addr_Mask2 = GR_Addr_Mask1,GR_Addr_Mask1
+ movl GR_14 = 0x402C000000000000
+};;
+.pred.rel "mutex",p14,p15
+{ .mfi
+ setf.d FR_12 = GR_12
+(p14) fma.s1 FR_1m2X = f1,f1,FR_1m2X // RB=1-2|x|
+ tbit.nz p8,p9 = GR_Sign_Exp,0
+}
+{ .mfi
+ ldfpd FR_OvfBound,FR_Xmin = [GR_ad_Data],16
+(p15) fms.s1 FR_1m2X = f1,f1,FR_1m2X // RB=1-2|x|
+(p11) shladd GR_Tbl_Offs = GR_Tbl_Offs,2,r0
+};;
+.pred.rel "mutex",p9,p8
+{ .mfi
+ setf.d FR_14 = GR_14
+ fma.s1 FR_4 = FR_2,FR_2,f0
+(p8) and GR_Tbl_Offs = GR_Tbl_Offs, GR_Addr_Mask1
+}
+{ .mfi
+ setf.exp FR_05 = GR_ExpOf05
+ fma.s1 FR_6 = FR_2,FR_2,FR_2
+(p9) and GR_Tbl_Offs = GR_Tbl_Offs, GR_Addr_Mask2
+};;
+.pred.rel "mutex",p9,p8
+{ .mfi
+(p8) shladd GR_ad_Co = GR_Tbl_Offs,1,GR_ad_Data
+ fcvt.xf FR_Xt = FR_iXt // [x]
+(p15) tbit.z.unc p11,p0 = GR_Sign_Exp,0x10 // p11 if 0 < x < 2
+}
+{ .mfi
+(p9) add GR_ad_Co = GR_ad_Data,GR_Tbl_Offs
+ fma.s1 FR_5 = FR_2,FR_2,f1
+(p15) cmp.lt.unc p7,p6 = GR_ExpOf05,GR_Sign_Exp // p7 if 0 < x < 1
+};;
+{ .mfi
+ add GR_ad_Ce = 16,GR_ad_Co
+(p11) frcpa.s1 FR_Rcp0,p0 = f1,f8
+ sub GR_Tbl_Offs = GR_ad_Co,GR_ad_Data
+}
+{ .mfb
+ ldfe FR_C01 = [GR_ad_Co],32
+(p7) fms.s1 FR_r02 = FR_r02,f1,f1
+ // jump if x is NaTVal, NaN, +/-0, +/-INF
+(p10) br.cond.spnt tgamma_spec
+};;
+.pred.rel "mutex",p14,p15
+{ .mfi
+ ldfe FR_C11 = [GR_ad_Ce],32
+(p14) fms.s1 FR_X2pX = f8,f8,f8 // RA=x^2+|x|
+ shr GR_Tbl_Ind = GR_Tbl_Offs,8
+}
+{ .mfb
+ ldfe FR_C21 = [GR_ad_Co],32
+(p15) fma.s1 FR_X2pX = f8,f8,f8 // RA=x^2+x
+ // jump if 0 < x < 2
+(p11) br.cond.spnt tgamma_from_0_to_2
+};;
+{ .mfi
+ ldfe FR_C31 = [GR_ad_Ce],32
+ fma.s1 FR_Rq2 = FR_2,f1,FR_1m2X // 2 + B
+ cmp.ltu p7,p0=0xB,GR_Tbl_Ind
+}
+{ .mfb
+ ldfe FR_C41 = [GR_ad_Co],32
+ fma.s1 FR_Rq3 = FR_2,FR_2,FR_1m2X // 4 + B
+ // jump if GR_Tbl_Ind > 11, i.e |x| is more than 192
+(p7) br.cond.spnt tgamma_spec_res
+};;
+{ .mfi
+ ldfe FR_C51 = [GR_ad_Ce],32
+ fma.s1 FR_Rq4 = FR_6,f1,FR_1m2X // 6 + B
+ shr GR_Tbl_Offs = GR_Tbl_Offs,1
+}
+{ .mfi
+ ldfe FR_C61 = [GR_ad_Co],32
+ fma.s1 FR_Rq5 = FR_4,FR_2,FR_1m2X // 8 + B
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_C71 = [GR_ad_Ce],32
+(p14) fms.s1 FR_r = FR_Xt,f1,f8 // r = |x| - [|x|]
+ shr GR_Tbl_16xInd = GR_Tbl_Offs,3
+}
+{ .mfi
+ ldfe FR_C81 = [GR_ad_Co],32
+(p15) fms.s1 FR_r = f8,f1,FR_Xt // r = x - [x]
+ add GR_ad_Data = 0xC00,GR_ad_Data
+};;
+{ .mfi
+ ldfe FR_C91 = [GR_ad_Ce],32
+ fma.s1 FR_Rq6 = FR_5,FR_2,FR_1m2X // 10 + B
+(p14) mov GR_0x30033 = 0x30033
+}
+{ .mfi
+ ldfe FR_CA1 = [GR_ad_Co],32
+ fma.s1 FR_Rq7 = FR_6,FR_2,FR_1m2X // 12 + B
+ sub GR_Tbl_Offs = GR_Tbl_Offs,GR_Tbl_16xInd
+};;
+{ .mfi
+ ldfe FR_C00 = [GR_ad_Ce],32
+ fma.s1 FR_Rq1 = FR_Rq1,FR_2,FR_X2pX // (x-1)*(x-2)
+(p13) cmp.eq.unc p8,p0 = r0,GR_Tbl_16xInd // index is 0 i.e. arg from [2;16)
+}
+{ .mfi
+ ldfe FR_C10 = [GR_ad_Co],32
+(p14) fms.s1 FR_AbsX = f0,f0,FR_NormX // absolute value of argument
+ add GR_ad_Co7 = GR_ad_Data,GR_Tbl_Offs
+};;
+{ .mfi
+ ldfe FR_C20 = [GR_ad_Ce],32
+ fma.s1 FR_Rq2 = FR_Rq2,FR_4,FR_X2pX // (x-3)*(x-4)
+ add GR_ad_Ce7 = 16,GR_ad_Co7
+}
+{ .mfi
+ ldfe FR_C30 = [GR_ad_Co],32
+ fma.s1 FR_Rq3 = FR_Rq3,FR_6,FR_X2pX // (x-5)*(x-6)
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_C40 = [GR_ad_Ce],32
+ fma.s1 FR_Rq4 = FR_Rq4,FR_8,FR_X2pX // (x-7)*(x-8)
+(p14) cmp.leu.unc p7,p0 = GR_0x30033,GR_Sign_Exp
+}
+{ .mfb
+ ldfe FR_C50 = [GR_ad_Co7],32
+ fma.s1 FR_Rq5 = FR_Rq5,FR_10,FR_X2pX // (x-9)*(x-10)
+ // jump if x is less or equal to -2^52, i.e. x is big negative integer
+(p7) br.cond.spnt tgamma_singularity
+};;
+{ .mfi
+ ldfe FR_C60 = [GR_ad_Ce7],32
+ fma.s1 FR_C01 = FR_C01,f1,FR_r
+ add GR_ad_Ce = 0x560,GR_ad_Data
+}
+{ .mfi
+ ldfe FR_C70 = [GR_ad_Co7],32
+ fma.s1 FR_rs = f0,f0,FR_r // reduced arg for sin(pi*x)
+ add GR_ad_Co = 0x550,GR_ad_Data
+};;
+{ .mfi
+ ldfe FR_C80 = [GR_ad_Ce7],32
+ fma.s1 FR_C11 = FR_C11,f1,FR_r
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_C90 = [GR_ad_Co7],32
+ fma.s1 FR_C21 = FR_C21,f1,FR_r
+ nop.i 0
+};;
+.pred.rel "mutex",p12,p13
+{ .mfi
+(p13) getf.sig GR_iSig = FR_iXt
+ fcmp.lt.s1 p11,p0 = FR_05,FR_r
+ mov GR_185 = 185
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_Rq6 = FR_Rq6,FR_12,FR_X2pX // (x-11)*(x-12)
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_CA0 = [GR_ad_Ce7],32
+ fma.s1 FR_C31 = FR_C31,f1,FR_r
+(p12) mov GR_iSig = 0
+}
+{ .mfi
+ ldfe FR_An = [GR_ad_Co7],0x80
+ fma.s1 FR_C41 = FR_C41,f1,FR_r
+ nop.i 0
+};;
+{ .mfi
+(p14) getf.sig GR_Sig = FR_r
+ fma.s1 FR_C51 = FR_C51,f1,FR_r
+(p14) sub GR_iSig = r0,GR_iSig
+}
+{ .mfi
+ ldfe FR_S21 = [GR_ad_Co],32
+ fma.s1 FR_C61 = FR_C61,f1,FR_r
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_S19 = [GR_ad_Ce],32
+ fma.s1 FR_C71 = FR_C71,f1,FR_r
+ and GR_SigRqLin = 0xF,GR_iSig
+}
+{ .mfi
+ ldfe FR_S17 = [GR_ad_Co],32
+ fma.s1 FR_C81 = FR_C81,f1,FR_r
+ mov GR_2 = 2
+};;
+{ .mfi
+(p14) ldfe FR_InvAn = [GR_ad_Co7]
+ fma.s1 FR_C91 = FR_C91,f1,FR_r
+ // if significand of r is 0 tnan argument is negative integer
+(p14) cmp.eq.unc p12,p0 = r0,GR_Sig
+}
+{ .mfb
+(p8) sub GR_SigRqLin = GR_SigRqLin,GR_2 // subtract 2 if 2 <= x < 16
+ fma.s1 FR_CA1 = FR_CA1,f1,FR_r
+ // jump if x is negative integer such that -2^52 < x < -185
+(p12) br.cond.spnt tgamma_singularity
+};;
+{ .mfi
+ setf.sig FR_Xt = GR_SigRqLin
+(p11) fms.s1 FR_rs = f1,f1,FR_r
+(p14) cmp.ltu.unc p7,p0 = GR_185,GR_iSig
+}
+{ .mfb
+ ldfe FR_S15 = [GR_ad_Ce],32
+ fma.s1 FR_Rq7 = FR_Rq7,FR_14,FR_X2pX // (x-13)*(x-14)
+ // jump if x is noninteger such that -2^52 < x < -185
+(p7) br.cond.spnt tgamma_underflow
+};;
+{ .mfi
+ ldfe FR_S13 = [GR_ad_Co],48
+ fma.s1 FR_C01 = FR_C01,FR_r,FR_C00
+ and GR_Sig2 = 0xE,GR_SigRqLin
+}
+{ .mfi
+ ldfe FR_S11 = [GR_ad_Ce],48
+ fma.s1 FR_C11 = FR_C11,FR_r,FR_C10
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_S9 = [GR_ad_Co],32
+ fma.s1 FR_C21 = FR_C21,FR_r,FR_C20
+ // should we mul by polynomial of recursion?
+ cmp.eq p13,p12 = r0,GR_SigRqLin
+}
+{ .mfi
+ ldfe FR_S7 = [GR_ad_Ce],32
+ fma.s1 FR_C31 = FR_C31,FR_r,FR_C30
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_S5 = [GR_ad_Co],32
+ fma.s1 FR_C41 = FR_C41,FR_r,FR_C40
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_S3 = [GR_ad_Ce],32
+ fma.s1 FR_C51 = FR_C51,FR_r,FR_C50
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C61 = FR_C61,FR_r,FR_C60
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C71 = FR_C71,FR_r,FR_C70
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C81 = FR_C81,FR_r,FR_C80
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C91 = FR_C91,FR_r,FR_C90
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_CA1 = FR_CA1,FR_r,FR_CA0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C01 = FR_C01,FR_C11,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C21 = FR_C21,FR_C31,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_rs2 = FR_rs,FR_rs,f0
+(p12) cmp.lt.unc p7,p0 = 2,GR_Sig2 // should mul by FR_Rq2?
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C41 = FR_C41,FR_C51,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p7) fma.s1 FR_Rq1 = FR_Rq1,FR_Rq2,f0
+(p12) cmp.lt.unc p9,p0 = 6,GR_Sig2 // should mul by FR_Rq4?
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C61 = FR_C61,FR_C71,f0
+(p15) cmp.eq p11,p0 = r0,r0
+}
+{ .mfi
+ nop.m 0
+(p9) fma.s1 FR_Rq3 = FR_Rq3,FR_Rq4,f0
+(p12) cmp.lt.unc p8,p0 = 10,GR_Sig2 // should mul by FR_Rq6?
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C81 = FR_C81,FR_C91,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p8) fma.s1 FR_Rq5 = FR_Rq5,FR_Rq6,f0
+(p14) cmp.ltu p0,p11 = 0x9,GR_Tbl_Ind
+};;
+{ .mfi
+ nop.m 0
+ fcvt.xf FR_RqLin = FR_Xt
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p11) fma.s1 FR_CA1 = FR_CA1,FR_An,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_S21 = FR_S21,FR_rs2,FR_S19
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_S17 = FR_S17,FR_rs2,FR_S15
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C01 = FR_C01,FR_C21,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_rs4 = FR_rs2,FR_rs2,f0
+(p12) cmp.lt.unc p8,p0 = 4,GR_Sig2 // should mul by FR_Rq3?
+};;
+{ .mfi
+ nop.m 0
+(p8) fma.s1 FR_Rq1 = FR_Rq1,FR_Rq3,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_S13 = FR_S13,FR_rs2,FR_S11
+(p12) cmp.lt.unc p9,p0 = 12,GR_Sig2 // should mul by FR_Rq7?
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C41 = FR_C41,FR_C61,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p9) fma.s1 FR_Rq5 = FR_Rq5,FR_Rq7,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C81 = FR_C81,FR_CA1,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_S9 = FR_S9,FR_rs2,FR_S7
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_S5 = FR_S5,FR_rs2,FR_S3
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_rs3 = FR_rs2,FR_rs,f0
+(p12) tbit.nz.unc p6,p0 = GR_SigRqLin,0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_rs8 = FR_rs4,FR_rs4,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_S21 = FR_S21,FR_rs4,FR_S17
+ mov GR_ExpOf1 = 0x2FFFF
+}
+{ .mfi
+ nop.m 0
+(p6) fms.s1 FR_RqLin = FR_AbsX,f1,FR_RqLin
+(p12) cmp.lt.unc p8,p0 = 8,GR_Sig2 // should mul by FR_Rq5?
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C01 = FR_C01,FR_C41,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p8) fma.s1 FR_Rq1 = FR_Rq1,FR_Rq5,f0
+(p14) cmp.gtu.unc p7,p0 = GR_Sign_Exp,GR_ExpOf1
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_S13 = FR_S13,FR_rs4,FR_S9
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p7) fma.s1 FR_C81 = FR_C81,FR_AbsX,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_AbsXp1 = f1,f1,FR_AbsX // |x|+1
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fcmp.lt.unc.s1 p0,p10 = FR_AbsX,FR_OvfBound // x >= overflow_boundary
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_rs7 = FR_rs4,FR_rs3,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_S5 = FR_S5,FR_rs3,FR_rs
+ nop.i 0
+};;
+{ .mib
+(p14) cmp.lt p13,p0 = r0,r0 // set p13 to 0 if x < 0
+(p12) cmp.eq.unc p8,p9 = 1,GR_SigRqLin
+(p10) br.cond.spnt tgamma_spec_res
+};;
+{ .mfi
+ getf.sig GR_Sig = FR_iXt
+(p6) fma.s1 FR_Rq1 = FR_Rq1,FR_RqLin,f0
+ // should we mul by polynomial of recursion?
+(p15) cmp.eq.unc p0,p11 = r0,GR_SigRqLin
+}
+{ .mfb
+ nop.m 0
+ fma.s1 FR_GAMMA = FR_C01,FR_C81,f0
+(p11) br.cond.spnt tgamma_positives
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_S21 = FR_S21,FR_rs8,FR_S13
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p13) fma.d.s0 f8 = FR_C01,FR_C81,f0
+(p13) br.ret.spnt b0
+};;
+.pred.rel "mutex",p8,p9
+{ .mfi
+ nop.m 0
+(p9) fma.s1 FR_GAMMA = FR_GAMMA,FR_Rq1,f0
+ tbit.z p6,p7 = GR_Sig,0 // p6 if sin<0, p7 if sin>0
+}
+{ .mfi
+ nop.m 0
+(p8) fma.s1 FR_GAMMA = FR_GAMMA,FR_RqLin,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_S21 = FR_S21,FR_rs7,FR_S5
+ nop.i 0
+};;
+.pred.rel "mutex",p6,p7
+{ .mfi
+ nop.m 0
+(p6) fnma.s1 FR_GAMMA = FR_GAMMA,FR_S21,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p7) fma.s1 FR_GAMMA = FR_GAMMA,FR_S21,f0
+ mov GR_Sig2 = 1
+};;
+{ .mfi
+ nop.m 0
+ frcpa.s1 FR_Rcp0,p0 = f1,FR_GAMMA
+ cmp.ltu p13,p0 = GR_Sign_Exp,GR_ExpOf1
+};;
+// NR method: ineration #1
+{ .mfi
+(p13) getf.exp GR_Sign_Exp = FR_AbsX
+ fnma.s1 FR_Rcp1 = FR_Rcp0,FR_GAMMA,f1 // t = 1 - r0*x
+(p13) shl GR_Sig2 = GR_Sig2,63
+};;
+{ .mfi
+(p13) getf.sig GR_Sig = FR_AbsX
+ nop.f 0
+(p13) mov GR_NzOvfBound = 0xFBFF
+};;
+{ .mfi
+(p13) cmp.ltu.unc p8,p0 = GR_Sign_Exp,GR_NzOvfBound // p8 <- overflow
+ nop.f 0
+(p13) cmp.eq.unc p9,p0 = GR_Sign_Exp,GR_NzOvfBound
+};;
+{ .mfb
+ nop.m 0
+(p13) fma.d.s0 FR_X = f1,f1,f8 // set deno & inexact flags
+(p8) br.cond.spnt tgamma_ovf_near_0 //tgamma_neg_overflow
+};;
+{ .mib
+ nop.m 0
+(p9) cmp.eq.unc p8,p0 = GR_Sig,GR_Sig2
+(p8) br.cond.spnt tgamma_ovf_near_0_boundary //tgamma_neg_overflow
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_Rcp1 = FR_Rcp0,FR_Rcp1,FR_Rcp0
+ nop.i 0
+};;
+// NR method: ineration #2
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_Rcp2 = FR_Rcp1,FR_GAMMA,f1 // t = 1 - r1*x
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_Rcp2 = FR_Rcp1,FR_Rcp2,FR_Rcp1
+ nop.i 0
+};;
+// NR method: ineration #3
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_Rcp3 = FR_Rcp2,FR_GAMMA,f1 // t = 1 - r2*x
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p13) fma.s1 FR_Rcp2 = FR_Rcp2,FR_AbsXp1,f0
+(p14) cmp.ltu p10,p11 = 0x9,GR_Tbl_Ind
+};;
+.pred.rel "mutex",p10,p11
+{ .mfi
+ nop.m 0
+(p10) fma.s1 FR_GAMMA = FR_Rcp2,FR_Rcp3,FR_Rcp2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p11) fma.d.s0 f8 = FR_Rcp2,FR_Rcp3,FR_Rcp2
+ nop.i 0
+};;
+{ .mfb
+ nop.m 0
+(p10) fma.d.s0 f8 = FR_GAMMA,FR_InvAn,f0
+ br.ret.sptk b0
+};;
+
+
+// here if x >= 3
+//--------------------------------------------------------------------
+.align 32
+tgamma_positives:
+.pred.rel "mutex",p8,p9
+{ .mfi
+ nop.m 0
+(p9) fma.d.s0 f8 = FR_GAMMA,FR_Rq1,f0
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p8) fma.d.s0 f8 = FR_GAMMA,FR_RqLin,f0
+ br.ret.sptk b0
+};;
+
+// here if 0 < x < 1
+//--------------------------------------------------------------------
+.align 32
+tgamma_from_0_to_2:
+{ .mfi
+ getf.exp GR_Sign_Exp = FR_r02
+ fms.s1 FR_r = FR_r02,f1,FR_Xmin
+ mov GR_ExpOf025 = 0xFFFD
+}
+{ .mfi
+ add GR_ad_Co = 0x1200,GR_ad_Data
+(p6) fnma.s1 FR_Rcp1 = FR_Rcp0,FR_NormX,f1 // t = 1 - r0*x
+(p6) mov GR_Sig2 = 1
+};;
+{ .mfi
+(p6) getf.sig GR_Sig = FR_NormX
+ nop.f 0
+(p6) shl GR_Sig2 = GR_Sig2,63
+}
+{ .mfi
+ add GR_ad_Ce = 0x1210,GR_ad_Data
+ nop.f 0
+(p6) mov GR_NzOvfBound = 0xFBFF
+};;
+{ .mfi
+ cmp.eq p8,p0 = GR_Sign_Exp,GR_ExpOf05 // r02 >= 1/2
+ nop.f 0
+ cmp.eq p9,p10 = GR_Sign_Exp,GR_ExpOf025 // r02 >= 1/4
+}
+{ .mfi
+(p6) cmp.ltu.unc p11,p0 = GR_Sign_Exp,GR_NzOvfBound // p11 <- overflow
+ nop.f 0
+(p6) cmp.eq.unc p12,p0 = GR_Sign_Exp,GR_NzOvfBound
+};;
+.pred.rel "mutex",p8,p9
+{ .mfi
+(p8) add GR_ad_Co = 0x200,GR_ad_Co
+(p6) fma.d.s0 FR_X = f1,f1,f8 // set deno & inexact flags
+(p9) add GR_ad_Co = 0x100,GR_ad_Co
+}
+{ .mib
+(p8) add GR_ad_Ce = 0x200,GR_ad_Ce
+(p9) add GR_ad_Ce = 0x100,GR_ad_Ce
+(p11) br.cond.spnt tgamma_ovf_near_0 //tgamma_spec_res
+};;
+{ .mfi
+ ldfe FR_A15 = [GR_ad_Co],32
+ nop.f 0
+(p12) cmp.eq.unc p13,p0 = GR_Sig,GR_Sig2
+}
+{ .mfb
+ ldfe FR_A14 = [GR_ad_Ce],32
+ nop.f 0
+(p13) br.cond.spnt tgamma_ovf_near_0_boundary //tgamma_spec_res
+};;
+{ .mfi
+ ldfe FR_A13 = [GR_ad_Co],32
+ nop.f 0
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_A12 = [GR_ad_Ce],32
+ nop.f 0
+ nop.i 0
+};;
+.pred.rel "mutex",p9,p10
+{ .mfi
+ ldfe FR_A11 = [GR_ad_Co],32
+(p10) fma.s1 FR_r2 = FR_r02,FR_r02,f0
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_A10 = [GR_ad_Ce],32
+(p9) fma.s1 FR_r2 = FR_r,FR_r,f0
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_A9 = [GR_ad_Co],32
+(p6) fma.s1 FR_Rcp1 = FR_Rcp0,FR_Rcp1,FR_Rcp0
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_A8 = [GR_ad_Ce],32
+(p10) fma.s1 FR_r = f0,f0,FR_r02
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_A7 = [GR_ad_Co],32
+ nop.f 0
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_A6 = [GR_ad_Ce],32
+ nop.f 0
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_A5 = [GR_ad_Co],32
+ nop.f 0
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_A4 = [GR_ad_Ce],32
+ nop.f 0
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_A3 = [GR_ad_Co],32
+ nop.f 0
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_A2 = [GR_ad_Ce],32
+ nop.f 0
+ nop.i 0
+};;
+{ .mfi
+ ldfe FR_A1 = [GR_ad_Co],32
+ fma.s1 FR_r4 = FR_r2,FR_r2,f0
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_A0 = [GR_ad_Ce],32
+ nop.f 0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p6) fnma.s1 FR_Rcp2 = FR_Rcp1,FR_NormX,f1 // t = 1 - r1*x
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A15 = FR_A15,FR_r,FR_A14
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A11 = FR_A11,FR_r,FR_A10
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r8 = FR_r4,FR_r4,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p6) fma.s1 FR_Rcp2 = FR_Rcp1,FR_Rcp2,FR_Rcp1
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A7 = FR_A7,FR_r,FR_A6
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A3 = FR_A3,FR_r,FR_A2
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A15 = FR_A15,FR_r,FR_A13
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A11 = FR_A11,FR_r,FR_A9
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p6) fnma.s1 FR_Rcp3 = FR_Rcp2,FR_NormX,f1 // t = 1 - r1*x
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A7 = FR_A7,FR_r,FR_A5
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A3 = FR_A3,FR_r,FR_A1
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A15 = FR_A15,FR_r,FR_A12
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A11 = FR_A11,FR_r,FR_A8
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p6) fma.s1 FR_Rcp3 = FR_Rcp2,FR_Rcp3,FR_Rcp2
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A7 = FR_A7,FR_r,FR_A4
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A3 = FR_A3,FR_r,FR_A0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A15 = FR_A15,FR_r4,FR_A11
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A7 = FR_A7,FR_r4,FR_A3
+ nop.i 0
+};;
+.pred.rel "mutex",p6,p7
+{ .mfi
+ nop.m 0
+(p6) fma.s1 FR_A15 = FR_A15,FR_r8,FR_A7
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p7) fma.d.s0 f8 = FR_A15,FR_r8,FR_A7
+ nop.i 0
+};;
+{ .mfb
+ nop.m 0
+(p6) fma.d.s0 f8 = FR_A15,FR_Rcp3,f0
+ br.ret.sptk b0
+};;
+
+// overflow
+//--------------------------------------------------------------------
+.align 32
+tgamma_ovf_near_0_boundary:
+.pred.rel "mutex",p14,p15
+{ .mfi
+ mov GR_fpsr = ar.fpsr
+ nop.f 0
+(p15) mov r8 = 0x7ff
+}
+{ .mfi
+ nop.m 0
+ nop.f 0
+(p14) mov r8 = 0xfff
+};;
+{ .mfi
+ nop.m 0
+ nop.f 0
+ shl r8 = r8,52
+};;
+{ .mfi
+ sub r8 = r8,r0,1
+ nop.f 0
+ extr.u GR_fpsr = GR_fpsr,10,2 // rounding mode
+};;
+.pred.rel "mutex",p14,p15
+{ .mfi
+ // set p8 to 0 in case of overflow and to 1 otherwise
+ // for negative arg:
+ // no overflow if rounding mode either Z or +Inf, i.e.
+ // GR_fpsr > 1
+(p14) cmp.lt p8,p0 = 1,GR_fpsr
+ nop.f 0
+ // for positive arg:
+ // no overflow if rounding mode either Z or -Inf, i.e.
+ // (GR_fpsr & 1) == 0
+(p15) tbit.z p0,p8 = GR_fpsr,0
+};;
+{ .mib
+(p8) setf.d f8 = r8 // set result to 0x7fefffffffffffff without
+ // OVERFLOW flag raising
+ nop.i 0
+(p8) br.ret.sptk b0
+};;
+.align 32
+tgamma_ovf_near_0:
+{ .mfi
+ mov r8 = 0x1FFFE
+ nop.f 0
+ nop.i 0
+};;
+{ .mfi
+ setf.exp f9 = r8
+ fmerge.s FR_X = f8,f8
+ mov GR_TAG = 258 // overflow
+};;
+.pred.rel "mutex",p14,p15
+{ .mfi
+ nop.m 0
+(p15) fma.d.s0 f8 = f9,f9,f0 // Set I,O and +INF result
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p14) fnma.d.s0 f8 = f9,f9,f0 // Set I,O and -INF result
+ br.cond.sptk tgamma_libm_err
+};;
+// overflow or absolute value of x is too big
+//--------------------------------------------------------------------
+.align 32
+tgamma_spec_res:
+{ .mfi
+ mov GR_0x30033 = 0x30033
+(p14) fcmp.eq.unc.s1 p10,p11 = f8,FR_Xt
+(p15) mov r8 = 0x1FFFE
+};;
+{ .mfi
+(p15) setf.exp f9 = r8
+ nop.f 0
+ nop.i 0
+};;
+{ .mfb
+(p11) cmp.ltu.unc p7,p8 = GR_0x30033,GR_Sign_Exp
+ nop.f 0
+(p10) br.cond.spnt tgamma_singularity
+};;
+.pred.rel "mutex",p7,p8
+{ .mbb
+ nop.m 0
+(p7) br.cond.spnt tgamma_singularity
+(p8) br.cond.spnt tgamma_underflow
+};;
+{ .mfi
+ nop.m 0
+ fmerge.s FR_X = f8,f8
+ mov GR_TAG = 258 // overflow
+}
+{ .mfb
+ nop.m 0
+(p15) fma.d.s0 f8 = f9,f9,f0 // Set I,O and +INF result
+ br.cond.sptk tgamma_libm_err
+};;
+
+// x is negative integer or +/-0
+//--------------------------------------------------------------------
+.align 32
+tgamma_singularity:
+{ .mfi
+ nop.m 0
+ fmerge.s FR_X = f8,f8
+ mov GR_TAG = 259 // negative
+}
+{ .mfb
+ nop.m 0
+ frcpa.s0 f8,p0 = f0,f0
+ br.cond.sptk tgamma_libm_err
+};;
+// x is negative noninteger with big absolute value
+//--------------------------------------------------------------------
+.align 32
+tgamma_underflow:
+{ .mmi
+ getf.sig GR_Sig = FR_iXt
+ mov r11 = 0x00001
+ nop.i 0
+};;
+{ .mfi
+ setf.exp f9 = r11
+ nop.f 0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ nop.f 0
+ tbit.z p6,p7 = GR_Sig,0
+};;
+.pred.rel "mutex",p6,p7
+{ .mfi
+ nop.m 0
+(p6) fms.d.s0 f8 = f9,f9,f9
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p7) fma.d.s0 f8 = f9,f9,f9
+ br.ret.sptk b0
+};;
+
+// x for natval, nan, +/-inf or +/-0
+//--------------------------------------------------------------------
+.align 32
+tgamma_spec:
+{ .mfi
+ nop.m 0
+ fclass.m p6,p0 = f8,0x1E1 // Test x for natval, nan, +inf
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fclass.m p7,p8 = f8,0x7 // +/-0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fmerge.s FR_X = f8,f8
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p6) fma.d.s0 f8 = f8,f1,f8
+(p6) br.ret.spnt b0
+};;
+.pred.rel "mutex",p7,p8
+{ .mfi
+(p7) mov GR_TAG = 259 // negative
+(p7) frcpa.s0 f8,p0 = f1,f8
+ nop.i 0
+}
+{ .mib
+ nop.m 0
+ nop.i 0
+(p8) br.cond.spnt tgamma_singularity
+};;
+
+.align 32
+tgamma_libm_err:
+{ .mfi
+ alloc r32 = ar.pfs,1,4,4,0
+ nop.f 0
+ mov GR_Parameter_TAG = GR_TAG
+};;
+
+GLOBAL_LIBM_END(tgamma)
+libm_alias_double_other (tgamma, tgamma)
+
+LOCAL_LIBM_ENTRY(__libm_error_region)
+.prologue
+{ .mfi
+ add GR_Parameter_Y=-32,sp // Parameter 2 value
+ nop.f 0
+.save ar.pfs,GR_SAVE_PFS
+ mov GR_SAVE_PFS=ar.pfs // Save ar.pfs
+}
+{ .mfi
+.fframe 64
+ add sp=-64,sp // Create new stack
+ nop.f 0
+ mov GR_SAVE_GP=gp // Save gp
+};;
+{ .mmi
+ stfd [GR_Parameter_Y] = FR_Y,16 // STORE Parameter 2 on stack
+ add GR_Parameter_X = 16,sp // Parameter 1 address
+.save b0, GR_SAVE_B0
+ mov GR_SAVE_B0=b0 // Save b0
+};;
+.body
+{ .mib
+ stfd [GR_Parameter_X] = FR_X // STORE Parameter 1 on stack
+ add GR_Parameter_RESULT = 0,GR_Parameter_Y // Parameter 3 address
+ nop.b 0
+}
+{ .mib
+ stfd [GR_Parameter_Y] = FR_RESULT // STORE Parameter 3 on stack
+ add GR_Parameter_Y = -16,GR_Parameter_Y
+ br.call.sptk b0=__libm_error_support# // Call error handling function
+};;
+{ .mmi
+ nop.m 0
+ nop.m 0
+ add GR_Parameter_RESULT = 48,sp
+};;
+{ .mmi
+ ldfd f8 = [GR_Parameter_RESULT] // Get return result off stack
+.restore sp
+ add sp = 64,sp // Restore stack pointer
+ mov b0 = GR_SAVE_B0 // Restore return address
+};;
+{ .mib
+ mov gp = GR_SAVE_GP // Restore gp
+ mov ar.pfs = GR_SAVE_PFS // Restore ar.pfs
+ br.ret.sptk b0 // Return
+};;
+
+LOCAL_LIBM_END(__libm_error_region)
+.type __libm_error_support#,@function
+.global __libm_error_support#
diff --git a/sysdeps/ia64/fpu/w_tgammaf.S b/sysdeps/ia64/fpu/w_tgammaf.S
deleted file mode 100644
index 0fbd840adb..0000000000
--- a/sysdeps/ia64/fpu/w_tgammaf.S
+++ /dev/null
@@ -1,1330 +0,0 @@
-.file "tgammaf.s"
-
-
-// Copyright (c) 2001 - 2005, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2001 by the Intel Numerics Group, Intel Corporation
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// * The name of Intel Corporation may not be used to endorse or promote
-// products derived from this software without specific prior written
-// permission.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING,BUT NOT
-// LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT,INCIDENTAL,SPECIAL,
-// EXEMPLARY,OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA,OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-// OF LIABILITY,WHETHER IN CONTRACT,STRICT LIABILITY OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Intel Corporation is the author of this code,and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://www.intel.com/software/products/opensource/libraries/num.htm.
-//
-//*********************************************************************
-//
-// History:
-// 11/30/01 Initial version
-// 05/20/02 Cleaned up namespace and sf0 syntax
-// 02/10/03 Reordered header: .section, .global, .proc, .align
-// 04/04/03 Changed error codes for overflow and negative integers
-// 04/10/03 Changed code for overflow near zero handling
-// 12/16/03 Fixed parameter passing to/from error handling routine
-// 03/31/05 Reformatted delimiters between data tables
-//
-//*********************************************************************
-//
-//*********************************************************************
-//
-// Function: tgammaf(x) computes the principle value of the GAMMA
-// function of x.
-//
-//*********************************************************************
-//
-// Resources Used:
-//
-// Floating-Point Registers: f8-f15
-// f33-f75
-//
-// General Purpose Registers:
-// r8-r11
-// r14-r29
-// r32-r36
-// r37-r40 (Used to pass arguments to error handling routine)
-//
-// Predicate Registers: p6-p15
-//
-//*********************************************************************
-//
-// IEEE Special Conditions:
-//
-// tgammaf(+inf) = +inf
-// tgammaf(-inf) = QNaN
-// tgammaf(+/-0) = +/-inf
-// tgammaf(x<0, x - integer) = QNaN
-// tgammaf(SNaN) = QNaN
-// tgammaf(QNaN) = QNaN
-//
-//*********************************************************************
-//
-// Overview
-//
-// The method consists of three cases.
-//
-// If 2 <= x < OVERFLOW_BOUNDARY use case tgamma_regular;
-// else if 0 < x < 2 use case tgamma_from_0_to_2;
-// else if -(i+1) < x < -i, i = 0...43 use case tgamma_negatives;
-//
-// Case 2 <= x < OVERFLOW_BOUNDARY
-// -------------------------------
-// Here we use algorithm based on the recursive formula
-// GAMMA(x+1) = x*GAMMA(x). For that we subdivide interval
-// [2; OVERFLOW_BOUNDARY] into intervals [8*n; 8*(n+1)] and
-// approximate GAMMA(x) by polynomial of 22th degree on each
-// [8*n; 8*n+1], recursive formula is used to expand GAMMA(x)
-// to [8*n; 8*n+1]. In other words we need to find n, i and r
-// such that x = 8 * n + i + r where n and i are integer numbers
-// and r is fractional part of x. So GAMMA(x) = GAMMA(8*n+i+r) =
-// = (x-1)*(x-2)*...*(x-i)*GAMMA(x-i) =
-// = (x-1)*(x-2)*...*(x-i)*GAMMA(8*n+r) ~
-// ~ (x-1)*(x-2)*...*(x-i)*P12n(r).
-//
-// Step 1: Reduction
-// -----------------
-// N = [x] with truncate
-// r = x - N, note 0 <= r < 1
-//
-// n = N & ~0xF - index of table that contains coefficient of
-// polynomial approximation
-// i = N & 0xF - is used in recursive formula
-//
-//
-// Step 2: Approximation
-// ---------------------
-// We use factorized minimax approximation polynomials
-// P12n(r) = A12*(r^2+C01(n)*r+C00(n))*
-// *(r^2+C11(n)*r+C10(n))*...*(r^2+C51(n)*r+C50(n))
-//
-// Step 3: Recursion
-// -----------------
-// In case when i > 0 we need to multiply P12n(r) by product
-// R(i,x)=(x-1)*(x-2)*...*(x-i). To reduce number of fp-instructions
-// we can calculate R as follow:
-// R(i,x) = ((x-1)*(x-2))*((x-3)*(x-4))*...*((x-(i-1))*(x-i)) if i is
-// even or R = ((x-1)*(x-2))*((x-3)*(x-4))*...*((x-(i-2))*(x-(i-1)))*
-// *(i-1) if i is odd. In both cases we need to calculate
-// R2(i,x) = (x^2-3*x+2)*(x^2-7*x+12)*...*(x^2+x+2*j*(2*j-1)) =
-// = ((x^2-x)+2*(1-x))*((x^2-x)+6*(2-x))*...*((x^2-x)+2*(2*j-1)*(j-x)) =
-// = (RA+2*RB)*(RA+6*(1-RB))*...*(RA+2*(2*j-1)*(j-1+RB))
-// where j = 1..[i/2], RA = x^2-x, RB = 1-x.
-//
-// Step 4: Reconstruction
-// ----------------------
-// Reconstruction is just simple multiplication i.e.
-// GAMMA(x) = P12n(r)*R(i,x)
-//
-// Case 0 < x < 2
-// --------------
-// To calculate GAMMA(x) on this interval we do following
-// if 1.0 <= x < 1.25 than GAMMA(x) = P7(x-1)
-// if 1.25 <= x < 1.5 than GAMMA(x) = P7(x-x_min) where
-// x_min is point of local minimum on [1; 2] interval.
-// if 1.5 <= x < 1.75 than GAMMA(x) = P7(x-1.5)
-// if 1.75 <= x < 2.0 than GAMMA(x) = P7(x-1.5)
-// and
-// if 0 < x < 1 than GAMMA(x) = GAMMA(x+1)/x
-//
-// Case -(i+1) < x < -i, i = 0...43
-// ----------------------------------
-// Here we use the fact that GAMMA(-x) = PI/(x*GAMMA(x)*sin(PI*x)) and
-// so we need to calculate GAMMA(x), sin(PI*x)/PI. Calculation of
-// GAMMA(x) is described above.
-//
-// Step 1: Reduction
-// -----------------
-// Note that period of sin(PI*x) is 2 and range reduction for
-// sin(PI*x) is like to range reduction for GAMMA(x)
-// i.e rs = x - round(x) and |rs| <= 0.5.
-//
-// Step 2: Approximation
-// ---------------------
-// To approximate sin(PI*x)/PI = sin(PI*(2*n+rs))/PI =
-// = (-1)^n*sin(PI*rs)/PI Taylor series is used.
-// sin(PI*rs)/PI ~ S17(rs).
-//
-// Step 3: Division
-// ----------------
-// To calculate 1/x and 1/(GAMMA(x)*S12(rs)) we use frcpa
-// instruction with following Newton-Raphson interations.
-//
-//
-//*********************************************************************
-
-GR_ad_Data = r8
-GR_TAG = r8
-GR_SignExp = r9
-GR_Sig = r10
-GR_ArgNz = r10
-GR_RqDeg = r11
-
-GR_NanBound = r14
-GR_ExpOf025 = r15
-GR_ExpOf05 = r16
-GR_ad_Co = r17
-GR_ad_Ce = r18
-GR_TblOffs = r19
-GR_Arg = r20
-GR_Exp2Ind = r21
-GR_TblOffsMask = r21
-GR_Offs = r22
-GR_OvfNzBound = r23
-GR_ZeroResBound = r24
-GR_ad_SinO = r25
-GR_ad_SinE = r26
-GR_Correction = r27
-GR_Tbl12Offs = r28
-GR_NzBound = r28
-GR_ExpOf1 = r29
-GR_fpsr = r29
-
-GR_SAVE_B0 = r33
-GR_SAVE_PFS = r34
-GR_SAVE_GP = r35
-GR_SAVE_SP = r36
-
-GR_Parameter_X = r37
-GR_Parameter_Y = r38
-GR_Parameter_RESULT = r39
-GR_Parameter_TAG = r40
-
-
-FR_X = f10
-FR_Y = f1
-FR_RESULT = f8
-
-FR_iXt = f11
-FR_Xt = f12
-FR_r = f13
-FR_r2 = f14
-FR_r4 = f15
-
-FR_C01 = f33
-FR_A7 = f33
-FR_C11 = f34
-FR_A6 = f34
-FR_C21 = f35
-FR_A5 = f35
-FR_C31 = f36
-FR_A4 = f36
-FR_C41 = f37
-FR_A3 = f37
-FR_C51 = f38
-FR_A2 = f38
-
-FR_C00 = f39
-FR_A1 = f39
-FR_C10 = f40
-FR_A0 = f40
-FR_C20 = f41
-FR_C30 = f42
-FR_C40 = f43
-FR_C50 = f44
-FR_An = f45
-FR_OvfBound = f46
-FR_InvAn = f47
-
-FR_Multplr = f48
-FR_NormX = f49
-FR_X2mX = f50
-FR_1mX = f51
-FR_Rq0 = f51
-FR_Rq1 = f52
-FR_Rq2 = f53
-FR_Rq3 = f54
-
-FR_Rcp0 = f55
-FR_Rcp1 = f56
-FR_Rcp2 = f57
-
-FR_InvNormX1 = f58
-FR_InvNormX2 = f59
-
-FR_rs = f60
-FR_rs2 = f61
-
-FR_LocalMin = f62
-FR_10 = f63
-
-FR_05 = f64
-
-FR_S32 = f65
-FR_S31 = f66
-FR_S01 = f67
-FR_S11 = f68
-FR_S21 = f69
-FR_S00 = f70
-FR_S10 = f71
-FR_S20 = f72
-
-FR_GAMMA = f73
-FR_2 = f74
-FR_6 = f75
-
-
-
-
-// Data tables
-//==============================================================
-RODATA
-.align 16
-LOCAL_OBJECT_START(tgammaf_data)
-data8 0x3FDD8B618D5AF8FE // local minimum (0.461632144968362356785)
-data8 0x4024000000000000 // 10.0
-data8 0x3E90FC992FF39E13 // S32
-data8 0xBEC144B2760626E2 // S31
-//
-//[2; 8)
-data8 0x4009EFD1BA0CB3B4 // C01
-data8 0x3FFFB35378FF4822 // C11
-data8 0xC01032270413B896 // C41
-data8 0xC01F171A4C0D6827 // C51
-data8 0x40148F8E197396AC // C20
-data8 0x401C601959F1249C // C30
-data8 0x3EE21AD881741977 // An
-data8 0x4041852200000000 // overflow boundary (35.04010009765625)
-data8 0x3FD9CE68F695B198 // C21
-data8 0xBFF8C30AC900DA03 // C31
-data8 0x400E17D2F0535C02 // C00
-data8 0x4010689240F7FAC8 // C10
-data8 0x402563147DDCCF8D // C40
-data8 0x4033406D0480A21C // C50
-//
-//[8; 16)
-data8 0x4006222BAE0B793B // C01
-data8 0x4002452733473EDA // C11
-data8 0xC0010EF3326FDDB3 // C41
-data8 0xC01492B817F99C0F // C51
-data8 0x40099C905A249B75 // C20
-data8 0x4012B972AE0E533D // C30
-data8 0x3FE6F6DB91D0D4CC // An
-data8 0x4041852200000000 // overflow boundary
-data8 0x3FF545828F7B73C5 // C21
-data8 0xBFBBD210578764DF // C31
-data8 0x4000542098F53CFC // C00
-data8 0x40032C1309AD6C81 // C10
-data8 0x401D7331E19BD2E1 // C40
-data8 0x402A06807295EF57 // C50
-//
-//[16; 24)
-data8 0x4000131002867596 // C01
-data8 0x3FFAA362D5D1B6F2 // C11
-data8 0xBFFCB6985697DB6D // C41
-data8 0xC0115BEE3BFC3B3B // C51
-data8 0x3FFE62FF83456F73 // C20
-data8 0x4007E33478A114C4 // C30
-data8 0x41E9B2B73795ED57 // An
-data8 0x4041852200000000 // overflow boundary
-data8 0x3FEEB1F345BC2769 // C21
-data8 0xBFC3BBE6E7F3316F // C31
-data8 0x3FF14E07DA5E9983 // C00
-data8 0x3FF53B76BF81E2C0 // C10
-data8 0x4014051E0269A3DC // C40
-data8 0x40229D4227468EDB // C50
-//
-//[24; 32)
-data8 0x3FFAF7BD498384DE // C01
-data8 0x3FF62AD8B4D1C3D2 // C11
-data8 0xBFFABCADCD004C32 // C41
-data8 0xC00FADE97C097EC9 // C51
-data8 0x3FF6DA9ED737707E // C20
-data8 0x4002A29E9E0C782C // C30
-data8 0x44329D5B5167C6C3 // An
-data8 0x4041852200000000 // overflow boundary
-data8 0x3FE8943CBBB4B727 // C21
-data8 0xBFCB39D466E11756 // C31
-data8 0x3FE879AF3243D8C1 // C00
-data8 0x3FEEC7DEBB14CE1E // C10
-data8 0x401017B79BA80BCB // C40
-data8 0x401E941DC3C4DE80 // C50
-//
-//[32; 40)
-data8 0x3FF7ECB3A0E8FE5C // C01
-data8 0x3FF3815A8516316B // C11
-data8 0xBFF9ABD8FCC000C3 // C41
-data8 0xC00DD89969A4195B // C51
-data8 0x3FF2E43139CBF563 // C20
-data8 0x3FFF96DC3474A606 // C30
-data8 0x46AFF4CA9B0DDDF0 // An
-data8 0x4041852200000000 // overflow boundary
-data8 0x3FE4CE76DA1B5783 // C21
-data8 0xBFD0524DB460BC4E // C31
-data8 0x3FE35852DF14E200 // C00
-data8 0x3FE8C7610359F642 // C10
-data8 0x400BCF750EC16173 // C40
-data8 0x401AC14E02EA701C // C50
-//
-//[40; 48)
-data8 0x3FF5DCE4D8193097 // C01
-data8 0x3FF1B0D8C4974FFA // C11
-data8 0xBFF8FB450194CAEA // C41
-data8 0xC00C9658E030A6C4 // C51
-data8 0x3FF068851118AB46 // C20
-data8 0x3FFBF7C7BB46BF7D // C30
-data8 0x3FF0000000000000 // An
-data8 0x4041852200000000 // overflow boundary
-data8 0x3FE231DEB11D847A // C21
-data8 0xBFD251ECAFD7E935 // C31
-data8 0x3FE0368AE288F6BF // C00
-data8 0x3FE513AE4215A70C // C10
-data8 0x4008F960F7141B8B // C40
-data8 0x40183BA08134397B // C50
-//
-//[1.0; 1.25)
-data8 0xBFD9909648921868 // A7
-data8 0x3FE96FFEEEA8520F // A6
-data8 0xBFED0800D93449B8 // A3
-data8 0x3FEFA648D144911C // A2
-data8 0xBFEE3720F7720B4D // A5
-data8 0x3FEF4857A010CA3B // A4
-data8 0xBFE2788CCD545AA4 // A1
-data8 0x3FEFFFFFFFE9209E // A0
-//
-//[1.25; 1.5)
-data8 0xBFB421236426936C // A7
-data8 0x3FAF237514F36691 // A6
-data8 0xBFC0BADE710A10B9 // A3
-data8 0x3FDB6C5465BBEF1F // A2
-data8 0xBFB7E7F83A546EBE // A5
-data8 0x3FC496A01A545163 // A4
-data8 0xBDEE86A39D8452EB // A1
-data8 0x3FEC56DC82A39AA2 // A0
-//
-//[1.5; 1.75)
-data8 0xBF94730B51795867 // A7
-data8 0x3FBF4203E3816C7B // A6
-data8 0xBFE85B427DBD23E4 // A3
-data8 0x3FEE65557AB26771 // A2
-data8 0xBFD59D31BE3AB42A // A5
-data8 0x3FE3C90CC8F09147 // A4
-data8 0xBFE245971DF735B8 // A1
-data8 0x3FEFFC613AE7FBC8 // A0
-//
-//[1.75; 2.0)
-data8 0xBF7746A85137617E // A7
-data8 0x3FA96E37D09735F3 // A6
-data8 0xBFE3C24AC40AC0BB // A3
-data8 0x3FEC56A80A977CA5 // A2
-data8 0xBFC6F0E707560916 // A5
-data8 0x3FDB262D949175BE // A4
-data8 0xBFE1C1AEDFB25495 // A1
-data8 0x3FEFEE1E644B2022 // A0
-//
-// sin(pi*x)/pi
-data8 0xC026FB0D377656CC // S01
-data8 0x3FFFB15F95A22324 // S11
-data8 0x406CE58F4A41C6E7 // S10
-data8 0x404453786302C61E // S20
-data8 0xC023D59A47DBFCD3 // S21
-data8 0x405541D7ABECEFCA // S00
-//
-// 1/An for [40; 48)
-data8 0xCAA7576DE621FCD5, 0x3F68
-LOCAL_OBJECT_END(tgammaf_data)
-
-//==============================================================
-// Code
-//==============================================================
-
-.section .text
-GLOBAL_LIBM_ENTRY(tgammaf)
-{ .mfi
- getf.exp GR_SignExp = f8
- fma.s1 FR_NormX = f8,f1,f0
- addl GR_ad_Data = @ltoff(tgammaf_data), gp
-}
-{ .mfi
- mov GR_ExpOf05 = 0xFFFE
- fcvt.fx.trunc.s1 FR_iXt = f8 // [x]
- mov GR_Offs = 0 // 2 <= x < 8
-};;
-{ .mfi
- getf.d GR_Arg = f8
- fcmp.lt.s1 p14,p15 = f8,f0
- mov GR_Tbl12Offs = 0
-}
-{ .mfi
- setf.exp FR_05 = GR_ExpOf05
- fma.s1 FR_2 = f1,f1,f1 // 2
- mov GR_Correction = 0
-};;
-{ .mfi
- ld8 GR_ad_Data = [GR_ad_Data]
- fclass.m p10,p0 = f8,0x1E7 // is x NaTVal, NaN, +/-0 or +/-INF?
- tbit.z p12,p13 = GR_SignExp,16 // p13 if |x| >= 2
-}
-{ .mfi
- mov GR_ExpOf1 = 0xFFFF
- fcvt.fx.s1 FR_rs = f8 // round(x)
- and GR_Exp2Ind = 7,GR_SignExp
-};;
-.pred.rel "mutex",p14,p15
-{ .mfi
-(p15) cmp.eq.unc p11,p0 = GR_ExpOf1,GR_SignExp // p11 if 1 <= x < 2
-(p14) fma.s1 FR_1mX = f1,f1,f8 // 1 - |x|
- mov GR_Sig = 0 // if |x| < 2
-}
-{ .mfi
-(p13) cmp.eq.unc p7,p0 = 2,GR_Exp2Ind
-(p15) fms.s1 FR_1mX = f1,f1,f8 // 1 - |x|
-(p13) cmp.eq.unc p8,p0 = 3,GR_Exp2Ind
-};;
-.pred.rel "mutex",p7,p8
-{ .mfi
-(p7) mov GR_Offs = 0x7 // 8 <= |x| < 16
- nop.f 0
-(p8) tbit.z.unc p0,p6 = GR_Arg,51
-}
-{ .mib
-(p13) cmp.lt.unc p9,p0 = 3,GR_Exp2Ind
-(p8) mov GR_Offs = 0xE // 16 <= |x| < 32
- // jump if x is NaTVal, NaN, +/-0 or +/-INF?
-(p10) br.cond.spnt tgammaf_spec_args
-};;
-.pred.rel "mutex",p14,p15
-.pred.rel "mutex",p6,p9
-{ .mfi
-(p9) mov GR_Offs = 0x1C // 32 <= |x|
-(p14) fma.s1 FR_X2mX = FR_NormX,FR_NormX,FR_NormX // x^2-|x|
-(p9) tbit.z.unc p0,p8 = GR_Arg,50
-}
-{ .mfi
- ldfpd FR_LocalMin,FR_10 = [GR_ad_Data],16
-(p15) fms.s1 FR_X2mX = FR_NormX,FR_NormX,FR_NormX // x^2-|x|
-(p6) add GR_Offs = 0x7,GR_Offs // 24 <= x < 32
-};;
-.pred.rel "mutex",p8,p12
-{ .mfi
- add GR_ad_Ce = 0x50,GR_ad_Data
-(p15) fcmp.lt.unc.s1 p10,p0 = f8,f1 // p10 if 0 <= x < 1
- mov GR_OvfNzBound = 2
-}
-{ .mib
- ldfpd FR_S32,FR_S31 = [GR_ad_Data],16
-(p8) add GR_Offs = 0x7,GR_Offs // 40 <= |x|
- // jump if 1 <= x < 2
-(p11) br.cond.spnt tgammaf_from_1_to_2
-};;
-{ .mfi
- shladd GR_ad_Ce = GR_Offs,4,GR_ad_Ce
- fcvt.xf FR_Xt = FR_iXt // [x]
-(p13) cmp.eq.unc p7,p0 = r0,GR_Offs // p7 if 2 <= |x| < 8
-}
-{ .mfi
- shladd GR_ad_Co = GR_Offs,4,GR_ad_Data
- fma.s1 FR_6 = FR_2,FR_2,FR_2
- mov GR_ExpOf05 = 0x7FC
-};;
-{ .mfi
-(p13) getf.sig GR_Sig = FR_iXt // if |x| >= 2
- frcpa.s1 FR_Rcp0,p0 = f1,FR_NormX
-(p10) shr GR_Arg = GR_Arg,51
-}
-{ .mib
- ldfpd FR_C01,FR_C11 = [GR_ad_Co],16
-(p7) mov GR_Correction = 2
- // jump if 0 < x < 1
-(p10) br.cond.spnt tgammaf_from_0_to_1
-};;
-{ .mfi
- ldfpd FR_C21,FR_C31 = [GR_ad_Ce],16
- fma.s1 FR_Rq2 = f1,f1,FR_1mX // 2 - |x|
-(p14) sub GR_Correction = r0,GR_Correction
-}
-{ .mfi
- ldfpd FR_C41,FR_C51 = [GR_ad_Co],16
-(p14) fcvt.xf FR_rs = FR_rs
-(p14) add GR_ad_SinO = 0x3A0,GR_ad_Data
-};;
-.pred.rel "mutex",p14,p15
-{ .mfi
- ldfpd FR_C00,FR_C10 = [GR_ad_Ce],16
- nop.f 0
-(p14) sub GR_Sig = GR_Correction,GR_Sig
-}
-{ .mfi
- ldfpd FR_C20,FR_C30 = [GR_ad_Co],16
- fma.s1 FR_Rq1 = FR_1mX,FR_2,FR_X2mX // (x-1)*(x-2)
-(p15) sub GR_Sig = GR_Sig,GR_Correction
-};;
-{ .mfi
-(p14) ldfpd FR_S01,FR_S11 = [GR_ad_SinO],16
- fma.s1 FR_Rq3 = FR_2,f1,FR_1mX // 3 - |x|
- and GR_RqDeg = 0x6,GR_Sig
-}
-{ .mfi
- ldfpd FR_C40,FR_C50 = [GR_ad_Ce],16
-(p14) fma.d.s0 FR_X = f0,f0,f8 // set deno flag
- mov GR_NanBound = 0x30016 // -2^23
-};;
-.pred.rel "mutex",p14,p15
-{ .mfi
-(p14) add GR_ad_SinE = 0x3C0,GR_ad_Data
-(p15) fms.s1 FR_r = FR_NormX,f1,FR_Xt // r = x - [x]
- cmp.eq p8,p0 = 2,GR_RqDeg
-}
-{ .mfi
- ldfpd FR_An,FR_OvfBound = [GR_ad_Co]
-(p14) fms.s1 FR_r = FR_Xt,f1,FR_NormX // r = |x - [x]|
- cmp.eq p9,p0 = 4,GR_RqDeg
-};;
-.pred.rel "mutex",p8,p9
-{ .mfi
-(p14) ldfpd FR_S21,FR_S00 = [GR_ad_SinE],16
-(p8) fma.s1 FR_Rq0 = FR_2,f1,FR_1mX // (3-x)
- tbit.z p0,p6 = GR_Sig,0
-}
-{ .mfi
-(p14) ldfpd FR_S10,FR_S20 = [GR_ad_SinO],16
-(p9) fma.s1 FR_Rq0 = FR_2,FR_2,FR_1mX // (5-x)
- cmp.eq p10,p0 = 6,GR_RqDeg
-};;
-{ .mfi
-(p14) getf.s GR_Arg = f8
-(p14) fcmp.eq.unc.s1 p13,p0 = FR_NormX,FR_Xt
-(p14) mov GR_ZeroResBound = 0xC22C // -43
-}
-{ .mfi
-(p14) ldfe FR_InvAn = [GR_ad_SinE]
-(p10) fma.s1 FR_Rq0 = FR_6,f1,FR_1mX // (7-x)
- cmp.eq p7,p0 = r0,GR_RqDeg
-};;
-{ .mfi
-(p14) cmp.ge.unc p11,p0 = GR_SignExp,GR_NanBound
- fma.s1 FR_Rq2 = FR_Rq2,FR_6,FR_X2mX // (x-3)*(x-4)
-(p14) shl GR_ZeroResBound = GR_ZeroResBound,16
-}
-{ .mfb
-(p14) mov GR_OvfNzBound = 0x802
-(p14) fms.s1 FR_rs = FR_rs,f1,FR_NormX // rs = round(x) - x
- // jump if x < -2^23 i.e. x is negative integer
-(p11) br.cond.spnt tgammaf_singularity
-};;
-{ .mfi
- nop.m 0
-(p7) fma.s1 FR_Rq1 = f0,f0,f1
-(p14) shl GR_OvfNzBound = GR_OvfNzBound,20
-}
-{ .mfb
- nop.m 0
- fma.s1 FR_Rq3 = FR_Rq3,FR_10,FR_X2mX // (x-5)*(x-6)
- // jump if x is negative integer such that -2^23 < x < 0
-(p13) br.cond.spnt tgammaf_singularity
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C01 = FR_C01,f1,FR_r
-(p14) mov GR_ExpOf05 = 0xFFFE
-}
-{ .mfi
-(p14) cmp.eq.unc p7,p0 = GR_Arg,GR_OvfNzBound
- fma.s1 FR_C11 = FR_C11,f1,FR_r
-(p14) cmp.ltu.unc p11,p0 = GR_Arg,GR_OvfNzBound
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C21 = FR_C21,f1,FR_r
-(p14) cmp.ltu.unc p9,p0 = GR_ZeroResBound,GR_Arg
-}
-{ .mfb
- nop.m 0
- fma.s1 FR_C31 = FR_C31,f1,FR_r
- // jump if argument is close to 0 negative
-(p11) br.cond.spnt tgammaf_overflow
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C41 = FR_C41,f1,FR_r
- nop.i 0
-}
-{ .mfb
- nop.m 0
- fma.s1 FR_C51 = FR_C51,f1,FR_r
- // jump if x is negative noninteger such that -2^23 < x < -43
-(p9) br.cond.spnt tgammaf_underflow
-};;
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_rs2 = FR_rs,FR_rs,f0
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p14) fma.s1 FR_S01 = FR_rs,FR_rs,FR_S01
- // jump if argument is 0x80200000
-(p7) br.cond.spnt tgammaf_overflow_near0_bound
-};;
-{ .mfi
- nop.m 0
-(p6) fnma.s1 FR_Rq1 = FR_Rq1,FR_Rq0,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p10) fma.s1 FR_Rq2 = FR_Rq2,FR_Rq3,f0
- and GR_Sig = 0x7,GR_Sig
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C01 = FR_C01,FR_r,FR_C00
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_C11 = FR_C11,FR_r,FR_C10
- cmp.eq p6,p7 = r0,GR_Sig // p6 if |x| from one of base intervals
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C21 = FR_C21,FR_r,FR_C20
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_C31 = FR_C31,FR_r,FR_C30
-(p7) cmp.lt.unc p9,p0 = 2,GR_RqDeg
-};;
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_S11 = FR_rs,FR_rs,FR_S11
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_S21 = FR_rs,FR_rs,FR_S21
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C41 = FR_C41,FR_r,FR_C40
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_S32 = FR_rs2,FR_S32,FR_S31
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p9) fma.s1 FR_Rq1 = FR_Rq1,FR_Rq2,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_C51 = FR_C51,FR_r,FR_C50
- nop.i 0
-};;
-{ .mfi
-(p14) getf.exp GR_SignExp = FR_rs
- fma.s1 FR_C01 = FR_C01,FR_C11,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_S01 = FR_S01,FR_rs2,FR_S00
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C21 = FR_C21,FR_C31,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- // NR-iteration
-(p14) fnma.s1 FR_InvNormX1 = FR_Rcp0,FR_NormX,f1
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_S11 = FR_S11,FR_rs2,FR_S10
-(p14) tbit.z.unc p11,p12 = GR_SignExp,17
-}
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_S21 = FR_S21,FR_rs2,FR_S20
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p15) fcmp.lt.unc.s1 p0,p13 = FR_NormX,FR_OvfBound
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_S32 = FR_rs2,FR_S32,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_C41 = FR_C41,FR_C51,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p7) fma.s1 FR_An = FR_Rq1,FR_An,f0
- nop.i 0
-};;
-{ .mfb
- nop.m 0
- nop.f 0
- // jump if x > 35.04010009765625
-(p13) br.cond.spnt tgammaf_overflow
-};;
-{ .mfi
- nop.m 0
- // NR-iteration
-(p14) fma.s1 FR_InvNormX1 = FR_Rcp0,FR_InvNormX1,FR_Rcp0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_S01 = FR_S01,FR_S11,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_S21 = FR_S21,FR_S32,f0
- nop.i 0
-};;
-{ .mfi
-(p14) getf.exp GR_SignExp = FR_NormX
- fma.s1 FR_C01 = FR_C01,FR_C21,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_C41 = FR_C41,FR_An,f0
-(p14) mov GR_ExpOf1 = 0x2FFFF
-};;
-{ .mfi
- nop.m 0
- // NR-iteration
-(p14) fnma.s1 FR_InvNormX2 = FR_InvNormX1,FR_NormX,f1
- nop.i 0
-};;
-.pred.rel "mutex",p11,p12
-{ .mfi
- nop.m 0
-(p12) fnma.s1 FR_S01 = FR_S01,FR_S21,f0
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p11) fma.s1 FR_S01 = FR_S01,FR_S21,f0
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_GAMMA = FR_C01,FR_C41,f0
-(p14) tbit.z.unc p6,p7 = GR_Sig,0
-}
-{ .mfb
- nop.m 0
-(p15) fma.s.s0 f8 = FR_C01,FR_C41,f0
-(p15) br.ret.spnt b0 // exit for positives
-};;
-.pred.rel "mutex",p11,p12
-{ .mfi
- nop.m 0
-(p12) fms.s1 FR_S01 = FR_rs,FR_S01,FR_rs
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p11) fma.s1 FR_S01 = FR_rs,FR_S01,FR_rs
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- // NR-iteration
- fma.s1 FR_InvNormX2 = FR_InvNormX1,FR_InvNormX2,FR_InvNormX1
- cmp.eq p10,p0 = 0x23,GR_Offs
-};;
-.pred.rel "mutex",p6,p7
-{ .mfi
- nop.m 0
-(p6) fma.s1 FR_GAMMA = FR_S01,FR_GAMMA,f0
- cmp.gtu p8,p0 = GR_SignExp,GR_ExpOf1
-}
-{ .mfi
- nop.m 0
-(p7) fnma.s1 FR_GAMMA = FR_S01,FR_GAMMA,f0
- cmp.eq p9,p0 = GR_SignExp,GR_ExpOf1
-};;
-{ .mfi
- nop.m 0
- // NR-iteration
- fnma.s1 FR_InvNormX1 = FR_InvNormX2,FR_NormX,f1
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p10) fma.s1 FR_InvNormX2 = FR_InvNormX2,FR_InvAn,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- frcpa.s1 FR_Rcp0,p0 = f1,FR_GAMMA
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fms.s1 FR_Multplr = FR_NormX,f1,f1 // x - 1
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- // NR-iteration
- fnma.s1 FR_Rcp1 = FR_Rcp0,FR_GAMMA,f1
- nop.i 0
-};;
-.pred.rel "mutex",p8,p9
-{ .mfi
- nop.m 0
- // 1/x or 1/(An*x)
-(p8) fma.s1 FR_Multplr = FR_InvNormX2,FR_InvNormX1,FR_InvNormX2
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p9) fma.s1 FR_Multplr = f1,f1,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- // NR-iteration
- fma.s1 FR_Rcp1 = FR_Rcp0,FR_Rcp1,FR_Rcp0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- // NR-iteration
- fnma.s1 FR_Rcp2 = FR_Rcp1,FR_GAMMA,f1
- nop.i 0
-}
-{ .mfi
- nop.m 0
- // NR-iteration
- fma.s1 FR_Rcp1 = FR_Rcp1,FR_Multplr,f0
- nop.i 0
-};;
-{ .mfb
- nop.m 0
- fma.s.s0 f8 = FR_Rcp1,FR_Rcp2,FR_Rcp1
- br.ret.sptk b0
-};;
-
-// here if 0 < x < 1
-//--------------------------------------------------------------------
-.align 32
-tgammaf_from_0_to_1:
-{ .mfi
- cmp.lt p7,p0 = GR_Arg,GR_ExpOf05
- // NR-iteration
- fnma.s1 FR_Rcp1 = FR_Rcp0,FR_NormX,f1
- cmp.eq p8,p0 = GR_Arg,GR_ExpOf05
-}
-{ .mfi
- cmp.gt p9,p0 = GR_Arg,GR_ExpOf05
- fma.s1 FR_r = f0,f0,FR_NormX // reduced arg for (0;1)
- mov GR_ExpOf025 = 0x7FA
-};;
-{ .mfi
- getf.s GR_ArgNz = f8
- fma.d.s0 FR_X = f0,f0,f8 // set deno flag
- shl GR_OvfNzBound = GR_OvfNzBound,20
-}
-{ .mfi
-(p8) mov GR_Tbl12Offs = 0x80 // 0.5 <= x < 0.75
- nop.f 0
-(p7) cmp.ge.unc p6,p0 = GR_Arg,GR_ExpOf025
-};;
-.pred.rel "mutex",p6,p9
-{ .mfi
-(p9) mov GR_Tbl12Offs = 0xC0 // 0.75 <= x < 1
- nop.f 0
-(p6) mov GR_Tbl12Offs = 0x40 // 0.25 <= x < 0.5
-}
-{ .mfi
- add GR_ad_Ce = 0x2C0,GR_ad_Data
- nop.f 0
- add GR_ad_Co = 0x2A0,GR_ad_Data
-};;
-{ .mfi
- add GR_ad_Co = GR_ad_Co,GR_Tbl12Offs
- nop.f 0
- cmp.lt p12,p0 = GR_ArgNz,GR_OvfNzBound
-}
-{ .mib
- add GR_ad_Ce = GR_ad_Ce,GR_Tbl12Offs
- cmp.eq p7,p0 = GR_ArgNz,GR_OvfNzBound
- // jump if argument is 0x00200000
-(p7) br.cond.spnt tgammaf_overflow_near0_bound
-};;
-{ .mmb
- ldfpd FR_A7,FR_A6 = [GR_ad_Co],16
- ldfpd FR_A5,FR_A4 = [GR_ad_Ce],16
- // jump if argument is close to 0 positive
-(p12) br.cond.spnt tgammaf_overflow
-};;
-{ .mfi
- ldfpd FR_A3,FR_A2 = [GR_ad_Co],16
- // NR-iteration
- fma.s1 FR_Rcp1 = FR_Rcp0,FR_Rcp1,FR_Rcp0
- nop.i 0
-}
-{ .mfb
- ldfpd FR_A1,FR_A0 = [GR_ad_Ce],16
- nop.f 0
- br.cond.sptk tgamma_from_0_to_2
-};;
-
-// here if 1 < x < 2
-//--------------------------------------------------------------------
-.align 32
-tgammaf_from_1_to_2:
-{ .mfi
- add GR_ad_Co = 0x2A0,GR_ad_Data
- fms.s1 FR_r = f0,f0,FR_1mX
- shr GR_TblOffs = GR_Arg,47
-}
-{ .mfi
- add GR_ad_Ce = 0x2C0,GR_ad_Data
- nop.f 0
- mov GR_TblOffsMask = 0x18
-};;
-{ .mfi
- nop.m 0
- nop.f 0
- and GR_TblOffs = GR_TblOffs,GR_TblOffsMask
-};;
-{ .mfi
- shladd GR_ad_Co = GR_TblOffs,3,GR_ad_Co
- nop.f 0
- nop.i 0
-}
-{ .mfi
- shladd GR_ad_Ce = GR_TblOffs,3,GR_ad_Ce
- nop.f 0
- cmp.eq p6,p7 = 8,GR_TblOffs
-};;
-{ .mmi
- ldfpd FR_A7,FR_A6 = [GR_ad_Co],16
- ldfpd FR_A5,FR_A4 = [GR_ad_Ce],16
- nop.i 0
-};;
-{ .mmi
- ldfpd FR_A3,FR_A2 = [GR_ad_Co],16
- ldfpd FR_A1,FR_A0 = [GR_ad_Ce],16
- nop.i 0
-};;
-
-.align 32
-tgamma_from_0_to_2:
-{ .mfi
- nop.m 0
-(p6) fms.s1 FR_r = FR_r,f1,FR_LocalMin
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- // NR-iteration
-(p10) fnma.s1 FR_Rcp2 = FR_Rcp1,FR_NormX,f1
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fms.s1 FR_r2 = FR_r,FR_r,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A7 = FR_A7,FR_r,FR_A6
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_A5 = FR_A5,FR_r,FR_A4
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A3 = FR_A3,FR_r,FR_A2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_A1 = FR_A1,FR_r,FR_A0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- // NR-iteration
-(p10) fma.s1 FR_Rcp2 = FR_Rcp1,FR_Rcp2,FR_Rcp1
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A7 = FR_A7,FR_r2,FR_A5
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r4 = FR_r2,FR_r2,f0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fma.s1 FR_A3 = FR_A3,FR_r2,FR_A1
- nop.i 0
-};;
-{ .mfi
- nop.m 0
-(p10) fma.s1 FR_GAMMA = FR_A7,FR_r4,FR_A3
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p11) fma.s.s0 f8 = FR_A7,FR_r4,FR_A3
- nop.i 0
-};;
-{ .mfb
- nop.m 0
-(p10) fma.s.s0 f8 = FR_GAMMA,FR_Rcp2,f0
- br.ret.sptk b0
-};;
-
-
-// overflow
-//--------------------------------------------------------------------
-.align 32
-tgammaf_overflow_near0_bound:
-.pred.rel "mutex",p14,p15
-{ .mfi
- mov GR_fpsr = ar.fpsr
- nop.f 0
-(p15) mov r8 = 0x7f8
-}
-{ .mfi
- nop.m 0
- nop.f 0
-(p14) mov r8 = 0xff8
-};;
-{ .mfi
- nop.m 0
- nop.f 0
- shl r8 = r8,20
-};;
-{ .mfi
- sub r8 = r8,r0,1
- nop.f 0
- extr.u GR_fpsr = GR_fpsr,10,2 // rounding mode
-};;
-.pred.rel "mutex",p14,p15
-{ .mfi
- // set p8 to 0 in case of overflow and to 1 otherwise
- // for negative arg:
- // no overflow if rounding mode either Z or +Inf, i.e.
- // GR_fpsr > 1
-(p14) cmp.lt p8,p0 = 1,GR_fpsr
- nop.f 0
- // for positive arg:
- // no overflow if rounding mode either Z or -Inf, i.e.
- // (GR_fpsr & 1) == 0
-(p15) tbit.z p0,p8 = GR_fpsr,0
-};;
-{ .mib
-(p8) setf.s f8 = r8 // set result to 0x7f7fffff without
- // OVERFLOW flag raising
- nop.i 0
-(p8) br.ret.sptk b0
-};;
-
-.align 32
-tgammaf_overflow:
-{ .mfi
- nop.m 0
- nop.f 0
- mov r8 = 0x1FFFE
-};;
-{ .mfi
- setf.exp f9 = r8
- fmerge.s FR_X = f8,f8
- nop.i 0
-};;
-.pred.rel "mutex",p14,p15
-{ .mfi
- nop.m 0
-(p14) fnma.s.s0 f8 = f9,f9,f0 // set I,O and -INF result
- mov GR_TAG = 261 // overflow
-}
-{ .mfb
- nop.m 0
-(p15) fma.s.s0 f8 = f9,f9,f0 // set I,O and +INF result
- br.cond.sptk tgammaf_libm_err
-};;
-
-// x is negative integer or +/-0
-//--------------------------------------------------------------------
-.align 32
-tgammaf_singularity:
-{ .mfi
- nop.m 0
- fmerge.s FR_X = f8,f8
- mov GR_TAG = 262 // negative
-}
-{ .mfb
- nop.m 0
- frcpa.s0 f8,p0 = f0,f0
- br.cond.sptk tgammaf_libm_err
-};;
-// x is negative noninteger with big absolute value
-//--------------------------------------------------------------------
-.align 32
-tgammaf_underflow:
-{ .mfi
- mov r8 = 0x00001
- nop.f 0
- tbit.z p6,p7 = GR_Sig,0
-};;
-{ .mfi
- setf.exp f9 = r8
- nop.f 0
- nop.i 0
-};;
-.pred.rel "mutex",p6,p7
-{ .mfi
- nop.m 0
-(p6) fms.s.s0 f8 = f9,f9,f9
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p7) fma.s.s0 f8 = f9,f9,f9
- br.ret.sptk b0
-};;
-
-// x for natval, nan, +/-inf or +/-0
-//--------------------------------------------------------------------
-.align 32
-tgammaf_spec_args:
-{ .mfi
- nop.m 0
- fclass.m p6,p0 = f8,0x1E1 // Test x for natval, nan, +inf
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fclass.m p7,p8 = f8,0x7 // +/-0
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fmerge.s FR_X = f8,f8
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p6) fma.s.s0 f8 = f8,f1,f8
-(p6) br.ret.spnt b0
-};;
-.pred.rel "mutex",p7,p8
-{ .mfi
-(p7) mov GR_TAG = 262 // negative
-(p7) frcpa.s0 f8,p0 = f1,f8
- nop.i 0
-}
-{ .mib
- nop.m 0
- nop.i 0
-(p8) br.cond.spnt tgammaf_singularity
-};;
-
-.align 32
-tgammaf_libm_err:
-{ .mfi
- alloc r32 = ar.pfs,1,4,4,0
- nop.f 0
- mov GR_Parameter_TAG = GR_TAG
-};;
-
-GLOBAL_LIBM_END(tgammaf)
-
-LOCAL_LIBM_ENTRY(__libm_error_region)
-.prologue
-{ .mfi
- add GR_Parameter_Y=-32,sp // Parameter 2 value
- nop.f 0
-.save ar.pfs,GR_SAVE_PFS
- mov GR_SAVE_PFS=ar.pfs // Save ar.pfs
-}
-{ .mfi
-.fframe 64
- add sp=-64,sp // Create new stack
- nop.f 0
- mov GR_SAVE_GP=gp // Save gp
-};;
-{ .mmi
- stfs [GR_Parameter_Y] = FR_Y,16 // STORE Parameter 2 on stack
- add GR_Parameter_X = 16,sp // Parameter 1 address
-.save b0, GR_SAVE_B0
- mov GR_SAVE_B0=b0 // Save b0
-};;
-.body
-{ .mib
- stfs [GR_Parameter_X] = FR_X // STORE Parameter 1 on stack
- add GR_Parameter_RESULT = 0,GR_Parameter_Y // Parameter 3 address
- nop.b 0
-}
-{ .mib
- stfs [GR_Parameter_Y] = FR_RESULT // STORE Parameter 3 on stack
- add GR_Parameter_Y = -16,GR_Parameter_Y
- br.call.sptk b0=__libm_error_support# // Call error handling function
-};;
-{ .mmi
- nop.m 0
- nop.m 0
- add GR_Parameter_RESULT = 48,sp
-};;
-{ .mmi
- ldfs f8 = [GR_Parameter_RESULT] // Get return result off stack
-.restore sp
- add sp = 64,sp // Restore stack pointer
- mov b0 = GR_SAVE_B0 // Restore return address
-};;
-{ .mib
- mov gp = GR_SAVE_GP // Restore gp
- mov ar.pfs = GR_SAVE_PFS // Restore ar.pfs
- br.ret.sptk b0 // Return
-};;
-
-LOCAL_LIBM_END(__libm_error_region)
-.type __libm_error_support#,@function
-.global __libm_error_support#
diff --git a/sysdeps/ia64/fpu/slowexp.c b/sysdeps/ia64/fpu/w_tgammaf.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/ia64/fpu/slowexp.c
+++ b/sysdeps/ia64/fpu/w_tgammaf.c
diff --git a/sysdeps/ia64/fpu/w_tgammaf_compat.S b/sysdeps/ia64/fpu/w_tgammaf_compat.S
new file mode 100644
index 0000000000..7ffc761d42
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_tgammaf_compat.S
@@ -0,0 +1,1331 @@
+.file "tgammaf.s"
+
+
+// Copyright (c) 2001 - 2005, Intel Corporation
+// All rights reserved.
+//
+// Contributed 2001 by the Intel Numerics Group, Intel Corporation
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// * The name of Intel Corporation may not be used to endorse or promote
+// products derived from this software without specific prior written
+// permission.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING,BUT NOT
+// LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT,INCIDENTAL,SPECIAL,
+// EXEMPLARY,OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA,OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY,WHETHER IN CONTRACT,STRICT LIABILITY OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Intel Corporation is the author of this code,and requests that all
+// problem reports or change requests be submitted to it directly at
+// http://www.intel.com/software/products/opensource/libraries/num.htm.
+//
+//*********************************************************************
+//
+// History:
+// 11/30/01 Initial version
+// 05/20/02 Cleaned up namespace and sf0 syntax
+// 02/10/03 Reordered header: .section, .global, .proc, .align
+// 04/04/03 Changed error codes for overflow and negative integers
+// 04/10/03 Changed code for overflow near zero handling
+// 12/16/03 Fixed parameter passing to/from error handling routine
+// 03/31/05 Reformatted delimiters between data tables
+//
+//*********************************************************************
+//
+//*********************************************************************
+//
+// Function: tgammaf(x) computes the principle value of the GAMMA
+// function of x.
+//
+//*********************************************************************
+//
+// Resources Used:
+//
+// Floating-Point Registers: f8-f15
+// f33-f75
+//
+// General Purpose Registers:
+// r8-r11
+// r14-r29
+// r32-r36
+// r37-r40 (Used to pass arguments to error handling routine)
+//
+// Predicate Registers: p6-p15
+//
+//*********************************************************************
+//
+// IEEE Special Conditions:
+//
+// tgammaf(+inf) = +inf
+// tgammaf(-inf) = QNaN
+// tgammaf(+/-0) = +/-inf
+// tgammaf(x<0, x - integer) = QNaN
+// tgammaf(SNaN) = QNaN
+// tgammaf(QNaN) = QNaN
+//
+//*********************************************************************
+//
+// Overview
+//
+// The method consists of three cases.
+//
+// If 2 <= x < OVERFLOW_BOUNDARY use case tgamma_regular;
+// else if 0 < x < 2 use case tgamma_from_0_to_2;
+// else if -(i+1) < x < -i, i = 0...43 use case tgamma_negatives;
+//
+// Case 2 <= x < OVERFLOW_BOUNDARY
+// -------------------------------
+// Here we use algorithm based on the recursive formula
+// GAMMA(x+1) = x*GAMMA(x). For that we subdivide interval
+// [2; OVERFLOW_BOUNDARY] into intervals [8*n; 8*(n+1)] and
+// approximate GAMMA(x) by polynomial of 22th degree on each
+// [8*n; 8*n+1], recursive formula is used to expand GAMMA(x)
+// to [8*n; 8*n+1]. In other words we need to find n, i and r
+// such that x = 8 * n + i + r where n and i are integer numbers
+// and r is fractional part of x. So GAMMA(x) = GAMMA(8*n+i+r) =
+// = (x-1)*(x-2)*...*(x-i)*GAMMA(x-i) =
+// = (x-1)*(x-2)*...*(x-i)*GAMMA(8*n+r) ~
+// ~ (x-1)*(x-2)*...*(x-i)*P12n(r).
+//
+// Step 1: Reduction
+// -----------------
+// N = [x] with truncate
+// r = x - N, note 0 <= r < 1
+//
+// n = N & ~0xF - index of table that contains coefficient of
+// polynomial approximation
+// i = N & 0xF - is used in recursive formula
+//
+//
+// Step 2: Approximation
+// ---------------------
+// We use factorized minimax approximation polynomials
+// P12n(r) = A12*(r^2+C01(n)*r+C00(n))*
+// *(r^2+C11(n)*r+C10(n))*...*(r^2+C51(n)*r+C50(n))
+//
+// Step 3: Recursion
+// -----------------
+// In case when i > 0 we need to multiply P12n(r) by product
+// R(i,x)=(x-1)*(x-2)*...*(x-i). To reduce number of fp-instructions
+// we can calculate R as follow:
+// R(i,x) = ((x-1)*(x-2))*((x-3)*(x-4))*...*((x-(i-1))*(x-i)) if i is
+// even or R = ((x-1)*(x-2))*((x-3)*(x-4))*...*((x-(i-2))*(x-(i-1)))*
+// *(i-1) if i is odd. In both cases we need to calculate
+// R2(i,x) = (x^2-3*x+2)*(x^2-7*x+12)*...*(x^2+x+2*j*(2*j-1)) =
+// = ((x^2-x)+2*(1-x))*((x^2-x)+6*(2-x))*...*((x^2-x)+2*(2*j-1)*(j-x)) =
+// = (RA+2*RB)*(RA+6*(1-RB))*...*(RA+2*(2*j-1)*(j-1+RB))
+// where j = 1..[i/2], RA = x^2-x, RB = 1-x.
+//
+// Step 4: Reconstruction
+// ----------------------
+// Reconstruction is just simple multiplication i.e.
+// GAMMA(x) = P12n(r)*R(i,x)
+//
+// Case 0 < x < 2
+// --------------
+// To calculate GAMMA(x) on this interval we do following
+// if 1.0 <= x < 1.25 than GAMMA(x) = P7(x-1)
+// if 1.25 <= x < 1.5 than GAMMA(x) = P7(x-x_min) where
+// x_min is point of local minimum on [1; 2] interval.
+// if 1.5 <= x < 1.75 than GAMMA(x) = P7(x-1.5)
+// if 1.75 <= x < 2.0 than GAMMA(x) = P7(x-1.5)
+// and
+// if 0 < x < 1 than GAMMA(x) = GAMMA(x+1)/x
+//
+// Case -(i+1) < x < -i, i = 0...43
+// ----------------------------------
+// Here we use the fact that GAMMA(-x) = PI/(x*GAMMA(x)*sin(PI*x)) and
+// so we need to calculate GAMMA(x), sin(PI*x)/PI. Calculation of
+// GAMMA(x) is described above.
+//
+// Step 1: Reduction
+// -----------------
+// Note that period of sin(PI*x) is 2 and range reduction for
+// sin(PI*x) is like to range reduction for GAMMA(x)
+// i.e rs = x - round(x) and |rs| <= 0.5.
+//
+// Step 2: Approximation
+// ---------------------
+// To approximate sin(PI*x)/PI = sin(PI*(2*n+rs))/PI =
+// = (-1)^n*sin(PI*rs)/PI Taylor series is used.
+// sin(PI*rs)/PI ~ S17(rs).
+//
+// Step 3: Division
+// ----------------
+// To calculate 1/x and 1/(GAMMA(x)*S12(rs)) we use frcpa
+// instruction with following Newton-Raphson interations.
+//
+//
+//*********************************************************************
+
+GR_ad_Data = r8
+GR_TAG = r8
+GR_SignExp = r9
+GR_Sig = r10
+GR_ArgNz = r10
+GR_RqDeg = r11
+
+GR_NanBound = r14
+GR_ExpOf025 = r15
+GR_ExpOf05 = r16
+GR_ad_Co = r17
+GR_ad_Ce = r18
+GR_TblOffs = r19
+GR_Arg = r20
+GR_Exp2Ind = r21
+GR_TblOffsMask = r21
+GR_Offs = r22
+GR_OvfNzBound = r23
+GR_ZeroResBound = r24
+GR_ad_SinO = r25
+GR_ad_SinE = r26
+GR_Correction = r27
+GR_Tbl12Offs = r28
+GR_NzBound = r28
+GR_ExpOf1 = r29
+GR_fpsr = r29
+
+GR_SAVE_B0 = r33
+GR_SAVE_PFS = r34
+GR_SAVE_GP = r35
+GR_SAVE_SP = r36
+
+GR_Parameter_X = r37
+GR_Parameter_Y = r38
+GR_Parameter_RESULT = r39
+GR_Parameter_TAG = r40
+
+
+FR_X = f10
+FR_Y = f1
+FR_RESULT = f8
+
+FR_iXt = f11
+FR_Xt = f12
+FR_r = f13
+FR_r2 = f14
+FR_r4 = f15
+
+FR_C01 = f33
+FR_A7 = f33
+FR_C11 = f34
+FR_A6 = f34
+FR_C21 = f35
+FR_A5 = f35
+FR_C31 = f36
+FR_A4 = f36
+FR_C41 = f37
+FR_A3 = f37
+FR_C51 = f38
+FR_A2 = f38
+
+FR_C00 = f39
+FR_A1 = f39
+FR_C10 = f40
+FR_A0 = f40
+FR_C20 = f41
+FR_C30 = f42
+FR_C40 = f43
+FR_C50 = f44
+FR_An = f45
+FR_OvfBound = f46
+FR_InvAn = f47
+
+FR_Multplr = f48
+FR_NormX = f49
+FR_X2mX = f50
+FR_1mX = f51
+FR_Rq0 = f51
+FR_Rq1 = f52
+FR_Rq2 = f53
+FR_Rq3 = f54
+
+FR_Rcp0 = f55
+FR_Rcp1 = f56
+FR_Rcp2 = f57
+
+FR_InvNormX1 = f58
+FR_InvNormX2 = f59
+
+FR_rs = f60
+FR_rs2 = f61
+
+FR_LocalMin = f62
+FR_10 = f63
+
+FR_05 = f64
+
+FR_S32 = f65
+FR_S31 = f66
+FR_S01 = f67
+FR_S11 = f68
+FR_S21 = f69
+FR_S00 = f70
+FR_S10 = f71
+FR_S20 = f72
+
+FR_GAMMA = f73
+FR_2 = f74
+FR_6 = f75
+
+
+
+
+// Data tables
+//==============================================================
+RODATA
+.align 16
+LOCAL_OBJECT_START(tgammaf_data)
+data8 0x3FDD8B618D5AF8FE // local minimum (0.461632144968362356785)
+data8 0x4024000000000000 // 10.0
+data8 0x3E90FC992FF39E13 // S32
+data8 0xBEC144B2760626E2 // S31
+//
+//[2; 8)
+data8 0x4009EFD1BA0CB3B4 // C01
+data8 0x3FFFB35378FF4822 // C11
+data8 0xC01032270413B896 // C41
+data8 0xC01F171A4C0D6827 // C51
+data8 0x40148F8E197396AC // C20
+data8 0x401C601959F1249C // C30
+data8 0x3EE21AD881741977 // An
+data8 0x4041852200000000 // overflow boundary (35.04010009765625)
+data8 0x3FD9CE68F695B198 // C21
+data8 0xBFF8C30AC900DA03 // C31
+data8 0x400E17D2F0535C02 // C00
+data8 0x4010689240F7FAC8 // C10
+data8 0x402563147DDCCF8D // C40
+data8 0x4033406D0480A21C // C50
+//
+//[8; 16)
+data8 0x4006222BAE0B793B // C01
+data8 0x4002452733473EDA // C11
+data8 0xC0010EF3326FDDB3 // C41
+data8 0xC01492B817F99C0F // C51
+data8 0x40099C905A249B75 // C20
+data8 0x4012B972AE0E533D // C30
+data8 0x3FE6F6DB91D0D4CC // An
+data8 0x4041852200000000 // overflow boundary
+data8 0x3FF545828F7B73C5 // C21
+data8 0xBFBBD210578764DF // C31
+data8 0x4000542098F53CFC // C00
+data8 0x40032C1309AD6C81 // C10
+data8 0x401D7331E19BD2E1 // C40
+data8 0x402A06807295EF57 // C50
+//
+//[16; 24)
+data8 0x4000131002867596 // C01
+data8 0x3FFAA362D5D1B6F2 // C11
+data8 0xBFFCB6985697DB6D // C41
+data8 0xC0115BEE3BFC3B3B // C51
+data8 0x3FFE62FF83456F73 // C20
+data8 0x4007E33478A114C4 // C30
+data8 0x41E9B2B73795ED57 // An
+data8 0x4041852200000000 // overflow boundary
+data8 0x3FEEB1F345BC2769 // C21
+data8 0xBFC3BBE6E7F3316F // C31
+data8 0x3FF14E07DA5E9983 // C00
+data8 0x3FF53B76BF81E2C0 // C10
+data8 0x4014051E0269A3DC // C40
+data8 0x40229D4227468EDB // C50
+//
+//[24; 32)
+data8 0x3FFAF7BD498384DE // C01
+data8 0x3FF62AD8B4D1C3D2 // C11
+data8 0xBFFABCADCD004C32 // C41
+data8 0xC00FADE97C097EC9 // C51
+data8 0x3FF6DA9ED737707E // C20
+data8 0x4002A29E9E0C782C // C30
+data8 0x44329D5B5167C6C3 // An
+data8 0x4041852200000000 // overflow boundary
+data8 0x3FE8943CBBB4B727 // C21
+data8 0xBFCB39D466E11756 // C31
+data8 0x3FE879AF3243D8C1 // C00
+data8 0x3FEEC7DEBB14CE1E // C10
+data8 0x401017B79BA80BCB // C40
+data8 0x401E941DC3C4DE80 // C50
+//
+//[32; 40)
+data8 0x3FF7ECB3A0E8FE5C // C01
+data8 0x3FF3815A8516316B // C11
+data8 0xBFF9ABD8FCC000C3 // C41
+data8 0xC00DD89969A4195B // C51
+data8 0x3FF2E43139CBF563 // C20
+data8 0x3FFF96DC3474A606 // C30
+data8 0x46AFF4CA9B0DDDF0 // An
+data8 0x4041852200000000 // overflow boundary
+data8 0x3FE4CE76DA1B5783 // C21
+data8 0xBFD0524DB460BC4E // C31
+data8 0x3FE35852DF14E200 // C00
+data8 0x3FE8C7610359F642 // C10
+data8 0x400BCF750EC16173 // C40
+data8 0x401AC14E02EA701C // C50
+//
+//[40; 48)
+data8 0x3FF5DCE4D8193097 // C01
+data8 0x3FF1B0D8C4974FFA // C11
+data8 0xBFF8FB450194CAEA // C41
+data8 0xC00C9658E030A6C4 // C51
+data8 0x3FF068851118AB46 // C20
+data8 0x3FFBF7C7BB46BF7D // C30
+data8 0x3FF0000000000000 // An
+data8 0x4041852200000000 // overflow boundary
+data8 0x3FE231DEB11D847A // C21
+data8 0xBFD251ECAFD7E935 // C31
+data8 0x3FE0368AE288F6BF // C00
+data8 0x3FE513AE4215A70C // C10
+data8 0x4008F960F7141B8B // C40
+data8 0x40183BA08134397B // C50
+//
+//[1.0; 1.25)
+data8 0xBFD9909648921868 // A7
+data8 0x3FE96FFEEEA8520F // A6
+data8 0xBFED0800D93449B8 // A3
+data8 0x3FEFA648D144911C // A2
+data8 0xBFEE3720F7720B4D // A5
+data8 0x3FEF4857A010CA3B // A4
+data8 0xBFE2788CCD545AA4 // A1
+data8 0x3FEFFFFFFFE9209E // A0
+//
+//[1.25; 1.5)
+data8 0xBFB421236426936C // A7
+data8 0x3FAF237514F36691 // A6
+data8 0xBFC0BADE710A10B9 // A3
+data8 0x3FDB6C5465BBEF1F // A2
+data8 0xBFB7E7F83A546EBE // A5
+data8 0x3FC496A01A545163 // A4
+data8 0xBDEE86A39D8452EB // A1
+data8 0x3FEC56DC82A39AA2 // A0
+//
+//[1.5; 1.75)
+data8 0xBF94730B51795867 // A7
+data8 0x3FBF4203E3816C7B // A6
+data8 0xBFE85B427DBD23E4 // A3
+data8 0x3FEE65557AB26771 // A2
+data8 0xBFD59D31BE3AB42A // A5
+data8 0x3FE3C90CC8F09147 // A4
+data8 0xBFE245971DF735B8 // A1
+data8 0x3FEFFC613AE7FBC8 // A0
+//
+//[1.75; 2.0)
+data8 0xBF7746A85137617E // A7
+data8 0x3FA96E37D09735F3 // A6
+data8 0xBFE3C24AC40AC0BB // A3
+data8 0x3FEC56A80A977CA5 // A2
+data8 0xBFC6F0E707560916 // A5
+data8 0x3FDB262D949175BE // A4
+data8 0xBFE1C1AEDFB25495 // A1
+data8 0x3FEFEE1E644B2022 // A0
+//
+// sin(pi*x)/pi
+data8 0xC026FB0D377656CC // S01
+data8 0x3FFFB15F95A22324 // S11
+data8 0x406CE58F4A41C6E7 // S10
+data8 0x404453786302C61E // S20
+data8 0xC023D59A47DBFCD3 // S21
+data8 0x405541D7ABECEFCA // S00
+//
+// 1/An for [40; 48)
+data8 0xCAA7576DE621FCD5, 0x3F68
+LOCAL_OBJECT_END(tgammaf_data)
+
+//==============================================================
+// Code
+//==============================================================
+
+.section .text
+GLOBAL_LIBM_ENTRY(tgammaf)
+{ .mfi
+ getf.exp GR_SignExp = f8
+ fma.s1 FR_NormX = f8,f1,f0
+ addl GR_ad_Data = @ltoff(tgammaf_data), gp
+}
+{ .mfi
+ mov GR_ExpOf05 = 0xFFFE
+ fcvt.fx.trunc.s1 FR_iXt = f8 // [x]
+ mov GR_Offs = 0 // 2 <= x < 8
+};;
+{ .mfi
+ getf.d GR_Arg = f8
+ fcmp.lt.s1 p14,p15 = f8,f0
+ mov GR_Tbl12Offs = 0
+}
+{ .mfi
+ setf.exp FR_05 = GR_ExpOf05
+ fma.s1 FR_2 = f1,f1,f1 // 2
+ mov GR_Correction = 0
+};;
+{ .mfi
+ ld8 GR_ad_Data = [GR_ad_Data]
+ fclass.m p10,p0 = f8,0x1E7 // is x NaTVal, NaN, +/-0 or +/-INF?
+ tbit.z p12,p13 = GR_SignExp,16 // p13 if |x| >= 2
+}
+{ .mfi
+ mov GR_ExpOf1 = 0xFFFF
+ fcvt.fx.s1 FR_rs = f8 // round(x)
+ and GR_Exp2Ind = 7,GR_SignExp
+};;
+.pred.rel "mutex",p14,p15
+{ .mfi
+(p15) cmp.eq.unc p11,p0 = GR_ExpOf1,GR_SignExp // p11 if 1 <= x < 2
+(p14) fma.s1 FR_1mX = f1,f1,f8 // 1 - |x|
+ mov GR_Sig = 0 // if |x| < 2
+}
+{ .mfi
+(p13) cmp.eq.unc p7,p0 = 2,GR_Exp2Ind
+(p15) fms.s1 FR_1mX = f1,f1,f8 // 1 - |x|
+(p13) cmp.eq.unc p8,p0 = 3,GR_Exp2Ind
+};;
+.pred.rel "mutex",p7,p8
+{ .mfi
+(p7) mov GR_Offs = 0x7 // 8 <= |x| < 16
+ nop.f 0
+(p8) tbit.z.unc p0,p6 = GR_Arg,51
+}
+{ .mib
+(p13) cmp.lt.unc p9,p0 = 3,GR_Exp2Ind
+(p8) mov GR_Offs = 0xE // 16 <= |x| < 32
+ // jump if x is NaTVal, NaN, +/-0 or +/-INF?
+(p10) br.cond.spnt tgammaf_spec_args
+};;
+.pred.rel "mutex",p14,p15
+.pred.rel "mutex",p6,p9
+{ .mfi
+(p9) mov GR_Offs = 0x1C // 32 <= |x|
+(p14) fma.s1 FR_X2mX = FR_NormX,FR_NormX,FR_NormX // x^2-|x|
+(p9) tbit.z.unc p0,p8 = GR_Arg,50
+}
+{ .mfi
+ ldfpd FR_LocalMin,FR_10 = [GR_ad_Data],16
+(p15) fms.s1 FR_X2mX = FR_NormX,FR_NormX,FR_NormX // x^2-|x|
+(p6) add GR_Offs = 0x7,GR_Offs // 24 <= x < 32
+};;
+.pred.rel "mutex",p8,p12
+{ .mfi
+ add GR_ad_Ce = 0x50,GR_ad_Data
+(p15) fcmp.lt.unc.s1 p10,p0 = f8,f1 // p10 if 0 <= x < 1
+ mov GR_OvfNzBound = 2
+}
+{ .mib
+ ldfpd FR_S32,FR_S31 = [GR_ad_Data],16
+(p8) add GR_Offs = 0x7,GR_Offs // 40 <= |x|
+ // jump if 1 <= x < 2
+(p11) br.cond.spnt tgammaf_from_1_to_2
+};;
+{ .mfi
+ shladd GR_ad_Ce = GR_Offs,4,GR_ad_Ce
+ fcvt.xf FR_Xt = FR_iXt // [x]
+(p13) cmp.eq.unc p7,p0 = r0,GR_Offs // p7 if 2 <= |x| < 8
+}
+{ .mfi
+ shladd GR_ad_Co = GR_Offs,4,GR_ad_Data
+ fma.s1 FR_6 = FR_2,FR_2,FR_2
+ mov GR_ExpOf05 = 0x7FC
+};;
+{ .mfi
+(p13) getf.sig GR_Sig = FR_iXt // if |x| >= 2
+ frcpa.s1 FR_Rcp0,p0 = f1,FR_NormX
+(p10) shr GR_Arg = GR_Arg,51
+}
+{ .mib
+ ldfpd FR_C01,FR_C11 = [GR_ad_Co],16
+(p7) mov GR_Correction = 2
+ // jump if 0 < x < 1
+(p10) br.cond.spnt tgammaf_from_0_to_1
+};;
+{ .mfi
+ ldfpd FR_C21,FR_C31 = [GR_ad_Ce],16
+ fma.s1 FR_Rq2 = f1,f1,FR_1mX // 2 - |x|
+(p14) sub GR_Correction = r0,GR_Correction
+}
+{ .mfi
+ ldfpd FR_C41,FR_C51 = [GR_ad_Co],16
+(p14) fcvt.xf FR_rs = FR_rs
+(p14) add GR_ad_SinO = 0x3A0,GR_ad_Data
+};;
+.pred.rel "mutex",p14,p15
+{ .mfi
+ ldfpd FR_C00,FR_C10 = [GR_ad_Ce],16
+ nop.f 0
+(p14) sub GR_Sig = GR_Correction,GR_Sig
+}
+{ .mfi
+ ldfpd FR_C20,FR_C30 = [GR_ad_Co],16
+ fma.s1 FR_Rq1 = FR_1mX,FR_2,FR_X2mX // (x-1)*(x-2)
+(p15) sub GR_Sig = GR_Sig,GR_Correction
+};;
+{ .mfi
+(p14) ldfpd FR_S01,FR_S11 = [GR_ad_SinO],16
+ fma.s1 FR_Rq3 = FR_2,f1,FR_1mX // 3 - |x|
+ and GR_RqDeg = 0x6,GR_Sig
+}
+{ .mfi
+ ldfpd FR_C40,FR_C50 = [GR_ad_Ce],16
+(p14) fma.d.s0 FR_X = f0,f0,f8 // set deno flag
+ mov GR_NanBound = 0x30016 // -2^23
+};;
+.pred.rel "mutex",p14,p15
+{ .mfi
+(p14) add GR_ad_SinE = 0x3C0,GR_ad_Data
+(p15) fms.s1 FR_r = FR_NormX,f1,FR_Xt // r = x - [x]
+ cmp.eq p8,p0 = 2,GR_RqDeg
+}
+{ .mfi
+ ldfpd FR_An,FR_OvfBound = [GR_ad_Co]
+(p14) fms.s1 FR_r = FR_Xt,f1,FR_NormX // r = |x - [x]|
+ cmp.eq p9,p0 = 4,GR_RqDeg
+};;
+.pred.rel "mutex",p8,p9
+{ .mfi
+(p14) ldfpd FR_S21,FR_S00 = [GR_ad_SinE],16
+(p8) fma.s1 FR_Rq0 = FR_2,f1,FR_1mX // (3-x)
+ tbit.z p0,p6 = GR_Sig,0
+}
+{ .mfi
+(p14) ldfpd FR_S10,FR_S20 = [GR_ad_SinO],16
+(p9) fma.s1 FR_Rq0 = FR_2,FR_2,FR_1mX // (5-x)
+ cmp.eq p10,p0 = 6,GR_RqDeg
+};;
+{ .mfi
+(p14) getf.s GR_Arg = f8
+(p14) fcmp.eq.unc.s1 p13,p0 = FR_NormX,FR_Xt
+(p14) mov GR_ZeroResBound = 0xC22C // -43
+}
+{ .mfi
+(p14) ldfe FR_InvAn = [GR_ad_SinE]
+(p10) fma.s1 FR_Rq0 = FR_6,f1,FR_1mX // (7-x)
+ cmp.eq p7,p0 = r0,GR_RqDeg
+};;
+{ .mfi
+(p14) cmp.ge.unc p11,p0 = GR_SignExp,GR_NanBound
+ fma.s1 FR_Rq2 = FR_Rq2,FR_6,FR_X2mX // (x-3)*(x-4)
+(p14) shl GR_ZeroResBound = GR_ZeroResBound,16
+}
+{ .mfb
+(p14) mov GR_OvfNzBound = 0x802
+(p14) fms.s1 FR_rs = FR_rs,f1,FR_NormX // rs = round(x) - x
+ // jump if x < -2^23 i.e. x is negative integer
+(p11) br.cond.spnt tgammaf_singularity
+};;
+{ .mfi
+ nop.m 0
+(p7) fma.s1 FR_Rq1 = f0,f0,f1
+(p14) shl GR_OvfNzBound = GR_OvfNzBound,20
+}
+{ .mfb
+ nop.m 0
+ fma.s1 FR_Rq3 = FR_Rq3,FR_10,FR_X2mX // (x-5)*(x-6)
+ // jump if x is negative integer such that -2^23 < x < 0
+(p13) br.cond.spnt tgammaf_singularity
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C01 = FR_C01,f1,FR_r
+(p14) mov GR_ExpOf05 = 0xFFFE
+}
+{ .mfi
+(p14) cmp.eq.unc p7,p0 = GR_Arg,GR_OvfNzBound
+ fma.s1 FR_C11 = FR_C11,f1,FR_r
+(p14) cmp.ltu.unc p11,p0 = GR_Arg,GR_OvfNzBound
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C21 = FR_C21,f1,FR_r
+(p14) cmp.ltu.unc p9,p0 = GR_ZeroResBound,GR_Arg
+}
+{ .mfb
+ nop.m 0
+ fma.s1 FR_C31 = FR_C31,f1,FR_r
+ // jump if argument is close to 0 negative
+(p11) br.cond.spnt tgammaf_overflow
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C41 = FR_C41,f1,FR_r
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+ fma.s1 FR_C51 = FR_C51,f1,FR_r
+ // jump if x is negative noninteger such that -2^23 < x < -43
+(p9) br.cond.spnt tgammaf_underflow
+};;
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_rs2 = FR_rs,FR_rs,f0
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p14) fma.s1 FR_S01 = FR_rs,FR_rs,FR_S01
+ // jump if argument is 0x80200000
+(p7) br.cond.spnt tgammaf_overflow_near0_bound
+};;
+{ .mfi
+ nop.m 0
+(p6) fnma.s1 FR_Rq1 = FR_Rq1,FR_Rq0,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p10) fma.s1 FR_Rq2 = FR_Rq2,FR_Rq3,f0
+ and GR_Sig = 0x7,GR_Sig
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C01 = FR_C01,FR_r,FR_C00
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C11 = FR_C11,FR_r,FR_C10
+ cmp.eq p6,p7 = r0,GR_Sig // p6 if |x| from one of base intervals
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C21 = FR_C21,FR_r,FR_C20
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C31 = FR_C31,FR_r,FR_C30
+(p7) cmp.lt.unc p9,p0 = 2,GR_RqDeg
+};;
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_S11 = FR_rs,FR_rs,FR_S11
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_S21 = FR_rs,FR_rs,FR_S21
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C41 = FR_C41,FR_r,FR_C40
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_S32 = FR_rs2,FR_S32,FR_S31
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p9) fma.s1 FR_Rq1 = FR_Rq1,FR_Rq2,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C51 = FR_C51,FR_r,FR_C50
+ nop.i 0
+};;
+{ .mfi
+(p14) getf.exp GR_SignExp = FR_rs
+ fma.s1 FR_C01 = FR_C01,FR_C11,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_S01 = FR_S01,FR_rs2,FR_S00
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C21 = FR_C21,FR_C31,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ // NR-iteration
+(p14) fnma.s1 FR_InvNormX1 = FR_Rcp0,FR_NormX,f1
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_S11 = FR_S11,FR_rs2,FR_S10
+(p14) tbit.z.unc p11,p12 = GR_SignExp,17
+}
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_S21 = FR_S21,FR_rs2,FR_S20
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p15) fcmp.lt.unc.s1 p0,p13 = FR_NormX,FR_OvfBound
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_S32 = FR_rs2,FR_S32,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C41 = FR_C41,FR_C51,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p7) fma.s1 FR_An = FR_Rq1,FR_An,f0
+ nop.i 0
+};;
+{ .mfb
+ nop.m 0
+ nop.f 0
+ // jump if x > 35.04010009765625
+(p13) br.cond.spnt tgammaf_overflow
+};;
+{ .mfi
+ nop.m 0
+ // NR-iteration
+(p14) fma.s1 FR_InvNormX1 = FR_Rcp0,FR_InvNormX1,FR_Rcp0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_S01 = FR_S01,FR_S11,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_S21 = FR_S21,FR_S32,f0
+ nop.i 0
+};;
+{ .mfi
+(p14) getf.exp GR_SignExp = FR_NormX
+ fma.s1 FR_C01 = FR_C01,FR_C21,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_C41 = FR_C41,FR_An,f0
+(p14) mov GR_ExpOf1 = 0x2FFFF
+};;
+{ .mfi
+ nop.m 0
+ // NR-iteration
+(p14) fnma.s1 FR_InvNormX2 = FR_InvNormX1,FR_NormX,f1
+ nop.i 0
+};;
+.pred.rel "mutex",p11,p12
+{ .mfi
+ nop.m 0
+(p12) fnma.s1 FR_S01 = FR_S01,FR_S21,f0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p11) fma.s1 FR_S01 = FR_S01,FR_S21,f0
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_GAMMA = FR_C01,FR_C41,f0
+(p14) tbit.z.unc p6,p7 = GR_Sig,0
+}
+{ .mfb
+ nop.m 0
+(p15) fma.s.s0 f8 = FR_C01,FR_C41,f0
+(p15) br.ret.spnt b0 // exit for positives
+};;
+.pred.rel "mutex",p11,p12
+{ .mfi
+ nop.m 0
+(p12) fms.s1 FR_S01 = FR_rs,FR_S01,FR_rs
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p11) fma.s1 FR_S01 = FR_rs,FR_S01,FR_rs
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ // NR-iteration
+ fma.s1 FR_InvNormX2 = FR_InvNormX1,FR_InvNormX2,FR_InvNormX1
+ cmp.eq p10,p0 = 0x23,GR_Offs
+};;
+.pred.rel "mutex",p6,p7
+{ .mfi
+ nop.m 0
+(p6) fma.s1 FR_GAMMA = FR_S01,FR_GAMMA,f0
+ cmp.gtu p8,p0 = GR_SignExp,GR_ExpOf1
+}
+{ .mfi
+ nop.m 0
+(p7) fnma.s1 FR_GAMMA = FR_S01,FR_GAMMA,f0
+ cmp.eq p9,p0 = GR_SignExp,GR_ExpOf1
+};;
+{ .mfi
+ nop.m 0
+ // NR-iteration
+ fnma.s1 FR_InvNormX1 = FR_InvNormX2,FR_NormX,f1
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p10) fma.s1 FR_InvNormX2 = FR_InvNormX2,FR_InvAn,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ frcpa.s1 FR_Rcp0,p0 = f1,FR_GAMMA
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fms.s1 FR_Multplr = FR_NormX,f1,f1 // x - 1
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ // NR-iteration
+ fnma.s1 FR_Rcp1 = FR_Rcp0,FR_GAMMA,f1
+ nop.i 0
+};;
+.pred.rel "mutex",p8,p9
+{ .mfi
+ nop.m 0
+ // 1/x or 1/(An*x)
+(p8) fma.s1 FR_Multplr = FR_InvNormX2,FR_InvNormX1,FR_InvNormX2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p9) fma.s1 FR_Multplr = f1,f1,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ // NR-iteration
+ fma.s1 FR_Rcp1 = FR_Rcp0,FR_Rcp1,FR_Rcp0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ // NR-iteration
+ fnma.s1 FR_Rcp2 = FR_Rcp1,FR_GAMMA,f1
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ // NR-iteration
+ fma.s1 FR_Rcp1 = FR_Rcp1,FR_Multplr,f0
+ nop.i 0
+};;
+{ .mfb
+ nop.m 0
+ fma.s.s0 f8 = FR_Rcp1,FR_Rcp2,FR_Rcp1
+ br.ret.sptk b0
+};;
+
+// here if 0 < x < 1
+//--------------------------------------------------------------------
+.align 32
+tgammaf_from_0_to_1:
+{ .mfi
+ cmp.lt p7,p0 = GR_Arg,GR_ExpOf05
+ // NR-iteration
+ fnma.s1 FR_Rcp1 = FR_Rcp0,FR_NormX,f1
+ cmp.eq p8,p0 = GR_Arg,GR_ExpOf05
+}
+{ .mfi
+ cmp.gt p9,p0 = GR_Arg,GR_ExpOf05
+ fma.s1 FR_r = f0,f0,FR_NormX // reduced arg for (0;1)
+ mov GR_ExpOf025 = 0x7FA
+};;
+{ .mfi
+ getf.s GR_ArgNz = f8
+ fma.d.s0 FR_X = f0,f0,f8 // set deno flag
+ shl GR_OvfNzBound = GR_OvfNzBound,20
+}
+{ .mfi
+(p8) mov GR_Tbl12Offs = 0x80 // 0.5 <= x < 0.75
+ nop.f 0
+(p7) cmp.ge.unc p6,p0 = GR_Arg,GR_ExpOf025
+};;
+.pred.rel "mutex",p6,p9
+{ .mfi
+(p9) mov GR_Tbl12Offs = 0xC0 // 0.75 <= x < 1
+ nop.f 0
+(p6) mov GR_Tbl12Offs = 0x40 // 0.25 <= x < 0.5
+}
+{ .mfi
+ add GR_ad_Ce = 0x2C0,GR_ad_Data
+ nop.f 0
+ add GR_ad_Co = 0x2A0,GR_ad_Data
+};;
+{ .mfi
+ add GR_ad_Co = GR_ad_Co,GR_Tbl12Offs
+ nop.f 0
+ cmp.lt p12,p0 = GR_ArgNz,GR_OvfNzBound
+}
+{ .mib
+ add GR_ad_Ce = GR_ad_Ce,GR_Tbl12Offs
+ cmp.eq p7,p0 = GR_ArgNz,GR_OvfNzBound
+ // jump if argument is 0x00200000
+(p7) br.cond.spnt tgammaf_overflow_near0_bound
+};;
+{ .mmb
+ ldfpd FR_A7,FR_A6 = [GR_ad_Co],16
+ ldfpd FR_A5,FR_A4 = [GR_ad_Ce],16
+ // jump if argument is close to 0 positive
+(p12) br.cond.spnt tgammaf_overflow
+};;
+{ .mfi
+ ldfpd FR_A3,FR_A2 = [GR_ad_Co],16
+ // NR-iteration
+ fma.s1 FR_Rcp1 = FR_Rcp0,FR_Rcp1,FR_Rcp0
+ nop.i 0
+}
+{ .mfb
+ ldfpd FR_A1,FR_A0 = [GR_ad_Ce],16
+ nop.f 0
+ br.cond.sptk tgamma_from_0_to_2
+};;
+
+// here if 1 < x < 2
+//--------------------------------------------------------------------
+.align 32
+tgammaf_from_1_to_2:
+{ .mfi
+ add GR_ad_Co = 0x2A0,GR_ad_Data
+ fms.s1 FR_r = f0,f0,FR_1mX
+ shr GR_TblOffs = GR_Arg,47
+}
+{ .mfi
+ add GR_ad_Ce = 0x2C0,GR_ad_Data
+ nop.f 0
+ mov GR_TblOffsMask = 0x18
+};;
+{ .mfi
+ nop.m 0
+ nop.f 0
+ and GR_TblOffs = GR_TblOffs,GR_TblOffsMask
+};;
+{ .mfi
+ shladd GR_ad_Co = GR_TblOffs,3,GR_ad_Co
+ nop.f 0
+ nop.i 0
+}
+{ .mfi
+ shladd GR_ad_Ce = GR_TblOffs,3,GR_ad_Ce
+ nop.f 0
+ cmp.eq p6,p7 = 8,GR_TblOffs
+};;
+{ .mmi
+ ldfpd FR_A7,FR_A6 = [GR_ad_Co],16
+ ldfpd FR_A5,FR_A4 = [GR_ad_Ce],16
+ nop.i 0
+};;
+{ .mmi
+ ldfpd FR_A3,FR_A2 = [GR_ad_Co],16
+ ldfpd FR_A1,FR_A0 = [GR_ad_Ce],16
+ nop.i 0
+};;
+
+.align 32
+tgamma_from_0_to_2:
+{ .mfi
+ nop.m 0
+(p6) fms.s1 FR_r = FR_r,f1,FR_LocalMin
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ // NR-iteration
+(p10) fnma.s1 FR_Rcp2 = FR_Rcp1,FR_NormX,f1
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r2 = FR_r,FR_r,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A7 = FR_A7,FR_r,FR_A6
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A5 = FR_A5,FR_r,FR_A4
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A3 = FR_A3,FR_r,FR_A2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A1 = FR_A1,FR_r,FR_A0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ // NR-iteration
+(p10) fma.s1 FR_Rcp2 = FR_Rcp1,FR_Rcp2,FR_Rcp1
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A7 = FR_A7,FR_r2,FR_A5
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r4 = FR_r2,FR_r2,f0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fma.s1 FR_A3 = FR_A3,FR_r2,FR_A1
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+(p10) fma.s1 FR_GAMMA = FR_A7,FR_r4,FR_A3
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p11) fma.s.s0 f8 = FR_A7,FR_r4,FR_A3
+ nop.i 0
+};;
+{ .mfb
+ nop.m 0
+(p10) fma.s.s0 f8 = FR_GAMMA,FR_Rcp2,f0
+ br.ret.sptk b0
+};;
+
+
+// overflow
+//--------------------------------------------------------------------
+.align 32
+tgammaf_overflow_near0_bound:
+.pred.rel "mutex",p14,p15
+{ .mfi
+ mov GR_fpsr = ar.fpsr
+ nop.f 0
+(p15) mov r8 = 0x7f8
+}
+{ .mfi
+ nop.m 0
+ nop.f 0
+(p14) mov r8 = 0xff8
+};;
+{ .mfi
+ nop.m 0
+ nop.f 0
+ shl r8 = r8,20
+};;
+{ .mfi
+ sub r8 = r8,r0,1
+ nop.f 0
+ extr.u GR_fpsr = GR_fpsr,10,2 // rounding mode
+};;
+.pred.rel "mutex",p14,p15
+{ .mfi
+ // set p8 to 0 in case of overflow and to 1 otherwise
+ // for negative arg:
+ // no overflow if rounding mode either Z or +Inf, i.e.
+ // GR_fpsr > 1
+(p14) cmp.lt p8,p0 = 1,GR_fpsr
+ nop.f 0
+ // for positive arg:
+ // no overflow if rounding mode either Z or -Inf, i.e.
+ // (GR_fpsr & 1) == 0
+(p15) tbit.z p0,p8 = GR_fpsr,0
+};;
+{ .mib
+(p8) setf.s f8 = r8 // set result to 0x7f7fffff without
+ // OVERFLOW flag raising
+ nop.i 0
+(p8) br.ret.sptk b0
+};;
+
+.align 32
+tgammaf_overflow:
+{ .mfi
+ nop.m 0
+ nop.f 0
+ mov r8 = 0x1FFFE
+};;
+{ .mfi
+ setf.exp f9 = r8
+ fmerge.s FR_X = f8,f8
+ nop.i 0
+};;
+.pred.rel "mutex",p14,p15
+{ .mfi
+ nop.m 0
+(p14) fnma.s.s0 f8 = f9,f9,f0 // set I,O and -INF result
+ mov GR_TAG = 261 // overflow
+}
+{ .mfb
+ nop.m 0
+(p15) fma.s.s0 f8 = f9,f9,f0 // set I,O and +INF result
+ br.cond.sptk tgammaf_libm_err
+};;
+
+// x is negative integer or +/-0
+//--------------------------------------------------------------------
+.align 32
+tgammaf_singularity:
+{ .mfi
+ nop.m 0
+ fmerge.s FR_X = f8,f8
+ mov GR_TAG = 262 // negative
+}
+{ .mfb
+ nop.m 0
+ frcpa.s0 f8,p0 = f0,f0
+ br.cond.sptk tgammaf_libm_err
+};;
+// x is negative noninteger with big absolute value
+//--------------------------------------------------------------------
+.align 32
+tgammaf_underflow:
+{ .mfi
+ mov r8 = 0x00001
+ nop.f 0
+ tbit.z p6,p7 = GR_Sig,0
+};;
+{ .mfi
+ setf.exp f9 = r8
+ nop.f 0
+ nop.i 0
+};;
+.pred.rel "mutex",p6,p7
+{ .mfi
+ nop.m 0
+(p6) fms.s.s0 f8 = f9,f9,f9
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p7) fma.s.s0 f8 = f9,f9,f9
+ br.ret.sptk b0
+};;
+
+// x for natval, nan, +/-inf or +/-0
+//--------------------------------------------------------------------
+.align 32
+tgammaf_spec_args:
+{ .mfi
+ nop.m 0
+ fclass.m p6,p0 = f8,0x1E1 // Test x for natval, nan, +inf
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fclass.m p7,p8 = f8,0x7 // +/-0
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fmerge.s FR_X = f8,f8
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p6) fma.s.s0 f8 = f8,f1,f8
+(p6) br.ret.spnt b0
+};;
+.pred.rel "mutex",p7,p8
+{ .mfi
+(p7) mov GR_TAG = 262 // negative
+(p7) frcpa.s0 f8,p0 = f1,f8
+ nop.i 0
+}
+{ .mib
+ nop.m 0
+ nop.i 0
+(p8) br.cond.spnt tgammaf_singularity
+};;
+
+.align 32
+tgammaf_libm_err:
+{ .mfi
+ alloc r32 = ar.pfs,1,4,4,0
+ nop.f 0
+ mov GR_Parameter_TAG = GR_TAG
+};;
+
+GLOBAL_LIBM_END(tgammaf)
+libm_alias_float_other (tgamma, tgamma)
+
+LOCAL_LIBM_ENTRY(__libm_error_region)
+.prologue
+{ .mfi
+ add GR_Parameter_Y=-32,sp // Parameter 2 value
+ nop.f 0
+.save ar.pfs,GR_SAVE_PFS
+ mov GR_SAVE_PFS=ar.pfs // Save ar.pfs
+}
+{ .mfi
+.fframe 64
+ add sp=-64,sp // Create new stack
+ nop.f 0
+ mov GR_SAVE_GP=gp // Save gp
+};;
+{ .mmi
+ stfs [GR_Parameter_Y] = FR_Y,16 // STORE Parameter 2 on stack
+ add GR_Parameter_X = 16,sp // Parameter 1 address
+.save b0, GR_SAVE_B0
+ mov GR_SAVE_B0=b0 // Save b0
+};;
+.body
+{ .mib
+ stfs [GR_Parameter_X] = FR_X // STORE Parameter 1 on stack
+ add GR_Parameter_RESULT = 0,GR_Parameter_Y // Parameter 3 address
+ nop.b 0
+}
+{ .mib
+ stfs [GR_Parameter_Y] = FR_RESULT // STORE Parameter 3 on stack
+ add GR_Parameter_Y = -16,GR_Parameter_Y
+ br.call.sptk b0=__libm_error_support# // Call error handling function
+};;
+{ .mmi
+ nop.m 0
+ nop.m 0
+ add GR_Parameter_RESULT = 48,sp
+};;
+{ .mmi
+ ldfs f8 = [GR_Parameter_RESULT] // Get return result off stack
+.restore sp
+ add sp = 64,sp // Restore stack pointer
+ mov b0 = GR_SAVE_B0 // Restore return address
+};;
+{ .mib
+ mov gp = GR_SAVE_GP // Restore gp
+ mov ar.pfs = GR_SAVE_PFS // Restore ar.pfs
+ br.ret.sptk b0 // Return
+};;
+
+LOCAL_LIBM_END(__libm_error_region)
+.type __libm_error_support#,@function
+.global __libm_error_support#
diff --git a/sysdeps/ia64/fpu/w_tgammal.S b/sysdeps/ia64/fpu/w_tgammal.S
deleted file mode 100644
index b10c5dc276..0000000000
--- a/sysdeps/ia64/fpu/w_tgammal.S
+++ /dev/null
@@ -1,4487 +0,0 @@
-.file "tgammal.s"
-
-
-// Copyright (c) 2002 - 2005, Intel Corporation
-// All rights reserved.
-//
-// Contributed 2002 by the Intel Numerics Group, Intel Corporation
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// * The name of Intel Corporation may not be used to endorse or promote
-// products derived from this software without specific prior written
-// permission.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Intel Corporation is the author of this code, and requests that all
-// problem reports or change requests be submitted to it directly at
-// http://www.intel.com/software/products/opensource/libraries/num.htm.
-//
-// History
-//==============================================================
-// 01/16/02 Initial version
-// 05/20/02 Cleaned up namespace and sf0 syntax
-// 02/10/03 Reordered header: .section, .global, .proc, .align;
-// used data8 for long double table values
-// 03/17/03 Moved tgammal_libm_err label into .proc region
-// 04/10/03 Changed error codes for overflow and negative integers
-// 03/31/05 Reformatted delimiters between data tables
-//
-// API
-//==============================================================
-// long double tgammal(long double)
-//
-// Resources Used:
-//
-// Floating-Point Registers: f8-f15
-// f32-f127
-//
-// General Purpose Registers: r32-r67
-//
-// Predicate Registers: p6-p15
-//
-//*********************************************************************
-//
-// IEEE Special Conditions:
-//
-// tgammal(+inf) = +inf
-// tgammal(-inf) = QNaN
-// tgammal(+/-0) = +/-inf
-// tgammal(x<0, x - integer) = QNaN
-// tgammal(SNaN) = QNaN
-// tgammal(QNaN) = QNaN
-//
-//*********************************************************************
-// Overview of operation
-//==============================================================
-//
-// Algorithm description
-// ---------------------
-//
-// There are 3 main paths in the implementation
-// (and additional special values branches)
-//
-// 1) |X| >= 13 - Stirling formula computation
-// a) Positive arguments:
-// TGAMMAL(X) = exp((X-0.5)*ln(X) - X + C + S(Z)),
-// where C = 0.5*ln(2*Pi) , Z = 1/Z, S(Z) - Bernulli polynomial
-// (up to 'B18' term).
-// Some of these calculation done in multiprecision.
-// Ln returns multiprecision result too
-// and exp also accepts and returns pair of values.
-//
-// b) Negative arguments
-// TGAMMAL(-X) = PI/(X*TGAMMAL(X)*sin(PI*X)).
-// (X*sin(PI*X))/PI calculated in parallel with TGAMMAL.
-// Here we use polynomial of 9th degree with 2 multiprecision steps.
-// Argument range reduction is:
-// N = [x] with round to nearest, r = x - N, -0.5 <= r < 0.5
-// After ((X-0.5)*ln(X) - X + C + S(Z)) completed we just invert
-// its result and compute exp with negative argument (1/exp(x)=exp(-x))
-// Then we multiply exp result to PI/(X*sin(PI*X)).
-//
-// 2) 1 <= |X| < 13 - Polynomial part
-// a) Positive arguments:
-// All values are splitted to such intervals as:
-// #0->[2;3], #1->[3,4], #2->[5,6]...
-// For even intervals we just use polynomial computation with degree 20
-// and first 6 multiprecision computations.
-// Range reduction looks like
-// N = [x] with truncate, r = x - N - 0.5, -0.5 <= r < 0.5
-// For odd intervals we use reccurent formula:
-// TGAMMAL(X) = TGAMMA(X-1)*(X-1)
-// [1;2] interval is splitted to 3 subranges:
-// [1;1.25], [1.25;1.75], [1.75;2] with the same polynomial forms
-//
-// b) Negative arguments
-// TGAMMAL(-X) = PI/(X*TGAMMAL(X)*sin(PI*X)).
-// (X*sin(PI*X))/PI calculated in parallel with TGAMMAL.
-// After multiplication by TGAMMAL(X) result we calculate reciprocal
-// and get final result.
-//
-// 3) 0 < |X| < 1 - Near 0 part
-// a) Here we use reccurent formula TGAMMAL(X) = TGAMMAL(X+1)/X
-// TGAMMAL(X+1) calculated as shown above,
-// 1/X result obtained in parallel. Then we just multiply these values.
-// There is only additional separated subrange: [0;0.125] with specific
-// polynomial constants set.
-//
-// b) Negative arguments
-// TGAMMAL(-X) = PI/(TGAMMAL(X+1)*sin(PI*X)).
-// There is no need to compute 1/X.
-
-
-
-RODATA
-
-.align 16
-LOCAL_OBJECT_START(Constants_Tgammal_log_80_Q)
-// log2_hi, log2_lo, Q_6, Q_5, Q_4, Q_3, Q_2, Q_1
-data4 0x00000000,0xB1721800,0x00003FFE,0x00000000
-data4 0x4361C4C6,0x82E30865,0x0000BFE2,0x00000000
-data4 0xA51BE0AF,0x92492453,0x00003FFC,0x00000000
-data4 0xA0CFD29F,0xAAAAAB73,0x0000BFFC,0x00000000
-data4 0xCCCE3872,0xCCCCCCCC,0x00003FFC,0x00000000
-data4 0xFFFFB4FB,0xFFFFFFFF,0x0000BFFC,0x00000000
-data4 0xAAAAAAAB,0xAAAAAAAA,0x00003FFD,0x00000000
-data4 0x00000000,0x80000000,0x0000BFFE,0x00000000
-LOCAL_OBJECT_END(Constants_Tgammal_log_80_Q)
-
-.align 64
-LOCAL_OBJECT_START(Constants_Tgammal_log_80_Z_G_H_h1)
-// Z1 - 16 bit fixed, G1 and H1 IEEE single, h1 IEEE double
-data4 0x00008000,0x3F800000,0x00000000,0x00000000
-data4 0x00000000,0x00000000,0x00000000,0x00000000
-data4 0x00007879,0x3F70F0F0,0x3D785196,0x00000000
-data4 0xEBA0E0D1,0x8B1D330B,0x00003FDA,0x00000000
-data4 0x000071C8,0x3F638E38,0x3DF13843,0x00000000
-data4 0x9EADD553,0xE2AF365E,0x00003FE2,0x00000000
-data4 0x00006BCB,0x3F579430,0x3E2FF9A0,0x00000000
-data4 0x752F34A2,0xF585FEC3,0x0000BFE3,0x00000000
-data4 0x00006667,0x3F4CCCC8,0x3E647FD6,0x00000000
-data4 0x893B03F3,0xF3546435,0x00003FE2,0x00000000
-data4 0x00006187,0x3F430C30,0x3E8B3AE7,0x00000000
-data4 0x39CDD2AC,0xBABA62E0,0x00003FE4,0x00000000
-data4 0x00005D18,0x3F3A2E88,0x3EA30C68,0x00000000
-data4 0x457978A1,0x8718789F,0x00003FE2,0x00000000
-data4 0x0000590C,0x3F321640,0x3EB9CEC8,0x00000000
-data4 0x3185E56A,0x9442DF96,0x0000BFE4,0x00000000
-data4 0x00005556,0x3F2AAAA8,0x3ECF9927,0x00000000
-data4 0x2BBE2CBD,0xCBF9A4BF,0x00003FE4,0x00000000
-data4 0x000051EC,0x3F23D708,0x3EE47FC5,0x00000000
-data4 0x852D5935,0xF3537535,0x00003FE3,0x00000000
-data4 0x00004EC5,0x3F1D89D8,0x3EF8947D,0x00000000
-data4 0x46CDF32F,0xA1F1E699,0x0000BFDF,0x00000000
-data4 0x00004BDB,0x3F17B420,0x3F05F3A1,0x00000000
-data4 0xD8484CE3,0x84A61856,0x00003FE4,0x00000000
-data4 0x00004925,0x3F124920,0x3F0F4303,0x00000000
-data4 0xFF28821B,0xC7DD97E0,0x0000BFE2,0x00000000
-data4 0x0000469F,0x3F0D3DC8,0x3F183EBF,0x00000000
-data4 0xEF1FD32F,0xD3C4A887,0x00003FE3,0x00000000
-data4 0x00004445,0x3F088888,0x3F20EC80,0x00000000
-data4 0x464C76DA,0x84672BE6,0x00003FE5,0x00000000
-data4 0x00004211,0x3F042108,0x3F29516A,0x00000000
-data4 0x18835FB9,0x9A43A511,0x0000BFE5,0x00000000
-LOCAL_OBJECT_END(Constants_Tgammal_log_80_Z_G_H_h1)
-
-.align 64
-LOCAL_OBJECT_START(Constants_Tgammal_log_80_Z_G_H_h2)
-// Z2 - 16 bit fixed, G2 and H2 IEEE single, h2 IEEE double
-data4 0x00008000,0x3F800000,0x00000000,0x00000000
-data4 0x00000000,0x00000000,0x00000000,0x00000000
-data4 0x00007F81,0x3F7F00F8,0x3B7F875D,0x00000000
-data4 0x211398BF,0xAD08B116,0x00003FDB,0x00000000
-data4 0x00007F02,0x3F7E03F8,0x3BFF015B,0x00000000
-data4 0xC376958E,0xB106790F,0x00003FDE,0x00000000
-data4 0x00007E85,0x3F7D08E0,0x3C3EE393,0x00000000
-data4 0x79A7679A,0xFD03F242,0x0000BFDA,0x00000000
-data4 0x00007E08,0x3F7C0FC0,0x3C7E0586,0x00000000
-data4 0x05E7AE08,0xF03F81C3,0x0000BFDF,0x00000000
-data4 0x00007D8D,0x3F7B1880,0x3C9E75D2,0x00000000
-data4 0x049EB22F,0xD1B87D3C,0x00003FDE,0x00000000
-data4 0x00007D12,0x3F7A2328,0x3CBDC97A,0x00000000
-data4 0x3A9E81E0,0xFABC8B95,0x00003FDF,0x00000000
-data4 0x00007C98,0x3F792FB0,0x3CDCFE47,0x00000000
-data4 0x7C4B5443,0xF5F3653F,0x00003FDF,0x00000000
-data4 0x00007C20,0x3F783E08,0x3CFC15D0,0x00000000
-data4 0xF65A1773,0xE78AB204,0x00003FE0,0x00000000
-data4 0x00007BA8,0x3F774E38,0x3D0D874D,0x00000000
-data4 0x7B8EF695,0xDB7CBFFF,0x0000BFE0,0x00000000
-data4 0x00007B31,0x3F766038,0x3D1CF49B,0x00000000
-data4 0xCF773FB3,0xC0241AEA,0x0000BFE0,0x00000000
-data4 0x00007ABB,0x3F757400,0x3D2C531D,0x00000000
-data4 0xC9539FDF,0xFC8F4D48,0x00003FE1,0x00000000
-data4 0x00007A45,0x3F748988,0x3D3BA322,0x00000000
-data4 0x954665C2,0x9CD035FB,0x0000BFE1,0x00000000
-data4 0x000079D1,0x3F73A0D0,0x3D4AE46F,0x00000000
-data4 0xDD367A30,0xEC9017C7,0x00003FE1,0x00000000
-data4 0x0000795D,0x3F72B9D0,0x3D5A1756,0x00000000
-data4 0xCB11189C,0xEE6625D3,0x0000BFE1,0x00000000
-data4 0x000078EB,0x3F71D488,0x3D693B9D,0x00000000
-data4 0xBE11C424,0xA49C8DB5,0x0000BFE0,0x00000000
-LOCAL_OBJECT_END(Constants_Tgammal_log_80_Z_G_H_h2)
-
-.align 64
-LOCAL_OBJECT_START(Constants_Tgammal_log_80_h3_G_H)
-// h3 IEEE double extended, H3 and G3 IEEE single
-data4 0x112666B0,0xAAACAAB1,0x00003FD3,0x3F7FFC00
-data4 0x9B7FAD21,0x90051030,0x00003FD8,0x3F7FF400
-data4 0xF4D783C4,0xA6B46F46,0x00003FDA,0x3F7FEC00
-data4 0x11C6DDCA,0xDA148D88,0x0000BFD8,0x3F7FE400
-data4 0xCA964D95,0xCE65C1D8,0x0000BFD8,0x3F7FDC00
-data4 0x23412D13,0x883838EE,0x0000BFDB,0x3F7FD400
-data4 0x983ED687,0xB7E5CFA1,0x00003FDB,0x3F7FCC08
-data4 0xE3C3930B,0xDBE23B16,0x0000BFD9,0x3F7FC408
-data4 0x48AA4DFC,0x9B92F1FC,0x0000BFDC,0x3F7FBC10
-data4 0xCE9C8F7E,0x9A8CEB15,0x0000BFD9,0x3F7FB410
-data4 0x0DECE74A,0x8C220879,0x00003FDC,0x3F7FAC18
-data4 0x2F053150,0xB25CA912,0x0000BFDA,0x3F7FA420
-data4 0xD9A5BE20,0xA5876555,0x00003FDB,0x3F7F9C20
-data4 0x2053F087,0xC919BB6E,0x00003FD9,0x3F7F9428
-data4 0x041E9A77,0xB70BDA79,0x00003FDC,0x3F7F8C30
-data4 0xEA1C9C30,0xF18A5C08,0x00003FDA,0x3F7F8438
-data4 0x796D89E5,0xA3790D84,0x0000BFDD,0x3F7F7C40
-data4 0xA2915A3A,0xE1852369,0x0000BFDD,0x3F7F7448
-data4 0xA39ED868,0xD803858F,0x00003FDC,0x3F7F6C50
-data4 0x9417EBB7,0xB2EEE356,0x0000BFDD,0x3F7F6458
-data4 0x9BB0D07F,0xED5C1F8A,0x0000BFDC,0x3F7F5C68
-data4 0xE87C740A,0xD6D201A0,0x0000BFDD,0x3F7F5470
-data4 0x1CA74025,0xE8DEBF5E,0x00003FDC,0x3F7F4C78
-data4 0x1F34A7EB,0x9A995A97,0x0000BFDC,0x3F7F4488
-data4 0x359EED97,0x9CB0F742,0x0000BFDA,0x3F7F3C90
-data4 0xBBC6A1C8,0xD6F833C2,0x0000BFDD,0x3F7F34A0
-data4 0xE71090EC,0xE1F68F2A,0x00003FDC,0x3F7F2CA8
-data4 0xC160A74F,0xD1881CF1,0x0000BFDB,0x3F7F24B8
-data4 0xD78CB5A4,0x9AD05AE2,0x00003FD6,0x3F7F1CC8
-data4 0x9A77DC4B,0xE658CB8E,0x0000BFDD,0x3F7F14D8
-data4 0x6BD6D312,0xBA281296,0x00003FDC,0x3F7F0CE0
-data4 0xF95210D0,0xB478BBEB,0x0000BFDB,0x3F7F04F0
-data4 0x38800100,0x39400480,0x39A00640,0x39E00C41 // H's start here
-data4 0x3A100A21,0x3A300F22,0x3A4FF51C,0x3A6FFC1D
-data4 0x3A87F20B,0x3A97F68B,0x3AA7EB86,0x3AB7E101
-data4 0x3AC7E701,0x3AD7DD7B,0x3AE7D474,0x3AF7CBED
-data4 0x3B03E1F3,0x3B0BDE2F,0x3B13DAAA,0x3B1BD766
-data4 0x3B23CC5C,0x3B2BC997,0x3B33C711,0x3B3BBCC6
-data4 0x3B43BAC0,0x3B4BB0F4,0x3B53AF6D,0x3B5BA620
-data4 0x3B639D12,0x3B6B9444,0x3B7393BC,0x3B7B8B6D
-LOCAL_OBJECT_END(Constants_Tgammal_log_80_h3_G_H)
-
-.align 64
-LOCAL_OBJECT_START(Constants_Tgammal_stirling)
-//0.5*ln(2*Pi)=9.1893853320467266954096885e-01 + 7.2239360881843238220057778e-17
-data8 0x3FED67F1C864BEB4, 0x3C94D252F2400510
-// Bernulli numbers
-data8 0xAAAAAAAAAAAAAAAB, 0x00003FFB //B2 = 8.3333333333333333333333333333e-02
-data8 0xBF66C16C16C16C17 //B4 = -2.7777777777777777777777777778e-03
-data8 0x3F4A01A01A01A01A //B6 = 7.9365079365079365079365079365e-04
-data8 0xBF43813813813814 //B8 = -5.9523809523809523809523809524e-04
-data8 0x3F4B951E2B18FF23 //B10 = 8.4175084175084175084175084175e-04
-data8 0xBF5F6AB0D9993C7D //B12 = -1.9175269175269175269175269175e-03
-data8 0x3F7A41A41A41A41A //B14 = 6.4102564102564102564102564103e-03
-data8 0xBF9E4286CB0F5398 //B16 = -2.9550653594771241830065359477e-02
-data8 0x3FC6FE96381E0680 //B18 = 1.7964437236883057316493849002e-01
-data8 0x3FE0000000000000 // 0.5
-LOCAL_OBJECT_END(Constants_Tgammal_stirling)
-
-.align 64
-LOCAL_OBJECT_START(Constants_Tgammal_sin)
-// Polynomial coefficients for the sin(Pi*x)/Pi, 0 <= |x| < 0.5
-//A2 = 8.1174242528335360802316245099e-01 + 5.1302254650266899774269946201e-18
-data8 0x3FE9F9CB402BC46C, 0x3C57A8B3819B7CEC
-//A1 = -1.6449340668482264060656916627e+00 + -3.0210280454695477893051351574e-17
-data8 0xBFFA51A6625307D3, 0xBC816A402079D0EF
-data8 0xF3AEF1FFCCE6C813, 0x0000BFE3 //A9 = -7.0921197799923779127089910470e-09
-data8 0x87D54408E6D4BB9D, 0x00003FE9 //A8 = 2.5300880778252693946712766029e-07
-data8 0xEA12033DCE7B8ED9, 0x0000BFED //A7 = -6.9758403885461690048189307819e-06
-data8 0x9BA38C952A59D1A8, 0x00003FF2 //A6 = 1.4842878710882320255092707181e-04
-data8 0x99C0B55178FF0E38, 0x0000BFF6 //A5 = -2.3460810348048124421268761990e-03
-data8 0xD63402E798FEC896, 0x00003FF9 //A4 = 2.6147847817611456327417812320e-02
-data8 0xC354723906D95E92, 0x0000BFFC //A3 = -1.9075182412208257558294507774e-01
-LOCAL_OBJECT_END(Constants_Tgammal_sin)
-
-.align 64
-LOCAL_OBJECT_START(Constants_Tgammal_exp_64_Arg)
-data4 0x00000000,0xB17217F4,0x00003FF2,0x00000000 // L_hi = hi part log(2)/2^12
-data4 0xF278ECE6,0xF473DE6A,0x00003FD4,0x00000000 // L_lo = lo part log(2)/2^12
-LOCAL_OBJECT_END(Constants_Tgammal_exp_64_Arg)
-
-LOCAL_OBJECT_START(Constants_Tgammal_exp_64_A)
-data4 0xB1B736A0,0xAAAAAAAB,0x00003FFA,0x00000000 // A3
-data4 0x90CD6327,0xAAAAAAAB,0x00003FFC,0x00000000 // A2
-data4 0xFFFFFFFF,0xFFFFFFFF,0x00003FFD,0x00000000 // A1
-LOCAL_OBJECT_END(Constants_Tgammal_exp_64_A)
-
-LOCAL_OBJECT_START(Constants_Tgammal_exp_64_T1)
-data4 0x3F800000,0x3F8164D2,0x3F82CD87,0x3F843A29
-data4 0x3F85AAC3,0x3F871F62,0x3F88980F,0x3F8A14D5
-data4 0x3F8B95C2,0x3F8D1ADF,0x3F8EA43A,0x3F9031DC
-data4 0x3F91C3D3,0x3F935A2B,0x3F94F4F0,0x3F96942D
-data4 0x3F9837F0,0x3F99E046,0x3F9B8D3A,0x3F9D3EDA
-data4 0x3F9EF532,0x3FA0B051,0x3FA27043,0x3FA43516
-data4 0x3FA5FED7,0x3FA7CD94,0x3FA9A15B,0x3FAB7A3A
-data4 0x3FAD583F,0x3FAF3B79,0x3FB123F6,0x3FB311C4
-data4 0x3FB504F3,0x3FB6FD92,0x3FB8FBAF,0x3FBAFF5B
-data4 0x3FBD08A4,0x3FBF179A,0x3FC12C4D,0x3FC346CD
-data4 0x3FC5672A,0x3FC78D75,0x3FC9B9BE,0x3FCBEC15
-data4 0x3FCE248C,0x3FD06334,0x3FD2A81E,0x3FD4F35B
-data4 0x3FD744FD,0x3FD99D16,0x3FDBFBB8,0x3FDE60F5
-data4 0x3FE0CCDF,0x3FE33F89,0x3FE5B907,0x3FE8396A
-data4 0x3FEAC0C7,0x3FED4F30,0x3FEFE4BA,0x3FF28177
-data4 0x3FF5257D,0x3FF7D0DF,0x3FFA83B3,0x3FFD3E0C
-LOCAL_OBJECT_END(Constants_Tgammal_exp_64_T1)
-
-LOCAL_OBJECT_START(Constants_Tgammal_exp_64_T2)
-data4 0x3F800000,0x3F80058C,0x3F800B18,0x3F8010A4
-data4 0x3F801630,0x3F801BBD,0x3F80214A,0x3F8026D7
-data4 0x3F802C64,0x3F8031F2,0x3F803780,0x3F803D0E
-data4 0x3F80429C,0x3F80482B,0x3F804DB9,0x3F805349
-data4 0x3F8058D8,0x3F805E67,0x3F8063F7,0x3F806987
-data4 0x3F806F17,0x3F8074A8,0x3F807A39,0x3F807FCA
-data4 0x3F80855B,0x3F808AEC,0x3F80907E,0x3F809610
-data4 0x3F809BA2,0x3F80A135,0x3F80A6C7,0x3F80AC5A
-data4 0x3F80B1ED,0x3F80B781,0x3F80BD14,0x3F80C2A8
-data4 0x3F80C83C,0x3F80CDD1,0x3F80D365,0x3F80D8FA
-data4 0x3F80DE8F,0x3F80E425,0x3F80E9BA,0x3F80EF50
-data4 0x3F80F4E6,0x3F80FA7C,0x3F810013,0x3F8105AA
-data4 0x3F810B41,0x3F8110D8,0x3F81166F,0x3F811C07
-data4 0x3F81219F,0x3F812737,0x3F812CD0,0x3F813269
-data4 0x3F813802,0x3F813D9B,0x3F814334,0x3F8148CE
-data4 0x3F814E68,0x3F815402,0x3F81599C,0x3F815F37
-LOCAL_OBJECT_END(Constants_Tgammal_exp_64_T2)
-
-LOCAL_OBJECT_START(Constants_Tgammal_exp_64_W1)
-data8 0x0000000000000000, 0xBE384454171EC4B4
-data8 0xBE6947414AA72766, 0xBE5D32B6D42518F8
-data8 0x3E68D96D3A319149, 0xBE68F4DA62415F36
-data8 0xBE6DDA2FC9C86A3B, 0x3E6B2E50F49228FE
-data8 0xBE49C0C21188B886, 0x3E64BFC21A4C2F1F
-data8 0xBE6A2FBB2CB98B54, 0x3E5DC5DE9A55D329
-data8 0x3E69649039A7AACE, 0x3E54728B5C66DBA5
-data8 0xBE62B0DBBA1C7D7D, 0x3E576E0409F1AF5F
-data8 0x3E6125001A0DD6A1, 0xBE66A419795FBDEF
-data8 0xBE5CDE8CE1BD41FC, 0xBE621376EA54964F
-data8 0x3E6370BE476E76EE, 0x3E390D1A3427EB92
-data8 0x3E1336DE2BF82BF8, 0xBE5FF1CBD0F7BD9E
-data8 0xBE60A3550CEB09DD, 0xBE5CA37E0980F30D
-data8 0xBE5C541B4C082D25, 0xBE5BBECA3B467D29
-data8 0xBE400D8AB9D946C5, 0xBE5E2A0807ED374A
-data8 0xBE66CB28365C8B0A, 0x3E3AAD5BD3403BCA
-data8 0x3E526055C7EA21E0, 0xBE442C75E72880D6
-data8 0x3E58B2BB85222A43, 0xBE5AAB79522C42BF
-data8 0xBE605CB4469DC2BC, 0xBE589FA7A48C40DC
-data8 0xBE51C2141AA42614, 0xBE48D087C37293F4
-data8 0x3E367A1CA2D673E0, 0xBE51BEBB114F7A38
-data8 0xBE6348E5661A4B48, 0xBDF526431D3B9962
-data8 0x3E3A3B5E35A78A53, 0xBE46C46C1CECD788
-data8 0xBE60B7EC7857D689, 0xBE594D3DD14F1AD7
-data8 0xBE4F9C304C9A8F60, 0xBE52187302DFF9D2
-data8 0xBE5E4C8855E6D68F, 0xBE62140F667F3DC4
-data8 0xBE36961B3BF88747, 0x3E602861C96EC6AA
-data8 0xBE3B5151D57FD718, 0x3E561CD0FC4A627B
-data8 0xBE3A5217CA913FEA, 0x3E40A3CC9A5D193A
-data8 0xBE5AB71310A9C312, 0x3E4FDADBC5F57719
-data8 0x3E361428DBDF59D5, 0x3E5DB5DB61B4180D
-data8 0xBE42AD5F7408D856, 0x3E2A314831B2B707
-LOCAL_OBJECT_END(Constants_Tgammal_exp_64_W1)
-
-LOCAL_OBJECT_START(Constants_Tgammal_exp_64_W2)
-data8 0x0000000000000000, 0xBE641F2537A3D7A2
-data8 0xBE68DD57AD028C40, 0xBE5C77D8F212B1B6
-data8 0x3E57878F1BA5B070, 0xBE55A36A2ECAE6FE
-data8 0xBE620608569DFA3B, 0xBE53B50EA6D300A3
-data8 0x3E5B5EF2223F8F2C, 0xBE56A0D9D6DE0DF4
-data8 0xBE64EEF3EAE28F51, 0xBE5E5AE2367EA80B
-data8 0x3E47CB1A5FCBC02D, 0xBE656BA09BDAFEB7
-data8 0x3E6E70C6805AFEE7, 0xBE6E0509A3415EBA
-data8 0xBE56856B49BFF529, 0x3E66DD3300508651
-data8 0x3E51165FC114BC13, 0x3E53333DC453290F
-data8 0x3E6A072B05539FDA, 0xBE47CD877C0A7696
-data8 0xBE668BF4EB05C6D9, 0xBE67C3E36AE86C93
-data8 0xBE533904D0B3E84B, 0x3E63E8D9556B53CE
-data8 0x3E212C8963A98DC8, 0xBE33138F032A7A22
-data8 0x3E530FA9BC584008, 0xBE6ADF82CCB93C97
-data8 0x3E5F91138370EA39, 0x3E5443A4FB6A05D8
-data8 0x3E63DACD181FEE7A, 0xBE62B29DF0F67DEC
-data8 0x3E65C4833DDE6307, 0x3E5BF030D40A24C1
-data8 0x3E658B8F14E437BE, 0xBE631C29ED98B6C7
-data8 0x3E6335D204CF7C71, 0x3E529EEDE954A79D
-data8 0x3E5D9257F64A2FB8, 0xBE6BED1B854ED06C
-data8 0x3E5096F6D71405CB, 0xBE3D4893ACB9FDF5
-data8 0xBDFEB15801B68349, 0x3E628D35C6A463B9
-data8 0xBE559725ADE45917, 0xBE68C29C042FC476
-data8 0xBE67593B01E511FA, 0xBE4A4313398801ED
-data8 0x3E699571DA7C3300, 0x3E5349BE08062A9E
-data8 0x3E5229C4755BB28E, 0x3E67E42677A1F80D
-data8 0xBE52B33F6B69C352, 0xBE6B3550084DA57F
-data8 0xBE6DB03FD1D09A20, 0xBE60CBC42161B2C1
-data8 0x3E56ED9C78A2B771, 0xBE508E319D0FA795
-data8 0xBE59482AFD1A54E9, 0xBE2A17CEB07FD23E
-data8 0x3E68BF5C17365712, 0x3E3956F9B3785569
-LOCAL_OBJECT_END(Constants_Tgammal_exp_64_W2)
-
-
-
-LOCAL_OBJECT_START(Constants_Tgammal_poly)
-
-// Polynomial coefficients for the tgammal(x), 2 <= |x| < 3
-//A5 = 2.8360780594841213109180699803e-02 + 2.2504152891014320704380000000e-19
-data8 0x3F9D0A9BC49353D2, 0x3C109AEA0F23CE2D
-//A4 = 1.0967323400216015538699565468e-01 + 9.9225166000430644587276000000e-18
-data8 0x3FBC138B89492C5B, 0x3C66E138506D5652
-//A3 = 2.5387124684114281691904579930e-01 + 2.2667777637607113205546600000e-17
-data8 0x3FD03F6D2FA4F4F8, 0x3C7A2258DA8CD8B1
-data8 0xC5866457328BC39B, 0x00003FE3 //A20 = 5.7487331964156762795056629138e-09
-data8 0xE93D9F1ACD59C929, 0x0000BFE4 //A19= -1.3576396100397317396956445658e-08
-data8 0xE33389C8F6CBA813, 0x00003FE5 //A18 = 2.6449714924964597501721434271e-08
-data8 0x8FE7B25B9CD26D2A, 0x0000BFE7 //A17= -6.7011017946055513660266853311e-08
-data8 0xB89F4721BFBC15B0, 0x00003FE8 //A16 = 1.7194280320370423615174419192e-07
-data8 0xE49CBDC1874EBABA, 0x0000BFE9 //A15= -4.2582353660153782928729466776e-07
-data8 0x913AF50A336129CA, 0x00003FEB //A14 = 1.0820500665257088283172211622e-06
-data8 0xABCF0F7313B3B332, 0x0000BFEC //A13= -2.5601510627710417669568115706e-06
-//A2 = 6.5455857798133676439533701341e-01 + 1.3292075193155190798867000000e-18
-data8 0x3FE4F224D4B7E01C, 0x3C3885014A2B8319
-//A1 = 9.3473452162608550164435428087e-01 + 3.2785154201417136611642400000e-17
-data8 0x3FEDE9585F1A7093, 0x3C82E63C1B5028BF
-//A0 = 1.3293403881791368004172682049e+00 + 2.2005689328949279282607500000e-16
-data8 0x3FF544FA6D47B38F, 0x3CAFB6AA9829E81F
-data8 0xF3668F799997C76D, 0x00003FED //A12 = 7.2539039479124273660331538367e-06
-data8 0xD6C6BBD54CDEAEB1, 0x0000BFEE //A11= -1.2801665282681088568639378920e-05
-data8 0x809E4763B06F6883, 0x00003FF1 //A10 = 6.1329973609906572700697893187e-05
-data8 0x8443B000F8F9A71A, 0x00003FED //A9 = 3.9417864189995544394564413428e-06
-data8 0xC5C7E6D62A6991D8, 0x00003FF4 //A8 = 7.5447412886334708803357581519e-04
-data8 0xD2AF690725C62D88, 0x00003FF5 //A7 = 1.6074004848394703022110823298e-03
-data8 0xAA44E635D4B7B682, 0x00003FF8 //A6 = 1.0392403425906843901680697839e-02
-//
-// Polynomial coefficients for the tgammal(x), 4 <= |x| < 5
-//A5 = 1.1600674810589555185913468449e+00 + 3.0229979112715124660731000000e-17
-data8 0x3FF28FA2EB44D22E, 0x3C816D285234C815
-//A4 = 3.1374268565470946334983182169e+00 + 1.3694868953995008497659600000e-16
-data8 0x400919734073B1E1, 0x3CA3BC83CD7E9565
-//A3 = 7.0834593993741057360580271052e+00 + 3.3899702569039156457249800000e-16
-data8 0x401C5576617B6C1F, 0x3CB86D6431213296
-data8 0xA4A5FB49C094966B, 0x00003FDA //A20 = 9.3591760106637809309720130828e-12
-data8 0xA9260DA0F51D7ED8, 0x00003FDD //A19 = 7.6919898428091669411809372180e-11
-data8 0xA16441DFB14BD6E1, 0x00003FE0 //A18 = 5.8713933014370867331213494535e-10
-data8 0x95F098D9C2234849, 0x00003FE3 //A17 = 4.3638234584169302324461091035e-09
-data8 0x8581817400E5AD2B, 0x00003FE6 //A16 = 3.1084260332429955234755367839e-08
-data8 0xE272940E373EBE15, 0x00003FE8 //A15 = 2.1089573544273993580820317236e-07
-data8 0xB6B3391145D226FB, 0x00003FEB //A14 = 1.3612217421122787182942706259e-06
-data8 0x8B9428C4DF95FCD5, 0x00003FEE //A13 = 8.3195416382628990683949003789e-06
-//A2 = 1.2665135075272345943631080445e+01 + 9.8721896915973874255877000000e-16
-data8 0x4029548C95A76F38, 0x3CD1C8BE715B8E13
-//A1 = 1.6154969393303069580269948347e+01 + 9.6850518810678379641029000000e-16
-data8 0x403027AC12FC1E1E, 0x3CD172711C15501B
-//A0 = 1.1631728396567448058362970187e+01 + 8.7078125362814179268673000000e-16
-data8 0x40274371E7866C65, 0x3CCF5F8A1A5FACA0
-data8 0xC94A903114272C03, 0x00003FF0 //A12 = 4.7991576836334427243159066630e-05
-data8 0x8844262960E04BE6, 0x00003FF3 //A11 = 2.5990716419283017929486175141e-04
-data8 0xAC5418A76767678D, 0x00003FF5 //A10 = 1.3147621245497801180184809726e-03
-data8 0xCA231B6EFE959132, 0x00003FF7 //A9 = 6.1687358811367989146517222415e-03
-data8 0xDA38E39C13819D2A, 0x00003FF9 //A8 = 2.6638454961912040754759086920e-02
-data8 0xD696DF8D8389FE53, 0x00003FFB //A7 = 1.0477995539298934056097943975e-01
-data8 0xBDD5C153048BC435, 0x00003FFD //A6 = 3.7077144754791605130056406006e-01
-//
-// Polynomial coefficients for the tgammal(x), 6 <= |x| < 7
-//A5 = 6.7169398121054200601065531373e+01 + 2.9481001527213915901489600000e-15
-data8 0x4050CAD76B377BA0, 0x3CEA8DDB2B2DE93E
-//A4 = 1.6115104376855398982115730178e+02 + 1.3422421925418824418257300000e-14
-data8 0x406424D559BDC687, 0x3D0E397FDB5B33DC
-//A3 = 3.1812194028053562533386866562e+02 + 3.9881709875858650942409600000e-14
-data8 0x4073E1F377A6CF73, 0x3D26738F63FE9C4C
-data8 0xD6E1B5FF90CAABD3, 0x00003FE1 //A20 = 1.5634700199277480081025480635e-09
-data8 0xD451987B925DD37E, 0x00003FE4 //A19 = 1.2358576813211397717382327174e-08
-data8 0xBFC151B67FA58E6B, 0x00003FE7 //A18 = 8.9292951435632759686382657901e-08
-data8 0xA9034C5E1D67572E, 0x00003FEA //A17 = 6.2962205718327848327368724720e-07
-data8 0x8E40F6EAA30A71EC, 0x00003FED //A16 = 4.2394926442967995119170095258e-06
-data8 0xE3C3541B03A1C350, 0x00003FEF //A15 = 2.7151465666109594512258841637e-05
-data8 0xACE2E58436B2DDCE, 0x00003FF2 //A14 = 1.6487723793339152877117376243e-04
-data8 0xF7EAF8D8D1CAA3D1, 0x00003FF4 //A13 = 9.4573158112768812533636022369e-04
-//A2 = 4.8664351544258869353143381886e+02 + 4.7424047995944376868895400000e-14
-data8 0x407E6A4BD6D9463B, 0x3D2AB2868D79E192
-//A1 = 5.1615277644992545447166776285e+02 + 3.0901956935588717379242200000e-14
-data8 0x40802138E2DC003B, 0x3D216570FB601AEA
-//A0 = 2.8788527781504433278314536437e+02 + 2.8213174117085164944959600000e-14
-data8 0x4071FE2A1911F7D6, 0x3D1FC3E4CF4DB5AF
-data8 0xA72B88E48D3D1BAB, 0x00003FF7 //A12 = 5.1016252919939028020562237471e-03
-data8 0xD2EFB1067DB4FFB2, 0x00003FF9 //A11 = 2.5749059441230515023024615917e-02
-data8 0xF788AF9522205C24, 0x00003FFB //A10 = 1.2086617635601742290221382521e-01
-data8 0x861A6CE06CB29EAF, 0x00003FFE //A9 = 5.2384071807018493367136112163e-01
-data8 0x84FBDE0947718B58, 0x00004000 //A8 = 2.0778727617851237754568261869e+00
-data8 0xEEC1371E265A2C3A, 0x00004001 //A7 = 7.4610858525146049022238037342e+00
-data8 0xBF514B9BE68ED59D, 0x00004003 //A6 = 2.3914694993947572859629197920e+01
-//
-// Polynomial coefficients for the tgammal(x), 8 <= |x| < 9
-//A5 = 5.8487447114416836484451778233e+03 + 4.7365465221455983144182900000e-13
-data8 0x40B6D8BEA568B6FD, 0x3D60AA4D44C2589B
-//A4 = 1.2796464063087094473303295672e+04 + 1.2373341702514898266244200000e-12
-data8 0x40C8FE3B666B532D, 0x3D75C4752C5B4783
-//A3 = 2.2837606581322281272150576115e+04 + 2.6598064610627891398831000000e-13
-data8 0x40D64D66D23A7764, 0x3D52B77B3A10EA5C
-data8 0xB23418F75B0BE22A, 0x00003FE9 //A20 = 3.3192989594206801808678663868e-07
-data8 0xA984A7BC8B856ED2, 0x00003FEC //A19 = 2.5260177918662350066375115788e-06
-data8 0x921A49729416372C, 0x00003FEF //A18 = 1.7416797068239475136398213598e-05
-data8 0xF5BB9415CC399CA4, 0x00003FF1 //A17 = 1.1717449586392814601938207599e-04
-data8 0xC50B91A40B81F9DF, 0x00003FF4 //A16 = 7.5166775151159345732094429036e-04
-data8 0x96002572326DB203, 0x00003FF7 //A15 = 4.5776541559407384162139204300e-03
-data8 0xD81A1A595E4157BA, 0x00003FF9 //A14 = 2.6379634345126284099420760736e-02
-data8 0x92B700D0CFECADD8, 0x00003FFC //A13 = 1.4327622675407940907282658100e-01
-//A2 = 3.1237895525940199149772524834e+04 + 3.1280450505163186432331700000e-12
-data8 0x40DE8179504C0878, 0x3D8B83BB33FBB766
-//A1 = 2.9192841741344487672904506326e+04 + 7.9300780509779689630767000000e-13
-data8 0x40DC8235DF171691, 0x3D6BE6C780EE54DF
-//A0 = 1.4034407293483411194756627083e+04 + 1.4038139346291543309253700000e-12
-data8 0x40CB693422315F90, 0x3D78B23746113FCE
-data8 0xBAE50807548BC711, 0x00003FFE //A12 = 7.3005724123917935346868107005e-01
-data8 0xDE28B1F57E68CFB6, 0x00004000 //A11 = 3.4712338349724065462763671443e+00
-data8 0xF4DCA5A5FF901118, 0x00004002 //A10 = 1.5303868912154033908205911714e+01
-data8 0xF85AAA1AD5E84E5E, 0x00004004 //A9 = 6.2088539523416399361048051373e+01
-data8 0xE5AA8BB1BF02934D, 0x00004006 //A8 = 2.2966619406617480799195651466e+02
-data8 0xBF6CFEFD67F59845, 0x00004008 //A7 = 7.6570306334640770654588802417e+02
-data8 0x8DB5D2F001635C29, 0x0000400A //A6 = 2.2673639984182571062068713002e+03
-//
-// Polynomial coefficients for the tgammal(x), 10 <= |x| < 11
-//A5 = 7.2546009516580589115619659424e+05 + 1.0343348865365065212891728822e-10
-data8 0x412623A830B99290, 0x3DDC6E7C157611C4
-//A4 = 1.4756292870840241666883230209e+06 + 8.1516565365333844166705674775e-11
-data8 0x4136842D497E56AF, 0x3DD66837E4C3F9EE
-//A3 = 2.4356116926500420086085796356e+06 + 3.5508860076560925641351069404e-10
-data8 0x4142950DD8A8C1AF, 0x3DF866C8E3DD0980
-data8 0xB7FD0D1EEAC38EB4, 0x00003FF1 //A20 = 8.7732544640091602721643775932e-05
-data8 0xA9345C64AC750AE9, 0x00003FF4 //A19 = 6.4546407626804942279126469603e-04
-data8 0x8BEABC81BE1E93C9, 0x00003FF7 //A18 = 4.2699261134524096128048819443e-03
-data8 0xE1CD281EDD7315F8, 0x00003FF9 //A17 = 2.7563646660310313164706189622e-02
-data8 0xAD8A5BA6D0FD9758, 0x00003FFC //A16 = 1.6947310643831556048460963841e-01
-data8 0xFCDDA464AD3F182E, 0x00003FFE //A15 = 9.8775699098518676937088606052e-01
-data8 0xAE0DCE2F7B60D1AE, 0x00004001 //A14 = 5.4391852309591064073782104822e+00
-data8 0xE1745D9ABEB8D1A7, 0x00004003 //A13 = 2.8181819161363002758615770457e+01
-//A2 = 3.0619656223573554307222366333e+06 + 1.0819940302945474471259520006e-10
-data8 0x41475C66CFA967E4, 0x3DDDBDDB2A27334B
-//A1 = 2.6099413018962685018777847290e+06 + 3.6851882860056025385268615240e-10
-data8 0x4143E98AA6A48974, 0x3DF9530D42589AB6
-//A0 = 1.1332783889487853739410638809e+06 + 1.9339350553312096248591829758e-10
-data8 0x41314ADE639225C9, 0x3DEA946DD6C2C8D3
-data8 0x88BCFAAE71812A1C, 0x00004006 //A12 = 1.3673820009490115307300592012e+02
-data8 0x9A770F5AB540A326, 0x00004008 //A11 = 6.1786031215382040427126476507e+02
-data8 0xA170C1D2C6B413FC, 0x0000400A //A10 = 2.5830473201524594051391525170e+03
-data8 0x9AE56061CB02EB55, 0x0000400C //A9 = 9.9133441230507404119297200255e+03
-data8 0x872390769650FBE2, 0x0000400E //A8 = 3.4595564309496661629764193479e+04
-data8 0xD3E5E8D6923910C1, 0x0000400F //A7 = 1.0849181904819284819615140521e+05
-data8 0x930D70602F50B754, 0x00004011 //A6 = 3.0116351174131169193070583741e+05
-//
-// Polynomial coefficients for the tgammal(x), 12 <= |x| < 13
-//A5 = 1.2249876249976964294910430908e+08 + 6.0051348061679753770848000000e-09
-data8 0x419D34BB29FFC39D, 0x3E39CAB72E01818D
-//A4 = 2.3482765927605420351028442383e+08 + 1.1874729051592862323641700000e-08
-data8 0x41ABFE5F168D56FA, 0x3E4980338AA7B04B
-//A3 = 3.6407329688125067949295043945e+08 + 2.6657200942150363994658700000e-08
-data8 0x41B5B35150E199A5, 0x3E5C9F79C0EB5300
-data8 0xE89AE0F8D726329D, 0x00003FF9 //A20 = 2.8394164465429105626588451540e-02
-data8 0xCF90981F86E38013, 0x00003FFC //A19 = 2.0270002071785908652476845915e-01
-data8 0xA56C658079CA8C4A, 0x00003FFF //A18 = 1.2923704984019263122675412350e+00
-data8 0x80AEF96A67C5615A, 0x00004002 //A17 = 8.0427183300456238315262463506e+00
-data8 0xBE886D7529678931, 0x00004004 //A16 = 4.7633230047847868242503413461e+01
-data8 0x858EDBA4CE2F7508, 0x00004007 //A15 = 2.6711607799594541057655957154e+02
-data8 0xB0B0A3AF388274F0, 0x00004009 //A14 = 1.4135199810126975119809102782e+03
-data8 0xDBA87137988751EF, 0x0000400B //A13 = 7.0290552818218513870879313985e+03
-//A2 = 4.2828433593031734228134155273e+08 + 3.9760422293645854535247300000e-08
-data8 0x41B98719AFEE2947, 0x3E6558A17E0D3007
-//A1 = 3.4008253676084774732589721680e+08 + 1.2558352335001093116071000000e-09
-data8 0x41B4453F68C2C6EB, 0x3E159338C5BC7EC3
-//A0 = 1.3684336546556583046913146973e+08 + 2.6786516700381562934240300000e-08
-data8 0x41A05020CAEE5EA5, 0x3E5CC3058A858579
-data8 0xFF5E3940FB4BA576, 0x0000400D //A12 = 3.2687111823895439312116108631e+04
-data8 0x8A08C124C7F74B6C, 0x00004010 //A11 = 1.4134701786994123329786229006e+05
-data8 0x89D701953540BFFB, 0x00004012 //A10 = 5.6459209892773907605385652281e+05
-data8 0xFC46344B3116C3AD, 0x00004013 //A9 = 2.0666305367147234406757715163e+06
-data8 0xD183EBD7A400151F, 0x00004015 //A8 = 6.8653979211730981618367536737e+06
-data8 0x9C083A40742112F4, 0x00004017 //A7 = 2.0451444503543981795037456447e+07
-data8 0xCD3C475B1A8B6662, 0x00004018 //A6 = 5.3801245423495149598177886823e+07
-LOCAL_OBJECT_END(Constants_Tgammal_poly)
-
-
-LOCAL_OBJECT_START(Constants_Tgammal_poly_splitted)
-
-// Polynomial coefficients for the tgammal(x), 1 <= |x| < 1.25
-//A5 = -9.8199506890310417350775651357e-01+ -3.2546247786122976510752200000e-17
-data8 0xBFEF6C80EC38B509, 0xBC82C2FA7A3DE3BD
-//A4 = 9.8172808683439960475425323239e-01 + 4.4847611775298520359811400000e-17
-data8 0x3FEF6A51055096B0, 0x3C89DA56DE95EFE4
-//A3 = -9.0747907608088618225394839101e-01 +-1.0244057366544064435443970000e-16
-data8 0xBFED0A118F324B62, 0xBC9D86C7B9EBCFFF
-data8 0xB8E3FDAA66CC738E, 0x00003FFB //A20 = 9.0278608095877488976217714815e-02
-data8 0xA76067AE1738699C, 0x0000BFFD //A19 =-3.2690738678103132837070881737e-01
-data8 0x9D66B13718408C44, 0x00003FFE //A18 = 6.1484820933424283818320582920e-01
-data8 0xD4AC67BBB4AE5599, 0x0000BFFE //A17 =-8.3075569470082063491389474937e-01
-data8 0xF1426ED1C1488DB3, 0x00003FFE //A16 = 9.4241993542644505594957058785e-01
-data8 0xFC12EB07AA6F4B6B, 0x0000BFFE //A15 =-9.8466366707947121954333549690e-01
-data8 0xFF2B32CFE5B0DDC8, 0x00003FFE //A14 = 9.9675290656677214804168895915e-01
-data8 0xFFD8E7E6FF3662EA, 0x0000BFFE //A13 =-9.9940347089360552383472582319e-01
-//A2 = 9.8905599532797250361682017683e-01 + 5.1760162410376024240867300000e-17
-data8 0x3FEFA658C23B1578, 0x3C8DD673A61F6FE7
-//A1 = -5.7721566490153275452712478000e-01+ -1.0607935612223465065923310000e-16
-data8 0xBFE2788CFC6FB618, 0xBC9E9346622D53B7
-//A0 = 9.9999999999999988897769753748e-01 + 1.1102230245372554544790880000e-16
-data8 0x3FEFFFFFFFFFFFFF, 0x3C9FFFFFFFF51E4E
-data8 0xFFF360DF628F0BC9, 0x00003FFE //A12 = 9.9980740979895815468216470840e-01
-data8 0xFFEF8F9A72B40480, 0x0000BFFE //A11 = -9.9974916001038145045939523470e-01
-data8 0xFFE037B8C7E39952, 0x00003FFE //A10 = 9.9951504002809911822597567307e-01
-data8 0xFFC01E08F348BED2, 0x0000BFFE //A9 = -9.9902522772325406705059517941e-01
-data8 0xFF83DAC83119B52C, 0x00003FFE //A8 = 9.9810569179053383842734164901e-01
-data8 0xFEF9F8AB891ABB24, 0x0000BFFE //A7 = -9.9600176036720260345608796766e-01
-data8 0xFE3F0537573C8235, 0x00003FFE //A6 = 9.9314911461918778676646301341e-01
-//
-// Polynomial coefficients for the tgammal(x), 1.25 <= |x| < 1.75
-//A5 = -7.7523052299853054125655660300e-02+ -1.2693512521686721504433600000e-17
-data8 0xBFB3D88CFE50601B, 0xBC6D44ED60EE2170
-//A4 = 1.4464535904462152982041800442e-01 + 2.5426820829345729856648800000e-17
-data8 0x3FC283BD374EB2A9, 0x3C7D50AC436187C3
-//A3 = -1.0729480456477220873257039102e-01+ -6.2429894945456418196551000000e-18
-data8 0xBFBB77AC1CA2EBA5, 0xBC5CCA6BCC422D41
-data8 0xF732D2689F323283, 0x00003FF2 //A20 = 2.3574688251652899567587145422e-04
-data8 0xB6B00E23DE89D13A, 0x0000BFF3 //A19 =-3.4844916488842618776630058875e-04
-data8 0xE98396FE4A1B2799, 0x00003FF3 //A18 =4.4539265198744452020440735977e-04
-data8 0xAF8D235A640DB1A2, 0x0000BFF4 //A17 =-6.6967514303333563295261178346e-04
-data8 0x8513B736C918B261, 0x00003FF5 //A16 = 1.0152970456990865810615917715e-03
-data8 0xC790A1A2C78D8E17, 0x0000BFF5 //A15 =-1.5225598630329403515321688394e-03
-data8 0x959706CFA638CDE2, 0x00003FF6 //A14 = 2.2825614575133879623648932383e-03
-data8 0xE050A6021E129860, 0x0000BFF6 //A13 =-3.4227757733947066666295285936e-03
-//A2 = 4.1481345368830113695679528973e-01 + 3.1252439808354284892632100000e-17
-data8 0x3FDA8C4DBA620D56, 0x3C82040BCB483C76
-//A1 = 3.2338397448885010387886751460e-02 + 3.4437825798552300531443100000e-18
-data8 0x3FA08EA88EE561B1, 0x3C4FC366D6C64806
-//A0 = 8.8622692545275794095971377828e-01 + 7.2689375867553992399219000000e-17
-data8 0x3FEC5BF891B4EF6A, 0x3C94F3877D311C0C
-data8 0xA8275AADC09D16FC, 0x00003FF7 //A12 = 5.1316445128621071486146117136e-03
-data8 0xFBFE2CE9215267A2, 0x0000BFF7 //A11= -7.6902121820788373000579382408e-03
-data8 0xBCC8EEAB67ECD91D, 0x00003FF8 //A10 = 1.1522515369164312742737727262e-02
-data8 0x8D1614BB97E5E8C2, 0x0000BFF9 //A9 = -1.7222443097804730395560633583e-02
-data8 0xD3A963578BE291E3, 0x00003FF9 //A8 = 2.5837606456090186343624210891e-02
-data8 0x9BA7EAE64C42FDF7, 0x0000BFFA //A7 = -3.8001935555045161419575037512e-02
-data8 0xF0115BA1A77607E7, 0x00003FFA //A6 = 5.8610303817173477119764956736e-02
-//
-// Polynomial coefficients for the tgammal(x), 1.75 <= |x| < 2.0
-//A5 = 2.6698206874501426502654943818e-04 + 3.4033756836921062797887300000e-20
-data8 0x3F317F3740FE2A68, 0x3BE417093234B06E
-//A4 = 7.4249010753513894345090307070e-02 + 3.9810018444482764697014200000e-18
-data8 0x3FB301FBB0F25A92, 0x3C525BEFFABB622F
-//A3 = -8.1576919247086265851720554565e-02+ -5.2716624487804746360745000000e-19
-data8 0xBFB4E239984650AC, 0xBC2372F1C4F276FF
-data8 0xFEF3AEE71038E9A3, 0x00003FEB //A20 = 1.8995395865421509009969188571e-06
-data8 0xA11CFA2672BF876A, 0x0000BFEB //A19 =-1.2003868221414015771269244270e-06
-data8 0xF8E107215DAE2164, 0x00003FEC //A18 = 3.7085863210303833432006027217e-06
-data8 0xBCDDD3FC011EF7D6, 0x00003FEC //A17 = 2.8143303971756051015245433043e-06
-data8 0x8683C4687FA22E68, 0x00003FEE //A16 = 8.0177018464360416764308252462e-06
-data8 0xFDA09E5D33E32968, 0x00003FEE //A15 = 1.5117372062443781157389064848e-05
-data8 0xFFB00D0CFF4089B4, 0x00003FEF //A14 = 3.0480348961227424242198174995e-05
-data8 0xFEF6C39566785085, 0x00003FF0 //A13 = 6.0788135974125244644334004947e-05
-//A2 = 4.1184033042643969357854416558e-01 + 1.2103396182129232634761000000e-18
-data8 0x3FDA5B978B96BEBF, 0x3C3653AAD0A139E4
-//A1 = -4.2278433509846713445057275749e-01+ -4.9429151528135657430413000000e-18
-data8 0xBFDB0EE6072093CE, 0xBC56CB907027554F
-//A0 = 1.0000000000000000000000000000e+00 + 1.0969171200000000000000000000e-31
-data8 0x3FF0000000000000, 0x3981CC6A5B20B4D5
-data8 0xFF2B7BA9A8D68C37, 0x00003FF1 //A12 = 1.2167446884801403650547161615e-04
-data8 0xFCA53468E3692EF1, 0x00003FF2 //A11 = 2.4094136329542400976250900707e-04
-data8 0x808D698A9C993615, 0x00003FF4 //A10 = 4.9038845704938303659791698883e-04
-data8 0xF10F8E3FB8BB4AFB, 0x00003FF4 //A9 = 9.1957383840999861214472423976e-04
-data8 0x89E224E42F93F005, 0x00003FF6 //A8 = 2.1039333407187324139473634747e-03
-data8 0xBAF374824937A323, 0x00003FF6 //A7 = 2.8526458211545152218493600470e-03
-data8 0xB6BF7564F52140C6, 0x00003FF8 //A6 = 1.1154045718131014476684982178e-02
-//
-// Polynomial coefficients for the tgammal(x), 0.0 <= |x| < 0.125
-//A5 = -9.8199506890314514073736518185e-01+ -5.9363811993837985890950900000e-17
-data8 0xBFEF6C80EC38B67A, 0xBC911C46B447C81F
-//A4 = 9.8172808683440015986576554496e-01 + 2.7457414262802803699834200000e-17
-data8 0x3FEF6A51055096B5, 0x3C7FA7FF90ACAD1F
-//A3 = -9.0747907608088618225394839101e-01 + -1.0676255850934306734701780000e-16
-data8 0xBFED0A118F324B62, 0xBC9EC5AFB633438D
-data8 0x9217E83FA207CB80, 0x00003FFD //A20 = 2.8533864762086088781083621561e-01
-data8 0xA8DABFA52FDF03EC, 0x0000BFFE //A19= -6.5958783896337186303285832783e-01
-data8 0xE331ED293AF39F9B, 0x00003FFE //A18 = 8.8748056656454687449654731184e-01
-data8 0xF9163C5DDB52419D, 0x0000BFFE //A17= -9.7299554149078295602977718525e-01
-data8 0xFEC0A1C672CB9265, 0x00003FFE //A16 = 9.9512683005268190987854104489e-01
-data8 0xFFD2D65B8EA7B5F4, 0x0000BFFE //A15= -9.9931087241443958201592847861e-01
-data8 0xFFF93AA39EE53445, 0x00003FFE //A14 = 9.9989668364186884793382816496e-01
-data8 0xFFFB99A9A3F5F480, 0x0000BFFE //A13= -9.9993286506283835663204999212e-01
-//A2 = 9.8905599532797250361682017683e-01 + 5.1778575360788420716540100000e-17
-data8 0x3FEFA658C23B1578, 0x3C8DD92B45408D07
-//A1 = -5.7721566490153275452712478000e-01+ -1.0607938730998824663273110000e-16
-data8 0xBFE2788CFC6FB618, 0xBC9E9346F8FDE55B
-//A0 = 9.9999999999999988897769753748e-01 + 1.1102230246251564036631420000e-16
-data8 0x3FEFFFFFFFFFFFFF, 0x3C9FFFFFFFFFFFFF
-data8 0xFFF7FEBB545812C1, 0x00003FFE //A12 = 9.9987785409425126648628395084e-01
-data8 0xFFF00C02E943A3F2, 0x0000BFFE //A11= -9.9975657530855116454438747397e-01
-data8 0xFFE0420AADC53820, 0x00003FFE //A10 = 9.9951565514290485919027183699e-01
-data8 0xFFC01EB42EF27EEB, 0x0000BFFE //A9 = -9.9902526759155739377365522320e-01
-data8 0xFF83DAD0BF23FF12, 0x00003FFE //A8 = 9.9810569378236378800364235948e-01
-data8 0xFEF9F8ABDBCDB2F3, 0x0000BFFE //A7 = -9.9600176044241699109053158187e-01
-data8 0xFE3F05375988491D, 0x00003FFE //A6 = 9.9314911462127599008937257662e-01
-LOCAL_OBJECT_END(Constants_Tgammal_poly_splitted)
-
-.align 64
-LOCAL_OBJECT_START(Constants_Tgammal_common)
-// Positive overflow value
-data8 0x3FE0000000000000 // 0.5
-data8 0x3FF8000000000000 // 1.5
-data8 0x3FD0000000000000 // 0.25
-data8 0x0000000000000000 // 0
-data8 0xDB718C066B352E21, 0x00004009 // Positive overflow value
-LOCAL_OBJECT_END(Constants_Tgammal_common)
-
-
-
-//=======================================================
-// Lgamma registers
-
-// General Purpose Registers
-GR_l_Log_Table = r33
-GR_l_Log_Table1 = r34
-GR_l_BIAS = r34
-GR_l_Index1 = r35
-GR_l_Index2 = r36
-GR_l_signif_Z = r37
-GR_l_X_0 = r38
-GR_l_X_1 = r39
-GR_l_X_2 = r40
-GR_l_Z_1 = r41
-GR_l_Z_2 = r42
-GR_l_N = r43
-GR_l_Index3 = r44
-GR_l_Stirling_Table = r45
-GR_l_N_Unbiased = r46
-
-// Floating Point Registers
-FR_l_logl_X = f8
-
-FR_l_h_3 = f10
-FR_l_poly_hi = f10
-FR_l_W = f11
-FR_l_S = f12
-FR_l_GS_hi = f13
-FR_l_Y_lo = f13
-FR_l_r_cor = f14
-FR_l_G_1 = f15
-FR_l_G = f15
-FR_l_H_1 = f32
-FR_l_H = f32
-FR_l_h = f33
-FR_l_h_1 = f33
-FR_l_N = f33
-FR_l_G_2 = f34
-FR_l_H_2 = f35
-FR_l_h_2 = f36
-FR_l_G_3 = f37
-FR_l_log2_hi = f38
-FR_l_GS_lo = f39
-FR_l_H_3 = f40
-FR_l_float_N = f41
-FR_l_Q_4 = f42
-FR_l_Q_3 = f43
-FR_l_Q_2 = f44
-FR_l_Q_1 = f45
-FR_l_Q_5 = f46
-FR_l_Q_6 = f47
-FR_l_log2_lo = f48
-FR_l_r = f49
-FR_l_poly_lo = f50
-FR_l_poly = f51
-FR_l_rsq = f52
-FR_l_Y_lo_res = f53
-
-FR_l_Y0 = f55
-FR_l_Q0 = f56
-FR_l_E0 = f57
-FR_l_E2 = f58
-FR_l_E1 = f59
-FR_l_Y1 = f60
-FR_l_E3 = f61
-FR_l_Y2 = f62
-
-FR_l_Z = f63
-FR_l_Z2 = f64
-FR_l_Z4 = f65
-FR_l_Z8 = f66
-
-FR_l_CH = f67
-FR_l_CL = f68
-
-FR_l_B2 = f69
-FR_l_B4 = f70
-FR_l_B6 = f71
-FR_l_B8 = f72
-FR_l_B10 = f73
-FR_l_B12 = f74
-FR_l_B14 = f75
-FR_l_B16 = f76
-FR_l_B18 = f77
-FR_l_Half = f78
-FR_l_SS = f79
-FR_l_AbsX_m_Half = f80
-FR_l_CXH = f81
-FR_l_CXL = f82
-FR_l_SSCXH = f83
-FR_l_SSCXL = f84
-FR_l_XYH = f85
-FR_l_XYL = f86
-FR_l_Temp = f87
-
-FR_l_logl_YHi = f88
-FR_l_logl_YLo = f89
-
-FR_l_SignedXYH = f123
-
-FR_l_AbsX = f127
-
-
-
-//=======================================================
-// Negative part registers
-
-// General Purpose Registers
-GR_n_sin_Table = r47
-GR_n_XN = r48
-
-// Float point registers
-FR_n_IXNS = f125
-FR_n_IXN = f126
-
-FR_n_XNS = f90
-FR_n_XS = f91
-FR_n_XS2 = f92
-FR_n_XS2L = f93
-FR_n_XS4 = f94
-FR_n_XS7 = f95
-FR_n_XS8 = f96
-FR_n_TT = f97
-FR_n_TH = f98
-FR_n_TL = f99
-
-FR_n_A2H = f100
-FR_n_A2L = f101
-FR_n_A1H = f102
-FR_n_A1L = f103
-FR_n_A9 = f104
-FR_n_A8 = f105
-FR_n_A7 = f106
-FR_n_A6 = f107
-FR_n_A5 = f108
-FR_n_A4 = f109
-FR_n_A3 = f110
-
-FR_n_PolyH = f111
-FR_n_PolyL = f112
-
-FR_n_Poly1H = f113
-FR_n_SinxH = f113 // the same as FR_n_Poly1H
-FR_n_Poly1L = f114
-FR_n_SinxL = f114 // the same as FR_n_Poly1L
-
-FR_n_Tail = f115
-FR_n_NegOne = f116
-
-FR_n_Y0 = f117
-
-FR_n_Q0 = f118
-FR_n_E0 = f119
-
-FR_n_E2 = f120
-FR_n_E1 = f121
-
-FR_n_Y1 = f55
-FR_n_E3 = f56
-
-FR_n_Y2 = f57
-FR_n_R0 = f58
-
-FR_n_E4 = f59
-FR_n_RcpResH = f60
-
-FR_n_Y3 = f61
-FR_n_R1 = f62
-FR_n_Temp = f63
-
-FR_n_RcpResL = f64
-
-FR_n_ResH = f65
-FR_n_ResL = f66
-
-
-
-
-//=======================================================
-// Exp registers
-
-// General Purpose Registers
-GR_e_ad_Arg = r33
-GR_e_ad_A = r34
-GR_e_signexp_x = r35
-GR_e_exp_x = r35
-GR_e_exp_mask = r36
-GR_e_ad_W1 = r37
-GR_e_ad_W2 = r38
-GR_e_M2 = r39
-GR_e_M1 = r40
-GR_e_K = r41
-GR_e_exp_2_mk = r42
-GR_e_exp_2_k = r43
-GR_e_ad_T1 = r44
-GR_e_ad_T2 = r45
-GR_e_N_fix = r46
-GR_e_one = r47
-GR_e_exp_bias = r48
-GR_e_sig_inv_ln2 = r49
-GR_e_rshf_2to51 = r50
-GR_e_exp_2tom51 = r51
-GR_e_rshf = r52
-
-// Floating Point Registers
-FR_e_RSHF_2TO51 = f10
-FR_e_INV_LN2_2TO63 = f11
-FR_e_W_2TO51_RSH = f12
-FR_e_2TOM51 = f13
-FR_e_RSHF = f14
-FR_e_Y_hi = f15
-FR_e_Y_lo = f32
-FR_e_scale = f33
-FR_e_float_N = f34
-FR_e_N_signif = f35
-FR_e_L_hi = f36
-FR_e_L_lo = f37
-FR_e_r = f38
-FR_e_W1 = f39
-FR_e_T1 = f40
-FR_e_W2 = f41
-FR_e_T2 = f42
-FR_e_W1_p1 = f43
-FR_e_rsq = f44
-FR_e_A2 = f45
-FR_e_r4 = f46
-FR_e_A3 = f47
-FR_e_poly = f48
-FR_e_T = f49
-FR_e_W = f50
-FR_e_Wp1 = f51
-FR_e_r6 = f52
-FR_e_2_mk = f53
-FR_e_A1 = f54
-FR_e_T_scale = f55
-FR_e_result_lo = f56
-FR_e_W_T_scale = f57
-FR_e_Wp1_T_scale = f58
-
-FR_e_expl_Input_X = f123
-FR_e_expl_Input_Y = f124
-FR_e_expl_Output_X = f123
-FR_e_expl_Output_Y = f124
-
-
-FR_e_expl_Input_AbsX = f122
-
-
-
-//=======================================================
-// Common registers
-
-// General Purpose Registers
-GR_c_Table = r53
-GR_c_NegUnderflow = r54
-GR_c_NegSingularity = r55
-GR_c_X = r56
-GR_c_SignBit = r57
-GR_c_13 = r58
-
-
-// Floating Point Registers
-FR_c_PosOverflow = f123
-FR_c_XN = f124
-
-
-//=======================================================
-// Polynomial part registers
-
-// General Purpose Registers
-GR_p_Table = r59
-GR_p_XN = r33
-GR_p_Table2 = r34
-GR_p_Int = r35
-GR_p_Offset = r36
-GR_p_Offset2 = r38
-GR_p_X_Sgnd = GR_l_signif_Z // = r37
-GR_p_Exp = r61
-GR_p_Bias = r62
-GR_p_0p75 = r63
-
-// Floating Point Registers
-FR_p_AbsX = FR_l_AbsX // = f127
-FR_p_IXN = FR_n_IXN // = f126
-FR_p_XN = f32
-FR_p_0p5 = f33
-FR_p_1p5 = f34
-FR_p_AbsXM1 = f35
-FR_p_2 = f36
-
-FR_p_A20 = f37
-FR_p_A19 = f38
-FR_p_A18 = f39
-FR_p_A17 = f40
-FR_p_A16 = f41
-FR_p_A15 = f42
-FR_p_A14 = f43
-FR_p_A13 = f44
-FR_p_A12 = f45
-FR_p_A11 = f46
-FR_p_A10 = f47
-FR_p_A9 = f48
-FR_p_A8 = f49
-FR_p_A7 = f50
-FR_p_A6 = f51
-FR_p_A5H = f52
-FR_p_A5L = f53
-FR_p_A4H = f54
-FR_p_A4L = f55
-FR_p_A3H = f56
-FR_p_A3L = f57
-FR_p_A2H = f58
-FR_p_A2L = f59
-FR_p_A1H = f60
-FR_p_A1L = f61
-FR_p_A0H = f62
-FR_p_A0L = f63
-
-FR_p_XR = f64
-FR_p_XR2 = f65
-FR_p_XR2L = f52
-
-FR_p_XR3 = f58
-FR_p_XR3L = f38
-
-FR_p_XR4 = f42
-FR_p_XR6 = f40
-FR_p_XR8 = f37
-
-FR_p_Poly5H = f66
-FR_p_Poly5L = f67
-FR_p_Poly4H = f53
-FR_p_Poly4L = f44
-FR_p_Poly3H = f41
-FR_p_Poly3L = f47
-FR_p_Poly2H = f68
-FR_p_Poly2L = f54
-FR_p_Poly1H = f55
-FR_p_Poly1L = f46
-FR_p_Poly0H = f39
-FR_p_Poly0L = f43
-
-FR_p_Temp5H = f69
-FR_p_Temp5L = f70
-FR_p_Temp4H = f71
-FR_p_Temp4L = f60
-FR_p_Temp2H = f72
-FR_p_Temp2L = f73
-FR_p_Temp1H = f59
-FR_p_Temp1L = f61
-FR_p_Temp0H = f49
-FR_p_Temp0L = f48
-FR_p_PolyTail = f45
-FR_p_OddPoly0H = f56
-FR_p_OddPoly0L = f51
-
-FR_p_0p25 = f73
-
-
-//=======================================================
-// Negative polynomial part registers
-// General Purpose Registers
-GR_r_sin_Table = r47
-GR_r_sin_Table2 = r60
-
-// Floating Point Registers
-FR_r_IXNS = FR_n_IXNS
-FR_r_IXN = FR_n_IXN
-
-FR_r_AbsX = FR_l_AbsX
-
-FR_r_A9 = f74
-FR_r_A8 = f75
-FR_r_A7 = f76
-FR_r_A6 = f77
-FR_r_A5 = f78
-FR_r_A4 = f79
-FR_r_A3 = f80
-FR_r_A2H = f81
-FR_r_A2L = f82
-FR_r_A1H = f83
-FR_r_A1L = f84
-
-FR_r_XNS = f85
-FR_r_XS = f86
-FR_r_XS2 = f87
-FR_r_XS2L = f88
-FR_r_XS4 = f89
-FR_r_XS7 = f90
-FR_r_XS8 = f91
-
-FR_r_Tail = f92
-
-FR_r_TT = f93
-FR_r_TH = f94
-FR_r_TL = f95
-
-FR_r_ResH = f96
-FR_r_ResL = f97
-
-FR_r_Res3H = f98
-FR_r_Res3L = f99
-
-FR_r_Res1H = f100
-FR_r_Res1L = f101
-
-
-
-FR_r_Y0 = f102
-FR_r_Q0 = f103
-FR_r_E0 = f104
-FR_r_E2 = f105
-FR_r_E1 = f106
-FR_r_Y1 = f107
-FR_r_E3 = f108
-FR_r_Y2 = f109
-FR_r_R0 = f110
-FR_r_E4 = f111
-FR_r_ZH = f112
-FR_r_Y3 = f113
-FR_r_R1 = f114
-FR_r_ZHN = f115
-FR_r_ZL = f115
-FR_r_NegOne = f116
-
-FR_z_Y0 = f102
-FR_z_Q0 = f103
-FR_z_E0 = f104
-FR_z_E2 = f105
-FR_z_E1 = f106
-FR_z_Y1 = f107
-FR_z_E3 = f108
-FR_z_Y2 = f109
-FR_z_R0 = f110
-FR_z_E4 = f111
-FR_z_ZH = f112
-FR_z_Y3 = f113
-FR_z_R1 = f114
-FR_z_ZL = f115
-
-
-// General Purpose Registers
-GR_SAVE_PFS = r32
-GR_DenOverflow = r33
-GR_u_XN = r34
-
-GR_SAVE_B0 = r35
-GR_SAVE_GP = r36
-GR_SAVE_SP = r37
-
-// Floating Point Registers
-FR_u_IXN = f34
-
-
-// ERROR HANDLER REGISTERS
-GR_Parameter_X = r64
-GR_Parameter_Y = r65
-GR_Parameter_RESULT = r66
-GR_Parameter_TAG = r67
-
-FR_RESULT = f8
-FR_X = f32
-FR_Y = f1
-
-
-.section .text
-GLOBAL_LIBM_ENTRY(tgammal)
-{ .mfi
- alloc r32 = ar.pfs,0,32,4,0
- fabs FR_l_AbsX = f8 // Get absolute value of X
- addl GR_n_sin_Table = @ltoff(Constants_Tgammal_sin), gp
-}
-{ .mfi
- addl GR_l_Log_Table=@ltoff(Constants_Tgammal_log_80_Z_G_H_h1#),gp
- nop.f 0
- addl GR_l_Stirling_Table = @ltoff(Constants_Tgammal_stirling), gp
-};;
-
-{ .mfi
- getf.sig GR_l_signif_Z = f8 // Significand of X
- fcvt.fx.s1 FR_n_IXNS = f8 // Convert to fixed point
- addl GR_c_Table = @ltoff(Constants_Tgammal_common), gp
-}
-{ .mfi
- ld8 GR_l_Log_Table = [GR_l_Log_Table]
- nop.f 0
- addl GR_p_Table = @ltoff(Constants_Tgammal_poly), gp
-};;
-
-{ .mfi
- ld8 GR_n_sin_Table = [GR_n_sin_Table]
- fclass.m p6,p0 = f8,0x1EF // Check x for NaN, 0, INF, denorm
- // NatVal.
- addl GR_c_NegSingularity = 0x1003E, r0
-}
-{ .mlx
- ld8 GR_l_Stirling_Table = [GR_l_Stirling_Table]
- movl GR_c_13 = 0x402A000000000000 // 13.0
-};;
-
-{ .mfi
- getf.d GR_c_X = f8 // Double prec. X to general register
- frcpa.s1 FR_z_Y0,p0 = f1,f8 // y = frcpa(x) (for negatives)
- extr.u GR_l_Index1 = GR_l_signif_Z, 59, 4 // = High 4 bits of Z
-}
-{ .mlx
- ld8 GR_c_Table = [GR_c_Table]
- movl GR_c_SignBit = 0x8000000000000000 // High bit (sign)
-};;
-
-{ .mfi
- ld8 GR_p_Table = [GR_p_Table]
- fcmp.lt.s1 p15, p14 = f8,f0 // p14 - positive arg, p15 - negative
- shl GR_l_Index1 = GR_l_Index1,5 // Adjust Index1 ptr (x32)
-}
-{ .mfb
- adds GR_c_NegUnderflow = 1765, r0
- nop.f 0
-(p6) br.cond.spnt tgammal_spec // Spec. values processing branch ////////////
- // (0s, INFs, NANs, NatVals, denormals) //////
-};;
-
-{ .mfi
- ldfpd FR_l_CH,FR_l_CL= [GR_l_Stirling_Table], 16 // Load CH, CL
- fcvt.fx.trunc.s1 FR_n_IXN = FR_l_AbsX // Abs arg to int by trunc
- extr.u GR_l_X_0 = GR_l_signif_Z, 49, 15 // High 15 bit of Z
-}
-{ .mfi
- add GR_l_Index1 = GR_l_Index1,GR_l_Log_Table // Add offset
- fma.s1 FR_p_2 = f1, f1, f1 // 2.0
- andcm GR_c_X = GR_c_X, GR_c_SignBit // Remove sign
-};;
-
-{ .mfi
- addl GR_l_Log_Table = @ltoff(Constants_Tgammal_log_80_Z_G_H_h2#), gp
- fcmp.lt.s1 p10, p0 = FR_l_AbsX, f1 // If |X|<1 then p10 = 1
- nop.i 0
-}
-{ .mlx
- ld2 GR_l_Z_1 = [GR_l_Index1],4 // load Z_1 from Index1
- movl GR_l_BIAS = 0x000000000000FFFF // Bias for exponent
-};;
-
-{ .mfi
- ld8 GR_l_Log_Table = [GR_l_Log_Table]
- frcpa.s1 FR_l_Y0, p0 = f1, FR_l_AbsX // y = frcpa(x)
- nop.i 0
-}
-{ .mfi
- ldfs FR_l_G_1 = [GR_l_Index1],4 // Load G_1
- fsub.s1 FR_l_W = FR_l_AbsX, f1 // W = |X|-1
- nop.i 0
-};;
-
-{ .mfi
- getf.exp GR_l_N_Unbiased= FR_l_AbsX // exponent of |X|
- fmerge.se FR_l_S = f1, FR_l_AbsX // S = merging of X and 1.0
- cmp.gtu p11, p0 = GR_c_13, GR_c_X // If 1 <= |X| < 13
- // then p11 = 1
-}
-{ .mfb
- ldfs FR_l_H_1 = [GR_l_Index1],8 // Load H_1
- fcvt.xf FR_n_XNS = FR_n_IXNS // Convert to FP repr. of int X
-(p10) br.cond.spnt tgamma_lt_1 // Branch to |X| < 1 path ///////////////////
-};;
-
-{ .mfi
- ldfpd FR_n_A2H, FR_n_A2L = [GR_n_sin_Table], 16
- nop.f 0
- pmpyshr2.u GR_l_X_1 = GR_l_X_0,GR_l_Z_1,15 // Adjust Index2 (x32)
-}
-{ .mfb
- ldfe FR_l_B2 = [GR_l_Stirling_Table], 16
- nop.f 0
-(p11) br.cond.spnt tgamma_lt_13 // Branch to 1 <= |X| < 13 path ///////////////
-};;
-
-{ .mfi
- ldfe FR_l_h_1 = [GR_l_Index1],0
- nop.f 0
- sub GR_l_N = GR_l_N_Unbiased, GR_l_BIAS // N - BIAS
-}
-{ .mib
- ldfpd FR_l_B4,FR_l_B6= [GR_l_Stirling_Table], 16 // Load C
-(p15) cmp.geu.unc p8,p0 = GR_l_N_Unbiased, GR_c_NegSingularity
-(p8) br.cond.spnt tgammal_singularity // Singularity for arg < to -2^63 //////
-};;
-
-{ .mmi
-(p15) ldfpd FR_n_A1H, FR_n_A1L = [GR_n_sin_Table], 16
- ldfpd FR_l_B8, FR_l_B10 = [GR_l_Stirling_Table], 16
- add GR_c_Table = 0x20, GR_c_Table
-};;
-
-{ .mfi
-(p15) ldfe FR_n_A9 = [GR_n_sin_Table], 16
- fma.s1 FR_l_Q0 = f1,FR_l_Y0,f0 // Q0 = Y0
- nop.i 0
-}
-{ .mfi
- ldfpd FR_l_B12, FR_l_B14 = [GR_l_Stirling_Table], 16
- fnma.s1 FR_l_E0 = FR_l_Y0,FR_l_AbsX,f1 // e = 1-b*y
- nop.i 0
-};;
-
-{ .mfi
-(p15) ldfe FR_n_A8 = [GR_n_sin_Table], 16
- fcvt.xf FR_c_XN = FR_n_IXN // Convert to FP repr. of int X
- extr.u GR_l_Index2 = GR_l_X_1, 6, 4 // Extract Index2
-}
-{ .mfi
- ldfpd FR_l_B16, FR_l_B18 = [GR_l_Stirling_Table], 16
- nop.f 0
- nop.i 0
-};;
-
-{ .mfi
-(p15) ldfe FR_n_A7 = [GR_n_sin_Table], 16
- fms.s1 FR_l_CXH = FR_l_CH, f1, FR_l_AbsX // CXH = CH+|X|
- shl GR_l_Index2 = GR_l_Index2,5
-}
-{ .mfi
- ldfd FR_l_Half = [GR_l_Stirling_Table] // Load 0.5
- nop.f 0
- nop.i 0
-};;
-
-{ .mfi
- add GR_l_Index2 = GR_l_Index2, GR_l_Log_Table // Add offset
- nop.f 0
- nop.i 0
-}
-{ .mfi
-(p15) ldfe FR_n_A6 = [GR_n_sin_Table], 16
-(p15) fma.s1 FR_n_XS = FR_l_AbsX , f1, FR_n_XNS // xs = x - int(x)
- nop.i 0
-};;
-
-{ .mmi
- ld2 GR_l_Z_2 = [GR_l_Index2],4
- addl GR_l_Log_Table = @ltoff(Constants_Tgammal_log_80_h3_G_H#),gp
- nop.i 0
-};;
-
-{ .mfi
- ld8 GR_l_Log_Table = [GR_l_Log_Table]
- fma.s1 FR_l_E2 = FR_l_E0,FR_l_E0,FR_l_E0 // e2 = e+e^2
- nop.i 0
-}
-{ .mfi
- ldfs FR_l_G_2 = [GR_l_Index2],4
- fma.s1 FR_l_E1 = FR_l_E0,FR_l_E0,f0 // e1 = e^2
- nop.i 0
-};;
-
-{ .mmi
- ldfs FR_l_H_2 = [GR_l_Index2],8
-(p15) ldfe FR_n_A5 = [GR_n_sin_Table], 16
- nop.i 0
-};;
-
-{ .mfi
- setf.sig FR_l_float_N = GR_l_N // float_N = Make N a fp number
- nop.f 0
- pmpyshr2.u GR_l_X_2 = GR_l_X_1,GR_l_Z_2,15 // X_2 = X_1 * Z_2
-}
-{ .mfi
- ldfe FR_l_h_2 = [GR_l_Index2],0
- fma.s1 FR_l_CXL = FR_l_AbsX, f1, FR_l_CXH // CXL = |X|+CXH
- add GR_l_Log_Table1= 0x200, GR_l_Log_Table
-};;
-
-{ .mfi
-(p15) ldfe FR_n_A4 = [GR_n_sin_Table], 16
-(p15) fcmp.eq.unc.s1 p9,p0 = FR_l_AbsX, FR_c_XN //if argument is integer
- // and negative
- nop.i 0
-}
-{ .mfi
- ldfe FR_c_PosOverflow = [GR_c_Table],16 //Load pos overflow value
-(p15) fma.s1 FR_n_XS2 = FR_n_XS, FR_n_XS, f0 // xs^2 = xs*xs
- nop.i 0
-};;
-
-{ .mfi
-(p15) ldfe FR_n_A3 = [GR_n_sin_Table], 16
- nop.f 0
- nop.i 0
-};;
-
-{ .mfi
-(p15) getf.sig GR_n_XN = FR_n_IXN // int(x) to general reg
- fma.s1 FR_l_Y1 = FR_l_Y0,FR_l_E2,FR_l_Y0 // y1 = y+y*e2
- nop.i 0
-}
-{ .mfb
- nop.m 0
- fma.s1 FR_l_E3 = FR_l_E1,FR_l_E1,FR_l_E0 // e3 = e+e1^2
-(p9) br.cond.spnt tgammal_singularity // Singularity for integer /////////////
- // and negative arguments //////////////
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_l_AbsX_m_Half = FR_l_AbsX, f1, FR_l_Half // |x|-0.5
- extr.u GR_l_Index2 = GR_l_X_2, 1, 5 // Get Index3
-};;
-
-{ .mfi
- shladd GR_l_Log_Table1= GR_l_Index2, 2, GR_l_Log_Table1
- nop.f 0
- shladd GR_l_Index3 = GR_l_Index2,4, GR_l_Log_Table // Index3
-}
-{ .mfb
-(p15) cmp.gtu.unc p11, p0 = GR_n_XN, GR_c_NegUnderflow // X < -1765
- fms.s1 FR_l_CXL = FR_l_CH, f1, FR_l_CXL // CXL = CH - CXL
-(p11) br.cond.spnt tgammal_underflow // Singularity for negative argument //////
- // at underflow domain (X < -1765) //////
-};;
-
-{ .mfi
- addl GR_l_Log_Table = @ltoff(Constants_Tgammal_log_80_Q#), gp
-(p15) fma.s1 FR_n_TT = FR_n_A2L, FR_n_XS2, f0 // T=A2L*x^2
- tbit.nz.unc p13, p12 = GR_n_XN, 0x0 // whether [X] odd or even
-}
-{ .mfi
- nop.m 0
-(p15) fms.s1 FR_n_XS2L = FR_n_XS, FR_n_XS, FR_n_XS2 // xs^2 Low part
- nop.i 0
-};;
-
-{ .mfi
- ld8 GR_l_Log_Table = [GR_l_Log_Table]
-(p15) fma.s1 FR_n_A7 = FR_n_A8, FR_n_XS2, FR_n_A7 // poly tail
- nop.i 0
-}
-{ .mfi
- ldfe FR_l_h_3 = [GR_l_Index3],12
-(p15) fma.s1 FR_n_XS4 = FR_n_XS2, FR_n_XS2, f0 // xs^4 = xs^2*xs^2
- nop.i 0
-};;
-
-{ .mfi
- ldfs FR_l_H_3 = [GR_l_Log_Table1], 0
- fma.s1 FR_l_Y2 = FR_l_Y1, FR_l_E3, FR_l_Y0 // y2 = y+y1*e3
- nop.i 0
-}
-{ .mfi
- ldfs FR_l_G_3 = [GR_l_Index3], 0
- fnma.s1 FR_l_Z = FR_l_AbsX,FR_l_Q0,f1 // r = a-b*q
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fmpy.s1 FR_l_G = FR_l_G_1, FR_l_G_2 // G = G1 * G_2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fadd.s1 FR_l_H = FR_l_H_1, FR_l_H_2 // H = H_1 + H_2
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_l_log2_hi = [GR_l_Log_Table],16 // load log2_hi part
- fadd.s1 FR_l_h = FR_l_h_1, FR_l_h_2 // h = h_1 + h_2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fcvt.xf FR_l_float_N = FR_l_float_N // int(N)
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_l_log2_lo = [GR_l_Log_Table],16 // Load log2_lo part
- fma.s1 FR_l_CXL = FR_l_CXL, f1, FR_l_CL
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_TT = FR_n_A2H, FR_n_XS2L, FR_n_TT // T=A2H*x2L+T
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_l_Q_6 = [GR_l_Log_Table],16
-(p15) fma.s1 FR_n_A3 = FR_n_A4, FR_n_XS2, FR_n_A3 // poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_A5 = FR_n_A6, FR_n_XS2, FR_n_A5 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_l_Q_5 = [GR_l_Log_Table],16
-(p15) fabs FR_n_XS = FR_n_XS // abs(xs)
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_l_Z = FR_l_Z,FR_l_Y2,FR_l_Q0 // x_hi = q+r*y2
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_l_Q_4 = [GR_l_Log_Table],16
-(p15) fma.s1 FR_n_A7 = FR_n_A9, FR_n_XS4, FR_n_A7 // poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_XS7 = FR_n_XS4, FR_n_XS2, f0 // = x^4*x^2
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_l_Q_3 = [GR_l_Log_Table],16
- fneg FR_n_NegOne = f1 // -1.0
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_XS8 = FR_n_XS4, FR_n_XS4, f0 // xs^8 = xs^4*xs^4
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_l_Q_2 = [GR_l_Log_Table],16
- fadd.s1 FR_l_h = FR_l_h, FR_l_h_3 // h = h_1 + h_2 + h_3
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_TH = FR_n_A2H, FR_n_XS2, FR_n_TT // A2H*xs2+T
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_l_Q_1 = [GR_l_Log_Table],16
- fmpy.s1 FR_l_G = FR_l_G, FR_l_G_3 // G = G_1 * G_2 * G_3
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fadd.s1 FR_l_H = FR_l_H, FR_l_H_3 // H = H_1 + H_2 + H_3
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_Z2 = FR_l_Z, FR_l_Z, f0 // Z^2
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_A3 = FR_n_A5, FR_n_XS4, FR_n_A3 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p14) fcmp.gt.unc.s1 p7,p0 = FR_l_AbsX, FR_c_PosOverflow //X > 1755.5483
- // (overflow domain, result cannot be represented by normal value)
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_XS7 = FR_n_XS7, FR_n_XS, f0 // x^7 construction
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fms.s1 FR_n_TL = FR_n_A2H, FR_n_XS2, FR_n_TH // A2H*xs2+TH
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_PolyH = FR_n_TH, f1, FR_n_A1H // PolyH=TH+A1H
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fmpy.s1 FR_l_GS_hi = FR_l_G, FR_l_S // GS_hi = G*S
- nop.i 0
-}
-{ .mfb
- nop.m 0
- fms.s1 FR_l_r = FR_l_G, FR_l_S, f1 // r = G*S -1
-(p7) br.cond.spnt tgammal_overflow // Overflow path for arg > 1755.5483 //////
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_B14 = FR_l_B16, FR_l_Z2, FR_l_B14// Bernoulli tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_l_Z4 = FR_l_Z2, FR_l_Z2, f0 // Z^4 = Z^2*Z^2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_B2 = FR_l_B4, FR_l_Z2, FR_l_B2 // Bernoulli tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_l_B6 = FR_l_B8, FR_l_Z2, FR_l_B6 // Bernoulli tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_B10 = FR_l_B12, FR_l_Z2, FR_l_B10// Bernoulli tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_Tail = FR_n_A7, FR_n_XS8, FR_n_A3 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_TL = FR_n_TL, f1, FR_n_TT // TL = TL+T
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fms.s1 FR_n_PolyL = FR_n_A1H, f1, FR_n_PolyH // polyH+A1H
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_poly_lo = FR_l_r, FR_l_Q_6, FR_l_Q_5 // Q_5+r*Q_6
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fsub.s1 FR_l_r_cor = FR_l_GS_hi, f1 // r_cor = GS_hi -1
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_l_GS_lo = FR_l_G, FR_l_S, FR_l_GS_hi // G*S-GS_hi
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_l_poly = FR_l_r, FR_l_Q_2, FR_l_Q_1 //poly=r*Q2+Q1
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fmpy.s1 FR_l_rsq = FR_l_r, FR_l_r // rsq = r * r
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_l_G = FR_l_float_N, FR_l_log2_hi, FR_l_H // Tbl =
- // float_N*log2_hi + H
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_Y_lo = FR_l_float_N, FR_l_log2_lo, FR_l_h // Y_lo=
- // float_N*log2_lo + h
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_l_B14 = FR_l_B18, FR_l_Z4, FR_l_B14 //bernulli tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_B2 = FR_l_B6, FR_l_Z4, FR_l_B2 //bernulli tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_l_Z8 = FR_l_Z4, FR_l_Z4, f0 //bernulli tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_poly_lo = FR_l_r, FR_l_poly_lo, FR_l_Q_4 // poly_lo =
- // Q_4 + r * poly_lo
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fsub.s1 FR_l_r_cor = FR_l_r_cor, FR_l_r // r_cor = r_cor - r
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_PolyL = FR_n_PolyL, f1, FR_n_TH // polyL+TH
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_TT = FR_n_TL, f1, FR_n_A1L // TL+A1L
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fadd.s1 FR_l_logl_YHi = FR_l_G, FR_l_r // Y_hi = Tbl + r
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_B10 = FR_l_B14, FR_l_Z4, FR_l_B10 //bernulli tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_poly_lo = FR_l_r, FR_l_poly_lo, FR_l_Q_3 // poly_lo =
- // Q_3 + r * poly_lo
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fadd.s1 FR_l_r_cor = FR_l_r_cor, FR_l_GS_lo // r_cor=r_cor+GS_lo
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_PolyL = FR_n_PolyL, f1, FR_n_TT // polyL+TT
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fsub.s1 FR_l_Y_lo_res = FR_l_G, FR_l_logl_YHi // Y_lo = Tbl - Y_hi
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_l_XYH = FR_l_logl_YHi, FR_l_AbsX_m_Half, f0 // XYH=
- // YHi*|x-0.5|
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_SS = FR_l_B10, FR_l_Z8, FR_l_B2 // Bernoulli tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fadd.s1 FR_l_r_cor = FR_l_r_cor, FR_l_Y_lo // r_cor = r_cor+Y_lo
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_l_poly = FR_l_rsq, FR_l_poly_lo, FR_l_poly //poly=
- // r^2*polyLo+poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_TT = FR_n_PolyL, FR_n_XS2, f0 // T=polyL*xs^2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fadd.s1 FR_l_Y_lo = FR_l_Y_lo_res, FR_l_r // Y_lo = Y_lo + r
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_l_XYL = FR_l_logl_YHi, FR_l_AbsX_m_Half, FR_l_XYH
- // XYL = YHi*|x-0.5|-XYH
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_SSCXH = FR_l_SS, FR_l_Z, FR_l_CXH // SS*Z+CXH
- nop.i 0
-}
-{ .mfi
- mov GR_e_exp_2tom51= 0xffff-51 // 2^-51
-(p15) fma.s1 FR_l_SignedXYH = FR_l_XYH, FR_n_NegOne, f0 // XYH = -XYH
- // for negatives
- nop.i 0
-};;
-
-{ .mlx
- nop.m 0
- movl GR_e_rshf_2to51 = 0x4718000000000000 // 1.10000 2^(63+51)
-}
-{ .mlx
- nop.m 0
- movl GR_e_sig_inv_ln2 = 0xb8aa3b295c17f0bc //significand of 1/ln2
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_poly = FR_l_rsq, FR_l_poly, FR_l_r_cor // poly =
- // rsq * poly + r_cor
- nop.i 0
-};;
-
-{ .mfi
- addl GR_e_ad_Arg = @ltoff(Constants_Tgammal_exp_64_Arg#),gp
-(p15) fma.s1 FR_n_TT = FR_n_PolyH, FR_n_XS2L, FR_n_TT
- mov GR_e_exp_mask = 0x1FFFF // Form exponent mask
-}
-{ .mlx
- nop.m 0
- movl GR_e_rshf = 0x43e8000000000000 // 1.10000 2^63 rshift
-};;
-
-
-{ .mmi
- setf.sig FR_e_INV_LN2_2TO63 = GR_e_sig_inv_ln2 // form 1/ln2 * 2^63
- setf.d FR_e_RSHF_2TO51 = GR_e_rshf_2to51 // 1.1000 * 2^(63+51)
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_l_SSCXL = FR_l_CXH, f1, FR_l_SSCXH // CXH+SS*CXH
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_e_expl_Input_AbsX = FR_l_XYH, f1, FR_l_SSCXH // HI EXP
- nop.i 0
-};;
-
-.pred.rel "mutex",p14,p15
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_e_expl_Input_X = FR_l_XYH, f1, FR_l_SSCXH // HI EXP
- mov GR_e_exp_bias = 0x0FFFF // Set exponent bias
-}
-{ .mfi
- ld8 GR_e_ad_Arg = [GR_e_ad_Arg] // Point to Arg table
-(p15) fms.s1 FR_e_expl_Input_X = FR_l_SignedXYH, f1, FR_l_SSCXH // HI EXP
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fadd.s1 FR_l_logl_YLo = FR_l_Y_lo, FR_l_poly // YLo = YLo+poly
- nop.i 0
-};;
-
-{ .mfi
- setf.exp FR_e_2TOM51 = GR_e_exp_2tom51 //2^-51 for scaling float_N
-(p15) fma.s1 FR_n_TH = FR_n_PolyH, FR_n_XS2, FR_n_TT // TH=
- // polyH*xs^2+T
- nop.i 0
-}
-{ .mib
- setf.d FR_e_RSHF = GR_e_rshf // Right shift const 1.1000*2^63
- nop.i 0
- nop.b 0
-};;
-
-{ .mfi
- add GR_e_ad_A = 0x20, GR_e_ad_Arg // Point to A table
- nop.f 0
- add GR_e_ad_T1 = 0x50, GR_e_ad_Arg // Point to T1 table
-}
-{ .mfi
- add GR_e_ad_T2 = 0x150, GR_e_ad_Arg // Point to T2 table
- nop.f 0
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_SSCXL = FR_l_SS, FR_l_Z, FR_l_SSCXL
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_e_expl_Input_Y = FR_l_XYH, f1, FR_e_expl_Input_AbsX
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_e_L_hi = [GR_e_ad_Arg],16 // Get L_hi
- nop.f 0
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_XYL = FR_l_logl_YLo, FR_l_AbsX_m_Half, FR_l_XYL
- // XYL = YLo*|x-0.5|+XYL
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_e_L_lo = [GR_e_ad_Arg],16 // Get L_lo
-(p15) fms.s1 FR_n_TL = FR_n_PolyH, FR_n_XS2, FR_n_TH // TL =
- // = polyH*xs^2-TH
- add GR_e_ad_W1 = 0x100, GR_e_ad_T2 // Point to W1 table
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_Poly1H = FR_n_TH, f1, f1 // poly1H = TH+1
- add GR_e_ad_W2 = 0x300, GR_e_ad_T2 // Point to W2 table
-};;
-
-{ .mmi
- getf.exp GR_e_signexp_x = FR_e_expl_Input_X // Extract sign and exp
- ldfe FR_e_A3 = [GR_e_ad_A],16 // Get A3
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_SSCXL = FR_l_SSCXL, f1, FR_l_CXL
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_e_expl_Input_Y = FR_e_expl_Input_Y, f1, FR_l_SSCXH
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_e_N_signif=FR_e_expl_Input_X,FR_e_INV_LN2_2TO63,FR_e_RSHF_2TO51
- and GR_e_exp_x = GR_e_signexp_x, GR_e_exp_mask
-};;
-
-{ .mmi
- sub GR_e_exp_x = GR_e_exp_x, GR_e_exp_bias // Get exponent
- ldfe FR_e_A2 = [GR_e_ad_A],16 // Get A2 for main path
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_PolyH = FR_n_Poly1H, FR_n_XS, f0//sin(Pi*x) poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fms.s1 FR_n_Poly1L = f1, f1, FR_n_Poly1H//sin(Pi*x) poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_TL = FR_n_TL, f1, FR_n_TT//sin(Pi*x) poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_l_Temp = FR_l_XYL, f1, FR_l_SSCXL // XYL+SS*CXL
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_e_expl_Input_Y = FR_e_expl_Input_Y, FR_n_NegOne, f0
- // Negate lo part of exp argument for negative input values
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_e_A1 = [GR_e_ad_A],16 // Get A1
- nop.f 0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_e_float_N = FR_e_N_signif, FR_e_2TOM51, FR_e_RSHF
- // Get float N = signd*2^51-RSHIFTER
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_Poly1L = FR_n_Poly1L, f1, FR_n_TH //sin(Pi*x) poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fms.s1 FR_n_PolyL = FR_n_Poly1H, FR_n_XS, FR_n_PolyH//sin(Pi*x)
- nop.i 0
-};;
-
-{ .mfi
- getf.sig GR_e_N_fix = FR_e_N_signif // Get N from significand
- nop.f 0
- nop.i 0
-};;
-
-.pred.rel "mutex",p14,p15
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_e_expl_Input_Y = FR_e_expl_Input_Y, f1, FR_l_Temp
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fms.s1 FR_e_expl_Input_Y = FR_e_expl_Input_Y, f1, FR_l_Temp
- // arguments for exp computation
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fnma.s1 FR_e_r = FR_e_L_hi, FR_e_float_N, FR_e_expl_Input_X
- // r = -L_hi * float_N + x
- extr.u GR_e_M1 = GR_e_N_fix, 6, 6 // Extract index M_1
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_Poly1L = FR_n_Poly1L, f1, FR_n_TL //sin(Pi*x) poly
- nop.i 0
-};;
-
-
-{ .mmf
- nop.m 0
- nop.m 0
- fma.s1 FR_e_r = FR_e_r, f1, FR_e_expl_Input_Y
- // r = r + FR_e_expl_Input_Y
-};;
-
-{ .mmi
- shladd GR_e_ad_W1 = GR_e_M1,3,GR_e_ad_W1 // Point to W1
- shladd GR_e_ad_T1 = GR_e_M1,2,GR_e_ad_T1 // Point to T1
- extr.u GR_e_M2 = GR_e_N_fix, 0, 6 // Extract index M_2
-};;
-
-
-{ .mfi
- ldfs FR_e_T1 = [GR_e_ad_T1],0 // Get T1
- nop.f 0
- extr GR_e_K = GR_e_N_fix, 12, 32 //Extract limit range K
-}
-{ .mfi
- shladd GR_e_ad_T2 = GR_e_M2,2,GR_e_ad_T2 // Point to T2
-(p15) fma.s1 FR_n_PolyL = FR_n_Poly1L, FR_n_XS, FR_n_PolyL
- //sin(Pi*x) poly
- shladd GR_e_ad_W2 = GR_e_M2,3,GR_e_ad_W2 // Point to W2
-};;
-
-{ .mfi
- ldfs FR_e_T2 = [GR_e_ad_T2],0 // Get T2
- nop.f 0
- add GR_e_exp_2_k = GR_e_exp_bias, GR_e_K // exp of 2^k
-}
-{ .mfi
- ldfd FR_e_W1 = [GR_e_ad_W1],0 // Get W1
- nop.f 0
- sub GR_e_exp_2_mk = GR_e_exp_bias, GR_e_K // exp of 2^-k
-};;
-
-{ .mmi
- ldfd FR_e_W2 = [GR_e_ad_W2],0 // Get W2
- nop.m 0
- nop.i 0
-};;
-
-{ .mmf
- setf.exp FR_e_scale = GR_e_exp_2_k // Set scale = 2^k
- setf.exp FR_e_2_mk = GR_e_exp_2_mk // Form 2^-k
- fnma.s1 FR_e_r = FR_e_L_lo, FR_e_float_N, FR_e_r
- // r = -L_lo * float_N + r
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_PolyL = FR_n_Tail, FR_n_XS7, FR_n_PolyL
- //sin(Pi*x) poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_e_poly = FR_e_r, FR_e_A3, FR_e_A2 // poly=r*A3+A2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fmpy.s1 FR_e_rsq = FR_e_r, FR_e_r // rsq = r * r
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fmpy.s1 FR_e_T = FR_e_T1, FR_e_T2 // T = T1 * T2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fadd.s1 FR_e_W1_p1 = FR_e_W1, f1 // W1_p1 = W1 + 1.0
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_TT = FR_n_PolyL, FR_l_AbsX, f0 //sin(Pi*x) poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_e_poly = FR_e_r, FR_e_poly, FR_e_A1
- // poly = r * poly + A1
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_e_T_scale = FR_e_T, FR_e_scale, f0 // T_scale=T*scale
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_e_W = FR_e_W2, FR_e_W1_p1, FR_e_W1
- // W = W2 * (W1+1.0) + W1
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_SinxH = FR_n_PolyH, FR_l_AbsX, FR_n_TT
- // sin(Pi*x) poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- mov FR_e_Y_hi = FR_e_T // Assume Y_hi = T
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_e_poly = FR_e_rsq, FR_e_poly, FR_e_r
- // poly = rsq * poly + r
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_e_Wp1_T_scale = FR_e_W, FR_e_T_scale, FR_e_T_scale
- // (W+1)*T*scale
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_e_W_T_scale = FR_e_W, FR_e_T_scale, f0 // W*T*scale
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fms.s1 FR_n_SinxL = FR_n_PolyH, FR_l_AbsX, FR_n_SinxH
- // Low part of sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) frcpa.s1 FR_n_Y0, p0 = f1, FR_n_SinxH // y = frcpa(b)
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_e_result_lo = FR_e_Wp1_T_scale, FR_e_poly, FR_e_W_T_scale
- // Low part of exp result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_SinxL = FR_n_SinxL, f1, FR_n_TT // sin low result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p15) fma.s1 FR_n_Q0 = f1,FR_n_Y0,f0 // q = y
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p15) fnma.s1 FR_n_E0 = FR_n_Y0, FR_n_SinxH, f1 // e = 1-b*y
- nop.i 0
-};;
-
-
-{ .mfb
- nop.m 0
-(p14) fma.s0 f8 = FR_e_Y_hi, FR_e_scale, FR_e_result_lo
-(p14) br.ret.spnt b0 // Exit for positive Stirling path //////////////////////
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_e_expl_Output_X = FR_e_Y_hi, FR_e_scale, f0 // exp result
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_e_expl_Output_Y = FR_e_result_lo, f1, f0// exp lo result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_n_E2 = FR_n_E0,FR_n_E0,FR_n_E0 // e2 = e+e^2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_n_E1 = FR_n_E0,FR_n_E0,f0 // e1 = e^2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_n_Y1 = FR_n_Y0,FR_n_E2,FR_n_Y0 // y1 = y+y*e2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_n_E3 = FR_n_E1,FR_n_E1,FR_n_E0 // e3 = e+e1^2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_n_Y2 = FR_n_Y1,FR_n_E3,FR_n_Y0 // y2 = y+y1*e3
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fnma.s1 FR_n_R0 = FR_n_SinxH,FR_n_Q0,f1 // r = a-b*q
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fnma.s1 FR_n_E4 = FR_n_SinxH,FR_n_Y2,f1 // e4 = 1-b*y2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_n_RcpResH = FR_n_R0,FR_n_Y2,FR_n_Q0 // x = q+r*y2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_n_Y3 = FR_n_Y2,FR_n_E4,FR_n_Y2 // y3 = y2+y2*e4
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fnma.s1 FR_n_R1 = FR_n_SinxH,FR_n_RcpResH,f1 // r1 = a-b*x
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fnma.s1 FR_n_R1 = FR_n_SinxL,FR_n_RcpResH,FR_n_R1
- // r1 = r1 - b_lo*X
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_n_RcpResL = FR_n_R1,FR_n_Y3,f0 // x_lo = r1*y3
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_n_Temp = FR_n_RcpResH, FR_e_expl_Output_Y, f0
- // Multiplying exp and sin result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_n_Temp = FR_n_RcpResL, FR_e_expl_Output_X, FR_n_Temp
- // Multiplying exp and sin result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_n_ResH = FR_n_RcpResH, FR_e_expl_Output_X, FR_n_Temp
- // Multiplying exp and sin result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_n_ResL = FR_n_RcpResH, FR_e_expl_Output_X, FR_n_ResH
- // Multiplying exp and sin result
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p12) fma.s1 FR_n_ResH = FR_n_ResH, FR_n_NegOne, f0 // Negate
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_n_ResL = FR_n_ResL, f1, FR_n_Temp
- // Multiplying exp and sin result - low result obtained
- nop.i 0
-};;
-
-.pred.rel "mutex",p12,p13
-{ .mfi
- nop.m 0
-(p13) fma.s0 f8 = FR_n_ResH, f1, FR_n_ResL // For odd
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p12) fms.s0 f8 = FR_n_ResH, f1, FR_n_ResL // For even
- br.ret.sptk b0 // Exit for negative Stirling path //////////////////////
-};;
-
-
-//////////// 1 <= |X| < 13 path ////////////////////////////////////////////////
-//------------------------------------------------------------------------------
-.align 64
-tgamma_lt_13:
-{ .mfi
- getf.sig GR_p_XN = FR_p_IXN // Get significand
- fcvt.xf FR_p_XN = FR_p_IXN // xn = [x]
- add GR_r_sin_Table2= 0x40, GR_r_sin_Table // Shifted table addr.
-}
-{ .mfi
- ldfpd FR_p_0p5, FR_p_1p5 = [GR_c_Table], 16 // 0.5 & 1.5
- fms.s1 FR_p_AbsXM1 = FR_p_AbsX, f1, f1 // X-1
- add GR_p_Table2 = 0xB0, GR_p_Table
-};;
-
-{ .mfi
- add GR_r_sin_Table = -16, GR_r_sin_Table // For compensation
- fcvt.xf FR_r_XNS = FR_r_IXNS // Convert int repr to float
- shr.u GR_p_X_Sgnd = GR_p_X_Sgnd, 59 // Get only 5 bit of signd
-};;
-
-{ .mfi
- ldfpd FR_r_A2H,FR_r_A2L = [GR_r_sin_Table], 16 // Load A2
- nop.f 0
- add GR_p_Int = -2, GR_p_XN // int = int - 2
-}
-{ .mfi
- ldfe FR_r_A6 = [GR_r_sin_Table2], 16
- nop.f 0
- cmp.gtu p11, p12 = 0x2, GR_p_XN // p11: x < 2 (splitted intervals),
- // p12: x > 2 (base intervals)
-};;
-
-{ .mfi
- ldfpd FR_r_A1H, FR_r_A1L = [GR_r_sin_Table], 16
- nop.f 0
- shr GR_p_Int = GR_p_Int, 1 // int/2
-}
-{ .mfi
- ldfe FR_r_A5 = [GR_r_sin_Table2], 16
- nop.f 0
-(p11) cmp.gtu.unc p10, p11 = 0x1C, GR_p_X_Sgnd // sgnd(x) < 0.75
-};;
-
-{ .mfi
- ldfe FR_r_A9 = [GR_r_sin_Table], 16
- nop.f 0
- shl GR_p_Offset = GR_p_Int, 4 // offset = int*16
-}
-{ .mfi
- ldfe FR_r_A4 = [GR_r_sin_Table2], 16
- nop.f 0
-(p10) cmp.gtu.unc p9, p10 = 0x14, GR_p_X_Sgnd // sgnd(x) < 0.25
-};;
-
-
-{ .mfi
- ldfe FR_r_A8 = [GR_r_sin_Table], 16
- nop.f 0
-(p12) tbit.nz.unc p13, p12 = GR_p_XN, 0x0 // p13: reccurent computations
- // X is at [3;4], [5;6], [7;8]... interval
-}
-{ .mfi
- ldfe FR_r_A3 = [GR_r_sin_Table2], 16
- nop.f 0
- shladd GR_p_Offset = GR_p_Int, 2, GR_p_Offset // +int*4
-};;
-
-.pred.rel "mutex",p9,p11
-{ .mfi
- add GR_p_Offset = GR_p_Int, GR_p_Offset
- // +int, so offset = int*21
-(p9) fms.s1 FR_p_XR = FR_p_AbsX, f1, f1 // r = x-1
- nop.i 0
-}
-{ .mfi
- ldfe FR_r_A7 = [GR_r_sin_Table], 16
-(p11) fms.s1 FR_p_XR = FR_p_2, f1, FR_p_AbsX
- // r = 2-x for 1.75 < x < 2
- nop.i 0
-};;
-
-.pred.rel "mutex",p9,p10
-.pred.rel "mutex",p10,p11
-.pred.rel "mutex",p9,p11
-{ .mfi
-(p9) add GR_p_Offset = 126, r0 // 1.0 < x < 1.25 table
-(p15) fcmp.eq.unc.s1 p7,p0 = FR_p_AbsX, FR_p_XN
- // If arg is integer and negative - singularity branch
- nop.i 0
-}
-{ .mfi
-(p10) add GR_p_Offset = 147, r0 // 1.25 < x < 1.75 table
- nop.f 0
-(p11) add GR_p_Offset = 168, r0 // 1.75 < x < 2.0 table
-};;
-
-{ .mmf
- shladd GR_p_Table = GR_p_Offset, 4, GR_p_Table
- shladd GR_p_Table2 = GR_p_Offset, 4, GR_p_Table2
- fma.s1 FR_r_XS = FR_r_AbsX , f1, FR_r_XNS // xs = x - [x]
-};;
-
-{ .mmb
- ldfpd FR_p_A5H, FR_p_A5L = [GR_p_Table], 16
- ldfpd FR_p_A2H, FR_p_A2L = [GR_p_Table2], 16
-(p7) br.cond.spnt tgammal_singularity // Singularity for integer /////////////
- // and negative argument ///////////////
-};;
-
-{ .mfi
- ldfpd FR_p_A4H, FR_p_A4L = [GR_p_Table], 16
- fma.s1 FR_p_XN = FR_p_XN, f1, FR_p_0p5 // xn = xn+0.5
- nop.i 0
-}
-{ .mfi
- ldfpd FR_p_A1H, FR_p_A1L = [GR_p_Table2], 16
-(p10) fms.s1 FR_p_XR = FR_p_AbsX, f1, FR_p_1p5 // r = x - 1.5
- nop.i 0
-};;
-
-{ .mmi
- ldfpd FR_p_A3H, FR_p_A3L = [GR_p_Table], 16
- ldfpd FR_p_A0H, FR_p_A0L = [GR_p_Table2], 16
- nop.i 0
-};;
-
-{ .mmi
- ldfe FR_p_A20 = [GR_p_Table], 16
- ldfe FR_p_A12 = [GR_p_Table2], 16
- nop.i 0
-};;
-
-{ .mmf
- ldfe FR_p_A19 = [GR_p_Table], 16
- ldfe FR_p_A11 = [GR_p_Table2], 16
- fma.s1 FR_r_XS2 = FR_r_XS, FR_r_XS, f0 // xs2 = xs*xs
-};;
-
-{ .mmi
- ldfe FR_p_A18 = [GR_p_Table], 16
- ldfe FR_p_A10 = [GR_p_Table2], 16
- nop.i 0
-};;
-
-.pred.rel "mutex",p12,p13
-{ .mfi
- ldfe FR_p_A17 = [GR_p_Table], 16
-(p12) fms.s1 FR_p_XR = FR_p_AbsX, f1, FR_p_XN // r = x - xn
- nop.i 0
-}
-{ .mfi
- ldfe FR_p_A9 = [GR_p_Table2], 16
-(p13) fms.s1 FR_p_XR = FR_p_AbsX, f1, FR_p_XN
- nop.i 0
-};;
-
-{ .mmi
- ldfe FR_p_A16 = [GR_p_Table], 16
- ldfe FR_p_A8 = [GR_p_Table2], 16
-(p9) cmp.eq p12, p0 = r0, r0 // clear p12
-};;
-
-{ .mmi
- ldfe FR_p_A15 = [GR_p_Table], 16
- ldfe FR_p_A7 = [GR_p_Table2], 16
-(p10) cmp.eq p12, p0 = r0, r0 // clear p12
-};;
-
-{ .mfi
- ldfe FR_p_A14 = [GR_p_Table], 16
- fma.s1 FR_r_TH = FR_r_A2H, FR_r_XS2, f0 // sin for neg
-(p11) cmp.eq p12, p0 = r0, r0 // clear p12
-}
-{ .mfi
- ldfe FR_p_A6 = [GR_p_Table2], 16
- fma.s1 FR_r_TL = FR_r_A2L, FR_r_XS2, f0 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_p_A13 = [GR_p_Table], 16
- fms.s1 FR_r_XS2L = FR_r_XS, FR_r_XS, FR_r_XS2 // x2Lo part
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp5H = FR_p_A5H, FR_p_XR, f0 // A5H*r
- // 'Low poly'
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR2 = FR_p_XR, FR_p_XR, f0 // r^2 = r*r
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fabs FR_r_XS = FR_r_XS // abs(xs)
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp2H = FR_p_A2H, FR_p_XR, f0 // A2H*r
- // 'High poly'
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_TT = FR_r_A2H, FR_r_XS2, FR_r_TH // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResH = FR_r_TH, f1, FR_r_A1H // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_r_A2H, FR_r_XS2L, FR_r_TL // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Temp5L = FR_p_A5H,FR_p_XR,FR_p_Temp5H //A5H*r delta
- // 'Low poly'
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly5H = FR_p_Temp5H, f1, FR_p_A4H // A5H*r+A4H
- // 'Low poly'
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Temp2L = FR_p_A2H, FR_p_XR, FR_p_Temp2H//A2H*r delta
- //'High poly'
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly2H = FR_p_Temp2H, f1, FR_p_A1H // A2H*r+A1H
- //'High poly'
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR3 = FR_p_XR2, FR_p_XR, f0 // r^3 = r^2*r
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_p_XR2L = FR_p_XR, FR_p_XR, FR_p_XR2 // r^2 delta
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A18 = FR_p_A19, FR_p_XR, FR_p_A18 // Poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A14 = FR_p_A15, FR_p_XR, FR_p_A14 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR4 = FR_p_XR2, FR_p_XR2, f0 // r^4 = r^2*r^2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp5L = FR_p_A5L, FR_p_XR, FR_p_Temp5L// Low part
- // of A5*r+A4
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Poly5L = FR_p_A4H, f1, FR_p_Poly5H // Low part
- // of A5*r+A4
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp4H = FR_p_Poly5H, FR_p_XR, f0 // (A5H*r+A4H)*r
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp2L = FR_p_A2L, FR_p_XR, FR_p_Temp2L // A2*r low
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Poly2L = FR_p_A1H, f1, FR_p_Poly2H // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp1H = FR_p_Poly2H, FR_p_XR, f0 // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_XR3L = FR_p_XR2, FR_p_XR, FR_p_XR3 // x^3 delta
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A16 = FR_p_A17, FR_p_XR, FR_p_A16 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_ResL = FR_r_A1H, f1, FR_r_ResH // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_r_TL, f1, FR_r_TT // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp5L = FR_p_Temp5L, f1, FR_p_A4L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly5L = FR_p_Poly5L, f1, FR_p_Temp5H // Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Temp4L = FR_p_Poly5H,FR_p_XR,FR_p_Temp4H //Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly4H = FR_p_Temp4H, f1, FR_p_A3H // Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp2L = FR_p_Temp2L, f1, FR_p_A1L // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly2L = FR_p_Poly2L, f1, FR_p_Temp2H // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Temp1L = FR_p_Poly2H,FR_p_XR,FR_p_Temp1H //High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly1H = FR_p_Temp1H, f1, FR_p_A0H // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A12 = FR_p_A13, FR_p_XR, FR_p_A12 // Poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR3L = FR_p_XR2L, FR_p_XR, FR_p_XR3L // x^3 low
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly5L = FR_p_Poly5L, f1, FR_p_Temp5L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A10 = FR_p_A11, FR_p_XR, FR_p_A10 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Poly4L = FR_p_A3H, f1, FR_p_Poly4H // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A6 = FR_p_A7, FR_p_XR, FR_p_A6 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A8 = FR_p_A9, FR_p_XR, FR_p_A8 // Poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR6 = FR_p_XR4, FR_p_XR2, f0 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly2L = FR_p_Poly2L, f1, FR_p_Temp2L // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Poly1L = FR_p_A0H, f1, FR_p_Poly1H // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TH // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TT = FR_r_TL, f1, FR_r_A1L // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp4L = FR_p_Poly5L,FR_p_XR,FR_p_Temp4L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A18 = FR_p_A20, FR_p_XR2, FR_p_A18 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly4L = FR_p_Poly4L, f1, FR_p_Temp4H // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A14 = FR_p_A16, FR_p_XR2, FR_p_A14 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A6 = FR_p_A8, FR_p_XR2, FR_p_A6 // Poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A10 = FR_p_A12, FR_p_XR2, FR_p_A10 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp1L = FR_p_Poly2L,FR_p_XR,FR_p_Temp1L //High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly1L = FR_p_Poly1L, f1, FR_p_Temp1H // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TT // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TH = FR_r_ResH, FR_r_XS2, f0 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp4L = FR_p_Temp4L, f1, FR_p_A3L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly3H = FR_p_Poly4H, FR_p_XR3, f0 // Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A14 = FR_p_A18, FR_p_XR4, FR_p_A14 // Poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR8 = FR_p_XR4, FR_p_XR4, f0 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_r_ResH, FR_r_XS2L, f0 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp1L = FR_p_Temp1L, f1, FR_p_A0L // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A6 = FR_p_A10, FR_p_XR4, FR_p_A6 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_TT = FR_r_ResH, FR_r_XS2, FR_r_TH // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Res3H = FR_r_TH, f1, f1 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly4L = FR_p_Poly4L, f1, FR_p_Temp4L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly3L = FR_p_Poly4H, FR_p_XR3L, f0 // Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly0H = FR_p_Poly3H,f1,FR_p_Poly1H //Low & High add
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_A7 = FR_r_A8, FR_r_XS2, FR_r_A7 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_r_ResL, FR_r_XS2, FR_r_TL // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_XS4 = FR_r_XS2, FR_r_XS2, f0 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly1L = FR_p_Poly1L, f1, FR_p_Temp1L // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_PolyTail = FR_p_A14, FR_p_XR8, FR_p_A6 // Poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_Res3L = f1, f1, FR_r_Res3H // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResH = FR_r_Res3H, FR_r_XS, f0 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Temp0L = FR_p_Poly4H,FR_p_XR3,FR_p_Poly3H //Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly3L = FR_p_Poly4L,FR_p_XR3,FR_p_Poly3L //Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Poly0L = FR_p_Poly1H,f1,FR_p_Poly0H //Low & High add
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p13) fma.s1 FR_p_OddPoly0H = FR_p_Poly0H, FR_p_AbsXM1, f0
- // Reccurent computations - multiplying by X-1
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_r_TL, f1, FR_r_TT // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_A3 = FR_r_A4, FR_r_XS2, FR_r_A3 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly1L = FR_p_PolyTail,FR_p_XR6,FR_p_Poly1L//High
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_A5 = FR_r_A6, FR_r_XS2, FR_r_A5 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Res3L = FR_r_Res3L, f1, FR_r_TH // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_r_ResL = FR_r_Res3H, FR_r_XS, FR_r_ResH//sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly3L = FR_p_Poly3L, f1, FR_p_Temp0L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_A7 = FR_r_A9, FR_r_XS4, FR_r_A7 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly0L = FR_p_Poly0L,f1,FR_p_Poly3H //Low & High add
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p13) fms.s1 FR_p_OddPoly0L = FR_p_Poly0H, FR_p_AbsXM1, FR_p_OddPoly0H
- // Reccurent computations - multiplying by X-1 (low part)
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_A3 = FR_r_A5, FR_r_XS4, FR_r_A3 // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_XS7 = FR_r_XS4, FR_r_XS2, f0 // xs^6
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Res3L = FR_r_Res3L, f1, FR_r_TL // sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_XS8 = FR_r_XS4, FR_r_XS4, f0 // sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp0H = FR_p_Poly3L,f1,FR_p_Poly1L //Low & High add
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_XS7 = FR_r_XS7, FR_r_XS, f0 // xs^7
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResL = FR_r_Res3L, FR_r_XS, FR_r_ResL//sin for neg
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Tail = FR_r_A7, FR_r_XS8, FR_r_A3 // sin tail res
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly0L = FR_p_Poly0L,f1,FR_p_Temp0H //Low & High add
- nop.i 0
-};;
-
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResL = FR_r_Tail,FR_r_XS7,FR_r_ResL //sin for neg
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p13) fma.s1 FR_p_OddPoly0L = FR_p_Poly0L, FR_p_AbsXM1, FR_p_OddPoly0L
- // Reccurent computations - multiplying by X-1 (low part)
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TT = FR_r_ResL, FR_r_AbsX, f0 // X*sin
- nop.i 0
-};;
-
-.pred.rel "mutex",p12,p13
-{ .mfi
- nop.m 0
-(p12) fma.s0 f8 = FR_p_Poly0H, f1, FR_p_Poly0L // Even
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p13) fma.s0 f8 = FR_p_OddPoly0H, f1, FR_p_OddPoly0L // Odd
-(p14) br.ret.spnt b0 // Exit for 1 <= |X| < 13 path (positive arguments)/////
-};;
-
-{ .mfi
- nop.m 0
-(p13) fma.s1 FR_p_Poly0H = FR_p_OddPoly0H, f1, f0
- // Reccurent computations
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p13) fma.s1 FR_p_Poly0L = FR_p_OddPoly0L, f1, f0
- // Reccurent computations
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Res1H = FR_r_ResH, FR_r_AbsX, FR_r_TT // X*sin
-(p11) cmp.eq p13, p12 = r0, r0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_Res1L = FR_r_ResH,FR_r_AbsX,FR_r_Res1H// X*sin
-(p9) cmp.eq p13, p12 = r0, r0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Res1L = FR_r_Res1L, f1, FR_r_TT // sin for neg
-(p10) cmp.eq p13, p12 = r0, r0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_p_Poly0L, FR_r_Res1H, f0 // mult by sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_p_Poly0H,FR_r_Res1L,FR_r_TL//mult by sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResH = FR_p_Poly0H,FR_r_Res1H,FR_r_TL//mult by sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_ResL = FR_p_Poly0H,FR_r_Res1H,FR_r_ResH//sin mult
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- frcpa.s1 FR_r_Y0,p0 = f1,FR_r_ResH // y = frcpa(b)
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fneg FR_r_NegOne = f1 // Form -1.0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TL //Low result of mult
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Q0 = f1,FR_r_Y0,f0 // q = a*y
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fnma.s1 FR_r_E0 = FR_r_Y0,FR_r_ResH,f1 // e = 1-b*y
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_E2 = FR_r_E0,FR_r_E0,FR_r_E0 // e2 = e+e^2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_E1 = FR_r_E0,FR_r_E0,f0 // e1 = e^2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Y1 = FR_r_Y0,FR_r_E2,FR_r_Y0 // y1 = y+y*e2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_E3 = FR_r_E1,FR_r_E1,FR_r_E0 // e3 = e+e1^2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Y2 = FR_r_Y1,FR_r_E3,FR_r_Y0 // y2 = y+y1*e3
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fnma.s1 FR_r_R0 = FR_r_ResH,FR_r_Q0,f1 // r = a-b*q
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fnma.s1 FR_r_E4 = FR_r_ResH,FR_r_Y2,f1 // e4 = 1-b*y2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ZH = FR_r_R0,FR_r_Y2,FR_r_Q0 // x = q+r*y2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Y3 = FR_r_Y2,FR_r_E4,FR_r_Y2 // y3 = y2+y2*e4
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fnma.s1 FR_r_R1 = FR_r_ResH,FR_r_ZH,f1 // r1 = a-b*x
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fnma.s1 FR_r_R1 = FR_r_ResL,FR_r_ZH,FR_r_R1 // r1=r1-b_lo*X
- nop.i 0
-}
-{ .mfi
- nop.m 0
-(p12) fma.s1 FR_r_ZHN = FR_r_ZH,FR_r_NegOne, f0 // Negate for evens
- nop.i 0
-};;
-
-.pred.rel "mutex",p13,p12
-{ .mfi
- nop.m 0
-(p13) fma.s0 f8 = FR_r_R1,FR_r_Y3,FR_r_ZH // Final result
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p12) fnma.s0 f8 = FR_r_R1,FR_r_Y3,FR_r_ZHN // Final result
- br.ret.sptk b0 // Exit for 1 <= |X| < 13 path (negative arguments)//////
-};;
-
-
-//////////// |X| < 1 path /////////////////////////////////////////////////////
-//------------------------------------------------------------------------------
-.align 64
-tgamma_lt_1:
-{ .mfi
- getf.exp GR_p_Exp = FR_p_AbsX // exp of abs X
- fma.s1 FR_z_Q0 = f1,FR_z_Y0,f0 // q = a*y
- add GR_r_sin_Table2= 0x50, GR_r_sin_Table
-}
-{ .mfi
- ldfpd FR_p_0p5, FR_p_1p5 = [GR_c_Table], 16
- fnma.s1 FR_z_E0 = FR_z_Y0,f8,f1 // e = 1-b*y
- add GR_p_Table2 = 0xB0, GR_p_Table
-};;
-
-{ .mfi
- ldfd FR_p_0p25 = [GR_c_Table]
- fcvt.xf FR_r_XNS = FR_r_IXNS // Convert int repr to float
- shr.u GR_p_X_Sgnd = GR_p_X_Sgnd, 60
- // Obtain only 4 bits of significand
-}
-{ .mfi
- nop.m 0
- nop.f 0
- add GR_p_Bias = 0xffff, r0 // Set bias
-};;
-
-{ .mfi
- ldfpd FR_r_A2H, FR_r_A2L = [GR_r_sin_Table], 16
- nop.f 0
- shl GR_p_XN = GR_p_Exp, 4
- // Shift exp to 4 bits left to set place for significand
-}
-{ .mlx
- ldfe FR_r_A6 = [GR_r_sin_Table2], 16
- movl GR_p_0p75 = 0xfffec // 0.75
-};;
-
-{ .mfi
- ldfpd FR_r_A1H, FR_r_A1L = [GR_r_sin_Table], 16
- nop.f 0
- or GR_p_XN = GR_p_XN, GR_p_X_Sgnd
- // Combine exp with 4 high bits of significand
-}
-{ .mfi
- ldfe FR_r_A5 = [GR_r_sin_Table2], 16
- nop.f 0
- sub GR_p_Exp = GR_p_Exp, GR_p_Bias // Unbiased exp
-};;
-
-{ .mmi
- ldfe FR_r_A9 = [GR_r_sin_Table], 16
- ldfe FR_r_A4 = [GR_r_sin_Table2], 16
- cmp.gtu.unc p10, p11 = GR_p_0p75, GR_p_XN // sgnd(x) < 0.75
-};;
-
-{ .mfi
- ldfe FR_r_A8 = [GR_r_sin_Table], 16
- fma.s1 FR_z_E2 = FR_z_E0,FR_z_E0,FR_z_E0 // e2 = e+e^2
-(p10) cmp.gt.unc p9, p10 = -2, GR_p_Exp // x < 0.25
-}
-{ .mfi
- ldfe FR_r_A3 = [GR_r_sin_Table2], 16
- fma.s1 FR_z_E1 = FR_z_E0,FR_z_E0,f0 // e1 = e^2
-(p11) add GR_p_Offset = 168, r0 // [0.75;1] interval
-};;
-
-{ .mmi
-(p10) add GR_p_Offset = 147, r0 // [0.25;0.75] interval
- ldfe FR_r_A7 = [GR_r_sin_Table], 16
-(p9) cmp.gt.unc p8, p9 = -3, GR_p_Exp // x < 0.125
-};;
-
-.pred.rel "mutex",p9,p8
-{ .mmi
-(p9) add GR_p_Offset = 126, r0 // [0.125;0.25] interval
-(p8) add GR_p_Offset = 189, r0 // [0.;0.125] interval
- nop.i 0
-};;
-
-{ .mmf
- shladd GR_p_Table = GR_p_Offset, 4, GR_p_Table //Make addresses
- shladd GR_p_Table2 = GR_p_Offset, 4, GR_p_Table2
- fma.s1 FR_r_XS = FR_r_AbsX , f1, FR_r_XNS // xs = |x|-[x]
-};;
-
-.pred.rel "mutex",p8,p11
-{ .mfi
- ldfpd FR_p_A5H, FR_p_A5L = [GR_p_Table], 16
-(p11) fms.s1 FR_p_XR = f1, f1, FR_p_AbsX // r = 1 - |x|
- // for [0.75;1] interval
- nop.i 0
-}
-{ .mfi
- ldfpd FR_p_A2H, FR_p_A2L = [GR_p_Table2], 16
-(p8) fms.s1 FR_p_XR = FR_p_AbsX, f1, f0 // r = |x|
- // for [0.;0.125] interval
- nop.i 0
-};;
-
-{ .mfi
- ldfpd FR_p_A4H, FR_p_A4L = [GR_p_Table], 16
- fma.s1 FR_z_Y1 = FR_z_Y0,FR_z_E2,FR_z_Y0 // y1 = y+y*e2
- nop.i 0
-}
-{ .mfi
- ldfpd FR_p_A1H, FR_p_A1L = [GR_p_Table2], 16
- fma.s1 FR_z_E3 = FR_z_E1,FR_z_E1,FR_z_E0 // e3 = e+e1^2
- nop.i 0
-};;
-
-.pred.rel "mutex",p9,p10
-{ .mfi
- ldfpd FR_p_A3H, FR_p_A3L = [GR_p_Table], 16
-(p9) fms.s1 FR_p_XR = FR_p_AbsX, f1, f0 // r = |x|
- // for [0.125;0.25] interval
- nop.i 0
-}
-{ .mfi
- ldfpd FR_p_A0H, FR_p_A0L = [GR_p_Table2], 16
-(p10) fms.s1 FR_p_XR = FR_p_AbsX, f1, FR_p_0p5 // r = |x| - 0.5
- // for [0.25;0.75] interval
- nop.i 0
-};;
-
-{ .mmi
- ldfe FR_p_A20 = [GR_p_Table], 16
- ldfe FR_p_A12 = [GR_p_Table2], 16
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_p_A19 = [GR_p_Table], 16
- fma.s1 FR_r_XS2 = FR_r_XS, FR_r_XS, f0 // xs^2
- nop.i 0
-}
-{ .mfi
- ldfe FR_p_A11 = [GR_p_Table2], 16
- nop.f 0
- nop.i 0
-};;
-
-{ .mmi
- ldfe FR_p_A18 = [GR_p_Table], 16
- ldfe FR_p_A10 = [GR_p_Table2], 16
- nop.i 0
-};;
-
-.pred.rel "mutex",p12,p13
-{ .mfi
- ldfe FR_p_A17 = [GR_p_Table], 16
- fma.s1 FR_z_Y2 = FR_z_Y1,FR_z_E3,FR_z_Y0 // y2 = y+y1*e3
- nop.i 0
-}
-{ .mfi
- ldfe FR_p_A9 = [GR_p_Table2], 16
- fnma.s1 FR_z_R0 = f8,FR_z_Q0,f1 // r = a-b*q
- nop.i 0
-};;
-
-{ .mmi
- ldfe FR_p_A16 = [GR_p_Table], 16
- ldfe FR_p_A8 = [GR_p_Table2], 16
- nop.i 0
-};;
-
-{ .mmi
- ldfe FR_p_A15 = [GR_p_Table], 16
- ldfe FR_p_A7 = [GR_p_Table2], 16
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_p_A14 = [GR_p_Table], 16
- fma.s1 FR_r_TH = FR_r_A2H, FR_r_XS2, f0 // neg sin
- nop.i 0
-}
-{ .mfi
- ldfe FR_p_A6 = [GR_p_Table2], 16
- fma.s1 FR_r_TL = FR_r_A2L, FR_r_XS2, f0 // neg sin
- nop.i 0
-};;
-
-{ .mfi
- ldfe FR_p_A13 = [GR_p_Table], 16
- fms.s1 FR_r_XS2L = FR_r_XS, FR_r_XS, FR_r_XS2 // xs^2 delta
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp5H = FR_p_A5H, FR_p_XR, f0 // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR2 = FR_p_XR, FR_p_XR, f0 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fabs FR_r_XS = FR_r_XS // Absolute value of xs
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp2H = FR_p_A2H, FR_p_XR, f0 // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fnma.s1 FR_z_E4 = f8,FR_z_Y2,f1 // e4 = 1-b*y2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_z_ZH = FR_z_R0,FR_z_Y2,FR_z_Q0 // 1/x = q+r*y2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_TT = FR_r_A2H, FR_r_XS2, FR_r_TH // neg sin
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResH = FR_r_TH, f1, FR_r_A1H // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_r_A2H, FR_r_XS2L, FR_r_TL // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Temp5L = FR_p_A5H, FR_p_XR, FR_p_Temp5H // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly5H = FR_p_Temp5H, f1, FR_p_A4H // Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Temp2L = FR_p_A2H, FR_p_XR, FR_p_Temp2H // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly2H = FR_p_Temp2H, f1, FR_p_A1H // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR3 = FR_p_XR2, FR_p_XR, f0 // r^3
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_p_XR2L = FR_p_XR, FR_p_XR, FR_p_XR2 // r^2 delta
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A18 = FR_p_A19, FR_p_XR, FR_p_A18 // poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A14 = FR_p_A15, FR_p_XR, FR_p_A14 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR4 = FR_p_XR2, FR_p_XR2, f0 // poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_z_Y3 = FR_z_Y2,FR_z_E4,FR_z_Y2 // y3 = y2+y2*e4
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp5L = FR_p_A5L, FR_p_XR, FR_p_Temp5L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Poly5L = FR_p_A4H, f1, FR_p_Poly5H // Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp4H = FR_p_Poly5H, FR_p_XR, f0 // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp2L = FR_p_A2L, FR_p_XR, FR_p_Temp2L // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Poly2L = FR_p_A1H, f1, FR_p_Poly2H // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp1H = FR_p_Poly2H, FR_p_XR, f0 // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_XR3L = FR_p_XR2, FR_p_XR, FR_p_XR3 // x^3 delta
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A16 = FR_p_A17, FR_p_XR, FR_p_A16 //poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_ResL = FR_r_A1H, f1, FR_r_ResH // neg sin
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_r_TL, f1, FR_r_TT // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp5L = FR_p_Temp5L, f1, FR_p_A4L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly5L = FR_p_Poly5L, f1, FR_p_Temp5H //Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Temp4L = FR_p_Poly5H, FR_p_XR, FR_p_Temp4H//Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly4H = FR_p_Temp4H, f1, FR_p_A3H // Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp2L = FR_p_Temp2L, f1, FR_p_A1L // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly2L = FR_p_Poly2L, f1, FR_p_Temp2H // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Temp1L = FR_p_Poly2H,FR_p_XR,FR_p_Temp1H //High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly1H = FR_p_Temp1H, f1, FR_p_A0H // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A12 = FR_p_A13, FR_p_XR, FR_p_A12 // poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR3L = FR_p_XR2L, FR_p_XR, FR_p_XR3L // x^3 low
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly5L = FR_p_Poly5L, f1, FR_p_Temp5L //Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A10 = FR_p_A11, FR_p_XR, FR_p_A10 //poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Poly4L = FR_p_A3H, f1, FR_p_Poly4H /// Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A6 = FR_p_A7, FR_p_XR, FR_p_A6 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A8 = FR_p_A9, FR_p_XR, FR_p_A8 // poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR6 = FR_p_XR4, FR_p_XR2, f0 // r^6
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly2L = FR_p_Poly2L, f1, FR_p_Temp2L // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Poly1L = FR_p_A0H, f1, FR_p_Poly1H // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TH // neg sin
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TT = FR_r_TL, f1, FR_r_A1L // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp4L = FR_p_Poly5L,FR_p_XR,FR_p_Temp4L //Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A18 = FR_p_A20, FR_p_XR2, FR_p_A18 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly4L = FR_p_Poly4L, f1, FR_p_Temp4H // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A14 = FR_p_A16, FR_p_XR2, FR_p_A14 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A6 = FR_p_A8, FR_p_XR2, FR_p_A6 // poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A10 = FR_p_A12, FR_p_XR2, FR_p_A10 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp1L = FR_p_Poly2L,FR_p_XR,FR_p_Temp1L //High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly1L = FR_p_Poly1L, f1, FR_p_Temp1H // High poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TT // neg sin
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TH = FR_r_ResH, FR_r_XS2, f0 // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp4L = FR_p_Temp4L, f1, FR_p_A3L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly3H = FR_p_Poly4H, FR_p_XR3, f0 // Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A14 = FR_p_A18, FR_p_XR4, FR_p_A14 // poly tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_XR8 = FR_p_XR4, FR_p_XR4, f0 // r^8
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_r_ResH, FR_r_XS2L, f0 // neg sin
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fnma.s1 FR_z_R1 = f8,FR_z_ZH,f1 // r1 = a-b*x
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp1L = FR_p_Temp1L, f1, FR_p_A0L // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_A6 = FR_p_A10, FR_p_XR4, FR_p_A6 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_TT = FR_r_ResH, FR_r_XS2, FR_r_TH // neg sin
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Res3H = FR_r_TH, f1, f1 // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly4L = FR_p_Poly4L, f1, FR_p_Temp4L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly3L = FR_p_Poly4H, FR_p_XR3L, f0 // Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly0H = FR_p_Poly3H, f1, FR_p_Poly1H // Result
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_A7 = FR_r_A8, FR_r_XS2, FR_r_A7 // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_r_ResL, FR_r_XS2, FR_r_TL // neg sin
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_XS4 = FR_r_XS2, FR_r_XS2, f0 // xs^4
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly1L = FR_p_Poly1L, f1, FR_p_Temp1L // High poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_PolyTail = FR_p_A14, FR_p_XR8, FR_p_A6 // poly tail
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_Res3L = f1, f1, FR_r_Res3H // neg sin
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResH = FR_r_Res3H, FR_r_XS, f0 // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Temp0L = FR_p_Poly4H,FR_p_XR3,FR_p_Poly3H //Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly3L = FR_p_Poly4L,FR_p_XR3,FR_p_Poly3L //Low poly
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_p_Poly0L = FR_p_Poly1H, f1, FR_p_Poly0H // Result
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_z_ZL = FR_z_R1,FR_z_Y3, f0 // x_lo = r1*y3
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_r_TL, f1, FR_r_TT // neg sin
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_A3 = FR_r_A4, FR_r_XS2, FR_r_A3 /// neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly1L = FR_p_PolyTail,FR_p_XR6,FR_p_Poly1L // High
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_A5 = FR_r_A6, FR_r_XS2, FR_r_A5 // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Res3L = FR_r_Res3L, f1, FR_r_TH // neg sin
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fms.s1 FR_r_ResL = FR_r_Res3H, FR_r_XS, FR_r_ResH // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly3L = FR_p_Poly3L, f1, FR_p_Temp0L // Low poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_A7 = FR_r_A9, FR_r_XS4, FR_r_A7 // neg sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly0L = FR_p_Poly0L, f1, FR_p_Poly3H // result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p14) fma.s1 f8 = FR_p_Poly0H, FR_z_ZH, f0 // z*poly
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp1L = FR_p_Poly0H, FR_z_ZL, f0 // z*poly low
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_A3 = FR_r_A5, FR_r_XS4, FR_r_A3 // sin tail
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_XS7 = FR_r_XS4, FR_r_XS2, f0 // xs^6
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Res3L = FR_r_Res3L, f1, FR_r_TL // sin low
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_XS8 = FR_r_XS4, FR_r_XS4, f0 // xs^8
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Temp0H = FR_p_Poly3L, f1, FR_p_Poly1L // result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p14) fms.s1 FR_p_Temp1H = FR_p_Poly0H, FR_z_ZH, f8 // hi result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_XS7 = FR_r_XS7, FR_r_XS, f0 // xs^7
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResL = FR_r_Res3L, FR_r_XS, FR_r_ResL // lo result
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Tail = FR_r_A7, FR_r_XS8, FR_r_A3 // tail result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_p_Poly0L = FR_p_Poly0L, f1, FR_p_Temp0H // lo result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResL = FR_r_Tail, FR_r_XS7, FR_r_ResL // lo result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_p_Temp1L = FR_p_Poly0L,FR_z_ZH,FR_p_Temp1L //hi result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TT = FR_r_ResL, f1, f0 // for low result
- nop.i 0
-};;
-
-.pred.rel "mutex",p12,p13
-{ .mfi
- nop.m 0
-(p14) fma.s1 FR_p_Temp1L = FR_p_Temp1L, f1, FR_p_Temp1H // for lo res
- nop.i 0
-};;
-
-{ .mfi
-(p10) cmp.eq p13, p12 = r0, r0 // set p13, clear p12
- fma.s1 FR_r_Res1H = FR_r_ResH, f1, FR_r_TT // hi res
- nop.i 0
-};;
-
-{ .mfb
-(p9) cmp.eq p13, p12 = r0, r0 // set p13, clear p12
-(p14) fma.s0 f8 = f8, f1, FR_p_Temp1L // Final result
-(p14) br.ret.spnt b0 // Exit for 0 < |X| < 1 path (positive arguments)///////
-};;
-
-{ .mfi
-(p11) cmp.eq p13, p12 = r0, r0 // set p13, clear p12
- fms.s1 FR_r_Res1L = FR_r_ResH, f1, FR_r_Res1H // Low sin result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Res1L = FR_r_Res1L, f1, FR_r_TT // Low sin result
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_p_Poly0L,FR_r_Res1H,f0 //Low sin result
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_TL = FR_p_Poly0H, FR_r_Res1L, FR_r_TL //Low sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResH = FR_p_Poly0H, FR_r_Res1H, FR_r_TL //High sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fms.s1 FR_r_ResL = FR_p_Poly0H,FR_r_Res1H,FR_r_ResH //Low res
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- frcpa.s1 FR_r_Y0,p0 = f1,FR_r_ResH // y = frcpa(b)
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fneg FR_r_NegOne = f1 // Construct -1.0
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TL // low sin
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Q0 = f1,FR_r_Y0,f0 // q = a*y
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fnma.s1 FR_r_E0 = FR_r_Y0,FR_r_ResH,f1 // e = 1-b*y
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_E2 = FR_r_E0,FR_r_E0,FR_r_E0 // e2 = e+e^2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_E1 = FR_r_E0,FR_r_E0,f0 // e1 = e^2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Y1 = FR_r_Y0,FR_r_E2,FR_r_Y0 // y1 = y+y*e2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_E3 = FR_r_E1,FR_r_E1,FR_r_E0 // e3 = e+e1^2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Y2 = FR_r_Y1,FR_r_E3,FR_r_Y0 // y2 = y+y1*e3
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fnma.s1 FR_r_R0 = FR_r_ResH,FR_r_Q0,f1 // r = a-b*q
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fnma.s1 FR_r_E4 = FR_r_ResH,FR_r_Y2,f1 // e4 = 1-b*y2
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ZH = FR_r_R0,FR_r_Y2,FR_r_Q0 // x = q+r*y2
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fma.s1 FR_r_Y3 = FR_r_Y2,FR_r_E4,FR_r_Y2 // y3 = y2+y2*e4
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fnma.s1 FR_r_R1 = FR_r_ResH,FR_r_ZH,f1 // r1 = a-b*x
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- fnma.s1 FR_r_R1 = FR_r_ResL,FR_r_ZH,FR_r_R1 // r1=r1 - b_lo*X
- nop.i 0
-}
-{ .mfi
- nop.m 0
- fma.s1 FR_r_ZHN = FR_r_ZH,FR_r_NegOne, f0 // Negate
- nop.i 0
-};;
-
-.pred.rel "mutex",p13,p12
-{ .mfb
- nop.m 0
- fnma.s0 f8 = FR_r_R1,FR_r_Y3,FR_r_ZHN // Result for neg
- br.ret.sptk b0 // Exit for 0 < |X| < 1 path (negative arguments)//////
-};;
-
-
-
-
-// SPECIALS (x for natval, nan, +/-inf or +/-0) ///////////////////////////////
-//------------------------------------------------------------------------------
-.align 32
-tgammal_spec:
-{ .mlx
- nop.m 0
- movl GR_DenOverflow = 0x2000000000000001
-}
-{ .mfi
- nop.m 0
- fclass.m p9,p0 = f8,0xB // +/-denormals
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fclass.m p6,p0 = f8,0x1E1 // Test x for natval, nan, +inf
- nop.i 0
-};;
-{ .mfi
- nop.m 0
- fclass.m p7,p8 = f8,0x7 // +/-0
- nop.i 0
-}
-
-{ .mfi
-(p9) cmp.ltu.unc p10,p11 = GR_l_signif_Z, GR_DenOverflow
-(p9) fnorm.s0 f8 = f8
- nop.i 0
-};;
-
-{ .mfb
- nop.m 0
-(p9) fcvt.fx.trunc.s1 FR_n_IXN = FR_l_AbsX // Round by truncate
-(p11) br.cond.sptk tgamma_lt_1 // Return to gamma ('good' denormal)////////////
-};;
-
-{ .mfb
- nop.m 0
- nop.f 0
-(p10) br.cond.spnt tgammal_overflow // "Bad" denormal - overflow! /////////////
-};;
-
-{ .mfi
- nop.m 0
- mov FR_X = f8 // for error handler
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p6) fma.s0 f8 = f8,f1,f8 // res = x + x
-(p6) br.ret.spnt b0 // Exit for NAN, INF and NatVals ////////////////////////
-};;
-.pred.rel "mutex",p7,p8
-{ .mfi
-(p7) mov GR_Parameter_TAG = 256 // negative
-(p7) frcpa.s0 f8,p0 = f1,f8 // Raise V flag
- nop.i 0
-}
-{ .mfb
- nop.m 0
- nop.f 0
-(p8) br.cond.spnt tgammal_singularity // Branch for +ZERO ////////////////////
-};;
-
-{ .mfb
- nop.m 0
- nop.f 0
- br.cond.spnt tgammal_libm_err // Branch for -ZERO ///////////////////////
-};;
-
-
-
-
-// SINGULARITY (x is negative integer or 0) ////////////////////////////////////
-//------------------------------------------------------------------------------
-.align 32
-tgammal_singularity:
-{ .mfi
- nop.m 0
- mov FR_X = f8 // For error handler
- mov GR_Parameter_TAG = 256 // negative
-}
-{ .mfb
- nop.m 0
- frcpa.s0 f8,p0 = f0,f0 // Raise V flag
- br.cond.sptk tgammal_libm_err // Call error handler /////////////////////
- // with singularity error /////////////////
-};;
-
-
-
-
-// OVERFLOW (result is too big and cannot be represented by normal value) //////
-// ( X > 1755.54 and for denormals with abs value less than 0x2000000000000001 )
-//------------------------------------------------------------------------------
-.align 32
-tgammal_overflow:
-{ .mfi
- addl r8 = 0x1FFFE, r0 // Exp of INF
- fcmp.lt.s1 p15,p14 = f8,f0 // p14 - pos arg, p15 - neg arg
- nop.i 0
-};;
-
-{ .mfi
- setf.exp f9 = r8
- mov FR_X = f8 // For error handler
- mov GR_Parameter_TAG = 255 // overflow
-};;
-
-.pred.rel "mutex",p14,p15
-{ .mfi
- nop.m 0
-(p14) fma.s0 f8 = f9,f9,f0 // Set I,O and +INF result
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p15) fnma.s0 f8 = f9,f9,f0 // Set I,O and -INF result
- br.cond.sptk tgammal_libm_err // Call error handler /////////////////////
- // with overflow error ////////////////////
-};;
-
-
-
-
-
-// UNDERFLOW (x is negative noninteger with big absolute value) ////////////////
-//------------------------------------------------------------------------------
-.align 32
-tgammal_underflow:
-{ .mfi
- nop.m 0
- fcvt.fx.trunc.s1 FR_u_IXN = f8 // Convert arg to int repres. in FR
- nop.i 0
-};;
-
-{ .mmi
- getf.sig GR_u_XN = FR_u_IXN
- mov r11 = 0x00001
- nop.i 0
-};;
-
-{ .mfi
- setf.exp f9 = r11
- nop.f 0
- nop.i 0
-};;
-
-{ .mfi
- nop.m 0
- nop.f 0
- tbit.z p6,p7 = GR_u_XN,0 // even or odd
-};;
-
-.pred.rel "mutex",p6,p7
-{ .mfi
- nop.m 0
-(p6) fms.s0 f8 = f9,f9,f9 // for negatives
- nop.i 0
-}
-{ .mfb
- nop.m 0
-(p7) fma.s0 f8 = f9,f9,f9 // for positives
- br.ret.sptk b0 // Exit for underflow path //////////////////////////////
-};;
-
-
-GLOBAL_LIBM_END(tgammal)
-
-
-
-
-////////////////// Tgammal error handler ///////////////////////////////////////
-//------------------------------------------------------------------------------
-LOCAL_LIBM_ENTRY(__libm_error_region)
-tgammal_libm_err:
-.prologue
-{ .mfi
- add GR_Parameter_Y=-32,sp // Parameter 2 value
- nop.f 0
-.save ar.pfs,GR_SAVE_PFS
- mov GR_SAVE_PFS=ar.pfs // Save ar.pfs
-}
-{ .mfi
-.fframe 64
- add sp=-64,sp // Create new stack
- nop.f 0
- mov GR_SAVE_GP=gp // Save gp
-};;
-{ .mmi
- stfe [GR_Parameter_Y] = FR_Y,16 // Save Parameter 2 on stack
- add GR_Parameter_X = 16,sp // Parameter 1 address
-.save b0, GR_SAVE_B0
- mov GR_SAVE_B0=b0 // Save b0
-};;
-.body
-{ .mib
- stfe [GR_Parameter_X] = FR_X // Store Parameter 1 on stack
- add GR_Parameter_RESULT = 0,GR_Parameter_Y
- nop.b 0 // Parameter 3 address
-}
-{ .mib
- stfe [GR_Parameter_Y] = FR_RESULT // Store Parameter 3 on stack
- add GR_Parameter_Y = -16,GR_Parameter_Y
- br.call.sptk b0=__libm_error_support# // Call error handling function
-};;
-{ .mmi
- nop.m 999
- nop.m 999
- add GR_Parameter_RESULT = 48,sp
-};;
-{ .mmi
- ldfe f8 = [GR_Parameter_RESULT] // Get return result off stack
-.restore sp
- add sp = 64,sp // Restore stack pointer
- mov b0 = GR_SAVE_B0 // Restore return address
-};;
-{ .mib
- mov gp = GR_SAVE_GP // Restore gp
- mov ar.pfs = GR_SAVE_PFS // Restore ar.pfs
- br.ret.sptk b0 // Return
-};;
-
-LOCAL_LIBM_END(__libm_error_region#)
-
-.type __libm_error_support#,@function
-.global __libm_error_support#
diff --git a/sysdeps/ia64/fpu/slowpow.c b/sysdeps/ia64/fpu/w_tgammal.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/ia64/fpu/slowpow.c
+++ b/sysdeps/ia64/fpu/w_tgammal.c
diff --git a/sysdeps/ia64/fpu/w_tgammal_compat.S b/sysdeps/ia64/fpu/w_tgammal_compat.S
new file mode 100644
index 0000000000..e71466d1d4
--- /dev/null
+++ b/sysdeps/ia64/fpu/w_tgammal_compat.S
@@ -0,0 +1,4488 @@
+.file "tgammal.s"
+
+
+// Copyright (c) 2002 - 2005, Intel Corporation
+// All rights reserved.
+//
+// Contributed 2002 by the Intel Numerics Group, Intel Corporation
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// * The name of Intel Corporation may not be used to endorse or promote
+// products derived from this software without specific prior written
+// permission.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Intel Corporation is the author of this code, and requests that all
+// problem reports or change requests be submitted to it directly at
+// http://www.intel.com/software/products/opensource/libraries/num.htm.
+//
+// History
+//==============================================================
+// 01/16/02 Initial version
+// 05/20/02 Cleaned up namespace and sf0 syntax
+// 02/10/03 Reordered header: .section, .global, .proc, .align;
+// used data8 for long double table values
+// 03/17/03 Moved tgammal_libm_err label into .proc region
+// 04/10/03 Changed error codes for overflow and negative integers
+// 03/31/05 Reformatted delimiters between data tables
+//
+// API
+//==============================================================
+// long double tgammal(long double)
+//
+// Resources Used:
+//
+// Floating-Point Registers: f8-f15
+// f32-f127
+//
+// General Purpose Registers: r32-r67
+//
+// Predicate Registers: p6-p15
+//
+//*********************************************************************
+//
+// IEEE Special Conditions:
+//
+// tgammal(+inf) = +inf
+// tgammal(-inf) = QNaN
+// tgammal(+/-0) = +/-inf
+// tgammal(x<0, x - integer) = QNaN
+// tgammal(SNaN) = QNaN
+// tgammal(QNaN) = QNaN
+//
+//*********************************************************************
+// Overview of operation
+//==============================================================
+//
+// Algorithm description
+// ---------------------
+//
+// There are 3 main paths in the implementation
+// (and additional special values branches)
+//
+// 1) |X| >= 13 - Stirling formula computation
+// a) Positive arguments:
+// TGAMMAL(X) = exp((X-0.5)*ln(X) - X + C + S(Z)),
+// where C = 0.5*ln(2*Pi) , Z = 1/Z, S(Z) - Bernulli polynomial
+// (up to 'B18' term).
+// Some of these calculation done in multiprecision.
+// Ln returns multiprecision result too
+// and exp also accepts and returns pair of values.
+//
+// b) Negative arguments
+// TGAMMAL(-X) = PI/(X*TGAMMAL(X)*sin(PI*X)).
+// (X*sin(PI*X))/PI calculated in parallel with TGAMMAL.
+// Here we use polynomial of 9th degree with 2 multiprecision steps.
+// Argument range reduction is:
+// N = [x] with round to nearest, r = x - N, -0.5 <= r < 0.5
+// After ((X-0.5)*ln(X) - X + C + S(Z)) completed we just invert
+// its result and compute exp with negative argument (1/exp(x)=exp(-x))
+// Then we multiply exp result to PI/(X*sin(PI*X)).
+//
+// 2) 1 <= |X| < 13 - Polynomial part
+// a) Positive arguments:
+// All values are splitted to such intervals as:
+// #0->[2;3], #1->[3,4], #2->[5,6]...
+// For even intervals we just use polynomial computation with degree 20
+// and first 6 multiprecision computations.
+// Range reduction looks like
+// N = [x] with truncate, r = x - N - 0.5, -0.5 <= r < 0.5
+// For odd intervals we use reccurent formula:
+// TGAMMAL(X) = TGAMMA(X-1)*(X-1)
+// [1;2] interval is splitted to 3 subranges:
+// [1;1.25], [1.25;1.75], [1.75;2] with the same polynomial forms
+//
+// b) Negative arguments
+// TGAMMAL(-X) = PI/(X*TGAMMAL(X)*sin(PI*X)).
+// (X*sin(PI*X))/PI calculated in parallel with TGAMMAL.
+// After multiplication by TGAMMAL(X) result we calculate reciprocal
+// and get final result.
+//
+// 3) 0 < |X| < 1 - Near 0 part
+// a) Here we use reccurent formula TGAMMAL(X) = TGAMMAL(X+1)/X
+// TGAMMAL(X+1) calculated as shown above,
+// 1/X result obtained in parallel. Then we just multiply these values.
+// There is only additional separated subrange: [0;0.125] with specific
+// polynomial constants set.
+//
+// b) Negative arguments
+// TGAMMAL(-X) = PI/(TGAMMAL(X+1)*sin(PI*X)).
+// There is no need to compute 1/X.
+
+
+
+RODATA
+
+.align 16
+LOCAL_OBJECT_START(Constants_Tgammal_log_80_Q)
+// log2_hi, log2_lo, Q_6, Q_5, Q_4, Q_3, Q_2, Q_1
+data4 0x00000000,0xB1721800,0x00003FFE,0x00000000
+data4 0x4361C4C6,0x82E30865,0x0000BFE2,0x00000000
+data4 0xA51BE0AF,0x92492453,0x00003FFC,0x00000000
+data4 0xA0CFD29F,0xAAAAAB73,0x0000BFFC,0x00000000
+data4 0xCCCE3872,0xCCCCCCCC,0x00003FFC,0x00000000
+data4 0xFFFFB4FB,0xFFFFFFFF,0x0000BFFC,0x00000000
+data4 0xAAAAAAAB,0xAAAAAAAA,0x00003FFD,0x00000000
+data4 0x00000000,0x80000000,0x0000BFFE,0x00000000
+LOCAL_OBJECT_END(Constants_Tgammal_log_80_Q)
+
+.align 64
+LOCAL_OBJECT_START(Constants_Tgammal_log_80_Z_G_H_h1)
+// Z1 - 16 bit fixed, G1 and H1 IEEE single, h1 IEEE double
+data4 0x00008000,0x3F800000,0x00000000,0x00000000
+data4 0x00000000,0x00000000,0x00000000,0x00000000
+data4 0x00007879,0x3F70F0F0,0x3D785196,0x00000000
+data4 0xEBA0E0D1,0x8B1D330B,0x00003FDA,0x00000000
+data4 0x000071C8,0x3F638E38,0x3DF13843,0x00000000
+data4 0x9EADD553,0xE2AF365E,0x00003FE2,0x00000000
+data4 0x00006BCB,0x3F579430,0x3E2FF9A0,0x00000000
+data4 0x752F34A2,0xF585FEC3,0x0000BFE3,0x00000000
+data4 0x00006667,0x3F4CCCC8,0x3E647FD6,0x00000000
+data4 0x893B03F3,0xF3546435,0x00003FE2,0x00000000
+data4 0x00006187,0x3F430C30,0x3E8B3AE7,0x00000000
+data4 0x39CDD2AC,0xBABA62E0,0x00003FE4,0x00000000
+data4 0x00005D18,0x3F3A2E88,0x3EA30C68,0x00000000
+data4 0x457978A1,0x8718789F,0x00003FE2,0x00000000
+data4 0x0000590C,0x3F321640,0x3EB9CEC8,0x00000000
+data4 0x3185E56A,0x9442DF96,0x0000BFE4,0x00000000
+data4 0x00005556,0x3F2AAAA8,0x3ECF9927,0x00000000
+data4 0x2BBE2CBD,0xCBF9A4BF,0x00003FE4,0x00000000
+data4 0x000051EC,0x3F23D708,0x3EE47FC5,0x00000000
+data4 0x852D5935,0xF3537535,0x00003FE3,0x00000000
+data4 0x00004EC5,0x3F1D89D8,0x3EF8947D,0x00000000
+data4 0x46CDF32F,0xA1F1E699,0x0000BFDF,0x00000000
+data4 0x00004BDB,0x3F17B420,0x3F05F3A1,0x00000000
+data4 0xD8484CE3,0x84A61856,0x00003FE4,0x00000000
+data4 0x00004925,0x3F124920,0x3F0F4303,0x00000000
+data4 0xFF28821B,0xC7DD97E0,0x0000BFE2,0x00000000
+data4 0x0000469F,0x3F0D3DC8,0x3F183EBF,0x00000000
+data4 0xEF1FD32F,0xD3C4A887,0x00003FE3,0x00000000
+data4 0x00004445,0x3F088888,0x3F20EC80,0x00000000
+data4 0x464C76DA,0x84672BE6,0x00003FE5,0x00000000
+data4 0x00004211,0x3F042108,0x3F29516A,0x00000000
+data4 0x18835FB9,0x9A43A511,0x0000BFE5,0x00000000
+LOCAL_OBJECT_END(Constants_Tgammal_log_80_Z_G_H_h1)
+
+.align 64
+LOCAL_OBJECT_START(Constants_Tgammal_log_80_Z_G_H_h2)
+// Z2 - 16 bit fixed, G2 and H2 IEEE single, h2 IEEE double
+data4 0x00008000,0x3F800000,0x00000000,0x00000000
+data4 0x00000000,0x00000000,0x00000000,0x00000000
+data4 0x00007F81,0x3F7F00F8,0x3B7F875D,0x00000000
+data4 0x211398BF,0xAD08B116,0x00003FDB,0x00000000
+data4 0x00007F02,0x3F7E03F8,0x3BFF015B,0x00000000
+data4 0xC376958E,0xB106790F,0x00003FDE,0x00000000
+data4 0x00007E85,0x3F7D08E0,0x3C3EE393,0x00000000
+data4 0x79A7679A,0xFD03F242,0x0000BFDA,0x00000000
+data4 0x00007E08,0x3F7C0FC0,0x3C7E0586,0x00000000
+data4 0x05E7AE08,0xF03F81C3,0x0000BFDF,0x00000000
+data4 0x00007D8D,0x3F7B1880,0x3C9E75D2,0x00000000
+data4 0x049EB22F,0xD1B87D3C,0x00003FDE,0x00000000
+data4 0x00007D12,0x3F7A2328,0x3CBDC97A,0x00000000
+data4 0x3A9E81E0,0xFABC8B95,0x00003FDF,0x00000000
+data4 0x00007C98,0x3F792FB0,0x3CDCFE47,0x00000000
+data4 0x7C4B5443,0xF5F3653F,0x00003FDF,0x00000000
+data4 0x00007C20,0x3F783E08,0x3CFC15D0,0x00000000
+data4 0xF65A1773,0xE78AB204,0x00003FE0,0x00000000
+data4 0x00007BA8,0x3F774E38,0x3D0D874D,0x00000000
+data4 0x7B8EF695,0xDB7CBFFF,0x0000BFE0,0x00000000
+data4 0x00007B31,0x3F766038,0x3D1CF49B,0x00000000
+data4 0xCF773FB3,0xC0241AEA,0x0000BFE0,0x00000000
+data4 0x00007ABB,0x3F757400,0x3D2C531D,0x00000000
+data4 0xC9539FDF,0xFC8F4D48,0x00003FE1,0x00000000
+data4 0x00007A45,0x3F748988,0x3D3BA322,0x00000000
+data4 0x954665C2,0x9CD035FB,0x0000BFE1,0x00000000
+data4 0x000079D1,0x3F73A0D0,0x3D4AE46F,0x00000000
+data4 0xDD367A30,0xEC9017C7,0x00003FE1,0x00000000
+data4 0x0000795D,0x3F72B9D0,0x3D5A1756,0x00000000
+data4 0xCB11189C,0xEE6625D3,0x0000BFE1,0x00000000
+data4 0x000078EB,0x3F71D488,0x3D693B9D,0x00000000
+data4 0xBE11C424,0xA49C8DB5,0x0000BFE0,0x00000000
+LOCAL_OBJECT_END(Constants_Tgammal_log_80_Z_G_H_h2)
+
+.align 64
+LOCAL_OBJECT_START(Constants_Tgammal_log_80_h3_G_H)
+// h3 IEEE double extended, H3 and G3 IEEE single
+data4 0x112666B0,0xAAACAAB1,0x00003FD3,0x3F7FFC00
+data4 0x9B7FAD21,0x90051030,0x00003FD8,0x3F7FF400
+data4 0xF4D783C4,0xA6B46F46,0x00003FDA,0x3F7FEC00
+data4 0x11C6DDCA,0xDA148D88,0x0000BFD8,0x3F7FE400
+data4 0xCA964D95,0xCE65C1D8,0x0000BFD8,0x3F7FDC00
+data4 0x23412D13,0x883838EE,0x0000BFDB,0x3F7FD400
+data4 0x983ED687,0xB7E5CFA1,0x00003FDB,0x3F7FCC08
+data4 0xE3C3930B,0xDBE23B16,0x0000BFD9,0x3F7FC408
+data4 0x48AA4DFC,0x9B92F1FC,0x0000BFDC,0x3F7FBC10
+data4 0xCE9C8F7E,0x9A8CEB15,0x0000BFD9,0x3F7FB410
+data4 0x0DECE74A,0x8C220879,0x00003FDC,0x3F7FAC18
+data4 0x2F053150,0xB25CA912,0x0000BFDA,0x3F7FA420
+data4 0xD9A5BE20,0xA5876555,0x00003FDB,0x3F7F9C20
+data4 0x2053F087,0xC919BB6E,0x00003FD9,0x3F7F9428
+data4 0x041E9A77,0xB70BDA79,0x00003FDC,0x3F7F8C30
+data4 0xEA1C9C30,0xF18A5C08,0x00003FDA,0x3F7F8438
+data4 0x796D89E5,0xA3790D84,0x0000BFDD,0x3F7F7C40
+data4 0xA2915A3A,0xE1852369,0x0000BFDD,0x3F7F7448
+data4 0xA39ED868,0xD803858F,0x00003FDC,0x3F7F6C50
+data4 0x9417EBB7,0xB2EEE356,0x0000BFDD,0x3F7F6458
+data4 0x9BB0D07F,0xED5C1F8A,0x0000BFDC,0x3F7F5C68
+data4 0xE87C740A,0xD6D201A0,0x0000BFDD,0x3F7F5470
+data4 0x1CA74025,0xE8DEBF5E,0x00003FDC,0x3F7F4C78
+data4 0x1F34A7EB,0x9A995A97,0x0000BFDC,0x3F7F4488
+data4 0x359EED97,0x9CB0F742,0x0000BFDA,0x3F7F3C90
+data4 0xBBC6A1C8,0xD6F833C2,0x0000BFDD,0x3F7F34A0
+data4 0xE71090EC,0xE1F68F2A,0x00003FDC,0x3F7F2CA8
+data4 0xC160A74F,0xD1881CF1,0x0000BFDB,0x3F7F24B8
+data4 0xD78CB5A4,0x9AD05AE2,0x00003FD6,0x3F7F1CC8
+data4 0x9A77DC4B,0xE658CB8E,0x0000BFDD,0x3F7F14D8
+data4 0x6BD6D312,0xBA281296,0x00003FDC,0x3F7F0CE0
+data4 0xF95210D0,0xB478BBEB,0x0000BFDB,0x3F7F04F0
+data4 0x38800100,0x39400480,0x39A00640,0x39E00C41 // H's start here
+data4 0x3A100A21,0x3A300F22,0x3A4FF51C,0x3A6FFC1D
+data4 0x3A87F20B,0x3A97F68B,0x3AA7EB86,0x3AB7E101
+data4 0x3AC7E701,0x3AD7DD7B,0x3AE7D474,0x3AF7CBED
+data4 0x3B03E1F3,0x3B0BDE2F,0x3B13DAAA,0x3B1BD766
+data4 0x3B23CC5C,0x3B2BC997,0x3B33C711,0x3B3BBCC6
+data4 0x3B43BAC0,0x3B4BB0F4,0x3B53AF6D,0x3B5BA620
+data4 0x3B639D12,0x3B6B9444,0x3B7393BC,0x3B7B8B6D
+LOCAL_OBJECT_END(Constants_Tgammal_log_80_h3_G_H)
+
+.align 64
+LOCAL_OBJECT_START(Constants_Tgammal_stirling)
+//0.5*ln(2*Pi)=9.1893853320467266954096885e-01 + 7.2239360881843238220057778e-17
+data8 0x3FED67F1C864BEB4, 0x3C94D252F2400510
+// Bernulli numbers
+data8 0xAAAAAAAAAAAAAAAB, 0x00003FFB //B2 = 8.3333333333333333333333333333e-02
+data8 0xBF66C16C16C16C17 //B4 = -2.7777777777777777777777777778e-03
+data8 0x3F4A01A01A01A01A //B6 = 7.9365079365079365079365079365e-04
+data8 0xBF43813813813814 //B8 = -5.9523809523809523809523809524e-04
+data8 0x3F4B951E2B18FF23 //B10 = 8.4175084175084175084175084175e-04
+data8 0xBF5F6AB0D9993C7D //B12 = -1.9175269175269175269175269175e-03
+data8 0x3F7A41A41A41A41A //B14 = 6.4102564102564102564102564103e-03
+data8 0xBF9E4286CB0F5398 //B16 = -2.9550653594771241830065359477e-02
+data8 0x3FC6FE96381E0680 //B18 = 1.7964437236883057316493849002e-01
+data8 0x3FE0000000000000 // 0.5
+LOCAL_OBJECT_END(Constants_Tgammal_stirling)
+
+.align 64
+LOCAL_OBJECT_START(Constants_Tgammal_sin)
+// Polynomial coefficients for the sin(Pi*x)/Pi, 0 <= |x| < 0.5
+//A2 = 8.1174242528335360802316245099e-01 + 5.1302254650266899774269946201e-18
+data8 0x3FE9F9CB402BC46C, 0x3C57A8B3819B7CEC
+//A1 = -1.6449340668482264060656916627e+00 + -3.0210280454695477893051351574e-17
+data8 0xBFFA51A6625307D3, 0xBC816A402079D0EF
+data8 0xF3AEF1FFCCE6C813, 0x0000BFE3 //A9 = -7.0921197799923779127089910470e-09
+data8 0x87D54408E6D4BB9D, 0x00003FE9 //A8 = 2.5300880778252693946712766029e-07
+data8 0xEA12033DCE7B8ED9, 0x0000BFED //A7 = -6.9758403885461690048189307819e-06
+data8 0x9BA38C952A59D1A8, 0x00003FF2 //A6 = 1.4842878710882320255092707181e-04
+data8 0x99C0B55178FF0E38, 0x0000BFF6 //A5 = -2.3460810348048124421268761990e-03
+data8 0xD63402E798FEC896, 0x00003FF9 //A4 = 2.6147847817611456327417812320e-02
+data8 0xC354723906D95E92, 0x0000BFFC //A3 = -1.9075182412208257558294507774e-01
+LOCAL_OBJECT_END(Constants_Tgammal_sin)
+
+.align 64
+LOCAL_OBJECT_START(Constants_Tgammal_exp_64_Arg)
+data4 0x00000000,0xB17217F4,0x00003FF2,0x00000000 // L_hi = hi part log(2)/2^12
+data4 0xF278ECE6,0xF473DE6A,0x00003FD4,0x00000000 // L_lo = lo part log(2)/2^12
+LOCAL_OBJECT_END(Constants_Tgammal_exp_64_Arg)
+
+LOCAL_OBJECT_START(Constants_Tgammal_exp_64_A)
+data4 0xB1B736A0,0xAAAAAAAB,0x00003FFA,0x00000000 // A3
+data4 0x90CD6327,0xAAAAAAAB,0x00003FFC,0x00000000 // A2
+data4 0xFFFFFFFF,0xFFFFFFFF,0x00003FFD,0x00000000 // A1
+LOCAL_OBJECT_END(Constants_Tgammal_exp_64_A)
+
+LOCAL_OBJECT_START(Constants_Tgammal_exp_64_T1)
+data4 0x3F800000,0x3F8164D2,0x3F82CD87,0x3F843A29
+data4 0x3F85AAC3,0x3F871F62,0x3F88980F,0x3F8A14D5
+data4 0x3F8B95C2,0x3F8D1ADF,0x3F8EA43A,0x3F9031DC
+data4 0x3F91C3D3,0x3F935A2B,0x3F94F4F0,0x3F96942D
+data4 0x3F9837F0,0x3F99E046,0x3F9B8D3A,0x3F9D3EDA
+data4 0x3F9EF532,0x3FA0B051,0x3FA27043,0x3FA43516
+data4 0x3FA5FED7,0x3FA7CD94,0x3FA9A15B,0x3FAB7A3A
+data4 0x3FAD583F,0x3FAF3B79,0x3FB123F6,0x3FB311C4
+data4 0x3FB504F3,0x3FB6FD92,0x3FB8FBAF,0x3FBAFF5B
+data4 0x3FBD08A4,0x3FBF179A,0x3FC12C4D,0x3FC346CD
+data4 0x3FC5672A,0x3FC78D75,0x3FC9B9BE,0x3FCBEC15
+data4 0x3FCE248C,0x3FD06334,0x3FD2A81E,0x3FD4F35B
+data4 0x3FD744FD,0x3FD99D16,0x3FDBFBB8,0x3FDE60F5
+data4 0x3FE0CCDF,0x3FE33F89,0x3FE5B907,0x3FE8396A
+data4 0x3FEAC0C7,0x3FED4F30,0x3FEFE4BA,0x3FF28177
+data4 0x3FF5257D,0x3FF7D0DF,0x3FFA83B3,0x3FFD3E0C
+LOCAL_OBJECT_END(Constants_Tgammal_exp_64_T1)
+
+LOCAL_OBJECT_START(Constants_Tgammal_exp_64_T2)
+data4 0x3F800000,0x3F80058C,0x3F800B18,0x3F8010A4
+data4 0x3F801630,0x3F801BBD,0x3F80214A,0x3F8026D7
+data4 0x3F802C64,0x3F8031F2,0x3F803780,0x3F803D0E
+data4 0x3F80429C,0x3F80482B,0x3F804DB9,0x3F805349
+data4 0x3F8058D8,0x3F805E67,0x3F8063F7,0x3F806987
+data4 0x3F806F17,0x3F8074A8,0x3F807A39,0x3F807FCA
+data4 0x3F80855B,0x3F808AEC,0x3F80907E,0x3F809610
+data4 0x3F809BA2,0x3F80A135,0x3F80A6C7,0x3F80AC5A
+data4 0x3F80B1ED,0x3F80B781,0x3F80BD14,0x3F80C2A8
+data4 0x3F80C83C,0x3F80CDD1,0x3F80D365,0x3F80D8FA
+data4 0x3F80DE8F,0x3F80E425,0x3F80E9BA,0x3F80EF50
+data4 0x3F80F4E6,0x3F80FA7C,0x3F810013,0x3F8105AA
+data4 0x3F810B41,0x3F8110D8,0x3F81166F,0x3F811C07
+data4 0x3F81219F,0x3F812737,0x3F812CD0,0x3F813269
+data4 0x3F813802,0x3F813D9B,0x3F814334,0x3F8148CE
+data4 0x3F814E68,0x3F815402,0x3F81599C,0x3F815F37
+LOCAL_OBJECT_END(Constants_Tgammal_exp_64_T2)
+
+LOCAL_OBJECT_START(Constants_Tgammal_exp_64_W1)
+data8 0x0000000000000000, 0xBE384454171EC4B4
+data8 0xBE6947414AA72766, 0xBE5D32B6D42518F8
+data8 0x3E68D96D3A319149, 0xBE68F4DA62415F36
+data8 0xBE6DDA2FC9C86A3B, 0x3E6B2E50F49228FE
+data8 0xBE49C0C21188B886, 0x3E64BFC21A4C2F1F
+data8 0xBE6A2FBB2CB98B54, 0x3E5DC5DE9A55D329
+data8 0x3E69649039A7AACE, 0x3E54728B5C66DBA5
+data8 0xBE62B0DBBA1C7D7D, 0x3E576E0409F1AF5F
+data8 0x3E6125001A0DD6A1, 0xBE66A419795FBDEF
+data8 0xBE5CDE8CE1BD41FC, 0xBE621376EA54964F
+data8 0x3E6370BE476E76EE, 0x3E390D1A3427EB92
+data8 0x3E1336DE2BF82BF8, 0xBE5FF1CBD0F7BD9E
+data8 0xBE60A3550CEB09DD, 0xBE5CA37E0980F30D
+data8 0xBE5C541B4C082D25, 0xBE5BBECA3B467D29
+data8 0xBE400D8AB9D946C5, 0xBE5E2A0807ED374A
+data8 0xBE66CB28365C8B0A, 0x3E3AAD5BD3403BCA
+data8 0x3E526055C7EA21E0, 0xBE442C75E72880D6
+data8 0x3E58B2BB85222A43, 0xBE5AAB79522C42BF
+data8 0xBE605CB4469DC2BC, 0xBE589FA7A48C40DC
+data8 0xBE51C2141AA42614, 0xBE48D087C37293F4
+data8 0x3E367A1CA2D673E0, 0xBE51BEBB114F7A38
+data8 0xBE6348E5661A4B48, 0xBDF526431D3B9962
+data8 0x3E3A3B5E35A78A53, 0xBE46C46C1CECD788
+data8 0xBE60B7EC7857D689, 0xBE594D3DD14F1AD7
+data8 0xBE4F9C304C9A8F60, 0xBE52187302DFF9D2
+data8 0xBE5E4C8855E6D68F, 0xBE62140F667F3DC4
+data8 0xBE36961B3BF88747, 0x3E602861C96EC6AA
+data8 0xBE3B5151D57FD718, 0x3E561CD0FC4A627B
+data8 0xBE3A5217CA913FEA, 0x3E40A3CC9A5D193A
+data8 0xBE5AB71310A9C312, 0x3E4FDADBC5F57719
+data8 0x3E361428DBDF59D5, 0x3E5DB5DB61B4180D
+data8 0xBE42AD5F7408D856, 0x3E2A314831B2B707
+LOCAL_OBJECT_END(Constants_Tgammal_exp_64_W1)
+
+LOCAL_OBJECT_START(Constants_Tgammal_exp_64_W2)
+data8 0x0000000000000000, 0xBE641F2537A3D7A2
+data8 0xBE68DD57AD028C40, 0xBE5C77D8F212B1B6
+data8 0x3E57878F1BA5B070, 0xBE55A36A2ECAE6FE
+data8 0xBE620608569DFA3B, 0xBE53B50EA6D300A3
+data8 0x3E5B5EF2223F8F2C, 0xBE56A0D9D6DE0DF4
+data8 0xBE64EEF3EAE28F51, 0xBE5E5AE2367EA80B
+data8 0x3E47CB1A5FCBC02D, 0xBE656BA09BDAFEB7
+data8 0x3E6E70C6805AFEE7, 0xBE6E0509A3415EBA
+data8 0xBE56856B49BFF529, 0x3E66DD3300508651
+data8 0x3E51165FC114BC13, 0x3E53333DC453290F
+data8 0x3E6A072B05539FDA, 0xBE47CD877C0A7696
+data8 0xBE668BF4EB05C6D9, 0xBE67C3E36AE86C93
+data8 0xBE533904D0B3E84B, 0x3E63E8D9556B53CE
+data8 0x3E212C8963A98DC8, 0xBE33138F032A7A22
+data8 0x3E530FA9BC584008, 0xBE6ADF82CCB93C97
+data8 0x3E5F91138370EA39, 0x3E5443A4FB6A05D8
+data8 0x3E63DACD181FEE7A, 0xBE62B29DF0F67DEC
+data8 0x3E65C4833DDE6307, 0x3E5BF030D40A24C1
+data8 0x3E658B8F14E437BE, 0xBE631C29ED98B6C7
+data8 0x3E6335D204CF7C71, 0x3E529EEDE954A79D
+data8 0x3E5D9257F64A2FB8, 0xBE6BED1B854ED06C
+data8 0x3E5096F6D71405CB, 0xBE3D4893ACB9FDF5
+data8 0xBDFEB15801B68349, 0x3E628D35C6A463B9
+data8 0xBE559725ADE45917, 0xBE68C29C042FC476
+data8 0xBE67593B01E511FA, 0xBE4A4313398801ED
+data8 0x3E699571DA7C3300, 0x3E5349BE08062A9E
+data8 0x3E5229C4755BB28E, 0x3E67E42677A1F80D
+data8 0xBE52B33F6B69C352, 0xBE6B3550084DA57F
+data8 0xBE6DB03FD1D09A20, 0xBE60CBC42161B2C1
+data8 0x3E56ED9C78A2B771, 0xBE508E319D0FA795
+data8 0xBE59482AFD1A54E9, 0xBE2A17CEB07FD23E
+data8 0x3E68BF5C17365712, 0x3E3956F9B3785569
+LOCAL_OBJECT_END(Constants_Tgammal_exp_64_W2)
+
+
+
+LOCAL_OBJECT_START(Constants_Tgammal_poly)
+
+// Polynomial coefficients for the tgammal(x), 2 <= |x| < 3
+//A5 = 2.8360780594841213109180699803e-02 + 2.2504152891014320704380000000e-19
+data8 0x3F9D0A9BC49353D2, 0x3C109AEA0F23CE2D
+//A4 = 1.0967323400216015538699565468e-01 + 9.9225166000430644587276000000e-18
+data8 0x3FBC138B89492C5B, 0x3C66E138506D5652
+//A3 = 2.5387124684114281691904579930e-01 + 2.2667777637607113205546600000e-17
+data8 0x3FD03F6D2FA4F4F8, 0x3C7A2258DA8CD8B1
+data8 0xC5866457328BC39B, 0x00003FE3 //A20 = 5.7487331964156762795056629138e-09
+data8 0xE93D9F1ACD59C929, 0x0000BFE4 //A19= -1.3576396100397317396956445658e-08
+data8 0xE33389C8F6CBA813, 0x00003FE5 //A18 = 2.6449714924964597501721434271e-08
+data8 0x8FE7B25B9CD26D2A, 0x0000BFE7 //A17= -6.7011017946055513660266853311e-08
+data8 0xB89F4721BFBC15B0, 0x00003FE8 //A16 = 1.7194280320370423615174419192e-07
+data8 0xE49CBDC1874EBABA, 0x0000BFE9 //A15= -4.2582353660153782928729466776e-07
+data8 0x913AF50A336129CA, 0x00003FEB //A14 = 1.0820500665257088283172211622e-06
+data8 0xABCF0F7313B3B332, 0x0000BFEC //A13= -2.5601510627710417669568115706e-06
+//A2 = 6.5455857798133676439533701341e-01 + 1.3292075193155190798867000000e-18
+data8 0x3FE4F224D4B7E01C, 0x3C3885014A2B8319
+//A1 = 9.3473452162608550164435428087e-01 + 3.2785154201417136611642400000e-17
+data8 0x3FEDE9585F1A7093, 0x3C82E63C1B5028BF
+//A0 = 1.3293403881791368004172682049e+00 + 2.2005689328949279282607500000e-16
+data8 0x3FF544FA6D47B38F, 0x3CAFB6AA9829E81F
+data8 0xF3668F799997C76D, 0x00003FED //A12 = 7.2539039479124273660331538367e-06
+data8 0xD6C6BBD54CDEAEB1, 0x0000BFEE //A11= -1.2801665282681088568639378920e-05
+data8 0x809E4763B06F6883, 0x00003FF1 //A10 = 6.1329973609906572700697893187e-05
+data8 0x8443B000F8F9A71A, 0x00003FED //A9 = 3.9417864189995544394564413428e-06
+data8 0xC5C7E6D62A6991D8, 0x00003FF4 //A8 = 7.5447412886334708803357581519e-04
+data8 0xD2AF690725C62D88, 0x00003FF5 //A7 = 1.6074004848394703022110823298e-03
+data8 0xAA44E635D4B7B682, 0x00003FF8 //A6 = 1.0392403425906843901680697839e-02
+//
+// Polynomial coefficients for the tgammal(x), 4 <= |x| < 5
+//A5 = 1.1600674810589555185913468449e+00 + 3.0229979112715124660731000000e-17
+data8 0x3FF28FA2EB44D22E, 0x3C816D285234C815
+//A4 = 3.1374268565470946334983182169e+00 + 1.3694868953995008497659600000e-16
+data8 0x400919734073B1E1, 0x3CA3BC83CD7E9565
+//A3 = 7.0834593993741057360580271052e+00 + 3.3899702569039156457249800000e-16
+data8 0x401C5576617B6C1F, 0x3CB86D6431213296
+data8 0xA4A5FB49C094966B, 0x00003FDA //A20 = 9.3591760106637809309720130828e-12
+data8 0xA9260DA0F51D7ED8, 0x00003FDD //A19 = 7.6919898428091669411809372180e-11
+data8 0xA16441DFB14BD6E1, 0x00003FE0 //A18 = 5.8713933014370867331213494535e-10
+data8 0x95F098D9C2234849, 0x00003FE3 //A17 = 4.3638234584169302324461091035e-09
+data8 0x8581817400E5AD2B, 0x00003FE6 //A16 = 3.1084260332429955234755367839e-08
+data8 0xE272940E373EBE15, 0x00003FE8 //A15 = 2.1089573544273993580820317236e-07
+data8 0xB6B3391145D226FB, 0x00003FEB //A14 = 1.3612217421122787182942706259e-06
+data8 0x8B9428C4DF95FCD5, 0x00003FEE //A13 = 8.3195416382628990683949003789e-06
+//A2 = 1.2665135075272345943631080445e+01 + 9.8721896915973874255877000000e-16
+data8 0x4029548C95A76F38, 0x3CD1C8BE715B8E13
+//A1 = 1.6154969393303069580269948347e+01 + 9.6850518810678379641029000000e-16
+data8 0x403027AC12FC1E1E, 0x3CD172711C15501B
+//A0 = 1.1631728396567448058362970187e+01 + 8.7078125362814179268673000000e-16
+data8 0x40274371E7866C65, 0x3CCF5F8A1A5FACA0
+data8 0xC94A903114272C03, 0x00003FF0 //A12 = 4.7991576836334427243159066630e-05
+data8 0x8844262960E04BE6, 0x00003FF3 //A11 = 2.5990716419283017929486175141e-04
+data8 0xAC5418A76767678D, 0x00003FF5 //A10 = 1.3147621245497801180184809726e-03
+data8 0xCA231B6EFE959132, 0x00003FF7 //A9 = 6.1687358811367989146517222415e-03
+data8 0xDA38E39C13819D2A, 0x00003FF9 //A8 = 2.6638454961912040754759086920e-02
+data8 0xD696DF8D8389FE53, 0x00003FFB //A7 = 1.0477995539298934056097943975e-01
+data8 0xBDD5C153048BC435, 0x00003FFD //A6 = 3.7077144754791605130056406006e-01
+//
+// Polynomial coefficients for the tgammal(x), 6 <= |x| < 7
+//A5 = 6.7169398121054200601065531373e+01 + 2.9481001527213915901489600000e-15
+data8 0x4050CAD76B377BA0, 0x3CEA8DDB2B2DE93E
+//A4 = 1.6115104376855398982115730178e+02 + 1.3422421925418824418257300000e-14
+data8 0x406424D559BDC687, 0x3D0E397FDB5B33DC
+//A3 = 3.1812194028053562533386866562e+02 + 3.9881709875858650942409600000e-14
+data8 0x4073E1F377A6CF73, 0x3D26738F63FE9C4C
+data8 0xD6E1B5FF90CAABD3, 0x00003FE1 //A20 = 1.5634700199277480081025480635e-09
+data8 0xD451987B925DD37E, 0x00003FE4 //A19 = 1.2358576813211397717382327174e-08
+data8 0xBFC151B67FA58E6B, 0x00003FE7 //A18 = 8.9292951435632759686382657901e-08
+data8 0xA9034C5E1D67572E, 0x00003FEA //A17 = 6.2962205718327848327368724720e-07
+data8 0x8E40F6EAA30A71EC, 0x00003FED //A16 = 4.2394926442967995119170095258e-06
+data8 0xE3C3541B03A1C350, 0x00003FEF //A15 = 2.7151465666109594512258841637e-05
+data8 0xACE2E58436B2DDCE, 0x00003FF2 //A14 = 1.6487723793339152877117376243e-04
+data8 0xF7EAF8D8D1CAA3D1, 0x00003FF4 //A13 = 9.4573158112768812533636022369e-04
+//A2 = 4.8664351544258869353143381886e+02 + 4.7424047995944376868895400000e-14
+data8 0x407E6A4BD6D9463B, 0x3D2AB2868D79E192
+//A1 = 5.1615277644992545447166776285e+02 + 3.0901956935588717379242200000e-14
+data8 0x40802138E2DC003B, 0x3D216570FB601AEA
+//A0 = 2.8788527781504433278314536437e+02 + 2.8213174117085164944959600000e-14
+data8 0x4071FE2A1911F7D6, 0x3D1FC3E4CF4DB5AF
+data8 0xA72B88E48D3D1BAB, 0x00003FF7 //A12 = 5.1016252919939028020562237471e-03
+data8 0xD2EFB1067DB4FFB2, 0x00003FF9 //A11 = 2.5749059441230515023024615917e-02
+data8 0xF788AF9522205C24, 0x00003FFB //A10 = 1.2086617635601742290221382521e-01
+data8 0x861A6CE06CB29EAF, 0x00003FFE //A9 = 5.2384071807018493367136112163e-01
+data8 0x84FBDE0947718B58, 0x00004000 //A8 = 2.0778727617851237754568261869e+00
+data8 0xEEC1371E265A2C3A, 0x00004001 //A7 = 7.4610858525146049022238037342e+00
+data8 0xBF514B9BE68ED59D, 0x00004003 //A6 = 2.3914694993947572859629197920e+01
+//
+// Polynomial coefficients for the tgammal(x), 8 <= |x| < 9
+//A5 = 5.8487447114416836484451778233e+03 + 4.7365465221455983144182900000e-13
+data8 0x40B6D8BEA568B6FD, 0x3D60AA4D44C2589B
+//A4 = 1.2796464063087094473303295672e+04 + 1.2373341702514898266244200000e-12
+data8 0x40C8FE3B666B532D, 0x3D75C4752C5B4783
+//A3 = 2.2837606581322281272150576115e+04 + 2.6598064610627891398831000000e-13
+data8 0x40D64D66D23A7764, 0x3D52B77B3A10EA5C
+data8 0xB23418F75B0BE22A, 0x00003FE9 //A20 = 3.3192989594206801808678663868e-07
+data8 0xA984A7BC8B856ED2, 0x00003FEC //A19 = 2.5260177918662350066375115788e-06
+data8 0x921A49729416372C, 0x00003FEF //A18 = 1.7416797068239475136398213598e-05
+data8 0xF5BB9415CC399CA4, 0x00003FF1 //A17 = 1.1717449586392814601938207599e-04
+data8 0xC50B91A40B81F9DF, 0x00003FF4 //A16 = 7.5166775151159345732094429036e-04
+data8 0x96002572326DB203, 0x00003FF7 //A15 = 4.5776541559407384162139204300e-03
+data8 0xD81A1A595E4157BA, 0x00003FF9 //A14 = 2.6379634345126284099420760736e-02
+data8 0x92B700D0CFECADD8, 0x00003FFC //A13 = 1.4327622675407940907282658100e-01
+//A2 = 3.1237895525940199149772524834e+04 + 3.1280450505163186432331700000e-12
+data8 0x40DE8179504C0878, 0x3D8B83BB33FBB766
+//A1 = 2.9192841741344487672904506326e+04 + 7.9300780509779689630767000000e-13
+data8 0x40DC8235DF171691, 0x3D6BE6C780EE54DF
+//A0 = 1.4034407293483411194756627083e+04 + 1.4038139346291543309253700000e-12
+data8 0x40CB693422315F90, 0x3D78B23746113FCE
+data8 0xBAE50807548BC711, 0x00003FFE //A12 = 7.3005724123917935346868107005e-01
+data8 0xDE28B1F57E68CFB6, 0x00004000 //A11 = 3.4712338349724065462763671443e+00
+data8 0xF4DCA5A5FF901118, 0x00004002 //A10 = 1.5303868912154033908205911714e+01
+data8 0xF85AAA1AD5E84E5E, 0x00004004 //A9 = 6.2088539523416399361048051373e+01
+data8 0xE5AA8BB1BF02934D, 0x00004006 //A8 = 2.2966619406617480799195651466e+02
+data8 0xBF6CFEFD67F59845, 0x00004008 //A7 = 7.6570306334640770654588802417e+02
+data8 0x8DB5D2F001635C29, 0x0000400A //A6 = 2.2673639984182571062068713002e+03
+//
+// Polynomial coefficients for the tgammal(x), 10 <= |x| < 11
+//A5 = 7.2546009516580589115619659424e+05 + 1.0343348865365065212891728822e-10
+data8 0x412623A830B99290, 0x3DDC6E7C157611C4
+//A4 = 1.4756292870840241666883230209e+06 + 8.1516565365333844166705674775e-11
+data8 0x4136842D497E56AF, 0x3DD66837E4C3F9EE
+//A3 = 2.4356116926500420086085796356e+06 + 3.5508860076560925641351069404e-10
+data8 0x4142950DD8A8C1AF, 0x3DF866C8E3DD0980
+data8 0xB7FD0D1EEAC38EB4, 0x00003FF1 //A20 = 8.7732544640091602721643775932e-05
+data8 0xA9345C64AC750AE9, 0x00003FF4 //A19 = 6.4546407626804942279126469603e-04
+data8 0x8BEABC81BE1E93C9, 0x00003FF7 //A18 = 4.2699261134524096128048819443e-03
+data8 0xE1CD281EDD7315F8, 0x00003FF9 //A17 = 2.7563646660310313164706189622e-02
+data8 0xAD8A5BA6D0FD9758, 0x00003FFC //A16 = 1.6947310643831556048460963841e-01
+data8 0xFCDDA464AD3F182E, 0x00003FFE //A15 = 9.8775699098518676937088606052e-01
+data8 0xAE0DCE2F7B60D1AE, 0x00004001 //A14 = 5.4391852309591064073782104822e+00
+data8 0xE1745D9ABEB8D1A7, 0x00004003 //A13 = 2.8181819161363002758615770457e+01
+//A2 = 3.0619656223573554307222366333e+06 + 1.0819940302945474471259520006e-10
+data8 0x41475C66CFA967E4, 0x3DDDBDDB2A27334B
+//A1 = 2.6099413018962685018777847290e+06 + 3.6851882860056025385268615240e-10
+data8 0x4143E98AA6A48974, 0x3DF9530D42589AB6
+//A0 = 1.1332783889487853739410638809e+06 + 1.9339350553312096248591829758e-10
+data8 0x41314ADE639225C9, 0x3DEA946DD6C2C8D3
+data8 0x88BCFAAE71812A1C, 0x00004006 //A12 = 1.3673820009490115307300592012e+02
+data8 0x9A770F5AB540A326, 0x00004008 //A11 = 6.1786031215382040427126476507e+02
+data8 0xA170C1D2C6B413FC, 0x0000400A //A10 = 2.5830473201524594051391525170e+03
+data8 0x9AE56061CB02EB55, 0x0000400C //A9 = 9.9133441230507404119297200255e+03
+data8 0x872390769650FBE2, 0x0000400E //A8 = 3.4595564309496661629764193479e+04
+data8 0xD3E5E8D6923910C1, 0x0000400F //A7 = 1.0849181904819284819615140521e+05
+data8 0x930D70602F50B754, 0x00004011 //A6 = 3.0116351174131169193070583741e+05
+//
+// Polynomial coefficients for the tgammal(x), 12 <= |x| < 13
+//A5 = 1.2249876249976964294910430908e+08 + 6.0051348061679753770848000000e-09
+data8 0x419D34BB29FFC39D, 0x3E39CAB72E01818D
+//A4 = 2.3482765927605420351028442383e+08 + 1.1874729051592862323641700000e-08
+data8 0x41ABFE5F168D56FA, 0x3E4980338AA7B04B
+//A3 = 3.6407329688125067949295043945e+08 + 2.6657200942150363994658700000e-08
+data8 0x41B5B35150E199A5, 0x3E5C9F79C0EB5300
+data8 0xE89AE0F8D726329D, 0x00003FF9 //A20 = 2.8394164465429105626588451540e-02
+data8 0xCF90981F86E38013, 0x00003FFC //A19 = 2.0270002071785908652476845915e-01
+data8 0xA56C658079CA8C4A, 0x00003FFF //A18 = 1.2923704984019263122675412350e+00
+data8 0x80AEF96A67C5615A, 0x00004002 //A17 = 8.0427183300456238315262463506e+00
+data8 0xBE886D7529678931, 0x00004004 //A16 = 4.7633230047847868242503413461e+01
+data8 0x858EDBA4CE2F7508, 0x00004007 //A15 = 2.6711607799594541057655957154e+02
+data8 0xB0B0A3AF388274F0, 0x00004009 //A14 = 1.4135199810126975119809102782e+03
+data8 0xDBA87137988751EF, 0x0000400B //A13 = 7.0290552818218513870879313985e+03
+//A2 = 4.2828433593031734228134155273e+08 + 3.9760422293645854535247300000e-08
+data8 0x41B98719AFEE2947, 0x3E6558A17E0D3007
+//A1 = 3.4008253676084774732589721680e+08 + 1.2558352335001093116071000000e-09
+data8 0x41B4453F68C2C6EB, 0x3E159338C5BC7EC3
+//A0 = 1.3684336546556583046913146973e+08 + 2.6786516700381562934240300000e-08
+data8 0x41A05020CAEE5EA5, 0x3E5CC3058A858579
+data8 0xFF5E3940FB4BA576, 0x0000400D //A12 = 3.2687111823895439312116108631e+04
+data8 0x8A08C124C7F74B6C, 0x00004010 //A11 = 1.4134701786994123329786229006e+05
+data8 0x89D701953540BFFB, 0x00004012 //A10 = 5.6459209892773907605385652281e+05
+data8 0xFC46344B3116C3AD, 0x00004013 //A9 = 2.0666305367147234406757715163e+06
+data8 0xD183EBD7A400151F, 0x00004015 //A8 = 6.8653979211730981618367536737e+06
+data8 0x9C083A40742112F4, 0x00004017 //A7 = 2.0451444503543981795037456447e+07
+data8 0xCD3C475B1A8B6662, 0x00004018 //A6 = 5.3801245423495149598177886823e+07
+LOCAL_OBJECT_END(Constants_Tgammal_poly)
+
+
+LOCAL_OBJECT_START(Constants_Tgammal_poly_splitted)
+
+// Polynomial coefficients for the tgammal(x), 1 <= |x| < 1.25
+//A5 = -9.8199506890310417350775651357e-01+ -3.2546247786122976510752200000e-17
+data8 0xBFEF6C80EC38B509, 0xBC82C2FA7A3DE3BD
+//A4 = 9.8172808683439960475425323239e-01 + 4.4847611775298520359811400000e-17
+data8 0x3FEF6A51055096B0, 0x3C89DA56DE95EFE4
+//A3 = -9.0747907608088618225394839101e-01 +-1.0244057366544064435443970000e-16
+data8 0xBFED0A118F324B62, 0xBC9D86C7B9EBCFFF
+data8 0xB8E3FDAA66CC738E, 0x00003FFB //A20 = 9.0278608095877488976217714815e-02
+data8 0xA76067AE1738699C, 0x0000BFFD //A19 =-3.2690738678103132837070881737e-01
+data8 0x9D66B13718408C44, 0x00003FFE //A18 = 6.1484820933424283818320582920e-01
+data8 0xD4AC67BBB4AE5599, 0x0000BFFE //A17 =-8.3075569470082063491389474937e-01
+data8 0xF1426ED1C1488DB3, 0x00003FFE //A16 = 9.4241993542644505594957058785e-01
+data8 0xFC12EB07AA6F4B6B, 0x0000BFFE //A15 =-9.8466366707947121954333549690e-01
+data8 0xFF2B32CFE5B0DDC8, 0x00003FFE //A14 = 9.9675290656677214804168895915e-01
+data8 0xFFD8E7E6FF3662EA, 0x0000BFFE //A13 =-9.9940347089360552383472582319e-01
+//A2 = 9.8905599532797250361682017683e-01 + 5.1760162410376024240867300000e-17
+data8 0x3FEFA658C23B1578, 0x3C8DD673A61F6FE7
+//A1 = -5.7721566490153275452712478000e-01+ -1.0607935612223465065923310000e-16
+data8 0xBFE2788CFC6FB618, 0xBC9E9346622D53B7
+//A0 = 9.9999999999999988897769753748e-01 + 1.1102230245372554544790880000e-16
+data8 0x3FEFFFFFFFFFFFFF, 0x3C9FFFFFFFF51E4E
+data8 0xFFF360DF628F0BC9, 0x00003FFE //A12 = 9.9980740979895815468216470840e-01
+data8 0xFFEF8F9A72B40480, 0x0000BFFE //A11 = -9.9974916001038145045939523470e-01
+data8 0xFFE037B8C7E39952, 0x00003FFE //A10 = 9.9951504002809911822597567307e-01
+data8 0xFFC01E08F348BED2, 0x0000BFFE //A9 = -9.9902522772325406705059517941e-01
+data8 0xFF83DAC83119B52C, 0x00003FFE //A8 = 9.9810569179053383842734164901e-01
+data8 0xFEF9F8AB891ABB24, 0x0000BFFE //A7 = -9.9600176036720260345608796766e-01
+data8 0xFE3F0537573C8235, 0x00003FFE //A6 = 9.9314911461918778676646301341e-01
+//
+// Polynomial coefficients for the tgammal(x), 1.25 <= |x| < 1.75
+//A5 = -7.7523052299853054125655660300e-02+ -1.2693512521686721504433600000e-17
+data8 0xBFB3D88CFE50601B, 0xBC6D44ED60EE2170
+//A4 = 1.4464535904462152982041800442e-01 + 2.5426820829345729856648800000e-17
+data8 0x3FC283BD374EB2A9, 0x3C7D50AC436187C3
+//A3 = -1.0729480456477220873257039102e-01+ -6.2429894945456418196551000000e-18
+data8 0xBFBB77AC1CA2EBA5, 0xBC5CCA6BCC422D41
+data8 0xF732D2689F323283, 0x00003FF2 //A20 = 2.3574688251652899567587145422e-04
+data8 0xB6B00E23DE89D13A, 0x0000BFF3 //A19 =-3.4844916488842618776630058875e-04
+data8 0xE98396FE4A1B2799, 0x00003FF3 //A18 =4.4539265198744452020440735977e-04
+data8 0xAF8D235A640DB1A2, 0x0000BFF4 //A17 =-6.6967514303333563295261178346e-04
+data8 0x8513B736C918B261, 0x00003FF5 //A16 = 1.0152970456990865810615917715e-03
+data8 0xC790A1A2C78D8E17, 0x0000BFF5 //A15 =-1.5225598630329403515321688394e-03
+data8 0x959706CFA638CDE2, 0x00003FF6 //A14 = 2.2825614575133879623648932383e-03
+data8 0xE050A6021E129860, 0x0000BFF6 //A13 =-3.4227757733947066666295285936e-03
+//A2 = 4.1481345368830113695679528973e-01 + 3.1252439808354284892632100000e-17
+data8 0x3FDA8C4DBA620D56, 0x3C82040BCB483C76
+//A1 = 3.2338397448885010387886751460e-02 + 3.4437825798552300531443100000e-18
+data8 0x3FA08EA88EE561B1, 0x3C4FC366D6C64806
+//A0 = 8.8622692545275794095971377828e-01 + 7.2689375867553992399219000000e-17
+data8 0x3FEC5BF891B4EF6A, 0x3C94F3877D311C0C
+data8 0xA8275AADC09D16FC, 0x00003FF7 //A12 = 5.1316445128621071486146117136e-03
+data8 0xFBFE2CE9215267A2, 0x0000BFF7 //A11= -7.6902121820788373000579382408e-03
+data8 0xBCC8EEAB67ECD91D, 0x00003FF8 //A10 = 1.1522515369164312742737727262e-02
+data8 0x8D1614BB97E5E8C2, 0x0000BFF9 //A9 = -1.7222443097804730395560633583e-02
+data8 0xD3A963578BE291E3, 0x00003FF9 //A8 = 2.5837606456090186343624210891e-02
+data8 0x9BA7EAE64C42FDF7, 0x0000BFFA //A7 = -3.8001935555045161419575037512e-02
+data8 0xF0115BA1A77607E7, 0x00003FFA //A6 = 5.8610303817173477119764956736e-02
+//
+// Polynomial coefficients for the tgammal(x), 1.75 <= |x| < 2.0
+//A5 = 2.6698206874501426502654943818e-04 + 3.4033756836921062797887300000e-20
+data8 0x3F317F3740FE2A68, 0x3BE417093234B06E
+//A4 = 7.4249010753513894345090307070e-02 + 3.9810018444482764697014200000e-18
+data8 0x3FB301FBB0F25A92, 0x3C525BEFFABB622F
+//A3 = -8.1576919247086265851720554565e-02+ -5.2716624487804746360745000000e-19
+data8 0xBFB4E239984650AC, 0xBC2372F1C4F276FF
+data8 0xFEF3AEE71038E9A3, 0x00003FEB //A20 = 1.8995395865421509009969188571e-06
+data8 0xA11CFA2672BF876A, 0x0000BFEB //A19 =-1.2003868221414015771269244270e-06
+data8 0xF8E107215DAE2164, 0x00003FEC //A18 = 3.7085863210303833432006027217e-06
+data8 0xBCDDD3FC011EF7D6, 0x00003FEC //A17 = 2.8143303971756051015245433043e-06
+data8 0x8683C4687FA22E68, 0x00003FEE //A16 = 8.0177018464360416764308252462e-06
+data8 0xFDA09E5D33E32968, 0x00003FEE //A15 = 1.5117372062443781157389064848e-05
+data8 0xFFB00D0CFF4089B4, 0x00003FEF //A14 = 3.0480348961227424242198174995e-05
+data8 0xFEF6C39566785085, 0x00003FF0 //A13 = 6.0788135974125244644334004947e-05
+//A2 = 4.1184033042643969357854416558e-01 + 1.2103396182129232634761000000e-18
+data8 0x3FDA5B978B96BEBF, 0x3C3653AAD0A139E4
+//A1 = -4.2278433509846713445057275749e-01+ -4.9429151528135657430413000000e-18
+data8 0xBFDB0EE6072093CE, 0xBC56CB907027554F
+//A0 = 1.0000000000000000000000000000e+00 + 1.0969171200000000000000000000e-31
+data8 0x3FF0000000000000, 0x3981CC6A5B20B4D5
+data8 0xFF2B7BA9A8D68C37, 0x00003FF1 //A12 = 1.2167446884801403650547161615e-04
+data8 0xFCA53468E3692EF1, 0x00003FF2 //A11 = 2.4094136329542400976250900707e-04
+data8 0x808D698A9C993615, 0x00003FF4 //A10 = 4.9038845704938303659791698883e-04
+data8 0xF10F8E3FB8BB4AFB, 0x00003FF4 //A9 = 9.1957383840999861214472423976e-04
+data8 0x89E224E42F93F005, 0x00003FF6 //A8 = 2.1039333407187324139473634747e-03
+data8 0xBAF374824937A323, 0x00003FF6 //A7 = 2.8526458211545152218493600470e-03
+data8 0xB6BF7564F52140C6, 0x00003FF8 //A6 = 1.1154045718131014476684982178e-02
+//
+// Polynomial coefficients for the tgammal(x), 0.0 <= |x| < 0.125
+//A5 = -9.8199506890314514073736518185e-01+ -5.9363811993837985890950900000e-17
+data8 0xBFEF6C80EC38B67A, 0xBC911C46B447C81F
+//A4 = 9.8172808683440015986576554496e-01 + 2.7457414262802803699834200000e-17
+data8 0x3FEF6A51055096B5, 0x3C7FA7FF90ACAD1F
+//A3 = -9.0747907608088618225394839101e-01 + -1.0676255850934306734701780000e-16
+data8 0xBFED0A118F324B62, 0xBC9EC5AFB633438D
+data8 0x9217E83FA207CB80, 0x00003FFD //A20 = 2.8533864762086088781083621561e-01
+data8 0xA8DABFA52FDF03EC, 0x0000BFFE //A19= -6.5958783896337186303285832783e-01
+data8 0xE331ED293AF39F9B, 0x00003FFE //A18 = 8.8748056656454687449654731184e-01
+data8 0xF9163C5DDB52419D, 0x0000BFFE //A17= -9.7299554149078295602977718525e-01
+data8 0xFEC0A1C672CB9265, 0x00003FFE //A16 = 9.9512683005268190987854104489e-01
+data8 0xFFD2D65B8EA7B5F4, 0x0000BFFE //A15= -9.9931087241443958201592847861e-01
+data8 0xFFF93AA39EE53445, 0x00003FFE //A14 = 9.9989668364186884793382816496e-01
+data8 0xFFFB99A9A3F5F480, 0x0000BFFE //A13= -9.9993286506283835663204999212e-01
+//A2 = 9.8905599532797250361682017683e-01 + 5.1778575360788420716540100000e-17
+data8 0x3FEFA658C23B1578, 0x3C8DD92B45408D07
+//A1 = -5.7721566490153275452712478000e-01+ -1.0607938730998824663273110000e-16
+data8 0xBFE2788CFC6FB618, 0xBC9E9346F8FDE55B
+//A0 = 9.9999999999999988897769753748e-01 + 1.1102230246251564036631420000e-16
+data8 0x3FEFFFFFFFFFFFFF, 0x3C9FFFFFFFFFFFFF
+data8 0xFFF7FEBB545812C1, 0x00003FFE //A12 = 9.9987785409425126648628395084e-01
+data8 0xFFF00C02E943A3F2, 0x0000BFFE //A11= -9.9975657530855116454438747397e-01
+data8 0xFFE0420AADC53820, 0x00003FFE //A10 = 9.9951565514290485919027183699e-01
+data8 0xFFC01EB42EF27EEB, 0x0000BFFE //A9 = -9.9902526759155739377365522320e-01
+data8 0xFF83DAD0BF23FF12, 0x00003FFE //A8 = 9.9810569378236378800364235948e-01
+data8 0xFEF9F8ABDBCDB2F3, 0x0000BFFE //A7 = -9.9600176044241699109053158187e-01
+data8 0xFE3F05375988491D, 0x00003FFE //A6 = 9.9314911462127599008937257662e-01
+LOCAL_OBJECT_END(Constants_Tgammal_poly_splitted)
+
+.align 64
+LOCAL_OBJECT_START(Constants_Tgammal_common)
+// Positive overflow value
+data8 0x3FE0000000000000 // 0.5
+data8 0x3FF8000000000000 // 1.5
+data8 0x3FD0000000000000 // 0.25
+data8 0x0000000000000000 // 0
+data8 0xDB718C066B352E21, 0x00004009 // Positive overflow value
+LOCAL_OBJECT_END(Constants_Tgammal_common)
+
+
+
+//=======================================================
+// Lgamma registers
+
+// General Purpose Registers
+GR_l_Log_Table = r33
+GR_l_Log_Table1 = r34
+GR_l_BIAS = r34
+GR_l_Index1 = r35
+GR_l_Index2 = r36
+GR_l_signif_Z = r37
+GR_l_X_0 = r38
+GR_l_X_1 = r39
+GR_l_X_2 = r40
+GR_l_Z_1 = r41
+GR_l_Z_2 = r42
+GR_l_N = r43
+GR_l_Index3 = r44
+GR_l_Stirling_Table = r45
+GR_l_N_Unbiased = r46
+
+// Floating Point Registers
+FR_l_logl_X = f8
+
+FR_l_h_3 = f10
+FR_l_poly_hi = f10
+FR_l_W = f11
+FR_l_S = f12
+FR_l_GS_hi = f13
+FR_l_Y_lo = f13
+FR_l_r_cor = f14
+FR_l_G_1 = f15
+FR_l_G = f15
+FR_l_H_1 = f32
+FR_l_H = f32
+FR_l_h = f33
+FR_l_h_1 = f33
+FR_l_N = f33
+FR_l_G_2 = f34
+FR_l_H_2 = f35
+FR_l_h_2 = f36
+FR_l_G_3 = f37
+FR_l_log2_hi = f38
+FR_l_GS_lo = f39
+FR_l_H_3 = f40
+FR_l_float_N = f41
+FR_l_Q_4 = f42
+FR_l_Q_3 = f43
+FR_l_Q_2 = f44
+FR_l_Q_1 = f45
+FR_l_Q_5 = f46
+FR_l_Q_6 = f47
+FR_l_log2_lo = f48
+FR_l_r = f49
+FR_l_poly_lo = f50
+FR_l_poly = f51
+FR_l_rsq = f52
+FR_l_Y_lo_res = f53
+
+FR_l_Y0 = f55
+FR_l_Q0 = f56
+FR_l_E0 = f57
+FR_l_E2 = f58
+FR_l_E1 = f59
+FR_l_Y1 = f60
+FR_l_E3 = f61
+FR_l_Y2 = f62
+
+FR_l_Z = f63
+FR_l_Z2 = f64
+FR_l_Z4 = f65
+FR_l_Z8 = f66
+
+FR_l_CH = f67
+FR_l_CL = f68
+
+FR_l_B2 = f69
+FR_l_B4 = f70
+FR_l_B6 = f71
+FR_l_B8 = f72
+FR_l_B10 = f73
+FR_l_B12 = f74
+FR_l_B14 = f75
+FR_l_B16 = f76
+FR_l_B18 = f77
+FR_l_Half = f78
+FR_l_SS = f79
+FR_l_AbsX_m_Half = f80
+FR_l_CXH = f81
+FR_l_CXL = f82
+FR_l_SSCXH = f83
+FR_l_SSCXL = f84
+FR_l_XYH = f85
+FR_l_XYL = f86
+FR_l_Temp = f87
+
+FR_l_logl_YHi = f88
+FR_l_logl_YLo = f89
+
+FR_l_SignedXYH = f123
+
+FR_l_AbsX = f127
+
+
+
+//=======================================================
+// Negative part registers
+
+// General Purpose Registers
+GR_n_sin_Table = r47
+GR_n_XN = r48
+
+// Float point registers
+FR_n_IXNS = f125
+FR_n_IXN = f126
+
+FR_n_XNS = f90
+FR_n_XS = f91
+FR_n_XS2 = f92
+FR_n_XS2L = f93
+FR_n_XS4 = f94
+FR_n_XS7 = f95
+FR_n_XS8 = f96
+FR_n_TT = f97
+FR_n_TH = f98
+FR_n_TL = f99
+
+FR_n_A2H = f100
+FR_n_A2L = f101
+FR_n_A1H = f102
+FR_n_A1L = f103
+FR_n_A9 = f104
+FR_n_A8 = f105
+FR_n_A7 = f106
+FR_n_A6 = f107
+FR_n_A5 = f108
+FR_n_A4 = f109
+FR_n_A3 = f110
+
+FR_n_PolyH = f111
+FR_n_PolyL = f112
+
+FR_n_Poly1H = f113
+FR_n_SinxH = f113 // the same as FR_n_Poly1H
+FR_n_Poly1L = f114
+FR_n_SinxL = f114 // the same as FR_n_Poly1L
+
+FR_n_Tail = f115
+FR_n_NegOne = f116
+
+FR_n_Y0 = f117
+
+FR_n_Q0 = f118
+FR_n_E0 = f119
+
+FR_n_E2 = f120
+FR_n_E1 = f121
+
+FR_n_Y1 = f55
+FR_n_E3 = f56
+
+FR_n_Y2 = f57
+FR_n_R0 = f58
+
+FR_n_E4 = f59
+FR_n_RcpResH = f60
+
+FR_n_Y3 = f61
+FR_n_R1 = f62
+FR_n_Temp = f63
+
+FR_n_RcpResL = f64
+
+FR_n_ResH = f65
+FR_n_ResL = f66
+
+
+
+
+//=======================================================
+// Exp registers
+
+// General Purpose Registers
+GR_e_ad_Arg = r33
+GR_e_ad_A = r34
+GR_e_signexp_x = r35
+GR_e_exp_x = r35
+GR_e_exp_mask = r36
+GR_e_ad_W1 = r37
+GR_e_ad_W2 = r38
+GR_e_M2 = r39
+GR_e_M1 = r40
+GR_e_K = r41
+GR_e_exp_2_mk = r42
+GR_e_exp_2_k = r43
+GR_e_ad_T1 = r44
+GR_e_ad_T2 = r45
+GR_e_N_fix = r46
+GR_e_one = r47
+GR_e_exp_bias = r48
+GR_e_sig_inv_ln2 = r49
+GR_e_rshf_2to51 = r50
+GR_e_exp_2tom51 = r51
+GR_e_rshf = r52
+
+// Floating Point Registers
+FR_e_RSHF_2TO51 = f10
+FR_e_INV_LN2_2TO63 = f11
+FR_e_W_2TO51_RSH = f12
+FR_e_2TOM51 = f13
+FR_e_RSHF = f14
+FR_e_Y_hi = f15
+FR_e_Y_lo = f32
+FR_e_scale = f33
+FR_e_float_N = f34
+FR_e_N_signif = f35
+FR_e_L_hi = f36
+FR_e_L_lo = f37
+FR_e_r = f38
+FR_e_W1 = f39
+FR_e_T1 = f40
+FR_e_W2 = f41
+FR_e_T2 = f42
+FR_e_W1_p1 = f43
+FR_e_rsq = f44
+FR_e_A2 = f45
+FR_e_r4 = f46
+FR_e_A3 = f47
+FR_e_poly = f48
+FR_e_T = f49
+FR_e_W = f50
+FR_e_Wp1 = f51
+FR_e_r6 = f52
+FR_e_2_mk = f53
+FR_e_A1 = f54
+FR_e_T_scale = f55
+FR_e_result_lo = f56
+FR_e_W_T_scale = f57
+FR_e_Wp1_T_scale = f58
+
+FR_e_expl_Input_X = f123
+FR_e_expl_Input_Y = f124
+FR_e_expl_Output_X = f123
+FR_e_expl_Output_Y = f124
+
+
+FR_e_expl_Input_AbsX = f122
+
+
+
+//=======================================================
+// Common registers
+
+// General Purpose Registers
+GR_c_Table = r53
+GR_c_NegUnderflow = r54
+GR_c_NegSingularity = r55
+GR_c_X = r56
+GR_c_SignBit = r57
+GR_c_13 = r58
+
+
+// Floating Point Registers
+FR_c_PosOverflow = f123
+FR_c_XN = f124
+
+
+//=======================================================
+// Polynomial part registers
+
+// General Purpose Registers
+GR_p_Table = r59
+GR_p_XN = r33
+GR_p_Table2 = r34
+GR_p_Int = r35
+GR_p_Offset = r36
+GR_p_Offset2 = r38
+GR_p_X_Sgnd = GR_l_signif_Z // = r37
+GR_p_Exp = r61
+GR_p_Bias = r62
+GR_p_0p75 = r63
+
+// Floating Point Registers
+FR_p_AbsX = FR_l_AbsX // = f127
+FR_p_IXN = FR_n_IXN // = f126
+FR_p_XN = f32
+FR_p_0p5 = f33
+FR_p_1p5 = f34
+FR_p_AbsXM1 = f35
+FR_p_2 = f36
+
+FR_p_A20 = f37
+FR_p_A19 = f38
+FR_p_A18 = f39
+FR_p_A17 = f40
+FR_p_A16 = f41
+FR_p_A15 = f42
+FR_p_A14 = f43
+FR_p_A13 = f44
+FR_p_A12 = f45
+FR_p_A11 = f46
+FR_p_A10 = f47
+FR_p_A9 = f48
+FR_p_A8 = f49
+FR_p_A7 = f50
+FR_p_A6 = f51
+FR_p_A5H = f52
+FR_p_A5L = f53
+FR_p_A4H = f54
+FR_p_A4L = f55
+FR_p_A3H = f56
+FR_p_A3L = f57
+FR_p_A2H = f58
+FR_p_A2L = f59
+FR_p_A1H = f60
+FR_p_A1L = f61
+FR_p_A0H = f62
+FR_p_A0L = f63
+
+FR_p_XR = f64
+FR_p_XR2 = f65
+FR_p_XR2L = f52
+
+FR_p_XR3 = f58
+FR_p_XR3L = f38
+
+FR_p_XR4 = f42
+FR_p_XR6 = f40
+FR_p_XR8 = f37
+
+FR_p_Poly5H = f66
+FR_p_Poly5L = f67
+FR_p_Poly4H = f53
+FR_p_Poly4L = f44
+FR_p_Poly3H = f41
+FR_p_Poly3L = f47
+FR_p_Poly2H = f68
+FR_p_Poly2L = f54
+FR_p_Poly1H = f55
+FR_p_Poly1L = f46
+FR_p_Poly0H = f39
+FR_p_Poly0L = f43
+
+FR_p_Temp5H = f69
+FR_p_Temp5L = f70
+FR_p_Temp4H = f71
+FR_p_Temp4L = f60
+FR_p_Temp2H = f72
+FR_p_Temp2L = f73
+FR_p_Temp1H = f59
+FR_p_Temp1L = f61
+FR_p_Temp0H = f49
+FR_p_Temp0L = f48
+FR_p_PolyTail = f45
+FR_p_OddPoly0H = f56
+FR_p_OddPoly0L = f51
+
+FR_p_0p25 = f73
+
+
+//=======================================================
+// Negative polynomial part registers
+// General Purpose Registers
+GR_r_sin_Table = r47
+GR_r_sin_Table2 = r60
+
+// Floating Point Registers
+FR_r_IXNS = FR_n_IXNS
+FR_r_IXN = FR_n_IXN
+
+FR_r_AbsX = FR_l_AbsX
+
+FR_r_A9 = f74
+FR_r_A8 = f75
+FR_r_A7 = f76
+FR_r_A6 = f77
+FR_r_A5 = f78
+FR_r_A4 = f79
+FR_r_A3 = f80
+FR_r_A2H = f81
+FR_r_A2L = f82
+FR_r_A1H = f83
+FR_r_A1L = f84
+
+FR_r_XNS = f85
+FR_r_XS = f86
+FR_r_XS2 = f87
+FR_r_XS2L = f88
+FR_r_XS4 = f89
+FR_r_XS7 = f90
+FR_r_XS8 = f91
+
+FR_r_Tail = f92
+
+FR_r_TT = f93
+FR_r_TH = f94
+FR_r_TL = f95
+
+FR_r_ResH = f96
+FR_r_ResL = f97
+
+FR_r_Res3H = f98
+FR_r_Res3L = f99
+
+FR_r_Res1H = f100
+FR_r_Res1L = f101
+
+
+
+FR_r_Y0 = f102
+FR_r_Q0 = f103
+FR_r_E0 = f104
+FR_r_E2 = f105
+FR_r_E1 = f106
+FR_r_Y1 = f107
+FR_r_E3 = f108
+FR_r_Y2 = f109
+FR_r_R0 = f110
+FR_r_E4 = f111
+FR_r_ZH = f112
+FR_r_Y3 = f113
+FR_r_R1 = f114
+FR_r_ZHN = f115
+FR_r_ZL = f115
+FR_r_NegOne = f116
+
+FR_z_Y0 = f102
+FR_z_Q0 = f103
+FR_z_E0 = f104
+FR_z_E2 = f105
+FR_z_E1 = f106
+FR_z_Y1 = f107
+FR_z_E3 = f108
+FR_z_Y2 = f109
+FR_z_R0 = f110
+FR_z_E4 = f111
+FR_z_ZH = f112
+FR_z_Y3 = f113
+FR_z_R1 = f114
+FR_z_ZL = f115
+
+
+// General Purpose Registers
+GR_SAVE_PFS = r32
+GR_DenOverflow = r33
+GR_u_XN = r34
+
+GR_SAVE_B0 = r35
+GR_SAVE_GP = r36
+GR_SAVE_SP = r37
+
+// Floating Point Registers
+FR_u_IXN = f34
+
+
+// ERROR HANDLER REGISTERS
+GR_Parameter_X = r64
+GR_Parameter_Y = r65
+GR_Parameter_RESULT = r66
+GR_Parameter_TAG = r67
+
+FR_RESULT = f8
+FR_X = f32
+FR_Y = f1
+
+
+.section .text
+GLOBAL_LIBM_ENTRY(tgammal)
+{ .mfi
+ alloc r32 = ar.pfs,0,32,4,0
+ fabs FR_l_AbsX = f8 // Get absolute value of X
+ addl GR_n_sin_Table = @ltoff(Constants_Tgammal_sin), gp
+}
+{ .mfi
+ addl GR_l_Log_Table=@ltoff(Constants_Tgammal_log_80_Z_G_H_h1#),gp
+ nop.f 0
+ addl GR_l_Stirling_Table = @ltoff(Constants_Tgammal_stirling), gp
+};;
+
+{ .mfi
+ getf.sig GR_l_signif_Z = f8 // Significand of X
+ fcvt.fx.s1 FR_n_IXNS = f8 // Convert to fixed point
+ addl GR_c_Table = @ltoff(Constants_Tgammal_common), gp
+}
+{ .mfi
+ ld8 GR_l_Log_Table = [GR_l_Log_Table]
+ nop.f 0
+ addl GR_p_Table = @ltoff(Constants_Tgammal_poly), gp
+};;
+
+{ .mfi
+ ld8 GR_n_sin_Table = [GR_n_sin_Table]
+ fclass.m p6,p0 = f8,0x1EF // Check x for NaN, 0, INF, denorm
+ // NatVal.
+ addl GR_c_NegSingularity = 0x1003E, r0
+}
+{ .mlx
+ ld8 GR_l_Stirling_Table = [GR_l_Stirling_Table]
+ movl GR_c_13 = 0x402A000000000000 // 13.0
+};;
+
+{ .mfi
+ getf.d GR_c_X = f8 // Double prec. X to general register
+ frcpa.s1 FR_z_Y0,p0 = f1,f8 // y = frcpa(x) (for negatives)
+ extr.u GR_l_Index1 = GR_l_signif_Z, 59, 4 // = High 4 bits of Z
+}
+{ .mlx
+ ld8 GR_c_Table = [GR_c_Table]
+ movl GR_c_SignBit = 0x8000000000000000 // High bit (sign)
+};;
+
+{ .mfi
+ ld8 GR_p_Table = [GR_p_Table]
+ fcmp.lt.s1 p15, p14 = f8,f0 // p14 - positive arg, p15 - negative
+ shl GR_l_Index1 = GR_l_Index1,5 // Adjust Index1 ptr (x32)
+}
+{ .mfb
+ adds GR_c_NegUnderflow = 1765, r0
+ nop.f 0
+(p6) br.cond.spnt tgammal_spec // Spec. values processing branch ////////////
+ // (0s, INFs, NANs, NatVals, denormals) //////
+};;
+
+{ .mfi
+ ldfpd FR_l_CH,FR_l_CL= [GR_l_Stirling_Table], 16 // Load CH, CL
+ fcvt.fx.trunc.s1 FR_n_IXN = FR_l_AbsX // Abs arg to int by trunc
+ extr.u GR_l_X_0 = GR_l_signif_Z, 49, 15 // High 15 bit of Z
+}
+{ .mfi
+ add GR_l_Index1 = GR_l_Index1,GR_l_Log_Table // Add offset
+ fma.s1 FR_p_2 = f1, f1, f1 // 2.0
+ andcm GR_c_X = GR_c_X, GR_c_SignBit // Remove sign
+};;
+
+{ .mfi
+ addl GR_l_Log_Table = @ltoff(Constants_Tgammal_log_80_Z_G_H_h2#), gp
+ fcmp.lt.s1 p10, p0 = FR_l_AbsX, f1 // If |X|<1 then p10 = 1
+ nop.i 0
+}
+{ .mlx
+ ld2 GR_l_Z_1 = [GR_l_Index1],4 // load Z_1 from Index1
+ movl GR_l_BIAS = 0x000000000000FFFF // Bias for exponent
+};;
+
+{ .mfi
+ ld8 GR_l_Log_Table = [GR_l_Log_Table]
+ frcpa.s1 FR_l_Y0, p0 = f1, FR_l_AbsX // y = frcpa(x)
+ nop.i 0
+}
+{ .mfi
+ ldfs FR_l_G_1 = [GR_l_Index1],4 // Load G_1
+ fsub.s1 FR_l_W = FR_l_AbsX, f1 // W = |X|-1
+ nop.i 0
+};;
+
+{ .mfi
+ getf.exp GR_l_N_Unbiased= FR_l_AbsX // exponent of |X|
+ fmerge.se FR_l_S = f1, FR_l_AbsX // S = merging of X and 1.0
+ cmp.gtu p11, p0 = GR_c_13, GR_c_X // If 1 <= |X| < 13
+ // then p11 = 1
+}
+{ .mfb
+ ldfs FR_l_H_1 = [GR_l_Index1],8 // Load H_1
+ fcvt.xf FR_n_XNS = FR_n_IXNS // Convert to FP repr. of int X
+(p10) br.cond.spnt tgamma_lt_1 // Branch to |X| < 1 path ///////////////////
+};;
+
+{ .mfi
+ ldfpd FR_n_A2H, FR_n_A2L = [GR_n_sin_Table], 16
+ nop.f 0
+ pmpyshr2.u GR_l_X_1 = GR_l_X_0,GR_l_Z_1,15 // Adjust Index2 (x32)
+}
+{ .mfb
+ ldfe FR_l_B2 = [GR_l_Stirling_Table], 16
+ nop.f 0
+(p11) br.cond.spnt tgamma_lt_13 // Branch to 1 <= |X| < 13 path ///////////////
+};;
+
+{ .mfi
+ ldfe FR_l_h_1 = [GR_l_Index1],0
+ nop.f 0
+ sub GR_l_N = GR_l_N_Unbiased, GR_l_BIAS // N - BIAS
+}
+{ .mib
+ ldfpd FR_l_B4,FR_l_B6= [GR_l_Stirling_Table], 16 // Load C
+(p15) cmp.geu.unc p8,p0 = GR_l_N_Unbiased, GR_c_NegSingularity
+(p8) br.cond.spnt tgammal_singularity // Singularity for arg < to -2^63 //////
+};;
+
+{ .mmi
+(p15) ldfpd FR_n_A1H, FR_n_A1L = [GR_n_sin_Table], 16
+ ldfpd FR_l_B8, FR_l_B10 = [GR_l_Stirling_Table], 16
+ add GR_c_Table = 0x20, GR_c_Table
+};;
+
+{ .mfi
+(p15) ldfe FR_n_A9 = [GR_n_sin_Table], 16
+ fma.s1 FR_l_Q0 = f1,FR_l_Y0,f0 // Q0 = Y0
+ nop.i 0
+}
+{ .mfi
+ ldfpd FR_l_B12, FR_l_B14 = [GR_l_Stirling_Table], 16
+ fnma.s1 FR_l_E0 = FR_l_Y0,FR_l_AbsX,f1 // e = 1-b*y
+ nop.i 0
+};;
+
+{ .mfi
+(p15) ldfe FR_n_A8 = [GR_n_sin_Table], 16
+ fcvt.xf FR_c_XN = FR_n_IXN // Convert to FP repr. of int X
+ extr.u GR_l_Index2 = GR_l_X_1, 6, 4 // Extract Index2
+}
+{ .mfi
+ ldfpd FR_l_B16, FR_l_B18 = [GR_l_Stirling_Table], 16
+ nop.f 0
+ nop.i 0
+};;
+
+{ .mfi
+(p15) ldfe FR_n_A7 = [GR_n_sin_Table], 16
+ fms.s1 FR_l_CXH = FR_l_CH, f1, FR_l_AbsX // CXH = CH+|X|
+ shl GR_l_Index2 = GR_l_Index2,5
+}
+{ .mfi
+ ldfd FR_l_Half = [GR_l_Stirling_Table] // Load 0.5
+ nop.f 0
+ nop.i 0
+};;
+
+{ .mfi
+ add GR_l_Index2 = GR_l_Index2, GR_l_Log_Table // Add offset
+ nop.f 0
+ nop.i 0
+}
+{ .mfi
+(p15) ldfe FR_n_A6 = [GR_n_sin_Table], 16
+(p15) fma.s1 FR_n_XS = FR_l_AbsX , f1, FR_n_XNS // xs = x - int(x)
+ nop.i 0
+};;
+
+{ .mmi
+ ld2 GR_l_Z_2 = [GR_l_Index2],4
+ addl GR_l_Log_Table = @ltoff(Constants_Tgammal_log_80_h3_G_H#),gp
+ nop.i 0
+};;
+
+{ .mfi
+ ld8 GR_l_Log_Table = [GR_l_Log_Table]
+ fma.s1 FR_l_E2 = FR_l_E0,FR_l_E0,FR_l_E0 // e2 = e+e^2
+ nop.i 0
+}
+{ .mfi
+ ldfs FR_l_G_2 = [GR_l_Index2],4
+ fma.s1 FR_l_E1 = FR_l_E0,FR_l_E0,f0 // e1 = e^2
+ nop.i 0
+};;
+
+{ .mmi
+ ldfs FR_l_H_2 = [GR_l_Index2],8
+(p15) ldfe FR_n_A5 = [GR_n_sin_Table], 16
+ nop.i 0
+};;
+
+{ .mfi
+ setf.sig FR_l_float_N = GR_l_N // float_N = Make N a fp number
+ nop.f 0
+ pmpyshr2.u GR_l_X_2 = GR_l_X_1,GR_l_Z_2,15 // X_2 = X_1 * Z_2
+}
+{ .mfi
+ ldfe FR_l_h_2 = [GR_l_Index2],0
+ fma.s1 FR_l_CXL = FR_l_AbsX, f1, FR_l_CXH // CXL = |X|+CXH
+ add GR_l_Log_Table1= 0x200, GR_l_Log_Table
+};;
+
+{ .mfi
+(p15) ldfe FR_n_A4 = [GR_n_sin_Table], 16
+(p15) fcmp.eq.unc.s1 p9,p0 = FR_l_AbsX, FR_c_XN //if argument is integer
+ // and negative
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_c_PosOverflow = [GR_c_Table],16 //Load pos overflow value
+(p15) fma.s1 FR_n_XS2 = FR_n_XS, FR_n_XS, f0 // xs^2 = xs*xs
+ nop.i 0
+};;
+
+{ .mfi
+(p15) ldfe FR_n_A3 = [GR_n_sin_Table], 16
+ nop.f 0
+ nop.i 0
+};;
+
+{ .mfi
+(p15) getf.sig GR_n_XN = FR_n_IXN // int(x) to general reg
+ fma.s1 FR_l_Y1 = FR_l_Y0,FR_l_E2,FR_l_Y0 // y1 = y+y*e2
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+ fma.s1 FR_l_E3 = FR_l_E1,FR_l_E1,FR_l_E0 // e3 = e+e1^2
+(p9) br.cond.spnt tgammal_singularity // Singularity for integer /////////////
+ // and negative arguments //////////////
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_l_AbsX_m_Half = FR_l_AbsX, f1, FR_l_Half // |x|-0.5
+ extr.u GR_l_Index2 = GR_l_X_2, 1, 5 // Get Index3
+};;
+
+{ .mfi
+ shladd GR_l_Log_Table1= GR_l_Index2, 2, GR_l_Log_Table1
+ nop.f 0
+ shladd GR_l_Index3 = GR_l_Index2,4, GR_l_Log_Table // Index3
+}
+{ .mfb
+(p15) cmp.gtu.unc p11, p0 = GR_n_XN, GR_c_NegUnderflow // X < -1765
+ fms.s1 FR_l_CXL = FR_l_CH, f1, FR_l_CXL // CXL = CH - CXL
+(p11) br.cond.spnt tgammal_underflow // Singularity for negative argument //////
+ // at underflow domain (X < -1765) //////
+};;
+
+{ .mfi
+ addl GR_l_Log_Table = @ltoff(Constants_Tgammal_log_80_Q#), gp
+(p15) fma.s1 FR_n_TT = FR_n_A2L, FR_n_XS2, f0 // T=A2L*x^2
+ tbit.nz.unc p13, p12 = GR_n_XN, 0x0 // whether [X] odd or even
+}
+{ .mfi
+ nop.m 0
+(p15) fms.s1 FR_n_XS2L = FR_n_XS, FR_n_XS, FR_n_XS2 // xs^2 Low part
+ nop.i 0
+};;
+
+{ .mfi
+ ld8 GR_l_Log_Table = [GR_l_Log_Table]
+(p15) fma.s1 FR_n_A7 = FR_n_A8, FR_n_XS2, FR_n_A7 // poly tail
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_l_h_3 = [GR_l_Index3],12
+(p15) fma.s1 FR_n_XS4 = FR_n_XS2, FR_n_XS2, f0 // xs^4 = xs^2*xs^2
+ nop.i 0
+};;
+
+{ .mfi
+ ldfs FR_l_H_3 = [GR_l_Log_Table1], 0
+ fma.s1 FR_l_Y2 = FR_l_Y1, FR_l_E3, FR_l_Y0 // y2 = y+y1*e3
+ nop.i 0
+}
+{ .mfi
+ ldfs FR_l_G_3 = [GR_l_Index3], 0
+ fnma.s1 FR_l_Z = FR_l_AbsX,FR_l_Q0,f1 // r = a-b*q
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fmpy.s1 FR_l_G = FR_l_G_1, FR_l_G_2 // G = G1 * G_2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fadd.s1 FR_l_H = FR_l_H_1, FR_l_H_2 // H = H_1 + H_2
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_l_log2_hi = [GR_l_Log_Table],16 // load log2_hi part
+ fadd.s1 FR_l_h = FR_l_h_1, FR_l_h_2 // h = h_1 + h_2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fcvt.xf FR_l_float_N = FR_l_float_N // int(N)
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_l_log2_lo = [GR_l_Log_Table],16 // Load log2_lo part
+ fma.s1 FR_l_CXL = FR_l_CXL, f1, FR_l_CL
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_TT = FR_n_A2H, FR_n_XS2L, FR_n_TT // T=A2H*x2L+T
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_l_Q_6 = [GR_l_Log_Table],16
+(p15) fma.s1 FR_n_A3 = FR_n_A4, FR_n_XS2, FR_n_A3 // poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_A5 = FR_n_A6, FR_n_XS2, FR_n_A5 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_l_Q_5 = [GR_l_Log_Table],16
+(p15) fabs FR_n_XS = FR_n_XS // abs(xs)
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_Z = FR_l_Z,FR_l_Y2,FR_l_Q0 // x_hi = q+r*y2
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_l_Q_4 = [GR_l_Log_Table],16
+(p15) fma.s1 FR_n_A7 = FR_n_A9, FR_n_XS4, FR_n_A7 // poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_XS7 = FR_n_XS4, FR_n_XS2, f0 // = x^4*x^2
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_l_Q_3 = [GR_l_Log_Table],16
+ fneg FR_n_NegOne = f1 // -1.0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_XS8 = FR_n_XS4, FR_n_XS4, f0 // xs^8 = xs^4*xs^4
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_l_Q_2 = [GR_l_Log_Table],16
+ fadd.s1 FR_l_h = FR_l_h, FR_l_h_3 // h = h_1 + h_2 + h_3
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_TH = FR_n_A2H, FR_n_XS2, FR_n_TT // A2H*xs2+T
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_l_Q_1 = [GR_l_Log_Table],16
+ fmpy.s1 FR_l_G = FR_l_G, FR_l_G_3 // G = G_1 * G_2 * G_3
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fadd.s1 FR_l_H = FR_l_H, FR_l_H_3 // H = H_1 + H_2 + H_3
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_Z2 = FR_l_Z, FR_l_Z, f0 // Z^2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_A3 = FR_n_A5, FR_n_XS4, FR_n_A3 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p14) fcmp.gt.unc.s1 p7,p0 = FR_l_AbsX, FR_c_PosOverflow //X > 1755.5483
+ // (overflow domain, result cannot be represented by normal value)
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_XS7 = FR_n_XS7, FR_n_XS, f0 // x^7 construction
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fms.s1 FR_n_TL = FR_n_A2H, FR_n_XS2, FR_n_TH // A2H*xs2+TH
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_PolyH = FR_n_TH, f1, FR_n_A1H // PolyH=TH+A1H
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fmpy.s1 FR_l_GS_hi = FR_l_G, FR_l_S // GS_hi = G*S
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+ fms.s1 FR_l_r = FR_l_G, FR_l_S, f1 // r = G*S -1
+(p7) br.cond.spnt tgammal_overflow // Overflow path for arg > 1755.5483 //////
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_B14 = FR_l_B16, FR_l_Z2, FR_l_B14// Bernoulli tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_Z4 = FR_l_Z2, FR_l_Z2, f0 // Z^4 = Z^2*Z^2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_B2 = FR_l_B4, FR_l_Z2, FR_l_B2 // Bernoulli tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_B6 = FR_l_B8, FR_l_Z2, FR_l_B6 // Bernoulli tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_B10 = FR_l_B12, FR_l_Z2, FR_l_B10// Bernoulli tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_Tail = FR_n_A7, FR_n_XS8, FR_n_A3 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_TL = FR_n_TL, f1, FR_n_TT // TL = TL+T
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fms.s1 FR_n_PolyL = FR_n_A1H, f1, FR_n_PolyH // polyH+A1H
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_poly_lo = FR_l_r, FR_l_Q_6, FR_l_Q_5 // Q_5+r*Q_6
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fsub.s1 FR_l_r_cor = FR_l_GS_hi, f1 // r_cor = GS_hi -1
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_l_GS_lo = FR_l_G, FR_l_S, FR_l_GS_hi // G*S-GS_hi
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_poly = FR_l_r, FR_l_Q_2, FR_l_Q_1 //poly=r*Q2+Q1
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fmpy.s1 FR_l_rsq = FR_l_r, FR_l_r // rsq = r * r
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_G = FR_l_float_N, FR_l_log2_hi, FR_l_H // Tbl =
+ // float_N*log2_hi + H
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_Y_lo = FR_l_float_N, FR_l_log2_lo, FR_l_h // Y_lo=
+ // float_N*log2_lo + h
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_B14 = FR_l_B18, FR_l_Z4, FR_l_B14 //bernulli tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_B2 = FR_l_B6, FR_l_Z4, FR_l_B2 //bernulli tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_Z8 = FR_l_Z4, FR_l_Z4, f0 //bernulli tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_poly_lo = FR_l_r, FR_l_poly_lo, FR_l_Q_4 // poly_lo =
+ // Q_4 + r * poly_lo
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fsub.s1 FR_l_r_cor = FR_l_r_cor, FR_l_r // r_cor = r_cor - r
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_PolyL = FR_n_PolyL, f1, FR_n_TH // polyL+TH
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_TT = FR_n_TL, f1, FR_n_A1L // TL+A1L
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fadd.s1 FR_l_logl_YHi = FR_l_G, FR_l_r // Y_hi = Tbl + r
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_B10 = FR_l_B14, FR_l_Z4, FR_l_B10 //bernulli tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_poly_lo = FR_l_r, FR_l_poly_lo, FR_l_Q_3 // poly_lo =
+ // Q_3 + r * poly_lo
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fadd.s1 FR_l_r_cor = FR_l_r_cor, FR_l_GS_lo // r_cor=r_cor+GS_lo
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_PolyL = FR_n_PolyL, f1, FR_n_TT // polyL+TT
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fsub.s1 FR_l_Y_lo_res = FR_l_G, FR_l_logl_YHi // Y_lo = Tbl - Y_hi
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_XYH = FR_l_logl_YHi, FR_l_AbsX_m_Half, f0 // XYH=
+ // YHi*|x-0.5|
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_SS = FR_l_B10, FR_l_Z8, FR_l_B2 // Bernoulli tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fadd.s1 FR_l_r_cor = FR_l_r_cor, FR_l_Y_lo // r_cor = r_cor+Y_lo
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_poly = FR_l_rsq, FR_l_poly_lo, FR_l_poly //poly=
+ // r^2*polyLo+poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_TT = FR_n_PolyL, FR_n_XS2, f0 // T=polyL*xs^2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fadd.s1 FR_l_Y_lo = FR_l_Y_lo_res, FR_l_r // Y_lo = Y_lo + r
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_l_XYL = FR_l_logl_YHi, FR_l_AbsX_m_Half, FR_l_XYH
+ // XYL = YHi*|x-0.5|-XYH
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_SSCXH = FR_l_SS, FR_l_Z, FR_l_CXH // SS*Z+CXH
+ nop.i 0
+}
+{ .mfi
+ mov GR_e_exp_2tom51= 0xffff-51 // 2^-51
+(p15) fma.s1 FR_l_SignedXYH = FR_l_XYH, FR_n_NegOne, f0 // XYH = -XYH
+ // for negatives
+ nop.i 0
+};;
+
+{ .mlx
+ nop.m 0
+ movl GR_e_rshf_2to51 = 0x4718000000000000 // 1.10000 2^(63+51)
+}
+{ .mlx
+ nop.m 0
+ movl GR_e_sig_inv_ln2 = 0xb8aa3b295c17f0bc //significand of 1/ln2
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_poly = FR_l_rsq, FR_l_poly, FR_l_r_cor // poly =
+ // rsq * poly + r_cor
+ nop.i 0
+};;
+
+{ .mfi
+ addl GR_e_ad_Arg = @ltoff(Constants_Tgammal_exp_64_Arg#),gp
+(p15) fma.s1 FR_n_TT = FR_n_PolyH, FR_n_XS2L, FR_n_TT
+ mov GR_e_exp_mask = 0x1FFFF // Form exponent mask
+}
+{ .mlx
+ nop.m 0
+ movl GR_e_rshf = 0x43e8000000000000 // 1.10000 2^63 rshift
+};;
+
+
+{ .mmi
+ setf.sig FR_e_INV_LN2_2TO63 = GR_e_sig_inv_ln2 // form 1/ln2 * 2^63
+ setf.d FR_e_RSHF_2TO51 = GR_e_rshf_2to51 // 1.1000 * 2^(63+51)
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_l_SSCXL = FR_l_CXH, f1, FR_l_SSCXH // CXH+SS*CXH
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_expl_Input_AbsX = FR_l_XYH, f1, FR_l_SSCXH // HI EXP
+ nop.i 0
+};;
+
+.pred.rel "mutex",p14,p15
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_e_expl_Input_X = FR_l_XYH, f1, FR_l_SSCXH // HI EXP
+ mov GR_e_exp_bias = 0x0FFFF // Set exponent bias
+}
+{ .mfi
+ ld8 GR_e_ad_Arg = [GR_e_ad_Arg] // Point to Arg table
+(p15) fms.s1 FR_e_expl_Input_X = FR_l_SignedXYH, f1, FR_l_SSCXH // HI EXP
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fadd.s1 FR_l_logl_YLo = FR_l_Y_lo, FR_l_poly // YLo = YLo+poly
+ nop.i 0
+};;
+
+{ .mfi
+ setf.exp FR_e_2TOM51 = GR_e_exp_2tom51 //2^-51 for scaling float_N
+(p15) fma.s1 FR_n_TH = FR_n_PolyH, FR_n_XS2, FR_n_TT // TH=
+ // polyH*xs^2+T
+ nop.i 0
+}
+{ .mib
+ setf.d FR_e_RSHF = GR_e_rshf // Right shift const 1.1000*2^63
+ nop.i 0
+ nop.b 0
+};;
+
+{ .mfi
+ add GR_e_ad_A = 0x20, GR_e_ad_Arg // Point to A table
+ nop.f 0
+ add GR_e_ad_T1 = 0x50, GR_e_ad_Arg // Point to T1 table
+}
+{ .mfi
+ add GR_e_ad_T2 = 0x150, GR_e_ad_Arg // Point to T2 table
+ nop.f 0
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_SSCXL = FR_l_SS, FR_l_Z, FR_l_SSCXL
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_e_expl_Input_Y = FR_l_XYH, f1, FR_e_expl_Input_AbsX
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_e_L_hi = [GR_e_ad_Arg],16 // Get L_hi
+ nop.f 0
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_XYL = FR_l_logl_YLo, FR_l_AbsX_m_Half, FR_l_XYL
+ // XYL = YLo*|x-0.5|+XYL
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_e_L_lo = [GR_e_ad_Arg],16 // Get L_lo
+(p15) fms.s1 FR_n_TL = FR_n_PolyH, FR_n_XS2, FR_n_TH // TL =
+ // = polyH*xs^2-TH
+ add GR_e_ad_W1 = 0x100, GR_e_ad_T2 // Point to W1 table
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_Poly1H = FR_n_TH, f1, f1 // poly1H = TH+1
+ add GR_e_ad_W2 = 0x300, GR_e_ad_T2 // Point to W2 table
+};;
+
+{ .mmi
+ getf.exp GR_e_signexp_x = FR_e_expl_Input_X // Extract sign and exp
+ ldfe FR_e_A3 = [GR_e_ad_A],16 // Get A3
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_SSCXL = FR_l_SSCXL, f1, FR_l_CXL
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_expl_Input_Y = FR_e_expl_Input_Y, f1, FR_l_SSCXH
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_N_signif=FR_e_expl_Input_X,FR_e_INV_LN2_2TO63,FR_e_RSHF_2TO51
+ and GR_e_exp_x = GR_e_signexp_x, GR_e_exp_mask
+};;
+
+{ .mmi
+ sub GR_e_exp_x = GR_e_exp_x, GR_e_exp_bias // Get exponent
+ ldfe FR_e_A2 = [GR_e_ad_A],16 // Get A2 for main path
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_PolyH = FR_n_Poly1H, FR_n_XS, f0//sin(Pi*x) poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fms.s1 FR_n_Poly1L = f1, f1, FR_n_Poly1H//sin(Pi*x) poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_TL = FR_n_TL, f1, FR_n_TT//sin(Pi*x) poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_l_Temp = FR_l_XYL, f1, FR_l_SSCXL // XYL+SS*CXL
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_e_expl_Input_Y = FR_e_expl_Input_Y, FR_n_NegOne, f0
+ // Negate lo part of exp argument for negative input values
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_e_A1 = [GR_e_ad_A],16 // Get A1
+ nop.f 0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_e_float_N = FR_e_N_signif, FR_e_2TOM51, FR_e_RSHF
+ // Get float N = signd*2^51-RSHIFTER
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_Poly1L = FR_n_Poly1L, f1, FR_n_TH //sin(Pi*x) poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fms.s1 FR_n_PolyL = FR_n_Poly1H, FR_n_XS, FR_n_PolyH//sin(Pi*x)
+ nop.i 0
+};;
+
+{ .mfi
+ getf.sig GR_e_N_fix = FR_e_N_signif // Get N from significand
+ nop.f 0
+ nop.i 0
+};;
+
+.pred.rel "mutex",p14,p15
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_e_expl_Input_Y = FR_e_expl_Input_Y, f1, FR_l_Temp
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fms.s1 FR_e_expl_Input_Y = FR_e_expl_Input_Y, f1, FR_l_Temp
+ // arguments for exp computation
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_e_r = FR_e_L_hi, FR_e_float_N, FR_e_expl_Input_X
+ // r = -L_hi * float_N + x
+ extr.u GR_e_M1 = GR_e_N_fix, 6, 6 // Extract index M_1
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_Poly1L = FR_n_Poly1L, f1, FR_n_TL //sin(Pi*x) poly
+ nop.i 0
+};;
+
+
+{ .mmf
+ nop.m 0
+ nop.m 0
+ fma.s1 FR_e_r = FR_e_r, f1, FR_e_expl_Input_Y
+ // r = r + FR_e_expl_Input_Y
+};;
+
+{ .mmi
+ shladd GR_e_ad_W1 = GR_e_M1,3,GR_e_ad_W1 // Point to W1
+ shladd GR_e_ad_T1 = GR_e_M1,2,GR_e_ad_T1 // Point to T1
+ extr.u GR_e_M2 = GR_e_N_fix, 0, 6 // Extract index M_2
+};;
+
+
+{ .mfi
+ ldfs FR_e_T1 = [GR_e_ad_T1],0 // Get T1
+ nop.f 0
+ extr GR_e_K = GR_e_N_fix, 12, 32 //Extract limit range K
+}
+{ .mfi
+ shladd GR_e_ad_T2 = GR_e_M2,2,GR_e_ad_T2 // Point to T2
+(p15) fma.s1 FR_n_PolyL = FR_n_Poly1L, FR_n_XS, FR_n_PolyL
+ //sin(Pi*x) poly
+ shladd GR_e_ad_W2 = GR_e_M2,3,GR_e_ad_W2 // Point to W2
+};;
+
+{ .mfi
+ ldfs FR_e_T2 = [GR_e_ad_T2],0 // Get T2
+ nop.f 0
+ add GR_e_exp_2_k = GR_e_exp_bias, GR_e_K // exp of 2^k
+}
+{ .mfi
+ ldfd FR_e_W1 = [GR_e_ad_W1],0 // Get W1
+ nop.f 0
+ sub GR_e_exp_2_mk = GR_e_exp_bias, GR_e_K // exp of 2^-k
+};;
+
+{ .mmi
+ ldfd FR_e_W2 = [GR_e_ad_W2],0 // Get W2
+ nop.m 0
+ nop.i 0
+};;
+
+{ .mmf
+ setf.exp FR_e_scale = GR_e_exp_2_k // Set scale = 2^k
+ setf.exp FR_e_2_mk = GR_e_exp_2_mk // Form 2^-k
+ fnma.s1 FR_e_r = FR_e_L_lo, FR_e_float_N, FR_e_r
+ // r = -L_lo * float_N + r
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_PolyL = FR_n_Tail, FR_n_XS7, FR_n_PolyL
+ //sin(Pi*x) poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_poly = FR_e_r, FR_e_A3, FR_e_A2 // poly=r*A3+A2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fmpy.s1 FR_e_rsq = FR_e_r, FR_e_r // rsq = r * r
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fmpy.s1 FR_e_T = FR_e_T1, FR_e_T2 // T = T1 * T2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fadd.s1 FR_e_W1_p1 = FR_e_W1, f1 // W1_p1 = W1 + 1.0
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_TT = FR_n_PolyL, FR_l_AbsX, f0 //sin(Pi*x) poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_poly = FR_e_r, FR_e_poly, FR_e_A1
+ // poly = r * poly + A1
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_T_scale = FR_e_T, FR_e_scale, f0 // T_scale=T*scale
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_W = FR_e_W2, FR_e_W1_p1, FR_e_W1
+ // W = W2 * (W1+1.0) + W1
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_SinxH = FR_n_PolyH, FR_l_AbsX, FR_n_TT
+ // sin(Pi*x) poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ mov FR_e_Y_hi = FR_e_T // Assume Y_hi = T
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_poly = FR_e_rsq, FR_e_poly, FR_e_r
+ // poly = rsq * poly + r
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_Wp1_T_scale = FR_e_W, FR_e_T_scale, FR_e_T_scale
+ // (W+1)*T*scale
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_W_T_scale = FR_e_W, FR_e_T_scale, f0 // W*T*scale
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fms.s1 FR_n_SinxL = FR_n_PolyH, FR_l_AbsX, FR_n_SinxH
+ // Low part of sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) frcpa.s1 FR_n_Y0, p0 = f1, FR_n_SinxH // y = frcpa(b)
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_result_lo = FR_e_Wp1_T_scale, FR_e_poly, FR_e_W_T_scale
+ // Low part of exp result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_SinxL = FR_n_SinxL, f1, FR_n_TT // sin low result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p15) fma.s1 FR_n_Q0 = f1,FR_n_Y0,f0 // q = y
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p15) fnma.s1 FR_n_E0 = FR_n_Y0, FR_n_SinxH, f1 // e = 1-b*y
+ nop.i 0
+};;
+
+
+{ .mfb
+ nop.m 0
+(p14) fma.s0 f8 = FR_e_Y_hi, FR_e_scale, FR_e_result_lo
+(p14) br.ret.spnt b0 // Exit for positive Stirling path //////////////////////
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_expl_Output_X = FR_e_Y_hi, FR_e_scale, f0 // exp result
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_e_expl_Output_Y = FR_e_result_lo, f1, f0// exp lo result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_E2 = FR_n_E0,FR_n_E0,FR_n_E0 // e2 = e+e^2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_E1 = FR_n_E0,FR_n_E0,f0 // e1 = e^2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_Y1 = FR_n_Y0,FR_n_E2,FR_n_Y0 // y1 = y+y*e2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_E3 = FR_n_E1,FR_n_E1,FR_n_E0 // e3 = e+e1^2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_Y2 = FR_n_Y1,FR_n_E3,FR_n_Y0 // y2 = y+y1*e3
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_n_R0 = FR_n_SinxH,FR_n_Q0,f1 // r = a-b*q
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_n_E4 = FR_n_SinxH,FR_n_Y2,f1 // e4 = 1-b*y2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_RcpResH = FR_n_R0,FR_n_Y2,FR_n_Q0 // x = q+r*y2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_Y3 = FR_n_Y2,FR_n_E4,FR_n_Y2 // y3 = y2+y2*e4
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_n_R1 = FR_n_SinxH,FR_n_RcpResH,f1 // r1 = a-b*x
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_n_R1 = FR_n_SinxL,FR_n_RcpResH,FR_n_R1
+ // r1 = r1 - b_lo*X
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_RcpResL = FR_n_R1,FR_n_Y3,f0 // x_lo = r1*y3
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_Temp = FR_n_RcpResH, FR_e_expl_Output_Y, f0
+ // Multiplying exp and sin result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_Temp = FR_n_RcpResL, FR_e_expl_Output_X, FR_n_Temp
+ // Multiplying exp and sin result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_ResH = FR_n_RcpResH, FR_e_expl_Output_X, FR_n_Temp
+ // Multiplying exp and sin result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_n_ResL = FR_n_RcpResH, FR_e_expl_Output_X, FR_n_ResH
+ // Multiplying exp and sin result
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p12) fma.s1 FR_n_ResH = FR_n_ResH, FR_n_NegOne, f0 // Negate
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_n_ResL = FR_n_ResL, f1, FR_n_Temp
+ // Multiplying exp and sin result - low result obtained
+ nop.i 0
+};;
+
+.pred.rel "mutex",p12,p13
+{ .mfi
+ nop.m 0
+(p13) fma.s0 f8 = FR_n_ResH, f1, FR_n_ResL // For odd
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p12) fms.s0 f8 = FR_n_ResH, f1, FR_n_ResL // For even
+ br.ret.sptk b0 // Exit for negative Stirling path //////////////////////
+};;
+
+
+//////////// 1 <= |X| < 13 path ////////////////////////////////////////////////
+//------------------------------------------------------------------------------
+.align 64
+tgamma_lt_13:
+{ .mfi
+ getf.sig GR_p_XN = FR_p_IXN // Get significand
+ fcvt.xf FR_p_XN = FR_p_IXN // xn = [x]
+ add GR_r_sin_Table2= 0x40, GR_r_sin_Table // Shifted table addr.
+}
+{ .mfi
+ ldfpd FR_p_0p5, FR_p_1p5 = [GR_c_Table], 16 // 0.5 & 1.5
+ fms.s1 FR_p_AbsXM1 = FR_p_AbsX, f1, f1 // X-1
+ add GR_p_Table2 = 0xB0, GR_p_Table
+};;
+
+{ .mfi
+ add GR_r_sin_Table = -16, GR_r_sin_Table // For compensation
+ fcvt.xf FR_r_XNS = FR_r_IXNS // Convert int repr to float
+ shr.u GR_p_X_Sgnd = GR_p_X_Sgnd, 59 // Get only 5 bit of signd
+};;
+
+{ .mfi
+ ldfpd FR_r_A2H,FR_r_A2L = [GR_r_sin_Table], 16 // Load A2
+ nop.f 0
+ add GR_p_Int = -2, GR_p_XN // int = int - 2
+}
+{ .mfi
+ ldfe FR_r_A6 = [GR_r_sin_Table2], 16
+ nop.f 0
+ cmp.gtu p11, p12 = 0x2, GR_p_XN // p11: x < 2 (splitted intervals),
+ // p12: x > 2 (base intervals)
+};;
+
+{ .mfi
+ ldfpd FR_r_A1H, FR_r_A1L = [GR_r_sin_Table], 16
+ nop.f 0
+ shr GR_p_Int = GR_p_Int, 1 // int/2
+}
+{ .mfi
+ ldfe FR_r_A5 = [GR_r_sin_Table2], 16
+ nop.f 0
+(p11) cmp.gtu.unc p10, p11 = 0x1C, GR_p_X_Sgnd // sgnd(x) < 0.75
+};;
+
+{ .mfi
+ ldfe FR_r_A9 = [GR_r_sin_Table], 16
+ nop.f 0
+ shl GR_p_Offset = GR_p_Int, 4 // offset = int*16
+}
+{ .mfi
+ ldfe FR_r_A4 = [GR_r_sin_Table2], 16
+ nop.f 0
+(p10) cmp.gtu.unc p9, p10 = 0x14, GR_p_X_Sgnd // sgnd(x) < 0.25
+};;
+
+
+{ .mfi
+ ldfe FR_r_A8 = [GR_r_sin_Table], 16
+ nop.f 0
+(p12) tbit.nz.unc p13, p12 = GR_p_XN, 0x0 // p13: reccurent computations
+ // X is at [3;4], [5;6], [7;8]... interval
+}
+{ .mfi
+ ldfe FR_r_A3 = [GR_r_sin_Table2], 16
+ nop.f 0
+ shladd GR_p_Offset = GR_p_Int, 2, GR_p_Offset // +int*4
+};;
+
+.pred.rel "mutex",p9,p11
+{ .mfi
+ add GR_p_Offset = GR_p_Int, GR_p_Offset
+ // +int, so offset = int*21
+(p9) fms.s1 FR_p_XR = FR_p_AbsX, f1, f1 // r = x-1
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_r_A7 = [GR_r_sin_Table], 16
+(p11) fms.s1 FR_p_XR = FR_p_2, f1, FR_p_AbsX
+ // r = 2-x for 1.75 < x < 2
+ nop.i 0
+};;
+
+.pred.rel "mutex",p9,p10
+.pred.rel "mutex",p10,p11
+.pred.rel "mutex",p9,p11
+{ .mfi
+(p9) add GR_p_Offset = 126, r0 // 1.0 < x < 1.25 table
+(p15) fcmp.eq.unc.s1 p7,p0 = FR_p_AbsX, FR_p_XN
+ // If arg is integer and negative - singularity branch
+ nop.i 0
+}
+{ .mfi
+(p10) add GR_p_Offset = 147, r0 // 1.25 < x < 1.75 table
+ nop.f 0
+(p11) add GR_p_Offset = 168, r0 // 1.75 < x < 2.0 table
+};;
+
+{ .mmf
+ shladd GR_p_Table = GR_p_Offset, 4, GR_p_Table
+ shladd GR_p_Table2 = GR_p_Offset, 4, GR_p_Table2
+ fma.s1 FR_r_XS = FR_r_AbsX , f1, FR_r_XNS // xs = x - [x]
+};;
+
+{ .mmb
+ ldfpd FR_p_A5H, FR_p_A5L = [GR_p_Table], 16
+ ldfpd FR_p_A2H, FR_p_A2L = [GR_p_Table2], 16
+(p7) br.cond.spnt tgammal_singularity // Singularity for integer /////////////
+ // and negative argument ///////////////
+};;
+
+{ .mfi
+ ldfpd FR_p_A4H, FR_p_A4L = [GR_p_Table], 16
+ fma.s1 FR_p_XN = FR_p_XN, f1, FR_p_0p5 // xn = xn+0.5
+ nop.i 0
+}
+{ .mfi
+ ldfpd FR_p_A1H, FR_p_A1L = [GR_p_Table2], 16
+(p10) fms.s1 FR_p_XR = FR_p_AbsX, f1, FR_p_1p5 // r = x - 1.5
+ nop.i 0
+};;
+
+{ .mmi
+ ldfpd FR_p_A3H, FR_p_A3L = [GR_p_Table], 16
+ ldfpd FR_p_A0H, FR_p_A0L = [GR_p_Table2], 16
+ nop.i 0
+};;
+
+{ .mmi
+ ldfe FR_p_A20 = [GR_p_Table], 16
+ ldfe FR_p_A12 = [GR_p_Table2], 16
+ nop.i 0
+};;
+
+{ .mmf
+ ldfe FR_p_A19 = [GR_p_Table], 16
+ ldfe FR_p_A11 = [GR_p_Table2], 16
+ fma.s1 FR_r_XS2 = FR_r_XS, FR_r_XS, f0 // xs2 = xs*xs
+};;
+
+{ .mmi
+ ldfe FR_p_A18 = [GR_p_Table], 16
+ ldfe FR_p_A10 = [GR_p_Table2], 16
+ nop.i 0
+};;
+
+.pred.rel "mutex",p12,p13
+{ .mfi
+ ldfe FR_p_A17 = [GR_p_Table], 16
+(p12) fms.s1 FR_p_XR = FR_p_AbsX, f1, FR_p_XN // r = x - xn
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_p_A9 = [GR_p_Table2], 16
+(p13) fms.s1 FR_p_XR = FR_p_AbsX, f1, FR_p_XN
+ nop.i 0
+};;
+
+{ .mmi
+ ldfe FR_p_A16 = [GR_p_Table], 16
+ ldfe FR_p_A8 = [GR_p_Table2], 16
+(p9) cmp.eq p12, p0 = r0, r0 // clear p12
+};;
+
+{ .mmi
+ ldfe FR_p_A15 = [GR_p_Table], 16
+ ldfe FR_p_A7 = [GR_p_Table2], 16
+(p10) cmp.eq p12, p0 = r0, r0 // clear p12
+};;
+
+{ .mfi
+ ldfe FR_p_A14 = [GR_p_Table], 16
+ fma.s1 FR_r_TH = FR_r_A2H, FR_r_XS2, f0 // sin for neg
+(p11) cmp.eq p12, p0 = r0, r0 // clear p12
+}
+{ .mfi
+ ldfe FR_p_A6 = [GR_p_Table2], 16
+ fma.s1 FR_r_TL = FR_r_A2L, FR_r_XS2, f0 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_p_A13 = [GR_p_Table], 16
+ fms.s1 FR_r_XS2L = FR_r_XS, FR_r_XS, FR_r_XS2 // x2Lo part
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp5H = FR_p_A5H, FR_p_XR, f0 // A5H*r
+ // 'Low poly'
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR2 = FR_p_XR, FR_p_XR, f0 // r^2 = r*r
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fabs FR_r_XS = FR_r_XS // abs(xs)
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp2H = FR_p_A2H, FR_p_XR, f0 // A2H*r
+ // 'High poly'
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_TT = FR_r_A2H, FR_r_XS2, FR_r_TH // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResH = FR_r_TH, f1, FR_r_A1H // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_r_A2H, FR_r_XS2L, FR_r_TL // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Temp5L = FR_p_A5H,FR_p_XR,FR_p_Temp5H //A5H*r delta
+ // 'Low poly'
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly5H = FR_p_Temp5H, f1, FR_p_A4H // A5H*r+A4H
+ // 'Low poly'
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Temp2L = FR_p_A2H, FR_p_XR, FR_p_Temp2H//A2H*r delta
+ //'High poly'
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly2H = FR_p_Temp2H, f1, FR_p_A1H // A2H*r+A1H
+ //'High poly'
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR3 = FR_p_XR2, FR_p_XR, f0 // r^3 = r^2*r
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_XR2L = FR_p_XR, FR_p_XR, FR_p_XR2 // r^2 delta
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A18 = FR_p_A19, FR_p_XR, FR_p_A18 // Poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A14 = FR_p_A15, FR_p_XR, FR_p_A14 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR4 = FR_p_XR2, FR_p_XR2, f0 // r^4 = r^2*r^2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp5L = FR_p_A5L, FR_p_XR, FR_p_Temp5L// Low part
+ // of A5*r+A4
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Poly5L = FR_p_A4H, f1, FR_p_Poly5H // Low part
+ // of A5*r+A4
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp4H = FR_p_Poly5H, FR_p_XR, f0 // (A5H*r+A4H)*r
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp2L = FR_p_A2L, FR_p_XR, FR_p_Temp2L // A2*r low
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Poly2L = FR_p_A1H, f1, FR_p_Poly2H // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp1H = FR_p_Poly2H, FR_p_XR, f0 // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_XR3L = FR_p_XR2, FR_p_XR, FR_p_XR3 // x^3 delta
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A16 = FR_p_A17, FR_p_XR, FR_p_A16 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_ResL = FR_r_A1H, f1, FR_r_ResH // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_r_TL, f1, FR_r_TT // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp5L = FR_p_Temp5L, f1, FR_p_A4L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly5L = FR_p_Poly5L, f1, FR_p_Temp5H // Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Temp4L = FR_p_Poly5H,FR_p_XR,FR_p_Temp4H //Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly4H = FR_p_Temp4H, f1, FR_p_A3H // Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp2L = FR_p_Temp2L, f1, FR_p_A1L // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly2L = FR_p_Poly2L, f1, FR_p_Temp2H // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Temp1L = FR_p_Poly2H,FR_p_XR,FR_p_Temp1H //High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly1H = FR_p_Temp1H, f1, FR_p_A0H // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A12 = FR_p_A13, FR_p_XR, FR_p_A12 // Poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR3L = FR_p_XR2L, FR_p_XR, FR_p_XR3L // x^3 low
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly5L = FR_p_Poly5L, f1, FR_p_Temp5L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A10 = FR_p_A11, FR_p_XR, FR_p_A10 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Poly4L = FR_p_A3H, f1, FR_p_Poly4H // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A6 = FR_p_A7, FR_p_XR, FR_p_A6 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A8 = FR_p_A9, FR_p_XR, FR_p_A8 // Poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR6 = FR_p_XR4, FR_p_XR2, f0 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly2L = FR_p_Poly2L, f1, FR_p_Temp2L // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Poly1L = FR_p_A0H, f1, FR_p_Poly1H // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TH // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TT = FR_r_TL, f1, FR_r_A1L // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp4L = FR_p_Poly5L,FR_p_XR,FR_p_Temp4L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A18 = FR_p_A20, FR_p_XR2, FR_p_A18 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly4L = FR_p_Poly4L, f1, FR_p_Temp4H // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A14 = FR_p_A16, FR_p_XR2, FR_p_A14 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A6 = FR_p_A8, FR_p_XR2, FR_p_A6 // Poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A10 = FR_p_A12, FR_p_XR2, FR_p_A10 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp1L = FR_p_Poly2L,FR_p_XR,FR_p_Temp1L //High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly1L = FR_p_Poly1L, f1, FR_p_Temp1H // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TT // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TH = FR_r_ResH, FR_r_XS2, f0 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp4L = FR_p_Temp4L, f1, FR_p_A3L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly3H = FR_p_Poly4H, FR_p_XR3, f0 // Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A14 = FR_p_A18, FR_p_XR4, FR_p_A14 // Poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR8 = FR_p_XR4, FR_p_XR4, f0 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_r_ResH, FR_r_XS2L, f0 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp1L = FR_p_Temp1L, f1, FR_p_A0L // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A6 = FR_p_A10, FR_p_XR4, FR_p_A6 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_TT = FR_r_ResH, FR_r_XS2, FR_r_TH // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Res3H = FR_r_TH, f1, f1 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly4L = FR_p_Poly4L, f1, FR_p_Temp4L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly3L = FR_p_Poly4H, FR_p_XR3L, f0 // Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly0H = FR_p_Poly3H,f1,FR_p_Poly1H //Low & High add
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_A7 = FR_r_A8, FR_r_XS2, FR_r_A7 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_r_ResL, FR_r_XS2, FR_r_TL // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_XS4 = FR_r_XS2, FR_r_XS2, f0 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly1L = FR_p_Poly1L, f1, FR_p_Temp1L // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_PolyTail = FR_p_A14, FR_p_XR8, FR_p_A6 // Poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_Res3L = f1, f1, FR_r_Res3H // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResH = FR_r_Res3H, FR_r_XS, f0 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Temp0L = FR_p_Poly4H,FR_p_XR3,FR_p_Poly3H //Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly3L = FR_p_Poly4L,FR_p_XR3,FR_p_Poly3L //Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Poly0L = FR_p_Poly1H,f1,FR_p_Poly0H //Low & High add
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p13) fma.s1 FR_p_OddPoly0H = FR_p_Poly0H, FR_p_AbsXM1, f0
+ // Reccurent computations - multiplying by X-1
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_r_TL, f1, FR_r_TT // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_A3 = FR_r_A4, FR_r_XS2, FR_r_A3 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly1L = FR_p_PolyTail,FR_p_XR6,FR_p_Poly1L//High
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_A5 = FR_r_A6, FR_r_XS2, FR_r_A5 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Res3L = FR_r_Res3L, f1, FR_r_TH // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_ResL = FR_r_Res3H, FR_r_XS, FR_r_ResH//sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly3L = FR_p_Poly3L, f1, FR_p_Temp0L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_A7 = FR_r_A9, FR_r_XS4, FR_r_A7 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly0L = FR_p_Poly0L,f1,FR_p_Poly3H //Low & High add
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p13) fms.s1 FR_p_OddPoly0L = FR_p_Poly0H, FR_p_AbsXM1, FR_p_OddPoly0H
+ // Reccurent computations - multiplying by X-1 (low part)
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_A3 = FR_r_A5, FR_r_XS4, FR_r_A3 // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_XS7 = FR_r_XS4, FR_r_XS2, f0 // xs^6
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Res3L = FR_r_Res3L, f1, FR_r_TL // sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_XS8 = FR_r_XS4, FR_r_XS4, f0 // sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp0H = FR_p_Poly3L,f1,FR_p_Poly1L //Low & High add
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_XS7 = FR_r_XS7, FR_r_XS, f0 // xs^7
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResL = FR_r_Res3L, FR_r_XS, FR_r_ResL//sin for neg
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Tail = FR_r_A7, FR_r_XS8, FR_r_A3 // sin tail res
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly0L = FR_p_Poly0L,f1,FR_p_Temp0H //Low & High add
+ nop.i 0
+};;
+
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResL = FR_r_Tail,FR_r_XS7,FR_r_ResL //sin for neg
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p13) fma.s1 FR_p_OddPoly0L = FR_p_Poly0L, FR_p_AbsXM1, FR_p_OddPoly0L
+ // Reccurent computations - multiplying by X-1 (low part)
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TT = FR_r_ResL, FR_r_AbsX, f0 // X*sin
+ nop.i 0
+};;
+
+.pred.rel "mutex",p12,p13
+{ .mfi
+ nop.m 0
+(p12) fma.s0 f8 = FR_p_Poly0H, f1, FR_p_Poly0L // Even
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p13) fma.s0 f8 = FR_p_OddPoly0H, f1, FR_p_OddPoly0L // Odd
+(p14) br.ret.spnt b0 // Exit for 1 <= |X| < 13 path (positive arguments)/////
+};;
+
+{ .mfi
+ nop.m 0
+(p13) fma.s1 FR_p_Poly0H = FR_p_OddPoly0H, f1, f0
+ // Reccurent computations
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p13) fma.s1 FR_p_Poly0L = FR_p_OddPoly0L, f1, f0
+ // Reccurent computations
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Res1H = FR_r_ResH, FR_r_AbsX, FR_r_TT // X*sin
+(p11) cmp.eq p13, p12 = r0, r0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_Res1L = FR_r_ResH,FR_r_AbsX,FR_r_Res1H// X*sin
+(p9) cmp.eq p13, p12 = r0, r0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Res1L = FR_r_Res1L, f1, FR_r_TT // sin for neg
+(p10) cmp.eq p13, p12 = r0, r0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_p_Poly0L, FR_r_Res1H, f0 // mult by sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_p_Poly0H,FR_r_Res1L,FR_r_TL//mult by sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResH = FR_p_Poly0H,FR_r_Res1H,FR_r_TL//mult by sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_ResL = FR_p_Poly0H,FR_r_Res1H,FR_r_ResH//sin mult
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ frcpa.s1 FR_r_Y0,p0 = f1,FR_r_ResH // y = frcpa(b)
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fneg FR_r_NegOne = f1 // Form -1.0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TL //Low result of mult
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Q0 = f1,FR_r_Y0,f0 // q = a*y
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_r_E0 = FR_r_Y0,FR_r_ResH,f1 // e = 1-b*y
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_E2 = FR_r_E0,FR_r_E0,FR_r_E0 // e2 = e+e^2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_E1 = FR_r_E0,FR_r_E0,f0 // e1 = e^2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Y1 = FR_r_Y0,FR_r_E2,FR_r_Y0 // y1 = y+y*e2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_E3 = FR_r_E1,FR_r_E1,FR_r_E0 // e3 = e+e1^2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Y2 = FR_r_Y1,FR_r_E3,FR_r_Y0 // y2 = y+y1*e3
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_r_R0 = FR_r_ResH,FR_r_Q0,f1 // r = a-b*q
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_r_E4 = FR_r_ResH,FR_r_Y2,f1 // e4 = 1-b*y2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ZH = FR_r_R0,FR_r_Y2,FR_r_Q0 // x = q+r*y2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Y3 = FR_r_Y2,FR_r_E4,FR_r_Y2 // y3 = y2+y2*e4
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_r_R1 = FR_r_ResH,FR_r_ZH,f1 // r1 = a-b*x
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_r_R1 = FR_r_ResL,FR_r_ZH,FR_r_R1 // r1=r1-b_lo*X
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+(p12) fma.s1 FR_r_ZHN = FR_r_ZH,FR_r_NegOne, f0 // Negate for evens
+ nop.i 0
+};;
+
+.pred.rel "mutex",p13,p12
+{ .mfi
+ nop.m 0
+(p13) fma.s0 f8 = FR_r_R1,FR_r_Y3,FR_r_ZH // Final result
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p12) fnma.s0 f8 = FR_r_R1,FR_r_Y3,FR_r_ZHN // Final result
+ br.ret.sptk b0 // Exit for 1 <= |X| < 13 path (negative arguments)//////
+};;
+
+
+//////////// |X| < 1 path /////////////////////////////////////////////////////
+//------------------------------------------------------------------------------
+.align 64
+tgamma_lt_1:
+{ .mfi
+ getf.exp GR_p_Exp = FR_p_AbsX // exp of abs X
+ fma.s1 FR_z_Q0 = f1,FR_z_Y0,f0 // q = a*y
+ add GR_r_sin_Table2= 0x50, GR_r_sin_Table
+}
+{ .mfi
+ ldfpd FR_p_0p5, FR_p_1p5 = [GR_c_Table], 16
+ fnma.s1 FR_z_E0 = FR_z_Y0,f8,f1 // e = 1-b*y
+ add GR_p_Table2 = 0xB0, GR_p_Table
+};;
+
+{ .mfi
+ ldfd FR_p_0p25 = [GR_c_Table]
+ fcvt.xf FR_r_XNS = FR_r_IXNS // Convert int repr to float
+ shr.u GR_p_X_Sgnd = GR_p_X_Sgnd, 60
+ // Obtain only 4 bits of significand
+}
+{ .mfi
+ nop.m 0
+ nop.f 0
+ add GR_p_Bias = 0xffff, r0 // Set bias
+};;
+
+{ .mfi
+ ldfpd FR_r_A2H, FR_r_A2L = [GR_r_sin_Table], 16
+ nop.f 0
+ shl GR_p_XN = GR_p_Exp, 4
+ // Shift exp to 4 bits left to set place for significand
+}
+{ .mlx
+ ldfe FR_r_A6 = [GR_r_sin_Table2], 16
+ movl GR_p_0p75 = 0xfffec // 0.75
+};;
+
+{ .mfi
+ ldfpd FR_r_A1H, FR_r_A1L = [GR_r_sin_Table], 16
+ nop.f 0
+ or GR_p_XN = GR_p_XN, GR_p_X_Sgnd
+ // Combine exp with 4 high bits of significand
+}
+{ .mfi
+ ldfe FR_r_A5 = [GR_r_sin_Table2], 16
+ nop.f 0
+ sub GR_p_Exp = GR_p_Exp, GR_p_Bias // Unbiased exp
+};;
+
+{ .mmi
+ ldfe FR_r_A9 = [GR_r_sin_Table], 16
+ ldfe FR_r_A4 = [GR_r_sin_Table2], 16
+ cmp.gtu.unc p10, p11 = GR_p_0p75, GR_p_XN // sgnd(x) < 0.75
+};;
+
+{ .mfi
+ ldfe FR_r_A8 = [GR_r_sin_Table], 16
+ fma.s1 FR_z_E2 = FR_z_E0,FR_z_E0,FR_z_E0 // e2 = e+e^2
+(p10) cmp.gt.unc p9, p10 = -2, GR_p_Exp // x < 0.25
+}
+{ .mfi
+ ldfe FR_r_A3 = [GR_r_sin_Table2], 16
+ fma.s1 FR_z_E1 = FR_z_E0,FR_z_E0,f0 // e1 = e^2
+(p11) add GR_p_Offset = 168, r0 // [0.75;1] interval
+};;
+
+{ .mmi
+(p10) add GR_p_Offset = 147, r0 // [0.25;0.75] interval
+ ldfe FR_r_A7 = [GR_r_sin_Table], 16
+(p9) cmp.gt.unc p8, p9 = -3, GR_p_Exp // x < 0.125
+};;
+
+.pred.rel "mutex",p9,p8
+{ .mmi
+(p9) add GR_p_Offset = 126, r0 // [0.125;0.25] interval
+(p8) add GR_p_Offset = 189, r0 // [0.;0.125] interval
+ nop.i 0
+};;
+
+{ .mmf
+ shladd GR_p_Table = GR_p_Offset, 4, GR_p_Table //Make addresses
+ shladd GR_p_Table2 = GR_p_Offset, 4, GR_p_Table2
+ fma.s1 FR_r_XS = FR_r_AbsX , f1, FR_r_XNS // xs = |x|-[x]
+};;
+
+.pred.rel "mutex",p8,p11
+{ .mfi
+ ldfpd FR_p_A5H, FR_p_A5L = [GR_p_Table], 16
+(p11) fms.s1 FR_p_XR = f1, f1, FR_p_AbsX // r = 1 - |x|
+ // for [0.75;1] interval
+ nop.i 0
+}
+{ .mfi
+ ldfpd FR_p_A2H, FR_p_A2L = [GR_p_Table2], 16
+(p8) fms.s1 FR_p_XR = FR_p_AbsX, f1, f0 // r = |x|
+ // for [0.;0.125] interval
+ nop.i 0
+};;
+
+{ .mfi
+ ldfpd FR_p_A4H, FR_p_A4L = [GR_p_Table], 16
+ fma.s1 FR_z_Y1 = FR_z_Y0,FR_z_E2,FR_z_Y0 // y1 = y+y*e2
+ nop.i 0
+}
+{ .mfi
+ ldfpd FR_p_A1H, FR_p_A1L = [GR_p_Table2], 16
+ fma.s1 FR_z_E3 = FR_z_E1,FR_z_E1,FR_z_E0 // e3 = e+e1^2
+ nop.i 0
+};;
+
+.pred.rel "mutex",p9,p10
+{ .mfi
+ ldfpd FR_p_A3H, FR_p_A3L = [GR_p_Table], 16
+(p9) fms.s1 FR_p_XR = FR_p_AbsX, f1, f0 // r = |x|
+ // for [0.125;0.25] interval
+ nop.i 0
+}
+{ .mfi
+ ldfpd FR_p_A0H, FR_p_A0L = [GR_p_Table2], 16
+(p10) fms.s1 FR_p_XR = FR_p_AbsX, f1, FR_p_0p5 // r = |x| - 0.5
+ // for [0.25;0.75] interval
+ nop.i 0
+};;
+
+{ .mmi
+ ldfe FR_p_A20 = [GR_p_Table], 16
+ ldfe FR_p_A12 = [GR_p_Table2], 16
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_p_A19 = [GR_p_Table], 16
+ fma.s1 FR_r_XS2 = FR_r_XS, FR_r_XS, f0 // xs^2
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_p_A11 = [GR_p_Table2], 16
+ nop.f 0
+ nop.i 0
+};;
+
+{ .mmi
+ ldfe FR_p_A18 = [GR_p_Table], 16
+ ldfe FR_p_A10 = [GR_p_Table2], 16
+ nop.i 0
+};;
+
+.pred.rel "mutex",p12,p13
+{ .mfi
+ ldfe FR_p_A17 = [GR_p_Table], 16
+ fma.s1 FR_z_Y2 = FR_z_Y1,FR_z_E3,FR_z_Y0 // y2 = y+y1*e3
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_p_A9 = [GR_p_Table2], 16
+ fnma.s1 FR_z_R0 = f8,FR_z_Q0,f1 // r = a-b*q
+ nop.i 0
+};;
+
+{ .mmi
+ ldfe FR_p_A16 = [GR_p_Table], 16
+ ldfe FR_p_A8 = [GR_p_Table2], 16
+ nop.i 0
+};;
+
+{ .mmi
+ ldfe FR_p_A15 = [GR_p_Table], 16
+ ldfe FR_p_A7 = [GR_p_Table2], 16
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_p_A14 = [GR_p_Table], 16
+ fma.s1 FR_r_TH = FR_r_A2H, FR_r_XS2, f0 // neg sin
+ nop.i 0
+}
+{ .mfi
+ ldfe FR_p_A6 = [GR_p_Table2], 16
+ fma.s1 FR_r_TL = FR_r_A2L, FR_r_XS2, f0 // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ ldfe FR_p_A13 = [GR_p_Table], 16
+ fms.s1 FR_r_XS2L = FR_r_XS, FR_r_XS, FR_r_XS2 // xs^2 delta
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp5H = FR_p_A5H, FR_p_XR, f0 // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR2 = FR_p_XR, FR_p_XR, f0 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fabs FR_r_XS = FR_r_XS // Absolute value of xs
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp2H = FR_p_A2H, FR_p_XR, f0 // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_z_E4 = f8,FR_z_Y2,f1 // e4 = 1-b*y2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_z_ZH = FR_z_R0,FR_z_Y2,FR_z_Q0 // 1/x = q+r*y2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_TT = FR_r_A2H, FR_r_XS2, FR_r_TH // neg sin
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResH = FR_r_TH, f1, FR_r_A1H // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_r_A2H, FR_r_XS2L, FR_r_TL // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Temp5L = FR_p_A5H, FR_p_XR, FR_p_Temp5H // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly5H = FR_p_Temp5H, f1, FR_p_A4H // Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Temp2L = FR_p_A2H, FR_p_XR, FR_p_Temp2H // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly2H = FR_p_Temp2H, f1, FR_p_A1H // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR3 = FR_p_XR2, FR_p_XR, f0 // r^3
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_XR2L = FR_p_XR, FR_p_XR, FR_p_XR2 // r^2 delta
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A18 = FR_p_A19, FR_p_XR, FR_p_A18 // poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A14 = FR_p_A15, FR_p_XR, FR_p_A14 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR4 = FR_p_XR2, FR_p_XR2, f0 // poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_z_Y3 = FR_z_Y2,FR_z_E4,FR_z_Y2 // y3 = y2+y2*e4
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp5L = FR_p_A5L, FR_p_XR, FR_p_Temp5L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Poly5L = FR_p_A4H, f1, FR_p_Poly5H // Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp4H = FR_p_Poly5H, FR_p_XR, f0 // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp2L = FR_p_A2L, FR_p_XR, FR_p_Temp2L // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Poly2L = FR_p_A1H, f1, FR_p_Poly2H // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp1H = FR_p_Poly2H, FR_p_XR, f0 // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_XR3L = FR_p_XR2, FR_p_XR, FR_p_XR3 // x^3 delta
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A16 = FR_p_A17, FR_p_XR, FR_p_A16 //poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_ResL = FR_r_A1H, f1, FR_r_ResH // neg sin
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_r_TL, f1, FR_r_TT // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp5L = FR_p_Temp5L, f1, FR_p_A4L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly5L = FR_p_Poly5L, f1, FR_p_Temp5H //Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Temp4L = FR_p_Poly5H, FR_p_XR, FR_p_Temp4H//Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly4H = FR_p_Temp4H, f1, FR_p_A3H // Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp2L = FR_p_Temp2L, f1, FR_p_A1L // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly2L = FR_p_Poly2L, f1, FR_p_Temp2H // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Temp1L = FR_p_Poly2H,FR_p_XR,FR_p_Temp1H //High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly1H = FR_p_Temp1H, f1, FR_p_A0H // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A12 = FR_p_A13, FR_p_XR, FR_p_A12 // poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR3L = FR_p_XR2L, FR_p_XR, FR_p_XR3L // x^3 low
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly5L = FR_p_Poly5L, f1, FR_p_Temp5L //Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A10 = FR_p_A11, FR_p_XR, FR_p_A10 //poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Poly4L = FR_p_A3H, f1, FR_p_Poly4H /// Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A6 = FR_p_A7, FR_p_XR, FR_p_A6 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A8 = FR_p_A9, FR_p_XR, FR_p_A8 // poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR6 = FR_p_XR4, FR_p_XR2, f0 // r^6
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly2L = FR_p_Poly2L, f1, FR_p_Temp2L // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Poly1L = FR_p_A0H, f1, FR_p_Poly1H // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TH // neg sin
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TT = FR_r_TL, f1, FR_r_A1L // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp4L = FR_p_Poly5L,FR_p_XR,FR_p_Temp4L //Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A18 = FR_p_A20, FR_p_XR2, FR_p_A18 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly4L = FR_p_Poly4L, f1, FR_p_Temp4H // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A14 = FR_p_A16, FR_p_XR2, FR_p_A14 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A6 = FR_p_A8, FR_p_XR2, FR_p_A6 // poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A10 = FR_p_A12, FR_p_XR2, FR_p_A10 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp1L = FR_p_Poly2L,FR_p_XR,FR_p_Temp1L //High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly1L = FR_p_Poly1L, f1, FR_p_Temp1H // High poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TT // neg sin
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TH = FR_r_ResH, FR_r_XS2, f0 // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp4L = FR_p_Temp4L, f1, FR_p_A3L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly3H = FR_p_Poly4H, FR_p_XR3, f0 // Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A14 = FR_p_A18, FR_p_XR4, FR_p_A14 // poly tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_XR8 = FR_p_XR4, FR_p_XR4, f0 // r^8
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_r_ResH, FR_r_XS2L, f0 // neg sin
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_z_R1 = f8,FR_z_ZH,f1 // r1 = a-b*x
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp1L = FR_p_Temp1L, f1, FR_p_A0L // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_A6 = FR_p_A10, FR_p_XR4, FR_p_A6 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_TT = FR_r_ResH, FR_r_XS2, FR_r_TH // neg sin
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Res3H = FR_r_TH, f1, f1 // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly4L = FR_p_Poly4L, f1, FR_p_Temp4L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly3L = FR_p_Poly4H, FR_p_XR3L, f0 // Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly0H = FR_p_Poly3H, f1, FR_p_Poly1H // Result
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_A7 = FR_r_A8, FR_r_XS2, FR_r_A7 // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_r_ResL, FR_r_XS2, FR_r_TL // neg sin
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_XS4 = FR_r_XS2, FR_r_XS2, f0 // xs^4
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly1L = FR_p_Poly1L, f1, FR_p_Temp1L // High poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_PolyTail = FR_p_A14, FR_p_XR8, FR_p_A6 // poly tail
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_Res3L = f1, f1, FR_r_Res3H // neg sin
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResH = FR_r_Res3H, FR_r_XS, f0 // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Temp0L = FR_p_Poly4H,FR_p_XR3,FR_p_Poly3H //Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly3L = FR_p_Poly4L,FR_p_XR3,FR_p_Poly3L //Low poly
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_p_Poly0L = FR_p_Poly1H, f1, FR_p_Poly0H // Result
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_z_ZL = FR_z_R1,FR_z_Y3, f0 // x_lo = r1*y3
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_r_TL, f1, FR_r_TT // neg sin
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_A3 = FR_r_A4, FR_r_XS2, FR_r_A3 /// neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly1L = FR_p_PolyTail,FR_p_XR6,FR_p_Poly1L // High
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_A5 = FR_r_A6, FR_r_XS2, FR_r_A5 // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Res3L = FR_r_Res3L, f1, FR_r_TH // neg sin
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_ResL = FR_r_Res3H, FR_r_XS, FR_r_ResH // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly3L = FR_p_Poly3L, f1, FR_p_Temp0L // Low poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_A7 = FR_r_A9, FR_r_XS4, FR_r_A7 // neg sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly0L = FR_p_Poly0L, f1, FR_p_Poly3H // result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p14) fma.s1 f8 = FR_p_Poly0H, FR_z_ZH, f0 // z*poly
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp1L = FR_p_Poly0H, FR_z_ZL, f0 // z*poly low
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_A3 = FR_r_A5, FR_r_XS4, FR_r_A3 // sin tail
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_XS7 = FR_r_XS4, FR_r_XS2, f0 // xs^6
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Res3L = FR_r_Res3L, f1, FR_r_TL // sin low
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_XS8 = FR_r_XS4, FR_r_XS4, f0 // xs^8
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Temp0H = FR_p_Poly3L, f1, FR_p_Poly1L // result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p14) fms.s1 FR_p_Temp1H = FR_p_Poly0H, FR_z_ZH, f8 // hi result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_XS7 = FR_r_XS7, FR_r_XS, f0 // xs^7
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResL = FR_r_Res3L, FR_r_XS, FR_r_ResL // lo result
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Tail = FR_r_A7, FR_r_XS8, FR_r_A3 // tail result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_p_Poly0L = FR_p_Poly0L, f1, FR_p_Temp0H // lo result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResL = FR_r_Tail, FR_r_XS7, FR_r_ResL // lo result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_p_Temp1L = FR_p_Poly0L,FR_z_ZH,FR_p_Temp1L //hi result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TT = FR_r_ResL, f1, f0 // for low result
+ nop.i 0
+};;
+
+.pred.rel "mutex",p12,p13
+{ .mfi
+ nop.m 0
+(p14) fma.s1 FR_p_Temp1L = FR_p_Temp1L, f1, FR_p_Temp1H // for lo res
+ nop.i 0
+};;
+
+{ .mfi
+(p10) cmp.eq p13, p12 = r0, r0 // set p13, clear p12
+ fma.s1 FR_r_Res1H = FR_r_ResH, f1, FR_r_TT // hi res
+ nop.i 0
+};;
+
+{ .mfb
+(p9) cmp.eq p13, p12 = r0, r0 // set p13, clear p12
+(p14) fma.s0 f8 = f8, f1, FR_p_Temp1L // Final result
+(p14) br.ret.spnt b0 // Exit for 0 < |X| < 1 path (positive arguments)///////
+};;
+
+{ .mfi
+(p11) cmp.eq p13, p12 = r0, r0 // set p13, clear p12
+ fms.s1 FR_r_Res1L = FR_r_ResH, f1, FR_r_Res1H // Low sin result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Res1L = FR_r_Res1L, f1, FR_r_TT // Low sin result
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_p_Poly0L,FR_r_Res1H,f0 //Low sin result
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_TL = FR_p_Poly0H, FR_r_Res1L, FR_r_TL //Low sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResH = FR_p_Poly0H, FR_r_Res1H, FR_r_TL //High sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fms.s1 FR_r_ResL = FR_p_Poly0H,FR_r_Res1H,FR_r_ResH //Low res
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ frcpa.s1 FR_r_Y0,p0 = f1,FR_r_ResH // y = frcpa(b)
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fneg FR_r_NegOne = f1 // Construct -1.0
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ResL = FR_r_ResL, f1, FR_r_TL // low sin
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Q0 = f1,FR_r_Y0,f0 // q = a*y
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_r_E0 = FR_r_Y0,FR_r_ResH,f1 // e = 1-b*y
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_E2 = FR_r_E0,FR_r_E0,FR_r_E0 // e2 = e+e^2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_E1 = FR_r_E0,FR_r_E0,f0 // e1 = e^2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Y1 = FR_r_Y0,FR_r_E2,FR_r_Y0 // y1 = y+y*e2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_E3 = FR_r_E1,FR_r_E1,FR_r_E0 // e3 = e+e1^2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Y2 = FR_r_Y1,FR_r_E3,FR_r_Y0 // y2 = y+y1*e3
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_r_R0 = FR_r_ResH,FR_r_Q0,f1 // r = a-b*q
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_r_E4 = FR_r_ResH,FR_r_Y2,f1 // e4 = 1-b*y2
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ZH = FR_r_R0,FR_r_Y2,FR_r_Q0 // x = q+r*y2
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_Y3 = FR_r_Y2,FR_r_E4,FR_r_Y2 // y3 = y2+y2*e4
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_r_R1 = FR_r_ResH,FR_r_ZH,f1 // r1 = a-b*x
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ fnma.s1 FR_r_R1 = FR_r_ResL,FR_r_ZH,FR_r_R1 // r1=r1 - b_lo*X
+ nop.i 0
+}
+{ .mfi
+ nop.m 0
+ fma.s1 FR_r_ZHN = FR_r_ZH,FR_r_NegOne, f0 // Negate
+ nop.i 0
+};;
+
+.pred.rel "mutex",p13,p12
+{ .mfb
+ nop.m 0
+ fnma.s0 f8 = FR_r_R1,FR_r_Y3,FR_r_ZHN // Result for neg
+ br.ret.sptk b0 // Exit for 0 < |X| < 1 path (negative arguments)//////
+};;
+
+
+
+
+// SPECIALS (x for natval, nan, +/-inf or +/-0) ///////////////////////////////
+//------------------------------------------------------------------------------
+.align 32
+tgammal_spec:
+{ .mlx
+ nop.m 0
+ movl GR_DenOverflow = 0x2000000000000001
+}
+{ .mfi
+ nop.m 0
+ fclass.m p9,p0 = f8,0xB // +/-denormals
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fclass.m p6,p0 = f8,0x1E1 // Test x for natval, nan, +inf
+ nop.i 0
+};;
+{ .mfi
+ nop.m 0
+ fclass.m p7,p8 = f8,0x7 // +/-0
+ nop.i 0
+}
+
+{ .mfi
+(p9) cmp.ltu.unc p10,p11 = GR_l_signif_Z, GR_DenOverflow
+(p9) fnorm.s0 f8 = f8
+ nop.i 0
+};;
+
+{ .mfb
+ nop.m 0
+(p9) fcvt.fx.trunc.s1 FR_n_IXN = FR_l_AbsX // Round by truncate
+(p11) br.cond.sptk tgamma_lt_1 // Return to gamma ('good' denormal)////////////
+};;
+
+{ .mfb
+ nop.m 0
+ nop.f 0
+(p10) br.cond.spnt tgammal_overflow // "Bad" denormal - overflow! /////////////
+};;
+
+{ .mfi
+ nop.m 0
+ mov FR_X = f8 // for error handler
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p6) fma.s0 f8 = f8,f1,f8 // res = x + x
+(p6) br.ret.spnt b0 // Exit for NAN, INF and NatVals ////////////////////////
+};;
+.pred.rel "mutex",p7,p8
+{ .mfi
+(p7) mov GR_Parameter_TAG = 256 // negative
+(p7) frcpa.s0 f8,p0 = f1,f8 // Raise V flag
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+ nop.f 0
+(p8) br.cond.spnt tgammal_singularity // Branch for +ZERO ////////////////////
+};;
+
+{ .mfb
+ nop.m 0
+ nop.f 0
+ br.cond.spnt tgammal_libm_err // Branch for -ZERO ///////////////////////
+};;
+
+
+
+
+// SINGULARITY (x is negative integer or 0) ////////////////////////////////////
+//------------------------------------------------------------------------------
+.align 32
+tgammal_singularity:
+{ .mfi
+ nop.m 0
+ mov FR_X = f8 // For error handler
+ mov GR_Parameter_TAG = 256 // negative
+}
+{ .mfb
+ nop.m 0
+ frcpa.s0 f8,p0 = f0,f0 // Raise V flag
+ br.cond.sptk tgammal_libm_err // Call error handler /////////////////////
+ // with singularity error /////////////////
+};;
+
+
+
+
+// OVERFLOW (result is too big and cannot be represented by normal value) //////
+// ( X > 1755.54 and for denormals with abs value less than 0x2000000000000001 )
+//------------------------------------------------------------------------------
+.align 32
+tgammal_overflow:
+{ .mfi
+ addl r8 = 0x1FFFE, r0 // Exp of INF
+ fcmp.lt.s1 p15,p14 = f8,f0 // p14 - pos arg, p15 - neg arg
+ nop.i 0
+};;
+
+{ .mfi
+ setf.exp f9 = r8
+ mov FR_X = f8 // For error handler
+ mov GR_Parameter_TAG = 255 // overflow
+};;
+
+.pred.rel "mutex",p14,p15
+{ .mfi
+ nop.m 0
+(p14) fma.s0 f8 = f9,f9,f0 // Set I,O and +INF result
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p15) fnma.s0 f8 = f9,f9,f0 // Set I,O and -INF result
+ br.cond.sptk tgammal_libm_err // Call error handler /////////////////////
+ // with overflow error ////////////////////
+};;
+
+
+
+
+
+// UNDERFLOW (x is negative noninteger with big absolute value) ////////////////
+//------------------------------------------------------------------------------
+.align 32
+tgammal_underflow:
+{ .mfi
+ nop.m 0
+ fcvt.fx.trunc.s1 FR_u_IXN = f8 // Convert arg to int repres. in FR
+ nop.i 0
+};;
+
+{ .mmi
+ getf.sig GR_u_XN = FR_u_IXN
+ mov r11 = 0x00001
+ nop.i 0
+};;
+
+{ .mfi
+ setf.exp f9 = r11
+ nop.f 0
+ nop.i 0
+};;
+
+{ .mfi
+ nop.m 0
+ nop.f 0
+ tbit.z p6,p7 = GR_u_XN,0 // even or odd
+};;
+
+.pred.rel "mutex",p6,p7
+{ .mfi
+ nop.m 0
+(p6) fms.s0 f8 = f9,f9,f9 // for negatives
+ nop.i 0
+}
+{ .mfb
+ nop.m 0
+(p7) fma.s0 f8 = f9,f9,f9 // for positives
+ br.ret.sptk b0 // Exit for underflow path //////////////////////////////
+};;
+
+
+GLOBAL_LIBM_END(tgammal)
+libm_alias_ldouble_other (tgamma, tgamma)
+
+
+
+
+////////////////// Tgammal error handler ///////////////////////////////////////
+//------------------------------------------------------------------------------
+LOCAL_LIBM_ENTRY(__libm_error_region)
+tgammal_libm_err:
+.prologue
+{ .mfi
+ add GR_Parameter_Y=-32,sp // Parameter 2 value
+ nop.f 0
+.save ar.pfs,GR_SAVE_PFS
+ mov GR_SAVE_PFS=ar.pfs // Save ar.pfs
+}
+{ .mfi
+.fframe 64
+ add sp=-64,sp // Create new stack
+ nop.f 0
+ mov GR_SAVE_GP=gp // Save gp
+};;
+{ .mmi
+ stfe [GR_Parameter_Y] = FR_Y,16 // Save Parameter 2 on stack
+ add GR_Parameter_X = 16,sp // Parameter 1 address
+.save b0, GR_SAVE_B0
+ mov GR_SAVE_B0=b0 // Save b0
+};;
+.body
+{ .mib
+ stfe [GR_Parameter_X] = FR_X // Store Parameter 1 on stack
+ add GR_Parameter_RESULT = 0,GR_Parameter_Y
+ nop.b 0 // Parameter 3 address
+}
+{ .mib
+ stfe [GR_Parameter_Y] = FR_RESULT // Store Parameter 3 on stack
+ add GR_Parameter_Y = -16,GR_Parameter_Y
+ br.call.sptk b0=__libm_error_support# // Call error handling function
+};;
+{ .mmi
+ nop.m 999
+ nop.m 999
+ add GR_Parameter_RESULT = 48,sp
+};;
+{ .mmi
+ ldfe f8 = [GR_Parameter_RESULT] // Get return result off stack
+.restore sp
+ add sp = 64,sp // Restore stack pointer
+ mov b0 = GR_SAVE_B0 // Restore return address
+};;
+{ .mib
+ mov gp = GR_SAVE_GP // Restore gp
+ mov ar.pfs = GR_SAVE_PFS // Restore ar.pfs
+ br.ret.sptk b0 // Return
+};;
+
+LOCAL_LIBM_END(__libm_error_region#)
+
+.type __libm_error_support#,@function
+.global __libm_error_support#
diff --git a/sysdeps/ia64/gccframe.h b/sysdeps/ia64/gccframe.h
index 26121db8bb..d458c3b051 100644
--- a/sysdeps/ia64/gccframe.h
+++ b/sysdeps/ia64/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. ia64 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/hp-timing.h b/sysdeps/ia64/hp-timing.h
index f97cf53648..d8d1d7bf2c 100644
--- a/sysdeps/ia64/hp-timing.h
+++ b/sysdeps/ia64/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. IA-64 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 2001.
diff --git a/sysdeps/ia64/htonl.S b/sysdeps/ia64/htonl.S
index 53780763a2..3cc127546f 100644
--- a/sysdeps/ia64/htonl.S
+++ b/sysdeps/ia64/htonl.S
@@ -1,5 +1,5 @@
/* Change byte order in 32-bit value. ia64 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dan Pop <Dan.Pop@cern.ch>
diff --git a/sysdeps/ia64/htons.S b/sysdeps/ia64/htons.S
index eb825ed47b..3baa6a0bd5 100644
--- a/sysdeps/ia64/htons.S
+++ b/sysdeps/ia64/htons.S
@@ -1,5 +1,5 @@
/* Change byte order in 16-bit value. ia64 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dan Pop <Dan.Pop@cern.ch>
diff --git a/sysdeps/ia64/ieee754.h b/sysdeps/ia64/ieee754.h
index d4ae04ee5d..89312d01a8 100644
--- a/sysdeps/ia64/ieee754.h
+++ b/sysdeps/ia64/ieee754.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/jmpbuf-unwind.h b/sysdeps/ia64/jmpbuf-unwind.h
index 2b0499f73f..8f814d7d60 100644
--- a/sysdeps/ia64/jmpbuf-unwind.h
+++ b/sysdeps/ia64/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/ia64/ldsodefs.h b/sysdeps/ia64/ldsodefs.h
index f79392fe6b..4d1ce234ca 100644
--- a/sysdeps/ia64/ldsodefs.h
+++ b/sysdeps/ia64/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/libc-tls.c b/sysdeps/ia64/libc-tls.c
index 5361a2ec54..ca117b9eea 100644
--- a/sysdeps/ia64/libc-tls.c
+++ b/sysdeps/ia64/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. IA-64 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/machine-gmon.h b/sysdeps/ia64/machine-gmon.h
index 5f17c1eabc..c76c567d28 100644
--- a/sysdeps/ia64/machine-gmon.h
+++ b/sysdeps/ia64/machine-gmon.h
@@ -1,5 +1,5 @@
/* Machine-specific calling sequence for `mcount' profiling function. IA-64.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/math-tests.h b/sysdeps/ia64/math-tests.h
new file mode 100644
index 0000000000..81e29f5c03
--- /dev/null
+++ b/sysdeps/ia64/math-tests.h
@@ -0,0 +1,25 @@
+/* Configuration for math tests. ia64 version.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* Before GCC 7, there is no built-in function to provide a __float128
+ sNaN, so most sNaN tests for this type cannot work. */
+#if !__GNUC_PREREQ (7, 0)
+# define SNAN_TESTS_float128 0
+#endif
+
+#include_next <math-tests.h>
diff --git a/sysdeps/ia64/memccpy.S b/sysdeps/ia64/memccpy.S
index a0a462a78e..c97d1de33c 100644
--- a/sysdeps/ia64/memccpy.S
+++ b/sysdeps/ia64/memccpy.S
@@ -1,6 +1,6 @@
/* Optimized version of the memccpy() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/memchr.S b/sysdeps/ia64/memchr.S
index 909e86b907..c52fca6109 100644
--- a/sysdeps/ia64/memchr.S
+++ b/sysdeps/ia64/memchr.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard memchr() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
@@ -67,6 +67,10 @@ ENTRY(__memchr)
.body
mov ret0 = str
add last = str, in2 // last byte
+ ;;
+ cmp.ltu p6, p0 = last, str
+ ;;
+(p6) mov last = -1
and tmp = 7, str // tmp = str % 8
cmp.ne p7, p0 = r0, r0 // clear p7
extr.u chr = in1, 0, 8 // chr = (unsigned char) in1
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index ffae63fcdb..bf475b38e9 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard memcmp() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/memcpy.S b/sysdeps/ia64/memcpy.S
index f355ce48f3..3abfee91ce 100644
--- a/sysdeps/ia64/memcpy.S
+++ b/sysdeps/ia64/memcpy.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard memcpy() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop for Itanium <Dan.Pop@cern.ch>.
Rewritten for McKinley by Sverre Jarp, HP Labs/CERN <Sverre.Jarp@cern.ch>
diff --git a/sysdeps/ia64/memmove.S b/sysdeps/ia64/memmove.S
index 598dcd450e..37d7466d14 100644
--- a/sysdeps/ia64/memmove.S
+++ b/sysdeps/ia64/memmove.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard memmove() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/memset.S b/sysdeps/ia64/memset.S
index f3ac0361cf..11cc1d2fea 100644
--- a/sysdeps/ia64/memset.S
+++ b/sysdeps/ia64/memset.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard memset() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop for Itanium <Dan.Pop@cern.ch>.
Rewritten for McKinley by Sverre Jarp, HP Labs/CERN <Sverre.Jarp@cern.ch>
diff --git a/sysdeps/ia64/memusage.h b/sysdeps/ia64/memusage.h
index 33005fb3a4..f231ffd3d5 100644
--- a/sysdeps/ia64/memusage.h
+++ b/sysdeps/ia64/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/nptl/Makefile b/sysdeps/ia64/nptl/Makefile
index 48f1327446..080663185d 100644
--- a/sysdeps/ia64/nptl/Makefile
+++ b/sysdeps/ia64/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -20,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-arch.h b/sysdeps/ia64/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..57be66cb99
--- /dev/null
+++ b/sysdeps/ia64/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.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/>. */
+
+#ifndef _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#define __SIZEOF_PTHREAD_ATTR_T 56
+#define __SIZEOF_PTHREAD_MUTEX_T 40
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCK_T 56
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIER_T 32
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Definitions for internal mutex struct. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
+#define __PTHREAD_MUTEX_USE_UNION 0
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+/* Data structure for reader-write lock variable handling. The
+ structure of the attribute type is not exposed on purpose. */
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+ int __cur_writer;
+ int __shared;
+ unsigned long int __pad1;
+ unsigned long int __pad2;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned int __flags;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/ia64/nptl/bits/pthreadtypes.h b/sysdeps/ia64/nptl/bits/pthreadtypes.h
deleted file mode 100644
index f2e6dacf98..0000000000
--- a/sysdeps/ia64/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.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/>. */
-
-#ifndef _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#define __SIZEOF_PTHREAD_ATTR_T 56
-#define __SIZEOF_PTHREAD_MUTEX_T 40
-#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-#define __SIZEOF_PTHREAD_COND_T 48
-#define __SIZEOF_PTHREAD_CONDATTR_T 4
-#define __SIZEOF_PTHREAD_RWLOCK_T 56
-#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-#define __SIZEOF_PTHREAD_BARRIER_T 32
-#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-
-
-/* Thread identifiers. The structure of the attribute type is not
- exposed on purpose. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-typedef struct __pthread_internal_list
-{
- struct __pthread_internal_list *__prev;
- struct __pthread_internal_list *__next;
-} __pthread_list_t;
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is not exposed on purpose. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
- unsigned int __nusers;
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
- int __spins;
- __pthread_list_t __list;
-#define __PTHREAD_MUTEX_HAVE_PREV 1
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- int __writer;
- int __shared;
- unsigned long int __pad1;
- unsigned long int __pad2;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned int __flags;
- } __data;
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/ia64/nptl/bits/semaphore.h b/sysdeps/ia64/nptl/bits/semaphore.h
index 84a861e4de..8836ddedcf 100644
--- a/sysdeps/ia64/nptl/bits/semaphore.h
+++ b/sysdeps/ia64/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/ia64/nptl/pthread-offsets.h b/sysdeps/ia64/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..16c6b0d9fd
--- /dev/null
+++ b/sysdeps/ia64/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 12
+#define __PTHREAD_MUTEX_KIND_OFFSET 16
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 24
diff --git a/sysdeps/ia64/nptl/pthread_spin_lock.c b/sysdeps/ia64/nptl/pthread_spin_lock.c
index a38740b578..4843a6d3e5 100644
--- a/sysdeps/ia64/nptl/pthread_spin_lock.c
+++ b/sysdeps/ia64/nptl/pthread_spin_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/ia64/nptl/pthread_spin_trylock.c b/sysdeps/ia64/nptl/pthread_spin_trylock.c
index 304ac0706a..0a2beccf10 100644
--- a/sysdeps/ia64/nptl/pthread_spin_trylock.c
+++ b/sysdeps/ia64/nptl/pthread_spin_trylock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/ia64/nptl/pthread_spin_unlock.c b/sysdeps/ia64/nptl/pthread_spin_unlock.c
index ccdef4168e..b16dfed1ac 100644
--- a/sysdeps/ia64/nptl/pthread_spin_unlock.c
+++ b/sysdeps/ia64/nptl/pthread_spin_unlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/ia64/nptl/pthreaddef.h b/sysdeps/ia64/nptl/pthreaddef.h
index 810bf419c2..09f9acf25c 100644
--- a/sysdeps/ia64/nptl/pthreaddef.h
+++ b/sysdeps/ia64/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/nptl/tcb-offsets.sym b/sysdeps/ia64/nptl/tcb-offsets.sym
index e1707ab1c8..b01f712be2 100644
--- a/sysdeps/ia64/nptl/tcb-offsets.sym
+++ b/sysdeps/ia64/nptl/tcb-offsets.sym
@@ -1,7 +1,6 @@
#include <sysdep.h>
#include <tls.h>
-PID offsetof (struct pthread, pid) - TLS_PRE_TCB_SIZE
TID offsetof (struct pthread, tid) - TLS_PRE_TCB_SIZE
MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads) - TLS_PRE_TCB_SIZE
SYSINFO_OFFSET offsetof (tcbhead_t, __private)
diff --git a/sysdeps/ia64/nptl/tls.h b/sysdeps/ia64/nptl/tls.h
index 54fddf5952..8760ee3b3a 100644
--- a/sysdeps/ia64/nptl/tls.h
+++ b/sysdeps/ia64/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. nptl/IA-64 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,19 +26,7 @@
# include <stdint.h>
# include <stdlib.h>
# include <list.h>
-
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
-
+# include <dl-dtv.h>
typedef struct
{
@@ -167,6 +155,7 @@ register struct pthread *__thread_self __asm__("r13");
= THREAD_GET_POINTER_GUARD ())
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/ia64/sched_cpucount.c b/sysdeps/ia64/sched_cpucount.c
index 521e1a2df7..3a128a38b2 100644
--- a/sysdeps/ia64/sched_cpucount.c
+++ b/sysdeps/ia64/sched_cpucount.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/softpipe.h b/sysdeps/ia64/softpipe.h
index 2156c35fd0..684ad40471 100644
--- a/sysdeps/ia64/softpipe.h
+++ b/sysdeps/ia64/softpipe.h
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/sysdeps/ia64/sotruss-lib.c b/sysdeps/ia64/sotruss-lib.c
index dd9345a535..2f3b642241 100644
--- a/sysdeps/ia64/sotruss-lib.c
+++ b/sysdeps/ia64/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for ia64.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/ia64/stackinfo.h b/sysdeps/ia64/stackinfo.h
index 9930e25fb8..102f54bac2 100644
--- a/sysdeps/ia64/stackinfo.h
+++ b/sysdeps/ia64/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,8 +27,7 @@
here. */
#define _STACK_GROWS_DOWN 1
-/* Default to an executable stack. PF_X can be overridden if PT_GNU_STACK is
- * present, but it is presumed absent. */
-#define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
+/* Default to a non-executable stack. */
+#define DEFAULT_STACK_PERMS (PF_R|PF_W)
#endif /* stackinfo.h */
diff --git a/sysdeps/ia64/start.S b/sysdeps/ia64/start.S
index 666fc48ce4..04205aa94f 100644
--- a/sysdeps/ia64/start.S
+++ b/sysdeps/ia64/start.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
diff --git a/sysdeps/ia64/strcat.c b/sysdeps/ia64/strcat.c
deleted file mode 100644
index c5f6ae0537..0000000000
--- a/sysdeps/ia64/strcat.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (C) 2004-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 <string.h>
-
-char *
-strcat (char *dest, const char *src)
-{
- strcpy (dest + strlen (dest), src);
- return dest;
-}
-libc_hidden_builtin_def (strcat)
diff --git a/sysdeps/ia64/strchr.S b/sysdeps/ia64/strchr.S
index c8580ee839..3a29e80b52 100644
--- a/sysdeps/ia64/strchr.S
+++ b/sysdeps/ia64/strchr.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard strchr() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/strcmp.S b/sysdeps/ia64/strcmp.S
index 7f8f30719c..e4a3329987 100644
--- a/sysdeps/ia64/strcmp.S
+++ b/sysdeps/ia64/strcmp.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard strcmp() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/strcpy.S b/sysdeps/ia64/strcpy.S
index 56d51a016f..5d025f6990 100644
--- a/sysdeps/ia64/strcpy.S
+++ b/sysdeps/ia64/strcpy.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard strcpy() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/strlen.S b/sysdeps/ia64/strlen.S
index 87494094a9..fcf3786546 100644
--- a/sysdeps/ia64/strlen.S
+++ b/sysdeps/ia64/strlen.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard strlen() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/strncmp.S b/sysdeps/ia64/strncmp.S
index fcec2303fd..33379aa083 100644
--- a/sysdeps/ia64/strncmp.S
+++ b/sysdeps/ia64/strncmp.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard strncmp() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/strncpy.S b/sysdeps/ia64/strncpy.S
index b551927550..2bedbbe277 100644
--- a/sysdeps/ia64/strncpy.S
+++ b/sysdeps/ia64/strncpy.S
@@ -1,6 +1,6 @@
/* Optimized version of the standard strncpy() function.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Dan Pop <Dan.Pop@cern.ch>
and Jakub Jelinek <jakub@redhat.com>.
diff --git a/sysdeps/ia64/sysdep.h b/sysdeps/ia64/sysdep.h
index 04b05c5cb1..6066ebd1d3 100644
--- a/sysdeps/ia64/sysdep.h
+++ b/sysdeps/ia64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
diff --git a/sysdeps/ia64/tst-audit.h b/sysdeps/ia64/tst-audit.h
index 0e98430ded..64607a09d8 100644
--- a/sysdeps/ia64/tst-audit.h
+++ b/sysdeps/ia64/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. IA64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/ieee754/bits/huge_val.h b/sysdeps/ieee754/bits/huge_val.h
deleted file mode 100644
index 42d416f703..0000000000
--- a/sysdeps/ieee754/bits/huge_val.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992-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/huge_val.h> directly; include <math.h> instead."
-#endif
-
-/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VAL (__builtin_huge_val())
-#elif __GNUC_PREREQ(2,96)
-# define HUGE_VAL (__extension__ 0x1.0p2047)
-#elif defined __GNUC__
-
-# define HUGE_VAL \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
- { __l: 0x7ff0000000000000ULL }).__d)
-
-#else /* not GCC */
-
-# include <endian.h>
-
-typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
-
-# if __BYTE_ORDER == __BIG_ENDIAN
-# define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
-# endif
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
-# endif
-
-static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
-# define HUGE_VAL (__huge_val.__d)
-
-#endif /* GCC. */
diff --git a/sysdeps/ieee754/bits/huge_valf.h b/sysdeps/ieee754/bits/huge_valf.h
deleted file mode 100644
index 9d418ba320..0000000000
--- a/sysdeps/ieee754/bits/huge_valf.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992-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/huge_valf.h> directly; include <math.h> instead."
-#endif
-
-/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VALF (__builtin_huge_valf())
-#elif __GNUC_PREREQ(2,96)
-# define HUGE_VALF (__extension__ 0x1.0p255f)
-#elif defined __GNUC__
-
-# define HUGE_VALF \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
- { __l: 0x7f800000UL }).__d)
-
-#else /* not GCC */
-
-typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
-
-# if __BYTE_ORDER == __BIG_ENDIAN
-# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
-# endif
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
-# endif
-
-static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
-# define HUGE_VALF (__huge_valf.__f)
-
-#endif /* GCC. */
diff --git a/sysdeps/ieee754/bits/inf.h b/sysdeps/ieee754/bits/inf.h
deleted file mode 100644
index 179bf48a87..0000000000
--- a/sysdeps/ieee754/bits/inf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* `INFINITY' constant for IEEE 754 machines.
- Copyright (C) 2004-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/inf.h> directly; include <math.h> instead."
-#endif
-
-/* IEEE positive infinity. */
-
-#if __GNUC_PREREQ(3,3)
-# define INFINITY (__builtin_inff())
-#else
-# define INFINITY HUGE_VALF
-#endif
diff --git a/sysdeps/ieee754/bits/nan.h b/sysdeps/ieee754/bits/nan.h
deleted file mode 100644
index b832724d6b..0000000000
--- a/sysdeps/ieee754/bits/nan.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* `NAN' constant for IEEE 754 machines.
- Copyright (C) 1992-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/nan.h> directly; include <math.h> instead."
-#endif
-
-
-/* IEEE Not A Number. */
-
-#if __GNUC_PREREQ(3,3)
-
-# define NAN (__builtin_nanf (""))
-
-#elif defined __GNUC__
-
-# define NAN \
- (__extension__ \
- ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \
- { __l: 0x7fc00000UL }).__d)
-
-#else
-
-# include <endian.h>
-
-# if __BYTE_ORDER == __BIG_ENDIAN
-# define __qnan_bytes { 0x7f, 0xc0, 0, 0 }
-# endif
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __qnan_bytes { 0, 0, 0xc0, 0x7f }
-# endif
-
-static union { unsigned char __c[4]; float __d; } __qnan_union
- __attribute__ ((__unused__)) = { __qnan_bytes };
-# define NAN (__qnan_union.__d)
-
-#endif /* GCC. */
diff --git a/sysdeps/ieee754/dbl-64/Makefile b/sysdeps/ieee754/dbl-64/Makefile
index 5557c75b45..c965982fa5 100644
--- a/sysdeps/ieee754/dbl-64/Makefile
+++ b/sysdeps/ieee754/dbl-64/Makefile
@@ -1,6 +1,6 @@
ifeq ($(subdir),math)
# branred depends on precise IEEE double rounding
-CFLAGS-branred.c = $(config-cflags-nofma)
-CFLAGS-e_sqrt.c = $(config-cflags-nofma)
-CFLAGS-e_pow.c = $(config-cflags-nofma)
+CFLAGS-branred.c += $(config-cflags-nofma)
+CFLAGS-e_sqrt.c += $(config-cflags-nofma)
+CFLAGS-e_pow.c += $(config-cflags-nofma)
endif
diff --git a/sysdeps/ieee754/dbl-64/MathLib.h b/sysdeps/ieee754/dbl-64/MathLib.h
index 94182e45c1..671d78f72b 100644
--- a/sysdeps/ieee754/dbl-64/MathLib.h
+++ b/sysdeps/ieee754/dbl-64/MathLib.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/asincos.tbl b/sysdeps/ieee754/dbl-64/asincos.tbl
index 8da9ff3c07..bb9b7c7c07 100644
--- a/sysdeps/ieee754/dbl-64/asincos.tbl
+++ b/sysdeps/ieee754/dbl-64/asincos.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/atnat.h b/sysdeps/ieee754/dbl-64/atnat.h
index a9649c57ea..ff8671ac48 100644
--- a/sysdeps/ieee754/dbl-64/atnat.h
+++ b/sysdeps/ieee754/dbl-64/atnat.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/atnat2.h b/sysdeps/ieee754/dbl-64/atnat2.h
index d5f4ab946d..1c7d3cb760 100644
--- a/sysdeps/ieee754/dbl-64/atnat2.h
+++ b/sysdeps/ieee754/dbl-64/atnat2.h
@@ -2,7 +2,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/branred.c b/sysdeps/ieee754/dbl-64/branred.c
index ca9dd90aff..b1490cce2d 100644
--- a/sysdeps/ieee754/dbl-64/branred.c
+++ b/sysdeps/ieee754/dbl-64/branred.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/branred.h b/sysdeps/ieee754/dbl-64/branred.h
index 7b6b5473b6..0c0f054e62 100644
--- a/sysdeps/ieee754/dbl-64/branred.h
+++ b/sysdeps/ieee754/dbl-64/branred.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/dbl2mpn.c b/sysdeps/ieee754/dbl-64/dbl2mpn.c
index cb5a070914..8d6e8a1836 100644
--- a/sysdeps/ieee754/dbl-64/dbl2mpn.c
+++ b/sysdeps/ieee754/dbl-64/dbl2mpn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/dbl-64/dla.h b/sysdeps/ieee754/dbl-64/dla.h
index d21c47a68f..5196759ca7 100644
--- a/sysdeps/ieee754/dbl-64/dla.h
+++ b/sysdeps/ieee754/dbl-64/dla.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -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/doasin.c b/sysdeps/ieee754/dbl-64/doasin.c
index 903b5484ba..9355333780 100644
--- a/sysdeps/ieee754/dbl-64/doasin.c
+++ b/sysdeps/ieee754/dbl-64/doasin.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/doasin.h b/sysdeps/ieee754/dbl-64/doasin.h
index 044d597f9c..240c7ec67c 100644
--- a/sysdeps/ieee754/dbl-64/doasin.h
+++ b/sysdeps/ieee754/dbl-64/doasin.h
@@ -2,7 +2,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/dosincos.c b/sysdeps/ieee754/dbl-64/dosincos.c
index 931975e6c3..689b453f8d 100644
--- a/sysdeps/ieee754/dbl-64/dosincos.c
+++ b/sysdeps/ieee754/dbl-64/dosincos.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/dosincos.h b/sysdeps/ieee754/dbl-64/dosincos.h
index 02772592e8..23858029e9 100644
--- a/sysdeps/ieee754/dbl-64/dosincos.h
+++ b/sysdeps/ieee754/dbl-64/dosincos.h
@@ -2,7 +2,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/e_acosh.c b/sysdeps/ieee754/dbl-64/e_acosh.c
index c1f3590f75..fe0c375f00 100644
--- a/sysdeps/ieee754/dbl-64/e_acosh.c
+++ b/sysdeps/ieee754/dbl-64/e_acosh.c
@@ -36,7 +36,7 @@ __ieee754_acosh (double x)
{
double t;
int32_t hx;
- u_int32_t lx;
+ uint32_t lx;
EXTRACT_WORDS (hx, lx, x);
if (hx < 0x3ff00000) /* x < 1 */
{
@@ -58,12 +58,12 @@ __ieee754_acosh (double x)
else if (hx > 0x40000000) /* 2**28 > x > 2 */
{
t = x * x;
- return __ieee754_log (2.0 * x - one / (x + __ieee754_sqrt (t - one)));
+ return __ieee754_log (2.0 * x - one / (x + sqrt (t - one)));
}
else /* 1<x<2 */
{
t = x - one;
- return __log1p (t + __ieee754_sqrt (2.0 * t + t * t));
+ return __log1p (t + sqrt (2.0 * t + t * t));
}
}
strong_alias (__ieee754_acosh, __acosh_finite)
diff --git a/sysdeps/ieee754/dbl-64/e_asin.c b/sysdeps/ieee754/dbl-64/e_asin.c
index d8c012d1d3..6bf56945a6 100644
--- a/sysdeps/ieee754/dbl-64/e_asin.c
+++ b/sysdeps/ieee754/dbl-64/e_asin.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -42,6 +42,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#ifndef SECTION
# define SECTION
@@ -323,7 +324,7 @@ __ieee754_asin(double x){
/*---------------------------- |x|>=1 -------------------------------*/
else if (k==0x3ff00000 && u.i[LOW_HALF]==0) return (m>0)?hp0.x:-hp0.x;
else
- if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x;
+ if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x + x;
else {
u.i[HIGH_HALF]=0x7ff00000;
v.i[HIGH_HALF]=0x7ff00000;
@@ -633,7 +634,7 @@ __ieee754_acos(double x)
else
if (k==0x3ff00000 && u.i[LOW_HALF]==0) return (m>0)?0:2.0*hp0.x;
else
- if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x;
+ if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x + x;
else {
u.i[HIGH_HALF]=0x7ff00000;
v.i[HIGH_HALF]=0x7ff00000;
diff --git a/sysdeps/ieee754/dbl-64/e_atan2.c b/sysdeps/ieee754/dbl-64/e_atan2.c
index 22e8fb8fef..7295067507 100644
--- a/sysdeps/ieee754/dbl-64/e_atan2.c
+++ b/sysdeps/ieee754/dbl-64/e_atan2.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -44,6 +44,7 @@
#include <fenv.h>
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <stap-probe.h>
@@ -91,7 +92,7 @@ __ieee754_atan2 (double y, double x)
if ((ux & 0x7ff00000) == 0x7ff00000)
{
if (((ux & 0x000fffff) | dx) != 0x00000000)
- return x + x;
+ return x + y;
}
num.d = y;
uy = num.i[HIGH_HALF];
diff --git a/sysdeps/ieee754/dbl-64/e_atanh.c b/sysdeps/ieee754/dbl-64/e_atanh.c
index 395118e92a..da4da8270c 100644
--- a/sysdeps/ieee754/dbl-64/e_atanh.c
+++ b/sysdeps/ieee754/dbl-64/e_atanh.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -38,7 +38,9 @@
#include <float.h>
#include <inttypes.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
static const double huge = 1e300;
diff --git a/sysdeps/ieee754/dbl-64/e_cosh.c b/sysdeps/ieee754/dbl-64/e_cosh.c
index 52a5d5007d..ae2180aa89 100644
--- a/sysdeps/ieee754/dbl-64/e_cosh.c
+++ b/sysdeps/ieee754/dbl-64/e_cosh.c
@@ -32,6 +32,7 @@
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const double one = 1.0, half = 0.5, huge = 1.0e300;
@@ -41,7 +42,7 @@ __ieee754_cosh (double x)
{
double t, w;
int32_t ix;
- u_int32_t lx;
+ uint32_t lx;
/* High word of |x|. */
GET_HIGH_WORD (ix, x);
@@ -71,7 +72,7 @@ __ieee754_cosh (double x)
/* |x| in [log(maxdouble), overflowthresold] */
GET_LOW_WORD (lx, x);
- if (ix < 0x408633ce || ((ix == 0x408633ce) && (lx <= (u_int32_t) 0x8fb9f87d)))
+ if (ix < 0x408633ce || ((ix == 0x408633ce) && (lx <= (uint32_t) 0x8fb9f87d)))
{
w = __ieee754_exp (half * fabs (x));
t = half * w;
diff --git a/sysdeps/ieee754/dbl-64/e_exp.c b/sysdeps/ieee754/dbl-64/e_exp.c
index ad1bc84625..ddd2bcb1c2 100644
--- a/sysdeps/ieee754/dbl-64/e_exp.c
+++ b/sysdeps/ieee754/dbl-64/e_exp.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -23,10 +23,9 @@
/* exp1 */
/* */
/* FILES NEEDED:dla.h endian.h mpa.h mydefs.h uexp.h */
-/* mpa.c mpexp.x slowexp.c */
/* */
/* An ultimate exp routine. Given an IEEE double machine number x */
-/* it computes the correctly rounded (to nearest) value of e^x */
+/* it computes an almost correctly rounded (to nearest) value of e^x */
/* Assumption: Machine arithmetic operations are performed in */
/* round to nearest mode of IEEE 754 standard. */
/* */
@@ -38,25 +37,25 @@
#include "mydefs.h"
#include "MathLib.h"
#include "uexp.tbl"
+#include <math-barriers.h>
#include <math_private.h>
#include <fenv.h>
#include <float.h>
+#include "eexp.tbl"
#ifndef SECTION
# define SECTION
#endif
-double __slowexp (double);
-
-/* An ultimate exp routine. Given an IEEE double machine number x it computes
- the correctly rounded (to nearest) value of e^x. */
double
SECTION
__ieee754_exp (double x)
{
double bexp, t, eps, del, base, y, al, bet, res, rem, cor;
+ double z;
mynumber junk1, junk2, binexp = {{0, 0}};
int4 i, j, m, n, ex;
+ int4 k;
double retval;
{
@@ -66,7 +65,42 @@ __ieee754_exp (double x)
m = junk1.i[HIGH_HALF];
n = m & hugeint;
- if (n > smallint && n < bigint)
+ if (n < 0x3ff0a2b2) /* |x| < 1.03972053527832 */
+ {
+ if (n < 0x3f862e42) /* |x| < 3/2 ln 2 */
+ {
+ if (n < 0x3ed00000) /* |x| < 1/64 ln 2 */
+ {
+ if (n < 0x3e300000) /* |x| < 2^18 */
+ {
+ retval = one + junk1.x;
+ goto ret;
+ }
+ retval = one + junk1.x * (one + half * junk1.x);
+ goto ret;
+ }
+ t = junk1.x * junk1.x;
+ retval = junk1.x + (t * (half + junk1.x * t2) +
+ (t * t) * (t3 + junk1.x * t4 + t * t5));
+ retval = one + retval;
+ goto ret;
+ }
+
+ /* Find the multiple of 2^-6 nearest x. */
+ k = n >> 20;
+ j = (0x00100000 | (n & 0x000fffff)) >> (0x40c - k);
+ j = (j - 1) & ~1;
+ if (m < 0)
+ j += 134;
+ z = junk1.x - TBL2[j];
+ t = z * z;
+ retval = z + (t * (half + (z * t2))
+ + (t * t) * (t3 + z * t4 + t * t5));
+ retval = TBL2[j + 1] + TBL2[j + 1] * retval;
+ goto ret;
+ }
+
+ if (n < bigint) /* && |x| >= 1.03972053527832 */
{
y = x * log2e.x + three51.x;
bexp = y - three51.x; /* multiply the result by 2**bexp */
@@ -93,22 +127,9 @@ __ieee754_exp (double x)
rem = (bet + bet * eps) + al * eps;
res = al + rem;
- cor = (al - res) + rem;
- if (res == (res + cor * err_0))
- {
- retval = res * binexp.x;
- goto ret;
- }
- else
- {
- retval = __slowexp (x);
- goto ret;
- } /*if error is over bound */
- }
-
- if (n <= smallint)
- {
- retval = 1.0;
+ /* Maximum relative error is 7.8e-22 (70.1 bits).
+ Maximum ULP error is 0.500007. */
+ retval = res * binexp.x;
goto ret;
}
@@ -166,38 +187,22 @@ __ieee754_exp (double x)
if (ex >= -1022)
{
binexp.i[HIGH_HALF] = (1023 + ex) << 20;
- if (res == (res + cor * err_0))
- {
- retval = res * binexp.x;
- goto ret;
- }
- else
- {
- retval = __slowexp (x);
- goto check_uflow_ret;
- } /*if error is over bound */
+ /* Does not underflow: res >= 1.0, binexp >= 0x1p-1022
+ Maximum relative error is 7.8e-22 (70.1 bits).
+ Maximum ULP error is 0.500007. */
+ retval = res * binexp.x;
+ goto ret;
}
ex = -(1022 + ex);
binexp.i[HIGH_HALF] = (1023 - ex) << 20;
res *= binexp.x;
cor *= binexp.x;
- eps = 1.0000000001 + err_0 * binexp.x;
t = 1.0 + res;
y = ((1.0 - t) + res) + cor;
res = t + y;
- cor = (t - res) + y;
- if (res == (res + eps * cor))
- {
- binexp.i[HIGH_HALF] = 0x00100000;
- retval = (res - 1.0) * binexp.x;
- goto check_uflow_ret;
- }
- else
- {
- retval = __slowexp (x);
- goto check_uflow_ret;
- } /* if error is over bound */
- check_uflow_ret:
+ /* Maximum ULP error is 0.5000035. */
+ binexp.i[HIGH_HALF] = 0x00100000;
+ retval = (res - 1.0) * binexp.x;
if (retval < DBL_MIN)
{
double force_underflow = tiny * tiny;
@@ -210,10 +215,9 @@ __ieee754_exp (double x)
else
{
binexp.i[HIGH_HALF] = (junk1.i[LOW_HALF] + 767) << 20;
- if (res == (res + cor * err_0))
- retval = res * binexp.x * t256.x;
- else
- retval = __slowexp (x);
+ /* Maximum relative error is 7.8e-22 (70.1 bits).
+ Maximum ULP error is 0.500007. */
+ retval = res * binexp.x * t256.x;
if (isinf (retval))
goto ret_huge;
else
@@ -233,13 +237,10 @@ ret:
strong_alias (__ieee754_exp, __exp_finite)
#endif
-/* Compute e^(x+xx). The routine also receives bound of error of previous
- calculation. If after computing exp the error exceeds the allowed bounds,
- the routine returns a non-positive number. Otherwise it returns the
- computed result, which is always positive. */
+/* Compute e^(x+xx). */
double
SECTION
-__exp1 (double x, double xx, double error)
+__exp1 (double x, double xx)
{
double bexp, t, eps, del, base, y, al, bet, res, rem, cor;
mynumber junk1, junk2, binexp = {{0, 0}};
@@ -249,6 +250,7 @@ __exp1 (double x, double xx, double error)
m = junk1.i[HIGH_HALF];
n = m & hugeint; /* no sign */
+ /* fabs (x) > 5.551112e-17 and fabs (x) < 7.080010e+02. */
if (n > smallint && n < bigint)
{
y = x * log2e.x + three51.x;
@@ -276,11 +278,9 @@ __exp1 (double x, double xx, double error)
rem = (bet + bet * eps) + al * eps;
res = al + rem;
- cor = (al - res) + rem;
- if (res == (res + cor * (1.0 + error + err_1)))
- return res * binexp.x;
- else
- return -10.0;
+ /* Maximum relative error before rounding is 8.8e-22 (69.9 bits).
+ Maximum ULP error is 0.500008. */
+ return res * binexp.x;
}
if (n <= smallint)
@@ -318,6 +318,7 @@ __exp1 (double x, double xx, double error)
cor = (al - res) + rem;
if (m >> 31)
{
+ /* x < 0. */
ex = junk1.i[LOW_HALF];
if (res < 1.0)
{
@@ -328,34 +329,25 @@ __exp1 (double x, double xx, double error)
if (ex >= -1022)
{
binexp.i[HIGH_HALF] = (1023 + ex) << 20;
- if (res == (res + cor * (1.0 + error + err_1)))
- return res * binexp.x;
- else
- return -10.0;
+ /* Maximum ULP error is 0.500008. */
+ return res * binexp.x;
}
+ /* Denormal case - ex < -1022. */
ex = -(1022 + ex);
binexp.i[HIGH_HALF] = (1023 - ex) << 20;
res *= binexp.x;
cor *= binexp.x;
- eps = 1.00000000001 + (error + err_1) * binexp.x;
t = 1.0 + res;
y = ((1.0 - t) + res) + cor;
res = t + y;
- cor = (t - res) + y;
- if (res == (res + eps * cor))
- {
- binexp.i[HIGH_HALF] = 0x00100000;
- return (res - 1.0) * binexp.x;
- }
- else
- return -10.0;
+ binexp.i[HIGH_HALF] = 0x00100000;
+ /* Maximum ULP error is 0.500004. */
+ return (res - 1.0) * binexp.x;
}
else
{
binexp.i[HIGH_HALF] = (junk1.i[LOW_HALF] + 767) << 20;
- if (res == (res + cor * (1.0 + error + err_1)))
- return res * binexp.x * t256.x;
- else
- return -10.0;
+ /* Maximum ULP error is 0.500008. */
+ return res * binexp.x * t256.x;
}
}
diff --git a/sysdeps/ieee754/dbl-64/e_exp10.c b/sysdeps/ieee754/dbl-64/e_exp10.c
index e3b39f7e31..0721143a69 100644
--- a/sysdeps/ieee754/dbl-64/e_exp10.c
+++ b/sysdeps/ieee754/dbl-64/e_exp10.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/dbl-64/e_exp2.c b/sysdeps/ieee754/dbl-64/e_exp2.c
index 7402bd7d89..c45bb44744 100644
--- a/sysdeps/ieee754/dbl-64/e_exp2.c
+++ b/sysdeps/ieee754/dbl-64/e_exp2.c
@@ -1,5 +1,5 @@
/* Double-precision floating point 2^x.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
@@ -29,7 +29,9 @@
#include <math.h>
#include <fenv.h>
#include <inttypes.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
#include "t_exp2.h"
diff --git a/sysdeps/ieee754/dbl-64/e_fmod.c b/sysdeps/ieee754/dbl-64/e_fmod.c
index e82b302200..1a8c14dc2a 100644
--- a/sysdeps/ieee754/dbl-64/e_fmod.c
+++ b/sysdeps/ieee754/dbl-64/e_fmod.c
@@ -24,7 +24,7 @@ double
__ieee754_fmod (double x, double y)
{
int32_t n, hx, hy, hz, ix, iy, sx, i;
- u_int32_t lx, ly, lz;
+ uint32_t lx, ly, lz;
EXTRACT_WORDS (hx, lx, x);
EXTRACT_WORDS (hy, ly, y);
@@ -41,7 +41,7 @@ __ieee754_fmod (double x, double y)
if ((hx < hy) || (lx < ly))
return x; /* |x|<|y| return x */
if (lx == ly)
- return Zero[(u_int32_t) sx >> 31]; /* |x|=|y| return x*0*/
+ return Zero[(uint32_t) sx >> 31]; /* |x|=|y| return x*0*/
}
/* determine ix = ilogb(x) */
@@ -125,7 +125,7 @@ __ieee754_fmod (double x, double y)
else
{
if ((hz | lz) == 0) /* return sign(x)*0 */
- return Zero[(u_int32_t) sx >> 31];
+ return Zero[(uint32_t) sx >> 31];
hx = hz + hz + (lz >> 31); lx = lz + lz;
}
}
@@ -138,7 +138,7 @@ __ieee754_fmod (double x, double y)
/* convert back to floating value and restore the sign */
if ((hx | lx) == 0) /* return sign(x)*0 */
- return Zero[(u_int32_t) sx >> 31];
+ return Zero[(uint32_t) sx >> 31];
while (hx < 0x00100000) /* normalize x */
{
hx = hx + hx + (lx >> 31); lx = lx + lx;
@@ -154,7 +154,7 @@ __ieee754_fmod (double x, double y)
n = -1022 - iy;
if (n <= 20)
{
- lx = (lx >> n) | ((u_int32_t) hx << (32 - n));
+ lx = (lx >> n) | ((uint32_t) hx << (32 - n));
hx >>= n;
}
else if (n <= 31)
diff --git a/sysdeps/ieee754/dbl-64/e_gamma_r.c b/sysdeps/ieee754/dbl-64/e_gamma_r.c
index 2d156850d5..2744549cbd 100644
--- a/sysdeps/ieee754/dbl-64/e_gamma_r.c
+++ b/sysdeps/ieee754/dbl-64/e_gamma_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,7 +18,9 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
@@ -98,7 +100,7 @@ gamma_positive (double x, int *exp2_adj)
double ret = (__ieee754_pow (x_adj_mant, x_adj)
* __ieee754_exp2 (x_adj_log2 * x_adj_frac)
* __ieee754_exp (-x_adj)
- * __ieee754_sqrt (2 * M_PI / x_adj)
+ * sqrt (2 * M_PI / x_adj)
/ prod);
exp_adj += x_eps * __ieee754_log (x_adj);
double bsum = gamma_coeff[NCOEFF - 1];
@@ -114,7 +116,7 @@ double
__ieee754_gamma_r (double x, int *signgamp)
{
int32_t hx;
- u_int32_t lx;
+ uint32_t lx;
double ret;
EXTRACT_WORDS (hx, lx, x);
@@ -126,7 +128,7 @@ __ieee754_gamma_r (double x, int *signgamp)
return 1.0 / x;
}
if (__builtin_expect (hx < 0, 0)
- && (u_int32_t) hx < 0xfff00000 && __rint (x) == x)
+ && (uint32_t) hx < 0xfff00000 && __rint (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
diff --git a/sysdeps/ieee754/dbl-64/e_hypot.c b/sysdeps/ieee754/dbl-64/e_hypot.c
index f142c450a2..a2c33cc4ed 100644
--- a/sysdeps/ieee754/dbl-64/e_hypot.c
+++ b/sysdeps/ieee754/dbl-64/e_hypot.c
@@ -44,6 +44,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
double
__ieee754_hypot (double x, double y)
@@ -74,8 +75,10 @@ __ieee754_hypot (double x, double y)
{
if (ha >= 0x7ff00000) /* Inf or NaN */
{
- u_int32_t low;
+ uint32_t low;
w = a + b; /* for sNaN */
+ if (issignaling (a) || issignaling (b))
+ return w;
GET_LOW_WORD (low, a);
if (((ha & 0xfffff) | low) == 0)
w = a;
@@ -93,7 +96,7 @@ __ieee754_hypot (double x, double y)
{
if (hb <= 0x000fffff) /* subnormal b or 0 */
{
- u_int32_t low;
+ uint32_t low;
GET_LOW_WORD (low, b);
if ((hb | low) == 0)
return a;
@@ -130,7 +133,7 @@ __ieee754_hypot (double x, double y)
t1 = 0;
SET_HIGH_WORD (t1, ha);
t2 = a - t1;
- w = __ieee754_sqrt (t1 * t1 - (b * (-b) - t2 * (a + t1)));
+ w = sqrt (t1 * t1 - (b * (-b) - t2 * (a + t1)));
}
else
{
@@ -141,11 +144,11 @@ __ieee754_hypot (double x, double y)
t1 = 0;
SET_HIGH_WORD (t1, ha + 0x00100000);
t2 = a - t1;
- w = __ieee754_sqrt (t1 * y1 - (w * (-w) - (t1 * y2 + t2 * b)));
+ w = sqrt (t1 * y1 - (w * (-w) - (t1 * y2 + t2 * b)));
}
if (k != 0)
{
- u_int32_t high;
+ uint32_t high;
t1 = 1.0;
GET_HIGH_WORD (high, t1);
SET_HIGH_WORD (t1, high + (k << 20));
diff --git a/sysdeps/ieee754/dbl-64/e_j0.c b/sysdeps/ieee754/dbl-64/e_j0.c
index 9f25aa855e..7f5919910d 100644
--- a/sysdeps/ieee754/dbl-64/e_j0.c
+++ b/sysdeps/ieee754/dbl-64/e_j0.c
@@ -59,6 +59,7 @@
*/
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
static double pzero (double), qzero (double);
@@ -109,11 +110,11 @@ __ieee754_j0 (double x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
if (ix > 0x48000000)
- z = (invsqrtpi * cc) / __ieee754_sqrt (x);
+ z = (invsqrtpi * cc) / sqrt (x);
else
{
u = pzero (x); v = qzero (x);
- z = invsqrtpi * (u * cc - v * ss) / __ieee754_sqrt (x);
+ z = invsqrtpi * (u * cc - v * ss) / sqrt (x);
}
return z;
}
@@ -169,7 +170,7 @@ __ieee754_y0 (double x)
if (ix >= 0x7ff00000)
return one / (x + x * x);
if ((ix | lx) == 0)
- return -HUGE_VAL + x; /* -inf and overflow exception. */
+ return -1 / zero; /* -inf and divide by zero exception. */
if (hx < 0)
return zero / (zero * x);
if (ix >= 0x40000000) /* |x| >= 2.0 */
@@ -200,11 +201,11 @@ __ieee754_y0 (double x)
ss = z / cc;
}
if (ix > 0x48000000)
- z = (invsqrtpi * ss) / __ieee754_sqrt (x);
+ z = (invsqrtpi * ss) / sqrt (x);
else
{
u = pzero (x); v = qzero (x);
- z = invsqrtpi * (u * ss + v * cc) / __ieee754_sqrt (x);
+ z = invsqrtpi * (u * ss + v * cc) / sqrt (x);
}
return z;
}
diff --git a/sysdeps/ieee754/dbl-64/e_j1.c b/sysdeps/ieee754/dbl-64/e_j1.c
index 4827fbf3d3..734f3ca64a 100644
--- a/sysdeps/ieee754/dbl-64/e_j1.c
+++ b/sysdeps/ieee754/dbl-64/e_j1.c
@@ -61,7 +61,9 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static double pone (double), qone (double);
@@ -112,11 +114,11 @@ __ieee754_j1 (double x)
* y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
*/
if (ix > 0x48000000)
- z = (invsqrtpi * cc) / __ieee754_sqrt (y);
+ z = (invsqrtpi * cc) / sqrt (y);
else
{
u = pone (y); v = qone (y);
- z = invsqrtpi * (u * cc - v * ss) / __ieee754_sqrt (y);
+ z = invsqrtpi * (u * cc - v * ss) / sqrt (y);
}
if (hx < 0)
return -z;
@@ -174,7 +176,7 @@ __ieee754_y1 (double x)
if (__glibc_unlikely (ix >= 0x7ff00000))
return one / (x + x * x);
if (__glibc_unlikely ((ix | lx) == 0))
- return -HUGE_VAL + x;
+ return -1 / zero; /* -inf and divide by zero exception. */
/* -inf and overflow exception. */;
if (__glibc_unlikely (hx < 0))
return zero / (zero * x);
@@ -203,11 +205,11 @@ __ieee754_y1 (double x)
* to compute the worse one.
*/
if (ix > 0x48000000)
- z = (invsqrtpi * ss) / __ieee754_sqrt (x);
+ z = (invsqrtpi * ss) / sqrt (x);
else
{
u = pone (x); v = qone (x);
- z = invsqrtpi * (u * ss + v * cc) / __ieee754_sqrt (x);
+ z = invsqrtpi * (u * ss + v * cc) / sqrt (x);
}
return z;
}
diff --git a/sysdeps/ieee754/dbl-64/e_jn.c b/sysdeps/ieee754/dbl-64/e_jn.c
index 3fecf82f10..9181b22bb8 100644
--- a/sysdeps/ieee754/dbl-64/e_jn.c
+++ b/sysdeps/ieee754/dbl-64/e_jn.c
@@ -39,7 +39,9 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static const double
invsqrtpi = 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
@@ -61,7 +63,7 @@ __ieee754_jn (int n, double x)
EXTRACT_WORDS (hx, lx, x);
ix = 0x7fffffff & hx;
/* if J(n,NaN) is NaN */
- if (__glibc_unlikely ((ix | ((u_int32_t) (lx | -lx)) >> 31) > 0x7ff00000))
+ if (__glibc_unlikely ((ix | ((uint32_t) (lx | -lx)) >> 31) > 0x7ff00000))
return x + x;
if (n < 0)
{
@@ -107,7 +109,7 @@ __ieee754_jn (int n, double x)
case 2: temp = -c - s; break;
case 3: temp = c - s; break;
}
- b = invsqrtpi * temp / __ieee754_sqrt (x);
+ b = invsqrtpi * temp / sqrt (x);
}
else
{
@@ -266,13 +268,8 @@ __ieee754_yn (int n, double x)
EXTRACT_WORDS (hx, lx, x);
ix = 0x7fffffff & hx;
/* if Y(n,NaN) is NaN */
- if (__glibc_unlikely ((ix | ((u_int32_t) (lx | -lx)) >> 31) > 0x7ff00000))
+ if (__glibc_unlikely ((ix | ((uint32_t) (lx | -lx)) >> 31) > 0x7ff00000))
return x + x;
- if (__glibc_unlikely ((ix | lx) == 0))
- return -HUGE_VAL + x;
- /* -inf and overflow exception. */;
- if (__glibc_unlikely (hx < 0))
- return zero / (zero * x);
sign = 1;
if (n < 0)
{
@@ -281,6 +278,11 @@ __ieee754_yn (int n, double x)
}
if (n == 0)
return (__ieee754_y0 (x));
+ if (__glibc_unlikely ((ix | lx) == 0))
+ return -sign / zero;
+ /* -inf and overflow exception. */;
+ if (__glibc_unlikely (hx < 0))
+ return zero / (zero * x);
{
SET_RESTORE_ROUND (FE_TONEAREST);
if (n == 1)
@@ -314,11 +316,11 @@ __ieee754_yn (int n, double x)
case 2: temp = -s + c; break;
case 3: temp = s + c; break;
}
- b = invsqrtpi * temp / __ieee754_sqrt (x);
+ b = invsqrtpi * temp / sqrt (x);
}
else
{
- u_int32_t high;
+ uint32_t high;
a = __ieee754_y0 (x);
b = __ieee754_y1 (x);
/* quit if b is -inf */
diff --git a/sysdeps/ieee754/dbl-64/e_lgamma_r.c b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
index 15154c0f43..17717d915f 100644
--- a/sysdeps/ieee754/dbl-64/e_lgamma_r.c
+++ b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
@@ -77,9 +77,10 @@
*
*/
-#include <libc-internal.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libc-diag.h>
static const double
two52= 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
@@ -225,7 +226,7 @@ __ieee754_lgamma_r(double x, int *signgamp)
if(hx<0) {
if(__builtin_expect(ix>=0x43300000, 0))
/* |x|>=2**52, must be -integer */
- return x/zero;
+ return fabs (x)/zero;
if (x < -2.0 && x > -28.0)
return __lgamma_neg (x, signgamp);
t = sin_pi(x);
diff --git a/sysdeps/ieee754/dbl-64/e_log.c b/sysdeps/ieee754/dbl-64/e_log.c
index 9917dc236f..2483dd8551 100644
--- a/sysdeps/ieee754/dbl-64/e_log.c
+++ b/sysdeps/ieee754/dbl-64/e_log.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -23,11 +23,10 @@
/* FUNCTION:ulog */
/* */
/* FILES NEEDED: dla.h endian.h mpa.h mydefs.h ulog.h */
-/* mpexp.c mplog.c mpa.c */
/* ulog.tbl */
/* */
/* An ultimate log routine. Given an IEEE double machine number x */
-/* it computes the correctly rounded (to nearest) value of log(x). */
+/* it computes the rounded (to nearest) value of log(x). */
/* Assumption: Machine arithmetic operations are performed in */
/* round to nearest mode of IEEE 754 standard. */
/* */
@@ -40,34 +39,26 @@
#include "MathLib.h"
#include <math.h>
#include <math_private.h>
-#include <stap-probe.h>
#ifndef SECTION
# define SECTION
#endif
-void __mplog (mp_no *, mp_no *, int);
-
/*********************************************************************/
-/* An ultimate log routine. Given an IEEE double machine number x */
-/* it computes the correctly rounded (to nearest) value of log(x). */
+/* An ultimate log routine. Given an IEEE double machine number x */
+/* it computes the rounded (to nearest) value of log(x). */
/*********************************************************************/
double
SECTION
__ieee754_log (double x)
{
-#define M 4
- static const int pr[M] = { 8, 10, 18, 32 };
- int i, j, n, ux, dx, p;
+ int i, j, n, ux, dx;
double dbl_n, u, p0, q, r0, w, nln2a, luai, lubi, lvaj, lvbj,
- sij, ssij, ttij, A, B, B0, y, y1, y2, polI, polII, sa, sb,
- t1, t2, t7, t8, t, ra, rb, ww,
- a0, aa0, s1, s2, ss2, s3, ss3, a1, aa1, a, aa, b, bb, c;
+ sij, ssij, ttij, A, B, B0, polI, polII, t8, a, aa, b, bb, c;
#ifndef DLA_FMS
- double t3, t4, t5, t6;
+ double t1, t2, t3, t4, t5;
#endif
number num;
- mp_no mpx, mpy, mpy1, mpy2, mperr;
#include "ulog.tbl"
#include "ulog.h"
@@ -101,7 +92,7 @@ __ieee754_log (double x)
if (w == 0.0)
return 0.0;
- /*--- Stage I, the case abs(x-1) < 0.03 */
+ /*--- The case abs(x-1) < 0.03 */
t8 = MHALF * w;
EMULV (t8, w, a, aa, t1, t2, t3, t4, t5);
@@ -118,50 +109,12 @@ __ieee754_log (double x)
polII *= w * w * w;
c = (aa + bb) + polII;
- /* End stage I, case abs(x-1) < 0.03 */
- if ((y = b + (c + b * E2)) == b + (c - b * E2))
- return y;
-
- /*--- Stage II, the case abs(x-1) < 0.03 */
-
- a = d19.d + w * d20.d;
- a = d18.d + w * a;
- a = d17.d + w * a;
- a = d16.d + w * a;
- a = d15.d + w * a;
- a = d14.d + w * a;
- a = d13.d + w * a;
- a = d12.d + w * a;
- a = d11.d + w * a;
-
- EMULV (w, a, s2, ss2, t1, t2, t3, t4, t5);
- ADD2 (d10.d, dd10.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d9.d, dd9.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d8.d, dd8.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d7.d, dd7.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d6.d, dd6.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d5.d, dd5.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d4.d, dd4.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d3.d, dd3.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d2.d, dd2.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- MUL2 (w, 0, s2, ss2, s3, ss3, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (w, 0, s3, ss3, b, bb, t1, t2);
+ /* Here b contains the high part of the result, and c the low part.
+ Maximum error is b * 2.334e-19, so accuracy is >61 bits.
+ Therefore max ULP error of b + c is ~0.502. */
+ return b + c;
- /* End stage II, case abs(x-1) < 0.03 */
- if ((y = b + (bb + b * E4)) == b + (bb - b * E4))
- return y;
- goto stage_n;
-
- /*--- Stage I, the case abs(x-1) > 0.03 */
+ /*--- The case abs(x-1) > 0.03 */
case_03:
/* Find n,u such that x = u*2**n, 1/sqrt(2) < u < sqrt(2) */
@@ -203,58 +156,10 @@ case_03:
B0 = (((lubi + lvbj) + ssij) + ttij) + dbl_n * LN2B;
B = polI + B0;
- /* End stage I, case abs(x-1) >= 0.03 */
- if ((y = A + (B + E1)) == A + (B - E1))
- return y;
-
-
- /*--- Stage II, the case abs(x-1) > 0.03 */
-
- /* Improve the accuracy of r0 */
- EMULV (p0, r0, sa, sb, t1, t2, t3, t4, t5);
- t = r0 * ((1 - sa) - sb);
- EADD (r0, t, ra, rb);
-
- /* Compute w */
- MUL2 (q, 0, ra, rb, w, ww, t1, t2, t3, t4, t5, t6, t7, t8);
-
- EADD (A, B0, a0, aa0);
-
- /* Evaluate polynomial III */
- s1 = (c3.d + (c4.d + c5.d * w) * w) * w;
- EADD (c2.d, s1, s2, ss2);
- MUL2 (s2, ss2, w, ww, s3, ss3, t1, t2, t3, t4, t5, t6, t7, t8);
- MUL2 (s3, ss3, w, ww, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (s2, ss2, w, ww, s3, ss3, t1, t2);
- ADD2 (s3, ss3, a0, aa0, a1, aa1, t1, t2);
-
- /* End stage II, case abs(x-1) >= 0.03 */
- if ((y = a1 + (aa1 + E3)) == a1 + (aa1 - E3))
- return y;
-
-
- /* Final stages. Use multi-precision arithmetic. */
-stage_n:
-
- for (i = 0; i < M; i++)
- {
- p = pr[i];
- __dbl_mp (x, &mpx, p);
- __dbl_mp (y, &mpy, p);
- __mplog (&mpx, &mpy, p);
- __dbl_mp (e[i].d, &mperr, p);
- __add (&mpy, &mperr, &mpy1, p);
- __sub (&mpy, &mperr, &mpy2, p);
- __mp_dbl (&mpy1, &y1, p);
- __mp_dbl (&mpy2, &y2, p);
- if (y1 == y2)
- {
- LIBC_PROBE (slowlog, 3, &p, &x, &y1);
- return y1;
- }
- }
- LIBC_PROBE (slowlog_inexact, 3, &p, &x, &y1);
- return y1;
+ /* Here A contains the high part of the result, and B the low part.
+ Maximum abs error is 6.095e-21 and min log (x) is 0.0295 since x > 1.03.
+ Therefore max ULP error of A + B is ~0.502. */
+ return A + B;
}
#ifndef __ieee754_log
diff --git a/sysdeps/ieee754/dbl-64/e_log10.c b/sysdeps/ieee754/dbl-64/e_log10.c
index df59d9dce4..677cbc4df8 100644
--- a/sysdeps/ieee754/dbl-64/e_log10.c
+++ b/sysdeps/ieee754/dbl-64/e_log10.c
@@ -57,7 +57,7 @@ __ieee754_log10 (double x)
{
double y, z;
int32_t i, k, hx;
- u_int32_t lx;
+ uint32_t lx;
EXTRACT_WORDS (hx, lx, x);
@@ -65,7 +65,7 @@ __ieee754_log10 (double x)
if (hx < 0x00100000)
{ /* x < 2**-1022 */
if (__glibc_unlikely (((hx & 0x7fffffff) | lx) == 0))
- return -two54 / (x - x); /* log(+-0)=-inf */
+ return -two54 / fabs (x); /* log(+-0)=-inf */
if (__glibc_unlikely (hx < 0))
return (x - x) / (x - x); /* log(-#) = NaN */
k -= 54;
@@ -75,7 +75,7 @@ __ieee754_log10 (double x)
if (__glibc_unlikely (hx >= 0x7ff00000))
return x + x;
k += (hx >> 20) - 1023;
- i = ((u_int32_t) k & 0x80000000) >> 31;
+ i = ((uint32_t) k & 0x80000000) >> 31;
hx = (hx & 0x000fffff) | ((0x3ff - i) << 20);
y = (double) (k + i);
if (FIX_INT_FP_CONVERT_ZERO && y == 0.0)
diff --git a/sysdeps/ieee754/dbl-64/e_log2.c b/sysdeps/ieee754/dbl-64/e_log2.c
index bc6a34192a..e4a6aff9a3 100644
--- a/sysdeps/ieee754/dbl-64/e_log2.c
+++ b/sysdeps/ieee754/dbl-64/e_log2.c
@@ -75,7 +75,7 @@ __ieee754_log2 (double x)
{
double hfsq, f, s, z, R, w, t1, t2, dk;
int32_t k, hx, i, j;
- u_int32_t lx;
+ uint32_t lx;
EXTRACT_WORDS (hx, lx, x);
@@ -83,7 +83,7 @@ __ieee754_log2 (double x)
if (hx < 0x00100000)
{ /* x < 2**-1022 */
if (__glibc_unlikely (((hx & 0x7fffffff) | lx) == 0))
- return -two54 / (x - x); /* log(+-0)=-inf */
+ return -two54 / fabs (x); /* log(+-0)=-inf */
if (__glibc_unlikely (hx < 0))
return (x - x) / (x - x); /* log(-#) = NaN */
k -= 54;
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
index 663fa392c2..96d5b23ccc 100644
--- a/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/sysdeps/ieee754/dbl-64/e_pow.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -20,13 +20,9 @@
/* MODULE_NAME: upow.c */
/* */
/* FUNCTIONS: upow */
-/* power1 */
-/* my_log2 */
/* log1 */
/* checkint */
/* FILES NEEDED: dla.h endian.h mpa.h mydefs.h */
-/* halfulp.c mpexp.c mplog.c slowexp.c slowpow.c mpa.c */
-/* uexp.c upow.c */
/* root.tbl uexp.tbl upow.tbl */
/* An ultimate power routine. Given two IEEE double machine numbers y,x */
/* it computes the correctly rounded (to nearest) value of x^y. */
@@ -42,6 +38,7 @@
#include "MathLib.h"
#include "upow.tbl"
#include <math_private.h>
+#include <math-underflow.h>
#include <fenv.h>
#ifndef SECTION
@@ -50,11 +47,8 @@
static const double huge = 1.0e300, tiny = 1.0e-300;
-double __exp1 (double x, double xx, double error);
-static double log1 (double x, double *delta, double *error);
-static double my_log2 (double x, double *delta, double *error);
-double __slowpow (double x, double y, double z);
-static double power1 (double x, double y);
+double __exp1 (double x, double xx);
+static double log1 (double x, double *delta);
static int checkint (double x);
/* An ultimate power routine. Given two IEEE double machine numbers y, x it
@@ -63,7 +57,7 @@ double
SECTION
__ieee754_pow (double x, double y)
{
- double z, a, aa, error, t, a1, a2, y1, y2;
+ double z, a, aa, t, a1, a2, y1, y2;
mynumber u, v;
int k;
int4 qx, qy;
@@ -73,8 +67,9 @@ __ieee754_pow (double x, double y)
{ /* of y */
qx = u.i[HIGH_HALF] & 0x7fffffff;
/* Is x a NaN? */
- if (((qx == 0x7ff00000) && (u.i[LOW_HALF] != 0)) || (qx > 0x7ff00000))
- return x;
+ if ((((qx == 0x7ff00000) && (u.i[LOW_HALF] != 0)) || (qx > 0x7ff00000))
+ && (y != 0 || issignaling (x)))
+ return x + x;
if (y == 1.0)
return x;
if (y == 2.0)
@@ -99,7 +94,7 @@ __ieee754_pow (double x, double y)
not matter if |y| <= 2**-64. */
if (fabs (y) < 0x1p-64)
y = y < 0 ? -0x1p-64 : 0x1p-64;
- z = log1 (x, &aa, &error); /* x^y =e^(y log (X)) */
+ z = log1 (x, &aa); /* x^y =e^(y log (X)) */
t = y * CN;
y1 = t - (t - y);
y2 = y - y1;
@@ -110,9 +105,16 @@ __ieee754_pow (double x, double y)
aa = y2 * a1 + y * a2;
a1 = a + aa;
a2 = (a - a1) + aa;
- error = error * fabs (y);
- t = __exp1 (a1, a2, 1.9e16 * error); /* return -10 or 0 if wasn't computed exactly */
- retval = (t > 0) ? t : power1 (x, y);
+
+ /* Maximum relative error RElog of log1 is 1.0e-21 (69.7 bits).
+ Maximum relative error REexp of __exp1 is 8.8e-22 (69.9 bits).
+ We actually compute exp ((1 + RElog) * log (x) * y) * (1 + REexp).
+ Since RElog/REexp are tiny and log (x) * y is at most log (DBL_MAX),
+ this is equivalent to pow (x, y) * (1 + 710 * RElog + REexp).
+ So the relative error is 710 * 1.0e-21 + 8.8e-22 = 7.1e-19
+ (60.2 bits). The worst-case ULP error is 0.5064. */
+
+ retval = __exp1 (a1, a2);
}
if (isinf (retval))
@@ -128,7 +130,7 @@ __ieee754_pow (double x, double y)
{
if (((v.i[HIGH_HALF] & 0x7fffffff) == 0x7ff00000 && v.i[LOW_HALF] != 0)
|| (v.i[HIGH_HALF] & 0x7fffffff) > 0x7ff00000) /* NaN */
- return y;
+ return y + y;
if (fabs (y) > 1.0e20)
return (y > 0) ? 0 : 1.0 / 0.0;
k = checkint (y);
@@ -142,9 +144,9 @@ __ieee754_pow (double x, double y)
qy = v.i[HIGH_HALF] & 0x7fffffff; /* no sign */
if (qx >= 0x7ff00000 && (qx > 0x7ff00000 || u.i[LOW_HALF] != 0)) /* NaN */
- return x;
+ return x + y;
if (qy >= 0x7ff00000 && (qy > 0x7ff00000 || v.i[LOW_HALF] != 0)) /* NaN */
- return x == 1.0 ? 1.0 : y;
+ return x == 1.0 && !issignaling (y) ? 1.0 : y + y;
/* if x<0 */
if (u.i[HIGH_HALF] < 0)
@@ -217,33 +219,11 @@ __ieee754_pow (double x, double y)
strong_alias (__ieee754_pow, __pow_finite)
#endif
-/* Compute x^y using more accurate but more slow log routine. */
-static double
-SECTION
-power1 (double x, double y)
-{
- double z, a, aa, error, t, a1, a2, y1, y2;
- z = my_log2 (x, &aa, &error);
- t = y * CN;
- y1 = t - (t - y);
- y2 = y - y1;
- t = z * CN;
- a1 = t - (t - z);
- a2 = z - a1;
- a = y * z;
- aa = ((y1 * a1 - a) + y1 * a2 + y2 * a1) + y2 * a2 + aa * y;
- a1 = a + aa;
- a2 = (a - a1) + aa;
- error = error * fabs (y);
- t = __exp1 (a1, a2, 1.9e16 * error);
- return (t >= 0) ? t : __slowpow (x, y, z);
-}
-
/* Compute log(x) (x is left argument). The result is the returned double + the
- parameter DELTA. The result is bounded by ERROR. */
+ parameter DELTA. */
static double
SECTION
-log1 (double x, double *delta, double *error)
+log1 (double x, double *delta)
{
unsigned int i, j;
int m;
@@ -259,9 +239,7 @@ log1 (double x, double *delta, double *error)
u.x = x;
m = u.i[HIGH_HALF];
- *error = 0;
- *delta = 0;
- if (m < 0x00100000) /* 1<x<2^-1007 */
+ if (m < 0x00100000) /* Handle denormal x. */
{
x = x * t52.x;
add = -52.0;
@@ -283,7 +261,7 @@ log1 (double x, double *delta, double *error)
v.x = u.x + bigu.x;
uu = v.x - bigu.x;
i = (v.i[LOW_HALF] & 0x000003ff) << 2;
- if (two52.i[LOW_HALF] == 1023) /* nx = 0 */
+ if (two52.i[LOW_HALF] == 1023) /* Exponent of x is 0. */
{
if (i > 1192 && i < 1208) /* |x-1| < 1.5*2**-10 */
{
@@ -295,8 +273,8 @@ log1 (double x, double *delta, double *error)
* (r7 + t * r8)))))
- 0.5 * t2 * (t + t1));
res = e1 + e2;
- *error = 1.0e-21 * fabs (t);
*delta = (e1 - res) + e2;
+ /* Max relative error is 1.464844e-24, so accurate to 79.1 bits. */
return res;
} /* |x-1| < 1.5*2**-10 */
else
@@ -315,12 +293,12 @@ log1 (double x, double *delta, double *error)
t2 = ((((t - t1) + e) + (ui.x[i + 3] + vj.x[j + 2])) + e2 + e * e
* (p2 + e * (p3 + e * p4)));
res = t1 + t2;
- *error = 1.0e-24;
*delta = (t1 - res) + t2;
+ /* Max relative error is 1.0e-24, so accurate to 79.7 bits. */
return res;
}
- } /* nx = 0 */
- else /* nx != 0 */
+ }
+ else /* Exponent of x != 0. */
{
eps = u.x - uu;
nx = (two52.x - two52e.x) + add;
@@ -333,113 +311,13 @@ log1 (double x, double *delta, double *error)
t2 = ((((t - t1) + e) + nx * ln2b.x + ui.x[i + 3] + e2) + e * e
* (q2 + e * (q3 + e * (q4 + e * (q5 + e * q6)))));
res = t1 + t2;
- *error = 1.0e-21;
- *delta = (t1 - res) + t2;
- return res;
- } /* nx != 0 */
-}
-
-/* Slower but more accurate routine of log. The returned result is double +
- DELTA. The result is bounded by ERROR. */
-static double
-SECTION
-my_log2 (double x, double *delta, double *error)
-{
- unsigned int i, j;
- int m;
- double uu, vv, eps, nx, e, e1, e2, t, t1, t2, res, add = 0;
- double ou1, ou2, lu1, lu2, ov, lv1, lv2, a, a1, a2;
- double y, yy, z, zz, j1, j2, j7, j8;
-#ifndef DLA_FMS
- double j3, j4, j5, j6;
-#endif
- mynumber u, v;
-#ifdef BIG_ENDI
- mynumber /**/ two52 = {{0x43300000, 0x00000000}}; /* 2**52 */
-#else
-# ifdef LITTLE_ENDI
- mynumber /**/ two52 = {{0x00000000, 0x43300000}}; /* 2**52 */
-# endif
-#endif
-
- u.x = x;
- m = u.i[HIGH_HALF];
- *error = 0;
- *delta = 0;
- add = 0;
- if (m < 0x00100000)
- { /* x < 2^-1022 */
- x = x * t52.x;
- add = -52.0;
- u.x = x;
- m = u.i[HIGH_HALF];
- }
-
- if ((m & 0x000fffff) < 0x0006a09e)
- {
- u.i[HIGH_HALF] = (m & 0x000fffff) | 0x3ff00000;
- two52.i[LOW_HALF] = (m >> 20);
- }
- else
- {
- u.i[HIGH_HALF] = (m & 0x000fffff) | 0x3fe00000;
- two52.i[LOW_HALF] = (m >> 20) + 1;
- }
-
- v.x = u.x + bigu.x;
- uu = v.x - bigu.x;
- i = (v.i[LOW_HALF] & 0x000003ff) << 2;
- /*------------------------------------- |x-1| < 2**-11------------------------------- */
- if ((two52.i[LOW_HALF] == 1023) && (i == 1200))
- {
- t = x - 1.0;
- EMULV (t, s3, y, yy, j1, j2, j3, j4, j5);
- ADD2 (-0.5, 0, y, yy, z, zz, j1, j2);
- MUL2 (t, 0, z, zz, y, yy, j1, j2, j3, j4, j5, j6, j7, j8);
- MUL2 (t, 0, y, yy, z, zz, j1, j2, j3, j4, j5, j6, j7, j8);
-
- e1 = t + z;
- e2 = ((((t - e1) + z) + zz) + t * t * t
- * (ss3 + t * (s4 + t * (s5 + t * (s6 + t * (s7 + t * s8))))));
- res = e1 + e2;
- *error = 1.0e-25 * fabs (t);
- *delta = (e1 - res) + e2;
- return res;
- }
- /*----------------------------- |x-1| > 2**-11 -------------------------- */
- else
- { /*Computing log(x) according to log table */
- nx = (two52.x - two52e.x) + add;
- ou1 = ui.x[i];
- ou2 = ui.x[i + 1];
- lu1 = ui.x[i + 2];
- lu2 = ui.x[i + 3];
- v.x = u.x * (ou1 + ou2) + bigv.x;
- vv = v.x - bigv.x;
- j = v.i[LOW_HALF] & 0x0007ffff;
- j = j + j + j;
- eps = u.x - uu * vv;
- ov = vj.x[j];
- lv1 = vj.x[j + 1];
- lv2 = vj.x[j + 2];
- a = (ou1 + ou2) * (1.0 + ov);
- a1 = (a + 1.0e10) - 1.0e10;
- a2 = a * (1.0 - a1 * uu * vv);
- e1 = eps * a1;
- e2 = eps * a2;
- e = e1 + e2;
- e2 = (e1 - e) + e2;
- t = nx * ln2a.x + lu1 + lv1;
- t1 = t + e;
- t2 = ((((t - t1) + e) + (lu2 + lv2 + nx * ln2b.x + e2)) + e * e
- * (p2 + e * (p3 + e * p4)));
- res = t1 + t2;
- *error = 1.0e-27;
*delta = (t1 - res) + t2;
+ /* Max relative error is 1.0e-21, so accurate to 69.7 bits. */
return res;
}
}
+
/* This function receives a double x and checks if it is an integer. If not,
it returns 0, else it returns 1 if even or -1 if odd. */
static int
@@ -451,7 +329,8 @@ checkint (double x)
int4 i[2];
double x;
} u;
- int k, m, n;
+ int k;
+ unsigned int m, n;
u.x = x;
m = u.i[HIGH_HALF] & 0x7fffffff; /* no sign */
if (m >= 0x7ff00000)
@@ -466,15 +345,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/e_rem_pio2.c b/sysdeps/ieee754/dbl-64/e_rem_pio2.c
index 2f55ca294b..81a3d073d4 100644
--- a/sysdeps/ieee754/dbl-64/e_rem_pio2.c
+++ b/sysdeps/ieee754/dbl-64/e_rem_pio2.c
@@ -74,7 +74,7 @@ __ieee754_rem_pio2 (double x, double *y)
double z, w, t, r, fn;
double tx[3];
int32_t e0, i, j, nx, n, ix, hx;
- u_int32_t low;
+ uint32_t low;
GET_HIGH_WORD (hx, x); /* high word of x */
ix = hx & 0x7fffffff;
@@ -130,7 +130,7 @@ __ieee754_rem_pio2 (double x, double *y)
}
else
{
- u_int32_t high;
+ uint32_t high;
j = ix >> 20;
y[0] = r - w;
GET_HIGH_WORD (high, y[0]);
diff --git a/sysdeps/ieee754/dbl-64/e_remainder.c b/sysdeps/ieee754/dbl-64/e_remainder.c
index a445e74b5c..2e7f0ac1f4 100644
--- a/sysdeps/ieee754/dbl-64/e_remainder.c
+++ b/sysdeps/ieee754/dbl-64/e_remainder.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/e_sinh.c b/sysdeps/ieee754/dbl-64/e_sinh.c
index 8479bdd9b8..c4e34211ac 100644
--- a/sysdeps/ieee754/dbl-64/e_sinh.c
+++ b/sysdeps/ieee754/dbl-64/e_sinh.c
@@ -34,7 +34,9 @@ static char rcsid[] = "$NetBSD: e_sinh.c,v 1.7 1995/05/10 20:46:13 jtc Exp $";
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static const double one = 1.0, shuge = 1.0e307;
@@ -43,7 +45,7 @@ __ieee754_sinh (double x)
{
double t, w, h;
int32_t ix, jx;
- u_int32_t lx;
+ uint32_t lx;
/* High word of |x|. */
GET_HIGH_WORD (jx, x);
@@ -77,7 +79,7 @@ __ieee754_sinh (double x)
/* |x| in [log(maxdouble), overflowthresold] */
GET_LOW_WORD (lx, x);
- if (ix < 0x408633ce || ((ix == 0x408633ce) && (lx <= (u_int32_t) 0x8fb9f87d)))
+ if (ix < 0x408633ce || ((ix == 0x408633ce) && (lx <= (uint32_t) 0x8fb9f87d)))
{
w = __ieee754_exp (0.5 * fabs (x));
t = h * w;
diff --git a/sysdeps/ieee754/dbl-64/e_sqrt.c b/sysdeps/ieee754/dbl-64/e_sqrt.c
index 8304a2bb63..f70623e17b 100644
--- a/sysdeps/ieee754/dbl-64/e_sqrt.c
+++ b/sysdeps/ieee754/dbl-64/e_sqrt.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -37,6 +37,7 @@
#include <dla.h>
#include "MathLib.h"
#include "root.tbl"
+#include <math-barriers.h>
#include <math_private.h>
/*********************************************************************/
diff --git a/sysdeps/ieee754/dbl-64/eexp.tbl b/sysdeps/ieee754/dbl-64/eexp.tbl
new file mode 100644
index 0000000000..4ee6040638
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/eexp.tbl
@@ -0,0 +1,172 @@
+/* EXP function tables - for use in computing double precision exponential
+ Copyright (C) 2018 Free Software 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/>. */
+
+/* For i = 0, ..., 66,
+ TBL2[2*i] is a double precision number near (i+1)*2^-6, and
+ TBL2[2*i+1] = exp(TBL2[2*i]) to within a relative error less
+ than 2^-60.
+
+ For i = 67, ..., 133,
+ TBL2[2*i] is a double precision number near -(i+1)*2^-6, and
+ TBL2[2*i+1] = exp(TBL2[2*i]) to within a relative error less
+ than 2^-60. */
+
+static const double TBL2[268] = {
+ 0x1.ffffffffffc82p-7, 0x1.04080ab55de32p+0,
+ 0x1.fffffffffffdbp-6, 0x1.08205601127ecp+0,
+ 0x1.80000000000a0p-5, 0x1.0c49236829e91p+0,
+ 0x1.fffffffffff79p-5, 0x1.1082b577d34e9p+0,
+ 0x1.3fffffffffffcp-4, 0x1.14cd4fc989cd6p+0,
+ 0x1.8000000000060p-4, 0x1.192937074e0d4p+0,
+ 0x1.c000000000061p-4, 0x1.1d96b0eff0e80p+0,
+ 0x1.fffffffffffd6p-4, 0x1.2216045b6f5cap+0,
+ 0x1.1ffffffffff58p-3, 0x1.26a7793f6014cp+0,
+ 0x1.3ffffffffff75p-3, 0x1.2b4b58b372c65p+0,
+ 0x1.5ffffffffff00p-3, 0x1.3001ecf601ad1p+0,
+ 0x1.8000000000020p-3, 0x1.34cb8170b583ap+0,
+ 0x1.9ffffffffa629p-3, 0x1.39a862bd3b344p+0,
+ 0x1.c00000000000fp-3, 0x1.3e98deaa11dcep+0,
+ 0x1.e00000000007fp-3, 0x1.439d443f5f16dp+0,
+ 0x1.0000000000072p-2, 0x1.48b5e3c3e81abp+0,
+ 0x1.0fffffffffecap-2, 0x1.4de30ec211dfbp+0,
+ 0x1.1ffffffffff8fp-2, 0x1.5325180cfacd2p+0,
+ 0x1.300000000003bp-2, 0x1.587c53c5a7b04p+0,
+ 0x1.4000000000034p-2, 0x1.5de9176046007p+0,
+ 0x1.4ffffffffff89p-2, 0x1.636bb9a98322fp+0,
+ 0x1.5ffffffffffe7p-2, 0x1.690492cbf942ap+0,
+ 0x1.6ffffffffff78p-2, 0x1.6eb3fc55b1e45p+0,
+ 0x1.7ffffffffff65p-2, 0x1.747a513dbef32p+0,
+ 0x1.8ffffffffffd5p-2, 0x1.7a57ede9ea22ep+0,
+ 0x1.9ffffffffff6ep-2, 0x1.804d30347b50fp+0,
+ 0x1.affffffffffc3p-2, 0x1.865a7772164aep+0,
+ 0x1.c000000000053p-2, 0x1.8c802477b0030p+0,
+ 0x1.d00000000004dp-2, 0x1.92be99a09bf1ep+0,
+ 0x1.e000000000096p-2, 0x1.99163ad4b1e08p+0,
+ 0x1.efffffffffefap-2, 0x1.9f876d8e8c4fcp+0,
+ 0x1.fffffffffffd0p-2, 0x1.a61298e1e0688p+0,
+ 0x1.0800000000002p-1, 0x1.acb82581eee56p+0,
+ 0x1.100000000001fp-1, 0x1.b3787dc80f979p+0,
+ 0x1.17ffffffffff8p-1, 0x1.ba540dba56e4fp+0,
+ 0x1.1fffffffffffap-1, 0x1.c14b431256441p+0,
+ 0x1.27fffffffffc4p-1, 0x1.c85e8d43f7c9bp+0,
+ 0x1.2fffffffffffdp-1, 0x1.cf8e5d84758a6p+0,
+ 0x1.380000000001fp-1, 0x1.d6db26d16cd84p+0,
+ 0x1.3ffffffffffd8p-1, 0x1.de455df80e39bp+0,
+ 0x1.4800000000052p-1, 0x1.e5cd799c6a59cp+0,
+ 0x1.4ffffffffffc8p-1, 0x1.ed73f240dc10cp+0,
+ 0x1.5800000000013p-1, 0x1.f539424d90f71p+0,
+ 0x1.5ffffffffffbcp-1, 0x1.fd1de6182f885p+0,
+ 0x1.680000000002dp-1, 0x1.02912df5ce741p+1,
+ 0x1.7000000000040p-1, 0x1.06a39207f0a2ap+1,
+ 0x1.780000000004fp-1, 0x1.0ac660691652ap+1,
+ 0x1.7ffffffffff6fp-1, 0x1.0ef9db467dcabp+1,
+ 0x1.87fffffffffe5p-1, 0x1.133e45d82e943p+1,
+ 0x1.9000000000035p-1, 0x1.1793e4652cc6dp+1,
+ 0x1.97fffffffffb3p-1, 0x1.1bfafc47bda48p+1,
+ 0x1.a000000000000p-1, 0x1.2073d3f1bd518p+1,
+ 0x1.a80000000004ap-1, 0x1.24feb2f105ce2p+1,
+ 0x1.affffffffffedp-1, 0x1.299be1f3e7f11p+1,
+ 0x1.b7ffffffffffbp-1, 0x1.2e4baacdb6611p+1,
+ 0x1.c00000000001dp-1, 0x1.330e587b62b39p+1,
+ 0x1.c800000000079p-1, 0x1.37e437282d538p+1,
+ 0x1.cffffffffff51p-1, 0x1.3ccd943268248p+1,
+ 0x1.d7fffffffff74p-1, 0x1.41cabe304cadcp+1,
+ 0x1.e000000000011p-1, 0x1.46dc04f4e5343p+1,
+ 0x1.e80000000001ep-1, 0x1.4c01b9950a124p+1,
+ 0x1.effffffffff9ep-1, 0x1.513c2e6c73196p+1,
+ 0x1.f7fffffffffedp-1, 0x1.568bb722dd586p+1,
+ 0x1.0000000000034p+0, 0x1.5bf0a8b1457b0p+1,
+ 0x1.03fffffffffe2p+0, 0x1.616b5967376dfp+1,
+ 0x1.07fffffffff4bp+0, 0x1.66fc20f0337a9p+1,
+ 0x1.0bffffffffffdp+0, 0x1.6ca35859290f5p+1,
+ -0x1.fffffffffffe4p-7, 0x1.f80feabfeefa5p-1,
+ -0x1.ffffffffffb0bp-6, 0x1.f03f56a88b5fep-1,
+ -0x1.7ffffffffffa7p-5, 0x1.e88dc6afecfc5p-1,
+ -0x1.ffffffffffea8p-5, 0x1.e0fabfbc702b8p-1,
+ -0x1.3ffffffffffb3p-4, 0x1.d985c89d041acp-1,
+ -0x1.7ffffffffffe3p-4, 0x1.d22e6a0197c06p-1,
+ -0x1.bffffffffff9ap-4, 0x1.caf42e73a4c89p-1,
+ -0x1.fffffffffff98p-4, 0x1.c3d6a24ed822dp-1,
+ -0x1.1ffffffffffe9p-3, 0x1.bcd553b9d7b67p-1,
+ -0x1.3ffffffffffe0p-3, 0x1.b5efd29f24c2dp-1,
+ -0x1.5fffffffff553p-3, 0x1.af25b0a61a9f4p-1,
+ -0x1.7ffffffffff8bp-3, 0x1.a876812c08794p-1,
+ -0x1.9fffffffffe51p-3, 0x1.a1e1d93d68828p-1,
+ -0x1.bffffffffff6ep-3, 0x1.9b674f8f2f3f5p-1,
+ -0x1.dffffffffff7fp-3, 0x1.95067c7837a0cp-1,
+ -0x1.fffffffffff7ap-3, 0x1.8ebef9eac8225p-1,
+ -0x1.0fffffffffffep-2, 0x1.8890636e31f55p-1,
+ -0x1.1ffffffffff41p-2, 0x1.827a56188975ep-1,
+ -0x1.2ffffffffffbap-2, 0x1.7c7c708877656p-1,
+ -0x1.3fffffffffff8p-2, 0x1.769652df22f81p-1,
+ -0x1.4ffffffffff90p-2, 0x1.70c79eba33c2fp-1,
+ -0x1.5ffffffffffdbp-2, 0x1.6b0ff72deb8aap-1,
+ -0x1.6ffffffffff9ap-2, 0x1.656f00bf5798ep-1,
+ -0x1.7ffffffffff9fp-2, 0x1.5fe4615e98eb0p-1,
+ -0x1.8ffffffffffeep-2, 0x1.5a6fc061433cep-1,
+ -0x1.9fffffffffc4ap-2, 0x1.5510c67cd26cdp-1,
+ -0x1.affffffffff30p-2, 0x1.4fc71dc13566bp-1,
+ -0x1.bfffffffffff0p-2, 0x1.4a9271936fd0ep-1,
+ -0x1.cfffffffffff3p-2, 0x1.45726ea84fb8cp-1,
+ -0x1.dfffffffffff3p-2, 0x1.4066c2ff3912bp-1,
+ -0x1.effffffffff80p-2, 0x1.3b6f1ddd05ab9p-1,
+ -0x1.fffffffffffdfp-2, 0x1.368b2fc6f9614p-1,
+ -0x1.0800000000000p-1, 0x1.31baaa7dca843p-1,
+ -0x1.0ffffffffffa4p-1, 0x1.2cfd40f8bdce4p-1,
+ -0x1.17fffffffff0ap-1, 0x1.2852a760d5ce7p-1,
+ -0x1.2000000000000p-1, 0x1.23ba930c1568bp-1,
+ -0x1.27fffffffffbbp-1, 0x1.1f34ba78d568dp-1,
+ -0x1.2fffffffffe32p-1, 0x1.1ac0d5492c1dbp-1,
+ -0x1.37ffffffff042p-1, 0x1.165e9c3e67ef2p-1,
+ -0x1.3ffffffffff77p-1, 0x1.120dc93499431p-1,
+ -0x1.47fffffffff6bp-1, 0x1.0dce171e34ecep-1,
+ -0x1.4fffffffffff1p-1, 0x1.099f41ffbe588p-1,
+ -0x1.57ffffffffe02p-1, 0x1.058106eb8a7aep-1,
+ -0x1.5ffffffffffe5p-1, 0x1.017323fd9002ep-1,
+ -0x1.67fffffffffb0p-1, 0x1.faeab0ae9386cp-2,
+ -0x1.6ffffffffffb2p-1, 0x1.f30ec837503d7p-2,
+ -0x1.77fffffffff7fp-1, 0x1.eb5210d627133p-2,
+ -0x1.7ffffffffffe8p-1, 0x1.e3b40ebefcd95p-2,
+ -0x1.87fffffffffc8p-1, 0x1.dc3448110dae2p-2,
+ -0x1.8fffffffffb30p-1, 0x1.d4d244cf4ef06p-2,
+ -0x1.97fffffffffefp-1, 0x1.cd8d8ed8ee395p-2,
+ -0x1.9ffffffffffa7p-1, 0x1.c665b1e1f1e5cp-2,
+ -0x1.a7fffffffffdcp-1, 0x1.bf5a3b6bf18d6p-2,
+ -0x1.affffffffff95p-1, 0x1.b86ababeef93bp-2,
+ -0x1.b7fffffffffcbp-1, 0x1.b196c0e24d256p-2,
+ -0x1.bffffffffff32p-1, 0x1.aadde095dadf7p-2,
+ -0x1.c7fffffffff6ap-1, 0x1.a43fae4b047c9p-2,
+ -0x1.cffffffffffb6p-1, 0x1.9dbbc01e182a4p-2,
+ -0x1.d7fffffffffcap-1, 0x1.9751adcfa81ecp-2,
+ -0x1.dffffffffffcdp-1, 0x1.910110be0699ep-2,
+ -0x1.e7ffffffffffbp-1, 0x1.8ac983dedbc69p-2,
+ -0x1.effffffffff88p-1, 0x1.84aaa3b8d51a9p-2,
+ -0x1.f7fffffffffbbp-1, 0x1.7ea40e5d6d92ep-2,
+ -0x1.fffffffffffdbp-1, 0x1.78b56362cef53p-2,
+ -0x1.03fffffffff00p+0, 0x1.72de43ddcb1f2p-2,
+ -0x1.07ffffffffe6fp+0, 0x1.6d1e525bed085p-2,
+ -0x1.0bfffffffffd6p+0, 0x1.677532dda1c57p-2};
+
+static const double
+ half = 0.5,
+ one = 1.0,
+/* t2-t5 terms used for polynomial computation. */
+ t2 = 0x1.5555555555555p-3, /* 1.6666666666666665741e-1 */
+ t3 = 0x1.5555555555555p-5, /* 4.1666666666666664354e-2 */
+ t4 = 0x1.1111111111111p-7, /* 8.3333333333333332177e-3 */
+ t5 = 0x1.6c16c16c16c17p-10; /* 1.3888888888888889419e-3 */
diff --git a/sysdeps/ieee754/dbl-64/gamma_product.c b/sysdeps/ieee754/dbl-64/gamma_product.c
index 7ae144aeb3..3300b5139c 100644
--- a/sysdeps/ieee754/dbl-64/gamma_product.c
+++ b/sysdeps/ieee754/dbl-64/gamma_product.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/gamma_productf.c b/sysdeps/ieee754/dbl-64/gamma_productf.c
index 58b4e761fe..011c6ff06e 100644
--- a/sysdeps/ieee754/dbl-64/gamma_productf.c
+++ b/sysdeps/ieee754/dbl-64/gamma_productf.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <float.h>
diff --git a/sysdeps/ieee754/dbl-64/halfulp.c b/sysdeps/ieee754/dbl-64/halfulp.c
deleted file mode 100644
index 5e3e731754..0000000000
--- a/sysdeps/ieee754/dbl-64/halfulp.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/************************************************************************/
-/* */
-/* MODULE_NAME:halfulp.c */
-/* */
-/* FUNCTIONS:halfulp */
-/* FILES NEEDED: mydefs.h dla.h endian.h */
-/* uroot.c */
-/* */
-/*Routine halfulp(double x, double y) computes x^y where result does */
-/*not need rounding. If the result is closer to 0 than can be */
-/*represented it returns 0. */
-/* In the following cases the function does not compute anything */
-/*and returns a negative number: */
-/*1. if the result needs rounding, */
-/*2. if y is outside the interval [0, 2^20-1], */
-/*3. if x can be represented by x=2**n for some integer n. */
-/************************************************************************/
-
-#include "endian.h"
-#include "mydefs.h"
-#include <dla.h>
-#include <math_private.h>
-
-#ifndef SECTION
-# define SECTION
-#endif
-
-static const int4 tab54[32] = {
- 262143, 11585, 1782, 511, 210, 107, 63, 42,
- 30, 22, 17, 14, 12, 10, 9, 7,
- 7, 6, 5, 5, 5, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3
-};
-
-
-double
-SECTION
-__halfulp (double x, double y)
-{
- mynumber v;
- double z, u, uu;
-#ifndef DLA_FMS
- double j1, j2, j3, j4, j5;
-#endif
- int4 k, l, m, n;
- if (y <= 0) /*if power is negative or zero */
- {
- v.x = y;
- if (v.i[LOW_HALF] != 0)
- return -10.0;
- v.x = x;
- if (v.i[LOW_HALF] != 0)
- return -10.0;
- if ((v.i[HIGH_HALF] & 0x000fffff) != 0)
- return -10; /* if x =2 ^ n */
- k = ((v.i[HIGH_HALF] & 0x7fffffff) >> 20) - 1023; /* find this n */
- z = (double) k;
- return (z * y == -1075.0) ? 0 : -10.0;
- }
- /* if y > 0 */
- v.x = y;
- if (v.i[LOW_HALF] != 0)
- return -10.0;
-
- v.x = x;
- /* case where x = 2**n for some integer n */
- if (((v.i[HIGH_HALF] & 0x000fffff) | v.i[LOW_HALF]) == 0)
- {
- k = (v.i[HIGH_HALF] >> 20) - 1023;
- return (((double) k) * y == -1075.0) ? 0 : -10.0;
- }
-
- v.x = y;
- k = v.i[HIGH_HALF];
- m = k << 12;
- l = 0;
- while (m)
- {
- m = m << 1; l++;
- }
- n = (k & 0x000fffff) | 0x00100000;
- n = n >> (20 - l); /* n is the odd integer of y */
- k = ((k >> 20) - 1023) - l; /* y = n*2**k */
- if (k > 5)
- return -10.0;
- if (k > 0)
- for (; k > 0; k--)
- n *= 2;
- if (n > 34)
- return -10.0;
- k = -k;
- if (k > 5)
- return -10.0;
-
- /* now treat x */
- while (k > 0)
- {
- z = __ieee754_sqrt (x);
- EMULV (z, z, u, uu, j1, j2, j3, j4, j5);
- if (((u - x) + uu) != 0)
- break;
- x = z;
- k--;
- }
- if (k)
- return -10.0;
-
- /* it is impossible that n == 2, so the mantissa of x must be short */
-
- v.x = x;
- if (v.i[LOW_HALF])
- return -10.0;
- k = v.i[HIGH_HALF];
- m = k << 12;
- l = 0;
- while (m)
- {
- m = m << 1; l++;
- }
- m = (k & 0x000fffff) | 0x00100000;
- m = m >> (20 - l); /* m is the odd integer of x */
-
- /* now check whether the length of m**n is at most 54 bits */
-
- if (m > tab54[n - 3])
- return -10.0;
-
- /* yes, it is - now compute x**n by simple multiplications */
-
- u = x;
- for (k = 1; k < n; k++)
- u = u * x;
- return u;
-}
diff --git a/sysdeps/ieee754/dbl-64/k_rem_pio2.c b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
index e58c9e854c..d8403dc345 100644
--- a/sysdeps/ieee754/dbl-64/k_rem_pio2.c
+++ b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
@@ -131,7 +131,9 @@ static char rcsid[] = "$NetBSD: k_rem_pio2.c,v 1.7 1995/05/10 20:46:25 jtc Exp $
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libc-diag.h>
static const int init_jk[] = {2,3,4,6}; /* initial value for jk */
@@ -251,8 +253,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] */
{
@@ -319,7 +330,16 @@ recompute:
for (i = jz; i >= 0; i--)
fv = math_narrow_eval (fv + fq[i]);
y[0] = (ih == 0) ? fv : -fv;
+ /* GCC mainline (to be GCC 9), as of 2018-05-22 on i686, warns
+ that fq[0] may be used uninitialized. This is not possible
+ because jz is always nonnegative when the above loop
+ initializing fq is executed, because the result is never zero
+ to full precision (this function is not called for zero
+ arguments). */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized");
fv = math_narrow_eval (fq[0] - fv);
+ DIAG_POP_NEEDS_COMMENT;
for (i = 1; i <= jz; i++)
fv = math_narrow_eval (fv + fq[i]);
y[1] = (ih == 0) ? fv : -fv;
diff --git a/sysdeps/ieee754/dbl-64/lgamma_neg.c b/sysdeps/ieee754/dbl-64/lgamma_neg.c
index fbf992203c..5bb2f10c71 100644
--- a/sysdeps/ieee754/dbl-64/lgamma_neg.c
+++ b/sysdeps/ieee754/dbl-64/lgamma_neg.c
@@ -1,5 +1,5 @@
/* lgamma expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const double lgamma_zeros[][2] =
diff --git a/sysdeps/ieee754/dbl-64/lgamma_product.c b/sysdeps/ieee754/dbl-64/lgamma_product.c
index d956575bc7..b37ecee73f 100644
--- a/sysdeps/ieee754/dbl-64/lgamma_product.c
+++ b/sysdeps/ieee754/dbl-64/lgamma_product.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/mpa-arch.h b/sysdeps/ieee754/dbl-64/mpa-arch.h
index ea33a14219..d1a2bf8ac4 100644
--- a/sysdeps/ieee754/dbl-64/mpa-arch.h
+++ b/sysdeps/ieee754/dbl-64/mpa-arch.h
@@ -1,5 +1,5 @@
/* Overridable constants and operations.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpa.c b/sysdeps/ieee754/dbl-64/mpa.c
index 4b21d1d2e6..f59ec6a9d8 100644
--- a/sysdeps/ieee754/dbl-64/mpa.c
+++ b/sysdeps/ieee754/dbl-64/mpa.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpa.h b/sysdeps/ieee754/dbl-64/mpa.h
index b8ca297eb7..1e188de4d1 100644
--- a/sysdeps/ieee754/dbl-64/mpa.h
+++ b/sysdeps/ieee754/dbl-64/mpa.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -119,36 +119,5 @@ void __dvd (const mp_no *, const mp_no *, mp_no *, int);
extern void __mpatan (mp_no *, mp_no *, int);
extern void __mpatan2 (mp_no *, mp_no *, mp_no *, int);
extern void __mpsqrt (mp_no *, mp_no *, int);
-extern void __mpexp (mp_no *, mp_no *, int);
extern void __c32 (mp_no *, mp_no *, mp_no *, int);
extern int __mpranred (double, mp_no *, int);
-
-/* Given a power POW, build a multiprecision number 2^POW. */
-static inline void
-__pow_mp (int pow, mp_no *y, int p)
-{
- int i, rem;
-
- /* The exponent is E such that E is a factor of 2^24. The remainder (of the
- form 2^x) goes entirely into the first digit of the mantissa as it is
- always less than 2^24. */
- EY = pow / 24;
- rem = pow - EY * 24;
- EY++;
-
- /* If the remainder is negative, it means that POW was negative since
- |EY * 24| <= |pow|. Adjust so that REM is positive and still less than
- 24 because of which, the mantissa digit is less than 2^24. */
- if (rem < 0)
- {
- EY--;
- rem += 24;
- }
- /* The sign of any 2^x is always positive. */
- Y[0] = 1;
- Y[1] = 1 << rem;
-
- /* Everything else is 0. */
- for (i = 2; i <= p; i++)
- Y[i] = 0;
-}
diff --git a/sysdeps/ieee754/dbl-64/mpatan.c b/sysdeps/ieee754/dbl-64/mpatan.c
index dbd49b2bee..656dc763aa 100644
--- a/sysdeps/ieee754/dbl-64/mpatan.c
+++ b/sysdeps/ieee754/dbl-64/mpatan.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpatan.h b/sysdeps/ieee754/dbl-64/mpatan.h
index 36c02602ac..2e34ce8a4d 100644
--- a/sysdeps/ieee754/dbl-64/mpatan.h
+++ b/sysdeps/ieee754/dbl-64/mpatan.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpatan2.c b/sysdeps/ieee754/dbl-64/mpatan2.c
index e7de6bc158..6eda7d39eb 100644
--- a/sysdeps/ieee754/dbl-64/mpatan2.c
+++ b/sysdeps/ieee754/dbl-64/mpatan2.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpexp.c b/sysdeps/ieee754/dbl-64/mpexp.c
deleted file mode 100644
index f17baf2139..0000000000
--- a/sysdeps/ieee754/dbl-64/mpexp.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/*************************************************************************/
-/* MODULE_NAME:mpexp.c */
-/* */
-/* FUNCTIONS: mpexp */
-/* */
-/* FILES NEEDED: mpa.h endian.h mpexp.h */
-/* mpa.c */
-/* */
-/* Multi-Precision exponential function subroutine */
-/* ( for p >= 4, 2**(-55) <= abs(x) <= 1024 ). */
-/*************************************************************************/
-
-#include "endian.h"
-#include "mpa.h"
-#include <assert.h>
-
-#ifndef SECTION
-# define SECTION
-#endif
-
-/* Multi-Precision exponential function subroutine (for p >= 4,
- 2**(-55) <= abs(x) <= 1024). */
-void
-SECTION
-__mpexp (mp_no *x, mp_no *y, int p)
-{
- int i, j, k, m, m1, m2, n;
- mantissa_t b;
- static const int np[33] =
- {
- 0, 0, 0, 0, 3, 3, 4, 4, 5, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8
- };
-
- static const int m1p[33] =
- {
- 0, 0, 0, 0,
- 17, 23, 23, 28,
- 27, 38, 42, 39,
- 43, 47, 43, 47,
- 50, 54, 57, 60,
- 64, 67, 71, 74,
- 68, 71, 74, 77,
- 70, 73, 76, 78,
- 81
- };
- static const int m1np[7][18] =
- {
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 36, 48, 60, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 24, 32, 40, 48, 56, 64, 72, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 17, 23, 29, 35, 41, 47, 53, 59, 65, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 23, 28, 33, 38, 42, 47, 52, 57, 62, 66, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 39, 43, 47, 51, 55, 59, 63},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 47, 50, 54}
- };
- mp_no mps, mpk, mpt1, mpt2;
-
- /* Choose m,n and compute a=2**(-m). */
- n = np[p];
- m1 = m1p[p];
- b = X[1];
- m2 = 24 * EX;
- for (; b < HALFRAD; m2--)
- b *= 2;
- if (b == HALFRAD)
- {
- for (i = 2; i <= p; i++)
- {
- if (X[i] != 0)
- break;
- }
- if (i == p + 1)
- m2--;
- }
-
- m = m1 + m2;
- if (__glibc_unlikely (m <= 0))
- {
- /* The m1np array which is used to determine if we can reduce the
- polynomial expansion iterations, has only 18 elements. Besides,
- numbers smaller than those required by p >= 18 should not come here
- at all since the fast phase of exp returns 1.0 for anything less
- than 2^-55. */
- assert (p < 18);
- m = 0;
- for (i = n - 1; i > 0; i--, n--)
- if (m1np[i][p] + m2 > 0)
- break;
- }
-
- /* Compute s=x*2**(-m). Put result in mps. This is the range-reduced input
- that we will use to compute e^s. For the final result, simply raise it
- to 2^m. */
- __pow_mp (-m, &mpt1, p);
- __mul (x, &mpt1, &mps, p);
-
- /* Compute the Taylor series for e^s:
-
- 1 + x/1! + x^2/2! + x^3/3! ...
-
- for N iterations. We compute this as:
-
- e^x = 1 + (x * n!/1! + x^2 * n!/2! + x^3 * n!/3!) / n!
- = 1 + (x * (n!/1! + x * (n!/2! + x * (n!/3! + x ...)))) / n!
-
- k! is computed on the fly as KF and at the end of the polynomial loop, KF
- is n!, which can be used directly. */
- __cpy (&mps, &mpt2, p);
-
- double kf = 1.0;
-
- /* Evaluate the rest. The result will be in mpt2. */
- for (k = n - 1; k > 0; k--)
- {
- /* n! / k! = n * (n - 1) ... * (n - k + 1) */
- kf *= k + 1;
-
- __dbl_mp (kf, &mpk, p);
- __add (&mpt2, &mpk, &mpt1, p);
- __mul (&mps, &mpt1, &mpt2, p);
- }
- __dbl_mp (kf, &mpk, p);
- __dvd (&mpt2, &mpk, &mpt1, p);
- __add (&__mpone, &mpt1, &mpt2, p);
-
- /* Raise polynomial value to the power of 2**m. Put result in y. */
- for (k = 0, j = 0; k < m;)
- {
- __sqr (&mpt2, &mpt1, p);
- k++;
- if (k == m)
- {
- j = 1;
- break;
- }
- __sqr (&mpt1, &mpt2, p);
- k++;
- }
- if (j)
- __cpy (&mpt1, y, p);
- else
- __cpy (&mpt2, y, p);
- return;
-}
diff --git a/sysdeps/ieee754/dbl-64/mplog.c b/sysdeps/ieee754/dbl-64/mplog.c
deleted file mode 100644
index b297153b10..0000000000
--- a/sysdeps/ieee754/dbl-64/mplog.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/************************************************************************/
-/* */
-/* MODULE_NAME:mplog.c */
-/* */
-/* FUNCTIONS: mplog */
-/* */
-/* FILES NEEDED: endian.h mpa.h mplog.h */
-/* mpexp.c */
-/* */
-/* Multi-Precision logarithm function subroutine (for precision p >= 4, */
-/* 2**(-1024) < x < 2**1024) and x is outside of the interval */
-/* [1-2**(-54),1+2**(-54)]. Upon entry, x should be set to the */
-/* multi-precision value of the input and y should be set into a multi- */
-/* precision value of an approximation of log(x) with relative error */
-/* bound of at most 2**(-52). The routine improves the accuracy of y. */
-/* */
-/************************************************************************/
-#include "endian.h"
-#include "mpa.h"
-
-void
-__mplog (mp_no *x, mp_no *y, int p)
-{
- int i, m;
- static const int mp[33] =
- {
- 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
- };
- mp_no mpt1, mpt2;
-
- /* Choose m. */
- m = mp[p];
-
- /* Perform m newton iterations to solve for y: exp(y) - x = 0. The
- iterations formula is: y(n + 1) = y(n) + (x * exp(-y(n)) - 1). */
- __cpy (y, &mpt1, p);
- for (i = 0; i < m; i++)
- {
- mpt1.d[0] = -mpt1.d[0];
- __mpexp (&mpt1, &mpt2, p);
- __mul (x, &mpt2, &mpt1, p);
- __sub (&mpt1, &__mpone, &mpt2, p);
- __add (y, &mpt2, &mpt1, p);
- __cpy (&mpt1, y, p);
- }
-}
diff --git a/sysdeps/ieee754/dbl-64/mpn2dbl.c b/sysdeps/ieee754/dbl-64/mpn2dbl.c
index 1050ec3b0e..693448fc8d 100644
--- a/sysdeps/ieee754/dbl-64/mpn2dbl.c
+++ b/sysdeps/ieee754/dbl-64/mpn2dbl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/dbl-64/mpsqrt.c b/sysdeps/ieee754/dbl-64/mpsqrt.c
index a77d3938a9..3ce4b9cda7 100644
--- a/sysdeps/ieee754/dbl-64/mpsqrt.c
+++ b/sysdeps/ieee754/dbl-64/mpsqrt.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpsqrt.h b/sysdeps/ieee754/dbl-64/mpsqrt.h
index 0f1cf58fb2..05a907bedf 100644
--- a/sysdeps/ieee754/dbl-64/mpsqrt.h
+++ b/sysdeps/ieee754/dbl-64/mpsqrt.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mptan.c b/sysdeps/ieee754/dbl-64/mptan.c
index 280c4909d6..26dbd5f601 100644
--- a/sysdeps/ieee754/dbl-64/mptan.c
+++ b/sysdeps/ieee754/dbl-64/mptan.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mydefs.h b/sysdeps/ieee754/dbl-64/mydefs.h
index b1d67d4445..3e15d5bdd6 100644
--- a/sysdeps/ieee754/dbl-64/mydefs.h
+++ b/sysdeps/ieee754/dbl-64/mydefs.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/powtwo.tbl b/sysdeps/ieee754/dbl-64/powtwo.tbl
index 2d828f6022..518fd6cd4b 100644
--- a/sysdeps/ieee754/dbl-64/powtwo.tbl
+++ b/sysdeps/ieee754/dbl-64/powtwo.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/root.tbl b/sysdeps/ieee754/dbl-64/root.tbl
index 61c859248c..a458e25ee2 100644
--- a/sysdeps/ieee754/dbl-64/root.tbl
+++ b/sysdeps/ieee754/dbl-64/root.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/s_asinh.c b/sysdeps/ieee754/dbl-64/s_asinh.c
index 9193301b5e..192ff8594d 100644
--- a/sysdeps/ieee754/dbl-64/s_asinh.c
+++ b/sysdeps/ieee754/dbl-64/s_asinh.c
@@ -24,6 +24,8 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
static const double
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
@@ -54,19 +56,15 @@ __asinh (double x)
double xa = fabs (x);
if (ix > 0x40000000) /* 2**28 > |x| > 2.0 */
{
- w = __ieee754_log (2.0 * xa + one / (__ieee754_sqrt (xa * xa + one) +
+ w = __ieee754_log (2.0 * xa + one / (sqrt (xa * xa + one) +
xa));
}
else /* 2.0 > |x| > 2**-28 */
{
double t = xa * xa;
- w = __log1p (xa + t / (one + __ieee754_sqrt (one + t)));
+ w = __log1p (xa + t / (one + sqrt (one + t)));
}
}
return __copysign (w, x);
}
-weak_alias (__asinh, asinh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__asinh, __asinhl)
-weak_alias (__asinh, asinhl)
-#endif
+libm_alias_double (__asinh, asinh)
diff --git a/sysdeps/ieee754/dbl-64/s_atan.c b/sysdeps/ieee754/dbl-64/s_atan.c
index 780c3ff17a..38db092d04 100644
--- a/sysdeps/ieee754/dbl-64/s_atan.c
+++ b/sysdeps/ieee754/dbl-64/s_atan.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -43,8 +43,10 @@
#include "atnat.h"
#include <fenv.h>
#include <float.h>
+#include <libm-alias-double.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <stap-probe.h>
void __mpatan (mp_no *, mp_no *, int); /* see definition in mpatan.c */
@@ -61,7 +63,7 @@ __signArctan (double x, double y)
/* An ultimate atan() routine. Given an IEEE double machine number x, */
/* routine computes the correctly rounded (to nearest) value of atan(x). */
double
-atan (double x)
+__atan (double x)
{
double cor, s1, ss1, s2, ss2, t1, t2, t3, t7, t8, t9, t10, u, u2, u3,
v, vv, w, ww, y, yy, z, zz;
@@ -323,6 +325,6 @@ atanMp (double x, const int pr[])
return y1; /*if impossible to do exact computing */
}
-#ifdef NO_LONG_DOUBLE
-weak_alias (atan, atanl)
+#ifndef __atan
+libm_alias_double (__atan, atan)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_cbrt.c b/sysdeps/ieee754/dbl-64/s_cbrt.c
index 647f30bc71..6cd55dc0d6 100644
--- a/sysdeps/ieee754/dbl-64/s_cbrt.c
+++ b/sysdeps/ieee754/dbl-64/s_cbrt.c
@@ -1,5 +1,5 @@
/* Compute cubic root of double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dirk Alboth <dirka@uni-paderborn.de> and
Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#define CBRT2 1.2599210498948731648 /* 2^(1/3) */
@@ -69,8 +70,4 @@ __cbrt (double x)
return __ldexp (x > 0.0 ? ym : -ym, xe / 3);
}
-weak_alias (__cbrt, cbrt)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cbrt, __cbrtl)
-weak_alias (__cbrt, cbrtl)
-#endif
+libm_alias_double (__cbrt, cbrt)
diff --git a/sysdeps/ieee754/dbl-64/s_ceil.c b/sysdeps/ieee754/dbl-64/s_ceil.c
index b2154b407d..5a7434c737 100644
--- a/sysdeps/ieee754/dbl-64/s_ceil.c
+++ b/sysdeps/ieee754/dbl-64/s_ceil.c
@@ -15,27 +15,23 @@
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to ceil(x).
*/
#include <math.h>
#include <math_private.h>
-
-static const double huge = 1.0e300;
+#include <libm-alias-double.h>
double
__ceil (double x)
{
int32_t i0, i1, j0;
- u_int32_t i, j;
+ uint32_t i, j;
EXTRACT_WORDS (i0, i1, x);
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
if (j0 < 20)
{
- if (j0 < 0) /* raise inexact if x != 0 */
+ if (j0 < 0)
{
- math_force_eval (huge + x);
/* return 0*sign(x) if |x|<1 */
if (i0 < 0)
{
@@ -51,7 +47,6 @@ __ceil (double x)
i = (0x000fffff) >> j0;
if (((i0 & i) | i1) == 0)
return x; /* x is integral */
- math_force_eval (huge + x); /* raise inexact flag */
if (i0 > 0)
i0 += (0x00100000) >> j0;
i0 &= (~i); i1 = 0;
@@ -66,10 +61,9 @@ __ceil (double x)
}
else
{
- i = ((u_int32_t) (0xffffffff)) >> (j0 - 20);
+ i = ((uint32_t) (0xffffffff)) >> (j0 - 20);
if ((i1 & i) == 0)
return x; /* x is integral */
- math_force_eval (huge + x); /* raise inexact flag */
if (i0 > 0)
{
if (j0 == 20)
@@ -88,9 +82,5 @@ __ceil (double x)
return x;
}
#ifndef __ceil
-weak_alias (__ceil, ceil)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__ceil, __ceill)
-weak_alias (__ceil, ceill)
-# endif
+libm_alias_double (__ceil, ceil)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_copysign.c b/sysdeps/ieee754/dbl-64/s_copysign.c
index 9caf24e8f2..ab81d732ab 100644
--- a/sysdeps/ieee754/dbl-64/s_copysign.c
+++ b/sysdeps/ieee754/dbl-64/s_copysign.c
@@ -22,18 +22,15 @@ static char rcsid[] = "$NetBSD: s_copysign.c,v 1.8 1995/05/10 20:46:57 jtc Exp $
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
double
__copysign (double x, double y)
{
- u_int32_t hx, hy;
+ uint32_t hx, hy;
GET_HIGH_WORD (hx, x);
GET_HIGH_WORD (hy, y);
SET_HIGH_WORD (x, (hx & 0x7fffffff) | (hy & 0x80000000));
return x;
}
-weak_alias (__copysign, copysign)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__copysign, __copysignl)
-weak_alias (__copysign, copysignl)
-#endif
+libm_alias_double (__copysign, copysign)
diff --git a/sysdeps/ieee754/dbl-64/s_erf.c b/sysdeps/ieee754/dbl-64/s_erf.c
index b4975a8af8..5f820604f8 100644
--- a/sysdeps/ieee754/dbl-64/s_erf.c
+++ b/sysdeps/ieee754/dbl-64/s_erf.c
@@ -115,7 +115,10 @@ static char rcsid[] = "$NetBSD: s_erf.c,v 1.8 1995/05/10 20:47:05 jtc Exp $";
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
#include <fix-int-fp-convert-zero.h>
static const double
@@ -201,7 +204,7 @@ __erf (double x)
ix = hx & 0x7fffffff;
if (ix >= 0x7ff00000) /* erf(nan)=nan */
{
- i = ((u_int32_t) hx >> 31) << 1;
+ i = ((uint32_t) hx >> 31) << 1;
return (double) (1 - i) + one / x; /* erf(+-inf)=+-1 */
}
@@ -294,11 +297,7 @@ __erf (double x)
else
return r / x - one;
}
-weak_alias (__erf, erf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__erf, __erfl)
-weak_alias (__erf, erfl)
-#endif
+libm_alias_double (__erf, erf)
double
__erfc (double x)
@@ -309,7 +308,7 @@ __erfc (double x)
ix = hx & 0x7fffffff;
if (ix >= 0x7ff00000) /* erfc(nan)=nan */
{ /* erfc(+-inf)=0,2 */
- double ret = (double) (((u_int32_t) hx >> 31) << 1) + one / x;
+ double ret = (double) (((uint32_t) hx >> 31) << 1) + one / x;
if (FIX_INT_FP_CONVERT_ZERO && ret == 0.0)
return 0.0;
return ret;
@@ -421,8 +420,4 @@ __erfc (double x)
return two - tiny;
}
}
-weak_alias (__erfc, erfc)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__erfc, __erfcl)
-weak_alias (__erfc, erfcl)
-#endif
+libm_alias_double (__erfc, erfc)
diff --git a/sysdeps/ieee754/dbl-64/s_expm1.c b/sysdeps/ieee754/dbl-64/s_expm1.c
index 54d771007a..8f1c95bd04 100644
--- a/sysdeps/ieee754/dbl-64/s_expm1.c
+++ b/sysdeps/ieee754/dbl-64/s_expm1.c
@@ -111,7 +111,10 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
#define one Q[0]
static const double
huge = 1.0e+300,
@@ -132,7 +135,7 @@ __expm1 (double x)
{
double y, hi, lo, c, t, e, hxs, hfx, r1, h2, h4, R1, R2, R3;
int32_t k, xsb;
- u_int32_t hx;
+ uint32_t hx;
GET_HIGH_WORD (hx, x);
xsb = hx & 0x80000000; /* sign bit of x */
@@ -149,7 +152,7 @@ __expm1 (double x)
{
if (hx >= 0x7ff00000)
{
- u_int32_t low;
+ uint32_t low;
GET_LOW_WORD (low, x);
if (((hx & 0xfffff) | low) != 0)
return x + x; /* NaN */
@@ -228,7 +231,7 @@ __expm1 (double x)
}
if (k <= -2 || k > 56) /* suffice to return exp(x)-1 */
{
- u_int32_t high;
+ uint32_t high;
y = one - (e - x);
GET_HIGH_WORD (high, y);
SET_HIGH_WORD (y, high + (k << 20)); /* add k to y's exponent */
@@ -237,7 +240,7 @@ __expm1 (double x)
t = one;
if (k < 20)
{
- u_int32_t high;
+ uint32_t high;
SET_HIGH_WORD (t, 0x3ff00000 - (0x200000 >> k)); /* t=1-2^-k */
y = t - (e - x);
GET_HIGH_WORD (high, y);
@@ -245,7 +248,7 @@ __expm1 (double x)
}
else
{
- u_int32_t high;
+ uint32_t high;
SET_HIGH_WORD (t, ((0x3ff - k) << 20)); /* 2^-k */
y = x - (e + t);
y += one;
@@ -255,8 +258,4 @@ __expm1 (double x)
}
return y;
}
-weak_alias (__expm1, expm1)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__expm1, __expm1l)
-weak_alias (__expm1, expm1l)
-#endif
+libm_alias_double (__expm1, expm1)
diff --git a/sysdeps/ieee754/dbl-64/s_f32xaddf64.c b/sysdeps/ieee754/dbl-64/s_f32xaddf64.c
new file mode 100644
index 0000000000..6e20a9e939
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_f32xaddf64.c
@@ -0,0 +1,30 @@
+/* Add _Float64 values, converting the result to _Float32x.
+ Copyright (C) 2018 Free Software 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 daddl __hide_daddl
+#include <math.h>
+#undef daddl
+
+#include <math-narrow.h>
+
+_Float32x
+__f32xaddf64 (_Float64 x, _Float64 y)
+{
+ NARROW_ADD_TRIVIAL (x, y, _Float32x);
+}
+libm_alias_float32x_float64 (add)
diff --git a/sysdeps/ieee754/dbl-64/s_f32xdivf64.c b/sysdeps/ieee754/dbl-64/s_f32xdivf64.c
new file mode 100644
index 0000000000..24dc25dc0c
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_f32xdivf64.c
@@ -0,0 +1,30 @@
+/* Divide _Float64 values, converting the result to _Float32x.
+ Copyright (C) 2018 Free Software 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 ddivl __hide_ddivl
+#include <math.h>
+#undef ddivl
+
+#include <math-narrow.h>
+
+_Float32x
+__f32xdivf64 (_Float64 x, _Float64 y)
+{
+ NARROW_DIV_TRIVIAL (x, y, _Float32x);
+}
+libm_alias_float32x_float64 (div)
diff --git a/sysdeps/ieee754/dbl-64/s_f32xmulf64.c b/sysdeps/ieee754/dbl-64/s_f32xmulf64.c
new file mode 100644
index 0000000000..f899c84567
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_f32xmulf64.c
@@ -0,0 +1,30 @@
+/* Multiply _Float64 values, converting the result to _Float32x.
+ Copyright (C) 2018 Free Software 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 dmull __hide_dmull
+#include <math.h>
+#undef dmull
+
+#include <math-narrow.h>
+
+_Float32x
+__f32xmulf64 (_Float64 x, _Float64 y)
+{
+ NARROW_MUL_TRIVIAL (x, y, _Float32x);
+}
+libm_alias_float32x_float64 (mul)
diff --git a/sysdeps/ieee754/dbl-64/s_f32xsubf64.c b/sysdeps/ieee754/dbl-64/s_f32xsubf64.c
new file mode 100644
index 0000000000..568f43a880
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_f32xsubf64.c
@@ -0,0 +1,30 @@
+/* Subtract _Float64 values, converting the result to _Float32x.
+ Copyright (C) 2018 Free Software 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 dsubl __hide_dsubl
+#include <math.h>
+#undef dsubl
+
+#include <math-narrow.h>
+
+_Float32x
+__f32xsubf64 (_Float64 x, _Float64 y)
+{
+ NARROW_SUB_TRIVIAL (x, y, _Float32x);
+}
+libm_alias_float32x_float64 (sub)
diff --git a/sysdeps/ieee754/dbl-64/s_fabs.c b/sysdeps/ieee754/dbl-64/s_fabs.c
index 73c09a269e..8232183324 100644
--- a/sysdeps/ieee754/dbl-64/s_fabs.c
+++ b/sysdeps/ieee754/dbl-64/s_fabs.c
@@ -19,14 +19,11 @@ static char rcsid[] = "$NetBSD: s_fabs.c,v 1.7 1995/05/10 20:47:13 jtc Exp $";
*/
#include <math.h>
+#include <libm-alias-double.h>
double
__fabs (double x)
{
return __builtin_fabs (x);
}
-weak_alias (__fabs, fabs)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fabs, __fabsl)
-weak_alias (__fabs, fabsl)
-#endif
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/ieee754/dbl-64/s_fadd.c b/sysdeps/ieee754/dbl-64/s_fadd.c
new file mode 100644
index 0000000000..5ecb435497
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fadd.c
@@ -0,0 +1,34 @@
+/* Add double values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32addf64 __hide_f32addf64
+#define f32addf32x __hide_f32addf32x
+#define faddl __hide_faddl
+#include <math.h>
+#undef f32addf64
+#undef f32addf32x
+#undef faddl
+
+#include <math-narrow.h>
+
+float
+__fadd (double x, double y)
+{
+ NARROW_ADD_ROUND_TO_ODD (x, y, float, union ieee754_double, , mantissa1);
+}
+libm_alias_float_double (add)
diff --git a/sysdeps/ieee754/dbl-64/s_fdiv.c b/sysdeps/ieee754/dbl-64/s_fdiv.c
new file mode 100644
index 0000000000..cdd2649df0
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fdiv.c
@@ -0,0 +1,34 @@
+/* Divide double values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32divf64 __hide_f32divf64
+#define f32divf32x __hide_f32divf32x
+#define fdivl __hide_fdivl
+#include <math.h>
+#undef f32divf64
+#undef f32divf32x
+#undef fdivl
+
+#include <math-narrow.h>
+
+float
+__fdiv (double x, double y)
+{
+ NARROW_DIV_ROUND_TO_ODD (x, y, float, union ieee754_double, , mantissa1);
+}
+libm_alias_float_double (div)
diff --git a/sysdeps/ieee754/dbl-64/s_finite.c b/sysdeps/ieee754/dbl-64/s_finite.c
index 69141db75d..da1519b1d0 100644
--- a/sysdeps/ieee754/dbl-64/s_finite.c
+++ b/sysdeps/ieee754/dbl-64/s_finite.c
@@ -21,6 +21,7 @@ static char rcsid[] = "$NetBSD: s_finite.c,v 1.8 1995/05/10 20:47:17 jtc Exp $";
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
#undef __finite
@@ -33,12 +34,12 @@ int FINITE(double x)
{
int32_t hx;
GET_HIGH_WORD (hx, x);
- return (int) ((u_int32_t) ((hx & 0x7ff00000) - 0x7ff00000) >> 31);
+ return (int) ((uint32_t) ((hx & 0x7ff00000) - 0x7ff00000) >> 31);
}
hidden_def (__finite)
weak_alias (__finite, finite)
#ifdef NO_LONG_DOUBLE
-# ifdef LDBL_CLASSIFY_COMPAT
+# if LDBL_CLASSIFY_COMPAT
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
# endif
diff --git a/sysdeps/ieee754/dbl-64/s_floor.c b/sysdeps/ieee754/dbl-64/s_floor.c
index bd6afa72e8..f27c6f3ad2 100644
--- a/sysdeps/ieee754/dbl-64/s_floor.c
+++ b/sysdeps/ieee754/dbl-64/s_floor.c
@@ -15,27 +15,24 @@
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floor(x).
*/
#include <math.h>
#include <math_private.h>
-
-static const double huge = 1.0e300;
+#include <libm-alias-double.h>
double
__floor (double x)
{
int32_t i0, i1, j0;
- u_int32_t i, j;
+ uint32_t i, j;
EXTRACT_WORDS (i0, i1, x);
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
if (j0 < 20)
{
- if (j0 < 0) /* raise inexact if x != 0 */
+ if (j0 < 0)
{
- math_force_eval (huge + x); /* return 0*sign(x) if |x|<1 */
+ /* return 0*sign(x) if |x|<1 */
if (i0 >= 0)
{
i0 = i1 = 0;
@@ -50,7 +47,6 @@ __floor (double x)
i = (0x000fffff) >> j0;
if (((i0 & i) | i1) == 0)
return x; /* x is integral */
- math_force_eval (huge + x); /* raise inexact flag */
if (i0 < 0)
i0 += (0x00100000) >> j0;
i0 &= (~i); i1 = 0;
@@ -65,10 +61,9 @@ __floor (double x)
}
else
{
- i = ((u_int32_t) (0xffffffff)) >> (j0 - 20);
+ i = ((uint32_t) (0xffffffff)) >> (j0 - 20);
if ((i1 & i) == 0)
return x; /* x is integral */
- math_force_eval (huge + x); /* raise inexact flag */
if (i0 < 0)
{
if (j0 == 20)
@@ -87,9 +82,5 @@ __floor (double x)
return x;
}
#ifndef __floor
-weak_alias (__floor, floor)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__floor, __floorl)
-weak_alias (__floor, floorl)
-# endif
+libm_alias_double (__floor, floor)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_fma.c b/sysdeps/ieee754/dbl-64/s_fma.c
index a3492434e4..57c7b5dfc2 100644
--- a/sysdeps/ieee754/dbl-64/s_fma.c
+++ b/sysdeps/ieee754/dbl-64/s_fma.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -21,7 +21,9 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <tininess.h>
/* This implementation uses rounding to odd to avoid problems with
@@ -292,10 +294,5 @@ __fma (double x, double y, double z)
}
}
#ifndef __fma
-weak_alias (__fma, fma)
-#endif
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fma, __fmal)
-weak_alias (__fmal, fmal)
+libm_alias_double (__fma, fma)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_fmaf.c b/sysdeps/ieee754/dbl-64/s_fmaf.c
index 582c205572..5c8b22ac16 100644
--- a/sysdeps/ieee754/dbl-64/s_fmaf.c
+++ b/sysdeps/ieee754/dbl-64/s_fmaf.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -20,7 +20,9 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-float.h>
/* This implementation relies on double being more than twice as
precise as float and uses rounding to odd in order to avoid problems
@@ -60,5 +62,5 @@ __fmaf (float x, float y, float z)
return (float) u.d;
}
#ifndef __fmaf
-weak_alias (__fmaf, fmaf)
+libm_alias_float (__fma, fma)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_fmul.c b/sysdeps/ieee754/dbl-64/s_fmul.c
new file mode 100644
index 0000000000..ad9ab7e94d
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fmul.c
@@ -0,0 +1,34 @@
+/* Multiply double values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32mulf64 __hide_f32mulf64
+#define f32mulf32x __hide_f32mulf32x
+#define fmull __hide_fmull
+#include <math.h>
+#undef f32mulf64
+#undef f32mulf32x
+#undef fmull
+
+#include <math-narrow.h>
+
+float
+__fmul (double x, double y)
+{
+ NARROW_MUL_ROUND_TO_ODD (x, y, float, union ieee754_double, , mantissa1);
+}
+libm_alias_float_double (mul)
diff --git a/sysdeps/ieee754/dbl-64/s_fpclassify.c b/sysdeps/ieee754/dbl-64/s_fpclassify.c
index 176e29fccb..1c2d1938f9 100644
--- a/sysdeps/ieee754/dbl-64/s_fpclassify.c
+++ b/sysdeps/ieee754/dbl-64/s_fpclassify.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -25,7 +25,7 @@
int
__fpclassify (double x)
{
- u_int32_t hx, lx;
+ uint32_t hx, lx;
int retval = FP_NORMAL;
EXTRACT_WORDS (hx, lx, x);
diff --git a/sysdeps/ieee754/dbl-64/s_frexp.c b/sysdeps/ieee754/dbl-64/s_frexp.c
index 1b8d8500ba..c96a869665 100644
--- a/sysdeps/ieee754/dbl-64/s_frexp.c
+++ b/sysdeps/ieee754/dbl-64/s_frexp.c
@@ -26,6 +26,7 @@ static char rcsid[] = "$NetBSD: s_frexp.c,v 1.9 1995/05/10 20:47:24 jtc Exp $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double
two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */
@@ -38,7 +39,7 @@ __frexp (double x, int *eptr)
ix = 0x7fffffff & hx;
*eptr = 0;
if (ix >= 0x7ff00000 || ((ix | lx) == 0))
- return x; /* 0,inf,nan */
+ return x + x; /* 0,inf,nan */
if (ix < 0x00100000) /* subnormal */
{
x *= two54;
@@ -51,8 +52,4 @@ __frexp (double x, int *eptr)
SET_HIGH_WORD (x, hx);
return x;
}
-weak_alias (__frexp, frexp)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__frexp, __frexpl)
-weak_alias (__frexp, frexpl)
-#endif
+libm_alias_double (__frexp, frexp)
diff --git a/sysdeps/ieee754/dbl-64/s_fromfp.c b/sysdeps/ieee754/dbl-64/s_fromfp.c
new file mode 100644
index 0000000000..30572b2a9b
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fromfp.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfp
+#include <s_fromfp_main.c>
+libm_alias_double (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/dbl-64/s_fromfp_main.c b/sysdeps/ieee754/dbl-64/s_fromfp_main.c
new file mode 100644
index 0000000000..dfb70b434e
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fromfp_main.c
@@ -0,0 +1,83 @@
+/* Round to integer type. dbl-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x3ff
+#define MANT_DIG 53
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (double x, int round, unsigned int width)
+{
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, x);
+ bool negative = (ix & 0x8000000000000000ULL) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ ix &= 0x7fffffffffffffffULL;
+ if (ix == 0)
+ return 0;
+ int exponent = ix >> (MANT_DIG - 1);
+ exponent -= BIAS;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+
+ ix &= ((1ULL << (MANT_DIG - 1)) - 1);
+ ix |= 1ULL << (MANT_DIG - 1);
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ if (exponent >= MANT_DIG - 1)
+ {
+ uret = ix;
+ uret <<= exponent - (MANT_DIG - 1);
+ half_bit = false;
+ more_bits = false;
+ }
+ else if (exponent >= -1)
+ {
+ uint64_t h = 1ULL << (MANT_DIG - 2 - exponent);
+ half_bit = (ix & h) != 0;
+ more_bits = (ix & (h - 1)) != 0;
+ uret = ix >> (MANT_DIG - 1 - exponent);
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/dbl-64/s_fromfpx.c b/sysdeps/ieee754/dbl-64/s_fromfpx.c
new file mode 100644
index 0000000000..b7a0d59a05
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fromfpx.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpx
+#include <s_fromfp_main.c>
+libm_alias_double (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/dbl-64/s_fsub.c b/sysdeps/ieee754/dbl-64/s_fsub.c
new file mode 100644
index 0000000000..c3b911e801
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fsub.c
@@ -0,0 +1,34 @@
+/* Subtract double values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32subf64 __hide_f32subf64
+#define f32subf32x __hide_f32subf32x
+#define fsubl __hide_fsubl
+#include <math.h>
+#undef f32subf64
+#undef f32subf32x
+#undef fsubl
+
+#include <math-narrow.h>
+
+float
+__fsub (double x, double y)
+{
+ NARROW_SUB_ROUND_TO_ODD (x, y, float, union ieee754_double, , mantissa1);
+}
+libm_alias_float_double (sub)
diff --git a/sysdeps/ieee754/dbl-64/s_getpayload.c b/sysdeps/ieee754/dbl-64/s_getpayload.c
new file mode 100644
index 0000000000..7b995e94ee
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_getpayload.c
@@ -0,0 +1,36 @@
+/* Get NaN payload. dbl-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.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;
+}
+libm_alias_double (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/dbl-64/s_isinf.c b/sysdeps/ieee754/dbl-64/s_isinf.c
index c0ad54538a..93eb65c147 100644
--- a/sysdeps/ieee754/dbl-64/s_isinf.c
+++ b/sysdeps/ieee754/dbl-64/s_isinf.c
@@ -15,6 +15,7 @@ static char rcsid[] = "$NetBSD: s_isinf.c,v 1.3 1995/05/11 23:20:14 jtc Exp $";
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
int
@@ -29,7 +30,7 @@ __isinf (double x)
hidden_def (__isinf)
weak_alias (__isinf, isinf)
#ifdef NO_LONG_DOUBLE
-# if defined LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
+# if LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
# endif
weak_alias (__isinf, isinfl)
diff --git a/sysdeps/ieee754/dbl-64/s_isnan.c b/sysdeps/ieee754/dbl-64/s_isnan.c
index 2174d988d8..82723eeb8a 100644
--- a/sysdeps/ieee754/dbl-64/s_isnan.c
+++ b/sysdeps/ieee754/dbl-64/s_isnan.c
@@ -21,6 +21,7 @@ static char rcsid[] = "$NetBSD: s_isnan.c,v 1.8 1995/05/10 20:47:36 jtc Exp $";
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
#undef __isnan
@@ -30,14 +31,14 @@ __isnan (double x)
int32_t hx, lx;
EXTRACT_WORDS (hx, lx, x);
hx &= 0x7fffffff;
- hx |= (u_int32_t) (lx | (-lx)) >> 31;
+ hx |= (uint32_t) (lx | (-lx)) >> 31;
hx = 0x7ff00000 - hx;
- return (int) (((u_int32_t) hx) >> 31);
+ return (int) (((uint32_t) hx) >> 31);
}
hidden_def (__isnan)
weak_alias (__isnan, isnan)
#ifdef NO_LONG_DOUBLE
-# if defined LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
+# if LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
# endif
weak_alias (__isnan, isnanl)
diff --git a/sysdeps/ieee754/dbl-64/s_issignaling.c b/sysdeps/ieee754/dbl-64/s_issignaling.c
index 4b93d6ae60..05aa3f2fdd 100644
--- a/sysdeps/ieee754/dbl-64/s_issignaling.c
+++ b/sysdeps/ieee754/dbl-64/s_issignaling.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,19 +18,20 @@
#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
- u_int32_t hxi;
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ uint32_t hxi;
GET_HIGH_WORD (hxi, x);
/* 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. */
return (hxi & 0x7ff80000) == 0x7ff80000;
#else
- u_int32_t hxi, lxi;
+ uint32_t hxi, lxi;
EXTRACT_WORDS (hxi, lxi, x);
/* To keep the following comparison simple, toggle the quiet/signaling bit,
so that it is set for sNaNs. This is inverse to IEEE 754-2008 (as well as
diff --git a/sysdeps/ieee754/dbl-64/s_llrint.c b/sysdeps/ieee754/dbl-64/s_llrint.c
index ff40ee626d..8159706f90 100644
--- a/sysdeps/ieee754/dbl-64/s_llrint.c
+++ b/sysdeps/ieee754/dbl-64/s_llrint.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,9 @@
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <fix-fp-int-convert-overflow.h>
static const double two52[2] =
@@ -36,7 +38,7 @@ long long int
__llrint (double x)
{
int32_t j0;
- u_int32_t i1, i0;
+ uint32_t i1, i0;
long long int result;
double w;
double t;
@@ -96,8 +98,4 @@ __llrint (double x)
return sx ? -result : result;
}
-weak_alias (__llrint, llrint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/ieee754/dbl-64/s_llround.c b/sysdeps/ieee754/dbl-64/s_llround.c
index 1d6a5205f1..1067d19859 100644
--- a/sysdeps/ieee754/dbl-64/s_llround.c
+++ b/sysdeps/ieee754/dbl-64/s_llround.c
@@ -1,5 +1,5 @@
/* Round double value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <fix-fp-int-convert-overflow.h>
@@ -29,7 +30,7 @@ long long int
__llround (double x)
{
int32_t j0;
- u_int32_t i1, i0;
+ uint32_t i1, i0;
long long int result;
int sign;
@@ -56,7 +57,7 @@ __llround (double x)
result = (((long long int) i0 << 32) | i1) << (j0 - 52);
else
{
- u_int32_t j = i1 + (0x80000000 >> (j0 - 20));
+ uint32_t j = i1 + (0x80000000 >> (j0 - 20));
if (j < i1)
++i0;
@@ -84,8 +85,4 @@ __llround (double x)
return sign * result;
}
-weak_alias (__llround, llround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __llroundl)
-weak_alias (__llround, llroundl)
-#endif
+libm_alias_double (__llround, llround)
diff --git a/sysdeps/ieee754/dbl-64/s_log1p.c b/sysdeps/ieee754/dbl-64/s_log1p.c
index 340f6377f7..e6476a8260 100644
--- a/sysdeps/ieee754/dbl-64/s_log1p.c
+++ b/sysdeps/ieee754/dbl-64/s_log1p.c
@@ -80,7 +80,10 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libc-diag.h>
static const double
ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
@@ -191,5 +194,14 @@ __log1p (double x)
if (k == 0)
return f - (hfsq - s * (hfsq + R));
else
- return k * ln2_hi - ((hfsq - (s * (hfsq + R) + (k * ln2_lo + c))) - f);
+ {
+ /* With GCC 7 when compiling with -Os the compiler warns that c
+ might be used uninitialized. This can't be true because k
+ must be 0 for c to be uninitialized and we handled that
+ computation earlier without using c. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
+ return k * ln2_hi - ((hfsq - (s * (hfsq + R) + (k * ln2_lo + c))) - f);
+ DIAG_POP_NEEDS_COMMENT;
+ }
}
diff --git a/sysdeps/ieee754/dbl-64/s_logb.c b/sysdeps/ieee754/dbl-64/s_logb.c
index 3a26b18f78..a6de1f6e49 100644
--- a/sysdeps/ieee754/dbl-64/s_logb.c
+++ b/sysdeps/ieee754/dbl-64/s_logb.c
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <fix-int-fp-convert-zero.h>
double
@@ -46,7 +47,6 @@ __logb (double x)
return 0.0;
return (double) (rix - 1023);
}
-weak_alias (__logb, logb)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__logb, __logbl) weak_alias (__logb, logbl)
+#ifndef __logb
+libm_alias_double (__logb, logb)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_lrint.c b/sysdeps/ieee754/dbl-64/s_lrint.c
index 4e7cbef97b..0e64ae1260 100644
--- a/sysdeps/ieee754/dbl-64/s_lrint.c
+++ b/sysdeps/ieee754/dbl-64/s_lrint.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,9 @@
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <fix-fp-int-convert-overflow.h>
static const double two52[2] =
@@ -36,7 +38,7 @@ long int
__lrint (double x)
{
int32_t j0;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
double w;
double t;
long int result;
@@ -120,8 +122,4 @@ __lrint (double x)
return sx ? -result : result;
}
-weak_alias (__lrint, lrint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/ieee754/dbl-64/s_lround.c b/sysdeps/ieee754/dbl-64/s_lround.c
index aa1275ddc3..70f624eea1 100644
--- a/sysdeps/ieee754/dbl-64/s_lround.c
+++ b/sysdeps/ieee754/dbl-64/s_lround.c
@@ -1,5 +1,5 @@
/* Round double value to long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <fix-fp-int-convert-overflow.h>
@@ -29,7 +30,7 @@ long int
__lround (double x)
{
int32_t j0;
- u_int32_t i1, i0;
+ uint32_t i1, i0;
long int result;
int sign;
@@ -56,7 +57,7 @@ __lround (double x)
result = ((long int) i0 << (j0 - 20)) | ((long int) i1 << (j0 - 52));
else
{
- u_int32_t j = i1 + (0x80000000 >> (j0 - 20));
+ uint32_t j = i1 + (0x80000000 >> (j0 - 20));
if (j < i1)
++i0;
@@ -106,8 +107,4 @@ __lround (double x)
return sign * result;
}
-weak_alias (__lround, lround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lround, __lroundl)
-weak_alias (__lround, lroundl)
-#endif
+libm_alias_double (__lround, lround)
diff --git a/sysdeps/ieee754/dbl-64/s_modf.c b/sysdeps/ieee754/dbl-64/s_modf.c
index 0a1e13008f..722511c64a 100644
--- a/sysdeps/ieee754/dbl-64/s_modf.c
+++ b/sysdeps/ieee754/dbl-64/s_modf.c
@@ -21,6 +21,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double one = 1.0;
@@ -28,7 +29,7 @@ double
__modf (double x, double *iptr)
{
int32_t i0, i1, j0;
- u_int32_t i;
+ uint32_t i;
EXTRACT_WORDS (i0, i1, x);
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; /* exponent of x */
if (j0 < 20) /* integer part in high x */
@@ -65,7 +66,7 @@ __modf (double x, double *iptr)
}
else /* fraction part in low x */
{
- i = ((u_int32_t) (0xffffffff)) >> (j0 - 20);
+ i = ((uint32_t) (0xffffffff)) >> (j0 - 20);
if ((i1 & i) == 0) /* x is integral */
{
*iptr = x;
@@ -79,8 +80,6 @@ __modf (double x, double *iptr)
}
}
}
-weak_alias (__modf, modf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__modf, __modfl)
-weak_alias (__modf, modfl)
+#ifndef __modf
+libm_alias_double (__modf, modf)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/s_nearbyint.c
index dec0c5d6ee..903121d456 100644
--- a/sysdeps/ieee754/dbl-64/s_nearbyint.c
+++ b/sysdeps/ieee754/dbl-64/s_nearbyint.c
@@ -26,7 +26,9 @@ static char rcsid[] = "$NetBSD: s_rint.c,v 1.8 1995/05/10 20:48:04 jtc Exp $";
#include <fenv.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double
TWO52[2] = {
@@ -48,7 +50,7 @@ __nearbyint (double x)
if (j0 < 0)
{
libc_feholdexcept (&env);
- w = TWO52[sx] + x;
+ w = TWO52[sx] + math_opt_barrier (x);
t = w - TWO52[sx];
math_force_eval (t);
libc_fesetenv (&env);
@@ -65,14 +67,10 @@ __nearbyint (double x)
return x; /* x is integral */
}
libc_feholdexcept (&env);
- w = TWO52[sx] + x;
+ w = TWO52[sx] + math_opt_barrier (x);
t = w - TWO52[sx];
math_force_eval (t);
libc_fesetenv (&env);
return t;
}
-weak_alias (__nearbyint, nearbyint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__nearbyint, __nearbyintl)
-weak_alias (__nearbyint, nearbyintl)
-#endif
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/ieee754/dbl-64/s_nextup.c b/sysdeps/ieee754/dbl-64/s_nextup.c
new file mode 100644
index 0000000000..d37a2b6657
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_nextup.c
@@ -0,0 +1,56 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.h>
+
+/* Return the least floating-point number greater than X. */
+double
+__nextup (double x)
+{
+ int32_t hx, ix;
+ uint32_t lx;
+
+ EXTRACT_WORDS (hx, lx, x);
+ ix = hx & 0x7fffffff;
+
+ if (((ix >= 0x7ff00000) && ((ix - 0x7ff00000) | lx) != 0)) /* x is nan. */
+ return x + x;
+ if ((ix | lx) == 0)
+ return DBL_TRUE_MIN;
+ if (hx >= 0)
+ { /* x > 0. */
+ if (isinf (x))
+ return x;
+ lx += 1;
+ if (lx == 0)
+ hx += 1;
+ }
+ else
+ { /* x < 0. */
+ if (lx == 0)
+ hx -= 1;
+ lx -= 1;
+ }
+ INSERT_WORDS (x, hx, lx);
+ return x;
+}
+
+libm_alias_double (__nextup, nextup)
diff --git a/sysdeps/ieee754/dbl-64/s_remquo.c b/sysdeps/ieee754/dbl-64/s_remquo.c
index 16215e1e29..9a3fbe0ec8 100644
--- a/sysdeps/ieee754/dbl-64/s_remquo.c
+++ b/sysdeps/ieee754/dbl-64/s_remquo.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double zero = 0.0;
@@ -29,7 +30,7 @@ double
__remquo (double x, double y, int *quo)
{
int32_t hx, hy;
- u_int32_t sx, lx, ly;
+ uint32_t sx, lx, ly;
int cquo, qs;
EXTRACT_WORDS (hx, lx, x);
@@ -108,8 +109,4 @@ __remquo (double x, double y, int *quo)
x = -x;
return x;
}
-weak_alias (__remquo, remquo)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__remquo, __remquol)
-weak_alias (__remquo, remquol)
-#endif
+libm_alias_double (__remquo, remquo)
diff --git a/sysdeps/ieee754/dbl-64/s_rint.c b/sysdeps/ieee754/dbl-64/s_rint.c
index a9c0d27842..cb0f5ca298 100644
--- a/sysdeps/ieee754/dbl-64/s_rint.c
+++ b/sysdeps/ieee754/dbl-64/s_rint.c
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double
TWO52[2] = {
@@ -59,9 +60,5 @@ __rint (double x)
return w - TWO52[sx];
}
#ifndef __rint
-weak_alias (__rint, rint)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
-# endif
+libm_alias_double (__rint, rint)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_round.c b/sysdeps/ieee754/dbl-64/s_round.c
index aeed6faf0e..fa9e83196e 100644
--- a/sysdeps/ieee754/dbl-64/s_round.c
+++ b/sysdeps/ieee754/dbl-64/s_round.c
@@ -1,5 +1,5 @@
/* Round double to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,16 +20,14 @@
#include <math.h>
#include <math_private.h>
-
-
-static const double huge = 1.0e300;
+#include <libm-alias-double.h>
double
__round (double x)
{
int32_t i0, j0;
- u_int32_t i1;
+ uint32_t i1;
EXTRACT_WORDS (i0, i1, x);
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
@@ -37,8 +35,6 @@ __round (double x)
{
if (j0 < 0)
{
- math_force_eval (huge + x);
-
i0 &= 0x80000000;
if (j0 == -1)
i0 |= 0x3ff00000;
@@ -46,13 +42,11 @@ __round (double x)
}
else
{
- u_int32_t i = 0x000fffff >> j0;
+ uint32_t i = 0x000fffff >> j0;
if (((i0 & i) | i1) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
- /* Raise inexact if x != 0. */
i0 += 0x00080000 >> j0;
i0 &= ~i;
i1 = 0;
@@ -68,15 +62,12 @@ __round (double x)
}
else
{
- u_int32_t i = 0xffffffff >> (j0 - 20);
+ uint32_t i = 0xffffffff >> (j0 - 20);
if ((i1 & i) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
-
- /* Raise inexact if x != 0. */
- u_int32_t j = i1 + (1 << (51 - j0));
+ uint32_t j = i1 + (1 << (51 - j0));
if (j < i1)
i0 += 1;
i1 = j;
@@ -86,8 +77,4 @@ __round (double x)
INSERT_WORDS (x, i0, i1);
return x;
}
-weak_alias (__round, round)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__round, __roundl)
-weak_alias (__round, roundl)
-#endif
+libm_alias_double (__round, round)
diff --git a/sysdeps/ieee754/dbl-64/s_roundeven.c b/sysdeps/ieee754/dbl-64/s_roundeven.c
new file mode 100644
index 0000000000..1438e81d45
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_roundeven.c
@@ -0,0 +1,105 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ dbl-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+#define BIAS 0x3ff
+#define MANT_DIG 53
+#define MAX_EXP (2 * BIAS + 1)
+
+double
+__roundeven (double x)
+{
+ uint32_t hx, lx, uhx;
+ EXTRACT_WORDS (hx, lx, x);
+ uhx = hx & 0x7fffffff;
+ int exponent = uhx >> (MANT_DIG - 1 - 32);
+ if (exponent >= BIAS + MANT_DIG - 1)
+ {
+ /* Integer, infinity or NaN. */
+ if (exponent == MAX_EXP)
+ /* Infinity or NaN; quiet signaling NaNs. */
+ return x + x;
+ else
+ return x;
+ }
+ else if (exponent >= BIAS + MANT_DIG - 32)
+ {
+ /* Not necessarily an integer; integer bit is in low word.
+ Locate the bits with exponents 0 and -1. */
+ int int_pos = (BIAS + MANT_DIG - 1) - exponent;
+ int half_pos = int_pos - 1;
+ uint32_t half_bit = 1U << half_pos;
+ uint32_t int_bit = 1U << int_pos;
+ if ((lx & (int_bit | (half_bit - 1))) != 0)
+ {
+ /* Carry into the exponent works correctly. No need to test
+ whether HALF_BIT is set. */
+ lx += half_bit;
+ hx += lx < half_bit;
+ }
+ lx &= ~(int_bit - 1);
+ }
+ else if (exponent == BIAS + MANT_DIG - 33)
+ {
+ /* Not necessarily an integer; integer bit is bottom of high
+ word, half bit is top of low word. */
+ if (((hx & 1) | (lx & 0x7fffffff)) != 0)
+ {
+ lx += 0x80000000;
+ hx += lx < 0x80000000;
+ }
+ lx = 0;
+ }
+ else if (exponent >= BIAS)
+ {
+ /* At least 1; not necessarily an integer, integer bit and half
+ bit are in the high word. Locate the bits with exponents 0
+ and -1 (when the unbiased exponent is 0, the bit with
+ exponent 0 is implicit, but as the bias is odd it is OK to
+ take it from the low bit of the exponent). */
+ int int_pos = (BIAS + MANT_DIG - 33) - exponent;
+ int half_pos = int_pos - 1;
+ uint32_t half_bit = 1U << half_pos;
+ uint32_t int_bit = 1U << int_pos;
+ if (((hx & (int_bit | (half_bit - 1))) | lx) != 0)
+ hx += half_bit;
+ hx &= ~(int_bit - 1);
+ lx = 0;
+ }
+ else if (exponent == BIAS - 1 && (uhx > 0x3fe00000 || lx != 0))
+ {
+ /* Interval (0.5, 1). */
+ hx = (hx & 0x80000000) | 0x3ff00000;
+ lx = 0;
+ }
+ else
+ {
+ /* Rounds to 0. */
+ hx &= 0x80000000;
+ lx = 0;
+ }
+ INSERT_WORDS (x, hx, lx);
+ return x;
+}
+hidden_def (__roundeven)
+libm_alias_double (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/dbl-64/s_setpayload.c b/sysdeps/ieee754/dbl-64/s_setpayload.c
new file mode 100644
index 0000000000..0f536956f4
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_setpayload.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayload
+#include <s_setpayload_main.c>
+libm_alias_double (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/dbl-64/s_setpayload_main.c b/sysdeps/ieee754/dbl-64/s_setpayload_main.c
new file mode 100644
index 0000000000..0e87c2a587
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_setpayload_main.c
@@ -0,0 +1,70 @@
+/* Set NaN payload. dbl-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3ff
+#define PAYLOAD_DIG 51
+#define EXPLICIT_MANT_DIG 52
+
+int
+FUNC (double *x, double payload)
+{
+ uint32_t hx, lx;
+ EXTRACT_WORDS (hx, lx, payload);
+ int exponent = hx >> (EXPLICIT_MANT_DIG - 32);
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. */
+ if (exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && hx == 0 && lx == 0)))
+ {
+ INSERT_WORDS (*x, 0, 0);
+ return 1;
+ }
+ int shift = BIAS + EXPLICIT_MANT_DIG - exponent;
+ if (shift < 32
+ ? (lx & ((1U << shift) - 1)) != 0
+ : (lx != 0 || (hx & ((1U << (shift - 32)) - 1)) != 0))
+ {
+ INSERT_WORDS (*x, 0, 0);
+ return 1;
+ }
+ if (exponent != 0)
+ {
+ hx &= (1U << (EXPLICIT_MANT_DIG - 32)) - 1;
+ hx |= 1U << (EXPLICIT_MANT_DIG - 32);
+ if (shift >= 32)
+ {
+ lx = hx >> (shift - 32);
+ hx = 0;
+ }
+ else if (shift != 0)
+ {
+ lx = (lx >> shift) | (hx << (32 - shift));
+ hx >>= shift;
+ }
+ }
+ hx |= 0x7ff00000 | (SET_HIGH_BIT ? 0x80000 : 0);
+ INSERT_WORDS (*x, hx, lx);
+ return 0;
+}
diff --git a/sysdeps/ieee754/dbl-64/s_setpayloadsig.c b/sysdeps/ieee754/dbl-64/s_setpayloadsig.c
new file mode 100644
index 0000000000..96ea34b070
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_setpayloadsig.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsig
+#include <s_setpayload_main.c>
+libm_alias_double (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/dbl-64/s_signbit.c b/sysdeps/ieee754/dbl-64/s_signbit.c
index f4ef4d238f..71500b0a2d 100644
--- a/sysdeps/ieee754/dbl-64/s_signbit.c
+++ b/sysdeps/ieee754/dbl-64/s_signbit.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index ca2532fb63..b369ac9f5b 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -22,22 +22,11 @@
/* */
/* FUNCTIONS: usin */
/* ucos */
-/* slow */
-/* slow1 */
-/* slow2 */
-/* sloww */
-/* sloww1 */
-/* sloww2 */
-/* bsloww */
-/* bsloww1 */
-/* bsloww2 */
-/* cslow2 */
/* FILES NEEDED: dla.h endian.h mpa.h mydefs.h usncs.h */
-/* branred.c sincos32.c dosincos.c mpa.c */
-/* sincos.tbl */
+/* branred.c sincos.tbl */
/* */
-/* An ultimate sin and routine. Given an IEEE double machine number x */
-/* it computes the correctly rounded (to nearest) value of sin(x) or cos(x) */
+/* An ultimate sin and cos routine. Given an IEEE double machine number x */
+/* it computes sin(x) or cos(x) with ~0.55 ULP. */
/* Assumption: Machine arithmetic operations are performed in */
/* round to nearest mode of IEEE 754 standard. */
/* */
@@ -52,6 +41,8 @@
#include "MathLib.h"
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
#include <fenv.h>
/* Helper macros to compute sin of the input values. */
@@ -65,35 +56,11 @@
a - a^3/3! + a^5/5! - a^7/7! + a^9/9! + (1 - a^2) * da / 2
The constants s1, s2, s3, etc. are pre-computed values of 1/3!, 1/5! and so
- on. The result is returned to LHS and correction in COR. */
-#define TAYLOR_SIN(xx, a, da, cor) \
+ on. The result is returned to LHS. */
+#define TAYLOR_SIN(xx, a, da) \
({ \
double t = ((POLYNOMIAL (xx) * (a) - 0.5 * (da)) * (xx) + (da)); \
double res = (a) + t; \
- (cor) = ((a) - res) + t; \
- res; \
-})
-
-/* This is again a variation of the Taylor series expansion with the term
- x^3/3! expanded into the following for better accuracy:
-
- bb * x ^ 3 + 3 * aa * x * x1 * x2 + aa * x1 ^ 3 + aa * x2 ^ 3
-
- The correction term is dx and bb + aa = -1/3!
- */
-#define TAYLOR_SLOW(x0, dx, cor) \
-({ \
- static const double th2_36 = 206158430208.0; /* 1.5*2**37 */ \
- double xx = (x0) * (x0); \
- double x1 = ((x0) + th2_36) - th2_36; \
- double y = aa * x1 * x1 * x1; \
- double r = (x0) + y; \
- double x2 = ((x0) - x1) + (dx); \
- double t = (((POLYNOMIAL2 (xx) + bb) * xx + 3.0 * aa * x1 * x2) \
- * (x0) + aa * x2 * x2 * x2 + (dx)); \
- t = (((x0) - r) + y) + t; \
- double res = r + t; \
- (cor) = (r - res) + t; \
res; \
})
@@ -123,156 +90,69 @@ static const double
cs4 = -4.16666666666664434524222570944589E-02,
cs6 = 1.38888874007937613028114285595617E-03;
-static const double t22 = 0x1.8p22;
-
-void __dubsin (double x, double dx, double w[]);
-void __docos (double x, double dx, double w[]);
-double __mpsin (double x, double dx, bool reduce_range);
-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 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);
-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. */
+static inline double
+__always_inline
+do_cos (double x, double dx)
{
- double xx, s, sn, ssn, c, cs, ccs, res, cor;
+ 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, cor;
xx = x * x;
s = x + x * xx * (sn3 + xx * sn5);
c = xx * (cs2 + xx * (cs4 + xx * cs6));
SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
cor = (ccs - s * ssn - cs * c) - sn * s;
- res = cs + cor;
- cor = (cs - res) + cor;
- *corp = cor;
- return res;
+ return cs + cor;
}
-/* 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)
+/* 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. */
+static inline double
+__always_inline
+do_sin (double x, double dx)
{
- double xx, y, x1, x2, e1, e2, res, cor;
- double s, sn, ssn, c, cs, ccs;
- xx = x * x;
- s = x * xx * (sn3 + xx * sn5);
- c = x * dx + xx * (cs2 + xx * (cs4 + xx * cs6));
- SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
- x1 = (x + t22) - t22;
- x2 = (x - x1) + dx;
- e1 = (sn + t22) - t22;
- e2 = (sn - e1) + ssn;
- cor = (ccs - cs * c - e1 * x2 - e2 * x) - sn * s;
- y = cs - e1 * x1;
- 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;
- *corp = cor;
- return res;
-}
+ double xold = x;
+ /* Max ULP is 0.501 if |x| < 0.126, otherwise ULP is 0.518. */
+ if (fabs (x) < 0.126)
+ return TAYLOR_SIN (x * x, x, dx);
-/* 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)
-{
- double xx, s, sn, ssn, c, cs, ccs, cor, res;
+ 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;
xx = x * x;
s = x + (dx + x * xx * (sn3 + xx * sn5));
c = x * dx + xx * (cs2 + xx * (cs4 + xx * cs6));
SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
cor = (ssn + s * ccs - sn * c) + cs * s;
- res = sn + cor;
- cor = (sn - res) + cor;
- *corp = cor;
- 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)
-{
- double xx, y, x1, x2, c1, c2, res, cor;
- double s, sn, ssn, c, cs, ccs;
- xx = x * x;
- s = x * xx * (sn3 + xx * sn5);
- c = xx * (cs2 + xx * (cs4 + xx * cs6));
- SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
- x1 = (x + t22) - t22;
- x2 = (x - x1) + dx;
- c1 = (cs + t22) - t22;
- c2 = (cs - c1) + ccs;
- cor = (ssn + s * ccs + cs * s + c2 * x + c1 * x2 - sn * x * dx) - sn * c;
- y = sn + c1 * x1;
- 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;
- *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. */
-static inline double
-__always_inline
-reduce_and_compute (double x, unsigned int k)
-{
- double retval = 0, a, da;
- unsigned int n = __branred (x, &a, &da);
- k = (n + k) % 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;
- }
- return retval;
+ return __copysign (sn + cor, xold);
}
+/* Reduce range of x to within PI/2 with abs (x) < 105414350. The high part
+ is written to *a, the low part to *da. Range reduction is accurate to 136
+ bits so that when x is large and *a very close to zero, all 53 bits of *a
+ are correct. */
static inline int4
__always_inline
-reduce_sincos_1 (double x, double *a, double *da)
+reduce_sincos (double x, double *a, double *da)
{
mynumber v;
@@ -281,198 +161,54 @@ reduce_sincos_1 (double x, double *a, double *da)
v.x = t;
double y = (x - xn * mp1) - xn * mp2;
int4 n = v.i[LOW_HALF] & 3;
- double db = xn * mp3;
- double b = y - db;
- db = (y - b) - db;
-
- *a = b;
- *da = db;
-
- return n;
-}
-
-/* Compute sin (A + DA). cos can be computed by shifting the quadrant N
- clockwise. */
-static double
-__always_inline
-do_sincos_1 (double a, double da, double x, int4 n, int4 k)
-{
- double xx, retval, res, cor, y;
- mynumber u;
- int m;
- double eps = fabs (x) * 1.2e-30;
-
- int k1 = (n + k) & 3;
- switch (k1)
- { /* quarter of unit circle */
- case 2:
- a = -a;
- da = -da;
- 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);
- }
- 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));
- }
- 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)
- : sloww2 (a, da, x, n));
- break;
- }
-
- return retval;
-}
-static inline int4
-__always_inline
-reduce_sincos_2 (double x, double *a, double *da)
-{
- mynumber v;
+ double b, db, t1, t2;
+ t1 = xn * pp3;
+ t2 = y - t1;
+ db = (y - t2) - t1;
- double t = (x * hpinv + toint);
- double xn = t - toint;
- v.x = t;
- double xn1 = (xn + 8.0e22) - 8.0e22;
- double xn2 = xn - xn1;
- double y = ((((x - xn1 * mp1) - xn1 * mp2) - xn2 * mp1) - xn2 * mp2);
- int4 n = v.i[LOW_HALF] & 3;
- double db = xn1 * pp3;
- t = y - db;
- db = (y - t) - db;
- db = (db - xn2 * pp3) - xn * pp4;
- double b = t + db;
- db = (t - b) + db;
+ t1 = xn * pp4;
+ b = t2 - t1;
+ db += (t2 - b) - t1;
*a = b;
*da = db;
-
return n;
}
-/* Compute sin (A + DA). cos can be computed by shifting the quadrant N
- clockwise. */
+/* Compute sin or cos (A + DA) for the given quadrant N. */
static double
__always_inline
-do_sincos_2 (double a, double da, double x, int4 n, int4 k)
+do_sincos (double a, double da, int4 n)
{
- double res, retval, cor, xx;
- mynumber u;
-
- double eps = 1.0e-24;
-
- k = (n + k) & 3;
-
- switch (k)
- {
- 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 : 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)
- : bsloww1 (a, da, x, n));
- }
- break;
+ double retval;
- 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;
- retval = ((res == res + cor) ? ((n & 2) ? -res : res)
- : bsloww2 (a, da, x, n));
- break;
- }
+ if (n & 1)
+ /* Max ULP is 0.513. */
+ retval = do_cos (a, da);
+ else
+ /* Max ULP is 0.501 if xx < 0.01588, otherwise ULP is 0.518. */
+ retval = do_sin (a, da);
- return retval;
+ return (n & 2) ? -retval : retval;
}
+
/*******************************************************************/
/* An ultimate sin routine. Given an IEEE double machine number x */
/* it computes the correctly rounded (to nearest) value of sin(x) */
/*******************************************************************/
-#ifdef IN_SINCOS
-static double
-#else
+#ifndef IN_SINCOS
double
SECTION
-#endif
__sin (double x)
{
- double xx, res, t, cor, y, s, c, sn, ssn, cs, ccs;
+ double t, a, da;
mynumber u;
- int4 k, m;
+ int4 k, m, n;
double retval = 0;
-#ifndef IN_SINCOS
SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
-#endif
u.x = x;
m = u.i[HIGH_HALF];
@@ -482,77 +218,34 @@ __sin (double x)
math_check_force_underflow (x);
retval = x;
}
- /*---------------------------- 2^-26 < |x|< 0.25 ----------------------*/
- else if (k < 0x3fd00000)
- {
- xx = x * x;
- /* Taylor series. */
- t = POLYNOMIAL (xx) * (xx * x);
- res = x + t;
- cor = (x - res) + t;
- retval = (res == res + 1.07 * cor) ? res : slow (x);
- } /* else if (k < 0x3fd00000) */
-/*---------------------------- 0.25<|x|< 0.855469---------------------- */
+/*--------------------------- 2^-26<|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;
- retval = (res == res + 1.096 * cor) ? res : slow1 (x);
+ /* Max ULP is 0.548. */
+ retval = do_sin (x, 0);
} /* 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);
+ /* Max ULP is 0.51. */
+ retval = __copysign (do_cos (t, hp1), x);
} /* else if (k < 0x400368fd) */
-#ifndef IN_SINCOS
/*-------------------------- 2.426265<|x|< 105414350 ----------------------*/
else if (k < 0x419921FB)
{
- double a, da;
- int4 n = reduce_sincos_1 (x, &a, &da);
- retval = do_sincos_1 (a, da, x, n, 0);
+ n = reduce_sincos (x, &a, &da);
+ retval = do_sincos (a, da, n);
} /* else if (k < 0x419921FB ) */
-/*---------------------105414350 <|x|< 281474976710656 --------------------*/
- else if (k < 0x42F00000)
- {
- double a, da;
-
- int4 n = reduce_sincos_2 (x, &a, &da);
- retval = do_sincos_2 (a, da, x, n, 0);
- } /* else if (k < 0x42F00000 ) */
-
-/* -----------------281474976710656 <|x| <2^1024----------------------------*/
+/* --------------------105414350 <|x| <2^1024------------------------------*/
else if (k < 0x7ff00000)
- retval = reduce_and_compute (x, 0);
-
+ {
+ n = __branred (x, &a, &da);
+ retval = do_sincos (a, da, n);
+ }
/*--------------------- |x| > 2^1024 ----------------------------------*/
else
{
@@ -560,7 +253,6 @@ __sin (double x)
__set_errno (EDOM);
retval = x / x;
}
-#endif
return retval;
}
@@ -571,23 +263,17 @@ __sin (double x)
/* it computes the correctly rounded (to nearest) value of cos(x) */
/*******************************************************************/
-#ifdef IN_SINCOS
-static double
-#else
double
SECTION
-#endif
__cos (double x)
{
- double y, xx, res, cor, a, da;
+ double y, a, da;
mynumber u;
- int4 k, m;
+ int4 k, m, n;
double retval = 0;
-#ifndef IN_SINCOS
SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
-#endif
u.x = x;
m = u.i[HIGH_HALF];
@@ -599,11 +285,8 @@ __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);
- retval = (res == res + 1.020 * cor) ? res : cslow2 (x);
+ /* Max ULP is 0.51. */
+ retval = do_cos (x, 0);
} /* else if (k < 0x3feb6000) */
else if (k < 0x400368fd)
@@ -611,55 +294,23 @@ __cos (double x)
y = hp0 - fabs (x);
a = y + hp1;
da = (y - a) + hp1;
- xx = a * a;
- 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);
- }
- 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));
- }
-
+ /* Max ULP is 0.501 if xx < 0.01588 or 0.518 otherwise.
+ Range reduction uses 106 bits here which is sufficient. */
+ retval = do_sin (a, da);
} /* else if (k < 0x400368fd) */
-
-#ifndef IN_SINCOS
else if (k < 0x419921FB)
{ /* 2.426265<|x|< 105414350 */
- double a, da;
- int4 n = reduce_sincos_1 (x, &a, &da);
- retval = do_sincos_1 (a, da, x, n, 1);
+ n = reduce_sincos (x, &a, &da);
+ retval = do_sincos (a, da, n + 1);
} /* else if (k < 0x419921FB ) */
- else if (k < 0x42F00000)
- {
- double a, da;
-
- int4 n = reduce_sincos_2 (x, &a, &da);
- retval = do_sincos_2 (a, da, x, n, 1);
- } /* else if (k < 0x42F00000 ) */
-
- /* 281474976710656 <|x| <2^1024 */
+ /* 105414350 <|x| <2^1024 */
else if (k < 0x7ff00000)
- retval = reduce_and_compute (x, 1);
+ {
+ n = __branred (x, &a, &da);
+ retval = do_sincos (a, da, n + 1);
+ }
else
{
@@ -667,366 +318,15 @@ __cos (double x)
__set_errno (EDOM);
retval = x / x; /* |x| > 2^1024 */
}
-#endif
return retval;
}
-/************************************************************************/
-/* Routine compute sin(x) for 2^-26 < |x|< 0.25 by Taylor with more */
-/* precision and if still doesn't accurate enough by mpsin or dubsin */
-/************************************************************************/
-
-static double
-SECTION
-slow (double x)
-{
- double res, cor, w[2];
- res = TAYLOR_SLOW (x, 0, cor);
- if (res == res + 1.0007 * cor)
- return res;
-
- __dubsin (fabs (x), 0, w);
- if (w[0] == w[0] + 1.000000001 * w[1])
- return (x > 0) ? w[0] : -w[0];
-
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
-}
-
-/*******************************************************************************/
-/* Routine compute sin(x) for 0.25<|x|< 0.855469 by __sincostab.tbl and Taylor */
-/* and if result still doesn't accurate enough by mpsin or dubsin */
-/*******************************************************************************/
-
-static double
-SECTION
-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);
- if (res == res + cor)
- return (x > 0) ? res : -res;
-
- __dubsin (fabs (x), 0, w);
- if (w[0] == w[0] + 1.000000005 * w[1])
- return (x > 0) ? w[0] : -w[0];
-
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-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
-slow2 (double x)
-{
- mynumber u;
- double w[2], y, y1, y2, cor, res, del;
-
- 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);
- if (res == res + cor)
- return (x > 0) ? res : -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 (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-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)
-{
- 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;
-
- 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;
-
- if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
-
- t = (orig * hpinv + toint);
- xn = t - toint;
- v.x = t;
- y = (orig - xn * mp1) - xn * mp2;
- n = (v.i[LOW_HALF] + k) & 3;
- da = xn * pp3;
- t = y - da;
- da = (y - t) - da;
- y = xn * pp4;
- a = t - y;
- da = ((t - a) - y) + da;
-
- if (n == 2 || n == 1)
- {
- 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;
-
- if (w[0] == w[0] + cor)
- return (a > 0) ? w[0] : -w[0];
-
- return (n & 1) ? __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)
-{
- mynumber u;
- double w[2], y, cor, res;
-
- u.x = big + x;
- y = x - (u.x - big);
- res = do_sin_slow (u, y, dx, 3.1e-30 * fabs (orig), &cor);
-
- if (res == res + cor)
- return (m > 0) ? res : -res;
-
- __dubsin (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);
-
- if (w[0] == w[0] + cor)
- return (m > 0) ? w[0] : -w[0];
-
- return (k == 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
-}
-
-/***************************************************************************/
-/* Routine compute sin(x+dx) (Double-Length number) where x in second or */
-/* fourth quarter of unit circle.Routine receive also the original value */
-/* and quarter(n= 1or 3)of x for computing error of result.And if result not*/
-/* accurate enough routine calls mpsin1 or dubsin */
-/***************************************************************************/
-
-static double
-SECTION
-sloww2 (double x, double dx, double orig, int n)
-{
- mynumber u;
- double w[2], y, cor, res;
-
- u.x = big + x;
- y = x - (u.x - big);
- res = do_cos_slow (u, y, dx, 3.1e-30 * fabs (orig), &cor);
-
- if (res == res + cor)
- return (n & 2) ? -res : res;
-
- __docos (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);
-
- if (w[0] == w[0] + cor)
- return (n & 2) ? -w[0] : w[0];
-
- return (n & 1) ? __mpsin (orig, 0, true) : __mpcos (orig, 0, true);
-}
-
-/***************************************************************************/
-/* Routine compute sin(x+dx) or cos(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 other routines */
-/***************************************************************************/
-
-static double
-SECTION
-bsloww (double x, double dx, double orig, int n)
-{
- double res, cor, w[2];
-
- res = TAYLOR_SLOW (x, dx, cor);
- cor = (cor > 0) ? 1.0005 * cor + 1.1e-24 : 1.0005 * cor - 1.1e-24;
- 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;
-
- if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
-
- return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
-}
-
-/***************************************************************************/
-/* Routine compute sin(x+dx) or cos(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 other routines */
-/***************************************************************************/
-
-static double
-SECTION
-bsloww1 (double x, double dx, double orig, int n)
-{
- mynumber u;
- double w[2], y, 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);
- if (res == res + cor)
- return (x > 0) ? res : -res;
-
- __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;
-
- if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
-
- return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
-}
-
-/***************************************************************************/
-/* Routine compute sin(x+dx) or cos(x+dx) (Double-Length number) where x */
-/* in second or fourth quarter of unit circle.Routine receive also the */
-/* original value and quarter(n= 1or 3)of x for computing error of result. */
-/* And if result not accurate enough routine calls other routines */
-/***************************************************************************/
-
-static double
-SECTION
-bsloww2 (double x, double dx, double orig, int n)
-{
- mynumber u;
- double w[2], y, 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);
- if (res == res + cor)
- return (n & 2) ? -res : res;
-
- __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;
-
- if (w[0] == w[0] + cor)
- return (n & 2) ? -w[0] : w[0];
-
- return (n & 1) ? __mpsin (orig, 0, true) : __mpcos (orig, 0, true);
-}
-
-/************************************************************************/
-/* Routine compute cos(x) for 2^-27 < |x|< 0.25 by Taylor with more */
-/* precision and if still doesn't accurate enough by mpcos or docos */
-/************************************************************************/
-
-static double
-SECTION
-cslow2 (double x)
-{
- mynumber u;
- double w[2], y, cor, res;
-
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- res = do_cos_slow (u, y, 0, 0, &cor);
- if (res == res + cor)
- return res;
-
- y = fabs (x);
- __docos (y, 0, w);
- if (w[0] == w[0] + 1.000000005 * w[1])
- return w[0];
-
- return __mpcos (x, 0, false);
-}
-
#ifndef __cos
-weak_alias (__cos, cos)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__cos, __cosl)
-weak_alias (__cos, cosl)
-# endif
+libm_alias_double (__cos, cos)
#endif
#ifndef __sin
-weak_alias (__sin, sin)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__sin, __sinl)
-weak_alias (__sin, sinl)
-# endif
+libm_alias_double (__sin, sin)
+#endif
+
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_sincos.c b/sysdeps/ieee754/dbl-64/s_sincos.c
index c389226b04..1d8d44befe 100644
--- a/sysdeps/ieee754/dbl-64/s_sincos.c
+++ b/sysdeps/ieee754/dbl-64/s_sincos.c
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,43 +21,12 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
-#define __sin __sin_local
-#define __cos __cos_local
-#define IN_SINCOS 1
+#define IN_SINCOS
#include "s_sin.c"
-/* Consolidated version of reduce_and_compute in s_sin.c that does range
- reduction only once and computes sin and cos together. */
-static inline void
-__always_inline
-reduce_and_compute_sincos (double x, double *sinx, double *cosx)
-{
- double a, da;
- unsigned int n = __branred (x, &a, &da);
-
- n = n & 3;
-
- if (n == 1 || n == 2)
- {
- a = -a;
- da = -da;
- }
-
- if (n & 1)
- {
- double *temp = cosx;
- cosx = sinx;
- sinx = temp;
- }
-
- if (a * a < 0.01588)
- *sinx = bsloww (a, da, x, n);
- else
- *sinx = bsloww1 (a, da, x, n);
- *cosx = bsloww2 (a, da, x, n);
-}
-
void
__sincos (double x, double *sinx, double *cosx)
{
@@ -67,37 +36,62 @@ __sincos (double x, double *sinx, double *cosx)
SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
u.x = x;
- k = 0x7fffffff & u.i[HIGH_HALF];
+ k = u.i[HIGH_HALF] & 0x7fffffff;
if (k < 0x400368fd)
{
- *sinx = __sin_local (x);
- *cosx = __cos_local (x);
- return;
- }
- if (k < 0x419921FB)
- {
- 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);
-
- return;
- }
- if (k < 0x42F00000)
- {
- 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);
-
+ double a, da, y;
+ /* |x| < 2^-27 => cos (x) = 1, sin (x) = x. */
+ if (k < 0x3e400000)
+ {
+ if (k < 0x3e500000)
+ math_check_force_underflow (x);
+ *sinx = x;
+ *cosx = 1.0;
+ return;
+ }
+ /* |x| < 0.855469. */
+ else if (k < 0x3feb6000)
+ {
+ *sinx = do_sin (x, 0);
+ *cosx = do_cos (x, 0);
+ return;
+ }
+
+ /* |x| < 2.426265. */
+ y = hp0 - fabs (x);
+ a = y + hp1;
+ da = (y - a) + hp1;
+ *sinx = __copysign (do_cos (a, da), x);
+ *cosx = do_sin (a, da);
return;
}
+ /* |x| < 2^1024. */
if (k < 0x7ff00000)
{
- reduce_and_compute_sincos (x, sinx, cosx);
+ double a, da, xx;
+ unsigned int n;
+
+ /* If |x| < 105414350 use simple range reduction. */
+ n = k < 0x419921FB ? reduce_sincos (x, &a, &da) : __branred (x, &a, &da);
+ n = n & 3;
+
+ if (n == 1 || n == 2)
+ {
+ a = -a;
+ da = -da;
+ }
+
+ if (n & 1)
+ {
+ double *temp = cosx;
+ cosx = sinx;
+ sinx = temp;
+ }
+
+ *sinx = do_sin (a, da);
+ xx = do_cos (a, da);
+ *cosx = (n & 2) ? -xx : xx;
return;
}
@@ -106,8 +100,4 @@ __sincos (double x, double *sinx, double *cosx)
*sinx = *cosx = x / x;
}
-weak_alias (__sincos, sincos)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__sincos, __sincosl)
-weak_alias (__sincos, sincosl)
-#endif
+libm_alias_double (__sincos, sincos)
diff --git a/sysdeps/ieee754/dbl-64/s_tan.c b/sysdeps/ieee754/dbl-64/s_tan.c
index ccffdd62d7..04ff8b6717 100644
--- a/sysdeps/ieee754/dbl-64/s_tan.c
+++ b/sysdeps/ieee754/dbl-64/s_tan.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -41,6 +41,8 @@
#include "MathLib.h"
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
#include <fenv.h>
#include <stap-probe.h>
@@ -53,7 +55,7 @@ void __mptan (double, mp_no *, int);
double
SECTION
-tan (double x)
+__tan (double x)
{
#include "utan.h"
#include "utan.tbl"
@@ -843,6 +845,6 @@ tanMp (double x)
return y;
}
-#ifdef NO_LONG_DOUBLE
-weak_alias (tan, tanl)
+#ifndef __tan
+libm_alias_double (__tan, tan)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_tanh.c b/sysdeps/ieee754/dbl-64/s_tanh.c
index 344a2f0330..673a97102d 100644
--- a/sysdeps/ieee754/dbl-64/s_tanh.c
+++ b/sysdeps/ieee754/dbl-64/s_tanh.c
@@ -41,6 +41,8 @@ static char rcsid[] = "$NetBSD: s_tanh.c,v 1.7 1995/05/10 20:48:22 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
static const double one = 1.0, two = 2.0, tiny = 1.0e-300;
@@ -91,8 +93,4 @@ __tanh (double x)
}
return (jx >= 0) ? z : -z;
}
-weak_alias (__tanh, tanh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__tanh, __tanhl)
-weak_alias (__tanh, tanhl)
-#endif
+libm_alias_double (__tanh, tanh)
diff --git a/sysdeps/ieee754/dbl-64/s_totalorder.c b/sysdeps/ieee754/dbl-64/s_totalorder.c
new file mode 100644
index 0000000000..59092dceda
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_totalorder.c
@@ -0,0 +1,53 @@
+/* Total order operation. dbl-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.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);
+}
+libm_alias_double (__totalorder, totalorder)
diff --git a/sysdeps/ieee754/dbl-64/s_totalordermag.c b/sysdeps/ieee754/dbl-64/s_totalordermag.c
new file mode 100644
index 0000000000..3b45113962
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_totalordermag.c
@@ -0,0 +1,48 @@
+/* Total order operation on absolute values. dbl-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.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);
+}
+libm_alias_double (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/dbl-64/s_trunc.c b/sysdeps/ieee754/dbl-64/s_trunc.c
index f64e097f16..6ffabb410a 100644
--- a/sysdeps/ieee754/dbl-64/s_trunc.c
+++ b/sysdeps/ieee754/dbl-64/s_trunc.c
@@ -1,5 +1,5 @@
/* Truncate argument to nearest integral value not larger than the argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 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 <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
double
__trunc (double x)
{
int32_t i0, j0;
- u_int32_t i1;
+ uint32_t i1;
int sx;
EXTRACT_WORDS (i0, i1, x);
@@ -53,8 +54,6 @@ __trunc (double x)
return x;
}
-weak_alias (__trunc, trunc)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__trunc, __truncl)
-weak_alias (__trunc, truncl)
+#ifndef __trunc
+libm_alias_double (__trunc, trunc)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_ufromfp.c b/sysdeps/ieee754/dbl-64/s_ufromfp.c
new file mode 100644
index 0000000000..2532215981
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_ufromfp.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfp
+#include <s_fromfp_main.c>
+libm_alias_double (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/dbl-64/s_ufromfpx.c b/sysdeps/ieee754/dbl-64/s_ufromfpx.c
new file mode 100644
index 0000000000..0945dfce08
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_ufromfpx.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpx
+#include <s_fromfp_main.c>
+libm_alias_double (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/dbl-64/sincos32.c b/sysdeps/ieee754/dbl-64/sincos32.c
index ad43465f64..a8572910d2 100644
--- a/sysdeps/ieee754/dbl-64/sincos32.c
+++ b/sysdeps/ieee754/dbl-64/sincos32.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/sincos32.h b/sysdeps/ieee754/dbl-64/sincos32.h
index 5a5f2e223a..d4e72bd82a 100644
--- a/sysdeps/ieee754/dbl-64/sincos32.h
+++ b/sysdeps/ieee754/dbl-64/sincos32.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -25,7 +25,7 @@
/******************************************************************/
#ifndef SINCOS32_H
-#define SINCCOS32_H
+#define SINCOS32_H
#ifdef BIG_ENDI
static const number
diff --git a/sysdeps/ieee754/dbl-64/sincostab.c b/sysdeps/ieee754/dbl-64/sincostab.c
index cd88af7331..082ecad7f6 100644
--- a/sysdeps/ieee754/dbl-64/sincostab.c
+++ b/sysdeps/ieee754/dbl-64/sincostab.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/slowexp.c b/sysdeps/ieee754/dbl-64/slowexp.c
deleted file mode 100644
index b602262783..0000000000
--- a/sysdeps/ieee754/dbl-64/slowexp.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/**************************************************************************/
-/* MODULE_NAME:slowexp.c */
-/* */
-/* FUNCTION:slowexp */
-/* */
-/* FILES NEEDED:mpa.h */
-/* mpa.c mpexp.c */
-/* */
-/*Converting from double precision to Multi-precision and calculating */
-/* e^x */
-/**************************************************************************/
-#include <math_private.h>
-
-#include <stap-probe.h>
-
-#ifndef USE_LONG_DOUBLE_FOR_MP
-# include "mpa.h"
-void __mpexp (mp_no *x, mp_no *y, int p);
-#endif
-
-#ifndef SECTION
-# define SECTION
-#endif
-
-/*Converting from double precision to Multi-precision and calculating e^x */
-double
-SECTION
-__slowexp (double x)
-{
-#ifndef USE_LONG_DOUBLE_FOR_MP
- double w, z, res, eps = 3.0e-26;
- int p;
- mp_no mpx, mpy, mpz, mpw, mpeps, mpcor;
-
- /* Use the multiple precision __MPEXP function to compute the exponential
- First at 144 bits and if it is not accurate enough, at 768 bits. */
- p = 6;
- __dbl_mp (x, &mpx, p);
- __mpexp (&mpx, &mpy, p);
- __dbl_mp (eps, &mpeps, p);
- __mul (&mpeps, &mpy, &mpcor, p);
- __add (&mpy, &mpcor, &mpw, p);
- __sub (&mpy, &mpcor, &mpz, p);
- __mp_dbl (&mpw, &w, p);
- __mp_dbl (&mpz, &z, p);
- if (w == z)
- {
- /* Track how often we get to the slow exp code plus
- its input/output values. */
- LIBC_PROBE (slowexp_p6, 2, &x, &w);
- return w;
- }
- else
- {
- p = 32;
- __dbl_mp (x, &mpx, p);
- __mpexp (&mpx, &mpy, p);
- __mp_dbl (&mpy, &res, p);
-
- /* Track how often we get to the uber-slow exp code plus
- its input/output values. */
- LIBC_PROBE (slowexp_p32, 2, &x, &res);
- return res;
- }
-#else
- return (double) __ieee754_expl((long double)x);
-#endif
-}
diff --git a/sysdeps/ieee754/dbl-64/slowpow.c b/sysdeps/ieee754/dbl-64/slowpow.c
deleted file mode 100644
index 266910c979..0000000000
--- a/sysdeps/ieee754/dbl-64/slowpow.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/*************************************************************************/
-/* MODULE_NAME:slowpow.c */
-/* */
-/* FUNCTION:slowpow */
-/* */
-/*FILES NEEDED:mpa.h */
-/* mpa.c mpexp.c mplog.c halfulp.c */
-/* */
-/* Given two IEEE double machine numbers y,x , routine computes the */
-/* correctly rounded (to nearest) value of x^y. Result calculated by */
-/* multiplication (in halfulp.c) or if result isn't accurate enough */
-/* then routine converts x and y into multi-precision doubles and */
-/* calls to mpexp routine */
-/*************************************************************************/
-
-#include "mpa.h"
-#include <math_private.h>
-
-#include <stap-probe.h>
-
-#ifndef SECTION
-# define SECTION
-#endif
-
-void __mpexp (mp_no *x, mp_no *y, int p);
-void __mplog (mp_no *x, mp_no *y, int p);
-double ulog (double);
-double __halfulp (double x, double y);
-
-double
-SECTION
-__slowpow (double x, double y, double z)
-{
- double res, res1;
- mp_no mpx, mpy, mpz, mpw, mpp, mpr, mpr1;
- static const mp_no eps = {-3, {1.0, 4.0}};
- int p;
-
- /* __HALFULP returns -10 or X^Y. */
- res = __halfulp (x, y);
-
- /* Return if the result was computed by __HALFULP. */
- if (res >= 0)
- return res;
-
- /* Compute pow as long double. This is currently only used by powerpc, where
- one may get 106 bits of accuracy. */
-#ifdef USE_LONG_DOUBLE_FOR_MP
- long double ldw, ldz, ldpp;
- static const long double ldeps = 0x4.0p-96;
-
- ldz = __ieee754_logl ((long double) x);
- ldw = (long double) y *ldz;
- ldpp = __ieee754_expl (ldw);
- res = (double) (ldpp + ldeps);
- res1 = (double) (ldpp - ldeps);
-
- /* Return the result if it is accurate enough. */
- if (res == res1)
- return res;
-#endif
-
- /* Or else, calculate using multiple precision. P = 10 implies accuracy of
- 240 bits accuracy, since MP_NO has a radix of 2^24. */
- p = 10;
- __dbl_mp (x, &mpx, p);
- __dbl_mp (y, &mpy, p);
- __dbl_mp (z, &mpz, p);
-
- /* z = x ^ y
- log (z) = y * log (x)
- z = exp (y * log (x)) */
- __mplog (&mpx, &mpz, p);
- __mul (&mpy, &mpz, &mpw, p);
- __mpexp (&mpw, &mpp, p);
-
- /* Add and subtract EPS to ensure that the result remains unchanged, i.e. we
- have last bit accuracy. */
- __add (&mpp, &eps, &mpr, p);
- __mp_dbl (&mpr, &res, p);
- __sub (&mpp, &eps, &mpr1, p);
- __mp_dbl (&mpr1, &res1, p);
- if (res == res1)
- {
- /* Track how often we get to the slow pow code plus
- its input/output values. */
- LIBC_PROBE (slowpow_p10, 4, &x, &y, &z, &res);
- return res;
- }
-
- /* If we don't, then we repeat using a higher precision. 768 bits of
- precision ought to be enough for anybody. */
- p = 32;
- __dbl_mp (x, &mpx, p);
- __dbl_mp (y, &mpy, p);
- __dbl_mp (z, &mpz, p);
- __mplog (&mpx, &mpz, p);
- __mul (&mpy, &mpz, &mpw, p);
- __mpexp (&mpw, &mpp, p);
- __mp_dbl (&mpp, &res, p);
-
- /* Track how often we get to the uber-slow pow code plus
- its input/output values. */
- LIBC_PROBE (slowpow_p32, 4, &x, &y, &z, &res);
-
- return res;
-}
diff --git a/sysdeps/ieee754/dbl-64/t_exp.c b/sysdeps/ieee754/dbl-64/t_exp.c
index 3c921f1d3d..555c4ff01b 100644
--- a/sysdeps/ieee754/dbl-64/t_exp.c
+++ b/sysdeps/ieee754/dbl-64/t_exp.c
@@ -1,5 +1,5 @@
/* Accurate tables for exp().
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
diff --git a/sysdeps/ieee754/dbl-64/uasncs.h b/sysdeps/ieee754/dbl-64/uasncs.h
index e88bd1bf3e..e980fc5c55 100644
--- a/sysdeps/ieee754/dbl-64/uasncs.h
+++ b/sysdeps/ieee754/dbl-64/uasncs.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/uatan.tbl b/sysdeps/ieee754/dbl-64/uatan.tbl
index 979d65d8b2..3f0b2bff90 100644
--- a/sysdeps/ieee754/dbl-64/uatan.tbl
+++ b/sysdeps/ieee754/dbl-64/uatan.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/uexp.h b/sysdeps/ieee754/dbl-64/uexp.h
index eb7aa5f5fb..64ab2c8fca 100644
--- a/sysdeps/ieee754/dbl-64/uexp.h
+++ b/sysdeps/ieee754/dbl-64/uexp.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -29,8 +29,7 @@
#include "mydefs.h"
-const static double zero = 0.0, hhuge = 1.0e300, tiny = 1.0e-300,
-err_0 = 1.000014, err_1 = 0.000016;
+const static double zero = 0.0, hhuge = 1.0e300, tiny = 1.0e-300;
const static int4 bigint = 0x40862002,
badint = 0x40876000,smallint = 0x3C8fffff;
const static int4 hugeint = 0x7FFFFFFF, infint = 0x7ff00000;
diff --git a/sysdeps/ieee754/dbl-64/uexp.tbl b/sysdeps/ieee754/dbl-64/uexp.tbl
index 9abfc7ef71..b1eff5253e 100644
--- a/sysdeps/ieee754/dbl-64/uexp.tbl
+++ b/sysdeps/ieee754/dbl-64/uexp.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/ulog.h b/sysdeps/ieee754/dbl-64/ulog.h
index d507c693d8..087b76e2ab 100644
--- a/sysdeps/ieee754/dbl-64/ulog.h
+++ b/sysdeps/ieee754/dbl-64/ulog.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -42,43 +42,6 @@
/**/ b6 = {{0x3fbc71c5, 0x25db58ac} }, /* 0.111... */
/**/ b7 = {{0xbfb9a4ac, 0x11a2a61c} }, /* -0.100... */
/**/ b8 = {{0x3fb75077, 0x0df2b591} }, /* 0.091... */
- /* polynomial III */
-#if 0
-/**/ c1 = {{0x3ff00000, 0x00000000} }, /* 1 */
-#endif
-/**/ c2 = {{0xbfe00000, 0x00000000} }, /* -1/2 */
-/**/ c3 = {{0x3fd55555, 0x55555555} }, /* 1/3 */
-/**/ c4 = {{0xbfd00000, 0x00000000} }, /* -1/4 */
-/**/ c5 = {{0x3fc99999, 0x9999999a} }, /* 1/5 */
- /* polynomial IV */
-/**/ d2 = {{0xbfe00000, 0x00000000} }, /* -1/2 */
-/**/ dd2 = {{0x00000000, 0x00000000} }, /* -1/2-d2 */
-/**/ d3 = {{0x3fd55555, 0x55555555} }, /* 1/3 */
-/**/ dd3 = {{0x3c755555, 0x55555555} }, /* 1/3-d3 */
-/**/ d4 = {{0xbfd00000, 0x00000000} }, /* -1/4 */
-/**/ dd4 = {{0x00000000, 0x00000000} }, /* -1/4-d4 */
-/**/ d5 = {{0x3fc99999, 0x9999999a} }, /* 1/5 */
-/**/ dd5 = {{0xbc699999, 0x9999999a} }, /* 1/5-d5 */
-/**/ d6 = {{0xbfc55555, 0x55555555} }, /* -1/6 */
-/**/ dd6 = {{0xbc655555, 0x55555555} }, /* -1/6-d6 */
-/**/ d7 = {{0x3fc24924, 0x92492492} }, /* 1/7 */
-/**/ dd7 = {{0x3c624924, 0x92492492} }, /* 1/7-d7 */
-/**/ d8 = {{0xbfc00000, 0x00000000} }, /* -1/8 */
-/**/ dd8 = {{0x00000000, 0x00000000} }, /* -1/8-d8 */
-/**/ d9 = {{0x3fbc71c7, 0x1c71c71c} }, /* 1/9 */
-/**/ dd9 = {{0x3c5c71c7, 0x1c71c71c} }, /* 1/9-d9 */
-/**/ d10 = {{0xbfb99999, 0x9999999a} }, /* -1/10 */
-/**/ dd10 = {{0x3c599999, 0x9999999a} }, /* -1/10-d10 */
-/**/ d11 = {{0x3fb745d1, 0x745d1746} }, /* 1/11 */
-/**/ d12 = {{0xbfb55555, 0x55555555} }, /* -1/12 */
-/**/ d13 = {{0x3fb3b13b, 0x13b13b14} }, /* 1/13 */
-/**/ d14 = {{0xbfb24924, 0x92492492} }, /* -1/14 */
-/**/ d15 = {{0x3fb11111, 0x11111111} }, /* 1/15 */
-/**/ d16 = {{0xbfb00000, 0x00000000} }, /* -1/16 */
-/**/ d17 = {{0x3fae1e1e, 0x1e1e1e1e} }, /* 1/17 */
-/**/ d18 = {{0xbfac71c7, 0x1c71c71c} }, /* -1/18 */
-/**/ d19 = {{0x3faaf286, 0xbca1af28} }, /* 1/19 */
-/**/ d20 = {{0xbfa99999, 0x9999999a} }, /* -1/20 */
/* constants */
/**/ sqrt_2 = {{0x3ff6a09e, 0x667f3bcc} }, /* sqrt(2) */
/**/ h1 = {{0x3fd2e000, 0x00000000} }, /* 151/2**9 */
@@ -87,14 +50,6 @@
/**/ delv = {{0x3ef00000, 0x00000000} }, /* 1/2**16 */
/**/ ln2a = {{0x3fe62e42, 0xfefa3800} }, /* ln(2) 43 bits */
/**/ ln2b = {{0x3d2ef357, 0x93c76730} }, /* ln(2)-ln2a */
-/**/ e1 = {{0x3bbcc868, 0x00000000} }, /* 6.095e-21 */
-/**/ e2 = {{0x3c1138ce, 0x00000000} }, /* 2.334e-19 */
-/**/ e3 = {{0x3aa1565d, 0x00000000} }, /* 2.801e-26 */
-/**/ e4 = {{0x39809d88, 0x00000000} }, /* 1.024e-31 */
-/**/ e[M] ={{{0x37da223a, 0x00000000} }, /* 1.2e-39 */
-/**/ {{0x35c851c4, 0x00000000} }, /* 1.3e-49 */
-/**/ {{0x2ab85e51, 0x00000000} }, /* 6.8e-103 */
-/**/ {{0x17383827, 0x00000000} }},/* 8.1e-197 */
/**/ two54 = {{0x43500000, 0x00000000} }, /* 2**54 */
/**/ u03 = {{0x3f9eb851, 0xeb851eb8} }; /* 0.03 */
@@ -114,43 +69,6 @@
/**/ b6 = {{0x25db58ac, 0x3fbc71c5} }, /* 0.111... */
/**/ b7 = {{0x11a2a61c, 0xbfb9a4ac} }, /* -0.100... */
/**/ b8 = {{0x0df2b591, 0x3fb75077} }, /* 0.091... */
- /* polynomial III */
-#if 0
-/**/ c1 = {{0x00000000, 0x3ff00000} }, /* 1 */
-#endif
-/**/ c2 = {{0x00000000, 0xbfe00000} }, /* -1/2 */
-/**/ c3 = {{0x55555555, 0x3fd55555} }, /* 1/3 */
-/**/ c4 = {{0x00000000, 0xbfd00000} }, /* -1/4 */
-/**/ c5 = {{0x9999999a, 0x3fc99999} }, /* 1/5 */
- /* polynomial IV */
-/**/ d2 = {{0x00000000, 0xbfe00000} }, /* -1/2 */
-/**/ dd2 = {{0x00000000, 0x00000000} }, /* -1/2-d2 */
-/**/ d3 = {{0x55555555, 0x3fd55555} }, /* 1/3 */
-/**/ dd3 = {{0x55555555, 0x3c755555} }, /* 1/3-d3 */
-/**/ d4 = {{0x00000000, 0xbfd00000} }, /* -1/4 */
-/**/ dd4 = {{0x00000000, 0x00000000} }, /* -1/4-d4 */
-/**/ d5 = {{0x9999999a, 0x3fc99999} }, /* 1/5 */
-/**/ dd5 = {{0x9999999a, 0xbc699999} }, /* 1/5-d5 */
-/**/ d6 = {{0x55555555, 0xbfc55555} }, /* -1/6 */
-/**/ dd6 = {{0x55555555, 0xbc655555} }, /* -1/6-d6 */
-/**/ d7 = {{0x92492492, 0x3fc24924} }, /* 1/7 */
-/**/ dd7 = {{0x92492492, 0x3c624924} }, /* 1/7-d7 */
-/**/ d8 = {{0x00000000, 0xbfc00000} }, /* -1/8 */
-/**/ dd8 = {{0x00000000, 0x00000000} }, /* -1/8-d8 */
-/**/ d9 = {{0x1c71c71c, 0x3fbc71c7} }, /* 1/9 */
-/**/ dd9 = {{0x1c71c71c, 0x3c5c71c7} }, /* 1/9-d9 */
-/**/ d10 = {{0x9999999a, 0xbfb99999} }, /* -1/10 */
-/**/ dd10 = {{0x9999999a, 0x3c599999} }, /* -1/10-d10 */
-/**/ d11 = {{0x745d1746, 0x3fb745d1} }, /* 1/11 */
-/**/ d12 = {{0x55555555, 0xbfb55555} }, /* -1/12 */
-/**/ d13 = {{0x13b13b14, 0x3fb3b13b} }, /* 1/13 */
-/**/ d14 = {{0x92492492, 0xbfb24924} }, /* -1/14 */
-/**/ d15 = {{0x11111111, 0x3fb11111} }, /* 1/15 */
-/**/ d16 = {{0x00000000, 0xbfb00000} }, /* -1/16 */
-/**/ d17 = {{0x1e1e1e1e, 0x3fae1e1e} }, /* 1/17 */
-/**/ d18 = {{0x1c71c71c, 0xbfac71c7} }, /* -1/18 */
-/**/ d19 = {{0xbca1af28, 0x3faaf286} }, /* 1/19 */
-/**/ d20 = {{0x9999999a, 0xbfa99999} }, /* -1/20 */
/* constants */
/**/ sqrt_2 = {{0x667f3bcc, 0x3ff6a09e} }, /* sqrt(2) */
/**/ h1 = {{0x00000000, 0x3fd2e000} }, /* 151/2**9 */
@@ -159,14 +77,6 @@
/**/ delv = {{0x00000000, 0x3ef00000} }, /* 1/2**16 */
/**/ ln2a = {{0xfefa3800, 0x3fe62e42} }, /* ln(2) 43 bits */
/**/ ln2b = {{0x93c76730, 0x3d2ef357} }, /* ln(2)-ln2a */
-/**/ e1 = {{0x00000000, 0x3bbcc868} }, /* 6.095e-21 */
-/**/ e2 = {{0x00000000, 0x3c1138ce} }, /* 2.334e-19 */
-/**/ e3 = {{0x00000000, 0x3aa1565d} }, /* 2.801e-26 */
-/**/ e4 = {{0x00000000, 0x39809d88} }, /* 1.024e-31 */
-/**/ e[M] ={{{0x00000000, 0x37da223a} }, /* 1.2e-39 */
-/**/ {{0x00000000, 0x35c851c4} }, /* 1.3e-49 */
-/**/ {{0x00000000, 0x2ab85e51} }, /* 6.8e-103 */
-/**/ {{0x00000000, 0x17383827} }},/* 8.1e-197 */
/**/ two54 = {{0x00000000, 0x43500000} }, /* 2**54 */
/**/ u03 = {{0xeb851eb8, 0x3f9eb851} }; /* 0.03 */
@@ -178,10 +88,6 @@
#define DEL_V delv.d
#define LN2A ln2a.d
#define LN2B ln2b.d
-#define E1 e1.d
-#define E2 e2.d
-#define E3 e3.d
-#define E4 e4.d
#define U03 u03.d
#endif
diff --git a/sysdeps/ieee754/dbl-64/ulog.tbl b/sysdeps/ieee754/dbl-64/ulog.tbl
index dd92cbb886..93fa1b36d3 100644
--- a/sysdeps/ieee754/dbl-64/ulog.tbl
+++ b/sysdeps/ieee754/dbl-64/ulog.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/upow.h b/sysdeps/ieee754/dbl-64/upow.h
index dd9ba32b71..c1b9d8e3cc 100644
--- a/sysdeps/ieee754/dbl-64/upow.h
+++ b/sysdeps/ieee754/dbl-64/upow.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/upow.tbl b/sysdeps/ieee754/dbl-64/upow.tbl
index 55d878edad..c1ad333583 100644
--- a/sysdeps/ieee754/dbl-64/upow.tbl
+++ b/sysdeps/ieee754/dbl-64/upow.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/urem.h b/sysdeps/ieee754/dbl-64/urem.h
index 42b26273fd..c810791a1c 100644
--- a/sysdeps/ieee754/dbl-64/urem.h
+++ b/sysdeps/ieee754/dbl-64/urem.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/usncs.h b/sysdeps/ieee754/dbl-64/usncs.h
index 1408695c85..97d1418a23 100644
--- a/sysdeps/ieee754/dbl-64/usncs.h
+++ b/sysdeps/ieee754/dbl-64/usncs.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/utan.h b/sysdeps/ieee754/dbl-64/utan.h
index 0a99812754..d619d0004b 100644
--- a/sysdeps/ieee754/dbl-64/utan.h
+++ b/sysdeps/ieee754/dbl-64/utan.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/utan.tbl b/sysdeps/ieee754/dbl-64/utan.tbl
index 8a8c2afa53..92163ec3e8 100644
--- a/sysdeps/ieee754/dbl-64/utan.tbl
+++ b/sysdeps/ieee754/dbl-64/utan.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/w_exp.c b/sysdeps/ieee754/dbl-64/w_exp.c
deleted file mode 100644
index 595ed992d2..0000000000
--- a/sysdeps/ieee754/dbl-64/w_exp.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <math_private.h>
-
-/* wrapper exp */
-double
-__exp (double x)
-{
- double z = __ieee754_exp (x);
- if (__builtin_expect (!isfinite (z) || z == 0, 0)
- && isfinite (x) && _LIB_VERSION != _IEEE_)
- return __kernel_standard (x, x, 6 + !!signbit (x));
-
- return z;
-}
-hidden_def (__exp)
-weak_alias (__exp, exp)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__exp, __expl)
-weak_alias (__exp, expl)
-#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
index ccccdaf106..0af05a0222 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
@@ -51,13 +51,13 @@ __ieee754_acosh (double x)
/* 2**28 > x > 2 */
double t = x * x;
- return __ieee754_log (2.0 * x - one / (x + __ieee754_sqrt (t - one)));
+ return __ieee754_log (2.0 * x - one / (x + sqrt (t - one)));
}
else if (__glibc_likely (hx > INT64_C (0x3ff0000000000000)))
{
/* 1<x<2 */
double t = x - one;
- return __log1p (t + __ieee754_sqrt (2.0 * t + t * t));
+ return __log1p (t + sqrt (2.0 * t + t * t));
}
else if (__glibc_likely (hx == INT64_C (0x3ff0000000000000)))
return 0.0; /* acosh(1) = 0 */
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
index 4f5a81669e..cd5567182f 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
@@ -65,7 +65,7 @@ __ieee754_log10 (double x)
if (hx < INT64_C(0x0010000000000000))
{ /* x < 2**-1022 */
if (__glibc_unlikely ((hx & UINT64_C(0x7fffffffffffffff)) == 0))
- return -two54 / (x - x); /* log(+-0)=-inf */
+ return -two54 / fabs (x); /* log(+-0)=-inf */
if (__glibc_unlikely (hx < 0))
return (x - x) / (x - x); /* log(-#) = NaN */
k -= 54;
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
index 5ccb78cf03..f08d5b337d 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
@@ -81,7 +81,7 @@ __ieee754_log2 (double x)
if (hx < INT64_C(0x0010000000000000))
{ /* x < 2**-1022 */
if (__glibc_unlikely ((hx & UINT64_C(0x7fffffffffffffff)) == 0))
- return -two54 / (x - x); /* log(+-0)=-inf */
+ return -two54 / fabs (x); /* log(+-0)=-inf */
if (__glibc_unlikely (hx < 0))
return (x - x) / (x - x); /* log(-#) = NaN */
k -= 54;
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
index c687525d4b..b99829d2b0 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
@@ -15,14 +15,11 @@
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to ceil(x).
*/
#include <math.h>
#include <math_private.h>
-
-static const double huge = 1.0e300;
+#include <libm-alias-double.h>
double
__ceil(double x)
@@ -32,14 +29,13 @@ __ceil(double x)
EXTRACT_WORDS64(i0,x);
j0 = ((i0>>52)&0x7ff)-0x3ff;
if(j0<=51) {
- if(j0<0) { /* raise inexact if x != 0 */
- math_force_eval(huge+x);/* return 0*sign(x) if |x|<1 */
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
if(i0<0) {i0=INT64_C(0x8000000000000000);}
else if(i0!=0) { i0=INT64_C(0x3ff0000000000000);}
} else {
i = INT64_C(0x000fffffffffffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
- math_force_eval(huge+x); /* raise inexact flag */
if(i0>0) i0 += UINT64_C(0x0010000000000000)>>j0;
i0 &= (~i);
}
@@ -51,9 +47,5 @@ __ceil(double x)
return x;
}
#ifndef __ceil
-weak_alias (__ceil, ceil)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__ceil, __ceill)
-weak_alias (__ceil, ceill)
-# endif
+libm_alias_double (__ceil, ceil)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
index ef51608f6e..40676924fe 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
@@ -16,6 +16,7 @@
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
#include <stdint.h>
@@ -30,7 +31,7 @@ __finite(double x)
hidden_def (__finite)
weak_alias (__finite, finite)
#ifdef NO_LONG_DOUBLE
-# ifdef LDBL_CLASSIFY_COMPAT
+# if LDBL_CLASSIFY_COMPAT
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
# endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c
index b7ed14bfa2..f7e0a77ec3 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c
@@ -1,5 +1,5 @@
/* Round double to integer away from zero.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 2011.
@@ -33,18 +33,15 @@
#include <math.h>
#include <math_private.h>
#include <stdint.h>
+#include <libm-alias-double.h>
/*
* floor(x)
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floor(x).
*/
-static const double huge = 1.0e300;
-
double
__floor (double x)
@@ -53,15 +50,14 @@ __floor (double x)
EXTRACT_WORDS64(i0,x);
int32_t j0 = ((i0>>52)&0x7ff)-0x3ff;
if(__builtin_expect(j0<52, 1)) {
- if(j0<0) { /* raise inexact if x != 0 */
- math_force_eval(huge+x);/* return 0*sign(x) if |x|<1 */
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
if(i0>=0) {i0=0;}
else if((i0&0x7fffffffffffffffl)!=0)
{ i0=0xbff0000000000000l;}
} else {
uint64_t i = (0x000fffffffffffffl)>>j0;
if((i0&i)==0) return x; /* x is integral */
- math_force_eval(huge+x); /* raise inexact flag */
if(i0<0) i0 += (0x0010000000000000l)>>j0;
i0 &= (~i);
}
@@ -71,9 +67,5 @@ __floor (double x)
return x;
}
#ifndef __floor
-weak_alias (__floor, floor)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__floor, __floorl)
-weak_alias (__floor, floorl)
-# endif
+libm_alias_double (__floor, floor)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c
index 42068f8187..c73434f5f3 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -19,6 +19,7 @@
#include <inttypes.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
/*
* for non-zero, finite x
@@ -55,12 +56,11 @@ __frexp (double x, int *eptr)
ix = (ix & INT64_C (0x800fffffffffffff)) | INT64_C (0x3fe0000000000000);
INSERT_WORDS64 (x, ix);
}
+ else
+ /* Quiet signaling NaNs. */
+ x += x;
*eptr = e;
return x;
}
-weak_alias (__frexp, frexp)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__frexp, __frexpl)
-weak_alias (__frexp, frexpl)
-#endif
+libm_alias_double (__frexp, frexp)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c
new file mode 100644
index 0000000000..1103ef2ed9
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c
@@ -0,0 +1,32 @@
+/* Get NaN payload. dbl-64/wordsize-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+double
+__getpayload (const double *x)
+{
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, *x);
+ ix &= 0x7ffffffffffffULL;
+ return (double) ix;
+}
+libm_alias_double (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c
index 951fb73239..2b427a8b4c 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c
@@ -11,6 +11,7 @@
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
int
@@ -26,7 +27,7 @@ __isinf (double x)
hidden_def (__isinf)
weak_alias (__isinf, isinf)
#ifdef NO_LONG_DOUBLE
-# if defined LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
+# if LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
# endif
weak_alias (__isinf, isinfl)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
index bcff9e3b67..cd805d157b 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
@@ -17,6 +17,7 @@
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
#include <stdint.h>
@@ -32,7 +33,7 @@ int __isnan(double x)
hidden_def (__isnan)
weak_alias (__isnan, isnan)
#ifdef NO_LONG_DOUBLE
-# if defined LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
+# if LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
# endif
weak_alias (__isnan, isnanl)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
index c22e608c6e..63ef5ca7d8 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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;
+ uint64_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_llround.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
index 73ddd8dd9f..e3b18eb893 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
@@ -1,5 +1,5 @@
/* Round double value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -24,6 +24,7 @@
#include <sysdep.h>
#include <math_private.h>
+#include <libm-alias-double.h>
long long int
@@ -63,20 +64,12 @@ __llround (double x)
return sign * result;
}
-weak_alias (__llround, llround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __llroundl)
-weak_alias (__llround, llroundl)
-#endif
+libm_alias_double (__llround, llround)
/* long has the same width as long long on LP64 machines, so use an alias. */
#undef lround
#undef __lround
#ifdef _LP64
strong_alias (__llround, __lround)
-weak_alias (__llround, lround)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __lroundl)
-weak_alias (__llround, lroundl)
-# endif
+libm_alias_double (__lround, lround)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
index c7846054a6..c7fa8169c5 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
@@ -1,5 +1,5 @@
/* Compute radix independent exponent.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
double
@@ -41,8 +42,6 @@ __logb (double x)
}
return (double) (ex - 1023);
}
-weak_alias (__logb, logb)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__logb, __logbl)
-weak_alias (__logb, logbl)
+#ifndef __logb
+libm_alias_double (__logb, logb)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c
index 9e665b01ec..a88c6c8788 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c
@@ -1,5 +1,5 @@
/* Round double value to long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
/* For LP64, lround is an alias for llround. */
#ifndef _LP64
@@ -80,10 +81,6 @@ __lround (double x)
return sign * result;
}
-weak_alias (__lround, lround)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__lround, __lroundl)
-weak_alias (__lround, lroundl)
-# endif
+libm_alias_double (__lround, lround)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
index c309e56272..8d14e78ef0 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <stdint.h>
static const double one = 1.0;
@@ -59,8 +60,6 @@ __modf(double x, double *iptr)
return x;
}
}
-weak_alias (__modf, modf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__modf, __modfl)
-weak_alias (__modf, modfl)
+#ifndef __modf
+libm_alias_double (__modf, modf)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
index 8293819981..a4a081724e 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
@@ -22,7 +22,9 @@
#include <fenv.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double
TWO52[2]={
@@ -42,9 +44,9 @@ __nearbyint(double x)
if(__builtin_expect(j0<52, 1)) {
if(j0<0) {
libc_feholdexcept (&env);
- double w = TWO52[sx]+x;
+ double w = TWO52[sx] + math_opt_barrier (x);
double t = w-TWO52[sx];
- math_opt_barrier(t);
+ math_force_eval (t);
libc_fesetenv (&env);
return __copysign (t, x);
}
@@ -53,14 +55,10 @@ __nearbyint(double x)
else return x; /* x is integral */
}
libc_feholdexcept (&env);
- double w = TWO52[sx]+x;
+ double w = TWO52[sx] + math_opt_barrier (x);
double t = w-TWO52[sx];
- math_opt_barrier (t);
+ math_force_eval (t);
libc_fesetenv (&env);
return t;
}
-weak_alias (__nearbyint, nearbyint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__nearbyint, __nearbyintl)
-weak_alias (__nearbyint, nearbyintl)
-#endif
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c
index 716e07e54d..bbfb1195ac 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <stdint.h>
static const double zero = 0.0;
@@ -107,8 +108,4 @@ __remquo (double x, double y, int *quo)
x = -x;
return x;
}
-weak_alias (__remquo, remquo)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__remquo, __remquol)
-weak_alias (__remquo, remquol)
-#endif
+libm_alias_double (__remquo, remquo)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
index 87b2339d43..622e479c5f 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
@@ -21,6 +21,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double
TWO52[2]={
@@ -52,9 +53,5 @@ __rint(double x)
return w-TWO52[sx];
}
#ifndef __rint
-weak_alias (__rint, rint)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
-# endif
+libm_alias_double (__rint, rint)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c
index f1d75bbe68..3323621ce3 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c
@@ -1,5 +1,5 @@
/* Round double to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,10 +20,9 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <stdint.h>
-static const double huge = 1.0e300;
-
double
__round (double x)
@@ -36,8 +35,6 @@ __round (double x)
{
if (j0 < 0)
{
- math_force_eval (huge + x);
-
i0 &= UINT64_C(0x8000000000000000);
if (j0 == -1)
i0 |= UINT64_C(0x3ff0000000000000);
@@ -48,9 +45,7 @@ __round (double x)
if ((i0 & i) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
- /* Raise inexact if x != 0. */
i0 += UINT64_C(0x0008000000000000) >> j0;
i0 &= ~i;
}
@@ -67,8 +62,4 @@ __round (double x)
INSERT_WORDS64 (x, i0);
return x;
}
-weak_alias (__round, round)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__round, __roundl)
-weak_alias (__round, roundl)
-#endif
+libm_alias_double (__round, round)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c
new file mode 100644
index 0000000000..7bbbb2dc20
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c
@@ -0,0 +1,71 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ dbl-64/wordsize-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+#define BIAS 0x3ff
+#define MANT_DIG 53
+#define MAX_EXP (2 * BIAS + 1)
+
+double
+__roundeven (double x)
+{
+ uint64_t ix, ux;
+ EXTRACT_WORDS64 (ix, x);
+ ux = ix & 0x7fffffffffffffffULL;
+ int exponent = ux >> (MANT_DIG - 1);
+ if (exponent >= BIAS + MANT_DIG - 1)
+ {
+ /* Integer, infinity or NaN. */
+ if (exponent == MAX_EXP)
+ /* Infinity or NaN; quiet signaling NaNs. */
+ return x + x;
+ else
+ return x;
+ }
+ else if (exponent >= BIAS)
+ {
+ /* At least 1; not necessarily an integer. Locate the bits with
+ exponents 0 and -1 (when the unbiased exponent is 0, the bit
+ with exponent 0 is implicit, but as the bias is odd it is OK
+ to take it from the low bit of the exponent). */
+ int int_pos = (BIAS + MANT_DIG - 1) - exponent;
+ int half_pos = int_pos - 1;
+ uint64_t half_bit = 1ULL << half_pos;
+ uint64_t int_bit = 1ULL << int_pos;
+ if ((ix & (int_bit | (half_bit - 1))) != 0)
+ /* Carry into the exponent works correctly. No need to test
+ whether HALF_BIT is set. */
+ ix += half_bit;
+ ix &= ~(int_bit - 1);
+ }
+ else if (exponent == BIAS - 1 && ux > 0x3fe0000000000000ULL)
+ /* Interval (0.5, 1). */
+ ix = (ix & 0x8000000000000000ULL) | 0x3ff0000000000000ULL;
+ else
+ /* Rounds to 0. */
+ ix &= 0x8000000000000000ULL;
+ INSERT_WORDS64 (x, ix);
+ return x;
+}
+hidden_def (__roundeven)
+libm_alias_double (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_setpayload_main.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_setpayload_main.c
new file mode 100644
index 0000000000..6af92d7fe2
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_setpayload_main.c
@@ -0,0 +1,54 @@
+/* Set NaN payload. dbl-64/wordsize-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3ff
+#define PAYLOAD_DIG 51
+#define EXPLICIT_MANT_DIG 52
+
+int
+FUNC (double *x, double payload)
+{
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, payload);
+ int exponent = ix >> EXPLICIT_MANT_DIG;
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. */
+ if (exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && ix == 0))
+ || (ix & ((1ULL << (BIAS + EXPLICIT_MANT_DIG - exponent)) - 1)) != 0)
+ {
+ INSERT_WORDS64 (*x, 0);
+ return 1;
+ }
+ if (ix != 0)
+ {
+ ix &= (1ULL << EXPLICIT_MANT_DIG) - 1;
+ ix |= 1ULL << EXPLICIT_MANT_DIG;
+ ix >>= BIAS + EXPLICIT_MANT_DIG - exponent;
+ }
+ ix |= 0x7ff0000000000000ULL | (SET_HIGH_BIT ? 0x8000000000000ULL : 0);
+ INSERT_WORDS64 (*x, ix);
+ return 0;
+}
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..c235e55c20
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c
@@ -0,0 +1,49 @@
+/* Total order operation. dbl-64/wordsize-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.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;
+}
+libm_alias_double (__totalorder, totalorder)
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..6da4f118a3
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c
@@ -0,0 +1,46 @@
+/* Total order operation on absolute values. dbl-64/wordsize-64 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-double.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;
+}
+libm_alias_double (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
index 81ac55e2f6..19a09b894e 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
@@ -1,5 +1,5 @@
/* Truncate argument to nearest integral value not larger than the argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
double
@@ -48,8 +49,6 @@ __trunc (double x)
return x;
}
-weak_alias (__trunc, trunc)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__trunc, __truncl)
-weak_alias (__trunc, truncl)
+#ifndef __trunc
+libm_alias_double (__trunc, trunc)
#endif
diff --git a/sysdeps/ieee754/dbl-64/x2y2m1.c b/sysdeps/ieee754/dbl-64/x2y2m1.c
index 96078888a7..aa0d9703fa 100644
--- a/sysdeps/ieee754/dbl-64/x2y2m1.c
+++ b/sysdeps/ieee754/dbl-64/x2y2m1.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/dbl-64/x2y2m1f.c b/sysdeps/ieee754/dbl-64/x2y2m1f.c
index 480b4c0c67..a61dc4185f 100644
--- a/sysdeps/ieee754/dbl-64/x2y2m1f.c
+++ b/sysdeps/ieee754/dbl-64/x2y2m1f.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/float128/Makeconfig b/sysdeps/ieee754/float128/Makeconfig
new file mode 100644
index 0000000000..a493ff1d41
--- /dev/null
+++ b/sysdeps/ieee754/float128/Makeconfig
@@ -0,0 +1,4 @@
+# Include this earlier so it can be used earlier in Makefiles,
+# and sysdep/ makefiles.
+float128-fcts = yes
+float64x-alias-fcts = yes
diff --git a/sysdeps/ieee754/float128/Makefile b/sysdeps/ieee754/float128/Makefile
new file mode 100644
index 0000000000..571a841809
--- /dev/null
+++ b/sysdeps/ieee754/float128/Makefile
@@ -0,0 +1,12 @@
+ifeq ($(subdir),stdlib)
+routines += float1282mpn strfromf128
+routines += strtof128 strtof128_l strtof128_nan mpn2float128
+
+# 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-strfromf128.c += $(libio-mtsafe)
+endif
+
+ifeq ($(subdir),wcsmbs)
+routines += wcstof128_l wcstof128 wcstof128_nan
+endif
diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
new file mode 100644
index 0000000000..2eebc6f1b0
--- /dev/null
+++ b/sysdeps/ieee754/float128/Versions
@@ -0,0 +1,51 @@
+%include <float128-abi.h>
+%ifndef FLOAT128_VERSION
+% error "float128-abi.h must define FLOAT128_VERSION"
+%endif
+libc {
+ FLOAT128_VERSION {
+ __strtof128_internal;
+ __wcstof128_internal;
+ }
+ GLIBC_PRIVATE {
+ # For __nanf128.
+ __strtof128_nan;
+ }
+}
+libm {
+ FLOAT128_VERSION {
+ __acosf128_finite;
+ __acoshf128_finite;
+ __asinf128_finite;
+ __atan2f128_finite;
+ __atanhf128_finite;
+ __coshf128_finite;
+ __exp10f128_finite;
+ __exp2f128_finite;
+ __expf128_finite;
+ __finitef128;
+ __fmodf128_finite;
+ __fpclassifyf128;
+ __gammaf128_r_finite;
+ __hypotf128_finite;
+ __iseqsigf128;
+ __isinff128;
+ __isnanf128;
+ __issignalingf128;
+ __j0f128_finite;
+ __j1f128_finite;
+ __jnf128_finite;
+ __lgammaf128_r_finite;
+ __log10f128_finite;
+ __log2f128_finite;
+ __logf128_finite;
+ __powf128_finite;
+ __remainderf128_finite;
+ __signbitf128;
+ __sinhf128_finite;
+ __sqrtf128_finite;
+ __y0f128_finite;
+ __y1f128_finite;
+ __ynf128_finite;
+ }
+}
diff --git a/sysdeps/ieee754/float128/e_acosf128.c b/sysdeps/ieee754/float128/e_acosf128.c
new file mode 100644
index 0000000000..7ddf7dcdf1
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_acosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_acosl.c"
diff --git a/sysdeps/ieee754/float128/e_acoshf128.c b/sysdeps/ieee754/float128/e_acoshf128.c
new file mode 100644
index 0000000000..f6dd40cd88
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_acoshf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_acoshl.c"
diff --git a/sysdeps/ieee754/float128/e_asinf128.c b/sysdeps/ieee754/float128/e_asinf128.c
new file mode 100644
index 0000000000..133ab8d875
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_asinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_asinl.c"
diff --git a/sysdeps/ieee754/float128/e_atan2f128.c b/sysdeps/ieee754/float128/e_atan2f128.c
new file mode 100644
index 0000000000..9aa740f770
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_atan2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_atan2l.c"
diff --git a/sysdeps/ieee754/float128/e_atanhf128.c b/sysdeps/ieee754/float128/e_atanhf128.c
new file mode 100644
index 0000000000..f26c8d54d2
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_atanhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_atanhl.c"
diff --git a/sysdeps/ieee754/float128/e_coshf128.c b/sysdeps/ieee754/float128/e_coshf128.c
new file mode 100644
index 0000000000..2abf067f64
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_coshf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_coshl.c"
diff --git a/sysdeps/ieee754/float128/e_exp10f128.c b/sysdeps/ieee754/float128/e_exp10f128.c
new file mode 100644
index 0000000000..b3468d256b
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_exp10f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_exp10l.c"
diff --git a/sysdeps/ieee754/float128/e_expf128.c b/sysdeps/ieee754/float128/e_expf128.c
new file mode 100644
index 0000000000..b727b17cc9
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_expf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_expl.c"
diff --git a/sysdeps/ieee754/float128/e_fmodf128.c b/sysdeps/ieee754/float128/e_fmodf128.c
new file mode 100644
index 0000000000..ed8a7491ed
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_fmodf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_fmodl.c"
diff --git a/sysdeps/ieee754/float128/e_gammaf128_r.c b/sysdeps/ieee754/float128/e_gammaf128_r.c
new file mode 100644
index 0000000000..895ac6374d
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_gammaf128_r.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_gammal_r.c"
diff --git a/sysdeps/ieee754/float128/e_hypotf128.c b/sysdeps/ieee754/float128/e_hypotf128.c
new file mode 100644
index 0000000000..1f06555505
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_hypotf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_hypotl.c"
diff --git a/sysdeps/ieee754/float128/e_ilogbf128.c b/sysdeps/ieee754/float128/e_ilogbf128.c
new file mode 100644
index 0000000000..2861801854
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_ilogbf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_ilogbl.c"
diff --git a/sysdeps/ieee754/float128/e_j0f128.c b/sysdeps/ieee754/float128/e_j0f128.c
new file mode 100644
index 0000000000..b624b5c596
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_j0f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_j0l.c"
diff --git a/sysdeps/ieee754/float128/e_j1f128.c b/sysdeps/ieee754/float128/e_j1f128.c
new file mode 100644
index 0000000000..445428e742
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_j1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_j1l.c"
diff --git a/sysdeps/ieee754/float128/e_jnf128.c b/sysdeps/ieee754/float128/e_jnf128.c
new file mode 100644
index 0000000000..7854e11a1a
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_jnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_jnl.c"
diff --git a/sysdeps/ieee754/float128/e_lgammaf128_r.c b/sysdeps/ieee754/float128/e_lgammaf128_r.c
new file mode 100644
index 0000000000..3517ac32af
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_lgammaf128_r.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_lgammal_r.c"
diff --git a/sysdeps/ieee754/float128/e_log10f128.c b/sysdeps/ieee754/float128/e_log10f128.c
new file mode 100644
index 0000000000..1c3341e412
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_log10f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_log10l.c"
diff --git a/sysdeps/ieee754/float128/e_log2f128.c b/sysdeps/ieee754/float128/e_log2f128.c
new file mode 100644
index 0000000000..36becaadc4
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_log2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_log2l.c"
diff --git a/sysdeps/ieee754/float128/e_logf128.c b/sysdeps/ieee754/float128/e_logf128.c
new file mode 100644
index 0000000000..b0c9975caf
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_logf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_logl.c"
diff --git a/sysdeps/ieee754/float128/e_powf128.c b/sysdeps/ieee754/float128/e_powf128.c
new file mode 100644
index 0000000000..3afaf7f6a6
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_powf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_powl.c"
diff --git a/sysdeps/ieee754/float128/e_rem_pio2f128.c b/sysdeps/ieee754/float128/e_rem_pio2f128.c
new file mode 100644
index 0000000000..86c2ca1024
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_rem_pio2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_rem_pio2l.c"
diff --git a/sysdeps/ieee754/float128/e_remainderf128.c b/sysdeps/ieee754/float128/e_remainderf128.c
new file mode 100644
index 0000000000..90c18f8493
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_remainderf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_remainderl.c"
diff --git a/sysdeps/ieee754/float128/e_scalbf128.c b/sysdeps/ieee754/float128/e_scalbf128.c
new file mode 100644
index 0000000000..067b724164
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_scalbf128.c
@@ -0,0 +1 @@
+/* Not defined for _FloatN types. */
diff --git a/sysdeps/ieee754/float128/e_sinhf128.c b/sysdeps/ieee754/float128/e_sinhf128.c
new file mode 100644
index 0000000000..42a54e0015
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_sinhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_sinhl.c"
diff --git a/sysdeps/ieee754/float128/float1282mpn.c b/sysdeps/ieee754/float128/float1282mpn.c
new file mode 100644
index 0000000000..49e8972221
--- /dev/null
+++ b/sysdeps/ieee754/float128/float1282mpn.c
@@ -0,0 +1,20 @@
+/* Convert a _Float128 type to multiprecision.
+ Copyright (C) 2017-2018 Free Software 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 <float128_private.h>
+#include "../ldbl-128/ldbl2mpn.c"
diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h
new file mode 100644
index 0000000000..9dd15601e6
--- /dev/null
+++ b/sysdeps/ieee754/float128/float128_private.h
@@ -0,0 +1,366 @@
+/* _Float128 overrides for building ldbl-128 as _Float128.
+ Copyright (C) 2017-2018 Free Software 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 must be included before the function renames below. */
+#include <gmp.h>
+#include <math.h>
+#undef HUGE_VALL
+#define HUGE_VALL HUGE_VAL_F128
+#include <math/mul_splitl.h>
+
+/* This must be included before the renames of types and macros from
+ it. */
+#include <ieee754.h>
+
+/* Renames derived from math_private.h. */
+#include <math_private.h>
+#include <ieee754_float128.h>
+#define ieee854_long_double_shape_type ieee854_float128_shape_type
+#define ieee854_long_double ieee854_float128
+
+#undef GET_LDOUBLE_LSW64
+#undef GET_LDOUBLE_MSW64
+#undef GET_LDOUBLE_WORDS64
+#undef SET_LDOUBLE_LSW64
+#undef SET_LDOUBLE_MSW64
+#undef SET_LDOUBLE_WORDS64
+#define GET_LDOUBLE_LSW64(x,y) GET_FLOAT128_LSW64 (x, y)
+#define GET_LDOUBLE_MSW64(x,y) GET_FLOAT128_MSW64 (x, y)
+#define GET_LDOUBLE_WORDS64(x,y,z) GET_FLOAT128_WORDS64 (x, y, z)
+#define SET_LDOUBLE_LSW64(x,y) SET_FLOAT128_LSW64 (x, y)
+#define SET_LDOUBLE_MSW64(x,y) SET_FLOAT128_MSW64 (x, y)
+#define SET_LDOUBLE_WORDS64(x,y,z) SET_FLOAT128_WORDS64 (x, y, z)
+
+#undef IEEE854_LONG_DOUBLE_BIAS
+#define IEEE854_LONG_DOUBLE_BIAS IEEE854_FLOAT128_BIAS
+
+#ifdef SET_RESTORE_ROUNDF128
+# undef SET_RESTORE_ROUNDL
+# define SET_RESTORE_ROUNDL(RM) SET_RESTORE_ROUNDF128 (RM)
+#endif
+
+#ifdef libc_feholdexcept_setroundf128
+# undef libc_feholdexcept_setroundl
+# define libc_feholdexcept_setroundl(ENV, RM) \
+ libc_feholdexcept_setroundf128 (ENV, RM)
+#endif
+
+#ifdef libc_feupdateenv_testf128
+# undef libc_feupdateenv_testl
+# define libc_feupdateenv_testl(ENV, EX) libc_feupdateenv_testf128 (ENV, EX)
+#endif
+
+/* misc macros from the header below. */
+#include <fix-fp-int-convert-overflow.h>
+#undef FIX_LDBL_LONG_CONVERT_OVERFLOW
+#undef FIX_LDBL_LLONG_CONVERT_OVERFLOW
+#define FIX_LDBL_LONG_CONVERT_OVERFLOW FIX_FLT128_LONG_CONVERT_OVERFLOW
+#define FIX_LDBL_LLONG_CONVERT_OVERFLOW FIX_FLT128_LLONG_CONVERT_OVERFLOW
+
+
+/* float.h constants. */
+#include <float.h>
+#undef LDBL_DIG
+#undef LDBL_EPSILON
+#undef LDBL_MANT_DIG
+#undef LDBL_MAX
+#undef LDBL_MAX_10_EXP
+#undef LDBL_MAX_EXP
+#undef LDBL_MIN
+#undef LDBL_MIN_10_EXP
+#undef LDBL_MIN_EXP
+#undef LDBL_TRUE_MIN
+#define LDBL_DIG FLT128_DIG
+#define LDBL_EPSILON FLT128_EPSILON
+#define LDBL_MANT_DIG FLT128_MANT_DIG
+#define LDBL_MAX FLT128_MAX
+#define LDBL_MAX_10_EXP FLT128_MAX_10_EXP
+#define LDBL_MAX_EXP FLT128_MAX_EXP
+#define LDBL_MIN FLT128_MIN
+#define LDBL_MIN_10_EXP FLT128_MIN_10_EXP
+#define LDBL_MIN_EXP FLT128_MIN_EXP
+#define LDBL_TRUE_MIN FLT128_TRUE_MIN
+
+
+/* math.h GNU constants. */
+#undef M_El
+#undef M_LOG2El
+#undef M_LOG10El
+#undef M_LN2l
+#undef M_LN10l
+#undef M_PIl
+#undef M_PI_2l
+#undef M_PI_4l
+#undef M_1_PIl
+#undef M_2_PIl
+#undef M_2_SQRTPIl
+#undef M_SQRT2l
+#undef M_SQRT1_2l
+#define M_El M_Ef128
+#define M_LOG2El M_LOG2Ef128
+#define M_LOG10El M_LOG10Ef128
+#define M_LN2l M_LN2f128
+#define M_LN10l M_LN10f128
+#define M_PIl M_PIf128
+#define M_PI_2l M_PI_2f128
+#define M_PI_4l M_PI_4f128
+#define M_1_PIl M_1_PIf128
+#define M_2_PIl M_2_PIf128
+#define M_2_SQRTPIl M_2_SQRTPIf128
+#define M_SQRT2l M_SQRT2f128
+#define M_SQRT1_2l M_SQRT1_2f128
+
+
+#include <libm-alias-ldouble.h>
+#include <libm-alias-float128.h>
+#undef libm_alias_ldouble_r
+#define libm_alias_ldouble_r(from, to, r) libm_alias_float128_r (from, to, r)
+
+
+#include <math/math-narrow.h>
+#undef libm_alias_float_ldouble
+#define libm_alias_float_ldouble(func) libm_alias_float32_float128 (func)
+#undef libm_alias_double_ldouble
+#define libm_alias_double_ldouble(func) libm_alias_float64_float128 (func)
+
+
+/* IEEE function renames. */
+#define __ieee754_acoshl __ieee754_acoshf128
+#define __ieee754_acosl __ieee754_acosf128
+#define __ieee754_asinhl __ieee754_asinhf128
+#define __ieee754_asinl __ieee754_asinf128
+#define __ieee754_atan2l __ieee754_atan2f128
+#define __ieee754_atanhl __ieee754_atanhf128
+#define __ieee754_coshl __ieee754_coshf128
+#define __ieee754_cosl __ieee754_cosf128
+#define __ieee754_exp10l __ieee754_exp10f128
+#define __ieee754_exp2l __ieee754_exp2f128
+#define __ieee754_expl __ieee754_expf128
+#define __ieee754_fmodl __ieee754_fmodf128
+#define __ieee754_gammal_r __ieee754_gammaf128_r
+#define __ieee754_hypotl __ieee754_hypotf128
+#define __ieee754_ilogbl __ieee754_ilogbf128
+#define __ieee754_j0l __ieee754_j0f128
+#define __ieee754_j1l __ieee754_j1f128
+#define __ieee754_jnl __ieee754_jnf128
+#define __ieee754_lgammal_r __ieee754_lgammaf128_r
+#define __ieee754_log10l __ieee754_log10f128
+#define __ieee754_log2l __ieee754_log2f128
+#define __ieee754_logl __ieee754_logf128
+#define __ieee754_powl __ieee754_powf128
+#define __ieee754_rem_pio2l __ieee754_rem_pio2f128
+#define __ieee754_remainderl __ieee754_remainderf128
+#define __ieee754_sinhl __ieee754_sinhf128
+#define __ieee754_sqrtl __ieee754_sqrtf128
+#define __ieee754_y0l __ieee754_y0f128
+#define __ieee754_y1l __ieee754_y1f128
+#define __ieee754_ynl __ieee754_ynf128
+
+
+/* finite math entry points. */
+#define __acoshl_finite __acoshf128_finite
+#define __acosl_finite __acosf128_finite
+#define __asinl_finite __asinf128_finite
+#define __atan2l_finite __atan2f128_finite
+#define __atanhl_finite __atanhf128_finite
+#define __coshl_finite __coshf128_finite
+#define __cosl_finite __cosf128_finite
+#define __exp10l_finite __exp10f128_finite
+#define __exp2l_finite __exp2f128_finite
+#define __expl_finite __expf128_finite
+#define __fmodl_finite __fmodf128_finite
+#define __hypotl_finite __hypotf128_finite
+#define __ilogbl_finite __ilogbf128_finite
+#define __j0l_finite __j0f128_finite
+#define __j1l_finite __j1f128_finite
+#define __jnl_finite __jnf128_finite
+#define __lgammal_r_finite __lgammaf128_r_finite
+#define __log10l_finite __log10f128_finite
+#define __log2l_finite __log2f128_finite
+#define __logl_finite __logf128_finite
+#define __powl_finite __powf128_finite
+#define __remainderl_finite __remainderf128_finite
+#define __sinhl_finite __sinhf128_finite
+#define __y0l_finite __y0f128_finite
+#define __y1l_finite __y1f128_finite
+#define __ynl_finite __ynf128_finite
+
+
+/* internal function names. */
+#define __asinhl __asinhf128
+#define __atanl __atanf128
+#define __cbrtl __cbrtf128
+#define __ceill __ceilf128
+#define __copysignl __copysignf128
+#define __cosl __cosf128
+#define __erfcl __erfcf128
+#define __erfl __erff128
+#define __expl __expf128
+#define __expm1l __expm1f128
+#define __fabsl __fabsf128
+#define __fdiml __fdimf128
+#define __finitel __finitef128
+#define __floorl __floorf128
+#define __fmal __fmaf128
+#define __fmaxl __fmaxf128
+#define __fminl __fminf128
+#define __fpclassifyl __fpclassifyf128
+#define __frexpl __frexpf128
+#define __gammal_r_finite __gammaf128_r_finite
+#define __getpayloadl __getpayloadf128
+#define __isinfl __isinff128
+#define __isnanl __isnanf128
+#define __issignalingl __issignalingf128
+#define __ldexpl __ldexpf128
+#define __llrintl __llrintf128
+#define __llroundl __llroundf128
+#define __log1pl __log1pf128
+#define __logbl __logbf128
+#define __logl __logf128
+#define __lrintl __lrintf128
+#define __lroundl __lroundf128
+#define __modfl __modff128
+#define __nearbyintl __nearbyintf128
+#define __nextafterl __nextafterf128
+#define __nextdownl __nextdownf128
+#define __nextupl __nextupf128
+#define __remquol __remquof128
+#define __rintl __rintf128
+#define __roundevenl __roundevenf128
+#define __roundl __roundf128
+#define __scalblnl __scalblnf128
+#define __scalbnl __scalbnf128
+#define __signbitl __signbitf128
+#define __sincosl __sincosf128
+#define __sinl __sinf128
+#define __sqrtl __sqrtf128
+#define __tanhl __tanhf128
+#define __tanl __tanf128
+#define __totalorderl __totalorderf128
+#define __totalordermagl __totalordermagf128
+#define __truncl __truncf128
+#define __x2y2m1l __x2y2m1f128
+
+#define __faddl __f32addf128
+#define __daddl __f64addf128
+#define __fdivl __f32divf128
+#define __ddivl __f64divf128
+#define __fmull __f32mulf128
+#define __dmull __f64mulf128
+#define __fsubl __f32subf128
+#define __dsubl __f64subf128
+
+/* __nexttowardf128 is not _Float128 API. */
+#define __nexttowardl __nexttowardf128_do_not_use
+#define nexttowardl nexttowardf128_do_not_use
+
+
+/* public entry points. */
+#define asinhl asinhf128
+#define atanl atanf128
+#define cbrtl cbrtf128
+#define ceill ceilf128
+#define copysignl copysignf128
+#define cosl cosf128
+#define erfcl erfcf128
+#define erfl erff128
+#define expl expf128
+#define expm1l expm1f128
+#define fabsl fabsf128
+#define fdiml fdimf128
+#define finitel finitef128_do_not_use
+#define floorl floorf128
+#define fmal fmaf128
+#define fmaxl fmaxf128
+#define fminl fminf128
+#define frexpl frexpf128
+#define getpayloadl getpayloadf128
+#define isinfl isinff128_do_not_use
+#define isnanl isnanf128_do_not_use
+#define ldexpl ldexpf128
+#define llrintl llrintf128
+#define llroundl llroundf128
+#define log1pl log1pf128
+#define logbl logbf128
+#define logl logf128
+#define lrintl lrintf128
+#define lroundl lroundf128
+#define modfl modff128
+#define nanl nanf128
+#define nearbyintl nearbyintf128
+#define nextafterl nextafterf128
+#define nextdownl nextdownf128
+#define nextupl nextupf128
+#define remquol remquof128
+#define rintl rintf128
+#define roundevenl roundevenf128
+#define roundl roundf128
+#define scalbnl scalbnf128
+#define sincosl sincosf128
+#define sinl sinf128
+#define sqrtl sqrtf128
+#define tanhl tanhf128
+#define tanl tanf128
+#define totalorderl totalorderf128
+#define totalordermagl totalordermagf128
+#define truncl truncf128
+
+
+/* misc internal renames. */
+#define __builtin_fmal __builtin_fmaf128
+#define __expl_table __expf128_table
+#define __gamma_productl __gamma_productf128
+#define __kernel_cosl __kernel_cosf128
+#define __kernel_rem_pio2l __kernel_rem_pio2f128
+#define __kernel_sincosl __kernel_sincosf128
+#define __kernel_sinl __kernel_sinf128
+#define __kernel_tanl __kernel_tanf128
+#define __lgamma_negl __lgamma_negf128
+#define __lgamma_productl __lgamma_productf128
+#define __mpn_extract_long_double __mpn_extract_float128
+#define __sincosl_table __sincosf128_table
+#define mul_splitl mul_splitf128
+
+/* Builtin renames. */
+#define __builtin_copysignl __builtin_copysignf128
+#define __builtin_signbitl __builtin_signbit
+
+/* Get the constant suffix from bits/floatn-compat.h. */
+#define L(x) __f128 (x)
+
+static inline void
+mul_splitf128 (_Float128 *hi, _Float128 *lo, _Float128 x, _Float128 y)
+{
+#ifdef __FP_FAST_FMAF128
+ /* 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 << (FLT128_MANT_DIG + 1) / 2) + 1)
+ _Float128 x1 = x * C;
+ _Float128 y1 = y * C;
+# undef C
+ x1 = (x - x1) + x1;
+ y1 = (y - y1) + y1;
+ _Float128 x2 = x - x1;
+ _Float128 y2 = y - y1;
+ *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
+#endif
+}
diff --git a/sysdeps/ieee754/float128/gamma_productf128.c b/sysdeps/ieee754/float128/gamma_productf128.c
new file mode 100644
index 0000000000..be2271f12f
--- /dev/null
+++ b/sysdeps/ieee754/float128/gamma_productf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/gamma_productl.c"
diff --git a/sysdeps/ieee754/float128/ieee754_float128.h b/sysdeps/ieee754/float128/ieee754_float128.h
new file mode 100644
index 0000000000..ea307eb9e9
--- /dev/null
+++ b/sysdeps/ieee754/float128/ieee754_float128.h
@@ -0,0 +1,140 @@
+/* _Float128 IEEE like macros.
+ Copyright (C) 2017-2018 Free Software 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 _IEEE754_FLOAT128_H
+#define _IEEE754_FLOAT128_H
+
+#include <endian.h>
+#include <stdint.h>
+
+# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+# define __FLT_EORDER2(t, a, b) t a; t b;
+# define __FLT_EORDER4(t, a, b, c, d) \
+ t a; t b; t c; t d;
+# define __FLT_EORDER6(t, a, b, c, d, e, f) \
+ t a; t b; t c; t d; t e; t f;
+# define __FLT_EORDER7(t, a, b, c, d, e, f, g) \
+ t a; t b; t c; t d; t e; t f; t g;
+# else
+# define __FLT_EORDER2(t, a, b) \
+ t b; t a;
+# define __FLT_EORDER4(t, a, b, c, d) \
+ t d; t c; t b; t a;
+# define __FLT_EORDER6(t, a, b, c, d, e, f) \
+ t f; t e; t d; t c; t b; t a;
+# define __FLT_EORDER7(t, a, b, c, d, e, f, g) \
+ t g; t f; t e; t d; t c; t b; t a;
+# endif
+
+/* A union which permits us to convert between _Float128 and
+ four 32 bit ints or two 64 bit ints. */
+
+typedef union
+{
+ _Float128 value;
+ struct
+ {
+ __FLT_EORDER2 (uint64_t, msw, lsw);
+ } parts64;
+ struct
+ {
+ __FLT_EORDER4 (uint32_t, w0, w1, w2, w3);
+ } parts32;
+} ieee854_float128_shape_type;
+
+/* Get two 64 bit ints from a _Float128. */
+
+# define GET_FLOAT128_WORDS64(ix0,ix1,d) \
+do { \
+ ieee854_float128_shape_type qw_u; \
+ qw_u.value = (d); \
+ (ix0) = qw_u.parts64.msw; \
+ (ix1) = qw_u.parts64.lsw; \
+} while (0)
+
+/* Set a _Float128 from two 64 bit ints. */
+
+# define SET_FLOAT128_WORDS64(d,ix0,ix1) \
+do { \
+ ieee854_float128_shape_type qw_u; \
+ qw_u.parts64.msw = (ix0); \
+ qw_u.parts64.lsw = (ix1); \
+ (d) = qw_u.value; \
+} while (0)
+
+/* Get the more significant 64 bits of a _Float128 mantissa. */
+
+# define GET_FLOAT128_MSW64(v,d) \
+do { \
+ ieee854_float128_shape_type sh_u; \
+ sh_u.value = (d); \
+ (v) = sh_u.parts64.msw; \
+} while (0)
+
+/* Set the more significant 64 bits of a _Float128 mantissa from an int. */
+
+# define SET_FLOAT128_MSW64(d,v) \
+do { \
+ ieee854_float128_shape_type sh_u; \
+ sh_u.value = (d); \
+ sh_u.parts64.msw = (v); \
+ (d) = sh_u.value; \
+} while (0)
+
+/* Get the least significant 64 bits of a _Float128 mantissa. */
+
+# define GET_FLOAT128_LSW64(v,d) \
+do { \
+ ieee854_float128_shape_type sh_u; \
+ sh_u.value = (d); \
+ (v) = sh_u.parts64.lsw; \
+} while (0)
+
+/* Likewise, some helper macros which are exposed via ieee754.h for
+ C99 real types, but not _Float128. */
+
+union ieee854_float128
+ {
+ _Float128 d;
+
+ /* This is the IEEE 854 quad-precision format. */
+ struct
+ {
+ __FLT_EORDER6 (unsigned int, negative:1,
+ exponent:15,
+ mantissa0:16,
+ mantissa1:32,
+ mantissa2:32,
+ mantissa3:32)
+ } ieee;
+
+ /* This format makes it easier to see if a NaN is a signalling NaN. */
+ struct
+ {
+ __FLT_EORDER7 (unsigned int, negative:1,
+ exponent:15,
+ quiet_nan:1,
+ mantissa0:15,
+ mantissa1:32,
+ mantissa2:32,
+ mantissa3:32)
+ } ieee_nan;
+ };
+
+#define IEEE854_FLOAT128_BIAS 0x3fff /* Added to exponent. */
+
+#endif
diff --git a/sysdeps/ieee754/float128/k_cosf128.c b/sysdeps/ieee754/float128/k_cosf128.c
new file mode 100644
index 0000000000..9db0906e9a
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_cosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_cosl.c"
diff --git a/sysdeps/ieee754/float128/k_sincosf128.c b/sysdeps/ieee754/float128/k_sincosf128.c
new file mode 100644
index 0000000000..14c0f1eccf
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_sincosl.c"
diff --git a/sysdeps/ieee754/float128/k_sinf128.c b/sysdeps/ieee754/float128/k_sinf128.c
new file mode 100644
index 0000000000..f3acf1cfe1
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_sinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_sinl.c"
diff --git a/sysdeps/ieee754/float128/k_tanf128.c b/sysdeps/ieee754/float128/k_tanf128.c
new file mode 100644
index 0000000000..ca6be539f7
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_tanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_tanl.c"
diff --git a/sysdeps/ieee754/float128/lgamma_negf128.c b/sysdeps/ieee754/float128/lgamma_negf128.c
new file mode 100644
index 0000000000..9c16f93025
--- /dev/null
+++ b/sysdeps/ieee754/float128/lgamma_negf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/lgamma_negl.c"
diff --git a/sysdeps/ieee754/float128/lgamma_productf128.c b/sysdeps/ieee754/float128/lgamma_productf128.c
new file mode 100644
index 0000000000..5efe5dd576
--- /dev/null
+++ b/sysdeps/ieee754/float128/lgamma_productf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/lgamma_productl.c"
diff --git a/sysdeps/ieee754/float128/math-nan-payload-float128.h b/sysdeps/ieee754/float128/math-nan-payload-float128.h
new file mode 100644
index 0000000000..95ab953596
--- /dev/null
+++ b/sysdeps/ieee754/float128/math-nan-payload-float128.h
@@ -0,0 +1,34 @@
+/* NaN payload handling for _Float128.
+ Copyright (C) 2017-2018 Free Software 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 <ieee754_float128.h>
+
+#define SET_NAN_PAYLOAD(flt, mant) \
+ do \
+ { \
+ union ieee854_float128 u; \
+ u.d = (flt); \
+ u.ieee_nan.mantissa0 = 0; \
+ u.ieee_nan.mantissa1 = 0; \
+ u.ieee_nan.mantissa2 = (mant) >> 32; \
+ u.ieee_nan.mantissa3 = (mant); \
+ if ((u.ieee.mantissa0 | u.ieee.mantissa1 \
+ | u.ieee.mantissa2 | u.ieee.mantissa3) != 0) \
+ (flt) = u.d; \
+ } \
+ while (0)
diff --git a/sysdeps/ieee754/float128/mpn2float128.c b/sysdeps/ieee754/float128/mpn2float128.c
new file mode 100644
index 0000000000..1360abc5c0
--- /dev/null
+++ b/sysdeps/ieee754/float128/mpn2float128.c
@@ -0,0 +1,54 @@
+/* Convert a number in multi-precision format to _Float128.
+ Copyright (C) 2017-2018 Free Software 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 "gmp.h"
+#include "gmp-impl.h"
+#include <float.h>
+#include <math.h>
+
+#include "ieee754_float128.h"
+
+/* Convert a multi-precision integer of the needed number of bits (113 for
+ binary128) and an integral power of two to a `_Float128' in IEEE854
+ quad-precision format. */
+
+_Float128
+__mpn_construct_float128 (mp_srcptr frac_ptr, int expt, int sign)
+{
+ union ieee854_float128 u;
+
+ u.ieee.negative = sign;
+ u.ieee.exponent = expt + IEEE854_FLOAT128_BIAS;
+#if BITS_PER_MP_LIMB == 32
+ u.ieee.mantissa3 = frac_ptr[0];
+ u.ieee.mantissa2 = frac_ptr[1];
+ u.ieee.mantissa1 = frac_ptr[2];
+ u.ieee.mantissa0 = frac_ptr[3] & (((mp_limb_t) 1
+ << (FLT128_MANT_DIG - 96)) - 1);
+#elif BITS_PER_MP_LIMB == 64
+ u.ieee.mantissa3 = frac_ptr[0] & (((mp_limb_t) 1 << 32) - 1);
+ u.ieee.mantissa2 = frac_ptr[0] >> 32;
+ u.ieee.mantissa1 = frac_ptr[1] & (((mp_limb_t) 1 << 32) - 1);
+ u.ieee.mantissa0 = (frac_ptr[1] >> 32) & (((mp_limb_t) 1
+ << (FLT128_MANT_DIG - 96)) - 1);
+#else
+ #error "mp_limb size " BITS_PER_MP_LIMB "not accounted for"
+#endif
+
+ return u.d;
+}
diff --git a/sysdeps/ieee754/float128/s_asinhf128.c b/sysdeps/ieee754/float128/s_asinhf128.c
new file mode 100644
index 0000000000..7b93d8cf3a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_asinhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_asinhl.c"
diff --git a/sysdeps/ieee754/float128/s_atanf128.c b/sysdeps/ieee754/float128/s_atanf128.c
new file mode 100644
index 0000000000..9b4d7ecec3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_atanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_atanl.c"
diff --git a/sysdeps/ieee754/float128/s_cbrtf128.c b/sysdeps/ieee754/float128/s_cbrtf128.c
new file mode 100644
index 0000000000..3bd5797373
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_cbrtf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_cbrtl.c"
diff --git a/sysdeps/ieee754/float128/s_ceilf128.c b/sysdeps/ieee754/float128/s_ceilf128.c
new file mode 100644
index 0000000000..0af15f5f03
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ceilf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_ceill.c"
diff --git a/sysdeps/ieee754/float128/s_copysignf128.c b/sysdeps/ieee754/float128/s_copysignf128.c
new file mode 100644
index 0000000000..808f7abbc0
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_copysignf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_copysignl.c"
diff --git a/sysdeps/ieee754/float128/s_cosf128.c b/sysdeps/ieee754/float128/s_cosf128.c
new file mode 100644
index 0000000000..8ba552695c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_cosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_cosl.c"
diff --git a/sysdeps/ieee754/float128/s_erff128.c b/sysdeps/ieee754/float128/s_erff128.c
new file mode 100644
index 0000000000..ac16ad6665
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_erff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_erfl.c"
diff --git a/sysdeps/ieee754/float128/s_expm1f128.c b/sysdeps/ieee754/float128/s_expm1f128.c
new file mode 100644
index 0000000000..ea28d89db4
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_expm1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_expm1l.c"
diff --git a/sysdeps/ieee754/float128/s_f32addf128.c b/sysdeps/ieee754/float128/s_f32addf128.c
new file mode 100644
index 0000000000..e2f8ded401
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f32addf128.c
@@ -0,0 +1,6 @@
+#define f32addf64x __hide_f32addf64x
+#define f32addf128 __hide_f32addf128
+#include <float128_private.h>
+#undef f32addf64x
+#undef f32addf128
+#include "../ldbl-128/s_faddl.c"
diff --git a/sysdeps/ieee754/float128/s_f32divf128.c b/sysdeps/ieee754/float128/s_f32divf128.c
new file mode 100644
index 0000000000..de8d252e80
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f32divf128.c
@@ -0,0 +1,6 @@
+#define f32divf64x __hide_f32divf64x
+#define f32divf128 __hide_f32divf128
+#include <float128_private.h>
+#undef f32divf64x
+#undef f32divf128
+#include "../ldbl-128/s_fdivl.c"
diff --git a/sysdeps/ieee754/float128/s_f32mulf128.c b/sysdeps/ieee754/float128/s_f32mulf128.c
new file mode 100644
index 0000000000..45fdc66ba6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f32mulf128.c
@@ -0,0 +1,6 @@
+#define f32mulf64x __hide_f32mulf64x
+#define f32mulf128 __hide_f32mulf128
+#include <float128_private.h>
+#undef f32mulf64x
+#undef f32mulf128
+#include "../ldbl-128/s_fmull.c"
diff --git a/sysdeps/ieee754/float128/s_f32subf128.c b/sysdeps/ieee754/float128/s_f32subf128.c
new file mode 100644
index 0000000000..f1373f68ac
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f32subf128.c
@@ -0,0 +1,6 @@
+#define f32subf64x __hide_f32subf64x
+#define f32subf128 __hide_f32subf128
+#include <float128_private.h>
+#undef f32subf64x
+#undef f32subf128
+#include "../ldbl-128/s_fsubl.c"
diff --git a/sysdeps/ieee754/float128/s_f64addf128.c b/sysdeps/ieee754/float128/s_f64addf128.c
new file mode 100644
index 0000000000..c2bb293399
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64addf128.c
@@ -0,0 +1,10 @@
+#define f32xaddf64x __hide_f32xaddf64x
+#define f32xaddf128 __hide_f32xaddf128
+#define f64addf64x __hide_f64addf64x
+#define f64addf128 __hide_f64addf128
+#include <float128_private.h>
+#undef f32xaddf64x
+#undef f32xaddf128
+#undef f64addf64x
+#undef f64addf128
+#include "../ldbl-128/s_daddl.c"
diff --git a/sysdeps/ieee754/float128/s_f64divf128.c b/sysdeps/ieee754/float128/s_f64divf128.c
new file mode 100644
index 0000000000..ea37e8bcaf
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64divf128.c
@@ -0,0 +1,10 @@
+#define f32xdivf64x __hide_f32xdivf64x
+#define f32xdivf128 __hide_f32xdivf128
+#define f64divf64x __hide_f64divf64x
+#define f64divf128 __hide_f64divf128
+#include <float128_private.h>
+#undef f32xdivf64x
+#undef f32xdivf128
+#undef f64divf64x
+#undef f64divf128
+#include "../ldbl-128/s_ddivl.c"
diff --git a/sysdeps/ieee754/float128/s_f64mulf128.c b/sysdeps/ieee754/float128/s_f64mulf128.c
new file mode 100644
index 0000000000..47a645ac4d
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64mulf128.c
@@ -0,0 +1,10 @@
+#define f32xmulf64x __hide_f32xmulf64x
+#define f32xmulf128 __hide_f32xmulf128
+#define f64mulf64x __hide_f64mulf64x
+#define f64mulf128 __hide_f64mulf128
+#include <float128_private.h>
+#undef f32xmulf64x
+#undef f32xmulf128
+#undef f64mulf64x
+#undef f64mulf128
+#include "../ldbl-128/s_dmull.c"
diff --git a/sysdeps/ieee754/float128/s_f64subf128.c b/sysdeps/ieee754/float128/s_f64subf128.c
new file mode 100644
index 0000000000..89ef5a7cc6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64subf128.c
@@ -0,0 +1,10 @@
+#define f32xsubf64x __hide_f32xsubf64x
+#define f32xsubf128 __hide_f32xsubf128
+#define f64subf64x __hide_f64subf64x
+#define f64subf128 __hide_f64subf128
+#include <float128_private.h>
+#undef f32xsubf64x
+#undef f32xsubf128
+#undef f64subf64x
+#undef f64subf128
+#include "../ldbl-128/s_dsubl.c"
diff --git a/sysdeps/ieee754/float128/s_f64xaddf128.c b/sysdeps/ieee754/float128/s_f64xaddf128.c
new file mode 100644
index 0000000000..c8af0a5dff
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64xaddf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_f64xaddf128.c"
diff --git a/sysdeps/ieee754/float128/s_f64xdivf128.c b/sysdeps/ieee754/float128/s_f64xdivf128.c
new file mode 100644
index 0000000000..55cc953ba6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64xdivf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_f64xdivf128.c"
diff --git a/sysdeps/ieee754/float128/s_f64xmulf128.c b/sysdeps/ieee754/float128/s_f64xmulf128.c
new file mode 100644
index 0000000000..085bf9fe4e
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64xmulf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_f64xmulf128.c"
diff --git a/sysdeps/ieee754/float128/s_f64xsubf128.c b/sysdeps/ieee754/float128/s_f64xsubf128.c
new file mode 100644
index 0000000000..64a0d6d82c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64xsubf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_f64xsubf128.c"
diff --git a/sysdeps/ieee754/float128/s_fabsf128.c b/sysdeps/ieee754/float128/s_fabsf128.c
new file mode 100644
index 0000000000..79ba47c3fd
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fabsf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fabsl.c"
diff --git a/sysdeps/ieee754/float128/s_finitef128.c b/sysdeps/ieee754/float128/s_finitef128.c
new file mode 100644
index 0000000000..801de88e32
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_finitef128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_finitel.c"
diff --git a/sysdeps/ieee754/float128/s_floorf128.c b/sysdeps/ieee754/float128/s_floorf128.c
new file mode 100644
index 0000000000..18298436a1
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_floorf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_floorl.c"
diff --git a/sysdeps/ieee754/float128/s_fmaf128.c b/sysdeps/ieee754/float128/s_fmaf128.c
new file mode 100644
index 0000000000..6497895c8d
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fmaf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fmal.c"
diff --git a/sysdeps/ieee754/float128/s_fpclassifyf128.c b/sysdeps/ieee754/float128/s_fpclassifyf128.c
new file mode 100644
index 0000000000..15131dc4a2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fpclassifyf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fpclassifyl.c"
diff --git a/sysdeps/ieee754/float128/s_frexpf128.c b/sysdeps/ieee754/float128/s_frexpf128.c
new file mode 100644
index 0000000000..7b040b3e33
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_frexpf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_frexpl.c"
diff --git a/sysdeps/ieee754/float128/s_fromfpf128.c b/sysdeps/ieee754/float128/s_fromfpf128.c
new file mode 100644
index 0000000000..86adf3821e
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fromfpf128.c
@@ -0,0 +1,6 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
+libm_alias_float128 (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/float128/s_fromfpxf128.c b/sysdeps/ieee754/float128/s_fromfpxf128.c
new file mode 100644
index 0000000000..c56422381f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fromfpxf128.c
@@ -0,0 +1,6 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
+libm_alias_float128 (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/float128/s_getpayloadf128.c b/sysdeps/ieee754/float128/s_getpayloadf128.c
new file mode 100644
index 0000000000..2e2607a81b
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_getpayloadf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_getpayloadl.c"
diff --git a/sysdeps/ieee754/float128/s_isinff128.c b/sysdeps/ieee754/float128/s_isinff128.c
new file mode 100644
index 0000000000..62cc424b16
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_isinff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_isinfl.c"
diff --git a/sysdeps/ieee754/float128/s_isnanf128.c b/sysdeps/ieee754/float128/s_isnanf128.c
new file mode 100644
index 0000000000..efba24059a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_isnanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_isnanl.c"
diff --git a/sysdeps/ieee754/float128/s_issignalingf128.c b/sysdeps/ieee754/float128/s_issignalingf128.c
new file mode 100644
index 0000000000..1d4599544f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_issignalingf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_issignalingl.c"
diff --git a/sysdeps/ieee754/float128/s_llrintf128.c b/sysdeps/ieee754/float128/s_llrintf128.c
new file mode 100644
index 0000000000..bb9ca580cd
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_llrintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_llrintl.c"
diff --git a/sysdeps/ieee754/float128/s_llroundf128.c b/sysdeps/ieee754/float128/s_llroundf128.c
new file mode 100644
index 0000000000..be54a90608
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_llroundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_llroundl.c"
diff --git a/sysdeps/ieee754/float128/s_log1pf128.c b/sysdeps/ieee754/float128/s_log1pf128.c
new file mode 100644
index 0000000000..48bb84f987
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_log1pf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_log1pl.c"
diff --git a/sysdeps/ieee754/float128/s_logbf128.c b/sysdeps/ieee754/float128/s_logbf128.c
new file mode 100644
index 0000000000..167384a8d4
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_logbf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_logbl.c"
diff --git a/sysdeps/ieee754/float128/s_lrintf128.c b/sysdeps/ieee754/float128/s_lrintf128.c
new file mode 100644
index 0000000000..1cfa9d7ca4
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_lrintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_lrintl.c"
diff --git a/sysdeps/ieee754/float128/s_lroundf128.c b/sysdeps/ieee754/float128/s_lroundf128.c
new file mode 100644
index 0000000000..13ba9f220d
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_lroundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_lroundl.c"
diff --git a/sysdeps/ieee754/float128/s_modff128.c b/sysdeps/ieee754/float128/s_modff128.c
new file mode 100644
index 0000000000..4618c6c380
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_modff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_modfl.c"
diff --git a/sysdeps/ieee754/float128/s_nearbyintf128.c b/sysdeps/ieee754/float128/s_nearbyintf128.c
new file mode 100644
index 0000000000..e61a3b3bfb
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nearbyintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nearbyintl.c"
diff --git a/sysdeps/ieee754/float128/s_nextafterf128.c b/sysdeps/ieee754/float128/s_nextafterf128.c
new file mode 100644
index 0000000000..2c43a00384
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nextafterf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nextafterl.c"
diff --git a/sysdeps/ieee754/float128/s_nexttowardf128.c b/sysdeps/ieee754/float128/s_nexttowardf128.c
new file mode 100644
index 0000000000..006e4c98b1
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nexttowardf128.c
@@ -0,0 +1 @@
+/* This function does not exist for _FloatN types. */
diff --git a/sysdeps/ieee754/float128/s_nextupf128.c b/sysdeps/ieee754/float128/s_nextupf128.c
new file mode 100644
index 0000000000..7d5d0b8c72
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nextupf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nextupl.c"
diff --git a/sysdeps/ieee754/float128/s_remquof128.c b/sysdeps/ieee754/float128/s_remquof128.c
new file mode 100644
index 0000000000..1cef61ab1b
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_remquof128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_remquol.c"
diff --git a/sysdeps/ieee754/float128/s_rintf128.c b/sysdeps/ieee754/float128/s_rintf128.c
new file mode 100644
index 0000000000..2adb95f360
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_rintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_rintl.c"
diff --git a/sysdeps/ieee754/float128/s_roundevenf128.c b/sysdeps/ieee754/float128/s_roundevenf128.c
new file mode 100644
index 0000000000..5a9b3f395f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_roundevenf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_roundevenl.c"
diff --git a/sysdeps/ieee754/float128/s_roundf128.c b/sysdeps/ieee754/float128/s_roundf128.c
new file mode 100644
index 0000000000..1eb36f2a5e
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_roundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_roundl.c"
diff --git a/sysdeps/ieee754/float128/s_scalblnf128.c b/sysdeps/ieee754/float128/s_scalblnf128.c
new file mode 100644
index 0000000000..999223c517
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_scalblnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_scalblnl.c"
diff --git a/sysdeps/ieee754/float128/s_scalbnf128.c b/sysdeps/ieee754/float128/s_scalbnf128.c
new file mode 100644
index 0000000000..0e7ab2663b
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_scalbnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_scalbnl.c"
diff --git a/sysdeps/ieee754/float128/s_setpayloadf128.c b/sysdeps/ieee754/float128/s_setpayloadf128.c
new file mode 100644
index 0000000000..65f0961fc7
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_setpayloadf128.c
@@ -0,0 +1,5 @@
+#include <float128_private.h>
+#define SIG 0
+#define FUNC __setpayloadf128
+#include "../ldbl-128/s_setpayloadl_main.c"
+libm_alias_float128 (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/float128/s_setpayloadsigf128.c b/sysdeps/ieee754/float128/s_setpayloadsigf128.c
new file mode 100644
index 0000000000..bd3ffb6775
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_setpayloadsigf128.c
@@ -0,0 +1,5 @@
+#include <float128_private.h>
+#define SIG 1
+#define FUNC __setpayloadsigf128
+#include "../ldbl-128/s_setpayloadl_main.c"
+libm_alias_float128 (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/float128/s_signbitf128.c b/sysdeps/ieee754/float128/s_signbitf128.c
new file mode 100644
index 0000000000..559df3b56c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_signbitf128.c
@@ -0,0 +1,37 @@
+/* Return nonzero value if number is negative.
+ Copyright (C) 2017-2018 Free Software 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 <float128_private.h>
+#include <math.h>
+#include <math_private.h>
+
+/* Once GCC >= 6.0 is required for building glibc, this implementation can
+ be removed and replaced with an inclusion of ldbl-128/s_signbitl.c. */
+int
+__signbitf128 (_Float128 x)
+{
+#if __GNUC_PREREQ (6, 0)
+ return __builtin_signbit (x);
+#else
+ int64_t e;
+
+ GET_FLOAT128_MSW64 (e, x);
+ return e < 0;
+#endif
+}
+hidden_def (__signbitf128)
diff --git a/sysdeps/ieee754/float128/s_significandf128.c b/sysdeps/ieee754/float128/s_significandf128.c
new file mode 100644
index 0000000000..067b724164
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_significandf128.c
@@ -0,0 +1 @@
+/* Not defined for _FloatN types. */
diff --git a/sysdeps/ieee754/float128/s_sincosf128.c b/sysdeps/ieee754/float128/s_sincosf128.c
new file mode 100644
index 0000000000..472adde17f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_sincosl.c"
diff --git a/sysdeps/ieee754/float128/s_sinf128.c b/sysdeps/ieee754/float128/s_sinf128.c
new file mode 100644
index 0000000000..d79a1163a5
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_sinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_sinl.c"
diff --git a/sysdeps/ieee754/float128/s_tanf128.c b/sysdeps/ieee754/float128/s_tanf128.c
new file mode 100644
index 0000000000..382961aada
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_tanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_tanl.c"
diff --git a/sysdeps/ieee754/float128/s_tanhf128.c b/sysdeps/ieee754/float128/s_tanhf128.c
new file mode 100644
index 0000000000..e02c9a6005
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_tanhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_tanhl.c"
diff --git a/sysdeps/ieee754/float128/s_totalorderf128.c b/sysdeps/ieee754/float128/s_totalorderf128.c
new file mode 100644
index 0000000000..1b115d8307
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_totalorderf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_totalorderl.c"
diff --git a/sysdeps/ieee754/float128/s_totalordermagf128.c b/sysdeps/ieee754/float128/s_totalordermagf128.c
new file mode 100644
index 0000000000..e44c657275
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_totalordermagf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_totalordermagl.c"
diff --git a/sysdeps/ieee754/float128/s_truncf128.c b/sysdeps/ieee754/float128/s_truncf128.c
new file mode 100644
index 0000000000..474d9dc77e
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_truncf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_truncl.c"
diff --git a/sysdeps/ieee754/float128/s_ufromfpf128.c b/sysdeps/ieee754/float128/s_ufromfpf128.c
new file mode 100644
index 0000000000..0e6521f587
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ufromfpf128.c
@@ -0,0 +1,6 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
+libm_alias_float128 (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/float128/s_ufromfpxf128.c b/sysdeps/ieee754/float128/s_ufromfpxf128.c
new file mode 100644
index 0000000000..cd192b73bf
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ufromfpxf128.c
@@ -0,0 +1,6 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
+libm_alias_float128 (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/float128/strfromf128.c b/sysdeps/ieee754/float128/strfromf128.c
new file mode 100644
index 0000000000..bdc540aa71
--- /dev/null
+++ b/sysdeps/ieee754/float128/strfromf128.c
@@ -0,0 +1,36 @@
+/* Definitions for strfromf128. Implementation in stdlib/strfrom-skeleton.c.
+
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <bits/floatn.h>
+
+#define FLOAT _Float128
+#define STRFROM strfromf128
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define strfromf64x __hide_strfromf64x
+# include <stdlib.h>
+# undef strfromf64x
+#endif
+
+#include <float128_private.h>
+
+#include <stdlib/strfrom-skeleton.c>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+weak_alias (strfromf128, strfromf64x)
+#endif
diff --git a/sysdeps/ieee754/float128/strtof128.c b/sysdeps/ieee754/float128/strtof128.c
new file mode 100644
index 0000000000..b7265b125a
--- /dev/null
+++ b/sysdeps/ieee754/float128/strtof128.c
@@ -0,0 +1,51 @@
+/* strtof128 wrapper of strtof128_l.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* The actual implementation for all floating point sizes is in strtod.c.
+ These macros tell it to produce the `_Float128' version, `strtof128'. */
+
+#include <bits/floatn.h>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x __hide_strtof64x
+# define wcstof64x __hide_wcstof64x
+#endif
+
+#define FLOAT _Float128
+#define FLT FLT128
+#ifdef USE_WIDE_CHAR
+# define STRTOF wcstof128
+# define STRTOF_L __wcstof128_l
+#else
+# define STRTOF strtof128
+# define STRTOF_L __strtof128_l
+#endif
+
+#include <float128_private.h>
+
+#include <stdlib/strtod.c>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x
+# undef wcstof64x
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstof128, wcstof64x)
+# else
+weak_alias (strtof128, strtof64x)
+# endif
+#endif
diff --git a/sysdeps/ieee754/float128/strtof128_l.c b/sysdeps/ieee754/float128/strtof128_l.c
new file mode 100644
index 0000000000..eff0c97d46
--- /dev/null
+++ b/sysdeps/ieee754/float128/strtof128_l.c
@@ -0,0 +1,58 @@
+/* Convert string representing a number to a _Float128 value, with locale.
+ Copyright (C) 2017-2018 Free Software 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 <bits/types/locale_t.h>
+
+/* Bring in potential typedef for _Float128 early for declaration below. */
+#include <bits/floatn.h>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
+extern _Float128 ____strtof128_l_internal (const char *, char **,
+ int, locale_t);
+
+#define FLOAT _Float128
+#define FLT FLT128
+#ifdef USE_WIDE_CHAR
+# define STRTOF wcstof128_l
+# define __STRTOF __wcstof128_l
+# define STRTOF_NAN __wcstof128_nan
+#else
+# define STRTOF strtof128_l
+# define __STRTOF __strtof128_l
+# define STRTOF_NAN __strtof128_nan
+#endif
+#define MPN2FLOAT __mpn_construct_float128
+#define FLOAT_HUGE_VAL __builtin_huge_valf128 ()
+
+#include <float128_private.h>
+
+#include <stdlib/strtod_l.c>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstof128_l, wcstof64x_l)
+# else
+weak_alias (strtof128_l, strtof64x_l)
+# endif
+#endif
diff --git a/sysdeps/ieee754/float128/strtof128_nan.c b/sysdeps/ieee754/float128/strtof128_nan.c
new file mode 100644
index 0000000000..37a7f4e02e
--- /dev/null
+++ b/sysdeps/ieee754/float128/strtof128_nan.c
@@ -0,0 +1,26 @@
+/* Convert string for NaN payload to corresponding NaN. Narrow
+ strings, __float128.
+ Copyright (C) 2017-2018 Free Software 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 <strtod_nan_narrow.h>
+#include <math-type-macros-float128.h>
+
+#define STRTOD_NAN __strtof128_nan
+#include <stdlib/strtod_nan_main.c>
diff --git a/sysdeps/ieee754/float128/t_sincosf128.c b/sysdeps/ieee754/float128/t_sincosf128.c
new file mode 100644
index 0000000000..7e699d3c8e
--- /dev/null
+++ b/sysdeps/ieee754/float128/t_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/t_sincosl.c"
diff --git a/sysdeps/ieee754/float128/wcstof128.c b/sysdeps/ieee754/float128/wcstof128.c
new file mode 100644
index 0000000000..4337b9f790
--- /dev/null
+++ b/sysdeps/ieee754/float128/wcstof128.c
@@ -0,0 +1,27 @@
+/* wcstof128 wrapper of wcstof128_l.
+ Copyright (C) 2017-2018 Free Software 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 <stddef.h>
+#include <bits/types/locale_t.h>
+
+#define USE_WIDE_CHAR 1
+
+/* Bring in _Float128 typedef if needed. */
+#include <bits/floatn.h>
+
+#include "strtof128.c"
diff --git a/sysdeps/ieee754/float128/wcstof128_l.c b/sysdeps/ieee754/float128/wcstof128_l.c
new file mode 100644
index 0000000000..19c3c51184
--- /dev/null
+++ b/sysdeps/ieee754/float128/wcstof128_l.c
@@ -0,0 +1,27 @@
+/* Convert string representing a number to integer value, using given locale.
+ Copyright (C) 2017-2018 Free Software 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 <stddef.h>
+#include <bits/types/locale_t.h>
+
+
+#define USE_WIDE_CHAR 1
+
+#include <bits/floatn.h>
+
+#include "strtof128_l.c"
diff --git a/sysdeps/ieee754/float128/wcstof128_nan.c b/sysdeps/ieee754/float128/wcstof128_nan.c
new file mode 100644
index 0000000000..f504809dcf
--- /dev/null
+++ b/sysdeps/ieee754/float128/wcstof128_nan.c
@@ -0,0 +1,23 @@
+/* Convert string for NaN payload to corresponding NaN. Wide strings,
+ _Float128.
+ Copyright (C) 2017-2018 Free Software 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 <stdlib/strtod_nan_wide.h>
+#include <math-type-macros-float128.h>
+#define STRTOD_NAN __wcstof128_nan
+#include <stdlib/strtod_nan_main.c>
diff --git a/sysdeps/ieee754/float128/x2y2m1f128.c b/sysdeps/ieee754/float128/x2y2m1f128.c
new file mode 100644
index 0000000000..68880792e6
--- /dev/null
+++ b/sysdeps/ieee754/float128/x2y2m1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/x2y2m1l.c"
diff --git a/sysdeps/ieee754/flt-32/e_acosf.c b/sysdeps/ieee754/flt-32/e_acosf.c
index 6f792f6604..3b2e4f1bde 100644
--- a/sysdeps/ieee754/flt-32/e_acosf.c
+++ b/sysdeps/ieee754/flt-32/e_acosf.c
@@ -56,14 +56,14 @@ __ieee754_acosf(float x)
z = (one+x)*(float)0.5;
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
- s = __ieee754_sqrtf(z);
+ s = sqrtf(z);
r = p/q;
w = r*s-pio2_lo;
return pi - (float)2.0*(s+w);
} else { /* x > 0.5 */
int32_t idf;
z = (one-x)*(float)0.5;
- s = __ieee754_sqrtf(z);
+ s = sqrtf(z);
df = s;
GET_FLOAT_WORD(idf,df);
SET_FLOAT_WORD(df,idf&0xfffff000);
diff --git a/sysdeps/ieee754/flt-32/e_acoshf.c b/sysdeps/ieee754/flt-32/e_acoshf.c
index aabfb85df7..49e64f3c43 100644
--- a/sysdeps/ieee754/flt-32/e_acoshf.c
+++ b/sysdeps/ieee754/flt-32/e_acoshf.c
@@ -40,10 +40,10 @@ float __ieee754_acoshf(float x)
return 0.0; /* acosh(1) = 0 */
} else if (hx > 0x40000000) { /* 2**28 > x > 2 */
t=x*x;
- return __ieee754_logf((float)2.0*x-one/(x+__ieee754_sqrtf(t-one)));
+ return __ieee754_logf((float)2.0*x-one/(x+sqrtf(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pf(t+__ieee754_sqrtf((float)2.0*t+t*t));
+ return __log1pf(t+sqrtf((float)2.0*t+t*t));
}
}
strong_alias (__ieee754_acoshf, __acoshf_finite)
diff --git a/sysdeps/ieee754/flt-32/e_asinf.c b/sysdeps/ieee754/flt-32/e_asinf.c
index 2ca2dbcb28..e03073b8bd 100644
--- a/sysdeps/ieee754/flt-32/e_asinf.c
+++ b/sysdeps/ieee754/flt-32/e_asinf.c
@@ -42,6 +42,7 @@ static char rcsid[] = "$NetBSD: e_asinf.c,v 1.5 1995/05/12 04:57:25 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float
one = 1.0000000000e+00, /* 0x3F800000 */
@@ -85,7 +86,7 @@ float __ieee754_asinf(float x)
w = one-fabsf(x);
t = w*0.5f;
p = t * (p0 + t * (p1 + t * (p2 + t * (p3 + t * p4))));
- s = __ieee754_sqrtf(t);
+ s = sqrtf(t);
if(ix>=0x3F79999A) { /* if |x| > 0.975 */
t = pio2_hi-(2.0f*(s+s*p)-pio2_lo);
} else {
diff --git a/sysdeps/ieee754/flt-32/e_atan2f.c b/sysdeps/ieee754/flt-32/e_atan2f.c
index 29eefc0dd6..ddc5873ade 100644
--- a/sysdeps/ieee754/flt-32/e_atan2f.c
+++ b/sysdeps/ieee754/flt-32/e_atan2f.c
@@ -81,7 +81,7 @@ __ieee754_atan2f (float y, float x)
switch (m) {
case 0: return z ; /* atan(+,+) */
case 1: {
- u_int32_t zh;
+ uint32_t zh;
GET_FLOAT_WORD(zh,z);
SET_FLOAT_WORD(z,zh ^ 0x80000000);
}
diff --git a/sysdeps/ieee754/flt-32/e_atanhf.c b/sysdeps/ieee754/flt-32/e_atanhf.c
index 82de071ab8..207d759362 100644
--- a/sysdeps/ieee754/flt-32/e_atanhf.c
+++ b/sysdeps/ieee754/flt-32/e_atanhf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -38,7 +38,9 @@
#include <float.h>
#include <inttypes.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float huge = 1e30;
diff --git a/sysdeps/ieee754/flt-32/e_coshf.c b/sysdeps/ieee754/flt-32/e_coshf.c
index 7b223758e1..a2aa83876d 100644
--- a/sysdeps/ieee754/flt-32/e_coshf.c
+++ b/sysdeps/ieee754/flt-32/e_coshf.c
@@ -15,6 +15,7 @@
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const float huge = 1.0e30;
diff --git a/sysdeps/ieee754/flt-32/e_exp2f.c b/sysdeps/ieee754/flt-32/e_exp2f.c
index 1723c482de..7218e5d254 100644
--- a/sysdeps/ieee754/flt-32/e_exp2f.c
+++ b/sysdeps/ieee754/flt-32/e_exp2f.c
@@ -1,7 +1,6 @@
-/* Single-precision floating point 2^x.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Single-precision 2^x function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
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,116 +16,81 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* The basic design here is from
- Shmuel Gal and Boris Bachelis, "An Accurate Elementary Mathematical
- Library for the IEEE Floating Point Standard", ACM Trans. Math. Soft.,
- 17 (1), March 1991, pp. 26-45.
- It has been slightly modified to compute 2^x instead of e^x, and for
- single-precision.
- */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-#include <stdlib.h>
-#include <float.h>
-#include <ieee754.h>
#include <math.h>
-#include <fenv.h>
-#include <inttypes.h>
-#include <math_private.h>
-
-#include "t_exp2f.h"
-
-static const float TWOM100 = 7.88860905e-31;
-static const float TWO127 = 1.7014118346e+38;
+#include <math-narrow-eval.h>
+#include <stdint.h>
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+#include "math_config.h"
+
+/*
+EXP2F_TABLE_BITS = 5
+EXP2F_POLY_ORDER = 3
+
+ULP error: 0.502 (nearest rounding.)
+Relative error: 1.69 * 2^-34 in [-1/64, 1/64] (before rounding.)
+Wrong count: 168353 (all nearest rounding wrong results with fma.)
+Non-nearest ULP error: 1 (rounded ULP error)
+*/
+
+#define N (1 << EXP2F_TABLE_BITS)
+#define T __exp2f_data.tab
+#define C __exp2f_data.poly
+#define SHIFT __exp2f_data.shift_scaled
+
+static inline uint32_t
+top12 (float x)
+{
+ return asuint (x) >> 20;
+}
float
-__ieee754_exp2f (float x)
+__exp2f (float x)
{
- static const float himark = (float) FLT_MAX_EXP;
- static const float lomark = (float) (FLT_MIN_EXP - FLT_MANT_DIG - 1);
-
- /* Check for usual case. */
- if (isless (x, himark) && isgreaterequal (x, lomark))
- {
- static const float THREEp14 = 49152.0;
- int tval, unsafe;
- float rx, x22, result;
- union ieee754_float ex2_u, scale_u;
-
- if (fabsf (x) < FLT_EPSILON / 4.0f)
- return 1.0f + x;
-
- {
- SET_RESTORE_ROUND_NOEXF (FE_TONEAREST);
-
- /* 1. Argument reduction.
- Choose integers ex, -128 <= t < 128, and some real
- -1/512 <= x1 <= 1/512 so that
- x = ex + t/512 + x1.
-
- First, calculate rx = ex + t/256. */
- rx = x + THREEp14;
- rx -= THREEp14;
- x -= rx; /* Compute x=x1. */
- /* Compute tval = (ex*256 + t)+128.
- Now, t = (tval mod 256)-128 and ex=tval/256 [that's mod, NOT %;
- and /-round-to-nearest not the usual c integer /]. */
- tval = (int) (rx * 256.0f + 128.0f);
-
- /* 2. Adjust for accurate table entry.
- Find e so that
- x = ex + t/256 + e + x2
- where -7e-4 < e < 7e-4, and
- (float)(2^(t/256+e))
- is accurate to one part in 2^-64. */
-
- /* 'tval & 255' is the same as 'tval%256' except that it's always
- positive.
- Compute x = x2. */
- x -= __exp2f_deltatable[tval & 255];
-
- /* 3. Compute ex2 = 2^(t/255+e+ex). */
- ex2_u.f = __exp2f_atable[tval & 255];
- tval >>= 8;
- /* x2 is an integer multiple of 2^-30; avoid intermediate
- underflow from the calculation of x22 * x. */
- unsafe = abs(tval) >= -FLT_MIN_EXP - 32;
- ex2_u.ieee.exponent += tval >> unsafe;
- scale_u.f = 1.0;
- scale_u.ieee.exponent += tval - (tval >> unsafe);
-
- /* 4. Approximate 2^x2 - 1, using a second-degree polynomial,
- with maximum error in [-2^-9 - 2^-14, 2^-9 + 2^-14]
- less than 1.3e-10. */
-
- x22 = (.24022656679f * x + .69314736128f) * ex2_u.f;
- }
-
- /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex). */
- result = x22 * x + ex2_u.f;
-
- if (!unsafe)
- return result;
- else
- {
- result *= scale_u.f;
- math_check_force_underflow_nonneg (result);
- return result;
- }
- }
- /* Exceptional cases: */
- else if (isless (x, himark))
+ uint32_t abstop;
+ uint64_t ki, t;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t kd, xd, z, r, r2, y, s;
+
+ xd = (double_t) x;
+ abstop = top12 (x) & 0x7ff;
+ if (__glibc_unlikely (abstop >= top12 (128.0f)))
{
- if (isinf (x))
- /* e^-inf == 0, with no error. */
- return 0;
- else
- /* Underflow */
- return TWOM100 * TWOM100;
+ /* |x| >= 128 or x is nan. */
+ if (asuint (x) == asuint (-INFINITY))
+ return 0.0f;
+ if (abstop >= top12 (INFINITY))
+ return x + x;
+ if (x > 0.0f)
+ return __math_oflowf (0);
+ if (x <= -150.0f)
+ return __math_uflowf (0);
+#if WANT_ERRNO_UFLOW
+ if (x < -149.0f)
+ return __math_may_uflowf (0);
+#endif
}
- else
- /* Return x, if x is a NaN or Inf; or overflow, otherwise. */
- return TWO127*x;
+
+ /* x = k/N + r with r in [-1/(2N), 1/(2N)] and int k. */
+ kd = math_narrow_eval ((double) (xd + SHIFT)); /* Needs to be double. */
+ ki = asuint64 (kd);
+ kd -= SHIFT; /* k/N for int k. */
+ r = xd - kd;
+
+ /* exp2(x) = 2^(k/N) * 2^r ~= s * (C0*r^3 + C1*r^2 + C2*r + 1) */
+ t = T[ki % N];
+ t += ki << (52 - EXP2F_TABLE_BITS);
+ s = asdouble (t);
+ z = C[0] * r + C[1];
+ r2 = r * r;
+ y = C[2] * r + 1;
+ y = z * r2 + y;
+ y = y * s;
+ return (float) y;
}
-strong_alias (__ieee754_exp2f, __exp2f_finite)
+#ifndef __exp2f
+strong_alias (__exp2f, __ieee754_exp2f)
+strong_alias (__exp2f, __exp2f_finite)
+versioned_symbol (libm, __exp2f, exp2f, GLIBC_2_27);
+libm_alias_float_other (__exp2, exp2)
+#endif
diff --git a/sysdeps/ieee754/flt-32/e_exp2f_data.c b/sysdeps/ieee754/flt-32/e_exp2f_data.c
new file mode 100644
index 0000000000..8d4e702c92
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/e_exp2f_data.c
@@ -0,0 +1,44 @@
+/* Shared data between expf, exp2f and powf.
+ Copyright (C) 2017-2018 Free Software 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_config.h"
+
+#define N (1 << EXP2F_TABLE_BITS)
+
+const struct exp2f_data __exp2f_data = {
+ /* tab[i] = uint(2^(i/N)) - (i << 52-BITS)
+ used for computing 2^(k/N) for an int |k| < 150 N as
+ double(tab[k%N] + (k << 52-BITS)) */
+ .tab = {
+0x3ff0000000000000, 0x3fefd9b0d3158574, 0x3fefb5586cf9890f, 0x3fef9301d0125b51,
+0x3fef72b83c7d517b, 0x3fef54873168b9aa, 0x3fef387a6e756238, 0x3fef1e9df51fdee1,
+0x3fef06fe0a31b715, 0x3feef1a7373aa9cb, 0x3feedea64c123422, 0x3feece086061892d,
+0x3feebfdad5362a27, 0x3feeb42b569d4f82, 0x3feeab07dd485429, 0x3feea47eb03a5585,
+0x3feea09e667f3bcd, 0x3fee9f75e8ec5f74, 0x3feea11473eb0187, 0x3feea589994cce13,
+0x3feeace5422aa0db, 0x3feeb737b0cdc5e5, 0x3feec49182a3f090, 0x3feed503b23e255d,
+0x3feee89f995ad3ad, 0x3feeff76f2fb5e47, 0x3fef199bdd85529c, 0x3fef3720dcef9069,
+0x3fef5818dcfba487, 0x3fef7c97337b9b5f, 0x3fefa4afa2a490da, 0x3fefd0765b6e4540,
+ },
+ .shift_scaled = 0x1.8p+52 / N,
+ .poly = { 0x1.c6af84b912394p-5, 0x1.ebfce50fac4f3p-3, 0x1.62e42ff0c52d6p-1 },
+ .shift = 0x1.8p+52,
+ .invln2_scaled = 0x1.71547652b82fep+0 * N,
+ .poly_scaled = {
+0x1.c6af84b912394p-5/N/N/N, 0x1.ebfce50fac4f3p-3/N/N, 0x1.62e42ff0c52d6p-1/N
+ },
+};
diff --git a/sysdeps/ieee754/flt-32/e_expf.c b/sysdeps/ieee754/flt-32/e_expf.c
index 071f615ef4..f2238bfd74 100644
--- a/sysdeps/ieee754/flt-32/e_expf.c
+++ b/sysdeps/ieee754/flt-32/e_expf.c
@@ -1,7 +1,6 @@
-/* Single-precision floating point e^x.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Single-precision e^x function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
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,117 +16,102 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* How this works:
+#ifdef __expf
+# undef libm_hidden_proto
+# define libm_hidden_proto(ignored)
+#endif
- The input value, x, is written as
-
- x = n * ln(2) + t/512 + delta[t] + x;
-
- where:
- - n is an integer, 127 >= n >= -150;
- - t is an integer, 177 >= t >= -177
- - delta is based on a table entry, delta[t] < 2^-28
- - x is whatever is left, |x| < 2^-10
-
- Then e^x is approximated as
-
- e^x = 2^n ( e^(t/512 + delta[t])
- + ( e^(t/512 + delta[t])
- * ( p(x + delta[t] + n * ln(2)) - delta ) ) )
-
- where
- - p(x) is a polynomial approximating e(x)-1;
- - e^(t/512 + delta[t]) is obtained from a table.
-
- The table used is the same one as for the double precision version;
- since we have the table, we might as well use it.
-
- It turns out to be faster to do calculations in double precision than
- to perform an 'accurate table method' expf, because of the range reduction
- overhead (compare exp2f).
- */
-#include <float.h>
-#include <ieee754.h>
#include <math.h>
-#include <fenv.h>
-#include <inttypes.h>
-#include <math_private.h>
-
-extern const float __exp_deltatable[178];
-extern const double __exp_atable[355] /* __attribute__((mode(DF))) */;
-
-static const float TWOM100 = 7.88860905e-31;
-static const float TWO127 = 1.7014118346e+38;
+#include <math-narrow-eval.h>
+#include <stdint.h>
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+#include "math_config.h"
+
+/*
+EXP2F_TABLE_BITS = 5
+EXP2F_POLY_ORDER = 3
+
+ULP error: 0.502 (nearest rounding.)
+Relative error: 1.69 * 2^-34 in [-ln2/64, ln2/64] (before rounding.)
+Wrong count: 170635 (all nearest rounding wrong results with fma.)
+Non-nearest ULP error: 1 (rounded ULP error)
+*/
+
+#define N (1 << EXP2F_TABLE_BITS)
+#define InvLn2N __exp2f_data.invln2_scaled
+#define T __exp2f_data.tab
+#define C __exp2f_data.poly_scaled
+
+static inline uint32_t
+top12 (float x)
+{
+ return asuint (x) >> 20;
+}
float
-__ieee754_expf (float x)
+__expf (float x)
{
- static const float himark = 88.72283935546875;
- static const float lomark = -103.972084045410;
- /* Check for usual case. */
- if (isless (x, himark) && isgreater (x, lomark))
- {
- static const float THREEp42 = 13194139533312.0;
- static const float THREEp22 = 12582912.0;
- /* 1/ln(2). */
-#undef M_1_LN2
- static const float M_1_LN2 = 1.44269502163f;
- /* ln(2) */
-#undef M_LN2
- static const double M_LN2 = .6931471805599452862;
-
- int tval;
- double x22, t, result, dx;
- float n, delta;
- union ieee754_double ex2_u;
-
- {
- SET_RESTORE_ROUND_NOEXF (FE_TONEAREST);
-
- /* Calculate n. */
- n = x * M_1_LN2 + THREEp22;
- n -= THREEp22;
- dx = x - n*M_LN2;
-
- /* Calculate t/512. */
- t = dx + THREEp42;
- t -= THREEp42;
- dx -= t;
-
- /* Compute tval = t. */
- tval = (int) (t * 512.0);
-
- if (t >= 0)
- delta = - __exp_deltatable[tval];
- else
- delta = __exp_deltatable[-tval];
-
- /* Compute ex2 = 2^n e^(t/512+delta[t]). */
- ex2_u.d = __exp_atable[tval+177];
- ex2_u.ieee.exponent += (int) n;
-
- /* Approximate e^(dx+delta) - 1, using a second-degree polynomial,
- with maximum error in [-2^-10-2^-28,2^-10+2^-28]
- less than 5e-11. */
- x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
- }
-
- /* Return result. */
- result = x22 * ex2_u.d + ex2_u.d;
- return (float) result;
- }
- /* Exceptional cases: */
- else if (isless (x, himark))
+ uint32_t abstop;
+ uint64_t ki, t;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t kd, xd, z, r, r2, y, s;
+
+ xd = (double_t) x;
+ abstop = top12 (x) & 0x7ff;
+ if (__glibc_unlikely (abstop >= top12 (88.0f)))
{
- if (isinf (x))
- /* e^-inf == 0, with no error. */
- return 0;
- else
- /* Underflow */
- return TWOM100 * TWOM100;
+ /* |x| >= 88 or x is nan. */
+ if (asuint (x) == asuint (-INFINITY))
+ return 0.0f;
+ if (abstop >= top12 (INFINITY))
+ return x + x;
+ if (x > 0x1.62e42ep6f) /* x > log(0x1p128) ~= 88.72 */
+ return __math_oflowf (0);
+ if (x < -0x1.9fe368p6f) /* x < log(0x1p-150) ~= -103.97 */
+ return __math_uflowf (0);
+#if WANT_ERRNO_UFLOW
+ if (x < -0x1.9d1d9ep6f) /* x < log(0x1p-149) ~= -103.28 */
+ return __math_may_uflowf (0);
+#endif
}
- else
- /* Return x, if x is a NaN or Inf; or overflow, otherwise. */
- return TWO127*x;
+
+ /* x*N/Ln2 = k + r with r in [-1/2, 1/2] and int k. */
+ z = InvLn2N * xd;
+
+ /* Round and convert z to int, the result is in [-150*N, 128*N] and
+ ideally ties-to-even rule is used, otherwise the magnitude of r
+ can be bigger which gives larger approximation error. */
+#if TOINT_INTRINSICS
+ kd = roundtoint (z);
+ ki = converttoint (z);
+#elif TOINT_RINT
+ kd = rint (z);
+ ki = (long) kd;
+#elif TOINT_SHIFT
+# define SHIFT __exp2f_data.shift
+ kd = math_narrow_eval ((double) (z + SHIFT)); /* Needs to be double. */
+ ki = asuint64 (kd);
+ kd -= SHIFT;
+#endif
+ r = z - kd;
+
+ /* exp(x) = 2^(k/N) * 2^(r/N) ~= s * (C0*r^3 + C1*r^2 + C2*r + 1) */
+ t = T[ki % N];
+ t += ki << (52 - EXP2F_TABLE_BITS);
+ s = asdouble (t);
+ z = C[0] * r + C[1];
+ r2 = r * r;
+ y = C[2] * r + 1;
+ y = z * r2 + y;
+ y = y * s;
+ return (float) y;
}
-strong_alias (__ieee754_expf, __expf_finite)
+
+#ifndef __expf
+hidden_def (__expf)
+strong_alias (__expf, __ieee754_expf)
+strong_alias (__expf, __expf_finite)
+versioned_symbol (libm, __expf, expf, GLIBC_2_27);
+libm_alias_float_other (__exp, exp)
+#endif
diff --git a/sysdeps/ieee754/flt-32/e_fmodf.c b/sysdeps/ieee754/flt-32/e_fmodf.c
index 8d8fad4eb5..1a9407b517 100644
--- a/sysdeps/ieee754/flt-32/e_fmodf.c
+++ b/sysdeps/ieee754/flt-32/e_fmodf.c
@@ -41,7 +41,7 @@ __ieee754_fmodf (float x, float y)
return (x*y)/(x*y);
if(hx<hy) return x; /* |x|<|y| return x */
if(hx==hy)
- return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/
+ return Zero[(uint32_t)sx>>31]; /* |x|=|y| return x*0*/
/* determine ix = ilogb(x) */
if(hx<0x00800000) { /* subnormal x */
@@ -74,7 +74,7 @@ __ieee754_fmodf (float x, float y)
if(hz<0){hx = hx+hx;}
else {
if(hz==0) /* return sign(x)*0 */
- return Zero[(u_int32_t)sx>>31];
+ return Zero[(uint32_t)sx>>31];
hx = hz+hz;
}
}
@@ -83,7 +83,7 @@ __ieee754_fmodf (float x, float y)
/* convert back to floating value and restore the sign */
if(hx==0) /* return sign(x)*0 */
- return Zero[(u_int32_t)sx>>31];
+ return Zero[(uint32_t)sx>>31];
while(hx<0x00800000) { /* normalize x */
hx = hx+hx;
iy -= 1;
diff --git a/sysdeps/ieee754/flt-32/e_gammaf_r.c b/sysdeps/ieee754/flt-32/e_gammaf_r.c
index 19f51b0c8b..8b23add347 100644
--- a/sysdeps/ieee754/flt-32/e_gammaf_r.c
+++ b/sysdeps/ieee754/flt-32/e_gammaf_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,7 +18,9 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
@@ -91,7 +93,7 @@ gammaf_positive (float x, int *exp2_adj)
float ret = (__ieee754_powf (x_adj_mant, x_adj)
* __ieee754_exp2f (x_adj_log2 * x_adj_frac)
* __ieee754_expf (-x_adj)
- * __ieee754_sqrtf (2 * (float) M_PI / x_adj)
+ * sqrtf (2 * (float) M_PI / x_adj)
/ prod);
exp_adj += x_eps * __ieee754_logf (x_adj);
float bsum = gamma_coeff[NCOEFF - 1];
@@ -118,7 +120,7 @@ __ieee754_gammaf_r (float x, int *signgamp)
return 1.0 / x;
}
if (__builtin_expect (hx < 0, 0)
- && (u_int32_t) hx < 0xff800000 && __rintf (x) == x)
+ && (uint32_t) hx < 0xff800000 && __rintf (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
diff --git a/sysdeps/ieee754/flt-32/e_hypotf.c b/sysdeps/ieee754/flt-32/e_hypotf.c
index 717b82e42f..5336876cf4 100644
--- a/sysdeps/ieee754/flt-32/e_hypotf.c
+++ b/sysdeps/ieee754/flt-32/e_hypotf.c
@@ -26,9 +26,9 @@ __ieee754_hypotf(float x, float y)
ha &= 0x7fffffff;
GET_FLOAT_WORD(hb,y);
hb &= 0x7fffffff;
- if (ha == 0x7f800000)
+ if (ha == 0x7f800000 && !issignaling (y))
return fabsf(x);
- else if (hb == 0x7f800000)
+ else if (hb == 0x7f800000 && !issignaling (x))
return fabsf(y);
else if (ha > 0x7f800000 || hb > 0x7f800000)
return fabsf(x) * fabsf(y);
@@ -40,6 +40,6 @@ __ieee754_hypotf(float x, float y)
d_x = (double) x;
d_y = (double) y;
- return (float) __ieee754_sqrt(d_x * d_x + d_y * d_y);
+ return (float) sqrt(d_x * d_x + d_y * d_y);
}
strong_alias (__ieee754_hypotf, __hypotf_finite)
diff --git a/sysdeps/ieee754/flt-32/e_j0f.c b/sysdeps/ieee754/flt-32/e_j0f.c
index bd0b80fdb0..0efc646a12 100644
--- a/sysdeps/ieee754/flt-32/e_j0f.c
+++ b/sysdeps/ieee754/flt-32/e_j0f.c
@@ -14,6 +14,7 @@
*/
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
static float pzerof(float), qzerof(float);
@@ -58,10 +59,10 @@ __ieee754_j0f(float x)
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
- if(ix>0x48000000) z = (invsqrtpi*cc)/__ieee754_sqrtf(x);
+ if(ix>0x48000000) z = (invsqrtpi*cc)/sqrtf(x);
else {
u = pzerof(x); v = qzerof(x);
- z = invsqrtpi*(u*cc-v*ss)/__ieee754_sqrtf(x);
+ z = invsqrtpi*(u*cc-v*ss)/sqrtf(x);
}
return z;
}
@@ -105,7 +106,7 @@ __ieee754_y0f(float x)
ix = 0x7fffffff&hx;
/* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0, y0(0) is -inf. */
if(ix>=0x7f800000) return one/(x+x*x);
- if(ix==0) return -HUGE_VALF+x; /* -inf and overflow exception. */
+ if(ix==0) return -1/zero; /* -inf and divide by zero exception. */
if(hx<0) return zero/(zero*x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
/* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
@@ -131,10 +132,10 @@ __ieee754_y0f(float x)
if ((s*c)<zero) cc = z/ss;
else ss = z/cc;
}
- if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrtf(x);
+ if(ix>0x48000000) z = (invsqrtpi*ss)/sqrtf(x);
else {
u = pzerof(x); v = qzerof(x);
- z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x);
+ z = invsqrtpi*(u*ss+v*cc)/sqrtf(x);
}
return z;
}
diff --git a/sysdeps/ieee754/flt-32/e_j1f.c b/sysdeps/ieee754/flt-32/e_j1f.c
index f359a3d9ba..887b5f7d1e 100644
--- a/sysdeps/ieee754/flt-32/e_j1f.c
+++ b/sysdeps/ieee754/flt-32/e_j1f.c
@@ -16,7 +16,9 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static float ponef(float), qonef(float);
@@ -61,10 +63,10 @@ __ieee754_j1f(float x)
* j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x)
* y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
*/
- if(ix>0x48000000) z = (invsqrtpi*cc)/__ieee754_sqrtf(y);
+ if(ix>0x48000000) z = (invsqrtpi*cc)/sqrtf(y);
else {
u = ponef(y); v = qonef(y);
- z = invsqrtpi*(u*cc-v*ss)/__ieee754_sqrtf(y);
+ z = invsqrtpi*(u*cc-v*ss)/sqrtf(y);
}
if(hx<0) return -z;
else return z;
@@ -112,7 +114,7 @@ __ieee754_y1f(float x)
/* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
if(__builtin_expect(ix>=0x7f800000, 0)) return one/(x+x*x);
if(__builtin_expect(ix==0, 0))
- return -HUGE_VALF+x; /* -inf and overflow exception. */
+ return -1/zero; /* -inf and divide by zero exception. */
if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
SET_RESTORE_ROUNDF (FE_TONEAREST);
@@ -135,10 +137,10 @@ __ieee754_y1f(float x)
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
* to compute the worse one.
*/
- if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrtf(x);
+ if(ix>0x48000000) z = (invsqrtpi*ss)/sqrtf(x);
else {
u = ponef(x); v = qonef(x);
- z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x);
+ z = invsqrtpi*(u*ss+v*cc)/sqrtf(x);
}
return z;
}
diff --git a/sysdeps/ieee754/flt-32/e_jnf.c b/sysdeps/ieee754/flt-32/e_jnf.c
index 4e634778d3..cd15ed7d4b 100644
--- a/sysdeps/ieee754/flt-32/e_jnf.c
+++ b/sysdeps/ieee754/flt-32/e_jnf.c
@@ -16,7 +16,9 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float
two = 2.0000000000e+00, /* 0x40000000 */
@@ -186,7 +188,7 @@ __ieee754_ynf(int n, float x)
float ret;
{
int32_t i,hx,ix;
- u_int32_t ib;
+ uint32_t ib;
int32_t sign;
float a, b, temp;
@@ -194,15 +196,15 @@ __ieee754_ynf(int n, float x)
ix = 0x7fffffff&hx;
/* if Y(n,NaN) is NaN */
if(__builtin_expect(ix>0x7f800000, 0)) return x+x;
- if(__builtin_expect(ix==0, 0))
- return -HUGE_VALF+x; /* -inf and overflow exception. */
- if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
sign = 1;
if(n<0){
n = -n;
sign = 1 - ((n&1)<<1);
}
if(n==0) return(__ieee754_y0f(x));
+ if(__builtin_expect(ix==0, 0))
+ return -sign/zero;
+ if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
SET_RESTORE_ROUNDF (FE_TONEAREST);
if(n==1) {
ret = sign*__ieee754_y1f(x);
diff --git a/sysdeps/ieee754/flt-32/e_lgammaf_r.c b/sysdeps/ieee754/flt-32/e_lgammaf_r.c
index 4d8a66bb39..8fdf9bb8bc 100644
--- a/sysdeps/ieee754/flt-32/e_lgammaf_r.c
+++ b/sysdeps/ieee754/flt-32/e_lgammaf_r.c
@@ -13,9 +13,10 @@
* ====================================================
*/
-#include <libc-internal.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libc-diag.h>
static const float
two23= 8.3886080000e+06, /* 0x4b000000 */
@@ -160,7 +161,7 @@ __ieee754_lgammaf_r(float x, int *signgamp)
}
if(hx<0) {
if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */
- return x/zero;
+ return fabsf (x)/zero;
if (ix > 0x40000000 /* X < 2.0f. */
&& ix < 0x41700000 /* X > -15.0f. */)
return __lgamma_negf (x, signgamp);
diff --git a/sysdeps/ieee754/flt-32/e_log10f.c b/sysdeps/ieee754/flt-32/e_log10f.c
index 2cd01b4a50..7f1ffdad77 100644
--- a/sysdeps/ieee754/flt-32/e_log10f.c
+++ b/sysdeps/ieee754/flt-32/e_log10f.c
@@ -34,7 +34,7 @@ __ieee754_log10f(float x)
k=0;
if (hx < 0x00800000) { /* x < 2**-126 */
if (__builtin_expect((hx&0x7fffffff)==0, 0))
- return -two25/(x-x); /* log(+-0)=-inf */
+ return -two25/fabsf (x); /* log(+-0)=-inf */
if (__builtin_expect(hx<0, 0))
return (x-x)/(x-x); /* log(-#) = NaN */
k -= 25; x *= two25; /* subnormal number, scale up x */
@@ -42,7 +42,7 @@ __ieee754_log10f(float x)
}
if (__builtin_expect(hx >= 0x7f800000, 0)) return x+x;
k += (hx>>23)-127;
- i = ((u_int32_t)k&0x80000000)>>31;
+ i = ((uint32_t)k&0x80000000)>>31;
hx = (hx&0x007fffff)|((0x7f-i)<<23);
y = (float)(k+i);
if (FIX_INT_FP_CONVERT_ZERO && y == 0.0f)
diff --git a/sysdeps/ieee754/flt-32/e_log2f.c b/sysdeps/ieee754/flt-32/e_log2f.c
index 857d13fb9b..62edc59cde 100644
--- a/sysdeps/ieee754/flt-32/e_log2f.c
+++ b/sysdeps/ieee754/flt-32/e_log2f.c
@@ -1,86 +1,95 @@
-/* e_logf.c -- float version of e_log.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- * adapted for log2 by Ulrich Drepper <drepper@cygnus.com>
- */
+/* Single-precision log2 function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <math.h>
-#include <math_private.h>
-#include <fix-int-fp-convert-zero.h>
+#include <stdint.h>
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+#include "math_config.h"
+
+/*
+LOG2F_TABLE_BITS = 4
+LOG2F_POLY_ORDER = 4
-static const float
-ln2 = 0.69314718055994530942,
-two25 = 3.355443200e+07, /* 0x4c000000 */
-Lg1 = 6.6666668653e-01, /* 3F2AAAAB */
-Lg2 = 4.0000000596e-01, /* 3ECCCCCD */
-Lg3 = 2.8571429849e-01, /* 3E924925 */
-Lg4 = 2.2222198546e-01, /* 3E638E29 */
-Lg5 = 1.8183572590e-01, /* 3E3A3325 */
-Lg6 = 1.5313838422e-01, /* 3E1CD04F */
-Lg7 = 1.4798198640e-01; /* 3E178897 */
+ULP error: 0.752 (nearest rounding.)
+Relative error: 1.9 * 2^-26 (before rounding.)
+*/
-static const float zero = 0.0;
+#define N (1 << LOG2F_TABLE_BITS)
+#define T __log2f_data.tab
+#define A __log2f_data.poly
+#define OFF 0x3f330000
float
-__ieee754_log2f(float x)
+__log2f (float x)
{
- float hfsq,f,s,z,R,w,t1,t2,dk;
- int32_t k,ix,i,j;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t z, r, r2, p, y, y0, invc, logc;
+ uint32_t ix, iz, top, tmp;
+ int k, i;
+
+ ix = asuint (x);
+#if WANT_ROUNDING
+ /* Fix sign of zero with downward rounding when x==1. */
+ if (__glibc_unlikely (ix == 0x3f800000))
+ return 0;
+#endif
+ if (__glibc_unlikely (ix - 0x00800000 >= 0x7f800000 - 0x00800000))
+ {
+ /* x < 0x1p-126 or inf or nan. */
+ if (ix * 2 == 0)
+ return __math_divzerof (1);
+ if (ix == 0x7f800000) /* log2(inf) == inf. */
+ return x;
+ if ((ix & 0x80000000) || ix * 2 >= 0xff000000)
+ return __math_invalidf (x);
+ /* x is subnormal, normalize it. */
+ ix = asuint (x * 0x1p23f);
+ ix -= 23 << 23;
+ }
+
+ /* x = 2^k z; where z is in range [OFF,2*OFF] and exact.
+ The range is split into N subintervals.
+ The ith subinterval contains z and c is near its center. */
+ tmp = ix - OFF;
+ i = (tmp >> (23 - LOG2F_TABLE_BITS)) % N;
+ top = tmp & 0xff800000;
+ iz = ix - top;
+ k = (int32_t) tmp >> 23; /* arithmetic shift */
+ invc = T[i].invc;
+ logc = T[i].logc;
+ z = (double_t) asfloat (iz);
- GET_FLOAT_WORD(ix,x);
+ /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */
+ r = z * invc - 1;
+ y0 = logc + (double_t) k;
- k=0;
- if (ix < 0x00800000) { /* x < 2**-126 */
- if (__builtin_expect((ix&0x7fffffff)==0, 0))
- return -two25/(x-x); /* log(+-0)=-inf */
- if (__builtin_expect(ix<0, 0))
- return (x-x)/(x-x); /* log(-#) = NaN */
- k -= 25; x *= two25; /* subnormal number, scale up x */
- GET_FLOAT_WORD(ix,x);
- }
- if (__builtin_expect(ix >= 0x7f800000, 0)) return x+x;
- k += (ix>>23)-127;
- ix &= 0x007fffff;
- i = (ix+(0x95f64<<3))&0x800000;
- SET_FLOAT_WORD(x,ix|(i^0x3f800000)); /* normalize x or x/2 */
- k += (i>>23);
- dk = (float)k;
- f = x-(float)1.0;
- if((0x007fffff&(15+ix))<16) { /* |f| < 2**-20 */
- if(f==zero)
- {
- if (FIX_INT_FP_CONVERT_ZERO && dk == 0.0f)
- dk = 0.0f;
- return dk;
- }
- R = f*f*((float)0.5-(float)0.33333333333333333*f);
- return dk-(R-f)/ln2;
- }
- s = f/((float)2.0+f);
- z = s*s;
- i = ix-(0x6147a<<3);
- w = z*z;
- j = (0x6b851<<3)-ix;
- t1= w*(Lg2+w*(Lg4+w*Lg6));
- t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7)));
- i |= j;
- R = t2+t1;
- if(i>0) {
- hfsq=(float)0.5*f*f;
- return dk-((hfsq-(s*(hfsq+R)))-f)/ln2;
- } else {
- return dk-((s*(f-R))-f)/ln2;
- }
+ /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */
+ r2 = r * r;
+ y = A[1] * r + A[2];
+ y = A[0] * r2 + y;
+ p = A[3] * r + y0;
+ y = y * r2 + p;
+ return (float) y;
}
-strong_alias (__ieee754_log2f, __log2f_finite)
+#ifndef __log2f
+strong_alias (__log2f, __ieee754_log2f)
+strong_alias (__log2f, __log2f_finite)
+versioned_symbol (libm, __log2f, log2f, GLIBC_2_27);
+libm_alias_float_other (__log2, log2)
+#endif
diff --git a/sysdeps/ieee754/flt-32/e_log2f_data.c b/sysdeps/ieee754/flt-32/e_log2f_data.c
new file mode 100644
index 0000000000..6390e9ce51
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/e_log2f_data.c
@@ -0,0 +1,44 @@
+/* Data definition for log2f.
+ Copyright (C) 2017-2018 Free Software 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_config.h"
+
+const struct log2f_data __log2f_data = {
+ .tab = {
+ { 0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2 },
+ { 0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2 },
+ { 0x1.49539f0f010bp+0, -0x1.7418b0a1fb77bp-2 },
+ { 0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2 },
+ { 0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2 },
+ { 0x1.25e227b0b8eap+0, -0x1.97c1d1b3b7afp-3 },
+ { 0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3 },
+ { 0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4 },
+ { 0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5 },
+ { 0x1p+0, 0x0p+0 },
+ { 0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4 },
+ { 0x1.ca4b31f026aap-1, 0x1.476a9543891bap-3 },
+ { 0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3 },
+ { 0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2 },
+ { 0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2 },
+ { 0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2 },
+ },
+ .poly = {
+ -0x1.712b6f70a7e4dp-2, 0x1.ecabf496832ep-2, -0x1.715479ffae3dep-1,
+ 0x1.715475f35c8b8p0,
+ }
+};
diff --git a/sysdeps/ieee754/flt-32/e_logf.c b/sysdeps/ieee754/flt-32/e_logf.c
index cf75e11781..879a673e12 100644
--- a/sysdeps/ieee754/flt-32/e_logf.c
+++ b/sysdeps/ieee754/flt-32/e_logf.c
@@ -1,85 +1,94 @@
-/* e_logf.c -- float version of e_log.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Single-precision log function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <math.h>
-#include <math_private.h>
+#include <stdint.h>
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+#include "math_config.h"
-static const float
-ln2_hi = 6.9313812256e-01, /* 0x3f317180 */
-ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */
-two25 = 3.355443200e+07, /* 0x4c000000 */
-Lg1 = 6.6666668653e-01, /* 3F2AAAAB */
-Lg2 = 4.0000000596e-01, /* 3ECCCCCD */
-Lg3 = 2.8571429849e-01, /* 3E924925 */
-Lg4 = 2.2222198546e-01, /* 3E638E29 */
-Lg5 = 1.8183572590e-01, /* 3E3A3325 */
-Lg6 = 1.5313838422e-01, /* 3E1CD04F */
-Lg7 = 1.4798198640e-01; /* 3E178897 */
+/*
+LOGF_TABLE_BITS = 4
+LOGF_POLY_ORDER = 4
-static const float zero = 0.0;
+ULP error: 0.818 (nearest rounding.)
+Relative error: 1.957 * 2^-26 (before rounding.)
+*/
+
+#define T __logf_data.tab
+#define A __logf_data.poly
+#define Ln2 __logf_data.ln2
+#define N (1 << LOGF_TABLE_BITS)
+#define OFF 0x3f330000
float
-__ieee754_logf(float x)
+__logf (float x)
{
- float hfsq,f,s,z,R,w,t1,t2,dk;
- int32_t k,ix,i,j;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t z, r, r2, y, y0, invc, logc;
+ uint32_t ix, iz, tmp;
+ int k, i;
+
+ ix = asuint (x);
+#if WANT_ROUNDING
+ /* Fix sign of zero with downward rounding when x==1. */
+ if (__glibc_unlikely (ix == 0x3f800000))
+ return 0;
+#endif
+ if (__glibc_unlikely (ix - 0x00800000 >= 0x7f800000 - 0x00800000))
+ {
+ /* x < 0x1p-126 or inf or nan. */
+ if (ix * 2 == 0)
+ return __math_divzerof (1);
+ if (ix == 0x7f800000) /* log(inf) == inf. */
+ return x;
+ if ((ix & 0x80000000) || ix * 2 >= 0xff000000)
+ return __math_invalidf (x);
+ /* x is subnormal, normalize it. */
+ ix = asuint (x * 0x1p23f);
+ ix -= 23 << 23;
+ }
+
+ /* x = 2^k z; where z is in range [OFF,2*OFF] and exact.
+ The range is split into N subintervals.
+ The ith subinterval contains z and c is near its center. */
+ tmp = ix - OFF;
+ i = (tmp >> (23 - LOGF_TABLE_BITS)) % N;
+ k = (int32_t) tmp >> 23; /* arithmetic shift */
+ iz = ix - (tmp & 0x1ff << 23);
+ invc = T[i].invc;
+ logc = T[i].logc;
+ z = (double_t) asfloat (iz);
- GET_FLOAT_WORD(ix,x);
+ /* log(x) = log1p(z/c-1) + log(c) + k*Ln2 */
+ r = z * invc - 1;
+ y0 = logc + (double_t) k * Ln2;
- k=0;
- if (ix < 0x00800000) { /* x < 2**-126 */
- if (__builtin_expect((ix&0x7fffffff)==0, 0))
- return -two25/zero; /* log(+-0)=-inf */
- if (__builtin_expect(ix<0, 0))
- return (x-x)/(x-x); /* log(-#) = NaN */
- k -= 25; x *= two25; /* subnormal number, scale up x */
- GET_FLOAT_WORD(ix,x);
- }
- if (__builtin_expect(ix >= 0x7f800000, 0)) return x+x;
- k += (ix>>23)-127;
- ix &= 0x007fffff;
- i = (ix+(0x95f64<<3))&0x800000;
- SET_FLOAT_WORD(x,ix|(i^0x3f800000)); /* normalize x or x/2 */
- k += (i>>23);
- f = x-(float)1.0;
- if((0x007fffff&(15+ix))<16) { /* |f| < 2**-20 */
- if(f==zero) {
- if(k==0) return zero; else {dk=(float)k;
- return dk*ln2_hi+dk*ln2_lo;}
- }
- R = f*f*((float)0.5-(float)0.33333333333333333*f);
- if(k==0) return f-R; else {dk=(float)k;
- return dk*ln2_hi-((R-dk*ln2_lo)-f);}
- }
- s = f/((float)2.0+f);
- dk = (float)k;
- z = s*s;
- i = ix-(0x6147a<<3);
- w = z*z;
- j = (0x6b851<<3)-ix;
- t1= w*(Lg2+w*(Lg4+w*Lg6));
- t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7)));
- i |= j;
- R = t2+t1;
- if(i>0) {
- hfsq=(float)0.5*f*f;
- if(k==0) return f-(hfsq-s*(hfsq+R)); else
- return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f);
- } else {
- if(k==0) return f-s*(f-R); else
- return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
- }
+ /* Pipelined polynomial evaluation to approximate log1p(r). */
+ r2 = r * r;
+ y = A[1] * r + A[2];
+ y = A[0] * r2 + y;
+ y = y * r2 + (y0 + r);
+ return (float) y;
}
-strong_alias (__ieee754_logf, __logf_finite)
+#ifndef __logf
+strong_alias (__logf, __ieee754_logf)
+strong_alias (__logf, __logf_finite)
+versioned_symbol (libm, __logf, logf, GLIBC_2_27);
+libm_alias_float_other (__log, log)
+#endif
diff --git a/sysdeps/ieee754/flt-32/e_logf_data.c b/sysdeps/ieee754/flt-32/e_logf_data.c
new file mode 100644
index 0000000000..0c71414a8a
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/e_logf_data.c
@@ -0,0 +1,44 @@
+/* Data definition for logf.
+ Copyright (C) 2017-2018 Free Software 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_config.h"
+
+const struct logf_data __logf_data = {
+ .tab = {
+ { 0x1.661ec79f8f3bep+0, -0x1.57bf7808caadep-2 },
+ { 0x1.571ed4aaf883dp+0, -0x1.2bef0a7c06ddbp-2 },
+ { 0x1.49539f0f010bp+0, -0x1.01eae7f513a67p-2 },
+ { 0x1.3c995b0b80385p+0, -0x1.b31d8a68224e9p-3 },
+ { 0x1.30d190c8864a5p+0, -0x1.6574f0ac07758p-3 },
+ { 0x1.25e227b0b8eap+0, -0x1.1aa2bc79c81p-3 },
+ { 0x1.1bb4a4a1a343fp+0, -0x1.a4e76ce8c0e5ep-4 },
+ { 0x1.12358f08ae5bap+0, -0x1.1973c5a611cccp-4 },
+ { 0x1.0953f419900a7p+0, -0x1.252f438e10c1ep-5 },
+ { 0x1p+0, 0x0p+0 },
+ { 0x1.e608cfd9a47acp-1, 0x1.aa5aa5df25984p-5 },
+ { 0x1.ca4b31f026aap-1, 0x1.c5e53aa362eb4p-4 },
+ { 0x1.b2036576afce6p-1, 0x1.526e57720db08p-3 },
+ { 0x1.9c2d163a1aa2dp-1, 0x1.bc2860d22477p-3 },
+ { 0x1.886e6037841edp-1, 0x1.1058bc8a07ee1p-2 },
+ { 0x1.767dcf5534862p-1, 0x1.4043057b6ee09p-2 },
+ },
+ .ln2 = 0x1.62e42fefa39efp-1,
+ .poly = {
+ -0x1.00ea348b88334p-2, 0x1.5575b0be00b6ap-2, -0x1.ffffef20a4123p-2,
+ }
+};
diff --git a/sysdeps/ieee754/flt-32/e_powf.c b/sysdeps/ieee754/flt-32/e_powf.c
index c72fe37d3b..ece83f0dd2 100644
--- a/sysdeps/ieee754/flt-32/e_powf.c
+++ b/sysdeps/ieee754/flt-32/e_powf.c
@@ -1,258 +1,224 @@
-/* e_powf.c -- float version of e_pow.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Single-precision pow function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#include <math.h>
-#include <math_private.h>
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY 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 const float huge = 1.0e+30, tiny = 1.0e-30;
+ 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/>. */
-static const float
-bp[] = {1.0, 1.5,},
-dp_h[] = { 0.0, 5.84960938e-01,}, /* 0x3f15c000 */
-dp_l[] = { 0.0, 1.56322085e-06,}, /* 0x35d1cfdc */
-zero = 0.0,
-one = 1.0,
-two = 2.0,
-two24 = 16777216.0, /* 0x4b800000 */
- /* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */
-L1 = 6.0000002384e-01, /* 0x3f19999a */
-L2 = 4.2857143283e-01, /* 0x3edb6db7 */
-L3 = 3.3333334327e-01, /* 0x3eaaaaab */
-L4 = 2.7272811532e-01, /* 0x3e8ba305 */
-L5 = 2.3066075146e-01, /* 0x3e6c3255 */
-L6 = 2.0697501302e-01, /* 0x3e53f142 */
-P1 = 1.6666667163e-01, /* 0x3e2aaaab */
-P2 = -2.7777778450e-03, /* 0xbb360b61 */
-P3 = 6.6137559770e-05, /* 0x388ab355 */
-P4 = -1.6533901999e-06, /* 0xb5ddea0e */
-P5 = 4.1381369442e-08, /* 0x3331bb4c */
-lg2 = 6.9314718246e-01, /* 0x3f317218 */
-lg2_h = 6.93145752e-01, /* 0x3f317200 */
-lg2_l = 1.42860654e-06, /* 0x35bfbe8c */
-ovt = 4.2995665694e-08, /* -(128-log2(ovfl+.5ulp)) */
-cp = 9.6179670095e-01, /* 0x3f76384f =2/(3ln2) */
-cp_h = 9.6179199219e-01, /* 0x3f763800 =head of cp */
-cp_l = 4.7017383622e-06, /* 0x369dc3a0 =tail of cp_h */
-ivln2 = 1.4426950216e+00, /* 0x3fb8aa3b =1/ln2 */
-ivln2_h = 1.4426879883e+00, /* 0x3fb8aa00 =16b 1/ln2*/
-ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
+#include <math.h>
+#include <stdint.h>
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+#include "math_config.h"
-float
-__ieee754_powf(float x, float y)
+/*
+POWF_LOG2_POLY_ORDER = 5
+EXP2F_TABLE_BITS = 5
+
+ULP error: 0.82 (~ 0.5 + relerr*2^24)
+relerr: 1.27 * 2^-26 (Relative error ~= 128*Ln2*relerr_log2 + relerr_exp2)
+relerr_log2: 1.83 * 2^-33 (Relative error of logx.)
+relerr_exp2: 1.69 * 2^-34 (Relative error of exp2(ylogx).)
+*/
+
+#define N (1 << POWF_LOG2_TABLE_BITS)
+#define T __powf_log2_data.tab
+#define A __powf_log2_data.poly
+#define OFF 0x3f330000
+
+/* Subnormal input is normalized so ix has negative biased exponent.
+ Output is multiplied by N (POWF_SCALE) if TOINT_INTRINICS is set. */
+static inline double_t
+log2_inline (uint32_t ix)
{
- float z,ax,z_h,z_l,p_h,p_l;
- float y1,t1,t2,r,s,t,u,v,w;
- int32_t i,j,k,yisint,n;
- int32_t hx,hy,ix,iy,is;
-
- GET_FLOAT_WORD(hx,x);
- GET_FLOAT_WORD(hy,y);
- ix = hx&0x7fffffff; iy = hy&0x7fffffff;
-
- /* y==zero: x**0 = 1 */
- if(iy==0) return one;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t z, r, r2, r4, p, q, y, y0, invc, logc;
+ uint32_t iz, top, tmp;
+ int k, i;
+
+ /* x = 2^k z; where z is in range [OFF,2*OFF] and exact.
+ The range is split into N subintervals.
+ The ith subinterval contains z and c is near its center. */
+ tmp = ix - OFF;
+ i = (tmp >> (23 - POWF_LOG2_TABLE_BITS)) % N;
+ top = tmp & 0xff800000;
+ iz = ix - top;
+ k = (int32_t) top >> (23 - POWF_SCALE_BITS); /* arithmetic shift */
+ invc = T[i].invc;
+ logc = T[i].logc;
+ z = (double_t) asfloat (iz);
+
+ /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */
+ r = z * invc - 1;
+ y0 = logc + (double_t) k;
+
+ /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */
+ r2 = r * r;
+ y = A[0] * r + A[1];
+ p = A[2] * r + A[3];
+ r4 = r2 * r2;
+ q = A[4] * r + y0;
+ q = p * r2 + q;
+ y = y * r4 + q;
+ return y;
+}
- /* x==+-1 */
- if(x == 1.0) return one;
- if(x == -1.0 && isinf(y)) return one;
+#undef N
+#undef T
+#define N (1 << EXP2F_TABLE_BITS)
+#define T __exp2f_data.tab
+#define SIGN_BIAS (1 << (EXP2F_TABLE_BITS + 11))
+
+/* The output of log2 and thus the input of exp2 is either scaled by N
+ (in case of fast toint intrinsics) or not. The unscaled xd must be
+ in [-1021,1023], sign_bias sets the sign of the result. */
+static inline double_t
+exp2_inline (double_t xd, uint32_t sign_bias)
+{
+ uint64_t ki, ski, t;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t kd, z, r, r2, y, s;
+
+#if TOINT_INTRINSICS
+# define C __exp2f_data.poly_scaled
+ /* N*x = k + r with r in [-1/2, 1/2] */
+ kd = roundtoint (xd); /* k */
+ ki = converttoint (xd);
+#else
+# define C __exp2f_data.poly
+# define SHIFT __exp2f_data.shift_scaled
+ /* x = k/N + r with r in [-1/(2N), 1/(2N)] */
+ kd = (double) (xd + SHIFT); /* Rounding to double precision is required. */
+ ki = asuint64 (kd);
+ kd -= SHIFT; /* k/N */
+#endif
+ r = xd - kd;
+
+ /* exp2(x) = 2^(k/N) * 2^r ~= s * (C0*r^3 + C1*r^2 + C2*r + 1) */
+ t = T[ki % N];
+ ski = ki + sign_bias;
+ t += ski << (52 - EXP2F_TABLE_BITS);
+ s = asdouble (t);
+ z = C[0] * r + C[1];
+ r2 = r * r;
+ y = C[2] * r + 1;
+ y = z * r2 + y;
+ y = y * s;
+ return y;
+}
- /* +-NaN return x+y */
- if(__builtin_expect(ix > 0x7f800000 ||
- iy > 0x7f800000, 0))
- return x+y;
+/* Returns 0 if not int, 1 if odd int, 2 if even int. */
+static inline int
+checkint (uint32_t iy)
+{
+ int e = iy >> 23 & 0xff;
+ if (e < 0x7f)
+ return 0;
+ if (e > 0x7f + 23)
+ return 2;
+ if (iy & ((1 << (0x7f + 23 - e)) - 1))
+ return 0;
+ if (iy & (1 << (0x7f + 23 - e)))
+ return 1;
+ return 2;
+}
- /* determine if y is an odd int when x < 0
- * yisint = 0 ... y is not an integer
- * yisint = 1 ... y is an odd int
- * yisint = 2 ... y is an even int
- */
- yisint = 0;
- if(hx<0) {
- if(iy>=0x4b800000) yisint = 2; /* even integer y */
- else if(iy>=0x3f800000) {
- k = (iy>>23)-0x7f; /* exponent */
- j = iy>>(23-k);
- if((j<<(23-k))==iy) yisint = 2-(j&1);
- }
- }
+static inline int
+zeroinfnan (uint32_t ix)
+{
+ return 2 * ix - 1 >= 2u * 0x7f800000 - 1;
+}
- /* special value of y */
- if (__builtin_expect(iy==0x7f800000, 0)) { /* y is +-inf */
- if (ix==0x3f800000)
- return y - y; /* inf**+-1 is NaN */
- else if (ix > 0x3f800000)/* (|x|>1)**+-inf = inf,0 */
- return (hy>=0)? y: zero;
- else /* (|x|<1)**-,+inf = inf,0 */
- return (hy<0)?-y: zero;
- }
- if(iy==0x3f800000) { /* y is +-1 */
- if(hy<0) return one/x; else return x;
- }
- if(hy==0x40000000) return x*x; /* y is 2 */
- if(hy==0x3f000000) { /* y is 0.5 */
- if(__builtin_expect(hx>=0, 1)) /* x >= +0 */
- return __ieee754_sqrtf(x);
+float
+__powf (float x, float y)
+{
+ uint32_t sign_bias = 0;
+ uint32_t ix, iy;
+
+ ix = asuint (x);
+ iy = asuint (y);
+ if (__glibc_unlikely (ix - 0x00800000 >= 0x7f800000 - 0x00800000
+ || zeroinfnan (iy)))
+ {
+ /* Either (x < 0x1p-126 or inf or nan) or (y is 0 or inf or nan). */
+ if (__glibc_unlikely (zeroinfnan (iy)))
+ {
+ if (2 * iy == 0)
+ return issignalingf_inline (x) ? x + y : 1.0f;
+ if (ix == 0x3f800000)
+ return issignalingf_inline (y) ? x + y : 1.0f;
+ if (2 * ix > 2u * 0x7f800000 || 2 * iy > 2u * 0x7f800000)
+ return x + y;
+ if (2 * ix == 2 * 0x3f800000)
+ return 1.0f;
+ if ((2 * ix < 2 * 0x3f800000) == !(iy & 0x80000000))
+ return 0.0f; /* |x|<1 && y==inf or |x|>1 && y==-inf. */
+ return y * y;
}
-
- ax = fabsf(x);
- /* special value of x */
- if(__builtin_expect(ix==0x7f800000||ix==0||ix==0x3f800000, 0)){
- z = ax; /*x is +-0,+-inf,+-1*/
- if(hy<0) z = one/z; /* z = (1/|x|) */
- if(hx<0) {
- if(((ix-0x3f800000)|yisint)==0) {
- z = (z-z)/(z-z); /* (-1)**non-int is NaN */
- } else if(yisint==1)
- z = -z; /* (x<0)**odd = -(|x|**odd) */
+ if (__glibc_unlikely (zeroinfnan (ix)))
+ {
+ float_t x2 = x * x;
+ if (ix & 0x80000000 && checkint (iy) == 1)
+ {
+ x2 = -x2;
+ sign_bias = 1;
}
- return z;
- }
-
- /* (x<0)**(non-int) is NaN */
- if(__builtin_expect(((((u_int32_t)hx>>31)-1)|yisint)==0, 0))
- return (x-x)/(x-x);
-
- /* |y| is huge */
- if(__builtin_expect(iy>0x4d000000, 0)) { /* if |y| > 2**27 */
- /* over/underflow if x is not close to one */
- if(ix<0x3f7ffff8) return (hy<0)? huge*huge:tiny*tiny;
- if(ix>0x3f800007) return (hy>0)? huge*huge:tiny*tiny;
- /* now |1-x| is tiny <= 2**-20, suffice to compute
- log(x) by x-x^2/2+x^3/3-x^4/4 */
- t = ax-1; /* t has 20 trailing zeros */
- w = (t*t)*((float)0.5-t*((float)0.333333333333-t*(float)0.25));
- u = ivln2_h*t; /* ivln2_h has 16 sig. bits */
- v = t*ivln2_l-w*ivln2;
- t1 = u+v;
- GET_FLOAT_WORD(is,t1);
- SET_FLOAT_WORD(t1,is&0xfffff000);
- t2 = v-(t1-u);
- } else {
- float s2,s_h,s_l,t_h,t_l;
- /* Avoid internal underflow for tiny y. The exact value
- of y does not matter if |y| <= 2**-32. */
- if (iy < 0x2f800000)
- SET_FLOAT_WORD (y, (hy & 0x80000000) | 0x2f800000);
- n = 0;
- /* take care subnormal number */
- if(ix<0x00800000)
- {ax *= two24; n -= 24; GET_FLOAT_WORD(ix,ax); }
- n += ((ix)>>23)-0x7f;
- j = ix&0x007fffff;
- /* determine interval */
- ix = j|0x3f800000; /* normalize ix */
- if(j<=0x1cc471) k=0; /* |x|<sqrt(3/2) */
- else if(j<0x5db3d7) k=1; /* |x|<sqrt(3) */
- else {k=0;n+=1;ix -= 0x00800000;}
- SET_FLOAT_WORD(ax,ix);
-
- /* compute s = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */
- u = ax-bp[k]; /* bp[0]=1.0, bp[1]=1.5 */
- v = one/(ax+bp[k]);
- s = u*v;
- s_h = s;
- GET_FLOAT_WORD(is,s_h);
- SET_FLOAT_WORD(s_h,is&0xfffff000);
- /* t_h=ax+bp[k] High */
- SET_FLOAT_WORD (t_h,
- ((((ix>>1)|0x20000000)+0x00400000+(k<<21))
- & 0xfffff000));
- t_l = ax - (t_h-bp[k]);
- s_l = v*((u-s_h*t_h)-s_h*t_l);
- /* compute log(ax) */
- s2 = s*s;
- r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6)))));
- r += s_l*(s_h+s);
- s2 = s_h*s_h;
- t_h = (float)3.0+s2+r;
- GET_FLOAT_WORD(is,t_h);
- SET_FLOAT_WORD(t_h,is&0xfffff000);
- t_l = r-((t_h-(float)3.0)-s2);
- /* u+v = s*(1+...) */
- u = s_h*t_h;
- v = s_l*t_h+t_l*s;
- /* 2/(3log2)*(s+...) */
- p_h = u+v;
- GET_FLOAT_WORD(is,p_h);
- SET_FLOAT_WORD(p_h,is&0xfffff000);
- p_l = v-(p_h-u);
- 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 = (float)n;
- t1 = (((z_h+z_l)+dp_h[k])+t);
- GET_FLOAT_WORD(is,t1);
- SET_FLOAT_WORD(t1,is&0xfffff000);
- t2 = z_l-(((t1-t)-dp_h[k])-z_h);
- }
-
- s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
- if(((((u_int32_t)hx>>31)-1)|(yisint-1))==0)
- s = -one; /* (-ve)**(odd int) */
-
- /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
- GET_FLOAT_WORD(is,y);
- SET_FLOAT_WORD(y1,is&0xfffff000);
- p_l = (y-y1)*t1+y*t2;
- p_h = y1*t1;
- z = p_l+p_h;
- GET_FLOAT_WORD(j,z);
- if (__builtin_expect(j>0x43000000, 0)) /* if z > 128 */
- return s*huge*huge; /* overflow */
- else if (__builtin_expect(j==0x43000000, 0)) { /* if z == 128 */
- if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */
+#if WANT_ERRNO
+ if (2 * ix == 0 && iy & 0x80000000)
+ return __math_divzerof (sign_bias);
+#endif
+ return iy & 0x80000000 ? 1 / x2 : x2;
}
- else if (__builtin_expect((j&0x7fffffff)>0x43160000, 0))/* z <= -150 */
- return s*tiny*tiny; /* underflow */
- else if (__builtin_expect((u_int32_t) j==0xc3160000, 0)){/* z == -150*/
- if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */
+ /* x and y are non-zero finite. */
+ if (ix & 0x80000000)
+ {
+ /* Finite x < 0. */
+ int yint = checkint (iy);
+ if (yint == 0)
+ return __math_invalidf (x);
+ if (yint == 1)
+ sign_bias = SIGN_BIAS;
+ ix &= 0x7fffffff;
}
- /*
- * compute 2**(p_h+p_l)
- */
- i = j&0x7fffffff;
- k = (i>>23)-0x7f;
- n = 0;
- if(i>0x3f000000) { /* if |z| > 0.5, set n = [z+0.5] */
- n = j+(0x00800000>>(k+1));
- k = ((n&0x7fffffff)>>23)-0x7f; /* new k for n */
- SET_FLOAT_WORD(t,n&~(0x007fffff>>k));
- n = ((n&0x007fffff)|0x00800000)>>(23-k);
- if(j<0) n = -n;
- p_h -= t;
+ if (ix < 0x00800000)
+ {
+ /* Normalize subnormal x so exponent becomes negative. */
+ ix = asuint (x * 0x1p23f);
+ ix &= 0x7fffffff;
+ ix -= 23 << 23;
}
- t = p_l+p_h;
- GET_FLOAT_WORD(is,t);
- SET_FLOAT_WORD(t,is&0xfffff000);
- u = t*lg2_h;
- v = (p_l-(t-p_h))*lg2+t*lg2_l;
- z = u+v;
- w = v-(z-u);
- t = z*z;
- t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
- r = (z*t1)/(t1-two)-(w+z*w);
- z = one-(r-z);
- GET_FLOAT_WORD(j,z);
- j += (n<<23);
- if((j>>23)<=0) /* subnormal output */
- {
- z = __scalbnf (z, n);
- float force_underflow = z * z;
- math_force_eval (force_underflow);
- }
- else SET_FLOAT_WORD(z,j);
- return s*z;
+ }
+ double_t logx = log2_inline (ix);
+ double_t ylogx = y * logx; /* Note: cannot overflow, y is single prec. */
+ if (__glibc_unlikely ((asuint64 (ylogx) >> 47 & 0xffff)
+ >= asuint64 (126.0 * POWF_SCALE) >> 47))
+ {
+ /* |y*log(x)| >= 126. */
+ if (ylogx > 0x1.fffffffd1d571p+6 * POWF_SCALE)
+ return __math_oflowf (sign_bias);
+ if (ylogx <= -150.0 * POWF_SCALE)
+ return __math_uflowf (sign_bias);
+#if WANT_ERRNO_UFLOW
+ if (ylogx < -149.0 * POWF_SCALE)
+ return __math_may_uflowf (sign_bias);
+#endif
+ }
+ return (float) exp2_inline (ylogx, sign_bias);
}
-strong_alias (__ieee754_powf, __powf_finite)
+#ifndef __powf
+strong_alias (__powf, __ieee754_powf)
+strong_alias (__powf, __powf_finite)
+versioned_symbol (libm, __powf, powf, GLIBC_2_27);
+libm_alias_float_other (__pow, pow)
+#endif
diff --git a/sysdeps/ieee754/flt-32/e_powf_log2_data.c b/sysdeps/ieee754/flt-32/e_powf_log2_data.c
new file mode 100644
index 0000000000..27cd6b7a81
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/e_powf_log2_data.c
@@ -0,0 +1,45 @@
+/* Data definition for powf.
+ Copyright (C) 2017-2018 Free Software 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_config.h"
+
+const struct powf_log2_data __powf_log2_data = {
+ .tab = {
+ { 0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2 * POWF_SCALE },
+ { 0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2 * POWF_SCALE },
+ { 0x1.49539f0f010bp+0, -0x1.7418b0a1fb77bp-2 * POWF_SCALE },
+ { 0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2 * POWF_SCALE },
+ { 0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2 * POWF_SCALE },
+ { 0x1.25e227b0b8eap+0, -0x1.97c1d1b3b7afp-3 * POWF_SCALE },
+ { 0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3 * POWF_SCALE },
+ { 0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4 * POWF_SCALE },
+ { 0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5 * POWF_SCALE },
+ { 0x1p+0, 0x0p+0 * POWF_SCALE },
+ { 0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4 * POWF_SCALE },
+ { 0x1.ca4b31f026aap-1, 0x1.476a9543891bap-3 * POWF_SCALE },
+ { 0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3 * POWF_SCALE },
+ { 0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2 * POWF_SCALE },
+ { 0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2 * POWF_SCALE },
+ { 0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2 * POWF_SCALE },
+ },
+ .poly = {
+ 0x1.27616c9496e0bp-2 * POWF_SCALE, -0x1.71969a075c67ap-2 * POWF_SCALE,
+ 0x1.ec70a6ca7baddp-2 * POWF_SCALE, -0x1.7154748bef6c8p-1 * POWF_SCALE,
+ 0x1.71547652ab82bp0 * POWF_SCALE,
+ }
+};
diff --git a/sysdeps/ieee754/flt-32/e_rem_pio2f.c b/sysdeps/ieee754/flt-32/e_rem_pio2f.c
index 0928373498..bd871a26c2 100644
--- a/sysdeps/ieee754/flt-32/e_rem_pio2f.c
+++ b/sysdeps/ieee754/flt-32/e_rem_pio2f.c
@@ -100,7 +100,7 @@ int32_t __ieee754_rem_pio2f(float x, float *y)
if(ix<0x4016cbe4) { /* |x| < 3pi/4, special case with n=+-1 */
if(hx>0) {
z = x - pio2_1;
- if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */
+ if((ix&0xffffffc0)!=0x3fc90fc0) { /* 24+24 bit pi OK */
y[0] = z - pio2_1t;
y[1] = (z-y[0])-pio2_1t;
} else { /* near pi/2, use 24+24+24 bit pi */
@@ -111,7 +111,7 @@ int32_t __ieee754_rem_pio2f(float x, float *y)
return 1;
} else { /* negative x */
z = x + pio2_1;
- if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */
+ if((ix&0xffffffc0)!=0x3fc90fc0) { /* 24+24 bit pi OK */
y[0] = z + pio2_1t;
y[1] = (z-y[0])+pio2_1t;
} else { /* near pi/2, use 24+24+24 bit pi */
@@ -131,7 +131,7 @@ int32_t __ieee754_rem_pio2f(float x, float *y)
if(n<32&&(int32_t)(ix&0xffffff00)!=npio2_hw[n-1]) {
y[0] = r-w; /* quick check no cancellation */
} else {
- u_int32_t high;
+ uint32_t high;
j = ix>>23;
y[0] = r-w;
GET_FLOAT_WORD(high,y[0]);
diff --git a/sysdeps/ieee754/flt-32/e_remainderf.c b/sysdeps/ieee754/flt-32/e_remainderf.c
index cc0167862e..8e78784e0f 100644
--- a/sysdeps/ieee754/flt-32/e_remainderf.c
+++ b/sysdeps/ieee754/flt-32/e_remainderf.c
@@ -23,7 +23,7 @@ float
__ieee754_remainderf(float x, float p)
{
int32_t hx,hp;
- u_int32_t sx;
+ uint32_t sx;
float p_half;
GET_FLOAT_WORD(hx,x);
diff --git a/sysdeps/ieee754/flt-32/e_sinhf.c b/sysdeps/ieee754/flt-32/e_sinhf.c
index 6100d95c55..20f7db81ea 100644
--- a/sysdeps/ieee754/flt-32/e_sinhf.c
+++ b/sysdeps/ieee754/flt-32/e_sinhf.c
@@ -15,7 +15,9 @@
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float one = 1.0, shuge = 1.0e37;
diff --git a/sysdeps/ieee754/flt-32/e_sqrtf.c b/sysdeps/ieee754/flt-32/e_sqrtf.c
index c02206ac01..6025da19cf 100644
--- a/sysdeps/ieee754/flt-32/e_sqrtf.c
+++ b/sysdeps/ieee754/flt-32/e_sqrtf.c
@@ -24,7 +24,7 @@ __ieee754_sqrtf(float x)
float z;
int32_t sign = (int)0x80000000;
int32_t ix,s,q,m,t,i;
- u_int32_t r;
+ uint32_t r;
GET_FLOAT_WORD(ix,x);
diff --git a/sysdeps/ieee754/flt-32/k_rem_pio2f.c b/sysdeps/ieee754/flt-32/k_rem_pio2f.c
index 392afdbb6c..ea4915b765 100644
--- a/sysdeps/ieee754/flt-32/k_rem_pio2f.c
+++ b/sysdeps/ieee754/flt-32/k_rem_pio2f.c
@@ -18,7 +18,9 @@ static char rcsid[] = "$NetBSD: k_rem_pio2f.c,v 1.4 1995/05/10 20:46:28 jtc Exp
#endif
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libc-diag.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 +124,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];
@@ -172,7 +183,17 @@ recompute:
float fv = 0.0;
for (i=jz;i>=0;i--) fv = math_narrow_eval (fv + fq[i]);
y[0] = (ih==0)? fv: -fv;
+ /* GCC mainline (to be GCC 9), as of 2018-05-22 on
+ i686, warns that fq[0] may be used uninitialized.
+ This is not possible because jz is always
+ nonnegative when the above loop initializing fq is
+ executed, because the result is never zero to full
+ precision (this function is not called for zero
+ arguments). */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized");
fv = math_narrow_eval (fq[0]-fv);
+ DIAG_POP_NEEDS_COMMENT;
for (i=1;i<=jz;i++) fv = math_narrow_eval (fv + fq[i]);
y[1] = (ih==0)? fv: -fv;
break;
diff --git a/sysdeps/ieee754/flt-32/k_sinf.c b/sysdeps/ieee754/flt-32/k_sinf.c
index a195d59466..dcf3c35358 100644
--- a/sysdeps/ieee754/flt-32/k_sinf.c
+++ b/sysdeps/ieee754/flt-32/k_sinf.c
@@ -20,6 +20,7 @@ static char rcsid[] = "$NetBSD: k_sinf.c,v 1.4 1995/05/10 20:46:33 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float
half = 5.0000000000e-01,/* 0x3f000000 */
diff --git a/sysdeps/ieee754/flt-32/k_tanf.c b/sysdeps/ieee754/flt-32/k_tanf.c
index 9f0e55860f..228ece2075 100644
--- a/sysdeps/ieee754/flt-32/k_tanf.c
+++ b/sysdeps/ieee754/flt-32/k_tanf.c
@@ -20,6 +20,7 @@ static char rcsid[] = "$NetBSD: k_tanf.c,v 1.4 1995/05/10 20:46:39 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float
one = 1.0000000000e+00, /* 0x3f800000 */
pio4 = 7.8539812565e-01, /* 0x3f490fda */
diff --git a/sysdeps/ieee754/flt-32/lgamma_negf.c b/sysdeps/ieee754/flt-32/lgamma_negf.c
index f15719b059..01edb0b8de 100644
--- a/sysdeps/ieee754/flt-32/lgamma_negf.c
+++ b/sysdeps/ieee754/flt-32/lgamma_negf.c
@@ -1,5 +1,5 @@
/* lgammaf expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const float lgamma_zeros[][2] =
diff --git a/sysdeps/ieee754/flt-32/math_config.h b/sysdeps/ieee754/flt-32/math_config.h
new file mode 100644
index 0000000000..9c4ef30173
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/math_config.h
@@ -0,0 +1,164 @@
+/* Configuration for math routines.
+ Copyright (C) 2017-2018 Free Software 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_CONFIG_H
+#define _MATH_CONFIG_H
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#ifndef WANT_ROUNDING
+/* Correct special case results in non-nearest rounding modes. */
+# define WANT_ROUNDING 1
+#endif
+#ifndef WANT_ERRNO
+/* Set errno according to ISO C with (math_errhandling & MATH_ERRNO) != 0. */
+# define WANT_ERRNO 1
+#endif
+#ifndef WANT_ERRNO_UFLOW
+/* Set errno to ERANGE if result underflows to 0 (in all rounding modes). */
+# define WANT_ERRNO_UFLOW (WANT_ROUNDING && WANT_ERRNO)
+#endif
+
+#ifndef TOINT_INTRINSICS
+# define TOINT_INTRINSICS 0
+#endif
+#ifndef TOINT_RINT
+# define TOINT_RINT 0
+#endif
+#ifndef TOINT_SHIFT
+# define TOINT_SHIFT 1
+#endif
+
+static inline uint32_t
+asuint (float f)
+{
+ union
+ {
+ float f;
+ uint32_t i;
+ } u = {f};
+ return u.i;
+}
+
+static inline float
+asfloat (uint32_t i)
+{
+ union
+ {
+ uint32_t i;
+ float f;
+ } u = {i};
+ return u.f;
+}
+
+static inline uint64_t
+asuint64 (double f)
+{
+ union
+ {
+ double f;
+ uint64_t i;
+ } u = {f};
+ return u.i;
+}
+
+static inline double
+asdouble (uint64_t i)
+{
+ union
+ {
+ uint64_t i;
+ double f;
+ } u = {i};
+ return u.f;
+}
+
+static inline int
+issignalingf_inline (float x)
+{
+ uint32_t ix = asuint (x);
+ if (HIGH_ORDER_BIT_IS_SET_FOR_SNAN)
+ return (ix & 0x7fc00000) == 0x7fc00000;
+ return 2 * (ix ^ 0x00400000) > 2u * 0x7fc00000;
+}
+
+#define NOINLINE __attribute__ ((noinline))
+
+attribute_hidden float __math_oflowf (uint32_t);
+attribute_hidden float __math_uflowf (uint32_t);
+attribute_hidden float __math_may_uflowf (uint32_t);
+attribute_hidden float __math_divzerof (uint32_t);
+attribute_hidden float __math_invalidf (float);
+
+/* Shared between expf, exp2f and powf. */
+#define EXP2F_TABLE_BITS 5
+#define EXP2F_POLY_ORDER 3
+extern const struct exp2f_data
+{
+ uint64_t tab[1 << EXP2F_TABLE_BITS];
+ double shift_scaled;
+ double poly[EXP2F_POLY_ORDER];
+ double shift;
+ double invln2_scaled;
+ double poly_scaled[EXP2F_POLY_ORDER];
+} __exp2f_data attribute_hidden;
+
+#define LOGF_TABLE_BITS 4
+#define LOGF_POLY_ORDER 4
+extern const struct logf_data
+{
+ struct
+ {
+ double invc, logc;
+ } tab[1 << LOGF_TABLE_BITS];
+ double ln2;
+ double poly[LOGF_POLY_ORDER - 1]; /* First order coefficient is 1. */
+} __logf_data attribute_hidden;
+
+#define LOG2F_TABLE_BITS 4
+#define LOG2F_POLY_ORDER 4
+extern const struct log2f_data
+{
+ struct
+ {
+ double invc, logc;
+ } tab[1 << LOG2F_TABLE_BITS];
+ double poly[LOG2F_POLY_ORDER];
+} __log2f_data attribute_hidden;
+
+#define POWF_LOG2_TABLE_BITS 4
+#define POWF_LOG2_POLY_ORDER 5
+#if TOINT_INTRINSICS
+# define POWF_SCALE_BITS EXP2F_TABLE_BITS
+#else
+# define POWF_SCALE_BITS 0
+#endif
+#define POWF_SCALE ((double) (1 << POWF_SCALE_BITS))
+extern const struct powf_log2_data
+{
+ struct
+ {
+ double invc, logc;
+ } tab[1 << POWF_LOG2_TABLE_BITS];
+ double poly[POWF_LOG2_POLY_ORDER];
+} __powf_log2_data attribute_hidden;
+
+#endif
diff --git a/sysdeps/ieee754/flt-32/math_errf.c b/sysdeps/ieee754/flt-32/math_errf.c
new file mode 100644
index 0000000000..5bc7ac6ef5
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/math_errf.c
@@ -0,0 +1,76 @@
+/* Single-precision math error handling.
+ Copyright (C) 2017-2018 Free Software 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_config.h"
+
+#if WANT_ERRNO
+# include <errno.h>
+/* NOINLINE reduces code size. */
+NOINLINE static float
+with_errnof (float y, int e)
+{
+ errno = e;
+ return y;
+}
+#else
+# define with_errnof(x, e) (x)
+#endif
+
+/* NOINLINE prevents fenv semantics breaking optimizations. */
+NOINLINE static float
+xflowf (uint32_t sign, float y)
+{
+ y = (sign ? -y : y) * y;
+ return with_errnof (y, ERANGE);
+}
+
+attribute_hidden float
+__math_uflowf (uint32_t sign)
+{
+ return xflowf (sign, 0x1p-95f);
+}
+
+#if WANT_ERRNO_UFLOW
+/* Underflows to zero in some non-nearest rounding mode, setting errno
+ is valid even if the result is non-zero, but in the subnormal range. */
+attribute_hidden float
+__math_may_uflowf (uint32_t sign)
+{
+ return xflowf (sign, 0x1.4p-75f);
+}
+#endif
+
+attribute_hidden float
+__math_oflowf (uint32_t sign)
+{
+ return xflowf (sign, 0x1p97f);
+}
+
+attribute_hidden float
+__math_divzerof (uint32_t sign)
+{
+ float y = 0;
+ return with_errnof ((sign ? -1 : 1) / y, ERANGE);
+}
+
+attribute_hidden float
+__math_invalidf (float x)
+{
+ float y = (x - x) / (x - x);
+ return isnan (x) ? y : with_errnof (y, EDOM);
+}
diff --git a/sysdeps/ieee754/flt-32/mpn2flt.c b/sysdeps/ieee754/flt-32/mpn2flt.c
index 7f40f56d33..accca55fde 100644
--- a/sysdeps/ieee754/flt-32/mpn2flt.c
+++ b/sysdeps/ieee754/flt-32/mpn2flt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/flt-32/s_asinhf.c b/sysdeps/ieee754/flt-32/s_asinhf.c
index da9cafb600..0812b54dca 100644
--- a/sysdeps/ieee754/flt-32/s_asinhf.c
+++ b/sysdeps/ieee754/flt-32/s_asinhf.c
@@ -16,6 +16,8 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-float.h>
static const float
one = 1.0000000000e+00, /* 0x3F800000 */
@@ -39,12 +41,12 @@ __asinhf(float x)
} else {
float xa = fabsf(x);
if (ix>0x40000000) { /* 2**14 > |x| > 2.0 */
- w = __ieee754_logf(2.0f*xa+one/(__ieee754_sqrtf(xa*xa+one)+xa));
+ w = __ieee754_logf(2.0f*xa+one/(sqrtf(xa*xa+one)+xa));
} else { /* 2.0 > |x| > 2**-14 */
float t = xa*xa;
- w =__log1pf(xa+t/(one+__ieee754_sqrtf(one+t)));
+ w =__log1pf(xa+t/(one+sqrtf(one+t)));
}
}
return __copysignf(w, x);
}
-weak_alias (__asinhf, asinhf)
+libm_alias_float (__asinh, asinh)
diff --git a/sysdeps/ieee754/flt-32/s_atanf.c b/sysdeps/ieee754/flt-32/s_atanf.c
index e322a1d41f..f61b0f5ef6 100644
--- a/sysdeps/ieee754/flt-32/s_atanf.c
+++ b/sysdeps/ieee754/flt-32/s_atanf.c
@@ -20,6 +20,8 @@ static char rcsid[] = "$NetBSD: s_atanf.c,v 1.4 1995/05/10 20:46:47 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-float.h>
static const float atanhi[] = {
4.6364760399e-01, /* atan(0.5)hi 0x3eed6338 */
@@ -98,4 +100,4 @@ float __atanf(float x)
return (hx<0)? -z:z;
}
}
-weak_alias (__atanf, atanf)
+libm_alias_float (__atan, atan)
diff --git a/sysdeps/ieee754/flt-32/s_cbrtf.c b/sysdeps/ieee754/flt-32/s_cbrtf.c
index b9e2b3738c..afa1454399 100644
--- a/sysdeps/ieee754/flt-32/s_cbrtf.c
+++ b/sysdeps/ieee754/flt-32/s_cbrtf.c
@@ -1,5 +1,5 @@
/* Compute cubic root of float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dirk Alboth <dirka@uni-paderborn.de> and
Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#define CBRT2 1.2599210498948731648 /* 2^(1/3) */
@@ -60,4 +61,4 @@ __cbrtf (float x)
return __ldexpf (x > 0.0 ? ym : -ym, xe / 3);
}
-weak_alias (__cbrtf, cbrtf)
+libm_alias_float (__cbrt, cbrt)
diff --git a/sysdeps/ieee754/flt-32/s_ceilf.c b/sysdeps/ieee754/flt-32/s_ceilf.c
index 37659ea2ae..f289ec2341 100644
--- a/sysdeps/ieee754/flt-32/s_ceilf.c
+++ b/sysdeps/ieee754/flt-32/s_ceilf.c
@@ -15,27 +15,25 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
-static const float huge = 1.0e30;
-
float
__ceilf(float x)
{
int32_t i0,j0;
- u_int32_t i;
+ uint32_t i;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f;
if(j0<23) {
- if(j0<0) { /* raise inexact if x != 0 */
- math_force_eval(huge+x);/* return 0*sign(x) if |x|<1 */
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
if(i0<0) {i0=0x80000000;}
else if(i0!=0) { i0=0x3f800000;}
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
- math_force_eval(huge+x); /* raise inexact flag */
if(i0>0) i0 += (0x00800000)>>j0;
i0 &= (~i);
}
@@ -47,5 +45,5 @@ __ceilf(float x)
return x;
}
#ifndef __ceilf
-weak_alias (__ceilf, ceilf)
+libm_alias_float (__ceil, ceil)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_copysignf.c b/sysdeps/ieee754/flt-32/s_copysignf.c
index 1621836065..3c4ac7ce68 100644
--- a/sysdeps/ieee754/flt-32/s_copysignf.c
+++ b/sysdeps/ieee754/flt-32/s_copysignf.c
@@ -25,13 +25,14 @@ static char rcsid[] = "$NetBSD: s_copysignf.c,v 1.4 1995/05/10 20:46:59 jtc Exp
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
float __copysignf(float x, float y)
{
- u_int32_t ix,iy;
+ uint32_t ix,iy;
GET_FLOAT_WORD(ix,x);
GET_FLOAT_WORD(iy,y);
SET_FLOAT_WORD(x,(ix&0x7fffffff)|(iy&0x80000000));
return x;
}
-weak_alias (__copysignf, copysignf)
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/ieee754/flt-32/s_cosf.c b/sysdeps/ieee754/flt-32/s_cosf.c
index 0affd406bb..061264d259 100644
--- a/sysdeps/ieee754/flt-32/s_cosf.c
+++ b/sysdeps/ieee754/flt-32/s_cosf.c
@@ -1,25 +1,26 @@
-/* s_cosf.c -- float version of s_cos.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Compute cosine of argument.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_cosf.c,v 1.4 1995/05/10 20:47:03 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
+#include "s_sincosf.h"
#ifndef COSF
# define COSF_FUNC __cosf
@@ -27,37 +28,123 @@ static char rcsid[] = "$NetBSD: s_cosf.c,v 1.4 1995/05/10 20:47:03 jtc Exp $";
# define COSF_FUNC COSF
#endif
-float COSF_FUNC(float x)
+float
+COSF_FUNC (float x)
{
- float y[2],z=0.0;
- int32_t n,ix;
-
- GET_FLOAT_WORD(ix,x);
-
- /* |x| ~< pi/4 */
- ix &= 0x7fffffff;
- if(ix <= 0x3f490fd8) return __kernel_cosf(x,z);
-
- /* cos(Inf or NaN) is NaN */
- else if (ix>=0x7f800000) {
- if (ix == 0x7f800000)
- __set_errno (EDOM);
- return x-x;
+ double theta = x;
+ double abstheta = fabs (theta);
+ if (isless (abstheta, M_PI_4))
+ {
+ double cx;
+ if (abstheta >= 0x1p-5)
+ {
+ const double theta2 = theta * theta;
+ /* Chebyshev polynomial of the form for cos:
+ * 1 + x^2 (C0 + x^2 (C1 + x^2 (C2 + x^2 (C3 + x^2 * C4)))). */
+ cx = C3 + theta2 * C4;
+ cx = C2 + theta2 * cx;
+ cx = C1 + theta2 * cx;
+ cx = C0 + theta2 * cx;
+ cx = 1. + theta2 * cx;
+ return cx;
}
-
- /* argument reduction needed */
- else {
- n = __ieee754_rem_pio2f(x,y);
- switch(n&3) {
- case 0: return __kernel_cosf(y[0],y[1]);
- case 1: return -__kernel_sinf(y[0],y[1],1);
- case 2: return -__kernel_cosf(y[0],y[1]);
- default:
- return __kernel_sinf(y[0],y[1],1);
+ else if (abstheta >= 0x1p-27)
+ {
+ /* A simpler Chebyshev approximation is close enough for this range:
+ * 1 + x^2 (CC0 + x^3 * CC1). */
+ const double theta2 = theta * theta;
+ cx = CC0 + theta * theta2 * CC1;
+ cx = 1.0 + theta2 * cx;
+ return cx;
+ }
+ else
+ {
+ /* For small enough |theta|, this is close enough. */
+ return 1.0 - abstheta;
+ }
+ }
+ else /* |theta| >= Pi/4. */
+ {
+ if (isless (abstheta, 9 * M_PI_4))
+ {
+ /* There are cases where FE_UPWARD rounding mode can
+ produce a result of abstheta * inv_PI_4 == 9,
+ where abstheta < 9pi/4, so the domain for
+ pio2_table must go to 5 (9 / 2 + 1). */
+ unsigned int n = (abstheta * inv_PI_4) + 1;
+ theta = abstheta - pio2_table[n / 2];
+ return reduced_cos (theta, n);
+ }
+ else if (isless (abstheta, INFINITY))
+ {
+ if (abstheta < 0x1p+23)
+ {
+ unsigned int n = ((unsigned int) (abstheta * inv_PI_4)) + 1;
+ double x = n / 2;
+ theta = (abstheta - x * PI_2_hi) - x * PI_2_lo;
+ /* Argument reduction needed. */
+ return reduced_cos (theta, n);
}
+ else /* |theta| >= 2^23. */
+ {
+ x = fabsf (x);
+ int exponent;
+ GET_FLOAT_WORD (exponent, x);
+ exponent = (exponent >> FLOAT_EXPONENT_SHIFT)
+ - FLOAT_EXPONENT_BIAS;
+ exponent += 3;
+ exponent /= 28;
+ double a = invpio4_table[exponent] * x;
+ double b = invpio4_table[exponent + 1] * x;
+ double c = invpio4_table[exponent + 2] * x;
+ double d = invpio4_table[exponent + 3] * x;
+ uint64_t l = a;
+ l &= ~0x7;
+ a -= l;
+ double e = a + b;
+ l = e;
+ e = a - l;
+ if (l & 1)
+ {
+ e -= 1.0;
+ e += b;
+ e += c;
+ e += d;
+ e *= M_PI_4;
+ return reduced_cos (e, l + 1);
+ }
+ else
+ {
+ e += b;
+ e += c;
+ e += d;
+ if (e <= 1.0)
+ {
+ e *= M_PI_4;
+ return reduced_cos (e, l + 1);
+ }
+ else
+ {
+ l++;
+ e -= 2.0;
+ e *= M_PI_4;
+ return reduced_cos (e, l + 1);
+ }
+ }
+ }
+ }
+ else
+ {
+ int32_t ix;
+ GET_FLOAT_WORD (ix, abstheta);
+ /* cos(Inf or NaN) is NaN. */
+ if (ix == 0x7f800000) /* Inf. */
+ __set_errno (EDOM);
+ return x - x;
}
+ }
}
#ifndef COSF
-weak_alias (__cosf, cosf)
+libm_alias_float (__cos, cos)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_erff.c b/sysdeps/ieee754/flt-32/s_erff.c
index c8b6287503..693934d59a 100644
--- a/sysdeps/ieee754/flt-32/s_erff.c
+++ b/sysdeps/ieee754/flt-32/s_erff.c
@@ -20,7 +20,10 @@ static char rcsid[] = "$NetBSD: s_erff.c,v 1.4 1995/05/10 20:47:07 jtc Exp $";
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-float.h>
#include <fix-int-fp-convert-zero.h>
static const float
@@ -104,7 +107,7 @@ float __erff(float x)
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7f800000) { /* erf(nan)=nan */
- i = ((u_int32_t)hx>>31)<<1;
+ i = ((uint32_t)hx>>31)<<1;
return (float)(1-i)+one/x; /* erf(+-inf)=+-1 */
}
@@ -152,7 +155,7 @@ float __erff(float x)
r = __ieee754_expf(-z*z-(float)0.5625)*__ieee754_expf((z-x)*(z+x)+R/S);
if(hx>=0) return one-r/x; else return r/x-one;
}
-weak_alias (__erff, erff)
+libm_alias_float (__erf, erf)
float __erfcf(float x)
{
@@ -162,7 +165,7 @@ float __erfcf(float x)
ix = hx&0x7fffffff;
if(ix>=0x7f800000) { /* erfc(nan)=nan */
/* erfc(+-inf)=0,2 */
- float ret = (float)(((u_int32_t)hx>>31)<<1)+one/x;
+ float ret = (float)(((uint32_t)hx>>31)<<1)+one/x;
if (FIX_INT_FP_CONVERT_ZERO && ret == 0.0f)
return 0.0f;
return ret;
@@ -227,4 +230,4 @@ float __erfcf(float x)
return two-tiny;
}
}
-weak_alias (__erfcf, erfcf)
+libm_alias_float (__erfc, erfc)
diff --git a/sysdeps/ieee754/flt-32/s_expm1f.c b/sysdeps/ieee754/flt-32/s_expm1f.c
index c515d25e28..b72cc0d083 100644
--- a/sysdeps/ieee754/flt-32/s_expm1f.c
+++ b/sysdeps/ieee754/flt-32/s_expm1f.c
@@ -16,7 +16,10 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-float.h>
static const float huge = 1.0e+30;
static const float tiny = 1.0e-30;
@@ -39,7 +42,7 @@ __expm1f(float x)
{
float y,hi,lo,c,t,e,hxs,hfx,r1;
int32_t k,xsb;
- u_int32_t hx;
+ uint32_t hx;
GET_FLOAT_WORD(hx,x);
xsb = hx&0x80000000; /* sign bit of x */
@@ -127,4 +130,4 @@ __expm1f(float x)
}
return y;
}
-weak_alias (__expm1f, expm1f)
+libm_alias_float (__expm1, expm1)
diff --git a/sysdeps/ieee754/flt-32/s_fabsf.c b/sysdeps/ieee754/flt-32/s_fabsf.c
index 297abe64bd..d3f6eb830b 100644
--- a/sysdeps/ieee754/flt-32/s_fabsf.c
+++ b/sysdeps/ieee754/flt-32/s_fabsf.c
@@ -22,9 +22,10 @@ static char rcsid[] = "$NetBSD: s_fabsf.c,v 1.4 1995/05/10 20:47:15 jtc Exp $";
*/
#include <math.h>
+#include <libm-alias-float.h>
float __fabsf(float x)
{
return __builtin_fabsf (x);
}
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/ieee754/flt-32/s_finitef.c b/sysdeps/ieee754/flt-32/s_finitef.c
index 4c5b339235..b9ae048559 100644
--- a/sysdeps/ieee754/flt-32/s_finitef.c
+++ b/sysdeps/ieee754/flt-32/s_finitef.c
@@ -35,7 +35,7 @@ int FINITEF(float x)
{
int32_t ix;
GET_FLOAT_WORD(ix,x);
- return (int)((u_int32_t)((ix&0x7f800000)-0x7f800000)>>31);
+ return (int)((uint32_t)((ix&0x7f800000)-0x7f800000)>>31);
}
hidden_def (__finitef)
weak_alias (__finitef, finitef)
diff --git a/sysdeps/ieee754/flt-32/s_floorf.c b/sysdeps/ieee754/flt-32/s_floorf.c
index 99d6c01833..12aed343a0 100644
--- a/sysdeps/ieee754/flt-32/s_floorf.c
+++ b/sysdeps/ieee754/flt-32/s_floorf.c
@@ -18,32 +18,28 @@
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floorf(x).
*/
#include <math.h>
#include <math_private.h>
-
-static const float huge = 1.0e30;
+#include <libm-alias-float.h>
float
__floorf(float x)
{
int32_t i0,j0;
- u_int32_t i;
+ uint32_t i;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f;
if(j0<23) {
- if(j0<0) { /* raise inexact if x != 0 */
- math_force_eval(huge+x);/* return 0*sign(x) if |x|<1 */
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
if(i0>=0) {i0=0;}
else if((i0&0x7fffffff)!=0)
{ i0=0xbf800000;}
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
- math_force_eval(huge+x); /* raise inexact flag */
if(i0<0) i0 += (0x00800000)>>j0;
i0 &= (~i);
}
@@ -55,5 +51,5 @@ __floorf(float x)
return x;
}
#ifndef __floorf
-weak_alias (__floorf, floorf)
+libm_alias_float (__floor, floor)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_fpclassifyf.c b/sysdeps/ieee754/flt-32/s_fpclassifyf.c
index 480557e2ae..01df9f26f5 100644
--- a/sysdeps/ieee754/flt-32/s_fpclassifyf.c
+++ b/sysdeps/ieee754/flt-32/s_fpclassifyf.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -25,7 +25,7 @@
int
__fpclassifyf (float x)
{
- u_int32_t wx;
+ uint32_t wx;
int retval = FP_NORMAL;
GET_FLOAT_WORD (wx, x);
diff --git a/sysdeps/ieee754/flt-32/s_frexpf.c b/sysdeps/ieee754/flt-32/s_frexpf.c
index 67a28d3603..b7403bf0d8 100644
--- a/sysdeps/ieee754/flt-32/s_frexpf.c
+++ b/sysdeps/ieee754/flt-32/s_frexpf.c
@@ -19,6 +19,7 @@ static char rcsid[] = "$NetBSD: s_frexpf.c,v 1.5 1995/05/10 20:47:26 jtc Exp $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
static const float
two25 = 3.3554432000e+07; /* 0x4c000000 */
@@ -29,7 +30,7 @@ float __frexpf(float x, int *eptr)
GET_FLOAT_WORD(hx,x);
ix = 0x7fffffff&hx;
*eptr = 0;
- if(ix>=0x7f800000||(ix==0)) return x; /* 0,inf,nan */
+ if(ix>=0x7f800000||(ix==0)) return x + x; /* 0,inf,nan */
if (ix<0x00800000) { /* subnormal */
x *= two25;
GET_FLOAT_WORD(hx,x);
@@ -41,4 +42,4 @@ float __frexpf(float x, int *eptr)
SET_FLOAT_WORD(x,hx);
return x;
}
-weak_alias (__frexpf, frexpf)
+libm_alias_float (__frexp, frexp)
diff --git a/sysdeps/ieee754/flt-32/s_fromfpf.c b/sysdeps/ieee754/flt-32/s_fromfpf.c
new file mode 100644
index 0000000000..d0c83b8f5d
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_fromfpf.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpf
+#include <s_fromfpf_main.c>
+libm_alias_float (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/flt-32/s_fromfpf_main.c b/sysdeps/ieee754/flt-32/s_fromfpf_main.c
new file mode 100644
index 0000000000..b220b7212c
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_fromfpf_main.c
@@ -0,0 +1,83 @@
+/* Round to integer type. flt-32 version.
+ Copyright (C) 2016-2018 Free Software 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 <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x7f
+#define MANT_DIG 24
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (float x, int round, unsigned int width)
+{
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint32_t ix;
+ GET_FLOAT_WORD (ix, x);
+ bool negative = (ix & 0x80000000) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ ix &= 0x7fffffff;
+ if (ix == 0)
+ return 0;
+ int exponent = ix >> (MANT_DIG - 1);
+ exponent -= BIAS;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+
+ ix &= ((1U << (MANT_DIG - 1)) - 1);
+ ix |= 1U << (MANT_DIG - 1);
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ if (exponent >= MANT_DIG - 1)
+ {
+ uret = ix;
+ uret <<= exponent - (MANT_DIG - 1);
+ half_bit = false;
+ more_bits = false;
+ }
+ else if (exponent >= -1)
+ {
+ uint32_t h = 1U << (MANT_DIG - 2 - exponent);
+ half_bit = (ix & h) != 0;
+ more_bits = (ix & (h - 1)) != 0;
+ uret = ix >> (MANT_DIG - 1 - exponent);
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/flt-32/s_fromfpxf.c b/sysdeps/ieee754/flt-32/s_fromfpxf.c
new file mode 100644
index 0000000000..01d9247c31
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_fromfpxf.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxf
+#include <s_fromfpf_main.c>
+libm_alias_float (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/flt-32/s_getpayloadf.c b/sysdeps/ieee754/flt-32/s_getpayloadf.c
new file mode 100644
index 0000000000..98a16f9347
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_getpayloadf.c
@@ -0,0 +1,35 @@
+/* Get NaN payload. flt-32 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+float
+__getpayloadf (const float *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;
+}
+libm_alias_float (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/flt-32/s_isnanf.c b/sysdeps/ieee754/flt-32/s_isnanf.c
index 820b31a2b4..52129735fe 100644
--- a/sysdeps/ieee754/flt-32/s_isnanf.c
+++ b/sysdeps/ieee754/flt-32/s_isnanf.c
@@ -32,7 +32,7 @@ int __isnanf(float x)
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
ix = 0x7f800000 - ix;
- return (int)(((u_int32_t)(ix))>>31);
+ return (int)(((uint32_t)(ix))>>31);
}
hidden_def (__isnanf)
weak_alias (__isnanf, isnanf)
diff --git a/sysdeps/ieee754/flt-32/s_issignalingf.c b/sysdeps/ieee754/flt-32/s_issignalingf.c
index 2409ff408c..a18ba3e586 100644
--- a/sysdeps/ieee754/flt-32/s_issignalingf.c
+++ b/sysdeps/ieee754/flt-32/s_issignalingf.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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;
+ uint32_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_llrintf.c b/sysdeps/ieee754/flt-32/s_llrintf.c
index 56415d34f8..7c64bb2db4 100644
--- a/sysdeps/ieee754/flt-32/s_llrintf.c
+++ b/sysdeps/ieee754/flt-32/s_llrintf.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,9 @@
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <fix-fp-int-convert-overflow.h>
static const float two23[2] =
@@ -36,7 +38,7 @@ long long int
__llrintf (float x)
{
int32_t j0;
- u_int32_t i0;
+ uint32_t i0;
float w;
float t;
long long int result;
@@ -83,4 +85,4 @@ __llrintf (float x)
return sx ? -result : result;
}
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/ieee754/flt-32/s_llroundf.c b/sysdeps/ieee754/flt-32/s_llroundf.c
index 1d35f71321..5457f9fa88 100644
--- a/sysdeps/ieee754/flt-32/s_llroundf.c
+++ b/sysdeps/ieee754/flt-32/s_llroundf.c
@@ -1,5 +1,5 @@
/* Round float value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <fix-fp-int-convert-overflow.h>
@@ -29,7 +30,7 @@ long long int
__llroundf (float x)
{
int32_t j0;
- u_int32_t i;
+ uint32_t i;
long long int result;
int sign;
@@ -70,4 +71,4 @@ __llroundf (float x)
return sign * result;
}
-weak_alias (__llroundf, llroundf)
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/ieee754/flt-32/s_log1pf.c b/sysdeps/ieee754/flt-32/s_log1pf.c
index ade60a2e27..a06190a589 100644
--- a/sysdeps/ieee754/flt-32/s_log1pf.c
+++ b/sysdeps/ieee754/flt-32/s_log1pf.c
@@ -15,7 +15,10 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libc-diag.h>
static const float
ln2_hi = 6.9313812256e-01, /* 0x3f317180 */
@@ -97,6 +100,18 @@ __log1pf(float x)
s = f/((float)2.0+f);
z = s*s;
R = z*(Lp1+z*(Lp2+z*(Lp3+z*(Lp4+z*(Lp5+z*(Lp6+z*Lp7))))));
- if(k==0) return f-(hfsq-s*(hfsq+R)); else
- return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f);
+ if (k == 0)
+ return f - (hfsq - s * (hfsq + R));
+ else
+ {
+ /* With GCC 7 when compiling with -Os the compiler warns
+ that c might be used uninitialized. This can't be true
+ because k must be 0 for c to be uninitialized and we
+ handled that computation earlier without using c. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
+ return k * ln2_hi - ((hfsq - (s * (hfsq + R)
+ + (k * ln2_lo + c))) - f);
+ DIAG_POP_NEEDS_COMMENT;
+ }
}
diff --git a/sysdeps/ieee754/flt-32/s_logbf.c b/sysdeps/ieee754/flt-32/s_logbf.c
index 9ae20e332a..e0d4f3fbab 100644
--- a/sysdeps/ieee754/flt-32/s_logbf.c
+++ b/sysdeps/ieee754/flt-32/s_logbf.c
@@ -15,6 +15,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <fix-int-fp-convert-zero.h>
float
@@ -38,4 +39,4 @@ __logbf (float x)
return 0.0f;
return (float) (rix - 127);
}
-weak_alias (__logbf, logbf)
+libm_alias_float (__logb, logb)
diff --git a/sysdeps/ieee754/flt-32/s_lrintf.c b/sysdeps/ieee754/flt-32/s_lrintf.c
index 3b480a2107..5171377a4e 100644
--- a/sysdeps/ieee754/flt-32/s_lrintf.c
+++ b/sysdeps/ieee754/flt-32/s_lrintf.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,9 @@
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <fix-fp-int-convert-overflow.h>
static const float two23[2] =
@@ -36,7 +38,7 @@ long int
__lrintf (float x)
{
int32_t j0;
- u_int32_t i0;
+ uint32_t i0;
float w;
float t;
long int result;
@@ -83,4 +85,4 @@ __lrintf (float x)
return sx ? -result : result;
}
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/ieee754/flt-32/s_lroundf.c b/sysdeps/ieee754/flt-32/s_lroundf.c
index 116c9e0627..20e7216640 100644
--- a/sysdeps/ieee754/flt-32/s_lroundf.c
+++ b/sysdeps/ieee754/flt-32/s_lroundf.c
@@ -1,5 +1,5 @@
/* Round float value to long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <fix-fp-int-convert-overflow.h>
@@ -29,7 +30,7 @@ long int
__lroundf (float x)
{
int32_t j0;
- u_int32_t i;
+ uint32_t i;
long int result;
int sign;
@@ -70,4 +71,4 @@ __lroundf (float x)
return sign * result;
}
-weak_alias (__lroundf, lroundf)
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/ieee754/flt-32/s_modff.c b/sysdeps/ieee754/flt-32/s_modff.c
index 23f6a902b3..45a94594fe 100644
--- a/sysdeps/ieee754/flt-32/s_modff.c
+++ b/sysdeps/ieee754/flt-32/s_modff.c
@@ -15,6 +15,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
static const float one = 1.0;
@@ -22,7 +23,7 @@ float
__modff(float x, float *iptr)
{
int32_t i0,j0;
- u_int32_t i;
+ uint32_t i;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f; /* exponent of x */
if(__builtin_expect(j0<23, 1)) { /* integer part in x */
@@ -32,7 +33,7 @@ __modff(float x, float *iptr)
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) { /* x is integral */
- u_int32_t ix;
+ uint32_t ix;
*iptr = x;
GET_FLOAT_WORD(ix,x);
SET_FLOAT_WORD(x,ix&0x80000000); /* return +-0 */
@@ -51,4 +52,4 @@ __modff(float x, float *iptr)
return x;
}
}
-weak_alias (__modff, modff)
+libm_alias_float (__modf, modf)
diff --git a/sysdeps/ieee754/flt-32/s_nearbyintf.c b/sysdeps/ieee754/flt-32/s_nearbyintf.c
index 5aebefafcf..4dfe491f27 100644
--- a/sysdeps/ieee754/flt-32/s_nearbyintf.c
+++ b/sysdeps/ieee754/flt-32/s_nearbyintf.c
@@ -17,7 +17,9 @@
#include <fenv.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-float.h>
static const float
TWO23[2]={
@@ -37,7 +39,7 @@ __nearbyintf(float x)
if(j0<23) {
if(j0<0) {
libc_feholdexceptf (&env);
- w = TWO23[sx]+x;
+ w = TWO23[sx] + math_opt_barrier (x);
t = w-TWO23[sx];
math_force_eval (t);
libc_fesetenvf (&env);
@@ -50,10 +52,10 @@ __nearbyintf(float x)
else return x; /* x is integral */
}
libc_feholdexceptf (&env);
- w = TWO23[sx]+x;
+ w = TWO23[sx] + math_opt_barrier (x);
t = w-TWO23[sx];
math_force_eval (t);
libc_fesetenvf (&env);
return t;
}
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/ieee754/flt-32/s_nextafterf.c b/sysdeps/ieee754/flt-32/s_nextafterf.c
index 625d54b768..aa49df5a9e 100644
--- a/sysdeps/ieee754/flt-32/s_nextafterf.c
+++ b/sysdeps/ieee754/flt-32/s_nextafterf.c
@@ -19,7 +19,9 @@ static char rcsid[] = "$NetBSD: s_nextafterf.c,v 1.4 1995/05/10 20:48:01 jtc Exp
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <float.h>
float __nextafterf(float x, float y)
@@ -70,4 +72,4 @@ float __nextafterf(float x, float y)
SET_FLOAT_WORD(x,hx);
return x;
}
-weak_alias (__nextafterf, nextafterf)
+libm_alias_float (__nextafter, nextafter)
diff --git a/sysdeps/ieee754/flt-32/s_nextupf.c b/sysdeps/ieee754/flt-32/s_nextupf.c
new file mode 100644
index 0000000000..87ec7ba21f
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_nextupf.c
@@ -0,0 +1,48 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-float.h>
+
+/* Return the least floating-point number greater than X. */
+float
+__nextupf (float x)
+{
+ int32_t hx, ix;
+
+ GET_FLOAT_WORD (hx, x);
+ ix = hx & 0x7fffffff;
+ if (ix == 0)
+ return FLT_TRUE_MIN;
+ if (ix > 0x7f800000) /* x is nan. */
+ return x + x;
+ if (hx >= 0)
+ { /* x > 0. */
+ if (isinf (x))
+ return x;
+ hx += 1;
+ }
+ else
+ hx -= 1;
+ SET_FLOAT_WORD (x, hx);
+ return x;
+}
+
+libm_alias_float (__nextup, nextup)
diff --git a/sysdeps/ieee754/flt-32/s_remquof.c b/sysdeps/ieee754/flt-32/s_remquof.c
index ecf831deaf..66704d46c2 100644
--- a/sysdeps/ieee754/flt-32/s_remquof.c
+++ b/sysdeps/ieee754/flt-32/s_remquof.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,13 +23,14 @@
static const float zero = 0.0;
+#include <libm-alias-float.h>
float
__remquof (float x, float y, int *quo)
{
int32_t hx,hy;
- u_int32_t sx;
+ uint32_t sx;
int cquo, qs;
GET_FLOAT_WORD (hx, x);
@@ -107,4 +108,4 @@ __remquof (float x, float y, int *quo)
x = -x;
return x;
}
-weak_alias (__remquof, remquof)
+libm_alias_float (__remquo, remquo)
diff --git a/sysdeps/ieee754/flt-32/s_rintf.c b/sysdeps/ieee754/flt-32/s_rintf.c
index 8a907488f7..db6f260a0b 100644
--- a/sysdeps/ieee754/flt-32/s_rintf.c
+++ b/sysdeps/ieee754/flt-32/s_rintf.c
@@ -15,6 +15,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
static const float
TWO23[2]={
@@ -46,5 +47,5 @@ __rintf(float x)
return w-TWO23[sx];
}
#ifndef __rintf
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_roundevenf.c b/sysdeps/ieee754/flt-32/s_roundevenf.c
new file mode 100644
index 0000000000..90f991d5c4
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_roundevenf.c
@@ -0,0 +1,70 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ flt-32 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+#define BIAS 0x7f
+#define MANT_DIG 24
+#define MAX_EXP (2 * BIAS + 1)
+
+float
+__roundevenf (float x)
+{
+ uint32_t ix, ux;
+ GET_FLOAT_WORD (ix, x);
+ ux = ix & 0x7fffffff;
+ int exponent = ux >> (MANT_DIG - 1);
+ if (exponent >= BIAS + MANT_DIG - 1)
+ {
+ /* Integer, infinity or NaN. */
+ if (exponent == MAX_EXP)
+ /* Infinity or NaN; quiet signaling NaNs. */
+ return x + x;
+ else
+ return x;
+ }
+ else if (exponent >= BIAS)
+ {
+ /* At least 1; not necessarily an integer. Locate the bits with
+ exponents 0 and -1 (when the unbiased exponent is 0, the bit
+ with exponent 0 is implicit, but as the bias is odd it is OK
+ to take it from the low bit of the exponent). */
+ int int_pos = (BIAS + MANT_DIG - 1) - exponent;
+ int half_pos = int_pos - 1;
+ uint32_t half_bit = 1U << half_pos;
+ uint32_t int_bit = 1U << int_pos;
+ if ((ix & (int_bit | (half_bit - 1))) != 0)
+ /* Carry into the exponent works correctly. No need to test
+ whether HALF_BIT is set. */
+ ix += half_bit;
+ ix &= ~(int_bit - 1);
+ }
+ else if (exponent == BIAS - 1 && ux > 0x3f000000)
+ /* Interval (0.5, 1). */
+ ix = (ix & 0x80000000) | 0x3f800000;
+ else
+ /* Rounds to 0. */
+ ix &= 0x80000000;
+ SET_FLOAT_WORD (x, ix);
+ return x;
+}
+libm_alias_float (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/flt-32/s_roundf.c b/sysdeps/ieee754/flt-32/s_roundf.c
index a75d98f384..7c95125d9c 100644
--- a/sysdeps/ieee754/flt-32/s_roundf.c
+++ b/sysdeps/ieee754/flt-32/s_roundf.c
@@ -1,5 +1,5 @@
/* Round float to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,7 @@
#include <math.h>
#include <math_private.h>
-
-
-static const float huge = 1.0e30;
+#include <libm-alias-float.h>
float
@@ -36,21 +34,17 @@ __roundf (float x)
{
if (j0 < 0)
{
- math_force_eval (huge + x);
-
i0 &= 0x80000000;
if (j0 == -1)
i0 |= 0x3f800000;
}
else
{
- u_int32_t i = 0x007fffff >> j0;
+ uint32_t i = 0x007fffff >> j0;
if ((i0 & i) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
- /* Raise inexact if x != 0. */
i0 += 0x00400000 >> j0;
i0 &= ~i;
}
@@ -67,4 +61,4 @@ __roundf (float x)
SET_FLOAT_WORD (x, i0);
return x;
}
-weak_alias (__roundf, roundf)
+libm_alias_float (__round, round)
diff --git a/sysdeps/ieee754/flt-32/s_setpayloadf.c b/sysdeps/ieee754/flt-32/s_setpayloadf.c
new file mode 100644
index 0000000000..6faf26bdcc
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_setpayloadf.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayloadf
+#include <s_setpayloadf_main.c>
+libm_alias_float (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/flt-32/s_setpayloadf_main.c b/sysdeps/ieee754/flt-32/s_setpayloadf_main.c
new file mode 100644
index 0000000000..a01c8677a3
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_setpayloadf_main.c
@@ -0,0 +1,54 @@
+/* Set NaN payload. flt-32 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-float.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x7f
+#define PAYLOAD_DIG 22
+#define EXPLICIT_MANT_DIG 23
+
+int
+FUNC (float *x, float payload)
+{
+ uint32_t ix;
+ GET_FLOAT_WORD (ix, payload);
+ int exponent = ix >> EXPLICIT_MANT_DIG;
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. */
+ if (exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && ix == 0))
+ || (ix & ((1U << (BIAS + EXPLICIT_MANT_DIG - exponent)) - 1)) != 0)
+ {
+ SET_FLOAT_WORD (*x, 0);
+ return 1;
+ }
+ if (ix != 0)
+ {
+ ix &= (1U << EXPLICIT_MANT_DIG) - 1;
+ ix |= 1U << EXPLICIT_MANT_DIG;
+ ix >>= BIAS + EXPLICIT_MANT_DIG - exponent;
+ }
+ ix |= 0x7f800000 | (SET_HIGH_BIT ? 0x400000 : 0);
+ SET_FLOAT_WORD (*x, ix);
+ return 0;
+}
diff --git a/sysdeps/ieee754/flt-32/s_setpayloadsigf.c b/sysdeps/ieee754/flt-32/s_setpayloadsigf.c
new file mode 100644
index 0000000000..f08c877dc6
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_setpayloadsigf.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsigf
+#include <s_setpayloadf_main.c>
+libm_alias_float (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/flt-32/s_signbitf.c b/sysdeps/ieee754/flt-32/s_signbitf.c
index 3cdde778d5..e97c6261d2 100644
--- a/sysdeps/ieee754/flt-32/s_signbitf.c
+++ b/sysdeps/ieee754/flt-32/s_signbitf.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/flt-32/s_sincosf.c b/sysdeps/ieee754/flt-32/s_sincosf.c
index e0737b5ce4..d4a5a1b22c 100644
--- a/sysdeps/ieee754/flt-32/s_sincosf.c
+++ b/sysdeps/ieee754/flt-32/s_sincosf.c
@@ -1,7 +1,6 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 2017-2018 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
@@ -19,8 +18,9 @@
#include <errno.h>
#include <math.h>
-
#include <math_private.h>
+#include <libm-alias-float.h>
+#include "s_sincosf.h"
#ifndef SINCOSF
# define SINCOSF_FUNC __sincosf
@@ -31,54 +31,141 @@
void
SINCOSF_FUNC (float x, float *sinx, float *cosx)
{
- int32_t ix;
-
- /* High word of x. */
- GET_FLOAT_WORD (ix, x);
-
- /* |x| ~< pi/4 */
- ix &= 0x7fffffff;
- if (ix <= 0x3f490fd8)
- {
- *sinx = __kernel_sinf (x, 0.0, 0);
- *cosx = __kernel_cosf (x, 0.0);
- }
- else if (ix>=0x7f800000)
+ double cx;
+ double theta = x;
+ double abstheta = fabs (theta);
+ /* If |x|< Pi/4. */
+ if (isless (abstheta, M_PI_4))
{
- /* sin(Inf or NaN) is NaN */
- *sinx = *cosx = x - x;
- if (ix == 0x7f800000)
- __set_errno (EDOM);
+ if (abstheta >= 0x1p-5) /* |x| >= 2^-5. */
+ {
+ const double theta2 = theta * theta;
+ /* Chebyshev polynomial of the form for sin and cos. */
+ cx = C3 + theta2 * C4;
+ cx = C2 + theta2 * cx;
+ cx = C1 + theta2 * cx;
+ cx = C0 + theta2 * cx;
+ cx = 1.0 + theta2 * cx;
+ *cosx = cx;
+ cx = S3 + theta2 * S4;
+ cx = S2 + theta2 * cx;
+ cx = S1 + theta2 * cx;
+ cx = S0 + theta2 * cx;
+ cx = theta + theta * theta2 * cx;
+ *sinx = cx;
+ }
+ else if (abstheta >= 0x1p-27) /* |x| >= 2^-27. */
+ {
+ /* A simpler Chebyshev approximation is close enough for this range:
+ for sin: x+x^3*(SS0+x^2*SS1)
+ for cos: 1.0+x^2*(CC0+x^3*CC1). */
+ const double theta2 = theta * theta;
+ cx = CC0 + theta * theta2 * CC1;
+ cx = 1.0 + theta2 * cx;
+ *cosx = cx;
+ cx = SS0 + theta2 * SS1;
+ cx = theta + theta * theta2 * cx;
+ *sinx = cx;
+ }
+ else
+ {
+ /* Handle some special cases. */
+ if (theta)
+ *sinx = theta - (theta * SMALL);
+ else
+ *sinx = theta;
+ *cosx = 1.0 - abstheta;
+ }
}
- else
+ else /* |x| >= Pi/4. */
{
- /* Argument reduction needed. */
- float y[2];
- int n;
-
- n = __ieee754_rem_pio2f (x, y);
- switch (n & 3)
+ unsigned int signbit = isless (x, 0);
+ if (isless (abstheta, 9 * M_PI_4)) /* |x| < 9*Pi/4. */
+ {
+ /* There are cases where FE_UPWARD rounding mode can
+ produce a result of abstheta * inv_PI_4 == 9,
+ where abstheta < 9pi/4, so the domain for
+ pio2_table must go to 5 (9 / 2 + 1). */
+ unsigned int n = (abstheta * inv_PI_4) + 1;
+ theta = abstheta - pio2_table[n / 2];
+ *sinx = reduced_sin (theta, n, signbit);
+ *cosx = reduced_cos (theta, n);
+ }
+ else if (isless (abstheta, INFINITY))
+ {
+ if (abstheta < 0x1p+23) /* |x| < 2^23. */
+ {
+ unsigned int n = ((unsigned int) (abstheta * inv_PI_4)) + 1;
+ double x = n / 2;
+ theta = (abstheta - x * PI_2_hi) - x * PI_2_lo;
+ /* Argument reduction needed. */
+ *sinx = reduced_sin (theta, n, signbit);
+ *cosx = reduced_cos (theta, n);
+ }
+ else /* |x| >= 2^23. */
+ {
+ x = fabsf (x);
+ int exponent;
+ GET_FLOAT_WORD (exponent, x);
+ exponent
+ = (exponent >> FLOAT_EXPONENT_SHIFT) - FLOAT_EXPONENT_BIAS;
+ exponent += 3;
+ exponent /= 28;
+ double a = invpio4_table[exponent] * x;
+ double b = invpio4_table[exponent + 1] * x;
+ double c = invpio4_table[exponent + 2] * x;
+ double d = invpio4_table[exponent + 3] * x;
+ uint64_t l = a;
+ l &= ~0x7;
+ a -= l;
+ double e = a + b;
+ l = e;
+ e = a - l;
+ if (l & 1)
+ {
+ e -= 1.0;
+ e += b;
+ e += c;
+ e += d;
+ e *= M_PI_4;
+ *sinx = reduced_sin (e, l + 1, signbit);
+ *cosx = reduced_cos (e, l + 1);
+ }
+ else
+ {
+ e += b;
+ e += c;
+ e += d;
+ if (e <= 1.0)
+ {
+ e *= M_PI_4;
+ *sinx = reduced_sin (e, l + 1, signbit);
+ *cosx = reduced_cos (e, l + 1);
+ }
+ else
+ {
+ l++;
+ e -= 2.0;
+ e *= M_PI_4;
+ *sinx = reduced_sin (e, l + 1, signbit);
+ *cosx = reduced_cos (e, l + 1);
+ }
+ }
+ }
+ }
+ else
{
- case 0:
- *sinx = __kernel_sinf (y[0], y[1], 1);
- *cosx = __kernel_cosf (y[0], y[1]);
- break;
- case 1:
- *sinx = __kernel_cosf (y[0], y[1]);
- *cosx = -__kernel_sinf (y[0], y[1], 1);
- break;
- case 2:
- *sinx = -__kernel_sinf (y[0], y[1], 1);
- *cosx = -__kernel_cosf (y[0], y[1]);
- break;
- default:
- *sinx = -__kernel_cosf (y[0], y[1]);
- *cosx = __kernel_sinf (y[0], y[1], 1);
- break;
+ int32_t ix;
+ /* High word of x. */
+ GET_FLOAT_WORD (ix, abstheta);
+ /* sin/cos(Inf or NaN) is NaN. */
+ *sinx = *cosx = x - x;
+ if (ix == 0x7f800000)
+ __set_errno (EDOM);
}
}
}
#ifndef SINCOSF
-weak_alias (__sincosf, sincosf)
+libm_alias_float (__sincos, sincos)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_sincosf.h b/sysdeps/ieee754/flt-32/s_sincosf.h
new file mode 100644
index 0000000000..35b5eee536
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_sincosf.h
@@ -0,0 +1,155 @@
+/* Used by sinf, cosf and sincosf functions.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* Chebyshev constants for cos, range -PI/4 - PI/4. */
+static const double C0 = -0x1.ffffffffe98aep-2;
+static const double C1 = 0x1.55555545c50c7p-5;
+static const double C2 = -0x1.6c16b348b6874p-10;
+static const double C3 = 0x1.a00eb9ac43ccp-16;
+static const double C4 = -0x1.23c97dd8844d7p-22;
+
+/* Chebyshev constants for sin, range -PI/4 - PI/4. */
+static const double S0 = -0x1.5555555551cd9p-3;
+static const double S1 = 0x1.1111110c2688bp-7;
+static const double S2 = -0x1.a019f8b4bd1f9p-13;
+static const double S3 = 0x1.71d7264e6b5b4p-19;
+static const double S4 = -0x1.a947e1674b58ap-26;
+
+/* Chebyshev constants for sin, range 2^-27 - 2^-5. */
+static const double SS0 = -0x1.555555543d49dp-3;
+static const double SS1 = 0x1.110f475cec8c5p-7;
+
+/* Chebyshev constants for cos, range 2^-27 - 2^-5. */
+static const double CC0 = -0x1.fffffff5cc6fdp-2;
+static const double CC1 = 0x1.55514b178dac5p-5;
+
+/* PI/2 with 98 bits of accuracy. */
+static const double PI_2_hi = 0x1.921fb544p+0;
+static const double PI_2_lo = 0x1.0b4611a626332p-34;
+
+static const double SMALL = 0x1p-50; /* 2^-50. */
+static const double inv_PI_4 = 0x1.45f306dc9c883p+0; /* 4/PI. */
+
+#define FLOAT_EXPONENT_SHIFT 23
+#define FLOAT_EXPONENT_BIAS 127
+
+static const double pio2_table[] = {
+ 0 * M_PI_2,
+ 1 * M_PI_2,
+ 2 * M_PI_2,
+ 3 * M_PI_2,
+ 4 * M_PI_2,
+ 5 * M_PI_2
+};
+
+static const double invpio4_table[] = {
+ 0x0p+0,
+ 0x1.45f306cp+0,
+ 0x1.c9c882ap-28,
+ 0x1.4fe13a8p-58,
+ 0x1.f47d4dp-85,
+ 0x1.bb81b6cp-112,
+ 0x1.4acc9ep-142,
+ 0x1.0e4107cp-169
+};
+
+static const double ones[] = { 1.0, -1.0 };
+
+/* Compute the sine value using Chebyshev polynomials where
+ THETA is the range reduced absolute value of the input
+ and it is less than Pi/4,
+ N is calculated as trunc(|x|/(Pi/4)) + 1 and it is used to decide
+ whether a sine or cosine approximation is more accurate and
+ SIGNBIT is used to add the correct sign after the Chebyshev
+ polynomial is computed. */
+static inline float
+reduced_sin (const double theta, const unsigned int n,
+ const unsigned int signbit)
+{
+ double sx;
+ const double theta2 = theta * theta;
+ /* We are operating on |x|, so we need to add back the original
+ signbit for sinf. */
+ double sign;
+ /* Determine positive or negative primary interval. */
+ sign = ones[((n >> 2) & 1) ^ signbit];
+ /* Are we in the primary interval of sin or cos? */
+ if ((n & 2) == 0)
+ {
+ /* Here sinf() is calculated using sin Chebyshev polynomial:
+ x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))). */
+ sx = S3 + theta2 * S4; /* S3+x^2*S4. */
+ sx = S2 + theta2 * sx; /* S2+x^2*(S3+x^2*S4). */
+ sx = S1 + theta2 * sx; /* S1+x^2*(S2+x^2*(S3+x^2*S4)). */
+ sx = S0 + theta2 * sx; /* S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4))). */
+ sx = theta + theta * theta2 * sx;
+ }
+ else
+ {
+ /* Here sinf() is calculated using cos Chebyshev polynomial:
+ 1.0+x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))). */
+ sx = C3 + theta2 * C4; /* C3+x^2*C4. */
+ sx = C2 + theta2 * sx; /* C2+x^2*(C3+x^2*C4). */
+ sx = C1 + theta2 * sx; /* C1+x^2*(C2+x^2*(C3+x^2*C4)). */
+ sx = C0 + theta2 * sx; /* C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4))). */
+ sx = 1.0 + theta2 * sx;
+ }
+
+ /* Add in the signbit and assign the result. */
+ return sign * sx;
+}
+
+/* Compute the cosine value using Chebyshev polynomials where
+ THETA is the range reduced absolute value of the input
+ and it is less than Pi/4,
+ N is calculated as trunc(|x|/(Pi/4)) + 1 and it is used to decide
+ whether a sine or cosine approximation is more accurate and
+ the sign of the result. */
+static inline float
+reduced_cos (double theta, unsigned int n)
+{
+ double sign, cx;
+ const double theta2 = theta * theta;
+
+ /* Determine positive or negative primary interval. */
+ n += 2;
+ sign = ones[(n >> 2) & 1];
+
+ /* Are we in the primary interval of sin or cos? */
+ if ((n & 2) == 0)
+ {
+ /* Here cosf() is calculated using sin Chebyshev polynomial:
+ x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))). */
+ cx = S3 + theta2 * S4;
+ cx = S2 + theta2 * cx;
+ cx = S1 + theta2 * cx;
+ cx = S0 + theta2 * cx;
+ cx = theta + theta * theta2 * cx;
+ }
+ else
+ {
+ /* Here cosf() is calculated using cos Chebyshev polynomial:
+ 1.0+x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))). */
+ cx = C3 + theta2 * C4;
+ cx = C2 + theta2 * cx;
+ cx = C1 + theta2 * cx;
+ cx = C0 + theta2 * cx;
+ cx = 1. + theta2 * cx;
+ }
+ return sign * cx;
+}
diff --git a/sysdeps/ieee754/flt-32/s_sinf.c b/sysdeps/ieee754/flt-32/s_sinf.c
index 916e345571..138e318dcc 100644
--- a/sysdeps/ieee754/flt-32/s_sinf.c
+++ b/sysdeps/ieee754/flt-32/s_sinf.c
@@ -1,25 +1,26 @@
-/* s_sinf.c -- float version of s_sin.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Compute sine of argument.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_sinf.c,v 1.4 1995/05/10 20:48:16 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
+#include "s_sincosf.h"
#ifndef SINF
# define SINF_FUNC __sinf
@@ -27,37 +28,129 @@ static char rcsid[] = "$NetBSD: s_sinf.c,v 1.4 1995/05/10 20:48:16 jtc Exp $";
# define SINF_FUNC SINF
#endif
-float SINF_FUNC(float x)
+float
+SINF_FUNC (float x)
{
- float y[2],z=0.0;
- int32_t n, ix;
-
- GET_FLOAT_WORD(ix,x);
-
- /* |x| ~< pi/4 */
- ix &= 0x7fffffff;
- if(ix <= 0x3f490fd8) return __kernel_sinf(x,z,0);
-
- /* sin(Inf or NaN) is NaN */
- else if (ix>=0x7f800000) {
- if (ix == 0x7f800000)
- __set_errno (EDOM);
- return x-x;
+ double cx;
+ double theta = x;
+ double abstheta = fabs (theta);
+ /* If |x|< Pi/4. */
+ if (isless (abstheta, M_PI_4))
+ {
+ if (abstheta >= 0x1p-5) /* |x| >= 2^-5. */
+ {
+ const double theta2 = theta * theta;
+ /* Chebyshev polynomial of the form for sin
+ x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))). */
+ cx = S3 + theta2 * S4;
+ cx = S2 + theta2 * cx;
+ cx = S1 + theta2 * cx;
+ cx = S0 + theta2 * cx;
+ cx = theta + theta * theta2 * cx;
+ return cx;
}
-
- /* argument reduction needed */
- else {
- n = __ieee754_rem_pio2f(x,y);
- switch(n&3) {
- case 0: return __kernel_sinf(y[0],y[1],1);
- case 1: return __kernel_cosf(y[0],y[1]);
- case 2: return -__kernel_sinf(y[0],y[1],1);
- default:
- return -__kernel_cosf(y[0],y[1]);
+ else if (abstheta >= 0x1p-27) /* |x| >= 2^-27. */
+ {
+ /* A simpler Chebyshev approximation is close enough for this range:
+ for sin: x+x^3*(SS0+x^2*SS1). */
+ const double theta2 = theta * theta;
+ cx = SS0 + theta2 * SS1;
+ cx = theta + theta * theta2 * cx;
+ return cx;
+ }
+ else
+ {
+ /* Handle some special cases. */
+ if (theta)
+ return theta - (theta * SMALL);
+ else
+ return theta;
+ }
+ }
+ else /* |x| >= Pi/4. */
+ {
+ unsigned int signbit = isless (x, 0);
+ if (isless (abstheta, 9 * M_PI_4)) /* |x| < 9*Pi/4. */
+ {
+ /* There are cases where FE_UPWARD rounding mode can
+ produce a result of abstheta * inv_PI_4 == 9,
+ where abstheta < 9pi/4, so the domain for
+ pio2_table must go to 5 (9 / 2 + 1). */
+ unsigned int n = (abstheta * inv_PI_4) + 1;
+ theta = abstheta - pio2_table[n / 2];
+ return reduced_sin (theta, n, signbit);
+ }
+ else if (isless (abstheta, INFINITY))
+ {
+ if (abstheta < 0x1p+23) /* |x| < 2^23. */
+ {
+ unsigned int n = ((unsigned int) (abstheta * inv_PI_4)) + 1;
+ double x = n / 2;
+ theta = (abstheta - x * PI_2_hi) - x * PI_2_lo;
+ /* Argument reduction needed. */
+ return reduced_sin (theta, n, signbit);
+ }
+ else /* |x| >= 2^23. */
+ {
+ x = fabsf (x);
+ int exponent;
+ GET_FLOAT_WORD (exponent, x);
+ exponent
+ = (exponent >> FLOAT_EXPONENT_SHIFT) - FLOAT_EXPONENT_BIAS;
+ exponent += 3;
+ exponent /= 28;
+ double a = invpio4_table[exponent] * x;
+ double b = invpio4_table[exponent + 1] * x;
+ double c = invpio4_table[exponent + 2] * x;
+ double d = invpio4_table[exponent + 3] * x;
+ uint64_t l = a;
+ l &= ~0x7;
+ a -= l;
+ double e = a + b;
+ l = e;
+ e = a - l;
+ if (l & 1)
+ {
+ e -= 1.0;
+ e += b;
+ e += c;
+ e += d;
+ e *= M_PI_4;
+ return reduced_sin (e, l + 1, signbit);
+ }
+ else
+ {
+ e += b;
+ e += c;
+ e += d;
+ if (e <= 1.0)
+ {
+ e *= M_PI_4;
+ return reduced_sin (e, l + 1, signbit);
+ }
+ else
+ {
+ l++;
+ e -= 2.0;
+ e *= M_PI_4;
+ return reduced_sin (e, l + 1, signbit);
+ }
+ }
}
}
+ else
+ {
+ int32_t ix;
+ /* High word of x. */
+ GET_FLOAT_WORD (ix, abstheta);
+ /* Sin(Inf or NaN) is NaN. */
+ if (ix == 0x7f800000)
+ __set_errno (EDOM);
+ return x - x;
+ }
+ }
}
#ifndef SINF
-weak_alias (__sinf, sinf)
+libm_alias_float (__sin, sin)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_tanf.c b/sysdeps/ieee754/flt-32/s_tanf.c
index 685df8fa35..ba3af54913 100644
--- a/sysdeps/ieee754/flt-32/s_tanf.c
+++ b/sysdeps/ieee754/flt-32/s_tanf.c
@@ -20,6 +20,7 @@ static char rcsid[] = "$NetBSD: s_tanf.c,v 1.4 1995/05/10 20:48:20 jtc Exp $";
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
float __tanf(float x)
{
@@ -46,4 +47,4 @@ float __tanf(float x)
-1 -- n odd */
}
}
-weak_alias (__tanf, tanf)
+libm_alias_float (__tan, tan)
diff --git a/sysdeps/ieee754/flt-32/s_tanhf.c b/sysdeps/ieee754/flt-32/s_tanhf.c
index f70702b29c..cc3d63d35d 100644
--- a/sysdeps/ieee754/flt-32/s_tanhf.c
+++ b/sysdeps/ieee754/flt-32/s_tanhf.c
@@ -20,6 +20,8 @@ static char rcsid[] = "$NetBSD: s_tanhf.c,v 1.4 1995/05/10 20:48:24 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-float.h>
static const float one=1.0, two=2.0, tiny = 1.0e-30;
@@ -59,4 +61,4 @@ float __tanhf(float x)
}
return (jx>=0)? z: -z;
}
-weak_alias (__tanhf, tanhf)
+libm_alias_float (__tanh, tanh)
diff --git a/sysdeps/ieee754/flt-32/s_totalorderf.c b/sysdeps/ieee754/flt-32/s_totalorderf.c
new file mode 100644
index 0000000000..928a8d6d8f
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_totalorderf.c
@@ -0,0 +1,48 @@
+/* Total order operation. flt-32 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-float.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;
+}
+libm_alias_float (__totalorder, totalorder)
diff --git a/sysdeps/ieee754/flt-32/s_totalordermagf.c b/sysdeps/ieee754/flt-32/s_totalordermagf.c
new file mode 100644
index 0000000000..0e383653a5
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_totalordermagf.c
@@ -0,0 +1,46 @@
+/* Total order operation on absolute values. flt-32 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-float.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalordermagf (float x, float y)
+{
+ 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)
+ {
+ ix ^= 0x00400000;
+ iy ^= 0x00400000;
+ }
+#endif
+ return ix <= iy;
+}
+libm_alias_float (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/flt-32/s_truncf.c b/sysdeps/ieee754/flt-32/s_truncf.c
index 43d35c7f6a..2e1464aeac 100644
--- a/sysdeps/ieee754/flt-32/s_truncf.c
+++ b/sysdeps/ieee754/flt-32/s_truncf.c
@@ -1,5 +1,5 @@
/* Truncate argument to nearest integral value not larger than the argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
float
@@ -48,4 +49,6 @@ __truncf (float x)
return x;
}
-weak_alias (__truncf, truncf)
+#ifndef __truncf
+libm_alias_float (__trunc, trunc)
+#endif
diff --git a/sysdeps/ieee754/flt-32/s_ufromfpf.c b/sysdeps/ieee754/flt-32/s_ufromfpf.c
new file mode 100644
index 0000000000..0d2b4493a8
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_ufromfpf.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpf
+#include <s_fromfpf_main.c>
+libm_alias_float (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/flt-32/s_ufromfpxf.c b/sysdeps/ieee754/flt-32/s_ufromfpxf.c
new file mode 100644
index 0000000000..81f56daf9d
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_ufromfpxf.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxf
+#include <s_fromfpf_main.c>
+libm_alias_float (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/flt-32/t_exp2f.h b/sysdeps/ieee754/flt-32/t_exp2f.h
deleted file mode 100644
index 3045b82cd1..0000000000
--- a/sysdeps/ieee754/flt-32/t_exp2f.h
+++ /dev/null
@@ -1,351 +0,0 @@
-/* Accurate tables for exp2f().
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 table has the property that, for all integers -128 <= i <= 127,
- exp(i/256.0 + __exp2f_deltatable[i-128]) == __exp2f_atable[i+128] + r
- for some -2^-35 < r < 2^-35 (abs(r) < 2^-36 if i <= 0); and that
- __exp2f_deltatable[i+128] == t * 2^-30
- for integer t so that abs(t) <= 43447 * 2^0. */
-
-#define W30 (9.31322575e-10)
-static const float __exp2f_deltatable[256] = {
- -810*W30, 283*W30, -1514*W30, 1304*W30,
- -1148*W30, -98*W30, -744*W30, -156*W30,
- -419*W30, -155*W30, 474*W30, 167*W30,
- -1984*W30, -826*W30, 692*W30, 781*W30,
- -578*W30, -411*W30, -129*W30, -1500*W30,
- 654*W30, -141*W30, -816*W30, -53*W30,
- 148*W30, 493*W30, -2214*W30, 760*W30,
- 260*W30, 750*W30, -1300*W30, 1424*W30,
- -1445*W30, -339*W30, -680*W30, -349*W30,
- -922*W30, 531*W30, 193*W30, -2892*W30,
- 290*W30, -2145*W30, -276*W30, 485*W30,
- -695*W30, 215*W30, -7093*W30, 412*W30,
- -4596*W30, 367*W30, 592*W30, -615*W30,
- -97*W30, -1066*W30, 972*W30, -226*W30,
- -625*W30, -374*W30, -5647*W30, -180*W30,
- 20349*W30, -447*W30, 111*W30, -4164*W30,
- -87*W30, -21*W30, -251*W30, 66*W30,
- -517*W30, 2093*W30, -263*W30, 182*W30,
- -601*W30, 475*W30, -483*W30, -1251*W30,
- -373*W30, 1471*W30, -92*W30, -215*W30,
- -97*W30, -190*W30, 0*W30, -290*W30,
- -2647*W30, 1940*W30, -582*W30, 28*W30,
- 833*W30, 1493*W30, 34*W30, 321*W30,
- 3327*W30, -35*W30, 177*W30, -135*W30,
- -796*W30, -428*W30, 129*W30, 9332*W30,
- -12*W30, -69*W30, -1743*W30, 6508*W30,
- -60*W30, 359*W30, 43447*W30, 15*W30,
- -23*W30, -305*W30, -375*W30, -652*W30,
- 667*W30, 269*W30, -1575*W30, 185*W30,
- -329*W30, 200*W30, 6002*W30, 163*W30,
- -647*W30, 19*W30, -603*W30, -755*W30,
- 742*W30, -438*W30, 3587*W30, 2560*W30,
- 0*W30, -520*W30, -241*W30, -299*W30,
- -1270*W30, -991*W30, -1138*W30, 255*W30,
- -1192*W30, 1722*W30, 1023*W30, 3700*W30,
- -1388*W30, -1551*W30, -2549*W30, 27*W30,
- 282*W30, 673*W30, 113*W30, 1561*W30,
- 72*W30, 873*W30, 87*W30, -395*W30,
- -433*W30, 629*W30, 3440*W30, -284*W30,
- -592*W30, -103*W30, -46*W30, -3844*W30,
- 1712*W30, 303*W30, 1555*W30, -631*W30,
- -1400*W30, -961*W30, -854*W30, -276*W30,
- 407*W30, 833*W30, -345*W30, -1501*W30,
- 121*W30, -1581*W30, 400*W30, 150*W30,
- 1224*W30, -139*W30, -563*W30, 879*W30,
- 933*W30, 2939*W30, 788*W30, 211*W30,
- 530*W30, -192*W30, 706*W30, -13347*W30,
- 1065*W30, 3*W30, 111*W30, -208*W30,
- -360*W30, -532*W30, -291*W30, 483*W30,
- 987*W30, -33*W30, -1373*W30, -166*W30,
- -1174*W30, -3955*W30, 1601*W30, -280*W30,
- 1405*W30, 600*W30, -1659*W30, -23*W30,
- 390*W30, 449*W30, 570*W30, -13143*W30,
- -9*W30, -1646*W30, 1201*W30, 294*W30,
- 2181*W30, -1173*W30, 1388*W30, -4504*W30,
- 190*W30, -2304*W30, 211*W30, 239*W30,
- 48*W30, -817*W30, 1018*W30, 1828*W30,
- -663*W30, 1408*W30, 408*W30, -36*W30,
- 1295*W30, -230*W30, 1341*W30, 9*W30,
- 40*W30, 705*W30, 186*W30, 376*W30,
- 557*W30, 5866*W30, 363*W30, -1558*W30,
- 718*W30, 669*W30, 1369*W30, -2972*W30,
- -468*W30, -121*W30, -219*W30, 667*W30,
- 29954*W30, 366*W30, 48*W30, -203*W30
-};
-
-static const float __exp2f_atable[256] /* __attribute__((mode(SF))) */ = {
- 0.707106411447, /* 0x0.b504ecfff */
- 0.709024071690, /* 0x0.b58299fff */
- 0.710945606239, /* 0x0.b60088000 */
- 0.712874472142, /* 0x0.b67ef1000 */
- 0.714806139464, /* 0x0.b6fd88fff */
- 0.716744661340, /* 0x0.b77c94000 */
- 0.718687653549, /* 0x0.b7fbea000 */
- 0.720636486992, /* 0x0.b87ba1fff */
- 0.722590208040, /* 0x0.b8fbabfff */
- 0.724549472323, /* 0x0.b97c12fff */
- 0.726514220228, /* 0x0.b9fcd5fff */
- 0.728483855735, /* 0x0.ba7deb000 */
- 0.730457961549, /* 0x0.baff4afff */
- 0.732438981522, /* 0x0.bb811efff */
- 0.734425544748, /* 0x0.bc0350000 */
- 0.736416816713, /* 0x0.bc85d0000 */
- 0.738412797450, /* 0x0.bd089efff */
- 0.740414917465, /* 0x0.bd8bd4fff */
- 0.742422521111, /* 0x0.be0f66fff */
- 0.744434773914, /* 0x0.be9346fff */
- 0.746454179287, /* 0x0.bf179f000 */
- 0.748477637755, /* 0x0.bf9c3afff */
- 0.750506639473, /* 0x0.c02133fff */
- 0.752541840064, /* 0x0.c0a694fff */
- 0.754582285889, /* 0x0.c12c4e000 */
- 0.756628334525, /* 0x0.c1b265000 */
- 0.758678436269, /* 0x0.c238bffff */
- 0.760736882681, /* 0x0.c2bfa6fff */
- 0.762799203401, /* 0x0.c346cf000 */
- 0.764867603790, /* 0x0.c3ce5d000 */
- 0.766940355298, /* 0x0.c45633fff */
- 0.769021093841, /* 0x0.c4de90fff */
- 0.771104693409, /* 0x0.c5671dfff */
- 0.773195922364, /* 0x0.c5f02afff */
- 0.775292098512, /* 0x0.c6798afff */
- 0.777394294745, /* 0x0.c70350000 */
- 0.779501736166, /* 0x0.c78d6d000 */
- 0.781615912910, /* 0x0.c817fafff */
- 0.783734917628, /* 0x0.c8a2d9fff */
- 0.785858273516, /* 0x0.c92e02000 */
- 0.787990570071, /* 0x0.c9b9c0000 */
- 0.790125787245, /* 0x0.ca45aefff */
- 0.792268991467, /* 0x0.cad223fff */
- 0.794417440881, /* 0x0.cb5ef0fff */
- 0.796570718287, /* 0x0.cbec0efff */
- 0.798730909811, /* 0x0.cc79a0fff */
- 0.800892710672, /* 0x0.cd074dfff */
- 0.803068041795, /* 0x0.cd95ddfff */
- 0.805242776881, /* 0x0.ce2464000 */
- 0.807428598393, /* 0x0.ceb3a3fff */
- 0.809617877002, /* 0x0.cf431dfff */
- 0.811812341211, /* 0x0.cfd2eefff */
- 0.814013659956, /* 0x0.d06333000 */
- 0.816220164311, /* 0x0.d0f3ce000 */
- 0.818434238424, /* 0x0.d184e7fff */
- 0.820652604094, /* 0x0.d21649fff */
- 0.822877407074, /* 0x0.d2a818000 */
- 0.825108587751, /* 0x0.d33a51000 */
- 0.827342867839, /* 0x0.d3ccbdfff */
- 0.829588949684, /* 0x0.d45ff1000 */
- 0.831849217401, /* 0x0.d4f411fff */
- 0.834093391880, /* 0x0.d58724fff */
- 0.836355149750, /* 0x0.d61b5f000 */
- 0.838620424257, /* 0x0.d6afd3fff */
- 0.840896368027, /* 0x0.d744fc000 */
- 0.843176305293, /* 0x0.d7da66fff */
- 0.845462262643, /* 0x0.d87037000 */
- 0.847754716864, /* 0x0.d90673fff */
- 0.850052893157, /* 0x0.d99d10fff */
- 0.852359056469, /* 0x0.da3433fff */
- 0.854668736446, /* 0x0.dacb91fff */
- 0.856986224651, /* 0x0.db6373000 */
- 0.859309315673, /* 0x0.dbfbb1fff */
- 0.861639738080, /* 0x0.dc946bfff */
- 0.863975346095, /* 0x0.dd2d7d000 */
- 0.866317391394, /* 0x0.ddc6f9fff */
- 0.868666708472, /* 0x0.de60f1000 */
- 0.871022939695, /* 0x0.defb5c000 */
- 0.873383641229, /* 0x0.df9611fff */
- 0.875751554968, /* 0x0.e03141000 */
- 0.878126025200, /* 0x0.e0ccde000 */
- 0.880506813521, /* 0x0.e168e4fff */
- 0.882894217966, /* 0x0.e2055afff */
- 0.885287821299, /* 0x0.e2a239000 */
- 0.887686729423, /* 0x0.e33f6ffff */
- 0.890096127973, /* 0x0.e3dd56fff */
- 0.892507970338, /* 0x0.e47b67000 */
- 0.894928157336, /* 0x0.e51a03000 */
- 0.897355020043, /* 0x0.e5b90efff */
- 0.899788379682, /* 0x0.e65888000 */
- 0.902227103705, /* 0x0.e6f85afff */
- 0.904673457151, /* 0x0.e798ae000 */
- 0.907128036008, /* 0x0.e8398afff */
- 0.909585535528, /* 0x0.e8da99000 */
- 0.912051796915, /* 0x0.e97c3a000 */
- 0.914524436003, /* 0x0.ea1e46000 */
- 0.917003571999, /* 0x0.eac0bf000 */
- 0.919490039339, /* 0x0.eb63b2fff */
- 0.921983361257, /* 0x0.ec071a000 */
- 0.924488604054, /* 0x0.ecab48fff */
- 0.926989555360, /* 0x0.ed4f30000 */
- 0.929502844812, /* 0x0.edf3e6000 */
- 0.932021975503, /* 0x0.ee98fdfff */
- 0.934553921208, /* 0x0.ef3eecfff */
- 0.937083780759, /* 0x0.efe4b8fff */
- 0.939624726786, /* 0x0.f08b3f000 */
- 0.942198514924, /* 0x0.f133ebfff */
- 0.944726586343, /* 0x0.f1d99a000 */
- 0.947287976728, /* 0x0.f28176fff */
- 0.949856162070, /* 0x0.f329c5fff */
- 0.952431440345, /* 0x0.f3d28bfff */
- 0.955013573175, /* 0x0.f47bc5000 */
- 0.957603693021, /* 0x0.f52584000 */
- 0.960199773321, /* 0x0.f5cfa7000 */
- 0.962801992906, /* 0x0.f67a31000 */
- 0.965413510788, /* 0x0.f72556fff */
- 0.968030691152, /* 0x0.f7d0dc000 */
- 0.970655620084, /* 0x0.f87ce2fff */
- 0.973290979849, /* 0x0.f92998fff */
- 0.975926160805, /* 0x0.f9d64bfff */
- 0.978571653370, /* 0x0.fa83ac000 */
- 0.981225252139, /* 0x0.fb3193fff */
- 0.983885228626, /* 0x0.fbdfe6fff */
- 0.986552715296, /* 0x0.fc8eb7fff */
- 0.989228487027, /* 0x0.fd3e14000 */
- 0.991909801964, /* 0x0.fdedcd000 */
- 0.994601726545, /* 0x0.fe9e38000 */
- 0.997297704209, /* 0x0.ff4ee6fff */
- 1.000000000000, /* 0x1.000000000 */
- 1.002710938457, /* 0x1.00b1aa000 */
- 1.005429744692, /* 0x1.0163d7ffe */
- 1.008155703526, /* 0x1.02167dffe */
- 1.010888457284, /* 0x1.02c995fff */
- 1.013629436498, /* 0x1.037d38000 */
- 1.016377568250, /* 0x1.043152000 */
- 1.019134163841, /* 0x1.04e5f9ffe */
- 1.021896362316, /* 0x1.059b00000 */
- 1.024668931945, /* 0x1.0650b3ffe */
- 1.027446627635, /* 0x1.0706be001 */
- 1.030234098408, /* 0x1.07bd6bffe */
- 1.033023953416, /* 0x1.087441ffe */
- 1.035824656494, /* 0x1.092bce000 */
- 1.038632392900, /* 0x1.09e3d0001 */
- 1.041450142840, /* 0x1.0a9c79ffe */
- 1.044273972530, /* 0x1.0b558a001 */
- 1.047105550795, /* 0x1.0c0f1c001 */
- 1.049944162390, /* 0x1.0cc924001 */
- 1.052791833895, /* 0x1.0d83c4001 */
- 1.055645227426, /* 0x1.0e3ec3fff */
- 1.058507919326, /* 0x1.0efa60001 */
- 1.061377286898, /* 0x1.0fb66bfff */
- 1.064254641510, /* 0x1.1072fdffe */
- 1.067140102389, /* 0x1.113018000 */
- 1.070034146304, /* 0x1.11edc1fff */
- 1.072937250162, /* 0x1.12ac04001 */
- 1.075843691823, /* 0x1.136a7dfff */
- 1.078760385496, /* 0x1.1429a3ffe */
- 1.081685543070, /* 0x1.14e958000 */
- 1.084618330005, /* 0x1.15a98c000 */
- 1.087556362176, /* 0x1.166a18001 */
- 1.090508937863, /* 0x1.172b98001 */
- 1.093464612954, /* 0x1.17ed4bfff */
- 1.096430182434, /* 0x1.18afa5ffe */
- 1.099401354802, /* 0x1.19725e000 */
- 1.102381587017, /* 0x1.1a35adfff */
- 1.105370759965, /* 0x1.1af994000 */
- 1.108367800686, /* 0x1.1bbdfdffe */
- 1.111373305331, /* 0x1.1c82f6000 */
- 1.114387035385, /* 0x1.1d4878001 */
- 1.117408752440, /* 0x1.1e0e7ffff */
- 1.120437502874, /* 0x1.1ed4fe000 */
- 1.123474478729, /* 0x1.1f9c06000 */
- 1.126521706601, /* 0x1.2063ba001 */
- 1.129574775716, /* 0x1.212bd0001 */
- 1.132638812065, /* 0x1.21f49e000 */
- 1.135709524130, /* 0x1.22bddbffe */
- 1.138789534565, /* 0x1.2387b5fff */
- 1.141876101508, /* 0x1.2451fe000 */
- 1.144971728301, /* 0x1.251cddffe */
- 1.148077130296, /* 0x1.25e861ffe */
- 1.151189923305, /* 0x1.26b462001 */
- 1.154312610610, /* 0x1.278107ffe */
- 1.157440662410, /* 0x1.284e08001 */
- 1.160578370109, /* 0x1.291baa001 */
- 1.163725256932, /* 0x1.29e9e6000 */
- 1.166879892324, /* 0x1.2ab8a3ffe */
- 1.170044302935, /* 0x1.2b8805fff */
- 1.173205971694, /* 0x1.2c5739ffe */
- 1.176397800428, /* 0x1.2d2867ffe */
- 1.179586529747, /* 0x1.2df962001 */
- 1.182784795737, /* 0x1.2ecafbffe */
- 1.185991406414, /* 0x1.2f9d21ffe */
- 1.189206838636, /* 0x1.306fdc001 */
- 1.192430973067, /* 0x1.314328000 */
- 1.195664167430, /* 0x1.32170c001 */
- 1.198906540890, /* 0x1.32eb8a001 */
- 1.202157497408, /* 0x1.33c098000 */
- 1.205416083326, /* 0x1.349625fff */
- 1.208683252332, /* 0x1.356c43fff */
- 1.211961269402, /* 0x1.364318001 */
- 1.215246438983, /* 0x1.371a64000 */
- 1.218539118740, /* 0x1.37f22dffe */
- 1.221847295770, /* 0x1.38cafc000 */
- 1.225158572187, /* 0x1.39a3fdfff */
- 1.228481650325, /* 0x1.3a7dc5ffe */
- 1.231811761846, /* 0x1.3b5803fff */
- 1.235149741144, /* 0x1.3c32c5ffe */
- 1.238499879811, /* 0x1.3d0e53ffe */
- 1.241858124726, /* 0x1.3dea69fff */
- 1.245225191102, /* 0x1.3ec713fff */
- 1.248601436624, /* 0x1.3fa458000 */
- 1.251975655584, /* 0x1.40817a001 */
- 1.255380749731, /* 0x1.4160a2001 */
- 1.258783102010, /* 0x1.423f9bffe */
- 1.262198328973, /* 0x1.431f6e000 */
- 1.265619754780, /* 0x1.43ffa7fff */
- 1.269052743928, /* 0x1.44e0a4001 */
- 1.272490739830, /* 0x1.45c1f4000 */
- 1.275942921659, /* 0x1.46a432001 */
- 1.279397487615, /* 0x1.478697ffe */
- 1.282870173427, /* 0x1.486a2dffe */
- 1.286346316319, /* 0x1.494dfdffe */
- 1.289836049094, /* 0x1.4a32b2001 */
- 1.293333172770, /* 0x1.4b17e1ffe */
- 1.296839594835, /* 0x1.4bfdadfff */
- 1.300354957560, /* 0x1.4ce40fffe */
- 1.303882122055, /* 0x1.4dcb38001 */
- 1.307417988757, /* 0x1.4eb2f1ffe */
- 1.310960650439, /* 0x1.4f9b1dfff */
- 1.314516782746, /* 0x1.50842bfff */
- 1.318079948424, /* 0x1.516daffff */
- 1.321653246888, /* 0x1.5257de000 */
- 1.325237751030, /* 0x1.5342c8001 */
- 1.328829526907, /* 0x1.542e2c000 */
- 1.332433700535, /* 0x1.551a5fffe */
- 1.336045145966, /* 0x1.56070dffe */
- 1.339667558645, /* 0x1.56f473ffe */
- 1.343300342533, /* 0x1.57e287ffe */
- 1.346941947961, /* 0x1.58d130001 */
- 1.350594043714, /* 0x1.59c087ffe */
- 1.354256033883, /* 0x1.5ab085fff */
- 1.357932448365, /* 0x1.5ba175ffe */
- 1.361609339707, /* 0x1.5c926dfff */
- 1.365299344044, /* 0x1.5d8441ffe */
- 1.369003057507, /* 0x1.5e76fc001 */
- 1.372714757920, /* 0x1.5f6a3c000 */
- 1.376437187179, /* 0x1.605e2fffe */
- 1.380165219333, /* 0x1.615282001 */
- 1.383909463864, /* 0x1.6247e3ffe */
- 1.387661933907, /* 0x1.633dd0000 */
- 1.391424179060, /* 0x1.64345fffe */
- 1.395197510706, /* 0x1.652ba9fff */
- 1.399006724329, /* 0x1.66254dffe */
- 1.402773022651, /* 0x1.671c22000 */
- 1.406576037403, /* 0x1.68155dfff */
- 1.410389423392, /* 0x1.690f48001 */
-};
diff --git a/sysdeps/m68k/m680x0/fpu/halfulp.c b/sysdeps/ieee754/flt-32/w_exp2f.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/m68k/m680x0/fpu/halfulp.c
+++ b/sysdeps/ieee754/flt-32/w_exp2f.c
diff --git a/sysdeps/ieee754/flt-32/w_expf.c b/sysdeps/ieee754/flt-32/w_expf.c
index ed1550972f..1cc8931700 100644
--- a/sysdeps/ieee754/flt-32/w_expf.c
+++ b/sysdeps/ieee754/flt-32/w_expf.c
@@ -1,34 +1 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <math_private.h>
-
-/* wrapper expf */
-float
-__expf (float x)
-{
- float z = __ieee754_expf (x);
- if (__builtin_expect (!isfinite (z) || z == 0, 0)
- && isfinite (x) && _LIB_VERSION != _IEEE_)
- return __kernel_standard_f (x, x, 106 + !!signbit (x));
-
- return z;
-}
-hidden_def (__expf)
-weak_alias (__expf, expf)
+/* Not needed. */
diff --git a/sysdeps/m68k/m680x0/fpu/mpexp.c b/sysdeps/ieee754/flt-32/w_log2f.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/m68k/m680x0/fpu/mpexp.c
+++ b/sysdeps/ieee754/flt-32/w_log2f.c
diff --git a/sysdeps/m68k/m680x0/fpu/mplog.c b/sysdeps/ieee754/flt-32/w_logf.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/m68k/m680x0/fpu/mplog.c
+++ b/sysdeps/ieee754/flt-32/w_logf.c
diff --git a/sysdeps/m68k/m680x0/fpu/slowexp.c b/sysdeps/ieee754/flt-32/w_powf.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/m68k/m680x0/fpu/slowexp.c
+++ b/sysdeps/ieee754/flt-32/w_powf.c
diff --git a/sysdeps/ieee754/ieee754.h b/sysdeps/ieee754/ieee754.h
index e7a5e93610..7dfa9f0a21 100644
--- a/sysdeps/ieee754/ieee754.h
+++ b/sysdeps/ieee754/ieee754.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/k_standard.c b/sysdeps/ieee754/k_standard.c
index c8aebbff90..f74f9c712e 100644
--- a/sysdeps/ieee754/k_standard.c
+++ b/sysdeps/ieee754/k_standard.c
@@ -16,27 +16,30 @@ static char rcsid[] = "$NetBSD: k_standard.c,v 1.6 1995/05/10 20:46:35 jtc Exp $
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
#include <errno.h>
#include <assert.h>
-#ifndef _USE_WRITE
-#include <stdio.h> /* fputs(), stderr */
-#define WRITE2(u,v) fputs(u, stderr)
-#else /* !defined(_USE_WRITE) */
-#include <unistd.h> /* write */
-#define WRITE2(u,v) write(2, u, v)
-#undef fflush
-#endif /* !defined(_USE_WRITE) */
+#if LIBM_SVID_COMPAT
+
+# ifndef _USE_WRITE
+# include <stdio.h> /* fputs(), stderr */
+# define WRITE2(u,v) fputs(u, stderr)
+# else /* !defined(_USE_WRITE) */
+# include <unistd.h> /* write */
+# define WRITE2(u,v) write(2, u, v)
+# undef fflush
+# endif /* !defined(_USE_WRITE) */
/* XXX gcc versions until now don't delay the 0.0/0.0 division until
runtime but produce NaN at compile time. This is wrong since the
exceptions are not set correctly. */
-#if 0
+# if 0
static const double zero = 0.0; /* used as const */
-#else
+# else
static double zero = 0.0; /* used as const */
-#endif
+# endif
/*
* Standard conformance (non-IEEE) on exception cases.
@@ -60,7 +63,6 @@ static double zero = 0.0; /* used as const */
* 17-- log(x<0)
* 18-- log10(0)
* 19-- log10(x<0)
- * 20-- pow(0.0,0.0)
* 21-- pow(x,y) overflow
* 22-- pow(x,y) underflow
* 23-- pow(0,negative)
@@ -82,7 +84,6 @@ static double zero = 0.0; /* used as const */
* 39-- yn(x>X_TLOSS, n)
* 40-- tgamma(finite) overflow
* 41-- tgamma(-integer)
- * 42-- pow(NaN,0.0)
* 43-- +0**neg
* 44-- exp2 overflow
* 45-- exp2 underflow
@@ -98,21 +99,21 @@ double
__kernel_standard(double x, double y, int type)
{
struct exception exc;
-#ifndef HUGE_VAL /* this is the only routine that uses HUGE_VAL */
-#define HUGE_VAL inf
+# ifndef HUGE_VAL /* this is the only routine that uses HUGE_VAL */
+# define HUGE_VAL inf
double inf = 0.0;
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
-#endif
+# endif
/* The SVID struct exception uses a field "char *name;". */
-#define CSTR(func) ((char *) (type < 100 \
+# define CSTR(func) ((char *) (type < 100 \
? func \
: (type < 200 ? func "f" : func "l")))
-#ifdef _USE_WRITE
+# ifdef _USE_WRITE
(void) fflush(stdout);
-#endif
+# endif
exc.arg1 = x;
exc.arg2 = y;
switch(type) {
@@ -461,20 +462,6 @@ __kernel_standard(double x, double y, int type)
__set_errno (EDOM);
}
break;
- case 20:
- case 120:
- case 220:
- /* pow(0.0,0.0) */
- /* error only if _LIB_VERSION == _SVID_ */
- exc.type = DOMAIN;
- exc.name = CSTR ("pow");
- exc.retval = zero;
- if (_LIB_VERSION != _SVID_) exc.retval = 1.0;
- else if (!matherr(&exc)) {
- (void) WRITE2("pow(0,0): DOMAIN error\n", 23);
- __set_errno (EDOM);
- }
- break;
case 21:
case 121:
case 221:
@@ -845,20 +832,6 @@ __kernel_standard(double x, double y, int type)
__set_errno (EDOM);
}
break;
- case 42:
- case 142:
- case 242:
- /* pow(NaN,0.0) */
- /* error only if _LIB_VERSION == _SVID_ & _XOPEN_ */
- exc.type = DOMAIN;
- exc.name = CSTR ("pow");
- exc.retval = x;
- if (_LIB_VERSION == _IEEE_ ||
- _LIB_VERSION == _POSIX_) exc.retval = 1.0;
- else if (!matherr(&exc)) {
- __set_errno (EDOM);
- }
- break;
case 44:
case 144:
@@ -968,6 +941,10 @@ __kernel_standard(double x, double y, int type)
break;
/* #### Last used is 50/150/250 ### */
+
+ default:
+ __builtin_unreachable ();
}
return exc.retval;
}
+#endif
diff --git a/sysdeps/ieee754/k_standardf.c b/sysdeps/ieee754/k_standardf.c
index 2b9c1bddb5..b790ad266d 100644
--- a/sysdeps/ieee754/k_standardf.c
+++ b/sysdeps/ieee754/k_standardf.c
@@ -1,5 +1,5 @@
/* Implement __kernel_standard_f.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,8 +18,10 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
+#if LIBM_SVID_COMPAT
/* Handle errors for a libm function as specified by TYPE (see
comments in k_standard.c for details), with arguments X and Y,
returning the appropriate return value for that function. */
@@ -29,3 +31,4 @@ __kernel_standard_f (float x, float y, int type)
{
return __kernel_standard (x, y, type);
}
+#endif
diff --git a/sysdeps/ieee754/k_standardl.c b/sysdeps/ieee754/k_standardl.c
index d2d6f7466e..58abc22b6e 100644
--- a/sysdeps/ieee754/k_standardl.c
+++ b/sysdeps/ieee754/k_standardl.c
@@ -1,5 +1,5 @@
/* Implement __kernel_standard_l.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,12 +31,16 @@
*/
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-svid-compat.h>
#include <fenv.h>
#include <float.h>
#include <errno.h>
+#if LIBM_SVID_COMPAT
+
static double zero = 0.0;
/* Handle errors for a libm function as specified by TYPE (see
@@ -105,3 +109,4 @@ __kernel_standard_l (long double x, long double y, int type)
return __kernel_standard (dx, dy, type);
}
}
+#endif
diff --git a/sysdeps/ieee754/ldbl-128/Makeconfig b/sysdeps/ieee754/ldbl-128/Makeconfig
new file mode 100644
index 0000000000..ca17c1b12a
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/Makeconfig
@@ -0,0 +1,4 @@
+# Include this earlier so it can be used earlier in Makefiles,
+# and sysdep/ makefiles.
+float128-alias-fcts = yes
+float64x-alias-fcts = yes
diff --git a/sysdeps/ieee754/ldbl-128/bits/floatn.h b/sysdeps/ieee754/ldbl-128/bits/floatn.h
new file mode 100644
index 0000000000..1d21ccee24
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/bits/floatn.h
@@ -0,0 +1,97 @@
+/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms.
+ Copyright (C) 2017-2018 Free Software 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 _BITS_FLOATN_H
+#define _BITS_FLOATN_H
+
+#include <features.h>
+#include <bits/long-double.h>
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the IEEE 754 binary128 format, and this
+ glibc includes corresponding *f128 interfaces for it. */
+#ifndef __NO_LONG_DOUBLE_MATH
+# define __HAVE_FLOAT128 1
+#else
+/* glibc does not support _Float128 for platforms where long double is
+ normally binary128 when building with long double as binary64.
+ GCC's default for supported scalar modes does not support it either
+ in that case. */
+# define __HAVE_FLOAT128 0
+#endif
+
+/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
+ from the default float, double and long double types in this glibc. */
+#define __HAVE_DISTINCT_FLOAT128 0
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the right format for _Float64x, and this
+ glibc includes corresponding *f64x interfaces for it. */
+#define __HAVE_FLOAT64X __HAVE_FLOAT128
+
+/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
+ of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
+ the format of _Float128, which must be different from that of long
+ double. */
+#define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128
+
+#ifndef __ASSEMBLER__
+
+/* Defined to concatenate the literal suffix to be used with _Float128
+ types, if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* The literal suffix f128 exists only since GCC 7.0. */
+# define __f128(x) x##l
+# else
+# define __f128(x) x##f128
+# endif
+# endif
+
+/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+# define __CFLOAT128 _Complex long double
+# else
+# define __CFLOAT128 _Complex _Float128
+# endif
+# endif
+
+/* The remaining of this file provides support for older compilers. */
+# if __HAVE_FLOAT128
+
+/* The type _Float128 exists only since GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+typedef long double _Float128;
+# endif
+
+/* Various built-in functions do not exist before GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_huge_valf128() (__builtin_huge_vall ())
+# define __builtin_inff128() (__builtin_infl ())
+# define __builtin_nanf128(x) (__builtin_nanl (x))
+# define __builtin_nansf128(x) (__builtin_nansl (x))
+# endif
+
+# endif
+
+#endif /* !__ASSEMBLER__. */
+
+#include <bits/floatn-common.h>
+
+#endif /* _BITS_FLOATN_H */
diff --git a/sysdeps/ieee754/ldbl-128/bits/long-double.h b/sysdeps/ieee754/ldbl-128/bits/long-double.h
new file mode 100644
index 0000000000..3d6e1139f8
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/bits/long-double.h
@@ -0,0 +1,20 @@
+/* Properties of long double type. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software 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 published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/>. */
+
+/* long double is distinct from double, so there is nothing to
+ define here. */
diff --git a/sysdeps/ieee754/ldbl-128/e_acoshl.c b/sysdeps/ieee754/ldbl-128/e_acoshl.c
index 6234289e1e..c292759ac6 100644
--- a/sysdeps/ieee754/ldbl-128/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-128/e_acoshl.c
@@ -30,15 +30,15 @@
#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;
- u_int64_t lx;
+ _Float128 t;
+ uint64_t lx;
int64_t hx;
GET_LDOUBLE_WORDS64(hx,lx,x);
if(hx<0x3fff000000000000LL) { /* x < 1 */
@@ -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+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..0dc23dee2b 100644
--- a/sysdeps/ieee754/ldbl-128/e_acosl.c
+++ b/sysdeps/ieee754/ldbl-128/e_acosl.c
@@ -51,107 +51,107 @@
* if x is NaN, return x itself;
* if |x|>1, return NaN with invalid signal.
*
- * Functions needed: __ieee754_sqrtl.
+ * Functions needed: sqrtl.
*/
#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
@@ -270,7 +270,7 @@ __ieee754_acosl (long double x)
else
{ /* |x| >= .625 */
z = (one - u.value) * 0.5;
- s = __ieee754_sqrtl (z);
+ s = sqrtl (z);
/* Compute an extended precision square root from
the Newton iteration s -> 0.5 * (s + z / s).
The change w from s to the improved value is
diff --git a/sysdeps/ieee754/ldbl-128/e_asinl.c b/sysdeps/ieee754/ldbl-128/e_asinl.c
index 5a0e473ef0..4835962db4 100644
--- a/sysdeps/ieee754/ldbl-128/e_asinl.c
+++ b/sysdeps/ieee754/ldbl-128/e_asinl.c
@@ -61,78 +61,79 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
-long double sqrtl (long double);
+#include <math-underflow.h>
-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 +155,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 */
}
@@ -232,7 +233,7 @@ __ieee754_asinl (long double x)
return x + x * w;
}
- s = __ieee754_sqrtl (t);
+ s = sqrtl (t);
if (ix >= 0x3ffef333) /* |x| > 0.975 */
{
w = p / q;
diff --git a/sysdeps/ieee754/ldbl-128/e_atan2l.c b/sysdeps/ieee754/ldbl-128/e_atan2l.c
index d31ee70dbd..8b4afa4bd5 100644
--- a/sysdeps/ieee754/ldbl-128/e_atan2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_atan2l.c
@@ -43,20 +43,20 @@
#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;
+ uint64_t lx,ly;
GET_LDOUBLE_WORDS64(hx,lx,x);
ix = hx&0x7fffffffffffffffLL;
@@ -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,13 +103,13 @@ __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(+,+) */
case 1: {
- u_int64_t zh;
+ uint64_t zh;
GET_LDOUBLE_MSW64(zh,z);
SET_LDOUBLE_MSW64(z,zh ^ 0x8000000000000000ULL);
}
diff --git a/sysdeps/ieee754/ldbl-128/e_atanhl.c b/sysdeps/ieee754/ldbl-128/e_atanhl.c
index 7fa53ef436..13b7683e17 100644
--- a/sysdeps/ieee754/ldbl-128/e_atanhl.c
+++ b/sysdeps/ieee754/ldbl-128/e_atanhl.c
@@ -35,16 +35,17 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.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;
- u_int32_t jx, ix;
+ _Float128 t;
+ uint32_t jx, ix;
ieee854_long_double_shape_type u;
u.value = x;
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..9b1ff9d821 100644
--- a/sysdeps/ieee754/ldbl-128/e_exp10l.c
+++ b/sysdeps/ieee754/ldbl-128/e_exp10l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,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..b4b21c4957 100644
--- a/sysdeps/ieee754/ldbl-128/e_expl.c
+++ b/sysdeps/ieee754/ldbl-128/e_expl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point e^x.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
Partly based on double-precision code
@@ -64,58 +64,60 @@
#include <math.h>
#include <fenv.h>
#include <inttypes.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
#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 +126,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,13 +187,14 @@ __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,
with maximum error in [-2^-16-2^-53,2^-16+2^-53]
less than 4.8e-39. */
x22 = x + x*x*(P1+x*(P2+x*(P3+x*(P4+x*(P5+x*P6)))));
+ math_force_eval (x22);
/* Return result. */
fesetenv (&oldenv);
diff --git a/sysdeps/ieee754/ldbl-128/e_fmodl.c b/sysdeps/ieee754/ldbl-128/e_fmodl.c
index 33280030f1..73465126b4 100644
--- a/sysdeps/ieee754/ldbl-128/e_fmodl.c
+++ b/sysdeps/ieee754/ldbl-128/e_fmodl.c
@@ -21,13 +21,13 @@
#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;
+ uint64_t lx,ly,lz;
GET_LDOUBLE_WORDS64(hx,lx,x);
GET_LDOUBLE_WORDS64(hy,ly,y);
@@ -42,7 +42,7 @@ __ieee754_fmodl (long double x, long double y)
if(hx<=hy) {
if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */
if(lx==ly)
- return Zero[(u_int64_t)sx>>63]; /* |x|=|y| return x*0*/
+ return Zero[(uint64_t)sx>>63]; /* |x|=|y| return x*0*/
}
/* determine ix = ilogb(x) */
@@ -96,7 +96,7 @@ __ieee754_fmodl (long double x, long double y)
if(hz<0){hx = hx+hx+(lx>>63); lx = lx+lx;}
else {
if((hz|lz)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ return Zero[(uint64_t)sx>>63];
hx = hz+hz+(lz>>63); lx = lz+lz;
}
}
@@ -105,7 +105,7 @@ __ieee754_fmodl (long double x, long double y)
/* convert back to floating value and restore the sign */
if((hx|lx)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ return Zero[(uint64_t)sx>>63];
while(hx<0x0001000000000000LL) { /* normalize x */
hx = hx+hx+(lx>>63); lx = lx+lx;
iy -= 1;
@@ -116,7 +116,7 @@ __ieee754_fmodl (long double x, long double y)
} else { /* subnormal output */
n = -16382 - iy;
if(n<=48) {
- lx = (lx>>n)|((u_int64_t)hx<<(64-n));
+ lx = (lx>>n)|((uint64_t)hx<<(64-n));
hx >>= n;
} else if (n<=63) {
lx = (hx<<(64-n))|(lx>>n); hx = sx;
diff --git a/sysdeps/ieee754/ldbl-128/e_gammal_r.c b/sysdeps/ieee754/ldbl-128/e_gammal_r.c
index d0286e31eb..e2730b8fc2 100644
--- a/sysdeps/ieee754/ldbl-128/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_gammal_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz, 1999.
@@ -20,27 +20,28 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* 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 +50,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 +94,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)
+ * 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 +120,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;
+ uint64_t lx;
+ _Float128 ret;
GET_LDOUBLE_WORDS64 (hx, lx, x);
@@ -134,7 +135,7 @@ __ieee754_gammal_r (long double x, int *signgamp)
*signgamp = 0;
return 1.0 / x;
}
- if (hx < 0 && (u_int64_t) hx < 0xffff000000000000ULL && __rintl (x) == x)
+ if (hx < 0 && (uint64_t) hx < 0xffff000000000000ULL && __rintl (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
@@ -154,7 +155,7 @@ __ieee754_gammal_r (long double x, int *signgamp)
return x + x;
}
- if (x >= 1756.0L)
+ if (x >= 1756)
{
/* Overflow. */
*signgamp = 0;
@@ -163,33 +164,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..7bafd4ae29 100644
--- a/sysdeps/ieee754/ldbl-128/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-128/e_hypotl.c
@@ -47,11 +47,12 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.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);
@@ -65,8 +66,10 @@ __ieee754_hypotl(long double x, long double y)
k=0;
if(ha > 0x5f3f000000000000LL) { /* a>2**8000 */
if(ha >= 0x7fff000000000000LL) { /* Inf or NaN */
- u_int64_t low;
+ uint64_t low;
w = a+b; /* for sNaN */
+ if (issignaling (a) || issignaling (b))
+ return w;
GET_LDOUBLE_LSW64(low,a);
if(((ha&0xffffffffffffLL)|low)==0) w = a;
GET_LDOUBLE_LSW64(low,b);
@@ -81,7 +84,7 @@ __ieee754_hypotl(long double x, long double y)
}
if(hb < 0x20bf000000000000LL) { /* b < 2**-8000 */
if(hb <= 0x0000ffffffffffffLL) { /* subnormal b or 0 */
- u_int64_t low;
+ uint64_t low;
GET_LDOUBLE_LSW64(low,b);
if((hb|low)==0) return a;
t1=0;
@@ -114,7 +117,7 @@ __ieee754_hypotl(long double x, long double y)
t1 = 0;
SET_LDOUBLE_MSW64(t1,ha);
t2 = a-t1;
- w = __ieee754_sqrtl(t1*t1-(b*(-b)-t2*(a+t1)));
+ w = sqrtl(t1*t1-(b*(-b)-t2*(a+t1)));
} else {
a = a+a;
y1 = 0;
@@ -123,11 +126,11 @@ __ieee754_hypotl(long double x, long double y)
t1 = 0;
SET_LDOUBLE_MSW64(t1,ha+0x0001000000000000LL);
t2 = a - t1;
- w = __ieee754_sqrtl(t1*y1-(w*(-w)-(t1*y2+t2*b)));
+ w = sqrtl(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
- u_int64_t high;
- t1 = 1.0L;
+ uint64_t high;
+ 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 c208916a79..5c699956b6 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;
+ 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)
- return ONEOSQPI * cc / __ieee754_sqrtl (xx);
+ if (xx > L(0x1p256))
+ return ONEOSQPI * cc / sqrtl (xx);
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -783,10 +783,10 @@ __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;
- z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
+ q = q - L(0.125) * xinv;
+ z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
return z;
}
strong_alias (__ieee754_j0l, __j0l_finite)
@@ -796,55 +796,50 @@ 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 const _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 const _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))
+ return 1 / (x + x * x);
+ if (x <= 0)
{
- if (x != x)
- return x;
- else
- return 0.0L;
- }
- if (x <= 0.0L)
- {
- if (x < 0.0L)
+ if (x < 0)
return (zero / (zero * x));
- return -HUGE_VALL + x;
+ return -1 / zero; /* -inf and divide by zero exception. */
}
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 +858,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 +867,10 @@ long double
ss = z / cc;
}
- if (xx > 0x1p256L)
- return ONEOSQPI * ss / __ieee754_sqrtl (x);
+ if (xx > L(0x1p256))
+ return ONEOSQPI * ss / sqrtl (x);
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -933,10 +928,10 @@ 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;
- z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (x);
+ q = q - L(0.125) * xinv;
+ z = ONEOSQPI * (p * ss + q * cc) / sqrtl (x);
return z;
}
strong_alias (__ieee754_y0l, __y0l_finite)
diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
index f5b04c073d..e6f46f52e9 100644
--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -98,36 +98,37 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#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 +136,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 +167,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 +201,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 +234,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 +266,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 +297,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 +327,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 +357,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 +387,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 +420,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 +456,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 +490,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 +523,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 +555,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 +587,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 +618,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 +665,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 +683,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;
+ 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 +726,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,15 +735,15 @@ __ieee754_j1l (long double x)
ss = z / cc;
}
- if (xx > 0x1p256L)
+ if (xx > L(0x1p256))
{
- z = ONEOSQPI * cc / __ieee754_sqrtl (xx);
+ z = ONEOSQPI * cc / sqrtl (xx);
if (x < 0)
z = -z;
return z;
}
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -800,10 +801,10 @@ __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;
- z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
+ q = q * xinv + L(0.375) * xinv;
+ z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
if (x < 0)
z = -z;
return z;
@@ -815,49 +816,44 @@ 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 const _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 const _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))
+ return 1 / (x + x * x);
+ if (x <= 0)
{
- if (x != x)
- return x;
- else
- return 0.0L;
- }
- if (x <= 0.0L)
- {
- if (x < 0.0L)
+ if (x < 0)
return (zero / (zero * x));
- return -HUGE_VALL + x;
+ return -1 / zero; /* -inf and divide by zero exception. */
}
xx = fabsl (x);
if (xx <= 0x1p-114)
@@ -867,7 +863,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 +883,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 +892,10 @@ __ieee754_y1l (long double x)
ss = z / cc;
}
- if (xx > 0x1p256L)
- return ONEOSQPI * ss / __ieee754_sqrtl (xx);
+ if (xx > L(0x1p256))
+ return ONEOSQPI * ss / sqrtl (xx);
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -957,10 +953,10 @@ __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;
- z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (xx);
+ q = q * xinv + L(0.375) * xinv;
+ z = ONEOSQPI * (p * ss + q * cc) / sqrtl (xx);
return z;
}
strong_alias (__ieee754_y1l, __y1l_finite)
diff --git a/sysdeps/ieee754/ldbl-128/e_jnl.c b/sysdeps/ieee754/ldbl-128/e_jnl.c
index 98669e6e3e..7739eec291 100644
--- a/sysdeps/ieee754/ldbl-128/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-128/e_jnl.c
@@ -60,21 +60,22 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.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;
+ uint32_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 +109,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 +132,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)
{
@@ -149,7 +150,7 @@ __ieee754_jnl (int n, long double x)
temp = c - s;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
@@ -158,7 +159,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 +179,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 +216,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 +250,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 +263,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 +271,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 +307,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;
+ uint32_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 +326,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 +368,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)
{
@@ -385,7 +386,7 @@ __ieee754_ynl (int n, long double x)
temp = s + c;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
@@ -397,7 +398,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..5c50e4616a 100644
--- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
@@ -72,35 +72,31 @@
#include <math_private.h>
#include <float.h>
-static const long double PIL = 3.1415926535897932384626433832795028841972E0L;
-#if LDBL_MANT_DIG == 106
-static const long double MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L;
-#else
-static const long double MAXLGM = 1.0485738685148938358098967157129705071571E4928L;
-#endif
-static const long double one = 1.0L;
-static const long double huge = LDBL_MAX;
+static const _Float128 PIL = L(3.1415926535897932384626433832795028841972E0);
+static const _Float128 MAXLGM = L(1.0485738685148938358098967157129705071571E4928);
+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 +104,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 +136,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 +168,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 +200,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 +233,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 +266,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 +300,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 +334,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 +369,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 +405,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 +442,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 +479,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 +515,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 +549,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 +584,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 +621,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 +658,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 +690,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 +738,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 +754,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 +765,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 > -50)
return __lgamma_negl (x, signgamp);
q = -x;
p = __floorl (q);
if (p == q)
- return (one / (p - p));
- long double halfp = p * 0.5L;
+ return (one / fabsl (p - p));
+ _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 +798,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 +815,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 +831,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 +858,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 +866,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 +903,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 +912,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 +938,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 +953,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 +1028,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..e8f33984f2 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 / fabsl (x)); /* log10l(+-0)=-inf */
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..06bf04f5e3 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 / fabsl (x)); /* log2l(+-0)=-inf */
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..8672047e43 100644
--- a/sysdeps/ieee754/ldbl-128/e_logl.c
+++ b/sysdeps/ieee754/ldbl-128/e_logl.c
@@ -58,134 +58,135 @@
License along with this library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <math.h>
#include <math_private.h>
/* 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 +199,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 +239,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 +275,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..dc748c3a0b 100644
--- a/sysdeps/ieee754/ldbl-128/e_powl.c
+++ b/sysdeps/ieee754/ldbl-128/e_powl.c
@@ -65,93 +65,94 @@
*/
#include <math.h>
+#include <math-barriers.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;
+ uint32_t ix, iy;
int32_t hx, hy;
ieee854_long_double_shape_type o, p, q;
@@ -165,13 +166,14 @@ __ieee754_powl (long double x, long double y)
/* y==zero: x**0 = 1 */
- if ((iy | q.parts32.w1 | q.parts32.w2 | q.parts32.w3) == 0)
+ if ((iy | q.parts32.w1 | q.parts32.w2 | q.parts32.w3) == 0
+ && !issignaling (x))
return one;
/* 1.0**y = 1; -1.0**+-Inf = 1 */
- if (x == one)
+ if (x == one && !issignaling (y))
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;
@@ -232,7 +234,7 @@ __ieee754_powl (long double x, long double y)
if (hy == 0x3ffe0000)
{ /* y is 0.5 */
if (hx >= 0) /* x >= +0 */
- return __ieee754_sqrtl (x);
+ return sqrtl (x);
}
}
@@ -259,12 +261,12 @@ __ieee754_powl (long double x, long double y)
}
/* (x<0)**(non-int) is NaN */
- if (((((u_int32_t) hx >> 31) - 1) | yisint) == 0)
+ if (((((uint32_t) hx >> 31) - 1) | yisint) == 0)
return (x - x) / (x - x);
/* sgn (sign of result -ve**odd) = -1 else = 1 */
sgn = one;
- if (((((u_int32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
+ if (((((uint32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
sgn = -one; /* (-ve)**(odd int) */
/* |y| is huge.
@@ -363,7 +365,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 +413,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 +439,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..d226d4218d 100644
--- a/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point argument reduction.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -183,22 +183,22 @@ 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;
+ uint64_t lx;
GET_LDOUBLE_WORDS64 (hx, lx, x);
ix = hx & 0x7fffffffffffffffLL;
@@ -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..09b8640b78 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;
+ uint64_t sx,lx,lp;
+ _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..39e7cf3084 100644
--- a/sysdeps/ieee754/ldbl-128/e_sinhl.c
+++ b/sysdeps/ieee754/ldbl-128/e_sinhl.c
@@ -56,15 +56,16 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.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;
- u_int32_t jx, ix;
+ _Float128 t, w, h;
+ uint32_t jx, ix;
ieee854_long_double_shape_type u;
/* Words of |x|. */
diff --git a/sysdeps/ieee754/ldbl-128/float128-abi.h b/sysdeps/ieee754/ldbl-128/float128-abi.h
new file mode 100644
index 0000000000..3077ffc7fe
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/float128-abi.h
@@ -0,0 +1,2 @@
+/* ABI version for _Float128 ABI introduction. */
+#define FLOAT128_VERSION GLIBC_2.27
diff --git a/sysdeps/ieee754/ldbl-128/gamma_productl.c b/sysdeps/ieee754/ldbl-128/gamma_productl.c
index 849b57d95d..2c1a03a915 100644
--- a/sysdeps/ieee754/ldbl-128/gamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128/gamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/ieee754.h b/sysdeps/ieee754/ldbl-128/ieee754.h
index fb42140933..d7173b6a8b 100644
--- a/sysdeps/ieee754/ldbl-128/ieee754.h
+++ b/sysdeps/ieee754/ldbl-128/ieee754.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128/k_cosl.c b/sysdeps/ieee754/ldbl-128/k_cosl.c
index 3985b1225b..866af57921 100644
--- a/sysdeps/ieee754/ldbl-128/k_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/k_cosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -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,27 +63,27 @@ 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;
+ uint32_t tix, hix, index;
GET_LDOUBLE_MSW64 (ix, x);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3ffc3000) /* |x| < 0.1484375 */
{
@@ -118,7 +118,7 @@ __kernel_cosl(long double x, long double y)
case 2: index = (hix - 0x3ffc3000) >> 10; break;
}
- SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
+ SET_LDOUBLE_WORDS64(h, ((uint64_t)hix) << 32, 0);
l = y - (h - x);
z = l * l;
sin_l = l*(ONE+z*(SSIN1+z*(SSIN2+z*(SSIN3+z*(SSIN4+z*SSIN5)))));
diff --git a/sysdeps/ieee754/ldbl-128/k_sincosl.c b/sysdeps/ieee754/ldbl-128/k_sincosl.c
index 404df352d3..6eb33ae375 100644
--- a/sysdeps/ieee754/ldbl-128/k_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/k_sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine and cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,10 +20,11 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.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 +33,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 +49,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 +65,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,30 +81,30 @@ 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;
+ uint32_t tix, hix, index;
GET_LDOUBLE_MSW64 (ix, x);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3ffc3000) /* |x| < 0.1484375 */
{
@@ -149,7 +150,7 @@ __kernel_sincosl(long double x, long double y, long double *sinx, long double *c
case 2: index = (hix - 0x3ffc3000) >> 10; break;
}
- SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
+ SET_LDOUBLE_WORDS64(h, ((uint64_t)hix) << 32, 0);
if (iy)
l = y - (h - x);
else
diff --git a/sysdeps/ieee754/ldbl-128/k_sinl.c b/sysdeps/ieee754/ldbl-128/k_sinl.c
index 6290b173b4..9c19fb1bf2 100644
--- a/sysdeps/ieee754/ldbl-128/k_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/k_sinl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,10 +20,11 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.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 +33,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 +49,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,27 +65,27 @@ 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;
+ uint32_t tix, hix, index;
GET_LDOUBLE_MSW64 (ix, x);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3ffc3000) /* |x| < 0.1484375 */
{
@@ -118,7 +119,7 @@ __kernel_sinl(long double x, long double y, int iy)
case 2: index = (hix - 0x3ffc3000) >> 10; break;
}
- SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
+ SET_LDOUBLE_WORDS64(h, ((uint64_t)hix) << 32, 0);
if (iy)
l = (ix < 0 ? -y : y) - (h - x);
else
diff --git a/sysdeps/ieee754/ldbl-128/k_tanl.c b/sysdeps/ieee754/ldbl-128/k_tanl.c
index 6bb221e4a6..8da794d80c 100644
--- a/sysdeps/ieee754/ldbl-128/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/k_tanl.c
@@ -57,36 +57,38 @@
*/
#include <float.h>
-#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,
+#include <math-underflow.h>
+#include <libc-diag.h>
+
+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;
@@ -98,7 +100,7 @@ __kernel_tanl (long double x, long double y, int iy)
{ /* generate inexact */
if ((ix | u.parts32.w1 | u.parts32.w2 | u.parts32.w3
| (iy + 1)) == 0)
- return one / fabs (x);
+ return one / fabsl (x);
else if (iy == 1)
{
math_check_force_underflow (x);
@@ -134,7 +136,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/ldbl2mpn.c b/sysdeps/ieee754/ldbl-128/ldbl2mpn.c
index e3f97623ed..0c0d43155d 100644
--- a/sysdeps/ieee754/ldbl-128/ldbl2mpn.c
+++ b/sysdeps/ieee754/ldbl-128/ldbl2mpn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <ieee754.h>
#include <float.h>
#include <math.h>
+#include <math_private.h>
#include <stdlib.h>
/* Convert a `long double' in IEEE854 quad-precision format to a
@@ -31,7 +32,7 @@
mp_size_t
__mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
int *expt, int *is_neg,
- long double value)
+ _Float128 value)
{
union ieee854_long_double u;
u.d = value;
diff --git a/sysdeps/ieee754/ldbl-128/lgamma_negl.c b/sysdeps/ieee754/ldbl-128/lgamma_negl.c
index df46199b82..f5043719ad 100644
--- a/sysdeps/ieee754/ldbl-128/lgamma_negl.c
+++ b/sysdeps/ieee754/ldbl-128/lgamma_negl.c
@@ -1,5 +1,5 @@
/* lgammal expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,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..fa69603aee 100644
--- a/sysdeps/ieee754/ldbl-128/lgamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128/lgamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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-nan-payload-ldouble.h b/sysdeps/ieee754/ldbl-128/math-nan-payload-ldouble.h
new file mode 100644
index 0000000000..e2f092d3e1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/math-nan-payload-ldouble.h
@@ -0,0 +1,32 @@
+/* NaN payload handling for ldbl-128.
+ Copyright (C) 1997-2018 Free Software 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 SET_NAN_PAYLOAD(flt, mant) \
+ do \
+ { \
+ union ieee854_long_double u; \
+ u.d = (flt); \
+ u.ieee_nan.mantissa0 = 0; \
+ u.ieee_nan.mantissa1 = 0; \
+ u.ieee_nan.mantissa2 = (mant) >> 32; \
+ u.ieee_nan.mantissa3 = (mant); \
+ if ((u.ieee.mantissa0 | u.ieee.mantissa1 \
+ | u.ieee.mantissa2 | u.ieee.mantissa3) != 0) \
+ (flt) = u.d; \
+ } \
+ while (0)
diff --git a/sysdeps/ieee754/ldbl-128/math_ldbl.h b/sysdeps/ieee754/ldbl-128/math_ldbl.h
index b3faa04846..db2bc5e0c3 100644
--- a/sysdeps/ieee754/ldbl-128/math_ldbl.h
+++ b/sysdeps/ieee754/ldbl-128/math_ldbl.h
@@ -1,41 +1,61 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+/* Manipulation of the bit representation of 'long double' quantities.
+ Copyright (C) 1999-2018 Free Software 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_LDBL_H_
+#define _MATH_LDBL_H_ 1
+
+#include <stdint.h>
+#include <endian.h>
/* A union which permits us to convert between a long double and
four 32 bit ints or two 64 bit ints. */
-#if __FLOAT_WORD_ORDER == BIG_ENDIAN
+#if __FLOAT_WORD_ORDER == __BIG_ENDIAN
typedef union
{
long double value;
struct
{
- u_int64_t msw;
- u_int64_t lsw;
+ uint64_t msw;
+ uint64_t lsw;
} parts64;
struct
{
- u_int32_t w0, w1, w2, w3;
+ uint32_t w0, w1, w2, w3;
} parts32;
} ieee854_long_double_shape_type;
#endif
-#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
+#if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN
typedef union
{
long double value;
struct
{
- u_int64_t lsw;
- u_int64_t msw;
+ uint64_t lsw;
+ uint64_t msw;
} parts64;
struct
{
- u_int32_t w3, w2, w1, w0;
+ uint32_t w3, w2, w1, w0;
} parts32;
} ieee854_long_double_shape_type;
@@ -88,3 +108,13 @@ 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
+
+#endif /* math_ldbl.h */
diff --git a/sysdeps/ieee754/ldbl-128/mpn2ldbl.c b/sysdeps/ieee754/ldbl-128/mpn2ldbl.c
index f9e4a39f59..9fb9f5c3ad 100644
--- a/sysdeps/ieee754/ldbl-128/mpn2ldbl.c
+++ b/sysdeps/ieee754/ldbl-128/mpn2ldbl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128/printf_fphex.c b/sysdeps/ieee754/ldbl-128/printf_fphex.c
index 83f8f39ae8..ec86afb6b1 100644
--- a/sysdeps/ieee754/ldbl-128/printf_fphex.c
+++ b/sysdeps/ieee754/ldbl-128/printf_fphex.c
@@ -1,6 +1,6 @@
/* Print floating point number in hexadecimal notation according to
ISO C99.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software 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,91 +17,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <ldbl-128/printf_fphex_macros.h>
#define PRINT_FPHEX_LONG_DOUBLE \
-do { \
- /* We have 112 bits of mantissa plus one implicit digit. Since \
- 112 bits are representable without rest using hexadecimal \
- digits we use only the implicit digits for the number before \
- the decimal point. */ \
- unsigned long long int num0, num1; \
- union ieee854_long_double u; \
- u.d = fpnum.ldbl; \
- \
- assert (sizeof (long double) == 16); \
- \
- num0 = (((unsigned long long int) u.ieee.mantissa0) << 32 \
- | u.ieee.mantissa1); \
- num1 = (((unsigned long long int) u.ieee.mantissa2) << 32 \
- | u.ieee.mantissa3); \
- \
- zero_mantissa = (num0|num1) == 0; \
- \
- if (sizeof (unsigned long int) > 6) \
- { \
- numstr = _itoa_word (num1, numbuf + sizeof numbuf, 16, \
- info->spec == 'A'); \
- wnumstr = _itowa_word (num1, \
- wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),\
- 16, info->spec == 'A'); \
- } \
- else \
- { \
- numstr = _itoa (num1, numbuf + sizeof numbuf, 16, \
- info->spec == 'A'); \
- wnumstr = _itowa (num1, \
- wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t), \
- 16, info->spec == 'A'); \
- } \
- \
- while (numstr > numbuf + (sizeof numbuf - 64 / 4)) \
- { \
- *--numstr = '0'; \
- *--wnumstr = L'0'; \
- } \
- \
- if (sizeof (unsigned long int) > 6) \
- { \
- numstr = _itoa_word (num0, numstr, 16, info->spec == 'A'); \
- wnumstr = _itowa_word (num0, wnumstr, 16, info->spec == 'A'); \
- } \
- else \
- { \
- numstr = _itoa (num0, numstr, 16, info->spec == 'A'); \
- wnumstr = _itowa (num0, wnumstr, 16, info->spec == 'A'); \
- } \
- \
- /* Fill with zeroes. */ \
- while (numstr > numbuf + (sizeof numbuf - 112 / 4)) \
- { \
- *--numstr = '0'; \
- *--wnumstr = L'0'; \
- } \
- \
- leading = u.ieee.exponent == 0 ? '0' : '1'; \
- \
- exponent = u.ieee.exponent; \
- \
- if (exponent == 0) \
- { \
- if (zero_mantissa) \
- expnegative = 0; \
- else \
- { \
- /* This is a denormalized number. */ \
- expnegative = 1; \
- exponent = IEEE854_LONG_DOUBLE_BIAS - 1; \
- } \
- } \
- else if (exponent >= IEEE854_LONG_DOUBLE_BIAS) \
- { \
- expnegative = 0; \
- exponent -= IEEE854_LONG_DOUBLE_BIAS; \
- } \
- else \
- { \
- expnegative = 1; \
- exponent = -(exponent - IEEE854_LONG_DOUBLE_BIAS); \
- } \
-} while (0)
+ PRINT_FPHEX (long double, fpnum.ldbl, ieee854_long_double, \
+ IEEE854_LONG_DOUBLE_BIAS)
#include <stdio-common/printf_fphex.c>
diff --git a/sysdeps/ieee754/ldbl-128/printf_fphex_macros.h b/sysdeps/ieee754/ldbl-128/printf_fphex_macros.h
new file mode 100644
index 0000000000..4d3ba72004
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/printf_fphex_macros.h
@@ -0,0 +1,104 @@
+/* Macro to print floating point numbers in hexadecimal notation.
+ Copyright (C) 2017-2018 Free Software 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 PRINT_FPHEX(FLOAT, VAR, IEEE854_UNION, IEEE854_BIAS) \
+do { \
+ /* We have 112 bits of mantissa plus one implicit digit. Since \
+ 112 bits are representable without rest using hexadecimal \
+ digits we use only the implicit digits for the number before \
+ the decimal point. */ \
+ unsigned long long int num0, num1; \
+ union IEEE854_UNION u; \
+ u.d = VAR; \
+ \
+ assert (sizeof (FLOAT) == 16); \
+ \
+ num0 = (((unsigned long long int) u.ieee.mantissa0) << 32 \
+ | u.ieee.mantissa1); \
+ num1 = (((unsigned long long int) u.ieee.mantissa2) << 32 \
+ | u.ieee.mantissa3); \
+ \
+ zero_mantissa = (num0|num1) == 0; \
+ \
+ if (sizeof (unsigned long int) > 6) \
+ { \
+ numstr = _itoa_word (num1, numbuf + sizeof numbuf, 16, \
+ info->spec == 'A'); \
+ wnumstr = _itowa_word (num1, \
+ wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),\
+ 16, info->spec == 'A'); \
+ } \
+ else \
+ { \
+ numstr = _itoa (num1, numbuf + sizeof numbuf, 16, \
+ info->spec == 'A'); \
+ wnumstr = _itowa (num1, \
+ wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t), \
+ 16, info->spec == 'A'); \
+ } \
+ \
+ while (numstr > numbuf + (sizeof numbuf - 64 / 4)) \
+ { \
+ *--numstr = '0'; \
+ *--wnumstr = L'0'; \
+ } \
+ \
+ if (sizeof (unsigned long int) > 6) \
+ { \
+ numstr = _itoa_word (num0, numstr, 16, info->spec == 'A'); \
+ wnumstr = _itowa_word (num0, wnumstr, 16, info->spec == 'A'); \
+ } \
+ else \
+ { \
+ numstr = _itoa (num0, numstr, 16, info->spec == 'A'); \
+ wnumstr = _itowa (num0, wnumstr, 16, info->spec == 'A'); \
+ } \
+ \
+ /* Fill with zeroes. */ \
+ while (numstr > numbuf + (sizeof numbuf - 112 / 4)) \
+ { \
+ *--numstr = '0'; \
+ *--wnumstr = L'0'; \
+ } \
+ \
+ leading = u.ieee.exponent == 0 ? '0' : '1'; \
+ \
+ exponent = u.ieee.exponent; \
+ \
+ if (exponent == 0) \
+ { \
+ if (zero_mantissa) \
+ expnegative = 0; \
+ else \
+ { \
+ /* This is a denormalized number. */ \
+ expnegative = 1; \
+ exponent = IEEE854_BIAS - 1; \
+ } \
+ } \
+ else if (exponent >= IEEE854_BIAS) \
+ { \
+ expnegative = 0; \
+ exponent -= IEEE854_BIAS; \
+ } \
+ else \
+ { \
+ expnegative = 1; \
+ exponent = -(exponent - IEEE854_BIAS); \
+ } \
+} while (0)
diff --git a/sysdeps/ieee754/ldbl-128/s_asinhl.c b/sysdeps/ieee754/ldbl-128/s_asinhl.c
index 5f3b9f2c76..a733ee7695 100644
--- a/sysdeps/ieee754/ldbl-128/s_asinhl.c
+++ b/sysdeps/ieee754/ldbl-128/s_asinhl.c
@@ -32,16 +32,18 @@ static char rcsid[] = "$NetBSD: $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.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;
@@ -64,16 +66,16 @@ __asinhl (long double x)
else if (ix >0x40000000)
{ /* 2^ 54 > |x| > 2.0 */
t = u.value;
- w = __ieee754_logl (2.0 * t + one / (__ieee754_sqrtl (x * x + one) + t));
+ w = __ieee754_logl (2.0 * t + one / (sqrtl (x * x + one) + t));
}
else
{ /* 2.0 > |x| > 2 ^ -56 */
t = x * x;
- w = __log1pl (u.value + t / (one + __ieee754_sqrtl (one + t)));
+ w = __log1pl (u.value + t / (one + sqrtl (one + t)));
}
if (sign & 0x80000000)
return -w;
else
return w;
}
-weak_alias (__asinhl, asinhl)
+libm_alias_ldouble (__asinh, asinh)
diff --git a/sysdeps/ieee754/ldbl-128/s_atanl.c b/sysdeps/ieee754/ldbl-128/s_atanl.c
index aaae701551..022ccf4c45 100644
--- a/sysdeps/ieee754/ldbl-128/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_atanl.c
@@ -62,93 +62,95 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.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 +158,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 +233,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.125 * k;
+ u = L(0.125) * k;
/* Small arctan argument. */
t = (x - u) / (1.0 + x * u);
}
@@ -250,4 +252,4 @@ __atanl (long double x)
return u;
}
-weak_alias (__atanl, atanl)
+libm_alias_ldouble (__atan, atan)
diff --git a/sysdeps/ieee754/ldbl-128/s_cbrtl.c b/sysdeps/ieee754/ldbl-128/s_cbrtl.c
index c3ae96830e..526e850378 100644
--- a/sysdeps/ieee754/ldbl-128/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cbrtl.c
@@ -56,18 +56,19 @@ Adapted for glibc October, 2001.
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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 +90,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,13 +124,13 @@ __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;
return (x);
}
-weak_alias (__cbrtl, cbrtl)
+libm_alias_ldouble (__cbrt, cbrt)
diff --git a/sysdeps/ieee754/ldbl-128/s_ceill.c b/sysdeps/ieee754/ldbl-128/s_ceill.c
index 9f6bc4ce15..e6aba5f2af 100644
--- a/sysdeps/ieee754/ldbl-128/s_ceill.c
+++ b/sysdeps/ieee754/ldbl-128/s_ceill.c
@@ -22,34 +22,28 @@ static char rcsid[] = "$NetBSD: $";
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to ceil(x).
*/
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double huge = 1.0e4930L;
-
-long double __ceill(long double x)
+_Float128 __ceill(_Float128 x)
{
int64_t i0,i1,j0;
- u_int64_t i,j;
+ uint64_t i,j;
GET_LDOUBLE_WORDS64(i0,i1,x);
j0 = ((i0>>48)&0x7fff)-0x3fff;
if(j0<48) {
- if(j0<0) { /* raise inexact if x != 0 */
- if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
- if(i0<0) {i0=0x8000000000000000ULL;i1=0;}
- else if((i0|i1)!=0) { i0=0x3fff000000000000ULL;i1=0;}
- }
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
+ if(i0<0) {i0=0x8000000000000000ULL;i1=0;}
+ else if((i0|i1)!=0) { i0=0x3fff000000000000ULL;i1=0;}
} else {
i = (0x0000ffffffffffffULL)>>j0;
if(((i0&i)|i1)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0>0) i0 += (0x0001000000000000LL)>>j0;
- i0 &= (~i); i1=0;
- }
+ if(i0>0) i0 += (0x0001000000000000LL)>>j0;
+ i0 &= (~i); i1=0;
}
} else if (j0>111) {
if(j0==0x4000) return x+x; /* inf or NaN */
@@ -57,19 +51,17 @@ long double __ceill(long double x)
} else {
i = -1ULL>>(j0-48);
if((i1&i)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0>0) {
- if(j0==48) i0+=1;
- else {
- j = i1+(1LL<<(112-j0));
- if(j<i1) i0 +=1 ; /* got a carry */
- i1=j;
- }
+ if(i0>0) {
+ if(j0==48) i0+=1;
+ else {
+ j = i1+(1LL<<(112-j0));
+ if(j<i1) i0 +=1 ; /* got a carry */
+ i1=j;
}
- i1 &= (~i);
}
+ i1 &= (~i);
}
SET_LDOUBLE_WORDS64(x,i0,i1);
return x;
}
-weak_alias (__ceill, ceill)
+libm_alias_ldouble (__ceil, ceil)
diff --git a/sysdeps/ieee754/ldbl-128/s_copysignl.c b/sysdeps/ieee754/ldbl-128/s_copysignl.c
index 19b6880940..d23e0f72ea 100644
--- a/sysdeps/ieee754/ldbl-128/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-128/s_copysignl.c
@@ -25,14 +25,15 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double __copysignl(long double x, long double y)
+_Float128 __copysignl(_Float128 x, _Float128 y)
{
- u_int64_t hx,hy;
+ uint64_t hx,hy;
GET_LDOUBLE_MSW64(hx,x);
GET_LDOUBLE_MSW64(hy,y);
SET_LDOUBLE_MSW64(x,(hx&0x7fffffffffffffffULL)
|(hy&0x8000000000000000ULL));
return x;
}
-weak_alias (__copysignl, copysignl)
+libm_alias_ldouble (__copysign, copysign)
diff --git a/sysdeps/ieee754/ldbl-128/s_cosl.c b/sysdeps/ieee754/ldbl-128/s_cosl.c
index 2c3bff6e0f..b315abccc5 100644
--- a/sysdeps/ieee754/ldbl-128/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cosl.c
@@ -47,10 +47,11 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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. */
@@ -83,4 +84,4 @@ long double __cosl(long double x)
}
}
}
-weak_alias (__cosl, cosl)
+libm_alias_ldouble (__cos, cos)
diff --git a/sysdeps/ieee754/ldbl-128/s_daddl.c b/sysdeps/ieee754/ldbl-128/s_daddl.c
new file mode 100644
index 0000000000..81e8e2d3e1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_daddl.c
@@ -0,0 +1,37 @@
+/* Add long double (ldbl-128) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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 f32xaddf64x __hide_f32xaddf64x
+#define f32xaddf128 __hide_f32xaddf128
+#define f64addf64x __hide_f64addf64x
+#define f64addf128 __hide_f64addf128
+#include <math.h>
+#undef f32xaddf64x
+#undef f32xaddf128
+#undef f64addf64x
+#undef f64addf128
+
+#include <math-narrow.h>
+
+double
+__daddl (_Float128 x, _Float128 y)
+{
+ NARROW_ADD_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_double_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-128/s_ddivl.c b/sysdeps/ieee754/ldbl-128/s_ddivl.c
new file mode 100644
index 0000000000..c76df92bfb
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_ddivl.c
@@ -0,0 +1,37 @@
+/* Divide long double (ldbl-128) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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 f32xdivf64x __hide_f32xdivf64x
+#define f32xdivf128 __hide_f32xdivf128
+#define f64divf64x __hide_f64divf64x
+#define f64divf128 __hide_f64divf128
+#include <math.h>
+#undef f32xdivf64x
+#undef f32xdivf128
+#undef f64divf64x
+#undef f64divf128
+
+#include <math-narrow.h>
+
+double
+__ddivl (_Float128 x, _Float128 y)
+{
+ NARROW_DIV_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_double_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-128/s_dmull.c b/sysdeps/ieee754/ldbl-128/s_dmull.c
new file mode 100644
index 0000000000..d32c4284e0
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_dmull.c
@@ -0,0 +1,37 @@
+/* Multiply long double (ldbl-128) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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 f32xmulf64x __hide_f32xmulf64x
+#define f32xmulf128 __hide_f32xmulf128
+#define f64mulf64x __hide_f64mulf64x
+#define f64mulf128 __hide_f64mulf128
+#include <math.h>
+#undef f32xmulf64x
+#undef f32xmulf128
+#undef f64mulf64x
+#undef f64mulf128
+
+#include <math-narrow.h>
+
+double
+__dmull (_Float128 x, _Float128 y)
+{
+ NARROW_MUL_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_double_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-128/s_dsubl.c b/sysdeps/ieee754/ldbl-128/s_dsubl.c
new file mode 100644
index 0000000000..46d0f95b4c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_dsubl.c
@@ -0,0 +1,37 @@
+/* Subtract long double (ldbl-128) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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 f32xsubf64x __hide_f32xsubf64x
+#define f32xsubf128 __hide_f32xsubf128
+#define f64subf64x __hide_f64subf64x
+#define f64subf128 __hide_f64subf128
+#include <math.h>
+#undef f32xsubf64x
+#undef f32xsubf128
+#undef f64subf64x
+#undef f64subf128
+
+#include <math-narrow.h>
+
+double
+__dsubl (_Float128 x, _Float128 y)
+{
+ NARROW_SUB_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_double_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-128/s_erfl.c b/sysdeps/ieee754/ldbl-128/s_erfl.c
index dd275a7dd9..c0abfe2926 100644
--- a/sysdeps/ieee754/ldbl-128/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_erfl.c
@@ -100,13 +100,15 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
/* 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 +123,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 +140,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 +183,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 +217,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 +515,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 +548,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 +581,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 +615,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 +650,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 +686,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 +722,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 +765,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 +786,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;
}
@@ -803,11 +805,11 @@ __erfl (long double x)
return( y );
}
-weak_alias (__erfl, erfl)
-long double
-__erfcl (long double x)
+libm_alias_ldouble (__erf, erf)
+_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 +821,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) (((uint32_t) sign >> 31) << 1) + one / x;
}
if (ix < 0x3ffd0000) /* |x| <1/4 */
@@ -835,48 +837,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 +927,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;
@@ -945,4 +947,4 @@ __erfcl (long double x)
}
}
-weak_alias (__erfcl, erfcl)
+libm_alias_ldouble (__erfc, erfc)
diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index b1100a9d0e..66881af01a 100644
--- a/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -57,41 +57,43 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
/* exp(x) - 1 = x + 0.5 x^2 + x^3 P(x)/Q(x)
-.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,9 +112,9 @@ __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;
- /* NaN. No invalid exception. */
- return x;
+ return -1;
+ /* NaN. Invalid exception if signaling. */
+ return x + x;
}
/* expm1(+- 0) = +- 0. */
@@ -121,12 +123,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,9 +160,9 @@ __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;
}
libm_hidden_def (__expm1l)
-weak_alias (__expm1l, expm1l)
+libm_alias_ldouble (__expm1, expm1)
diff --git a/sysdeps/ieee754/ldbl-128/s_f64xaddf128.c b/sysdeps/ieee754/ldbl-128/s_f64xaddf128.c
new file mode 100644
index 0000000000..545c7b93fd
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_f64xaddf128.c
@@ -0,0 +1,38 @@
+/* Add _Float128 values, converting the result to _Float64x.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+/* math_ldbl.h defines _Float128 to long double for this directory,
+ but when they are different, this function must be defined with
+ _Float128 arguments to avoid defining an alias with an incompatible
+ type. */
+#undef _Float128
+
+_Float64x
+__f64xaddf128 (_Float128 x, _Float128 y)
+{
+#if __HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_DISTINCT_FLOAT128
+ NARROW_ADD_ROUND_TO_ODD (x, y, _Float64x, union ieee854_long_double, l,
+ mantissa3);
+#else
+ NARROW_ADD_TRIVIAL (x, y, _Float64x);
+#endif
+}
+libm_alias_float64x_float128 (add)
diff --git a/sysdeps/ieee754/ldbl-128/s_f64xdivf128.c b/sysdeps/ieee754/ldbl-128/s_f64xdivf128.c
new file mode 100644
index 0000000000..64356bbdd7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_f64xdivf128.c
@@ -0,0 +1,38 @@
+/* Divide _Float128 values, converting the result to _Float64x.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+/* math_ldbl.h defines _Float128 to long double for this directory,
+ but when they are different, this function must be defined with
+ _Float128 arguments to avoid defining an alias with an incompatible
+ type. */
+#undef _Float128
+
+_Float64x
+__f64xdivf128 (_Float128 x, _Float128 y)
+{
+#if __HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_DISTINCT_FLOAT128
+ NARROW_DIV_ROUND_TO_ODD (x, y, _Float64x, union ieee854_long_double, l,
+ mantissa3);
+#else
+ NARROW_DIV_TRIVIAL (x, y, _Float64x);
+#endif
+}
+libm_alias_float64x_float128 (div)
diff --git a/sysdeps/ieee754/ldbl-128/s_f64xmulf128.c b/sysdeps/ieee754/ldbl-128/s_f64xmulf128.c
new file mode 100644
index 0000000000..ed88eabe40
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_f64xmulf128.c
@@ -0,0 +1,38 @@
+/* Multiply _Float128 values, converting the result to _Float64x.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+/* math_ldbl.h defines _Float128 to long double for this directory,
+ but when they are different, this function must be defined with
+ _Float128 arguments to avoid defining an alias with an incompatible
+ type. */
+#undef _Float128
+
+_Float64x
+__f64xmulf128 (_Float128 x, _Float128 y)
+{
+#if __HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_DISTINCT_FLOAT128
+ NARROW_MUL_ROUND_TO_ODD (x, y, _Float64x, union ieee854_long_double, l,
+ mantissa3);
+#else
+ NARROW_MUL_TRIVIAL (x, y, _Float64x);
+#endif
+}
+libm_alias_float64x_float128 (mul)
diff --git a/sysdeps/ieee754/ldbl-128/s_f64xsubf128.c b/sysdeps/ieee754/ldbl-128/s_f64xsubf128.c
new file mode 100644
index 0000000000..c9a63d9e84
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_f64xsubf128.c
@@ -0,0 +1,38 @@
+/* Subtract _Float128 values, converting the result to _Float64x.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+/* math_ldbl.h defines _Float128 to long double for this directory,
+ but when they are different, this function must be defined with
+ _Float128 arguments to avoid defining an alias with an incompatible
+ type. */
+#undef _Float128
+
+_Float64x
+__f64xsubf128 (_Float128 x, _Float128 y)
+{
+#if __HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_DISTINCT_FLOAT128
+ NARROW_SUB_ROUND_TO_ODD (x, y, _Float64x, union ieee854_long_double, l,
+ mantissa3);
+#else
+ NARROW_SUB_TRIVIAL (x, y, _Float64x);
+#endif
+}
+libm_alias_float64x_float128 (sub)
diff --git a/sysdeps/ieee754/ldbl-128/s_fabsl.c b/sysdeps/ieee754/ldbl-128/s_fabsl.c
index a1bb6c5dff..8d554531be 100644
--- a/sysdeps/ieee754/ldbl-128/s_fabsl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fabsl.c
@@ -23,12 +23,13 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double __fabsl(long double x)
+_Float128 __fabsl(_Float128 x)
{
- u_int64_t hx;
+ uint64_t hx;
GET_LDOUBLE_MSW64(hx,x);
SET_LDOUBLE_MSW64(x,hx&0x7fffffffffffffffLL);
return x;
}
-weak_alias (__fabsl, fabsl)
+libm_alias_ldouble (__fabs, fabs)
diff --git a/sysdeps/ieee754/ldbl-128/s_faddl.c b/sysdeps/ieee754/ldbl-128/s_faddl.c
new file mode 100644
index 0000000000..edbaa2103b
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_faddl.c
@@ -0,0 +1,33 @@
+/* Add long double (ldbl-128) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32addf64x __hide_f32addf64x
+#define f32addf128 __hide_f32addf128
+#include <math.h>
+#undef f32addf64x
+#undef f32addf128
+
+#include <math-narrow.h>
+
+float
+__faddl (_Float128 x, _Float128 y)
+{
+ NARROW_ADD_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_float_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-128/s_fdivl.c b/sysdeps/ieee754/ldbl-128/s_fdivl.c
new file mode 100644
index 0000000000..b00fdb4eaa
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fdivl.c
@@ -0,0 +1,33 @@
+/* Divide long double (ldbl-128) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32divf64x __hide_f32divf64x
+#define f32divf128 __hide_f32divf128
+#include <math.h>
+#undef f32divf64x
+#undef f32divf128
+
+#include <math-narrow.h>
+
+float
+__fdivl (_Float128 x, _Float128 y)
+{
+ NARROW_DIV_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_float_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-128/s_finitel.c b/sysdeps/ieee754/ldbl-128/s_finitel.c
index ea8a9ba379..d42b37815c 100644
--- a/sysdeps/ieee754/ldbl-128/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-128/s_finitel.c
@@ -25,12 +25,12 @@ 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);
- return (int)((u_int64_t)((hx&0x7fff000000000000LL)
- -0x7fff000000000000LL)>>63);
+ return (int)((uint64_t)((hx&0x7fff000000000000LL)
+ -0x7fff000000000000LL)>>63);
}
-hidden_def (__finitel)
+mathx_hidden_def (__finitel)
weak_alias (__finitel, finitel)
diff --git a/sysdeps/ieee754/ldbl-128/s_floorl.c b/sysdeps/ieee754/ldbl-128/s_floorl.c
index c72d5d4330..f9c5e014f9 100644
--- a/sysdeps/ieee754/ldbl-128/s_floorl.c
+++ b/sysdeps/ieee754/ldbl-128/s_floorl.c
@@ -22,35 +22,29 @@ static char rcsid[] = "$NetBSD: $";
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floor(x).
*/
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double huge = 1.0e4930L;
-
-long double __floorl(long double x)
+_Float128 __floorl(_Float128 x)
{
int64_t i0,i1,j0;
- u_int64_t i,j;
+ uint64_t i,j;
GET_LDOUBLE_WORDS64(i0,i1,x);
j0 = ((i0>>48)&0x7fff)-0x3fff;
if(j0<48) {
- if(j0<0) { /* raise inexact if x != 0 */
- if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
- if(i0>=0) {i0=i1=0;}
- else if(((i0&0x7fffffffffffffffLL)|i1)!=0)
- { i0=0xbfff000000000000ULL;i1=0;}
- }
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
+ if(i0>=0) {i0=i1=0;}
+ else if(((i0&0x7fffffffffffffffLL)|i1)!=0)
+ { i0=0xbfff000000000000ULL;i1=0;}
} else {
i = (0x0000ffffffffffffULL)>>j0;
if(((i0&i)|i1)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0<0) i0 += (0x0001000000000000LL)>>j0;
- i0 &= (~i); i1=0;
- }
+ if(i0<0) i0 += (0x0001000000000000LL)>>j0;
+ i0 &= (~i); i1=0;
}
} else if (j0>111) {
if(j0==0x4000) return x+x; /* inf or NaN */
@@ -58,19 +52,17 @@ long double __floorl(long double x)
} else {
i = -1ULL>>(j0-48);
if((i1&i)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0<0) {
- if(j0==48) i0+=1;
- else {
- j = i1+(1LL<<(112-j0));
- if(j<i1) i0 +=1 ; /* got a carry */
- i1=j;
- }
+ if(i0<0) {
+ if(j0==48) i0+=1;
+ else {
+ j = i1+(1LL<<(112-j0));
+ if(j<i1) i0 +=1 ; /* got a carry */
+ i1=j;
}
- i1 &= (~i);
}
+ i1 &= (~i);
}
SET_LDOUBLE_WORDS64(x,i0,i1);
return x;
}
-weak_alias (__floorl, floorl)
+libm_alias_ldouble (__floor, floor)
diff --git a/sysdeps/ieee754/ldbl-128/s_fma.c b/sysdeps/ieee754/ldbl-128/s_fma.c
index cbe708f4b8..19620dca5c 100644
--- a/sysdeps/ieee754/ldbl-128/s_fma.c
+++ b/sysdeps/ieee754/ldbl-128/s_fma.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -20,6 +20,7 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <libm-alias-double.h>
/* This implementation relies on long double being more than twice as
precise as double and uses rounding to odd in order to avoid problems
@@ -51,5 +52,5 @@ __fma (double x, double y, double z)
return (double) u.d;
}
#ifndef __fma
-weak_alias (__fma, fma)
+libm_alias_double (__fma, fma)
#endif
diff --git a/sysdeps/ieee754/ldbl-128/s_fmal.c b/sysdeps/ieee754/ldbl-128/s_fmal.c
index 728949c916..4eba9253df 100644
--- a/sysdeps/ieee754/ldbl-128/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128/s_fmal.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -21,15 +21,17 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include <tininess.h>
/* This implementation uses rounding to odd to avoid problems with
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 +77,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 +85,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 +96,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 +146,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 +154,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 +168,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 +192,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 +240,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 +257,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 +280,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)
+libm_alias_ldouble (__fma, fma)
diff --git a/sysdeps/ieee754/ldbl-128/s_fmull.c b/sysdeps/ieee754/ldbl-128/s_fmull.c
new file mode 100644
index 0000000000..dd399f9590
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fmull.c
@@ -0,0 +1,33 @@
+/* Multiply long double (ldbl-128) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32mulf64x __hide_f32mulf64x
+#define f32mulf128 __hide_f32mulf128
+#include <math.h>
+#undef f32mulf64x
+#undef f32mulf128
+
+#include <math-narrow.h>
+
+float
+__fmull (_Float128 x, _Float128 y)
+{
+ NARROW_MUL_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_float_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c b/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
index c89686f8f9..6deaa5cc45 100644
--- a/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -24,9 +24,9 @@
int
-__fpclassifyl (long double x)
+__fpclassifyl (_Float128 x)
{
- u_int64_t hx, lx;
+ uint64_t hx, lx;
int retval = FP_NORMAL;
GET_LDOUBLE_WORDS64 (hx, lx, x);
diff --git a/sysdeps/ieee754/ldbl-128/s_frexpl.c b/sysdeps/ieee754/ldbl-128/s_frexpl.c
index d61dddaaaa..bab0779e23 100644
--- a/sysdeps/ieee754/ldbl-128/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-128/s_frexpl.c
@@ -29,17 +29,18 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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;
+ uint64_t hx, lx, ix;
GET_LDOUBLE_WORDS64(hx,lx,x);
ix = 0x7fffffffffffffffULL&hx;
*eptr = 0;
- if(ix>=0x7fff000000000000ULL||((ix|lx)==0)) return x; /* 0,inf,nan */
+ if(ix>=0x7fff000000000000ULL||((ix|lx)==0)) return x + x;/* 0,inf,nan */
if (ix<0x0001000000000000ULL) { /* subnormal */
x *= two114;
GET_LDOUBLE_MSW64(hx,x);
@@ -51,4 +52,4 @@ long double __frexpl(long double x, int *eptr)
SET_LDOUBLE_MSW64(x,hx);
return x;
}
-weak_alias (__frexpl, frexpl)
+libm_alias_ldouble (__frexp, frexp)
diff --git a/sysdeps/ieee754/ldbl-128/s_fromfpl.c b/sysdeps/ieee754/ldbl-128/s_fromfpl.c
new file mode 100644
index 0000000000..bcedceea8e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/ldbl-128/s_fromfpl_main.c b/sysdeps/ieee754/ldbl-128/s_fromfpl_main.c
new file mode 100644
index 0000000000..5b9c1a84b2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fromfpl_main.c
@@ -0,0 +1,91 @@
+/* Round to integer type. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software 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 <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x3fff
+#define MANT_DIG 113
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (_Float128 x, int round, unsigned int width)
+{
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint64_t hx, lx;
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ bool negative = (hx & 0x8000000000000000ULL) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ hx &= 0x7fffffffffffffffULL;
+ if ((hx | lx) == 0)
+ return 0;
+ int exponent = hx >> (MANT_DIG - 1 - 64);
+ exponent -= BIAS;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+
+ hx &= ((1ULL << (MANT_DIG - 1 - 64)) - 1);
+ hx |= 1ULL << (MANT_DIG - 1 - 64);
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ /* The exponent is at most 63, so we are shifting right by at least
+ 49 bits. */
+ if (exponent >= -1)
+ {
+ int shift = MANT_DIG - 1 - exponent;
+ if (shift <= 64)
+ {
+ uint64_t h = 1ULL << (shift - 1);
+ half_bit = (lx & h) != 0;
+ more_bits = (lx & (h - 1)) != 0;
+ uret = hx << (64 - shift);
+ if (shift != 64)
+ uret |= lx >> shift;
+ }
+ else
+ {
+ uint64_t h = 1ULL << (shift - 1 - 64);
+ half_bit = (hx & h) != 0;
+ more_bits = ((hx & (h - 1)) | lx) != 0;
+ uret = hx >> (shift - 64);
+ }
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/ldbl-128/s_fromfpxl.c b/sysdeps/ieee754/ldbl-128/s_fromfpxl.c
new file mode 100644
index 0000000000..0a342a22d1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/ldbl-128/s_fsubl.c b/sysdeps/ieee754/ldbl-128/s_fsubl.c
new file mode 100644
index 0000000000..6a5e6b3173
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fsubl.c
@@ -0,0 +1,33 @@
+/* Subtract long double (ldbl-128) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32subf64x __hide_f32subf64x
+#define f32subf128 __hide_f32subf128
+#include <math.h>
+#undef f32subf64x
+#undef f32subf128
+
+#include <math-narrow.h>
+
+float
+__fsubl (_Float128 x, _Float128 y)
+{
+ NARROW_SUB_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_float_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-128/s_getpayloadl.c b/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
new file mode 100644
index 0000000000..3bdc429de6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
@@ -0,0 +1,59 @@
+/* Get NaN payload. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.h>
+#include <stdint.h>
+
+_Float128
+__getpayloadl (const _Float128 *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);
+ _Float128 ret;
+ SET_LDOUBLE_WORDS64 (ret, hx, lx);
+ return ret;
+}
+libm_alias_ldouble (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/ldbl-128/s_isinfl.c b/sysdeps/ieee754/ldbl-128/s_isinfl.c
index 03e4d13371..a41e8cf44b 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);
@@ -25,5 +25,5 @@ __isinfl (long double x)
lx |= -lx;
return ~(lx >> 63) & (hx >> 62);
}
-hidden_def (__isinfl)
+mathx_hidden_def (__isinfl)
weak_alias (__isinfl, isinfl)
diff --git a/sysdeps/ieee754/ldbl-128/s_isnanl.c b/sysdeps/ieee754/ldbl-128/s_isnanl.c
index 74960e7ff2..8ebef00d24 100644
--- a/sysdeps/ieee754/ldbl-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isnanl.c
@@ -25,14 +25,14 @@ 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);
hx &= 0x7fffffffffffffffLL;
- hx |= (u_int64_t)(lx|(-lx))>>63;
+ hx |= (uint64_t)(lx|(-lx))>>63;
hx = 0x7fff000000000000LL - hx;
- return (int)((u_int64_t)hx>>63);
+ return (int)((uint64_t)hx>>63);
}
-hidden_def (__isnanl)
+mathx_hidden_def (__isnanl)
weak_alias (__isnanl, isnanl)
diff --git a/sysdeps/ieee754/ldbl-128/s_issignalingl.c b/sysdeps/ieee754/ldbl-128/s_issignalingl.c
index c06f14dd12..1893e80293 100644
--- a/sysdeps/ieee754/ldbl-128/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-128/s_issignalingl.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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));
+ uint64_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..ce17cf962a 100644
--- a/sysdeps/ieee754/ldbl-128/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -24,21 +24,22 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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;
+ uint64_t i0,i1;
+ _Float128 w;
+ _Float128 t;
long long int result;
int sx;
@@ -52,7 +53,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 +84,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 +93,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;
@@ -105,4 +106,4 @@ __llrintl (long double x)
return sx ? -result : result;
}
-weak_alias (__llrintl, llrintl)
+libm_alias_ldouble (__llrint, llrint)
diff --git a/sysdeps/ieee754/ldbl-128/s_llroundl.c b/sysdeps/ieee754/ldbl-128/s_llroundl.c
index bfc81cc534..1973e1bffd 100644
--- a/sysdeps/ieee754/ldbl-128/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llroundl.c
@@ -1,5 +1,5 @@
/* Round long double value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -23,13 +23,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#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;
+ uint64_t i1, i0;
long long int result;
int sign;
@@ -55,7 +56,7 @@ __llroundl (long double x)
result = ((long long int) i0 << (j0 - 48)) | (i1 << (j0 - 112));
else
{
- u_int64_t j = i1 + (0x8000000000000000ULL >> (j0 - 48));
+ uint64_t j = i1 + (0x8000000000000000ULL >> (j0 - 48));
if (j < i1)
++i0;
@@ -79,13 +80,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". */
@@ -99,4 +100,4 @@ __llroundl (long double x)
return sign * result;
}
-weak_alias (__llroundl, llroundl)
+libm_alias_ldouble (__llround, llround)
diff --git a/sysdeps/ieee754/ldbl-128/s_log1pl.c b/sysdeps/ieee754/ldbl-128/s_log1pl.c
index b348f41e55..f3181dbc8e 100644
--- a/sysdeps/ieee754/ldbl-128/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128/s_log1pl.c
@@ -56,39 +56,40 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
/* Coefficients for log(1+x) = x - x^2 / 2 + x^3 P(x)/Q(x)
* 1/sqrt(2) <= 1+x < sqrt(2)
* 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 +97,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 +146,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 +172,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 +210,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 +250,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 3ba67b7bd2..9264fe6616 100644
--- a/sysdeps/ieee754/ldbl-128/s_logbl.c
+++ b/sysdeps/ieee754/ldbl-128/s_logbl.c
@@ -25,16 +25,17 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double
-__logbl (long double x)
+_Float128
+__logbl (_Float128 x)
{
int64_t lx, hx, ex;
GET_LDOUBLE_WORDS64 (hx, lx, x);
hx &= 0x7fffffffffffffffLL; /* high |x| */
if ((hx | lx) == 0)
- return -1.0 / fabs (x);
+ return -1.0 / fabsl (x);
if (hx >= 0x7fff000000000000LL)
return x * x;
if ((ex = hx >> 48) == 0) /* IEEE 754 logb */
@@ -48,7 +49,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)
+libm_alias_ldouble (__logb, logb)
diff --git a/sysdeps/ieee754/ldbl-128/s_lrintl.c b/sysdeps/ieee754/ldbl-128/s_lrintl.c
index 23f828f862..c1233a45dc 100644
--- a/sysdeps/ieee754/ldbl-128/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -24,21 +24,22 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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;
+ uint64_t i0,i1;
+ _Float128 w;
+ _Float128 t;
long int result;
int sx;
@@ -55,7 +56,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 +83,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 +113,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 +122,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;
@@ -134,4 +135,4 @@ __lrintl (long double x)
return sx ? -result : result;
}
-weak_alias (__lrintl, lrintl)
+libm_alias_ldouble (__lrint, lrint)
diff --git a/sysdeps/ieee754/ldbl-128/s_lroundl.c b/sysdeps/ieee754/ldbl-128/s_lroundl.c
index f03262543f..f109157d67 100644
--- a/sysdeps/ieee754/ldbl-128/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lroundl.c
@@ -1,5 +1,5 @@
/* Round long double value to long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -23,13 +23,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include <fix-fp-int-convert-overflow.h>
long int
-__lroundl (long double x)
+__lroundl (_Float128 x)
{
int64_t j0;
- u_int64_t i1, i0;
+ uint64_t i1, i0;
long int result;
int sign;
@@ -62,7 +63,7 @@ __lroundl (long double x)
result = ((long int) i0 << (j0 - 48)) | (i1 << (j0 - 112));
else
{
- u_int64_t j = i1 + (0x8000000000000000ULL >> (j0 - 48));
+ uint64_t j = i1 + (0x8000000000000000ULL >> (j0 - 48));
if (j < i1)
++i0;
@@ -88,13 +89,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". */
@@ -110,4 +111,4 @@ __lroundl (long double x)
return sign * result;
}
-weak_alias (__lroundl, lroundl)
+libm_alias_ldouble (__lround, lround)
diff --git a/sysdeps/ieee754/ldbl-128/s_modfl.c b/sysdeps/ieee754/ldbl-128/s_modfl.c
index 597a5c9a0c..2d0a2d739f 100644
--- a/sysdeps/ieee754/ldbl-128/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_modfl.c
@@ -29,13 +29,14 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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;
+ uint64_t i;
GET_LDOUBLE_WORDS64(i0,i1,x);
j0 = ((i0>>48)&0x7fff)-0x3fff; /* exponent of x */
if(j0<48) { /* integer part in high x */
@@ -76,4 +77,4 @@ long double __modfl(long double x, long double *iptr)
}
}
}
-weak_alias (__modfl, modfl)
+libm_alias_ldouble (__modf, modf)
diff --git a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
index 2017c04207..f044cb4334 100644
--- a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -25,27 +25,29 @@
#include <fenv.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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;
+ uint64_t i1 __attribute__ ((unused));
+ _Float128 w,t;
GET_LDOUBLE_WORDS64(i0,i1,x);
- sx = (((u_int64_t)i0)>>63);
+ sx = (((uint64_t)i0)>>63);
j0 = ((i0>>48)&0x7fff)-0x3fff;
if(j0<112) {
if(j0<0) {
feholdexcept (&env);
- w = TWO112[sx]+x;
+ w = TWO112[sx] + math_opt_barrier (x);
t = w-TWO112[sx];
math_force_eval (t);
fesetenv (&env);
@@ -58,10 +60,10 @@ long double __nearbyintl(long double x)
else return x; /* x is integral */
}
feholdexcept (&env);
- w = TWO112[sx]+x;
+ w = TWO112[sx] + math_opt_barrier (x);
t = w-TWO112[sx];
math_force_eval (t);
fesetenv (&env);
return t;
}
-weak_alias (__nearbyintl, nearbyintl)
+libm_alias_ldouble (__nearbyint, nearbyint)
diff --git a/sysdeps/ieee754/ldbl-128/s_nextafterl.c b/sysdeps/ieee754/ldbl-128/s_nextafterl.c
index 4e9a2ce520..60fdae648f 100644
--- a/sysdeps/ieee754/ldbl-128/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nextafterl.c
@@ -26,12 +26,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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;
+ uint64_t lx,ly;
GET_LDOUBLE_WORDS64(hx,lx,x);
GET_LDOUBLE_WORDS64(hy,ly,y);
@@ -43,7 +45,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,18 +71,18 @@ 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);
}
SET_LDOUBLE_WORDS64(x,hx,lx);
return x;
}
-weak_alias (__nextafterl, nextafterl)
+libm_alias_ldouble (__nextafter, nextafter)
strong_alias (__nextafterl, __nexttowardl)
weak_alias (__nextafterl, nexttowardl)
diff --git a/sysdeps/ieee754/ldbl-128/s_nexttoward.c b/sysdeps/ieee754/ldbl-128/s_nexttoward.c
index 4343fe83f8..6db8b7f15f 100644
--- a/sysdeps/ieee754/ldbl-128/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-128/s_nexttoward.c
@@ -27,6 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <float.h>
@@ -34,8 +35,8 @@ double __nexttoward(double x, long double y)
{
int32_t hx,ix;
int64_t hy,iy;
- u_int32_t lx;
- u_int64_t ly;
+ uint32_t lx;
+ uint64_t ly;
EXTRACT_WORDS(hx,lx,x);
GET_LDOUBLE_WORDS64(hy,ly,y);
@@ -49,7 +50,7 @@ double __nexttoward(double x, long double y)
if((long double) x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
double u;
- INSERT_WORDS(x,(u_int32_t)((hy>>32)&0x80000000),1);/* return +-minsub */
+ INSERT_WORDS(x,(uint32_t)((hy>>32)&0x80000000),1);/* return +-minsub */
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
diff --git a/sysdeps/ieee754/ldbl-128/s_nexttowardf.c b/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
index 8703359d4f..7840cb382e 100644
--- a/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
@@ -20,13 +20,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
float __nexttowardf(float x, long double y)
{
int32_t hx,ix;
int64_t hy,iy;
- u_int64_t ly;
+ uint64_t ly;
GET_FLOAT_WORD(hx,x);
GET_LDOUBLE_WORDS64(hy,ly,y);
@@ -40,7 +41,7 @@ float __nexttowardf(float x, long double y)
if((long double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
float u;
- SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
+ SET_FLOAT_WORD(x,(uint32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
diff --git a/sysdeps/ieee754/ldbl-128/s_nextupl.c b/sysdeps/ieee754/ldbl-128/s_nextupl.c
new file mode 100644
index 0000000000..20827e6d09
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_nextupl.c
@@ -0,0 +1,58 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.h>
+
+/* Return the least floating-point number greater than X. */
+_Float128
+__nextupl (_Float128 x)
+{
+ int64_t hx, ix;
+ uint64_t lx;
+
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ ix = hx & 0x7fffffffffffffffLL;
+
+ /* x is nan. */
+ if (((ix >= 0x7fff000000000000LL)
+ && ((ix - 0x7fff000000000000LL) | lx) != 0))
+ return x + x;
+ if ((ix | lx) == 0)
+ return LDBL_TRUE_MIN;
+ if (hx >= 0)
+ { /* x > 0. */
+ if (isinf (x))
+ return x;
+ lx++;
+ if (lx == 0)
+ hx++;
+ }
+ else
+ { /* x < 0. */
+ if (lx == 0)
+ hx--;
+ lx--;
+ }
+ SET_LDOUBLE_WORDS64 (x, hx, lx);
+ return x;
+}
+
+libm_alias_ldouble (__nextup, nextup)
diff --git a/sysdeps/ieee754/ldbl-128/s_remquol.c b/sysdeps/ieee754/ldbl-128/s_remquol.c
index 7356f5f4ef..2fcea6ecdf 100644
--- a/sysdeps/ieee754/ldbl-128/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-128/s_remquol.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -21,16 +21,17 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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;
+ uint64_t sx,lx,ly,qs;
int cquo;
GET_LDOUBLE_WORDS64 (hx, lx, x);
@@ -87,7 +88,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,10 +104,10 @@ __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;
}
-weak_alias (__remquol, remquol)
+libm_alias_ldouble (__remquo, remquo)
diff --git a/sysdeps/ieee754/ldbl-128/s_rintl.c b/sysdeps/ieee754/ldbl-128/s_rintl.c
index ae2142b2c9..9e6637a225 100644
--- a/sysdeps/ieee754/ldbl-128/s_rintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_rintl.c
@@ -29,20 +29,21 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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;
+ uint64_t i1 __attribute__ ((unused));
+ _Float128 w,t;
GET_LDOUBLE_WORDS64(i0,i1,x);
- sx = (((u_int64_t)i0)>>63);
+ sx = (((uint64_t)i0)>>63);
j0 = ((i0>>48)&0x7fff)-0x3fff;
if(j0<112) {
if(j0<0) {
@@ -59,4 +60,4 @@ long double __rintl(long double x)
w = TWO112[sx]+x;
return w-TWO112[sx];
}
-weak_alias (__rintl, rintl)
+libm_alias_ldouble (__rint, rint)
diff --git a/sysdeps/ieee754/ldbl-128/s_roundevenl.c b/sysdeps/ieee754/ldbl-128/s_roundevenl.c
new file mode 100644
index 0000000000..5fc59af4ee
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_roundevenl.c
@@ -0,0 +1,104 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.h>
+#include <stdint.h>
+
+#define BIAS 0x3fff
+#define MANT_DIG 113
+#define MAX_EXP (2 * BIAS + 1)
+
+_Float128
+__roundevenl (_Float128 x)
+{
+ uint64_t hx, lx, uhx;
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ uhx = hx & 0x7fffffffffffffffULL;
+ int exponent = uhx >> (MANT_DIG - 1 - 64);
+ if (exponent >= BIAS + MANT_DIG - 1)
+ {
+ /* Integer, infinity or NaN. */
+ if (exponent == MAX_EXP)
+ /* Infinity or NaN; quiet signaling NaNs. */
+ return x + x;
+ else
+ return x;
+ }
+ else if (exponent >= BIAS + MANT_DIG - 64)
+ {
+ /* Not necessarily an integer; integer bit is in low word.
+ Locate the bits with exponents 0 and -1. */
+ int int_pos = (BIAS + MANT_DIG - 1) - exponent;
+ int half_pos = int_pos - 1;
+ uint64_t half_bit = 1ULL << half_pos;
+ uint64_t int_bit = 1ULL << int_pos;
+ if ((lx & (int_bit | (half_bit - 1))) != 0)
+ {
+ /* Carry into the exponent works correctly. No need to test
+ whether HALF_BIT is set. */
+ lx += half_bit;
+ hx += lx < half_bit;
+ }
+ lx &= ~(int_bit - 1);
+ }
+ else if (exponent == BIAS + MANT_DIG - 65)
+ {
+ /* Not necessarily an integer; integer bit is bottom of high
+ word, half bit is top of low word. */
+ if (((hx & 1) | (lx & 0x7fffffffffffffffULL)) != 0)
+ {
+ lx += 0x8000000000000000ULL;
+ hx += lx < 0x8000000000000000ULL;
+ }
+ lx = 0;
+ }
+ else if (exponent >= BIAS)
+ {
+ /* At least 1; not necessarily an integer, integer bit and half
+ bit are in the high word. Locate the bits with exponents 0
+ and -1 (when the unbiased exponent is 0, the bit with
+ exponent 0 is implicit, but as the bias is odd it is OK to
+ take it from the low bit of the exponent). */
+ int int_pos = (BIAS + MANT_DIG - 65) - exponent;
+ int half_pos = int_pos - 1;
+ uint64_t half_bit = 1ULL << half_pos;
+ uint64_t int_bit = 1ULL << int_pos;
+ if (((hx & (int_bit | (half_bit - 1))) | lx) != 0)
+ hx += half_bit;
+ hx &= ~(int_bit - 1);
+ lx = 0;
+ }
+ else if (exponent == BIAS - 1 && (uhx > 0x3ffe000000000000ULL || lx != 0))
+ {
+ /* Interval (0.5, 1). */
+ hx = (hx & 0x8000000000000000ULL) | 0x3fff000000000000ULL;
+ lx = 0;
+ }
+ else
+ {
+ /* Rounds to 0. */
+ hx &= 0x8000000000000000ULL;
+ lx = 0;
+ }
+ SET_LDOUBLE_WORDS64 (x, hx, lx);
+ return x;
+}
+libm_alias_ldouble (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/ldbl-128/s_roundl.c b/sysdeps/ieee754/ldbl-128/s_roundl.c
index 98b448e4f3..22789cedf3 100644
--- a/sysdeps/ieee754/ldbl-128/s_roundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_roundl.c
@@ -1,5 +1,5 @@
/* Round long double to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -21,16 +21,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double huge = 1.0E4930L;
-
-
-long double
-__roundl (long double x)
+_Float128
+__roundl (_Float128 x)
{
int32_t j0;
- u_int64_t i1, i0;
+ uint64_t i1, i0;
GET_LDOUBLE_WORDS64 (i0, i1, x);
j0 = ((i0 >> 48) & 0x7fff) - 0x3fff;
@@ -38,27 +36,21 @@ __roundl (long double x)
{
if (j0 < 0)
{
- if (huge + x > 0.0)
- {
- i0 &= 0x8000000000000000ULL;
- if (j0 == -1)
- i0 |= 0x3fff000000000000LL;
- i1 = 0;
- }
+ i0 &= 0x8000000000000000ULL;
+ if (j0 == -1)
+ i0 |= 0x3fff000000000000LL;
+ i1 = 0;
}
else
{
- u_int64_t i = 0x0000ffffffffffffLL >> j0;
+ uint64_t i = 0x0000ffffffffffffLL >> j0;
if (((i0 & i) | i1) == 0)
/* X is integral. */
return x;
- if (huge + x > 0.0)
- {
- /* Raise inexact if x != 0. */
- i0 += 0x0000800000000000LL >> j0;
- i0 &= ~i;
- i1 = 0;
- }
+
+ i0 += 0x0000800000000000LL >> j0;
+ i0 &= ~i;
+ i1 = 0;
}
}
else if (j0 > 111)
@@ -71,23 +63,19 @@ __roundl (long double x)
}
else
{
- u_int64_t i = -1ULL >> (j0 - 48);
+ uint64_t i = -1ULL >> (j0 - 48);
if ((i1 & i) == 0)
/* X is integral. */
return x;
- if (huge + x > 0.0)
- {
- /* Raise inexact if x != 0. */
- u_int64_t j = i1 + (1LL << (111 - j0));
- if (j < i1)
- i0 += 1;
- i1 = j;
- }
+ uint64_t j = i1 + (1LL << (111 - j0));
+ if (j < i1)
+ i0 += 1;
+ i1 = j;
i1 &= ~i;
}
SET_LDOUBLE_WORDS64 (x, i0, i1);
return x;
}
-weak_alias (__roundl, roundl)
+libm_alias_ldouble (__round, round)
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_setpayloadl.c b/sysdeps/ieee754/ldbl-128/s_setpayloadl.c
new file mode 100644
index 0000000000..9f43c259ec
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_setpayloadl.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayloadl
+#include <s_setpayloadl_main.c>
+libm_alias_ldouble (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c b/sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c
new file mode 100644
index 0000000000..bb3fc8d9fb
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c
@@ -0,0 +1,70 @@
+/* Set NaN payload. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3fff
+#define PAYLOAD_DIG 111
+#define EXPLICIT_MANT_DIG 112
+
+int
+FUNC (_Float128 *x, _Float128 payload)
+{
+ uint64_t hx, lx;
+ GET_LDOUBLE_WORDS64 (hx, lx, payload);
+ int exponent = hx >> (EXPLICIT_MANT_DIG - 64);
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. */
+ if (exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && hx == 0 && lx == 0)))
+ {
+ SET_LDOUBLE_WORDS64 (*x, 0, 0);
+ return 1;
+ }
+ int shift = BIAS + EXPLICIT_MANT_DIG - exponent;
+ if (shift < 64
+ ? (lx & ((1ULL << shift) - 1)) != 0
+ : (lx != 0 || (hx & ((1ULL << (shift - 64)) - 1)) != 0))
+ {
+ SET_LDOUBLE_WORDS64 (*x, 0, 0);
+ return 1;
+ }
+ if (exponent != 0)
+ {
+ hx &= (1ULL << (EXPLICIT_MANT_DIG - 64)) - 1;
+ hx |= 1ULL << (EXPLICIT_MANT_DIG - 64);
+ if (shift >= 64)
+ {
+ lx = hx >> (shift - 64);
+ hx = 0;
+ }
+ else if (shift != 0)
+ {
+ lx = (lx >> shift) | (hx << (64 - shift));
+ hx >>= shift;
+ }
+ }
+ hx |= 0x7fff000000000000ULL | (SET_HIGH_BIT ? 0x800000000000ULL : 0);
+ SET_LDOUBLE_WORDS64 (*x, hx, lx);
+ return 0;
+}
diff --git a/sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c b/sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c
new file mode 100644
index 0000000000..cd82f295aa
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsigl
+#include <s_setpayloadl_main.c>
+libm_alias_ldouble (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/ldbl-128/s_signbitl.c b/sysdeps/ieee754/ldbl-128/s_signbitl.c
index ee5d77e27a..1aa93f709d 100644
--- a/sysdeps/ieee754/ldbl-128/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-128/s_signbitl.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -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..dfcb0be301 100644
--- a/sysdeps/ieee754/ldbl-128/s_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sincosl.c
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>.
@@ -22,9 +22,10 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
void
-__sincosl (long double x, long double *sinx, long double *cosx)
+__sincosl (_Float128 x, _Float128 *sinx, _Float128 *cosx)
{
int64_t ix;
@@ -34,7 +35,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 +46,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);
@@ -70,4 +71,4 @@ __sincosl (long double x, long double *sinx, long double *cosx)
}
}
}
-weak_alias (__sincosl, sincosl)
+libm_alias_ldouble (__sincos, sincos)
diff --git a/sysdeps/ieee754/ldbl-128/s_sinl.c b/sysdeps/ieee754/ldbl-128/s_sinl.c
index 582a53fd7a..773b2fa7ee 100644
--- a/sysdeps/ieee754/ldbl-128/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sinl.c
@@ -47,10 +47,11 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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. */
@@ -83,4 +84,4 @@ long double __sinl(long double x)
}
}
}
-weak_alias (__sinl, sinl)
+libm_alias_ldouble (__sin, sin)
diff --git a/sysdeps/ieee754/ldbl-128/s_tanhl.c b/sysdeps/ieee754/ldbl-128/s_tanhl.c
index f7a1d20f79..fc309dab0a 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanhl.c
@@ -44,14 +44,16 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.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;
- u_int32_t jx, ix;
+ _Float128 t, z;
+ uint32_t jx, ix;
ieee854_long_double_shape_type u;
/* Words of |x|. */
@@ -97,4 +99,4 @@ __tanhl (long double x)
}
return (jx & 0x80000000) ? -z : z;
}
-weak_alias (__tanhl, tanhl)
+libm_alias_ldouble (__tanh, tanh)
diff --git a/sysdeps/ieee754/ldbl-128/s_tanl.c b/sysdeps/ieee754/ldbl-128/s_tanl.c
index c7d637402b..77db10f077 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanl.c
@@ -47,10 +47,11 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.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. */
@@ -77,4 +78,4 @@ long double __tanl(long double x)
-1 -- n odd */
}
}
-weak_alias (__tanl, tanl)
+libm_alias_ldouble (__tan, tan)
diff --git a/sysdeps/ieee754/ldbl-128/s_totalorderl.c b/sysdeps/ieee754/ldbl-128/s_totalorderl.c
new file mode 100644
index 0000000000..080c9597b9
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_totalorderl.c
@@ -0,0 +1,56 @@
+/* Total order operation. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.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);
+}
+libm_alias_ldouble (__totalorder, totalorder)
diff --git a/sysdeps/ieee754/ldbl-128/s_totalordermagl.c b/sysdeps/ieee754/ldbl-128/s_totalordermagl.c
new file mode 100644
index 0000000000..642c48e8f5
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_totalordermagl.c
@@ -0,0 +1,50 @@
+/* Total order operation on absolute values. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.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);
+}
+libm_alias_ldouble (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/ldbl-128/s_truncl.c b/sysdeps/ieee754/ldbl-128/s_truncl.c
index c71f0aba92..f858ede3d2 100644
--- a/sysdeps/ieee754/ldbl-128/s_truncl.c
+++ b/sysdeps/ieee754/ldbl-128/s_truncl.c
@@ -1,5 +1,5 @@
/* Truncate argument to nearest integral value not larger than the argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -21,13 +21,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double
-__truncl (long double x)
+_Float128
+__truncl (_Float128 x)
{
int32_t j0;
- u_int64_t i0, i1, sx;
+ uint64_t i0, i1, sx;
GET_LDOUBLE_WORDS64 (i0, i1, x);
sx = i0 & 0x8000000000000000ULL;
@@ -53,4 +54,4 @@ __truncl (long double x)
return x;
}
-weak_alias (__truncl, truncl)
+libm_alias_ldouble (__trunc, trunc)
diff --git a/sysdeps/ieee754/ldbl-128/s_ufromfpl.c b/sysdeps/ieee754/ldbl-128/s_ufromfpl.c
new file mode 100644
index 0000000000..22935e6ef7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_ufromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/ldbl-128/s_ufromfpxl.c b/sysdeps/ieee754/ldbl-128/s_ufromfpxl.c
new file mode 100644
index 0000000000..77a5423de8
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_ufromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h
deleted file mode 100644
index aed8953421..0000000000
--- a/sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Convert string for NaN payload to corresponding NaN. For ldbl-128.
- 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/>. */
-
-#define FLOAT long double
-#define SET_MANTISSA(flt, mant) \
- do \
- { \
- union ieee854_long_double u; \
- u.d = (flt); \
- u.ieee_nan.mantissa0 = 0; \
- u.ieee_nan.mantissa1 = 0; \
- u.ieee_nan.mantissa2 = (mant) >> 32; \
- u.ieee_nan.mantissa3 = (mant); \
- if ((u.ieee.mantissa0 | u.ieee.mantissa1 \
- | u.ieee.mantissa2 | u.ieee.mantissa3) != 0) \
- (flt) = u.d; \
- } \
- while (0)
diff --git a/sysdeps/ieee754/ldbl-128/strtold_l.c b/sysdeps/ieee754/ldbl-128/strtold_l.c
index 12ccd93ee5..4b72ae1e33 100644
--- a/sysdeps/ieee754/ldbl-128/strtold_l.c
+++ b/sysdeps/ieee754/ldbl-128/strtold_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,4 +34,34 @@
#define MPN2FLOAT __mpn_construct_long_double
#define FLOAT_HUGE_VAL HUGE_VALL
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# define strtof128_l __hide_strtof128_l
+# define wcstof128_l __hide_wcstof128_l
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
#include <strtod_l.c>
+
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# undef strtof128_l
+# undef wcstof128_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstold_l, wcstof128_l)
+# else
+weak_alias (strtold_l, strtof128_l)
+# endif
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstold_l, wcstof64x_l)
+# else
+weak_alias (strtold_l, strtof64x_l)
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-128/t_expl.h b/sysdeps/ieee754/ldbl-128/t_expl.h
index a23d3d9344..b386fc1f54 100644
--- a/sysdeps/ieee754/ldbl-128/t_expl.h
+++ b/sysdeps/ieee754/ldbl-128/t_expl.h
@@ -1,5 +1,5 @@
/* Accurate table for expl().
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -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..7d65c5fcb0 100644
--- a/sysdeps/ieee754/ldbl-128/t_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/t_sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine and cosine tables.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -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/w_expl.c b/sysdeps/ieee754/ldbl-128/w_expl.c
deleted file mode 100644
index c32616e504..0000000000
--- a/sysdeps/ieee754/ldbl-128/w_expl.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* w_expl.c -- long double version of w_exp.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
-
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
-/*
- * wrapper expl(x)
- */
-
-#include <math.h>
-#include <math_private.h>
-
-long double __expl(long double x) /* wrapper exp */
-{
-#ifdef _IEEE_LIBM
- return __ieee754_expl(x);
-#else
- long double z = __ieee754_expl (x);
- if (__glibc_unlikely (!isfinite (z) || z == 0)
- && isfinite (x) && _LIB_VERSION != _IEEE_)
- return __kernel_standard_l (x, x, 206 + !!signbit (x));
-
- return z;
-#endif
-}
-hidden_def (__expl)
-weak_alias (__expl, expl)
diff --git a/sysdeps/ieee754/ldbl-128/x2y2m1l.c b/sysdeps/ieee754/ldbl-128/x2y2m1l.c
index 733742da04..390163fbc4 100644
--- a/sysdeps/ieee754/ldbl-128/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-128/x2y2m1l.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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-compat/Makefile b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile
new file mode 100644
index 0000000000..412beb5b5c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile
@@ -0,0 +1,22 @@
+ifeq ($(subdir),stdio-common)
+routines += ieee128-printf_size
+
+tests-internal += test-printf-size-ieee128 test-printf-size-ibm128
+CFLAGS-test-printf-size-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
+CFLAGS-test-printf-size-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
+
+ifeq ($(run-built-tests),yes)
+tests-special += $(objpfx)test-printf-size-ieee128.out
+tests-special += $(objpfx)test-printf-size-ibm128.out
+endif
+
+$(objpfx)test-printf-size-ieee128.out: \
+ tst-printfsz-islongdouble.sh $(objpfx)test-printf-size-ieee128
+ $(SHELL) $^ '$(test-program-prefix)' $@; \
+ $(evaluate-test)
+
+$(objpfx)test-printf-size-ibm128.out: \
+ tst-printfsz-islongdouble.sh $(objpfx)test-printf-size-ibm128
+ $(SHELL) $^ '$(test-program-prefix)' $@; \
+ $(evaluate-test)
+endif
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions
new file mode 100644
index 0000000000..4aa34dbe59
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions
@@ -0,0 +1,123 @@
+%include <ldbl-128ibm-compat-abi.h>
+%ifndef LDBL_IBM128_VERSION
+% error "ldbl-128ibm-compat-abi.h must define LDBL_IBM128_VERSION"
+%endif
+
+libm {
+ LDBL_IBM128_VERSION {
+ __acoshieee128;
+ __acosieee128;
+ __asinhieee128;
+ __asinieee128;
+ __atan2ieee128;
+ __atanhieee128;
+ __atanieee128;
+ __cabsieee128;
+ __cacoshieee128;
+ __cacosieee128;
+ __canonicalizeieee128;
+ __cargieee128;
+ __casinhieee128;
+ __casinieee128;
+ __catanhieee128;
+ __catanieee128;
+ __cbrtieee128;
+ __ccoshieee128;
+ __ccosieee128;
+ __ceilieee128;
+ __cexpieee128;
+ __cimagieee128;
+ __clog10ieee128;
+ __clogieee128;
+ __conjieee128;
+ __copysignieee128;
+ __coshieee128;
+ __cosieee128;
+ __cpowieee128;
+ __cprojieee128;
+ __crealieee128;
+ __csinhieee128;
+ __csinieee128;
+ __csqrtieee128;
+ __ctanhieee128;
+ __ctanieee128;
+ __erfcieee128;
+ __erfieee128;
+ __exp10ieee128;
+ __exp2ieee128;
+ __expieee128;
+ __expm1ieee128;
+ __fabsieee128;
+ __fdimieee128;
+ __floorieee128;
+ __fmaieee128;
+ __fmaxieee128;
+ __fmaxmagieee128;
+ __fminieee128;
+ __fminmagieee128;
+ __fmodieee128;
+ __frexpieee128;
+ __fromfpieee128;
+ __fromfpxieee128;
+ __getpayloadieee128;
+ __hypotieee128;
+ __ilogbieee128;
+ __j0ieee128;
+ __j1ieee128;
+ __jnieee128;
+ __ldexpieee128;
+ __lgammaieee128;
+ __lgammaieee128_r;
+ __llogbieee128;
+ __llrintieee128;
+ __llroundieee128;
+ __log10ieee128;
+ __log1pieee128;
+ __log2ieee128;
+ __logbieee128;
+ __logieee128;
+ __lrintieee128;
+ __lroundieee128;
+ __modfieee128;
+ __nanieee128;
+ __nearbyintieee128;
+ __nextafterieee128;
+ __nextdownieee128;
+ __nextupieee128;
+ __powieee128;
+ __remainderieee128;
+ __remquoieee128;
+ __rintieee128;
+ __roundevenieee128;
+ __roundieee128;
+ __scalblnieee128;
+ __scalbnieee128;
+ __setpayloadieee128;
+ __setpayloadsigieee128;
+ __sincosieee128;
+ __sinhieee128;
+ __sinieee128;
+ __sqrtieee128;
+ __tanhieee128;
+ __tanieee128;
+ __tgammaieee128;
+ __totalorderieee128;
+ __totalordermagieee128;
+ __truncieee128;
+ __ufromfpieee128;
+ __ufromfpxieee128;
+ __y0ieee128;
+ __y1ieee128;
+ __ynieee128;
+ }
+}
+libc {
+ LDBL_IBM128_VERSION {
+ __strfromieee128;
+ __strtoieee128;
+ __strtoieee128_l;
+ __wcstoieee128;
+ __wcstoieee128_l;
+
+ __printf_sizeieee128;
+ }
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf_size.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf_size.c
new file mode 100644
index 0000000000..646f673648
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf_size.c
@@ -0,0 +1,32 @@
+/* Wrapper for printf_size. IEEE128 version.
+ Copyright (C) 2018 Free Software 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 <printf.h>
+
+extern __typeof (printf_size) __printf_size;
+
+int
+___ieee128_printf_size (FILE *fp, const struct printf_info *info,
+ const void *const *args)
+{
+ struct printf_info info_ieee128 = *info;
+
+ info_ieee128.is_binary128 = info->is_long_double;
+ return __printf_size (fp, &info_ieee128, args);
+}
+strong_alias (___ieee128_printf_size, __printf_sizeieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h b/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h
new file mode 100644
index 0000000000..a21dfcaea5
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h
@@ -0,0 +1,64 @@
+/* Define aliases for libm _Float128 functions.
+ Copyright (C) 2018 Free Software 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 _LIBM_ALIAS_FLOAT128_H
+#define _LIBM_ALIAS_FLOAT128_H
+
+#include <bits/floatn.h>
+#include <ldbl-128ibm-compat-abi.h>
+
+/* This macro should be used on all long double functions that are not part of
+ the _Float128 API in order to provide *ieee128 symbols without exposing
+ internal *f128 symbols. */
+#define libm_alias_float128_other_r_ldbl(from, to, r) \
+ strong_alias (from ## f128 ## r, __ ## to ## ieee128 ## r)
+
+/* Define _FloatN / _FloatNx aliases (other than that for _Float128)
+ for a _Float128 libm function that has internal name FROM ## f128
+ ## R and public names TO ## suffix ## R for each suffix of a
+ supported _FloatN / _FloatNx floating-point type with the same
+ format as _Float128. */
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define libm_alias_float128_other_r(from, to, r) \
+ weak_alias (from ## f128 ## r, to ## f64x ## r); \
+ libm_alias_float128_other_r_ldbl(from, to, r)
+#else
+# define libm_alias_float128_other_r(from, to, r) \
+ libm_alias_float128_other_r_ldbl(from, to, r)
+#endif
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_float128_other(from, to) \
+ libm_alias_float128_other_r (from, to, )
+
+/* Define aliases for a _Float128 libm function that has internal name
+ FROM ## f128 ## R and public names TO ## suffix ## R for each
+ suffix of a supported floating-point type with the same format as
+ _Float128. This should only be used for functions where such
+ public names exist for _FloatN types, not for
+ implementation-namespace exported names (where there is one name
+ per format, not per type) or for obsolescent functions not provided
+ for _FloatN types. */
+#define libm_alias_float128_r(from, to, r) \
+ weak_alias (from ## f128 ## r, to ## f128 ## r); \
+ libm_alias_float128_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_float128(from, to) libm_alias_float128_r (from, to, )
+
+#endif
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/strfromf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/strfromf128.c
new file mode 100644
index 0000000000..21eeb94af0
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/strfromf128.c
@@ -0,0 +1,20 @@
+/* Definitions for strfromf128.
+
+ Copyright (C) 2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 "../float128/strfromf128.c"
+weak_alias (strfromf128, __strfromieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/strtof128.c b/sysdeps/ieee754/ldbl-128ibm-compat/strtof128.c
new file mode 100644
index 0000000000..0cbdc2bc27
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/strtof128.c
@@ -0,0 +1,20 @@
+/* Definition of strtof128.
+ Copyright (C) 2018 Free Software 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 "../float128/strtof128.c"
+weak_alias (strtof128, __strtoieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/strtof128_l.c b/sysdeps/ieee754/ldbl-128ibm-compat/strtof128_l.c
new file mode 100644
index 0000000000..1a166cd4b0
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/strtof128_l.c
@@ -0,0 +1,20 @@
+/* Convert string representing a number to a _Float128 value, with locale.
+ Copyright (C) 2018 Free Software 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 "../float128/strtof128_l.c"
+weak_alias (strtof128_l, __strtoieee128_l)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ibm128.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ibm128.c
new file mode 100644
index 0000000000..3280597d13
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ibm128.c
@@ -0,0 +1 @@
+#include <tst-printfsz-islongdouble.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ieee128.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ieee128.c
new file mode 100644
index 0000000000..3280597d13
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ieee128.c
@@ -0,0 +1 @@
+#include <tst-printfsz-islongdouble.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128.c b/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128.c
new file mode 100644
index 0000000000..22bdd56aee
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128.c
@@ -0,0 +1,20 @@
+/* Definition of wcstof128.
+ Copyright (C) 2018 Free Software 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 "../float128/wcstof128.c"
+weak_alias (wcstof128, __wcstoieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128_l.c b/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128_l.c
new file mode 100644
index 0000000000..adac083939
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128_l.c
@@ -0,0 +1,20 @@
+/* Convert string representing a number to a _Float128 value, with locale.
+ Copyright (C) 2018 Free Software 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 "../float128/wcstof128_l.c"
+weak_alias (wcstof128_l, __wcstoieee128_l)
diff --git a/sysdeps/ieee754/ldbl-128ibm/Makefile b/sysdeps/ieee754/ldbl-128ibm/Makefile
index 5591814824..bdba6cc6b5 100644
--- a/sysdeps/ieee754/ldbl-128ibm/Makefile
+++ b/sysdeps/ieee754/ldbl-128ibm/Makefile
@@ -8,3 +8,9 @@ ifeq ($(subdir),stdlib)
tests += tst-strtold-ldbl-128ibm
$(objpfx)tst-strtold-ldbl-128ibm: $(libm)
endif
+
+ifeq ($(subdir),math)
+tests += test-fmodl-ldbl-128ibm test-remainderl-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..60c54cca46
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
@@ -0,0 +1,58 @@
+/* Define iscanonical macro. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software 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__));
+# define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1)
+# define __iscanonical(x) ((void) (__typeof (x)) (x), 1)
+# if __HAVE_DISTINCT_FLOAT128
+# define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1)
+# endif
+
+/* 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. */
+# ifndef __cplusplus
+# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x))
+# else
+/* In C++ mode, __MATH_TG cannot be used, because it relies on
+ __builtin_types_compatible_p, which is a C-only builtin. On the
+ other hand, overloading provides the means to distinguish between
+ the floating-point types. The overloading resolution will match
+ the correct parameter (regardless of type qualifiers (i.e.: const
+ and volatile)). */
+extern "C++" {
+inline int iscanonical (float __val) { return __iscanonicalf (__val); }
+inline int iscanonical (double __val) { return __iscanonical (__val); }
+inline int iscanonical (long double __val) { return __iscanonicall (__val); }
+# if __HAVE_DISTINCT_FLOAT128
+inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); }
+# endif
+}
+# endif /* __cplusplus */
+#endif /* __NO_LONG_DOUBLE_MATH */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
index cab1da9995..f85fe678ba 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
@@ -53,10 +53,10 @@ __ieee754_acoshl(long double x)
return 0.0; /* acosh(1) = 0 */
} else if (hx > 0x4000000000000000LL) { /* 2**56 > x > 2 */
t=x*x;
- return __ieee754_logl(2.0*x-one/(x+__ieee754_sqrtl(t-one)));
+ return __ieee754_logl(2.0*x-one/(x+sqrtl(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pl(t+__ieee754_sqrtl(2.0*t+t*t));
+ return __log1pl(t+sqrtl(2.0*t+t*t));
}
}
strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acosl.c b/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
index 5974ee1338..1f8e405c9b 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
@@ -51,7 +51,7 @@
* if x is NaN, return x itself;
* if |x|>1, return NaN with invalid signal.
*
- * Functions needed: __ieee754_sqrtl.
+ * Functions needed: sqrtl.
*/
#include <math.h>
@@ -268,7 +268,7 @@ __ieee754_acosl (long double x)
double shi, slo;
z = (one - a) * 0.5;
- s = __ieee754_sqrtl (z);
+ s = sqrtl (z);
/* Compute an extended precision square root from
the Newton iteration s -> 0.5 * (s + z / s).
The change w from s to the improved value is
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_asinl.c b/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
index 6ed5e8d68d..e8b0221a92 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
@@ -61,8 +61,9 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
-long double sqrtl (long double);
+#include <math-underflow.h>
static const long double
one = 1.0L,
@@ -226,7 +227,7 @@ __ieee754_asinl (long double x)
return x + x * w;
}
- s = __ieee754_sqrtl (t);
+ s = sqrtl (t);
if (a > 0.975L)
{
w = p / q;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c b/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
index b576f42030..25c286b8ff 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
@@ -31,6 +31,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double one = 1.0L, huge = 1e300L;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c b/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c
index 5699b8e53d..b4c17856b2 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_expl.c b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
index ca3cbb53af..16d4205465 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_expl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point e^x.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
Partly based on double-precision code
@@ -65,7 +65,9 @@
#include <fenv.h>
#include <inttypes.h>
#include <math_private.h>
-#include <sysdeps/ieee754/ldbl-128/t_expl.h>
+
+
+#include "t_expl.h"
static const long double C[] = {
/* Smallest integer x for which e^x overflows. */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c b/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
index 205097d38f..fae7dbe888 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
@@ -55,6 +55,13 @@ __ieee754_fmodl (long double x, long double y)
return x;
/* At this point the absolute value of the high doubles of
x and y must be equal. */
+ if ((lx & 0x7fffffffffffffffLL) == 0
+ && (ly & 0x7fffffffffffffffLL) == 0)
+ /* Both low parts are zero. The result should be an
+ appropriately signed zero, but the subsequent logic
+ could treat them as unequal, depending on the signs
+ of the low parts. */
+ return Zero[(uint64_t) sx >> 63];
/* If the low double of y is the same sign as the high
double of y (ie. the low double increases |y|)... */
if (((ly ^ sy) & 0x8000000000000000LL) == 0
@@ -112,7 +119,7 @@ __ieee754_fmodl (long double x, long double y)
if(hz<0){hx = hx+hx+(lx>>63); lx = lx+lx;}
else {
if((hz|lz)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ return Zero[(uint64_t)sx>>63];
hx = hz+hz+(lz>>63); lx = lz+lz;
}
}
@@ -121,7 +128,7 @@ __ieee754_fmodl (long double x, long double y)
/* convert back to floating value and restore the sign */
if((hx|lx)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ return Zero[(uint64_t)sx>>63];
while(hx<0x0001000000000000LL) { /* normalize x */
hx = hx+hx+(lx>>63); lx = lx+lx;
iy -= 1;
@@ -130,15 +137,11 @@ __ieee754_fmodl (long double x, long double y)
x = ldbl_insert_mantissa((sx>>63), iy, hx, lx);
} else { /* subnormal output */
n = -1022 - iy;
- if(n<=48) {
- lx = (lx>>n)|((u_int64_t)hx<<(64-n));
- hx >>= n;
- } else if (n<=63) {
- lx = (hx<<(64-n))|(lx>>n); hx = sx;
- } else {
- lx = hx>>(n-64); hx = sx;
- }
- x = ldbl_insert_mantissa((sx>>63), iy, hx, lx);
+ /* We know 1 <= N <= 52, and that there are no nonzero
+ bits in places below 2^-1074. */
+ lx = (lx >> n) | ((uint64_t) hx << (64 - n));
+ hx >>= n;
+ x = ldbl_insert_mantissa((sx>>63), -1023, hx, lx);
x *= one; /* create necessary signal */
}
return x; /* exact output */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
index 8dbb131f93..84ea7ee0f5 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz, 1999.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
@@ -106,7 +107,7 @@ gammal_positive (long double x, int *exp2_adj)
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)
+ * sqrtl (2 * M_PIl / x_adj)
/ prod);
exp_adj += x_eps * __ieee754_logl (x_adj);
long double bsum = gamma_coeff[NCOEFF - 1];
@@ -134,7 +135,7 @@ __ieee754_gammal_r (long double x, int *signgamp)
*signgamp = 0;
return 1.0 / x;
}
- if (hx < 0 && (u_int64_t) hx < 0xfff0000000000000ULL && __rintl (x) == x)
+ if (hx < 0 && (uint64_t) hx < 0xfff0000000000000ULL && __rintl (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
index c68dac03b0..842f77b7ed 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
@@ -44,6 +44,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
long double
__ieee754_hypotl(long double x, long double y)
@@ -67,6 +68,8 @@ __ieee754_hypotl(long double x, long double y)
if(ha > 0x5f30000000000000LL) { /* a>2**500 */
if(ha >= 0x7ff0000000000000LL) { /* Inf or NaN */
w = a+b; /* for sNaN */
+ if (issignaling (a) || issignaling (b))
+ return w;
if(ha == 0x7ff0000000000000LL)
w = a;
if(hb == 0x7ff0000000000000LL)
@@ -105,7 +108,7 @@ __ieee754_hypotl(long double x, long double y)
= a1*(a1+a2) + a2*a + b*b
= a1*a1 + a1*a2 + a2*a + b*b
= a1*a1 + a2*(a+a1) + b*b */
- w = __ieee754_sqrtl(a1*a1-(b*(-b)-a2*(a+a1)));
+ w = sqrtl(a1*a1-(b*(-b)-a2*(a+a1)));
} else {
a = a+a;
ldbl_unpack (b, &hi, &lo);
@@ -122,7 +125,7 @@ __ieee754_hypotl(long double x, long double y)
= w*w + a1*b + a2*b
= w*w + a1*(b1+b2) + a2*b
= w*w + a1*b1 + a1*b2 + a2*b */
- w = __ieee754_sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b)));
+ w = sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b)));
}
if(k!=0)
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
index 39a238aa9b..448cfb63fe 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
@@ -1,3 +1,864 @@
-/* Looks like we can use ieee854 e_j0l.c as is for IBM extended format. */
-#include <sysdeps/ieee754/ldbl-128/e_j0l.c>
+/* Bessel function of order zero. IBM Extended Precision version.
+ Copyright 2001 by Stephen L. Moshier (moshier@na-net.ornl.gov).
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c. */
+
+
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+/* 1 / sqrt(pi) */
+static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+/* 2 / pi */
+static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
+static const long double 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+ };
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0*/
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ 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,
+};
+#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,
+ /* 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)
+{
+ long double y;
+
+ p += n;
+ y = *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* 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)
+{
+ long double y;
+
+ p += n;
+ y = x + *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Bessel function of the first kind, order zero. */
+
+long double
+__ieee754_j0l (long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ {
+ if (x != x)
+ return x + x;
+ else
+ return 0;
+ }
+ if (x == 0)
+ return 1;
+
+ xx = fabsl (x);
+ if (xx <= 2)
+ {
+ if (xx < 0x1p-57L)
+ 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;
+ return p;
+ }
+
+ /* X = x - pi/4
+ cos(X) = cos(x) cos(pi/4) + sin(x) sin(pi/4)
+ = 1/sqrt(2) * (cos(x) + sin(x))
+ sin(X) = sin(x) cos(pi/4) - cos(x) sin(pi/4)
+ = 1/sqrt(2) * (sin(x) - cos(x))
+ sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+ cf. Fdlibm. */
+ __sincosl (xx, &s, &c);
+ ss = s - c;
+ cc = s + c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = -__cosl (xx + xx);
+ if ((s * c) < 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ return ONEOSQPI * cc / sqrtl (xx);
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * xinv * q;
+ q = q - 0.125L * xinv;
+ z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
+ return z;
+}
+strong_alias (__ieee754_j0l, __j0l_finite)
+
+
+/* Y0(x) = 2/pi * log(x) * J0(x) + R(x^2)
+ Peak absolute error 1.7e-36 (relative where Y0 > 1)
+ 0 <= x <= 2 */
+#define NY0_2N 7
+static const long double Y0_2N[NY0_2N + 1] = {
+ -1.062023609591350692692296993537002558155E19L,
+ 2.542000883190248639104127452714966858866E19L,
+ -1.984190771278515324281415820316054696545E18L,
+ 4.982586044371592942465373274440222033891E16L,
+ -5.529326354780295177243773419090123407550E14L,
+ 3.013431465522152289279088265336861140391E12L,
+ -7.959436160727126750732203098982718347785E9L,
+ 8.230845651379566339707130644134372793322E6L,
+};
+#define NY0_2D 7
+static const long double Y0_2D[NY0_2D + 1] = {
+ 1.438972634353286978700329883122253752192E20L,
+ 1.856409101981569254247700169486907405500E18L,
+ 1.219693352678218589553725579802986255614E16L,
+ 5.389428943282838648918475915779958097958E13L,
+ 1.774125762108874864433872173544743051653E11L,
+ 4.522104832545149534808218252434693007036E8L,
+ 8.872187401232943927082914504125234454930E5L,
+ 1.251945613186787532055610876304669413955E3L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+static const long double U0 = -7.3804295108687225274343927948483016310862e-02L;
+
+/* Bessel function of the second kind, order zero. */
+
+long double
+ __ieee754_y0l(long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ return 1 / (x + x * x);
+ if (x <= 0)
+ {
+ if (x < 0)
+ return (zero / (zero * x));
+ return -1 / zero; /* -inf and divide by zero exception. */
+ }
+ xx = fabsl (x);
+ if (xx <= 0x1p-57)
+ return U0 + TWOOPI * __ieee754_logl (x);
+ if (xx <= 2)
+ {
+ /* 0 <= x <= 2 */
+ z = xx * xx;
+ p = neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+ p = TWOOPI * __ieee754_logl (x) * __ieee754_j0l (x) + p;
+ return p;
+ }
+
+ /* X = x - pi/4
+ cos(X) = cos(x) cos(pi/4) + sin(x) sin(pi/4)
+ = 1/sqrt(2) * (cos(x) + sin(x))
+ sin(X) = sin(x) cos(pi/4) - cos(x) sin(pi/4)
+ = 1/sqrt(2) * (sin(x) - cos(x))
+ sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+ cf. Fdlibm. */
+ __sincosl (x, &s, &c);
+ ss = s - c;
+ cc = s + c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = -__cosl (x + x);
+ if ((s * c) < 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ return ONEOSQPI * ss / sqrtl (x);
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * xinv * q;
+ q = q - 0.125L * xinv;
+ z = ONEOSQPI * (p * ss + q * cc) / sqrtl (x);
+ return z;
+}
+strong_alias (__ieee754_y0l, __y0l_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
index c86e24f7c0..5126900f96 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
@@ -1,2 +1,885 @@
-/* Looks like we can use ieee854 e_j1l.c as is for IBM extended format. */
-#include <sysdeps/ieee754/ldbl-128/e_j1l.c>
+/* Bessel function of order one. IBM Extended Precision version.
+ Copyright 2001 by Stephen L. Moshier (moshier@na-net.onrl.gov).
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c. */
+
+
+#include <errno.h>
+#include <math.h>
+#include <math_private.h>
+#include <math-underflow.h>
+#include <float.h>
+
+/* 1 / sqrt(pi) */
+static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+/* 2 / pi */
+static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
+static const long double 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
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0L */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 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
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+ };
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ 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,
+};
+#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,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ 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,
+};
+#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,
+ /* 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)
+{
+ long double y;
+
+ p += n;
+ y = *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* 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)
+{
+ long double y;
+
+ p += n;
+ y = x + *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Bessel function of the first kind, order one. */
+
+long double
+__ieee754_j1l (long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ {
+ if (x != x)
+ return x + x;
+ else
+ return 0;
+ }
+ if (x == 0)
+ return x;
+ xx = fabsl (x);
+ if (xx <= 0x1p-58L)
+ {
+ long double ret = x * 0.5L;
+ math_check_force_underflow (ret);
+ if (ret == 0)
+ __set_errno (ERANGE);
+ return ret;
+ }
+ 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;
+ if (x < 0)
+ p = -p;
+ return p;
+ }
+
+ /* X = x - 3 pi/4
+ cos(X) = cos(x) cos(3 pi/4) + sin(x) sin(3 pi/4)
+ = 1/sqrt(2) * (-cos(x) + sin(x))
+ sin(X) = sin(x) cos(3 pi/4) - cos(x) sin(3 pi/4)
+ = -1/sqrt(2) * (sin(x) + cos(x))
+ cf. Fdlibm. */
+ __sincosl (xx, &s, &c);
+ ss = -s - c;
+ cc = s - c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = __cosl (xx + xx);
+ if ((s * c) > 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ {
+ z = ONEOSQPI * cc / sqrtl (xx);
+ if (x < 0)
+ z = -z;
+ return z;
+ }
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * q;
+ q = q * xinv + 0.375L * xinv;
+ z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
+ if (x < 0)
+ z = -z;
+ return z;
+}
+strong_alias (__ieee754_j1l, __j1l_finite)
+
+
+/* Y1(x) = 2/pi * (log(x) * J1(x) - 1/x) + x R(x^2)
+ Peak relative error 6.2e-38
+ 0 <= x <= 2 */
+#define NY0_2N 7
+static const long double Y0_2N[NY0_2N + 1] = {
+ -6.804415404830253804408698161694720833249E19L,
+ 1.805450517967019908027153056150465849237E19L,
+ -8.065747497063694098810419456383006737312E17L,
+ 1.401336667383028259295830955439028236299E16L,
+ -1.171654432898137585000399489686629680230E14L,
+ 5.061267920943853732895341125243428129150E11L,
+ -1.096677850566094204586208610960870217970E9L,
+ 9.541172044989995856117187515882879304461E5L,
+};
+#define NY0_2D 7
+static const long double Y0_2D[NY0_2D + 1] = {
+ 3.470629591820267059538637461549677594549E20L,
+ 4.120796439009916326855848107545425217219E18L,
+ 2.477653371652018249749350657387030814542E16L,
+ 9.954678543353888958177169349272167762797E13L,
+ 2.957927997613630118216218290262851197754E11L,
+ 6.748421382188864486018861197614025972118E8L,
+ 1.173453425218010888004562071020305709319E6L,
+ 1.450335662961034949894009554536003377187E3L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+
+/* Bessel function of the second kind, order one. */
+
+long double
+__ieee754_y1l (long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ return 1 / (x + x * x);
+ if (x <= 0)
+ {
+ if (x < 0)
+ return (zero / (zero * x));
+ return -1 / zero; /* -inf and divide by zero exception. */
+ }
+ xx = fabsl (x);
+ if (xx <= 0x1p-114)
+ {
+ z = -TWOOPI / x;
+ if (isinf (z))
+ __set_errno (ERANGE);
+ return z;
+ }
+ if (xx <= 2)
+ {
+ /* 0 <= x <= 2 */
+ SET_RESTORE_ROUNDL (FE_TONEAREST);
+ z = xx * xx;
+ p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+ p = -TWOOPI / xx + p;
+ p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
+ return p;
+ }
+
+ /* X = x - 3 pi/4
+ cos(X) = cos(x) cos(3 pi/4) + sin(x) sin(3 pi/4)
+ = 1/sqrt(2) * (-cos(x) + sin(x))
+ sin(X) = sin(x) cos(3 pi/4) - cos(x) sin(3 pi/4)
+ = -1/sqrt(2) * (sin(x) + cos(x))
+ cf. Fdlibm. */
+ __sincosl (xx, &s, &c);
+ ss = -s - c;
+ cc = s - c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = __cosl (xx + xx);
+ if ((s * c) > 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ return ONEOSQPI * ss / sqrtl (xx);
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * q;
+ q = q * xinv + 0.375L * xinv;
+ z = ONEOSQPI * (p * ss + q * cc) / sqrtl (xx);
+ return z;
+}
+strong_alias (__ieee754_y1l, __y1l_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
index 4a8ccb044e..71b3addfba 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
@@ -60,6 +60,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double
invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
@@ -149,7 +150,7 @@ __ieee754_jnl (int n, long double x)
temp = c - s;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
@@ -385,7 +386,7 @@ __ieee754_ynl (int n, long double x)
temp = s + c;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
index 9bcaaf765a..5b628bedc1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
@@ -1,3 +1,992 @@
-/* Looks like we can use ieee854 e_lgammal_r.c as is for IBM extended format. */
-#include <sysdeps/ieee754/ldbl-128/e_lgammal_r.c>
+/* Natural logarithm of gamma function. IBM Extended Precision version.
+ Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov>
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_lgammal_r.c. */
+
+
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+static const long double PIL = 3.1415926535897932384626433832795028841972E0L;
+static const long double MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L;
+static const long double one = 1;
+static const long double 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;
+#define NRASY 12
+static const long double 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
+};
+
+
+/* log gamma(x+13) = log gamma(13) + x P(x)/Q(x)
+ -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;
+#define NRN13 7
+static const long double RN13[NRN13 + 1] =
+{
+ 8.591478354823578150238226576156275285700E11L,
+ 2.347931159756482741018258864137297157668E11L,
+ 2.555408396679352028680662433943000804616E10L,
+ 1.408581709264464345480765758902967123937E9L,
+ 4.126759849752613822953004114044451046321E7L,
+ 6.133298899622688505854211579222889943778E5L,
+ 3.929248056293651597987893340755876578072E3L,
+ 6.850783280018706668924952057996075215223E0L
+};
+#define NRD13 6
+static const long double RD13[NRD13 + 1] =
+{
+ 3.401225382297342302296607039352935541669E11L,
+ 8.756765276918037910363513243563234551784E10L,
+ 8.873913342866613213078554180987647243903E9L,
+ 4.483797255342763263361893016049310017973E8L,
+ 1.178186288833066430952276702931512870676E7L,
+ 1.519928623743264797939103740132278337476E5L,
+ 7.989298844938119228411117593338850892311E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+12) = log gamma(12) + x P(x)/Q(x)
+ -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;
+#define NRN12 7
+static const long double RN12[NRN12 + 1] =
+{
+ 4.709859662695606986110997348630997559137E11L,
+ 1.398713878079497115037857470168777995230E11L,
+ 1.654654931821564315970930093932954900867E10L,
+ 9.916279414876676861193649489207282144036E8L,
+ 3.159604070526036074112008954113411389879E7L,
+ 5.109099197547205212294747623977502492861E5L,
+ 3.563054878276102790183396740969279826988E3L,
+ 6.769610657004672719224614163196946862747E0L
+};
+#define NRD12 6
+static const long double RD12[NRD12 + 1] =
+{
+ 1.928167007860968063912467318985802726613E11L,
+ 5.383198282277806237247492369072266389233E10L,
+ 5.915693215338294477444809323037871058363E9L,
+ 3.241438287570196713148310560147925781342E8L,
+ 9.236680081763754597872713592701048455890E6L,
+ 1.292246897881650919242713651166596478850E5L,
+ 7.366532445427159272584194816076600211171E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+11) = log gamma(11) + x P(x)/Q(x)
+ -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;
+#define NRN11 7
+static const long double RN11[NRN11 + 1] =
+{
+ 2.446960438029415837384622675816736622795E11L,
+ 7.955444974446413315803799763901729640350E10L,
+ 1.030555327949159293591618473447420338444E10L,
+ 6.765022131195302709153994345470493334946E8L,
+ 2.361892792609204855279723576041468347494E7L,
+ 4.186623629779479136428005806072176490125E5L,
+ 3.202506022088912768601325534149383594049E3L,
+ 6.681356101133728289358838690666225691363E0L
+};
+#define NRD11 6
+static const long double RD11[NRD11 + 1] =
+{
+ 1.040483786179428590683912396379079477432E11L,
+ 3.172251138489229497223696648369823779729E10L,
+ 3.806961885984850433709295832245848084614E9L,
+ 2.278070344022934913730015420611609620171E8L,
+ 7.089478198662651683977290023829391596481E6L,
+ 1.083246385105903533237139380509590158658E5L,
+ 6.744420991491385145885727942219463243597E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+10) = log gamma(10) + x P(x)/Q(x)
+ -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;
+#define NRN10 7
+static const long double RN10[NRN10 + 1] =
+{
+ -1.239059737177249934158597996648808363783E14L,
+ -4.725899566371458992365624673357356908719E13L,
+ -7.283906268647083312042059082837754850808E12L,
+ -5.802855515464011422171165179767478794637E11L,
+ -2.532349691157548788382820303182745897298E10L,
+ -5.884260178023777312587193693477072061820E8L,
+ -6.437774864512125749845840472131829114906E6L,
+ -2.350975266781548931856017239843273049384E4L
+};
+#define NRD10 7
+static const long double RD10[NRD10 + 1] =
+{
+ -5.502645997581822567468347817182347679552E13L,
+ -1.970266640239849804162284805400136473801E13L,
+ -2.819677689615038489384974042561531409392E12L,
+ -2.056105863694742752589691183194061265094E11L,
+ -8.053670086493258693186307810815819662078E9L,
+ -1.632090155573373286153427982504851867131E8L,
+ -1.483575879240631280658077826889223634921E6L,
+ -4.002806669713232271615885826373550502510E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+9) = log gamma(9) + x P(x)/Q(x)
+ -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;
+#define NRN9 7
+static const long double RN9[NRN9 + 1] =
+{
+ -4.936332264202687973364500998984608306189E13L,
+ -2.101372682623700967335206138517766274855E13L,
+ -3.615893404644823888655732817505129444195E12L,
+ -3.217104993800878891194322691860075472926E11L,
+ -1.568465330337375725685439173603032921399E10L,
+ -4.073317518162025744377629219101510217761E8L,
+ -4.983232096406156139324846656819246974500E6L,
+ -2.036280038903695980912289722995505277253E4L
+};
+#define NRD9 7
+static const long double RD9[NRD9 + 1] =
+{
+ -2.306006080437656357167128541231915480393E13L,
+ -9.183606842453274924895648863832233799950E12L,
+ -1.461857965935942962087907301194381010380E12L,
+ -1.185728254682789754150068652663124298303E11L,
+ -5.166285094703468567389566085480783070037E9L,
+ -1.164573656694603024184768200787835094317E8L,
+ -1.177343939483908678474886454113163527909E6L,
+ -3.529391059783109732159524500029157638736E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+8) = log gamma(8) + x P(x)/Q(x)
+ -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;
+#define NRN8 8
+static const long double RN8[NRN8 + 1] =
+{
+ 6.600775438203423546565361176829139703289E11L,
+ 3.406361267593790705240802723914281025800E11L,
+ 7.222460928505293914746983300555538432830E10L,
+ 8.102984106025088123058747466840656458342E9L,
+ 5.157620015986282905232150979772409345927E8L,
+ 1.851445288272645829028129389609068641517E7L,
+ 3.489261702223124354745894067468953756656E5L,
+ 2.892095396706665774434217489775617756014E3L,
+ 6.596977510622195827183948478627058738034E0L
+};
+#define NRD8 7
+static const long double RD8[NRD8 + 1] =
+{
+ 3.274776546520735414638114828622673016920E11L,
+ 1.581811207929065544043963828487733970107E11L,
+ 3.108725655667825188135393076860104546416E10L,
+ 3.193055010502912617128480163681842165730E9L,
+ 1.830871482669835106357529710116211541839E8L,
+ 5.790862854275238129848491555068073485086E6L,
+ 9.305213264307921522842678835618803553589E4L,
+ 6.216974105861848386918949336819572333622E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+7) = log gamma(7) + x P(x)/Q(x)
+ -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;
+#define NRN7 8
+static const long double RN7[NRN7 + 1] =
+{
+ 2.065019306969459407636744543358209942213E11L,
+ 1.226919919023736909889724951708796532847E11L,
+ 2.996157990374348596472241776917953749106E10L,
+ 3.873001919306801037344727168434909521030E9L,
+ 2.841575255593761593270885753992732145094E8L,
+ 1.176342515359431913664715324652399565551E7L,
+ 2.558097039684188723597519300356028511547E5L,
+ 2.448525238332609439023786244782810774702E3L,
+ 6.460280377802030953041566617300902020435E0L
+};
+#define NRD7 7
+static const long double RD7[NRD7 + 1] =
+{
+ 1.102646614598516998880874785339049304483E11L,
+ 6.099297512712715445879759589407189290040E10L,
+ 1.372898136289611312713283201112060238351E10L,
+ 1.615306270420293159907951633566635172343E9L,
+ 1.061114435798489135996614242842561967459E8L,
+ 3.845638971184305248268608902030718674691E6L,
+ 7.081730675423444975703917836972720495507E4L,
+ 5.423122582741398226693137276201344096370E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+6) = log gamma(6) + x P(x)/Q(x)
+ -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;
+#define NRN6 8
+static const long double RN6[NRN6 + 1] =
+{
+ -3.538412754670746879119162116819571823643E13L,
+ -2.613432593406849155765698121483394257148E13L,
+ -8.020670732770461579558867891923784753062E12L,
+ -1.322227822931250045347591780332435433420E12L,
+ -1.262809382777272476572558806855377129513E11L,
+ -7.015006277027660872284922325741197022467E9L,
+ -2.149320689089020841076532186783055727299E8L,
+ -3.167210585700002703820077565539658995316E6L,
+ -1.576834867378554185210279285358586385266E4L
+};
+#define NRD6 8
+static const long double RD6[NRD6 + 1] =
+{
+ -2.073955870771283609792355579558899389085E13L,
+ -1.421592856111673959642750863283919318175E13L,
+ -4.012134994918353924219048850264207074949E12L,
+ -6.013361045800992316498238470888523722431E11L,
+ -5.145382510136622274784240527039643430628E10L,
+ -2.510575820013409711678540476918249524123E9L,
+ -6.564058379709759600836745035871373240904E7L,
+ -7.861511116647120540275354855221373571536E5L,
+ -2.821943442729620524365661338459579270561E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+5) = log gamma(5) + x P(x)/Q(x)
+ -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;
+#define NRN5 9
+static const long double RN5[NRN5 + 1] =
+{
+ 2.010952885441805899580403215533972172098E11L,
+ 1.916132681242540921354921906708215338584E11L,
+ 7.679102403710581712903937970163206882492E10L,
+ 1.680514903671382470108010973615268125169E10L,
+ 2.181011222911537259440775283277711588410E9L,
+ 1.705361119398837808244780667539728356096E8L,
+ 7.792391565652481864976147945997033946360E6L,
+ 1.910741381027985291688667214472560023819E5L,
+ 2.088138241893612679762260077783794329559E3L,
+ 6.330318119566998299106803922739066556550E0L
+};
+#define NRD5 8
+static const long double RD5[NRD5 + 1] =
+{
+ 1.335189758138651840605141370223112376176E11L,
+ 1.174130445739492885895466097516530211283E11L,
+ 4.308006619274572338118732154886328519910E10L,
+ 8.547402888692578655814445003283720677468E9L,
+ 9.934628078575618309542580800421370730906E8L,
+ 6.847107420092173812998096295422311820672E7L,
+ 2.698552646016599923609773122139463150403E6L,
+ 5.526516251532464176412113632726150253215E4L,
+ 4.772343321713697385780533022595450486932E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+4) = log gamma(4) + x P(x)/Q(x)
+ -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;
+#define NRN4 9
+static const long double RN4[NRN4 + 1] =
+{
+ -1.026583408246155508572442242188887829208E13L,
+ -1.306476685384622809290193031208776258809E13L,
+ -7.051088602207062164232806511992978915508E12L,
+ -2.100849457735620004967624442027793656108E12L,
+ -3.767473790774546963588549871673843260569E11L,
+ -4.156387497364909963498394522336575984206E10L,
+ -2.764021460668011732047778992419118757746E9L,
+ -1.036617204107109779944986471142938641399E8L,
+ -1.895730886640349026257780896972598305443E6L,
+ -1.180509051468390914200720003907727988201E4L
+};
+#define NRD4 9
+static const long double RD4[NRD4 + 1] =
+{
+ -8.172669122056002077809119378047536240889E12L,
+ -9.477592426087986751343695251801814226960E12L,
+ -4.629448850139318158743900253637212801682E12L,
+ -1.237965465892012573255370078308035272942E12L,
+ -1.971624313506929845158062177061297598956E11L,
+ -1.905434843346570533229942397763361493610E10L,
+ -1.089409357680461419743730978512856675984E9L,
+ -3.416703082301143192939774401370222822430E7L,
+ -4.981791914177103793218433195857635265295E5L,
+ -2.192507743896742751483055798411231453733E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+3) = log gamma(3) + x P(x)/Q(x)
+ -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;
+
+#define NRN3 9
+static const long double RN3[NRN3 + 1] =
+{
+ -4.813901815114776281494823863935820876670E11L,
+ -8.425592975288250400493910291066881992620E11L,
+ -6.228685507402467503655405482985516909157E11L,
+ -2.531972054436786351403749276956707260499E11L,
+ -6.170200796658926701311867484296426831687E10L,
+ -9.211477458528156048231908798456365081135E9L,
+ -8.251806236175037114064561038908691305583E8L,
+ -4.147886355917831049939930101151160447495E7L,
+ -1.010851868928346082547075956946476932162E6L,
+ -8.333374463411801009783402800801201603736E3L
+};
+#define NRD3 9
+static const long double RD3[NRD3 + 1] =
+{
+ -5.216713843111675050627304523368029262450E11L,
+ -8.014292925418308759369583419234079164391E11L,
+ -5.180106858220030014546267824392678611990E11L,
+ -1.830406975497439003897734969120997840011E11L,
+ -3.845274631904879621945745960119924118925E10L,
+ -4.891033385370523863288908070309417710903E9L,
+ -3.670172254411328640353855768698287474282E8L,
+ -1.505316381525727713026364396635522516989E7L,
+ -2.856327162923716881454613540575964890347E5L,
+ -1.622140448015769906847567212766206894547E3L
+ /* 1.0E0L */
+};
+
+
+/* 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;
+#define NRN2r5 8
+static const long double RN2r5[NRN2r5 + 1] =
+{
+ -4.676454313888335499356699817678862233205E9L,
+ -9.361888347911187924389905984624216340639E9L,
+ -7.695353600835685037920815799526540237703E9L,
+ -3.364370100981509060441853085968900734521E9L,
+ -8.449902011848163568670361316804900559863E8L,
+ -1.225249050950801905108001246436783022179E8L,
+ -9.732972931077110161639900388121650470926E6L,
+ -3.695711763932153505623248207576425983573E5L,
+ -4.717341584067827676530426007495274711306E3L
+};
+#define NRD2r5 8
+static const long double RD2r5[NRD2r5 + 1] =
+{
+ -6.650657966618993679456019224416926875619E9L,
+ -1.099511409330635807899718829033488771623E10L,
+ -7.482546968307837168164311101447116903148E9L,
+ -2.702967190056506495988922973755870557217E9L,
+ -5.570008176482922704972943389590409280950E8L,
+ -6.536934032192792470926310043166993233231E7L,
+ -4.101991193844953082400035444146067511725E6L,
+ -1.174082735875715802334430481065526664020E5L,
+ -9.932840389994157592102947657277692978511E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+2) = x P(x)/Q(x)
+ -0.125 <= x <= +0.375
+ 1.875 <= x+2 <= 2.375
+ Peak relative error 4.6e-36 */
+#define NRN2 9
+static const long double RN2[NRN2 + 1] =
+{
+ -3.716661929737318153526921358113793421524E9L,
+ -1.138816715030710406922819131397532331321E10L,
+ -1.421017419363526524544402598734013569950E10L,
+ -9.510432842542519665483662502132010331451E9L,
+ -3.747528562099410197957514973274474767329E9L,
+ -8.923565763363912474488712255317033616626E8L,
+ -1.261396653700237624185350402781338231697E8L,
+ -9.918402520255661797735331317081425749014E6L,
+ -3.753996255897143855113273724233104768831E5L,
+ -4.778761333044147141559311805999540765612E3L
+};
+#define NRD2 9
+static const long double RD2[NRD2 + 1] =
+{
+ -8.790916836764308497770359421351673950111E9L,
+ -2.023108608053212516399197678553737477486E10L,
+ -1.958067901852022239294231785363504458367E10L,
+ -1.035515043621003101254252481625188704529E10L,
+ -3.253884432621336737640841276619272224476E9L,
+ -6.186383531162456814954947669274235815544E8L,
+ -6.932557847749518463038934953605969951466E7L,
+ -4.240731768287359608773351626528479703758E6L,
+ -1.197343995089189188078944689846348116630E5L,
+ -1.004622911670588064824904487064114090920E3L
+/* 1.0E0 */
+};
+
+
+/* log gamma(x+1.75) = log gamma(1.75) + x P(x)/Q(x)
+ -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;
+#define NRN1r75 8
+static const long double RN1r75[NRN1r75 + 1] =
+{
+ -5.221061693929833937710891646275798251513E7L,
+ -2.052466337474314812817883030472496436993E8L,
+ -2.952718275974940270675670705084125640069E8L,
+ -2.132294039648116684922965964126389017840E8L,
+ -8.554103077186505960591321962207519908489E7L,
+ -1.940250901348870867323943119132071960050E7L,
+ -2.379394147112756860769336400290402208435E6L,
+ -1.384060879999526222029386539622255797389E5L,
+ -2.698453601378319296159355612094598695530E3L
+};
+#define NRD1r75 8
+static const long double RD1r75[NRD1r75 + 1] =
+{
+ -2.109754689501705828789976311354395393605E8L,
+ -5.036651829232895725959911504899241062286E8L,
+ -4.954234699418689764943486770327295098084E8L,
+ -2.589558042412676610775157783898195339410E8L,
+ -7.731476117252958268044969614034776883031E7L,
+ -1.316721702252481296030801191240867486965E7L,
+ -1.201296501404876774861190604303728810836E6L,
+ -5.007966406976106636109459072523610273928E4L,
+ -6.155817990560743422008969155276229018209E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+x0) = y0 + x^2 P(x)/Q(x)
+ -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;
+#define NRN1r5 8
+static const long double RN1r5[NRN1r5 + 1] =
+{
+ 6.827103657233705798067415468881313128066E5L,
+ 1.910041815932269464714909706705242148108E6L,
+ 2.194344176925978377083808566251427771951E6L,
+ 1.332921400100891472195055269688876427962E6L,
+ 4.589080973377307211815655093824787123508E5L,
+ 8.900334161263456942727083580232613796141E4L,
+ 9.053840838306019753209127312097612455236E3L,
+ 4.053367147553353374151852319743594873771E2L,
+ 5.040631576303952022968949605613514584950E0L
+};
+#define NRD1r5 8
+static const long double RD1r5[NRD1r5 + 1] =
+{
+ 1.411036368843183477558773688484699813355E6L,
+ 4.378121767236251950226362443134306184849E6L,
+ 5.682322855631723455425929877581697918168E6L,
+ 3.999065731556977782435009349967042222375E6L,
+ 1.653651390456781293163585493620758410333E6L,
+ 4.067774359067489605179546964969435858311E5L,
+ 5.741463295366557346748361781768833633256E4L,
+ 4.226404539738182992856094681115746692030E3L,
+ 1.316980975410327975566999780608618774469E2L,
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+1.25) = log gamma(1.25) + x P(x)/Q(x)
+ -.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;
+#define NRN1r25 9
+static const long double RN1r25[NRN1r25 + 1] =
+{
+ -9.054787275312026472896002240379580536760E4L,
+ -8.685076892989927640126560802094680794471E4L,
+ 2.797898965448019916967849727279076547109E5L,
+ 6.175520827134342734546868356396008898299E5L,
+ 5.179626599589134831538516906517372619641E5L,
+ 2.253076616239043944538380039205558242161E5L,
+ 5.312653119599957228630544772499197307195E4L,
+ 6.434329437514083776052669599834938898255E3L,
+ 3.385414416983114598582554037612347549220E2L,
+ 4.907821957946273805080625052510832015792E0L
+};
+#define NRD1r25 8
+static const long double RD1r25[NRD1r25 + 1] =
+{
+ 3.980939377333448005389084785896660309000E5L,
+ 1.429634893085231519692365775184490465542E6L,
+ 2.145438946455476062850151428438668234336E6L,
+ 1.743786661358280837020848127465970357893E6L,
+ 8.316364251289743923178092656080441655273E5L,
+ 2.355732939106812496699621491135458324294E5L,
+ 3.822267399625696880571810137601310855419E4L,
+ 3.228463206479133236028576845538387620856E3L,
+ 1.152133170470059555646301189220117965514E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x + 1) = x P(x)/Q(x)
+ 0.0 <= x <= +0.125
+ 1.0 <= x+1 <= 1.125
+ Peak relative error 1.1e-35 */
+#define NRN1 8
+static const long double RN1[NRN1 + 1] =
+{
+ -9.987560186094800756471055681088744738818E3L,
+ -2.506039379419574361949680225279376329742E4L,
+ -1.386770737662176516403363873617457652991E4L,
+ 1.439445846078103202928677244188837130744E4L,
+ 2.159612048879650471489449668295139990693E4L,
+ 1.047439813638144485276023138173676047079E4L,
+ 2.250316398054332592560412486630769139961E3L,
+ 1.958510425467720733041971651126443864041E2L,
+ 4.516830313569454663374271993200291219855E0L
+};
+#define NRD1 7
+static const long double RD1[NRD1 + 1] =
+{
+ 1.730299573175751778863269333703788214547E4L,
+ 6.807080914851328611903744668028014678148E4L,
+ 1.090071629101496938655806063184092302439E5L,
+ 9.124354356415154289343303999616003884080E4L,
+ 4.262071638655772404431164427024003253954E4L,
+ 1.096981664067373953673982635805821283581E4L,
+ 1.431229503796575892151252708527595787588E3L,
+ 7.734110684303689320830401788262295992921E1L
+ /* 1.0E0 */
+};
+
+
+/* log gamma(x + 1) = x P(x)/Q(x)
+ -0.125 <= x <= 0
+ 0.875 <= x+1 <= 1.0
+ Peak relative error 7.0e-37 */
+#define NRNr9 8
+static const long double RNr9[NRNr9 + 1] =
+{
+ 4.441379198241760069548832023257571176884E5L,
+ 1.273072988367176540909122090089580368732E6L,
+ 9.732422305818501557502584486510048387724E5L,
+ -5.040539994443998275271644292272870348684E5L,
+ -1.208719055525609446357448132109723786736E6L,
+ -7.434275365370936547146540554419058907156E5L,
+ -2.075642969983377738209203358199008185741E5L,
+ -2.565534860781128618589288075109372218042E4L,
+ -1.032901669542994124131223797515913955938E3L,
+};
+#define NRDr9 8
+static const long double RDr9[NRDr9 + 1] =
+{
+ -7.694488331323118759486182246005193998007E5L,
+ -3.301918855321234414232308938454112213751E6L,
+ -5.856830900232338906742924836032279404702E6L,
+ -5.540672519616151584486240871424021377540E6L,
+ -3.006530901041386626148342989181721176919E6L,
+ -9.350378280513062139466966374330795935163E5L,
+ -1.566179100031063346901755685375732739511E5L,
+ -1.205016539620260779274902967231510804992E4L,
+ -2.724583156305709733221564484006088794284E2L
+/* 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)
+{
+ long double y;
+
+ p += n;
+ y = *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* 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)
+{
+ long double y;
+
+ p += n;
+ y = x + *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+long double
+__ieee754_lgammal_r (long double x, int *signgamp)
+{
+ long double p, q, w, z, nx;
+ int i, nn;
+
+ *signgamp = 1;
+
+ if (! isfinite (x))
+ return x * x;
+
+ if (x == 0)
+ {
+ if (signbit (x))
+ *signgamp = -1;
+ }
+
+ if (x < 0)
+ {
+ if (x < -2 && x > -48)
+ return __lgamma_negl (x, signgamp);
+ q = -x;
+ p = __floorl (q);
+ if (p == q)
+ return (one / fabsl (p - p));
+ long double halfp = p * 0.5L;
+ if (halfp == __floorl (halfp))
+ *signgamp = -1;
+ else
+ *signgamp = 1;
+ if (q < 0x1p-120L)
+ return -__logl (q);
+ z = q - p;
+ if (z > 0.5L)
+ {
+ p += 1;
+ z = p - q;
+ }
+ z = q * __sinl (PIL * z);
+ w = __ieee754_lgammal_r (q, &i);
+ z = __logl (PIL / z) - w;
+ return (z);
+ }
+
+ if (x < 13.5L)
+ {
+ p = 0;
+ nx = __floorl (x + 0.5L);
+ nn = nx;
+ switch (nn)
+ {
+ case 0:
+ /* log gamma (x + 1) = log(x) + log gamma(x) */
+ if (x < 0x1p-120L)
+ return -__logl (x);
+ else if (x <= 0.125)
+ {
+ p = x * neval (x, RN1, NRN1) / deval (x, RD1, NRD1);
+ }
+ else if (x <= 0.375)
+ {
+ z = x - 0.25L;
+ p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
+ p += lgam1r25b;
+ p += lgam1r25a;
+ }
+ else if (x <= 0.625)
+ {
+ z = x + (1 - x0a);
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ else if (x <= 0.875)
+ {
+ z = x - 0.75L;
+ p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
+ p += lgam1r75b;
+ p += lgam1r75a;
+ }
+ else
+ {
+ 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 <= 0.625)
+ {
+ z = x + (1 - x0a);
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ else if (x <= 0.875)
+ {
+ z = x - 0.75L;
+ p = z * neval (z, RN1r75, NRN1r75)
+ / deval (z, RD1r75, NRD1r75);
+ p += lgam1r75b;
+ p += lgam1r75a;
+ }
+ else
+ {
+ z = x - 1;
+ p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+ }
+ p = p - __logl (x);
+ }
+ else if (x < 1)
+ {
+ z = x - 1;
+ p = z * neval (z, RNr9, NRNr9) / deval (z, RDr9, NRDr9);
+ }
+ else if (x == 1)
+ p = 0;
+ else if (x <= 1.125L)
+ {
+ z = x - 1;
+ p = z * neval (z, RN1, NRN1) / deval (z, RD1, NRD1);
+ }
+ else if (x <= 1.375)
+ {
+ z = x - 1.25L;
+ p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
+ p += lgam1r25b;
+ p += lgam1r25a;
+ }
+ else
+ {
+ /* 1.375 <= x+x0 <= 1.625 */
+ z = x - x0a;
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ break;
+
+ case 2:
+ if (x < 1.625L)
+ {
+ z = x - x0a;
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ else if (x < 1.875L)
+ {
+ z = x - 1.75L;
+ p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
+ p += lgam1r75b;
+ p += lgam1r75a;
+ }
+ else if (x == 2)
+ p = 0;
+ else if (x < 2.375L)
+ {
+ z = x - 2;
+ p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+ }
+ else
+ {
+ z = x - 2.5L;
+ p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
+ p += lgam2r5b;
+ p += lgam2r5a;
+ }
+ break;
+
+ case 3:
+ if (x < 2.75)
+ {
+ z = x - 2.5L;
+ p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
+ p += lgam2r5b;
+ p += lgam2r5a;
+ }
+ else
+ {
+ z = x - 3;
+ p = z * neval (z, RN3, NRN3) / deval (z, RD3, NRD3);
+ p += lgam3b;
+ p += lgam3a;
+ }
+ break;
+
+ case 4:
+ z = x - 4;
+ p = z * neval (z, RN4, NRN4) / deval (z, RD4, NRD4);
+ p += lgam4b;
+ p += lgam4a;
+ break;
+
+ case 5:
+ z = x - 5;
+ p = z * neval (z, RN5, NRN5) / deval (z, RD5, NRD5);
+ p += lgam5b;
+ p += lgam5a;
+ break;
+
+ case 6:
+ z = x - 6;
+ p = z * neval (z, RN6, NRN6) / deval (z, RD6, NRD6);
+ p += lgam6b;
+ p += lgam6a;
+ break;
+
+ case 7:
+ z = x - 7;
+ p = z * neval (z, RN7, NRN7) / deval (z, RD7, NRD7);
+ p += lgam7b;
+ p += lgam7a;
+ break;
+
+ case 8:
+ z = x - 8;
+ p = z * neval (z, RN8, NRN8) / deval (z, RD8, NRD8);
+ p += lgam8b;
+ p += lgam8a;
+ break;
+
+ case 9:
+ z = x - 9;
+ p = z * neval (z, RN9, NRN9) / deval (z, RD9, NRD9);
+ p += lgam9b;
+ p += lgam9a;
+ break;
+
+ case 10:
+ z = x - 10;
+ p = z * neval (z, RN10, NRN10) / deval (z, RD10, NRD10);
+ p += lgam10b;
+ p += lgam10a;
+ break;
+
+ case 11:
+ z = x - 11;
+ p = z * neval (z, RN11, NRN11) / deval (z, RD11, NRD11);
+ p += lgam11b;
+ p += lgam11a;
+ break;
+
+ case 12:
+ z = x - 12;
+ p = z * neval (z, RN12, NRN12) / deval (z, RD12, NRD12);
+ p += lgam12b;
+ p += lgam12a;
+ break;
+
+ case 13:
+ z = x - 13;
+ p = z * neval (z, RN13, NRN13) / deval (z, RD13, NRD13);
+ p += lgam13b;
+ p += lgam13a;
+ break;
+ }
+ return p;
+ }
+
+ if (x > MAXLGM)
+ return (*signgamp * huge * huge);
+
+ if (x > 0x1p120L)
+ return x * (__logl (x) - 1);
+ q = ls2pi - x;
+ q = (x - 0.5L) * __logl (x) + q;
+ if (x > 1.0e18L)
+ return (q);
+
+ p = 1 / (x * x);
+ q += neval (p, RASY, NRASY) / x;
+ return (q);
+}
+strong_alias (__ieee754_lgammal_r, __lgammal_r_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_log10l.c b/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
index 7477791b77..62e3214ca4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
@@ -189,7 +189,7 @@ __ieee754_log10l (long double x)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (hx, xhi);
if ((hx & 0x7fffffffffffffffLL) == 0)
- return (-1.0L / (x - x));
+ return (-1.0L / fabsl (x)); /* log10l(+-0)=-inf */
if (hx < 0)
return (x - x) / (x - x);
if (hx >= 0x7ff0000000000000LL)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_log2l.c b/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
index e39eaba72a..1f8b6e9d7f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
@@ -183,7 +183,7 @@ __ieee754_log2l (long double x)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (hx, xhi);
if ((hx & 0x7fffffffffffffffLL) == 0)
- return (-1.0L / (x - x));
+ return (-1.0L / fabsl (x)); /* log2l(+-0)=-inf */
if (hx < 0)
return (x - x) / (x - x);
if (hx >= 0x7ff0000000000000LL)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_logl.c b/sysdeps/ieee754/ldbl-128ibm/e_logl.c
index 14acfc2db7..c44feca65b 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_logl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_logl.c
@@ -58,6 +58,7 @@
License along with this library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <math.h>
#include <math_private.h>
/* log(1+x) = x - .5 x^2 + x^3 l(x)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_powl.c b/sysdeps/ieee754/ldbl-128ibm/e_powl.c
index 90340e890e..f59ad4e113 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_powl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_powl.c
@@ -66,6 +66,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double bp[] = {
1.0L,
@@ -148,7 +149,7 @@ long double
__ieee754_powl (long double x, long double y)
{
long double z, ax, z_h, z_l, p_h, p_l;
- long double y1, t1, t2, r, s, t, u, v, w;
+ long double y1, t1, t2, r, s, sgn, t, u, v, w;
long double s2, s_h, s_l, t_h, t_l, ay;
int32_t i, j, k, yisint, n;
uint32_t ix, iy;
@@ -165,11 +166,11 @@ __ieee754_powl (long double x, long double y)
iy = hy & 0x7fffffff;
/* y==zero: x**0 = 1 */
- if ((iy | ly) == 0)
+ if ((iy | ly) == 0 && !issignaling (x))
return one;
/* 1.0**y = 1; -1.0**+-Inf = 1 */
- if (x == one)
+ if (x == one && !issignaling (y))
return one;
if (x == -1.0L && ((iy - 0x7ff00000) | ly) == 0)
return one;
@@ -233,7 +234,7 @@ __ieee754_powl (long double x, long double y)
if (hy == 0x3fe00000)
{ /* y is 0.5 */
if (hx >= 0) /* x >= +0 */
- return __ieee754_sqrtl (x);
+ return sqrtl (x);
}
}
}
@@ -260,9 +261,14 @@ __ieee754_powl (long double x, long double y)
}
/* (x<0)**(non-int) is NaN */
- if (((((u_int32_t) hx >> 31) - 1) | yisint) == 0)
+ if (((((uint32_t) hx >> 31) - 1) | yisint) == 0)
return (x - x) / (x - x);
+ /* sgn (sign of result -ve**odd) = -1 else = 1 */
+ sgn = one;
+ if (((((uint32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
+ sgn = -one; /* (-ve)**(odd int) */
+
/* |y| is huge.
2^-16495 = 1/2 of smallest representable value.
If (1 - 1/131072)^y underflows, y > 1.4986e9 */
@@ -272,15 +278,15 @@ __ieee754_powl (long double x, long double y)
if (iy > 0x47d654b0)
{
if (ix <= 0x3fefffff)
- return (hy < 0) ? huge * huge : tiny * tiny;
+ return (hy < 0) ? sgn * huge * huge : sgn * tiny * tiny;
if (ix >= 0x3ff00000)
- return (hy > 0) ? huge * huge : tiny * tiny;
+ return (hy > 0) ? sgn * huge * huge : sgn * tiny * tiny;
}
/* over/underflow if x is not close to one */
if (ix < 0x3fefffff)
- return (hy < 0) ? huge * huge : tiny * tiny;
+ return (hy < 0) ? sgn * huge * huge : sgn * tiny * tiny;
if (ix > 0x3ff00000)
- return (hy > 0) ? huge * huge : tiny * tiny;
+ return (hy > 0) ? sgn * huge * huge : sgn * tiny * tiny;
}
ay = y > 0 ? y : -y;
@@ -351,11 +357,6 @@ __ieee754_powl (long double x, long double y)
t1 = ldbl_high (t1);
t2 = z_l - (((t1 - t) - dp_h[k]) - z_h);
- /* s (sign of result -ve**odd) = -1 else = 1 */
- s = one;
- if (((((u_int32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
- s = -one; /* (-ve)**(odd int) */
-
/* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
y1 = ldbl_high (y);
p_l = (y - y1) * t1 + y * t2;
@@ -367,22 +368,22 @@ __ieee754_powl (long double x, long double y)
{
/* if z > 16384 */
if (((j - 0x40d00000) | lj) != 0)
- return s * huge * huge; /* overflow */
+ return sgn * huge * huge; /* overflow */
else
{
if (p_l + ovt > z - p_h)
- return s * huge * huge; /* overflow */
+ return sgn * huge * huge; /* overflow */
}
}
else if ((j & 0x7fffffff) >= 0x40d01b90) /* z <= -16495 */
{
/* z < -16495 */
if (((j - 0xc0d01bc0) | lj) != 0)
- return s * tiny * tiny; /* underflow */
+ return sgn * tiny * tiny; /* underflow */
else
{
if (p_l <= z - p_h)
- return s * tiny * tiny; /* underflow */
+ return sgn * tiny * tiny; /* underflow */
}
}
/* compute 2**(p_h+p_l) */
@@ -408,8 +409,8 @@ __ieee754_powl (long double x, long double y)
t1 = z - t * u / v;
r = (z * t1) / (t1 - two) - (w + z * w);
z = one - (r - z);
- z = __scalbnl (z, n);
- math_check_force_underflow_nonneg (z);
- return s * z;
+ z = __scalbnl (sgn * z, n);
+ math_check_force_underflow (z);
+ return z;
}
strong_alias (__ieee754_powl, __powl_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c
index cc2b235534..07cb1e8b4c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point argument reduction.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -200,7 +200,7 @@ int32_t __ieee754_rem_pio2l(long double x, long double *y)
double tx[8];
int exp;
int64_t n, ix, hx, ixd;
- u_int64_t lxd;
+ uint64_t lxd;
double xhi;
xhi = ldbl_high (x);
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c b/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
index 800416f29a..efa83bdab7 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
@@ -31,7 +31,7 @@ long double
__ieee754_remainderl(long double x, long double p)
{
int64_t hx,hp;
- u_int64_t sx,lx,lp;
+ uint64_t sx,lx,lp;
long double p_half;
double xhi, xlo, phi, plo;
@@ -42,8 +42,14 @@ __ieee754_remainderl(long double x, long double p)
EXTRACT_WORDS64 (hp, phi);
EXTRACT_WORDS64 (lp, plo);
sx = hx&0x8000000000000000ULL;
+ lp ^= hp & 0x8000000000000000ULL;
hp &= 0x7fffffffffffffffLL;
+ lx ^= sx;
hx &= 0x7fffffffffffffffLL;
+ if (lp == 0x8000000000000000ULL)
+ lp = 0;
+ if (lx == 0x8000000000000000ULL)
+ lx = 0;
/* purge off exception values */
if(hp==0) return (x*p)/(x*p); /* p = 0 */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
index 67d9d24ce7..f869fb068c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
@@ -31,6 +31,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double one = 1.0, shuge = 1.0e307;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
index 96845fe5f8..28b208883d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -91,11 +91,9 @@ long double __ieee754_sqrtl(long double x)
return c.x * i;
}
else {
- if (k>=INT64_C(0x7ff0000000000000)) {
- if (a.i[0] == INT64_C(0xfff0000000000000))
- return (big1-big1)/(big-big); /* sqrt (-Inf) = NaN. */
- return x; /* sqrt (NaN) = NaN, sqrt (+Inf) = +Inf. */
- }
+ if (k>=INT64_C(0x7ff0000000000000))
+ /* sqrt (-Inf) = NaN, sqrt (NaN) = NaN, sqrt (+Inf) = +Inf. */
+ return x * x + x;
if (x == 0) return x;
if (x < 0) return (big1-big1)/(big-big);
return tm256*__ieee754_sqrtl(x*t512);
diff --git a/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c b/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c
index b631f90a44..e4d9887b6c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/ieee754.h b/sysdeps/ieee754/ldbl-128ibm/ieee754.h
index c07a6def4b..8017d9846f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/ieee754.h
+++ b/sysdeps/ieee754/ldbl-128ibm/ieee754.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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/k_cosl.c b/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
index 2a3189ad36..e40c53cad3 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -86,7 +86,7 @@ __kernel_cosl(long double x, long double y)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (ix, xhi);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3fc30000) /* |x| < 0.1484375 */
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
index 4e43c8622e..ba95337c31 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine and cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,6 +20,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double c[] = {
#define ONE c[0]
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_sinl.c b/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
index 44da02b0f3..46d1d7b52a 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,6 +20,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double c[] = {
#define ONE c[0]
@@ -82,12 +83,12 @@ __kernel_sinl(long double x, long double y, int iy)
{
long double h, l, z, sin_l, cos_l_m1;
int64_t ix;
- u_int32_t tix, hix, index;
+ uint32_t tix, hix, index;
double xhi, hhi;
xhi = ldbl_high (x);
EXTRACT_WORDS64 (ix, xhi);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3fc30000) /* |x| < 0.1484375 */
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_tanl.c b/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
index 3c1bf32af9..3927fca25c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
@@ -57,9 +57,11 @@
*/
#include <float.h>
-#include <libc-internal.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libc-diag.h>
+
static const long double
one = 1.0L,
pio4hi = 7.8539816339744830961566084581987569936977E-1L,
diff --git a/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c b/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
index 4f550ef47c..0e265ff5b2 100644
--- a/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
+++ b/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,6 +28,12 @@
bits (106 for long double) and an integral power of two (MPN
frexpl). */
+
+/* When signs differ, the actual value is the difference between the
+ significant double and the less significant double. Sometimes a
+ bit can be lost when we borrow from the significant mantissa. */
+#define EXTRA_INTERNAL_PRECISION (7)
+
mp_size_t
__mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
int *expt, int *is_neg,
@@ -45,10 +51,15 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
lo = ((long long) u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1;
hi = ((long long) u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1;
+ /* Hold 7 extra bits of precision in the mantissa. This allows
+ the normalizing shifts below to prevent losing precision when
+ the signs differ and the exponents are sufficiently far apart. */
+ lo <<= EXTRA_INTERNAL_PRECISION;
+
/* If the lower double is not a denormal or zero then set the hidden
53rd bit. */
if (u.d[1].ieee.exponent != 0)
- lo |= 1ULL << 52;
+ lo |= 1ULL << (52 + EXTRA_INTERNAL_PRECISION);
else
lo = lo << 1;
@@ -72,12 +83,12 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
if (u.d[0].ieee.negative != u.d[1].ieee.negative
&& lo != 0)
{
- lo = (1ULL << 53) - lo;
+ lo = (1ULL << (53 + EXTRA_INTERNAL_PRECISION)) - lo;
if (hi == 0)
{
/* we have a borrow from the hidden bit, so shift left 1. */
- hi = 0x0ffffffffffffeLL | (lo >> 51);
- lo = 0x1fffffffffffffLL & (lo << 1);
+ hi = 0x000ffffffffffffeLL | (lo >> (52 + EXTRA_INTERNAL_PRECISION));
+ lo = 0x0fffffffffffffffLL & (lo << 1);
(*expt)--;
}
else
@@ -85,14 +96,14 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
}
#if BITS_PER_MP_LIMB == 32
/* Combine the mantissas to be contiguous. */
- res_ptr[0] = lo;
- res_ptr[1] = (hi << (53 - 32)) | (lo >> 32);
+ res_ptr[0] = lo >> EXTRA_INTERNAL_PRECISION;
+ res_ptr[1] = (hi << (53 - 32)) | (lo >> (32 + EXTRA_INTERNAL_PRECISION));
res_ptr[2] = hi >> 11;
res_ptr[3] = hi >> (32 + 11);
#define N 4
#elif BITS_PER_MP_LIMB == 64
/* Combine the two mantissas to be contiguous. */
- res_ptr[0] = (hi << 53) | lo;
+ res_ptr[0] = (hi << 53) | (lo >> EXTRA_INTERNAL_PRECISION);
res_ptr[1] = hi >> 11;
#define N 2
#else
diff --git a/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c b/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c
index c2a5cd29b6..e00f7b9889 100644
--- a/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c
@@ -1,5 +1,5 @@
/* lgammal expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c b/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c
index c5fa81be8e..dc0e8dd723 100644
--- a/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h b/sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h
new file mode 100644
index 0000000000..653407597f
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h
@@ -0,0 +1,29 @@
+/* NaN payload handling or ldbl-128ibm.
+ Copyright (C) 1997-2018 Free Software 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 SET_NAN_PAYLOAD(flt, mant) \
+ do \
+ { \
+ union ibm_extended_long_double u; \
+ u.ld = (flt); \
+ u.d[0].ieee_nan.mantissa0 = (mant) >> 32; \
+ u.d[0].ieee_nan.mantissa1 = (mant); \
+ if ((u.d[0].ieee.mantissa0 | u.d[0].ieee.mantissa1) != 0) \
+ (flt) = u.ld; \
+ } \
+ while (0)
diff --git a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
index 051352f9f7..ccb646620e 100644
--- a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
+++ b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
@@ -1,6 +1,23 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+/* Manipulation of the bit representation of 'long double' quantities.
+ Copyright (C) 2006-2018 Free Software 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_LDBL_H_
+#define _MATH_LDBL_H_ 1
#include <ieee754.h>
#include <stdint.h>
@@ -230,3 +247,44 @@ ldbl_nearbyint (double a)
}
return a;
}
+
+/* Canonicalize a result from an integer rounding function, in any
+ rounding mode. *A and *AA are finite and integers, with *A being
+ nonzero; if the result is not already canonical, *AA is plus or
+ minus a power of 2 that does not exceed the least set bit in
+ *A. */
+static inline void
+ldbl_canonicalize_int (double *a, double *aa)
+{
+ /* Previously we used EXTRACT_WORDS64 from math_private.h, but in order
+ to avoid including internal headers we duplicate that code here. */
+ uint64_t ax, aax;
+ union { double value; uint64_t word; } extractor;
+ extractor.value = *a;
+ ax = extractor.word;
+ extractor.value = *aa;
+ aax = extractor.word;
+
+ int expdiff = ((ax >> 52) & 0x7ff) - ((aax >> 52) & 0x7ff);
+ if (expdiff <= 53)
+ {
+ if (expdiff == 53)
+ {
+ /* Half way between two double values; noncanonical iff the
+ low bit of A's mantissa is 1. */
+ if ((ax & 1) != 0)
+ {
+ *a += 2 * *aa;
+ *aa = -*aa;
+ }
+ }
+ else
+ {
+ /* The sum can be represented in a single double. */
+ *a += *aa;
+ *aa = 0;
+ }
+ }
+}
+
+#endif /* math_ldbl.h */
diff --git a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
index 42f5e6a02d..ff9f6496bd 100644
--- a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c b/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
index 06be1c52d4..2908e8a819 100644
--- a/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
+++ b/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c b/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
index aa9a9ba213..d4977e5414 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
@@ -28,6 +28,7 @@ static char rcsid[] = "$NetBSD: s_asinh.c,v 1.9 1995/05/12 04:57:37 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
static const long double
@@ -53,10 +54,10 @@ long double __asinhl(long double x)
w = __ieee754_logl(fabsl(x))+ln2;
} else if (ix>0x4000000000000000LL) { /* 2**56 >= |x| > 2.0 */
t = fabs(x);
- w = __ieee754_logl(2.0*t+one/(__ieee754_sqrtl(x*x+one)+t));
+ w = __ieee754_logl(2.0*t+one/(sqrtl(x*x+one)+t));
} else { /* 2.0 >= |x| >= 2**-56 */
t = x*x;
- w =__log1pl(fabsl(x)+t/(one+__ieee754_sqrtl(one+t)));
+ w =__log1pl(fabsl(x)+t/(one+sqrtl(one+t)));
}
if(hx>0) return w; else return -w;
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_atanl.c b/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
index 0560d820ae..32cf36c65d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
@@ -62,6 +62,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
/* arctan(k/8), k = 0, ..., 82 */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
index 010a671dce..317d238057 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
@@ -1,6 +1,102 @@
-/* Looks like we can use ieee854 s_cbrtl.c as is for IBM extended format. */
+/* Implementation of cbrtl. IBM Extended Precision version.
+ Cephes Math Library Release 2.2: January, 1991
+ Copyright 1984, 1991 by Stephen L. Moshier
+ Adapted for glibc October, 2001.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c. */
+
+
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_cbrtl.c>
+#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;
+
+
+long double
+__cbrtl (long double x)
+{
+ int e, rem, sign;
+ long double z;
+
+ if (!isfinite (x))
+ return x + x;
+
+ if (x == 0)
+ return (x);
+
+ if (x > 0)
+ sign = 1;
+ else
+ {
+ sign = -1;
+ x = -x;
+ }
+
+ z = x;
+ /* extract power of 2, leaving mantissa between 0.5 and 1 */
+ x = __frexpl (x, &e);
+
+ /* 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;
+
+ /* exponent divided by 3 */
+ if (e >= 0)
+ {
+ rem = e;
+ e /= 3;
+ rem -= 3 * e;
+ if (rem == 1)
+ x *= CBRT2;
+ else if (rem == 2)
+ x *= CBRT4;
+ }
+ else
+ { /* argument less than 1 */
+ e = -e;
+ rem = e;
+ e /= 3;
+ rem -= 3 * e;
+ if (rem == 1)
+ x *= CBRT2I;
+ else if (rem == 2)
+ x *= CBRT4I;
+ e = -e;
+ }
+
+ /* multiply by power of 2 */
+ 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;
+
+ if (sign < 0)
+ x = -x;
+ return (x);
+}
+
long_double_symbol (libm, __cbrtl, cbrtl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ceill.c b/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
index ac649b7215..7dcff021c4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
@@ -1,6 +1,6 @@
/* Ceil (round to +inf) long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -35,43 +36,26 @@ __ceill (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- double orig_xh;
-
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- orig_xh = xh;
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is non-zero. nearbyint
- rounds values to the nearest integer, and values halfway
- between integers to the nearest even integer. ceill must
- round towards +Inf. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
-
- if (xh > 0.0 || (xh == 0.0 && xl > 0.0))
- lo += 1.0;
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
-
- /* Ensure we return -0 rather than +0 when appropriate. */
- if (orig_xh < 0.0)
- xh = -__builtin_fabs (xh);
+ hi = __ceil (xh);
+ if (hi != xh)
+ {
+ /* The high part is not an integer; the low part does not
+ affect the result. */
+ xh = hi;
+ xl = 0;
+ }
+ else
+ {
+ /* The high part is a nonzero integer. */
+ lo = __ceil (xl);
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize_int (&xh, &xl);
+ }
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_daddl.c b/sysdeps/ieee754/ldbl-128ibm/s_daddl.c
new file mode 100644
index 0000000000..28b7e06ace
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_daddl.c
@@ -0,0 +1,27 @@
+/* Add long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+double
+__daddl (long double x, long double y)
+{
+ NARROW_ADD_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ddivl.c b/sysdeps/ieee754/ldbl-128ibm/s_ddivl.c
new file mode 100644
index 0000000000..6bbbbcf09d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ddivl.c
@@ -0,0 +1,27 @@
+/* Divide long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+double
+__ddivl (long double x, long double y)
+{
+ NARROW_DIV_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_dmull.c b/sysdeps/ieee754/ldbl-128ibm/s_dmull.c
new file mode 100644
index 0000000000..7b75b2b0f1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_dmull.c
@@ -0,0 +1,27 @@
+/* Multiply long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+double
+__dmull (long double x, long double y)
+{
+ NARROW_MUL_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_dsubl.c b/sysdeps/ieee754/ldbl-128ibm/s_dsubl.c
new file mode 100644
index 0000000000..e0e80f26a4
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_dsubl.c
@@ -0,0 +1,27 @@
+/* Subtract long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+double
+__dsubl (long double x, long double y)
+{
+ NARROW_SUB_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_erfl.c b/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
index 7b761b0afa..5302fee522 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
@@ -105,6 +105,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
#include <fix-int-fp-convert-zero.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
index 66f75e1c80..42d57c6eec 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
@@ -106,8 +106,8 @@ __expm1l (long double x)
/* Infinity (which must be negative infinity). */
if (((ix - 0x7ff00000) | lx) == 0)
return -1.0L;
- /* NaN. No invalid exception. */
- return x;
+ /* NaN. Invalid exception if signaling. */
+ return x + x;
}
/* expm1(+- 0) = +- 0. */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c b/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
index c801c97065..54bf9b9cc1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
@@ -28,7 +28,7 @@ static char rcsid[] = "$NetBSD: $";
long double __fabsl(long double x)
{
- u_int64_t hx, lx;
+ uint64_t hx, lx;
double xhi, xlo;
ldbl_unpack (x, &xhi, &xlo);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_faddl.c b/sysdeps/ieee754/ldbl-128ibm/s_faddl.c
new file mode 100644
index 0000000000..55a391885c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_faddl.c
@@ -0,0 +1,27 @@
+/* Add long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+float
+__faddl (long double x, long double y)
+{
+ NARROW_ADD_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fdivl.c b/sysdeps/ieee754/ldbl-128ibm/s_fdivl.c
new file mode 100644
index 0000000000..dd34c05502
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fdivl.c
@@ -0,0 +1,27 @@
+/* Divide long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+float
+__fdivl (long double x, long double y)
+{
+ NARROW_DIV_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_floorl.c b/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
index 912230870a..4aae5ae608 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -35,36 +36,26 @@ __floorl (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is non-zero. nearbyint
- rounds values to the nearest integer, and values halfway
- between integers to the nearest even integer. floorl must
- round towards -Inf. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
-
- if (xh < 0.0 || (xh == 0.0 && xl < 0.0))
- lo += -1.0;
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
+ hi = __floor (xh);
+ if (hi != xh)
+ {
+ /* The high part is not an integer; the low part does not
+ affect the result. */
+ xh = hi;
+ xl = 0;
+ }
+ else
+ {
+ /* The high part is a nonzero integer. */
+ lo = __floor (xl);
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize_int (&xh, &xl);
+ }
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
index eb3ee3cfb8..e72a3e4d59 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Flaherty <flaherty@linux.vnet.ibm.com>.
@@ -17,25 +17,240 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <fenv.h>
+#include <float.h>
#include <math.h>
+#include <math-barriers.h>
+#include <math_private.h>
+#include <math-underflow.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
+ given that |X| >= |Y| and the values are small enough that no
+ overflow occurs. */
+
+static void
+add_split (double *hi, double *lo, double x, double y)
+{
+ /* Apply Dekker's algorithm. */
+ *hi = x + y;
+ *lo = (x - *hi) + y;
+}
+
+/* Value with extended range, used in intermediate computations. */
+typedef struct
+{
+ /* Value in [0.5, 1), as from frexp, or 0. */
+ double val;
+ /* Exponent of power of 2 it is multiplied by, or 0 for zero. */
+ int exp;
+} ext_val;
+
+/* Store D as an ext_val value. */
+
+static void
+store_ext_val (ext_val *v, double d)
+{
+ v->val = __frexp (d, &v->exp);
+}
+
+/* Store X * Y as ext_val values *V0 and *V1. */
+
+static void
+mul_ext_val (ext_val *v0, ext_val *v1, double x, double y)
+{
+ int xexp, yexp;
+ x = __frexp (x, &xexp);
+ y = __frexp (y, &yexp);
+ double hi, lo;
+ mul_split (&hi, &lo, x, y);
+ store_ext_val (v0, hi);
+ if (hi != 0)
+ v0->exp += xexp + yexp;
+ store_ext_val (v1, lo);
+ if (lo != 0)
+ v1->exp += xexp + yexp;
+}
+
+/* Compare absolute values of ext_val values pointed to by P and Q for
+ qsort. */
+
+static int
+compare (const void *p, const void *q)
+{
+ const ext_val *pe = p;
+ const ext_val *qe = q;
+ if (pe->val == 0)
+ return qe->val == 0 ? 0 : -1;
+ else if (qe->val == 0)
+ return 1;
+ else if (pe->exp < qe->exp)
+ return -1;
+ else if (pe->exp > qe->exp)
+ return 1;
+ else
+ {
+ double pd = fabs (pe->val);
+ double qd = fabs (qe->val);
+ if (pd < qd)
+ return -1;
+ else if (pd == qd)
+ return 0;
+ else
+ return 1;
+ }
+}
+
+/* Calculate *X + *Y exactly, storing the high part in *X (rounded to
+ nearest) and the low part in *Y. It is given that |X| >= |Y|. */
+
+static void
+add_split_ext (ext_val *x, ext_val *y)
+{
+ int xexp = x->exp, yexp = y->exp;
+ if (y->val == 0 || xexp - yexp > 53)
+ return;
+ double hi = x->val;
+ double lo = __scalbn (y->val, yexp - xexp);
+ add_split (&hi, &lo, hi, lo);
+ store_ext_val (x, hi);
+ if (hi != 0)
+ x->exp += xexp;
+ store_ext_val (y, lo);
+ if (lo != 0)
+ y->exp += xexp;
+}
long double
__fmal (long double x, long double y, long double z)
{
- /* An IBM long double 128 is really just 2 IEEE64 doubles, and in
- * the case of inf/nan only the first double counts. So we use the
- * (double) cast to avoid any data movement. */
- if ((isfinite ((double)x) && isfinite ((double)y)) && isinf ((double)z))
- return (z);
-
- /* If z is zero and x are y are nonzero, compute the result
- as x * y to avoid the wrong sign of a zero result if x * y
- underflows to 0. */
- if (z == 0 && x != 0 && y != 0)
- return x * y;
-
- return (x * y) + z;
+ double xhi, xlo, yhi, ylo, zhi, zlo;
+ int64_t hx, hy, hz;
+ int xexp, yexp, zexp;
+ double scale_val;
+ int scale_exp;
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ xexp = (hx & 0x7ff0000000000000LL) >> 52;
+ ldbl_unpack (y, &yhi, &ylo);
+ EXTRACT_WORDS64 (hy, yhi);
+ yexp = (hy & 0x7ff0000000000000LL) >> 52;
+ ldbl_unpack (z, &zhi, &zlo);
+ EXTRACT_WORDS64 (hz, zhi);
+ zexp = (hz & 0x7ff0000000000000LL) >> 52;
+
+ /* If z is Inf or NaN, but x and y are finite, avoid any exceptions
+ from computing x * y. */
+ if (zexp == 0x7ff && xexp != 0x7ff && yexp != 0x7ff)
+ return (z + x) + y;
+
+ /* If z is zero and x are y are nonzero, compute the result as x * y
+ to avoid the wrong sign of a zero result if x * y underflows to
+ 0. */
+ if (z == 0 && x != 0 && y != 0)
+ return x * y;
+
+ /* If x or y or z is Inf/NaN, or if x * y is zero, compute as x * y
+ + z. */
+ if (xexp == 0x7ff || yexp == 0x7ff || zexp == 0x7ff
+ || x == 0 || y == 0)
+ return (x * y) + z;
+
+ {
+ SET_RESTORE_ROUND (FE_TONEAREST);
+
+ ext_val vals[10];
+ store_ext_val (&vals[0], zhi);
+ store_ext_val (&vals[1], zlo);
+ mul_ext_val (&vals[2], &vals[3], xhi, yhi);
+ mul_ext_val (&vals[4], &vals[5], xhi, ylo);
+ mul_ext_val (&vals[6], &vals[7], xlo, yhi);
+ mul_ext_val (&vals[8], &vals[9], xlo, ylo);
+ qsort (vals, 10, sizeof (ext_val), 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 <= 8; i++)
+ {
+ add_split_ext (&vals[i + 1], &vals[i]);
+ qsort (vals + i + 1, 9 - i, sizeof (ext_val), compare);
+ }
+ /* Add up the values in the other direction, so that each element
+ of VALS has absolute value less than 5ulp of the next
+ value. */
+ size_t dstpos = 9;
+ for (size_t i = 1; i <= 9; i++)
+ {
+ if (vals[dstpos].val == 0)
+ {
+ vals[dstpos] = vals[9 - i];
+ vals[9 - i].val = 0;
+ vals[9 - i].exp = 0;
+ }
+ else
+ {
+ add_split_ext (&vals[dstpos], &vals[9 - i]);
+ if (vals[9 - i].val != 0)
+ {
+ if (9 - i < dstpos - 1)
+ {
+ vals[dstpos - 1] = vals[9 - i];
+ vals[9 - i].val = 0;
+ vals[9 - i].exp = 0;
+ }
+ dstpos--;
+ }
+ }
+ }
+ /* If the result is an exact zero, it results from adding two
+ values with opposite signs; recompute in the original rounding
+ mode. */
+ if (vals[9].val == 0)
+ goto zero_out;
+ /* Adding the top three values will now give a result as accurate
+ as the underlying long double arithmetic. */
+ add_split_ext (&vals[9], &vals[8]);
+ if (compare (&vals[8], &vals[7]) < 0)
+ {
+ ext_val tmp = vals[7];
+ vals[7] = vals[8];
+ vals[8] = tmp;
+ }
+ add_split_ext (&vals[8], &vals[7]);
+ add_split_ext (&vals[9], &vals[8]);
+ if (vals[9].exp > DBL_MAX_EXP || vals[9].exp < DBL_MIN_EXP)
+ {
+ /* Overflow or underflow, with the result depending on the
+ original rounding mode, but not on the low part computed
+ here. */
+ scale_val = vals[9].val;
+ scale_exp = vals[9].exp;
+ goto scale_out;
+ }
+ double hi = __scalbn (vals[9].val, vals[9].exp);
+ double lo = __scalbn (vals[8].val, vals[8].exp);
+ /* It is possible that the low part became subnormal and was
+ rounded so that the result is no longer canonical. */
+ ldbl_canonicalize (&hi, &lo);
+ long double ret = ldbl_pack (hi, lo);
+ math_check_force_underflow (ret);
+ return ret;
+ }
+
+ scale_out:
+ scale_val = math_opt_barrier (scale_val);
+ scale_val = __scalbn (scale_val, scale_exp);
+ if (fabs (scale_val) == DBL_MAX)
+ return __copysignl (LDBL_MAX, scale_val);
+ math_check_force_underflow (scale_val);
+ return scale_val;
+
+ zero_out:;
+ double zero = 0.0;
+ zero = math_opt_barrier (zero);
+ return zero - zero;
}
#if IS_IN (libm)
long_double_symbol (libm, __fmal, fmal);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fmull.c b/sysdeps/ieee754/ldbl-128ibm/s_fmull.c
new file mode 100644
index 0000000000..d1988f168d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fmull.c
@@ -0,0 +1,27 @@
+/* Multiply long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+float
+__fmull (long double x, long double y)
+{
+ NARROW_MUL_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c b/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c
index 83c3a8dc51..92c08cc995 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -44,7 +44,7 @@
int
___fpclassifyl (long double x)
{
- u_int64_t hx, lx;
+ uint64_t hx, lx;
int retval = FP_NORMAL;
double xhi, xlo;
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c b/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
index 52d2d3ea90..210c5d2ed4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
@@ -47,7 +47,7 @@ long double __frexpl(long double x, int *eptr)
{
/* 0,inf,nan. */
*eptr = expon;
- return x;
+ return x + x;
}
expon = ix >> 52;
if (expon == 0)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c
new file mode 100644
index 0000000000..f3fdba33c1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpl
+#include <s_fromfpl_main.c>
+weak_alias (__fromfpl, fromfpl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c
new file mode 100644
index 0000000000..76287c33dc
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c
@@ -0,0 +1,147 @@
+/* Round to integer type. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software 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 <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x3ff
+#define MANT_DIG 53
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (long double x, int round, unsigned int width)
+{
+ double hi, lo;
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint64_t hx, lx;
+ ldbl_unpack (x, &hi, &lo);
+ EXTRACT_WORDS64 (hx, hi);
+ EXTRACT_WORDS64 (lx, lo);
+ bool negative = (hx & 0x8000000000000000ULL) != 0;
+ bool lo_negative = (lx & 0x8000000000000000ULL) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ hx &= 0x7fffffffffffffffULL;
+ lx &= 0x7fffffffffffffffULL;
+ if ((hx | lx) == 0)
+ return 0;
+ int hi_exponent = hx >> (MANT_DIG - 1);
+ hi_exponent -= BIAS;
+ int exponent = hi_exponent;
+ hx &= ((1ULL << (MANT_DIG - 1)) - 1);
+ if (hx == 0 && lx != 0 && lo_negative != negative)
+ exponent--;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+ int lo_exponent = lx >> (MANT_DIG - 1);
+ lo_exponent -= BIAS;
+
+ /* Convert the high part to integer. */
+ hx |= 1ULL << (MANT_DIG - 1);
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ if (hi_exponent >= MANT_DIG - 1)
+ {
+ uret = hx;
+ uret <<= hi_exponent - (MANT_DIG - 1);
+ half_bit = false;
+ more_bits = false;
+ }
+ else if (hi_exponent >= -1)
+ {
+ uint64_t h = 1ULL << (MANT_DIG - 2 - hi_exponent);
+ half_bit = (hx & h) != 0;
+ more_bits = (hx & (h - 1)) != 0;
+ uret = hx >> (MANT_DIG - 1 - hi_exponent);
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+
+ /* Likewise, the low part. */
+ if (lx != 0)
+ {
+ uintmax_t lo_uret;
+ bool lo_half_bit, lo_more_bits;
+ lx &= ((1ULL << (MANT_DIG - 1)) - 1);
+ lx |= 1ULL << (MANT_DIG - 1);
+ /* The high part exponent is at most 64, so the low part
+ exponent is at most 11. */
+ if (lo_exponent >= -1)
+ {
+ uint64_t h = 1ULL << (MANT_DIG - 2 - lo_exponent);
+ lo_half_bit = (lx & h) != 0;
+ lo_more_bits = (lx & (h - 1)) != 0;
+ lo_uret = lx >> (MANT_DIG - 1 - lo_exponent);
+ }
+ else
+ {
+ lo_uret = 0;
+ lo_half_bit = false;
+ lo_more_bits = true;
+ }
+ if (lo_negative == negative)
+ {
+ uret += lo_uret;
+ half_bit |= lo_half_bit;
+ more_bits |= lo_more_bits;
+ }
+ else
+ {
+ uret -= lo_uret;
+ if (lo_half_bit)
+ {
+ uret--;
+ half_bit = true;
+ }
+ if (lo_more_bits && !more_bits)
+ {
+ if (half_bit)
+ {
+ half_bit = false;
+ more_bits = true;
+ }
+ else
+ {
+ uret--;
+ half_bit = true;
+ more_bits = true;
+ }
+ }
+ }
+ }
+
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c b/sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c
new file mode 100644
index 0000000000..9477cc2ea7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxl
+#include <s_fromfpl_main.c>
+weak_alias (__fromfpxl, fromfpxl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fsubl.c b/sysdeps/ieee754/ldbl-128ibm/s_fsubl.c
new file mode 100644
index 0000000000..aa6662de05
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fsubl.c
@@ -0,0 +1,27 @@
+/* Subtract long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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-narrow.h>
+
+float
+__fsubl (long double x, long double y)
+{
+ NARROW_SUB_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c b/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c
new file mode 100644
index 0000000000..5b24955353
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c
@@ -0,0 +1,35 @@
+/* Get NaN payload. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software 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;
+}
+weak_alias (__getpayloadl, getpayloadl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c b/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c
new file mode 100644
index 0000000000..91ce417992
--- /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-2018 Free Software 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..126abce2de 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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_llrintl.c b/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
index 860ede1e0b..9d4535103e 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round to long long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
index 9fba087d5b..de6a7b5be2 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
@@ -1,6 +1,6 @@
/* Round to long long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
index 743693bfd6..e499c9f604 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
@@ -131,8 +131,8 @@ __log1pl (long double xm1)
/* Test for NaN or infinity input. */
xhi = ldbl_high (xm1);
EXTRACT_WORDS (hx, lx, xhi);
- if (hx >= 0x7ff00000)
- return xm1;
+ if ((hx & 0x7fffffff) >= 0x7ff00000)
+ return xm1 + xm1 * xm1;
/* log1p(+- 0) = +- 0. */
if (((hx & 0x7fffffff) | lx) == 0)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c b/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
index 988de70c5a..05fe7fefdf 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
@@ -1,6 +1,6 @@
/* Round to long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -84,7 +85,7 @@ __lrintl (long double x)
/* Peg at max/min values, assuming that the above conversions do so.
Strictly speaking, we can return anything for values that overflow,
but this is more useful. */
- res = hi + lo;
+ res = (long int) ((unsigned long int) hi + (unsigned long int) lo);
/* This is just sign(hi) == sign(lo) && sign(res) != sign(hi). */
if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
@@ -105,27 +106,27 @@ __lrintl (long double x)
return res;
if (xh < 0.0)
- res -= 1;
+ res -= 1UL;
else
- res += 1;
+ res += 1UL;
break;
case FE_TOWARDZERO:
if (res > 0 && (xh < 0.0 || (xh == 0.0 && xl < 0.0)))
- res -= 1;
+ res -= 1UL;
else if (res < 0 && (xh > 0.0 || (xh == 0.0 && xl > 0.0)))
- res += 1;
+ res += 1UL;
return res;
break;
case FE_UPWARD:
if (xh > 0.0 || (xh == 0.0 && xl > 0.0))
- res += 1;
+ res += 1UL;
break;
case FE_DOWNWARD:
if (xh < 0.0 || (xh == 0.0 && xl < 0.0))
- res -= 1;
+ res -= 1UL;
break;
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
index aa48f680d4..bc8dda4c1d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
@@ -1,6 +1,6 @@
/* Round to long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -80,7 +81,7 @@ __lroundl (long double x)
/* Peg at max/min values, assuming that the above conversions do so.
Strictly speaking, we can return anything for values that overflow,
but this is more useful. */
- res = hi + lo;
+ res = (long int) ((unsigned long int) hi + (unsigned long int) lo);
/* This is just sign(hi) == sign(lo) && sign(res) != sign(hi). */
if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
@@ -92,21 +93,21 @@ __lroundl (long double x)
hi = res;
if (xh > 0.5)
{
- res += 1;
+ res += 1UL;
}
else if (xh == 0.5)
{
if (xl > 0.0 || (xl == 0.0 && res >= 0))
- res += 1;
+ res += 1UL;
}
else if (-xh > 0.5)
{
- res -= 1;
+ res -= 1UL;
}
else if (-xh == 0.5)
{
if (xl < 0.0 || (xl == 0.0 && res <= 0))
- res -= 1;
+ res -= 1UL;
}
if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_modfl.c b/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
index 260cc3e33c..1dc6c40e9c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
@@ -36,7 +36,7 @@ static const long double one = 1.0;
long double __modfl(long double x, long double *iptr)
{
int64_t i0,i1,j0;
- u_int64_t i;
+ uint64_t i;
double xhi, xlo;
ldbl_unpack (x, &xhi, &xlo);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
index 08134edd10..bd691f3310 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values without raising inexact.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software 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,110 +17,5 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* This has been coded in assembler because GCC makes such a mess of it
- when it's coded in C. */
-
-#include <math.h>
-#include <math_private.h>
-#include <fenv.h>
-#include <math_ldbl_opt.h>
-#include <float.h>
-#include <ieee754.h>
-
-
-long double
-__nearbyintl (long double x)
-{
- fenv_t env;
- static const long double TWO52 = 4503599627370496.0L;
- union ibm_extended_long_double u;
- u.ld = x;
-
- if (!isfinite (u.d[0].d))
- return x;
- else if (fabs (u.d[0].d) < TWO52)
- {
- double xh = u.d[0].d;
- double high = u.d[0].d;
- feholdexcept (&env);
- if (high > 0.0)
- {
- high += TWO52;
- high -= TWO52;
- if (high == -0.0) high = 0.0;
- }
- else if (high < 0.0)
- {
- high -= TWO52;
- high += TWO52;
- if (high == 0.0) high = -0.0;
- }
- if (u.d[1].d > 0.0 && (xh - high == 0.5))
- high += 1.0;
- else if (u.d[1].d < 0.0 && (-(xh - high) == 0.5))
- high -= 1.0;
- u.d[0].d = high;
- u.d[1].d = 0.0;
- math_force_eval (u.d[0]);
- math_force_eval (u.d[1]);
- fesetenv (&env);
- }
- else if (fabs (u.d[1].d) < TWO52 && u.d[1].d != 0.0)
- {
- double high = u.d[0].d, low = u.d[1].d, tau;
- /* In this case we have to round the low double and handle any
- adjustment to the high double that may be caused by rounding
- (up). This is complicated by the fact that the high double
- may already be rounded and the low double may have the
- opposite sign to compensate. */
- feholdexcept (&env);
- if (u.d[0].d > 0.0)
- {
- if (u.d[1].d > 0.0)
- {
- /* If the high/low doubles are the same sign then simply
- round the low double. */
- }
- else if (u.d[1].d < 0.0)
- {
- /* Else the high double is pre rounded and we need to
- adjust for that. */
-
- tau = __nextafter (u.d[0].d, 0.0);
- tau = (u.d[0].d - tau) * 2.0;
- high -= tau;
- low += tau;
- }
- low += TWO52;
- low -= TWO52;
- }
- else if (u.d[0].d < 0.0)
- {
- if (u.d[1].d < 0.0)
- {
- /* If the high/low doubles are the same sign then simply
- round the low double. */
- }
- else if (u.d[1].d > 0.0)
- {
- /* Else the high double is pre rounded and we need to
- adjust for that. */
- tau = __nextafter (u.d[0].d, 0.0);
- tau = (u.d[0].d - tau) * 2.0;
- high -= tau;
- low += tau;
- }
- low = TWO52 - low;
- low = -(low - TWO52);
- }
- u.d[0].d = high + low;
- u.d[1].d = high - u.d[0].d + low;
- math_force_eval (u.d[0]);
- math_force_eval (u.d[1]);
- fesetenv (&env);
- }
-
- return u.ld;
-}
-
-long_double_symbol (libm, __nearbyintl, nearbyintl);
+#define USE_AS_NEARBYINTL
+#include "s_rintl.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c b/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
index 515aa1ef5b..e29f7d60a3 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
@@ -27,6 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
@@ -87,6 +88,9 @@ long double __nextafterl(long double x, long double y)
math_force_eval (u); /* raise underflow flag */
__set_errno (ERANGE);
}
+ /* Avoid returning -0 in FE_DOWNWARD mode. */
+ if (x == 0.0L)
+ return 0.0L;
return x;
}
/* If the high double is an exact power of two and the low
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c b/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
index d8f4fc6523..8456bd5145 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
@@ -27,6 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c b/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
index 7c5d1cc112..960ffd9aee 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
@@ -20,6 +20,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
@@ -43,7 +44,7 @@ float __nexttowardf(float x, long double y)
if((long double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
float u;
- SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
+ SET_FLOAT_WORD(x,(uint32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nextupl.c b/sysdeps/ieee754/ldbl-128ibm/s_nextupl.c
new file mode 100644
index 0000000000..9b532a3a25
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nextupl.c
@@ -0,0 +1,79 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software 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 <math_ldbl_opt.h>
+
+/* Return the least floating-point number greater than X. */
+long double
+__nextupl (long double x)
+{
+ int64_t hx, ihx, lx;
+ double xhi, xlo, yhi;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo);
+ ihx = hx & 0x7fffffffffffffffLL;
+
+ if (ihx > 0x7ff0000000000000LL) /* x is nan. */
+ return x + x; /* Signal the nan. */
+ if (ihx == 0)
+ return LDBL_TRUE_MIN;
+
+ long double u;
+ if ((hx == 0x7fefffffffffffffLL) && (lx == 0x7c8ffffffffffffeLL))
+ return INFINITY;
+ if ((uint64_t) hx >= 0xfff0000000000000ULL)
+ {
+ u = -0x1.fffffffffffff7ffffffffffff8p+1023L;
+ return u;
+ }
+ if (ihx <= 0x0360000000000000LL)
+ { /* x <= LDBL_MIN. */
+ x += LDBL_TRUE_MIN;
+ if (x == 0.0L) /* Handle negative LDBL_TRUE_MIN case. */
+ x = -0.0L;
+ return x;
+ }
+ /* If the high double is an exact power of two and the low
+ double is the opposite sign, then 1ulp is one less than
+ what we might determine from the high double. Similarly
+ if X is an exact power of two, and negative, because
+ making it a little larger will result in the exponent
+ decreasing by one and normalisation of the mantissa. */
+ if ((hx & 0x000fffffffffffffLL) == 0
+ && ((lx != 0 && lx != 0x8000000000000000LL && (hx ^ lx) < 0)
+ || ((lx == 0 || lx == 0x8000000000000000LL) && hx < 0)))
+ ihx -= 1LL << 52;
+ if (ihx < (106LL << 52))
+ { /* ulp will denormal. */
+ INSERT_WORDS64 (yhi, ihx & (0x7ffLL << 52));
+ u = yhi * 0x1p-105;
+ }
+ else
+ {
+ INSERT_WORDS64 (yhi, (ihx & (0x7ffLL << 52)) - (105LL << 52));
+ u = yhi;
+ }
+ return x + u;
+}
+
+weak_alias (__nextupl, nextupl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_remquol.c b/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
index 20e17cc823..d87bce7982 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -31,7 +31,7 @@ long double
__remquol (long double x, long double y, int *quo)
{
int64_t hx,hy;
- u_int64_t sx,lx,ly,qs;
+ uint64_t sx,lx,ly,qs;
int cquo;
double xhi, xlo, yhi, ylo;
@@ -43,7 +43,9 @@ __remquol (long double x, long double y, int *quo)
EXTRACT_WORDS64 (ly, ylo);
sx = hx & 0x8000000000000000ULL;
qs = sx ^ (hy & 0x8000000000000000ULL);
+ ly ^= hy & 0x8000000000000000ULL;
hy &= 0x7fffffffffffffffLL;
+ lx ^= sx;
hx &= 0x7fffffffffffffffLL;
/* Purge off exception values. */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_rintl.c b/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
index 8c51ded1d6..f003609d95 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,10 +22,17 @@
#include <math.h>
#include <fenv.h>
+#include <math-barriers.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
+#ifdef USE_AS_NEARBYINTL
+# define rintl nearbyintl
+# define __rintl __nearbyintl
+#endif
+
long double
__rintl (long double x)
@@ -44,7 +51,11 @@ __rintl (long double x)
/* Long double arithmetic, including the canonicalisation below,
only works in round-to-nearest mode. */
+#ifdef USE_AS_NEARBYINTL
+ SET_RESTORE_ROUND_NOEX (FE_TONEAREST);
+#else
fesetround (FE_TONEAREST);
+#endif
/* Convert the high double to integer. */
orig_xh = xh;
@@ -103,8 +114,16 @@ __rintl (long double x)
if (orig_xh < 0.0)
xh = -__builtin_fabs (xh);
+#ifdef USE_AS_NEARBYINTL
+ math_force_eval (xh);
+ math_force_eval (xl);
+#else
fesetround (save_round);
+#endif
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c b/sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c
new file mode 100644
index 0000000000..84950e215f
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c
@@ -0,0 +1,70 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+long double
+__roundevenl (long double x)
+{
+ double xh, xl, hi;
+
+ ldbl_unpack (x, &xh, &xl);
+
+ if (xh != 0 && isfinite (xh))
+ {
+ hi = __roundeven (xh);
+ if (hi != xh)
+ {
+ /* The high part is not an integer; the low part only
+ affects the result if the high part is exactly half way
+ between two integers and the low part is nonzero in the
+ opposite direction to the rounding of the high part. */
+ double diff = hi - xh;
+ if (fabs (diff) == 0.5)
+ {
+ if (xl < 0 && diff > 0)
+ xh = hi - 1;
+ else if (xl > 0 && diff < 0)
+ xh = hi + 1;
+ else
+ xh = hi;
+ }
+ else
+ xh = hi;
+ xl = 0;
+ }
+ else
+ {
+ /* The high part is a nonzero integer. Rounding the low
+ part to nearest, ties round to even, is always correct,
+ as a high part that is an odd integer together with a low
+ part with magnitude 0.5 is not a valid long double. */
+ xl = __roundeven (xl);
+ xh = hi;
+ ldbl_canonicalize_int (&xh, &xl);
+ }
+ }
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
+
+ return ldbl_pack (xh, xl);
+}
+weak_alias (__roundevenl, roundevenl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_roundl.c b/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
index 20813ed366..94a62dcd6c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
when it's coded in C. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -38,47 +39,48 @@ __roundl (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- double orig_xh;
-
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- orig_xh = xh;
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is exactly 0.5. nearbyint
- rounds values halfway between integers to the nearest even
- integer. roundl must round away from zero.
- Also correct cases where nearbyint returns an incorrect value
- for LO. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
- if (xh == 0.5)
+ hi = __round (xh);
+ if (hi != xh)
{
- if (xl > 0.0 || (xl == 0.0 && orig_xh > 0.0))
- lo += 1.0;
+ /* The high part is not an integer; the low part only
+ affects the result if the high part is exactly half way
+ between two integers and the low part is nonzero with the
+ opposite sign. */
+ if (fabs (hi - xh) == 0.5)
+ {
+ if (xh > 0 && xl < 0)
+ xh = hi - 1;
+ else if (xh < 0 && xl > 0)
+ xh = hi + 1;
+ else
+ xh = hi;
+ }
+ else
+ xh = hi;
+ xl = 0;
}
- else if (-xh == 0.5)
+ else
{
- if (xl < 0.0 || (xl == 0.0 && orig_xh < 0.0))
- lo -= 1.0;
+ /* The high part is a nonzero integer. */
+ lo = __round (xl);
+ if (fabs (lo - xl) == 0.5)
+ {
+ if (xh > 0 && xl < 0)
+ xl = lo + 1;
+ else if (xh < 0 && lo > 0)
+ xl = lo - 1;
+ else
+ xl = lo;
+ }
+ else
+ xl = lo;
+ xh = hi;
+ ldbl_canonicalize_int (&xh, &xl);
}
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c
new file mode 100644
index 0000000000..bb07a3533a
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayloadl
+#include <s_setpayloadl_main.c>
+weak_alias (__setpayloadl, setpayloadl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c
new file mode 100644
index 0000000000..e5b49d03a2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c
@@ -0,0 +1,60 @@
+/* Set NaN payload. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3ff
+#define PAYLOAD_DIG 51
+#define EXPLICIT_MANT_DIG 52
+
+int
+FUNC (long double *x, long double payload)
+{
+ double hi, lo;
+ uint64_t hx, lx;
+
+ ldbl_unpack (payload, &hi, &lo);
+ EXTRACT_WORDS64 (hx, hi);
+ EXTRACT_WORDS64 (lx, lo);
+ int exponent = hx >> EXPLICIT_MANT_DIG;
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. All valid
+ arguments have the low part zero. */
+ if ((lx & 0x7fffffffffffffffULL) != 0
+ || exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && hx == 0))
+ || (hx & ((1ULL << (BIAS + EXPLICIT_MANT_DIG - exponent)) - 1)) != 0)
+ {
+ *x = 0.0L;
+ return 1;
+ }
+ if (hx != 0)
+ {
+ hx &= (1ULL << EXPLICIT_MANT_DIG) - 1;
+ hx |= 1ULL << EXPLICIT_MANT_DIG;
+ hx >>= BIAS + EXPLICIT_MANT_DIG - exponent;
+ }
+ hx |= 0x7ff0000000000000ULL | (SET_HIGH_BIT ? 0x8000000000000ULL : 0);
+ INSERT_WORDS64 (hi, hx);
+ *x = ldbl_pack (hi, 0.0);
+ return 0;
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c
new file mode 100644
index 0000000000..4e920360d4
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsigl
+#include <s_setpayloadl_main.c>
+weak_alias (__setpayloadsigl, setpayloadsigl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c b/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
index b4e8256329..2f7eb62ee8 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c
index fae4020a7b..ca4f9dff2f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c b/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
index e6457a1c1c..3504862402 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
@@ -41,6 +41,7 @@ static char rcsid[] = "$NetBSD: s_tanh.c,v 1.7 1995/05/10 20:48:22 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
static const long double one=1.0L, two=2.0L, tiny = 1.0e-300L;
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c b/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c
new file mode 100644
index 0000000000..9f20e01adc
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c
@@ -0,0 +1,63 @@
+/* Total order operation. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software 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;
+}
+weak_alias (__totalorderl, totalorderl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c b/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c
new file mode 100644
index 0000000000..d8027ffbb0
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c
@@ -0,0 +1,65 @@
+/* Total order operation on absolute values. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software 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;
+}
+weak_alias (__totalordermagl, totalordermagl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_truncl.c b/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
index df58b64b53..a915a01ac6 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
@@ -1,6 +1,6 @@
/* Truncate (toward zero) long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -35,51 +36,26 @@ __truncl (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- double orig_xh;
-
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- orig_xh = xh;
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is non-zero. nearbyint
- rounds values to the nearest integer, and values halfway
- between integers to the nearest even integer. floorl must
- round towards -Inf. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
-
- if (orig_xh < 0.0)
+ hi = __trunc (xh);
+ if (hi != xh)
{
- if (xh > 0.0 || (xh == 0.0 && xl > 0.0))
- lo += 1.0;
+ /* The high part is not an integer; the low part does not
+ affect the result. */
+ xh = hi;
+ xl = 0;
}
else
{
- if (xh < 0.0 || (xh == 0.0 && xl < 0.0))
- lo -= 1.0;
+ /* The high part is a nonzero integer. */
+ lo = xh > 0 ? __floor (xl) : __ceil (xl);
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize_int (&xh, &xl);
}
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
-
- /* Ensure we return -0 rather than +0 when appropriate. */
- if (orig_xh < 0.0)
- xh = -__builtin_fabs (xh);
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c
new file mode 100644
index 0000000000..2176aa0cdd
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpl
+#include <s_fromfpl_main.c>
+weak_alias (__ufromfpl, ufromfpl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c
new file mode 100644
index 0000000000..2901151312
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxl
+#include <s_fromfpl_main.c>
+weak_alias (__ufromfpxl, ufromfpxl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h
deleted file mode 100644
index d827112446..0000000000
--- a/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Convert string for NaN payload to corresponding NaN. For ldbl-128ibm.
- 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/>. */
-
-#define FLOAT long double
-#define SET_MANTISSA(flt, mant) \
- do \
- { \
- union ibm_extended_long_double u; \
- u.ld = (flt); \
- u.d[0].ieee_nan.mantissa0 = (mant) >> 32; \
- u.d[0].ieee_nan.mantissa1 = (mant); \
- if ((u.d[0].ieee.mantissa0 | u.d[0].ieee.mantissa1) != 0) \
- (flt) = u.ld; \
- } \
- while (0)
diff --git a/sysdeps/ieee754/ldbl-128ibm/strtold_l.c b/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
index a8181740a8..862fd533be 100644
--- a/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,6 @@
#include <math.h>
#include <stdlib.h>
#include <wchar.h>
-#include <xlocale.h>
/* The actual implementation for all floating point sizes is in strtod.c.
These macros tell it to produce the `long double' version, `strtold'. */
@@ -26,13 +25,13 @@
#define FLOAT long double
#define FLT LDBL
#ifdef USE_WIDE_CHAR
-extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, __locale_t);
+extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, locale_t);
# define STRTOF __new_wcstold_l
# define __STRTOF ____new_wcstold_l
# define ____STRTOF_INTERNAL ____wcstold_l_internal
# define STRTOF_NAN __wcstold_nan
#else
-extern long double ____new_strtold_l (const char *, char **, __locale_t);
+extern long double ____new_strtold_l (const char *, char **, locale_t);
# define STRTOF __new_strtold_l
# define __STRTOF ____new_strtold_l
# define ____STRTOF_INTERNAL ____strtold_l_internal
diff --git a/sysdeps/ieee754/ldbl-128ibm/t_expl.h b/sysdeps/ieee754/ldbl-128ibm/t_expl.h
new file mode 100644
index 0000000000..ca2481caa1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/t_expl.h
@@ -0,0 +1,970 @@
+/* Accurate table for expl().
+ Copyright (C) 1999-2018 Free Software 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/>. */
+
+/* __expl_table basically consists of four tables, T_EXPL_ARG{1,2} and
+ T_EXPL_RES{1,2}. All tables use positive and negative indexes, the 0 points
+ are marked by T_EXPL_* defines.
+ For ARG1 and RES1 tables lets B be 89 and S 256.0, for ARG2 and RES2 B is 65
+ and S 32768.0.
+ These table have the property that, for all integers -B <= i <= B
+ expl(__expl_table[T_EXPL_ARGN+2*i]+__expl_table[T_EXPL_ARGN+2*i+1]+r) ==
+ __expl_table[T_EXPL_RESN+i], __expl_table[T_EXPL_RESN+i] is some exact number
+ with the low 58 bits of the mantissa 0,
+ __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 */
+#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 */
+
+ -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 */
+#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 */
+
+ 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 */
+#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 */
+
+ 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 */
+#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 */
+};
diff --git a/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c
index 737c7c73fa..daeba17942 100644
--- a/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine and cosine tables.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
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..a2571649ec
--- /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-2018 Free Software 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_ldbl.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-fmodl-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c
new file mode 100644
index 0000000000..c717616e3c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c
@@ -0,0 +1,21 @@
+/* Test for ldbl-128ibm fmodl handling of equal values (bug 19602).
+ Copyright (C) 2016-2018 Free Software 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 FUNC fmodl
+#define SETUP
+#include "test-fmodrem-ldbl-128ibm.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c
new file mode 100644
index 0000000000..ce959faf90
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c
@@ -0,0 +1,84 @@
+/* Test for ldbl-128ibm fmodl etc. handling of equal values.
+ Copyright (C) 2016-2018 Free Software 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 <float.h>
+#include <math.h>
+#include <stdio.h>
+
+/* FUNC is defined to be the name of the function to test. */
+#define STRX(x) #x
+#define STR(x) STRX (x)
+#define SFUNC STR (FUNC)
+
+union u
+{
+ long double ld;
+ double d[2];
+};
+
+volatile union u p1 = { .d = { DBL_MIN, 0.0 } };
+volatile union u p2 = { .d = { DBL_MIN, -0.0 } };
+volatile union u m1 = { .d = { -DBL_MIN, 0.0 } };
+volatile union u m2 = { .d = { -DBL_MIN, -0.0 } };
+
+static int
+test_func (const char *s, long double x, long double y, long double expected)
+{
+ volatile long double r;
+ r = FUNC (x, y);
+ if (r != expected || copysignl (1.0, r) != copysignl (1.0, expected))
+ {
+ printf ("FAIL: " SFUNC " (%s)\n", s);
+ return 1;
+ }
+ else
+ {
+ printf ("PASS: " SFUNC " (%s)\n", s);
+ return 0;
+ }
+}
+
+#define TEST_FUNC(a, b, e) test_func (#a ", " #b, a, b, e)
+
+static int
+do_test (void)
+{
+ int result = 0;
+ SETUP;
+ result |= TEST_FUNC (p1.ld, p1.ld, 0.0L);
+ result |= TEST_FUNC (p1.ld, p2.ld, 0.0L);
+ result |= TEST_FUNC (p1.ld, m1.ld, 0.0L);
+ result |= TEST_FUNC (p1.ld, m2.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, p1.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, p2.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, m1.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, m2.ld, 0.0L);
+ result |= TEST_FUNC (m1.ld, p1.ld, -0.0L);
+ result |= TEST_FUNC (m1.ld, p2.ld, -0.0L);
+ result |= TEST_FUNC (m1.ld, m1.ld, -0.0L);
+ result |= TEST_FUNC (m1.ld, m2.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, p1.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, p2.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, m1.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, m2.ld, -0.0L);
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../../../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c
new file mode 100644
index 0000000000..829cf48c89
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c
@@ -0,0 +1,21 @@
+/* Test for ldbl-128ibm remainderl handling of equal values (bug 19677).
+ Copyright (C) 2016-2018 Free Software 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 FUNC remainderl
+#define SETUP fesetround (FE_DOWNWARD)
+#include "test-fmodrem-ldbl-128ibm.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c
new file mode 100644
index 0000000000..446e84146d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c
@@ -0,0 +1,30 @@
+/* Test for ldbl-128ibm remquol handling of equal values (bug 19677).
+ Copyright (C) 2016-2018 Free Software 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>
+
+static long double
+wrap_remquol (long double x, long double y)
+{
+ int quo;
+ return remquol (x, y, &quo);
+}
+
+#define FUNC wrap_remquol
+#define SETUP fesetround (FE_DOWNWARD)
+#include "test-fmodrem-ldbl-128ibm.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..6412e1781d
--- /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-2018 Free Software 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_ldbl.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/tst-strtold-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c
index 14dc683619..1893c04dda 100644
--- a/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c
+++ b/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c
@@ -1,5 +1,5 @@
/* Test for ldbl-128ibm strtold overflow to infinity (bug 14551).
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_expl.c b/sysdeps/ieee754/ldbl-128ibm/w_expl.c
deleted file mode 100644
index c9d44b61dd..0000000000
--- a/sysdeps/ieee754/ldbl-128ibm/w_expl.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <math.h>
-#include <math_private.h>
-#include <math_ldbl_opt.h>
-
-long double __expl(long double x) /* wrapper exp */
-{
- long double z;
- z = __ieee754_expl(x);
- if (_LIB_VERSION == _IEEE_)
- return z;
- if (isfinite(x))
- {
- if (!isfinite (z))
- return __kernel_standard_l(x,x,206); /* exp overflow */
- else if (z == 0.0L)
- return __kernel_standard_l(x,x,207); /* exp underflow */
- }
- return z;
-}
-hidden_def (__expl)
-long_double_symbol (libm, __expl, expl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_log1pl.c b/sysdeps/ieee754/ldbl-128ibm/w_log1pl.c
deleted file mode 100644
index 969fadc205..0000000000
--- a/sysdeps/ieee754/ldbl-128ibm/w_log1pl.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Wrapper for __log1pl that handles setting errno.
- Copyright (C) 2015-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_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log1pl.c>
-long_double_symbol (libm, __w_log1pl, log1pl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_scalblnl.c b/sysdeps/ieee754/ldbl-128ibm/w_scalblnl.c
deleted file mode 100644
index 7e73c9abf8..0000000000
--- a/sysdeps/ieee754/ldbl-128ibm/w_scalblnl.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Wrapper for __scalblnl handles setting errno.
- Copyright (C) 2014-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_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(name, alias)
-#include <math/w_scalblnl.c>
-long_double_symbol (libm, __w_scalblnl, scalblnl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c b/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
index da2e929175..e299c48748 100644
--- a/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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-64-128/e_ilogbl.c b/sysdeps/ieee754/ldbl-64-128/e_ilogbl.c
deleted file mode 100644
index 75a38e13ce..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/e_ilogbl.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/ldbl-128/e_ilogbl.c>
diff --git a/sysdeps/ieee754/ldbl-64-128/s_asinhl.c b/sysdeps/ieee754/ldbl-64-128/s_asinhl.c
deleted file mode 100644
index 4e8a541263..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_asinhl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_asinhl.c>
-long_double_symbol (libm, __asinhl, asinhl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_atanl.c b/sysdeps/ieee754/ldbl-64-128/s_atanl.c
deleted file mode 100644
index c23d14aade..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_atanl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_atanl.c>
-long_double_symbol (libm, __atanl, atanl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c b/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c
deleted file mode 100644
index ace5645277..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_cbrtl.c>
-long_double_symbol (libm, __cbrtl, cbrtl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_ceill.c b/sysdeps/ieee754/ldbl-64-128/s_ceill.c
deleted file mode 100644
index a646494f14..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_ceill.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_ceill.c>
-long_double_symbol (libm, __ceill, ceill);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
index 211e7240ac..11b42d04ba 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
@@ -1,9 +1,10 @@
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
+#include <libm-alias-ldouble.h>
+#if IS_IN (libc)
+# undef libm_alias_ldouble
+# define libm_alias_ldouble(from, to)
+#endif
#include <sysdeps/ieee754/ldbl-128/s_copysignl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __copysignl, copysignl);
-#else
+#if IS_IN (libc)
long_double_symbol (libc, __copysignl, copysignl);
#endif
diff --git a/sysdeps/ieee754/ldbl-64-128/s_cosl.c b/sysdeps/ieee754/ldbl-64-128/s_cosl.c
deleted file mode 100644
index 6a7e2e3162..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_cosl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_cosl.c>
-long_double_symbol (libm, __cosl, cosl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_erfl.c b/sysdeps/ieee754/ldbl-64-128/s_erfl.c
deleted file mode 100644
index c5f9bb3ac4..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_erfl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_erfl.c>
-long_double_symbol (libm, __erfl, erfl);
-long_double_symbol (libm, __erfcl, erfcl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_expm1l.c b/sysdeps/ieee754/ldbl-64-128/s_expm1l.c
deleted file mode 100644
index 4fb186127f..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_expm1l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_expm1l.c>
-long_double_symbol (libm, __expm1l, expm1l);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_fabsl.c b/sysdeps/ieee754/ldbl-64-128/s_fabsl.c
deleted file mode 100644
index 93d81d98bc..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_fabsl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_fabsl.c>
-long_double_symbol (libm, __fabsl, fabsl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_finitel.c b/sysdeps/ieee754/ldbl-64-128/s_finitel.c
index c0862a7485..5a16e6a277 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_finitel.c
@@ -1,3 +1,5 @@
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#undef weak_alias
#define weak_alias(n,a)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_floorl.c b/sysdeps/ieee754/ldbl-64-128/s_floorl.c
deleted file mode 100644
index 953043035e..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_floorl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_floorl.c>
-long_double_symbol (libm, __floorl, floorl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_fmal.c b/sysdeps/ieee754/ldbl-64-128/s_fmal.c
deleted file mode 100644
index 218aa52b35..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_fmal.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_fmal.c>
-long_double_symbol (libm, __fmal, fmal);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c b/sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c
index a10b6c3a1a..a14cea4001 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c
@@ -1,3 +1,5 @@
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#undef weak_alias
#define weak_alias(n,a)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_frexpl.c b/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
index c7b6aaaaee..73ac41e40c 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
@@ -1,9 +1,10 @@
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
+#include <libm-alias-ldouble.h>
+#if IS_IN (libc)
+# undef libm_alias_ldouble
+# define libm_alias_ldouble(from, to)
+#endif
#include <sysdeps/ieee754/ldbl-128/s_frexpl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __frexpl, frexpl);
-#else
+#if IS_IN (libc)
long_double_symbol (libc, __frexpl, frexpl);
#endif
diff --git a/sysdeps/ieee754/ldbl-64-128/s_isinfl.c b/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
index 6dab0e9223..94d0b06277 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
@@ -1,3 +1,5 @@
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#if !IS_IN (libm)
# undef weak_alias
diff --git a/sysdeps/ieee754/ldbl-64-128/s_isnanl.c b/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
index ad5ecc5281..9a7a29770c 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
@@ -1,3 +1,5 @@
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#if !IS_IN (libm)
# undef weak_alias
diff --git a/sysdeps/ieee754/ldbl-64-128/s_llrintl.c b/sysdeps/ieee754/ldbl-64-128/s_llrintl.c
deleted file mode 100644
index 1515f3abd7..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_llrintl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_llrintl.c>
-long_double_symbol (libm, __llrintl, llrintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_llroundl.c b/sysdeps/ieee754/ldbl-64-128/s_llroundl.c
deleted file mode 100644
index ca35dae491..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_llroundl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_llroundl.c>
-long_double_symbol (libm, __llroundl, llroundl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_log1pl.c b/sysdeps/ieee754/ldbl-64-128/s_log1pl.c
deleted file mode 100644
index 11d56bfe9f..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_log1pl.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/ldbl-128/s_log1pl.c>
diff --git a/sysdeps/ieee754/ldbl-64-128/s_logbl.c b/sysdeps/ieee754/ldbl-64-128/s_logbl.c
deleted file mode 100644
index 8ba8179feb..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_logbl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_logbl.c>
-long_double_symbol (libm, __logbl, logbl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_lrintl.c b/sysdeps/ieee754/ldbl-64-128/s_lrintl.c
deleted file mode 100644
index 56e69c94f9..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_lrintl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_lrintl.c>
-long_double_symbol (libm, __lrintl, lrintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_lroundl.c b/sysdeps/ieee754/ldbl-64-128/s_lroundl.c
deleted file mode 100644
index d5429e2384..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_lroundl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_lroundl.c>
-long_double_symbol (libm, __lroundl, lroundl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_modfl.c b/sysdeps/ieee754/ldbl-64-128/s_modfl.c
index fa4d3ad82a..7d7aeae111 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_modfl.c
@@ -1,9 +1,10 @@
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
+#include <libm-alias-ldouble.h>
+#if IS_IN (libc)
+# undef libm_alias_ldouble
+# define libm_alias_ldouble(from, to)
+#endif
#include <sysdeps/ieee754/ldbl-128/s_modfl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __modfl, modfl);
-#else
+#if IS_IN (libc)
long_double_symbol (libc, __modfl, modfl);
#endif
diff --git a/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c
deleted file mode 100644
index a6d0a313fd..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_nearbyintl.c>
-long_double_symbol (libm, __nearbyintl, nearbyintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_nextafterl.c b/sysdeps/ieee754/ldbl-64-128/s_nextafterl.c
index 64c663eda3..5218abea5e 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_nextafterl.c
@@ -4,3 +4,6 @@
#include <sysdeps/ieee754/ldbl-128/s_nextafterl.c>
long_double_symbol (libm, __nextafterl, nextafterl);
long_double_symbol (libm, __nexttowardl, nexttowardl);
+#undef weak_alias
+#define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+libm_alias_ldouble_other (__nextafter, nextafter)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_remquol.c b/sysdeps/ieee754/ldbl-64-128/s_remquol.c
deleted file mode 100644
index 16f0eb16a4..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_remquol.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_remquol.c>
-long_double_symbol (libm, __remquol, remquol);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_rintl.c b/sysdeps/ieee754/ldbl-64-128/s_rintl.c
deleted file mode 100644
index 19af9bbdcb..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_rintl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_rintl.c>
-long_double_symbol (libm, __rintl, rintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_roundl.c b/sysdeps/ieee754/ldbl-64-128/s_roundl.c
deleted file mode 100644
index 3fa99d6f2a..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_roundl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_roundl.c>
-long_double_symbol (libm, __roundl, roundl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_scalblnl.c b/sysdeps/ieee754/ldbl-64-128/s_scalblnl.c
deleted file mode 100644
index 97181d29b9..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_scalblnl.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_scalblnl.c>
diff --git a/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c b/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c
deleted file mode 100644
index 15af1b2849..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_scalbnl.c>
diff --git a/sysdeps/ieee754/ldbl-64-128/s_signbitl.c b/sysdeps/ieee754/ldbl-64-128/s_signbitl.c
index 850db7386a..39e0c34b6c 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_signbitl.c
@@ -1,3 +1,5 @@
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#undef weak_alias
#define weak_alias(n,a)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_sincosl.c b/sysdeps/ieee754/ldbl-64-128/s_sincosl.c
deleted file mode 100644
index ce0d4e2887..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_sincosl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_sincosl.c>
-long_double_symbol (libm, __sincosl, sincosl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_sinl.c b/sysdeps/ieee754/ldbl-64-128/s_sinl.c
deleted file mode 100644
index ebc20affdb..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_sinl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_sinl.c>
-long_double_symbol (libm, __sinl, sinl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_tanhl.c b/sysdeps/ieee754/ldbl-64-128/s_tanhl.c
deleted file mode 100644
index ede93930cd..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_tanhl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_tanhl.c>
-long_double_symbol (libm, __tanhl, tanhl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_tanl.c b/sysdeps/ieee754/ldbl-64-128/s_tanl.c
deleted file mode 100644
index 6e635dfdc9..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_tanl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_tanl.c>
-long_double_symbol (libm, __tanl, tanl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_truncl.c b/sysdeps/ieee754/ldbl-64-128/s_truncl.c
deleted file mode 100644
index 6311479d01..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_truncl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_truncl.c>
-long_double_symbol (libm, __truncl, truncl);
diff --git a/sysdeps/ieee754/ldbl-64-128/strtold_l.c b/sysdeps/ieee754/ldbl-64-128/strtold_l.c
index a8181740a8..448c26bbd0 100644
--- a/sysdeps/ieee754/ldbl-64-128/strtold_l.c
+++ b/sysdeps/ieee754/ldbl-64-128/strtold_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software 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,10 +15,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <bits/floatn.h>
+
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# define strtof128_l __hide_strtof128_l
+# define wcstof128_l __hide_wcstof128_l
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
#include <math.h>
#include <stdlib.h>
#include <wchar.h>
-#include <xlocale.h>
/* The actual implementation for all floating point sizes is in strtod.c.
These macros tell it to produce the `long double' version, `strtold'. */
@@ -26,13 +37,13 @@
#define FLOAT long double
#define FLT LDBL
#ifdef USE_WIDE_CHAR
-extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, __locale_t);
+extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, locale_t);
# define STRTOF __new_wcstold_l
# define __STRTOF ____new_wcstold_l
# define ____STRTOF_INTERNAL ____wcstold_l_internal
# define STRTOF_NAN __wcstold_nan
#else
-extern long double ____new_strtold_l (const char *, char **, __locale_t);
+extern long double ____new_strtold_l (const char *, char **, locale_t);
# define STRTOF __new_strtold_l
# define __STRTOF ____new_strtold_l
# define ____STRTOF_INTERNAL ____strtold_l_internal
@@ -58,3 +69,23 @@ long_double_symbol (libc, ___new_strtold_l, strtold_l);
long_double_symbol (libc, ____new_strtold_l, __strtold_l);
# endif
#endif
+
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# undef strtof128_l
+# undef wcstof128_l
+# ifdef USE_WIDE_CHAR
+weak_alias (____new_wcstold_l, wcstof128_l)
+# else
+weak_alias (____new_strtold_l, strtof128_l)
+# endif
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (____new_wcstold_l, wcstof64x_l)
+# else
+weak_alias (____new_strtold_l, strtof64x_l)
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-64-128/w_expl.c b/sysdeps/ieee754/ldbl-64-128/w_expl.c
deleted file mode 100644
index 2a402b04c0..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/w_expl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/w_expl.c>
-long_double_symbol (libm, __expl, expl);
diff --git a/sysdeps/ieee754/ldbl-64-128/w_log1pl.c b/sysdeps/ieee754/ldbl-64-128/w_log1pl.c
deleted file mode 100644
index 969fadc205..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/w_log1pl.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Wrapper for __log1pl that handles setting errno.
- Copyright (C) 2015-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_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log1pl.c>
-long_double_symbol (libm, __w_log1pl, log1pl);
diff --git a/sysdeps/ieee754/ldbl-64-128/w_scalblnl.c b/sysdeps/ieee754/ldbl-64-128/w_scalblnl.c
deleted file mode 100644
index 05d4dfe05b..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/w_scalblnl.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Wrapper for __scalblnl handles setting errno.
- Copyright (C) 2014-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_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(name, alias)
-#include <math/w_scalblnl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __w_scalblnl, scalblnl);
-#else
-long_double_symbol (libc, __w_scalblnl, scalblnl);
-#endif
diff --git a/sysdeps/ieee754/ldbl-96/Makefile b/sysdeps/ieee754/ldbl-96/Makefile
new file mode 100644
index 0000000000..790f670e44
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/Makefile
@@ -0,0 +1,21 @@
+# Makefile for sysdeps/ieee754/ldbl-96.
+# Copyright (C) 2016-2018 Free Software 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..e1ee1356b7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/bits/iscanonical.h
@@ -0,0 +1,54 @@
+/* Define iscanonical macro. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software 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__));
+#define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1)
+#define __iscanonical(x) ((void) (__typeof (x)) (x), 1)
+#if __HAVE_DISTINCT_FLOAT128
+# define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1)
+#endif
+
+/* 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. */
+#ifndef __cplusplus
+# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x))
+#else
+/* In C++ mode, __MATH_TG cannot be used, because it relies on
+ __builtin_types_compatible_p, which is a C-only builtin. On the
+ other hand, overloading provides the means to distinguish between
+ the floating-point types. The overloading resolution will match
+ the correct parameter (regardless of type qualifiers (i.e.: const
+ and volatile)). */
+extern "C++" {
+inline int iscanonical (float __val) { return __iscanonicalf (__val); }
+inline int iscanonical (double __val) { return __iscanonical (__val); }
+inline int iscanonical (long double __val) { return __iscanonicall (__val); }
+# if __HAVE_DISTINCT_FLOAT128
+inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); }
+# endif
+}
+#endif /* __cplusplus */
diff --git a/sysdeps/ieee754/ldbl-96/bits/long-double.h b/sysdeps/ieee754/ldbl-96/bits/long-double.h
new file mode 100644
index 0000000000..28488e0b05
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/bits/long-double.h
@@ -0,0 +1,20 @@
+/* Properties of long double type. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software 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 published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/>. */
+
+/* long double is distinct from double, so there is nothing to
+ define here. */
diff --git a/sysdeps/ieee754/ldbl-96/e_acoshl.c b/sysdeps/ieee754/ldbl-96/e_acoshl.c
index cf9a6db0ef..56b04d4cc4 100644
--- a/sysdeps/ieee754/ldbl-96/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-96/e_acoshl.c
@@ -39,7 +39,7 @@ long double
__ieee754_acoshl(long double x)
{
long double t;
- u_int32_t se,i0,i1;
+ uint32_t se,i0,i1;
GET_LDOUBLE_WORDS(se,i0,i1,x);
if(se<0x3fff || se & 0x8000) { /* x < 1 */
return (x-x)/(x-x);
@@ -52,10 +52,10 @@ __ieee754_acoshl(long double x)
return 0.0; /* acosh(1) = 0 */
} else if (se > 0x4000) { /* 2**28 > x > 2 */
t=x*x;
- return __ieee754_logl(2.0*x-one/(x+__ieee754_sqrtl(t-one)));
+ return __ieee754_logl(2.0*x-one/(x+sqrtl(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pl(t+__ieee754_sqrtl(2.0*t+t*t));
+ return __log1pl(t+sqrtl(2.0*t+t*t));
}
}
strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/sysdeps/ieee754/ldbl-96/e_asinl.c b/sysdeps/ieee754/ldbl-96/e_asinl.c
index f52b931459..806906a58a 100644
--- a/sysdeps/ieee754/ldbl-96/e_asinl.c
+++ b/sysdeps/ieee754/ldbl-96/e_asinl.c
@@ -61,6 +61,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double
one = 1.0L,
@@ -96,7 +97,7 @@ __ieee754_asinl (long double x)
{
long double t, w, p, q, c, r, s;
int32_t ix;
- u_int32_t se, i0, i1, k;
+ uint32_t se, i0, i1, k;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -132,7 +133,7 @@ __ieee754_asinl (long double x)
t = w * 0.5;
p = t * (pS0 + t * (pS1 + t * (pS2 + t * (pS3 + t * (pS4 + t * pS5)))));
q = qS0 + t * (qS1 + t * (qS2 + t * (qS3 + t * (qS4 + t))));
- s = __ieee754_sqrtl (t);
+ s = sqrtl (t);
if (ix >= 0x3ffef999)
{ /* if |x| > 0.975 */
w = p / q;
diff --git a/sysdeps/ieee754/ldbl-96/e_atanhl.c b/sysdeps/ieee754/ldbl-96/e_atanhl.c
index b99a83c6ee..7312f84329 100644
--- a/sysdeps/ieee754/ldbl-96/e_atanhl.c
+++ b/sysdeps/ieee754/ldbl-96/e_atanhl.c
@@ -34,7 +34,9 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double one = 1.0, huge = 1e4900L;
@@ -45,7 +47,7 @@ __ieee754_atanhl(long double x)
{
long double t;
int32_t ix;
- u_int32_t se,i0,i1;
+ uint32_t se,i0,i1;
GET_LDOUBLE_WORDS(se,i0,i1,x);
ix = se&0x7fff;
if ((ix+((((i0&0x7fffffff)|i1)|(-((i0&0x7fffffff)|i1)))>>31))>0x3fff)
diff --git a/sysdeps/ieee754/ldbl-96/e_coshl.c b/sysdeps/ieee754/ldbl-96/e_coshl.c
index dd22cae363..1edf2c1542 100644
--- a/sysdeps/ieee754/ldbl-96/e_coshl.c
+++ b/sysdeps/ieee754/ldbl-96/e_coshl.c
@@ -44,7 +44,7 @@ __ieee754_coshl (long double x)
{
long double t,w;
int32_t ex;
- u_int32_t mx,lx;
+ uint32_t mx,lx;
/* High word of |x|. */
GET_LDOUBLE_WORDS(ex,mx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-96/e_gammal_r.c b/sysdeps/ieee754/ldbl-96/e_gammal_r.c
index 8dd7a03918..fc7a5c55dc 100644
--- a/sysdeps/ieee754/ldbl-96/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-96/e_gammal_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
@@ -100,7 +101,7 @@ gammal_positive (long double x, int *exp2_adj)
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)
+ * sqrtl (2 * M_PIl / x_adj)
/ prod);
exp_adj += x_eps * __ieee754_logl (x_adj);
long double bsum = gamma_coeff[NCOEFF - 1];
@@ -115,7 +116,7 @@ gammal_positive (long double x, int *exp2_adj)
long double
__ieee754_gammal_r (long double x, int *signgamp)
{
- u_int32_t es, hx, lx;
+ uint32_t es, hx, lx;
long double ret;
GET_LDOUBLE_WORDS (es, hx, lx, x);
diff --git a/sysdeps/ieee754/ldbl-96/e_hypotl.c b/sysdeps/ieee754/ldbl-96/e_hypotl.c
index ee3a07055b..f664e30c98 100644
--- a/sysdeps/ieee754/ldbl-96/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-96/e_hypotl.c
@@ -48,11 +48,12 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
long double __ieee754_hypotl(long double x, long double y)
{
long double a,b,t1,t2,y1,y2,w;
- u_int32_t j,k,ea,eb;
+ uint32_t j,k,ea,eb;
GET_LDOUBLE_EXP(ea,x);
ea &= 0x7fff;
@@ -65,9 +66,11 @@ long double __ieee754_hypotl(long double x, long double y)
k=0;
if(__builtin_expect(ea > 0x5f3f,0)) { /* a>2**8000 */
if(ea == 0x7fff) { /* Inf or NaN */
- u_int32_t exp __attribute__ ((unused));
- u_int32_t high,low;
+ uint32_t exp __attribute__ ((unused));
+ uint32_t high,low;
w = a+b; /* for sNaN */
+ if (issignaling (a) || issignaling (b))
+ return w;
GET_LDOUBLE_WORDS(exp,high,low,a);
if(((high&0x7fffffff)|low)==0) w = a;
GET_LDOUBLE_WORDS(exp,high,low,b);
@@ -81,8 +84,8 @@ long double __ieee754_hypotl(long double x, long double y)
}
if(__builtin_expect(eb < 0x20bf, 0)) { /* b < 2**-8000 */
if(eb == 0) { /* subnormal b or 0 */
- u_int32_t exp __attribute__ ((unused));
- u_int32_t high,low;
+ uint32_t exp __attribute__ ((unused));
+ uint32_t high,low;
GET_LDOUBLE_WORDS(exp,high,low,b);
if((high|low)==0) return a;
SET_LDOUBLE_WORDS(t1, 0x7ffd, 0x80000000, 0); /* t1=2^16382 */
@@ -111,13 +114,13 @@ long double __ieee754_hypotl(long double x, long double y)
/* medium size a and b */
w = a-b;
if (w>b) {
- u_int32_t high;
+ uint32_t high;
GET_LDOUBLE_MSW(high,a);
SET_LDOUBLE_WORDS(t1,ea,high,0);
t2 = a-t1;
- w = __ieee754_sqrtl(t1*t1-(b*(-b)-t2*(a+t1)));
+ w = sqrtl(t1*t1-(b*(-b)-t2*(a+t1)));
} else {
- u_int32_t high;
+ uint32_t high;
GET_LDOUBLE_MSW(high,b);
a = a+a;
SET_LDOUBLE_WORDS(y1,eb,high,0);
@@ -125,10 +128,10 @@ long double __ieee754_hypotl(long double x, long double y)
GET_LDOUBLE_MSW(high,a);
SET_LDOUBLE_WORDS(t1,ea+1,high,0);
t2 = a - t1;
- w = __ieee754_sqrtl(t1*y1-(w*(-w)-(t1*y2+t2*b)));
+ w = sqrtl(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
- u_int32_t exp;
+ uint32_t exp;
t1 = 1.0;
GET_LDOUBLE_EXP(exp,t1);
SET_LDOUBLE_EXP(t1,exp+k);
diff --git a/sysdeps/ieee754/ldbl-96/e_j0l.c b/sysdeps/ieee754/ldbl-96/e_j0l.c
index a536054cde..e720ae9558 100644
--- a/sysdeps/ieee754/ldbl-96/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-96/e_j0l.c
@@ -72,6 +72,7 @@
*/
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
static long double pzero (long double), qzero (long double);
@@ -108,7 +109,7 @@ __ieee754_j0l (long double x)
{
long double z, s, c, ss, cc, r, u, v;
int32_t ix;
- u_int32_t se;
+ uint32_t se;
GET_LDOUBLE_EXP (se, x);
ix = se & 0x7fff;
@@ -133,12 +134,12 @@ __ieee754_j0l (long double x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
if (__glibc_unlikely (ix > 0x4080)) /* 2^129 */
- z = (invsqrtpi * cc) / __ieee754_sqrtl (x);
+ z = (invsqrtpi * cc) / sqrtl (x);
else
{
u = pzero (x);
v = qzero (x);
- z = invsqrtpi * (u * cc - v * ss) / __ieee754_sqrtl (x);
+ z = invsqrtpi * (u * cc - v * ss) / sqrtl (x);
}
return z;
}
@@ -194,7 +195,7 @@ __ieee754_y0l (long double x)
{
long double z, s, c, ss, cc, u, v;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -235,12 +236,12 @@ __ieee754_y0l (long double x)
ss = z / cc;
}
if (__glibc_unlikely (ix > 0x4080)) /* 1e39 */
- z = (invsqrtpi * ss) / __ieee754_sqrtl (x);
+ z = (invsqrtpi * ss) / sqrtl (x);
else
{
u = pzero (x);
v = qzero (x);
- z = invsqrtpi * (u * ss + v * cc) / __ieee754_sqrtl (x);
+ z = invsqrtpi * (u * ss + v * cc) / sqrtl (x);
}
return z;
}
@@ -352,7 +353,7 @@ pzero (long double x)
const long double *p, *q;
long double z, r, s;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -490,7 +491,7 @@ qzero (long double x)
const long double *p, *q;
long double s, r, z;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
diff --git a/sysdeps/ieee754/ldbl-96/e_j1l.c b/sysdeps/ieee754/ldbl-96/e_j1l.c
index e8a7349cf4..581615d563 100644
--- a/sysdeps/ieee754/ldbl-96/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-96/e_j1l.c
@@ -75,6 +75,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static long double pone (long double), qone (long double);
@@ -112,7 +113,7 @@ __ieee754_j1l (long double x)
{
long double z, c, r, s, ss, cc, u, v, y;
int32_t ix;
- u_int32_t se;
+ uint32_t se;
GET_LDOUBLE_EXP (se, x);
ix = se & 0x7fff;
@@ -137,12 +138,12 @@ __ieee754_j1l (long double x)
* y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
*/
if (__glibc_unlikely (ix > 0x4080))
- z = (invsqrtpi * cc) / __ieee754_sqrtl (y);
+ z = (invsqrtpi * cc) / sqrtl (y);
else
{
u = pone (y);
v = qone (y);
- z = invsqrtpi * (u * cc - v * ss) / __ieee754_sqrtl (y);
+ z = invsqrtpi * (u * cc - v * ss) / sqrtl (y);
}
if (se & 0x8000)
return -z;
@@ -195,7 +196,7 @@ __ieee754_y1l (long double x)
{
long double z, s, c, ss, cc, u, v;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -231,12 +232,12 @@ __ieee754_y1l (long double x)
* to compute the worse one.
*/
if (__glibc_unlikely (ix > 0x4080))
- z = (invsqrtpi * ss) / __ieee754_sqrtl (x);
+ z = (invsqrtpi * ss) / sqrtl (x);
else
{
u = pone (x);
v = qone (x);
- z = invsqrtpi * (u * ss + v * cc) / __ieee754_sqrtl (x);
+ z = invsqrtpi * (u * ss + v * cc) / sqrtl (x);
}
return z;
}
@@ -362,7 +363,7 @@ pone (long double x)
const long double *p, *q;
long double z, r, s;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -507,9 +508,9 @@ static long double
qone (long double x)
{
const long double *p, *q;
- static long double s, r, z;
+ long double s, r, z;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
diff --git a/sysdeps/ieee754/ldbl-96/e_jnl.c b/sysdeps/ieee754/ldbl-96/e_jnl.c
index 92f96921a7..394921f564 100644
--- a/sysdeps/ieee754/ldbl-96/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-96/e_jnl.c
@@ -60,6 +60,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double
invsqrtpi = 5.64189583547756286948079e-1L, two = 2.0e0L, one = 1.0e0L;
@@ -69,7 +70,7 @@ static const long double zero = 0.0L;
long double
__ieee754_jnl (int n, long double x)
{
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
int32_t i, ix, sgn;
long double a, b, temp, di, ret;
long double z, w;
@@ -142,7 +143,7 @@ __ieee754_jnl (int n, long double x)
temp = c - s;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
@@ -302,7 +303,7 @@ strong_alias (__ieee754_jnl, __jnl_finite)
long double
__ieee754_ynl (int n, long double x)
{
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
int32_t i, ix;
int32_t sign;
long double a, b, temp, ret;
@@ -371,7 +372,7 @@ __ieee754_ynl (int n, long double x)
temp = s + c;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
diff --git a/sysdeps/ieee754/ldbl-96/e_lgammal_r.c b/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
index 9862fe8d5c..200421f5cc 100644
--- a/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
@@ -91,9 +91,9 @@
*
*/
-#include <libc-internal.h>
#include <math.h>
#include <math_private.h>
+#include <libc-diag.h>
static const long double
half = 0.5L,
@@ -208,7 +208,7 @@ sin_pi (long double x)
{
long double y, z;
int n, ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -275,7 +275,7 @@ __ieee754_lgammal_r (long double x, int *signgamp)
{
long double t, y, z, nadj, p, p1, p2, q, r, w;
int i, ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
*signgamp = 1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
diff --git a/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
index 0d8e64675c..f67805f2d3 100644
--- a/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
+++ b/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
@@ -1,5 +1,5 @@
/* Extended-precision floating point argument reduction.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on quad-precision code by Jakub Jelinek <jj@ultra.linux.cz>
@@ -186,7 +186,7 @@ __ieee754_rem_pio2l (long double x, long double *y)
{
double tx[3], ty[3];
int32_t se, j0;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
int sx;
int n, exp;
diff --git a/sysdeps/ieee754/ldbl-96/e_sinhl.c b/sysdeps/ieee754/ldbl-96/e_sinhl.c
index 095b142621..a4b39783bc 100644
--- a/sysdeps/ieee754/ldbl-96/e_sinhl.c
+++ b/sysdeps/ieee754/ldbl-96/e_sinhl.c
@@ -39,6 +39,7 @@ static char rcsid[] = "$NetBSD: $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double one = 1.0, shuge = 1.0e4931L;
@@ -46,7 +47,7 @@ long double
__ieee754_sinhl(long double x)
{
long double t,w,h;
- u_int32_t jx,ix,i0,i1;
+ uint32_t jx,ix,i0,i1;
/* Words of |x|. */
GET_LDOUBLE_WORDS(jx,i0,i1,x);
diff --git a/sysdeps/ieee754/ldbl-96/gamma_product.c b/sysdeps/ieee754/ldbl-96/gamma_product.c
index 419d11598f..f1b65e12e2 100644
--- a/sysdeps/ieee754/ldbl-96/gamma_product.c
+++ b/sysdeps/ieee754/ldbl-96/gamma_product.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <float.h>
diff --git a/sysdeps/ieee754/ldbl-96/gamma_productl.c b/sysdeps/ieee754/ldbl-96/gamma_productl.c
index 849b57d95d..ed0c166d78 100644
--- a/sysdeps/ieee754/ldbl-96/gamma_productl.c
+++ b/sysdeps/ieee754/ldbl-96/gamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/k_cosl.c b/sysdeps/ieee754/ldbl-96/k_cosl.c
index 08b11b3733..da20385210 100644
--- a/sysdeps/ieee754/ldbl-96/k_cosl.c
+++ b/sysdeps/ieee754/ldbl-96/k_cosl.c
@@ -1,5 +1,5 @@
/* Extended-precision floating point cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on quad-precision cosine by Jakub Jelinek <jj@ultra.linux.cz>
diff --git a/sysdeps/ieee754/ldbl-96/k_sinl.c b/sysdeps/ieee754/ldbl-96/k_sinl.c
index 6ba7ceddc0..2549f71d19 100644
--- a/sysdeps/ieee754/ldbl-96/k_sinl.c
+++ b/sysdeps/ieee754/ldbl-96/k_sinl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on quad-precision sine by Jakub Jelinek <jj@ultra.linux.cz>
@@ -23,6 +23,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
/* The polynomials have not been optimized for extended-precision and
may contain more terms than needed. */
diff --git a/sysdeps/ieee754/ldbl-96/k_tanl.c b/sysdeps/ieee754/ldbl-96/k_tanl.c
index 0c050c112f..9b5151baa2 100644
--- a/sysdeps/ieee754/ldbl-96/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-96/k_tanl.c
@@ -57,9 +57,11 @@
*/
#include <float.h>
-#include <libc-internal.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libc-diag.h>
+
static const long double
one = 1.0L,
pio4hi = 0xc.90fdaa22168c235p-4L,
diff --git a/sysdeps/ieee754/ldbl-96/ldbl2mpn.c b/sysdeps/ieee754/ldbl-96/ldbl2mpn.c
index fe7002f640..0805051723 100644
--- a/sysdeps/ieee754/ldbl-96/ldbl2mpn.c
+++ b/sysdeps/ieee754/ldbl-96/ldbl2mpn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/lgamma_negl.c b/sysdeps/ieee754/ldbl-96/lgamma_negl.c
index 99ecf7e85f..6d2e0b7165 100644
--- a/sysdeps/ieee754/ldbl-96/lgamma_negl.c
+++ b/sysdeps/ieee754/ldbl-96/lgamma_negl.c
@@ -1,5 +1,5 @@
/* lgammal expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/lgamma_product.c b/sysdeps/ieee754/ldbl-96/lgamma_product.c
index e3ba72d8e4..1eb99c40a5 100644
--- a/sysdeps/ieee754/ldbl-96/lgamma_product.c
+++ b/sysdeps/ieee754/ldbl-96/lgamma_product.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/lgamma_productl.c b/sysdeps/ieee754/ldbl-96/lgamma_productl.c
index de67cbe665..9141a3177a 100644
--- a/sysdeps/ieee754/ldbl-96/lgamma_productl.c
+++ b/sysdeps/ieee754/ldbl-96/lgamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/sysdeps/ieee754/ldbl-96/math-nan-payload-ldouble.h b/sysdeps/ieee754/ldbl-96/math-nan-payload-ldouble.h
new file mode 100644
index 0000000000..ab2542c097
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/math-nan-payload-ldouble.h
@@ -0,0 +1,29 @@
+/* NaN payload handling for ldbl-96.
+ Copyright (C) 1997-2018 Free Software 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 SET_NAN_PAYLOAD(flt, mant) \
+ do \
+ { \
+ union ieee854_long_double u; \
+ u.d = (flt); \
+ u.ieee_nan.mantissa0 = (mant) >> 32; \
+ u.ieee_nan.mantissa1 = (mant); \
+ if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0) \
+ (flt) = u.d; \
+ } \
+ while (0)
diff --git a/sysdeps/ieee754/ldbl-96/math_ldbl.h b/sysdeps/ieee754/ldbl-96/math_ldbl.h
index cca30657ce..99428f6eeb 100644
--- a/sysdeps/ieee754/ldbl-96/math_ldbl.h
+++ b/sysdeps/ieee754/ldbl-96/math_ldbl.h
@@ -1,11 +1,31 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+/* Manipulation of the bit representation of 'long double' quantities.
+ Copyright (C) 1999-2018 Free Software 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_LDBL_H_
+#define _MATH_LDBL_H_ 1
+
+#include <stdint.h>
+#include <endian.h>
/* A union which permits us to convert between a long double and
three 32 bit ints. */
-#if __FLOAT_WORD_ORDER == BIG_ENDIAN
+#if __FLOAT_WORD_ORDER == __BIG_ENDIAN
typedef union
{
@@ -14,22 +34,22 @@ typedef union
{
int sign_exponent:16;
unsigned int empty:16;
- u_int32_t msw;
- u_int32_t lsw;
+ uint32_t msw;
+ uint32_t lsw;
} parts;
} ieee_long_double_shape_type;
#endif
-#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
+#if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN
typedef union
{
long double value;
struct
{
- u_int32_t lsw;
- u_int32_t msw;
+ uint32_t lsw;
+ uint32_t msw;
int sign_exponent:16;
unsigned int empty:16;
} parts;
@@ -96,3 +116,5 @@ do { \
se_u.parts.sign_exponent = (exp); \
(d) = se_u.value; \
} while (0)
+
+#endif /* math_ldbl.h */
diff --git a/sysdeps/ieee754/ldbl-96/mpn2ldbl.c b/sysdeps/ieee754/ldbl-96/mpn2ldbl.c
index 6159d7dabf..8cbf28256b 100644
--- a/sysdeps/ieee754/ldbl-96/mpn2ldbl.c
+++ b/sysdeps/ieee754/ldbl-96/mpn2ldbl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/printf_fphex.c b/sysdeps/ieee754/ldbl-96/printf_fphex.c
index 65bf538590..45d97447a7 100644
--- a/sysdeps/ieee754/ldbl-96/printf_fphex.c
+++ b/sysdeps/ieee754/ldbl-96/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/s_asinhl.c b/sysdeps/ieee754/ldbl-96/s_asinhl.c
index da49ea5988..2b9ae1f677 100644
--- a/sysdeps/ieee754/ldbl-96/s_asinhl.c
+++ b/sysdeps/ieee754/ldbl-96/s_asinhl.c
@@ -32,6 +32,8 @@ static char rcsid[] = "$NetBSD: $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
static const long double
one = 1.000000000000000000000e+00L, /* 0x3FFF, 0x00000000, 0x00000000 */
@@ -54,12 +56,12 @@ long double __asinhl(long double x)
} else {
long double xa = fabsl(x);
if (ix>0x4000) { /* 2**34 > |x| > 2.0 */
- w = __ieee754_logl(2.0*xa+one/(__ieee754_sqrtl(xa*xa+one)+xa));
+ w = __ieee754_logl(2.0*xa+one/(sqrtl(xa*xa+one)+xa));
} else { /* 2.0 > |x| > 2**-28 */
t = xa*xa;
- w =__log1pl(xa+t/(one+__ieee754_sqrtl(one+t)));
+ w =__log1pl(xa+t/(one+sqrtl(one+t)));
}
}
return __copysignl(w, x);
}
-weak_alias (__asinhl, asinhl)
+libm_alias_ldouble (__asinh, asinh)
diff --git a/sysdeps/ieee754/ldbl-96/s_cbrtl.c b/sysdeps/ieee754/ldbl-96/s_cbrtl.c
index 42849ab517..67cf86dd7a 100644
--- a/sysdeps/ieee754/ldbl-96/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-96/s_cbrtl.c
@@ -1,5 +1,5 @@
/* Compute cubic root of double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dirk Alboth <dirka@uni-paderborn.de> and
Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#define CBRT2 1.2599210498948731648 /* 2^(1/3) */
@@ -67,4 +68,4 @@ __cbrtl (long double x)
u -= (u - (x / (u * u))) * third;
return u;
}
-weak_alias (__cbrtl, cbrtl)
+libm_alias_ldouble (__cbrt, cbrt)
diff --git a/sysdeps/ieee754/ldbl-96/s_copysignl.c b/sysdeps/ieee754/ldbl-96/s_copysignl.c
index b1c442452f..3c16d54783 100644
--- a/sysdeps/ieee754/ldbl-96/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-96/s_copysignl.c
@@ -26,13 +26,14 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double __copysignl(long double x, long double y)
{
- u_int32_t es1,es2;
+ uint32_t es1,es2;
GET_LDOUBLE_EXP(es1,x);
GET_LDOUBLE_EXP(es2,y);
SET_LDOUBLE_EXP(x,(es1&0x7fff)|(es2&0x8000));
return x;
}
-weak_alias (__copysignl, copysignl)
+libm_alias_ldouble (__copysign, copysign)
diff --git a/sysdeps/ieee754/ldbl-96/s_cosl.c b/sysdeps/ieee754/ldbl-96/s_cosl.c
index 8b0b7d3cc2..324e5b9663 100644
--- a/sysdeps/ieee754/ldbl-96/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-96/s_cosl.c
@@ -52,6 +52,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double __cosl(long double x)
{
@@ -85,4 +86,4 @@ long double __cosl(long double x)
}
}
}
-weak_alias (__cosl, cosl)
+libm_alias_ldouble (__cos, cos)
diff --git a/sysdeps/ieee754/ldbl-96/s_daddl.c b/sysdeps/ieee754/ldbl-96/s_daddl.c
new file mode 100644
index 0000000000..d1e3c17bc7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_daddl.c
@@ -0,0 +1,33 @@
+/* Add long double (ldbl-96) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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 f32xaddf64x __hide_f32xaddf64x
+#define f64addf64x __hide_f64addf64x
+#include <math.h>
+#undef f32xaddf64x
+#undef f64addf64x
+
+#include <math-narrow.h>
+
+double
+__daddl (long double x, long double y)
+{
+ NARROW_ADD_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_double_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-96/s_ddivl.c b/sysdeps/ieee754/ldbl-96/s_ddivl.c
new file mode 100644
index 0000000000..9c266d1ff3
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_ddivl.c
@@ -0,0 +1,33 @@
+/* Divide long double (ldbl-96) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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 f32xdivf64x __hide_f32xdivf64x
+#define f64divf64x __hide_f64divf64x
+#include <math.h>
+#undef f32xdivf64x
+#undef f64divf64x
+
+#include <math-narrow.h>
+
+double
+__ddivl (long double x, long double y)
+{
+ NARROW_DIV_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_double_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-96/s_dmull.c b/sysdeps/ieee754/ldbl-96/s_dmull.c
new file mode 100644
index 0000000000..a717b0aa07
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_dmull.c
@@ -0,0 +1,33 @@
+/* Multiply long double (ldbl-96) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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 f32xmulf64x __hide_f32xmulf64x
+#define f64mulf64x __hide_f64mulf64x
+#include <math.h>
+#undef f32xmulf64x
+#undef f64mulf64x
+
+#include <math-narrow.h>
+
+double
+__dmull (long double x, long double y)
+{
+ NARROW_MUL_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_double_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-96/s_dsubl.c b/sysdeps/ieee754/ldbl-96/s_dsubl.c
new file mode 100644
index 0000000000..5a855790f6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_dsubl.c
@@ -0,0 +1,33 @@
+/* Subtract long double (ldbl-96) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software 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 f32xsubf64x __hide_f32xsubf64x
+#define f64subf64x __hide_f64subf64x
+#include <math.h>
+#undef f32xsubf64x
+#undef f64subf64x
+
+#include <math-narrow.h>
+
+double
+__dsubl (long double x, long double y)
+{
+ NARROW_SUB_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_double_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-96/s_erfl.c b/sysdeps/ieee754/ldbl-96/s_erfl.c
index d00adb1000..1e42df70a7 100644
--- a/sysdeps/ieee754/ldbl-96/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-96/s_erfl.c
@@ -108,6 +108,8 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
static const long double
tiny = 1e-4931L,
@@ -254,7 +256,7 @@ __erfl (long double x)
{
long double R, S, P, Q, s, y, z, r;
int32_t ix, i;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -335,13 +337,13 @@ __erfl (long double x)
return r / x - one;
}
-weak_alias (__erfl, erfl)
+libm_alias_ldouble (__erf, erf)
long double
__erfcl (long double x)
{
int32_t hx, ix;
long double R, S, P, Q, s, y, z, r;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -448,4 +450,4 @@ __erfcl (long double x)
}
}
-weak_alias (__erfcl, erfcl)
+libm_alias_ldouble (__erfc, erfc)
diff --git a/sysdeps/ieee754/ldbl-96/s_faddl.c b/sysdeps/ieee754/ldbl-96/s_faddl.c
new file mode 100644
index 0000000000..4164774cd4
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_faddl.c
@@ -0,0 +1,31 @@
+/* Add long double (ldbl-96) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32addf64x __hide_f32addf64x
+#include <math.h>
+#undef f32addf64x
+
+#include <math-narrow.h>
+
+float
+__faddl (long double x, long double y)
+{
+ NARROW_ADD_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_float_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-96/s_fdivl.c b/sysdeps/ieee754/ldbl-96/s_fdivl.c
new file mode 100644
index 0000000000..ccb87ccd15
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fdivl.c
@@ -0,0 +1,31 @@
+/* Divide long double (ldbl-96) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32divf64x __hide_f32divf64x
+#include <math.h>
+#undef f32divf64x
+
+#include <math-narrow.h>
+
+float
+__fdivl (long double x, long double y)
+{
+ NARROW_DIV_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_float_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-96/s_fma.c b/sysdeps/ieee754/ldbl-96/s_fma.c
index ab45bcfce2..986879cda5 100644
--- a/sysdeps/ieee754/ldbl-96/s_fma.c
+++ b/sysdeps/ieee754/ldbl-96/s_fma.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -21,7 +21,9 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-double.h>
/* This implementation uses rounding to odd to avoid problems with
double rounding. See a paper by Boldo and Melquiond:
@@ -30,14 +32,12 @@
double
__fma (double x, double y, double z)
{
- if (__glibc_unlikely (isinf (z)))
- {
- /* If z is Inf, but x and y are finite, the result should be
- z rather than NaN. */
- if (isfinite (x) && isfinite (y))
- return (z + x) + y;
- return (x * y) + z;
- }
+ if (__glibc_unlikely (!isfinite (x) || !isfinite (y)))
+ return x * y + z;
+ else if (__glibc_unlikely (!isfinite (z)))
+ /* If z is Inf, but x and y are finite, the result should be z
+ rather than NaN. */
+ return (z + x) + y;
/* Ensure correct sign of exact 0 + 0. */
if (__glibc_unlikely ((x == 0 || y == 0) && z == 0))
@@ -97,5 +97,5 @@ __fma (double x, double y, double z)
return u.d;
}
#ifndef __fma
-weak_alias (__fma, fma)
+libm_alias_double (__fma, fma)
#endif
diff --git a/sysdeps/ieee754/ldbl-96/s_fmal.c b/sysdeps/ieee754/ldbl-96/s_fmal.c
index f1467fda3d..0b261fd17a 100644
--- a/sysdeps/ieee754/ldbl-96/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-96/s_fmal.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -21,7 +21,9 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include <tininess.h>
/* This implementation uses rounding to odd to avoid problems with
@@ -293,4 +295,4 @@ __fmal (long double x, long double y, long double z)
return v.d * 0x1p-130L;
}
}
-weak_alias (__fmal, fmal)
+libm_alias_ldouble (__fma, fma)
diff --git a/sysdeps/ieee754/ldbl-96/s_fmull.c b/sysdeps/ieee754/ldbl-96/s_fmull.c
new file mode 100644
index 0000000000..b7582526a6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fmull.c
@@ -0,0 +1,31 @@
+/* Multiply long double (ldbl-96) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32mulf64x __hide_f32mulf64x
+#include <math.h>
+#undef f32mulf64x
+
+#include <math-narrow.h>
+
+float
+__fmull (long double x, long double y)
+{
+ NARROW_MUL_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_float_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-96/s_frexpl.c b/sysdeps/ieee754/ldbl-96/s_frexpl.c
index ab217a659b..7c31ed9936 100644
--- a/sysdeps/ieee754/ldbl-96/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-96/s_frexpl.c
@@ -31,6 +31,7 @@ static char rcsid[] = "$NetBSD: $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
static const long double
#if LDBL_MANT_DIG == 64
@@ -42,11 +43,11 @@ two65 = 3.68934881474191032320e+19L; /* 0x4040, 0x80000000, 0x00000000 */
long double __frexpl(long double x, int *eptr)
{
- u_int32_t se, hx, ix, lx;
+ uint32_t se, hx, ix, lx;
GET_LDOUBLE_WORDS(se,hx,lx,x);
ix = 0x7fff&se;
*eptr = 0;
- if(ix==0x7fff||((ix|hx|lx)==0)) return x; /* 0,inf,nan */
+ if(ix==0x7fff||((ix|hx|lx)==0)) return x + x; /* 0,inf,nan */
if (ix==0x0000) { /* subnormal */
x *= two65;
GET_LDOUBLE_EXP(se,x);
@@ -58,4 +59,4 @@ long double __frexpl(long double x, int *eptr)
SET_LDOUBLE_EXP(x,se);
return x;
}
-weak_alias (__frexpl, frexpl)
+libm_alias_ldouble (__frexp, frexp)
diff --git a/sysdeps/ieee754/ldbl-96/s_fromfpl.c b/sysdeps/ieee754/ldbl-96/s_fromfpl.c
new file mode 100644
index 0000000000..bcedceea8e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/ldbl-96/s_fromfpl_main.c b/sysdeps/ieee754/ldbl-96/s_fromfpl_main.c
new file mode 100644
index 0000000000..6f24ccf488
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fromfpl_main.c
@@ -0,0 +1,85 @@
+/* Round to integer type. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software 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 <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x3fff
+#define MANT_DIG 64
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (long double x, int round, unsigned int width)
+{
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint16_t se;
+ uint32_t hx, lx;
+ GET_LDOUBLE_WORDS (se, hx, lx, x);
+ bool negative = (se & 0x8000) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ if ((hx | lx) == 0)
+ return 0;
+ int exponent = se & 0x7fff;
+ exponent -= BIAS;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+
+ uint64_t ix = (((uint64_t) hx) << 32) | lx;
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ if (exponent >= MANT_DIG - 1)
+ {
+ uret = ix;
+ /* Exponent 63; no shifting required. */
+ half_bit = false;
+ more_bits = false;
+ }
+ else if (exponent >= -1)
+ {
+ uint64_t h = 1ULL << (MANT_DIG - 2 - exponent);
+ half_bit = (ix & h) != 0;
+ more_bits = (ix & (h - 1)) != 0;
+ if (exponent == -1)
+ uret = 0;
+ else
+ uret = ix >> (MANT_DIG - 1 - exponent);
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/ldbl-96/s_fromfpxl.c b/sysdeps/ieee754/ldbl-96/s_fromfpxl.c
new file mode 100644
index 0000000000..0a342a22d1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/ldbl-96/s_fsubl.c b/sysdeps/ieee754/ldbl-96/s_fsubl.c
new file mode 100644
index 0000000000..54aaf68b74
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fsubl.c
@@ -0,0 +1,31 @@
+/* Subtract long double (ldbl-96) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software 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 f32subf64x __hide_f32subf64x
+#include <math.h>
+#undef f32subf64x
+
+#include <math-narrow.h>
+
+float
+__fsubl (long double x, long double y)
+{
+ NARROW_SUB_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_float_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-96/s_getpayloadl.c b/sysdeps/ieee754/ldbl-96/s_getpayloadl.c
new file mode 100644
index 0000000000..4b7b734f3d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_getpayloadl.c
@@ -0,0 +1,34 @@
+/* Get NaN payload. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.h>
+#include <stdint.h>
+
+long double
+__getpayloadl (const long double *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;
+}
+libm_alias_ldouble (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/ldbl-96/s_iscanonicall.c b/sysdeps/ieee754/ldbl-96/s_iscanonicall.c
new file mode 100644
index 0000000000..413c6bd42c
--- /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-2018 Free Software 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..b1dd41ecfd 100644
--- a/sysdeps/ieee754/ldbl-96/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-96/s_issignalingl.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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;
+ uint32_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_llrintl.c b/sysdeps/ieee754/ldbl-96/s_llrintl.c
index 592d51c607..d45a69a1f7 100644
--- a/sysdeps/ieee754/ldbl-96/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-96/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,6 +23,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
static const long double two63[2] =
{
@@ -35,7 +36,7 @@ long long int
__llrintl (long double x)
{
int32_t se,j0;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
long long int result;
long double w;
long double t;
@@ -88,4 +89,4 @@ __llrintl (long double x)
return sx ? -result : result;
}
-weak_alias (__llrintl, llrintl)
+libm_alias_ldouble (__llrint, llrint)
diff --git a/sysdeps/ieee754/ldbl-96/s_llroundl.c b/sysdeps/ieee754/ldbl-96/s_llroundl.c
index 483199d442..601fd0e644 100644
--- a/sysdeps/ieee754/ldbl-96/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-96/s_llroundl.c
@@ -1,5 +1,5 @@
/* Round long double value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,13 +22,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long long int
__llroundl (long double x)
{
int32_t j0;
- u_int32_t se, i1, i0;
+ uint32_t se, i1, i0;
long long int result;
int sign;
@@ -42,7 +43,7 @@ __llroundl (long double x)
return j0 < -1 ? 0 : sign;
else
{
- u_int32_t j = i0 + (0x40000000 >> j0);
+ uint32_t j = i0 + (0x40000000 >> j0);
if (j < i0)
{
j >>= 1;
@@ -59,7 +60,7 @@ __llroundl (long double x)
result = (((long long int) i0 << 32) | i1) << (j0 - 63);
else
{
- u_int32_t j = i1 + (0x80000000 >> (j0 - 31));
+ uint32_t j = i1 + (0x80000000 >> (j0 - 31));
result = (long long int) i0;
if (j < i1)
@@ -86,4 +87,4 @@ __llroundl (long double x)
return sign * result;
}
-weak_alias (__llroundl, llroundl)
+libm_alias_ldouble (__llround, llround)
diff --git a/sysdeps/ieee754/ldbl-96/s_lrintl.c b/sysdeps/ieee754/ldbl-96/s_lrintl.c
index bd902deb47..df3222c7f2 100644
--- a/sysdeps/ieee754/ldbl-96/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-96/s_lrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,6 +23,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
static const long double two63[2] =
{
@@ -35,7 +36,7 @@ long int
__lrintl (long double x)
{
int32_t se,j0;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
long int result;
long double w;
long double t;
@@ -123,4 +124,4 @@ __lrintl (long double x)
return sx ? -result : result;
}
-weak_alias (__lrintl, lrintl)
+libm_alias_ldouble (__lrint, lrint)
diff --git a/sysdeps/ieee754/ldbl-96/s_lroundl.c b/sysdeps/ieee754/ldbl-96/s_lroundl.c
index 3b43d77e72..0cc9f9c5d6 100644
--- a/sysdeps/ieee754/ldbl-96/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-96/s_lroundl.c
@@ -1,5 +1,5 @@
/* Round long double value to long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,13 +22,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long int
__lroundl (long double x)
{
int32_t j0;
- u_int32_t se, i1, i0;
+ uint32_t se, i1, i0;
long int result;
int sign;
@@ -42,7 +43,7 @@ __lroundl (long double x)
return j0 < -1 ? 0 : sign;
else
{
- u_int32_t j = i0 + (0x40000000 >> j0);
+ uint32_t j = i0 + (0x40000000 >> j0);
if (j < i0)
{
j >>= 1;
@@ -66,7 +67,7 @@ __lroundl (long double x)
result = ((long int) i0 << (j0 - 31)) | (i1 << (j0 - 63));
else
{
- u_int32_t j = i1 + (0x80000000 >> (j0 - 31));
+ uint32_t j = i1 + (0x80000000 >> (j0 - 31));
unsigned long int ures = i0;
if (j < i1)
@@ -108,4 +109,4 @@ __lroundl (long double x)
return sign * result;
}
-weak_alias (__lroundl, lroundl)
+libm_alias_ldouble (__lround, lround)
diff --git a/sysdeps/ieee754/ldbl-96/s_modfl.c b/sysdeps/ieee754/ldbl-96/s_modfl.c
index e9401d0f5d..380b6f0389 100644
--- a/sysdeps/ieee754/ldbl-96/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-96/s_modfl.c
@@ -26,6 +26,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
static const long double one = 1.0;
@@ -33,7 +34,7 @@ long double
__modfl(long double x, long double *iptr)
{
int32_t i0,i1,j0;
- u_int32_t i,se;
+ uint32_t i,se;
GET_LDOUBLE_WORDS(se,i0,i1,x);
j0 = (se&0x7fff)-0x3fff; /* exponent of x */
if(j0<32) { /* integer part in high x */
@@ -59,7 +60,7 @@ __modfl(long double x, long double *iptr)
SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
return x;
} else { /* fraction part in low x */
- i = ((u_int32_t)(0x7fffffff))>>(j0-32);
+ i = ((uint32_t)(0x7fffffff))>>(j0-32);
if((i1&i)==0) { /* x is integral */
*iptr = x;
SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
@@ -70,4 +71,4 @@ __modfl(long double x, long double *iptr)
}
}
}
-weak_alias (__modfl, modfl)
+libm_alias_ldouble (__modf, modf)
diff --git a/sysdeps/ieee754/ldbl-96/s_nexttoward.c b/sysdeps/ieee754/ldbl-96/s_nexttoward.c
index 3d0382eac9..1d8d9c7f91 100644
--- a/sysdeps/ieee754/ldbl-96/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-96/s_nexttoward.c
@@ -27,13 +27,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <float.h>
double __nexttoward(double x, long double y)
{
int32_t hx,ix,iy;
- u_int32_t lx,hy,ly,esy;
+ uint32_t lx,hy,ly,esy;
EXTRACT_WORDS(hx,lx,x);
GET_LDOUBLE_WORDS(esy,hy,ly,y);
diff --git a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
index ae7538942f..9a08e1c8ff 100644
--- a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
@@ -19,13 +19,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <float.h>
float __nexttowardf(float x, long double y)
{
int32_t hx,ix,iy;
- u_int32_t hy,ly,esy;
+ uint32_t hy,ly,esy;
GET_FLOAT_WORD(hx,x);
GET_LDOUBLE_WORDS(esy,hy,ly,y);
diff --git a/sysdeps/ieee754/ldbl-96/s_nextupl.c b/sysdeps/ieee754/ldbl-96/s_nextupl.c
new file mode 100644
index 0000000000..5dff32ce73
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_nextupl.c
@@ -0,0 +1,86 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.h>
+
+/* Return the least floating-point number greater than X. */
+long double
+__nextupl (long double x)
+{
+ uint32_t hx, ix;
+ uint32_t lx;
+ int32_t esx;
+
+ GET_LDOUBLE_WORDS (esx, hx, lx, x);
+ ix = esx & 0x7fff;
+
+ if (((ix == 0x7fff) && (((hx & 0x7fffffff) | lx) != 0))) /* x is nan. */
+ return x + x;
+ if ((ix | hx | lx) == 0)
+ return LDBL_TRUE_MIN;
+ if (esx >= 0)
+ { /* x > 0. */
+ if (isinf (x))
+ return x;
+ lx += 1;
+ if (lx == 0)
+ {
+ hx += 1;
+#if LDBL_MIN_EXP == -16381
+ if (hx == 0 || (esx == 0 && hx == 0x80000000))
+#else
+ if (hx == 0)
+#endif
+ {
+ esx += 1;
+ hx |= 0x80000000;
+ }
+ }
+ }
+ else
+ { /* x < 0. */
+ if (lx == 0)
+ {
+#if LDBL_MIN_EXP == -16381
+ if (hx <= 0x80000000 && esx != 0xffff8000)
+ {
+ esx -= 1;
+ hx = hx - 1;
+ if ((esx & 0x7fff) > 0)
+ hx |= 0x80000000;
+ }
+ else
+ hx -= 1;
+#else
+ if (ix != 0 && hx == 0x80000000)
+ hx = 0;
+ if (hx == 0)
+ esx -= 1;
+ hx -= 1;
+#endif
+ }
+ lx -= 1;
+ }
+ SET_LDOUBLE_WORDS (x, esx, hx, lx);
+ return x;
+}
+
+libm_alias_ldouble (__nextup, nextup)
diff --git a/sysdeps/ieee754/ldbl-96/s_remquol.c b/sysdeps/ieee754/ldbl-96/s_remquol.c
index 89b2630d46..88c5ea2084 100644
--- a/sysdeps/ieee754/ldbl-96/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-96/s_remquol.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
static const long double zero = 0.0;
@@ -29,7 +30,7 @@ long double
__remquol (long double x, long double p, int *quo)
{
int32_t ex,ep,hx,hp;
- u_int32_t sx,lx,lp;
+ uint32_t sx,lx,lp;
int cquo,qs;
GET_LDOUBLE_WORDS (ex, hx, lx, x);
@@ -108,4 +109,4 @@ __remquol (long double x, long double p, int *quo)
x = -x;
return x;
}
-weak_alias (__remquol, remquol)
+libm_alias_ldouble (__remquo, remquo)
diff --git a/sysdeps/ieee754/ldbl-96/s_roundevenl.c b/sysdeps/ieee754/ldbl-96/s_roundevenl.c
new file mode 100644
index 0000000000..be2e4fa49e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_roundevenl.c
@@ -0,0 +1,126 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.h>
+#include <stdint.h>
+
+#define BIAS 0x3fff
+#define MANT_DIG 64
+#define MAX_EXP (2 * BIAS + 1)
+
+long double
+__roundevenl (long double x)
+{
+ uint16_t se;
+ uint32_t hx, lx;
+ GET_LDOUBLE_WORDS (se, hx, lx, x);
+ int exponent = se & 0x7fff;
+ if (exponent >= BIAS + MANT_DIG - 1)
+ {
+ /* Integer, infinity or NaN. */
+ if (exponent == MAX_EXP)
+ /* Infinity or NaN; quiet signaling NaNs. */
+ return x + x;
+ else
+ return x;
+ }
+ else if (exponent >= BIAS + MANT_DIG - 32)
+ {
+ /* Not necessarily an integer; integer bit is in low word.
+ Locate the bits with exponents 0 and -1. */
+ int int_pos = (BIAS + MANT_DIG - 1) - exponent;
+ int half_pos = int_pos - 1;
+ uint32_t half_bit = 1U << half_pos;
+ uint32_t int_bit = 1U << int_pos;
+ if ((lx & (int_bit | (half_bit - 1))) != 0)
+ {
+ /* No need to test whether HALF_BIT is set. */
+ lx += half_bit;
+ if (lx < half_bit)
+ {
+ hx++;
+ if (hx == 0)
+ {
+ hx = 0x80000000;
+ se++;
+ }
+ }
+ }
+ lx &= ~(int_bit - 1);
+ }
+ else if (exponent == BIAS + MANT_DIG - 33)
+ {
+ /* Not necessarily an integer; integer bit is bottom of high
+ word, half bit is top of low word. */
+ if (((hx & 1) | (lx & 0x7fffffff)) != 0)
+ {
+ lx += 0x80000000;
+ if (lx < 0x80000000)
+ {
+ hx++;
+ if (hx == 0)
+ {
+ hx = 0x80000000;
+ se++;
+ }
+ }
+ }
+ lx = 0;
+ }
+ else if (exponent >= BIAS)
+ {
+ /* At least 1; not necessarily an integer, integer bit and half
+ bit are in the high word. Locate the bits with exponents 0
+ and -1. */
+ int int_pos = (BIAS + MANT_DIG - 33) - exponent;
+ int half_pos = int_pos - 1;
+ uint32_t half_bit = 1U << half_pos;
+ uint32_t int_bit = 1U << int_pos;
+ if (((hx & (int_bit | (half_bit - 1))) | lx) != 0)
+ {
+ hx += half_bit;
+ if (hx < half_bit)
+ {
+ hx = 0x80000000;
+ se++;
+ }
+ }
+ hx &= ~(int_bit - 1);
+ lx = 0;
+ }
+ else if (exponent == BIAS - 1 && (hx > 0x80000000 || lx != 0))
+ {
+ /* Interval (0.5, 1). */
+ se = (se & 0x8000) | 0x3fff;
+ hx = 0x80000000;
+ lx = 0;
+ }
+ else
+ {
+ /* Rounds to 0. */
+ se &= 0x8000;
+ hx = 0;
+ lx = 0;
+ }
+ SET_LDOUBLE_WORDS (x, se, hx, lx);
+ return x;
+}
+libm_alias_ldouble (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/ldbl-96/s_roundl.c b/sysdeps/ieee754/ldbl-96/s_roundl.c
index 4f35c4847b..c5c304cb2e 100644
--- a/sysdeps/ieee754/ldbl-96/s_roundl.c
+++ b/sysdeps/ieee754/ldbl-96/s_roundl.c
@@ -1,5 +1,5 @@
/* Round long double to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,16 +20,14 @@
#include <math.h>
#include <math_private.h>
-
-
-static const long double huge = 1.0e4930L;
+#include <libm-alias-ldouble.h>
long double
__roundl (long double x)
{
int32_t j0;
- u_int32_t se, i1, i0;
+ uint32_t se, i1, i0;
GET_LDOUBLE_WORDS (se, i0, i1, x);
j0 = (se & 0x7fff) - 0x3fff;
@@ -37,7 +35,6 @@ __roundl (long double x)
{
if (j0 < 0)
{
- math_force_eval (huge + x);
se &= 0x8000;
i0 = i1 = 0;
if (j0 == -1)
@@ -48,14 +45,12 @@ __roundl (long double x)
}
else
{
- u_int32_t i = 0x7fffffff >> j0;
+ uint32_t i = 0x7fffffff >> j0;
if (((i0 & i) | i1) == 0)
/* X is integral. */
return x;
- /* Raise inexact if x != 0. */
- math_force_eval (huge + x);
- u_int32_t j = i0 + (0x40000000 >> j0);
+ uint32_t j = i0 + (0x40000000 >> j0);
if (j < i0)
se += 1;
i0 = (j & ~i) | 0x80000000;
@@ -72,17 +67,15 @@ __roundl (long double x)
}
else
{
- u_int32_t i = 0xffffffff >> (j0 - 31);
+ uint32_t i = 0xffffffff >> (j0 - 31);
if ((i1 & i) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
- /* Raise inexact if x != 0. */
- u_int32_t j = i1 + (1 << (62 - j0));
+ uint32_t j = i1 + (1 << (62 - j0));
if (j < i1)
{
- u_int32_t k = i0 + 1;
+ uint32_t k = i0 + 1;
if (k < i0)
{
se += 1;
@@ -97,4 +90,4 @@ __roundl (long double x)
SET_LDOUBLE_WORDS (x, se, i0, i1);
return x;
}
-weak_alias (__roundl, roundl)
+libm_alias_ldouble (__round, round)
diff --git a/sysdeps/ieee754/ldbl-96/s_setpayloadl.c b/sysdeps/ieee754/ldbl-96/s_setpayloadl.c
new file mode 100644
index 0000000000..9f43c259ec
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_setpayloadl.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayloadl
+#include <s_setpayloadl_main.c>
+libm_alias_ldouble (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/ldbl-96/s_setpayloadl_main.c b/sysdeps/ieee754/ldbl-96/s_setpayloadl_main.c
new file mode 100644
index 0000000000..6b85bdf1a9
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_setpayloadl_main.c
@@ -0,0 +1,69 @@
+/* Set NaN payload. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3fff
+#define PAYLOAD_DIG 62
+#define EXPLICIT_MANT_DIG 63
+
+int
+FUNC (long double *x, long double payload)
+{
+ uint32_t hx, lx;
+ uint16_t exponent;
+ GET_LDOUBLE_WORDS (exponent, hx, lx, payload);
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. */
+ if (exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT
+ && exponent == 0 && hx == 0 && lx == 0)))
+ {
+ SET_LDOUBLE_WORDS (*x, 0, 0, 0);
+ return 1;
+ }
+ int shift = BIAS + EXPLICIT_MANT_DIG - exponent;
+ if (shift < 32
+ ? (lx & ((1U << shift) - 1)) != 0
+ : (lx != 0 || (hx & ((1U << (shift - 32)) - 1)) != 0))
+ {
+ SET_LDOUBLE_WORDS (*x, 0, 0, 0);
+ return 1;
+ }
+ if (exponent != 0)
+ {
+ if (shift >= 32)
+ {
+ lx = hx >> (shift - 32);
+ hx = 0;
+ }
+ else if (shift != 0)
+ {
+ lx = (lx >> shift) | (hx << (32 - shift));
+ hx >>= shift;
+ }
+ }
+ hx |= 0x80000000 | (SET_HIGH_BIT ? 0x40000000 : 0);
+ SET_LDOUBLE_WORDS (*x, 0x7fff, hx, lx);
+ return 0;
+}
diff --git a/sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c b/sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c
new file mode 100644
index 0000000000..cd82f295aa
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsigl
+#include <s_setpayloadl_main.c>
+libm_alias_ldouble (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/ldbl-96/s_signbitl.c b/sysdeps/ieee754/ldbl-96/s_signbitl.c
index ee5d77e27a..19953c180a 100644
--- a/sysdeps/ieee754/ldbl-96/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-96/s_signbitl.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/ldbl-96/s_sincosl.c b/sysdeps/ieee754/ldbl-96/s_sincosl.c
index ab32b73e7d..355c25dba9 100644
--- a/sysdeps/ieee754/ldbl-96/s_sincosl.c
+++ b/sysdeps/ieee754/ldbl-96/s_sincosl.c
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,6 +21,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
void
@@ -73,4 +74,4 @@ __sincosl (long double x, long double *sinx, long double *cosx)
}
}
}
-weak_alias (__sincosl, sincosl)
+libm_alias_ldouble (__sincos, sincos)
diff --git a/sysdeps/ieee754/ldbl-96/s_sinl.c b/sysdeps/ieee754/ldbl-96/s_sinl.c
index 11e1899822..cfbe9bf153 100644
--- a/sysdeps/ieee754/ldbl-96/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-96/s_sinl.c
@@ -52,6 +52,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double __sinl(long double x)
{
@@ -85,4 +86,4 @@ long double __sinl(long double x)
}
}
}
-weak_alias (__sinl, sinl)
+libm_alias_ldouble (__sin, sin)
diff --git a/sysdeps/ieee754/ldbl-96/s_tanhl.c b/sysdeps/ieee754/ldbl-96/s_tanhl.c
index 38edf9f75e..b1b3e0637b 100644
--- a/sysdeps/ieee754/ldbl-96/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-96/s_tanhl.c
@@ -45,6 +45,8 @@ static char rcsid[] = "$NetBSD: $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
static const long double one=1.0, two=2.0, tiny = 1.0e-4900L;
@@ -52,7 +54,7 @@ long double __tanhl(long double x)
{
long double t,z;
int32_t se;
- u_int32_t j0,j1,ix;
+ uint32_t j0,j1,ix;
/* High word of |x|. */
GET_LDOUBLE_WORDS(se,j0,j1,x);
@@ -87,4 +89,4 @@ long double __tanhl(long double x)
}
return (se&0x8000)? -z: z;
}
-weak_alias (__tanhl, tanhl)
+libm_alias_ldouble (__tanh, tanh)
diff --git a/sysdeps/ieee754/ldbl-96/s_tanl.c b/sysdeps/ieee754/ldbl-96/s_tanl.c
index 3fbe4a8f6b..b4163792c5 100644
--- a/sysdeps/ieee754/ldbl-96/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-96/s_tanl.c
@@ -51,6 +51,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double __tanl(long double x)
{
@@ -78,4 +79,4 @@ long double __tanl(long double x)
-1 -- n odd */
}
}
-weak_alias (__tanl, tanl)
+libm_alias_ldouble (__tan, tan)
diff --git a/sysdeps/ieee754/ldbl-96/s_totalorderl.c b/sysdeps/ieee754/ldbl-96/s_totalorderl.c
new file mode 100644
index 0000000000..f5be9bf28e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_totalorderl.c
@@ -0,0 +1,59 @@
+/* Total order operation. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.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)));
+}
+libm_alias_ldouble (__totalorder, totalorder)
diff --git a/sysdeps/ieee754/ldbl-96/s_totalordermagl.c b/sysdeps/ieee754/ldbl-96/s_totalordermagl.c
new file mode 100644
index 0000000000..18efefaee1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_totalordermagl.c
@@ -0,0 +1,53 @@
+/* Total order operation on absolute values. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software 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 <libm-alias-ldouble.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)));
+}
+libm_alias_ldouble (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/ldbl-96/s_ufromfpl.c b/sysdeps/ieee754/ldbl-96/s_ufromfpl.c
new file mode 100644
index 0000000000..22935e6ef7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_ufromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/ldbl-96/s_ufromfpxl.c b/sysdeps/ieee754/ldbl-96/s_ufromfpxl.c
new file mode 100644
index 0000000000..77a5423de8
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_ufromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h
deleted file mode 100644
index 2694b5ee34..0000000000
--- a/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Convert string for NaN payload to corresponding NaN. For ldbl-96.
- 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/>. */
-
-#define FLOAT long double
-#define SET_MANTISSA(flt, mant) \
- do \
- { \
- union ieee854_long_double u; \
- u.d = (flt); \
- u.ieee_nan.mantissa0 = (mant) >> 32; \
- u.ieee_nan.mantissa1 = (mant); \
- if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0) \
- (flt) = u.d; \
- } \
- while (0)
diff --git a/sysdeps/ieee754/ldbl-96/strtold_l.c b/sysdeps/ieee754/ldbl-96/strtold_l.c
index b51560e18a..145e64f766 100644
--- a/sysdeps/ieee754/ldbl-96/strtold_l.c
+++ b/sysdeps/ieee754/ldbl-96/strtold_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,4 +34,19 @@
#define MPN2FLOAT __mpn_construct_long_double
#define FLOAT_HUGE_VAL HUGE_VALL
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
#include <stdlib/strtod_l.c>
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstold_l, wcstof64x_l)
+# else
+weak_alias (strtold_l, strtof64x_l)
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-96/t_sincosl.c b/sysdeps/ieee754/ldbl-96/t_sincosl.c
index f00a182061..5d3531f677 100644
--- a/sysdeps/ieee754/ldbl-96/t_sincosl.c
+++ b/sysdeps/ieee754/ldbl-96/t_sincosl.c
@@ -1,5 +1,5 @@
/* Extended-precision floating point sine and cosine tables.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on quad-precision tables by Jakub Jelinek <jj@ultra.linux.cz>
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..cd63e01140
--- /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-2018 Free Software 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_ldbl.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..552a97783a
--- /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-2018 Free Software 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_ldbl.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/w_expl.c b/sysdeps/ieee754/ldbl-96/w_expl.c
deleted file mode 100644
index 5c7a1812bc..0000000000
--- a/sysdeps/ieee754/ldbl-96/w_expl.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <math_private.h>
-
-/* wrapper expl */
-long double
-__expl (long double x)
-{
- long double z = __ieee754_expl (x);
- if (__builtin_expect (!isfinite (z) || z == 0, 0)
- && isfinite (x) && _LIB_VERSION != _IEEE_)
- return __kernel_standard_l (x, x, 206 + !!signbit (x));
-
- return z;
-}
-hidden_def (__expl)
-weak_alias (__expl, expl)
diff --git a/sysdeps/ieee754/ldbl-96/x2y2m1.c b/sysdeps/ieee754/ldbl-96/x2y2m1.c
index 4119f42acc..afe7ab161b 100644
--- a/sysdeps/ieee754/ldbl-96/x2y2m1.c
+++ b/sysdeps/ieee754/ldbl-96/x2y2m1.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/x2y2m1l.c b/sysdeps/ieee754/ldbl-96/x2y2m1l.c
index 733742da04..392830c1b0 100644
--- a/sysdeps/ieee754/ldbl-96/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-96/x2y2m1l.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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 53091e410c..ef790adc77 100644
--- a/sysdeps/ieee754/ldbl-opt/Makefile
+++ b/sysdeps/ieee754/ldbl-opt/Makefile
@@ -24,11 +24,12 @@ 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 \
significand acos asin atan atan2 cos sin tan cosh sinh \
- tanh acosh asinh atanh exp log log10 exp10 pow10 expm1 \
+ tanh acosh asinh atanh exp log log10 exp10 expm1 \
log1p logb exp2 sqrt cbrt fabs floor j0 j1 y0 y1 erf erfc \
lgamma tgamma gamma rint nearbyint round trunc \
copysign fdim fmax fmin nextafter pow hypot fmod \
@@ -40,7 +41,11 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
isoc99_scanf isoc99_fscanf isoc99_sscanf \
isoc99_vscanf isoc99_vfscanf isoc99_vsscanf \
isoc99_wscanf isoc99_fwscanf isoc99_swscanf \
- isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf
+ isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf \
+ nextup nextdown totalorder totalordermag getpayload \
+ canonicalize setpayload setpayloadsig llogb fmaxmag fminmag \
+ roundeven fromfp ufromfp fromfpx ufromfpx fadd dadd \
+ fdiv ddiv fmul dmul fsub dsub
libnldbl-routines = $(libnldbl-calls:%=nldbl-%)
libnldbl-inhibit-o = $(object-suffixes)
libnldbl-static-only-routines = $(libnldbl-routines)
@@ -56,6 +61,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
@@ -81,6 +87,10 @@ CFLAGS-nldbl-csinh.c = -fno-builtin-csinhl
CFLAGS-nldbl-csqrt.c = -fno-builtin-csqrtl
CFLAGS-nldbl-ctan.c = -fno-builtin-ctanl
CFLAGS-nldbl-ctanh.c = -fno-builtin-ctanhl
+CFLAGS-nldbl-dadd.c = -fno-builtin-daddl
+CFLAGS-nldbl-ddiv.c = -fno-builtin-ddivl
+CFLAGS-nldbl-dmul.c = -fno-builtin-dmull
+CFLAGS-nldbl-dsub.c = -fno-builtin-dsubl
CFLAGS-nldbl-erf.c = -fno-builtin-erfl
CFLAGS-nldbl-erfc.c = -fno-builtin-erfcl
CFLAGS-nldbl-exp.c = -fno-builtin-expl
@@ -88,15 +98,24 @@ CFLAGS-nldbl-exp10.c = -fno-builtin-exp10l
CFLAGS-nldbl-exp2.c = -fno-builtin-exp2l
CFLAGS-nldbl-expm1.c = -fno-builtin-expm1l
CFLAGS-nldbl-fabs.c = -fno-builtin-fabsl
+CFLAGS-nldbl-fadd.c = -fno-builtin-faddl
CFLAGS-nldbl-fdim.c = -fno-builtin-fdiml
+CFLAGS-nldbl-fdiv.c = -fno-builtin-fdivl
CFLAGS-nldbl-finite.c = -fno-builtin-finitel
CFLAGS-nldbl-floor.c = -fno-builtin-floorl
CFLAGS-nldbl-fma.c = -fno-builtin-fmal
CFLAGS-nldbl-fmax.c = -fno-builtin-fmaxl
+CFLAGS-nldbl-fmaxmag.c = -fno-builtin-fmaxmagl
CFLAGS-nldbl-fmin.c = -fno-builtin-fminl
+CFLAGS-nldbl-fminmag.c = -fno-builtin-fminmagl
CFLAGS-nldbl-fmod.c = -fno-builtin-fmodl
+CFLAGS-nldbl-fmul.c = -fno-builtin-fmull
CFLAGS-nldbl-frexp.c = -fno-builtin-frexpl
+CFLAGS-nldbl-fromfp.c = -fno-builtin-fromfpl
+CFLAGS-nldbl-fromfpx.c = -fno-builtin-fromfpxl
+CFLAGS-nldbl-fsub.c = -fno-builtin-fsubl
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
@@ -107,6 +126,7 @@ CFLAGS-nldbl-jn.c = -fno-builtin-jnl
CFLAGS-nldbl-ldexp.c = -fno-builtin-ldexpl
CFLAGS-nldbl-lgamma.c = -fno-builtin-lgammal
CFLAGS-nldbl-lgamma_r.c = -fno-builtin-lgammal_r
+CFLAGS-nldbl-llogb.c = -fno-builtin-llogbl
CFLAGS-nldbl-llrint.c = -fno-builtin-llrintl
CFLAGS-nldbl-llround.c = -fno-builtin-llroundl
CFLAGS-nldbl-log.c = -fno-builtin-logl
@@ -120,17 +140,21 @@ CFLAGS-nldbl-modf.c = -fno-builtin-modfl
CFLAGS-nldbl-nan.c = -fno-builtin-nanl
CFLAGS-nldbl-nearbyint.c = -fno-builtin-nearbyintl
CFLAGS-nldbl-nextafter.c = -fno-builtin-nextafterl
+CFLAGS-nldbl-nextdown.c = -fno-builtin-nextdownl
CFLAGS-nldbl-nexttoward.c = -fno-builtin-nexttoward -fno-builtin-nexttowardl
CFLAGS-nldbl-nexttowardf.c = -fno-builtin-nexttowardf
+CFLAGS-nldbl-nextup.c = -fno-builtin-nextupl
CFLAGS-nldbl-pow.c = -fno-builtin-powl
-CFLAGS-nldbl-pow10.c = -fno-builtin-pow10l
CFLAGS-nldbl-remainder.c = -fno-builtin-remainderl -fno-builtin-dreml
CFLAGS-nldbl-remquo.c = -fno-builtin-remquol
CFLAGS-nldbl-rint.c = -fno-builtin-rintl
CFLAGS-nldbl-round.c = -fno-builtin-roundl
+CFLAGS-nldbl-roundeven.c = -fno-builtin-roundevenl
CFLAGS-nldbl-scalb.c = -fno-builtin-scalbl
CFLAGS-nldbl-scalbln.c = -fno-builtin-scalblnl
CFLAGS-nldbl-scalbn.c = -fno-builtin-scalbnl
+CFLAGS-nldbl-setpayload.c = -fno-builtin-setpayloadl
+CFLAGS-nldbl-setpayloadsig.c = -fno-builtin-setpayloadsigl
CFLAGS-nldbl-significand.c = -fno-builtin-significandl
CFLAGS-nldbl-sin.c = -fno-builtin-sinl
CFLAGS-nldbl-sincos.c = -fno-builtin-sincosl
@@ -139,9 +163,16 @@ 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-ufromfp.c = -fno-builtin-ufromfpl
+CFLAGS-nldbl-ufromfpx.c = -fno-builtin-ufromfpxl
CFLAGS-nldbl-y0.c = -fno-builtin-y0l
CFLAGS-nldbl-y1.c = -fno-builtin-y1l
CFLAGS-nldbl-yn.c = -fno-builtin-ynl
+tests += test-narrow-macros-ldbl-64
+CFLAGS-test-narrow-macros-ldbl-64.c += -mlong-double-64
+
endif
diff --git a/sysdeps/ieee754/ldbl-opt/Versions b/sysdeps/ieee754/ldbl-opt/Versions
index d3f0beaef2..af0c4a098c 100644
--- a/sysdeps/ieee754/ldbl-opt/Versions
+++ b/sysdeps/ieee754/ldbl-opt/Versions
@@ -97,4 +97,10 @@ libm {
sincosl; tanl; tanhl; truncl; expl; __finitel; __signbitl;
__fpclassifyl; nexttowardf; nexttoward; __nldbl_nexttowardf;
}
+ GLIBC_2.28 {
+ # Functions taking long double = double argument and rounding
+ # result to double (same as f32x*f64 functions, but those names
+ # are not reserved in TS 18661-1).
+ __nldbl_daddl; __nldbl_ddivl; __nldbl_dmull; __nldbl_dsubl;
+ }
}
diff --git a/sysdeps/ieee754/ldbl-opt/bits/long-double.h b/sysdeps/ieee754/ldbl-opt/bits/long-double.h
new file mode 100644
index 0000000000..69b33890ff
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/bits/long-double.h
@@ -0,0 +1,24 @@
+/* Properties of long double type. ldbl-opt version.
+ Copyright (C) 2016-2018 Free Software 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 published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 __NO_LONG_DOUBLE_MATH
+# define __LONG_DOUBLE_MATH_OPTIONAL 1
+# ifndef __LONG_DOUBLE_128__
+# define __NO_LONG_DOUBLE_MATH 1
+# endif
+#endif
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/libm-alias-double.h b/sysdeps/ieee754/ldbl-opt/libm-alias-double.h
new file mode 100644
index 0000000000..95f810f4eb
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/libm-alias-double.h
@@ -0,0 +1,72 @@
+/* Define aliases for libm double functions. ldbl-opt version.
+ Copyright (C) 2017-2018 Free Software 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 _LIBM_ALIAS_DOUBLE_H
+#define _LIBM_ALIAS_DOUBLE_H
+
+#include <bits/floatn.h>
+#include <math_ldbl_opt.h>
+#include <first-versions.h>
+#include <ldbl-compat-choose.h>
+
+#if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64
+# define libm_alias_double_other_r_f64(from, to, r) \
+ weak_alias (from ## r, to ## f64 ## r)
+#else
+# define libm_alias_double_other_r_f64(from, to, r)
+#endif
+
+#if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X
+# define libm_alias_double_other_r_f32x(from, to, r) \
+ weak_alias (from ## r, to ## f32x ## r)
+#else
+# define libm_alias_double_other_r_f32x(from, to, r)
+#endif
+
+/* Define _FloatN / _FloatNx aliases for a double libm function that
+ has internal name FROM ## R and public names TO ## suffix ## R for
+ each suffix of a supported _FloatN / _FloatNx floating-point type
+ with the same format as double. */
+#define libm_alias_double_other_r(from, to, r) \
+ libm_alias_double_other_r_f64 (from, to, r); \
+ libm_alias_double_other_r_f32x (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_double_other(from, to) \
+ libm_alias_double_other_r (from, to, )
+
+/* Define aliases for a double libm function that has internal name
+ FROM ## R and public names TO ## suffix ## R for each suffix of a
+ supported floating-point type with the same format as double. This
+ should only be used for functions where such public names exist for
+ _FloatN types, not for implementation-namespace exported names
+ (where there is one name per format, not per type) or for
+ obsolescent functions not provided for _FloatN types. */
+#define libm_alias_double_r(from, to, r) \
+ weak_alias (from ## r, to ## r); \
+ LONG_DOUBLE_COMPAT_CHOOSE_libm_ ## to ## l ## r \
+ (compat_symbol (libm, \
+ from ## r, \
+ to ## l ## r, \
+ FIRST_VERSION_libm_ ## to ## l ## r), ); \
+ libm_alias_double_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_double(from, to) libm_alias_double_r (from, to, )
+
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h b/sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h
new file mode 100644
index 0000000000..df9172b333
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h
@@ -0,0 +1,69 @@
+/* Define aliases for libm long double functions. ldbl-opt version.
+ Copyright (C) 2017-2018 Free Software 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 _LIBM_ALIAS_LDOUBLE_H
+#define _LIBM_ALIAS_LDOUBLE_H
+
+#include <bits/floatn.h>
+#include <math_ldbl_opt.h>
+#include <ldbl-compat-choose.h>
+
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# define libm_alias_ldouble_other_r_f128(from, to, r) \
+ weak_alias (from ## l ## r, to ## f128 ## r)
+#else
+# define libm_alias_ldouble_other_r_f128(from, to, r)
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define libm_alias_ldouble_other_r_f64x(from, to, r) \
+ weak_alias (from ## l ## r, to ## f64x ## r)
+#else
+# define libm_alias_ldouble_other_r_f64x(from, to, r)
+#endif
+
+/* Define _FloatN / _FloatNx aliases for a long double libm function
+ that has internal name FROM ## l ## R and public names TO ## suffix
+ ## R for each suffix of a supported _FloatN / _FloatNx
+ floating-point type with the same format as long double. */
+#define libm_alias_ldouble_other_r(from, to, r) \
+ libm_alias_ldouble_other_r_f128 (from, to, r); \
+ libm_alias_ldouble_other_r_f64x (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_ldouble_other(from, to) \
+ libm_alias_ldouble_other_r (from, to, )
+
+/* Define aliases for a long double libm function that has internal
+ name FROM ## l ## R and public names TO ## suffix ## R for each
+ suffix of a supported floating-point type with the same format as
+ long double. This should only be used for functions where such
+ public names exist for _FloatN types, not for
+ implementation-namespace exported names (where there is one name
+ per format, not per type) or for obsolescent functions not provided
+ for _FloatN types. */
+#define libm_alias_ldouble_r(from, to, r) \
+ LONG_DOUBLE_COMPAT_CHOOSE_libm_ ## to ## l ## r \
+ (long_double_symbol (libm, from ## l ## r, to ## l ## r), \
+ weak_alias (from ## l ## r, to ## l ## r)); \
+ libm_alias_ldouble_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_ldouble(from, to) libm_alias_ldouble_r (from, to, )
+
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h b/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
index af861c11ea..61ba784f86 100644
--- a/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
+++ b/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
@@ -36,9 +36,6 @@
#endif
#ifndef __ASSEMBLER__
-# include <math.h>
-# include <math_private.h>
-
/* Set temporarily to non-zero if long double should be considered
the same as double. */
extern __thread int __no_long_double attribute_tls_model_ie attribute_hidden;
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c b/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c
new file mode 100644
index 0000000000..a65d87458d
--- /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-2018 Free Software 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-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
index 35b7a69945..ffb5fabebe 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
@@ -1,5 +1,5 @@
/* *printf* family compatibility routines for IEEE double as long double
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@cygnus.com>, 2006.
@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <libioP.h>
+#include <math.h>
#include <wchar.h>
#include <printf.h>
#include <monetary.h>
@@ -333,8 +334,7 @@ __nldbl_wprintf (const wchar_t *fmt, ...)
int
attribute_compat_text_section
-__nldbl__IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap,
- int *errp)
+__nldbl__IO_vfscanf (FILE *s, const char *fmt, va_list ap, int *errp)
{
int res;
set_no_long_double ();
@@ -790,7 +790,7 @@ __nldbl_strfmon (char *s, size_t maxsize, const char *format, ...)
ssize_t
attribute_compat_text_section
-__nldbl___strfmon_l (char *s, size_t maxsize, __locale_t loc,
+__nldbl___strfmon_l (char *s, size_t maxsize, locale_t loc,
const char *format, ...)
{
va_list ap;
@@ -818,7 +818,7 @@ libc_hidden_def (__nldbl___vstrfmon)
ssize_t
attribute_compat_text_section
-__nldbl___vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
+__nldbl___vstrfmon_l (char *s, size_t maxsize, locale_t loc,
const char *format, va_list ap)
{
ssize_t res;
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
index 0c3c5ad24d..888f561cac 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
@@ -1,5 +1,5 @@
/* Prototypes for compatibility double == long double entry points.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@cygnus.com>, 2006.
@@ -24,6 +24,7 @@
#define __NO_LONG_DOUBLE_MATH 1
#include <stdarg.h>
#include <stdlib.h>
+#include <stdint.h>
#include <stdio.h>
#include <printf.h>
#include <wchar.h>
@@ -81,23 +82,30 @@ extern ssize_t __nldbl___vstrfmon (char *, size_t, const char *, va_list)
/* These don't use __typeof because they were not declared by the headers,
since we don't compile with _FORTIFY_SOURCE. */
extern int __nldbl___vfprintf_chk (FILE *__restrict, int,
- const char *__restrict, _G_va_list);
+ const char *__restrict, __gnuc_va_list);
extern int __nldbl___vfwprintf_chk (FILE *__restrict, int,
const wchar_t *__restrict, __gnuc_va_list);
extern int __nldbl___vsprintf_chk (char *__restrict, int, size_t,
- const char *__restrict, _G_va_list) __THROW;
+ const char *__restrict, __gnuc_va_list)
+ __THROW;
extern int __nldbl___vsnprintf_chk (char *__restrict, size_t, int, size_t,
- const char *__restrict, _G_va_list)
+ const char *__restrict, __gnuc_va_list)
__THROW;
extern int __nldbl___vswprintf_chk (wchar_t *__restrict, size_t, int, size_t,
const wchar_t *__restrict, __gnuc_va_list)
__THROW;
-extern int __nldbl___vasprintf_chk (char **, int, const char *, _G_va_list)
+extern int __nldbl___vasprintf_chk (char **, int, const char *, __gnuc_va_list)
__THROW;
-extern int __nldbl___vdprintf_chk (int, int, const char *, _G_va_list);
+extern int __nldbl___vdprintf_chk (int, int, const char *, __gnuc_va_list);
extern int __nldbl___obstack_vprintf_chk (struct obstack *, int, const char *,
- _G_va_list) __THROW;
+ __gnuc_va_list) __THROW;
extern void __nldbl___vsyslog_chk (int, int, const char *, va_list);
+/* The original declarations of these were hidden by the including
+ file. */
+extern double __nldbl_daddl (double, double) __THROW;
+extern double __nldbl_ddivl (double, double) __THROW;
+extern double __nldbl_dmull (double, double) __THROW;
+extern double __nldbl_dsubl (double, double) __THROW;
#endif /* __NLDBL_COMPAT_H */
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-dadd.c b/sysdeps/ieee754/ldbl-opt/nldbl-dadd.c
new file mode 100644
index 0000000000..acbcb3ff75
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-dadd.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for dadd.
+ Copyright (C) 2018 Free Software 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 daddl __hide_daddl
+#include "nldbl-compat.h"
+#undef daddl
+
+double
+attribute_hidden
+daddl (double x, double y)
+{
+ return __nldbl_daddl (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c b/sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c
new file mode 100644
index 0000000000..5cb4606b7d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for ddiv.
+ Copyright (C) 2018 Free Software 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 ddivl __hide_ddivl
+#include "nldbl-compat.h"
+#undef ddivl
+
+double
+attribute_hidden
+ddivl (double x, double y)
+{
+ return __nldbl_ddivl (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-dmul.c b/sysdeps/ieee754/ldbl-opt/nldbl-dmul.c
new file mode 100644
index 0000000000..9c9b94e067
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-dmul.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for dmul.
+ Copyright (C) 2018 Free Software 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 dmull __hide_dmull
+#include "nldbl-compat.h"
+#undef dmull
+
+double
+attribute_hidden
+dmull (double x, double y)
+{
+ return __nldbl_dmull (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-dsub.c b/sysdeps/ieee754/ldbl-opt/nldbl-dsub.c
new file mode 100644
index 0000000000..1d31a75f13
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-dsub.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for dsub.
+ Copyright (C) 2018 Free Software 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 dsubl __hide_dsubl
+#include "nldbl-compat.h"
+#undef dsubl
+
+double
+attribute_hidden
+dsubl (double x, double y)
+{
+ return __nldbl_dsubl (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fadd.c b/sysdeps/ieee754/ldbl-opt/nldbl-fadd.c
new file mode 100644
index 0000000000..c31a6db475
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fadd.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fadd.
+ Copyright (C) 2018 Free Software 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 faddl __hide_faddl
+#include "nldbl-compat.h"
+#undef faddl
+
+float
+attribute_hidden
+faddl (double x, double y)
+{
+ return fadd (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c b/sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c
new file mode 100644
index 0000000000..2d043fc721
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fdiv.
+ Copyright (C) 2018 Free Software 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 fdivl __hide_fdivl
+#include "nldbl-compat.h"
+#undef fdivl
+
+float
+attribute_hidden
+fdivl (double x, double y)
+{
+ return fdiv (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c b/sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c
new file mode 100644
index 0000000000..774ed88a63
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fmaxmag.
+ Copyright (C) 2016-2018 Free Software 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
+fmaxmagl (double x, double y)
+{
+ return fmaxmag (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c b/sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c
new file mode 100644
index 0000000000..66dff4f3ff
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fminmag.
+ Copyright (C) 2016-2018 Free Software 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
+fminmagl (double x, double y)
+{
+ return fminmag (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fmul.c b/sysdeps/ieee754/ldbl-opt/nldbl-fmul.c
new file mode 100644
index 0000000000..2520d1b014
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fmul.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fmul.
+ Copyright (C) 2018 Free Software 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 fmull __hide_fmull
+#include "nldbl-compat.h"
+#undef fmull
+
+float
+attribute_hidden
+fmull (double x, double y)
+{
+ return fmul (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c b/sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c
new file mode 100644
index 0000000000..59db6a9819
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fromfp.
+ Copyright (C) 2016-2018 Free Software 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"
+
+intmax_t
+attribute_hidden
+fromfpl (double x, int round, unsigned int width)
+{
+ return fromfp (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c b/sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c
new file mode 100644
index 0000000000..f8df721ff9
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fromfpx.
+ Copyright (C) 2016-2018 Free Software 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"
+
+intmax_t
+attribute_hidden
+fromfpxl (double x, int round, unsigned int width)
+{
+ return fromfpx (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fsub.c b/sysdeps/ieee754/ldbl-opt/nldbl-fsub.c
new file mode 100644
index 0000000000..36dfe11a75
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fsub.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fsub.
+ Copyright (C) 2018 Free Software 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 fsubl __hide_fsubl
+#include "nldbl-compat.h"
+#undef fsubl
+
+float
+attribute_hidden
+fsubl (double x, double y)
+{
+ return fsub (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c b/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c
new file mode 100644
index 0000000000..425afebc52
--- /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-2018 Free Software 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-iovfscanf.c b/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c
index 05581c0354..442c11c203 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c
@@ -2,7 +2,7 @@
int
attribute_hidden
-_IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap, int *errp)
+_IO_vfscanf (FILE *s, const char *fmt, va_list ap, int *errp)
{
return __nldbl__IO_vfscanf (s, fmt, ap, errp);
}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-llogb.c b/sysdeps/ieee754/ldbl-opt/nldbl-llogb.c
new file mode 100644
index 0000000000..d0dcf35f2d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-llogb.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for llogb.
+ Copyright (C) 2016-2018 Free Software 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"
+
+long int
+attribute_hidden
+llogbl (double x)
+{
+ return llogb (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c b/sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c
new file mode 100644
index 0000000000..30f7f253f3
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c
@@ -0,0 +1,27 @@
+/* Compatibility routine for IEEE double as long double for nextdown.
+ Copyright (C) 2016-2018 Free Software 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"
+
+/* Return the greatest floating-point number less than X. */
+double
+attribute_hidden
+nextdownl (double x)
+{
+ return nextdown (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-nextup.c b/sysdeps/ieee754/ldbl-opt/nldbl-nextup.c
new file mode 100644
index 0000000000..1f04fedbdd
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-nextup.c
@@ -0,0 +1,27 @@
+/* Compatibility routine for IEEE double as long double for nextup.
+ Copyright (C) 2016-2018 Free Software 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"
+
+/* Return the least floating-point number greater than X. */
+double
+attribute_hidden
+nextupl (double x)
+{
+ return nextup (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-pow10.c b/sysdeps/ieee754/ldbl-opt/nldbl-pow10.c
deleted file mode 100644
index 20ebf8d1bb..0000000000
--- a/sysdeps/ieee754/ldbl-opt/nldbl-pow10.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "nldbl-compat.h"
-
-double
-attribute_hidden
-pow10l (double x)
-{
- return pow10 (x);
-}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c b/sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c
new file mode 100644
index 0000000000..ccafa45af1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for roundeven.
+ Copyright (C) 2016-2018 Free Software 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
+roundevenl (double x)
+{
+ return roundeven (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c b/sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c
new file mode 100644
index 0000000000..810e329454
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for setpayload.
+ Copyright (C) 2016-2018 Free Software 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
+setpayloadl (double *x, double payload)
+{
+ return setpayload (x, payload);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c b/sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c
new file mode 100644
index 0000000000..c510f3ea0b
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for setpayloadsig.
+ Copyright (C) 2016-2018 Free Software 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
+setpayloadsigl (double *x, double payload)
+{
+ return setpayloadsig (x, payload);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c b/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c
index 0db0e8c42f..9281e17a37 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c
@@ -2,7 +2,7 @@
ssize_t
attribute_hidden
-__strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
+__strfmon_l (char *s, size_t maxsize, locale_t loc, const char *format, ...)
{
va_list ap;
ssize_t res;
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-strtold_l.c b/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
index 33ff1ca5b5..29ad60c8a5 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
@@ -8,11 +8,11 @@
extern double
__strtod_l (const char *__restrict __nptr, char **__restrict __endptr,
- __locale_t __loc);
+ locale_t __loc);
double
attribute_hidden
-__strtold_l (const char *nptr, char **endptr, __locale_t loc)
+__strtold_l (const char *nptr, char **endptr, locale_t loc)
{
return __strtod_l (nptr, endptr, loc);
}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c b/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c
new file mode 100644
index 0000000000..52aaa4618b
--- /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-2018 Free Software 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..0a8860b53f
--- /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-2018 Free Software 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/nldbl-ufromfp.c b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c
new file mode 100644
index 0000000000..a7b6835ce6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for ufromfp.
+ Copyright (C) 2016-2018 Free Software 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"
+
+uintmax_t
+attribute_hidden
+ufromfpl (double x, int round, unsigned int width)
+{
+ return ufromfp (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c
new file mode 100644
index 0000000000..61eea00996
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for ufromfpx.
+ Copyright (C) 2016-2018 Free Software 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"
+
+uintmax_t
+attribute_hidden
+ufromfpxl (double x, int round, unsigned int width)
+{
+ return ufromfpx (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c b/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c
index e32d13a94b..7004ae79f4 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c
@@ -6,7 +6,7 @@
double
attribute_hidden
-__wcstold_l (const wchar_t *nptr, wchar_t **endptr, __locale_t loc)
+__wcstold_l (const wchar_t *nptr, wchar_t **endptr, locale_t loc)
{
return __wcstod_l (nptr, endptr, loc);
}
diff --git a/sysdeps/ieee754/ldbl-opt/s_asinh.c b/sysdeps/ieee754/ldbl-opt/s_asinh.c
deleted file mode 100644
index e9bcfaea62..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_asinh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_asinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __asinh, asinhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_atan.c b/sysdeps/ieee754/ldbl-opt/s_atan.c
deleted file mode 100644
index 5fbd5e62d6..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_atan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_atan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, atan, atanl, GLIBC_2_0);
-#endif
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_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_cbrt.c b/sysdeps/ieee754/ldbl-opt/s_cbrt.c
deleted file mode 100644
index cdc635771e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cbrt.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_cbrt.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __cbrt, cbrtl, GLIBC_2_0);
-#endif
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_ceil.c b/sysdeps/ieee754/ldbl-opt/s_ceil.c
deleted file mode 100644
index 6e4b70795d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ceil.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_ceil.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0);
-#endif
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
index ac3f4a3a71..1ce017392c 100644
--- a/sysdeps/ieee754/ldbl-opt/s_clog10.c
+++ b/sysdeps/ieee754/ldbl-opt/s_clog10.c
@@ -1,7 +1,28 @@
-#include <complex.h>
+/* Define __clog10l compat symbol for clog10 for ldbl-opt.
+ Copyright (C) 2017-2018 Free Software 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_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);
+#include <first-versions.h>
+#include <math-type-macros-double.h>
+
+#include <s_clog10_template.c>
+
+#if LONG_DOUBLE_COMPAT (libm, FIRST_VERSION_libm___clog10l)
+strong_alias (__clog10, __clog10l_alias)
+compat_symbol (libm, __clog10l_alias, __clog10l, FIRST_VERSION_libm___clog10l);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_clog10l.c b/sysdeps/ieee754/ldbl-opt/s_clog10l.c
index 954f68095a..77e1dc3812 100644
--- a/sysdeps/ieee754/ldbl-opt/s_clog10l.c
+++ b/sysdeps/ieee754/ldbl-opt/s_clog10l.c
@@ -1,10 +1,32 @@
-#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
-strong_alias (__clog10l_internal, __clog10l__internal)
+/* clog10l alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016-2018 Free Software 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, __clog10_internal_l)
long_double_symbol (libm, __clog10l_internal, __clog10l);
-long_double_symbol (libm, __clog10l__internal, clog10l);
+long_double_symbol (libm, __clog10_internal_l, clog10l);
+libm_alias_ldouble_other (__clog10_internal_, clog10)
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_copysign.c b/sysdeps/ieee754/ldbl-opt/s_copysign.c
index f4303f5768..8d42a181df 100644
--- a/sysdeps/ieee754/ldbl-opt/s_copysign.c
+++ b/sysdeps/ieee754/ldbl-opt/s_copysign.c
@@ -1,9 +1,5 @@
#include <math_ldbl_opt.h>
#include <sysdeps/ieee754/dbl-64/s_copysign.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
#endif
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_erf.c b/sysdeps/ieee754/ldbl-opt/s_erf.c
deleted file mode 100644
index 76f1baa5ca..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_erf.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_erf.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __erf, erfl, GLIBC_2_0);
-compat_symbol (libm, __erfc, erfcl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_expm1.c b/sysdeps/ieee754/ldbl-opt/s_expm1.c
deleted file mode 100644
index ef9b5956db..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_expm1.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_expm1.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __expm1, expm1l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fabs.c b/sysdeps/ieee754/ldbl-opt/s_fabs.c
deleted file mode 100644
index e7c92187e9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fabs.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_fabs.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fabs, fabsl, GLIBC_2_0);
-#endif
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_floor.c b/sysdeps/ieee754/ldbl-opt/s_floor.c
deleted file mode 100644
index 7797944e9e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_floor.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_floor.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fma.c b/sysdeps/ieee754/ldbl-opt/s_fma.c
deleted file mode 100644
index 1723c5c306..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fma.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_fma.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fma, fmal, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmal.c b/sysdeps/ieee754/ldbl-opt/s_fmal.c
deleted file mode 100644
index bd12dabcbe..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmal.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fmal.c>
-long_double_symbol (libm, __fmal, fmal);
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_frexp.c b/sysdeps/ieee754/ldbl-opt/s_frexp.c
index 0e3a5e0830..b0bfde3093 100644
--- a/sysdeps/ieee754/ldbl-opt/s_frexp.c
+++ b/sysdeps/ieee754/ldbl-opt/s_frexp.c
@@ -1,9 +1,5 @@
#include <math_ldbl_opt.h>
#include <sysdeps/ieee754/dbl-64/s_frexp.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __frexp, frexpl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __frexp, frexpl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexp.c b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
index 20e107be7e..94417193f5 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexp.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
@@ -1,9 +1,26 @@
-#include <math_ldbl_opt.h>
-#include <math/s_ldexp.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ldexp, ldexpl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+/* ldexp alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016-2018 Free Software 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-type-macros-double.h>
+#include <s_ldexp_template.c>
+
+#if IS_IN (libc) && LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __ldexp, ldexpl, GLIBC_2_0);
+compat_symbol (libc, __wrap_scalbn, scalbnl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
index ed87a92b96..8a60b03987 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
@@ -1,12 +1,29 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ldexpl.c>
-strong_alias (__ldexpl, __ldexpl_2)
-#if IS_IN (libm)
-long_double_symbol (libm, __ldexpl, ldexpl);
-long_double_symbol (libm, __ldexpl_2, scalbnl);
-#else
+/* ldexpl alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define declare_mgen_alias(f,t)
+#endif
+#include <math-type-macros-ldouble.h>
+#include <s_ldexp_template.c>
+
+#if IS_IN (libc)
long_double_symbol (libc, __ldexpl, ldexpl);
-long_double_symbol (libc, __ldexpl_2, scalbnl);
+long_double_symbol (libc, __wrap_scalbnl, scalbnl);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_llrint.c b/sysdeps/ieee754/ldbl-opt/s_llrint.c
deleted file mode 100644
index e6311972e1..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_llrint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_llrint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_llround.c b/sysdeps/ieee754/ldbl-opt/s_llround.c
deleted file mode 100644
index 36c7e6edac..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_llround.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_llround.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_log1p.c b/sysdeps/ieee754/ldbl-opt/s_log1p.c
deleted file mode 100644
index 495fa32e35..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_log1p.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_log1p.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __log1p, log1pl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_logb.c b/sysdeps/ieee754/ldbl-opt/s_logb.c
deleted file mode 100644
index 4d7a6db275..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_logb.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_logb.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __logb, logbl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_lrint.c b/sysdeps/ieee754/ldbl-opt/s_lrint.c
deleted file mode 100644
index b7af812846..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_lrint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_lrint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_lround.c b/sysdeps/ieee754/ldbl-opt/s_lround.c
deleted file mode 100644
index f3a27fa9c9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_lround.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_lround.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_modf.c b/sysdeps/ieee754/ldbl-opt/s_modf.c
index 93acb43ae6..268a728e9b 100644
--- a/sysdeps/ieee754/ldbl-opt/s_modf.c
+++ b/sysdeps/ieee754/ldbl-opt/s_modf.c
@@ -1,9 +1,5 @@
#include <math_ldbl_opt.h>
#include <sysdeps/ieee754/dbl-64/s_modf.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __modf, modfl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __modf, modfl, GLIBC_2_0);
#endif
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_nearbyint.c b/sysdeps/ieee754/ldbl-opt/s_nearbyint.c
deleted file mode 100644
index a8b7973acd..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nearbyint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_nearbyint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_nextafter.c b/sysdeps/ieee754/ldbl-opt/s_nextafter.c
index 78e2c0ff37..e36ade8202 100644
--- a/sysdeps/ieee754/ldbl-opt/s_nextafter.c
+++ b/sysdeps/ieee754/ldbl-opt/s_nextafter.c
@@ -1,8 +1,5 @@
#include <math_ldbl_opt.h>
#include <math/s_nextafter.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __nextafter, nextafterl, GLIBC_2_0);
-#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
strong_alias (__nextafter, __nexttowardd)
strong_alias (__nextafter, __nexttowardld)
diff --git a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
index 07e9375b78..d1cdd54c44 100644
--- a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
+++ b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
@@ -22,6 +22,7 @@
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
@@ -31,7 +32,7 @@ float __nldbl_nexttowardf(float x, double y);
float __nldbl_nexttowardf(float x, double y)
{
int32_t hx,hy,ix,iy;
- u_int32_t ly;
+ uint32_t ly;
GET_FLOAT_WORD(hx,x);
EXTRACT_WORDS(hy,ly,y);
@@ -44,7 +45,7 @@ float __nldbl_nexttowardf(float x, double y)
if((double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
float u;
- SET_FLOAT_WORD(x,(u_int32_t)(hy&0x80000000)|1);/* return +-minsub*/
+ SET_FLOAT_WORD(x,(uint32_t)(hy&0x80000000)|1);/* return +-minsub*/
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
diff --git a/sysdeps/ieee754/ldbl-opt/s_remquo.c b/sysdeps/ieee754/ldbl-opt/s_remquo.c
deleted file mode 100644
index 9f3d7ba368..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_remquo.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_remquo.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __remquo, remquol, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_rint.c b/sysdeps/ieee754/ldbl-opt/s_rint.c
deleted file mode 100644
index d9b156ea27..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_rint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_rint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_round.c b/sysdeps/ieee754/ldbl-opt/s_round.c
deleted file mode 100644
index edff2f017b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_round.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_round.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_scalbln.c b/sysdeps/ieee754/ldbl-opt/s_scalbln.c
deleted file mode 100644
index 391142b769..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_scalbln.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_scalbln.c>
-#if IS_IN (libm)
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __scalbln, scalblnl, GLIBC_2_1);
-#endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
-compat_symbol (libc, __scalbln, scalblnl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_scalbn.c b/sysdeps/ieee754/ldbl-opt/s_scalbn.c
deleted file mode 100644
index 1ad81b199e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_scalbn.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_scalbn.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __scalbn, scalbnl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
-compat_symbol (libc, __scalbn, scalbnl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_significand.c b/sysdeps/ieee754/ldbl-opt/s_significand.c
deleted file mode 100644
index 5287c09066..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_significand.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_significand.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __significand, significandl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_significandl.c b/sysdeps/ieee754/ldbl-opt/s_significandl.c
deleted file mode 100644
index 9339b4780d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_significandl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_significandl.c>
-long_double_symbol (libm, __significandl, significandl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_sin.c b/sysdeps/ieee754/ldbl-opt/s_sin.c
deleted file mode 100644
index 04e60e2731..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_sin.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* dbl-64/s_sin.c uses NAN and sincos identifiers internally. */
-#define sincos sincos_disable
-/* These definitions needed for proper unfolding of __MATHDECL_VEC. */
-#define __DECL_SIMD_sincos_disable
-#define __DECL_SIMD_sincos_disablef
-#define __DECL_SIMD_sincos_disablel
-#include <math_ldbl_opt.h>
-#undef NAN
-#undef sincos
-#include <sysdeps/ieee754/dbl-64/s_sin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sin, sinl, GLIBC_2_0);
-compat_symbol (libm, __cos, cosl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_sincos.c b/sysdeps/ieee754/ldbl-opt/s_sincos.c
deleted file mode 100644
index 6d2a48f25b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_sincos.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_sincos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __sincos, sincosl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_tan.c b/sysdeps/ieee754/ldbl-opt/s_tan.c
deleted file mode 100644
index 6b0fec0063..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_tan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_tan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, tan, tanl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_tanh.c b/sysdeps/ieee754/ldbl-opt/s_tanh.c
deleted file mode 100644
index e763bbde77..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_tanh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_tanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __tanh, tanhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_trunc.c b/sysdeps/ieee754/ldbl-opt/s_trunc.c
deleted file mode 100644
index 9d90a2bd73..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_trunc.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_trunc.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c b/sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c
new file mode 100644
index 0000000000..be92325403
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c
@@ -0,0 +1 @@
+#include <math/test-narrow-macros.c>
diff --git a/sysdeps/ieee754/ldbl-opt/w_acos.c b/sysdeps/ieee754/ldbl-opt/w_acos.c
deleted file mode 100644
index 2934041d4d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acos.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_acos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __acos, acosl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_acosh.c b/sysdeps/ieee754/ldbl-opt/w_acosh.c
deleted file mode 100644
index 7f7fa14e27..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acosh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_acosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __acosh, acoshl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_acoshl.c b/sysdeps/ieee754/ldbl-opt/w_acoshl.c
deleted file mode 100644
index 6243c2ac80..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acoshl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_acoshl.c>
-long_double_symbol (libm, __acoshl, acoshl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_acosl.c b/sysdeps/ieee754/ldbl-opt/w_acosl.c
deleted file mode 100644
index 8b6e890a53..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acosl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_acosl.c>
-long_double_symbol (libm, __acosl, acosl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_asin.c b/sysdeps/ieee754/ldbl-opt/w_asin.c
deleted file mode 100644
index 5e1d70ff65..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_asin.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_asin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __asin, asinl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_asinl.c b/sysdeps/ieee754/ldbl-opt/w_asinl.c
deleted file mode 100644
index a58a224a38..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_asinl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_asinl.c>
-long_double_symbol (libm, __asinl, asinl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_atan2.c b/sysdeps/ieee754/ldbl-opt/w_atan2.c
deleted file mode 100644
index f1d1501bd2..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atan2.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_atan2.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __atan2, atan2l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_atan2l.c b/sysdeps/ieee754/ldbl-opt/w_atan2l.c
deleted file mode 100644
index 01431eff44..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atan2l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_atan2l.c>
-long_double_symbol (libm, __atan2l, atan2l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_atanh.c b/sysdeps/ieee754/ldbl-opt/w_atanh.c
deleted file mode 100644
index b4cab87c32..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atanh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_atanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __atanh, atanhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_atanhl.c b/sysdeps/ieee754/ldbl-opt/w_atanhl.c
deleted file mode 100644
index 0dbc114481..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atanhl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_atanhl.c>
-long_double_symbol (libm, __atanhl, atanhl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_cosh.c b/sysdeps/ieee754/ldbl-opt/w_cosh.c
deleted file mode 100644
index a6f56cf4c5..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_cosh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_cosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __cosh, coshl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_coshl.c b/sysdeps/ieee754/ldbl-opt/w_coshl.c
deleted file mode 100644
index 8c7dccb7f3..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_coshl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_coshl.c>
-long_double_symbol (libm, __coshl, coshl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp.c b/sysdeps/ieee754/ldbl-opt/w_exp.c
deleted file mode 100644
index 61fcfcc9df..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_exp.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/w_exp.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __exp, expl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10.c b/sysdeps/ieee754/ldbl-opt/w_exp10.c
deleted file mode 100644
index 990c48e61a..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_exp10.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_exp10.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __exp10, exp10l, GLIBC_2_1);
-compat_symbol (libm, __pow10, pow10l, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c b/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c
new file mode 100644
index 0000000000..895411d1ee
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c
@@ -0,0 +1,8 @@
+#include <math_ldbl_opt.h>
+#include <math/w_exp10_compat.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
+strong_alias (__pow10, __pow10_pow10l)
+compat_symbol (libm, __pow10_pow10l, pow10l, GLIBC_2_1);
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10l.c b/sysdeps/ieee754/ldbl-opt/w_exp10l.c
deleted file mode 100644
index e06dfb5014..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_exp10l.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_exp10l.c>
-long_double_symbol (libm, __exp10l, exp10l);
-long_double_symbol (libm, __pow10l, pow10l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c b/sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c
new file mode 100644
index 0000000000..4822211189
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c
@@ -0,0 +1,17 @@
+#include <math_ldbl_opt.h>
+#undef compat_symbol
+#define compat_symbol(l,n,a,v)
+#include <math/w_exp10l_compat.c>
+#if LIBM_SVID_COMPAT
+# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
+/* compat_symbol was undefined and redefined above to avoid the
+ default pow10l compat symbol at version GLIBC_2_1 (as for ldbl-opt
+ configurations, that version should have the alias to exp10). So
+ it now needs to be redefined to define the compat symbol at version
+ LONG_DOUBLE_COMPAT_VERSION. */
+# undef compat_symbol
+# define compat_symbol(lib, local, symbol, version) \
+ compat_symbol_reference (lib, local, symbol, version)
+compat_symbol (libm, __pow10l, pow10l, LONG_DOUBLE_COMPAT_VERSION);
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_fmod.c b/sysdeps/ieee754/ldbl-opt/w_fmod.c
deleted file mode 100644
index 81ad5057f7..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_fmod.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_fmod.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fmod, fmodl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_fmodl.c b/sysdeps/ieee754/ldbl-opt/w_fmodl.c
deleted file mode 100644
index 2a534a304c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_fmodl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_fmodl.c>
-long_double_symbol (libm, __fmodl, fmodl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_hypot.c b/sysdeps/ieee754/ldbl-opt/w_hypot.c
deleted file mode 100644
index e1cf1ffcfe..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_hypot.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_hypot.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __hypot, hypotl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_hypotl.c b/sysdeps/ieee754/ldbl-opt/w_hypotl.c
deleted file mode 100644
index 6c46bd4bde..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_hypotl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_hypotl.c>
-long_double_symbol (libm, __hypotl, hypotl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_ilogb.c b/sysdeps/ieee754/ldbl-opt/w_ilogb.c
deleted file mode 100644
index f518087a5f..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_ilogb.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_ilogb.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ilogb, ilogbl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_ilogbl.c b/sysdeps/ieee754/ldbl-opt/w_ilogbl.c
deleted file mode 100644
index 36f83f6ade..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_ilogbl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_ilogbl.c>
-long_double_symbol (libm, __ilogbl, ilogbl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_j0.c b/sysdeps/ieee754/ldbl-opt/w_j0.c
deleted file mode 100644
index 5c78aff085..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j0.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_j0.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, j0, j0l, GLIBC_2_0);
-compat_symbol (libm, y0, y0l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_j0l.c b/sysdeps/ieee754/ldbl-opt/w_j0l.c
deleted file mode 100644
index 767a1bcada..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j0l.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_j0l.c>
-long_double_symbol (libm, __j0l, j0l);
-long_double_symbol (libm, __y0l, y0l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_j1.c b/sysdeps/ieee754/ldbl-opt/w_j1.c
deleted file mode 100644
index ed3dbc0361..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j1.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_j1.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, j1, j1l, GLIBC_2_0);
-compat_symbol (libm, y1, y1l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_j1l.c b/sysdeps/ieee754/ldbl-opt/w_j1l.c
deleted file mode 100644
index 946c36467c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j1l.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_j1l.c>
-long_double_symbol (libm, __j1l, j1l);
-long_double_symbol (libm, __y1l, y1l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_jn.c b/sysdeps/ieee754/ldbl-opt/w_jn.c
deleted file mode 100644
index 7a7e0d434b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_jn.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_jn.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, jn, jnl, GLIBC_2_0);
-compat_symbol (libm, yn, ynl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_jnl.c b/sysdeps/ieee754/ldbl-opt/w_jnl.c
deleted file mode 100644
index 5219543a97..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_jnl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_jnl.c>
-long_double_symbol (libm, __jnl, jnl);
-long_double_symbol (libm, __ynl, ynl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c b/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c
deleted file mode 100644
index eeab6a6b47..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_lgamma_r.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __lgamma_r, lgammal_r, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c b/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c
deleted file mode 100644
index 25459758d7..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_lgammal_r.c>
-long_double_symbol (libm, __lgammal_r, lgammal_r);
diff --git a/sysdeps/ieee754/ldbl-opt/w_log.c b/sysdeps/ieee754/ldbl-opt/w_log.c
deleted file mode 100644
index bde1e31db4..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_log.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __log, logl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_log10.c b/sysdeps/ieee754/ldbl-opt/w_log10.c
deleted file mode 100644
index 74e716821e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log10.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_log10.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __log10, log10l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_log10l.c b/sysdeps/ieee754/ldbl-opt/w_log10l.c
deleted file mode 100644
index 9c936e376a..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log10l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log10l.c>
-long_double_symbol (libm, __log10l, log10l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_log2.c b/sysdeps/ieee754/ldbl-opt/w_log2.c
deleted file mode 100644
index 9b9b45b21b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log2.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_log2.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __log2, log2l, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_log2l.c b/sysdeps/ieee754/ldbl-opt/w_log2l.c
deleted file mode 100644
index c859682133..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log2l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log2l.c>
-long_double_symbol (libm, __log2l, log2l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_logl.c b/sysdeps/ieee754/ldbl-opt/w_logl.c
deleted file mode 100644
index c2354a02b9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_logl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_logl.c>
-long_double_symbol (libm, __logl, logl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_pow.c b/sysdeps/ieee754/ldbl-opt/w_pow.c
deleted file mode 100644
index 2d98fb9be4..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_pow.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_pow.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __pow, powl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_powl.c b/sysdeps/ieee754/ldbl-opt/w_powl.c
deleted file mode 100644
index 85b8927648..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_powl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_powl.c>
-long_double_symbol (libm, __powl, powl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_remainder.c b/sysdeps/ieee754/ldbl-opt/w_remainder.c
deleted file mode 100644
index dfa7b7f569..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_remainder.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_remainder.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __remainder, remainderl, GLIBC_2_0);
-strong_alias (__remainder, __drem)
-compat_symbol (libm, __drem, dreml, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_remainder_compat.c b/sysdeps/ieee754/ldbl-opt/w_remainder_compat.c
new file mode 100644
index 0000000000..8bdea32c02
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_remainder_compat.c
@@ -0,0 +1,6 @@
+#include <math_ldbl_opt.h>
+#include <math/w_remainder_compat.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+strong_alias (__remainder, __drem)
+compat_symbol (libm, __drem, dreml, GLIBC_2_0);
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_remainderl.c b/sysdeps/ieee754/ldbl-opt/w_remainderl.c
deleted file mode 100644
index 7a344b7709..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_remainderl.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_remainderl.c>
-long_double_symbol (libm, __remainderl, remainderl);
-strong_alias (__remainderl, __dreml)
-long_double_symbol (libm, __dreml, dreml);
diff --git a/sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c b/sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c
new file mode 100644
index 0000000000..2579600aa2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c
@@ -0,0 +1,19 @@
+#include <math_ldbl_opt.h>
+#undef weak_alias
+#define weak_alias(n,a)
+#include <math/w_remainderl_compat.c>
+#if LIBM_SVID_COMPAT
+/* If ldbl-opt is used without special versioning for remainderl being
+ required, the generic code does not define remainderl because of
+ the undefine and redefine of weak_alias above. In any case, that
+ undefine and redefine mean _FloatN / _FloatNx aliases have not been
+ defined. */
+# undef weak_alias
+# define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+# if !LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+weak_alias (__remainderl, remainderl)
+# endif
+strong_alias (__remainderl, __dreml)
+long_double_symbol (libm, __dreml, dreml);
+libm_alias_ldouble_other (__remainder, remainder)
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_scalb.c b/sysdeps/ieee754/ldbl-opt/w_scalb.c
deleted file mode 100644
index e2ac601596..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_scalb.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_scalb.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __scalb, scalbl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_scalb_compat.c b/sysdeps/ieee754/ldbl-opt/w_scalb_compat.c
new file mode 100644
index 0000000000..f6d53a5ba5
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_scalb_compat.c
@@ -0,0 +1,5 @@
+#include <math_ldbl_opt.h>
+#include <math/w_scalb_compat.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __scalb, scalbl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_scalbl.c b/sysdeps/ieee754/ldbl-opt/w_scalbl.c
deleted file mode 100644
index f3d3901f86..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_scalbl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_scalbl.c>
-long_double_symbol (libm, __scalbl, scalbl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c b/sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c
new file mode 100644
index 0000000000..c8feb654a2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c
@@ -0,0 +1,5 @@
+#include <math_ldbl_opt.h>
+#undef weak_alias
+#define weak_alias(n,a)
+#include <math/w_scalbl_compat.c>
+long_double_symbol (libm, __scalbl, scalbl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_sinh.c b/sysdeps/ieee754/ldbl-opt/w_sinh.c
deleted file mode 100644
index a5400b5eb1..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sinh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_sinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sinh, sinhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_sinhl.c b/sysdeps/ieee754/ldbl-opt/w_sinhl.c
deleted file mode 100644
index b94f4ec845..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sinhl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_sinhl.c>
-long_double_symbol (libm, __sinhl, sinhl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_sqrt.c b/sysdeps/ieee754/ldbl-opt/w_sqrt.c
deleted file mode 100644
index ca2ba061e8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sqrt.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_sqrt.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_sqrtl.c b/sysdeps/ieee754/ldbl-opt/w_sqrtl.c
deleted file mode 100644
index 609f5bf3d6..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sqrtl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_sqrtl.c>
-long_double_symbol (libm, __sqrtl, sqrtl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_tgamma.c b/sysdeps/ieee754/ldbl-opt/w_tgamma.c
deleted file mode 100644
index cce9f348ed..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_tgamma.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_tgamma.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __tgamma, tgammal, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_tgammal.c b/sysdeps/ieee754/ldbl-opt/w_tgammal.c
deleted file mode 100644
index c3c511db8c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_tgammal.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_tgammal.c>
-long_double_symbol (libm, __tgammal, tgammal);
diff --git a/sysdeps/ieee754/s_lib_version.c b/sysdeps/ieee754/s_lib_version.c
index bb59300953..40f708d82d 100644
--- a/sysdeps/ieee754/s_lib_version.c
+++ b/sysdeps/ieee754/s_lib_version.c
@@ -18,24 +18,13 @@ static char rcsid[] = "$NetBSD: s_lib_version.c,v 1.6 1995/05/10 20:47:44 jtc Ex
* MACRO for standards
*/
-#include <math.h>
-#include <math_private.h>
+#include <math-svid-compat.h>
/*
* define and initialize _LIB_VERSION
*/
-#ifdef _POSIX_MODE
+#undef _LIB_VERSION
+#if LIBM_SVID_COMPAT
_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _POSIX_;
-#else
-#ifdef _XOPEN_MODE
-_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _XOPEN_;
-#else
-#ifdef _SVID3_MODE
-_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _SVID_;
-#else /* default _IEEE_MODE */
-_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _IEEE_;
+compat_symbol (libm, _LIB_VERSION_INTERNAL, _LIB_VERSION, GLIBC_2_0);
#endif
-#endif
-#endif
-
-weak_alias (_LIB_VERSION_INTERNAL, _LIB_VERSION)
diff --git a/sysdeps/ieee754/s_matherr.c b/sysdeps/ieee754/s_matherr.c
index d5dc6f122d..5eacdd51c6 100644
--- a/sysdeps/ieee754/s_matherr.c
+++ b/sysdeps/ieee754/s_matherr.c
@@ -14,9 +14,10 @@
static char rcsid[] = "$NetBSD: s_matherr.c,v 1.6 1995/05/10 20:47:53 jtc Exp $";
#endif
-#include <math.h>
-#include <math_private.h>
+#include <math-svid-compat.h>
+#undef matherr
+#if LIBM_SVID_COMPAT
int
weak_function
__matherr(struct exception *x)
@@ -25,4 +26,5 @@ __matherr(struct exception *x)
if(x->arg1!=x->arg1) return 0;
return n;
}
-weak_alias (__matherr, matherr)
+compat_symbol (libm, __matherr, matherr, GLIBC_2_0);
+#endif
diff --git a/sysdeps/aarch64/soft-fp/Makefile b/sysdeps/ieee754/soft-fp/Makefile
index ada13e8b70..ada13e8b70 100644
--- a/sysdeps/aarch64/soft-fp/Makefile
+++ b/sysdeps/ieee754/soft-fp/Makefile
diff --git a/sysdeps/ieee754/soft-fp/s_daddl.c b/sysdeps/ieee754/soft-fp/s_daddl.c
new file mode 100644
index 0000000000..efe3772413
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_daddl.c
@@ -0,0 +1,59 @@
+/* Add long double (ldbl-128) values, narrowing the result to double,
+ using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32xaddf64x __hide_f32xaddf64x
+#define f32xaddf128 __hide_f32xaddf128
+#define f64addf64x __hide_f64addf64x
+#define f64addf128 __hide_f64addf128
+#include <math.h>
+#undef f32xaddf64x
+#undef f32xaddf128
+#undef f64addf64x
+#undef f64addf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <double.h>
+#include <quad.h>
+
+double
+__daddl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_D (RN);
+ double ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_Q (X, x);
+ FP_UNPACK_SEMIRAW_Q (Y, y);
+ FP_ADD_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC (D, Q, 2, 4, RN, R);
+#else
+ FP_TRUNC (D, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_SEMIRAW_D (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_ADD (ret, x, y);
+ return ret;
+}
+libm_alias_double_ldouble (add)
diff --git a/sysdeps/ieee754/soft-fp/s_ddivl.c b/sysdeps/ieee754/soft-fp/s_ddivl.c
new file mode 100644
index 0000000000..7e598a2132
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_ddivl.c
@@ -0,0 +1,59 @@
+/* Divide long double (ldbl-128) values, narrowing the result to
+ double, using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32xdivf64x __hide_f32xdivf64x
+#define f32xdivf128 __hide_f32xdivf128
+#define f64divf64x __hide_f64divf64x
+#define f64divf128 __hide_f64divf128
+#include <math.h>
+#undef f32xdivf64x
+#undef f32xdivf128
+#undef f64divf64x
+#undef f64divf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <double.h>
+#include <quad.h>
+
+double
+__ddivl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_D (RN);
+ double ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (X, x);
+ FP_UNPACK_Q (Y, y);
+ FP_DIV_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC_COOKED (D, Q, 2, 4, RN, R);
+#else
+ FP_TRUNC_COOKED (D, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_D (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_DIV (ret, x, y);
+ return ret;
+}
+libm_alias_double_ldouble (div)
diff --git a/sysdeps/ieee754/soft-fp/s_dmull.c b/sysdeps/ieee754/soft-fp/s_dmull.c
new file mode 100644
index 0000000000..4ebf31140b
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_dmull.c
@@ -0,0 +1,59 @@
+/* Multiply long double (ldbl-128) values, narrowing the result to
+ double, using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32xmulf64x __hide_f32xmulf64x
+#define f32xmulf128 __hide_f32xmulf128
+#define f64mulf64x __hide_f64mulf64x
+#define f64mulf128 __hide_f64mulf128
+#include <math.h>
+#undef f32xmulf64x
+#undef f32xmulf128
+#undef f64mulf64x
+#undef f64mulf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <double.h>
+#include <quad.h>
+
+double
+__dmull (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_D (RN);
+ double ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (X, x);
+ FP_UNPACK_Q (Y, y);
+ FP_MUL_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC_COOKED (D, Q, 2, 4, RN, R);
+#else
+ FP_TRUNC_COOKED (D, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_D (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_MUL (ret, x, y);
+ return ret;
+}
+libm_alias_double_ldouble (mul)
diff --git a/sysdeps/ieee754/soft-fp/s_dsubl.c b/sysdeps/ieee754/soft-fp/s_dsubl.c
new file mode 100644
index 0000000000..52f489c6ed
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_dsubl.c
@@ -0,0 +1,59 @@
+/* Subtract long double (ldbl-128) values, narrowing the result to
+ double, using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32xsubf64x __hide_f32xsubf64x
+#define f32xsubf128 __hide_f32xsubf128
+#define f64subf64x __hide_f64subf64x
+#define f64subf128 __hide_f64subf128
+#include <math.h>
+#undef f32xsubf64x
+#undef f32xsubf128
+#undef f64subf64x
+#undef f64subf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <double.h>
+#include <quad.h>
+
+double
+__dsubl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_D (RN);
+ double ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_Q (X, x);
+ FP_UNPACK_SEMIRAW_Q (Y, y);
+ FP_SUB_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC (D, Q, 2, 4, RN, R);
+#else
+ FP_TRUNC (D, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_SEMIRAW_D (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_SUB (ret, x, y);
+ return ret;
+}
+libm_alias_double_ldouble (sub)
diff --git a/sysdeps/ieee754/soft-fp/s_fadd.c b/sysdeps/ieee754/soft-fp/s_fadd.c
new file mode 100644
index 0000000000..606e527300
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fadd.c
@@ -0,0 +1,56 @@
+/* Add double values, narrowing the result to float, using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32addf64 __hide_f32addf64
+#define f32addf32x __hide_f32addf32x
+#define faddl __hide_faddl
+#include <math.h>
+#undef f32addf64
+#undef f32addf32x
+#undef faddl
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <double.h>
+
+float
+__fadd (double x, double y)
+{
+ FP_DECL_EX;
+ FP_DECL_D (X);
+ FP_DECL_D (Y);
+ FP_DECL_D (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_D (X, x);
+ FP_UNPACK_SEMIRAW_D (Y, y);
+ FP_ADD_D (R, X, Y);
+#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D
+ FP_TRUNC (S, D, 1, 2, RN, R);
+#else
+ FP_TRUNC (S, D, 1, 1, RN, R);
+#endif
+ FP_PACK_SEMIRAW_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_ADD (ret, x, y);
+ return ret;
+}
+libm_alias_float_double (add)
diff --git a/sysdeps/ieee754/soft-fp/s_faddl.c b/sysdeps/ieee754/soft-fp/s_faddl.c
new file mode 100644
index 0000000000..42c4422060
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_faddl.c
@@ -0,0 +1,55 @@
+/* Add long double (ldbl-128) values, narrowing the result to float,
+ using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32addf64x __hide_f32addf64x
+#define f32addf128 __hide_f32addf128
+#include <math.h>
+#undef f32addf64x
+#undef f32addf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <quad.h>
+
+float
+__faddl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_Q (X, x);
+ FP_UNPACK_SEMIRAW_Q (Y, y);
+ FP_ADD_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC (S, Q, 1, 4, RN, R);
+#else
+ FP_TRUNC (S, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_SEMIRAW_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_ADD (ret, x, y);
+ return ret;
+}
+libm_alias_float_ldouble (add)
diff --git a/sysdeps/ieee754/soft-fp/s_fdiv.c b/sysdeps/ieee754/soft-fp/s_fdiv.c
new file mode 100644
index 0000000000..341339f5ed
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fdiv.c
@@ -0,0 +1,56 @@
+/* Divide double values, narrowing the result to float, using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32divf64 __hide_f32divf64
+#define f32divf32x __hide_f32divf32x
+#define fdivl __hide_fdivl
+#include <math.h>
+#undef f32divf64
+#undef f32divf32x
+#undef fdivl
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <double.h>
+
+float
+__fdiv (double x, double y)
+{
+ FP_DECL_EX;
+ FP_DECL_D (X);
+ FP_DECL_D (Y);
+ FP_DECL_D (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_D (X, x);
+ FP_UNPACK_D (Y, y);
+ FP_DIV_D (R, X, Y);
+#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D
+ FP_TRUNC_COOKED (S, D, 1, 2, RN, R);
+#else
+ FP_TRUNC_COOKED (S, D, 1, 1, RN, R);
+#endif
+ FP_PACK_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_DIV (ret, x, y);
+ return ret;
+}
+libm_alias_float_double (div)
diff --git a/sysdeps/ieee754/soft-fp/s_fdivl.c b/sysdeps/ieee754/soft-fp/s_fdivl.c
new file mode 100644
index 0000000000..7fb3709c73
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fdivl.c
@@ -0,0 +1,55 @@
+/* Divide long double (ldbl-128) values, narrowing the result to
+ float, using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32divf64x __hide_f32divf64x
+#define f32divf128 __hide_f32divf128
+#include <math.h>
+#undef f32divf64x
+#undef f32divf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <quad.h>
+
+float
+__fdivl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (X, x);
+ FP_UNPACK_Q (Y, y);
+ FP_DIV_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC_COOKED (S, Q, 1, 4, RN, R);
+#else
+ FP_TRUNC_COOKED (S, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_DIV (ret, x, y);
+ return ret;
+}
+libm_alias_float_ldouble (div)
diff --git a/sysdeps/ieee754/soft-fp/s_fma.c b/sysdeps/ieee754/soft-fp/s_fma.c
new file mode 100644
index 0000000000..41cf81a74b
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fma.c
@@ -0,0 +1,68 @@
+/* Implement fma using soft-fp.
+ Copyright (C) 2013-2018 Free Software 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 <math.h>
+#include <libc-diag.h>
+#include <libm-alias-double.h>
+
+/* R_e is not set in cases where it is not used in packing, but the
+ compiler does not see that it is set in all cases where it is
+ used, resulting in warnings that it may be used uninitialized.
+ The location of the warning differs in different versions of GCC,
+ it may be where R is defined using a macro or it may be where the
+ macro is defined. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
+
+#include "soft-fp.h"
+#include "double.h"
+
+double
+__fma (double a, double b, double c)
+{
+ FP_DECL_EX;
+ FP_DECL_D (A);
+ FP_DECL_D (B);
+ FP_DECL_D (C);
+ FP_DECL_D (R);
+ double r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_D (A, a);
+ FP_UNPACK_D (B, b);
+ FP_UNPACK_D (C, c);
+ FP_FMA_D (R, A, B, C);
+ FP_PACK_D (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
+DIAG_POP_NEEDS_COMMENT;
+
+#ifndef __fma
+libm_alias_double (__fma, fma)
+#endif
diff --git a/sysdeps/ieee754/soft-fp/s_fmaf.c b/sysdeps/ieee754/soft-fp/s_fmaf.c
new file mode 100644
index 0000000000..afe64356b3
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fmaf.c
@@ -0,0 +1,68 @@
+/* Implement fmaf using soft-fp.
+ Copyright (C) 2013-2018 Free Software 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 <math.h>
+#include <libc-diag.h>
+#include <libm-alias-float.h>
+
+/* R_e is not set in cases where it is not used in packing, but the
+ compiler does not see that it is set in all cases where it is
+ used, resulting in warnings that it may be used uninitialized.
+ The location of the warning differs in different versions of GCC,
+ it may be where R is defined using a macro or it may be where the
+ macro is defined. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
+
+#include "soft-fp.h"
+#include "single.h"
+
+float
+__fmaf (float a, float b, float c)
+{
+ FP_DECL_EX;
+ FP_DECL_S (A);
+ FP_DECL_S (B);
+ FP_DECL_S (C);
+ FP_DECL_S (R);
+ float r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_S (A, a);
+ FP_UNPACK_S (B, b);
+ FP_UNPACK_S (C, c);
+ FP_FMA_S (R, A, B, C);
+ FP_PACK_S (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
+DIAG_POP_NEEDS_COMMENT;
+
+#ifndef __fmaf
+libm_alias_float (__fma, fma)
+#endif
diff --git a/sysdeps/ieee754/soft-fp/s_fmal.c b/sysdeps/ieee754/soft-fp/s_fmal.c
new file mode 100644
index 0000000000..4c2d4c5d9b
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fmal.c
@@ -0,0 +1,66 @@
+/* Implement fmal using soft-fp.
+ Copyright (C) 2013-2018 Free Software 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 <math.h>
+#include <libc-diag.h>
+#include <libm-alias-ldouble.h>
+
+/* R_e is not set in cases where it is not used in packing, but the
+ compiler does not see that it is set in all cases where it is
+ used, resulting in warnings that it may be used uninitialized.
+ The location of the warning differs in different versions of GCC,
+ it may be where R is defined using a macro or it may be where the
+ macro is defined. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
+
+#include "soft-fp.h"
+#include "quad.h"
+
+long double
+__fmal (long double a, long double b, long double c)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (A);
+ FP_DECL_Q (B);
+ FP_DECL_Q (C);
+ FP_DECL_Q (R);
+ long double r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (A, a);
+ FP_UNPACK_Q (B, b);
+ FP_UNPACK_Q (C, c);
+ FP_FMA_Q (R, A, B, C);
+ FP_PACK_Q (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
+DIAG_POP_NEEDS_COMMENT;
+
+libm_alias_ldouble (__fma, fma)
diff --git a/sysdeps/ieee754/soft-fp/s_fmul.c b/sysdeps/ieee754/soft-fp/s_fmul.c
new file mode 100644
index 0000000000..5f679b1d45
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fmul.c
@@ -0,0 +1,56 @@
+/* Multiply double values, narrowing the result to float, using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32mulf64 __hide_f32mulf64
+#define f32mulf32x __hide_f32mulf32x
+#define fmull __hide_fmull
+#include <math.h>
+#undef f32mulf64
+#undef f32mulf32x
+#undef fmull
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <double.h>
+
+float
+__fmul (double x, double y)
+{
+ FP_DECL_EX;
+ FP_DECL_D (X);
+ FP_DECL_D (Y);
+ FP_DECL_D (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_D (X, x);
+ FP_UNPACK_D (Y, y);
+ FP_MUL_D (R, X, Y);
+#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D
+ FP_TRUNC_COOKED (S, D, 1, 2, RN, R);
+#else
+ FP_TRUNC_COOKED (S, D, 1, 1, RN, R);
+#endif
+ FP_PACK_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_MUL (ret, x, y);
+ return ret;
+}
+libm_alias_float_double (mul)
diff --git a/sysdeps/ieee754/soft-fp/s_fmull.c b/sysdeps/ieee754/soft-fp/s_fmull.c
new file mode 100644
index 0000000000..da4a12c8ec
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fmull.c
@@ -0,0 +1,55 @@
+/* Multiply long double (ldbl-128) values, narrowing the result to
+ float, using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32mulf64x __hide_f32mulf64x
+#define f32mulf128 __hide_f32mulf128
+#include <math.h>
+#undef f32mulf64x
+#undef f32mulf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <quad.h>
+
+float
+__fmull (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (X, x);
+ FP_UNPACK_Q (Y, y);
+ FP_MUL_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC_COOKED (S, Q, 1, 4, RN, R);
+#else
+ FP_TRUNC_COOKED (S, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_MUL (ret, x, y);
+ return ret;
+}
+libm_alias_float_ldouble (mul)
diff --git a/sysdeps/ieee754/soft-fp/s_fsub.c b/sysdeps/ieee754/soft-fp/s_fsub.c
new file mode 100644
index 0000000000..824a3abbc7
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fsub.c
@@ -0,0 +1,56 @@
+/* Subtract double values, narrowing the result to float, using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32subf64 __hide_f32subf64
+#define f32subf32x __hide_f32subf32x
+#define fsubl __hide_fsubl
+#include <math.h>
+#undef f32subf64
+#undef f32subf32x
+#undef fsubl
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <double.h>
+
+float
+__fsub (double x, double y)
+{
+ FP_DECL_EX;
+ FP_DECL_D (X);
+ FP_DECL_D (Y);
+ FP_DECL_D (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_D (X, x);
+ FP_UNPACK_SEMIRAW_D (Y, y);
+ FP_SUB_D (R, X, Y);
+#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D
+ FP_TRUNC (S, D, 1, 2, RN, R);
+#else
+ FP_TRUNC (S, D, 1, 1, RN, R);
+#endif
+ FP_PACK_SEMIRAW_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_SUB (ret, x, y);
+ return ret;
+}
+libm_alias_float_double (sub)
diff --git a/sysdeps/ieee754/soft-fp/s_fsubl.c b/sysdeps/ieee754/soft-fp/s_fsubl.c
new file mode 100644
index 0000000000..84b1013797
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fsubl.c
@@ -0,0 +1,55 @@
+/* Subtract long double (ldbl-128) values, narrowing the result to
+ float, using soft-fp.
+ Copyright (C) 2018 Free Software 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 f32subf64x __hide_f32subf64x
+#define f32subf128 __hide_f32subf128
+#include <math.h>
+#undef f32subf64x
+#undef f32subf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <quad.h>
+
+float
+__fsubl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_Q (X, x);
+ FP_UNPACK_SEMIRAW_Q (Y, y);
+ FP_SUB_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC (S, Q, 1, 4, RN, R);
+#else
+ FP_TRUNC (S, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_SEMIRAW_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_SUB (ret, x, y);
+ return ret;
+}
+libm_alias_float_ldouble (sub)
diff --git a/sysdeps/init_array/crti.S b/sysdeps/init_array/crti.S
index 0a6e9fd953..145c918f93 100644
--- a/sysdeps/init_array/crti.S
+++ b/sysdeps/init_array/crti.S
@@ -11,3 +11,17 @@
But new configurations without compatibility concerns for
toolchains without .init_array support can use this to avoid the
superfluous .init and .fini boilerplate code. */
+
+#ifdef PREINIT_FUNCTION
+
+#if PREINIT_FUNCTION_WEAK
+# error PREINIT_FUNCTION_WEAK is unsupported
+#endif
+
+/* This arranges for PREINIT_FUNCTION to be called upon loading a library that
+ contains crti.o. */
+
+ .section .init_array,"a",%init_array
+ .dc.a PREINIT_FUNCTION
+
+#endif
diff --git a/sysdeps/init_array/elf-init.c b/sysdeps/init_array/elf-init.c
index 737183181a..9fbe82e93c 100644
--- a/sysdeps/init_array/elf-init.c
+++ b/sysdeps/init_array/elf-init.c
@@ -1,5 +1,5 @@
/* Startup support for ELF initializers/finalizers in the main executable.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/init_array/gmon-start.c b/sysdeps/init_array/gmon-start.c
index 676b311bbf..3bacaf7e38 100644
--- a/sysdeps/init_array/gmon-start.c
+++ b/sysdeps/init_array/gmon-start.c
@@ -1,5 +1,5 @@
/* gmon startup hook using .preinit_array.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/init_array/pt-crti.S b/sysdeps/init_array/pt-crti.S
index fa568e7224..9bf17059dd 100644
--- a/sysdeps/init_array/pt-crti.S
+++ b/sysdeps/init_array/pt-crti.S
@@ -1,5 +1,5 @@
/* Special initializer support for libpthread.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/Makefile b/sysdeps/m68k/Makefile
index 37a2f2de82..ac0aa0fd47 100644
--- a/sysdeps/m68k/Makefile
+++ b/sysdeps/m68k/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1993-2016 Free Software Foundation, Inc.
+# Copyright (C) 1993-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -26,15 +26,24 @@ asm-CPPFLAGS += $(m68k-syntax-flag)
pic-ccflag = -fpic
+ifeq ($(subdir),csu)
+# Make sure gcrt1.o uses the large PIC model
+CFLAGS-gmon-start.c := -fPIC
+ifeq ($(build-pie-default),yes)
+# Override default PIE
+ASFLAGS-.o += -fno-pie
+endif
+endif
+
ifeq ($(subdir),setjmp)
# Make sure setjmp.c is compiled with a frame pointer
CFLAGS-setjmp.c := -fno-omit-frame-pointer
endif
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
-
ifeq ($(subdir),elf)
CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
endif
+
+ifeq ($(subdir),gmon)
+CFLAGS-mcount.c += -Wno-frame-address
+endif
diff --git a/sysdeps/m68k/__longjmp.c b/sysdeps/m68k/__longjmp.c
index db620f8994..9f8998e584 100644
--- a/sysdeps/m68k/__longjmp.c
+++ b/sysdeps/m68k/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/asm-syntax.h b/sysdeps/m68k/asm-syntax.h
index 6be0fec5ae..c347b07431 100644
--- a/sysdeps/m68k/asm-syntax.h
+++ b/sysdeps/m68k/asm-syntax.h
@@ -1,5 +1,5 @@
/* Definitions for 68k syntax variations.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in the GNU MP Library.
diff --git a/sysdeps/m68k/backtrace.c b/sysdeps/m68k/backtrace.c
index 7789d08ef6..9e13e245db 100644
--- a/sysdeps/m68k/backtrace.c
+++ b/sysdeps/m68k/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/bits/byteswap.h b/sysdeps/m68k/bits/byteswap.h
deleted file mode 100644
index ce7c4987bc..0000000000
--- a/sysdeps/m68k/bits/byteswap.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Macros to swap the order of bytes in integer values. m68k version.
- 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/>. */
-
-#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
-# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
-#endif
-
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H 1
-
-/* Swap bytes in 16 bit value. We don't provide an assembler version
- because GCC is smart enough to generate optimal assembler output, and
- this allows for better cse. */
-#define __bswap_constant_16(x) \
- ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
-
-static __always_inline unsigned short int
-__bswap_16 (unsigned short int __bsx)
-{
- return __bswap_constant_16 (__bsx);
-}
-
-/* Swap bytes in 32 bit value. */
-#define __bswap_constant_32(x) \
- ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \
- (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
-
-#if !defined(__mcoldfire__)
-static __always_inline unsigned int
-__bswap_32 (unsigned int __bsx)
-{
- if (__builtin_constant_p (__bsx))
- return __bswap_constant_32 (__bsx);
- __asm__ __volatile__ ("ror%.w %#8, %0;"
- "swap %0;"
- "ror%.w %#8, %0"
- : "+d" (__bsx));
- return __bsx;
-}
-#else
-static __always_inline unsigned int
-__bswap_32 (unsigned int __bsx)
-{
- return __bswap_constant_32 (__bsx);
-}
-#endif
-
-#if defined __GNUC__ && __GNUC__ >= 2
-/* Swap bytes in 64 bit value. */
-# define __bswap_constant_64(x) \
- __extension__ \
- ((((x) & 0xff00000000000000ull) >> 56) \
- | (((x) & 0x00ff000000000000ull) >> 40) \
- | (((x) & 0x0000ff0000000000ull) >> 24) \
- | (((x) & 0x000000ff00000000ull) >> 8) \
- | (((x) & 0x00000000ff000000ull) << 8) \
- | (((x) & 0x0000000000ff0000ull) << 24) \
- | (((x) & 0x000000000000ff00ull) << 40) \
- | (((x) & 0x00000000000000ffull) << 56))
-
-/* Swap bytes in 64 bit value. */
-__extension__
-static __always_inline unsigned long long
-__bswap_64 (unsigned long long __bsx)
-{
- if (__builtin_constant_p (__bsx))
- return __bswap_constant_64 (__bsx);
- return (__bswap_32 (__bsx >> 32)
- | ((unsigned long long) __bswap_32 (__bsx) << 32));
-}
-#endif
-
-#endif /* _BITS_BYTESWAP_H */
diff --git a/sysdeps/m68k/bits/fenv.h b/sysdeps/m68k/bits/fenv.h
new file mode 100644
index 0000000000..7050ceff24
--- /dev/null
+++ b/sysdeps/m68k/bits/fenv.h
@@ -0,0 +1,131 @@
+/* Copyright (C) 1997-2018 Free Software 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 _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+#if defined __HAVE_68881__ || defined __HAVE_FPU__ || defined __mcffpu__
+
+/* Define bits representing the exception. We use the bit positions of
+ the appropriate bits in the FPSR Accrued Exception Byte. */
+enum
+ {
+ FE_INEXACT =
+# define FE_INEXACT (1 << 3)
+ FE_INEXACT,
+ FE_DIVBYZERO =
+# define FE_DIVBYZERO (1 << 4)
+ FE_DIVBYZERO,
+ FE_UNDERFLOW =
+# define FE_UNDERFLOW (1 << 5)
+ FE_UNDERFLOW,
+ FE_OVERFLOW =
+# define FE_OVERFLOW (1 << 6)
+ FE_OVERFLOW,
+ FE_INVALID =
+# define FE_INVALID (1 << 7)
+ FE_INVALID
+ };
+
+# define FE_ALL_EXCEPT \
+ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The m68k FPU supports all of the four defined rounding modes. We use
+ the bit positions in the FPCR Mode Control Byte as the values for the
+ appropriate macros. */
+enum
+ {
+ FE_TONEAREST =
+# define FE_TONEAREST 0
+ FE_TONEAREST,
+ FE_TOWARDZERO =
+# define FE_TOWARDZERO (1 << 4)
+ FE_TOWARDZERO,
+ FE_DOWNWARD =
+# define FE_DOWNWARD (2 << 4)
+ FE_DOWNWARD,
+ FE_UPWARD =
+# define FE_UPWARD (3 << 4)
+ FE_UPWARD
+ };
+
+#else
+
+/* In the soft-float case, only rounding to nearest is supported, with
+ no exceptions. */
+
+# define FE_ALL_EXCEPT 0
+
+enum
+ {
+ __FE_UNDEFINED = -1,
+
+ FE_TONEAREST =
+# define FE_TONEAREST 0
+ FE_TONEAREST
+ };
+
+#endif
+
+
+/* Type representing exception flags. */
+typedef unsigned int fexcept_t;
+
+
+#if defined __HAVE_68881__ || defined __HAVE_FPU__ || defined __mcffpu__
+
+/* Type representing floating-point environment. This structure
+ corresponds to the layout of the block written by `fmovem'. */
+typedef struct
+ {
+ unsigned int __control_register;
+ unsigned int __status_register;
+ unsigned int __instruction_address;
+ }
+fenv_t;
+
+#else
+
+/* Keep ABI compatibility with the type used in the generic
+ bits/fenv.h, formerly used for no-FPU ColdFire. */
+typedef struct
+ {
+ fexcept_t __excepts;
+ }
+fenv_t;
+
+#endif
+
+/* If the default argument is used we use this value. */
+#define FE_DFL_ENV ((const fenv_t *) -1)
+
+#if defined __USE_GNU && (defined __HAVE_68881__ \
+ || defined __HAVE_FPU__ \
+ || defined __mcffpu__)
+/* 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/bits/link.h b/sysdeps/m68k/bits/link.h
index 69b8b838f9..c88ce6bd33 100644
--- a/sysdeps/m68k/bits/link.h
+++ b/sysdeps/m68k/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/bits/setjmp.h b/sysdeps/m68k/bits/setjmp.h
index 55568b5117..9a7826c5e8 100644
--- a/sysdeps/m68k/bits/setjmp.h
+++ b/sysdeps/m68k/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/bsd-_setjmp.c b/sysdeps/m68k/bsd-_setjmp.c
index 20f4ceaf9d..369d894059 100644
--- a/sysdeps/m68k/bsd-_setjmp.c
+++ b/sysdeps/m68k/bsd-_setjmp.c
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. m68k version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/bsd-setjmp.c b/sysdeps/m68k/bsd-setjmp.c
index 3f6dee8a91..53e51b7cfa 100644
--- a/sysdeps/m68k/bsd-setjmp.c
+++ b/sysdeps/m68k/bsd-setjmp.c
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. m68k version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/coldfire/atomic-machine.h b/sysdeps/m68k/coldfire/atomic-machine.h
index 140dd022f8..3ef9859f88 100644
--- a/sysdeps/m68k/coldfire/atomic-machine.h
+++ b/sysdeps/m68k/coldfire/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,6 +53,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 1
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
/* The only basic operation needed is compare and exchange. */
#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
({ __typeof (mem) __gmemp = (mem); \
diff --git a/sysdeps/m68k/coldfire/fpu/bits/mathinline.h b/sysdeps/m68k/coldfire/fpu/bits/mathinline.h
deleted file mode 100644
index e143db29e8..0000000000
--- a/sysdeps/m68k/coldfire/fpu/bits/mathinline.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Inline math functions for Coldfire.
- 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/>. */
-
-#ifndef _MATH_H
-# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_always_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_always_inline
-#endif
-
-#if defined __USE_ISOC99 && defined __GNUC__
-
-/* Test for negative number. Used in the signbit macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
- return __builtin_signbitf (__x);
-}
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
- return __builtin_signbit (__x);
-}
-
-#endif
diff --git a/sysdeps/m68k/coldfire/fpu/e_sqrt.c b/sysdeps/m68k/coldfire/fpu/e_sqrt.c
index ba59df60c0..3d51589eae 100644
--- a/sysdeps/m68k/coldfire/fpu/e_sqrt.c
+++ b/sysdeps/m68k/coldfire/fpu/e_sqrt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/coldfire/fpu/e_sqrtf.c b/sysdeps/m68k/coldfire/fpu/e_sqrtf.c
index 5a48aef25c..80636da591 100644
--- a/sysdeps/m68k/coldfire/fpu/e_sqrtf.c
+++ b/sysdeps/m68k/coldfire/fpu/e_sqrtf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/coldfire/fpu/fraiseexcpt.c b/sysdeps/m68k/coldfire/fpu/fraiseexcpt.c
index 3774890424..8474542cfe 100644
--- a/sysdeps/m68k/coldfire/fpu/fraiseexcpt.c
+++ b/sysdeps/m68k/coldfire/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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/coldfire/fpu/math_private.h b/sysdeps/m68k/coldfire/fpu/math_private.h
deleted file mode 100644
index d306a508b4..0000000000
--- a/sysdeps/m68k/coldfire/fpu/math_private.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef COLDFIRE_MATH_PRIVATE_H
-#define COLDFIRE_MATH_PRIVATE_H 1
-
-/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
- when built without long double support. */
-#define LDBL_CLASSIFY_COMPAT 1
-
-#include_next <math_private.h>
-
-#endif
diff --git a/sysdeps/m68k/coldfire/fpu/s_fabs.c b/sysdeps/m68k/coldfire/fpu/s_fabs.c
index a20d41ef14..50e1cfe40c 100644
--- a/sysdeps/m68k/coldfire/fpu/s_fabs.c
+++ b/sysdeps/m68k/coldfire/fpu/s_fabs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software 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,14 +15,12 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-double.h>
+
double
__fabs (double x)
{
asm ("fdabs.d %1,%0" : "=f" (x) : "fm" (x));
return x;
}
-weak_alias (__fabs, fabs)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fabs, __fabsl)
-weak_alias (__fabs, fabsl)
-#endif
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/m68k/coldfire/fpu/s_fabsf.c b/sysdeps/m68k/coldfire/fpu/s_fabsf.c
index 4287bebcaf..9b37d69782 100644
--- a/sysdeps/m68k/coldfire/fpu/s_fabsf.c
+++ b/sysdeps/m68k/coldfire/fpu/s_fabsf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software 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,10 +15,12 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-float.h>
+
float
__fabsf (float x)
{
asm ("fsabs.s %1,%0" : "=f" (x) : "dm" (x));
return x;
}
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/m68k/coldfire/fpu/s_lrint.c b/sysdeps/m68k/coldfire/fpu/s_lrint.c
index e404b42194..2a0a4b8f56 100644
--- a/sysdeps/m68k/coldfire/fpu/s_lrint.c
+++ b/sysdeps/m68k/coldfire/fpu/s_lrint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software 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,6 +15,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-double.h>
+
long int
__lrint (double x)
{
@@ -22,8 +24,4 @@ __lrint (double x)
asm ("fmove.l %1,%0" : "=dm" (result) : "f" (x));
return result;
}
-weak_alias (__lrint, lrint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/m68k/coldfire/fpu/s_lrintf.c b/sysdeps/m68k/coldfire/fpu/s_lrintf.c
index e58a48c634..66f951c9f5 100644
--- a/sysdeps/m68k/coldfire/fpu/s_lrintf.c
+++ b/sysdeps/m68k/coldfire/fpu/s_lrintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software 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,6 +15,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-float.h>
+
long int
__lrintf (float x)
{
@@ -22,4 +24,4 @@ __lrintf (float x)
asm ("fmove.l %1,%0" : "=dm" (result) : "f" (x));
return result;
}
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/m68k/coldfire/fpu/s_rint.c b/sysdeps/m68k/coldfire/fpu/s_rint.c
index e7047bfb4a..a5bc4ad223 100644
--- a/sysdeps/m68k/coldfire/fpu/s_rint.c
+++ b/sysdeps/m68k/coldfire/fpu/s_rint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software 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,14 +15,12 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-double.h>
+
double
__rint (double x)
{
asm ("fint.d %1,%0" : "=f" (x) : "fm" (x));
return x;
}
-weak_alias (__rint, rint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
-#endif
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/m68k/coldfire/fpu/s_rintf.c b/sysdeps/m68k/coldfire/fpu/s_rintf.c
index 07d989332e..d68a3fda4d 100644
--- a/sysdeps/m68k/coldfire/fpu/s_rintf.c
+++ b/sysdeps/m68k/coldfire/fpu/s_rintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software 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,6 +15,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-float.h>
+
float
__rintf (float x)
{
@@ -22,4 +24,4 @@ __rintf (float x)
asm ("fint.s %1,%0" : "=f" (result) : "dm" (x));
return (float) result;
}
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/m68k/coldfire/ldbl-classify-compat.h b/sysdeps/m68k/coldfire/ldbl-classify-compat.h
new file mode 100644
index 0000000000..c1ec4d4ffa
--- /dev/null
+++ b/sysdeps/m68k/coldfire/ldbl-classify-compat.h
@@ -0,0 +1,8 @@
+#ifndef COLDFIRE_LDBL_CLASSIFY_COMPAT_H
+#define COLDFIRE_LDBL_CLASSIFY_COMPAT_H 1
+
+/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
+ when built without long double support. */
+#define LDBL_CLASSIFY_COMPAT 1
+
+#endif
diff --git a/sysdeps/m68k/coldfire/math-tests.h b/sysdeps/m68k/coldfire/math-tests.h
new file mode 100644
index 0000000000..b05609d45d
--- /dev/null
+++ b/sysdeps/m68k/coldfire/math-tests.h
@@ -0,0 +1,29 @@
+/* Configuration for math tests. ColdFire version.
+ Copyright (C) 2018 Free Software 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/>. */
+
+/* ColdFire soft float does not support exceptions and rounding modes. */
+#ifndef __mcffpu__
+# define ROUNDING_TESTS_float(MODE) ((MODE) == FE_TONEAREST)
+# define ROUNDING_TESTS_double(MODE) ((MODE) == FE_TONEAREST)
+# define ROUNDING_TESTS_long_double(MODE) ((MODE) == FE_TONEAREST)
+# define EXCEPTION_TESTS_float 0
+# define EXCEPTION_TESTS_double 0
+# define EXCEPTION_TESTS_long_double 0
+#endif
+
+#include_next <math-tests.h>
diff --git a/sysdeps/m68k/coldfire/nofpu/Implies b/sysdeps/m68k/coldfire/nofpu/Implies
new file mode 100644
index 0000000000..abcbadb25f
--- /dev/null
+++ b/sysdeps/m68k/coldfire/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/m68k/coldfire/nofpu/s_fma.c b/sysdeps/m68k/coldfire/nofpu/s_fma.c
deleted file mode 100644
index d9613fa67c..0000000000
--- a/sysdeps/m68k/coldfire/nofpu/s_fma.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <soft-fp/fmadf4.c>
diff --git a/sysdeps/m68k/coldfire/nofpu/s_fmaf.c b/sysdeps/m68k/coldfire/nofpu/s_fmaf.c
deleted file mode 100644
index aa5c9b2d91..0000000000
--- a/sysdeps/m68k/coldfire/nofpu/s_fmaf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <soft-fp/fmasf4.c>
diff --git a/sysdeps/m68k/coldfire/sysdep.h b/sysdeps/m68k/coldfire/sysdep.h
index ce2dcbf784..7eab5047ab 100644
--- a/sysdeps/m68k/coldfire/sysdep.h
+++ b/sysdeps/m68k/coldfire/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for Coldfire.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/crti.S b/sysdeps/m68k/crti.S
index 47f5a958a0..e5f2157cd6 100644
--- a/sysdeps/m68k/crti.S
+++ b/sysdeps/m68k/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for m68k.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,6 +58,7 @@
.section .init,"ax",@progbits
.align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
link.w %fp, #0
@@ -75,6 +76,7 @@ _init:
.section .fini,"ax",@progbits
.align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
link.w %fp, #0
diff --git a/sysdeps/m68k/crtn.S b/sysdeps/m68k/crtn.S
index cf16c30c59..a1dbf67e22 100644
--- a/sysdeps/m68k/crtn.S
+++ b/sysdeps/m68k/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for m68k.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h
index 41c179c3f1..8eb2295deb 100644
--- a/sysdeps/m68k/dl-machine.h
+++ b/sysdeps/m68k/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. m68k version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -51,9 +51,15 @@ static inline Elf32_Addr
elf_machine_load_address (void)
{
Elf32_Addr addr;
+#ifdef SHARED
asm (PCREL_OP ("lea", "_dl_start", "%0", "%0", "%%pc") "\n\t"
"sub.l _dl_start@GOT.w(%%a5), %0"
: "=a" (addr));
+#else
+ asm (PCREL_OP ("lea", "_dl_relocate_static_pie", "%0", "%0", "%%pc") "\n\t"
+ "sub.l _dl_relocate_static_pie@GOT.w(%%a5), %0"
+ : "=a" (addr));
+#endif
return addr;
}
@@ -182,6 +188,7 @@ _dl_start_user:\n\
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
@@ -222,7 +229,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
{
const Elf32_Sym *const refsym = sym;
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
switch (r_type)
{
diff --git a/sysdeps/m68k/dl-tls.h b/sysdeps/m68k/dl-tls.h
index f853b99874..20d7d0d333 100644
--- a/sysdeps/m68k/dl-tls.h
+++ b/sysdeps/m68k/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. M68K version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
@@ -45,6 +45,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/m68k/dl-trampoline.S b/sysdeps/m68k/dl-trampoline.S
index 46e56e5555..7e1eace26b 100644
--- a/sysdeps/m68k/dl-trampoline.S
+++ b/sysdeps/m68k/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. m68k version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/ffs.c b/sysdeps/m68k/ffs.c
index e284315a93..cbee8c201d 100644
--- a/sysdeps/m68k/ffs.c
+++ b/sysdeps/m68k/ffs.c
@@ -1,7 +1,7 @@
/* ffs -- find first set bit in a word, counted from least significant end.
For mc68020, mc68030, mc68040.
This file is part of the GNU C Library.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
Contributed by Torbjorn Granlund (tege@sics.se).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/fpu/bits/fenv.h b/sysdeps/m68k/fpu/bits/fenv.h
deleted file mode 100644
index 2228861624..0000000000
--- a/sysdeps/m68k/fpu/bits/fenv.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* 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/>. */
-
-#ifndef _FENV_H
-# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
-#endif
-
-
-/* Define bits representing the exception. We use the bit positions of
- the appropriate bits in the FPSR Accrued Exception Byte. */
-enum
- {
- FE_INEXACT =
-#define FE_INEXACT (1 << 3)
- FE_INEXACT,
- FE_DIVBYZERO =
-#define FE_DIVBYZERO (1 << 4)
- FE_DIVBYZERO,
- FE_UNDERFLOW =
-#define FE_UNDERFLOW (1 << 5)
- FE_UNDERFLOW,
- FE_OVERFLOW =
-#define FE_OVERFLOW (1 << 6)
- FE_OVERFLOW,
- FE_INVALID =
-#define FE_INVALID (1 << 7)
- FE_INVALID
- };
-
-#define FE_ALL_EXCEPT \
- (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
-
-/* The m68k FPU supports all of the four defined rounding modes. We use
- the bit positions in the FPCR Mode Control Byte as the values for the
- appropriate macros. */
-enum
- {
- FE_TONEAREST =
-#define FE_TONEAREST 0
- FE_TONEAREST,
- FE_TOWARDZERO =
-#define FE_TOWARDZERO (1 << 4)
- FE_TOWARDZERO,
- FE_DOWNWARD =
-#define FE_DOWNWARD (2 << 4)
- FE_DOWNWARD,
- FE_UPWARD =
-#define FE_UPWARD (3 << 4)
- FE_UPWARD
- };
-
-
-/* Type representing exception flags. */
-typedef unsigned int fexcept_t;
-
-
-/* Type representing floating-point environment. This structure
- corresponds to the layout of the block written by `fmovem'. */
-typedef struct
- {
- unsigned int __control_register;
- unsigned int __status_register;
- unsigned int __instruction_address;
- }
-fenv_t;
-
-/* If the default argument is used we use this value. */
-#define FE_DFL_ENV ((const fenv_t *) -1)
-
-#ifdef __USE_GNU
-/* Floating-point environment where none of the exceptions are masked. */
-# define FE_NOMASK_ENV ((const fenv_t *) -2)
-#endif
diff --git a/sysdeps/m68k/fpu/fclrexcpt.c b/sysdeps/m68k/fpu/fclrexcpt.c
index 7248cbbf82..b3bf9b760b 100644
--- a/sysdeps/m68k/fpu/fclrexcpt.c
+++ b/sysdeps/m68k/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fedisblxcpt.c b/sysdeps/m68k/fpu/fedisblxcpt.c
index 19d1668820..0e62cd47c2 100644
--- a/sysdeps/m68k/fpu/fedisblxcpt.c
+++ b/sysdeps/m68k/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>, 2000.
diff --git a/sysdeps/m68k/fpu/feenablxcpt.c b/sysdeps/m68k/fpu/feenablxcpt.c
index cdb395d962..a67c4ac6fd 100644
--- a/sysdeps/m68k/fpu/feenablxcpt.c
+++ b/sysdeps/m68k/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>, 2000.
diff --git a/sysdeps/m68k/fpu/fegetenv.c b/sysdeps/m68k/fpu/fegetenv.c
index 04ee8ebbd2..4f5774191e 100644
--- a/sysdeps/m68k/fpu/fegetenv.c
+++ b/sysdeps/m68k/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fegetexcept.c b/sysdeps/m68k/fpu/fegetexcept.c
index 65a1c1b32a..2167fb689d 100644
--- a/sysdeps/m68k/fpu/fegetexcept.c
+++ b/sysdeps/m68k/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>, 2000.
diff --git a/sysdeps/m68k/fpu/fegetmode.c b/sysdeps/m68k/fpu/fegetmode.c
new file mode 100644
index 0000000000..fb5a4cdba9
--- /dev/null
+++ b/sysdeps/m68k/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. M68K version.
+ Copyright (C) 2016-2018 Free Software 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/m68k/fpu/fegetround.c b/sysdeps/m68k/fpu/fegetround.c
index 724246f016..5dd18b2ba7 100644
--- a/sysdeps/m68k/fpu/fegetround.c
+++ b/sysdeps/m68k/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/feholdexcpt.c b/sysdeps/m68k/fpu/feholdexcpt.c
index ff00e2f9b7..b47724a2e0 100644
--- a/sysdeps/m68k/fpu/feholdexcpt.c
+++ b/sysdeps/m68k/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fesetenv.c b/sysdeps/m68k/fpu/fesetenv.c
index 59189906a3..ab7b3e25ce 100644
--- a/sysdeps/m68k/fpu/fesetenv.c
+++ b/sysdeps/m68k/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fesetexcept.c b/sysdeps/m68k/fpu/fesetexcept.c
new file mode 100644
index 0000000000..0906e526be
--- /dev/null
+++ b/sysdeps/m68k/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. M68K version.
+ Copyright (C) 2016-2018 Free Software 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)
+{
+ 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;
+}
diff --git a/sysdeps/m68k/fpu/fesetmode.c b/sysdeps/m68k/fpu/fesetmode.c
new file mode 100644
index 0000000000..3569fd08ca
--- /dev/null
+++ b/sysdeps/m68k/fpu/fesetmode.c
@@ -0,0 +1,32 @@
+/* Install given floating-point control modes. M68K version.
+ Copyright (C) 2016-2018 Free Software 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/fpu/fesetround.c b/sysdeps/m68k/fpu/fesetround.c
index a1ea0d074e..e2b0c4a98a 100644
--- a/sysdeps/m68k/fpu/fesetround.c
+++ b/sysdeps/m68k/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/feupdateenv.c b/sysdeps/m68k/fpu/feupdateenv.c
index 077f6ad3aa..ee351a2f86 100644
--- a/sysdeps/m68k/fpu/feupdateenv.c
+++ b/sysdeps/m68k/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fgetexcptflg.c b/sysdeps/m68k/fpu/fgetexcptflg.c
index 0783381466..87c29a3b89 100644
--- a/sysdeps/m68k/fpu/fgetexcptflg.c
+++ b/sysdeps/m68k/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/fsetexcptflg.c b/sysdeps/m68k/fpu/fsetexcptflg.c
index f51a129c92..1f2a5e4104 100644
--- a/sysdeps/m68k/fpu/fsetexcptflg.c
+++ b/sysdeps/m68k/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu/ftestexcept.c b/sysdeps/m68k/fpu/ftestexcept.c
index e61f0cb0cb..cb7f063873 100644
--- a/sysdeps/m68k/fpu/ftestexcept.c
+++ b/sysdeps/m68k/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
diff --git a/sysdeps/m68k/fpu_control.h b/sysdeps/m68k/fpu_control.h
index e443f2cdf8..db8b0c9c17 100644
--- a/sysdeps/m68k/fpu_control.h
+++ b/sysdeps/m68k/fpu_control.h
@@ -1,5 +1,5 @@
/* 68k FPU control word definitions.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/gccframe.h b/sysdeps/m68k/gccframe.h
index 634f021c46..c28db6c6ed 100644
--- a/sysdeps/m68k/gccframe.h
+++ b/sysdeps/m68k/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. m68k version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/jmpbuf-unwind.h b/sysdeps/m68k/jmpbuf-unwind.h
index aed4a260b1..8d0f3ffe6e 100644
--- a/sysdeps/m68k/jmpbuf-unwind.h
+++ b/sysdeps/m68k/jmpbuf-unwind.h
@@ -1,5 +1,5 @@
/* Examine __jmp_buf for unwinding frames. m68k version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/ldsodefs.h b/sysdeps/m68k/ldsodefs.h
index 0b93325168..58509ba823 100644
--- a/sysdeps/m68k/ldsodefs.h
+++ b/sysdeps/m68k/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/libc-tls.c b/sysdeps/m68k/libc-tls.c
index 9c2d002a0c..6bf81e9b4e 100644
--- a/sysdeps/m68k/libc-tls.c
+++ b/sysdeps/m68k/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. m68k version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/m68k/m680x0/add_n.S b/sysdeps/m68k/m680x0/add_n.S
index fbca15fea8..5d61884c69 100644
--- a/sysdeps/m68k/m680x0/add_n.S
+++ b/sysdeps/m68k/m680x0/add_n.S
@@ -1,7 +1,7 @@
/* mc68020 __mpn_add_n -- Add two limb vectors of the same length > 0 and store
sum in a third limb vector.
-Copyright (C) 1992-2016 Free Software Foundation, Inc.
+Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/bits/flt-eval-method.h b/sysdeps/m68k/m680x0/bits/flt-eval-method.h
new file mode 100644
index 0000000000..8bcaf79a7b
--- /dev/null
+++ b/sysdeps/m68k/m680x0/bits/flt-eval-method.h
@@ -0,0 +1,25 @@
+/* Define __GLIBC_FLT_EVAL_METHOD. M68K version.
+ Copyright (C) 2016-2018 Free Software 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/flt-eval-method.h> directly; include <math.h> instead."
+#endif
+
+/* The m68k FPUs evaluate all values in the 96-bit floating-point
+ format which is also available for the user as 'long double'. */
+#define __GLIBC_FLT_EVAL_METHOD 2
diff --git a/sysdeps/m68k/m680x0/bits/fp-logb.h b/sysdeps/m68k/m680x0/bits/fp-logb.h
new file mode 100644
index 0000000000..ab2d11a0fe
--- /dev/null
+++ b/sysdeps/m68k/m680x0/bits/fp-logb.h
@@ -0,0 +1,24 @@
+/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. M68K version.
+ Copyright (C) 2016-2018 Free Software 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/fp-logb.h> directly; include <math.h> instead."
+#endif
+
+#define __FP_LOGB0_IS_MIN 1
+#define __FP_LOGBNAN_IS_MIN 0
diff --git a/sysdeps/m68k/m680x0/bits/huge_vall.h b/sysdeps/m68k/m680x0/bits/huge_vall.h
deleted file mode 100644
index 6fcca1801d..0000000000
--- a/sysdeps/m68k/m680x0/bits/huge_vall.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* `HUGE_VALL' constant for m68k (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992-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/huge_val.h> directly; include <math.h> instead."
-#endif
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VALL (__builtin_huge_vall ())
-#elif __GNUC_PREREQ(2,96)
-# define HUGE_VALL (__extension__ 0x1.0p32767L)
-#elif defined __GNUC__
-
-# define HUGE_VALL \
- (__extension__ \
- ((union { unsigned long __l[3]; long double __ld; }) \
- { __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld)
-
-#else /* not GCC */
-
-static union { unsigned char __c[12]; long double __ld; } __huge_vall =
- { { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } };
-# define HUGE_VALL (__huge_vall.__ld)
-
-#endif /* GCC 2.95. */
diff --git a/sysdeps/m68k/m680x0/bits/mathdef.h b/sysdeps/m68k/m680x0/bits/mathdef.h
deleted file mode 100644
index a5509384c4..0000000000
--- a/sysdeps/m68k/m680x0/bits/mathdef.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* The m68k FPUs evaluate all values in the 96 bit floating-point format
- which is also available for the user as `long double'. Therefore we
- define: */
-typedef long double float_t; /* `float' expressions are evaluated as
- `long double'. */
-typedef long double double_t; /* `double' expressions are evaluated as
- `long double'. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647 - 1)
-# define FP_ILOGBNAN (2147483647)
-
-#endif /* ISO C99 */
diff --git a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
index df498eff56..fbe8d029df 100644
--- a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
@@ -1,5 +1,5 @@
/* Definitions of inline math functions implemented by the m68881/2.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,103 +28,28 @@
#ifdef __GNUC__
-#ifdef __USE_ISOC99
-/* GCC 3.1 and up have builtins that actually can be used. */
-# if !__GNUC_PREREQ (3,1)
-/* ISO C99 defines some macros to perform unordered comparisons. The
- m68k FPU supports this with special opcodes and we should use them.
- These must not be inline functions since we have to be able to handle
- all floating-point types. */
-# undef isgreater
-# undef isgreaterequal
-# undef isless
-# undef islessequal
-# undef islessgreater
-# undef isunordered
-# define isgreater(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsogt %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-
-# define isgreaterequal(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsoge %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-
-# define isless(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsolt %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-
-# define islessequal(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsole %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-
-# define islessgreater(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsogl %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-
-# define isunordered(x, y) \
- __extension__ \
- ({ char __result; \
- __asm__ ("fcmp%.x %2,%1; fsun %0" \
- : "=dm" (__result) : "f" (x), "f" (y)); \
- __result != 0; })
-# endif /* GCC 3.1 */
-
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
- __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
- return __u.__i[0] < 0;
-}
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- __extension__ union { long double __d; int __i[3]; } __u = { __d: __x };
- return __u.__i[0] < 0;
-}
-#endif
-
-
#if (!defined __NO_MATH_INLINES && defined __OPTIMIZE__) \
|| defined __LIBC_INTERNAL_MATH_INLINES
#ifdef __LIBC_INTERNAL_MATH_INLINES
/* This is used when defining the functions themselves. Define them with
__ names, and with `static inline' instead of `extern inline' so the
- bodies will always be used, never an external function call. */
+ bodies will always be used, never an external function call.
+ Note: GCC 6 objects to __attribute__ ((__leaf__)) on static functions. */
# define __m81_u(x) __CONCAT(__,x)
# define __m81_inline static __inline
+# define __m81_nth(fn) __NTHNL (fn)
#else
# define __m81_u(x) x
-# define __m81_inline __MATH_INLINE
+# define __m81_inline __MATH_INLINE
+# define __m81_nth(fn) __NTH (fn)
# define __M81_MATH_INLINES 1
#endif
-/* Define a const math function. */
-#define __m81_defun(rettype, func, args) \
- __m81_inline rettype __attribute__((__const__)) \
- __NTH (__m81_u(func) args)
+/* Define a math function. */
+#define __m81_defun(rettype, func, args, attrs) \
+ __m81_inline rettype attrs \
+ __m81_nth (__m81_u(func) args)
/* Define the three variants of a math function that has a direct
implementation in the m68k fpu. FUNC is the name for C (which will be
@@ -132,17 +57,17 @@ __NTH (__signbitl (long double __x))
is the name of the fpu operation (without leading f). */
#ifdef __USE_ISOC99
-# define __inline_mathop(func, op) \
- __inline_mathop1(double, func, op) \
- __inline_mathop1(float, __CONCAT(func,f), op) \
- __inline_mathop1(long double, __CONCAT(func,l), op)
+# define __inline_mathop(func, op, attrs) \
+ __inline_mathop1(double, func, op, attrs) \
+ __inline_mathop1(float, __CONCAT(func,f), op, attrs) \
+ __inline_mathop1(long double, __CONCAT(func,l), op, attrs)
#else
-# define __inline_mathop(func, op) \
- __inline_mathop1(double, func, op)
+# define __inline_mathop(func, op, attrs) \
+ __inline_mathop1(double, func, op, attrs)
#endif
-#define __inline_mathop1(float_type,func, op) \
- __m81_defun (float_type, func, (float_type __mathop_x)) \
+#define __inline_mathop1(float_type,func, op, attrs) \
+ __m81_defun (float_type, func, (float_type __mathop_x), attrs) \
{ \
float_type __result; \
__asm __volatile__ ("f" __STRING(op) "%.x %1, %0" \
@@ -150,53 +75,54 @@ __NTH (__signbitl (long double __x))
return __result; \
}
-__inline_mathop(__atan, atan)
-__inline_mathop(__cos, cos)
-__inline_mathop(__sin, sin)
-__inline_mathop(__tan, tan)
-__inline_mathop(__tanh, tanh)
-__inline_mathop(__fabs, abs)
+__inline_mathop(__atan, atan,)
+__inline_mathop(__cos, cos,)
+__inline_mathop(__sin, sin,)
+__inline_mathop(__tan, tan,)
+__inline_mathop(__tanh, tanh,)
+__inline_mathop(__fabs, abs, __attribute__ ((__const__)))
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-__inline_mathop(__rint, int)
-__inline_mathop(__expm1, etoxm1)
-__inline_mathop(__log1p, lognp1)
+__inline_mathop(__rint, int,)
+__inline_mathop(__expm1, etoxm1,)
+__inline_mathop(__log1p, lognp1,)
#endif
#ifdef __USE_MISC
-__inline_mathop(__significand, getman)
+__inline_mathop(__significand, getman,)
#endif
#ifdef __USE_ISOC99
-__inline_mathop(__trunc, intrz)
+__inline_mathop(__trunc, intrz, __attribute__ ((__const__)))
#endif
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
-__inline_mathop(atan, atan)
-__inline_mathop(tanh, tanh)
+__inline_mathop(atan, atan,)
+__inline_mathop(tanh, tanh,)
# if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-__inline_mathop(rint, int)
-__inline_mathop(log1p, lognp1)
+__inline_mathop(rint, int,)
+__inline_mathop(log1p, lognp1,)
# endif
# ifdef __USE_MISC
-__inline_mathop(significand, getman)
+__inline_mathop(significand, getman,)
# endif
# ifdef __USE_ISOC99
-__inline_mathop(trunc, intrz)
+__inline_mathop(trunc, intrz, __attribute__ ((__const__)))
# endif
#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
/* This macro contains the definition for the rest of the inline
- functions, using FLOAT_TYPE as the domain type and S as the suffix
- for the function names. */
+ functions, using FLOAT_TYPE as the domain type and M as a macro
+ that adds the suffix for the function names. */
-#define __inline_functions(float_type, s) \
-__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \
+#define __inline_functions(float_type, m) \
+__m81_defun (float_type, m(__floor), (float_type __x), \
+ __attribute__ ((__const__))) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
@@ -212,7 +138,8 @@ __m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \
return __result; \
} \
\
-__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \
+__m81_defun (float_type, m(__ceil), (float_type __x), \
+ __attribute__ ((__const__))) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
@@ -228,17 +155,21 @@ __m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \
return __result; \
}
-__inline_functions(double,)
+#define __CONCAT_d(arg) arg
+#define __CONCAT_f(arg) arg ## f
+#define __CONCAT_l(arg) arg ## l
+__inline_functions(double, __CONCAT_d)
#ifdef __USE_ISOC99
-__inline_functions(float,f)
-__inline_functions(long double,l)
+__inline_functions(float, __CONCAT_f)
+__inline_functions(long double, __CONCAT_l)
#endif
#undef __inline_functions
#ifdef __USE_MISC
-# define __inline_functions(float_type, s) \
-__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
+# define __inline_functions(float_type, m) \
+__m81_defun (int, m(__isinf), (float_type __value), \
+ __attribute__ ((__const__))) \
{ \
/* There is no branch-condition for infinity, \
so we must extract and examine the condition codes manually. */ \
@@ -248,7 +179,8 @@ __m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \
} \
\
-__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \
+__m81_defun (int, m(__finite), (float_type __value), \
+ __attribute__ ((__const__))) \
{ \
/* There is no branch-condition for infinity, so we must extract and \
examine the condition codes manually. */ \
@@ -258,8 +190,8 @@ __m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \
return (__fpsr & (3 << 24)) == 0; \
} \
\
-__m81_defun (float_type, __CONCAT(__scalbn,s), \
- (float_type __x, int __n)) \
+__m81_defun (float_type, m(__scalbn), \
+ (float_type __x, int __n),) \
{ \
float_type __result; \
__asm __volatile__ ("fscale%.l %1, %0" : "=f" (__result) \
@@ -267,17 +199,18 @@ __m81_defun (float_type, __CONCAT(__scalbn,s), \
return __result; \
}
-__inline_functions(double,)
-__inline_functions(float,f)
-__inline_functions(long double,l)
+__inline_functions(double, __CONCAT_d)
+__inline_functions(float, __CONCAT_f)
+__inline_functions(long double, __CONCAT_l)
# undef __inline_functions
#endif /* Use misc. */
#if defined __USE_MISC || defined __USE_XOPEN
-# define __inline_functions(float_type, s) \
-__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \
+# define __inline_functions(float_type, m) \
+__m81_defun (int, m(__isnan), (float_type __value), \
+ __attribute__ ((__const__))) \
{ \
char __result; \
__asm ("ftst%.x %1\n" \
@@ -285,10 +218,10 @@ __m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \
return __result; \
}
-__inline_functions(double,)
+__inline_functions(double, __CONCAT_d)
# ifdef __USE_MISC
-__inline_functions(float,f)
-__inline_functions(long double,l)
+__inline_functions(float, __CONCAT_f)
+__inline_functions(long double, __CONCAT_l)
# endif
# undef __inline_functions
@@ -296,14 +229,14 @@ __inline_functions(long double,l)
#ifdef __USE_ISOC99
-# define __inline_functions(float_type, s) \
-__m81_defun (float_type, __CONCAT(__scalbln,s), \
- (float_type __x, long int __n)) \
+# define __inline_functions(float_type, m) \
+__m81_defun (float_type, m(__scalbln), \
+ (float_type __x, long int __n),) \
{ \
- return __CONCAT(__scalbn,s) (__x, __n); \
+ return m(__scalbn) (__x, __n); \
} \
\
-__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) \
+__m81_defun (float_type, m(__nearbyint), (float_type __x),) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
@@ -317,44 +250,46 @@ __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) \
return __result; \
} \
\
-__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) \
+__m81_defun (long int, m(__lrint), (float_type __x),) \
{ \
long int __result; \
__asm __volatile__ ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); \
return __result; \
}
-__inline_functions (double,)
-__inline_functions (float,f)
-__inline_functions (long double,l)
+__inline_functions (double, __CONCAT_d)
+__inline_functions (float, __CONCAT_f)
+__inline_functions (long double, __CONCAT_l)
# undef __inline_functions
#endif /* Use ISO C9x */
#ifdef __USE_GNU
-# define __inline_functions(float_type, s) \
+# define __inline_functions(float_type, m) \
__m81_inline void \
-__NTH (__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
- float_type *__cosx)) \
+__m81_nth (__m81_u(m(__sincos)) \
+ (float_type __x, float_type *__sinx, float_type *__cosx)) \
{ \
__asm __volatile__ ("fsincos%.x %2,%1:%0" \
: "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \
}
-__inline_functions (double,)
-__inline_functions (float,f)
-__inline_functions (long double,l)
+__inline_functions (double, __CONCAT_d)
+__inline_functions (float, __CONCAT_f)
+__inline_functions (long double, __CONCAT_l)
# undef __inline_functions
#endif
+#undef __CONCAT_d
+#undef __CONCAT_f
+#undef __CONCAT_l
+
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
/* Define inline versions of the user visible functions. */
-/* Note that there must be no whitespace before the argument passed for
- NAME, to make token pasting work correctly with -traditional. */
# define __inline_forward_c(rettype, name, args1, args2) \
__MATH_INLINE rettype __attribute__((__const__)) \
__NTH (name args1) \
@@ -375,7 +310,7 @@ __inline_forward_c(double,ceil, (double __x), (__x))
__inline_forward_c(int,isinf, (double __value), (__value))
# endif
__inline_forward_c(int,finite, (double __value), (__value))
-__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n))
+__inline_forward(double,scalbn, (double __x, int __n), (__x, __n))
# endif
# if defined __USE_MISC || defined __USE_XOPEN
# ifndef __USE_ISOC99 /* Conflict with macro of same name. */
@@ -383,9 +318,9 @@ __inline_forward_c(int,isnan, (double __value), (__value))
# endif
# endif
# ifdef __USE_ISOC99
-__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
-__inline_forward_c(double,nearbyint, (double __value), (__value))
-__inline_forward_c(long int,lrint, (double __value), (__value))
+__inline_forward(double,scalbln, (double __x, long int __n), (__x, __n))
+__inline_forward(double,nearbyint, (double __value), (__value))
+__inline_forward(long int,lrint, (double __value), (__value))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
@@ -399,13 +334,13 @@ __inline_forward_c(float,ceilf, (float __x), (__x))
# ifdef __USE_MISC
__inline_forward_c(int,isinff, (float __value), (__value))
__inline_forward_c(int,finitef, (float __value), (__value))
-__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n))
+__inline_forward(float,scalbnf, (float __x, int __n), (__x, __n))
__inline_forward_c(int,isnanf, (float __value), (__value))
# endif
# ifdef __USE_ISOC99
-__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
-__inline_forward_c(float,nearbyintf, (float __value), (__value))
-__inline_forward_c(long int,lrintf, (float __value), (__value))
+__inline_forward(float,scalblnf, (float __x, long int __n), (__x, __n))
+__inline_forward(float,nearbyintf, (float __value), (__value))
+__inline_forward(long int,lrintf, (float __value), (__value))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
@@ -417,14 +352,14 @@ __inline_forward_c(long double,ceill, (long double __x), (__x))
# ifdef __USE_MISC
__inline_forward_c(int,isinfl, (long double __value), (__value))
__inline_forward_c(int,finitel, (long double __value), (__value))
-__inline_forward_c(long double,scalbnl, (long double __x, int __n), (__x, __n))
+__inline_forward(long double,scalbnl, (long double __x, int __n), (__x, __n))
__inline_forward_c(int,isnanl, (long double __value), (__value))
# endif
# ifdef __USE_ISOC99
-__inline_forward_c(long double,scalblnl, (long double __x, long int __n),
- (__x, __n))
-__inline_forward_c(long double,nearbyintl, (long double __value), (__value))
-__inline_forward_c(long int,lrintl, (long double __value), (__value))
+__inline_forward(long double,scalblnl, (long double __x, long int __n),
+ (__x, __n))
+__inline_forward(long double,nearbyintl, (long double __value), (__value))
+__inline_forward(long int,lrintl, (long double __value), (__value))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincosl,
diff --git a/sysdeps/m68k/m680x0/fpu/e_acos.c b/sysdeps/m68k/m680x0/fpu/e_acos.c
index 522e20985e..67a2616be7 100644
--- a/sysdeps/m68k/m680x0/fpu/e_acos.c
+++ b/sysdeps/m68k/m680x0/fpu/e_acos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/m680x0/fpu/e_atan2.c b/sysdeps/m68k/m680x0/fpu/e_atan2.c
index 05c0988787..f1cd00df78 100644
--- a/sysdeps/m68k/m680x0/fpu/e_atan2.c
+++ b/sysdeps/m68k/m680x0/fpu/e_atan2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/m680x0/fpu/slowpow.c b/sysdeps/m68k/m680x0/fpu/e_exp2f_data.c
index 1cc8931700..1cc8931700 100644
--- a/sysdeps/m68k/m680x0/fpu/slowpow.c
+++ b/sysdeps/m68k/m680x0/fpu/e_exp2f_data.c
diff --git a/sysdeps/m68k/m680x0/fpu/e_fmod.c b/sysdeps/m68k/m680x0/fpu/e_fmod.c
index e7c958bead..83dbd37e85 100644
--- a/sysdeps/m68k/m680x0/fpu/e_fmod.c
+++ b/sysdeps/m68k/m680x0/fpu/e_fmod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/m680x0/fpu/e_ilogb.c b/sysdeps/m68k/m680x0/fpu/e_ilogb.c
index 920f244f6a..e1cb2938bf 100644
--- a/sysdeps/m68k/m680x0/fpu/e_ilogb.c
+++ b/sysdeps/m68k/m680x0/fpu/e_ilogb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/m680x0/fpu/e_log2f_data.c b/sysdeps/m68k/m680x0/fpu/e_log2f_data.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/e_log2f_data.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/m68k/m680x0/fpu/e_logf_data.c b/sysdeps/m68k/m680x0/fpu/e_logf_data.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/e_logf_data.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/m68k/m680x0/fpu/e_pow.c b/sysdeps/m68k/m680x0/fpu/e_pow.c
index 34bdf464b7..a94c0e0c0d 100644
--- a/sysdeps/m68k/m680x0/fpu/e_pow.c
+++ b/sysdeps/m68k/m680x0/fpu/e_pow.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -64,7 +64,7 @@ s(__ieee754_pow) (float_type x, float_type y)
if (y == 2)
return x * x;
if (y == 0.5 && !(x_cond & __M81_COND_NEG))
- return m81(__ieee754_sqrt) (x);
+ return m81(sqrt) (x);
if (x == 10.0)
{
@@ -106,7 +106,7 @@ s(__ieee754_pow) (float_type x, float_type y)
this format and rounding won't change the result. */
{
int32_t exponent;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
GET_LDOUBLE_WORDS (exponent, i0, i1, y);
exponent = (exponent & 0x7fff) - 0x3fff;
if (exponent <= 31
diff --git a/sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c b/sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/m68k/m680x0/fpu/e_scalb.c b/sysdeps/m68k/m680x0/fpu/e_scalb.c
index 498fdbe477..efa3133363 100644
--- a/sysdeps/m68k/m680x0/fpu/e_scalb.c
+++ b/sysdeps/m68k/m680x0/fpu/e_scalb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
diff --git a/sysdeps/m68k/m680x0/fpu/fraiseexcpt.c b/sysdeps/m68k/m680x0/fpu/fraiseexcpt.c
index 0a55f25a76..99fee81548 100644
--- a/sysdeps/m68k/m680x0/fpu/fraiseexcpt.c
+++ b/sysdeps/m68k/m680x0/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
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 b/sysdeps/m68k/m680x0/fpu/libm-test-ulps
index 7667d34b84..2247a4af60 100644
--- a/sysdeps/m68k/m680x0/fpu/libm-test-ulps
+++ b/sysdeps/m68k/m680x0/fpu/libm-test-ulps
@@ -1451,14 +1451,6 @@ ifloat: 7
ildouble: 9
ldouble: 9
-Function: "pow_tonearest":
-double: 1
-float: 7
-idouble: 1
-ifloat: 7
-ildouble: 7
-ldouble: 7
-
Function: "pow_towardzero":
double: 1
float: 4
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/math-barriers.h b/sysdeps/m68k/m680x0/fpu/math-barriers.h
new file mode 100644
index 0000000000..b1b78d5f11
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/math-barriers.h
@@ -0,0 +1,37 @@
+/* Control when floating-point expressions are evaluated. M68k version.
+ Copyright (C) 2011-2018 Free Software 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 M68K_MATH_BARRIERS_H
+#define M68K_MATH_BARRIERS_H 1
+
+#define math_opt_barrier(x) \
+({ __typeof (x) __x; \
+ __asm ("" : "=f" (__x) : "0" (x)); \
+ __x; })
+#define math_force_eval(x) \
+do \
+ { \
+ __typeof (x) __x = (x); \
+ if (sizeof (x) <= sizeof (double)) \
+ __asm __volatile ("" : : "m" (__x)); \
+ else \
+ __asm __volatile ("" : : "f" (__x)); \
+ } \
+while (0)
+
+#endif
diff --git a/sysdeps/m68k/m680x0/fpu/math_errf.c b/sysdeps/m68k/m680x0/fpu/math_errf.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/math_errf.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/m68k/m680x0/fpu/math_private.h b/sysdeps/m68k/m680x0/fpu/math_private.h
deleted file mode 100644
index 2b7909535e..0000000000
--- a/sysdeps/m68k/m680x0/fpu/math_private.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef M68K_MATH_PRIVATE_H
-#define M68K_MATH_PRIVATE_H 1
-
-#define math_opt_barrier(x) \
-({ __typeof (x) __x; \
- __asm ("" : "=f" (__x) : "0" (x)); \
- __x; })
-#define math_force_eval(x) \
-do \
- { \
- __typeof (x) __x = (x); \
- if (sizeof (x) <= sizeof (double)) \
- __asm __volatile ("" : : "m" (__x)); \
- else \
- __asm __volatile ("" : : "f" (__x)); \
- } \
-while (0)
-
-#include_next <math_private.h>
-#endif
diff --git a/sysdeps/m68k/m680x0/fpu/mathimpl.h b/sysdeps/m68k/m680x0/fpu/mathimpl.h
index cebec16200..848f9cffaa 100644
--- a/sysdeps/m68k/m680x0/fpu/mathimpl.h
+++ b/sysdeps/m68k/m680x0/fpu/mathimpl.h
@@ -1,6 +1,6 @@
/* Definitions of libc internal inline math functions implemented
by the m68881/2.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,27 +20,27 @@
/* This file contains the definitions of the inline math functions that
are only used internally inside libm, not visible to the user. */
-__inline_mathop (__ieee754_acos, acos)
-__inline_mathop (__ieee754_asin, asin)
-__inline_mathop (__ieee754_cosh, cosh)
-__inline_mathop (__ieee754_sinh, sinh)
-__inline_mathop (__ieee754_exp, etox)
-__inline_mathop (__ieee754_exp2, twotox)
-__inline_mathop (__ieee754_exp10, tentox)
-__inline_mathop (__ieee754_log10, log10)
-__inline_mathop (__ieee754_log2, log2)
-__inline_mathop (__ieee754_log, logn)
-__inline_mathop (__ieee754_sqrt, sqrt)
-__inline_mathop (__ieee754_atanh, atanh)
+__inline_mathop (__ieee754_acos, acos,)
+__inline_mathop (__ieee754_asin, asin,)
+__inline_mathop (__ieee754_cosh, cosh,)
+__inline_mathop (__ieee754_sinh, sinh,)
+__inline_mathop (__ieee754_exp, etox,)
+__inline_mathop (__ieee754_exp2, twotox,)
+__inline_mathop (__ieee754_exp10, tentox,)
+__inline_mathop (__ieee754_log10, log10,)
+__inline_mathop (__ieee754_log2, log2,)
+__inline_mathop (__ieee754_log, logn,)
+__inline_mathop (__ieee754_sqrt, sqrt,)
+__inline_mathop (__ieee754_atanh, atanh,)
-__m81_defun (double, __ieee754_remainder, (double __x, double __y))
+__m81_defun (double, __ieee754_remainder, (double __x, double __y),)
{
double __result;
__asm ("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
return __result;
}
-__m81_defun (float, __ieee754_remainderf, (float __x, float __y))
+__m81_defun (float, __ieee754_remainderf, (float __x, float __y),)
{
float __result;
__asm ("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
@@ -48,21 +48,21 @@ __m81_defun (float, __ieee754_remainderf, (float __x, float __y))
}
__m81_defun (long double,
- __ieee754_remainderl, (long double __x, long double __y))
+ __ieee754_remainderl, (long double __x, long double __y),)
{
long double __result;
__asm ("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
return __result;
}
-__m81_defun (double, __ieee754_fmod, (double __x, double __y))
+__m81_defun (double, __ieee754_fmod, (double __x, double __y),)
{
double __result;
__asm ("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
return __result;
}
-__m81_defun (float, __ieee754_fmodf, (float __x, float __y))
+__m81_defun (float, __ieee754_fmodf, (float __x, float __y),)
{
float __result;
__asm ("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
@@ -70,7 +70,7 @@ __m81_defun (float, __ieee754_fmodf, (float __x, float __y))
}
__m81_defun (long double,
- __ieee754_fmodl, (long double __x, long double __y))
+ __ieee754_fmodl, (long double __x, long double __y),)
{
long double __result;
__asm ("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
diff --git a/sysdeps/m68k/m680x0/fpu/s_atan.c b/sysdeps/m68k/m680x0/fpu/s_atan.c
index 5160faee52..a6f90d3298 100644
--- a/sysdeps/m68k/m680x0/fpu/s_atan.c
+++ b/sysdeps/m68k/m680x0/fpu/s_atan.c
@@ -1,34 +1,2 @@
-/* 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 <math.h>
-
-#ifndef FUNC
-#define FUNC atan
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-__CONCATX(__,FUNC) (float_type x)
-{
- return __m81_u(__CONCATX(__,FUNC))(x);
-}
-weak_alias (__CONCATX(__,FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_atan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_atan_template.c b/sysdeps/m68k/m680x0/fpu/s_atan_template.c
new file mode 100644
index 0000000000..8696a65105
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_atan_template.c
@@ -0,0 +1,26 @@
+/* Implement atan for m68k.
+ Copyright (C) 1996-2018 Free Software 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>
+
+FLOAT
+M_DECL_FUNC (__atan) (FLOAT x)
+{
+ return __m81_u(M_SUF (__atan)) (x);
+}
+declare_mgen_alias (__atan, atan)
diff --git a/sysdeps/m68k/m680x0/fpu/s_atanf.c b/sysdeps/m68k/m680x0/fpu/s_atanf.c
index c98559a8ba..bc24155c41 100644
--- a/sysdeps/m68k/m680x0/fpu/s_atanf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_atanf.c
@@ -1,5 +1,2 @@
-#ifndef FUNC
-#define FUNC atanf
-#endif
-#define float_type float
-#include <s_atan.c>
+#include <math-type-macros-float.h>
+#include <s_atan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_atanl.c b/sysdeps/m68k/m680x0/fpu/s_atanl.c
index b7e608addd..28eea11999 100644
--- a/sysdeps/m68k/m680x0/fpu/s_atanl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_atanl.c
@@ -1,5 +1,2 @@
-#ifndef FUNC
-#define FUNC atanl
-#endif
-#define float_type long double
-#include <s_atan.c>
+#include <math-type-macros-ldouble.h>
+#include <s_atan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_ccosh.c b/sysdeps/m68k/m680x0/fpu/s_ccosh.c
deleted file mode 100644
index 47a4fb0c94..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_ccosh.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Complex cosine hyperbole function. m68k fpu version
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include "mathimpl.h"
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-#define m81(func) __m81_u(s(func))
-
-__complex__ float_type
-s(__ccosh) (__complex__ float_type x)
-{
- __complex__ float_type 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;
-
- __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix)
- : "f" (__imag__ x));
- __real__ retval = cos_ix * m81(__ieee754_cosh) (__real__ x);
- if (ix_cond & __M81_COND_ZERO)
- __imag__ retval = (signbit (__real__ x)
- ? -__imag__ x : __imag__ x);
- else
- __imag__ retval = sin_ix * m81(__ieee754_sinh) (__real__ x);
- }
- else
- {
- unsigned long rx_cond = __m81_test (__real__ x);
-
- if (rx_cond & __M81_COND_ZERO)
- {
- __real__ retval = __imag__ x - __imag__ x;
- __imag__ retval = __real__ x;
- }
- else
- {
- if (rx_cond & __M81_COND_INF)
- __real__ retval = s(fabs) (__real__ x);
- else
- __real__ retval = s(__nan) ("");
- __imag__ retval = __imag__ x - __imag__ x;
- }
- }
-
- return retval;
-}
-weak_alias (s(__ccosh), s(ccosh))
diff --git a/sysdeps/m68k/m680x0/fpu/s_ccosh_template.c b/sysdeps/m68k/m680x0/fpu/s_ccosh_template.c
new file mode 100644
index 0000000000..23308a20c3
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_ccosh_template.c
@@ -0,0 +1,68 @@
+/* Complex cosine hyperbole function. m68k fpu version
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <complex.h>
+#include <math.h>
+#include "mathimpl.h"
+
+#define s(name) M_SUF (name)
+#define m81(func) __m81_u(s(func))
+
+CFLOAT
+s(__ccosh) (CFLOAT x)
+{
+ 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 sin_ix, cos_ix;
+
+ __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix)
+ : "f" (__imag__ x));
+ __real__ retval = cos_ix * m81(__ieee754_cosh) (__real__ x);
+ if (ix_cond & __M81_COND_ZERO)
+ __imag__ retval = (signbit (__real__ x)
+ ? -__imag__ x : __imag__ x);
+ else
+ __imag__ retval = sin_ix * m81(__ieee754_sinh) (__real__ x);
+ }
+ else
+ {
+ unsigned long rx_cond = __m81_test (__real__ x);
+
+ if (rx_cond & __M81_COND_ZERO)
+ {
+ __real__ retval = __imag__ x - __imag__ x;
+ __imag__ retval = __real__ x;
+ }
+ else
+ {
+ if (rx_cond & __M81_COND_INF)
+ __real__ retval = s(fabs) (__real__ x);
+ else
+ __real__ retval = s(__nan) ("");
+ __imag__ retval = __imag__ x - __imag__ x;
+ }
+ }
+
+ return retval;
+}
+declare_mgen_alias (__ccosh, ccosh)
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_ceil.c b/sysdeps/m68k/m680x0/fpu/s_ceil.c
index 93d5ad72e5..70aeb739f1 100644
--- a/sysdeps/m68k/m680x0/fpu/s_ceil.c
+++ b/sysdeps/m68k/m680x0/fpu/s_ceil.c
@@ -1,2 +1,2 @@
-#define FUNC ceil
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_ceil_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_ceil_template.c b/sysdeps/m68k/m680x0/fpu/s_ceil_template.c
new file mode 100644
index 0000000000..a4d032d90c
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_ceil_template.c
@@ -0,0 +1,26 @@
+/* Implement ceil for m68k.
+ Copyright (C) 1996-2018 Free Software 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>
+
+FLOAT
+M_DECL_FUNC (__ceil) (FLOAT x)
+{
+ return __m81_u(M_SUF (__ceil)) (x);
+}
+declare_mgen_alias (__ceil, ceil)
diff --git a/sysdeps/m68k/m680x0/fpu/s_ceilf.c b/sysdeps/m68k/m680x0/fpu/s_ceilf.c
index b3ba6a5700..74e027e40c 100644
--- a/sysdeps/m68k/m680x0/fpu/s_ceilf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_ceilf.c
@@ -1,2 +1,2 @@
-#define FUNC ceilf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_ceil_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_ceill.c b/sysdeps/m68k/m680x0/fpu/s_ceill.c
index 2bf95b00c6..5188c2471d 100644
--- a/sysdeps/m68k/m680x0/fpu/s_ceill.c
+++ b/sysdeps/m68k/m680x0/fpu/s_ceill.c
@@ -1,2 +1,2 @@
-#define FUNC ceill
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_ceil_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cexp.c b/sysdeps/m68k/m680x0/fpu/s_cexp.c
deleted file mode 100644
index f715b77d2d..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_cexp.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Complex exponential function. m68k fpu version
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <float.h>
-#include <complex.h>
-#include <math.h>
-#include "mathimpl.h"
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-#define m81(func) __m81_u(s(func))
-
-__complex__ float_type
-s(__cexp) (__complex__ float_type x)
-{
- __complex__ float_type retval;
- unsigned long ix_cond;
-
- ix_cond = __m81_test (__imag__ x);
-
- if ((ix_cond & (__M81_COND_NAN|__M81_COND_INF)) == 0)
- {
- /* Imaginary part is finite. */
- unsigned long rx_cond = __m81_test (__real__ x);
-
- if ((rx_cond & (__M81_COND_NAN|__M81_COND_INF)) == 0)
- {
- const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
- long double sin_ix, cos_ix, exp_val;
-
- __m81_u (__sincosl) (__imag__ x, &sin_ix, &cos_ix);
-
- if (__real__ x > t)
- {
- long double exp_t = __m81_u(__ieee754_expl) (t);
- __real__ x -= t;
- sin_ix *= exp_t;
- cos_ix *= exp_t;
- if (__real__ x > t)
- {
- __real__ x -= t;
- sin_ix *= exp_t;
- cos_ix *= exp_t;
- }
- }
-
- exp_val = __m81_u(__ieee754_expl) (__real__ x);
- __real__ retval = exp_val * cos_ix;
- if (ix_cond & __M81_COND_ZERO)
- __imag__ retval = __imag__ x;
- else
- __imag__ retval = exp_val * sin_ix;
- }
- else
- {
- /* Compute the sign of the result. */
- long double remainder, pi_2;
- int quadrant;
-
- if ((rx_cond & (__M81_COND_NAN|__M81_COND_NEG)) == __M81_COND_NEG)
- __real__ retval = __imag__ retval = 0.0;
- else
- __real__ retval = __imag__ retval = __real__ x;
- __asm ("fmovecr %#0,%0\n\tfscale%.w %#-1,%0" : "=f" (pi_2));
- __asm ("fmod%.x %2,%0\n\tfmove%.l %/fpsr,%1"
- : "=f" (remainder), "=dm" (quadrant)
- : "f" (pi_2), "0" (__imag__ x));
- quadrant = (quadrant >> 16) & 0x83;
- if (quadrant & 0x80)
- quadrant ^= 0x83;
- switch (quadrant)
- {
- default:
- break;
- case 1:
- __real__ retval = -__real__ retval;
- break;
- case 2:
- __real__ retval = -__real__ retval;
- case 3:
- __imag__ retval = -__imag__ retval;
- break;
- }
- if (ix_cond & __M81_COND_ZERO && (rx_cond & __M81_COND_NAN) == 0)
- __imag__ retval = __imag__ x;
- }
- }
- else
- {
- unsigned long rx_cond = __m81_test (__real__ x);
-
- if (rx_cond & __M81_COND_INF)
- {
- /* Real part is infinite. */
- if (rx_cond & __M81_COND_NEG)
- {
- __real__ retval = __imag__ retval = 0.0;
- if (ix_cond & __M81_COND_NEG)
- __imag__ retval = -__imag__ retval;
- }
- else
- {
- __real__ retval = __real__ x;
- __imag__ retval = __imag__ x - __imag__ x;
- }
- }
- else
- __real__ retval = __imag__ retval = __imag__ x - __imag__ x;
- }
-
- return retval;
-}
-weak_alias (s(__cexp), s(cexp))
diff --git a/sysdeps/m68k/m680x0/fpu/s_cexp_template.c b/sysdeps/m68k/m680x0/fpu/s_cexp_template.c
new file mode 100644
index 0000000000..02de829470
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_cexp_template.c
@@ -0,0 +1,129 @@
+/* Complex exponential function. m68k fpu version
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <complex.h>
+#include <math.h>
+#include "mathimpl.h"
+
+#define CONCATX(a,b) __CONCAT(a,b)
+#define s(name) M_SUF (name)
+#define m81(func) __m81_u(s(func))
+
+CFLOAT
+s(__cexp) (CFLOAT x)
+{
+ CFLOAT retval;
+ unsigned long ix_cond;
+
+ ix_cond = __m81_test (__imag__ x);
+
+ if ((ix_cond & (__M81_COND_NAN|__M81_COND_INF)) == 0)
+ {
+ /* Imaginary part is finite. */
+ unsigned long rx_cond = __m81_test (__real__ x);
+
+ if ((rx_cond & (__M81_COND_NAN|__M81_COND_INF)) == 0)
+ {
+ const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
+ long double sin_ix, cos_ix, exp_val;
+
+ __m81_u (__sincosl) (__imag__ x, &sin_ix, &cos_ix);
+
+ if (__real__ x > t)
+ {
+ long double exp_t = __m81_u(__ieee754_expl) (t);
+ __real__ x -= t;
+ sin_ix *= exp_t;
+ cos_ix *= exp_t;
+ if (__real__ x > t)
+ {
+ __real__ x -= t;
+ sin_ix *= exp_t;
+ cos_ix *= exp_t;
+ }
+ }
+
+ exp_val = __m81_u(__ieee754_expl) (__real__ x);
+ __real__ retval = exp_val * cos_ix;
+ if (ix_cond & __M81_COND_ZERO)
+ __imag__ retval = __imag__ x;
+ else
+ __imag__ retval = exp_val * sin_ix;
+ }
+ else
+ {
+ /* Compute the sign of the result. */
+ long double remainder, pi_2;
+ int quadrant;
+
+ if ((rx_cond & (__M81_COND_NAN|__M81_COND_NEG)) == __M81_COND_NEG)
+ __real__ retval = __imag__ retval = 0.0;
+ else
+ __real__ retval = __imag__ retval = __real__ x;
+ __asm ("fmovecr %#0,%0\n\tfscale%.w %#-1,%0" : "=f" (pi_2));
+ __asm ("fmod%.x %2,%0\n\tfmove%.l %/fpsr,%1"
+ : "=f" (remainder), "=dm" (quadrant)
+ : "f" (pi_2), "0" (__imag__ x));
+ quadrant = (quadrant >> 16) & 0x83;
+ if (quadrant & 0x80)
+ quadrant ^= 0x83;
+ switch (quadrant)
+ {
+ default:
+ break;
+ case 1:
+ __real__ retval = -__real__ retval;
+ break;
+ case 2:
+ __real__ retval = -__real__ retval;
+ case 3:
+ __imag__ retval = -__imag__ retval;
+ break;
+ }
+ if (ix_cond & __M81_COND_ZERO && (rx_cond & __M81_COND_NAN) == 0)
+ __imag__ retval = __imag__ x;
+ }
+ }
+ else
+ {
+ unsigned long rx_cond = __m81_test (__real__ x);
+
+ if (rx_cond & __M81_COND_INF)
+ {
+ /* Real part is infinite. */
+ if (rx_cond & __M81_COND_NEG)
+ {
+ __real__ retval = __imag__ retval = 0.0;
+ if (ix_cond & __M81_COND_NEG)
+ __imag__ retval = -__imag__ retval;
+ }
+ else
+ {
+ __real__ retval = __real__ x;
+ __imag__ retval = __imag__ x - __imag__ x;
+ }
+ }
+ else
+ __real__ retval = __imag__ retval = __imag__ x - __imag__ x;
+ }
+
+ return retval;
+}
+declare_mgen_alias (__cexp, cexp)
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_cos.c b/sysdeps/m68k/m680x0/fpu/s_cos.c
index 2f1adf77f5..24e508e5c3 100644
--- a/sysdeps/m68k/m680x0/fpu/s_cos.c
+++ b/sysdeps/m68k/m680x0/fpu/s_cos.c
@@ -1,2 +1,2 @@
-#define FUNC cos
-#include <s_sin.c>
+#include <math-type-macros-double.h>
+#include <s_cos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cos_template.c b/sysdeps/m68k/m680x0/fpu/s_cos_template.c
new file mode 100644
index 0000000000..a2574debdc
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_cos_template.c
@@ -0,0 +1,30 @@
+/* Implement cos for m68k.
+ Copyright (C) 2012-2018 Free Software 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 <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__cos) (FLOAT x)
+{
+ if (__m81_test (x) & __M81_COND_INF)
+ __set_errno (EDOM);
+ return __m81_u(M_SUF (__cos)) (x);
+}
+declare_mgen_alias (__cos, cos)
diff --git a/sysdeps/m68k/m680x0/fpu/s_cosf.c b/sysdeps/m68k/m680x0/fpu/s_cosf.c
index b6d6accb4a..fcfc844dfe 100644
--- a/sysdeps/m68k/m680x0/fpu/s_cosf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_cosf.c
@@ -1,2 +1,2 @@
-#define FUNC cosf
-#include <s_sinf.c>
+#include <math-type-macros-float.h>
+#include <s_cos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cosl.c b/sysdeps/m68k/m680x0/fpu/s_cosl.c
index eb61521fdd..de8767cfe3 100644
--- a/sysdeps/m68k/m680x0/fpu/s_cosl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_cosl.c
@@ -1,2 +1,2 @@
-#define FUNC cosl
-#include <s_sinl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_cos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_csin.c b/sysdeps/m68k/m680x0/fpu/s_csin.c
deleted file mode 100644
index b8419be897..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_csin.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Complex sine function. m68k fpu version
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include "mathimpl.h"
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-#define m81(func) __m81_u(s(func))
-
-__complex__ float_type
-s(__csin) (__complex__ float_type x)
-{
- __complex__ float_type retval;
- unsigned long rx_cond = __m81_test (__real__ x);
-
- if ((rx_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0)
- {
- /* Real part is finite. */
- float_type sin_rx, cos_rx;
-
- __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_rx), "=f" (cos_rx)
- : "f" (__real__ x));
- if (rx_cond & __M81_COND_ZERO)
- __real__ retval = __real__ x;
- else
- __real__ retval = sin_rx * m81(__ieee754_cosh) (__imag__ x);
- __imag__ retval = cos_rx * m81(__ieee754_sinh) (__imag__ x);
- }
- else
- {
- unsigned long ix_cond = __m81_test (__imag__ x);
-
- __real__ retval = __real__ x - __real__ x;
- if (ix_cond & (__M81_COND_ZERO|__M81_COND_INF|__M81_COND_NAN))
- __imag__ retval = __imag__ x;
- else
- __imag__ retval = __real__ retval;
- }
-
- return retval;
-}
-weak_alias (s(__csin), s(csin))
diff --git a/sysdeps/m68k/m680x0/fpu/s_csin_template.c b/sysdeps/m68k/m680x0/fpu/s_csin_template.c
new file mode 100644
index 0000000000..1ea0b1bb77
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_csin_template.c
@@ -0,0 +1,59 @@
+/* Complex sine function. m68k fpu version
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <complex.h>
+#include <math.h>
+#include "mathimpl.h"
+
+#define s(name) M_SUF (name)
+#define m81(func) __m81_u(s(func))
+
+CFLOAT
+s(__csin) (CFLOAT x)
+{
+ 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 sin_rx, cos_rx;
+
+ __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_rx), "=f" (cos_rx)
+ : "f" (__real__ x));
+ if (rx_cond & __M81_COND_ZERO)
+ __real__ retval = __real__ x;
+ else
+ __real__ retval = sin_rx * m81(__ieee754_cosh) (__imag__ x);
+ __imag__ retval = cos_rx * m81(__ieee754_sinh) (__imag__ x);
+ }
+ else
+ {
+ unsigned long ix_cond = __m81_test (__imag__ x);
+
+ __real__ retval = __real__ x - __real__ x;
+ if (ix_cond & (__M81_COND_ZERO|__M81_COND_INF|__M81_COND_NAN))
+ __imag__ retval = __imag__ x;
+ else
+ __imag__ retval = __real__ retval;
+ }
+
+ return retval;
+}
+declare_mgen_alias (__csin, csin)
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.c
deleted file mode 100644
index c633cd8875..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_csinh.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Complex sine hyperbole function. m68k fpu version
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include "mathimpl.h"
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-#define m81(func) __m81_u(s(func))
-
-__complex__ float_type
-s(__csinh) (__complex__ float_type x)
-{
- __complex__ float_type retval;
- unsigned long ix_cond;
-
- 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;
-
- __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix)
- : "f" (__imag__ x));
- __real__ retval = cos_ix * m81(__ieee754_sinh) (__real__ x);
- if (ix_cond & __M81_COND_ZERO)
- __imag__ retval = __imag__ x;
- else
- __imag__ retval = sin_ix * m81(__ieee754_cosh) (__real__ x);
- }
- else
- {
- unsigned long rx_cond = __m81_test (__real__ x);
-
- __imag__ retval = __imag__ x - __imag__ x;
- if (rx_cond & (__M81_COND_ZERO|__M81_COND_INF|__M81_COND_NAN))
- __real__ retval = __real__ x;
- else
- __real__ retval = __imag__ retval;
- }
-
- return retval;
-}
-weak_alias (s(__csinh), s(csinh))
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinh_template.c b/sysdeps/m68k/m680x0/fpu/s_csinh_template.c
new file mode 100644
index 0000000000..26c41a290d
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_csinh_template.c
@@ -0,0 +1,62 @@
+/* Complex sine hyperbole function. m68k fpu version
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <complex.h>
+#include <math.h>
+#include "mathimpl.h"
+
+#define CONCATX(a,b) __CONCAT(a,b)
+#define s(name) M_SUF (name)
+#define m81(func) __m81_u(s(func))
+
+CFLOAT
+s(__csinh) (CFLOAT x)
+{
+ CFLOAT retval;
+ unsigned long ix_cond;
+
+ ix_cond = __m81_test (__imag__ x);
+
+ if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0)
+ {
+ /* Imaginary part is finite. */
+ FLOAT sin_ix, cos_ix;
+
+ __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix)
+ : "f" (__imag__ x));
+ __real__ retval = cos_ix * m81(__ieee754_sinh) (__real__ x);
+ if (ix_cond & __M81_COND_ZERO)
+ __imag__ retval = __imag__ x;
+ else
+ __imag__ retval = sin_ix * m81(__ieee754_cosh) (__real__ x);
+ }
+ else
+ {
+ unsigned long rx_cond = __m81_test (__real__ x);
+
+ __imag__ retval = __imag__ x - __imag__ x;
+ if (rx_cond & (__M81_COND_ZERO|__M81_COND_INF|__M81_COND_NAN))
+ __real__ retval = __real__ x;
+ else
+ __real__ retval = __imag__ retval;
+ }
+
+ return retval;
+}
+declare_mgen_alias (__csinh, csinh)
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/m680x0/fpu/s_expm1.c b/sysdeps/m68k/m680x0/fpu/s_expm1.c
index baa044ce99..3f9b4660a3 100644
--- a/sysdeps/m68k/m680x0/fpu/s_expm1.c
+++ b/sysdeps/m68k/m680x0/fpu/s_expm1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software 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,27 +15,6 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <math.h>
-#include <errno.h>
-#include "mathimpl.h"
-
-#ifndef FUNC
-# define FUNC expm1
-#endif
-#ifndef float_type
-# define float_type double
-#endif
-#ifndef o_threshold
-# define o_threshold 7.09782712893383973096e+02
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-CONCATX(__,FUNC) (float_type x)
-{
- if ((__m81_test (x) & __M81_COND_INF) == 0 && isgreater (x, o_threshold))
- __set_errno (ERANGE);
- return __m81_u(CONCATX(__, FUNC)) (x);
-}
-weak_alias (CONCATX(__, FUNC), FUNC)
+#include <math-type-macros-double.h>
+#define o_threshold 7.09782712893383973096e+02
+#include <s_expm1_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1_template.c b/sysdeps/m68k/m680x0/fpu/s_expm1_template.c
new file mode 100644
index 0000000000..f055f7781a
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_expm1_template.c
@@ -0,0 +1,30 @@
+/* Implement expm1 for m68k.
+ Copyright (C) 2012-2018 Free Software 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 <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__expm1) (FLOAT x)
+{
+ if ((__m81_test (x) & __M81_COND_INF) == 0 && isgreater (x, o_threshold))
+ __set_errno (ERANGE);
+ return __m81_u(M_SUF (__expm1)) (x);
+}
+declare_mgen_alias (__expm1, expm1)
diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1f.c b/sysdeps/m68k/m680x0/fpu/s_expm1f.c
index 2cd8ffcfeb..a36080030e 100644
--- a/sysdeps/m68k/m680x0/fpu/s_expm1f.c
+++ b/sysdeps/m68k/m680x0/fpu/s_expm1f.c
@@ -1,4 +1,3 @@
-#define FUNC expm1f
-#define float_type float
+#include <math-type-macros-float.h>
#define o_threshold 8.8722831726e+01F
-#include <s_expm1.c>
+#include <s_expm1_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1l.c b/sysdeps/m68k/m680x0/fpu/s_expm1l.c
index a2c80860ba..cfbab2843b 100644
--- a/sysdeps/m68k/m680x0/fpu/s_expm1l.c
+++ b/sysdeps/m68k/m680x0/fpu/s_expm1l.c
@@ -1,6 +1,5 @@
-#define FUNC expm1l
-#define float_type long double
+#include <math-type-macros-ldouble.h>
/* 400c0000b17217f7d1cf79ab */
#define o_threshold 1.13565234062941439487914863093465101e+04L
-#include <s_expm1.c>
+#include <s_expm1_template.c>
libm_hidden_def (__expm1l)
diff --git a/sysdeps/m68k/m680x0/fpu/s_fabs.c b/sysdeps/m68k/m680x0/fpu/s_fabs.c
index 1f0631e2ff..179a94add2 100644
--- a/sysdeps/m68k/m680x0/fpu/s_fabs.c
+++ b/sysdeps/m68k/m680x0/fpu/s_fabs.c
@@ -1,2 +1,2 @@
-#define FUNC fabs
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_fabs_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_fabs_template.c b/sysdeps/m68k/m680x0/fpu/s_fabs_template.c
new file mode 100644
index 0000000000..8af749a3f3
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_fabs_template.c
@@ -0,0 +1,26 @@
+/* Implement fabs for m68k.
+ Copyright (C) 1996-2018 Free Software 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>
+
+FLOAT
+M_DECL_FUNC (__fabs) (FLOAT x)
+{
+ return __m81_u(M_SUF (__fabs)) (x);
+}
+declare_mgen_alias (__fabs, fabs)
diff --git a/sysdeps/m68k/m680x0/fpu/s_fabsf.c b/sysdeps/m68k/m680x0/fpu/s_fabsf.c
index 8f9421998a..9072d2a76a 100644
--- a/sysdeps/m68k/m680x0/fpu/s_fabsf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_fabsf.c
@@ -1,2 +1,2 @@
-#define FUNC fabsf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_fabs_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_fabsl.c b/sysdeps/m68k/m680x0/fpu/s_fabsl.c
index 8ac14d5b8c..fa48f8ae4e 100644
--- a/sysdeps/m68k/m680x0/fpu/s_fabsl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_fabsl.c
@@ -1,2 +1,2 @@
-#define FUNC fabsl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_fabs_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_floor.c b/sysdeps/m68k/m680x0/fpu/s_floor.c
index e1219c602a..339ae2cce4 100644
--- a/sysdeps/m68k/m680x0/fpu/s_floor.c
+++ b/sysdeps/m68k/m680x0/fpu/s_floor.c
@@ -1,2 +1,2 @@
-#define FUNC floor
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_floor_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_floor_template.c b/sysdeps/m68k/m680x0/fpu/s_floor_template.c
new file mode 100644
index 0000000000..7779813d84
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_floor_template.c
@@ -0,0 +1,26 @@
+/* Implement floor for m68k.
+ Copyright (C) 1996-2018 Free Software 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>
+
+FLOAT
+M_DECL_FUNC (__floor) (FLOAT x)
+{
+ return __m81_u(M_SUF (__floor)) (x);
+}
+declare_mgen_alias (__floor, floor)
diff --git a/sysdeps/m68k/m680x0/fpu/s_floorf.c b/sysdeps/m68k/m680x0/fpu/s_floorf.c
index f4f9b9a1d8..5d998e0217 100644
--- a/sysdeps/m68k/m680x0/fpu/s_floorf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_floorf.c
@@ -1,2 +1,2 @@
-#define FUNC floorf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_floor_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_floorl.c b/sysdeps/m68k/m680x0/fpu/s_floorl.c
index 2c1ffd7d2c..2295f99845 100644
--- a/sysdeps/m68k/m680x0/fpu/s_floorl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_floorl.c
@@ -1,2 +1,2 @@
-#define FUNC floorl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_floor_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c b/sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c
index efe2116f22..657fe0c476 100644
--- a/sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_fpclassifyl.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument. m68k version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
Fixed for m68k by Andreas Schwab <schwab@suse.de>.
@@ -26,7 +26,7 @@
int
__fpclassifyl (long double x)
{
- u_int32_t ex, hx, lx;
+ uint32_t ex, hx, lx;
int retval = FP_NORMAL;
GET_LDOUBLE_WORDS (ex, hx, lx, x);
diff --git a/sysdeps/m68k/m680x0/fpu/s_frexp.c b/sysdeps/m68k/m680x0/fpu/s_frexp.c
index 34e6ad1efa..be8db3875a 100644
--- a/sysdeps/m68k/m680x0/fpu/s_frexp.c
+++ b/sysdeps/m68k/m680x0/fpu/s_frexp.c
@@ -1,53 +1,2 @@
-/* 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 <math.h>
-
-#ifndef FUNC
-#define FUNC frexp
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-__CONCATX(__,FUNC) (float_type value, int *expptr)
-{
- float_type mantissa, exponent;
- int iexponent;
- unsigned long fpsr;
-
- __asm ("ftst%.x %1\n"
- "fmove%.l %/fpsr, %0"
- : "=dm" (fpsr) : "f" (value));
- if (fpsr & (7 << 24))
- {
- /* Not finite or zero. */
- *expptr = 0;
- return value;
- }
- __asm ("fgetexp%.x %1, %0" : "=f" (exponent) : "f" (value));
- iexponent = (int) exponent + 1;
- *expptr = iexponent;
- __asm ("fscale%.l %2, %0"
- : "=f" (mantissa)
- : "0" (value), "dmi" (-iexponent));
- return mantissa;
-}
-weak_alias (__CONCATX(__,FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_frexp_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_frexp_template.c b/sysdeps/m68k/m680x0/fpu/s_frexp_template.c
new file mode 100644
index 0000000000..5036433766
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_frexp_template.c
@@ -0,0 +1,45 @@
+/* Implement frexp for m68k.
+ Copyright (C) 1996-2018 Free Software 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>
+
+FLOAT
+M_DECL_FUNC (__frexp) (FLOAT value, int *expptr)
+{
+ FLOAT mantissa, exponent;
+ int iexponent;
+ unsigned long fpsr;
+
+ __asm ("ftst%.x %1\n"
+ "fmove%.l %/fpsr, %0"
+ : "=dm" (fpsr) : "f" (value));
+ if (fpsr & (7 << 24))
+ {
+ /* Not finite or zero. */
+ *expptr = 0;
+ return value;
+ }
+ __asm ("fgetexp%.x %1, %0" : "=f" (exponent) : "f" (value));
+ iexponent = (int) exponent + 1;
+ *expptr = iexponent;
+ __asm ("fscale%.l %2, %0"
+ : "=f" (mantissa)
+ : "0" (value), "dmi" (-iexponent));
+ return mantissa;
+}
+declare_mgen_alias (__frexp, frexp)
diff --git a/sysdeps/m68k/m680x0/fpu/s_frexpf.c b/sysdeps/m68k/m680x0/fpu/s_frexpf.c
index 893b6ad3cf..6cf7ceb294 100644
--- a/sysdeps/m68k/m680x0/fpu/s_frexpf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_frexpf.c
@@ -1,3 +1,2 @@
-#define FUNC frexpf
-#define float_type float
-#include <s_frexp.c>
+#include <math-type-macros-float.h>
+#include <s_frexp_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_frexpl.c b/sysdeps/m68k/m680x0/fpu/s_frexpl.c
index e8b5edf6b4..44e67bf8d7 100644
--- a/sysdeps/m68k/m680x0/fpu/s_frexpl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_frexpl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/m680x0/fpu/s_isinf.c b/sysdeps/m68k/m680x0/fpu/s_isinf.c
index aa15e2ca90..339db1f9f4 100644
--- a/sysdeps/m68k/m680x0/fpu/s_isinf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_isinf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/m680x0/fpu/s_llrint.c b/sysdeps/m68k/m680x0/fpu/s_llrint.c
index d3f4154f42..6ca1875869 100644
--- a/sysdeps/m68k/m680x0/fpu/s_llrint.c
+++ b/sysdeps/m68k/m680x0/fpu/s_llrint.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -20,13 +20,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include "mathimpl.h"
long long int
__llrint (double x)
{
int32_t e;
- u_int32_t h, l, s;
+ uint32_t h, l, s;
long long int result;
x = __m81_u(__rint) (x);
@@ -72,4 +73,4 @@ __llrint (double x)
return result;
}
-weak_alias (__llrint, llrint)
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_llrintf.c b/sysdeps/m68k/m680x0/fpu/s_llrintf.c
index 8c8ad56023..f972cf99f1 100644
--- a/sysdeps/m68k/m680x0/fpu/s_llrintf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_llrintf.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -20,13 +20,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include "mathimpl.h"
long long int
__llrintf (float x)
{
int32_t e;
- u_int32_t i, s;
+ uint32_t i, s;
long long int result;
x = __m81_u(__rintf) (x);
@@ -62,4 +63,4 @@ __llrintf (float x)
return result;
}
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_llrintl.c b/sysdeps/m68k/m680x0/fpu/s_llrintl.c
index d239fc0a99..9caa46f98a 100644
--- a/sysdeps/m68k/m680x0/fpu/s_llrintl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -20,13 +20,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include "mathimpl.h"
long long int
__llrintl (long double x)
{
int32_t e, s;
- u_int32_t h, l;
+ uint32_t h, l;
long long int result;
x = __m81_u(__rintl) (x);
@@ -61,4 +62,4 @@ __llrintl (long double x)
return result;
}
-weak_alias (__llrintl, llrintl)
+libm_alias_ldouble (__llrint, llrint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_log1p.c b/sysdeps/m68k/m680x0/fpu/s_log1p.c
index 082618df18..5da96c5834 100644
--- a/sysdeps/m68k/m680x0/fpu/s_log1p.c
+++ b/sysdeps/m68k/m680x0/fpu/s_log1p.c
@@ -1,4 +1,34 @@
-#define FUNC log1p
-#undef weak_alias
-#define weak_alias(a,b)
-#include <s_atan.c>
+/* Implement logp1 for m68k.
+ Copyright (C) 2018 Free Software 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>
+
+#ifndef FUNC
+#define FUNC log1p
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+float_type
+__CONCATX(__,FUNC) (float_type x)
+{
+ return __m81_u(__CONCATX(__,FUNC))(x);
+}
diff --git a/sysdeps/m68k/m680x0/fpu/s_log1pf.c b/sysdeps/m68k/m680x0/fpu/s_log1pf.c
index 480c39519f..1e408ffffe 100644
--- a/sysdeps/m68k/m680x0/fpu/s_log1pf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_log1pf.c
@@ -1,4 +1,3 @@
#define FUNC log1pf
-#undef weak_alias
-#define weak_alias(a,b)
-#include <s_atanf.c>
+#define float_type float
+#include <s_log1p.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_log1pl.c b/sysdeps/m68k/m680x0/fpu/s_log1pl.c
index a4f34a4f86..ffe1d8893f 100644
--- a/sysdeps/m68k/m680x0/fpu/s_log1pl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_log1pl.c
@@ -1,4 +1,3 @@
#define FUNC log1pl
-#undef weak_alias
-#define weak_alias(a,b)
-#include <s_atanl.c>
+#define float_type long double
+#include <s_log1p.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_lrint.c b/sysdeps/m68k/m680x0/fpu/s_lrint.c
index 1096931eed..31440cfdbc 100644
--- a/sysdeps/m68k/m680x0/fpu/s_lrint.c
+++ b/sysdeps/m68k/m680x0/fpu/s_lrint.c
@@ -1,37 +1,2 @@
-/* Round argument to nearest integral value according to current rounding
- direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-
-#ifndef suffix
-#define suffix /*empty*/
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-long int
-CONCATX(__lrint,suffix) (float_type x)
-{
- return __m81_u(CONCATX(__lrint,suffix)) (x);
-}
-weak_alias (CONCATX(__lrint,suffix), CONCATX(lrint,suffix))
+#include <math-type-macros-double.h>
+#include <s_lrint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_lrint_template.c b/sysdeps/m68k/m680x0/fpu/s_lrint_template.c
new file mode 100644
index 0000000000..6a531789d2
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_lrint_template.c
@@ -0,0 +1,28 @@
+/* Round argument to nearest integral value according to current rounding
+ direction.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+long int
+M_DECL_FUNC (__lrint) (FLOAT x)
+{
+ return __m81_u(M_SUF (__lrint)) (x);
+}
+declare_mgen_alias (__lrint, lrint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_lrintf.c b/sysdeps/m68k/m680x0/fpu/s_lrintf.c
index 44924cb82f..77e753baa7 100644
--- a/sysdeps/m68k/m680x0/fpu/s_lrintf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_lrintf.c
@@ -1,3 +1,2 @@
-#define suffix f
-#define float_type float
-#include <s_lrint.c>
+#include <math-type-macros-float.h>
+#include <s_lrint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_lrintl.c b/sysdeps/m68k/m680x0/fpu/s_lrintl.c
index cd0bd23b8a..a4670b83c6 100644
--- a/sysdeps/m68k/m680x0/fpu/s_lrintl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_lrintl.c
@@ -1,3 +1,2 @@
-#define suffix l
-#define float_type long double
-#include <s_lrint.c>
+#include <math-type-macros-ldouble.h>
+#include <s_lrint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_modf.c b/sysdeps/m68k/m680x0/fpu/s_modf.c
index 11970950c2..1d1c0ea7f2 100644
--- a/sysdeps/m68k/m680x0/fpu/s_modf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_modf.c
@@ -1,53 +1,2 @@
-/* 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 <math.h>
-#include "mathimpl.h"
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-#define m81(func) __m81_u(s(func))
-
-float_type
-s(__modf) (float_type x, float_type *iptr)
-{
- float_type x_int, result;
- unsigned long x_cond;
-
- __asm ("fintrz%.x %1, %0" : "=f" (x_int) : "f" (x));
- *iptr = x_int;
- x_cond = __m81_test (x);
- if (x_cond & __M81_COND_INF)
- {
- result = 0;
- if (x_cond & __M81_COND_NEG)
- result = -result;
- }
- else if (x_cond & __M81_COND_ZERO)
- result = x;
- else
- result = x - x_int;
- return result;
-}
-weak_alias (s(__modf), s(modf))
+#include <math-type-macros-double.h>
+#include <s_modf_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_modf_template.c b/sysdeps/m68k/m680x0/fpu/s_modf_template.c
new file mode 100644
index 0000000000..a6f51bd6d7
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_modf_template.c
@@ -0,0 +1,43 @@
+/* Implement modf for m68k.
+ Copyright (C) 1996-2018 Free Software 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 "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__modf) (FLOAT x, FLOAT *iptr)
+{
+ FLOAT x_int, result;
+ unsigned long x_cond;
+
+ __asm ("fintrz%.x %1, %0" : "=f" (x_int) : "f" (x));
+ *iptr = x_int;
+ x_cond = __m81_test (x);
+ if (x_cond & __M81_COND_INF)
+ {
+ result = 0;
+ if (x_cond & __M81_COND_NEG)
+ result = -result;
+ }
+ else if (x_cond & __M81_COND_ZERO)
+ result = x;
+ else
+ result = x - x_int;
+ return result;
+}
+declare_mgen_alias (__modf, modf)
diff --git a/sysdeps/m68k/m680x0/fpu/s_modff.c b/sysdeps/m68k/m680x0/fpu/s_modff.c
index 0c44d7c0ab..3d28880398 100644
--- a/sysdeps/m68k/m680x0/fpu/s_modff.c
+++ b/sysdeps/m68k/m680x0/fpu/s_modff.c
@@ -1,3 +1,2 @@
-#define SUFF f
-#define float_type float
-#include <s_modf.c>
+#include <math-type-macros-float.h>
+#include <s_modf_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_modfl.c b/sysdeps/m68k/m680x0/fpu/s_modfl.c
index c7075b3ba9..9057645249 100644
--- a/sysdeps/m68k/m680x0/fpu/s_modfl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_modfl.c
@@ -1,3 +1,2 @@
-#define SUFF l
-#define float_type long double
-#include <s_modf.c>
+#include <math-type-macros-ldouble.h>
+#include <s_modf_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyint.c b/sysdeps/m68k/m680x0/fpu/s_nearbyint.c
index b87f5e2160..6af0d9b1a9 100644
--- a/sysdeps/m68k/m680x0/fpu/s_nearbyint.c
+++ b/sysdeps/m68k/m680x0/fpu/s_nearbyint.c
@@ -1,2 +1,2 @@
-#define FUNC nearbyint
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_nearbyint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c b/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c
new file mode 100644
index 0000000000..971511321b
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c
@@ -0,0 +1,26 @@
+/* Implement nearbyint for m68k.
+ Copyright (C) 1996-2018 Free Software 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>
+
+FLOAT
+M_DECL_FUNC (__nearbyint) (FLOAT x)
+{
+ return __m81_u(M_SUF (__nearbyint)) (x);
+}
+declare_mgen_alias (__nearbyint, nearbyint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c b/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c
index 70d08ab44c..aefd7fc7c5 100644
--- a/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c
@@ -1,2 +1,2 @@
-#define FUNC nearbyintf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_nearbyint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c b/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c
index 230cd7784c..8516caf947 100644
--- a/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c
@@ -1,2 +1,2 @@
-#define FUNC nearbyintl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_nearbyint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_nextafterl.c b/sysdeps/m68k/m680x0/fpu/s_nextafterl.c
index c46c0e76ec..76e900055f 100644
--- a/sysdeps/m68k/m680x0/fpu/s_nextafterl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_nextafterl.c
@@ -28,12 +28,13 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
long double __nextafterl(long double x, long double y)
{
int32_t ix,iy,esx,esy;
- u_int32_t hx,hy,lx,ly;
+ uint32_t hx,hy,lx,ly;
GET_LDOUBLE_WORDS(esx,hx,lx,x);
GET_LDOUBLE_WORDS(esy,hy,ly,y);
diff --git a/sysdeps/m68k/m680x0/fpu/s_remquo.c b/sysdeps/m68k/m680x0/fpu/s_remquo.c
index ef9c4e4c27..b1d8f3a972 100644
--- a/sysdeps/m68k/m680x0/fpu/s_remquo.c
+++ b/sysdeps/m68k/m680x0/fpu/s_remquo.c
@@ -1,46 +1,2 @@
-/* Compute remainder and a congruent to the quotient. m68k fpu version
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.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)
-
-float_type
-s(__remquo) (float_type x, float_type y, int *quo)
-{
- float_type result;
- int cquo, fpsr;
-
- __asm ("frem%.x %2,%0\n\tfmove%.l %/fpsr,%1"
- : "=f" (result), "=dm" (fpsr) : "f" (y), "0" (x));
- cquo = (fpsr >> 16) & 0x7f;
- if (fpsr & (1 << 23))
- cquo = -cquo;
- *quo = cquo;
- return result;
-}
-weak_alias (s(__remquo), s(remquo))
+#include <math-type-macros-double.h>
+#include <s_remquo_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_remquo_template.c b/sysdeps/m68k/m680x0/fpu/s_remquo_template.c
new file mode 100644
index 0000000000..e7c7be6271
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_remquo_template.c
@@ -0,0 +1,36 @@
+/* Compute remainder and a congruent to the quotient. m68k fpu version
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__remquo) (FLOAT x, FLOAT y, int *quo)
+{
+ FLOAT result;
+ int cquo, fpsr;
+
+ __asm ("frem%.x %2,%0\n\tfmove%.l %/fpsr,%1"
+ : "=f" (result), "=dm" (fpsr) : "f" (y), "0" (x));
+ cquo = (fpsr >> 16) & 0x7f;
+ if (fpsr & (1 << 23))
+ cquo = -cquo;
+ *quo = cquo;
+ return result;
+}
+declare_mgen_alias (__remquo, remquo)
diff --git a/sysdeps/m68k/m680x0/fpu/s_remquof.c b/sysdeps/m68k/m680x0/fpu/s_remquof.c
index 8a292fc26c..f2b86628d2 100644
--- a/sysdeps/m68k/m680x0/fpu/s_remquof.c
+++ b/sysdeps/m68k/m680x0/fpu/s_remquof.c
@@ -1,3 +1,2 @@
-#define SUFF f
-#define float_type float
-#include <s_remquo.c>
+#include <math-type-macros-float.h>
+#include <s_remquo_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_remquol.c b/sysdeps/m68k/m680x0/fpu/s_remquol.c
index d236cfd1f9..cb18d9e520 100644
--- a/sysdeps/m68k/m680x0/fpu/s_remquol.c
+++ b/sysdeps/m68k/m680x0/fpu/s_remquol.c
@@ -1,3 +1,2 @@
-#define SUFF l
-#define float_type long double
-#include <s_remquo.c>
+#include <math-type-macros-ldouble.h>
+#include <s_remquo_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_rint.c b/sysdeps/m68k/m680x0/fpu/s_rint.c
index f0f18c7346..fa092c07eb 100644
--- a/sysdeps/m68k/m680x0/fpu/s_rint.c
+++ b/sysdeps/m68k/m680x0/fpu/s_rint.c
@@ -1,2 +1,2 @@
-#define FUNC rint
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_rint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_rint_template.c b/sysdeps/m68k/m680x0/fpu/s_rint_template.c
new file mode 100644
index 0000000000..4f4ef12aab
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_rint_template.c
@@ -0,0 +1,26 @@
+/* Implement rint for m68k.
+ Copyright (C) 1996-2018 Free Software 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>
+
+FLOAT
+M_DECL_FUNC (__rint) (FLOAT x)
+{
+ return __m81_u(M_SUF (__rint)) (x);
+}
+declare_mgen_alias (__rint, rint)
diff --git a/sysdeps/m68k/m680x0/fpu/s_rintf.c b/sysdeps/m68k/m680x0/fpu/s_rintf.c
index 4e00cab0fb..5cda19c690 100644
--- a/sysdeps/m68k/m680x0/fpu/s_rintf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_rintf.c
@@ -1,2 +1,2 @@
-#define FUNC rintf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_rint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_rintl.c b/sysdeps/m68k/m680x0/fpu/s_rintl.c
index 305667b3a1..df393ee895 100644
--- a/sysdeps/m68k/m680x0/fpu/s_rintl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_rintl.c
@@ -1,2 +1,2 @@
-#define FUNC rintl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_rint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_scalbn.c b/sysdeps/m68k/m680x0/fpu/s_scalbn.c
index 886a13dcaf..eed3a351fe 100644
--- a/sysdeps/m68k/m680x0/fpu/s_scalbn.c
+++ b/sysdeps/m68k/m680x0/fpu/s_scalbn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/m680x0/fpu/s_significand.c b/sysdeps/m68k/m680x0/fpu/s_significand.c
index 34d4ea3d14..3259d4ee6a 100644
--- a/sysdeps/m68k/m680x0/fpu/s_significand.c
+++ b/sysdeps/m68k/m680x0/fpu/s_significand.c
@@ -1,2 +1,21 @@
-#define FUNC significand
-#include <s_atan.c>
+/* Implement significand for m68k.
+ Copyright (C) 1996-2018 Free Software 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 FUNC significand
+#include <s_log1p.c>
+weak_alias (__significand, significand)
diff --git a/sysdeps/m68k/m680x0/fpu/s_significandf.c b/sysdeps/m68k/m680x0/fpu/s_significandf.c
index 4e769ca317..95da7cf969 100644
--- a/sysdeps/m68k/m680x0/fpu/s_significandf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_significandf.c
@@ -1,2 +1,4 @@
-#define FUNC significandf
-#include <s_atanf.c>
+#define FUNC significandf
+#define float_type float
+#include <s_log1p.c>
+weak_alias (__significandf, significandf)
diff --git a/sysdeps/m68k/m680x0/fpu/s_significandl.c b/sysdeps/m68k/m680x0/fpu/s_significandl.c
index 8c6fc7e610..356b48d138 100644
--- a/sysdeps/m68k/m680x0/fpu/s_significandl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_significandl.c
@@ -1,2 +1,4 @@
#define FUNC significandl
-#include <s_atanl.c>
+#define float_type long double
+#include <s_log1p.c>
+weak_alias (__significandl, significandl)
diff --git a/sysdeps/m68k/m680x0/fpu/s_sin.c b/sysdeps/m68k/m680x0/fpu/s_sin.c
index 9b54adb849..b52e804ab9 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sin.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sin.c
@@ -1,38 +1,2 @@
-/* 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/>. */
-
-#include <math.h>
-#include <errno.h>
-#include "mathimpl.h"
-
-#ifndef FUNC
-# define FUNC sin
-#endif
-#ifndef float_type
-# define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-CONCATX(__,FUNC) (float_type x)
-{
- if (__m81_test (x) & __M81_COND_INF)
- __set_errno (EDOM);
- return __m81_u(CONCATX(__, FUNC)) (x);
-}
-weak_alias (CONCATX(__, FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_sin_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sin_template.c b/sysdeps/m68k/m680x0/fpu/s_sin_template.c
new file mode 100644
index 0000000000..6872889710
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_sin_template.c
@@ -0,0 +1,30 @@
+/* Implement sin for m68k.
+ Copyright (C) 2012-2018 Free Software 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 <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__sin) (FLOAT x)
+{
+ if (__m81_test (x) & __M81_COND_INF)
+ __set_errno (EDOM);
+ return __m81_u(M_SUF (__sin)) (x);
+}
+declare_mgen_alias (__sin, sin)
diff --git a/sysdeps/m68k/m680x0/fpu/s_sincos.c b/sysdeps/m68k/m680x0/fpu/s_sincos.c
index f681b16bf7..9226798fd7 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sincos.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sincos.c
@@ -1,34 +1,2 @@
-/* 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 <math.h>
-
-#ifndef FUNC
-#define FUNC sincos
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-void
-CONCATX(__,FUNC) (float_type x, float_type *sinx, float_type *cosx)
-{
- __m81_u(CONCATX(__,FUNC))(x, sinx, cosx);
-}
-weak_alias (CONCATX(__,FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_sincos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sincos_template.c b/sysdeps/m68k/m680x0/fpu/s_sincos_template.c
new file mode 100644
index 0000000000..5d2af7e4ba
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_sincos_template.c
@@ -0,0 +1,26 @@
+/* Implement sincos for m68k.
+ Copyright (C) 1997-2018 Free Software 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>
+
+void
+M_DECL_FUNC (__sincos) (FLOAT x, FLOAT *sinx, FLOAT *cosx)
+{
+ __m81_u(M_SUF (__sincos)) (x, sinx, cosx);
+}
+declare_mgen_alias (__sincos, sincos)
diff --git a/sysdeps/m68k/m680x0/fpu/s_sincosf.c b/sysdeps/m68k/m680x0/fpu/s_sincosf.c
index 7ee2ec6600..581388bdc6 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sincosf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sincosf.c
@@ -1,3 +1,2 @@
-#define FUNC sincosf
-#define float_type float
-#include <s_sincos.c>
+#include <math-type-macros-float.h>
+#include <s_sincos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sincosl.c b/sysdeps/m68k/m680x0/fpu/s_sincosl.c
index f998cc0977..6a88d3e88a 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sincosl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sincosl.c
@@ -1,3 +1,2 @@
-#define FUNC sincosl
-#define float_type long double
-#include <s_sincos.c>
+#include <math-type-macros-ldouble.h>
+#include <s_sincos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sinf.c b/sysdeps/m68k/m680x0/fpu/s_sinf.c
index 304f4f76f6..7868705d27 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sinf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sinf.c
@@ -1,5 +1,2 @@
-#ifndef FUNC
-# define FUNC sinf
-#endif
-#define float_type float
-#include <s_sin.c>
+#include <math-type-macros-float.h>
+#include <s_sin_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sinl.c b/sysdeps/m68k/m680x0/fpu/s_sinl.c
index 31dac0bee7..f542d1b096 100644
--- a/sysdeps/m68k/m680x0/fpu/s_sinl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_sinl.c
@@ -1,5 +1,2 @@
-#ifndef FUNC
-# define FUNC sinl
-#endif
-#define float_type long double
-#include <s_sin.c>
+#include <math-type-macros-ldouble.h>
+#include <s_sin_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tan.c b/sysdeps/m68k/m680x0/fpu/s_tan.c
index dfbbbb2270..c680a6b041 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tan.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tan.c
@@ -1,2 +1,2 @@
-#define FUNC tan
-#include <s_sin.c>
+#include <math-type-macros-double.h>
+#include <s_tan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tan_template.c b/sysdeps/m68k/m680x0/fpu/s_tan_template.c
new file mode 100644
index 0000000000..54ec165f90
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_tan_template.c
@@ -0,0 +1,30 @@
+/* Implement tan for m68k.
+ Copyright (C) 2012-2018 Free Software 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 <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__tan) (FLOAT x)
+{
+ if (__m81_test (x) & __M81_COND_INF)
+ __set_errno (EDOM);
+ return __m81_u(M_SUF (__tan)) (x);
+}
+declare_mgen_alias (__tan, tan)
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanf.c b/sysdeps/m68k/m680x0/fpu/s_tanf.c
index 9ae66ddbf3..a95d4d757c 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tanf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tanf.c
@@ -1,2 +1,2 @@
-#define FUNC tanf
-#include <s_sinf.c>
+#include <math-type-macros-float.h>
+#include <s_tan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanh.c b/sysdeps/m68k/m680x0/fpu/s_tanh.c
index ac2e7dbb79..11d4bc4f71 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tanh.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tanh.c
@@ -1,2 +1,2 @@
-#define FUNC tanh
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_tanh_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanh_template.c b/sysdeps/m68k/m680x0/fpu/s_tanh_template.c
new file mode 100644
index 0000000000..e7122a651c
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_tanh_template.c
@@ -0,0 +1,26 @@
+/* Implement tanh for m68k.
+ Copyright (C) 1996-2018 Free Software 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>
+
+FLOAT
+M_DECL_FUNC (__tanh) (FLOAT x)
+{
+ return __m81_u(M_SUF (__tanh)) (x);
+}
+declare_mgen_alias (__tanh, tanh)
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanhf.c b/sysdeps/m68k/m680x0/fpu/s_tanhf.c
index 1addaae4ff..40f45a2fd7 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tanhf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tanhf.c
@@ -1,2 +1,2 @@
-#define FUNC tanhf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_tanh_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanhl.c b/sysdeps/m68k/m680x0/fpu/s_tanhl.c
index 6e997911f2..72f4d8f1bc 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tanhl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tanhl.c
@@ -1,2 +1,2 @@
-#define FUNC tanhl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_tanh_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanl.c b/sysdeps/m68k/m680x0/fpu/s_tanl.c
index 27daf8f29b..099dbfde7d 100644
--- a/sysdeps/m68k/m680x0/fpu/s_tanl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_tanl.c
@@ -1,2 +1,2 @@
-#define FUNC tanl
-#include <s_sinl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_tan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_trunc.c b/sysdeps/m68k/m680x0/fpu/s_trunc.c
index 96f29a776c..a9f0c4b9db 100644
--- a/sysdeps/m68k/m680x0/fpu/s_trunc.c
+++ b/sysdeps/m68k/m680x0/fpu/s_trunc.c
@@ -1,2 +1,2 @@
-#define FUNC trunc
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_trunc_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_trunc_template.c b/sysdeps/m68k/m680x0/fpu/s_trunc_template.c
new file mode 100644
index 0000000000..39a6822cfb
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/s_trunc_template.c
@@ -0,0 +1,26 @@
+/* Implement trunc for m68k.
+ Copyright (C) 1996-2018 Free Software 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>
+
+FLOAT
+M_DECL_FUNC (__trunc) (FLOAT x)
+{
+ return __m81_u(M_SUF (__trunc)) (x);
+}
+declare_mgen_alias (__trunc, trunc)
diff --git a/sysdeps/m68k/m680x0/fpu/s_truncf.c b/sysdeps/m68k/m680x0/fpu/s_truncf.c
index 44dca748ca..65474c779b 100644
--- a/sysdeps/m68k/m680x0/fpu/s_truncf.c
+++ b/sysdeps/m68k/m680x0/fpu/s_truncf.c
@@ -1,2 +1,2 @@
-#define FUNC truncf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_trunc_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_truncl.c b/sysdeps/m68k/m680x0/fpu/s_truncl.c
index 8d35777aed..cbb87540cf 100644
--- a/sysdeps/m68k/m680x0/fpu/s_truncl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_truncl.c
@@ -1,2 +1,2 @@
-#define FUNC truncl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_trunc_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_exp2f.c b/sysdeps/m68k/m680x0/fpu/w_exp2f.c
new file mode 100644
index 0000000000..583065d12a
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_exp2f.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_exp2f.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_expf.c b/sysdeps/m68k/m680x0/fpu/w_expf.c
new file mode 100644
index 0000000000..b5fe164520
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_expf.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_expf.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_log2f.c b/sysdeps/m68k/m680x0/fpu/w_log2f.c
new file mode 100644
index 0000000000..3f5c71cec2
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_log2f.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_log2f.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_logf.c b/sysdeps/m68k/m680x0/fpu/w_logf.c
new file mode 100644
index 0000000000..ea48d1356e
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_logf.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_logf.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_powf.c b/sysdeps/m68k/m680x0/fpu/w_powf.c
new file mode 100644
index 0000000000..d133216f5b
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/w_powf.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_powf.c>
diff --git a/sysdeps/m68k/m680x0/lshift.S b/sysdeps/m68k/m680x0/lshift.S
index b5f5f74ac2..bba11c46dc 100644
--- a/sysdeps/m68k/m680x0/lshift.S
+++ b/sysdeps/m68k/m680x0/lshift.S
@@ -1,6 +1,6 @@
/* mc68020 __mpn_lshift -- Shift left a low-level natural-number integer.
-Copyright (C) 1996-2016 Free Software Foundation, Inc.
+Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/m68020/addmul_1.S b/sysdeps/m68k/m680x0/m68020/addmul_1.S
index 2c94465cb1..2eee6d1543 100644
--- a/sysdeps/m68k/m680x0/m68020/addmul_1.S
+++ b/sysdeps/m68k/m680x0/m68020/addmul_1.S
@@ -1,7 +1,7 @@
/* mc68020 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
the result to a second limb vector.
-Copyright (C) 1992-2016 Free Software Foundation, Inc.
+Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/m68020/atomic-machine.h b/sysdeps/m68k/m680x0/m68020/atomic-machine.h
index 24bc5c5ef7..1bc695d418 100644
--- a/sysdeps/m68k/m680x0/m68020/atomic-machine.h
+++ b/sysdeps/m68k/m680x0/m68020/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>, 2003.
@@ -47,6 +47,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 1
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
({ __typeof (*(mem)) __ret; \
__asm __volatile ("cas%.b %0,%2,%1" \
@@ -73,7 +76,7 @@ typedef uintmax_t uatomic_max_t;
__typeof (mem) __memp = (mem); \
__asm __volatile ("cas2%.l %0:%R0,%1:%R1,(%2):(%3)" \
: "=d" (__ret) \
- : "d" (newval), "r" (__memp), \
+ : "d" ((__typeof (*(mem))) (newval)), "r" (__memp), \
"r" ((char *) __memp + 4), "0" (oldval) \
: "memory"); \
__ret; })
@@ -101,8 +104,9 @@ typedef uintmax_t uatomic_max_t;
__asm __volatile ("1: cas2%.l %0:%R0,%1:%R1,(%2):(%3);" \
" jbne 1b" \
: "=d" (__result) \
- : "d" (newvalue), "r" (__memp), \
- "r" ((char *) __memp + 4), "0" (__result) \
+ : "d" ((__typeof (*(mem))) (newvalue)), \
+ "r" (__memp), "r" ((char *) __memp + 4), \
+ "0" (__result) \
: "memory"); \
} \
__result; })
@@ -144,7 +148,7 @@ typedef uintmax_t uatomic_max_t;
" cas2%.l %0:%R0,%1:%R1,(%3):(%4);" \
" jbne 1b" \
: "=d" (__result), "=&d" (__temp) \
- : "d" (value), "r" (__memp), \
+ : "d" ((__typeof (*(mem))) (value)), "r" (__memp), \
"r" ((char *) __memp + 4), "0" (__result) \
: "memory"); \
} \
@@ -175,8 +179,9 @@ typedef uintmax_t uatomic_max_t;
" cas2%.l %0:%R0,%1:%R1,(%3):(%4);" \
" jbne 1b" \
: "=d" (__oldval), "=&d" (__temp) \
- : "d" (value), "r" (__memp), \
- "r" ((char *) __memp + 4), "0" (__oldval) \
+ : "d" ((__typeof (*(mem))) (value)), \
+ "r" (__memp), "r" ((char *) __memp + 4), \
+ "0" (__oldval) \
: "memory"); \
} \
})
diff --git a/sysdeps/m68k/m680x0/m68020/bits/string.h b/sysdeps/m68k/m680x0/m68020/bits/string.h
deleted file mode 100644
index 78c95943e1..0000000000
--- a/sysdeps/m68k/m680x0/m68020/bits/string.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Optimized, inlined string functions. m680x0 version, x >= 2.
- 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/>. */
-
-#ifndef _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* Use the unaligned string inline ABI. */
-#define _STRING_INLINE_unaligned 1
diff --git a/sysdeps/m68k/m680x0/m68020/mul_1.S b/sysdeps/m68k/m680x0/m68020/mul_1.S
index 8b1c27e578..2d7720672e 100644
--- a/sysdeps/m68k/m680x0/m68020/mul_1.S
+++ b/sysdeps/m68k/m680x0/m68020/mul_1.S
@@ -1,7 +1,7 @@
/* mc68020 __mpn_mul_1 -- Multiply a limb vector with a limb and store
the result in a second limb vector.
-Copyright (C) 1992-2016 Free Software Foundation, Inc.
+Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/m68020/string_private.h b/sysdeps/m68k/m680x0/m68020/string_private.h
index 6846663811..3c372a18b3 100644
--- a/sysdeps/m68k/m680x0/m68020/string_private.h
+++ b/sysdeps/m68k/m680x0/m68020/string_private.h
@@ -1,5 +1,5 @@
/* Define _STRING_ARCH_unaligned. m680x0 version, x >= 2.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/m680x0/m68020/submul_1.S b/sysdeps/m68k/m680x0/m68020/submul_1.S
index 5ec3064a6c..edb0975e6d 100644
--- a/sysdeps/m68k/m680x0/m68020/submul_1.S
+++ b/sysdeps/m68k/m680x0/m68020/submul_1.S
@@ -1,7 +1,7 @@
/* mc68020 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
the result from a second limb vector.
-Copyright (C) 1992-2016 Free Software Foundation, Inc.
+Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/rshift.S b/sysdeps/m68k/m680x0/rshift.S
index 6e351d4fc6..db9d60b3db 100644
--- a/sysdeps/m68k/m680x0/rshift.S
+++ b/sysdeps/m68k/m680x0/rshift.S
@@ -1,6 +1,6 @@
/* mc68020 __mpn_rshift -- Shift right a low-level natural-number integer.
-Copyright (C) 1996-2016 Free Software Foundation, Inc.
+Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/sub_n.S b/sysdeps/m68k/m680x0/sub_n.S
index e62772ad56..5e7732e3af 100644
--- a/sysdeps/m68k/m680x0/sub_n.S
+++ b/sysdeps/m68k/m680x0/sub_n.S
@@ -1,7 +1,7 @@
/* mc68020 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
store difference in a third limb vector.
-Copyright (C) 1992-2016 Free Software Foundation, Inc.
+Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/m68k/m680x0/sysdep.h b/sysdeps/m68k/m680x0/sysdep.h
index e53887786e..5430f4236e 100644
--- a/sysdeps/m68k/m680x0/sysdep.h
+++ b/sysdeps/m68k/m680x0/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for m680x0.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/memchr.S b/sysdeps/m68k/memchr.S
index a29b9a3aed..89cd8f6e91 100644
--- a/sysdeps/m68k/memchr.S
+++ b/sysdeps/m68k/memchr.S
@@ -1,7 +1,7 @@
/* memchr (str, ch, n) -- Return pointer to first occurrence of CH in the
first N bytes of STR.
For Motorola 68000.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
diff --git a/sysdeps/m68k/memcopy.h b/sysdeps/m68k/memcopy.h
index 33a20640cf..58569c61c2 100644
--- a/sysdeps/m68k/memcopy.h
+++ b/sysdeps/m68k/memcopy.h
@@ -1,5 +1,5 @@
/* memcopy.h -- definitions for memory copy functions. Motorola 68020 version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/sysdeps/m68k/memusage.h b/sysdeps/m68k/memusage.h
index c1e78e3591..eb88e203d7 100644
--- a/sysdeps/m68k/memusage.h
+++ b/sysdeps/m68k/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/nptl/Makefile b/sysdeps/m68k/nptl/Makefile
index 8b445c019d..97126b5971 100644
--- a/sysdeps/m68k/nptl/Makefile
+++ b/sysdeps/m68k/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2010-2016 Free Software Foundation, Inc.
+# Copyright (C) 2010-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
#
diff --git a/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h b/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..53e2d01db8
--- /dev/null
+++ b/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <endian.h>
+
+#define __SIZEOF_PTHREAD_ATTR_T 36
+#define __SIZEOF_PTHREAD_MUTEX_T 24
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCK_T 32
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIER_T 20
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Data structure for mutex handling. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1
+#define __PTHREAD_MUTEX_USE_UNION 1
+
+#define __LOCK_ALIGNMENT __attribute__ ((__aligned__ (4)))
+#define __ONCE_ALIGNMENT __attribute__ ((__aligned__ (4)))
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers __attribute__ ((__aligned__ (4)));
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ int __cur_writer;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/m68k/nptl/bits/pthreadtypes.h b/sysdeps/m68k/nptl/bits/pthreadtypes.h
deleted file mode 100644
index d8faa7a000..0000000000
--- a/sysdeps/m68k/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <endian.h>
-
-#define __SIZEOF_PTHREAD_ATTR_T 36
-#define __SIZEOF_PTHREAD_MUTEX_T 24
-#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-#define __SIZEOF_PTHREAD_COND_T 48
-#define __SIZEOF_PTHREAD_CONDATTR_T 4
-#define __SIZEOF_PTHREAD_RWLOCK_T 32
-#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-#define __SIZEOF_PTHREAD_BARRIER_T 20
-#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-
-
-/* Thread identifiers. The structure of the attribute type is
- deliberately not exposed. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is deliberately not exposed. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock __attribute__ ((__aligned__ (4)));
- unsigned int __count;
- int __owner;
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock __attribute__ ((__aligned__ (4)));
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int __attribute__ ((__aligned__ (4))) pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock __attribute__ ((__aligned__ (4)));
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- unsigned char __pad1;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- int __writer;
- } __data;
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align __attribute__ ((__aligned__ (4)));
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/m68k/nptl/bits/semaphore.h b/sysdeps/m68k/nptl/bits/semaphore.h
index b5b56daec9..56c1fb3cee 100644
--- a/sysdeps/m68k/nptl/bits/semaphore.h
+++ b/sysdeps/m68k/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/m68k/nptl/pthread-offsets.h b/sysdeps/m68k/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..9617354dc7
--- /dev/null
+++ b/sysdeps/m68k/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+#define __PTHREAD_MUTEX_KIND_OFFSET 12
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 20
diff --git a/sysdeps/m68k/nptl/pthread_spin_lock.c b/sysdeps/m68k/nptl/pthread_spin_lock.c
deleted file mode 100644
index 5aaee5a37f..0000000000
--- a/sysdeps/m68k/nptl/pthread_spin_lock.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
-
-/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because
- it will resolve to this very file. Using "sysdeps/.." as reference to the
- top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
diff --git a/sysdeps/m68k/nptl/pthreaddef.h b/sysdeps/m68k/nptl/pthreaddef.h
index f3299d0b7d..68fc37a394 100644
--- a/sysdeps/m68k/nptl/pthreaddef.h
+++ b/sysdeps/m68k/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/m68k/nptl/tcb-offsets.sym b/sysdeps/m68k/nptl/tcb-offsets.sym
index b1bba65868..241fb8b47c 100644
--- a/sysdeps/m68k/nptl/tcb-offsets.sym
+++ b/sysdeps/m68k/nptl/tcb-offsets.sym
@@ -7,5 +7,4 @@
#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
-PID_OFFSET thread_offsetof (pid)
TID_OFFSET thread_offsetof (tid)
diff --git a/sysdeps/m68k/nptl/tls.h b/sysdeps/m68k/nptl/tls.h
index f93228212b..53be3a02cc 100644
--- a/sysdeps/m68k/nptl/tls.h
+++ b/sysdeps/m68k/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/m68k version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
@@ -26,17 +26,7 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
@@ -144,6 +134,7 @@ extern void * __m68k_read_tp (void);
# define NO_TLS_OFFSET -1
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/m68k/preconfigure b/sysdeps/m68k/preconfigure
index 94fc1aabc2..1028dac080 100644
--- a/sysdeps/m68k/preconfigure
+++ b/sysdeps/m68k/preconfigure
@@ -13,5 +13,9 @@ m68k) variant=`(echo "#ifdef __mcoldfire__"
echo >&2 "Cannot determine m68k processor variant"
exit 1
fi
- base_machine=m68k machine=m68k/$variant ;;
+ base_machine=m68k machine=m68k/$variant
+ if test "$variant" = "coldfire"; then
+ with_fp_cond="defined __mcffpu__"
+ fi
+ ;;
esac
diff --git a/sysdeps/m68k/rawmemchr.S b/sysdeps/m68k/rawmemchr.S
index 70baab679c..3fba31ec4f 100644
--- a/sysdeps/m68k/rawmemchr.S
+++ b/sysdeps/m68k/rawmemchr.S
@@ -1,6 +1,6 @@
/* rawmemchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Motorola 68000.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
diff --git a/sysdeps/m68k/setjmp.c b/sysdeps/m68k/setjmp.c
index 9c080ea937..650367f795 100644
--- a/sysdeps/m68k/setjmp.c
+++ b/sysdeps/m68k/setjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/sotruss-lib.c b/sysdeps/m68k/sotruss-lib.c
index 609536c4bc..e6988379d3 100644
--- a/sysdeps/m68k/sotruss-lib.c
+++ b/sysdeps/m68k/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for m68k.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/stackinfo.h b/sysdeps/m68k/stackinfo.h
index edf37d051c..e700508422 100644
--- a/sysdeps/m68k/stackinfo.h
+++ b/sysdeps/m68k/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/start.S b/sysdeps/m68k/start.S
index 36dab891f0..7bab3e1cde 100644
--- a/sysdeps/m68k/start.S
+++ b/sysdeps/m68k/start.S
@@ -1,5 +1,5 @@
/* Startup code compliant to the ELF m68k ABI.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -76,7 +76,7 @@ _start:
pea (%a1) /* Push address of the shared library
termination function. */
-#ifdef SHARED
+#ifdef PIC
/* Load PIC register. */
LOAD_GOT (%a5)
diff --git a/sysdeps/m68k/strchr.S b/sysdeps/m68k/strchr.S
index 758e0a441d..e2f97f97f5 100644
--- a/sysdeps/m68k/strchr.S
+++ b/sysdeps/m68k/strchr.S
@@ -1,6 +1,6 @@
/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Motorola 68000.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
diff --git a/sysdeps/m68k/strchrnul.S b/sysdeps/m68k/strchrnul.S
index 59645979a4..ea157555c1 100644
--- a/sysdeps/m68k/strchrnul.S
+++ b/sysdeps/m68k/strchrnul.S
@@ -1,7 +1,7 @@
/* strchrnul (str, ch) -- Return pointer to first occurrence of CH in STR
or the final NUL byte.
For Motorola 68000.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
diff --git a/sysdeps/m68k/symbol-hacks.h b/sysdeps/m68k/symbol-hacks.h
new file mode 100644
index 0000000000..3b5b71ccbe
--- /dev/null
+++ b/sysdeps/m68k/symbol-hacks.h
@@ -0,0 +1,21 @@
+/* Hacks needed for symbol manipulation. m68k version.
+ Copyright (C) 2017-2018 Free Software 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 <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
+
+#include_next "symbol-hacks.h"
diff --git a/sysdeps/m68k/sys/ucontext.h b/sysdeps/m68k/sys/ucontext.h
index ef85368cb2..7b723d6862 100644
--- a/sysdeps/m68k/sys/ucontext.h
+++ b/sysdeps/m68k/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,87 +21,105 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
/* Type for general register. */
typedef int greg_t;
/* Number of general registers. */
-#define NGREG 18
+#define __NGREG 18
+#ifdef __USE_MISC
+# define NGREG __NGREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
+#ifdef __USE_MISC
/* Number of each register is the `gregset_t' array. */
enum
{
R_D0 = 0,
-#define R_D0 R_D0
+# define R_D0 R_D0
R_D1 = 1,
-#define R_D1 R_D1
+# define R_D1 R_D1
R_D2 = 2,
-#define R_D2 R_D2
+# define R_D2 R_D2
R_D3 = 3,
-#define R_D3 R_D3
+# define R_D3 R_D3
R_D4 = 4,
-#define R_D4 R_D4
+# define R_D4 R_D4
R_D5 = 5,
-#define R_D5 R_D5
+# define R_D5 R_D5
R_D6 = 6,
-#define R_D6 R_D6
+# define R_D6 R_D6
R_D7 = 7,
-#define R_D7 R_D7
+# define R_D7 R_D7
R_A0 = 8,
-#define R_A0 R_A0
+# define R_A0 R_A0
R_A1 = 9,
-#define R_A1 R_A1
+# define R_A1 R_A1
R_A2 = 10,
-#define R_A2 R_A2
+# define R_A2 R_A2
R_A3 = 11,
-#define R_A3 R_A3
+# define R_A3 R_A3
R_A4 = 12,
-#define R_A4 R_A4
+# define R_A4 R_A4
R_A5 = 13,
-#define R_A5 R_A5
+# define R_A5 R_A5
R_A6 = 14,
-#define R_A6 R_A6
+# define R_A6 R_A6
R_A7 = 15,
-#define R_A7 R_A7
+# define R_A7 R_A7
R_SP = 15,
-#define R_SP R_SP
+# define R_SP R_SP
R_PC = 16,
-#define R_PC R_PC
+# define R_PC R_PC
R_PS = 17
-#define R_PS R_PS
+# define R_PS R_PS
};
/* Structure to describe FPU registers. */
-typedef struct fpregset
+typedef struct
{
int f_pcr;
int f_psr;
int f_fpiaddr;
int f_fpregs[8][3];
} fpregset_t;
+#endif
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
/* Context to describe whole processor state. */
typedef struct
{
- int version;
- gregset_t gregs;
+ int __ctx(version);
+ gregset_t __ctx(gregs);
} mcontext_t;
-#define MCONTEXT_VERSION 1
+#ifdef __USE_MISC
+# define MCONTEXT_VERSION 1
+#endif
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
- __sigset_t uc_sigmask;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
+ sigset_t uc_sigmask;
stack_t uc_stack;
mcontext_t uc_mcontext;
- long int uc_filler[201];
+ long int __glibc_reserved1[201];
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/m68k/sysdep.h b/sysdeps/m68k/sysdep.h
index 74776d81b7..0ecb3eae9f 100644
--- a/sysdeps/m68k/sysdep.h
+++ b/sysdeps/m68k/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for m68k.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/m68k/tls-macros.h b/sysdeps/m68k/tls-macros.h
index 5ec46d71ab..cf4a78cf97 100644
--- a/sysdeps/m68k/tls-macros.h
+++ b/sysdeps/m68k/tls-macros.h
@@ -1,5 +1,5 @@
/* Macros for accessing thread-local storage. m68k version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/m68k/tst-audit.h b/sysdeps/m68k/tst-audit.h
index 76aea5c95d..d4d7369458 100644
--- a/sysdeps/m68k/tst-audit.h
+++ b/sysdeps/m68k/tst-audit.h
@@ -1,5 +1,5 @@
/* Definitions for testing PLT entry/exit auditing. m68k version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/m68k/wcpcpy.c b/sysdeps/m68k/wcpcpy.c
index bfc659949f..b87ccb69c5 100644
--- a/sysdeps/m68k/wcpcpy.c
+++ b/sysdeps/m68k/wcpcpy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
diff --git a/sysdeps/m68k/wcpcpy_chk.c b/sysdeps/m68k/wcpcpy_chk.c
index 9f408c05fe..c440af63c9 100644
--- a/sysdeps/m68k/wcpcpy_chk.c
+++ b/sysdeps/m68k/wcpcpy_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
diff --git a/sysdeps/mach/Makefile b/sysdeps/mach/Makefile
index 7d8c67c316..475894b046 100644
--- a/sysdeps/mach/Makefile
+++ b/sysdeps/mach/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1993-2016 Free Software Foundation, Inc.
+# Copyright (C) 1993-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -50,4 +50,30 @@ mach-before-compile:
before-compile += $(mach-before-compile)
endif
+ifeq (crypt,$(subdir))
+ LDLIBS-crypt.so += $(objdir)/mach/libmachuser.so
+else ifeq (dlfcn,$(subdir))
+ LDLIBS-dl.so += $(objdir)/mach/libmachuser.so
+else ifeq (nis,$(subdir))
+ LDLIBS-nsl.so += $(objdir)/mach/libmachuser.so
+ LDLIBS-nss_nis.so += $(objdir)/mach/libmachuser.so
+ LDLIBS-nss_nisplus.so += $(objdir)/mach/libmachuser.so
+ LDLIBS-nss_compat.so += $(objdir)/mach/libmachuser.so
+else ifeq (nss,$(subdir))
+ LDLIBS-nss.so += $(objdir)/mach/libmachuser.so
+ LDLIBS-nss_files.so += $(objdir)/mach/libmachuser.so
+ LDLIBS-nss_db.so += $(objdir)/mach/libmachuser.so
+ LDLIBS-nss_compat.so += $(objdir)/mach/libmachuser.so
+else ifeq (hesiod,$(subdir))
+ LDLIBS-nss_hesiod.so += $(objdir)/mach/libmachuser.so
+else ifeq (posix,$(subdir))
+ LDLIBS-tst-rfc3484 += $(objdir)/mach/libmachuser.so
+ LDLIBS-tst-rfc3484-2 += $(objdir)/mach/libmachuser.so
+ LDLIBS-tst-rfc3484-3 += $(objdir)/mach/libmachuser.so
+else ifeq (nscd,$(subdir))
+ LDLIBS-nscd += $(objdir)/mach/libmachuser.so
+endif
+
+LDLIBS-pthread.so += $(objdir)/mach/libmachuser.so
+
endif # in-Makerules
diff --git a/sysdeps/mach/_strerror.c b/sysdeps/mach/_strerror.c
index d60e2cc100..3ce7e5569c 100644
--- a/sysdeps/mach/_strerror.c
+++ b/sysdeps/mach/_strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/adjtime.c b/sysdeps/mach/adjtime.c
index bc4665fb87..11c22c55b7 100644
--- a/sysdeps/mach/adjtime.c
+++ b/sysdeps/mach/adjtime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure
index 632a9c9fa4..c6ea9be20b 100644
--- a/sysdeps/mach/configure
+++ b/sysdeps/mach/configure
@@ -282,7 +282,7 @@ if test $libc_cv_mach_task_creation_time = no; then
fi
mach_interface_list=
-for ifc in mach mach4 \
+for ifc in mach mach4 gnumach \
clock clock_priv host_priv host_security ledger lock_set \
processor processor_set task task_notify thread_act vm_map \
memory_object memory_object_default default_pager \
diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac
index 3033fec946..cadecae884 100644
--- a/sysdeps/mach/configure.ac
+++ b/sysdeps/mach/configure.ac
@@ -59,7 +59,7 @@ dnl but we don't do a check for that here because in a bare
dnl environment the compile against those headers will fail.
dnl
mach_interface_list=
-for ifc in mach mach4 \
+for ifc in mach mach4 gnumach \
clock clock_priv host_priv host_security ledger lock_set \
processor processor_set task task_notify thread_act vm_map \
memory_object memory_object_default default_pager \
diff --git a/sysdeps/mach/getloadavg.c b/sysdeps/mach/getloadavg.c
index f760da989d..1554c0211e 100644
--- a/sysdeps/mach/getloadavg.c
+++ b/sysdeps/mach/getloadavg.c
@@ -1,5 +1,5 @@
/* Get system load averages. Mach version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/getpagesize.c b/sysdeps/mach/getpagesize.c
index 9ee5db8231..38c0576472 100644
--- a/sysdeps/mach/getpagesize.c
+++ b/sysdeps/mach/getpagesize.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/getsysstats.c b/sysdeps/mach/getsysstats.c
index 4f1009137e..e69fcd8e93 100644
--- a/sysdeps/mach/getsysstats.c
+++ b/sysdeps/mach/getsysstats.c
@@ -1,5 +1,5 @@
/* System dependent pieces of sysconf; Mach version
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,6 +39,7 @@ __get_nprocs_conf (void)
return hbi.max_cpus;
}
+libc_hidden_def (__get_nprocs_conf)
weak_alias (__get_nprocs_conf, get_nprocs_conf)
/* Return the number of processors currently available on the system. */
@@ -58,6 +59,7 @@ __get_nprocs (void)
return hbi.avail_cpus;
}
+libc_hidden_def (__get_nprocs)
weak_alias (__get_nprocs, get_nprocs)
/* Return the number of physical pages on the system. */
@@ -77,6 +79,7 @@ __get_phys_pages (void)
return hbi.memory_size / __vm_page_size;
}
+libc_hidden_def (__get_phys_pages)
weak_alias (__get_phys_pages, get_phys_pages)
/* Return the number of available physical pages */
@@ -102,4 +105,5 @@ __get_avphys_pages (void)
return vs.free_count;
}
+libc_hidden_def (__get_avphys_pages)
weak_alias (__get_avphys_pages, get_avphys_pages)
diff --git a/sysdeps/mach/gettimeofday.c b/sysdeps/mach/gettimeofday.c
index d88141bf73..9453a76197 100644
--- a/sysdeps/mach/gettimeofday.c
+++ b/sysdeps/mach/gettimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/htl/Implies b/sysdeps/mach/htl/Implies
new file mode 100644
index 0000000000..5215f33d98
--- /dev/null
+++ b/sysdeps/mach/htl/Implies
@@ -0,0 +1 @@
+htl
diff --git a/sysdeps/mach/htl/bits/spin-lock-inline.h b/sysdeps/mach/htl/bits/spin-lock-inline.h
new file mode 100644
index 0000000000..695c6dccde
--- /dev/null
+++ b/sysdeps/mach/htl/bits/spin-lock-inline.h
@@ -0,0 +1,87 @@
+/* Definitions of user-visible names for spin locks.
+ Copyright (C) 1994-2018 Free Software 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 _BITS_SPIN_LOCK_INLINE_H
+#define _BITS_SPIN_LOCK_INLINE_H 1
+
+#include <features.h>
+#include <bits/types/__pthread_spinlock_t.h>
+#include <lock-intern.h> /* This does all the work. */
+
+__BEGIN_DECLS
+
+#if defined __USE_EXTERN_INLINES || defined _FORCE_INLINES
+
+# ifndef __EBUSY
+# include <errno.h>
+# define __EBUSY EBUSY
+# endif
+
+# ifndef __PT_SPIN_INLINE
+# define __PT_SPIN_INLINE __extern_inline
+# endif
+
+__PT_SPIN_INLINE int __pthread_spin_destroy (__pthread_spinlock_t *__lock);
+
+__PT_SPIN_INLINE int
+__pthread_spin_destroy (__pthread_spinlock_t *__lock)
+{
+ return 0;
+}
+
+__PT_SPIN_INLINE int __pthread_spin_init (__pthread_spinlock_t *__lock,
+ int __pshared);
+
+__PT_SPIN_INLINE int
+__pthread_spin_init (__pthread_spinlock_t *__lock, int __pshared)
+{
+ *__lock = __PTHREAD_SPIN_LOCK_INITIALIZER;
+ return 0;
+}
+
+__PT_SPIN_INLINE int __pthread_spin_trylock (__pthread_spinlock_t *__lock);
+
+__PT_SPIN_INLINE int
+__pthread_spin_trylock (__pthread_spinlock_t *__lock)
+{
+ return __spin_try_lock ((__spin_lock_t *) __lock) ? 0 : __EBUSY;
+}
+
+__PT_SPIN_INLINE int __pthread_spin_lock (__pthread_spinlock_t *__lock);
+
+__PT_SPIN_INLINE int
+__pthread_spin_lock (__pthread_spinlock_t *__lock)
+{
+ __spin_lock ((__spin_lock_t *) __lock);
+ return 0;
+}
+
+__PT_SPIN_INLINE int __pthread_spin_unlock (__pthread_spinlock_t *__lock);
+
+__PT_SPIN_INLINE int
+__pthread_spin_unlock (__pthread_spinlock_t *__lock)
+{
+ __spin_unlock ((__spin_lock_t *) __lock);
+ return 0;
+}
+
+#endif /* Use extern inlines or force inlines. */
+
+__END_DECLS
+
+#endif /* bits/types/__pthread_spinlock_t.h */
diff --git a/sysdeps/mach/htl/bits/types/__pthread_spinlock_t.h b/sysdeps/mach/htl/bits/types/__pthread_spinlock_t.h
new file mode 100644
index 0000000000..038e2b429c
--- /dev/null
+++ b/sysdeps/mach/htl/bits/types/__pthread_spinlock_t.h
@@ -0,0 +1,34 @@
+/* Definitions of user-visible names for spin locks.
+ Copyright (C) 1994-2018 Free Software 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 _BITS_TYPES___PTHREAD_SPINLOCK_T_H
+#define _BITS_TYPES___PTHREAD_SPINLOCK_T_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* The type of a spin lock object. */
+typedef volatile int __pthread_spinlock_t;
+
+/* Initializer for a spin lock object. */
+#define __PTHREAD_SPIN_LOCK_INITIALIZER 0
+
+__END_DECLS
+
+#endif /* bits/types/__pthread_spinlock_t.h */
diff --git a/sysdeps/mach/htl/pt-block.c b/sysdeps/mach/htl/pt-block.c
new file mode 100644
index 0000000000..f62134c895
--- /dev/null
+++ b/sysdeps/mach/htl/pt-block.c
@@ -0,0 +1,38 @@
+/* Block a thread. Mach version.
+ Copyright (C) 2000-2018 Free Software 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 <assert.h>
+#include <errno.h>
+
+#include <mach.h>
+#include <mach/message.h>
+
+#include <pt-internal.h>
+
+/* Block THREAD. */
+void
+__pthread_block (struct __pthread *thread)
+{
+ mach_msg_header_t msg;
+ error_t err;
+
+ err = __mach_msg (&msg, MACH_RCV_MSG, 0, sizeof msg,
+ thread->wakeupmsg.msgh_remote_port,
+ MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+ assert_perror (err);
+}
diff --git a/sysdeps/mach/htl/pt-spin.c b/sysdeps/mach/htl/pt-spin.c
new file mode 100644
index 0000000000..2b0b3c1175
--- /dev/null
+++ b/sysdeps/mach/htl/pt-spin.c
@@ -0,0 +1,31 @@
+/* Spin locks. Mach version.
+ Copyright (C) 2002-2018 Free Software 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 <machine-lock.h>
+
+/* In glibc. */
+extern void __spin_lock_solid (__spin_lock_t *lock);
+
+/* Lock the spin lock object LOCK. If the lock is held by another
+ thread spin until it becomes available. */
+int
+_pthread_spin_lock (__spin_lock_t *lock)
+{
+ __spin_lock_solid (lock);
+ return 0;
+}
diff --git a/sysdeps/mach/htl/pt-stack-alloc.c b/sysdeps/mach/htl/pt-stack-alloc.c
new file mode 100644
index 0000000000..dc31ab745a
--- /dev/null
+++ b/sysdeps/mach/htl/pt-stack-alloc.c
@@ -0,0 +1,67 @@
+/* Allocate a new stack. Mach version.
+ Copyright (C) 2000-2018 Free Software 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 <mach.h>
+#include <mach/machine/vm_param.h>
+
+#include <pt-internal.h>
+
+/* The next address to use for stack allocation. */
+static vm_address_t next_stack_base = VM_MIN_ADDRESS;
+
+
+/* Allocate a new stack of size STACKSIZE. If successful, store the
+ address of the newly allocated stack in *STACKADDR and return 0.
+ Otherwise return an error code (EINVAL for an invalid stack size,
+ EAGAIN if the system lacked the necessary resources to allocate a
+ new stack). */
+int
+__pthread_stack_alloc (void **stackaddr, size_t stacksize)
+{
+ vm_offset_t base;
+ int i = 0;
+
+get_stack:
+ i++;
+ for (base = next_stack_base;
+ base < VM_MAX_ADDRESS
+ && __vm_allocate (__mach_task_self (), &base,
+ stacksize, FALSE) != KERN_SUCCESS; base += stacksize)
+ ;
+
+ if (base >= VM_MAX_ADDRESS)
+ {
+ if (i == 1)
+ {
+ next_stack_base = VM_MIN_ADDRESS;
+ goto get_stack;
+ }
+ else
+ return EAGAIN;
+ }
+
+ if (base >= VM_MAX_ADDRESS)
+ return EAGAIN;
+
+ next_stack_base = base + stacksize;
+
+ (*stackaddr) = (void *) base;
+ return 0;
+}
diff --git a/sysdeps/mach/htl/pt-thread-alloc.c b/sysdeps/mach/htl/pt-thread-alloc.c
new file mode 100644
index 0000000000..39993e4993
--- /dev/null
+++ b/sysdeps/mach/htl/pt-thread-alloc.c
@@ -0,0 +1,94 @@
+/* Start thread. Mach version.
+ Copyright (C) 2000-2018 Free Software 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 <assert.h>
+#include <errno.h>
+#include <string.h>
+
+#include <mach.h>
+
+#include <pt-internal.h>
+
+/* Prepare a wakeup message. */
+static error_t
+create_wakeupmsg (struct __pthread *thread)
+{
+ kern_return_t err;
+
+ /* Build wakeup message. */
+ thread->wakeupmsg.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_COPY_SEND, 0);
+ thread->wakeupmsg.msgh_size = 0;
+
+ err = __mach_port_allocate (__mach_task_self (), MACH_PORT_RIGHT_RECEIVE,
+ &thread->wakeupmsg.msgh_remote_port);
+ if (err)
+ return EAGAIN;
+
+ thread->wakeupmsg.msgh_local_port = MACH_PORT_NULL;
+ thread->wakeupmsg.msgh_seqno = 0;
+ thread->wakeupmsg.msgh_id = 0;
+
+ err = __mach_port_insert_right (__mach_task_self (),
+ thread->wakeupmsg.msgh_remote_port,
+ thread->wakeupmsg.msgh_remote_port,
+ MACH_MSG_TYPE_MAKE_SEND);
+ if (err)
+ {
+ __mach_port_destroy (__mach_task_self (),
+ thread->wakeupmsg.msgh_remote_port);
+ return EAGAIN;
+ }
+
+ /* No need to queue more than one wakeup message on this port. */
+ __mach_port_set_qlimit (__mach_task_self (),
+ thread->wakeupmsg.msgh_remote_port, 1);
+
+ return 0;
+}
+
+/* Allocate any resouces for THREAD. The new kernel thread should not
+ be eligible to be scheduled. */
+int
+__pthread_thread_alloc (struct __pthread *thread)
+{
+ static int do_create;
+ error_t err;
+
+ err = create_wakeupmsg (thread);
+ if (err)
+ return err;
+
+ if (!do_create)
+ {
+ assert (__pthread_total == 0);
+ thread->kernel_thread = __mach_thread_self ();
+ do_create = 1;
+ }
+ else
+ {
+ err = __thread_create (__mach_task_self (), &thread->kernel_thread);
+ if (err)
+ {
+ __mach_port_destroy (__mach_task_self (),
+ thread->wakeupmsg.msgh_remote_port);
+ return EAGAIN;
+ }
+ }
+
+ return 0;
+}
diff --git a/sysdeps/mach/htl/pt-thread-start.c b/sysdeps/mach/htl/pt-thread-start.c
new file mode 100644
index 0000000000..a79eb0c523
--- /dev/null
+++ b/sysdeps/mach/htl/pt-thread-start.c
@@ -0,0 +1,53 @@
+/* Start thread. Mach version.
+ Copyright (C) 2000-2018 Free Software 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 <assert.h>
+#include <errno.h>
+#include <mach.h>
+
+#include <pt-internal.h>
+
+/* Start THREAD. Get the kernel thread scheduled and running. */
+int
+__pthread_thread_start (struct __pthread *thread)
+{
+ static int do_start;
+ error_t err;
+
+ if (!do_start)
+ {
+ /* The main thread is already running: do nothing. */
+ assert (__pthread_total == 1);
+ assert ((
+ {
+ mach_port_t ktid = __mach_thread_self ();
+ int ok = thread->kernel_thread == ktid;
+ __mach_port_deallocate (__mach_task_self (),
+ thread->kernel_thread);
+ ok;
+ }));
+ do_start = 1;
+ }
+ else
+ {
+ err = __thread_resume (thread->kernel_thread);
+ assert_perror (err);
+ }
+
+ return 0;
+}
diff --git a/sysdeps/mach/htl/pt-thread-terminate.c b/sysdeps/mach/htl/pt-thread-terminate.c
new file mode 100644
index 0000000000..b4ec882916
--- /dev/null
+++ b/sysdeps/mach/htl/pt-thread-terminate.c
@@ -0,0 +1,82 @@
+/* Deallocate the kernel thread resources. Mach version.
+ Copyright (C) 2000-2018 Free Software 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 <assert.h>
+#include <errno.h>
+#include <mach.h>
+
+#include <mach/mig_support.h>
+
+#include <pt-internal.h>
+
+/* Terminate the kernel thread associated with THREAD, and deallocate its
+ right reference and its stack. The function also drops a reference
+ on THREAD. */
+void
+__pthread_thread_terminate (struct __pthread *thread)
+{
+ thread_t kernel_thread, self_ktid;
+ mach_port_t wakeup_port, reply_port;
+ void *stackaddr;
+ size_t stacksize;
+ error_t err;
+
+ kernel_thread = thread->kernel_thread;
+
+ if (thread->stack)
+ {
+ stackaddr = thread->stackaddr;
+ stacksize = ((thread->guardsize + __vm_page_size - 1)
+ / __vm_page_size) * __vm_page_size + thread->stacksize;
+ }
+ else
+ {
+ stackaddr = NULL;
+ stacksize = 0;
+ }
+
+ wakeup_port = thread->wakeupmsg.msgh_remote_port;
+
+ /* Each thread has its own reply port, allocated from MiG stub code calling
+ __mig_get_reply_port. Destroying it is a bit tricky because the calls
+ involved are also RPCs, causing the creation of a new reply port if
+ currently null. The __thread_terminate_release call is actually a one way
+ simple routine designed not to require a reply port. */
+ self_ktid = __mach_thread_self ();
+ reply_port = (self_ktid == kernel_thread)
+ ? __mig_get_reply_port () : MACH_PORT_NULL;
+ __mach_port_deallocate (__mach_task_self (), self_ktid);
+
+ /* Finally done with the thread structure. */
+ __pthread_dealloc (thread);
+
+ /* The wake up port is now no longer needed. */
+ __mach_port_destroy (__mach_task_self (), wakeup_port);
+
+ /* Terminate and release all that's left. */
+ err = __thread_terminate_release (kernel_thread, mach_task_self (),
+ kernel_thread, reply_port,
+ (vm_address_t) stackaddr, stacksize);
+
+ /* The kernel does not support it yet. Leak but at least terminate
+ correctly. */
+ err = __thread_terminate (kernel_thread);
+
+ /* We are out of luck. */
+ assert_perror (err);
+}
diff --git a/sysdeps/mach/htl/pt-timedblock.c b/sysdeps/mach/htl/pt-timedblock.c
new file mode 100644
index 0000000000..9301b8fa18
--- /dev/null
+++ b/sysdeps/mach/htl/pt-timedblock.c
@@ -0,0 +1,65 @@
+/* Block a thread with a timeout. Mach version.
+ Copyright (C) 2000-2018 Free Software 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 <assert.h>
+#include <errno.h>
+#include <time.h>
+#include <sys/time.h>
+
+#include <mach.h>
+#include <mach/message.h>
+
+#include <pt-internal.h>
+
+/* Block THREAD. */
+error_t
+__pthread_timedblock (struct __pthread *thread,
+ const struct timespec *abstime, clockid_t clock_id)
+{
+ error_t err;
+ mach_msg_header_t msg;
+ mach_msg_timeout_t timeout;
+ struct timespec now;
+
+ /* We have an absolute time and now we have to convert it to a
+ relative time. Arg. */
+
+ err = clock_gettime (clock_id, &now);
+ assert (!err);
+
+ if (now.tv_sec > abstime->tv_sec
+ || (now.tv_sec == abstime->tv_sec && now.tv_nsec > abstime->tv_nsec))
+ return ETIMEDOUT;
+
+ timeout = (abstime->tv_sec - now.tv_sec) * 1000;
+
+ if (abstime->tv_nsec >= now.tv_nsec)
+ timeout += (abstime->tv_nsec - now.tv_nsec + 999999) / 1000000;
+ else
+ /* Need to do a carry. */
+ timeout -= (now.tv_nsec - abstime->tv_nsec + 999999) / 1000000;
+
+ err = __mach_msg (&msg, MACH_RCV_MSG | MACH_RCV_TIMEOUT, 0,
+ sizeof msg, thread->wakeupmsg.msgh_remote_port,
+ timeout, MACH_PORT_NULL);
+ if (err == EMACH_RCV_TIMED_OUT)
+ return ETIMEDOUT;
+
+ assert_perror (err);
+ return 0;
+}
diff --git a/sysdeps/mach/htl/pt-wakeup.c b/sysdeps/mach/htl/pt-wakeup.c
new file mode 100644
index 0000000000..069d232d7a
--- /dev/null
+++ b/sysdeps/mach/htl/pt-wakeup.c
@@ -0,0 +1,37 @@
+/* Wakeup a thread. Mach version.
+ Copyright (C) 2000-2018 Free Software 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 <assert.h>
+#include <errno.h>
+
+#include <mach.h>
+#include <mach/message.h>
+
+#include <pt-internal.h>
+
+/* Wakeup THREAD. */
+void
+__pthread_wakeup (struct __pthread *thread)
+{
+ error_t err;
+
+ err = __mach_msg (&thread->wakeupmsg, MACH_SEND_MSG | MACH_SEND_TIMEOUT,
+ sizeof (thread->wakeupmsg), 0, MACH_PORT_NULL,
+ 0, MACH_PORT_NULL);
+ assert_perror (err);
+}
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index 3845c57c14..3a853a6cd9 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1993-2016 Free Software Foundation, Inc.
+# Copyright (C) 1993-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -79,9 +79,11 @@ endef
# the headers we want to search for Mach error codes, listed above (and
# incidentally, all other headers those include).
-include $(common-objpfx)errnos.d
-$(common-objpfx)errnos.d: $(mach-errnos-deps) libc-modules.h
+$(common-objpfx)errnos.d: $(mach-errnos-deps)
$(mach-errno-h) | \
- $(CC) $(CFLAGS) $(CPPFLAGS) -M -x c - | \
+ $(CC) $(CFLAGS) \
+ $(subst -include $(common-objpfx)libc-modules.h,,$(CPPFLAGS)) \
+ -M -x c - | \
sed $(sed-remove-objpfx) -e 's,- *:,mach-errnos-deps :=,' \
-e 's, \.\./, $(..),g' > $@t
mv -f $@t $@
@@ -197,8 +199,11 @@ sysdep_headers += nfs/nfs.h
endif
ifeq ($(subdir),socket)
-sysdep_headers += net/ethernet.h net/if_arp.h net/if_ether.h net/if_ppp.h \
- net/route.h
+sysdep_headers += net/ethernet.h net/if_arp.h net/if_ether.h net/route.h
+endif
+
+ifeq ($(subdir),nis)
+CFLAGS-ypclnt.c += -DUSE_BINDINGDIR=1
endif
endif # in-Makerules
diff --git a/sysdeps/mach/hurd/Versions b/sysdeps/mach/hurd/Versions
index 89e19061af..f69d5fef67 100644
--- a/sysdeps/mach/hurd/Versions
+++ b/sysdeps/mach/hurd/Versions
@@ -1,11 +1,16 @@
libc {
GLIBC_2.0 {
# functions with a weak definition in the dynamic linker
- __getcwd; __mmap;
+ __access; __getcwd; __mmap;
+ }
+ GLIBC_2.2.6 {
+ # functions with a weak definition in the dynamic linker
+ __writev;
}
GLIBC_PRIVATE {
# Functions shared with the dynamic linker
- __libc_read; __libc_write; __libc_lseek64;
+ __access_noerrno; __libc_read; __libc_write; __libc_lseek64;
+ __libc_lock_self0;
_dl_init_first;
}
@@ -14,16 +19,19 @@ libc {
ld {
GLIBC_2.0 {
# variables that must be shared with libc
- __hurd_sigthread_stack_base; __hurd_sigthread_stack_end;
- __hurd_sigthread_variables;
__hurd_threadvar_stack_mask; __hurd_threadvar_stack_offset;
# functions that must be shared with libc
- __close; __getcwd; __getpid;
- __mmap; __open; __xstat64; __fxstat64;
+ __access; __close; __getcwd; __getpid;
+ __mmap; __open; __read; __sbrk; __strtoul_internal;
+ __write; __writev; __xstat64; __fxstat64;
_exit; _hurd_intr_rpc_mach_msg;
abort;
}
+ GLIBC_2.2 {
+ # functions that must be shared with libc
+ __open64;
+ }
GLIBC_2.2.6 {
# this also must be shared with libc.
__errno_location;
@@ -32,6 +40,7 @@ ld {
_dl_init_first;
# functions that must be shared with libc
- __libc_read; __libc_write; __libc_lseek64;
+ __access_noerrno; __libc_read; __libc_write; __libc_lseek64;
+ __libc_lock_self0;
}
}
diff --git a/sysdeps/mach/hurd/_exit.c b/sysdeps/mach/hurd/_exit.c
index f057768c3c..3cbda3ffa9 100644
--- a/sysdeps/mach/hurd/_exit.c
+++ b/sysdeps/mach/hurd/_exit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/accept.c b/sysdeps/mach/hurd/accept.c
index 870a53af09..a6a3a9a0a0 100644
--- a/sysdeps/mach/hurd/accept.c
+++ b/sysdeps/mach/hurd/accept.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/mach/hurd/accept4.c b/sysdeps/mach/hurd/accept4.c
index 9a64b06798..92bf92ddc3 100644
--- a/sysdeps/mach/hurd/accept4.c
+++ b/sysdeps/mach/hurd/accept4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/mach/hurd/access.c b/sysdeps/mach/hurd/access.c
index c308340329..31fd5bea56 100644
--- a/sysdeps/mach/hurd/access.c
+++ b/sysdeps/mach/hurd/access.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software 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,132 +15,24 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <errno.h>
#include <unistd.h>
-#include <hurd.h>
-#include <hurd/port.h>
-#include <hurd/id.h>
-#include <hurd/lookup.h>
#include <fcntl.h>
+/* Test for access to FILE by our real user and group IDs without setting
+ errno. This may be unsafe to run during initialization of tunables
+ since access_common calls __hurd_file_name_lookup, which calls
+ __hurd_file_name_lookup_retry, which can set errno. */
+int
+__access_noerrno (const char *file, int type)
+{
+ return __faccessat_noerrno (AT_FDCWD, file, type, 0);
+}
+
/* Test for access to FILE by our real user and group IDs. */
int
__access (const char *file, int type)
{
- error_t err;
- file_t rcrdir, rcwdir, io;
- int flags, allowed;
-
- error_t reauthenticate (int which, file_t *result)
- {
- /* Get a port to our root directory, authenticated with the real IDs. */
- error_t err;
- mach_port_t ref;
- ref = __mach_reply_port ();
- err = HURD_PORT_USE
- (&_hurd_ports[which],
- ({
- err = __io_reauthenticate (port, ref, MACH_MSG_TYPE_MAKE_SEND);
- if (!err)
- err = __auth_user_authenticate (_hurd_id.rid_auth,
- ref, MACH_MSG_TYPE_MAKE_SEND,
- result);
- err;
- }));
- __mach_port_destroy (__mach_task_self (), ref);
- return err;
- }
-
- error_t init_port (int which, error_t (*operate) (mach_port_t))
- {
- switch (which)
- {
- case INIT_PORT_AUTH:
- return (*operate) (_hurd_id.rid_auth);
- case INIT_PORT_CRDIR:
- return (reauthenticate (INIT_PORT_CRDIR, &rcrdir) ?:
- (*operate) (rcrdir));
- case INIT_PORT_CWDIR:
- return (reauthenticate (INIT_PORT_CWDIR, &rcwdir) ?:
- (*operate) (rcwdir));
- default:
- return _hurd_ports_use (which, operate);
- }
- }
-
- rcrdir = rcwdir = MACH_PORT_NULL;
-
- HURD_CRITICAL_BEGIN;
-
- __mutex_lock (&_hurd_id.lock);
- /* Get _hurd_id up to date. */
- if (err = _hurd_check_ids ())
- goto lose;
-
- if (_hurd_id.rid_auth == MACH_PORT_NULL)
- {
- /* Set up _hurd_id.rid_auth. This is a special auth server port
- which uses the real uid and gid (the first aux uid and gid) as
- the only effective uid and gid. */
-
- if (_hurd_id.aux.nuids < 1 || _hurd_id.aux.ngids < 1)
- {
- /* We do not have a real UID and GID. Lose, lose, lose! */
- err = EGRATUITOUS;
- goto lose;
- }
-
- /* Create a new auth port using our real UID and GID (the first
- auxiliary UID and GID) as the only effective IDs. */
- if (err = __USEPORT (AUTH,
- __auth_makeauth (port,
- NULL, MACH_MSG_TYPE_COPY_SEND, 0,
- _hurd_id.aux.uids, 1,
- _hurd_id.aux.uids,
- _hurd_id.aux.nuids,
- _hurd_id.aux.gids, 1,
- _hurd_id.aux.gids,
- _hurd_id.aux.ngids,
- &_hurd_id.rid_auth)))
- goto lose;
- }
-
- if (!err)
- /* Look up the file name using the modified init ports. */
- err = __hurd_file_name_lookup (&init_port, &__getdport, 0,
- file, 0, 0, &io);
-
- /* We are done with _hurd_id.rid_auth now. */
- lose:
- __mutex_unlock (&_hurd_id.lock);
-
- HURD_CRITICAL_END;
-
- if (rcrdir != MACH_PORT_NULL)
- __mach_port_deallocate (__mach_task_self (), rcrdir);
- if (rcwdir != MACH_PORT_NULL)
- __mach_port_deallocate (__mach_task_self (), rcwdir);
- if (err)
- return __hurd_fail (err);
-
- /* Find out what types of access we are allowed to this file. */
- err = __file_check_access (io, &allowed);
- __mach_port_deallocate (__mach_task_self (), io);
- if (err)
- return __hurd_fail (err);
-
- flags = 0;
- if (type & R_OK)
- flags |= O_READ;
- if (type & W_OK)
- flags |= O_WRITE;
- if (type & X_OK)
- flags |= O_EXEC;
-
- if (flags & ~allowed)
- /* We are not allowed all the requested types of access. */
- return __hurd_fail (EACCES);
-
- return 0;
+ return __faccessat (AT_FDCWD, file, type, 0);
}
-
weak_alias (__access, access)
diff --git a/sysdeps/mach/hurd/adjtime.c b/sysdeps/mach/hurd/adjtime.c
index d65b95b9c6..66ee42a6ff 100644
--- a/sysdeps/mach/hurd/adjtime.c
+++ b/sysdeps/mach/hurd/adjtime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/bind.c b/sysdeps/mach/hurd/bind.c
index e605e31c5f..fae826d534 100644
--- a/sysdeps/mach/hurd/bind.c
+++ b/sysdeps/mach/hurd/bind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/bits/errno.h b/sysdeps/mach/hurd/bits/errno.h
index d20ffe654a..8096fb9c05 100644
--- a/sysdeps/mach/hurd/bits/errno.h
+++ b/sysdeps/mach/hurd/bits/errno.h
@@ -1,329 +1,414 @@
-/* This file generated by errnos.awk. */
+/* This file generated by errnos.awk from
+ errno.texi
+ mach/message.h
+ mach/kern_return.h
+ mach/mig_errors.h
+ device/device_types.h
+ Do not edit this file; edit errnos.awk and regenerate it. */
-/* The Hurd uses Mach error system 0x10, currently only subsystem 0. */
-#ifndef _HURD_ERRNO
-#define _HURD_ERRNO(n) ((0x10 << 26) | ((n) & 0x3fff))
+#ifndef _BITS_ERRNO_H
+#define _BITS_ERRNO_H 1
+
+#if !defined _ERRNO_H
+# error "Never include <bits/errno.h> directly; use <errno.h> instead."
#endif
-#ifdef _ERRNO_H
+#ifndef __ASSEMBLER__
enum __error_t_codes
{
- /* The value zero always means success and it is perfectly fine for
- code to use 0 explicitly (or implicitly, e.g. via Boolean coercion).
- Having an enum entry for zero both makes the debugger print the name
- for error_t-typed zero values, and prevents the compiler from
- issuing warnings about 'case 0:' in a switch on an error_t-typed
- value. */
- ESUCCESS = 0,
+ /* The value zero always means success and it is perfectly fine
+ for code to use 0 explicitly (or implicitly, e.g. via Boolean
+ coercion.) Having an enum entry for zero both makes the
+ debugger print the name for error_t-typed zero values, and
+ prevents the compiler from issuing warnings about 'case 0:'
+ in a switch on an error_t-typed value. */
+ ESUCCESS = 0,
-#undef EDOM
-#undef ERANGE
- EPERM = _HURD_ERRNO (1),
-#define EPERM _HURD_ERRNO (1) /* Operation not permitted */
- ENOENT = _HURD_ERRNO (2),
-#define ENOENT _HURD_ERRNO (2) /* No such file or directory */
- ESRCH = _HURD_ERRNO (3),
-#define ESRCH _HURD_ERRNO (3) /* No such process */
- EINTR = _HURD_ERRNO (4),
-#define EINTR _HURD_ERRNO (4) /* Interrupted system call */
- EIO = _HURD_ERRNO (5),
-#define EIO _HURD_ERRNO (5) /* Input/output error */
- ENXIO = _HURD_ERRNO (6),
-#define ENXIO _HURD_ERRNO (6) /* No such device or address */
- E2BIG = _HURD_ERRNO (7),
-#define E2BIG _HURD_ERRNO (7) /* Argument list too long */
- ENOEXEC = _HURD_ERRNO (8),
-#define ENOEXEC _HURD_ERRNO (8) /* Exec format error */
- EBADF = _HURD_ERRNO (9),
-#define EBADF _HURD_ERRNO (9) /* Bad file descriptor */
- ECHILD = _HURD_ERRNO (10),
-#define ECHILD _HURD_ERRNO (10)/* No child processes */
- EDEADLK = _HURD_ERRNO (11),
-#define EDEADLK _HURD_ERRNO (11)/* Resource deadlock avoided */
- ENOMEM = _HURD_ERRNO (12),
-#define ENOMEM _HURD_ERRNO (12)/* Cannot allocate memory */
- EACCES = _HURD_ERRNO (13),
-#define EACCES _HURD_ERRNO (13)/* Permission denied */
- EFAULT = _HURD_ERRNO (14),
-#define EFAULT _HURD_ERRNO (14)/* Bad address */
- ENOTBLK = _HURD_ERRNO (15),
-#define ENOTBLK _HURD_ERRNO (15)/* Block device required */
- EBUSY = _HURD_ERRNO (16),
-#define EBUSY _HURD_ERRNO (16)/* Device or resource busy */
- EEXIST = _HURD_ERRNO (17),
-#define EEXIST _HURD_ERRNO (17)/* File exists */
- EXDEV = _HURD_ERRNO (18),
-#define EXDEV _HURD_ERRNO (18)/* Invalid cross-device link */
- ENODEV = _HURD_ERRNO (19),
-#define ENODEV _HURD_ERRNO (19)/* No such device */
- ENOTDIR = _HURD_ERRNO (20),
-#define ENOTDIR _HURD_ERRNO (20)/* Not a directory */
- EISDIR = _HURD_ERRNO (21),
-#define EISDIR _HURD_ERRNO (21)/* Is a directory */
- EINVAL = _HURD_ERRNO (22),
-#define EINVAL _HURD_ERRNO (22)/* Invalid argument */
- EMFILE = _HURD_ERRNO (24),
-#define EMFILE _HURD_ERRNO (24)/* Too many open files */
- ENFILE = _HURD_ERRNO (23),
-#define ENFILE _HURD_ERRNO (23)/* Too many open files in system */
- ENOTTY = _HURD_ERRNO (25),
-#define ENOTTY _HURD_ERRNO (25)/* Inappropriate ioctl for device */
- ETXTBSY = _HURD_ERRNO (26),
-#define ETXTBSY _HURD_ERRNO (26)/* Text file busy */
- EFBIG = _HURD_ERRNO (27),
-#define EFBIG _HURD_ERRNO (27)/* File too large */
- ENOSPC = _HURD_ERRNO (28),
-#define ENOSPC _HURD_ERRNO (28)/* No space left on device */
- ESPIPE = _HURD_ERRNO (29),
-#define ESPIPE _HURD_ERRNO (29)/* Illegal seek */
- EROFS = _HURD_ERRNO (30),
-#define EROFS _HURD_ERRNO (30)/* Read-only file system */
- EMLINK = _HURD_ERRNO (31),
-#define EMLINK _HURD_ERRNO (31)/* Too many links */
- EPIPE = _HURD_ERRNO (32),
-#define EPIPE _HURD_ERRNO (32)/* Broken pipe */
- EDOM = _HURD_ERRNO (33),
-#define EDOM _HURD_ERRNO (33)/* Numerical argument out of domain */
- ERANGE = _HURD_ERRNO (34),
-#define ERANGE _HURD_ERRNO (34)/* Numerical result out of range */
- EAGAIN = _HURD_ERRNO (35),
-#define EAGAIN _HURD_ERRNO (35)/* Resource temporarily unavailable */
-#define EWOULDBLOCK EAGAIN /* Operation would block */
- EINPROGRESS = _HURD_ERRNO (36),
-#define EINPROGRESS _HURD_ERRNO (36)/* Operation now in progress */
- EALREADY = _HURD_ERRNO (37),
-#define EALREADY _HURD_ERRNO (37)/* Operation already in progress */
- ENOTSOCK = _HURD_ERRNO (38),
-#define ENOTSOCK _HURD_ERRNO (38)/* Socket operation on non-socket */
- EMSGSIZE = _HURD_ERRNO (40),
-#define EMSGSIZE _HURD_ERRNO (40)/* Message too long */
- EPROTOTYPE = _HURD_ERRNO (41),
-#define EPROTOTYPE _HURD_ERRNO (41)/* Protocol wrong type for socket */
- ENOPROTOOPT = _HURD_ERRNO (42),
-#define ENOPROTOOPT _HURD_ERRNO (42)/* Protocol not available */
- EPROTONOSUPPORT = _HURD_ERRNO (43),
-#define EPROTONOSUPPORT _HURD_ERRNO (43)/* Protocol not supported */
- ESOCKTNOSUPPORT = _HURD_ERRNO (44),
-#define ESOCKTNOSUPPORT _HURD_ERRNO (44)/* Socket type not supported */
- EOPNOTSUPP = _HURD_ERRNO (45),
-#define EOPNOTSUPP _HURD_ERRNO (45)/* Operation not supported */
- EPFNOSUPPORT = _HURD_ERRNO (46),
-#define EPFNOSUPPORT _HURD_ERRNO (46)/* Protocol family not supported */
- EAFNOSUPPORT = _HURD_ERRNO (47),
-#define EAFNOSUPPORT _HURD_ERRNO (47)/* Address family not supported by protocol */
- EADDRINUSE = _HURD_ERRNO (48),
-#define EADDRINUSE _HURD_ERRNO (48)/* Address already in use */
- EADDRNOTAVAIL = _HURD_ERRNO (49),
-#define EADDRNOTAVAIL _HURD_ERRNO (49)/* Cannot assign requested address */
- ENETDOWN = _HURD_ERRNO (50),
-#define ENETDOWN _HURD_ERRNO (50)/* Network is down */
- ENETUNREACH = _HURD_ERRNO (51),
-#define ENETUNREACH _HURD_ERRNO (51)/* Network is unreachable */
- ENETRESET = _HURD_ERRNO (52),
-#define ENETRESET _HURD_ERRNO (52)/* Network dropped connection on reset */
- ECONNABORTED = _HURD_ERRNO (53),
-#define ECONNABORTED _HURD_ERRNO (53)/* Software caused connection abort */
- ECONNRESET = _HURD_ERRNO (54),
-#define ECONNRESET _HURD_ERRNO (54)/* Connection reset by peer */
- ENOBUFS = _HURD_ERRNO (55),
-#define ENOBUFS _HURD_ERRNO (55)/* No buffer space available */
- EISCONN = _HURD_ERRNO (56),
-#define EISCONN _HURD_ERRNO (56)/* Transport endpoint is already connected */
- ENOTCONN = _HURD_ERRNO (57),
-#define ENOTCONN _HURD_ERRNO (57)/* Transport endpoint is not connected */
- EDESTADDRREQ = _HURD_ERRNO (39),
-#define EDESTADDRREQ _HURD_ERRNO (39)/* Destination address required */
- ESHUTDOWN = _HURD_ERRNO (58),
-#define ESHUTDOWN _HURD_ERRNO (58)/* Cannot send after transport endpoint shutdown */
- ETOOMANYREFS = _HURD_ERRNO (59),
-#define ETOOMANYREFS _HURD_ERRNO (59)/* Too many references: cannot splice */
- ETIMEDOUT = _HURD_ERRNO (60),
-#define ETIMEDOUT _HURD_ERRNO (60)/* Connection timed out */
- ECONNREFUSED = _HURD_ERRNO (61),
-#define ECONNREFUSED _HURD_ERRNO (61)/* Connection refused */
- ELOOP = _HURD_ERRNO (62),
-#define ELOOP _HURD_ERRNO (62)/* Too many levels of symbolic links */
- ENAMETOOLONG = _HURD_ERRNO (63),
-#define ENAMETOOLONG _HURD_ERRNO (63)/* File name too long */
- EHOSTDOWN = _HURD_ERRNO (64),
-#define EHOSTDOWN _HURD_ERRNO (64)/* Host is down */
- EHOSTUNREACH = _HURD_ERRNO (65),
-#define EHOSTUNREACH _HURD_ERRNO (65)/* No route to host */
- ENOTEMPTY = _HURD_ERRNO (66),
-#define ENOTEMPTY _HURD_ERRNO (66)/* Directory not empty */
- EPROCLIM = _HURD_ERRNO (67),
-#define EPROCLIM _HURD_ERRNO (67)/* Too many processes */
- EUSERS = _HURD_ERRNO (68),
-#define EUSERS _HURD_ERRNO (68)/* Too many users */
- EDQUOT = _HURD_ERRNO (69),
-#define EDQUOT _HURD_ERRNO (69)/* Disk quota exceeded */
- ESTALE = _HURD_ERRNO (70),
-#define ESTALE _HURD_ERRNO (70)/* Stale file handle */
- EREMOTE = _HURD_ERRNO (71),
-#define EREMOTE _HURD_ERRNO (71)/* Object is remote */
- EBADRPC = _HURD_ERRNO (72),
-#define EBADRPC _HURD_ERRNO (72)/* RPC struct is bad */
- ERPCMISMATCH = _HURD_ERRNO (73),
-#define ERPCMISMATCH _HURD_ERRNO (73)/* RPC version wrong */
- EPROGUNAVAIL = _HURD_ERRNO (74),
-#define EPROGUNAVAIL _HURD_ERRNO (74)/* RPC program not available */
- EPROGMISMATCH = _HURD_ERRNO (75),
-#define EPROGMISMATCH _HURD_ERRNO (75)/* RPC program version wrong */
- EPROCUNAVAIL = _HURD_ERRNO (76),
-#define EPROCUNAVAIL _HURD_ERRNO (76)/* RPC bad procedure for program */
- ENOLCK = _HURD_ERRNO (77),
-#define ENOLCK _HURD_ERRNO (77)/* No locks available */
- EFTYPE = _HURD_ERRNO (79),
-#define EFTYPE _HURD_ERRNO (79)/* Inappropriate file type or format */
- EAUTH = _HURD_ERRNO (80),
-#define EAUTH _HURD_ERRNO (80)/* Authentication error */
- ENEEDAUTH = _HURD_ERRNO (81),
-#define ENEEDAUTH _HURD_ERRNO (81)/* Need authenticator */
- ENOSYS = _HURD_ERRNO (78),
-#define ENOSYS _HURD_ERRNO (78)/* Function not implemented */
- ENOTSUP = _HURD_ERRNO (118),
-#define ENOTSUP _HURD_ERRNO (118)/* Not supported */
- EILSEQ = _HURD_ERRNO (106),
-#define EILSEQ _HURD_ERRNO (106)/* Invalid or incomplete multibyte or wide character */
- EBACKGROUND = _HURD_ERRNO (100),
-#define EBACKGROUND _HURD_ERRNO (100)/* Inappropriate operation for background process */
- EDIED = _HURD_ERRNO (101),
-#define EDIED _HURD_ERRNO (101)/* Translator died */
- ED = _HURD_ERRNO (102),
-#define ED _HURD_ERRNO (102)/* ? */
- EGREGIOUS = _HURD_ERRNO (103),
-#define EGREGIOUS _HURD_ERRNO (103)/* You really blew it this time */
- EIEIO = _HURD_ERRNO (104),
-#define EIEIO _HURD_ERRNO (104)/* Computer bought the farm */
- EGRATUITOUS = _HURD_ERRNO (105),
-#define EGRATUITOUS _HURD_ERRNO (105)/* Gratuitous error */
- EBADMSG = _HURD_ERRNO (107),
-#define EBADMSG _HURD_ERRNO (107)/* Bad message */
- EIDRM = _HURD_ERRNO (108),
-#define EIDRM _HURD_ERRNO (108)/* Identifier removed */
- EMULTIHOP = _HURD_ERRNO (109),
-#define EMULTIHOP _HURD_ERRNO (109)/* Multihop attempted */
- ENODATA = _HURD_ERRNO (110),
-#define ENODATA _HURD_ERRNO (110)/* No data available */
- ENOLINK = _HURD_ERRNO (111),
-#define ENOLINK _HURD_ERRNO (111)/* Link has been severed */
- ENOMSG = _HURD_ERRNO (112),
-#define ENOMSG _HURD_ERRNO (112)/* No message of desired type */
- ENOSR = _HURD_ERRNO (113),
-#define ENOSR _HURD_ERRNO (113)/* Out of streams resources */
- ENOSTR = _HURD_ERRNO (114),
-#define ENOSTR _HURD_ERRNO (114)/* Device not a stream */
- EOVERFLOW = _HURD_ERRNO (115),
-#define EOVERFLOW _HURD_ERRNO (115)/* Value too large for defined data type */
- EPROTO = _HURD_ERRNO (116),
-#define EPROTO _HURD_ERRNO (116)/* Protocol error */
- ETIME = _HURD_ERRNO (117),
-#define ETIME _HURD_ERRNO (117)/* Timer expired */
- ECANCELED = _HURD_ERRNO (119),
-#define ECANCELED _HURD_ERRNO (119)/* Operation canceled */
+ /* The Hurd uses Mach error system 0x10, subsystem 0. */
+ EPERM = 0x40000001, /* Operation not permitted */
+ ENOENT = 0x40000002, /* No such file or directory */
+ ESRCH = 0x40000003, /* No such process */
+ EINTR = 0x40000004, /* Interrupted system call */
+ EIO = 0x40000005, /* Input/output error */
+ ENXIO = 0x40000006, /* No such device or address */
+ E2BIG = 0x40000007, /* Argument list too long */
+ ENOEXEC = 0x40000008, /* Exec format error */
+ EBADF = 0x40000009, /* Bad file descriptor */
+ ECHILD = 0x4000000a, /* No child processes */
+ EDEADLK = 0x4000000b, /* Resource deadlock avoided */
+ ENOMEM = 0x4000000c, /* Cannot allocate memory */
+ EACCES = 0x4000000d, /* Permission denied */
+ EFAULT = 0x4000000e, /* Bad address */
+ ENOTBLK = 0x4000000f, /* Block device required */
+ EBUSY = 0x40000010, /* Device or resource busy */
+ EEXIST = 0x40000011, /* File exists */
+ EXDEV = 0x40000012, /* Invalid cross-device link */
+ ENODEV = 0x40000013, /* No such device */
+ ENOTDIR = 0x40000014, /* Not a directory */
+ EISDIR = 0x40000015, /* Is a directory */
+ EINVAL = 0x40000016, /* Invalid argument */
+ EMFILE = 0x40000018, /* Too many open files */
+ ENFILE = 0x40000017, /* Too many open files in system */
+ ENOTTY = 0x40000019, /* Inappropriate ioctl for device */
+ ETXTBSY = 0x4000001a, /* Text file busy */
+ EFBIG = 0x4000001b, /* File too large */
+ ENOSPC = 0x4000001c, /* No space left on device */
+ ESPIPE = 0x4000001d, /* Illegal seek */
+ EROFS = 0x4000001e, /* Read-only file system */
+ EMLINK = 0x4000001f, /* Too many links */
+ EPIPE = 0x40000020, /* Broken pipe */
+ EDOM = 0x40000021, /* Numerical argument out of domain */
+ ERANGE = 0x40000022, /* Numerical result out of range */
+ EAGAIN = 0x40000023, /* Resource temporarily unavailable */
+ EINPROGRESS = 0x40000024, /* Operation now in progress */
+ EALREADY = 0x40000025, /* Operation already in progress */
+ ENOTSOCK = 0x40000026, /* Socket operation on non-socket */
+ EMSGSIZE = 0x40000028, /* Message too long */
+ EPROTOTYPE = 0x40000029, /* Protocol wrong type for socket */
+ ENOPROTOOPT = 0x4000002a, /* Protocol not available */
+ EPROTONOSUPPORT = 0x4000002b, /* Protocol not supported */
+ ESOCKTNOSUPPORT = 0x4000002c, /* Socket type not supported */
+ EOPNOTSUPP = 0x4000002d, /* Operation not supported */
+ EPFNOSUPPORT = 0x4000002e, /* Protocol family not supported */
+ EAFNOSUPPORT = 0x4000002f, /* Address family not supported by protocol */
+ EADDRINUSE = 0x40000030, /* Address already in use */
+ EADDRNOTAVAIL = 0x40000031, /* Cannot assign requested address */
+ ENETDOWN = 0x40000032, /* Network is down */
+ ENETUNREACH = 0x40000033, /* Network is unreachable */
+ ENETRESET = 0x40000034, /* Network dropped connection on reset */
+ ECONNABORTED = 0x40000035, /* Software caused connection abort */
+ ECONNRESET = 0x40000036, /* Connection reset by peer */
+ ENOBUFS = 0x40000037, /* No buffer space available */
+ EISCONN = 0x40000038, /* Transport endpoint is already connected */
+ ENOTCONN = 0x40000039, /* Transport endpoint is not connected */
+ EDESTADDRREQ = 0x40000027, /* Destination address required */
+ ESHUTDOWN = 0x4000003a, /* Cannot send after transport endpoint shutdown */
+ ETOOMANYREFS = 0x4000003b, /* Too many references: cannot splice */
+ ETIMEDOUT = 0x4000003c, /* Connection timed out */
+ ECONNREFUSED = 0x4000003d, /* Connection refused */
+ ELOOP = 0x4000003e, /* Too many levels of symbolic links */
+ ENAMETOOLONG = 0x4000003f, /* File name too long */
+ EHOSTDOWN = 0x40000040, /* Host is down */
+ EHOSTUNREACH = 0x40000041, /* No route to host */
+ ENOTEMPTY = 0x40000042, /* Directory not empty */
+ EPROCLIM = 0x40000043, /* Too many processes */
+ EUSERS = 0x40000044, /* Too many users */
+ EDQUOT = 0x40000045, /* Disk quota exceeded */
+ ESTALE = 0x40000046, /* Stale file handle */
+ EREMOTE = 0x40000047, /* Object is remote */
+ EBADRPC = 0x40000048, /* RPC struct is bad */
+ ERPCMISMATCH = 0x40000049, /* RPC version wrong */
+ EPROGUNAVAIL = 0x4000004a, /* RPC program not available */
+ EPROGMISMATCH = 0x4000004b, /* RPC program version wrong */
+ EPROCUNAVAIL = 0x4000004c, /* RPC bad procedure for program */
+ ENOLCK = 0x4000004d, /* No locks available */
+ EFTYPE = 0x4000004f, /* Inappropriate file type or format */
+ EAUTH = 0x40000050, /* Authentication error */
+ ENEEDAUTH = 0x40000051, /* Need authenticator */
+ ENOSYS = 0x4000004e, /* Function not implemented */
+ ENOTSUP = 0x40000076, /* Not supported */
+ EILSEQ = 0x4000006a, /* Invalid or incomplete multibyte or wide character */
+ EBACKGROUND = 0x40000064, /* Inappropriate operation for background process */
+ EDIED = 0x40000065, /* Translator died */
+ ED = 0x40000066, /* ? */
+ EGREGIOUS = 0x40000067, /* You really blew it this time */
+ EIEIO = 0x40000068, /* Computer bought the farm */
+ EGRATUITOUS = 0x40000069, /* Gratuitous error */
+ EBADMSG = 0x4000006b, /* Bad message */
+ EIDRM = 0x4000006c, /* Identifier removed */
+ EMULTIHOP = 0x4000006d, /* Multihop attempted */
+ ENODATA = 0x4000006e, /* No data available */
+ ENOLINK = 0x4000006f, /* Link has been severed */
+ ENOMSG = 0x40000070, /* No message of desired type */
+ ENOSR = 0x40000071, /* Out of streams resources */
+ ENOSTR = 0x40000072, /* Device not a stream */
+ EOVERFLOW = 0x40000073, /* Value too large for defined data type */
+ EPROTO = 0x40000074, /* Protocol error */
+ ETIME = 0x40000075, /* Timer expired */
+ ECANCELED = 0x40000077, /* Operation canceled */
+ EOWNERDEAD = 0x40000078, /* Owner died */
+ ENOTRECOVERABLE = 0x40000079, /* State not recoverable */
- /* Errors from <mach/message.h>. */
- EMACH_SEND_IN_PROGRESS = 0x10000001,
- EMACH_SEND_INVALID_DATA = 0x10000002,
- EMACH_SEND_INVALID_DEST = 0x10000003,
- EMACH_SEND_TIMED_OUT = 0x10000004,
- EMACH_SEND_WILL_NOTIFY = 0x10000005,
- EMACH_SEND_NOTIFY_IN_PROGRESS = 0x10000006,
- EMACH_SEND_INTERRUPTED = 0x10000007,
- EMACH_SEND_MSG_TOO_SMALL = 0x10000008,
- EMACH_SEND_INVALID_REPLY = 0x10000009,
- EMACH_SEND_INVALID_RIGHT = 0x1000000a,
- EMACH_SEND_INVALID_NOTIFY = 0x1000000b,
- EMACH_SEND_INVALID_MEMORY = 0x1000000c,
- EMACH_SEND_NO_BUFFER = 0x1000000d,
- EMACH_SEND_NO_NOTIFY = 0x1000000e,
- EMACH_SEND_INVALID_TYPE = 0x1000000f,
- EMACH_SEND_INVALID_HEADER = 0x10000010,
- EMACH_RCV_IN_PROGRESS = 0x10004001,
- EMACH_RCV_INVALID_NAME = 0x10004002,
- EMACH_RCV_TIMED_OUT = 0x10004003,
- EMACH_RCV_TOO_LARGE = 0x10004004,
- EMACH_RCV_INTERRUPTED = 0x10004005,
- EMACH_RCV_PORT_CHANGED = 0x10004006,
- EMACH_RCV_INVALID_NOTIFY = 0x10004007,
- EMACH_RCV_INVALID_DATA = 0x10004008,
- EMACH_RCV_PORT_DIED = 0x10004009,
- EMACH_RCV_IN_SET = 0x1000400a,
- EMACH_RCV_HEADER_ERROR = 0x1000400b,
- EMACH_RCV_BODY_ERROR = 0x1000400c,
+/* Errors from <mach/message.h>. */
+ EMACH_SEND_IN_PROGRESS = 0x10000001,
+ EMACH_SEND_INVALID_DATA = 0x10000002,
+ EMACH_SEND_INVALID_DEST = 0x10000003,
+ EMACH_SEND_TIMED_OUT = 0x10000004,
+ EMACH_SEND_WILL_NOTIFY = 0x10000005,
+ EMACH_SEND_NOTIFY_IN_PROGRESS = 0x10000006,
+ EMACH_SEND_INTERRUPTED = 0x10000007,
+ EMACH_SEND_MSG_TOO_SMALL = 0x10000008,
+ EMACH_SEND_INVALID_REPLY = 0x10000009,
+ EMACH_SEND_INVALID_RIGHT = 0x1000000a,
+ EMACH_SEND_INVALID_NOTIFY = 0x1000000b,
+ EMACH_SEND_INVALID_MEMORY = 0x1000000c,
+ EMACH_SEND_NO_BUFFER = 0x1000000d,
+ EMACH_SEND_NO_NOTIFY = 0x1000000e,
+ EMACH_SEND_INVALID_TYPE = 0x1000000f,
+ EMACH_SEND_INVALID_HEADER = 0x10000010,
+ EMACH_RCV_IN_PROGRESS = 0x10004001,
+ EMACH_RCV_INVALID_NAME = 0x10004002,
+ EMACH_RCV_TIMED_OUT = 0x10004003,
+ EMACH_RCV_TOO_LARGE = 0x10004004,
+ EMACH_RCV_INTERRUPTED = 0x10004005,
+ EMACH_RCV_PORT_CHANGED = 0x10004006,
+ EMACH_RCV_INVALID_NOTIFY = 0x10004007,
+ EMACH_RCV_INVALID_DATA = 0x10004008,
+ EMACH_RCV_PORT_DIED = 0x10004009,
+ EMACH_RCV_IN_SET = 0x1000400a,
+ EMACH_RCV_HEADER_ERROR = 0x1000400b,
+ EMACH_RCV_BODY_ERROR = 0x1000400c,
- /* Errors from <mach/kern_return.h>. */
- EKERN_INVALID_ADDRESS = 1,
- EKERN_PROTECTION_FAILURE = 2,
- EKERN_NO_SPACE = 3,
- EKERN_INVALID_ARGUMENT = 4,
- EKERN_FAILURE = 5,
- EKERN_RESOURCE_SHORTAGE = 6,
- EKERN_NOT_RECEIVER = 7,
- EKERN_NO_ACCESS = 8,
- EKERN_MEMORY_FAILURE = 9,
- EKERN_MEMORY_ERROR = 10,
- EKERN_NOT_IN_SET = 12,
- EKERN_NAME_EXISTS = 13,
- EKERN_ABORTED = 14,
- EKERN_INVALID_NAME = 15,
- EKERN_INVALID_TASK = 16,
- EKERN_INVALID_RIGHT = 17,
- EKERN_INVALID_VALUE = 18,
- EKERN_UREFS_OVERFLOW = 19,
- EKERN_INVALID_CAPABILITY = 20,
- EKERN_RIGHT_EXISTS = 21,
- EKERN_INVALID_HOST = 22,
- EKERN_MEMORY_PRESENT = 23,
- EKERN_WRITE_PROTECTION_FAILURE = 24,
- EKERN_TERMINATED = 26,
+/* Errors from <mach/kern_return.h>. */
+ EKERN_INVALID_ADDRESS = 1,
+ EKERN_PROTECTION_FAILURE = 2,
+ EKERN_NO_SPACE = 3,
+ EKERN_INVALID_ARGUMENT = 4,
+ EKERN_FAILURE = 5,
+ EKERN_RESOURCE_SHORTAGE = 6,
+ EKERN_NOT_RECEIVER = 7,
+ EKERN_NO_ACCESS = 8,
+ EKERN_MEMORY_FAILURE = 9,
+ EKERN_MEMORY_ERROR = 10,
+ EKERN_NOT_IN_SET = 12,
+ EKERN_NAME_EXISTS = 13,
+ EKERN_ABORTED = 14,
+ EKERN_INVALID_NAME = 15,
+ EKERN_INVALID_TASK = 16,
+ EKERN_INVALID_RIGHT = 17,
+ EKERN_INVALID_VALUE = 18,
+ EKERN_UREFS_OVERFLOW = 19,
+ EKERN_INVALID_CAPABILITY = 20,
+ EKERN_RIGHT_EXISTS = 21,
+ EKERN_INVALID_HOST = 22,
+ EKERN_MEMORY_PRESENT = 23,
+ EKERN_WRITE_PROTECTION_FAILURE = 24,
+ EKERN_TERMINATED = 26,
+ EKERN_TIMEDOUT = 27,
+ EKERN_INTERRUPTED = 28,
- /* Errors from <mach/mig_errors.h>. */
- EMIG_TYPE_ERROR = -300 /* client type check failure */,
- EMIG_REPLY_MISMATCH = -301 /* wrong reply message ID */,
- EMIG_REMOTE_ERROR = -302 /* server detected error */,
- EMIG_BAD_ID = -303 /* bad request message ID */,
- EMIG_BAD_ARGUMENTS = -304 /* server type check failure */,
- EMIG_NO_REPLY = -305 /* no reply should be sent */,
- EMIG_EXCEPTION = -306 /* server raised exception */,
- EMIG_ARRAY_TOO_LARGE = -307 /* array not large enough */,
- EMIG_SERVER_DIED = -308 /* server died */,
- EMIG_DESTROY_REQUEST = -309 /* destroy request with no reply */,
+/* Errors from <mach/mig_errors.h>. */
+ EMIG_TYPE_ERROR = -300, /* client type check failure */
+ EMIG_REPLY_MISMATCH = -301, /* wrong reply message ID */
+ EMIG_REMOTE_ERROR = -302, /* server detected error */
+ EMIG_BAD_ID = -303, /* bad request message ID */
+ EMIG_BAD_ARGUMENTS = -304, /* server type check failure */
+ EMIG_NO_REPLY = -305, /* no reply should be sent */
+ EMIG_EXCEPTION = -306, /* server raised exception */
+ EMIG_ARRAY_TOO_LARGE = -307, /* array not large enough */
+ EMIG_SERVER_DIED = -308, /* server died */
+ EMIG_DESTROY_REQUEST = -309, /* destroy request with no reply */
- /* Errors from <device/device_types.h>. */
- ED_IO_ERROR = 2500 /* hardware IO error */,
- ED_WOULD_BLOCK = 2501 /* would block, but D_NOWAIT set */,
- ED_NO_SUCH_DEVICE = 2502 /* no such device */,
- ED_ALREADY_OPEN = 2503 /* exclusive-use device already open */,
- ED_DEVICE_DOWN = 2504 /* device has been shut down */,
- ED_INVALID_OPERATION = 2505 /* bad operation for device */,
- ED_INVALID_RECNUM = 2506 /* invalid record (block) number */,
- ED_INVALID_SIZE = 2507 /* invalid IO size */,
- ED_NO_MEMORY = 2508 /* memory allocation failure */,
- ED_READ_ONLY = 2509 /* device cannot be written to */
+/* Errors from <device/device_types.h>. */
+ ED_IO_ERROR = 2500, /* hardware IO error */
+ ED_WOULD_BLOCK = 2501, /* would block, but D_NOWAIT set */
+ ED_NO_SUCH_DEVICE = 2502, /* no such device */
+ ED_ALREADY_OPEN = 2503, /* exclusive-use device already open */
+ ED_DEVICE_DOWN = 2504, /* device has been shut down */
+ ED_INVALID_OPERATION = 2505, /* bad operation for device */
+ ED_INVALID_RECNUM = 2506, /* invalid record (block) number */
+ ED_INVALID_SIZE = 2507, /* invalid IO size */
+ ED_NO_MEMORY = 2508, /* memory allocation failure */
+ ED_READ_ONLY = 2509, /* device cannot be written to */
+ /* Because the C standard requires that errno have type 'int',
+ this enumeration must be a signed type. */
+ __FORCE_ERROR_T_CODES_SIGNED = -1
};
-#define _HURD_ERRNOS 120
+#endif /* not __ASSEMBLER__ */
-/* User-visible type of error codes. It is ok to use `int' or
- `kern_return_t' for these, but with `error_t' the debugger prints
- symbolic values. */
-#ifdef __USE_GNU
-typedef enum __error_t_codes error_t;
-#define __error_t_defined 1
-#endif
+/* The C standard requires that all of the E-constants be
+ defined as macros. */
+
+#define EPERM 0x40000001
+#define ENOENT 0x40000002
+#define ESRCH 0x40000003
+#define EINTR 0x40000004
+#define EIO 0x40000005
+#define ENXIO 0x40000006
+#define E2BIG 0x40000007
+#define ENOEXEC 0x40000008
+#define EBADF 0x40000009
+#define ECHILD 0x4000000a
+#define EDEADLK 0x4000000b
+#define ENOMEM 0x4000000c
+#define EACCES 0x4000000d
+#define EFAULT 0x4000000e
+#define ENOTBLK 0x4000000f
+#define EBUSY 0x40000010
+#define EEXIST 0x40000011
+#define EXDEV 0x40000012
+#define ENODEV 0x40000013
+#define ENOTDIR 0x40000014
+#define EISDIR 0x40000015
+#define EINVAL 0x40000016
+#define EMFILE 0x40000018
+#define ENFILE 0x40000017
+#define ENOTTY 0x40000019
+#define ETXTBSY 0x4000001a
+#define EFBIG 0x4000001b
+#define ENOSPC 0x4000001c
+#define ESPIPE 0x4000001d
+#define EROFS 0x4000001e
+#define EMLINK 0x4000001f
+#define EPIPE 0x40000020
+#define EDOM 0x40000021
+#define ERANGE 0x40000022
+#define EAGAIN 0x40000023
+#define EWOULDBLOCK EAGAIN
+#define EINPROGRESS 0x40000024
+#define EALREADY 0x40000025
+#define ENOTSOCK 0x40000026
+#define EMSGSIZE 0x40000028
+#define EPROTOTYPE 0x40000029
+#define ENOPROTOOPT 0x4000002a
+#define EPROTONOSUPPORT 0x4000002b
+#define ESOCKTNOSUPPORT 0x4000002c
+#define EOPNOTSUPP 0x4000002d
+#define EPFNOSUPPORT 0x4000002e
+#define EAFNOSUPPORT 0x4000002f
+#define EADDRINUSE 0x40000030
+#define EADDRNOTAVAIL 0x40000031
+#define ENETDOWN 0x40000032
+#define ENETUNREACH 0x40000033
+#define ENETRESET 0x40000034
+#define ECONNABORTED 0x40000035
+#define ECONNRESET 0x40000036
+#define ENOBUFS 0x40000037
+#define EISCONN 0x40000038
+#define ENOTCONN 0x40000039
+#define EDESTADDRREQ 0x40000027
+#define ESHUTDOWN 0x4000003a
+#define ETOOMANYREFS 0x4000003b
+#define ETIMEDOUT 0x4000003c
+#define ECONNREFUSED 0x4000003d
+#define ELOOP 0x4000003e
+#define ENAMETOOLONG 0x4000003f
+#define EHOSTDOWN 0x40000040
+#define EHOSTUNREACH 0x40000041
+#define ENOTEMPTY 0x40000042
+#define EPROCLIM 0x40000043
+#define EUSERS 0x40000044
+#define EDQUOT 0x40000045
+#define ESTALE 0x40000046
+#define EREMOTE 0x40000047
+#define EBADRPC 0x40000048
+#define ERPCMISMATCH 0x40000049
+#define EPROGUNAVAIL 0x4000004a
+#define EPROGMISMATCH 0x4000004b
+#define EPROCUNAVAIL 0x4000004c
+#define ENOLCK 0x4000004d
+#define EFTYPE 0x4000004f
+#define EAUTH 0x40000050
+#define ENEEDAUTH 0x40000051
+#define ENOSYS 0x4000004e
+#define ENOTSUP 0x40000076
+#define EILSEQ 0x4000006a
+#define EBACKGROUND 0x40000064
+#define EDIED 0x40000065
+#define ED 0x40000066
+#define EGREGIOUS 0x40000067
+#define EIEIO 0x40000068
+#define EGRATUITOUS 0x40000069
+#define EBADMSG 0x4000006b
+#define EIDRM 0x4000006c
+#define EMULTIHOP 0x4000006d
+#define ENODATA 0x4000006e
+#define ENOLINK 0x4000006f
+#define ENOMSG 0x40000070
+#define ENOSR 0x40000071
+#define ENOSTR 0x40000072
+#define EOVERFLOW 0x40000073
+#define EPROTO 0x40000074
+#define ETIME 0x40000075
+#define ECANCELED 0x40000077
+#define EOWNERDEAD 0x40000078
+#define ENOTRECOVERABLE 0x40000079
+
+/* Errors from <mach/message.h>. */
+#define EMACH_SEND_IN_PROGRESS 0x10000001
+#define EMACH_SEND_INVALID_DATA 0x10000002
+#define EMACH_SEND_INVALID_DEST 0x10000003
+#define EMACH_SEND_TIMED_OUT 0x10000004
+#define EMACH_SEND_WILL_NOTIFY 0x10000005
+#define EMACH_SEND_NOTIFY_IN_PROGRESS 0x10000006
+#define EMACH_SEND_INTERRUPTED 0x10000007
+#define EMACH_SEND_MSG_TOO_SMALL 0x10000008
+#define EMACH_SEND_INVALID_REPLY 0x10000009
+#define EMACH_SEND_INVALID_RIGHT 0x1000000a
+#define EMACH_SEND_INVALID_NOTIFY 0x1000000b
+#define EMACH_SEND_INVALID_MEMORY 0x1000000c
+#define EMACH_SEND_NO_BUFFER 0x1000000d
+#define EMACH_SEND_NO_NOTIFY 0x1000000e
+#define EMACH_SEND_INVALID_TYPE 0x1000000f
+#define EMACH_SEND_INVALID_HEADER 0x10000010
+#define EMACH_RCV_IN_PROGRESS 0x10004001
+#define EMACH_RCV_INVALID_NAME 0x10004002
+#define EMACH_RCV_TIMED_OUT 0x10004003
+#define EMACH_RCV_TOO_LARGE 0x10004004
+#define EMACH_RCV_INTERRUPTED 0x10004005
+#define EMACH_RCV_PORT_CHANGED 0x10004006
+#define EMACH_RCV_INVALID_NOTIFY 0x10004007
+#define EMACH_RCV_INVALID_DATA 0x10004008
+#define EMACH_RCV_PORT_DIED 0x10004009
+#define EMACH_RCV_IN_SET 0x1000400a
+#define EMACH_RCV_HEADER_ERROR 0x1000400b
+#define EMACH_RCV_BODY_ERROR 0x1000400c
+
+/* Errors from <mach/kern_return.h>. */
+#define EKERN_INVALID_ADDRESS 1
+#define EKERN_PROTECTION_FAILURE 2
+#define EKERN_NO_SPACE 3
+#define EKERN_INVALID_ARGUMENT 4
+#define EKERN_FAILURE 5
+#define EKERN_RESOURCE_SHORTAGE 6
+#define EKERN_NOT_RECEIVER 7
+#define EKERN_NO_ACCESS 8
+#define EKERN_MEMORY_FAILURE 9
+#define EKERN_MEMORY_ERROR 10
+#define EKERN_NOT_IN_SET 12
+#define EKERN_NAME_EXISTS 13
+#define EKERN_ABORTED 14
+#define EKERN_INVALID_NAME 15
+#define EKERN_INVALID_TASK 16
+#define EKERN_INVALID_RIGHT 17
+#define EKERN_INVALID_VALUE 18
+#define EKERN_UREFS_OVERFLOW 19
+#define EKERN_INVALID_CAPABILITY 20
+#define EKERN_RIGHT_EXISTS 21
+#define EKERN_INVALID_HOST 22
+#define EKERN_MEMORY_PRESENT 23
+#define EKERN_WRITE_PROTECTION_FAILURE 24
+#define EKERN_TERMINATED 26
+#define EKERN_TIMEDOUT 27
+#define EKERN_INTERRUPTED 28
-/* Return the current thread's location for `errno'.
- The syntax of this function allows redeclarations like `int errno'. */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+/* Errors from <mach/mig_errors.h>. */
+#define EMIG_TYPE_ERROR -300
+#define EMIG_REPLY_MISMATCH -301
+#define EMIG_REMOTE_ERROR -302
+#define EMIG_BAD_ID -303
+#define EMIG_BAD_ARGUMENTS -304
+#define EMIG_NO_REPLY -305
+#define EMIG_EXCEPTION -306
+#define EMIG_ARRAY_TOO_LARGE -307
+#define EMIG_SERVER_DIED -308
+#define EMIG_DESTROY_REQUEST -309
-#define errno (*__errno_location ())
+/* Errors from <device/device_types.h>. */
+#define ED_IO_ERROR 2500
+#define ED_WOULD_BLOCK 2501
+#define ED_NO_SUCH_DEVICE 2502
+#define ED_ALREADY_OPEN 2503
+#define ED_DEVICE_DOWN 2504
+#define ED_INVALID_OPERATION 2505
+#define ED_INVALID_RECNUM 2506
+#define ED_INVALID_SIZE 2507
+#define ED_NO_MEMORY 2508
+#define ED_READ_ONLY 2509
-#endif /* <errno.h> included. */
+#define _HURD_ERRNOS 122
-#if !defined (_ERRNO_H) && defined (__need_Emath)
-#define EDOM _HURD_ERRNO (33)/* Numerical argument out of domain */
-#define ERANGE _HURD_ERRNO (34)/* Numerical result out of range */
-#endif /* <errno.h> not included and need math error codes. */
+#endif /* bits/errno.h. */
diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h
index fbd0b0abae..2cfaa872a5 100644
--- a/sysdeps/mach/hurd/bits/fcntl.h
+++ b/sysdeps/mach/hurd/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for GNU.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -135,7 +135,7 @@
#ifdef __USE_MISC
-/* Bits in the file status flags returned by F_GETFL. */
+/* Flags for TIOCFLUSH. */
# define FREAD O_RDONLY
# define FWRITE O_WRONLY
diff --git a/sysdeps/mach/hurd/bits/ioctls.h b/sysdeps/mach/hurd/bits/ioctls.h
index 7a5a28d52c..91a15b5083 100644
--- a/sysdeps/mach/hurd/bits/ioctls.h
+++ b/sysdeps/mach/hurd/bits/ioctls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/bits/local_lim.h b/sysdeps/mach/hurd/bits/local_lim.h
index a7760eeb1d..97f87ad5d2 100644
--- a/sysdeps/mach/hurd/bits/local_lim.h
+++ b/sysdeps/mach/hurd/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Hurd version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,3 +32,12 @@
suitable, and `sysconf' will return a number at least as large. */
#define NGROUPS_MAX 256
+
+/* The number of data keys per process. */
+#define _POSIX_THREAD_KEYS_MAX 128
+
+/* Controlling the iterations of destructors for thread-specific data. */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
+
+/* The number of threads per process. */
+#define _POSIX_THREAD_THREADS_MAX 64
diff --git a/sysdeps/mach/hurd/bits/param.h b/sysdeps/mach/hurd/bits/param.h
index 84cbf5acca..5d4faf793f 100644
--- a/sysdeps/mach/hurd/bits/param.h
+++ b/sysdeps/mach/hurd/bits/param.h
@@ -1,5 +1,5 @@
/* Old-style Unix parameters and limits. Hurd version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,8 @@
# error "Never use <bits/param.h> directly; include <sys/param.h> instead."
#endif
+#include <bits/mach/param.h>
+
/* This file is deprecated and is provided only for compatibility with
Unix systems. It is unwise to include this file on programs which
are intended only for GNU systems.
diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h
index 5a578f0c1f..dfb0ba46ec 100644
--- a/sysdeps/mach/hurd/bits/posix_opt.h
+++ b/sysdeps/mach/hurd/bits/posix_opt.h
@@ -1,5 +1,5 @@
/* Define POSIX options for GNU/Hurd.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -42,8 +42,8 @@
/* Mapping of files to memory is supported. */
#define _POSIX_MAPPED_FILES 200809L
-/* Locking of all memory could be supported in future. */
-#define _POSIX_MEMLOCK 0
+/* Locking of all memory is supported. */
+#define _POSIX_MEMLOCK 200809L
/* Locking of ranges of memory is supported. */
#define _POSIX_MEMLOCK_RANGE 200809L
@@ -53,13 +53,13 @@
/* Elements of the `c_cc' member of `struct termios' structure
can be disabled by using the value _POSIX_VDISABLE. */
-#define _POSIX_VDISABLE ((unsigned char) -1)
+#define _POSIX_VDISABLE '\0'
/* Different Hurd filesystems might do these differently.
You must query the particular file with `pathconf' or `fpathconf'. */
-#undef _POSIX_CHOWN_RESTRICTED /* Only root can change owner of file? */
-#undef _POSIX_NO_TRUNC /* Overlong file names get error? */
+#define _POSIX_CHOWN_RESTRICTED 0 /* Only root can change owner of file? */
+#define _POSIX_NO_TRUNC 0 /* Overlong file names get error? */
#undef _POSIX_SYNC_IO /* File supports O_SYNC et al? */
/* X/Open realtime support is not supported. */
@@ -71,24 +71,38 @@
/* XPG4.2 shared memory is not supported. */
#undef _XOPEN_SHM
-/* We do not have the POSIX threads interface. */
-#define _POSIX_THREADS -1
+/* Tell we have POSIX threads. */
+#define _POSIX_THREADS 200809L
/* We have the reentrant functions described in POSIX. */
#define _POSIX_REENTRANT_FUNCTIONS 1
#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L
-/* These are all things that won't be supported when _POSIX_THREADS is not. */
+/* We do not provide priority scheduling for threads. */
#define _POSIX_THREAD_PRIORITY_SCHEDULING -1
-#define _POSIX_THREAD_ATTR_STACKSIZE -1
-#define _POSIX_THREAD_ATTR_STACKADDR -1
+
+/* We support user-defined stack sizes. */
+#define _POSIX_THREAD_ATTR_STACKSIZE 200809L
+
+/* We support user-defined stacks. */
+#define _POSIX_THREAD_ATTR_STACKADDR 200809L
+
+/* We do not support priority inheritence. */
#define _POSIX_THREAD_PRIO_INHERIT -1
+
+/* We do not support priority protection. */
#define _POSIX_THREAD_PRIO_PROTECT -1
+
#ifdef __USE_XOPEN2K8
+/* We do not support priority inheritence for robust mutexes. */
# define _POSIX_THREAD_ROBUST_PRIO_INHERIT -1
+
+/* We do not support priority protection for robust mutexes. */
# define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1
#endif
-#define _POSIX_SEMAPHORES -1
+
+/* We support POSIX.1b semaphores. */
+#define _POSIX_SEMAPHORES 200809L
/* Real-time signals are not yet supported. */
#define _POSIX_REALTIME_SIGNALS -1
@@ -121,17 +135,17 @@
/* GNU libc provides regular expression handling. */
#define _POSIX_REGEXP 1
-/* Reader/Writer locks are not available. */
-#define _POSIX_READER_WRITER_LOCKS -1
+/* Reader/Writer locks are available. */
+#define _POSIX_READER_WRITER_LOCKS 200809L
/* We have a POSIX shell. */
#define _POSIX_SHELL 1
-/* We cannot support the Timeouts option without _POSIX_THREADS. */
-#define _POSIX_TIMEOUTS -1
+/* We support the Timeouts option. */
+#define _POSIX_TIMEOUTS 200809L
-/* We do not support spinlocks. */
-#define _POSIX_SPIN_LOCKS -1
+/* We support spinlocks. */
+#define _POSIX_SPIN_LOCKS 200809L
/* The `spawn' function family is supported. */
#define _POSIX_SPAWN 200809L
@@ -139,8 +153,8 @@
/* We do not have POSIX timers, but could in future without ABI change. */
#define _POSIX_TIMERS 0
-/* The barrier functions are not available. */
-#define _POSIX_BARRIERS -1
+/* The barrier functions are available. */
+#define _POSIX_BARRIERS 200809L
/* POSIX message queues could be available in future. */
#define _POSIX_MESSAGE_PASSING 0
diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
index 02c5dac032..18959139dc 100644
--- a/sysdeps/mach/hurd/bits/socket.h
+++ b/sysdeps/mach/hurd/bits/socket.h
@@ -1,5 +1,5 @@
/* System-specific socket constants and types. Hurd version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -25,11 +25,10 @@
#endif
#define __need_size_t
-#define __need_NULL
#include <stddef.h>
-#include <limits.h> /* XXX Is this allowed? */
-#include <bits/types.h>
+#include <bits/wordsize.h>
+#include <sys/types.h>
/* Type for length arguments in socket calls. */
#ifndef __socklen_t_defined
@@ -131,13 +130,19 @@ enum __socket_type
#define AF_APPLETALK PF_APPLETALK
#define AF_ROUTE PF_ROUTE
#define AF_LINK PF_LINK
-#define pseudo_AF_XTP PF_XTP
+#ifdef __USE_MISC
+# define pseudo_AF_XTP PF_XTP
+#endif
#define AF_COIP PF_COIP
#define AF_CNT PF_CNT
-#define pseudo_AF_RTIP PF_RTIP
+#ifdef __USE_MISC
+# define pseudo_AF_RTIP PF_RTIP
+#endif
#define AF_IPX PF_IPX
#define AF_SIP PF_SIP
-#define pseudo_AF_PIP PF_PIP
+#ifdef __USE_MISC
+# define pseudo_AF_PIP PF_PIP
+#endif
#define AF_INET6 PF_INET6
#define AF_MAX PF_MAX
@@ -156,20 +161,20 @@ struct sockaddr
/* Structure large enough to hold any socket address (with the historical
- exception of AF_UNIX). We reserve 128 bytes. */
-#if ULONG_MAX > 0xffffffff
+ exception of AF_UNIX). */
+#if __WORDSIZE == 64
# define __ss_aligntype __uint64_t
#else
# define __ss_aligntype __uint32_t
#endif
-#define _SS_SIZE 128
-#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+#define _SS_PADSIZE \
+ (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype))
struct sockaddr_storage
{
__SOCKADDR_COMMON (ss_); /* Address family, etc. */
- __ss_aligntype __ss_align; /* Force desired alignment. */
char __ss_padding[_SS_PADSIZE];
+ __ss_aligntype __ss_align; /* Force desired alignment. */
};
@@ -220,13 +225,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))
@@ -236,7 +241,7 @@ struct cmsghdr
#define CMSG_FIRSTHDR(mhdr) \
((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
- ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
& (size_t) ~(sizeof (size_t) - 1))
@@ -255,7 +260,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
{
if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
/* The kernel header does this so there may be a reason. */
- return NULL;
+ return (struct cmsghdr *) 0;
__cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ CMSG_ALIGN (__cmsg->cmsg_len));
@@ -264,7 +269,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
|| ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
> ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
/* No more entries. */
- return NULL;
+ return (struct cmsghdr *) 0;
return __cmsg;
}
#endif /* Use `extern inline'. */
@@ -280,6 +285,7 @@ enum
#define SCM_CREDS SCM_CREDS
};
+#ifdef __USE_MISC
/* Unfortunately, BSD practice dictates this structure be of fixed size.
If there are more than CMGROUP_MAX groups, the list is truncated.
(On GNU systems, the `cmcred_euid' field is just the first in the
@@ -300,6 +306,7 @@ struct cmsgcred
int cmcred_ngroups;
__gid_t cmcred_groups[CMGROUP_MAX];
};
+#endif
/* Protocol number used to manipulate socket-level options
with `getsockopt' and `setsockopt'. */
diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
index 3e4a7d247b..cb8680e000 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -255,4 +255,9 @@ extern int fchflags (int __fd, unsigned long int __flags) __THROW;
__END_DECLS
#endif
+#ifdef __USE_ATFILE
+# define UTIME_NOW -1 /* corresponds to the current time */
+# define UTIME_OMIT -2 /* target time is omitted */
+#endif
+
#endif /* bits/stat.h */
diff --git a/sysdeps/mach/hurd/bits/statfs.h b/sysdeps/mach/hurd/bits/statfs.h
index ab37e5a51f..82e570b222 100644
--- a/sysdeps/mach/hurd/bits/statfs.h
+++ b/sysdeps/mach/hurd/bits/statfs.h
@@ -1,5 +1,5 @@
/* Definition of `struct statfs', information about a filesystem.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,7 +37,7 @@
struct statfs
{
unsigned int f_type;
- unsigned int f_bsize;
+ unsigned long int f_bsize;
#ifndef __USE_FILE_OFFSET64
__fsblkcnt_t f_blocks;
__fsblkcnt_t f_bfree;
@@ -52,14 +52,14 @@ struct statfs
__fsblkcnt64_t f_ffree;
#endif
__fsid_t f_fsid;
- unsigned int f_namelen;
+ unsigned long int f_namelen;
#ifndef __USE_FILE_OFFSET64
__fsfilcnt_t f_favail;
#else
__fsfilcnt64_t f_favail;
#endif
- unsigned int f_frsize;
- unsigned int f_flag;
+ unsigned long int f_frsize;
+ unsigned long int f_flag;
unsigned int f_spare[3];
};
@@ -67,17 +67,17 @@ struct statfs
struct statfs64
{
unsigned int f_type;
- unsigned int f_bsize;
+ unsigned long int f_bsize;
__fsblkcnt64_t f_blocks;
__fsblkcnt64_t f_bfree;
__fsblkcnt64_t f_bavail;
__fsblkcnt64_t f_files;
__fsblkcnt64_t f_ffree;
__fsid_t f_fsid;
- unsigned int f_namelen;
+ unsigned long int f_namelen;
__fsfilcnt64_t f_favail;
- unsigned int f_frsize;
- unsigned int f_flag;
+ unsigned long int f_frsize;
+ unsigned long int f_flag;
unsigned int f_spare[3];
};
#endif
diff --git a/sysdeps/mach/hurd/bits/statvfs.h b/sysdeps/mach/hurd/bits/statvfs.h
index 98d622b366..9880b2c9c7 100644
--- a/sysdeps/mach/hurd/bits/statvfs.h
+++ b/sysdeps/mach/hurd/bits/statvfs.h
@@ -1,5 +1,5 @@
/* Definition of `struct statvfs', information about a filesystem.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,7 +30,7 @@
struct statvfs
{
unsigned int __f_type;
- unsigned int f_bsize;
+ unsigned long int f_bsize;
#ifndef __USE_FILE_OFFSET64
__fsblkcnt_t f_blocks;
__fsblkcnt_t f_bfree;
@@ -45,14 +45,14 @@ struct statvfs
__fsfilcnt64_t f_ffree;
#endif
__fsid_t f_fsid;
- unsigned int f_namemax; /* NOTE: f_namelen in `struct statfs'. */
+ unsigned long int f_namemax; /* NOTE: f_namelen in `struct statfs'. */
#ifndef __USE_FILE_OFFSET64
__fsfilcnt_t f_favail;
#else
__fsfilcnt64_t f_favail;
#endif
- unsigned int f_frsize;
- unsigned int f_flag;
+ unsigned long int f_frsize;
+ unsigned long int f_flag;
unsigned int f_spare[3];
};
@@ -60,17 +60,17 @@ struct statvfs
struct statvfs64
{
unsigned int __f_type;
- unsigned int f_bsize;
+ unsigned long int f_bsize;
__fsblkcnt64_t f_blocks;
__fsblkcnt64_t f_bfree;
__fsblkcnt64_t f_bavail;
__fsfilcnt64_t f_files;
__fsfilcnt64_t f_ffree;
__fsid_t f_fsid;
- unsigned int f_namemax;
+ unsigned long int f_namemax;
__fsfilcnt64_t f_favail;
- unsigned int f_frsize;
- unsigned int f_flag;
+ unsigned long int f_frsize;
+ unsigned long int f_flag;
unsigned int f_spare[3];
};
#endif
diff --git a/sysdeps/mach/hurd/bits/sysmacros.h b/sysdeps/mach/hurd/bits/sysmacros.h
new file mode 100644
index 0000000000..b75a329d04
--- /dev/null
+++ b/sysdeps/mach/hurd/bits/sysmacros.h
@@ -0,0 +1,60 @@
+/* Definitions of macros to access `dev_t' values. Hurd version.
+ Copyright (C) 1996-2018 Free Software 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 _BITS_SYSMACROS_H
+#define _BITS_SYSMACROS_H 1
+
+#ifndef _SYS_SYSMACROS_H
+# error "Never include <bits/sysmacros.h> directly; use <sys/sysmacros.h> instead."
+#endif
+
+/* The Hurd version of dev_t in glibc is a 32-bit quantity, with 8-bit
+ major and 24-bit minor numbers. The encoding is mmmmMMmm, where M is a
+ hex digit of the major number and m is a hex digit of the minor number. */
+
+#define __SYSMACROS_DECLARE_MAJOR(DECL_TEMPL) \
+ DECL_TEMPL(unsigned int, major, (__dev_t __dev))
+
+#define __SYSMACROS_DEFINE_MAJOR(DECL_TEMPL) \
+ __SYSMACROS_DECLARE_MAJOR (DECL_TEMPL) \
+ { \
+ return ((__dev & (__dev_t) 0x0000ff00u) >> 8); \
+ }
+
+#define __SYSMACROS_DECLARE_MINOR(DECL_TEMPL) \
+ DECL_TEMPL(unsigned int, minor, (__dev_t __dev))
+
+#define __SYSMACROS_DEFINE_MINOR(DECL_TEMPL) \
+ __SYSMACROS_DECLARE_MINOR (DECL_TEMPL) \
+ { \
+ return (__dev & (__dev_t) 0xffff00ff); \
+ }
+
+#define __SYSMACROS_DECLARE_MAKEDEV(DECL_TEMPL) \
+ DECL_TEMPL(__dev_t, makedev, (unsigned int __major, unsigned int __minor))
+
+#define __SYSMACROS_DEFINE_MAKEDEV(DECL_TEMPL) \
+ __SYSMACROS_DECLARE_MAKEDEV (DECL_TEMPL) \
+ { \
+ __dev_t __dev; \
+ __dev = (((__dev_t) (__major & 0x000000ffu)) << 8); \
+ __dev |= (((__dev_t) (__minor & 0xffff00ffu)) << 0); \
+ return __dev; \
+ }
+
+#endif /* bits/sysmacros.h */
diff --git a/sysdeps/mach/hurd/bits/types/error_t.h b/sysdeps/mach/hurd/bits/types/error_t.h
new file mode 100644
index 0000000000..286e5fdc6a
--- /dev/null
+++ b/sysdeps/mach/hurd/bits/types/error_t.h
@@ -0,0 +1,29 @@
+/* Define error_t.
+ Copyright (C) 1991-2018 Free Software 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 <bits/errno.h>
+
+/* User-visible type of error codes. It is ok to use 'int' or
+ 'kern_return_t' for these, but with 'error_t' the debugger prints
+ symbolic values. */
+#ifndef __error_t_defined
+# define __error_t_defined 1
+
+typedef enum __error_t_codes error_t;
+
+#endif
diff --git a/sysdeps/mach/hurd/bits/typesizes.h b/sysdeps/mach/hurd/bits/typesizes.h
index a33fb7fe8b..d3026ba66e 100644
--- a/sysdeps/mach/hurd/bits/typesizes.h
+++ b/sysdeps/mach/hurd/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Hurd version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/brk.c b/sysdeps/mach/hurd/brk.c
index 972d6a9791..f8272e5f22 100644
--- a/sysdeps/mach/hurd/brk.c
+++ b/sysdeps/mach/hurd/brk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/chdir.c b/sysdeps/mach/hurd/chdir.c
index 86cf576cc7..b1cec6266c 100644
--- a/sysdeps/mach/hurd/chdir.c
+++ b/sysdeps/mach/hurd/chdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/check_fds.c b/sysdeps/mach/hurd/check_fds.c
index 2858868845..c21432a80e 100644
--- a/sysdeps/mach/hurd/check_fds.c
+++ b/sysdeps/mach/hurd/check_fds.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/check_native.c b/sysdeps/mach/hurd/check_native.c
new file mode 100644
index 0000000000..d16ff883a9
--- /dev/null
+++ b/sysdeps/mach/hurd/check_native.c
@@ -0,0 +1 @@
+#include <inet/check_native.c>
diff --git a/sysdeps/mach/hurd/check_pf.c b/sysdeps/mach/hurd/check_pf.c
new file mode 100644
index 0000000000..edd99a7278
--- /dev/null
+++ b/sysdeps/mach/hurd/check_pf.c
@@ -0,0 +1 @@
+#include <inet/check_pf.c>
diff --git a/sysdeps/mach/hurd/chflags.c b/sysdeps/mach/hurd/chflags.c
index 02b247a6bc..4673043d74 100644
--- a/sysdeps/mach/hurd/chflags.c
+++ b/sysdeps/mach/hurd/chflags.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/chmod.c b/sysdeps/mach/hurd/chmod.c
index 47c93fea3b..bed20efb7a 100644
--- a/sysdeps/mach/hurd/chmod.c
+++ b/sysdeps/mach/hurd/chmod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,4 +35,5 @@ __chmod (const char *file, mode_t mode)
return 0;
}
+libc_hidden_def (__chmod)
weak_alias (__chmod, chmod)
diff --git a/sysdeps/mach/hurd/chown.c b/sysdeps/mach/hurd/chown.c
index 28db3c9bf5..6a50f82646 100644
--- a/sysdeps/mach/hurd/chown.c
+++ b/sysdeps/mach/hurd/chown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/chroot.c b/sysdeps/mach/hurd/chroot.c
index 93dc9790d3..bd08556824 100644
--- a/sysdeps/mach/hurd/chroot.c
+++ b/sysdeps/mach/hurd/chroot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/clock.c b/sysdeps/mach/hurd/clock.c
index 9f4f26a17c..296ca89d21 100644
--- a/sysdeps/mach/hurd/clock.c
+++ b/sysdeps/mach/hurd/clock.c
@@ -1,5 +1,5 @@
/* Return the CPU time used by the program so far. Hurd version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/close.c b/sysdeps/mach/hurd/close.c
index fab44a47ee..d064448b44 100644
--- a/sysdeps/mach/hurd/close.c
+++ b/sysdeps/mach/hurd/close.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/closedir.c b/sysdeps/mach/hurd/closedir.c
index 3e1eae44d3..783cd580ab 100644
--- a/sysdeps/mach/hurd/closedir.c
+++ b/sysdeps/mach/hurd/closedir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure
index 3d155a450e..66cc0ce3a5 100644
--- a/sysdeps/mach/hurd/configure
+++ b/sysdeps/mach/hurd/configure
@@ -1,6 +1,6 @@
# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
-$as_echo "#define NO_HIDDEN 1" >>confdefs.h
+$as_echo "#define NO_RTLD_HIDDEN 1" >>confdefs.h
if test -n "$sysheaders"; then
@@ -45,3 +45,5 @@ fi
if test -n "$sysheaders"; then
CPPFLAGS=$OLD_CPPFLAGS
fi
+
+libc_cv_ld_gnu_indirect_function=no
diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac
index af9a9ea052..774ffc80a9 100644
--- a/sysdeps/mach/hurd/configure.ac
+++ b/sysdeps/mach/hurd/configure.ac
@@ -1,7 +1,9 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
dnl We need this setting because of the need for PLT calls in ld.so.
-AC_DEFINE([NO_HIDDEN])
+dnl See Roland's comment in
+dnl https://sourceware.org/bugzilla/show_bug.cgi?id=15605
+AC_DEFINE([NO_RTLD_HIDDEN])
if test -n "$sysheaders"; then
OLD_CPPFLAGS=$CPPFLAGS
@@ -24,3 +26,7 @@ fi
if test -n "$sysheaders"; then
CPPFLAGS=$OLD_CPPFLAGS
fi
+
+dnl ifunc does not work yet for static binaries
+dnl http://www.gnu.org/software/hurd/open_issues/ifunc.html
+libc_cv_ld_gnu_indirect_function=no
diff --git a/sysdeps/mach/hurd/connect.c b/sysdeps/mach/hurd/connect.c
index 80fcf0be0f..537d686778 100644
--- a/sysdeps/mach/hurd/connect.c
+++ b/sysdeps/mach/hurd/connect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/cthreads.c b/sysdeps/mach/hurd/cthreads.c
index ca1cc0dd91..05c48e4e4c 100644
--- a/sysdeps/mach/hurd/cthreads.c
+++ b/sysdeps/mach/hurd/cthreads.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,11 +18,16 @@
#include <libc-lock.h>
#include <errno.h>
#include <stdlib.h>
+#include <cthreads.h>
+
+/* This serves as stub "self" pointer for libc locks when TLS is not initialized
+ yet. */
+char __libc_lock_self0[0];
/* Placeholder for key creation routine from Hurd cthreads library. */
int
weak_function
-cthread_keycreate (cthread_key_t *key)
+__cthread_keycreate (cthread_key_t *key)
{
__set_errno (ENOSYS);
*key = -1;
@@ -32,7 +37,7 @@ cthread_keycreate (cthread_key_t *key)
/* Placeholder for key retrieval routine from Hurd cthreads library. */
int
weak_function
-cthread_getspecific (cthread_key_t key, void **pval)
+__cthread_getspecific (cthread_key_t key, void **pval)
{
*pval = NULL;
__set_errno (ENOSYS);
@@ -42,18 +47,8 @@ cthread_getspecific (cthread_key_t key, void **pval)
/* Placeholder for key setting routine from Hurd cthreads library. */
int
weak_function
-cthread_setspecific (cthread_key_t key, void *val)
+__cthread_setspecific (cthread_key_t key, void *val)
{
__set_errno (ENOSYS);
return -1;
}
-
-/* Call cthread_getspecific which gets a pointer to the return value instead
- of just returning it. */
-void *
-__libc_getspecific (cthread_key_t key)
-{
- void *val;
- cthread_getspecific (key, &val);
- return val;
-}
diff --git a/sysdeps/mach/hurd/device-nrs.h b/sysdeps/mach/hurd/device-nrs.h
index 6a56af14ee..a006028e29 100644
--- a/sysdeps/mach/hurd/device-nrs.h
+++ b/sysdeps/mach/hurd/device-nrs.h
@@ -1,5 +1,5 @@
/* Device numbers of devices used in the implementation. Hurd version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/dirfd.c b/sysdeps/mach/hurd/dirfd.c
index 06a9238b93..f70ee8d3e3 100644
--- a/sysdeps/mach/hurd/dirfd.c
+++ b/sysdeps/mach/hurd/dirfd.c
@@ -1,5 +1,5 @@
/* dirfd -- Return the file descriptor used by a DIR stream. Hurd version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
#include <errno.h>
int
-dirfd (DIR *dirp)
+__dirfd (DIR *dirp)
{
int fd;
@@ -41,3 +41,6 @@ dirfd (DIR *dirp)
return fd;
}
+
+weak_alias (__dirfd, dirfd)
+libc_hidden_def (dirfd)
diff --git a/sysdeps/mach/hurd/dirstream.h b/sysdeps/mach/hurd/dirstream.h
index 6134ac5688..45d2e8e571 100644
--- a/sysdeps/mach/hurd/dirstream.h
+++ b/sysdeps/mach/hurd/dirstream.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/dl-execstack.c b/sysdeps/mach/hurd/dl-execstack.c
index fb0b8b41a2..b658c9667e 100644
--- a/sysdeps/mach/hurd/dl-execstack.c
+++ b/sysdeps/mach/hurd/dl-execstack.c
@@ -1,5 +1,5 @@
/* Stack executability handling for GNU dynamic linker. Hurd version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,7 +26,6 @@ extern struct hurd_startup_data *_dl_hurd_data attribute_hidden;
so as to mprotect it. */
int
-internal_function
_dl_make_stack_executable (void **stack_endp)
{
/* Challenge the caller. */
diff --git a/sysdeps/mach/hurd/dl-fcntl.h b/sysdeps/mach/hurd/dl-fcntl.h
new file mode 100644
index 0000000000..3de29dced9
--- /dev/null
+++ b/sysdeps/mach/hurd/dl-fcntl.h
@@ -0,0 +1,22 @@
+/* Functions with hidden attribute internal to ld.so, which are declared
+ in include/fcntl.h. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+/* __open can't be hidden in ld.so on Hurd since it will be preempted by the
+ one in libc.so after bootstrap. */
+extern __typeof (__fcntl) __fcntl attribute_hidden;
diff --git a/sysdeps/mach/hurd/dl-mman.h b/sysdeps/mach/hurd/dl-mman.h
index 157462b201..3502c03187 100644
--- a/sysdeps/mach/hurd/dl-mman.h
+++ b/sysdeps/mach/hurd/dl-mman.h
@@ -1,6 +1,6 @@
/* Functions with hidden attribute internal to ld.so, which are declared
in include/sys/mman.h. Hurd version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 76140cf093..b72913d3ba 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -1,5 +1,5 @@
/* Operating system support for run-time dynamic linker. Hurd version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,6 +31,7 @@
#include <assert.h>
#include <sysdep.h>
#include <mach/mig_support.h>
+#include <mach/machine/vm_param.h>
#include "hurdstartup.h"
#include <hurd/lookup.h>
#include <hurd/auth.h>
@@ -44,6 +45,9 @@
#include <dl-machine.h>
#include <dl-procinfo.h>
+#include <dl-tunables.h>
+#include <not-errno.h>
+
extern void __mach_init (void);
extern int _dl_argc;
@@ -62,28 +66,11 @@ rtld_hidden_data_def(__libc_stack_end)
hp_timing_t _dl_cpuclock_offset;
#endif
+/* TODO: Initialize. */
+void *_dl_random attribute_relro = NULL;
struct hurd_startup_data *_dl_hurd_data;
-/* This is used only within ld.so, via dl-minimal.c's __errno_location. */
-#undef errno
-int errno attribute_hidden;
-
-/* Defining these variables here avoids the inclusion of hurdsig.c. */
-unsigned long int __hurd_sigthread_stack_base;
-unsigned long int __hurd_sigthread_stack_end;
-unsigned long int *__hurd_sigthread_variables;
-
-/* Defining these variables here avoids the inclusion of init-first.c.
- We need to provide temporary storage for the per-thread variables
- of the main user thread here, since it is used for storing the
- `errno' variable. Note that this information is lost once we
- relocate the dynamic linker. */
-static unsigned long int threadvars[_HURD_THREADVAR_MAX];
-unsigned long int __hurd_threadvar_stack_offset
- = (unsigned long int) &threadvars;
-unsigned long int __hurd_threadvar_stack_mask;
-
#define FMH defined(__i386__)
#if ! FMH
# define fmh() ((void)0)
@@ -143,6 +130,8 @@ _dl_sysdep_start (void **start_argptr,
__libc_enable_secure = _dl_hurd_data->flags & EXEC_SECURE;
+ __tunables_init (_environ);
+
if (_dl_hurd_data->flags & EXEC_STACK_ARGS &&
_dl_hurd_data->user_entry == 0)
_dl_hurd_data->user_entry = (vm_address_t) ENTRY_POINT;
@@ -200,7 +189,7 @@ unfmh(); /* XXX */
up and leave us to transfer control to USER_ENTRY. */
(*dl_main) ((const ElfW(Phdr) *) _dl_hurd_data->phdr,
_dl_hurd_data->phdrsz / sizeof (ElfW(Phdr)),
- &_dl_hurd_data->user_entry, NULL);
+ (ElfW(Addr) *) &_dl_hurd_data->user_entry, NULL);
/* The call above might screw a few things up.
@@ -273,7 +262,6 @@ fmh(); /* XXX */
}
void
-internal_function
_dl_sysdep_start_cleanup (void)
{
/* Deallocate the reply port and task port rights acquired by
@@ -287,7 +275,16 @@ _dl_sysdep_start_cleanup (void)
/* Minimal open/close/mmap implementation sufficient for initial loading of
shared libraries. These are weak definitions so that when the
dynamic linker re-relocates itself to be user-visible (for -ldl),
- it will get the user's definition (i.e. usually libc's). */
+ it will get the user's definition (i.e. usually libc's).
+
+ They also need to be set in the ld section of sysdeps/mach/hurd/Versions, to
+ be overridable, and in libc.abilist and ld.abilist to be checked. */
+
+/* This macro checks that the function does not get renamed to be hidden: we do
+ need these to be overridable by libc's. */
+#define check_no_hidden(name) \
+ static __typeof (name) __check_##name##_no_hidden \
+ __attribute__ ((alias (#name)));
/* Open FILE_NAME and return a Hurd I/O for it in *PORT, or return an
error. If STAT is non-zero, stat the file into that stat buffer. */
@@ -344,6 +341,8 @@ open_file (const char *file_name, int flags,
return err;
}
+check_no_hidden(__open);
+check_no_hidden (__open64);
int weak_function
__open (const char *file_name, int mode, ...)
{
@@ -354,7 +353,9 @@ __open (const char *file_name, int mode, ...)
else
return (int)port;
}
+weak_alias (__open, __open64)
+check_no_hidden(__close);
int weak_function
__close (int fd)
{
@@ -363,8 +364,9 @@ __close (int fd)
return 0;
}
+check_no_hidden(__read);
__ssize_t weak_function
-__libc_read (int fd, void *buf, size_t nbytes)
+__read (int fd, void *buf, size_t nbytes)
{
error_t err;
char *data;
@@ -384,10 +386,11 @@ __libc_read (int fd, void *buf, size_t nbytes)
return nread;
}
-libc_hidden_weak (__libc_read)
+libc_hidden_weak (__read)
+check_no_hidden(__write);
__ssize_t weak_function
-__libc_write (int fd, const void *buf, size_t nbytes)
+__write (int fd, const void *buf, size_t nbytes)
{
error_t err;
mach_msg_type_number_t nwrote;
@@ -400,9 +403,10 @@ __libc_write (int fd, const void *buf, size_t nbytes)
return nwrote;
}
-libc_hidden_weak (__libc_write)
+libc_hidden_weak (__write)
/* This is only used for printing messages (see dl-misc.c). */
+check_no_hidden(__writev);
__ssize_t weak_function
__writev (int fd, const struct iovec *iov, int niov)
{
@@ -436,7 +440,7 @@ __writev (int fd, const struct iovec *iov, int niov)
return 0;
}
-
+check_no_hidden(__libc_lseek64);
off64_t weak_function
__libc_lseek64 (int fd, off64_t offset, int whence)
{
@@ -449,8 +453,9 @@ __libc_lseek64 (int fd, off64_t offset, int whence)
return offset;
}
-__ptr_t weak_function
-__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
+check_no_hidden(__mmap);
+void *weak_function
+__mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
{
error_t err;
vm_prot_t vmprot;
@@ -473,7 +478,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;
@@ -507,9 +513,10 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
if (err)
return __hurd_fail (err), MAP_FAILED;
- return (__ptr_t) mapaddr;
+ return (void *) mapaddr;
}
+check_no_hidden(__fxstat64);
int weak_function
__fxstat64 (int vers, int fd, struct stat64 *buf)
{
@@ -525,6 +532,7 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
}
libc_hidden_def (__fxstat64)
+check_no_hidden(__xstat64);
int weak_function
__xstat64 (int vers, const char *file, struct stat64 *buf)
{
@@ -547,13 +555,21 @@ libc_hidden_def (__xstat64)
whether debugging malloc is allowed even for SUID binaries. This
stub will always fail, which means that malloc-debugging is always
disabled for SUID binaries. */
+check_no_hidden(__access);
int weak_function
__access (const char *file, int type)
{
errno = ENOSYS;
return -1;
}
+check_no_hidden(__access_noerrno);
+int weak_function
+__access_noerrno (const char *file, int type)
+{
+ return -1;
+}
+check_no_hidden(__getpid);
pid_t weak_function
__getpid (void)
{
@@ -567,20 +583,50 @@ __getpid (void)
return pid;
}
+/* We need this alias to satisfy references from libc_pic.a objects
+ that were affected by the libc_hidden_proto declaration for __getpid. */
+strong_alias (__getpid, __GI___getpid)
+
/* This is called only in some strange cases trying to guess a value
for $ORIGIN for the executable. The dynamic linker copes with
getcwd failing (dl-object.c), and it's too much hassle to include
the functionality here. (We could, it just requires duplicating or
reusing getcwd.c's code but using our special lookup function as in
`open', above.) */
-char *
-weak_function
+check_no_hidden(__getcwd);
+char *weak_function
__getcwd (char *buf, size_t size)
{
errno = ENOSYS;
return NULL;
}
+/* This is used by dl-tunables.c to strdup strings. We can just make this a
+ mere allocation. */
+check_no_hidden(__sbrk);
+void *weak_function
+__sbrk (intptr_t increment)
+{
+ vm_address_t addr;
+ __vm_allocate (__mach_task_self (), &addr, increment, 1);
+ return (void *) addr;
+}
+
+check_no_hidden(__strtoul_internal);
+unsigned long int weak_function
+__strtoul_internal (const char *nptr, char **endptr, int base, int group)
+{
+ assert (base == 0 || base == 10);
+ assert (group == 0);
+ return _dl_strtoul (nptr, endptr);
+}
+
+/* We need this alias to satisfy references from libc_pic.a objects
+ that were affected by the libc_hidden_proto declaration for __strtoul_internal. */
+strong_alias (__strtoul_internal, __GI___strtoul_internal)
+strong_alias (__strtoul_internal, __GI_____strtoul_internal)
+
+check_no_hidden(_exit);
void weak_function attribute_hidden
_exit (int status)
{
@@ -588,6 +634,9 @@ _exit (int status)
W_EXITCODE (status, 0), 0);
while (__task_terminate (__mach_task_self ()))
__mach_task_self_ = (__mach_task_self) ();
+
+ LOSE;
+ abort ();
}
/* We need this alias to satisfy references from libc_pic.a objects
that were affected by the libc_hidden_proto declaration for _exit. */
@@ -601,6 +650,7 @@ strong_alias (_exit, __GI__exit)
# define ABORT_INSTRUCTION
#endif
+check_no_hidden(abort);
void weak_function
abort (void)
{
@@ -619,6 +669,10 @@ abort (void)
/* We need this alias to satisfy references from libc_pic.a objects
that were affected by the libc_hidden_proto declaration for abort. */
strong_alias (abort, __GI_abort)
+strong_alias (abort, __GI___chk_fail)
+strong_alias (abort, __GI___fortify_fail)
+strong_alias (abort, __GI___assert_fail)
+strong_alias (abort, __GI___assert_perror_fail)
/* This function is called by interruptible RPC stubs. For initial
dynamic linking, just use the normal mach_msg. Since this defn is
@@ -640,7 +694,6 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
void
-internal_function
_dl_show_auxv (void)
{
/* There is nothing to print. Hurd has no auxiliary vector. */
diff --git a/sysdeps/mach/hurd/dl-sysdep.h b/sysdeps/mach/hurd/dl-sysdep.h
index fc4005a75f..9a1f353a8d 100644
--- a/sysdeps/mach/hurd/dl-sysdep.h
+++ b/sysdeps/mach/hurd/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. Hurd version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/dl-unistd.h b/sysdeps/mach/hurd/dl-unistd.h
index b3cfb611a2..da7f0ed18d 100644
--- a/sysdeps/mach/hurd/dl-unistd.h
+++ b/sysdeps/mach/hurd/dl-unistd.h
@@ -1,6 +1,6 @@
/* Functions with hidden attribute internal to ld.so, which are declared
in include/unistd.h. Hurd version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,12 +17,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* __close, __getcwd, __getpid, __libc_read and __libc_write can't be
- hidden in ld.so on Hurd since they will be preempted by the ones in
- libc.so after bootstrap. */
-extern __typeof (__access) __access attribute_hidden;
-extern __typeof (__brk) __brk attribute_hidden;
-extern __typeof (__lseek) __lseek attribute_hidden;
+/* Most stubs mustn't be hidden in ld.so on Hurd since they need to be preempted
+ by functions from libc.so after bootstrap. */
extern __typeof (__profil) __profil attribute_hidden;
-extern __typeof (__read) __read attribute_hidden;
-extern __typeof (__sbrk) __sbrk attribute_hidden;
diff --git a/sysdeps/mach/hurd/dup2.c b/sysdeps/mach/hurd/dup2.c
index fcdc52de84..3615461cb5 100644
--- a/sysdeps/mach/hurd/dup2.c
+++ b/sysdeps/mach/hurd/dup2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/mach/hurd/dup3.c b/sysdeps/mach/hurd/dup3.c
index 4cf840b0f7..09ea24a00b 100644
--- a/sysdeps/mach/hurd/dup3.c
+++ b/sysdeps/mach/hurd/dup3.c
@@ -1,5 +1,5 @@
/* Duplicate a file descriptor to a given number, with flags. Hurd version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/mach/hurd/eloop-threshold.h b/sysdeps/mach/hurd/eloop-threshold.h
index 15f6f7e686..2eaf4e2c5d 100644
--- a/sysdeps/mach/hurd/eloop-threshold.h
+++ b/sysdeps/mach/hurd/eloop-threshold.h
@@ -1,5 +1,5 @@
/* Threshold at which to diagnose ELOOP. Hurd version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/enbl-secure.c b/sysdeps/mach/hurd/enbl-secure.c
index ddcdc7755f..772bdb6bf8 100644
--- a/sysdeps/mach/hurd/enbl-secure.c
+++ b/sysdeps/mach/hurd/enbl-secure.c
@@ -1,5 +1,5 @@
/* Define and initialize the `__libc_enable_secure' flag. Hurd version.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,3 +21,10 @@
In the shared library, the `__libc_enable_secure' variable is defined
by the dynamic linker in dl-sysdep.c and set there.
In the static library, it is defined in init-first.c and set there. */
+
+#include <libc-internal.h>
+
+void
+__libc_init_secure (void)
+{
+}
diff --git a/sysdeps/mach/hurd/errlist.c b/sysdeps/mach/hurd/errlist.c
index eaa53a0a57..77cbabf23c 100644
--- a/sysdeps/mach/hurd/errlist.c
+++ b/sysdeps/mach/hurd/errlist.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/errno-loc.c b/sysdeps/mach/hurd/errno-loc.c
index 4dca6ddca7..05e7673743 100644
--- a/sysdeps/mach/hurd/errno-loc.c
+++ b/sysdeps/mach/hurd/errno-loc.c
@@ -1,5 +1,5 @@
/* __errno_location -- helper function for locating per-thread errno value
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software 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,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <hurd/threadvar.h>
+#if IS_IN (rtld)
+/* rtld can not access TLS too early, thus rtld_errno.
-int *
+ Instead of making __open/__close pass errno from TLS to rtld_errno, simply
+ use a weak __errno_location using rtld_errno, which will be overriden by the
+ libc definition. */
+static int rtld_errno;
+int * weak_function
__errno_location (void)
{
- return (int *) __hurd_threadvar_location (_HURD_THREADVAR_ERRNO);
+ return &rtld_errno;
}
-strong_alias (__errno_location, __hurd_errno_location)
-libc_hidden_def (__errno_location)
+libc_hidden_weak (__errno_location)
+#else
+#include "../../../csu/errno-loc.c"
+#endif
diff --git a/sysdeps/mach/hurd/errno.c b/sysdeps/mach/hurd/errno.c
deleted file mode 100644
index a29091b5e2..0000000000
--- a/sysdeps/mach/hurd/errno.c
+++ /dev/null
@@ -1 +0,0 @@
-/* No definition of `errno' variable on the Hurd. */
diff --git a/sysdeps/mach/hurd/errnos.awk b/sysdeps/mach/hurd/errnos.awk
index 1d15131e81..dc19350eb0 100644
--- a/sysdeps/mach/hurd/errnos.awk
+++ b/sysdeps/mach/hurd/errnos.awk
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2016 Free Software Foundation, Inc.
+# Copyright (C) 1991-2018 Free Software 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,84 +16,77 @@
# <http://www.gnu.org/licenses/>.
# errno.texinfo contains lines like:
-# @comment errno.h
-# @comment POSIX.1: Function not implemented
-# @deftypevr Macro int ENOSYS
-# @comment errno 123
+# @errno{ENOSYS, 123, Function not implemented}
BEGIN {
- print "/* This file generated by errnos.awk. */";
- print "";
- print "/* The Hurd uses Mach error system 0x10, currently only subsystem 0. */";
- print "#ifndef _HURD_ERRNO";
- print "#define _HURD_ERRNO(n)\t((0x10 << 26) | ((n) & 0x3fff))";
- print "#endif";
+ print "/* This file generated by errnos.awk from";
+ for (i = 1; i < ARGC; i++)
+ {
+ arg = ARGV[i];
+ sub(/.*(manual|include)\//, "", arg)
+ print " " arg;
+ }
+ print " Do not edit this file; edit errnos.awk and regenerate it. */";
print "";
- print "#ifdef _ERRNO_H\n";
- print "enum __error_t_codes\n{";
- print "\t/* The value zero always means success and it is perfectly fine for";
- print "\t code to use 0 explicitly (or implicitly, e.g. via Boolean coercion).";
- print "\t Having an enum entry for zero both makes the debugger print the name";
- print "\t for error_t-typed zero values, and prevents the compiler from";
- print "\t issuing warnings about 'case 0:' in a switch on an error_t-typed";
- print "\t value. */";
- print "\tESUCCESS = 0,"
+ print "#ifndef _BITS_ERRNO_H";
+ print "#define _BITS_ERRNO_H 1";
print "";
- errnoh = 0;
+ print "#if !defined _ERRNO_H";
+ print "# error \"Never include <bits/errno.h> directly; use <errno.h> instead.\"";
+ print "#endif";
+
maxerrno = 0;
+ maxerrlen = 0;
in_mach_errors = "";
- in_math = 0;
- edom = erange = "";
- print "#undef EDOM\n#undef ERANGE";
- lno = 0;
+ seq = 0;
}
-$1 == "@comment" && $2 == "errno.h" { errnoh=1; next }
-$1 == "@comment" && errnoh == 1 \
+/^@errno\{/ \
{
- ++errnoh;
- etext = "";
- for (i = 3; i <= NF; ++i)
- etext = etext " " $i;
- next;
- }
-
-errnoh == 2 && $1 == "@deftypevr" && $2 == "Macro" && $3 == "int" \
- { ++errnoh; e = $4; next; }
-
-errnoh == 3 && $1 == "@comment" && $2 == "errno" {
+ e = substr($1, 8, length($1)-8)
+ if (length(e) > maxerrlen)
+ maxerrlen = length(e);
if (e == "EWOULDBLOCK")
{
- lines[lno++]="#define EWOULDBLOCK EAGAIN /* Operation would block */";
+ econsts[seq] = e;
+ errnos[seq] = "EAGAIN";
+ seq++;
next;
}
- errno = $3 + 0;
+
+ errno = substr($2, 1, length($2)-1) + 0;
if (errno == 0)
next;
- if (errno > maxerrno) maxerrno = errno;
- x = sprintf ("%-40s/*%s */", sprintf ("%-24s%s", "#define\t" e,
- "_HURD_ERRNO (" errno ")"),
- etext);
- if (e == "EDOM")
- edom = x;
- else if (e == "ERANGE")
- erange = x;
- comma[lno] = 1;
- lines[lno++] = sprintf("\t%-16s= _HURD_ERRNO (%d)", e, errno);
- lines[lno++] = x;
+ if (errno > 0x3ffff)
+ {
+ printf("%s:%d: errno value %d too large for the Hurd\n",
+ FILENAME, NR, errno) >> "/dev/stderr";
+ exit 1;
+ }
+ if (errno > maxerrno)
+ maxerrno = errno;
+
+ etext = "";
+ for (i = 3; i <= NF; ++i)
+ etext = etext " " $i;
+ etext = substr(etext, 2, length(etext)-2);
+
+ econsts[seq] = e;
+ errnos[seq] = sprintf("0x%08x", 0x40000000 + errno);
+ etexts[seq] = etext;
+ seq++;
next;
}
-{ errnoh=0 }
NF == 3 && $1 == "#define" && $2 == "MACH_SEND_IN_PROGRESS" \
{
in_mach_errors = FILENAME;
- lines[lno++] = "\n\t/* Errors from <mach/message.h>. */";
+ annot[seq++] = "\n/* Errors from <mach/message.h>. */";
}
NF == 3 && $1 == "#define" && $2 == "KERN_SUCCESS" \
{
in_mach_errors = FILENAME;
- lines[lno++] = "\n\t/* Errors from <mach/kern_return.h>. */";
+ annot[seq++] = "\n/* Errors from <mach/kern_return.h>. */";
next;
}
@@ -102,16 +95,24 @@ in_mach_errors != "" && $2 == "MACH_IPC_COMPAT" \
in_mach_errors = "";
}
+# FIXME: mach/message.h and mach/kern_return.h do include error
+# descriptions which we could slurp, but some of them are very long,
+# we would need to word-wrap them.
in_mach_errors == FILENAME && NF == 3 && $1 == "#define" \
{
- comma[lno] = 1;
- lines[lno++] = sprintf("\t%-32s= %s", "E" $2, $3);
+ e = "E" $2;
+ if (length(e) > maxerrlen)
+ maxerrlen = length(e);
+ econsts[seq] = e;
+ errnos[seq] = $3;
+ etexts[seq] = "";
+ seq++;
}
$1 == "#define" && $2 == "_MACH_MIG_ERRORS_H_" \
{
in_mig_errors = 1;
- lines[lno++] = "\n\t/* Errors from <mach/mig_errors.h>. */";
+ annot[seq++] = "\n/* Errors from <mach/mig_errors.h>. */";
next;
}
in_mig_errors && $1 == "#endif" && $3 == "_MACH_MIG_ERRORS_H_" \
@@ -122,17 +123,23 @@ in_mig_errors && $1 == "#endif" && $3 == "_MACH_MIG_ERRORS_H_" \
(in_mig_errors && $1 == "#define" && $3 <= -300) || \
(in_device_errors && $1 == "#define" && /D_/ && NF > 3) \
{
- comment = "";
- for (i = 4; i <= NF; ++i)
- comment = comment " " $i;
- comma[lno] = 1;
- lines[lno++] = sprintf("%-32s", sprintf ("\t%-24s= %s", "E" $2, $3)) comment;
+ etext = "";
+ for (i = 5; i < NF; ++i)
+ etext = etext " " $i;
+
+ e = "E" $2;
+ if (length(e) > maxerrlen)
+ maxerrlen = length(e);
+ econsts[seq] = e;
+ errnos[seq] = $3;
+ etexts[seq] = substr(etext, 2, length(etext)-1);
+ seq++;
}
$1 == "#define" && $2 == "D_SUCCESS" \
{
in_device_errors = 1;
- lines[lno++] = "\n\t/* Errors from <device/device_types.h>. */";
+ annot[seq++] = "\n/* Errors from <device/device_types.h>. */";
next;
}
in_device_errors && $1 == "#endif" \
@@ -140,36 +147,65 @@ in_device_errors && $1 == "#endif" \
in_device_errors = 0;
}
+function print_errno_enum(maxseq)
+{
+ print "";
+ print "#ifndef __ASSEMBLER__";
+ print "";
+ print "enum __error_t_codes";
+ print "{";
+ print " /* The value zero always means success and it is perfectly fine";
+ print " for code to use 0 explicitly (or implicitly, e.g. via Boolean";
+ print " coercion.) Having an enum entry for zero both makes the";
+ print " debugger print the name for error_t-typed zero values, and";
+ print " prevents the compiler from issuing warnings about 'case 0:'";
+ print " in a switch on an error_t-typed value. */";
+ printf(" %-*s = 0,\n", maxerrlen, "ESUCCESS");
+
+ print "";
+ print " /* The Hurd uses Mach error system 0x10, subsystem 0. */";
+ for (i = 0; i < maxseq; i++)
+ {
+ if (i in annot)
+ print annot[i];
+ else if (i in etexts && etexts[i] != "")
+ printf(" %-*s = %s,\t/* %s */\n",
+ maxerrlen, econsts[i], errnos[i], etexts[i]);
+ else if (errnos[i] != "EAGAIN")
+ printf(" %-*s = %s,\n", maxerrlen, econsts[i], errnos[i]);
+ }
+
+ print "";
+ print " /* Because the C standard requires that errno have type 'int',"
+ print " this enumeration must be a signed type. */";
+ print " __FORCE_ERROR_T_CODES_SIGNED = -1";
+ print "};";
+ print "";
+ print "#endif /* not __ASSEMBLER__ */";
+}
+
+function print_errno_defines(maxseq)
+{
+ print "";
+ print "/* The C standard requires that all of the E-constants be"
+ print " defined as macros. */"
+ print "";
+ for (i = 0; i < maxseq; i++)
+ {
+ if (i in annot)
+ print annot[i];
+ else
+ printf("#define %-*s %s\n", maxerrlen, econsts[i], errnos[i]);
+ }
+ print "";
+ printf("#define _HURD_ERRNOS %d\n", maxerrno+1);
+}
END \
{
- for (i = 0; i < lno - 1; ++i)
- printf "%s%s\n", lines[i], (comma[i] ? "," : "");
- print lines[i];
- print "";
- print "};";
- print "";
- printf "#define\t_HURD_ERRNOS\t%d\n", maxerrno+1;
- print "";
- print "\
-/* User-visible type of error codes. It is ok to use `int' or\n\
- `kern_return_t' for these, but with `error_t' the debugger prints\n\
- symbolic values. */";
- print "#ifdef __USE_GNU";
- print "typedef enum __error_t_codes error_t;"
- print "#define __error_t_defined\t1"
- print "#endif";
- print "";
- print "\
-/* Return the current thread's location for `errno'.\n\
- The syntax of this function allows redeclarations like `int errno'. */\n\
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));\n\
-\n\
-#define errno (*__errno_location ())\n\
-";
- print "#endif /* <errno.h> included. */";
+ print_errno_enum(seq);
+ print_errno_defines(seq);
+
print "";
- print "#if !defined (_ERRNO_H) && defined (__need_Emath)";
- print edom; print erange;
- print "#endif /* <errno.h> not included and need math error codes. */";
+ print "#endif /* bits/errno.h. */";
}
diff --git a/sysdeps/mach/hurd/euidaccess.c b/sysdeps/mach/hurd/euidaccess.c
index ee512ff5e3..2c7ce1f2b6 100644
--- a/sysdeps/mach/hurd/euidaccess.c
+++ b/sysdeps/mach/hurd/euidaccess.c
@@ -1,5 +1,5 @@
/* Test for access to FILE using effective UID and GID. Hurd version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software 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,42 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stddef.h>
#include <unistd.h>
#include <fcntl.h>
-#include <hurd.h>
int
__euidaccess (const char *file, int type)
{
- error_t err;
- file_t port;
- int allowed, flags;
-
- port = __file_name_lookup (file, 0, 0);
- if (port == MACH_PORT_NULL)
- return -1;
-
- /* Find out what types of access we are allowed to this file. */
- err = __file_check_access (port, &allowed);
- __mach_port_deallocate (__mach_task_self (), port);
- if (err)
- return __hurd_fail (err);
-
- flags = 0;
- if (type & R_OK)
- flags |= O_READ;
- if (type & W_OK)
- flags |= O_WRITE;
- if (type & X_OK)
- flags |= O_EXEC;
-
- if (flags & ~allowed)
- /* We are not allowed all the requested types of access. */
- return __hurd_fail (EACCES);
-
- return 0;
+ return __faccessat (AT_FDCWD, file, type, AT_EACCESS);
}
weak_alias (__euidaccess, euidaccess)
weak_alias (__euidaccess, eaccess)
diff --git a/sysdeps/mach/hurd/execve.c b/sysdeps/mach/hurd/execve.c
index 6904fc6452..1c5b681d89 100644
--- a/sysdeps/mach/hurd/execve.c
+++ b/sysdeps/mach/hurd/execve.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
#include <unistd.h>
#include <hurd.h>
#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
/* Replace the current process, executing FILE_NAME with arguments ARGV and
environment ENVP. ARGV and ENVP are terminated by NULL pointers. */
@@ -25,16 +27,46 @@ int
__execve (const char *file_name, char *const argv[], char *const envp[])
{
error_t err;
- file_t file = __file_name_lookup (file_name, O_EXEC, 0);
+ char *concat_name = NULL;
+ const char *abs_path;
+ file_t file = __file_name_lookup (file_name, O_EXEC, 0);
if (file == MACH_PORT_NULL)
return -1;
+ if (file_name[0] == '/')
+ {
+ /* Already an absolute path */
+ abs_path = file_name;
+ }
+ else
+ {
+ /* Relative path */
+ char *cwd = __getcwd (NULL, 0);
+ if (cwd == NULL)
+ {
+ __mach_port_deallocate (__mach_task_self (), file);
+ return -1;
+ }
+
+ int res = __asprintf (&concat_name, "%s/%s", cwd, file_name);
+ free (cwd);
+ if (res == -1)
+ {
+ __mach_port_deallocate (__mach_task_self (), file);
+ return -1;
+ }
+
+ abs_path = concat_name;
+ }
+
/* Hopefully this will not return. */
- err = _hurd_exec (__mach_task_self (), file, argv, envp);
+ err = _hurd_exec_paths (__mach_task_self (), file,
+ file_name, abs_path, argv, envp);
/* Oh well. Might as well be tidy. */
__mach_port_deallocate (__mach_task_self (), file);
+ free (concat_name);
return __hurd_fail (err);
}
diff --git a/sysdeps/mach/hurd/faccessat.c b/sysdeps/mach/hurd/faccessat.c
index 0a57ab627c..d9bceaada7 100644
--- a/sysdeps/mach/hurd/faccessat.c
+++ b/sysdeps/mach/hurd/faccessat.c
@@ -1,5 +1,5 @@
/* Test for access to file, relative to open directory. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,31 +23,167 @@
#include <sys/types.h>
#include <hurd.h>
#include <hurd/fd.h>
+#include <hurd/port.h>
+#include <hurd/id.h>
+#include <hurd/lookup.h>
-int
-faccessat (int fd, const char *file, int type, int flag)
+static int
+hurd_fail_seterrno (error_t err)
+{
+ return __hurd_fail (err);
+}
+
+static int
+hurd_fail_noerrno (error_t err)
+{
+ return -1;
+}
+
+static int
+__faccessat_common (int fd, const char *file, int type, int at_flags,
+ int (*errfunc) (error_t))
{
error_t err;
- file_t port;
- int allowed, flags;
+ file_t rcrdir, rcwdir, io;
+ int flags, allowed;
- if ((flag & AT_EACCESS) == 0)
+ if ((at_flags & AT_EACCESS) == AT_EACCESS)
{
- if (fd == AT_FDCWD || file[0] == '/')
- return __access (file, type);
- __set_errno (ENOTSUP); /* XXX later */
- return -1;
+ /* Use effective permissions. */
+ io = __file_name_lookup_at (fd, at_flags &~ AT_EACCESS, file, 0, 0);
+ if (io == MACH_PORT_NULL)
+ return -1;
}
+ else
+ {
+ /* We have to use real permissions instead of the
+ usual effective permissions. */
+
+ int hurd_flags = 0;
+ __hurd_at_flags (&at_flags, &hurd_flags);
+
+ error_t reauthenticate_cwdir_at (file_t *result)
+ {
+ /* Get a port to the FD directory, authenticated with the real IDs. */
+ error_t err;
+ mach_port_t ref;
+ ref = __mach_reply_port ();
+ err = HURD_DPORT_USE
+ (fd,
+ ({
+ err = __io_reauthenticate (port, ref, MACH_MSG_TYPE_MAKE_SEND);
+ if (!err)
+ err = __auth_user_authenticate (_hurd_id.rid_auth,
+ ref, MACH_MSG_TYPE_MAKE_SEND,
+ result);
+ err;
+ }));
+ __mach_port_destroy (__mach_task_self (), ref);
+ return err;
+ }
+
+ error_t reauthenticate (int which, file_t *result)
+ {
+ /* Get a port to our root directory, authenticated with the real IDs. */
+ error_t err;
+ mach_port_t ref;
+ ref = __mach_reply_port ();
+ err = HURD_PORT_USE
+ (&_hurd_ports[which],
+ ({
+ err = __io_reauthenticate (port, ref, MACH_MSG_TYPE_MAKE_SEND);
+ if (!err)
+ err = __auth_user_authenticate (_hurd_id.rid_auth,
+ ref, MACH_MSG_TYPE_MAKE_SEND,
+ result);
+ err;
+ }));
+ __mach_port_destroy (__mach_task_self (), ref);
+ return err;
+ }
+
+ error_t init_port (int which, error_t (*operate) (mach_port_t))
+ {
+ switch (which)
+ {
+ case INIT_PORT_AUTH:
+ return (*operate) (_hurd_id.rid_auth);
+ case INIT_PORT_CRDIR:
+ return (reauthenticate (INIT_PORT_CRDIR, &rcrdir) ?:
+ (*operate) (rcrdir));
+ case INIT_PORT_CWDIR:
+ if (fd == AT_FDCWD || file[0] == '/')
+ return (reauthenticate (INIT_PORT_CWDIR, &rcwdir) ?:
+ (*operate) (rcwdir));
+ else
+ return (reauthenticate_cwdir_at (&rcwdir) ?:
+ (*operate) (rcwdir));
+ default:
+ return _hurd_ports_use (which, operate);
+ }
+ }
+
+ rcrdir = rcwdir = MACH_PORT_NULL;
+
+ HURD_CRITICAL_BEGIN;
+
+ __mutex_lock (&_hurd_id.lock);
+ /* Get _hurd_id up to date. */
+ if (err = _hurd_check_ids ())
+ goto lose;
- port = __file_name_lookup_at (fd, flag &~ AT_EACCESS, file, 0, 0);
- if (port == MACH_PORT_NULL)
- return -1;
+ if (_hurd_id.rid_auth == MACH_PORT_NULL)
+ {
+ /* Set up _hurd_id.rid_auth. This is a special auth server port
+ which uses the real uid and gid (the first aux uid and gid) as
+ the only effective uid and gid. */
+
+ if (_hurd_id.aux.nuids < 1 || _hurd_id.aux.ngids < 1)
+ {
+ /* We do not have a real UID and GID. Lose, lose, lose! */
+ err = EGRATUITOUS;
+ goto lose;
+ }
+
+ /* Create a new auth port using our real UID and GID (the first
+ auxiliary UID and GID) as the only effective IDs. */
+ if (err = __USEPORT (AUTH,
+ __auth_makeauth (port,
+ NULL, MACH_MSG_TYPE_COPY_SEND, 0,
+ _hurd_id.aux.uids, 1,
+ _hurd_id.aux.uids,
+ _hurd_id.aux.nuids,
+ _hurd_id.aux.gids, 1,
+ _hurd_id.aux.gids,
+ _hurd_id.aux.ngids,
+ &_hurd_id.rid_auth)))
+ goto lose;
+ }
+
+ if (!err)
+ /* Look up the file name using the modified init ports. */
+ err = __hurd_file_name_lookup (&init_port, &__getdport, 0,
+ file, hurd_flags, 0, &io);
+
+ /* We are done with _hurd_id.rid_auth now. */
+ lose:
+ __mutex_unlock (&_hurd_id.lock);
+
+ HURD_CRITICAL_END;
+
+ if (rcrdir != MACH_PORT_NULL)
+ __mach_port_deallocate (__mach_task_self (), rcrdir);
+ if (rcwdir != MACH_PORT_NULL)
+ __mach_port_deallocate (__mach_task_self (), rcwdir);
+ if (err)
+ return errfunc (err);
+ }
/* Find out what types of access we are allowed to this file. */
- err = __file_check_access (port, &allowed);
- __mach_port_deallocate (__mach_task_self (), port);
+ err = __file_check_access (io, &allowed);
+ __mach_port_deallocate (__mach_task_self (), io);
if (err)
- return __hurd_fail (err);
+ return errfunc (err);
flags = 0;
if (type & R_OK)
@@ -59,7 +195,20 @@ faccessat (int fd, const char *file, int type, int flag)
if (flags & ~allowed)
/* We are not allowed all the requested types of access. */
- return __hurd_fail (EACCES);
+ return errfunc (EACCES);
return 0;
}
+
+int
+__faccessat_noerrno (int fd, const char *file, int type, int at_flags)
+{
+ return __faccessat_common (fd, file, type, at_flags, hurd_fail_noerrno);
+}
+
+int
+__faccessat (int fd, const char *file, int type, int at_flags)
+{
+ return __faccessat_common (fd, file, type, at_flags, hurd_fail_seterrno);
+}
+weak_alias (__faccessat, faccessat)
diff --git a/sysdeps/mach/hurd/fchdir.c b/sysdeps/mach/hurd/fchdir.c
index 360ba72be0..94ceda8a03 100644
--- a/sysdeps/mach/hurd/fchdir.c
+++ b/sysdeps/mach/hurd/fchdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fchflags.c b/sysdeps/mach/hurd/fchflags.c
index ac7da61736..443c8d9406 100644
--- a/sysdeps/mach/hurd/fchflags.c
+++ b/sysdeps/mach/hurd/fchflags.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fchmod.c b/sysdeps/mach/hurd/fchmod.c
index b20e4b7b62..5dd5dd99d9 100644
--- a/sysdeps/mach/hurd/fchmod.c
+++ b/sysdeps/mach/hurd/fchmod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fchmodat.c b/sysdeps/mach/hurd/fchmodat.c
index 24b2a8285a..4b4dabad31 100644
--- a/sysdeps/mach/hurd/fchmodat.c
+++ b/sysdeps/mach/hurd/fchmodat.c
@@ -1,5 +1,5 @@
/* Change the protections of file relative to open directory. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fchown.c b/sysdeps/mach/hurd/fchown.c
index 742e1e7d0f..2c4c666c6f 100644
--- a/sysdeps/mach/hurd/fchown.c
+++ b/sysdeps/mach/hurd/fchown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fchownat.c b/sysdeps/mach/hurd/fchownat.c
index 26a6851fb8..906ec05ba3 100644
--- a/sysdeps/mach/hurd/fchownat.c
+++ b/sysdeps/mach/hurd/fchownat.c
@@ -1,5 +1,5 @@
/* Change owner and group of a file relative to open directory. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c
index 2898ebbb14..598317d811 100644
--- a/sysdeps/mach/hurd/fcntl.c
+++ b/sysdeps/mach/hurd/fcntl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -210,3 +210,8 @@ libc_hidden_def (__libc_fcntl)
weak_alias (__libc_fcntl, __fcntl)
libc_hidden_weak (__fcntl)
weak_alias (__libc_fcntl, fcntl)
+
+strong_alias (__libc_fcntl, __libc_fcntl64)
+libc_hidden_def (__libc_fcntl64)
+weak_alias (__libc_fcntl64, __fcntl64)
+libc_hidden_weak (__fcntl64)
diff --git a/sysdeps/mach/hurd/fdatasync.c b/sysdeps/mach/hurd/fdatasync.c
index 5c28ba69f9..eda679f4c6 100644
--- a/sysdeps/mach/hurd/fdatasync.c
+++ b/sysdeps/mach/hurd/fdatasync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fdopendir.c b/sysdeps/mach/hurd/fdopendir.c
index 33af683a5a..ec3a7486fd 100644
--- a/sysdeps/mach/hurd/fdopendir.c
+++ b/sysdeps/mach/hurd/fdopendir.c
@@ -1,5 +1,5 @@
/* Open a directory stream from a file descriptor. Hurd version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fexecve.c b/sysdeps/mach/hurd/fexecve.c
index e7b451543a..c5679f197e 100644
--- a/sysdeps/mach/hurd/fexecve.c
+++ b/sysdeps/mach/hurd/fexecve.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,8 +25,9 @@
int
fexecve (int fd, char *const argv[], char *const envp[])
{
- error_t err = HURD_DPORT_USE (fd, _hurd_exec (__mach_task_self (), port,
- argv, envp));
+ error_t err = HURD_DPORT_USE (fd, _hurd_exec_paths (__mach_task_self (),
+ port, NULL, NULL,
+ argv, envp));
if (! err)
err = EGRATUITOUS;
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/fgetxattr.c b/sysdeps/mach/hurd/fgetxattr.c
index 16ddb3bfca..fc0b1feb12 100644
--- a/sysdeps/mach/hurd/fgetxattr.c
+++ b/sysdeps/mach/hurd/fgetxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/flistxattr.c b/sysdeps/mach/hurd/flistxattr.c
index 2ae3fab456..4564f50948 100644
--- a/sysdeps/mach/hurd/flistxattr.c
+++ b/sysdeps/mach/hurd/flistxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/flock.c b/sysdeps/mach/hurd/flock.c
index f552b855bd..6d6f748df3 100644
--- a/sysdeps/mach/hurd/flock.c
+++ b/sysdeps/mach/hurd/flock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c
index 12def903bd..2d1e64c8d1 100644
--- a/sysdeps/mach/hurd/fork.c
+++ b/sysdeps/mach/hurd/fork.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <unistd.h>
#include <hurd.h>
#include <hurd/signal.h>
+#include <hurd/threadvar.h>
#include <setjmp.h>
#include <thread_state.h>
#include <sysdep.h> /* For stack growth direction. */
@@ -26,6 +27,7 @@
#include <assert.h>
#include "hurdmalloc.h" /* XXX */
#include <tls.h>
+#include <malloc/malloc-internal.h>
#undef __fork
@@ -117,6 +119,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;
@@ -205,38 +214,9 @@ __fork (void)
{
/* This is a receive right. We want to give the child task
its own new receive right under the same name. */
- err = __mach_port_allocate_name (newtask,
- MACH_PORT_RIGHT_RECEIVE,
- portnames[i]);
- if (err == KERN_NAME_EXISTS)
- {
- /* It already has a right under this name (?!). Well,
- there is this bizarre old Mach IPC feature (in #ifdef
- MACH_IPC_COMPAT in the ukernel) which results in new
- tasks getting a new receive right for task special
- port number 2. What else might be going on I'm not
- sure. So let's check. */
-#if !MACH_IPC_COMPAT
-#define TASK_NOTIFY_PORT 2
-#endif
- assert (({ mach_port_t thisport, notify_port;
- mach_msg_type_name_t poly;
- (__task_get_special_port (newtask,
- TASK_NOTIFY_PORT,
- &notify_port) == 0 &&
- __mach_port_extract_right
- (newtask,
- portnames[i],
- MACH_MSG_TYPE_MAKE_SEND,
- &thisport, &poly) == 0 &&
- (thisport == notify_port) &&
- __mach_port_deallocate (__mach_task_self (),
- thisport) == 0 &&
- __mach_port_deallocate (__mach_task_self (),
- notify_port) == 0);
- }));
- }
- else if (err)
+ if (err = __mach_port_allocate_name (newtask,
+ MACH_PORT_RIGHT_RECEIVE,
+ portnames[i]))
LOSE;
if (porttypes[i] & MACH_PORT_TYPE_SEND)
{
@@ -504,19 +484,17 @@ __fork (void)
(natural_t *) &state, &statecount))
LOSE;
#ifdef STACK_GROWTH_UP
-#define THREADVAR_SPACE (__hurd_threadvar_max \
- * sizeof *__hurd_sightread_variables)
if (__hurd_sigthread_stack_base == 0)
{
state.SP &= __hurd_threadvar_stack_mask;
- state.SP += __hurd_threadvar_stack_offset + THREADVAR_SPACE;
+ state.SP += __hurd_threadvar_stack_offset;
}
else
state.SP = __hurd_sigthread_stack_base;
#else
if (__hurd_sigthread_stack_end == 0)
{
- /* The signal thread has a normal stack assigned by cthreads.
+ /* The signal thread has a stack assigned by cthreads.
The threadvar_stack variables conveniently tell us how
to get to the highest address in the stack, just below
the per-thread variables. */
@@ -529,7 +507,7 @@ __fork (void)
MACHINE_THREAD_STATE_SET_PC (&state,
(unsigned long int) _hurd_msgport_receive);
- /* Do special thread setup for TLS if needed. */
+ /* Do special signal thread setup for TLS if needed. */
if (err = _hurd_tls_fork (sigthread, _hurd_msgport_thread, &state))
LOSE;
@@ -609,6 +587,10 @@ __fork (void)
nthreads * sizeof (*threads));
}
+ /* Release malloc locks. */
+ _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
symmetrical: the prepare hook arrests state in some way for the
@@ -660,6 +642,10 @@ __fork (void)
/* Forking clears the trace flag. */
__sigemptyset (&_hurdsig_traced);
+ /* Release malloc locks. */
+ _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/fpathconf.c b/sysdeps/mach/hurd/fpathconf.c
index e1cc122fb6..4332aa70ac 100644
--- a/sysdeps/mach/hurd/fpathconf.c
+++ b/sysdeps/mach/hurd/fpathconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fremovexattr.c b/sysdeps/mach/hurd/fremovexattr.c
index a857c944df..662ae38f89 100644
--- a/sysdeps/mach/hurd/fremovexattr.c
+++ b/sysdeps/mach/hurd/fremovexattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fsetxattr.c b/sysdeps/mach/hurd/fsetxattr.c
index a0b65d2675..cd9653765c 100644
--- a/sysdeps/mach/hurd/fsetxattr.c
+++ b/sysdeps/mach/hurd/fsetxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fstatfs.c b/sysdeps/mach/hurd/fstatfs.c
index a04efe1ede..e8b03d24e7 100644
--- a/sysdeps/mach/hurd/fstatfs.c
+++ b/sysdeps/mach/hurd/fstatfs.c
@@ -1,5 +1,5 @@
/* fstatfs -- Return information about the filesystem on which FD resides.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fstatfs64.c b/sysdeps/mach/hurd/fstatfs64.c
index 1b9f1b3092..364b96e14d 100644
--- a/sysdeps/mach/hurd/fstatfs64.c
+++ b/sysdeps/mach/hurd/fstatfs64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fstatvfs.c b/sysdeps/mach/hurd/fstatvfs.c
index b3ef4b7d0c..4fbf6e5bed 100644
--- a/sysdeps/mach/hurd/fstatvfs.c
+++ b/sysdeps/mach/hurd/fstatvfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fstatvfs64.c b/sysdeps/mach/hurd/fstatvfs64.c
index d08b825e7b..f5e03316f4 100644
--- a/sysdeps/mach/hurd/fstatvfs64.c
+++ b/sysdeps/mach/hurd/fstatvfs64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fsync.c b/sysdeps/mach/hurd/fsync.c
index 13dc2baa46..d8ae6e0358 100644
--- a/sysdeps/mach/hurd/fsync.c
+++ b/sysdeps/mach/hurd/fsync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/ftruncate.c b/sysdeps/mach/hurd/ftruncate.c
index e4eebcc797..94e17803ac 100644
--- a/sysdeps/mach/hurd/ftruncate.c
+++ b/sysdeps/mach/hurd/ftruncate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/ftruncate64.c b/sysdeps/mach/hurd/ftruncate64.c
new file mode 100644
index 0000000000..7a33dd1823
--- /dev/null
+++ b/sysdeps/mach/hurd/ftruncate64.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991-2018 Free Software 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 <unistd.h>
+#include <hurd.h>
+#include <hurd/fd.h>
+
+/* Truncate the file referenced by FD to LENGTH bytes. */
+int
+__ftruncate64 (int fd, off64_t length)
+{
+ error_t err;
+ if (err = HURD_DPORT_USE (fd, __file_set_size (port, length)))
+ return __hurd_dfail (fd, err);
+ return 0;
+}
+
+weak_alias (__ftruncate64, ftruncate64)
diff --git a/sysdeps/mach/hurd/futimens.c b/sysdeps/mach/hurd/futimens.c
new file mode 100644
index 0000000000..4a3943e673
--- /dev/null
+++ b/sysdeps/mach/hurd/futimens.c
@@ -0,0 +1,50 @@
+/* futimens -- change access and modification times of open file. Hurd version.
+ Copyright (C) 2002-2018 Free Software 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/time.h>
+#include <errno.h>
+#include <stddef.h>
+#include <hurd.h>
+#include <hurd/fd.h>
+
+#include "utime-helper.c"
+
+/* Change the access time of FD to TSP[0] and
+ the modification time of FD to TSP[1]. */
+int
+__futimens (int fd, const struct timespec tsp[2])
+{
+ struct timespec atime, mtime;
+ error_t err;
+
+ utime_ts_from_tspec (tsp, &atime, &mtime);
+
+ err = HURD_DPORT_USE (fd, __file_utimens (port, atime, mtime));
+
+ if (err == MIG_BAD_ID || err == EOPNOTSUPP)
+ {
+ time_value_t atim, mtim;
+
+ utime_tvalue_from_tspec (tsp, &atim, &mtim);
+
+ err = HURD_DPORT_USE (fd, __file_utimes (port, atim, mtim));
+ }
+
+ return err ? __hurd_dfail (fd, err) : 0;
+}
+weak_alias (__futimens, futimens)
diff --git a/sysdeps/mach/hurd/futimes.c b/sysdeps/mach/hurd/futimes.c
index a4df741a2d..1b521e3e51 100644
--- a/sysdeps/mach/hurd/futimes.c
+++ b/sysdeps/mach/hurd/futimes.c
@@ -1,5 +1,5 @@
/* futimes -- change access and modification times of open file. Hurd version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,29 +22,29 @@
#include <hurd.h>
#include <hurd/fd.h>
+#include "utime-helper.c"
+
/* Change the access time of FD to TVP[0] and
the modification time of FD to TVP[1]. */
int
__futimes (int fd, const struct timeval tvp[2])
{
- union tv
- {
- struct timeval tv;
- time_value_t tvt;
- };
- const union tv *u = (const union tv *) tvp;
- union tv nulltv[2];
+ struct timespec atime, mtime;
error_t err;
- if (tvp == NULL)
+ utime_ts_from_tval (tvp, &atime, &mtime);
+
+ err = HURD_DPORT_USE (fd, __file_utimens (port, atime, mtime));
+
+ if (err == EMIG_BAD_ID || err == EOPNOTSUPP)
{
- /* Setting the number of microseconds to `-1' tells the
- underlying filesystems to use the current time. */
- nulltv[0].tvt.microseconds = nulltv[1].tvt.microseconds = -1;
- u = nulltv;
+ time_value_t atim, mtim;
+
+ utime_tvalue_from_tval (tvp, &atim, &mtim);
+
+ err = HURD_DPORT_USE (fd, __file_utimes (port, atim, mtim));
}
- err = HURD_DPORT_USE (fd, __file_utimes (port, u[0].tvt, u[1].tvt));
return err ? __hurd_dfail (fd, err) : 0;
}
weak_alias (__futimes, futimes)
diff --git a/sysdeps/mach/hurd/futimesat.c b/sysdeps/mach/hurd/futimesat.c
new file mode 100644
index 0000000000..b4939bf644
--- /dev/null
+++ b/sysdeps/mach/hurd/futimesat.c
@@ -0,0 +1,45 @@
+/* futimesat -- change access and modification times of file. Hurd version.
+ Copyright (C) 1991-2018 Free Software 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/time.h>
+#include <errno.h>
+#include <stddef.h>
+#include <hurd.h>
+#include <hurd/fd.h>
+
+#include "utime-helper.c"
+
+/* Change the access time of FILE relative to FD to TVP[0] and
+ the modification time of FILE to TVP[1]. */
+int
+futimesat (int fd, const char *file, const struct timeval tvp[2])
+{
+ error_t err;
+ file_t port;
+
+ port = __file_name_lookup_at (fd, 0, file, 0, 0);
+ if (port == MACH_PORT_NULL)
+ return -1;
+
+ err = hurd_futimes (port, tvp);
+
+ __mach_port_deallocate (__mach_task_self (), port);
+ if (err)
+ return __hurd_fail (err);
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/fxstat.c b/sysdeps/mach/hurd/fxstat.c
index 1ab83651b0..f6570af630 100644
--- a/sysdeps/mach/hurd/fxstat.c
+++ b/sysdeps/mach/hurd/fxstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fxstat64.c b/sysdeps/mach/hurd/fxstat64.c
index 0c2d0a75a9..fcdbb3671e 100644
--- a/sysdeps/mach/hurd/fxstat64.c
+++ b/sysdeps/mach/hurd/fxstat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fxstatat.c b/sysdeps/mach/hurd/fxstatat.c
index 35fec83ab4..06100d2226 100644
--- a/sysdeps/mach/hurd/fxstatat.c
+++ b/sysdeps/mach/hurd/fxstatat.c
@@ -1,5 +1,5 @@
/* Get information about file named relative to open directory. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/fxstatat64.c b/sysdeps/mach/hurd/fxstatat64.c
index 45f18fd146..909f6f2481 100644
--- a/sysdeps/mach/hurd/fxstatat64.c
+++ b/sysdeps/mach/hurd/fxstatat64.c
@@ -1,5 +1,5 @@
/* Get information about file named relative to open directory. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/gai_misc.h b/sysdeps/mach/hurd/gai_misc.h
new file mode 100644
index 0000000000..7804139baa
--- /dev/null
+++ b/sysdeps/mach/hurd/gai_misc.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 2006-2018 Free Software 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 <assert.h>
+#include <signal.h>
+#include <pthread.h>
+
+#define gai_start_notify_thread __gai_start_notify_thread
+#define gai_create_helper_thread __gai_create_helper_thread
+
+extern inline void
+__gai_start_notify_thread (void)
+{
+ sigset_t ss;
+ sigemptyset (&ss);
+ int sigerr __attribute__ ((unused));
+ sigerr = pthread_sigmask (SIG_SETMASK, &ss, NULL);
+ assert_perror (sigerr);
+}
+
+extern inline int
+__gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
+ void *arg)
+{
+ pthread_attr_t attr;
+
+ /* Make sure the thread is created detached. */
+ pthread_attr_init (&attr);
+ pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
+
+ /* The helper thread needs only very little resources. */
+ (void) pthread_attr_setstacksize (&attr, 0x10000);
+
+ /* Block all signals in the helper thread. To do this thoroughly we
+ temporarily have to block all signals here. */
+ sigset_t ss;
+ sigset_t oss;
+ sigfillset (&ss);
+ int sigerr __attribute__ ((unused));
+ sigerr = pthread_sigmask (SIG_SETMASK, &ss, &oss);
+ assert_perror (sigerr);
+
+ int ret = pthread_create (threadp, &attr, tf, arg);
+
+ /* Restore the signal mask. */
+ sigerr = pthread_sigmask (SIG_SETMASK, &oss, NULL);
+ assert_perror (sigerr);
+
+ (void) pthread_attr_destroy (&attr);
+ return ret;
+}
+
+#include_next <gai_misc.h>
diff --git a/sysdeps/mach/hurd/getclktck.c b/sysdeps/mach/hurd/getclktck.c
index 9ed99422cc..35458361f4 100644
--- a/sysdeps/mach/hurd/getclktck.c
+++ b/sysdeps/mach/hurd/getclktck.c
@@ -1,5 +1,5 @@
/* Return run-time value of CLK_TCK for Hurd.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getcwd.c b/sysdeps/mach/hurd/getcwd.c
index a757dab965..c30b7c507b 100644
--- a/sysdeps/mach/hurd/getcwd.c
+++ b/sysdeps/mach/hurd/getcwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,7 +37,7 @@
a slash to indicate that it is relative to some unknown root directory. */
char *
-_hurd_canonicalize_directory_name_internal (file_t thisdir,
+__hurd_canonicalize_directory_name_internal (file_t thisdir,
char *buf,
size_t size)
{
@@ -282,6 +282,7 @@ _hurd_canonicalize_directory_name_internal (file_t thisdir,
cleanup ();
return NULL;
}
+strong_alias (__hurd_canonicalize_directory_name_internal, _hurd_canonicalize_directory_name_internal)
char *
__canonicalize_directory_name_internal (const char *thisdir, char *buf,
@@ -291,7 +292,7 @@ __canonicalize_directory_name_internal (const char *thisdir, char *buf,
file_t port = __file_name_lookup (thisdir, 0, 0);
if (port == MACH_PORT_NULL)
return NULL;
- result = _hurd_canonicalize_directory_name_internal (port, buf, size);
+ result = __hurd_canonicalize_directory_name_internal (port, buf, size);
__mach_port_deallocate (__mach_task_self (), port);
return result;
}
@@ -306,8 +307,8 @@ __getcwd (char *buf, size_t size)
{
char *cwd =
__USEPORT (CWDIR,
- _hurd_canonicalize_directory_name_internal (port,
- buf, size));
+ __hurd_canonicalize_directory_name_internal (port,
+ buf, size));
if (cwd && cwd[0] != '/')
{
/* `cwd' is an unknown root directory. */
diff --git a/sysdeps/mach/hurd/getdomain.c b/sysdeps/mach/hurd/getdomain.c
index dfe8d49e2b..dc32228849 100644
--- a/sysdeps/mach/hurd/getdomain.c
+++ b/sysdeps/mach/hurd/getdomain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getdtsz.c b/sysdeps/mach/hurd/getdtsz.c
index 0c55745211..3fb8231d99 100644
--- a/sysdeps/mach/hurd/getdtsz.c
+++ b/sysdeps/mach/hurd/getdtsz.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getegid.c b/sysdeps/mach/hurd/getegid.c
index cd280973fa..d232482740 100644
--- a/sysdeps/mach/hurd/getegid.c
+++ b/sysdeps/mach/hurd/getegid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/geteuid.c b/sysdeps/mach/hurd/geteuid.c
index 9051b57105..a8c87ccb69 100644
--- a/sysdeps/mach/hurd/geteuid.c
+++ b/sysdeps/mach/hurd/geteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getgid.c b/sysdeps/mach/hurd/getgid.c
index e9617b71e6..1e35f9c906 100644
--- a/sysdeps/mach/hurd/getgid.c
+++ b/sysdeps/mach/hurd/getgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getgroups.c b/sysdeps/mach/hurd/getgroups.c
index 45deda4155..ad6babe56d 100644
--- a/sysdeps/mach/hurd/getgroups.c
+++ b/sysdeps/mach/hurd/getgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/gethostid.c b/sysdeps/mach/hurd/gethostid.c
index aadcdc5970..0cfbb8ae7f 100644
--- a/sysdeps/mach/hurd/gethostid.c
+++ b/sysdeps/mach/hurd/gethostid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/gethostname.c b/sysdeps/mach/hurd/gethostname.c
index 5b30c20df8..41fe0ecc1f 100644
--- a/sysdeps/mach/hurd/gethostname.c
+++ b/sysdeps/mach/hurd/gethostname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getitimer.c b/sysdeps/mach/hurd/getitimer.c
index a2d910b064..65ffe9386e 100644
--- a/sysdeps/mach/hurd/getitimer.c
+++ b/sysdeps/mach/hurd/getitimer.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getlogin.c b/sysdeps/mach/hurd/getlogin.c
index d9becf6d87..0ee5a28bc9 100644
--- a/sysdeps/mach/hurd/getlogin.c
+++ b/sysdeps/mach/hurd/getlogin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getlogin_r.c b/sysdeps/mach/hurd/getlogin_r.c
index 73d2f071a0..79b8271a74 100644
--- a/sysdeps/mach/hurd/getlogin_r.c
+++ b/sysdeps/mach/hurd/getlogin_r.c
@@ -1,5 +1,5 @@
/* Reentrant function to return the current login name. Hurd version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getpeername.c b/sysdeps/mach/hurd/getpeername.c
index 79862ec3aa..dc78538b75 100644
--- a/sysdeps/mach/hurd/getpeername.c
+++ b/sysdeps/mach/hurd/getpeername.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getpgid.c b/sysdeps/mach/hurd/getpgid.c
index 61ae5fb8a4..83d14eaa27 100644
--- a/sysdeps/mach/hurd/getpgid.c
+++ b/sysdeps/mach/hurd/getpgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getpid.c b/sysdeps/mach/hurd/getpid.c
index 2fc9f63ccc..a7943def59 100644
--- a/sysdeps/mach/hurd/getpid.c
+++ b/sysdeps/mach/hurd/getpid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getppid.c b/sysdeps/mach/hurd/getppid.c
index 523bb9527b..212c9607c2 100644
--- a/sysdeps/mach/hurd/getppid.c
+++ b/sysdeps/mach/hurd/getppid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getpriority.c b/sysdeps/mach/hurd/getpriority.c
index 444a2dd049..c581ddd10f 100644
--- a/sysdeps/mach/hurd/getpriority.c
+++ b/sysdeps/mach/hurd/getpriority.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getresgid.c b/sysdeps/mach/hurd/getresgid.c
index fd42571baa..e5eeba8ac5 100644
--- a/sysdeps/mach/hurd/getresgid.c
+++ b/sysdeps/mach/hurd/getresgid.c
@@ -1,5 +1,5 @@
/* getresgid -- fetch real group ID, effective group ID, and saved-set group ID
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,6 @@ int
__getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
{
error_t err;
- gid_t real, eff, saved;
HURD_CRITICAL_BEGIN;
__mutex_lock (&_hurd_id.lock);
@@ -40,22 +39,18 @@ __getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
err = EGRATUITOUS;
else
{
- real = _hurd_id.aux.gids[0];
- eff = _hurd_id.gen.ngids < 1 ? real : _hurd_id.gen.gids[0];
- saved = _hurd_id.aux.ngids < 2 ? real : _hurd_id.aux.gids[1];
+ gid_t real = _hurd_id.aux.gids[0];
+
+ *rgid = real;
+ *egid = _hurd_id.gen.ngids < 1 ? real : _hurd_id.gen.gids[0];
+ *sgid = _hurd_id.aux.ngids < 2 ? real : _hurd_id.aux.gids[1];
}
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
- if (err)
- return __hurd_fail (err);
-
- *rgid = real;
- *egid = eff;
- *sgid = saved;
- return 0;
+ return __hurd_fail (err);
}
libc_hidden_def (__getresgid)
weak_alias (__getresgid, getresgid)
diff --git a/sysdeps/mach/hurd/getresuid.c b/sysdeps/mach/hurd/getresuid.c
index fba1c786ee..4af4786fc5 100644
--- a/sysdeps/mach/hurd/getresuid.c
+++ b/sysdeps/mach/hurd/getresuid.c
@@ -1,5 +1,5 @@
/* getresuid -- fetch real user ID, effective user ID, and saved-set user ID
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,6 @@ int
__getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
{
error_t err;
- uid_t real, eff, saved;
HURD_CRITICAL_BEGIN;
__mutex_lock (&_hurd_id.lock);
@@ -40,22 +39,18 @@ __getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
err = EGRATUITOUS;
else
{
- real = _hurd_id.aux.uids[0];
- eff = _hurd_id.gen.nuids < 1 ? real : _hurd_id.gen.uids[0];
- saved = _hurd_id.aux.nuids < 2 ? real : _hurd_id.aux.uids[1];
+ uid_t real = _hurd_id.aux.uids[0];
+
+ *ruid = real;
+ *euid = _hurd_id.gen.nuids < 1 ? real : _hurd_id.gen.uids[0];
+ *suid = _hurd_id.aux.nuids < 2 ? real : _hurd_id.aux.uids[1];
}
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
- if (err)
- return __hurd_fail (err);
-
- *ruid = real;
- *euid = eff;
- *suid = saved;
- return 0;
+ return __hurd_fail (err);
}
libc_hidden_def (__getresuid)
weak_alias (__getresuid, getresuid)
diff --git a/sysdeps/mach/hurd/getrlimit.c b/sysdeps/mach/hurd/getrlimit.c
index eda3fec666..5b994c59a7 100644
--- a/sysdeps/mach/hurd/getrlimit.c
+++ b/sysdeps/mach/hurd/getrlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getrusage.c b/sysdeps/mach/hurd/getrusage.c
index 0388bae835..dfda2b7e1b 100644
--- a/sysdeps/mach/hurd/getrusage.c
+++ b/sysdeps/mach/hurd/getrusage.c
@@ -1,5 +1,5 @@
/* getrusage -- Get resource usage information about processes. Hurd version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getsid.c b/sysdeps/mach/hurd/getsid.c
index 56e8954c88..ae0e0a96bd 100644
--- a/sysdeps/mach/hurd/getsid.c
+++ b/sysdeps/mach/hurd/getsid.c
@@ -1,5 +1,5 @@
/* getsid -- Return session ID of a process. Hurd version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getsockname.c b/sysdeps/mach/hurd/getsockname.c
index 60cad8e617..2e56564824 100644
--- a/sysdeps/mach/hurd/getsockname.c
+++ b/sysdeps/mach/hurd/getsockname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getsockopt.c b/sysdeps/mach/hurd/getsockopt.c
index fc00214820..364a622188 100644
--- a/sysdeps/mach/hurd/getsockopt.c
+++ b/sysdeps/mach/hurd/getsockopt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getuid.c b/sysdeps/mach/hurd/getuid.c
index 9844eefc9c..80acbd4987 100644
--- a/sysdeps/mach/hurd/getuid.c
+++ b/sysdeps/mach/hurd/getuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/getxattr.c b/sysdeps/mach/hurd/getxattr.c
index 2653e5767e..3463bdfcb2 100644
--- a/sysdeps/mach/hurd/getxattr.c
+++ b/sysdeps/mach/hurd/getxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/group_member.c b/sysdeps/mach/hurd/group_member.c
index f11d0c689a..5b4be63218 100644
--- a/sysdeps/mach/hurd/group_member.c
+++ b/sysdeps/mach/hurd/group_member.c
@@ -1,5 +1,5 @@
/* `group_member' -- test if process is in a given group. Hurd version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/hp-timing.h b/sysdeps/mach/hurd/hp-timing.h
new file mode 100644
index 0000000000..7bff90cb93
--- /dev/null
+++ b/sysdeps/mach/hurd/hp-timing.h
@@ -0,0 +1,21 @@
+/* High precision, low overhead timing functions. Generic version.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 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/>. */
+
+/* We don't have support for high precision timing for now. */
+#include <sysdeps/generic/hp-timing.h>
diff --git a/sysdeps/mach/hurd/htl/Implies b/sysdeps/mach/hurd/htl/Implies
new file mode 100644
index 0000000000..64daad184a
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/Implies
@@ -0,0 +1,2 @@
+hurd/htl
+mach/htl
diff --git a/sysdeps/mach/hurd/htl/bits/pthread-np.h b/sysdeps/mach/hurd/htl/bits/pthread-np.h
new file mode 100644
index 0000000000..e42fb3a038
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/bits/pthread-np.h
@@ -0,0 +1,37 @@
+/* Non-portable functions. Hurd on Mach version.
+ Copyright (C) 2008-2018 Free Software 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/>. */
+
+/*
+ * Never include this file directly; use <pthread.h> or <cthreads.h> instead.
+ */
+
+#ifndef _BITS_PTHREAD_NP_H
+#define _BITS_PTHREAD_NP_H 1
+
+/* Same as pthread_cond_wait, but for Hurd-specific cancellation.
+ See hurd_thread_cancel. */
+extern int pthread_hurd_cond_wait_np (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex);
+
+/* Same as pthread_cond_timedwait, but for Hurd-specific cancellation.
+ See hurd_thread_cancel. */
+extern int pthread_hurd_cond_timedwait_np (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex,
+ const struct timespec *__abstime);
+
+#endif /* bits/pthread-np.h */
diff --git a/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h b/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h
new file mode 100644
index 0000000000..8417ee9531
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h
@@ -0,0 +1,49 @@
+/* Mutex type. Generic version.
+ Copyright (C) 2000-2018 Free Software 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 _BITS_TYPES_STRUCT___PTHREAD_MUTEX_H
+#define _BITS_TYPES_STRUCT___PTHREAD_MUTEX_H 1
+
+#include <bits/types/struct___pthread_mutexattr.h>
+
+/* User visible part of a mutex. */
+struct __pthread_mutex
+{
+ unsigned int __lock;
+ unsigned int __owner_id;
+ unsigned int __cnt;
+ int __shpid;
+ int __type;
+ int __flags;
+ unsigned int __reserved1;
+ unsigned int __reserved2;
+};
+
+/* Static mutex initializers. */
+#define __PTHREAD_MUTEX_INITIALIZER \
+ { 0, 0, 0, 0, __PTHREAD_MUTEX_TIMED, 0, 0, 0 }
+
+/* The +1 is to mantain binary compatibility with the old
+ * libpthread implementation. */
+#define __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER \
+ { 0, 0, 0, 0, __PTHREAD_MUTEX_ERRORCHECK + 1, 0, 0, 0 }
+
+#define __PTHREAD_RECURSIVE_MUTEX_INITIALIZER \
+ { 0, 0, 0, 0, __PTHREAD_MUTEX_RECURSIVE + 1, 0, 0, 0 }
+
+#endif /* bits/types/struct___pthread_mutex.h */
diff --git a/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c b/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
new file mode 100644
index 0000000000..ff6bee83d0
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
@@ -0,0 +1,28 @@
+/* pthread_attr_setstackaddr. Hurd on Mach version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr)
+{
+ attr->__stackaddr = stackaddr;
+ return 0;
+}
+strong_alias (__pthread_attr_setstackaddr, pthread_attr_setstackaddr)
diff --git a/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c b/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
new file mode 100644
index 0000000000..e5c59d14b4
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
@@ -0,0 +1,28 @@
+/* pthread_attr_setstacksize. Hurd on Mach version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+int
+__pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize)
+{
+ attr->__stacksize = stacksize;
+ return 0;
+}
+strong_alias (__pthread_attr_setstacksize, pthread_attr_setstacksize)
diff --git a/sysdeps/mach/hurd/htl/pt-docancel.c b/sysdeps/mach/hurd/htl/pt-docancel.c
new file mode 100644
index 0000000000..6e9428ce57
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-docancel.c
@@ -0,0 +1,66 @@
+/* Cancel a thread.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+#include <pthreadP.h>
+
+static void
+call_exit (void)
+{
+ __pthread_exit (0);
+}
+
+int
+__pthread_do_cancel (struct __pthread *p)
+{
+ mach_port_t ktid;
+ int me;
+
+ assert (p->cancel_pending == 1);
+ assert (p->cancel_state == PTHREAD_CANCEL_ENABLE);
+
+ __pthread_mutex_unlock (&p->cancel_lock);
+
+ ktid = __mach_thread_self ();
+ me = p->kernel_thread == ktid;
+ __mach_port_deallocate (__mach_task_self (), ktid);
+
+ if (me)
+ call_exit ();
+ else
+ {
+ error_t err;
+
+ err = __thread_suspend (p->kernel_thread);
+ assert_perror (err);
+
+ err = __thread_abort (p->kernel_thread);
+ assert_perror (err);
+
+ err = __thread_set_pcsptp (p->kernel_thread,
+ 1, (void *) call_exit, 0, 0, 0, 0);
+ assert_perror (err);
+
+ err = __thread_resume (p->kernel_thread);
+ assert_perror (err);
+ }
+
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/htl/pt-hurd-cond-timedwait.c b/sysdeps/mach/hurd/htl/pt-hurd-cond-timedwait.c
new file mode 100644
index 0000000000..263d3bfd27
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-hurd-cond-timedwait.c
@@ -0,0 +1,169 @@
+/* pthread_hurd_cond_timedwait_np. Hurd-specific wait on a condition.
+ Copyright (C) 2012-2018 Free Software 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 <assert.h>
+#include <hurd/signal.h>
+
+#include <pt-internal.h>
+
+extern int __pthread_hurd_cond_timedwait_internal (pthread_cond_t *cond,
+ pthread_mutex_t *mutex,
+ const struct timespec
+ *abstime);
+
+int
+__pthread_hurd_cond_timedwait_np (pthread_cond_t *cond,
+ pthread_mutex_t *mutex,
+ const struct timespec *abstime)
+{
+ return __pthread_hurd_cond_timedwait_internal (cond, mutex, abstime);
+}
+
+strong_alias (__pthread_hurd_cond_timedwait_np, pthread_hurd_cond_timedwait_np);
+
+int
+__pthread_hurd_cond_timedwait_internal (pthread_cond_t *cond,
+ pthread_mutex_t *mutex,
+ const struct timespec *abstime)
+{
+ struct hurd_sigstate *ss = _hurd_self_sigstate ();
+ struct __pthread *self = _pthread_self ();
+ error_t err = 0;
+ int cancel, drain;
+ clockid_t clock_id = __pthread_default_condattr.__clock;
+
+ /* This function will be called by hurd_thread_cancel while we are blocked
+ We wake up our thread if it's still blocking or about to block, so it will
+ progress and notice the cancellation flag. */
+ void cancel_me (void)
+ {
+ int unblock;
+
+ __pthread_spin_lock (&cond->__lock);
+ /* The thread only needs to be awaken if it's blocking or about to block.
+ If it was already unblocked, it's not queued any more. */
+ unblock = self->prevp != NULL;
+ if (unblock)
+ __pthread_dequeue (self);
+ __pthread_spin_unlock (&cond->__lock);
+
+ if (unblock)
+ __pthread_wakeup (self);
+ }
+
+ assert (ss->intr_port == MACH_PORT_NULL); /* Sanity check for signal bugs. */
+
+ if (abstime != NULL && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000))
+ return EINVAL;
+
+ /* Atomically enqueue our thread on the condition variable's queue of
+ waiters, and mark our sigstate to indicate that `cancel_me' must be
+ called to wake us up. We must hold the sigstate lock while acquiring
+ the condition variable's lock and tweaking it, so that
+ hurd_thread_cancel can never suspend us and then deadlock waiting for
+ the condition variable's lock. */
+
+ __spin_lock (&ss->lock);
+ __pthread_spin_lock (&cond->__lock);
+ cancel = ss->cancel;
+ if (cancel)
+ /* We were cancelled before doing anything. Don't block at all. */
+ ss->cancel = 0;
+ else
+ {
+ /* Put us on the queue so that pthread_cond_broadcast will know to wake
+ us up. */
+ __pthread_enqueue (&cond->__queue, self);
+ if (cond->__attr)
+ clock_id = cond->__attr->__clock;
+ /* Tell hurd_thread_cancel how to unblock us. */
+ ss->cancel_hook = &cancel_me;
+ }
+ __pthread_spin_unlock (&cond->__lock);
+ __spin_unlock (&ss->lock);
+
+ if (cancel)
+ {
+ /* Cancelled on entry. Just leave the mutex locked. */
+ mutex = NULL;
+
+ __spin_lock (&ss->lock);
+ }
+ else
+ {
+ /* Release MUTEX before blocking. */
+ __pthread_mutex_unlock (mutex);
+
+ /* Block the thread. */
+ if (abstime != NULL)
+ err = __pthread_timedblock (self, abstime, clock_id);
+ else
+ {
+ err = 0;
+ __pthread_block (self);
+ }
+
+ /* As it was done when enqueueing, prevent hurd_thread_cancel from
+ suspending us while the condition lock is held. */
+ __spin_lock (&ss->lock);
+ __pthread_spin_lock (&cond->__lock);
+ if (self->prevp == NULL)
+ /* Another thread removed us from the list of waiters, which means
+ a wakeup message has been sent. It was either consumed while
+ we were blocking, or queued after we timed out and before we
+ acquired the condition lock, in which case the message queue
+ must be drained. */
+ drain = err ? 1 : 0;
+ else
+ {
+ /* We're still in the list of waiters. Noone attempted to wake us
+ up, i.e. we timed out. */
+ __pthread_dequeue (self);
+ drain = 0;
+ }
+ __pthread_spin_unlock (&cond->__lock);
+
+ if (drain)
+ __pthread_block (self);
+ }
+
+ /* Clear the hook, now that we are done blocking. */
+ ss->cancel_hook = NULL;
+ /* Check the cancellation flag; we might have unblocked due to
+ cancellation rather than a normal pthread_cond_signal or
+ pthread_cond_broadcast (or we might have just happened to get cancelled
+ right after waking up). */
+ cancel |= ss->cancel;
+ ss->cancel = 0;
+ __spin_unlock (&ss->lock);
+
+ if (mutex != NULL)
+ /* Reacquire the mutex and return. */
+ __pthread_mutex_lock (mutex);
+
+ if (cancel)
+ return EINTR;
+ else if (err)
+ {
+ assert (err == ETIMEDOUT);
+ return err;
+ }
+
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/htl/pt-hurd-cond-wait.c b/sysdeps/mach/hurd/htl/pt-hurd-cond-wait.c
new file mode 100644
index 0000000000..067bd667e7
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-hurd-cond-wait.c
@@ -0,0 +1,40 @@
+/* pthread_hurd_cond_wait. Hurd-specific wait on a condition.
+ Copyright (C) 2012-2018 Free Software 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 <assert.h>
+#include <hurd/signal.h>
+
+#include <pt-internal.h>
+
+/* Implemented in pt-hurd-cond-timedwait.c. */
+extern int __pthread_hurd_cond_timedwait_internal (pthread_cond_t *cond,
+ pthread_mutex_t *mutex,
+ const struct timespec
+ *abstime);
+
+int
+__pthread_hurd_cond_wait_np (pthread_cond_t *cond, pthread_mutex_t *mutex)
+{
+ error_t err;
+
+ err = __pthread_hurd_cond_timedwait_internal (cond, mutex, NULL);
+ return err == EINTR;
+}
+
+strong_alias (__pthread_hurd_cond_wait_np, pthread_hurd_cond_wait_np);
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c
new file mode 100644
index 0000000000..e02f959a57
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c
@@ -0,0 +1,47 @@
+/* pthread_mutex_consistent. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutex_consistent (pthread_mutex_t *mtxp)
+{
+ int ret = EINVAL;
+ unsigned int val = mtxp->__lock;
+
+ if ((mtxp->__flags & PTHREAD_MUTEX_ROBUST) != 0 &&
+ (val & LLL_DEAD_OWNER) != 0 &&
+ atomic_compare_and_exchange_bool_acq (&mtxp->__lock,
+ __getpid () | LLL_WAITERS,
+ val) == 0)
+ {
+ /* The mutex is now ours, and it's consistent. */
+ mtxp->__owner_id = _pthread_self ()->thread;
+ mtxp->__cnt = 1;
+ ret = 0;
+ }
+
+ return ret;
+}
+
+weak_alias (pthread_mutex_consistent, pthread_mutex_consistent_np)
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-destroy.c b/sysdeps/mach/hurd/htl/pt-mutex-destroy.c
new file mode 100644
index 0000000000..7e7c4bd7a7
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex-destroy.c
@@ -0,0 +1,37 @@
+/* pthread_mutex_destroy. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+_pthread_mutex_destroy (pthread_mutex_t *mtxp)
+{
+ atomic_read_barrier ();
+ if (*(volatile unsigned int *) &mtxp->__lock != 0)
+ return EBUSY;
+
+ mtxp->__type = -1;
+ return 0;
+}
+
+strong_alias (_pthread_mutex_destroy, pthread_mutex_destroy)
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c b/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c
new file mode 100644
index 0000000000..e52da9cad2
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c
@@ -0,0 +1,34 @@
+/* pthread_mutex_getprioceiling. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutex_getprioceiling (const pthread_mutex_t *mtxp, int *clp)
+{
+ (void) mtxp;
+ (void) clp;
+ return ENOSYS;
+}
+
+stub_warning (pthread_mutex_getprioceiling)
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-init.c b/sysdeps/mach/hurd/htl/pt-mutex-init.c
new file mode 100644
index 0000000000..687a4c0e67
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex-init.c
@@ -0,0 +1,57 @@
+/* pthread_mutex_init. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include <pthreadP.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+static const pthread_mutexattr_t dfl_attr = {
+ .__prioceiling = 0,
+ .__protocol = PTHREAD_PRIO_NONE,
+ .__pshared = PTHREAD_PROCESS_PRIVATE,
+ .__mutex_type = __PTHREAD_MUTEX_TIMED
+};
+
+int
+_pthread_mutex_init (pthread_mutex_t *mtxp, const pthread_mutexattr_t *attrp)
+{
+ if (attrp == NULL)
+ attrp = &dfl_attr;
+
+ mtxp->__flags = (attrp->__pshared == PTHREAD_PROCESS_SHARED ?
+ GSYNC_SHARED : 0) | ((attrp->
+ __prioceiling & PTHREAD_MUTEX_ROBUST) ?
+ PTHREAD_MUTEX_ROBUST : 0);
+
+ mtxp->__type = attrp->__mutex_type +
+ (attrp->__mutex_type != __PTHREAD_MUTEX_TIMED);
+
+ mtxp->__owner_id = 0;
+ mtxp->__shpid = 0;
+ mtxp->__cnt = 0;
+ mtxp->__lock = 0;
+
+ return 0;
+}
+
+strong_alias (_pthread_mutex_init, pthread_mutex_init)
+hidden_def (_pthread_mutex_init)
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-lock.c b/sysdeps/mach/hurd/htl/pt-mutex-lock.c
new file mode 100644
index 0000000000..a7f1537756
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex-lock.c
@@ -0,0 +1,80 @@
+/* pthread_mutex_lock. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+__pthread_mutex_lock (pthread_mutex_t *mtxp)
+{
+ struct __pthread *self;
+ int flags = mtxp->__flags & GSYNC_SHARED;
+ int ret = 0;
+
+ switch (MTX_TYPE (mtxp))
+ {
+ case PT_MTX_NORMAL:
+ lll_lock (&mtxp->__lock, flags);
+ break;
+
+ case PT_MTX_RECURSIVE:
+ self = _pthread_self ();
+ if (mtx_owned_p (mtxp, self, flags))
+ {
+ if (__glibc_unlikely (mtxp->__cnt + 1 == 0))
+ return EAGAIN;
+
+ ++mtxp->__cnt;
+ return ret;
+ }
+
+ lll_lock (&mtxp->__lock, flags);
+ mtx_set_owner (mtxp, self, flags);
+ mtxp->__cnt = 1;
+ break;
+
+ case PT_MTX_ERRORCHECK:
+ self = _pthread_self ();
+ if (mtx_owned_p (mtxp, self, flags))
+ return EDEADLK;
+
+ lll_lock (&mtxp->__lock, flags);
+ mtx_set_owner (mtxp, self, flags);
+ break;
+
+ case PT_MTX_NORMAL | PTHREAD_MUTEX_ROBUST:
+ case PT_MTX_RECURSIVE | PTHREAD_MUTEX_ROBUST:
+ case PT_MTX_ERRORCHECK | PTHREAD_MUTEX_ROBUST:
+ self = _pthread_self ();
+ ROBUST_LOCK (self, mtxp, __lll_robust_lock, flags);
+ break;
+
+ default:
+ ret = EINVAL;
+ break;
+ }
+
+ return ret;
+}
+
+strong_alias (__pthread_mutex_lock, _pthread_mutex_lock)
+strong_alias (__pthread_mutex_lock, pthread_mutex_lock)
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c b/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c
new file mode 100644
index 0000000000..c06520a83d
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c
@@ -0,0 +1,35 @@
+/* pthread_mutex_setprioceiling. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutex_setprioceiling (pthread_mutex_t *mtxp, int cl, int *prp)
+{
+ (void) mtxp;
+ (void) cl;
+ (void) prp;
+ return ENOSYS;
+}
+
+stub_warning (pthread_mutex_setprioceiling)
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
new file mode 100644
index 0000000000..f804ac08ad
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
@@ -0,0 +1,78 @@
+/* pthread_mutex_timedlock. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp)
+{
+ struct __pthread *self;
+ int ret, flags = mtxp->__flags & GSYNC_SHARED;
+
+ switch (MTX_TYPE (mtxp))
+ {
+ case PT_MTX_NORMAL:
+ ret = lll_abstimed_lock (&mtxp->__lock, tsp, flags);
+ break;
+
+ case PT_MTX_RECURSIVE:
+ self = _pthread_self ();
+ if (mtx_owned_p (mtxp, self, flags))
+ {
+ if (__glibc_unlikely (mtxp->__cnt + 1 == 0))
+ return EAGAIN;
+
+ ++mtxp->__cnt;
+ ret = 0;
+ }
+ else if ((ret = lll_abstimed_lock (&mtxp->__lock, tsp, flags)) == 0)
+ {
+ mtx_set_owner (mtxp, self, flags);
+ mtxp->__cnt = 1;
+ }
+
+ break;
+
+ case PT_MTX_ERRORCHECK:
+ self = _pthread_self ();
+ if (mtx_owned_p (mtxp, self, flags))
+ ret = EDEADLK;
+ else if ((ret = lll_abstimed_lock (&mtxp->__lock, tsp, flags)) == 0)
+ mtx_set_owner (mtxp, self, flags);
+
+ break;
+
+ case PT_MTX_NORMAL | PTHREAD_MUTEX_ROBUST:
+ case PT_MTX_RECURSIVE | PTHREAD_MUTEX_ROBUST:
+ case PT_MTX_ERRORCHECK | PTHREAD_MUTEX_ROBUST:
+ self = _pthread_self ();
+ ROBUST_LOCK (self, mtxp, lll_robust_abstimed_lock, tsp, flags);
+ break;
+
+ default:
+ ret = EINVAL;
+ break;
+ }
+
+ return ret;
+}
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c b/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c
new file mode 100644
index 0000000000..f6281292ab
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c
@@ -0,0 +1,76 @@
+/* pthread_mutex_transfer_np. Transfer mutex ownership to another thread.
+ Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+__pthread_mutex_transfer_np (pthread_mutex_t *mtxp, pthread_t th)
+{
+ struct __pthread *self = _pthread_self ();
+ struct __pthread *pt = __pthread_getid (th);
+
+ if (pt == NULL)
+ return ESRCH;
+ else if (pt == self)
+ return 0;
+
+ int ret = 0;
+ int flags = mtxp->__flags & GSYNC_SHARED;
+
+ switch (MTX_TYPE (mtxp))
+ {
+ case PT_MTX_NORMAL:
+ break;
+
+ case PT_MTX_RECURSIVE:
+ case PT_MTX_ERRORCHECK:
+ if (!mtx_owned_p (mtxp, self, flags))
+ ret = EPERM;
+ else
+ mtx_set_owner (mtxp, pt, flags);
+
+ break;
+
+ case PT_MTX_NORMAL | PTHREAD_MUTEX_ROBUST:
+ case PT_MTX_RECURSIVE | PTHREAD_MUTEX_ROBUST:
+ case PT_MTX_ERRORCHECK | PTHREAD_MUTEX_ROBUST:
+ /* Note that this can be used to transfer an inconsistent
+ * mutex as well. The new owner will still have the same
+ * flags as the original. */
+ if (mtxp->__owner_id != self->thread ||
+ (int) (mtxp->__lock & LLL_OWNER_MASK) != __getpid ())
+ ret = EPERM;
+ else
+ mtxp->__owner_id = pt->thread;
+
+ break;
+
+ default:
+ ret = EINVAL;
+ }
+
+ return ret;
+}
+
+weak_alias (__pthread_mutex_transfer_np, pthread_mutex_transfer_np)
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-trylock.c b/sysdeps/mach/hurd/htl/pt-mutex-trylock.c
new file mode 100644
index 0000000000..9828d783c1
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex-trylock.c
@@ -0,0 +1,84 @@
+/* pthread_mutex_trylock. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+__pthread_mutex_trylock (pthread_mutex_t *mtxp)
+{
+ struct __pthread *self;
+ int ret;
+
+ switch (MTX_TYPE (mtxp))
+ {
+ case PT_MTX_NORMAL:
+ ret = lll_trylock (&mtxp->__lock);
+ if (ret)
+ ret = EBUSY;
+ break;
+
+ case PT_MTX_RECURSIVE:
+ self = _pthread_self ();
+ if (mtx_owned_p (mtxp, self, mtxp->__flags))
+ {
+ if (__glibc_unlikely (mtxp->__cnt + 1 == 0))
+ return EAGAIN;
+
+ ++mtxp->__cnt;
+ ret = 0;
+ }
+ else if ((ret = lll_trylock (&mtxp->__lock)) == 0)
+ {
+ mtx_set_owner (mtxp, self, mtxp->__flags);
+ mtxp->__cnt = 1;
+ }
+ else
+ ret = EBUSY;
+
+ break;
+
+ case PT_MTX_ERRORCHECK:
+ self = _pthread_self ();
+ if ((ret = lll_trylock (&mtxp->__lock)) == 0)
+ mtx_set_owner (mtxp, self, mtxp->__flags);
+ else
+ ret = EBUSY;
+ break;
+
+ case PT_MTX_NORMAL | PTHREAD_MUTEX_ROBUST:
+ case PT_MTX_RECURSIVE | PTHREAD_MUTEX_ROBUST:
+ case PT_MTX_ERRORCHECK | PTHREAD_MUTEX_ROBUST:
+ self = _pthread_self ();
+ ROBUST_LOCK (self, mtxp, __lll_robust_trylock);
+ break;
+
+ default:
+ ret = EINVAL;
+ break;
+ }
+
+ return ret;
+}
+
+strong_alias (__pthread_mutex_trylock, _pthread_mutex_trylock)
+strong_alias (__pthread_mutex_trylock, pthread_mutex_trylock)
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-unlock.c b/sysdeps/mach/hurd/htl/pt-mutex-unlock.c
new file mode 100644
index 0000000000..1699234420
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex-unlock.c
@@ -0,0 +1,91 @@
+/* pthread_mutex_unlock. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+__pthread_mutex_unlock (pthread_mutex_t *mtxp)
+{
+ struct __pthread *self;
+ int ret = 0, flags = mtxp->__flags & GSYNC_SHARED;
+
+ switch (MTX_TYPE (mtxp))
+ {
+ case PT_MTX_NORMAL:
+ lll_unlock (&mtxp->__lock, flags);
+ break;
+
+ case PT_MTX_RECURSIVE:
+ self = _pthread_self ();
+ if (!mtx_owned_p (mtxp, self, flags))
+ ret = EPERM;
+ else if (--mtxp->__cnt == 0)
+ {
+ mtxp->__owner_id = mtxp->__shpid = 0;
+ lll_unlock (&mtxp->__lock, flags);
+ }
+
+ break;
+
+ case PT_MTX_ERRORCHECK:
+ self = _pthread_self ();
+ if (!mtx_owned_p (mtxp, self, flags))
+ ret = EPERM;
+ else
+ {
+ mtxp->__owner_id = mtxp->__shpid = 0;
+ lll_unlock (&mtxp->__lock, flags);
+ }
+
+ break;
+
+ case PT_MTX_NORMAL | PTHREAD_MUTEX_ROBUST:
+ case PT_MTX_RECURSIVE | PTHREAD_MUTEX_ROBUST:
+ case PT_MTX_ERRORCHECK | PTHREAD_MUTEX_ROBUST:
+ self = _pthread_self ();
+ if (mtxp->__owner_id == NOTRECOVERABLE_ID)
+ ; /* Nothing to do. */
+ else if (mtxp->__owner_id != self->thread ||
+ (int) (mtxp->__lock & LLL_OWNER_MASK) != __getpid ())
+ ret = EPERM;
+ else if (--mtxp->__cnt == 0)
+ {
+ /* Release the lock. If it's in an inconsistent
+ * state, mark it as irrecoverable. */
+ mtxp->__owner_id = (mtxp->__lock & LLL_DEAD_OWNER) ?
+ NOTRECOVERABLE_ID : 0;
+ __lll_robust_unlock (&mtxp->__lock, flags);
+ }
+
+ break;
+
+ default:
+ ret = EINVAL;
+ break;
+ }
+
+ return ret;
+}
+
+strong_alias (__pthread_mutex_unlock, _pthread_mutex_unlock)
+strong_alias (__pthread_mutex_unlock, pthread_mutex_unlock)
diff --git a/sysdeps/mach/hurd/htl/pt-mutex.h b/sysdeps/mach/hurd/htl/pt-mutex.h
new file mode 100644
index 0000000000..4fc7259513
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutex.h
@@ -0,0 +1,90 @@
+/* Internal definitions for pthreads library.
+ Copyright (C) 2016-2018 Free Software 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 _PT_MUTEX_H
+#define _PT_MUTEX_H 1
+
+/* Special ID used to signal an unrecoverable robust mutex. */
+#define NOTRECOVERABLE_ID (1U << 31)
+
+/* Common path for robust mutexes. Assumes the variable 'ret'
+ * is bound in the function this is called from. */
+#define ROBUST_LOCK(self, mtxp, cb, ...) \
+ if (mtxp->__owner_id == NOTRECOVERABLE_ID) \
+ return ENOTRECOVERABLE; \
+ else if (mtxp->__owner_id == self->thread && \
+ __getpid () == (int)(mtxp->__lock & LLL_OWNER_MASK)) \
+ { \
+ if (mtxp->__type == PT_MTX_RECURSIVE) \
+ { \
+ if (__glibc_unlikely (mtxp->__cnt + 1 == 0)) \
+ return EAGAIN; \
+ \
+ ++mtxp->__cnt; \
+ return 0; \
+ } \
+ else if (mtxp->__type == PT_MTX_ERRORCHECK) \
+ return EDEADLK; \
+ } \
+ \
+ ret = cb (&mtxp->__lock, ##__VA_ARGS__); \
+ if (ret == 0 || ret == EOWNERDEAD) \
+ { \
+ if (mtxp->__owner_id == ENOTRECOVERABLE) \
+ ret = ENOTRECOVERABLE; \
+ else \
+ { \
+ mtxp->__owner_id = self->thread; \
+ mtxp->__cnt = 1; \
+ if (ret == EOWNERDEAD) \
+ { \
+ mtxp->__lock = mtxp->__lock | LLL_DEAD_OWNER; \
+ atomic_write_barrier (); \
+ } \
+ } \
+ } \
+ (void)0
+
+/* Check that a thread owns the mutex. For non-robust, task-shared
+ * objects, we have to check the thread *and* process-id. */
+#define mtx_owned_p(mtx, pt, flags) \
+ ((mtx)->__owner_id == (pt)->thread && \
+ (((flags) & GSYNC_SHARED) == 0 || \
+ (mtx)->__shpid == __getpid ()))
+
+/* Record a thread as the owner of the mutex. */
+#define mtx_set_owner(mtx, pt, flags) \
+ (void) \
+ ({ \
+ (mtx)->__owner_id = (pt)->thread; \
+ if ((flags) & GSYNC_SHARED) \
+ (mtx)->__shpid = __getpid (); \
+ })
+
+/* Redefined mutex types. The +1 is for binary compatibility. */
+#define PT_MTX_NORMAL __PTHREAD_MUTEX_TIMED
+#define PT_MTX_RECURSIVE (__PTHREAD_MUTEX_RECURSIVE + 1)
+#define PT_MTX_ERRORCHECK (__PTHREAD_MUTEX_ERRORCHECK + 1)
+
+/* Mutex type, including robustness. */
+#define MTX_TYPE(mtxp) \
+ ((mtxp)->__type | ((mtxp)->__flags & PTHREAD_MUTEX_ROBUST))
+
+extern int __getpid (void) __attribute__ ((const));
+
+#endif /* pt-mutex.h */
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-destroy.c b/sysdeps/mach/hurd/htl/pt-mutexattr-destroy.c
new file mode 100644
index 0000000000..de8de0f2a5
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-destroy.c
@@ -0,0 +1,33 @@
+/* pthread_mutexattr_destroy. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+__pthread_mutexattr_destroy (pthread_mutexattr_t *attrp)
+{
+ (void) attrp;
+ return 0;
+}
+
+weak_alias (__pthread_mutexattr_destroy, pthread_mutexattr_destroy)
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-getprioceiling.c b/sysdeps/mach/hurd/htl/pt-mutexattr-getprioceiling.c
new file mode 100644
index 0000000000..8c6c748a40
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-getprioceiling.c
@@ -0,0 +1,34 @@
+/* pthread_mutexattr_getprioceiling. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *ap, int *clp)
+{
+ (void) ap;
+ (void) clp;
+ return ENOSYS;
+}
+
+stub_warning (pthread_mutexattr_getprioceiling)
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-getprotocol.c b/sysdeps/mach/hurd/htl/pt-mutexattr-getprotocol.c
new file mode 100644
index 0000000000..f0f9edcf47
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-getprotocol.c
@@ -0,0 +1,31 @@
+/* pthread_mutexattr_getprotocol. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attrp, int *ptp)
+{
+ *ptp = attrp->__protocol;
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-getpshared.c b/sysdeps/mach/hurd/htl/pt-mutexattr-getpshared.c
new file mode 100644
index 0000000000..eb162beee8
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-getpshared.c
@@ -0,0 +1,31 @@
+/* pthread_mutexattr_getpshared. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutexattr_getpshared (const pthread_mutexattr_t *attrp, int *outp)
+{
+ *outp = attrp->__pshared;
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c b/sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c
new file mode 100644
index 0000000000..5325e070fe
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c
@@ -0,0 +1,34 @@
+/* pthread_mutexattr_getrobust. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutexattr_getrobust (const pthread_mutexattr_t *attrp, int *outp)
+{
+ *outp = (attrp->__prioceiling & PTHREAD_MUTEX_ROBUST) ?
+ PTHREAD_MUTEX_ROBUST : PTHREAD_MUTEX_STALLED;
+ return 0;
+}
+
+weak_alias (pthread_mutexattr_getrobust, pthread_mutexattr_getrobust_np)
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-gettype.c b/sysdeps/mach/hurd/htl/pt-mutexattr-gettype.c
new file mode 100644
index 0000000000..78b7462895
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-gettype.c
@@ -0,0 +1,31 @@
+/* pthread_mutexattr_gettype. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutexattr_gettype (const pthread_mutexattr_t *attrp, int *outp)
+{
+ *outp = attrp->__mutex_type;
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-init.c b/sysdeps/mach/hurd/htl/pt-mutexattr-init.c
new file mode 100644
index 0000000000..c96afdc26d
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-init.c
@@ -0,0 +1,39 @@
+/* pthread_mutexattr_init. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+static const pthread_mutexattr_t dfl_attr = {
+ .__prioceiling = 0,
+ .__protocol = PTHREAD_PRIO_NONE,
+ .__pshared = PTHREAD_PROCESS_PRIVATE,
+ .__mutex_type = __PTHREAD_MUTEX_TIMED
+};
+
+int
+__pthread_mutexattr_init (pthread_mutexattr_t *attrp)
+{
+ *attrp = dfl_attr;
+ return 0;
+}
+weak_alias (__pthread_mutexattr_init, pthread_mutexattr_init)
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-setprioceiling.c b/sysdeps/mach/hurd/htl/pt-mutexattr-setprioceiling.c
new file mode 100644
index 0000000000..f93cdef38d
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-setprioceiling.c
@@ -0,0 +1,34 @@
+/* pthread_mutexattr_setprioceiling. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attrp, int cl)
+{
+ (void) attrp;
+ (void) cl;
+ return ENOSYS;
+}
+
+stub_warning (pthread_mutexattr_setprioceiling)
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c b/sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c
new file mode 100644
index 0000000000..f971b5bc5f
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c
@@ -0,0 +1,33 @@
+/* pthread_mutexattr_setprotocol. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutexattr_setprotocol (pthread_mutexattr_t *attrp, int proto)
+{
+ (void) attrp;
+ return proto == PTHREAD_PRIO_NONE ? 0 :
+ proto != PTHREAD_PRIO_INHERIT &&
+ proto != PTHREAD_PRIO_PROTECT ? EINVAL : ENOTSUP;
+}
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c b/sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c
new file mode 100644
index 0000000000..6bed94fbce
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c
@@ -0,0 +1,34 @@
+/* pthread_mutexattr_setpshared. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutexattr_setpshared (pthread_mutexattr_t *attrp, int pshared)
+{
+ if (pshared != PTHREAD_PROCESS_PRIVATE && pshared != PTHREAD_PROCESS_SHARED)
+ return EINVAL;
+
+ attrp->__pshared = pshared;
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-setrobust.c b/sysdeps/mach/hurd/htl/pt-mutexattr-setrobust.c
new file mode 100644
index 0000000000..b1baf6cbf8
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-setrobust.c
@@ -0,0 +1,36 @@
+/* pthread_mutexattr_setrobust. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+pthread_mutexattr_setrobust (pthread_mutexattr_t *attrp, int robust)
+{
+ if (robust != PTHREAD_MUTEX_ROBUST && robust != PTHREAD_MUTEX_STALLED)
+ return EINVAL;
+
+ attrp->__prioceiling |= robust;
+ return 0;
+}
+
+weak_alias (pthread_mutexattr_setrobust, pthread_mutexattr_setrobust_np)
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-settype.c b/sysdeps/mach/hurd/htl/pt-mutexattr-settype.c
new file mode 100644
index 0000000000..56b58887c1
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-settype.c
@@ -0,0 +1,35 @@
+/* pthread_mutexattr_settype. Hurd version.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <assert.h>
+#include <pt-internal.h>
+#include "pt-mutex.h"
+#include <hurdlock.h>
+
+int
+__pthread_mutexattr_settype (pthread_mutexattr_t *attrp, int type)
+{
+ if (type < 0 || type > __PTHREAD_MUTEX_RECURSIVE)
+ return EINVAL;
+
+ attrp->__mutex_type = type;
+ return 0;
+}
+weak_alias (__pthread_mutexattr_settype, pthread_mutexattr_settype)
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr.c b/sysdeps/mach/hurd/htl/pt-mutexattr.c
new file mode 100644
index 0000000000..40a8c178f1
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr.c
@@ -0,0 +1 @@
+/* empty */
diff --git a/sysdeps/mach/hurd/htl/pt-sigstate-destroy.c b/sysdeps/mach/hurd/htl/pt-sigstate-destroy.c
new file mode 100644
index 0000000000..e7154a371d
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-sigstate-destroy.c
@@ -0,0 +1,26 @@
+/* Destroy the signal state. Hurd on Mach version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+
+void
+__pthread_sigstate_destroy (struct __pthread *thread)
+{
+}
diff --git a/sysdeps/mach/hurd/htl/pt-sigstate-init.c b/sysdeps/mach/hurd/htl/pt-sigstate-init.c
new file mode 100644
index 0000000000..70832f9576
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-sigstate-init.c
@@ -0,0 +1,44 @@
+/* Initialize the signal state. Hurd on Mach version.
+ Copyright (C) 2002-2018 Free Software 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 <pt-internal.h>
+#include <hurd/signal.h>
+
+error_t
+__pthread_sigstate_init (struct __pthread *thread)
+{
+ static int do_init_global;
+
+ /* Mark the thread as a global signal receiver so as to conform with
+ the pthread semantics. However, we must be careful. The first
+ pthread created is the main thread, during libpthread initialization.
+ We must not mark it, otherwise the sigprocmask call in
+ __pthread_create would try to access _hurd_global_sigstate,
+ which is not initialized yet. When glibc runs _hurdsig_init later
+ on, the message thread is created, which must not be marked either. */
+ if (do_init_global)
+ {
+ struct hurd_sigstate *ss = _hurd_thread_sigstate (thread->kernel_thread);
+ (void) ss;
+ }
+ else if (__pthread_num_threads >= 2)
+ do_init_global = 1;
+
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/htl/pt-sigstate.c b/sysdeps/mach/hurd/htl/pt-sigstate.c
new file mode 100644
index 0000000000..f7050ec0df
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-sigstate.c
@@ -0,0 +1,70 @@
+/* Set a thread's signal state. Hurd on Mach version.
+ Copyright (C) 2002-2018 Free Software 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 <assert.h>
+#include <signal.h>
+#include <hurd/signal.h>
+
+#include <pt-internal.h>
+
+error_t
+__pthread_sigstate (struct __pthread *thread, int how,
+ const sigset_t *set, sigset_t *oset, int clear_pending)
+{
+ error_t err = 0;
+ struct hurd_sigstate *ss;
+
+ ss = _hurd_thread_sigstate (thread->kernel_thread);
+ assert (ss);
+
+ __spin_lock (&ss->lock);
+
+ if (oset != NULL)
+ *oset = ss->blocked;
+
+ if (set != NULL)
+ {
+ switch (how)
+ {
+ case SIG_BLOCK:
+ ss->blocked |= *set;
+ break;
+
+ case SIG_SETMASK:
+ ss->blocked = *set;
+ break;
+
+ case SIG_UNBLOCK:
+ ss->blocked &= ~*set;
+ break;
+
+ default:
+ err = EINVAL;
+ break;
+ }
+ ss->blocked &= ~_SIG_CANT_MASK;
+ }
+
+ if (!err && clear_pending)
+ __sigemptyset (&ss->pending);
+
+ __spin_unlock (&ss->lock);
+
+ return err;
+}
diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.c b/sysdeps/mach/hurd/htl/pt-sysdep.c
new file mode 100644
index 0000000000..673f048c37
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-sysdep.c
@@ -0,0 +1,100 @@
+/* System dependent pthreads code. Hurd version.
+ Copyright (C) 2000-2018 Free Software 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 <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <mach.h>
+#include <mach/mig_support.h>
+
+#include <pt-internal.h>
+#include <pthreadP.h>
+
+__thread struct __pthread *___pthread_self;
+
+/* Forward. */
+static void *init_routine (void);
+
+/* OK, the name of this variable isn't really appropriate, but I don't
+ want to change it yet. */
+void *(*_cthread_init_routine) (void) = &init_routine;
+
+/* This function is called from the Hurd-specific startup code. It
+ should return a new stack pointer for the main thread. The caller
+ will switch to this new stack before doing anything serious. */
+static void *
+_init_routine (void *stack)
+{
+ struct __pthread *thread;
+ int err;
+ pthread_attr_t attr, *attrp = 0;
+
+ if (__pthread_threads != NULL)
+ /* Already initialized */
+ return 0;
+
+ /* Initialize the library. */
+ ___pthread_init ();
+
+ if (stack != NULL)
+ {
+ /* We are getting initialized due to dlopening a library using libpthread
+ while the main program was not linked against libpthread. */
+ /* Avoid allocating another stack */
+ attrp = &attr;
+ __pthread_attr_init (attrp);
+ __pthread_attr_setstack (attrp, stack, __vm_page_size);
+ }
+
+ /* Create the pthread structure for the main thread (i.e. us). */
+ err = __pthread_create_internal (&thread, attrp, 0, 0);
+ assert_perror (err);
+
+ /* XXX The caller copies the command line arguments and the environment
+ to the new stack. Pretend it wasn't allocated so that it remains
+ valid if the main thread terminates. */
+ thread->stack = 0;
+
+ ___pthread_self = thread;
+
+ /* Decrease the number of threads, to take into account that the
+ signal thread (which will be created by the glibc startup code
+ when we return from here) shouldn't be seen as a user thread. */
+ __pthread_total--;
+
+ /* Make MiG code thread aware. */
+ __mig_init (thread->stackaddr);
+
+ return thread->mcontext.sp;
+}
+
+static void *
+init_routine (void)
+{
+ return _init_routine (0);
+}
+
+#ifdef SHARED
+__attribute__ ((constructor))
+static void
+dynamic_init_routine (void)
+{
+ _init_routine (__libc_stack_end);
+}
+#endif
diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.h b/sysdeps/mach/hurd/htl/pt-sysdep.h
new file mode 100644
index 0000000000..5b15223da8
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-sysdep.h
@@ -0,0 +1,65 @@
+/* Internal definitions for pthreads library.
+ Copyright (C) 2000-2018 Free Software 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 _PT_SYSDEP_H
+#define _PT_SYSDEP_H 1
+
+#include <mach.h>
+
+/* XXX */
+#define _POSIX_THREAD_THREADS_MAX 64
+
+/* The default stack size. */
+#define PTHREAD_STACK_DEFAULT (8 * 1024 * 1024)
+
+#define PTHREAD_SYSDEP_MEMBERS \
+ thread_t kernel_thread; \
+ mach_msg_header_t wakeupmsg;
+
+extern __thread struct __pthread *___pthread_self;
+#define _pthread_self() \
+ ({ \
+ struct __pthread *thread; \
+ \
+ assert (__pthread_threads); \
+ thread = ___pthread_self; \
+ \
+ assert (thread); \
+ assert (({ mach_port_t ktid = __mach_thread_self (); \
+ int ok = thread->kernel_thread == ktid; \
+ __mach_port_deallocate (__mach_task_self (), ktid);\
+ ok; })); \
+ thread; \
+ })
+
+extern inline void
+__attribute__ ((__always_inline__))
+__pthread_stack_dealloc (void *stackaddr, size_t stacksize)
+{
+ __vm_deallocate (__mach_task_self (), (vm_offset_t) stackaddr, stacksize);
+}
+
+/* Change thread THREAD's program counter to PC if SET_PC is true,
+ its stack pointer to SP if SET_IP is true, and its thread pointer
+ to TP if SET_TP is true. */
+extern int __thread_set_pcsptp (thread_t thread,
+ int set_pc, void *pc,
+ int set_sp, void *sp, int set_tp, void *tp);
+
+
+#endif /* pt-sysdep.h */
diff --git a/sysdeps/mach/hurd/i386/Implies b/sysdeps/mach/hurd/i386/Implies
new file mode 100644
index 0000000000..eedc9eada9
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/Implies
@@ -0,0 +1,2 @@
+mach/hurd/x86
+mach/hurd/i386/htl
diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile
index 9e1a978b6f..1a53065ae7 100644
--- a/sysdeps/mach/hurd/i386/Makefile
+++ b/sysdeps/mach/hurd/i386/Makefile
@@ -11,3 +11,99 @@ ifeq ($(subdir),stdlib)
gen-as-const-headers += ucontext_i.sym
sysdep_routines += makecontext-helper
endif
+
+ifeq ($(subdir),csu)
+ifeq (yes,$(build-shared))
+sysdep_routines += divdi3
+shared-only-routines += divdi3
+CPPFLAGS-divdi3.c = -Din_divdi3_c
+endif
+endif
+
+ifeq ($(subdir),conform)
+# For bugs 23081, 23082, 23083, 23084, 23085, 23086.
+conformtest-xfail-conds += i386-gnu
+
+# For bug 23088
+test-xfail-POSIX/fcntl.h/conform = yes
+test-xfail-POSIX/signal.h/conform = yes
+test-xfail-POSIX/semaphore.h/conform = yes
+test-xfail-POSIX/regex.h/conform = yes
+test-xfail-POSIX/aio.h/conform = yes
+test-xfail-POSIX/mqueue.h/conform = yes
+test-xfail-POSIX/sys/types.h/conform = yes
+test-xfail-UNIX98/fcntl.h/conform = yes
+test-xfail-UNIX98/netdb.h/conform = yes
+test-xfail-UNIX98/signal.h/conform = yes
+test-xfail-UNIX98/semaphore.h/conform = yes
+test-xfail-UNIX98/regex.h/conform = yes
+test-xfail-UNIX98/aio.h/conform = yes
+test-xfail-UNIX98/ftw.h/conform = yes
+test-xfail-UNIX98/mqueue.h/conform = yes
+test-xfail-UNIX98/netinet/in.h/conform = yes
+test-xfail-UNIX98/sys/wait.h/conform = yes
+test-xfail-UNIX98/sys/sem.h/conform = yes
+test-xfail-UNIX98/sys/uio.h/conform = yes
+test-xfail-UNIX98/sys/socket.h/conform = yes
+test-xfail-UNIX98/sys/types.h/conform = yes
+test-xfail-UNIX98/stdlib.h/conform = yes
+test-xfail-UNIX98/arpa/inet.h/conform = yes
+test-xfail-POSIX2008/fcntl.h/conform = yes
+test-xfail-POSIX2008/netdb.h/conform = yes
+test-xfail-POSIX2008/signal.h/conform = yes
+test-xfail-POSIX2008/semaphore.h/conform = yes
+test-xfail-POSIX2008/regex.h/conform = yes
+test-xfail-POSIX2008/aio.h/conform = yes
+test-xfail-POSIX2008/mqueue.h/conform = yes
+test-xfail-POSIX2008/netinet/in.h/conform = yes
+test-xfail-POSIX2008/sys/wait.h/conform = yes
+test-xfail-POSIX2008/sys/socket.h/conform = yes
+test-xfail-POSIX2008/sys/types.h/conform = yes
+test-xfail-POSIX2008/arpa/inet.h/conform = yes
+test-xfail-XOPEN2K/fcntl.h/conform = yes
+test-xfail-XOPEN2K/netdb.h/conform = yes
+test-xfail-XOPEN2K/signal.h/conform = yes
+test-xfail-XOPEN2K/semaphore.h/conform = yes
+test-xfail-XOPEN2K/regex.h/conform = yes
+test-xfail-XOPEN2K/aio.h/conform = yes
+test-xfail-XOPEN2K/ftw.h/conform = yes
+test-xfail-XOPEN2K/mqueue.h/conform = yes
+test-xfail-XOPEN2K/netinet/in.h/conform = yes
+test-xfail-XOPEN2K/sys/wait.h/conform = yes
+test-xfail-XOPEN2K/sys/sem.h/conform = yes
+test-xfail-XOPEN2K/sys/uio.h/conform = yes
+test-xfail-XOPEN2K/sys/socket.h/conform = yes
+test-xfail-XOPEN2K/sys/types.h/conform = yes
+test-xfail-XOPEN2K/stdlib.h/conform = yes
+test-xfail-XOPEN2K/arpa/inet.h/conform = yes
+test-xfail-XOPEN2K8/fcntl.h/conform = yes
+test-xfail-XOPEN2K8/netdb.h/conform = yes
+test-xfail-XOPEN2K8/signal.h/conform = yes
+test-xfail-XOPEN2K8/semaphore.h/conform = yes
+test-xfail-XOPEN2K8/regex.h/conform = yes
+test-xfail-XOPEN2K8/aio.h/conform = yes
+test-xfail-XOPEN2K8/ftw.h/conform = yes
+test-xfail-XOPEN2K8/mqueue.h/conform = yes
+test-xfail-XOPEN2K8/netinet/in.h/conform = yes
+test-xfail-XOPEN2K8/sys/wait.h/conform = yes
+test-xfail-XOPEN2K8/sys/sem.h/conform = yes
+test-xfail-XOPEN2K8/sys/uio.h/conform = yes
+test-xfail-XOPEN2K8/sys/socket.h/conform = yes
+test-xfail-XOPEN2K8/sys/types.h/conform = yes
+test-xfail-XOPEN2K8/stdlib.h/conform = yes
+test-xfail-XOPEN2K8/arpa/inet.h/conform = yes
+endif
+
+# For bug 23286
+ifeq ($(subdir),hurd)
+test-xfail-check-abi-libhurduser = yes
+endif
+ifeq ($(subdir),mach)
+test-xfail-check-abi-libmachuser = yes
+endif
+
+ifeq ($(subdir),elf)
+# We do use nested functions involving creation of trampolines, notably for
+# callbacks whose parameters don't permit to get the context parameters.
+check-execstack-xfail += ld.so libc.so libpthread.so
+endif
diff --git a/sysdeps/mach/hurd/i386/____longjmp_chk.S b/sysdeps/mach/hurd/i386/____longjmp_chk.S
index 4ddf6cd82e..7c3a73adba 100644
--- a/sysdeps/mach/hurd/i386/____longjmp_chk.S
+++ b/sysdeps/mach/hurd/i386/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,9 +36,11 @@ longjmp_msg:
cfi_register(%ebx,%ecx); \
LOAD_PIC_REG (bx); \
leal longjmp_msg@GOTOFF(%ebx), %eax; \
+ movl %eax, (%esp); \
call HIDDEN_JUMPTARGET(__fortify_fail)
#else
# define CALL_FAIL movl $longjmp_msg, %eax; \
+ movl %eax, (%esp); \
call HIDDEN_JUMPTARGET(__fortify_fail)
#endif
@@ -66,7 +68,7 @@ ENTRY (____longjmp_chk)
/* TODO: need locking? */
/* struct hurd_sigstate * _hurd_self_sigstate (void) */
- call _hurd_self_sigstate
+ call HIDDEN_JUMPTARGET(_hurd_self_sigstate)
/* TODO: %eax and %eax->sigaltstack are always valid? */
testl $SS_ONSTACK, (HURD_SIGSTATE__SIGALTSTACK__OFFSET + SIGALTSTACK__SS_FLAGS__OFFSET)(%eax)
diff --git a/sysdeps/mach/hurd/i386/bits/sigcontext.h b/sysdeps/mach/hurd/i386/bits/sigcontext.h
index 6d15b039ef..f493bc9750 100644
--- a/sysdeps/mach/hurd/i386/bits/sigcontext.h
+++ b/sysdeps/mach/hurd/i386/bits/sigcontext.h
@@ -1,5 +1,5 @@
/* Machine-dependent signal context structure for GNU Hurd. i386 version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software 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,17 @@
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); */
+#include <bits/types/__sigset_t.h>
#include <mach/machine/fp_reg.h>
/* State of this thread when the signal was taken. */
@@ -116,4 +118,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/i386/c++-types.data b/sysdeps/mach/hurd/i386/c++-types.data
new file mode 100644
index 0000000000..4cde3ca667
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:l
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:j
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:y
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14__pthread_attr
+pthread_barrier_t:17__pthread_barrier
+pthread_barrierattr_t:21__pthread_barrierattr
+pthread_cond_t:14__pthread_cond
+pthread_condattr_t:18__pthread_condattr
+pthread_key_t:i
+pthread_mutex_t:15__pthread_mutex
+pthread_mutexattr_t:19__pthread_mutexattr
+pthread_once_t:14__pthread_once
+pthread_rwlock_t:16__pthread_rwlock
+pthread_rwlockattr_t:20__pthread_rwlockattr
+pthread_spinlock_t:i
+pthread_t:i
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:m
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/sysdeps/mach/hurd/i386/exc2signal.c b/sysdeps/mach/hurd/i386/exc2signal.c
index bf0ca2e367..57bc05df99 100644
--- a/sysdeps/mach/hurd/i386/exc2signal.c
+++ b/sysdeps/mach/hurd/i386/exc2signal.c
@@ -1,5 +1,5 @@
/* Translate Mach exception codes into signal numbers. i386 version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -163,3 +163,4 @@ _hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
break;
}
}
+libc_hidden_def (_hurd_exception2signal)
diff --git a/sysdeps/mach/hurd/i386/htl/Implies b/sysdeps/mach/hurd/i386/htl/Implies
new file mode 100644
index 0000000000..7a0f99d772
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/htl/Implies
@@ -0,0 +1,2 @@
+mach/hurd/htl
+i386/htl
diff --git a/sysdeps/mach/hurd/i386/htl/pt-machdep.c b/sysdeps/mach/hurd/i386/htl/pt-machdep.c
new file mode 100644
index 0000000000..2e35a095ab
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/htl/pt-machdep.c
@@ -0,0 +1,82 @@
+/* Machine dependent pthreads code. Hurd/i386 version.
+ Copyright (C) 2000-2018 Free Software 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 <mach.h>
+#include <mach/i386/thread_status.h>
+#include <mach/i386/mach_i386.h>
+#include <mach/mig_errors.h>
+#include <mach/thread_status.h>
+
+#define HURD_TLS_DESC_DECL(desc, tcb) \
+ struct descriptor desc = \
+ { /* low word: */ \
+ 0xffff /* limit 0..15 */ \
+ | (((unsigned int) (tcb)) << 16) /* base 0..15 */ \
+ , /* high word: */ \
+ ((((unsigned int) (tcb)) >> 16) & 0xff) /* base 16..23 */ \
+ | ((0x12 | 0x60 | 0x80) << 8) /* access = ACC_DATA_W|ACC_PL_U|ACC_P */ \
+ | (0xf << 16) /* limit 16..19 */ \
+ | ((4 | 8) << 20) /* granularity = SZ_32|SZ_G */ \
+ | (((unsigned int) (tcb)) & 0xff000000) /* base 24..31 */ \
+ }
+
+int
+__thread_set_pcsptp (thread_t thread,
+ int set_ip, void *ip,
+ int set_sp, void *sp,
+ int set_tp, void *tp)
+{
+ error_t err;
+ struct i386_thread_state state;
+ mach_msg_type_number_t state_count;
+
+ state_count = i386_THREAD_STATE_COUNT;
+
+ err = __thread_get_state (thread, i386_REGS_SEGS_STATE,
+ (thread_state_t) &state, &state_count);
+ if (err)
+ return err;
+
+ if (set_sp)
+ state.uesp = (unsigned int) sp;
+ if (set_ip)
+ state.eip = (unsigned int) ip;
+ if (set_tp)
+ {
+ HURD_TLS_DESC_DECL (desc, tp);
+ int sel;
+
+ asm ("mov %%gs, %w0": "=q" (sel):"0" (0));
+ if (__builtin_expect (sel, 0x48) & 4) /* LDT selector */
+ err = __i386_set_ldt (thread, sel, &desc, 1);
+ else
+ err = __i386_set_gdt (thread, &sel, desc);
+ if (err)
+ return err;
+ state.gs = sel;
+ }
+
+ err = __thread_set_state (thread, i386_REGS_SEGS_STATE,
+ (thread_state_t) &state, i386_THREAD_STATE_COUNT);
+ if (err)
+ return err;
+
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/i386/htl/pt-setup.c b/sysdeps/mach/hurd/i386/htl/pt-setup.c
new file mode 100644
index 0000000000..e10d38a842
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/htl/pt-setup.c
@@ -0,0 +1,110 @@
+/* Setup thread stack. Hurd/i386 version.
+ Copyright (C) 2000-2018 Free Software 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 <stdint.h>
+#include <assert.h>
+#include <mach.h>
+
+#include <pt-internal.h>
+
+/* The stack layout used on the i386 is:
+
+ -----------------
+ | ARG |
+ -----------------
+ | START_ROUTINE |
+ -----------------
+ | 0 |
+ -----------------
+ */
+
+/* Set up the stack for THREAD, such that it appears as if
+ START_ROUTINE and ARG were passed to the new thread's entry-point.
+ Return the stack pointer for the new thread. */
+static void *
+stack_setup (struct __pthread *thread,
+ void *(*start_routine) (void *), void *arg)
+{
+ error_t err;
+ uintptr_t *bottom, *top;
+
+ /* Calculate the top of the new stack. */
+ bottom = thread->stackaddr;
+ top = (uintptr_t *) ((uintptr_t) bottom + thread->stacksize
+ + ((thread->guardsize + __vm_page_size - 1)
+ / __vm_page_size) * __vm_page_size);
+
+ if (start_routine != NULL)
+ {
+ /* And then the call frame. */
+ top -= 3;
+ top = (uintptr_t *) ((uintptr_t) top & ~0xf);
+ top[2] = (uintptr_t) arg; /* Argument to START_ROUTINE. */
+ top[1] = (uintptr_t) start_routine;
+ top[0] = (uintptr_t) thread;
+ *--top = 0; /* Fake return address. */
+ }
+
+ if (thread->guardsize)
+ {
+ err = __vm_protect (__mach_task_self (), (vm_address_t) bottom,
+ thread->guardsize, 0, 0);
+ assert_perror (err);
+ }
+
+ return top;
+}
+
+int
+__pthread_setup (struct __pthread *thread,
+ void (*entry_point) (struct __pthread *, void *(*)(void *),
+ void *), void *(*start_routine) (void *),
+ void *arg)
+{
+ tcbhead_t *tcb;
+ error_t err;
+ mach_port_t ktid;
+
+ thread->mcontext.pc = entry_point;
+ thread->mcontext.sp = stack_setup (thread, start_routine, arg);
+
+ ktid = __mach_thread_self ();
+ if (thread->kernel_thread == ktid)
+ /* Fix up the TCB for the main thread. The C library has already
+ installed a TCB, which we want to keep using. This TCB must not
+ be freed so don't register it in the thread structure. On the
+ other hand, it's not yet possible to reliably release a TCB.
+ Leave the unused one registered so that it doesn't leak. The
+ only thing left to do is to correctly set the `self' member in
+ the already existing TCB. */
+ tcb = THREAD_SELF;
+ else
+ {
+ err = __thread_set_pcsptp (thread->kernel_thread,
+ 1, thread->mcontext.pc,
+ 1, thread->mcontext.sp,
+ 1, thread->tcb);
+ assert_perror (err);
+ tcb = thread->tcb;
+ }
+ __mach_port_deallocate (__mach_task_self (), ktid);
+
+ tcb->self = thread->kernel_thread;
+
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index 7895206417..f8ad2ceb8e 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/i386/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. For i386/Hurd.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,12 +33,8 @@
extern void __mach_init (void);
extern void __init_misc (int, char **, char **);
-#ifdef USE_NONOPTION_FLAGS
-extern void __getopt_clean_environment (char **);
-#endif
extern void __libc_global_ctors (void);
-unsigned int __hurd_threadvar_max;
unsigned long int __hurd_threadvar_stack_offset;
unsigned long int __hurd_threadvar_stack_mask;
@@ -88,11 +84,6 @@ posixland_init (int argc, char **argv, char **envp)
#endif
__init_misc (argc, argv, envp);
-#ifdef USE_NONOPTION_FLAGS
- /* This is a hack to make the special getopt in GNU libc working. */
- __getopt_clean_environment (envp);
-#endif
-
/* Initialize ctype data. */
__ctype_init ();
@@ -113,10 +104,12 @@ init1 (int argc, char *arg0, ...)
++envp;
d = (void *) ++envp;
- /* If we are the bootstrap task started by the kernel,
- then after the environment pointers there is no Hurd
- data block; the argument strings start there. */
+ /* Initialize libpthread if linked in. */
+ if (__pthread_initialize_minimal != NULL)
+ __pthread_initialize_minimal ();
+
if ((void *) d == argv[0])
+ /* No Hurd data block to process. */
return;
#ifndef SHARED
@@ -155,15 +148,6 @@ init (int *data)
char **argv = (void *) (data + 1);
char **envp = &argv[argc + 1];
struct hurd_startup_data *d;
- unsigned long int threadvars[_HURD_THREADVAR_MAX];
-
- /* Provide temporary storage for thread-specific variables on the
- startup stack so the cthreads initialization code can use them
- for malloc et al, or so we can use malloc below for the real
- threadvars array. */
- memset (threadvars, 0, sizeof threadvars);
- threadvars[_HURD_THREADVAR_LOCALE] = (unsigned long int) &_nl_global_locale;
- __hurd_threadvar_stack_offset = (unsigned long int) threadvars;
/* Since the cthreads initialization code uses malloc, and the
malloc initialization code needs to get at the environment, make
@@ -180,21 +164,21 @@ init (int *data)
/* If we are the bootstrap task started by the kernel,
then after the environment pointers there is no Hurd
data block; the argument strings start there. */
- if ((void *) d == argv[0])
+ if ((void *) d == argv[0] || d->phdr == 0)
{
/* With a new enough linker (binutils-2.23 or better),
- the magic __ehdr_start symbol will be available and
- __libc_start_main will have done this that way already. */
+ the magic __ehdr_start symbol will be available and
+ __libc_start_main will have done this that way already. */
if (_dl_phdr == NULL)
{
- /* We may need to see our own phdrs, e.g. for TLS setup.
- Try the usual kludge to find the headers without help from
- the exec server. */
- extern const void __executable_start;
- const ElfW(Ehdr) *const ehdr = &__executable_start;
- _dl_phdr = (const void *) ehdr + ehdr->e_phoff;
- _dl_phnum = ehdr->e_phnum;
- assert (ehdr->e_phentsize == sizeof (ElfW(Phdr)));
+ /* We may need to see our own phdrs, e.g. for TLS setup.
+ Try the usual kludge to find the headers without help from
+ the exec server. */
+ extern const void __executable_start;
+ const ElfW(Ehdr) *const ehdr = &__executable_start;
+ _dl_phdr = (const void *) ehdr + ehdr->e_phoff;
+ _dl_phnum = ehdr->e_phnum;
+ assert (ehdr->e_phentsize == sizeof (ElfW(Phdr)));
}
}
else
@@ -204,20 +188,10 @@ init (int *data)
assert (d->phdrsz % sizeof (ElfW(Phdr)) == 0);
}
- /* We need to setup TLS before starting the signal thread. */
- extern void __pthread_initialize_minimal (void);
- if (__pthread_initialize_minimal != NULL)
- __pthread_initialize_minimal ();
+ /* We need to setup TLS before initializing libpthread. */
+ __libc_setup_tls ();
#endif
- /* The user might have defined a value for this, to get more variables.
- Otherwise it will be zero on startup. We must make sure it is set
- properly before before cthreads initialization, so cthreads can know
- how much space to leave for thread variables. */
- if (__hurd_threadvar_max < _HURD_THREADVAR_MAX)
- __hurd_threadvar_max = _HURD_THREADVAR_MAX;
-
-
/* After possibly switching stacks, call `init1' (above) with the user
code as the return address, and the argument data immediately above
that on the stack. */
@@ -232,11 +206,6 @@ init (int *data)
__libc_stack_end = newsp;
- /* Copy per-thread variables from that temporary
- area onto the new cthread stack. */
- memcpy (__hurd_threadvar_location_from_sp (0, newsp),
- threadvars, sizeof threadvars);
-
/* Copy the argdata from the old stack to the new one. */
newsp = memcpy (newsp - ((char *) &d[1] - (char *) data), data,
(char *) d - (char *) data);
@@ -277,25 +246,10 @@ init (int *data)
}
else
{
- /* We are not using cthreads, so we will have just a single allocated
- area for the per-thread variables of the main user thread. */
- unsigned long int *array;
- unsigned int i;
int usercode;
void call_init1 (void);
- array = malloc (__hurd_threadvar_max * sizeof (unsigned long int));
- if (array == NULL)
- __libc_fatal ("Can't allocate single-threaded thread variables.");
-
- /* Copy per-thread variables from the temporary array into the
- newly malloc'd space. */
- memcpy (array, threadvars, sizeof threadvars);
- __hurd_threadvar_stack_offset = (unsigned long int) array;
- for (i = _HURD_THREADVAR_MAX; i < __hurd_threadvar_max; ++i)
- array[i] = 0;
-
/* The argument data is just above the stack frame we will unwind by
returning. Mutate our own return address to run the code below. */
/* The following expression would typically be written as
diff --git a/sysdeps/mach/hurd/i386/intr-msg.h b/sysdeps/mach/hurd/i386/intr-msg.h
index d60cb197d6..64f05f8c4e 100644
--- a/sysdeps/mach/hurd/i386/intr-msg.h
+++ b/sysdeps/mach/hurd/i386/intr-msg.h
@@ -1,5 +1,5 @@
/* Machine-dependent details of interruptible RPC messaging. i386 version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/i386/ioperm.c b/sysdeps/mach/hurd/i386/ioperm.c
index d89a6bf79d..6f22a88490 100644
--- a/sysdeps/mach/hurd/i386/ioperm.c
+++ b/sysdeps/mach/hurd/i386/ioperm.c
@@ -1,5 +1,5 @@
/* Access to hardware i/o ports. Hurd/x86 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/i386/jmp_buf-macros.h b/sysdeps/mach/hurd/i386/jmp_buf-macros.h
new file mode 100644
index 0000000000..834f5fb243
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 32
+#define SIGJMP_BUF_SIZE 32
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 24
+#define SAVED_MASK_OFFSET 28
diff --git a/sysdeps/mach/hurd/i386/ld.abilist b/sysdeps/mach/hurd/i386/ld.abilist
new file mode 100644
index 0000000000..c76b913486
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/ld.abilist
@@ -0,0 +1,25 @@
+GLIBC_2.2.6 __close F
+GLIBC_2.2.6 __errno_location F
+GLIBC_2.2.6 __fxstat64 F
+GLIBC_2.2.6 __getpid F
+GLIBC_2.2.6 __libc_stack_end D 0x4
+GLIBC_2.2.6 __mmap F
+GLIBC_2.2.6 __open F
+GLIBC_2.2.6 __open64 F
+GLIBC_2.2.6 __read F
+GLIBC_2.2.6 __sbrk F
+GLIBC_2.2.6 __strtoul_internal F
+GLIBC_2.2.6 __write F
+GLIBC_2.2.6 __writev F
+GLIBC_2.2.6 __xstat64 F
+GLIBC_2.2.6 _dl_mcount F
+GLIBC_2.2.6 _hurd_intr_rpc_mach_msg F
+GLIBC_2.2.6 _r_debug D 0x14
+GLIBC_2.2.6 abort F
+GLIBC_2.2.6 calloc F
+GLIBC_2.2.6 free F
+GLIBC_2.2.6 malloc F
+GLIBC_2.2.6 realloc F
+GLIBC_2.3 ___tls_get_addr F
+GLIBC_2.3 __tls_get_addr F
+GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/mach/hurd/i386/libBrokenLocale.abilist b/sysdeps/mach/hurd/i386/libBrokenLocale.abilist
new file mode 100644
index 0000000000..a0f854c7f8
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/libBrokenLocale.abilist
@@ -0,0 +1 @@
+GLIBC_2.2.6 __ctype_get_mb_cur_max F
diff --git a/sysdeps/mach/hurd/i386/libanl.abilist b/sysdeps/mach/hurd/i386/libanl.abilist
new file mode 100644
index 0000000000..123013b2ce
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/libanl.abilist
@@ -0,0 +1,4 @@
+GLIBC_2.2.6 gai_cancel F
+GLIBC_2.2.6 gai_error F
+GLIBC_2.2.6 gai_suspend F
+GLIBC_2.2.6 getaddrinfo_a F
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
new file mode 100644
index 0000000000..e3fc05137b
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -0,0 +1,2306 @@
+GLIBC_2.10 __cxa_at_quick_exit F
+GLIBC_2.10 __posix_getopt F
+GLIBC_2.10 accept4 F
+GLIBC_2.10 endsgent F
+GLIBC_2.10 fgetsgent F
+GLIBC_2.10 fgetsgent_r F
+GLIBC_2.10 getsgent F
+GLIBC_2.10 getsgent_r F
+GLIBC_2.10 getsgnam F
+GLIBC_2.10 getsgnam_r F
+GLIBC_2.10 malloc_info F
+GLIBC_2.10 preadv F
+GLIBC_2.10 preadv64 F
+GLIBC_2.10 psiginfo F
+GLIBC_2.10 putsgent F
+GLIBC_2.10 pwritev F
+GLIBC_2.10 pwritev64 F
+GLIBC_2.10 quick_exit F
+GLIBC_2.10 register_printf_modifier F
+GLIBC_2.10 register_printf_specifier F
+GLIBC_2.10 register_printf_type F
+GLIBC_2.10 setsgent F
+GLIBC_2.10 sgetsgent F
+GLIBC_2.10 sgetsgent_r F
+GLIBC_2.11 __longjmp_chk F
+GLIBC_2.11 execvpe F
+GLIBC_2.11 mkostemps F
+GLIBC_2.11 mkostemps64 F
+GLIBC_2.11 mkstemps F
+GLIBC_2.11 mkstemps64 F
+GLIBC_2.13 __fentry__ F
+GLIBC_2.14 syncfs F
+GLIBC_2.15 __fdelt_chk F
+GLIBC_2.15 __fdelt_warn F
+GLIBC_2.15 posix_spawn F
+GLIBC_2.15 posix_spawnp F
+GLIBC_2.15 scandirat F
+GLIBC_2.15 scandirat64 F
+GLIBC_2.16 __getauxval F
+GLIBC_2.16 __poll_chk F
+GLIBC_2.16 __ppoll_chk F
+GLIBC_2.16 aligned_alloc F
+GLIBC_2.16 c16rtomb F
+GLIBC_2.16 c32rtomb F
+GLIBC_2.16 getauxval F
+GLIBC_2.16 mbrtoc16 F
+GLIBC_2.16 mbrtoc32 F
+GLIBC_2.16 timespec_get F
+GLIBC_2.17 clock_getcpuclockid F
+GLIBC_2.17 clock_getres F
+GLIBC_2.17 clock_gettime F
+GLIBC_2.17 clock_nanosleep F
+GLIBC_2.17 clock_settime F
+GLIBC_2.17 recvmmsg F
+GLIBC_2.17 secure_getenv F
+GLIBC_2.17 sendmmsg F
+GLIBC_2.18 __cxa_thread_atexit_impl F
+GLIBC_2.2.6 _Exit F
+GLIBC_2.2.6 _IO_2_1_stderr_ D 0x98
+GLIBC_2.2.6 _IO_2_1_stdin_ D 0x98
+GLIBC_2.2.6 _IO_2_1_stdout_ D 0x98
+GLIBC_2.2.6 _IO_adjust_column F
+GLIBC_2.2.6 _IO_adjust_wcolumn F
+GLIBC_2.2.6 _IO_default_doallocate F
+GLIBC_2.2.6 _IO_default_finish F
+GLIBC_2.2.6 _IO_default_pbackfail F
+GLIBC_2.2.6 _IO_default_uflow F
+GLIBC_2.2.6 _IO_default_xsgetn F
+GLIBC_2.2.6 _IO_default_xsputn F
+GLIBC_2.2.6 _IO_do_write F
+GLIBC_2.2.6 _IO_doallocbuf F
+GLIBC_2.2.6 _IO_fclose F
+GLIBC_2.2.6 _IO_fdopen F
+GLIBC_2.2.6 _IO_feof F
+GLIBC_2.2.6 _IO_ferror F
+GLIBC_2.2.6 _IO_fflush F
+GLIBC_2.2.6 _IO_fgetpos F
+GLIBC_2.2.6 _IO_fgetpos64 F
+GLIBC_2.2.6 _IO_fgets F
+GLIBC_2.2.6 _IO_file_attach F
+GLIBC_2.2.6 _IO_file_close F
+GLIBC_2.2.6 _IO_file_close_it F
+GLIBC_2.2.6 _IO_file_doallocate F
+GLIBC_2.2.6 _IO_file_finish F
+GLIBC_2.2.6 _IO_file_fopen F
+GLIBC_2.2.6 _IO_file_init F
+GLIBC_2.2.6 _IO_file_jumps D 0x54
+GLIBC_2.2.6 _IO_file_open F
+GLIBC_2.2.6 _IO_file_overflow F
+GLIBC_2.2.6 _IO_file_read F
+GLIBC_2.2.6 _IO_file_seek F
+GLIBC_2.2.6 _IO_file_seekoff F
+GLIBC_2.2.6 _IO_file_setbuf F
+GLIBC_2.2.6 _IO_file_stat F
+GLIBC_2.2.6 _IO_file_sync F
+GLIBC_2.2.6 _IO_file_underflow F
+GLIBC_2.2.6 _IO_file_write F
+GLIBC_2.2.6 _IO_file_xsputn F
+GLIBC_2.2.6 _IO_flockfile F
+GLIBC_2.2.6 _IO_flush_all F
+GLIBC_2.2.6 _IO_flush_all_linebuffered F
+GLIBC_2.2.6 _IO_fopen F
+GLIBC_2.2.6 _IO_fprintf F
+GLIBC_2.2.6 _IO_fputs F
+GLIBC_2.2.6 _IO_fread F
+GLIBC_2.2.6 _IO_free_backup_area F
+GLIBC_2.2.6 _IO_free_wbackup_area F
+GLIBC_2.2.6 _IO_fsetpos F
+GLIBC_2.2.6 _IO_fsetpos64 F
+GLIBC_2.2.6 _IO_ftell F
+GLIBC_2.2.6 _IO_ftrylockfile F
+GLIBC_2.2.6 _IO_funlockfile F
+GLIBC_2.2.6 _IO_fwrite F
+GLIBC_2.2.6 _IO_getc F
+GLIBC_2.2.6 _IO_getline F
+GLIBC_2.2.6 _IO_getline_info F
+GLIBC_2.2.6 _IO_gets F
+GLIBC_2.2.6 _IO_init F
+GLIBC_2.2.6 _IO_init_marker F
+GLIBC_2.2.6 _IO_init_wmarker F
+GLIBC_2.2.6 _IO_iter_begin F
+GLIBC_2.2.6 _IO_iter_end F
+GLIBC_2.2.6 _IO_iter_file F
+GLIBC_2.2.6 _IO_iter_next F
+GLIBC_2.2.6 _IO_least_wmarker F
+GLIBC_2.2.6 _IO_link_in F
+GLIBC_2.2.6 _IO_list_all D 0x4
+GLIBC_2.2.6 _IO_list_lock F
+GLIBC_2.2.6 _IO_list_resetlock F
+GLIBC_2.2.6 _IO_list_unlock F
+GLIBC_2.2.6 _IO_marker_delta F
+GLIBC_2.2.6 _IO_marker_difference F
+GLIBC_2.2.6 _IO_padn F
+GLIBC_2.2.6 _IO_peekc_locked F
+GLIBC_2.2.6 _IO_popen F
+GLIBC_2.2.6 _IO_printf F
+GLIBC_2.2.6 _IO_proc_close F
+GLIBC_2.2.6 _IO_proc_open F
+GLIBC_2.2.6 _IO_putc F
+GLIBC_2.2.6 _IO_puts F
+GLIBC_2.2.6 _IO_remove_marker F
+GLIBC_2.2.6 _IO_seekmark F
+GLIBC_2.2.6 _IO_seekoff F
+GLIBC_2.2.6 _IO_seekpos F
+GLIBC_2.2.6 _IO_seekwmark F
+GLIBC_2.2.6 _IO_setb F
+GLIBC_2.2.6 _IO_setbuffer F
+GLIBC_2.2.6 _IO_setvbuf F
+GLIBC_2.2.6 _IO_sgetn F
+GLIBC_2.2.6 _IO_sprintf F
+GLIBC_2.2.6 _IO_sputbackc F
+GLIBC_2.2.6 _IO_sputbackwc F
+GLIBC_2.2.6 _IO_sscanf F
+GLIBC_2.2.6 _IO_str_init_readonly F
+GLIBC_2.2.6 _IO_str_init_static F
+GLIBC_2.2.6 _IO_str_overflow F
+GLIBC_2.2.6 _IO_str_pbackfail F
+GLIBC_2.2.6 _IO_str_seekoff F
+GLIBC_2.2.6 _IO_str_underflow F
+GLIBC_2.2.6 _IO_sungetc F
+GLIBC_2.2.6 _IO_sungetwc F
+GLIBC_2.2.6 _IO_switch_to_get_mode F
+GLIBC_2.2.6 _IO_switch_to_main_wget_area F
+GLIBC_2.2.6 _IO_switch_to_wbackup_area F
+GLIBC_2.2.6 _IO_switch_to_wget_mode F
+GLIBC_2.2.6 _IO_un_link F
+GLIBC_2.2.6 _IO_ungetc F
+GLIBC_2.2.6 _IO_unsave_markers F
+GLIBC_2.2.6 _IO_unsave_wmarkers F
+GLIBC_2.2.6 _IO_vfprintf F
+GLIBC_2.2.6 _IO_vfscanf F
+GLIBC_2.2.6 _IO_vsprintf F
+GLIBC_2.2.6 _IO_wdefault_doallocate F
+GLIBC_2.2.6 _IO_wdefault_finish F
+GLIBC_2.2.6 _IO_wdefault_pbackfail F
+GLIBC_2.2.6 _IO_wdefault_uflow F
+GLIBC_2.2.6 _IO_wdefault_xsgetn F
+GLIBC_2.2.6 _IO_wdefault_xsputn F
+GLIBC_2.2.6 _IO_wdo_write F
+GLIBC_2.2.6 _IO_wdoallocbuf F
+GLIBC_2.2.6 _IO_wfile_jumps D 0x54
+GLIBC_2.2.6 _IO_wfile_overflow F
+GLIBC_2.2.6 _IO_wfile_seekoff F
+GLIBC_2.2.6 _IO_wfile_sync F
+GLIBC_2.2.6 _IO_wfile_underflow F
+GLIBC_2.2.6 _IO_wfile_xsputn F
+GLIBC_2.2.6 _IO_wmarker_delta F
+GLIBC_2.2.6 _IO_wsetb F
+GLIBC_2.2.6 _S_catch_exception_raise F
+GLIBC_2.2.6 _S_msg_add_auth F
+GLIBC_2.2.6 _S_msg_del_auth F
+GLIBC_2.2.6 _S_msg_describe_ports F
+GLIBC_2.2.6 _S_msg_get_dtable F
+GLIBC_2.2.6 _S_msg_get_env_variable F
+GLIBC_2.2.6 _S_msg_get_environment F
+GLIBC_2.2.6 _S_msg_get_fd F
+GLIBC_2.2.6 _S_msg_get_init_int F
+GLIBC_2.2.6 _S_msg_get_init_ints F
+GLIBC_2.2.6 _S_msg_get_init_port F
+GLIBC_2.2.6 _S_msg_get_init_ports F
+GLIBC_2.2.6 _S_msg_proc_newids F
+GLIBC_2.2.6 _S_msg_report_wait F
+GLIBC_2.2.6 _S_msg_set_dtable F
+GLIBC_2.2.6 _S_msg_set_env_variable F
+GLIBC_2.2.6 _S_msg_set_environment F
+GLIBC_2.2.6 _S_msg_set_fd F
+GLIBC_2.2.6 _S_msg_set_init_int F
+GLIBC_2.2.6 _S_msg_set_init_ints F
+GLIBC_2.2.6 _S_msg_set_init_port F
+GLIBC_2.2.6 _S_msg_set_init_ports F
+GLIBC_2.2.6 _S_msg_sig_post F
+GLIBC_2.2.6 _S_msg_sig_post_untraced F
+GLIBC_2.2.6 ___brk_addr D 0x4
+GLIBC_2.2.6 __after_morecore_hook D 0x4
+GLIBC_2.2.6 __argz_count F
+GLIBC_2.2.6 __argz_next F
+GLIBC_2.2.6 __argz_stringify F
+GLIBC_2.2.6 __asprintf F
+GLIBC_2.2.6 __assert F
+GLIBC_2.2.6 __assert_fail F
+GLIBC_2.2.6 __assert_perror_fail F
+GLIBC_2.2.6 __backtrace F
+GLIBC_2.2.6 __backtrace_symbols F
+GLIBC_2.2.6 __backtrace_symbols_fd F
+GLIBC_2.2.6 __bsd_getpgrp F
+GLIBC_2.2.6 __bzero F
+GLIBC_2.2.6 __check_rhosts_file D 0x4
+GLIBC_2.2.6 __close F
+GLIBC_2.2.6 __cmsg_nxthdr F
+GLIBC_2.2.6 __connect F
+GLIBC_2.2.6 __ctype32_b D 0x4
+GLIBC_2.2.6 __ctype32_tolower D 0x4
+GLIBC_2.2.6 __ctype32_toupper D 0x4
+GLIBC_2.2.6 __ctype_b D 0x4
+GLIBC_2.2.6 __ctype_get_mb_cur_max F
+GLIBC_2.2.6 __ctype_tolower D 0x4
+GLIBC_2.2.6 __ctype_toupper D 0x4
+GLIBC_2.2.6 __cxa_atexit F
+GLIBC_2.2.6 __cxa_finalize F
+GLIBC_2.2.6 __cyg_profile_func_enter F
+GLIBC_2.2.6 __cyg_profile_func_exit F
+GLIBC_2.2.6 __daylight D 0x4
+GLIBC_2.2.6 __dcgettext F
+GLIBC_2.2.6 __default_morecore F
+GLIBC_2.2.6 __dgettext F
+GLIBC_2.2.6 __divdi3 F
+GLIBC_2.2.6 __dup2 F
+GLIBC_2.2.6 __duplocale F
+GLIBC_2.2.6 __environ D 0x4
+GLIBC_2.2.6 __errno_location F
+GLIBC_2.2.6 __fbufsize F
+GLIBC_2.2.6 __fcntl F
+GLIBC_2.2.6 __ffs F
+GLIBC_2.2.6 __finite F
+GLIBC_2.2.6 __finitef F
+GLIBC_2.2.6 __finitel F
+GLIBC_2.2.6 __flbf F
+GLIBC_2.2.6 __fork F
+GLIBC_2.2.6 __fpending F
+GLIBC_2.2.6 __fpu_control D 0x2
+GLIBC_2.2.6 __fpurge F
+GLIBC_2.2.6 __freadable F
+GLIBC_2.2.6 __freading F
+GLIBC_2.2.6 __free_hook D 0x4
+GLIBC_2.2.6 __freelocale F
+GLIBC_2.2.6 __fsetlocking F
+GLIBC_2.2.6 __fwritable F
+GLIBC_2.2.6 __fwriting F
+GLIBC_2.2.6 __fxstat F
+GLIBC_2.2.6 __fxstat64 F
+GLIBC_2.2.6 __getdelim F
+GLIBC_2.2.6 __getpagesize F
+GLIBC_2.2.6 __getpgid F
+GLIBC_2.2.6 __getpid F
+GLIBC_2.2.6 __gettimeofday F
+GLIBC_2.2.6 __gmtime_r F
+GLIBC_2.2.6 __h_errno_location F
+GLIBC_2.2.6 __hurd_fail F
+GLIBC_2.2.6 __hurd_threadvar_stack_mask D 0x4
+GLIBC_2.2.6 __hurd_threadvar_stack_offset D 0x4
+GLIBC_2.2.6 __isalnum_l F
+GLIBC_2.2.6 __isalpha_l F
+GLIBC_2.2.6 __isascii_l F
+GLIBC_2.2.6 __isblank_l F
+GLIBC_2.2.6 __iscntrl_l F
+GLIBC_2.2.6 __isdigit_l F
+GLIBC_2.2.6 __isgraph_l F
+GLIBC_2.2.6 __isinf F
+GLIBC_2.2.6 __isinff F
+GLIBC_2.2.6 __isinfl F
+GLIBC_2.2.6 __islower_l F
+GLIBC_2.2.6 __isnan F
+GLIBC_2.2.6 __isnanf F
+GLIBC_2.2.6 __isnanl F
+GLIBC_2.2.6 __isprint_l F
+GLIBC_2.2.6 __ispunct_l F
+GLIBC_2.2.6 __isspace_l F
+GLIBC_2.2.6 __isupper_l F
+GLIBC_2.2.6 __iswalnum_l F
+GLIBC_2.2.6 __iswalpha_l F
+GLIBC_2.2.6 __iswblank_l F
+GLIBC_2.2.6 __iswcntrl_l F
+GLIBC_2.2.6 __iswctype F
+GLIBC_2.2.6 __iswctype_l F
+GLIBC_2.2.6 __iswdigit_l F
+GLIBC_2.2.6 __iswgraph_l F
+GLIBC_2.2.6 __iswlower_l F
+GLIBC_2.2.6 __iswprint_l F
+GLIBC_2.2.6 __iswpunct_l F
+GLIBC_2.2.6 __iswspace_l F
+GLIBC_2.2.6 __iswupper_l F
+GLIBC_2.2.6 __iswxdigit_l F
+GLIBC_2.2.6 __isxdigit_l F
+GLIBC_2.2.6 __ivaliduser F
+GLIBC_2.2.6 __key_decryptsession_pk_LOCAL D 0x4
+GLIBC_2.2.6 __key_encryptsession_pk_LOCAL D 0x4
+GLIBC_2.2.6 __key_gendes_LOCAL D 0x4
+GLIBC_2.2.6 __libc_allocate_rtsig F
+GLIBC_2.2.6 __libc_calloc F
+GLIBC_2.2.6 __libc_current_sigrtmax F
+GLIBC_2.2.6 __libc_current_sigrtmin F
+GLIBC_2.2.6 __libc_free F
+GLIBC_2.2.6 __libc_freeres F
+GLIBC_2.2.6 __libc_init_first F
+GLIBC_2.2.6 __libc_mallinfo F
+GLIBC_2.2.6 __libc_malloc F
+GLIBC_2.2.6 __libc_mallopt F
+GLIBC_2.2.6 __libc_memalign F
+GLIBC_2.2.6 __libc_pvalloc F
+GLIBC_2.2.6 __libc_realloc F
+GLIBC_2.2.6 __libc_start_main F
+GLIBC_2.2.6 __libc_valloc F
+GLIBC_2.2.6 __lseek F
+GLIBC_2.2.6 __lxstat F
+GLIBC_2.2.6 __lxstat64 F
+GLIBC_2.2.6 __mach_msg F
+GLIBC_2.2.6 __mach_msg_destroy F
+GLIBC_2.2.6 __mach_port_allocate F
+GLIBC_2.2.6 __mach_port_deallocate F
+GLIBC_2.2.6 __mach_port_insert_right F
+GLIBC_2.2.6 __mach_reply_port F
+GLIBC_2.2.6 __mach_task_self_ D 0x4
+GLIBC_2.2.6 __mach_thread_self F
+GLIBC_2.2.6 __malloc_hook D 0x4
+GLIBC_2.2.6 __malloc_initialize_hook D 0x4
+GLIBC_2.2.6 __mbrlen F
+GLIBC_2.2.6 __mbrtowc F
+GLIBC_2.2.6 __memalign_hook D 0x4
+GLIBC_2.2.6 __memcpy_by2 F
+GLIBC_2.2.6 __memcpy_by4 F
+GLIBC_2.2.6 __memcpy_c F
+GLIBC_2.2.6 __memcpy_g F
+GLIBC_2.2.6 __mempcpy F
+GLIBC_2.2.6 __mempcpy_by2 F
+GLIBC_2.2.6 __mempcpy_by4 F
+GLIBC_2.2.6 __mempcpy_byn F
+GLIBC_2.2.6 __mempcpy_small F
+GLIBC_2.2.6 __memset_cc F
+GLIBC_2.2.6 __memset_ccn_by2 F
+GLIBC_2.2.6 __memset_ccn_by4 F
+GLIBC_2.2.6 __memset_cg F
+GLIBC_2.2.6 __memset_gcn_by2 F
+GLIBC_2.2.6 __memset_gcn_by4 F
+GLIBC_2.2.6 __memset_gg F
+GLIBC_2.2.6 __mig_allocate F
+GLIBC_2.2.6 __mig_dealloc_reply_port F
+GLIBC_2.2.6 __mig_deallocate F
+GLIBC_2.2.6 __mig_get_reply_port F
+GLIBC_2.2.6 __mig_init F
+GLIBC_2.2.6 __mig_put_reply_port F
+GLIBC_2.2.6 __mig_strncpy F
+GLIBC_2.2.6 __mmap F
+GLIBC_2.2.6 __moddi3 F
+GLIBC_2.2.6 __monstartup F
+GLIBC_2.2.6 __morecore D 0x4
+GLIBC_2.2.6 __nanosleep F
+GLIBC_2.2.6 __newlocale F
+GLIBC_2.2.6 __nl_langinfo_l F
+GLIBC_2.2.6 __nss_configure_lookup F
+GLIBC_2.2.6 __nss_database_lookup F
+GLIBC_2.2.6 __nss_group_lookup F
+GLIBC_2.2.6 __nss_hostname_digits_dots F
+GLIBC_2.2.6 __nss_hosts_lookup F
+GLIBC_2.2.6 __nss_next F
+GLIBC_2.2.6 __nss_passwd_lookup F
+GLIBC_2.2.6 __open F
+GLIBC_2.2.6 __open64 F
+GLIBC_2.2.6 __overflow F
+GLIBC_2.2.6 __pipe F
+GLIBC_2.2.6 __poll F
+GLIBC_2.2.6 __pread64 F
+GLIBC_2.2.6 __printf_fp F
+GLIBC_2.2.6 __profile_frequency F
+GLIBC_2.2.6 __progname D 0x4
+GLIBC_2.2.6 __progname_full D 0x4
+GLIBC_2.2.6 __pwrite64 F
+GLIBC_2.2.6 __rawmemchr F
+GLIBC_2.2.6 __rcmd_errstr D 0x4
+GLIBC_2.2.6 __read F
+GLIBC_2.2.6 __realloc_hook D 0x4
+GLIBC_2.2.6 __res_init F
+GLIBC_2.2.6 __res_nclose F
+GLIBC_2.2.6 __res_ninit F
+GLIBC_2.2.6 __res_randomid F
+GLIBC_2.2.6 __res_state F
+GLIBC_2.2.6 __rpc_thread_createerr F
+GLIBC_2.2.6 __rpc_thread_svc_fdset F
+GLIBC_2.2.6 __rpc_thread_svc_max_pollfd F
+GLIBC_2.2.6 __rpc_thread_svc_pollfd F
+GLIBC_2.2.6 __sbrk F
+GLIBC_2.2.6 __sched_get_priority_max F
+GLIBC_2.2.6 __sched_get_priority_min F
+GLIBC_2.2.6 __sched_getparam F
+GLIBC_2.2.6 __sched_getscheduler F
+GLIBC_2.2.6 __sched_setscheduler F
+GLIBC_2.2.6 __sched_yield F
+GLIBC_2.2.6 __secure_getenv F
+GLIBC_2.2.6 __select F
+GLIBC_2.2.6 __send F
+GLIBC_2.2.6 __setpgid F
+GLIBC_2.2.6 __sigaction F
+GLIBC_2.2.6 __sigaddset F
+GLIBC_2.2.6 __sigdelset F
+GLIBC_2.2.6 __sigismember F
+GLIBC_2.2.6 __signbit F
+GLIBC_2.2.6 __signbitf F
+GLIBC_2.2.6 __signbitl F
+GLIBC_2.2.6 __sigpause F
+GLIBC_2.2.6 __sigsetjmp F
+GLIBC_2.2.6 __sigsuspend F
+GLIBC_2.2.6 __stpcpy F
+GLIBC_2.2.6 __stpcpy_g F
+GLIBC_2.2.6 __stpcpy_small F
+GLIBC_2.2.6 __stpncpy F
+GLIBC_2.2.6 __strcasecmp F
+GLIBC_2.2.6 __strcasecmp_l F
+GLIBC_2.2.6 __strcasestr F
+GLIBC_2.2.6 __strcat_c F
+GLIBC_2.2.6 __strcat_g F
+GLIBC_2.2.6 __strchr_c F
+GLIBC_2.2.6 __strchr_g F
+GLIBC_2.2.6 __strchrnul_c F
+GLIBC_2.2.6 __strchrnul_g F
+GLIBC_2.2.6 __strcmp_gg F
+GLIBC_2.2.6 __strcoll_l F
+GLIBC_2.2.6 __strcpy_g F
+GLIBC_2.2.6 __strcpy_small F
+GLIBC_2.2.6 __strcspn_c1 F
+GLIBC_2.2.6 __strcspn_c2 F
+GLIBC_2.2.6 __strcspn_c3 F
+GLIBC_2.2.6 __strcspn_cg F
+GLIBC_2.2.6 __strcspn_g F
+GLIBC_2.2.6 __strdup F
+GLIBC_2.2.6 __strerror_r F
+GLIBC_2.2.6 __strfmon_l F
+GLIBC_2.2.6 __strlen_g F
+GLIBC_2.2.6 __strncasecmp_l F
+GLIBC_2.2.6 __strncat_g F
+GLIBC_2.2.6 __strncmp_g F
+GLIBC_2.2.6 __strncpy_by2 F
+GLIBC_2.2.6 __strncpy_by4 F
+GLIBC_2.2.6 __strncpy_byn F
+GLIBC_2.2.6 __strncpy_gg F
+GLIBC_2.2.6 __strndup F
+GLIBC_2.2.6 __strpbrk_c2 F
+GLIBC_2.2.6 __strpbrk_c3 F
+GLIBC_2.2.6 __strpbrk_cg F
+GLIBC_2.2.6 __strpbrk_g F
+GLIBC_2.2.6 __strrchr_c F
+GLIBC_2.2.6 __strrchr_g F
+GLIBC_2.2.6 __strsep_1c F
+GLIBC_2.2.6 __strsep_2c F
+GLIBC_2.2.6 __strsep_3c F
+GLIBC_2.2.6 __strsep_g F
+GLIBC_2.2.6 __strspn_c1 F
+GLIBC_2.2.6 __strspn_c2 F
+GLIBC_2.2.6 __strspn_c3 F
+GLIBC_2.2.6 __strspn_cg F
+GLIBC_2.2.6 __strspn_g F
+GLIBC_2.2.6 __strstr_cg F
+GLIBC_2.2.6 __strstr_g F
+GLIBC_2.2.6 __strtod_internal F
+GLIBC_2.2.6 __strtod_l F
+GLIBC_2.2.6 __strtof_internal F
+GLIBC_2.2.6 __strtof_l F
+GLIBC_2.2.6 __strtok_r F
+GLIBC_2.2.6 __strtok_r_1c F
+GLIBC_2.2.6 __strtol_internal F
+GLIBC_2.2.6 __strtol_l F
+GLIBC_2.2.6 __strtold_internal F
+GLIBC_2.2.6 __strtold_l F
+GLIBC_2.2.6 __strtoll_internal F
+GLIBC_2.2.6 __strtoll_l F
+GLIBC_2.2.6 __strtoul_internal F
+GLIBC_2.2.6 __strtoul_l F
+GLIBC_2.2.6 __strtoull_internal F
+GLIBC_2.2.6 __strtoull_l F
+GLIBC_2.2.6 __strverscmp F
+GLIBC_2.2.6 __strxfrm_l F
+GLIBC_2.2.6 __sysconf F
+GLIBC_2.2.6 __sysv_signal F
+GLIBC_2.2.6 __timezone D 0x4
+GLIBC_2.2.6 __toascii_l F
+GLIBC_2.2.6 __tolower_l F
+GLIBC_2.2.6 __toupper_l F
+GLIBC_2.2.6 __towctrans F
+GLIBC_2.2.6 __towctrans_l F
+GLIBC_2.2.6 __towlower_l F
+GLIBC_2.2.6 __towupper_l F
+GLIBC_2.2.6 __tzname D 0x8
+GLIBC_2.2.6 __udivdi3 F
+GLIBC_2.2.6 __uflow F
+GLIBC_2.2.6 __umoddi3 F
+GLIBC_2.2.6 __underflow F
+GLIBC_2.2.6 __vfork F
+GLIBC_2.2.6 __vfscanf F
+GLIBC_2.2.6 __vm_allocate F
+GLIBC_2.2.6 __vm_deallocate F
+GLIBC_2.2.6 __vm_page_size D 0x4
+GLIBC_2.2.6 __vsnprintf F
+GLIBC_2.2.6 __vsscanf F
+GLIBC_2.2.6 __wait F
+GLIBC_2.2.6 __waitpid F
+GLIBC_2.2.6 __wcscasecmp_l F
+GLIBC_2.2.6 __wcscoll_l F
+GLIBC_2.2.6 __wcsncasecmp_l F
+GLIBC_2.2.6 __wcstod_internal F
+GLIBC_2.2.6 __wcstod_l F
+GLIBC_2.2.6 __wcstof_internal F
+GLIBC_2.2.6 __wcstof_l F
+GLIBC_2.2.6 __wcstol_internal F
+GLIBC_2.2.6 __wcstol_l F
+GLIBC_2.2.6 __wcstold_internal F
+GLIBC_2.2.6 __wcstold_l F
+GLIBC_2.2.6 __wcstoll_internal F
+GLIBC_2.2.6 __wcstoll_l F
+GLIBC_2.2.6 __wcstoul_internal F
+GLIBC_2.2.6 __wcstoul_l F
+GLIBC_2.2.6 __wcstoull_internal F
+GLIBC_2.2.6 __wcstoull_l F
+GLIBC_2.2.6 __wcsxfrm_l F
+GLIBC_2.2.6 __wctrans_l F
+GLIBC_2.2.6 __wctype_l F
+GLIBC_2.2.6 __woverflow F
+GLIBC_2.2.6 __write F
+GLIBC_2.2.6 __writev F
+GLIBC_2.2.6 __wuflow F
+GLIBC_2.2.6 __wunderflow F
+GLIBC_2.2.6 __xmknod F
+GLIBC_2.2.6 __xpg_basename F
+GLIBC_2.2.6 __xpg_sigpause F
+GLIBC_2.2.6 __xstat F
+GLIBC_2.2.6 __xstat64 F
+GLIBC_2.2.6 _authenticate F
+GLIBC_2.2.6 _dl_mcount_wrapper F
+GLIBC_2.2.6 _dl_mcount_wrapper_check F
+GLIBC_2.2.6 _end GLIBC_2.2.6 g ? D .bss 00000000
+GLIBC_2.2.6 _environ D 0x4
+GLIBC_2.2.6 _exit F
+GLIBC_2.2.6 _flushlbf F
+GLIBC_2.2.6 _hurd_canonicalize_directory_name_internal F
+GLIBC_2.2.6 _hurd_critical_section_lock F
+GLIBC_2.2.6 _hurd_critical_section_unlock F
+GLIBC_2.2.6 _hurd_device_master D 0x4
+GLIBC_2.2.6 _hurd_dtable D 0x4
+GLIBC_2.2.6 _hurd_dtable_lock D 0x18
+GLIBC_2.2.6 _hurd_dtablesize D 0x4
+GLIBC_2.2.6 _hurd_exception2signal F
+GLIBC_2.2.6 _hurd_exec F
+GLIBC_2.2.6 _hurd_fd_get F
+GLIBC_2.2.6 _hurd_host_priv D 0x4
+GLIBC_2.2.6 _hurd_init F
+GLIBC_2.2.6 _hurd_intern_fd F
+GLIBC_2.2.6 _hurd_intr_rpc_mach_msg F
+GLIBC_2.2.6 _hurd_msgport D 0x4
+GLIBC_2.2.6 _hurd_port_cleanup F
+GLIBC_2.2.6 _hurd_port_free F
+GLIBC_2.2.6 _hurd_port_get F
+GLIBC_2.2.6 _hurd_port_init F
+GLIBC_2.2.6 _hurd_port_locked_get F
+GLIBC_2.2.6 _hurd_port_set F
+GLIBC_2.2.6 _hurd_ports D 0x4
+GLIBC_2.2.6 _hurd_ports_use F
+GLIBC_2.2.6 _hurd_proc_init F
+GLIBC_2.2.6 _hurd_raise_signal F
+GLIBC_2.2.6 _hurd_self_sigstate F
+GLIBC_2.2.6 _hurd_thread_sigstate F
+GLIBC_2.2.6 _hurdsig_fault_catch_exception_raise F
+GLIBC_2.2.6 _hurdsig_fault_env D 0x20
+GLIBC_2.2.6 _hurdsig_fault_preemptor D 0x18
+GLIBC_2.2.6 _hurdsig_interrupt_timeout D 0x4
+GLIBC_2.2.6 _libc_intl_domainname D 0x5
+GLIBC_2.2.6 _longjmp F
+GLIBC_2.2.6 _mcleanup F
+GLIBC_2.2.6 _mcount F
+GLIBC_2.2.6 _nl_default_dirname D 0xe
+GLIBC_2.2.6 _nl_domain_bindings D 0x4
+GLIBC_2.2.6 _nl_msg_cat_cntr D 0x4
+GLIBC_2.2.6 _null_auth D 0xc
+GLIBC_2.2.6 _obstack D 0x4
+GLIBC_2.2.6 _obstack_allocated_p F
+GLIBC_2.2.6 _obstack_begin F
+GLIBC_2.2.6 _obstack_begin_1 F
+GLIBC_2.2.6 _obstack_free F
+GLIBC_2.2.6 _obstack_memory_used F
+GLIBC_2.2.6 _obstack_newchunk F
+GLIBC_2.2.6 _res D 0x200
+GLIBC_2.2.6 _res_hconf D 0x30
+GLIBC_2.2.6 _rpc_dtablesize F
+GLIBC_2.2.6 _seterr_reply F
+GLIBC_2.2.6 _setjmp F
+GLIBC_2.2.6 _sys_siglist D 0x84
+GLIBC_2.2.6 _tolower F
+GLIBC_2.2.6 _toupper F
+GLIBC_2.2.6 a64l F
+GLIBC_2.2.6 abort F
+GLIBC_2.2.6 abs F
+GLIBC_2.2.6 accept F
+GLIBC_2.2.6 access F
+GLIBC_2.2.6 acct F
+GLIBC_2.2.6 addmntent F
+GLIBC_2.2.6 addseverity F
+GLIBC_2.2.6 adjtime F
+GLIBC_2.2.6 advance F
+GLIBC_2.2.6 alarm F
+GLIBC_2.2.6 alphasort F
+GLIBC_2.2.6 alphasort64 F
+GLIBC_2.2.6 argp_err_exit_status D 0x4
+GLIBC_2.2.6 argp_error F
+GLIBC_2.2.6 argp_failure F
+GLIBC_2.2.6 argp_help F
+GLIBC_2.2.6 argp_parse F
+GLIBC_2.2.6 argp_program_bug_address D 0x4
+GLIBC_2.2.6 argp_program_version D 0x4
+GLIBC_2.2.6 argp_program_version_hook D 0x4
+GLIBC_2.2.6 argp_state_help F
+GLIBC_2.2.6 argp_usage F
+GLIBC_2.2.6 argz_add F
+GLIBC_2.2.6 argz_add_sep F
+GLIBC_2.2.6 argz_append F
+GLIBC_2.2.6 argz_count F
+GLIBC_2.2.6 argz_create F
+GLIBC_2.2.6 argz_create_sep F
+GLIBC_2.2.6 argz_delete F
+GLIBC_2.2.6 argz_extract F
+GLIBC_2.2.6 argz_insert F
+GLIBC_2.2.6 argz_next F
+GLIBC_2.2.6 argz_replace F
+GLIBC_2.2.6 argz_stringify F
+GLIBC_2.2.6 asctime F
+GLIBC_2.2.6 asctime_r F
+GLIBC_2.2.6 asprintf F
+GLIBC_2.2.6 atof F
+GLIBC_2.2.6 atoi F
+GLIBC_2.2.6 atol F
+GLIBC_2.2.6 atoll F
+GLIBC_2.2.6 authdes_create F
+GLIBC_2.2.6 authdes_getucred F
+GLIBC_2.2.6 authdes_pk_create F
+GLIBC_2.2.6 authnone_create F
+GLIBC_2.2.6 authunix_create F
+GLIBC_2.2.6 authunix_create_default F
+GLIBC_2.2.6 backtrace F
+GLIBC_2.2.6 backtrace_symbols F
+GLIBC_2.2.6 backtrace_symbols_fd F
+GLIBC_2.2.6 basename F
+GLIBC_2.2.6 bcmp F
+GLIBC_2.2.6 bcopy F
+GLIBC_2.2.6 bind F
+GLIBC_2.2.6 bind_textdomain_codeset F
+GLIBC_2.2.6 bindresvport F
+GLIBC_2.2.6 bindtextdomain F
+GLIBC_2.2.6 brk F
+GLIBC_2.2.6 bsd_signal F
+GLIBC_2.2.6 bsearch F
+GLIBC_2.2.6 btowc F
+GLIBC_2.2.6 bzero F
+GLIBC_2.2.6 calloc F
+GLIBC_2.2.6 callrpc F
+GLIBC_2.2.6 canonicalize_file_name F
+GLIBC_2.2.6 catclose F
+GLIBC_2.2.6 catgets F
+GLIBC_2.2.6 catopen F
+GLIBC_2.2.6 cbc_crypt F
+GLIBC_2.2.6 cfgetispeed F
+GLIBC_2.2.6 cfgetospeed F
+GLIBC_2.2.6 cfmakeraw F
+GLIBC_2.2.6 cfree F
+GLIBC_2.2.6 cfsetispeed F
+GLIBC_2.2.6 cfsetospeed F
+GLIBC_2.2.6 cfsetspeed F
+GLIBC_2.2.6 chdir F
+GLIBC_2.2.6 chflags F
+GLIBC_2.2.6 chmod F
+GLIBC_2.2.6 chown F
+GLIBC_2.2.6 chroot F
+GLIBC_2.2.6 clearenv F
+GLIBC_2.2.6 clearerr F
+GLIBC_2.2.6 clearerr_unlocked F
+GLIBC_2.2.6 clnt_broadcast F
+GLIBC_2.2.6 clnt_create F
+GLIBC_2.2.6 clnt_pcreateerror F
+GLIBC_2.2.6 clnt_perrno F
+GLIBC_2.2.6 clnt_perror F
+GLIBC_2.2.6 clnt_spcreateerror F
+GLIBC_2.2.6 clnt_sperrno F
+GLIBC_2.2.6 clnt_sperror F
+GLIBC_2.2.6 clntraw_create F
+GLIBC_2.2.6 clnttcp_create F
+GLIBC_2.2.6 clntudp_bufcreate F
+GLIBC_2.2.6 clntudp_create F
+GLIBC_2.2.6 clntunix_create F
+GLIBC_2.2.6 clock F
+GLIBC_2.2.6 close F
+GLIBC_2.2.6 closedir F
+GLIBC_2.2.6 closelog F
+GLIBC_2.2.6 confstr F
+GLIBC_2.2.6 connect F
+GLIBC_2.2.6 copysign F
+GLIBC_2.2.6 copysignf F
+GLIBC_2.2.6 copysignl F
+GLIBC_2.2.6 creat F
+GLIBC_2.2.6 creat64 F
+GLIBC_2.2.6 ctermid F
+GLIBC_2.2.6 ctime F
+GLIBC_2.2.6 ctime_r F
+GLIBC_2.2.6 cuserid F
+GLIBC_2.2.6 daemon F
+GLIBC_2.2.6 daylight D 0x4
+GLIBC_2.2.6 dcgettext F
+GLIBC_2.2.6 dcngettext F
+GLIBC_2.2.6 des_setparity F
+GLIBC_2.2.6 dgettext F
+GLIBC_2.2.6 difftime F
+GLIBC_2.2.6 directory_name_split F
+GLIBC_2.2.6 dirfd F
+GLIBC_2.2.6 dirname F
+GLIBC_2.2.6 div F
+GLIBC_2.2.6 dl_iterate_phdr F
+GLIBC_2.2.6 dngettext F
+GLIBC_2.2.6 dprintf F
+GLIBC_2.2.6 drand48 F
+GLIBC_2.2.6 drand48_r F
+GLIBC_2.2.6 dup F
+GLIBC_2.2.6 dup2 F
+GLIBC_2.2.6 dysize F
+GLIBC_2.2.6 ecb_crypt F
+GLIBC_2.2.6 ecvt F
+GLIBC_2.2.6 ecvt_r F
+GLIBC_2.2.6 endaliasent F
+GLIBC_2.2.6 endfsent F
+GLIBC_2.2.6 endgrent F
+GLIBC_2.2.6 endhostent F
+GLIBC_2.2.6 endmntent F
+GLIBC_2.2.6 endnetent F
+GLIBC_2.2.6 endnetgrent F
+GLIBC_2.2.6 endprotoent F
+GLIBC_2.2.6 endpwent F
+GLIBC_2.2.6 endrpcent F
+GLIBC_2.2.6 endservent F
+GLIBC_2.2.6 endspent F
+GLIBC_2.2.6 endttyent F
+GLIBC_2.2.6 endusershell F
+GLIBC_2.2.6 endutent F
+GLIBC_2.2.6 endutxent F
+GLIBC_2.2.6 environ D 0x4
+GLIBC_2.2.6 envz_add F
+GLIBC_2.2.6 envz_entry F
+GLIBC_2.2.6 envz_get F
+GLIBC_2.2.6 envz_merge F
+GLIBC_2.2.6 envz_remove F
+GLIBC_2.2.6 envz_strip F
+GLIBC_2.2.6 erand48 F
+GLIBC_2.2.6 erand48_r F
+GLIBC_2.2.6 err F
+GLIBC_2.2.6 error F
+GLIBC_2.2.6 error_at_line F
+GLIBC_2.2.6 error_message_count D 0x4
+GLIBC_2.2.6 error_one_per_line D 0x4
+GLIBC_2.2.6 error_print_progname D 0x4
+GLIBC_2.2.6 errx F
+GLIBC_2.2.6 ether_aton F
+GLIBC_2.2.6 ether_aton_r F
+GLIBC_2.2.6 ether_hostton F
+GLIBC_2.2.6 ether_line F
+GLIBC_2.2.6 ether_ntoa F
+GLIBC_2.2.6 ether_ntoa_r F
+GLIBC_2.2.6 ether_ntohost F
+GLIBC_2.2.6 euidaccess F
+GLIBC_2.2.6 evc_wait F
+GLIBC_2.2.6 execl F
+GLIBC_2.2.6 execle F
+GLIBC_2.2.6 execlp F
+GLIBC_2.2.6 execv F
+GLIBC_2.2.6 execve F
+GLIBC_2.2.6 execvp F
+GLIBC_2.2.6 exit F
+GLIBC_2.2.6 fattach F
+GLIBC_2.2.6 fchdir F
+GLIBC_2.2.6 fchflags F
+GLIBC_2.2.6 fchmod F
+GLIBC_2.2.6 fchown F
+GLIBC_2.2.6 fclose F
+GLIBC_2.2.6 fcloseall F
+GLIBC_2.2.6 fcntl F
+GLIBC_2.2.6 fcvt F
+GLIBC_2.2.6 fcvt_r F
+GLIBC_2.2.6 fdatasync F
+GLIBC_2.2.6 fdetach F
+GLIBC_2.2.6 fdopen F
+GLIBC_2.2.6 feof F
+GLIBC_2.2.6 feof_unlocked F
+GLIBC_2.2.6 ferror F
+GLIBC_2.2.6 ferror_unlocked F
+GLIBC_2.2.6 fexecve F
+GLIBC_2.2.6 fflush F
+GLIBC_2.2.6 fflush_unlocked F
+GLIBC_2.2.6 ffs F
+GLIBC_2.2.6 ffsl F
+GLIBC_2.2.6 ffsll F
+GLIBC_2.2.6 fgetc F
+GLIBC_2.2.6 fgetc_unlocked F
+GLIBC_2.2.6 fgetgrent F
+GLIBC_2.2.6 fgetgrent_r F
+GLIBC_2.2.6 fgetpos F
+GLIBC_2.2.6 fgetpos64 F
+GLIBC_2.2.6 fgetpwent F
+GLIBC_2.2.6 fgetpwent_r F
+GLIBC_2.2.6 fgets F
+GLIBC_2.2.6 fgets_unlocked F
+GLIBC_2.2.6 fgetspent F
+GLIBC_2.2.6 fgetspent_r F
+GLIBC_2.2.6 fgetwc F
+GLIBC_2.2.6 fgetwc_unlocked F
+GLIBC_2.2.6 fgetws F
+GLIBC_2.2.6 fgetws_unlocked F
+GLIBC_2.2.6 file_name_lookup F
+GLIBC_2.2.6 file_name_lookup_under F
+GLIBC_2.2.6 file_name_path_lookup F
+GLIBC_2.2.6 file_name_split F
+GLIBC_2.2.6 fileno F
+GLIBC_2.2.6 fileno_unlocked F
+GLIBC_2.2.6 finite F
+GLIBC_2.2.6 finitef F
+GLIBC_2.2.6 finitel F
+GLIBC_2.2.6 flock F
+GLIBC_2.2.6 flockfile F
+GLIBC_2.2.6 fmemopen F
+GLIBC_2.2.6 fmtmsg F
+GLIBC_2.2.6 fnmatch F
+GLIBC_2.2.6 fopen F
+GLIBC_2.2.6 fopen64 F
+GLIBC_2.2.6 fopencookie F
+GLIBC_2.2.6 fopenport F
+GLIBC_2.2.6 fork F
+GLIBC_2.2.6 fpathconf F
+GLIBC_2.2.6 fprintf F
+GLIBC_2.2.6 fputc F
+GLIBC_2.2.6 fputc_unlocked F
+GLIBC_2.2.6 fputs F
+GLIBC_2.2.6 fputs_unlocked F
+GLIBC_2.2.6 fputwc F
+GLIBC_2.2.6 fputwc_unlocked F
+GLIBC_2.2.6 fputws F
+GLIBC_2.2.6 fputws_unlocked F
+GLIBC_2.2.6 fread F
+GLIBC_2.2.6 fread_unlocked F
+GLIBC_2.2.6 free F
+GLIBC_2.2.6 freeaddrinfo F
+GLIBC_2.2.6 freopen F
+GLIBC_2.2.6 freopen64 F
+GLIBC_2.2.6 frexp F
+GLIBC_2.2.6 frexpf F
+GLIBC_2.2.6 frexpl F
+GLIBC_2.2.6 fscanf F
+GLIBC_2.2.6 fseek F
+GLIBC_2.2.6 fseeko F
+GLIBC_2.2.6 fseeko64 F
+GLIBC_2.2.6 fsetpos F
+GLIBC_2.2.6 fsetpos64 F
+GLIBC_2.2.6 fstatfs F
+GLIBC_2.2.6 fstatfs64 F
+GLIBC_2.2.6 fstatvfs F
+GLIBC_2.2.6 fstatvfs64 F
+GLIBC_2.2.6 fsync F
+GLIBC_2.2.6 ftell F
+GLIBC_2.2.6 ftello F
+GLIBC_2.2.6 ftello64 F
+GLIBC_2.2.6 ftime F
+GLIBC_2.2.6 ftok F
+GLIBC_2.2.6 ftruncate F
+GLIBC_2.2.6 ftruncate64 F
+GLIBC_2.2.6 ftrylockfile F
+GLIBC_2.2.6 fts_children F
+GLIBC_2.2.6 fts_close F
+GLIBC_2.2.6 fts_open F
+GLIBC_2.2.6 fts_read F
+GLIBC_2.2.6 fts_set F
+GLIBC_2.2.6 ftw F
+GLIBC_2.2.6 ftw64 F
+GLIBC_2.2.6 funlockfile F
+GLIBC_2.2.6 fwide F
+GLIBC_2.2.6 fwprintf F
+GLIBC_2.2.6 fwrite F
+GLIBC_2.2.6 fwrite_unlocked F
+GLIBC_2.2.6 fwscanf F
+GLIBC_2.2.6 gai_strerror F
+GLIBC_2.2.6 gcvt F
+GLIBC_2.2.6 get_avphys_pages F
+GLIBC_2.2.6 get_current_dir_name F
+GLIBC_2.2.6 get_myaddress F
+GLIBC_2.2.6 get_nprocs F
+GLIBC_2.2.6 get_nprocs_conf F
+GLIBC_2.2.6 get_phys_pages F
+GLIBC_2.2.6 get_privileged_ports F
+GLIBC_2.2.6 getaddrinfo F
+GLIBC_2.2.6 getaliasbyname F
+GLIBC_2.2.6 getaliasbyname_r F
+GLIBC_2.2.6 getaliasent F
+GLIBC_2.2.6 getaliasent_r F
+GLIBC_2.2.6 getauth F
+GLIBC_2.2.6 getc F
+GLIBC_2.2.6 getc_unlocked F
+GLIBC_2.2.6 getchar F
+GLIBC_2.2.6 getchar_unlocked F
+GLIBC_2.2.6 getcontext F
+GLIBC_2.2.6 getcrdir F
+GLIBC_2.2.6 getcttyid F
+GLIBC_2.2.6 getcwd F
+GLIBC_2.2.6 getcwdir F
+GLIBC_2.2.6 getdate F
+GLIBC_2.2.6 getdate_err D 0x4
+GLIBC_2.2.6 getdate_r F
+GLIBC_2.2.6 getdelim F
+GLIBC_2.2.6 getdirentries F
+GLIBC_2.2.6 getdirentries64 F
+GLIBC_2.2.6 getdomainname F
+GLIBC_2.2.6 getdport F
+GLIBC_2.2.6 getdtablesize F
+GLIBC_2.2.6 getegid F
+GLIBC_2.2.6 getenv F
+GLIBC_2.2.6 geteuid F
+GLIBC_2.2.6 geteuids F
+GLIBC_2.2.6 getfsent F
+GLIBC_2.2.6 getfsfile F
+GLIBC_2.2.6 getfsspec F
+GLIBC_2.2.6 getgid F
+GLIBC_2.2.6 getgrent F
+GLIBC_2.2.6 getgrent_r F
+GLIBC_2.2.6 getgrgid F
+GLIBC_2.2.6 getgrgid_r F
+GLIBC_2.2.6 getgrnam F
+GLIBC_2.2.6 getgrnam_r F
+GLIBC_2.2.6 getgrouplist F
+GLIBC_2.2.6 getgroups F
+GLIBC_2.2.6 gethostbyaddr F
+GLIBC_2.2.6 gethostbyaddr_r F
+GLIBC_2.2.6 gethostbyname F
+GLIBC_2.2.6 gethostbyname2 F
+GLIBC_2.2.6 gethostbyname2_r F
+GLIBC_2.2.6 gethostbyname_r F
+GLIBC_2.2.6 gethostent F
+GLIBC_2.2.6 gethostent_r F
+GLIBC_2.2.6 gethostid F
+GLIBC_2.2.6 gethostname F
+GLIBC_2.2.6 getitimer F
+GLIBC_2.2.6 getline F
+GLIBC_2.2.6 getloadavg F
+GLIBC_2.2.6 getlogin F
+GLIBC_2.2.6 getlogin_r F
+GLIBC_2.2.6 getmntent F
+GLIBC_2.2.6 getmntent_r F
+GLIBC_2.2.6 getmsg F
+GLIBC_2.2.6 getnameinfo F
+GLIBC_2.2.6 getnetbyaddr F
+GLIBC_2.2.6 getnetbyaddr_r F
+GLIBC_2.2.6 getnetbyname F
+GLIBC_2.2.6 getnetbyname_r F
+GLIBC_2.2.6 getnetent F
+GLIBC_2.2.6 getnetent_r F
+GLIBC_2.2.6 getnetgrent F
+GLIBC_2.2.6 getnetgrent_r F
+GLIBC_2.2.6 getnetname F
+GLIBC_2.2.6 getopt F
+GLIBC_2.2.6 getopt_long F
+GLIBC_2.2.6 getopt_long_only F
+GLIBC_2.2.6 getpagesize F
+GLIBC_2.2.6 getpass F
+GLIBC_2.2.6 getpeername F
+GLIBC_2.2.6 getpgid F
+GLIBC_2.2.6 getpgrp F
+GLIBC_2.2.6 getpid F
+GLIBC_2.2.6 getpmsg F
+GLIBC_2.2.6 getppid F
+GLIBC_2.2.6 getpriority F
+GLIBC_2.2.6 getproc F
+GLIBC_2.2.6 getprotobyname F
+GLIBC_2.2.6 getprotobyname_r F
+GLIBC_2.2.6 getprotobynumber F
+GLIBC_2.2.6 getprotobynumber_r F
+GLIBC_2.2.6 getprotoent F
+GLIBC_2.2.6 getprotoent_r F
+GLIBC_2.2.6 getpt F
+GLIBC_2.2.6 getpublickey F
+GLIBC_2.2.6 getpw F
+GLIBC_2.2.6 getpwent F
+GLIBC_2.2.6 getpwent_r F
+GLIBC_2.2.6 getpwnam F
+GLIBC_2.2.6 getpwnam_r F
+GLIBC_2.2.6 getpwuid F
+GLIBC_2.2.6 getpwuid_r F
+GLIBC_2.2.6 getrlimit F
+GLIBC_2.2.6 getrlimit64 F
+GLIBC_2.2.6 getrpcbyname F
+GLIBC_2.2.6 getrpcbyname_r F
+GLIBC_2.2.6 getrpcbynumber F
+GLIBC_2.2.6 getrpcbynumber_r F
+GLIBC_2.2.6 getrpcent F
+GLIBC_2.2.6 getrpcent_r F
+GLIBC_2.2.6 getrpcport F
+GLIBC_2.2.6 getrusage F
+GLIBC_2.2.6 gets F
+GLIBC_2.2.6 getsecretkey F
+GLIBC_2.2.6 getservbyname F
+GLIBC_2.2.6 getservbyname_r F
+GLIBC_2.2.6 getservbyport F
+GLIBC_2.2.6 getservbyport_r F
+GLIBC_2.2.6 getservent F
+GLIBC_2.2.6 getservent_r F
+GLIBC_2.2.6 getsid F
+GLIBC_2.2.6 getsockname F
+GLIBC_2.2.6 getsockopt F
+GLIBC_2.2.6 getspent F
+GLIBC_2.2.6 getspent_r F
+GLIBC_2.2.6 getspnam F
+GLIBC_2.2.6 getspnam_r F
+GLIBC_2.2.6 getsubopt F
+GLIBC_2.2.6 gettext F
+GLIBC_2.2.6 gettimeofday F
+GLIBC_2.2.6 getttyent F
+GLIBC_2.2.6 getttynam F
+GLIBC_2.2.6 getuid F
+GLIBC_2.2.6 getumask F
+GLIBC_2.2.6 getusershell F
+GLIBC_2.2.6 getutent F
+GLIBC_2.2.6 getutent_r F
+GLIBC_2.2.6 getutid F
+GLIBC_2.2.6 getutid_r F
+GLIBC_2.2.6 getutline F
+GLIBC_2.2.6 getutline_r F
+GLIBC_2.2.6 getutmp F
+GLIBC_2.2.6 getutmpx F
+GLIBC_2.2.6 getutxent F
+GLIBC_2.2.6 getutxid F
+GLIBC_2.2.6 getutxline F
+GLIBC_2.2.6 getw F
+GLIBC_2.2.6 getwc F
+GLIBC_2.2.6 getwc_unlocked F
+GLIBC_2.2.6 getwchar F
+GLIBC_2.2.6 getwchar_unlocked F
+GLIBC_2.2.6 getwd F
+GLIBC_2.2.6 glob F
+GLIBC_2.2.6 glob64 F
+GLIBC_2.2.6 glob_pattern_p F
+GLIBC_2.2.6 globfree F
+GLIBC_2.2.6 globfree64 F
+GLIBC_2.2.6 gmtime F
+GLIBC_2.2.6 gmtime_r F
+GLIBC_2.2.6 gnu_get_libc_release F
+GLIBC_2.2.6 gnu_get_libc_version F
+GLIBC_2.2.6 grantpt F
+GLIBC_2.2.6 group_member F
+GLIBC_2.2.6 gsignal F
+GLIBC_2.2.6 gtty F
+GLIBC_2.2.6 h_errlist D 0x14
+GLIBC_2.2.6 h_nerr D 0x4
+GLIBC_2.2.6 hasmntopt F
+GLIBC_2.2.6 hcreate F
+GLIBC_2.2.6 hcreate_r F
+GLIBC_2.2.6 hdestroy F
+GLIBC_2.2.6 hdestroy_r F
+GLIBC_2.2.6 herror F
+GLIBC_2.2.6 host2netname F
+GLIBC_2.2.6 hsearch F
+GLIBC_2.2.6 hsearch_r F
+GLIBC_2.2.6 hstrerror F
+GLIBC_2.2.6 htonl F
+GLIBC_2.2.6 htons F
+GLIBC_2.2.6 hurd_catch_signal F
+GLIBC_2.2.6 hurd_check_cancel F
+GLIBC_2.2.6 hurd_directory_name_split F
+GLIBC_2.2.6 hurd_file_name_lookup F
+GLIBC_2.2.6 hurd_file_name_lookup_retry F
+GLIBC_2.2.6 hurd_file_name_path_lookup F
+GLIBC_2.2.6 hurd_file_name_split F
+GLIBC_2.2.6 hurd_preempt_signals F
+GLIBC_2.2.6 hurd_safe_copyin F
+GLIBC_2.2.6 hurd_safe_copyout F
+GLIBC_2.2.6 hurd_safe_memmove F
+GLIBC_2.2.6 hurd_safe_memset F
+GLIBC_2.2.6 hurd_sig_post F
+GLIBC_2.2.6 hurd_thread_cancel F
+GLIBC_2.2.6 hurd_thread_self F
+GLIBC_2.2.6 hurd_unpreempt_signals F
+GLIBC_2.2.6 iconv F
+GLIBC_2.2.6 iconv_close F
+GLIBC_2.2.6 iconv_open F
+GLIBC_2.2.6 if_freenameindex F
+GLIBC_2.2.6 if_indextoname F
+GLIBC_2.2.6 if_nameindex F
+GLIBC_2.2.6 if_nametoindex F
+GLIBC_2.2.6 imaxabs F
+GLIBC_2.2.6 imaxdiv F
+GLIBC_2.2.6 in6addr_any D 0x10
+GLIBC_2.2.6 in6addr_loopback D 0x10
+GLIBC_2.2.6 index F
+GLIBC_2.2.6 inet_addr F
+GLIBC_2.2.6 inet_aton F
+GLIBC_2.2.6 inet_lnaof F
+GLIBC_2.2.6 inet_makeaddr F
+GLIBC_2.2.6 inet_netof F
+GLIBC_2.2.6 inet_network F
+GLIBC_2.2.6 inet_nsap_addr F
+GLIBC_2.2.6 inet_nsap_ntoa F
+GLIBC_2.2.6 inet_ntoa F
+GLIBC_2.2.6 inet_ntop F
+GLIBC_2.2.6 inet_pton F
+GLIBC_2.2.6 initgroups F
+GLIBC_2.2.6 initstate F
+GLIBC_2.2.6 initstate_r F
+GLIBC_2.2.6 innetgr F
+GLIBC_2.2.6 insque F
+GLIBC_2.2.6 ioctl F
+GLIBC_2.2.6 ioperm F
+GLIBC_2.2.6 iruserok F
+GLIBC_2.2.6 iruserok_af F
+GLIBC_2.2.6 isalnum F
+GLIBC_2.2.6 isalpha F
+GLIBC_2.2.6 isascii F
+GLIBC_2.2.6 isastream F
+GLIBC_2.2.6 isatty F
+GLIBC_2.2.6 isblank F
+GLIBC_2.2.6 iscntrl F
+GLIBC_2.2.6 isdigit F
+GLIBC_2.2.6 isfdtype F
+GLIBC_2.2.6 isgraph F
+GLIBC_2.2.6 isinf F
+GLIBC_2.2.6 isinff F
+GLIBC_2.2.6 isinfl F
+GLIBC_2.2.6 islower F
+GLIBC_2.2.6 isnan F
+GLIBC_2.2.6 isnanf F
+GLIBC_2.2.6 isnanl F
+GLIBC_2.2.6 isprint F
+GLIBC_2.2.6 ispunct F
+GLIBC_2.2.6 isspace F
+GLIBC_2.2.6 isupper F
+GLIBC_2.2.6 iswalnum F
+GLIBC_2.2.6 iswalpha F
+GLIBC_2.2.6 iswblank F
+GLIBC_2.2.6 iswcntrl F
+GLIBC_2.2.6 iswctype F
+GLIBC_2.2.6 iswdigit F
+GLIBC_2.2.6 iswgraph F
+GLIBC_2.2.6 iswlower F
+GLIBC_2.2.6 iswprint F
+GLIBC_2.2.6 iswpunct F
+GLIBC_2.2.6 iswspace F
+GLIBC_2.2.6 iswupper F
+GLIBC_2.2.6 iswxdigit F
+GLIBC_2.2.6 isxdigit F
+GLIBC_2.2.6 jrand48 F
+GLIBC_2.2.6 jrand48_r F
+GLIBC_2.2.6 key_decryptsession F
+GLIBC_2.2.6 key_decryptsession_pk F
+GLIBC_2.2.6 key_encryptsession F
+GLIBC_2.2.6 key_encryptsession_pk F
+GLIBC_2.2.6 key_gendes F
+GLIBC_2.2.6 key_get_conv F
+GLIBC_2.2.6 key_secretkey_is_set F
+GLIBC_2.2.6 key_setnet F
+GLIBC_2.2.6 key_setsecret F
+GLIBC_2.2.6 kill F
+GLIBC_2.2.6 killpg F
+GLIBC_2.2.6 l64a F
+GLIBC_2.2.6 labs F
+GLIBC_2.2.6 lchown F
+GLIBC_2.2.6 lckpwdf F
+GLIBC_2.2.6 lcong48 F
+GLIBC_2.2.6 lcong48_r F
+GLIBC_2.2.6 ldexp F
+GLIBC_2.2.6 ldexpf F
+GLIBC_2.2.6 ldexpl F
+GLIBC_2.2.6 ldiv F
+GLIBC_2.2.6 lfind F
+GLIBC_2.2.6 link F
+GLIBC_2.2.6 listen F
+GLIBC_2.2.6 llabs F
+GLIBC_2.2.6 lldiv F
+GLIBC_2.2.6 loc1 D 0x4
+GLIBC_2.2.6 loc2 D 0x4
+GLIBC_2.2.6 localeconv F
+GLIBC_2.2.6 localtime F
+GLIBC_2.2.6 localtime_r F
+GLIBC_2.2.6 lockf F
+GLIBC_2.2.6 lockf64 F
+GLIBC_2.2.6 locs D 0x4
+GLIBC_2.2.6 longjmp F
+GLIBC_2.2.6 lrand48 F
+GLIBC_2.2.6 lrand48_r F
+GLIBC_2.2.6 lsearch F
+GLIBC_2.2.6 lseek F
+GLIBC_2.2.6 lseek64 F
+GLIBC_2.2.6 mach_error F
+GLIBC_2.2.6 mach_error_string F
+GLIBC_2.2.6 mach_error_type F
+GLIBC_2.2.6 mach_host_self F
+GLIBC_2.2.6 mach_msg F
+GLIBC_2.2.6 mach_msg_destroy F
+GLIBC_2.2.6 mach_msg_receive F
+GLIBC_2.2.6 mach_msg_send F
+GLIBC_2.2.6 mach_msg_server F
+GLIBC_2.2.6 mach_msg_server_timeout F
+GLIBC_2.2.6 mach_open_devstream F
+GLIBC_2.2.6 mach_port_allocate F
+GLIBC_2.2.6 mach_port_allocate_name F
+GLIBC_2.2.6 mach_port_deallocate F
+GLIBC_2.2.6 mach_port_insert_right F
+GLIBC_2.2.6 mach_reply_port F
+GLIBC_2.2.6 mach_setup_thread F
+GLIBC_2.2.6 mach_setup_tls F
+GLIBC_2.2.6 mach_task_self F
+GLIBC_2.2.6 mach_thread_self F
+GLIBC_2.2.6 madvise F
+GLIBC_2.2.6 makecontext F
+GLIBC_2.2.6 mallinfo F
+GLIBC_2.2.6 malloc F
+GLIBC_2.2.6 malloc_get_state F
+GLIBC_2.2.6 malloc_set_state F
+GLIBC_2.2.6 malloc_stats F
+GLIBC_2.2.6 malloc_trim F
+GLIBC_2.2.6 malloc_usable_size F
+GLIBC_2.2.6 mallopt F
+GLIBC_2.2.6 mallwatch D 0x4
+GLIBC_2.2.6 mblen F
+GLIBC_2.2.6 mbrlen F
+GLIBC_2.2.6 mbrtowc F
+GLIBC_2.2.6 mbsinit F
+GLIBC_2.2.6 mbsnrtowcs F
+GLIBC_2.2.6 mbsrtowcs F
+GLIBC_2.2.6 mbstowcs F
+GLIBC_2.2.6 mbtowc F
+GLIBC_2.2.6 mcheck F
+GLIBC_2.2.6 mcheck_check_all F
+GLIBC_2.2.6 mcheck_pedantic F
+GLIBC_2.2.6 mcount F
+GLIBC_2.2.6 memalign F
+GLIBC_2.2.6 memccpy F
+GLIBC_2.2.6 memchr F
+GLIBC_2.2.6 memcmp F
+GLIBC_2.2.6 memcpy F
+GLIBC_2.2.6 memfrob F
+GLIBC_2.2.6 memmem F
+GLIBC_2.2.6 memmove F
+GLIBC_2.2.6 mempcpy F
+GLIBC_2.2.6 memrchr F
+GLIBC_2.2.6 memset F
+GLIBC_2.2.6 mig_allocate F
+GLIBC_2.2.6 mig_dealloc_reply_port F
+GLIBC_2.2.6 mig_deallocate F
+GLIBC_2.2.6 mig_get_reply_port F
+GLIBC_2.2.6 mig_init F
+GLIBC_2.2.6 mig_put_reply_port F
+GLIBC_2.2.6 mig_strncpy F
+GLIBC_2.2.6 mincore F
+GLIBC_2.2.6 mkdir F
+GLIBC_2.2.6 mkdtemp F
+GLIBC_2.2.6 mkfifo F
+GLIBC_2.2.6 mkstemp F
+GLIBC_2.2.6 mkstemp64 F
+GLIBC_2.2.6 mktemp F
+GLIBC_2.2.6 mktime F
+GLIBC_2.2.6 mlock F
+GLIBC_2.2.6 mlockall F
+GLIBC_2.2.6 mmap F
+GLIBC_2.2.6 mmap64 F
+GLIBC_2.2.6 modf F
+GLIBC_2.2.6 modff F
+GLIBC_2.2.6 modfl F
+GLIBC_2.2.6 moncontrol F
+GLIBC_2.2.6 monstartup F
+GLIBC_2.2.6 mprobe F
+GLIBC_2.2.6 mprotect F
+GLIBC_2.2.6 mrand48 F
+GLIBC_2.2.6 mrand48_r F
+GLIBC_2.2.6 msgctl F
+GLIBC_2.2.6 msgget F
+GLIBC_2.2.6 msgrcv F
+GLIBC_2.2.6 msgsnd F
+GLIBC_2.2.6 msync F
+GLIBC_2.2.6 mtrace F
+GLIBC_2.2.6 munlock F
+GLIBC_2.2.6 munlockall F
+GLIBC_2.2.6 munmap F
+GLIBC_2.2.6 muntrace F
+GLIBC_2.2.6 nanosleep F
+GLIBC_2.2.6 netname2host F
+GLIBC_2.2.6 netname2user F
+GLIBC_2.2.6 nftw F
+GLIBC_2.2.6 nftw64 F
+GLIBC_2.2.6 ngettext F
+GLIBC_2.2.6 nice F
+GLIBC_2.2.6 nl_langinfo F
+GLIBC_2.2.6 nrand48 F
+GLIBC_2.2.6 nrand48_r F
+GLIBC_2.2.6 ntohl F
+GLIBC_2.2.6 ntohs F
+GLIBC_2.2.6 obstack_alloc_failed_handler D 0x4
+GLIBC_2.2.6 obstack_exit_failure D 0x4
+GLIBC_2.2.6 obstack_free F
+GLIBC_2.2.6 obstack_printf F
+GLIBC_2.2.6 obstack_vprintf F
+GLIBC_2.2.6 on_exit F
+GLIBC_2.2.6 open F
+GLIBC_2.2.6 open64 F
+GLIBC_2.2.6 open_memstream F
+GLIBC_2.2.6 opendir F
+GLIBC_2.2.6 openlog F
+GLIBC_2.2.6 openport F
+GLIBC_2.2.6 optarg D 0x4
+GLIBC_2.2.6 opterr D 0x4
+GLIBC_2.2.6 optind D 0x4
+GLIBC_2.2.6 optopt D 0x4
+GLIBC_2.2.6 parse_printf_format F
+GLIBC_2.2.6 passwd2des F
+GLIBC_2.2.6 pathconf F
+GLIBC_2.2.6 pause F
+GLIBC_2.2.6 pclose F
+GLIBC_2.2.6 perror F
+GLIBC_2.2.6 pid2task F
+GLIBC_2.2.6 pipe F
+GLIBC_2.2.6 pmap_getmaps F
+GLIBC_2.2.6 pmap_getport F
+GLIBC_2.2.6 pmap_rmtcall F
+GLIBC_2.2.6 pmap_set F
+GLIBC_2.2.6 pmap_unset F
+GLIBC_2.2.6 poll F
+GLIBC_2.2.6 popen F
+GLIBC_2.2.6 posix_fadvise F
+GLIBC_2.2.6 posix_fadvise64 F
+GLIBC_2.2.6 posix_fallocate F
+GLIBC_2.2.6 posix_fallocate64 F
+GLIBC_2.2.6 posix_madvise F
+GLIBC_2.2.6 posix_memalign F
+GLIBC_2.2.6 posix_openpt F
+GLIBC_2.2.6 posix_spawn F
+GLIBC_2.2.6 posix_spawn_file_actions_addclose F
+GLIBC_2.2.6 posix_spawn_file_actions_adddup2 F
+GLIBC_2.2.6 posix_spawn_file_actions_addopen F
+GLIBC_2.2.6 posix_spawn_file_actions_destroy F
+GLIBC_2.2.6 posix_spawn_file_actions_init F
+GLIBC_2.2.6 posix_spawnattr_destroy F
+GLIBC_2.2.6 posix_spawnattr_getflags F
+GLIBC_2.2.6 posix_spawnattr_getpgroup F
+GLIBC_2.2.6 posix_spawnattr_getschedparam F
+GLIBC_2.2.6 posix_spawnattr_getschedpolicy F
+GLIBC_2.2.6 posix_spawnattr_getsigdefault F
+GLIBC_2.2.6 posix_spawnattr_getsigmask F
+GLIBC_2.2.6 posix_spawnattr_init F
+GLIBC_2.2.6 posix_spawnattr_setflags F
+GLIBC_2.2.6 posix_spawnattr_setpgroup F
+GLIBC_2.2.6 posix_spawnattr_setschedparam F
+GLIBC_2.2.6 posix_spawnattr_setschedpolicy F
+GLIBC_2.2.6 posix_spawnattr_setsigdefault F
+GLIBC_2.2.6 posix_spawnattr_setsigmask F
+GLIBC_2.2.6 posix_spawnp F
+GLIBC_2.2.6 pread F
+GLIBC_2.2.6 pread64 F
+GLIBC_2.2.6 printf F
+GLIBC_2.2.6 printf_size F
+GLIBC_2.2.6 printf_size_info F
+GLIBC_2.2.6 profil F
+GLIBC_2.2.6 program_invocation_name D 0x4
+GLIBC_2.2.6 program_invocation_short_name D 0x4
+GLIBC_2.2.6 pselect F
+GLIBC_2.2.6 psignal F
+GLIBC_2.2.6 ptrace F
+GLIBC_2.2.6 ptsname F
+GLIBC_2.2.6 ptsname_r F
+GLIBC_2.2.6 putc F
+GLIBC_2.2.6 putc_unlocked F
+GLIBC_2.2.6 putchar F
+GLIBC_2.2.6 putchar_unlocked F
+GLIBC_2.2.6 putenv F
+GLIBC_2.2.6 putgrent F
+GLIBC_2.2.6 putmsg F
+GLIBC_2.2.6 putpmsg F
+GLIBC_2.2.6 putpwent F
+GLIBC_2.2.6 puts F
+GLIBC_2.2.6 putspent F
+GLIBC_2.2.6 pututline F
+GLIBC_2.2.6 pututxline F
+GLIBC_2.2.6 putw F
+GLIBC_2.2.6 putwc F
+GLIBC_2.2.6 putwc_unlocked F
+GLIBC_2.2.6 putwchar F
+GLIBC_2.2.6 putwchar_unlocked F
+GLIBC_2.2.6 pvalloc F
+GLIBC_2.2.6 pwrite F
+GLIBC_2.2.6 pwrite64 F
+GLIBC_2.2.6 qecvt F
+GLIBC_2.2.6 qecvt_r F
+GLIBC_2.2.6 qfcvt F
+GLIBC_2.2.6 qfcvt_r F
+GLIBC_2.2.6 qgcvt F
+GLIBC_2.2.6 qsort F
+GLIBC_2.2.6 raise F
+GLIBC_2.2.6 rand F
+GLIBC_2.2.6 rand_r F
+GLIBC_2.2.6 random F
+GLIBC_2.2.6 random_r F
+GLIBC_2.2.6 rawmemchr F
+GLIBC_2.2.6 rcmd F
+GLIBC_2.2.6 rcmd_af F
+GLIBC_2.2.6 re_comp F
+GLIBC_2.2.6 re_compile_fastmap F
+GLIBC_2.2.6 re_compile_pattern F
+GLIBC_2.2.6 re_exec F
+GLIBC_2.2.6 re_match F
+GLIBC_2.2.6 re_match_2 F
+GLIBC_2.2.6 re_max_failures D 0x4
+GLIBC_2.2.6 re_search F
+GLIBC_2.2.6 re_search_2 F
+GLIBC_2.2.6 re_set_registers F
+GLIBC_2.2.6 re_set_syntax F
+GLIBC_2.2.6 re_syntax_options D 0x4
+GLIBC_2.2.6 read F
+GLIBC_2.2.6 readdir F
+GLIBC_2.2.6 readdir64 F
+GLIBC_2.2.6 readdir64_r F
+GLIBC_2.2.6 readdir_r F
+GLIBC_2.2.6 readlink F
+GLIBC_2.2.6 readv F
+GLIBC_2.2.6 realloc F
+GLIBC_2.2.6 realpath F
+GLIBC_2.2.6 reboot F
+GLIBC_2.2.6 recv F
+GLIBC_2.2.6 recvfrom F
+GLIBC_2.2.6 recvmsg F
+GLIBC_2.2.6 regcomp F
+GLIBC_2.2.6 regerror F
+GLIBC_2.2.6 regexec F
+GLIBC_2.2.6 regfree F
+GLIBC_2.2.6 register_printf_function F
+GLIBC_2.2.6 registerrpc F
+GLIBC_2.2.6 remove F
+GLIBC_2.2.6 remque F
+GLIBC_2.2.6 rename F
+GLIBC_2.2.6 revoke F
+GLIBC_2.2.6 rewind F
+GLIBC_2.2.6 rewinddir F
+GLIBC_2.2.6 rexec F
+GLIBC_2.2.6 rexec_af F
+GLIBC_2.2.6 rexecoptions D 0x4
+GLIBC_2.2.6 rindex F
+GLIBC_2.2.6 rmdir F
+GLIBC_2.2.6 rpc_createerr D 0x10
+GLIBC_2.2.6 rpmatch F
+GLIBC_2.2.6 rresvport F
+GLIBC_2.2.6 rresvport_af F
+GLIBC_2.2.6 rtime F
+GLIBC_2.2.6 ruserok F
+GLIBC_2.2.6 ruserok_af F
+GLIBC_2.2.6 ruserpass F
+GLIBC_2.2.6 sbrk F
+GLIBC_2.2.6 scalbln F
+GLIBC_2.2.6 scalblnf F
+GLIBC_2.2.6 scalblnl F
+GLIBC_2.2.6 scalbn F
+GLIBC_2.2.6 scalbnf F
+GLIBC_2.2.6 scalbnl F
+GLIBC_2.2.6 scandir F
+GLIBC_2.2.6 scandir64 F
+GLIBC_2.2.6 scanf F
+GLIBC_2.2.6 sched_get_priority_max F
+GLIBC_2.2.6 sched_get_priority_min F
+GLIBC_2.2.6 sched_getparam F
+GLIBC_2.2.6 sched_getscheduler F
+GLIBC_2.2.6 sched_rr_get_interval F
+GLIBC_2.2.6 sched_setparam F
+GLIBC_2.2.6 sched_setscheduler F
+GLIBC_2.2.6 sched_yield F
+GLIBC_2.2.6 seed48 F
+GLIBC_2.2.6 seed48_r F
+GLIBC_2.2.6 seekdir F
+GLIBC_2.2.6 select F
+GLIBC_2.2.6 semctl F
+GLIBC_2.2.6 semget F
+GLIBC_2.2.6 semop F
+GLIBC_2.2.6 send F
+GLIBC_2.2.6 sendfile F
+GLIBC_2.2.6 sendmsg F
+GLIBC_2.2.6 sendto F
+GLIBC_2.2.6 setaliasent F
+GLIBC_2.2.6 setauth F
+GLIBC_2.2.6 setbuf F
+GLIBC_2.2.6 setbuffer F
+GLIBC_2.2.6 setcontext F
+GLIBC_2.2.6 setcrdir F
+GLIBC_2.2.6 setcttyid F
+GLIBC_2.2.6 setcwdir F
+GLIBC_2.2.6 setdomainname F
+GLIBC_2.2.6 setegid F
+GLIBC_2.2.6 setenv F
+GLIBC_2.2.6 seteuid F
+GLIBC_2.2.6 seteuids F
+GLIBC_2.2.6 setfsent F
+GLIBC_2.2.6 setgid F
+GLIBC_2.2.6 setgrent F
+GLIBC_2.2.6 setgroups F
+GLIBC_2.2.6 sethostent F
+GLIBC_2.2.6 sethostid F
+GLIBC_2.2.6 sethostname F
+GLIBC_2.2.6 setitimer F
+GLIBC_2.2.6 setjmp F
+GLIBC_2.2.6 setlinebuf F
+GLIBC_2.2.6 setlocale F
+GLIBC_2.2.6 setlogin F
+GLIBC_2.2.6 setlogmask F
+GLIBC_2.2.6 setmntent F
+GLIBC_2.2.6 setnetent F
+GLIBC_2.2.6 setnetgrent F
+GLIBC_2.2.6 setpgid F
+GLIBC_2.2.6 setpgrp F
+GLIBC_2.2.6 setpriority F
+GLIBC_2.2.6 setproc F
+GLIBC_2.2.6 setprotoent F
+GLIBC_2.2.6 setpwent F
+GLIBC_2.2.6 setregid F
+GLIBC_2.2.6 setreuid F
+GLIBC_2.2.6 setrlimit F
+GLIBC_2.2.6 setrlimit64 F
+GLIBC_2.2.6 setrpcent F
+GLIBC_2.2.6 setservent F
+GLIBC_2.2.6 setsid F
+GLIBC_2.2.6 setsockopt F
+GLIBC_2.2.6 setspent F
+GLIBC_2.2.6 setstate F
+GLIBC_2.2.6 setstate_r F
+GLIBC_2.2.6 settimeofday F
+GLIBC_2.2.6 setttyent F
+GLIBC_2.2.6 setuid F
+GLIBC_2.2.6 setusershell F
+GLIBC_2.2.6 setutent F
+GLIBC_2.2.6 setutxent F
+GLIBC_2.2.6 setvbuf F
+GLIBC_2.2.6 sgetspent F
+GLIBC_2.2.6 sgetspent_r F
+GLIBC_2.2.6 shmat F
+GLIBC_2.2.6 shmctl F
+GLIBC_2.2.6 shmdt F
+GLIBC_2.2.6 shmget F
+GLIBC_2.2.6 shutdown F
+GLIBC_2.2.6 sigaction F
+GLIBC_2.2.6 sigaddset F
+GLIBC_2.2.6 sigaltstack F
+GLIBC_2.2.6 sigandset F
+GLIBC_2.2.6 sigblock F
+GLIBC_2.2.6 sigdelset F
+GLIBC_2.2.6 sigemptyset F
+GLIBC_2.2.6 sigfillset F
+GLIBC_2.2.6 siggetmask F
+GLIBC_2.2.6 sighold F
+GLIBC_2.2.6 sigignore F
+GLIBC_2.2.6 siginterrupt F
+GLIBC_2.2.6 sigisemptyset F
+GLIBC_2.2.6 sigismember F
+GLIBC_2.2.6 siglongjmp F
+GLIBC_2.2.6 signal F
+GLIBC_2.2.6 sigorset F
+GLIBC_2.2.6 sigpause F
+GLIBC_2.2.6 sigpending F
+GLIBC_2.2.6 sigprocmask F
+GLIBC_2.2.6 sigqueue F
+GLIBC_2.2.6 sigrelse F
+GLIBC_2.2.6 sigreturn F
+GLIBC_2.2.6 sigset F
+GLIBC_2.2.6 sigsetmask F
+GLIBC_2.2.6 sigstack F
+GLIBC_2.2.6 sigsuspend F
+GLIBC_2.2.6 sigtimedwait F
+GLIBC_2.2.6 sigvec F
+GLIBC_2.2.6 sigwait F
+GLIBC_2.2.6 sigwaitinfo F
+GLIBC_2.2.6 sleep F
+GLIBC_2.2.6 snprintf F
+GLIBC_2.2.6 sockatmark F
+GLIBC_2.2.6 socket F
+GLIBC_2.2.6 socketpair F
+GLIBC_2.2.6 sprintf F
+GLIBC_2.2.6 sprofil F
+GLIBC_2.2.6 srand F
+GLIBC_2.2.6 srand48 F
+GLIBC_2.2.6 srand48_r F
+GLIBC_2.2.6 srandom F
+GLIBC_2.2.6 srandom_r F
+GLIBC_2.2.6 sscanf F
+GLIBC_2.2.6 ssignal F
+GLIBC_2.2.6 sstk F
+GLIBC_2.2.6 statfs F
+GLIBC_2.2.6 statfs64 F
+GLIBC_2.2.6 statvfs F
+GLIBC_2.2.6 statvfs64 F
+GLIBC_2.2.6 stderr D 0x4
+GLIBC_2.2.6 stdin D 0x4
+GLIBC_2.2.6 stdout D 0x4
+GLIBC_2.2.6 step F
+GLIBC_2.2.6 stime F
+GLIBC_2.2.6 stpcpy F
+GLIBC_2.2.6 stpncpy F
+GLIBC_2.2.6 strcasecmp F
+GLIBC_2.2.6 strcasestr F
+GLIBC_2.2.6 strcat F
+GLIBC_2.2.6 strchr F
+GLIBC_2.2.6 strchrnul F
+GLIBC_2.2.6 strcmp F
+GLIBC_2.2.6 strcoll F
+GLIBC_2.2.6 strcpy F
+GLIBC_2.2.6 strcspn F
+GLIBC_2.2.6 strdup F
+GLIBC_2.2.6 strerror F
+GLIBC_2.2.6 strerror_r F
+GLIBC_2.2.6 strfmon F
+GLIBC_2.2.6 strfry F
+GLIBC_2.2.6 strftime F
+GLIBC_2.2.6 strlen F
+GLIBC_2.2.6 strncasecmp F
+GLIBC_2.2.6 strncat F
+GLIBC_2.2.6 strncmp F
+GLIBC_2.2.6 strncpy F
+GLIBC_2.2.6 strndup F
+GLIBC_2.2.6 strnlen F
+GLIBC_2.2.6 strpbrk F
+GLIBC_2.2.6 strptime F
+GLIBC_2.2.6 strrchr F
+GLIBC_2.2.6 strsep F
+GLIBC_2.2.6 strsignal F
+GLIBC_2.2.6 strspn F
+GLIBC_2.2.6 strstr F
+GLIBC_2.2.6 strtod F
+GLIBC_2.2.6 strtof F
+GLIBC_2.2.6 strtoimax F
+GLIBC_2.2.6 strtok F
+GLIBC_2.2.6 strtok_r F
+GLIBC_2.2.6 strtol F
+GLIBC_2.2.6 strtold F
+GLIBC_2.2.6 strtoll F
+GLIBC_2.2.6 strtoq F
+GLIBC_2.2.6 strtoul F
+GLIBC_2.2.6 strtoull F
+GLIBC_2.2.6 strtoumax F
+GLIBC_2.2.6 strtouq F
+GLIBC_2.2.6 strverscmp F
+GLIBC_2.2.6 strxfrm F
+GLIBC_2.2.6 stty F
+GLIBC_2.2.6 svc_exit F
+GLIBC_2.2.6 svc_fdset D 0x20
+GLIBC_2.2.6 svc_getreq F
+GLIBC_2.2.6 svc_getreq_common F
+GLIBC_2.2.6 svc_getreq_poll F
+GLIBC_2.2.6 svc_getreqset F
+GLIBC_2.2.6 svc_max_pollfd D 0x4
+GLIBC_2.2.6 svc_pollfd D 0x4
+GLIBC_2.2.6 svc_register F
+GLIBC_2.2.6 svc_run F
+GLIBC_2.2.6 svc_sendreply F
+GLIBC_2.2.6 svc_unregister F
+GLIBC_2.2.6 svcauthdes_stats D 0xc
+GLIBC_2.2.6 svcerr_auth F
+GLIBC_2.2.6 svcerr_decode F
+GLIBC_2.2.6 svcerr_noproc F
+GLIBC_2.2.6 svcerr_noprog F
+GLIBC_2.2.6 svcerr_progvers F
+GLIBC_2.2.6 svcerr_systemerr F
+GLIBC_2.2.6 svcerr_weakauth F
+GLIBC_2.2.6 svcfd_create F
+GLIBC_2.2.6 svcraw_create F
+GLIBC_2.2.6 svctcp_create F
+GLIBC_2.2.6 svcudp_bufcreate F
+GLIBC_2.2.6 svcudp_create F
+GLIBC_2.2.6 svcudp_enablecache F
+GLIBC_2.2.6 svcunix_create F
+GLIBC_2.2.6 svcunixfd_create F
+GLIBC_2.2.6 swab F
+GLIBC_2.2.6 swapcontext F
+GLIBC_2.2.6 swprintf F
+GLIBC_2.2.6 swscanf F
+GLIBC_2.2.6 swtch F
+GLIBC_2.2.6 swtch_pri F
+GLIBC_2.2.6 symlink F
+GLIBC_2.2.6 sync F
+GLIBC_2.2.6 sys_sigabbrev D 0x84
+GLIBC_2.2.6 sys_siglist D 0x84
+GLIBC_2.2.6 syscall F
+GLIBC_2.2.6 sysconf F
+GLIBC_2.2.6 syslog F
+GLIBC_2.2.6 system F
+GLIBC_2.2.6 sysv_signal F
+GLIBC_2.2.6 task2pid F
+GLIBC_2.2.6 task_create F
+GLIBC_2.2.6 task_set_special_port F
+GLIBC_2.2.6 task_suspend F
+GLIBC_2.2.6 task_terminate F
+GLIBC_2.2.6 tcdrain F
+GLIBC_2.2.6 tcflow F
+GLIBC_2.2.6 tcflush F
+GLIBC_2.2.6 tcgetattr F
+GLIBC_2.2.6 tcgetpgrp F
+GLIBC_2.2.6 tcgetsid F
+GLIBC_2.2.6 tcsendbreak F
+GLIBC_2.2.6 tcsetattr F
+GLIBC_2.2.6 tcsetpgrp F
+GLIBC_2.2.6 tdelete F
+GLIBC_2.2.6 tdestroy F
+GLIBC_2.2.6 telldir F
+GLIBC_2.2.6 tempnam F
+GLIBC_2.2.6 textdomain F
+GLIBC_2.2.6 tfind F
+GLIBC_2.2.6 thread_depress_abort F
+GLIBC_2.2.6 thread_switch F
+GLIBC_2.2.6 time F
+GLIBC_2.2.6 timegm F
+GLIBC_2.2.6 timelocal F
+GLIBC_2.2.6 times F
+GLIBC_2.2.6 timezone D 0x4
+GLIBC_2.2.6 tmpfile F
+GLIBC_2.2.6 tmpfile64 F
+GLIBC_2.2.6 tmpnam F
+GLIBC_2.2.6 tmpnam_r F
+GLIBC_2.2.6 toascii F
+GLIBC_2.2.6 tolower F
+GLIBC_2.2.6 toupper F
+GLIBC_2.2.6 towctrans F
+GLIBC_2.2.6 towlower F
+GLIBC_2.2.6 towupper F
+GLIBC_2.2.6 tr_break F
+GLIBC_2.2.6 truncate F
+GLIBC_2.2.6 truncate64 F
+GLIBC_2.2.6 tsearch F
+GLIBC_2.2.6 ttyname F
+GLIBC_2.2.6 ttyname_r F
+GLIBC_2.2.6 ttyslot F
+GLIBC_2.2.6 twalk F
+GLIBC_2.2.6 tzname D 0x8
+GLIBC_2.2.6 tzset F
+GLIBC_2.2.6 ualarm F
+GLIBC_2.2.6 ulckpwdf F
+GLIBC_2.2.6 ulimit F
+GLIBC_2.2.6 umask F
+GLIBC_2.2.6 uname F
+GLIBC_2.2.6 ungetc F
+GLIBC_2.2.6 ungetwc F
+GLIBC_2.2.6 unlink F
+GLIBC_2.2.6 unlockpt F
+GLIBC_2.2.6 unsetenv F
+GLIBC_2.2.6 updwtmp F
+GLIBC_2.2.6 updwtmpx F
+GLIBC_2.2.6 user2netname F
+GLIBC_2.2.6 usleep F
+GLIBC_2.2.6 ustat F
+GLIBC_2.2.6 utime F
+GLIBC_2.2.6 utimes F
+GLIBC_2.2.6 utmpname F
+GLIBC_2.2.6 utmpxname F
+GLIBC_2.2.6 valloc F
+GLIBC_2.2.6 vasprintf F
+GLIBC_2.2.6 vdprintf F
+GLIBC_2.2.6 verr F
+GLIBC_2.2.6 verrx F
+GLIBC_2.2.6 versionsort F
+GLIBC_2.2.6 versionsort64 F
+GLIBC_2.2.6 vfork F
+GLIBC_2.2.6 vfprintf F
+GLIBC_2.2.6 vfscanf F
+GLIBC_2.2.6 vfwprintf F
+GLIBC_2.2.6 vfwscanf F
+GLIBC_2.2.6 vhangup F
+GLIBC_2.2.6 vlimit F
+GLIBC_2.2.6 vm_allocate F
+GLIBC_2.2.6 vm_deallocate F
+GLIBC_2.2.6 vm_map F
+GLIBC_2.2.6 vm_page_size D 0x4
+GLIBC_2.2.6 vpprintf F
+GLIBC_2.2.6 vprintf F
+GLIBC_2.2.6 vscanf F
+GLIBC_2.2.6 vsnprintf F
+GLIBC_2.2.6 vsprintf F
+GLIBC_2.2.6 vsscanf F
+GLIBC_2.2.6 vswprintf F
+GLIBC_2.2.6 vswscanf F
+GLIBC_2.2.6 vsyslog F
+GLIBC_2.2.6 vtimes F
+GLIBC_2.2.6 vwarn F
+GLIBC_2.2.6 vwarnx F
+GLIBC_2.2.6 vwprintf F
+GLIBC_2.2.6 vwscanf F
+GLIBC_2.2.6 wait F
+GLIBC_2.2.6 wait3 F
+GLIBC_2.2.6 wait4 F
+GLIBC_2.2.6 waitid F
+GLIBC_2.2.6 waitpid F
+GLIBC_2.2.6 warn F
+GLIBC_2.2.6 warnx F
+GLIBC_2.2.6 wcpcpy F
+GLIBC_2.2.6 wcpncpy F
+GLIBC_2.2.6 wcrtomb F
+GLIBC_2.2.6 wcscasecmp F
+GLIBC_2.2.6 wcscat F
+GLIBC_2.2.6 wcschr F
+GLIBC_2.2.6 wcschrnul F
+GLIBC_2.2.6 wcscmp F
+GLIBC_2.2.6 wcscoll F
+GLIBC_2.2.6 wcscpy F
+GLIBC_2.2.6 wcscspn F
+GLIBC_2.2.6 wcsdup F
+GLIBC_2.2.6 wcsftime F
+GLIBC_2.2.6 wcslen F
+GLIBC_2.2.6 wcsncasecmp F
+GLIBC_2.2.6 wcsncat F
+GLIBC_2.2.6 wcsncmp F
+GLIBC_2.2.6 wcsncpy F
+GLIBC_2.2.6 wcsnlen F
+GLIBC_2.2.6 wcsnrtombs F
+GLIBC_2.2.6 wcspbrk F
+GLIBC_2.2.6 wcsrchr F
+GLIBC_2.2.6 wcsrtombs F
+GLIBC_2.2.6 wcsspn F
+GLIBC_2.2.6 wcsstr F
+GLIBC_2.2.6 wcstod F
+GLIBC_2.2.6 wcstof F
+GLIBC_2.2.6 wcstoimax F
+GLIBC_2.2.6 wcstok F
+GLIBC_2.2.6 wcstol F
+GLIBC_2.2.6 wcstold F
+GLIBC_2.2.6 wcstoll F
+GLIBC_2.2.6 wcstombs F
+GLIBC_2.2.6 wcstoq F
+GLIBC_2.2.6 wcstoul F
+GLIBC_2.2.6 wcstoull F
+GLIBC_2.2.6 wcstoumax F
+GLIBC_2.2.6 wcstouq F
+GLIBC_2.2.6 wcswcs F
+GLIBC_2.2.6 wcswidth F
+GLIBC_2.2.6 wcsxfrm F
+GLIBC_2.2.6 wctob F
+GLIBC_2.2.6 wctomb F
+GLIBC_2.2.6 wctrans F
+GLIBC_2.2.6 wctype F
+GLIBC_2.2.6 wcwidth F
+GLIBC_2.2.6 wmemchr F
+GLIBC_2.2.6 wmemcmp F
+GLIBC_2.2.6 wmemcpy F
+GLIBC_2.2.6 wmemmove F
+GLIBC_2.2.6 wmempcpy F
+GLIBC_2.2.6 wmemset F
+GLIBC_2.2.6 wordexp F
+GLIBC_2.2.6 wordfree F
+GLIBC_2.2.6 wprintf F
+GLIBC_2.2.6 write F
+GLIBC_2.2.6 writev F
+GLIBC_2.2.6 wscanf F
+GLIBC_2.2.6 xdecrypt F
+GLIBC_2.2.6 xdr_accepted_reply F
+GLIBC_2.2.6 xdr_array F
+GLIBC_2.2.6 xdr_authdes_cred F
+GLIBC_2.2.6 xdr_authdes_verf F
+GLIBC_2.2.6 xdr_authunix_parms F
+GLIBC_2.2.6 xdr_bool F
+GLIBC_2.2.6 xdr_bytes F
+GLIBC_2.2.6 xdr_callhdr F
+GLIBC_2.2.6 xdr_callmsg F
+GLIBC_2.2.6 xdr_char F
+GLIBC_2.2.6 xdr_cryptkeyarg F
+GLIBC_2.2.6 xdr_cryptkeyarg2 F
+GLIBC_2.2.6 xdr_cryptkeyres F
+GLIBC_2.2.6 xdr_des_block F
+GLIBC_2.2.6 xdr_double F
+GLIBC_2.2.6 xdr_enum F
+GLIBC_2.2.6 xdr_float F
+GLIBC_2.2.6 xdr_free F
+GLIBC_2.2.6 xdr_getcredres F
+GLIBC_2.2.6 xdr_hyper F
+GLIBC_2.2.6 xdr_int F
+GLIBC_2.2.6 xdr_int16_t F
+GLIBC_2.2.6 xdr_int32_t F
+GLIBC_2.2.6 xdr_int64_t F
+GLIBC_2.2.6 xdr_int8_t F
+GLIBC_2.2.6 xdr_key_netstarg F
+GLIBC_2.2.6 xdr_key_netstres F
+GLIBC_2.2.6 xdr_keybuf F
+GLIBC_2.2.6 xdr_keystatus F
+GLIBC_2.2.6 xdr_long F
+GLIBC_2.2.6 xdr_longlong_t F
+GLIBC_2.2.6 xdr_netnamestr F
+GLIBC_2.2.6 xdr_netobj F
+GLIBC_2.2.6 xdr_opaque F
+GLIBC_2.2.6 xdr_opaque_auth F
+GLIBC_2.2.6 xdr_pmap F
+GLIBC_2.2.6 xdr_pmaplist F
+GLIBC_2.2.6 xdr_pointer F
+GLIBC_2.2.6 xdr_reference F
+GLIBC_2.2.6 xdr_rejected_reply F
+GLIBC_2.2.6 xdr_replymsg F
+GLIBC_2.2.6 xdr_rmtcall_args F
+GLIBC_2.2.6 xdr_rmtcallres F
+GLIBC_2.2.6 xdr_short F
+GLIBC_2.2.6 xdr_sizeof F
+GLIBC_2.2.6 xdr_string F
+GLIBC_2.2.6 xdr_u_char F
+GLIBC_2.2.6 xdr_u_hyper F
+GLIBC_2.2.6 xdr_u_int F
+GLIBC_2.2.6 xdr_u_long F
+GLIBC_2.2.6 xdr_u_longlong_t F
+GLIBC_2.2.6 xdr_u_short F
+GLIBC_2.2.6 xdr_uint16_t F
+GLIBC_2.2.6 xdr_uint32_t F
+GLIBC_2.2.6 xdr_uint64_t F
+GLIBC_2.2.6 xdr_uint8_t F
+GLIBC_2.2.6 xdr_union F
+GLIBC_2.2.6 xdr_unixcred F
+GLIBC_2.2.6 xdr_vector F
+GLIBC_2.2.6 xdr_void F
+GLIBC_2.2.6 xdr_wrapstring F
+GLIBC_2.2.6 xdrmem_create F
+GLIBC_2.2.6 xdrrec_create F
+GLIBC_2.2.6 xdrrec_endofrecord F
+GLIBC_2.2.6 xdrrec_eof F
+GLIBC_2.2.6 xdrrec_skiprecord F
+GLIBC_2.2.6 xdrstdio_create F
+GLIBC_2.2.6 xencrypt F
+GLIBC_2.2.6 xprt_register F
+GLIBC_2.2.6 xprt_unregister F
+GLIBC_2.21 __mach_host_self_ D 0x4
+GLIBC_2.21 __pthread_get_cleanup_stack F
+GLIBC_2.21 pthread_attr_destroy F
+GLIBC_2.21 pthread_attr_getdetachstate F
+GLIBC_2.21 pthread_attr_getinheritsched F
+GLIBC_2.21 pthread_attr_getschedparam F
+GLIBC_2.21 pthread_attr_getschedpolicy F
+GLIBC_2.21 pthread_attr_getscope F
+GLIBC_2.21 pthread_attr_init F
+GLIBC_2.21 pthread_attr_setdetachstate F
+GLIBC_2.21 pthread_attr_setinheritsched F
+GLIBC_2.21 pthread_attr_setschedparam F
+GLIBC_2.21 pthread_attr_setschedpolicy F
+GLIBC_2.21 pthread_attr_setscope F
+GLIBC_2.21 pthread_cond_broadcast F
+GLIBC_2.21 pthread_cond_destroy F
+GLIBC_2.21 pthread_cond_init F
+GLIBC_2.21 pthread_cond_signal F
+GLIBC_2.21 pthread_cond_timedwait F
+GLIBC_2.21 pthread_cond_wait F
+GLIBC_2.21 pthread_condattr_destroy F
+GLIBC_2.21 pthread_condattr_init F
+GLIBC_2.21 pthread_equal F
+GLIBC_2.21 pthread_exit F
+GLIBC_2.21 pthread_getschedparam F
+GLIBC_2.21 pthread_mutex_destroy F
+GLIBC_2.21 pthread_mutex_init F
+GLIBC_2.21 pthread_mutex_lock F
+GLIBC_2.21 pthread_mutex_unlock F
+GLIBC_2.21 pthread_self F
+GLIBC_2.21 pthread_setcancelstate F
+GLIBC_2.21 pthread_setcanceltype F
+GLIBC_2.21 pthread_setschedparam F
+GLIBC_2.22 __register_atfork F
+GLIBC_2.22 fmemopen F
+GLIBC_2.23 fts64_children F
+GLIBC_2.23 fts64_close F
+GLIBC_2.23 fts64_open F
+GLIBC_2.23 fts64_read F
+GLIBC_2.23 fts64_set F
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+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
+GLIBC_2.26 __strtof128_internal F
+GLIBC_2.26 __wcstof128_internal F
+GLIBC_2.26 _hurd_exec_paths F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.26 strfromf128 F
+GLIBC_2.26 strtof128 F
+GLIBC_2.26 strtof128_l F
+GLIBC_2.26 wcstof128 F
+GLIBC_2.26 wcstof128_l F
+GLIBC_2.27 __hurd_dfail F
+GLIBC_2.27 __hurd_sockfail F
+GLIBC_2.27 _hurd_fd_error F
+GLIBC_2.27 _hurd_fd_error_signal F
+GLIBC_2.27 _hurd_port_locked_set F
+GLIBC_2.27 _hurd_userlink_clear F
+GLIBC_2.27 _hurd_userlink_link F
+GLIBC_2.27 _hurd_userlink_unlink F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.3 __ctype_b_loc F
+GLIBC_2.3 __ctype_tolower_loc F
+GLIBC_2.3 __ctype_toupper_loc F
+GLIBC_2.3 __isctype F
+GLIBC_2.3 __strftime_l F
+GLIBC_2.3 __uselocale F
+GLIBC_2.3 __wcsftime_l F
+GLIBC_2.3 duplocale F
+GLIBC_2.3 fgetxattr F
+GLIBC_2.3 flistxattr F
+GLIBC_2.3 freeifaddrs F
+GLIBC_2.3 freelocale F
+GLIBC_2.3 fremovexattr F
+GLIBC_2.3 fsetxattr F
+GLIBC_2.3 futimes F
+GLIBC_2.3 getifaddrs F
+GLIBC_2.3 getxattr F
+GLIBC_2.3 isalnum_l F
+GLIBC_2.3 isalpha_l F
+GLIBC_2.3 isblank_l F
+GLIBC_2.3 iscntrl_l F
+GLIBC_2.3 isctype F
+GLIBC_2.3 isdigit_l F
+GLIBC_2.3 isgraph_l F
+GLIBC_2.3 islower_l F
+GLIBC_2.3 isprint_l F
+GLIBC_2.3 ispunct_l F
+GLIBC_2.3 isspace_l F
+GLIBC_2.3 isupper_l F
+GLIBC_2.3 iswalnum_l F
+GLIBC_2.3 iswalpha_l F
+GLIBC_2.3 iswblank_l F
+GLIBC_2.3 iswcntrl_l F
+GLIBC_2.3 iswctype_l F
+GLIBC_2.3 iswdigit_l F
+GLIBC_2.3 iswgraph_l F
+GLIBC_2.3 iswlower_l F
+GLIBC_2.3 iswprint_l F
+GLIBC_2.3 iswpunct_l F
+GLIBC_2.3 iswspace_l F
+GLIBC_2.3 iswupper_l F
+GLIBC_2.3 iswxdigit_l F
+GLIBC_2.3 isxdigit_l F
+GLIBC_2.3 lgetxattr F
+GLIBC_2.3 listxattr F
+GLIBC_2.3 llistxattr F
+GLIBC_2.3 lremovexattr F
+GLIBC_2.3 lsetxattr F
+GLIBC_2.3 lutimes F
+GLIBC_2.3 newlocale F
+GLIBC_2.3 nl_langinfo_l F
+GLIBC_2.3 realpath F
+GLIBC_2.3 removexattr F
+GLIBC_2.3 sendfile64 F
+GLIBC_2.3 setxattr F
+GLIBC_2.3 strcasecmp_l F
+GLIBC_2.3 strcoll_l F
+GLIBC_2.3 strfmon_l F
+GLIBC_2.3 strftime_l F
+GLIBC_2.3 strncasecmp_l F
+GLIBC_2.3 strtod_l F
+GLIBC_2.3 strtof_l F
+GLIBC_2.3 strtol_l F
+GLIBC_2.3 strtold_l F
+GLIBC_2.3 strtoll_l F
+GLIBC_2.3 strtoul_l F
+GLIBC_2.3 strtoull_l F
+GLIBC_2.3 strxfrm_l F
+GLIBC_2.3 tolower_l F
+GLIBC_2.3 toupper_l F
+GLIBC_2.3 towctrans_l F
+GLIBC_2.3 towlower_l F
+GLIBC_2.3 towupper_l F
+GLIBC_2.3 uselocale F
+GLIBC_2.3 wcscasecmp_l F
+GLIBC_2.3 wcscoll_l F
+GLIBC_2.3 wcsftime_l F
+GLIBC_2.3 wcsncasecmp_l F
+GLIBC_2.3 wcstod_l F
+GLIBC_2.3 wcstof_l F
+GLIBC_2.3 wcstol_l F
+GLIBC_2.3 wcstold_l F
+GLIBC_2.3 wcstoll_l F
+GLIBC_2.3 wcstoul_l F
+GLIBC_2.3 wcstoull_l F
+GLIBC_2.3 wcsxfrm_l F
+GLIBC_2.3 wctrans_l F
+GLIBC_2.3 wctype_l F
+GLIBC_2.3.2 getresgid F
+GLIBC_2.3.2 getresuid F
+GLIBC_2.3.2 lchmod F
+GLIBC_2.3.2 setresgid F
+GLIBC_2.3.2 setresuid F
+GLIBC_2.3.2 strptime_l F
+GLIBC_2.3.3 inet6_option_alloc F
+GLIBC_2.3.3 inet6_option_append F
+GLIBC_2.3.3 inet6_option_find F
+GLIBC_2.3.3 inet6_option_init F
+GLIBC_2.3.3 inet6_option_next F
+GLIBC_2.3.3 inet6_option_space F
+GLIBC_2.3.3 nftw F
+GLIBC_2.3.3 nftw64 F
+GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 remap_file_pages F
+GLIBC_2.3.3 sched_getaffinity F
+GLIBC_2.3.3 sched_setaffinity F
+GLIBC_2.3.3 semtimedop F
+GLIBC_2.3.4 __chk_fail F
+GLIBC_2.3.4 __fprintf_chk F
+GLIBC_2.3.4 __gets_chk F
+GLIBC_2.3.4 __memcpy_chk F
+GLIBC_2.3.4 __memmove_chk F
+GLIBC_2.3.4 __mempcpy_chk F
+GLIBC_2.3.4 __memset_chk F
+GLIBC_2.3.4 __printf_chk F
+GLIBC_2.3.4 __snprintf_chk F
+GLIBC_2.3.4 __sprintf_chk F
+GLIBC_2.3.4 __stpcpy_chk F
+GLIBC_2.3.4 __strcat_chk F
+GLIBC_2.3.4 __strcpy_chk F
+GLIBC_2.3.4 __strncat_chk F
+GLIBC_2.3.4 __strncpy_chk F
+GLIBC_2.3.4 __vfprintf_chk F
+GLIBC_2.3.4 __vprintf_chk F
+GLIBC_2.3.4 __vsnprintf_chk F
+GLIBC_2.3.4 __vsprintf_chk F
+GLIBC_2.3.4 __xpg_strerror_r F
+GLIBC_2.3.4 getipv4sourcefilter F
+GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 regexec F
+GLIBC_2.3.4 setipv4sourcefilter F
+GLIBC_2.3.4 setsourcefilter F
+GLIBC_2.3.4 xdr_quad_t F
+GLIBC_2.3.4 xdr_u_quad_t F
+GLIBC_2.4 __confstr_chk F
+GLIBC_2.4 __fgets_chk F
+GLIBC_2.4 __fgets_unlocked_chk F
+GLIBC_2.4 __fgetws_chk F
+GLIBC_2.4 __fgetws_unlocked_chk F
+GLIBC_2.4 __fwprintf_chk F
+GLIBC_2.4 __fxstatat F
+GLIBC_2.4 __fxstatat64 F
+GLIBC_2.4 __getcwd_chk F
+GLIBC_2.4 __getdomainname_chk F
+GLIBC_2.4 __getgroups_chk F
+GLIBC_2.4 __gethostname_chk F
+GLIBC_2.4 __getlogin_r_chk F
+GLIBC_2.4 __getwd_chk F
+GLIBC_2.4 __mbsnrtowcs_chk F
+GLIBC_2.4 __mbsrtowcs_chk F
+GLIBC_2.4 __mbstowcs_chk F
+GLIBC_2.4 __pread64_chk F
+GLIBC_2.4 __pread_chk F
+GLIBC_2.4 __ptsname_r_chk F
+GLIBC_2.4 __read_chk F
+GLIBC_2.4 __readlink_chk F
+GLIBC_2.4 __realpath_chk F
+GLIBC_2.4 __recv_chk F
+GLIBC_2.4 __recvfrom_chk F
+GLIBC_2.4 __stack_chk_fail F
+GLIBC_2.4 __stpncpy_chk F
+GLIBC_2.4 __swprintf_chk F
+GLIBC_2.4 __syslog_chk F
+GLIBC_2.4 __ttyname_r_chk F
+GLIBC_2.4 __vfwprintf_chk F
+GLIBC_2.4 __vswprintf_chk F
+GLIBC_2.4 __vsyslog_chk F
+GLIBC_2.4 __vwprintf_chk F
+GLIBC_2.4 __wcpcpy_chk F
+GLIBC_2.4 __wcpncpy_chk F
+GLIBC_2.4 __wcrtomb_chk F
+GLIBC_2.4 __wcscat_chk F
+GLIBC_2.4 __wcscpy_chk F
+GLIBC_2.4 __wcsncat_chk F
+GLIBC_2.4 __wcsncpy_chk F
+GLIBC_2.4 __wcsnrtombs_chk F
+GLIBC_2.4 __wcsrtombs_chk F
+GLIBC_2.4 __wcstombs_chk F
+GLIBC_2.4 __wctomb_chk F
+GLIBC_2.4 __wmemcpy_chk F
+GLIBC_2.4 __wmemmove_chk F
+GLIBC_2.4 __wmempcpy_chk F
+GLIBC_2.4 __wmemset_chk F
+GLIBC_2.4 __wprintf_chk F
+GLIBC_2.4 __xmknodat F
+GLIBC_2.4 eaccess F
+GLIBC_2.4 faccessat F
+GLIBC_2.4 fchmodat F
+GLIBC_2.4 fchownat F
+GLIBC_2.4 fdopendir F
+GLIBC_2.4 futimesat F
+GLIBC_2.4 linkat F
+GLIBC_2.4 mkdirat F
+GLIBC_2.4 mkfifoat F
+GLIBC_2.4 open_wmemstream F
+GLIBC_2.4 openat F
+GLIBC_2.4 openat64 F
+GLIBC_2.4 ppoll F
+GLIBC_2.4 readlinkat F
+GLIBC_2.4 renameat F
+GLIBC_2.4 symlinkat F
+GLIBC_2.4 unlinkat F
+GLIBC_2.5 __readlinkat_chk F
+GLIBC_2.5 inet6_opt_append F
+GLIBC_2.5 inet6_opt_find F
+GLIBC_2.5 inet6_opt_finish F
+GLIBC_2.5 inet6_opt_get_val F
+GLIBC_2.5 inet6_opt_init F
+GLIBC_2.5 inet6_opt_next F
+GLIBC_2.5 inet6_opt_set_val F
+GLIBC_2.5 inet6_rth_add F
+GLIBC_2.5 inet6_rth_getaddr F
+GLIBC_2.5 inet6_rth_init F
+GLIBC_2.5 inet6_rth_reverse F
+GLIBC_2.5 inet6_rth_segments F
+GLIBC_2.5 inet6_rth_space F
+GLIBC_2.6 __sched_cpucount F
+GLIBC_2.6 futimens F
+GLIBC_2.6 strerror_l F
+GLIBC_2.6 utimensat F
+GLIBC_2.7 __fread_chk F
+GLIBC_2.7 __fread_unlocked_chk F
+GLIBC_2.7 __isoc99_fscanf F
+GLIBC_2.7 __isoc99_fwscanf F
+GLIBC_2.7 __isoc99_scanf F
+GLIBC_2.7 __isoc99_sscanf F
+GLIBC_2.7 __isoc99_swscanf F
+GLIBC_2.7 __isoc99_vfscanf F
+GLIBC_2.7 __isoc99_vfwscanf F
+GLIBC_2.7 __isoc99_vscanf F
+GLIBC_2.7 __isoc99_vsscanf F
+GLIBC_2.7 __isoc99_vswscanf F
+GLIBC_2.7 __isoc99_vwscanf F
+GLIBC_2.7 __isoc99_wscanf F
+GLIBC_2.7 __open64_2 F
+GLIBC_2.7 __open_2 F
+GLIBC_2.7 __openat64_2 F
+GLIBC_2.7 __openat_2 F
+GLIBC_2.7 __sched_cpualloc F
+GLIBC_2.7 __sched_cpufree F
+GLIBC_2.7 mkostemp F
+GLIBC_2.7 mkostemp64 F
+GLIBC_2.8 __asprintf_chk F
+GLIBC_2.8 __dprintf_chk F
+GLIBC_2.8 __obstack_printf_chk F
+GLIBC_2.8 __obstack_vprintf_chk F
+GLIBC_2.8 __vasprintf_chk F
+GLIBC_2.8 __vdprintf_chk F
+GLIBC_2.8 qsort_r F
+GLIBC_2.9 dup3 F
+GLIBC_2.9 pipe2 F
+HURD_CTHREADS_0.3 __cthread_getspecific F
+HURD_CTHREADS_0.3 __cthread_keycreate F
+HURD_CTHREADS_0.3 __cthread_setspecific F
+HURD_CTHREADS_0.3 __mutex_init F
+HURD_CTHREADS_0.3 __mutex_lock F
+HURD_CTHREADS_0.3 __mutex_lock_solid F
+HURD_CTHREADS_0.3 __mutex_trylock F
+HURD_CTHREADS_0.3 __mutex_unlock F
+HURD_CTHREADS_0.3 __mutex_unlock_solid F
+HURD_CTHREADS_0.3 __spin_lock F
+HURD_CTHREADS_0.3 __spin_lock_init F
+HURD_CTHREADS_0.3 __spin_lock_solid F
+HURD_CTHREADS_0.3 __spin_try_lock F
+HURD_CTHREADS_0.3 __spin_unlock F
+HURD_CTHREADS_0.3 _cthread_exit_routine D 0x4
diff --git a/sysdeps/mach/hurd/i386/libcrypt.abilist b/sysdeps/mach/hurd/i386/libcrypt.abilist
new file mode 100644
index 0000000000..5cd9b78d1e
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/libcrypt.abilist
@@ -0,0 +1,7 @@
+GLIBC_2.2.6 crypt F
+GLIBC_2.2.6 crypt_r F
+GLIBC_2.2.6 encrypt F
+GLIBC_2.2.6 encrypt_r F
+GLIBC_2.2.6 fcrypt F
+GLIBC_2.2.6 setkey F
+GLIBC_2.2.6 setkey_r F
diff --git a/sysdeps/mach/hurd/i386/libdl.abilist b/sysdeps/mach/hurd/i386/libdl.abilist
new file mode 100644
index 0000000000..27d133bb7b
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/libdl.abilist
@@ -0,0 +1,9 @@
+GLIBC_2.2.6 dladdr F
+GLIBC_2.2.6 dlclose F
+GLIBC_2.2.6 dlerror F
+GLIBC_2.2.6 dlopen F
+GLIBC_2.2.6 dlsym F
+GLIBC_2.2.6 dlvsym F
+GLIBC_2.3.3 dladdr1 F
+GLIBC_2.3.3 dlinfo F
+GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/mach/hurd/i386/libm.abilist b/sysdeps/mach/hurd/i386/libm.abilist
new file mode 100644
index 0000000000..fd0a277bdc
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/libm.abilist
@@ -0,0 +1,1070 @@
+GLIBC_2.15 __acos_finite F
+GLIBC_2.15 __acosf_finite F
+GLIBC_2.15 __acosh_finite F
+GLIBC_2.15 __acoshf_finite F
+GLIBC_2.15 __acoshl_finite F
+GLIBC_2.15 __acosl_finite F
+GLIBC_2.15 __asin_finite F
+GLIBC_2.15 __asinf_finite F
+GLIBC_2.15 __asinl_finite F
+GLIBC_2.15 __atan2_finite F
+GLIBC_2.15 __atan2f_finite F
+GLIBC_2.15 __atan2l_finite F
+GLIBC_2.15 __atanh_finite F
+GLIBC_2.15 __atanhf_finite F
+GLIBC_2.15 __atanhl_finite F
+GLIBC_2.15 __cosh_finite F
+GLIBC_2.15 __coshf_finite F
+GLIBC_2.15 __coshl_finite F
+GLIBC_2.15 __exp10_finite F
+GLIBC_2.15 __exp10f_finite F
+GLIBC_2.15 __exp10l_finite F
+GLIBC_2.15 __exp2_finite F
+GLIBC_2.15 __exp2f_finite F
+GLIBC_2.15 __exp2l_finite F
+GLIBC_2.15 __exp_finite F
+GLIBC_2.15 __expf_finite F
+GLIBC_2.15 __expl_finite F
+GLIBC_2.15 __fmod_finite F
+GLIBC_2.15 __fmodf_finite F
+GLIBC_2.15 __fmodl_finite F
+GLIBC_2.15 __gamma_r_finite F
+GLIBC_2.15 __gammaf_r_finite F
+GLIBC_2.15 __gammal_r_finite F
+GLIBC_2.15 __hypot_finite F
+GLIBC_2.15 __hypotf_finite F
+GLIBC_2.15 __hypotl_finite F
+GLIBC_2.15 __j0_finite F
+GLIBC_2.15 __j0f_finite F
+GLIBC_2.15 __j0l_finite F
+GLIBC_2.15 __j1_finite F
+GLIBC_2.15 __j1f_finite F
+GLIBC_2.15 __j1l_finite F
+GLIBC_2.15 __jn_finite F
+GLIBC_2.15 __jnf_finite F
+GLIBC_2.15 __jnl_finite F
+GLIBC_2.15 __lgamma_r_finite F
+GLIBC_2.15 __lgammaf_r_finite F
+GLIBC_2.15 __lgammal_r_finite F
+GLIBC_2.15 __log10_finite F
+GLIBC_2.15 __log10f_finite F
+GLIBC_2.15 __log10l_finite F
+GLIBC_2.15 __log2_finite F
+GLIBC_2.15 __log2f_finite F
+GLIBC_2.15 __log2l_finite F
+GLIBC_2.15 __log_finite F
+GLIBC_2.15 __logf_finite F
+GLIBC_2.15 __logl_finite F
+GLIBC_2.15 __pow_finite F
+GLIBC_2.15 __powf_finite F
+GLIBC_2.15 __powl_finite F
+GLIBC_2.15 __remainder_finite F
+GLIBC_2.15 __remainderf_finite F
+GLIBC_2.15 __remainderl_finite F
+GLIBC_2.15 __scalb_finite F
+GLIBC_2.15 __scalbf_finite F
+GLIBC_2.15 __scalbl_finite F
+GLIBC_2.15 __sinh_finite F
+GLIBC_2.15 __sinhf_finite F
+GLIBC_2.15 __sinhl_finite F
+GLIBC_2.15 __sqrt_finite F
+GLIBC_2.15 __sqrtf_finite F
+GLIBC_2.15 __sqrtl_finite F
+GLIBC_2.15 __y0_finite F
+GLIBC_2.15 __y0f_finite F
+GLIBC_2.15 __y0l_finite F
+GLIBC_2.15 __y1_finite F
+GLIBC_2.15 __y1f_finite F
+GLIBC_2.15 __y1l_finite F
+GLIBC_2.15 __yn_finite F
+GLIBC_2.15 __ynf_finite F
+GLIBC_2.15 __ynl_finite F
+GLIBC_2.18 __issignaling F
+GLIBC_2.18 __issignalingf F
+GLIBC_2.18 __issignalingl F
+GLIBC_2.2.6 _LIB_VERSION D 0x4
+GLIBC_2.2.6 __clog10 F
+GLIBC_2.2.6 __clog10f F
+GLIBC_2.2.6 __clog10l F
+GLIBC_2.2.6 __expl F
+GLIBC_2.2.6 __expm1l F
+GLIBC_2.2.6 __finite F
+GLIBC_2.2.6 __finitef F
+GLIBC_2.2.6 __finitel F
+GLIBC_2.2.6 __fpclassify F
+GLIBC_2.2.6 __fpclassifyf F
+GLIBC_2.2.6 __fpclassifyl F
+GLIBC_2.2.6 __signbit F
+GLIBC_2.2.6 __signbitf F
+GLIBC_2.2.6 __signbitl F
+GLIBC_2.2.6 acos F
+GLIBC_2.2.6 acosf F
+GLIBC_2.2.6 acosh F
+GLIBC_2.2.6 acoshf F
+GLIBC_2.2.6 acoshl F
+GLIBC_2.2.6 acosl F
+GLIBC_2.2.6 asin F
+GLIBC_2.2.6 asinf F
+GLIBC_2.2.6 asinh F
+GLIBC_2.2.6 asinhf F
+GLIBC_2.2.6 asinhl F
+GLIBC_2.2.6 asinl F
+GLIBC_2.2.6 atan F
+GLIBC_2.2.6 atan2 F
+GLIBC_2.2.6 atan2f F
+GLIBC_2.2.6 atan2l F
+GLIBC_2.2.6 atanf F
+GLIBC_2.2.6 atanh F
+GLIBC_2.2.6 atanhf F
+GLIBC_2.2.6 atanhl F
+GLIBC_2.2.6 atanl F
+GLIBC_2.2.6 cabs F
+GLIBC_2.2.6 cabsf F
+GLIBC_2.2.6 cabsl F
+GLIBC_2.2.6 cacos F
+GLIBC_2.2.6 cacosf F
+GLIBC_2.2.6 cacosh F
+GLIBC_2.2.6 cacoshf F
+GLIBC_2.2.6 cacoshl F
+GLIBC_2.2.6 cacosl F
+GLIBC_2.2.6 carg F
+GLIBC_2.2.6 cargf F
+GLIBC_2.2.6 cargl F
+GLIBC_2.2.6 casin F
+GLIBC_2.2.6 casinf F
+GLIBC_2.2.6 casinh F
+GLIBC_2.2.6 casinhf F
+GLIBC_2.2.6 casinhl F
+GLIBC_2.2.6 casinl F
+GLIBC_2.2.6 catan F
+GLIBC_2.2.6 catanf F
+GLIBC_2.2.6 catanh F
+GLIBC_2.2.6 catanhf F
+GLIBC_2.2.6 catanhl F
+GLIBC_2.2.6 catanl F
+GLIBC_2.2.6 cbrt F
+GLIBC_2.2.6 cbrtf F
+GLIBC_2.2.6 cbrtl F
+GLIBC_2.2.6 ccos F
+GLIBC_2.2.6 ccosf F
+GLIBC_2.2.6 ccosh F
+GLIBC_2.2.6 ccoshf F
+GLIBC_2.2.6 ccoshl F
+GLIBC_2.2.6 ccosl F
+GLIBC_2.2.6 ceil F
+GLIBC_2.2.6 ceilf F
+GLIBC_2.2.6 ceill F
+GLIBC_2.2.6 cexp F
+GLIBC_2.2.6 cexpf F
+GLIBC_2.2.6 cexpl F
+GLIBC_2.2.6 cimag F
+GLIBC_2.2.6 cimagf F
+GLIBC_2.2.6 cimagl F
+GLIBC_2.2.6 clog F
+GLIBC_2.2.6 clog10 F
+GLIBC_2.2.6 clog10f F
+GLIBC_2.2.6 clog10l F
+GLIBC_2.2.6 clogf F
+GLIBC_2.2.6 clogl F
+GLIBC_2.2.6 conj F
+GLIBC_2.2.6 conjf F
+GLIBC_2.2.6 conjl F
+GLIBC_2.2.6 copysign F
+GLIBC_2.2.6 copysignf F
+GLIBC_2.2.6 copysignl F
+GLIBC_2.2.6 cos F
+GLIBC_2.2.6 cosf F
+GLIBC_2.2.6 cosh F
+GLIBC_2.2.6 coshf F
+GLIBC_2.2.6 coshl F
+GLIBC_2.2.6 cosl F
+GLIBC_2.2.6 cpow F
+GLIBC_2.2.6 cpowf F
+GLIBC_2.2.6 cpowl F
+GLIBC_2.2.6 cproj F
+GLIBC_2.2.6 cprojf F
+GLIBC_2.2.6 cprojl F
+GLIBC_2.2.6 creal F
+GLIBC_2.2.6 crealf F
+GLIBC_2.2.6 creall F
+GLIBC_2.2.6 csin F
+GLIBC_2.2.6 csinf F
+GLIBC_2.2.6 csinh F
+GLIBC_2.2.6 csinhf F
+GLIBC_2.2.6 csinhl F
+GLIBC_2.2.6 csinl F
+GLIBC_2.2.6 csqrt F
+GLIBC_2.2.6 csqrtf F
+GLIBC_2.2.6 csqrtl F
+GLIBC_2.2.6 ctan F
+GLIBC_2.2.6 ctanf F
+GLIBC_2.2.6 ctanh F
+GLIBC_2.2.6 ctanhf F
+GLIBC_2.2.6 ctanhl F
+GLIBC_2.2.6 ctanl F
+GLIBC_2.2.6 drem F
+GLIBC_2.2.6 dremf F
+GLIBC_2.2.6 dreml F
+GLIBC_2.2.6 erf F
+GLIBC_2.2.6 erfc F
+GLIBC_2.2.6 erfcf F
+GLIBC_2.2.6 erfcl F
+GLIBC_2.2.6 erff F
+GLIBC_2.2.6 erfl F
+GLIBC_2.2.6 exp F
+GLIBC_2.2.6 exp10 F
+GLIBC_2.2.6 exp10f F
+GLIBC_2.2.6 exp10l F
+GLIBC_2.2.6 exp2 F
+GLIBC_2.2.6 exp2f F
+GLIBC_2.2.6 exp2l F
+GLIBC_2.2.6 expf F
+GLIBC_2.2.6 expl F
+GLIBC_2.2.6 expm1 F
+GLIBC_2.2.6 expm1f F
+GLIBC_2.2.6 expm1l F
+GLIBC_2.2.6 fabs F
+GLIBC_2.2.6 fabsf F
+GLIBC_2.2.6 fabsl F
+GLIBC_2.2.6 fdim F
+GLIBC_2.2.6 fdimf F
+GLIBC_2.2.6 fdiml F
+GLIBC_2.2.6 feclearexcept F
+GLIBC_2.2.6 fedisableexcept F
+GLIBC_2.2.6 feenableexcept F
+GLIBC_2.2.6 fegetenv F
+GLIBC_2.2.6 fegetexcept F
+GLIBC_2.2.6 fegetexceptflag F
+GLIBC_2.2.6 fegetround F
+GLIBC_2.2.6 feholdexcept F
+GLIBC_2.2.6 feraiseexcept F
+GLIBC_2.2.6 fesetenv F
+GLIBC_2.2.6 fesetexceptflag F
+GLIBC_2.2.6 fesetround F
+GLIBC_2.2.6 fetestexcept F
+GLIBC_2.2.6 feupdateenv F
+GLIBC_2.2.6 finite F
+GLIBC_2.2.6 finitef F
+GLIBC_2.2.6 finitel F
+GLIBC_2.2.6 floor F
+GLIBC_2.2.6 floorf F
+GLIBC_2.2.6 floorl F
+GLIBC_2.2.6 fma F
+GLIBC_2.2.6 fmaf F
+GLIBC_2.2.6 fmal F
+GLIBC_2.2.6 fmax F
+GLIBC_2.2.6 fmaxf F
+GLIBC_2.2.6 fmaxl F
+GLIBC_2.2.6 fmin F
+GLIBC_2.2.6 fminf F
+GLIBC_2.2.6 fminl F
+GLIBC_2.2.6 fmod F
+GLIBC_2.2.6 fmodf F
+GLIBC_2.2.6 fmodl F
+GLIBC_2.2.6 frexp F
+GLIBC_2.2.6 frexpf F
+GLIBC_2.2.6 frexpl F
+GLIBC_2.2.6 gamma F
+GLIBC_2.2.6 gammaf F
+GLIBC_2.2.6 gammal F
+GLIBC_2.2.6 hypot F
+GLIBC_2.2.6 hypotf F
+GLIBC_2.2.6 hypotl F
+GLIBC_2.2.6 ilogb F
+GLIBC_2.2.6 ilogbf F
+GLIBC_2.2.6 ilogbl F
+GLIBC_2.2.6 j0 F
+GLIBC_2.2.6 j0f F
+GLIBC_2.2.6 j0l F
+GLIBC_2.2.6 j1 F
+GLIBC_2.2.6 j1f F
+GLIBC_2.2.6 j1l F
+GLIBC_2.2.6 jn F
+GLIBC_2.2.6 jnf F
+GLIBC_2.2.6 jnl F
+GLIBC_2.2.6 ldexp F
+GLIBC_2.2.6 ldexpf F
+GLIBC_2.2.6 ldexpl F
+GLIBC_2.2.6 lgamma F
+GLIBC_2.2.6 lgamma_r F
+GLIBC_2.2.6 lgammaf F
+GLIBC_2.2.6 lgammaf_r F
+GLIBC_2.2.6 lgammal F
+GLIBC_2.2.6 lgammal_r F
+GLIBC_2.2.6 llrint F
+GLIBC_2.2.6 llrintf F
+GLIBC_2.2.6 llrintl F
+GLIBC_2.2.6 llround F
+GLIBC_2.2.6 llroundf F
+GLIBC_2.2.6 llroundl F
+GLIBC_2.2.6 log F
+GLIBC_2.2.6 log10 F
+GLIBC_2.2.6 log10f F
+GLIBC_2.2.6 log10l F
+GLIBC_2.2.6 log1p F
+GLIBC_2.2.6 log1pf F
+GLIBC_2.2.6 log1pl F
+GLIBC_2.2.6 log2 F
+GLIBC_2.2.6 log2f F
+GLIBC_2.2.6 log2l F
+GLIBC_2.2.6 logb F
+GLIBC_2.2.6 logbf F
+GLIBC_2.2.6 logbl F
+GLIBC_2.2.6 logf F
+GLIBC_2.2.6 logl F
+GLIBC_2.2.6 lrint F
+GLIBC_2.2.6 lrintf F
+GLIBC_2.2.6 lrintl F
+GLIBC_2.2.6 lround F
+GLIBC_2.2.6 lroundf F
+GLIBC_2.2.6 lroundl F
+GLIBC_2.2.6 matherr F
+GLIBC_2.2.6 modf F
+GLIBC_2.2.6 modff F
+GLIBC_2.2.6 modfl F
+GLIBC_2.2.6 nan F
+GLIBC_2.2.6 nanf F
+GLIBC_2.2.6 nanl F
+GLIBC_2.2.6 nearbyint F
+GLIBC_2.2.6 nearbyintf F
+GLIBC_2.2.6 nearbyintl F
+GLIBC_2.2.6 nextafter F
+GLIBC_2.2.6 nextafterf F
+GLIBC_2.2.6 nextafterl F
+GLIBC_2.2.6 nexttoward F
+GLIBC_2.2.6 nexttowardf F
+GLIBC_2.2.6 nexttowardl F
+GLIBC_2.2.6 pow F
+GLIBC_2.2.6 pow10 F
+GLIBC_2.2.6 pow10f F
+GLIBC_2.2.6 pow10l F
+GLIBC_2.2.6 powf F
+GLIBC_2.2.6 powl F
+GLIBC_2.2.6 remainder F
+GLIBC_2.2.6 remainderf F
+GLIBC_2.2.6 remainderl F
+GLIBC_2.2.6 remquo F
+GLIBC_2.2.6 remquof F
+GLIBC_2.2.6 remquol F
+GLIBC_2.2.6 rint F
+GLIBC_2.2.6 rintf F
+GLIBC_2.2.6 rintl F
+GLIBC_2.2.6 round F
+GLIBC_2.2.6 roundf F
+GLIBC_2.2.6 roundl F
+GLIBC_2.2.6 scalb F
+GLIBC_2.2.6 scalbf F
+GLIBC_2.2.6 scalbl F
+GLIBC_2.2.6 scalbln F
+GLIBC_2.2.6 scalblnf F
+GLIBC_2.2.6 scalblnl F
+GLIBC_2.2.6 scalbn F
+GLIBC_2.2.6 scalbnf F
+GLIBC_2.2.6 scalbnl F
+GLIBC_2.2.6 signgam D 0x4
+GLIBC_2.2.6 significand F
+GLIBC_2.2.6 significandf F
+GLIBC_2.2.6 significandl F
+GLIBC_2.2.6 sin F
+GLIBC_2.2.6 sincos F
+GLIBC_2.2.6 sincosf F
+GLIBC_2.2.6 sincosl F
+GLIBC_2.2.6 sinf F
+GLIBC_2.2.6 sinh F
+GLIBC_2.2.6 sinhf F
+GLIBC_2.2.6 sinhl F
+GLIBC_2.2.6 sinl F
+GLIBC_2.2.6 sqrt F
+GLIBC_2.2.6 sqrtf F
+GLIBC_2.2.6 sqrtl F
+GLIBC_2.2.6 tan F
+GLIBC_2.2.6 tanf F
+GLIBC_2.2.6 tanh F
+GLIBC_2.2.6 tanhf F
+GLIBC_2.2.6 tanhl F
+GLIBC_2.2.6 tanl F
+GLIBC_2.2.6 tgamma F
+GLIBC_2.2.6 tgammaf F
+GLIBC_2.2.6 tgammal F
+GLIBC_2.2.6 trunc F
+GLIBC_2.2.6 truncf F
+GLIBC_2.2.6 truncl F
+GLIBC_2.2.6 y0 F
+GLIBC_2.2.6 y0f F
+GLIBC_2.2.6 y0l F
+GLIBC_2.2.6 y1 F
+GLIBC_2.2.6 y1f F
+GLIBC_2.2.6 y1l F
+GLIBC_2.2.6 yn F
+GLIBC_2.2.6 ynf F
+GLIBC_2.2.6 ynl F
+GLIBC_2.23 __signgam D 0x4
+GLIBC_2.23 lgamma F
+GLIBC_2.23 lgammaf F
+GLIBC_2.23 lgammal F
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.26 __acosf128_finite F
+GLIBC_2.26 __acoshf128_finite F
+GLIBC_2.26 __asinf128_finite F
+GLIBC_2.26 __atan2f128_finite F
+GLIBC_2.26 __atanhf128_finite F
+GLIBC_2.26 __coshf128_finite F
+GLIBC_2.26 __exp10f128_finite F
+GLIBC_2.26 __exp2f128_finite F
+GLIBC_2.26 __expf128_finite F
+GLIBC_2.26 __finitef128 F
+GLIBC_2.26 __fmodf128_finite F
+GLIBC_2.26 __fpclassifyf128 F
+GLIBC_2.26 __gammaf128_r_finite F
+GLIBC_2.26 __hypotf128_finite F
+GLIBC_2.26 __iseqsigf128 F
+GLIBC_2.26 __isinff128 F
+GLIBC_2.26 __isnanf128 F
+GLIBC_2.26 __issignalingf128 F
+GLIBC_2.26 __j0f128_finite F
+GLIBC_2.26 __j1f128_finite F
+GLIBC_2.26 __jnf128_finite F
+GLIBC_2.26 __lgammaf128_r_finite F
+GLIBC_2.26 __log10f128_finite F
+GLIBC_2.26 __log2f128_finite F
+GLIBC_2.26 __logf128_finite F
+GLIBC_2.26 __powf128_finite F
+GLIBC_2.26 __remainderf128_finite F
+GLIBC_2.26 __signbitf128 F
+GLIBC_2.26 __sinhf128_finite F
+GLIBC_2.26 __sqrtf128_finite F
+GLIBC_2.26 __y0f128_finite F
+GLIBC_2.26 __y1f128_finite F
+GLIBC_2.26 __ynf128_finite F
+GLIBC_2.26 acosf128 F
+GLIBC_2.26 acoshf128 F
+GLIBC_2.26 asinf128 F
+GLIBC_2.26 asinhf128 F
+GLIBC_2.26 atan2f128 F
+GLIBC_2.26 atanf128 F
+GLIBC_2.26 atanhf128 F
+GLIBC_2.26 cabsf128 F
+GLIBC_2.26 cacosf128 F
+GLIBC_2.26 cacoshf128 F
+GLIBC_2.26 canonicalizef128 F
+GLIBC_2.26 cargf128 F
+GLIBC_2.26 casinf128 F
+GLIBC_2.26 casinhf128 F
+GLIBC_2.26 catanf128 F
+GLIBC_2.26 catanhf128 F
+GLIBC_2.26 cbrtf128 F
+GLIBC_2.26 ccosf128 F
+GLIBC_2.26 ccoshf128 F
+GLIBC_2.26 ceilf128 F
+GLIBC_2.26 cexpf128 F
+GLIBC_2.26 cimagf128 F
+GLIBC_2.26 clog10f128 F
+GLIBC_2.26 clogf128 F
+GLIBC_2.26 conjf128 F
+GLIBC_2.26 copysignf128 F
+GLIBC_2.26 cosf128 F
+GLIBC_2.26 coshf128 F
+GLIBC_2.26 cpowf128 F
+GLIBC_2.26 cprojf128 F
+GLIBC_2.26 crealf128 F
+GLIBC_2.26 csinf128 F
+GLIBC_2.26 csinhf128 F
+GLIBC_2.26 csqrtf128 F
+GLIBC_2.26 ctanf128 F
+GLIBC_2.26 ctanhf128 F
+GLIBC_2.26 erfcf128 F
+GLIBC_2.26 erff128 F
+GLIBC_2.26 exp10f128 F
+GLIBC_2.26 exp2f128 F
+GLIBC_2.26 expf128 F
+GLIBC_2.26 expm1f128 F
+GLIBC_2.26 fabsf128 F
+GLIBC_2.26 fdimf128 F
+GLIBC_2.26 floorf128 F
+GLIBC_2.26 fmaf128 F
+GLIBC_2.26 fmaxf128 F
+GLIBC_2.26 fmaxmagf128 F
+GLIBC_2.26 fminf128 F
+GLIBC_2.26 fminmagf128 F
+GLIBC_2.26 fmodf128 F
+GLIBC_2.26 frexpf128 F
+GLIBC_2.26 fromfpf128 F
+GLIBC_2.26 fromfpxf128 F
+GLIBC_2.26 getpayloadf128 F
+GLIBC_2.26 hypotf128 F
+GLIBC_2.26 ilogbf128 F
+GLIBC_2.26 j0f128 F
+GLIBC_2.26 j1f128 F
+GLIBC_2.26 jnf128 F
+GLIBC_2.26 ldexpf128 F
+GLIBC_2.26 lgammaf128 F
+GLIBC_2.26 lgammaf128_r F
+GLIBC_2.26 llogbf128 F
+GLIBC_2.26 llrintf128 F
+GLIBC_2.26 llroundf128 F
+GLIBC_2.26 log10f128 F
+GLIBC_2.26 log1pf128 F
+GLIBC_2.26 log2f128 F
+GLIBC_2.26 logbf128 F
+GLIBC_2.26 logf128 F
+GLIBC_2.26 lrintf128 F
+GLIBC_2.26 lroundf128 F
+GLIBC_2.26 modff128 F
+GLIBC_2.26 nanf128 F
+GLIBC_2.26 nearbyintf128 F
+GLIBC_2.26 nextafterf128 F
+GLIBC_2.26 nextdownf128 F
+GLIBC_2.26 nextupf128 F
+GLIBC_2.26 powf128 F
+GLIBC_2.26 remainderf128 F
+GLIBC_2.26 remquof128 F
+GLIBC_2.26 rintf128 F
+GLIBC_2.26 roundevenf128 F
+GLIBC_2.26 roundf128 F
+GLIBC_2.26 scalblnf128 F
+GLIBC_2.26 scalbnf128 F
+GLIBC_2.26 setpayloadf128 F
+GLIBC_2.26 setpayloadsigf128 F
+GLIBC_2.26 sincosf128 F
+GLIBC_2.26 sinf128 F
+GLIBC_2.26 sinhf128 F
+GLIBC_2.26 sqrtf128 F
+GLIBC_2.26 tanf128 F
+GLIBC_2.26 tanhf128 F
+GLIBC_2.26 tgammaf128 F
+GLIBC_2.26 totalorderf128 F
+GLIBC_2.26 totalordermagf128 F
+GLIBC_2.26 truncf128 F
+GLIBC_2.26 ufromfpf128 F
+GLIBC_2.26 ufromfpxf128 F
+GLIBC_2.26 y0f128 F
+GLIBC_2.26 y1f128 F
+GLIBC_2.26 ynf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/mach/hurd/i386/libnsl.abilist b/sysdeps/mach/hurd/i386/libnsl.abilist
new file mode 100644
index 0000000000..c3979162d3
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/libnsl.abilist
@@ -0,0 +1,121 @@
+GLIBC_2.2.6 __free_fdresult F
+GLIBC_2.2.6 __nis_default_access F
+GLIBC_2.2.6 __nis_default_group F
+GLIBC_2.2.6 __nis_default_owner F
+GLIBC_2.2.6 __nis_default_ttl F
+GLIBC_2.2.6 __nis_finddirectory F
+GLIBC_2.2.6 __nis_hash F
+GLIBC_2.2.6 __nisbind_connect F
+GLIBC_2.2.6 __nisbind_create F
+GLIBC_2.2.6 __nisbind_destroy F
+GLIBC_2.2.6 __nisbind_next F
+GLIBC_2.2.6 __yp_check F
+GLIBC_2.2.6 nis_add F
+GLIBC_2.2.6 nis_add_entry F
+GLIBC_2.2.6 nis_addmember F
+GLIBC_2.2.6 nis_checkpoint F
+GLIBC_2.2.6 nis_clone_directory F
+GLIBC_2.2.6 nis_clone_object F
+GLIBC_2.2.6 nis_clone_result F
+GLIBC_2.2.6 nis_creategroup F
+GLIBC_2.2.6 nis_destroy_object F
+GLIBC_2.2.6 nis_destroygroup F
+GLIBC_2.2.6 nis_dir_cmp F
+GLIBC_2.2.6 nis_domain_of F
+GLIBC_2.2.6 nis_domain_of_r F
+GLIBC_2.2.6 nis_first_entry F
+GLIBC_2.2.6 nis_free_directory F
+GLIBC_2.2.6 nis_free_object F
+GLIBC_2.2.6 nis_free_request F
+GLIBC_2.2.6 nis_freenames F
+GLIBC_2.2.6 nis_freeresult F
+GLIBC_2.2.6 nis_freeservlist F
+GLIBC_2.2.6 nis_freetags F
+GLIBC_2.2.6 nis_getnames F
+GLIBC_2.2.6 nis_getservlist F
+GLIBC_2.2.6 nis_ismember F
+GLIBC_2.2.6 nis_leaf_of F
+GLIBC_2.2.6 nis_leaf_of_r F
+GLIBC_2.2.6 nis_lerror F
+GLIBC_2.2.6 nis_list F
+GLIBC_2.2.6 nis_local_directory F
+GLIBC_2.2.6 nis_local_group F
+GLIBC_2.2.6 nis_local_host F
+GLIBC_2.2.6 nis_local_principal F
+GLIBC_2.2.6 nis_lookup F
+GLIBC_2.2.6 nis_mkdir F
+GLIBC_2.2.6 nis_modify F
+GLIBC_2.2.6 nis_modify_entry F
+GLIBC_2.2.6 nis_name_of F
+GLIBC_2.2.6 nis_name_of_r F
+GLIBC_2.2.6 nis_next_entry F
+GLIBC_2.2.6 nis_perror F
+GLIBC_2.2.6 nis_ping F
+GLIBC_2.2.6 nis_print_directory F
+GLIBC_2.2.6 nis_print_entry F
+GLIBC_2.2.6 nis_print_group F
+GLIBC_2.2.6 nis_print_group_entry F
+GLIBC_2.2.6 nis_print_link F
+GLIBC_2.2.6 nis_print_object F
+GLIBC_2.2.6 nis_print_result F
+GLIBC_2.2.6 nis_print_rights F
+GLIBC_2.2.6 nis_print_table F
+GLIBC_2.2.6 nis_read_obj F
+GLIBC_2.2.6 nis_remove F
+GLIBC_2.2.6 nis_remove_entry F
+GLIBC_2.2.6 nis_removemember F
+GLIBC_2.2.6 nis_rmdir F
+GLIBC_2.2.6 nis_servstate F
+GLIBC_2.2.6 nis_sperrno F
+GLIBC_2.2.6 nis_sperror F
+GLIBC_2.2.6 nis_sperror_r F
+GLIBC_2.2.6 nis_stats F
+GLIBC_2.2.6 nis_verifygroup F
+GLIBC_2.2.6 nis_write_obj F
+GLIBC_2.2.6 readColdStartFile F
+GLIBC_2.2.6 writeColdStartFile F
+GLIBC_2.2.6 xdr_cback_data F
+GLIBC_2.2.6 xdr_domainname F
+GLIBC_2.2.6 xdr_keydat F
+GLIBC_2.2.6 xdr_mapname F
+GLIBC_2.2.6 xdr_obj_p F
+GLIBC_2.2.6 xdr_peername F
+GLIBC_2.2.6 xdr_valdat F
+GLIBC_2.2.6 xdr_yp_buf F
+GLIBC_2.2.6 xdr_ypall F
+GLIBC_2.2.6 xdr_ypbind_binding F
+GLIBC_2.2.6 xdr_ypbind_resp F
+GLIBC_2.2.6 xdr_ypbind_resptype F
+GLIBC_2.2.6 xdr_ypbind_setdom F
+GLIBC_2.2.6 xdr_ypdelete_args F
+GLIBC_2.2.6 xdr_ypmap_parms F
+GLIBC_2.2.6 xdr_ypmaplist F
+GLIBC_2.2.6 xdr_yppush_status F
+GLIBC_2.2.6 xdr_yppushresp_xfr F
+GLIBC_2.2.6 xdr_ypreq_key F
+GLIBC_2.2.6 xdr_ypreq_nokey F
+GLIBC_2.2.6 xdr_ypreq_xfr F
+GLIBC_2.2.6 xdr_ypresp_all F
+GLIBC_2.2.6 xdr_ypresp_key_val F
+GLIBC_2.2.6 xdr_ypresp_maplist F
+GLIBC_2.2.6 xdr_ypresp_master F
+GLIBC_2.2.6 xdr_ypresp_order F
+GLIBC_2.2.6 xdr_ypresp_val F
+GLIBC_2.2.6 xdr_ypresp_xfr F
+GLIBC_2.2.6 xdr_ypstat F
+GLIBC_2.2.6 xdr_ypupdate_args F
+GLIBC_2.2.6 xdr_ypxfrstat F
+GLIBC_2.2.6 yp_all F
+GLIBC_2.2.6 yp_bind F
+GLIBC_2.2.6 yp_first F
+GLIBC_2.2.6 yp_get_default_domain F
+GLIBC_2.2.6 yp_maplist F
+GLIBC_2.2.6 yp_master F
+GLIBC_2.2.6 yp_match F
+GLIBC_2.2.6 yp_next F
+GLIBC_2.2.6 yp_order F
+GLIBC_2.2.6 yp_unbind F
+GLIBC_2.2.6 yp_update F
+GLIBC_2.2.6 ypbinderr_string F
+GLIBC_2.2.6 yperr_string F
+GLIBC_2.2.6 ypprot_err F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
new file mode 100644
index 0000000000..4c7d06d073
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -0,0 +1,149 @@
+GLIBC_2.12 __mutex_lock_solid F
+GLIBC_2.12 __mutex_unlock_solid F
+GLIBC_2.12 __pthread_get_cleanup_stack F
+GLIBC_2.12 __pthread_key_create F
+GLIBC_2.12 __pthread_kill F
+GLIBC_2.12 __pthread_mutex_transfer_np F
+GLIBC_2.12 __pthread_self F
+GLIBC_2.12 __pthread_spin_destroy F
+GLIBC_2.12 __pthread_spin_init F
+GLIBC_2.12 __pthread_spin_lock F
+GLIBC_2.12 __pthread_spin_trylock F
+GLIBC_2.12 __pthread_spin_unlock F
+GLIBC_2.12 _cthread_init_routine D 0x4
+GLIBC_2.12 _cthreads_flockfile F
+GLIBC_2.12 _cthreads_ftrylockfile F
+GLIBC_2.12 _cthreads_funlockfile F
+GLIBC_2.12 _pthread_mutex_destroy F
+GLIBC_2.12 _pthread_mutex_init F
+GLIBC_2.12 _pthread_mutex_lock F
+GLIBC_2.12 _pthread_mutex_trylock F
+GLIBC_2.12 _pthread_mutex_unlock F
+GLIBC_2.12 _pthread_rwlock_destroy F
+GLIBC_2.12 _pthread_rwlock_init F
+GLIBC_2.12 _pthread_spin_lock F
+GLIBC_2.12 cthread_detach F
+GLIBC_2.12 cthread_fork F
+GLIBC_2.12 cthread_getspecific F
+GLIBC_2.12 cthread_keycreate F
+GLIBC_2.12 cthread_setspecific F
+GLIBC_2.12 flockfile F
+GLIBC_2.12 ftrylockfile F
+GLIBC_2.12 funlockfile F
+GLIBC_2.12 pthread_atfork F
+GLIBC_2.12 pthread_attr_destroy F
+GLIBC_2.12 pthread_attr_getdetachstate F
+GLIBC_2.12 pthread_attr_getguardsize F
+GLIBC_2.12 pthread_attr_getinheritsched F
+GLIBC_2.12 pthread_attr_getschedparam F
+GLIBC_2.12 pthread_attr_getschedpolicy F
+GLIBC_2.12 pthread_attr_getscope F
+GLIBC_2.12 pthread_attr_getstack F
+GLIBC_2.12 pthread_attr_getstackaddr F
+GLIBC_2.12 pthread_attr_getstacksize F
+GLIBC_2.12 pthread_attr_init F
+GLIBC_2.12 pthread_attr_setdetachstate F
+GLIBC_2.12 pthread_attr_setguardsize F
+GLIBC_2.12 pthread_attr_setinheritsched F
+GLIBC_2.12 pthread_attr_setschedparam F
+GLIBC_2.12 pthread_attr_setschedpolicy F
+GLIBC_2.12 pthread_attr_setscope F
+GLIBC_2.12 pthread_attr_setstack F
+GLIBC_2.12 pthread_attr_setstackaddr F
+GLIBC_2.12 pthread_attr_setstacksize F
+GLIBC_2.12 pthread_barrier_destroy F
+GLIBC_2.12 pthread_barrier_init F
+GLIBC_2.12 pthread_barrier_wait F
+GLIBC_2.12 pthread_barrierattr_destroy F
+GLIBC_2.12 pthread_barrierattr_getpshared F
+GLIBC_2.12 pthread_barrierattr_init F
+GLIBC_2.12 pthread_barrierattr_setpshared F
+GLIBC_2.12 pthread_cancel F
+GLIBC_2.12 pthread_cond_broadcast F
+GLIBC_2.12 pthread_cond_destroy F
+GLIBC_2.12 pthread_cond_init F
+GLIBC_2.12 pthread_cond_signal F
+GLIBC_2.12 pthread_cond_timedwait F
+GLIBC_2.12 pthread_cond_wait F
+GLIBC_2.12 pthread_condattr_destroy F
+GLIBC_2.12 pthread_condattr_getclock F
+GLIBC_2.12 pthread_condattr_getpshared F
+GLIBC_2.12 pthread_condattr_init F
+GLIBC_2.12 pthread_condattr_setclock F
+GLIBC_2.12 pthread_condattr_setpshared F
+GLIBC_2.12 pthread_create F
+GLIBC_2.12 pthread_detach F
+GLIBC_2.12 pthread_equal F
+GLIBC_2.12 pthread_exit F
+GLIBC_2.12 pthread_getattr_np F
+GLIBC_2.12 pthread_getconcurrency F
+GLIBC_2.12 pthread_getcpuclockid F
+GLIBC_2.12 pthread_getschedparam F
+GLIBC_2.12 pthread_getspecific F
+GLIBC_2.12 pthread_join F
+GLIBC_2.12 pthread_key_create F
+GLIBC_2.12 pthread_key_delete F
+GLIBC_2.12 pthread_kill F
+GLIBC_2.12 pthread_mutex_destroy F
+GLIBC_2.12 pthread_mutex_getprioceiling F
+GLIBC_2.12 pthread_mutex_init F
+GLIBC_2.12 pthread_mutex_lock F
+GLIBC_2.12 pthread_mutex_setprioceiling F
+GLIBC_2.12 pthread_mutex_timedlock F
+GLIBC_2.12 pthread_mutex_transfer_np F
+GLIBC_2.12 pthread_mutex_trylock F
+GLIBC_2.12 pthread_mutex_unlock F
+GLIBC_2.12 pthread_mutexattr_destroy F
+GLIBC_2.12 pthread_mutexattr_getprioceiling F
+GLIBC_2.12 pthread_mutexattr_getprotocol F
+GLIBC_2.12 pthread_mutexattr_getpshared F
+GLIBC_2.12 pthread_mutexattr_gettype F
+GLIBC_2.12 pthread_mutexattr_init F
+GLIBC_2.12 pthread_mutexattr_setprioceiling F
+GLIBC_2.12 pthread_mutexattr_setprotocol F
+GLIBC_2.12 pthread_mutexattr_setpshared F
+GLIBC_2.12 pthread_mutexattr_settype F
+GLIBC_2.12 pthread_once F
+GLIBC_2.12 pthread_rwlock_destroy F
+GLIBC_2.12 pthread_rwlock_init F
+GLIBC_2.12 pthread_rwlock_rdlock F
+GLIBC_2.12 pthread_rwlock_timedrdlock F
+GLIBC_2.12 pthread_rwlock_timedwrlock F
+GLIBC_2.12 pthread_rwlock_tryrdlock F
+GLIBC_2.12 pthread_rwlock_trywrlock F
+GLIBC_2.12 pthread_rwlock_unlock F
+GLIBC_2.12 pthread_rwlock_wrlock F
+GLIBC_2.12 pthread_rwlockattr_destroy F
+GLIBC_2.12 pthread_rwlockattr_getpshared F
+GLIBC_2.12 pthread_rwlockattr_init F
+GLIBC_2.12 pthread_rwlockattr_setpshared F
+GLIBC_2.12 pthread_self F
+GLIBC_2.12 pthread_setcancelstate F
+GLIBC_2.12 pthread_setcanceltype F
+GLIBC_2.12 pthread_setconcurrency F
+GLIBC_2.12 pthread_setschedparam F
+GLIBC_2.12 pthread_setschedprio F
+GLIBC_2.12 pthread_setspecific F
+GLIBC_2.12 pthread_sigmask F
+GLIBC_2.12 pthread_spin_destroy F
+GLIBC_2.12 pthread_spin_init F
+GLIBC_2.12 pthread_spin_lock F
+GLIBC_2.12 pthread_spin_trylock F
+GLIBC_2.12 pthread_spin_unlock F
+GLIBC_2.12 pthread_testcancel F
+GLIBC_2.12 pthread_yield F
+GLIBC_2.12 sem_close F
+GLIBC_2.12 sem_destroy F
+GLIBC_2.12 sem_getvalue F
+GLIBC_2.12 sem_init F
+GLIBC_2.12 sem_open F
+GLIBC_2.12 sem_post F
+GLIBC_2.12 sem_timedwait F
+GLIBC_2.12 sem_trywait F
+GLIBC_2.12 sem_unlink F
+GLIBC_2.12 sem_wait F
+GLIBC_2.2.6 _IO_flockfile F
+GLIBC_2.2.6 _IO_ftrylockfile F
+GLIBC_2.2.6 _IO_funlockfile F
+GLIBC_2.21 pthread_hurd_cond_timedwait_np F
+GLIBC_2.21 pthread_hurd_cond_wait_np F
diff --git a/sysdeps/mach/hurd/i386/libresolv.abilist b/sysdeps/mach/hurd/i386/libresolv.abilist
new file mode 100644
index 0000000000..e662651c8e
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/libresolv.abilist
@@ -0,0 +1,91 @@
+GLIBC_2.2.6 __b64_ntop F
+GLIBC_2.2.6 __b64_pton F
+GLIBC_2.2.6 __dn_comp F
+GLIBC_2.2.6 __dn_count_labels F
+GLIBC_2.2.6 __dn_expand F
+GLIBC_2.2.6 __dn_skipname F
+GLIBC_2.2.6 __fp_nquery F
+GLIBC_2.2.6 __fp_query F
+GLIBC_2.2.6 __fp_resstat F
+GLIBC_2.2.6 __hostalias F
+GLIBC_2.2.6 __loc_aton F
+GLIBC_2.2.6 __loc_ntoa F
+GLIBC_2.2.6 __p_cdname F
+GLIBC_2.2.6 __p_cdnname F
+GLIBC_2.2.6 __p_class F
+GLIBC_2.2.6 __p_class_syms D 0x54
+GLIBC_2.2.6 __p_fqname F
+GLIBC_2.2.6 __p_fqnname F
+GLIBC_2.2.6 __p_option F
+GLIBC_2.2.6 __p_query F
+GLIBC_2.2.6 __p_secstodate F
+GLIBC_2.2.6 __p_time F
+GLIBC_2.2.6 __p_type F
+GLIBC_2.2.6 __p_type_syms D 0x228
+GLIBC_2.2.6 __putlong F
+GLIBC_2.2.6 __putshort F
+GLIBC_2.2.6 __res_close F
+GLIBC_2.2.6 __res_dnok F
+GLIBC_2.2.6 __res_hnok F
+GLIBC_2.2.6 __res_hostalias F
+GLIBC_2.2.6 __res_isourserver F
+GLIBC_2.2.6 __res_mailok F
+GLIBC_2.2.6 __res_mkquery F
+GLIBC_2.2.6 __res_nameinquery F
+GLIBC_2.2.6 __res_nmkquery F
+GLIBC_2.2.6 __res_nquery F
+GLIBC_2.2.6 __res_nquerydomain F
+GLIBC_2.2.6 __res_nsearch F
+GLIBC_2.2.6 __res_nsend F
+GLIBC_2.2.6 __res_ownok F
+GLIBC_2.2.6 __res_queriesmatch F
+GLIBC_2.2.6 __res_query F
+GLIBC_2.2.6 __res_querydomain F
+GLIBC_2.2.6 __res_search F
+GLIBC_2.2.6 __res_send F
+GLIBC_2.2.6 __sym_ntop F
+GLIBC_2.2.6 __sym_ntos F
+GLIBC_2.2.6 __sym_ston F
+GLIBC_2.2.6 _gethtbyaddr F
+GLIBC_2.2.6 _gethtbyname F
+GLIBC_2.2.6 _gethtbyname2 F
+GLIBC_2.2.6 _gethtent F
+GLIBC_2.2.6 _getlong F
+GLIBC_2.2.6 _getshort F
+GLIBC_2.2.6 _res_opcodes D 0x40
+GLIBC_2.2.6 _sethtent F
+GLIBC_2.2.6 inet_net_ntop F
+GLIBC_2.2.6 inet_net_pton F
+GLIBC_2.2.6 inet_neta F
+GLIBC_2.2.6 res_gethostbyaddr F
+GLIBC_2.2.6 res_gethostbyname F
+GLIBC_2.2.6 res_gethostbyname2 F
+GLIBC_2.2.6 res_send_setqhook F
+GLIBC_2.2.6 res_send_setrhook F
+GLIBC_2.3.2 __p_rcode F
+GLIBC_2.9 ns_datetosecs F
+GLIBC_2.9 ns_format_ttl F
+GLIBC_2.9 ns_get16 F
+GLIBC_2.9 ns_get32 F
+GLIBC_2.9 ns_initparse F
+GLIBC_2.9 ns_makecanon F
+GLIBC_2.9 ns_msg_getflag F
+GLIBC_2.9 ns_name_compress F
+GLIBC_2.9 ns_name_ntol F
+GLIBC_2.9 ns_name_ntop F
+GLIBC_2.9 ns_name_pack F
+GLIBC_2.9 ns_name_pton F
+GLIBC_2.9 ns_name_rollback F
+GLIBC_2.9 ns_name_skip F
+GLIBC_2.9 ns_name_uncompress F
+GLIBC_2.9 ns_name_unpack F
+GLIBC_2.9 ns_parse_ttl F
+GLIBC_2.9 ns_parserr F
+GLIBC_2.9 ns_put16 F
+GLIBC_2.9 ns_put32 F
+GLIBC_2.9 ns_samedomain F
+GLIBC_2.9 ns_samename F
+GLIBC_2.9 ns_skiprr F
+GLIBC_2.9 ns_sprintrr F
+GLIBC_2.9 ns_sprintrrf F
+GLIBC_2.9 ns_subdomain F
diff --git a/sysdeps/mach/hurd/i386/librt.abilist b/sysdeps/mach/hurd/i386/librt.abilist
new file mode 100644
index 0000000000..d5fe32b3a9
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/librt.abilist
@@ -0,0 +1,42 @@
+GLIBC_2.2.6 aio_cancel F
+GLIBC_2.2.6 aio_cancel64 F
+GLIBC_2.2.6 aio_error F
+GLIBC_2.2.6 aio_error64 F
+GLIBC_2.2.6 aio_fsync F
+GLIBC_2.2.6 aio_fsync64 F
+GLIBC_2.2.6 aio_init F
+GLIBC_2.2.6 aio_read F
+GLIBC_2.2.6 aio_read64 F
+GLIBC_2.2.6 aio_return F
+GLIBC_2.2.6 aio_return64 F
+GLIBC_2.2.6 aio_suspend F
+GLIBC_2.2.6 aio_suspend64 F
+GLIBC_2.2.6 aio_write F
+GLIBC_2.2.6 aio_write64 F
+GLIBC_2.2.6 clock_getcpuclockid F
+GLIBC_2.2.6 clock_getres F
+GLIBC_2.2.6 clock_gettime F
+GLIBC_2.2.6 clock_nanosleep F
+GLIBC_2.2.6 clock_settime F
+GLIBC_2.2.6 lio_listio F
+GLIBC_2.2.6 lio_listio64 F
+GLIBC_2.2.6 shm_open F
+GLIBC_2.2.6 shm_unlink F
+GLIBC_2.2.6 timer_create F
+GLIBC_2.2.6 timer_delete F
+GLIBC_2.2.6 timer_getoverrun F
+GLIBC_2.2.6 timer_gettime F
+GLIBC_2.2.6 timer_settime F
+GLIBC_2.3.4 mq_close F
+GLIBC_2.3.4 mq_getattr F
+GLIBC_2.3.4 mq_notify F
+GLIBC_2.3.4 mq_open F
+GLIBC_2.3.4 mq_receive F
+GLIBC_2.3.4 mq_send F
+GLIBC_2.3.4 mq_setattr F
+GLIBC_2.3.4 mq_timedreceive F
+GLIBC_2.3.4 mq_timedsend F
+GLIBC_2.3.4 mq_unlink F
+GLIBC_2.4 lio_listio F
+GLIBC_2.4 lio_listio64 F
+GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/mach/hurd/i386/libutil.abilist b/sysdeps/mach/hurd/i386/libutil.abilist
new file mode 100644
index 0000000000..1dd59e0afb
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/libutil.abilist
@@ -0,0 +1,6 @@
+GLIBC_2.2.6 forkpty F
+GLIBC_2.2.6 login F
+GLIBC_2.2.6 login_tty F
+GLIBC_2.2.6 logout F
+GLIBC_2.2.6 logwtmp F
+GLIBC_2.2.6 openpty F
diff --git a/sysdeps/mach/hurd/i386/localplt.data b/sysdeps/mach/hurd/i386/localplt.data
new file mode 100644
index 0000000000..a5b5241b84
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/localplt.data
@@ -0,0 +1,64 @@
+# See scripts/check-localplt.awk for how this file is processed.
+# PLT use is required for the malloc family and for matherr because
+# users can define their own functions and have library internals call them.
+# Linker in binutils 2.26 and newer consolidates R_X86_64_JUMP_SLOT
+# relocation with R_386_GLOB_DAT relocation against the same symbol.
+libc.so: calloc + REL R_386_GLOB_DAT
+libc.so: free + REL R_386_GLOB_DAT
+libc.so: malloc + REL R_386_GLOB_DAT
+libc.so: memalign + REL R_386_GLOB_DAT
+libc.so: realloc + REL R_386_GLOB_DAT
+libm.so: matherr + REL R_386_GLOB_DAT
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
+ld.so: malloc + REL R_386_GLOB_DAT
+ld.so: calloc + REL R_386_GLOB_DAT
+ld.so: realloc + REL R_386_GLOB_DAT
+ld.so: free + REL R_386_GLOB_DAT
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error + REL R_386_GLOB_DAT
+ld.so: _dl_catch_error + REL R_386_GLOB_DAT
+ld.so: _dl_signal_exception + REL R_386_GLOB_DAT
+ld.so: _dl_catch_exception + REL R_386_GLOB_DAT
+# The dynamic linker has its own versions of basic functions for initial loading
+# of shared libraries. These need to be overriden by libc once loaded.
+ld.so: __open ?
+ld.so: __open64
+ld.so: __close
+ld.so: __read
+ld.so: __write
+ld.so: __writev
+ld.so: __libc_lseek64
+ld.so: __mmap
+ld.so: __fxstat64
+ld.so: __xstat64
+#ld.so: __access
+ld.so: __access_noerrno
+ld.so: __getpid
+#ld.so: __getcwd
+ld.so: __sbrk
+ld.so: __strtoul_internal
+#ld.so: _exit
+ld.so: abort
+ld.so: _hurd_intr_rpc_mach_msg
+ld.so: __errno_location
+# rtld_hidden is currently disabled to avoid having to special-case the
+# functions above which do need a PLT. These are thus currently expected.
+ld.so: _dl_allocate_tls
+ld.so: _dl_allocate_tls_init
+ld.so: _dl_exception_create
+ld.so: _dl_exception_create_format
+ld.so: _dl_exception_free
+ld.so: _dl_find_dso_for_object
+ld.so: _dl_init_first
+ld.so: _dl_mcount
+ld.so: ___tls_get_addr
+ld.so: __tunable_get_val
+#
+# These should ideally be avoided, but is currently difficult
+libc.so: siglongjmp ?
+libc.so: longjmp ?
+# This is from lseek.c
+libc.so: __libc_lseek64 ?
+# This is through cleanup_region_start from vfprintf.c
+libc.so: _IO_funlockfile ?
diff --git a/sysdeps/mach/hurd/i386/longjmp-ts.c b/sysdeps/mach/hurd/i386/longjmp-ts.c
index ce2871e25e..37ac78ce5d 100644
--- a/sysdeps/mach/hurd/i386/longjmp-ts.c
+++ b/sysdeps/mach/hurd/i386/longjmp-ts.c
@@ -1,5 +1,5 @@
/* Perform a `longjmp' on a Mach thread_state. i386 version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/i386/sigcontextinfo.h b/sysdeps/mach/hurd/i386/sigcontextinfo.h
index ff03b7a8bf..836ecb227f 100644
--- a/sysdeps/mach/hurd/i386/sigcontextinfo.h
+++ b/sysdeps/mach/hurd/i386/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software 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,9 +16,4 @@
<http://www.gnu.org/licenses/>. */
#define SIGCONTEXT struct sigcontext
-#define SIGCONTEXT_EXTRA_ARGS
#define GET_PC(ctx) ((void *) (ctx).sc_eip)
-#define GET_FRAME(ctx) ((void *) (ctx).sc_ebp)
-#define GET_STACK(ctx) ((void *) (ctx).sc_uesp)
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/mach/hurd/i386/signal-defines.sym b/sysdeps/mach/hurd/i386/signal-defines.sym
index 9521bd723c..e42bbbe061 100644
--- a/sysdeps/mach/hurd/i386/signal-defines.sym
+++ b/sysdeps/mach/hurd/i386/signal-defines.sym
@@ -5,6 +5,6 @@
HURD_SIGSTATE__SIGALTSTACK__OFFSET offsetof(struct hurd_sigstate, sigaltstack)
-SIGALTSTACK__SS_SP__OFFSET offsetof(struct sigaltstack, ss_sp)
-SIGALTSTACK__SS_SIZE__OFFSET offsetof(struct sigaltstack, ss_size)
-SIGALTSTACK__SS_FLAGS__OFFSET offsetof(struct sigaltstack, ss_flags)
+SIGALTSTACK__SS_SP__OFFSET offsetof(stack_t, ss_sp)
+SIGALTSTACK__SS_SIZE__OFFSET offsetof(stack_t, ss_size)
+SIGALTSTACK__SS_FLAGS__OFFSET offsetof(stack_t, ss_flags)
diff --git a/sysdeps/mach/hurd/i386/sigreturn.c b/sysdeps/mach/hurd/i386/sigreturn.c
index 8285f33556..07633e17c8 100644
--- a/sysdeps/mach/hurd/i386/sigreturn.c
+++ b/sysdeps/mach/hurd/i386/sigreturn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -68,7 +68,7 @@ __sigreturn (struct sigcontext *scp)
if (scp->sc_onstack)
{
- ss->sigaltstack.ss_flags &= ~SS_ONSTACK; /* XXX threadvars */
+ ss->sigaltstack.ss_flags &= ~SS_ONSTACK;
/* XXX cannot unlock until off sigstack */
abort ();
}
@@ -77,8 +77,7 @@ __sigreturn (struct sigcontext *scp)
/* Destroy the MiG reply port used by the signal handler, and restore the
reply port in use by the thread when interrupted. */
- reply_port =
- (mach_port_t *) __hurd_threadvar_location (_HURD_THREADVAR_MIG_REPLY);
+ reply_port = &__hurd_local_reply_port;
if (*reply_port)
{
mach_port_t port = *reply_port;
diff --git a/sysdeps/mach/hurd/i386/static-start.S b/sysdeps/mach/hurd/i386/static-start.S
index 320191a1a5..1df95a0a18 100644
--- a/sysdeps/mach/hurd/i386/static-start.S
+++ b/sysdeps/mach/hurd/i386/static-start.S
@@ -1,5 +1,5 @@
/* Startup code for statically linked Hurd/i386 binaries.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/i386/sys/io.h b/sysdeps/mach/hurd/i386/sys/io.h
index b0d20b6bee..81165f00a1 100644
--- a/sysdeps/mach/hurd/i386/sys/io.h
+++ b/sysdeps/mach/hurd/i386/sys/io.h
@@ -1,5 +1,5 @@
/* Access to hardware i/o ports. GNU/x86 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h
index fe0622868b..da1f7b78da 100644
--- a/sysdeps/mach/hurd/i386/tls.h
+++ b/sysdeps/mach/hurd/i386/tls.h
@@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. Hurd/i386 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,17 +25,7 @@
#ifndef __ASSEMBLER__
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
-
+# include <dl-dtv.h>
/* Type of the TCB. */
typedef struct
@@ -53,9 +43,27 @@ typedef struct
void *__private_tm[4];
/* GCC split stack support. */
void *__private_ss;
+
+ /* Keep this field last, so fields above can continue being compatible with
+ the Linux version. */
+ mach_port_t reply_port; /* This thread's reply port. */
+ struct hurd_sigstate *_hurd_sigstate;
} tcbhead_t;
#endif
+/* Return tcbhead_t from a TLS segment descriptor. */
+# define HURD_DESC_TLS(desc) \
+ ({ \
+ (tcbhead_t *) ( (desc->low_word >> 16) \
+ | ((desc->high_word & 0xff) << 16) \
+ | (desc->high_word & 0xff000000)); \
+ })
+
+/* Return 1 if TLS is not initialized yet. */
+#define __LIBC_NO_TLS() \
+ ({ unsigned short ds, gs; \
+ asm ("movw %%ds,%w0; movw %%gs,%w1" : "=q" (ds), "=q" (gs)); \
+ __builtin_expect (ds == gs, 0); })
/* The TCB can have any size and the memory following the address the
thread pointer points to is unspecified. Allocate the TCB there. */
@@ -81,8 +89,6 @@ typedef struct
# define __i386_set_gdt(thr, sel, desc) ((void) (thr), (void) (sel), (void) (desc), MIG_BAD_ID)
# endif
-#define __i386_selector_is_ldt(sel) (!!((sel) & 4))
-
# include <errno.h>
# include <assert.h>
@@ -99,41 +105,49 @@ typedef struct
| (((unsigned int) (tcb)) & 0xff000000) /* base 24..31 */ \
}
+# define HURD_SEL_LDT(sel) (__builtin_expect ((sel) & 4, 0))
static inline const char * __attribute__ ((unused))
_hurd_tls_init (tcbhead_t *tcb)
{
HURD_TLS_DESC_DECL (desc, tcb);
+ thread_t self = __mach_thread_self ();
+ const char *msg = NULL;
/* This field is used by TLS accesses to get our "thread pointer"
from the TLS point of view. */
tcb->tcb = tcb;
-
- /* Cache our thread port. */
- tcb->self = __mach_thread_self ();
+ /* We always at least start the sigthread anyway. */
+ tcb->multiple_threads = 1;
/* Get the first available selector. */
int sel = -1;
- error_t err = __i386_set_gdt (tcb->self, &sel, desc);
+ error_t err = __i386_set_gdt (self, &sel, desc);
if (err == MIG_BAD_ID)
{
/* Old kernel, use a per-thread LDT. */
sel = 0x27;
- err = __i386_set_ldt (tcb->self, sel, &desc, 1);
+ err = __i386_set_ldt (self, sel, &desc, 1);
assert_perror (err);
if (err)
- return "i386_set_ldt failed";
+ {
+ msg = "i386_set_ldt failed";
+ goto out;
+ }
}
else if (err)
{
assert_perror (err); /* Separate from above with different line #. */
- return "i386_set_gdt failed";
+ msg = "i386_set_gdt failed";
+ goto out;
}
/* Now install the new selector. */
asm volatile ("mov %w0, %%gs" :: "q" (sel));
- return 0;
+out:
+ __mach_port_deallocate (__mach_task_self (), self);
+ return msg;
}
/* Code to initially initialize the thread pointer. This might need
@@ -149,6 +163,21 @@ _hurd_tls_init (tcbhead_t *tcb)
: "i" (offsetof (tcbhead_t, tcb))); \
__tcb;})
+/* Return the TCB address of a thread given its state.
+ Note: this is expensive. */
+# define THREAD_TCB(thread, thread_state) \
+ ({ int __sel = (thread_state)->basic.gs; \
+ struct descriptor __desc, *___desc = &__desc; \
+ unsigned int __count = 1; \
+ kern_return_t __err; \
+ if (HURD_SEL_LDT (__sel)) \
+ __err = __i386_get_ldt ((thread), __sel, 1, &___desc, &__count); \
+ else \
+ __err = __i386_get_gdt ((thread), __sel, &__desc); \
+ assert_perror (__err); \
+ assert (__count == 1); \
+ HURD_DESC_TLS (___desc);})
+
/* Install new dtv for current thread. */
# define INSTALL_NEW_DTV(dtvp) \
({ asm volatile ("movl %0,%%gs:%P1" \
@@ -176,7 +205,7 @@ _hurd_tls_fork (thread_t child, thread_t orig, struct i386_thread_state *state)
error_t err;
unsigned int count = 1;
- if (__glibc_unlikely (__i386_selector_is_ldt(sel)))
+ if (HURD_SEL_LDT (sel))
err = __i386_get_ldt (orig, sel, 1, &_desc, &count);
else
err = __i386_get_gdt (orig, sel, &desc);
@@ -185,7 +214,7 @@ _hurd_tls_fork (thread_t child, thread_t orig, struct i386_thread_state *state)
if (err)
return err;
- if (__glibc_unlikely (__i386_selector_is_ldt(sel)))
+ if (HURD_SEL_LDT (sel))
err = __i386_set_ldt (child, sel, &desc, 1);
else
err = __i386_set_gdt (child, &sel, desc);
@@ -209,7 +238,7 @@ _hurd_tls_new (thread_t child, struct i386_thread_state *state, tcbhead_t *tcb)
tcb->tcb = tcb;
tcb->self = child;
- if (__glibc_unlikely (__i386_selector_is_ldt(sel)))
+ if (HURD_SEL_LDT (sel))
err = __i386_set_ldt (child, sel, &desc, 1);
else
err = __i386_set_gdt (child, &sel, desc);
diff --git a/sysdeps/mach/hurd/i386/tlsdesc.sym b/sysdeps/mach/hurd/i386/tlsdesc.sym
new file mode 100644
index 0000000000..a358f7e325
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/tlsdesc.sym
@@ -0,0 +1,19 @@
+#include <stddef.h>
+#include <sysdep.h>
+#include <tls.h>
+#include <link.h>
+#include <dl-tlsdesc.h>
+
+--
+
+-- We have to override sysdeps/i386/tlsdesc.sym to adapt to our libpthread.
+
+-- Abuse tls.h macros to derive offsets relative to the thread register.
+
+DTV_OFFSET offsetof(tcbhead_t, dtv)
+
+TLSDESC_ARG offsetof(struct tlsdesc, arg)
+
+TLSDESC_GEN_COUNT offsetof(struct tlsdesc_dynamic_arg, gen_count)
+TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
+TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
diff --git a/sysdeps/mach/hurd/i386/trampoline.c b/sysdeps/mach/hurd/i386/trampoline.c
index dacbdd26d8..0e795f9389 100644
--- a/sysdeps/mach/hurd/i386/trampoline.c
+++ b/sysdeps/mach/hurd/i386/trampoline.c
@@ -1,5 +1,5 @@
/* Set thread_state for sighandler, and sigcontext to recover. i386 version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -79,8 +79,6 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
{
sigsp = ss->sigaltstack.ss_sp + ss->sigaltstack.ss_size;
ss->sigaltstack.ss_flags |= SS_ONSTACK;
- /* XXX need to set up base of new stack for
- per-thread variables, cthreads. */
}
/* This code has intimate knowledge of the special mach_msg system call
done in intr-msg.c; that code does (see intr-msg.h):
diff --git a/sysdeps/mach/hurd/if_index.c b/sysdeps/mach/hurd/if_index.c
index 6479458a56..4303c938a8 100644
--- a/sysdeps/mach/hurd/if_index.c
+++ b/sysdeps/mach/hurd/if_index.c
@@ -1,5 +1,5 @@
/* Find network interface names and index numbers. Hurd version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,6 +37,12 @@ __if_nametoindex (const char *ifname)
if (fd < 0)
return 0;
+ if (strlen (ifname) >= IFNAMSIZ)
+ {
+ __set_errno (ENODEV);
+ return 0;
+ }
+
strncpy (ifr.ifr_name, ifname, IFNAMSIZ);
if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
{
@@ -187,7 +193,6 @@ libc_hidden_weak (if_indextoname)
#if 0
void
-internal_function
__protocol_available (int *have_inet, int *have_inet6)
{
*have_inet = _hurd_socket_server (PF_INET, 0) != MACH_PORT_NULL;
diff --git a/sysdeps/mach/hurd/ifreq.c b/sysdeps/mach/hurd/ifreq.c
index cdbff2c3f8..70a906a83a 100644
--- a/sysdeps/mach/hurd/ifreq.c
+++ b/sysdeps/mach/hurd/ifreq.c
@@ -1,5 +1,5 @@
/* Fetch the host's network interface list. Hurd version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,7 +53,7 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
if (len % sizeof (struct ifreq) != 0)
{
- munmap (data, len);
+ __munmap (data, len);
errno = EGRATUITOUS;
goto out;
}
diff --git a/sysdeps/mach/hurd/ifreq.h b/sysdeps/mach/hurd/ifreq.h
index fe332492e6..3ab8d858b6 100644
--- a/sysdeps/mach/hurd/ifreq.h
+++ b/sysdeps/mach/hurd/ifreq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>.
@@ -24,21 +24,9 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
-static inline struct ifreq *
-__if_nextreq (struct ifreq *ifr)
-{
-#ifdef _HAVE_SA_LEN
- if (ifr->ifr_addr.sa_len > sizeof ifr->ifr_addr)
- return (struct ifreq *) ((char *) &ifr->ifr_addr + ifr->ifr_addr.sa_len);
-#endif
- return ifr + 1;
-}
-
-extern void __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd);
-
static inline void
__if_freereq (struct ifreq *ifreqs, int num_ifs)
{
- munmap (ifreqs, num_ifs * sizeof (struct ifreq));
+ __munmap (ifreqs, num_ifs * sizeof (struct ifreq));
}
diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c
index 74b6c41c72..15b26f5bba 100644
--- a/sysdeps/mach/hurd/ioctl.c
+++ b/sysdeps/mach/hurd/ioctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -323,4 +323,5 @@ __ioctl (int fd, unsigned long int request, ...)
}
}
+libc_hidden_def (__ioctl)
weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/mach/hurd/isatty.c b/sysdeps/mach/hurd/isatty.c
index 1bd062b17c..4adc8901fb 100644
--- a/sysdeps/mach/hurd/isatty.c
+++ b/sysdeps/mach/hurd/isatty.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/jmp-unwind.c b/sysdeps/mach/hurd/jmp-unwind.c
index f74124eea9..d269f9f61b 100644
--- a/sysdeps/mach/hurd/jmp-unwind.c
+++ b/sysdeps/mach/hurd/jmp-unwind.c
@@ -1,5 +1,5 @@
/* _longjmp_unwind -- Clean up stack frames unwound by longjmp. Hurd version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/kernel-features.h b/sysdeps/mach/hurd/kernel-features.h
index 7de5c11b66..a13d6cdf11 100644
--- a/sysdeps/mach/hurd/kernel-features.h
+++ b/sysdeps/mach/hurd/kernel-features.h
@@ -1,5 +1,5 @@
/* Set flags signalling availability of certain operating system features.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,3 @@
/* This file can define __ASSUME_* macros checked by certain source files.
Almost none of these are used outside of sysdeps/unix/sysv/linux code.
But those referring to POSIX-level features like O_* flags can be. */
-
-#define __ASSUME_O_CLOEXEC 1
-#define __ASSUME_DUP3 1
-#define __ASSUME_ACCEPT4 1
diff --git a/sysdeps/mach/hurd/kill.c b/sysdeps/mach/hurd/kill.c
index 3c5c0e573d..7e64e7c9d7 100644
--- a/sysdeps/mach/hurd/kill.c
+++ b/sysdeps/mach/hurd/kill.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -146,4 +146,5 @@ __kill (pid_t pid, int sig)
return delivered ? 0 : __hurd_fail (err ?: ESRCH);
}
+libc_hidden_def (__kill)
weak_alias (__kill, kill)
diff --git a/sysdeps/mach/hurd/lchmod.c b/sysdeps/mach/hurd/lchmod.c
index 7be10b7753..0fd02e86b8 100644
--- a/sysdeps/mach/hurd/lchmod.c
+++ b/sysdeps/mach/hurd/lchmod.c
@@ -1,5 +1,5 @@
/* lchmod -- Change the protections of a file or symbolic link. Hurd version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/lchown.c b/sysdeps/mach/hurd/lchown.c
index 147a422cee..eb5760eb18 100644
--- a/sysdeps/mach/hurd/lchown.c
+++ b/sysdeps/mach/hurd/lchown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/lgetxattr.c b/sysdeps/mach/hurd/lgetxattr.c
index f1adfb365d..ae385f8379 100644
--- a/sysdeps/mach/hurd/lgetxattr.c
+++ b/sysdeps/mach/hurd/lgetxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/libc-lock.h b/sysdeps/mach/hurd/libc-lock.h
deleted file mode 100644
index 8011905243..0000000000
--- a/sysdeps/mach/hurd/libc-lock.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/* libc-internal interface for mutex locks. Hurd version using Mach cthreads.
- 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/>. */
-
-#ifndef _LIBC_LOCK_H
-#define _LIBC_LOCK_H 1
-
-#if (_LIBC - 0) || (_CTHREADS_ - 0)
-#if (_LIBC - 0)
-#include <tls.h>
-#endif
-#include <cthreads.h>
-#include <hurd/threadvar.h>
-
-typedef struct mutex __libc_lock_t;
-typedef struct
-{
- struct mutex mutex;
- void *owner;
- int count;
-} __libc_lock_recursive_t;
-typedef __libc_lock_recursive_t __rtld_lock_recursive_t;
-
-#define __libc_lock_owner_self() ((void *) __hurd_threadvar_location (0))
-
-#else
-typedef struct __libc_lock_opaque__ __libc_lock_t;
-typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
-#endif
-
-/* Define a lock variable NAME with storage class CLASS. The lock must be
- initialized with __libc_lock_init before it can be used (or define it
- with __libc_lock_define_initialized, below). Use `extern' for CLASS to
- declare a lock defined in another module. In public structure
- definitions you must use a pointer to the lock structure (i.e., NAME
- begins with a `*'), because its storage size will not be known outside
- of libc. */
-#define __libc_lock_define(CLASS,NAME) \
- CLASS __libc_lock_t NAME;
-
-/* Define an initialized lock variable NAME with storage class CLASS. */
-#define _LIBC_LOCK_INITIALIZER MUTEX_INITIALIZER
-#define __libc_lock_define_initialized(CLASS,NAME) \
- CLASS __libc_lock_t NAME = _LIBC_LOCK_INITIALIZER;
-
-/* Initialize the named lock variable, leaving it in a consistent, unlocked
- state. */
-#define __libc_lock_init(NAME) __mutex_init (&(NAME))
-
-/* Finalize the named lock variable, which must be locked. It cannot be
- used again until __libc_lock_init is called again on it. This must be
- called on a lock variable before the containing storage is reused. */
-#define __libc_lock_fini(NAME) __mutex_unlock (&(NAME))
-#define __libc_lock_fini_recursive(NAME) __mutex_unlock (&(NAME).mutex)
-#define __rtld_lock_fini_recursive(NAME) __mutex_unlock (&(NAME).mutex)
-
-
-/* Lock the named lock variable. */
-#define __libc_lock_lock(NAME) __mutex_lock (&(NAME))
-
-/* Lock the named lock variable. */
-#define __libc_lock_trylock(NAME) (!__mutex_trylock (&(NAME)))
-
-/* Unlock the named lock variable. */
-#define __libc_lock_unlock(NAME) __mutex_unlock (&(NAME))
-
-
-#define __libc_lock_define_recursive(CLASS,NAME) \
- CLASS __libc_lock_recursive_t NAME;
-#define _LIBC_LOCK_RECURSIVE_INITIALIZER { MUTEX_INITIALIZER, 0, 0 }
-#define __libc_lock_define_initialized_recursive(CLASS,NAME) \
- CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
-
-#define __rtld_lock_define_recursive(CLASS,NAME) \
- __libc_lock_define_recursive (CLASS, NAME)
-#define _RTLD_LOCK_RECURSIVE_INITIALIZER \
- _LIBC_LOCK_RECURSIVE_INITIALIZER
-#define __rtld_lock_define_initialized_recursive(CLASS,NAME) \
- __libc_lock_define_initialized_recursive (CLASS, NAME)
-
-#define __libc_lock_init_recursive(NAME) \
- ({ __libc_lock_recursive_t *const __lock = &(NAME); \
- __lock->owner = 0; mutex_init (&__lock->mutex); })
-
-#define __libc_lock_trylock_recursive(NAME) \
- ({ __libc_lock_recursive_t *const __lock = &(NAME); \
- void *__self = __libc_lock_owner_self (); \
- __mutex_trylock (&__lock->mutex) \
- ? (__lock->owner = __self, __lock->count = 1, 0) \
- : __lock->owner == __self ? (++__lock->count, 0) : 1; })
-
-#define __libc_lock_lock_recursive(NAME) \
- ({ __libc_lock_recursive_t *const __lock = &(NAME); \
- void *__self = __libc_lock_owner_self (); \
- if (__mutex_trylock (&__lock->mutex) \
- || (__lock->owner != __self \
- && (__mutex_lock (&__lock->mutex), 1))) \
- __lock->owner = __self, __lock->count = 1; \
- else \
- ++__lock->count; \
- })
-#define __libc_lock_unlock_recursive(NAME) \
- ({ __libc_lock_recursive_t *const __lock = &(NAME); \
- if (--__lock->count == 0) \
- { \
- __lock->owner = 0; \
- __mutex_unlock (&__lock->mutex); \
- } \
- })
-
-
-#define __rtld_lock_initialize(NAME) \
- (void) ((NAME) = (__rtld_lock_recursive_t) _RTLD_LOCK_RECURSIVE_INITIALIZER)
-#define __rtld_lock_trylock_recursive(NAME) \
- __libc_lock_trylock_recursive (NAME)
-#define __rtld_lock_lock_recursive(NAME) \
- __libc_lock_lock_recursive(NAME)
-#define __rtld_lock_unlock_recursive(NAME) \
- __libc_lock_unlock_recursive (NAME)
-
-
-/* XXX for now */
-#define __libc_rwlock_define __libc_lock_define
-#define __libc_rwlock_define_initialized __libc_lock_define_initialized
-#define __libc_rwlock_init __libc_lock_init
-#define __libc_rwlock_fini __libc_lock_fini
-#define __libc_rwlock_rdlock __libc_lock_lock
-#define __libc_rwlock_wrlock __libc_lock_lock
-#define __libc_rwlock_tryrdlock __libc_lock_trylock
-#define __libc_rwlock_trywrlock __libc_lock_trylock
-#define __libc_rwlock_unlock __libc_lock_unlock
-
-
-/* Start a critical region with a cleanup function */
-#define __libc_cleanup_region_start(DOIT, FCT, ARG) \
-{ \
- typeof (***(FCT)) *__save_FCT = (DOIT) ? (FCT) : 0; \
- typeof (ARG) __save_ARG = ARG; \
- /* close brace is in __libc_cleanup_region_end below. */
-
-/* End a critical region started with __libc_cleanup_region_start. */
-#define __libc_cleanup_region_end(DOIT) \
- if ((DOIT) && __save_FCT != 0) \
- (*__save_FCT)(__save_ARG); \
-}
-
-/* Sometimes we have to exit the block in the middle. */
-#define __libc_cleanup_end(DOIT) \
- if ((DOIT) && __save_FCT != 0) \
- (*__save_FCT)(__save_ARG); \
-
-#define __libc_cleanup_push(fct, arg) __libc_cleanup_region_start (1, fct, arg)
-#define __libc_cleanup_pop(execute) __libc_cleanup_region_end (execute)
-
-#if (_CTHREADS_ - 0)
-
-/* Use mutexes as once control variables. */
-
-struct __libc_once
- {
- __libc_lock_t lock;
- int done;
- };
-
-#define __libc_once_define(CLASS,NAME) \
- CLASS struct __libc_once NAME = { MUTEX_INITIALIZER, 0 }
-
-/* Call handler iff the first call. */
-#define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
- do { \
- __libc_lock_lock (ONCE_CONTROL.lock); \
- if (!ONCE_CONTROL.done) \
- (INIT_FUNCTION) (); \
- ONCE_CONTROL.done = 1; \
- __libc_lock_unlock (ONCE_CONTROL.lock); \
- } while (0)
-
-/* Get once control variable. */
-#define __libc_once_get(ONCE_CONTROL) ((ONCE_CONTROL).done != 0)
-
-#ifdef _LIBC
-/* We need portable names for some functions. E.g., when they are
- used as argument to __libc_cleanup_region_start. */
-#define __libc_mutex_unlock __mutex_unlock
-#endif
-
-/* Type for key of thread specific data. */
-typedef cthread_key_t __libc_key_t;
-
-#define __libc_key_create(KEY,DEST) cthread_keycreate (KEY)
-#define __libc_setspecific(KEY,VAL) cthread_setspecific (KEY, VAL)
-void *__libc_getspecific (__libc_key_t key);
-
-#endif /* _CTHREADS_ */
-
-/* Hide the definitions which are only supposed to be used inside libc in
- a separate file. This file is not present in the installation! */
-#ifdef _LIBC
-# include <libc-lockP.h>
-#endif
-
-#endif /* libc-lock.h */
diff --git a/sysdeps/mach/hurd/libc-start.h b/sysdeps/mach/hurd/libc-start.h
new file mode 100644
index 0000000000..f7e39935ce
--- /dev/null
+++ b/sysdeps/mach/hurd/libc-start.h
@@ -0,0 +1,31 @@
+/* Hurd definitions for libc main startup.
+ Copyright (C) 2017-2018 Free Software 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 _LIBC_START_H
+#define _LIBC_START_H
+
+#ifndef SHARED
+/* By default we perform STT_GNU_IFUNC resolution *before* TLS
+ initialization, and this means you cannot, without machine
+ knowledge, access TLS from an IFUNC resolver. */
+#define ARCH_SETUP_IREL() apply_irel ()
+#define ARCH_SETUP_TLS()
+#define ARCH_APPLY_IREL()
+#endif /* ! SHARED */
+
+#endif /* _LIBC_START_H */
diff --git a/sysdeps/mach/hurd/libc-tsd.h b/sysdeps/mach/hurd/libc-tsd.h
deleted file mode 100644
index f523034fe7..0000000000
--- a/sysdeps/mach/hurd/libc-tsd.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* libc-internal interface for thread-specific data. Hurd version.
- 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/>. */
-
-#ifndef _LIBC_TSD_H
-#define _LIBC_TSD_H 1
-
-#include <hurd/threadvar.h>
-
-#define __libc_tsd_define(CLASS, TYPE, KEY) /* nothing, always have threadvars */
-
-#define __libc_tsd_address(TYPE, KEY) \
- ((TYPE *) __hurd_threadvar_location (_HURD_THREADVAR_##KEY))
-
-#define __libc_tsd_get(TYPE, KEY) \
- (*__libc_tsd_address (TYPE, KEY))
-#define __libc_tsd_set(TYPE, KEY, VALUE) \
- (*__libc_tsd_address (TYPE, KEY) = (VALUE))
-
-#endif /* libc-tsd.h */
diff --git a/sysdeps/mach/hurd/libhurduser.abilist b/sysdeps/mach/hurd/libhurduser.abilist
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sysdeps/mach/hurd/libhurduser.abilist
diff --git a/sysdeps/mach/hurd/link.c b/sysdeps/mach/hurd/link.c
index 04d160407f..f50d63cb1a 100644
--- a/sysdeps/mach/hurd/link.c
+++ b/sysdeps/mach/hurd/link.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/linkat.c b/sysdeps/mach/hurd/linkat.c
index 52371599df..e2e427cb4d 100644
--- a/sysdeps/mach/hurd/linkat.c
+++ b/sysdeps/mach/hurd/linkat.c
@@ -1,5 +1,5 @@
/* Make a link between file names relative to open directories. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/listen.c b/sysdeps/mach/hurd/listen.c
index a2869129c7..2b2cf23eb6 100644
--- a/sysdeps/mach/hurd/listen.c
+++ b/sysdeps/mach/hurd/listen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/listxattr.c b/sysdeps/mach/hurd/listxattr.c
index 69080defdc..c1af8072c1 100644
--- a/sysdeps/mach/hurd/listxattr.c
+++ b/sysdeps/mach/hurd/listxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/llistxattr.c b/sysdeps/mach/hurd/llistxattr.c
index 54f6e0de13..0b3e848c7d 100644
--- a/sysdeps/mach/hurd/llistxattr.c
+++ b/sysdeps/mach/hurd/llistxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/lremovexattr.c b/sysdeps/mach/hurd/lremovexattr.c
index 3e7fceb9e5..a6fa830d4a 100644
--- a/sysdeps/mach/hurd/lremovexattr.c
+++ b/sysdeps/mach/hurd/lremovexattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/lseek.c b/sysdeps/mach/hurd/lseek.c
index 25e648bc8e..0a4077268a 100644
--- a/sysdeps/mach/hurd/lseek.c
+++ b/sysdeps/mach/hurd/lseek.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software 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,12 +17,22 @@
#include <unistd.h>
#include <sys/types.h>
+#include <errno.h>
/* Seek to OFFSET on FD, starting from WHENCE. */
off_t
__libc_lseek (int fd, off_t offset, int whence)
{
- return __libc_lseek64 (fd, (off64_t) offset, whence);
+ off64_t res64 = __libc_lseek64 (fd, (off64_t) offset, whence);
+ off_t res = (off_t) res64;
+
+ if (sizeof res != sizeof res64 && res != res64)
+ {
+ __set_errno (EOVERFLOW);
+ return (off_t) -1;
+ }
+
+ return res;
}
weak_alias (__libc_lseek, __lseek)
diff --git a/sysdeps/mach/hurd/lseek64.c b/sysdeps/mach/hurd/lseek64.c
index 4f112e6c2a..d058ab36ff 100644
--- a/sysdeps/mach/hurd/lseek64.c
+++ b/sysdeps/mach/hurd/lseek64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/lsetxattr.c b/sysdeps/mach/hurd/lsetxattr.c
index 38d5156e42..95a2899a09 100644
--- a/sysdeps/mach/hurd/lsetxattr.c
+++ b/sysdeps/mach/hurd/lsetxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/lutimes.c b/sysdeps/mach/hurd/lutimes.c
index d39e4e7271..375ab3feb3 100644
--- a/sysdeps/mach/hurd/lutimes.c
+++ b/sysdeps/mach/hurd/lutimes.c
@@ -1,5 +1,5 @@
/* lutimes -- change access and modification times of a symlink. Hurd version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,33 +22,22 @@
#include <hurd.h>
#include <fcntl.h>
+#include "utime-helper.c"
+
/* Change the access time of FILE to TVP[0] and
the modification time of FILE to TVP[1]. */
int
__lutimes (const char *file, const struct timeval tvp[2])
{
- union tv
- {
- struct timeval tv;
- time_value_t tvt;
- };
- const union tv *u = (const union tv *) tvp;
- union tv nulltv[2];
error_t err;
file_t port;
- if (tvp == NULL)
- {
- /* Setting the number of microseconds to `-1' tells the
- underlying filesystems to use the current time. */
- nulltv[0].tvt.microseconds = nulltv[1].tvt.microseconds = -1;
- u = nulltv;
- }
-
port = __file_name_lookup (file, O_NOLINK, 0);
if (port == MACH_PORT_NULL)
return -1;
- err = __file_utimes (port, u[0].tvt, u[1].tvt);
+
+ err = hurd_futimes (port, tvp);
+
__mach_port_deallocate (__mach_task_self (), port);
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/lxstat.c b/sysdeps/mach/hurd/lxstat.c
index 4173782bd4..ea69f78b2b 100644
--- a/sysdeps/mach/hurd/lxstat.c
+++ b/sysdeps/mach/hurd/lxstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/lxstat64.c b/sysdeps/mach/hurd/lxstat64.c
index fffea88edc..e060d2c1f6 100644
--- a/sysdeps/mach/hurd/lxstat64.c
+++ b/sysdeps/mach/hurd/lxstat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/malloc-machine.h b/sysdeps/mach/hurd/malloc-machine.h
index 515f3ff151..36a7d11dc5 100644
--- a/sysdeps/mach/hurd/malloc-machine.h
+++ b/sysdeps/mach/hurd/malloc-machine.h
@@ -1,6 +1,6 @@
/* Basic platform-independent macro definitions for mutexes,
thread-specific data and parameters for malloc.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,38 +20,9 @@
#ifndef _MALLOC_MACHINE_H
#define _MALLOC_MACHINE_H
-#undef thread_atfork_static
-
#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))
-
-#define thread_atfork(prepare, parent, child) do {} while(0)
-#define thread_atfork_static(prepare, parent, child) \
- text_set_element(_hurd_fork_prepare_hook, prepare); \
- text_set_element(_hurd_fork_parent_hook, parent); \
- text_set_element(_hurd_fork_child_hook, child);
-
-/* 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/mig-reply.c b/sysdeps/mach/hurd/mig-reply.c
index 5471cf220d..8350354500 100644
--- a/sysdeps/mach/hurd/mig-reply.c
+++ b/sysdeps/mach/hurd/mig-reply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software 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,47 +16,40 @@
<http://www.gnu.org/licenses/>. */
#include <mach.h>
+#include <mach/mig_support.h>
#include <hurd/threadvar.h>
-#define GETPORT \
- mach_port_t *portloc = \
- (mach_port_t *) __hurd_threadvar_location (_HURD_THREADVAR_MIG_REPLY)
-#define reply_port (*(use_threadvar ? portloc : &global_reply_port))
-
-static int use_threadvar;
-static mach_port_t global_reply_port;
-
/* These functions are called by MiG-generated code. */
+mach_port_t __hurd_reply_port0;
+
/* Called by MiG to get a reply port. */
mach_port_t
__mig_get_reply_port (void)
{
- GETPORT;
-
- if (reply_port == MACH_PORT_NULL)
- reply_port = __mach_reply_port ();
+ if (__hurd_local_reply_port == MACH_PORT_NULL ||
+ (&__hurd_local_reply_port != &__hurd_reply_port0
+ && __hurd_local_reply_port == __hurd_reply_port0))
+ __hurd_local_reply_port = __mach_reply_port ();
- return reply_port;
+ return __hurd_local_reply_port;
}
weak_alias (__mig_get_reply_port, mig_get_reply_port)
+libc_hidden_def (__mig_get_reply_port)
/* Called by MiG to deallocate the reply port. */
void
__mig_dealloc_reply_port (mach_port_t arg)
{
- mach_port_t port;
-
- GETPORT;
-
- port = reply_port;
- reply_port = MACH_PORT_NULL; /* So the mod_refs RPC won't use it. */
+ mach_port_t port = __hurd_local_reply_port;
+ __hurd_local_reply_port = MACH_PORT_NULL; /* So the mod_refs RPC won't use it. */
if (MACH_PORT_VALID (port))
__mach_port_mod_refs (__mach_task_self (), port,
MACH_PORT_RIGHT_RECEIVE, -1);
}
weak_alias (__mig_dealloc_reply_port, mig_dealloc_reply_port)
+libc_hidden_def (__mig_dealloc_reply_port)
/* Called by mig interfaces when done with a port. Used to provide the
same interface as needed when a custom allocator is used. */
@@ -73,15 +66,7 @@ weak_alias (__mig_put_reply_port, mig_put_reply_port)
void
__mig_init (void *stack)
{
- use_threadvar = stack != 0;
-
- if (use_threadvar)
- {
- /* Recycle the reply port used before multithreading was enabled. */
- mach_port_t *portloc = (mach_port_t *)
- __hurd_threadvar_location_from_sp (_HURD_THREADVAR_MIG_REPLY, stack);
- *portloc = global_reply_port;
- global_reply_port = MACH_PORT_NULL;
- }
+ /* Do nothing. */
}
weak_alias (__mig_init, mig_init)
+libc_hidden_def (__mig_init)
diff --git a/sysdeps/mach/hurd/mkdir.c b/sysdeps/mach/hurd/mkdir.c
index fe7692dbd3..fa01aabde0 100644
--- a/sysdeps/mach/hurd/mkdir.c
+++ b/sysdeps/mach/hurd/mkdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,4 +40,5 @@ __mkdir (const char *file_name, mode_t mode)
return 0;
}
+libc_hidden_def (__mkdir)
weak_alias (__mkdir, mkdir)
diff --git a/sysdeps/mach/hurd/mkdirat.c b/sysdeps/mach/hurd/mkdirat.c
index 3a178ef9b2..f214e08cab 100644
--- a/sysdeps/mach/hurd/mkdirat.c
+++ b/sysdeps/mach/hurd/mkdirat.c
@@ -1,5 +1,5 @@
/* Create a directory named relative to another open directory. Hurd version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/mlock.c b/sysdeps/mach/hurd/mlock.c
index c8fdaeb9d8..28a33be24f 100644
--- a/sysdeps/mach/hurd/mlock.c
+++ b/sysdeps/mach/hurd/mlock.c
@@ -1,5 +1,5 @@
/* mlock -- guarantee pages are resident in memory. Mach/Hurd version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/mlockall.c b/sysdeps/mach/hurd/mlockall.c
new file mode 100644
index 0000000000..6fa944b21f
--- /dev/null
+++ b/sysdeps/mach/hurd/mlockall.c
@@ -0,0 +1,42 @@
+/* mlockall -- lock in core all the pages in this process. Hurd version.
+ Copyright (C) 2001-2018 Free Software 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/types.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include <hurd.h>
+#include <mach/mach_host.h>
+
+/* Cause all currently mapped pages of the process to be memory resident
+ until unlocked by a call to the `munlockall', until the process exits,
+ or until the process calls `execve'. */
+
+int
+mlockall (int flags)
+{
+ mach_port_t host;
+ error_t err;
+
+ err = __get_privileged_ports (&host, NULL);
+ if (err)
+ return __hurd_fail (err);
+
+ err = __vm_wire_all (host, __mach_task_self (), flags);
+ __mach_port_deallocate (__mach_task_self (), host);
+ return err ? __hurd_fail (err) : 0;
+}
diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c
index c62955875b..e388ac9783 100644
--- a/sysdeps/mach/hurd/mmap.c
+++ b/sysdeps/mach/hurd/mmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,12 +26,12 @@
is nonzero, it is the desired mapping address. If the MAP_FIXED bit is
set in FLAGS, the mapping will be at ADDR exactly (which must be
page-aligned); otherwise the system chooses a convenient nearby address.
- The return value is the actual mapping address chosen or (__ptr_t) -1
+ The return value is the actual mapping address chosen or (void *) -1
for errors (in which case `errno' is set). A successful `mmap' call
deallocates any previous mapping for the affected region. */
-__ptr_t
-__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
+void *
+__mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
{
error_t err;
vm_prot_t vmprot;
@@ -42,7 +42,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
/* ADDR and OFFSET must be page-aligned. */
if ((mapaddr & (__vm_page_size - 1)) || (offset & (__vm_page_size - 1)))
- return (__ptr_t) (long int) __hurd_fail (EINVAL);
+ return (void *) (long int) __hurd_fail (EINVAL);
if ((flags & (MAP_TYPE|MAP_INHERIT)) == MAP_ANON
&& prot == (PROT_READ|PROT_WRITE)) /* cf VM_PROT_DEFAULT */
@@ -64,7 +64,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
err = __vm_allocate (__mach_task_self (), &mapaddr, len, 1);
}
- return err ? (__ptr_t) (long int) __hurd_fail (err) : (__ptr_t) mapaddr;
+ return err ? (void *) (long int) __hurd_fail (err) : (void *) mapaddr;
}
vmprot = VM_PROT_NONE;
@@ -78,7 +78,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
switch (flags & MAP_TYPE)
{
default:
- return (__ptr_t) (long int) __hurd_fail (EINVAL);
+ return (void *) (long int) __hurd_fail (EINVAL);
case MAP_ANON:
memobj = MACH_PORT_NULL;
@@ -92,7 +92,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
{
if (err == MIG_BAD_ID || err == EOPNOTSUPP || err == ENOSYS)
err = ENODEV; /* File descriptor doesn't support mmap. */
- return (__ptr_t) (long int) __hurd_dfail (fd, err);
+ return (void *) (long int) __hurd_dfail (fd, err);
}
switch (prot & (PROT_READ|PROT_WRITE))
{
@@ -129,7 +129,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
else
{
__mach_port_deallocate (__mach_task_self (), wobj);
- return (__ptr_t) (long int) __hurd_fail (EACCES);
+ return (void *) (long int) __hurd_fail (EACCES);
}
break;
default:
@@ -180,9 +180,10 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
__mach_port_deallocate (__mach_task_self (), memobj);
if (err)
- return (__ptr_t) (long int) __hurd_fail (err);
+ return (void *) (long int) __hurd_fail (err);
- return (__ptr_t) mapaddr;
+ return (void *) mapaddr;
}
+libc_hidden_def (__mmap)
weak_alias (__mmap, mmap)
diff --git a/sysdeps/mach/hurd/mmap64.c b/sysdeps/mach/hurd/mmap64.c
index 42d777ce93..19133ceca5 100644
--- a/sysdeps/mach/hurd/mmap64.c
+++ b/sysdeps/mach/hurd/mmap64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,8 +28,8 @@
for errors (in which case `errno' is set). A successful `mmap' call
deallocates any previous mapping for the affected region. */
-__ptr_t
-__mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd,
+void *
+__mmap64 (void *addr, size_t len, int prot, int flags, int fd,
__off64_t offset)
{
vm_offset_t small_offset = (vm_offset_t) offset;
@@ -44,4 +44,5 @@ __mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd,
return __mmap (addr, len, prot, flags, fd, small_offset);
}
+libc_hidden_def (__mmap64)
weak_alias (__mmap64, mmap64)
diff --git a/sysdeps/mach/hurd/munlock.c b/sysdeps/mach/hurd/munlock.c
index f3b418a964..3ef4dbb175 100644
--- a/sysdeps/mach/hurd/munlock.c
+++ b/sysdeps/mach/hurd/munlock.c
@@ -1,5 +1,5 @@
/* munlock -- undo the effects of prior mlock calls. Mach/Hurd version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/munlockall.c b/sysdeps/mach/hurd/munlockall.c
new file mode 100644
index 0000000000..615b77f034
--- /dev/null
+++ b/sysdeps/mach/hurd/munlockall.c
@@ -0,0 +1,40 @@
+/* munlockall -- undo the effects of all prior mlock calls. Hurd version.
+ Copyright (C) 2001-2018 Free Software 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/types.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include <hurd.h>
+#include <mach/mach_host.h>
+
+/* Undo the effects of all prior mlock calls in this process. */
+
+int
+munlockall (void)
+{
+ mach_port_t host;
+ error_t err;
+
+ err = __get_privileged_ports (&host, NULL);
+ if (err)
+ return __hurd_fail (err);
+
+ err = __vm_wire_all (host, __mach_task_self (), VM_WIRE_NONE);
+ __mach_port_deallocate (__mach_task_self (), host);
+ return err ? __hurd_fail (err) : 0;
+}
diff --git a/sysdeps/mach/hurd/net/ethernet.h b/sysdeps/mach/hurd/net/ethernet.h
index 404311e7a2..31f15cbe0f 100644
--- a/sysdeps/mach/hurd/net/ethernet.h
+++ b/sysdeps/mach/hurd/net/ethernet.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@
#include <sys/cdefs.h>
#include <sys/types.h>
+#include <stdint.h>
#include <net/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];
};
/* 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..01c8b62a99 100644
--- a/sysdeps/mach/hurd/net/if_arp.h
+++ b/sysdeps/mach/hurd/net/if_arp.h
@@ -1,5 +1,5 @@
/* Definitions for Address Resolution Protocol.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <sys/socket.h>
+#include <stdint.h>
__BEGIN_DECLS
@@ -132,7 +133,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_ether.h b/sysdeps/mach/hurd/net/if_ether.h
index d205522856..d499b1d6ed 100644
--- a/sysdeps/mach/hurd/net/if_ether.h
+++ b/sysdeps/mach/hurd/net/if_ether.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/net/if_ppp.h b/sysdeps/mach/hurd/net/if_ppp.h
deleted file mode 100644
index 1b1c3ea6eb..0000000000
--- a/sysdeps/mach/hurd/net/if_ppp.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/* From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
-
-/*
- * if_ppp.h - Point-to-Point Protocol definitions.
- *
- * Copyright (c) 1989 Carnegie Mellon University.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
- * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/*
- * ==FILEVERSION 960926==
- *
- * NOTE TO MAINTAINERS:
- * If you modify this file at all, please set the above date.
- * if_ppp.h is shipped with a PPP distribution as well as with the kernel;
- * if everyone increases the FILEVERSION number above, then scripts
- * can do the right thing when deciding whether to install a new if_ppp.h
- * file. Don't change the format of that line otherwise, so the
- * installation script can recognize it.
- */
-
-
-#ifndef __NET_IF_PPP_H
-#define __NET_IF_PPP_H 1
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-#include <net/if.h>
-#include <sys/ioctl.h>
-#include <net/ppp_defs.h>
-
-__BEGIN_DECLS
-
-/*
- * Packet sizes
- */
-
-#define PPP_MTU 1500 /* Default MTU (size of Info field) */
-#define PPP_MAXMRU 65000 /* Largest MRU we allow */
-#define PPP_VERSION "2.2.0"
-#define PPP_MAGIC 0x5002 /* Magic value for the ppp structure */
-#define PROTO_IPX 0x002b /* protocol numbers */
-#define PROTO_DNA_RT 0x0027 /* DNA Routing */
-
-
-/*
- * Bit definitions for flags.
- */
-
-#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
-#define SC_COMP_AC 0x00000002 /* header compression (output) */
-#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
-#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
-#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
-#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
-#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
-#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
-#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
-#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
-#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
-#define SC_DEBUG 0x00010000 /* enable debug messages */
-#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
-#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
-#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
-#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
-#define SC_MASK 0x0fE0ffff /* bits that user can change */
-
-/* state bits */
-#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */
-#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */
-#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */
-#define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */
-#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
-#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
-#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
-#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
-#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
-#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
-
-/*
- * Ioctl definitions.
- */
-
-struct npioctl {
- int protocol; /* PPP protocol, e.g. PPP_IP */
- enum NPmode mode;
-};
-
-/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
-struct ppp_option_data {
- u_int8_t *ptr;
- u_int32_t length;
- int transmit;
-};
-
-struct ifpppstatsreq {
- struct ifreq b;
- struct ppp_stats stats; /* statistic information */
-};
-
-struct ifpppcstatsreq {
- struct ifreq b;
- struct ppp_comp_stats stats;
-};
-
-#define ifr__name b.ifr_ifrn.ifrn_name
-#define stats_ptr b.ifr_ifru.ifru_data
-
-/*
- * Ioctl definitions.
- */
-
-#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
-#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
-#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
-#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
-#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
-#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
-#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
-#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
-#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
-#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
-#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
-#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
-#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
-#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
-#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
-#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
-#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
-#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
-#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
-
-#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
-#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
-#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
-
-#if !defined(ifr_mtu)
-#define ifr_mtu ifr_ifru.ifru_metric
-#endif
-
-__END_DECLS
-
-#endif /* net/if_ppp.h */
diff --git a/sysdeps/mach/hurd/net/route.h b/sysdeps/mach/hurd/net/route.h
index a596ce18e3..c47944316f 100644
--- a/sysdeps/mach/hurd/net/route.h
+++ b/sysdeps/mach/hurd/net/route.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc..
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc..
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -55,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/hurd/not-errno.h b/sysdeps/mach/hurd/not-errno.h
new file mode 100644
index 0000000000..838a5abc69
--- /dev/null
+++ b/sysdeps/mach/hurd/not-errno.h
@@ -0,0 +1,21 @@
+/* Syscall wrapper that do not set errno. Generic version.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* The __access_noerrno stub mustn't be hidden in ld.so on Hurd since it needs
+ to be preempted by __access_noerrno from libc.so after bootstrap. */
+extern __typeof (__access) __access_noerrno;
diff --git a/sysdeps/mach/hurd/open.c b/sysdeps/mach/hurd/open.c
index 5b98fb9f4d..8acdd3d418 100644
--- a/sysdeps/mach/hurd/open.c
+++ b/sysdeps/mach/hurd/open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/openat.c b/sysdeps/mach/hurd/openat.c
index 974ff3fa15..3534f256bc 100644
--- a/sysdeps/mach/hurd/openat.c
+++ b/sysdeps/mach/hurd/openat.c
@@ -1,5 +1,5 @@
/* openat -- Open a file named relative to an open directory. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,7 +29,7 @@
the directory associated with FD. If O_CREAT or O_TMPFILE is in OFLAG, a
third argument is the file protection. */
int
-__openat (int fd, const char *file, int oflag)
+__openat (int fd, const char *file, int oflag, ...)
{
mode_t mode;
io_t port;
diff --git a/sysdeps/mach/hurd/opendir.c b/sysdeps/mach/hurd/opendir.c
index a62af6ffcd..bda138e439 100644
--- a/sysdeps/mach/hurd/opendir.c
+++ b/sysdeps/mach/hurd/opendir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -69,7 +69,6 @@ _hurd_fd_opendir (struct hurd_fd *d)
DIR *
-internal_function
__opendirat (int dfd, const char *name)
{
if (name[0] == '\0')
@@ -84,9 +83,9 @@ __opendirat (int dfd, const char *name)
int fd;
#if IS_IN (rtld)
assert (dfd == AT_FDCWD);
- fd = open_not_cancel_2 (name, flags);
+ fd = __open_nocancel (name, flags);
#else
- fd = openat_not_cancel_3 (dfd, name, flags);
+ fd = __openat_nocancel (dfd, name, flags);
#endif
if (fd < 0)
return NULL;
diff --git a/sysdeps/mach/hurd/pathconf.c b/sysdeps/mach/hurd/pathconf.c
index 7a0ac04158..62099a6c05 100644
--- a/sysdeps/mach/hurd/pathconf.c
+++ b/sysdeps/mach/hurd/pathconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/pipe.c b/sysdeps/mach/hurd/pipe.c
index 364c856a59..9e67ef7c84 100644
--- a/sysdeps/mach/hurd/pipe.c
+++ b/sysdeps/mach/hurd/pipe.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software 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,9 +15,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
#include <unistd.h>
/* Create a one-way communication channel (pipe).
@@ -28,23 +25,7 @@
int
__pipe (int fds[2])
{
- int save_errno = errno;
- int result;
-
- /* The magic S_IFIFO protocol tells the pflocal server to create
- sockets which report themselves as FIFOs, as POSIX requires for
- pipes. */
- result = __socketpair (PF_LOCAL, SOCK_STREAM, S_IFIFO, fds);
- if (result == -1 && errno == EPROTONOSUPPORT)
- {
- /* We contacted an "old" pflocal server that doesn't support the
- magic S_IFIFO protocol.
- FIXME: Remove this junk somewhere in the future. */
- __set_errno (save_errno);
- return __socketpair (PF_LOCAL, SOCK_STREAM, 0, fds);
- }
-
- return result;
+ return __pipe2 (fds, 0);
}
libc_hidden_def (__pipe)
weak_alias (__pipe, pipe)
diff --git a/sysdeps/mach/hurd/pipe2.c b/sysdeps/mach/hurd/pipe2.c
new file mode 100644
index 0000000000..288d4b8c67
--- /dev/null
+++ b/sysdeps/mach/hurd/pipe2.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 1992-2018 Free Software 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/socket.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <fcntl-internal.h>
+#include <hurd.h>
+
+/* Create a one-way communication channel (pipe).
+ Actually the channel is two-way on the Hurd.
+ If successful, two file descriptors are stored in FDS;
+ bytes written on FDS[1] can be read from FDS[0].
+ Apply FLAGS to the new file descriptors.
+ Returns 0 if successful, -1 if not. */
+int
+__pipe2 (int fds[2], int flags)
+{
+ int save_errno = errno;
+ int result;
+
+ if (flags & ~(O_CLOEXEC | O_NONBLOCK))
+ return __hurd_fail (EINVAL);
+
+ flags = o_to_sock_flags (flags);
+
+ /* The magic S_IFIFO protocol tells the pflocal server to create
+ sockets which report themselves as FIFOs, as POSIX requires for
+ pipes. */
+ result = __socketpair (PF_LOCAL, SOCK_STREAM | flags, S_IFIFO, fds);
+ if (result == -1 && errno == EPROTONOSUPPORT)
+ {
+ /* We contacted an "old" pflocal server that doesn't support the
+ magic S_IFIFO protocol.
+ FIXME: Remove this junk somewhere in the future. */
+ __set_errno (save_errno);
+ return __socketpair (PF_LOCAL, SOCK_STREAM | flags, 0, fds);
+ }
+
+ return result;
+}
+weak_alias (__pipe2, pipe2)
diff --git a/sysdeps/mach/hurd/poll.c b/sysdeps/mach/hurd/poll.c
index 837c88a75a..50d0ad7290 100644
--- a/sysdeps/mach/hurd/poll.c
+++ b/sysdeps/mach/hurd/poll.c
@@ -1,5 +1,5 @@
/* poll file descriptors. Hurd version.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/ppoll.c b/sysdeps/mach/hurd/ppoll.c
index e8e75b282b..615fc0814c 100644
--- a/sysdeps/mach/hurd/ppoll.c
+++ b/sysdeps/mach/hurd/ppoll.c
@@ -1,5 +1,5 @@
/* poll file descriptors. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/pread.c b/sysdeps/mach/hurd/pread.c
index f4bdd34194..63a90aa4df 100644
--- a/sysdeps/mach/hurd/pread.c
+++ b/sysdeps/mach/hurd/pread.c
@@ -1,6 +1,6 @@
/* Read block from given position in file without changing file pointer.
Hurd version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/pread64.c b/sysdeps/mach/hurd/pread64.c
index 6ce8f72529..1a6ec06acd 100644
--- a/sysdeps/mach/hurd/pread64.c
+++ b/sysdeps/mach/hurd/pread64.c
@@ -1,6 +1,6 @@
/* Read block from given position in file without changing file pointer.
Hurd version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,5 +34,6 @@ __libc_pread64 (int fd, void *buf, size_t nbytes, off64_t offset)
#ifndef __libc_pread64
weak_alias (__libc_pread64, __pread64)
+libc_hidden_weak (__pread64)
weak_alias (__libc_pread64, pread64)
#endif
diff --git a/sysdeps/mach/hurd/profil.c b/sysdeps/mach/hurd/profil.c
index 17028522a7..c2c2f9f119 100644
--- a/sysdeps/mach/hurd/profil.c
+++ b/sysdeps/mach/hurd/profil.c
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Mach/Hurd version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,7 +40,7 @@ static mach_msg_timeout_t collector_timeout; /* ms between collections. */
static int profile_tick;
/* Reply port used by profiler thread */
-static mach_port_t profil_reply_port;
+static mach_port_t profil_reply_port = MACH_PORT_NULL;
/* Forwards */
static kern_return_t profil_task_get_sampled_pcs (mach_port_t,
@@ -63,13 +63,15 @@ update_waiter (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
if (profile_thread == MACH_PORT_NULL)
{
+ if (profil_reply_port == MACH_PORT_NULL)
+ profil_reply_port = __mach_reply_port ();
/* Set up the profiling collector thread. */
err = __thread_create (__mach_task_self (), &profile_thread);
if (! err)
err = __mach_setup_thread (__mach_task_self (), profile_thread,
&profile_waiter, NULL, NULL);
if (! err)
- err = __mach_setup_tls (profile_thread);
+ err = __mach_setup_tls(profile_thread);
}
else
err = 0;
@@ -102,7 +104,7 @@ update_waiter (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
int
__profile_frequency (void)
{
- return profile_tick;
+ return 1000000 / profile_tick;
}
libc_hidden_def (__profile_frequency)
@@ -138,8 +140,10 @@ __profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
}
weak_alias (__profil, profil)
+static volatile error_t special_profil_failure;
+
/* Fetch PC samples. This function must be very careful not to depend
- on Hurd threadvar variables. We arrange that by using a special
+ on Hurd TLS variables. We arrange that by using a special
stub arranged for at the end of this file. */
static void
fetch_samples (void)
@@ -154,14 +158,13 @@ fetch_samples (void)
pc_samples, &nsamples);
if (err)
{
- static error_t special_profil_failure;
- static volatile int a, b, c;
+ static volatile int a, b;
special_profil_failure = err;
a = 1;
b = 0;
while (1)
- c = a / b;
+ a = a / b;
}
for (i = 0; i < nsamples; ++i)
@@ -175,7 +178,7 @@ fetch_samples (void)
}
-/* This function must be very careful not to depend on Hurd threadvar
+/* This function must be very careful not to depend on Hurd TLS
variables. We arrange that by using special stubs arranged for at the
end of this file. */
static void
@@ -184,7 +187,6 @@ profile_waiter (void)
mach_msg_header_t msg;
mach_port_t timeout_reply_port;
- profil_reply_port = __mach_reply_port ();
timeout_reply_port = __mach_reply_port ();
while (1)
@@ -267,7 +269,7 @@ text_set_element (_hurd_fork_child_hook, fork_profil_child);
are fatal in profile_waiter anyhow. */
#define __mig_put_reply_port(foo)
-/* Use our static variable instead of the usual threadvar mechanism for
+/* Use our static variable instead of the usual TLS mechanism for
this. */
#define __mig_get_reply_port() profil_reply_port
diff --git a/sysdeps/mach/hurd/pselect.c b/sysdeps/mach/hurd/pselect.c
index d3a10690dc..1d469c025a 100644
--- a/sysdeps/mach/hurd/pselect.c
+++ b/sysdeps/mach/hurd/pselect.c
@@ -1,5 +1,5 @@
/* pselect for Hurd.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/ptrace.c b/sysdeps/mach/hurd/ptrace.c
index 4e9fa26ab1..d0268a3f98 100644
--- a/sysdeps/mach/hurd/ptrace.c
+++ b/sysdeps/mach/hurd/ptrace.c
@@ -1,5 +1,5 @@
/* Process tracing interface `ptrace' for GNU Hurd.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -155,7 +155,7 @@ ptrace (enum __ptrace_request request, ... )
va_end (ap);
/* SIGKILL always just terminates the task,
so normal kill is just the same when traced. */
- return kill (pid, SIGKILL);
+ return __kill (pid, SIGKILL);
case PTRACE_SINGLESTEP:
/* This is a machine-dependent kernel RPC on
diff --git a/sysdeps/mach/hurd/ptsname.c b/sysdeps/mach/hurd/ptsname.c
index 2978394eb5..5c1dc6e981 100644
--- a/sysdeps/mach/hurd/ptsname.c
+++ b/sysdeps/mach/hurd/ptsname.c
@@ -1,5 +1,5 @@
/* ptsname -- return the name of a pty slave given an FD to the pty master
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <errno.h>
#include <string.h>
+#include <sys/stat.h>
#include <hurd.h>
#include <hurd/fd.h>
#include <hurd/term.h>
@@ -38,11 +39,9 @@ ptsname (int fd)
}
-/* Store at most BUFLEN characters of the pathname of the slave pseudo
- terminal associated with the master FD is open on in BUF.
- Return 0 on success, otherwise an error number. */
+/* We don't need STP, but fill it for conformity with the Linux version... */
int
-__ptsname_r (int fd, char *buf, size_t buflen)
+__ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
{
string_t peername;
size_t len;
@@ -58,7 +57,23 @@ __ptsname_r (int fd, char *buf, size_t buflen)
return ERANGE;
}
+ if (stp)
+ {
+ if (__xstat64 (_STAT_VER, peername, stp) < 0)
+ return errno;
+ }
+
memcpy (buf, peername, len);
return 0;
}
+
+
+/* Store at most BUFLEN characters of the pathname of the slave pseudo
+ terminal associated with the master FD is open on in BUF.
+ Return 0 on success, otherwise an error number. */
+int
+__ptsname_r (int fd, char *buf, size_t buflen)
+{
+ return __ptsname_internal (fd, buf, buflen, NULL);
+}
weak_alias (__ptsname_r, ptsname_r)
diff --git a/sysdeps/mach/hurd/pwrite.c b/sysdeps/mach/hurd/pwrite.c
index a0da13307b..80be158489 100644
--- a/sysdeps/mach/hurd/pwrite.c
+++ b/sysdeps/mach/hurd/pwrite.c
@@ -1,6 +1,6 @@
/* Write block at given position in file without changing file pointer.
Hurd version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/pwrite64.c b/sysdeps/mach/hurd/pwrite64.c
index 8f282da958..bfa6b02c14 100644
--- a/sysdeps/mach/hurd/pwrite64.c
+++ b/sysdeps/mach/hurd/pwrite64.c
@@ -1,6 +1,6 @@
/* Write block to given position in file without changing file pointer.
Hurd version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/read.c b/sysdeps/mach/hurd/read.c
index e636ad447f..20a4b979f6 100644
--- a/sysdeps/mach/hurd/read.c
+++ b/sysdeps/mach/hurd/read.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,3 +30,4 @@ libc_hidden_def (__libc_read)
weak_alias (__libc_read, __read)
libc_hidden_weak (__read)
weak_alias (__libc_read, read)
+libc_hidden_weak (read)
diff --git a/sysdeps/mach/hurd/readdir.c b/sysdeps/mach/hurd/readdir.c
index 7352a37435..16f608cf5a 100644
--- a/sysdeps/mach/hurd/readdir.c
+++ b/sysdeps/mach/hurd/readdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/readdir64.c b/sysdeps/mach/hurd/readdir64.c
index 74296680a6..f28d8603ab 100644
--- a/sysdeps/mach/hurd/readdir64.c
+++ b/sysdeps/mach/hurd/readdir64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -98,4 +98,5 @@ __readdir64 (DIR *dirp)
return dp;
}
+libc_hidden_def (__readdir64)
weak_alias (__readdir64, readdir64)
diff --git a/sysdeps/mach/hurd/readdir64_r.c b/sysdeps/mach/hurd/readdir64_r.c
index e98ada1cd1..eb39833c71 100644
--- a/sysdeps/mach/hurd/readdir64_r.c
+++ b/sysdeps/mach/hurd/readdir64_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/readdir_r.c b/sysdeps/mach/hurd/readdir_r.c
index 479be702a8..4b34434170 100644
--- a/sysdeps/mach/hurd/readdir_r.c
+++ b/sysdeps/mach/hurd/readdir_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/readlink.c b/sysdeps/mach/hurd/readlink.c
index 41bcb43922..e1368d8fd0 100644
--- a/sysdeps/mach/hurd/readlink.c
+++ b/sysdeps/mach/hurd/readlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/readlinkat.c b/sysdeps/mach/hurd/readlinkat.c
index 0f414aed9d..e601c6b619 100644
--- a/sysdeps/mach/hurd/readlinkat.c
+++ b/sysdeps/mach/hurd/readlinkat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/reboot.c b/sysdeps/mach/hurd/reboot.c
index 73d2ad7ad4..beeb9bfcbc 100644
--- a/sysdeps/mach/hurd/reboot.c
+++ b/sysdeps/mach/hurd/reboot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <errno.h>
#include <unistd.h>
#include <hurd.h>
+#include <hurd/paths.h>
#include <hurd/startup.h>
#include <sys/reboot.h>
@@ -33,8 +34,8 @@ reboot (int howto)
if (err)
return __hurd_fail (EPERM);
- err = __USEPORT (PROC, __proc_getmsgport (port, 1, &init));
- if (!err)
+ init = __file_name_lookup (_SERVERS_STARTUP, 0, 0);
+ if (init != MACH_PORT_NULL)
{
err = __startup_reboot (init, hostpriv, howto);
__mach_port_deallocate (__mach_task_self (), init);
diff --git a/sysdeps/mach/hurd/recv.c b/sysdeps/mach/hurd/recv.c
index 1534228c0a..0bc5ce4bfc 100644
--- a/sysdeps/mach/hurd/recv.c
+++ b/sysdeps/mach/hurd/recv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,12 +37,16 @@ __recv (int fd, void *buf, size_t n, int flags)
char *cdata = NULL;
mach_msg_type_number_t clen = 0;
- if (err = HURD_DPORT_USE (fd, __socket_recv (port, &addrport,
+ err = HURD_DPORT_USE (fd, __socket_recv (port, &addrport,
flags, &bufp, &nread,
&ports, &nports,
&cdata, &clen,
&flags,
- n)))
+ n));
+ if (err == MIG_BAD_ID || err == EOPNOTSUPP)
+ /* The file did not grok the socket protocol. */
+ err = ENOTSOCK;
+ if (err)
return __hurd_sockfail (fd, flags, err);
__mach_port_deallocate (__mach_task_self (), addrport);
diff --git a/sysdeps/mach/hurd/recvfrom.c b/sysdeps/mach/hurd/recvfrom.c
index fc4690fcfd..5d71a21b98 100644
--- a/sysdeps/mach/hurd/recvfrom.c
+++ b/sysdeps/mach/hurd/recvfrom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c
index 770a42e05e..770ca7187b 100644
--- a/sysdeps/mach/hurd/recvmsg.c
+++ b/sysdeps/mach/hurd/recvmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -64,7 +64,7 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags)
&message->msg_flags, amount)))
return __hurd_sockfail (fd, flags, err);
- if (message->msg_name != NULL)
+ if (message->msg_name != NULL && aport != MACH_PORT_NULL)
{
char *buf = message->msg_name;
mach_msg_type_number_t buflen = message->msg_namelen;
@@ -98,6 +98,8 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags)
if (buflen > 0)
((struct sockaddr *) message->msg_name)->sa_family = type;
}
+ else if (message->msg_name != NULL)
+ message->msg_namelen = 0;
__mach_port_deallocate (__mach_task_self (), aport);
diff --git a/sysdeps/mach/hurd/removexattr.c b/sysdeps/mach/hurd/removexattr.c
index 60310fa20f..6fdb88c3e9 100644
--- a/sysdeps/mach/hurd/removexattr.c
+++ b/sysdeps/mach/hurd/removexattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/rename.c b/sysdeps/mach/hurd/rename.c
index b2761800d5..ea3ffa3792 100644
--- a/sysdeps/mach/hurd/rename.c
+++ b/sysdeps/mach/hurd/rename.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/renameat.c b/sysdeps/mach/hurd/renameat.c
index 75fece2dd4..7985763f73 100644
--- a/sysdeps/mach/hurd/renameat.c
+++ b/sysdeps/mach/hurd/renameat.c
@@ -1,5 +1,5 @@
/* Rename a file using relative source and destination names. Hurd version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
/* Rename the file OLD relative to OLDFD to NEW relative to NEWFD. */
int
-renameat (int oldfd, const char *old, int newfd, const char *new)
+__renameat (int oldfd, const char *old, int newfd, const char *new)
{
error_t err;
file_t olddir, newdir;
@@ -45,3 +45,5 @@ renameat (int oldfd, const char *old, int newfd, const char *new)
return __hurd_fail (err);
return 0;
}
+libc_hidden_def (__renameat)
+weak_alias (__renameat, renameat)
diff --git a/sysdeps/mach/hurd/revoke.c b/sysdeps/mach/hurd/revoke.c
index 4681eca351..5b1495a238 100644
--- a/sysdeps/mach/hurd/revoke.c
+++ b/sysdeps/mach/hurd/revoke.c
@@ -1,5 +1,5 @@
/* Revoke the access of all descriptors currently open on a file. Hurd version
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
#include <hurd.h>
int
-revoke (const char *file_name)
+__revoke (const char *file_name)
{
error_t err;
file_t file = __file_name_lookup (file_name, 0, 0);
@@ -36,3 +36,5 @@ revoke (const char *file_name)
return __hurd_fail (err);
return 0;
}
+
+weak_alias (__revoke, revoke)
diff --git a/sysdeps/mach/hurd/rewinddir.c b/sysdeps/mach/hurd/rewinddir.c
index 95a816485b..4e8864f9ea 100644
--- a/sysdeps/mach/hurd/rewinddir.c
+++ b/sysdeps/mach/hurd/rewinddir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
void
__rewinddir (DIR *dirp)
{
- seekdir (dirp, (off_t) 0L);
+ __seekdir (dirp, (off_t) 0L);
}
libc_hidden_def (__rewinddir)
weak_alias (__rewinddir, rewinddir)
diff --git a/sysdeps/mach/hurd/rmdir.c b/sysdeps/mach/hurd/rmdir.c
index 58875ee819..1ad10fbb68 100644
--- a/sysdeps/mach/hurd/rmdir.c
+++ b/sysdeps/mach/hurd/rmdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/sbrk.c b/sysdeps/mach/hurd/sbrk.c
index b3409a9dd1..2736342734 100644
--- a/sysdeps/mach/hurd/sbrk.c
+++ b/sysdeps/mach/hurd/sbrk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/seekdir.c b/sysdeps/mach/hurd/seekdir.c
index 1e527d1125..a7b9222452 100644
--- a/sysdeps/mach/hurd/seekdir.c
+++ b/sysdeps/mach/hurd/seekdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,9 +22,8 @@
#include "dirstream.h"
/* Seek to position POS in DIRP. */
-/* XXX should be __seekdir ? */
void
-seekdir (DIR *dirp, long int pos)
+__seekdir (DIR *dirp, long int pos)
{
__libc_lock_lock (dirp->__lock);
/* Change our entry index pointer to POS and discard any data already
@@ -35,3 +34,5 @@ seekdir (DIR *dirp, long int pos)
dirp->__size = 0;
__libc_lock_unlock (dirp->__lock);
}
+
+weak_alias (__seekdir, seekdir)
diff --git a/sysdeps/mach/hurd/select.c b/sysdeps/mach/hurd/select.c
index b81b82435d..bcf8fbf8f7 100644
--- a/sysdeps/mach/hurd/select.c
+++ b/sysdeps/mach/hurd/select.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/send.c b/sysdeps/mach/hurd/send.c
index cc7d2a8b86..c7dc907129 100644
--- a/sysdeps/mach/hurd/send.c
+++ b/sysdeps/mach/hurd/send.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,6 +33,10 @@ __send (int fd, const void *buf, size_t n, int flags)
NULL, MACH_MSG_TYPE_COPY_SEND, 0,
NULL, 0, &wrote));
+ if (err == MIG_BAD_ID || err == EOPNOTSUPP)
+ /* The file did not grok the socket protocol. */
+ err = ENOTSOCK;
+
return err ? __hurd_sockfail (fd, flags, err) : wrote;
}
libc_hidden_def (__send)
diff --git a/sysdeps/mach/hurd/sendfile.c b/sysdeps/mach/hurd/sendfile.c
index 33bfe2d48e..4df66b56d7 100644
--- a/sysdeps/mach/hurd/sendfile.c
+++ b/sysdeps/mach/hurd/sendfile.c
@@ -1,5 +1,5 @@
/* sendfile -- copy data directly from one file descriptor to another
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,11 +25,11 @@ ssize_t
sendfile (int out_fd, int in_fd, off_t *offset, size_t count)
{
if (offset == NULL || sizeof (off_t) == sizeof (off64_t))
- return sendfile64 (out_fd, in_fd, (off64_t *) offset, count);
+ return __sendfile64 (out_fd, in_fd, (off64_t *) offset, count);
else
{
off64_t ofs = *offset;
- ssize_t ret = sendfile64 (out_fd, in_fd, &ofs, count);
+ ssize_t ret = __sendfile64 (out_fd, in_fd, &ofs, count);
*offset = ofs;
return ret;
}
diff --git a/sysdeps/mach/hurd/sendfile64.c b/sysdeps/mach/hurd/sendfile64.c
index 99412706a9..ea4e96da90 100644
--- a/sysdeps/mach/hurd/sendfile64.c
+++ b/sysdeps/mach/hurd/sendfile64.c
@@ -1,5 +1,5 @@
/* sendfile -- copy data directly from one file descriptor to another
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
/* Send COUNT bytes from file associated with IN_FD starting at OFFSET to
descriptor OUT_FD. */
ssize_t
-sendfile64 (int out_fd, int in_fd, off64_t *offset, size_t count)
+__sendfile64 (int out_fd, int in_fd, off64_t *offset, size_t count)
{
/* We just do a vanilla io_read followed by a vanilla io_write here.
In theory the IN_FD filesystem can return us out-of-line data that
@@ -47,7 +47,7 @@ sendfile64 (int out_fd, int in_fd, off64_t *offset, size_t count)
return 0;
err = HURD_DPORT_USE (out_fd, __io_write (port, data, datalen,
(off_t) -1, &nwrote));
- munmap (data, datalen);
+ __munmap (data, datalen);
if (err == 0)
{
if (offset)
@@ -57,3 +57,4 @@ sendfile64 (int out_fd, int in_fd, off64_t *offset, size_t count)
}
return __hurd_fail (err);
}
+strong_alias (__sendfile64, sendfile64)
diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c
index ce40764992..d12f4a1e90 100644
--- a/sysdeps/mach/hurd/sendmsg.c
+++ b/sysdeps/mach/hurd/sendmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/sendto.c b/sysdeps/mach/hurd/sendto.c
index 7570246cf6..46cabbb9cf 100644
--- a/sysdeps/mach/hurd/sendto.c
+++ b/sysdeps/mach/hurd/sendto.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setdomain.c b/sysdeps/mach/hurd/setdomain.c
index 8cd19bd25f..f78e8626c1 100644
--- a/sysdeps/mach/hurd/setdomain.c
+++ b/sysdeps/mach/hurd/setdomain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setegid.c b/sysdeps/mach/hurd/setegid.c
index 9057135222..c5e8cf622f 100644
--- a/sysdeps/mach/hurd/setegid.c
+++ b/sysdeps/mach/hurd/setegid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/seteuid.c b/sysdeps/mach/hurd/seteuid.c
index 3e16aba175..d6001960a8 100644
--- a/sysdeps/mach/hurd/seteuid.c
+++ b/sysdeps/mach/hurd/seteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setgid.c b/sysdeps/mach/hurd/setgid.c
index 3bd1ac9f0a..faac055f71 100644
--- a/sysdeps/mach/hurd/setgid.c
+++ b/sysdeps/mach/hurd/setgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setgroups.c b/sysdeps/mach/hurd/setgroups.c
index 23ae4f570e..cdfa869fc2 100644
--- a/sysdeps/mach/hurd/setgroups.c
+++ b/sysdeps/mach/hurd/setgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/sethostid.c b/sysdeps/mach/hurd/sethostid.c
index 5f0620312b..90c816884b 100644
--- a/sysdeps/mach/hurd/sethostid.c
+++ b/sysdeps/mach/hurd/sethostid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/sethostname.c b/sysdeps/mach/hurd/sethostname.c
index cbb507fd0b..2771afc2f6 100644
--- a/sysdeps/mach/hurd/sethostname.c
+++ b/sysdeps/mach/hurd/sethostname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setitimer.c b/sysdeps/mach/hurd/setitimer.c
index 48346e2eab..f5dfb7da84 100644
--- a/sysdeps/mach/hurd/setitimer.c
+++ b/sysdeps/mach/hurd/setitimer.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -226,7 +226,7 @@ setitimer_locked (const struct itimerval *new, struct itimerval *old,
&timer_thread,
&_hurd_itimer_thread_stack_base,
&_hurd_itimer_thread_stack_size))
- || (err = __mach_setup_tls (_hurd_itimer_thread)))
+ || (err = __mach_setup_tls(_hurd_itimer_thread)))
{
__thread_terminate (_hurd_itimer_thread);
_hurd_itimer_thread = MACH_PORT_NULL;
diff --git a/sysdeps/mach/hurd/setlogin.c b/sysdeps/mach/hurd/setlogin.c
index 30717157a9..bb12e81a52 100644
--- a/sysdeps/mach/hurd/setlogin.c
+++ b/sysdeps/mach/hurd/setlogin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setpgid.c b/sysdeps/mach/hurd/setpgid.c
index 8579efb9b1..98b1341cfa 100644
--- a/sysdeps/mach/hurd/setpgid.c
+++ b/sysdeps/mach/hurd/setpgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <unistd.h>
#include <hurd.h>
#include <hurd/port.h>
+#include <lowlevellock.h>
/* Set the process group ID of the process matching PID to PGID.
If PID is zero, the current process's process group ID is set.
@@ -38,14 +39,7 @@ __setpgid (pid_t pid, pid_t pgid)
/* Synchronize with the signal thread to make sure we have
received and processed proc_newids before returning to the user. */
while (_hurd_pids_changed_stamp == stamp)
- {
-#ifdef noteven
- /* XXX we have no need for a mutex, but cthreads demands one. */
- __condition_wait (&_hurd_pids_changed_sync, NULL);
-#else
- __swtch_pri(0);
-#endif
- }
+ lll_wait (&_hurd_pids_changed_stamp, stamp, 0);
return 0;
diff --git a/sysdeps/mach/hurd/setpriority.c b/sysdeps/mach/hurd/setpriority.c
index 23f4c282f0..a9c263491d 100644
--- a/sysdeps/mach/hurd/setpriority.c
+++ b/sysdeps/mach/hurd/setpriority.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setregid.c b/sysdeps/mach/hurd/setregid.c
index 24797f3968..45953474b7 100644
--- a/sysdeps/mach/hurd/setregid.c
+++ b/sysdeps/mach/hurd/setregid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setresgid.c b/sysdeps/mach/hurd/setresgid.c
index 256fac4a20..d09935d8b0 100644
--- a/sysdeps/mach/hurd/setresgid.c
+++ b/sysdeps/mach/hurd/setresgid.c
@@ -1,5 +1,5 @@
/* setresgid -- set real group ID, effective group ID, and saved-set group ID
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setresuid.c b/sysdeps/mach/hurd/setresuid.c
index 7d33e205ac..3ed7dfd021 100644
--- a/sysdeps/mach/hurd/setresuid.c
+++ b/sysdeps/mach/hurd/setresuid.c
@@ -1,5 +1,5 @@
/* setresuid -- set real user ID, effective user ID, and saved-set user ID
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setreuid.c b/sysdeps/mach/hurd/setreuid.c
index e4e05f6e4c..12548b375b 100644
--- a/sysdeps/mach/hurd/setreuid.c
+++ b/sysdeps/mach/hurd/setreuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setrlimit.c b/sysdeps/mach/hurd/setrlimit.c
index 2e73910652..8866f05935 100644
--- a/sysdeps/mach/hurd/setrlimit.c
+++ b/sysdeps/mach/hurd/setrlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,4 +53,5 @@ __setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits)
return 0;
}
+libc_hidden_def (__setrlimit)
weak_alias (__setrlimit, setrlimit)
diff --git a/sysdeps/mach/hurd/setsid.c b/sysdeps/mach/hurd/setsid.c
index c66466686f..7b989361d1 100644
--- a/sysdeps/mach/hurd/setsid.c
+++ b/sysdeps/mach/hurd/setsid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <hurd/port.h>
#include <hurd/fd.h>
#include <hurd/ioctl.h>
+#include <lowlevellock.h>
/* Create a new session with the calling process as its leader.
The process group IDs of the session and the calling process
@@ -55,14 +56,7 @@ __setsid (void)
returned by `getpgrp ()' in other threads) has been updated before
we return. */
while (_hurd_pids_changed_stamp == stamp)
- {
-#ifdef noteven
- /* XXX we have no need for a mutex, but cthreads demands one. */
- __condition_wait (&_hurd_pids_changed_sync, NULL);
-#else
- __swtch_pri (0);
-#endif
- }
+ lll_wait (&_hurd_pids_changed_stamp, stamp, 0);
}
HURD_CRITICAL_END;
diff --git a/sysdeps/mach/hurd/setsockopt.c b/sysdeps/mach/hurd/setsockopt.c
index 70c1ee70b9..c837a7c9e9 100644
--- a/sysdeps/mach/hurd/setsockopt.c
+++ b/sysdeps/mach/hurd/setsockopt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/settimeofday.c b/sysdeps/mach/hurd/settimeofday.c
index 3380e19b02..a29c488ed7 100644
--- a/sysdeps/mach/hurd/settimeofday.c
+++ b/sysdeps/mach/hurd/settimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setuid.c b/sysdeps/mach/hurd/setuid.c
index 6fca89c288..e3c0120c98 100644
--- a/sysdeps/mach/hurd/setuid.c
+++ b/sysdeps/mach/hurd/setuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/setxattr.c b/sysdeps/mach/hurd/setxattr.c
index 5cb2a8eee3..ea23652190 100644
--- a/sysdeps/mach/hurd/setxattr.c
+++ b/sysdeps/mach/hurd/setxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/shutdown.c b/sysdeps/mach/hurd/shutdown.c
index 8f87e91353..484820f275 100644
--- a/sysdeps/mach/hurd/shutdown.c
+++ b/sysdeps/mach/hurd/shutdown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/sigaction.c b/sysdeps/mach/hurd/sigaction.c
index 3ff9d183f0..5f010064c9 100644
--- a/sysdeps/mach/hurd/sigaction.c
+++ b/sysdeps/mach/hurd/sigaction.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/mach/hurd/sigaltstack.c b/sysdeps/mach/hurd/sigaltstack.c
index 316540a935..44b019aaf2 100644
--- a/sysdeps/mach/hurd/sigaltstack.c
+++ b/sysdeps/mach/hurd/sigaltstack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,16 +22,16 @@
/* Run signals handlers on the stack specified by SS (if not NULL).
If OSS is not NULL, it is filled in with the old signal stack status. */
int
-__sigaltstack (const struct sigaltstack *argss, struct sigaltstack *oss)
+__sigaltstack (const stack_t *argss, stack_t *oss)
{
struct hurd_sigstate *s;
- struct sigaltstack ss, old;
+ stack_t ss, old;
/* Fault before taking any locks. */
if (argss != NULL)
ss = *argss;
if (oss != NULL)
- *(volatile struct sigaltstack *) oss = *oss;
+ *(volatile stack_t *) oss = *oss;
s = _hurd_self_sigstate ();
__spin_lock (&s->lock);
@@ -57,4 +57,5 @@ __sigaltstack (const struct sigaltstack *argss, struct sigaltstack *oss)
return 0;
}
+libc_hidden_def (__sigaltstack)
weak_alias (__sigaltstack, sigaltstack)
diff --git a/sysdeps/mach/hurd/siglist.h b/sysdeps/mach/hurd/siglist.h
index c45171603c..193ca6dec2 100644
--- a/sysdeps/mach/hurd/siglist.h
+++ b/sysdeps/mach/hurd/siglist.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/sigpending.c b/sysdeps/mach/hurd/sigpending.c
index ef855329c6..ea41ddc427 100644
--- a/sysdeps/mach/hurd/sigpending.c
+++ b/sysdeps/mach/hurd/sigpending.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/sigprocmask.c b/sysdeps/mach/hurd/sigprocmask.c
index 9168224b0c..e2587afcbc 100644
--- a/sysdeps/mach/hurd/sigprocmask.c
+++ b/sysdeps/mach/hurd/sigprocmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -80,4 +80,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
return 0;
}
+libc_hidden_def (__sigprocmask)
weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/mach/hurd/sigstack.c b/sysdeps/mach/hurd/sigstack.c
index 4bce41365e..d87d220e39 100644
--- a/sysdeps/mach/hurd/sigstack.c
+++ b/sysdeps/mach/hurd/sigstack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
int
sigstack (struct sigstack *ss, struct sigstack *oss)
{
- struct sigaltstack as, oas;
+ stack_t as, oas;
as.ss_sp = ss->ss_sp;
as.ss_size = 0;
diff --git a/sysdeps/mach/hurd/sigsuspend.c b/sysdeps/mach/hurd/sigsuspend.c
index bafac7e94d..7da3897722 100644
--- a/sysdeps/mach/hurd/sigsuspend.c
+++ b/sysdeps/mach/hurd/sigsuspend.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -79,5 +79,4 @@ __sigsuspend (const sigset_t *set)
return -1;
}
libc_hidden_def (__sigsuspend)
-strong_alias (__sigsuspend, sigsuspend_not_cancel)
weak_alias (__sigsuspend, sigsuspend)
diff --git a/sysdeps/mach/hurd/sigwait.c b/sysdeps/mach/hurd/sigwait.c
index ab10913f3a..ce17cce895 100644
--- a/sysdeps/mach/hurd/sigwait.c
+++ b/sysdeps/mach/hurd/sigwait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/socket.c b/sysdeps/mach/hurd/socket.c
index 34c66a8481..43f2c3b2b5 100644
--- a/sysdeps/mach/hurd/socket.c
+++ b/sysdeps/mach/hurd/socket.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <hurd/socket.h>
#include <hurd/fd.h>
#include <fcntl.h>
+#include <fcntl-internal.h>
/* Create a new socket of type TYPE in domain DOMAIN, using
protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
@@ -30,6 +31,11 @@ __socket (int domain, int type, int protocol)
{
error_t err;
socket_t sock, server;
+ int flags = sock_to_o_flags (type & ~SOCK_TYPE_MASK);
+ type &= SOCK_TYPE_MASK;
+
+ if (flags & ~(O_CLOEXEC | O_NONBLOCK))
+ return __hurd_fail (EINVAL);
/* Find the socket server for DOMAIN. */
server = _hurd_socket_server (domain, 0);
@@ -55,10 +61,17 @@ __socket (int domain, int type, int protocol)
|| err == MIG_BAD_ID || err == EOPNOTSUPP)
err = EAFNOSUPPORT;
+ if (! err)
+ {
+ if (flags & O_NONBLOCK)
+ err = __io_set_some_openmodes (sock, O_NONBLOCK);
+ /* TODO: do we need special ERR massaging after the previous call? */
+ }
+
if (err)
return __hurd_fail (err);
- return _hurd_intern_fd (sock, O_IGNORE_CTTY, 1);
+ return _hurd_intern_fd (sock, O_IGNORE_CTTY | flags, 1);
}
libc_hidden_def (__socket)
diff --git a/sysdeps/mach/hurd/socketpair.c b/sysdeps/mach/hurd/socketpair.c
index 0b0d4e9417..6dce208157 100644
--- a/sysdeps/mach/hurd/socketpair.c
+++ b/sysdeps/mach/hurd/socketpair.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <fcntl-internal.h>
#include <sys/socket.h>
#include <unistd.h>
@@ -34,6 +35,11 @@ __socketpair (int domain, int type, int protocol, int fds[2])
error_t err;
socket_t server, sock1, sock2;
int d1, d2;
+ int flags = sock_to_o_flags (type & ~SOCK_TYPE_MASK);
+ type &= SOCK_TYPE_MASK;
+
+ if (flags & ~(O_CLOEXEC | O_NONBLOCK))
+ return __hurd_fail (EINVAL);
if (fds == NULL)
return __hurd_fail (EINVAL);
@@ -56,6 +62,14 @@ __socketpair (int domain, int type, int protocol, int fds[2])
return -1;
err = __socket_create (server, type, protocol, &sock1);
}
+ /* TODO: do we need special ERR massaging here, like it is done in
+ __socket? */
+ if (! err)
+ {
+ if (flags & O_NONBLOCK)
+ err = __io_set_some_openmodes (sock1, O_NONBLOCK);
+ /* TODO: do we need special ERR massaging after the previous call? */
+ }
if (err)
return __hurd_fail (err);
if (err = __socket_create (server, type, protocol, &sock2))
@@ -63,7 +77,12 @@ __socketpair (int domain, int type, int protocol, int fds[2])
__mach_port_deallocate (__mach_task_self (), sock1);
return __hurd_fail (err);
}
- if (err = __socket_connect2 (sock1, sock2))
+ if (flags & O_NONBLOCK)
+ err = __io_set_some_openmodes (sock2, O_NONBLOCK);
+ /* TODO: do we need special ERR massaging after the previous call? */
+ if (! err)
+ err = __socket_connect2 (sock1, sock2);
+ if (err)
{
__mach_port_deallocate (__mach_task_self (), sock1);
__mach_port_deallocate (__mach_task_self (), sock2);
@@ -72,17 +91,17 @@ __socketpair (int domain, int type, int protocol, int fds[2])
/* Put the sockets into file descriptors. */
- d1 = _hurd_intern_fd (sock1, O_IGNORE_CTTY, 1);
+ d1 = _hurd_intern_fd (sock1, O_IGNORE_CTTY | flags, 1);
if (d1 < 0)
{
__mach_port_deallocate (__mach_task_self (), sock2);
return -1;
}
- d2 = _hurd_intern_fd (sock2, O_IGNORE_CTTY, 1);
+ d2 = _hurd_intern_fd (sock2, O_IGNORE_CTTY | flags, 1);
if (d2 < 0)
{
err = errno;
- (void) close (d1);
+ (void) __close (d1);
return __hurd_fail (err);
}
diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c
index 328a4bb13f..9351c13e56 100644
--- a/sysdeps/mach/hurd/spawni.c
+++ b/sysdeps/mach/hurd/spawni.c
@@ -1,5 +1,5 @@
/* spawn a new process running an executable. Hurd version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,7 @@
#include <spawn.h>
#include <stdlib.h>
#include <string.h>
+#include <stdio.h>
#include <unistd.h>
#include <hurd.h>
#include <hurd/signal.h>
@@ -44,6 +45,9 @@ __spawni (pid_t *pid, const char *file,
{
pid_t new_pid;
char *path, *p, *name;
+ char *concat_name = NULL;
+ const char *relpath, *abspath;
+ int res;
size_t len;
size_t pathlen;
short int flags;
@@ -59,14 +63,14 @@ __spawni (pid_t *pid, const char *file,
that remains visible after an exec is registration with the proc
server, and the inheritance of various values and ports. All those
inherited values and ports are what get collected up and passed in the
- file_exec RPC by an exec call. So we do the proc server registration
- here, following the model of fork (see fork.c). We then collect up
- the inherited values and ports from this (parent) process following
- the model of exec (see hurd/hurdexec.c), modify or replace each value
- that fork would (plus the specific changes demanded by ATTRP and
- FILE_ACTIONS), and make the file_exec RPC on the requested executable
- file with the child process's task port rather than our own. This
- should be indistinguishable from the fork + exec implementation,
+ file_exec_paths RPC by an exec call. So we do the proc server
+ registration here, following the model of fork (see fork.c). We then
+ collect up the inherited values and ports from this (parent) process
+ following the model of exec (see hurd/hurdexec.c), modify or replace each
+ value that fork would (plus the specific changes demanded by ATTRP and
+ FILE_ACTIONS), and make the file_exec_paths RPC on the requested
+ executable file with the child process's task port rather than our own.
+ This should be indistinguishable from the fork + exec implementation,
except that all errors will be detected here (in the parent process)
and return proper errno codes rather than the child dying with 127.
@@ -281,6 +285,9 @@ __spawni (pid_t *pid, const char *file,
}
#endif
+ if (!err && (flags & POSIX_SPAWN_SETSID) != 0)
+ err = __proc_setsid (proc);
+
/* Set the process group ID. */
if (!err && (flags & POSIX_SPAWN_SETPGROUP) != 0)
err = __proc_setpgrp (proc, new_pid, attrp->__pgrp);
@@ -544,7 +551,7 @@ __spawni (pid_t *pid, const char *file,
if ((xflags & SPAWN_XFLAGS_USE_PATH) == 0 || strchr (file, '/') != NULL)
/* The FILE parameter is actually a path. */
- err = child_lookup (file, O_EXEC, 0, &execfile);
+ err = child_lookup (relpath = file, O_EXEC, 0, &execfile);
else
{
/* We have to search for FILE on the path. */
@@ -605,6 +612,7 @@ __spawni (pid_t *pid, const char *file,
}
// We only get here when we are done looking for the file.
+ relpath = startp;
break;
}
while (*p++ != '\0');
@@ -612,6 +620,26 @@ __spawni (pid_t *pid, const char *file,
if (err)
goto out;
+ if (relpath[0] == '/')
+ {
+ /* Already an absolute path */
+ abspath = relpath;
+ }
+ else
+ {
+ /* Relative path */
+ char *cwd = __getcwd (NULL, 0);
+ if (cwd == NULL)
+ goto out;
+
+ res = __asprintf (&concat_name, "%s/%s", cwd, relpath);
+ free (cwd);
+ if (res == -1)
+ goto out;
+
+ abspath = concat_name;
+ }
+
/* Almost there! */
{
mach_port_t ports[_hurd_nports];
@@ -621,14 +649,28 @@ __spawni (pid_t *pid, const char *file,
inline error_t exec (file_t file)
{
- return __file_exec (file, task,
- (__sigismember (&_hurdsig_traced, SIGKILL)
- ? EXEC_SIGTRAP : 0),
- args, argslen, env, envlen,
- dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
- ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports,
- ints, INIT_INT_MAX,
- NULL, 0, NULL, 0);
+ error_t err = __file_exec_paths
+ (file, task,
+ __sigismember (&_hurdsig_traced, SIGKILL) ? EXEC_SIGTRAP : 0,
+ relpath, abspath, args, argslen, env, envlen,
+ dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
+ ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports,
+ ints, INIT_INT_MAX,
+ NULL, 0, NULL, 0);
+
+ /* Fallback for backwards compatibility. This can just be removed
+ when __file_exec goes away. */
+ if (err == MIG_BAD_ID)
+ return __file_exec (file, task,
+ (__sigismember (&_hurdsig_traced, SIGKILL)
+ ? EXEC_SIGTRAP : 0),
+ args, argslen, env, envlen,
+ dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
+ ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports,
+ ints, INIT_INT_MAX,
+ NULL, 0, NULL, 0);
+
+ return err;
}
/* Now we are out of things that can fail before the file_exec RPC,
@@ -747,6 +789,8 @@ __spawni (pid_t *pid, const char *file,
_hurd_port_free (dtable_cells[i], &ulink_dtable[i], dtable[i]);
}
+ free (concat_name);
+
if (err)
/* This hack canonicalizes the error code that we return. */
err = (__hurd_fail (err), errno);
diff --git a/sysdeps/mach/hurd/statfs.c b/sysdeps/mach/hurd/statfs.c
index 2bb4702d13..b64eae5182 100644
--- a/sysdeps/mach/hurd/statfs.c
+++ b/sysdeps/mach/hurd/statfs.c
@@ -1,5 +1,5 @@
/* statfs -- Return information about the filesystem on which FILE resides.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/statfs64.c b/sysdeps/mach/hurd/statfs64.c
index cf60fee0f6..1697079fc3 100644
--- a/sysdeps/mach/hurd/statfs64.c
+++ b/sysdeps/mach/hurd/statfs64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/statfsconv.c b/sysdeps/mach/hurd/statfsconv.c
index c32f4355e2..4a699d10a6 100644
--- a/sysdeps/mach/hurd/statfsconv.c
+++ b/sysdeps/mach/hurd/statfsconv.c
@@ -1,5 +1,5 @@
/* Convert between `struct statfs' format, and `struct statfs64' format.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/statvfs.c b/sysdeps/mach/hurd/statvfs.c
index 5b0fe163cf..92e197806d 100644
--- a/sysdeps/mach/hurd/statvfs.c
+++ b/sysdeps/mach/hurd/statvfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/statvfs64.c b/sysdeps/mach/hurd/statvfs64.c
index 18e6b8e0a5..f6dd8feda8 100644
--- a/sysdeps/mach/hurd/statvfs64.c
+++ b/sysdeps/mach/hurd/statvfs64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/symlink.c b/sysdeps/mach/hurd/symlink.c
index 5aca56033e..d8a31ec458 100644
--- a/sysdeps/mach/hurd/symlink.c
+++ b/sysdeps/mach/hurd/symlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/symlinkat.c b/sysdeps/mach/hurd/symlinkat.c
index be9c65fdfb..4c4eaaaee7 100644
--- a/sysdeps/mach/hurd/symlinkat.c
+++ b/sysdeps/mach/hurd/symlinkat.c
@@ -1,5 +1,5 @@
/* Create a symbolic link named relative to an open directory. Hurd version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/sync.c b/sysdeps/mach/hurd/sync.c
index 4d9fb6c853..ed5709ca34 100644
--- a/sysdeps/mach/hurd/sync.c
+++ b/sysdeps/mach/hurd/sync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/syncfs.c b/sysdeps/mach/hurd/syncfs.c
index 0b65f22220..eb57f5dfed 100644
--- a/sysdeps/mach/hurd/syncfs.c
+++ b/sysdeps/mach/hurd/syncfs.c
@@ -1,6 +1,6 @@
/* Make all changes done to all files on the file system associated
with FD actually appear on disk.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/sysconf.c b/sysdeps/mach/hurd/sysconf.c
index 5c8220516e..b9d837a83f 100644
--- a/sysdeps/mach/hurd/sysconf.c
+++ b/sysdeps/mach/hurd/sysconf.c
@@ -1,5 +1,5 @@
/* Return values of system parameters. Hurd version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/sysdep-cancel.h b/sysdeps/mach/hurd/sysdep-cancel.h
new file mode 100644
index 0000000000..ec55c7330f
--- /dev/null
+++ b/sysdeps/mach/hurd/sysdep-cancel.h
@@ -0,0 +1,9 @@
+#include <sysdep.h>
+
+/* Always multi-thread (since there's at least the sig handler), but no
+ handling enabled. */
+#define SINGLE_THREAD_P (0)
+#define RTLD_SINGLE_THREAD_P (0)
+#define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */
+#define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */
+#define LIBC_CANCEL_HANDLED() /* Nothing. */
diff --git a/sysdeps/mach/hurd/telldir.c b/sysdeps/mach/hurd/telldir.c
index 8a53d3aa75..5ff62f359f 100644
--- a/sysdeps/mach/hurd/telldir.c
+++ b/sysdeps/mach/hurd/telldir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/times.c b/sysdeps/mach/hurd/times.c
index 27f510f1ef..246280115a 100644
--- a/sysdeps/mach/hurd/times.c
+++ b/sysdeps/mach/hurd/times.c
@@ -1,5 +1,5 @@
/* Return CPU and real time used by process and its children. Hurd version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/tls.h b/sysdeps/mach/hurd/tls.h
index 67ed17d00d..67c657b655 100644
--- a/sysdeps/mach/hurd/tls.h
+++ b/sysdeps/mach/hurd/tls.h
@@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. Hurd version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,7 @@
# include <sysdep.h>
# include <mach/mig_errors.h>
# include <mach.h>
+# include <atomic.h>
/* This is the size of the initial TCB. */
@@ -51,6 +52,26 @@
# define GET_DTV(descr) \
(((tcbhead_t *) (descr))->dtv)
+/* Global scope switch support. */
+#define THREAD_GSCOPE_IN_TCB 0
+#define THREAD_GSCOPE_GLOBAL
+#define THREAD_GSCOPE_SET_FLAG() \
+ atomic_exchange_and_add_acq (&GL(dl_thread_gscope_count), 1)
+#define THREAD_GSCOPE_RESET_FLAG() \
+ do \
+ if (atomic_exchange_and_add_rel (&GL(dl_thread_gscope_count), -1) == 1) \
+ lll_wake (&GL(dl_thread_gscope_count), 0); \
+ while (0)
+#define THREAD_GSCOPE_WAIT() \
+ do \
+ { \
+ int count; \
+ atomic_write_barrier (); \
+ while ((count = GL(dl_thread_gscope_count))) \
+ lll_wait (&GL(dl_thread_gscope_count), count, 0); \
+ } \
+ while (0)
+
#endif /* !ASSEMBLER */
diff --git a/sysdeps/mach/hurd/tmpfile.c b/sysdeps/mach/hurd/tmpfile.c
index 5e09f8a36d..488bb6ae2b 100644
--- a/sysdeps/mach/hurd/tmpfile.c
+++ b/sysdeps/mach/hurd/tmpfile.c
@@ -1,5 +1,5 @@
/* Open a stdio stream on an anonymous temporary file. Hurd version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/truncate.c b/sysdeps/mach/hurd/truncate.c
index 5039a474b0..e3fc452511 100644
--- a/sysdeps/mach/hurd/truncate.c
+++ b/sysdeps/mach/hurd/truncate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/truncate64.c b/sysdeps/mach/hurd/truncate64.c
new file mode 100644
index 0000000000..0d30a1cc01
--- /dev/null
+++ b/sysdeps/mach/hurd/truncate64.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1991-2018 Free Software 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 <unistd.h>
+#include <hurd.h>
+
+/* Truncate FILE_NAME to LENGTH bytes. */
+int
+__truncate64 (const char *file_name, off64_t length)
+{
+ error_t err;
+ file_t file = __file_name_lookup (file_name, O_WRITE, 0);
+
+ if (file == MACH_PORT_NULL)
+ return -1;
+
+ err = __file_set_size (file, length);
+ __mach_port_deallocate (__mach_task_self (), file);
+
+ if (err)
+ return __hurd_fail (err);
+ return 0;
+}
+
+weak_alias (__truncate64, truncate64)
diff --git a/sysdeps/mach/hurd/ttyname.c b/sysdeps/mach/hurd/ttyname.c
index 73944e9e3d..f500095650 100644
--- a/sysdeps/mach/hurd/ttyname.c
+++ b/sysdeps/mach/hurd/ttyname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/ttyname_r.c b/sysdeps/mach/hurd/ttyname_r.c
index 1e984a3f66..b307080b6d 100644
--- a/sysdeps/mach/hurd/ttyname_r.c
+++ b/sysdeps/mach/hurd/ttyname_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/umask.c b/sysdeps/mach/hurd/umask.c
index b1e81dcaab..420e35a5fc 100644
--- a/sysdeps/mach/hurd/umask.c
+++ b/sysdeps/mach/hurd/umask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/uname.c b/sysdeps/mach/hurd/uname.c
index e62ce8eea1..2d5323e32d 100644
--- a/sysdeps/mach/hurd/uname.c
+++ b/sysdeps/mach/hurd/uname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/unlink.c b/sysdeps/mach/hurd/unlink.c
index 30e34efde5..6376fefd57 100644
--- a/sysdeps/mach/hurd/unlink.c
+++ b/sysdeps/mach/hurd/unlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/unlinkat.c b/sysdeps/mach/hurd/unlinkat.c
index 8d6fa7cc29..f20a0f20a0 100644
--- a/sysdeps/mach/hurd/unlinkat.c
+++ b/sysdeps/mach/hurd/unlinkat.c
@@ -1,5 +1,5 @@
/* unlinkat -- Remove a name relative to an open directory. Hurd version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/utime-helper.c b/sysdeps/mach/hurd/utime-helper.c
new file mode 100644
index 0000000000..6aed3316a7
--- /dev/null
+++ b/sysdeps/mach/hurd/utime-helper.c
@@ -0,0 +1,154 @@
+/* Helpers for utimes/utimens conversions.
+ Copyright (C) 2015-2018 Free Software 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 <hurd/hurd_types.h>
+#include <stddef.h>
+#include <sys/time.h>
+
+/* Initializes atime/mtime timespec structures from an array of timeval. */
+static inline void
+utime_ts_from_tval (const struct timeval tvp[2],
+ struct timespec *atime, struct timespec *mtime)
+{
+ if (tvp == NULL)
+ {
+ /* Setting the number of nanoseconds to UTIME_NOW tells the
+ underlying filesystems to use the current time. */
+ atime->tv_sec = 0;
+ atime->tv_nsec = UTIME_NOW;
+ mtime->tv_sec = 0;
+ mtime->tv_nsec = UTIME_NOW;
+ }
+ else
+ {
+ TIMEVAL_TO_TIMESPEC (&tvp[0], atime);
+ TIMEVAL_TO_TIMESPEC (&tvp[1], mtime);
+ }
+}
+
+/* Initializes atime/mtime time_value_t structures from an array of timeval. */
+static inline void
+utime_tvalue_from_tval (const struct timeval tvp[2],
+ time_value_t *atime, time_value_t *mtime)
+{
+ if (tvp == NULL)
+ /* Setting the number of microseconds to `-1' tells the
+ underlying filesystems to use the current time. */
+ atime->microseconds = mtime->microseconds = -1;
+ else
+ {
+ atime->seconds = tvp[0].tv_sec;
+ atime->microseconds = tvp[0].tv_usec;
+ mtime->seconds = tvp[1].tv_sec;
+ mtime->microseconds = tvp[1].tv_usec;
+ }
+}
+
+/* Changes the access time of the file behind PORT using a timeval array. */
+static inline error_t
+hurd_futimes (const file_t port, const struct timeval tvp[2])
+{
+ error_t err;
+ struct timespec atime, mtime;
+
+ utime_ts_from_tval (tvp, &atime, &mtime);
+
+ err = __file_utimens (port, atime, mtime);
+
+ if (err == MIG_BAD_ID || err == EOPNOTSUPP)
+ {
+ time_value_t atim, mtim;
+
+ utime_tvalue_from_tval (tvp, &atim, &mtim);
+
+ err = __file_utimes (port, atim, mtim);
+ }
+
+ return err;
+}
+
+/* Initializes atime/mtime timespec structures from an array of timespec. */
+static inline void
+utime_ts_from_tspec (const struct timespec tsp[2],
+ struct timespec *atime, struct timespec *mtime)
+{
+ if (tsp == NULL)
+ {
+ /* Setting the number of nanoseconds to UTIME_NOW tells the
+ underlying filesystems to use the current time. */
+ atime->tv_sec = 0;
+ atime->tv_nsec = UTIME_NOW;
+ mtime->tv_sec = 0;
+ mtime->tv_nsec = UTIME_NOW;
+ }
+ else
+ {
+ *atime = tsp[0];
+ *mtime = tsp[1];
+ }
+}
+
+/* Initializes atime/mtime time_value_t structures from an array of timespec. */
+static inline void
+utime_tvalue_from_tspec (const struct timespec tsp[2],
+ time_value_t *atime, time_value_t *mtime)
+{
+ if (tsp == NULL)
+ /* Setting the number of microseconds to `-1' tells the
+ underlying filesystems to use the current time. */
+ atime->microseconds = mtime->microseconds = -1;
+ else
+ {
+ if (tsp[0].tv_nsec == UTIME_NOW)
+ atime->microseconds = -1;
+ else if (tsp[0].tv_nsec == UTIME_OMIT)
+ atime->microseconds = -2;
+ else
+ TIMESPEC_TO_TIME_VALUE (atime, &(tsp[0]));
+ if (tsp[1].tv_nsec == UTIME_NOW)
+ mtime->microseconds = -1;
+ else if (tsp[1].tv_nsec == UTIME_OMIT)
+ mtime->microseconds = -2;
+ else
+ TIMESPEC_TO_TIME_VALUE (mtime, &(tsp[1]));
+ }
+}
+
+/* Changes the access time of the file behind PORT using a timespec array. */
+static inline error_t
+hurd_futimens (const file_t port, const struct timespec tsp[2])
+{
+ error_t err;
+ struct timespec atime, mtime;
+
+ utime_ts_from_tspec (tsp, &atime, &mtime);
+
+ err = __file_utimens (port, atime, mtime);
+
+ if (err == MIG_BAD_ID || err == EOPNOTSUPP)
+ {
+ time_value_t atim, mtim;
+
+ utime_tvalue_from_tspec (tsp, &atim, &mtim);
+
+ err = __file_utimes (port, atim, mtim);
+ }
+
+ return err;
+}
diff --git a/sysdeps/mach/hurd/utimensat.c b/sysdeps/mach/hurd/utimensat.c
new file mode 100644
index 0000000000..ac9bc534c8
--- /dev/null
+++ b/sysdeps/mach/hurd/utimensat.c
@@ -0,0 +1,46 @@
+/* Change access and modification times of open file. Hurd version.
+ Copyright (C) 1991-2018 Free Software 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/time.h>
+#include <errno.h>
+#include <stddef.h>
+#include <hurd.h>
+#include <hurd/fd.h>
+
+#include "utime-helper.c"
+
+/* Change the access time of FILE to TSP[0] and
+ the modification time of FILE to TSP[1]. */
+int
+utimensat (int fd, const char *file, const struct timespec tsp[2],
+ int flags)
+{
+ error_t err;
+ file_t port;
+
+ port = __file_name_lookup_at (fd, flags, file, 0, 0);
+ if (port == MACH_PORT_NULL)
+ return -1;
+
+ err = hurd_futimens (port, tsp);
+
+ __mach_port_deallocate (__mach_task_self (), port);
+ if (err)
+ return __hurd_fail (err);
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/utimes.c b/sysdeps/mach/hurd/utimes.c
index 121b456232..bdf4d79790 100644
--- a/sysdeps/mach/hurd/utimes.c
+++ b/sysdeps/mach/hurd/utimes.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* utimes -- change access and modification times of file. Hurd version.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,33 +21,22 @@
#include <stddef.h>
#include <hurd.h>
+#include "utime-helper.c"
+
/* Change the access time of FILE to TVP[0] and
the modification time of FILE to TVP[1]. */
int
__utimes (const char *file, const struct timeval tvp[2])
{
- union tv
- {
- struct timeval tv;
- time_value_t tvt;
- };
- const union tv *u = (const union tv *) tvp;
- union tv nulltv[2];
error_t err;
file_t port;
- if (tvp == NULL)
- {
- /* Setting the number of microseconds to `-1' tells the
- underlying filesystems to use the current time. */
- nulltv[0].tvt.microseconds = nulltv[1].tvt.microseconds = -1;
- u = nulltv;
- }
-
port = __file_name_lookup (file, 0, 0);
if (port == MACH_PORT_NULL)
return -1;
- err = __file_utimes (port, u[0].tvt, u[1].tvt);
+
+ err = hurd_futimes (port, tvp);
+
__mach_port_deallocate (__mach_task_self (), port);
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/wait4.c b/sysdeps/mach/hurd/wait4.c
index 3bc9fa83fb..a72bcee145 100644
--- a/sysdeps/mach/hurd/wait4.c
+++ b/sysdeps/mach/hurd/wait4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,8 +22,7 @@
#include <hurd/port.h>
pid_t
-__wait4 (pid_t pid, __WAIT_STATUS_DEFN stat_loc, int options,
- struct rusage *usage)
+__wait4 (pid_t pid, int *stat_loc, int options, struct rusage *usage)
{
pid_t dead;
error_t err;
diff --git a/sysdeps/mach/hurd/write.c b/sysdeps/mach/hurd/write.c
index 4f9deecdab..3cf748be9d 100644
--- a/sysdeps/mach/hurd/write.c
+++ b/sysdeps/mach/hurd/write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,3 +30,4 @@ libc_hidden_def (__libc_write)
weak_alias (__libc_write, __write)
libc_hidden_weak (__write)
weak_alias (__libc_write, write)
+libc_hidden_weak (write)
diff --git a/sysdeps/mach/hurd/x86/dl-sysdep.c b/sysdeps/mach/hurd/x86/dl-sysdep.c
new file mode 100644
index 0000000000..abb488cde9
--- /dev/null
+++ b/sysdeps/mach/hurd/x86/dl-sysdep.c
@@ -0,0 +1,21 @@
+/* Operating system support for run-time dynamic linker. X86 version.
+ Copyright (C) 2017-2018 Free Software 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 <config.h>
+#include <sysdeps/x86/cpu-tunables.c>
+#include <sysdeps/mach/hurd/dl-sysdep.c>
diff --git a/sysdeps/mach/hurd/xmknod.c b/sysdeps/mach/hurd/xmknod.c
index fc9d5ce550..d6b8adce9b 100644
--- a/sysdeps/mach/hurd/xmknod.c
+++ b/sysdeps/mach/hurd/xmknod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/xmknodat.c b/sysdeps/mach/hurd/xmknodat.c
index 514b79a29b..e4e866c4f4 100644
--- a/sysdeps/mach/hurd/xmknodat.c
+++ b/sysdeps/mach/hurd/xmknodat.c
@@ -1,5 +1,5 @@
/* Create a device file relative to an open directory. Hurd version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,7 @@
#include <_itoa.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/sysmacros.h>
/* Create a device file named PATH relative to FD, with permission and
special bits MODE and device number DEV (which can be constructed
@@ -80,9 +81,9 @@ __xmknodat (int vers, int fd, const char *path, mode_t mode, dev_t *dev)
bp = buf + sizeof (buf);
*--bp = '\0';
- bp = _itoa (minor (*dev), bp, 10, 0);
+ bp = _itoa (__gnu_dev_minor (*dev), bp, 10, 0);
*--bp = '\0';
- bp = _itoa (major (*dev), bp, 10, 0);
+ bp = _itoa (__gnu_dev_major (*dev), bp, 10, 0);
memcpy (bp - len, translator, len);
translator = bp - len;
len = buf + sizeof (buf) - translator;
diff --git a/sysdeps/mach/hurd/xstat.c b/sysdeps/mach/hurd/xstat.c
index 9828a33c60..46314706f3 100644
--- a/sysdeps/mach/hurd/xstat.c
+++ b/sysdeps/mach/hurd/xstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/xstat64.c b/sysdeps/mach/hurd/xstat64.c
index 9ea2b49ecc..f3a8ddc6e7 100644
--- a/sysdeps/mach/hurd/xstat64.c
+++ b/sysdeps/mach/hurd/xstat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/hurd/xstatconv.c b/sysdeps/mach/hurd/xstatconv.c
index 37feaa20e3..1aa8aff317 100644
--- a/sysdeps/mach/hurd/xstatconv.c
+++ b/sysdeps/mach/hurd/xstatconv.c
@@ -1,5 +1,5 @@
/* Convert between `struct stat' format, and `struct stat64' format.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/i386/bits/mach/param.h b/sysdeps/mach/i386/bits/mach/param.h
new file mode 100644
index 0000000000..15e842f4d3
--- /dev/null
+++ b/sysdeps/mach/i386/bits/mach/param.h
@@ -0,0 +1,25 @@
+/* Old-style Unix parameters and limits. i386 Mach version.
+ Copyright (C) 1993-2018 Free Software 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 _SYS_PARAM_H
+# error "Never use <bits/mach/param.h> directly; include <sys/param.h> instead."
+#endif
+
+#ifndef EXEC_PAGESIZE
+#define EXEC_PAGESIZE 4096
+#endif
diff --git a/sysdeps/mach/i386/machine-lock.h b/sysdeps/mach/i386/machine-lock.h
index 4b3a6f1ab0..3c12021eb2 100644
--- a/sysdeps/mach/i386/machine-lock.h
+++ b/sysdeps/mach/i386/machine-lock.h
@@ -1,5 +1,5 @@
/* Machine-specific definition for spin locks. i386 version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,9 +34,9 @@ typedef volatile int __spin_lock_t;
/* Unlock LOCK. */
-void __spin_unlock (__spin_lock_t *__lock);
+extern void __spin_unlock (__spin_lock_t *__lock);
-#ifdef __USE_EXTERN_INLINES
+#if defined __USE_EXTERN_INLINES && defined _LIBC
_EXTERN_INLINE void
__spin_unlock (__spin_lock_t *__lock)
{
@@ -49,9 +49,9 @@ __spin_unlock (__spin_lock_t *__lock)
/* Try to lock LOCK; return nonzero if we locked it, zero if another has. */
-int __spin_try_lock (__spin_lock_t *__lock);
+extern int __spin_try_lock (__spin_lock_t *__lock);
-#ifdef __USE_EXTERN_INLINES
+#if defined __USE_EXTERN_INLINES && defined _LIBC
_EXTERN_INLINE int
__spin_try_lock (__spin_lock_t *__lock)
{
@@ -65,9 +65,9 @@ __spin_try_lock (__spin_lock_t *__lock)
/* Return nonzero if LOCK is locked. */
-int __spin_lock_locked (__spin_lock_t *__lock);
+extern int __spin_lock_locked (__spin_lock_t *__lock);
-#ifdef __USE_EXTERN_INLINES
+#if defined __USE_EXTERN_INLINES && defined _LIBC
_EXTERN_INLINE int
__spin_lock_locked (__spin_lock_t *__lock)
{
diff --git a/sysdeps/mach/i386/machine-sp.h b/sysdeps/mach/i386/machine-sp.h
index e888bf5fec..196c6a3802 100644
--- a/sysdeps/mach/i386/machine-sp.h
+++ b/sysdeps/mach/i386/machine-sp.h
@@ -1,5 +1,5 @@
/* Machine-specific function to return the stack pointer. i386 version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/i386/syscall.S b/sysdeps/mach/i386/syscall.S
index adb7716948..531d4e9693 100644
--- a/sysdeps/mach/i386/syscall.S
+++ b/sysdeps/mach/i386/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,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/i386/sysdep.h b/sysdeps/mach/i386/sysdep.h
index 7d2c0a8ec1..3595ad7330 100644
--- a/sysdeps/mach/i386/sysdep.h
+++ b/sysdeps/mach/i386/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/mach/i386/thread_state.h b/sysdeps/mach/i386/thread_state.h
index 2e081405e3..be3c8a9cee 100644
--- a/sysdeps/mach/i386/thread_state.h
+++ b/sysdeps/mach/i386/thread_state.h
@@ -1,5 +1,5 @@
/* Mach thread state definitions for machine-independent code. i386 version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,9 @@
#include <mach/machine/thread_status.h>
+/* This lets the kernel define segments for a new thread. */
#define MACHINE_NEW_THREAD_STATE_FLAVOR i386_THREAD_STATE
+/* This makes the kernel load our segments descriptors. */
#define MACHINE_THREAD_STATE_FLAVOR i386_REGS_SEGS_STATE
#define MACHINE_THREAD_STATE_COUNT i386_THREAD_STATE_COUNT
diff --git a/sysdeps/mach/include/lock-intern.h b/sysdeps/mach/include/lock-intern.h
new file mode 100644
index 0000000000..e42ad17be2
--- /dev/null
+++ b/sysdeps/mach/include/lock-intern.h
@@ -0,0 +1,14 @@
+#ifndef _LOCK_INTERN_H
+#include <mach/lock-intern.h>
+#ifndef _ISOMAC
+libc_hidden_proto (__spin_lock_locked)
+libc_hidden_proto (__spin_lock)
+libc_hidden_proto (__spin_lock_solid)
+libc_hidden_proto (__spin_unlock)
+libc_hidden_proto (__spin_try_lock)
+libc_hidden_proto (__mutex_init)
+libc_hidden_proto (__mutex_lock)
+libc_hidden_proto (__mutex_unlock)
+libc_hidden_proto (__mutex_trylock)
+#endif
+#endif
diff --git a/sysdeps/mach/include/mach-shortcuts-hidden.h b/sysdeps/mach/include/mach-shortcuts-hidden.h
new file mode 100644
index 0000000000..f0ab8804ca
--- /dev/null
+++ b/sysdeps/mach/include/mach-shortcuts-hidden.h
@@ -0,0 +1,15 @@
+#include <mach-shortcuts.h>
+#ifndef _ISOMAC
+libc_hidden_proto (__task_create)
+libc_hidden_proto (__task_terminate)
+libc_hidden_proto (__vm_allocate)
+libc_hidden_proto (__vm_deallocate)
+libc_hidden_proto (__task_suspend)
+libc_hidden_proto (__task_set_special_port)
+libc_hidden_proto (__vm_map)
+libc_hidden_proto (__thread_depress_abort)
+libc_hidden_proto (__mach_port_allocate_name)
+libc_hidden_proto (__mach_port_allocate)
+libc_hidden_proto (__mach_port_deallocate)
+libc_hidden_proto (__mach_port_insert_right)
+#endif
diff --git a/sysdeps/mach/include/mach.h b/sysdeps/mach/include/mach.h
new file mode 100644
index 0000000000..65f8d9764b
--- /dev/null
+++ b/sysdeps/mach/include/mach.h
@@ -0,0 +1,8 @@
+#ifndef _MACH_H
+#include_next <mach.h>
+#include <mach-shortcuts-hidden.h>
+#ifndef _ISOMAC
+libc_hidden_proto (__mach_msg_destroy)
+libc_hidden_proto (__mach_msg)
+#endif
+#endif
diff --git a/sysdeps/mach/include/mach/mach_traps.h b/sysdeps/mach/include/mach/mach_traps.h
new file mode 100644
index 0000000000..c43349524d
--- /dev/null
+++ b/sysdeps/mach/include/mach/mach_traps.h
@@ -0,0 +1,23 @@
+#ifndef _MACH_MACH_TRAPS_H
+#include_next <mach/mach_traps.h>
+
+#ifndef _ISOMAC
+extern mach_port_t __mach_reply_port (void);
+libc_hidden_proto (__mach_reply_port)
+extern mach_port_t __mach_thread_self (void);
+libc_hidden_proto (__mach_thread_self)
+extern mach_port_t (__mach_task_self) (void);
+libc_hidden_proto (__mach_task_self)
+extern mach_port_t (__mach_host_self) (void);
+libc_hidden_proto (__mach_host_self)
+extern boolean_t __swtch (void);
+libc_hidden_proto (__swtch)
+extern boolean_t __swtch_pri (int priority);
+libc_hidden_proto (__swtch_pri)
+kern_return_t __thread_switch (mach_port_t new_thread,
+ int option, mach_msg_timeout_t option_time);
+libc_hidden_proto (__thread_switch)
+kern_return_t __evc_wait (unsigned int event);
+libc_hidden_proto (__evc_wait)
+#endif
+#endif
diff --git a/sysdeps/mach/include/mach/mig_support.h b/sysdeps/mach/include/mach/mig_support.h
new file mode 100644
index 0000000000..b027237692
--- /dev/null
+++ b/sysdeps/mach/include/mach/mig_support.h
@@ -0,0 +1,8 @@
+#ifndef _MACH_MIG_SUPPORT_H
+#include_next <mach/mig_support.h>
+#ifndef _ISOMAC
+libc_hidden_proto (__mig_get_reply_port)
+libc_hidden_proto (__mig_dealloc_reply_port)
+libc_hidden_proto (__mig_init)
+#endif
+#endif
diff --git a/sysdeps/mach/include/mach_error.h b/sysdeps/mach/include/mach_error.h
new file mode 100644
index 0000000000..de1c4ca4fe
--- /dev/null
+++ b/sysdeps/mach/include/mach_error.h
@@ -0,0 +1,6 @@
+#ifndef _MACH_ERROR_
+#include_next <mach_error.h>
+#ifndef _ISOMAC
+libc_hidden_proto (mach_error_type)
+#endif
+#endif
diff --git a/sysdeps/mach/libc-lock.h b/sysdeps/mach/libc-lock.h
index 6acc78abd8..2c64019b33 100644
--- a/sysdeps/mach/libc-lock.h
+++ b/sysdeps/mach/libc-lock.h
@@ -1,5 +1,5 @@
/* libc-internal interface for mutex locks. Mach cthreads version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,15 +20,32 @@
#define _LIBC_LOCK_H 1
#ifdef _LIBC
-#include <cthreads.h>
-#define __libc_lock_t struct mutex
+
+#include <tls.h>
+#include <lowlevellock.h>
+
+/* The locking here is very inexpensive, even for inlining. */
+#define _IO_lock_inexpensive 1
+
+typedef unsigned int __libc_lock_t;
+typedef struct
+{
+ __libc_lock_t lock;
+ int cnt;
+ void *owner;
+} __libc_lock_recursive_t;
+
+typedef __libc_lock_recursive_t __rtld_lock_recursive_t;
+
+extern char __libc_lock_self0[0];
+#define __libc_lock_owner_self() \
+ (__LIBC_NO_TLS () ? (void *)&__libc_lock_self0 : THREAD_SELF)
+
#else
typedef struct __libc_lock_opaque__ __libc_lock_t;
+typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
#endif
-/* Type for key of thread specific data. */
-typedef cthread_key_t __libc_key_t;
-
/* Define a lock variable NAME with storage class CLASS. The lock must be
initialized with __libc_lock_init before it can be used (or define it
with __libc_lock_define_initialized, below). Use `extern' for CLASS to
@@ -40,27 +57,97 @@ typedef cthread_key_t __libc_key_t;
CLASS __libc_lock_t NAME;
/* Define an initialized lock variable NAME with storage class CLASS. */
+#define _LIBC_LOCK_INITIALIZER LLL_INITIALIZER
#define __libc_lock_define_initialized(CLASS,NAME) \
- CLASS __libc_lock_t NAME = MUTEX_INITIALIZER;
+ CLASS __libc_lock_t NAME = LLL_INITIALIZER;
/* Initialize the named lock variable, leaving it in a consistent, unlocked
state. */
-#define __libc_lock_init(NAME) __mutex_init (&(NAME))
+#define __libc_lock_init(NAME) (NAME) = LLL_INITIALIZER
/* Finalize the named lock variable, which must be locked. It cannot be
used again until __libc_lock_init is called again on it. This must be
called on a lock variable before the containing storage is reused. */
-#define __libc_lock_fini(NAME) __mutex_unlock (&(NAME))
+#define __libc_lock_fini __libc_lock_unlock
+#define __libc_lock_fini_recursive __libc_lock_unlock_recursive
+#define __rtld_lock_fini_recursive __rtld_lock_unlock_recursive
/* Lock the named lock variable. */
-#define __libc_lock_lock(NAME) __mutex_lock (&(NAME))
+#define __libc_lock_lock(NAME) \
+ ({ lll_lock (&(NAME), 0); 0; })
/* Lock the named lock variable. */
-#define __libc_lock_trylock(NAME) (!__mutex_trylock (&(NAME)))
+#define __libc_lock_trylock(NAME) lll_trylock (&(NAME))
/* Unlock the named lock variable. */
-#define __libc_lock_unlock(NAME) __mutex_unlock (&(NAME))
-
+#define __libc_lock_unlock(NAME) \
+ ({ lll_unlock (&(NAME), 0); 0; })
+
+#define __libc_lock_define_recursive(CLASS,NAME) \
+ CLASS __libc_lock_recursive_t NAME;
+
+#define _LIBC_LOCK_RECURSIVE_INITIALIZER { LLL_INITIALIZER, 0, 0 }
+
+#define __libc_lock_define_initialized_recursive(CLASS,NAME) \
+ CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
+
+#define __rtld_lock_define_recursive(CLASS,NAME) \
+ __libc_lock_define_recursive (CLASS, NAME)
+#define _RTLD_LOCK_RECURSIVE_INITIALIZER \
+ _LIBC_LOCK_RECURSIVE_INITIALIZER
+#define __rtld_lock_define_initialized_recursive(CLASS,NAME) \
+ __libc_lock_define_initialized_recursive (CLASS, NAME)
+
+#define __libc_lock_init_recursive(NAME) \
+ ({ \
+ (NAME) = (__libc_lock_recursive_t)_LIBC_LOCK_RECURSIVE_INITIALIZER; \
+ 0; \
+ })
+
+#define __libc_lock_trylock_recursive(NAME) \
+ ({ \
+ __libc_lock_recursive_t *const __lock = &(NAME); \
+ void *__self = __libc_lock_owner_self (); \
+ int __r = 0; \
+ if (__self == __lock->owner) \
+ ++__lock->cnt; \
+ else if ((__r = lll_trylock (&__lock->lock)) == 0) \
+ __lock->owner = __self, __lock->cnt = 1; \
+ __r; \
+ })
+
+#define __libc_lock_lock_recursive(NAME) \
+ ({ \
+ __libc_lock_recursive_t *const __lock = &(NAME); \
+ void *__self = __libc_lock_owner_self (); \
+ if (__self != __lock->owner) \
+ { \
+ lll_lock (&__lock->lock, 0); \
+ __lock->owner = __self; \
+ } \
+ ++__lock->cnt; \
+ (void)0; \
+ })
+
+#define __libc_lock_unlock_recursive(NAME) \
+ ({ \
+ __libc_lock_recursive_t *const __lock = &(NAME); \
+ if (--__lock->cnt == 0) \
+ { \
+ __lock->owner = 0; \
+ lll_unlock (&__lock->lock, 0); \
+ } \
+ })
+
+
+#define __rtld_lock_initialize(NAME) \
+ (void) ((NAME) = (__rtld_lock_recursive_t) _RTLD_LOCK_RECURSIVE_INITIALIZER)
+#define __rtld_lock_trylock_recursive(NAME) \
+ __libc_lock_trylock_recursive (NAME)
+#define __rtld_lock_lock_recursive(NAME) \
+ __libc_lock_lock_recursive(NAME)
+#define __rtld_lock_unlock_recursive(NAME) \
+ __libc_lock_unlock_recursive (NAME)
/* XXX for now */
#define __libc_rwlock_define __libc_lock_define
@@ -73,27 +160,40 @@ typedef cthread_key_t __libc_key_t;
#define __libc_rwlock_trywrlock __libc_lock_trylock
#define __libc_rwlock_unlock __libc_lock_unlock
+struct __libc_cleanup_frame
+{
+ void (*__fct) (void *);
+ void *__argp;
+ int __doit;
+};
+
+__extern_inline void
+__libc_cleanup_fct (struct __libc_cleanup_frame *framep)
+{
+ if (framep->__doit)
+ framep->__fct (framep->__argp);
+}
/* Start a critical region with a cleanup function */
-#define __libc_cleanup_region_start(DOIT, FCT, ARG) \
-{ \
- typeof (***(FCT)) *__save_FCT = (DOIT) ? (FCT) : 0; \
- typeof (ARG) __save_ARG = ARG; \
- /* close brace is in __libc_cleanup_region_end below. */
-
-/* End a critical region started with __libc_cleanup_region_start. */
-#define __libc_cleanup_region_end(DOIT) \
- if ((DOIT) && __save_FCT != 0) \
- (*__save_FCT)(__save_ARG); \
-}
+#define __libc_cleanup_region_start(DOIT, FCT, ARG) \
+ do \
+ { \
+ struct __libc_cleanup_frame __cleanup \
+ __attribute__ ((__cleanup__ (__libc_cleanup_fct))) = \
+ { .__fct = (FCT), .__argp = (ARG), .__doit = (DOIT) };
+
+/* This one closes the brace above. */
+#define __libc_cleanup_region_end(DOIT) \
+ __cleanup.__doit = (DOIT); \
+ } \
+ while (0)
-/* Sometimes we have to exit the block in the middle. */
-#define __libc_cleanup_end(DOIT) \
- if ((DOIT) && __save_FCT != 0) \
- (*__save_FCT)(__save_ARG); \
+#define __libc_cleanup_end(DOIT) __cleanup.__doit = (DOIT);
+#define __libc_cleanup_push(fct, arg) __libc_cleanup_region_start (1, fct, arg)
+#define __libc_cleanup_pop(execute) __libc_cleanup_region_end (execute)
-/* Use mutexes as once control variables. */
+/* Use mutexes as once control variables. */
struct __libc_once
{
@@ -102,8 +202,7 @@ struct __libc_once
};
#define __libc_once_define(CLASS,NAME) \
- CLASS struct __libc_once NAME = { MUTEX_INITIALIZER, 0 }
-
+ CLASS struct __libc_once NAME = { _LIBC_LOCK_INITIALIZER, 0 }
/* Call handler iff the first call. */
#define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
@@ -121,25 +220,11 @@ struct __libc_once
#ifdef _LIBC
/* We need portable names for some functions. E.g., when they are
used as argument to __libc_cleanup_region_start. */
-#define __libc_mutex_unlock __mutex_unlock
-#endif
+#define __libc_mutex_unlock __libc_lock_unlock
-#define __libc_key_create(KEY,DEST) cthread_keycreate (KEY)
-#define __libc_setspecific(KEY,VAL) cthread_setspecific (KEY, VAL)
-void *__libc_getspecific (__libc_key_t key);
-
-/* XXX until cthreads supports recursive locks */
-#define __libc_lock_define_initialized_recursive __libc_lock_define_initialized
-#define __libc_lock_init_recursive __libc_lock_init
-#define __libc_lock_fini_recursive __libc_lock_fini
-#define __libc_lock_trylock_recursive __libc_lock_trylock
-#define __libc_lock_unlock_recursive __libc_lock_unlock
-#define __libc_lock_lock_recursive __libc_lock_lock
-
-#define __rtld_lock_define_initialized_recursive __libc_lock_define_initialized
-#define __rtld_lock_fini_recursive __libc_lock_fini
-#define __rtld_lock_trylock_recursive __libc_lock_trylock
-#define __rtld_lock_unlock_recursive __libc_lock_unlock
-#define __rtld_lock_lock_recursive __libc_lock_lock
+/* Hide the definitions which are only supposed to be used inside libc in
+ a separate file. This file is not present in the installation! */
+# include <libc-lockP.h>
+#endif
#endif /* libc-lock.h */
diff --git a/sysdeps/mach/libmachuser.abilist b/sysdeps/mach/libmachuser.abilist
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sysdeps/mach/libmachuser.abilist
diff --git a/sysdeps/mach/mprotect.c b/sysdeps/mach/mprotect.c
index 1031d8b563..2e55f90b78 100644
--- a/sysdeps/mach/mprotect.c
+++ b/sysdeps/mach/mprotect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,7 @@
(and sets errno). */
int
-__mprotect (__ptr_t addr, size_t len, int prot)
+__mprotect (void *addr, size_t len, int prot)
{
kern_return_t err;
vm_prot_t vmprot;
@@ -47,4 +47,5 @@ __mprotect (__ptr_t addr, size_t len, int prot)
}
return 0;
}
+libc_hidden_def (__mprotect)
weak_alias (__mprotect, mprotect)
diff --git a/sysdeps/mach/msync.c b/sysdeps/mach/msync.c
index 1b60c75a05..92ce15e639 100644
--- a/sysdeps/mach/msync.c
+++ b/sysdeps/mach/msync.c
@@ -1,5 +1,5 @@
/* msync -- Synchronize mapped memory to external storage. Mach version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@
unpredictable before this is done. */
int
-msync (__ptr_t addr, size_t len, int flags)
+msync (void *addr, size_t len, int flags)
{
vm_sync_t sync_flags = 0;
kern_return_t err;
diff --git a/sysdeps/mach/munmap.c b/sysdeps/mach/munmap.c
index 4813492766..2ac9305ff8 100644
--- a/sysdeps/mach/munmap.c
+++ b/sysdeps/mach/munmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
bytes. Returns 0 if successful, -1 for errors (and sets errno). */
int
-__munmap (__ptr_t addr, size_t len)
+__munmap (void *addr, size_t len)
{
kern_return_t err;
@@ -43,4 +43,5 @@ __munmap (__ptr_t addr, size_t len)
return 0;
}
+libc_hidden_def (__munmap)
weak_alias (__munmap, munmap)
diff --git a/sysdeps/mach/nanosleep.c b/sysdeps/mach/nanosleep.c
index 7c810d3be9..e9a584d09c 100644
--- a/sysdeps/mach/nanosleep.c
+++ b/sysdeps/mach/nanosleep.c
@@ -1,5 +1,5 @@
/* nanosleep -- sleep for a period specified with a struct timespec
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/pagecopy.h b/sysdeps/mach/pagecopy.h
index cda1ef90c6..8583df4569 100644
--- a/sysdeps/mach/pagecopy.h
+++ b/sysdeps/mach/pagecopy.h
@@ -1,5 +1,5 @@
/* Macros for copying by pages; used in memcpy, memmove. Mach version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,8 +19,8 @@
#include <mach.h>
/* Threshold at which vm_copy is more efficient than well-optimized copying
- by words. This parameter should be tuned as necessary. */
-#define PAGE_THRESHOLD (2 * PAGE_SIZE) /* XXX ? */
+ by words. */
+#define PAGE_COPY_THRESHOLD (16384)
#define PAGE_SIZE __vm_page_size
#define PAGE_COPY_FWD(dstp, srcp, nbytes_left, nbytes) \
diff --git a/sysdeps/mach/readonly-area.c b/sysdeps/mach/readonly-area.c
index 155c0e4d42..e236b5ec37 100644
--- a/sysdeps/mach/readonly-area.c
+++ b/sysdeps/mach/readonly-area.c
@@ -1,5 +1,5 @@
/* Test if a memory region is wholly unwritable. Mach version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/sched_yield.c b/sysdeps/mach/sched_yield.c
index fb69e6b59c..654ab6c3a6 100644
--- a/sysdeps/mach/sched_yield.c
+++ b/sysdeps/mach/sched_yield.c
@@ -1,5 +1,5 @@
/* sched_yield -- yield the processor. Mach version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/sleep.c b/sysdeps/mach/sleep.c
index 6292dc7dfc..1cc6af4a07 100644
--- a/sysdeps/mach/sleep.c
+++ b/sysdeps/mach/sleep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/strerror_l.c b/sysdeps/mach/strerror_l.c
index e93e82f42e..7111124439 100644
--- a/sysdeps/mach/strerror_l.c
+++ b/sysdeps/mach/strerror_l.c
@@ -1,5 +1,5 @@
/* strerror_l - Get errno description string in given locale. Mach version.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
#include <mach/error.h>
#include <errorlib.h>
#include <sys/param.h>
+#include <libc-symbols.h>
static __thread char *last_value;
@@ -86,16 +87,10 @@ strerror_l (int errnum, locale_t loc)
return (char *) translate (es->subsystem[sub].codes[code], loc);
}
-
-#ifdef _LIBC
-# ifdef _LIBC_REENTRANT
/* This is called when a thread is exiting to free the last_value string. */
-static void __attribute__ ((section ("__libc_thread_freeres_fn")))
-strerror_thread_freeres (void)
+void
+__strerror_thread_freeres (void)
{
free (last_value);
}
-text_set_element (__libc_thread_subfreeres, strerror_thread_freeres);
-text_set_element (__libc_subfreeres, strerror_thread_freeres);
-# endif
-#endif
+text_set_element (__libc_subfreeres, __strerror_thread_freeres);
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/mach/sysdep.h b/sysdeps/mach/sysdep.h
index 5f6bf1e080..04bbf93c23 100644
--- a/sysdeps/mach/sysdep.h
+++ b/sysdeps/mach/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/thread_state.h b/sysdeps/mach/thread_state.h
index c382eb995a..2e3a10cbcb 100644
--- a/sysdeps/mach/thread_state.h
+++ b/sysdeps/mach/thread_state.h
@@ -1,5 +1,5 @@
/* Generic definitions for dealing with Mach thread states.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,6 +37,9 @@
((ts)->SP = (unsigned long int) (stack) + (size))
#endif
#endif
+
+/* This copies architecture-specific bits from the current thread to the new
+ thread state. */
#ifndef MACHINE_THREAD_STATE_FIX_NEW
# define MACHINE_THREAD_STATE_FIX_NEW(ts)
#endif
diff --git a/sysdeps/mach/usleep.c b/sysdeps/mach/usleep.c
index 542026d6d7..693d11d81a 100644
--- a/sysdeps/mach/usleep.c
+++ b/sysdeps/mach/usleep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mach/xpg-strerror.c b/sysdeps/mach/xpg-strerror.c
index 8ed5e03e5a..c38ec3d753 100644
--- a/sysdeps/mach/xpg-strerror.c
+++ b/sysdeps/mach/xpg-strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/microblaze/Implies b/sysdeps/microblaze/Implies
index 73c766c52e..746b21ad66 100644
--- a/sysdeps/microblaze/Implies
+++ b/sysdeps/microblaze/Implies
@@ -1,4 +1,5 @@
wordsize-32
# MicroBlaze uses IEEE 754 floating point.
+ieee754/soft-fp
ieee754/flt-32
ieee754/dbl-64
diff --git a/sysdeps/microblaze/__longjmp.S b/sysdeps/microblaze/__longjmp.S
index 647a950896..b93639bca0 100644
--- a/sysdeps/microblaze/__longjmp.S
+++ b/sysdeps/microblaze/__longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/_mcount.S b/sysdeps/microblaze/_mcount.S
index b5a7c867fc..2fcf3c0d09 100644
--- a/sysdeps/microblaze/_mcount.S
+++ b/sysdeps/microblaze/_mcount.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/asm-syntax.h b/sysdeps/microblaze/asm-syntax.h
index cdb265ed71..5fd720a831 100644
--- a/sysdeps/microblaze/asm-syntax.h
+++ b/sysdeps/microblaze/asm-syntax.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/atomic-machine.h b/sysdeps/microblaze/atomic-machine.h
index af7acacc96..5ff5d16d75 100644
--- a/sysdeps/microblaze/atomic-machine.h
+++ b/sysdeps/microblaze/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -38,6 +38,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
/* Microblaze does not have byte and halfword forms of load and reserve and
store conditional. So for microblaze we stub out the 8- and 16-bit forms. */
@@ -47,12 +50,6 @@ typedef uintmax_t uatomic_max_t;
#define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval) \
(abort (), 0)
-#define __arch_compare_and_exchange_bool_8_rel(mem, newval, oldval) \
- (abort (), 0)
-
-#define __arch_compare_and_exchange_bool_16_rel(mem, newval, oldval) \
- (abort (), 0)
-
#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
({ \
__typeof (*(mem)) __tmp; \
diff --git a/sysdeps/microblaze/backtrace.c b/sysdeps/microblaze/backtrace.c
index 9eb17dd192..3ba44679f4 100644
--- a/sysdeps/microblaze/backtrace.c
+++ b/sysdeps/microblaze/backtrace.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -27,7 +27,7 @@ _identify_sighandler (unsigned long fp, unsigned long pc,
unsigned long *pprev_fp, unsigned long *pprev_pc,
unsigned long *retaddr);
-inline long
+static inline long
get_frame_size (unsigned long instr)
{
return abs ((short signed) (instr & 0xFFFF));
diff --git a/sysdeps/microblaze/backtrace_linux.c b/sysdeps/microblaze/backtrace_linux.c
index 797afbd2d0..a566c03be5 100644
--- a/sysdeps/microblaze/backtrace_linux.c
+++ b/sysdeps/microblaze/backtrace_linux.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/bits/endian.h b/sysdeps/microblaze/bits/endian.h
index 3ab2648749..90641ddce6 100644
--- a/sysdeps/microblaze/bits/endian.h
+++ b/sysdeps/microblaze/bits/endian.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/bits/fenv.h b/sysdeps/microblaze/bits/fenv.h
index 3891f4a186..9a8d87dae6 100644
--- a/sysdeps/microblaze/bits/fenv.h
+++ b/sysdeps/microblaze/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,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/bits/link.h b/sysdeps/microblaze/bits/link.h
index e247c79dcf..de401731f9 100644
--- a/sysdeps/microblaze/bits/link.h
+++ b/sysdeps/microblaze/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/bits/setjmp.h b/sysdeps/microblaze/bits/setjmp.h
index 52ba6d62c9..fda93eeae2 100644
--- a/sysdeps/microblaze/bits/setjmp.h
+++ b/sysdeps/microblaze/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -25,7 +25,7 @@
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
-typedef struct
+typedef struct __jmp_buf_internal_tag
{
/* There are 21 4-byte registers that should be saved:
r1, r2, r13-r31. Actually, there seems no need to save
diff --git a/sysdeps/microblaze/bsd-_setjmp.S b/sysdeps/microblaze/bsd-_setjmp.S
index ed2a9834c6..7129be02cd 100644
--- a/sysdeps/microblaze/bsd-_setjmp.S
+++ b/sysdeps/microblaze/bsd-_setjmp.S
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/microblaze/bsd-setjmp.S b/sysdeps/microblaze/bsd-setjmp.S
index f78c1f1fd2..388689dc3b 100644
--- a/sysdeps/microblaze/bsd-setjmp.S
+++ b/sysdeps/microblaze/bsd-setjmp.S
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/microblaze/crti.S b/sysdeps/microblaze/crti.S
index 15fbb3b0c4..09c8cd7ccd 100644
--- a/sysdeps/microblaze/crti.S
+++ b/sysdeps/microblaze/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for MicroBlaze.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,6 +58,7 @@
.section .init,"ax",@progbits
.align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
addik r1,r1,-32
@@ -79,6 +80,7 @@ $Lno_weak_fn:
.section .fini,"ax",@progbits
.align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
addik r1,r1,-32
diff --git a/sysdeps/microblaze/crtn.S b/sysdeps/microblaze/crtn.S
index a1676f7fb5..61ec067244 100644
--- a/sysdeps/microblaze/crtn.S
+++ b/sysdeps/microblaze/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for MicroBlaze.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/microblaze/dl-machine.h b/sysdeps/microblaze/dl-machine.h
index fd4fe0543f..8480a7a34e 100644
--- a/sysdeps/microblaze/dl-machine.h
+++ b/sysdeps/microblaze/dl-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -174,6 +174,7 @@ _dl_start_user:\n\
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
@@ -222,7 +223,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
{
const Elf32_Sym *const refsym = sym;
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
value += reloc->r_addend;
if (r_type == R_MICROBLAZE_GLOB_DAT ||
diff --git a/sysdeps/microblaze/dl-tls.h b/sysdeps/microblaze/dl-tls.h
index f0f8205181..66ba0dd7ab 100644
--- a/sysdeps/microblaze/dl-tls.h
+++ b/sysdeps/microblaze/dl-tls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -24,6 +24,3 @@ typedef struct
} tls_index;
extern void *__tls_get_addr (tls_index *ti);
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/microblaze/dl-trampoline.S b/sysdeps/microblaze/dl-trampoline.S
index f000f5f976..8ddd968ff8 100644
--- a/sysdeps/microblaze/dl-trampoline.S
+++ b/sysdeps/microblaze/dl-trampoline.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/gccframe.h b/sysdeps/microblaze/gccframe.h
index 202ee97530..2bccbf41aa 100644
--- a/sysdeps/microblaze/gccframe.h
+++ b/sysdeps/microblaze/gccframe.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/jmpbuf-unwind.h b/sysdeps/microblaze/jmpbuf-unwind.h
index 209784c6e6..27b519677d 100644
--- a/sysdeps/microblaze/jmpbuf-unwind.h
+++ b/sysdeps/microblaze/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/ldbl-classify-compat.h b/sysdeps/microblaze/ldbl-classify-compat.h
new file mode 100644
index 0000000000..38c5c99949
--- /dev/null
+++ b/sysdeps/microblaze/ldbl-classify-compat.h
@@ -0,0 +1,8 @@
+#ifndef MICROBLAZE_LDBL_CLASSIFY_COMPAT_H
+#define MICROBLAZE_LDBL_CLASSIFY_COMPAT_H 1
+
+/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
+ when built without long double support. */
+#define LDBL_CLASSIFY_COMPAT 1
+
+#endif
diff --git a/sysdeps/microblaze/ldsodefs.h b/sysdeps/microblaze/ldsodefs.h
index 1d67be4da0..73ac775e92 100644
--- a/sysdeps/microblaze/ldsodefs.h
+++ b/sysdeps/microblaze/ldsodefs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/libc-tls.c b/sysdeps/microblaze/libc-tls.c
index 2265441eda..9971d105ba 100644
--- a/sysdeps/microblaze/libc-tls.c
+++ b/sysdeps/microblaze/libc-tls.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/libm-test-ulps b/sysdeps/microblaze/libm-test-ulps
index c252c96d0a..e4b4d4e490 100644
--- a/sysdeps/microblaze/libm-test-ulps
+++ b/sysdeps/microblaze/libm-test-ulps
@@ -1,23 +1,44 @@
# Begin of automatic generation
# Maximal error of functions:
+Function: "acos":
+float: 1
+ifloat: 1
+
Function: "acosh":
-double: 1
-idouble: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asin":
+float: 1
+ifloat: 1
Function: "asinh":
double: 1
float: 1
+idouble: 1
ifloat: 1
-Function: "atan2":
+Function: "atan":
float: 1
ifloat: 1
-Function: "atanh":
+Function: "atan2":
float: 1
ifloat: 1
+Function: "atanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "cabs":
+double: 1
+idouble: 1
+
Function: Real part of "cacos":
double: 1
float: 2
@@ -25,15 +46,15 @@ idouble: 1
ifloat: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Imaginary part of "cacosh":
@@ -42,6 +63,10 @@ float: 2
idouble: 1
ifloat: 2
+Function: "carg":
+float: 1
+ifloat: 1
+
Function: Real part of "casin":
double: 1
float: 1
@@ -49,15 +74,15 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Imaginary part of "casinh":
@@ -67,7 +92,9 @@ idouble: 1
ifloat: 1
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Imaginary part of "catan":
@@ -83,13 +110,15 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "cbrt":
-double: 1
+double: 3
float: 1
-idouble: 1
+idouble: 3
ifloat: 1
Function: Real part of "ccos":
@@ -129,47 +158,37 @@ idouble: 1
ifloat: 2
Function: Real part of "clog":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: Imaginary part of "clog":
float: 1
ifloat: 1
Function: Real part of "clog10":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: Imaginary part of "clog10":
double: 2
float: 2
idouble: 2
ifloat: 2
-Function: Imaginary part of "clog10":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
Function: "cos":
float: 1
ifloat: 1
-Function: "cos_tonearest":
-float: 1
-ifloat: 1
-
Function: "cosh":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: "cosh_tonearest":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
Function: Real part of "cpow":
double: 2
float: 4
@@ -197,36 +216,24 @@ idouble: 1
ifloat: 1
Function: Real part of "csqrt":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Function: Imaginary part of "csqrt":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Real part of "ctan":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
-Function: Real part of "ctan_tonearest":
+Function: Real part of "ctan":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: Imaginary part of "ctan_tonearest":
+Function: Imaginary part of "ctan":
double: 2
float: 1
idouble: 2
@@ -244,53 +251,43 @@ float: 2
idouble: 2
ifloat: 2
-Function: Real part of "ctanh_tonearest":
-double: 2
+Function: "erf":
+double: 1
float: 1
-idouble: 2
+idouble: 1
ifloat: 1
-Function: Imaginary part of "ctanh_tonearest":
-double: 2
+Function: "erfc":
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-Function: "erf":
-double: 1
-idouble: 1
-
-Function: "erfc":
-double: 1
+Function: "exp":
float: 1
-idouble: 1
ifloat: 1
Function: "exp10":
-double: 1
-idouble: 1
+double: 2
+idouble: 2
-Function: "exp10_tonearest":
-double: 1
-idouble: 1
-
-Function: "expm1":
+Function: "exp2":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: "expm1_tonearest":
+Function: "expm1":
double: 1
float: 1
idouble: 1
ifloat: 1
Function: "gamma":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
Function: "hypot":
double: 1
@@ -315,34 +312,34 @@ idouble: 4
ifloat: 4
Function: "lgamma":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
Function: "log":
float: 1
ifloat: 1
Function: "log10":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: "log1p":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-Function: "pow":
+Function: "log2":
+double: 2
float: 1
+idouble: 2
ifloat: 1
-Function: "pow10":
-double: 1
-idouble: 1
-
-Function: "pow_tonearest":
+Function: "pow":
float: 1
ifloat: 1
@@ -350,19 +347,31 @@ Function: "sin":
float: 1
ifloat: 1
-Function: "sin_tonearest":
+Function: "sincos":
float: 1
ifloat: 1
-Function: "sincos":
+Function: "sinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tan":
float: 1
ifloat: 1
+Function: "tanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
Function: "tgamma":
-double: 4
-float: 3
-idouble: 4
-ifloat: 3
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
Function: "y0":
double: 2
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/machine-gmon.h b/sysdeps/microblaze/machine-gmon.h
index d2dd6cc342..70acd61bab 100644
--- a/sysdeps/microblaze/machine-gmon.h
+++ b/sysdeps/microblaze/machine-gmon.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/math_private.h b/sysdeps/microblaze/math_private.h
deleted file mode 100644
index d82e8bf820..0000000000
--- a/sysdeps/microblaze/math_private.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef MICROBLAZE_MATH_PRIVATE_H
-#define MICROBLAZE_MATH_PRIVATE_H 1
-
-/* Suppress use of exceptions here to avoid build errors if the FE_*
- macros aren't definied. Only allow rounding modes implemented for
- MicroBlaze.
-
- This does mean that some code will silently fail to report exceptions,
- set rounding mode as expected, etc., but it allows math code to compile
- that otherwise wouldn't (such as math/s_fma.c) and so is valuable.
-
- We intentionally ignore the "exception" arguments of functions that
- take an exception, since we can't even evaluate the argument
- without causing a build failure. The extra level of statement
- expression wrapping avoids "statement with no effect" warnings.
- Since the callers don't check for errors anyway, we just claim
- success in every case.
-
- The overrides for libc_ functions must happen before we include
- the generic math_private.h, and the overrides for regular
- <fenv.h> functions must happen afterwards, to avoid clashing with
- the declarations of those functions. */
-
-#define libc_fesetround(rnd) ({ 0; })
-#define libc_fetestexcept(exc) ({ 0; })
-#define libc_feholdexcept_setround(env, exc) ({ (void) (env); 0; })
-#define libc_feupdateenv_test(env, exc) ({ (void) (env); 0; })
-
-/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
- when built without long double support. */
-#define LDBL_CLASSIFY_COMPAT 1
-
-#include_next <math_private.h>
-
-#define feraiseexcept(excepts) ({ 0; })
-#define __feraiseexcept(excepts) ({ 0; })
-#define feclearexcept(exc) ({ 0; })
-
-#endif
diff --git a/sysdeps/microblaze/memusage.h b/sysdeps/microblaze/memusage.h
index 8d314e18ee..de17609cba 100644
--- a/sysdeps/microblaze/memusage.h
+++ b/sysdeps/microblaze/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/nptl/Makefile b/sysdeps/microblaze/nptl/Makefile
index 486aeca81e..bebbdef871 100644
--- a/sysdeps/microblaze/nptl/Makefile
+++ b/sysdeps/microblaze/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# Copyright (C) 2005-2018 Free Software Foundation, Inc.
#
# This file is part of the GNU C Library.
#
diff --git a/sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h b/sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..846d5d0a57
--- /dev/null
+++ b/sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 2002-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+# define _BITS_PTHREADTYPES_ARCH_H 1
+
+# include <endian.h>
+
+# define __SIZEOF_PTHREAD_ATTR_T 36
+# define __SIZEOF_PTHREAD_MUTEX_T 24
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+# define __SIZEOF_PTHREAD_COND_T 48
+# define __SIZEOF_PTHREAD_CONDATTR_T 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 32
+# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Definitions for internal mutex struct. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1
+#define __PTHREAD_MUTEX_USE_UNION 1
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+# if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+# else
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ unsigned char __shared;
+ unsigned char __pad1;
+ unsigned char __pad2;
+# endif
+ int __cur_writer;
+};
+
+# define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h. */
diff --git a/sysdeps/microblaze/nptl/bits/pthreadtypes.h b/sysdeps/microblaze/nptl/bits/pthreadtypes.h
deleted file mode 100644
index 9e9e307cf9..0000000000
--- a/sysdeps/microblaze/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/* Copyright (C) 2002-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 _BITS_PTHREADTYPES_H
-# define _BITS_PTHREADTYPES_H 1
-
-# include <endian.h>
-
-# define __SIZEOF_PTHREAD_ATTR_T 36
-# define __SIZEOF_PTHREAD_MUTEX_T 24
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_COND_COMPAT_T 12
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 32
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 20
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-
-
-/* Thread identifiers. The structure of the attribute type is not
- exposed on purpose. */
-typedef unsigned long int pthread_t;
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-
-# ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-# endif
-
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-
-/* Data structures for mutex handling. The structure of the attribute
- type is not exposed on purpose. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-/* Keys for thread-specific data. */
-typedef unsigned int pthread_key_t;
-
-/* Once-only execution. */
-typedef int pthread_once_t;
-
-# if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
-# if __BYTE_ORDER == __BIG_ENDIAN
- unsigned char __pad1;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
-# else
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- unsigned char __shared;
- unsigned char __pad1;
- unsigned char __pad2;
-# endif
- int __writer;
- } __data;
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-# endif
-
-# ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-# endif
-
-#endif /* bits/pthreadtypes.h. */
diff --git a/sysdeps/microblaze/nptl/bits/semaphore.h b/sysdeps/microblaze/nptl/bits/semaphore.h
index ea05026a06..d08e71e56b 100644
--- a/sysdeps/microblaze/nptl/bits/semaphore.h
+++ b/sysdeps/microblaze/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/nptl/pthread-offsets.h b/sysdeps/microblaze/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..9617354dc7
--- /dev/null
+++ b/sysdeps/microblaze/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+#define __PTHREAD_MUTEX_KIND_OFFSET 12
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 20
diff --git a/sysdeps/microblaze/nptl/pthread_spin_lock.c b/sysdeps/microblaze/nptl/pthread_spin_lock.c
deleted file mode 100644
index 21a54b8215..0000000000
--- a/sysdeps/microblaze/nptl/pthread_spin_lock.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (C) 2008-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 SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
-
-/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because
- it will resolve to this very file. Using "sysdeps/.." as reference to the
- top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
diff --git a/sysdeps/microblaze/nptl/pthreaddef.h b/sysdeps/microblaze/nptl/pthreaddef.h
index 56d80e18ea..12fac81398 100644
--- a/sysdeps/microblaze/nptl/pthreaddef.h
+++ b/sysdeps/microblaze/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/nptl/tcb-offsets.sym b/sysdeps/microblaze/nptl/tcb-offsets.sym
index 18afbee291..614f0dfed6 100644
--- a/sysdeps/microblaze/nptl/tcb-offsets.sym
+++ b/sysdeps/microblaze/nptl/tcb-offsets.sym
@@ -7,5 +7,4 @@
#define thread_offsetof(mem) (long)(offsetof (struct pthread, mem) - sizeof (struct pthread))
MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
-PID_OFFSET thread_offsetof (pid)
TID_OFFSET thread_offsetof (tid)
diff --git a/sysdeps/microblaze/nptl/tls.h b/sysdeps/microblaze/nptl/tls.h
index 8376f5005e..8b489740f2 100644
--- a/sysdeps/microblaze/nptl/tls.h
+++ b/sysdeps/microblaze/nptl/tls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -25,17 +25,7 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
@@ -126,6 +116,7 @@ typedef struct
(descr->member[idx] = (value))
/* Get and set the global scope generation counter in struct pthread. */
+# define THREAD_GSCOPE_IN_TCB 1
# define THREAD_GSCOPE_FLAG_UNUSED 0
# define THREAD_GSCOPE_FLAG_USED 1
# define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/microblaze/s_fma.c b/sysdeps/microblaze/s_fma.c
deleted file mode 100644
index d9613fa67c..0000000000
--- a/sysdeps/microblaze/s_fma.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <soft-fp/fmadf4.c>
diff --git a/sysdeps/microblaze/s_fmaf.c b/sysdeps/microblaze/s_fmaf.c
deleted file mode 100644
index aa5c9b2d91..0000000000
--- a/sysdeps/microblaze/s_fmaf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <soft-fp/fmasf4.c>
diff --git a/sysdeps/microblaze/setjmp.S b/sysdeps/microblaze/setjmp.S
index 7d42dd6b89..dda1f26e1b 100644
--- a/sysdeps/microblaze/setjmp.S
+++ b/sysdeps/microblaze/setjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/sotruss-lib.c b/sysdeps/microblaze/sotruss-lib.c
index 761ddeffa6..a5f1f8decc 100644
--- a/sysdeps/microblaze/sotruss-lib.c
+++ b/sysdeps/microblaze/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for MicroBlaze.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/microblaze/stackinfo.h b/sysdeps/microblaze/stackinfo.h
index 193ea10a89..cfa339bdee 100644
--- a/sysdeps/microblaze/stackinfo.h
+++ b/sysdeps/microblaze/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/start.S b/sysdeps/microblaze/start.S
index 337c415563..cc8dd13fe4 100644
--- a/sysdeps/microblaze/start.S
+++ b/sysdeps/microblaze/start.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/sysdep.h b/sysdeps/microblaze/sysdep.h
index 366b3ca1a5..86cd827a09 100644
--- a/sysdeps/microblaze/sysdep.h
+++ b/sysdeps/microblaze/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/tls-macros.h b/sysdeps/microblaze/tls-macros.h
index 8ca20f0463..23d2f617f3 100644
--- a/sysdeps/microblaze/tls-macros.h
+++ b/sysdeps/microblaze/tls-macros.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/microblaze/tst-audit.h b/sysdeps/microblaze/tst-audit.h
index 115e14b282..11e73e0e10 100644
--- a/sysdeps/microblaze/tst-audit.h
+++ b/sysdeps/microblaze/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. MicroBlaze version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/mips/Makefile b/sysdeps/mips/Makefile
index 3d3552322b..7ac6fa5031 100644
--- a/sysdeps/mips/Makefile
+++ b/sysdeps/mips/Makefile
@@ -9,10 +9,7 @@ endif
ifeq ($(subdir),rt)
librt-sysdep_routines += rt-sysdep
-endif
-
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
+librt-shared-only-routines += rt-sysdep
endif
ifeq ($(subdir),csu)
@@ -26,6 +23,9 @@ CPPFLAGS-crtn.S += $(pic-ccflag)
endif
ASFLAGS-.os += $(pic-ccflag)
+# libc.a and libc_p.a must be compiled with -fPIE/-fpie for static PIE.
+ASFLAGS-.o += $(pie-default)
+ASFLAGS-.op += $(pie-default)
ifeq ($(subdir),elf)
ifneq ($(o32-fpabi),)
diff --git a/sysdeps/mips/__longjmp.c b/sysdeps/mips/__longjmp.c
index 9aed9fa517..56bb73f1bc 100644
--- a/sysdeps/mips/__longjmp.c
+++ b/sysdeps/mips/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
diff --git a/sysdeps/mips/add_n.S b/sysdeps/mips/add_n.S
index 6450bd93cc..b0a8fd13b9 100644
--- a/sysdeps/mips/add_n.S
+++ b/sysdeps/mips/add_n.S
@@ -1,7 +1,7 @@
/* MIPS2 __mpn_add_n -- Add two limb vectors of the same length > 0 and
store sum in a third limb vector.
-Copyright (C) 1995-2016 Free Software Foundation, Inc.
+Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/mips/addmul_1.S b/sysdeps/mips/addmul_1.S
index cf09942254..0b182084d7 100644
--- a/sysdeps/mips/addmul_1.S
+++ b/sysdeps/mips/addmul_1.S
@@ -1,7 +1,7 @@
/* MIPS __mpn_addmul_1 -- Multiply a limb vector with a single limb and
add the product to a second limb vector.
-Copyright (C) 1995-2016 Free Software Foundation, Inc.
+Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/mips/atomic-machine.h b/sysdeps/mips/atomic-machine.h
index a60e4fbac8..5acf9487c1 100644
--- a/sysdeps/mips/atomic-machine.h
+++ b/sysdeps/mips/atomic-machine.h
@@ -1,5 +1,5 @@
/* Low-level functions for atomic operations. Mips version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -55,68 +55,43 @@ typedef uintmax_t uatomic_max_t;
# define MIPS_SYNC sync
#endif
-/* Certain revisions of the R10000 Processor need an LL/SC Workaround
- enabled. Revisions before 3.0 misbehave on atomic operations, and
- Revs 2.6 and lower deadlock after several seconds due to other errata.
-
- To quote the R10K Errata:
- Workaround: The basic idea is to inhibit the four instructions
- from simultaneously becoming active in R10000. Padding all
- ll/sc sequences with nops or changing the looping branch in the
- routines to a branch likely (which is always predicted taken
- by R10000) will work. The nops should go after the loop, and the
- number of them should be 28. This number could be decremented for
- each additional instruction in the ll/sc loop such as the lock
- modifier(s) between the ll and sc, the looping branch and its
- delay slot. For typical short routines with one ll/sc loop, any
- instructions after the loop could also count as a decrement. The
- nop workaround pollutes the cache more but would be a few cycles
- faster if all the code is in the cache and the looping branch
- is predicted not taken. */
-
-
-#ifdef _MIPS_ARCH_R10000
-#define R10K_BEQZ_INSN "beqzl"
-#else
-#define R10K_BEQZ_INSN "beqz"
-#endif
-
#define MIPS_SYNC_STR_2(X) #X
#define MIPS_SYNC_STR_1(X) MIPS_SYNC_STR_2(X)
#define MIPS_SYNC_STR MIPS_SYNC_STR_1(MIPS_SYNC)
-#if __GNUC_PREREQ (4, 8) || defined __mips16
-/* The __atomic_* builtins are available in GCC 4.7 and later, but MIPS
- support for their efficient implementation was added only in GCC 4.8.
- We still want to use them even with GCC 4.7 for MIPS16 code where we
- have no assembly alternative available and want to avoid the __sync_*
- builtins if at all possible. */
-
#define USE_ATOMIC_COMPILER_BUILTINS 1
+/* MIPS is an LL/SC machine. However, XLP has a direct atomic exchange
+ instruction which will be used by __atomic_exchange_n. */
+#ifdef _MIPS_ARCH_XLP
+# define ATOMIC_EXCHANGE_USES_CAS 0
+#else
+# define ATOMIC_EXCHANGE_USES_CAS 1
+#endif
+
/* Compare and exchange.
For all "bool" routines, we return FALSE if exchange succesful. */
-# define __arch_compare_and_exchange_bool_8_int(mem, newval, oldval, model) \
+#define __arch_compare_and_exchange_bool_8_int(mem, newval, oldval, model) \
(abort (), 0)
-# define __arch_compare_and_exchange_bool_16_int(mem, newval, oldval, model) \
+#define __arch_compare_and_exchange_bool_16_int(mem, newval, oldval, model) \
(abort (), 0)
-# define __arch_compare_and_exchange_bool_32_int(mem, newval, oldval, model) \
+#define __arch_compare_and_exchange_bool_32_int(mem, newval, oldval, model) \
({ \
typeof (*mem) __oldval = (oldval); \
!__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \
model, __ATOMIC_RELAXED); \
})
-# define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model) \
+#define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model) \
(abort (), (typeof(*mem)) 0)
-# define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model) \
+#define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model) \
(abort (), (typeof(*mem)) 0)
-# define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model) \
+#define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model) \
({ \
typeof (*mem) __oldval = (oldval); \
__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \
@@ -124,343 +99,91 @@ typedef uintmax_t uatomic_max_t;
__oldval; \
})
-# if _MIPS_SIM == _ABIO32
+#if _MIPS_SIM == _ABIO32
/* We can't do an atomic 64-bit operation in O32. */
-# define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \
+# define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \
(abort (), 0)
-# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \
+# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \
(abort (), (typeof(*mem)) 0)
-# else
-# define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \
+#else
+# define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \
__arch_compare_and_exchange_bool_32_int (mem, newval, oldval, model)
-# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \
+# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \
__arch_compare_and_exchange_val_32_int (mem, newval, oldval, model)
-# endif
+#endif
/* Compare and exchange with "acquire" semantics, ie barrier after. */
-# define atomic_compare_and_exchange_bool_acq(mem, new, old) \
+#define atomic_compare_and_exchange_bool_acq(mem, new, old) \
__atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
mem, new, old, __ATOMIC_ACQUIRE)
-# define atomic_compare_and_exchange_val_acq(mem, new, old) \
+#define atomic_compare_and_exchange_val_acq(mem, new, old) \
__atomic_val_bysize (__arch_compare_and_exchange_val, int, \
mem, new, old, __ATOMIC_ACQUIRE)
/* Compare and exchange with "release" semantics, ie barrier before. */
-# define atomic_compare_and_exchange_bool_rel(mem, new, old) \
- __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
- mem, new, old, __ATOMIC_RELEASE)
-
-# define atomic_compare_and_exchange_val_rel(mem, new, old) \
+#define atomic_compare_and_exchange_val_rel(mem, new, old) \
__atomic_val_bysize (__arch_compare_and_exchange_val, int, \
mem, new, old, __ATOMIC_RELEASE)
/* Atomic exchange (without compare). */
-# define __arch_exchange_8_int(mem, newval, model) \
+#define __arch_exchange_8_int(mem, newval, model) \
(abort (), (typeof(*mem)) 0)
-# define __arch_exchange_16_int(mem, newval, model) \
+#define __arch_exchange_16_int(mem, newval, model) \
(abort (), (typeof(*mem)) 0)
-# define __arch_exchange_32_int(mem, newval, model) \
+#define __arch_exchange_32_int(mem, newval, model) \
__atomic_exchange_n (mem, newval, model)
-# if _MIPS_SIM == _ABIO32
+#if _MIPS_SIM == _ABIO32
/* We can't do an atomic 64-bit operation in O32. */
-# define __arch_exchange_64_int(mem, newval, model) \
+# define __arch_exchange_64_int(mem, newval, model) \
(abort (), (typeof(*mem)) 0)
-# else
-# define __arch_exchange_64_int(mem, newval, model) \
+#else
+# define __arch_exchange_64_int(mem, newval, model) \
__atomic_exchange_n (mem, newval, model)
-# endif
+#endif
-# define atomic_exchange_acq(mem, value) \
+#define atomic_exchange_acq(mem, value) \
__atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_ACQUIRE)
-# define atomic_exchange_rel(mem, value) \
+#define atomic_exchange_rel(mem, value) \
__atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_RELEASE)
/* Atomically add value and return the previous (unincremented) value. */
-# define __arch_exchange_and_add_8_int(mem, value, model) \
+#define __arch_exchange_and_add_8_int(mem, value, model) \
(abort (), (typeof(*mem)) 0)
-# define __arch_exchange_and_add_16_int(mem, value, model) \
+#define __arch_exchange_and_add_16_int(mem, value, model) \
(abort (), (typeof(*mem)) 0)
-# define __arch_exchange_and_add_32_int(mem, value, model) \
+#define __arch_exchange_and_add_32_int(mem, value, model) \
__atomic_fetch_add (mem, value, model)
-# if _MIPS_SIM == _ABIO32
+#if _MIPS_SIM == _ABIO32
/* We can't do an atomic 64-bit operation in O32. */
-# define __arch_exchange_and_add_64_int(mem, value, model) \
+# define __arch_exchange_and_add_64_int(mem, value, model) \
(abort (), (typeof(*mem)) 0)
-# else
-# define __arch_exchange_and_add_64_int(mem, value, model) \
+#else
+# define __arch_exchange_and_add_64_int(mem, value, model) \
__atomic_fetch_add (mem, value, model)
-# endif
+#endif
-# define atomic_exchange_and_add_acq(mem, value) \
+#define atomic_exchange_and_add_acq(mem, value) \
__atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
__ATOMIC_ACQUIRE)
-# define atomic_exchange_and_add_rel(mem, value) \
+#define atomic_exchange_and_add_rel(mem, value) \
__atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
__ATOMIC_RELEASE)
-#else /* !__mips16 && !__GNUC_PREREQ (4, 8) */
-/* This implementation using inline assembly will be removed once glibc
- requires GCC 4.8 or later to build. */
-
-#define USE_ATOMIC_COMPILER_BUILTINS 0
-
-/* Compare and exchange. For all of the "xxx" routines, we expect a
- "__prev" and a "__cmp" variable to be provided by the enclosing scope,
- in which values are returned. */
-
-# define __arch_compare_and_exchange_xxx_8_int(mem, newval, oldval, rel, acq) \
- (abort (), __prev = 0, __cmp = 0, (void) __cmp)
-
-# define __arch_compare_and_exchange_xxx_16_int(mem, newval, oldval, rel, acq) \
- (abort (), __prev = 0, __cmp = 0, (void) __cmp)
-
-# define __arch_compare_and_exchange_xxx_32_int(mem, newval, oldval, rel, acq) \
- __asm__ __volatile__ ( \
- ".set push\n\t" \
- MIPS_PUSH_MIPS2 \
- rel "\n" \
- "1:\t" \
- "ll %0,%5\n\t" \
- "move %1,$0\n\t" \
- "bne %0,%3,2f\n\t" \
- "move %1,%4\n\t" \
- "sc %1,%2\n\t" \
- R10K_BEQZ_INSN" %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
- : "r" (oldval), "r" (newval), "m" (*mem) \
- : "memory")
-
-# if _MIPS_SIM == _ABIO32
-/* We can't do an atomic 64-bit operation in O32. */
-# define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \
- (abort (), __prev = 0, __cmp = 0, (void) __cmp)
-# else
-# define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \
- __asm__ __volatile__ ("\n" \
- ".set push\n\t" \
- MIPS_PUSH_MIPS2 \
- rel "\n" \
- "1:\t" \
- "lld %0,%5\n\t" \
- "move %1,$0\n\t" \
- "bne %0,%3,2f\n\t" \
- "move %1,%4\n\t" \
- "scd %1,%2\n\t" \
- R10K_BEQZ_INSN" %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
- : "r" (oldval), "r" (newval), "m" (*mem) \
- : "memory")
-# endif
-
-/* For all "bool" routines, we return FALSE if exchange succesful. */
-
-# define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \
- __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \
- !__cmp; })
-
-# define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \
- __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \
- !__cmp; })
-
-# define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \
- __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \
- !__cmp; })
-
-# define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \
- __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \
- !__cmp; })
-
-/* For all "val" routines, return the old value whether exchange
- successful or not. */
-
-# define __arch_compare_and_exchange_val_8_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
- __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \
- (typeof (*mem))__prev; })
-
-# define __arch_compare_and_exchange_val_16_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
- __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \
- (typeof (*mem))__prev; })
-
-# define __arch_compare_and_exchange_val_32_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
- __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \
- (typeof (*mem))__prev; })
-
-# define __arch_compare_and_exchange_val_64_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
- __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \
- (typeof (*mem))__prev; })
-
-/* Compare and exchange with "acquire" semantics, ie barrier after. */
-
-# define atomic_compare_and_exchange_bool_acq(mem, new, old) \
- __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
- mem, new, old, "", MIPS_SYNC_STR)
-
-# define atomic_compare_and_exchange_val_acq(mem, new, old) \
- __atomic_val_bysize (__arch_compare_and_exchange_val, int, \
- mem, new, old, "", MIPS_SYNC_STR)
-
-/* Compare and exchange with "release" semantics, ie barrier before. */
-
-# define atomic_compare_and_exchange_bool_rel(mem, new, old) \
- __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
- mem, new, old, MIPS_SYNC_STR, "")
-
-# define atomic_compare_and_exchange_val_rel(mem, new, old) \
- __atomic_val_bysize (__arch_compare_and_exchange_val, int, \
- mem, new, old, MIPS_SYNC_STR, "")
-
-
-
-/* Atomic exchange (without compare). */
-
-# define __arch_exchange_xxx_8_int(mem, newval, rel, acq) \
- (abort (), (typeof(*mem)) 0)
-
-# define __arch_exchange_xxx_16_int(mem, newval, rel, acq) \
- (abort (), (typeof(*mem)) 0)
-
-# define __arch_exchange_xxx_32_int(mem, newval, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
- __asm__ __volatile__ ("\n" \
- ".set push\n\t" \
- MIPS_PUSH_MIPS2 \
- rel "\n" \
- "1:\t" \
- "ll %0,%4\n\t" \
- "move %1,%3\n\t" \
- "sc %1,%2\n\t" \
- R10K_BEQZ_INSN" %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
- : "r" (newval), "m" (*mem) \
- : "memory"); \
- __prev; })
-
-# if _MIPS_SIM == _ABIO32
-/* We can't do an atomic 64-bit operation in O32. */
-# define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \
- (abort (), (typeof(*mem)) 0)
-# else
-# define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
- __asm__ __volatile__ ("\n" \
- ".set push\n\t" \
- MIPS_PUSH_MIPS2 \
- rel "\n" \
- "1:\n" \
- "lld %0,%4\n\t" \
- "move %1,%3\n\t" \
- "scd %1,%2\n\t" \
- R10K_BEQZ_INSN" %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
- : "r" (newval), "m" (*mem) \
- : "memory"); \
- __prev; })
-# endif
-
-# define atomic_exchange_acq(mem, value) \
- __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, "", MIPS_SYNC_STR)
-
-# define atomic_exchange_rel(mem, value) \
- __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, MIPS_SYNC_STR, "")
-
-
-/* Atomically add value and return the previous (unincremented) value. */
-
-# define __arch_exchange_and_add_8_int(mem, newval, rel, acq) \
- (abort (), (typeof(*mem)) 0)
-
-# define __arch_exchange_and_add_16_int(mem, newval, rel, acq) \
- (abort (), (typeof(*mem)) 0)
-
-# define __arch_exchange_and_add_32_int(mem, value, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
- __asm__ __volatile__ ("\n" \
- ".set push\n\t" \
- MIPS_PUSH_MIPS2 \
- rel "\n" \
- "1:\t" \
- "ll %0,%4\n\t" \
- "addu %1,%0,%3\n\t" \
- "sc %1,%2\n\t" \
- R10K_BEQZ_INSN" %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
- : "r" (value), "m" (*mem) \
- : "memory"); \
- __prev; })
-
-# if _MIPS_SIM == _ABIO32
-/* We can't do an atomic 64-bit operation in O32. */
-# define __arch_exchange_and_add_64_int(mem, value, rel, acq) \
- (abort (), (typeof(*mem)) 0)
-# else
-# define __arch_exchange_and_add_64_int(mem, value, rel, acq) \
-({ typeof (*mem) __prev; int __cmp; \
- __asm__ __volatile__ ( \
- ".set push\n\t" \
- MIPS_PUSH_MIPS2 \
- rel "\n" \
- "1:\t" \
- "lld %0,%4\n\t" \
- "daddu %1,%0,%3\n\t" \
- "scd %1,%2\n\t" \
- R10K_BEQZ_INSN" %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
- : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
- : "r" (value), "m" (*mem) \
- : "memory"); \
- __prev; })
-# endif
-
-# define atomic_exchange_and_add_acq(mem, value) \
- __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
- "", MIPS_SYNC_STR)
-
-# define atomic_exchange_and_add_rel(mem, value) \
- __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
- MIPS_SYNC_STR, "")
-
-#endif /* !__mips16 && !__GNUC_PREREQ (4, 8) */
-
/* TODO: More atomic operations could be implemented efficiently; only the
basic requirements are done. */
diff --git a/sysdeps/mips/backtrace.c b/sysdeps/mips/backtrace.c
deleted file mode 100644
index 27ce597b39..0000000000
--- a/sysdeps/mips/backtrace.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/x86_64/backtrace.c>
diff --git a/sysdeps/mips/bits/dlfcn.h b/sysdeps/mips/bits/dlfcn.h
index caf7ea72ea..471ab4fdda 100644
--- a/sysdeps/mips/bits/dlfcn.h
+++ b/sysdeps/mips/bits/dlfcn.h
@@ -1,5 +1,5 @@
/* System dependent definitions for run-time dynamic loading.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/bits/fenv.h b/sysdeps/mips/bits/fenv.h
index f829bd3807..37d0a9e64d 100644
--- a/sysdeps/mips/bits/fenv.h
+++ b/sysdeps/mips/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/ipctypes.h b/sysdeps/mips/bits/ipctypes.h
index d09136b805..57b4aa5997 100644
--- a/sysdeps/mips/bits/ipctypes.h
+++ b/sysdeps/mips/bits/ipctypes.h
@@ -1,5 +1,5 @@
/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. MIPS version
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/bits/link.h b/sysdeps/mips/bits/link.h
index 0bb6a61b10..207171c512 100644
--- a/sysdeps/mips/bits/link.h
+++ b/sysdeps/mips/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/bits/mathdef.h b/sysdeps/mips/bits/mathdef.h
deleted file mode 100644
index 3a1162776f..0000000000
--- a/sysdeps/mips/bits/mathdef.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#include <sgidefs.h>
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* MIPS has `float' and `double' operations. */
-typedef float float_t; /* `float' expressions are evaluated as
- `float'. */
-typedef double double_t; /* `double' expressions are evaluated as
- `double'. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647)
-# define FP_ILOGBNAN 2147483647
-
-#endif /* ISO C99 */
-
-#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
-/* Signal that we do not really have a `long double'. This disables the
- declaration of all the `long double' function variants. */
-# define __NO_LONG_DOUBLE_MATH 1
-#endif
diff --git a/sysdeps/mips/bits/nan.h b/sysdeps/mips/bits/nan.h
deleted file mode 100644
index feecd2704a..0000000000
--- a/sysdeps/mips/bits/nan.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* `NAN' constant for IEEE 754 machines. MIPS version.
- Copyright (C) 1992-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/nan.h> directly; include <math.h> instead."
-#endif
-
-
-/* IEEE Not A Number. */
-/* In legacy-NaN mode MIPS has the qNaN and sNaN patterns reversed
- compared to most other architectures. IEEE 754-1985 left the
- definition of this open to implementations, and for MIPS the top bit
- of the mantissa must be SET to indicate a sNaN. In 2008-NaN mode
- MIPS aligned to IEEE 754-2008. */
-
-#if __GNUC_PREREQ(3,3)
-
-# define NAN (__builtin_nanf (""))
-
-#elif defined __GNUC__
-
-/* No 2008-NaN mode support in any GCC version before 4.9. */
-
-# define NAN \
- (__extension__ \
- ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \
- { __l: 0x7fbfffffUL }).__d)
-
-#else
-
-# include <endian.h>
-
-# if __BYTE_ORDER == __BIG_ENDIAN
-# ifdef __mips_nan2008
-# define __qnan_bytes { 0x7f, 0xc0, 0, 0 }
-# else
-# define __qnan_bytes { 0x7f, 0xbf, 0xff, 0xff }
-# endif
-# endif
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# ifdef __mips_nan2008
-# define __qnan_bytes { 0, 0, 0xc0, 0x7f }
-# else
-# define __qnan_bytes { 0xff, 0xff, 0xbf, 0x7f }
-# endif
-# endif
-
-static union { unsigned char __c[4]; float __d; } __qnan_union
- __attribute__ ((__unused__)) = { __qnan_bytes };
-# define NAN (__qnan_union.__d)
-
-#endif /* GCC. */
diff --git a/sysdeps/mips/bits/setjmp.h b/sysdeps/mips/bits/setjmp.h
index 9ba70beda3..e859101b00 100644
--- a/sysdeps/mips/bits/setjmp.h
+++ b/sysdeps/mips/bits/setjmp.h
@@ -1,5 +1,5 @@
/* Define the machine-dependent type `jmp_buf'. MIPS version.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,19 +29,19 @@ typedef struct __jmp_buf_internal_tag
{
#if _MIPS_SIM == _ABIO32
/* Program counter. */
- __ptr_t __pc;
+ void *__pc;
/* Stack pointer. */
- __ptr_t __sp;
+ void *__sp;
/* Callee-saved registers s0 through s7. */
int __regs[8];
/* The frame pointer. */
- __ptr_t __fp;
+ void *__fp;
/* The global pointer. */
- __ptr_t __gp;
+ void *__gp;
#else
/* Program counter. */
__extension__ long long __pc;
diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h
index bc90435442..4dcc655eb9 100644
--- a/sysdeps/mips/bits/wordsize.h
+++ b/sysdeps/mips/bits/wordsize.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,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/bsd-_setjmp.S b/sysdeps/mips/bsd-_setjmp.S
index b75e091f16..8e041d0893 100644
--- a/sysdeps/mips/bsd-_setjmp.S
+++ b/sysdeps/mips/bsd-_setjmp.S
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/bsd-setjmp.S b/sysdeps/mips/bsd-setjmp.S
index 2ec4fe8263..6ea08661f2 100644
--- a/sysdeps/mips/bsd-setjmp.S
+++ b/sysdeps/mips/bsd-setjmp.S
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/dl-dtprocnum.h b/sysdeps/mips/dl-dtprocnum.h
index ee72ebe81e..14aaebec8e 100644
--- a/sysdeps/mips/dl-dtprocnum.h
+++ b/sysdeps/mips/dl-dtprocnum.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions. MIPS version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/dl-machine-reject-phdr.h b/sysdeps/mips/dl-machine-reject-phdr.h
index 6fe8287356..afa3d41b0a 100644
--- a/sysdeps/mips/dl-machine-reject-phdr.h
+++ b/sysdeps/mips/dl-machine-reject-phdr.h
@@ -1,5 +1,5 @@
/* Machine-dependent program header inspection for the ELF loader.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index 8c0b40e8de..91fc640388 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. MIPS version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
@@ -190,7 +190,7 @@ elf_machine_load_address (void)
fiddles with global data. */
#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
do { \
- struct link_map *map = &bootstrap_map; \
+ struct link_map *map = BOOTSTRAP_MAP; \
ElfW(Sym) *sym; \
ElfW(Addr) *got; \
int i, n; \
@@ -220,7 +220,7 @@ do { \
while (i--) \
{ \
if (sym->st_shndx == SHN_UNDEF || sym->st_shndx == SHN_COMMON) \
- *got = map->l_addr + sym->st_value; \
+ *got = SYMBOL_ADDRESS (map, sym, true); \
else if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC \
&& *got != sym->st_value) \
*got += map->l_addr; \
@@ -230,7 +230,7 @@ do { \
*got += map->l_addr; \
} \
else \
- *got = map->l_addr + sym->st_value; \
+ *got = SYMBOL_ADDRESS (map, sym, true); \
\
got++; \
sym++; \
@@ -453,6 +453,7 @@ dl_platform_init (void)
the corresponding PLT entry instead. */
static inline ElfW(Addr)
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const ElfW(Rel) *reloc,
ElfW(Addr) *reloc_addr, ElfW(Addr) value)
{
@@ -597,7 +598,7 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
#ifndef RTLD_BOOTSTRAP
if (map != &GL(dl_rtld_map))
#endif
- reloc_value += sym->st_value + map->l_addr;
+ reloc_value += SYMBOL_ADDRESS (map, sym, true);
}
else
{
@@ -662,7 +663,7 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
"found jump slot relocation with non-zero addend");
sym_map = RESOLVE_MAP (&sym, version, r_type);
- value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ value = SYMBOL_ADDRESS (sym_map, sym, true);
*addr_field = value;
break;
@@ -676,7 +677,7 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
/* Calculate the address of the symbol. */
sym_map = RESOLVE_MAP (&sym, version, r_type);
- value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ value = SYMBOL_ADDRESS (sym_map, sym, true);
if (__builtin_expect (sym == NULL, 0))
/* This can happen in trace mode if an object could not be
@@ -694,7 +695,8 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
RTLD_PROGNAME, strtab + refsym->st_name);
}
memcpy (reloc_addr, (void *) value,
- MIN (sym->st_size, refsym->st_size));
+ sym->st_size < refsym->st_size
+ ? sym->st_size : refsym->st_size);
break;
}
@@ -796,7 +798,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
= vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL; \
struct link_map *sym_map; \
sym_map = RESOLVE_MAP (&ref, version, reloc); \
- ref ? sym_map->l_addr + ref->st_value : 0; \
+ SYMBOL_ADDRESS (sym_map, ref, true); \
})
if (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL)
@@ -840,7 +842,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
&& !(sym->st_other & STO_MIPS_PLT))
{
if (lazy)
- *got = sym->st_value + map->l_addr;
+ *got = SYMBOL_ADDRESS (map, sym, true);
else
/* This is a lazy-binding stub, so we don't need the
canonical address. */
diff --git a/sysdeps/mips/dl-procinfo.c b/sysdeps/mips/dl-procinfo.c
index 9158d32d3d..008d52d33e 100644
--- a/sysdeps/mips/dl-procinfo.c
+++ b/sysdeps/mips/dl-procinfo.c
@@ -1,5 +1,5 @@
/* Data for Mips version of processor capability information.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Robert Millan <rmh@gnu.org>.
diff --git a/sysdeps/mips/dl-procinfo.h b/sysdeps/mips/dl-procinfo.h
index d031b0c46f..68235c48f8 100644
--- a/sysdeps/mips/dl-procinfo.h
+++ b/sysdeps/mips/dl-procinfo.h
@@ -1,5 +1,5 @@
/* Mips version of processor capability information handling macros.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Robert Millan <rmh@gnu.org>.
@@ -28,13 +28,6 @@
#define _DL_PLATFORMS_COUNT 4
-static inline const char *
-__attribute__ ((unused))
-_dl_platform_string (int idx)
-{
- return GLRO(dl_mips_platforms)[idx];
-};
-
static inline int
__attribute__ ((unused, always_inline))
_dl_string_platform (const char *str)
@@ -44,7 +37,7 @@ _dl_string_platform (const char *str)
if (str != NULL)
for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
{
- if (strcmp (str, _dl_platform_string (i)) == 0)
+ if (strcmp (str, GLRO(dl_mips_platforms)[i]) == 0)
return i;
}
return -1;
diff --git a/sysdeps/mips/dl-tls.h b/sysdeps/mips/dl-tls.h
index 4d084d6191..7f9ce2a9e8 100644
--- a/sysdeps/mips/dl-tls.h
+++ b/sysdeps/mips/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. MIPS version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -43,6 +43,3 @@ extern void *__tls_get_addr (tls_index *ti);
# define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
# define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/mips/dl-trampoline.c b/sysdeps/mips/dl-trampoline.c
index fbb1ded65f..35b6b93a89 100644
--- a/sysdeps/mips/dl-trampoline.c
+++ b/sysdeps/mips/dl-trampoline.c
@@ -1,5 +1,5 @@
/* PLT trampoline. MIPS version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
@@ -192,12 +192,12 @@ __dl_runtime_resolve (ElfW(Word) sym_index,
/* Currently value contains the base load address of the object
that defines sym. Now add in the symbol offset. */
- value = (sym ? sym_map->l_addr + sym->st_value : 0);
+ value = SYMBOL_ADDRESS (sym_map, sym, true);
}
else
/* We already found the symbol. The module (and therefore its load
address) is also known. */
- value = l->l_addr + sym->st_value;
+ value = SYMBOL_ADDRESS (l, sym, true);
/* Apply the relocation with that value. */
*(got + local_gotno + sym_index - gotsym) = value;
diff --git a/sysdeps/mips/fpregdef.h b/sysdeps/mips/fpregdef.h
index d00f7115cb..6b7e7b1333 100644
--- a/sysdeps/mips/fpregdef.h
+++ b/sysdeps/mips/fpregdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/fpu/e_sqrt.c b/sysdeps/mips/fpu/e_sqrt.c
index 9c48fef125..3a18711951 100644
--- a/sysdeps/mips/fpu/e_sqrt.c
+++ b/sysdeps/mips/fpu/e_sqrt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Hartvig Ekner <hartvige@mips.com>, 2002.
diff --git a/sysdeps/mips/fpu/e_sqrtf.c b/sysdeps/mips/fpu/e_sqrtf.c
index b3a31550dd..ed858ab04a 100644
--- a/sysdeps/mips/fpu/e_sqrtf.c
+++ b/sysdeps/mips/fpu/e_sqrtf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Hartvig Ekner <hartvige@mips.com>, 2002.
diff --git a/sysdeps/mips/fpu/fclrexcpt.c b/sysdeps/mips/fpu/fclrexcpt.c
index 6b044ab05f..51310d931f 100644
--- a/sysdeps/mips/fpu/fclrexcpt.c
+++ b/sysdeps/mips/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1998.
diff --git a/sysdeps/mips/fpu/fedisblxcpt.c b/sysdeps/mips/fpu/fedisblxcpt.c
index 87287cbcb0..37a6a6e358 100644
--- a/sysdeps/mips/fpu/fedisblxcpt.c
+++ b/sysdeps/mips/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
diff --git a/sysdeps/mips/fpu/feenablxcpt.c b/sysdeps/mips/fpu/feenablxcpt.c
index 0a6dffc37c..81f73ab6bd 100644
--- a/sysdeps/mips/fpu/feenablxcpt.c
+++ b/sysdeps/mips/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
diff --git a/sysdeps/mips/fpu/fegetenv.c b/sysdeps/mips/fpu/fegetenv.c
index fd9dcb8a4b..8e8fa2c576 100644
--- a/sysdeps/mips/fpu/fegetenv.c
+++ b/sysdeps/mips/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1998.
diff --git a/sysdeps/mips/fpu/fegetexcept.c b/sysdeps/mips/fpu/fegetexcept.c
index d02089c261..da7e56f1d6 100644
--- a/sysdeps/mips/fpu/fegetexcept.c
+++ b/sysdeps/mips/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
diff --git a/sysdeps/mips/fpu/fegetmode.c b/sysdeps/mips/fpu/fegetmode.c
new file mode 100644
index 0000000000..e0a5180f7b
--- /dev/null
+++ b/sysdeps/mips/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. MIPS version.
+ Copyright (C) 2016-2018 Free Software 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/mips/fpu/fegetround.c b/sysdeps/mips/fpu/fegetround.c
index 72b414e71e..a7ac444aea 100644
--- a/sysdeps/mips/fpu/fegetround.c
+++ b/sysdeps/mips/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
diff --git a/sysdeps/mips/fpu/feholdexcpt.c b/sysdeps/mips/fpu/feholdexcpt.c
index 4e48bc055a..eb9d476498 100644
--- a/sysdeps/mips/fpu/feholdexcpt.c
+++ b/sysdeps/mips/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
diff --git a/sysdeps/mips/fpu/fenv_libc.h b/sysdeps/mips/fpu/fenv_libc.h
index bb28d8fded..4f32cddbca 100644
--- a/sysdeps/mips/fpu/fenv_libc.h
+++ b/sysdeps/mips/fpu/fenv_libc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>.
diff --git a/sysdeps/mips/fpu/fesetenv.c b/sysdeps/mips/fpu/fesetenv.c
index a99810eee5..8dee8782c3 100644
--- a/sysdeps/mips/fpu/fesetenv.c
+++ b/sysdeps/mips/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1998.
diff --git a/sysdeps/mips/fpu/fesetexcept.c b/sysdeps/mips/fpu/fesetexcept.c
new file mode 100644
index 0000000000..d14febca6b
--- /dev/null
+++ b/sysdeps/mips/fpu/fesetexcept.c
@@ -0,0 +1,32 @@
+/* Set given exception flags. MIPS version.
+ Copyright (C) 2016-2018 Free Software 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/mips/fpu/fesetmode.c b/sysdeps/mips/fpu/fesetmode.c
new file mode 100644
index 0000000000..68541735b4
--- /dev/null
+++ b/sysdeps/mips/fpu/fesetmode.c
@@ -0,0 +1,38 @@
+/* Install given floating-point control modes. MIPS version.
+ Copyright (C) 2016-2018 Free Software 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/fpu/fesetround.c b/sysdeps/mips/fpu/fesetround.c
index 0e0b2f2293..31fdeab368 100644
--- a/sysdeps/mips/fpu/fesetround.c
+++ b/sysdeps/mips/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
diff --git a/sysdeps/mips/fpu/feupdateenv.c b/sysdeps/mips/fpu/feupdateenv.c
index 2f9e4a3cf2..669bfc3c9e 100644
--- a/sysdeps/mips/fpu/feupdateenv.c
+++ b/sysdeps/mips/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1998.
diff --git a/sysdeps/mips/fpu/fgetexcptflg.c b/sysdeps/mips/fpu/fgetexcptflg.c
index 04fe583db5..1e594e1470 100644
--- a/sysdeps/mips/fpu/fgetexcptflg.c
+++ b/sysdeps/mips/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1998.
diff --git a/sysdeps/mips/fpu/fraiseexcpt.c b/sysdeps/mips/fpu/fraiseexcpt.c
index 9d71e2051b..56ad431662 100644
--- a/sysdeps/mips/fpu/fraiseexcpt.c
+++ b/sysdeps/mips/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
diff --git a/sysdeps/mips/fpu/fsetexcptflg.c b/sysdeps/mips/fpu/fsetexcptflg.c
index 43a2037da6..dc447a7775 100644
--- a/sysdeps/mips/fpu/fsetexcptflg.c
+++ b/sysdeps/mips/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Hartvig Ekner <hartvige@mips.com>, 2002.
diff --git a/sysdeps/mips/fpu/ftestexcept.c b/sysdeps/mips/fpu/ftestexcept.c
index 41b2f73da8..fa645b2675 100644
--- a/sysdeps/mips/fpu/ftestexcept.c
+++ b/sysdeps/mips/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
diff --git a/sysdeps/mips/fpu_control.h b/sysdeps/mips/fpu_control.h
index ca077bf9aa..a1d88fea06 100644
--- a/sysdeps/mips/fpu_control.h
+++ b/sysdeps/mips/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word bits. Mips version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Olaf Flebbe and Ralf Baechle.
diff --git a/sysdeps/mips/gccframe.h b/sysdeps/mips/gccframe.h
index eaa7bfb44e..af6a17f17f 100644
--- a/sysdeps/mips/gccframe.h
+++ b/sysdeps/mips/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. mips version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/ieee754/bits/floatn.h b/sysdeps/mips/ieee754/bits/floatn.h
new file mode 100644
index 0000000000..917fe4bc3c
--- /dev/null
+++ b/sysdeps/mips/ieee754/bits/floatn.h
@@ -0,0 +1,97 @@
+/* Macros to control TS 18661-3 glibc features on MIPS platforms.
+ Copyright (C) 2017-2018 Free Software 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 _BITS_FLOATN_H
+#define _BITS_FLOATN_H
+
+#include <features.h>
+#include <bits/long-double.h>
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the IEEE 754 binary128 format, and this
+ glibc includes corresponding *f128 interfaces for it. */
+#ifndef __NO_LONG_DOUBLE_MATH
+# define __HAVE_FLOAT128 1
+#else
+/* glibc does not support _Float128 for platforms where long double is
+ normally binary128 when building with long double as binary64.
+ GCC's default for supported scalar modes does not support it either
+ in that case. */
+# define __HAVE_FLOAT128 0
+#endif
+
+/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
+ from the default float, double and long double types in this glibc. */
+#define __HAVE_DISTINCT_FLOAT128 0
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the right format for _Float64x, and this
+ glibc includes corresponding *f64x interfaces for it. */
+#define __HAVE_FLOAT64X __HAVE_FLOAT128
+
+/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
+ of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
+ the format of _Float128, which must be different from that of long
+ double. */
+#define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128
+
+#ifndef __ASSEMBLER__
+
+/* Defined to concatenate the literal suffix to be used with _Float128
+ types, if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* The literal suffix f128 exists only since GCC 7.0. */
+# define __f128(x) x##l
+# else
+# define __f128(x) x##f128
+# endif
+# endif
+
+/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+# define __CFLOAT128 _Complex long double
+# else
+# define __CFLOAT128 _Complex _Float128
+# endif
+# endif
+
+/* The remaining of this file provides support for older compilers. */
+# if __HAVE_FLOAT128
+
+/* The type _Float128 exists only since GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+typedef long double _Float128;
+# endif
+
+/* Various built-in functions do not exist before GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_huge_valf128() (__builtin_huge_vall ())
+# define __builtin_inff128() (__builtin_infl ())
+# define __builtin_nanf128(x) (__builtin_nanl (x))
+# define __builtin_nansf128(x) (__builtin_nansl (x))
+# endif
+
+# endif
+
+#endif /* !__ASSEMBLER__. */
+
+#include <bits/floatn-common.h>
+
+#endif /* _BITS_FLOATN_H */
diff --git a/sysdeps/mips/ieee754/bits/long-double.h b/sysdeps/mips/ieee754/bits/long-double.h
new file mode 100644
index 0000000000..a1e41d28df
--- /dev/null
+++ b/sysdeps/mips/ieee754/bits/long-double.h
@@ -0,0 +1,23 @@
+/* Properties of long double type. MIPS version.
+ Copyright (C) 2016-2018 Free Software 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 published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <sgidefs.h>
+
+#if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
+# define __NO_LONG_DOUBLE_MATH 1
+#endif
diff --git a/sysdeps/mips/ieee754/ieee754.h b/sysdeps/mips/ieee754/ieee754.h
index f34a2fa2d0..9b94ecb280 100644
--- a/sysdeps/mips/ieee754/ieee754.h
+++ b/sysdeps/mips/ieee754/ieee754.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/ieee754/s_fma.c b/sysdeps/mips/ieee754/s_fma.c
deleted file mode 100644
index 574141416b..0000000000
--- a/sysdeps/mips/ieee754/s_fma.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef __mips_hard_float
-# include <sysdeps/ieee754/dbl-64/s_fma.c>
-#else
-# include <soft-fp/fmadf4.c>
-#endif
diff --git a/sysdeps/mips/ieee754/s_fmaf.c b/sysdeps/mips/ieee754/s_fmaf.c
deleted file mode 100644
index 30bcdae620..0000000000
--- a/sysdeps/mips/ieee754/s_fmaf.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef __mips_hard_float
-# include <sysdeps/ieee754/dbl-64/s_fmaf.c>
-#else
-# include <soft-fp/fmasf4.c>
-#endif
diff --git a/sysdeps/mips/ieee754/s_fmal.c b/sysdeps/mips/ieee754/s_fmal.c
index 6b83e914fe..c52331967d 100644
--- a/sysdeps/mips/ieee754/s_fmal.c
+++ b/sysdeps/mips/ieee754/s_fmal.c
@@ -4,4 +4,4 @@
# error "long double fma being compiled for o32 ABI"
#endif
-#include <soft-fp/fmatf4.c>
+#include <sysdeps/ieee754/soft-fp/s_fmal.c>
diff --git a/sysdeps/mips/include/sys/asm.h b/sysdeps/mips/include/sys/asm.h
index 7e288df117..e44df8fe0b 100644
--- a/sysdeps/mips/include/sys/asm.h
+++ b/sysdeps/mips/include/sys/asm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software 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,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/jmpbuf-unwind.h b/sysdeps/mips/jmpbuf-unwind.h
index 55a9b09056..8318c4669e 100644
--- a/sysdeps/mips/jmpbuf-unwind.h
+++ b/sysdeps/mips/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/ldbl-classify-compat.h b/sysdeps/mips/ldbl-classify-compat.h
new file mode 100644
index 0000000000..547ac7b53a
--- /dev/null
+++ b/sysdeps/mips/ldbl-classify-compat.h
@@ -0,0 +1,8 @@
+#ifndef MIPS_LDBL_CLASSIFY_COMPAT_H
+#define MIPS_LDBL_CLASSIFY_COMPAT_H 1
+
+/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
+ when built without long double support. */
+#define LDBL_CLASSIFY_COMPAT 1
+
+#endif
diff --git a/sysdeps/mips/ldsodefs.h b/sysdeps/mips/ldsodefs.h
index 7399eff32d..c6e5ce7e66 100644
--- a/sysdeps/mips/ldsodefs.h
+++ b/sysdeps/mips/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/libc-tls.c b/sysdeps/mips/libc-tls.c
index b4c91fb84b..a3d6165241 100644
--- a/sysdeps/mips/libc-tls.c
+++ b/sysdeps/mips/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. MIPS version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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/lshift.S b/sysdeps/mips/lshift.S
index 8bca5466b2..5a2d19bc8f 100644
--- a/sysdeps/mips/lshift.S
+++ b/sysdeps/mips/lshift.S
@@ -1,6 +1,6 @@
/* MIPS2 __mpn_lshift --
-Copyright (C) 1995-2016 Free Software Foundation, Inc.
+Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/mips/machine-gmon.h b/sysdeps/mips/machine-gmon.h
index 8e8efd2ebe..afc3ae5022 100644
--- a/sysdeps/mips/machine-gmon.h
+++ b/sysdeps/mips/machine-gmon.h
@@ -1,5 +1,5 @@
/* Machine-specific calling sequence for `mcount' profiling function. MIPS
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/math-tests.h b/sysdeps/mips/math-tests.h
index f41c1616b0..941d38bdf0 100644
--- a/sysdeps/mips/math-tests.h
+++ b/sysdeps/mips/math-tests.h
@@ -1,5 +1,5 @@
/* Configuration for math tests. MIPS version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,10 +19,7 @@
#include <features.h>
#include <sgidefs.h>
-/* MIPS soft float does not support exceptions and rounding modes, and
- before GCC 4.9 long double when wider than double is implemented
- using fp-bit which does not integrate with hardware exceptions and
- rounding modes. */
+/* MIPS soft float does not support exceptions and rounding modes. */
#ifdef __mips_soft_float
# define ROUNDING_TESTS_float(MODE) ((MODE) == FE_TONEAREST)
# define ROUNDING_TESTS_double(MODE) ((MODE) == FE_TONEAREST)
@@ -30,9 +27,12 @@
# define EXCEPTION_TESTS_float 0
# define EXCEPTION_TESTS_double 0
# define EXCEPTION_TESTS_long_double 0
-#elif _MIPS_SIM != _ABIO32 && !__GNUC_PREREQ (4, 9)
-# define ROUNDING_TESTS_long_double(MODE) ((MODE) == FE_TONEAREST)
-# define EXCEPTION_TESTS_long_double 0
+#endif
+
+/* NaN payload preservation when converting a signaling NaN to quiet
+ is only required in NAN2008 mode. */
+#ifndef __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..01ae8b18fd 100644
--- a/sysdeps/mips/math_private.h
+++ b/sysdeps/mips/math_private.h
@@ -1,5 +1,5 @@
/* Internal math stuff. MIPS version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,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
@@ -248,10 +240,6 @@ libc_feholdsetround_mips_ctx (struct rm_ctx *ctx, int round)
#endif
-/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
- when built without long double support. */
-#define LDBL_CLASSIFY_COMPAT 1
-
#include_next <math_private.h>
#endif
diff --git a/sysdeps/mips/memcpy.S b/sysdeps/mips/memcpy.S
index 9b072d7420..3e9bd1d61b 100644
--- a/sysdeps/mips/memcpy.S
+++ b/sysdeps/mips/memcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -507,7 +507,7 @@ L(skip_pref):
move a2,t8
/* Here we have src and dest word-aligned but less than 64-bytes or
- * 128 bytes to go. Check for a 32(64) byte chunk and copy if if there
+ * 128 bytes to go. Check for a 32(64) byte chunk and copy if there
* is one. Otherwise jump down to L(chk1w) to handle the tail end of
* the copy.
*/
@@ -736,7 +736,7 @@ L(ua_skip_pref):
move a2,t8
/* Here we have src and dest word-aligned but less than 64-bytes or
- * 128 bytes to go. Check for a 32(64) byte chunk and copy if if there
+ * 128 bytes to go. Check for a 32(64) byte chunk and copy if there
* is one. Otherwise jump down to L(ua_chk1w) to handle the tail end of
* the copy. */
diff --git a/sysdeps/mips/memset.S b/sysdeps/mips/memset.S
index 9035b3d2f6..4145b00be0 100644
--- a/sysdeps/mips/memset.S
+++ b/sysdeps/mips/memset.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -370,7 +370,7 @@ L(skip_pref):
move a2,t8
/* Here we have dest word-aligned but less than 64-bytes or 128 bytes to go.
- Check for a 32(64) byte chunk and copy if if there is one. Otherwise
+ Check for a 32(64) byte chunk and copy if there is one. Otherwise
jump down to L(chk1w) to handle the tail end of the copy. */
L(chkw):
andi t8,a2,NSIZEMASK /* is there a 32-byte/64-byte chunk. */
diff --git a/sysdeps/mips/memusage.h b/sysdeps/mips/memusage.h
index dd1692f961..597a31e0a9 100644
--- a/sysdeps/mips/memusage.h
+++ b/sysdeps/mips/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/mips32/crti.S b/sysdeps/mips/mips32/crti.S
index 5c0ad7328a..b3e1c4e0d5 100644
--- a/sysdeps/mips/mips32/crti.S
+++ b/sysdeps/mips/mips32/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for MIPS (o32).
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,6 +40,12 @@
#include <libc-symbols.h>
+#ifdef __mips_micromips
+# define JALR_RELOC R_MICROMIPS_JALR
+#else
+# define JALR_RELOC R_MIPS_JALR
+#endif
+
#ifndef PREINIT_FUNCTION
# define PREINIT_FUNCTION __gmon_start__
#endif
@@ -59,6 +65,7 @@
.section .init,"ax",@progbits
.p2align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
.set noreorder
@@ -71,18 +78,20 @@ _init:
lw $2,%got(PREINIT_FUNCTION)($28)
beq $2,$0,.Lno_weak_fn
lw $25,%call16(PREINIT_FUNCTION)($28)
- .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+ .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
1: jalr $25
.Lno_weak_fn:
+ .insn
#else
lw $25,%got(PREINIT_FUNCTION)($28)
- .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+ .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
1: jalr $25
#endif
.section .fini,"ax",@progbits
.p2align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
.set noreorder
diff --git a/sysdeps/mips/mips32/crtn.S b/sysdeps/mips/mips32/crtn.S
index a2f97c85e1..84efcb1938 100644
--- a/sysdeps/mips/mips32/crtn.S
+++ b/sysdeps/mips/mips32/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for MIPS (o32).
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h b/sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h
index b9f4aea488..1afc7f65a6 100644
--- a/sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h
+++ b/sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h
@@ -1,5 +1,5 @@
/* Fix for conversion of floating point to integer overflow. MIPS version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/mips32/fpu/fpucw-helpers.c b/sysdeps/mips/mips32/fpu/fpucw-helpers.c
index 2af39e969e..c52d55460e 100644
--- a/sysdeps/mips/mips32/fpu/fpucw-helpers.c
+++ b/sysdeps/mips/mips32/fpu/fpucw-helpers.c
@@ -1,5 +1,5 @@
/* FPU control word handling, MIPS version, needed by MIPS16 callers.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/mips32/libm-test-ulps b/sysdeps/mips/mips32/libm-test-ulps
index aa3d696863..e62cca3e03 100644
--- a/sysdeps/mips/mips32/libm-test-ulps
+++ b/sysdeps/mips/mips32/libm-test-ulps
@@ -184,15 +184,15 @@ idouble: 1
ifloat: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: Imaginary part of "cacos_downward":
@@ -202,9 +202,9 @@ idouble: 5
ifloat: 3
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: Imaginary part of "cacos_towardzero":
@@ -220,15 +220,15 @@ idouble: 2
ifloat: 2
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Imaginary part of "cacosh":
@@ -244,10 +244,10 @@ idouble: 5
ifloat: 3
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: Real part of "cacosh_towardzero":
double: 5
@@ -256,9 +256,9 @@ idouble: 5
ifloat: 3
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: Real part of "cacosh_upward":
@@ -268,9 +268,9 @@ idouble: 4
ifloat: 4
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: "carg":
@@ -302,16 +302,16 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "casin_downward":
double: 5
@@ -332,21 +332,21 @@ idouble: 5
ifloat: 3
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Imaginary part of "casinh":
@@ -363,9 +363,9 @@ ifloat: 3
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
Function: Real part of "casinh_towardzero":
double: 5
@@ -380,19 +380,21 @@ idouble: 3
ifloat: 1
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Imaginary part of "catan":
@@ -403,9 +405,9 @@ ifloat: 1
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "catan_downward":
double: 2
@@ -415,18 +417,20 @@ ifloat: 2
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Real part of "catan_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Imaginary part of "catan_upward":
@@ -442,7 +446,9 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Real part of "catanh_downward":
@@ -459,9 +465,9 @@ ifloat: 2
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "catanh_towardzero":
double: 1
@@ -471,12 +477,14 @@ ifloat: 2
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
idouble: 4
-ifloat: 3
+ifloat: 4
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "cbrt":
@@ -671,9 +679,9 @@ ifloat: 2
Function: Real part of "clog10_downward":
double: 5
-float: 4
+float: 5
idouble: 5
-ifloat: 4
+ifloat: 5
Function: Imaginary part of "clog10_downward":
double: 2
@@ -742,7 +750,9 @@ idouble: 1
ifloat: 2
Function: "cos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "cos_downward":
@@ -789,9 +799,9 @@ ifloat: 2
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
Function: Imaginary part of "cpow":
float: 2
@@ -977,9 +987,9 @@ ifloat: 1
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Real part of "ctan_downward":
double: 6
@@ -989,9 +999,9 @@ ifloat: 5
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Real part of "ctan_towardzero":
double: 5
@@ -1007,9 +1017,9 @@ ifloat: 2
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
Function: Imaginary part of "ctan_upward":
double: 2
@@ -1019,9 +1029,9 @@ ifloat: 3
Function: Real part of "ctanh":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "ctanh":
double: 2
@@ -1031,9 +1041,9 @@ ifloat: 2
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
idouble: 4
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "ctanh_downward":
double: 6
@@ -1165,15 +1175,21 @@ ifloat: 1
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "expm1":
double: 1
@@ -1247,9 +1263,9 @@ ifloat: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
Function: "j0_towardzero":
double: 3
@@ -1271,9 +1287,9 @@ ifloat: 2
Function: "j1_downward":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
Function: "j1_towardzero":
double: 3
@@ -1426,29 +1442,9 @@ idouble: 1
ifloat: 2
Function: "pow":
+double: 1
float: 1
-ifloat: 1
-
-Function: "pow10":
-double: 2
-idouble: 2
-
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
+idouble: 1
ifloat: 1
Function: "pow_downward":
@@ -1470,7 +1466,9 @@ idouble: 1
ifloat: 1
Function: "sin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "sin_downward":
@@ -1492,7 +1490,9 @@ idouble: 1
ifloat: 2
Function: "sincos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "sincos_downward":
@@ -1615,9 +1615,9 @@ ifloat: 1
Function: "y0_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
Function: "y0_towardzero":
double: 3
@@ -1627,9 +1627,9 @@ ifloat: 3
Function: "y0_upward":
double: 3
-float: 4
+float: 5
idouble: 3
-ifloat: 4
+ifloat: 5
Function: "y1":
double: 3
@@ -1657,15 +1657,15 @@ ifloat: 2
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
Function: "yn_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
Function: "yn_towardzero":
double: 3
@@ -1675,8 +1675,8 @@ ifloat: 3
Function: "yn_upward":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
# end of automatic generation
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/mips32/nofpu/Implies b/sysdeps/mips/mips32/nofpu/Implies
new file mode 100644
index 0000000000..abcbadb25f
--- /dev/null
+++ b/sysdeps/mips/mips32/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/mips/mips32/sfp-machine.h b/sysdeps/mips/mips32/sfp-machine.h
index 4e23aa8b26..5215655029 100644
--- a/sysdeps/mips/mips32/sfp-machine.h
+++ b/sysdeps/mips/mips32/sfp-machine.h
@@ -41,9 +41,20 @@
# define _FP_QNANNEGATEDP 1
#endif
+#ifdef __mips_nan2008
+/* NaN payloads should be preserved for NAN2008. */
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc (R, X); \
+ R##_c = FP_CLS_NAN; \
+ } \
+ while (0)
+#else
/* From my experiments it seems X is chosen unless one of the
NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
do { \
if ((_FP_FRAC_HIGH_RAW_##fs(X) | \
_FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \
@@ -58,6 +69,7 @@
} \
R##_c = FP_CLS_NAN; \
} while (0)
+#endif
#define FP_EX_INVALID (1 << 4)
#define FP_EX_DIVZERO (1 << 3)
diff --git a/sysdeps/mips/mips64/__longjmp.c b/sysdeps/mips/mips64/__longjmp.c
index 147e979232..e5d413280c 100644
--- a/sysdeps/mips/mips64/__longjmp.c
+++ b/sysdeps/mips/mips64/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
diff --git a/sysdeps/mips/mips64/add_n.S b/sysdeps/mips/mips64/add_n.S
index 056aee7e76..46d6f77162 100644
--- a/sysdeps/mips/mips64/add_n.S
+++ b/sysdeps/mips/mips64/add_n.S
@@ -1,7 +1,7 @@
/* MIPS3 __mpn_add_n -- Add two limb vectors of the same length > 0 and
* store sum in a third limb vector.
*
- * Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ * Copyright (C) 1995-2018 Free Software Foundation, Inc.
*
* This file is part of the GNU MP Library.
*
diff --git a/sysdeps/mips/mips64/addmul_1.S b/sysdeps/mips/mips64/addmul_1.S
index d7fe56bcde..dae3a74438 100644
--- a/sysdeps/mips/mips64/addmul_1.S
+++ b/sysdeps/mips/mips64/addmul_1.S
@@ -1,7 +1,7 @@
/* MIPS3 __mpn_addmul_1 -- Multiply a limb vector with a single limb and
* add the product to a second limb vector.
*
- * Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ * Copyright (C) 1992-2018 Free Software Foundation, Inc.
*
* This file is part of the GNU MP Library.
*
diff --git a/sysdeps/mips/mips64/bsd-_setjmp.S b/sysdeps/mips/mips64/bsd-_setjmp.S
index cd2ae472eb..f58ee38d1f 100644
--- a/sysdeps/mips/mips64/bsd-_setjmp.S
+++ b/sysdeps/mips/mips64/bsd-_setjmp.S
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS64 version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/mips64/bsd-setjmp.S b/sysdeps/mips/mips64/bsd-setjmp.S
index 8b094a30ea..1f084daf3c 100644
--- a/sysdeps/mips/mips64/bsd-setjmp.S
+++ b/sysdeps/mips/mips64/bsd-setjmp.S
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS64 version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/mips64/e_sqrtl.c b/sysdeps/mips/mips64/e_sqrtl.c
index 4453ac8ee0..6e3352962f 100644
--- a/sysdeps/mips/mips64/e_sqrtl.c
+++ b/sysdeps/mips/mips64/e_sqrtl.c
@@ -1,5 +1,5 @@
/* long double square root in software floating-point emulation.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/mips/mips64/gmp-mparam.h b/sysdeps/mips/mips64/gmp-mparam.h
index 1e76391a60..9874aaefe3 100644
--- a/sysdeps/mips/mips64/gmp-mparam.h
+++ b/sysdeps/mips/mips64/gmp-mparam.h
@@ -1,6 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright (C) 1991-2016 Free Software Foundation, Inc.
+Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/mips/mips64/libm-test-ulps b/sysdeps/mips/mips64/libm-test-ulps
index 5bf6f3e65b..82b15be5af 100644
--- a/sysdeps/mips/mips64/libm-test-ulps
+++ b/sysdeps/mips/mips64/libm-test-ulps
@@ -250,36 +250,36 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "cacos_downward":
double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "cacos_towardzero":
double: 5
@@ -298,17 +298,17 @@ ildouble: 3
ldouble: 3
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -330,12 +330,12 @@ ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-ildouble: 2
-ldouble: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
Function: Real part of "cacosh_towardzero":
double: 5
@@ -346,28 +346,28 @@ ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Real part of "cacosh_upward":
double: 4
float: 4
idouble: 4
ifloat: 4
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
Function: "carg":
float: 1
@@ -408,18 +408,18 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -428,8 +428,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "casin_towardzero":
double: 3
@@ -448,25 +448,25 @@ ildouble: 5
ldouble: 5
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -484,14 +484,14 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -512,23 +512,25 @@ ildouble: 3
ldouble: 3
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
ildouble: 3
ldouble: 3
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -543,9 +545,9 @@ ldouble: 1
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -554,30 +556,32 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 2
+ldouble: 2
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
+ifloat: 2
+ildouble: 2
+ldouble: 2
Function: Real part of "catan_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catan_upward":
double: 3
@@ -596,7 +600,9 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -606,8 +612,8 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catanh_downward":
double: 1
@@ -619,11 +625,11 @@ ldouble: 2
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
+ifloat: 2
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catanh_towardzero":
double: 1
@@ -635,17 +641,19 @@ ldouble: 2
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
idouble: 4
-ifloat: 3
+ifloat: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "cbrt":
double: 3
@@ -903,9 +911,9 @@ ldouble: 2
Function: Real part of "clog10_downward":
double: 5
-float: 4
+float: 5
idouble: 5
-ifloat: 4
+ifloat: 5
ildouble: 3
ldouble: 3
@@ -998,7 +1006,9 @@ ildouble: 2
ldouble: 2
Function: "cos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -1061,9 +1071,9 @@ ldouble: 3
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
ildouble: 4
ldouble: 4
@@ -1317,9 +1327,9 @@ ldouble: 3
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -1333,9 +1343,9 @@ ldouble: 4
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1357,9 +1367,9 @@ ldouble: 5
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 5
ldouble: 5
@@ -1373,9 +1383,9 @@ ldouble: 5
Function: Real part of "ctanh":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -1389,9 +1399,9 @@ ldouble: 3
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
idouble: 4
-ifloat: 1
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1569,15 +1579,21 @@ ldouble: 2
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "expm1":
double: 1
@@ -1677,9 +1693,9 @@ ldouble: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 4
ldouble: 4
@@ -1709,9 +1725,9 @@ ldouble: 4
Function: "j1_downward":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 4
ldouble: 4
@@ -1918,41 +1934,13 @@ ildouble: 1
ldouble: 1
Function: "pow":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 2
ldouble: 2
-Function: "pow10":
-double: 2
-idouble: 2
-ildouble: 2
-ldouble: 2
-
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
Function: "pow_downward":
double: 1
float: 1
@@ -1978,7 +1966,9 @@ ildouble: 2
ldouble: 2
Function: "sin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2008,7 +1998,9 @@ ildouble: 3
ldouble: 3
Function: "sincos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2173,9 +2165,9 @@ ldouble: 3
Function: "y0_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 4
ldouble: 4
@@ -2189,9 +2181,9 @@ ldouble: 3
Function: "y0_upward":
double: 3
-float: 4
+float: 5
idouble: 3
-ifloat: 4
+ifloat: 5
ildouble: 3
ldouble: 3
@@ -2229,17 +2221,17 @@ ldouble: 5
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 5
ldouble: 5
Function: "yn_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 5
ldouble: 5
@@ -2253,9 +2245,9 @@ ldouble: 5
Function: "yn_upward":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
ildouble: 5
ldouble: 5
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/mips/mips64/lshift.S b/sysdeps/mips/mips64/lshift.S
index fdd5b31fe7..73b1cfb8e7 100644
--- a/sysdeps/mips/mips64/lshift.S
+++ b/sysdeps/mips/mips64/lshift.S
@@ -1,6 +1,6 @@
/* MIPS3 __mpn_lshift --
*
- * Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ * Copyright (C) 1995-2018 Free Software Foundation, Inc.
*
* This file is part of the GNU MP Library.
*
diff --git a/sysdeps/mips/mips64/mul_1.S b/sysdeps/mips/mips64/mul_1.S
index eccd146033..8707257a68 100644
--- a/sysdeps/mips/mips64/mul_1.S
+++ b/sysdeps/mips/mips64/mul_1.S
@@ -1,7 +1,7 @@
/* MIPS3 __mpn_mul_1 -- Multiply a limb vector with a single limb and
* store the product in a second limb vector.
*
- * Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ * Copyright (C) 1992-2018 Free Software Foundation, Inc.
*
* This file is part of the GNU MP Library.
*
diff --git a/sysdeps/mips/mips64/n32/crti.S b/sysdeps/mips/mips64/n32/crti.S
index 00b89f3894..59a09d5763 100644
--- a/sysdeps/mips/mips64/n32/crti.S
+++ b/sysdeps/mips/mips64/n32/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for MIPS (n32).
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,6 +40,12 @@
#include <libc-symbols.h>
+#ifdef __mips_micromips
+# define JALR_RELOC R_MICROMIPS_JALR
+#else
+# define JALR_RELOC R_MIPS_JALR
+#endif
+
#ifndef PREINIT_FUNCTION
# define PREINIT_FUNCTION __gmon_start__
#endif
@@ -59,6 +65,7 @@
.section .init,"ax",@progbits
.p2align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
addiu $sp,$sp,-16
@@ -71,18 +78,20 @@ _init:
lw $2,%got_disp(PREINIT_FUNCTION)($28)
beq $2,$0,.Lno_weak_fn
lw $25,%call16(PREINIT_FUNCTION)($28)
- .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+ .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
1: jalr $25
.Lno_weak_fn:
+ .insn
#else
lw $25,%got_disp(PREINIT_FUNCTION)($28)
- .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+ .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
1: jalr $25
#endif
.section .fini,"ax",@progbits
.p2align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
addiu $sp,$sp,-16
diff --git a/sysdeps/mips/mips64/n32/crtn.S b/sysdeps/mips/mips64/n32/crtn.S
index d4e6b685dd..6fa7630d0c 100644
--- a/sysdeps/mips/mips64/n32/crtn.S
+++ b/sysdeps/mips/mips64/n32/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for MIPS (n32).
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/mips64/n32/fpu/s_fma.c b/sysdeps/mips/mips64/n32/fpu/s_fma.c
new file mode 100644
index 0000000000..b61fa643de
--- /dev/null
+++ b/sysdeps/mips/mips64/n32/fpu/s_fma.c
@@ -0,0 +1 @@
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/sysdeps/mips/mips64/n32/nofpu/Implies b/sysdeps/mips/mips64/n32/nofpu/Implies
new file mode 100644
index 0000000000..abcbadb25f
--- /dev/null
+++ b/sysdeps/mips/mips64/n32/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/mips/mips64/n64/crti.S b/sysdeps/mips/mips64/n64/crti.S
index f59b20c631..fd468f0467 100644
--- a/sysdeps/mips/mips64/n64/crti.S
+++ b/sysdeps/mips/mips64/n64/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for MIPS (n64).
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,6 +40,12 @@
#include <libc-symbols.h>
+#ifdef __mips_micromips
+# define JALR_RELOC R_MICROMIPS_JALR
+#else
+# define JALR_RELOC R_MIPS_JALR
+#endif
+
#ifndef PREINIT_FUNCTION
# define PREINIT_FUNCTION __gmon_start__
#endif
@@ -59,6 +65,7 @@
.section .init,"ax",@progbits
.p2align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
daddiu $sp,$sp,-16
@@ -71,18 +78,20 @@ _init:
ld $2,%got_disp(PREINIT_FUNCTION)($28)
beq $2,$0,.Lno_weak_fn
ld $25,%call16(PREINIT_FUNCTION)($28)
- .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+ .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
1: jalr $25
.Lno_weak_fn:
+ .insn
#else
ld $25,%got_disp(PREINIT_FUNCTION)($28)
- .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+ .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
1: jalr $25
#endif
.section .fini,"ax",@progbits
.p2align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
daddiu $sp,$sp,-16
diff --git a/sysdeps/mips/mips64/n64/crtn.S b/sysdeps/mips/mips64/n64/crtn.S
index 98649008a3..13f72c754c 100644
--- a/sysdeps/mips/mips64/n64/crtn.S
+++ b/sysdeps/mips/mips64/n64/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for MIPS (n64).
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/mips64/n64/fpu/s_fma.c b/sysdeps/mips/mips64/n64/fpu/s_fma.c
new file mode 100644
index 0000000000..b61fa643de
--- /dev/null
+++ b/sysdeps/mips/mips64/n64/fpu/s_fma.c
@@ -0,0 +1 @@
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/sysdeps/mips/mips64/n64/nofpu/Implies b/sysdeps/mips/mips64/n64/nofpu/Implies
new file mode 100644
index 0000000000..abcbadb25f
--- /dev/null
+++ b/sysdeps/mips/mips64/n64/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/mips/mips64/rshift.S b/sysdeps/mips/mips64/rshift.S
index ade44fec65..22eede3b78 100644
--- a/sysdeps/mips/mips64/rshift.S
+++ b/sysdeps/mips/mips64/rshift.S
@@ -1,6 +1,6 @@
/* MIPS3 __mpn_rshift --
*
- * Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ * Copyright (C) 1995-2018 Free Software Foundation, Inc.
*
* This file is part of the GNU MP Library.
*
diff --git a/sysdeps/mips/mips64/setjmp.S b/sysdeps/mips/mips64/setjmp.S
index e72eaa71fd..ea30bd8efa 100644
--- a/sysdeps/mips/mips64/setjmp.S
+++ b/sysdeps/mips/mips64/setjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -42,3 +42,4 @@ ENTRY (__sigsetjmp)
#endif
jr t9
END (__sigsetjmp)
+hidden_def (__sigsetjmp)
diff --git a/sysdeps/mips/mips64/setjmp_aux.c b/sysdeps/mips/mips64/setjmp_aux.c
index d924c97ce3..5354d40f38 100644
--- a/sysdeps/mips/mips64/setjmp_aux.c
+++ b/sysdeps/mips/mips64/setjmp_aux.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
@@ -24,7 +24,12 @@
pointer. We do things this way because it's difficult to reliably
access them in C. */
+/* Stack protection is disabled to avoid changing s0 (or any other
+ caller-save register) before storing it to environment.
+ See BZ #22624. */
+
int
+inhibit_stack_protector
__sigsetjmp_aux (jmp_buf env, int savemask, long long sp, long long fp,
long long gp)
{
diff --git a/sysdeps/mips/mips64/sfp-machine.h b/sysdeps/mips/mips64/sfp-machine.h
index 708afc783e..35cc4ddeb1 100644
--- a/sysdeps/mips/mips64/sfp-machine.h
+++ b/sysdeps/mips/mips64/sfp-machine.h
@@ -44,9 +44,20 @@
# define _FP_QNANNEGATEDP 1
#endif
+#ifdef __mips_nan2008
+/* NaN payloads should be preserved for NAN2008. */
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc (R, X); \
+ R##_c = FP_CLS_NAN; \
+ } \
+ while (0)
+#else
/* From my experiments it seems X is chosen unless one of the
NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
do { \
if ((_FP_FRAC_HIGH_RAW_##fs(X) | \
_FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \
@@ -61,6 +72,7 @@
} \
R##_c = FP_CLS_NAN; \
} while (0)
+#endif
#define _FP_DECL_EX fpu_control_t _fcw
diff --git a/sysdeps/mips/mips64/sub_n.S b/sysdeps/mips/mips64/sub_n.S
index 4b3cce4037..6cc09a7771 100644
--- a/sysdeps/mips/mips64/sub_n.S
+++ b/sysdeps/mips/mips64/sub_n.S
@@ -1,7 +1,7 @@
/* MIPS3 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
* store difference in a third limb vector.
*
- * Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ * Copyright (C) 1995-2018 Free Software Foundation, Inc.
*
* This file is part of the GNU MP Library.
*
diff --git a/sysdeps/mips/mips64/submul_1.S b/sysdeps/mips/mips64/submul_1.S
index 40cf6fb482..fb9a1c2375 100644
--- a/sysdeps/mips/mips64/submul_1.S
+++ b/sysdeps/mips/mips64/submul_1.S
@@ -1,7 +1,7 @@
/* MIPS3 __mpn_submul_1 -- Multiply a limb vector with a single limb and
* subtract the product from a second limb vector.
*
- * Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ * Copyright (C) 1992-2018 Free Software Foundation, Inc.
*
* This file is part of the GNU MP Library.
*
diff --git a/sysdeps/mips/mul_1.S b/sysdeps/mips/mul_1.S
index 770f7786d1..02d9d5152f 100644
--- a/sysdeps/mips/mul_1.S
+++ b/sysdeps/mips/mul_1.S
@@ -1,7 +1,7 @@
/* MIPS __mpn_mul_1 -- Multiply a limb vector with a single limb and
store the product in a second limb vector.
-Copyright (C) 1995-2016 Free Software Foundation, Inc.
+Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/mips/nan-high-order-bit.h b/sysdeps/mips/nan-high-order-bit.h
new file mode 100644
index 0000000000..0500605d01
--- /dev/null
+++ b/sysdeps/mips/nan-high-order-bit.h
@@ -0,0 +1,32 @@
+/* Specify NaN high-order bit conventions. MIPS version.
+ Copyright (C) 2016-2018 Free Software 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
+
+#ifdef __mips_nan2008
+/* MIPS aligned to IEEE 754-2008. */
+# define HIGH_ORDER_BIT_IS_SET_FOR_SNAN 0
+#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 1
+#endif
+
+#endif /* nan-high-order-bit.h */
diff --git a/sysdeps/mips/nptl/Makefile b/sysdeps/mips/nptl/Makefile
index 117744ffe2..280fc5691d 100644
--- a/sysdeps/mips/nptl/Makefile
+++ b/sysdeps/mips/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# Copyright (C) 2005-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
# The GNU C Library is free software; you can redistribute it and/or
@@ -21,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-arch.h b/sysdeps/mips/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..f9e7d18a8b
--- /dev/null
+++ b/sysdeps/mips/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,89 @@
+/* Machine-specific pthread type layouts. MIPS version.
+ Copyright (C) 2005-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <endian.h>
+
+#if _MIPS_SIM == _ABI64
+# define __SIZEOF_PTHREAD_ATTR_T 56
+# define __SIZEOF_PTHREAD_MUTEX_T 40
+# define __SIZEOF_PTHREAD_RWLOCK_T 56
+# define __SIZEOF_PTHREAD_BARRIER_T 32
+#else
+# define __SIZEOF_PTHREAD_ATTR_T 36
+# define __SIZEOF_PTHREAD_MUTEX_T 24
+# define __SIZEOF_PTHREAD_RWLOCK_T 32
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+#endif
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Data structure for mutex handling. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND (_MIPS_SIM != _ABI64)
+#define __PTHREAD_MUTEX_USE_UNION (_MIPS_SIM != _ABI64)
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+#if _MIPS_SIM == _ABI64
+ int __cur_writer;
+ int __shared;
+ unsigned long int __pad1;
+ unsigned long int __pad2;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned int __flags;
+# else
+# if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+# else
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ unsigned char __shared;
+ unsigned char __pad1;
+ unsigned char __pad2;
+# endif
+ int __cur_writer;
+#endif
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/mips/nptl/bits/pthreadtypes.h b/sysdeps/mips/nptl/bits/pthreadtypes.h
deleted file mode 100644
index 68ed94b145..0000000000
--- a/sysdeps/mips/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/* Machine-specific pthread type layouts. MIPS version.
- Copyright (C) 2005-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 _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <endian.h>
-
-#if _MIPS_SIM == _ABI64
-# define __SIZEOF_PTHREAD_ATTR_T 56
-# define __SIZEOF_PTHREAD_MUTEX_T 40
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 56
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 32
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#else
-# define __SIZEOF_PTHREAD_ATTR_T 36
-# define __SIZEOF_PTHREAD_MUTEX_T 24
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 32
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 20
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#endif
-
-
-/* Thread identifiers. The structure of the attribute type is
- deliberately not exposed. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-#if _MIPS_SIM == _ABI64
-typedef struct __pthread_internal_list
-{
- struct __pthread_internal_list *__prev;
- struct __pthread_internal_list *__next;
-} __pthread_list_t;
-#else
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-#endif
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is deliberately not exposed. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
-#if _MIPS_SIM == _ABI64
- unsigned int __nusers;
-#endif
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
-#if _MIPS_SIM == _ABI64
- int __spins;
- __pthread_list_t __list;
-# define __PTHREAD_MUTEX_HAVE_PREV 1
-#else
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
-#endif
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is deliberately not exposed. */
-typedef union
-{
-# if _MIPS_SIM == _ABI64
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- int __writer;
- int __shared;
- unsigned long int __pad1;
- unsigned long int __pad2;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned int __flags;
- } __data;
-# else
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
-#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned char __pad1;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
-#else
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- unsigned char __shared;
- unsigned char __pad1;
- unsigned char __pad2;
-#endif
- int __writer;
- } __data;
-# endif
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/mips/nptl/bits/semaphore.h b/sysdeps/mips/nptl/bits/semaphore.h
index 93c61cccdc..e78d075e5a 100644
--- a/sysdeps/mips/nptl/bits/semaphore.h
+++ b/sysdeps/mips/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/nptl/pthread-offsets.h b/sysdeps/mips/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..0ac3eda3fb
--- /dev/null
+++ b/sysdeps/mips/nptl/pthread-offsets.h
@@ -0,0 +1,13 @@
+#if _MIPS_SIM == _ABI64
+# define __PTHREAD_MUTEX_NUSERS_OFFSET 12
+# define __PTHREAD_MUTEX_KIND_OFFSET 16
+# define __PTHREAD_MUTEX_SPINS_OFFSET 20
+# define __PTHREAD_MUTEX_ELISION_OFFSET 22
+# define __PTHREAD_MUTEX_LIST_OFFSET 24
+#else
+# define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+# define __PTHREAD_MUTEX_KIND_OFFSET 12
+# define __PTHREAD_MUTEX_SPINS_OFFSET 20
+# define __PTHREAD_MUTEX_ELISION_OFFSET 22
+# define __PTHREAD_MUTEX_LIST_OFFSET 20
+#endif
diff --git a/sysdeps/mips/nptl/pthread_spin_lock.c b/sysdeps/mips/nptl/pthread_spin_lock.c
deleted file mode 100644
index e681f5b193..0000000000
--- a/sysdeps/mips/nptl/pthread_spin_lock.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* 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/>. */
-
-#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
-
-/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because
- it will resolve to this very file. Using "sysdeps/.." as reference to the
- top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
diff --git a/sysdeps/mips/nptl/pthreaddef.h b/sysdeps/mips/nptl/pthreaddef.h
index 271155f810..7b1283ae64 100644
--- a/sysdeps/mips/nptl/pthreaddef.h
+++ b/sysdeps/mips/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/nptl/tcb-offsets.sym b/sysdeps/mips/nptl/tcb-offsets.sym
index e0e71dc430..9ea25b94a8 100644
--- a/sysdeps/mips/nptl/tcb-offsets.sym
+++ b/sysdeps/mips/nptl/tcb-offsets.sym
@@ -7,5 +7,4 @@
#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
-PID_OFFSET thread_offsetof (pid)
TID_OFFSET thread_offsetof (tid)
diff --git a/sysdeps/mips/nptl/tls.h b/sysdeps/mips/nptl/tls.h
index 10ca878292..777432fe1a 100644
--- a/sysdeps/mips/nptl/tls.h
+++ b/sysdeps/mips/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/MIPS version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,20 +25,11 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
+# include <dl-dtv.h>
+
/* Get system call information. */
# include <sysdep.h>
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
-
#ifdef __mips16
/* MIPS16 uses GCC builtin to access the TP. */
# define READ_THREAD_POINTER() (__builtin_thread_pointer ())
@@ -168,6 +159,7 @@ typedef struct
# define NO_TLS_OFFSET -1
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/mips/preconfigure b/sysdeps/mips/preconfigure
index c118592b27..48fc32ed5b 100644
--- a/sysdeps/mips/preconfigure
+++ b/sysdeps/mips/preconfigure
@@ -25,5 +25,7 @@ mips*)
if test "$abiflag" != "_ABIO32" -a "$mips16flag" = "1"; then
as_fn_error $? "MIPS16 is only supported with the o32 ABI." "$LINENO" 5
fi
+
+ with_fp_cond="defined __mips_hard_float"
;;
esac
diff --git a/sysdeps/mips/regdef.h b/sysdeps/mips/regdef.h
index 64cffbf5b2..d55b623759 100644
--- a/sysdeps/mips/regdef.h
+++ b/sysdeps/mips/regdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ralf Baechle <ralf@gnu.org>.
diff --git a/sysdeps/mips/rshift.S b/sysdeps/mips/rshift.S
index 450c2f51d6..a80b902a7d 100644
--- a/sysdeps/mips/rshift.S
+++ b/sysdeps/mips/rshift.S
@@ -1,6 +1,6 @@
/* MIPS2 __mpn_rshift --
-Copyright (C) 1995-2016 Free Software Foundation, Inc.
+Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/mips/setjmp.S b/sysdeps/mips/setjmp.S
index 8ddbf19085..5863ffafbc 100644
--- a/sysdeps/mips/setjmp.S
+++ b/sysdeps/mips/setjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,3 +44,4 @@ ENTRY (__sigsetjmp)
j __sigsetjmp_aux
#endif
END (__sigsetjmp)
+hidden_def (__sigsetjmp)
diff --git a/sysdeps/mips/setjmp_aux.c b/sysdeps/mips/setjmp_aux.c
index 2539ee00af..ee3e63f0ad 100644
--- a/sysdeps/mips/setjmp_aux.c
+++ b/sysdeps/mips/setjmp_aux.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
@@ -23,7 +23,12 @@
pointer. We do things this way because it's difficult to reliably
access them in C. */
+/* Stack protection is disabled to avoid changing s0 (or any other
+ caller-save register) before storing it to environment.
+ See BZ #22624. */
+
int __attribute__ ((nomips16))
+inhibit_stack_protector
__sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp)
{
#ifdef __mips_hard_float
diff --git a/sysdeps/mips/sgidefs.h b/sysdeps/mips/sgidefs.h
index ea9e497e32..e3721feeec 100644
--- a/sysdeps/mips/sgidefs.h
+++ b/sysdeps/mips/sgidefs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ralf Baechle <ralf@gnu.org>.
diff --git a/sysdeps/mips/sotruss-lib.c b/sysdeps/mips/sotruss-lib.c
index ea28ec7b5b..74d01bd1fc 100644
--- a/sysdeps/mips/sotruss-lib.c
+++ b/sysdeps/mips/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for MIPS.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/stackinfo.h b/sysdeps/mips/stackinfo.h
index 882d3ad3d4..ff3b6f594c 100644
--- a/sysdeps/mips/stackinfo.h
+++ b/sysdeps/mips/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/start.S b/sysdeps/mips/start.S
index cfbc297957..a4c4ef0fae 100644
--- a/sysdeps/mips/start.S
+++ b/sysdeps/mips/start.S
@@ -1,5 +1,5 @@
/* Startup code compliant to the ELF Mips ABI.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/strcmp.S b/sysdeps/mips/strcmp.S
index f1278d267f..1afeda3c5f 100644
--- a/sysdeps/mips/strcmp.S
+++ b/sysdeps/mips/strcmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/sub_n.S b/sysdeps/mips/sub_n.S
index 2d6bad1f90..3202016c71 100644
--- a/sysdeps/mips/sub_n.S
+++ b/sysdeps/mips/sub_n.S
@@ -1,7 +1,7 @@
/* MIPS2 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
store difference in a third limb vector.
-Copyright (C) 1995-2016 Free Software Foundation, Inc.
+Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/mips/submul_1.S b/sysdeps/mips/submul_1.S
index 6acbb475fb..641cdb2df9 100644
--- a/sysdeps/mips/submul_1.S
+++ b/sysdeps/mips/submul_1.S
@@ -1,7 +1,7 @@
/* MIPS __mpn_submul_1 -- Multiply a limb vector with a single limb and
subtract the product from a second limb vector.
-Copyright (C) 1995-2016 Free Software Foundation, Inc.
+Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/mips/sys/asm.h b/sysdeps/mips/sys/asm.h
index 3373b850a1..9fabc79472 100644
--- a/sysdeps/mips/sys/asm.h
+++ b/sysdeps/mips/sys/asm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ralf Baechle <ralf@gnu.org>.
diff --git a/sysdeps/mips/sys/fpregdef.h b/sysdeps/mips/sys/fpregdef.h
index aa32f733ff..be79d9e2e6 100644
--- a/sysdeps/mips/sys/fpregdef.h
+++ b/sysdeps/mips/sys/fpregdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/sys/regdef.h b/sysdeps/mips/sys/regdef.h
index 8416d97115..35a7c7ffaf 100644
--- a/sysdeps/mips/sys/regdef.h
+++ b/sysdeps/mips/sys/regdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ralf Baechle <ralf@gnu.org>.
diff --git a/sysdeps/mips/sys/tas.h b/sysdeps/mips/sys/tas.h
index 22907ab86f..d5ed013e28 100644
--- a/sysdeps/mips/sys/tas.h
+++ b/sysdeps/mips/sys/tas.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000.
diff --git a/sysdeps/mips/sys/ucontext.h b/sysdeps/mips/sys/ucontext.h
index b3d752bc46..aaa08fdea9 100644
--- a/sysdeps/mips/sys/ucontext.h
+++ b/sysdeps/mips/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,8 +21,13 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
+
+#include <bits/types.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
#include <sgidefs.h>
-#include <signal.h>
+
/* Type for general register. */
#if _MIPS_SIM == _ABIO32
@@ -32,127 +37,140 @@ typedef __uint64_t greg_t;
#endif
/* Number of general registers. */
-#define NGREG 36
+#define __NGREG 36
+#ifdef __USE_MISC
+# define NGREG __NGREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
+#ifdef __USE_MISC
/* Number of each register is the `gregset_t' array. */
enum
{
CTX_R0 = 0,
-#define CTX_R0 CTX_R0
+# define CTX_R0 CTX_R0
CTX_AT = 1,
-#define CTX_AT CTX_AT
+# define CTX_AT CTX_AT
CTX_V0 = 2,
-#define CTX_V0 CTX_V0
+# define CTX_V0 CTX_V0
CTX_V1 = 3,
-#define CTX_V1 CTX_V1
+# define CTX_V1 CTX_V1
CTX_A0 = 4,
-#define CTX_A0 CTX_A0
+# define CTX_A0 CTX_A0
CTX_A1 = 5,
-#define CTX_A1 CTX_A1
+# define CTX_A1 CTX_A1
CTX_A2 = 6,
-#define CTX_A2 CTX_A2
+# define CTX_A2 CTX_A2
CTX_A3 = 7,
-#define CTX_A3 CTX_A3
+# define CTX_A3 CTX_A3
CTX_T0 = 8,
-#define CTX_T0 CTX_T0
+# define CTX_T0 CTX_T0
CTX_T1 = 9,
-#define CTX_T1 CTX_T1
+# define CTX_T1 CTX_T1
CTX_T2 = 10,
-#define CTX_T2 CTX_T2
+# define CTX_T2 CTX_T2
CTX_T3 = 11,
-#define CTX_T3 CTX_T3
+# define CTX_T3 CTX_T3
CTX_T4 = 12,
-#define CTX_T4 CTX_T4
+# define CTX_T4 CTX_T4
CTX_T5 = 13,
-#define CTX_T5 CTX_T5
+# define CTX_T5 CTX_T5
CTX_T6 = 14,
-#define CTX_T6 CTX_T6
+# define CTX_T6 CTX_T6
CTX_T7 = 15,
-#define CTX_T7 CTX_T7
+# define CTX_T7 CTX_T7
CTX_S0 = 16,
-#define CTX_S0 CTX_S0
+# define CTX_S0 CTX_S0
CTX_S1 = 17,
-#define CTX_S1 CTX_S1
+# define CTX_S1 CTX_S1
CTX_S2 = 18,
-#define CTX_S2 CTX_S2
+# define CTX_S2 CTX_S2
CTX_S3 = 19,
-#define CTX_S3 CTX_S3
+# define CTX_S3 CTX_S3
CTX_S4 = 20,
-#define CTX_S4 CTX_S4
+# define CTX_S4 CTX_S4
CTX_S5 = 21,
-#define CTX_S5 CTX_S5
+# define CTX_S5 CTX_S5
CTX_S6 = 22,
-#define CTX_S6 CTX_S6
+# define CTX_S6 CTX_S6
CTX_S7 = 23,
-#define CTX_S7 CTX_S7
+# define CTX_S7 CTX_S7
CTX_T8 = 24,
-#define CTX_T8 CTX_T8
+# define CTX_T8 CTX_T8
CTX_T9 = 25,
-#define CTX_T9 CTX_T9
+# define CTX_T9 CTX_T9
CTX_K0 = 26,
-#define CTX_K0 CTX_K0
+# define CTX_K0 CTX_K0
CTX_K1 = 27,
-#define CTX_K1 CTX_K1
+# define CTX_K1 CTX_K1
CTX_GP = 28,
-#define CTX_GP CTX_GP
+# define CTX_GP CTX_GP
CTX_SP = 29,
-#define CTX_SP CTX_SP
+# define CTX_SP CTX_SP
CTX_S8 = 30,
-#define CTX_S8 CTX_S8
+# define CTX_S8 CTX_S8
CTX_RA = 31,
-#define CTX_RA CTX_RA
+# define CTX_RA CTX_RA
CTX_MDLO = 32,
-#define CTX_MDLO CTX_MDLO
+# define CTX_MDLO CTX_MDLO
CTX_MDHI = 33,
-#define CTX_MDHI CTX_MDHI
+# define CTX_MDHI CTX_MDHI
CTX_CAUSE = 34,
-#define CTX_CAUSE CTX_CAUSE
+# define CTX_CAUSE CTX_CAUSE
CTX_EPC = 35,
-#define CTX_EPC CTX_EPC
+# define CTX_EPC CTX_EPC
};
+#endif
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
/* Structure to describe FPU registers. */
-typedef struct fpregset
+typedef struct
{
union
{
#if _MIPS_SIM == _ABIO32
- double fp_dregs[16];
- float fp_fregs[32];
- unsigned int fp_regs[32];
+ double __ctx(fp_dregs)[16];
+ float __ctx(fp_fregs)[32];
+ unsigned int __ctx(fp_regs)[32];
#else
- double fp_dregs[32];
- /* float fp_fregs[32]; */
- __uint64_t fp_regs[32];
+ double __ctx(fp_dregs)[32];
+ /* float __ctx(fp_fregs)[32]; */
+ __uint64_t __ctx(fp_regs)[32];
#endif
- } fp_r;
- unsigned int fp_csr;
- unsigned int fp_pad;
+ } __ctx(fp_r);
+ unsigned int __ctx(fp_csr);
+ unsigned int __ctx(fp_pad);
} fpregset_t;
/* Context to describe whole processor state. */
typedef struct
{
- gregset_t gpregs;
- fpregset_t fpregs;
+ gregset_t __ctx(gpregs);
+ fpregset_t __ctx(fpregs);
} mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
#if _MIPS_SIM == _ABIO32
- unsigned long int uc_flags;
+ unsigned long int __ctx(uc_flags);
#else
- __uint64_t uc_flags;
+ __uint64_t __ctx(uc_flags);
#endif
- struct ucontext *uc_link;
- __sigset_t uc_sigmask;
+ struct ucontext_t *uc_link;
+ sigset_t uc_sigmask;
stack_t uc_stack;
mcontext_t uc_mcontext;
- int uc_filler[48];
+ int __glibc_reserved1[48];
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/mips/tst-abi-fp32mod.c b/sysdeps/mips/tst-abi-fp32mod.c
index 860f7979b1..fe0d6503e2 100644
--- a/sysdeps/mips/tst-abi-fp32mod.c
+++ b/sysdeps/mips/tst-abi-fp32mod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/tst-abi-fp64amod.c b/sysdeps/mips/tst-abi-fp64amod.c
index 8b336cec5a..3f1e3827a5 100644
--- a/sysdeps/mips/tst-abi-fp64amod.c
+++ b/sysdeps/mips/tst-abi-fp64amod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/tst-abi-fp64mod.c b/sysdeps/mips/tst-abi-fp64mod.c
index 9ef89f2446..bdb46e4e7d 100644
--- a/sysdeps/mips/tst-abi-fp64mod.c
+++ b/sysdeps/mips/tst-abi-fp64mod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/tst-abi-fpxxmod.c b/sysdeps/mips/tst-abi-fpxxmod.c
index 1ecaa22da6..81b95da80e 100644
--- a/sysdeps/mips/tst-abi-fpxxmod.c
+++ b/sysdeps/mips/tst-abi-fpxxmod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/tst-abi-fpxxomod.c b/sysdeps/mips/tst-abi-fpxxomod.c
index 1fe40fa3b1..d26966095c 100644
--- a/sysdeps/mips/tst-abi-fpxxomod.c
+++ b/sysdeps/mips/tst-abi-fpxxomod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/tst-abi-interlink.c b/sysdeps/mips/tst-abi-interlink.c
index 125f98ffeb..7407e2564d 100644
--- a/sysdeps/mips/tst-abi-interlink.c
+++ b/sysdeps/mips/tst-abi-interlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/mips/tst-audit.h b/sysdeps/mips/tst-audit.h
index a24bf75f02..02adb0902c 100644
--- a/sysdeps/mips/tst-audit.h
+++ b/sysdeps/mips/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. ARM version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/mips/tst-mode-switch-1.c b/sysdeps/mips/tst-mode-switch-1.c
index 1a26e4c7b5..aa73c82b22 100644
--- a/sysdeps/mips/tst-mode-switch-1.c
+++ b/sysdeps/mips/tst-mode-switch-1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -71,8 +71,8 @@ thread_function (void * arg __attribute__ ((unused)))
return NULL;
}
-int
-main (void)
+static int
+do_test (void)
{
int count = sysconf (_SC_NPROCESSORS_ONLN);
if (count <= 0)
@@ -121,3 +121,6 @@ main (void)
return result;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../../test-skeleton.c"
diff --git a/sysdeps/mips/tst-mode-switch-2.c b/sysdeps/mips/tst-mode-switch-2.c
index b41acf45d3..2f63e7ff8e 100644
--- a/sysdeps/mips/tst-mode-switch-2.c
+++ b/sysdeps/mips/tst-mode-switch-2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -77,8 +77,8 @@ thread_function (void * arg __attribute__ ((unused)))
return NULL;
}
-int
-main (void)
+static int
+do_test (void)
{
int count = sysconf (_SC_NPROCESSORS_ONLN);
if (count <= 0)
@@ -161,3 +161,6 @@ main (void)
return result;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../../test-skeleton.c"
diff --git a/sysdeps/mips/tst-mode-switch-3.c b/sysdeps/mips/tst-mode-switch-3.c
index 65e2b5eebd..f9ba8b2603 100644
--- a/sysdeps/mips/tst-mode-switch-3.c
+++ b/sysdeps/mips/tst-mode-switch-3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -43,8 +43,8 @@ static jmp_buf env;
float check1 = 2.0;
double check2 = 3.0;
-int
-main (void)
+static int
+do_test (void)
{
int i;
int result = 0;
@@ -88,3 +88,6 @@ main (void)
return result;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../../test-skeleton.c"
diff --git a/sysdeps/nacl/Implies b/sysdeps/nacl/Implies
deleted file mode 100644
index 0448f3f018..0000000000
--- a/sysdeps/nacl/Implies
+++ /dev/null
@@ -1,3 +0,0 @@
-nptl
-posix
-gnu
diff --git a/sysdeps/nacl/Makefile b/sysdeps/nacl/Makefile
deleted file mode 100644
index 71a4f8fa4b..0000000000
--- a/sysdeps/nacl/Makefile
+++ /dev/null
@@ -1,144 +0,0 @@
-# Makefile fragment for NaCl configurations.
-
-# Copyright (C) 2015-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/>.
-
-# The libthread_db code does not compile for NaCl because there is no
-# sys/procfs.h supplying the register layout types. But since libthread_db
-# will probably never be useful for NaCl, just elide the directory rather
-# than implementing stuff to make it compile (and never get used).
-subdirs := $(filter-out nptl_db,$(subdirs))
-sorted-subdirs := $(filter-out nptl_db,$(sorted-subdirs))
-
-# The (required) --with-headers option to configure sets sysheaders to the
-# location of the native_client/.. source directory. We'll get necessary
-# headers directly from there.
-naclsrc = $(sysheaders)/native_client/src
-
-# How to find the directory containing this Makefile.
-nacl = $(..)sysdeps/nacl
-
-# Generate our bits/errno.h with the numbers from NaCl's sys/errno.h file.
-nacl-errno = $(naclsrc)/trusted/service_runtime/include/sys/errno.h
-
-bits-errno = $(common-objpfx)bits/errno.h
-$(bits-errno): $(common-objpfx)stamp-errnos ;
-$(common-objpfx)stamp-errnos: $(nacl)/errnos.awk $(..)manual/errno.texi \
- $(nacl-errno)
- $(make-target-directory)
- $(AWK) -f $^ > $(bits-errno)-tmp
-# Make it unwritable so noone will edit it by mistake.
- -chmod a-w $(bits-errno)-tmp
- $(move-if-change) $(bits-errno)-tmp $(bits-errno)
- touch $@
-common-generated += stamp-errnos bits/errno.h
-before-compile += $(bits-errno)
-
-# Massage NaCl's irt.h (and irt_dev.h) into something we can use.
-# See irt.sed for details.
-nacl-irt.h = $(common-objpfx)nacl-irt.h
-$(nacl-irt.h): $(nacl)/irt.sed \
- $(naclsrc)/untrusted/irt/irt.h \
- $(naclsrc)/untrusted/irt/irt_dev.h
- sed -f $^ > $@.new
- mv -f $@.new $@
-common-generated += nacl-irt.h
-before-compile += $(nacl-irt.h)
-
-$(common-objpfx)nacl-interfaces.v.i: $(nacl)/nacl-interfaces.mk.in \
- $(nacl)/nacl-interface-list.h
--include $(common-objpfx)nacl-interfaces.v
-common-generated += nacl-interfaces.v
-before-compile += $(common-objpfx)nacl-interfaces.v
-
-nacl-all-interfaces = $(nacl-mandatory-interfaces) $(nacl-optional-interfaces)
-nacl-interface-routines = $(nacl-all-interfaces:%=nacl-interface-%)
-
-define nacl-interface-table-command
-(echo '#define INTERFACE_CATEGORY $1'; \
- echo '#define INTERFACE_MODULE $(firstword $(subst -, ,$*))'; \
- echo '#define INTERFACE_TYPE $(word 2,$(subst -, ,$*))'; \
- echo '#define INTERFACE_STRING $(nacl-$*-string)'; \
- echo '#include "nacl-interface-table.c"' \
-) > $@T
-mv -f $@T $@
-endef
-
-nacl-interface-pattern = $(objpfx)nacl-interface-%.c
-
-$(nacl-mandatory-interfaces:%=$(nacl-interface-pattern)): \
- $(nacl-interface-pattern): $(nacl)/Makefile $(common-objpfx)nacl-interfaces.v
- $(make-target-directory)
- $(call nacl-interface-table-command,mandatory)
-$(nacl-optional-interfaces:%=$(nacl-interface-pattern)): \
- $(nacl-interface-pattern): $(nacl)/Makefile $(common-objpfx)nacl-interfaces.v
- $(make-target-directory)
- $(call nacl-interface-table-command,optional)
-
-nacl-routines-of = $(filter nacl-interface-$1-%,$(nacl-interface-routines))
-
-
-# Run the NaCl code validator on binaries after we link them, so the
-# build does not succeed with any binary that won't pass validation.
-# Moving the file around makes sure that we don't leave a target
-# appearing complete after it fails validation.
-define after-link
-mv -f $1 $1.prevalidation
-$(nacl)/nacl-after-link.sh '${READELF}' $1.prevalidation
-mv -f $1.prevalidation $1
-endef
-
-# The test wrapper script takes care of running things under NaCl's sel_ldr.
-test-wrapper-env-only = $(nacl)/nacl-test-wrapper.sh --arch=$(nacl-sdk-arch)
-test-wrapper-env = $(test-wrapper-env-only)
-test-wrapper = $(test-wrapper-env) --
-
-ifeq ($(subdir),csu)
-sysdep_routines += nacl_interface_query nacl_interface_ext_supply \
- nacl-interfaces $(call nacl-routines-of,libc)
-endif
-
-ifeq ($(subdir),elf)
-sysdep-dl-routines += $(call nacl-routines-of,rtld)
-sysdep-rtld-routines += nacl-interfaces $(call nacl-routines-of,rtld)
-endif
-
-ifeq ($(subdir),io)
-sysdep_routines += xstatconv
-endif
-
-ifeq ($(subdir),nptl)
-# We do not need any wrappers in libpthread.
-libpthread-routines := $(filter-out ptw-%,$(libpthread-routines))
-endif
-
-ifeq ($(subdir),misc)
-# We reuse the Linux file since the bits match. The file lives in the
-# top-level source tree so we can use it without reference to any
-# sysdeps/.../linux/ directories, but it's still a sysdeps decision to
-# install it.
-sysdep_headers += bits/mman-linux.h
-
-# This defeats sysdeps/gnu/Makefile's addition of sys/mtio.h, which
-# we do not want. This is a total kludge, but it seems no worse for
-# now than making the sysdeps/gnu/Makefile code conditional on a
-# variable we set here. If some sysdeps/.../Makefile that is later
-# in the list than sysdeps/gnu needed to add to sysdep_headers, this
-# would break it. But sysdeps/gnu is close to last in the list and
-# this coming up seems unlikely.
-override sysdep_headers := $(sysdep_headers)
-endif
diff --git a/sysdeps/nacl/Subdirs b/sysdeps/nacl/Subdirs
deleted file mode 100644
index 5d570b9969..0000000000
--- a/sysdeps/nacl/Subdirs
+++ /dev/null
@@ -1,3 +0,0 @@
-inet
-resolv
-nss
diff --git a/sysdeps/nacl/Versions b/sysdeps/nacl/Versions
deleted file mode 100644
index cfc4a08c40..0000000000
--- a/sysdeps/nacl/Versions
+++ /dev/null
@@ -1,23 +0,0 @@
-ld {
- GLIBC_PRIVATE {
- __nacl_irt_*;
- __nacl_supply_interface_rtld;
- }
-}
-
-libc {
- GLIBC_2.22 {
- nacl_interface_query;
- nacl_interface_ext_supply;
- }
-
- GLIBC_PRIVATE {
- # These are used by libpthread.
- __libc_write;
- __libc_open;
- __libc_close;
- __libc_fork;
-
- __nacl_irt_*;
- }
-}
diff --git a/sysdeps/nacl/_exit.c b/sysdeps/nacl/_exit.c
deleted file mode 100644
index 5855bbf87d..0000000000
--- a/sysdeps/nacl/_exit.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* _exit -- low-level program termination. NaCl version.
- Copyright (C) 2015-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 <stdlib.h>
-#include <nacl-interfaces.h>
-
-void
-_exit (int status)
-{
- __nacl_irt_basic.exit (status);
-
- /* That never returns unless something is severely and unrecoverably wrong.
- If it ever does, try to make sure we crash. */
- while (1)
- __builtin_trap ();
-}
-libc_hidden_def (_exit)
-rtld_hidden_def (_exit)
-weak_alias (_exit, _Exit)
diff --git a/sysdeps/nacl/access.c b/sysdeps/nacl/access.c
deleted file mode 100644
index 95a0fb726b..0000000000
--- a/sysdeps/nacl/access.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Check file access permission. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Test for access to FILE. */
-int
-__access (const char *file, int type)
-{
- return NACL_CALL (__nacl_irt_dev_filename.access (file, type), 0);
-}
-weak_alias (__access, access)
diff --git a/sysdeps/nacl/backtrace.c b/sysdeps/nacl/backtrace.c
deleted file mode 100644
index 27ce597b39..0000000000
--- a/sysdeps/nacl/backtrace.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/x86_64/backtrace.c>
diff --git a/sysdeps/nacl/bits/dirent.h b/sysdeps/nacl/bits/dirent.h
deleted file mode 100644
index d4eb7feb4b..0000000000
--- a/sysdeps/nacl/bits/dirent.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Directory entry structure `struct dirent'. NaCl version.
- Copyright (C) 2015-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 _DIRENT_H
-# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
-#endif
-
-/* Note that __ino_t and __ino64_t are the same type.
- Likewise __off_t and __off64_t are the same type. */
-
-struct dirent
- {
- __ino_t d_ino; /* File serial number. */
- __off_t d_off; /* File position of this entry. */
- unsigned short int d_reclen; /* Length of the whole `struct dirent'. */
-
- /* Only this member is in the POSIX standard. */
- char d_name[256]; /* We must not include limits.h! */
- };
-
-#ifdef __USE_LARGEFILE64
-/* This is completely identical to `struct dirent'. */
-struct dirent64
- {
- __ino_t d_ino; /* File serial number. */
- __off_t d_off; /* File position of this entry. */
- unsigned short int d_reclen; /* Length of the whole `struct dirent'. */
-
- /* Only this member is in the POSIX standard. */
- char d_name[256]; /* We must not include limits.h! */
- };
-#endif
-
-#define d_fileno d_ino /* Backwards compatibility. */
-
-#define _DIRENT_HAVE_D_RECLEN 1
-#define _DIRENT_MATCHES_DIRENT64 1
diff --git a/sysdeps/nacl/bits/fcntl.h b/sysdeps/nacl/bits/fcntl.h
deleted file mode 100644
index ad083b357c..0000000000
--- a/sysdeps/nacl/bits/fcntl.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/* O_*, F_*, FD_* bit values. NaCl version.
- Copyright (C) 2015-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 _FCNTL_H
-#error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
-#endif
-
-
-/* File access modes for `open' and `fcntl'. */
-#define O_RDONLY 0 /* Open read-only. */
-#define O_WRONLY 1 /* Open write-only. */
-#define O_RDWR 2 /* Open read/write. */
-
-
-/* Bits OR'd into the second argument to open. */
-#define O_CREAT 00100 /* Create file if it doesn't exist. */
-#define O_EXCL 00200 /* Fail if file already exists. */
-#define O_TRUNC 01000 /* Truncate file to zero length. */
-#define O_NOCTTY 0 /* Don't assign a controlling terminal. */
-#define O_ASYNC 020000 /* Send SIGIO to owner when data is ready. */
-#define O_FSYNC 010000 /* Synchronous writes. */
-#define O_SYNC O_FSYNC
-#ifdef __USE_XOPEN2K8
-# define O_DIRECTORY 00200000 /* Must be a directory. */
-# define O_NOFOLLOW 00400000 /* Do not follow links. */
-# define O_CLOEXEC 02000000 /* Set close_on_exec. */
-#endif
-#if defined __USE_POSIX199309 || defined __USE_UNIX98
-# define O_DSYNC O_SYNC /* Synchronize data. */
-# define O_RSYNC O_SYNC /* Synchronize read operations. */
-#endif
-
-/* All opens support large file sizes, so there is no flag bit for this. */
-#ifdef __USE_LARGEFILE64
-# define O_LARGEFILE 0
-#endif
-
-/* File status flags for `open' and `fcntl'. */
-#define O_APPEND 02000 /* Writes append to the file. */
-#define O_NONBLOCK 04000 /* Non-blocking I/O. */
-
-#ifdef __USE_MISC
-# define O_NDELAY O_NONBLOCK
-#endif
-
-#ifdef __USE_MISC
-/* Bits in the file status flags returned by F_GETFL.
- These are all the O_* flags, plus FREAD and FWRITE, which are
- independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was
- given to `open'. */
-# define FREAD 1
-# define FWRITE 2
-
-/* Traditional BSD names the O_* bits. */
-# define FASYNC O_ASYNC
-# define FFSYNC O_FSYNC
-# define FSYNC O_SYNC
-# define FAPPEND O_APPEND
-# define FNDELAY O_NDELAY
-#endif
-
-/* Mask for file access modes. This is system-dependent in case
- some system ever wants to define some other flavor of access. */
-#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
-
-/* Values for the second argument to `fcntl'. */
-#define F_DUPFD 0 /* Duplicate file descriptor. */
-#define F_GETFD 1 /* Get file descriptor flags. */
-#define F_SETFD 2 /* Set file descriptor flags. */
-#define F_GETFL 3 /* Get file status flags. */
-#define F_SETFL 4 /* Set file status flags. */
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
-#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
-#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
-#endif
-#define F_GETLK 7 /* Get record locking info. */
-#define F_SETLK 8 /* Set record locking info (non-blocking). */
-#define F_SETLKW 9 /* Set record locking info (blocking). */
-/* Not necessary, we always have 64-bit offsets. */
-#define F_GETLK64 F_GETLK /* Get record locking info. */
-#define F_SETLK64 F_SETLK /* Set record locking info (non-blocking). */
-#define F_SETLKW64 F_SETLKW/* Set record locking info (blocking). */
-#ifdef __USE_XOPEN2K8
-# define F_DUPFD_CLOEXEC 12 /* Duplicate file descriptor with
- close-on-exec set. */
-#endif
-
-/* File descriptor flags used with F_GETFD and F_SETFD. */
-#define FD_CLOEXEC 1 /* Close on exec. */
-
-
-#include <bits/types.h>
-
-/* The structure describing an advisory lock. This is the type of the third
- argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */
-struct flock
- {
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
- __off_t l_start; /* Offset where the lock begins. */
- __off_t l_len; /* Size of the locked area; zero means until EOF. */
- __pid_t l_pid; /* Process holding the lock. */
- };
-
-#ifdef __USE_LARGEFILE64
-/* Note this matches struct flock exactly. */
-struct flock64
- {
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
- __off_t l_start; /* Offset where the lock begins. */
- __off_t l_len; /* Size of the locked area; zero means until EOF. */
- __pid_t l_pid; /* Process holding the lock. */
- };
-#endif
-
-/* Values for the `l_type' field of a `struct flock'. */
-#define F_RDLCK 1 /* Read lock. */
-#define F_WRLCK 2 /* Write lock. */
-#define F_UNLCK 3 /* Remove lock. */
-
-/* Advice to `posix_fadvise'. */
-#ifdef __USE_XOPEN2K
-# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
-# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
-#endif
diff --git a/sysdeps/nacl/bits/local_lim.h b/sysdeps/nacl/bits/local_lim.h
deleted file mode 100644
index 0f9e4df561..0000000000
--- a/sysdeps/nacl/bits/local_lim.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Minimum guaranteed maximum values for system limits. NaCl version.
- Copyright (C) 2015-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 NAME_MAX 255
-
-#define PATH_MAX 4096
-
-#define NGROUPS_MAX 65536
-
-/* The number of data keys per process. */
-#define _POSIX_THREAD_KEYS_MAX 128
-/* This is the value this implementation supports. */
-#define PTHREAD_KEYS_MAX 1024
-
-/* Controlling the iterations of destructors for thread-specific data. */
-#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
-/* Number of iterations this implementation does. */
-#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
-
-/* The number of threads per process. */
-#define _POSIX_THREAD_THREADS_MAX 64
-/* We have no predefined limit on the number of threads. */
-#undef PTHREAD_THREADS_MAX
-
-/* Maximum amount by which a process can descrease its asynchronous I/O
- priority level. */
-#define AIO_PRIO_DELTA_MAX 20
-
-/* Minimum size for a thread. We are free to choose a reasonable value. */
-#define PTHREAD_STACK_MIN 131072
-
-/* Maximum number of timer expiration overruns. */
-#define DELAYTIMER_MAX 2147483647
-
-/* Maximum tty name length. */
-#define TTY_NAME_MAX 32
-
-/* Maximum login name length. This is arbitrary. */
-#define LOGIN_NAME_MAX 256
-
-/* Maximum host name length. */
-#define HOST_NAME_MAX 64
-
-/* Maximum message queue priority level. */
-#define MQ_PRIO_MAX 32768
-
-/* Maximum value the semaphore can have. */
-#define SEM_VALUE_MAX (2147483647)
diff --git a/sysdeps/nacl/bits/mman.h b/sysdeps/nacl/bits/mman.h
deleted file mode 100644
index 2baf35b036..0000000000
--- a/sysdeps/nacl/bits/mman.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Definitions for POSIX memory map interface. NaCl version.
- Copyright (C) 2015-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 _SYS_MMAN_H
-# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
-#endif
-
-/* NaCl uses the Linux bits for this. */
-#include <bits/mman-linux.h>
diff --git a/sysdeps/nacl/bits/param.h b/sysdeps/nacl/bits/param.h
deleted file mode 100644
index 8f33497a3d..0000000000
--- a/sysdeps/nacl/bits/param.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Old-style Unix parameters and limits. NaCl version.
- 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/>. */
-
-#ifndef _SYS_PARAM_H
-# error "Never use <bits/param.h> directly; include <sys/param.h> instead."
-#endif
-
-#define EXEC_PAGESIZE 0x10000
diff --git a/sysdeps/nacl/bits/posix_opt.h b/sysdeps/nacl/bits/posix_opt.h
deleted file mode 100644
index 6d51363e0e..0000000000
--- a/sysdeps/nacl/bits/posix_opt.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/* Define POSIX options for NaCl.
- Copyright (C) 2015-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 _BITS_POSIX_OPT_H
-#define _BITS_POSIX_OPT_H 1
-
-/* Job control is supported. (Not really, but the APIs exist.) */
-#define _POSIX_JOB_CONTROL 1
-
-/* Processes have a saved set-user-ID and a saved set-group-ID. */
-#define _POSIX_SAVED_IDS 1
-
-/* Priority scheduling is supported. ??? */
-#define _POSIX_PRIORITY_SCHEDULING 200809L
-
-/* Synchronizing file data is supported. ??? */
-#define _POSIX_SYNCHRONIZED_IO 200809L
-
-/* The fsync function is present. */
-#define _POSIX_FSYNC 200809L
-
-/* Mapping of files to memory is supported. */
-#define _POSIX_MAPPED_FILES 200809L
-
-/* Locking of all memory is not supported. */
-#define _POSIX_MEMLOCK -1
-
-/* Locking of ranges of memory is not supported. */
-#define _POSIX_MEMLOCK_RANGE -1
-
-/* Setting of memory protections is supported. */
-#define _POSIX_MEMORY_PROTECTION 200809L
-
-/* Some filesystems allow all users to change file ownership. */
-#define _POSIX_CHOWN_RESTRICTED 0
-
-/* `c_cc' member of 'struct termios' structure can be disabled by
- using the value _POSIX_VDISABLE. ??? */
-#define _POSIX_VDISABLE '\0'
-
-/* Filenames are not silently truncated. */
-#define _POSIX_NO_TRUNC 1
-
-/* X/Open realtime support is not fully available. This requires the
- following set of POSIX.1 features, not all of which NaCl supports:
- _POSIX_FSYNC
- _POSIX_MEMLOCK
- _POSIX_MEMLOCK_RANGE
- _POSIX_MESSAGE_PASSING
- _POSIX_PRIORITIZED_IO
- _POSIX_PRIORITY_SCHEDULING
- _POSIX_SHARED_MEMORY_OBJECTS
- _POSIX_SYNCHRONIZED_IO
- */
-#define _XOPEN_REALTIME -1
-
-/* X/Open thread realtime support is not available. This requires the
- following set of POSIX.1 features, none of which NaCl supports:
- _POSIX_THREAD_PRIO_INHERIT
- _POSIX_THREAD_PRIO_PROTECT
- _POSIX_THREAD_PRIORITY_SCHEDULING
- _POSIX_THREAD_ROBUST_PRIO_INHERIT
- _POSIX_THREAD_ROBUST_PRIO_PROTECT
- */
-#define _XOPEN_REALTIME_THREADS -1
-
-/* XPG4.2 shared memory is not supported.
- ??? What is this? shm* interfaces?
-*/
-#define _XOPEN_SHM -1
-
-/* POSIX threads are supported. */
-#define _POSIX_THREADS 200809L
-
-/* We have the reentrant functions described in POSIX. */
-#define _POSIX_REENTRANT_FUNCTIONS 1
-#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L
-
-/* We do not provide priority scheduling for threads. */
-#define _POSIX_THREAD_PRIORITY_SCHEDULING -1
-
-/* We support user-defined stack sizes. */
-#define _POSIX_THREAD_ATTR_STACKSIZE 200809L
-
-/* We support user-defined stacks. */
-#define _POSIX_THREAD_ATTR_STACKADDR 200809L
-
-/* We do not support priority inheritence. */
-#define _POSIX_THREAD_PRIO_INHERIT -1
-
-/* We do not support priority protection. */
-#define _POSIX_THREAD_PRIO_PROTECT -1
-
-#ifdef __USE_XOPEN2K8
-/* We do not support priority inheritence for robust mutexes. */
-# define _POSIX_THREAD_ROBUST_PRIO_INHERIT -1
-
-/* We do not support priority protection for robust mutexes. */
-# define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1
-#endif
-
-/* We support POSIX.1b semaphores. */
-#define _POSIX_SEMAPHORES 200809L
-
-/* Real-time signals are supported. ??? */
-#define _POSIX_REALTIME_SIGNALS 200809L
-
-/* We support asynchronous I/O. */
-#define _POSIX_ASYNCHRONOUS_IO 200809L
-#define _POSIX_ASYNC_IO 1
-/* Alternative name for Unix98. */
-#define _LFS_ASYNCHRONOUS_IO 1
-/* Support for prioritization is not available. */
-#define _POSIX_PRIORITIZED_IO -1
-
-/* The LFS support in asynchronous I/O is also available. */
-#define _LFS64_ASYNCHRONOUS_IO 1
-
-/* The rest of the LFS is also available. */
-#define _LFS_LARGEFILE 1
-#define _LFS64_LARGEFILE 1
-#define _LFS64_STDIO 1
-
-/* POSIX shared memory objects are implemented. */
-#define _POSIX_SHARED_MEMORY_OBJECTS 200809L
-
-/* Process CPU-time clocks are not supported. */
-#define _POSIX_CPUTIME -1
-
-/* Thread CPU-time locks are supported. */
-#define _POSIX_THREAD_CPUTIME 200809L
-
-/* GNU libc provides regular expression handling. */
-#define _POSIX_REGEXP 1
-
-/* Reader/Writer locks are available. */
-#define _POSIX_READER_WRITER_LOCKS 200809L
-
-/* We have a POSIX shell. */
-#define _POSIX_SHELL 1
-
-/* We support the Timeouts option. */
-#define _POSIX_TIMEOUTS 200809L
-
-/* We support spinlocks. */
-#define _POSIX_SPIN_LOCKS 200809L
-
-/* The `spawn' function family is supported. */
-#define _POSIX_SPAWN 200809L
-
-/* We have POSIX timers. */
-#define _POSIX_TIMERS 200809L
-
-/* The barrier functions are available. */
-#define _POSIX_BARRIERS 200809L
-
-/* POSIX message queues are not available. */
-#define _POSIX_MESSAGE_PASSING -1
-
-/* Thread process-shared synchronization is not supported. */
-#define _POSIX_THREAD_PROCESS_SHARED -1
-
-/* The monotonic clock is available. */
-#define _POSIX_MONOTONIC_CLOCK 200809L
-
-/* The clock selection interfaces are available. ??? Actually only
- clock_nanosleep works, and pthread_condattr_setclock does not. */
-#define _POSIX_CLOCK_SELECTION 200809L
-
-/* Advisory information interfaces are available. */
-#define _POSIX_ADVISORY_INFO 200809L
-
-/* IPv6 support is available. */
-#define _POSIX_IPV6 200809L
-
-/* Raw socket support is available. */
-#define _POSIX_RAW_SOCKETS 200809L
-
-/* We have at least one terminal. */
-#define _POSIX2_CHAR_TERM 200809L
-
-/* Neither process nor thread sporadic server interfaces is available. */
-#define _POSIX_SPORADIC_SERVER -1
-#define _POSIX_THREAD_SPORADIC_SERVER -1
-
-/* trace.h is not available. */
-#define _POSIX_TRACE -1
-#define _POSIX_TRACE_EVENT_FILTER -1
-#define _POSIX_TRACE_INHERIT -1
-#define _POSIX_TRACE_LOG -1
-
-/* Typed memory objects are not available. */
-#define _POSIX_TYPED_MEMORY_OBJECTS -1
-
-#endif /* bits/posix_opt.h */
diff --git a/sysdeps/nacl/bits/stat.h b/sysdeps/nacl/bits/stat.h
deleted file mode 100644
index 2ff4982e8f..0000000000
--- a/sysdeps/nacl/bits/stat.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* 'struct stat' and related definitions. NaCl version.
- Copyright (C) 2015-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/>. */
-
-#if !defined _SYS_STAT_H && !defined _FCNTL_H
-# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
-#endif
-
-#ifndef _BITS_STAT_H
-#define _BITS_STAT_H 1
-
-/* Versions of the `struct stat' data structure. */
-#define _STAT_VER_NACL 0
-#define _STAT_VER_LINUX 1
-
-#define _STAT_VER _STAT_VER_LINUX
-
-struct stat
- {
- __dev_t st_dev; /* Device. */
- __ino_t st_ino; /* File serial number. */
- __nlink_t st_nlink; /* Link count. */
- __mode_t st_mode; /* File mode. */
- __uid_t st_uid; /* User ID of the file's owner. */
- __gid_t st_gid; /* Group ID of the file's group.*/
- int __pad0;
- __dev_t st_rdev; /* Device number, if device. */
- __off_t st_size; /* Size of file, in bytes. */
- __blksize_t st_blksize; /* Optimal block size for I/O. */
- __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
-#if defined __USE_XOPEN2K8
- /* Nanosecond resolution timestamps are stored in a format
- equivalent to 'struct timespec'. This is the type used
- whenever possible but the Unix namespace rules do not allow the
- identifier 'timespec' to appear in the <sys/stat.h> header.
- Therefore we have to handle the use of this header in strictly
- standard-compliant sources special. */
- struct timespec st_atim; /* Time of last access. */
- struct timespec st_mtim; /* Time of last modification. */
- struct timespec st_ctim; /* Time of last status change. */
-# define st_atime st_atim.tv_sec /* Backward compatibility. */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
- __time_t st_atime; /* Time of last access. */
- __uint64_t st_atimensec; /* Nsecs of last access. */
- __time_t st_mtime; /* Time of last modification. */
- __uint64_t st_mtimensec; /* Nsecs of last modification. */
- __time_t st_ctime; /* Time of last status change. */
- __uint64_t st_ctimensec; /* Nsecs of last status change. */
-#endif
- __int64_t __unused[3];
- };
-
-#ifdef __USE_LARGEFILE64
-/* Note stat64 has the same shape as stat for NaCl. */
-struct stat64
- {
- __dev_t st_dev; /* Device. */
- __ino_t st_ino; /* File serial number. */
- __nlink_t st_nlink; /* Link count. */
- __mode_t st_mode; /* File mode. */
- __uid_t st_uid; /* User ID of the file's owner. */
- __gid_t st_gid; /* Group ID of the file's group.*/
- int __pad0;
- __dev_t st_rdev; /* Device number, if device. */
- __off_t st_size; /* Size of file, in bytes. */
- __blksize_t st_blksize; /* Optimal block size for I/O. */
- __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
-# if defined __USE_XOPEN2K8
- /* Nanosecond resolution timestamps are stored in a format
- equivalent to 'struct timespec'. This is the type used
- whenever possible but the Unix namespace rules do not allow the
- identifier 'timespec' to appear in the <sys/stat.h> header.
- Therefore we have to handle the use of this header in strictly
- standard-compliant sources special. */
- struct timespec st_atim; /* Time of last access. */
- struct timespec st_mtim; /* Time of last modification. */
- struct timespec st_ctim; /* Time of last status change. */
-# define st_atime st_atim.tv_sec /* Backward compatibility. */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-# else
- __time_t st_atime; /* Time of last access. */
- __uint64_t st_atimensec; /* Nsecs of last access. */
- __time_t st_mtime; /* Time of last modification. */
- __uint64_t st_mtimensec; /* Nsecs of last modification. */
- __time_t st_ctime; /* Time of last status change. */
- __uint64_t st_ctimensec; /* Nsecs of last status change. */
-# endif
- __int64_t __unused[3];
- };
-#endif
-
-/* Tell code we have these members. */
-#define _STATBUF_ST_BLKSIZE 1
-#define _STATBUF_ST_RDEV 1
-/* Nanosecond resolution time values are supported. */
-#define _STATBUF_ST_NSEC 1
-
-/* Encoding of the file mode. */
-
-#define __S_IFMT 0170000 /* These bits determine file type. */
-
-/* File types. */
-#define __S_IFDIR 0040000 /* Directory. */
-#define __S_IFCHR 0020000 /* Character device. */
-#define __S_IFBLK 0060000 /* Block device. */
-#define __S_IFREG 0100000 /* Regular file. */
-#define __S_IFIFO 0010000 /* FIFO. */
-#define __S_IFLNK 0120000 /* Symbolic link. */
-#define __S_IFSOCK 0140000 /* Socket. */
-
-/* POSIX.1b objects. Note that these macros always evaluate to zero. But
- they do it by enforcing the correct use of the macros. */
-#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode)
-#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
-#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
-
-/* Protection bits. */
-
-#define __S_ISUID 04000 /* Set user ID on execution. */
-#define __S_ISGID 02000 /* Set group ID on execution. */
-#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */
-#define __S_IREAD 0400 /* Read by owner. */
-#define __S_IWRITE 0200 /* Write by owner. */
-#define __S_IEXEC 0100 /* Execute by owner. */
-
-#ifdef __USE_ATFILE
-/* XXX missing: UTIME_NOW, UTIME_OMIT */
-#endif
-
-#endif /* bits/stat.h */
diff --git a/sysdeps/nacl/bits/typesizes.h b/sysdeps/nacl/bits/typesizes.h
deleted file mode 100644
index 0118309e18..0000000000
--- a/sysdeps/nacl/bits/typesizes.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* bits/typesizes.h -- underlying types for *_t. NaCl version.
- Copyright (C) 2015-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 _BITS_TYPES_H
-# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
-#endif
-
-#ifndef _BITS_TYPESIZES_H
-#define _BITS_TYPESIZES_H 1
-
-/* See <bits/types.h> for the meaning of these macros. This file exists so
- that <bits/types.h> need not vary across different GNU platforms. */
-
-#define __DEV_T_TYPE __UQUAD_TYPE
-#define __UID_T_TYPE __U32_TYPE
-#define __GID_T_TYPE __U32_TYPE
-#define __INO_T_TYPE __UQUAD_TYPE
-#define __INO64_T_TYPE __INO_T_TYPE
-#define __MODE_T_TYPE __U32_TYPE
-#define __NLINK_T_TYPE __UWORD_TYPE
-#define __OFF_T_TYPE __SQUAD_TYPE
-#define __OFF64_T_TYPE __OFF_T_TYPE
-#define __PID_T_TYPE __S32_TYPE
-#define __RLIM_T_TYPE __UQUAD_TYPE
-#define __RLIM64_T_TYPE __RLIM_T_TYPE
-#define __BLKCNT_T_TYPE __SQUAD_TYPE
-#define __BLKCNT64_T_TYPE __BLKCNT_T_TYPE
-#define __FSBLKCNT_T_TYPE __UQUAD_TYPE
-#define __FSBLKCNT64_T_TYPE __FSBLKCNT_T_TYPE
-#define __FSFILCNT_T_TYPE __UQUAD_TYPE
-#define __FSFILCNT64_T_TYPE __FSFILCNT_T_TYPE
-#define __FSWORD_T_TYPE __SWORD_TYPE
-#define __ID_T_TYPE __U32_TYPE
-#define __CLOCK_T_TYPE __SLONGWORD_TYPE
-#define __TIME_T_TYPE __SQUAD_TYPE
-#define __USECONDS_T_TYPE __U32_TYPE
-#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
-#define __DADDR_T_TYPE __S32_TYPE
-#define __KEY_T_TYPE __S32_TYPE
-#define __CLOCKID_T_TYPE __S32_TYPE
-#define __TIMER_T_TYPE void *
-#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
-#define __FSID_T_TYPE struct { int __val[2]; }
-#define __SSIZE_T_TYPE __SWORD_TYPE
-#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
-#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
-#define __CPU_MASK_TYPE __ULONGWORD_TYPE
-
-/* All our foo64_t types match their foo_t counterparts. */
-#define __OFF_T_MATCHES_OFF64_T 1
-#define __INO_T_MATCHES_INO64_T 1
-
-/* Number of descriptors that can fit in an `fd_set'. */
-#define __FD_SETSIZE 1024
-
-
-#endif /* bits/typesizes.h */
diff --git a/sysdeps/nacl/brk.c b/sysdeps/nacl/brk.c
deleted file mode 100644
index cf7aac4b20..0000000000
--- a/sysdeps/nacl/brk.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* brk -- Adjust the "break" at the end of initial data. NaCl version.
- Copyright (C) 2015-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 <libc-internal.h>
-#include <stdint.h>
-#include <sys/mman.h>
-#include <sys/param.h>
-#include <unistd.h>
-
-/* sbrk.c expects this. */
-void *__curbrk;
-
-static uintptr_t
-page_above (void *addr)
-{
- return ALIGN_UP ((uintptr_t) addr, EXEC_PAGESIZE);
-}
-
-/* Set the end of the process's data space to ADDR.
- Return 0 if successful, -1 if not. */
-int
-__brk (void *addr)
-{
- /* The NaCl sysbrk call is deprecated, so we do not use it here. Other
- libc code expects that __sbrk can be used at least a little bit, so
- rather than a plain stub we have a minimal __brk implementation here.
- It just uses mmap/munmap to grow or shrink the break area, punting as
- soon as mmap fails to use the same contiguous area. */
-
- if (__glibc_unlikely (__curbrk == NULL))
- {
- /* This is the first call. We must initialize the record
- of the current position. It starts out at the end of the
- main program's data segment. */
-
- /* XXX dynamic case??? */
- extern char _end[];
- __curbrk = _end;
- }
-
- if (__glibc_unlikely (addr == NULL))
- /* This is a call just to ensure that __curbrk is set up. */
- return 0;
-
- uintptr_t old_limit = page_above (__curbrk);
- uintptr_t new_limit = page_above (addr);
-
- if (old_limit > new_limit)
- {
- /* We're shrinking the old heap enough to release some pages. */
- if (__munmap ((void *) new_limit, old_limit - new_limit) != 0)
- return -1;
- }
- else if (old_limit < new_limit)
- {
- /* We're growing the old heap enough to need some more pages.
- See if they are available. */
- void *new_space = __mmap ((void *) old_limit, new_limit - old_limit,
- PROT_READ | PROT_WRITE, MAP_ANON, -1, 0);
- if (new_space != (void *) old_limit)
- {
- if (new_space != MAP_FAILED)
- {
- /* mmap chose some different place for the pages
- because the contiguous area was not available.
- Oh well. We can't use that. */
- __munmap (new_space, new_limit - old_limit);
- __set_errno (ENOMEM);
- }
- return -1;
- }
- }
-
- __curbrk = addr;
- return 0;
-}
-weak_alias (__brk, brk)
diff --git a/sysdeps/nacl/chdir.c b/sysdeps/nacl/chdir.c
deleted file mode 100644
index f28eb42f52..0000000000
--- a/sysdeps/nacl/chdir.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Change current working directory. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Change the current directory to PATH. */
-int
-__chdir (const char *path)
-{
- return NACL_CALL (__nacl_irt_dev_filename.chdir (path), 0);
-}
-weak_alias (__chdir, chdir)
diff --git a/sysdeps/nacl/check_fds.c b/sysdeps/nacl/check_fds.c
deleted file mode 100644
index 3a75a8ee34..0000000000
--- a/sysdeps/nacl/check_fds.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Check inherited file descriptors for sanity at startup. NaCl version.
- Copyright (C) 2015-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/>. */
-
-/* Nothing to do here. */
-void
-__libc_check_standard_fds (void)
-{
-}
diff --git a/sysdeps/nacl/chmod.c b/sysdeps/nacl/chmod.c
deleted file mode 100644
index 78bf811c93..0000000000
--- a/sysdeps/nacl/chmod.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Change a file's permissions. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Change the protections of FILE to MODE. */
-int
-__chmod (const char *file, mode_t mode)
-{
- return NACL_CALL (__nacl_irt_dev_filename.chmod (file, mode), 0);
-}
-weak_alias (__chmod, chmod)
diff --git a/sysdeps/nacl/clock.c b/sysdeps/nacl/clock.c
deleted file mode 100644
index 664ad650c3..0000000000
--- a/sysdeps/nacl/clock.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Return the time used by the program so far. NaCl version.
- Copyright (C) 2015-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 <time.h>
-#include <nacl-interfaces.h>
-
-
-/* Return the time used by the program so far (user time + system time). */
-clock_t
-clock (void)
-{
- nacl_abi_clock_t result;
- return NACL_CALL (__nacl_irt_basic.clock (&result), result);
-}
diff --git a/sysdeps/nacl/clock_getres.c b/sysdeps/nacl/clock_getres.c
deleted file mode 100644
index 2b9a74f46f..0000000000
--- a/sysdeps/nacl/clock_getres.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Get the resolution of a clock. NaCl version.
- Copyright (C) 2015-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 <time.h>
-#include <nacl-interfaces.h>
-
-/* Get resolution of clock. */
-int
-__clock_getres (clockid_t clock_id, struct timespec *res)
-{
- return NACL_CALL (__nacl_irt_clock.clock_getres (clock_id, res), 0);
-}
-weak_alias (__clock_getres, clock_getres)
diff --git a/sysdeps/nacl/clock_gettime.c b/sysdeps/nacl/clock_gettime.c
deleted file mode 100644
index f33069c24a..0000000000
--- a/sysdeps/nacl/clock_gettime.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Get the current value of a clock. NaCl version.
- Copyright (C) 2015-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 <time.h>
-#include <nacl-interfaces.h>
-
-/* Get current value of CLOCK and store it in TP. */
-int
-__clock_gettime (clockid_t clock_id, struct timespec *tp)
-{
- return NACL_CALL (__nacl_irt_clock.clock_gettime (clock_id, tp), 0);
-}
-libc_hidden_def (__clock_gettime)
-weak_alias (__clock_gettime, clock_gettime)
diff --git a/sysdeps/nacl/configure b/sysdeps/nacl/configure
deleted file mode 100644
index 6bc753be03..0000000000
--- a/sysdeps/nacl/configure
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
- # Local configure fragment for sysdeps/nacl.
-
-nacl_probe_file=native_client/src/trusted/service_runtime/include/sys/errno.h
-
-# sysheaders is set by the --with-headers=... option to configure.
-# For NaCl, we require that the option be given and point to the
-# native_client/.. source tree directory.
-test -n "$sysheaders" || {
- as_fn_error $? "must supply --with-headers=DIR with native_client source tree" "$LINENO" 5
-}
-test -r "$sysheaders/$nacl_probe_file" || {
- as_fn_error $? "$sysheaders does not appear to be a native_client source tree" "$LINENO" 5
-}
-
-# nscd is extremely useless in the NaCl context.
-build_nscd=no
-use_nscd=no
diff --git a/sysdeps/nacl/configure.ac b/sysdeps/nacl/configure.ac
deleted file mode 100644
index 2c6f29fe1b..0000000000
--- a/sysdeps/nacl/configure.ac
+++ /dev/null
@@ -1,18 +0,0 @@
-GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
-# Local configure fragment for sysdeps/nacl.
-
-nacl_probe_file=native_client/src/trusted/service_runtime/include/sys/errno.h
-
-# sysheaders is set by the --with-headers=... option to configure.
-# For NaCl, we require that the option be given and point to the
-# native_client/.. source tree directory.
-test -n "$sysheaders" || {
- AC_MSG_ERROR([must supply --with-headers=DIR with native_client source tree])
-}
-test -r "$sysheaders/$nacl_probe_file" || {
- AC_MSG_ERROR([$sysheaders does not appear to be a native_client source tree])
-}
-
-# nscd is extremely useless in the NaCl context.
-build_nscd=no
-use_nscd=no
diff --git a/sysdeps/nacl/createthread.c b/sysdeps/nacl/createthread.c
deleted file mode 100644
index 7b571c34e2..0000000000
--- a/sysdeps/nacl/createthread.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Low-level thread creation for NPTL. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-#include <pthread-pids.h>
-
-/* See the comments in pthread_create.c for the requirements for these
- two macros and the create_thread function. */
-
-#define START_THREAD_DEFN \
- static void __attribute__ ((noreturn)) start_thread (void)
-#define START_THREAD_SELF THREAD_SELF
-
-/* pthread_create.c defines this using START_THREAD_DEFN
- We need a forward declaration here so we can take its address. */
-static void start_thread (void) __attribute__ ((noreturn));
-
-static int
-create_thread (struct pthread *pd, const struct pthread_attr *attr,
- bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
-{
- pd->tid = __nacl_get_tid (pd);
-
- pd->stopped_start = stopped_start;
- if (__glibc_unlikely (stopped_start))
- /* We make sure the thread does not run far by forcing it to get a
- lock. We lock it here too so that the new thread cannot continue
- until we tell it to. */
- lll_lock (pd->lock, LLL_PRIVATE);
-
- TLS_DEFINE_INIT_TP (tp, pd);
-
- return __nacl_irt_thread.thread_create (&start_thread, stackaddr, tp);
-}
diff --git a/sysdeps/nacl/dl-fileid.h b/sysdeps/nacl/dl-fileid.h
deleted file mode 100644
index 4c34581701..0000000000
--- a/sysdeps/nacl/dl-fileid.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Bypass sysdeps/posix/dl-fileid.h, which relies on st_dev/st_ino being
- reliable. Under NaCl, we cannot always expect them to be useful.
- Fortunately, in the ways NaCl is used it's far less likely that two
- different names for the same file would be used in dlopen or the like,
- so failing to notice re-opening the same file is not so likely to be a
- problem in practice. */
-
-#include <sysdeps/generic/dl-fileid.h>
diff --git a/sysdeps/nacl/dl-map-segments.h b/sysdeps/nacl/dl-map-segments.h
deleted file mode 100644
index ec3eff8a60..0000000000
--- a/sysdeps/nacl/dl-map-segments.h
+++ /dev/null
@@ -1,264 +0,0 @@
-/* Map in a shared object's segments. NaCl version.
- Copyright (C) 2015-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 <assert.h>
-#include <dl-load.h>
-#include <errno.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <libc-internal.h>
-
-
-/* This is basically pread, but with iteration after short reads. */
-static bool
-read_in_data (int fd, void *data, size_t len, off_t pos)
-{
- if (__glibc_unlikely (__lseek (fd, pos, SEEK_SET) == (off_t) -1))
- return true;
- while (len > 0)
- {
- ssize_t n = __read (fd, data, len);
- if (__glibc_unlikely (n < 0))
- return true;
- if (__glibc_unlikely (n == 0))
- {
- errno = EFTYPE;
- return true;
- }
- data += n;
- len -= n;
- }
- return false;
-}
-
-static const char *
-_dl_map_segments (struct link_map *l, int fd,
- const ElfW(Ehdr) *header, int type,
- const struct loadcmd loadcmds[], size_t nloadcmds,
- const size_t maplength, bool has_holes,
- struct link_map *loader)
-{
- if (__glibc_likely (type == ET_DYN))
- {
- /* This is a position-independent shared object. Let the system
- choose where to place it.
-
- As a refinement, sometimes we have an address that we would
- prefer to map such objects at; but this is only a preference,
- the OS can do whatever it likes. */
- ElfW(Addr) mappref
- = (ELF_PREFERRED_ADDRESS (loader, maplength,
- loadcmds[0].mapstart & GLRO(dl_use_load_bias))
- - MAP_BASE_ADDR (l));
-
- uintptr_t mapstart;
- if (__glibc_likely (loadcmds[0].prot & PROT_EXEC))
- {
- /* When there is a code segment, we must use the
- allocate_code_data interface to choose a location. */
-
- uintptr_t code_size = loadcmds[0].allocend - loadcmds[0].mapstart;
- uintptr_t data_offset;
- size_t data_size;
-
- if (__glibc_likely (nloadcmds > 1))
- {
- data_offset = loadcmds[1].mapstart - loadcmds[0].mapstart;
- data_size = ALIGN_UP (maplength - data_offset,
- GLRO(dl_pagesize));
- }
- else
- {
- data_offset = 0;
- data_size = 0;
- }
-
- int error = __nacl_irt_code_data_alloc.allocate_code_data
- (mappref, code_size, data_offset, data_size, &mapstart);
- if (__glibc_unlikely (error))
- {
- errno = error;
- return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
- }
- }
- else
- {
- /* With no code pages involved, plain mmap works fine. */
- void *mapped = __mmap ((void *) mappref, maplength,
- PROT_NONE, MAP_ANON, -1, 0);
- if (__glibc_unlikely (mapped == MAP_FAILED))
- return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
- mapstart = (uintptr_t) mapped;
- }
-
- l->l_addr = mapstart - loadcmds[0].mapstart;
- }
-
- /* Remember which part of the address space this object uses. */
- l->l_map_start = loadcmds[0].mapstart + l->l_addr;
- l->l_map_end = l->l_map_start + maplength;
- l->l_contiguous = !has_holes;
-
- /* Now actually map (or read) in each segment. */
- for (const struct loadcmd *c = loadcmds; c < &loadcmds[nloadcmds]; ++c)
- if (__glibc_likely (c->mapend > c->mapstart))
- {
- /* Unlike POSIX mmap, NaCl's mmap does not reliably handle COW
- faults in the remainder of the final partial page. So to get
- the expected behavior for the unaligned boundary between data
- and bss, it's necessary to allocate the final partial page of
- data as anonymous memory rather than mapping it from the file. */
-
- size_t maplen = c->mapend - c->mapstart;
- if (c->mapend > c->dataend && c->allocend > c->dataend)
- maplen = (c->dataend & -GLRO(dl_pagesize)) - c->mapstart;
-
- /* Map the segment contents from the file. */
- if (__glibc_unlikely (__mmap ((void *) (l->l_addr + c->mapstart),
- maplen, c->prot,
- MAP_FIXED|MAP_COPY|MAP_FILE,
- fd, c->mapoff)
- == MAP_FAILED))
- {
- switch (errno)
- {
- case EINVAL:
- case ENOTSUP:
- case ENOSYS:
- break;
- default:
- return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
- }
-
- /* No mmap support for this file. */
- if (c->prot & PROT_EXEC)
- {
- /* Read the data into a temporary buffer. */
- const size_t len = c->mapend - c->mapstart;
- void *data = __mmap (NULL, len, PROT_READ | PROT_WRITE,
- MAP_ANON|MAP_PRIVATE, -1, 0);
- if (__glibc_unlikely (data == MAP_FAILED))
- return DL_MAP_SEGMENTS_ERROR_MAP_ZERO_FILL;
- if (read_in_data (fd, data, len, c->mapoff))
- return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
- /* Now validate and install the code. */
- int error = __nacl_irt_dyncode.dyncode_create
- ((void *) (l->l_addr + c->mapstart), data, len);
- __munmap (data, len);
- if (__glibc_unlikely (error))
- {
- errno = error;
- return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
- }
- if (__glibc_unlikely (type != ET_DYN))
- {
- /* A successful PROT_EXEC mmap would have implicitly
- updated the bookkeeping so that a future
- allocate_code_data call would know that this range
- of the address space is already occupied. That
- doesn't happen implicitly with dyncode_create, so
- it's necessary to do an explicit call to update the
- bookkeeping. */
- uintptr_t allocated_address;
- error = __nacl_irt_code_data_alloc.allocate_code_data
- (l->l_addr + c->mapstart, len, 0, 0, &allocated_address);
- if (__glibc_unlikely (error))
- {
- errno = error;
- return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
- }
- if (__glibc_unlikely
- (allocated_address != l->l_addr + c->mapstart))
- {
- /* This is not a very helpful error for this case,
- but there isn't really anything better to use. */
- errno = ENOMEM;
- return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
- }
- }
- }
- else
- {
- /* Allocate the pages. */
- if (__mmap ((void *) (l->l_addr + c->mapstart),
- c->mapend - c->mapstart, c->prot | PROT_WRITE,
- MAP_FIXED|MAP_ANON|MAP_PRIVATE, -1, 0)
- == MAP_FAILED)
- return DL_MAP_SEGMENTS_ERROR_MAP_ZERO_FILL;
- /* Now read in the data. */
- if (read_in_data (fd, (void *) (l->l_addr + c->mapstart),
- c->dataend - c->mapstart, c->mapoff))
- return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
- /* Now that we've filled the pages, reset the page
- protections to what they should be. */
- if (!(c->prot & PROT_WRITE)
- && __mprotect ((void *) (l->l_addr + c->mapstart),
- c->mapend - c->mapstart, c->prot) < 0)
- return DL_MAP_SEGMENTS_ERROR_MPROTECT;
- }
- }
- else if (c->allocend > c->dataend)
- {
- /* Extra zero pages should appear at the end of this segment,
- after the data mapped from the file. */
-
- uintptr_t allocend = c->mapend;
- if (c->mapend > c->dataend)
- {
- /* The final data page was partial. So we didn't map it in.
- Instead, we must allocate an anonymous page to fill. */
- if (c->prot & PROT_WRITE)
- /* Do the whole allocation right here. */
- allocend = c->allocend;
- if (__mmap ((void *) (l->l_addr + c->mapstart + maplen),
- allocend - (c->mapstart + maplen), c->prot,
- MAP_FIXED|MAP_ANON|MAP_PRIVATE, -1, 0)
- == MAP_FAILED)
- return DL_MAP_SEGMENTS_ERROR_MAP_ZERO_FILL;
- if (read_in_data (fd,
- (void *) (l->l_addr + c->mapstart + maplen),
- c->dataend & (GLRO(dl_pagesize) - 1),
- c->mapoff + maplen))
- return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
- /* Now that we've filled the page, reset its
- protections to what they should be. */
- if (!(c->prot & PROT_WRITE)
- && __mprotect ((void *) (l->l_addr + c->mapstart + maplen),
- c->mapend - (c->mapstart + maplen),
- c->prot) < 0)
- return DL_MAP_SEGMENTS_ERROR_MPROTECT;
- }
-
- /* Now allocate the pure zero-fill pages. */
- if (allocend < c->allocend
- && (__mmap ((void *) (l->l_addr + c->mapstart + allocend),
- c->allocend - (c->mapstart + allocend), c->prot,
- MAP_FIXED|MAP_ANON|MAP_PRIVATE, -1, 0)
- == MAP_FAILED))
- return DL_MAP_SEGMENTS_ERROR_MAP_ZERO_FILL;
- }
-
- _dl_postprocess_loadcmd (l, header, c);
- }
-
- /* Notify ELF_PREFERRED_ADDRESS that we have to load this one
- fixed. */
- ELF_FIXED_ADDRESS (loader, c->mapstart);
-
- return NULL;
-}
diff --git a/sysdeps/nacl/dl-osinfo.h b/sysdeps/nacl/dl-osinfo.h
deleted file mode 100644
index c4cb0bafc8..0000000000
--- a/sysdeps/nacl/dl-osinfo.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* DL_SYSDEP_OSCHECK macro for NaCl.
- Copyright (C) 2015-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 _DL_OSINFO_H
-#define _DL_OSINFO_H 1
-
-#include <sysdeps/generic/dl-osinfo.h>
-
-#include "nacl-interfaces.h"
-
-#ifndef SHARED
-/* This doesn't really have anything to do with the purpose for
- which this macro is used in Linux configurations. But it is
- called at the right place in __libc_start_main. */
-# define DL_SYSDEP_OSCHECK(fatal) __nacl_initialize_interfaces ()
-#endif
-
-
-#endif /* dl-osinfo.h */
diff --git a/sysdeps/nacl/dl-sysdep-open.h b/sysdeps/nacl/dl-sysdep-open.h
deleted file mode 100644
index 10a48291da..0000000000
--- a/sysdeps/nacl/dl-sysdep-open.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* System-specific call to open a shared object by name. NaCl version.
- Copyright (C) 2015-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 _DL_SYSDEP_OPEN_H
-#define _DL_SYSDEP_OPEN_H 1
-
-#include <stddef.h>
-
-/* NAME is a name without slashes, as it appears in a DT_NEEDED entry
- or a dlopen call's argument or suchlike. NAMELEN is (strlen (NAME) + 1).
-
- Find NAME in an OS-dependent fashion, and return its "real" name.
- Optionally fill in *FD with a file descriptor open on that file (or
- else leave its initial value of -1). The return value is a new
- malloc'd string, which will be free'd by the caller. If NAME is
- resolved to an actual file that can be opened, then the return
- value should name that file (and if *FD was not set, then a normal
- __open call on that string will be made). If *FD was set by some
- other means than a normal open and there is no "real" name to use,
- then __strdup (NAME) is fine (modulo error checking). */
-
-extern char *_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
- internal_function attribute_hidden;
-
-#endif /* dl-sysdep-open.h */
diff --git a/sysdeps/nacl/dl-sysdep.c b/sysdeps/nacl/dl-sysdep.c
deleted file mode 100644
index f82567642d..0000000000
--- a/sysdeps/nacl/dl-sysdep.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Operating system support for run-time dynamic linker. NaCl version.
- Copyright (C) 2015-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 SHARED
-
-# include <assert.h>
-# include <ldsodefs.h>
-# include <stdint.h>
-# include <nacl-interfaces.h>
-
-/* NaCl's elf32.h is incompatible with the real <elf.h>. */
-# define NATIVE_CLIENT_SRC_INCLUDE_ELF32_H_
-# include <native_client/src/untrusted/nacl/nacl_startup.h>
-
-/* The RTLD_START code sets up the pointer that gets to these
- macros as COOKIE to point to two words:
- [0] the argument to the entry point from the system (see nacl_startup.h)
- [1] the stack base
-*/
-
-# define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
- do { \
- uint32_t *_info = ((void **) (cookie))[0]; \
- (argc) = nacl_startup_argc (_info); \
- (argv) = nacl_startup_argv (_info); \
- (envp) = nacl_startup_envp (_info); \
- (auxp) = nacl_startup_auxv (_info); \
- } while (0)
-
-# define DL_STACK_END(cookie) (((void **) (cookie))[1])
-
-/* This is called from the entry point (_start), defined by the RTLD_START
- macro in the machine-specific dl-machine.h file. At this point, dynamic
- linking has been completed and the first argument is the application's
- entry point. */
-attribute_hidden internal_function __attribute__ ((noreturn))
-void
-_dl_start_user (void (*user_entry) (uint32_t info[]), uint32_t info[])
-{
- if (_dl_skip_args > 0)
- {
- /* There are some arguments that the user program should not see.
- Just slide up the INFO pointer so its NACL_STARTUP_ARGV points
- to what should now be argv[0], and copy back the earlier fields. */
- assert (nacl_startup_argc (info) >= _dl_skip_args);
- assert (NACL_STARTUP_ARGV == 3);
- uint32_t envc = info[NACL_STARTUP_ENVC];
- uint32_t argc = info[NACL_STARTUP_ARGC];
- info += _dl_skip_args;
- info[NACL_STARTUP_ENVC] = envc;
- info[NACL_STARTUP_ARGC] = argc - _dl_skip_args;
- }
-
- /* Pass our finalizer function to the user. */
- info[NACL_STARTUP_FINI] = (uintptr_t) &_dl_fini;
-
- /* Run initializers. */
- _dl_init (GL(dl_ns)[0]._ns_loaded,
- nacl_startup_argc (info),
- nacl_startup_argv (info),
- nacl_startup_envp (info));
-
- /* Call the user's entry point. This should never return. */
- (*user_entry) (info);
-
- /* Fail clearly just in case it did return. */
- __builtin_trap ();
-}
-
-# define DL_SYSDEP_INIT __nacl_initialize_interfaces ()
-
-#endif /* SHARED */
-
-#include <elf/dl-sysdep.c>
-
-#include <dl-sysdep-open.h>
-#include <nacl-interfaces.h>
-#include <assert.h>
-#include <string.h>
-#include <unistd.h>
-
-char *
-internal_function
-_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
-{
- int error = __nacl_irt_resource_open.open_resource (name, fd);
- if (error)
- return NULL;
- assert (*fd != -1);
- char *realname = __strdup (name);
- if (__glibc_unlikely (realname == NULL))
- {
- __close (*fd);
- *fd = -1;
- }
- return realname;
-}
diff --git a/sysdeps/nacl/dl-sysdep.h b/sysdeps/nacl/dl-sysdep.h
deleted file mode 100644
index 735e2f3ce5..0000000000
--- a/sysdeps/nacl/dl-sysdep.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* System-specific settings for dynamic linker code. NaCl version.
- Copyright (C) 2015-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/>. */
-
-/* No multiple inclusion protection needed here because it's just macros.
- We don't want to use _DL_SYSDEP_H in case we are #include_next'd. */
-
-#include_next <dl-sysdep.h>
-
-/* We use AT_SYSINFO for a different purpose than Linux does,
- but we too want to store its value. */
-#define NEED_DL_SYSINFO 1
-#define DL_SYSINFO_DEFAULT 0
-
-/* sysdeps/arm/dl-sysdep.h defines this but it does not apply to NaCl. */
-#undef DL_ARGV_NOT_RELRO
diff --git a/sysdeps/nacl/dl-unmap-segments.h b/sysdeps/nacl/dl-unmap-segments.h
deleted file mode 100644
index 6f114eb620..0000000000
--- a/sysdeps/nacl/dl-unmap-segments.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Unmap a shared object's segments. NaCl version.
- Copyright (C) 2015-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 _DL_UNMAP_SEGMENTS_H
-#define _DL_UNMAP_SEGMENTS_H 1
-
-#include <link.h>
-#include <sys/mman.h>
-
-/* There is always a big gap between the executable segment and the data
- segments. Other code segments and data pages lie in there. So we must
- unmap each segment individually (except for a codeless module). */
-
-static void __always_inline
-_dl_unmap_segments (struct link_map *l)
-{
- if (l->l_contiguous)
- /* Simple case. */
- __munmap ((void *) l->l_map_start, l->l_map_end - l->l_map_start);
- else
- {
- /* Normally l_phdr points into the RODATA segment, which we will
- unmap in one iteration of the loop. So we cannot use it directly
- throughout. */
-
- struct { ElfW(Addr) start, end; } segments[l->l_phnum], *seg = segments;
-
- for (const ElfW(Phdr) *ph = l->l_phdr; ph < &l->l_phdr[l->l_phnum]; ++ph)
- if (ph->p_type == PT_LOAD)
- {
- seg->start = (l->l_addr + ph->p_vaddr) & -GLRO(dl_pagesize);
- seg->end = (l->l_addr + ph->p_vaddr + ph->p_memsz
- + GLRO(dl_pagesize) - 1) & -GLRO(dl_pagesize);
- if (seg > segments && seg[-1].end == seg->start)
- /* Coalesce two adjacent segments into one munmap call. */
- seg[-1].end = seg->end;
- else
- ++seg;
- }
-
- do
- {
- --seg;
- __munmap ((void *) seg->start, seg->end - seg->start);
- }
- while (seg > segments);
- }
-}
-
-#endif /* dl-unmap-segments.h */
diff --git a/sysdeps/nacl/dl-writev.h b/sysdeps/nacl/dl-writev.h
deleted file mode 100644
index bd50865378..0000000000
--- a/sysdeps/nacl/dl-writev.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Message-writing for the dynamic linker. NaCl version.
- Copyright (C) 2015-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/uio.h>
-#include <nacl-interfaces.h>
-
-/* This is used from only one place: dl-misc.c:_dl_debug_vdprintf.
- Hence it's in a header with the expectation it will be inlined.
-
- This is writev, but with a constraint added and others loosened:
-
- 1. Under RTLD_PRIVATE_ERRNO, it must not clobber the private errno
- when another thread holds the dl_load_lock.
- 2. It is not obliged to detect and report errors at all.
- 3. It's not really obliged to deliver a single atomic write
- (though it may be preferable). */
-
-static inline void
-_dl_writev (int fd, const struct iovec *iov, size_t niov)
-{
- for (size_t i = 0; i < niov; ++i)
- {
- size_t wrote;
- if (__nacl_irt_fdio.write (fd, iov[i].iov_base, iov[i].iov_len,
- &wrote) != 0
- || wrote != iov[i].iov_len)
- /* The write failed, so don't bother trying any more. */
- break;
- }
-}
diff --git a/sysdeps/nacl/dup.c b/sysdeps/nacl/dup.c
deleted file mode 100644
index 34a7cd46d4..0000000000
--- a/sysdeps/nacl/dup.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Duplicate a file descriptor. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-
-/* Duplicate FD, returning a new file descriptor open on the same file. */
-int
-__dup (int fd)
-{
- int result;
- return NACL_CALL (__nacl_irt_fdio.dup (fd, &result), result);
-}
-weak_alias (__dup, dup)
diff --git a/sysdeps/nacl/dup2.c b/sysdeps/nacl/dup2.c
deleted file mode 100644
index 9cffec3c99..0000000000
--- a/sysdeps/nacl/dup2.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Duplicate a file descriptor to a chosen number. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-
-/* Duplicate FD to FD2, closing the old FD2 and making FD2 be
- open the same file as FD is. Return FD2 or -1. */
-int
-__dup2 (int fd, int fd2)
-{
- return NACL_CALL (__nacl_irt_fdio.dup2 (fd, fd2), fd2);
-}
-libc_hidden_def (__dup2)
-weak_alias (__dup2, dup2)
diff --git a/sysdeps/nacl/entry.h b/sysdeps/nacl/entry.h
deleted file mode 100644
index e9dc190e34..0000000000
--- a/sysdeps/nacl/entry.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASSEMBLY__
-# include <stdint.h>
-extern void _start (uint32_t info[]) attribute_hidden;
-#endif
-
-#define ENTRY_POINT _start
diff --git a/sysdeps/nacl/errnos.awk b/sysdeps/nacl/errnos.awk
deleted file mode 100644
index f245bde0a6..0000000000
--- a/sysdeps/nacl/errnos.awk
+++ /dev/null
@@ -1,87 +0,0 @@
-# Script to produce bits/errno.h for NaCl.
-
-# Copyright (C) 2015-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/>.
-
-BEGIN { maxerrno = 0 }
-
-$1 == "#define" && $2 ~ /NACL_ABI_E[A-Z0-9_]+/ && $3 ~ /[0-9]+/ {
- ename = $2;
- sub(/NACL_ABI_/, "", ename);
- errno = $3 + 0;
- if (errno > maxerrno) maxerrno = errno;
- errnos[errno] = ename;
- errnos_by_name[ename] = errno;
- if ($4 == "/*" && !(ename in errno_text)) {
- etext = $5;
- for (i = 6; i <= NF && $i != "*/"; ++i)
- etext = etext " " $i;
- errno_text[ename] = etext;
- }
- next;
-}
-
-$1 == "@comment" && $2 == "errno.h" { errnoh=1; next }
-errnoh == 1 && $1 == "@comment" {
- ++errnoh;
- etext = $3;
- for (i = 4; i <= NF; ++i)
- etext = etext " " $i;
- next;
-}
-errnoh == 2 && $1 == "@deftypevr" && $2 == "Macro" && $3 == "int" {
- ename = $4;
- errno_text[ename] = etext;
- next;
-}
-
-function define_errno(errno, ename) {
- etext = errno_text[ename];
- if (length(ename) < 8) ename = ename "\t";
- printf "#define\t%s\t%d\t/* %s */\n", ename, errno, etext;
-}
-
-END {
- print "\
-/* This file generated by errnos.awk. */\n\
-\n\
-#if !defined __Emath_defined && (defined _ERRNO_H || defined __need_Emath)\n\
-#undef __need_Emath\n\
-#define __Emath_defined 1";
- emath["EDOM"] = emath["EILSEQ"] = emath["ERANGE"] = 1;
- for (ename in emath) {
- errno = errnos_by_name[ename];
- define_errno(errno, ename);
- delete errnos[errno];
- }
- print "\
-#endif\n\
-\n\
-#ifdef _ERRNO_H\n";
-
- for (i = 1; i <= maxerrno; ++i)
- if (i in errnos) define_errno(i, errnos[i]);
-
- print "\n\
-#define EWOULDBLOCK EAGAIN\n\
-#define ENOTSUP EOPNOTSUPP\n\
-\n\
-extern __thread int errno __attribute__ ((__tls_model__ (\"initial-exec\")));\n\
-#define errno errno\n\
-\n\
-#endif";
-}
diff --git a/sysdeps/nacl/euidaccess.c b/sysdeps/nacl/euidaccess.c
deleted file mode 100644
index 62dda81604..0000000000
--- a/sysdeps/nacl/euidaccess.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Check file access permission. NaCl version.
- Copyright (C) 2015-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>
-
-/* Test for access to FILE. */
-int
-__euidaccess (const char *file, int type)
-{
- /* No NaCl process will ever be set-ID, so access and euidaccess are one. */
- return __access (file, type);
-}
-weak_alias (__euidaccess, euidaccess)
-weak_alias (__euidaccess, eaccess)
diff --git a/sysdeps/nacl/exit-thread.h b/sysdeps/nacl/exit-thread.h
deleted file mode 100644
index 864ed4b424..0000000000
--- a/sysdeps/nacl/exit-thread.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Call to terminate the current thread. NaCl version.
- Copyright (C) 2015-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 <assert.h>
-#include <atomic.h>
-#include <futex-internal.h>
-#include <nacl-interfaces.h>
-#include <nptl/pthreadP.h>
-
-/* This causes the current thread to exit, without affecting other
- threads in the process if there are any. If there are no other
- threads left, then this has the effect of _exit (0). */
-
-static inline void __attribute__ ((noreturn, always_inline, unused))
-__exit_thread (void)
-{
- struct pthread *pd = THREAD_SELF;
-
- /* The generic logic for pthread_join and stack/descriptor reuse is
- based on the Linux kernel feature that will clear and futex-wake
- a designated address as a final part of thread teardown. Correct
- synchronization relies on the fact that these happen only after
- there is no possibility of user code touching or examining the
- late thread's stack.
-
- The NaCl system interface implements half of this: it clears a
- word after the thread's user stack is safely dead, but it does
- not futex-wake the location. So, some shenanigans are required.
- We change and futex-wake the location here, so as to wake up any
- blocked pthread_join (i.e. lll_wait_tid) or pthread_timedjoin_np
- (i.e. lll_timedwait_tid). However, that's before we have safely
- vacated the stack. So instead of clearing the location, we set
- it to a special magic value, NACL_EXITING_TID. This counts as a
- "live thread" value for all the generic logic, but is recognized
- specially in lll_wait_tid and lll_timedwait_tid (lowlevellock.h).
- Once it has this value, lll_wait_tid will busy-wait for the
- location to be cleared to zero by the NaCl system code. Only then
- is the stack actually safe to reuse. */
-
- if (!IS_DETACHED (pd))
- {
- /* The magic value must not be one that could ever be a valid
- TID value. See pthread-pids.h about the low bit. */
- assert (NACL_EXITING_TID & 1);
-
- /* The magic value must not be one that has the "free" flag
- (i.e. sign bit) set. If that bit is set, then the
- descriptor could be reused for a new thread. */
- assert (NACL_EXITING_TID > 0);
-
- atomic_store_relaxed (&pd->tid, NACL_EXITING_TID);
- futex_wake ((unsigned int *) &pd->tid, 1, FUTEX_PRIVATE);
- }
-
- /* This clears PD->tid some time after the thread stack can never
- be touched again. Unfortunately, it does not also do a
- futex-wake at that time (as Linux does via CLONE_CHILD_CLEARTID
- and set_tid_address). So lll_wait_tid does some busy-waiting. */
- __nacl_irt_thread.thread_exit (&pd->tid);
-
- /* That never returns unless something is severely and unrecoverably wrong.
- If it ever does, try to make sure we crash. */
- while (1)
- __builtin_trap ();
-}
diff --git a/sysdeps/nacl/fchdir.c b/sysdeps/nacl/fchdir.c
deleted file mode 100644
index 294fb48046..0000000000
--- a/sysdeps/nacl/fchdir.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Change working directory given a file descriptor. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Change the current directory to FD. */
-int
-__fchdir (int fd)
-{
- return NACL_CALL (__nacl_irt_dev_fdio.fchdir (fd), 0);
-}
-weak_alias (__fchdir, fchdir)
diff --git a/sysdeps/nacl/fchmod.c b/sysdeps/nacl/fchmod.c
deleted file mode 100644
index 1ed335c322..0000000000
--- a/sysdeps/nacl/fchmod.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Change a file's permissions given a file descriptor. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Change the permissions of the file referenced by FD to MODE. */
-int
-__fchmod (int fd, mode_t mode)
-{
- return NACL_CALL (__nacl_irt_dev_fdio.fchmod (fd, mode), 0);
-}
-weak_alias (__fchmod, fchmod)
diff --git a/sysdeps/nacl/fdopendir.c b/sysdeps/nacl/fdopendir.c
deleted file mode 100644
index 9e4220c1b7..0000000000
--- a/sysdeps/nacl/fdopendir.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Open a directory stream from a file descriptor. NaCl version.
- Copyright (C) 2015-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 <assert.h>
-#include <fcntl.h>
-
-/* Since NaCl does not have a useful fcntl, stub it out.
- fdopendir will not detect an fd open for writing only,
- but readdir will fail with EBADF so that's close enough. */
-
-#define __fcntl(fd, command) \
- ({ \
- assert ((command) == F_GETFL); \
- O_RDONLY; \
- })
-
-#include <sysdeps/posix/fdopendir.c>
diff --git a/sysdeps/nacl/fork.c b/sysdeps/nacl/fork.c
deleted file mode 100644
index 9f06944aa7..0000000000
--- a/sysdeps/nacl/fork.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Get the stub, bypassing the "generic" NPTL code. */
-#include <posix/fork.c>
-strong_alias (__fork, __libc_fork)
diff --git a/sysdeps/nacl/ftruncate.c b/sysdeps/nacl/ftruncate.c
deleted file mode 100644
index 66fbaa5daa..0000000000
--- a/sysdeps/nacl/ftruncate.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Truncate a file. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Truncate the file referenced by FD to LENGTH bytes. */
-int
-__ftruncate (int fd, off_t length)
-{
- return NACL_CALL (__nacl_irt_dev_fdio.ftruncate (fd, length), 0);
-}
-weak_alias (__ftruncate, ftruncate)
-
-/* ftruncate64 is the same as ftruncate. */
-strong_alias (__ftruncate, __ftruncate64)
-weak_alias (__ftruncate64, ftruncate64)
diff --git a/sysdeps/nacl/ftruncate64.c b/sysdeps/nacl/ftruncate64.c
deleted file mode 100644
index e40129af66..0000000000
--- a/sysdeps/nacl/ftruncate64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* ftruncate64 is the same as ftruncate. */
diff --git a/sysdeps/nacl/futex-internal.h b/sysdeps/nacl/futex-internal.h
deleted file mode 100644
index 0c5e02e818..0000000000
--- a/sysdeps/nacl/futex-internal.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/* futex operations for glibc-internal use. NaCl version.
- Copyright (C) 2014-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 FUTEX_INTERNAL_H
-#define FUTEX_INTERNAL_H
-
-#include <sysdeps/nptl/futex-internal.h>
-#include <errno.h>
-#include <lowlevellock-futex.h>
-#include <nacl-interfaces.h>
-#include <nptl/pthreadP.h>
-
-/* See sysdeps/nptl/futex-internal.h for documentation; this file only
- contains NaCl-specific comments.
-
- There is no support yet for shared futexes nor for exact relative
- timeouts. */
-
-/* See sysdeps/nptl/futex-internal.h for constraints on the value of the
- FUTEX_PRIVATE and FUTEX_SHARED constants.
- Shared futexes are not yet supported, and we never allow clients to
- actually request shared futexes. Therefore, we do not need a different
- value. */
-#undef FUTEX_SHARED
-#define FUTEX_SHARED FUTEX_PRIVATE
-
-/* FUTEX_SHARED is not yet supported. */
-static __always_inline int
-futex_supports_pshared (int pshared)
-{
- if (__glibc_likely (pshared == PTHREAD_PROCESS_PRIVATE))
- return 0;
- else if (pshared == PTHREAD_PROCESS_SHARED)
- return ENOTSUP;
- else
- return EINVAL;
-}
-
-/* Relative timeouts are only emulated via absolute timeouts using the
- system clock. */
-static __always_inline bool
-futex_supports_exact_relative_timeouts (void)
-{
- return false;
-}
-
-/* See sysdeps/nptl/futex-internal.h for details. */
-static __always_inline int
-futex_wait (unsigned int *futex_word, unsigned int expected, int private)
-{
- int err = lll_futex_timed_wait (futex_word, expected, NULL, private);
- switch (err)
- {
- case 0:
- case -EAGAIN:
- case -EINTR:
- return -err;
-
- case -ETIMEDOUT: /* Cannot have happened as we provided no timeout. */
- case -EFAULT: /* Must have been caused by a glibc or application bug. */
- case -EINVAL: /* Either due to wrong alignment or due to the timeout not
- being normalized. Must have been caused by a glibc or
- application bug. */
- case -ENOSYS: /* Must have been caused by a glibc bug. */
- /* No other errors are documented at this time. */
- default:
- futex_fatal_error ();
- }
-}
-
-/* See sysdeps/nptl/futex-internal.h for details. */
-static __always_inline int
-futex_wait_cancelable (unsigned int *futex_word, unsigned int expected,
- int private)
-{
- int oldtype;
- oldtype = __pthread_enable_asynccancel ();
- int err = lll_futex_timed_wait (futex_word, expected, NULL, private);
- __pthread_disable_asynccancel (oldtype);
- switch (err)
- {
- case 0:
- case -EAGAIN:
- case -EINTR:
- return -err;
-
- case -ETIMEDOUT: /* Cannot have happened as we provided no timeout. */
- case -EFAULT: /* Must have been caused by a glibc or application bug. */
- case -EINVAL: /* Either due to wrong alignment or due to the timeout not
- being normalized. Must have been caused by a glibc or
- application bug. */
- case -ENOSYS: /* Must have been caused by a glibc bug. */
- /* No other errors are documented at this time. */
- default:
- futex_fatal_error ();
- }
-}
-
-/* See sysdeps/nptl/futex-internal.h for details. */
-static __always_inline int
-futex_reltimed_wait (unsigned int *futex_word, unsigned int expected,
- const struct timespec *reltime, int private)
-{
- int err = lll_futex_timed_wait (futex_word, expected, reltime, private);
- switch (err)
- {
- case 0:
- case -EAGAIN:
- case -EINTR:
- case -ETIMEDOUT:
- return -err;
-
- case -EFAULT: /* Must have been caused by a glibc or application bug. */
- case -EINVAL: /* Either due to wrong alignment or due to the timeout not
- being normalized. Must have been caused by a glibc or
- application bug. */
- case -ENOSYS: /* Must have been caused by a glibc bug. */
- /* No other errors are documented at this time. */
- default:
- futex_fatal_error ();
- }
-}
-
-/* See sysdeps/nptl/futex-internal.h for details. */
-static __always_inline int
-futex_reltimed_wait_cancelable (unsigned int *futex_word,
- unsigned int expected,
- const struct timespec *reltime, int private)
-{
- int oldtype;
- oldtype = __pthread_enable_asynccancel ();
- int err = lll_futex_timed_wait (futex_word, expected, reltime, private);
- __pthread_disable_asynccancel (oldtype);
- switch (err)
- {
- case 0:
- case -EAGAIN:
- case -EINTR:
- case -ETIMEDOUT:
- return -err;
-
- case -EFAULT: /* Must have been caused by a glibc or application bug. */
- case -EINVAL: /* Either due to wrong alignment or due to the timeout not
- being normalized. Must have been caused by a glibc or
- application bug. */
- case -ENOSYS: /* Must have been caused by a glibc bug. */
- /* No other errors are documented at this time. */
- default:
- futex_fatal_error ();
- }
-}
-
-/* See sysdeps/nptl/futex-internal.h for details. */
-static __always_inline int
-futex_abstimed_wait (unsigned int *futex_word, unsigned int expected,
- const struct timespec *abstime, int private)
-{
- int err = __nacl_irt_futex.futex_wait_abs ((volatile int *) futex_word,
- expected, abstime);
- switch (err)
- {
- case 0:
- case EAGAIN:
- case EINTR:
- case ETIMEDOUT:
- return err;
-
- case EFAULT: /* Must have been caused by a glibc or application bug. */
- case EINVAL: /* Either due to wrong alignment or due to the timeout not
- being normalized. Must have been caused by a glibc or
- application bug. */
- case ENOSYS: /* Must have been caused by a glibc bug. */
- /* No other errors are documented at this time. */
- default:
- futex_fatal_error ();
- }
-}
-
-/* See sysdeps/nptl/futex-internal.h for details. */
-static __always_inline int
-futex_abstimed_wait_cancelable (unsigned int *futex_word,
- unsigned int expected,
- const struct timespec *abstime, int private)
-{
- int oldtype;
- oldtype = __pthread_enable_asynccancel ();
- int err = __nacl_irt_futex.futex_wait_abs ((volatile int *) futex_word,
- expected, abstime);
- __pthread_disable_asynccancel (oldtype);
- switch (err)
- {
- case 0:
- case EAGAIN:
- case EINTR:
- case ETIMEDOUT:
- return err;
-
- case EFAULT: /* Must have been caused by a glibc or application bug. */
- case EINVAL: /* Either due to wrong alignment or due to the timeout not
- being normalized. Must have been caused by a glibc or
- application bug. */
- case ENOSYS: /* Must have been caused by a glibc bug. */
- /* No other errors are documented at this time. */
- default:
- futex_fatal_error ();
- }
-}
-
-/* See sysdeps/nptl/futex-internal.h for details. */
-static __always_inline void
-futex_wake (unsigned int *futex_word, int processes_to_wake, int private)
-{
- int res = lll_futex_wake (futex_word, processes_to_wake, private);
- /* No error. Ignore the number of woken processes. */
- if (res >= 0)
- return;
- switch (res)
- {
- case -EFAULT: /* Could have happened due to memory reuse. */
- case -EINVAL: /* Could be either due to incorrect alignment (a bug in
- glibc or in the application) or due to memory being
- reused for a PI futex. We cannot distinguish between the
- two causes, and one of them is correct use, so we do not
- act in this case. */
- return;
- case -ENOSYS: /* Must have been caused by a glibc bug. */
- /* No other errors are documented at this time. */
- default:
- futex_fatal_error ();
- }
-}
-
-#endif /* futex-internal.h */
diff --git a/sysdeps/nacl/fxstat.c b/sysdeps/nacl/fxstat.c
deleted file mode 100644
index e97be0f517..0000000000
--- a/sysdeps/nacl/fxstat.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Get stat information from a file descriptor. NaCl version.
- Copyright (C) 2015-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/>. */
-
-/* Avoid the declaration so the compiler doesn't complain about the alias
- with a different type signature. It doesn't know that 'struct stat'
- and 'struct stat64' are ABI-compatible. */
-#define __fxstat64 __fxstat64_avoid
-#include <sys/stat.h>
-#undef __fxstat64
-
-#include <errno.h>
-#include <stddef.h>
-
-#include <xstatconv.h>
-
-#undef fstat
-
-/* Get information about the file descriptor FD in BUF. */
-int
-__fxstat (int vers, int fd, struct stat *buf)
-{
- nacl_abi_stat_t abi_buf;
- return NACL_CALL (__nacl_irt_fdio.fstat (fd, &abi_buf),
- __xstat_conv (vers, &abi_buf, buf));
-}
-hidden_def (__fxstat)
-weak_alias (__fxstat, _fxstat)
-
-strong_alias (__fxstat, __fxstat64)
-hidden_ver (__fxstat, __fxstat64)
diff --git a/sysdeps/nacl/fxstat64.c b/sysdeps/nacl/fxstat64.c
deleted file mode 100644
index 72aae12fe9..0000000000
--- a/sysdeps/nacl/fxstat64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* fxstat.c defines __fxstat64 as an alias. */
diff --git a/sysdeps/nacl/getcwd.c b/sysdeps/nacl/getcwd.c
deleted file mode 100644
index 85a7eb2244..0000000000
--- a/sysdeps/nacl/getcwd.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Get current working directory. NaCl version.
- Copyright (C) 2015-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 <limits.h>
-#include <stdlib.h>
-#include <nacl-interfaces.h>
-
-/* Get the pathname of the current working directory,
- and put it in SIZE bytes of BUF. Returns NULL if the
- directory couldn't be determined or SIZE was too small.
- If successful, returns BUF. In GNU, if BUF is NULL,
- an array is allocated with `malloc'; the array is SIZE
- bytes long, unless SIZE <= 0, in which case it is as
- big as necessary. */
-char *
-__getcwd (char *buf, size_t size)
-{
- char *use_buf = buf;
-
- if (buf == NULL)
- {
- if (size == 0)
- size = PATH_MAX;
- use_buf = malloc (size);
- if (__glibc_unlikely (use_buf == NULL))
- return NULL;
- }
-
- int error = __nacl_irt_dev_filename.getcwd (use_buf, size);
- if (__glibc_unlikely (error))
- {
- if (use_buf != buf)
- free (use_buf);
- errno = error;
- return NULL;
- }
-
- return use_buf;
-}
-weak_alias (__getcwd, getcwd)
diff --git a/sysdeps/nacl/getdents.c b/sysdeps/nacl/getdents.c
deleted file mode 100644
index ea248de583..0000000000
--- a/sysdeps/nacl/getdents.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Read directory entries from a file descriptor. NaCl version.
- Copyright (C) 2015-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 <dirent.h>
-#include <nacl-interfaces.h>
-
-ssize_t
-internal_function
-__getdents (int fd, char *buf, size_t nbytes)
-{
- size_t nread;
- return NACL_CALL (__nacl_irt_fdio.getdents (fd, (void *) buf, nbytes, &nread),
- nread);
-}
diff --git a/sysdeps/nacl/getdents64.c b/sysdeps/nacl/getdents64.c
deleted file mode 100644
index 730861899c..0000000000
--- a/sysdeps/nacl/getdents64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* We do not define a getdirentries or getdirentries64 entry point at all. */
diff --git a/sysdeps/nacl/getdtsz.c b/sysdeps/nacl/getdtsz.c
deleted file mode 100644
index 4eb91b7a64..0000000000
--- a/sysdeps/nacl/getdtsz.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* getdtablesize -- Return the limit on file descriptor values. NaCl version.
- Copyright (C) 2015-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>
-
-/* Return the maximum number of file descriptors
- the current process could possibly have. */
-int
-__getdtablesize (void)
-{
- /* There is no actual limit in NaCl, just memory. */
- return -1;
-}
-weak_alias (__getdtablesize, getdtablesize)
diff --git a/sysdeps/nacl/gethostname.c b/sysdeps/nacl/gethostname.c
deleted file mode 100644
index 098b84be10..0000000000
--- a/sysdeps/nacl/gethostname.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Get current host's name. NaCl version.
- Copyright (C) 2015-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 <string.h>
-#include <unistd.h>
-
-/* Put the name of the current host in no more than LEN bytes of NAME.
- The result is null-terminated if LEN is large enough for the full
- name and the terminator. */
-int
-__gethostname (char *name, size_t len)
-{
- static const char hostname[] = "naclhost";
-
- int result = 0;
- size_t copy = sizeof hostname;
-
- if (len < copy)
- {
- errno = ENAMETOOLONG;
- result = -1;
- copy = len;
- }
-
- memcpy (name, hostname, copy);
-
- return result;
-}
-weak_alias (__gethostname, gethostname)
diff --git a/sysdeps/nacl/getpagesize.c b/sysdeps/nacl/getpagesize.c
deleted file mode 100644
index 0be1ccf072..0000000000
--- a/sysdeps/nacl/getpagesize.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/getpagesize.c>
diff --git a/sysdeps/nacl/getpid.c b/sysdeps/nacl/getpid.c
deleted file mode 100644
index a2269a4c33..0000000000
--- a/sysdeps/nacl/getpid.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Get the process ID of the calling process. NaCl version.
- Copyright (C) 2015-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 <unistd.h>
-#include <nacl-interfaces.h>
-
-/* Get the process ID of the calling process. */
-pid_t
-__getpid (void)
-{
- int pid;
- return NACL_CALL (__nacl_irt_dev_getpid.getpid (&pid), pid);
-}
-libc_hidden_def (__getpid)
-weak_alias (__getpid, getpid)
-libc_hidden_weak (getpid)
diff --git a/sysdeps/nacl/getsysstats.c b/sysdeps/nacl/getsysstats.c
deleted file mode 100644
index 496b44b114..0000000000
--- a/sysdeps/nacl/getsysstats.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* getsysstats - Determine various system internal values. NaCl version.
- Copyright (C) 2015-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/sysinfo.h>
-#include <nacl-interfaces.h>
-
-#undef __native_client__
-#include "native_client/src/trusted/service_runtime/include/sys/unistd.h"
-
-
-int
-__get_nprocs_conf (void)
-{
- int nprocs;
- if (__nacl_irt_basic.sysconf (NACL_ABI__SC_NPROCESSORS_ONLN, &nprocs) != 0)
- /* On failure (which should be impossible), just report one processor. */
- nprocs = 1;
- return nprocs;
-}
-weak_alias (__get_nprocs_conf, get_nprocs_conf)
-
-int
-__get_nprocs (void)
-{
- return __get_nprocs_conf ();
-}
-weak_alias (__get_nprocs, get_nprocs)
-
-
-long int
-__get_phys_pages (void)
-{
- /* We have no general way to determine this value. */
- __set_errno (ENOSYS);
- return -1;
-}
-weak_alias (__get_phys_pages, get_phys_pages)
-stub_warning (get_phys_pages)
-
-
-long int
-__get_avphys_pages (void)
-{
- /* We have no general way to determine this value. */
- __set_errno (ENOSYS);
- return -1;
-}
-weak_alias (__get_avphys_pages, get_avphys_pages)
-stub_warning (get_avphys_pages)
diff --git a/sysdeps/nacl/gettimeofday.c b/sysdeps/nacl/gettimeofday.c
deleted file mode 100644
index fac54f7c47..0000000000
--- a/sysdeps/nacl/gettimeofday.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Get the current wall clock time. NaCl version.
- Copyright (C) 2015-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/time.h>
-#include <nacl-interfaces.h>
-
-
-/* Get the current time of day and timezone information,
- putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
- Returns 0 on success, -1 on errors. */
-int
-__gettimeofday (struct timeval *tv, struct timezone *tz)
-{
- if (__glibc_unlikely (tz != NULL))
- {
- tz->tz_minuteswest = 0;
- tz->tz_dsttime = 0;
- }
-
- return NACL_CALL (__nacl_irt_basic.gettod (tv), 0);
-}
-libc_hidden_def (__gettimeofday)
-weak_alias (__gettimeofday, gettimeofday)
-libc_hidden_weak (gettimeofday)
diff --git a/sysdeps/nacl/glob.c b/sysdeps/nacl/glob.c
deleted file mode 100644
index be2ee039a1..0000000000
--- a/sysdeps/nacl/glob.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Fetch the version that defines glob64 as an alias. */
-#include <sysdeps/wordsize-64/glob.c>
diff --git a/sysdeps/nacl/glob64.c b/sysdeps/nacl/glob64.c
deleted file mode 100644
index adca2d4a49..0000000000
--- a/sysdeps/nacl/glob64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/glob64.c>
diff --git a/sysdeps/nacl/ifaddrs.c b/sysdeps/nacl/ifaddrs.c
deleted file mode 100644
index 0e6485170b..0000000000
--- a/sysdeps/nacl/ifaddrs.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Bypass the sysdeps/gnu version to get the plain stub. */
-#include <inet/ifaddrs.c>
diff --git a/sysdeps/nacl/init-first.c b/sysdeps/nacl/init-first.c
deleted file mode 100644
index c1364f070b..0000000000
--- a/sysdeps/nacl/init-first.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Initialization code run first thing by the ELF startup code. NaCl version.
- Copyright (C) 2015-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 SHARED
-
-# include <nacl-interfaces.h>
-
-# define VDSO_SETUP __nacl_initialize_interfaces
-
-#endif
-
-#include <csu/init-first.c>
diff --git a/sysdeps/nacl/iofdopen.c b/sysdeps/nacl/iofdopen.c
deleted file mode 100644
index 9ddd9e0d3b..0000000000
--- a/sysdeps/nacl/iofdopen.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Open a stream from a file descriptor. NaCl version.
- Copyright (C) 2015-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>
-
-/* NaCl does not have a functioning fcntl, so don't use the stub and fail. */
-#undef F_GETFL
-#undef F_SETFL
-#define __fcntl(...) ???should not be called???
-
-#include <libio/iofdopen.c>
diff --git a/sysdeps/nacl/irt.sed b/sysdeps/nacl/irt.sed
deleted file mode 100644
index 0abe17701e..0000000000
--- a/sysdeps/nacl/irt.sed
+++ /dev/null
@@ -1,12 +0,0 @@
-# This sed script massages native_client/src/untrusted/irt/irt.h into
-# the nacl-irt.h used to build libc, by rewriting foo_t and struct bar
-# to nacl_abi_foo_t and nacl_abi_bar_t (and eliding forward declarations).
-# It doesn't perturb any struct CamelCaps cases, since such names will
-# be used only in NaCl-specific interfaces.
-/^struct \([a-z][a-z]*\);$/d
-/^#include "irt\.h"$/d
-/(/!b
-s/\([a-z0-9_][a-z0-9_]*\)_t\>/nacl_abi_\1_t/g
-s/struct \([a-z0-9_][a-z0-9_]*\)/nacl_abi_\1_t/g
-s/nacl_abi_\(u*int[3264ptr]*_t\)/\1/g
-s/nacl_abi_\(nacl_irt_\)/\1/g
diff --git a/sysdeps/nacl/isatty.c b/sysdeps/nacl/isatty.c
deleted file mode 100644
index 988403891f..0000000000
--- a/sysdeps/nacl/isatty.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Determine if a file descriptor refers to a terminal. NaCl version.
- Copyright (C) 2015-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 <unistd.h>
-#include <nacl-interfaces.h>
-
-/* Return 1 if FD is a terminal, 0 if not. */
-int
-__isatty (int fd)
-{
- int result;
- int error = __nacl_irt_dev_fdio.isatty (fd, &result);
- if (error == 0)
- {
- if (result)
- return 1;
- error = ENOTTY;
- }
- errno = error;
- return 0;
-}
-weak_alias (__isatty, isatty)
diff --git a/sysdeps/nacl/kernel-features.h b/sysdeps/nacl/kernel-features.h
deleted file mode 100644
index e27d2d4821..0000000000
--- a/sysdeps/nacl/kernel-features.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Set flags signalling availability of certain operating system features.
- Copyright (C) 2015-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 file can define __ASSUME_* macros checked by certain source files.
- Almost none of these are used outside of sysdeps/unix/sysv/linux code.
- But those referring to POSIX-level features like O_* flags can be. */
-
-#define __ASSUME_O_CLOEXEC 1
-
-/*
-#define __ASSUME_DUP3 1
-#define __ASSUME_ACCEPT4 1
-*/
diff --git a/sysdeps/nacl/ld.abilist b/sysdeps/nacl/ld.abilist
deleted file mode 100644
index 242f6d0723..0000000000
--- a/sysdeps/nacl/ld.abilist
+++ /dev/null
@@ -1,11 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 __libc_memalign F
-GLIBC_2.22 __libc_stack_end D 0x4
-GLIBC_2.22 __stack_chk_guard D 0x4
-GLIBC_2.22 __tls_get_addr F
-GLIBC_2.22 _dl_mcount F
-GLIBC_2.22 _r_debug D 0x14
-GLIBC_2.22 calloc F
-GLIBC_2.22 free F
-GLIBC_2.22 malloc F
-GLIBC_2.22 realloc F
diff --git a/sysdeps/nacl/ldsodefs.h b/sysdeps/nacl/ldsodefs.h
deleted file mode 100644
index bc7723a36e..0000000000
--- a/sysdeps/nacl/ldsodefs.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Run-time dynamic linker data structures for loaded ELF shared objects. NaCl.
- Copyright (C) 2015-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 _LDSODEFS_H
-
-/* Get the real definitions. */
-#include_next <ldsodefs.h>
-
-/* Now define our stuff. */
-
-/* We have the auxiliary vector. */
-#define HAVE_AUX_VECTOR 1
-
-/* Used by static binaries to check the auxiliary vector. */
-extern void _dl_aux_init (ElfW(auxv_t) *av) internal_function;
-
-/* Initialization which is normally done by the dynamic linker. */
-extern void _dl_non_dynamic_init (void) internal_function;
-
-#endif /* ldsodefs.h */
diff --git a/sysdeps/nacl/libBrokenLocale.abilist b/sysdeps/nacl/libBrokenLocale.abilist
deleted file mode 100644
index 4c14da7995..0000000000
--- a/sysdeps/nacl/libBrokenLocale.abilist
+++ /dev/null
@@ -1,2 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 __ctype_get_mb_cur_max F
diff --git a/sysdeps/nacl/libanl.abilist b/sysdeps/nacl/libanl.abilist
deleted file mode 100644
index ab6f9d2b40..0000000000
--- a/sysdeps/nacl/libanl.abilist
+++ /dev/null
@@ -1,5 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 gai_cancel F
-GLIBC_2.22 gai_error F
-GLIBC_2.22 gai_suspend F
-GLIBC_2.22 getaddrinfo_a F
diff --git a/sysdeps/nacl/libc-start.c b/sysdeps/nacl/libc-start.c
deleted file mode 100644
index dadd18037a..0000000000
--- a/sysdeps/nacl/libc-start.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* We can compute the location of auxv without a loop, so we might as well
- pass it in. */
-#define LIBC_START_MAIN_AUXVEC_ARG
-#include <csu/libc-start.c>
diff --git a/sysdeps/nacl/libcrypt.abilist b/sysdeps/nacl/libcrypt.abilist
deleted file mode 100644
index 9bb645fe60..0000000000
--- a/sysdeps/nacl/libcrypt.abilist
+++ /dev/null
@@ -1,8 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 crypt F
-GLIBC_2.22 crypt_r F
-GLIBC_2.22 encrypt F
-GLIBC_2.22 encrypt_r F
-GLIBC_2.22 fcrypt F
-GLIBC_2.22 setkey F
-GLIBC_2.22 setkey_r F
diff --git a/sysdeps/nacl/libdl.abilist b/sysdeps/nacl/libdl.abilist
deleted file mode 100644
index 863946ef7b..0000000000
--- a/sysdeps/nacl/libdl.abilist
+++ /dev/null
@@ -1,10 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 dladdr F
-GLIBC_2.22 dladdr1 F
-GLIBC_2.22 dlclose F
-GLIBC_2.22 dlerror F
-GLIBC_2.22 dlinfo F
-GLIBC_2.22 dlmopen F
-GLIBC_2.22 dlopen F
-GLIBC_2.22 dlsym F
-GLIBC_2.22 dlvsym F
diff --git a/sysdeps/nacl/libm.abilist b/sysdeps/nacl/libm.abilist
deleted file mode 100644
index 055b0b25ba..0000000000
--- a/sysdeps/nacl/libm.abilist
+++ /dev/null
@@ -1,374 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 _LIB_VERSION D 0x4
-GLIBC_2.22 __acos_finite F
-GLIBC_2.22 __acosf_finite F
-GLIBC_2.22 __acosh_finite F
-GLIBC_2.22 __acoshf_finite F
-GLIBC_2.22 __asin_finite F
-GLIBC_2.22 __asinf_finite F
-GLIBC_2.22 __atan2_finite F
-GLIBC_2.22 __atan2f_finite F
-GLIBC_2.22 __atanh_finite F
-GLIBC_2.22 __atanhf_finite F
-GLIBC_2.22 __clog10 F
-GLIBC_2.22 __clog10f F
-GLIBC_2.22 __clog10l F
-GLIBC_2.22 __cosh_finite F
-GLIBC_2.22 __coshf_finite F
-GLIBC_2.22 __exp10_finite F
-GLIBC_2.22 __exp10f_finite F
-GLIBC_2.22 __exp2_finite F
-GLIBC_2.22 __exp2f_finite F
-GLIBC_2.22 __exp_finite F
-GLIBC_2.22 __expf_finite F
-GLIBC_2.22 __finite F
-GLIBC_2.22 __finitef F
-GLIBC_2.22 __finitel F
-GLIBC_2.22 __fmod_finite F
-GLIBC_2.22 __fmodf_finite F
-GLIBC_2.22 __fpclassify F
-GLIBC_2.22 __fpclassifyf F
-GLIBC_2.22 __gamma_r_finite F
-GLIBC_2.22 __gammaf_r_finite F
-GLIBC_2.22 __hypot_finite F
-GLIBC_2.22 __hypotf_finite F
-GLIBC_2.22 __issignaling F
-GLIBC_2.22 __issignalingf F
-GLIBC_2.22 __j0_finite F
-GLIBC_2.22 __j0f_finite F
-GLIBC_2.22 __j1_finite F
-GLIBC_2.22 __j1f_finite F
-GLIBC_2.22 __jn_finite F
-GLIBC_2.22 __jnf_finite F
-GLIBC_2.22 __lgamma_r_finite F
-GLIBC_2.22 __lgammaf_r_finite F
-GLIBC_2.22 __log10_finite F
-GLIBC_2.22 __log10f_finite F
-GLIBC_2.22 __log2_finite F
-GLIBC_2.22 __log2f_finite F
-GLIBC_2.22 __log_finite F
-GLIBC_2.22 __logf_finite F
-GLIBC_2.22 __pow_finite F
-GLIBC_2.22 __powf_finite F
-GLIBC_2.22 __remainder_finite F
-GLIBC_2.22 __remainderf_finite F
-GLIBC_2.22 __scalb_finite F
-GLIBC_2.22 __scalbf_finite F
-GLIBC_2.22 __signbit F
-GLIBC_2.22 __signbitf F
-GLIBC_2.22 __sinh_finite F
-GLIBC_2.22 __sinhf_finite F
-GLIBC_2.22 __sqrt_finite F
-GLIBC_2.22 __sqrtf_finite F
-GLIBC_2.22 __y0_finite F
-GLIBC_2.22 __y0f_finite F
-GLIBC_2.22 __y1_finite F
-GLIBC_2.22 __y1f_finite F
-GLIBC_2.22 __yn_finite F
-GLIBC_2.22 __ynf_finite F
-GLIBC_2.22 acos F
-GLIBC_2.22 acosf F
-GLIBC_2.22 acosh F
-GLIBC_2.22 acoshf F
-GLIBC_2.22 acoshl F
-GLIBC_2.22 acosl F
-GLIBC_2.22 asin F
-GLIBC_2.22 asinf F
-GLIBC_2.22 asinh F
-GLIBC_2.22 asinhf F
-GLIBC_2.22 asinhl F
-GLIBC_2.22 asinl F
-GLIBC_2.22 atan F
-GLIBC_2.22 atan2 F
-GLIBC_2.22 atan2f F
-GLIBC_2.22 atan2l F
-GLIBC_2.22 atanf F
-GLIBC_2.22 atanh F
-GLIBC_2.22 atanhf F
-GLIBC_2.22 atanhl F
-GLIBC_2.22 atanl F
-GLIBC_2.22 cabs F
-GLIBC_2.22 cabsf F
-GLIBC_2.22 cabsl F
-GLIBC_2.22 cacos F
-GLIBC_2.22 cacosf F
-GLIBC_2.22 cacosh F
-GLIBC_2.22 cacoshf F
-GLIBC_2.22 cacoshl F
-GLIBC_2.22 cacosl F
-GLIBC_2.22 carg F
-GLIBC_2.22 cargf F
-GLIBC_2.22 cargl F
-GLIBC_2.22 casin F
-GLIBC_2.22 casinf F
-GLIBC_2.22 casinh F
-GLIBC_2.22 casinhf F
-GLIBC_2.22 casinhl F
-GLIBC_2.22 casinl F
-GLIBC_2.22 catan F
-GLIBC_2.22 catanf F
-GLIBC_2.22 catanh F
-GLIBC_2.22 catanhf F
-GLIBC_2.22 catanhl F
-GLIBC_2.22 catanl F
-GLIBC_2.22 cbrt F
-GLIBC_2.22 cbrtf F
-GLIBC_2.22 cbrtl F
-GLIBC_2.22 ccos F
-GLIBC_2.22 ccosf F
-GLIBC_2.22 ccosh F
-GLIBC_2.22 ccoshf F
-GLIBC_2.22 ccoshl F
-GLIBC_2.22 ccosl F
-GLIBC_2.22 ceil F
-GLIBC_2.22 ceilf F
-GLIBC_2.22 ceill F
-GLIBC_2.22 cexp F
-GLIBC_2.22 cexpf F
-GLIBC_2.22 cexpl F
-GLIBC_2.22 cimag F
-GLIBC_2.22 cimagf F
-GLIBC_2.22 cimagl F
-GLIBC_2.22 clog F
-GLIBC_2.22 clog10 F
-GLIBC_2.22 clog10f F
-GLIBC_2.22 clog10l F
-GLIBC_2.22 clogf F
-GLIBC_2.22 clogl F
-GLIBC_2.22 conj F
-GLIBC_2.22 conjf F
-GLIBC_2.22 conjl F
-GLIBC_2.22 copysign F
-GLIBC_2.22 copysignf F
-GLIBC_2.22 copysignl F
-GLIBC_2.22 cos F
-GLIBC_2.22 cosf F
-GLIBC_2.22 cosh F
-GLIBC_2.22 coshf F
-GLIBC_2.22 coshl F
-GLIBC_2.22 cosl F
-GLIBC_2.22 cpow F
-GLIBC_2.22 cpowf F
-GLIBC_2.22 cpowl F
-GLIBC_2.22 cproj F
-GLIBC_2.22 cprojf F
-GLIBC_2.22 cprojl F
-GLIBC_2.22 creal F
-GLIBC_2.22 crealf F
-GLIBC_2.22 creall F
-GLIBC_2.22 csin F
-GLIBC_2.22 csinf F
-GLIBC_2.22 csinh F
-GLIBC_2.22 csinhf F
-GLIBC_2.22 csinhl F
-GLIBC_2.22 csinl F
-GLIBC_2.22 csqrt F
-GLIBC_2.22 csqrtf F
-GLIBC_2.22 csqrtl F
-GLIBC_2.22 ctan F
-GLIBC_2.22 ctanf F
-GLIBC_2.22 ctanh F
-GLIBC_2.22 ctanhf F
-GLIBC_2.22 ctanhl F
-GLIBC_2.22 ctanl F
-GLIBC_2.22 drem F
-GLIBC_2.22 dremf F
-GLIBC_2.22 dreml F
-GLIBC_2.22 erf F
-GLIBC_2.22 erfc F
-GLIBC_2.22 erfcf F
-GLIBC_2.22 erfcl F
-GLIBC_2.22 erff F
-GLIBC_2.22 erfl F
-GLIBC_2.22 exp F
-GLIBC_2.22 exp10 F
-GLIBC_2.22 exp10f F
-GLIBC_2.22 exp10l F
-GLIBC_2.22 exp2 F
-GLIBC_2.22 exp2f F
-GLIBC_2.22 exp2l F
-GLIBC_2.22 expf F
-GLIBC_2.22 expl F
-GLIBC_2.22 expm1 F
-GLIBC_2.22 expm1f F
-GLIBC_2.22 expm1l F
-GLIBC_2.22 fabs F
-GLIBC_2.22 fabsf F
-GLIBC_2.22 fabsl F
-GLIBC_2.22 fdim F
-GLIBC_2.22 fdimf F
-GLIBC_2.22 fdiml F
-GLIBC_2.22 feclearexcept F
-GLIBC_2.22 fedisableexcept F
-GLIBC_2.22 feenableexcept F
-GLIBC_2.22 fegetenv F
-GLIBC_2.22 fegetexcept F
-GLIBC_2.22 fegetexceptflag F
-GLIBC_2.22 fegetround F
-GLIBC_2.22 feholdexcept F
-GLIBC_2.22 feraiseexcept F
-GLIBC_2.22 fesetenv F
-GLIBC_2.22 fesetexceptflag F
-GLIBC_2.22 fesetround F
-GLIBC_2.22 fetestexcept F
-GLIBC_2.22 feupdateenv F
-GLIBC_2.22 finite F
-GLIBC_2.22 finitef F
-GLIBC_2.22 finitel F
-GLIBC_2.22 floor F
-GLIBC_2.22 floorf F
-GLIBC_2.22 floorl F
-GLIBC_2.22 fma F
-GLIBC_2.22 fmaf F
-GLIBC_2.22 fmal F
-GLIBC_2.22 fmax F
-GLIBC_2.22 fmaxf F
-GLIBC_2.22 fmaxl F
-GLIBC_2.22 fmin F
-GLIBC_2.22 fminf F
-GLIBC_2.22 fminl F
-GLIBC_2.22 fmod F
-GLIBC_2.22 fmodf F
-GLIBC_2.22 fmodl F
-GLIBC_2.22 frexp F
-GLIBC_2.22 frexpf F
-GLIBC_2.22 frexpl F
-GLIBC_2.22 gamma F
-GLIBC_2.22 gammaf F
-GLIBC_2.22 gammal F
-GLIBC_2.22 hypot F
-GLIBC_2.22 hypotf F
-GLIBC_2.22 hypotl F
-GLIBC_2.22 ilogb F
-GLIBC_2.22 ilogbf F
-GLIBC_2.22 ilogbl F
-GLIBC_2.22 j0 F
-GLIBC_2.22 j0f F
-GLIBC_2.22 j0l F
-GLIBC_2.22 j1 F
-GLIBC_2.22 j1f F
-GLIBC_2.22 j1l F
-GLIBC_2.22 jn F
-GLIBC_2.22 jnf F
-GLIBC_2.22 jnl F
-GLIBC_2.22 ldexp F
-GLIBC_2.22 ldexpf F
-GLIBC_2.22 ldexpl F
-GLIBC_2.22 lgamma F
-GLIBC_2.22 lgamma_r F
-GLIBC_2.22 lgammaf F
-GLIBC_2.22 lgammaf_r F
-GLIBC_2.22 lgammal F
-GLIBC_2.22 lgammal_r F
-GLIBC_2.22 llrint F
-GLIBC_2.22 llrintf F
-GLIBC_2.22 llrintl F
-GLIBC_2.22 llround F
-GLIBC_2.22 llroundf F
-GLIBC_2.22 llroundl F
-GLIBC_2.22 log F
-GLIBC_2.22 log10 F
-GLIBC_2.22 log10f F
-GLIBC_2.22 log10l F
-GLIBC_2.22 log1p F
-GLIBC_2.22 log1pf F
-GLIBC_2.22 log1pl F
-GLIBC_2.22 log2 F
-GLIBC_2.22 log2f F
-GLIBC_2.22 log2l F
-GLIBC_2.22 logb F
-GLIBC_2.22 logbf F
-GLIBC_2.22 logbl F
-GLIBC_2.22 logf F
-GLIBC_2.22 logl F
-GLIBC_2.22 lrint F
-GLIBC_2.22 lrintf F
-GLIBC_2.22 lrintl F
-GLIBC_2.22 lround F
-GLIBC_2.22 lroundf F
-GLIBC_2.22 lroundl F
-GLIBC_2.22 matherr F
-GLIBC_2.22 modf F
-GLIBC_2.22 modff F
-GLIBC_2.22 modfl F
-GLIBC_2.22 nan F
-GLIBC_2.22 nanf F
-GLIBC_2.22 nanl F
-GLIBC_2.22 nearbyint F
-GLIBC_2.22 nearbyintf F
-GLIBC_2.22 nearbyintl F
-GLIBC_2.22 nextafter F
-GLIBC_2.22 nextafterf F
-GLIBC_2.22 nextafterl F
-GLIBC_2.22 nexttoward F
-GLIBC_2.22 nexttowardf F
-GLIBC_2.22 nexttowardl F
-GLIBC_2.22 pow F
-GLIBC_2.22 pow10 F
-GLIBC_2.22 pow10f F
-GLIBC_2.22 pow10l F
-GLIBC_2.22 powf F
-GLIBC_2.22 powl F
-GLIBC_2.22 remainder F
-GLIBC_2.22 remainderf F
-GLIBC_2.22 remainderl F
-GLIBC_2.22 remquo F
-GLIBC_2.22 remquof F
-GLIBC_2.22 remquol F
-GLIBC_2.22 rint F
-GLIBC_2.22 rintf F
-GLIBC_2.22 rintl F
-GLIBC_2.22 round F
-GLIBC_2.22 roundf F
-GLIBC_2.22 roundl F
-GLIBC_2.22 scalb F
-GLIBC_2.22 scalbf F
-GLIBC_2.22 scalbl F
-GLIBC_2.22 scalbln F
-GLIBC_2.22 scalblnf F
-GLIBC_2.22 scalblnl F
-GLIBC_2.22 scalbn F
-GLIBC_2.22 scalbnf F
-GLIBC_2.22 scalbnl F
-GLIBC_2.22 signgam D 0x4
-GLIBC_2.22 significand F
-GLIBC_2.22 significandf F
-GLIBC_2.22 significandl F
-GLIBC_2.22 sin F
-GLIBC_2.22 sincos F
-GLIBC_2.22 sincosf F
-GLIBC_2.22 sincosl F
-GLIBC_2.22 sinf F
-GLIBC_2.22 sinh F
-GLIBC_2.22 sinhf F
-GLIBC_2.22 sinhl F
-GLIBC_2.22 sinl F
-GLIBC_2.22 sqrt F
-GLIBC_2.22 sqrtf F
-GLIBC_2.22 sqrtl F
-GLIBC_2.22 tan F
-GLIBC_2.22 tanf F
-GLIBC_2.22 tanh F
-GLIBC_2.22 tanhf F
-GLIBC_2.22 tanhl F
-GLIBC_2.22 tanl F
-GLIBC_2.22 tgamma F
-GLIBC_2.22 tgammaf F
-GLIBC_2.22 tgammal F
-GLIBC_2.22 trunc F
-GLIBC_2.22 truncf F
-GLIBC_2.22 truncl F
-GLIBC_2.22 y0 F
-GLIBC_2.22 y0f F
-GLIBC_2.22 y0l F
-GLIBC_2.22 y1 F
-GLIBC_2.22 y1f F
-GLIBC_2.22 y1l F
-GLIBC_2.22 yn F
-GLIBC_2.22 ynf F
-GLIBC_2.22 ynl F
-GLIBC_2.23 GLIBC_2.23 A
-GLIBC_2.23 __signgam D 0x4
-GLIBC_2.23 lgamma F
-GLIBC_2.23 lgammaf F
-GLIBC_2.23 lgammal F
diff --git a/sysdeps/nacl/libpthread.abilist b/sysdeps/nacl/libpthread.abilist
deleted file mode 100644
index 8f0099cb2f..0000000000
--- a/sysdeps/nacl/libpthread.abilist
+++ /dev/null
@@ -1,175 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 _IO_flockfile F
-GLIBC_2.22 _IO_ftrylockfile F
-GLIBC_2.22 _IO_funlockfile F
-GLIBC_2.22 __errno_location F
-GLIBC_2.22 __h_errno_location F
-GLIBC_2.22 __libc_allocate_rtsig F
-GLIBC_2.22 __libc_current_sigrtmax F
-GLIBC_2.22 __libc_current_sigrtmin F
-GLIBC_2.22 __pthread_cleanup_routine F
-GLIBC_2.22 __pthread_getspecific F
-GLIBC_2.22 __pthread_key_create F
-GLIBC_2.22 __pthread_mutex_destroy F
-GLIBC_2.22 __pthread_mutex_init F
-GLIBC_2.22 __pthread_mutex_lock F
-GLIBC_2.22 __pthread_mutex_trylock F
-GLIBC_2.22 __pthread_mutex_unlock F
-GLIBC_2.22 __pthread_mutexattr_destroy F
-GLIBC_2.22 __pthread_mutexattr_init F
-GLIBC_2.22 __pthread_mutexattr_settype F
-GLIBC_2.22 __pthread_once F
-GLIBC_2.22 __pthread_register_cancel F
-GLIBC_2.22 __pthread_register_cancel_defer F
-GLIBC_2.22 __pthread_rwlock_destroy F
-GLIBC_2.22 __pthread_rwlock_init F
-GLIBC_2.22 __pthread_rwlock_rdlock F
-GLIBC_2.22 __pthread_rwlock_tryrdlock F
-GLIBC_2.22 __pthread_rwlock_trywrlock F
-GLIBC_2.22 __pthread_rwlock_unlock F
-GLIBC_2.22 __pthread_rwlock_wrlock F
-GLIBC_2.22 __pthread_setspecific F
-GLIBC_2.22 __pthread_unregister_cancel F
-GLIBC_2.22 __pthread_unregister_cancel_restore F
-GLIBC_2.22 __pthread_unwind_next F
-GLIBC_2.22 __res_state F
-GLIBC_2.22 _pthread_cleanup_pop F
-GLIBC_2.22 _pthread_cleanup_pop_restore F
-GLIBC_2.22 _pthread_cleanup_push F
-GLIBC_2.22 _pthread_cleanup_push_defer F
-GLIBC_2.22 flockfile F
-GLIBC_2.22 ftrylockfile F
-GLIBC_2.22 funlockfile F
-GLIBC_2.22 pthread_attr_destroy F
-GLIBC_2.22 pthread_attr_getaffinity_np F
-GLIBC_2.22 pthread_attr_getdetachstate F
-GLIBC_2.22 pthread_attr_getguardsize F
-GLIBC_2.22 pthread_attr_getinheritsched F
-GLIBC_2.22 pthread_attr_getschedparam F
-GLIBC_2.22 pthread_attr_getschedpolicy F
-GLIBC_2.22 pthread_attr_getscope F
-GLIBC_2.22 pthread_attr_getstack F
-GLIBC_2.22 pthread_attr_getstackaddr F
-GLIBC_2.22 pthread_attr_getstacksize F
-GLIBC_2.22 pthread_attr_init F
-GLIBC_2.22 pthread_attr_setaffinity_np F
-GLIBC_2.22 pthread_attr_setdetachstate F
-GLIBC_2.22 pthread_attr_setguardsize F
-GLIBC_2.22 pthread_attr_setinheritsched F
-GLIBC_2.22 pthread_attr_setschedparam F
-GLIBC_2.22 pthread_attr_setschedpolicy F
-GLIBC_2.22 pthread_attr_setscope F
-GLIBC_2.22 pthread_attr_setstack F
-GLIBC_2.22 pthread_attr_setstackaddr F
-GLIBC_2.22 pthread_attr_setstacksize F
-GLIBC_2.22 pthread_barrier_destroy F
-GLIBC_2.22 pthread_barrier_init F
-GLIBC_2.22 pthread_barrier_wait F
-GLIBC_2.22 pthread_barrierattr_destroy F
-GLIBC_2.22 pthread_barrierattr_getpshared F
-GLIBC_2.22 pthread_barrierattr_init F
-GLIBC_2.22 pthread_barrierattr_setpshared F
-GLIBC_2.22 pthread_cancel F
-GLIBC_2.22 pthread_cond_broadcast F
-GLIBC_2.22 pthread_cond_destroy F
-GLIBC_2.22 pthread_cond_init F
-GLIBC_2.22 pthread_cond_signal F
-GLIBC_2.22 pthread_cond_timedwait F
-GLIBC_2.22 pthread_cond_wait F
-GLIBC_2.22 pthread_condattr_destroy F
-GLIBC_2.22 pthread_condattr_getclock F
-GLIBC_2.22 pthread_condattr_getpshared F
-GLIBC_2.22 pthread_condattr_init F
-GLIBC_2.22 pthread_condattr_setclock F
-GLIBC_2.22 pthread_condattr_setpshared F
-GLIBC_2.22 pthread_create F
-GLIBC_2.22 pthread_detach F
-GLIBC_2.22 pthread_equal F
-GLIBC_2.22 pthread_exit F
-GLIBC_2.22 pthread_getaffinity_np F
-GLIBC_2.22 pthread_getattr_default_np F
-GLIBC_2.22 pthread_getattr_np F
-GLIBC_2.22 pthread_getconcurrency F
-GLIBC_2.22 pthread_getcpuclockid F
-GLIBC_2.22 pthread_getname_np F
-GLIBC_2.22 pthread_getschedparam F
-GLIBC_2.22 pthread_getspecific F
-GLIBC_2.22 pthread_join F
-GLIBC_2.22 pthread_key_create F
-GLIBC_2.22 pthread_key_delete F
-GLIBC_2.22 pthread_kill F
-GLIBC_2.22 pthread_kill_other_threads_np F
-GLIBC_2.22 pthread_mutex_consistent F
-GLIBC_2.22 pthread_mutex_consistent_np F
-GLIBC_2.22 pthread_mutex_destroy F
-GLIBC_2.22 pthread_mutex_getprioceiling F
-GLIBC_2.22 pthread_mutex_init F
-GLIBC_2.22 pthread_mutex_lock F
-GLIBC_2.22 pthread_mutex_setprioceiling F
-GLIBC_2.22 pthread_mutex_timedlock F
-GLIBC_2.22 pthread_mutex_trylock F
-GLIBC_2.22 pthread_mutex_unlock F
-GLIBC_2.22 pthread_mutexattr_destroy F
-GLIBC_2.22 pthread_mutexattr_getkind_np F
-GLIBC_2.22 pthread_mutexattr_getprioceiling F
-GLIBC_2.22 pthread_mutexattr_getprotocol F
-GLIBC_2.22 pthread_mutexattr_getpshared F
-GLIBC_2.22 pthread_mutexattr_getrobust F
-GLIBC_2.22 pthread_mutexattr_getrobust_np F
-GLIBC_2.22 pthread_mutexattr_gettype F
-GLIBC_2.22 pthread_mutexattr_init F
-GLIBC_2.22 pthread_mutexattr_setkind_np F
-GLIBC_2.22 pthread_mutexattr_setprioceiling F
-GLIBC_2.22 pthread_mutexattr_setprotocol F
-GLIBC_2.22 pthread_mutexattr_setpshared F
-GLIBC_2.22 pthread_mutexattr_setrobust F
-GLIBC_2.22 pthread_mutexattr_setrobust_np F
-GLIBC_2.22 pthread_mutexattr_settype F
-GLIBC_2.22 pthread_once F
-GLIBC_2.22 pthread_rwlock_destroy F
-GLIBC_2.22 pthread_rwlock_init F
-GLIBC_2.22 pthread_rwlock_rdlock F
-GLIBC_2.22 pthread_rwlock_timedrdlock F
-GLIBC_2.22 pthread_rwlock_timedwrlock F
-GLIBC_2.22 pthread_rwlock_tryrdlock F
-GLIBC_2.22 pthread_rwlock_trywrlock F
-GLIBC_2.22 pthread_rwlock_unlock F
-GLIBC_2.22 pthread_rwlock_wrlock F
-GLIBC_2.22 pthread_rwlockattr_destroy F
-GLIBC_2.22 pthread_rwlockattr_getkind_np F
-GLIBC_2.22 pthread_rwlockattr_getpshared F
-GLIBC_2.22 pthread_rwlockattr_init F
-GLIBC_2.22 pthread_rwlockattr_setkind_np F
-GLIBC_2.22 pthread_rwlockattr_setpshared F
-GLIBC_2.22 pthread_self F
-GLIBC_2.22 pthread_setaffinity_np F
-GLIBC_2.22 pthread_setattr_default_np F
-GLIBC_2.22 pthread_setcancelstate F
-GLIBC_2.22 pthread_setcanceltype F
-GLIBC_2.22 pthread_setconcurrency F
-GLIBC_2.22 pthread_setname_np F
-GLIBC_2.22 pthread_setschedparam F
-GLIBC_2.22 pthread_setschedprio F
-GLIBC_2.22 pthread_setspecific F
-GLIBC_2.22 pthread_sigmask F
-GLIBC_2.22 pthread_sigqueue F
-GLIBC_2.22 pthread_spin_destroy F
-GLIBC_2.22 pthread_spin_init F
-GLIBC_2.22 pthread_spin_lock F
-GLIBC_2.22 pthread_spin_trylock F
-GLIBC_2.22 pthread_spin_unlock F
-GLIBC_2.22 pthread_testcancel F
-GLIBC_2.22 pthread_timedjoin_np F
-GLIBC_2.22 pthread_tryjoin_np F
-GLIBC_2.22 pthread_yield F
-GLIBC_2.22 raise F
-GLIBC_2.22 sem_close F
-GLIBC_2.22 sem_destroy F
-GLIBC_2.22 sem_getvalue F
-GLIBC_2.22 sem_init F
-GLIBC_2.22 sem_open F
-GLIBC_2.22 sem_post F
-GLIBC_2.22 sem_timedwait F
-GLIBC_2.22 sem_trywait F
-GLIBC_2.22 sem_unlink F
-GLIBC_2.22 sem_wait F
diff --git a/sysdeps/nacl/libresolv.abilist b/sysdeps/nacl/libresolv.abilist
deleted file mode 100644
index 03f6bc211a..0000000000
--- a/sysdeps/nacl/libresolv.abilist
+++ /dev/null
@@ -1,92 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 __b64_ntop F
-GLIBC_2.22 __b64_pton F
-GLIBC_2.22 __dn_comp F
-GLIBC_2.22 __dn_count_labels F
-GLIBC_2.22 __dn_expand F
-GLIBC_2.22 __dn_skipname F
-GLIBC_2.22 __fp_nquery F
-GLIBC_2.22 __fp_query F
-GLIBC_2.22 __fp_resstat F
-GLIBC_2.22 __hostalias F
-GLIBC_2.22 __loc_aton F
-GLIBC_2.22 __loc_ntoa F
-GLIBC_2.22 __p_cdname F
-GLIBC_2.22 __p_cdnname F
-GLIBC_2.22 __p_class F
-GLIBC_2.22 __p_class_syms D 0x54
-GLIBC_2.22 __p_fqname F
-GLIBC_2.22 __p_fqnname F
-GLIBC_2.22 __p_option F
-GLIBC_2.22 __p_query F
-GLIBC_2.22 __p_rcode F
-GLIBC_2.22 __p_secstodate F
-GLIBC_2.22 __p_time F
-GLIBC_2.22 __p_type F
-GLIBC_2.22 __p_type_syms D 0x228
-GLIBC_2.22 __putlong F
-GLIBC_2.22 __putshort F
-GLIBC_2.22 __res_close F
-GLIBC_2.22 __res_dnok F
-GLIBC_2.22 __res_hnok F
-GLIBC_2.22 __res_hostalias F
-GLIBC_2.22 __res_isourserver F
-GLIBC_2.22 __res_mailok F
-GLIBC_2.22 __res_mkquery F
-GLIBC_2.22 __res_nameinquery F
-GLIBC_2.22 __res_nmkquery F
-GLIBC_2.22 __res_nquery F
-GLIBC_2.22 __res_nquerydomain F
-GLIBC_2.22 __res_nsearch F
-GLIBC_2.22 __res_nsend F
-GLIBC_2.22 __res_ownok F
-GLIBC_2.22 __res_queriesmatch F
-GLIBC_2.22 __res_query F
-GLIBC_2.22 __res_querydomain F
-GLIBC_2.22 __res_search F
-GLIBC_2.22 __res_send F
-GLIBC_2.22 __sym_ntop F
-GLIBC_2.22 __sym_ntos F
-GLIBC_2.22 __sym_ston F
-GLIBC_2.22 _gethtbyaddr F
-GLIBC_2.22 _gethtbyname F
-GLIBC_2.22 _gethtbyname2 F
-GLIBC_2.22 _gethtent F
-GLIBC_2.22 _getlong F
-GLIBC_2.22 _getshort F
-GLIBC_2.22 _res_opcodes D 0x40
-GLIBC_2.22 _sethtent F
-GLIBC_2.22 inet_net_ntop F
-GLIBC_2.22 inet_net_pton F
-GLIBC_2.22 inet_neta F
-GLIBC_2.22 ns_datetosecs F
-GLIBC_2.22 ns_format_ttl F
-GLIBC_2.22 ns_get16 F
-GLIBC_2.22 ns_get32 F
-GLIBC_2.22 ns_initparse F
-GLIBC_2.22 ns_makecanon F
-GLIBC_2.22 ns_msg_getflag F
-GLIBC_2.22 ns_name_compress F
-GLIBC_2.22 ns_name_ntol F
-GLIBC_2.22 ns_name_ntop F
-GLIBC_2.22 ns_name_pack F
-GLIBC_2.22 ns_name_pton F
-GLIBC_2.22 ns_name_rollback F
-GLIBC_2.22 ns_name_skip F
-GLIBC_2.22 ns_name_uncompress F
-GLIBC_2.22 ns_name_unpack F
-GLIBC_2.22 ns_parse_ttl F
-GLIBC_2.22 ns_parserr F
-GLIBC_2.22 ns_put16 F
-GLIBC_2.22 ns_put32 F
-GLIBC_2.22 ns_samedomain F
-GLIBC_2.22 ns_samename F
-GLIBC_2.22 ns_skiprr F
-GLIBC_2.22 ns_sprintrr F
-GLIBC_2.22 ns_sprintrrf F
-GLIBC_2.22 ns_subdomain F
-GLIBC_2.22 res_gethostbyaddr F
-GLIBC_2.22 res_gethostbyname F
-GLIBC_2.22 res_gethostbyname2 F
-GLIBC_2.22 res_send_setqhook F
-GLIBC_2.22 res_send_setrhook F
diff --git a/sysdeps/nacl/librt.abilist b/sysdeps/nacl/librt.abilist
deleted file mode 100644
index 58a05aad05..0000000000
--- a/sysdeps/nacl/librt.abilist
+++ /dev/null
@@ -1,36 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 __mq_open_2 F
-GLIBC_2.22 aio_cancel F
-GLIBC_2.22 aio_cancel64 F
-GLIBC_2.22 aio_error F
-GLIBC_2.22 aio_error64 F
-GLIBC_2.22 aio_fsync F
-GLIBC_2.22 aio_fsync64 F
-GLIBC_2.22 aio_init F
-GLIBC_2.22 aio_read F
-GLIBC_2.22 aio_read64 F
-GLIBC_2.22 aio_return F
-GLIBC_2.22 aio_return64 F
-GLIBC_2.22 aio_suspend F
-GLIBC_2.22 aio_suspend64 F
-GLIBC_2.22 aio_write F
-GLIBC_2.22 aio_write64 F
-GLIBC_2.22 lio_listio F
-GLIBC_2.22 lio_listio64 F
-GLIBC_2.22 mq_close F
-GLIBC_2.22 mq_getattr F
-GLIBC_2.22 mq_notify F
-GLIBC_2.22 mq_open F
-GLIBC_2.22 mq_receive F
-GLIBC_2.22 mq_send F
-GLIBC_2.22 mq_setattr F
-GLIBC_2.22 mq_timedreceive F
-GLIBC_2.22 mq_timedsend F
-GLIBC_2.22 mq_unlink F
-GLIBC_2.22 shm_open F
-GLIBC_2.22 shm_unlink F
-GLIBC_2.22 timer_create F
-GLIBC_2.22 timer_delete F
-GLIBC_2.22 timer_getoverrun F
-GLIBC_2.22 timer_gettime F
-GLIBC_2.22 timer_settime F
diff --git a/sysdeps/nacl/libutil.abilist b/sysdeps/nacl/libutil.abilist
deleted file mode 100644
index 080dd1e57b..0000000000
--- a/sysdeps/nacl/libutil.abilist
+++ /dev/null
@@ -1,7 +0,0 @@
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 forkpty F
-GLIBC_2.22 login F
-GLIBC_2.22 login_tty F
-GLIBC_2.22 logout F
-GLIBC_2.22 logwtmp F
-GLIBC_2.22 openpty F
diff --git a/sysdeps/nacl/link.c b/sysdeps/nacl/link.c
deleted file mode 100644
index 1310dc461b..0000000000
--- a/sysdeps/nacl/link.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Make a hard link. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Make a link to FROM called TO. */
-int
-__link (const char *from, const char *to)
-{
- return NACL_CALL (__nacl_irt_dev_filename.link (from, to), 0);
-}
-weak_alias (__link, link)
diff --git a/sysdeps/nacl/lll_timedlock_wait.c b/sysdeps/nacl/lll_timedlock_wait.c
deleted file mode 100644
index d9f177291f..0000000000
--- a/sysdeps/nacl/lll_timedlock_wait.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Timed low level locking for pthread library. NaCl version.
- Copyright (C) 2015-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 <assert.h>
-#include <atomic.h>
-#include <errno.h>
-#include <lowlevellock.h>
-#include <sys/time.h>
-
-
-/* This behaves the same as the generic version in nptl/. It's simpler
- because it doesn't need to convert an absolute timeout to a relative
- one (and back again in the lll_futex_timed_wait macro). */
-
-int
-__lll_timedlock_wait (int *futex, const struct timespec *abstime, int private)
-{
- /* Reject invalid timeouts. */
- if (__glibc_unlikely (abstime->tv_nsec < 0)
- || __glibc_unlikely (abstime->tv_nsec >= 1000000000))
- return EINVAL;
-
- /* Try locking. */
- while (atomic_exchange_acq (futex, 2) != 0)
- {
- /* If *futex == 2, wait until woken or timeout. */
- int err = __nacl_irt_futex.futex_wait_abs ((volatile int *) futex, 2,
- abstime);
- if (err != 0)
- {
- if (__glibc_likely (err == ETIMEDOUT))
- return err;
- assert (err == EAGAIN);
- }
- }
-
- return 0;
-}
diff --git a/sysdeps/nacl/lll_timedwait_tid.c b/sysdeps/nacl/lll_timedwait_tid.c
deleted file mode 100644
index 07276444f9..0000000000
--- a/sysdeps/nacl/lll_timedwait_tid.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Timed waiting for thread death. NaCl version.
- Copyright (C) 2015-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 <assert.h>
-#include <atomic.h>
-#include <errno.h>
-#include <lowlevellock.h>
-#include <sys/time.h>
-
-int
-__lll_timedwait_tid (int *tidp, const struct timespec *abstime)
-{
- /* Reject invalid timeouts. */
- if (__glibc_unlikely (abstime->tv_nsec < 0)
- || __glibc_unlikely (abstime->tv_nsec >= 1000000000))
- return EINVAL;
-
- /* Repeat until thread terminated. */
- int tid;
- while ((tid = atomic_load_relaxed (tidp)) != 0)
- {
- /* See exit-thread.h for details. */
- if (tid == NACL_EXITING_TID)
- /* The thread should now be in the process of exiting, so it will
- finish quick enough that the timeout doesn't matter. If any
- thread ever stays in this state for long, there is something
- catastrophically wrong. */
- atomic_spin_nop ();
- else
- {
- assert (tid > 0);
-
- /* If *FUTEX == TID, wait until woken or timeout. */
- int err = __nacl_irt_futex.futex_wait_abs ((volatile int *) tidp,
- tid, abstime);
- if (err != 0)
- {
- if (__glibc_likely (err == ETIMEDOUT))
- return err;
- assert (err == EAGAIN);
- }
- }
- }
-
- return 0;
-}
diff --git a/sysdeps/nacl/lowlevellock-futex.h b/sysdeps/nacl/lowlevellock-futex.h
deleted file mode 100644
index 5382f685ff..0000000000
--- a/sysdeps/nacl/lowlevellock-futex.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Low-level locking access to futex facilities. NaCl version.
- Copyright (C) 2015-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 _LOWLEVELLOCK_FUTEX_H
-#define _LOWLEVELLOCK_FUTEX_H 1
-
-#include <nacl-interfaces.h>
-#include <time.h>
-
-
-#pragma GCC diagnostic ignored "-Wunused-value" /* XXX */
-
-/* Values for 'private' parameter of locking macros. Note pthreadP.h
- optimizes for these exact values, though they are not required. */
-#define LLL_PRIVATE 0
-#define LLL_SHARED 128
-
-#define FUTEX_PRIVATE_FLAG 0 /* XXX */
-
-
-/* Wait while *FUTEXP == VAL for an lll_futex_wake call on FUTEXP. */
-#define lll_futex_wait(futexp, val, private) \
- ((void) (private), \
- - __nacl_irt_futex.futex_wait_abs ((volatile int *) (futexp), val, NULL))
-
-/* Wait until a lll_futex_wake call on FUTEXP, or TIMEOUT elapses. */
-#define lll_futex_timed_wait(futexp, val, timeout, private) \
- ({ \
- /* This timeout is relative, but the IRT call wants it absolute. */\
- const struct timespec *_to = (timeout); \
- struct timespec _ts; \
- int _err = 0; \
- if (_to != NULL \
- && __glibc_likely ((_err = __nacl_irt_clock.clock_gettime \
- (CLOCK_REALTIME, &_ts)) == 0)) \
- { \
- _ts.tv_sec += _to->tv_sec; \
- _ts.tv_nsec += _to->tv_nsec; \
- while (_ts.tv_nsec >= 1000000000) \
- { \
- _ts.tv_nsec -= 1000000000; \
- ++_ts.tv_sec; \
- } \
- _to = &_ts; \
- } \
- if (_err == 0) \
- _err = __nacl_irt_futex.futex_wait_abs \
- ((volatile int *) (futexp), val, _to); \
- (void) (private); \
- -_err; \
- })
-
-/* Wake up up to NR waiters on FUTEXP. */
-#define lll_futex_wake(futexp, nr, private) \
- ({ \
- int _woken; \
- (void) (private); \
- - __nacl_irt_futex.futex_wake ((volatile int *) (futexp), nr, &_woken); \
- })
-
-/* NaCl does not support the requeue operation. The only use of this is in
- pthread_cond_broadcast, which handles an error return by falling back to
- plain lll_futex_wake. */
-#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
- ((futexp), (nr_wake), (nr_move), (mutex), (val), (private), -ENOSYS)
-
-/* NaCl does not support the special wake-unlock operation. The only use
- of this is in pthread_cond_signal, which handles an error return by
- falling back to plain lll_futex_wake. */
-/* Wake up up to NR_WAKE waiters on FUTEXP and NR_WAKE2 on FUTEXP2. */
-#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
- ((futexp), (nr_wake), (nr_wake2), (futexp2), (private), -ENOSYS)
-
-
-#endif /* lowlevellock-futex.h */
diff --git a/sysdeps/nacl/lowlevellock.h b/sysdeps/nacl/lowlevellock.h
deleted file mode 100644
index 330c726b20..0000000000
--- a/sysdeps/nacl/lowlevellock.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Low-level lock implementation. NaCl version.
- Copyright (C) 2015-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 _LOWLEVELLOCK_H
-
-/* Everything except the exit handling is the same as the generic code. */
-# include <sysdeps/nptl/lowlevellock.h>
-
-/* See exit-thread.h for details. */
-# define NACL_EXITING_TID 1
-
-# undef lll_wait_tid
-# define lll_wait_tid(tid) \
- do { \
- __typeof (tid) __tid; \
- volatile __typeof (tid) *__tidp = &(tid); \
- while ((__tid = atomic_load_relaxed (__tidp)) != 0) \
- { \
- if (__tid == NACL_EXITING_TID) \
- atomic_spin_nop (); \
- else \
- lll_futex_wait (__tidp, __tid, LLL_PRIVATE); \
- } \
- } while (0)
-
-#endif /* lowlevellock.h */
diff --git a/sysdeps/nacl/lseek.c b/sysdeps/nacl/lseek.c
deleted file mode 100644
index 4b5644060f..0000000000
--- a/sysdeps/nacl/lseek.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* lseek -- Move the file position of a file descriptor. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-
-/* Seek to OFFSET on FD, starting from WHENCE. */
-off_t
-__libc_lseek (int fd, off_t offset, int whence)
-{
- off_t result;
- int error = __nacl_irt_fdio.seek (fd, offset, whence, &result);
- if (error)
- {
- __set_errno (error);
- return -1;
- }
- return result;
-}
-libc_hidden_def (__lseek)
-weak_alias (__libc_lseek, __lseek)
-weak_alias (__libc_lseek, lseek)
-
-/* Since off64_t is the same as off_t, lseek64 is just an alias. */
-weak_alias (__libc_lseek, __libc_lseek64)
-weak_alias (__libc_lseek, __lseek64)
-weak_alias (__libc_lseek, lseek64)
diff --git a/sysdeps/nacl/lseek64.c b/sysdeps/nacl/lseek64.c
deleted file mode 100644
index 6f42ee6584..0000000000
--- a/sysdeps/nacl/lseek64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* lseek.c defines lseek64 as an alias. */
diff --git a/sysdeps/nacl/lxstat.c b/sysdeps/nacl/lxstat.c
deleted file mode 100644
index 4dd7cb4e5f..0000000000
--- a/sysdeps/nacl/lxstat.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Get stat information from a file name NaCl version.
- Copyright (C) 2015-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/>. */
-
-/* Avoid the declaration so the compiler doesn't complain about the alias
- with a different type signature. It doesn't know that 'struct stat'
- and 'struct stat64' are ABI-compatible. */
-#define __lxstat64 __lxstat64_avoid
-#include <sys/stat.h>
-#undef __lxstat64
-
-#include <errno.h>
-#include <stddef.h>
-
-#include <xstatconv.h>
-
-#undef lstat
-
-/* Get file attributes about FILE and put them in BUF.
- If FILE is a symbolic link, do not follow it. */
-int
-__lxstat (int vers, const char *file, struct stat *buf)
-{
- nacl_abi_stat_t abi_buf;
- return NACL_CALL (__nacl_irt_dev_filename.lstat (file, &abi_buf),
- __xstat_conv (vers, &abi_buf, buf));
-}
-hidden_def (__lxstat)
-weak_alias (__lxstat, _lxstat)
-
-strong_alias (__lxstat, __lxstat64)
-hidden_ver (__lxstat, __lxstat64)
diff --git a/sysdeps/nacl/lxstat64.c b/sysdeps/nacl/lxstat64.c
deleted file mode 100644
index ca4ecd2be5..0000000000
--- a/sysdeps/nacl/lxstat64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* lxstat.c defines __lxstat64 as an alias. */
diff --git a/sysdeps/nacl/mkdir.c b/sysdeps/nacl/mkdir.c
deleted file mode 100644
index e37b789a3f..0000000000
--- a/sysdeps/nacl/mkdir.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Make a directory. NaCl version.
- Copyright (C) 2015-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/stat.h>
-#include <nacl-interfaces.h>
-
-/* Create a directory named PATH with protections MODE. */
-int
-__mkdir (const char *path, mode_t mode)
-{
- return NACL_CALL (__nacl_irt_dev_filename.mkdir (path, mode), 0);
-}
-weak_alias (__mkdir, mkdir)
diff --git a/sysdeps/nacl/mmap.c b/sysdeps/nacl/mmap.c
deleted file mode 100644
index 1f35443c78..0000000000
--- a/sysdeps/nacl/mmap.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Map addresses from a file or anonymous memory. NaCl version.
- Copyright (C) 2015-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/mman.h>
-#include <nacl-interfaces.h>
-
-
-/* Map addresses starting near ADDR and extending for LEN bytes. From
- OFFSET into the file FD describes according to PROT and FLAGS. If ADDR
- is nonzero, it is the desired mapping address. If the MAP_FIXED bit is
- set in FLAGS, the mapping will be at ADDR exactly (which must be
- page-aligned); otherwise the system chooses a convenient nearby address.
- The return value is the actual mapping address chosen or MAP_FAILED
- for errors (in which case `errno' is set). A successful `mmap' call
- deallocates any previous mapping for the affected region. */
-
-__ptr_t
-__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
-{
- int error = __nacl_irt_memory.mmap (&addr, len, prot, flags, fd, offset);
- if (error)
- {
- errno = error;
- return MAP_FAILED;
- }
- return addr;
-}
-weak_alias (__mmap, mmap)
-
-
-/* Since off64_t is the same as off_t, mmap64 is just an alias. */
-strong_alias (__mmap, __mmap64)
-weak_alias (__mmap, mmap64)
diff --git a/sysdeps/nacl/mmap64.c b/sysdeps/nacl/mmap64.c
deleted file mode 100644
index e8775a6931..0000000000
--- a/sysdeps/nacl/mmap64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* mmap.c defines mmap64 as an alias. */
diff --git a/sysdeps/nacl/mprotect.c b/sysdeps/nacl/mprotect.c
deleted file mode 100644
index fe5f8c6f02..0000000000
--- a/sysdeps/nacl/mprotect.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Change memory protections on pages. NaCl version.
- Copyright (C) 2015-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/types.h>
-#include <sys/mman.h>
-#include <nacl-interfaces.h>
-
-
-/* Change the memory protection of the region starting at ADDR and
- extending LEN bytes to PROT. Returns 0 if successful, -1 for errors
- (and sets errno). */
-
-int
-__mprotect (__ptr_t addr, size_t len, int prot)
-{
- return NACL_CALL (__nacl_irt_memory.mprotect (addr, len, prot), 0);
-}
-weak_alias (__mprotect, mprotect)
diff --git a/sysdeps/nacl/munmap.c b/sysdeps/nacl/munmap.c
deleted file mode 100644
index 8026370f1c..0000000000
--- a/sysdeps/nacl/munmap.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Deallocate a region of pages. NaCl version.
- Copyright (C) 2015-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/mman.h>
-#include <nacl-interfaces.h>
-
-
-/* Deallocate any mapping for the region starting at ADDR and extending LEN
- bytes. Returns 0 if successful, -1 for errors (and sets errno). */
-
-int
-__munmap (__ptr_t addr, size_t len)
-{
- return NACL_CALL (__nacl_irt_memory.munmap (addr, len), 0);
-}
-
-weak_alias (__munmap, munmap)
diff --git a/sysdeps/nacl/nacl-after-link.sh b/sysdeps/nacl/nacl-after-link.sh
deleted file mode 100755
index f59ac0981f..0000000000
--- a/sysdeps/nacl/nacl-after-link.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-# Script to validate NaCl binaries after linking.
-
-# Copyright (C) 2015-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/>.
-
-# See sysdeps/nacl/Makefile for how this script is invoked.
-READELF="$1"
-binary="$2"
-
-if [ -z "$NACL_SDK_ROOT" ]; then
- echo >&2 "$0: NACL_SDK_ROOT must be set in the environment"
- exit 77
-fi
-
-ncval="${NACL_SDK_ROOT}/tools/ncval"
-
-if [ ! -x "$ncval" ]; then
- echo >&2 "$0: No ncval binary in $ncval"
- exit 77
-fi
-
-"${READELF}" -Wl "$binary" | awk '
-BEGIN { saw_load = saw_text = 0 }
-$1 == "LOAD" {
- saw_load = 1;
- if (/ R.E /) saw_code = 1;
-}
-END {
- exit (saw_code ? 11 : saw_load ? 22 : 1);
-}
-'
-case $? in
-11)
- # We saw a code segment, so we can try ncval.
- ;;
-22)
- # We saw LOAD segments but none of them were code.
- echo >&2 "+++ No code: $binary"
- exit 0
- ;;
-*)
- # Something funny going on.
- echo >&2 "*** Failed to analyze: $binary"
- exit 2
- ;;
-esac
-
-if "$ncval" "$binary"; then
- echo >&2 "+++ Validated: $binary"
- exit 0
-else
- echo >&2 "*** Validation failed: $binary"
- exit 2
-fi
diff --git a/sysdeps/nacl/nacl-interface-list.h b/sysdeps/nacl/nacl-interface-list.h
deleted file mode 100644
index c5bfba05d5..0000000000
--- a/sysdeps/nacl/nacl-interface-list.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* List of NaCl interface tables used in libraries.
- Copyright (C) 2015-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/>. */
-
-NACL_MANDATORY_INTERFACE (rtld,
- NACL_IRT_BASIC_v0_1, nacl_irt_basic)
-NACL_MANDATORY_INTERFACE (rtld,
- NACL_IRT_FDIO_v0_1, nacl_irt_fdio)
-NACL_MANDATORY_INTERFACE (rtld,
- NACL_IRT_MEMORY_v0_3, nacl_irt_memory)
-NACL_MANDATORY_INTERFACE (libc,
- NACL_IRT_THREAD_v0_1, nacl_irt_thread)
-NACL_MANDATORY_INTERFACE (rtld,
- NACL_IRT_FUTEX_v0_1, nacl_irt_futex)
-NACL_MANDATORY_INTERFACE (rtld,
- NACL_IRT_TLS_v0_1, nacl_irt_tls)
-NACL_MANDATORY_INTERFACE (rtld,
- NACL_IRT_RESOURCE_OPEN_v0_1, nacl_irt_resource_open)
-NACL_MANDATORY_INTERFACE (rtld,
- NACL_IRT_CODE_DATA_ALLOC_v0_1,
- nacl_irt_code_data_alloc)
-NACL_OPTIONAL_INTERFACE (libc,
- NACL_IRT_CLOCK_v0_1, nacl_irt_clock)
-NACL_OPTIONAL_INTERFACE (rtld,
- NACL_IRT_DYNCODE_v0_1, nacl_irt_dyncode)
-NACL_OPTIONAL_INTERFACE (rtld,
- NACL_IRT_DEV_GETPID_v0_1, nacl_irt_dev_getpid)
-NACL_OPTIONAL_INTERFACE (rtld,
- NACL_IRT_DEV_FILENAME_v0_3, nacl_irt_dev_filename)
-NACL_OPTIONAL_INTERFACE (libc,
- NACL_IRT_DEV_FDIO_v0_3, nacl_irt_dev_fdio)
diff --git a/sysdeps/nacl/nacl-interface-table.c b/sysdeps/nacl/nacl-interface-table.c
deleted file mode 100644
index 50d6bb2bab..0000000000
--- a/sysdeps/nacl/nacl-interface-table.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Define one NaCl interface table.
- Copyright (C) 2015-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 "nacl-interfaces.h"
-
-#define PASTE(a, b) PASTE_1 (a, b)
-#define PASTE_1(a, b) a##b
-#define STRINGIFY(x) STRINGIFY_1 (x)
-#define STRINGIFY_1(x) #x
-
-#if IS_IN (rtld) && PASTE (MODULE_, INTERFACE_MODULE) != MODULE_rtld
-# error "This interface is also needed in rtld."
-#endif
-
-#define SECTION(which) \
- section ("nacl_" STRINGIFY (INTERFACE_CATEGORY) "_interface_" #which)
-
-static const struct nacl_interface PASTE (desc_, INTERFACE_TYPE)
- __attribute__ ((used, SECTION (names))) =
-{
- .table_size = sizeof (struct INTERFACE_TYPE),
- .namelen = sizeof INTERFACE_STRING,
- .name = INTERFACE_STRING
-};
-
-struct INTERFACE_TYPE PASTE (__, INTERFACE_TYPE)
- __attribute__ ((SECTION (tables)));
-PASTE (INTERFACE_MODULE, _hidden_data_def) (PASTE (__, INTERFACE_TYPE))
diff --git a/sysdeps/nacl/nacl-interfaces.c b/sysdeps/nacl/nacl-interfaces.c
deleted file mode 100644
index bf1cf19523..0000000000
--- a/sysdeps/nacl/nacl-interfaces.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/* Using NaCl interface tables.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-#include <ldsodefs.h>
-
-
-/* These magic symbols are provided implicitly by the linker to
- give us the bounds of the specially-named sections. */
-
-extern const struct nacl_interface __start_nacl_mandatory_interface_names[]
- attribute_hidden;
-extern const struct nacl_interface __stop_nacl_mandatory_interface_names[]
- attribute_hidden;
-
-extern uintptr_t __start_nacl_mandatory_interface_tables[]
- attribute_hidden;
-extern uintptr_t __stop_nacl_mandatory_interface_tables[]
- attribute_hidden;
-
-/* We use weak references for the optional ones, since they
- might not be included at all in any given statically-linked program. */
-
-extern const struct nacl_interface __start_nacl_optional_interface_names[]
- attribute_hidden __attribute__ ((weak));
-extern const struct nacl_interface __stop_nacl_optional_interface_names[]
- attribute_hidden __attribute__ ((weak));
-
-extern uintptr_t __start_nacl_optional_interface_tables[]
- attribute_hidden __attribute__ ((weak));
-extern uintptr_t __stop_nacl_optional_interface_tables[]
- attribute_hidden __attribute__ ((weak));
-
-static uintptr_t *
-next_nacl_table (uintptr_t *t, const struct nacl_interface *i)
-{
- return (void *) t + i->table_size;
-}
-
-static void __attribute__ ((noreturn))
-missing_mandatory_interface (const struct nacl_interface *i)
-{
- static const char before[] =
- "FATAL: NaCl IRT interface query failed for essential interface \"";
- static const char after[] =
- "\"\n";
-
- if (__nacl_irt_fdio.write != NULL)
- {
- size_t wrote;
- (*__nacl_irt_fdio.write) (2, before, sizeof before - 1, &wrote);
- (*__nacl_irt_fdio.write) (2, i->name, i->namelen - 1, &wrote);
- (*__nacl_irt_fdio.write) (2, after, sizeof after - 1, &wrote);
- }
-
- if (__nacl_irt_basic.exit != NULL)
- (*__nacl_irt_basic.exit) (-1);
-
- __builtin_trap ();
-}
-
-static void
-initialize_mandatory_interfaces (void)
-{
- const struct nacl_interface *i = __start_nacl_mandatory_interface_names;
- uintptr_t *t = __start_nacl_mandatory_interface_tables;
- while (i < __stop_nacl_mandatory_interface_names)
- {
- if (__nacl_irt_query (i->name, t, i->table_size) != i->table_size)
- missing_mandatory_interface (i);
-
- t = next_nacl_table (t, i);
- i = next_nacl_interface (i);
- }
-}
-
-
-static int
-nacl_missing_optional_interface (void)
-{
- return ENOSYS;
-}
-
-static void
-initialize_optional_interfaces (void)
-{
- const struct nacl_interface *i = __start_nacl_optional_interface_names;
- uintptr_t *t = __start_nacl_optional_interface_tables;
- while (i < __stop_nacl_optional_interface_names)
- {
- size_t filled = __nacl_irt_query (i->name, t, i->table_size);
- if (filled != i->table_size)
- for (size_t slot = 0; slot < i->table_size / sizeof *t; ++slot)
- t[slot] = (uintptr_t) &nacl_missing_optional_interface;
-
- t = next_nacl_table (t, i);
- i = next_nacl_interface (i);
- }
-}
-
-
-void attribute_hidden
-__nacl_initialize_interfaces (void)
-{
- initialize_mandatory_interfaces ();
- initialize_optional_interfaces ();
-}
-
-
-static bool
-try_supply (const struct nacl_interface *const start,
- const struct nacl_interface *const stop,
- uintptr_t *all_tables,
- const char *ident, size_t ident_len,
- const void *table, size_t tablesize)
-{
- const struct nacl_interface *i = start;
- uintptr_t *t = all_tables;
- while (i < stop)
- {
- if (i->table_size == tablesize
- && i->namelen == ident_len
- && !memcmp (i->name, ident, ident_len))
- {
- memcpy (t, table, tablesize);
- return true;
- }
-
- t = next_nacl_table (t, i);
- i = next_nacl_interface (i);
- }
-
- return false;
-}
-
-internal_function
-bool
-PASTE_NAME (__nacl_supply_interface_, MODULE_NAME)
- (const char *ident, size_t ident_len, const void *table, size_t tablesize)
-{
- return (try_supply (__start_nacl_mandatory_interface_names,
- __stop_nacl_mandatory_interface_names,
- __start_nacl_mandatory_interface_tables,
- ident, ident_len, table, tablesize)
- || try_supply (__start_nacl_optional_interface_names,
- __stop_nacl_optional_interface_names,
- __start_nacl_optional_interface_tables,
- ident, ident_len, table, tablesize));
-}
diff --git a/sysdeps/nacl/nacl-interfaces.h b/sysdeps/nacl/nacl-interfaces.h
deleted file mode 100644
index b7b45bbf38..0000000000
--- a/sysdeps/nacl/nacl-interfaces.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Using NaCl interface tables.
- Copyright (C) 2015-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 _NACL_INTERFACES_H
-#define _NACL_INTERFACES_H 1
-
-#include <errno.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-/* <nacl-irt.h> is massaged from native_client/src/untrusted/irt/irt.h so
- that it uses nacl_abi_*_t type names. We must define those types first. */
-
-/* These are the same in the IRT ABI as in the libc ABI. */
-typedef blksize_t nacl_abi_blksize_t;
-typedef dev_t nacl_abi_dev_t;
-typedef gid_t nacl_abi_gid_t;
-typedef ino_t nacl_abi_ino_t;
-typedef mode_t nacl_abi_mode_t;
-typedef nlink_t nacl_abi_nlink_t;
-typedef size_t nacl_abi_size_t;
-typedef time_t nacl_abi_time_t;
-typedef uid_t nacl_abi_uid_t;
-typedef struct dirent nacl_abi_dirent_t;
-typedef struct timeval nacl_abi_timeval_t;
-typedef struct timespec nacl_abi_timespec_t;
-
-/* This is unsigned in the IRT ABI, but it's traditionally 'long int',
- so we stick with that. */
-typedef clock_t nacl_abi_clock_t;
-
-typedef int32_t nacl_abi_blkcnt_t;
-
-/* This is different by design. */
-typedef struct nacl_abi_stat nacl_abi_stat_t;
-
-#include <nacl-irt.h>
-
-/* This is how we access the IRT interface-query function.
- This formulation makes it usable as if it were a function name. */
-#define __nacl_irt_query (*(TYPE_nacl_irt_query) GLRO(dl_sysinfo))
-
-
-/* This describes one IRT (or IRT-like) interface that libc uses.
- This structure contains no pointers, so it can go into rodata
- without relocs. Instead, the actual tables we use for these
- interfaces live in a parallel section in writable data. */
-struct nacl_interface {
- size_t table_size;
- size_t namelen;
- char name[];
-};
-
-/* Increment for 'const struct nacl_interface *' pointers. */
-static inline const struct nacl_interface *
-next_nacl_interface (const struct nacl_interface *i)
-{
- uintptr_t align = __alignof (*i);
- return (const void *) (((uintptr_t) &i->name[i->namelen] + align - 1)
- & -align);
-}
-
-#if IS_IN (libpthread)
-# define libpthread_hidden_proto(name) hidden_proto (name)
-#else
-# define libpthread_hidden_proto(name)
-#endif
-
-#define DECLARE_INTERFACE(module, type) \
- extern struct type __##type; module##_hidden_proto (__##type);
-
-#define NACL_MANDATORY_INTERFACE(module, id, type) \
- DECLARE_INTERFACE (module, type)
-#define NACL_OPTIONAL_INTERFACE(module, id, type) \
- DECLARE_INTERFACE (module, type)
-#include "nacl-interface-list.h"
-#undef NACL_MANDATORY_INTERFACE
-#undef NACL_OPTIONAL_INTERFACE
-
-extern void __nacl_initialize_interfaces (void) attribute_hidden;
-extern bool __nacl_supply_interface_libc (const char *ident, size_t ident_len,
- const void *table, size_t tablesize)
- internal_function attribute_hidden;
-extern bool __nacl_supply_interface_rtld (const char *ident, size_t ident_len,
- const void *table, size_t tablesize);
- internal_function;
-
-/* Convenience function for handling IRT call return values. */
-static inline int
-__nacl_fail (int err)
-{
- errno = err;
- return -1;
-}
-
-#define NACL_CALL(err, val) \
- ({ int _err = (err); _err ? __nacl_fail (_err) : (val); })
-
-#endif /* nacl-interfaces.h */
diff --git a/sysdeps/nacl/nacl-interfaces.mk.in b/sysdeps/nacl/nacl-interfaces.mk.in
deleted file mode 100644
index 92ff3c6afe..0000000000
--- a/sysdeps/nacl/nacl-interfaces.mk.in
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Might as well be -*- C -*-.
-
- This generates a makefile that sets the variable pairs
- nacl-MODULE-mandatory-interfaces and nacl-MODULE-optional-interfaces
- based on the nacl-interface-list.h list. */
-
-%define NACL_MANDATORY_INTERFACE(module, id, type) \
- nacl-mandatory-interfaces += module-type
-%define NACL_OPTIONAL_INTERFACE(module, id, type) \
- nacl-optional-interfaces += module-type
-
-%include "nacl-interface-list.h"
-
-%undef NACL_MANDATORY_INTERFACE
-%undef NACL_OPTIONAL_INTERFACE
-
-%define NACL_MANDATORY_INTERFACE(module, id, type) \
- nacl-module-type-string := id
-%define NACL_OPTIONAL_INTERFACE(module, id, type) \
- nacl-module-type-string := id
-
-%include "nacl-interface-list.h"
-
-%undef NACL_MANDATORY_INTERFACE
-%undef NACL_OPTIONAL_INTERFACE
diff --git a/sysdeps/nacl/nacl-test-wrapper.sh b/sysdeps/nacl/nacl-test-wrapper.sh
deleted file mode 100755
index df5ab40970..0000000000
--- a/sysdeps/nacl/nacl-test-wrapper.sh
+++ /dev/null
@@ -1,280 +0,0 @@
-#!/bin/bash
-# test-wrapper script for NaCl.
-
-# Copyright (C) 2015-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/>.
-
-progname="$(basename "$0")"
-
-usage="usage: ${progname} --arch=ARCH [VAR=VAL...] COMMAND ..."
-help="
-"
-
-use_bootstrap=true
-arch=
-env=()
-envi=0
-while [ $# -gt 0 ]; do
- case "$1" in
-
- --help)
- echo "$usage"
- echo "$help"
- exit 0
- ;;
-
- --arch=*)
- arch="${1#--arch=}"
- shift
- ;;
-
- *=*)
- env[envi++]='-E'
- env[envi++]="$1"
- shift
- ;;
-
- --)
- shift
- break
- ;;
-
- *)
- break
- ;;
- esac
-done
-
-if [ $# -lt 1 -o -z "$arch" ]; then
- echo "$usage" >&2
- echo "Type '${progname} --help' for more detailed help." >&2
- exit 1
-fi
-
-test_args=("$@")
-
-if [ -z "$NACL_SDK_ROOT" ]; then
- echo >&2 "$0: NACL_SDK_ROOT must be set in the environment"
- exit 77
-fi
-
-# We use a handful of things from the NaCl SDK, or at least
-# from a directory matching the layout of the NaCl SDK.
-sdk_tools="${NACL_SDK_ROOT}/tools"
-
-NACL_BOOTSTRAP="${sdk_tools}/nacl_helper_bootstrap_${arch}"
-NACL_SEL_LDR="${sdk_tools}/sel_ldr_${arch}"
-NACL_IRT="${sdk_tools}/irt_core_${arch}.nexe"
-NACL_LOADER="${sdk_tools}/elf_loader_${arch}.nexe"
-
-if [ ! -x "$NACL_BOOTSTRAP" -o ! -x "$NACL_SEL_LDR" ]; then
- echo >&2 "$0: sel_ldr_${arch} and/or nacl_helper_bootstrap_${arch} missing"
- echo >&2 "$0: from directory $sdk_tools"
- exit 77
-fi
-
-if [ ! -r "$NACL_IRT" -o ! -r "$NACL_LOADER" ]; then
- echo >&2 "$0: irt_core_${arch}.nexe and/or loader_${arch}.nexe missing"
- echo >&2 "$0: from directory $sdk_tools"
- exit 77
-fi
-
-# Figure out if we are building for the native machine or not.
-# If not, we'll run sel_ldr under qemu.
-decide_use_emulator()
-{
- local arg
- for arg; do
- if [[ "$(uname -m)" = "$1" ]]; then
- return
- fi
- done
- use_emulator=true
-}
-
-use_emulator=false
-case "$arch" in
-arm)
- decide_use_emulator 'arm*'
- emulator=(qemu-arm -cpu cortex-a15 -L "${sdk_tools}/arm_trusted")
- ;;
-x86_32)
- decide_use_emulator 'i?86' 'x86_64*'
- emulator=(qemu-i386)
- ;;
-x86_64)
- decide_use_emulator 'x86_64*'
- emulator=(qemu-x86_64)
- ;;
-esac
-
-if $use_emulator; then
- ldr_args=('-Q')
- emulator_factor=10
-else
- emulator=()
- ldr_args=()
- emulator_factor=1
-fi
-
-if $use_bootstrap; then
- ldr=(
- "${NACL_BOOTSTRAP}"
- "${NACL_SEL_LDR}"
- '--r_debug=0xXXXXXXXXXXXXXXXX'
- '--reserved_at_zero=0xXXXXXXXXXXXXXXXX'
- )
-else
- ldr=("${NACL_SEL_LDR}")
-fi
-
-static=true
-case "$1" in
-*/ld-nacl*) static=false ;;
-esac
-
-if $static; then
- loader=()
-else
- loader=(-f "${NACL_LOADER}")
-fi
-
-run_test()
-{
- local test_fifo="$1"
- local cmd=(
- "${emulator[@]}" "${ldr[@]}" -q -S -a "${ldr_args[@]}" -B "${NACL_IRT}"
- "${loader[@]}" "${env[@]}" -E TEST_DIRECT="$test_fifo" -- "${test_args[@]}"
- )
- if [ "${NACLVERBOSITY:+set}" = set ]; then
- "${cmd[@]}"
- else
- NACLLOG=/dev/null "${cmd[@]}"
- fi
-}
-
-temp_files=()
-test_fifo=
-do_cleanup()
-{
- rm -rf "$test_fifo" "${temp_files[@]}"
-}
-trap do_cleanup EXIT HUP INT TERM
-
-# Create a named pipe to receive the TEST_DIRECT information from the test
-# program.
-test_fifo=${TMPDIR:-/tmp}/libc-test-fifo.$$
-rm -f "$test_fifo"
-mkfifo "$test_fifo" || {
- echo "Cannot create test FIFO '$test_fifo'"
- exit 1
-}
-
-# Run the test in the background, so we can implement a timeout.
-# The no-op redirection defeats the default behavior of "< /dev/null"
-# for a background command.
-run_test "$test_fifo" <&0 & test_pid=$!
-
-# Set up a short timeout before we read from the FIFO, in case
-# the program doesn't actually write to the FIFO at all (it is
-# not a test-skeleton.c program, or it dies very early).
-no_skeleton=false
-script_pid=$$
-trap 'no_skeleton=true' USR1
-(sleep 2; kill -USR1 $script_pid) 2> /dev/null &
-
-# The test should first write into the FIFO to describe its expectations.
-# Our open-for-reading of the FIFO will block until the test starts up and
-# opens it for writing. Then our reads will block until the test finishes
-# writing out info and closes the FIFO. At that point we will have
-# collected (and evaluated) what it emitted. It sets these variables:
-# timeout=%u
-# timeoutfactor=%u
-# exit=%u
-# signal=%s
-unset exit signal
-. "$test_fifo" 2> /dev/null
-
-# If we got this far, either the 'no_skeleton=true' watchdog already
-# fired, or else we don't want it to.
-trap '' USR1
-
-if $no_skeleton; then
- # We hit the timeout, so we didn't get full information about test
- # expectations. Reset any partial results we may have gotten.
- unset exit signal
-else
- # Now we know the expected timeout, so we can start the timer running.
- ((sleep_time = timeout * timeoutfactor * emulator_factor))
-
- # Now start a background subshell to enforce the timeout.
- (sleep "$sleep_time"; kill -ALRM $test_pid) 2> /dev/null &
-fi
-
-# This corresponds to '#ifdef EXPECTED_STATUS' in test-skeleton.c.
-expected_status()
-{
- test "${exit+yes}" = yes
-}
-# This corresponds to '#ifdef EXPECTED_SIGNAL' in test-skeleton.c.
-expected_signal()
-{
- test "${signal+yes}" = yes
-}
-# This corresponds to 'if (WIFEXITED (status))' in test-skeleton.c.
-wifexited()
-{
- test $test_rc -lt 128
-}
-
-# Now wait for the test process to finish.
-wait $test_pid
-test_rc=$?
-
-# This exactly duplicates the logic in test-skeleton.c.
-if wifexited; then
- if ! expected_status; then
- if ! expected_signal; then
- # Simply exit with the return value of the test. */
- exit $test_rc
- else
- echo "Expected signal '${signal}' from child, got none"
- exit 1
- fi
- else
- if [ $test_rc -ne $exit ]; then
- echo "Expected status $exit, got $test_rc"
- exit 1
- fi
- exit 0
- fi
-else
- # Process was killed by timer or other signal.
- ((test_signal = test_rc > 192 ? 256 - test_rc : test_rc - 128 ))
- test_signame=$(kill -l "$test_signal")
- if ! expected_signal; then
- echo "Didn't expect signal from child; got '${test_signame}'"
- exit 1
- else
- if [ "$test_signame" != "$signal" ]; then
- echo "\
-Incorrect signal from child: got '${test_signame}', need '${signal}'"
- exit 1
- fi
- exit 0
- fi
-fi
diff --git a/sysdeps/nacl/nacl_interface_ext_supply.c b/sysdeps/nacl/nacl_interface_ext_supply.c
deleted file mode 100644
index d8b2085ba6..0000000000
--- a/sysdeps/nacl/nacl_interface_ext_supply.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Interface for the user to replace NaCl IRT interface functions.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-#include <string.h>
-
-size_t
-nacl_interface_ext_supply (const char *interface_ident,
- const void *table, size_t tablesize)
-{
- const size_t ident_len = strlen (interface_ident) + 1;
-
- /* Most interfaces are in rtld, so try there first. If other
- libraries ever get their own tables not used in libc, then we
- will need some dynamic registration mechanism here to iterate
- over all libraries' __nacl_supply_interface_libfoo calls. */
- if (0
-#ifdef SHARED
- || __nacl_supply_interface_rtld (interface_ident, ident_len,
- table, tablesize)
-#endif
- || __nacl_supply_interface_libc (interface_ident, ident_len,
- table, tablesize))
- return tablesize;
-
- return 0;
-}
diff --git a/sysdeps/nacl/nacl_interface_query.c b/sysdeps/nacl/nacl_interface_query.c
deleted file mode 100644
index adf1dd4c02..0000000000
--- a/sysdeps/nacl/nacl_interface_query.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* NaCl function exposing IRT interface query.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-#include <ldsodefs.h>
-
-#ifdef SHARED
-
-/* We can define this trivially using IFUNC rather than a wrapper
- because we absolutely require that we get the IRT interface query
- function pointer via AT_SYSINFO. */
-
-extern TYPE_nacl_irt_query nacl_interface_query_ifunc (void)
- asm ("nacl_interface_query");
-
-TYPE_nacl_irt_query
-nacl_interface_query_ifunc (void)
-{
- return &__nacl_irt_query;
-}
-asm (".type nacl_interface_query, %gnu_indirect_function");
-
-#else
-
-/* In the static library, using IFUNC is just extra overhead. */
-
-size_t
-nacl_interface_query (const char *interface_ident,
- void *table, size_t tablesize)
-{
- return __nacl_irt_query (interface_ident, table, tablesize);
-}
-
-#endif
diff --git a/sysdeps/nacl/nanosleep.c b/sysdeps/nacl/nanosleep.c
deleted file mode 100644
index 013dd5b625..0000000000
--- a/sysdeps/nacl/nanosleep.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* nanosleep -- Sleep for a duration given in nanoseconds. NaCl version.
- Copyright (C) 2015-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 <time.h>
-#include <nacl-interfaces.h>
-
-
-/* Pause execution for a number of nanoseconds. */
-int
-__libc_nanosleep (const struct timespec *requested_time,
- struct timespec *remaining)
-{
- return NACL_CALL (__nacl_irt_basic.nanosleep (requested_time, remaining), 0);
-}
-
-weak_alias (__libc_nanosleep, __nanosleep)
-libc_hidden_def (__nanosleep)
-weak_alias (__libc_nanosleep, nanosleep)
diff --git a/sysdeps/nacl/open.c b/sysdeps/nacl/open.c
deleted file mode 100644
index 983234fb65..0000000000
--- a/sysdeps/nacl/open.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Open a file by name. NaCl version.
- Copyright (C) 2015-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 <stdarg.h>
-#include <stdio.h>
-#include <nacl-interfaces.h>
-
-
-/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
- a third argument is the file protection. */
-int
-__libc_open (const char *file, int oflag, ...)
-{
- mode_t mode = 0;
-
- if (oflag & O_CREAT)
- {
- va_list arg;
- va_start (arg, oflag);
- mode = va_arg (arg, mode_t);
- va_end (arg);
- }
-
- int fd;
- return NACL_CALL (__nacl_irt_dev_filename.open (file, oflag, mode, &fd), fd);
-}
-libc_hidden_def (__libc_open)
-weak_alias (__libc_open, __open)
-libc_hidden_weak (__open)
-weak_alias (__libc_open, open)
-
-/* open64 is just an alias. */
-strong_alias (__libc_open, __libc_open64)
-strong_alias (__libc_open64, __open64)
-libc_hidden_def (__open64)
-weak_alias (__libc_open64, open64)
diff --git a/sysdeps/nacl/open64.c b/sysdeps/nacl/open64.c
deleted file mode 100644
index b3e5563cd6..0000000000
--- a/sysdeps/nacl/open64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* open.c defines open64 as an alias. */
diff --git a/sysdeps/nacl/preconfigure b/sysdeps/nacl/preconfigure
deleted file mode 100644
index c700fbc2f8..0000000000
--- a/sysdeps/nacl/preconfigure
+++ /dev/null
@@ -1,7 +0,0 @@
-# GNU C Library preconfigure fragment for sysdeps/nacl
-
-case "$config_machine-$config_os" in
-arm*-nacl*)
- libc_config_ok=yes
- ;;
-esac
diff --git a/sysdeps/nacl/profil.c b/sysdeps/nacl/profil.c
deleted file mode 100644
index 701d7ad651..0000000000
--- a/sysdeps/nacl/profil.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Side-step sysdeps/posix/profil.c, which uses sigaction and setitimer. */
-#include <gmon/profil.c>
diff --git a/sysdeps/nacl/pthread-pids.h b/sysdeps/nacl/pthread-pids.h
deleted file mode 100644
index 80cd98e06a..0000000000
--- a/sysdeps/nacl/pthread-pids.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Initialize pid and tid fields of struct pthread. NaCl version.
- Copyright (C) 2015-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 <pthreadP.h>
-
-
-/* NaCl has no concept of PID or TID, nor even any notion of an
- identifier for a thread within the process. But various places in
- the NPTL implementation rely on using the 'tid' field of the TCB
- (struct pthread) as an identifier that is unique at least among all
- live threads in the process. So we must synthesize some number to
- use. Conveniently, the 'pthread_t' value itself is already unique
- in exactly this way (because it's the 'struct pthread' pointer).
-
- The only wrinkle is that 'tid' is a (32-bit) 'int' and its high
- (sign) bit is used for special purposes, so we must be absolutely
- sure that we never use a pointer value with the high bit set. (It
- also cannot be zero, but zero is never a valid pointer anyway.)
- The NaCl sandbox models for 32-bit machines limit the address space
- to less than 3GB (in fact, to 1GB), so it's already impossible that
- a valid pointer will have its high bit set. But the NaCl x86-64
- sandbox model allows a full 4GB of address space, so we cannot
- assume that an arbitrary pointer value will not have the high bit
- set. Conveniently, there are always unused bits in the pointer
- value for a 'struct pthread', because it is always aligned to at
- least 32 bits and so the low bits are always zero. Hence, we can
- safely avoid the danger of a nonzero high bit just by shifting the
- pointer value right. */
-
-static inline int
-__nacl_get_tid (struct pthread *pd)
-{
- uintptr_t id = (uintptr_t) pd;
- int tid = id >> 1;
- assert ((id & 1) == 0);
- assert (sizeof id == sizeof tid);
- assert (tid > 0);
- /* This ensures that NACL_EXITING_TID (lowlevellock.h) can never
- be a valid TID value. */
- assert ((tid & 1) == 0);
- return tid;
-}
-
-
-/* Initialize PD->pid and PD->tid for the initial thread. If there is
- setup required to arrange that __exit_thread causes PD->tid to be
- cleared and futex-woken, then this function should do that as well. */
-static inline void
-__pthread_initialize_pids (struct pthread *pd)
-{
- pd->tid = __nacl_get_tid (pd);
- pd->pid = -1;
-}
diff --git a/sysdeps/nacl/pthread_condattr_setclock.c b/sysdeps/nacl/pthread_condattr_setclock.c
deleted file mode 100644
index e9b45d26e9..0000000000
--- a/sysdeps/nacl/pthread_condattr_setclock.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Set the clock for timeouts on a condition variable. NaCl version.
- Copyright (C) 2015-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 "pthreadP.h"
-
-
-int
-pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t clock_id)
-{
- switch (clock_id)
- {
- case CLOCK_REALTIME:
- /* This is the default state and the only one actually supported. */
- return 0;
-
- case CLOCK_MONOTONIC:
- /* NaCl recognizes CLOCK_MONOTONIC for other purposes, so it is a
- "known clock". But NaCl doesn't support it for this purpose. */
- return ENOTSUP;
-
- default:
- /* The only other recognized clocks are CPU-time clocks,
- which POSIX says should get EINVAL. */
- return EINVAL;
- }
-}
diff --git a/sysdeps/nacl/readdir.c b/sysdeps/nacl/readdir.c
deleted file mode 100644
index a73bfe42a5..0000000000
--- a/sysdeps/nacl/readdir.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* The compiler complains about aliases with nonmatching type signatures.
- The types 'struct dirent' and 'struct dirent64' are actually identical
- even though the compiler doesn't consider them to be. So we hide the
- declaration from the compiler. */
-#define __readdir64 __avoid___readdir64_declaration
-#define readdir64 __avoid_readdir64_declaration
-#include <sysdeps/posix/readdir.c>
-#undef __readdir64
-#undef readdir64
-strong_alias (__readdir, __readdir64)
-weak_alias (__readdir64, readdir64)
diff --git a/sysdeps/nacl/readdir64.c b/sysdeps/nacl/readdir64.c
deleted file mode 100644
index f4806bf269..0000000000
--- a/sysdeps/nacl/readdir64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* readdir.c defines readdir64 as an alias. */
diff --git a/sysdeps/nacl/readdir64_r.c b/sysdeps/nacl/readdir64_r.c
deleted file mode 100644
index c7830de559..0000000000
--- a/sysdeps/nacl/readdir64_r.c
+++ /dev/null
@@ -1 +0,0 @@
-/* readdir_r.c defines readdir64_r as an alias. */
diff --git a/sysdeps/nacl/readdir_r.c b/sysdeps/nacl/readdir_r.c
deleted file mode 100644
index 3a9a71703e..0000000000
--- a/sysdeps/nacl/readdir_r.c
+++ /dev/null
@@ -1,8 +0,0 @@
-/* The compiler complains about aliases with nonmatching type signatures.
- The types 'struct dirent' and 'struct dirent64' are actually identical
- even though the compiler doesn't consider them to be. So we hide the
- declaration from the compiler. */
-#define readdir64_r __avoid_readdir64_r_declaration
-#include <sysdeps/posix/readdir_r.c>
-#undef readdir64_r
-weak_alias (__readdir_r, readdir64_r)
diff --git a/sysdeps/nacl/readlink.c b/sysdeps/nacl/readlink.c
deleted file mode 100644
index 3f417825c8..0000000000
--- a/sysdeps/nacl/readlink.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Read the contents of a symbolic link. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Read the contents of the symbolic link PATH into no more than
- LEN bytes of BUF. The contents are not null-terminated.
- Returns the number of characters read, or -1 for errors. */
-ssize_t
-__readlink (const char *path, char *buf, size_t len)
-{
- size_t nread;
- return NACL_CALL (__nacl_irt_dev_filename.readlink (path, buf, len, &nread),
- nread);
-}
-weak_alias (__readlink, readlink)
diff --git a/sysdeps/nacl/rename.c b/sysdeps/nacl/rename.c
deleted file mode 100644
index 58e191335c..0000000000
--- a/sysdeps/nacl/rename.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Rename a file. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Rename the file OLD to NEW. */
-int
-rename (const char *old, const char *new)
-{
- return NACL_CALL (__nacl_irt_dev_filename.rename (old, new), 0);
-}
diff --git a/sysdeps/nacl/rmdir.c b/sysdeps/nacl/rmdir.c
deleted file mode 100644
index ffe1037894..0000000000
--- a/sysdeps/nacl/rmdir.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Remove a directory. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Remove the directory PATH. */
-int
-__rmdir (const char *path)
-{
- return NACL_CALL (__nacl_irt_dev_filename.rmdir (path), 0);
-}
-weak_alias (__rmdir, rmdir)
diff --git a/sysdeps/nacl/sched_yield.c b/sysdeps/nacl/sched_yield.c
deleted file mode 100644
index 294e0689db..0000000000
--- a/sysdeps/nacl/sched_yield.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* sched_yield -- Yield the processor. NaCl version.
- Copyright (C) 2015-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 <sched.h>
-#include <nacl-interfaces.h>
-
-
-/* Yield the processor. */
-int
-__sched_yield (void)
-{
- return NACL_CALL (__nacl_irt_basic.sched_yield (), 0);
-}
-libc_hidden_def (__sched_yield)
-weak_alias (__sched_yield, sched_yield)
diff --git a/sysdeps/nacl/shlib-versions b/sysdeps/nacl/shlib-versions
deleted file mode 100644
index c146d31b96..0000000000
--- a/sysdeps/nacl/shlib-versions
+++ /dev/null
@@ -1,9 +0,0 @@
-# DEFAULT Earliest symbol set
-# ------- -------------------
-DEFAULT GLIBC_2.22
-
-# Library=version Earliest symbol set (optional)
-# --------------- ------------------------------
-
-libc=0.1
-libm=0.1
diff --git a/sysdeps/nacl/sigaction.c b/sysdeps/nacl/sigaction.c
deleted file mode 100644
index 898486eea5..0000000000
--- a/sysdeps/nacl/sigaction.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#if IS_IN (libpthread)
-
-/* This placeholder file prevents nptl/sigaction.c from being compiled.
- For NaCl, there is no need for a separate sigaction in libpthread. */
-
-#else
-
-/* Get the standard stub. */
-#include <signal/sigaction.c>
-
-#endif
diff --git a/sysdeps/nacl/sprofil.c b/sysdeps/nacl/sprofil.c
deleted file mode 100644
index 96d4300927..0000000000
--- a/sysdeps/nacl/sprofil.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Side-step sysdeps/posix/sprofil.c, which uses sigaction and setitimer. */
-#include <gmon/sprofil.c>
diff --git a/sysdeps/nacl/start.c b/sysdeps/nacl/start.c
deleted file mode 100644
index f009c6d302..0000000000
--- a/sysdeps/nacl/start.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Entry-point for programs. NaCl version.
- Copyright (C) 2015-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 with other
- programs, and to distribute those programs without any restriction
- coming from the use of this file. (The GNU Lesser General Public
- License restrictions do apply in other respects; for example, they
- cover modification of the file, and distribution when not linked
- into another program.)
-
- Note that people who make modified versions of this file are not
- obligated to grant this special exception for their modified
- versions; it is their choice whether to do so. The GNU Lesser
- General Public License gives permission to release a modified
- version without this exception; this exception also makes it
- possible to release a modified version which carries forward this
- exception.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <stdint.h>
-#include <link.h>
-
-/* NaCl's elf32.h is incompatible with the real <elf.h>. */
-#define NATIVE_CLIENT_SRC_INCLUDE_ELF32_H_
-#include <native_client/src/untrusted/nacl/nacl_startup.h>
-
-
-/* The application defines this, of course. */
-extern int main (int argc, char **argv, char **envp);
-
-/* But maybe it defines this too, in which case it takes precedence. */
-extern int __nacl_main (int argc, char **argv, char **envp)
- __attribute__ ((weak));
-
-/* These are defined in libc. */
-extern int __libc_csu_init (int argc, char **argv, char **envp);
-extern void __libc_csu_fini (void);
-extern void __libc_start_main (int (*main) (int, char **, char **),
- int argc, char **argv, ElfW(auxv_t) *auxv,
- int (*init) (int, char **, char **),
- void (*fini) (void),
- void (*rtld_fini) (void),
- void *stack_end);
-
-void
-_start (uint32_t info[])
-{
- /* The generic code actually assumes that envp follows argv. */
-
- __libc_start_main (&__nacl_main ?: &main,
- nacl_startup_argc (info),
- nacl_startup_argv (info),
- nacl_startup_auxv (info),
- &__libc_csu_init, &__libc_csu_fini,
- nacl_startup_fini (info),
- __builtin_frame_address (0));
-
- /* That should not return. Make sure we crash if it did. */
- while (1)
- __builtin_trap ();
-}
diff --git a/sysdeps/nacl/symlink.c b/sysdeps/nacl/symlink.c
deleted file mode 100644
index 198902e39e..0000000000
--- a/sysdeps/nacl/symlink.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Make a symbolic link. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Make a symbolic link to FROM called TO. */
-int
-__symlink (const char *from, const char *to)
-{
- return NACL_CALL (__nacl_irt_dev_filename.symlink (from, to), 0);
-}
-weak_alias (__symlink, symlink)
diff --git a/sysdeps/nacl/tls.h b/sysdeps/nacl/tls.h
deleted file mode 100644
index c56ff37d2f..0000000000
--- a/sysdeps/nacl/tls.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Definition for thread-local data handling. NaCl version.
- Copyright (C) 2015-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 _NACL_TLS_H
-#define _NACL_TLS_H 1
-
-#ifndef __ASSEMBLER__
-
-# include <nacl-interfaces.h>
-
-/* Code to initially initialize the thread pointer. This might need
- special attention since 'errno' is not yet available and if the
- operation can cause a failure 'errno' must not be touched. */
-# define TLS_INIT_TP(tcbp) \
- ((*__nacl_irt_tls.tls_init) (tcbp) == 0 ? NULL : "tls_init call failed")
-
-/* Our use of dl_sysinfo is rather different from the Linux syscall
- entry-point case. We never need a thread-local copy of the value. */
-# undef SETUP_THREAD_SYSINFO
-# undef CHECK_THREAD_SYSINFO
-# define SETUP_THREAD_SYSINFO(pd) ((void) (pd))
-# define CHECK_THREAD_SYSINFO(pd) ((void) (pd))
-
-#endif /* __ASSEMBLER__ */
-
-#endif /* tls.h */
diff --git a/sysdeps/nacl/truncate.c b/sysdeps/nacl/truncate.c
deleted file mode 100644
index 0497824cd2..0000000000
--- a/sysdeps/nacl/truncate.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Truncate a file (by name). NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Truncate PATH to LENGTH bytes. */
-int
-__truncate (const char *path, off_t length)
-{
- return NACL_CALL (__nacl_irt_dev_filename.truncate (path, length), 0);
-}
-weak_alias (__truncate, truncate)
-
-/* truncate64 is the same as truncate. */
-strong_alias (__truncate, __truncate64)
-weak_alias (__truncate64, truncate64)
diff --git a/sysdeps/nacl/truncate64.c b/sysdeps/nacl/truncate64.c
deleted file mode 100644
index 729d0d01db..0000000000
--- a/sysdeps/nacl/truncate64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* truncate64 is the same as truncate. */
diff --git a/sysdeps/nacl/uname-values.h b/sysdeps/nacl/uname-values.h
deleted file mode 100644
index a907234cbc..0000000000
--- a/sysdeps/nacl/uname-values.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Constant values for the uname function to return. NaCl version.
- Copyright (C) 2015-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 file must define these macros with string values:
- UNAME_SYSNAME
- UNAME_RELEASE
- UNAME_VERSION
- UNAME_MACHINE
-*/
-
-#ifndef UNAME_MACHINE
-# error "sysdeps/MACHINE/nacl/uname-values.h should define UNAME_MACHINE"
-#endif
-
-#define UNAME_SYSNAME "NaCl"
-#define UNAME_RELEASE "unknown"
-#define UNAME_VERSION "unknown"
diff --git a/sysdeps/nacl/unlink.c b/sysdeps/nacl/unlink.c
deleted file mode 100644
index 76f4ee94de..0000000000
--- a/sysdeps/nacl/unlink.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Remove a file. NaCl version.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-/* Remove the link named NAME. */
-int
-__unlink (const char *name)
-{
- return NACL_CALL (__nacl_irt_dev_filename.unlink (name), 0);
-}
-weak_alias (__unlink, unlink)
diff --git a/sysdeps/nacl/utimes.c b/sysdeps/nacl/utimes.c
deleted file mode 100644
index 06b0c0ebcb..0000000000
--- a/sysdeps/nacl/utimes.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Change the access and modification times of a file. NaCl version.
- Copyright (C) 2015-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/time.h>
-#include <nacl-interfaces.h>
-
-/* Change the access time of FILE to TVP[0] and
- the modification time of FILE to TVP[1]. */
-int
-__utimes (const char *file, const struct timeval tvp[2])
-{
- return NACL_CALL (__nacl_irt_dev_filename.utimes (file, tvp), 0);
-}
-weak_alias (__utimes, utimes)
diff --git a/sysdeps/nacl/xstat.c b/sysdeps/nacl/xstat.c
deleted file mode 100644
index 531f7b477b..0000000000
--- a/sysdeps/nacl/xstat.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Get stat information from a file name. NaCl version.
- Copyright (C) 2015-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/>. */
-
-/* Avoid the declaration so the compiler doesn't complain about the alias
- with a different type signature. It doesn't know that 'struct stat'
- and 'struct stat64' are ABI-compatible. */
-#define __xstat64 __xstat64_avoid
-#include <sys/stat.h>
-#undef __xstat64
-
-#include <errno.h>
-#include <stddef.h>
-
-#include <xstatconv.h>
-
-#undef stat
-
-/* Get file information about FILE in BUF. */
-int
-__xstat (int vers, const char *file, struct stat *buf)
-{
- nacl_abi_stat_t abi_buf;
- return NACL_CALL (__nacl_irt_dev_filename.stat (file, &abi_buf),
- __xstat_conv (vers, &abi_buf, buf));
-}
-hidden_def (__xstat)
-weak_alias (__xstat, _xstat)
-
-strong_alias (__xstat, __xstat64)
-hidden_ver (__xstat, __xstat64)
diff --git a/sysdeps/nacl/xstat64.c b/sysdeps/nacl/xstat64.c
deleted file mode 100644
index 47db9b9368..0000000000
--- a/sysdeps/nacl/xstat64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* xstat.c defines __xstat64 as an alias. */
diff --git a/sysdeps/nacl/xstatconv.c b/sysdeps/nacl/xstatconv.c
deleted file mode 100644
index 7223198f0f..0000000000
--- a/sysdeps/nacl/xstatconv.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Convert between the NaCl ABI's `struct stat' format, and libc's.
- Copyright (C) 2015-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 <string.h>
-#include <sys/stat.h>
-#include <xstatconv.h>
-
-internal_function
-int
-__xstat_conv (int vers, const struct nacl_abi_stat *kbuf, void *ubuf)
-{
- /* It's kosher enough just to crash here, but there are some
- existing NaCl tests that like to see EFAULT, and that's what
- making the IRT call with NULL would give. */
- if (__glibc_unlikely (ubuf == NULL))
- {
- __set_errno (EFAULT);
- return -1;
- }
-
- switch (vers)
- {
- case _STAT_VER_NACL:
- /* Nothing to do. The struct is in the form the NaCl ABI expects. */
- *(struct nacl_abi_stat *) ubuf = *kbuf;
- break;
-
- case _STAT_VER_LINUX:
- {
- struct stat *buf = ubuf;
-
- /* Zero-fill the pad/unused fields. */
- memset (buf, 0, sizeof *buf);
-
- /* Convert from NaCl IRT ABI `struct stat'. */
- buf->st_dev = kbuf->nacl_abi_st_dev;
- buf->st_ino = kbuf->nacl_abi_st_ino;
- buf->st_mode = kbuf->nacl_abi_st_mode;
- buf->st_nlink = kbuf->nacl_abi_st_nlink;
- buf->st_uid = kbuf->nacl_abi_st_uid;
- buf->st_gid = kbuf->nacl_abi_st_gid;
- buf->st_rdev = kbuf->nacl_abi_st_rdev;
- buf->st_size = kbuf->nacl_abi_st_size;
- buf->st_blksize = kbuf->nacl_abi_st_blksize;
- buf->st_blocks = kbuf->nacl_abi_st_blocks;
- buf->st_atim.tv_sec = kbuf->nacl_abi_st_atime;
- buf->st_atim.tv_nsec = kbuf->nacl_abi_st_atimensec;
- buf->st_mtim.tv_sec = kbuf->nacl_abi_st_mtime;
- buf->st_mtim.tv_nsec = kbuf->nacl_abi_st_mtimensec;
- buf->st_ctim.tv_sec = kbuf->nacl_abi_st_ctime;
- buf->st_ctim.tv_nsec = kbuf->nacl_abi_st_ctimensec;
- }
- break;
-
- default:
- __set_errno (EINVAL);
- return -1;
- }
-
- return 0;
-}
diff --git a/sysdeps/nacl/xstatconv.h b/sysdeps/nacl/xstatconv.h
deleted file mode 100644
index 08c87a9108..0000000000
--- a/sysdeps/nacl/xstatconv.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Convert between the NaCl ABI's `struct stat' format, and libc's.
- Copyright (C) 2015-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 <nacl-interfaces.h>
-
-#define NACL_IN_TOOLCHAIN_HEADERS
-
-struct stat;
-
-/* stat.h uses nacl_abi_off_t, but irt.h defines only nacl_irt_off_t. */
-typedef nacl_irt_off_t nacl_abi_off_t;
-
-/* We use this header to define struct nacl_abi_stat. */
-#include <native_client/src/trusted/service_runtime/include/bits/stat.h>
-
-extern int __xstat_conv (int vers, const struct nacl_abi_stat *, void *)
- internal_function attribute_hidden;
diff --git a/sysdeps/nios2/Implies b/sysdeps/nios2/Implies
index 387a0ca052..7d69983412 100644
--- a/sysdeps/nios2/Implies
+++ b/sysdeps/nios2/Implies
@@ -1,3 +1,4 @@
wordsize-32
+ieee754/soft-fp
ieee754/dbl-64
ieee754/flt-32
diff --git a/sysdeps/nios2/Makefile b/sysdeps/nios2/Makefile
index c63a6a0c72..25fc2abfee 100644
--- a/sysdeps/nios2/Makefile
+++ b/sysdeps/nios2/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1993-2016 Free Software Foundation, Inc.
+# Copyright (C) 1993-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -22,14 +22,9 @@ pic-ccflag = -fpic
long-double-fcts = no
ifeq ($(subdir),soft-fp)
-sysdep_routines += $(filter-out sqrtsf2,$(gcc-single-routines)) \
- $(filter-out sqrtdf2,$(gcc-double-routines))
+sysdep_routines += $(gcc-single-routines) $(gcc-double-routines)
endif
ifeq ($(subdir),csu)
gen-as-const-headers += tcb-offsets.sym
endif
-
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
diff --git a/sysdeps/nios2/__longjmp.S b/sysdeps/nios2/__longjmp.S
index 7b89e3d93c..d8a6edab8a 100644
--- a/sysdeps/nios2/__longjmp.S
+++ b/sysdeps/nios2/__longjmp.S
@@ -1,5 +1,5 @@
/* longjmp for Nios II.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/backtrace.c b/sysdeps/nios2/backtrace.c
deleted file mode 100644
index 27ce597b39..0000000000
--- a/sysdeps/nios2/backtrace.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/x86_64/backtrace.c>
diff --git a/sysdeps/nios2/bits/fenv.h b/sysdeps/nios2/bits/fenv.h
index 9d046217c8..c39286658b 100644
--- a/sysdeps/nios2/bits/fenv.h
+++ b/sysdeps/nios2/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -42,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/bits/link.h b/sysdeps/nios2/bits/link.h
index 46eb7b1a8f..c34198866f 100644
--- a/sysdeps/nios2/bits/link.h
+++ b/sysdeps/nios2/bits/link.h
@@ -1,5 +1,5 @@
/* Machine-specific declarations for dynamic linker interface, Nios II version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/bits/setjmp.h b/sysdeps/nios2/bits/setjmp.h
index 8b3865d304..b5cef8b2da 100644
--- a/sysdeps/nios2/bits/setjmp.h
+++ b/sysdeps/nios2/bits/setjmp.h
@@ -1,5 +1,5 @@
/* Define the machine-dependent type `jmp_buf'. Nios II version.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/crti.S b/sysdeps/nios2/crti.S
index 921cae7e37..46ab896ac0 100644
--- a/sysdeps/nios2/crti.S
+++ b/sysdeps/nios2/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for Nios II.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -57,6 +57,7 @@
.section .init,"ax",@progbits
.align 2
.global _init
+ .hidden _init
.type _init, @function
_init:
addi sp, sp, -8
@@ -84,6 +85,7 @@ _init:
.section .fini,"ax",@progbits
.align 2
.global _fini
+ .hidden _fini
.type _fini, @function
_fini:
addi sp, sp, -8
diff --git a/sysdeps/nios2/crtn.S b/sysdeps/nios2/crtn.S
index e1dc6bc6d5..18fe2e0036 100644
--- a/sysdeps/nios2/crtn.S
+++ b/sysdeps/nios2/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for Nios II.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/dl-init.c b/sysdeps/nios2/dl-init.c
index f7864984a4..a691706e70 100644
--- a/sysdeps/nios2/dl-init.c
+++ b/sysdeps/nios2/dl-init.c
@@ -1,5 +1,5 @@
/* Nios II specific procedures for initializing code.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,6 @@
#include <elf/dl-init.c>
unsigned int
-internal_function
_dl_nios2_get_gp_value (struct link_map *main_map)
{
ElfW(Dyn) *dyn = main_map->l_ld;
diff --git a/sysdeps/nios2/dl-machine.h b/sysdeps/nios2/dl-machine.h
index 8b4763ea05..1f57a343e0 100644
--- a/sysdeps/nios2/dl-machine.h
+++ b/sysdeps/nios2/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. Nios II version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -207,6 +207,7 @@ _start:\n\
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
@@ -249,7 +250,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
{
const Elf32_Sym *const refsym = sym;
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
switch (r_type)
{
diff --git a/sysdeps/nios2/dl-sysdep.h b/sysdeps/nios2/dl-sysdep.h
index eaaf406316..35103afdac 100644
--- a/sysdeps/nios2/dl-sysdep.h
+++ b/sysdeps/nios2/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. Nios II version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/dl-tls.h b/sysdeps/nios2/dl-tls.h
index cd794610b6..2f4636233b 100644
--- a/sysdeps/nios2/dl-tls.h
+++ b/sysdeps/nios2/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. Nios II version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -43,6 +43,3 @@ extern void *__tls_get_addr (tls_index *ti);
# define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
# define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/nios2/dl-trampoline.S b/sysdeps/nios2/dl-trampoline.S
index 4b90c619db..37f738e8f6 100644
--- a/sysdeps/nios2/dl-trampoline.S
+++ b/sysdeps/nios2/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. Nios II version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/gccframe.h b/sysdeps/nios2/gccframe.h
index 739e37c756..d031e90e88 100644
--- a/sysdeps/nios2/gccframe.h
+++ b/sysdeps/nios2/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. Nios II version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/gmp-mparam.h b/sysdeps/nios2/gmp-mparam.h
index c83ab99659..8f9c107d1a 100644
--- a/sysdeps/nios2/gmp-mparam.h
+++ b/sysdeps/nios2/gmp-mparam.h
@@ -1,6 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright (C) 2015-2016 Free Software Foundation, Inc.
+Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/nios2/jmpbuf-offsets.h b/sysdeps/nios2/jmpbuf-offsets.h
index 3c62704dc8..877b958acd 100644
--- a/sysdeps/nios2/jmpbuf-offsets.h
+++ b/sysdeps/nios2/jmpbuf-offsets.h
@@ -1,5 +1,5 @@
/* Private macros for accessing __jmp_buf contents. Nios II version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/jmpbuf-unwind.h b/sysdeps/nios2/jmpbuf-unwind.h
index 8796061889..18b7c6fa37 100644
--- a/sysdeps/nios2/jmpbuf-unwind.h
+++ b/sysdeps/nios2/jmpbuf-unwind.h
@@ -1,5 +1,5 @@
/* Examine __jmp_buf for unwinding frames. Nios II version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/ldbl-classify-compat.h b/sysdeps/nios2/ldbl-classify-compat.h
new file mode 100644
index 0000000000..a9614de9df
--- /dev/null
+++ b/sysdeps/nios2/ldbl-classify-compat.h
@@ -0,0 +1,8 @@
+#ifndef NIOS2_LDBL_CLASSIFY_COMPAT_H
+#define NIOS2_LDBL_CLASSIFY_COMPAT_H 1
+
+/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
+ when built without long double support. */
+#define LDBL_CLASSIFY_COMPAT 1
+
+#endif
diff --git a/sysdeps/nios2/ldsodefs.h b/sysdeps/nios2/ldsodefs.h
index 87d1b8e8bf..b68fb03fe3 100644
--- a/sysdeps/nios2/ldsodefs.h
+++ b/sysdeps/nios2/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/libc-tls.c b/sysdeps/nios2/libc-tls.c
index 82a3e3e1c8..d91af00a1e 100644
--- a/sysdeps/nios2/libc-tls.c
+++ b/sysdeps/nios2/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. Nios II version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/libm-test-ulps b/sysdeps/nios2/libm-test-ulps
index f1a01fdb30..0b9ef2afec 100644
--- a/sysdeps/nios2/libm-test-ulps
+++ b/sysdeps/nios2/libm-test-ulps
@@ -46,15 +46,15 @@ idouble: 1
ifloat: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Imaginary part of "cacosh":
@@ -74,15 +74,15 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Imaginary part of "casinh":
@@ -92,7 +92,9 @@ idouble: 1
ifloat: 1
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Imaginary part of "catan":
@@ -108,7 +110,9 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "cbrt":
@@ -176,7 +180,9 @@ idouble: 2
ifloat: 2
Function: "cos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "cosh":
@@ -187,9 +193,9 @@ ifloat: 1
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
Function: Imaginary part of "cpow":
float: 2
@@ -231,15 +237,15 @@ ifloat: 1
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Real part of "ctanh":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Imaginary part of "ctanh":
double: 2
@@ -336,19 +342,21 @@ idouble: 2
ifloat: 1
Function: "pow":
+double: 1
float: 3
+idouble: 1
ifloat: 3
-Function: "pow10":
-double: 2
-idouble: 2
-
Function: "sin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "sincos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "sinh":
@@ -387,8 +395,8 @@ ifloat: 2
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
# end of automatic generation
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/machine-gmon.h b/sysdeps/nios2/machine-gmon.h
index a20d010d24..5d0ff9d5d4 100644
--- a/sysdeps/nios2/machine-gmon.h
+++ b/sysdeps/nios2/machine-gmon.h
@@ -1,5 +1,5 @@
/* Machine-dependent definitions for profiling support. Nios II version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/math-tests.h b/sysdeps/nios2/math-tests.h
index f8f8b66cf5..a1c2762786 100644
--- a/sysdeps/nios2/math-tests.h
+++ b/sysdeps/nios2/math-tests.h
@@ -1,5 +1,5 @@
/* Configuration for math tests. Nios II version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/math_private.h b/sysdeps/nios2/math_private.h
deleted file mode 100644
index 373da2a621..0000000000
--- a/sysdeps/nios2/math_private.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef NIO2_MATH_PRIVATE_H
-#define NIO2_MATH_PRIVATE_H 1
-
-/* Suppress use of exceptions here to avoid build errors if the FE_*
- macros aren't defined. Only allow rounding modes implemented for Nios II.
-
- This does mean that some code will silently fail to report exceptions,
- set rounding mode as expected, etc., but it allows math code to compile
- that otherwise wouldn't (such as math/s_fma.c) and so is valuable.
-
- We intentionally ignore the "exception" arguments of functions that
- take an exception, since we can't even evaluate the argument
- without causing a build failure. The extra level of statement
- expression wrapping avoids "statement with no effect" warnings.
- Since the callers don't check for errors anyway, we just claim
- success in every case.
-
- The overrides for libc_ functions must happen before we include
- the generic math_private.h, and the overrides for regular
- <fenv.h> functions must happen afterwards, to avoid clashing with
- the declarations of those functions. */
-
-#define libc_fesetround(rnd) ({ 0; })
-#define libc_fetestexcept(exc) ({ 0; })
-#define libc_feholdexcept_setround(env, exc) ({ (void) (env); 0; })
-#define libc_feupdateenv_test(env, exc) ({ (void) (env); 0; })
-
-/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
- when built without long double support. */
-#define LDBL_CLASSIFY_COMPAT 1
-
-#include_next <math_private.h>
-
-#define feraiseexcept(excepts) ({ 0; })
-#define __feraiseexcept(excepts) ({ 0; })
-#define feclearexcept(exc) ({ 0; })
-
-#endif
diff --git a/sysdeps/nios2/memusage.h b/sysdeps/nios2/memusage.h
index f1b56bdd4b..459c811a4d 100644
--- a/sysdeps/nios2/memusage.h
+++ b/sysdeps/nios2/memusage.h
@@ -1,5 +1,5 @@
/* Machine-specific definitions for memory usage profiling, Nios II version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/nptl/Makefile b/sysdeps/nios2/nptl/Makefile
index 88181acbef..bff5331346 100644
--- a/sysdeps/nios2/nptl/Makefile
+++ b/sysdeps/nios2/nptl/Makefile
@@ -1,5 +1,5 @@
# NPTL makefile fragment for Nios II.
-# Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# Copyright (C) 2005-2018 Free Software Foundation, Inc.
#
# This file is part of the GNU C Library.
#
diff --git a/sysdeps/nios2/nptl/bits/pthreadtypes-arch.h b/sysdeps/nios2/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..0917cae580
--- /dev/null
+++ b/sysdeps/nios2/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,72 @@
+/* Machine-specific pthread type layouts. Nios II version.
+ Copyright (C) 2012-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <endian.h>
+
+#define __SIZEOF_PTHREAD_ATTR_T 36
+#define __SIZEOF_PTHREAD_MUTEX_T 24
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCK_T 32
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIER_T 20
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Data structure for mutex handling. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1
+#define __PTHREAD_MUTEX_USE_UNION 1
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+#else
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ unsigned char __shared;
+ unsigned char __pad1;
+ unsigned char __pad2;
+#endif
+ int __cur_writer;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/nios2/nptl/bits/pthreadtypes.h b/sysdeps/nios2/nptl/bits/pthreadtypes.h
deleted file mode 100644
index 76076d009a..0000000000
--- a/sysdeps/nios2/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/* Machine-specific pthread type layouts. Nios II version.
- 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/>. */
-
-#ifndef _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <endian.h>
-
-#define __SIZEOF_PTHREAD_ATTR_T 36
-#define __SIZEOF_PTHREAD_MUTEX_T 24
-#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-#define __SIZEOF_PTHREAD_COND_T 48
-#define __SIZEOF_PTHREAD_CONDATTR_T 4
-#define __SIZEOF_PTHREAD_RWLOCK_T 32
-#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-#define __SIZEOF_PTHREAD_BARRIER_T 20
-#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-
-
-/* Thread identifiers. The structure of the attribute type is
- deliberately not exposed. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is deliberately not exposed. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- long int __align;
-} pthread_mutexattr_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- long int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
-#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned char __pad1;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
-#else
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- unsigned char __shared;
- unsigned char __pad1;
- unsigned char __pad2;
-#endif
- int __writer;
- } __data;
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/nios2/nptl/bits/semaphore.h b/sysdeps/nios2/nptl/bits/semaphore.h
index d877316904..457b83e54f 100644
--- a/sysdeps/nios2/nptl/bits/semaphore.h
+++ b/sysdeps/nios2/nptl/bits/semaphore.h
@@ -1,5 +1,5 @@
/* Machine-specific POSIX semaphore type layouts. Nios II version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/nptl/pthread-offsets.h b/sysdeps/nios2/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..9617354dc7
--- /dev/null
+++ b/sysdeps/nios2/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+#define __PTHREAD_MUTEX_KIND_OFFSET 12
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 20
diff --git a/sysdeps/nios2/nptl/pthread_spin_lock.c b/sysdeps/nios2/nptl/pthread_spin_lock.c
deleted file mode 100644
index 481c563355..0000000000
--- a/sysdeps/nios2/nptl/pthread_spin_lock.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* pthread spin-lock implementation for Nios II.
- Copyright (C) 2005-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 SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
-
-/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because
- it will resolve to this very file. Using "sysdeps/.." as reference to the
- top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
diff --git a/sysdeps/nios2/nptl/pthreaddef.h b/sysdeps/nios2/nptl/pthreaddef.h
index d74891a08b..b70d1d17b3 100644
--- a/sysdeps/nios2/nptl/pthreaddef.h
+++ b/sysdeps/nios2/nptl/pthreaddef.h
@@ -1,5 +1,5 @@
/* pthread machine parameter definitions, Nios II version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/nptl/tcb-offsets.sym b/sysdeps/nios2/nptl/tcb-offsets.sym
index d9ae952585..3cd8d984ac 100644
--- a/sysdeps/nios2/nptl/tcb-offsets.sym
+++ b/sysdeps/nios2/nptl/tcb-offsets.sym
@@ -9,6 +9,5 @@
# define thread_offsetof(mem) ((ptrdiff_t) THREAD_SELF + offsetof (struct pthread, mem))
MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
-PID_OFFSET thread_offsetof (pid)
TID_OFFSET thread_offsetof (tid)
POINTER_GUARD (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
diff --git a/sysdeps/nios2/nptl/tls.h b/sysdeps/nios2/nptl/tls.h
index ad29ac5ac2..6fedb2a556 100644
--- a/sysdeps/nios2/nptl/tls.h
+++ b/sysdeps/nios2/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/Nios II version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,17 +25,7 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
@@ -147,6 +137,7 @@ register struct pthread *__thread_self __asm__("r23");
# define NO_TLS_OFFSET -1
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/nios2/s_fma.c b/sysdeps/nios2/s_fma.c
deleted file mode 100644
index d9613fa67c..0000000000
--- a/sysdeps/nios2/s_fma.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <soft-fp/fmadf4.c>
diff --git a/sysdeps/nios2/s_fmaf.c b/sysdeps/nios2/s_fmaf.c
deleted file mode 100644
index aa5c9b2d91..0000000000
--- a/sysdeps/nios2/s_fmaf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <soft-fp/fmasf4.c>
diff --git a/sysdeps/nios2/setjmp.S b/sysdeps/nios2/setjmp.S
index 14eb092224..5e48e68528 100644
--- a/sysdeps/nios2/setjmp.S
+++ b/sysdeps/nios2/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for Nios II.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/sotruss-lib.c b/sysdeps/nios2/sotruss-lib.c
index df8f9613b9..7d8261ff2d 100644
--- a/sysdeps/nios2/sotruss-lib.c
+++ b/sysdeps/nios2/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for Nios II.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/nios2/stackinfo.h b/sysdeps/nios2/stackinfo.h
index cc0d0f5124..341f7f6f86 100644
--- a/sysdeps/nios2/stackinfo.h
+++ b/sysdeps/nios2/stackinfo.h
@@ -1,5 +1,5 @@
/* Stack environment definitions for Nios II.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/start.S b/sysdeps/nios2/start.S
index 210fa74b87..fa224ef75c 100644
--- a/sysdeps/nios2/start.S
+++ b/sysdeps/nios2/start.S
@@ -1,5 +1,5 @@
/* Startup code for Nios II
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/sysdep.h b/sysdeps/nios2/sysdep.h
index ebcfc20e67..38ea9456af 100644
--- a/sysdeps/nios2/sysdep.h
+++ b/sysdeps/nios2/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for Nios II.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nios2/tst-audit.h b/sysdeps/nios2/tst-audit.h
index 5e4b9abf02..ac7e8943fd 100644
--- a/sysdeps/nios2/tst-audit.h
+++ b/sysdeps/nios2/tst-audit.h
@@ -1,5 +1,5 @@
/* Definitions for testing PLT entry/exit auditing. Nios II version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nptl/Makeconfig b/sysdeps/nptl/Makeconfig
index 2f4918d112..ce8998bbf5 100644
--- a/sysdeps/nptl/Makeconfig
+++ b/sysdeps/nptl/Makeconfig
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -16,17 +16,12 @@
# License along with the GNU C Library; if not, see
# <http://www.gnu.org/licenses/>.
-# Makeconfig fragment for NPTL add-on.
+# Makeconfig fragment for NPTL.
# This gets included at the end of the main glibc Makeconfig.
have-thread-library = yes
-shared-thread-library = $(common-objpfx)nptl/libpthread_nonshared.a \
- $(common-objpfx)nptl/libpthread.so
+shared-thread-library = $(common-objpfx)nptl/libpthread.so
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/Makefile b/sysdeps/nptl/Makefile
index 0dbbd72b27..6b87b82759 100644
--- a/sysdeps/nptl/Makefile
+++ b/sysdeps/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/nptl/aio_misc.h b/sysdeps/nptl/aio_misc.h
index a7a8a12060..206d8e193d 100644
--- a/sysdeps/nptl/aio_misc.h
+++ b/sysdeps/nptl/aio_misc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nptl/allocrtsig.c b/sysdeps/nptl/allocrtsig.c
index ead2832d75..2039d62a83 100644
--- a/sysdeps/nptl/allocrtsig.c
+++ b/sysdeps/nptl/allocrtsig.c
@@ -1,5 +1,5 @@
/* Handle real-time signal allocation. NPTL version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nptl/bits/pthreadtypes.h b/sysdeps/nptl/bits/pthreadtypes.h
new file mode 100644
index 0000000000..70ce0a0448
--- /dev/null
+++ b/sysdeps/nptl/bits/pthreadtypes.h
@@ -0,0 +1,121 @@
+/* Declaration of common pthread types for all architectures.
+ Copyright (C) 2017-2018 Free Software 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 _BITS_PTHREADTYPES_COMMON_H
+# define _BITS_PTHREADTYPES_COMMON_H 1
+
+/* For internal mutex and condition variable definitions. */
+#include <bits/thread-shared-types.h>
+
+/* Thread identifiers. The structure of the attribute type is not
+ exposed on purpose. */
+typedef unsigned long int pthread_t;
+
+
+/* Data structures for mutex handling. The structure of the attribute
+ type is not exposed on purpose. */
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
+ int __align;
+} pthread_mutexattr_t;
+
+
+/* Data structure for condition variable handling. The structure of
+ the attribute type is not exposed on purpose. */
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_CONDATTR_T];
+ int __align;
+} pthread_condattr_t;
+
+
+/* Keys for thread-specific data */
+typedef unsigned int pthread_key_t;
+
+
+/* Once-only execution */
+typedef int __ONCE_ALIGNMENT pthread_once_t;
+
+
+union pthread_attr_t
+{
+ char __size[__SIZEOF_PTHREAD_ATTR_T];
+ long int __align;
+};
+#ifndef __have_pthread_attr_t
+typedef union pthread_attr_t pthread_attr_t;
+# define __have_pthread_attr_t 1
+#endif
+
+
+typedef union
+{
+ struct __pthread_mutex_s __data;
+ char __size[__SIZEOF_PTHREAD_MUTEX_T];
+ long int __align;
+} pthread_mutex_t;
+
+
+typedef union
+{
+ struct __pthread_cond_s __data;
+ char __size[__SIZEOF_PTHREAD_COND_T];
+ __extension__ long long int __align;
+} pthread_cond_t;
+
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+/* Data structure for reader-writer lock variable handling. The
+ structure of the attribute type is deliberately not exposed. */
+typedef union
+{
+ struct __pthread_rwlock_arch_t __data;
+ char __size[__SIZEOF_PTHREAD_RWLOCK_T];
+ long int __align;
+} pthread_rwlock_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
+ long int __align;
+} pthread_rwlockattr_t;
+#endif
+
+
+#ifdef __USE_XOPEN2K
+/* POSIX spinlock data type. */
+typedef volatile int pthread_spinlock_t;
+
+
+/* POSIX barriers data type. The structure of the type is
+ deliberately not exposed. */
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_BARRIER_T];
+ long int __align;
+} pthread_barrier_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
+ int __align;
+} pthread_barrierattr_t;
+#endif
+
+#endif
diff --git a/sysdeps/nptl/bits/thread-shared-types.h b/sysdeps/nptl/bits/thread-shared-types.h
new file mode 100644
index 0000000000..1e2092a05d
--- /dev/null
+++ b/sysdeps/nptl/bits/thread-shared-types.h
@@ -0,0 +1,178 @@
+/* Common threading primitives definitions for both POSIX and C11.
+ Copyright (C) 2017-2018 Free Software 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 _THREAD_SHARED_TYPES_H
+#define _THREAD_SHARED_TYPES_H 1
+
+/* Arch-specific definitions. Each architecture must define the following
+ macros to define the expected sizes of pthread data types:
+
+ __SIZEOF_PTHREAD_ATTR_T - size of pthread_attr_t.
+ __SIZEOF_PTHREAD_MUTEX_T - size of pthread_mutex_t.
+ __SIZEOF_PTHREAD_MUTEXATTR_T - size of pthread_mutexattr_t.
+ __SIZEOF_PTHREAD_COND_T - size of pthread_cond_t.
+ __SIZEOF_PTHREAD_CONDATTR_T - size of pthread_condattr_t.
+ __SIZEOF_PTHREAD_RWLOCK_T - size of pthread_rwlock_t.
+ __SIZEOF_PTHREAD_RWLOCKATTR_T - size of pthread_rwlockattr_t.
+ __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t.
+ __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
+
+ Also, the following macros must be define for internal pthread_mutex_t
+ struct definitions (struct __pthread_mutex_s):
+
+ __PTHREAD_COMPAT_PADDING_MID - any additional members after 'kind'
+ and before '__spin' (for 64 bits) or
+ '__nusers' (for 32 bits).
+ __PTHREAD_COMPAT_PADDING_END - any additional members at the end of
+ the internal structure.
+ __PTHREAD_MUTEX_LOCK_ELISION - 1 if the architecture supports lock
+ elision or 0 otherwise.
+ __PTHREAD_MUTEX_NUSERS_AFTER_KIND - control where to put __nusers. The
+ preferred value for new architectures
+ is 0.
+ __PTHREAD_MUTEX_USE_UNION - control whether internal __spins and
+ __list will be place inside a union for
+ linuxthreads compatibility.
+ The preferred value for new architectures
+ is 0.
+
+ For a new port the preferred values for the required defines are:
+
+ #define __PTHREAD_COMPAT_PADDING_MID
+ #define __PTHREAD_COMPAT_PADDING_END
+ #define __PTHREAD_MUTEX_LOCK_ELISION 0
+ #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
+ #define __PTHREAD_MUTEX_USE_UNION 0
+
+ __PTHREAD_MUTEX_LOCK_ELISION can be set to 1 if the hardware plans to
+ eventually support lock elision using transactional memory.
+
+ The additional macro defines any constraint for the lock alignment
+ inside the thread structures:
+
+ __LOCK_ALIGNMENT - for internal lock/futex usage.
+
+ Same idea but for the once locking primitive:
+
+ __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
+
+ And finally the internal pthread_rwlock_t (struct __pthread_rwlock_arch_t)
+ must be defined.
+ */
+#include <bits/pthreadtypes-arch.h>
+
+/* Common definition of pthread_mutex_t. */
+
+#if !__PTHREAD_MUTEX_USE_UNION
+typedef struct __pthread_internal_list
+{
+ struct __pthread_internal_list *__prev;
+ struct __pthread_internal_list *__next;
+} __pthread_list_t;
+#else
+typedef struct __pthread_internal_slist
+{
+ struct __pthread_internal_slist *__next;
+} __pthread_slist_t;
+#endif
+
+/* Lock elision support. */
+#if __PTHREAD_MUTEX_LOCK_ELISION
+# if !__PTHREAD_MUTEX_USE_UNION
+# define __PTHREAD_SPINS_DATA \
+ short __spins; \
+ short __elision
+# define __PTHREAD_SPINS 0, 0
+# else
+# define __PTHREAD_SPINS_DATA \
+ struct \
+ { \
+ short __espins; \
+ short __eelision; \
+ } __elision_data
+# define __PTHREAD_SPINS { 0, 0 }
+# define __spins __elision_data.__espins
+# define __elision __elision_data.__eelision
+# endif
+#else
+# define __PTHREAD_SPINS_DATA int __spins
+/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
+# define __PTHREAD_SPINS 0
+#endif
+
+struct __pthread_mutex_s
+{
+ int __lock __LOCK_ALIGNMENT;
+ unsigned int __count;
+ int __owner;
+#if !__PTHREAD_MUTEX_NUSERS_AFTER_KIND
+ unsigned int __nusers;
+#endif
+ /* KIND must stay at this position in the structure to maintain
+ binary compatibility with static initializers. */
+ int __kind;
+ __PTHREAD_COMPAT_PADDING_MID
+#if __PTHREAD_MUTEX_NUSERS_AFTER_KIND
+ unsigned int __nusers;
+#endif
+#if !__PTHREAD_MUTEX_USE_UNION
+ __PTHREAD_SPINS_DATA;
+ __pthread_list_t __list;
+# define __PTHREAD_MUTEX_HAVE_PREV 1
+#else
+ __extension__ union
+ {
+ __PTHREAD_SPINS_DATA;
+ __pthread_slist_t __list;
+ };
+# define __PTHREAD_MUTEX_HAVE_PREV 0
+#endif
+ __PTHREAD_COMPAT_PADDING_END
+};
+
+
+/* Common definition of pthread_cond_t. */
+
+struct __pthread_cond_s
+{
+ __extension__ union
+ {
+ __extension__ unsigned long long int __wseq;
+ struct
+ {
+ unsigned int __low;
+ unsigned int __high;
+ } __wseq32;
+ };
+ __extension__ union
+ {
+ __extension__ unsigned long long int __g1_start;
+ struct
+ {
+ unsigned int __low;
+ unsigned int __high;
+ } __g1_start32;
+ };
+ unsigned int __g_refs[2] __LOCK_ALIGNMENT;
+ unsigned int __g_size[2];
+ unsigned int __g1_orig_size;
+ unsigned int __wrefs;
+ unsigned int __g_signals[2];
+};
+
+#endif /* _THREAD_SHARED_TYPES_H */
diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
index 27f8d52e30..ec56a827eb 100644
--- a/sysdeps/nptl/fork.c
+++ b/sysdeps/nptl/fork.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -31,7 +31,7 @@
#include <fork.h>
#include <arch-fork.h>
#include <futex-internal.h>
-
+#include <malloc/malloc-internal.h>
static void
fresetlockfiles (void)
@@ -48,100 +48,41 @@ pid_t
__libc_fork (void)
{
pid_t pid;
- struct used_handler
- {
- struct fork_handler *handler;
- struct used_handler *next;
- } *allp = NULL;
-
- /* Run all the registered preparation handlers. In reverse order.
- While doing this we build up a list of all the entries. */
- struct fork_handler *runp;
- while ((runp = __fork_handlers) != NULL)
- {
- /* Make sure we read from the current RUNP pointer. */
- atomic_full_barrier ();
-
- unsigned int oldval = runp->refcntr;
-
- if (oldval == 0)
- /* This means some other thread removed the list just after
- the pointer has been loaded. Try again. Either the list
- is empty or we can retry it. */
- continue;
-
- /* Bump the reference counter. */
- if (atomic_compare_and_exchange_bool_acq (&__fork_handlers->refcntr,
- oldval + 1, oldval))
- /* The value changed, try again. */
- continue;
-
- /* We bumped the reference counter for the first entry in the
- list. That means that none of the following entries will
- just go away. The unloading code works in the order of the
- list.
-
- While executing the registered handlers we are building a
- list of all the entries so that we can go backward later on. */
- while (1)
- {
- /* Execute the handler if there is one. */
- if (runp->prepare_handler != NULL)
- runp->prepare_handler ();
-
- /* Create a new element for the list. */
- struct used_handler *newp
- = (struct used_handler *) alloca (sizeof (*newp));
- newp->handler = runp;
- newp->next = allp;
- allp = newp;
-
- /* Advance to the next handler. */
- runp = runp->next;
- if (runp == NULL)
- break;
-
- /* Bump the reference counter for the next entry. */
- atomic_increment (&runp->refcntr);
- }
- /* We are done. */
- break;
- }
+ /* Determine if we are running multiple threads. We skip some fork
+ handlers in the single-thread case, to make fork safer to use in
+ signal handlers. POSIX requires that fork is async-signal-safe,
+ but our current fork implementation is not. */
+ bool multiple_threads = THREAD_GETMEM (THREAD_SELF, header.multiple_threads);
- _IO_list_lock ();
+ __run_fork_handlers (atfork_run_prepare);
-#ifndef NDEBUG
- pid_t ppid = THREAD_GETMEM (THREAD_SELF, tid);
-#endif
+ /* If we are not running multiple threads, we do not have to
+ preserve lock state. If fork runs from a signal handler, only
+ async-signal-safe functions can be used in the child. These data
+ structures are only used by unsafe functions, so their state does
+ not matter if fork was called from a signal handler. */
+ if (multiple_threads)
+ {
+ _IO_list_lock ();
- /* We need to prevent the getpid() code to update the PID field so
- that, if a signal arrives in the child very early and the signal
- handler uses getpid(), the value returned is correct. */
- pid_t parentpid = THREAD_GETMEM (THREAD_SELF, pid);
- THREAD_SETMEM (THREAD_SELF, pid, -parentpid);
-
-#ifdef ARCH_FORK
- pid = ARCH_FORK ();
-#else
-# error "ARCH_FORK must be defined so that the CLONE_SETTID flag is used"
- pid = INLINE_SYSCALL (fork, 0);
-#endif
+ /* 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);
+ }
+ pid = arch_fork (&THREAD_SELF->tid);
if (pid == 0)
{
struct pthread *self = THREAD_SELF;
- assert (THREAD_GETMEM (self, tid) != ppid);
-
/* See __pthread_once. */
if (__fork_generation_pointer != NULL)
*__fork_generation_pointer += __PTHREAD_ONCE_FORK_GEN_INCR;
- /* Adjust the PID field for the new process. */
- THREAD_SETMEM (self, pid, THREAD_GETMEM (self, tid));
-
#if HP_TIMING_AVAIL
/* The CPU clock of the thread and process have to be set to zero. */
hp_timing_t now;
@@ -151,12 +92,20 @@ __libc_fork (void)
#endif
#ifdef __NR_set_robust_list
- /* Initialize the robust mutex list which has been reset during
- the fork. We do not check for errors since if it fails here
- it failed at process start as well and noone could have used
- robust mutexes. We also do not have to set
- self->robust_head.futex_offset since we inherit the correct
- value from the parent. */
+ /* Initialize the robust mutex list setting in the kernel which has
+ been reset during the fork. We do not check for errors because if
+ it fails here, it must have failed at process startup as well and
+ nobody could have used robust mutexes.
+ Before we do that, we have to clear the list of robust mutexes
+ because we do not inherit ownership of mutexes from the parent.
+ We do not have to set self->robust_head.futex_offset since we do
+ inherit the correct value from the parent. We do not need to clear
+ the pending operation because it must have been zero when fork was
+ called. */
+# if __PTHREAD_MUTEX_HAVE_PREV
+ self->robust_prev = &self->robust_head;
+# endif
+ self->robust_head.list = &self->robust_head;
# ifdef SHARED
if (__builtin_expect (__libc_pthread_functions_init, 0))
PTHFCT_CALL (ptr_set_robust, (self));
@@ -168,62 +117,39 @@ __libc_fork (void)
# endif
#endif
- /* Reset the file list. These are recursive mutexes. */
- fresetlockfiles ();
+ /* Reset the lock state in the multi-threaded case. */
+ if (multiple_threads)
+ {
+ /* Release malloc locks. */
+ call_function_static_weak (__malloc_fork_unlock_child);
- /* Reset locks in the I/O code. */
- _IO_list_resetlock ();
+ /* Reset the file list. These are recursive mutexes. */
+ fresetlockfiles ();
+
+ /* Reset locks in the I/O code. */
+ _IO_list_resetlock ();
+ }
/* Reset the lock the dynamic loader uses to protect its data. */
__rtld_lock_initialize (GL(dl_load_lock));
/* Run the handlers registered for the child. */
- while (allp != NULL)
- {
- if (allp->handler->child_handler != NULL)
- allp->handler->child_handler ();
-
- /* Note that we do not have to wake any possible waiter.
- This is the only thread in the new process. The count
- may have been bumped up by other threads doing a fork.
- We reset it to 1, to avoid waiting for non-existing
- thread(s) to release the count. */
- allp->handler->refcntr = 1;
-
- /* XXX We could at this point look through the object pool
- and mark all objects not on the __fork_handlers list as
- unused. This is necessary in case the fork() happened
- while another thread called dlclose() and that call had
- to create a new list. */
-
- allp = allp->next;
- }
-
- /* Initialize the fork lock. */
- __fork_lock = LLL_LOCK_INITIALIZER;
+ __run_fork_handlers (atfork_run_child);
}
else
{
- assert (THREAD_GETMEM (THREAD_SELF, tid) == ppid);
-
- /* Restore the PID value. */
- THREAD_SETMEM (THREAD_SELF, pid, parentpid);
-
- /* We execute this even if the 'fork' call failed. */
- _IO_list_unlock ();
-
- /* Run the handlers registered for the parent. */
- while (allp != NULL)
+ /* Release acquired locks in the multi-threaded case. */
+ if (multiple_threads)
{
- if (allp->handler->parent_handler != NULL)
- allp->handler->parent_handler ();
+ /* Release malloc locks, parent process variant. */
+ call_function_static_weak (__malloc_fork_unlock_parent);
- if (atomic_decrement_and_test (&allp->handler->refcntr)
- && allp->handler->need_signal)
- futex_wake (&allp->handler->refcntr, 1, FUTEX_PRIVATE);
-
- allp = allp->next;
+ /* We execute this even if the 'fork' call failed. */
+ _IO_list_unlock ();
}
+
+ /* Run the handlers registered for the parent. */
+ __run_fork_handlers (atfork_run_parent);
}
return pid;
diff --git a/sysdeps/nptl/fork.h b/sysdeps/nptl/fork.h
index 76762d4b1e..6eab61c121 100644
--- a/sysdeps/nptl/fork.h
+++ b/sysdeps/nptl/fork.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -24,29 +24,37 @@ extern unsigned long int __fork_generation attribute_hidden;
/* Pointer to the fork generation counter in the thread library. */
extern unsigned long int *__fork_generation_pointer attribute_hidden;
-/* Lock to protect allocation and deallocation of fork handlers. */
-extern int __fork_lock attribute_hidden;
-
/* Elements of the fork handler lists. */
struct fork_handler
{
- struct fork_handler *next;
void (*prepare_handler) (void);
void (*parent_handler) (void);
void (*child_handler) (void);
void *dso_handle;
- unsigned int refcntr;
- int need_signal;
};
-/* The single linked list of all currently registered for handlers. */
-extern struct fork_handler *__fork_handlers attribute_hidden;
-
-
/* Function to call to unregister fork handlers. */
extern void __unregister_atfork (void *dso_handle) attribute_hidden;
#define UNREGISTER_ATFORK(dso_handle) __unregister_atfork (dso_handle)
+enum __run_fork_handler_type
+{
+ atfork_run_prepare,
+ atfork_run_child,
+ atfork_run_parent
+};
+
+/* Run the atfork handlers and lock/unlock the internal lock depending
+ of the WHO argument:
+
+ - atfork_run_prepare: run all the PREPARE_HANDLER in reverse order of
+ insertion and locks the internal lock.
+ - atfork_run_child: run all the CHILD_HANDLER and unlocks the internal
+ lock.
+ - atfork_run_parent: run all the PARENT_HANDLER and unlocks the internal
+ lock. */
+extern void __run_fork_handlers (enum __run_fork_handler_type who)
+ attribute_hidden;
/* C library side function to register new fork handlers. */
extern int __register_atfork (void (*__prepare) (void),
@@ -54,6 +62,3 @@ extern int __register_atfork (void (*__prepare) (void),
void (*__child) (void),
void *dso_handle);
libc_hidden_proto (__register_atfork)
-
-/* Add a new element to the fork list. */
-extern void __linkin_atfork (struct fork_handler *newp) attribute_hidden;
diff --git a/sysdeps/nptl/futex-internal.h b/sysdeps/nptl/futex-internal.h
index d798b69708..1a5624789d 100644
--- a/sysdeps/nptl/futex-internal.h
+++ b/sysdeps/nptl/futex-internal.h
@@ -1,6 +1,6 @@
/* futex operations for glibc-internal use. Stub version; do not include
this file directly.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
#include <sys/time.h>
#include <stdio.h>
#include <stdbool.h>
-#include <libc-internal.h>
+#include <libc-diag.h>
/* This file defines futex operations used internally in glibc. A futex
consists of the so-called futex word in userspace, which is of type
diff --git a/sysdeps/nptl/gai_misc.h b/sysdeps/nptl/gai_misc.h
index c550cdd85e..815e6c0dc6 100644
--- a/sysdeps/nptl/gai_misc.h
+++ b/sysdeps/nptl/gai_misc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nptl/internaltypes.h b/sysdeps/nptl/internaltypes.h
index 203c548550..b78ad99a88 100644
--- a/sysdeps/nptl/internaltypes.h
+++ b/sysdeps/nptl/internaltypes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -68,20 +68,13 @@ struct pthread_condattr
{
/* Combination of values:
- Bit 0 : flag whether conditional variable will be sharable between
- processes.
-
- Bit 1-7: clock ID. */
+ Bit 0 : flag whether conditional variable will be
+ sharable between processes.
+ Bit 1-COND_CLOCK_BITS: Clock ID. COND_CLOCK_BITS is the number of bits
+ needed to represent the ID of the clock. */
int value;
};
-
-
-/* The __NWAITERS field is used as a counter and to house the number
- of bits for other purposes. COND_CLOCK_BITS is the number
- of bits needed to represent the ID of the clock. COND_NWAITERS_SHIFT
- is the number of bits reserved for other purposes like the clock. */
-#define COND_CLOCK_BITS 1
-#define COND_NWAITERS_SHIFT 1
+#define COND_CLOCK_BITS 1
/* Read-write lock variable attribute data structure. */
@@ -147,7 +140,7 @@ struct pthread_key_struct
struct new_sem
{
#if __HAVE_64B_ATOMICS
- /* The data field holds both value (in the least-significant 32 bytes) and
+ /* The data field holds both value (in the least-significant 32 bits) and
nwaiters. */
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define SEM_VALUE_OFFSET 0
diff --git a/sysdeps/nptl/jmp-unwind.c b/sysdeps/nptl/jmp-unwind.c
index ec227ada21..ea754df3ea 100644
--- a/sysdeps/nptl/jmp-unwind.c
+++ b/sysdeps/nptl/jmp-unwind.c
@@ -1,5 +1,5 @@
/* Clean up stack frames unwound by longjmp. Linux version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nptl/libc-lock.h b/sysdeps/nptl/libc-lock.h
index db11456b38..801bcf7913 100644
--- a/sysdeps/nptl/libc-lock.h
+++ b/sysdeps/nptl/libc-lock.h
@@ -1,5 +1,5 @@
/* libc-internal interface for mutex locks. NPTL version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h
index 50b86d2225..989fefa370 100644
--- a/sysdeps/nptl/libc-lockP.h
+++ b/sysdeps/nptl/libc-lockP.h
@@ -1,5 +1,5 @@
/* Private libc-internal interface for mutex locks. NPTL version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -319,8 +319,6 @@ __libc_cleanup_routine (struct __pthread_cleanup_frame *f)
/* Register handlers to execute before and after `fork'. Note that the
last parameter is NULL. The handlers registered by the libc are
never removed so this is OK. */
-#define __libc_atfork(PREPARE, PARENT, CHILD) \
- __register_atfork (PREPARE, PARENT, CHILD, NULL)
extern int __register_atfork (void (*__prepare) (void),
void (*__parent) (void),
void (*__child) (void),
diff --git a/sysdeps/nptl/librt-cancellation.c b/sysdeps/nptl/librt-cancellation.c
index ce5a627b67..39c5991205 100644
--- a/sysdeps/nptl/librt-cancellation.c
+++ b/sysdeps/nptl/librt-cancellation.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/nptl/lowlevellock-futex.h b/sysdeps/nptl/lowlevellock-futex.h
index 9a976364f1..27b81b8347 100644
--- a/sysdeps/nptl/lowlevellock-futex.h
+++ b/sysdeps/nptl/lowlevellock-futex.h
@@ -1,5 +1,5 @@
/* Low-level locking access to futex facilities. Stub version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nptl/lowlevellock.h b/sysdeps/nptl/lowlevellock.h
index 3890145402..bfbda99940 100644
--- a/sysdeps/nptl/lowlevellock.h
+++ b/sysdeps/nptl/lowlevellock.h
@@ -1,5 +1,5 @@
/* Low-level lock implementation. Generic futex-based version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -64,17 +64,16 @@
0. Otherwise leave lock unchanged and return non-zero to indicate that the
lock was not acquired. */
#define lll_trylock(lock) \
- atomic_compare_and_exchange_bool_acq (&(lock), 1, 0)
+ __glibc_unlikely (atomic_compare_and_exchange_bool_acq (&(lock), 1, 0))
/* If LOCK is 0 (not acquired), set to 2 (acquired, possibly with waiters) and
return 0. Otherwise leave lock unchanged and return non-zero to indicate
that the lock was not acquired. */
#define lll_cond_trylock(lock) \
- atomic_compare_and_exchange_bool_acq (&(lock), 2, 0)
+ __glibc_unlikely (atomic_compare_and_exchange_bool_acq (&(lock), 2, 0))
extern void __lll_lock_wait_private (int *futex) attribute_hidden;
extern void __lll_lock_wait (int *futex, int private) attribute_hidden;
-extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
/* This is an expression rather than a statement even though its value is
void, so that it can be used in a comma expression or as an expression
@@ -103,28 +102,6 @@ extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
__lll_lock (&(futex), private)
-/* If FUTEX is 0 (not acquired), set to ID (acquired with no waiters) and
- return 0. Otherwise, ensure that it is set to FUTEX | FUTEX_WAITERS
- (acquired, possibly with waiters) and block until we acquire the lock.
- FUTEX will now be ID | FUTEX_WAITERS and we return 0.
- If the previous owner of the lock dies before we acquire the lock then FUTEX
- will be the value of id as set by the previous owner, with FUTEX_OWNER_DIED
- set (FUTEX_WAITERS may or may not be set). We return this value to indicate
- that the lock is not acquired. */
-#define __lll_robust_lock(futex, id, private) \
- ({ \
- int *__futex = (futex); \
- int __val = 0; \
- \
- if (__glibc_unlikely \
- (atomic_compare_and_exchange_bool_acq (__futex, id, 0))) \
- __val = __lll_robust_lock_wait (__futex, private); \
- __val; \
- })
-#define lll_robust_lock(futex, id, private) \
- __lll_robust_lock (&(futex), id, private)
-
-
/* This is an expression rather than a statement even though its value is
void, so that it can be used in a comma expression or as an expression
that's cast to void. */
@@ -142,16 +119,8 @@ extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
-/* As __lll_robust_lock, but set to ID | FUTEX_WAITERS (acquired, possibly with
- waiters) if FUTEX is 0. */
-#define lll_robust_cond_lock(futex, id, private) \
- __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private)
-
-
extern int __lll_timedlock_wait (int *futex, const struct timespec *,
int private) attribute_hidden;
-extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
- int private) attribute_hidden;
/* As __lll_lock, but with a timeout. If the timeout occurs then return
@@ -170,22 +139,6 @@ extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
__lll_timedlock (&(futex), abstime, private)
-/* As __lll_robust_lock, but with a timeout. If the timeout occurs then return
- ETIMEDOUT. If ABSTIME is invalid, return EINVAL. */
-#define __lll_robust_timedlock(futex, abstime, id, private) \
- ({ \
- int *__futex = (futex); \
- int __val = 0; \
- \
- if (__glibc_unlikely \
- (atomic_compare_and_exchange_bool_acq (__futex, id, 0))) \
- __val = __lll_robust_timedlock_wait (__futex, abstime, private); \
- __val; \
- })
-#define lll_robust_timedlock(futex, abstime, id, private) \
- __lll_robust_timedlock (&(futex), abstime, id, private)
-
-
/* This is an expression rather than a statement even though its value is
void, so that it can be used in a comma expression or as an expression
that's cast to void. */
@@ -211,27 +164,6 @@ extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
__lll_unlock (&(futex), private)
-/* This is an expression rather than a statement even though its value is
- void, so that it can be used in a comma expression or as an expression
- that's cast to void. */
-/* Unconditionally set FUTEX to 0 (not acquired), releasing the lock. If FUTEX
- had FUTEX_WAITERS set then wake any waiters. The waiter that acquires the
- lock will set FUTEX_WAITERS.
- Evaluate PRIVATE before releasing the lock so that we do not violate the
- mutex destruction requirements (see __lll_unlock). */
-#define __lll_robust_unlock(futex, private) \
- ((void) \
- ({ \
- int *__futex = (futex); \
- int __private = (private); \
- int __oldval = atomic_exchange_rel (__futex, 0); \
- if (__glibc_unlikely (__oldval & FUTEX_WAITERS)) \
- lll_futex_wake (__futex, 1, __private); \
- }))
-#define lll_robust_unlock(futex, private) \
- __lll_robust_unlock (&(futex), private)
-
-
#define lll_islocked(futex) \
((futex) != LLL_LOCK_INITIALIZER)
@@ -249,11 +181,14 @@ extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
thread ID while the clone is running and is reset to zero by the kernel
afterwards. The kernel up to version 3.16.3 does not use the private futex
operations for futex wake-up when the clone terminates. */
-#define lll_wait_tid(tid) \
- do { \
- __typeof (tid) __tid; \
- while ((__tid = (tid)) != 0) \
- lll_futex_wait (&(tid), __tid, LLL_SHARED);\
+#define lll_wait_tid(tid) \
+ do { \
+ __typeof (tid) __tid; \
+ /* We need acquire MO here so that we synchronize \
+ with the kernel's store to 0 when the clone \
+ terminates. (see above) */ \
+ while ((__tid = atomic_load_acquire (&(tid))) != 0) \
+ lll_futex_wait (&(tid), __tid, LLL_SHARED); \
} while (0)
extern int __lll_timedwait_tid (int *, const struct timespec *)
diff --git a/sysdeps/nptl/malloc-machine.h b/sysdeps/nptl/malloc-machine.h
index 5b276dfeb4..b038339054 100644
--- a/sysdeps/nptl/malloc-machine.h
+++ b/sysdeps/nptl/malloc-machine.h
@@ -1,6 +1,6 @@
/* Basic platform-independent macro definitions for mutexes,
thread-specific data and parameters for malloc.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,43 +20,8 @@
#ifndef _MALLOC_MACHINE_H
#define _MALLOC_MACHINE_H
-#undef thread_atfork_static
-
#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))
-
-/* This is defined by newer gcc version unique for each module. */
-extern void *__dso_handle __attribute__ ((__weak__));
-
-#include <fork.h>
-
-#define ATFORK_MEM static struct fork_handler atfork_mem
-
-#ifdef SHARED
-# define thread_atfork(prepare, parent, child) \
- atfork_mem.prepare_handler = prepare; \
- atfork_mem.parent_handler = parent; \
- atfork_mem.child_handler = child; \
- atfork_mem.dso_handle = __dso_handle; \
- atfork_mem.refcntr = 1; \
- __linkin_atfork (&atfork_mem)
-#else
-# define thread_atfork(prepare, parent, child) \
- atfork_mem.prepare_handler = prepare; \
- atfork_mem.parent_handler = parent; \
- atfork_mem.child_handler = child; \
- atfork_mem.dso_handle = &__dso_handle == NULL ? NULL : __dso_handle; \
- atfork_mem.refcntr = 1; \
- __linkin_atfork (&atfork_mem)
-#endif
-
#include <sysdeps/generic/malloc-machine.h>
#endif /* !defined(_MALLOC_MACHINE_H) */
diff --git a/sysdeps/nptl/nptl-signals.h b/sysdeps/nptl/nptl-signals.h
deleted file mode 100644
index 74e7df395c..0000000000
--- a/sysdeps/nptl/nptl-signals.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Special use of signals in NPTL internals. Stub version.
- Copyright (C) 2014-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 file can define the macros SIGCANCEL, SIGTIMER, and SIGSETXID to
- signal numbers reserved by libpthread for those internal purposes.
-
- Note that some code presumes SIGTIMER is the same as SIGCANCEL. */
diff --git a/sysdeps/nptl/pthread-functions.h b/sysdeps/nptl/pthread-functions.h
index 60f0ad566b..fa103695d9 100644
--- a/sysdeps/nptl/pthread-functions.h
+++ b/sysdeps/nptl/pthread-functions.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -74,7 +74,6 @@ struct pthread_functions
const pthread_mutexattr_t *);
int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
- pthread_t (*ptr_pthread_self) (void);
int (*ptr___pthread_setcancelstate) (int, int *);
int (*ptr_pthread_setcanceltype) (int, int *);
void (*ptr___pthread_cleanup_upto) (__jmp_buf, char *);
@@ -95,7 +94,6 @@ struct pthread_functions
__attribute ((noreturn)) __cleanup_fct_attribute;
void (*ptr__nptl_deallocate_tsd) (void);
int (*ptr__nptl_setxid) (struct xid_command *);
- void (*ptr_freeres) (void);
void (*ptr_set_robust) (struct pthread *);
};
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
index fd0894efd2..df049abf74 100644
--- a/sysdeps/nptl/pthread.h
+++ b/sysdeps/nptl/pthread.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,7 @@
#include <bits/pthreadtypes.h>
#include <bits/setjmp.h>
#include <bits/wordsize.h>
+#include <bits/types/struct_timespec.h>
/* Detach state. */
@@ -82,7 +83,7 @@ enum
#endif
-#ifdef __PTHREAD_MUTEX_HAVE_PREV
+#if __PTHREAD_MUTEX_HAVE_PREV
# define PTHREAD_MUTEX_INITIALIZER \
{ { 0, 0, 0, 0, 0, __PTHREAD_SPINS, { 0, 0 } } }
# ifdef __USE_GNU
@@ -183,7 +184,7 @@ enum
/* Conditional variable handling. */
-#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }
+#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, {0, 0}, 0, 0, {0, 0} } }
/* Cleanup buffers */
diff --git a/sysdeps/nptl/setxid.h b/sysdeps/nptl/setxid.h
index 916ec43709..de39efc723 100644
--- a/sysdeps/nptl/setxid.h
+++ b/sysdeps/nptl/setxid.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nptl/shm-directory.h b/sysdeps/nptl/shm-directory.h
index dfe5925b42..7452191626 100644
--- a/sysdeps/nptl/shm-directory.h
+++ b/sysdeps/nptl/shm-directory.h
@@ -1,5 +1,5 @@
/* Header for directory for shm/sem files. NPTL version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nptl/sigfillset.c b/sysdeps/nptl/sigfillset.c
deleted file mode 100644
index 1c29fa445e..0000000000
--- a/sysdeps/nptl/sigfillset.c
+++ /dev/null
@@ -1,20 +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 <nptl/pthreadP.h>
-
-#include <signal/sigfillset.c>
diff --git a/sysdeps/nptl/stdio-lock.h b/sysdeps/nptl/stdio-lock.h
index d3a9092459..5b9782452f 100644
--- a/sysdeps/nptl/stdio-lock.h
+++ b/sysdeps/nptl/stdio-lock.h
@@ -1,5 +1,5 @@
/* Thread package specific definitions of stream lock type. NPTL version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,7 @@
#define _IO_lock_inexpensive 1
typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
+#define _IO_lock_t_defined 1
#define _IO_lock_initializer { LLL_LOCK_INITIALIZER, 0, NULL }
@@ -89,13 +90,13 @@ typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
# ifdef __EXCEPTIONS
# define _IO_acquire_lock(_fp) \
do { \
- _IO_FILE *_IO_acquire_lock_file \
+ FILE *_IO_acquire_lock_file \
__attribute__((cleanup (_IO_acquire_lock_fct))) \
= (_fp); \
_IO_flockfile (_IO_acquire_lock_file);
# define _IO_acquire_lock_clear_flags2(_fp) \
do { \
- _IO_FILE *_IO_acquire_lock_file \
+ FILE *_IO_acquire_lock_file \
__attribute__((cleanup (_IO_acquire_lock_clear_flags2_fct))) \
= (_fp); \
_IO_flockfile (_IO_acquire_lock_file);
diff --git a/sysdeps/nptl/sys/procfs.h b/sysdeps/nptl/sys/procfs.h
index 66cc2c9b9e..d8c9383696 100644
--- a/sysdeps/nptl/sys/procfs.h
+++ b/sysdeps/nptl/sys/procfs.h
@@ -1,5 +1,5 @@
/* Types used by thread_db callback interface. Stub version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nptl/threads.h b/sysdeps/nptl/threads.h
new file mode 100644
index 0000000000..9800f93aa7
--- /dev/null
+++ b/sysdeps/nptl/threads.h
@@ -0,0 +1,207 @@
+/* ISO C11 Standard: 7.26 - Thread support library <threads.h>.
+ Copyright (C) 2018 Free Software 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 _THREADS_H
+#define _THREADS_H 1
+
+#include <features.h>
+#include <time.h>
+
+__BEGIN_DECLS
+
+#include <bits/pthreadtypes-arch.h>
+#include <bits/types/struct_timespec.h>
+
+#ifndef __cplusplus
+# define thread_local _Thread_local
+#endif
+
+#define TSS_DTOR_ITERATIONS 4
+typedef unsigned int tss_t;
+typedef void (*tss_dtor_t) (void*);
+
+typedef unsigned long int thrd_t;
+typedef int (*thrd_start_t) (void*);
+
+/* Exit and error codes. */
+enum
+{
+ thrd_success = 0,
+ thrd_busy = 1,
+ thrd_error = 2,
+ thrd_nomem = 3,
+ thrd_timedout = 4
+};
+
+/* Mutex types. */
+enum
+{
+ mtx_plain = 0,
+ mtx_recursive = 1,
+ mtx_timed = 2
+};
+
+typedef struct
+{
+ int __data __ONCE_ALIGNMENT;
+} once_flag;
+#define ONCE_FLAG_INIT { 0 }
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_MUTEX_T];
+ long int __align __LOCK_ALIGNMENT;
+} mtx_t;
+
+typedef union
+{
+ char __size[__SIZEOF_PTHREAD_COND_T];
+ __extension__ long long int __align __LOCK_ALIGNMENT;
+} cnd_t;
+
+/* Threads functions. */
+
+/* Create a new thread executing the function __FUNC. Arguments for __FUNC
+ are passed through __ARG. If succesful, __THR is set to new thread
+ identifier. */
+extern int thrd_create (thrd_t *__thr, thrd_start_t __func, void *__arg);
+
+/* Check if __LHS and __RHS point to the same thread. */
+extern int thrd_equal (thrd_t __lhs, thrd_t __rhs);
+
+/* Return current thread identifier. */
+extern thrd_t thrd_current (void);
+
+/* Block current thread execution for at least the time pointed by
+ __TIME_POINT. The current thread may resume if receives a signal. In
+ that case, if __REMAINING is not NULL, the remaining time is stored in
+ the object pointed by it. */
+extern int thrd_sleep (const struct timespec *__time_point,
+ struct timespec *__remaining);
+
+/* Terminate current thread execution, cleaning up any thread local
+ storage and freeing resources. Returns the value specified in __RES. */
+extern void thrd_exit (int __res) __attribute__ ((__noreturn__));
+
+/* Detach the thread identified by __THR from the current environment
+ (it does not allow join or wait for it). */
+extern int thrd_detach (thrd_t __thr);
+
+/* Block current thread until execution of __THR is complete. In case that
+ __RES is not NULL, will store the return value of __THR when exiting. */
+extern int thrd_join (thrd_t __thr, int *__res);
+
+/* Stop current thread execution and call the scheduler to decide which
+ thread should execute next. The current thread may be selected by the
+ scheduler to keep running. */
+extern void thrd_yield (void);
+
+#ifdef __USE_EXTERN_INLINES
+/* Optimizations. */
+__extern_inline int
+thrd_equal (thrd_t __thread1, thrd_t __thread2)
+{
+ return __thread1 == __thread2;
+}
+#endif
+
+
+/* Mutex functions. */
+
+/* Creates a new mutex object with type __TYPE. If successful the new
+ object is pointed by __MUTEX. */
+extern int mtx_init (mtx_t *__mutex, int __type);
+
+/* Block the current thread until the mutex pointed to by __MUTEX is
+ unlocked. In that case current thread will not be blocked. */
+extern int mtx_lock (mtx_t *__mutex);
+
+/* Block the current thread until the mutex pointed by __MUTEX is unlocked
+ or time pointed by __TIME_POINT is reached. In case the mutex is unlock,
+ the current thread will not be blocked. */
+extern int mtx_timedlock (mtx_t *__restrict __mutex,
+ const struct timespec *__restrict __time_point);
+
+/* Try to lock the mutex pointed by __MUTEX without blocking. If the mutex
+ is free the current threads takes control of it, otherwise it returns
+ immediately. */
+extern int mtx_trylock (mtx_t *__mutex);
+
+/* Unlock the mutex pointed by __MUTEX. It may potentially awake other
+ threads waiting on this mutex. */
+extern int mtx_unlock (mtx_t *__mutex);
+
+/* Destroy the mutex object pointed by __MUTEX. */
+extern void mtx_destroy (mtx_t *__mutex);
+
+
+/* Call function __FUNC exactly once, even if invoked from several threads.
+ All calls must be made with the same __FLAGS object. */
+extern void call_once (once_flag *__flag, void (*__func)(void));
+
+
+/* Condition variable functions. */
+
+/* Initialize new condition variable pointed by __COND. */
+extern int cnd_init (cnd_t *__cond);
+
+/* Unblock one thread that currently waits on condition variable pointed
+ by __COND. */
+extern int cnd_signal (cnd_t *__cond);
+
+/* Unblock all threads currently waiting on condition variable pointed by
+ __COND. */
+extern int cnd_broadcast (cnd_t *__cond);
+
+/* Block current thread on the condition variable pointed by __COND. */
+extern int cnd_wait (cnd_t *__cond, mtx_t *__mutex);
+
+/* Block current thread on the condition variable until condition variable
+ pointed by __COND is signaled or time pointed by __TIME_POINT is
+ reached. */
+extern int cnd_timedwait (cnd_t *__restrict __cond,
+ mtx_t *__restrict __mutex,
+ const struct timespec *__restrict __time_point);
+
+/* Destroy condition variable pointed by __cond and free all of its
+ resources. */
+extern void cnd_destroy (cnd_t *__COND);
+
+
+/* Thread specific storage functions. */
+
+/* Create new thread-specific storage key and stores it in the object pointed
+ by __TSS_ID. If __DESTRUCTOR is not NULL, the function will be called when
+ the thread terminates. */
+extern int tss_create (tss_t *__tss_id, tss_dtor_t __destructor);
+
+/* Return the value held in thread-specific storage for the current thread
+ identified by __TSS_ID. */
+extern void *tss_get (tss_t __tss_id);
+
+/* Sets the value of the thread-specific storage identified by __TSS_ID for
+ the current thread to __VAL. */
+extern int tss_set (tss_t __tss_id, void *__val);
+
+/* Destroys the thread-specific storage identified by __TSS_ID. The
+ destructor is not called until thrd_exit is called. */
+extern void tss_delete (tss_t __tss_id);
+
+__END_DECLS
+
+#endif /* _THREADS_H */
diff --git a/sysdeps/nptl/timer_routines.h b/sysdeps/nptl/timer_routines.h
new file mode 100644
index 0000000000..9931015684
--- /dev/null
+++ b/sysdeps/nptl/timer_routines.h
@@ -0,0 +1,51 @@
+/* Helper code for POSIX timer implementation on NPTL.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General 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 _TIMER_ROUTINES_H
+#define _TIMER_ROUTINES_H 1
+
+#include <internaltypes.h>
+#include <string.h>
+
+/* Compare two pthread_attr_t thread attributes for exact equality.
+ Returns 1 if they are equal, otherwise zero if they are not equal
+ or contain illegal values. This version is NPTL-specific for
+ performance reason. One could use the access functions to get the
+ values of all the fields of the attribute structure. */
+static inline int
+thread_attr_compare (const pthread_attr_t *left, const pthread_attr_t *right)
+{
+ struct pthread_attr *ileft = (struct pthread_attr *) left;
+ struct pthread_attr *iright = (struct pthread_attr *) right;
+
+ return (ileft->flags == iright->flags
+ && ileft->schedpolicy == iright->schedpolicy
+ && (ileft->schedparam.sched_priority
+ == iright->schedparam.sched_priority)
+ && ileft->guardsize == iright->guardsize
+ && ileft->stackaddr == iright->stackaddr
+ && ileft->stacksize == iright->stacksize
+ && ((ileft->cpuset == NULL && iright->cpuset == NULL)
+ || (ileft->cpuset != NULL && iright->cpuset != NULL
+ && ileft->cpusetsize == iright->cpusetsize
+ && memcmp (ileft->cpuset, iright->cpuset,
+ ileft->cpusetsize) == 0)));
+}
+
+#endif /* timer_routines.h */
diff --git a/sysdeps/nptl/unwind-forcedunwind.c b/sysdeps/nptl/unwind-forcedunwind.c
index ca757c48ce..5902fa4be7 100644
--- a/sysdeps/nptl/unwind-forcedunwind.c
+++ b/sysdeps/nptl/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
@@ -49,6 +49,7 @@ pthread_cancel_init (void)
return;
}
+ /* See include/dlfcn.h. Use of __libc_dlopen requires RTLD_NOW. */
handle = __libc_dlopen (LIBGCC_S_SO);
if (handle == NULL
@@ -78,9 +79,9 @@ pthread_cancel_init (void)
libgcc_s_handle = handle;
}
+/* Register for cleanup in libpthread.so. */
void
-__libc_freeres_fn_section
-__unwind_freeres (void)
+__nptl_unwind_freeres (void)
{
void *handle = libgcc_s_handle;
if (handle != NULL)
diff --git a/sysdeps/posix/alarm.c b/sysdeps/posix/alarm.c
index 47b7477e6d..91543cef18 100644
--- a/sysdeps/posix/alarm.c
+++ b/sysdeps/posix/alarm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/clock.c b/sysdeps/posix/clock.c
index 04ac806410..52382b72c1 100644
--- a/sysdeps/posix/clock.c
+++ b/sysdeps/posix/clock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c
index fb328d78a9..e7924e0891 100644
--- a/sysdeps/posix/clock_getres.c
+++ b/sysdeps/posix/clock_getres.c
@@ -1,5 +1,5 @@
/* clock_getres -- Get the resolution of a POSIX clockid_t.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,7 +58,7 @@ hp_timing_getres (struct timespec *res)
static inline int
realtime_getres (struct timespec *res)
{
- long int clk_tck = sysconf (_SC_CLK_TCK);
+ long int clk_tck = __sysconf (_SC_CLK_TCK);
if (__glibc_likely (clk_tck != -1))
{
diff --git a/sysdeps/posix/closedir.c b/sysdeps/posix/closedir.c
index 960cdec8d3..9b1e698762 100644
--- a/sysdeps/posix/closedir.c
+++ b/sysdeps/posix/closedir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -49,6 +49,6 @@ __closedir (DIR *dirp)
free ((void *) dirp);
- return close_not_cancel (fd);
+ return __close_nocancel (fd);
}
weak_alias (__closedir, closedir)
diff --git a/sysdeps/posix/ctermid.c b/sysdeps/posix/ctermid.c
index 5efdab6a39..767743b4e8 100644
--- a/sysdeps/posix/ctermid.c
+++ b/sysdeps/posix/ctermid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/cuserid.c b/sysdeps/posix/cuserid.c
index 5f5ea3a8f7..721c645608 100644
--- a/sysdeps/posix/cuserid.c
+++ b/sysdeps/posix/cuserid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/dirfd.c b/sysdeps/posix/dirfd.c
index f47aafd83a..5afc9f37e7 100644
--- a/sysdeps/posix/dirfd.c
+++ b/sysdeps/posix/dirfd.c
@@ -1,5 +1,5 @@
/* Return the file descriptor used by a DIR stream. Unix version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,10 @@
#undef dirfd
int
-dirfd (DIR *dirp)
+__dirfd (DIR *dirp)
{
return dirp->fd;
}
+
+weak_alias (__dirfd, dirfd)
+libc_hidden_def (dirfd)
diff --git a/sysdeps/posix/dirstream.h b/sysdeps/posix/dirstream.h
index 87a930d7fe..ae6faf65f5 100644
--- a/sysdeps/posix/dirstream.h
+++ b/sysdeps/posix/dirstream.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/dl-fileid.h b/sysdeps/posix/dl-fileid.h
index c56e324e65..26bef2f9dc 100644
--- a/sysdeps/posix/dl-fileid.h
+++ b/sysdeps/posix/dl-fileid.h
@@ -1,5 +1,5 @@
/* File identity for the dynamic linker. Generic POSIX.1 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/dup.c b/sysdeps/posix/dup.c
index 9525e76749..be6ec4b2bf 100644
--- a/sysdeps/posix/dup.c
+++ b/sysdeps/posix/dup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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/dup2.c b/sysdeps/posix/dup2.c
index 9fc65029a8..6e050f5fad 100644
--- a/sysdeps/posix/dup2.c
+++ b/sysdeps/posix/dup2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/euidaccess.c b/sysdeps/posix/euidaccess.c
index d8878aa28f..ec44b0f696 100644
--- a/sysdeps/posix/euidaccess.c
+++ b/sysdeps/posix/euidaccess.c
@@ -1,5 +1,5 @@
/* Check if effective user id can access file
- Copyright (C) 1990-2016 Free Software Foundation, Inc.
+ Copyright (C) 1990-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/fdopendir.c b/sysdeps/posix/fdopendir.c
index 227174ec54..b72eecc66b 100644
--- a/sysdeps/posix/fdopendir.c
+++ b/sysdeps/posix/fdopendir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,7 +38,7 @@ __fdopendir (int fd)
}
/* Make sure the descriptor allows for reading. */
- int flags = __fcntl (fd, F_GETFL);
+ int flags = __fcntl64_nocancel (fd, F_GETFL);
if (__glibc_unlikely (flags == -1))
return NULL;
if (__glibc_unlikely ((flags & O_ACCMODE) == O_WRONLY))
diff --git a/sysdeps/posix/flock.c b/sysdeps/posix/flock.c
index c621a5b03e..998bc84866 100644
--- a/sysdeps/posix/flock.c
+++ b/sysdeps/posix/flock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c
index 4aaded14be..a9d164564e 100644
--- a/sysdeps/posix/fpathconf.c
+++ b/sysdeps/posix/fpathconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -103,25 +103,22 @@ __fpathconf (int fd, int name)
#endif
case _PC_CHOWN_RESTRICTED:
-#ifdef _POSIX_CHOWN_RESTRICTED
- return _POSIX_CHOWN_RESTRICTED;
-#else
- return -1;
+#if _POSIX_CHOWN_RESTRICTED == -1
+# error "Invalid value for _POSIX_CHOWN_RESTRICTED"
#endif
+ return _POSIX_CHOWN_RESTRICTED;
case _PC_NO_TRUNC:
-#ifdef _POSIX_NO_TRUNC
- return _POSIX_NO_TRUNC;
-#else
- return -1;
+#if _POSIX_NO_TRUNC == -1
+# error "Invalid value for _POSIX_NO_TRUNC"
#endif
+ return _POSIX_NO_TRUNC;
case _PC_VDISABLE:
-#ifdef _POSIX_VDISABLE
- return _POSIX_VDISABLE;
-#else
- return -1;
+#if _POSIX_VDISABLE == -1
+# error "Invalid value for _POSIX_VDISABLE"
#endif
+ return _POSIX_VDISABLE;
case _PC_SYNC_IO:
#ifdef _POSIX_SYNC_IO
diff --git a/sysdeps/posix/gai_strerror.c b/sysdeps/posix/gai_strerror.c
index 151ee08c29..6c2b66bf9f 100644
--- a/sysdeps/posix/gai_strerror.c
+++ b/sysdeps/posix/gai_strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 1ef3f20d98..553833d1f2 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -1,3 +1,21 @@
+/* Host and service name lookups using Name Service Switch modules.
+ Copyright (C) 1996-2018 Free Software 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/>. */
+
/* The Inner Net License, Version 2.00
The author(s) grant permission for redistribution and use in source and
@@ -41,7 +59,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ifaddrs.h>
#include <netdb.h>
#include <nss.h>
-#include <resolv.h>
+#include <resolv/resolv-internal.h>
+#include <resolv/resolv_context.h>
+#include <resolv/res_use_inet6.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdio_ext.h>
@@ -62,13 +82,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <not-cancel.h>
#include <nscd/nscd-client.h>
#include <nscd/nscd_proto.h>
-#include <resolv/res_hconf.h>
+#include <scratch_buffer.h>
+#include <inet/net-internal.h>
+
+/* Former AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES
+ flags, now ignored. */
+#define DEPRECATED_AI_IDN 0x300
-#ifdef HAVE_LIBIDN
-extern int __idna_to_ascii_lz (const char *input, char **output, int flags);
-extern int __idna_to_unicode_lzlz (const char *input, char **output,
- int flags);
-# include <libidn/idna.h>
+#if IS_IN (libc)
+# define feof_unlocked(fp) __feof_unlocked (fp)
#endif
struct gaih_service
@@ -135,24 +157,24 @@ static const struct addrinfo default_hints =
static int
gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
- const struct addrinfo *req, struct gaih_servtuple *st)
+ const struct addrinfo *req, struct gaih_servtuple *st,
+ struct scratch_buffer *tmpbuf)
{
struct servent *s;
- size_t tmpbuflen = 1024;
struct servent ts;
- char *tmpbuf;
int r;
do
{
- tmpbuf = __alloca (tmpbuflen);
-
- r = __getservbyname_r (servicename, tp->name, &ts, tmpbuf, tmpbuflen,
- &s);
+ r = __getservbyname_r (servicename, tp->name, &ts,
+ tmpbuf->data, tmpbuf->length, &s);
if (r != 0 || s == NULL)
{
if (r == ERANGE)
- tmpbuflen *= 2;
+ {
+ if (!scratch_buffer_grow (tmpbuf))
+ return -EAI_MEMORY;
+ }
else
return -EAI_SERVICE;
}
@@ -168,87 +190,114 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
return 0;
}
+/* Convert struct hostent to a list of struct gaih_addrtuple objects.
+ h_name is not copied, and the struct hostent object must not be
+ deallocated prematurely. *RESULT must be NULL or a pointer to a
+ linked-list. The new addresses are appended at the end. */
+static bool
+convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
+ int family,
+ struct hostent *h,
+ struct gaih_addrtuple **result)
+{
+ while (*result)
+ result = &(*result)->next;
+
+ /* Count the number of addresses in h->h_addr_list. */
+ size_t count = 0;
+ for (char **p = h->h_addr_list; *p != NULL; ++p)
+ ++count;
+
+ /* Report no data if no addresses are available, or if the incoming
+ address size is larger than what we can store. */
+ if (count == 0 || h->h_length > sizeof (((struct gaih_addrtuple) {}).addr))
+ return true;
+
+ struct gaih_addrtuple *array = calloc (count, sizeof (*array));
+ if (array == NULL)
+ return false;
+
+ for (size_t i = 0; i < count; ++i)
+ {
+ if (family == AF_INET && req->ai_family == AF_INET6)
+ {
+ /* Perform address mapping. */
+ array[i].family = AF_INET6;
+ memcpy(array[i].addr + 3, h->h_addr_list[i], sizeof (uint32_t));
+ array[i].addr[2] = htonl (0xffff);
+ }
+ else
+ {
+ array[i].family = family;
+ memcpy (array[i].addr, h->h_addr_list[i], h->h_length);
+ }
+ array[i].next = array + i + 1;
+ }
+ array[0].name = h->h_name;
+ array[count - 1].next = NULL;
+
+ *result = array;
+ return true;
+}
+
#define gethosts(_family, _type) \
{ \
- int i; \
- int herrno; \
struct hostent th; \
- struct hostent *h; \
char *localcanon = NULL; \
no_data = 0; \
- while (1) { \
- rc = 0; \
- status = DL_CALL_FCT (fct, (name, _family, &th, tmpbuf, tmpbuflen, \
- &rc, &herrno, NULL, &localcanon)); \
- if (rc != ERANGE || herrno != NETDB_INTERNAL) \
- break; \
- if (!malloc_tmpbuf && __libc_use_alloca (alloca_used + 2 * tmpbuflen)) \
- tmpbuf = extend_alloca_account (tmpbuf, tmpbuflen, 2 * tmpbuflen, \
- alloca_used); \
- else \
- { \
- char *newp = realloc (malloc_tmpbuf ? tmpbuf : NULL, \
- 2 * tmpbuflen); \
- if (newp == NULL) \
- { \
- result = -EAI_MEMORY; \
- goto free_and_return; \
- } \
- tmpbuf = newp; \
- malloc_tmpbuf = true; \
- tmpbuflen = 2 * tmpbuflen; \
- } \
- } \
- if (status == NSS_STATUS_SUCCESS && rc == 0) \
- h = &th; \
- else \
- h = NULL; \
- if (rc != 0) \
+ while (1) \
+ { \
+ status = DL_CALL_FCT (fct, (name, _family, &th, \
+ tmpbuf->data, tmpbuf->length, \
+ &errno, &h_errno, NULL, &localcanon)); \
+ if (status != NSS_STATUS_TRYAGAIN || h_errno != NETDB_INTERNAL \
+ || errno != ERANGE) \
+ break; \
+ if (!scratch_buffer_grow (tmpbuf)) \
+ { \
+ __resolv_context_enable_inet6 (res_ctx, res_enable_inet6); \
+ __resolv_context_put (res_ctx); \
+ result = -EAI_MEMORY; \
+ goto free_and_return; \
+ } \
+ } \
+ if (status == NSS_STATUS_NOTFOUND \
+ || status == NSS_STATUS_TRYAGAIN || status == NSS_STATUS_UNAVAIL) \
{ \
- if (herrno == NETDB_INTERNAL) \
+ if (h_errno == NETDB_INTERNAL) \
{ \
- __set_h_errno (herrno); \
- _res.options |= old_res_options & RES_USE_INET6; \
+ __resolv_context_enable_inet6 (res_ctx, res_enable_inet6); \
+ __resolv_context_put (res_ctx); \
result = -EAI_SYSTEM; \
goto free_and_return; \
} \
- if (herrno == TRY_AGAIN) \
+ if (h_errno == TRY_AGAIN) \
no_data = EAI_AGAIN; \
else \
- no_data = herrno == NO_DATA; \
+ no_data = h_errno == NO_DATA; \
} \
- else if (h != NULL) \
+ else if (status == NSS_STATUS_SUCCESS) \
{ \
- for (i = 0; h->h_addr_list[i]; i++) \
+ if (!convert_hostent_to_gaih_addrtuple (req, _family, &th, &addrmem)) \
{ \
- if (*pat == NULL) \
- { \
- *pat = __alloca (sizeof (struct gaih_addrtuple)); \
- (*pat)->scopeid = 0; \
- } \
- uint32_t *addr = (*pat)->addr; \
- (*pat)->next = NULL; \
- (*pat)->name = i == 0 ? strdupa (h->h_name) : NULL; \
- if (_family == AF_INET && req->ai_family == AF_INET6) \
- { \
- (*pat)->family = AF_INET6; \
- addr[3] = *(uint32_t *) h->h_addr_list[i]; \
- addr[2] = htonl (0xffff); \
- addr[1] = 0; \
- addr[0] = 0; \
- } \
- else \
+ __resolv_context_enable_inet6 (res_ctx, res_enable_inet6); \
+ __resolv_context_put (res_ctx); \
+ result = -EAI_SYSTEM; \
+ goto free_and_return; \
+ } \
+ *pat = addrmem; \
+ \
+ if (localcanon != NULL && canon == NULL) \
+ { \
+ canonbuf = __strdup (localcanon); \
+ if (canonbuf == NULL) \
{ \
- (*pat)->family = _family; \
- memcpy (addr, h->h_addr_list[i], sizeof(_type)); \
+ result = -EAI_SYSTEM; \
+ goto free_and_return; \
} \
- pat = &((*pat)->next); \
+ canon = canonbuf; \
} \
- \
- if (localcanon != NULL && canon == NULL) \
- canon = strdupa (localcanon); \
- \
- if (_family == AF_INET6 && i > 0) \
+ if (_family == AF_INET6 && *pat != NULL) \
got_ipv6 = true; \
} \
}
@@ -265,22 +314,45 @@ typedef enum nss_status (*nss_gethostbyname3_r)
typedef enum nss_status (*nss_getcanonname_r)
(const char *name, char *buffer, size_t buflen, char **result,
int *errnop, int *h_errnop);
-extern service_user *__nss_hosts_database attribute_hidden;
+/* This function is called if a canonical name is requested, but if
+ the service function did not provide it. It tries to obtain the
+ name using getcanonname_r from the same service NIP. If the name
+ cannot be canonicalized, return a copy of NAME. Return NULL on
+ memory allocation failure. The returned string is allocated on the
+ heap; the caller has to free it. */
+static char *
+getcanonname (service_user *nip, struct gaih_addrtuple *at, const char *name)
+{
+ nss_getcanonname_r cfct = __nss_lookup_function (nip, "getcanonname_r");
+ char *s = (char *) name;
+ if (cfct != NULL)
+ {
+ char buf[256];
+ if (DL_CALL_FCT (cfct, (at->name ?: name, buf, sizeof (buf),
+ &s, &errno, &h_errno)) != NSS_STATUS_SUCCESS)
+ /* If the canonical name cannot be determined, use the passed
+ string. */
+ s = (char *) name;
+ }
+ return __strdup (name);
+}
static int
gaih_inet (const char *name, const struct gaih_service *service,
const struct addrinfo *req, struct addrinfo **pai,
- unsigned int *naddrs)
+ unsigned int *naddrs, struct scratch_buffer *tmpbuf)
{
const struct gaih_typeproto *tp = gaih_inet_typeproto;
struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv;
struct gaih_addrtuple *at = NULL;
- int rc;
bool got_ipv6 = false;
const char *canon = NULL;
const char *orig_name = name;
- size_t alloca_used = 0;
+
+ /* Reserve stack memory for the scratch buffer in the getaddrinfo
+ function. */
+ size_t alloca_used = sizeof (struct scratch_buffer);
if (req->ai_protocol || req->ai_socktype)
{
@@ -315,7 +387,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
st = (struct gaih_servtuple *)
alloca_account (sizeof (struct gaih_servtuple), alloca_used);
- if ((rc = gaih_inet_serv (service->name, tp, req, st)))
+ int rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf);
+ if (__glibc_unlikely (rc != 0))
return rc;
}
else
@@ -340,12 +413,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
alloca_account (sizeof (struct gaih_servtuple),
alloca_used);
- if ((rc = gaih_inet_serv (service->name, tp, req, newp)))
- {
- if (rc)
- continue;
- return rc;
- }
+ if (gaih_inet_serv (service->name,
+ tp, req, newp, tmpbuf) != 0)
+ continue;
*pst = newp;
pst = &(newp->next);
@@ -397,13 +467,10 @@ gaih_inet (const char *name, const struct gaih_service *service,
}
bool malloc_name = false;
- bool malloc_addrmem = false;
struct gaih_addrtuple *addrmem = NULL;
- bool malloc_canonbuf = false;
char *canonbuf = NULL;
- bool malloc_tmpbuf = false;
- char *tmpbuf = NULL;
int result = 0;
+
if (name != NULL)
{
at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used);
@@ -411,35 +478,15 @@ gaih_inet (const char *name, const struct gaih_service *service,
at->scopeid = 0;
at->next = NULL;
-#ifdef HAVE_LIBIDN
if (req->ai_flags & AI_IDN)
{
- int idn_flags = 0;
- if (req->ai_flags & AI_IDN_ALLOW_UNASSIGNED)
- idn_flags |= IDNA_ALLOW_UNASSIGNED;
- if (req->ai_flags & AI_IDN_USE_STD3_ASCII_RULES)
- idn_flags |= IDNA_USE_STD3_ASCII_RULES;
-
- char *p = NULL;
- rc = __idna_to_ascii_lz (name, &p, idn_flags);
- if (rc != IDNA_SUCCESS)
- {
- /* No need to jump to free_and_return here. */
- if (rc == IDNA_MALLOC_ERROR)
- return -EAI_MEMORY;
- if (rc == IDNA_DLOPEN_ERROR)
- return -EAI_SYSTEM;
- return -EAI_IDN_ENCODE;
- }
- /* In case the output string is the same as the input string
- no new string has been allocated. */
- if (p != name)
- {
- name = p;
- malloc_name = true;
- }
+ char *out;
+ result = __idna_to_dns_encoding (name, &out);
+ if (result != 0)
+ return -result;
+ name = out;
+ malloc_name = true;
}
-#endif
if (__inet_aton (name, (struct in_addr *) at->addr) != 0)
{
@@ -466,46 +513,11 @@ gaih_inet (const char *name, const struct gaih_service *service,
{
char *scope_delim = strchr (name, SCOPE_DELIMITER);
int e;
-
- {
- bool malloc_namebuf = false;
- char *namebuf = (char *) name;
-
- if (__glibc_unlikely (scope_delim != NULL))
- {
- if (malloc_name)
- *scope_delim = '\0';
- else
- {
- if (__libc_use_alloca (alloca_used
- + scope_delim - name + 1))
- {
- namebuf = alloca_account (scope_delim - name + 1,
- alloca_used);
- *((char *) __mempcpy (namebuf, name,
- scope_delim - name)) = '\0';
- }
- else
- {
- namebuf = strndup (name, scope_delim - name);
- if (namebuf == NULL)
- {
- assert (!malloc_name);
- return -EAI_MEMORY;
- }
- malloc_namebuf = true;
- }
- }
- }
-
- e = inet_pton (AF_INET6, namebuf, at->addr);
-
- if (malloc_namebuf)
- free (namebuf);
- else if (scope_delim != NULL && malloc_name)
- /* Undo what we did above. */
- *scope_delim = SCOPE_DELIMITER;
- }
+ if (scope_delim == NULL)
+ e = inet_pton (AF_INET6, name, at->addr);
+ else
+ e = __inet_pton_length (AF_INET6, name, scope_delim - name,
+ at->addr);
if (e > 0)
{
if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6)
@@ -522,31 +534,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)
@@ -563,7 +557,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
enum nss_status status = NSS_STATUS_UNAVAIL;
int no_more;
- int old_res_options;
+ struct resolv_context *res_ctx = NULL;
+ bool res_enable_inet6 = false;
/* If we do not have to look for IPv6 addresses or the canonical
name, use the simple, old functions, which do not support
@@ -571,40 +566,21 @@ gaih_inet (const char *name, const struct gaih_service *service,
if (req->ai_family == AF_INET
&& (req->ai_flags & AI_CANONNAME) == 0)
{
- /* Allocate additional room for struct host_data. */
- size_t tmpbuflen = (512 + MAX_NR_ALIASES * sizeof(char*)
- + 16 * sizeof(char));
- assert (tmpbuf == NULL);
- tmpbuf = alloca_account (tmpbuflen, alloca_used);
int rc;
struct hostent th;
struct hostent *h;
- int herrno;
while (1)
{
- rc = __gethostbyname2_r (name, AF_INET, &th, tmpbuf,
- tmpbuflen, &h, &herrno);
- if (rc != ERANGE || herrno != NETDB_INTERNAL)
+ rc = __gethostbyname2_r (name, AF_INET, &th,
+ tmpbuf->data, tmpbuf->length,
+ &h, &h_errno);
+ if (rc != ERANGE || h_errno != NETDB_INTERNAL)
break;
-
- if (!malloc_tmpbuf
- && __libc_use_alloca (alloca_used + 2 * tmpbuflen))
- tmpbuf = extend_alloca_account (tmpbuf, tmpbuflen,
- 2 * tmpbuflen,
- alloca_used);
- else
+ if (!scratch_buffer_grow (tmpbuf))
{
- char *newp = realloc (malloc_tmpbuf ? tmpbuf : NULL,
- 2 * tmpbuflen);
- if (newp == NULL)
- {
- result = -EAI_MEMORY;
- goto free_and_return;
- }
- tmpbuf = newp;
- malloc_tmpbuf = true;
- tmpbuflen = 2 * tmpbuflen;
+ result = -EAI_MEMORY;
+ goto free_and_return;
}
}
@@ -612,54 +588,29 @@ gaih_inet (const char *name, const struct gaih_service *service,
{
if (h != NULL)
{
- int i;
- /* We found data, count the number of addresses. */
- for (i = 0; h->h_addr_list[i]; ++i)
- ;
- if (i > 0 && *pat != NULL)
- --i;
-
- if (__libc_use_alloca (alloca_used
- + i * sizeof (struct gaih_addrtuple)))
- addrmem = alloca_account (i * sizeof (struct gaih_addrtuple),
- alloca_used);
- else
- {
- addrmem = malloc (i
- * sizeof (struct gaih_addrtuple));
- if (addrmem == NULL)
- {
- result = -EAI_MEMORY;
- goto free_and_return;
- }
- malloc_addrmem = true;
- }
-
- /* Now convert it into the list. */
- struct gaih_addrtuple *addrfree = addrmem;
- for (i = 0; h->h_addr_list[i]; ++i)
+ /* We found data, convert it. */
+ if (!convert_hostent_to_gaih_addrtuple
+ (req, AF_INET, h, &addrmem))
{
- if (*pat == NULL)
- {
- *pat = addrfree++;
- (*pat)->scopeid = 0;
- }
- (*pat)->next = NULL;
- (*pat)->family = AF_INET;
- memcpy ((*pat)->addr, h->h_addr_list[i],
- h->h_length);
- pat = &((*pat)->next);
+ result = -EAI_MEMORY;
+ goto free_and_return;
}
+ *pat = addrmem;
+ }
+ else
+ {
+ if (h_errno == NO_DATA)
+ result = -EAI_NODATA;
+ else
+ result = -EAI_NONAME;
+ goto free_and_return;
}
}
else
{
- if (herrno == NETDB_INTERNAL)
- {
- __set_h_errno (herrno);
- result = -EAI_SYSTEM;
- }
- else if (herrno == TRY_AGAIN)
+ if (h_errno == NETDB_INTERNAL)
+ result = -EAI_SYSTEM;
+ else if (h_errno == TRY_AGAIN)
result = -EAI_AGAIN;
else
/* We made requests but they turned out no data.
@@ -682,29 +633,18 @@ gaih_inet (const char *name, const struct gaih_service *service,
{
/* Try to use nscd. */
struct nscd_ai_result *air = NULL;
- int herrno;
- int err = __nscd_getai (name, &air, &herrno);
+ int err = __nscd_getai (name, &air, &h_errno);
if (air != NULL)
{
/* Transform into gaih_addrtuple list. */
bool added_canon = (req->ai_flags & AI_CANONNAME) == 0;
char *addrs = air->addrs;
- if (__libc_use_alloca (alloca_used
- + air->naddrs * sizeof (struct gaih_addrtuple)))
- addrmem = alloca_account (air->naddrs
- * sizeof (struct gaih_addrtuple),
- alloca_used);
- else
+ addrmem = calloc (air->naddrs, sizeof (*addrmem));
+ if (addrmem == NULL)
{
- addrmem = malloc (air->naddrs
- * sizeof (struct gaih_addrtuple));
- if (addrmem == NULL)
- {
- result = -EAI_MEMORY;
- goto free_and_return;
- }
- malloc_addrmem = true;
+ result = -EAI_MEMORY;
+ goto free_and_return;
}
struct gaih_addrtuple *addrfree = addrmem;
@@ -735,22 +675,13 @@ gaih_inet (const char *name, const struct gaih_service *service,
(*pat)->name = NULL;
else if (canonbuf == NULL)
{
- size_t canonlen = strlen (air->canon) + 1;
- if ((req->ai_flags & AI_CANONIDN) != 0
- && __libc_use_alloca (alloca_used + canonlen))
- canonbuf = alloca_account (canonlen, alloca_used);
- else
+ canonbuf = __strdup (air->canon);
+ if (canonbuf == NULL)
{
- canonbuf = malloc (canonlen);
- if (canonbuf == NULL)
- {
- result = -EAI_MEMORY;
- goto free_and_return;
- }
- malloc_canonbuf = true;
+ result = -EAI_MEMORY;
+ goto free_and_return;
}
- canon = (*pat)->name = memcpy (canonbuf, air->canon,
- canonlen);
+ canon = (*pat)->name = canonbuf;
}
if (air->family[i] == AF_INET
@@ -793,9 +724,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
goto free_and_return;
else if (__nss_not_use_nscd_hosts == 0)
{
- if (herrno == NETDB_INTERNAL && errno == ENOMEM)
+ if (h_errno == NETDB_INTERNAL && errno == ENOMEM)
result = -EAI_MEMORY;
- else if (herrno == TRY_AGAIN)
+ else if (h_errno == TRY_AGAIN)
result = -EAI_AGAIN;
else
result = -EAI_SYSTEM;
@@ -813,34 +744,14 @@ gaih_inet (const char *name, const struct gaih_service *service,
no_more = 0;
nip = __nss_hosts_database;
- /* Initialize configurations. */
- if (__glibc_unlikely (!_res_hconf.initialized))
- _res_hconf_init ();
- if (__res_maybe_init (&_res, 0) == -1)
- no_more = 1;
-
/* If we are looking for both IPv4 and IPv6 address we don't
want the lookup functions to automatically promote IPv4
- addresses to IPv6 addresses. Currently this is decided
- by setting the RES_USE_INET6 bit in _res.options. */
- old_res_options = _res.options;
- _res.options &= ~RES_USE_INET6;
-
- size_t tmpbuflen = 1024 + sizeof(struct gaih_addrtuple);
- malloc_tmpbuf = !__libc_use_alloca (alloca_used + tmpbuflen);
- assert (tmpbuf == NULL);
- if (!malloc_tmpbuf)
- tmpbuf = alloca_account (tmpbuflen, alloca_used);
- else
- {
- tmpbuf = malloc (tmpbuflen);
- if (tmpbuf == NULL)
- {
- _res.options |= old_res_options & RES_USE_INET6;
- result = -EAI_MEMORY;
- goto free_and_return;
- }
- }
+ addresses to IPv6 addresses, so we use the no_inet6
+ function variant. */
+ res_ctx = __resolv_context_get ();
+ res_enable_inet6 = __resolv_context_disable_inet6 (res_ctx);
+ if (res_ctx == NULL)
+ no_more = 1;
while (!no_more)
{
@@ -854,44 +765,31 @@ gaih_inet (const char *name, const struct gaih_service *service,
if (fct4 != NULL)
{
- int herrno;
-
while (1)
{
- rc = 0;
- status = DL_CALL_FCT (fct4, (name, pat, tmpbuf,
- tmpbuflen, &rc, &herrno,
+ status = DL_CALL_FCT (fct4, (name, pat,
+ tmpbuf->data, tmpbuf->length,
+ &errno, &h_errno,
NULL));
if (status == NSS_STATUS_SUCCESS)
break;
if (status != NSS_STATUS_TRYAGAIN
- || rc != ERANGE || herrno != NETDB_INTERNAL)
+ || errno != ERANGE || h_errno != NETDB_INTERNAL)
{
- if (herrno == TRY_AGAIN)
+ if (h_errno == TRY_AGAIN)
no_data = EAI_AGAIN;
else
- no_data = herrno == NO_DATA;
+ no_data = h_errno == NO_DATA;
break;
}
- if (!malloc_tmpbuf
- && __libc_use_alloca (alloca_used + 2 * tmpbuflen))
- tmpbuf = extend_alloca_account (tmpbuf, tmpbuflen,
- 2 * tmpbuflen,
- alloca_used);
- else
+ if (!scratch_buffer_grow (tmpbuf))
{
- char *newp = realloc (malloc_tmpbuf ? tmpbuf : NULL,
- 2 * tmpbuflen);
- if (newp == NULL)
- {
- _res.options |= old_res_options & RES_USE_INET6;
- result = -EAI_MEMORY;
- goto free_and_return;
- }
- tmpbuf = newp;
- malloc_tmpbuf = true;
- tmpbuflen = 2 * tmpbuflen;
+ __resolv_context_enable_inet6
+ (res_ctx, res_enable_inet6);
+ __resolv_context_put (res_ctx);
+ result = -EAI_MEMORY;
+ goto free_and_return;
}
}
@@ -985,54 +883,16 @@ gaih_inet (const char *name, const struct gaih_service *service,
if ((req->ai_flags & AI_CANONNAME) != 0
&& canon == NULL)
{
- /* If we need the canonical name, get it
- from the same service as the result. */
- nss_getcanonname_r cfct;
- int herrno;
-
- cfct = __nss_lookup_function (nip,
- "getcanonname_r");
- if (cfct != NULL)
+ canonbuf = getcanonname (nip, at, name);
+ if (canonbuf == NULL)
{
- const size_t max_fqdn_len = 256;
- if ((req->ai_flags & AI_CANONIDN) != 0
- && __libc_use_alloca (alloca_used
- + max_fqdn_len))
- canonbuf = alloca_account (max_fqdn_len,
- alloca_used);
- else
- {
- canonbuf = malloc (max_fqdn_len);
- if (canonbuf == NULL)
- {
- _res.options
- |= old_res_options & RES_USE_INET6;
- result = -EAI_MEMORY;
- goto free_and_return;
- }
- malloc_canonbuf = true;
- }
- char *s;
-
- if (DL_CALL_FCT (cfct, (at->name ?: name,
- canonbuf,
- max_fqdn_len,
- &s, &rc, &herrno))
- == NSS_STATUS_SUCCESS)
- canon = s;
- else
- {
- /* If the canonical name cannot be
- determined, use the passed in
- string. */
- if (malloc_canonbuf)
- {
- free (canonbuf);
- malloc_canonbuf = false;
- }
- canon = name;
- }
+ __resolv_context_enable_inet6
+ (res_ctx, res_enable_inet6);
+ __resolv_context_put (res_ctx);
+ result = -EAI_MEMORY;
+ goto free_and_return;
}
+ canon = canonbuf;
}
status = NSS_STATUS_SUCCESS;
}
@@ -1049,13 +909,17 @@ gaih_inet (const char *name, const struct gaih_service *service,
}
else
{
+ /* Could not locate any of the lookup functions.
+ The NSS lookup code does not consistently set
+ errno, so we need to supply our own error
+ code here. The root cause could either be a
+ resource allocation failure, or a missing
+ service function in the DSO (so it should not
+ be listed in /etc/nsswitch.conf). Assume the
+ former, and return EBUSY. */
status = NSS_STATUS_UNAVAIL;
- /* Could not load any of the lookup functions. Indicate
- an internal error if the failure was due to a system
- error other than the file not being found. We use the
- errno from the last failed callback. */
- if (errno != 0 && errno != ENOENT)
- __set_h_errno (NETDB_INTERNAL);
+ __set_h_errno (NETDB_INTERNAL);
+ __set_errno (EBUSY);
}
}
@@ -1068,9 +932,13 @@ gaih_inet (const char *name, const struct gaih_service *service,
nip = nip->next;
}
- _res.options |= old_res_options & RES_USE_INET6;
+ __resolv_context_enable_inet6 (res_ctx, res_enable_inet6);
+ __resolv_context_put (res_ctx);
- if (h_errno == NETDB_INTERNAL)
+ /* If we have a failure which sets errno, report it using
+ EAI_SYSTEM. */
+ if ((status == NSS_STATUS_TRYAGAIN || status == NSS_STATUS_UNAVAIL)
+ && h_errno == NETDB_INTERNAL)
{
result = -EAI_SYSTEM;
goto free_and_return;
@@ -1144,46 +1012,31 @@ gaih_inet (const char *name, const struct gaih_service *service,
the passed in string. */
canon = orig_name;
-#ifdef HAVE_LIBIDN
- if (req->ai_flags & AI_CANONIDN)
+ bool do_idn = req->ai_flags & AI_CANONIDN;
+ if (do_idn)
{
- int idn_flags = 0;
- if (req->ai_flags & AI_IDN_ALLOW_UNASSIGNED)
- idn_flags |= IDNA_ALLOW_UNASSIGNED;
- if (req->ai_flags & AI_IDN_USE_STD3_ASCII_RULES)
- idn_flags |= IDNA_USE_STD3_ASCII_RULES;
-
char *out;
- int rc = __idna_to_unicode_lzlz (canon, &out, idn_flags);
- if (rc != IDNA_SUCCESS)
+ int rc = __idna_from_dns_encoding (canon, &out);
+ if (rc == 0)
+ canon = out;
+ else if (rc == EAI_IDN_ENCODE)
+ /* Use the punycode name as a fallback. */
+ do_idn = false;
+ else
{
- if (rc == IDNA_MALLOC_ERROR)
- result = -EAI_MEMORY;
- else if (rc == IDNA_DLOPEN_ERROR)
- result = -EAI_SYSTEM;
- else
- result = -EAI_IDN_ENCODE;
+ result = -rc;
goto free_and_return;
}
- /* In case the output string is the same as the input
- string no new string has been allocated and we
- make a copy. */
- if (out == canon)
- goto make_copy;
- canon = out;
}
- else
-#endif
+ if (!do_idn)
{
-#ifdef HAVE_LIBIDN
- make_copy:
-#endif
- if (malloc_canonbuf)
- /* We already allocated the string using malloc. */
- malloc_canonbuf = false;
+ if (canonbuf != NULL)
+ /* We already allocated the string using malloc, but
+ the buffer is now owned by canon. */
+ canonbuf = NULL;
else
{
- canon = strdup (canon);
+ canon = __strdup (canon);
if (canon == NULL)
{
result = -EAI_MEMORY;
@@ -1274,12 +1127,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
free_and_return:
if (malloc_name)
free ((char *) name);
- if (malloc_addrmem)
- free (addrmem);
- if (malloc_canonbuf)
- free (canonbuf);
- if (malloc_tmpbuf)
- free (tmpbuf);
+ free (addrmem);
+ free (canonbuf);
return result;
}
@@ -2341,10 +2190,7 @@ getaddrinfo (const char *name, const char *service,
if (hints->ai_flags
& ~(AI_PASSIVE|AI_CANONNAME|AI_NUMERICHOST|AI_ADDRCONFIG|AI_V4MAPPED
-#ifdef HAVE_LIBIDN
- |AI_IDN|AI_CANONIDN|AI_IDN_ALLOW_UNASSIGNED
- |AI_IDN_USE_STD3_ASCII_RULES
-#endif
+ |AI_IDN|AI_CANONIDN|DEPRECATED_AI_IDN
|AI_NUMERICSERV|AI_ALL))
return EAI_BADFLAGS;
@@ -2414,7 +2260,11 @@ getaddrinfo (const char *name, const char *service,
if (hints->ai_family == AF_UNSPEC || hints->ai_family == AF_INET
|| hints->ai_family == AF_INET6)
{
- last_i = gaih_inet (name, pservice, hints, end, &naddrs);
+ struct scratch_buffer tmpbuf;
+ scratch_buffer_init (&tmpbuf);
+ last_i = gaih_inet (name, pservice, hints, end, &naddrs, &tmpbuf);
+ scratch_buffer_free (&tmpbuf);
+
if (last_i != 0)
{
freeaddrinfo (p);
@@ -2510,9 +2360,9 @@ getaddrinfo (const char *name, const char *service,
{
if (fd != -1)
close_retry:
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
af = q->ai_family;
- fd = __socket (af, SOCK_DGRAM, IPPROTO_IP);
+ fd = __socket (af, SOCK_DGRAM | SOCK_CLOEXEC, IPPROTO_IP);
}
else
{
@@ -2613,7 +2463,7 @@ getaddrinfo (const char *name, const char *service,
}
if (fd != -1)
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
/* We got all the source addresses we can get, now sort using
the information. */
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index 38cf4e7fc8..b53433a2dc 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -175,8 +175,8 @@ extern char *alloca ();
# include <not-cancel.h>
# include <kernel-features.h>
#else
-# define openat64_not_cancel_3(dfd, name, mode) openat64 (dfd, name, mode)
-# define close_not_cancel_no_status(fd) close (fd)
+# define __openat64_nocancel(dfd, name, mode) openat64 (dfd, name, mode)
+# define __close_nocancel_nostatus(fd) close (fd)
#endif
#ifndef PATH_MAX
@@ -281,13 +281,7 @@ __getcwd (char *buf, size_t size)
while (!(thisdev == rootdev && thisino == rootino))
{
if (__have_atfcts >= 0)
- {
- int mode = O_RDONLY;
-#ifdef O_CLOEXEC
- mode |= O_CLOEXEC;
-#endif
- fd = openat64_not_cancel_3 (fd, "..", mode);
- }
+ fd = __openat64_nocancel (fd, "..", O_RDONLY | O_CLOEXEC);
else
fd = -1;
if (fd >= 0)
@@ -324,7 +318,7 @@ __getcwd (char *buf, size_t size)
}
else
{
- new = realloc ((__ptr_t) dotlist, dotsize * 2 + 1);
+ new = realloc ((void *) dotlist, dotsize * 2 + 1);
if (new == NULL)
goto lose;
dotp = &new[dotsize];
@@ -498,7 +492,7 @@ __getcwd (char *buf, size_t size)
#ifndef __ASSUME_ATFCTS
if (dotlist != dots)
- free ((__ptr_t) dotlist);
+ free ((void *) dotlist);
#endif
size_t used = path + allocated - pathp;
@@ -522,12 +516,12 @@ __getcwd (char *buf, size_t size)
int save_errno = errno;
#ifndef __ASSUME_ATFCTS
if (dotlist != dots)
- free ((__ptr_t) dotlist);
+ free ((void *) dotlist);
#endif
if (dirstream != NULL)
__closedir (dirstream);
if (fd_needs_closing)
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
#ifndef NO_ALLOCATION
if (buf == NULL)
free (path);
diff --git a/sysdeps/posix/getdtsz.c b/sysdeps/posix/getdtsz.c
index ea1c66ca0b..0da5081575 100644
--- a/sysdeps/posix/getdtsz.c
+++ b/sysdeps/posix/getdtsz.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/gethostname.c b/sysdeps/posix/gethostname.c
index 6ce54e933b..0e29e18617 100644
--- a/sysdeps/posix/gethostname.c
+++ b/sysdeps/posix/gethostname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,7 +29,7 @@ __gethostname (char *name, size_t len)
struct utsname buf;
size_t node_len;
- if (uname (&buf))
+ if (__uname (&buf))
return -1;
node_len = strlen (buf.nodename) + 1;
diff --git a/sysdeps/posix/getpagesize.c b/sysdeps/posix/getpagesize.c
index 11963ac7a6..6f37dba644 100644
--- a/sysdeps/posix/getpagesize.c
+++ b/sysdeps/posix/getpagesize.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@cygnus.com).
diff --git a/sysdeps/posix/gettimeofday.c b/sysdeps/posix/gettimeofday.c
index e6e343c23d..ea00cd387d 100644
--- a/sysdeps/posix/gettimeofday.c
+++ b/sysdeps/posix/gettimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/isatty.c b/sysdeps/posix/isatty.c
index aaed61af74..a06e7ecad5 100644
--- a/sysdeps/posix/isatty.c
+++ b/sysdeps/posix/isatty.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/isfdtype.c b/sysdeps/posix/isfdtype.c
index e3779b4530..38e7fd4210 100644
--- a/sysdeps/posix/isfdtype.c
+++ b/sysdeps/posix/isfdtype.c
@@ -1,5 +1,5 @@
/* Determine whether descriptor has given property.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/killpg.c b/sysdeps/posix/killpg.c
index dc3a7f1433..533d2f1722 100644
--- a/sysdeps/posix/killpg.c
+++ b/sysdeps/posix/killpg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/libc_fatal.c b/sysdeps/posix/libc_fatal.c
index 3c820dab11..89a20080e1 100644
--- a/sysdeps/posix/libc_fatal.c
+++ b/sysdeps/posix/libc_fatal.c
@@ -1,5 +1,5 @@
/* Catastrophic failure reports. Generic POSIX.1 version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -64,7 +64,7 @@ struct str_list
/* Abort with an error message. */
void
-__libc_message (int do_abort, const char *fmt, ...)
+__libc_message (enum __libc_message_action action, const char *fmt, ...)
{
va_list ap;
int fd = -1;
@@ -75,11 +75,16 @@ __libc_message (int do_abort, const char *fmt, ...)
FATAL_PREPARE;
#endif
- /* Open a descriptor for /dev/tty unless the user explicitly
- requests errors on standard error. */
- const char *on_2 = __libc_secure_getenv ("LIBC_FATAL_STDERR_");
- if (on_2 == NULL || *on_2 == '\0')
- fd = open_not_cancel_2 (_PATH_TTY, O_RDWR | O_NOCTTY | O_NDELAY);
+ /* Don't call __libc_secure_getenv if we aren't doing backtrace, which
+ may access the corrupted stack. */
+ if ((action & do_backtrace))
+ {
+ /* Open a descriptor for /dev/tty unless the user explicitly
+ requests errors on standard error. */
+ const char *on_2 = __libc_secure_getenv ("LIBC_FATAL_STDERR_");
+ if (on_2 == NULL || *on_2 == '\0')
+ fd = __open_nocancel (_PATH_TTY, O_RDWR | O_NOCTTY | O_NDELAY);
+ }
if (fd == -1)
fd = STDERR_FILENO;
@@ -140,7 +145,7 @@ __libc_message (int do_abort, const char *fmt, ...)
written = WRITEV_FOR_FATAL (fd, iov, nlist, total);
- if (do_abort)
+ if ((action & do_abort))
{
total = ((total + 1 + GLRO(dl_pagesize) - 1)
& ~(GLRO(dl_pagesize) - 1));
@@ -167,9 +172,10 @@ __libc_message (int do_abort, const char *fmt, ...)
va_end (ap);
- if (do_abort)
+ if ((action & do_abort))
{
- BEFORE_ABORT (do_abort, written, fd);
+ if ((action & do_backtrace))
+ BEFORE_ABORT (do_abort, written, fd);
/* Kill the application. */
abort ();
@@ -182,6 +188,6 @@ __libc_fatal (const char *message)
{
/* The loop is added only to keep gcc happy. */
while (1)
- __libc_message (1, "%s", message);
+ __libc_message (do_abort | do_backtrace, "%s", message);
}
libc_hidden_def (__libc_fatal)
diff --git a/sysdeps/posix/mkfifo.c b/sysdeps/posix/mkfifo.c
index 7eea6572ca..eedbf9e28c 100644
--- a/sysdeps/posix/mkfifo.c
+++ b/sysdeps/posix/mkfifo.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/mkfifoat.c b/sysdeps/posix/mkfifoat.c
index 0f910d7441..c54383eab9 100644
--- a/sysdeps/posix/mkfifoat.c
+++ b/sysdeps/posix/mkfifoat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/nice.c b/sysdeps/posix/nice.c
index ae82618767..2d907e80e4 100644
--- a/sysdeps/posix/nice.c
+++ b/sysdeps/posix/nice.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/open64.c b/sysdeps/posix/open64.c
index dc0387b44a..c4209c8cdb 100644
--- a/sysdeps/posix/open64.c
+++ b/sysdeps/posix/open64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/opendir.c b/sysdeps/posix/opendir.c
index 3e09deb805..bb6bd7cc85 100644
--- a/sysdeps/posix/opendir.c
+++ b/sysdeps/posix/opendir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software 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,24 +15,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <assert.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdlib.h>
#include <dirent.h>
#include <fcntl.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
+#include <errno.h>
+#include <stdio.h> /* For BUFSIZ. */
+#include <sys/param.h> /* For MIN and MAX. */
-#include <dirstream.h>
#include <not-cancel.h>
-#include <kernel-features.h>
/* The st_blksize value of the directory is used as a hint for the
size of the buffer which receives struct dirent values from the
@@ -40,47 +29,9 @@
file system provides a bogus value. */
#define MAX_DIR_BUFFER_SIZE 1048576U
-/* opendir() must not accidentally open something other than a directory.
- Some OS's have kernel support for that, some don't. In the worst
- case we have to stat() before the open() AND fstat() after.
-
- We have to test at runtime for kernel support since libc may have
- been compiled with different headers to the kernel it's running on.
- This test can't be done reliably in the general case. We'll use
- /dev/null, which if it's not a device lots of stuff will break, as
- a guinea pig. It may be missing in chroot environments, so we
- make sure to fail safe. */
-#ifdef O_DIRECTORY
-# ifdef O_DIRECTORY_WORKS
-# define o_directory_works 1
-# define tryopen_o_directory() while (1) /* This must not be called. */
-# else
-static int o_directory_works;
-
-static void
-tryopen_o_directory (void)
-{
- int serrno = errno;
- int x = open_not_cancel_2 ("/dev/null", O_RDONLY|O_NDELAY|O_DIRECTORY);
-
- if (x >= 0)
- {
- close_not_cancel_no_status (x);
- o_directory_works = -1;
- }
- else if (errno != ENOTDIR)
- o_directory_works = -1;
- else
- o_directory_works = 1;
-
- __set_errno (serrno);
-}
-# endif
-# define EXTRA_FLAGS O_DIRECTORY
-#else
-# define EXTRA_FLAGS 0
-#endif
-
+enum {
+ opendir_oflags = O_RDONLY|O_NDELAY|O_DIRECTORY|O_LARGEFILE|O_CLOEXEC
+};
static bool
invalid_name (const char *name)
@@ -95,33 +46,6 @@ invalid_name (const char *name)
return false;
}
-
-static bool
-need_isdir_precheck (void)
-{
-#ifdef O_DIRECTORY
- /* Test whether O_DIRECTORY works. */
- if (o_directory_works == 0)
- tryopen_o_directory ();
-
- /* We can skip the expensive `stat' call if O_DIRECTORY works. */
- return o_directory_works < 0;
-#endif
- return true;
-}
-
-
-static int
-opendir_oflags (void)
-{
- int flags = O_RDONLY|O_NDELAY|EXTRA_FLAGS|O_LARGEFILE;
-#ifdef O_CLOEXEC
- flags |= O_CLOEXEC;
-#endif
- return flags;
-}
-
-
static DIR *
opendir_tail (int fd)
{
@@ -138,7 +62,7 @@ opendir_tail (int fd)
{
__set_errno (ENOTDIR);
lose:
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
return NULL;
}
@@ -148,29 +72,12 @@ opendir_tail (int fd)
#if IS_IN (libc)
DIR *
-internal_function
__opendirat (int dfd, const char *name)
{
if (__glibc_unlikely (invalid_name (name)))
return NULL;
- if (need_isdir_precheck ())
- {
- /* We first have to check whether the name is for a directory. We
- cannot do this after the open() call since the open/close operation
- performed on, say, a tape device might have undesirable effects. */
- struct stat64 statbuf;
- if (__glibc_unlikely (__fxstatat64 (_STAT_VER, dfd, name,
- &statbuf, 0) < 0))
- return NULL;
- if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode)))
- {
- __set_errno (ENOTDIR);
- return NULL;
- }
- }
-
- return opendir_tail (openat_not_cancel_3 (dfd, name, opendir_oflags ()));
+ return opendir_tail (__openat_nocancel (dfd, name, opendir_oflags));
}
#endif
@@ -182,54 +89,18 @@ __opendir (const char *name)
if (__glibc_unlikely (invalid_name (name)))
return NULL;
- if (need_isdir_precheck ())
- {
- /* We first have to check whether the name is for a directory. We
- cannot do this after the open() call since the open/close operation
- performed on, say, a tape device might have undesirable effects. */
- struct stat64 statbuf;
- if (__glibc_unlikely (__xstat64 (_STAT_VER, name, &statbuf) < 0))
- return NULL;
- if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode)))
- {
- __set_errno (ENOTDIR);
- return NULL;
- }
- }
-
- return opendir_tail (open_not_cancel_2 (name, opendir_oflags ()));
+ return opendir_tail (__open_nocancel (name, opendir_oflags));
}
weak_alias (__opendir, opendir)
-
-#ifdef __ASSUME_O_CLOEXEC
-# define check_have_o_cloexec(fd) 1
-#else
-static int
-check_have_o_cloexec (int fd)
-{
- if (__have_o_cloexec == 0)
- __have_o_cloexec = (__fcntl (fd, F_GETFD, 0) & FD_CLOEXEC) == 0 ? -1 : 1;
- return __have_o_cloexec > 0;
-}
-#endif
-
-
DIR *
-internal_function
__alloc_dir (int fd, bool close_fd, int flags, const struct stat64 *statp)
{
- /* We always have to set the close-on-exit flag if the user provided
- the file descriptor. Otherwise only if we have no working
- O_CLOEXEC support. */
-#ifdef O_CLOEXEC
- if ((! close_fd && (flags & O_CLOEXEC) == 0)
- || ! check_have_o_cloexec (fd))
-#endif
- {
- if (__builtin_expect (__fcntl (fd, F_SETFD, FD_CLOEXEC), 0) < 0)
+ /* We have to set the close-on-exit flag if the user provided the
+ file descriptor. */
+ if (!close_fd
+ && __glibc_unlikely (__fcntl64_nocancel (fd, F_SETFD, FD_CLOEXEC) < 0))
goto lose;
- }
const size_t default_allocation = (4 * BUFSIZ < sizeof (struct dirent64)
? sizeof (struct dirent64) : 4 * BUFSIZ);
@@ -256,7 +127,7 @@ __alloc_dir (int fd, bool close_fd, int flags, const struct stat64 *statp)
if (close_fd)
{
int save_errno = errno;
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
__set_errno (save_errno);
}
return NULL;
diff --git a/sysdeps/posix/pathconf.c b/sysdeps/posix/pathconf.c
index f65d5018ea..0f893ec1ba 100644
--- a/sysdeps/posix/pathconf.c
+++ b/sysdeps/posix/pathconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -101,25 +101,22 @@ __pathconf (const char *path, int name)
#endif
case _PC_CHOWN_RESTRICTED:
-#ifdef _POSIX_CHOWN_RESTRICTED
- return _POSIX_CHOWN_RESTRICTED;
-#else
- return -1;
+#if _POSIX_CHOWN_RESTRICTED == -1
+# error "Invalid value for _POSIX_CHOWN_RESTRICTED"
#endif
+ return _POSIX_CHOWN_RESTRICTED;
case _PC_NO_TRUNC:
-#ifdef _POSIX_NO_TRUNC
- return _POSIX_NO_TRUNC;
-#else
- return -1;
+#if _POSIX_NO_TRUNC == -1
+# error "Invalid value for _POSIX_NO_TRUNC"
#endif
+ return _POSIX_NO_TRUNC;
case _PC_VDISABLE:
-#ifdef _POSIX_VDISABLE
- return _POSIX_VDISABLE;
-#else
- return -1;
+#if _POSIX_VDISABLE == -1
+# error "Invalid value for _POSIX_VDISABLE"
#endif
+ return _POSIX_VDISABLE;
case _PC_SYNC_IO:
#ifdef _POSIX_SYNC_IO
diff --git a/sysdeps/posix/pause.c b/sysdeps/posix/pause.c
index f1ecc4f98b..2b9eca2192 100644
--- a/sysdeps/posix/pause.c
+++ b/sysdeps/posix/pause.c
@@ -1,5 +1,5 @@
/* pause -- suspend the process until a signal arrives. POSIX.1 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <signal.h>
#include <unistd.h>
#include <sysdep-cancel.h>
+#include <sigsetops.h>
/* Suspend the process until a signal arrives.
This always returns -1 and sets errno to EINTR. */
@@ -39,18 +40,3 @@ __libc_pause (void)
weak_alias (__libc_pause, pause)
LIBC_CANCEL_HANDLED (); /* sigsuspend handles our cancellation. */
-
-#ifndef NO_CANCELLATION
-# include <not-cancel.h>
-
-int
-__pause_nocancel (void)
-{
- sigset_t set;
-
- __sigemptyset (&set);
- __sigprocmask (SIG_BLOCK, NULL, &set);
-
- return sigsuspend_not_cancel (&set);
-}
-#endif
diff --git a/sysdeps/posix/posix_fallocate.c b/sysdeps/posix/posix_fallocate.c
index 970e7d80e8..f3c2182486 100644
--- a/sysdeps/posix/posix_fallocate.c
+++ b/sysdeps/posix/posix_fallocate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/posix_fallocate64.c b/sysdeps/posix/posix_fallocate64.c
index 0c094ff9b8..2eaeab2a6f 100644
--- a/sysdeps/posix/posix_fallocate64.c
+++ b/sysdeps/posix/posix_fallocate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/pread.c b/sysdeps/posix/pread.c
index aa8e8901fd..aa0a56cf98 100644
--- a/sysdeps/posix/pread.c
+++ b/sysdeps/posix/pread.c
@@ -1,6 +1,6 @@
/* Read block from given position in file without changing file pointer.
POSIX version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/posix/pread64.c b/sysdeps/posix/pread64.c
index b7a2808c07..04146239a8 100644
--- a/sysdeps/posix/pread64.c
+++ b/sysdeps/posix/pread64.c
@@ -1,6 +1,6 @@
/* Read block from given position in file without changing file pointer.
POSIX version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -58,5 +58,6 @@ __libc_pread64 (int fd, void *buf, size_t nbyte, off64_t offset)
#ifndef __libc_pread64
weak_alias (__libc_pread64, __pread64)
+libc_hidden_weak (__pread64)
weak_alias (__libc_pread64, pread64)
#endif
diff --git a/sysdeps/posix/preadv.c b/sysdeps/posix/preadv.c
index fb7586c0a6..f944ec746e 100644
--- a/sysdeps/posix/preadv.c
+++ b/sysdeps/posix/preadv.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Read data into multiple buffers. Generic version.
+ Copyright (C) 2009-2018 Free Software 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,93 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <limits.h>
-#include <stdbool.h>
-#include <sys/param.h>
-#if __WORDSIZE == 64 && !defined PREADV
-/* Hide the preadv64 declaration. */
-# define preadv64 __redirect_preadv64
-#endif
-#include <sys/uio.h>
-#include <bits/wordsize.h>
+#include <sys/types.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
-#ifndef PREADV
# define PREADV preadv
# define PREAD __pread
# define OFF_T off_t
-#endif
-
-
-static void
-ifree (char **ptrp)
-{
- free (*ptrp);
-}
-
-
-/* Read data from file descriptor FD at the given position OFFSET
- without change the file pointer, and put the result in the buffers
- described by VECTOR, which is a vector of COUNT 'struct iovec's.
- The buffers are filled in the order specified. Operates just like
- 'pread' (see <unistd.h>) except that data are put in VECTOR instead
- of a contiguous buffer. */
-ssize_t
-PREADV (int fd, const struct iovec *vector, int count, OFF_T offset)
-{
- /* Find the total number of bytes to be read. */
- size_t bytes = 0;
- for (int i = 0; i < count; ++i)
- {
- /* Check for ssize_t overflow. */
- if (SSIZE_MAX - bytes < vector[i].iov_len)
- {
- __set_errno (EINVAL);
- return -1;
- }
- bytes += vector[i].iov_len;
- }
-
- /* Allocate a temporary buffer to hold the data. We should normally
- use alloca since it's faster and does not require synchronization
- with other threads. But we cannot if the amount of memory
- required is too large. */
- char *buffer;
- char *malloced_buffer __attribute__ ((__cleanup__ (ifree))) = NULL;
- if (__libc_use_alloca (bytes))
- buffer = (char *) __alloca (bytes);
- else
- {
- malloced_buffer = buffer = (char *) malloc (bytes);
- if (buffer == NULL)
- return -1;
- }
-
- /* Read the data. */
- ssize_t bytes_read = PREAD (fd, buffer, bytes, offset);
- if (bytes_read < 0)
- return -1;
-
- /* Copy the data from BUFFER into the memory specified by VECTOR. */
- bytes = bytes_read;
- for (int i = 0; i < count; ++i)
- {
- size_t copy = MIN (vector[i].iov_len, bytes);
-
- (void) memcpy ((void *) vector[i].iov_base, (void *) buffer, copy);
+# include <sysdeps/posix/preadv_common.c>
- buffer += copy;
- bytes -= copy;
- if (bytes == 0)
- break;
- }
+libc_hidden_def (preadv)
- return bytes_read;
-}
-#if __WORDSIZE == 64 && defined preadv64
-# undef preadv64
-strong_alias (preadv, preadv64)
#endif
diff --git a/sysdeps/posix/preadv2.c b/sysdeps/posix/preadv2.c
new file mode 100644
index 0000000000..4f8557ac83
--- /dev/null
+++ b/sysdeps/posix/preadv2.c
@@ -0,0 +1,42 @@
+/* Generic version of preadv2.
+ Copyright (C) 2017-2018 Free Software 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 <unistd.h>
+#include <sys/uio.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+/* Since we define no flags for preadv2 just route to preadv. */
+ssize_t
+preadv2 (int fd, const struct iovec *vector, int count, off_t offset,
+ int flags)
+{
+ if (flags != 0)
+ {
+ __set_errno (ENOTSUP);
+ return -1;
+ }
+
+ if (offset == -1)
+ return __readv (fd, vector, count);
+ else
+ return preadv (fd, vector, count, offset);
+}
+
+#endif
diff --git a/sysdeps/posix/preadv64.c b/sysdeps/posix/preadv64.c
index 198622353a..d0ee6dae4a 100644
--- a/sysdeps/posix/preadv64.c
+++ b/sysdeps/posix/preadv64.c
@@ -1,9 +1,28 @@
-#include <bits/wordsize.h>
+/* Read data into multiple buffers. Generic LFS version.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#if __WORDSIZE == 32
-# define PREADV preadv64
-# define PREAD __pread64
-# define OFF_T off64_t
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-# include "preadv.c"
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 PREADV preadv64
+#define PREAD __pread64
+#define OFF_T off64_t
+#include <sysdeps/posix/preadv_common.c>
+
+libc_hidden_def (preadv64)
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (preadv64, preadv)
+libc_hidden_def (preadv)
#endif
diff --git a/sysdeps/posix/preadv64v2.c b/sysdeps/posix/preadv64v2.c
new file mode 100644
index 0000000000..f89ad08c54
--- /dev/null
+++ b/sysdeps/posix/preadv64v2.c
@@ -0,0 +1,41 @@
+/* Generic version of preadv2.
+ Copyright (C) 2017-2018 Free Software 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 <unistd.h>
+#include <sys/uio.h>
+
+ssize_t
+preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
+ int flags)
+{
+ if (flags != 0)
+ {
+ __set_errno (ENOTSUP);
+ return -1;
+ }
+
+ if (offset == -1)
+ return __readv (fd, vector, count);
+ else
+ return preadv64 (fd, vector, count, offset);
+}
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (preadv64v2, preadv2)
+#endif
diff --git a/sysdeps/posix/preadv_common.c b/sysdeps/posix/preadv_common.c
new file mode 100644
index 0000000000..14fd4cea2a
--- /dev/null
+++ b/sysdeps/posix/preadv_common.c
@@ -0,0 +1,85 @@
+/* Read data into multiple buffers. Base implementation for preadv
+ and preadv64.
+ Copyright (C) 2017-2018 Free Software 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 <sys/uio.h>
+#include <sys/param.h>
+#include <errno.h>
+#include <malloc.h>
+
+#include <ldsodefs.h>
+#include <libc-pointer-arith.h>
+
+/* Read data from file descriptor FD at the given position OFFSET
+ without change the file pointer, and put the result in the buffers
+ described by VECTOR, which is a vector of COUNT 'struct iovec's.
+ The buffers are filled in the order specified. Operates just like
+ 'pread' (see <unistd.h>) except that data are put in VECTOR instead
+ of a contiguous buffer. */
+ssize_t
+PREADV (int fd, const struct iovec *vector, int count, OFF_T offset)
+{
+ /* Find the total number of bytes to be read. */
+ size_t bytes = 0;
+ for (int i = 0; i < count; ++i)
+ {
+ /* Check for ssize_t overflow. */
+ if (SSIZE_MAX - bytes < vector[i].iov_len)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+ bytes += vector[i].iov_len;
+ }
+
+ /* Allocate a temporary buffer to hold the data. It could be done with a
+ stack allocation, but due limitations on some system (Linux with
+ O_DIRECT) it aligns the buffer to pagesize. A possible optimization
+ would be querying if the syscall would impose any alignment constraint,
+ but 1. it is system specific (not meant in generic implementation), and
+ 2. it would make the implementation more complex, and 3. it will require
+ another syscall (fcntl). */
+ void *buffer = __mmap (NULL, bytes, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (__glibc_unlikely (buffer == MAP_FAILED))
+ return -1;
+
+ ssize_t bytes_read = PREAD (fd, buffer, bytes, offset);
+ if (bytes_read < 0)
+ goto end;
+
+ /* Copy the data from BUFFER into the memory specified by VECTOR. */
+ bytes = bytes_read;
+ void *buf = buffer;
+ for (int i = 0; i < count; ++i)
+ {
+ size_t copy = MIN (vector[i].iov_len, bytes);
+
+ memcpy (vector[i].iov_base, buf, copy);
+
+ buf += copy;
+ bytes -= copy;
+ if (bytes == 0)
+ break;
+ }
+
+end:
+ __munmap (buffer, bytes);
+ return bytes_read;
+}
diff --git a/sysdeps/posix/profil.c b/sysdeps/posix/profil.c
index 23e601c6c2..ae0a663533 100644
--- a/sysdeps/posix/profil.c
+++ b/sysdeps/posix/profil.c
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Mostly POSIX.1 version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,7 @@
#include <signal.h>
#include <sys/time.h>
#include <libc-internal.h>
+#include <sigsetops.h>
#ifndef SIGPROF
diff --git a/sysdeps/posix/pwrite.c b/sysdeps/posix/pwrite.c
index c3aa7c084a..0455a806d0 100644
--- a/sysdeps/posix/pwrite.c
+++ b/sysdeps/posix/pwrite.c
@@ -1,6 +1,6 @@
/* Write block to given position in file without changing file pointer.
POSIX version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/posix/pwrite64.c b/sysdeps/posix/pwrite64.c
index 721c733c3f..38c1903958 100644
--- a/sysdeps/posix/pwrite64.c
+++ b/sysdeps/posix/pwrite64.c
@@ -1,6 +1,6 @@
/* Write block to given position in file without changing file pointer.
POSIX version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/posix/pwritev.c b/sysdeps/posix/pwritev.c
index 8c483f1b47..3a8b1b2081 100644
--- a/sysdeps/posix/pwritev.c
+++ b/sysdeps/posix/pwritev.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Write data into multiple buffers. Generic version.
+ Copyright (C) 2009-2018 Free Software 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,81 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <limits.h>
-#include <stdbool.h>
-#include <sys/param.h>
-#if __WORDSIZE == 64 && !defined PWRITEV
-/* Hide the pwritev64 declaration. */
-# define pwritev64 __redirect_pwritev64
-#endif
-#include <sys/uio.h>
-#include <bits/wordsize.h>
+#include <sys/types.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
-#ifndef PWRITEV
# define PWRITEV pwritev
# define PWRITE __pwrite
# define OFF_T off_t
-#endif
-
-
-static void
-ifree (char **ptrp)
-{
- free (*ptrp);
-}
-
-
-/* Write data pointed by the buffers described by IOVEC, which is a
- vector of COUNT 'struct iovec's, to file descriptor FD at the given
- position OFFSET without change the file pointer. The data is
- written in the order specified. Operates just like 'write' (see
- <unistd.h>) except that the data are taken from IOVEC instead of a
- contiguous buffer. */
-ssize_t
-PWRITEV (int fd, const struct iovec *vector, int count, OFF_T offset)
-{
- /* Find the total number of bytes to be read. */
- size_t bytes = 0;
- for (int i = 0; i < count; ++i)
- {
- /* Check for ssize_t overflow. */
- if (SSIZE_MAX - bytes < vector[i].iov_len)
- {
- __set_errno (EINVAL);
- return -1;
- }
- bytes += vector[i].iov_len;
- }
-
- /* Allocate a temporary buffer to hold the data. We should normally
- use alloca since it's faster and does not require synchronization
- with other threads. But we cannot if the amount of memory
- required is too large. */
- char *buffer;
- char *malloced_buffer __attribute__ ((__cleanup__ (ifree))) = NULL;
- if (__libc_use_alloca (bytes))
- buffer = (char *) __alloca (bytes);
- else
- {
- malloced_buffer = buffer = (char *) malloc (bytes);
- if (buffer == NULL)
- return -1;
- }
+# include <sysdeps/posix/pwritev_common.c>
- /* Copy the data from BUFFER into the memory specified by VECTOR. */
- char *ptr = buffer;
- for (int i = 0; i < count; ++i)
- ptr = __mempcpy ((void *) ptr, (void *) vector[i].iov_base,
- vector[i].iov_len);
+libc_hidden_def (pwritev)
- /* Write the data. */
- return PWRITE (fd, buffer, bytes, offset);
-}
-#if __WORDSIZE == 64 && defined pwritev64
-# undef pwritev64
-strong_alias (pwritev, pwritev64)
#endif
diff --git a/sysdeps/posix/pwritev2.c b/sysdeps/posix/pwritev2.c
new file mode 100644
index 0000000000..a39304d9d9
--- /dev/null
+++ b/sysdeps/posix/pwritev2.c
@@ -0,0 +1,42 @@
+/* Generic version of pwritev2.
+ Copyright (C) 2017-2018 Free Software 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 <unistd.h>
+#include <sys/uio.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+/* Since we define no flags for pwritev2 just route to pwritev. */
+ssize_t
+pwritev2 (int fd, const struct iovec *vector, int count, off_t offset,
+ int flags)
+{
+ if (flags != 0)
+ {
+ __set_errno (ENOTSUP);
+ return -1;
+ }
+
+ if (offset == -1)
+ return __writev (fd, vector, count);
+ else
+ return pwritev (fd, vector, count, offset);
+}
+
+#endif
diff --git a/sysdeps/posix/pwritev64.c b/sysdeps/posix/pwritev64.c
index 4948d2efee..f16b1c1b8e 100644
--- a/sysdeps/posix/pwritev64.c
+++ b/sysdeps/posix/pwritev64.c
@@ -1,9 +1,28 @@
-#include <bits/wordsize.h>
+/* Write data into multiple buffers. Generic LFS version.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#if __WORDSIZE == 32
-# define PWRITEV pwritev64
-# define PWRITE __pwrite64
-# define OFF_T off64_t
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-# include "pwritev.c"
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 PWRITEV pwritev64
+#define PWRITE __pwrite64
+#define OFF_T off64_t
+#include <sysdeps/posix/pwritev_common.c>
+
+libc_hidden_def (pwritev64)
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (pwritev64, pwritev)
+libc_hidden_def (pwritev)
#endif
diff --git a/sysdeps/posix/pwritev64v2.c b/sysdeps/posix/pwritev64v2.c
new file mode 100644
index 0000000000..7a3a3239d7
--- /dev/null
+++ b/sysdeps/posix/pwritev64v2.c
@@ -0,0 +1,42 @@
+/* Generic version of pwritev2.
+ Copyright (C) 2017-2018 Free Software 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 <unistd.h>
+#include <sys/uio.h>
+
+/* Since we define no flags for pwritev2 just route to pwritev. */
+ssize_t
+pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
+ int flags)
+{
+ if (flags != 0)
+ {
+ __set_errno (ENOTSUP);
+ return -1;
+ }
+
+ if (offset == -1)
+ return __writev (fd, vector, count);
+ else
+ return pwritev64 (fd, vector, count, offset);
+}
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (pwritev64v2, pwritev2)
+#endif
diff --git a/sysdeps/posix/pwritev_common.c b/sysdeps/posix/pwritev_common.c
new file mode 100644
index 0000000000..344ab4d61b
--- /dev/null
+++ b/sysdeps/posix/pwritev_common.c
@@ -0,0 +1,74 @@
+/* Write data into multiple buffers. Base implementation for pwritev
+ and pwritev64.
+ Copyright (C) 2017-2018 Free Software 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 <sys/uio.h>
+#include <sys/param.h>
+#include <errno.h>
+#include <malloc.h>
+
+#include <ldsodefs.h>
+#include <libc-pointer-arith.h>
+
+/* Write data pointed by the buffers described by IOVEC, which is a
+ vector of COUNT 'struct iovec's, to file descriptor FD at the given
+ position OFFSET without change the file pointer. The data is
+ written in the order specified. Operates just like 'write' (see
+ <unistd.h>) except that the data are taken from IOVEC instead of a
+ contiguous buffer. */
+ssize_t
+PWRITEV (int fd, const struct iovec *vector, int count, OFF_T offset)
+{
+ /* Find the total number of bytes to be read. */
+ size_t bytes = 0;
+ for (int i = 0; i < count; ++i)
+ {
+ /* Check for ssize_t overflow. */
+ if (SSIZE_MAX - bytes < vector[i].iov_len)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+ bytes += vector[i].iov_len;
+ }
+
+ /* Allocate a temporary buffer to hold the data. It could be done with a
+ stack allocation, but due limitations on some system (Linux with
+ O_DIRECT) it aligns the buffer to pagesize. A possible optimization
+ would be querying if the syscall would impose any alignment constraint,
+ but 1. it is system specific (not meant in generic implementation), and
+ 2. it would make the implementation more complex, and 3. it will require
+ another syscall (fcntl). */
+ void *buffer = __mmap (NULL, bytes, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (__glibc_unlikely (buffer == MAP_FAILED))
+ return -1;
+
+ /* Copy the data from BUFFER into the memory specified by VECTOR. */
+ char *ptr = buffer;
+ for (int i = 0; i < count; ++i)
+ ptr = __mempcpy ((void *) ptr, (void *) vector[i].iov_base,
+ vector[i].iov_len);
+
+ ssize_t ret = PWRITE (fd, buffer, bytes, offset);
+
+ __munmap (buffer, bytes);
+
+ return ret;
+}
diff --git a/sysdeps/posix/raise.c b/sysdeps/posix/raise.c
index d438fcb87e..1f02b201e1 100644
--- a/sysdeps/posix/raise.c
+++ b/sysdeps/posix/raise.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/readdir.c b/sysdeps/posix/readdir.c
index e1e63f6157..a6ecc0fe5b 100644
--- a/sysdeps/posix/readdir.c
+++ b/sysdeps/posix/readdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -120,3 +120,8 @@ __READDIR (DIR *dirp)
#ifdef __READDIR_ALIAS
weak_alias (__readdir, readdir)
#endif
+
+#undef __READDIR
+#undef __GETDENTS
+#undef DIRENT_TYPE
+#undef __READDIR_ALIAS
diff --git a/sysdeps/posix/readdir_r.c b/sysdeps/posix/readdir_r.c
index 4c7b3701fe..2d691e7242 100644
--- a/sysdeps/posix/readdir_r.c
+++ b/sysdeps/posix/readdir_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -152,3 +152,8 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
#ifdef __READDIR_R_ALIAS
weak_alias (__readdir_r, readdir_r)
#endif
+
+#undef __READDIR_R
+#undef __GETDENTS
+#undef DIRENT_TYPE
+#undef __READDIR_R_ALIAS
diff --git a/sysdeps/posix/readv.c b/sysdeps/posix/readv.c
index 17a864d2fa..4fe6218454 100644
--- a/sysdeps/posix/readv.c
+++ b/sysdeps/posix/readv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -88,4 +88,5 @@ __readv (int fd, const struct iovec *vector, int count)
return bytes_read;
}
+libc_hidden_def (__readv)
weak_alias (__readv, readv)
diff --git a/sysdeps/posix/remove.c b/sysdeps/posix/remove.c
index 8d331fa171..1ddf9ebc1b 100644
--- a/sysdeps/posix/remove.c
+++ b/sysdeps/posix/remove.c
@@ -1,5 +1,5 @@
/* ANSI C `remove' function to delete a file or directory. POSIX.1 version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/rename.c b/sysdeps/posix/rename.c
index df34f0949d..15c7f56e65 100644
--- a/sysdeps/posix/rename.c
+++ b/sysdeps/posix/rename.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/rewinddir.c b/sysdeps/posix/rewinddir.c
index 1fa4c94a04..5c5d8f1514 100644
--- a/sysdeps/posix/rewinddir.c
+++ b/sysdeps/posix/rewinddir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/seekdir.c b/sysdeps/posix/seekdir.c
index 5e774a16e8..bcf2405e16 100644
--- a/sysdeps/posix/seekdir.c
+++ b/sysdeps/posix/seekdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/shm-directory.c b/sysdeps/posix/shm-directory.c
index 953085b7ce..4e2285ff24 100644
--- a/sysdeps/posix/shm-directory.c
+++ b/sysdeps/posix/shm-directory.c
@@ -1,5 +1,5 @@
/* Determine directory for shm/sem files. Generic POSIX version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/shm-directory.h b/sysdeps/posix/shm-directory.h
index 76c528d8be..55ded84efa 100644
--- a/sysdeps/posix/shm-directory.h
+++ b/sysdeps/posix/shm-directory.h
@@ -1,5 +1,5 @@
/* Header for directory for shm/sem files.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/shm_open.c b/sysdeps/posix/shm_open.c
index f2961620b4..b9b473ceed 100644
--- a/sysdeps/posix/shm_open.c
+++ b/sysdeps/posix/shm_open.c
@@ -1,5 +1,5 @@
/* shm_open -- open a POSIX shared memory object. Generic POSIX file version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,7 @@
#else
# include <fcntl.h>
+# include <pthread.h>
# include <shm-directory.h>
@@ -34,12 +35,12 @@ shm_open (const char *name, int oflag, mode_t mode)
{
SHM_GET_NAME (EINVAL, -1, "");
-# ifdef O_NOFOLLOW
- oflag |= O_NOFOLLOW;
-# endif
-# ifdef O_CLOEXEC
- oflag |= O_CLOEXEC;
-# endif
+ oflag |= O_NOFOLLOW | O_CLOEXEC;
+
+ /* 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
@@ -47,28 +48,7 @@ shm_open (const char *name, int oflag, mode_t mode)
object names and the standard does not mention EISDIR. */
__set_errno (EINVAL);
-# ifndef O_CLOEXEC
- if (fd != -1)
- {
- /* We got a descriptor. Now set the FD_CLOEXEC bit. */
- int flags = fcntl (fd, F_GETFD, 0);
-
- if (__glibc_likely (flags != -1))
- {
- flags |= FD_CLOEXEC;
- flags = fcntl (fd, F_SETFD, flags);
- }
-
- if (flags == -1)
- {
- /* Something went wrong. We cannot return the descriptor. */
- int save_errno = errno;
- close (fd);
- fd = -1;
- __set_errno (save_errno);
- }
- }
-# endif
+ pthread_setcancelstate (state, NULL);
return fd;
}
diff --git a/sysdeps/posix/shm_unlink.c b/sysdeps/posix/shm_unlink.c
index ae742d3fcb..de8466f4c1 100644
--- a/sysdeps/posix/shm_unlink.c
+++ b/sysdeps/posix/shm_unlink.c
@@ -1,5 +1,5 @@
/* shm_unlink -- remove a POSIX shared memory object. Generic POSIX version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/sigblock.c b/sysdeps/posix/sigblock.c
index c28b819376..9d8f4db47d 100644
--- a/sysdeps/posix/sigblock.c
+++ b/sysdeps/posix/sigblock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,4 +35,5 @@ __sigblock (int mask)
return sigset_get_old_mask (&oset);
}
+libc_hidden_def (__sigblock)
weak_alias (__sigblock, sigblock)
diff --git a/sysdeps/posix/sigignore.c b/sysdeps/posix/sigignore.c
index 28d3eeb706..120d06cef1 100644
--- a/sysdeps/posix/sigignore.c
+++ b/sysdeps/posix/sigignore.c
@@ -1,5 +1,5 @@
/* Set the disposition of SIG to SIG_IGN.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -22,7 +22,7 @@
#include <stddef.h>
#include <signal.h>
#include <string.h> /* For the real memset prototype. */
-
+#include <sigsetops.h>
int
sigignore (int sig)
@@ -30,8 +30,7 @@ sigignore (int sig)
struct sigaction act;
act.sa_handler = SIG_IGN;
- if (__sigemptyset (&act.sa_mask) < 0)
- return -1;
+ __sigemptyset (&act.sa_mask);
act.sa_flags = 0;
return __sigaction (sig, &act, NULL);
diff --git a/sysdeps/posix/sigintr.c b/sysdeps/posix/sigintr.c
index bce75b7cf9..435fc75f3e 100644
--- a/sysdeps/posix/sigintr.c
+++ b/sysdeps/posix/sigintr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <stddef.h>
#include <signal.h>
#include <errno.h>
+#include <sigsetops.h>
/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
(causing them to fail with EINTR); if INTERRUPT is zero, make system
diff --git a/sysdeps/posix/signal.c b/sysdeps/posix/signal.c
index 6884fc742d..8a135c7b0e 100644
--- a/sysdeps/posix/signal.c
+++ b/sysdeps/posix/signal.c
@@ -1,5 +1,5 @@
/* BSD-like signal function.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,8 +18,8 @@
#include <errno.h>
#include <signal.h>
-#include <string.h> /* For the real memset prototype. */
-
+#include <sigsetops.h>
+#include <internal-signals.h>
sigset_t _sigintr attribute_hidden; /* Set by siginterrupt. */
@@ -31,16 +31,16 @@ __bsd_signal (int sig, __sighandler_t handler)
struct sigaction act, oact;
/* Check signal extents to protect __sigismember. */
- if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
+ if (handler == SIG_ERR || sig < 1 || sig >= NSIG
+ || __is_internal_signal (sig))
{
__set_errno (EINVAL);
return SIG_ERR;
}
act.sa_handler = handler;
- if (__sigemptyset (&act.sa_mask) < 0
- || __sigaddset (&act.sa_mask, sig) < 0)
- return SIG_ERR;
+ __sigemptyset (&act.sa_mask);
+ __sigaddset (&act.sa_mask, sig);
act.sa_flags = __sigismember (&_sigintr, sig) ? 0 : SA_RESTART;
if (__sigaction (sig, &act, &oact) < 0)
return SIG_ERR;
diff --git a/sysdeps/posix/sigpause.c b/sysdeps/posix/sigpause.c
index bbe8bde324..db9df8eb6e 100644
--- a/sysdeps/posix/sigpause.c
+++ b/sysdeps/posix/sigpause.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,13 @@
#include <errno.h>
#include <signal.h>
#include <stddef.h> /* For NULL. */
-#include <sysdep-cancel.h>
#undef sigpause
#include <sigset-cvt-mask.h>
+#include <sysdep-cancel.h>
-/* Set the mask of blocked signals to MASK,
- wait for a signal to arrive, and then restore the mask. */
-static int
-do_sigpause (int sig_or_mask, int is_sig)
+int
+__sigpause (int sig_or_mask, int is_sig)
{
sigset_t set;
@@ -46,21 +44,6 @@ do_sigpause (int sig_or_mask, int is_sig)
to do anything here. */
return __sigsuspend (&set);
}
-
-int
-__sigpause (int sig_or_mask, int is_sig)
-{
- if (SINGLE_THREAD_P)
- return do_sigpause (sig_or_mask, is_sig);
-
- int oldtype = LIBC_CANCEL_ASYNC ();
-
- int result = do_sigpause (sig_or_mask, is_sig);
-
- LIBC_CANCEL_RESET (oldtype);
-
- return result;
-}
libc_hidden_def (__sigpause)
/* We have to provide a default version of this function since the
@@ -87,3 +70,6 @@ __xpg_sigpause (int sig)
return __sigpause (sig, 1);
}
strong_alias (__xpg_sigpause, __libc___xpg_sigpause)
+
+/* __sigsuspend handles cancellation. */
+LIBC_CANCEL_HANDLED ();
diff --git a/sysdeps/posix/sigset.c b/sysdeps/posix/sigset.c
index 765fe637f1..6ab4a48767 100644
--- a/sysdeps/posix/sigset.c
+++ b/sysdeps/posix/sigset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -8,7 +8,7 @@
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
@@ -20,7 +20,7 @@
#include <stddef.h>
#include <signal.h>
#include <string.h> /* For the real memset prototype. */
-
+#include <sigsetops.h>
/* Set the disposition for SIG. */
__sighandler_t
@@ -31,19 +31,13 @@ sigset (int sig, __sighandler_t disp)
sigset_t set;
sigset_t oset;
-#ifdef SIG_HOLD
- /* Handle SIG_HOLD first. */
+ __sigemptyset (&set);
+ if (sigaddset (&set, sig) < 0)
+ return SIG_ERR;
+
if (disp == SIG_HOLD)
{
- /* Create an empty signal set. */
- if (__sigemptyset (&set) < 0)
- return SIG_ERR;
-
- /* Add the specified signal. */
- if (__sigaddset (&set, sig) < 0)
- return SIG_ERR;
-
- /* Add the signal set to the current signal mask. */
+ /* Add the signal to the current signal mask. */
if (__sigprocmask (SIG_BLOCK, &set, &oset) < 0)
return SIG_ERR;
@@ -57,34 +51,19 @@ sigset (int sig, __sighandler_t disp)
return oact.sa_handler;
}
-#endif /* SIG_HOLD */
-
- /* Check signal extents to protect __sigismember. */
- if (disp == SIG_ERR || sig < 1 || sig >= NSIG)
+ else
{
- __set_errno (EINVAL);
- return SIG_ERR;
- }
-
- act.sa_handler = disp;
- if (__sigemptyset (&act.sa_mask) < 0)
- return SIG_ERR;
- act.sa_flags = 0;
- if (__sigaction (sig, &act, &oact) < 0)
- return SIG_ERR;
-
- /* Create an empty signal set. */
- if (__sigemptyset (&set) < 0)
- return SIG_ERR;
-
- /* Add the specified signal. */
- if (__sigaddset (&set, sig) < 0)
- return SIG_ERR;
+ act.sa_handler = disp;
+ __sigemptyset (&act.sa_mask);
+ act.sa_flags = 0;
+ if (__sigaction (sig, &act, &oact) < 0)
+ return SIG_ERR;
- /* Remove the signal set from the current signal mask. */
- if (__sigprocmask (SIG_UNBLOCK, &set, &oset) < 0)
- return SIG_ERR;
+ /* Remove the signal from the current signal mask. */
+ if (__sigprocmask (SIG_UNBLOCK, &set, &oset) < 0)
+ return SIG_ERR;
- /* If the signal was already blocked return SIG_HOLD. */
- return __sigismember (&oset, sig) ? SIG_HOLD : oact.sa_handler;
+ /* If the signal was already blocked return SIG_HOLD. */
+ return __sigismember (&oset, sig) ? SIG_HOLD : oact.sa_handler;
+ }
}
diff --git a/sysdeps/posix/sigsetmask.c b/sysdeps/posix/sigsetmask.c
index bb16262ece..9895848937 100644
--- a/sysdeps/posix/sigsetmask.c
+++ b/sysdeps/posix/sigsetmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/sigsuspend.c b/sysdeps/posix/sigsuspend.c
index 090edc208c..50953fc818 100644
--- a/sysdeps/posix/sigsuspend.c
+++ b/sysdeps/posix/sigsuspend.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/sigwait.c b/sysdeps/posix/sigwait.c
index b9b328176d..4ff9d847d4 100644
--- a/sysdeps/posix/sigwait.c
+++ b/sysdeps/posix/sigwait.c
@@ -1,5 +1,5 @@
/* Implementation of sigwait function from POSIX.1c.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/sysdeps/posix/sleep.c b/sysdeps/posix/sleep.c
index f15028bd1a..7de748fe44 100644
--- a/sysdeps/posix/sleep.c
+++ b/sysdeps/posix/sleep.c
@@ -1,5 +1,5 @@
/* Sleep for a given number of seconds. POSIX.1 version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/spawni.c b/sysdeps/posix/spawni.c
index 043266dcd3..b138ab4393 100644
--- a/sysdeps/posix/spawni.c
+++ b/sysdeps/posix/spawni.c
@@ -1,5 +1,5 @@
/* Guts of POSIX spawn interface. Generic POSIX.1 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software 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,20 +16,23 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
+#include <spawn.h>
+#include <assert.h>
#include <fcntl.h>
#include <paths.h>
-#include <spawn.h>
-#include <stdbool.h>
-#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
-#include <signal.h>
#include <sys/resource.h>
-#include "spawn_int.h"
+#include <sys/wait.h>
+#include <sys/param.h>
+#include <sys/mman.h>
#include <not-cancel.h>
#include <local-setxid.h>
#include <shlib-compat.h>
+#include <nptl/pthreadP.h>
+#include <dl-sysdep.h>
+#include <libc-pointer-arith.h>
+#include <ldsodefs.h>
+#include "spawn_int.h"
/* The Unix standard contains a long explanation of the way to signal
@@ -39,93 +42,59 @@
normal program exit with the exit code 127. */
#define SPAWN_ERROR 127
-
-/* The file is accessible but it is not an executable file. Invoke
- the shell to interpret it as a script. */
-static void
-internal_function
-script_execute (const char *file, char *const argv[], char *const envp[])
+struct posix_spawn_args
{
- /* Count the arguments. */
- int argc = 0;
- while (argv[argc++])
- ;
-
- /* Construct an argument list for the shell. */
- {
- char *new_argv[argc + 1];
- new_argv[0] = (char *) _PATH_BSHELL;
- new_argv[1] = (char *) file;
- while (argc > 1)
- {
- new_argv[argc] = argv[argc - 1];
- --argc;
- }
-
- /* Execute the shell. */
- __execve (new_argv[0], new_argv, envp);
- }
-}
-
-static inline void
-maybe_script_execute (const char *file, char *const argv[], char *const envp[],
- int xflags)
+ sigset_t oldmask;
+ const char *file;
+ int (*exec) (const char *, char *const *, char *const *);
+ const posix_spawn_file_actions_t *fa;
+ const posix_spawnattr_t *restrict attr;
+ char *const *argv;
+ ptrdiff_t argc;
+ char *const *envp;
+ int xflags;
+ int pipe[2];
+};
+
+/* Older version requires that shell script without shebang definition
+ to be called explicitly using /bin/sh (_PATH_BSHELL). */
+static void
+maybe_script_execute (struct posix_spawn_args *args)
{
if (SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_15)
- && (xflags & SPAWN_XFLAGS_TRY_SHELL)
- && errno == ENOEXEC)
- script_execute (file, argv, envp);
-}
-
-/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
- Before running the process perform the actions described in FILE-ACTIONS. */
-int
-__spawni (pid_t *pid, const char *file,
- const posix_spawn_file_actions_t *file_actions,
- const posix_spawnattr_t *attrp, char *const argv[],
- char *const envp[], int xflags)
-{
- pid_t new_pid;
- char *path, *p, *name;
- size_t len;
- size_t pathlen;
-
- /* Do this once. */
- short int flags = attrp == NULL ? 0 : attrp->__flags;
-
- /* Generate the new process. */
- if ((flags & POSIX_SPAWN_USEVFORK) != 0
- /* If no major work is done, allow using vfork. Note that we
- might perform the path searching. But this would be done by
- a call to execvp(), too, and such a call must be OK according
- to POSIX. */
- || ((flags & (POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF
- | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER
- | POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_RESETIDS)) == 0
- && file_actions == NULL))
- new_pid = __vfork ();
- else
- new_pid = __fork ();
-
- if (new_pid != 0)
+ && (args->xflags & SPAWN_XFLAGS_TRY_SHELL) && errno == ENOEXEC)
{
- if (new_pid < 0)
- return errno;
-
- /* The call was successful. Store the PID if necessary. */
- if (pid != NULL)
- *pid = new_pid;
+ char *const *argv = args->argv;
+ ptrdiff_t argc = args->argc;
+
+ /* Construct an argument list for the shell. */
+ char *new_argv[argc + 1];
+ new_argv[0] = (char *) _PATH_BSHELL;
+ new_argv[1] = (char *) args->file;
+ if (argc > 1)
+ memcpy (new_argv + 2, argv + 1, argc * sizeof(char *));
+ else
+ new_argv[2] = NULL;
- return 0;
+ /* Execute the shell. */
+ args->exec (new_argv[0], new_argv, args->envp);
}
+}
- /* Set signal mask. */
- if ((flags & POSIX_SPAWN_SETSIGMASK) != 0
- && __sigprocmask (SIG_SETMASK, &attrp->__ss, NULL) != 0)
- _exit (SPAWN_ERROR);
+/* Function used in the clone call to setup the signals mask, posix_spawn
+ attributes, and file actions. */
+static int
+__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 ret;
+
+ __close (args->pipe[0]);
/* Set signal default action. */
- if ((flags & POSIX_SPAWN_SETSIGDEF) != 0)
+ if ((attr->__flags & POSIX_SPAWN_SETSIGDEF) != 0)
{
/* We have to iterate over all signals. This could possibly be
done better but it requires system specific solutions since
@@ -138,37 +107,41 @@ __spawni (pid_t *pid, const char *file,
sa.sa_handler = SIG_DFL;
for (sig = 1; sig <= _NSIG; ++sig)
- if (__sigismember (&attrp->__sd, sig) != 0
+ if (__sigismember (&attr->__sd, sig) != 0
&& __sigaction (sig, &sa, NULL) != 0)
- _exit (SPAWN_ERROR);
-
+ goto fail;
}
#ifdef _POSIX_PRIORITY_SCHEDULING
/* Set the scheduling algorithm and parameters. */
- if ((flags & (POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER))
+ if ((attr->__flags & (POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER))
== POSIX_SPAWN_SETSCHEDPARAM)
{
- if (__sched_setparam (0, &attrp->__sp) == -1)
- _exit (SPAWN_ERROR);
+ if (__sched_setparam (0, &attr->__sp) == -1)
+ goto fail;
}
- else if ((flags & POSIX_SPAWN_SETSCHEDULER) != 0)
+ else if ((attr->__flags & POSIX_SPAWN_SETSCHEDULER) != 0)
{
- if (__sched_setscheduler (0, attrp->__policy, &attrp->__sp) == -1)
- _exit (SPAWN_ERROR);
+ if (__sched_setscheduler (0, attr->__policy, &attr->__sp) == -1)
+ goto fail;
}
#endif
+ /* Set the process session ID. */
+ if ((attr->__flags & POSIX_SPAWN_SETSID) != 0
+ && __setsid () < 0)
+ goto fail;
+
/* Set the process group ID. */
- if ((flags & POSIX_SPAWN_SETPGROUP) != 0
- && __setpgid (0, attrp->__pgrp) != 0)
- _exit (SPAWN_ERROR);
+ if ((attr->__flags & POSIX_SPAWN_SETPGROUP) != 0
+ && __setpgid (0, attr->__pgrp) != 0)
+ goto fail;
/* Set the effective user and group IDs. */
- if ((flags & POSIX_SPAWN_RESETIDS) != 0
+ if ((attr->__flags & POSIX_SPAWN_RESETIDS) != 0
&& (local_seteuid (__getuid ()) != 0
- || local_setegid (__getgid ()) != 0))
- _exit (SPAWN_ERROR);
+ || local_setegid (__getgid ())) != 0)
+ goto fail;
/* Execute the file actions. */
if (file_actions != NULL)
@@ -184,9 +157,9 @@ __spawni (pid_t *pid, const char *file,
switch (action->tag)
{
case spawn_do_close:
- if (close_not_cancel (action->action.close_action.fd) != 0)
+ if (__close_nocancel (action->action.close_action.fd) != 0)
{
- if (! have_fdlimit)
+ if (have_fdlimit == 0)
{
__getrlimit64 (RLIMIT_NOFILE, &fdlimit);
have_fdlimit = true;
@@ -195,33 +168,37 @@ __spawni (pid_t *pid, const char *file,
/* Only signal errors for file descriptors out of range. */
if (action->action.close_action.fd < 0
|| action->action.close_action.fd >= fdlimit.rlim_cur)
- /* Signal the error. */
- _exit (SPAWN_ERROR);
+ goto fail;
}
break;
case spawn_do_open:
{
- int new_fd = open_not_cancel (action->action.open_action.path,
+ /* 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_nocancel (action->action.open_action.fd);
+
+ int new_fd = __open_nocancel (action->action.open_action.path,
action->action.open_action.oflag
| O_LARGEFILE,
action->action.open_action.mode);
if (new_fd == -1)
- /* The `open' call failed. */
- _exit (SPAWN_ERROR);
+ goto fail;
/* Make sure the desired file descriptor is used. */
if (new_fd != action->action.open_action.fd)
{
if (__dup2 (new_fd, action->action.open_action.fd)
!= action->action.open_action.fd)
- /* The `dup2' call failed. */
- _exit (SPAWN_ERROR);
+ goto fail;
- if (close_not_cancel (new_fd) != 0)
- /* The `close' call failed. */
- _exit (SPAWN_ERROR);
+ if (__close_nocancel (new_fd) != 0)
+ goto fail;
}
}
break;
@@ -230,85 +207,111 @@ __spawni (pid_t *pid, const char *file,
if (__dup2 (action->action.dup2_action.fd,
action->action.dup2_action.newfd)
!= action->action.dup2_action.newfd)
- /* The `dup2' call failed. */
- _exit (SPAWN_ERROR);
+ goto fail;
break;
}
}
}
- if ((xflags & SPAWN_XFLAGS_USE_PATH) == 0 || strchr (file, '/') != NULL)
- {
- /* The FILE parameter is actually a path. */
- __execve (file, argv, envp);
+ /* Set the initial signal mask of the child if POSIX_SPAWN_SETSIGMASK
+ is set, otherwise restore the previous one. */
+ __sigprocmask (SIG_SETMASK, (attr->__flags & POSIX_SPAWN_SETSIGMASK)
+ ? &attr->__ss : &args->oldmask, 0);
+
+ args->exec (args->file, args->argv, args->envp);
+
+ /* This is compatibility function required to enable posix_spawn run
+ script without shebang definition for older posix_spawn versions
+ (2.15). */
+ maybe_script_execute (args);
+
+fail:
+ /* 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. */
+ ret = errno ? : ECHILD;
+ if (ret)
+ /* Since sizeof errno < PIPE_BUF, the write is atomic. */
+ while (__write_nocancel (args->pipe[1], &ret, sizeof (ret)) < 0);
- maybe_script_execute (file, argv, envp, xflags);
+ _exit (SPAWN_ERROR);
+}
- /* Oh, oh. `execve' returns. This is bad. */
- _exit (SPAWN_ERROR);
- }
+/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
+ Before running the process perform the actions described in FILE-ACTIONS. */
+int
+__spawnix (pid_t *pid, const char *file,
+ const posix_spawn_file_actions_t *file_actions,
+ const posix_spawnattr_t *attrp, char *const argv[],
+ char *const envp[], int xflags,
+ int (*exec) (const char *, char *const *, char *const *))
+{
+ struct posix_spawn_args args;
+ int ec;
- /* We have to search for FILE on the path. */
- path = getenv ("PATH");
- if (path == NULL)
- {
- /* There is no `PATH' in the environment.
- The default search path is the current directory
- followed by the path `confstr' returns for `_CS_PATH'. */
- len = confstr (_CS_PATH, (char *) NULL, 0);
- path = (char *) __alloca (1 + len);
- path[0] = ':';
- (void) confstr (_CS_PATH, path + 1, len);
- }
+ if (__pipe2 (args.pipe, O_CLOEXEC))
+ return errno;
- len = strlen (file) + 1;
- pathlen = strlen (path);
- name = __alloca (pathlen + len + 1);
- /* Copy the file name at the top. */
- name = (char *) memcpy (name + pathlen + 1, file, len);
- /* And add the slash. */
- *--name = '/';
+ /* Disable asynchronous cancellation. */
+ int state;
+ __libc_ptf_call (__pthread_setcancelstate,
+ (PTHREAD_CANCEL_DISABLE, &state), 0);
- p = path;
- do
- {
- char *startp;
+ ptrdiff_t argc = 0;
+ ptrdiff_t limit = INT_MAX - 1;
+ while (argv[argc++] != NULL)
+ if (argc == limit)
+ {
+ errno = E2BIG;
+ return errno;
+ }
- path = p;
- p = __strchrnul (path, ':');
+ args.file = file;
+ args.exec = exec;
+ args.fa = file_actions;
+ args.attr = attrp ? attrp : &(const posix_spawnattr_t) { 0 };
+ args.argv = argv;
+ args.argc = argc;
+ args.envp = envp;
+ args.xflags = xflags;
- if (p == path)
- /* Two adjacent colons, or a colon at the beginning or the end
- of `PATH' means to search the current directory. */
- startp = name + 1;
+ /* Generate the new process. */
+ pid_t new_pid = __fork ();
+
+ if (new_pid == 0)
+ __spawni_child (&args);
+ else if (new_pid > 0)
+ {
+ __close (args.pipe[1]);
+
+ if (__read (args.pipe[0], &ec, sizeof ec) != sizeof ec)
+ ec = 0;
else
- startp = (char *) memcpy (name - (p - path), path, p - path);
+ __waitpid (new_pid, &(int) { 0 }, 0);
+ }
+ else
+ ec = errno;
- /* Try to execute this name. If it works, execv will not return. */
- __execve (startp, argv, envp);
+ __close (args.pipe[0]);
- maybe_script_execute (startp, argv, envp, xflags);
+ if ((ec == 0) && (pid != NULL))
+ *pid = new_pid;
- switch (errno)
- {
- case EACCES:
- case ENOENT:
- case ESTALE:
- case ENOTDIR:
- /* Those errors indicate the file is missing or not executable
- by us, in which case we want to just try the next path
- directory. */
- break;
-
- default:
- /* Some other error means we found an executable file, but
- something went wrong executing it; return the error to our
- caller. */
- _exit (SPAWN_ERROR);
- }
- }
- while (*p++ != '\0');
+ __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
- /* Return with an error. */
- _exit (SPAWN_ERROR);
+ return ec;
+}
+
+int
+__spawni (pid_t * pid, const char *file,
+ const posix_spawn_file_actions_t * acts,
+ const posix_spawnattr_t * attrp, char *const argv[],
+ char *const envp[], int xflags)
+{
+ /* It uses __execvpex to avoid run ENOEXEC in non compatibility mode (it
+ will be handled by maybe_script_execute). */
+ return __spawnix (pid, file, acts, attrp, argv, envp, xflags,
+ xflags & SPAWN_XFLAGS_USE_PATH ? __execvpex : __execve);
}
diff --git a/sysdeps/posix/sprofil.c b/sysdeps/posix/sprofil.c
index b46721a7ce..d9d639aaad 100644
--- a/sysdeps/posix/sprofil.c
+++ b/sysdeps/posix/sprofil.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
This file is part of the GNU C Library.
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <sigsetops.h>
#include <sys/time.h>
#include <sys/profil.h>
diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
index 892f76d55c..8b74ad6184 100644
--- a/sysdeps/posix/sysconf.c
+++ b/sysdeps/posix/sysconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,6 +29,7 @@
#include <sys/stat.h>
#include <sys/sysinfo.h>
#include <sys/types.h>
+#include <sys/uio.h>
#include <regex.h>
#define NEED_SPEC_ARRAY 0
@@ -93,7 +94,7 @@ __sysconf (int name)
#endif
case _SC_TZNAME_MAX:
- return MAX (__tzname_max (), _POSIX_TZNAME_MAX);
+ return -1;
case _SC_JOB_CONTROL:
#if CONF_IS_DEFINED_SET (_POSIX_JOB_CONTROL)
diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
index 8ed01aa9fb..d7594436ed 100644
--- a/sysdeps/posix/system.c
+++ b/sysdeps/posix/system.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
#include <sys/wait.h>
#include <libc-lock.h>
#include <sysdep-cancel.h>
+#include <sigsetops.h>
#define SHELL_PATH "/bin/sh" /* Path of the shell. */
diff --git a/sysdeps/posix/sysv_signal.c b/sysdeps/posix/sysv_signal.c
index c70f50d01e..2727ab0ee3 100644
--- a/sysdeps/posix/sysv_signal.c
+++ b/sysdeps/posix/sysv_signal.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <errno.h>
#include <signal.h>
#include <string.h> /* For the real memset prototype. */
-
+#include <sigsetops.h>
/* Tolerate non-threads versions of Posix */
#ifndef SA_ONESHOT
@@ -46,8 +46,7 @@ __sysv_signal (int sig, __sighandler_t handler)
}
act.sa_handler = handler;
- if (__sigemptyset (&act.sa_mask) < 0)
- return SIG_ERR;
+ __sigemptyset (&act.sa_mask);
act.sa_flags = SA_ONESHOT | SA_NOMASK | SA_INTERRUPT;
act.sa_flags &= ~SA_RESTART;
if (__sigaction (sig, &act, &oact) < 0)
diff --git a/sysdeps/posix/telldir.c b/sysdeps/posix/telldir.c
index 85dc58bd8a..8caea582f9 100644
--- a/sysdeps/posix/telldir.c
+++ b/sysdeps/posix/telldir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c
index 93be738e12..432262a03b 100644
--- a/sysdeps/posix/tempname.c
+++ b/sysdeps/posix/tempname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/time.c b/sysdeps/posix/time.c
index 2afe174788..6d0bb4bafc 100644
--- a/sysdeps/posix/time.c
+++ b/sysdeps/posix/time.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/timespec_get.c b/sysdeps/posix/timespec_get.c
index 01346ab1a9..6a40b64b8c 100644
--- a/sysdeps/posix/timespec_get.c
+++ b/sysdeps/posix/timespec_get.c
@@ -1,5 +1,5 @@
/* timespec_get -- C11 interface to sample a clock. Generic POSIX.1 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/truncate.c b/sysdeps/posix/truncate.c
index 82a77b5a9a..388e87734f 100644
--- a/sysdeps/posix/truncate.c
+++ b/sysdeps/posix/truncate.c
@@ -1,5 +1,5 @@
/* Truncate a file given by name. Generic POSIX.1 version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/ttyname.c b/sysdeps/posix/ttyname.c
index 23a250cd9b..3dae5e8411 100644
--- a/sysdeps/posix/ttyname.c
+++ b/sysdeps/posix/ttyname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,13 +28,12 @@
char *__ttyname;
static char *getttyname (int fd, dev_t mydev, ino_t myino,
- int save, int *dostat) internal_function;
+ int save, int *dostat);
libc_freeres_ptr (static char *getttyname_name);
static char *
-internal_function
getttyname (int fd, dev_t mydev, ino_t myino, int save, int *dostat)
{
static const char dev[] = "/dev";
diff --git a/sysdeps/posix/ttyname_r.c b/sysdeps/posix/ttyname_r.c
index 6da98b3510..725de7c4fb 100644
--- a/sysdeps/posix/ttyname_r.c
+++ b/sysdeps/posix/ttyname_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,10 +33,9 @@ static const char dev[] = "/dev";
static int getttyname_r (int fd, char *buf, size_t buflen,
dev_t mydev, ino_t myino, int save,
- int *dostat) __THROW internal_function;
+ int *dostat) __THROW;
static int
-internal_function
getttyname_r (int fd, char *buf, size_t buflen, dev_t mydev, ino_t myino,
int save, int *dostat)
{
diff --git a/sysdeps/posix/ulimit.c b/sysdeps/posix/ulimit.c
index 47c9ff2e41..3a4c64dc90 100644
--- a/sysdeps/posix/ulimit.c
+++ b/sysdeps/posix/ulimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/usleep.c b/sysdeps/posix/usleep.c
index f0e28f2d7a..3a3cd202c9 100644
--- a/sysdeps/posix/usleep.c
+++ b/sysdeps/posix/usleep.c
@@ -1,5 +1,5 @@
/* Implementation of the BSD usleep function using nanosleep.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/sysdeps/posix/utime.c b/sysdeps/posix/utime.c
index c0d2736ae2..63e4898c8d 100644
--- a/sysdeps/posix/utime.c
+++ b/sysdeps/posix/utime.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* utime -- Change access and modification times of file. Posix version.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/utimes.c b/sysdeps/posix/utimes.c
index 4dc2946b18..a76eaf18a0 100644
--- a/sysdeps/posix/utimes.c
+++ b/sysdeps/posix/utimes.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* utimes -- Change access and modification times of file. Posix version.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/posix/wait.c b/sysdeps/posix/wait.c
index 7f1d71a45f..2abcf24ab9 100644
--- a/sysdeps/posix/wait.c
+++ b/sysdeps/posix/wait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
/* Wait for a child to die. When one does, put its status in *STAT_LOC
and return its process ID. For errors, return (pid_t) -1. */
__pid_t
-__libc_wait (__WAIT_STATUS_DEFN stat_loc)
+__libc_wait (int *stat_loc)
{
return __waitpid (WAIT_ANY, (int *) stat_loc, 0);
}
diff --git a/sysdeps/posix/wait3.c b/sysdeps/posix/wait3.c
index 2e76892bff..c3f977d62b 100644
--- a/sysdeps/posix/wait3.c
+++ b/sysdeps/posix/wait3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,14 +26,14 @@
there. If the WUNTRACED bit is set in OPTIONS, return status for stopped
children; otherwise don't. */
pid_t
-__wait3 (__WAIT_STATUS stat_loc, int options, struct rusage *usage)
+__wait3 (int *stat_loc, int options, struct rusage *usage)
{
if (usage != NULL)
{
__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/posix/waitid.c b/sysdeps/posix/waitid.c
index 14bf15e735..3207c742c2 100644
--- a/sysdeps/posix/waitid.c
+++ b/sysdeps/posix/waitid.c
@@ -1,5 +1,5 @@
/* Pseudo implementation of waitid.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1997.
@@ -80,7 +80,7 @@ OUR_WAITID (idtype_t idtype, id_t id, siginfo_t *infop, int options)
#endif
#ifdef WEXITED
|| ((options & (WEXITED|WSTOPPED|WCONTINUED))
- != (WEXITED | (options & WUNTRACED)))
+ != (WEXITED | (options & WSTOPPED)))
#endif
)
{
diff --git a/sysdeps/posix/writev.c b/sysdeps/posix/writev.c
index 99edfdfade..dbabe0d9ca 100644
--- a/sysdeps/posix/writev.c
+++ b/sysdeps/posix/writev.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -88,4 +88,5 @@ __writev (int fd, const struct iovec *vector, int count)
return bytes_written;
}
+libc_hidden_def (__writev)
weak_alias (__writev, writev)
diff --git a/sysdeps/powerpc/Makefile b/sysdeps/powerpc/Makefile
index 099fbf68cd..6aa683b03f 100644
--- a/sysdeps/powerpc/Makefile
+++ b/sysdeps/powerpc/Makefile
@@ -8,10 +8,20 @@ sysdep-dl-routines += dl-machine hwcapinfo
sysdep_routines += dl-machine hwcapinfo
# extra shared linker files to link only into dl-allobjs.so
sysdep-rtld-routines += dl-machine hwcapinfo
-# Don't optimize GD tls sequence to LE.
-LDFLAGS-tst-tlsopt-powerpc += -Wl,--no-tls-optimize
+
+modules-names += mod-tlsopt-powerpc
+mod-tlsopt-powerpc.so-no-z-defs = yes
tests += tst-tlsopt-powerpc
-endif
+$(objpfx)tst-tlsopt-powerpc: $(objpfx)mod-tlsopt-powerpc.so
+
+ifneq (no,$(multi-arch))
+tests-static += tst-tlsifunc-static
+tests-internal += tst-tlsifunc-static
+ifeq (yes,$(build-shared))
+tests-internal += tst-tlsifunc
+endif # build-shared
+endif # multi-arch
+endif # subdir = elf
ifeq ($(subdir),setjmp)
ifeq (yes,$(build-shared))
@@ -27,13 +37,14 @@ gen-as-const-headers += locale-defines.sym
endif
ifeq ($(subdir),nptl)
-tests += test-get_hwcap test-get_hwcap-static
+tests-internal += test-get_hwcap test-get_hwcap-static
tests-static += test-get_hwcap-static
endif
ifeq ($(subdir),misc)
sysdep_headers += sys/platform/ppc.h
tests += test-gettimebase
+tests += tst-set_ppr
endif
ifneq (,$(filter %le,$(config-machine)))
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/atomic-machine.h b/sysdeps/powerpc/atomic-machine.h
index 8b0e1e7284..908380f98f 100644
--- a/sysdeps/powerpc/atomic-machine.h
+++ b/sysdeps/powerpc/atomic-machine.h
@@ -1,5 +1,5 @@
/* Atomic operations. PowerPC Common version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
@@ -53,12 +53,6 @@ typedef uintmax_t uatomic_max_t;
#define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval) \
(abort (), 0)
-#define __arch_compare_and_exchange_bool_8_rel(mem, newval, oldval) \
- (abort (), 0)
-
-#define __arch_compare_and_exchange_bool_16_rel(mem, newval, oldval) \
- (abort (), 0)
-
#ifdef UP
# define __ARCH_ACQ_INSTR ""
# define __ARCH_REL_INSTR ""
diff --git a/sysdeps/powerpc/bits/endian.h b/sysdeps/powerpc/bits/endian.h
index 9adaf0ce5e..5bf6d90247 100644
--- a/sysdeps/powerpc/bits/endian.h
+++ b/sysdeps/powerpc/bits/endian.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/bits/fenv.h b/sysdeps/powerpc/bits/fenv.h
index d2a6d34a99..39a75ebeec 100644
--- a/sysdeps/powerpc/bits/fenv.h
+++ b/sysdeps/powerpc/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/bits/fenvinline.h b/sysdeps/powerpc/bits/fenvinline.h
index 4a7b2af6aa..41316386ba 100644
--- a/sysdeps/powerpc/bits/fenvinline.h
+++ b/sysdeps/powerpc/bits/fenvinline.h
@@ -1,5 +1,5 @@
/* Inline floating-point environment handling functions for powerpc.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,8 +32,10 @@
warning when __excepts is not a constant. Otherwise, they mean the
same as just plain 'i'. */
+# if __GNUC_PREREQ(3, 4)
+
/* Inline definition for feraiseexcept. */
-# define feraiseexcept(__excepts) \
+# define feraiseexcept(__excepts) \
(__extension__ ({ \
int __e = __excepts; \
int __ret; \
@@ -42,8 +44,8 @@
&& __e != FE_INVALID) \
{ \
if (__e != 0) \
- __asm__ __volatile__ ("mtfsb1 %s0" \
- : : "i#*X" (__builtin_ffs (__e))); \
+ __asm__ __volatile__ ("mtfsb1 %0" \
+ : : "i#*X" (__builtin_clz (__e))); \
__ret = 0; \
} \
else \
@@ -52,7 +54,7 @@
}))
/* Inline definition for feclearexcept. */
-# define feclearexcept(__excepts) \
+# define feclearexcept(__excepts) \
(__extension__ ({ \
int __e = __excepts; \
int __ret; \
@@ -61,8 +63,8 @@
&& __e != FE_INVALID) \
{ \
if (__e != 0) \
- __asm__ __volatile__ ("mtfsb0 %s0" \
- : : "i#*X" (__builtin_ffs (__e))); \
+ __asm__ __volatile__ ("mtfsb0 %0" \
+ : : "i#*X" (__builtin_clz (__e))); \
__ret = 0; \
} \
else \
@@ -70,6 +72,8 @@
__ret; \
}))
+# endif /* __GNUC_PREREQ(3, 4). */
+
# endif /* !__NO_MATH_INLINES. */
#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */
diff --git a/sysdeps/powerpc/bits/floatn.h b/sysdeps/powerpc/bits/floatn.h
new file mode 100644
index 0000000000..c6d8b9b9b3
--- /dev/null
+++ b/sysdeps/powerpc/bits/floatn.h
@@ -0,0 +1,122 @@
+/* Macros to control TS 18661-3 glibc features on powerpc.
+ Copyright (C) 2017-2018 Free Software 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 _BITS_FLOATN_H
+#define _BITS_FLOATN_H
+
+#include <features.h>
+#include <bits/long-double.h>
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the IEEE 754 binary128 format, and this glibc
+ includes corresponding *f128 interfaces for it. */
+#if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \
+ && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH
+# define __HAVE_FLOAT128 1
+#else
+# define __HAVE_FLOAT128 0
+#endif
+
+/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
+ from the default float, double and long double types in this glibc, i.e.
+ calls to the binary128 functions go to *f128 symbols instead of *l. */
+#if __HAVE_FLOAT128
+# define __HAVE_DISTINCT_FLOAT128 1
+#else
+# define __HAVE_DISTINCT_FLOAT128 0
+#endif
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the right format for _Float64x, and this
+ glibc includes corresponding *f64x interfaces for it. */
+#define __HAVE_FLOAT64X __HAVE_FLOAT128
+
+/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
+ of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
+ the format of _Float128, which must be different from that of long
+ double. */
+#define __HAVE_FLOAT64X_LONG_DOUBLE 0
+
+#ifndef __ASSEMBLER__
+
+/* Defined to concatenate the literal suffix to be used with _Float128
+ types, if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* The literal suffix (f128) exist for powerpc only since GCC 7.0. */
+# if __LDBL_MANT_DIG__ == 113
+# define __f128(x) x##l
+# else
+# define __f128(x) x##q
+# endif
+# else
+# define __f128(x) x##f128
+# endif
+# endif
+
+/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if __LDBL_MANT_DIG__ == 113 && defined __cplusplus
+typedef long double _Float128;
+# define __CFLOAT128 _Complex long double
+# elif !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* The type _Float128 exist for powerpc only since GCC 7.0. */
+typedef __float128 _Float128;
+/* Add a typedef for older GCC and C++ compilers which don't natively support
+ _Complex _Float128. */
+typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__)));
+# define __CFLOAT128 __cfloat128
+# else
+# define __CFLOAT128 _Complex _Float128
+# endif
+# endif
+
+/* The remaining of this file provides support for older compilers. */
+# if __HAVE_FLOAT128
+/* Builtin __builtin_huge_valf128 doesn't exist before GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())
+# endif
+
+/* The following builtins (suffixed with 'q') are available in GCC >= 6.2,
+ which is the minimum version required for float128 support on powerpc64le.
+ Since GCC 7.0 the builtins suffixed with f128 are also available, then
+ there is no need to redefined them. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_copysignf128 __builtin_copysignq
+# define __builtin_fabsf128 __builtin_fabsq
+# define __builtin_inff128 __builtin_infq
+# define __builtin_nanf128 __builtin_nanq
+# define __builtin_nansf128 __builtin_nansq
+# endif
+
+/* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
+ e.g.: __builtin_signbitf128, before GCC 6. However, there has never
+ been a __builtin_signbitf128 in GCC and the type-generic builtin is
+ only available since GCC 6. */
+# if !__GNUC_PREREQ (6, 0)
+# define __builtin_signbitf128 __signbitf128
+# endif
+
+# endif
+
+#endif /* !__ASSEMBLER__. */
+
+#include <bits/floatn-common.h>
+
+#endif /* _BITS_FLOATN_H */
diff --git a/sysdeps/powerpc/bits/fp-fast.h b/sysdeps/powerpc/bits/fp-fast.h
new file mode 100644
index 0000000000..40924a8a07
--- /dev/null
+++ b/sysdeps/powerpc/bits/fp-fast.h
@@ -0,0 +1,39 @@
+/* Define FP_FAST_* macros. PowerPC version.
+ Copyright (C) 2016-2018 Free Software 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/fp-fast.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __USE_ISOC99
+
+/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l}
+ builtins are supported. */
+# if (!defined _SOFT_FLOAT && !defined __NO_FPRS__) || defined __FP_FAST_FMA
+# define FP_FAST_FMA 1
+# endif
+
+# if (!defined _SOFT_FLOAT && !defined __NO_FPRS__) || defined __FP_FAST_FMAF
+# define FP_FAST_FMAF 1
+# endif
+
+# ifdef __FP_FAST_FMAL
+# define FP_FAST_FMAL 1
+# endif
+
+#endif
diff --git a/sysdeps/powerpc/bits/hwcap.h b/sysdeps/powerpc/bits/hwcap.h
index 40572d08fc..b35f5eddc1 100644
--- a/sysdeps/powerpc/bits/hwcap.h
+++ b/sysdeps/powerpc/bits/hwcap.h
@@ -1,5 +1,5 @@
/* Defines for bits in AT_HWCAP and AT_HWCAP2.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -50,6 +50,7 @@
#define PPC_FEATURE_ARCH_2_06 0x00000100 /* ISA 2.06 */
#define PPC_FEATURE_HAS_VSX 0x00000080 /* P7 Vector Extension. */
#define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040
+/* Reserved by the kernel. 0x00000004 Do not use. */
#define PPC_FEATURE_TRUE_LE 0x00000002
#define PPC_FEATURE_PPC_LE 0x00000001
@@ -69,3 +70,7 @@
#define PPC_FEATURE2_ARCH_3_00 0x00800000 /* ISA 3.0 */
#define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float
128-bit */
+#define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */
+#define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */
+#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended
+ state. */
diff --git a/sysdeps/powerpc/bits/link.h b/sysdeps/powerpc/bits/link.h
index dc1a8de58f..a23bb3676d 100644
--- a/sysdeps/powerpc/bits/link.h
+++ b/sysdeps/powerpc/bits/link.h
@@ -1,5 +1,5 @@
/* Machine-specific declarations for dynamic linker interface. PowerPC version
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/bits/mathdef.h b/sysdeps/powerpc/bits/mathdef.h
deleted file mode 100644
index d4dd4b5c6a..0000000000
--- a/sysdeps/powerpc/bits/mathdef.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* 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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-
-/* FIXME! This file describes properties of the compiler, not the machine;
- it should not be part of libc!
-
- FIXME! This file does not deal with the -fshort-double option of
- gcc! */
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* PowerPC has both `float' and `double' arithmetic. */
-typedef float float_t;
-typedef double double_t;
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647)
-# define FP_ILOGBNAN (2147483647)
-
-# if !defined _SOFT_FLOAT && !defined __NO_FPRS__
-/* The powerpc has a combined multiply/add instruction. */
-# define FP_FAST_FMA 1
-# define FP_FAST_FMAF 1
-# endif
-
-#endif /* ISO C99 */
diff --git a/sysdeps/powerpc/bits/mathinline.h b/sysdeps/powerpc/bits/mathinline.h
index ac7d86af3a..e3e83865df 100644
--- a/sysdeps/powerpc/bits/mathinline.h
+++ b/sysdeps/powerpc/bits/mathinline.h
@@ -1,5 +1,5 @@
/* Inline math functions for powerpc.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,66 +28,6 @@
#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__
-#ifdef __USE_ISOC99
-# if !__GNUC_PREREQ (2,97)
-# define __unordered_cmp(x, y) \
- (__extension__ \
- ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
- unsigned __r; \
- __asm__("fcmpu 7,%1,%2 ; mfcr %0" : "=r" (__r) : "f" (__x), "f"(__y) \
- : "cr7"); \
- __r; }))
-
-# undef isgreater
-# undef isgreaterequal
-# undef isless
-# undef islessequal
-# undef islessgreater
-# undef isunordered
-
-# define isgreater(x, y) (__unordered_cmp (x, y) >> 2 & 1)
-# define isgreaterequal(x, y) ((__unordered_cmp (x, y) & 6) != 0)
-# define isless(x, y) (__unordered_cmp (x, y) >> 3 & 1)
-# define islessequal(x, y) ((__unordered_cmp (x, y) & 0xA) != 0)
-# define islessgreater(x, y) ((__unordered_cmp (x, y) & 0xC) != 0)
-# define isunordered(x, y) (__unordered_cmp (x, y) & 1)
-
-# endif /* __GNUC_PREREQ (2,97) */
-
-/* The gcc, version 2.7 or below, has problems with all this inlining
- code. So disable it for this version of the compiler. */
-# if __GNUC_PREREQ (2, 8)
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-#if __GNUC_PREREQ (4, 0)
- return __builtin_signbitf (__x);
-#else
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
-#endif
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-#if __GNUC_PREREQ (4, 0)
- return __builtin_signbit (__x);
-#else
- __extension__ union { double __d; long long __i; } __u = { __d: __x };
- return __u.__i < 0;
-#endif
-}
-# ifdef __LONG_DOUBLE_128__
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- return __signbit ((double) __x);
-}
-# endif
-# endif
-#endif /* __USE_ISOC99 */
-
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
#ifdef __USE_ISOC99
@@ -113,20 +53,6 @@ __NTH (lrintf (float __x))
}
# endif
-__MATH_INLINE double fdim (double __x, double __y) __THROW;
-__MATH_INLINE double
-__NTH (fdim (double __x, double __y))
-{
- return __x <= __y ? 0 : __x - __y;
-}
-
-__MATH_INLINE float fdimf (float __x, float __y) __THROW;
-__MATH_INLINE float
-__NTH (fdimf (float __x, float __y))
-{
- return __x <= __y ? 0 : __x - __y;
-}
-
#endif /* __USE_ISOC99 */
#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */
diff --git a/sysdeps/powerpc/bits/setjmp.h b/sysdeps/powerpc/bits/setjmp.h
index 0a7e1d8bb2..48ff130947 100644
--- a/sysdeps/powerpc/bits/setjmp.h
+++ b/sysdeps/powerpc/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/cpu-features.c b/sysdeps/powerpc/cpu-features.c
new file mode 100644
index 0000000000..955d4778a6
--- /dev/null
+++ b/sysdeps/powerpc/cpu-features.c
@@ -0,0 +1,39 @@
+/* Initialize cpu feature data. PowerPC version.
+ Copyright (C) 2017-2018 Free Software 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 <stdint.h>
+#include <cpu-features.h>
+
+#if HAVE_TUNABLES
+# include <elf/dl-tunables.h>
+#endif
+
+static inline void
+init_cpu_features (struct cpu_features *cpu_features)
+{
+ /* Default is to use aligned memory access on optimized function unless
+ tunables is enable, since for this case user can explicit disable
+ unaligned optimizations. */
+#if HAVE_TUNABLES
+ int32_t cached_memfunc = TUNABLE_GET (glibc, tune, cached_memopt, int32_t,
+ NULL);
+ cpu_features->use_cached_memopt = (cached_memfunc > 0);
+#else
+ cpu_features->use_cached_memopt = false;
+#endif
+}
diff --git a/sysdeps/powerpc/cpu-features.h b/sysdeps/powerpc/cpu-features.h
new file mode 100644
index 0000000000..e596385b4b
--- /dev/null
+++ b/sysdeps/powerpc/cpu-features.h
@@ -0,0 +1,28 @@
+/* Initialize cpu feature data. PowerPC version.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 __CPU_FEATURES_POWERPC_H
+# define __CPU_FEATURES_POWERPC_H
+
+#include <stdbool.h>
+
+struct cpu_features
+{
+ bool use_cached_memopt;
+};
+
+#endif /* __CPU_FEATURES_H */
diff --git a/sysdeps/powerpc/dl-procinfo.c b/sysdeps/powerpc/dl-procinfo.c
index 6e7850eebd..35cac2e249 100644
--- a/sysdeps/powerpc/dl-procinfo.c
+++ b/sysdeps/powerpc/dl-procinfo.c
@@ -1,5 +1,5 @@
/* Data for processor capability information. PowerPC version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software 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,8 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-/* This information must be kept in sync with the _DL_HWCAP_COUNT and
- _DL_PLATFORM_COUNT definitions in procinfo.h.
+/* This information must be kept in sync with the _DL_HWCAP_COUNT
+ definition in procinfo.h.
If anything should be added here check whether the size of each string
is still ok with the given array size.
@@ -42,14 +42,31 @@
# define PROCINFO_CLASS
#endif
+#if !IS_IN (ldconfig)
+# if !defined PROCINFO_DECL && defined SHARED
+ ._dl_powerpc_cpu_features
+# else
+PROCINFO_CLASS struct cpu_features _dl_powerpc_cpu_features
+# endif
+# ifndef PROCINFO_DECL
+= { }
+# endif
+# if !defined SHARED || defined PROCINFO_DECL
+;
+# else
+,
+# endif
+#endif
+
#if !defined PROCINFO_DECL && defined SHARED
._dl_powerpc_cap_flags
#else
-PROCINFO_CLASS const char _dl_powerpc_cap_flags[60][10]
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[64][15]
#endif
#ifndef PROCINFO_DECL
= {
- "ppcle", "true_le", "archpmu", "vsx",
+ "ppcle", "true_le", "", "",
+ "", "", "archpmu", "vsx",
"arch_2_06", "power6x", "dfp", "pa6t",
"arch_2_05", "ic_snoop", "smt", "booke",
"cellbe", "power5+", "power5", "power4",
@@ -60,8 +77,8 @@ PROCINFO_CLASS const char _dl_powerpc_cap_flags[60][10]
"", "", "", "",
"", "", "", "",
"", "", "", "",
- "", "", "", "",
- "", "", "ieee128", "arch_3_00",
+ "", "", "", "htm-no-suspend",
+ "scv", "darn", "ieee128", "arch_3_00",
"htm-nosc", "vcrypto", "tar", "isel",
"ebb", "dscr", "htm", "arch_2_07",
}
@@ -72,35 +89,5 @@ PROCINFO_CLASS const char _dl_powerpc_cap_flags[60][10]
,
#endif
-#if !defined PROCINFO_DECL && defined SHARED
- ._dl_powerpc_platforms
-#else
-PROCINFO_CLASS const char _dl_powerpc_platforms[15][12]
-#endif
-#ifndef PROCINFO_DECL
-= {
- [PPC_PLATFORM_POWER4] = "power4",
- [PPC_PLATFORM_PPC970] = "ppc970",
- [PPC_PLATFORM_POWER5] = "power5",
- [PPC_PLATFORM_POWER5_PLUS] = "power5+",
- [PPC_PLATFORM_POWER6] = "power6",
- [PPC_PLATFORM_CELL_BE] = "ppc-cell-be",
- [PPC_PLATFORM_POWER6X] = "power6x",
- [PPC_PLATFORM_POWER7] = "power7",
- [PPC_PLATFORM_PPCA2] = "ppca2",
- [PPC_PLATFORM_PPC405] = "ppc405",
- [PPC_PLATFORM_PPC440] = "ppc440",
- [PPC_PLATFORM_PPC464] = "ppc464",
- [PPC_PLATFORM_PPC476] = "ppc476",
- [PPC_PLATFORM_POWER8] = "power8",
- [PPC_PLATFORM_POWER9] = "power9"
- }
-#endif
-#if !defined SHARED || defined PROCINFO_DECL
-;
-#else
-,
-#endif
-
#undef PROCINFO_DECL
#undef PROCINFO_CLASS
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index bce3a49ac0..3803379ab2 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -1,5 +1,5 @@
/* Processor capability information handling macros. PowerPC version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,9 +22,6 @@
#include <ldsodefs.h>
#include <sysdep.h> /* This defines the PPC_FEATURE[2]_* macros. */
-/* There are 28 bits used, but they are bits 4..31. */
-#define _DL_HWCAP_FIRST 4
-
/* The total number of available bits (including those prior to
_DL_HWCAP_FIRST). Some of these bits might not be used. */
#define _DL_HWCAP_COUNT 64
@@ -68,21 +65,14 @@ static inline const char *
__attribute__ ((unused))
_dl_hwcap_string (int idx)
{
- return GLRO(dl_powerpc_cap_flags)[idx - _DL_HWCAP_FIRST];
-}
-
-static inline const char *
-__attribute__ ((unused))
-_dl_platform_string (int idx)
-{
- return GLRO(dl_powerpc_platforms)[idx - _DL_FIRST_PLATFORM];
+ return GLRO(dl_powerpc_cap_flags)[idx];
}
static inline int
__attribute__ ((unused))
_dl_string_hwcap (const char *str)
{
- for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
+ for (int i = 0; i < _DL_HWCAP_COUNT; ++i)
if (strcmp (str, _dl_hwcap_string (i)) == 0)
return i;
return -1;
@@ -95,7 +85,7 @@ _dl_string_platform (const char *str)
if (str == NULL)
return -1;
- if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_POWER4], 5) == 0)
+ if (strncmp (str, "power", 5) == 0)
{
int ret;
str += 5;
@@ -135,35 +125,21 @@ _dl_string_platform (const char *str)
if (str[1] == '\0')
return ret;
}
- else if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970],
- 3) == 0)
+ else if (strncmp (str, "ppc", 3) == 0)
{
- if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970]
- + 3) == 0)
+ if (strcmp (str + 3, "970") == 0)
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC970;
- else if (strcmp (str + 3,
- GLRO(dl_powerpc_platforms)[PPC_PLATFORM_CELL_BE] + 3)
- == 0)
+ else if (strcmp (str + 3, "-cell-be") == 0)
return _DL_FIRST_PLATFORM + PPC_PLATFORM_CELL_BE;
- else if (strcmp (str + 3,
- GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPCA2] + 3)
- == 0)
+ else if (strcmp (str + 3, "a2") == 0)
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPCA2;
- else if (strcmp (str + 3,
- GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC405] + 3)
- == 0)
+ else if (strcmp (str + 3, "405") == 0)
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC405;
- else if (strcmp (str + 3,
- GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC440] + 3)
- == 0)
+ else if (strcmp (str + 3, "440") == 0)
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC440;
- else if (strcmp (str + 3,
- GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC464] + 3)
- == 0)
+ else if (strcmp (str + 3, "464") == 0)
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC464;
- else if (strcmp (str + 3,
- GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC476] + 3)
- == 0)
+ else if (strcmp (str + 3, "476") == 0)
return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC476;
}
@@ -180,7 +156,7 @@ _dl_procinfo (unsigned int type, unsigned long int word)
case AT_HWCAP:
_dl_printf ("AT_HWCAP: ");
- for (int i = _DL_HWCAP_FIRST; i <= _DL_HWCAP_LAST; ++i)
+ for (int i = 0; i <= _DL_HWCAP_LAST; ++i)
if (word & (1 << i))
_dl_printf (" %s", _dl_hwcap_string (i));
break;
diff --git a/sysdeps/powerpc/dl-tls.c b/sysdeps/powerpc/dl-tls.c
index aad8698524..185ec69efe 100644
--- a/sysdeps/powerpc/dl-tls.c
+++ b/sysdeps/powerpc/dl-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. PowerPC version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/dl-tls.h b/sysdeps/powerpc/dl-tls.h
index eced36b65d..9f9306b83c 100644
--- a/sysdeps/powerpc/dl-tls.h
+++ b/sysdeps/powerpc/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. PowerPC version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -49,7 +49,4 @@ extern void *__tls_get_addr (tls_index *ti);
# define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
#endif
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
-
#endif /* dl-tls.h */
diff --git a/sysdeps/powerpc/dl-tunables.list b/sysdeps/powerpc/dl-tunables.list
new file mode 100644
index 0000000000..d26636a16b
--- /dev/null
+++ b/sysdeps/powerpc/dl-tunables.list
@@ -0,0 +1,28 @@
+# powerpc specific tunables.
+# Copyright (C) 2017-2018 Free Software 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/>.
+
+glibc {
+ tune {
+ cached_memopt {
+ type: INT_32
+ minval: 0
+ maxval: 1
+ default: 0
+ }
+ }
+}
diff --git a/sysdeps/powerpc/ffs.c b/sysdeps/powerpc/ffs.c
index c453db5f7a..fce42ff4fc 100644
--- a/sysdeps/powerpc/ffs.c
+++ b/sysdeps/powerpc/ffs.c
@@ -1,6 +1,6 @@
/* Find first set bit in a word, counted from least significant end.
For PowerPC.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/sysdeps/powerpc/fpu/e_hypot.c b/sysdeps/powerpc/fpu/e_hypot.c
index da0f2daed3..b55db6d259 100644
--- a/sysdeps/powerpc/fpu/e_hypot.c
+++ b/sysdeps/powerpc/fpu/e_hypot.c
@@ -1,5 +1,5 @@
/* Pythagorean addition using doubles
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -19,6 +19,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <stdint.h>
static const double two60 = 1.152921504606847e+18;
@@ -41,10 +42,11 @@ static const double pdnum = 2.225073858507201e-308;
#ifdef _ARCH_PWR7
/* POWER7 isinf and isnan optimization are fast. */
# define TEST_INF_NAN(x, y) \
- if (isinf(x) || isinf(y)) \
+ if ((isinf(x) || isinf(y)) \
+ && !issignaling (x) && !issignaling (y)) \
return INFINITY; \
if (isnan(x) || isnan(y)) \
- return NAN;
+ return x + y;
# else
/* For POWER6 and below isinf/isnan triggers LHS and PLT calls are
* costly (especially for POWER6). */
@@ -66,9 +68,10 @@ static const double pdnum = 2.225073858507201e-308;
uint32_t ht = hx; hx = hy; hy = ht; \
} \
if (hx >= 0x7ff00000) { \
- if (hx == 0x7ff00000 || hy == 0x7ff00000) \
+ if ((hx == 0x7ff00000 || hy == 0x7ff00000) \
+ && !issignaling (x) && !issignaling (y)) \
return INFINITY; \
- return NAN; \
+ return x + y; \
} \
} while (0)
@@ -108,7 +111,7 @@ __ieee754_hypot (double x, double y)
{
x *= twoM600;
y *= twoM600;
- return __ieee754_sqrt (x * x + y * y) / twoM600;
+ return sqrt (x * x + y * y) / twoM600;
}
if (y < twoM500)
{
@@ -116,7 +119,7 @@ __ieee754_hypot (double x, double y)
{
x *= two1022;
y *= two1022;
- double ret = __ieee754_sqrt (x * x + y * y) / two1022;
+ double ret = sqrt (x * x + y * y) / two1022;
math_check_force_underflow_nonneg (ret);
return ret;
}
@@ -124,9 +127,9 @@ __ieee754_hypot (double x, double y)
{
x *= two600;
y *= two600;
- return __ieee754_sqrt (x * x + y * y) / two600;
+ return sqrt (x * x + y * y) / two600;
}
}
- return __ieee754_sqrt (x * x + y * y);
+ return sqrt (x * x + y * y);
}
strong_alias (__ieee754_hypot, __hypot_finite)
diff --git a/sysdeps/powerpc/fpu/e_hypotf.c b/sysdeps/powerpc/fpu/e_hypotf.c
index 48360828c3..72b46ad9da 100644
--- a/sysdeps/powerpc/fpu/e_hypotf.c
+++ b/sysdeps/powerpc/fpu/e_hypotf.c
@@ -1,5 +1,5 @@
/* Pythagorean addition using floats
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -31,10 +31,11 @@
#ifdef _ARCH_PWR7
/* POWER7 isinf and isnan optimizations are fast. */
# define TEST_INF_NAN(x, y) \
- if (isinff(x) || isinff(y)) \
+ if ((isinff(x) || isinff(y)) \
+ && !issignaling (x) && !issignaling (y)) \
return INFINITY; \
if (isnanf(x) || isnanf(y)) \
- return NAN;
+ return x + y;
# else
/* For POWER6 and below isinf/isnan triggers LHS and PLT calls are
* costly (especially for POWER6). */
@@ -56,9 +57,10 @@
uint32_t ht = hx; hx = hy; hy = ht; \
} \
if (hx >= 0x7f800000) { \
- if (hx == 0x7f800000 || hy == 0x7f800000) \
+ if ((hx == 0x7f800000 || hy == 0x7f800000) \
+ && !issignaling (x) && !issignaling (y)) \
return INFINITY; \
- return NAN; \
+ return x + y; \
} \
} while (0)
#endif
@@ -69,6 +71,6 @@ __ieee754_hypotf (float x, float y)
{
TEST_INF_NAN (x, y);
- return __ieee754_sqrt ((double) x * x + (double) y * y);
+ return sqrt ((double) x * x + (double) y * y);
}
strong_alias (__ieee754_hypotf, __hypotf_finite)
diff --git a/sysdeps/powerpc/fpu/e_rem_pio2f.c b/sysdeps/powerpc/fpu/e_rem_pio2f.c
index 14686bf80b..30fd53ee2c 100644
--- a/sysdeps/powerpc/fpu/e_rem_pio2f.c
+++ b/sysdeps/powerpc/fpu/e_rem_pio2f.c
@@ -1,5 +1,5 @@
/* e_rem_pio2f.c -- float version of e_rem_pio2.c
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
diff --git a/sysdeps/powerpc/fpu/e_sqrt.c b/sysdeps/powerpc/fpu/e_sqrt.c
index 29d72e9728..7dfb609565 100644
--- a/sysdeps/powerpc/fpu/e_sqrt.c
+++ b/sysdeps/powerpc/fpu/e_sqrt.c
@@ -1,5 +1,5 @@
/* Double-precision floating point square root.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/e_sqrtf.c b/sysdeps/powerpc/fpu/e_sqrtf.c
index 0aaafecb43..be934c26a1 100644
--- a/sysdeps/powerpc/fpu/e_sqrtf.c
+++ b/sysdeps/powerpc/fpu/e_sqrtf.c
@@ -1,5 +1,5 @@
/* Single-precision floating point square root.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/fclrexcpt.c b/sysdeps/powerpc/fpu/fclrexcpt.c
index aae649d7a2..5ed4309a69 100644
--- a/sysdeps/powerpc/fpu/fclrexcpt.c
+++ b/sysdeps/powerpc/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/fe_mask.c b/sysdeps/powerpc/fpu/fe_mask.c
index bf2531ce0b..5580e340b5 100644
--- a/sysdeps/powerpc/fpu/fe_mask.c
+++ b/sysdeps/powerpc/fpu/fe_mask.c
@@ -1,5 +1,5 @@
/* Procedure definition for FE_MASK_ENV.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/fe_nomask.c b/sysdeps/powerpc/fpu/fe_nomask.c
index 1e6026963c..4868315062 100644
--- a/sysdeps/powerpc/fpu/fe_nomask.c
+++ b/sysdeps/powerpc/fpu/fe_nomask.c
@@ -1,5 +1,5 @@
/* Procedure definition for FE_NOMASK_ENV.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/fedisblxcpt.c b/sysdeps/powerpc/fpu/fedisblxcpt.c
index 14e507cfde..2daed44a41 100644
--- a/sysdeps/powerpc/fpu/fedisblxcpt.c
+++ b/sysdeps/powerpc/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@geoffk.org>, 2000.
diff --git a/sysdeps/powerpc/fpu/feenablxcpt.c b/sysdeps/powerpc/fpu/feenablxcpt.c
index bf3dab04c6..19cfe28e7a 100644
--- a/sysdeps/powerpc/fpu/feenablxcpt.c
+++ b/sysdeps/powerpc/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@geoffk.org>, 2000.
diff --git a/sysdeps/powerpc/fpu/fegetenv.c b/sysdeps/powerpc/fpu/fegetenv.c
index 71478ef0fc..8edf6e2b6e 100644
--- a/sysdeps/powerpc/fpu/fegetenv.c
+++ b/sysdeps/powerpc/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/fegetexcept.c b/sysdeps/powerpc/fpu/fegetexcept.c
index 6ba5310836..a053a32bfe 100644
--- a/sysdeps/powerpc/fpu/fegetexcept.c
+++ b/sysdeps/powerpc/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@geoffk.org>, 2000.
diff --git a/sysdeps/powerpc/fpu/fegetmode.c b/sysdeps/powerpc/fpu/fegetmode.c
new file mode 100644
index 0000000000..b83dc9f625
--- /dev/null
+++ b/sysdeps/powerpc/fpu/fegetmode.c
@@ -0,0 +1,26 @@
+/* Store current floating-point control modes. PowerPC version.
+ Copyright (C) 2016-2018 Free Software 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/fegetround.c b/sysdeps/powerpc/fpu/fegetround.c
index 47534714e7..6798068f4e 100644
--- a/sysdeps/powerpc/fpu/fegetround.c
+++ b/sysdeps/powerpc/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/feholdexcpt.c b/sysdeps/powerpc/fpu/feholdexcpt.c
index d2525c4d6f..8ec3fbff82 100644
--- a/sysdeps/powerpc/fpu/feholdexcpt.c
+++ b/sysdeps/powerpc/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/fenv_const.c b/sysdeps/powerpc/fpu/fenv_const.c
index b061daf578..84064f82fd 100644
--- a/sysdeps/powerpc/fpu/fenv_const.c
+++ b/sysdeps/powerpc/fpu/fenv_const.c
@@ -1,5 +1,5 @@
/* Constants for fenv_bits.h.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,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_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h
index b25bd010b5..4c19d12b0b 100644
--- a/sysdeps/powerpc/fpu/fenv_libc.h
+++ b/sysdeps/powerpc/fpu/fenv_libc.h
@@ -1,5 +1,5 @@
/* Internal libc stuff for floating point environment routines.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/fenv_private.h b/sysdeps/powerpc/fpu/fenv_private.h
index e1b02a3f80..945ab98018 100644
--- a/sysdeps/powerpc/fpu/fenv_private.h
+++ b/sysdeps/powerpc/fpu/fenv_private.h
@@ -1,5 +1,5 @@
/* Private floating point rounding and exceptions handling. PowerPC version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,56 +23,57 @@
#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 everything but the rounding moded and non-IEEE arithmetic flags. */
-#define _FPU_MASK_ROUNDING 0xffffffff00000007LL
+/* Mask the rounding mode bits. */
+#define _FPU_MASK_RN 0xfffffffffffffffcLL
+
+/* Mask everything but the rounding modes and non-IEEE arithmetic flags. */
+#define _FPU_MASK_NOT_RN_NI 0xffffffff00000807LL
/* Mask restore rounding mode and exception enabled. */
-#define _FPU_MASK_EXCEPT_ROUND 0xffffffff1fffff00LL
+#define _FPU_MASK_TRAPS_RN 0xffffffffffffff00LL
-/* Mask exception enable but fraction rounded/inexact and FP result/CC
- bits. */
-#define _FPU_MASK_FRAC_INEX_RET_CC 0x1ff80fff
+/* Mask FP result flags, preserve fraction rounded/inexact bits. */
+#define _FPU_MASK_FRAC_INEX_RET_CC 0xfffffffffff80fffLL
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 +85,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) | 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 +172,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 +202,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) | 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 +212,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/fesetenv.c b/sysdeps/powerpc/fpu/fesetenv.c
index 05cd6b0d7b..ad9fda15b1 100644
--- a/sysdeps/powerpc/fpu/fesetenv.c
+++ b/sysdeps/powerpc/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/fesetexcept.c b/sysdeps/powerpc/fpu/fesetexcept.c
new file mode 100644
index 0000000000..85419c79f0
--- /dev/null
+++ b/sysdeps/powerpc/fpu/fesetexcept.c
@@ -0,0 +1,42 @@
+/* Set given exception flags. PowerPC version.
+ Copyright (C) 2016-2018 Free Software 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..32203a24ff
--- /dev/null
+++ b/sysdeps/powerpc/fpu/fesetmode.c
@@ -0,0 +1,49 @@
+/* Install given floating-point control modes. PowerPC version.
+ Copyright (C) 2016-2018 Free Software 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/fesetround.c b/sysdeps/powerpc/fpu/fesetround.c
index dff6bd38e5..9ff239f7df 100644
--- a/sysdeps/powerpc/fpu/fesetround.c
+++ b/sysdeps/powerpc/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/powerpc/fpu/feupdateenv.c b/sysdeps/powerpc/fpu/feupdateenv.c
index bc442793c3..2dbd1c4e9e 100644
--- a/sysdeps/powerpc/fpu/feupdateenv.c
+++ b/sysdeps/powerpc/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/powerpc/fpu/fgetexcptflg.c b/sysdeps/powerpc/fpu/fgetexcptflg.c
index 3f29498fdc..a0c1c5a183 100644
--- a/sysdeps/powerpc/fpu/fgetexcptflg.c
+++ b/sysdeps/powerpc/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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..00bf6cae58
--- /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-2018 Free Software 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/fraiseexcpt.c b/sysdeps/powerpc/fpu/fraiseexcpt.c
index c6a53578d3..6859edce00 100644
--- a/sysdeps/powerpc/fpu/fraiseexcpt.c
+++ b/sysdeps/powerpc/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/fsetexcptflg.c b/sysdeps/powerpc/fpu/fsetexcptflg.c
index a06640593c..b45dbd82bc 100644
--- a/sysdeps/powerpc/fpu/fsetexcptflg.c
+++ b/sysdeps/powerpc/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,8 +31,12 @@ __fesetexceptflag (const fexcept_t *flagp, int excepts)
flag = *flagp & excepts;
/* Replace the exception status */
- n.l = ((u.l & ~(FPSCR_STICKY_BITS & excepts))
+ int excepts_mask = FPSCR_STICKY_BITS & excepts;
+ if ((excepts & FE_INVALID) != 0)
+ excepts_mask |= FE_ALL_INVALID;
+ n.l = ((u.l & ~excepts_mask)
| (flag & FPSCR_STICKY_BITS)
+ /* Turn FE_INVALID into FE_INVALID_SOFTWARE. */
| (flag >> ((31 - FPSCR_VX) - (31 - FPSCR_VXSOFT))
& FE_INVALID_SOFTWARE));
diff --git a/sysdeps/powerpc/fpu/ftestexcept.c b/sysdeps/powerpc/fpu/ftestexcept.c
index 4215d3517f..d9febb0ab1 100644
--- a/sysdeps/powerpc/fpu/ftestexcept.c
+++ b/sysdeps/powerpc/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/k_cosf.c b/sysdeps/powerpc/fpu/k_cosf.c
index 517d3cbdef..32d590d661 100644
--- a/sysdeps/powerpc/fpu/k_cosf.c
+++ b/sysdeps/powerpc/fpu/k_cosf.c
@@ -1,5 +1,5 @@
/* k_cosf.c -- float version of k_cos.c
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
diff --git a/sysdeps/powerpc/fpu/k_rem_pio2f.c b/sysdeps/powerpc/fpu/k_rem_pio2f.c
index 8cebbcce01..7e5a08ba5a 100644
--- a/sysdeps/powerpc/fpu/k_rem_pio2f.c
+++ b/sysdeps/powerpc/fpu/k_rem_pio2f.c
@@ -1,5 +1,5 @@
/* k_rem_pio2f.c -- float version of e_rem_pio2.c
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
diff --git a/sysdeps/powerpc/fpu/k_sinf.c b/sysdeps/powerpc/fpu/k_sinf.c
index 6b5e569fd2..0fb99c7b2b 100644
--- a/sysdeps/powerpc/fpu/k_sinf.c
+++ b/sysdeps/powerpc/fpu/k_sinf.c
@@ -1,5 +1,5 @@
/* k_sinf.c -- float version of k_sin.c
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps
index f918f52fd3..f4c67c6423 100644
--- a/sysdeps/powerpc/fpu/libm-test-ulps
+++ b/sysdeps/powerpc/fpu/libm-test-ulps
@@ -3,1627 +3,2052 @@
# Maximal error of functions:
Function: "acos":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "acos_downward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "acos_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "acos_upward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "acosh":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
-ildouble: 1
-ldouble: 1
+ifloat128: 2
+ildouble: 2
+ldouble: 2
Function: "acosh_downward":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 3
+idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "acosh_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
-ildouble: 3
-ldouble: 3
+ifloat128: 2
+ildouble: 4
+ldouble: 4
Function: "acosh_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 4
+Function: "add_ldouble":
+double: 1
+float: 1
+
Function: "asin":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "asin_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "asin_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "asin_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "asinh":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "asinh_downward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "asinh_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: "asinh_upward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
-ildouble: 4
-ldouble: 4
+ifloat128: 4
+ildouble: 7
+ldouble: 7
Function: "atan":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan2":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "atan2_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: "atan2_towardzero":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 6
ldouble: 6
Function: "atan2_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "atan_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atan_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan_upward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "atanh":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "atanh_downward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 3
ldouble: 3
Function: "atanh_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "atanh_upward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
-ildouble: 3
-ldouble: 3
+ifloat128: 4
+ildouble: 4
+ldouble: 4
Function: "cabs":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_downward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: Real part of "cacos":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 3
+idouble: 3
ifloat: 2
+ifloat128: 3
ildouble: 6
ldouble: 6
Function: Imaginary part of "cacos_downward":
double: 5
float: 3
+float128: 6
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 8
+ldouble: 8
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 3
+idouble: 3
ifloat: 2
-ildouble: 6
-ldouble: 6
+ifloat128: 3
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "cacos_towardzero":
double: 5
float: 3
+float128: 5
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 5
+ildouble: 8
+ldouble: 8
Function: Real part of "cacos_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
-ildouble: 4
-ldouble: 4
+ifloat128: 3
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 8
-ldouble: 8
+double: 5
+float: 5
+float128: 7
+idouble: 5
+ifloat: 5
+ifloat128: 7
+ildouble: 13
+ldouble: 13
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacosh":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "cacosh_downward":
double: 5
float: 3
+float128: 5
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 5
+ildouble: 8
+ldouble: 8
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+float128: 4
+idouble: 3
+ifloat: 3
+ifloat128: 4
ildouble: 6
ldouble: 6
Function: Real part of "cacosh_towardzero":
double: 5
float: 3
+float128: 5
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 5
+ildouble: 8
+ldouble: 8
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 3
+idouble: 3
ifloat: 2
-ildouble: 6
-ldouble: 6
+ifloat128: 3
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh_upward":
double: 4
float: 4
+float128: 6
idouble: 4
ifloat: 4
-ildouble: 8
-ldouble: 8
+ifloat128: 6
+ildouble: 12
+ldouble: 12
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 4
+idouble: 3
ifloat: 2
-ildouble: 4
-ldouble: 4
+ifloat128: 4
+ildouble: 8
+ldouble: 8
Function: "carg":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "carg_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: "carg_towardzero":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 6
ldouble: 6
Function: "carg_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "casin":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
+float128: 3
idouble: 3
-ifloat: 1
-ildouble: 3
-ldouble: 3
+ifloat: 2
+ifloat128: 3
+ildouble: 4
+ldouble: 4
Function: Imaginary part of "casin_downward":
double: 5
float: 3
+float128: 6
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 8
+ldouble: 8
Function: Real part of "casin_towardzero":
double: 3
float: 1
+float128: 3
idouble: 3
ifloat: 1
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Imaginary part of "casin_towardzero":
double: 5
float: 3
+float128: 5
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 5
+ildouble: 8
+ldouble: 8
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+float128: 3
+idouble: 3
+ifloat: 2
+ifloat128: 3
ildouble: 6
ldouble: 6
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 8
-ldouble: 8
+double: 5
+float: 5
+float128: 7
+idouble: 5
+ifloat: 5
+ifloat128: 7
+ildouble: 13
+ldouble: 13
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "casinh":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "casinh_downward":
double: 5
float: 3
+float128: 6
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 8
+ldouble: 8
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
+float128: 3
idouble: 3
-ifloat: 1
-ildouble: 3
-ldouble: 3
+ifloat: 2
+ifloat128: 3
+ildouble: 4
+ldouble: 4
Function: Real part of "casinh_towardzero":
double: 5
float: 3
+float128: 5
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 5
+ildouble: 8
+ldouble: 8
Function: Imaginary part of "casinh_towardzero":
double: 3
float: 1
+float128: 3
idouble: 3
ifloat: 1
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 8
-ldouble: 8
+double: 5
+float: 5
+float128: 7
+idouble: 5
+ifloat: 5
+ifloat128: 7
+ildouble: 13
+ldouble: 13
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 3
+idouble: 3
ifloat: 2
+ifloat128: 3
ildouble: 6
ldouble: 6
Function: Real part of "catan":
+double: 1
float: 1
+float128: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ifloat128: 1
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "catan":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ifloat128: 1
+ildouble: 2
+ldouble: 2
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
+float128: 2
idouble: 1
-ifloat: 1
-ildouble: 5
-ldouble: 5
+ifloat: 2
+ifloat128: 2
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "catan_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
-ildouble: 6
-ldouble: 6
+ifloat128: 2
+ildouble: 7
+ldouble: 7
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
+float128: 2
idouble: 1
-ifloat: 1
-ildouble: 6
-ldouble: 6
+ifloat: 2
+ifloat128: 2
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
+float128: 2
idouble: 2
-ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat: 2
+ifloat128: 2
+ildouble: 3
+ldouble: 3
Function: Real part of "catan_upward":
+double: 1
float: 1
+float128: 2
+idouble: 1
ifloat: 1
-ildouble: 3
-ldouble: 3
+ifloat128: 2
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "catan_upward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 8
ldouble: 8
Function: Real part of "catanh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ifloat128: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catanh":
+double: 1
float: 1
+float128: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ifloat128: 1
+ildouble: 3
+ldouble: 3
Function: Real part of "catanh_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: Imaginary part of "catanh_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
-ildouble: 5
-ldouble: 5
+ifloat128: 2
+ildouble: 6
+ldouble: 6
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
+float128: 2
idouble: 2
-ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat: 2
+ifloat128: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "catanh_towardzero":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
-ildouble: 6
-ldouble: 6
+ifloat128: 2
+ildouble: 7
+ldouble: 7
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
+float128: 4
idouble: 4
-ifloat: 3
+ifloat: 4
+ifloat128: 4
ildouble: 8
ldouble: 8
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+float128: 2
+idouble: 1
ifloat: 1
-ildouble: 3
-ldouble: 3
+ifloat128: 2
+ildouble: 6
+ldouble: 6
Function: "cbrt":
double: 3
float: 1
+float128: 1
idouble: 3
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cbrt_downward":
double: 4
float: 1
+float128: 1
idouble: 4
ifloat: 1
+ifloat128: 1
ildouble: 5
ldouble: 5
Function: "cbrt_towardzero":
double: 3
float: 1
+float128: 1
idouble: 3
ifloat: 1
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "cbrt_upward":
double: 5
float: 1
+float128: 2
idouble: 5
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "ccos":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "ccos":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ifloat128: 1
+ildouble: 2
+ldouble: 2
Function: Real part of "ccos_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Imaginary part of "ccos_downward":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Real part of "ccos_towardzero":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Imaginary part of "ccos_towardzero":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Real part of "ccos_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccos_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Real part of "ccosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "ccosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: Real part of "ccosh_downward":
double: 1
float: 3
+float128: 2
idouble: 1
ifloat: 3
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Imaginary part of "ccosh_downward":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Real part of "ccosh_towardzero":
double: 1
float: 3
+float128: 2
idouble: 1
ifloat: 3
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Imaginary part of "ccosh_towardzero":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Real part of "ccosh_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccosh_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Real part of "cexp":
double: 2
float: 1
+float128: 1
idouble: 2
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: Imaginary part of "cexp":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: Real part of "cexp_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 11
ldouble: 11
Function: Imaginary part of "cexp_downward":
double: 1
float: 3
+float128: 2
idouble: 1
ifloat: 3
+ifloat128: 2
ildouble: 11
ldouble: 11
Function: Real part of "cexp_towardzero":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 11
ldouble: 11
Function: Imaginary part of "cexp_towardzero":
double: 1
float: 3
+float128: 2
idouble: 1
ifloat: 3
+ifloat128: 2
ildouble: 11
ldouble: 11
Function: Real part of "cexp_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Imaginary part of "cexp_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: Imaginary part of "clog":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: Real part of "clog10":
double: 3
float: 4
+float128: 2
idouble: 3
ifloat: 4
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "clog10":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "clog10_downward":
double: 6
float: 6
+float128: 3
idouble: 6
ifloat: 6
+ifloat128: 3
ildouble: 10
ldouble: 10
Function: Imaginary part of "clog10_downward":
double: 2
float: 4
+float128: 3
idouble: 2
ifloat: 4
+ifloat128: 3
ildouble: 7
ldouble: 7
Function: Real part of "clog10_towardzero":
double: 5
float: 5
+float128: 4
idouble: 5
ifloat: 5
+ifloat128: 4
ildouble: 9
ldouble: 9
Function: Imaginary part of "clog10_towardzero":
double: 2
float: 4
+float128: 3
idouble: 2
ifloat: 4
+ifloat128: 3
ildouble: 8
ldouble: 8
Function: Real part of "clog10_upward":
double: 8
float: 5
+float128: 4
idouble: 8
ifloat: 5
+ifloat128: 4
ildouble: 10
ldouble: 10
Function: Imaginary part of "clog10_upward":
double: 2
float: 4
+float128: 3
idouble: 2
ifloat: 4
+ifloat128: 3
ildouble: 7
ldouble: 7
Function: Real part of "clog_downward":
double: 7
float: 5
+float128: 3
idouble: 7
ifloat: 5
+ifloat128: 3
ildouble: 11
ldouble: 11
Function: Imaginary part of "clog_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: Real part of "clog_towardzero":
double: 7
float: 5
+float128: 3
idouble: 7
ifloat: 5
+ifloat128: 3
ildouble: 10
ldouble: 10
Function: Imaginary part of "clog_towardzero":
double: 1
float: 3
+float128: 2
idouble: 1
ifloat: 3
+ifloat128: 2
ildouble: 7
ldouble: 7
Function: Real part of "clog_upward":
double: 8
float: 5
+float128: 4
idouble: 8
ifloat: 5
+ifloat128: 4
ildouble: 10
ldouble: 10
Function: Imaginary part of "clog_upward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "cos":
-float: 1
-ifloat: 1
+double: 1
+float: 3
+float128: 1
+idouble: 1
+ifloat: 3
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: "cos_downward":
double: 1
-float: 2
+float: 4
+float128: 3
idouble: 1
-ifloat: 2
+ifloat: 4
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: "cos_towardzero":
double: 1
-float: 1
+float: 3
+float128: 1
idouble: 1
-ifloat: 1
+ifloat: 3
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: "cos_upward":
double: 1
-float: 2
+float: 3
+float128: 2
idouble: 1
-ifloat: 2
+ifloat: 3
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: "cosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "cosh_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cosh_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cosh_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: Real part of "cpow":
double: 2
float: 5
+float128: 4
idouble: 2
ifloat: 5
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "cpow":
float: 2
+float128: 1
ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: Real part of "cpow_downward":
double: 4
float: 8
+float128: 6
idouble: 4
ifloat: 8
+ifloat128: 6
ildouble: 7
ldouble: 7
Function: Imaginary part of "cpow_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Real part of "cpow_towardzero":
double: 4
float: 8
+float128: 6
idouble: 4
ifloat: 8
+ifloat128: 6
ildouble: 8
ldouble: 8
Function: Imaginary part of "cpow_towardzero":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Real part of "cpow_upward":
double: 4
float: 1
+float128: 3
idouble: 4
ifloat: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Imaginary part of "cpow_upward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csin":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ifloat128: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "csin":
+float128: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "csin_downward":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Imaginary part of "csin_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Real part of "csin_towardzero":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Imaginary part of "csin_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Real part of "csin_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csin_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "csinh":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "csinh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ifloat128: 1
+ildouble: 2
+ldouble: 2
Function: Real part of "csinh_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Imaginary part of "csinh_downward":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Real part of "csinh_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Imaginary part of "csinh_towardzero":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 6
ldouble: 6
Function: Real part of "csinh_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Imaginary part of "csinh_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csqrt":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "csqrt":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "csqrt_downward":
double: 5
float: 4
+float128: 4
idouble: 5
ifloat: 4
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "csqrt_downward":
double: 4
float: 3
+float128: 3
idouble: 4
ifloat: 3
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Real part of "csqrt_towardzero":
double: 4
float: 3
+float128: 3
idouble: 4
ifloat: 3
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Imaginary part of "csqrt_towardzero":
double: 4
float: 3
+float128: 3
idouble: 4
ifloat: 3
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Real part of "csqrt_upward":
double: 5
float: 4
+float128: 4
idouble: 5
ifloat: 4
+ifloat128: 4
ildouble: 12
ldouble: 12
Function: Imaginary part of "csqrt_upward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 8
ldouble: 8
Function: Real part of "ctan":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
+float128: 3
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Real part of "ctan_downward":
double: 6
float: 5
+float128: 4
idouble: 6
ifloat: 5
+ifloat128: 4
ildouble: 6
ldouble: 6
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
+float128: 5
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 5
ildouble: 9
ldouble: 9
Function: Real part of "ctan_towardzero":
double: 5
float: 3
+float128: 4
idouble: 5
ifloat: 3
+ifloat128: 4
ildouble: 6
ldouble: 6
Function: Imaginary part of "ctan_towardzero":
double: 2
float: 2
+float128: 5
idouble: 2
ifloat: 2
+ifloat128: 5
ildouble: 13
ldouble: 13
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
+float128: 5
idouble: 2
-ifloat: 3
+ifloat: 4
+ifloat128: 5
ildouble: 7
ldouble: 7
Function: Imaginary part of "ctan_upward":
double: 2
float: 3
+float128: 5
idouble: 2
ifloat: 3
+ifloat128: 5
ildouble: 10
ldouble: 10
Function: Real part of "ctanh":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Imaginary part of "ctanh":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
+float128: 5
idouble: 4
-ifloat: 1
+ifloat: 2
+ifloat128: 5
ildouble: 9
ldouble: 9
Function: Imaginary part of "ctanh_downward":
double: 6
float: 5
+float128: 4
idouble: 6
ifloat: 5
+ifloat128: 4
ildouble: 6
ldouble: 6
Function: Real part of "ctanh_towardzero":
double: 2
float: 2
+float128: 5
idouble: 2
ifloat: 2
+ifloat128: 5
ildouble: 13
ldouble: 13
Function: Imaginary part of "ctanh_towardzero":
double: 5
float: 2
+float128: 3
idouble: 5
ifloat: 2
+ifloat128: 3
ildouble: 10
ldouble: 10
Function: Real part of "ctanh_upward":
double: 2
float: 3
+float128: 5
idouble: 2
ifloat: 3
+ifloat128: 5
ildouble: 10
ldouble: 10
Function: Imaginary part of "ctanh_upward":
double: 2
float: 3
+float128: 5
idouble: 2
ifloat: 3
+ifloat128: 5
ildouble: 10
ldouble: 10
+Function: "div_ldouble":
+float: 1
+
Function: "erf":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "erf_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "erf_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "erf_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "erfc":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
-ildouble: 2
-ldouble: 2
+ifloat128: 2
+ildouble: 3
+ldouble: 3
Function: "erfc_downward":
double: 3
float: 4
+float128: 5
idouble: 3
ifloat: 4
+ifloat128: 5
ildouble: 10
ldouble: 10
Function: "erfc_towardzero":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 9
ldouble: 9
Function: "erfc_upward":
double: 3
float: 4
+float128: 5
idouble: 3
ifloat: 4
+ifloat128: 5
ildouble: 7
ldouble: 7
Function: "exp":
double: 1
-float: 1
+float128: 1
idouble: 1
-ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp10":
double: 2
+float128: 2
idouble: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "exp10_downward":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 9
ldouble: 9
Function: "exp10_towardzero":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 9
ldouble: 9
Function: "exp10_upward":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "exp2":
double: 1
-float: 1
+float128: 1
idouble: 1
-ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "exp2_downward":
double: 1
-float: 1
+float128: 1
idouble: 1
-ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp2_towardzero":
double: 1
-float: 1
+float128: 1
idouble: 1
-ifloat: 1
-ildouble: 1
-ldouble: 1
+ifloat128: 1
+ildouble: 2
+ldouble: 2
Function: "exp2_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 2
ldouble: 2
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 2
ldouble: 2
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "expm1":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "expm1_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "expm1_towardzero":
double: 1
float: 2
+float128: 4
idouble: 1
ifloat: 2
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "expm1_upward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
-ildouble: 4
-ldouble: 4
+ifloat128: 3
+ildouble: 6
+ldouble: 6
Function: "fma":
ildouble: 1
@@ -1670,299 +2095,387 @@ double: 4
float: 4
idouble: 4
ifloat: 4
-ildouble: 14
-ldouble: 14
+ildouble: 15
+ldouble: 15
Function: "gamma_towardzero":
double: 4
float: 3
idouble: 4
ifloat: 3
-ildouble: 14
-ldouble: 14
+ildouble: 16
+ldouble: 16
Function: "gamma_upward":
double: 4
float: 5
idouble: 4
ifloat: 5
-ildouble: 10
-ldouble: 10
+ildouble: 11
+ldouble: 11
Function: "hypot":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "hypot_downward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "hypot_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "hypot_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "j0":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
+float128: 4
idouble: 2
-ifloat: 3
+ifloat: 4
+ifloat128: 4
ildouble: 11
ldouble: 11
Function: "j0_towardzero":
double: 2
float: 1
+float128: 2
idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 8
ldouble: 8
Function: "j0_upward":
double: 3
float: 2
+float128: 5
idouble: 3
ifloat: 2
+ifloat128: 5
ildouble: 6
ldouble: 6
Function: "j1":
double: 1
float: 2
+float128: 4
idouble: 1
ifloat: 2
-ildouble: 1
-ldouble: 1
+ifloat128: 4
+ildouble: 2
+ldouble: 2
Function: "j1_downward":
double: 3
float: 2
+float128: 4
idouble: 3
ifloat: 2
+ifloat128: 4
ildouble: 7
ldouble: 7
Function: "j1_towardzero":
double: 3
float: 2
+float128: 4
idouble: 3
ifloat: 2
+ifloat128: 4
ildouble: 7
ldouble: 7
Function: "j1_upward":
double: 3
float: 4
+float128: 3
idouble: 3
ifloat: 4
+ifloat128: 3
ildouble: 6
ldouble: 6
Function: "jn":
double: 4
float: 4
+float128: 7
idouble: 4
ifloat: 4
+ifloat128: 7
ildouble: 4
ldouble: 4
Function: "jn_downward":
double: 4
float: 5
+float128: 8
idouble: 4
ifloat: 5
+ifloat128: 8
ildouble: 7
ldouble: 7
Function: "jn_towardzero":
double: 4
float: 5
+float128: 8
idouble: 4
ifloat: 5
+ifloat128: 8
ildouble: 7
ldouble: 7
Function: "jn_upward":
double: 5
float: 4
+float128: 7
idouble: 5
ifloat: 4
+ifloat128: 7
ildouble: 5
ldouble: 5
Function: "lgamma":
double: 3
float: 4
+float128: 5
idouble: 3
ifloat: 4
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: "lgamma_downward":
double: 4
float: 4
+float128: 8
idouble: 4
ifloat: 4
-ildouble: 14
-ldouble: 14
+ifloat128: 8
+ildouble: 15
+ldouble: 15
Function: "lgamma_towardzero":
double: 4
float: 3
+float128: 5
idouble: 4
ifloat: 3
-ildouble: 14
-ldouble: 14
+ifloat128: 5
+ildouble: 16
+ldouble: 16
Function: "lgamma_upward":
double: 4
float: 5
+float128: 8
idouble: 4
ifloat: 5
-ildouble: 10
-ldouble: 10
+ifloat128: 8
+ildouble: 11
+ldouble: 11
Function: "log":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log10":
double: 2
float: 2
+float128: 1
idouble: 2
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log10_downward":
double: 2
float: 3
+float128: 1
idouble: 2
ifloat: 3
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log10_towardzero":
double: 2
float: 2
+float128: 1
idouble: 2
ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "log10_upward":
double: 2
float: 2
+float128: 1
idouble: 2
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log1p":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "log1p_downward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "log1p_towardzero":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "log1p_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
-ildouble: 2
-ldouble: 2
+ifloat128: 2
+ildouble: 3
+ldouble: 3
Function: "log2":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "log2_downward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "log2_towardzero":
double: 2
float: 2
+float128: 1
idouble: 2
ifloat: 2
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: "log2_upward":
double: 3
float: 3
+float128: 1
idouble: 3
ifloat: 3
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: "log_downward":
float: 2
+float128: 1
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log_towardzero":
-float: 1
-ifloat: 1
+float: 2
+float128: 2
+ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "log_upward":
double: 1
-float: 1
+float: 2
+float128: 1
idouble: 1
-ifloat: 1
+ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
+Function: "mul_downward_ldouble":
+double: 1
+float: 1
+
+Function: "mul_ldouble":
+double: 1
+float: 1
+
+Function: "mul_towardzero_ldouble":
+double: 1
+float: 1
+
+Function: "mul_upward_ldouble":
+double: 1
+float: 1
+
Function: "nextafter_downward":
ildouble: 1
ldouble: 1
@@ -1972,154 +2485,162 @@ ildouble: 1
ldouble: 1
Function: "pow":
+double: 1
float: 1
+float128: 2
+idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
-Function: "pow10":
-double: 2
-idouble: 2
-ildouble: 1
-ldouble: 1
-
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 9
-ldouble: 9
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 9
-ldouble: 9
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 4
-ldouble: 4
-
Function: "pow_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "pow_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "pow_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "sin":
+double: 1
float: 1
+float128: 1
+idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "sin_downward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "sin_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "sin_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: "sincos":
+double: 1
float: 1
+float128: 1
+idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "sincos_downward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "sincos_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 7
ldouble: 7
Function: "sincos_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 7
ldouble: 7
Function: "sinh":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "sinh_downward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 6
ldouble: 6
Function: "sinh_towardzero":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 6
ldouble: 6
Function: "sinh_upward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 6
ldouble: 6
@@ -2139,193 +2660,245 @@ Function: "sqrt_upward":
ildouble: 1
ldouble: 1
-Function: "tan":
+Function: "sub_ldouble":
+double: 1
float: 1
-ifloat: 1
+
+Function: "tan":
+float: 3
+float128: 1
+ifloat: 3
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "tan_downward":
double: 1
-float: 2
+float: 3
+float128: 1
idouble: 1
-ifloat: 2
+ifloat: 3
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "tan_towardzero":
double: 1
-float: 1
+float: 3
+float128: 1
idouble: 1
-ifloat: 1
+ifloat: 3
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "tan_upward":
double: 1
-float: 1
+float: 3
+float128: 1
idouble: 1
-ifloat: 1
+ifloat: 3
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "tanh":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "tanh_downward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
-ildouble: 3
-ldouble: 3
+ifloat128: 4
+ildouble: 4
+ldouble: 4
Function: "tanh_towardzero":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
-ildouble: 3
-ldouble: 3
+ifloat128: 3
+ildouble: 4
+ldouble: 4
Function: "tanh_upward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 6
ldouble: 6
Function: "tgamma":
double: 5
float: 4
+float128: 4
idouble: 5
ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "tgamma_downward":
double: 5
float: 5
+float128: 5
idouble: 5
ifloat: 5
+ifloat128: 5
ildouble: 6
ldouble: 6
Function: "tgamma_towardzero":
double: 5
float: 4
+float128: 5
idouble: 5
ifloat: 4
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "tgamma_upward":
double: 4
float: 4
+float128: 4
idouble: 4
ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "y0":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "y0_downward":
double: 3
-float: 2
+float: 4
+float128: 4
idouble: 3
-ifloat: 2
+ifloat: 4
+ifloat128: 4
ildouble: 10
ldouble: 10
Function: "y0_towardzero":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 8
ldouble: 8
Function: "y0_upward":
double: 2
-float: 3
+float: 5
+float128: 3
idouble: 2
-ifloat: 3
+ifloat: 5
+ifloat128: 3
ildouble: 9
ldouble: 9
Function: "y1":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "y1_downward":
double: 3
float: 2
+float128: 4
idouble: 3
ifloat: 2
+ifloat128: 4
ildouble: 7
ldouble: 7
Function: "y1_towardzero":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 9
ldouble: 9
Function: "y1_upward":
double: 5
float: 2
+float128: 5
idouble: 5
ifloat: 2
+ifloat128: 5
ildouble: 9
ldouble: 9
Function: "yn":
double: 3
-float: 2
+float: 3
+float128: 5
idouble: 3
-ifloat: 2
+ifloat: 3
+ifloat128: 5
ildouble: 2
ldouble: 2
Function: "yn_downward":
double: 3
-float: 2
+float: 4
+float128: 5
idouble: 3
-ifloat: 2
+ifloat: 4
+ifloat128: 5
ildouble: 10
ldouble: 10
Function: "yn_towardzero":
double: 3
float: 3
+float128: 5
idouble: 3
ifloat: 3
+ifloat128: 5
ildouble: 8
ldouble: 8
Function: "yn_upward":
double: 4
-float: 3
+float: 5
+float128: 5
idouble: 4
-ifloat: 3
+ifloat: 5
+ifloat128: 5
ildouble: 9
ldouble: 9
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/fpu/math-barriers.h b/sysdeps/powerpc/fpu/math-barriers.h
new file mode 100644
index 0000000000..6da210219e
--- /dev/null
+++ b/sysdeps/powerpc/fpu/math-barriers.h
@@ -0,0 +1,28 @@
+/* Control when floating-point expressions are evaluated. PowerPC version.
+ Copyright (C) 2017-2018 Free Software 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 POWERPC_MATH_BARRIERS_H
+#define POWERPC_MATH_BARRIERS_H 1
+
+/* Avoid putting floating point values in memory. */
+# define math_opt_barrier(x) \
+ ({ __typeof (x) __x = (x); __asm ("" : "+dwa" (__x)); __x; })
+# define math_force_eval(x) \
+ ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "dwa" (__x)); })
+
+#endif
diff --git a/sysdeps/powerpc/fpu/math_ldbl.h b/sysdeps/powerpc/fpu/math_ldbl.h
index 36378c0239..124391b94b 100644
--- a/sysdeps/powerpc/fpu/math_ldbl.h
+++ b/sysdeps/powerpc/fpu/math_ldbl.h
@@ -1,6 +1,23 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+/* Manipulation of the bit representation of 'long double' quantities.
+ Copyright (C) 2006-2018 Free Software 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_LDBL_H_PPC_
+#define _MATH_LDBL_H_PPC_ 1
/* GCC does not optimize the default ldbl_pack code to not spill register
in the stack. The following optimization tells gcc that pack/unpack
@@ -34,3 +51,5 @@ ldbl_unpack_ppc (long double l, double *a, double *aa)
#define ldbl_unpack ldbl_unpack_ppc
#include <sysdeps/ieee754/ldbl-128ibm/math_ldbl.h>
+
+#endif /* math_ldbl.h */
diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h
index d90327c4af..e642d6c823 100644
--- a/sysdeps/powerpc/fpu/math_private.h
+++ b/sysdeps/powerpc/fpu/math_private.h
@@ -1,5 +1,5 @@
/* Private inline math functions for powerpc.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,38 +23,19 @@
#include <ldsodefs.h>
#include <dl-procinfo.h>
#include <fenv_private.h>
+
#include_next <math_private.h>
-extern double __slow_ieee754_sqrt (double);
-extern __always_inline double
-__ieee754_sqrt (double __x)
+#if defined _ARCH_PWR9 && __HAVE_DISTINCT_FLOAT128
+extern __always_inline _Float128
+__ieee754_sqrtf128 (_Float128 __x)
{
- double __z;
-
-#ifdef _ARCH_PPCSQ
- asm ("fsqrt %0,%1" : "=f" (__z) : "f" (__x));
-#else
- __z = __slow_ieee754_sqrt(__x);
-#endif
-
+ _Float128 __z;
+ asm ("xssqrtqp %0,%1" : "=v" (__z) : "v" (__x));
return __z;
}
-
-extern float __slow_ieee754_sqrtf (float);
-extern __always_inline float
-__ieee754_sqrtf (float __x)
-{
- float __z;
-
-#ifdef _ARCH_PPCSQ
- asm ("fsqrts %0,%1" : "=f" (__z) : "f" (__x));
-#else
- __z = __slow_ieee754_sqrtf(__x);
#endif
- return __z;
-}
-
#if defined _ARCH_PWR5X
# ifndef __round
diff --git a/sysdeps/powerpc/fpu/s_cosf.c b/sysdeps/powerpc/fpu/s_cosf.c
index eaeaebcb12..9423eb9c35 100644
--- a/sysdeps/powerpc/fpu/s_cosf.c
+++ b/sysdeps/powerpc/fpu/s_cosf.c
@@ -1,5 +1,5 @@
/* s_cosf.c -- float version of s_cos.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -20,6 +20,7 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
static const float pio4 = 7.8539801e-1;
@@ -66,4 +67,4 @@ __cosf (float x)
}
}
-weak_alias (__cosf, cosf)
+libm_alias_float (__cos, cos)
diff --git a/sysdeps/powerpc/fpu/s_fabs.S b/sysdeps/powerpc/fpu/s_fabs.S
index 145b3e22ed..01fb5829cd 100644
--- a/sysdeps/powerpc/fpu/s_fabs.S
+++ b/sysdeps/powerpc/fpu/s_fabs.S
@@ -1,5 +1,5 @@
/* Floating-point absolute value. PowerPC version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,8 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
ENTRY(__fabs)
/* double [f1] fabs (double [f1] x); */
@@ -24,13 +26,8 @@ ENTRY(__fabs)
blr
END(__fabs)
-weak_alias (__fabs,fabs)
+libm_alias_double (__fabs, fabs)
/* It turns out that it's safe to use this code even for single-precision. */
strong_alias(__fabs,__fabsf)
-weak_alias (__fabs,fabsf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__fabs,__fabsl)
-weak_alias (__fabs,fabsl)
-#endif
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/powerpc/fpu/s_fdim.c b/sysdeps/powerpc/fpu/s_fdim.c
deleted file mode 100644
index 1d4b6d0665..0000000000
--- a/sysdeps/powerpc/fpu/s_fdim.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Return positive difference between arguments.
- 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 <math.h>
-
-double
-__fdim (double x, double y)
-{
- return x <= y ? 0 : x - y;
-}
-weak_alias (__fdim, fdim)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fdim, __fdiml)
-weak_alias (__fdim, fdiml)
-#endif
diff --git a/sysdeps/powerpc/fpu/s_fdimf.c b/sysdeps/powerpc/fpu/s_fdimf.c
deleted file mode 100644
index 8c645c413a..0000000000
--- a/sysdeps/powerpc/fpu/s_fdimf.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Return positive difference between arguments.
- 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 <math.h>
-
-float
-__fdimf (float x, float y)
-{
- return x <= y ? 0 : x - y;
-}
-weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/powerpc/fpu/s_float_bitwise.h b/sysdeps/powerpc/fpu/s_float_bitwise.h
index 7eed88c09a..6608692096 100644
--- a/sysdeps/powerpc/fpu/s_float_bitwise.h
+++ b/sysdeps/powerpc/fpu/s_float_bitwise.h
@@ -1,5 +1,5 @@
/* Bitwise manipulation over float. Function prototypes.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
diff --git a/sysdeps/powerpc/fpu/s_fma.S b/sysdeps/powerpc/fpu/s_fma.S
index 1ce2eaaac1..23311bb8fd 100644
--- a/sysdeps/powerpc/fpu/s_fma.S
+++ b/sysdeps/powerpc/fpu/s_fma.S
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation. PowerPC version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software 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,16 +17,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
-ENTRY(__fma)
+ENTRY_TOCLESS(__fma)
/* double [f1] fma (double [f1] x, double [f2] y, double [f3] z); */
fmadd fp1,fp1,fp2,fp3
blr
END(__fma)
-weak_alias (__fma,fma)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__fma,__fmal)
-weak_alias (__fma,fmal)
-#endif
+libm_alias_double (__fma, fma)
diff --git a/sysdeps/powerpc/fpu/s_fmaf.S b/sysdeps/powerpc/fpu/s_fmaf.S
index 6450a1a235..f0b070b748 100644
--- a/sysdeps/powerpc/fpu/s_fmaf.S
+++ b/sysdeps/powerpc/fpu/s_fmaf.S
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation. PowerPC version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software 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,11 +17,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
-ENTRY(__fmaf)
+ENTRY_TOCLESS(__fmaf)
/* float [f1] fmaf (float [f1] x, float [f2] y, float [f3] z); */
fmadds fp1,fp1,fp2,fp3
blr
END(__fmaf)
-weak_alias (__fmaf,fmaf)
+libm_alias_float (__fma, fma)
diff --git a/sysdeps/powerpc/fpu/s_fmax.S b/sysdeps/powerpc/fpu/s_fmax.S
deleted file mode 100644
index 75ee74c316..0000000000
--- a/sysdeps/powerpc/fpu/s_fmax.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Floating-point maximum. PowerPC version.
- 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 <sysdep.h>
-
-ENTRY(__fmax)
-/* double [f1] fmax (double [f1] x, double [f2] y); */
- fcmpu cr0,fp1,fp2
- blt cr0,0f /* if x < y, neither x nor y can be NaN... */
- bnulr+ cr0
-/* x and y are unordered, so one of x or y must be a NaN... */
- fcmpu cr1,fp2,fp2
- bunlr cr1
-0: fmr fp1,fp2
- blr
-END(__fmax)
-
-weak_alias (__fmax,fmax)
-
-/* It turns out that it's safe to use this code even for single-precision. */
-strong_alias(__fmax,__fmaxf)
-weak_alias (__fmax,fmaxf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__fmax,__fmaxl)
-weak_alias (__fmax,fmaxl)
-#endif
diff --git a/sysdeps/powerpc/fpu/s_fmaxf.S b/sysdeps/powerpc/fpu/s_fmaxf.S
deleted file mode 100644
index 3c2d62bb81..0000000000
--- a/sysdeps/powerpc/fpu/s_fmaxf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* __fmaxf is in s_fmax.c */
diff --git a/sysdeps/powerpc/fpu/s_fmin.S b/sysdeps/powerpc/fpu/s_fmin.S
deleted file mode 100644
index 4d7c3b4fbc..0000000000
--- a/sysdeps/powerpc/fpu/s_fmin.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Floating-point minimum. PowerPC version.
- 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 <sysdep.h>
-
-ENTRY(__fmin)
-/* double [f1] fmin (double [f1] x, double [f2] y); */
- fcmpu cr0,fp1,fp2
- bgt cr0,0f /* if x > y, neither x nor y can be NaN... */
- bnulr+ cr0
-/* x and y are unordered, so one of x or y must be a NaN... */
- fcmpu cr1,fp2,fp2
- bunlr cr1
-0: fmr fp1,fp2
- blr
-END(__fmin)
-
-weak_alias (__fmin,fmin)
-
-/* It turns out that it's safe to use this code even for single-precision. */
-strong_alias(__fmin,__fminf)
-weak_alias (__fmin,fminf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__fmin,__fminl)
-weak_alias (__fmin,fminl)
-#endif
diff --git a/sysdeps/powerpc/fpu/s_fminf.S b/sysdeps/powerpc/fpu/s_fminf.S
deleted file mode 100644
index 10ab7fe53c..0000000000
--- a/sysdeps/powerpc/fpu/s_fminf.S
+++ /dev/null
@@ -1 +0,0 @@
-/* __fminf is in s_fmin.c */
diff --git a/sysdeps/powerpc/fpu/s_isnan.c b/sysdeps/powerpc/fpu/s_isnan.c
index 47d73000af..9bf8a78b1b 100644
--- a/sysdeps/powerpc/fpu/s_isnan.c
+++ b/sysdeps/powerpc/fpu/s_isnan.c
@@ -1,5 +1,5 @@
/* Return 1 if argument is a NaN, else 0.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/fpu/s_rint.c b/sysdeps/powerpc/fpu/s_rint.c
index f0b16e567b..7a0cefd2a0 100644
--- a/sysdeps/powerpc/fpu/s_rint.c
+++ b/sysdeps/powerpc/fpu/s_rint.c
@@ -1,5 +1,5 @@
/* Round a 64-bit floating point value to the nearest integer.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-double.h>
double
__rint (double x)
@@ -39,8 +40,4 @@ __rint (double x)
return x;
}
-weak_alias (__rint, rint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
-#endif
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/powerpc/fpu/s_rintf.c b/sysdeps/powerpc/fpu/s_rintf.c
index b2e5016c9f..8752834a54 100644
--- a/sysdeps/powerpc/fpu/s_rintf.c
+++ b/sysdeps/powerpc/fpu/s_rintf.c
@@ -1,5 +1,5 @@
/* Round a 32-bit floating point value to the nearest integer.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-float.h>
float
__rintf (float x)
@@ -39,4 +40,4 @@ __rintf (float x)
return x;
}
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/powerpc/fpu/s_sinf.c b/sysdeps/powerpc/fpu/s_sinf.c
index eabf12b891..555a81b030 100644
--- a/sysdeps/powerpc/fpu/s_sinf.c
+++ b/sysdeps/powerpc/fpu/s_sinf.c
@@ -1,5 +1,5 @@
/* s_sinf.c -- float version of s_sin.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -20,6 +20,7 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
static const float pio4 = 7.8539801e-1;
@@ -66,4 +67,4 @@ __sinf (float x)
}
}
-weak_alias (__sinf, sinf)
+libm_alias_float (__sin, sin)
diff --git a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
index 05421f068e..4b25ec3e40 100644
--- a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
+++ b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ryan S. Arnold <rsa@us.ibm.com>
Sean Curry <spcurry@us.ibm.com>
@@ -23,11 +23,11 @@
#include <string.h>
#include <ucontext.h>
#include <unistd.h>
-#include <malloc.h>
#include <link.h>
#include <elf.h>
-#include <sysdep.h>
#include <fpu_control.h>
+#include <sys/auxv.h>
+#include <support/support.h>
static ucontext_t ctx[3];
@@ -59,7 +59,7 @@ ElfW(Addr) query_auxv(int type)
perror("Error opening file for reading");
return 0;
}
- auxv = (ElfW(auxv_t) *)malloc(getpagesize());
+ auxv = xmalloc (getpagesize ());
do
{
diff --git a/sysdeps/powerpc/fpu_control.h b/sysdeps/powerpc/fpu_control.h
index 35e4298266..9d0698b4fc 100644
--- a/sysdeps/powerpc/fpu_control.h
+++ b/sysdeps/powerpc/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word definitions. PowerPC version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/gccframe.h b/sysdeps/powerpc/gccframe.h
index e8e751675f..60116a2ed7 100644
--- a/sysdeps/powerpc/gccframe.h
+++ b/sysdeps/powerpc/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. powerpc version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/hwcapinfo.c b/sysdeps/powerpc/hwcapinfo.c
index 31a7c5d5d5..a09b183093 100644
--- a/sysdeps/powerpc/hwcapinfo.c
+++ b/sysdeps/powerpc/hwcapinfo.c
@@ -1,5 +1,5 @@
/* powerpc HWCAP/HWCAP2 and AT_PLATFORM data pre-processing.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/hwcapinfo.h b/sysdeps/powerpc/hwcapinfo.h
index 67840772a3..b53fad1beb 100644
--- a/sysdeps/powerpc/hwcapinfo.h
+++ b/sysdeps/powerpc/hwcapinfo.h
@@ -1,5 +1,5 @@
/* powerpc HWCAP/HWCAP2 and AT_PLATFORM data pre-processing.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/ifunc-sel.h b/sysdeps/powerpc/ifunc-sel.h
index 526d8ed88b..7112bed22c 100644
--- a/sysdeps/powerpc/ifunc-sel.h
+++ b/sysdeps/powerpc/ifunc-sel.h
@@ -4,7 +4,8 @@
extern int global;
-static inline void *
+static inline __attribute__ ((always_inline)) void *
+inhibit_stack_protector
ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
{
register void *ret __asm__ ("r3");
@@ -17,19 +18,22 @@ ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
"addis %0,11,%2-1b@ha\n\t"
"addi %0,%0,%2-1b@l\n\t"
"cmpwi 12,1\n\t"
- "beqlr\n\t"
+ "beq 2f\n\t"
"addis %0,11,%3-1b@ha\n\t"
"addi %0,%0,%3-1b@l\n\t"
"cmpwi 12,-1\n\t"
- "beqlr\n\t"
+ "beq 2f\n\t"
"addis %0,11,%4-1b@ha\n\t"
- "addi %0,%0,%4-1b@l"
+ "addi %0,%0,%4-1b@l\n\t"
+ "2:"
: "=r" (ret)
- : "X" (&global), "X" (f1), "X" (f2), "X" (f3));
+ : "i" (&global), "i" (f1), "i" (f2), "i" (f3)
+ : "11", "12", "cr0");
return ret;
}
-static inline void *
+static inline __attribute__ ((always_inline)) void *
+inhibit_stack_protector
ifunc_one (int (*f1) (void))
{
register void *ret __asm__ ("r3");
@@ -40,7 +44,8 @@ ifunc_one (int (*f1) (void))
"addis %0,%0,%1-1b@ha\n\t"
"addi %0,%0,%1-1b@l"
: "=r" (ret)
- : "X" (f1));
+ : "i" (f1)
+ : "12");
return ret;
}
#endif
diff --git a/sysdeps/powerpc/jmpbuf-offsets.h b/sysdeps/powerpc/jmpbuf-offsets.h
index 370ed8182e..a974360038 100644
--- a/sysdeps/powerpc/jmpbuf-offsets.h
+++ b/sysdeps/powerpc/jmpbuf-offsets.h
@@ -1,5 +1,5 @@
/* Private macros for accessing __jmp_buf contents. PowerPC version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/jmpbuf-unwind.h b/sysdeps/powerpc/jmpbuf-unwind.h
index b50ecd5124..cb10cd2584 100644
--- a/sysdeps/powerpc/jmpbuf-unwind.h
+++ b/sysdeps/powerpc/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/powerpc/ldsodefs.h b/sysdeps/powerpc/ldsodefs.h
index 83ff1be48a..2a981d888d 100644
--- a/sysdeps/powerpc/ldsodefs.h
+++ b/sysdeps/powerpc/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#define _POWERPC_LDSODEFS_H 1
#include <elf.h>
+#include <cpu-features.h>
struct La_ppc32_regs;
struct La_ppc32_retval;
diff --git a/sysdeps/powerpc/libc-tls.c b/sysdeps/powerpc/libc-tls.c
index c55cb03493..a2554e0819 100644
--- a/sysdeps/powerpc/libc-tls.c
+++ b/sysdeps/powerpc/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. PowerPC version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/locale-defines.sym b/sysdeps/powerpc/locale-defines.sym
index af64b920a4..5c5379c39f 100644
--- a/sysdeps/powerpc/locale-defines.sym
+++ b/sysdeps/powerpc/locale-defines.sym
@@ -3,3 +3,7 @@
--
LOCALE_CTYPE_TOLOWER offsetof (struct __locale_struct, __ctype_tolower)
+LOCALE_CTYPE_TOUPPER offsetof (struct __locale_struct, __ctype_toupper)
+_NL_CTYPE_NONASCII_CASE
+LOCALE_DATA_VALUES offsetof (struct __locale_data, values)
+SIZEOF_VALUES sizeof (((struct __locale_data *) 0)->values[0])
diff --git a/sysdeps/powerpc/longjmp.c b/sysdeps/powerpc/longjmp.c
index fdee5a781f..e34115844f 100644
--- a/sysdeps/powerpc/longjmp.c
+++ b/sysdeps/powerpc/longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/machine-gmon.h b/sysdeps/powerpc/machine-gmon.h
index be0b18ccd3..8e34f24294 100644
--- a/sysdeps/powerpc/machine-gmon.h
+++ b/sysdeps/powerpc/machine-gmon.h
@@ -1,5 +1,5 @@
/* PowerPC-specific implementation of profiling support.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/math-tests.h b/sysdeps/powerpc/math-tests.h
index 31042fa5b6..cf8adccefd 100644
--- a/sysdeps/powerpc/math-tests.h
+++ b/sysdeps/powerpc/math-tests.h
@@ -1,5 +1,5 @@
/* Configuration for math tests. PowerPC version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,4 +24,10 @@
<http://gcc.gnu.org/PR56828>. */
#define SNAN_TESTS_TYPE_CAST 0
+#ifndef __NO_FPRS__
+/* Setting exception flags in FPSCR results in enabled traps for those
+ exceptions being taken. */
+# define EXCEPTION_SET_FORCES_TRAP 1
+#endif
+
#include_next <math-tests.h>
diff --git a/sysdeps/powerpc/memusage.h b/sysdeps/powerpc/memusage.h
index 84f3664d69..41048f26a4 100644
--- a/sysdeps/powerpc/memusage.h
+++ b/sysdeps/powerpc/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/mod-tlsopt-powerpc.c b/sysdeps/powerpc/mod-tlsopt-powerpc.c
new file mode 100644
index 0000000000..ee0db12a73
--- /dev/null
+++ b/sysdeps/powerpc/mod-tlsopt-powerpc.c
@@ -0,0 +1,49 @@
+/* shared library to test for __tls_get_addr optimization. */
+#include <stdio.h>
+
+#include "../../elf/tls-macros.h"
+#include "dl-tls.h"
+
+/* common 'int' variable in TLS. */
+COMMON_INT_DEF(foo);
+
+
+int
+tls_get_addr_opt_test (void)
+{
+ int result = 0;
+
+ /* Get variable using general dynamic model. */
+ int *ap = TLS_GD (foo);
+ if (*ap != 0)
+ {
+ printf ("foo = %d\n", *ap);
+ result = 1;
+ }
+
+ tls_index *tls_arg;
+#ifdef __powerpc64__
+ register unsigned long thread_pointer __asm__ ("r13");
+ asm ("addi %0,2,foo@got@tlsgd" : "=r" (tls_arg));
+#else
+ register unsigned long thread_pointer __asm__ ("r2");
+ asm ("bcl 20,31,1f\n1:\t"
+ "mflr %0\n\t"
+ "addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t"
+ "addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t"
+ "addi %0,%0,foo@got@tlsgd" : "=b" (tls_arg));
+#endif
+
+ if (tls_arg->ti_module != 0)
+ {
+ printf ("tls_index not optimized, binutils too old?\n");
+ result = 1;
+ }
+ else if (tls_arg->ti_offset + thread_pointer != (unsigned long) ap)
+ {
+ printf ("tls_index->ti_offset wrong value\n");
+ result = 1;
+ }
+
+ return result;
+}
diff --git a/sysdeps/powerpc/nofpu/Makefile b/sysdeps/powerpc/nofpu/Makefile
index 99761ef7f0..80c762ebdf 100644
--- a/sysdeps/powerpc/nofpu/Makefile
+++ b/sysdeps/powerpc/nofpu/Makefile
@@ -2,6 +2,7 @@
ifeq ($(subdir),soft-fp)
sysdep_routines += $(gcc-single-routines) $(gcc-double-routines) \
+ sqrtsf2 sqrtdf2 \
sim-full atomic-feholdexcept atomic-feclearexcept \
atomic-feupdateenv flt-rounds
endif
@@ -15,18 +16,38 @@ CPPFLAGS += -I../soft-fp/
# gcc-4.1.1 and may be too late for gcc-4.2. So we need these flags
# until the fix in a gcc release and glibc drops support for earlier
# versions of gcc.
+#
+# This bug can cause wrong signs of zero results from fabsl, and
+# spurious "invalid" exceptions from comparisons with NaN in the
+# default code sequence generated. The fpclassify expansion used by
+# __builtin_fpclassify, which is used in the absence of
+# -fsignaling-nans, uses __builtin_fabsl, and is not affected by
+# -fno-builtin-fabsl, so requiring -fsignaling-nans for some affected
+# source files.
CFLAGS-e_atan2l.c += -fno-builtin-fabsl
CFLAGS-e_hypotl.c += -fno-builtin-fabsl
CFLAGS-e_powl.c += -fno-builtin-fabsl
-CFLAGS-s_ccoshl.c += -fno-builtin-fabsl
-CFLAGS-s_csinhl.c += -fno-builtin-fabsl
-CFLAGS-s_clogl.c += -fno-builtin-fabsl
-CFLAGS-s_clog10l.c += -fno-builtin-fabsl
-CFLAGS-s_csinl.c += -fno-builtin-fabsl
-CFLAGS-s_csqrtl.c += -fno-builtin-fabsl
-CFLAGS-w_acosl.c += -fno-builtin-fabsl
-CFLAGS-w_asinl.c += -fno-builtin-fabsl
-CFLAGS-w_atanhl.c += -fno-builtin-fabsl
-CFLAGS-w_j0l.c += -fno-builtin-fabsl
-CFLAGS-w_j1l.c += -fno-builtin-fabsl
+CFLAGS-s_cacosl.c += -fsignaling-nans
+CFLAGS-s_cacoshl.c += -fsignaling-nans
+CFLAGS-s_casinhl.c += -fsignaling-nans
+CFLAGS-s_catanl.c += -fsignaling-nans
+CFLAGS-s_catanhl.c += -fsignaling-nans
+CFLAGS-s_ccoshl.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-s_cexpl.c += -fsignaling-nans
+CFLAGS-s_csinhl.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-s_clogl.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-s_clog10l.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-s_csinl.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-s_csqrtl.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-w_acosl_compat.c += -fno-builtin-fabsl
+CFLAGS-w_asinl_compat.c += -fno-builtin-fabsl
+CFLAGS-w_atanhl_compat.c += -fno-builtin-fabsl
+CFLAGS-w_j0l_compat.c += -fno-builtin-fabsl
+CFLAGS-w_j1l_compat.c += -fno-builtin-fabsl
+CFLAGS-e_lgammal_r.c += -fno-builtin-fabsl
+CFLAGS-e_log10l.c += -fno-builtin-fabsl
+CFLAGS-e_log2l.c += -fno-builtin-fabsl
+CFLAGS-e_remainderl.c += -fno-builtin-fabsl
+CFLAGS-s_fmaxmagl.c += -fno-builtin-fabsl
+CFLAGS-s_fminmagl.c += -fno-builtin-fabsl
endif
diff --git a/sysdeps/powerpc/nofpu/atomic-feclearexcept.c b/sysdeps/powerpc/nofpu/atomic-feclearexcept.c
index cf1ee9b47a..fd19b69878 100644
--- a/sysdeps/powerpc/nofpu/atomic-feclearexcept.c
+++ b/sysdeps/powerpc/nofpu/atomic-feclearexcept.c
@@ -1,5 +1,5 @@
/* Clear floating-point exceptions for atomic compound assignment.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/nofpu/atomic-feholdexcept.c b/sysdeps/powerpc/nofpu/atomic-feholdexcept.c
index ba3d6878ab..563a0ddf92 100644
--- a/sysdeps/powerpc/nofpu/atomic-feholdexcept.c
+++ b/sysdeps/powerpc/nofpu/atomic-feholdexcept.c
@@ -1,6 +1,6 @@
/* Store current floating-point environment and clear exceptions for
atomic compound assignment.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/nofpu/atomic-feupdateenv.c b/sysdeps/powerpc/nofpu/atomic-feupdateenv.c
index 40ddad213d..46a1763671 100644
--- a/sysdeps/powerpc/nofpu/atomic-feupdateenv.c
+++ b/sysdeps/powerpc/nofpu/atomic-feupdateenv.c
@@ -1,6 +1,6 @@
/* Install given floating-point environment and raise exceptions for
atomic compound assignment.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/nofpu/fclrexcpt.c b/sysdeps/powerpc/nofpu/fclrexcpt.c
index 716eb0cce7..1a4c712cd8 100644
--- a/sysdeps/powerpc/nofpu/fclrexcpt.c
+++ b/sysdeps/powerpc/nofpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear floating-point exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fedisblxcpt.c b/sysdeps/powerpc/nofpu/fedisblxcpt.c
index 5e01bc91d8..abf9e3cc90 100644
--- a/sysdeps/powerpc/nofpu/fedisblxcpt.c
+++ b/sysdeps/powerpc/nofpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/feenablxcpt.c b/sysdeps/powerpc/nofpu/feenablxcpt.c
index 81665d49ed..084e69d310 100644
--- a/sysdeps/powerpc/nofpu/feenablxcpt.c
+++ b/sysdeps/powerpc/nofpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fegetenv.c b/sysdeps/powerpc/nofpu/fegetenv.c
index 03b2d95513..fe96f60acf 100644
--- a/sysdeps/powerpc/nofpu/fegetenv.c
+++ b/sysdeps/powerpc/nofpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002, 2010.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fegetexcept.c b/sysdeps/powerpc/nofpu/fegetexcept.c
index 3849a11e15..b5468b5e72 100644
--- a/sysdeps/powerpc/nofpu/fegetexcept.c
+++ b/sysdeps/powerpc/nofpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get floating-point exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fegetmode.c b/sysdeps/powerpc/nofpu/fegetmode.c
new file mode 100644
index 0000000000..7c896105d9
--- /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-2018 Free Software 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/fegetround.c b/sysdeps/powerpc/nofpu/fegetround.c
index 69b861d2c8..eb329c97a0 100644
--- a/sysdeps/powerpc/nofpu/fegetround.c
+++ b/sysdeps/powerpc/nofpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding mode (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/feholdexcpt.c b/sysdeps/powerpc/nofpu/feholdexcpt.c
index bcfd7c4040..40345847f2 100644
--- a/sysdeps/powerpc/nofpu/feholdexcpt.c
+++ b/sysdeps/powerpc/nofpu/feholdexcpt.c
@@ -1,6 +1,6 @@
/* Store current floating-point environment and clear exceptions
(soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fenv_const.c b/sysdeps/powerpc/nofpu/fenv_const.c
index ebf5c68fc5..367fc9e6c7 100644
--- a/sysdeps/powerpc/nofpu/fenv_const.c
+++ b/sysdeps/powerpc/nofpu/fenv_const.c
@@ -1,5 +1,5 @@
/* Constants for fenv_bits.h (soft float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
@@ -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/sysdeps/powerpc/nofpu/fesetenv.c b/sysdeps/powerpc/nofpu/fesetenv.c
index 6512da095c..fd7c3b4ed3 100644
--- a/sysdeps/powerpc/nofpu/fesetenv.c
+++ b/sysdeps/powerpc/nofpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Set floating point environment (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fesetexcept.c b/sysdeps/powerpc/nofpu/fesetexcept.c
new file mode 100644
index 0000000000..a3309ec435
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/fesetexcept.c
@@ -0,0 +1,28 @@
+/* Set given exception flags. PowerPC soft-float version.
+ Copyright (C) 2016-2018 Free Software 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-supp.h"
+
+int
+fesetexcept (int excepts)
+{
+ __sim_exceptions_thread |= (excepts & FE_ALL_EXCEPT);
+ SIM_SET_GLOBAL (__sim_exceptions_global, __sim_exceptions_thread);
+
+ return 0;
+}
diff --git a/sysdeps/powerpc/nofpu/fesetmode.c b/sysdeps/powerpc/nofpu/fesetmode.c
new file mode 100644
index 0000000000..88655ee15c
--- /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-2018 Free Software 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/fesetround.c b/sysdeps/powerpc/nofpu/fesetround.c
index 5995901e39..75b51aafb1 100644
--- a/sysdeps/powerpc/nofpu/fesetround.c
+++ b/sysdeps/powerpc/nofpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set rounding mode (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/feupdateenv.c b/sysdeps/powerpc/nofpu/feupdateenv.c
index 37a2314c5d..f576a4f4c6 100644
--- a/sysdeps/powerpc/nofpu/feupdateenv.c
+++ b/sysdeps/powerpc/nofpu/feupdateenv.c
@@ -1,6 +1,6 @@
/* Install given floating-point environment and raise exceptions
(soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fgetexcptflg.c b/sysdeps/powerpc/nofpu/fgetexcptflg.c
index 6b02690af2..331b81a643 100644
--- a/sysdeps/powerpc/nofpu/fgetexcptflg.c
+++ b/sysdeps/powerpc/nofpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/flt-rounds.c b/sysdeps/powerpc/nofpu/flt-rounds.c
index 23e3648f96..55419e1904 100644
--- a/sysdeps/powerpc/nofpu/flt-rounds.c
+++ b/sysdeps/powerpc/nofpu/flt-rounds.c
@@ -1,5 +1,5 @@
/* Return current rounding mode as correct value for FLT_ROUNDS.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/nofpu/fraiseexcpt.c b/sysdeps/powerpc/nofpu/fraiseexcpt.c
index d0a95d2417..c8a4024425 100644
--- a/sysdeps/powerpc/nofpu/fraiseexcpt.c
+++ b/sysdeps/powerpc/nofpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fsetexcptflg.c b/sysdeps/powerpc/nofpu/fsetexcptflg.c
index 2e180c82d7..467195d778 100644
--- a/sysdeps/powerpc/nofpu/fsetexcptflg.c
+++ b/sysdeps/powerpc/nofpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/ftestexcept.c b/sysdeps/powerpc/nofpu/ftestexcept.c
index 75fd27de0c..4b586a7457 100644
--- a/sysdeps/powerpc/nofpu/ftestexcept.c
+++ b/sysdeps/powerpc/nofpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test floating-point exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/get-rounding-mode.h b/sysdeps/powerpc/nofpu/get-rounding-mode.h
index a00cfcfd64..4a59577682 100644
--- a/sysdeps/powerpc/nofpu/get-rounding-mode.h
+++ b/sysdeps/powerpc/nofpu/get-rounding-mode.h
@@ -1,6 +1,6 @@
/* Determine floating-point rounding mode within libc. PowerPC
soft-float version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/nofpu/libm-test-ulps b/sysdeps/powerpc/nofpu/libm-test-ulps
index 41613421de..6c13a1852c 100644
--- a/sysdeps/powerpc/nofpu/libm-test-ulps
+++ b/sysdeps/powerpc/nofpu/libm-test-ulps
@@ -63,6 +63,10 @@ ifloat: 2
ildouble: 3
ldouble: 4
+Function: "add_ldouble":
+double: 1
+float: 1
+
Function: "asin":
float: 1
ifloat: 1
@@ -250,17 +254,17 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 1
ldouble: 1
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
ildouble: 6
ldouble: 6
@@ -274,12 +278,12 @@ ildouble: 8
ldouble: 8
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 6
-ldouble: 6
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "cacos_towardzero":
double: 5
@@ -298,17 +302,17 @@ ildouble: 4
ldouble: 4
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 8
-ldouble: 8
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 13
+ldouble: 13
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 1
ldouble: 1
@@ -330,10 +334,10 @@ ildouble: 8
ldouble: 8
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
ildouble: 6
ldouble: 6
@@ -346,28 +350,28 @@ ildouble: 8
ldouble: 8
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 6
-ldouble: 6
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh_upward":
double: 4
float: 4
idouble: 4
ifloat: 4
-ildouble: 8
-ldouble: 8
+ildouble: 12
+ldouble: 12
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 4
-ldouble: 4
+ildouble: 5
+ldouble: 5
Function: "carg":
float: 1
@@ -408,18 +412,18 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 1
ldouble: 1
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -448,25 +452,25 @@ ildouble: 8
ldouble: 8
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
ildouble: 6
ldouble: 6
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 8
-ldouble: 8
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 13
+ldouble: 13
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 1
ldouble: 1
@@ -489,9 +493,9 @@ ldouble: 8
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -512,72 +516,76 @@ ildouble: 5
ldouble: 5
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 8
-ldouble: 8
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 13
+ldouble: 13
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
ildouble: 6
ldouble: 6
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "catan":
double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
-ildouble: 5
-ldouble: 5
+ifloat: 2
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "catan_downward":
double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 6
-ldouble: 6
+ildouble: 7
+ldouble: 7
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
-ildouble: 6
-ldouble: 6
+ifloat: 2
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
Function: Real part of "catan_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 3
-ldouble: 3
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "catan_upward":
double: 3
@@ -592,14 +600,16 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 3
+ldouble: 3
Function: Real part of "catanh_downward":
double: 2
@@ -614,38 +624,40 @@ double: 1
float: 2
idouble: 1
ifloat: 2
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "catanh_towardzero":
double: 1
float: 2
idouble: 1
ifloat: 2
-ildouble: 6
-ldouble: 6
+ildouble: 7
+ldouble: 7
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
idouble: 4
-ifloat: 3
+ifloat: 4
ildouble: 8
ldouble: 8
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 3
-ldouble: 3
+ildouble: 6
+ldouble: 6
Function: "cbrt":
double: 3
@@ -903,9 +915,9 @@ ldouble: 2
Function: Real part of "clog10_downward":
double: 5
-float: 4
+float: 5
idouble: 5
-ifloat: 4
+ifloat: 5
ildouble: 8
ldouble: 8
@@ -998,7 +1010,9 @@ ildouble: 4
ldouble: 4
Function: "cos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 4
ldouble: 4
@@ -1061,9 +1075,9 @@ ldouble: 2
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
ildouble: 4
ldouble: 4
@@ -1317,9 +1331,9 @@ ldouble: 3
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -1333,9 +1347,9 @@ ldouble: 6
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 9
ldouble: 9
@@ -1357,9 +1371,9 @@ ldouble: 13
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 7
ldouble: 7
@@ -1373,9 +1387,9 @@ ldouble: 10
Function: Real part of "ctanh":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -1389,9 +1403,9 @@ ldouble: 3
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
idouble: 4
-ifloat: 1
+ifloat: 2
ildouble: 9
ldouble: 9
@@ -1435,6 +1449,9 @@ ifloat: 3
ildouble: 10
ldouble: 10
+Function: "div_ldouble":
+float: 1
+
Function: "erf":
double: 1
float: 1
@@ -1569,19 +1586,25 @@ ldouble: 2
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -1662,24 +1685,24 @@ double: 5
float: 4
idouble: 5
ifloat: 4
-ildouble: 14
-ldouble: 14
+ildouble: 15
+ldouble: 15
Function: "gamma_towardzero":
double: 5
float: 4
idouble: 5
ifloat: 4
-ildouble: 14
-ldouble: 14
+ildouble: 16
+ldouble: 16
Function: "gamma_upward":
double: 5
float: 5
idouble: 5
ifloat: 5
-ildouble: 10
-ldouble: 10
+ildouble: 11
+ldouble: 11
Function: "hypot":
double: 1
@@ -1715,9 +1738,9 @@ ldouble: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 11
ldouble: 11
@@ -1747,9 +1770,9 @@ ldouble: 1
Function: "j1_downward":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 6
ldouble: 6
@@ -1822,24 +1845,24 @@ double: 5
float: 4
idouble: 5
ifloat: 4
-ildouble: 14
-ldouble: 14
+ildouble: 15
+ldouble: 15
Function: "lgamma_towardzero":
double: 5
float: 4
idouble: 5
ifloat: 4
-ildouble: 14
-ldouble: 14
+ildouble: 16
+ldouble: 16
Function: "lgamma_upward":
double: 5
float: 5
idouble: 5
ifloat: 5
-ildouble: 10
-ldouble: 10
+ildouble: 11
+ldouble: 11
Function: "log":
float: 1
@@ -1963,6 +1986,22 @@ ifloat: 2
ildouble: 1
ldouble: 1
+Function: "mul_downward_ldouble":
+double: 1
+float: 1
+
+Function: "mul_ldouble":
+double: 1
+float: 1
+
+Function: "mul_towardzero_ldouble":
+double: 1
+float: 1
+
+Function: "mul_upward_ldouble":
+double: 1
+float: 1
+
Function: "nextafter_downward":
ildouble: 1
ldouble: 1
@@ -1972,41 +2011,13 @@ ildouble: 1
ldouble: 1
Function: "pow":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
-Function: "pow10":
-double: 2
-idouble: 2
-ildouble: 1
-ldouble: 1
-
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 9
-ldouble: 9
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 9
-ldouble: 9
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 4
-ldouble: 4
-
Function: "pow_downward":
double: 1
float: 1
@@ -2056,7 +2067,9 @@ ildouble: 1
ldouble: 1
Function: "sin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2086,7 +2099,9 @@ ildouble: 5
ldouble: 5
Function: "sincos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2163,6 +2178,10 @@ Function: "sqrt_upward":
ildouble: 1
ldouble: 1
+Function: "sub_ldouble":
+double: 1
+float: 1
+
Function: "tan":
float: 1
ifloat: 1
@@ -2267,9 +2286,9 @@ ldouble: 1
Function: "y0_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 10
ldouble: 10
@@ -2283,9 +2302,9 @@ ldouble: 8
Function: "y0_upward":
double: 3
-float: 4
+float: 5
idouble: 3
-ifloat: 4
+ifloat: 5
ildouble: 7
ldouble: 7
@@ -2323,17 +2342,17 @@ ldouble: 9
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 2
ldouble: 2
Function: "yn_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 10
ldouble: 10
@@ -2347,9 +2366,9 @@ ldouble: 8
Function: "yn_upward":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
ildouble: 5
ldouble: 5
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/soft-fp/sfp-machine.h b/sysdeps/powerpc/nofpu/sfp-machine.h
index d92a90e3e2..d92a90e3e2 100644
--- a/sysdeps/powerpc/soft-fp/sfp-machine.h
+++ b/sysdeps/powerpc/nofpu/sfp-machine.h
diff --git a/sysdeps/powerpc/nofpu/sim-full.c b/sysdeps/powerpc/nofpu/sim-full.c
index e8b9b32b17..223bf488f2 100644
--- a/sysdeps/powerpc/nofpu/sim-full.c
+++ b/sysdeps/powerpc/nofpu/sim-full.c
@@ -1,5 +1,5 @@
/* Software floating-point exception handling emulation.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/soft-supp.h b/sysdeps/powerpc/nofpu/soft-supp.h
index 24d238f28d..12af14f42c 100644
--- a/sysdeps/powerpc/nofpu/soft-supp.h
+++ b/sysdeps/powerpc/nofpu/soft-supp.h
@@ -1,5 +1,5 @@
/* Internal support stuff for complete soft float.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/sqrtdf2.c b/sysdeps/powerpc/nofpu/sqrtdf2.c
new file mode 100644
index 0000000000..50d1d26ceb
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/sqrtdf2.c
@@ -0,0 +1,53 @@
+/* Software floating-point emulation.
+ Return sqrt(a)
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com) and
+ Jakub Jelinek (jj@ultra.linux.cz).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser 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 "double.h"
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_3_2, GLIBC_2_28)
+DFtype
+__sqrtdf2 (DFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_D (A);
+ FP_DECL_D (R);
+ DFtype r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_D (A, a);
+ FP_SQRT_D (R, A);
+ FP_PACK_D (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
+compat_symbol (libc, __sqrtdf2, __sqrtdf2, GLIBC_2_3_2);
+#endif
diff --git a/sysdeps/powerpc/nofpu/sqrtsf2.c b/sysdeps/powerpc/nofpu/sqrtsf2.c
new file mode 100644
index 0000000000..8684f9631b
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/sqrtsf2.c
@@ -0,0 +1,53 @@
+/* Software floating-point emulation.
+ Return sqrt(a)
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com) and
+ Jakub Jelinek (jj@ultra.linux.cz).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser 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 "single.h"
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_3_2, GLIBC_2_28)
+SFtype
+__sqrtsf2 (SFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_S (A);
+ FP_DECL_S (R);
+ SFtype r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_S (A, a);
+ FP_SQRT_S (R, A);
+ FP_PACK_S (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
+compat_symbol (libc, __sqrtsf2, __sqrtsf2, GLIBC_2_3_2);
+#endif
diff --git a/sysdeps/powerpc/novmx-longjmp.c b/sysdeps/powerpc/novmx-longjmp.c
index 988dc1a95e..ac95d9ab0c 100644
--- a/sysdeps/powerpc/novmx-longjmp.c
+++ b/sysdeps/powerpc/novmx-longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/novmx-sigjmp.c b/sysdeps/powerpc/novmx-sigjmp.c
index b16c2def13..7acdd6fc09 100644
--- a/sysdeps/powerpc/novmx-sigjmp.c
+++ b/sysdeps/powerpc/novmx-sigjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/novmxsetjmp.h b/sysdeps/powerpc/novmxsetjmp.h
index ec9f0fc5c1..0a1f39a7cf 100644
--- a/sysdeps/powerpc/novmxsetjmp.h
+++ b/sysdeps/powerpc/novmxsetjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -54,7 +54,7 @@ typedef long int __jmp_buf[40];
typedef long int __jmp_buf[58];
# endif
-# include <bits/sigset.h> /* Get `__sigset_t'. */
+# include <bits/types/__sigset_t.h>
/* Calling environment, plus possibly a saved signal mask. */
typedef struct __novmx__jmp_buf_tag
diff --git a/sysdeps/powerpc/nptl/Makefile b/sysdeps/powerpc/nptl/Makefile
index 9ba2c6bed1..ddce0844fd 100644
--- a/sysdeps/powerpc/nptl/Makefile
+++ b/sysdeps/powerpc/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h b/sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..b6215d02f4
--- /dev/null
+++ b/sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,81 @@
+/* Machine-specific pthread type layouts. PowerPC version.
+ Copyright (C) 2003-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __SIZEOF_PTHREAD_MUTEX_T 40
+# define __SIZEOF_PTHREAD_ATTR_T 56
+# define __SIZEOF_PTHREAD_RWLOCK_T 56
+# define __SIZEOF_PTHREAD_BARRIER_T 32
+#else
+# define __SIZEOF_PTHREAD_MUTEX_T 24
+# define __SIZEOF_PTHREAD_ATTR_T 36
+# define __SIZEOF_PTHREAD_RWLOCK_T 32
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+#endif
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Definitions for internal mutex struct. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 1
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND (__WORDSIZE != 64)
+#define __PTHREAD_MUTEX_USE_UNION (__WORDSIZE != 64)
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+#if __WORDSIZE == 64
+ int __cur_writer;
+ int __shared;
+ unsigned char __rwelision;
+ unsigned char __pad1[7];
+ unsigned long int __pad2;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned int __flags;
+# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, {0, 0, 0, 0, 0, 0, 0 }
+#else
+ unsigned char __rwelision;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ int __cur_writer;
+# define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+#endif
+};
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/powerpc/nptl/elide.h b/sysdeps/powerpc/nptl/elide.h
index 77bd82ecba..f26bf3d382 100644
--- a/sysdeps/powerpc/nptl/elide.h
+++ b/sysdeps/powerpc/nptl/elide.h
@@ -1,5 +1,5 @@
/* elide.h: Generic lock elision support for powerpc.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,6 @@
#ifndef ELIDE_PPC_H
# define ELIDE_PPC_H
-#ifdef ENABLE_LOCK_ELISION
# include <htm.h>
# include <elision-conf.h>
@@ -102,6 +101,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;
}
@@ -111,12 +113,4 @@ __elide_unlock (int is_lock_free)
# define ELIDE_UNLOCK(is_lock_free) \
__elide_unlock (is_lock_free)
-# else
-
-# define ELIDE_LOCK(adapt_count, is_lock_free) 0
-# define ELIDE_TRYLOCK(adapt_count, is_lock_free, write) 0
-# define ELIDE_UNLOCK(is_lock_free) 0
-
-#endif /* ENABLE_LOCK_ELISION */
-
#endif
diff --git a/sysdeps/powerpc/nptl/pthread-offsets.h b/sysdeps/powerpc/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..bdda1f197e
--- /dev/null
+++ b/sysdeps/powerpc/nptl/pthread-offsets.h
@@ -0,0 +1,15 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __PTHREAD_MUTEX_NUSERS_OFFSET 12
+# define __PTHREAD_MUTEX_KIND_OFFSET 16
+# define __PTHREAD_MUTEX_SPINS_OFFSET 20
+# define __PTHREAD_MUTEX_ELISION_OFFSET 22
+# define __PTHREAD_MUTEX_LIST_OFFSET 24
+#else
+# define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+# define __PTHREAD_MUTEX_KIND_OFFSET 12
+# define __PTHREAD_MUTEX_SPINS_OFFSET 20
+# define __PTHREAD_MUTEX_ELISION_OFFSET 22
+# define __PTHREAD_MUTEX_LIST_OFFSET 20
+#endif
diff --git a/sysdeps/powerpc/nptl/pthread_spin_lock.c b/sysdeps/powerpc/nptl/pthread_spin_lock.c
index 2ae2d94f5b..858abee20c 100644
--- a/sysdeps/powerpc/nptl/pthread_spin_lock.c
+++ b/sysdeps/powerpc/nptl/pthread_spin_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
diff --git a/sysdeps/powerpc/nptl/pthread_spin_trylock.c b/sysdeps/powerpc/nptl/pthread_spin_trylock.c
index da31220725..2b106e3606 100644
--- a/sysdeps/powerpc/nptl/pthread_spin_trylock.c
+++ b/sysdeps/powerpc/nptl/pthread_spin_trylock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
diff --git a/sysdeps/powerpc/nptl/pthread_spin_unlock.c b/sysdeps/powerpc/nptl/pthread_spin_unlock.c
index 3251ccaa48..0a1ec2b5ac 100644
--- a/sysdeps/powerpc/nptl/pthread_spin_unlock.c
+++ b/sysdeps/powerpc/nptl/pthread_spin_unlock.c
@@ -1,5 +1,5 @@
/* pthread_spin_unlock -- unlock a spin lock. PowerPC version.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/nptl/pthreaddef.h b/sysdeps/powerpc/nptl/pthreaddef.h
index 33b73e1603..83416849ee 100644
--- a/sysdeps/powerpc/nptl/pthreaddef.h
+++ b/sysdeps/powerpc/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/nptl/tcb-offsets.sym b/sysdeps/powerpc/nptl/tcb-offsets.sym
index f580e69555..e5bb2b376d 100644
--- a/sysdeps/powerpc/nptl/tcb-offsets.sym
+++ b/sysdeps/powerpc/nptl/tcb-offsets.sym
@@ -13,7 +13,6 @@
#if TLS_MULTIPLE_THREADS_IN_TCB
MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
#endif
-PID thread_offsetof (pid)
TID thread_offsetof (tid)
POINTER_GUARD (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
TAR_SAVE (offsetof (tcbhead_t, tar_save) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
@@ -28,6 +27,3 @@ TCB_AT_PLATFORM (offsetof (tcbhead_t, at_platform) - TLS_TCB_OFFSET - sizeof(t
PADDING (offsetof (tcbhead_t, padding) - TLS_TCB_OFFSET - sizeof(tcbhead_t))
#endif
TCB_HWCAP (offsetof (tcbhead_t, hwcap) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
-#ifndef __ASSUME_PRIVATE_FUTEX
-PRIVATE_FUTEX_OFFSET thread_offsetof (header.private_futex)
-#endif
diff --git a/sysdeps/powerpc/nptl/tls.h b/sysdeps/powerpc/nptl/tls.h
index 0e889bc122..f88fed5ecf 100644
--- a/sysdeps/powerpc/nptl/tls.h
+++ b/sysdeps/powerpc/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/PowerPC version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,17 +25,7 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
@@ -246,6 +236,7 @@ register void *__thread_register __asm__ ("r13");
# define NO_TLS_OFFSET -1
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/powerpc/power4/fpu/Makefile b/sysdeps/powerpc/power4/fpu/Makefile
index e17d32f30e..f487ed6014 100644
--- a/sysdeps/powerpc/power4/fpu/Makefile
+++ b/sysdeps/powerpc/power4/fpu/Makefile
@@ -2,6 +2,4 @@
ifeq ($(subdir),math)
CFLAGS-mpa.c += --param max-unroll-times=4 -funroll-loops -fpeel-loops
-CPPFLAGS-slowpow.c += -DUSE_LONG_DOUBLE_FOR_MP=1
-CPPFLAGS-slowexp.c += -DUSE_LONG_DOUBLE_FOR_MP=1
endif
diff --git a/sysdeps/powerpc/power4/fpu/mpa-arch.h b/sysdeps/powerpc/power4/fpu/mpa-arch.h
index c2146c8e7f..a2913a84ea 100644
--- a/sysdeps/powerpc/power4/fpu/mpa-arch.h
+++ b/sysdeps/powerpc/power4/fpu/mpa-arch.h
@@ -1,5 +1,5 @@
/* Overridable constants and operations.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/powerpc/power4/fpu/mpa.c b/sysdeps/powerpc/power4/fpu/mpa.c
index 452d000021..bf4d4998e5 100644
--- a/sysdeps/powerpc/power4/fpu/mpa.c
+++ b/sysdeps/powerpc/power4/fpu/mpa.c
@@ -2,7 +2,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/powerpc/power4/wordcopy.c b/sysdeps/powerpc/power4/wordcopy.c
index 4992d5da67..510de2e573 100644
--- a/sysdeps/powerpc/power4/wordcopy.c
+++ b/sysdeps/powerpc/power4/wordcopy.c
@@ -1,5 +1,5 @@
/* _memcopy.c -- subroutines for memory copy functions.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/sysdeps/powerpc/power5+/fpu/s_modf.c b/sysdeps/powerpc/power5+/fpu/s_modf.c
index 04a104e09a..7a32d31303 100644
--- a/sysdeps/powerpc/power5+/fpu/s_modf.c
+++ b/sysdeps/powerpc/power5+/fpu/s_modf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
double
__modf (double x, double *iptr)
@@ -44,15 +45,7 @@ __modf (double x, double *iptr)
return __copysign (x - *iptr, x);
}
}
-weak_alias (__modf, modf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__modf, __modfl)
-weak_alias (__modf, modfl)
-#endif
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __modf, modfl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+libm_alias_double (__modf, modf)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __modf, modfl, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/power5+/fpu/s_modff.c b/sysdeps/powerpc/power5+/fpu/s_modff.c
index 32fb088587..c1bbae6479 100644
--- a/sysdeps/powerpc/power5+/fpu/s_modff.c
+++ b/sysdeps/powerpc/power5+/fpu/s_modff.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
float
__modff (float x, float *iptr)
@@ -43,4 +44,4 @@ __modff (float x, float *iptr)
return __copysignf (x - *iptr, x);
}
}
-weak_alias (__modff, modff)
+libm_alias_float (__modf, modf)
diff --git a/sysdeps/powerpc/power6/wcschr.c b/sysdeps/powerpc/power6/wcschr.c
index 7cbf24e65c..2bbb515c24 100644
--- a/sysdeps/powerpc/power6/wcschr.c
+++ b/sysdeps/powerpc/power6/wcschr.c
@@ -1,5 +1,5 @@
/* wcschr.c - Wide Character Search for POWER6+.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/power6/wcscpy.c b/sysdeps/powerpc/power6/wcscpy.c
index 9bf15697c3..202a5f824b 100644
--- a/sysdeps/powerpc/power6/wcscpy.c
+++ b/sysdeps/powerpc/power6/wcscpy.c
@@ -1,5 +1,5 @@
/* wcscpy.c - Wide Character Copy for POWER6+.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/power6/wcsrchr.c b/sysdeps/powerpc/power6/wcsrchr.c
index a980ef43b8..9ba9593d01 100644
--- a/sysdeps/powerpc/power6/wcsrchr.c
+++ b/sysdeps/powerpc/power6/wcsrchr.c
@@ -1,5 +1,5 @@
/* wcsrchr.c - Wide Character Reverse Search for POWER6+.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/power6/wordcopy.c b/sysdeps/powerpc/power6/wordcopy.c
index f48ef609fd..47e851ddb1 100644
--- a/sysdeps/powerpc/power6/wordcopy.c
+++ b/sysdeps/powerpc/power6/wordcopy.c
@@ -1,5 +1,5 @@
/* _memcopy.c -- subroutines for memory copy functions.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
Updated for POWER6 by Steven Munroe (sjmunroe@us.ibm.com).
diff --git a/sysdeps/powerpc/power7/fpu/s_logb.c b/sysdeps/powerpc/power7/fpu/s_logb.c
index 24f7fad4d5..f7eec8ff06 100644
--- a/sysdeps/powerpc/power7/fpu/s_logb.c
+++ b/sysdeps/powerpc/power7/fpu/s_logb.c
@@ -1,5 +1,5 @@
/* logb(). PowerPC/POWER7 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software 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,7 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* This implementation avoids FP to INT conversions by using VSX
bitwise instructions over FP values. */
@@ -68,12 +71,4 @@ __logb (double x)
/* Test to avoid logb_downward (0.0) == -0.0. */
return ret == -0.0 ? 0.0 : ret;
}
-weak_alias (__logb, logb)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__logb, __logbl)
-weak_alias (__logb, logbl)
-#endif
-
-#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
-compat_symbol (libm, logb, logbl, GLIBC_2_0);
-#endif
+libm_alias_double (__logb, logb)
diff --git a/sysdeps/powerpc/power7/fpu/s_logbf.c b/sysdeps/powerpc/power7/fpu/s_logbf.c
index a3873b842b..0832ad7022 100644
--- a/sysdeps/powerpc/power7/fpu/s_logbf.c
+++ b/sysdeps/powerpc/power7/fpu/s_logbf.c
@@ -1,5 +1,5 @@
/* logbf(). PowerPC/POWER7 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include "math_private.h"
+#include <libm-alias-float.h>
/* This implementation avoids FP to INT conversions by using VSX
bitwise instructions over FP values. */
@@ -57,4 +58,4 @@ __logbf (float x)
The test is to avoid logb_downward (0.0) == -0.0. */
return ret == -0.0 ? 0.0 : ret;
}
-weak_alias (__logbf, logbf)
+libm_alias_float (__logb, logb)
diff --git a/sysdeps/powerpc/power7/fpu/s_logbl.c b/sysdeps/powerpc/power7/fpu/s_logbl.c
index ec6907efc5..192145a7a1 100644
--- a/sysdeps/powerpc/power7/fpu/s_logbl.c
+++ b/sysdeps/powerpc/power7/fpu/s_logbl.c
@@ -1,5 +1,5 @@
/* logbl(). PowerPC/POWER7 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,14 +35,16 @@ static const union {
long double
__logbl (long double x)
{
- double xh;
+ double xh, xl;
double ret;
+ int64_t hx;
if (__builtin_expect (x == 0.0L, 0))
/* Raise FE_DIVBYZERO and return -HUGE_VAL[LF]. */
return -1.0L / __builtin_fabsl (x);
- xh = ldbl_high (x);
+ ldbl_unpack (x, &xh, &xl);
+ EXTRACT_WORDS64 (hx, xh);
/* ret = x & 0x7ff0000000000000; */
asm (
"xxland %x0,%x1,%x2\n"
@@ -58,10 +60,20 @@ __logbl (long double x)
{
/* POSIX specifies that denormal number is treated as
though it were normalized. */
- int64_t hx;
-
- EXTRACT_WORDS64 (hx, xh);
- return (long double) (-1023 - (__builtin_clzll (hx) - 12));
+ return (long double) (- (__builtin_clzll (hx & 0x7fffffffffffffffLL) \
+ - 12) - 1023);
+ }
+ else if ((hx & 0x000fffffffffffffLL) == 0)
+ {
+ /* If the high part is a power of 2, and the low part is nonzero
+ with the opposite sign, the low part affects the
+ exponent. */
+ int64_t lx, rhx;
+ EXTRACT_WORDS64 (lx, xl);
+ rhx = (hx & 0x7ff0000000000000LL) >> 52;
+ if ((hx ^ lx) < 0 && (lx & 0x7fffffffffffffffLL) != 0)
+ rhx--;
+ return (long double) (rhx - 1023);
}
/* Test to avoid logb_downward (0.0) == -0.0. */
return ret == -0.0 ? 0.0 : ret;
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index a021f4cff3..da5a588870 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -1,5 +1,5 @@
/* Optimized memcmp implementation for PowerPC476.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/405/memcpy.S b/sysdeps/powerpc/powerpc32/405/memcpy.S
index 58ecd52530..12b8a98c4f 100644
--- a/sysdeps/powerpc/powerpc32/405/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/405/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC476.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/405/memset.S b/sysdeps/powerpc/powerpc32/405/memset.S
index e32a0e9de4..14f35daead 100644
--- a/sysdeps/powerpc/powerpc32/405/memset.S
+++ b/sysdeps/powerpc/powerpc32/405/memset.S
@@ -1,5 +1,5 @@
/* Optimized memset for PowerPC405,440,464 (32-byte cacheline).
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/405/strcmp.S b/sysdeps/powerpc/powerpc32/405/strcmp.S
index 69cfea6fd7..62420da8b9 100644
--- a/sysdeps/powerpc/powerpc32/405/strcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/strcmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC476.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/405/strcpy.S b/sysdeps/powerpc/powerpc32/405/strcpy.S
index c00995db32..2244b5395b 100644
--- a/sysdeps/powerpc/powerpc32/405/strcpy.S
+++ b/sysdeps/powerpc/powerpc32/405/strcpy.S
@@ -1,5 +1,5 @@
/* Optimized strcpy implementation for PowerPC476.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/405/strlen.S b/sysdeps/powerpc/powerpc32/405/strlen.S
index d944e99934..eb84c8d2e2 100644
--- a/sysdeps/powerpc/powerpc32/405/strlen.S
+++ b/sysdeps/powerpc/powerpc32/405/strlen.S
@@ -1,5 +1,5 @@
/* Optimized strlen implementation for PowerPC476.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/405/strncmp.S b/sysdeps/powerpc/powerpc32/405/strncmp.S
index d5b15ea04b..c63100d621 100644
--- a/sysdeps/powerpc/powerpc32/405/strncmp.S
+++ b/sysdeps/powerpc/powerpc32/405/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strncmp implementation for PowerPC476.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/476/memset.S b/sysdeps/powerpc/powerpc32/476/memset.S
index 9ce6229d72..3249d3f584 100644
--- a/sysdeps/powerpc/powerpc32/476/memset.S
+++ b/sysdeps/powerpc/powerpc32/476/memset.S
@@ -1,5 +1,5 @@
/* Optimized memset for PowerPC476 (128-byte cacheline).
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/Implies b/sysdeps/powerpc/powerpc32/Implies-after
index 78dba9510c..78dba9510c 100644
--- a/sysdeps/powerpc/Implies
+++ b/sysdeps/powerpc/powerpc32/Implies-after
diff --git a/sysdeps/powerpc/powerpc32/__longjmp-common.S b/sysdeps/powerpc/powerpc32/__longjmp-common.S
index c4e2b41574..0423e3ee88 100644
--- a/sysdeps/powerpc/powerpc32/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/__longjmp-common.S
@@ -1,5 +1,5 @@
/* longjmp for PowerPC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/__longjmp.S b/sysdeps/powerpc/powerpc32/__longjmp.S
index fd865f3328..2f5145e972 100644
--- a/sysdeps/powerpc/powerpc32/__longjmp.S
+++ b/sysdeps/powerpc/powerpc32/__longjmp.S
@@ -1,5 +1,5 @@
/* AltiVec/VMX (new) version of __longjmp for PowerPC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/a2/memcpy.S b/sysdeps/powerpc/powerpc32/a2/memcpy.S
index 4c74342299..196b6d98e5 100644
--- a/sysdeps/powerpc/powerpc32/a2/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/a2/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC A2.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Michael Brutman <brutman@us.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/add_n.S b/sysdeps/powerpc/powerpc32/add_n.S
index a66867b523..eeecc8d7d2 100644
--- a/sysdeps/powerpc/powerpc32/add_n.S
+++ b/sysdeps/powerpc/powerpc32/add_n.S
@@ -1,5 +1,5 @@
/* Add two limb vectors of equal, non-zero length for PowerPC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/addmul_1.S b/sysdeps/powerpc/powerpc32/addmul_1.S
index dba1573e24..9232a346a5 100644
--- a/sysdeps/powerpc/powerpc32/addmul_1.S
+++ b/sysdeps/powerpc/powerpc32/addmul_1.S
@@ -1,5 +1,5 @@
/* Multiply a limb vector by a single limb, for PowerPC.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/atomic-machine.h b/sysdeps/powerpc/powerpc32/atomic-machine.h
index 1d407b3490..e0de9d858d 100644
--- a/sysdeps/powerpc/powerpc32/atomic-machine.h
+++ b/sysdeps/powerpc/powerpc32/atomic-machine.h
@@ -1,5 +1,5 @@
/* Atomic operations. PowerPC32 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
@@ -35,6 +35,7 @@
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+#define ATOMIC_EXCHANGE_USES_CAS 1
/*
* The 32-bit exchange_bool is different on powerpc64 because the subf
@@ -58,22 +59,6 @@
__tmp != 0; \
})
-#define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval) \
-({ \
- unsigned int __tmp; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
- "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
- " stwcx. %3,0,%1\n" \
- " bne- 1b\n" \
- "2: " \
- : "=&r" (__tmp) \
- : "b" (mem), "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
-})
-
/* Powerpc32 processors don't implement the 64-bit (doubleword) forms of
load and reserve (ldarx) and store conditional (stdcx.) instructions.
So for powerpc32 we stub out the 64-bit forms. */
@@ -83,9 +68,6 @@
#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
(abort (), (__typeof (*mem)) 0)
-#define __arch_compare_and_exchange_bool_64_rel(mem, newval, oldval) \
- (abort (), 0)
-
#define __arch_compare_and_exchange_val_64_rel(mem, newval, oldval) \
(abort (), (__typeof (*mem)) 0)
diff --git a/sysdeps/powerpc/powerpc32/backtrace.c b/sysdeps/powerpc/powerpc32/backtrace.c
index 1f372374db..5422fdd50d 100644
--- a/sysdeps/powerpc/powerpc32/backtrace.c
+++ b/sysdeps/powerpc/powerpc32/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -52,10 +52,10 @@ struct signal_frame_32 {
};
static inline int
-is_sigtramp_address (unsigned int nip)
+is_sigtramp_address (void *nip)
{
#ifdef SHARED
- if (nip == (unsigned int)__vdso_sigtramp32)
+ if (nip == VDSO_SYMBOL (sigtramp32))
return 1;
#endif
return 0;
@@ -64,15 +64,15 @@ is_sigtramp_address (unsigned int nip)
struct rt_signal_frame_32 {
char dummy[SIGNAL_FRAMESIZE + 16];
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
/* We don't care about the rest, since IP value is at 'uc' field. */
};
static inline int
-is_sigtramp_address_rt (unsigned int nip)
+is_sigtramp_address_rt (void * nip)
{
#ifdef SHARED
- if (nip == (unsigned int)__vdso_sigtramp_rt32)
+ if (nip == VDSO_SYMBOL (sigtramp_rt32))
return 1;
#endif
return 0;
@@ -100,20 +100,23 @@ __backtrace (void **array, int size)
/* Check if the symbol is the signal trampoline and get the interrupted
* symbol address from the trampoline saved area. */
- if (is_sigtramp_address ((unsigned int)current->return_address))
+ if (is_sigtramp_address (current->return_address))
{
struct signal_frame_32 *sigframe =
(struct signal_frame_32*) current;
gregset = &sigframe->mctx.gregs;
}
- else if (is_sigtramp_address_rt ((unsigned int)current->return_address))
+ else if (is_sigtramp_address_rt (current->return_address))
{
struct rt_signal_frame_32 *sigframe =
(struct rt_signal_frame_32*) current;
gregset = &sigframe->uc.uc_mcontext.uc_regs->gregs;
}
if (gregset)
- array[++count] = (void*)((*gregset)[PT_NIP]);
+ {
+ array[++count] = (void*)((*gregset)[PT_NIP]);
+ current = (void*)((*gregset)[PT_R1]);
+ }
}
/* It's possible the second-last stack frame can't return
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/bsd-_setjmp.S b/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
index 349972c968..60fbffa141 100644
--- a/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
+++ b/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. PowerPC32/64 version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/bsd-setjmp.S b/sysdeps/powerpc/powerpc32/bsd-setjmp.S
index 2cc9e4e834..6608b062dc 100644
--- a/sysdeps/powerpc/powerpc32/bsd-setjmp.S
+++ b/sysdeps/powerpc/powerpc32/bsd-setjmp.S
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. PowerPC32/64 version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/bzero.S b/sysdeps/powerpc/powerpc32/bzero.S
index 0875c98d5a..3ee0db04b9 100644
--- a/sysdeps/powerpc/powerpc32/bzero.S
+++ b/sysdeps/powerpc/powerpc32/bzero.S
@@ -1,5 +1,5 @@
/* Optimized bzero `implementation' for PowerPC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/cell/memcpy.S b/sysdeps/powerpc/powerpc32/cell/memcpy.S
index 64226d6c8a..484c0dcfd7 100644
--- a/sysdeps/powerpc/powerpc32/cell/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/cell/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for CELL BE PowerPC.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/crti.S b/sysdeps/powerpc/powerpc32/crti.S
index af9409e8a3..e4ee8dd484 100644
--- a/sysdeps/powerpc/powerpc32/crti.S
+++ b/sysdeps/powerpc/powerpc32/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for PowerPC.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,6 +58,7 @@
.section .init,"ax",@progbits
.align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
stwu r1, -16(r1)
@@ -80,6 +81,7 @@ _init:
.section .fini,"ax",@progbits
.align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
stwu r1, -16(r1)
diff --git a/sysdeps/powerpc/powerpc32/crtn.S b/sysdeps/powerpc/powerpc32/crtn.S
index c080cad310..fbc5911290 100644
--- a/sysdeps/powerpc/powerpc32/crtn.S
+++ b/sysdeps/powerpc/powerpc32/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for PowerPC.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/dl-irel.h b/sysdeps/powerpc/powerpc32/dl-irel.h
index 03ffc7a977..a7368b2582 100644
--- a/sysdeps/powerpc/powerpc32/dl-irel.h
+++ b/sysdeps/powerpc/powerpc32/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
PowerPC version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/dl-machine.c b/sysdeps/powerpc/powerpc32/dl-machine.c
index dd1d1f4a15..e82f1d8619 100644
--- a/sysdeps/powerpc/powerpc32/dl-machine.c
+++ b/sysdeps/powerpc/powerpc32/dl-machine.c
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation functions. PowerPC version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h
index 88e7941f2f..31c7f3f95a 100644
--- a/sysdeps/powerpc/powerpc32/dl-machine.h
+++ b/sysdeps/powerpc/powerpc32/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. PowerPC version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -235,6 +235,7 @@ extern Elf32_Addr __elf_machine_fixup_plt (struct link_map *map,
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf64_Addr finaladdr)
{
@@ -309,11 +310,14 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
against local symbols. */
if (__builtin_expect (ELF32_ST_BIND (sym->st_info) == STB_LOCAL, 0)
&& sym->st_shndx != SHN_UNDEF)
- value = map->l_addr;
+ {
+ sym_map = map;
+ value = map->l_addr;
+ }
else
{
sym_map = RESOLVE_MAP (&sym, version, r_type);
- value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ value = SYMBOL_ADDRESS (sym_map, sym, true);
}
value += reloc->r_addend;
#else
diff --git a/sysdeps/powerpc/powerpc32/dl-start.S b/sysdeps/powerpc/powerpc32/dl-start.S
index 4c20f713a8..244d87fb6d 100644
--- a/sysdeps/powerpc/powerpc32/dl-start.S
+++ b/sysdeps/powerpc/powerpc32/dl-start.S
@@ -1,5 +1,5 @@
/* Machine-dependent ELF startup code. PowerPC version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/dl-trampoline.S b/sysdeps/powerpc/powerpc32/dl-trampoline.S
index b0c07dd1fa..cac4e20443 100644
--- a/sysdeps/powerpc/powerpc32/dl-trampoline.S
+++ b/sysdeps/powerpc/powerpc32/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. PPC32 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feclearexcept.c b/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feclearexcept.c
index 039780e697..5108d5ca1e 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feclearexcept.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feclearexcept.c
@@ -1,6 +1,6 @@
/* Clear floating-point exceptions for atomic compound assignment.
e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feholdexcept.c b/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feholdexcept.c
index dc36cee36d..137eba9629 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feholdexcept.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feholdexcept.c
@@ -1,6 +1,6 @@
/* Store current floating-point environment and clear exceptions for
atomic compound assignment. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feupdateenv.c b/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feupdateenv.c
index ffcd0f56bc..aa5faba52f 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feupdateenv.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/atomic-feupdateenv.c
@@ -1,6 +1,6 @@
/* Install given floating-point environment and raise exceptions for
atomic compound assignment. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fclrexcpt.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fclrexcpt.c
index 4484ed83a4..d215d49f56 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fclrexcpt.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fe_note_change.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fe_note_change.c
index 237fce9dbb..8e0bf03ba2 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fe_note_change.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fe_note_change.c
@@ -1,5 +1,5 @@
/* Note a change to floating-point exceptions.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fedisblxcpt.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fedisblxcpt.c
index 9b5de4be20..a766c7eb08 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fedisblxcpt.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/feenablxcpt.c b/sysdeps/powerpc/powerpc32/e500/nofpu/feenablxcpt.c
index ba955a2bdc..65f7d468d0 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/feenablxcpt.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fegetenv.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fegetenv.c
index 7eb7f3bb3b..31502036e8 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fegetenv.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fegetexcept.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fegetexcept.c
index 37a7d7d7f8..a3df28e730 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fegetexcept.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get floating-point exceptions. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fegetmode.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fegetmode.c
new file mode 100644
index 0000000000..0a2d70d13a
--- /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-2018 Free Software 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/fegetround.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fegetround.c
index 387f73d932..99bdf7fb6c 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fegetround.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c b/sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c
index 19d8121416..ff4a64909e 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c
@@ -1,6 +1,6 @@
/* Store current floating-point environment and clear exceptions.
e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c
index 11e24ca182..fe9c652f7a 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c
@@ -1,5 +1,5 @@
/* Constant floating-point environments for e500.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/fenv_libc.h b/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_libc.h
index 928b766966..386bbdc071 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_libc.h
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_libc.h
@@ -1,5 +1,5 @@
/* Internal libc stuff for floating point environment routines. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fesetenv.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetenv.c
index 2b64fb78fa..f768fe5d66 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fesetenv.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment. e500 version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c
new file mode 100644
index 0000000000..5131885794
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c
@@ -0,0 +1,37 @@
+/* Set given exception flags. e500 version.
+ Copyright (C) 2016-2018 Free Software 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/powerpc/powerpc32/e500/nofpu/fesetmode.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetmode.c
new file mode 100644
index 0000000000..637956dece
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetmode.c
@@ -0,0 +1,43 @@
+/* Install given floating-point control modes. e500 version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define SPEFSCR_STATUS 0xff3eff00
+
+int
+fesetmode (const femode_t *modep)
+{
+ fenv_union_t u;
+ INTERNAL_SYSCALL_DECL (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;
+}
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fesetround.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetround.c
index c59f209752..5e5f51cd35 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fesetround.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fetestexceptflag.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fetestexceptflag.c
new file mode 100644
index 0000000000..a465a1cfa2
--- /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-2018 Free Software 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/e500/nofpu/feupdateenv.c b/sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c
index dcb3d11d11..2e132664e5 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c
@@ -1,6 +1,6 @@
/* Install given floating-point environment and raise exceptions.
e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_from_prctl.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_from_prctl.c
index df2bbcecd4..248a31e1fc 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_from_prctl.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_from_prctl.c
@@ -1,5 +1,5 @@
/* Convert floating-point exceptions from prctl form.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_from_spe.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_from_spe.c
index d13b797439..bfb4e28342 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_from_spe.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_from_spe.c
@@ -1,5 +1,5 @@
/* Convert floating-point exceptions from SPEFSCR form.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_to_prctl.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_to_prctl.c
index 9331e2bff8..5c77cb86f0 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_to_prctl.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_to_prctl.c
@@ -1,5 +1,5 @@
/* Convert floating-point exceptions to prctl form.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_to_spe.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_to_spe.c
index 88b4b4693c..1d3047a669 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_to_spe.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fexcepts_to_spe.c
@@ -1,5 +1,5 @@
/* Convert floating-point exceptions to SPEFSCR form.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fgetexcptflg.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fgetexcptflg.c
index 9cf20ddc0f..5840b46635 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fgetexcptflg.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/flt-rounds.c b/sysdeps/powerpc/powerpc32/e500/nofpu/flt-rounds.c
index d3c50a3d47..17a32f4ca0 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/flt-rounds.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/flt-rounds.c
@@ -1,6 +1,6 @@
/* Return current rounding mode as correct value for FLT_ROUNDS. e500
version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcept-soft.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcept-soft.c
index a26e3c6216..37ae81a12c 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcept-soft.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcept-soft.c
@@ -1,5 +1,5 @@
/* Raise given exceptions. e500 version for use from soft-fp.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2004.
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcpt.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcpt.c
index 8e0662c2d5..dfe0283f0a 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcpt.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fsetexcptflg.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fsetexcptflg.c
index b5404d1984..ec98d54d2a 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fsetexcptflg.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling. e500 version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/ftestexcept.c b/sysdeps/powerpc/powerpc32/e500/nofpu/ftestexcept.c
index eeac79b1a9..612df632ed 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/ftestexcept.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/s_fabsf.S b/sysdeps/powerpc/powerpc32/e500/nofpu/s_fabsf.S
index 721d103ce8..aa13fba0c3 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/s_fabsf.S
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/s_fabsf.S
@@ -1,5 +1,5 @@
/* Floating-point absolute value. e500 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
ENTRY (__fabsf)
/* float [r3] fabsf (float [r3] x) ; */
@@ -24,4 +25,4 @@ ENTRY (__fabsf)
blr
END (__fabsf)
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/spe-raise.c b/sysdeps/powerpc/powerpc32/e500/nofpu/spe-raise.c
index 2a3f5e4c67..4952e6ad17 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/spe-raise.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/spe-raise.c
@@ -1,5 +1,5 @@
/* Raise given exceptions, given the SPEFSCR bits for those exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
index 5395410e61..7a4b068599 100644
--- a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
@@ -1,5 +1,5 @@
/* longjmp for PowerPC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/fpu/__longjmp.S b/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
index 529e0956cc..c59b59a4c3 100644
--- a/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
+++ b/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
@@ -1,5 +1,5 @@
/* AltiVec/VMX (new) version of __longjmp for PowerPC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,15 +26,13 @@
# include "__longjmp-common.S"
#else /* IS_IN (libc) */
-/* Build a versioned object for libc. */
-versioned_symbol (libc, __vmx__longjmp, __longjmp, GLIBC_2_3_4);
+strong_alias (__vmx__longjmp, __longjmp)
# define __longjmp_symbol __vmx__longjmp
# include "__longjmp-common.S"
# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
# define __NO_VMX__
# undef JB_SIZE
-compat_symbol (libc, __novmx__longjmp, __longjmp, GLIBC_2_0);
# undef __longjmp_symbol
# define __longjmp_symbol __novmx__longjmp
# include "__longjmp-common.S"
diff --git a/sysdeps/powerpc/powerpc32/fpu/fix-int-fp-convert-zero.h b/sysdeps/powerpc/powerpc32/fpu/fix-int-fp-convert-zero.h
index a2d002c256..6bdc3480b2 100644
--- a/sysdeps/powerpc/powerpc32/fpu/fix-int-fp-convert-zero.h
+++ b/sysdeps/powerpc/powerpc32/fpu/fix-int-fp-convert-zero.h
@@ -1,5 +1,5 @@
/* Fix for conversion of integer 0 to floating point. PowerPC version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/fpu/fprrest.S b/sysdeps/powerpc/powerpc32/fpu/fprrest.S
index df08df41d7..c17bdf35df 100644
--- a/sysdeps/powerpc/powerpc32/fpu/fprrest.S
+++ b/sysdeps/powerpc/powerpc32/fpu/fprrest.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/fpu/fprsave.S b/sysdeps/powerpc/powerpc32/fpu/fprsave.S
index 4a257cdb46..0822de23a0 100644
--- a/sysdeps/powerpc/powerpc32/fpu/fprsave.S
+++ b/sysdeps/powerpc/powerpc32/fpu/fprsave.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_ceil.S b/sysdeps/powerpc/powerpc32/fpu/s_ceil.S
index 48d6d0de19..7f2f97ada1 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_ceil.S
@@ -1,5 +1,5 @@
/* ceil function. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section .rodata.cst4,"aM",@progbits,4
.align 2
@@ -26,7 +27,6 @@
.section ".text"
ENTRY (__ceil)
- mffs fp11 /* Save current FPU rounding mode. */
#ifdef SHARED
mflr r11
cfi_register(lr,r11)
@@ -42,15 +42,18 @@ ENTRY (__ceil)
fabs fp0,fp1
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,2 /* Set rounding mode toward +inf. */
ble- cr6,.L4
fadd fp1,fp1,fp13 /* x+= TWO52; */
fsub fp1,fp1,fp13 /* x-= TWO52; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -59,16 +62,15 @@ ENTRY (__ceil)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
blr
END (__ceil)
-weak_alias (__ceil, ceil)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__ceil, ceill)
-strong_alias (__ceil, __ceill)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S
index c70fd444e2..3f5949004f 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_ceilf.S
@@ -1,5 +1,5 @@
/* float ceil function. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section .rodata.cst4,"aM",@progbits,4
.align 2
@@ -25,7 +26,6 @@
.section ".text"
ENTRY (__ceilf)
- mffs fp11 /* Save current FPU rounding mode. */
#ifdef SHARED
mflr r11
cfi_register(lr,r11)
@@ -41,15 +41,18 @@ ENTRY (__ceilf)
fabs fp0,fp1
fsubs fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,2 /* Set rounding mode toward +inf. */
ble- cr6,.L4
fadds fp1,fp1,fp13 /* x+= TWO23; */
fsubs fp1,fp1,fp13 /* x-= TWO23; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -58,9 +61,16 @@ ENTRY (__ceilf)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
blr
END (__ceilf)
-weak_alias (__ceilf, ceilf)
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_copysign.S b/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
index 05eb07df3f..6ca90cd1e3 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_copysign.S
@@ -1,5 +1,5 @@
/* Copy a sign bit between floating-point values.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
ENTRY(__copysign)
/* double [f1] copysign (double [f1] x, double [f2] y);
@@ -40,20 +42,12 @@ L(0): fnabs fp1,fp1
blr
END (__copysign)
-weak_alias (__copysign,copysign)
+libm_alias_double (__copysign, copysign)
/* It turns out that it's safe to use this code even for single-precision. */
-weak_alias (__copysign,copysignf)
strong_alias(__copysign,__copysignf)
+libm_alias_float (__copysign, copysign)
-#ifdef NO_LONG_DOUBLE
-weak_alias (__copysign,copysignl)
-strong_alias(__copysign,__copysignl)
-#endif
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __copysign, copysignl, GLIBC_2_0)
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __copysign, copysignl, GLIBC_2_0)
#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S b/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
index aed783ad59..0c9d18cb03 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
@@ -1,6 +1,6 @@
/* Copy a sign bit between floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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/fpu/s_fabs.S b/sysdeps/powerpc/powerpc32/fpu/s_fabs.S
deleted file mode 100644
index 53d21301ee..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_fabs.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fabs.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fabs, fabsl, GLIBC_2_0)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_fabsl.S b/sysdeps/powerpc/powerpc32/fpu/s_fabsl.S
index 0462d20630..e6a726afb0 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_fabsl.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_fabsl.S
@@ -1,6 +1,6 @@
/* Copy a sign bit between floating-point values.
IBM extended format long double version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,11 +24,28 @@ ENTRY(__fabsl)
/* long double [f1,f2] fabs (long double [f1,f2] x);
fabs(x,y) returns a value with the magnitude of x and
with the sign bit of y. */
+#ifdef _ARCH_PPCGR
+ /* fsel available. */
fmr fp0,fp1
+#else
+ /* Use integer operations to test sign of high part to avoid
+ exceptions on sNaNs. */
+ stwu r1,-16(r1)
+ cfi_adjust_cfa_offset (16)
+ stfd fp1,8(r1)
+#endif
fabs fp1,fp1
- fcmpu cr1,fp0,fp1
- beqlr cr1
+#ifdef _ARCH_PPCGR
+ fneg fp3,fp2
+ fsel fp2,fp0,fp2,fp3
+#else
+ lwz r3,8+HIWORD(r1)
+ cmpwi cr6,r3,0
+ addi r1,r1,16
+ cfi_adjust_cfa_offset (-16)
+ bgelr cr6
fneg fp2,fp2
+#endif
blr
END (__fabsl)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_fdim.c b/sysdeps/powerpc/powerpc32/fpu/s_fdim.c
deleted file mode 100644
index e34b51ee54..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_fdim.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fdim.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_floor.S b/sysdeps/powerpc/powerpc32/fpu/s_floor.S
index 3f84465a8e..cb2fd9596e 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_floor.S
@@ -1,5 +1,5 @@
/* Floor function. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section .rodata.cst4,"aM",@progbits,4
.align 2
@@ -26,7 +27,6 @@
.section ".text"
ENTRY (__floor)
- mffs fp11 /* Save current FPU rounding mode. */
#ifdef SHARED
mflr r11
cfi_register(lr,r11)
@@ -42,15 +42,18 @@ ENTRY (__floor)
fabs fp0,fp1
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,3 /* Set rounding mode toward -inf. */
ble- cr6,.L4
fadd fp1,fp1,fp13 /* x+= TWO52; */
fsub fp1,fp1,fp13 /* x-= TWO52; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -59,16 +62,15 @@ ENTRY (__floor)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
blr
END (__floor)
-weak_alias (__floor, floor)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__floor, floorl)
-strong_alias (__floor, __floorl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_floorf.S b/sysdeps/powerpc/powerpc32/fpu/s_floorf.S
index 55ac526d71..37b70d7c72 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_floorf.S
@@ -1,5 +1,5 @@
/* float Floor function. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section .rodata.cst4,"aM",@progbits,4
.align 2
@@ -25,7 +26,6 @@
.section ".text"
ENTRY (__floorf)
- mffs fp11 /* Save current FPU rounding mode. */
#ifdef SHARED
mflr r11
cfi_register(lr,r11)
@@ -41,15 +41,18 @@ ENTRY (__floorf)
fabs fp0,fp1
fsubs fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,3 /* Set rounding mode toward -inf. */
ble- cr6,.L4
fadds fp1,fp1,fp13 /* x+= TWO23; */
fsubs fp1,fp1,fp13 /* x-= TWO23; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -58,9 +61,16 @@ ENTRY (__floorf)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
blr
END (__floorf)
-weak_alias (__floorf, floorf)
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_fma.S b/sysdeps/powerpc/powerpc32/fpu/s_fma.S
deleted file mode 100644
index d40695c633..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_fma.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fma.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fma, fmal, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_fmax.S b/sysdeps/powerpc/powerpc32/fpu/s_fmax.S
deleted file mode 100644
index 69735761ab..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_fmax.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fmax.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_fmin.S b/sysdeps/powerpc/powerpc32/fpu/s_fmin.S
deleted file mode 100644
index 6d4a0a946c..0000000000
--- a/sysdeps/powerpc/powerpc32/fpu/s_fmin.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fmin.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
index c33b89492d..c0cec82ce0 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC32 version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_llrint.c b/sysdeps/powerpc/powerpc32/fpu/s_llrint.c
index 9cb72a1fd6..3704f9b11e 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_llrint.c
+++ b/sysdeps/powerpc/powerpc32/fpu/s_llrint.c
@@ -1,5 +1,5 @@
/* Round a double value to a long long in the current rounding mode.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <math_ldbl_opt.h>
#include <math_private.h>
#include <stdint.h>
+#include <libm-alias-double.h>
long long int
__llrint (double x)
@@ -53,11 +54,4 @@ __llrint (double x)
return (long long int) (long int) rx << 32;
}
}
-weak_alias (__llrint, llrint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
-#endif
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_llrintf.c b/sysdeps/powerpc/powerpc32/fpu/s_llrintf.c
index 7151bed1c9..c5e78fa050 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_llrintf.c
+++ b/sysdeps/powerpc/powerpc32/fpu/s_llrintf.c
@@ -1,5 +1,5 @@
/* Round a float value to a long long in the current rounding mode.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <math_private.h>
#include <stdint.h>
+#include <libm-alias-float.h>
long long int
__llrintf (float x)
@@ -43,4 +44,4 @@ __llrintf (float x)
return (long long int) ((i0 & 0x80000000) != 0 ? -mant : mant);
}
}
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_llround.c b/sysdeps/powerpc/powerpc32/fpu/s_llround.c
index b09949bce5..d09f97f2a2 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_llround.c
+++ b/sysdeps/powerpc/powerpc32/fpu/s_llround.c
@@ -1,5 +1,5 @@
/* Round double value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <math_ldbl_opt.h>
#include <math_private.h>
#include <stdint.h>
+#include <libm-alias-double.h>
/* Round to the nearest integer, with values exactly on a 0.5 boundary
rounded away from zero, regardless of the current rounding mode.
@@ -80,11 +81,4 @@ __llround (double x)
}
return xr;
}
-weak_alias (__llround, llround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __llroundl)
-weak_alias (__llround, llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
-#endif
+libm_alias_double (__llround, llround)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_llroundf.c b/sysdeps/powerpc/powerpc32/fpu/s_llroundf.c
index 607977c0ab..5337ccd4c8 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_llroundf.c
+++ b/sysdeps/powerpc/powerpc32/fpu/s_llroundf.c
@@ -1,5 +1,5 @@
/* Round float value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <math_private.h>
#include <stdint.h>
+#include <libm-alias-float.h>
/* Round to the nearest integer, with values exactly on a 0.5 boundary
rounded away from zero, regardless of the current rounding mode.
@@ -69,4 +70,4 @@ __llroundf (float x)
}
return xr;
}
-weak_alias (__llroundf, llroundf)
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_lrint.S b/sysdeps/powerpc/powerpc32/fpu/s_lrint.S
index 54326268b7..49a97ff012 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_lrint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_lrint.S
@@ -1,5 +1,5 @@
/* Round double to long int. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
/* long int[r3] __lrint (double x[fp1]) */
ENTRY (__lrint)
@@ -32,15 +34,7 @@ ENTRY (__lrint)
blr
END (__lrint)
-weak_alias (__lrint, lrint)
+libm_alias_double (__lrint, lrint)
strong_alias (__lrint, __lrintf)
-weak_alias (__lrint, lrintf)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_lround.S b/sysdeps/powerpc/powerpc32/fpu/s_lround.S
index 66d9a67e1a..03d7dae2a5 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_lround.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_lround.S
@@ -1,5 +1,5 @@
/* lround function. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
.section .rodata.cst4,"aM",@progbits,4
.align 2
@@ -115,15 +117,7 @@ ENTRY (__lround)
b .Lconvert
END (__lround)
-weak_alias (__lround, lround)
+libm_alias_double (__lround, lround)
strong_alias (__lround, __lroundf)
-weak_alias (__lround, lroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S b/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
index 68e3182b0d..2481897816 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
@@ -1,5 +1,5 @@
/* Round to int floating-point values. PowerPC32 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -22,6 +22,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* double [fp1] nearbyint(double [fp1] x) */
@@ -49,7 +50,7 @@ ENTRY (__nearbyint)
fabs fp0,fp1
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52 */
- bgelr cr7
+ bge cr7,.L10
fcmpu cr7,fp1,fp12 /* if (x > 0.0 */
ble cr7,L(lessthanzero)
mffs fp11
@@ -68,14 +69,12 @@ L(lessthanzero):
fnabs fp1,fp1 /* if (x == 0.0) */
mtfsf 0xff,fp11 /* Restore FE_INEXACT state. */
blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
+ blr
END (__nearbyint)
-weak_alias (__nearbyint, nearbyint)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__nearbyint, nearbyintl)
-strong_alias (__nearbyint, __nearbyintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1)
-#endif
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S b/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S
index 107b035a24..113ee81309 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S
@@ -1,5 +1,5 @@
/* Round to int floating-point values. PowerPC32 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -21,6 +21,7 @@
when it's coded in C. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* float [fp1] nearbyintf(float [fp1] x) */
@@ -48,7 +49,7 @@ ENTRY (__nearbyintf)
fabs fp0,fp1
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23 */
- bgelr cr7
+ bge cr7,.L10
fcmpu cr7,fp1,fp12 /* if (x > 0.0 */
ble cr7,L(lessthanzero)
mffs fp11
@@ -67,6 +68,12 @@ L(lessthanzero):
fnabs fp1,fp1 /* if (x == 0.0) */
mtfsf 0xff,fp11 /* Restore FE_INEXACT state. */
blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
+ blr
END (__nearbyintf)
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_rint.S b/sysdeps/powerpc/powerpc32/fpu/s_rint.S
index 5d78f3a5fc..7c7784adf9 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_rint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_rint.S
@@ -1,5 +1,5 @@
/* Round to int floating-point values. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section .rodata.cst4,"aM",@progbits,4
.align 2
@@ -45,7 +46,7 @@ ENTRY (__rint)
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr cr7
+ bnl cr7,.L10
bng cr6,.L4
fadd fp1,fp1,fp13 /* x+= TWO52; */
fsub fp1,fp1,fp13 /* x-= TWO52; */
@@ -57,14 +58,12 @@ ENTRY (__rint)
fadd fp1,fp1,fp13 /* x+= TWO52; */
fnabs fp1,fp1 /* if (x == 0.0) */
blr /* x = -0.0; */
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
+ blr
END (__rint)
-weak_alias (__rint, rint)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__rint, rintl)
-strong_alias (__rint, __rintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0)
-#endif
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_rintf.S b/sysdeps/powerpc/powerpc32/fpu/s_rintf.S
index 94b7045da6..34e095399f 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_rintf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_rintf.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section .rodata.cst4,"aM",@progbits,4
.align 2
@@ -41,7 +42,7 @@ ENTRY (__rintf)
fsubs fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr cr7
+ bnl cr7,.L10
bng cr6,.L4
fadds fp1,fp1,fp13 /* x+= TWO23; */
fsubs fp1,fp1,fp13 /* x-= TWO23; */
@@ -53,7 +54,13 @@ ENTRY (__rintf)
fadds fp1,fp1,fp13 /* x+= TWO23; */
fnabs fp1,fp1 /* if (x == 0.0) */
blr /* x = -0.0; */
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
+ blr
END (__rintf)
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_round.S b/sysdeps/powerpc/powerpc32/fpu/s_round.S
index ae25364bd9..6fb12ca2e9 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_round.S
@@ -1,5 +1,5 @@
/* round function. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section .rodata.cst8,"aM",@progbits,8
.align 2
@@ -57,7 +58,7 @@ ENTRY (__round)
mffs fp11 /* Save current FPU rounding mode and
"inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,1 /* Set rounding mode toward 0. */
#ifdef SHARED
lfs fp10,.LC1-.LC0(r9)
@@ -85,14 +86,12 @@ ENTRY (__round)
mtfsf 0xff,fp11 /* Restore previous rounding mode and
"inexact" state. */
blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
+ blr
END (__round)
-weak_alias (__round, round)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__round, roundl)
-strong_alias (__round, __roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1)
-#endif
+libm_alias_double (__round, round)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_roundf.S b/sysdeps/powerpc/powerpc32/fpu/s_roundf.S
index f63248138f..222c0dfc10 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_roundf.S
@@ -1,5 +1,5 @@
/* roundf function. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section .rodata.cst8,"aM",@progbits,8
.align 3
@@ -56,7 +57,7 @@ ENTRY (__roundf )
mffs fp11 /* Save current FPU rounding mode and
"inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,1 /* Set rounding mode toward 0. */
#ifdef SHARED
lfs fp10,.LC1-.LC0(r9)
@@ -83,7 +84,13 @@ ENTRY (__roundf )
mtfsf 0xff,fp11 /* Restore previous rounding mode and
"inexact" state. */
blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
+ blr
END (__roundf)
-weak_alias (__roundf, roundf)
+libm_alias_float (__round, round)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_trunc.S b/sysdeps/powerpc/powerpc32/fpu/s_trunc.S
index c8aa2fb245..ff39a13d68 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_trunc.S
@@ -1,5 +1,5 @@
/* trunc function. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section .rodata.cst4,"aM",@progbits,4
.align 2
@@ -33,7 +34,6 @@
.section ".text"
ENTRY (__trunc)
- mffs fp11 /* Save current FPU rounding mode. */
#ifdef SHARED
mflr r11
cfi_register(lr,r11)
@@ -49,15 +49,18 @@ ENTRY (__trunc)
fabs fp0,fp1
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,1 /* Set rounding toward 0 mode. */
ble- cr6,.L4
fadd fp1,fp1,fp13 /* x+= TWO52; */
fsub fp1,fp1,fp13 /* x-= TWO52; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -66,16 +69,15 @@ ENTRY (__trunc)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
blr
END (__trunc)
-weak_alias (__trunc, trunc)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__trunc, truncl)
-strong_alias (__trunc, __truncl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_truncf.S b/sysdeps/powerpc/powerpc32/fpu/s_truncf.S
index e47ee96c55..52e97f83f9 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_truncf.S
@@ -1,5 +1,5 @@
/* truncf function. PowerPC32 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section .rodata.cst4,"aM",@progbits,4
.align 2
@@ -32,7 +33,6 @@
.section ".text"
ENTRY (__truncf)
- mffs fp11 /* Save current FPU rounding mode. */
#ifdef SHARED
mflr r11
cfi_register(lr,r11)
@@ -48,15 +48,18 @@ ENTRY (__truncf)
fabs fp0,fp1
fsubs fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,1 /* Set rounding toward 0 mode. */
ble- cr6,.L4
fadds fp1,fp1,fp13 /* x+= TWO23; */
fsubs fp1,fp1,fp13 /* x-= TWO23; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -65,9 +68,16 @@ ENTRY (__truncf)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
blr
END (__truncf)
-weak_alias (__truncf, truncf)
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
index 59f4e8b3da..e2d781ed78 100644
--- a/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
@@ -1,5 +1,5 @@
/* setjmp for PowerPC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/fpu/setjmp.S b/sysdeps/powerpc/powerpc32/fpu/setjmp.S
index 6a4016c229..36eb839a97 100644
--- a/sysdeps/powerpc/powerpc32/fpu/setjmp.S
+++ b/sysdeps/powerpc/powerpc32/fpu/setjmp.S
@@ -1,5 +1,5 @@
/* non altivec (old) version of setjmp for PowerPC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,6 +32,7 @@ versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4)
# define __sigsetjmp_symbol __vmx__sigsetjmp
# define __sigjmp_save_symbol __vmx__sigjmp_save
# include "setjmp-common.S"
+libc_hidden_ver (__vmx__sigsetjmp, __sigsetjmp)
# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
# define __NO_VMX__
diff --git a/sysdeps/powerpc/powerpc32/gprrest0.S b/sysdeps/powerpc/powerpc32/gprrest0.S
index 3b12af9008..8186157a50 100644
--- a/sysdeps/powerpc/powerpc32/gprrest0.S
+++ b/sysdeps/powerpc/powerpc32/gprrest0.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/gprrest1.S b/sysdeps/powerpc/powerpc32/gprrest1.S
index 40cd5c698c..f28575d941 100644
--- a/sysdeps/powerpc/powerpc32/gprrest1.S
+++ b/sysdeps/powerpc/powerpc32/gprrest1.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/gprsave0.S b/sysdeps/powerpc/powerpc32/gprsave0.S
index c8cc8996ba..bdbed4b844 100644
--- a/sysdeps/powerpc/powerpc32/gprsave0.S
+++ b/sysdeps/powerpc/powerpc32/gprsave0.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/gprsave1.S b/sysdeps/powerpc/powerpc32/gprsave1.S
index 44eed283a3..e75829284b 100644
--- a/sysdeps/powerpc/powerpc32/gprsave1.S
+++ b/sysdeps/powerpc/powerpc32/gprsave1.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/libgcc-compat.S b/sysdeps/powerpc/powerpc32/libgcc-compat.S
index f7c26a3624..0412d78ede 100644
--- a/sysdeps/powerpc/powerpc32/libgcc-compat.S
+++ b/sysdeps/powerpc/powerpc32/libgcc-compat.S
@@ -1,5 +1,5 @@
/* pre-.hidden libgcc compatibility
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/lshift.S b/sysdeps/powerpc/powerpc32/lshift.S
index 4e35878f36..78e0ed40f5 100644
--- a/sysdeps/powerpc/powerpc32/lshift.S
+++ b/sysdeps/powerpc/powerpc32/lshift.S
@@ -1,5 +1,5 @@
/* Shift a limb left, low level routine.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/memset.S b/sysdeps/powerpc/powerpc32/memset.S
index 3e22705b80..94686f9573 100644
--- a/sysdeps/powerpc/powerpc32/memset.S
+++ b/sysdeps/powerpc/powerpc32/memset.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
+/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5]));
Returns 's'.
The memset is done in four sizes: byte (8 bits), word (32 bits),
diff --git a/sysdeps/powerpc/powerpc32/mul_1.S b/sysdeps/powerpc/powerpc32/mul_1.S
index ae8999be25..5536e47b41 100644
--- a/sysdeps/powerpc/powerpc32/mul_1.S
+++ b/sysdeps/powerpc/powerpc32/mul_1.S
@@ -1,5 +1,5 @@
/* Multiply a limb vector by a limb, for PowerPC.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
index 590a8eba05..4e85021d50 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
@@ -8,8 +8,7 @@ sysdep_routines += s_isnan-power7 s_isnan-power6 s_isnan-power5 s_isnan-ppc32 \
libm-sysdep_routines += s_llrintf-power6 s_llrintf-ppc32 s_llrint-power6 \
s_llrint-ppc32 s_llround-power6 s_llround-power5+ \
- s_llround-ppc32 w_sqrt-power5 w_sqrt-ppc32 \
- w_sqrtf-power5 w_sqrtf-ppc32 s_isnan-power7 \
+ s_llround-ppc32 s_isnan-power7 \
s_isnan-power6 s_isnan-power5 s_isnan-ppc32 \
s_isnanf-power6 s_isnanf-power5 s_isinf-power7 \
s_isinf-ppc32 s_isinff-ppc32 s_finite-power7 \
@@ -34,4 +33,9 @@ CFLAGS-s_logb-power7.c = -mcpu=power7
CFLAGS-s_logbf-power7.c = -mcpu=power7
CFLAGS-e_hypot-power7.c = -mcpu=power7
CFLAGS-e_hypotf-power7.c = -mcpu=power7
+
+# These files quiet sNaNs in a way that is optimized away without
+# -fsignaling-nans.
+CFLAGS-s_modf-ppc32.c += -fsignaling-nans
+CFLAGS-s_modff-ppc32.c += -fsignaling-nans
endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-power7.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-power7.c
index 3c23e94112..b1200260a9 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-power7.c
@@ -1,5 +1,5 @@
/* __ieee_hypot() POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-ppc32.c
index 49e1d9a213..e2b98fdb55 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-ppc32.c
@@ -1,5 +1,5 @@
/* __ieee_hypot() PowerPC32 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot.c
index 08a2b9240e..b05414f225 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot.c
@@ -1,5 +1,5 @@
/* Multiple versions of ieee754_hypot.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-power7.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-power7.c
index 2071d0ca85..2eacefd617 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-power7.c
@@ -1,5 +1,5 @@
/* __ieee754_hypot POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-ppc32.c
index f672005da0..353d0b7d29 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-ppc32.c
@@ -1,5 +1,5 @@
/* __ieee_hypot() PowerPC32 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf.c
index 5e7e78f40d..d432cd0023 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf.c
@@ -1,5 +1,5 @@
/* Multiple versions of ieee754_hypotf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S
index 501a7524f1..b8181585a8 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S
@@ -1,5 +1,5 @@
/* ceil function. PowerPC32/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S
index 06de64c87c..cd2bc69b67 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S
@@ -1,5 +1,5 @@
/* ceil function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil.c
index 8fb55e958d..5f3c0713fb 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil.c
@@ -1,5 +1,5 @@
/* Multiple versions of ceil.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__ceil) __ceil_ppc32 attribute_hidden;
extern __typeof (__ceil) __ceil_power5plus attribute_hidden;
@@ -29,12 +30,4 @@ libc_ifunc (__ceil,
? __ceil_power5plus
: __ceil_ppc32);
-weak_alias (__ceil, ceil)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__ceil, __ceill)
-weak_alias (__ceil, ceill)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0);
-#endif
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S
index 2968c8aef9..d01aa6e7db 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S
@@ -1,5 +1,5 @@
/* ceilf function. PowerPC32/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S
index 19ddf91700..264e032b3b 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S
@@ -1,5 +1,5 @@
/* ceilf function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf.c
index ae1003628b..1f10ed6585 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf.c
@@ -1,5 +1,5 @@
/* Multiple versions of ceilf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__ceilf) __ceilf_ppc32 attribute_hidden;
extern __typeof (__ceilf) __ceilf_power5plus attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__ceilf,
? __ceilf_power5plus
: __ceilf_ppc32);
-weak_alias (__ceilf, ceilf)
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S
index 2fd216efae..dce94759da 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S
@@ -1,5 +1,5 @@
/* copysign(). PowerPC32/POWER6 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S
index 75df244afe..8e576f2dc4 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S
@@ -1,5 +1,5 @@
/* copysign(). PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c
index 310aa9fb54..86df7d6bc2 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c
@@ -1,5 +1,5 @@
/* Multiple versions of copysign.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,7 @@
#undef __copysign
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__redirect_copysign) __copysign_ppc32 attribute_hidden;
extern __typeof (__redirect_copysign) __copysign_power6 attribute_hidden;
@@ -36,16 +37,8 @@ libc_ifunc (__libm_copysign,
: __copysign_ppc32);
strong_alias (__libm_copysign, __copysign)
-weak_alias (__copysign, copysign)
+libm_alias_double (__copysign, copysign)
-#ifdef NO_LONG_DOUBLE
-weak_alias (__copysign,copysignl)
-strong_alias(__copysign,__copysignl)
-#endif
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c
index 255c5a0d63..d2900b3287 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c
@@ -1,5 +1,5 @@
/* Multiple versions of copysignf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
/* It's safe to use double-precision implementation for single-precision. */
extern __typeof (__copysignf) __copysign_ppc32 attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__copysignf,
? __copysign_power6
: __copysign_ppc32);
-weak_alias (__copysignf, copysignf)
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-power7.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-power7.S
index 63f958d5cf..034fec7d1c 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-power7.S
@@ -1,5 +1,5 @@
/* finite(). PowerPC32/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-ppc32.c
index af6ec9500d..74498c2714 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite-ppc32.c
@@ -1,5 +1,5 @@
/* finite(). PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c
index c860a1b5d3..9ef6d109a6 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c
@@ -1,5 +1,5 @@
/* Multiple versions of finite.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef-ppc32.c
index c0a5df3def..681cb3fb25 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef-ppc32.c
@@ -1,5 +1,5 @@
/* finitef(). PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c
index 831c94f3fc..b512ba6c64 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c
@@ -1,5 +1,5 @@
/* Multiple versions of finitef.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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_floor-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-power5+.S
index 421d68ea28..709a1910e9 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-power5+.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-power5+.S
@@ -1,5 +1,5 @@
/* floor function. PowerPC32/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-ppc32.S
index 5d938b5bde..bf4110cde6 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-ppc32.S
@@ -1,5 +1,5 @@
/* floor function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor.c
index 6f5311eca5..0152ea606e 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor.c
@@ -1,5 +1,5 @@
/* Multiple versions of floor.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__floor) __floor_ppc32 attribute_hidden;
extern __typeof (__floor) __floor_power5plus attribute_hidden;
@@ -29,12 +30,4 @@ libc_ifunc (__floor,
? __floor_power5plus
: __floor_ppc32);
-weak_alias (__floor, floor)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__floor, __floorl)
-weak_alias (__floor, floorl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0);
-#endif
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-power5+.S
index c4fc6de0ec..1a6b089060 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-power5+.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-power5+.S
@@ -1,5 +1,5 @@
/* floorf function. PowerPC32/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-ppc32.S
index 0ac7f967ce..c1be69e0df 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-ppc32.S
@@ -1,5 +1,5 @@
/* floorf function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf.c
index 2fc151fd53..57ae50c9f6 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf.c
@@ -1,5 +1,5 @@
/* Multiple versions of floorf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__floorf) __floorf_ppc32 attribute_hidden;
extern __typeof (__floorf) __floorf_power5plus attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__floorf,
? __floorf_power5plus
: __floorf_ppc32);
-weak_alias (__floorf, floorf)
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-power7.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-power7.S
index 51d3f8869c..3748019890 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-power7.S
@@ -1,5 +1,5 @@
/* isinf(). PowerPC32/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-ppc32.c
index 87c9e20f2c..633fe9485d 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf-ppc32.c
@@ -1,5 +1,5 @@
/* isinf(). PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
index 506c1115e8..764d511c2a 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
@@ -1,5 +1,5 @@
/* Multiple versions of isinf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff-ppc32.c
index 0c830fd7f5..8d1801abf1 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff-ppc32.c
@@ -1,5 +1,5 @@
/* isinff(). PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c
index 2ab83ee7cb..949c052788 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c
@@ -1,5 +1,5 @@
/* Multiple versions of isinf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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-power5.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S
index 44aa92e399..de55f5ae27 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power5.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC32/POWER5 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S
index b41fde7a01..f9008a2571 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power6.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC32/POWER6 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S
index a7bc994d0e..08fe361ffe 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-power7.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC32/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S
index 75b254fc20..293174f80b 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan-ppc32.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
index 8f848d7bbc..1a1dcb729b 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
@@ -1,5 +1,5 @@
/* Multiple versions of isnan.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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-power5.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S
index 152b915b7c..a9484177df 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power5.S
@@ -1,5 +1,5 @@
/* isnanf(). PowerPC32/POWER5 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S
index 03c014078d..3565165003 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf-power6.S
@@ -1,5 +1,5 @@
/* isnanf(). PowerPC32/POWER6 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c
index c43c0f3293..0c04a314fb 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c
@@ -1,5 +1,5 @@
/* Multiple versions of isnanf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,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/fpu/multiarch/s_llrint-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-power6.S
index ff96b05033..9a5c6063af 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-power6.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-power6.S
@@ -1,5 +1,5 @@
/* Round double to long int. PowerPC32/Power6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-ppc32.S
index 36ca67875d..61a2fcd619 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint-ppc32.S
@@ -1,5 +1,5 @@
/* llrint function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint.c
index 2ac592eb0a..2981b61129 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint.c
@@ -1,5 +1,5 @@
/* Multiple versions of llrint.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__llrint) __llrint_ppc32 attribute_hidden;
extern __typeof (__llrint) __llrint_power6 attribute_hidden;
@@ -29,12 +30,4 @@ libc_ifunc (__llrint,
? __llrint_power6
: __llrint_ppc32);
-weak_alias (__llrint, llrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
-#endif
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-power6.S
index 8b95159d38..a0c38b3e5a 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-power6.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-power6.S
@@ -1,5 +1,5 @@
/* Round float to long int. PowerPC32/POWER6 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-ppc32.S
index 6746ba0917..eab87b79c3 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf-ppc32.S
@@ -1,5 +1,5 @@
/* llrintf function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf.c
index 77183d44cb..12419451ac 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf.c
@@ -1,5 +1,5 @@
/* Multiple versions of llrintf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__llrintf) __llrintf_ppc32 attribute_hidden;
extern __typeof (__llrintf) __llrintf_power6 attribute_hidden;
@@ -28,4 +29,4 @@ libc_ifunc (__llrintf,
? __llrintf_power6
: __llrintf_ppc32);
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power5+.S
index 39bdc422ef..0c62aa81ea 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power5+.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power5+.S
@@ -1,5 +1,5 @@
/* lround function. PowerPC32/POWER5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power6.S
index 925aa8b5e2..bc0fdd76f5 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power6.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-power6.S
@@ -1,5 +1,5 @@
/* lround function. PowerPC32/POWER6 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-ppc32.S
index 919cc030aa..43a3403d1f 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround-ppc32.S
@@ -1,5 +1,5 @@
/* llround function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround.c
index 38d7790307..7889d71c71 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround.c
@@ -1,5 +1,5 @@
/* Multiple versions of llround.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__llround) __llround_ppc32 attribute_hidden;
extern __typeof (__llround) __llround_power5plus attribute_hidden;
@@ -32,12 +33,4 @@ libc_ifunc (__llround,
? __llround_power5plus
: __llround_ppc32);
-weak_alias (__llround, llround)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __llroundl)
-weak_alias (__llround, llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
-#endif
+libm_alias_double (__llround, llround)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llroundf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llroundf.c
index b475c1d852..ce0ac14dff 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llroundf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llroundf.c
@@ -1,5 +1,5 @@
/* Multiple versions of llroundf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <math.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
/* It's safe to use double-precision implementation for single-precision. */
extern __typeof (__llroundf) __llround_ppc32 attribute_hidden;
@@ -31,4 +32,4 @@ libc_ifunc (__llroundf,
? __llround_power5plus
: __llround_ppc32);
-weak_alias (__llroundf, llroundf)
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-power7.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-power7.c
index 6c83dec9f6..2a9726ce38 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-power7.c
@@ -1,5 +1,5 @@
/* logb(). PowerPC32/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-ppc32.c
index 025aae6fe0..b21fc1a05b 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-ppc32.c
@@ -1,5 +1,5 @@
/* logb(). PowerPC32/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,11 +18,6 @@
#include <math.h>
-#undef weak_alias
-#define weak_alias(a, b)
-#undef strong_alias
-#define strong_alias(a, b)
-
#define __logb __logb_ppc32
#include <sysdeps/ieee754/dbl-64/s_logb.c>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c
index deb72251a8..5f1b0d1e21 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c
@@ -1,5 +1,5 @@
/* Multiple versions of logb.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__logb) __logb_ppc32 attribute_hidden;
extern __typeof (__logb) __logb_power7 attribute_hidden;
@@ -29,13 +30,4 @@ libc_ifunc (__logb,
? __logb_power7
: __logb_ppc32);
-weak_alias (__logb, logb)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__logb, __logbl)
-weak_alias (__logb, logbl)
-#endif
-
-#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
-compat_symbol (libm, logb, logbl, GLIBC_2_0);
-#endif
+libm_alias_double (__logb, logb)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-power7.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-power7.c
index 8f19504ba3..5ad1af97db 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-power7.c
@@ -1,5 +1,5 @@
/* logbf(). PowerPC32/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-ppc32.c
index fabe5cde6f..732934437e 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-ppc32.c
@@ -1,5 +1,5 @@
/* logbf(). PowerPC32 default implementation.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf.c
index 7638e855ee..34314d67f5 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf.c
@@ -1,5 +1,5 @@
/* Multiple versions of logbf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__logbf) __logbf_ppc32 attribute_hidden;
extern __typeof (__logbf) __logbf_power7 attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__logbf,
? __logbf_power7
: __logbf_ppc32);
-weak_alias (__logbf, logbf)
+libm_alias_float (__logb, logb)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-power7.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-power7.c
index 6b2180faf8..2634375191 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-power7.c
@@ -1,5 +1,5 @@
/* logbl(). PowerPC32/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-ppc32.c
index 96cd137146..33d29a7c24 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-ppc32.c
@@ -1,5 +1,5 @@
/* logbl(). PowerPC32/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl.c
index c0014b21cf..9556bc95d9 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl.c
@@ -1,5 +1,5 @@
/* Multiple versions of logbl.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-power6x.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-power6x.S
index 161c5617c3..e75e352091 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-power6x.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-power6x.S
@@ -1,5 +1,5 @@
/* Round double to long int. POWER6x PowerPC32 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-ppc32.S
index 6fb1b89100..14863448cb 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint-ppc32.S
@@ -1,5 +1,5 @@
/* Round double to long int. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint.c
index 90931ee8ab..3f6f34eea5 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint.c
@@ -1,5 +1,5 @@
/* Multiple versions of lrint.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__lrint) __lrint_ppc32 attribute_hidden;
extern __typeof (__lrint) __lrint_power6x attribute_hidden;
@@ -29,12 +30,4 @@ libc_ifunc (__lrint,
__lrint_power6x
: __lrint_ppc32);
-weak_alias (__lrint, lrint)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__lrint, lrintl)
-strong_alias (__lrint, __lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
-#endif
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrintf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrintf.c
index 38965e7fa5..1de8336a5b 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrintf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrintf.c
@@ -1,5 +1,5 @@
/* Multiple versions of lrintf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <math.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
/* It's safe to use double-precision implementation for single-precision. */
extern __typeof (__lrintf) __lrint_ppc32 attribute_hidden;
@@ -28,4 +29,4 @@ libc_ifunc (__lrintf,
__lrint_power6x
: __lrint_ppc32);
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power5+.S
index 988ba829a7..9e99317a85 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power5+.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power5+.S
@@ -1,5 +1,5 @@
/* lround function. POWER5+, PowerPC32 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power6x.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power6x.S
index fc268134c4..7c0a954b56 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power6x.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-power6x.S
@@ -1,5 +1,5 @@
/* lround function. POWER6x, PowerPC32 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-ppc32.S
index 677424f8a4..199c8a3c76 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround-ppc32.S
@@ -1,5 +1,5 @@
/* lround function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround.c
index 8c435258a9..63778e42b3 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround.c
@@ -1,5 +1,5 @@
/* Multiple versions of lround.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__lround) __lround_ppc32 attribute_hidden;
extern __typeof (__lround) __lround_power5plus attribute_hidden;
@@ -32,12 +33,4 @@ libc_ifunc (__lround,
__lround_power5plus
: __lround_ppc32);
-weak_alias (__lround, lround)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
-#endif
+libm_alias_double (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lroundf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lroundf.c
index f420f05205..8b60c03e61 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lroundf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lroundf.c
@@ -1,5 +1,5 @@
/* Multiple versions of lroundf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <math.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
/* It's safe to use double-precision implementation for single-precision. */
extern __typeof (__lroundf) __lround_ppc32 attribute_hidden;
@@ -31,4 +32,4 @@ libc_ifunc (__lroundf,
__lround_power5plus
: __lround_ppc32);
-weak_alias (__lroundf, lroundf)
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-power5+.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-power5+.c
index 8548d397ce..8b42d97a6f 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-power5+.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-power5+.c
@@ -1,5 +1,5 @@
/* PowerPC/POWER5+ implementation for modf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c
index 4e9b758fcc..7eeef17d40 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c
@@ -1,5 +1,5 @@
/* PowerPC32 default implementation for modf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,11 +19,6 @@
#include <math.h>
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-
#define __modf __modf_ppc32
#include <sysdeps/ieee754/dbl-64/s_modf.c>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c
index 70bc64e161..fe810edaef 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c
@@ -1,5 +1,5 @@
/* Multiple versions of modf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__modf) __modf_ppc32 attribute_hidden;
extern __typeof (__modf) __modf_power5plus attribute_hidden;
@@ -29,16 +30,8 @@ libc_ifunc (__modf,
? __modf_power5plus
: __modf_ppc32);
-weak_alias (__modf, modf)
+libm_alias_double (__modf, modf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__modf, __modfl)
-weak_alias (__modf, modfl)
-#endif
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __modf, modfl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __modf, modfl, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-power5+.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-power5+.c
index 9c61d90831..b966d58780 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-power5+.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-power5+.c
@@ -1,5 +1,5 @@
/* PowerPC/POWER5+ implementation for modff.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-ppc32.c
index 4e62915b12..3ba36bf52f 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-ppc32.c
@@ -1,5 +1,5 @@
/* PowerPC32 default implementation for modff.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff.c
index 8b46e81b6a..e1d6e82290 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff.c
@@ -1,5 +1,5 @@
/* Multiple versions of modff.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <math.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__modff) __modff_ppc32 attribute_hidden;
extern __typeof (__modff) __modff_power5plus attribute_hidden;
@@ -27,4 +28,4 @@ libc_ifunc (__modff,
? __modff_power5plus
: __modff_ppc32);
-weak_alias (__modff, modff)
+libm_alias_float (__modf, modf)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round-power5+.S
index 5e8849147f..50fdd1bc44 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round-power5+.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round-power5+.S
@@ -1,5 +1,5 @@
/* round function. PowerPC32/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round-ppc32.S
index b21302eeb4..e3a24275aa 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round-ppc32.S
@@ -1,5 +1,5 @@
/* round function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round.c
index 3b052209a6..65e7801315 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round.c
@@ -1,5 +1,5 @@
/* Multiple versions of round.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__round) __round_ppc32 attribute_hidden;
extern __typeof (__round) __round_power5plus attribute_hidden;
@@ -29,12 +30,4 @@ libc_ifunc (__round,
? __round_power5plus
: __round_ppc32);
-weak_alias (__round, round)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__round, __roundl)
-weak_alias (__round, roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1);
-#endif
+libm_alias_double (__round, round)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf-power5+.S
index 98857b0097..e1974ebc64 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf-power5+.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf-power5+.S
@@ -1,5 +1,5 @@
/* roundf function. PowerPC32/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf-ppc32.S
index ef9b16fa2f..9323cf911a 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf-ppc32.S
@@ -1,5 +1,5 @@
/* roundf function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf.c
index 949e9b8d90..0d923a2ca6 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf.c
@@ -1,5 +1,5 @@
/* Multiple versions of roundf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__roundf) __roundf_ppc32 attribute_hidden;
extern __typeof (__roundf) __roundf_power5plus attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__roundf,
? __roundf_power5plus
: __roundf_ppc32);
-weak_alias (__roundf, roundf)
+libm_alias_float (__round, round)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.S
index 5e8c19f268..3e3441d575 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.S
@@ -1,5 +1,5 @@
/* trunc function. PowerPC32/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.S
index 7e0ec091e4..86e50ad66a 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.S
@@ -1,5 +1,5 @@
/* trunc function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc.c
index e1ca31855b..5712d6a3b2 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc.c
@@ -1,5 +1,5 @@
/* Multiple versions of trunc.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__trunc) __trunc_ppc32 attribute_hidden;
extern __typeof (__trunc) __trunc_power5plus attribute_hidden;
@@ -29,12 +30,4 @@ libc_ifunc (__trunc,
? __trunc_power5plus
: __trunc_ppc32);
-weak_alias (__trunc, trunc)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__trunc, __truncl)
-weak_alias (__trunc, truncl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1);
-#endif
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.S
index a4c4db9af3..dfc3af881a 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.S
@@ -1,5 +1,5 @@
/* truncf function. PowerPC32/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.S
index 6e407fb168..f85dcfe3a9 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.S
@@ -1,5 +1,5 @@
/* truncf function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf.c
index 57116e8a9b..d5d72b52fe 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf.c
@@ -1,5 +1,5 @@
/* Multiple versions of truncf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__truncf) __truncf_ppc32 attribute_hidden;
extern __typeof (__truncf) __truncf_power5plus attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__truncf,
? __truncf_power5plus
: __truncf_ppc32);
-weak_alias (__truncf, truncf)
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-power5.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-power5.S
deleted file mode 100644
index b16e78bc41..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-power5.S
+++ /dev/null
@@ -1,31 +0,0 @@
-/* sqrt function. PowerPC32/POWER5 version.
- 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/>. */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
-
-#define __sqrt __sqrt_power5
-
-#include <sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-ppc32.S
deleted file mode 100644
index 7bf32aa1f3..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-ppc32.S
+++ /dev/null
@@ -1,31 +0,0 @@
-/* sqrt function. PowerPC32 default version.
- 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/>. */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
-
-#define __sqrt __sqrt_ppc32
-
-#include <sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt.c
deleted file mode 100644
index 7569800196..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Multiple versions of sqrt.
- 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/>. */
-
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
-
-extern __typeof (__sqrt) __sqrt_ppc32 attribute_hidden;
-extern __typeof (__sqrt) __sqrt_power5 attribute_hidden;
-
-libc_ifunc (__sqrt,
- (hwcap & PPC_FEATURE_POWER5)
- ? __sqrt_power5
- : __sqrt_ppc32);
-
-weak_alias (__sqrt, sqrt)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__sqrt, __sqrtl)
-weak_alias (__sqrt, sqrtl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-power5.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-power5.S
deleted file mode 100644
index 68b51554f3..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-power5.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* sqrtf function. PowerPC32/POWER5 version.
- 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/>. */
-
-#include <sysdep.h>
-
-#undef weak_alias
-#define weak_alias(a,b)
-
-#define __sqrtf __sqrtf_power5
-
-#include <sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-ppc32.S
deleted file mode 100644
index f9d1cfef53..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-ppc32.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* sqrtf function. PowerPC32 default version.
- 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/>. */
-
-#include <sysdep.h>
-
-#undef weak_alias
-#define weak_alias(a,b)
-
-#define __sqrtf __sqrtf_ppc32
-
-#include <sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf.c
deleted file mode 100644
index b7c8c23fd1..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Multiple versions of sqrtf.
- 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/>. */
-
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
-
-extern __typeof (__sqrtf) __sqrtf_ppc32 attribute_hidden;
-extern __typeof (__sqrtf) __sqrtf_power5 attribute_hidden;
-
-libc_ifunc (__sqrtf,
- (hwcap & PPC_FEATURE_POWER5)
- ? __sqrtf_power5
- : __sqrtf_ppc32);
-
-weak_alias (__sqrtf, sqrtf)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S b/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S
index d55d55d4aa..00c600d18d 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S
@@ -1,5 +1,5 @@
/* Round double to long int. PowerPC32 on PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* long long int[r3, r4] __llrint (double x[fp1]) */
ENTRY (__llrint)
@@ -35,12 +36,4 @@ ENTRY (__llrint)
blr
END (__llrint)
-weak_alias (__llrint, llrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-#endif
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S b/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S
index 712e173c79..ffc323cb43 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S
@@ -1,5 +1,5 @@
/* Round float to long int. PowerPC32 on PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* long long int[r3, r4] __llrintf (float x[fp1]) */
ENTRY (__llrintf)
@@ -34,5 +35,5 @@ ENTRY (__llrintf)
blr
END (__llrintf)
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
index 467e39b81c..5ad89a1486 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
@@ -1,5 +1,5 @@
/* llround function. PowerPC32 on PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
.section .rodata.cst8,"aM",@progbits,8
.align 3
@@ -69,6 +71,11 @@ ENTRY (__llround)
fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */
blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */
bge- cr7,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */
+ /* Test whether an integer to avoid spurious "inexact". */
+ fadd fp3,fp2,fp9
+ fsub fp3,fp3,fp9
+ fcmpu cr5,fp2,fp3
+ beq cr5,.Lnobias
fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */
bge cr1,.Lconvert /* x is positive so don't negate x. */
fnabs fp3,fp3 /* -(|x|+=0.5) */
@@ -92,15 +99,7 @@ ENTRY (__llround)
b .Lconvert
END (__llround)
-weak_alias (__llround, llround)
+libm_alias_double (__llround, llround)
strong_alias (__llround, __llroundf)
-weak_alias (__llround, llroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-#endif
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S b/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
deleted file mode 100644
index b6e87621cc..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
+++ /dev/null
@@ -1,109 +0,0 @@
-/* sqrt function. PowerPC32 version.
- 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-
-/* double [fp1] sqrt (double x [fp1])
- Power4 (ISA V2.0) and above implement sqrt in hardware (not optional).
- The fsqrt instruction generates the correct value for all inputs and
- sets the appropriate floating point exceptions. Extended checking is
- only needed to set errno (via __kernel_standard) if the input value
- is negative.
-
- The fsqrt will set FPCC and FU (Floating Point Unordered or NaN
- to indicated that the input value was negative or NaN. Use Move to
- Condition Register from FPSCR to copy the FPCC field to cr1. The
- branch on summary overflow transfers control to w_sqrt to process
- any error conditions. Otherwise we can return the result directly.
-
- This part of the function is a leaf routine, so no need to stack a
- frame or execute prologue/epilogue code. This means it is safe to
- transfer directly to w_sqrt as long as the input value (f1) is
- preserved. Putting the sqrt result into f2 (double parameter 2)
- allows passing both the input value and sqrt result into the extended
- wrapper so there is no need to recompute.
-
- This tactic avoids the overhead of stacking a frame for the normal
- (non-error) case. Until gcc supports prologue shrink-wrapping
- this is the best we can do. */
-
- .section ".text"
- .machine power4
-EALIGN (__sqrt, 5, 0)
- fsqrt fp2,fp1
- mcrfs cr1,4
- bso- cr1,.Lw_sqrt
- fmr fp1,fp2
- blr
- .align 4
-.Lw_sqrt:
- mflr r0
- stwu r1,-16(r1)
- cfi_adjust_cfa_offset(16)
- fmr fp12,fp2
- stw r0,20(r1)
- stw r30,8(r1)
- cfi_offset(lr,20-16)
- cfi_offset(r30,8-16)
-#ifdef SHARED
- SETUP_GOT_ACCESS(r30,got_label)
- addis r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@ha
- addi r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@l
- lwz r9,_LIB_VERSION@got(30)
- lwz r0,0(r9)
-#else
- lis r9,_LIB_VERSION@ha
- lwz r0,_LIB_VERSION@l(r9)
-#endif
-/* if (_LIB_VERSION == _IEEE_) return z; */
- cmpwi cr7,r0,-1
- beq- cr7,.L4
-/* if (x != x) return z; !isnan*/
- fcmpu cr7,fp1,fp1
- bne- cr7,.L4
-/* if (x < 0.0)
- return __kernel_standard (x, x, 26) */
- fmr fp2,fp1
- fabs fp0,fp1
- li r3,26
- fcmpu cr7,fp1,fp0
- bne- cr7,.L11
-.L4:
- lwz r0,20(r1)
- fmr fp1,fp12
- lwz r30,8(r1)
- addi r1,r1,16
- mtlr r0
- blr
-.L11:
- bl __kernel_standard@plt
- fmr fp12,fp1
- b .L4
- END (__sqrt)
-
-weak_alias (__sqrt, sqrt)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__sqrt, sqrtl)
-strong_alias (__sqrt, __sqrtl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0)
-#endif
-
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S b/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
deleted file mode 100644
index 4403cf3ef0..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
+++ /dev/null
@@ -1,101 +0,0 @@
-/* sqrtf function. PowerPC32 version.
- 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-
-/* float [fp1] sqrts (float x [fp1])
- Power4 (ISA V2.0) and above implement sqrt in hardware (not optional).
- The fsqrts instruction generates the correct value for all inputs and
- sets the appropriate floating point exceptions. Extended checking is
- only needed to set errno (via __kernel_standard) if the input value
- is negative.
-
- The fsqrts will set FPCC and FU (Floating Point Unordered or NaN
- to indicated that the input value was negative or NaN. Use Move to
- Condition Register from FPSCR to copy the FPCC field to cr1. The
- branch on summary overflow transfers control to w_sqrt to process
- any error conditions. Otherwise we can return the result directly.
-
- This part of the function is a leaf routine, so no need to stack a
- frame or execute prologue/epilogue code. This means it is safe to
- transfer directly to w_sqrt as long as the input value (f1) is
- preserved. Putting the sqrt result into f2 (float parameter 2)
- allows passing both the input value and sqrt result into the extended
- wrapper so there is no need to recompute.
-
- This tactic avoids the overhead of stacking a frame for the normal
- (non-error) case. Until gcc supports prologue shrink-wrapping
- this is the best we can do. */
-
- .section ".text"
- .machine power4
-EALIGN (__sqrtf, 5, 0)
- fsqrts fp2,fp1
- mcrfs cr1,4
- bso- cr1,.Lw_sqrtf
- fmr fp1,fp2
- blr
- .align 4
-.Lw_sqrtf:
- mflr r0
- stwu r1,-16(r1)
- cfi_adjust_cfa_offset(16)
- fmr fp12,fp2
- stw r0,20(r1)
- stw r30,8(r1)
- cfi_offset(lr,20-16)
- cfi_offset(r30,8-16)
-#ifdef SHARED
- SETUP_GOT_ACCESS(r30,got_label)
- addis r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@ha
- addi r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@l
- lwz r9,_LIB_VERSION@got(30)
- lwz r0,0(r9)
-#else
- lis r9,_LIB_VERSION@ha
- lwz r0,_LIB_VERSION@l(r9)
-#endif
-/* if (_LIB_VERSION == _IEEE_) return z; */
- cmpwi cr7,r0,-1
- beq- cr7,.L4
-/* if (x != x, 0) return z; !isnan */
- fcmpu cr7,fp1,fp1
- bne- cr7,.L4
-/* if (x < 0.0)
- return __kernel_standard (x, x, 126) */
- fmr fp2,fp1
- fabs fp0,fp1
- li r3,126
- fcmpu cr7,1,0
- bne- cr7,.L11
-.L4:
- lwz r0,20(r1)
- fmr fp1,fp12
- lwz r30,8(r1)
- addi r1,r1,16
- mtlr r0
- blr
-.L11:
- bl __kernel_standard@plt
- fmr fp12,fp1
- b .L4
- END (__sqrtf)
-
-weak_alias (__sqrtf, sqrtf)
-
diff --git a/sysdeps/powerpc/powerpc32/power4/hp-timing.h b/sysdeps/powerpc/powerpc32/power4/hp-timing.h
index 870514d982..10efcac481 100644
--- a/sysdeps/powerpc/powerpc32/power4/hp-timing.h
+++ b/sysdeps/powerpc/powerpc32/power4/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. powerpc64 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index 602a7957ad..cc4bd32482 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC32.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -54,8 +54,8 @@ EALIGN (memcmp, 4, 0)
stwu 1, -64(r1)
cfi_adjust_cfa_offset(64)
stw rWORD8, 48(r1)
- cfi_offset(rWORD8, (48-64))
stw rWORD7, 44(r1)
+ cfi_offset(rWORD8, (48-64))
cfi_offset(rWORD7, (44-64))
bne L(unaligned)
/* At this point we know both strings have the same alignment and the
@@ -747,18 +747,18 @@ L(unaligned):
the actual start of rSTR2. */
clrrwi rSTR2, rSTR2, 2
stw rWORD2_SHIFT, 28(r1)
- cfi_offset(rWORD2_SHIFT, (28-64))
/* Compute the left/right shift counts for the unaligned rSTR2,
compensating for the logical (W aligned) start of rSTR1. */
clrlwi rSHL, rWORD8_SHIFT, 30
clrrwi rSTR1, rSTR1, 2
stw rWORD4_SHIFT, 24(r1)
- cfi_offset(rWORD4_SHIFT, (24-64))
slwi rSHL, rSHL, 3
cmplw cr5, rWORD8_SHIFT, rSTR2
add rN, rN, r12
slwi rWORD6, r12, 3
stw rWORD6_SHIFT, 20(r1)
+ cfi_offset(rWORD2_SHIFT, (28-64))
+ cfi_offset(rWORD4_SHIFT, (24-64))
cfi_offset(rWORD6_SHIFT, (20-64))
subfic rSHR, rSHL, 32
srwi r0, rN, 4 /* Divide by 16 */
@@ -852,15 +852,15 @@ L(duPs4):
.align 4
L(Wunaligned):
stw rWORD8_SHIFT, 32(r1)
- cfi_offset(rWORD8_SHIFT, (32-64))
clrrwi rSTR2, rSTR2, 2
stw rWORD2_SHIFT, 28(r1)
- cfi_offset(rWORD2_SHIFT, (28-64))
srwi r0, rN, 4 /* Divide by 16 */
stw rWORD4_SHIFT, 24(r1)
- cfi_offset(rWORD4_SHIFT, (24-64))
andi. r12, rN, 12 /* Get the W remainder */
stw rWORD6_SHIFT, 20(r1)
+ cfi_offset(rWORD8_SHIFT, (32-64))
+ cfi_offset(rWORD2_SHIFT, (28-64))
+ cfi_offset(rWORD4_SHIFT, (24-64))
cfi_offset(rWORD6_SHIFT, (20-64))
slwi rSHL, rSHL, 3
#ifdef __LITTLE_ENDIAN__
diff --git a/sysdeps/powerpc/powerpc32/power4/memcopy.h b/sysdeps/powerpc/powerpc32/power4/memcopy.h
index a06a8c91a1..8050abc83c 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcopy.h
+++ b/sysdeps/powerpc/powerpc32/power4/memcopy.h
@@ -1,5 +1,5 @@
/* memcopy.h -- definitions for memory copy functions. Generic C version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/sysdeps/powerpc/powerpc32/power4/memcpy.S b/sysdeps/powerpc/powerpc32/power4/memcpy.S
index b844e10288..44866d6b88 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC32 on PowerPC64.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]);
Returns 'dst'.
Memcpy handles short copies (< 32-bytes) using a binary move blocks
diff --git a/sysdeps/powerpc/powerpc32/power4/memset.S b/sysdeps/powerpc/powerpc32/power4/memset.S
index 32866c1aaa..7e8249ed24 100644
--- a/sysdeps/powerpc/powerpc32/power4/memset.S
+++ b/sysdeps/powerpc/powerpc32/power4/memset.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
+/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5]));
Returns 's'.
The memset is done in three sizes: byte (8 bits), word (32 bits),
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S
index 84c991188c..bdadd8b59b 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power6.S
@@ -1,5 +1,5 @@
/* Optimized bzero implementation for PowerPC32/POWER6.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S
index d77f79b52d..30ef633b9c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-power7.S
@@ -1,5 +1,5 @@
/* Optimized bzero implementation for PowerPC32/POWER7.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
index cf54089fe8..1af0a5aa61 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
@@ -1,5 +1,5 @@
/* Optimized bzero implementation for PowerPC32/PPC32.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
index b7304031d5..95a5c8c48f 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
@@ -1,5 +1,5 @@
/* Multiple versions of bzero.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
index 231a5260d9..3ddc33fa60 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
@@ -1,5 +1,5 @@
/* Enumerate available IFUNC implementations of a function. PowerPC32 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h b/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
index 584e720539..cf906ff227 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -37,6 +37,8 @@
#define INIT_ARCH() \
unsigned long int hwcap = __GLRO(dl_hwcap); \
unsigned long int __attribute__((unused)) hwcap2 = __GLRO(dl_hwcap2); \
+ bool __attribute__((unused)) use_cached_memopt = \
+ GLRO(dl_powerpc_cpu_features).use_cached_memopt; \
if (hwcap & PPC_FEATURE_ARCH_2_06) \
hwcap |= PPC_FEATURE_ARCH_2_05 | \
PPC_FEATURE_POWER5_PLUS | \
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-power7.S
index 42ca27c5d7..e8e5f38199 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized memchr implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c
index 9861337693..9333b54257 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c
@@ -1,5 +1,5 @@
/* PowerPC32 default implementation of memchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c
index 7f3ad5532a..ac3d01ef52 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of memchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
index c6af1b5b6d..0fcb0e8a63 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S
@@ -1,5 +1,5 @@
/* Optimized memcmp implementation for POWER7/PowerPC32.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
index b0de61c964..a58c6b88a6 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S
@@ -1,5 +1,5 @@
/* Default memcmp implementation for PowerPC32.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
index c08519c7a1..00e7e7d2a5 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of memcmp.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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-a2.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-a2.S
index dfcd7a7e83..539e260e30 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-a2.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-a2.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC A2.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-cell.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-cell.S
index 99dde71108..cbf7ff5d55 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-cell.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-cell.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for CELL BE PowerPC.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-power6.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-power6.S
index 34153aa709..16f05bf4bc 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-power6.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-power6.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC32 on POWER6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-power7.S
index f8b870cacf..a35b02aa15 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-power7.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC32/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S
index 8f9e6f9221..7c11b12cfe 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S
@@ -1,5 +1,5 @@
/* Default memcpy implementation for PowerPC32.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c
index f379e479a2..7db588fb76 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of memcpy.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,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-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-power7.c
index ea37481590..1b9d70ec80 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-power7.c
@@ -1,5 +1,5 @@
/* Power7 multiarch memmove.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-ppc.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-ppc.c
index aad861d5df..3f300a7db3 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-ppc.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove-ppc.c
@@ -1,5 +1,5 @@
/* Power7 multiarch memmove.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c
index 417318461b..3634f3fcfb 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c
@@ -1,5 +1,5 @@
/* Multiple versions of memmove. PowerPC32 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,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-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-power7.S
index e4200560f4..05f027158b 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-power7.S
@@ -1,5 +1,5 @@
/* Optimized mempcpy implementation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c
index 7e00f34e38..441f7db653 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c
@@ -1,5 +1,5 @@
/* PowerPC32 default implementation of mempcpy.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
index 3c77b5f1bd..caa77de8c4 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of mempcpy.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +17,27 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
# 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/memrchr-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-power7.S
index 1e2cf04d82..faf7e86a9c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized memrchr implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c
index d123be8f34..8f9f279c00 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c
@@ -1,5 +1,5 @@
/* PowerPC32 default implementation of memrchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c
index 7603343947..46e20df350 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of memrchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memset-power6.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memset-power6.S
index f54612d599..f1cd354853 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memset-power6.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memset-power6.S
@@ -1,5 +1,5 @@
/* Optimized 32-bit memset implementation for POWER6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memset-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memset-power7.S
index ec2b434d65..8c488ee36c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memset-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memset-power7.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC32/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S
index 64e1a83134..f2278b48d3 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S
@@ -1,5 +1,5 @@
/* Default memset implementation for PowerPC32.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
index 1d7fc7f2c8..3a2eb17a24 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
@@ -1,5 +1,5 @@
/* Multiple versions of memset.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr-power7.S
index 733c85b662..494084f061 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized rawrawmemchr implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr-ppc32.c
index beb1f2cff0..8ebd039697 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr-ppc32.c
@@ -1,5 +1,5 @@
/* PowerPC32 default implementation of rawmemchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c
index f06030eeeb..14aaf8ea32 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of rawmemchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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/rtld-memcmp.S b/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memcmp.S
index 0b389fa75b..2ffce4b887 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memcmp.S
@@ -1,5 +1,5 @@
/* Loader memcmp implementation for PowerPC32.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memset.S b/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memset.S
index e83ac103d8..3db95ad256 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memset.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memset.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-strchr.S b/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-strchr.S
index b6a8aa034e..bc7eaed61c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-strchr.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-strchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-strnlen.c b/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-strnlen.c
index 9f82e2fa81..fd8aed4112 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-strnlen.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/rtld-strnlen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp-power7.S
index 101ef57008..18695a078a 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp-power7.S
@@ -1,5 +1,5 @@
/* Optimized strcasecmp implementation for PowerPC32.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c
index 547660f265..e05975981b 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcasecmp.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l-power7.S
index e89e66a16c..8d00d285ea 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l-power7.S
@@ -1,5 +1,5 @@
/* Default strcasecmp implementation for PowerPC32.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c
index 3b1bad516a..3a1a84768e 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcasecmp.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchr-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strchr-power7.S
index f229c96ffe..bfa7a7f121 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchr-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized strchr implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchr-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strchr-ppc32.S
index 5f3f4d9c93..7acf9022bd 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchr-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchr-ppc32.S
@@ -1,5 +1,5 @@
/* PowerPC32 default implementation of strchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c
index 2cfde632cb..832914916c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of strchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/strchrnul-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-power7.S
index ac5eca2086..5851294e5e 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-power7.S
@@ -1,5 +1,5 @@
/* Optimized strchrnul implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c
index fa5ba605f8..7ae631f4ee 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul-ppc32.c
@@ -1,5 +1,5 @@
/* PowerPC32 default implementation of strchrnul.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c
index 682aa0fef7..527160f7eb 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c
@@ -1,5 +1,5 @@
/* Multiple versions of strchrnul.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-power7.S
index f2925e0245..d7b0dfa62e 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-power7.S
@@ -1,5 +1,5 @@
/* Optimized strlen implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S
index 4ca5beefba..99de9ca41f 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S
@@ -1,5 +1,5 @@
/* Default strlen implementation for PowerPC32.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c
index af5921a15a..3ce050b8f2 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c
@@ -1,5 +1,5 @@
/* Multiple versions of strlen.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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/strncase-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase-power7.c
index 26bc96bfdf..d29fb55eef 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase-power7.c
@@ -1,5 +1,5 @@
/* Optimized strcasecmp_l implememtation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c
index f7a97b2cf6..a286a7b92e 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncasecmp.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l-power7.c
index 1ef1fa13e1..5540a443a0 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l-power7.c
@@ -1,5 +1,5 @@
/* Optimized strcasecmp_l implememtation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c
index 072698a86d..21ce9ec13d 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncasecmp_l.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-power7.S
index 7f0f38ceb6..f1df407361 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-power7.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for POWER7/PowerPC32.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S
index 8747c0aa22..59dd36daee 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c
index 7cc7628091..cb1cbe72fe 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncmp.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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-power7.S b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-power7.S
index 3251adcefb..d5137f619c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-power7.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-power7.S
@@ -1,5 +1,5 @@
/* Optimized strnlen implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c
index 7cedb7f804..df940d333f 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c
@@ -1,5 +1,5 @@
/* Default strnlen implementation for PowerPC32.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c
index 8f1e7c9e54..d056b74305 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c
@@ -1,5 +1,5 @@
/* Multiple versions of strnlen.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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/power4/multiarch/wcschr-power6.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c
index 9db91ae14f..dacc8af2b7 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c
@@ -1,5 +1,5 @@
/* wcschr.c - Wide Character Search for powerpc32/power6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c
index 1a97d88e5b..2c284076f9 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c
@@ -1,5 +1,5 @@
/* wcschr.c - Wide Character Search for powerpc32/power7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c
index c159c2ead5..340d4f1473 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c
index add1fa1c52..97d55dc11c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcschr
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c
index 2304f9e7dd..9f0ae48363 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c
index 8e0fc288a5..c4d6da5539 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c
index 62b15b7db5..b5d27ac7db 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
index 4392cb285d..85bb8da3c2 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcscpy
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c
index a959771abd..230279368c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c
index fb677efaed..f6f79b8c56 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c
index 4fa56f7546..86d1efeee0 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c
index bb6ef643c9..b0a82bb365 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcsrchr
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c
index 953f9b65b0..6d65ce6fe4 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
index 6bc79428aa..f409a34612 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power4/strncmp.S b/sysdeps/powerpc/powerpc32/power4/strncmp.S
index 75b37c7c04..ac806744eb 100644
--- a/sysdeps/powerpc/powerpc32/power4/strncmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC32.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S
index f61c86f00d..356c7a79ed 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S
@@ -1,5 +1,5 @@
/* ceil function. PowerPC32/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.machine "power5"
EALIGN (__ceil, 4, 0)
@@ -25,12 +26,4 @@ EALIGN (__ceil, 4, 0)
blr
END (__ceil)
-weak_alias (__ceil, ceil)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__ceil, ceill)
-strong_alias (__ceil, __ceill)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
index 9febe2fe35..a0bcda17fd 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S
@@ -1,5 +1,5 @@
/* ceilf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.machine "power5"
EALIGN (__ceilf, 4, 0)
@@ -25,5 +26,5 @@ EALIGN (__ceilf, 4, 0)
blr
END (__ceilf)
-weak_alias (__ceilf, ceilf)
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S
index 03547f496c..e8a15f6c09 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S
@@ -1,5 +1,5 @@
/* floor function. PowerPC32/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.machine "power5"
EALIGN (__floor, 4, 0)
@@ -25,12 +26,4 @@ EALIGN (__floor, 4, 0)
blr
END (__floor)
-weak_alias (__floor, floor)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__floor, floorl)
-strong_alias (__floor, __floorl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
index 4932f571bd..385c40cdef 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S
@@ -1,5 +1,5 @@
/* floorf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.machine "power5"
EALIGN (__floorf, 4, 0)
@@ -25,5 +26,5 @@ EALIGN (__floorf, 4, 0)
blr
END (__floorf)
-weak_alias (__floorf, floorf)
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S
index e33476ed0f..c70c0bd70b 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S
@@ -1,5 +1,5 @@
/* lround function. POWER5+, PowerPC32 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
/* long [r3] llround (float x [fp1])
IEEE 1003.1 lround function. IEEE specifies "round to the nearest
@@ -45,15 +47,7 @@ ENTRY (__llround)
blr
END (__llround)
-weak_alias (__llround, llround)
+libm_alias_double (__llround, llround)
strong_alias (__llround, __llroundf)
-weak_alias (__llround, llroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-#endif
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S
index d86c3807a8..09fa022e9e 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S
+++ b/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S
@@ -1,5 +1,5 @@
/* lround function. POWER5+, PowerPC32 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,8 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
/* long [r3] lround (float x [fp1])
IEEE 1003.1 lround function. IEEE specifies "round to the nearest
@@ -43,15 +45,7 @@ ENTRY (__lround)
blr
END (__lround)
-weak_alias (__lround, lround)
+libm_alias_double (__lround, lround)
strong_alias (__lround, __lroundf)
-weak_alias (__lround, lroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S
index 2c107b145b..36c9bd3bee 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S
@@ -1,5 +1,5 @@
/* round function. PowerPC32/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.machine "power5"
EALIGN (__round, 4, 0)
@@ -25,12 +26,4 @@ EALIGN (__round, 4, 0)
blr
END (__round)
-weak_alias (__round, round)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__round, roundl)
-strong_alias (__round, __roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1)
-#endif
+libm_alias_double (__round, round)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
index 94754a569e..c720e77136 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
@@ -1,5 +1,5 @@
/* roundf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.machine "power5"
EALIGN (__roundf, 4, 0)
@@ -25,5 +26,5 @@ EALIGN (__roundf, 4, 0)
blr
END (__roundf)
-weak_alias (__roundf, roundf)
+libm_alias_float (__round, round)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S
index f77004cbf5..14007e9632 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S
@@ -1,5 +1,5 @@
/* trunc function. PowerPC32/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.machine "power5"
EALIGN (__trunc, 4, 0)
@@ -25,12 +26,4 @@ EALIGN (__trunc, 4, 0)
blr
END (__trunc)
-weak_alias (__trunc, trunc)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__trunc, truncl)
-strong_alias (__trunc, __truncl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
index 1028b7d4d9..092bae7a2d 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
@@ -1,5 +1,5 @@
/* truncf function. PowerPC32/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.machine "power5"
EALIGN (__truncf, 4, 0)
@@ -25,5 +26,5 @@ EALIGN (__truncf, 4, 0)
blr
END (__truncf)
-weak_alias (__truncf, truncf)
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
index 1f7306ec77..f159454e0d 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC32 version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
index 36627a7663..c45e4563da 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
+++ b/sysdeps/powerpc/powerpc32/power5/fpu/s_isnanf.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC32 version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S b/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
deleted file mode 100644
index 1ee8a44df3..0000000000
--- a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
+++ /dev/null
@@ -1,107 +0,0 @@
-/* sqrt function. PowerPC32 version.
- 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-
-/* double [fp1] sqrt (double x [fp1])
- Power4 (ISA V2.0) and above implement sqrt in hardware (not optional).
- The fsqrt instruction generates the correct value for all inputs and
- sets the appropriate floating point exceptions. Extended checking is
- only needed to set errno (via __kernel_standard) if the input value
- is negative.
-
- So compare the input value against the absolute value of itself.
- This will compare equal unless the value is negative (EDOM) or a NAN,
- in which case we branch to the extend wrapper. If equal we can return
- the result directly.
-
- This part of the function looks like a leaf routine, so no need to
- stack a frame or execute prologue/epilogue code. It is safe to
- branch directly to w_sqrt as long as the input value (f1) is
- preserved. Putting the sqrt result into f2 (float parameter 2)
- allows passing both the input value and sqrt result into the extended
- wrapper so there is no need to recompute.
-
- This tactic avoids the overhead of stacking a frame for the normal
- (non-error) case. Until gcc supports prologue shrink-wrapping
- this is the best we can do. */
-
- .section ".text"
- .machine power4
-EALIGN (__sqrt, 5, 0)
- fabs fp0,fp1
- fsqrt fp2,fp1
- fcmpu cr1,fp0,fp1
- bne- cr1,.Lw_sqrt
- fmr fp1,fp2
- blr
- .align 4
-.Lw_sqrt:
- mflr r0
- stwu r1,-16(r1)
- cfi_adjust_cfa_offset(16)
- fmr fp12,fp2
- stw r0,20(r1)
- stw r30,8(r1)
- cfi_offset(lr,20-16)
- cfi_offset(r30,8-16)
-#ifdef SHARED
- SETUP_GOT_ACCESS(r30,got_label)
- addis r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@ha
- addi r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@l
- lwz r9,_LIB_VERSION@got(30)
- lwz r0,0(r9)
-#else
- lis r9,_LIB_VERSION@ha
- lwz r0,_LIB_VERSION@l(r9)
-#endif
-/* if (_LIB_VERSION == _IEEE_) return z; */
- cmpwi cr7,r0,-1
- beq- cr7,.L4
-/* if (x != x) return z; !isnan*/
- fcmpu cr7,fp1,fp1
- bne- cr7,.L4
-/* if (x < 0.0)
- return __kernel_standard (x, x, 26) */
- fmr fp2,fp1
- li r3,26
- bne- cr1,.L11
-.L4:
- lwz r0,20(r1)
- fmr fp1,fp12
- lwz r30,8(r1)
- addi r1,r1,16
- mtlr r0
- blr
-.L11:
- bl __kernel_standard@plt
- fmr fp12,fp1
- b .L4
- END (__sqrt)
-
-weak_alias (__sqrt, sqrt)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__sqrt, sqrtl)
-strong_alias (__sqrt, __sqrtl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0)
-#endif
-
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S b/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
deleted file mode 100644
index 998434c96f..0000000000
--- a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
+++ /dev/null
@@ -1,99 +0,0 @@
-/* sqrtf function. PowerPC32 version.
- 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-
-/* float [fp1] sqrts (float x [fp1])
- Power4 (ISA V2.0) and above implement sqrt in hardware (not optional).
- The fsqrts instruction generates the correct value for all inputs and
- sets the appropriate floating point exceptions. Extended checking is
- only needed to set errno (via __kernel_standard) if the input value
- is negative.
-
- So compare the input value against the absolute value of itself.
- This will compare equal unless the value is negative (EDOM) or a NAN,
- in which case we branch to the extend wrapper. If equal we can return
- the result directly.
-
- This part of the function looks like a leaf routine, so no need to
- stack a frame or execute prologue/epilogue code. It is safe to
- branch directly to w_sqrt as long as the input value (f1) is
- preserved. Putting the sqrt result into f2 (float parameter 2)
- allows passing both the input value and sqrt result into the extended
- wrapper so there is no need to recompute.
-
- This tactic avoids the overhead of stacking a frame for the normal
- (non-error) case. Until gcc supports prologue shrink-wrapping
- this is the best we can do. */
-
- .section ".text"
- .machine power4
-EALIGN (__sqrtf, 5, 0)
- fabs fp0,fp1
- fsqrts fp2,fp1
- fcmpu cr1,fp0,fp1
- bne- cr1,.Lw_sqrtf
- fmr fp1,fp2
- blr
- .align 4
-.Lw_sqrtf:
- mflr r0
- stwu r1,-16(r1)
- cfi_adjust_cfa_offset(16)
- fmr fp12,fp2
- stw r0,20(r1)
- stw r30,8(r1)
- cfi_offset(lr,20-16)
- cfi_offset(r30,8-16)
-#ifdef SHARED
- SETUP_GOT_ACCESS(r30,got_label)
- addis r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@ha
- addi r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@l
- lwz r9,_LIB_VERSION@got(30)
- lwz r0,0(r9)
-#else
- lis r9,_LIB_VERSION@ha
- lwz r0,_LIB_VERSION@l(r9)
-#endif
-/* if (_LIB_VERSION == _IEEE_) return z; */
- cmpwi cr7,r0,-1
- beq- cr7,.L4
-/* if (x != x, 0) return z; !isnan */
- fcmpu cr7,fp1,fp1
- bne- cr7,.L4
-/* if (x < 0.0)
- return __kernel_standard (x, x, 126) */
- fmr fp2,fp1
- li r3,126
- bne- cr1,.L11
-.L4:
- lwz r0,20(r1)
- fmr fp1,fp12
- lwz r30,8(r1)
- addi r1,r1,16
- mtlr r0
- blr
-.L11:
- bl __kernel_standard@plt
- fmr fp12,fp1
- b .L4
- END (__sqrtf)
-
-weak_alias (__sqrtf, sqrtf)
-
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
index caf768fd1b..6069b29644 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
@@ -1,5 +1,5 @@
/* copysign(). PowerPC32/POWER6 version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -19,6 +19,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
/* double [f1] copysign (double [f1] x, double [f2] y);
copysign(x,y) returns a value with the magnitude of x and
@@ -34,25 +36,14 @@ EALIGN (__copysign, 4, 0)
END (__copysign)
hidden_def (__copysign)
-weak_alias (__copysign, copysign)
+libm_alias_double (__copysign, copysign)
/* It turns out that the 'double' version will also always work for
single-precision. */
strong_alias (__copysign, __copysignf)
hidden_def (__copysignf)
-weak_alias (__copysignf, copysignf)
+libm_alias_float (__copysign, copysign)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__copysign, __copysignl)
-weak_alias (__copysign, copysignl)
-#endif
-
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
-compat_symbol (libm, copysign, copysignl, GLIBC_2_0)
-# endif
-#else
-# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, copysign, copysignl, GLIBC_2_0);
-# endif
#endif
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
index a01f6574ad..cecc7c8509 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC32 version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S
index 8fa8ec1019..8faac974fd 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S
+++ b/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S
@@ -1,5 +1,5 @@
/* isnanf(). PowerPC32 version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S
index 04d2c96ec5..4ec398fa99 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S
@@ -1,5 +1,5 @@
/* Round double to long int. PowerPC32 on PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* long long int[r3, r4] __llrint (double x[fp1]) */
ENTRY (__llrint)
@@ -35,12 +36,4 @@ ENTRY (__llrint)
blr
END (__llrint)
-weak_alias (__llrint, llrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-#endif
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
index 50fe46a4a2..bb6b6bc3a2 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
+++ b/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
@@ -1,5 +1,5 @@
/* Round float to long int. PowerPC32 on PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* long long int[r3, r4] __llrintf (float x[fp1]) */
ENTRY (__llrintf)
@@ -34,5 +35,5 @@ ENTRY (__llrintf)
blr
END (__llrintf)
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S
index ece4765d83..fc22a557ad 100644
--- a/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S
@@ -1,5 +1,5 @@
/* lround function. POWER5+, PowerPC32 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
/* long [r3] llround (float x [fp1])
IEEE 1003.1 lround function. IEEE specifies "round to the nearest
@@ -45,15 +47,7 @@ ENTRY (__llround)
blr
END (__llround)
-weak_alias (__llround, llround)
+libm_alias_double (__llround, llround)
strong_alias (__llround, __llroundf)
-weak_alias (__llround, llroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-#endif
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/powerpc/powerpc32/power6/memcpy.S b/sysdeps/powerpc/powerpc32/power6/memcpy.S
index 6dff0ed6df..3ca26a2344 100644
--- a/sysdeps/powerpc/powerpc32/power6/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/power6/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC32 on POWER6.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]);
Returns 'dst'.
Memcpy handles short copies (< 32-bytes) using a binary move blocks
@@ -46,8 +46,8 @@ EALIGN (memcpy, 5, 0)
ble- cr1,L(word_unaligned_short) /* If move < 32 bytes. */
cmplw cr6,10,11
stw 31,24(1)
- cfi_offset(31,(24-32))
stw 30,20(1)
+ cfi_offset(31,(24-32))
cfi_offset(30,(20-32))
mr 30,3
beq .L0
diff --git a/sysdeps/powerpc/powerpc32/power6/memset.S b/sysdeps/powerpc/powerpc32/power6/memset.S
index b2a222edd2..8f5e862199 100644
--- a/sysdeps/powerpc/powerpc32/power6/memset.S
+++ b/sysdeps/powerpc/powerpc32/power6/memset.S
@@ -1,5 +1,5 @@
/* Optimized 32-bit memset implementation for POWER6.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
+/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5]));
Returns 's'.
The memset is done in three sizes: byte (8 bits), word (32 bits),
@@ -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/power6x/fpu/s_lrint.S b/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
index 8e18f5c3f8..ad4a010425 100644
--- a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
+++ b/sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S
@@ -1,5 +1,5 @@
/* Round double to long int. POWER6x PowerPC32 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
.machine "power6"
/* long int[r3] __lrint (double x[fp1]) */
@@ -27,15 +29,7 @@ ENTRY (__lrint)
blr
END (__lrint)
-weak_alias (__lrint, lrint)
+libm_alias_double (__lrint, lrint)
strong_alias (__lrint, __lrintf)
-weak_alias (__lrint, lrintf)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S b/sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S
index e7deaee776..5131d11e17 100644
--- a/sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S
+++ b/sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S
@@ -1,5 +1,5 @@
/* lround function. POWER6x, PowerPC32 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
/* long [r3] lround (float x [fp1])
IEEE 1003.1 lround function. IEEE specifies "round to the nearest
@@ -37,15 +39,7 @@ ENTRY (__lround)
blr
END (__lround)
-weak_alias (__lround, lround)
+libm_alias_double (__lround, lround)
strong_alias (__lround, __lroundf)
-weak_alias (__lround, lroundf)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
index b0dfed49d8..793cf0da94 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
+++ b/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
@@ -1,5 +1,5 @@
/* finite(). PowerPC32/POWER7 version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
index 76ed3346cb..400fec7fdc 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
@@ -1,5 +1,5 @@
/* isinf(). PowerPC32/POWER7 version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
index 873e0d60fe..b8bb0e667e 100644
--- a/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC32/POWER7 version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power7/memchr.S b/sysdeps/powerpc/powerpc32/power7/memchr.S
index 318168b4cf..ec78709c35 100644
--- a/sysdeps/powerpc/powerpc32/power7/memchr.S
+++ b/sysdeps/powerpc/powerpc32/power7/memchr.S
@@ -1,5 +1,5 @@
/* Optimized memchr implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -26,7 +26,16 @@ ENTRY (__memchr)
dcbt 0,r3
clrrwi r8,r3,2
insrwi r4,r4,8,16 /* Replicate byte to word. */
- add r7,r3,r5 /* Calculate the last acceptable address. */
+
+ /* Calculate the last acceptable address and check for possible
+ addition overflow by using satured math:
+ r7 = r3 + r5
+ r7 |= -(r7 < x) */
+ add r7,r3,r5
+ subfc r6,r3,r7
+ subfe r9,r9,r9
+ or r7,r7,r9
+
insrwi r4,r4,16,0
cmplwi r5,16
li r9, -1
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 9c06a89491..8c1a00d635 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1,5 +1,5 @@
/* Optimized memcmp implementation for POWER7/PowerPC32.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -54,8 +54,8 @@ EALIGN (memcmp, 4, 0)
stwu 1, -64(r1)
cfi_adjust_cfa_offset(64)
stw rWORD8, 48(r1)
- cfi_offset(rWORD8, (48-64))
stw rWORD7, 44(r1)
+ cfi_offset(rWORD8, (48-64))
cfi_offset(rWORD7, (44-64))
bne L(unaligned)
/* At this point we know both strings have the same alignment and the
@@ -747,18 +747,18 @@ L(unaligned):
the actual start of rSTR2. */
clrrwi rSTR2, rSTR2, 2
stw rWORD2_SHIFT, 28(r1)
- cfi_offset(rWORD2_SHIFT, (28-64))
/* Compute the left/right shift counts for the unaligned rSTR2,
compensating for the logical (W aligned) start of rSTR1. */
clrlwi rSHL, rWORD8_SHIFT, 30
clrrwi rSTR1, rSTR1, 2
stw rWORD4_SHIFT, 24(r1)
- cfi_offset(rWORD4_SHIFT, (24-64))
slwi rSHL, rSHL, 3
cmplw cr5, rWORD8_SHIFT, rSTR2
add rN, rN, r12
slwi rWORD6, r12, 3
stw rWORD6_SHIFT, 20(r1)
+ cfi_offset(rWORD2_SHIFT, (28-64))
+ cfi_offset(rWORD4_SHIFT, (24-64))
cfi_offset(rWORD6_SHIFT, (20-64))
subfic rSHR, rSHL, 32
srwi r0, rN, 4 /* Divide by 16 */
@@ -852,15 +852,15 @@ L(duPs4):
.align 4
L(Wunaligned):
stw rWORD8_SHIFT, 32(r1)
- cfi_offset(rWORD8_SHIFT, (32-64))
clrrwi rSTR2, rSTR2, 2
stw rWORD2_SHIFT, 28(r1)
- cfi_offset(rWORD2_SHIFT, (28-64))
srwi r0, rN, 4 /* Divide by 16 */
stw rWORD4_SHIFT, 24(r1)
- cfi_offset(rWORD4_SHIFT, (24-64))
andi. r12, rN, 12 /* Get the W remainder */
stw rWORD6_SHIFT, 20(r1)
+ cfi_offset(rWORD8_SHIFT, (32-64))
+ cfi_offset(rWORD2_SHIFT, (28-64))
+ cfi_offset(rWORD4_SHIFT, (24-64))
cfi_offset(rWORD6_SHIFT, (20-64))
slwi rSHL, rSHL, 3
#ifdef __LITTLE_ENDIAN__
diff --git a/sysdeps/powerpc/powerpc32/power7/memcpy.S b/sysdeps/powerpc/powerpc32/power7/memcpy.S
index 2bc7ee268e..76b1c53c43 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC32/POWER7.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -19,7 +19,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]);
Returns 'dst'. */
.machine power7
diff --git a/sysdeps/powerpc/powerpc32/power7/mempcpy.S b/sysdeps/powerpc/powerpc32/power7/mempcpy.S
index f4041f3278..1a3f4ebea1 100644
--- a/sysdeps/powerpc/powerpc32/power7/mempcpy.S
+++ b/sysdeps/powerpc/powerpc32/power7/mempcpy.S
@@ -1,5 +1,5 @@
/* Optimized mempcpy implementation for POWER7.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -19,7 +19,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] __mempcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+/* void * [r3] __mempcpy (void *dst [r3], void *src [r4], size_t len [r5]);
Returns 'dst' + 'len'. */
.machine power7
diff --git a/sysdeps/powerpc/powerpc32/power7/memrchr.S b/sysdeps/powerpc/powerpc32/power7/memrchr.S
index 831bded075..aedae95914 100644
--- a/sysdeps/powerpc/powerpc32/power7/memrchr.S
+++ b/sysdeps/powerpc/powerpc32/power7/memrchr.S
@@ -1,5 +1,5 @@
/* Optimized memrchr implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power7/memset.S b/sysdeps/powerpc/powerpc32/power7/memset.S
index 9cee5f1677..26fa736ab2 100644
--- a/sysdeps/powerpc/powerpc32/power7/memset.S
+++ b/sysdeps/powerpc/powerpc32/power7/memset.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC32/POWER7.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -19,7 +19,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
+/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5]));
Returns 's'. */
.machine power7
diff --git a/sysdeps/powerpc/powerpc32/power7/rawmemchr.S b/sysdeps/powerpc/powerpc32/power7/rawmemchr.S
index 264ff00854..a886e13c90 100644
--- a/sysdeps/powerpc/powerpc32/power7/rawmemchr.S
+++ b/sysdeps/powerpc/powerpc32/power7/rawmemchr.S
@@ -1,5 +1,5 @@
/* Optimized rawmemchr implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power7/strcasecmp.S b/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
index 9a414ac0f0..7bd8b43166 100644
--- a/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
@@ -1,5 +1,5 @@
/* Optimized strcasecmp implementation for PowerPC32.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
or if defined USE_IN_EXTENDED_LOCALE_MODEL:
int [r3] strcasecmp_l (const char *s1 [r3], const char *s2 [r4],
- __locale_t loc [r5]) */
+ locale_t loc [r5]) */
#ifndef STRCMP
# define __STRCMP __strcasecmp
diff --git a/sysdeps/powerpc/powerpc32/power7/strchr.S b/sysdeps/powerpc/powerpc32/power7/strchr.S
index fa09e144a7..54bb4ad502 100644
--- a/sysdeps/powerpc/powerpc32/power7/strchr.S
+++ b/sysdeps/powerpc/powerpc32/power7/strchr.S
@@ -1,5 +1,5 @@
/* Optimized strchr implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power7/strchrnul.S b/sysdeps/powerpc/powerpc32/power7/strchrnul.S
index a9b785b04f..634bf56e62 100644
--- a/sysdeps/powerpc/powerpc32/power7/strchrnul.S
+++ b/sysdeps/powerpc/powerpc32/power7/strchrnul.S
@@ -1,5 +1,5 @@
/* Optimized strchrnul implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power7/strlen.S b/sysdeps/powerpc/powerpc32/power7/strlen.S
index ecc1c8e105..f7d1ebb8d4 100644
--- a/sysdeps/powerpc/powerpc32/power7/strlen.S
+++ b/sysdeps/powerpc/powerpc32/power7/strlen.S
@@ -1,5 +1,5 @@
/* Optimized strlen implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc32/power7/strncmp.S b/sysdeps/powerpc/powerpc32/power7/strncmp.S
index 0e96c6d74e..9fe8e419ae 100644
--- a/sysdeps/powerpc/powerpc32/power7/strncmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for POWER7/PowerPC32.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/power7/strnlen.S b/sysdeps/powerpc/powerpc32/power7/strnlen.S
index 00d80dd330..2f28acc99a 100644
--- a/sysdeps/powerpc/powerpc32/power7/strnlen.S
+++ b/sysdeps/powerpc/powerpc32/power7/strnlen.S
@@ -1,5 +1,5 @@
/* Optimized strnlen implementation for PowerPC32/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
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..b3cf011ff5 100644
--- a/sysdeps/powerpc/powerpc32/ppc-mcount.S
+++ b/sysdeps/powerpc/powerpc32/ppc-mcount.S
@@ -1,5 +1,5 @@
/* PowerPC-specific implementation of profiling support.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,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/powerpc32/register-dump.h b/sysdeps/powerpc/powerpc32/register-dump.h
index f98bc59be3..e4b1f25233 100644
--- a/sysdeps/powerpc/powerpc32/register-dump.h
+++ b/sysdeps/powerpc/powerpc32/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/rshift.S b/sysdeps/powerpc/powerpc32/rshift.S
index dca9fd15e1..90e3c7898c 100644
--- a/sysdeps/powerpc/powerpc32/rshift.S
+++ b/sysdeps/powerpc/powerpc32/rshift.S
@@ -1,5 +1,5 @@
/* Shift a limb right, low level routine.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/setjmp-common.S b/sysdeps/powerpc/powerpc32/setjmp-common.S
index 7dd0b5f497..f271d244e9 100644
--- a/sysdeps/powerpc/powerpc32/setjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/setjmp-common.S
@@ -1,5 +1,5 @@
/* setjmp for PowerPC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/setjmp.S b/sysdeps/powerpc/powerpc32/setjmp.S
index 88f7f828ce..ba69bdc279 100644
--- a/sysdeps/powerpc/powerpc32/setjmp.S
+++ b/sysdeps/powerpc/powerpc32/setjmp.S
@@ -1,5 +1,5 @@
/* non altivec (old) version of setjmp for PowerPC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,6 +31,7 @@ versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4)
# define __sigsetjmp_symbol __vmx__sigsetjmp
# define __sigjmp_save_symbol __vmx__sigjmp_save
# include "setjmp-common.S"
+libc_hidden_ver (__vmx__sigsetjmp, __sigsetjmp)
# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
# define __NO_VMX__
diff --git a/sysdeps/powerpc/powerpc32/start.S b/sysdeps/powerpc/powerpc32/start.S
index 243cb8e744..5c10a22f8a 100644
--- a/sysdeps/powerpc/powerpc32/start.S
+++ b/sysdeps/powerpc/powerpc32/start.S
@@ -1,5 +1,5 @@
/* Startup code for programs linked with GNU libc.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/stpcpy.S b/sysdeps/powerpc/powerpc32/stpcpy.S
index c8c4213a31..bb7a0f4e00 100644
--- a/sysdeps/powerpc/powerpc32/stpcpy.S
+++ b/sysdeps/powerpc/powerpc32/stpcpy.S
@@ -1,5 +1,5 @@
/* Optimized stpcpy implementation for PowerPC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/strchr.S b/sysdeps/powerpc/powerpc32/strchr.S
index 40e4c95cc3..38983a2d9e 100644
--- a/sysdeps/powerpc/powerpc32/strchr.S
+++ b/sysdeps/powerpc/powerpc32/strchr.S
@@ -1,5 +1,5 @@
/* Optimized strchr implementation for PowerPC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/strcmp.S b/sysdeps/powerpc/powerpc32/strcmp.S
index 67ca856b72..bd038dbe5b 100644
--- a/sysdeps/powerpc/powerpc32/strcmp.S
+++ b/sysdeps/powerpc/powerpc32/strcmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/strcpy.S b/sysdeps/powerpc/powerpc32/strcpy.S
index 05fcc52d0c..757dad9f08 100644
--- a/sysdeps/powerpc/powerpc32/strcpy.S
+++ b/sysdeps/powerpc/powerpc32/strcpy.S
@@ -1,5 +1,5 @@
/* Optimized strcpy implementation for PowerPC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/strlen.S b/sysdeps/powerpc/powerpc32/strlen.S
index 9582bf142b..23a6f8a7a2 100644
--- a/sysdeps/powerpc/powerpc32/strlen.S
+++ b/sysdeps/powerpc/powerpc32/strlen.S
@@ -1,5 +1,5 @@
/* Optimized strlen implementation for PowerPC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/strncmp.S b/sysdeps/powerpc/powerpc32/strncmp.S
index b7ae2fc95c..2bbd4a455b 100644
--- a/sysdeps/powerpc/powerpc32/strncmp.S
+++ b/sysdeps/powerpc/powerpc32/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC32.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/sub_n.S b/sysdeps/powerpc/powerpc32/sub_n.S
index 2f8517f034..698e71c6aa 100644
--- a/sysdeps/powerpc/powerpc32/sub_n.S
+++ b/sysdeps/powerpc/powerpc32/sub_n.S
@@ -1,5 +1,5 @@
/* Subtract two limb vectors of equal, non-zero length for PowerPC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/submul_1.S b/sysdeps/powerpc/powerpc32/submul_1.S
index 7e54529dfb..8522a545d2 100644
--- a/sysdeps/powerpc/powerpc32/submul_1.S
+++ b/sysdeps/powerpc/powerpc32/submul_1.S
@@ -1,5 +1,5 @@
/* Multiply a limb vector by a single limb, for PowerPC.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc32/symbol-hacks.h b/sysdeps/powerpc/powerpc32/symbol-hacks.h
new file mode 100644
index 0000000000..b986020b33
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/symbol-hacks.h
@@ -0,0 +1,21 @@
+/* Hacks needed for symbol manipulation. powerpc version.
+ Copyright (C) 2017-2018 Free Software 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 <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
+
+#include_next "symbol-hacks.h"
diff --git a/sysdeps/powerpc/powerpc32/sysdep.h b/sysdeps/powerpc/powerpc32/sysdep.h
index 241cc8069d..5f1294ead3 100644
--- a/sysdeps/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/powerpc/powerpc32/sysdep.h
@@ -1,5 +1,5 @@
/* Assembly macros for 32-bit PowerPC.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -43,6 +43,8 @@
cfi_startproc; \
CALL_MCOUNT
+#define ENTRY_TOCLESS(name) ENTRY(name)
+
/* helper macro for accessing the 32-bit powerpc GOT. */
#define SETUP_GOT_ACCESS(regname,GOT_LABEL) \
@@ -88,8 +90,8 @@ GOT_LABEL: ; \
cfi_endproc; \
ASM_SIZE_DIRECTIVE(name)
-#if ! IS_IN(rtld) && defined (ENABLE_LOCK_ELISION)
-# define ABORT_TRANSACTION \
+#if !IS_IN(rtld) && !defined(__SPE__)
+# define ABORT_TRANSACTION_IMPL \
cmpwi 2,0; \
beq 1f; \
lwz 0,TM_CAPABLE(2); \
@@ -100,8 +102,9 @@ GOT_LABEL: ; \
.align 4; \
1:
#else
-# define ABORT_TRANSACTION
+# define ABORT_TRANSACTION_IMPL
#endif
+#define ABORT_TRANSACTION ABORT_TRANSACTION_IMPL
#define DO_CALL(syscall) \
ABORT_TRANSACTION \
diff --git a/sysdeps/powerpc/powerpc32/tst-audit.h b/sysdeps/powerpc/powerpc32/tst-audit.h
index 8e9a02c30b..735f94edcf 100644
--- a/sysdeps/powerpc/powerpc32/tst-audit.h
+++ b/sysdeps/powerpc/powerpc32/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. PowerPC32 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc64/970/Implies b/sysdeps/powerpc/powerpc64/970/Implies
deleted file mode 100644
index bedb20b65c..0000000000
--- a/sysdeps/powerpc/powerpc64/970/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/power4/fpu
-powerpc/powerpc64/power4
diff --git a/sysdeps/powerpc/powerpc64/Makefile b/sysdeps/powerpc/powerpc64/Makefile
index 9d15db0328..a0bd0c9504 100644
--- a/sysdeps/powerpc/powerpc64/Makefile
+++ b/sysdeps/powerpc/powerpc64/Makefile
@@ -47,3 +47,15 @@ ifeq ($(subdir),gmon)
CFLAGS-mcount.c += $(no-special-regs)
sysdep_routines += ppc-mcount
endif
+
+ifeq ($(subdir),setjmp)
+tests += tst-setjmp-bug21895-static
+tests-static += tst-setjmp-bug21895-static
+modules-names += setjmp-bug21895
+
+$(objpfx)tst-setjmp-bug21895-static: $(common-objpfx)dlfcn/libdl.a
+$(objpfx)tst-setjmp-bug21895-static.out: $(objpfx)setjmp-bug21895.so
+
+tst-setjmp-bug21895-static-ENV = \
+ LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)setjmp:$(common-objpfx)elf
+endif
diff --git a/sysdeps/powerpc/powerpc64/__longjmp-common.S b/sysdeps/powerpc/powerpc64/__longjmp-common.S
index ff5d4cfa1f..99c17c5797 100644
--- a/sysdeps/powerpc/powerpc64/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc64/__longjmp-common.S
@@ -1,5 +1,5 @@
/* longjmp for PowerPC64.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -130,9 +130,6 @@ L(no_vmx):
ld r0,(JB_LR*8)(r3)
ld r14,((JB_GPRS+0)*8)(r3)
lfd fp14,((JB_FPRS+0)*8)(r3)
-#if defined SHARED && !IS_IN (rtld)
- std r2,FRAME_TOC_SAVE(r1) /* Restore the callers TOC save area. */
-#endif
ld r15,((JB_GPRS+1)*8)(r3)
lfd fp15,((JB_FPRS+1)*8)(r3)
ld r16,((JB_GPRS+2)*8)(r3)
@@ -152,7 +149,7 @@ L(no_vmx):
second argument (-4@4), and target address (8@0), respectively. */
LIBC_PROBE (longjmp, 3, 8@3, -4@4, 8@0)
mtlr r0
-/* std r2,FRAME_TOC_SAVE(r1) Restore the TOC save area. */
+ std r2,FRAME_TOC_SAVE(r1) /* Restore the TOC save area. */
ld r21,((JB_GPRS+7)*8)(r3)
lfd fp21,((JB_FPRS+7)*8)(r3)
ld r22,((JB_GPRS+8)*8)(r3)
diff --git a/sysdeps/powerpc/powerpc64/__longjmp.S b/sysdeps/powerpc/powerpc64/__longjmp.S
index 029e089d67..c84b420686 100644
--- a/sysdeps/powerpc/powerpc64/__longjmp.S
+++ b/sysdeps/powerpc/powerpc64/__longjmp.S
@@ -1,5 +1,5 @@
/* AltiVec/VMX (new) version of __longjmp for PowerPC64.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/a2/memcpy.S b/sysdeps/powerpc/powerpc64/a2/memcpy.S
index 31a0b5dabe..488ab6dde3 100644
--- a/sysdeps/powerpc/powerpc64/a2/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/a2/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC A2.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Michael Brutman <brutman@us.ibm.com>.
This file is part of the GNU C Library.
@@ -19,6 +19,10 @@
#include <sysdep.h>
+#ifndef MEMCPY
+# define MEMCPY memcpy
+#endif
+
#define PREFETCH_AHEAD 4 /* no cache lines SRC prefetching ahead */
#define ZERO_AHEAD 2 /* no cache lines DST zeroing ahead */
@@ -30,7 +34,7 @@
.machine a2
-EALIGN (memcpy, 5, 0)
+ENTRY (MEMCPY, 5)
CALL_MCOUNT 3
dcbt 0,r4 /* Prefetch ONE SRC cacheline */
@@ -520,5 +524,5 @@ L(endloop2_128):
b L(lessthancacheline)
-END_GEN_TB (memcpy,TB_TOCLESS)
+END_GEN_TB (MEMCPY,TB_TOCLESS)
libc_hidden_builtin_def (memcpy)
diff --git a/sysdeps/powerpc/powerpc64/addmul_1.S b/sysdeps/powerpc/powerpc64/addmul_1.S
index f222e2c6a4..48e3b1b290 100644
--- a/sysdeps/powerpc/powerpc64/addmul_1.S
+++ b/sysdeps/powerpc/powerpc64/addmul_1.S
@@ -1,6 +1,6 @@
/* PowerPC64 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
the result to a second limb vector.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,7 +34,7 @@
#define N r5
#define VL r6
-EALIGN(FUNC, 5, 0)
+ENTRY_TOCLESS (FUNC, 5)
std r31, -8(r1)
rldicl. r0, N, 0, 62
std r30, -16(r1)
diff --git a/sysdeps/powerpc/powerpc64/atomic-machine.h b/sysdeps/powerpc/powerpc64/atomic-machine.h
index 751487a3a7..1f09c52bd2 100644
--- a/sysdeps/powerpc/powerpc64/atomic-machine.h
+++ b/sysdeps/powerpc/powerpc64/atomic-machine.h
@@ -1,5 +1,5 @@
/* Atomic operations. PowerPC64 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
@@ -35,6 +35,7 @@
#define __HAVE_64B_ATOMICS 1
#define USE_ATOMIC_COMPILER_BUILTINS 0
+#define ATOMIC_EXCHANGE_USES_CAS 1
/* The 32-bit exchange_bool is different on powerpc64 because the subf
does signed 64-bit arithmetic while the lwarx is 32-bit unsigned
@@ -58,23 +59,6 @@
__tmp != 0; \
})
-#define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval) \
-({ \
- unsigned int __tmp, __tmp2; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
- " clrldi %1,%1,32\n" \
- "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
- " stwcx. %4,0,%2\n" \
- " bne- 1b\n" \
- "2: " \
- : "=&r" (__tmp), "=r" (__tmp2) \
- : "b" (mem), "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
-})
-
/*
* Only powerpc64 processors support Load doubleword and reserve index (ldarx)
* and Store doubleword conditional indexed (stdcx) instructions. So here
@@ -96,22 +80,6 @@
__tmp != 0; \
})
-#define __arch_compare_and_exchange_bool_64_rel(mem, newval, oldval) \
-({ \
- unsigned long __tmp; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
- "1: ldarx %0,0,%1" MUTEX_HINT_REL "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
- " stdcx. %3,0,%1\n" \
- " bne- 1b\n" \
- "2: " \
- : "=&r" (__tmp) \
- : "b" (mem), "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
-})
-
#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
({ \
__typeof (*(mem)) __tmp; \
diff --git a/sysdeps/powerpc/powerpc64/backtrace.c b/sysdeps/powerpc/powerpc64/backtrace.c
index edd53bb619..c0c4b48262 100644
--- a/sysdeps/powerpc/powerpc64/backtrace.c
+++ b/sysdeps/powerpc/powerpc64/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software 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,10 +16,12 @@
License along with the GNU C Library; see the file COPYING.LIB. If
not, see <http://www.gnu.org/licenses/>. */
-#include <execinfo.h>
#include <stddef.h>
#include <string.h>
#include <signal.h>
+#include <stdint.h>
+
+#include <execinfo.h>
#include <libc-vdso.h>
/* This is the stack layout we see with every stack frame.
@@ -37,7 +39,7 @@
struct layout
{
struct layout *next;
- long condition_register;
+ long int condition_register;
void *return_address;
};
@@ -47,16 +49,16 @@ struct layout
dummy frame to make it look like it has a caller. */
struct signal_frame_64 {
#define SIGNAL_FRAMESIZE 128
- char dummy[SIGNAL_FRAMESIZE];
- struct ucontext uc;
+ char dummy[SIGNAL_FRAMESIZE];
+ ucontext_t uc;
/* We don't care about the rest, since the IP value is at 'uc' field. */
};
static inline int
-is_sigtramp_address (unsigned long nip)
+is_sigtramp_address (void *nip)
{
#ifdef SHARED
- if (nip == (unsigned long)__vdso_sigtramp_rt64)
+ if (nip == VDSO_SYMBOL (sigtramp_rt64))
return 1;
#endif
return 0;
@@ -82,10 +84,11 @@ __backtrace (void **array, int size)
/* Check if the symbol is the signal trampoline and get the interrupted
* symbol address from the trampoline saved area. */
- if (is_sigtramp_address ((unsigned long)current->return_address))
+ if (is_sigtramp_address (current->return_address))
{
struct signal_frame_64 *sigframe = (struct signal_frame_64*) current;
- array[++count] = (void*)sigframe->uc.uc_mcontext.gp_regs[PT_NIP];
+ array[++count] = (void*) sigframe->uc.uc_mcontext.gp_regs[PT_NIP];
+ current = (void*) sigframe->uc.uc_mcontext.gp_regs[PT_R1];
}
}
diff --git a/sysdeps/powerpc/powerpc64/be/970/Implies b/sysdeps/powerpc/powerpc64/be/970/Implies
new file mode 100644
index 0000000000..ac431fa96e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/970/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power4
diff --git a/sysdeps/powerpc/powerpc64/be/Implies b/sysdeps/powerpc/powerpc64/be/Implies
new file mode 100644
index 0000000000..a105a325f7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64
diff --git a/sysdeps/powerpc/powerpc64/be/Implies-after b/sysdeps/powerpc/powerpc64/be/Implies-after
new file mode 100644
index 0000000000..78dba9510c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/Implies-after
@@ -0,0 +1,5 @@
+# On PowerPC we use the IBM extended long double format.
+ieee754/ldbl-128ibm
+ieee754/ldbl-opt
+ieee754/dbl-64
+ieee754/flt-32
diff --git a/sysdeps/powerpc/powerpc64/be/a2/Implies b/sysdeps/powerpc/powerpc64/be/a2/Implies
new file mode 100644
index 0000000000..6c02123791
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/a2/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/a2
diff --git a/sysdeps/powerpc/powerpc64/be/cell/Implies b/sysdeps/powerpc/powerpc64/be/cell/Implies
new file mode 100644
index 0000000000..d6b89b15d3
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/cell/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/cell
diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/Implies b/sysdeps/powerpc/powerpc64/be/fpu/Implies
index c1f617b7da..c1f617b7da 100644
--- a/sysdeps/powerpc/powerpc64/power4/fpu/Implies
+++ b/sysdeps/powerpc/powerpc64/be/fpu/Implies
diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Implies
index 8d6531a174..8d6531a174 100644
--- a/sysdeps/powerpc/powerpc64/power4/fpu/multiarch/Implies
+++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Implies
diff --git a/sysdeps/powerpc/powerpc64/power4/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/multiarch/Implies
index 30edcf7f9d..30edcf7f9d 100644
--- a/sysdeps/powerpc/powerpc64/power4/multiarch/Implies
+++ b/sysdeps/powerpc/powerpc64/be/multiarch/Implies
diff --git a/sysdeps/powerpc/powerpc64/be/power4/Implies b/sysdeps/powerpc/powerpc64/be/power4/Implies
new file mode 100644
index 0000000000..6d067e28ec
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power4/Implies
@@ -0,0 +1,3 @@
+powerpc/powerpc64/power4
+powerpc/power4/fpu
+powerpc/power4
diff --git a/sysdeps/powerpc/powerpc64/be/power4/fpu/Implies b/sysdeps/powerpc/powerpc64/be/power4/fpu/Implies
new file mode 100644
index 0000000000..c1f617b7da
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power4/fpu/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/fpu
diff --git a/sysdeps/powerpc/powerpc64/be/power4/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power4/fpu/multiarch/Implies
new file mode 100644
index 0000000000..8d6531a174
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power4/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power4/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power4/multiarch/Implies
new file mode 100644
index 0000000000..30edcf7f9d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power4/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power5+/Implies b/sysdeps/powerpc/powerpc64/be/power5+/Implies
new file mode 100644
index 0000000000..03852149d4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power5+/Implies
@@ -0,0 +1,5 @@
+powerpc/powerpc64/power5+
+powerpc/power5+/fpu
+powerpc/power5+
+powerpc/powerpc64/be/power5/fpu
+powerpc/powerpc64/be/power5
diff --git a/sysdeps/powerpc/powerpc64/be/power5+/fpu/Implies b/sysdeps/powerpc/powerpc64/be/power5+/fpu/Implies
new file mode 100644
index 0000000000..25f20b1d8e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power5+/fpu/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power5+/fpu
+powerpc/powerpc64/be/power5/fpu
diff --git a/sysdeps/powerpc/powerpc64/be/power5+/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power5+/fpu/multiarch/Implies
new file mode 100644
index 0000000000..5985565e0f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power5+/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power5/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power5+/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power5+/multiarch/Implies
new file mode 100644
index 0000000000..818920343d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power5+/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power5/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power5/Implies b/sysdeps/powerpc/powerpc64/be/power5/Implies
new file mode 100644
index 0000000000..e50a23b357
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power5/Implies
@@ -0,0 +1,3 @@
+powerpc/powerpc64/power5
+powerpc/powerpc64/be/power4/fpu
+powerpc/powerpc64/be/power4
diff --git a/sysdeps/powerpc/powerpc64/be/power5/fpu/Implies b/sysdeps/powerpc/powerpc64/be/power5/fpu/Implies
new file mode 100644
index 0000000000..58ab3b7abb
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power5/fpu/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power5/fpu
+powerpc/powerpc64/be/power4/fpu/
diff --git a/sysdeps/powerpc/powerpc64/be/power5/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power5/fpu/multiarch/Implies
new file mode 100644
index 0000000000..f2fffcb96f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power5/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power4/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power5/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power5/multiarch/Implies
new file mode 100644
index 0000000000..a9cda70bcd
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power5/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power4/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power6/Implies b/sysdeps/powerpc/powerpc64/be/power6/Implies
new file mode 100644
index 0000000000..c0e0be57b6
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power6/Implies
@@ -0,0 +1,3 @@
+powerpc/powerpc64/power6
+powerpc/powerpc64/be/power5+/fpu
+powerpc/powerpc64/be/power5+
diff --git a/sysdeps/powerpc/powerpc64/be/power6/fpu/Implies b/sysdeps/powerpc/powerpc64/be/power6/fpu/Implies
new file mode 100644
index 0000000000..a16a96e9eb
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power6/fpu/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power6/fpu
+powerpc/powerpc64/be/power5+/fpu
diff --git a/sysdeps/powerpc/powerpc64/be/power6/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power6/fpu/multiarch/Implies
new file mode 100644
index 0000000000..ef0f432215
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power6/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power5+/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power6/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power6/multiarch/Implies
new file mode 100644
index 0000000000..9510043332
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power6/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power5+/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power6x/Implies b/sysdeps/powerpc/powerpc64/be/power6x/Implies
new file mode 100644
index 0000000000..018c999e10
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power6x/Implies
@@ -0,0 +1,3 @@
+powerpc/powerpc64/power6x
+powerpc/powerpc64/be/power6/fpu
+powerpc/powerpc64/be/power6
diff --git a/sysdeps/powerpc/powerpc64/be/power6x/fpu/Implies b/sysdeps/powerpc/powerpc64/be/power6x/fpu/Implies
new file mode 100644
index 0000000000..4d1744c0b4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power6x/fpu/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power6x/fpu
+powerpc/powerpc64/be/power6/fpu
diff --git a/sysdeps/powerpc/powerpc64/be/power6x/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power6x/fpu/multiarch/Implies
new file mode 100644
index 0000000000..6da6f27f08
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power6x/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power6/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power6x/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power6x/multiarch/Implies
new file mode 100644
index 0000000000..86cbf9e528
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power6x/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power6/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power7/Implies b/sysdeps/powerpc/powerpc64/be/power7/Implies
new file mode 100644
index 0000000000..b1853f1873
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power7/Implies
@@ -0,0 +1,3 @@
+powerpc/powerpc64/power7
+powerpc/powerpc64/be/power6/fpu
+powerpc/powerpc64/be/power6
diff --git a/sysdeps/powerpc/powerpc64/be/power7/fpu/Implies b/sysdeps/powerpc/powerpc64/be/power7/fpu/Implies
new file mode 100644
index 0000000000..33830fe120
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power7/fpu/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power7/fpu
+powerpc/powerpc64/be/power6/fpu
diff --git a/sysdeps/powerpc/powerpc64/be/power7/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power7/fpu/multiarch/Implies
new file mode 100644
index 0000000000..6da6f27f08
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power7/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power6/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power7/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power7/multiarch/Implies
new file mode 100644
index 0000000000..86cbf9e528
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power7/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power6/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power8/Implies b/sysdeps/powerpc/powerpc64/be/power8/Implies
new file mode 100644
index 0000000000..cdaa47e809
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power8/Implies
@@ -0,0 +1,3 @@
+powerpc/powerpc64/power8
+powerpc/powerpc64/be/power7/fpu
+powerpc/powerpc64/be/power7
diff --git a/sysdeps/powerpc/powerpc64/be/power8/fpu/Implies b/sysdeps/powerpc/powerpc64/be/power8/fpu/Implies
new file mode 100644
index 0000000000..72e9f54efc
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power8/fpu/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power8/fpu
+powerpc/powerpc64/be/power7/fpu/
diff --git a/sysdeps/powerpc/powerpc64/be/power8/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power8/fpu/multiarch/Implies
new file mode 100644
index 0000000000..babe3de793
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power8/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power7/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power8/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power8/multiarch/Implies
new file mode 100644
index 0000000000..8ec7fa2c54
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power8/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power7/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power9/Implies b/sysdeps/powerpc/powerpc64/be/power9/Implies
new file mode 100644
index 0000000000..9b40c0f58c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power9/Implies
@@ -0,0 +1,3 @@
+powerpc/powerpc64/power9
+powerpc/powerpc64/be/power8/fpu
+powerpc/powerpc64/be/power8
diff --git a/sysdeps/powerpc/powerpc64/be/power9/fpu/Implies b/sysdeps/powerpc/powerpc64/be/power9/fpu/Implies
new file mode 100644
index 0000000000..bdec0f9295
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power9/fpu/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power9/fpu
+powerpc/powerpc64/be/power8/fpu
diff --git a/sysdeps/powerpc/powerpc64/be/power9/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power9/fpu/multiarch/Implies
new file mode 100644
index 0000000000..93e2a02716
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power9/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power8/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power9/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power9/multiarch/Implies
new file mode 100644
index 0000000000..8bea6abe00
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power9/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/power8/multiarch
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/bzero.S b/sysdeps/powerpc/powerpc64/bzero.S
index 56806fcd5a..c66824a931 100644
--- a/sysdeps/powerpc/powerpc64/bzero.S
+++ b/sysdeps/powerpc/powerpc64/bzero.S
@@ -1,5 +1,5 @@
/* Optimized bzero `implementation' for PowerPC64.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/cell/memcpy.S b/sysdeps/powerpc/powerpc64/cell/memcpy.S
index d5dc9c4a35..3e07003b58 100644
--- a/sysdeps/powerpc/powerpc64/cell/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/cell/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for CELL BE PowerPC.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,10 @@
#include <sysdep.h>
+#ifndef MEMCPY
+# define MEMCPY memcpy
+#endif
+
#define PREFETCH_AHEAD 6 /* no cache lines SRC prefetching ahead */
#define ZERO_AHEAD 4 /* no cache lines DST zeroing ahead */
@@ -39,7 +43,7 @@
.align 7
-EALIGN (memcpy, 5, 0)
+ENTRY_TOCLESS (MEMCPY, 5)
CALL_MCOUNT 3
dcbt 0,r4 /* Prefetch ONE SRC cacheline */
@@ -238,5 +242,5 @@ EALIGN (memcpy, 5, 0)
stb r0,0(r6)
1: blr
-END_GEN_TB (memcpy,TB_TOCLESS)
+END_GEN_TB (MEMCPY,TB_TOCLESS)
libc_hidden_builtin_def (memcpy)
diff --git a/sysdeps/powerpc/powerpc64/crti.S b/sysdeps/powerpc/powerpc64/crti.S
index e1b68a8634..2242deb3dd 100644
--- a/sysdeps/powerpc/powerpc64/crti.S
+++ b/sysdeps/powerpc/powerpc64/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for PowerPC64.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -62,6 +62,7 @@
#endif
.section ".init", "ax", @progbits
ENTRY_2(_init)
+ .hidden _init
.align ALIGNARG (2)
BODY_LABEL (_init):
LOCALENTRY(_init)
@@ -80,6 +81,7 @@ BODY_LABEL (_init):
.section ".fini", "ax", @progbits
ENTRY_2(_fini)
+ .hidden _fini
.align ALIGNARG (2)
BODY_LABEL (_fini):
LOCALENTRY(_fini)
diff --git a/sysdeps/powerpc/powerpc64/crtn.S b/sysdeps/powerpc/powerpc64/crtn.S
index ae9135ce9f..6067bed6c3 100644
--- a/sysdeps/powerpc/powerpc64/crtn.S
+++ b/sysdeps/powerpc/powerpc64/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for PowerPC64.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/dl-dtprocnum.h b/sysdeps/powerpc/powerpc64/dl-dtprocnum.h
index e72b71e2f8..d46cadb9c9 100644
--- a/sysdeps/powerpc/powerpc64/dl-dtprocnum.h
+++ b/sysdeps/powerpc/powerpc64/dl-dtprocnum.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions. PowerPC64 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/dl-irel.h b/sysdeps/powerpc/powerpc64/dl-irel.h
index db76ebbca9..ab13c04358 100644
--- a/sysdeps/powerpc/powerpc64/dl-irel.h
+++ b/sysdeps/powerpc/powerpc64/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
PowerPC64 version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/dl-machine.c b/sysdeps/powerpc/powerpc64/dl-machine.c
index 3b4ed65bc9..959907bf02 100644
--- a/sysdeps/powerpc/powerpc64/dl-machine.c
+++ b/sysdeps/powerpc/powerpc64/dl-machine.c
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation functions. PowerPC64 version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,14 +24,17 @@
void
_dl_reloc_overflow (struct link_map *map,
- const char *name,
- Elf64_Addr *const reloc_addr,
- const Elf64_Sym *refsym)
+ const char *name,
+ Elf64_Addr *const reloc_addr,
+ const Elf64_Sym *refsym)
{
- char buffer[128];
+ char buffer[1024];
char *t;
t = stpcpy (buffer, name);
- t = stpcpy (t, " reloc at 0x");
+ /* Notice that _itoa_word() writes characters from the higher address to the
+ lower address, requiring the destination string to reserve all the
+ required size before the call. */
+ t = stpcpy (t, " reloc at 0x0000000000000000");
_itoa_word ((unsigned long) reloc_addr, t, 16, 0);
if (refsym)
{
@@ -45,3 +48,19 @@ _dl_reloc_overflow (struct link_map *map,
t = stpcpy (t, " out of range");
_dl_signal_error (0, map->l_name, NULL, buffer);
}
+
+#if _CALL_ELF == 2
+void
+_dl_error_localentry (struct link_map *map, const Elf64_Sym *refsym)
+{
+ char buffer[1024];
+ char *t;
+ const char *strtab;
+
+ strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+ t = stpcpy (buffer, "expected localentry:0 `");
+ t = stpcpy (t, strtab + refsym->st_name);
+ t = stpcpy (t, "'");
+ _dl_signal_error (0, map->l_name, NULL, buffer);
+}
+#endif
diff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h
index d6f780ec85..99a83d0c82 100644
--- a/sysdeps/powerpc/powerpc64/dl-machine.h
+++ b/sysdeps/powerpc/powerpc64/dl-machine.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions.
PowerPC64 version.
- Copyright 1995-2016 Free Software Foundation, Inc.
+ Copyright 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,7 @@
#include <dl-tls.h>
#include <sysdep.h>
#include <hwcapinfo.h>
+#include <cpu-features.c>
/* Translate a processor specific dynamic tag to the index
in l_info array. */
@@ -300,13 +301,14 @@ BODY_PREFIX "_dl_start_user:\n" \
/* We define an initialization function to initialize HWCAP/HWCAP2 and
platform data so it can be copied into the TCB later. This is called
very early in _dl_sysdep_start for dynamically linked binaries. */
-#ifdef SHARED
+#if defined(SHARED) && IS_IN (rtld)
# define DL_PLATFORM_INIT dl_platform_init ()
static inline void __attribute__ ((unused))
dl_platform_init (void)
{
__tcb_parse_hwcap_and_convert_at_platform ();
+ init_cpu_features (&GLRO(dl_powerpc_cpu_features));
}
#endif
@@ -440,20 +442,30 @@ elf_machine_runtime_setup (struct link_map *map, int lazy, int profile)
}
#if _CALL_ELF == 2
-/* If the PLT entry whose reloc is 'reloc' resolves to a function in
- the same object, return the target function's local entry point
- offset if usable. */
+extern void attribute_hidden _dl_error_localentry (struct link_map *map,
+ const Elf64_Sym *refsym);
+
+/* If the PLT entry resolves to a function in the same object, return
+ the target function's local entry point offset if usable. */
static inline Elf64_Addr __attribute__ ((always_inline))
ppc64_local_entry_offset (struct link_map *map, lookup_t sym_map,
- const Elf64_Rela *reloc)
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym)
{
- const Elf64_Sym *symtab;
- const Elf64_Sym *sym;
-
/* If the target function is in a different object, we cannot
use the local entry point. */
if (sym_map != map)
- return 0;
+ {
+ /* Check that optimized plt call stubs for localentry:0 functions
+ are not being satisfied by a non-zero localentry symbol. */
+ if (map->l_info[DT_PPC64(OPT)]
+ && (map->l_info[DT_PPC64(OPT)]->d_un.d_val & PPC64_OPT_LOCALENTRY) != 0
+ && refsym->st_info == ELFW(ST_INFO) (STB_GLOBAL, STT_FUNC)
+ && (STO_PPC64_LOCAL_MASK & refsym->st_other) == 0
+ && (STO_PPC64_LOCAL_MASK & sym->st_other) != 0)
+ _dl_error_localentry (map, refsym);
+
+ return 0;
+ }
/* If the linker inserted multiple TOCs, we cannot use the
local entry point. */
@@ -461,16 +473,13 @@ ppc64_local_entry_offset (struct link_map *map, lookup_t sym_map,
&& (map->l_info[DT_PPC64(OPT)]->d_un.d_val & PPC64_OPT_MULTI_TOC))
return 0;
- /* Otherwise, we can use the local entry point. Retrieve its offset
- from the symbol's ELF st_other field. */
- symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]);
- sym = &symtab[ELFW(R_SYM) (reloc->r_info)];
-
/* If the target function is an ifunc then the local entry offset is
for the resolver, not the final destination. */
if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0))
return 0;
+ /* Otherwise, we can use the local entry point. Retrieve its offset
+ from the symbol's ELF st_other field. */
return PPC64_LOCAL_ENTRY_OFFSET (sym->st_other);
}
#endif
@@ -479,6 +488,7 @@ ppc64_local_entry_offset (struct link_map *map, lookup_t sym_map,
routine. */
static inline Elf64_Addr __attribute__ ((always_inline))
elf_machine_fixup_plt (struct link_map *map, lookup_t sym_map,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf64_Rela *reloc,
Elf64_Addr *reloc_addr, Elf64_Addr finaladdr)
{
@@ -534,7 +544,7 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t sym_map,
PPC_DCBST (&plt->fd_func);
PPC_ISYNC;
#else
- finaladdr += ppc64_local_entry_offset (map, sym_map, reloc);
+ finaladdr += ppc64_local_entry_offset (map, sym_map, refsym, sym);
*reloc_addr = finaladdr;
#endif
@@ -543,6 +553,7 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t sym_map,
static inline void __attribute__ ((always_inline))
elf_machine_plt_conflict (struct link_map *map, lookup_t sym_map,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf64_Rela *reloc,
Elf64_Addr *reloc_addr, Elf64_Addr finaladdr)
{
@@ -565,7 +576,7 @@ elf_machine_plt_conflict (struct link_map *map, lookup_t sym_map,
PPC_DCBST (&plt->fd_toc);
PPC_SYNC;
#else
- finaladdr += ppc64_local_entry_offset (map, sym_map, reloc);
+ finaladdr += ppc64_local_entry_offset (map, sym_map, refsym, sym);
*reloc_addr = finaladdr;
#endif
}
@@ -604,11 +615,10 @@ elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc,
#define dont_expect(X) __builtin_expect ((X), 0)
-extern void _dl_reloc_overflow (struct link_map *map,
- const char *name,
- Elf64_Addr *const reloc_addr,
- const Elf64_Sym *refsym)
- attribute_hidden;
+extern void attribute_hidden _dl_reloc_overflow (struct link_map *map,
+ const char *name,
+ Elf64_Addr *const reloc_addr,
+ const Elf64_Sym *refsym);
auto inline void __attribute__ ((always_inline))
elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
@@ -698,8 +708,7 @@ elf_machine_rela (struct link_map *map,
/* We need SYM_MAP even in the absence of TLS, for elf_machine_fixup_plt
and STT_GNU_IFUNC. */
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf64_Addr value = ((sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value)
- + reloc->r_addend);
+ Elf64_Addr value = SYMBOL_ADDRESS (sym_map, sym, true) + reloc->r_addend;
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
@@ -728,9 +737,11 @@ elf_machine_rela (struct link_map *map,
/* Fall thru */
case R_PPC64_JMP_SLOT:
#ifdef RESOLVE_CONFLICT_FIND_MAP
- elf_machine_plt_conflict (map, sym_map, reloc, reloc_addr, value);
+ elf_machine_plt_conflict (map, sym_map, refsym, sym,
+ reloc, reloc_addr, value);
#else
- elf_machine_fixup_plt (map, sym_map, reloc, reloc_addr, value);
+ elf_machine_fixup_plt (map, sym_map, refsym, sym,
+ reloc, reloc_addr, value);
#endif
return;
diff --git a/sysdeps/powerpc/powerpc64/dl-trampoline.S b/sysdeps/powerpc/powerpc64/dl-trampoline.S
index fc07e453e9..aa141dc44b 100644
--- a/sysdeps/powerpc/powerpc64/dl-trampoline.S
+++ b/sysdeps/powerpc/powerpc64/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. PPC64 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@
a function that makes no calls except for __tls_get_addr and we
might be here resolving the __tls_get_addr call. */
#define INT_PARMS FRAME_MIN_SIZE
-EALIGN(_dl_runtime_resolve, 4, 0)
+ENTRY (_dl_runtime_resolve, 4)
stdu r1,-FRAME_SIZE(r1)
cfi_adjust_cfa_offset (FRAME_SIZE)
std r3,INT_PARMS+0(r1)
@@ -195,7 +195,7 @@ END(_dl_runtime_resolve)
parm1 (r3) and the index (r0) needs to be converted to an offset
(index * 24) in parm2 (r4). */
#ifndef PROF
-EALIGN(_dl_profile_resolve, 4, 0)
+ENTRY (_dl_profile_resolve, 4)
/* Spill r30, r31 to preserve the link_map* and reloc_addr, in case we
need to call _dl_call_pltexit. */
std r31,-8(r1)
diff --git a/sysdeps/powerpc/powerpc64/entry.h b/sysdeps/powerpc/powerpc64/entry.h
index 6baffdbc95..c2f7348cad 100644
--- a/sysdeps/powerpc/powerpc64/entry.h
+++ b/sysdeps/powerpc/powerpc64/entry.h
@@ -1,5 +1,5 @@
/* Finding the entry point and start of text. PowerPC64 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/ffsll.c b/sysdeps/powerpc/powerpc64/ffsll.c
index 786f4e5e9d..c95ad99b36 100644
--- a/sysdeps/powerpc/powerpc64/ffsll.c
+++ b/sysdeps/powerpc/powerpc64/ffsll.c
@@ -1,6 +1,6 @@
/* Find first set bit in a word, counted from least significant end.
For PowerPC.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index 0e3eac7190..73f2f69377 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -1,30 +1,35 @@
ifeq ($(subdir),math)
-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
- s_isnan-power5 s_isnan-ppc64 s_copysign-power6 \
- s_copysign-ppc64 s_finite-power7 s_finite-ppc64 \
- s_finitef-ppc64 s_isinff-ppc64 s_isinf-power7 \
- s_isinf-ppc64 s_modf-power5+ s_modf-ppc64 \
- s_modff-power5+ s_modff-ppc64 s_isnan-power8 \
- s_isinf-power8 s_finite-power8
+# These functions are built both for libc and libm because they're required
+# by printf. While the libc objects have the prefix s_, the libm ones are
+# prefixed with m_.
+sysdep_calls := s_copysign-power6 s_copysign-ppc64 \
+ s_finite-power8 s_finite-power7 s_finite-ppc64 \
+ s_finitef-ppc64 \
+ s_isinf-power8 s_isinf-ppc64 \
+ s_isinff-ppc64 s_isinf-power7 \
+ s_isnan-power8 s_isnan-power7 s_isnan-power6x s_isnan-power6 \
+ s_isnan-power5 s_isnan-ppc64 \
+ s_modf-power5+ s_modf-ppc64 \
+ s_modff-power5+ s_modff-ppc64
-libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \
- s_isnan-power5 s_isnan-ppc64 s_llround-power6x \
+sysdep_routines += $(sysdep_calls)
+libm-sysdep_routines += s_llround-power6x \
s_llround-power5+ s_llround-ppc64 s_ceil-power5+ \
s_ceil-ppc64 s_ceilf-power5+ s_ceilf-ppc64 \
s_floor-power5+ s_floor-ppc64 s_floorf-power5+ \
s_floorf-ppc64 s_round-power5+ s_round-ppc64 \
s_roundf-power5+ s_roundf-ppc64 s_trunc-power5+ \
s_trunc-ppc64 s_truncf-power5+ s_truncf-ppc64 \
- s_copysign-power6 s_copysign-ppc64 s_llrint-power6x \
- s_llrint-ppc64 s_finite-power7 s_finite-ppc64 \
- s_finitef-ppc64 s_isinff-ppc64 s_isinf-power7 \
- s_isinf-ppc64 s_logb-power7 s_logbf-power7 \
+ s_llrint-power6x s_llrint-ppc64 \
+ s_logb-power7 s_logbf-power7 \
s_logbl-power7 s_logb-ppc64 s_logbf-ppc64 \
- s_logbl-ppc64 s_modf-power5+ s_modf-ppc64 \
- s_modff-power5+ s_modff-ppc64 e_hypot-ppc64 \
+ s_logbl-ppc64 e_hypot-ppc64 \
e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 \
- s_isnan-power8 s_isinf-power8 s_finite-power8 \
- s_llrint-power8 s_llround-power8
+ s_llrint-power8 s_llround-power8 s_llroundf-ppc64 \
+ e_expf-power8 e_expf-ppc64 \
+ s_sinf-ppc64 s_sinf-power8 \
+ s_cosf-ppc64 s_cosf-power8 \
+ $(sysdep_calls:s_%=m_%)
CFLAGS-s_logbf-power7.c = -mcpu=power7
CFLAGS-s_logbl-power7.c = -mcpu=power7
@@ -33,4 +38,9 @@ CFLAGS-s_modf-power5+.c = -mcpu=power5+
CFLAGS-s_modff-power5+.c = -mcpu=power5+
CFLAGS-e_hypot-power7.c = -mcpu=power7
CFLAGS-e_hypotf-power7.c = -mcpu=power7
+
+# These files quiet sNaNs in a way that is optimized away without
+# -fsignaling-nans.
+CFLAGS-s_modf-ppc64.c += -fsignaling-nans
+CFLAGS-s_modff-ppc64.c += -fsignaling-nans
endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S
new file mode 100644
index 0000000000..c9dad4e132
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S
@@ -0,0 +1,24 @@
+/* __ieee754_expf() POWER8 version.
+ Copyright (C) 2016-2018 Free Software 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 strong_alias
+#define strong_alias(a, b)
+
+#define __ieee754_expf __ieee754_expf_power8
+
+#include <sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c
new file mode 100644
index 0000000000..8ab41a8ed4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c
@@ -0,0 +1,21 @@
+/* __ieee_expf() PowerPC64 version.
+ Copyright (C) 2016-2018 Free Software 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 __expf __ieee754_expf_ppc64
+
+#include <sysdeps/ieee754/flt-32/e_expf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf.c
new file mode 100644
index 0000000000..f752514efa
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of ieee754_expf.
+ Copyright (C) 2016-2018 Free Software 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 <math_ldbl_opt.h>
+#include "init-arch.h"
+
+extern __typeof (__ieee754_expf) __ieee754_expf_ppc64 attribute_hidden;
+extern __typeof (__ieee754_expf) __ieee754_expf_power8 attribute_hidden;
+
+libc_ifunc (__ieee754_expf,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __ieee754_expf_power8
+ : __ieee754_expf_ppc64);
+
+strong_alias (__ieee754_expf, __expf_finite)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c
index d79ee7ba47..416ef50df6 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c
@@ -1,5 +1,5 @@
/* __ieee_hypot() POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-ppc64.c
index 8bbcfc3560..f469a24719 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-ppc64.c
@@ -1,5 +1,5 @@
/* __ieee_hypot() PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c
index 30f91ef742..8d05c430cc 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c
@@ -1,5 +1,5 @@
/* Multiple versions of ieee754_hypot.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c
index 572dfe6bfb..b40158fd29 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c
@@ -1,5 +1,5 @@
/* __ieee_hypotf() POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-ppc64.c
index 634bf85da6..54dbaee016 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-ppc64.c
@@ -1,5 +1,5 @@
/* __ieee_hypot() PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c
index 7686b51e2b..9bef1fea3f 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c
@@ -1,5 +1,5 @@
/* Multiple versions of ieee754_hypot.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S
index be59f4bdb8..76651b694c 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S
@@ -1,5 +1,5 @@
/* ceil function. PowerPC64/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S
index b44d44af33..c75c66ba3b 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S
@@ -1,5 +1,5 @@
/* ceil function. PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c
index 3c20329eb0..5cde4eb46f 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c
@@ -1,5 +1,5 @@
/* Multiple versions of ceil.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__ceil) __ceil_ppc64 attribute_hidden;
extern __typeof (__ceil) __ceil_power5plus attribute_hidden;
@@ -29,12 +30,4 @@ libc_ifunc (__ceil,
? __ceil_power5plus
: __ceil_ppc64);
-weak_alias (__ceil, ceil)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__ceil, __ceill)
-weak_alias (__ceil, ceill)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0);
-#endif
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S
index d9ad500d9c..b9c9e14fba 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S
@@ -1,5 +1,5 @@
/* ceilf function. PowerPC64/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S
index ba3a20f0ba..ce5cc49770 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S
@@ -1,5 +1,5 @@
/* ceilf function. PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c
index 4c366c8123..18697e52b3 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c
@@ -1,5 +1,5 @@
/* Multiple versions of ceilf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__ceilf) __ceilf_ppc64 attribute_hidden;
extern __typeof (__ceilf) __ceilf_power5plus attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__ceilf,
? __ceilf_power5plus
: __ceilf_ppc64);
-weak_alias (__ceilf, ceilf)
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S
index 9ee298a80e..3ce85ca822 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S
@@ -1,5 +1,5 @@
/* copysign(). PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S
index c253657baa..97fad681e3 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S
@@ -1,5 +1,5 @@
/* copysign(). PowerPC64 default version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -17,8 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
index 91c123bc92..74ce097397 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
@@ -1,5 +1,5 @@
/* Multiple versions of copysign.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,7 @@
#undef __copysign
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__redirect_copysign) __copysign_ppc64 attribute_hidden;
extern __typeof (__redirect_copysign) __copysign_power6 attribute_hidden;
@@ -36,16 +37,8 @@ libc_ifunc (__libm_copysign,
: __copysign_ppc64);
strong_alias (__libm_copysign, __copysign)
-weak_alias (__copysign, copysign)
+libm_alias_double (__copysign, copysign)
-#ifdef NO_LONG_DOUBLE
-weak_alias (__copysign,copysignl)
-strong_alias(__copysign,__copysignl)
-#endif
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c
index 84f22809d0..377a3f814c 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c
@@ -1,5 +1,5 @@
/* Multiple versions of copysignf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
/* It's safe to use double-precision implementation for single-precision. */
extern __typeof (__copysignf) __copysign_ppc64 attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__copysignf,
? __copysign_power6
: __copysign_ppc64);
-weak_alias (__copysignf, copysignf)
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S
new file mode 100644
index 0000000000..17adc90ad2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S
@@ -0,0 +1,24 @@
+/* cosf function. PowerPC64/power8 version.
+ Copyright (C) 2017-2018 Free Software 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)
+
+#define __cosf __cosf_power8
+
+#include <sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c
new file mode 100644
index 0000000000..34e0553b93
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c
@@ -0,0 +1,24 @@
+/* cosf function. PowerPC64 default version.
+ Copyright (C) 2017-2018 Free Software 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)
+
+#define __cosf __cosf_ppc64
+
+#include <sysdeps/powerpc/fpu/s_cosf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c
new file mode 100644
index 0000000000..cb12178791
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of cosf.
+ Copyright (C) 2017-2018 Free Software 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 <shlib-compat.h>
+#include "init-arch.h"
+#include <libm-alias-float.h>
+
+extern __typeof (__cosf) __cosf_ppc64 attribute_hidden;
+extern __typeof (__cosf) __cosf_power8 attribute_hidden;
+
+libc_ifunc (__cosf,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __cosf_power8
+ : __cosf_ppc64);
+
+libm_alias_float (__cos, cos)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S
index c0a101feea..d3e9f606bd 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef hidden_def
#define hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S
index 44e0f6f944..7a200a5c1a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64/POWER7 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef hidden_def
#define hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c
index e6d2029164..2a597fc38d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-ppc64.c
@@ -1,5 +1,5 @@
/* finite(). PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
index 067edc2ea6..14c9ea7fef 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
@@ -1,5 +1,5 @@
/* Multiple versions of finite.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,6 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __finite __redirect___finite
+
+/* The following definitions, although not related to the 'double'
+ version of 'finite', are required to guarantee macro expansions
+ (e.g.: from __finitef to __redirect_finitef) in include/math.h, thus
+ compensating for the unintended macro expansions in
+ math/bits/mathcalls-helper-functions.h. */
+#define __finitef __redirect___finitef
+#define __finitel __redirect___finitel
+#define __finitef128 __redirect___finitef128
+
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -24,13 +35,17 @@
extern __typeof (__finite) __finite_ppc64 attribute_hidden;
extern __typeof (__finite) __finite_power7 attribute_hidden;
extern __typeof (__finite) __finite_power8 attribute_hidden;
+#undef __finite
+#undef __finitef
+#undef __finitel
+#undef __finitef128
-libc_ifunc (__finite,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __finite_power8 :
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __finite_power7
- : __finite_ppc64);
+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-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c
index e010880f46..0df571cd2e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef-ppc64.c
@@ -1,5 +1,5 @@
/* finitef(). PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
index e0b4686ced..d2ffdeeb41 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
@@ -1,5 +1,5 @@
/* Multiple versions of finitef.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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_floor-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S
index a93f3d9183..0c4c97f7a6 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S
@@ -1,5 +1,5 @@
/* floor function. PowerPC64/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S
index 89be2a5bee..97ec94d733 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S
@@ -1,5 +1,5 @@
/* floor function. PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c
index 6a743fd7ee..d1a21a1d12 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c
@@ -1,5 +1,5 @@
/* Multiple versions of floor.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__floor) __floor_ppc64 attribute_hidden;
extern __typeof (__floor) __floor_power5plus attribute_hidden;
@@ -29,12 +30,4 @@ libc_ifunc (__floor,
? __floor_power5plus
: __floor_ppc64);
-weak_alias (__floor, floor)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__floor, __floorl)
-weak_alias (__floor, floorl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0);
-#endif
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S
index 87b9e3caa2..10676569c3 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S
@@ -1,5 +1,5 @@
/* floorf function. PowerPC64/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S
index f97492d2ef..b207f0cad2 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S
@@ -1,5 +1,5 @@
/* floorf function. PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,9 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c
index 2ee2048f98..d1bbc14614 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c
@@ -1,5 +1,5 @@
/* Multiple versions of floorf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__floorf) __floorf_ppc64 attribute_hidden;
extern __typeof (__floorf) __floorf_power5plus attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__floorf,
? __floorf_power5plus
: __floorf_ppc64);
-weak_alias (__floorf, floorf)
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S
index aaa163a914..e644f9605f 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S
@@ -1,5 +1,5 @@
/* isinf(). PowerPC64/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef hidden_def
#define hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S
index 69341ec162..dc7764d915 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S
@@ -1,5 +1,5 @@
/* isinf(). PowerPC64/POWER8 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef hidden_def
#define hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c
index c400a73fa9..c1907980db 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-ppc64.c
@@ -1,5 +1,5 @@
/* isinf(). PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
index 07e159d9c1..44f5d0c129 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
@@ -1,5 +1,5 @@
/* Multiple versions of isinf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,6 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __isinf __redirect___isinf
+
+/* The following definitions, although not related to the 'double'
+ version of 'isinf', are required to guarantee macro expansions
+ (e.g.: from __isinff to __redirect_isinff) in include/math.h, thus
+ compensating for the unintended macro expansions in
+ math/bits/mathcalls-helper-functions.h. */
+#define __isinff __redirect___isinff
+#define __isinfl __redirect___isinfl
+#define __isinff128 __redirect___isinff128
+
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -24,13 +35,17 @@
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
+#undef __isinff128
+
+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-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c
index 72775f571d..531f15d822 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff-ppc64.c
@@ -1,5 +1,5 @@
/* isinff(). PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
index 2cb161b54c..7e29a60713 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
@@ -1,5 +1,5 @@
/* Multiple versions of isinf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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-power5.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S
index c61b52618e..749cdbc9fe 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64/POWER5 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef hidden_def
#define hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S
index c77bb345b6..51cbc6b243 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64/POWER6 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef hidden_def
#define hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S
index 389008efdd..a2d64dfeb7 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64/POWER6X version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef hidden_def
#define hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S
index 4e388a4ba7..8585808b51 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef hidden_def
#define hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S
index 83e3b3eb1a..d501878cb2 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64/POWER7 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef hidden_def
#define hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S
index 9a8451a762..82e14d8b2e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,17 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
#undef strong_alias
#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
+
#define __isnan __isnan_ppc64
-#undef hidden_def
-#define hidden_def(name) \
- .globl __GI___isnan ; .set __GI___isnan,__isnan_ppc64
+#ifdef SHARED
+ #undef hidden_def
+ #define hidden_def(name) \
+ .globl __GI___isnan ; .set __GI___isnan,__isnan_ppc64
+#endif
#include <sysdeps/powerpc/powerpc64/fpu/s_isnan.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
index a614f25047..0c155130c6 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
@@ -1,5 +1,5 @@
/* Multiple versions of isnan.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,6 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __isnan __redirect___isnan
+
+/* The following definitions, although not related to the 'double'
+ version of 'isnan', are required to guarantee macro expansions
+ (e.g.: from __isnanf to __redirect_isnanf) in include/math.h, thus
+ compensating for the unintended macro expansions in
+ math/bits/mathcalls-helper-functions.h. */
+#define __isnanf __redirect___isnanf
+#define __isnanl __redirect___isnanl
+#define __isnanf128 __redirect___isnanf128
+
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -27,19 +38,23 @@ 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;
+#undef __isnan
+#undef __isnanf
+#undef __isnanl
+#undef __isnanf128
-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);
+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..e9558d554c 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c
@@ -1,5 +1,5 @@
/* Multiple versions of isnan.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,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/multiarch/s_llrint-power6x.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S
index 7968fb7b78..3de77d5c7a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S
@@ -1,5 +1,5 @@
/* Round double to long int. PowerPC64/POWER6X default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S
index b87482e443..619527207f 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S
@@ -1,5 +1,5 @@
/* Round double to long int. PowerPC64/POWER6X default version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S
index f9c77abf4a..093726628d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S
@@ -1,5 +1,5 @@
/* Round double to long int. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
index 2a21a510e9..59f8c2bd95 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
@@ -1,5 +1,5 @@
/* Multiple versions of llrint.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,7 @@
#undef __lrint
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__llrint) __llrint_ppc64 attribute_hidden;
extern __typeof (__llrint) __llrint_power6x attribute_hidden;
@@ -39,22 +40,8 @@ libc_ifunc (__llrint,
? __llrint_power6x
: __llrint_ppc64);
-weak_alias (__llrint, llrint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
-#endif
+libm_alias_double (__llrint, llrint)
/* long has the same width as long long on PowerPC64. */
strong_alias (__llrint, __lrint)
-weak_alias (__lrint, lrint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
-#endif
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c
new file mode 100644
index 0000000000..919b5de03a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c
@@ -0,0 +1,47 @@
+/* Multiple versions of llrintf.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+/* Redefine lrintf/__lrintf so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias below. */
+#define lrintf __hidden_lrintf
+#define __lrintf __hidden___lrintf
+
+#include <math.h>
+#undef lrintf
+#undef __lrintf
+#include "init-arch.h"
+#include <libm-alias-float.h>
+
+extern __typeof (__llrintf) __llrint_ppc64 attribute_hidden;
+extern __typeof (__llrintf) __llrint_power6x attribute_hidden;
+extern __typeof (__llrintf) __llrint_power8 attribute_hidden;
+
+/* The ppc64 ABI passes float and double parameters in 64bit floating point
+ registers (at least up to a point) as IEEE binary64 format, so effectively
+ of "double" type. Both l[l]rint and l[l]rintf return long type. So these
+ functions have identical signatures and functionality, and can use a
+ single implementation. */
+libc_ifunc (__llrintf,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __llrint_power8 :
+ (hwcap & PPC_FEATURE_POWER6_EXT)
+ ? __llrint_power6x
+ : __llrint_ppc64);
+
+libm_alias_float (__llrint, llrint)
+strong_alias (__llrintf, __lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S
index 3cb1c0c105..448ec22478 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S
@@ -1,5 +1,5 @@
/* llround(). PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(name, alias)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S
index 21698393fb..9110148419 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S
@@ -1,5 +1,5 @@
/* llround(). PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(name, alias)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S
index bc3a1e5591..3bbb5924ee 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S
@@ -1,5 +1,5 @@
/* llround(). PowerPC64 default version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(name, alias)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S
index 85415a0d51..c098210ade 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S
@@ -1,5 +1,5 @@
/* llround(). PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef compat_symbol
#define compat_symbol(a,b,c,d)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
index 423bdce727..07ae196178 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
@@ -1,5 +1,5 @@
/* Multiple versions of llround.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__llround) __llround_ppc64 attribute_hidden;
extern __typeof (__llround) __llround_power5plus attribute_hidden;
@@ -38,26 +39,10 @@ libc_ifunc (__llround,
? __llround_power5plus
: __llround_ppc64);
-weak_alias (__llround, llround)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
-compat_symbol (libm, llround, lroundl, GLIBC_2_1);
-#endif
+libm_alias_double (__llround, llround)
/* long has the same width as long long on PPC64. */
#undef lround
#undef __lround
strong_alias (__llround, __lround)
-weak_alias (__llround, lround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __llroundl)
-weak_alias (__llround, llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
-#endif
+libm_alias_double (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S
new file mode 100644
index 0000000000..1af420a1d9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S
@@ -0,0 +1,31 @@
+/* llroundf(). PowerPC64 default version.
+ Copyright (C) 2017-2018 Free Software 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 <shlib-compat.h>
+
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#undef compat_symbol
+#define compat_symbol(a,b,c,d)
+
+#define __llroundf __llroundf_ppc64
+#define __lroundf __lroundf_ppc64
+
+#include <sysdeps/powerpc/powerpc64/fpu/s_llroundf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c
new file mode 100644
index 0000000000..792ae1dc5e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c
@@ -0,0 +1,47 @@
+/* Multiple versions of llroundf.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+/* Redefine lroundf/__lroundf so that the compiler won't complain about
+ the type mismatch with the IFUNC selector in strong_alias below. */
+#define lroundf __hidden_lroundf
+#define __lroundf __hidden___lroundf
+
+#include <math.h>
+#undef lroundf
+#undef __lroundf
+#include "init-arch.h"
+#include <libm-alias-float.h>
+
+extern __typeof (__llroundf) __llroundf_ppc64 attribute_hidden;
+extern __typeof (__llroundf) __llround_power6x attribute_hidden;
+extern __typeof (__llroundf) __llround_power8 attribute_hidden;
+
+/* The ppc64 ABI passes float and double parameters in 64bit floating point
+ registers (at least up to a point) as IEEE binary64 format, so effectively
+ of "double" type. Both l[l]round and l[l]roundf return long type. So these
+ functions have identical signatures and functionality, and can use a
+ single implementation. */
+libc_ifunc (__llroundf,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __llround_power8 :
+ (hwcap & PPC_FEATURE_POWER6_EXT)
+ ? __llround_power6x
+ : __llroundf_ppc64);
+
+libm_alias_float (__llround, llround)
+strong_alias (__llroundf, __lroundf)
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c
index 769dc2346a..504603a242 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c
@@ -1,5 +1,5 @@
/* logb(). PowerPC64/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c
index 1f530b547d..0f1e4fc76b 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c
@@ -1,5 +1,5 @@
/* logb(). PowerPC32/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,11 +18,6 @@
#include <math.h>
-#undef weak_alias
-#define weak_alias(a, b)
-#undef strong_alias
-#define strong_alias(a, b)
-
#define __logb __logb_ppc64
#include <sysdeps/ieee754/dbl-64/s_logb.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c
index f7bc72d3eb..b4a72c81fd 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c
@@ -1,5 +1,5 @@
/* Multiple versions of logb.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__logb) __logb_ppc64 attribute_hidden;
extern __typeof (__logb) __logb_power7 attribute_hidden;
@@ -29,13 +30,4 @@ libc_ifunc (__logb,
? __logb_power7
: __logb_ppc64);
-weak_alias (__logb, logb)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__logb, __logbl)
-weak_alias (__logb, logbl)
-#endif
-
-#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
-compat_symbol (libm, logb, logbl, GLIBC_2_0);
-#endif
+libm_alias_double (__logb, logb)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c
index 4c80d7ff4d..fee93e2352 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c
@@ -1,5 +1,5 @@
/* logb(). PowerPC64/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-ppc64.c
index 42630633b0..fe197b7e9b 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-ppc64.c
@@ -1,5 +1,5 @@
/* logbf(). PowerPC64 default implementation.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c
index 3fc948b10d..48e7d410e1 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c
@@ -1,5 +1,5 @@
/* Multiple versions of logbf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__logbf) __logbf_ppc64 attribute_hidden;
extern __typeof (__logbf) __logbf_power7 attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__logbf,
? __logbf_power7
: __logbf_ppc64);
-weak_alias (__logbf, logbf)
+libm_alias_float (__logb, logb)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c
index e04e673056..eb08b5fe5e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c
@@ -1,5 +1,5 @@
/* logb(). PowerPC64/POWER7 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-ppc64.c
index e16a721cfc..62d8c95783 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-ppc64.c
@@ -1,5 +1,5 @@
/* logbl(). PowerPC64/POWER7 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c
index 4b86b39635..f677c2aa69 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c
@@ -1,5 +1,5 @@
/* Multiple versions of logbl.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c
index 24fe354860..c7a382445a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c
@@ -1,5 +1,5 @@
/* PowerPC/POWER5+ implementation for modf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c
index 9758e88d71..c4aabe8f6e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation for modf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,11 +19,6 @@
#include <math.h>
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-
#define __modf __modf_ppc64
#include <sysdeps/ieee754/dbl-64/s_modf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
index 2af1959ad5..1fe7408cf3 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
@@ -1,5 +1,5 @@
/* Multiple versions of modf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__modf) __modf_ppc64 attribute_hidden;
extern __typeof (__modf) __modf_power5plus attribute_hidden;
@@ -29,16 +30,8 @@ libc_ifunc (__modf,
? __modf_power5plus
: __modf_ppc64);
-weak_alias (__modf, modf)
+libm_alias_double (__modf, modf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__modf, __modfl)
-weak_alias (__modf, modfl)
-#endif
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __modf, modfl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __modf, modfl, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c
index cbac75a97b..1c23444a21 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c
@@ -1,5 +1,5 @@
/* PowerPC/POWER5+ implementation for modff.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-ppc64.c
index 521bc0841d..0b1b289efd 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation for modff.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c
index 1163d1c1cf..efa96a799b 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c
@@ -1,5 +1,5 @@
/* Multiple versions of modff.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <math.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__modff) __modff_ppc64 attribute_hidden;
extern __typeof (__modff) __modff_power5plus attribute_hidden;
@@ -27,4 +28,4 @@ libc_ifunc (__modff,
? __modff_power5plus
: __modff_ppc64);
-weak_alias (__modff, modff)
+libm_alias_float (__modf, modf)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
index edcc60242f..67c001005a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
@@ -1,5 +1,5 @@
/* round function. PowerPC64/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S
index 3a6bb790d7..43cf13ab38 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S
@@ -1,5 +1,5 @@
/* round function. PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c
index 0408dc9e0b..bfa4d8119e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c
@@ -1,5 +1,5 @@
/* Multiple versions of round.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__round) __round_ppc64 attribute_hidden;
extern __typeof (__round) __round_power5plus attribute_hidden;
@@ -29,12 +30,4 @@ libc_ifunc (__round,
? __round_power5plus
: __round_ppc64);
-weak_alias (__round, round)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__round, __roundl)
-weak_alias (__round, roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __round, roundl, GLIBC_2_0);
-#endif
+libm_alias_double (__round, round)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
index 970cf7056c..6daf4c9f12 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
@@ -1,5 +1,5 @@
/* roundf function. PowerPC64/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S
index ef05017e50..9500b278cf 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S
@@ -1,5 +1,5 @@
/* roundf function. PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c
index 6d33611a88..3d77156846 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c
@@ -1,5 +1,5 @@
/* Multiple versions of roundf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__roundf) __roundf_ppc64 attribute_hidden;
extern __typeof (__roundf) __roundf_power5plus attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__roundf,
? __roundf_power5plus
: __roundf_ppc64);
-weak_alias (__roundf, roundf)
+libm_alias_float (__round, round)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S
new file mode 100644
index 0000000000..6cc058e93c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S
@@ -0,0 +1,24 @@
+/* sinf(). PowerPC64/POWER8 version.
+ Copyright (C) 2016-2018 Free Software 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)
+
+#define __sinf __sinf_power8
+
+#include <sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-ppc64.c
new file mode 100644
index 0000000000..4f0a09e040
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-ppc64.c
@@ -0,0 +1,24 @@
+/* sinf(). PowerPC64 default version.
+ Copyright (C) 2016-2018 Free Software 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)
+
+#define __sinf __sinf_ppc64
+
+#include <sysdeps/powerpc/fpu/s_sinf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c
new file mode 100644
index 0000000000..f1d9a97eea
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of sinf.
+ Copyright (C) 2016-2018 Free Software 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 <shlib-compat.h>
+#include "init-arch.h"
+#include <libm-alias-float.h>
+
+extern __typeof (__sinf) __sinf_ppc64 attribute_hidden;
+extern __typeof (__sinf) __sinf_power8 attribute_hidden;
+
+libc_ifunc (__sinf,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __sinf_power8
+ : __sinf_ppc64);
+
+libm_alias_float (__sin, sin)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S
index 47c9191bc7..c3cb5d3f21 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S
@@ -1,5 +1,5 @@
/* trunc function. PowerPC64/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S
index b9c25e18cb..1cfe0531e8 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S
@@ -1,5 +1,5 @@
/* trunc function. PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c
index 9d6144726d..989ffc9cf4 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c
@@ -1,5 +1,5 @@
/* Multiple versions of trunc.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-double.h>
extern __typeof (__trunc) __trunc_ppc64 attribute_hidden;
extern __typeof (__trunc) __trunc_power5plus attribute_hidden;
@@ -29,12 +30,4 @@ libc_ifunc (__trunc,
? __trunc_power5plus
: __trunc_ppc64);
-weak_alias (__trunc, trunc)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__trunc, __truncl)
-weak_alias (__trunc, truncl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_0);
-#endif
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S
index 96f08a9631..b40f00dd8e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S
@@ -1,5 +1,5 @@
/* truncf function. PowerPC64/power5+ version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S
index f413b0f74a..b05bbfd1e5 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S
@@ -1,5 +1,5 @@
/* truncf function. PowerPC64 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,8 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#undef weak_alias
#define weak_alias(a,b)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c
index f2d99109ae..fc5351b0ca 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c
@@ -1,5 +1,5 @@
/* Multiple versions of truncf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
extern __typeof (__truncf) __truncf_ppc64 attribute_hidden;
extern __typeof (__truncf) __truncf_power5plus attribute_hidden;
@@ -29,4 +30,4 @@ libc_ifunc (__truncf,
? __truncf_power5plus
: __truncf_ppc64);
-weak_alias (__truncf, truncf)
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c
new file mode 100644
index 0000000000..b5fe164520
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_expf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_ceil.S b/sysdeps/powerpc/powerpc64/fpu/s_ceil.S
index 77fe0f3c96..252d94f51e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_ceil.S
@@ -1,5 +1,5 @@
/* ceil function. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,28 +18,31 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section ".toc","aw"
.LC0: /* 2**52 */
.tc FD_43300000_0[TC],0x4330000000000000
.section ".text"
-EALIGN (__ceil, 4, 0)
+ENTRY (__ceil, 4)
CALL_MCOUNT 0
- mffs fp11 /* Save current FPU rounding mode. */
lfd fp13,.LC0@toc(2)
fabs fp0,fp1
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,2 /* Set rounding mode toward +inf. */
ble- cr6,.L4
fadd fp1,fp1,fp13 /* x+= TWO52; */
fsub fp1,fp1,fp13 /* x-= TWO52; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -48,16 +51,15 @@ EALIGN (__ceil, 4, 0)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
blr
END (__ceil)
-weak_alias (__ceil, ceil)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__ceil, ceill)
-strong_alias (__ceil, __ceill)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S
index 91d4a25ae1..3c62077c14 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S
@@ -1,5 +1,5 @@
/* float ceil function. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section ".toc","aw"
.p2align 3
@@ -25,22 +26,24 @@
.long 0x0
.section ".text"
-EALIGN (__ceilf, 4, 0)
+ENTRY (__ceilf, 4)
CALL_MCOUNT 0
- mffs fp11 /* Save current FPU rounding mode. */
lfs fp13,.LC0@toc(2)
fabs fp0,fp1
fsubs fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,2 /* Set rounding mode toward +inf. */
ble- cr6,.L4
fadds fp1,fp1,fp13 /* x+= TWO23; */
fsubs fp1,fp1,fp13 /* x-= TWO23; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -49,9 +52,16 @@ EALIGN (__ceilf, 4, 0)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
blr
END (__ceilf)
-weak_alias (__ceilf, ceilf)
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_copysign.S b/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
index 26fe79e3c4..e40cbc7b8b 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
@@ -1,5 +1,5 @@
/* Copy a sign bit between floating-point values. PowerPC64 version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,8 +21,10 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
-ENTRY(__copysign)
+ENTRY_TOCLESS (__copysign)
CALL_MCOUNT 0
/* double [f1] copysign (double [f1] x, double [f2] y);
copysign(x,y) returns a value with the magnitude of x and
@@ -40,20 +42,12 @@ L(0): fnabs fp1,fp1
blr
END (__copysign)
-weak_alias (__copysign,copysign)
+libm_alias_double (__copysign, copysign)
/* It turns out that it's safe to use this code even for single-precision. */
-weak_alias (__copysign,copysignf)
strong_alias(__copysign,__copysignf)
+libm_alias_float (__copysign, copysign)
-#ifdef NO_LONG_DOUBLE
-weak_alias (__copysign,copysignl)
-strong_alias(__copysign,__copysignl)
-#endif
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __copysign, copysignl, GLIBC_2_0)
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __copysign, copysignl, GLIBC_2_0)
#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S b/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
index 1e1b9d43e6..1dcfa33b2e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
@@ -1,6 +1,6 @@
/* Copy a sign bit between floating-point values.
IBM extended format long double version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
-ENTRY(__copysignl)
+ENTRY_TOCLESS (__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. */
@@ -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/fpu/s_fabs.S b/sysdeps/powerpc/powerpc64/fpu/s_fabs.S
deleted file mode 100644
index 53d21301ee..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/s_fabs.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fabs.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fabs, fabsl, GLIBC_2_0)
-#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_fabsl.S b/sysdeps/powerpc/powerpc64/fpu/s_fabsl.S
index 0462d20630..04936949ac 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_fabsl.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_fabsl.S
@@ -1,6 +1,6 @@
/* Copy a sign bit between floating-point values.
IBM extended format long double version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,15 +20,14 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
-ENTRY(__fabsl)
+ENTRY_TOCLESS (__fabsl)
/* long double [f1,f2] fabs (long double [f1,f2] x);
fabs(x,y) returns a value with the magnitude of x and
with the sign bit of y. */
fmr fp0,fp1
fabs fp1,fp1
- fcmpu cr1,fp0,fp1
- beqlr cr1
- fneg fp2,fp2
+ fneg fp3,fp2
+ fsel fp2,fp0,fp2,fp3
blr
END (__fabsl)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_fdim.c b/sysdeps/powerpc/powerpc64/fpu/s_fdim.c
deleted file mode 100644
index e34b51ee54..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/s_fdim.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fdim.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_floor.S b/sysdeps/powerpc/powerpc64/fpu/s_floor.S
index afa08b70c4..f0d57c47dd 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_floor.S
@@ -1,5 +1,5 @@
/* Floor function. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,28 +18,31 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section ".toc","aw"
.LC0: /* 2**52 */
.tc FD_43300000_0[TC],0x4330000000000000
.section ".text"
-EALIGN (__floor, 4, 0)
+ENTRY (__floor, 4)
CALL_MCOUNT 0
- mffs fp11 /* Save current FPU rounding mode. */
lfd fp13,.LC0@toc(2)
fabs fp0,fp1
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,3 /* Set rounding mode toward -inf. */
ble- cr6,.L4
fadd fp1,fp1,fp13 /* x+= TWO52; */
fsub fp1,fp1,fp13 /* x-= TWO52; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -48,16 +51,15 @@ EALIGN (__floor, 4, 0)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
blr
END (__floor)
-weak_alias (__floor, floor)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__floor, floorl)
-strong_alias (__floor, __floorl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_floorf.S b/sysdeps/powerpc/powerpc64/fpu/s_floorf.S
index 80080ca0b6..b8c70fa7de 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_floorf.S
@@ -1,5 +1,5 @@
/* float Floor function. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section ".toc","aw"
.p2align 3
@@ -25,22 +26,24 @@
.long 0x0
.section ".text"
-EALIGN (__floorf, 4, 0)
+ENTRY (__floorf, 4)
CALL_MCOUNT 0
- mffs fp11 /* Save current FPU rounding mode. */
lfs fp13,.LC0@toc(2)
fabs fp0,fp1
fsubs fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,3 /* Set rounding mode toward -inf. */
ble- cr6,.L4
fadds fp1,fp1,fp13 /* x+= TWO23; */
fsubs fp1,fp1,fp13 /* x-= TWO23; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -49,9 +52,16 @@ EALIGN (__floorf, 4, 0)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
blr
END (__floorf)
-weak_alias (__floorf, floorf)
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_fma.S b/sysdeps/powerpc/powerpc64/fpu/s_fma.S
deleted file mode 100644
index d40695c633..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/s_fma.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fma.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fma, fmal, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_fmax.S b/sysdeps/powerpc/powerpc64/fpu/s_fmax.S
deleted file mode 100644
index 69735761ab..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/s_fmax.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fmax.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_fmin.S b/sysdeps/powerpc/powerpc64/fpu/s_fmin.S
deleted file mode 100644
index 6d4a0a946c..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/s_fmin.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/powerpc/fpu/s_fmin.S>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
index 8169ae9cff..12d23969ee 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64 version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
/* int __isnan(x) */
.machine power4
-EALIGN (__isnan, 4, 0)
+ENTRY_TOCLESS (__isnan, 4)
CALL_MCOUNT 0
mffs fp0
mtfsb0 4*cr6+lt /* reset_fpscr_bit (FPSCR_VE) */
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/fpu/s_llrint.S
index 2a1fee7c70..d3cc9b821e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_llrint.S
@@ -1,5 +1,5 @@
/* Round double to long int. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,9 +18,11 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
/* long long int[r3] __llrint (double x[fp1]) */
-ENTRY (__llrint)
+ENTRY_TOCLESS (__llrint)
CALL_MCOUNT 0
fctid fp13,fp1
stfd fp13,-16(r1)
@@ -32,16 +34,12 @@ ENTRY (__llrint)
END (__llrint)
strong_alias (__llrint, __lrint)
-weak_alias (__llrint, llrint)
-weak_alias (__lrint, lrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
+libm_alias_double (__llrint, llrint)
+libm_alias_double (__lrint, lrint)
+/* The double version also works for single-precision as both float and
+ double parameters are passed in 64bit FPRs and both versions are expected
+ to return [long] long type. */
+strong_alias (__llrint, __llrintf)
+libm_alias_float (__llrint, llrint)
+strong_alias (__lrint, __lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llrintf.S b/sysdeps/powerpc/powerpc64/fpu/s_llrintf.S
index ac257ede53..ba7752311d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_llrintf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_llrintf.S
@@ -1,36 +1 @@
-/* Round double to long int. PowerPC64 version.
- Copyright (C) 2004-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>
-
-/* long long int[r3] __llrintf (float x[fp1]) */
-ENTRY (__llrintf)
- CALL_MCOUNT 0
- fctid fp13,fp1
- stfd fp13,-16(r1)
- nop /* Insure the following load is in a different dispatch group */
- nop /* to avoid pipe stall on POWER4&5. */
- nop
- ld r3,-16(r1)
- blr
- END (__llrintf)
-
-strong_alias (__llrintf, __lrintf)
-weak_alias (__llrintf, llrintf)
-weak_alias (__lrintf, lrintf)
-
+/* __llrintf is in s_llrint.S. */
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/fpu/s_llround.S
index 19d9c7de45..8efb29859b 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_llround.S
@@ -1,5 +1,5 @@
/* llround function. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section ".toc","aw"
.LC0: /* 2^52 */
@@ -81,16 +82,5 @@ ENTRY (__llround)
END (__llround)
strong_alias (__llround, __lround)
-weak_alias (__llround, llround)
-weak_alias (__lround, lround)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+libm_alias_double (__llround, llround)
+libm_alias_double (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S
index 50bbdb1bb3..613469602e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S
@@ -1,5 +1,5 @@
/* llroundf function. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section ".toc","aw"
.LC0: /* 2^23 */
@@ -83,6 +84,6 @@ ENTRY (__llroundf)
END (__llroundf)
strong_alias (__llroundf, __lroundf)
-weak_alias (__llroundf, llroundf)
-weak_alias (__lroundf, lroundf)
+libm_alias_float (__llround, llround)
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S b/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
index 93d24652e1..7d89e78f88 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
@@ -1,5 +1,5 @@
/* Round to int floating-point values. PowerPC64 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -22,6 +22,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* double [fp1] nearbyint(double [fp1] x) */
@@ -31,12 +32,12 @@
.tc FD_43300000_0[TC],0x4330000000000000
.section ".text"
-EALIGN (__nearbyint, 4, 0)
+ENTRY (__nearbyint, 4)
CALL_MCOUNT 0
fabs fp0,fp1
lfd fp13,.LC0@toc(2)
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
- bgelr cr7
+ bge cr7,.L10
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp1,fp12 /* if (x > 0.0) */
ble cr7, L(lessthanzero)
@@ -56,14 +57,12 @@ L(lessthanzero):
fnabs fp1,fp1 /* if (x == 0.0) */
mtfsf 0xff,fp11 /* Restore FE_INEXACT state. */
blr /* x = -0.0; */
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
+ blr
END (__nearbyint)
-weak_alias (__nearbyint, nearbyint)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__nearbyint, nearbyint)
-strong_alias (__nearbyint, __nearbyintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1)
-#endif
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
index 3ba53784a4..4b62ba1e8d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
@@ -1,5 +1,5 @@
/* Round to int floating-point values. PowerPC64 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -21,6 +21,7 @@
when it's coded in C. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* float [fp1] nearbyintf(float [fp1]) */
@@ -32,12 +33,12 @@
.long 0x0
.section ".text"
-EALIGN (__nearbyintf, 4, 0)
+ENTRY (__nearbyintf, 4)
CALL_MCOUNT 0
fabs fp0,fp1
lfs fp13,.LC0@toc(2)
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
- bgelr cr7
+ bge cr7,.L10
fsubs fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp1,fp12 /* if (x > 0.0) */
ble cr7, L(lessthanzero)
@@ -57,6 +58,12 @@ L(lessthanzero):
fnabs fp1,fp1 /* if (x == 0.0) */
mtfsf 0xff,fp11 /* Restore FE_INEXACT state. */
blr /* x = -0.0; */
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
+ blr
END (__nearbyintf)
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_rint.S b/sysdeps/powerpc/powerpc64/fpu/s_rint.S
index 60c3deeb2e..a05e6dc8ca 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_rint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_rint.S
@@ -1,5 +1,5 @@
/* Round to int floating-point values. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,20 +21,21 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section ".toc","aw"
.LC0: /* 2**52 */
.tc FD_43300000_0[TC],0x4330000000000000
.section ".text"
-EALIGN (__rint, 4, 0)
+ENTRY (__rint, 4)
CALL_MCOUNT 0
lfd fp13,.LC0@toc(2)
fabs fp0,fp1
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr cr7
+ bnl cr7,.L10
bng cr6,.L4
fadd fp1,fp1,fp13 /* x+= TWO52; */
fsub fp1,fp1,fp13 /* x-= TWO52; */
@@ -46,14 +47,12 @@ EALIGN (__rint, 4, 0)
fadd fp1,fp1,fp13 /* x+= TWO52; */
fnabs fp1,fp1 /* if (x == 0.0) */
blr /* x = -0.0; */
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
+ blr
END (__rint)
-weak_alias (__rint, rint)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__rint, rintl)
-strong_alias (__rint, __rintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0)
-#endif
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_rintf.S b/sysdeps/powerpc/powerpc64/fpu/s_rintf.S
index 0b274b008a..7ac532cc8e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_rintf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_rintf.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section ".toc","aw"
.p2align 3
@@ -25,14 +26,14 @@
.long 0x0
.section ".text"
-EALIGN (__rintf, 4, 0)
+ENTRY (__rintf, 4)
CALL_MCOUNT 0
lfs fp13,.LC0@toc(2)
fabs fp0,fp1
fsubs fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr cr7
+ bnl cr7,.L10
bng cr6,.L4
fadds fp1,fp1,fp13 /* x+= TWO23; */
fsubs fp1,fp1,fp13 /* x-= TWO23; */
@@ -44,7 +45,13 @@ EALIGN (__rintf, 4, 0)
fadds fp1,fp1,fp13 /* x+= TWO23; */
fnabs fp1,fp1 /* if (x == 0.0) */
blr /* x = -0.0; */
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
+ blr
END (__rintf)
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_round.S b/sysdeps/powerpc/powerpc64/fpu/s_round.S
index 19713b37e2..d5aa47c596 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_round.S
@@ -1,5 +1,5 @@
/* round function. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section ".toc","aw"
.LC0: /* 2**52 */
@@ -36,7 +37,7 @@
"Round toward Zero" mode and round by adding +-0.5 before rounding
to the integer value. */
-EALIGN (__round, 4, 0)
+ENTRY (__round, 4)
CALL_MCOUNT 0
lfd fp13,.LC0@toc(2)
fabs fp0,fp1
@@ -45,7 +46,7 @@ EALIGN (__round, 4, 0)
mffs fp11 /* Save current FPU rounding mode and
"inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,1 /* Set rounding mode toward 0. */
lfd fp10,.LC1@toc(2)
ble- cr6,.L4
@@ -68,14 +69,12 @@ EALIGN (__round, 4, 0)
mtfsf 0xff,fp11 /* Restore previous rounding mode and
"inexact" state. */
blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
+ blr
END (__round)
-weak_alias (__round, round)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__round, roundl)
-strong_alias (__round, __roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1)
-#endif
+libm_alias_double (__round, round)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
index 8841d83497..a8db632db6 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
@@ -1,5 +1,5 @@
/* roundf function. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section ".toc","aw"
.p2align 3
@@ -37,7 +38,7 @@
"Round toward Zero" mode and round by adding +-0.5 before rounding
to the integer value. */
-EALIGN (__roundf, 4, 0)
+ENTRY (__roundf, 4)
CALL_MCOUNT 0
lfs fp13,.LC0@toc(2)
fabs fp0,fp1
@@ -46,7 +47,7 @@ EALIGN (__roundf, 4, 0)
mffs fp11 /* Save current FPU rounding mode and
"inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,1 /* Set rounding mode toward 0. */
lfs fp10,.LC1@toc(2)
ble- cr6,.L4
@@ -69,7 +70,13 @@ EALIGN (__roundf, 4, 0)
mtfsf 0xff,fp11 /* Restore previous rounding mode and
"inexact" state. */
blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
+ blr
END (__roundf)
-weak_alias (__roundf, roundf)
+libm_alias_float (__round, round)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_trunc.S b/sysdeps/powerpc/powerpc64/fpu/s_trunc.S
index 4ad939ebc4..eecc72764a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_trunc.S
@@ -1,5 +1,5 @@
/* trunc function. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.section ".toc","aw"
.LC0: /* 2**52 */
@@ -31,22 +32,24 @@
We set "round toward Zero" mode and trunc by adding +-2**52 then
subtracting +-2**52. */
-EALIGN (__trunc, 4, 0)
+ENTRY (__trunc, 4)
CALL_MCOUNT 0
- mffs fp11 /* Save current FPU rounding mode. */
lfd fp13,.LC0@toc(2)
fabs fp0,fp1
fsub fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,1 /* Set rounding toward 0 mode. */
ble- cr6,.L4
fadd fp1,fp1,fp13 /* x+= TWO52; */
fsub fp1,fp1,fp13 /* x-= TWO52; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -55,16 +58,15 @@ EALIGN (__trunc, 4, 0)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadd fp1,fp1,fp1
blr
END (__trunc)
-weak_alias (__trunc, trunc)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__trunc, truncl)
-strong_alias (__trunc, __truncl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_truncf.S b/sysdeps/powerpc/powerpc64/fpu/s_truncf.S
index 3a990550d6..7796e6b26d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_truncf.S
@@ -1,5 +1,5 @@
/* truncf function. PowerPC64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.section ".toc","aw"
.p2align 3
@@ -32,22 +33,24 @@
We set "round toward Zero" mode and trunc by adding +-2**23 then
subtracting +-2**23. */
-EALIGN (__truncf, 4, 0)
+ENTRY (__truncf, 4)
CALL_MCOUNT 0
- mffs fp11 /* Save current FPU rounding mode. */
lfs fp13,.LC0@toc(2)
fabs fp0,fp1
fsubs fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23) */
+ mffs fp11 /* Save current FPU rounding mode and
+ "inexact" state. */
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
- bnllr- cr7
+ bnl- cr7,.L10
mtfsfi 7,1 /* Set rounding toward 0 mode. */
ble- cr6,.L4
fadds fp1,fp1,fp13 /* x+= TWO23; */
fsubs fp1,fp1,fp13 /* x-= TWO23; */
fabs fp1,fp1 /* if (x == 0.0) */
/* x = 0.0; */
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
blr
.L4:
bge- cr6,.L9 /* if (x < 0.0) */
@@ -56,9 +59,16 @@ EALIGN (__truncf, 4, 0)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0xff,fp11 /* Restore previous rounding mode and
+ "inexact" state. */
+ blr
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
blr
END (__truncf)
-weak_alias (__truncf, truncf)
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc64/hp-timing.h b/sysdeps/powerpc/powerpc64/hp-timing.h
index 1d9889b6ca..c0aa3642f6 100644
--- a/sysdeps/powerpc/powerpc64/hp-timing.h
+++ b/sysdeps/powerpc/powerpc64/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. powerpc64 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/powerpc/powerpc64/le/Implies b/sysdeps/powerpc/powerpc64/le/Implies
new file mode 100644
index 0000000000..a105a325f7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64
diff --git a/sysdeps/powerpc/powerpc64/le/Implies-before b/sysdeps/powerpc/powerpc64/le/Implies-before
new file mode 100644
index 0000000000..7c20db4e97
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/Implies-before
@@ -0,0 +1,6 @@
+# On PowerPC we use the IBM extended long double format.
+ieee754/ldbl-128ibm
+ieee754/ldbl-opt
+ieee754/dbl-64
+ieee754/flt-32
+ieee754/float128
diff --git a/sysdeps/powerpc/powerpc64/le/Makefile b/sysdeps/powerpc/powerpc64/le/Makefile
new file mode 100644
index 0000000000..f59db1ca3c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/Makefile
@@ -0,0 +1,84 @@
+# When building float128 we need to ensure -mfloat128 is
+# passed to all such object files.
+
+# libgcc requires __tcb_parse_hwcap_and_convert_at_platform when built with
+# a binary128 type. That symbol is provided by the loader on dynamically
+# linked executables, forcing to link the loader after libgcc link.
+f128-loader-link = $(as-needed) $(elf-objpfx)ld.so $(no-as-needed)
+
+ifeq ($(subdir),math)
+# sqrtf128 requires emulation before POWER9.
+CPPFLAGS += -I../soft-fp
+
+# float128 requires adding a handful of extra flags.
+$(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += -mfloat128
+$(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFLAGS += -mfloat128
+$(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += -mfloat128
+$(foreach suf,$(all-object-suffixes),$(objpfx)test-float64x%$(suf)): CFLAGS += -mfloat128
+$(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFLAGS += -mfloat128
+$(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat64x%$(suf)): CFLAGS += -mfloat128
+# Pairs of types with _Float128 / _Float64x as the wider type but not
+# the narrower one.
+f128-pairs = float32-float64x float32-float128 float64-float64x \
+ float64-float128 float32x-float64x float32x-float128
+$(foreach suf,$(all-object-suffixes),$(foreach pair,$(f128-pairs),$(objpfx)test-$(pair)%$(suf))): CFLAGS += -mfloat128
+CFLAGS-libm-test-support-float128.c += -mfloat128
+CFLAGS-libm-test-support-float64x.c += -mfloat128
+CFLAGS-test-math-iscanonical.cc += -mfloat128
+CFLAGS-test-math-iseqsig.cc += -mfloat128
+CFLAGS-test-math-issignaling.cc += -mfloat128
+CFLAGS-test-math-iszero.cc += -mfloat128
+$(foreach test, \
+ test-float128% test-ifloat128% test-float64x% test-ifloat64x% \
+ $(foreach pair,$(f128-pairs),test-$(pair)%) \
+ test-math-iscanonical test-math-iseqsig test-math-issignaling \
+ test-math-iszero, \
+ $(objpfx)$(test)): \
+ gnulib-tests += $(f128-loader-link)
+endif
+
+# Append flags to string <-> _Float128 routines.
+ifneq ($(filter $(subdir),wcsmbs stdlib),)
+$(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += -mfloat128
+$(foreach suf,$(all-object-suffixes),%f128_l$(suf)): CFLAGS += -mfloat128
+$(foreach suf,$(all-object-suffixes),%f128_nan$(suf)): CFLAGS += -mfloat128
+$(foreach suf,$(all-object-suffixes),%float1282mpn$(suf)): CFLAGS += -mfloat128
+$(foreach suf,$(all-object-suffixes),%mpn2float128$(suf)): CFLAGS += -mfloat128
+CFLAGS-bug-strtod.c += -mfloat128
+CFLAGS-bug-strtod2.c += -mfloat128
+CFLAGS-tst-strtod-round.c += -mfloat128
+CFLAGS-tst-wcstod-round.c += -mfloat128
+CFLAGS-tst-strtod-nan-locale.c += -mfloat128
+CFLAGS-tst-wcstod-nan-locale.c += -mfloat128
+CFLAGS-tst-strtod6.c += -mfloat128
+CFLAGS-tst-strfrom.c += -mfloat128
+CFLAGS-tst-strfrom-locale.c += -mfloat128
+CFLAGS-strfrom-skeleton.c += -mfloat128
+CFLAGS-tst-strtod-nan-sign.c += -mfloat128
+CFLAGS-tst-wcstod-nan-sign.c += -mfloat128
+$(foreach test,bug-strtod bug-strtod2 bug-strtod2 tst-strtod-round \
+tst-wcstod-round tst-strtod6 tst-strrom tst-strfrom-locale \
+tst-strtod-nan-locale tst-wcstod-nan-locale \
+strfrom-skeleton tst-strtod-nan-sign tst-wcstod-nan-sign, \
+$(objpfx)$(test)): gnulib-tests += $(f128-loader-link)
+
+# When building glibc with support for _Float128, the powers of ten tables in
+# fpioconst.c and in the string conversion functions must be extended. Some
+# Makefiles (e.g.: wcsmbs/Makefile) override CFLAGS defined by the Makefiles in
+# sysdeps. This is avoided with the use sysdep-CFLAGS instead of CFLAGS.
+sysdep-CFLAGS += $(sysdep-CFLAGS-$(<F))
+sysdep-CFLAGS-fpioconst.c += -mfloat128
+sysdep-CFLAGS-strtod_l.c += -mfloat128
+sysdep-CFLAGS-strtof_l.c += -mfloat128
+sysdep-CFLAGS-strtold_l.c += -mfloat128
+sysdep-CFLAGS-wcstod_l.c += -mfloat128
+sysdep-CFLAGS-wcstof_l.c += -mfloat128
+sysdep-CFLAGS-wcstold_l.c += -mfloat128
+endif
+
+# Append flags to printf routines.
+ifeq ($(subdir),stdio-common)
+CFLAGS-printf_fp.c = -mfloat128
+CFLAGS-printf_fphex.c = -mfloat128
+CFLAGS-printf_size.c = -mfloat128
+endif
diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure
new file mode 100644
index 0000000000..66bb5dcc1a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/configure
@@ -0,0 +1,75 @@
+# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/powerpc/powerpc64le.
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports binary128 floating point type" >&5
+$as_echo_n "checking if $CC supports binary128 floating point type... " >&6; }
+if ${libc_cv_compiler_powerpc64le_binary128_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Werror -mfloat128"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+__float128 a, b, c, d, e;
+int i;
+
+__float128
+foobar (__float128 x)
+{
+ a = __builtin_nansq ("0");
+ b = __builtin_huge_valq ();
+ c = __builtin_infq ();
+ d = __builtin_fabsq (x);
+ e = __builtin_nanq ("0");
+ i = __builtin_signbit (x);
+ return __builtin_copysignq (x, x);
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ libc_cv_compiler_powerpc64le_binary128_ok=yes
+else
+ libc_cv_compiler_powerpc64le_binary128_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$save_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_powerpc64le_binary128_ok" >&5
+$as_echo "$libc_cv_compiler_powerpc64le_binary128_ok" >&6; }
+if test "$libc_cv_compiler_powerpc64le_binary128_ok" != "yes"; then :
+ critic_missing="$critic_missing binary128 floating point type (GCC >= 6.2) is required on powerpc64le."
+fi
+
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $libc_cv_cc_submachine"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the target machine is at least POWER8" >&5
+$as_echo_n "checking if the target machine is at least POWER8... " >&6; }
+if ${libc_cv_target_power8_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifndef _ARCH_PWR8
+#error invalid target architecture
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ libc_cv_target_power8_ok=yes
+else
+ libc_cv_target_power8_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_target_power8_ok" >&5
+$as_echo "$libc_cv_target_power8_ok" >&6; }
+if test "$libc_cv_target_power8_ok" != "yes"; then :
+ critic_missing="$critic_missing POWER8 or newer is required on powerpc64le."
+fi
+CFLAGS="$OLD_CFLAGS"
+
+test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5
diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac
new file mode 100644
index 0000000000..20a49d89e8
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/configure.ac
@@ -0,0 +1,48 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/powerpc/powerpc64le.
+
+dnl Require binary128 floating point support on powerpc64le (available in
+dnl GCC 6.2).
+AC_CACHE_CHECK([if $CC supports binary128 floating point type],
+ libc_cv_compiler_powerpc64le_binary128_ok, [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Werror -mfloat128"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+__float128 a, b, c, d, e;
+int i;
+
+__float128
+foobar (__float128 x)
+{
+ a = __builtin_nansq ("0");
+ b = __builtin_huge_valq ();
+ c = __builtin_infq ();
+ d = __builtin_fabsq (x);
+ e = __builtin_nanq ("0");
+ i = __builtin_signbit (x);
+ return __builtin_copysignq (x, x);
+}
+]])],
+ [libc_cv_compiler_powerpc64le_binary128_ok=yes],
+ [libc_cv_compiler_powerpc64le_binary128_ok=no])
+CFLAGS="$save_CFLAGS"])
+AS_IF([test "$libc_cv_compiler_powerpc64le_binary128_ok" != "yes"],
+ [critic_missing="$critic_missing binary128 floating point type (GCC >= 6.2) is required on powerpc64le."])
+
+dnl Require at least POWER8 on powerpc64le
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $libc_cv_cc_submachine"
+AC_CACHE_CHECK([if the target machine is at least POWER8],
+ libc_cv_target_power8_ok, [
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#ifndef _ARCH_PWR8
+#error invalid target architecture
+#endif
+]])],
+ [libc_cv_target_power8_ok=yes],
+ [libc_cv_target_power8_ok=no])])
+AS_IF([test "$libc_cv_target_power8_ok" != "yes"],
+ [critic_missing="$critic_missing POWER8 or newer is required on powerpc64le."])
+CFLAGS="$OLD_CFLAGS"
+
+test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing])
diff --git a/sysdeps/powerpc/powerpc64/le/fpu/Implies b/sysdeps/powerpc/powerpc64/le/fpu/Implies
new file mode 100644
index 0000000000..c1f617b7da
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/fpu/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/fpu
diff --git a/sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c b/sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c
new file mode 100644
index 0000000000..f7c8ea33d3
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c
@@ -0,0 +1,56 @@
+/* soft-fp sqrt for _Float128
+ Return sqrt(a)
+ Copyright (C) 2017-2018 Free Software 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 <math.h>
+
+/* Unavoidable hacks since TFmode is assumed to be binary128 when
+ -mabi=ibmlongdouble is used. */
+#if __HAVE_FLOAT128_UNLIKE_LDBL
+# define TFtype KFtype
+# define TF KF
+#endif
+
+#include <soft-fp.h>
+#include <quad.h>
+
+__float128
+__ieee754_sqrtf128 (__float128 a)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (A);
+ FP_DECL_Q (R);
+ __float128 r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (A, a);
+ FP_SQRT_Q (R, A);
+ FP_PACK_Q (r, R);
+ FP_HANDLE_EXCEPTIONS;
+ return r;
+}
+strong_alias (__ieee754_sqrtf128, __sqrtf128_finite)
diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Implies
new file mode 100644
index 0000000000..8d6531a174
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile
new file mode 100644
index 0000000000..a32f3d8b81
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/Makefile
@@ -0,0 +1,6 @@
+ifeq ($(subdir),math)
+libm-sysdep_routines += w_sqrtf128-power9 w_sqrtf128-ppc64le
+
+CFLAGS-w_sqrtf128-ppc64le.c += -mfloat128
+CFLAGS-w_sqrtf128-power9.c += -mfloat128 -mcpu=power9
+endif
diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128-power9.c b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128-power9.c
new file mode 100644
index 0000000000..55d93b9256
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128-power9.c
@@ -0,0 +1,35 @@
+/* POWER9 sqrt for _Float128
+ Copyright (C) 2018 Free Software 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 <math-type-macros-float128.h>
+
+#define __sqrtf128 __sqrtf128_power9
+
+#undef declare_mgen_alias
+#define declare_mgen_alias(a, b)
+
+#include <w_sqrt_template.c>
diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128-ppc64le.c b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128-ppc64le.c
new file mode 100644
index 0000000000..72f09b1017
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128-ppc64le.c
@@ -0,0 +1,35 @@
+/* PPC64LE sqrt for _Float128
+ Copyright (C) 2018 Free Software 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 <math-type-macros-float128.h>
+
+#define __sqrtf128 __sqrtf128_ppc64le
+
+#undef declare_mgen_alias
+#define declare_mgen_alias(a, b)
+
+#include <w_sqrt_template.c>
diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128.c b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128.c
new file mode 100644
index 0000000000..a44bf4f5cc
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/w_sqrtf128.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __sqrtf128.
+ Copyright (C) 2018 Free Software 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 NO_MATH_REDIRECT
+#include <math.h>
+#include "init-arch.h"
+#include <math-type-macros-float128.h>
+
+extern __typeof (__sqrtf128) __sqrtf128_ppc64le attribute_hidden;
+extern __typeof (__sqrtf128) __sqrtf128_power9 attribute_hidden;
+
+libc_ifunc (__sqrtf128,
+ (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+ ? __sqrtf128_power9
+ : __sqrtf128_ppc64le);
+declare_mgen_alias (__sqrt, sqrt)
diff --git a/sysdeps/powerpc/powerpc64/le/fpu/sfp-machine.h b/sysdeps/powerpc/powerpc64/le/fpu/sfp-machine.h
new file mode 100644
index 0000000000..fac5dd0347
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/fpu/sfp-machine.h
@@ -0,0 +1,115 @@
+#define _FP_W_TYPE_SIZE 64
+#define _FP_W_TYPE unsigned long long
+#define _FP_WS_TYPE signed long long
+#define _FP_I_TYPE long long
+
+typedef int TItype __attribute__ ((mode (TI)));
+typedef unsigned int UTItype __attribute__ ((mode (TI)));
+
+#define TI_BITS (__CHAR_BIT__ * (int)sizeof(TItype))
+
+/* The type of the result of a floating point comparison. This must
+ match `__libgcc_cmp_return__' in GCC for the target. */
+typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
+#define CMPtype __gcc_CMPtype
+
+#define _FP_MUL_MEAT_S(R,X,Y) \
+ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+
+#define _FP_MUL_MEAT_D(R,X,Y) \
+ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y) \
+ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
+
+#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
+
+#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1)
+#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1
+
+#define _FP_NANSIGN_S 0
+#define _FP_NANSIGN_D 0
+#define _FP_NANSIGN_Q 0
+
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
+
+/* Someone please check this. */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do { \
+ if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
+ && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
+ { \
+ R##_s = Y##_s; \
+ _FP_FRAC_COPY_##wc(R,Y); \
+ } \
+ else \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc(R,X); \
+ } \
+ R##_c = FP_CLS_NAN; \
+ } while (0)
+
+#define _FP_TININESS_AFTER_ROUNDING 0
+
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __BYTE_ORDER __LITTLE_ENDIAN
+
+/* Only provide exception support if we have hardware floating point using
+ floating point registers and we can execute the mtfsf instruction. This
+ would only be true if we are using the emulation routines for IEEE 128-bit
+ floating point on pre-ISA 3.0 machines without the IEEE 128-bit floating
+ point support. */
+
+#ifdef __FLOAT128__
+#define ISA_BIT(x) (1LL << (63 - x))
+
+/* Use the same bits of the FPSCR. */
+# define FP_EX_INVALID ISA_BIT(34)
+# define FP_EX_OVERFLOW ISA_BIT(35)
+# define FP_EX_UNDERFLOW ISA_BIT(36)
+# define FP_EX_DIVZERO ISA_BIT(37)
+# define FP_EX_INEXACT ISA_BIT(38)
+# define FP_EX_ALL (FP_EX_INVALID | FP_EX_OVERFLOW \
+ | FP_EX_UNDERFLOW | FP_EX_DIVZERO \
+ | FP_EX_INEXACT)
+
+void __sfp_handle_exceptions (int);
+
+# define FP_HANDLE_EXCEPTIONS \
+ do { \
+ if (__builtin_expect (_fex, 0)) \
+ __sfp_handle_exceptions (_fex); \
+ } while (0);
+
+/* The FP_EX_* bits track whether the exception has occurred. This macro
+ must set the FP_EX_* bits of those exceptions which are configured to
+ trap. The FPSCR bit which indicates this is 22 ISA bits above the
+ respective FP_EX_* bit. Note, the ISA labels bits from msb to lsb,
+ so 22 ISA bits above is 22 bits below when counted from the lsb. */
+# define FP_TRAPPING_EXCEPTIONS ((_fpscr.i << 22) & FP_EX_ALL)
+
+# define FP_RND_NEAREST 0x0
+# define FP_RND_ZERO 0x1
+# define FP_RND_PINF 0x2
+# define FP_RND_MINF 0x3
+# define FP_RND_MASK 0x3
+
+# define _FP_DECL_EX \
+ union { unsigned long long i; double d; } _fpscr __attribute__ ((unused)) = \
+ { .i = FP_RND_NEAREST }
+
+#define FP_INIT_ROUNDMODE \
+ do { \
+ __asm__ __volatile__ ("mffs %0" \
+ : "=f" (_fpscr.d)); \
+ } while (0)
+
+# define FP_ROUNDMODE (_fpscr.i & FP_RND_MASK)
+#endif /* !__FLOAT128__ */
diff --git a/sysdeps/powerpc/powerpc64/le/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/multiarch/Implies
new file mode 100644
index 0000000000..30edcf7f9d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/multiarch
diff --git a/sysdeps/powerpc/powerpc64/le/power7/Implies b/sysdeps/powerpc/powerpc64/le/power7/Implies
new file mode 100644
index 0000000000..5763968694
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power7/Implies
@@ -0,0 +1,13 @@
+powerpc/powerpc64/power7
+powerpc/powerpc64/power6/fpu
+powerpc/powerpc64/power6
+powerpc/powerpc64/power5+/fpu
+powerpc/powerpc64/power5+
+powerpc/power5+/fpu
+powerpc/power5+
+powerpc/powerpc64/power5/fpu
+powerpc/powerpc64/power5
+powerpc/powerpc64/power4
+powerpc/power4/fpu
+powerpc/power4
+powerpc/powerpc64/le
diff --git a/sysdeps/powerpc/powerpc64/le/power7/fpu/Implies b/sysdeps/powerpc/powerpc64/le/power7/fpu/Implies
new file mode 100644
index 0000000000..27eb299ef0
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power7/fpu/Implies
@@ -0,0 +1,5 @@
+powerpc/powerpc64/power7/fpu
+powerpc/powerpc64/power6/fpu
+powerpc/powerpc64/power5+/fpu
+powerpc/powerpc64/power5/fpu
+powerpc/powerpc64/le/fpu
diff --git a/sysdeps/powerpc/powerpc64/le/power7/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/power7/fpu/multiarch/Implies
new file mode 100644
index 0000000000..f9b3a92c33
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power7/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/le/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/le/power7/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/power7/multiarch/Implies
new file mode 100644
index 0000000000..87b32a21ee
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power7/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/le/multiarch
diff --git a/sysdeps/powerpc/powerpc64/le/power8/Implies b/sysdeps/powerpc/powerpc64/le/power8/Implies
new file mode 100644
index 0000000000..6c3fc78ce1
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power8/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power8
+powerpc/powerpc64/le/power7
diff --git a/sysdeps/powerpc/powerpc64/le/power8/fpu/Implies b/sysdeps/powerpc/powerpc64/le/power8/fpu/Implies
new file mode 100644
index 0000000000..be3c5157b9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power8/fpu/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power8/fpu
+powerpc/powerpc64/le/power7/fpu
diff --git a/sysdeps/powerpc/powerpc64/le/power8/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/power8/fpu/multiarch/Implies
new file mode 100644
index 0000000000..36c05ff34a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power8/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/le/power7/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/le/power8/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/power8/multiarch/Implies
new file mode 100644
index 0000000000..0057194b12
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power8/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/le/power7/multiarch
diff --git a/sysdeps/powerpc/powerpc64/le/power9/Implies b/sysdeps/powerpc/powerpc64/le/power9/Implies
new file mode 100644
index 0000000000..8c0cfd7c2e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power9/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power9
+powerpc/powerpc64/le/power8
diff --git a/sysdeps/powerpc/powerpc64/le/power9/fpu/Implies b/sysdeps/powerpc/powerpc64/le/power9/fpu/Implies
new file mode 100644
index 0000000000..8b7c0b4af6
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power9/fpu/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power9/fpu
+powerpc/powerpc64/le/power8/fpu
diff --git a/sysdeps/powerpc/powerpc64/le/power9/fpu/e_sqrtf128.c b/sysdeps/powerpc/powerpc64/le/power9/fpu/e_sqrtf128.c
new file mode 100644
index 0000000000..76ab451dbb
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power9/fpu/e_sqrtf128.c
@@ -0,0 +1,36 @@
+/* POWER9 sqrt for _Float128
+ Return sqrt(a)
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+__float128
+__ieee754_sqrtf128 (__float128 a)
+{
+ __float128 z;
+ asm ("xssqrtqp %0,%1" : "=v" (z) : "v" (a));
+ return z;
+}
+strong_alias (__ieee754_sqrtf128, __sqrtf128_finite)
diff --git a/sysdeps/powerpc/powerpc64/le/power9/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/power9/fpu/multiarch/Implies
new file mode 100644
index 0000000000..dce5bca13e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power9/fpu/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/le/power8/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/le/power9/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/power9/multiarch/Implies
new file mode 100644
index 0000000000..98efd68e54
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power9/multiarch/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/le/power8/multiarch
diff --git a/sysdeps/powerpc/powerpc64/lshift.S b/sysdeps/powerpc/powerpc64/lshift.S
index 8ce7a7644d..8b6396ee6c 100644
--- a/sysdeps/powerpc/powerpc64/lshift.S
+++ b/sysdeps/powerpc/powerpc64/lshift.S
@@ -1,5 +1,5 @@
/* PowerPC64 mpn_lshift -- rp[] = up[] << cnt
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,7 +28,7 @@
#define U1 r31
#define RETVAL r5
-EALIGN(__mpn_lshift, 5, 0)
+ENTRY_TOCLESS (__mpn_lshift, 5)
std U1, -8(r1)
std U0, -16(r1)
subfic TNC, CNT, 64
diff --git a/sysdeps/powerpc/powerpc64/memcpy.S b/sysdeps/powerpc/powerpc64/memcpy.S
index 4c44a124e0..ebde694a4f 100644
--- a/sysdeps/powerpc/powerpc64/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC64.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]);
Returns 'dst'.
Memcpy handles short copies (< 32-bytes) using a binary move blocks
@@ -33,7 +33,11 @@
possible when both source and destination are doubleword aligned.
Each case has a optimized unrolled loop. */
-EALIGN (memcpy, 5, 0)
+#ifndef MEMCPY
+# define MEMCPY memcpy
+#endif
+
+ENTRY_TOCLESS (MEMCPY, 5)
CALL_MCOUNT 3
cmpldi cr1,5,31
@@ -389,5 +393,5 @@ EALIGN (memcpy, 5, 0)
ld 31,-8(1)
ld 3,-16(1)
blr
-END_GEN_TB (memcpy,TB_TOCLESS)
+END_GEN_TB (MEMCPY,TB_TOCLESS)
libc_hidden_builtin_def (memcpy)
diff --git a/sysdeps/powerpc/powerpc64/memset.S b/sysdeps/powerpc/powerpc64/memset.S
index 1106e77410..a36df7caa8 100644
--- a/sysdeps/powerpc/powerpc64/memset.S
+++ b/sysdeps/powerpc/powerpc64/memset.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,14 +24,18 @@
.section ".text"
.align 2
-/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
+/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5]));
Returns 's'.
The memset is done in three sizes: byte (8 bits), word (32 bits),
cache line (256 bits). There is a special case for setting cache lines
to 0, to take advantage of the dcbz instruction. */
-EALIGN (memset, 5, 0)
+#ifndef MEMSET
+# define MEMSET memset
+#endif
+
+ENTRY (MEMSET, 5)
CALL_MCOUNT 3
#define rTMP r0
@@ -244,7 +248,7 @@ L(medium_27f):
L(medium_28t):
std rCHR, -8(rMEMP)
blr
-END_GEN_TB (memset,TB_TOCLESS)
+END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
#ifndef NO_BZERO_IMPL
diff --git a/sysdeps/powerpc/powerpc64/mul_1.S b/sysdeps/powerpc/powerpc64/mul_1.S
index d1934dfc0f..953ded8028 100644
--- a/sysdeps/powerpc/powerpc64/mul_1.S
+++ b/sysdeps/powerpc/powerpc64/mul_1.S
@@ -1,6 +1,6 @@
/* PowerPC64 __mpn_mul_1 -- Multiply a limb vector with a limb and store
the result in a second limb vector.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
#define N r5
#define VL r6
-EALIGN(__mpn_mul_1, 5, 0)
+ENTRY_TOCLESS (__mpn_mul_1, 5)
std r27, -40(r1)
std r26, -48(r1)
li r12, 0
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index 3b0e3a0117..4df6b45c4c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -1,25 +1,35 @@
ifeq ($(subdir),string)
-sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
- memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
- memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
+sysdep_routines += memcpy-power8-cached memcpy-power7 memcpy-a2 memcpy-power6 \
+ memcpy-cell memcpy-power4 memcpy-ppc64 \
+ memcmp-power8 memcmp-power7 memcmp-power4 memcmp-ppc64 \
+ memset-power7 memset-power6 memset-power4 \
memset-ppc64 memset-power8 \
- mempcpy-power7 mempcpy-ppc64 memchr-power7 memchr-ppc64 \
- memrchr-power7 memrchr-ppc64 rawmemchr-power7 \
- rawmemchr-ppc64 strlen-power7 strlen-ppc64 strnlen-power7 \
- strnlen-ppc64 strcasecmp-power7 strcasecmp_l-power7 \
+ mempcpy-power7 mempcpy-ppc64 \
+ memchr-power8 memchr-power7 memchr-ppc64 \
+ memrchr-power8 memrchr-power7 memrchr-ppc64 \
+ rawmemchr-power7 rawmemchr-ppc64 \
+ strlen-power7 strlen-ppc64 \
+ strnlen-power8 strnlen-power7 strnlen-ppc64 \
+ strcasecmp-power7 strcasecmp_l-power7 \
strncase-power7 strncase_l-power7 \
- strncmp-power8 strncmp-power7 strncmp-power4 strncmp-ppc64 \
- strchr-power7 strchr-ppc64 \
- strchrnul-power7 strchrnul-ppc64 \
+ strncmp-power9 strncmp-power8 strncmp-power7 \
+ strncmp-power4 strncmp-ppc64 \
+ strchr-power8 strchr-power7 strchr-ppc64 \
+ strchrnul-power8 strchrnul-power7 strchrnul-ppc64 \
strcpy-power8 strcpy-power7 strcpy-ppc64 stpcpy-power8 \
stpcpy-power7 stpcpy-ppc64 \
- strrchr-power7 strrchr-ppc64 strncat-power7 strncat-ppc64 \
+ strrchr-power8 strrchr-power7 strrchr-ppc64 \
+ strncat-power8 strncat-power7 strncat-ppc64 \
strncpy-power7 strncpy-ppc64 \
stpncpy-power8 stpncpy-power7 stpncpy-ppc64 \
- strcmp-power8 strcmp-power7 strcmp-ppc64 \
+ strcmp-power9 strcmp-power8 strcmp-power7 strcmp-ppc64 \
strcat-power8 strcat-power7 strcat-ppc64 \
memmove-power7 memmove-ppc64 wordcopy-ppc64 bcopy-ppc64 \
- strncpy-power8 strstr-power7 strstr-ppc64
+ strncpy-power8 strstr-power7 strstr-ppc64 \
+ strspn-power8 strspn-ppc64 strcspn-power8 strcspn-ppc64 \
+ strlen-power8 strcasestr-power8 strcasestr-ppc64 \
+ strcasecmp-ppc64 strcasecmp-power8 strncase-ppc64 \
+ strncase-power8
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
index ddd9bfde5a..f28be7bf37 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default bcopy.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bcopy.c b/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
index ff271a0859..1c4a229b1f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
@@ -1,5 +1,5 @@
/* PowerPC64 multiarch bcopy.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bzero.c b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
index 56073fc587..f8cb05bea8 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bzero.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
@@ -1,5 +1,5 @@
/* Multiple versions of bzero. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 11a8215ee4..38a21e478e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -1,5 +1,5 @@
/* Enumerate available IFUNC implementations of a function. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -51,6 +51,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
#ifdef SHARED
/* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __memcpy_power8_cached)
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_HAS_VSX,
__memcpy_power7)
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_ARCH_2_06,
@@ -101,6 +103,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strlen.c. */
IFUNC_IMPL (i, name, strlen,
+ IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strlen_power8)
IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_HAS_VSX,
__strlen_power7)
IFUNC_IMPL_ADD (array, i, strlen, 1,
@@ -108,6 +112,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c. */
IFUNC_IMPL (i, name, strncmp,
+ IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00,
+ __strncmp_power9)
IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_2_07,
__strncmp_power8)
IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_HAS_VSX,
@@ -120,6 +126,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strchr.c. */
IFUNC_IMPL (i, name, strchr,
IFUNC_IMPL_ADD (array, i, strchr,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strchr_power8)
+ IFUNC_IMPL_ADD (array, i, strchr,
hwcap & PPC_FEATURE_HAS_VSX,
__strchr_power7)
IFUNC_IMPL_ADD (array, i, strchr, 1,
@@ -128,6 +137,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strchrnul.c. */
IFUNC_IMPL (i, name, strchrnul,
IFUNC_IMPL_ADD (array, i, strchrnul,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strchrnul_power8)
+ IFUNC_IMPL_ADD (array, i, strchrnul,
hwcap & PPC_FEATURE_HAS_VSX,
__strchrnul_power7)
IFUNC_IMPL_ADD (array, i, strchrnul, 1,
@@ -136,6 +148,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */
IFUNC_IMPL (i, name, memcmp,
+ IFUNC_IMPL_ADD (array, i, memcmp, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __memcmp_power8)
IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_HAS_VSX,
__memcmp_power7)
IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_POWER4,
@@ -171,6 +185,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c. */
IFUNC_IMPL (i, name, memchr,
IFUNC_IMPL_ADD (array, i, memchr,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __memchr_power8)
+ IFUNC_IMPL_ADD (array, i, memchr,
hwcap & PPC_FEATURE_HAS_VSX,
__memchr_power7)
IFUNC_IMPL_ADD (array, i, memchr, 1,
@@ -179,6 +196,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/memrchr.c. */
IFUNC_IMPL (i, name, memrchr,
IFUNC_IMPL_ADD (array, i, memrchr,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __memrchr_power8)
+ IFUNC_IMPL_ADD (array, i, memrchr,
hwcap & PPC_FEATURE_HAS_VSX,
__memrchr_power7)
IFUNC_IMPL_ADD (array, i, memrchr, 1,
@@ -194,6 +214,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strnlen.c. */
IFUNC_IMPL (i, name, strnlen,
+ IFUNC_IMPL_ADD (array, i, strnlen,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strnlen_power8)
IFUNC_IMPL_ADD (array, i, strnlen, hwcap & PPC_FEATURE_HAS_VSX,
__strnlen_power7)
IFUNC_IMPL_ADD (array, i, strnlen, 1,
@@ -202,6 +225,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c. */
IFUNC_IMPL (i, name, strcasecmp,
IFUNC_IMPL_ADD (array, i, strcasecmp,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strcasecmp_power8)
+ IFUNC_IMPL_ADD (array, i, strcasecmp,
hwcap & PPC_FEATURE_HAS_VSX,
__strcasecmp_power7)
IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_ppc))
@@ -217,6 +243,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c. */
IFUNC_IMPL (i, name, strncasecmp,
IFUNC_IMPL_ADD (array, i, strncasecmp,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strncasecmp_power8)
+ IFUNC_IMPL_ADD (array, i, strncasecmp,
hwcap & PPC_FEATURE_HAS_VSX,
__strncasecmp_power7)
IFUNC_IMPL_ADD (array, i, strncasecmp, 1, __strncasecmp_ppc))
@@ -265,6 +294,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c. */
IFUNC_IMPL (i, name, strrchr,
IFUNC_IMPL_ADD (array, i, strrchr,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strrchr_power8)
+ IFUNC_IMPL_ADD (array, i, strrchr,
hwcap & PPC_FEATURE_HAS_VSX,
__strrchr_power7)
IFUNC_IMPL_ADD (array, i, strrchr, 1,
@@ -273,6 +305,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strncat.c. */
IFUNC_IMPL (i, name, strncat,
IFUNC_IMPL_ADD (array, i, strncat,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strncat_power8)
+ IFUNC_IMPL_ADD (array, i, strncat,
hwcap & PPC_FEATURE_HAS_VSX,
__strncat_power7)
IFUNC_IMPL_ADD (array, i, strncat, 1,
@@ -303,6 +338,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
/* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c. */
IFUNC_IMPL (i, name, strcmp,
IFUNC_IMPL_ADD (array, i, strcmp,
+ hwcap2 & PPC_FEATURE2_ARCH_3_00,
+ __strcmp_power9)
+ IFUNC_IMPL_ADD (array, i, strcmp,
hwcap2 & PPC_FEATURE2_ARCH_2_07,
__strcmp_power8)
IFUNC_IMPL_ADD (array, i, strcmp,
@@ -322,6 +360,22 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strcat, 1,
__strcat_ppc))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strspn.c. */
+ IFUNC_IMPL (i, name, strspn,
+ IFUNC_IMPL_ADD (array, i, strspn,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strspn_power8)
+ IFUNC_IMPL_ADD (array, i, strspn, 1,
+ __strspn_ppc))
+
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strcspn.c. */
+ IFUNC_IMPL (i, name, strcspn,
+ IFUNC_IMPL_ADD (array, i, strcspn,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strcspn_power8)
+ IFUNC_IMPL_ADD (array, i, strcspn, 1,
+ __strcspn_ppc))
+
/* Support sysdeps/powerpc/powerpc64/multiarch/strstr.c. */
IFUNC_IMPL (i, name, strstr,
IFUNC_IMPL_ADD (array, i, strstr,
@@ -331,5 +385,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strstr_ppc))
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strcasestr.c. */
+ IFUNC_IMPL (i, name, strcasestr,
+ IFUNC_IMPL_ADD (array, i, strcasestr,
+ hwcap2 & PPC_FEATURE2_ARCH_2_07,
+ __strcasestr_power8)
+ IFUNC_IMPL_ADD (array, i, strcasestr, 1,
+ __strcasestr_ppc))
+
return i;
}
diff --git a/sysdeps/powerpc/powerpc64/multiarch/init-arch.h b/sysdeps/powerpc/powerpc64/multiarch/init-arch.h
index 98089b20f3..207add351a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/init-arch.h
+++ b/sysdeps/powerpc/powerpc64/multiarch/init-arch.h
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S
index df947f5f89..33b565f1e5 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized memchr implementation for PowerPC64/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__memchr_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__memchr_power7): \
- cfi_startproc; \
- LOCALENTRY(__memchr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__memchr_power7) \
- END_2(__memchr_power7)
+#define MEMCHR __memchr_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S
new file mode 100644
index 0000000000..cb1f0face9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S
@@ -0,0 +1,26 @@
+/* Optimized memchr implementation for PowerPC64/POWER8.
+ Copyright (C) 2017-2018 Free Software 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 MEMCHR __memchr_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#undef weak_alias
+#define weak_alias(name,alias)
+
+#include <sysdeps/powerpc/powerpc64/power8/memchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c
index 896824c5ce..48cbe601eb 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of memchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr.c b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
index 71f89c4e88..cd71db972f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of memchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,10 +23,13 @@
extern __typeof (__memchr) __memchr_ppc attribute_hidden;
extern __typeof (__memchr) __memchr_power7 attribute_hidden;
+extern __typeof (__memchr) __memchr_power8 attribute_hidden;
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
libc_ifunc (__memchr,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __memchr_power8 :
(hwcap & PPC_FEATURE_HAS_VSX)
? __memchr_power7
: __memchr_ppc);
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
index 1d74e37feb..26879a2b0f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S
@@ -1,5 +1,5 @@
/* Optimized memcmp implementation for PowerPC64/POWER4.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcmp_power4) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcmp_power4): \
- cfi_startproc; \
- LOCALENTRY(__memcmp_power4)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__memcmp_power4) \
- END_2(__memcmp_power4)
+#define MEMCMP __memcmp_power4
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
index 9993e7266b..9715d11d8d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S
@@ -1,5 +1,5 @@
/* Optimized memcmp implementation for PowerPC64/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcmp_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcmp_power7): \
- cfi_startproc; \
- LOCALENTRY(__memcmp_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__memcmp_power7) \
- END_2(__memcmp_power7)
+#define MEMCMP __memcmp_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
new file mode 100644
index 0000000000..c4da81c64e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
@@ -0,0 +1,26 @@
+/* Optimized memcmp implementation for PowerPC64/POWER8.
+ Copyright (C) 2017-2018 Free Software 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 MEMCMP __memcmp_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#undef weak_alias
+#define weak_alias(name,alias)
+
+#include <sysdeps/powerpc/powerpc64/power8/memcmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
index d88f908d12..8180ed122b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
index e8cf6ae23d..2c7a083a65 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of memcmp. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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,19 @@
extern __typeof (memcmp) __memcmp_ppc attribute_hidden;
extern __typeof (memcmp) __memcmp_power4 attribute_hidden;
extern __typeof (memcmp) __memcmp_power7 attribute_hidden;
+extern __typeof (memcmp) __memcmp_power8 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,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __memcmp_power8 :
+ (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/memcpy-a2.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S
index bbe1b32033..91eddcebe9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC A2.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_a2) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_a2): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_a2)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_a2,mask) \
- END_2(__memcpy_a2)
+#define MEMCPY __memcpy_a2
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S
index 11bab911d4..a93f5146fb 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC/CELL.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_cell) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_cell): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_cell)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_cell,mask) \
- END_2(__memcpy_cell)
+#define MEMCPY __memcpy_cell
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S
index e414819208..bc6844535b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC64/POWER4.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_power4) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_power4): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_power4)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_power4,mask) \
- END_2(__memcpy_power4)
+#define MEMCPY __memcpy_power4
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S
index 819f015d32..9d4c9927d9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC/POWER6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_power6) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_power6): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_power6)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_power6,mask) \
- END_2(__memcpy_power6)
+#define MEMCPY __memcpy_power6
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
index d48b54f4c1..b24452e29c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_power7): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_power7)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_power7,mask) \
- END_2(__memcpy_power7)
+#define MEMCPY __memcpy_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S
new file mode 100644
index 0000000000..6b69e57212
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S
@@ -0,0 +1,176 @@
+/* Optimized memcpy implementation for cached memory on PowerPC64/POWER8.
+ Copyright (C) 2017-2018 Free Software 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>
+
+
+/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+ Returns 'dst'. */
+
+ .machine power8
+ENTRY_TOCLESS (__memcpy_power8_cached, 5)
+ CALL_MCOUNT 3
+
+ cmpldi cr7,r5,15
+ bgt cr7,L(ge_16)
+ andi. r9,r5,0x1
+ mr r9,r3
+ beq cr0,1f
+ lbz r10,0(r4)
+ addi r9,r3,1
+ addi r4,r4,1
+ stb r10,0(r3)
+1:
+ andi. r10,r5,0x2
+ beq cr0,2f
+ lhz r10,0(r4)
+ addi r9,r9,2
+ addi r4,r4,2
+ sth r10,-2(r9)
+2:
+ andi. r10,r5,0x4
+ beq cr0,3f
+ lwz r10,0(r4)
+ addi r9,9,4
+ addi r4,4,4
+ stw r10,-4(r9)
+3:
+ andi. r10,r5,0x8
+ beqlr cr0
+ ld r10,0(r4)
+ std r10,0(r9)
+ blr
+
+ .align 4
+L(ge_16):
+ cmpldi cr7,r5,32
+ ble cr7,L(ge_16_le_32)
+ cmpldi cr7,r5,64
+ ble cr7,L(gt_32_le_64)
+
+ /* Align dst to 16 bytes. */
+ andi. r9,r3,0xf
+ mr r12,r3
+ beq cr0,L(dst_is_align_16)
+ lxvd2x v0,0,r4
+ subfic r12,r9,16
+ subf r5,r12,r5
+ add r4,r4,r12
+ add r12,r3,r12
+ stxvd2x v0,0,r3
+L(dst_is_align_16):
+ cmpldi cr7,r5,127
+ ble cr7,L(tail_copy)
+ mr r9,r12
+ srdi r10,r5,7
+ li r11,16
+ li r6,32
+ li r7,48
+ mtctr r10
+ clrrdi r0,r5,7
+
+ /* Main loop, copy 128 bytes each time. */
+ .align 4
+L(copy_128):
+ lxvd2x v10,0,r4
+ lxvd2x v11,r4,r11
+ addi r8,r4,64
+ addi r10,r9,64
+ lxvd2x v12,r4,r6
+ lxvd2x v0,r4,r7
+ addi r4,r4,128
+ stxvd2x v10,0,r9
+ stxvd2x v11,r9,r11
+ stxvd2x v12,r9,r6
+ stxvd2x v0,r9,r7
+ addi r9,r9,128
+ lxvd2x v10,0,r8
+ lxvd2x v11,r8,r11
+ lxvd2x v12,r8,r6
+ lxvd2x v0,r8,r7
+ stxvd2x v10,0,r10
+ stxvd2x v11,r10,r11
+ stxvd2x v12,r10,r6
+ stxvd2x v0,r10,r7
+ bdnz L(copy_128)
+
+ add r12,r12,r0
+ rldicl r5,r5,0,57
+L(tail_copy):
+ cmpldi cr7,r5,63
+ ble cr7,L(tail_le_64)
+ li r8,16
+ li r10,32
+ lxvd2x v10,0,r4
+ li r9,48
+ addi r5,r5,-64
+ lxvd2x v11,r4,r8
+ lxvd2x v12,r4,r10
+ lxvd2x v0,r4,r9
+ addi r4,r4,64
+ stxvd2x v10,0,r12
+ stxvd2x v11,r12,r8
+ stxvd2x v12,r12,r10
+ stxvd2x v0,r12,9
+ addi r12,r12,64
+
+L(tail_le_64):
+ cmpldi cr7,r5,32
+ bgt cr7,L(tail_gt_32_le_64)
+ cmpdi cr7,r5,0
+ beqlr cr7
+ addi r5,r5,-32
+ li r9,16
+ add r8,r4,r5
+ add r10,r12,r5
+ lxvd2x v12,r4,r5
+ lxvd2x v0,r8,r9
+ stxvd2x v12,r12,r5
+ stxvd2x v0,r10,r9
+ blr
+
+ .align 4
+L(ge_16_le_32):
+ addi r5,r5,-16
+ lxvd2x v0,0,r4
+ lxvd2x v1,r4,r5
+ stxvd2x v0,0,r3
+ stxvd2x v1,r3,r5
+ blr
+
+ .align 4
+L(gt_32_le_64):
+ mr r12,r3
+
+ .align 4
+L(tail_gt_32_le_64):
+ li r9,16
+ lxvd2x v0,0,r4
+ addi r5,r5,-32
+ lxvd2x v1,r4,r9
+ add r8,r4,r5
+ lxvd2x v2,r4,r5
+ add r10,r12,r5
+ lxvd2x v3,r8,r9
+ stxvd2x v0,0,r12
+ stxvd2x v1,r12,r9
+ stxvd2x v2,r12,r5
+ stxvd2x v3,r10,r9
+ blr
+
+END_GEN_TB (__memcpy_power8_cached,TB_TOCLESS)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
index 6e2b64fa7d..55036676b3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S
@@ -1,5 +1,5 @@
/* Default memcpy implementation for PowerPC64.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,24 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#if defined SHARED && IS_IN (libc)
-# undef EALIGN
-# define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memcpy_ppc) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memcpy_ppc): \
- cfi_startproc; \
- LOCALENTRY(__memcpy_ppc)
-
-# undef END_GEN_TB
-# define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memcpy_ppc,mask) \
- END_2(__memcpy_ppc)
+# define MEMCPY __memcpy_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
index 8549515c25..44dea594f3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of memcpy. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,18 +35,21 @@ extern __typeof (__redirect_memcpy) __memcpy_cell attribute_hidden;
extern __typeof (__redirect_memcpy) __memcpy_power6 attribute_hidden;
extern __typeof (__redirect_memcpy) __memcpy_a2 attribute_hidden;
extern __typeof (__redirect_memcpy) __memcpy_power7 attribute_hidden;
+extern __typeof (__redirect_memcpy) __memcpy_power8_cached attribute_hidden;
libc_ifunc (__libc_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 :
- (hwcap & PPC_FEATURE_POWER4)
- ? __memcpy_power4
+ ((hwcap2 & PPC_FEATURE2_ARCH_2_07) && use_cached_memopt)
+ ? __memcpy_power8_cached :
+ (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 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __memcpy_power4
: __memcpy_ppc);
#undef memcpy
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S
index 5f35f16d9b..0b251d0f5f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S
@@ -1,5 +1,5 @@
/* Optimized memmove implementation for PowerPC64/POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memmove_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memmove_power7): \
- cfi_startproc; \
- LOCALENTRY(__memmove_power7)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memmove_power7,mask) \
- END_2(__memmove_power7)
+#define MEMMOVE __memmove_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c
index fc9bed3c25..a185190360 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove.c b/sysdeps/powerpc/powerpc64/multiarch/memmove.c
index 2775c2c8d4..39987155cc 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memmove.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memmove.c
@@ -1,5 +1,5 @@
/* Multiple versions of memmove. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
index de5caae4cb..bee44f0364 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
@@ -1,5 +1,5 @@
/* Optimized mempcpy implementation for PowerPC/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__mempcpy_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__mempcpy_power7): \
- cfi_startproc; \
- LOCALENTRY(__mempcpy_power7)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__mempcpy_power7,mask) \
- END_2(__mempcpy_power7)
+#define MEMPCPY __mempcpy_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
index 27c6e877b2..a03748e8c6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of mempcpy.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
index 3c77b5f1bd..35e2368fa6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of mempcpy.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +17,27 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
# 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/memrchr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S
index 0e41b6c9f5..afaae46dec 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized memrchr implementation for PowerPC64/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__memrchr_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__memrchr_power7): \
- cfi_startproc; \
- LOCALENTRY(__memrchr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__memrchr_power7) \
- END_2(__memrchr_power7)
+#define MEMRCHR __memrchr_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S
new file mode 100644
index 0000000000..453e2b620e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S
@@ -0,0 +1,26 @@
+/* Optimized memrchr implementation for PowerPC64/POWER8.
+ Copyright (C) 2017-2018 Free Software 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 MEMRCHR __memrchr_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#undef weak_alias
+#define weak_alias(name,alias)
+
+#include <sysdeps/powerpc/powerpc64/power8/memrchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c
index 3db538f120..e6d60c3fc3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of memrchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,5 +15,4 @@
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 <sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
index 7603343947..48be9515e4 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of memrchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,13 +23,16 @@
extern __typeof (__memrchr) __memrchr_ppc attribute_hidden;
extern __typeof (__memrchr) __memrchr_power7 attribute_hidden;
+extern __typeof (__memrchr) __memrchr_power8 attribute_hidden;
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
libc_ifunc (__memrchr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __memrchr_power7
- : __memrchr_ppc);
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __memrchr_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memrchr_power7
+ : __memrchr_ppc);
weak_alias (__memrchr, memrchr)
#else
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
index 34707382f1..78d6de9e19 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power4.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64/POWER4.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memset_power4) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memset_power4): \
- cfi_startproc; \
- LOCALENTRY(__memset_power4)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memset_power4,mask) \
- END_2(__memset_power4)
+#define MEMSET __memset_power4
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
index c11db16890..79d93c7615 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power6.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64/POWER6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memset_power6) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memset_power6): \
- cfi_startproc; \
- LOCALENTRY(__memset_power6)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memset_power6,mask) \
- END_2(__memset_power6)
+#define MEMSET __memset_power6
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
index 61191815dc..02d1855186 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power7.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memset_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memset_power7): \
- cfi_startproc; \
- LOCALENTRY(__memset_power7)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memset_power7,mask) \
- END_2(__memset_power7)
+#define MEMSET __memset_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
index ceafa7e83b..932eeefca1 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64/POWER8.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memset_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memset_power8): \
- cfi_startproc; \
- LOCALENTRY(__memset_power8)
-
-#undef END_GEN_TB
-#define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memset_power8,mask) \
- END_2(__memset_power8)
+#define MEMSET __memset_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
index 7b3aa3acd1..61f4bc5089 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
@@ -1,5 +1,5 @@
/* Default memset/bzero implementation for PowerPC64.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,21 +30,7 @@ END_GEN_TB (__bzero_ppc,TB_TOCLESS)
#if defined SHARED && IS_IN (libc)
-# undef EALIGN
-# define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__memset_ppc) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__memset_ppc): \
- cfi_startproc; \
- LOCALENTRY(__memset_ppc)
-
-# undef END_GEN_TB
-# define END_GEN_TB(name, mask) \
- cfi_endproc; \
- TRACEBACK_MASK(__memset_ppc,mask) \
- END_2(__memset_ppc)
+# define MEMSET __memset_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset.c b/sysdeps/powerpc/powerpc64/multiarch/memset.c
index 8f0489e65b..1a7c46fecf 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset.c
@@ -1,5 +1,5 @@
/* Multiple versions of memset.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
index f1515bccce..a268376729 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized rawmemchr implementation for PowerPC64/POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,21 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__rawmemchr_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__rawmemchr_power7): \
- cfi_startproc; \
- LOCALENTRY(__rawmemchr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__rawmemchr_power7) \
- END_2(__rawmemchr_power7)
+#define RAWMEMCHR __rawmemchr_power7
#include <sysdeps/powerpc/powerpc64/power7/rawmemchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c
index 066a838dc7..e5daa9225b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of rawmemchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
index f06030eeeb..02bac49b53 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of rawmemchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,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/rtld-memset.c b/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
index 5e66a21224..611eff4bf6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/rtld-memset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S b/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S
index 06e8fb5d17..9ec081aebd 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/rtld-strchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power7.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power7.c
index fb383799f5..44e9f15e9b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power7.c
@@ -1,5 +1,5 @@
/* Multiarch stpcpy for POWER7/PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S
index 8aeaa7c6ad..7718869370 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S
@@ -1,5 +1,5 @@
/* Optimized stpcpy implementation for POWER8/PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__stpcpy_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__stpcpy_power8): \
- cfi_startproc; \
- LOCALENTRY(__stpcpy_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__stpcpy_power8) \
- END_2(__stpcpy_power8)
+#define STPCPY __stpcpy_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c
index d607d8a6de..8359b7b4ca 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.c
@@ -1,5 +1,5 @@
/* Multiarch stpcpy for PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,9 +27,7 @@ extern __typeof (stpcpy) __stpcpy_ppc attribute_hidden;
#define strlen __strlen_ppc
#undef weak_alias
-#define weak_alias(name, aliasname) \
- extern __typeof (__stpcpy_ppc) aliasname \
- __attribute__ ((weak, alias ("__stpcpy_ppc")));
+#define weak_alias(name, aliasname)
#undef libc_hidden_def
#define libc_hidden_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
index bbc169180b..34c8896441 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of stpcpy. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#if defined SHARED && IS_IN (libc)
+# define __NO_STRING_INLINES
# define NO_MEMPCPY_STPCPY_REDIRECT
# include <string.h>
# include <shlib-compat.h>
@@ -26,14 +27,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-power7.S b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S
index fa1572ce01..6af2557c5d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S
@@ -1,5 +1,5 @@
/* Optimized stpncpy implementation for POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,29 +16,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#define USE_AS_STPNCPY
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__stpncpy_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__stpncpy_power7): \
- cfi_startproc; \
- LOCALENTRY(__stpncpy_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__stpncpy_power7) \
- END_2(__stpncpy_power7)
+#define STPNCPY __stpncpy_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#define MEMSET __memset_power7
+#ifdef SHARED
+#define MEMSET_is_local
+#endif
#include <sysdeps/powerpc/powerpc64/power7/stpncpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S
index 804e499023..4fea202a54 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S
@@ -1,5 +1,5 @@
/* Optimized stpncpy implementation for POWER8.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,24 +16,14 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#define STPNCPY __stpncpy_power8
-#define USE_AS_STPNCPY
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__stpncpy_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__stpncpy_power8): \
- cfi_startproc; \
- LOCALENTRY(__stpncpy_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__stpncpy_power8) \
- END_2(__stpncpy_power8)
+#define MEMSET __memset_power8
+#ifdef SHARED
+#define MEMSET_is_local
+#endif
#include <sysdeps/powerpc/powerpc64/power8/stpncpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-ppc64.c
index 593ae2324e..8f9dc08599 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-ppc64.c
@@ -1,5 +1,5 @@
/* Default stpncpy implementation for PowerPC64.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
index b1484b1e36..28e3c97b72 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of stpncpy. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,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/strcasecmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
index 013dc62867..bec2f30703 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
@@ -1,5 +1,5 @@
-/* Optimized strcasecmp implementation foOWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Optimized strcasecmp implementation for POWER7.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strcasecmp_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strcasecmp_power7): \
- cfi_startproc; \
- LOCALENTRY(__strcasecmp_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcasecmp_power7) \
- END_2(__strcasecmp_power7)
-
+#define __strcasecmp __strcasecmp_power7
#undef weak_alias
#define weak_alias(name, alias)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S
new file mode 100644
index 0000000000..29453ff80d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S
@@ -0,0 +1,26 @@
+/* Optimized strcasecmp implementation for POWER8.
+ Copyright (C) 2016-2018 Free Software 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 __strcasecmp __strcasecmp_power8
+#undef weak_alias
+#define weak_alias(name, alias)
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strcasecmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-ppc64.c
new file mode 100644
index 0000000000..b477255196
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-ppc64.c
@@ -0,0 +1,21 @@
+/* Multiarch strcasecmp for PPC64.
+ Copyright (C) 2016-2018 Free Software 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 strcasecmp __strcasecmp_ppc
+
+#include <string/strcasecmp.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
index 1f22336d49..1a6661e49c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
@@ -1,5 +1,5 @@
-/* Multiple versions of strcasecmp.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Multiple versions of strcasecmp
+ Copyright (C) 2013-2018 Free Software 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,25 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if IS_IN (libc)
-# include <string.h>
-# define strcasecmp __strcasecmp_ppc
-extern __typeof (__strcasecmp) __strcasecmp_ppc attribute_hidden;
-extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
-#endif
+#include <string.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
-#include <string/strcasecmp.c>
-#undef strcasecmp
+extern __typeof (__strcasecmp) __libc_strcasecmp;
-#if IS_IN (libc)
-# include <shlib-compat.h>
-# include "init-arch.h"
+extern __typeof (__strcasecmp) __strcasecmp_ppc attribute_hidden;
+extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
+extern __typeof (__strcasecmp) __strcasecmp_power8 attribute_hidden;
-extern __typeof (__strcasecmp) __libc_strcasecmp;
libc_ifunc (__libc_strcasecmp,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strcasecmp_power7
- : __strcasecmp_ppc);
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcasecmp_power8:
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcasecmp_power7
+ : __strcasecmp_ppc);
weak_alias (__libc_strcasecmp, strcasecmp)
-#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
index d4706e1755..07e716950a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
@@ -1,5 +1,5 @@
/* Optimized strcasecmp_l implementation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strcasecmp_l_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strcasecmp_l_power7): \
- cfi_startproc; \
- LOCALENTRY(__strcasecmp_l_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcasecmp_l_power7) \
- END_2(__strcasecmp_l_power7)
+#define __strcasecmp_l __strcasecmp_l_power7
#undef weak_alias
#define weak_alias(name, alias)
@@ -40,5 +25,7 @@
#define libc_hidden_builtin_def(name)
#define USE_IN_EXTENDED_LOCALE_MODEL
+#define __STRCMP __strcasecmp_l
+#define STRCMP strcasecmp_l
#include <sysdeps/powerpc/powerpc64/power7/strcasecmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
index d05b1c8a86..3edccc4333 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcasecmp_l.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S
new file mode 100644
index 0000000000..985f4e4e7d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S
@@ -0,0 +1,33 @@
+/* Optimized strcasestr implementation for POWER8.
+ Copyright (C) 2016-2018 Free Software 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 STRCASESTR __strcasestr_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+/* The following definitions are used in strcasestr optimization. */
+
+/* strlen is used to calculate len of r4. */
+#define STRLEN __strlen_power8
+/* strnlen is used to check if len of r3 is more than r4. */
+#define STRNLEN __strnlen_power8
+/* strchr is used to check if first char of r4 is present in r3. */
+#define STRCHR __strchr_power8
+
+#include <sysdeps/powerpc/powerpc64/power8/strcasestr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasestr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-ppc64.c
new file mode 100644
index 0000000000..0805b6f939
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-ppc64.c
@@ -0,0 +1,34 @@
+/* PowerPC64 default implementation of strcasestr.
+ Copyright (C) 2016-2018 Free Software 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 <string.h>
+
+#define STRCASESTR __strcasestr_ppc
+#if IS_IN (libc) && defined(SHARED)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ __hidden_ver1(__strcasestr_ppc, __GI_strcasestr, __strcasestr_ppc);
+#endif
+
+
+#undef weak_alias
+#define weak_alias(a,b)
+
+extern __typeof (strcasestr) __strcasestr_ppc attribute_hidden;
+
+#include <string/strcasestr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c b/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
new file mode 100644
index 0000000000..dc46bfd474
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
@@ -0,0 +1,37 @@
+/* Multiple versions of strcasestr.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__strcasestr) __strcasestr_ppc attribute_hidden;
+extern __typeof (__strcasestr) __strcasestr_power8 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__strcasestr,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcasestr_power8
+ : __strcasestr_ppc);
+
+weak_alias (__strcasestr, strcasestr)
+#else
+#include <string/strcasestr.c>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strcat-power7.c
index 58563162ed..31966827ed 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,4 +27,4 @@ extern typeof (strlen) __strlen_power7;
#define strcpy __strcpy_power7
#define strlen __strlen_power7
-#include <sysdeps/powerpc/strcat.c>
+#include <string/strcat.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c b/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c
index be17631411..996a3b6a28 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,8 +23,8 @@
#define libc_hidden_def(name)
extern typeof (strcpy) __strcpy_power8;
-extern typeof (strlen) __strlen_power7;
+extern typeof (strlen) __strlen_power8;
#define strcpy __strcpy_power8
-#define strlen __strlen_power7
-#include <sysdeps/powerpc/strcat.c>
+#define strlen __strlen_power8
+#include <string/strcat.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strcat-ppc64.c
index 3f8953eebe..fc3ef2a2bf 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,4 +26,4 @@
extern __typeof (strcat) __strcat_ppc attribute_hidden;
-#include <sysdeps/powerpc/strcat.c>
+#include <string/strcat.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat.c b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
index a2894ae027..48035ed3c0 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcat. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<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-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S
index 47f4fe734c..f91b809984 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized strchr implementation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strchr_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strchr_power7): \
- cfi_startproc; \
- LOCALENTRY(__strchr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strchr_power7) \
- END_2(__strchr_power7)
+#define STRCHR __strchr_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S
new file mode 100644
index 0000000000..16a484dbda
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S
@@ -0,0 +1,24 @@
+/* Optimized strchr implementation for POWER8.
+ Copyright (C) 2016-2018 Free Software 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 STRCHR __strchr_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S
index 8641d262cb..cdbb9c151e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of strchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#ifdef SHARED
-# undef ENTRY
-# define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strchr_ppc) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strchr_ppc): \
- cfi_startproc; \
- LOCALENTRY(__strchr_ppc)
-
-# undef END
-# define END(name) \
- cfi_endproc; \
- TRACEBACK(__strchr_ppc) \
- END_2(__strchr_ppc)
+# define STRCHR __strchr_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name) \
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr.c b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
index 2cfde632cb..6528469ee3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of strchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,18 +18,25 @@
/* 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;
+extern __typeof (strchr) __strchr_power8 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,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strchr_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strchr_power7
+ : __strchr_ppc);
weak_alias (strchr, index)
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S
index 977286da48..fee140926b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S
@@ -1,5 +1,5 @@
/* Optimized strchrnul implementation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strchrnul_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strchrnul_power7): \
- cfi_startproc; \
- LOCALENTRY(__strchrnul_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strchrnul_power7) \
- END_2(__strchrnul_power7)
+#define STRCHRNUL __strchrnul_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S
new file mode 100644
index 0000000000..e17e918d00
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S
@@ -0,0 +1,24 @@
+/* Optimized strchrnul implementation for POWER8.
+ Copyright (C) 2016-2018 Free Software 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 STRCHRNUL __strchrnul_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strchrnul.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c
index 2ec52432da..59c6bc37f7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-ppc64.c
@@ -1,5 +1,5 @@
/* PowerPC64 default implementation of strchrnul.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
index 682aa0fef7..ead31f791c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
@@ -1,5 +1,5 @@
/* Multiple versions of strchrnul.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,10 +23,13 @@
extern __typeof (__strchrnul) __strchrnul_ppc attribute_hidden;
extern __typeof (__strchrnul) __strchrnul_power7 attribute_hidden;
+extern __typeof (__strchrnul) __strchrnul_power8 attribute_hidden;
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
libc_ifunc (__strchrnul,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strchrnul_power8 :
(hwcap & PPC_FEATURE_HAS_VSX)
? __strchrnul_power7
: __strchrnul_ppc);
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S
index d44114bcd9..814d472680 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strcmp_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strcmp_power7): \
- cfi_startproc; \
- LOCALENTRY(__strcmp_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcmp_power7) \
- END_2(__strcmp_power7)
+#define STRCMP __strcmp_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S
index e35251ca25..68803ffc1b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for POWER8/PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,25 +16,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strcmp_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strcmp_power8): \
- cfi_startproc; \
- LOCALENTRY(__strcmp_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcmp_power8) \
- END_2(__strcmp_power8)
+#if IS_IN (libc)
+#define STRCMP __strcmp_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#include <sysdeps/powerpc/powerpc64/power8/strcmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S
new file mode 100644
index 0000000000..8b569d38be
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S
@@ -0,0 +1,26 @@
+/* Optimized strcmp implementation for POWER9/PPC64.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+#define STRCMP __strcmp_power9
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power9/strcmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S
index a9515112d8..43e1c6f697 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S
@@ -1,5 +1,5 @@
/* Default strcmp implementation for PowerPC64.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,28 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#if defined SHARED && IS_IN (libc)
-# undef EALIGN
-# define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strcmp_ppc) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strcmp_ppc): \
- cfi_startproc; \
- LOCALENTRY(__strcmp_ppc)
-
-# undef END
-# define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcmp_ppc) \
- END_2(__strcmp_ppc)
+# define STRCMP __strcmp_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name) \
.globl __GI_strcmp; __GI_strcmp = __strcmp_ppc
-#endif
+#endif /* SHARED && IS_IN */
#include <sysdeps/powerpc/powerpc64/strcmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
index aee888a4b7..b669053166 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcmp. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,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,16 @@
extern __typeof (strcmp) __strcmp_ppc attribute_hidden;
extern __typeof (strcmp) __strcmp_power7 attribute_hidden;
extern __typeof (strcmp) __strcmp_power8 attribute_hidden;
+extern __typeof (strcmp) __strcmp_power9 attribute_hidden;
-libc_ifunc (strcmp,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strcmp_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strcmp_power7
- : __strcmp_ppc);
+# undef strcmp
+
+libc_ifunc_redirected (__redirect_strcmp, strcmp,
+ (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+ ? __strcmp_power9 :
+ (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-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strcpy-power7.c
index f75abb95a4..0a719519a6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy-power7.c
@@ -1,5 +1,5 @@
/* Multiarch strcpy for POWER7/PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S
index 213c77a69b..5b68fc970e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S
@@ -1,5 +1,5 @@
/* Optimized strcpy implementation for POWER8/PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strcpy_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strcpy_power8): \
- cfi_startproc; \
- LOCALENTRY(__strcpy_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strcpy_power8) \
- END_2(__strcpy_power8)
+#define STRCPY __strcpy_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.c
index 1d75d2aaf2..22831974ab 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.c
@@ -1,5 +1,5 @@
/* Multiarch strcpy for PPC64.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
index d2c38589e7..b18a92a62a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcpy. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<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/strcspn-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S
new file mode 100644
index 0000000000..23bf1c1e5f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S
@@ -0,0 +1,23 @@
+/* Optimized strcspn implementation for POWER8.
+ Copyright (C) 2016-2018 Free Software 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 STRSPN __strcspn_power8
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strcspn.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c
new file mode 100644
index 0000000000..03eac0d183
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c
@@ -0,0 +1,26 @@
+/* Default strcspn implementation for PowerPC64.
+ Copyright (C) 2016-2018 Free Software 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 STRCSPN __strcspn_ppc
+
+#ifdef SHARED
+# undef libc_hidden_def
+# define libc_hidden_def(name)
+#endif
+
+#include <string/strcspn.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
new file mode 100644
index 0000000000..308aab5970
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strcspn. PowerPC64 version.
+ Copyright (C) 2016-2018 Free Software 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 <string.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
+
+#undef strcspn
+extern __typeof (strcspn) __libc_strcspn;
+
+extern __typeof (strcspn) __strcspn_ppc attribute_hidden;
+extern __typeof (strcspn) __strcspn_power8 attribute_hidden;
+
+libc_ifunc (__libc_strcspn,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcspn_power8
+ : __strcspn_ppc);
+
+weak_alias (__libc_strcspn, strcspn)
+libc_hidden_builtin_def (strcspn)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S
index ee60e434aa..5f4591ff6c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S
@@ -1,5 +1,5 @@
/* Optimized strlen implementation for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strlen_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strlen_power7): \
- cfi_startproc; \
- LOCALENTRY(__strlen_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strlen_power7) \
- END_2(__strlen_power7)
+#define STRLEN __strlen_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S
new file mode 100644
index 0000000000..fb8ffbf970
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S
@@ -0,0 +1,24 @@
+/* Optimized strlen implementation for POWER8.
+ Copyright (C) 2016-2018 Free Software 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 STRLEN __strlen_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strlen.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
index 2a4327a054..3e9e4814c9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S
@@ -1,5 +1,5 @@
/* Default strlen implementation for PowerPC64.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,23 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#if defined SHARED && IS_IN (libc)
-# undef ENTRY
-# define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strlen_ppc) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strlen_ppc): \
- cfi_startproc; \
- LOCALENTRY(__strlen_ppc)
-
-# undef END
-# define END(name) \
- cfi_endproc; \
- TRACEBACK(__strlen_ppc) \
- END_2(__strlen_ppc)
+# define STRLEN __strlen_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen.c b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
index 94501fdf2f..74810dab99 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
@@ -1,5 +1,5 @@
/* Multiple versions of strlen. PowerPC64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,11 +29,14 @@ extern __typeof (__redirect_strlen) __libc_strlen;
extern __typeof (__redirect_strlen) __strlen_ppc attribute_hidden;
extern __typeof (__redirect_strlen) __strlen_power7 attribute_hidden;
+extern __typeof (__redirect_strlen) __strlen_power8 attribute_hidden;
libc_ifunc (__libc_strlen,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strlen_power7
- : __strlen_ppc);
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strlen_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strlen_power7
+ : __strlen_ppc);
#undef strlen
strong_alias (__libc_strlen, strlen)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
index 1e147aedb2..27ca40c40a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S
new file mode 100644
index 0000000000..c0a0901a28
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S
@@ -0,0 +1,26 @@
+/* Optimized strncasecmp implementation for POWER8.
+ Copyright (C) 2016-2018 Free Software 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 __strncasecmp __strncasecmp_power8
+#undef weak_alias
+#define weak_alias(name, alias)
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strncase.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strncase-ppc64.c
new file mode 100644
index 0000000000..31ed9510c6
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase-ppc64.c
@@ -0,0 +1,21 @@
+/* Multiarch strncasecmp for PPC64.
+ Copyright (C) 2016-2018 Free Software 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 strncasecmp __strncasecmp_ppc
+
+#include <string/strncase.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase.c b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
index 2729fcea83..8cf7154c59 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncasecmp
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,26 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if IS_IN (libc)
-# include <string.h>
-# define strncasecmp __strncasecmp_ppc
-extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden;
-extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
-#endif
+#include <string.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
-#include <string/strncase.c>
-#undef strncasecmp
+extern __typeof (__strncasecmp) __libc_strncasecmp;
-#if IS_IN (libc)
-# include <shlib-compat.h>
-# include "init-arch.h"
+extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden;
+extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
+extern __typeof (__strncasecmp) __strncasecmp_power8 attribute_hidden;
-/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
- ifunc symbol properly. */
-extern __typeof (__strncasecmp) __libc_strncasecmp;
libc_ifunc (__libc_strncasecmp,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strncasecmp_power8:
(hwcap & PPC_FEATURE_HAS_VSX)
? __strncasecmp_power7
: __strncasecmp_ppc);
+
weak_alias (__libc_strncasecmp, strncasecmp)
-#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
index 21fba18836..ae2c4a3554 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,8 +18,10 @@
#include <string.h>
#define __strncasecmp_l __strncasecmp_l_power7
-#define USE_IN_EXTENDED_LOCALE_MODEL 1
+
+#undef libc_hidden_def
+#define libc_hidden_def(name)
extern __typeof (strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
-#include <string/strncase.c>
+#include <string/strncase_l.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
index 33a1d8b639..d3c4bf18c1 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncasecmp_l
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c
index bbc31e1abb..a393c2ed60 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c b/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c
new file mode 100644
index 0000000000..7842a507a0
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 2017-2018 Free Software 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 <string.h>
+
+#define STRNCAT __strncat_power8
+
+extern __typeof (strncat) __strncat_power8 attribute_hidden;
+extern __typeof (strlen) __strlen_power8 attribute_hidden;
+extern __typeof (strnlen) __strnlen_power8 attribute_hidden;
+extern __typeof (memcpy) __memcpy_power7 attribute_hidden;
+
+#define strlen __strlen_power8
+#define __strnlen __strnlen_power8
+#define memcpy __memcpy_power7
+
+#include <string/strncat.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c
index 5b364c8341..dd0f166514 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat.c b/sysdeps/powerpc/powerpc64/multiarch/strncat.c
index 0f6f29cccc..a2e5038e53 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncat. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,9 +23,12 @@
extern __typeof (strncat) __strncat_ppc attribute_hidden;
extern __typeof (strncat) __strncat_power7 attribute_hidden;
+extern __typeof (strncat) __strncat_power8 attribute_hidden;
libc_ifunc (strncat,
- (hwcap & PPC_FEATURE_HAS_VSX)
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strncat_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
? __strncat_power7
: __strncat_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
index d1aebbbc93..860f2ec18a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software 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,23 +15,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name,alignt,words) \
- .section ".text"; \
- ENTRY_2(__strncmp_power4) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncmp_power4): \
- cfi_startproc; \
- LOCALENTRY(__strncmp_power4)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncmp_power4) \
- END_2(__strncmp_power4)
+#define STRNCMP __strncmp_power4
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
index 3edc4fce62..8d4108e1ba 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software 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,24 +15,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name,alignt,words) \
- .section ".text"; \
- ENTRY_2(__strncmp_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncmp_power7): \
- cfi_startproc; \
- LOCALENTRY(__strncmp_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncmp_power7) \
- END_2(__strncmp_power7)
-
+#define STRNCMP __strncmp_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S
index 771986ec77..e8a5fb804f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software 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,26 +15,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name,alignt,words) \
- .section ".text"; \
- ENTRY_2(__strncmp_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncmp_power8): \
- cfi_startproc; \
- LOCALENTRY(__strncmp_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncmp_power8) \
- END_2(__strncmp_power8)
-
+#if IS_IN (libc)
+#define STRNCMP __strncmp_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#include <sysdeps/powerpc/powerpc64/power8/strncmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S
new file mode 100644
index 0000000000..3356f72527
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S
@@ -0,0 +1,25 @@
+/* Copyright (C) 2016-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+#define STRNCMP __strncmp_power9
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power9/strncmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
index 30b139aa78..1b5704a079 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software 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,24 +15,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
#if defined SHARED && IS_IN (libc)
-#undef EALIGN
-#define EALIGN(name,alignt,words) \
- .section ".text"; \
- ENTRY_2(__strncmp_ppc) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncmp_ppc): \
- cfi_startproc; \
- LOCALENTRY(__strncmp_ppc)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncmp_ppc) \
- END_2(__strncmp_ppc)
+# define STRNCMP __strncmp_ppc
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name) \
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
index 1eb6e517af..c4a40d1ec7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncmp.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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,19 @@ 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;
+extern __typeof (strncmp) __strncmp_power9 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_3_00)
+ ? __strncmp_power9 :
+ (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-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S
index 14efab3604..a044c11327 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S
@@ -1,5 +1,5 @@
/* Optimized strncpy implementation for POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,27 +16,14 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strncpy_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncpy_power7): \
- cfi_startproc; \
- LOCALENTRY(__strncpy_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncpy_power7) \
- END_2(__strncpy_power7)
+#define STRNCPY __strncpy_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
#define MEMSET __memset_power7
+#ifdef SHARED
+#define MEMSET_is_local
+#endif
#include <sysdeps/powerpc/powerpc64/power7/strncpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S
index 3263bbd70a..10b8453f58 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S
@@ -1,5 +1,5 @@
/* Optimized strncpy implementation for POWER8.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,25 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strncpy_power8) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strncpy_power8): \
- cfi_startproc; \
- LOCALENTRY(__strncpy_power8)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strncpy_power8) \
- END_2(__strncpy_power8)
+#define STRNCPY __strncpy_power8
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
+/* memset is used to pad the end of the string. */
+#define MEMSET __memset_power8
+#ifdef SHARED
+#define MEMSET_is_local
+#endif
+
#include <sysdeps/powerpc/powerpc64/power8/strncpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c
index 6f5907eb9f..7efbe10905 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
index 0176514c1e..41e5ea8446 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncpy.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S
index ae4e6c05bb..565937b534 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S
@@ -1,5 +1,5 @@
/* Optimized strnlen version for POWER7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strnlen_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strnlen_power7): \
- cfi_startproc; \
- LOCALENTRY(__strnlen_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strnlen_power7) \
- END_2(__strnlen_power7)
+#define STRNLEN __strnlen_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S
new file mode 100644
index 0000000000..ed5b67e607
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S
@@ -0,0 +1,26 @@
+/* Optimized strnlen version for POWER8.
+ Copyright (C) 2017-2018 Free Software 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 __strnlen __strnlen_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#undef weak_alias
+#define weak_alias(name, alias)
+
+#include <sysdeps/powerpc/powerpc64/power8/strnlen.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c
index de17a38f83..ce710e218d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
index c4907e9ec8..298bfa0dc1 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
@@ -1,5 +1,5 @@
/* Multiple versions of strnlen.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,19 +17,24 @@
<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);
+extern __typeof (__strnlen) __strnlen_power8 attribute_hidden;
+# undef strnlen
+# undef __strnlen
+libc_ifunc_redirected (__redirect___strnlen, __strnlen,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strnlen_power8 :
+ (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-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S
index 464e74a5e8..949803031e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S
@@ -1,5 +1,5 @@
/* Optimized strrchr implementation for POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,22 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef ENTRY
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(__strrchr_power7) \
- .align ALIGNARG(2); \
- BODY_LABEL(__strrchr_power7): \
- cfi_startproc; \
- LOCALENTRY(__strrchr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strrchr_power7) \
- END_2(__strrchr_power7)
+#define STRRCHR __strrchr_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S
new file mode 100644
index 0000000000..342d02a38c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S
@@ -0,0 +1,24 @@
+/* Optimized strrchr implementation for POWER8.
+ Copyright (C) 2017-2018 Free Software 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 STRRCHR __strrchr_power8
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strrchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c
index 151bd35ea6..bcf049a2ed 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,10 +18,10 @@
#include <string.h>
#define STRRCHR __strrchr_ppc
+
#undef weak_alias
-#define weak_alias(name, aliasname) \
- extern __typeof (__strrchr_ppc) aliasname \
- __attribute__ ((weak, alias ("__strrchr_ppc")));
+#define weak_alias(name, aliasname)
+
#if IS_IN (libc) && defined(SHARED)
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name) \
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
index 45742bc910..d46f7c0403 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of strrchr. PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,18 +18,23 @@
/* 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;
+extern __typeof (strrchr) __strrchr_power8 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,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strrchr_power8 :
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strrchr_power7
+ : __strrchr_ppc);
weak_alias (strrchr, rindex)
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S
new file mode 100644
index 0000000000..bc9f493cf7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S
@@ -0,0 +1,23 @@
+/* Optimized strspn implementation for POWER8.
+ Copyright (C) 2016-2018 Free Software 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 STRSPN __strspn_power8
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power8/strspn.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
new file mode 100644
index 0000000000..05a240b252
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
@@ -0,0 +1,25 @@
+/* Default strspn implementation for PowerPC64.
+ Copyright (C) 2016-2018 Free Software 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 STRSPN __strspn_ppc
+#ifdef SHARED
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+#endif
+
+#include <string/strspn.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn.c b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
new file mode 100644
index 0000000000..61251610e7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strspn. PowerPC64 version.
+ Copyright (C) 2016-2018 Free Software 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 <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+#undef strspn
+extern __typeof (strspn) __libc_strspn;
+
+extern __typeof (strspn) __strspn_ppc attribute_hidden;
+extern __typeof (strspn) __strspn_power8 attribute_hidden;
+
+libc_ifunc (__libc_strspn,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strspn_power8
+ : __strspn_ppc);
+
+weak_alias (__libc_strspn, strspn)
+libc_hidden_builtin_def (strspn)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S
index 68b93b07e7..a24ab585f4 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S
@@ -1,5 +1,5 @@
/* Optimized strstr implementation for POWER7.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,23 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-
-#undef EALIGN
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(__strstr_power7) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- BODY_LABEL(__strstr_power7): \
- cfi_startproc; \
- LOCALENTRY(__strstr_power7)
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(__strstr_power7) \
- END_2(__strstr_power7)
+#define STRSTR __strstr_power7
#undef libc_hidden_builtin_def
#define libc_hidden_builtin_def(name)
@@ -40,5 +24,10 @@
#define STRLEN __strlen_power7
#define STRNLEN __strnlen_power7
#define STRCHR __strchr_power7
+#ifdef SHARED
+#define STRLEN_is_local
+#define STRNLEN_is_local
+#define STRCHR_is_local
+#endif
#include <sysdeps/powerpc/powerpc64/power7/strstr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c
index 2ca62c4b74..971bb18f7a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr.c b/sysdeps/powerpc/powerpc64/multiarch/strstr.c
index 7efc4b0913..264b5d88d5 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strstr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strstr.c
@@ -1,5 +1,5 @@
/* Multiple versions of strstr. PowerPC64 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c
index b78fdd3533..52f562b613 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c
@@ -1,5 +1,5 @@
/* wcschr.c - Wide Character Search for powerpc64/power6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
index 3374ba26ef..0acad04706 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
@@ -1,5 +1,5 @@
/* wcschr.c - Wide Character Search for powerpc64/power7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c
index 5192fe8704..f72865241b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
index 44c9b971ce..9976a63afa 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcschr
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,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/multiarch/wcscpy-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c
index cc655942c2..ef0f7ccdc7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c
@@ -1,5 +1,5 @@
/* wcscpy.c - Wide Character Search for powerpc64/power6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
index 7aec88dc94..2712f58156 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
@@ -1,5 +1,5 @@
/* wcscpy.c - Wide Character Search for powerpc64/power7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c
index f48a65f0ef..4bcf792544 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
index 5c919f56ff..76fc3569b8 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcscpy.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c
index 184dc941d7..05414b00e3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c
@@ -1,5 +1,5 @@
/* wcsrchr.c - Wide Character Search for powerpc64/power6.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
index 927d5c8cc3..35a56386d2 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
@@ -1,5 +1,5 @@
/* wcsrchr.c - Wide Character Search for powerpc64/power7.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c
index bb796726dd..708575042b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
index dc4b796723..06e4b61d11 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcsrchr.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
index 7a0694be39..486003f0c9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/power4/Implies b/sysdeps/powerpc/powerpc64/power4/Implies
deleted file mode 100644
index a372141bb7..0000000000
--- a/sysdeps/powerpc/powerpc64/power4/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/power4/fpu
-powerpc/power4
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index c1a77c64b0..e5319f101f 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1,5 +1,5 @@
/* Optimized memcmp implementation for PowerPC64.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,8 +22,12 @@
const char *s2 [r4],
size_t size [r5]) */
+#ifndef MEMCMP
+# define MEMCMP memcmp
+#endif
+
.machine power4
-EALIGN (memcmp, 4, 0)
+ENTRY_TOCLESS (MEMCMP, 4)
CALL_MCOUNT 3
#define rRTN r3
@@ -52,8 +56,8 @@ EALIGN (memcmp, 4, 0)
byte loop. */
blt cr1, L(bytealigned)
std rWORD8, -8(r1)
- cfi_offset(rWORD8, -8)
std rWORD7, -16(r1)
+ cfi_offset(rWORD8, -8)
cfi_offset(rWORD7, -16)
bne L(unaligned)
/* At this point we know both strings have the same alignment and the
@@ -728,18 +732,18 @@ L(unaligned):
the actual start of rSTR2. */
clrrdi rSTR2, rSTR2, 3
std rWORD2_SHIFT, -48(r1)
- cfi_offset(rWORD2_SHIFT, -48)
/* Compute the left/right shift counts for the unaligned rSTR2,
compensating for the logical (DW aligned) start of rSTR1. */
clrldi rSHL, rWORD8_SHIFT, 61
clrrdi rSTR1, rSTR1, 3
std rWORD4_SHIFT, -56(r1)
- cfi_offset(rWORD4_SHIFT, -56)
sldi rSHL, rSHL, 3
cmpld cr5, rWORD8_SHIFT, rSTR2
add rN, rN, r12
sldi rWORD6, r12, 3
std rWORD6_SHIFT, -64(r1)
+ cfi_offset(rWORD2_SHIFT, -48)
+ cfi_offset(rWORD4_SHIFT, -56)
cfi_offset(rWORD6_SHIFT, -64)
subfic rSHR, rSHL, 64
srdi r0, rN, 5 /* Divide by 32 */
@@ -833,15 +837,15 @@ L(duPs4):
.align 4
L(DWunaligned):
std rWORD8_SHIFT, -40(r1)
- cfi_offset(rWORD8_SHIFT, -40)
clrrdi rSTR2, rSTR2, 3
std rWORD2_SHIFT, -48(r1)
- cfi_offset(rWORD2_SHIFT, -48)
srdi r0, rN, 5 /* Divide by 32 */
std rWORD4_SHIFT, -56(r1)
- cfi_offset(rWORD4_SHIFT, -56)
andi. r12, rN, 24 /* Get the DW remainder */
std rWORD6_SHIFT, -64(r1)
+ cfi_offset(rWORD8_SHIFT, -40)
+ cfi_offset(rWORD2_SHIFT, -48)
+ cfi_offset(rWORD4_SHIFT, -56)
cfi_offset(rWORD6_SHIFT, -64)
sldi rSHL, rSHL, 3
#ifdef __LITTLE_ENDIAN__
@@ -1360,6 +1364,6 @@ L(duzeroLength):
li rRTN, 0
blr
-END (memcmp)
+END (MEMCMP)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp, bcmp)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcpy.S b/sysdeps/powerpc/powerpc64/power4/memcpy.S
index 844f08f627..ce074943f2 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC64.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]);
Returns 'dst'.
Memcpy handles short copies (< 32-bytes) using a binary move blocks
@@ -33,8 +33,11 @@
possible when both source and destination are doubleword aligned.
Each case has a optimized unrolled loop. */
+#ifndef MEMCPY
+# define MEMCPY memcpy
+#endif
.machine power4
-EALIGN (memcpy, 5, 0)
+ENTRY_TOCLESS (MEMCPY, 5)
CALL_MCOUNT 3
cmpldi cr1,5,31
@@ -470,5 +473,5 @@ EALIGN (memcpy, 5, 0)
ld 31,-8(1)
ld 3,-16(1)
blr
-END_GEN_TB (memcpy,TB_TOCLESS)
+END_GEN_TB (MEMCPY,TB_TOCLESS)
libc_hidden_builtin_def (memcpy)
diff --git a/sysdeps/powerpc/powerpc64/power4/memset.S b/sysdeps/powerpc/powerpc64/power4/memset.S
index bc249c31ab..a8f0dfaa1a 100644
--- a/sysdeps/powerpc/powerpc64/power4/memset.S
+++ b/sysdeps/powerpc/powerpc64/power4/memset.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,15 +18,18 @@
#include <sysdep.h>
-/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
+/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5]));
Returns 's'.
The memset is done in three sizes: byte (8 bits), word (32 bits),
cache line (256 bits). There is a special case for setting cache lines
to 0, to take advantage of the dcbz instruction. */
+#ifndef MEMSET
+# define MEMSET memset
+#endif
.machine power4
-EALIGN (memset, 5, 0)
+ENTRY_TOCLESS (MEMSET, 5)
CALL_MCOUNT 3
#define rTMP r0
@@ -232,12 +235,12 @@ L(medium_27f):
L(medium_28t):
std rCHR, -8(rMEMP)
blr
-END_GEN_TB (memset,TB_TOCLESS)
+END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
-ENTRY (__bzero)
+ENTRY_TOCLESS (__bzero)
CALL_MCOUNT 3
mr r5,r4
li r4,0
diff --git a/sysdeps/powerpc/powerpc64/power4/strncmp.S b/sysdeps/powerpc/powerpc64/power4/strncmp.S
index e45ee6dce2..73629e4191 100644
--- a/sysdeps/powerpc/powerpc64/power4/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC64.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,11 +18,15 @@
#include <sysdep.h>
+#ifndef STRNCMP
+# define STRNCMP strncmp
+#endif
+
/* See strlen.s for comments on how the end-of-string testing works. */
/* int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */
-EALIGN (strncmp, 4, 0)
+ENTRY_TOCLESS (STRNCMP, 4)
CALL_MCOUNT 3
#define rTMP2 r0
@@ -217,5 +221,5 @@ L(u4): sub rRTN, rWORD1, rWORD2
L(ux):
li rRTN, 0
blr
-END (strncmp)
+END (STRNCMP)
libc_hidden_builtin_def (strncmp)
diff --git a/sysdeps/powerpc/powerpc64/power5+/Implies b/sysdeps/powerpc/powerpc64/power5+/Implies
deleted file mode 100644
index 565bc94471..0000000000
--- a/sysdeps/powerpc/powerpc64/power5+/Implies
+++ /dev/null
@@ -1,4 +0,0 @@
-powerpc/power5+/fpu
-powerpc/power5+
-powerpc/powerpc64/power5/fpu
-powerpc/powerpc64/power5
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/Implies b/sysdeps/powerpc/powerpc64/power5+/fpu/Implies
deleted file mode 100644
index f00c50fb49..0000000000
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power5/fpu
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/power5+/fpu/multiarch/Implies
deleted file mode 100644
index c0e67848e2..0000000000
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power5/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S
index a12fa29ab2..e500932573 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S
@@ -1,5 +1,5 @@
/* ceil function. PowerPC64/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,20 +18,13 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.machine "power5"
-EALIGN (__ceil, 4, 0)
+ENTRY_TOCLESS (__ceil, 4)
CALL_MCOUNT 0
frip fp1, fp1
blr
END (__ceil)
-weak_alias (__ceil, ceil)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__ceil, ceill)
-strong_alias (__ceil, __ceill)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
index b1664c8352..d0b2118c2a 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S
@@ -1,5 +1,5 @@
/* ceilf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software 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,14 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.machine "power5"
-EALIGN (__ceilf, 4, 0)
+ENTRY_TOCLESS (__ceilf, 4)
CALL_MCOUNT 0
frip fp1, fp1 /* The rounding instructions are double. */
frsp fp1, fp1 /* But we need to set ooverflow for float. */
blr
END (__ceilf)
-weak_alias (__ceilf, ceilf)
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
index c1fec4c9f2..9b9eb1529d 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
@@ -1,5 +1,5 @@
/* floor function. PowerPC64/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,20 +18,13 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.machine "power5"
-EALIGN (__floor, 4, 0)
+ENTRY_TOCLESS (__floor, 4)
CALL_MCOUNT 0
frim fp1, fp1
blr
END (__floor)
-weak_alias (__floor, floor)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__floor, floorl)
-strong_alias (__floor, __floorl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
index 4108cfa06d..790edbd9a4 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S
@@ -1,5 +1,5 @@
/* floorf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software 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,14 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.machine "power5"
-EALIGN (__floorf, 4, 0)
+ENTRY_TOCLESS (__floorf, 4)
CALL_MCOUNT 0
frim fp1, fp1 /* The rounding instructions are double. */
frsp fp1, fp1 /* But we need to set ooverflow for float. */
blr
END (__floorf)
-weak_alias (__floorf, floorf)
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S
index 3388c35e6c..9fc4ec4a04 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S
@@ -1,5 +1,5 @@
/* llround function. POWER5+, PowerPC64 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
/* long long [r3] llround (float x [fp1])
IEEE 1003.1 llround function. IEEE specifies "round to the nearest
@@ -30,7 +32,7 @@
round to zero instruction. */
.machine "power5"
-EALIGN (__llround, 4, 0)
+ENTRY_TOCLESS (__llround, 4)
CALL_MCOUNT 0
frin fp2, fp1 /* Round to nearest +-0.5. */
fctidz fp3, fp2 /* Convert To Integer DW round toward 0. */
@@ -43,16 +45,12 @@ EALIGN (__llround, 4, 0)
END (__llround)
strong_alias (__llround, __lround)
-weak_alias (__llround, llround)
-weak_alias (__lround, lround)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+libm_alias_double (__llround, llround)
+libm_alias_double (__lround, lround)
+/* The double version also works for single-precision as both float and
+ double parameters are passed in 64bit FPRs and both versions are expected
+ to return [long] long type. */
+strong_alias (__llround, __llroundf)
+libm_alias_float (__llround, llround)
+strong_alias (__lround, __lroundf)
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_llroundf.S
new file mode 100644
index 0000000000..9ea6bd105b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_llroundf.S
@@ -0,0 +1 @@
+/* __lroundf is in s_llround.S. */
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
index a73311bbff..ed4df257d3 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
@@ -1,5 +1,5 @@
/* round function. PowerPC64/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,20 +18,13 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.machine "power5"
-EALIGN (__round, 4, 0)
+ENTRY_TOCLESS (__round, 4)
CALL_MCOUNT 0
frin fp1, fp1
blr
END (__round)
-weak_alias (__round, round)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__round, roundl)
-strong_alias (__round, __roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1)
-#endif
+libm_alias_double (__round, round)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
index 7df18ecb6b..32df46059a 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
@@ -1,5 +1,5 @@
/* roundf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software 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,14 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.machine "power5"
-EALIGN (__roundf, 4, 0)
+ENTRY_TOCLESS (__roundf, 4)
CALL_MCOUNT 0
frin fp1, fp1 /* The rounding instructions are double. */
frsp fp1, fp1 /* But we need to set ooverflow for float. */
blr
END (__roundf)
-weak_alias (__roundf, roundf)
+libm_alias_float (__round, round)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
index b8971801dd..a45766582a 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
@@ -1,5 +1,5 @@
/* trunc function. PowerPC64/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,20 +18,13 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
.machine "power5"
-EALIGN (__trunc, 4, 0)
+ENTRY_TOCLESS (__trunc, 4)
CALL_MCOUNT 0
friz fp1, fp1
blr
END (__trunc)
-weak_alias (__trunc, trunc)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__trunc, truncl)
-strong_alias (__trunc, __truncl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
index 6e18ae1ae8..f06f54f163 100644
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
+++ b/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
@@ -1,5 +1,5 @@
/* truncf function. PowerPC64/power5+ version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software 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,14 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.machine "power5"
-EALIGN (__truncf, 4, 0)
+ENTRY_TOCLESS (__truncf, 4)
CALL_MCOUNT 0
friz fp1, fp1 /* The rounding instructions are double. */
frsp fp1, fp1 /* But we need to set ooverflow for float. */
blr
END (__truncf)
-weak_alias (__truncf, truncf)
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc64/power5+/multiarch/Implies b/sysdeps/powerpc/powerpc64/power5+/multiarch/Implies
deleted file mode 100644
index 0851b19fa2..0000000000
--- a/sysdeps/powerpc/powerpc64/power5+/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power5/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power5/Implies b/sysdeps/powerpc/powerpc64/power5/Implies
deleted file mode 100644
index bedb20b65c..0000000000
--- a/sysdeps/powerpc/powerpc64/power5/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/power4/fpu
-powerpc/powerpc64/power4
diff --git a/sysdeps/powerpc/powerpc64/power5/fpu/Implies b/sysdeps/powerpc/powerpc64/power5/fpu/Implies
deleted file mode 100644
index 6b8c23efa6..0000000000
--- a/sysdeps/powerpc/powerpc64/power5/fpu/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power4/fpu/
diff --git a/sysdeps/powerpc/powerpc64/power5/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/power5/fpu/multiarch/Implies
deleted file mode 100644
index 3740d050a6..0000000000
--- a/sysdeps/powerpc/powerpc64/power5/fpu/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power4/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
index 57b5613d41..83b5657b75 100644
--- a/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power5/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64 version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
/* int __isnan(x) */
.machine power5
-EALIGN (__isnan, 4, 0)
+ENTRY_TOCLESS (__isnan, 4)
CALL_MCOUNT 0
stfd fp1,-8(r1) /* copy FPR to GPR */
lis r0,0x7ff0
diff --git a/sysdeps/powerpc/powerpc64/power5/multiarch/Implies b/sysdeps/powerpc/powerpc64/power5/multiarch/Implies
deleted file mode 100644
index 9a3cbb0938..0000000000
--- a/sysdeps/powerpc/powerpc64/power5/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power4/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power6/Implies b/sysdeps/powerpc/powerpc64/power6/Implies
deleted file mode 100644
index 4c782d4122..0000000000
--- a/sysdeps/powerpc/powerpc64/power6/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/power5+/fpu
-powerpc/powerpc64/power5+
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/Implies b/sysdeps/powerpc/powerpc64/power6/fpu/Implies
deleted file mode 100644
index f09854edb6..0000000000
--- a/sysdeps/powerpc/powerpc64/power6/fpu/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power5+/fpu
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/power6/fpu/multiarch/Implies
deleted file mode 100644
index fca8a4ef0f..0000000000
--- a/sysdeps/powerpc/powerpc64/power6/fpu/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power5+/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
index 01346f473b..03e8bedb67 100644
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
@@ -1,5 +1,5 @@
/* copysign(). PowerPC64/POWER6 version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -19,6 +19,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
/* double [f1] copysign (double [f1] x, double [f2] y);
copysign(x,y) returns a value with the magnitude of x and
@@ -27,32 +29,21 @@
.section ".text"
.type __copysign, @function
.machine power6
-EALIGN (__copysign, 4, 0)
+ENTRY_TOCLESS (__copysign, 4)
CALL_MCOUNT 0
fcpsgn fp1,fp2,fp1
blr
END (__copysign)
hidden_def (__copysign)
-weak_alias (__copysign, copysign)
+libm_alias_double (__copysign, copysign)
/* It turns out that the 'double' version will also always work for
single-precision. */
strong_alias (__copysign, __copysignf)
hidden_def (__copysignf)
-weak_alias (__copysignf, copysignf)
+libm_alias_float (__copysign, copysign)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__copysign, __copysignl)
-weak_alias (__copysign, copysignl)
-#endif
-
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
-compat_symbol (libm, copysign, copysignl, GLIBC_2_0)
-# endif
-#else
-# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, copysign, copysignl, GLIBC_2_0);
-# endif
#endif
diff --git a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
index 35f34c89b8..6296c944b5 100644
--- a/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power6/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64 version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
/* int __isnan(x) */
.machine power6
-EALIGN (__isnan, 4, 0)
+ENTRY_TOCLESS (__isnan, 4)
CALL_MCOUNT 0
stfd fp1,-8(r1) /* copy FPR to GPR */
ori r1,r1,0
diff --git a/sysdeps/powerpc/powerpc64/power6/memcpy.S b/sysdeps/powerpc/powerpc64/power6/memcpy.S
index 9711810caf..9356867568 100644
--- a/sysdeps/powerpc/powerpc64/power6/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/power6/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC64.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <sysdep.h>
-/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]);
Returns 'dst'.
Memcpy handles short copies (< 32-bytes) using a binary move blocks
@@ -40,8 +40,11 @@
the source but may take a risk and only require word alignment
for the destination. */
+#ifndef MEMCPY
+# define MEMCPY memcpy
+#endif
.machine "power6"
-EALIGN (memcpy, 7, 0)
+ENTRY_TOCLESS (MEMCPY, 7)
CALL_MCOUNT 3
cmpldi cr1,5,31
@@ -1492,5 +1495,5 @@ L(du_done):
ld 31,-8(1)
ld 3,-16(1)
blr
-END_GEN_TB (memcpy,TB_TOCLESS)
+END_GEN_TB (MEMCPY,TB_TOCLESS)
libc_hidden_builtin_def (memcpy)
diff --git a/sysdeps/powerpc/powerpc64/power6/memset.S b/sysdeps/powerpc/powerpc64/power6/memset.S
index c2d1c4e600..3901e33da2 100644
--- a/sysdeps/powerpc/powerpc64/power6/memset.S
+++ b/sysdeps/powerpc/powerpc64/power6/memset.S
@@ -1,5 +1,5 @@
/* Optimized 64-bit memset implementation for POWER6.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,15 +18,18 @@
#include <sysdep.h>
-/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
+/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5]));
Returns 's'.
The memset is done in three sizes: byte (8 bits), word (32 bits),
cache line (256 bits). There is a special case for setting cache lines
to 0, to take advantage of the dcbz instruction. */
+#ifndef MEMSET
+# define MEMSET memset
+#endif
.machine power6
-EALIGN (memset, 7, 0)
+ENTRY_TOCLESS (MEMSET, 7)
CALL_MCOUNT 3
#define rTMP r0
@@ -251,7 +254,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
@@ -376,12 +379,12 @@ L(medium_27f):
L(medium_28t):
std rCHR, -8(rMEMP)
blr
-END_GEN_TB (memset,TB_TOCLESS)
+END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
-ENTRY (__bzero)
+ENTRY_TOCLESS (__bzero)
CALL_MCOUNT 3
mr r5,r4
li r4,0
diff --git a/sysdeps/powerpc/powerpc64/power6/multiarch/Implies b/sysdeps/powerpc/powerpc64/power6/multiarch/Implies
deleted file mode 100644
index 2ebe304fa6..0000000000
--- a/sysdeps/powerpc/powerpc64/power6/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power5+/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power6x/Implies b/sysdeps/powerpc/powerpc64/power6x/Implies
deleted file mode 100644
index 9d68f39d22..0000000000
--- a/sysdeps/powerpc/powerpc64/power6x/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/power6/fpu
-powerpc/powerpc64/power6
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/Implies b/sysdeps/powerpc/powerpc64/power6x/fpu/Implies
deleted file mode 100644
index 30fa17646e..0000000000
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power6/fpu
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/power6x/fpu/multiarch/Implies
deleted file mode 100644
index 410d289a6d..0000000000
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power6/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
index 1f3ee64331..96d0695ed2 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power6x/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64 version.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
/* int __isnan(x) */
.machine power6
-EALIGN (__isnan, 4, 0)
+ENTRY_TOCLESS (__isnan, 4)
CALL_MCOUNT 0
mftgpr r4,fp1 /* copy FPR to GPR */
lis r0,0x7ff0
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
index 0aae09140e..36980be13f 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S
@@ -1,5 +1,5 @@
/* Round double to long int. POWER6x PowerPC64 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,10 +18,12 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
.machine "power6"
/* long long int[r3] __llrint (double x[fp1]) */
-ENTRY (__llrint)
+ENTRY_TOCLESS (__llrint)
CALL_MCOUNT 0
fctid fp13,fp1
mftgpr r3,fp13
@@ -29,16 +31,12 @@ ENTRY (__llrint)
END (__llrint)
strong_alias (__llrint, __lrint)
-weak_alias (__llrint, llrint)
-weak_alias (__lrint, lrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
+libm_alias_double (__llrint, llrint)
+libm_alias_double (__lrint, lrint)
+/* The double version also works for single-precision as both float and
+ double parameters are passed in 64bit FPRs and both versions are expected
+ to return [long] long type. */
+strong_alias (__llrint, __llrintf)
+libm_alias_float (__llrint, llrint)
+strong_alias (__lrint, __lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S
index 39480c15a8..605f55ed5f 100644
--- a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S
@@ -1,5 +1,5 @@
/* llround function. POWER6x PowerPC64 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
/* long long [r3] llround (float x [fp1])
IEEE 1003.1 llround function. IEEE specifies "round to the nearest
@@ -30,7 +32,7 @@
round to zero instruction. */
.machine "power6"
-ENTRY (__llround)
+ENTRY_TOCLESS (__llround)
CALL_MCOUNT 0
frin fp2,fp1 /* Round to nearest +-0.5. */
fctidz fp3,fp2 /* Convert To Integer DW round toward 0. */
@@ -39,16 +41,12 @@ ENTRY (__llround)
END (__llround)
strong_alias (__llround, __lround)
-weak_alias (__llround, llround)
-weak_alias (__lround, lround)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+libm_alias_double (__llround, llround)
+libm_alias_double (__lround, lround)
+/* The double version also works for single-precision as both float and
+ double parameters are passed in 64bit FPRs and both versions are expected
+ to return [long] long type. */
+strong_alias (__llround, __llroundf)
+libm_alias_float (__llround, llround)
+strong_alias (__lround, __lroundf)
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc64/power6x/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llroundf.S
new file mode 100644
index 0000000000..9ea6bd105b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power6x/fpu/s_llroundf.S
@@ -0,0 +1 @@
+/* __lroundf is in s_llround.S. */
diff --git a/sysdeps/powerpc/powerpc64/power6x/multiarch/Implies b/sysdeps/powerpc/powerpc64/power6x/multiarch/Implies
deleted file mode 100644
index bf5d6171a5..0000000000
--- a/sysdeps/powerpc/powerpc64/power6x/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power6/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power7/Implies b/sysdeps/powerpc/powerpc64/power7/Implies
deleted file mode 100644
index 9d68f39d22..0000000000
--- a/sysdeps/powerpc/powerpc64/power7/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/power6/fpu
-powerpc/powerpc64/power6
diff --git a/sysdeps/powerpc/powerpc64/power7/add_n.S b/sysdeps/powerpc/powerpc64/power7/add_n.S
index 2397d3abca..1306e5aa2f 100644
--- a/sysdeps/powerpc/powerpc64/power7/add_n.S
+++ b/sysdeps/powerpc/powerpc64/power7/add_n.S
@@ -1,6 +1,6 @@
/* PowerPC64 mpn_lshift -- mpn_add_n/mpn_sub_n -- mpn addition and
subtraction.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,19 +36,19 @@
#define VP r5
#define N r6
-EALIGN(FUNC, 5, 0)
+ENTRY_TOCLESS (FUNC, 5)
#ifdef USE_AS_SUB
- addic r0, r0, 0
+ addic r0, r1, -1
#else
- addic r0, r1, -1
+ addic r0, r0, 0
#endif
andi. r7, N, 1
beq L(bx0)
ld r7, 0(UP)
- ld r9, r0(VP)
+ ld r9, 0(VP)
ADDSUBC r11, r9, r7
- std r11, r0(RP)
+ std r11, 0(RP)
cmpldi N, N, 1
beq N, L(end)
addi UP, UP, 8
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/Implies b/sysdeps/powerpc/powerpc64/power7/fpu/Implies
deleted file mode 100644
index 30fa17646e..0000000000
--- a/sysdeps/powerpc/powerpc64/power7/fpu/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power6/fpu
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/power7/fpu/multiarch/Implies
deleted file mode 100644
index 410d289a6d..0000000000
--- a/sysdeps/powerpc/powerpc64/power7/fpu/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power6/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
index 5366fd6d0b..78e3bdef80 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
@@ -1,5 +1,5 @@
/* finite(). PowerPC64/POWER7 version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -27,7 +27,7 @@
.section ".text"
.type __finite, @function
.machine power7
-EALIGN (__finite, 4, 0)
+ENTRY (__finite, 4)
CALL_MCOUNT 0
lfd fp0,.LC0@toc(r2)
ftdiv cr7,fp1,fp0
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
index 89dfad1235..0fbb99d64d 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
@@ -1,5 +1,5 @@
/* isinf(). PowerPC64/POWER7 version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -27,7 +27,7 @@
.section ".text"
.type __isinf, @function
.machine power7
-EALIGN (__isinf, 4, 0)
+ENTRY (__isinf, 4)
CALL_MCOUNT 0
lfd fp0,.LC0@toc(r2)
ftdiv cr7,fp1,fp0
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
index bb65c3a153..3f675d7e58 100644
--- a/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64/POWER7 version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -27,7 +27,7 @@
.section ".text"
.type __isnan, @function
.machine power7
-EALIGN (__isnan, 4, 0)
+ENTRY (__isnan, 4)
CALL_MCOUNT 0
lfd fp0,.LC0@toc(r2)
ftdiv cr7,fp1,fp0
diff --git a/sysdeps/powerpc/powerpc64/power7/memchr.S b/sysdeps/powerpc/powerpc64/power7/memchr.S
index 03f0d7c2dd..9ab5ab2099 100644
--- a/sysdeps/powerpc/powerpc64/power7/memchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/memchr.S
@@ -1,5 +1,5 @@
/* Optimized memchr implementation for PowerPC64/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -20,13 +20,27 @@
#include <sysdep.h>
/* int [r3] memchr (char *s [r3], int byte [r4], int size [r5]) */
+
+#ifndef MEMCHR
+# define MEMCHR __memchr
+#endif
.machine power7
-ENTRY (__memchr)
+ENTRY_TOCLESS (MEMCHR)
CALL_MCOUNT 3
dcbt 0,r3
clrrdi r8,r3,3
insrdi r4,r4,8,48
- add r7,r3,r5 /* Calculate the last acceptable address. */
+
+ /* Calculate the last acceptable address and check for possible
+ addition overflow by using satured math:
+ r7 = r3 + r5
+ r7 |= -(r7 < x) */
+ add r7,r3,r5
+ subfc r6,r3,r7
+ subfe r9,r9,r9
+ extsw r6,r9
+ or r7,r7,r6
+
insrdi r4,r4,16,32
cmpldi r5,32
li r9, -1
@@ -180,6 +194,6 @@ L(small_range):
bne cr6,L(done)
blr
-END (__memchr)
+END (MEMCHR)
weak_alias (__memchr, memchr)
libc_hidden_builtin_def (memchr)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index 4be29008c7..91acdfbd92 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1,5 +1,5 @@
/* Optimized memcmp implementation for POWER7/PowerPC64.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,9 +21,11 @@
/* int [r3] memcmp (const char *s1 [r3],
const char *s2 [r4],
size_t size [r5]) */
-
+#ifndef MEMCMP
+# define MEMCMP memcmp
+#endif
.machine power7
-EALIGN (memcmp, 4, 0)
+ENTRY_TOCLESS (MEMCMP, 4)
CALL_MCOUNT 3
#define rRTN r3
@@ -82,17 +84,17 @@ EALIGN (memcmp, 4, 0)
byte loop. */
blt cr1, L(bytealigned)
std rWORD8, rWORD8SAVE(r1)
- cfi_offset(rWORD8, rWORD8SAVE)
std rWORD7, rWORD7SAVE(r1)
- cfi_offset(rWORD7, rWORD7SAVE)
std rOFF8, rOFF8SAVE(r1)
- cfi_offset(rWORD7, rOFF8SAVE)
std rOFF16, rOFF16SAVE(r1)
- cfi_offset(rWORD7, rOFF16SAVE)
std rOFF24, rOFF24SAVE(r1)
- cfi_offset(rWORD7, rOFF24SAVE)
std rOFF32, rOFF32SAVE(r1)
- cfi_offset(rWORD7, rOFF32SAVE)
+ cfi_offset(rWORD8, rWORD8SAVE)
+ cfi_offset(rWORD7, rWORD7SAVE)
+ cfi_offset(rOFF8, rOFF8SAVE)
+ cfi_offset(rOFF16, rOFF16SAVE)
+ cfi_offset(rOFF24, rOFF24SAVE)
+ cfi_offset(rOFF32, rOFF32SAVE)
li rOFF8,8
li rOFF16,16
@@ -601,18 +603,18 @@ L(unaligned):
the actual start of rSTR2. */
clrrdi rSTR2, rSTR2, 3
std rWORD2_SHIFT, rWORD2SHIFTSAVE(r1)
- cfi_offset(rWORD2_SHIFT, rWORD2SHIFTSAVE)
/* Compute the left/right shift counts for the unaligned rSTR2,
compensating for the logical (DW aligned) start of rSTR1. */
clrldi rSHL, rWORD8_SHIFT, 61
clrrdi rSTR1, rSTR1, 3
std rWORD4_SHIFT, rWORD4SHIFTSAVE(r1)
- cfi_offset(rWORD4_SHIFT, rWORD4SHIFTSAVE)
sldi rSHL, rSHL, 3
cmpld cr5, rWORD8_SHIFT, rSTR2
add rN, rN, r12
sldi rWORD6, r12, 3
std rWORD6_SHIFT, rWORD6SHIFTSAVE(r1)
+ cfi_offset(rWORD2_SHIFT, rWORD2SHIFTSAVE)
+ cfi_offset(rWORD4_SHIFT, rWORD4SHIFTSAVE)
cfi_offset(rWORD6_SHIFT, rWORD6SHIFTSAVE)
subfic rSHR, rSHL, 64
srdi r0, rN, 5 /* Divide by 32 */
@@ -689,15 +691,15 @@ L(duPs4):
.align 4
L(DWunaligned):
std rWORD8_SHIFT, rWORD8SHIFTSAVE(r1)
- cfi_offset(rWORD8_SHIFT, rWORD8SHIFTSAVE)
clrrdi rSTR2, rSTR2, 3
std rWORD2_SHIFT, rWORD2SHIFTSAVE(r1)
- cfi_offset(rWORD2_SHIFT, rWORD2SHIFTSAVE)
srdi r0, rN, 5 /* Divide by 32 */
std rWORD4_SHIFT, rWORD4SHIFTSAVE(r1)
- cfi_offset(rWORD4_SHIFT, rWORD4SHIFTSAVE)
andi. r12, rN, 24 /* Get the DW remainder */
std rWORD6_SHIFT, rWORD6SHIFTSAVE(r1)
+ cfi_offset(rWORD8_SHIFT, rWORD8SHIFTSAVE)
+ cfi_offset(rWORD2_SHIFT, rWORD2SHIFTSAVE)
+ cfi_offset(rWORD4_SHIFT, rWORD4SHIFTSAVE)
cfi_offset(rWORD6_SHIFT, rWORD6SHIFTSAVE)
sldi rSHL, rSHL, 3
LD rWORD6, 0, rSTR2
@@ -1054,6 +1056,6 @@ L(duzeroLength):
li rRTN, 0
blr
-END (memcmp)
+END (MEMCMP)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp, bcmp)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcpy.S b/sysdeps/powerpc/powerpc64/power7/memcpy.S
index 6bb5f13257..3d8629ca65 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC64/POWER7.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -20,15 +20,19 @@
#include <sysdep.h>
-/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]);
Returns 'dst'. */
+#ifndef MEMCPY
+# define MEMCPY memcpy
+#endif
+
#define dst 11 /* Use r11 so r3 kept unchanged. */
#define src 4
#define cnt 5
.machine power7
-EALIGN (memcpy, 5, 0)
+ENTRY_TOCLESS (MEMCPY, 5)
CALL_MCOUNT 3
cmpldi cr1,cnt,31
@@ -87,63 +91,63 @@ L(aligned_copy):
srdi 12,cnt,7
cmpdi 12,0
beq L(aligned_tail)
- lxvd2x 6,0,src
- lxvd2x 7,src,6
+ lvx 6,0,src
+ lvx 7,src,6
mtctr 12
b L(aligned_128loop)
.align 4
L(aligned_128head):
/* for the 2nd + iteration of this loop. */
- lxvd2x 6,0,src
- lxvd2x 7,src,6
+ lvx 6,0,src
+ lvx 7,src,6
L(aligned_128loop):
- lxvd2x 8,src,7
- lxvd2x 9,src,8
- stxvd2x 6,0,dst
+ lvx 8,src,7
+ lvx 9,src,8
+ stvx 6,0,dst
addi src,src,64
- stxvd2x 7,dst,6
- stxvd2x 8,dst,7
- stxvd2x 9,dst,8
- lxvd2x 6,0,src
- lxvd2x 7,src,6
+ stvx 7,dst,6
+ stvx 8,dst,7
+ stvx 9,dst,8
+ lvx 6,0,src
+ lvx 7,src,6
addi dst,dst,64
- lxvd2x 8,src,7
- lxvd2x 9,src,8
+ lvx 8,src,7
+ lvx 9,src,8
addi src,src,64
- stxvd2x 6,0,dst
- stxvd2x 7,dst,6
- stxvd2x 8,dst,7
- stxvd2x 9,dst,8
+ stvx 6,0,dst
+ stvx 7,dst,6
+ stvx 8,dst,7
+ stvx 9,dst,8
addi dst,dst,64
bdnz L(aligned_128head)
L(aligned_tail):
mtocrf 0x01,cnt
bf 25,32f
- lxvd2x 6,0,src
- lxvd2x 7,src,6
- lxvd2x 8,src,7
- lxvd2x 9,src,8
+ lvx 6,0,src
+ lvx 7,src,6
+ lvx 8,src,7
+ lvx 9,src,8
addi src,src,64
- stxvd2x 6,0,dst
- stxvd2x 7,dst,6
- stxvd2x 8,dst,7
- stxvd2x 9,dst,8
+ stvx 6,0,dst
+ stvx 7,dst,6
+ stvx 8,dst,7
+ stvx 9,dst,8
addi dst,dst,64
32:
bf 26,16f
- lxvd2x 6,0,src
- lxvd2x 7,src,6
+ lvx 6,0,src
+ lvx 7,src,6
addi src,src,32
- stxvd2x 6,0,dst
- stxvd2x 7,dst,6
+ stvx 6,0,dst
+ stvx 7,dst,6
addi dst,dst,32
16:
bf 27,8f
- lxvd2x 6,0,src
+ lvx 6,0,src
addi src,src,16
- stxvd2x 6,0,dst
+ stvx 6,0,dst
addi dst,dst,16
8:
bf 28,4f
@@ -422,5 +426,5 @@ L(end_unaligned_loop):
/* Return original DST pointer. */
blr
-END_GEN_TB (memcpy,TB_TOCLESS)
+END_GEN_TB (MEMCPY,TB_TOCLESS)
libc_hidden_builtin_def (memcpy)
diff --git a/sysdeps/powerpc/powerpc64/power7/memmove.S b/sysdeps/powerpc/powerpc64/power7/memmove.S
index e263ba9608..b7f3dc28d1 100644
--- a/sysdeps/powerpc/powerpc64/power7/memmove.S
+++ b/sysdeps/powerpc/powerpc64/power7/memmove.S
@@ -1,5 +1,5 @@
/* Optimized memmove implementation for PowerPC64/POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,8 +27,11 @@
If source and destiny overlaps, a optimized backwards memcpy is used
instead. */
+#ifndef MEMMOVE
+# define MEMMOVE memmove
+#endif
.machine power7
-EALIGN (memmove, 5, 0)
+ENTRY_TOCLESS (MEMMOVE, 5)
CALL_MCOUNT 3
L(_memmove):
@@ -89,63 +92,63 @@ L(aligned_copy):
srdi 12,r5,7
cmpdi 12,0
beq L(aligned_tail)
- lxvd2x 6,0,r4
- lxvd2x 7,r4,6
+ lvx 6,0,r4
+ lvx 7,r4,6
mtctr 12
b L(aligned_128loop)
.align 4
L(aligned_128head):
/* for the 2nd + iteration of this loop. */
- lxvd2x 6,0,r4
- lxvd2x 7,r4,6
+ lvx 6,0,r4
+ lvx 7,r4,6
L(aligned_128loop):
- lxvd2x 8,r4,7
- lxvd2x 9,r4,8
- stxvd2x 6,0,r11
+ lvx 8,r4,7
+ lvx 9,r4,8
+ stvx 6,0,r11
addi r4,r4,64
- stxvd2x 7,r11,6
- stxvd2x 8,r11,7
- stxvd2x 9,r11,8
- lxvd2x 6,0,r4
- lxvd2x 7,r4,6
+ stvx 7,r11,6
+ stvx 8,r11,7
+ stvx 9,r11,8
+ lvx 6,0,r4
+ lvx 7,r4,6
addi r11,r11,64
- lxvd2x 8,r4,7
- lxvd2x 9,r4,8
+ lvx 8,r4,7
+ lvx 9,r4,8
addi r4,r4,64
- stxvd2x 6,0,r11
- stxvd2x 7,r11,6
- stxvd2x 8,r11,7
- stxvd2x 9,r11,8
+ stvx 6,0,r11
+ stvx 7,r11,6
+ stvx 8,r11,7
+ stvx 9,r11,8
addi r11,r11,64
bdnz L(aligned_128head)
L(aligned_tail):
mtocrf 0x01,r5
bf 25,32f
- lxvd2x 6,0,r4
- lxvd2x 7,r4,6
- lxvd2x 8,r4,7
- lxvd2x 9,r4,8
+ lvx 6,0,r4
+ lvx 7,r4,6
+ lvx 8,r4,7
+ lvx 9,r4,8
addi r4,r4,64
- stxvd2x 6,0,r11
- stxvd2x 7,r11,6
- stxvd2x 8,r11,7
- stxvd2x 9,r11,8
+ stvx 6,0,r11
+ stvx 7,r11,6
+ stvx 8,r11,7
+ stvx 9,r11,8
addi r11,r11,64
32:
bf 26,16f
- lxvd2x 6,0,r4
- lxvd2x 7,r4,6
+ lvx 6,0,r4
+ lvx 7,r4,6
addi r4,r4,32
- stxvd2x 6,0,r11
- stxvd2x 7,r11,6
+ stvx 6,0,r11
+ stvx 7,r11,6
addi r11,r11,32
16:
bf 27,8f
- lxvd2x 6,0,r4
+ lvx 6,0,r4
addi r4,r4,16
- stxvd2x 6,0,r11
+ stvx 6,0,r11
addi r11,r11,16
8:
bf 28,4f
@@ -485,63 +488,63 @@ L(aligned_copy_bwd):
srdi r12,r5,7
cmpdi r12,0
beq L(aligned_tail_bwd)
- lxvd2x v6,r4,r6
- lxvd2x v7,r4,r7
+ lvx v6,r4,r6
+ lvx v7,r4,r7
mtctr 12
b L(aligned_128loop_bwd)
.align 4
L(aligned_128head_bwd):
/* for the 2nd + iteration of this loop. */
- lxvd2x v6,r4,r6
- lxvd2x v7,r4,r7
+ lvx v6,r4,r6
+ lvx v7,r4,r7
L(aligned_128loop_bwd):
- lxvd2x v8,r4,r8
- lxvd2x v9,r4,r9
- stxvd2x v6,r11,r6
+ lvx v8,r4,r8
+ lvx v9,r4,r9
+ stvx v6,r11,r6
subi r4,r4,64
- stxvd2x v7,r11,r7
- stxvd2x v8,r11,r8
- stxvd2x v9,r11,r9
- lxvd2x v6,r4,r6
- lxvd2x v7,r4,7
+ stvx v7,r11,r7
+ stvx v8,r11,r8
+ stvx v9,r11,r9
+ lvx v6,r4,r6
+ lvx v7,r4,7
subi r11,r11,64
- lxvd2x v8,r4,r8
- lxvd2x v9,r4,r9
+ lvx v8,r4,r8
+ lvx v9,r4,r9
subi r4,r4,64
- stxvd2x v6,r11,r6
- stxvd2x v7,r11,r7
- stxvd2x v8,r11,r8
- stxvd2x v9,r11,r9
+ stvx v6,r11,r6
+ stvx v7,r11,r7
+ stvx v8,r11,r8
+ stvx v9,r11,r9
subi r11,r11,64
bdnz L(aligned_128head_bwd)
L(aligned_tail_bwd):
mtocrf 0x01,r5
bf 25,32f
- lxvd2x v6,r4,r6
- lxvd2x v7,r4,r7
- lxvd2x v8,r4,r8
- lxvd2x v9,r4,r9
+ lvx v6,r4,r6
+ lvx v7,r4,r7
+ lvx v8,r4,r8
+ lvx v9,r4,r9
subi r4,r4,64
- stxvd2x v6,r11,r6
- stxvd2x v7,r11,r7
- stxvd2x v8,r11,r8
- stxvd2x v9,r11,r9
+ stvx v6,r11,r6
+ stvx v7,r11,r7
+ stvx v8,r11,r8
+ stvx v9,r11,r9
subi r11,r11,64
32:
bf 26,16f
- lxvd2x v6,r4,r6
- lxvd2x v7,r4,r7
+ lvx v6,r4,r6
+ lvx v7,r4,r7
subi r4,r4,32
- stxvd2x v6,r11,r6
- stxvd2x v7,r11,r7
+ stvx v6,r11,r6
+ stvx v7,r11,r7
subi r11,r11,32
16:
bf 27,8f
- lxvd2x v6,r4,r6
+ lvx v6,r4,r6
subi r4,r4,16
- stxvd2x v6,r11,r6
+ stvx v6,r11,r6
subi r11,r11,16
8:
bf 28,4f
@@ -816,14 +819,14 @@ L(end_unaligned_loop_bwd):
stb r8,-7(r11)
/* Return original DST pointer. */
blr
-END_GEN_TB (memmove, TB_TOCLESS)
+END_GEN_TB (MEMMOVE, TB_TOCLESS)
libc_hidden_builtin_def (memmove)
/* void bcopy(const void *src [r3], void *dest [r4], size_t n [r5])
Implemented in this file to avoid linker create a stub function call
in the branch to '_memmove'. */
-ENTRY (__bcopy)
+ENTRY_TOCLESS (__bcopy)
mr r6,r3
mr r3,r4
mr r4,r6
diff --git a/sysdeps/powerpc/powerpc64/power7/mempcpy.S b/sysdeps/powerpc/powerpc64/power7/mempcpy.S
index 98ed1f07f9..7f5a4745ef 100644
--- a/sysdeps/powerpc/powerpc64/power7/mempcpy.S
+++ b/sysdeps/powerpc/powerpc64/power7/mempcpy.S
@@ -1,5 +1,5 @@
/* Optimized mempcpy implementation for POWER7.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -20,11 +20,14 @@
#include <sysdep.h>
-/* __ptr_t [r3] __mempcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
+/* void * [r3] __mempcpy (void *dst [r3], void *src [r4], size_t len [r5]);
Returns 'dst' + 'len'. */
+#ifndef MEMPCPY
+# define MEMPCPY __mempcpy
+#endif
.machine power7
-EALIGN (__mempcpy, 5, 0)
+ENTRY_TOCLESS (MEMPCPY, 5)
CALL_MCOUNT 3
cmpldi cr1,5,31
@@ -463,7 +466,7 @@ L(end_unaligned_loop):
add 3,3,5
blr
-END_GEN_TB (__mempcpy,TB_TOCLESS)
+END_GEN_TB (MEMPCPY,TB_TOCLESS)
libc_hidden_def (__mempcpy)
weak_alias (__mempcpy, mempcpy)
libc_hidden_builtin_def (mempcpy)
diff --git a/sysdeps/powerpc/powerpc64/power7/memrchr.S b/sysdeps/powerpc/powerpc64/power7/memrchr.S
index 042c46d804..583d513c4c 100644
--- a/sysdeps/powerpc/powerpc64/power7/memrchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/memrchr.S
@@ -1,5 +1,5 @@
/* Optimized memrchr implementation for PowerPC64/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -20,8 +20,12 @@
#include <sysdep.h>
/* int [r3] memrchr (char *s [r3], int byte [r4], int size [r5]) */
+
+#ifndef MEMRCHR
+# define MEMRCHR __memrchr
+#endif
.machine power7
-ENTRY (__memrchr)
+ENTRY_TOCLESS (MEMRCHR)
CALL_MCOUNT 3
add r7,r3,r5 /* Calculate the last acceptable address. */
neg r0,r7
@@ -192,6 +196,6 @@ L(loop_small):
bne L(loop_small)
blr
-END (__memrchr)
+END (MEMRCHR)
weak_alias (__memrchr, memrchr)
libc_hidden_builtin_def (memrchr)
diff --git a/sysdeps/powerpc/powerpc64/power7/memset.S b/sysdeps/powerpc/powerpc64/power7/memset.S
index cf831861fe..acd0adfb78 100644
--- a/sysdeps/powerpc/powerpc64/power7/memset.S
+++ b/sysdeps/powerpc/powerpc64/power7/memset.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64/POWER7.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -19,11 +19,14 @@
#include <sysdep.h>
-/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
+/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5]));
Returns 's'. */
+#ifndef MEMSET
+# define MEMSET memset
+#endif
.machine power7
-EALIGN (memset, 5, 0)
+ENTRY_TOCLESS (MEMSET, 5)
CALL_MCOUNT 3
L(_memset):
@@ -380,12 +383,12 @@ L(small):
stw 4,4(10)
blr
-END_GEN_TB (memset,TB_TOCLESS)
+END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
-ENTRY (__bzero)
+ENTRY_TOCLESS (__bzero)
CALL_MCOUNT 3
mr r5,r4
li r4,0
diff --git a/sysdeps/powerpc/powerpc64/power7/multiarch/Implies b/sysdeps/powerpc/powerpc64/power7/multiarch/Implies
deleted file mode 100644
index bf5d6171a5..0000000000
--- a/sysdeps/powerpc/powerpc64/power7/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power6/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power7/rawmemchr.S b/sysdeps/powerpc/powerpc64/power7/rawmemchr.S
index 32223d0baa..6ada0ebb30 100644
--- a/sysdeps/powerpc/powerpc64/power7/rawmemchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/rawmemchr.S
@@ -1,5 +1,5 @@
/* Optimized rawmemchr implementation for PowerPC64/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -20,8 +20,12 @@
#include <sysdep.h>
/* int [r3] rawmemchr (void *s [r3], int c [r4]) */
+
+#ifndef RAWMEMCHR
+# define RAWMEMCHR __rawmemchr
+#endif
.machine power7
-ENTRY (__rawmemchr)
+ENTRY_TOCLESS (RAWMEMCHR)
CALL_MCOUNT 2
dcbt 0,r3
clrrdi r8,r3,3 /* Align the address to doubleword boundary. */
@@ -106,6 +110,6 @@ L(done):
srdi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of the matching char. */
blr
-END (__rawmemchr)
+END (RAWMEMCHR)
weak_alias (__rawmemchr,rawmemchr)
libc_hidden_builtin_def (__rawmemchr)
diff --git a/sysdeps/powerpc/powerpc64/power7/stpncpy.S b/sysdeps/powerpc/powerpc64/power7/stpncpy.S
index 54cfae9218..279ce83973 100644
--- a/sysdeps/powerpc/powerpc64/power7/stpncpy.S
+++ b/sysdeps/powerpc/powerpc64/power7/stpncpy.S
@@ -1,5 +1,5 @@
/* Optimized stpncpy implementation for PowerPC64/POWER7.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/power7/strcasecmp.S b/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
index d1c29166a9..1d4bc61137 100644
--- a/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
@@ -1,5 +1,5 @@
/* Optimized strcasecmp implementation for PowerPC64.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,17 +24,18 @@
or if defined USE_IN_EXTENDED_LOCALE_MODEL:
int [r3] strcasecmp_l (const char *s1 [r3], const char *s2 [r4],
- __locale_t loc [r5]) */
+ locale_t loc [r5]) */
#ifndef STRCMP
# define __STRCMP __strcasecmp
# define STRCMP strcasecmp
#endif
-ENTRY (__STRCMP)
#ifndef USE_IN_EXTENDED_LOCALE_MODEL
+ENTRY (__STRCMP)
CALL_MCOUNT 2
#else
+ENTRY_TOCLESS (__STRCMP)
CALL_MCOUNT 3
#endif
diff --git a/sysdeps/powerpc/powerpc64/power7/strchr.S b/sysdeps/powerpc/powerpc64/power7/strchr.S
index 1ad4bd3a2a..da648b2749 100644
--- a/sysdeps/powerpc/powerpc64/power7/strchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/strchr.S
@@ -1,5 +1,5 @@
/* Optimized strchr implementation for PowerPC64/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -19,9 +19,13 @@
#include <sysdep.h>
+#ifndef STRCHR
+# define STRCHR strchr
+#endif
+
/* int [r3] strchr (char *s [r3], int c [r4]) */
.machine power7
-ENTRY (strchr)
+ENTRY_TOCLESS (STRCHR)
CALL_MCOUNT 2
dcbt 0,r3
clrrdi r8,r3,3 /* Align the address to doubleword boundary. */
@@ -221,6 +225,6 @@ L(done_null):
srdi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of the matching null byte. */
blr
-END (strchr)
+END (STRCHR)
weak_alias (strchr, index)
libc_hidden_builtin_def (strchr)
diff --git a/sysdeps/powerpc/powerpc64/power7/strchrnul.S b/sysdeps/powerpc/powerpc64/power7/strchrnul.S
index 020c0459b8..f137174701 100644
--- a/sysdeps/powerpc/powerpc64/power7/strchrnul.S
+++ b/sysdeps/powerpc/powerpc64/power7/strchrnul.S
@@ -1,5 +1,5 @@
/* Optimized strchrnul implementation for PowerPC64/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -19,9 +19,12 @@
#include <sysdep.h>
+#ifndef STRCHRNUL
+# define STRCHRNUL __strchrnul
+#endif
/* int [r3] strchrnul (char *s [r3], int c [r4]) */
.machine power7
-ENTRY (__strchrnul)
+ENTRY_TOCLESS (STRCHRNUL)
CALL_MCOUNT 2
dcbt 0,r3
clrrdi r8,r3,3 /* Align the address to doubleword boundary. */
@@ -123,6 +126,6 @@ L(done):
srdi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of matching c/null byte. */
blr
-END (__strchrnul)
-weak_alias (__strchrnul,strchrnul)
-libc_hidden_builtin_def (__strchrnul)
+END (STRCHRNUL)
+weak_alias (STRCHRNUL, strchrnul)
+libc_hidden_builtin_def (STRCHRNUL)
diff --git a/sysdeps/powerpc/powerpc64/power7/strcmp.S b/sysdeps/powerpc/powerpc64/power7/strcmp.S
index 5bbae0d3b2..c3d5ec1090 100644
--- a/sysdeps/powerpc/powerpc64/power7/strcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/strcmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for Power7 using 'cmpb' instruction
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,10 +23,14 @@
#include <sysdep.h>
+#ifndef STRCMP
+# define STRCMP strcmp
+#endif
+
/* int [r3] strcmp (const char *s1 [r3], const char *s2 [r4]) */
.machine power7
-EALIGN (strcmp, 4, 0)
+ENTRY_TOCLESS (STRCMP, 4)
CALL_MCOUNT 2
or r9, r3, r4
@@ -160,5 +164,5 @@ L(diffOfNULL):
extsw r3, r10 /* sign extend result */
blr /* return */
-END (strcmp)
+END (STRCMP)
libc_hidden_builtin_def (strcmp)
diff --git a/sysdeps/powerpc/powerpc64/power7/strlen.S b/sysdeps/powerpc/powerpc64/power7/strlen.S
index 4b2180f65f..9758089a15 100644
--- a/sysdeps/powerpc/powerpc64/power7/strlen.S
+++ b/sysdeps/powerpc/powerpc64/power7/strlen.S
@@ -1,5 +1,5 @@
/* Optimized strlen implementation for PowerPC64/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -20,8 +20,12 @@
#include <sysdep.h>
/* int [r3] strlen (char *s [r3]) */
+
+#ifndef STRLEN
+# define STRLEN strlen
+#endif
.machine power7
-ENTRY (strlen)
+ENTRY_TOCLESS (STRLEN)
CALL_MCOUNT 1
dcbt 0,r3
clrrdi r4,r3,3 /* Align the address to doubleword boundary. */
@@ -99,5 +103,5 @@ L(done):
srdi r0,r0,3 /* Convert leading/trailing zeros to bytes. */
add r3,r5,r0 /* Compute final length. */
blr
-END (strlen)
+END (STRLEN)
libc_hidden_builtin_def (strlen)
diff --git a/sysdeps/powerpc/powerpc64/power7/strncmp.S b/sysdeps/powerpc/powerpc64/power7/strncmp.S
index 0de9b97173..0c7429d19f 100644
--- a/sysdeps/powerpc/powerpc64/power7/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for POWER7/PowerPC64.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,13 +18,17 @@
#include <sysdep.h>
+#ifndef STRNCMP
+# define STRNCMP strncmp
+#endif
+
/* See strlen.s for comments on how the end-of-string testing works. */
/* int [r3] strncmp (const char *s1 [r3],
const char *s2 [r4],
size_t size [r5]) */
-EALIGN (strncmp,5,0)
+ENTRY_TOCLESS (STRNCMP, 5)
CALL_MCOUNT 3
#define rTMP2 r0
@@ -219,5 +223,5 @@ L(u4): sub rRTN,rWORD1,rWORD2
L(ux):
li rRTN,0
blr
-END (strncmp)
+END (STRNCMP)
libc_hidden_builtin_def (strncmp)
diff --git a/sysdeps/powerpc/powerpc64/power7/strncpy.S b/sysdeps/powerpc/powerpc64/power7/strncpy.S
index 1b4a3d9181..1965f82a2b 100644
--- a/sysdeps/powerpc/powerpc64/power7/strncpy.S
+++ b/sysdeps/powerpc/powerpc64/power7/strncpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,17 +40,26 @@
memset. */
#ifdef USE_AS_STPNCPY
-# define FUNC_NAME __stpncpy
+# ifndef STPNCPY
+# define FUNC_NAME __stpncpy
+# else
+# define FUNC_NAME STPNCPY
+# endif
#else
-# define FUNC_NAME strncpy
-#endif
+# ifndef STRNCPY
+# define FUNC_NAME strncpy
+# else
+# define FUNC_NAME STRNCPY
+# endif
+#endif /* !USE_AS_STPNCPY */
-#define FRAMESIZE (FRAME_MIN_SIZE+32)
+#define FRAMESIZE (FRAME_MIN_SIZE+16)
#ifndef MEMSET
/* For builds with no IFUNC support, local calls should be made to internal
GLIBC symbol (created by libc_hidden_builtin_def). */
# ifdef SHARED
+# define MEMSET_is_local
# define MEMSET __GI_memset
# else
# define MEMSET memset
@@ -58,17 +67,20 @@
#endif
.machine power7
-EALIGN(FUNC_NAME, 4, 0)
+#ifdef MEMSET_is_local
+ENTRY_TOCLESS (FUNC_NAME, 4)
+#else
+ENTRY (FUNC_NAME, 4)
+#endif
CALL_MCOUNT 3
- mflr r0 /* load link register LR to r0 */
or r10, r3, r4 /* to verify source and destination */
rldicl. r8, r10, 0, 61 /* is double word aligned .. ? */
std r19, -8(r1) /* save callers register , r19 */
std r18, -16(r1) /* save callers register , r18 */
- std r0, 16(r1) /* store the link register */
- stdu r1, -FRAMESIZE(r1) /* create the stack frame */
+ cfi_offset(r19, -8)
+ cfi_offset(r18, -16)
mr r9, r3 /* save r3 into r9 for use */
mr r18, r3 /* save r3 for retCode of strncpy */
@@ -211,11 +223,23 @@ L(zeroFill):
cmpdi cr7, r8, 0 /* compare if length is zero */
beq cr7, L(update3return)
+ mflr r0 /* load link register LR to r0 */
+ std r0, 16(r1) /* store the link register */
+ stdu r1, -FRAMESIZE(r1) /* create the stack frame */
+ cfi_adjust_cfa_offset(FRAMESIZE)
+ cfi_offset(lr, 16)
mr r3, r19 /* fill buffer with */
li r4, 0 /* zero fill buffer */
mr r5, r8 /* how many bytes to fill buffer with */
bl MEMSET /* call optimized memset */
+#ifndef MEMSET_is_local
nop
+#endif
+ ld r0, FRAMESIZE+16(r1) /* read the saved link register */
+ addi r1, r1, FRAMESIZE /* restore stack pointer */
+ cfi_adjust_cfa_offset(-FRAMESIZE)
+ mtlr r0
+ cfi_restore(lr)
L(update3return):
#ifdef USE_AS_STPNCPY
@@ -226,11 +250,8 @@ L(hop2return):
#ifndef USE_AS_STPNCPY
mr r3, r18 /* set return value */
#endif
- addi r1, r1, FRAMESIZE /* restore stack pointer */
- ld r0, 16(r1) /* read the saved link register */
ld r18, -16(r1) /* restore callers save register, r18 */
ld r19, -8(r1) /* restore callers save register, r19 */
- mtlr r0 /* branch to link register */
blr /* return */
.p2align 4
@@ -264,16 +285,13 @@ L(oneBYone):
.p2align 4
L(done):
- addi r1, r1, FRAMESIZE /* restore stack pointer */
#ifdef USE_AS_STPNCPY
mr r3, r19 /* set the return value */
#else
mr r3, r18 /* set the return value */
#endif
- ld r0, 16(r1) /* read the saved link register */
ld r18, -16(r1) /* restore callers save register, r18 */
ld r19, -8(r1) /* restore callers save register, r19 */
- mtlr r0 /* branch to link register */
blr /* return */
L(update1):
diff --git a/sysdeps/powerpc/powerpc64/power7/strnlen.S b/sysdeps/powerpc/powerpc64/power7/strnlen.S
index 35b7749e0d..3097cac1fb 100644
--- a/sysdeps/powerpc/powerpc64/power7/strnlen.S
+++ b/sysdeps/powerpc/powerpc64/power7/strnlen.S
@@ -1,5 +1,5 @@
/* Optimized strnlen implementation for PowerPC64/POWER7 using cmpb insn.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -19,9 +19,13 @@
#include <sysdep.h>
+#ifndef STRNLEN
+# define STRNLEN __strnlen
+#endif
+
/* int [r3] strnlen (char *s [r3], int size [r4]) */
.machine power7
-ENTRY (__strnlen)
+ENTRY_TOCLESS (STRNLEN)
CALL_MCOUNT 2
dcbt 0,r3
clrrdi r8,r3,3
@@ -172,7 +176,7 @@ L(loop_small):
mr r3,r4
blr
-END (__strnlen)
+END (STRNLEN)
libc_hidden_def (__strnlen)
weak_alias (__strnlen, strnlen)
libc_hidden_def (strnlen)
diff --git a/sysdeps/powerpc/powerpc64/power7/strrchr.S b/sysdeps/powerpc/powerpc64/power7/strrchr.S
index 5193b07a7a..e47e3d4188 100644
--- a/sysdeps/powerpc/powerpc64/power7/strrchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/strrchr.S
@@ -1,5 +1,5 @@
/* Optimized strrchr implementation for PowerPC64/POWER7 using cmpb insn.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,8 +19,13 @@
#include <sysdep.h>
/* int [r3] strrchr (char *s [r3], int c [r4]) */
+
+#ifndef STRRCHR
+# define STRRCHR strrchr
+#endif
+
.machine power7
-ENTRY (strrchr)
+ENTRY_TOCLESS (STRRCHR)
CALL_MCOUNT 2
dcbt 0,r3
clrrdi r8,r3,3 /* Align the address to doubleword boundary. */
@@ -250,6 +255,6 @@ L(done_null):
srdi r0,r0,3 /* Convert trailing zeros to bytes. */
add r3,r8,r0 /* Return address of the matching null byte. */
blr
-END (strrchr)
+END (STRRCHR)
weak_alias (strrchr, rindex)
libc_hidden_builtin_def (strrchr)
diff --git a/sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c b/sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c
index 164c49a2c3..7559733c7c 100644
--- a/sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c
@@ -1,5 +1,5 @@
/* Optimized strstr implementation for PowerPC64/POWER7.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/power7/strstr.S b/sysdeps/powerpc/powerpc64/power7/strstr.S
index fefac1c9e5..ac92f9c517 100644
--- a/sysdeps/powerpc/powerpc64/power7/strstr.S
+++ b/sysdeps/powerpc/powerpc64/power7/strstr.S
@@ -1,5 +1,5 @@
/* Optimized strstr implementation for PowerPC64/POWER7.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,11 +25,16 @@
#define ITERATIONS 64
+#ifndef STRSTR
+# define STRSTR strstr
+#endif
+
#ifndef STRLEN
/* For builds with no IFUNC support, local calls should be made to internal
GLIBC symbol (created by libc_hidden_builtin_def). */
# ifdef SHARED
# define STRLEN __GI_strlen
+# define STRLEN_is_local
# else
# define STRLEN strlen
# endif
@@ -40,6 +45,7 @@
GLIBC symbol (created by libc_hidden_builtin_def). */
# ifdef SHARED
# define STRNLEN __GI_strnlen
+# define STRNLEN_is_local
# else
# define STRNLEN __strnlen
# endif
@@ -48,6 +54,7 @@
#ifndef STRCHR
# ifdef SHARED
# define STRCHR __GI_strchr
+# define STRCHR_is_local
# else
# define STRCHR strchr
# endif
@@ -55,18 +62,19 @@
#define FRAMESIZE (FRAME_MIN_SIZE+32)
.machine power7
-EALIGN (strstr, 4, 0)
+/* Can't be ENTRY_TOCLESS due to calling __strstr_ppc which uses r2. */
+ENTRY (STRSTR, 4)
CALL_MCOUNT 2
mflr r0 /* Load link register LR to r0. */
std r31, -8(r1) /* Save callers register r31. */
- cfi_offset(r31, -8)
std r30, -16(r1) /* Save callers register r30. */
- cfi_offset(r30, -16)
std r29, -24(r1) /* Save callers register r29. */
- cfi_offset(r29, -24)
std r28, -32(r1) /* Save callers register r28. */
- cfi_offset(r28, -32)
std r0, 16(r1) /* Store the link register. */
+ cfi_offset(r31, -8)
+ cfi_offset(r30, -16)
+ cfi_offset(r28, -32)
+ cfi_offset(r29, -24)
cfi_offset(lr, 16)
stdu r1, -FRAMESIZE(r1) /* Create the stack frame. */
cfi_adjust_cfa_offset(FRAMESIZE)
@@ -82,7 +90,9 @@ EALIGN (strstr, 4, 0)
mr r30, r4
mr r3, r4
bl STRLEN
+#ifndef STRLEN_is_local
nop
+#endif
cmpdi cr7, r3, 0 /* If search str is null. */
beq cr7, L(ret_r3)
@@ -91,14 +101,18 @@ EALIGN (strstr, 4, 0)
mr r4, r3
mr r3, r29
bl STRNLEN
+#ifndef STRNLEN_is_local
nop
+#endif
cmpd cr7, r3, r31 /* If len(r3) < len(r4). */
blt cr7, L(retnull)
mr r3, r29
lbz r4, 0(r30)
bl STRCHR
+#ifndef STRCHR_is_local
nop
+#endif
mr r11, r3
/* If first char of search str is not present. */
@@ -330,7 +344,9 @@ L(begin):
beq cr7, L(default)
lbz r4, 0(r30)
bl STRCHR
+#ifndef STRCHR_is_local
nop
+#endif
/* If first char of search str is not present. */
cmpdi cr7, r3, 0
ble cr7, L(end)
@@ -433,7 +449,9 @@ L(nextbyte):
beq cr7, L(default)
lbz r4, 0(r30)
bl STRCHR
+#ifndef STRCHR_is_local
nop
+#endif
/* If first char of search str is not present. */
cmpdi cr7, r3, 0
ble cr7, L(end)
@@ -513,5 +531,5 @@ L(end):
ld r31, -8(r1) /* Restore callers save register r31. */
mtlr r0 /* Branch to link register. */
blr
-END (strstr)
+END (STRSTR)
libc_hidden_builtin_def (strstr)
diff --git a/sysdeps/powerpc/powerpc64/power7/sub_n.S b/sysdeps/powerpc/powerpc64/power7/sub_n.S
index 262eee5486..283e0cac6c 100644
--- a/sysdeps/powerpc/powerpc64/power7/sub_n.S
+++ b/sysdeps/powerpc/powerpc64/power7/sub_n.S
@@ -1,6 +1,6 @@
/* PowerPC64 mpn_lshift -- mpn_add_n/mpn_sub_n -- mpn addition and
subtraction.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/power8/Implies b/sysdeps/powerpc/powerpc64/power8/Implies
deleted file mode 100644
index 9a5e3c7277..0000000000
--- a/sysdeps/powerpc/powerpc64/power8/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/power7/fpu
-powerpc/powerpc64/power7
diff --git a/sysdeps/powerpc/powerpc64/power8/Makefile b/sysdeps/powerpc/powerpc64/power8/Makefile
new file mode 100644
index 0000000000..71a59529f3
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),string)
+sysdep_routines += strcasestr-ppc64
+endif
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/Implies b/sysdeps/powerpc/powerpc64/power8/fpu/Implies
deleted file mode 100644
index 1187cdfb0a..0000000000
--- a/sysdeps/powerpc/powerpc64/power8/fpu/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power7/fpu/
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S b/sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S
new file mode 100644
index 0000000000..32ee8326e1
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S
@@ -0,0 +1,303 @@
+/* Optimized expf(). PowerPC64/POWER8 version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+/* Short algorithm description:
+ *
+ * Let K = 64 (table size).
+ * e^x = 2^(x/log(2)) = 2^n * T[j] * (1 + P(y))
+ * where:
+ * x = m*log(2)/K + y, y in [0.0..log(2)/K]
+ * m = n*K + j, m,n,j - signed integer, j in [0..K-1]
+ * values of 2^(j/K) are tabulated as T[j].
+ *
+ * P(y) is a minimax polynomial approximation of expf(y)-1
+ * on small interval [0.0..log(2)/K].
+ *
+ * P(y) = P3*y*y*y*y + P2*y*y*y + P1*y*y + P0*y, calculated as
+ * z = y*y; P(y) = (P3*z + P1)*z + (P2*z + P0)*y
+ *
+ * Special cases:
+ * expf(NaN) = NaN
+ * expf(+INF) = +INF
+ * expf(-INF) = 0
+ * expf(x) = 1 for subnormals
+ * for finite argument, only expf(0)=1 is exact
+ * expf(x) overflows if x>88.7228317260742190
+ * expf(x) underflows if x<-103.972076416015620
+ */
+
+#define C1 0x42ad496b /* Single precision 125*log(2). */
+#define C2 0x31800000 /* Single precision 2^(-28). */
+#define SP_INF 0x7f800000 /* Single precision Inf. */
+#define SP_EXP_BIAS 0x1fc0 /* Single precision exponent bias. */
+
+#define DATA_OFFSET r9
+
+/* Implements the function
+
+ float [fp1] expf (float [fp1] x) */
+
+ .machine power8
+ENTRY (__ieee754_expf, 4)
+ addis DATA_OFFSET,r2,.Lanchor@toc@ha
+ addi DATA_OFFSET,DATA_OFFSET,.Lanchor@toc@l
+
+ xscvdpspn v0,v1
+ mfvsrd r8,v0 /* r8 = x */
+ lfd fp2,(.KLN2-.Lanchor)(DATA_OFFSET)
+ lfd fp3,(.P2-.Lanchor)(DATA_OFFSET)
+ rldicl r3,r8,32,33 /* r3 = |x| */
+ lis r4,C1@ha /* r4 = 125*log(2) */
+ ori r4,r4,C1@l
+ cmpw r3,r4
+ lfd fp5,(.P3-.Lanchor)(DATA_OFFSET)
+ lfd fp4,(.RS-.Lanchor)(DATA_OFFSET)
+ fmadd fp2,fp1,fp2,fp4 /* fp2 = x * K/log(2) + (2^23 + 2^22) */
+ bge L(special_paths) /* |x| >= 125*log(2) ? */
+
+ lis r4,C2@ha
+ ori r4,r4,C2@l
+ cmpw r3,r4
+ blt L(small_args) /* |x| < 2^(-28) ? */
+
+ /* Main path: here if 2^(-28) <= |x| < 125*log(2) */
+ frsp fp6,fp2
+ xscvdpsp v2,v2
+ mfvsrd r8,v2
+ mr r3,r8 /* r3 = m */
+ rldicl r8,r8,32,58 /* r8 = j */
+ lfs fp4,(.SP_RS-.Lanchor)(DATA_OFFSET)
+ fsubs fp2,fp6,fp4 /* fp2 = m = x * K/log(2) */
+ srdi r3,r3,32
+ clrrwi r3,r3,6 /* r3 = n */
+ lfd fp6,(.NLN2K-.Lanchor)(DATA_OFFSET)
+ fmadd fp0,fp2,fp6,fp1 /* fp0 = y = x - m*log(2)/K */
+ fmul fp2,fp0,fp0 /* fp2 = z = y^2 */
+ lfd fp4,(.P1-.Lanchor)(DATA_OFFSET)
+ lfd fp6,(.P0-.Lanchor)(DATA_OFFSET)
+ lis r4,SP_EXP_BIAS@ha
+ ori r4,r4,SP_EXP_BIAS@l
+ add r3,r3,r4
+ rldic r3,r3,49,1 /* r3 = 2^n */
+ fmadd fp4,fp5,fp2,fp4 /* fp4 = P3 * z + P1 */
+ fmadd fp6,fp3,fp2,fp6 /* fp6 = P2 * z + P0 */
+ mtvsrd v1,r3
+ xscvspdp v1,v1
+ fmul fp4,fp4,fp2 /* fp4 = (P3 * z + P1)*z */
+ fmadd fp0,fp0,fp6,fp4 /* fp0 = P(y) */
+ sldi r8,r8,3 /* Access doublewords from T[j]. */
+ addi r6,DATA_OFFSET,(.Ttable-.Lanchor)
+ lfdx fp3,r6,r8
+ fmadd fp0,fp0,fp3,fp3 /* fp0 = T[j] * (1 + P(y)) */
+ fmul fp1,fp1,fp0 /* fp1 = 2^n * T[j] * (1 + P(y)) */
+ frsp fp1,fp1
+ blr
+
+ .align 4
+/* x is either underflow, overflow, infinite or NaN. */
+L(special_paths):
+ srdi r8,r8,32
+ rlwinm r8,r8,3,29,29 /* r8 = 0, if x positive.
+ r8 = 4, otherwise. */
+ addi r6,DATA_OFFSET,(.SPRANGE-.Lanchor)
+ lwzx r4,r6,r8 /* r4 = .SPRANGE[signbit(x)] */
+ cmpw r3,r4
+ /* |x| <= .SPRANGE[signbit(x)] */
+ ble L(near_under_or_overflow)
+
+ lis r4,SP_INF@ha
+ ori r4,r4,SP_INF@l
+ cmpw r3,r4
+ bge L(arg_inf_or_nan) /* |x| > Infinite ? */
+
+ addi r6,DATA_OFFSET,(.SPLARGE_SMALL-.Lanchor)
+ lfsx fp1,r6,r8
+ fmuls fp1,fp1,fp1
+ blr
+
+
+ .align 4
+L(small_args):
+ /* expf(x) = 1.0, where |x| < |2^(-28)| */
+ lfs fp2,(.SPone-.Lanchor)(DATA_OFFSET)
+ fadds fp1,fp1,fp2
+ blr
+
+
+ .align 4
+L(arg_inf_or_nan:)
+ bne L(arg_nan)
+
+ /* expf(+INF) = +INF
+ expf(-INF) = 0 */
+ addi r6,DATA_OFFSET,(.INF_ZERO-.Lanchor)
+ lfsx fp1,r6,r8
+ blr
+
+
+ .align 4
+L(arg_nan):
+ /* expf(NaN) = NaN */
+ fadd fp1,fp1,fp1
+ frsp fp1,fp1
+ blr
+
+ .align 4
+L(near_under_or_overflow):
+ frsp fp6,fp2
+ xscvdpsp v2,v2
+ mfvsrd r8,v2
+ mr r3,r8 /* r3 = m */
+ rldicl r8,r8,32,58 /* r8 = j */
+ lfs fp4,(.SP_RS-.Lanchor)(DATA_OFFSET)
+ fsubs fp2,fp6,fp4 /* fp2 = m = x * K/log(2) */
+ srdi r3,r3,32
+ clrrwi r3,r3,6 /* r3 = n */
+ lfd fp6,(.NLN2K-.Lanchor)(DATA_OFFSET)
+ fmadd fp0,fp2,fp6,fp1 /* fp0 = y = x - m*log(2)/K */
+ fmul fp2,fp0,fp0 /* fp2 = z = y^2 */
+ lfd fp4,(.P1-.Lanchor)(DATA_OFFSET)
+ lfd fp6,(.P0-.Lanchor)(DATA_OFFSET)
+ ld r4,(.DP_EXP_BIAS-.Lanchor)(DATA_OFFSET)
+ add r3,r3,r4
+ rldic r3,r3,46,1 /* r3 = 2 */
+ fmadd fp4,fp5,fp2,fp4 /* fp4 = P3 * z + P1 */
+ fmadd fp6,fp3,fp2,fp6 /* fp6 = P2 * z + P0 */
+ mtvsrd v1,r3
+ fmul fp4,fp4,fp2 /* fp4 = (P3*z + P1)*z */
+ fmadd fp0,fp0,fp6,fp4 /* fp0 = P(y) */
+ sldi r8,r8,3 /* Access doublewords from T[j]. */
+ addi r6,DATA_OFFSET,(.Ttable-.Lanchor)
+ lfdx fp3,r6,r8
+ fmadd fp0,fp0,fp3,fp3 /* fp0 = T[j] * (1 + T[j]) */
+ fmul fp1,fp1,fp0 /* fp1 = 2^n * T[j] * (1 + T[j]) */
+ frsp fp1,fp1
+ blr
+END(__ieee754_expf)
+
+ .section .rodata, "a",@progbits
+.Lanchor:
+ .balign 8
+/* Table T[j] = 2^(j/K). Double precision. */
+.Ttable:
+ .8byte 0x3ff0000000000000
+ .8byte 0x3ff02c9a3e778061
+ .8byte 0x3ff059b0d3158574
+ .8byte 0x3ff0874518759bc8
+ .8byte 0x3ff0b5586cf9890f
+ .8byte 0x3ff0e3ec32d3d1a2
+ .8byte 0x3ff11301d0125b51
+ .8byte 0x3ff1429aaea92de0
+ .8byte 0x3ff172b83c7d517b
+ .8byte 0x3ff1a35beb6fcb75
+ .8byte 0x3ff1d4873168b9aa
+ .8byte 0x3ff2063b88628cd6
+ .8byte 0x3ff2387a6e756238
+ .8byte 0x3ff26b4565e27cdd
+ .8byte 0x3ff29e9df51fdee1
+ .8byte 0x3ff2d285a6e4030b
+ .8byte 0x3ff306fe0a31b715
+ .8byte 0x3ff33c08b26416ff
+ .8byte 0x3ff371a7373aa9cb
+ .8byte 0x3ff3a7db34e59ff7
+ .8byte 0x3ff3dea64c123422
+ .8byte 0x3ff4160a21f72e2a
+ .8byte 0x3ff44e086061892d
+ .8byte 0x3ff486a2b5c13cd0
+ .8byte 0x3ff4bfdad5362a27
+ .8byte 0x3ff4f9b2769d2ca7
+ .8byte 0x3ff5342b569d4f82
+ .8byte 0x3ff56f4736b527da
+ .8byte 0x3ff5ab07dd485429
+ .8byte 0x3ff5e76f15ad2148
+ .8byte 0x3ff6247eb03a5585
+ .8byte 0x3ff6623882552225
+ .8byte 0x3ff6a09e667f3bcd
+ .8byte 0x3ff6dfb23c651a2f
+ .8byte 0x3ff71f75e8ec5f74
+ .8byte 0x3ff75feb564267c9
+ .8byte 0x3ff7a11473eb0187
+ .8byte 0x3ff7e2f336cf4e62
+ .8byte 0x3ff82589994cce13
+ .8byte 0x3ff868d99b4492ed
+ .8byte 0x3ff8ace5422aa0db
+ .8byte 0x3ff8f1ae99157736
+ .8byte 0x3ff93737b0cdc5e5
+ .8byte 0x3ff97d829fde4e50
+ .8byte 0x3ff9c49182a3f090
+ .8byte 0x3ffa0c667b5de565
+ .8byte 0x3ffa5503b23e255d
+ .8byte 0x3ffa9e6b5579fdbf
+ .8byte 0x3ffae89f995ad3ad
+ .8byte 0x3ffb33a2b84f15fb
+ .8byte 0x3ffb7f76f2fb5e47
+ .8byte 0x3ffbcc1e904bc1d2
+ .8byte 0x3ffc199bdd85529c
+ .8byte 0x3ffc67f12e57d14b
+ .8byte 0x3ffcb720dcef9069
+ .8byte 0x3ffd072d4a07897c
+ .8byte 0x3ffd5818dcfba487
+ .8byte 0x3ffda9e603db3285
+ .8byte 0x3ffdfc97337b9b5f
+ .8byte 0x3ffe502ee78b3ff6
+ .8byte 0x3ffea4afa2a490da
+ .8byte 0x3ffefa1bee615a27
+ .8byte 0x3fff50765b6e4540
+ .8byte 0x3fffa7c1819e90d8
+
+.KLN2:
+ .8byte 0x40571547652b82fe /* Double precision K/log(2). */
+
+/* Double precision polynomial coefficients. */
+.P0:
+ .8byte 0x3fefffffffffe7c6
+.P1:
+ .8byte 0x3fe00000008d6118
+.P2:
+ .8byte 0x3fc55550da752d4f
+.P3:
+ .8byte 0x3fa56420eb78fa85
+
+.RS:
+ .8byte 0x4168000000000000 /* Double precision 2^23 + 2^22. */
+.NLN2K:
+ .8byte 0xbf862e42fefa39ef /* Double precision -log(2)/K. */
+.DP_EXP_BIAS:
+ .8byte 0x000000000000ffc0 /* Double precision exponent bias. */
+
+ .balign 4
+.SPone:
+ .4byte 0x3f800000 /* Single precision 1.0. */
+.SP_RS:
+ .4byte 0x4b400000 /* Single precision 2^23 + 2^22. */
+
+.SPRANGE: /* Single precision overflow/underflow bounds. */
+ .4byte 0x42b17217 /* if x>this bound, then result overflows. */
+ .4byte 0x42cff1b4 /* if x<this bound, then result underflows. */
+
+.SPLARGE_SMALL:
+ .4byte 0x71800000 /* 2^100. */
+ .4byte 0x0d800000 /* 2^-100. */
+
+.INF_ZERO:
+ .4byte 0x7f800000 /* Single precision Inf. */
+ .4byte 0 /* Single precision zero. */
+
+strong_alias (__ieee754_expf, __expf_finite)
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/power8/fpu/multiarch/Implies
deleted file mode 100644
index 7fd86fdf87..0000000000
--- a/sysdeps/powerpc/powerpc64/power8/fpu/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power7/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S
new file mode 100644
index 0000000000..af71382fb2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S
@@ -0,0 +1,509 @@
+/* Optimized cosf(). PowerPC64/POWER8 version.
+ Copyright (C) 2017-2018 Free Software 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 _ERRNO_H 1
+#include <bits/errno.h>
+#include <libm-alias-float.h>
+
+#define FRAMESIZE (FRAME_MIN_SIZE+16)
+
+#define FLOAT_EXPONENT_SHIFT 23
+#define FLOAT_EXPONENT_BIAS 127
+#define INTEGER_BITS 3
+
+#define PI_4 0x3f490fdb /* PI/4 */
+#define NINEPI_4 0x40e231d6 /* 9 * PI/4 */
+#define TWO_PN5 0x3d000000 /* 2^-5 */
+#define TWO_PN27 0x32000000 /* 2^-27 */
+#define INFINITY 0x7f800000
+#define TWO_P23 0x4b000000 /* 2^23 */
+#define FX_FRACTION_1_28 0x9249250 /* 0x100000000 / 28 + 1 */
+
+ /* Implements the function
+
+ float [fp1] cosf (float [fp1] x) */
+
+ .machine power8
+ENTRY (__cosf, 4)
+ addis r9,r2,L(anchor)@toc@ha
+ addi r9,r9,L(anchor)@toc@l
+
+ lis r4,PI_4@h
+ ori r4,r4,PI_4@l
+
+ xscvdpspn v0,v1
+ mfvsrd r8,v0
+ rldicl r3,r8,32,33 /* Remove sign bit. */
+
+ cmpw r3,r4
+ bge L(greater_or_equal_pio4)
+
+ lis r4,TWO_PN5@h
+ ori r4,r4,TWO_PN5@l
+
+ cmpw r3,r4
+ blt L(less_2pn5)
+
+ /* Chebyshev polynomial of the form:
+ * 1.0+x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))). */
+
+ lfd fp9,(L(C0)-L(anchor))(r9)
+ lfd fp10,(L(C1)-L(anchor))(r9)
+ lfd fp11,(L(C2)-L(anchor))(r9)
+ lfd fp12,(L(C3)-L(anchor))(r9)
+ lfd fp13,(L(C4)-L(anchor))(r9)
+
+ fmul fp2,fp1,fp1 /* x^2 */
+ lfd fp3,(L(DPone)-L(anchor))(r9)
+
+ fmadd fp4,fp2,fp13,fp12 /* C3+x^2*C4 */
+ fmadd fp4,fp2,fp4,fp11 /* C2+x^2*(C3+x^2*C4) */
+ fmadd fp4,fp2,fp4,fp10 /* C1+x^2*(C2+x^2*(C3+x^2*C4)) */
+ fmadd fp4,fp2,fp4,fp9 /* C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4))) */
+ fmadd fp1,fp2,fp4,fp3 /* 1.0+x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))) */
+ frsp fp1,fp1 /* Round to single precision. */
+
+ blr
+
+ .balign 16
+L(greater_or_equal_pio4):
+ lis r4,NINEPI_4@h
+ ori r4,r4,NINEPI_4@l
+ cmpw r3,r4
+ bge L(greater_or_equal_9pio4)
+
+ /* Calculate quotient of |x|/(PI/4). */
+ lfd fp2,(L(invpio4)-L(anchor))(r9)
+ fabs fp1,fp1 /* |x| */
+ fmul fp2,fp1,fp2 /* |x|/(PI/4) */
+ fctiduz fp2,fp2
+ mfvsrd r3,v2 /* n = |x| mod PI/4 */
+
+ /* Now use that quotient to find |x| mod (PI/2). */
+ addi r7,r3,1
+ rldicr r5,r7,2,60 /* ((n+1) >> 1) << 3 */
+ addi r6,r9,(L(pio2_table)-L(anchor))
+ lfdx fp4,r5,r6
+ fsub fp1,fp1,fp4
+
+ .balign 16
+L(reduced):
+ /* Now we are in the range -PI/4 to PI/4. */
+
+ /* Work out if we are in a positive or negative primary interval. */
+ addi r7,r7,2
+ rldicl r4,r7,62,63 /* ((n+3) >> 2) & 1 */
+
+ /* Load a 1.0 or -1.0. */
+ addi r5,r9,(L(ones)-L(anchor))
+ sldi r4,r4,3
+ lfdx fp0,r4,r5
+
+ /* Are we in the primary interval of sin or cos? */
+ andi. r4,r7,0x2
+ bne L(cos)
+
+ /* Chebyshev polynomial of the form:
+ x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))). */
+
+ lfd fp9,(L(S0)-L(anchor))(r9)
+ lfd fp10,(L(S1)-L(anchor))(r9)
+ lfd fp11,(L(S2)-L(anchor))(r9)
+ lfd fp12,(L(S3)-L(anchor))(r9)
+ lfd fp13,(L(S4)-L(anchor))(r9)
+
+ fmul fp2,fp1,fp1 /* x^2 */
+ fmul fp3,fp2,fp1 /* x^3 */
+
+ fmadd fp4,fp2,fp13,fp12 /* S3+x^2*S4 */
+ fmadd fp4,fp2,fp4,fp11 /* S2+x^2*(S3+x^2*S4) */
+ fmadd fp4,fp2,fp4,fp10 /* S1+x^2*(S2+x^2*(S3+x^2*S4)) */
+ fmadd fp4,fp2,fp4,fp9 /* S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4))) */
+ fmadd fp4,fp3,fp4,fp1 /* x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))) */
+ fmul fp4,fp4,fp0 /* Add in the sign. */
+ frsp fp1,fp4 /* Round to single precision. */
+
+ blr
+
+ .balign 16
+L(cos):
+ /* Chebyshev polynomial of the form:
+ 1.0+x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))). */
+
+ lfd fp9,(L(C0)-L(anchor))(r9)
+ lfd fp10,(L(C1)-L(anchor))(r9)
+ lfd fp11,(L(C2)-L(anchor))(r9)
+ lfd fp12,(L(C3)-L(anchor))(r9)
+ lfd fp13,(L(C4)-L(anchor))(r9)
+
+ fmul fp2,fp1,fp1 /* x^2 */
+ lfd fp3,(L(DPone)-L(anchor))(r9)
+
+ fmadd fp4,fp2,fp13,fp12 /* C3+x^2*C4 */
+ fmadd fp4,fp2,fp4,fp11 /* C2+x^2*(C3+x^2*C4) */
+ fmadd fp4,fp2,fp4,fp10 /* C1+x^2*(C2+x^2*(C3+x^2*C4)) */
+ fmadd fp4,fp2,fp4,fp9 /* C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4))) */
+ fmadd fp4,fp2,fp4,fp3 /* 1.0 + x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))) */
+ fmul fp4,fp4,fp0 /* Add in the sign. */
+ frsp fp1,fp4 /* Round to single precision. */
+
+ blr
+
+ .balign 16
+L(greater_or_equal_9pio4):
+ lis r4,INFINITY@h
+ ori r4,r4,INFINITY@l
+ cmpw r3,r4
+ bge L(inf_or_nan)
+
+ lis r4,TWO_P23@h
+ ori r4,r4,TWO_P23@l
+ cmpw r3,r4
+ bge L(greater_or_equal_2p23)
+
+ fabs fp1,fp1 /* |x| */
+
+ /* Calculate quotient of |x|/(PI/4). */
+ lfd fp2,(L(invpio4)-L(anchor))(r9)
+
+ lfd fp3,(L(DPone)-L(anchor))(r9)
+ lfd fp4,(L(DPhalf)-L(anchor))(r9)
+ fmul fp2,fp1,fp2 /* |x|/(PI/4) */
+ friz fp2,fp2 /* n = floor(|x|/(PI/4)) */
+
+ /* Calculate (n + 1) / 2. */
+ fadd fp2,fp2,fp3 /* n + 1 */
+ fmul fp3,fp2,fp4 /* (n + 1) / 2 */
+ friz fp3,fp3
+
+ lfd fp4,(L(pio2hi)-L(anchor))(r9)
+ lfd fp5,(L(pio2lo)-L(anchor))(r9)
+
+ fmul fp6,fp4,fp3
+ fadd fp6,fp6,fp1
+ fmadd fp1,fp5,fp3,fp6
+
+ fctiduz fp2,fp2
+ mfvsrd r7,v2 /* n + 1 */
+
+ b L(reduced)
+
+ .balign 16
+L(inf_or_nan):
+ bne L(skip_errno_setting) /* Is a NAN? */
+
+ /* We delayed the creation of the stack frame, as well as the saving of
+ the link register, because only at this point, we are sure that
+ doing so is actually needed. */
+
+ stfd fp1,-8(r1)
+
+ /* Save the link register. */
+ mflr r0
+ std r0,16(r1)
+ cfi_offset(lr, 16)
+
+ /* Create the stack frame. */
+ stdu r1,-FRAMESIZE(r1)
+ cfi_adjust_cfa_offset(FRAMESIZE)
+
+ bl JUMPTARGET(__errno_location)
+ nop
+
+ /* Restore the stack frame. */
+ addi r1,r1,FRAMESIZE
+ cfi_adjust_cfa_offset(-FRAMESIZE)
+ /* Restore the link register. */
+ ld r0,16(r1)
+ mtlr r0
+
+ lfd fp1,-8(r1)
+
+ /* errno = EDOM */
+ li r4,EDOM
+ stw r4,0(r3)
+
+L(skip_errno_setting):
+ fsub fp1,fp1,fp1 /* x - x */
+ blr
+
+ .balign 16
+L(greater_or_equal_2p23):
+ fabs fp1,fp1
+
+ srwi r4,r3,FLOAT_EXPONENT_SHIFT
+ subi r4,r4,FLOAT_EXPONENT_BIAS
+
+ /* We reduce the input modulo pi/4, so we need 3 bits of integer
+ to determine where in 2*pi we are. Index into our array
+ accordingly. */
+ addi r4,r4,INTEGER_BITS
+
+ /* To avoid an expensive divide, for the range we care about (0 - 127)
+ we can transform x/28 into:
+
+ x/28 = (x * ((0x100000000 / 28) + 1)) >> 32
+
+ mulhwu returns the top 32 bits of the 64 bit result, doing the
+ shift for us in the same instruction. The top 32 bits are undefined,
+ so we have to mask them. */
+
+ lis r6,FX_FRACTION_1_28@h
+ ori r6,r6,FX_FRACTION_1_28@l
+ mulhwu r5,r4,r6
+ clrldi r5,r5,32
+
+ /* Get our pointer into the invpio4_table array. */
+ sldi r4,r5,3
+ addi r6,r9,(L(invpio4_table)-L(anchor))
+ add r4,r4,r6
+
+ lfd fp2,0(r4)
+ lfd fp3,8(r4)
+ lfd fp4,16(r4)
+ lfd fp5,24(r4)
+
+ fmul fp6,fp2,fp1
+ fmul fp7,fp3,fp1
+ fmul fp8,fp4,fp1
+ fmul fp9,fp5,fp1
+
+ /* Mask off larger integer bits in highest double word that we don't
+ care about to avoid losing precision when combining with smaller
+ values. */
+ fctiduz fp10,fp6
+ mfvsrd r7,v10
+ rldicr r7,r7,0,(63-INTEGER_BITS)
+ mtvsrd v10,r7
+ fcfidu fp10,fp10 /* Integer bits. */
+
+ fsub fp6,fp6,fp10 /* highest -= integer bits */
+
+ /* Work out the integer component, rounded down. Use the top two
+ limbs for this. */
+ fadd fp10,fp6,fp7 /* highest + higher */
+
+ fctiduz fp10,fp10
+ mfvsrd r7,v10
+ andi. r0,r7,1
+ fcfidu fp10,fp10
+
+ /* Subtract integer component from highest limb. */
+ fsub fp12,fp6,fp10
+
+ beq L(even_integer)
+
+ /* Our integer component is odd, so we are in the -PI/4 to 0 primary
+ region. We need to shift our result down by PI/4, and to do this
+ in the mod (4/PI) space we simply subtract 1. */
+ lfd fp11,(L(DPone)-L(anchor))(r9)
+ fsub fp12,fp12,fp11
+
+ /* Now add up all the limbs in order. */
+ fadd fp12,fp12,fp7
+ fadd fp12,fp12,fp8
+ fadd fp12,fp12,fp9
+
+ /* And finally multiply by pi/4. */
+ lfd fp13,(L(pio4)-L(anchor))(r9)
+ fmul fp1,fp12,fp13
+
+ addi r7,r7,1
+ b L(reduced)
+
+L(even_integer):
+ lfd fp11,(L(DPone)-L(anchor))(r9)
+
+ /* Now add up all the limbs in order. */
+ fadd fp12,fp12,fp7
+ fadd fp12,r12,fp8
+ fadd fp12,r12,fp9
+
+ /* We need to check if the addition of all the limbs resulted in us
+ overflowing 1.0. */
+ fcmpu 0,fp12,fp11
+ bgt L(greater_than_one)
+
+ /* And finally multiply by pi/4. */
+ lfd fp13,(L(pio4)-L(anchor))(r9)
+ fmul fp1,fp12,fp13
+
+ addi r7,r7,1
+ b L(reduced)
+
+L(greater_than_one):
+ /* We did overflow 1.0 when adding up all the limbs. Add 1.0 to our
+ integer, and subtract 1.0 from our result. Since that makes the
+ integer component odd, we need to subtract another 1.0 as
+ explained above. */
+ addi r7,r7,1
+
+ lfd fp11,(L(DPtwo)-L(anchor))(r9)
+ fsub fp12,fp12,fp11
+
+ /* And finally multiply by pi/4. */
+ lfd fp13,(L(pio4)-L(anchor))(r9)
+ fmul fp1,fp12,fp13
+
+ addi r7,r7,1
+ b L(reduced)
+
+ .balign 16
+L(less_2pn5):
+ lis r4,TWO_PN27@h
+ ori r4,r4,TWO_PN27@l
+
+ cmpw r3,r4
+ blt L(less_2pn27)
+
+ /* A simpler Chebyshev approximation is close enough for this range:
+ 1.0+x^2*(CC0+x^3*CC1). */
+
+ lfd fp10,(L(CC0)-L(anchor))(r9)
+ lfd fp11,(L(CC1)-L(anchor))(r9)
+
+ fmul fp2,fp1,fp1 /* x^2 */
+ fmul fp3,fp2,fp1 /* x^3 */
+ lfd fp1,(L(DPone)-L(anchor))(r9)
+
+ fmadd fp4,fp3,fp11,fp10 /* CC0+x^3*CC1 */
+ fmadd fp1,fp2,fp4,fp1 /* 1.0+x^2*(CC0+x^3*CC1) */
+
+ frsp fp1,fp1 /* Round to single precision. */
+
+ blr
+
+ .balign 16
+L(less_2pn27):
+ /* Handle some special cases:
+
+ cosf(subnormal) raises inexact
+ cosf(min_normalized) raises inexact
+ cosf(normalized) raises inexact. */
+
+ lfd fp2,(L(DPone)-L(anchor))(r9)
+
+ fabs fp1,fp1 /* |x| */
+ fsub fp1,fp2,fp1 /* 1.0-|x| */
+
+ frsp fp1,fp1
+
+ blr
+
+END (__cosf)
+
+ .section .rodata, "a"
+
+ .balign 8
+
+L(anchor):
+
+ /* Chebyshev constants for sin, range -PI/4 - PI/4. */
+L(S0): .8byte 0xbfc5555555551cd9
+L(S1): .8byte 0x3f81111110c2688b
+L(S2): .8byte 0xbf2a019f8b4bd1f9
+L(S3): .8byte 0x3ec71d7264e6b5b4
+L(S4): .8byte 0xbe5a947e1674b58a
+
+ /* Chebyshev constants for cos, range 2^-27 - 2^-5. */
+L(CC0): .8byte 0xbfdfffffff5cc6fd
+L(CC1): .8byte 0x3fa55514b178dac5
+
+ /* Chebyshev constants for cos, range -PI/4 - PI/4. */
+L(C0): .8byte 0xbfdffffffffe98ae
+L(C1): .8byte 0x3fa55555545c50c7
+L(C2): .8byte 0xbf56c16b348b6874
+L(C3): .8byte 0x3efa00eb9ac43cc0
+L(C4): .8byte 0xbe923c97dd8844d7
+
+L(invpio2):
+ .8byte 0x3fe45f306dc9c883 /* 2/PI */
+
+L(invpio4):
+ .8byte 0x3ff45f306dc9c883 /* 4/PI */
+
+L(invpio4_table):
+ .8byte 0x0000000000000000
+ .8byte 0x3ff45f306c000000
+ .8byte 0x3e3c9c882a000000
+ .8byte 0x3c54fe13a8000000
+ .8byte 0x3aaf47d4d0000000
+ .8byte 0x38fbb81b6c000000
+ .8byte 0x3714acc9e0000000
+ .8byte 0x3560e4107c000000
+ .8byte 0x33bca2c756000000
+ .8byte 0x31fbd778ac000000
+ .8byte 0x300b7246e0000000
+ .8byte 0x2e5d2126e8000000
+ .8byte 0x2c97003248000000
+ .8byte 0x2ad77504e8000000
+ .8byte 0x290921cfe0000000
+ .8byte 0x274deb1cb0000000
+ .8byte 0x25829a73e0000000
+ .8byte 0x23fd1046be000000
+ .8byte 0x2224baed10000000
+ .8byte 0x20709d338e000000
+ .8byte 0x1e535a2f80000000
+ .8byte 0x1cef904e64000000
+ .8byte 0x1b0d639830000000
+ .8byte 0x1964ce7d24000000
+ .8byte 0x17b908bf16000000
+
+L(pio4):
+ .8byte 0x3fe921fb54442d18 /* PI/4 */
+
+/* PI/2 as a sum of two doubles. We only use 32 bits of the upper limb
+ to avoid losing significant bits when multiplying with up to
+ (2^22)/(pi/2). */
+L(pio2hi):
+ .8byte 0xbff921fb54400000
+
+L(pio2lo):
+ .8byte 0xbdd0b4611a626332
+
+L(pio2_table):
+ .8byte 0
+ .8byte 0x3ff921fb54442d18 /* 1 * PI/2 */
+ .8byte 0x400921fb54442d18 /* 2 * PI/2 */
+ .8byte 0x4012d97c7f3321d2 /* 3 * PI/2 */
+ .8byte 0x401921fb54442d18 /* 4 * PI/2 */
+ .8byte 0x401f6a7a2955385e /* 5 * PI/2 */
+ .8byte 0x4022d97c7f3321d2 /* 6 * PI/2 */
+ .8byte 0x4025fdbbe9bba775 /* 7 * PI/2 */
+ .8byte 0x402921fb54442d18 /* 8 * PI/2 */
+ .8byte 0x402c463abeccb2bb /* 9 * PI/2 */
+ .8byte 0x402f6a7a2955385e /* 10 * PI/2 */
+
+L(small):
+ .8byte 0x3cd0000000000000 /* 2^-50 */
+
+L(ones):
+ .8byte 0x3ff0000000000000 /* +1.0 */
+ .8byte 0xbff0000000000000 /* -1.0 */
+
+L(DPhalf):
+ .8byte 0x3fe0000000000000 /* 0.5 */
+
+L(DPone):
+ .8byte 0x3ff0000000000000 /* 1.0 */
+
+L(DPtwo):
+ .8byte 0x4000000000000000 /* 2.0 */
+
+libm_alias_float (__cos, cos)
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
index 3b0c88e5eb..aac54a9364 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S
@@ -1,5 +1,5 @@
/* isfinite(). PowerPC64/POWER8 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
/* int [r3] __finite ([fp1] x) */
-EALIGN (__finite, 4, 0)
+ENTRY_TOCLESS (__finite, 4)
CALL_MCOUNT 0
MFVSRD_R3_V1
lis r9,0x8010
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
index 4708239689..94746ef068 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S
@@ -1,5 +1,5 @@
/* isinf(). PowerPC64/POWER8 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
/* int [r3] __isinf([fp1] x) */
-EALIGN (__isinf, 4, 0)
+ENTRY_TOCLESS (__isinf, 4)
CALL_MCOUNT 0
MFVSRD_R3_V1
lis r9,0x7ff0 /* r9 = 0x7ff0 */
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
index 0e5c19333c..8aef354f68 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). PowerPC64/POWER8 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
/* int [r3] __isnan([f1] x) */
-EALIGN (__isnan, 4, 0)
+ENTRY_TOCLESS (__isnan, 4)
CALL_MCOUNT 0
MFVSRD_R3_V1
lis r9,0x7ff0
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S
index 0af9feee5a..7f18d705a9 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S
@@ -1,5 +1,5 @@
/* Round double to long int. POWER8 PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,11 +18,13 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
#define MFVSRD_R3_V1 .long 0x7c230066 /* mfvsrd r3,vs1 */
/* long long int[r3] __llrint (double x[fp1]) */
-ENTRY (__llrint)
+ENTRY_TOCLESS (__llrint)
CALL_MCOUNT 0
fctid fp1,fp1
MFVSRD_R3_V1
@@ -30,16 +32,12 @@ ENTRY (__llrint)
END (__llrint)
strong_alias (__llrint, __lrint)
-weak_alias (__llrint, llrint)
-weak_alias (__lrint, lrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
+libm_alias_double (__llrint, llrint)
+libm_alias_double (__lrint, lrint)
+/* The double version also works for single-precision as both float and
+ double parameters are passed in 64bit FPRs and both versions are expected
+ to return [long] long type. */
+strong_alias (__llrint, __llrintf)
+libm_alias_float (__llrint, llrint)
+strong_alias (__lrint, __lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
index af2409deb8..a22fc63bb3 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
@@ -1,5 +1,5 @@
/* llround function. POWER8 PowerPC64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,12 +19,14 @@
#include <sysdep.h>
#include <endian.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-float.h>
+#include <libm-alias-double.h>
#define MFVSRD_R3_V1 .long 0x7c230066 /* mfvsrd r3,vs1 */
/* long long [r3] llround (float x [fp1]) */
-ENTRY (__llround)
+ENTRY_TOCLESS (__llround)
CALL_MCOUNT 0
frin fp1,fp1 /* Round to nearest +-0.5. */
fctidz fp1,fp1 /* Convert To Integer DW round toward 0. */
@@ -33,16 +35,12 @@ ENTRY (__llround)
END (__llround)
strong_alias (__llround, __lround)
-weak_alias (__llround, llround)
-weak_alias (__lround, lround)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__llround, llroundl)
-strong_alias (__llround, __llroundl)
-weak_alias (__lround, lroundl)
-strong_alias (__lround, __lroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
-#endif
+libm_alias_double (__llround, llround)
+libm_alias_double (__lround, lround)
+/* The double version also works for single-precision as both float and
+ double parameters are passed in 64bit FPRs and both versions are expected
+ to return [long] long type. */
+strong_alias (__llround, __llroundf)
+libm_alias_float (__llround, llround)
+strong_alias (__lround, __lroundf)
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llroundf.S
new file mode 100644
index 0000000000..9ea6bd105b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_llroundf.S
@@ -0,0 +1 @@
+/* __lroundf is in s_llround.S. */
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S
new file mode 100644
index 0000000000..59e613c102
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S
@@ -0,0 +1,520 @@
+/* Optimized sinf(). PowerPC64/POWER8 version.
+ Copyright (C) 2016-2018 Free Software 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 _ERRNO_H 1
+#include <bits/errno.h>
+#include <libm-alias-float.h>
+
+#define FRAMESIZE (FRAME_MIN_SIZE+16)
+
+#define FLOAT_EXPONENT_SHIFT 23
+#define FLOAT_EXPONENT_BIAS 127
+#define INTEGER_BITS 3
+
+#define PI_4 0x3f490fdb /* PI/4 */
+#define NINEPI_4 0x40e231d6 /* 9 * PI/4 */
+#define TWO_PN5 0x3d000000 /* 2^-5 */
+#define TWO_PN27 0x32000000 /* 2^-27 */
+#define INFINITY 0x7f800000
+#define TWO_P23 0x4b000000 /* 2^27 */
+#define FX_FRACTION_1_28 0x9249250 /* 0x100000000 / 28 + 1 */
+
+ /* Implements the function
+
+ float [fp1] sinf (float [fp1] x) */
+
+ .machine power8
+ENTRY (__sinf, 4)
+ addis r9,r2,L(anchor)@toc@ha
+ addi r9,r9,L(anchor)@toc@l
+
+ lis r4,PI_4@h
+ ori r4,r4,PI_4@l
+
+ xscvdpspn v0,v1
+ mfvsrd r8,v0
+ rldicl r3,r8,32,33 /* Remove sign bit. */
+
+ cmpw r3,r4
+ bge L(greater_or_equal_pio4)
+
+ lis r4,TWO_PN5@h
+ ori r4,r4,TWO_PN5@l
+
+ cmpw r3,r4
+ blt L(less_2pn5)
+
+ /* Chebyshev polynomial of the form:
+ * x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))). */
+
+ lfd fp9,(L(S0)-L(anchor))(r9)
+ lfd fp10,(L(S1)-L(anchor))(r9)
+ lfd fp11,(L(S2)-L(anchor))(r9)
+ lfd fp12,(L(S3)-L(anchor))(r9)
+ lfd fp13,(L(S4)-L(anchor))(r9)
+
+ fmul fp2,fp1,fp1 /* x^2 */
+ fmul fp3,fp2,fp1 /* x^3 */
+
+ fmadd fp4,fp2,fp13,fp12 /* S3+x^2*S4 */
+ fmadd fp4,fp2,fp4,fp11 /* S2+x^2*(S3+x^2*S4) */
+ fmadd fp4,fp2,fp4,fp10 /* S1+x^2*(S2+x^2*(S3+x^2*S4)) */
+ fmadd fp4,fp2,fp4,fp9 /* S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4))) */
+ fmadd fp1,fp3,fp4,fp1 /* x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))) */
+ frsp fp1,fp1 /* Round to single precision. */
+
+ blr
+
+ .balign 16
+L(greater_or_equal_pio4):
+ lis r4,NINEPI_4@h
+ ori r4,r4,NINEPI_4@l
+ cmpw r3,r4
+ bge L(greater_or_equal_9pio4)
+
+ /* Calculate quotient of |x|/(PI/4). */
+ lfd fp2,(L(invpio4)-L(anchor))(r9)
+ fabs fp1,fp1 /* |x| */
+ fmul fp2,fp1,fp2 /* |x|/(PI/4) */
+ fctiduz fp2,fp2
+ mfvsrd r3,v2 /* n = |x| mod PI/4 */
+
+ /* Now use that quotient to find |x| mod (PI/2). */
+ addi r7,r3,1
+ rldicr r5,r7,2,60 /* ((n+1) >> 1) << 3 */
+ addi r6,r9,(L(pio2_table)-L(anchor))
+ lfdx fp4,r5,r6
+ fsub fp1,fp1,fp4
+
+ .balign 16
+L(reduced):
+ /* Now we are in the range -PI/4 to PI/4. */
+
+ /* Work out if we are in a positive or negative primary interval. */
+ rldicl r4,r7,62,63 /* ((n+1) >> 2) & 1 */
+
+ /* We are operating on |x|, so we need to add back the original
+ sign. */
+ rldicl r8,r8,33,63 /* (x >> 31) & 1, ie the sign bit. */
+ xor r4,r4,r8 /* 0 if result should be positive,
+ 1 if negative. */
+
+ /* Load a 1.0 or -1.0. */
+ addi r5,r9,(L(ones)-L(anchor))
+ sldi r4,r4,3
+ lfdx fp0,r4,r5
+
+ /* Are we in the primary interval of sin or cos? */
+ andi. r4,r7,0x2
+ bne L(cos)
+
+ /* Chebyshev polynomial of the form:
+ x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))). */
+
+ lfd fp9,(L(S0)-L(anchor))(r9)
+ lfd fp10,(L(S1)-L(anchor))(r9)
+ lfd fp11,(L(S2)-L(anchor))(r9)
+ lfd fp12,(L(S3)-L(anchor))(r9)
+ lfd fp13,(L(S4)-L(anchor))(r9)
+
+ fmul fp2,fp1,fp1 /* x^2 */
+ fmul fp3,fp2,fp1 /* x^3 */
+
+ fmadd fp4,fp2,fp13,fp12 /* S3+x^2*S4 */
+ fmadd fp4,fp2,fp4,fp11 /* S2+x^2*(S3+x^2*S4) */
+ fmadd fp4,fp2,fp4,fp10 /* S1+x^2*(S2+x^2*(S3+x^2*S4)) */
+ fmadd fp4,fp2,fp4,fp9 /* S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4))) */
+ fmadd fp4,fp3,fp4,fp1 /* x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))) */
+ fmul fp4,fp4,fp0 /* Add in the sign. */
+ frsp fp1,fp4 /* Round to single precision. */
+
+ blr
+
+ .balign 16
+L(cos):
+ /* Chebyshev polynomial of the form:
+ 1.0+x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))). */
+
+ lfd fp9,(L(C0)-L(anchor))(r9)
+ lfd fp10,(L(C1)-L(anchor))(r9)
+ lfd fp11,(L(C2)-L(anchor))(r9)
+ lfd fp12,(L(C3)-L(anchor))(r9)
+ lfd fp13,(L(C4)-L(anchor))(r9)
+
+ fmul fp2,fp1,fp1 /* x^2 */
+ lfd fp3,(L(DPone)-L(anchor))(r9)
+
+ fmadd fp4,fp2,fp13,fp12 /* C3+x^2*C4 */
+ fmadd fp4,fp2,fp4,fp11 /* C2+x^2*(C3+x^2*C4) */
+ fmadd fp4,fp2,fp4,fp10 /* C1+x^2*(C2+x^2*(C3+x^2*C4)) */
+ fmadd fp4,fp2,fp4,fp9 /* C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4))) */
+ fmadd fp4,fp2,fp4,fp3 /* 1.0 + x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))) */
+ fmul fp4,fp4,fp0 /* Add in the sign. */
+ frsp fp1,fp4 /* Round to single precision. */
+
+ blr
+
+ .balign 16
+L(greater_or_equal_9pio4):
+ lis r4,INFINITY@h
+ ori r4,r4,INFINITY@l
+ cmpw r3,r4
+ bge L(inf_or_nan)
+
+ lis r4,TWO_P23@h
+ ori r4,r4,TWO_P23@l
+ cmpw r3,r4
+ bge L(greater_or_equal_2p23)
+
+ fabs fp1,fp1 /* |x| */
+
+ /* Calculate quotient of |x|/(PI/4). */
+ lfd fp2,(L(invpio4)-L(anchor))(r9)
+
+ lfd fp3,(L(DPone)-L(anchor))(r9)
+ lfd fp4,(L(DPhalf)-L(anchor))(r9)
+ fmul fp2,fp1,fp2 /* |x|/(PI/4) */
+ friz fp2,fp2 /* n = floor(|x|/(PI/4)) */
+
+ /* Calculate (n + 1) / 2. */
+ fadd fp2,fp2,fp3 /* n + 1 */
+ fmul fp3,fp2,fp4 /* (n + 1) / 2 */
+ friz fp3,fp3
+
+ lfd fp4,(L(pio2hi)-L(anchor))(r9)
+ lfd fp5,(L(pio2lo)-L(anchor))(r9)
+
+ fmul fp6,fp4,fp3
+ fadd fp6,fp6,fp1
+ fmadd fp1,fp5,fp3,fp6
+
+ fctiduz fp2,fp2
+ mfvsrd r7,v2 /* n + 1 */
+
+ b L(reduced)
+
+ .balign 16
+L(inf_or_nan):
+ bne L(skip_errno_setting) /* Is a NAN? */
+
+ /* We delayed the creation of the stack frame, as well as the saving of
+ the link register, because only at this point, we are sure that
+ doing so is actually needed. */
+
+ stfd fp1,-8(r1)
+
+ /* Save the link register. */
+ mflr r0
+ std r0,16(r1)
+ cfi_offset(lr, 16)
+
+ /* Create the stack frame. */
+ stdu r1,-FRAMESIZE(r1)
+ cfi_adjust_cfa_offset(FRAMESIZE)
+
+ bl JUMPTARGET(__errno_location)
+ nop
+
+ /* Restore the stack frame. */
+ addi r1,r1,FRAMESIZE
+ cfi_adjust_cfa_offset(-FRAMESIZE)
+ /* Restore the link register. */
+ ld r0,16(r1)
+ mtlr r0
+
+ lfd fp1,-8(r1)
+
+ /* errno = EDOM */
+ li r4,EDOM
+ stw r4,0(r3)
+
+L(skip_errno_setting):
+ fsub fp1,fp1,fp1 /* x - x */
+ blr
+
+ .balign 16
+L(greater_or_equal_2p23):
+ fabs fp1,fp1
+
+ srwi r4,r3,FLOAT_EXPONENT_SHIFT
+ subi r4,r4,FLOAT_EXPONENT_BIAS
+
+ /* We reduce the input modulo pi/4, so we need 3 bits of integer
+ to determine where in 2*pi we are. Index into our array
+ accordingly. */
+ addi r4,r4,INTEGER_BITS
+
+ /* To avoid an expensive divide, for the range we care about (0 - 127)
+ we can transform x/28 into:
+
+ x/28 = (x * ((0x100000000 / 28) + 1)) >> 32
+
+ mulhwu returns the top 32 bits of the 64 bit result, doing the
+ shift for us in the same instruction. The top 32 bits are undefined,
+ so we have to mask them. */
+
+ lis r6,FX_FRACTION_1_28@h
+ ori r6,r6,FX_FRACTION_1_28@l
+ mulhwu r5,r4,r6
+ clrldi r5,r5,32
+
+ /* Get our pointer into the invpio4_table array. */
+ sldi r4,r5,3
+ addi r6,r9,(L(invpio4_table)-L(anchor))
+ add r4,r4,r6
+
+ lfd fp2,0(r4)
+ lfd fp3,8(r4)
+ lfd fp4,16(r4)
+ lfd fp5,24(r4)
+
+ fmul fp6,fp2,fp1
+ fmul fp7,fp3,fp1
+ fmul fp8,fp4,fp1
+ fmul fp9,fp5,fp1
+
+ /* Mask off larger integer bits in highest double word that we don't
+ care about to avoid losing precision when combining with smaller
+ values. */
+ fctiduz fp10,fp6
+ mfvsrd r7,v10
+ rldicr r7,r7,0,(63-INTEGER_BITS)
+ mtvsrd v10,r7
+ fcfidu fp10,fp10 /* Integer bits. */
+
+ fsub fp6,fp6,fp10 /* highest -= integer bits */
+
+ /* Work out the integer component, rounded down. Use the top two
+ limbs for this. */
+ fadd fp10,fp6,fp7 /* highest + higher */
+
+ fctiduz fp10,fp10
+ mfvsrd r7,v10
+ andi. r0,r7,1
+ fcfidu fp10,fp10
+
+ /* Subtract integer component from highest limb. */
+ fsub fp12,fp6,fp10
+
+ beq L(even_integer)
+
+ /* Our integer component is odd, so we are in the -PI/4 to 0 primary
+ region. We need to shift our result down by PI/4, and to do this
+ in the mod (4/PI) space we simply subtract 1. */
+ lfd fp11,(L(DPone)-L(anchor))(r9)
+ fsub fp12,fp12,fp11
+
+ /* Now add up all the limbs in order. */
+ fadd fp12,fp12,fp7
+ fadd fp12,fp12,fp8
+ fadd fp12,fp12,fp9
+
+ /* And finally multiply by pi/4. */
+ lfd fp13,(L(pio4)-L(anchor))(r9)
+ fmul fp1,fp12,fp13
+
+ addi r7,r7,1
+ b L(reduced)
+
+L(even_integer):
+ lfd fp11,(L(DPone)-L(anchor))(r9)
+
+ /* Now add up all the limbs in order. */
+ fadd fp12,fp12,fp7
+ fadd fp12,r12,fp8
+ fadd fp12,r12,fp9
+
+ /* We need to check if the addition of all the limbs resulted in us
+ overflowing 1.0. */
+ fcmpu 0,fp12,fp11
+ bgt L(greater_than_one)
+
+ /* And finally multiply by pi/4. */
+ lfd fp13,(L(pio4)-L(anchor))(r9)
+ fmul fp1,fp12,fp13
+
+ addi r7,r7,1
+ b L(reduced)
+
+L(greater_than_one):
+ /* We did overflow 1.0 when adding up all the limbs. Add 1.0 to our
+ integer, and subtract 1.0 from our result. Since that makes the
+ integer component odd, we need to subtract another 1.0 as
+ explained above. */
+ addi r7,r7,1
+
+ lfd fp11,(L(DPtwo)-L(anchor))(r9)
+ fsub fp12,fp12,fp11
+
+ /* And finally multiply by pi/4. */
+ lfd fp13,(L(pio4)-L(anchor))(r9)
+ fmul fp1,fp12,fp13
+
+ addi r7,r7,1
+ b L(reduced)
+
+ .balign 16
+L(less_2pn5):
+ lis r4,TWO_PN27@h
+ ori r4,r4,TWO_PN27@l
+
+ cmpw r3,r4
+ blt L(less_2pn27)
+
+ /* A simpler Chebyshev approximation is close enough for this range:
+ x+x^3*(SS0+x^2*SS1). */
+
+ lfd fp10,(L(SS0)-L(anchor))(r9)
+ lfd fp11,(L(SS1)-L(anchor))(r9)
+
+ fmul fp2,fp1,fp1 /* x^2 */
+ fmul fp3,fp2,fp1 /* x^3 */
+
+ fmadd fp4,fp2,fp11,fp10 /* SS0+x^2*SS1 */
+ fmadd fp1,fp3,fp4,fp1 /* x+x^3*(SS0+x^2*SS1) */
+
+ frsp fp1,fp1 /* Round to single precision. */
+
+ blr
+
+ .balign 16
+L(less_2pn27):
+ cmpwi r3,0
+ beq L(zero)
+
+ /* Handle some special cases:
+
+ sinf(subnormal) raises inexact/underflow
+ sinf(min_normalized) raises inexact/underflow
+ sinf(normalized) raises inexact. */
+
+ lfd fp2,(L(small)-L(anchor))(r9)
+
+ fmul fp2,fp1,fp2 /* x * small */
+ fsub fp1,fp1,fp2 /* x - x * small */
+
+ frsp fp1,fp1
+
+ blr
+
+ .balign 16
+L(zero):
+ blr
+
+END (__sinf)
+
+ .section .rodata, "a"
+
+ .balign 8
+
+L(anchor):
+
+ /* Chebyshev constants for sin, range -PI/4 - PI/4. */
+L(S0): .8byte 0xbfc5555555551cd9
+L(S1): .8byte 0x3f81111110c2688b
+L(S2): .8byte 0xbf2a019f8b4bd1f9
+L(S3): .8byte 0x3ec71d7264e6b5b4
+L(S4): .8byte 0xbe5a947e1674b58a
+
+ /* Chebyshev constants for sin, range 2^-27 - 2^-5. */
+L(SS0): .8byte 0xbfc555555543d49d
+L(SS1): .8byte 0x3f8110f475cec8c5
+
+ /* Chebyshev constants for cos, range -PI/4 - PI/4. */
+L(C0): .8byte 0xbfdffffffffe98ae
+L(C1): .8byte 0x3fa55555545c50c7
+L(C2): .8byte 0xbf56c16b348b6874
+L(C3): .8byte 0x3efa00eb9ac43cc0
+L(C4): .8byte 0xbe923c97dd8844d7
+
+L(invpio2):
+ .8byte 0x3fe45f306dc9c883 /* 2/PI */
+
+L(invpio4):
+ .8byte 0x3ff45f306dc9c883 /* 4/PI */
+
+L(invpio4_table):
+ .8byte 0x0000000000000000
+ .8byte 0x3ff45f306c000000
+ .8byte 0x3e3c9c882a000000
+ .8byte 0x3c54fe13a8000000
+ .8byte 0x3aaf47d4d0000000
+ .8byte 0x38fbb81b6c000000
+ .8byte 0x3714acc9e0000000
+ .8byte 0x3560e4107c000000
+ .8byte 0x33bca2c756000000
+ .8byte 0x31fbd778ac000000
+ .8byte 0x300b7246e0000000
+ .8byte 0x2e5d2126e8000000
+ .8byte 0x2c97003248000000
+ .8byte 0x2ad77504e8000000
+ .8byte 0x290921cfe0000000
+ .8byte 0x274deb1cb0000000
+ .8byte 0x25829a73e0000000
+ .8byte 0x23fd1046be000000
+ .8byte 0x2224baed10000000
+ .8byte 0x20709d338e000000
+ .8byte 0x1e535a2f80000000
+ .8byte 0x1cef904e64000000
+ .8byte 0x1b0d639830000000
+ .8byte 0x1964ce7d24000000
+ .8byte 0x17b908bf16000000
+
+L(pio4):
+ .8byte 0x3fe921fb54442d18 /* PI/4 */
+
+/* PI/2 as a sum of two doubles. We only use 32 bits of the upper limb
+ to avoid losing significant bits when multiplying with up to
+ (2^22)/(pi/2). */
+L(pio2hi):
+ .8byte 0xbff921fb54400000
+
+L(pio2lo):
+ .8byte 0xbdd0b4611a626332
+
+L(pio2_table):
+ .8byte 0
+ .8byte 0x3ff921fb54442d18 /* 1 * PI/2 */
+ .8byte 0x400921fb54442d18 /* 2 * PI/2 */
+ .8byte 0x4012d97c7f3321d2 /* 3 * PI/2 */
+ .8byte 0x401921fb54442d18 /* 4 * PI/2 */
+ .8byte 0x401f6a7a2955385e /* 5 * PI/2 */
+ .8byte 0x4022d97c7f3321d2 /* 6 * PI/2 */
+ .8byte 0x4025fdbbe9bba775 /* 7 * PI/2 */
+ .8byte 0x402921fb54442d18 /* 8 * PI/2 */
+ .8byte 0x402c463abeccb2bb /* 9 * PI/2 */
+ .8byte 0x402f6a7a2955385e /* 10 * PI/2 */
+
+L(small):
+ .8byte 0x3cd0000000000000 /* 2^-50 */
+
+L(ones):
+ .8byte 0x3ff0000000000000 /* +1.0 */
+ .8byte 0xbff0000000000000 /* -1.0 */
+
+L(DPhalf):
+ .8byte 0x3fe0000000000000 /* 0.5 */
+
+L(DPone):
+ .8byte 0x3ff0000000000000 /* 1.0 */
+
+L(DPtwo):
+ .8byte 0x4000000000000000 /* 2.0 */
+
+libm_alias_float (__sin, sin)
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c b/sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c
new file mode 100644
index 0000000000..b5fe164520
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_expf.c>
diff --git a/sysdeps/powerpc/powerpc64/power8/memchr.S b/sysdeps/powerpc/powerpc64/power8/memchr.S
new file mode 100644
index 0000000000..45ba1b479a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/memchr.S
@@ -0,0 +1,335 @@
+/* Optimized memchr implementation for POWER8.
+ Copyright (C) 2017-2018 Free Software 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>
+
+/* void *[r3] memchr (const void *s [r3], int c [r4], size_t n [r5]) */
+
+/* TODO: change these to the actual instructions when the minimum required
+ binutils allows it. */
+#define MTVRD(v, r) .long (0x7c000167 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#define MFVRD(r, v) .long (0x7c000067 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#define VBPERMQ(t, a, b) .long (0x1000054c \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+
+#ifndef MEMCHR
+# define MEMCHR __memchr
+#endif
+/* TODO: change this to .machine power8 when the minimum required binutils
+ allows it. */
+ .machine power7
+ENTRY_TOCLESS (MEMCHR)
+ CALL_MCOUNT 3
+ dcbt 0, r3
+ clrrdi r8, r3, 3
+ insrdi r4, r4, 8, 48
+
+ /* Calculate the last acceptable address and check for possible
+ addition overflow by using satured math:
+ r7 = r3 + r5
+ r7 |= -(r7 < x) */
+ add r7, r3, r5
+ subfc r6, r3, r7
+ subfe r9, r9, r9
+ extsw r6, r9
+ or r7, r7, r6
+
+ insrdi r4, r4, 16, 32
+ cmpldi r5, 32
+ li r9, -1
+ rlwinm r6, r3, 3, 26, 28 /* Calculate padding. */
+ insrdi r4, r4, 32, 0
+ mr r10, r7
+ addi r7, r7, -1
+#ifdef __LITTLE_ENDIAN__
+ sld r9, r9, r6
+#else
+ srd r9, r9, r6
+#endif
+ ble L(small_range)
+ andi. r11, r3, 63
+ beq cr0, L(align_qw)
+ clrldi r11, r3, 61
+ ld r12, 0(r8) /* Load doubleword from memory. */
+ cmpb r3, r12, r4 /* Check for BYTEs in DWORD1. */
+ and r3, r3, r9
+ clrldi r6, r7, 61 /* Byte count - 1 in last dword. */
+ clrrdi r7, r7, 3 /* Address of last doubleword. */
+ cmpldi cr7, r3, 0 /* Does r3 indicate we got a hit? */
+ bne cr7, L(done)
+ addi r8, r8, 8
+ addi r5, r5, -8
+ add r5, r5, r11
+
+ /* Are we now aligned to a quadword boundary? */
+ andi. r11, r8, 15
+ beq cr0, L(align_qw)
+
+ /* Handle DWORD to make it QW aligned. */
+ ld r12, 0(r8)
+ cmpb r3, r12, r4
+ cmpldi cr7, r3, 0
+ bne cr7, L(done)
+ addi r5, r5, -8
+ addi r8, r8, 8
+ /* At this point, r8 is 16B aligned. */
+L(align_qw):
+ vspltisb v0, 0
+ /* Precompute vbpermq constant. */
+ vspltisb v10, 3
+ li r0, 0
+ lvsl v11, r0, r0
+ vslb v10, v11, v10
+ MTVRD(v1, r4)
+ vspltb v1, v1, 7
+ cmpldi r5, 64
+ ble L(tail64)
+ /* Are we 64-byte aligned? If so, jump to the vectorized loop.
+ Note: aligning to 64-byte will necessarily slow down performance for
+ strings around 64 bytes in length due to the extra comparisons
+ required to check alignment for the vectorized loop. This is a
+ necessary tradeoff we are willing to take in order to speed up the
+ calculation for larger strings. */
+ andi. r11, r8, 63
+ beq cr0, L(preloop_64B)
+ /* In order to begin the 64B loop, it needs to be 64
+ bytes aligned. So read until it is 64B aligned. */
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ addi r8, r8, 16
+ addi r5, r5, -16
+
+ andi. r11, r8, 63
+ beq cr0, L(preloop_64B)
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ addi r8, r8, 16
+ addi r5, r5, -16
+
+ andi. r11, r8, 63
+ beq cr0, L(preloop_64B)
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ addi r8, r8, 16
+ addi r5, r5, -16
+ /* At this point it should be 64B aligned.
+ Prepare for the 64B loop. */
+L(preloop_64B):
+ cmpldi r5, 64 /* Check if r5 < 64. */
+ ble L(tail64)
+ sub r6, r10, r8
+ srdi r9, r6, 6 /* Number of loop iterations. */
+ mtctr r9 /* Setup the counter. */
+ li r11, 16 /* Load required offsets. */
+ li r9, 32
+ li r7, 48
+
+ /* Handle r5 > 64. Loop over the bytes in strides of 64B. */
+ .align 4
+L(loop):
+ lvx v2, 0, r8 /* Load 4 quadwords. */
+ lvx v3, r8, r11
+ lvx v4, v8, r9
+ lvx v5, v8, r7
+ vcmpequb v6, v1, v2
+ vcmpequb v7, v1, v3
+ vcmpequb v8, v1, v4
+ vcmpequb v9, v1, v5
+ vor v11, v6, v7
+ vor v12, v8, v9
+ vor v11, v11, v12 /* Compare and merge into one VR for speed. */
+ vcmpequb. v11, v0, v11
+ bnl cr6, L(found)
+ addi r8, r8, 64 /* Adjust address for the next iteration. */
+ bdnz L(loop)
+ clrldi r5, r6, 58
+
+ /* Handle remainder of 64B loop or r5 > 64. */
+ .align 4
+L(tail64):
+ cmpldi r5, 0
+ beq L(null)
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ addi r8, r8, 16
+ cmpldi cr6, r5, 16
+ ble cr6, L(null)
+ addi r5, r5, -16
+
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ addi r8, r8, 16
+ cmpldi cr6, r5, 16
+ ble cr6, L(null)
+ addi r5, r5, -16
+
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ addi r8, r8, 16
+ cmpldi cr6, r5, 16
+ ble cr6, L(null)
+ addi r5, r5, -16
+
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ li r3, 0
+ blr
+
+ /* Found a match in 64B loop. */
+ .align 4
+L(found):
+ /* Permute the first bit of each byte into bits 48-63. */
+ VBPERMQ(v6, v6, v10)
+ VBPERMQ(v7, v7, v10)
+ VBPERMQ(v8, v8, v10)
+ VBPERMQ(v9, v9, v10)
+ /* Shift each component into its correct position for merging. */
+#ifdef __LITTLE_ENDIAN__
+ vsldoi v7, v7, v7, 2
+ vsldoi v8, v8, v8, 4
+ vsldoi v9, v9, v9, 6
+#else
+ vsldoi v6, v6, v6, 6
+ vsldoi v7, v7, v7, 4
+ vsldoi v8, v8, v8, 2
+#endif
+ /* Merge the results and move to a GPR. */
+ vor v11, v6, v7
+ vor v4, v9, v8
+ vor v4, v11, v4
+ MFVRD(r5, v4)
+#ifdef __LITTLE_ENDIAN__
+ addi r6, r5, -1
+ andc r6, r6, r5
+ popcntd r6, r6
+#else
+ cntlzd r6, r5 /* Count leading zeros before the match. */
+#endif
+ add r3, r8, r6 /* Compute final length. */
+ blr
+
+ /* Found a match in last 16 bytes. */
+ .align 4
+L(found_16B):
+ /* Permute the first bit of each byte into bits 48-63. */
+ VBPERMQ(v6, v6, v10)
+ /* Shift each component into its correct position for merging. */
+#ifdef __LITTLE_ENDIAN__
+ MFVRD(r7, v6)
+ addi r6, r7, -1
+ andc r6, r6, r7
+ popcntd r6, r6
+#else
+ vsldoi v6, v6, v6, 6
+ MFVRD(r7, v6)
+ cntlzd r6, r7 /* Count leading zeros before the match. */
+#endif
+ add r3, r8, r6 /* Compute final length. */
+ cmpld r6, r5
+ bltlr
+ li r3, 0
+ blr
+
+ .align 4
+ /* r3 has the output of the cmpb instruction, that is, it contains
+ 0xff in the same position as BYTE in the original
+ doubleword from the string. Use that to calculate the pointer.
+ We need to make sure BYTE is *before* the end of the range. */
+L(done):
+#ifdef __LITTLE_ENDIAN__
+ addi r0, r3, -1
+ andc r0, r0, r3
+ popcntd r0, r0 /* Count trailing zeros. */
+#else
+ cntlzd r0, r3 /* Count leading zeros before the match. */
+#endif
+ cmpld r8, r7 /* Are we on the last dword? */
+ srdi r0, r0, 3 /* Convert leading/trailing zeros to bytes. */
+ add r3, r8, r0
+ cmpld cr7, r0, r6 /* If on the last dword, check byte offset. */
+ bnelr
+ blelr cr7
+ li r3, 0
+ blr
+
+ .align 4
+L(null):
+ li r3, 0
+ blr
+
+/* Deals with size <= 32. */
+ .align 4
+L(small_range):
+ cmpldi r5, 0
+ beq L(null)
+ ld r12, 0(r8) /* Load word from memory. */
+ cmpb r3, r12, r4 /* Check for BYTE in DWORD1. */
+ and r3, r3, r9
+ cmpldi cr7, r3, 0
+ clrldi r6, r7, 61 /* Byte count - 1 in last dword. */
+ clrrdi r7, r7, 3 /* Address of last doubleword. */
+ cmpld r8, r7 /* Are we done already? */
+ bne cr7, L(done)
+ beqlr
+
+ ldu r12, 8(r8)
+ cmpb r3, r12, r4
+ cmpldi cr6, r3, 0
+ cmpld r8, r7
+ bne cr6, L(done) /* Found something. */
+ beqlr /* Hit end of string (length). */
+
+ ldu r12, 8(r8)
+ cmpb r3, r12, r4
+ cmpldi cr6, r3, 0
+ cmpld r8, r7
+ bne cr6, L(done)
+ beqlr
+
+ ldu r12, 8(r8)
+ cmpb r3, r12, r4
+ cmpldi cr6, r3, 0
+ cmpld r8, r7
+ bne cr6, L(done)
+ beqlr
+
+ ldu r12, 8(r8)
+ cmpb r3, r12, r4
+ cmpldi cr6, r3, 0
+ bne cr6, L(done)
+ blr
+
+END (MEMCHR)
+weak_alias (__memchr, memchr)
+libc_hidden_builtin_def (memchr)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
new file mode 100644
index 0000000000..ec4ccf3382
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -0,0 +1,1447 @@
+/* Optimized memcmp implementation for POWER7/PowerPC64.
+ Copyright (C) 2010-2018 Free Software 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>
+
+/* int [r3] memcmp (const char *s1 [r3],
+ const char *s2 [r4],
+ size_t size [r5]) */
+
+/* TODO: change these to the actual instructions when the minimum required
+ binutils allows it. */
+#define MFVRD(r,v) .long (0x7c000067 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#ifndef MEMCMP
+# define MEMCMP memcmp
+#endif
+ .machine power7
+ENTRY_TOCLESS (MEMCMP, 4)
+ CALL_MCOUNT 3
+
+#define rRTN r3
+#define rSTR1 r3 /* First string arg. */
+#define rSTR2 r4 /* Second string arg. */
+#define rN r5 /* Max string length. */
+#define rWORD1 r6 /* Current word in s1. */
+#define rWORD2 r7 /* Current word in s2. */
+#define rWORD3 r8 /* Next word in s1. */
+#define rWORD4 r9 /* Next word in s2. */
+#define rWORD5 r10 /* Next word in s1. */
+#define rWORD6 r11 /* Next word in s2. */
+
+#define rOFF8 r20 /* 8 bytes offset. */
+#define rOFF16 r21 /* 16 bytes offset. */
+#define rOFF24 r22 /* 24 bytes offset. */
+#define rOFF32 r23 /* 24 bytes offset. */
+#define rWORD6_SHIFT r24 /* Left rotation temp for rWORD8. */
+#define rWORD4_SHIFT r25 /* Left rotation temp for rWORD6. */
+#define rWORD2_SHIFT r26 /* Left rotation temp for rWORD4. */
+#define rWORD8_SHIFT r27 /* Left rotation temp for rWORD2. */
+#define rSHR r28 /* Unaligned shift right count. */
+#define rSHL r29 /* Unaligned shift left count. */
+#define rWORD7 r30 /* Next word in s1. */
+#define rWORD8 r31 /* Next word in s2. */
+
+#define rWORD8SAVE (-8)
+#define rWORD7SAVE (-16)
+#define rOFF8SAVE (-24)
+#define rOFF16SAVE (-32)
+#define rOFF24SAVE (-40)
+#define rOFF32SAVE (-48)
+#define rSHRSAVE (-56)
+#define rSHLSAVE (-64)
+#define rWORD8SHIFTSAVE (-72)
+#define rWORD2SHIFTSAVE (-80)
+#define rWORD4SHIFTSAVE (-88)
+#define rWORD6SHIFTSAVE (-96)
+
+#ifdef __LITTLE_ENDIAN__
+# define LD ldbrx
+#else
+# define LD ldx
+#endif
+
+ xor r10, rSTR2, rSTR1
+ cmpldi cr6, rN, 0
+ cmpldi cr1, rN, 8
+ clrldi. r0, r10, 61
+ clrldi r12, rSTR1, 61
+ cmpldi cr5, r12, 0
+ beq- cr6, L(zeroLength)
+ dcbt 0, rSTR1
+ dcbt 0, rSTR2
+ /* If less than 8 bytes or not aligned, use the unaligned
+ byte loop. */
+ blt cr1, L(bytealigned)
+ bne L(unalignedqw)
+/* At this point we know both strings have the same alignment and the
+ compare length is at least 8 bytes. r12 contains the low order
+ 3 bits of rSTR1 and cr5 contains the result of the logical compare
+ of r12 to 0. If r12 == 0 then we are already double word
+ aligned and can perform the DW aligned loop. */
+
+ .align 4
+L(samealignment):
+ or r11, rSTR2, rSTR1
+ clrldi. r11, r11, 60
+ beq L(qw_align)
+ /* Try to align to QW else proceed to DW loop. */
+ clrldi. r10, r10, 60
+ bne L(DW)
+ /* For the difference to reach QW alignment, load as DW. */
+ clrrdi rSTR1, rSTR1, 3
+ clrrdi rSTR2, rSTR2, 3
+ subfic r10, r12, 8
+ LD rWORD1, 0, rSTR1
+ LD rWORD2, 0, rSTR2
+ sldi r9, r10, 3
+ subfic r9, r9, 64
+ sld rWORD1, rWORD1, r9
+ sld rWORD2, rWORD2, r9
+ cmpld cr6, rWORD1, rWORD2
+ addi rSTR1, rSTR1, 8
+ addi rSTR2, rSTR2, 8
+ bne cr6, L(ret_diff)
+ subf rN, r10, rN
+
+ cmpld cr6, r11, r12
+ bgt cr6, L(qw_align)
+ LD rWORD1, 0, rSTR1
+ LD rWORD2, 0, rSTR2
+ cmpld cr6, rWORD1, rWORD2
+ addi rSTR1, rSTR1, 8
+ addi rSTR2, rSTR2, 8
+ bne cr6, L(different)
+ cmpldi cr6, rN, 8
+ ble cr6, L(zeroLength)
+ addi rN, rN, -8
+ /* Now both rSTR1 and rSTR2 are aligned to QW. */
+ .align 4
+L(qw_align):
+ vspltisb v0, 0
+ srdi. r6, rN, 6
+ li r8, 16
+ li r10, 32
+ li r11, 48
+ ble cr0, L(lessthan64)
+ mtctr r6
+ vspltisb v8, 0
+ vspltisb v6, 0
+ /* Aligned vector loop. */
+ .align 4
+L(aligned_loop):
+ lvx v4, 0, rSTR1
+ lvx v5, 0, rSTR2
+ vcmpequb. v7, v6, v8
+ bnl cr6, L(different3)
+ lvx v6, rSTR1, r8
+ lvx v8, rSTR2, r8
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different2)
+ lvx v4, rSTR1, r10
+ lvx v5, rSTR2, r10
+ vcmpequb. v7, v6, v8
+ bnl cr6, L(different3)
+ lvx v6, rSTR1, r11
+ lvx v8, rSTR2, r11
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different2)
+ addi rSTR1, rSTR1, 64
+ addi rSTR2, rSTR2, 64
+ bdnz L(aligned_loop)
+ vcmpequb. v7, v6, v8
+ bnl cr6, L(different3)
+ clrldi rN, rN, 58
+ /* Handle remainder for aligned loop. */
+ .align 4
+L(lessthan64):
+ mr r9, rSTR1
+ cmpdi cr6, rN, 0
+ li rSTR1, 0
+ blelr cr6
+ lvx v4, 0, r9
+ lvx v5, 0, rSTR2
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different1)
+ addi rN, rN, -16
+
+ cmpdi cr6, rN, 0
+ blelr cr6
+ lvx v4, r9, r8
+ lvx v5, rSTR2, r8
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different1)
+ addi rN, rN, -16
+
+ cmpdi cr6, rN, 0
+ blelr cr6
+ lvx v4, r9, r10
+ lvx v5, rSTR2, r10
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different1)
+ addi rN, rN, -16
+
+ cmpdi cr6, rN, 0
+ blelr cr6
+ lvx v4, r9, r11
+ lvx v5, rSTR2, r11
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different1)
+ blr
+
+ /* Calculate and return the difference. */
+ .align 4
+L(different1):
+ cmpdi cr6, rN, 16
+ bge cr6, L(different2)
+ /* Discard unwanted bytes. */
+#ifdef __LITTLE_ENDIAN__
+ lvsr v1, 0, rN
+ vperm v4, v4, v0, v1
+ vperm v5, v5, v0, v1
+#else
+ lvsl v1, 0, rN
+ vperm v4, v0, v4, v1
+ vperm v5, v0, v5, v1
+#endif
+ vcmpequb. v7, v4, v5
+ li rRTN, 0
+ bltlr cr6
+ .align 4
+L(different2):
+#ifdef __LITTLE_ENDIAN__
+ /* Reverse bytes for direct comparison. */
+ lvsl v10, r0, r0
+ vspltisb v8, 15
+ vsububm v9, v8, v10
+ vperm v4, v4, v0, v9
+ vperm v5, v5, v0, v9
+#endif
+ MFVRD(r7, v4)
+ MFVRD(r9, v5)
+ cmpld cr6, r7, r9
+ bne cr6, L(ret_diff)
+ /* Difference in second DW. */
+ vsldoi v4, v4, v4, 8
+ vsldoi v5, v5, v5, 8
+ MFVRD(r7, v4)
+ MFVRD(r9, v5)
+ cmpld cr6, r7, r9
+L(ret_diff):
+ li rRTN, 1
+ bgtlr cr6
+ li rRTN, -1
+ blr
+ .align 4
+L(different3):
+#ifdef __LITTLE_ENDIAN__
+ /* Reverse bytes for direct comparison. */
+ vspltisb v9, 15
+ lvsl v10, r0, r0
+ vsububm v9, v9, v10
+ vperm v6, v6, v0, v9
+ vperm v8, v8, v0, v9
+#endif
+ MFVRD(r7, v6)
+ MFVRD(r9, v8)
+ cmpld cr6, r7, r9
+ bne cr6, L(ret_diff)
+ /* Difference in second DW. */
+ vsldoi v6, v6, v6, 8
+ vsldoi v8, v8, v8, 8
+ MFVRD(r7, v6)
+ MFVRD(r9, v8)
+ cmpld cr6, r7, r9
+ li rRTN, 1
+ bgtlr cr6
+ li rRTN, -1
+ blr
+
+ .align 4
+L(different):
+ cmpldi cr7, rN, 8
+ bgt cr7, L(end)
+ /* Skip unwanted bytes. */
+ sldi r8, rN, 3
+ subfic r8, r8, 64
+ srd rWORD1, rWORD1, r8
+ srd rWORD2, rWORD2, r8
+ cmpld cr6, rWORD1, rWORD2
+ li rRTN, 0
+ beqlr cr6
+L(end):
+ li rRTN, 1
+ bgtlr cr6
+ li rRTN, -1
+ blr
+
+ .align 4
+L(unalignedqw):
+ /* Proceed to DW unaligned loop,if there is a chance of pagecross. */
+ rldicl r9, rSTR1, 0, 52
+ add r9, r9, rN
+ cmpldi cr0, r9, 4096-16
+ bgt cr0, L(unaligned)
+ rldicl r9, rSTR2, 0, 52
+ add r9, r9, rN
+ cmpldi cr0, r9, 4096-16
+ bgt cr0, L(unaligned)
+ li r0, 0
+ li r8, 16
+ vspltisb v0, 0
+ /* Check if rSTR1 is aligned to QW. */
+ andi. r11, rSTR1, 0xF
+ beq L(s1_align)
+
+ /* Compare 16B and align S1 to QW. */
+#ifdef __LITTLE_ENDIAN__
+ lvsr v10, 0, rSTR1 /* Compute mask. */
+ lvsr v6, 0, rSTR2 /* Compute mask. */
+#else
+ lvsl v10, 0, rSTR1 /* Compute mask. */
+ lvsl v6, 0, rSTR2 /* Compute mask. */
+#endif
+ lvx v5, 0, rSTR2
+ lvx v9, rSTR2, r8
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v9, v5, v6
+#else
+ vperm v5, v5, v9, v6
+#endif
+ lvx v4, 0, rSTR1
+ lvx v9, rSTR1, r8
+#ifdef __LITTLE_ENDIAN__
+ vperm v4, v9, v4, v10
+#else
+ vperm v4, v4, v9, v10
+#endif
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different1)
+ cmpldi cr6, rN, 16
+ ble cr6, L(zeroLength)
+ subfic r11, r11, 16
+ subf rN, r11, rN
+ add rSTR1, rSTR1, r11
+ add rSTR2, rSTR2, r11
+
+ /* As s1 is QW aligned prepare for unaligned loop. */
+ .align 4
+L(s1_align):
+#ifdef __LITTLE_ENDIAN__
+ lvsr v6, 0, rSTR2
+#else
+ lvsl v6, 0, rSTR2
+#endif
+ lvx v5, 0, rSTR2
+ srdi. r6, rN, 6
+ li r10, 32
+ li r11, 48
+ ble cr0, L(lessthan64_unalign)
+ mtctr r6
+ li r9, 64
+ /* Unaligned vector loop. */
+ .align 4
+L(unalign_qwloop):
+ lvx v4, 0, rSTR1
+ lvx v10, rSTR2, r8
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v10, v5, v6
+#else
+ vperm v5, v5, v10, v6
+#endif
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different2)
+ vor v5, v10, v10
+ lvx v4, rSTR1, r8
+ lvx v10, rSTR2, r10
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v10, v5, v6
+#else
+ vperm v5, v5, v10, v6
+#endif
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different2)
+ vor v5, v10, v10
+ lvx v4, rSTR1, r10
+ lvx v10, rSTR2, r11
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v10, v5, v6
+#else
+ vperm v5, v5, v10, v6
+#endif
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different2)
+ vor v5, v10, v10
+ lvx v4, rSTR1, r11
+ lvx v10, rSTR2, r9
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v10, v5, v6
+#else
+ vperm v5, v5, v10, v6
+#endif
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different2)
+ vor v5, v10, v10
+ addi rSTR1, rSTR1, 64
+ addi rSTR2, rSTR2, 64
+ bdnz L(unalign_qwloop)
+ clrldi rN, rN, 58
+ /* Handle remainder for unaligned loop. */
+ .align 4
+L(lessthan64_unalign):
+ mr r9, rSTR1
+ cmpdi cr6, rN, 0
+ li rSTR1, 0
+ blelr cr6
+ lvx v4, 0, r9
+ lvx v10, rSTR2, r8
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v10, v5, v6
+#else
+ vperm v5, v5, v10, v6
+#endif
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different1)
+ vor v5, v10, v10
+ addi rN, rN, -16
+
+ cmpdi cr6, rN, 0
+ blelr cr6
+ lvx v4, r9, r8
+ lvx v10, rSTR2, r10
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v10, v5, v6
+#else
+ vperm v5, v5, v10, v6
+#endif
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different1)
+ vor v5, v10, v10
+ addi rN, rN, -16
+
+ cmpdi cr6, rN, 0
+ blelr cr6
+ lvx v4, r9, r10
+ lvx v10, rSTR2, r11
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v10, v5, v6
+#else
+ vperm v5, v5, v10, v6
+#endif
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different1)
+ vor v5, v10, v10
+ addi rN, rN, -16
+
+ cmpdi cr6, rN, 0
+ blelr cr6
+ lvx v4, r9, r11
+ addi r11, r11, 16
+ lvx v10, rSTR2, r11
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v10, v5, v6
+#else
+ vperm v5, v5, v10, v6
+#endif
+ vcmpequb. v7, v5, v4
+ bnl cr6, L(different1)
+ blr
+
+/* Otherwise we know the two strings have the same alignment (but not
+ yet DW). So we force the string addresses to the next lower DW
+ boundary and special case this first DW using shift left to
+ eliminate bits preceding the first byte. Since we want to join the
+ normal (DW aligned) compare loop, starting at the second double word,
+ we need to adjust the length (rN) and special case the loop
+ versioning for the first DW. This ensures that the loop count is
+ correct and the first DW (shifted) is in the expected register pair. */
+ .align 4
+L(DW):
+ std rWORD8, rWORD8SAVE(r1)
+ std rWORD7, rWORD7SAVE(r1)
+ std rOFF8, rOFF8SAVE(r1)
+ std rOFF16, rOFF16SAVE(r1)
+ std rOFF24, rOFF24SAVE(r1)
+ std rOFF32, rOFF32SAVE(r1)
+ cfi_offset(rWORD8, rWORD8SAVE)
+ cfi_offset(rWORD7, rWORD7SAVE)
+ cfi_offset(rOFF8, rOFF8SAVE)
+ cfi_offset(rOFF16, rOFF16SAVE)
+ cfi_offset(rOFF24, rOFF24SAVE)
+ cfi_offset(rOFF32, rOFF32SAVE)
+
+ li rOFF8,8
+ li rOFF16,16
+ li rOFF24,24
+ li rOFF32,32
+ clrrdi rSTR1, rSTR1, 3
+ clrrdi rSTR2, rSTR2, 3
+ beq cr5, L(DWaligned)
+ add rN, rN, r12
+ sldi rWORD6, r12, 3
+ srdi r0, rN, 5 /* Divide by 32. */
+ andi. r12, rN, 24 /* Get the DW remainder. */
+ LD rWORD1, 0, rSTR1
+ LD rWORD2, 0, rSTR2
+ cmpldi cr1, r12, 16
+ cmpldi cr7, rN, 32
+ clrldi rN, rN, 61
+ beq L(dPs4)
+ mtctr r0
+ bgt cr1, L(dPs3)
+ beq cr1, L(dPs2)
+
+/* Remainder is 8. */
+ .align 3
+L(dsP1):
+ sld rWORD5, rWORD1, rWORD6
+ sld rWORD6, rWORD2, rWORD6
+ cmpld cr5, rWORD5, rWORD6
+ blt cr7, L(dP1x)
+/* Do something useful in this cycle since we have to branch anyway. */
+ LD rWORD1, rOFF8, rSTR1
+ LD rWORD2, rOFF8, rSTR2
+ cmpld cr7, rWORD1, rWORD2
+ b L(dP1e)
+/* Remainder is 16. */
+ .align 4
+L(dPs2):
+ sld rWORD5, rWORD1, rWORD6
+ sld rWORD6, rWORD2, rWORD6
+ cmpld cr6, rWORD5, rWORD6
+ blt cr7, L(dP2x)
+/* Do something useful in this cycle since we have to branch anyway. */
+ LD rWORD7, rOFF8, rSTR1
+ LD rWORD8, rOFF8, rSTR2
+ cmpld cr5, rWORD7, rWORD8
+ b L(dP2e)
+/* Remainder is 24. */
+ .align 4
+L(dPs3):
+ sld rWORD3, rWORD1, rWORD6
+ sld rWORD4, rWORD2, rWORD6
+ cmpld cr1, rWORD3, rWORD4
+ b L(dP3e)
+/* Count is a multiple of 32, remainder is 0. */
+ .align 4
+L(dPs4):
+ mtctr r0
+ sld rWORD1, rWORD1, rWORD6
+ sld rWORD2, rWORD2, rWORD6
+ cmpld cr7, rWORD1, rWORD2
+ b L(dP4e)
+
+/* At this point we know both strings are double word aligned and the
+ compare length is at least 8 bytes. */
+ .align 4
+L(DWaligned):
+ andi. r12, rN, 24 /* Get the DW remainder. */
+ srdi r0, rN, 5 /* Divide by 32. */
+ cmpldi cr1, r12, 16
+ cmpldi cr7, rN, 32
+ clrldi rN, rN, 61
+ beq L(dP4)
+ bgt cr1, L(dP3)
+ beq cr1, L(dP2)
+
+/* Remainder is 8. */
+ .align 4
+L(dP1):
+ mtctr r0
+/* Normally we'd use rWORD7/rWORD8 here, but since we might exit early
+ (8-15 byte compare), we want to use only volatile registers. This
+ means we can avoid restoring non-volatile registers since we did not
+ change any on the early exit path. The key here is the non-early
+ exit path only cares about the condition code (cr5), not about which
+ register pair was used. */
+ LD rWORD5, 0, rSTR1
+ LD rWORD6, 0, rSTR2
+ cmpld cr5, rWORD5, rWORD6
+ blt cr7, L(dP1x)
+ LD rWORD1, rOFF8, rSTR1
+ LD rWORD2, rOFF8, rSTR2
+ cmpld cr7, rWORD1, rWORD2
+L(dP1e):
+ LD rWORD3, rOFF16, rSTR1
+ LD rWORD4, rOFF16, rSTR2
+ cmpld cr1, rWORD3, rWORD4
+ LD rWORD5, rOFF24, rSTR1
+ LD rWORD6, rOFF24, rSTR2
+ cmpld cr6, rWORD5, rWORD6
+ bne cr5, L(dLcr5x)
+ bne cr7, L(dLcr7x)
+
+ LD rWORD7, rOFF32, rSTR1
+ LD rWORD8, rOFF32, rSTR2
+ addi rSTR1, rSTR1, 32
+ addi rSTR2, rSTR2, 32
+ bne cr1, L(dLcr1)
+ cmpld cr5, rWORD7, rWORD8
+ bdnz L(dLoop)
+ bne cr6, L(dLcr6)
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+ .align 3
+L(dP1x):
+ sldi. r12, rN, 3
+ bne cr5, L(dLcr5x)
+ subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */
+ bne L(d00)
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ li rRTN, 0
+ blr
+
+/* Remainder is 16. */
+ .align 4
+L(dP2):
+ mtctr r0
+ LD rWORD5, 0, rSTR1
+ LD rWORD6, 0, rSTR2
+ cmpld cr6, rWORD5, rWORD6
+ blt cr7, L(dP2x)
+ LD rWORD7, rOFF8, rSTR1
+ LD rWORD8, rOFF8, rSTR2
+ cmpld cr5, rWORD7, rWORD8
+L(dP2e):
+ LD rWORD1, rOFF16, rSTR1
+ LD rWORD2, rOFF16, rSTR2
+ cmpld cr7, rWORD1, rWORD2
+ LD rWORD3, rOFF24, rSTR1
+ LD rWORD4, rOFF24, rSTR2
+ cmpld cr1, rWORD3, rWORD4
+ addi rSTR1, rSTR1, 8
+ addi rSTR2, rSTR2, 8
+ bne cr6, L(dLcr6)
+ bne cr5, L(dLcr5)
+ b L(dLoop2)
+ .align 4
+L(dP2x):
+ LD rWORD3, rOFF8, rSTR1
+ LD rWORD4, rOFF8, rSTR2
+ cmpld cr1, rWORD3, rWORD4
+ sldi. r12, rN, 3
+ bne cr6, L(dLcr6x)
+ addi rSTR1, rSTR1, 8
+ addi rSTR2, rSTR2, 8
+ bne cr1, L(dLcr1x)
+ subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */
+ bne L(d00)
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ li rRTN, 0
+ blr
+
+/* Remainder is 24. */
+ .align 4
+L(dP3):
+ mtctr r0
+ LD rWORD3, 0, rSTR1
+ LD rWORD4, 0, rSTR2
+ cmpld cr1, rWORD3, rWORD4
+L(dP3e):
+ LD rWORD5, rOFF8, rSTR1
+ LD rWORD6, rOFF8, rSTR2
+ cmpld cr6, rWORD5, rWORD6
+ blt cr7, L(dP3x)
+ LD rWORD7, rOFF16, rSTR1
+ LD rWORD8, rOFF16, rSTR2
+ cmpld cr5, rWORD7, rWORD8
+ LD rWORD1, rOFF24, rSTR1
+ LD rWORD2, rOFF24, rSTR2
+ cmpld cr7, rWORD1, rWORD2
+ addi rSTR1, rSTR1, 16
+ addi rSTR2, rSTR2, 16
+ bne cr1, L(dLcr1)
+ bne cr6, L(dLcr6)
+ b L(dLoop1)
+/* Again we are on a early exit path (24-31 byte compare), we want to
+ only use volatile registers and avoid restoring non-volatile
+ registers. */
+ .align 4
+L(dP3x):
+ LD rWORD1, rOFF16, rSTR1
+ LD rWORD2, rOFF16, rSTR2
+ cmpld cr7, rWORD1, rWORD2
+ sldi. r12, rN, 3
+ bne cr1, L(dLcr1x)
+ addi rSTR1, rSTR1, 16
+ addi rSTR2, rSTR2, 16
+ bne cr6, L(dLcr6x)
+ subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */
+ bne cr7, L(dLcr7x)
+ bne L(d00)
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ li rRTN, 0
+ blr
+
+/* Count is a multiple of 32, remainder is 0. */
+ .align 4
+L(dP4):
+ mtctr r0
+ LD rWORD1, 0, rSTR1
+ LD rWORD2, 0, rSTR2
+ cmpld cr7, rWORD1, rWORD2
+L(dP4e):
+ LD rWORD3, rOFF8, rSTR1
+ LD rWORD4, rOFF8, rSTR2
+ cmpld cr1, rWORD3, rWORD4
+ LD rWORD5, rOFF16, rSTR1
+ LD rWORD6, rOFF16, rSTR2
+ cmpld cr6, rWORD5, rWORD6
+ LD rWORD7, rOFF24, rSTR1
+ LD rWORD8, rOFF24, rSTR2
+ addi rSTR1, rSTR1, 24
+ addi rSTR2, rSTR2, 24
+ cmpld cr5, rWORD7, rWORD8
+ bne cr7, L(dLcr7)
+ bne cr1, L(dLcr1)
+ bdz- L(d24) /* Adjust CTR as we start with +4. */
+/* This is the primary loop. */
+ .align 4
+L(dLoop):
+ LD rWORD1, rOFF8, rSTR1
+ LD rWORD2, rOFF8, rSTR2
+ cmpld cr1, rWORD3, rWORD4
+ bne cr6, L(dLcr6)
+L(dLoop1):
+ LD rWORD3, rOFF16, rSTR1
+ LD rWORD4, rOFF16, rSTR2
+ cmpld cr6, rWORD5, rWORD6
+ bne cr5, L(dLcr5)
+L(dLoop2):
+ LD rWORD5, rOFF24, rSTR1
+ LD rWORD6, rOFF24, rSTR2
+ cmpld cr5, rWORD7, rWORD8
+ bne cr7, L(dLcr7)
+L(dLoop3):
+ LD rWORD7, rOFF32, rSTR1
+ LD rWORD8, rOFF32, rSTR2
+ addi rSTR1, rSTR1, 32
+ addi rSTR2, rSTR2, 32
+ bne cr1, L(dLcr1)
+ cmpld cr7, rWORD1, rWORD2
+ bdnz L(dLoop)
+
+L(dL4):
+ cmpld cr1, rWORD3, rWORD4
+ bne cr6, L(dLcr6)
+ cmpld cr6, rWORD5, rWORD6
+ bne cr5, L(dLcr5)
+ cmpld cr5, rWORD7, rWORD8
+L(d44):
+ bne cr7, L(dLcr7)
+L(d34):
+ bne cr1, L(dLcr1)
+L(d24):
+ bne cr6, L(dLcr6)
+L(d14):
+ sldi. r12, rN, 3
+ bne cr5, L(dLcr5)
+L(d04):
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+ subfic rN, r12, 64 /* Shift count is 64 - (rN * 8). */
+ beq L(duzeroLength)
+/* At this point we have a remainder of 1 to 7 bytes to compare. Since
+ we are aligned it is safe to load the whole double word, and use
+ shift right double to eliminate bits beyond the compare length. */
+L(d00):
+ LD rWORD1, rOFF8, rSTR1
+ LD rWORD2, rOFF8, rSTR2
+ srd rWORD1, rWORD1, rN
+ srd rWORD2, rWORD2, rN
+ cmpld cr7, rWORD1, rWORD2
+ bne cr7, L(dLcr7x)
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ li rRTN, 0
+ blr
+
+ .align 4
+L(dLcr7):
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+L(dLcr7x):
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ li rRTN, 1
+ bgtlr cr7
+ li rRTN, -1
+ blr
+ .align 4
+L(dLcr1):
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+L(dLcr1x):
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ li rRTN, 1
+ bgtlr cr1
+ li rRTN, -1
+ blr
+ .align 4
+L(dLcr6):
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+L(dLcr6x):
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ li rRTN, 1
+ bgtlr cr6
+ li rRTN, -1
+ blr
+ .align 4
+L(dLcr5):
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+L(dLcr5x):
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ li rRTN, 1
+ bgtlr cr5
+ li rRTN, -1
+ blr
+
+ .align 4
+L(bytealigned):
+ mtctr rN
+
+/* We need to prime this loop. This loop is swing modulo scheduled
+ to avoid pipe delays. The dependent instruction latencies (load to
+ compare to conditional branch) is 2 to 3 cycles. In this loop each
+ dispatch group ends in a branch and takes 1 cycle. Effectively
+ the first iteration of the loop only serves to load operands and
+ branches based on compares are delayed until the next loop.
+
+ So we must precondition some registers and condition codes so that
+ we don't exit the loop early on the first iteration. */
+
+ lbz rWORD1, 0(rSTR1)
+ lbz rWORD2, 0(rSTR2)
+ bdz L(b11)
+ cmpld cr7, rWORD1, rWORD2
+ lbz rWORD3, 1(rSTR1)
+ lbz rWORD4, 1(rSTR2)
+ bdz L(b12)
+ cmpld cr1, rWORD3, rWORD4
+ lbzu rWORD5, 2(rSTR1)
+ lbzu rWORD6, 2(rSTR2)
+ bdz L(b13)
+ .align 4
+L(bLoop):
+ lbzu rWORD1, 1(rSTR1)
+ lbzu rWORD2, 1(rSTR2)
+ bne cr7, L(bLcr7)
+
+ cmpld cr6, rWORD5, rWORD6
+ bdz L(b3i)
+
+ lbzu rWORD3, 1(rSTR1)
+ lbzu rWORD4, 1(rSTR2)
+ bne cr1, L(bLcr1)
+
+ cmpld cr7, rWORD1, rWORD2
+ bdz L(b2i)
+
+ lbzu rWORD5, 1(rSTR1)
+ lbzu rWORD6, 1(rSTR2)
+ bne cr6, L(bLcr6)
+
+ cmpld cr1, rWORD3, rWORD4
+ bdnz L(bLoop)
+
+/* We speculatively loading bytes before we have tested the previous
+ bytes. But we must avoid overrunning the length (in the ctr) to
+ prevent these speculative loads from causing a segfault. In this
+ case the loop will exit early (before the all pending bytes are
+ tested. In this case we must complete the pending operations
+ before returning. */
+L(b1i):
+ bne cr7, L(bLcr7)
+ bne cr1, L(bLcr1)
+ b L(bx56)
+ .align 4
+L(b2i):
+ bne cr6, L(bLcr6)
+ bne cr7, L(bLcr7)
+ b L(bx34)
+ .align 4
+L(b3i):
+ bne cr1, L(bLcr1)
+ bne cr6, L(bLcr6)
+ b L(bx12)
+ .align 4
+L(bLcr7):
+ li rRTN, 1
+ bgtlr cr7
+ li rRTN, -1
+ blr
+L(bLcr1):
+ li rRTN, 1
+ bgtlr cr1
+ li rRTN, -1
+ blr
+L(bLcr6):
+ li rRTN, 1
+ bgtlr cr6
+ li rRTN, -1
+ blr
+
+L(b13):
+ bne cr7, L(bx12)
+ bne cr1, L(bx34)
+L(bx56):
+ sub rRTN, rWORD5, rWORD6
+ blr
+ nop
+L(b12):
+ bne cr7, L(bx12)
+L(bx34):
+ sub rRTN, rWORD3, rWORD4
+ blr
+L(b11):
+L(bx12):
+ sub rRTN, rWORD1, rWORD2
+ blr
+
+ .align 4
+L(zeroLength):
+ li rRTN, 0
+ blr
+
+ .align 4
+/* At this point we know the strings have different alignment and the
+ compare length is at least 8 bytes. r12 contains the low order
+ 3 bits of rSTR1 and cr5 contains the result of the logical compare
+ of r12 to 0. If r12 == 0 then rStr1 is double word
+ aligned and can perform the DWunaligned loop.
+
+ Otherwise we know that rSTR1 is not already DW aligned yet.
+ So we can force the string addresses to the next lower DW
+ boundary and special case this first DW using shift left to
+ eliminate bits preceding the first byte. Since we want to join the
+ normal (DWaligned) compare loop, starting at the second double word,
+ we need to adjust the length (rN) and special case the loop
+ versioning for the first DW. This ensures that the loop count is
+ correct and the first DW (shifted) is in the expected resister pair. */
+L(unaligned):
+ std rWORD8, rWORD8SAVE(r1)
+ std rWORD7, rWORD7SAVE(r1)
+ std rOFF8, rOFF8SAVE(r1)
+ std rOFF16, rOFF16SAVE(r1)
+ std rOFF24, rOFF24SAVE(r1)
+ std rOFF32, rOFF32SAVE(r1)
+ cfi_offset(rWORD8, rWORD8SAVE)
+ cfi_offset(rWORD7, rWORD7SAVE)
+ cfi_offset(rOFF8, rOFF8SAVE)
+ cfi_offset(rOFF16, rOFF16SAVE)
+ cfi_offset(rOFF24, rOFF24SAVE)
+ cfi_offset(rOFF32, rOFF32SAVE)
+ li rOFF8,8
+ li rOFF16,16
+ li rOFF24,24
+ li rOFF32,32
+ std rSHL, rSHLSAVE(r1)
+ cfi_offset(rSHL, rSHLSAVE)
+ clrldi rSHL, rSTR2, 61
+ beq cr6, L(duzeroLength)
+ std rSHR, rSHRSAVE(r1)
+ cfi_offset(rSHR, rSHRSAVE)
+ beq cr5, L(DWunaligned)
+ std rWORD8_SHIFT, rWORD8SHIFTSAVE(r1)
+ cfi_offset(rWORD8_SHIFT, rWORD8SHIFTSAVE)
+/* Adjust the logical start of rSTR2 to compensate for the extra bits
+ in the 1st rSTR1 DW. */
+ sub rWORD8_SHIFT, rSTR2, r12
+/* But do not attempt to address the DW before that DW that contains
+ the actual start of rSTR2. */
+ clrrdi rSTR2, rSTR2, 3
+ std rWORD2_SHIFT, rWORD2SHIFTSAVE(r1)
+/* Compute the left/right shift counts for the unaligned rSTR2,
+ compensating for the logical (DW aligned) start of rSTR1. */
+ clrldi rSHL, rWORD8_SHIFT, 61
+ clrrdi rSTR1, rSTR1, 3
+ std rWORD4_SHIFT, rWORD4SHIFTSAVE(r1)
+ sldi rSHL, rSHL, 3
+ cmpld cr5, rWORD8_SHIFT, rSTR2
+ add rN, rN, r12
+ sldi rWORD6, r12, 3
+ std rWORD6_SHIFT, rWORD6SHIFTSAVE(r1)
+ cfi_offset(rWORD2_SHIFT, rWORD2SHIFTSAVE)
+ cfi_offset(rWORD4_SHIFT, rWORD4SHIFTSAVE)
+ cfi_offset(rWORD6_SHIFT, rWORD6SHIFTSAVE)
+ subfic rSHR, rSHL, 64
+ srdi r0, rN, 5 /* Divide by 32. */
+ andi. r12, rN, 24 /* Get the DW remainder. */
+/* We normally need to load 2 DWs to start the unaligned rSTR2, but in
+ this special case those bits may be discarded anyway. Also we
+ must avoid loading a DW where none of the bits are part of rSTR2 as
+ this may cross a page boundary and cause a page fault. */
+ li rWORD8, 0
+ blt cr5, L(dus0)
+ LD rWORD8, 0, rSTR2
+ addi rSTR2, rSTR2, 8
+ sld rWORD8, rWORD8, rSHL
+
+L(dus0):
+ LD rWORD1, 0, rSTR1
+ LD rWORD2, 0, rSTR2
+ cmpldi cr1, r12, 16
+ cmpldi cr7, rN, 32
+ srd r12, rWORD2, rSHR
+ clrldi rN, rN, 61
+ beq L(duPs4)
+ mtctr r0
+ or rWORD8, r12, rWORD8
+ bgt cr1, L(duPs3)
+ beq cr1, L(duPs2)
+
+/* Remainder is 8. */
+ .align 4
+L(dusP1):
+ sld rWORD8_SHIFT, rWORD2, rSHL
+ sld rWORD7, rWORD1, rWORD6
+ sld rWORD8, rWORD8, rWORD6
+ bge cr7, L(duP1e)
+/* At this point we exit early with the first double word compare
+ complete and remainder of 0 to 7 bytes. See L(du14) for details on
+ how we handle the remaining bytes. */
+ cmpld cr5, rWORD7, rWORD8
+ sldi. rN, rN, 3
+ bne cr5, L(duLcr5)
+ cmpld cr7, rN, rSHR
+ beq L(duZeroReturn)
+ li r0, 0
+ ble cr7, L(dutrim)
+ LD rWORD2, rOFF8, rSTR2
+ srd r0, rWORD2, rSHR
+ b L(dutrim)
+/* Remainder is 16. */
+ .align 4
+L(duPs2):
+ sld rWORD6_SHIFT, rWORD2, rSHL
+ sld rWORD5, rWORD1, rWORD6
+ sld rWORD6, rWORD8, rWORD6
+ b L(duP2e)
+/* Remainder is 24. */
+ .align 4
+L(duPs3):
+ sld rWORD4_SHIFT, rWORD2, rSHL
+ sld rWORD3, rWORD1, rWORD6
+ sld rWORD4, rWORD8, rWORD6
+ b L(duP3e)
+/* Count is a multiple of 32, remainder is 0. */
+ .align 4
+L(duPs4):
+ mtctr r0
+ or rWORD8, r12, rWORD8
+ sld rWORD2_SHIFT, rWORD2, rSHL
+ sld rWORD1, rWORD1, rWORD6
+ sld rWORD2, rWORD8, rWORD6
+ b L(duP4e)
+
+/* At this point we know rSTR1 is double word aligned and the
+ compare length is at least 8 bytes. */
+ .align 4
+L(DWunaligned):
+ std rWORD8_SHIFT, rWORD8SHIFTSAVE(r1)
+ clrrdi rSTR2, rSTR2, 3
+ std rWORD2_SHIFT, rWORD2SHIFTSAVE(r1)
+ srdi r0, rN, 5 /* Divide by 32. */
+ std rWORD4_SHIFT, rWORD4SHIFTSAVE(r1)
+ andi. r12, rN, 24 /* Get the DW remainder. */
+ std rWORD6_SHIFT, rWORD6SHIFTSAVE(r1)
+ cfi_offset(rWORD8_SHIFT, rWORD8SHIFTSAVE)
+ cfi_offset(rWORD2_SHIFT, rWORD2SHIFTSAVE)
+ cfi_offset(rWORD4_SHIFT, rWORD4SHIFTSAVE)
+ cfi_offset(rWORD6_SHIFT, rWORD6SHIFTSAVE)
+ sldi rSHL, rSHL, 3
+ LD rWORD6, 0, rSTR2
+ LD rWORD8, rOFF8, rSTR2
+ addi rSTR2, rSTR2, 8
+ cmpldi cr1, r12, 16
+ cmpldi cr7, rN, 32
+ clrldi rN, rN, 61
+ subfic rSHR, rSHL, 64
+ sld rWORD6_SHIFT, rWORD6, rSHL
+ beq L(duP4)
+ mtctr r0
+ bgt cr1, L(duP3)
+ beq cr1, L(duP2)
+
+/* Remainder is 8. */
+ .align 4
+L(duP1):
+ srd r12, rWORD8, rSHR
+ LD rWORD7, 0, rSTR1
+ sld rWORD8_SHIFT, rWORD8, rSHL
+ or rWORD8, r12, rWORD6_SHIFT
+ blt cr7, L(duP1x)
+L(duP1e):
+ LD rWORD1, rOFF8, rSTR1
+ LD rWORD2, rOFF8, rSTR2
+ cmpld cr5, rWORD7, rWORD8
+ srd r0, rWORD2, rSHR
+ sld rWORD2_SHIFT, rWORD2, rSHL
+ or rWORD2, r0, rWORD8_SHIFT
+ LD rWORD3, rOFF16, rSTR1
+ LD rWORD4, rOFF16, rSTR2
+ cmpld cr7, rWORD1, rWORD2
+ srd r12, rWORD4, rSHR
+ sld rWORD4_SHIFT, rWORD4, rSHL
+ bne cr5, L(duLcr5)
+ or rWORD4, r12, rWORD2_SHIFT
+ LD rWORD5, rOFF24, rSTR1
+ LD rWORD6, rOFF24, rSTR2
+ cmpld cr1, rWORD3, rWORD4
+ srd r0, rWORD6, rSHR
+ sld rWORD6_SHIFT, rWORD6, rSHL
+ bne cr7, L(duLcr7)
+ or rWORD6, r0, rWORD4_SHIFT
+ cmpld cr6, rWORD5, rWORD6
+ b L(duLoop3)
+ .align 4
+/* At this point we exit early with the first double word compare
+ complete and remainder of 0 to 7 bytes. See L(du14) for details on
+ how we handle the remaining bytes. */
+L(duP1x):
+ cmpld cr5, rWORD7, rWORD8
+ sldi. rN, rN, 3
+ bne cr5, L(duLcr5)
+ cmpld cr7, rN, rSHR
+ beq L(duZeroReturn)
+ li r0, 0
+ ble cr7, L(dutrim)
+ LD rWORD2, rOFF8, rSTR2
+ srd r0, rWORD2, rSHR
+ b L(dutrim)
+/* Remainder is 16. */
+ .align 4
+L(duP2):
+ srd r0, rWORD8, rSHR
+ LD rWORD5, 0, rSTR1
+ or rWORD6, r0, rWORD6_SHIFT
+ sld rWORD6_SHIFT, rWORD8, rSHL
+L(duP2e):
+ LD rWORD7, rOFF8, rSTR1
+ LD rWORD8, rOFF8, rSTR2
+ cmpld cr6, rWORD5, rWORD6
+ srd r12, rWORD8, rSHR
+ sld rWORD8_SHIFT, rWORD8, rSHL
+ or rWORD8, r12, rWORD6_SHIFT
+ blt cr7, L(duP2x)
+ LD rWORD1, rOFF16, rSTR1
+ LD rWORD2, rOFF16, rSTR2
+ cmpld cr5, rWORD7, rWORD8
+ bne cr6, L(duLcr6)
+ srd r0, rWORD2, rSHR
+ sld rWORD2_SHIFT, rWORD2, rSHL
+ or rWORD2, r0, rWORD8_SHIFT
+ LD rWORD3, rOFF24, rSTR1
+ LD rWORD4, rOFF24, rSTR2
+ cmpld cr7, rWORD1, rWORD2
+ bne cr5, L(duLcr5)
+ srd r12, rWORD4, rSHR
+ sld rWORD4_SHIFT, rWORD4, rSHL
+ or rWORD4, r12, rWORD2_SHIFT
+ addi rSTR1, rSTR1, 8
+ addi rSTR2, rSTR2, 8
+ cmpld cr1, rWORD3, rWORD4
+ b L(duLoop2)
+ .align 4
+L(duP2x):
+ cmpld cr5, rWORD7, rWORD8
+ addi rSTR1, rSTR1, 8
+ addi rSTR2, rSTR2, 8
+ bne cr6, L(duLcr6)
+ sldi. rN, rN, 3
+ bne cr5, L(duLcr5)
+ cmpld cr7, rN, rSHR
+ beq L(duZeroReturn)
+ li r0, 0
+ ble cr7, L(dutrim)
+ LD rWORD2, rOFF8, rSTR2
+ srd r0, rWORD2, rSHR
+ b L(dutrim)
+
+/* Remainder is 24. */
+ .align 4
+L(duP3):
+ srd r12, rWORD8, rSHR
+ LD rWORD3, 0, rSTR1
+ sld rWORD4_SHIFT, rWORD8, rSHL
+ or rWORD4, r12, rWORD6_SHIFT
+L(duP3e):
+ LD rWORD5, rOFF8, rSTR1
+ LD rWORD6, rOFF8, rSTR2
+ cmpld cr1, rWORD3, rWORD4
+ srd r0, rWORD6, rSHR
+ sld rWORD6_SHIFT, rWORD6, rSHL
+ or rWORD6, r0, rWORD4_SHIFT
+ LD rWORD7, rOFF16, rSTR1
+ LD rWORD8, rOFF16, rSTR2
+ cmpld cr6, rWORD5, rWORD6
+ bne cr1, L(duLcr1)
+ srd r12, rWORD8, rSHR
+ sld rWORD8_SHIFT, rWORD8, rSHL
+ or rWORD8, r12, rWORD6_SHIFT
+ blt cr7, L(duP3x)
+ LD rWORD1, rOFF24, rSTR1
+ LD rWORD2, rOFF24, rSTR2
+ cmpld cr5, rWORD7, rWORD8
+ bne cr6, L(duLcr6)
+ srd r0, rWORD2, rSHR
+ sld rWORD2_SHIFT, rWORD2, rSHL
+ or rWORD2, r0, rWORD8_SHIFT
+ addi rSTR1, rSTR1, 16
+ addi rSTR2, rSTR2, 16
+ cmpld cr7, rWORD1, rWORD2
+ b L(duLoop1)
+ .align 4
+L(duP3x):
+ addi rSTR1, rSTR1, 16
+ addi rSTR2, rSTR2, 16
+ cmpld cr5, rWORD7, rWORD8
+ bne cr6, L(duLcr6)
+ sldi. rN, rN, 3
+ bne cr5, L(duLcr5)
+ cmpld cr7, rN, rSHR
+ beq L(duZeroReturn)
+ li r0, 0
+ ble cr7, L(dutrim)
+ LD rWORD2, rOFF8, rSTR2
+ srd r0, rWORD2, rSHR
+ b L(dutrim)
+
+/* Count is a multiple of 32, remainder is 0. */
+ .align 4
+L(duP4):
+ mtctr r0
+ srd r0, rWORD8, rSHR
+ LD rWORD1, 0, rSTR1
+ sld rWORD2_SHIFT, rWORD8, rSHL
+ or rWORD2, r0, rWORD6_SHIFT
+L(duP4e):
+ LD rWORD3, rOFF8, rSTR1
+ LD rWORD4, rOFF8, rSTR2
+ cmpld cr7, rWORD1, rWORD2
+ srd r12, rWORD4, rSHR
+ sld rWORD4_SHIFT, rWORD4, rSHL
+ or rWORD4, r12, rWORD2_SHIFT
+ LD rWORD5, rOFF16, rSTR1
+ LD rWORD6, rOFF16, rSTR2
+ cmpld cr1, rWORD3, rWORD4
+ bne cr7, L(duLcr7)
+ srd r0, rWORD6, rSHR
+ sld rWORD6_SHIFT, rWORD6, rSHL
+ or rWORD6, r0, rWORD4_SHIFT
+ LD rWORD7, rOFF24, rSTR1
+ LD rWORD8, rOFF24, rSTR2
+ addi rSTR1, rSTR1, 24
+ addi rSTR2, rSTR2, 24
+ cmpld cr6, rWORD5, rWORD6
+ bne cr1, L(duLcr1)
+ srd r12, rWORD8, rSHR
+ sld rWORD8_SHIFT, rWORD8, rSHL
+ or rWORD8, r12, rWORD6_SHIFT
+ cmpld cr5, rWORD7, rWORD8
+ bdz L(du24) /* Adjust CTR as we start with +4. */
+/* This is the primary loop. */
+ .align 4
+L(duLoop):
+ LD rWORD1, rOFF8, rSTR1
+ LD rWORD2, rOFF8, rSTR2
+ cmpld cr1, rWORD3, rWORD4
+ bne cr6, L(duLcr6)
+ srd r0, rWORD2, rSHR
+ sld rWORD2_SHIFT, rWORD2, rSHL
+ or rWORD2, r0, rWORD8_SHIFT
+L(duLoop1):
+ LD rWORD3, rOFF16, rSTR1
+ LD rWORD4, rOFF16, rSTR2
+ cmpld cr6, rWORD5, rWORD6
+ bne cr5, L(duLcr5)
+ srd r12, rWORD4, rSHR
+ sld rWORD4_SHIFT, rWORD4, rSHL
+ or rWORD4, r12, rWORD2_SHIFT
+L(duLoop2):
+ LD rWORD5, rOFF24, rSTR1
+ LD rWORD6, rOFF24, rSTR2
+ cmpld cr5, rWORD7, rWORD8
+ bne cr7, L(duLcr7)
+ srd r0, rWORD6, rSHR
+ sld rWORD6_SHIFT, rWORD6, rSHL
+ or rWORD6, r0, rWORD4_SHIFT
+L(duLoop3):
+ LD rWORD7, rOFF32, rSTR1
+ LD rWORD8, rOFF32, rSTR2
+ addi rSTR1, rSTR1, 32
+ addi rSTR2, rSTR2, 32
+ cmpld cr7, rWORD1, rWORD2
+ bne cr1, L(duLcr1)
+ srd r12, rWORD8, rSHR
+ sld rWORD8_SHIFT, rWORD8, rSHL
+ or rWORD8, r12, rWORD6_SHIFT
+ bdnz L(duLoop)
+
+L(duL4):
+ cmpld cr1, rWORD3, rWORD4
+ bne cr6, L(duLcr6)
+ cmpld cr6, rWORD5, rWORD6
+ bne cr5, L(duLcr5)
+ cmpld cr5, rWORD7, rWORD8
+L(du44):
+ bne cr7, L(duLcr7)
+L(du34):
+ bne cr1, L(duLcr1)
+L(du24):
+ bne cr6, L(duLcr6)
+L(du14):
+ sldi. rN, rN, 3
+ bne cr5, L(duLcr5)
+/* At this point we have a remainder of 1 to 7 bytes to compare. We use
+ shift right double to eliminate bits beyond the compare length.
+
+ However it may not be safe to load rWORD2 which may be beyond the
+ string length. So we compare the bit length of the remainder to
+ the right shift count (rSHR). If the bit count is less than or equal
+ we do not need to load rWORD2 (all significant bits are already in
+ rWORD8_SHIFT). */
+ cmpld cr7, rN, rSHR
+ beq L(duZeroReturn)
+ li r0, 0
+ ble cr7, L(dutrim)
+ LD rWORD2, rOFF8, rSTR2
+ srd r0, rWORD2, rSHR
+ .align 4
+L(dutrim):
+ LD rWORD1, rOFF8, rSTR1
+ ld rWORD8, -8(r1)
+ subfic rN, rN, 64 /* Shift count is 64 - (rN * 8). */
+ or rWORD2, r0, rWORD8_SHIFT
+ ld rWORD7, rWORD7SAVE(r1)
+ ld rSHL, rSHLSAVE(r1)
+ srd rWORD1, rWORD1, rN
+ srd rWORD2, rWORD2, rN
+ ld rSHR, rSHRSAVE(r1)
+ ld rWORD8_SHIFT, rWORD8SHIFTSAVE(r1)
+ li rRTN, 0
+ cmpld cr7, rWORD1, rWORD2
+ ld rWORD2_SHIFT, rWORD2SHIFTSAVE(r1)
+ ld rWORD4_SHIFT, rWORD4SHIFTSAVE(r1)
+ beq cr7, L(dureturn24)
+ li rRTN, 1
+ ld rWORD6_SHIFT, rWORD6SHIFTSAVE(r1)
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ bgtlr cr7
+ li rRTN, -1
+ blr
+ .align 4
+L(duLcr7):
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+ li rRTN, 1
+ bgt cr7, L(dureturn29)
+ ld rSHL, rSHLSAVE(r1)
+ ld rSHR, rSHRSAVE(r1)
+ li rRTN, -1
+ b L(dureturn27)
+ .align 4
+L(duLcr1):
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+ li rRTN, 1
+ bgt cr1, L(dureturn29)
+ ld rSHL, rSHLSAVE(r1)
+ ld rSHR, rSHRSAVE(r1)
+ li rRTN, -1
+ b L(dureturn27)
+ .align 4
+L(duLcr6):
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+ li rRTN, 1
+ bgt cr6, L(dureturn29)
+ ld rSHL, rSHLSAVE(r1)
+ ld rSHR, rSHRSAVE(r1)
+ li rRTN, -1
+ b L(dureturn27)
+ .align 4
+L(duLcr5):
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+ li rRTN, 1
+ bgt cr5, L(dureturn29)
+ ld rSHL, rSHLSAVE(r1)
+ ld rSHR, rSHRSAVE(r1)
+ li rRTN, -1
+ b L(dureturn27)
+
+ .align 3
+L(duZeroReturn):
+ li rRTN, 0
+ .align 4
+L(dureturn):
+ ld rWORD8, rWORD8SAVE(r1)
+ ld rWORD7, rWORD7SAVE(r1)
+L(dureturn29):
+ ld rSHL, rSHLSAVE(r1)
+ ld rSHR, rSHRSAVE(r1)
+L(dureturn27):
+ ld rWORD8_SHIFT, rWORD8SHIFTSAVE(r1)
+ ld rWORD2_SHIFT, rWORD2SHIFTSAVE(r1)
+ ld rWORD4_SHIFT, rWORD4SHIFTSAVE(r1)
+L(dureturn24):
+ ld rWORD6_SHIFT, rWORD6SHIFTSAVE(r1)
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ blr
+
+L(duzeroLength):
+ ld rOFF8, rOFF8SAVE(r1)
+ ld rOFF16, rOFF16SAVE(r1)
+ ld rOFF24, rOFF24SAVE(r1)
+ ld rOFF32, rOFF32SAVE(r1)
+ li rRTN, 0
+ blr
+
+END (MEMCMP)
+libc_hidden_builtin_def (memcmp)
+weak_alias (memcmp, bcmp)
diff --git a/sysdeps/powerpc/powerpc64/power8/memrchr.S b/sysdeps/powerpc/powerpc64/power8/memrchr.S
new file mode 100644
index 0000000000..54de6566bd
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/memrchr.S
@@ -0,0 +1,345 @@
+/* Optimized memrchr implementation for PowerPC64/POWER8.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ Contributed by Luis Machado <luisgpm@br.ibm.com>.
+ 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>
+
+/* int [r3] memrchr (char *s [r3], int byte [r4], int size [r5]) */
+
+/* TODO: change these to the actual instructions when the minimum required
+ binutils allows it. */
+#define MTVRD(v, r) .long (0x7c000167 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#define MFVRD(r, v) .long (0x7c000067 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#define VBPERMQ(t, a, b) .long (0x1000054c \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+#ifndef MEMRCHR
+# define MEMRCHR __memrchr
+#endif
+ .machine power7
+ENTRY_TOCLESS (MEMRCHR)
+ CALL_MCOUNT 3
+ add r7, r3, r5 /* Calculate the last acceptable address. */
+ neg r0, r7
+ addi r7, r7, -1
+ mr r10, r3
+ clrrdi r6, r7, 7
+ li r9, 3<<5
+ dcbt r9, r6, 8 /* Stream hint, decreasing addresses. */
+
+ /* Replicate BYTE to doubleword. */
+ insrdi r4, r4, 8, 48
+ insrdi r4, r4, 16, 32
+ insrdi r4, r4, 32, 0
+ li r6, -8
+ li r9, -1
+ rlwinm r0, r0, 3, 26, 28 /* Calculate padding. */
+ clrrdi r8, r7, 3
+ srd r9, r9, r0
+ cmpldi r5, 32
+ clrrdi r0, r10, 3
+ ble L(small_range)
+
+#ifdef __LITTLE_ENDIAN__
+ ldx r12, 0, r8
+#else
+ ldbrx r12, 0, r8 /* Load reversed doubleword from memory. */
+#endif
+ cmpb r3, r12, r4 /* Check for BYTE in DWORD1. */
+ and r3, r3, r9
+ cmpldi cr7, r3, 0 /* If r3 == 0, no BYTEs have been found. */
+ bne cr7, L(done)
+
+ /* Are we now aligned to a quadword boundary? If so, skip to
+ the main loop. Otherwise, go through the alignment code. */
+ andi. r12, r8, 15
+ beq cr0, L(align_qw)
+
+ /* Handle DWORD2 of pair. */
+#ifdef __LITTLE_ENDIAN__
+ ldx r12, r8, r6
+#else
+ ldbrx r12, r8, r6
+#endif
+ addi r8, r8, -8
+ cmpb r3, r12, r4
+ cmpldi cr7, r3, 0
+ bne cr7, L(done)
+
+ .align 4
+ /* At this point, r8 is 16B aligned. */
+L(align_qw):
+ sub r5, r8, r0
+ vspltisb v0, 0
+ /* Precompute vbpermq constant. */
+ vspltisb v10, 3
+ li r0, 0
+ lvsl v11, r0, r0
+ vslb v10, v11, v10
+ MTVRD(v1, r4)
+ vspltb v1, v1, 7
+ cmpldi r5, 64
+ ble L(tail64)
+ /* Are we 64-byte aligned? If so, jump to the vectorized loop.
+ Note: aligning to 64-byte will necessarily slow down performance for
+ strings around 64 bytes in length due to the extra comparisons
+ required to check alignment for the vectorized loop. This is a
+ necessary tradeoff we are willing to take in order to speed up the
+ calculation for larger strings. */
+ andi. r11, r8, 63
+ beq cr0, L(preloop_64B)
+ /* In order to begin the 64B loop, it needs to be 64
+ bytes aligned. So read until it is 64B aligned. */
+ addi r8, r8, -16
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ addi r5, r5, -16
+
+ andi. r11, r8, 63
+ beq cr0, L(preloop_64B)
+ addi r8, r8, -16
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ addi r5, r5, -16
+
+ andi. r11, r8, 63
+ beq cr0, L(preloop_64B)
+ addi r8, r8, -16
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ addi r5, r5, -16
+ /* At this point it should be 64B aligned.
+ Prepare for the 64B loop. */
+L(preloop_64B):
+ cmpldi r5, 64 /* Check if r5 < 64. */
+ ble L(tail64)
+ srdi r9, r5, 6 /* Number of loop iterations. */
+ mtctr r9 /* Setup the counter. */
+ li r11, 16 /* Load required offsets. */
+ li r9, 32
+ li r7, 48
+
+ /* Handle r5 > 64. Loop over the bytes in strides of 64B. */
+ .align 4
+L(loop):
+ addi r8, r8, -64 /* Adjust address for the next iteration. */
+ lvx v2, 0, r8 /* Load 4 quadwords. */
+ lvx v3, r8, r11
+ lvx v4, v8, r9
+ lvx v5, v8, r7
+ vcmpequb v6, v1, v2
+ vcmpequb v7, v1, v3
+ vcmpequb v8, v1, v4
+ vcmpequb v9, v1, v5
+ vor v11, v6, v7
+ vor v12, v8, v9
+ vor v11, v11, v12 /* Compare and merge into one VR for speed. */
+ vcmpequb. v11, v0, v11
+ bnl cr6, L(found)
+ bdnz L(loop)
+ clrldi r5, r5, 58
+
+ /* Handle remainder of 64B loop or r5 > 64. */
+ .align 4
+L(tail64):
+ cmpldi r5, 0
+ beq L(null)
+ addi r8, r8, -16
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ cmpldi cr6, r5, 16
+ ble cr6, L(null)
+ addi r5, r5, -16
+
+ addi r8, r8, -16
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ cmpldi cr6, r5, 16
+ ble cr6, L(null)
+ addi r5, r5, -16
+
+ addi r8, r8, -16
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ cmpldi cr6, r5, 16
+ ble cr6, L(null)
+ addi r5, r5, -16
+
+ addi r8, r8, -16
+ lvx v4, 0, r8
+ vcmpequb v6, v1, v4
+ vcmpequb. v11, v0, v6
+ bnl cr6, L(found_16B)
+ li r3, 0
+ blr
+
+ /* Found a match in 64B loop. */
+ .align 4
+L(found):
+ /* Permute the first bit of each byte into bits 48-63. */
+ VBPERMQ(v6, v6, v10)
+ VBPERMQ(v7, v7, v10)
+ VBPERMQ(v8, v8, v10)
+ VBPERMQ(v9, v9, v10)
+ /* Shift each component into its correct position for merging. */
+#ifdef __LITTLE_ENDIAN__
+ vsldoi v7, v7, v7, 2
+ vsldoi v8, v8, v8, 4
+ vsldoi v9, v9, v9, 6
+#else
+ vsldoi v6, v6, v6, 6
+ vsldoi v7, v7, v7, 4
+ vsldoi v8, v8, v8, 2
+#endif
+ /* Merge the results and move to a GPR. */
+ vor v11, v6, v7
+ vor v4, v9, v8
+ vor v4, v11, v4
+ MFVRD(r5, v4)
+#ifdef __LITTLE_ENDIAN__
+ cntlzd r6, r5 /* Count leading zeros before the match. */
+#else
+ addi r6, r5, -1
+ andc r6, r6, r5
+ popcntd r6, r6
+#endif
+ addi r8, r8, 63
+ sub r3, r8, r6 /* Compute final address. */
+ cmpld cr7, r3, r10
+ bgelr cr7
+ li r3, 0
+ blr
+
+ /* Found a match in last 16 bytes. */
+ .align 4
+L(found_16B):
+ cmpld r8, r10 /* Are we on the last QW? */
+ bge L(last)
+ /* Now discard bytes before starting address. */
+ sub r9, r10, r8
+ MTVRD(v9, r9)
+ vspltisb v8, 3
+ /* Mask unwanted bytes. */
+#ifdef __LITTLE_ENDIAN__
+ lvsr v7, 0, r10
+ vperm v6, v0, v6, v7
+ vsldoi v9, v0, v9, 8
+ vsl v9, v9, v8
+ vslo v6, v6, v9
+#else
+ lvsl v7, 0, r10
+ vperm v6, v6, v0, v7
+ vsldoi v9, v0, v9, 8
+ vsl v9, v9, v8
+ vsro v6, v6, v9
+#endif
+L(last):
+ /* Permute the first bit of each byte into bits 48-63. */
+ VBPERMQ(v6, v6, v10)
+ /* Shift each component into its correct position for merging. */
+#ifdef __LITTLE_ENDIAN__
+ vsldoi v6, v6, v6, 6
+ MFVRD(r7, v6)
+ cntlzd r6, r7 /* Count leading zeros before the match. */
+#else
+ MFVRD(r7, v6)
+ addi r6, r7, -1
+ andc r6, r6, r7
+ popcntd r6, r6
+#endif
+ addi r8, r8, 15
+ sub r3, r8, r6 /* Compute final address. */
+ cmpld r6, r5
+ bltlr
+ li r3, 0
+ blr
+
+ /* r3 has the output of the cmpb instruction, that is, it contains
+ 0xff in the same position as BYTE in the original
+ word from the string. Use that to calculate the pointer.
+ We need to make sure BYTE is *before* the end of the
+ range. */
+L(done):
+ cntlzd r9, r3 /* Count leading zeros before the match. */
+ cmpld r8, r0 /* Are we on the last word? */
+ srdi r6, r9, 3 /* Convert leading zeros to bytes. */
+ addi r0, r6, -7
+ sub r3, r8, r0
+ cmpld cr7, r3, r10
+ bnelr
+ bgelr cr7
+ li r3, 0
+ blr
+
+ .align 4
+L(null):
+ li r3, 0
+ blr
+
+/* Deals with size <= 32. */
+ .align 4
+L(small_range):
+ cmpldi r5, 0
+ beq L(null)
+
+#ifdef __LITTLE_ENDIAN__
+ ldx r12, 0, r8
+#else
+ ldbrx r12, 0, r8 /* Load reversed doubleword from memory. */
+#endif
+ cmpb r3, r12, r4 /* Check for BYTE in DWORD1. */
+ and r3, r3, r9
+ cmpldi cr7, r3, 0
+ bne cr7, L(done)
+
+ /* Are we done already? */
+ cmpld r8, r0
+ addi r8, r8, -8
+ beqlr
+
+ .align 5
+L(loop_small):
+#ifdef __LITTLE_ENDIAN__
+ ldx r12, 0, r8
+#else
+ ldbrx r12, 0, r8
+#endif
+ cmpb r3, r12, r4
+ cmpld r8, r0
+ cmpldi cr7, r3, 0
+ bne cr7, L(done)
+ addi r8, r8, -8
+ bne L(loop_small)
+ blr
+
+END (MEMRCHR)
+weak_alias (__memrchr, memrchr)
+libc_hidden_builtin_def (memrchr)
diff --git a/sysdeps/powerpc/powerpc64/power8/memset.S b/sysdeps/powerpc/powerpc64/power8/memset.S
index 11433d89ad..a42232b42a 100644
--- a/sysdeps/powerpc/powerpc64/power8/memset.S
+++ b/sysdeps/powerpc/powerpc64/power8/memset.S
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC64/POWER8.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,14 +20,18 @@
#define MTVSRD_V1_R4 .long 0x7c240166 /* mtvsrd v1,r4 */
-/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
+/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5]));
Returns 's'. */
+#ifndef MEMSET
+# define MEMSET memset
+#endif
+
/* No need to use .machine power8 since mtvsrd is already
handled by the define. It avoid breakage on binutils
that does not support this machine specifier. */
.machine power7
-EALIGN (memset, 5, 0)
+ENTRY_TOCLESS (MEMSET, 5)
CALL_MCOUNT 3
L(_memset):
@@ -373,7 +377,10 @@ L(write_LT_32):
subf r5,r0,r5
2: bf 30,1f
- sth r4,0(r10)
+ /* Use stb instead of sth because it doesn't generate
+ alignment interrupts on cache-inhibited storage. */
+ stb r4,0(r10)
+ stb r4,1(r10)
addi r10,r10,2
1: bf 31,L(end_4bytes_alignment)
@@ -433,17 +440,80 @@ L(tail5):
/* Handles copies of 0~8 bytes. */
.align 4
L(write_LE_8):
- bne cr6,L(tail4)
+ bne cr6,L(LE7_tail4)
+ /* If input is word aligned, use stw, else use stb. */
+ andi. r0,r10,3
+ bne L(8_unalign)
stw r4,0(r10)
stw r4,4(r10)
blr
-END_GEN_TB (memset,TB_TOCLESS)
+
+ /* Unaligned input and size is 8. */
+ .align 4
+L(8_unalign):
+ andi. r0,r10,1
+ beq L(8_hwalign)
+ stb r4,0(r10)
+ sth r4,1(r10)
+ sth r4,3(r10)
+ sth r4,5(r10)
+ stb r4,7(r10)
+ blr
+
+ /* Halfword aligned input and size is 8. */
+ .align 4
+L(8_hwalign):
+ sth r4,0(r10)
+ sth r4,2(r10)
+ sth r4,4(r10)
+ sth r4,6(r10)
+ blr
+
+ .align 4
+ /* Copies 4~7 bytes. */
+L(LE7_tail4):
+ /* Use stb instead of sth because it doesn't generate
+ alignment interrupts on cache-inhibited storage. */
+ bf 29,L(LE7_tail2)
+ stb r4,0(r10)
+ stb r4,1(r10)
+ stb r4,2(r10)
+ stb r4,3(r10)
+ bf 30,L(LE7_tail5)
+ stb r4,4(r10)
+ stb r4,5(r10)
+ bflr 31
+ stb r4,6(r10)
+ blr
+
+ .align 4
+ /* Copies 2~3 bytes. */
+L(LE7_tail2):
+ bf 30,1f
+ stb r4,0(r10)
+ stb r4,1(r10)
+ bflr 31
+ stb r4,2(r10)
+ blr
+
+ .align 4
+L(LE7_tail5):
+ bflr 31
+ stb r4,4(r10)
+ blr
+
+ .align 4
+1: bflr 31
+ stb r4,0(r10)
+ blr
+
+END_GEN_TB (MEMSET,TB_TOCLESS)
libc_hidden_builtin_def (memset)
/* Copied from bzero.S to prevent the linker from inserting a stub
between bzero and memset. */
-ENTRY (__bzero)
+ENTRY_TOCLESS (__bzero)
CALL_MCOUNT 3
mr r5,r4
li r4,0
diff --git a/sysdeps/powerpc/powerpc64/power8/multiarch/Implies b/sysdeps/powerpc/powerpc64/power8/multiarch/Implies
deleted file mode 100644
index 1fc7b7cd39..0000000000
--- a/sysdeps/powerpc/powerpc64/power8/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power7/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power8/stpcpy.S b/sysdeps/powerpc/powerpc64/power8/stpcpy.S
index fd8f7fa63a..ebdfaab97c 100644
--- a/sysdeps/powerpc/powerpc64/power8/stpcpy.S
+++ b/sysdeps/powerpc/powerpc64/power8/stpcpy.S
@@ -1,5 +1,5 @@
/* Optimized stpcpy implementation for PowerPC64/POWER8.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/power8/stpncpy.S b/sysdeps/powerpc/powerpc64/power8/stpncpy.S
index 067910b373..95c86e9677 100644
--- a/sysdeps/powerpc/powerpc64/power8/stpncpy.S
+++ b/sysdeps/powerpc/powerpc64/power8/stpncpy.S
@@ -1,5 +1,5 @@
/* Optimized stpncpy implementation for PowerPC64/POWER8.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,3 +18,7 @@
#define USE_AS_STPNCPY
#include <sysdeps/powerpc/powerpc64/power8/strncpy.S>
+
+weak_alias (__stpncpy, stpncpy)
+libc_hidden_def (__stpncpy)
+libc_hidden_builtin_def (stpncpy)
diff --git a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
new file mode 100644
index 0000000000..3a2efe2a64
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
@@ -0,0 +1,457 @@
+/* Optimized strcasecmp implementation for PowerPC64.
+ Copyright (C) 2016-2018 Free Software 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>
+#include <locale-defines.h>
+
+/* int [r3] strcasecmp (const char *s1 [r3], const char *s2 [r4] ) */
+
+#ifndef USE_AS_STRNCASECMP
+# define __STRCASECMP __strcasecmp
+# define STRCASECMP strcasecmp
+#else
+# define __STRCASECMP __strncasecmp
+# define STRCASECMP strncasecmp
+#endif
+/* Convert 16 bytes to lowercase and compare */
+#define TOLOWER() \
+ vaddubm v8, v4, v1; \
+ vaddubm v7, v4, v3; \
+ vcmpgtub v8, v8, v2; \
+ vsel v4, v7, v4, v8; \
+ vaddubm v8, v5, v1; \
+ vaddubm v7, v5, v3; \
+ vcmpgtub v8, v8, v2; \
+ vsel v5, v7, v5, v8; \
+ vcmpequb. v7, v5, v4;
+
+/*
+ * Get 16 bytes for unaligned case.
+ * reg1: Vector to hold next 16 bytes.
+ * reg2: Address to read from.
+ * reg3: Permute control vector.
+ * v8: Tmp vector used to mask unwanted bytes.
+ * v9: Tmp vector,0 when null is found on first 16 bytes
+ */
+#ifdef __LITTLE_ENDIAN__
+#define GET16BYTES(reg1, reg2, reg3) \
+ lvx reg1, 0, reg2; \
+ vspltisb v8, -1; \
+ vperm v8, v8, reg1, reg3; \
+ vcmpequb. v8, v0, v8; \
+ beq cr6, 1f; \
+ vspltisb v9, 0; \
+ b 2f; \
+ .align 4; \
+1: \
+ addi r6, reg2, 16; \
+ lvx v9, 0, r6; \
+2: \
+ vperm reg1, v9, reg1, reg3;
+#else
+#define GET16BYTES(reg1, reg2, reg3) \
+ lvx reg1, 0, reg2; \
+ vspltisb v8, -1; \
+ vperm v8, reg1, v8, reg3; \
+ vcmpequb. v8, v0, v8; \
+ beq cr6, 1f; \
+ vspltisb v9, 0; \
+ b 2f; \
+ .align 4; \
+1: \
+ addi r6, reg2, 16; \
+ lvx v9, 0, r6; \
+2: \
+ vperm reg1, reg1, v9, reg3;
+#endif
+
+/* Check null in v4, v5 and convert to lower. */
+#define CHECKNULLANDCONVERT() \
+ vcmpequb. v7, v0, v5; \
+ beq cr6, 3f; \
+ vcmpequb. v7, v0, v4; \
+ beq cr6, 3f; \
+ b L(null_found); \
+ .align 4; \
+3: \
+ TOLOWER()
+
+#ifdef _ARCH_PWR8
+# define VCLZD_V8_v7 vclzd v8, v7;
+# define MFVRD_R3_V1 mfvrd r3, v1;
+# define VSUBUDM_V9_V8 vsubudm v9, v9, v8;
+# define VPOPCNTD_V8_V8 vpopcntd v8, v8;
+# define VADDUQM_V7_V8 vadduqm v9, v7, v8;
+#else
+# define VCLZD_V8_v7 .long 0x11003fc2
+# define MFVRD_R3_V1 .long 0x7c230067
+# define VSUBUDM_V9_V8 .long 0x112944c0
+# define VPOPCNTD_V8_V8 .long 0x110047c3
+# define VADDUQM_V7_V8 .long 0x11274100
+#endif
+
+ .machine power7
+
+ENTRY (__STRCASECMP)
+#ifdef USE_AS_STRNCASECMP
+ CALL_MCOUNT 3
+#else
+ CALL_MCOUNT 2
+#endif
+#define rRTN r3 /* Return value */
+#define rSTR1 r10 /* 1st string */
+#define rSTR2 r4 /* 2nd string */
+#define rCHAR1 r6 /* Byte read from 1st string */
+#define rCHAR2 r7 /* Byte read from 2nd string */
+#define rADDR1 r8 /* Address of tolower(rCHAR1) */
+#define rADDR2 r12 /* Address of tolower(rCHAR2) */
+#define rLWR1 r8 /* Word tolower(rCHAR1) */
+#define rLWR2 r12 /* Word tolower(rCHAR2) */
+#define rTMP r9
+#define rLOC r11 /* Default locale address */
+
+ cmpd cr7, rRTN, rSTR2
+
+ /* Get locale address. */
+ ld rTMP, __libc_tsd_LOCALE@got@tprel(r2)
+ add rLOC, rTMP, __libc_tsd_LOCALE@tls
+ ld rLOC, 0(rLOC)
+
+ mr rSTR1, rRTN
+ li rRTN, 0
+ beqlr cr7
+#ifdef USE_AS_STRNCASECMP
+ cmpdi cr7, r5, 0
+ beq cr7, L(retnull)
+ cmpdi cr7, r5, 16
+ blt cr7, L(bytebybyte)
+#endif
+ vspltisb v0, 0
+ vspltisb v8, -1
+ /* Check for null in initial characters.
+ Check max of 16 char depending on the alignment.
+ If null is present, proceed byte by byte. */
+ lvx v4, 0, rSTR1
+#ifdef __LITTLE_ENDIAN__
+ lvsr v10, 0, rSTR1 /* Compute mask. */
+ vperm v9, v8, v4, v10 /* Mask bits that are not part of string. */
+#else
+ lvsl v10, 0, rSTR1
+ vperm v9, v4, v8, v10
+#endif
+ vcmpequb. v9, v0, v9 /* Check for null bytes. */
+ bne cr6, L(bytebybyte)
+ lvx v5, 0, rSTR2
+ /* Calculate alignment. */
+#ifdef __LITTLE_ENDIAN__
+ lvsr v6, 0, rSTR2
+ vperm v9, v8, v5, v6 /* Mask bits that are not part of string. */
+#else
+ lvsl v6, 0, rSTR2
+ vperm v9, v5, v8, v6
+#endif
+ vcmpequb. v9, v0, v9 /* Check for null bytes. */
+ bne cr6, L(bytebybyte)
+ /* Check if locale has non ascii characters. */
+ ld rTMP, 0(rLOC)
+ addi r6, rTMP,LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES
+ lwz rTMP, 0(r6)
+ cmpdi cr7, rTMP, 1
+ beq cr7, L(bytebybyte)
+
+ /* Load vector registers with values used for TOLOWER. */
+ /* Load v1 = 0xbf, v2 = 0x19 v3 = 0x20 in each byte. */
+ vspltisb v3, 2
+ vspltisb v9, 4
+ vsl v3, v3, v9
+ vaddubm v1, v3, v3
+ vnor v1, v1, v1
+ vspltisb v2, 7
+ vsububm v2, v3, v2
+
+ andi. rADDR1, rSTR1, 0xF
+ beq cr0, L(align)
+ addi r6, rSTR1, 16
+ lvx v9, 0, r6
+ /* Compute 16 bytes from previous two loads. */
+#ifdef __LITTLE_ENDIAN__
+ vperm v4, v9, v4, v10
+#else
+ vperm v4, v4, v9, v10
+#endif
+L(align):
+ andi. rADDR2, rSTR2, 0xF
+ beq cr0, L(align1)
+ addi r6, rSTR2, 16
+ lvx v9, 0, r6
+ /* Compute 16 bytes from previous two loads. */
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v9, v5, v6
+#else
+ vperm v5, v5, v9, v6
+#endif
+L(align1):
+ CHECKNULLANDCONVERT()
+ blt cr6, L(match)
+ b L(different)
+ .align 4
+L(match):
+ clrldi r6, rSTR1, 60
+ subfic r7, r6, 16
+#ifdef USE_AS_STRNCASECMP
+ sub r5, r5, r7
+#endif
+ add rSTR1, rSTR1, r7
+ add rSTR2, rSTR2, r7
+ andi. rADDR2, rSTR2, 0xF
+ addi rSTR1, rSTR1, -16
+ addi rSTR2, rSTR2, -16
+ beq cr0, L(aligned)
+#ifdef __LITTLE_ENDIAN__
+ lvsr v6, 0, rSTR2
+#else
+ lvsl v6, 0, rSTR2
+#endif
+ /* There are 2 loops depending on the input alignment.
+ Each loop gets 16 bytes from s1 and s2, check for null,
+ convert to lowercase and compare. Loop till difference
+ or null occurs. */
+L(s1_align):
+ addi rSTR1, rSTR1, 16
+ addi rSTR2, rSTR2, 16
+#ifdef USE_AS_STRNCASECMP
+ cmpdi cr7, r5, 16
+ blt cr7, L(bytebybyte)
+ addi r5, r5, -16
+#endif
+ lvx v4, 0, rSTR1
+ GET16BYTES(v5, rSTR2, v6)
+ CHECKNULLANDCONVERT()
+ blt cr6, L(s1_align)
+ b L(different)
+ .align 4
+L(aligned):
+ addi rSTR1, rSTR1, 16
+ addi rSTR2, rSTR2, 16
+#ifdef USE_AS_STRNCASECMP
+ cmpdi cr7, r5, 16
+ blt cr7, L(bytebybyte)
+ addi r5, r5, -16
+#endif
+ lvx v4, 0, rSTR1
+ lvx v5, 0, rSTR2
+ CHECKNULLANDCONVERT()
+ blt cr6, L(aligned)
+
+ /* Calculate and return the difference. */
+L(different):
+ vaddubm v1, v3, v3
+ vcmpequb v7, v0, v7
+#ifdef __LITTLE_ENDIAN__
+ /* Count trailing zero. */
+ vspltisb v8, -1
+ VADDUQM_V7_V8
+ vandc v8, v9, v7
+ VPOPCNTD_V8_V8
+ vspltb v6, v8, 15
+ vcmpequb. v6, v6, v1
+ blt cr6, L(shift8)
+#else
+ /* Count leading zero. */
+ VCLZD_V8_v7
+ vspltb v6, v8, 7
+ vcmpequb. v6, v6, v1
+ blt cr6, L(shift8)
+ vsro v8, v8, v1
+#endif
+ b L(skipsum)
+ .align 4
+L(shift8):
+ vsumsws v8, v8, v0
+L(skipsum):
+#ifdef __LITTLE_ENDIAN__
+ /* Shift registers based on leading zero count. */
+ vsro v6, v5, v8
+ vsro v7, v4, v8
+ /* Merge and move to GPR. */
+ vmrglb v6, v6, v7
+ vslo v1, v6, v1
+ MFVRD_R3_V1
+ /* Place the characters that are different in first position. */
+ sldi rSTR2, rRTN, 56
+ srdi rSTR2, rSTR2, 56
+ sldi rSTR1, rRTN, 48
+ srdi rSTR1, rSTR1, 56
+#else
+ vslo v6, v5, v8
+ vslo v7, v4, v8
+ vmrghb v1, v6, v7
+ MFVRD_R3_V1
+ srdi rSTR2, rRTN, 48
+ sldi rSTR2, rSTR2, 56
+ srdi rSTR2, rSTR2, 56
+ srdi rSTR1, rRTN, 56
+#endif
+ subf rRTN, rSTR1, rSTR2
+ extsw rRTN, rRTN
+ blr
+
+ .align 4
+ /* OK. We've hit the end of the string. We need to be careful that
+ we don't compare two strings as different because of junk beyond
+ the end of the strings... */
+L(null_found):
+ vaddubm v10, v3, v3
+#ifdef __LITTLE_ENDIAN__
+ /* Count trailing zero. */
+ vspltisb v8, -1
+ VADDUQM_V7_V8
+ vandc v8, v9, v7
+ VPOPCNTD_V8_V8
+ vspltb v6, v8, 15
+ vcmpequb. v6, v6, v10
+ blt cr6, L(shift_8)
+#else
+ /* Count leading zero. */
+ VCLZD_V8_v7
+ vspltb v6, v8, 7
+ vcmpequb. v6, v6, v10
+ blt cr6, L(shift_8)
+ vsro v8, v8, v10
+#endif
+ b L(skipsum1)
+ .align 4
+L(shift_8):
+ vsumsws v8, v8, v0
+L(skipsum1):
+ /* Calculate shift count based on count of zero. */
+ vspltisb v10, 7
+ vslb v10, v10, v10
+ vsldoi v9, v0, v10, 1
+ VSUBUDM_V9_V8
+ vspltisb v8, 8
+ vsldoi v8, v0, v8, 1
+ VSUBUDM_V9_V8
+ /* Shift and remove junk after null character. */
+#ifdef __LITTLE_ENDIAN__
+ vslo v5, v5, v9
+ vslo v4, v4, v9
+#else
+ vsro v5, v5, v9
+ vsro v4, v4, v9
+#endif
+ /* Convert and compare 16 bytes. */
+ TOLOWER()
+ blt cr6, L(retnull)
+ b L(different)
+ .align 4
+L(retnull):
+ li rRTN, 0
+ blr
+ .align 4
+L(bytebybyte):
+ /* Unrolling loop for POWER: loads are done with 'lbz' plus
+ offset and string descriptors are only updated in the end
+ of loop unrolling. */
+ ld rLOC, LOCALE_CTYPE_TOLOWER(rLOC)
+ lbz rCHAR1, 0(rSTR1) /* Load char from s1 */
+ lbz rCHAR2, 0(rSTR2) /* Load char from s2 */
+#ifdef USE_AS_STRNCASECMP
+ rldicl rTMP, r5, 62, 2
+ cmpdi cr7, rTMP, 0
+ beq cr7, L(lessthan4)
+ mtctr rTMP
+#endif
+L(loop):
+ cmpdi rCHAR1, 0 /* *s1 == '\0' ? */
+ sldi rADDR1, rCHAR1, 2 /* Calculate address for tolower(*s1) */
+ sldi rADDR2, rCHAR2, 2 /* Calculate address for tolower(*s2) */
+ lwzx rLWR1, rLOC, rADDR1 /* Load tolower(*s1) */
+ lwzx rLWR2, rLOC, rADDR2 /* Load tolower(*s2) */
+ cmpw cr1, rLWR1, rLWR2 /* r = tolower(*s1) == tolower(*s2) ? */
+ crorc 4*cr1+eq,eq,4*cr1+eq /* (*s1 != '\0') || (r == 1) */
+ beq cr1, L(done)
+ lbz rCHAR1, 1(rSTR1)
+ lbz rCHAR2, 1(rSTR2)
+ cmpdi rCHAR1, 0
+ sldi rADDR1, rCHAR1, 2
+ sldi rADDR2, rCHAR2, 2
+ lwzx rLWR1, rLOC, rADDR1
+ lwzx rLWR2, rLOC, rADDR2
+ cmpw cr1, rLWR1, rLWR2
+ crorc 4*cr1+eq,eq,4*cr1+eq
+ beq cr1, L(done)
+ lbz rCHAR1, 2(rSTR1)
+ lbz rCHAR2, 2(rSTR2)
+ cmpdi rCHAR1, 0
+ sldi rADDR1, rCHAR1, 2
+ sldi rADDR2, rCHAR2, 2
+ lwzx rLWR1, rLOC, rADDR1
+ lwzx rLWR2, rLOC, rADDR2
+ cmpw cr1, rLWR1, rLWR2
+ crorc 4*cr1+eq,eq,4*cr1+eq
+ beq cr1, L(done)
+ lbz rCHAR1, 3(rSTR1)
+ lbz rCHAR2, 3(rSTR2)
+ cmpdi rCHAR1, 0
+ /* Increment both string descriptors */
+ addi rSTR1, rSTR1, 4
+ addi rSTR2, rSTR2, 4
+ sldi rADDR1, rCHAR1, 2
+ sldi rADDR2, rCHAR2, 2
+ lwzx rLWR1, rLOC, rADDR1
+ lwzx rLWR2, rLOC, rADDR2
+ cmpw cr1, rLWR1, rLWR2
+ crorc 4*cr1+eq,eq,4*cr1+eq
+ beq cr1, L(done)
+ lbz rCHAR1, 0(rSTR1) /* Load char from s1 */
+ lbz rCHAR2, 0(rSTR2) /* Load char from s2 */
+#ifdef USE_AS_STRNCASECMP
+ bdnz L(loop)
+#else
+ b L(loop)
+#endif
+#ifdef USE_AS_STRNCASECMP
+L(lessthan4):
+ clrldi r5, r5, 62
+ cmpdi cr7, r5, 0
+ beq cr7, L(retnull)
+ mtctr r5
+L(loop1):
+ cmpdi rCHAR1, 0
+ sldi rADDR1, rCHAR1, 2
+ sldi rADDR2, rCHAR2, 2
+ lwzx rLWR1, rLOC, rADDR1
+ lwzx rLWR2, rLOC, rADDR2
+ cmpw cr1, rLWR1, rLWR2
+ crorc 4*cr1+eq,eq,4*cr1+eq
+ beq cr1, L(done)
+ addi rSTR1, rSTR1, 1
+ addi rSTR2, rSTR2, 1
+ lbz rCHAR1, 0(rSTR1)
+ lbz rCHAR2, 0(rSTR2)
+ bdnz L(loop1)
+#endif
+L(done):
+ subf r0, rLWR2, rLWR1
+ extsw rRTN, r0
+ blr
+END (__STRCASECMP)
+
+weak_alias (__STRCASECMP, STRCASECMP)
+libc_hidden_builtin_def (__STRCASECMP)
diff --git a/sysdeps/powerpc/powerpc64/power8/strcasestr-ppc64.c b/sysdeps/powerpc/powerpc64/power8/strcasestr-ppc64.c
new file mode 100644
index 0000000000..221d4733f4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strcasestr-ppc64.c
@@ -0,0 +1,29 @@
+/* Optimized strcasestr implementation for PowerPC64/POWER8.
+ Copyright (C) 2016-2018 Free Software 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 <string.h>
+
+#define STRCASESTR __strcasestr_ppc
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(__name)
+
+#undef weak_alias
+#define weak_alias(a,b)
+extern __typeof (strcasestr) __strcasestr_ppc attribute_hidden;
+
+#include <string/strcasestr.c>
diff --git a/sysdeps/powerpc/powerpc64/power8/strcasestr.S b/sysdeps/powerpc/powerpc64/power8/strcasestr.S
new file mode 100644
index 0000000000..9fc24c29f9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strcasestr.S
@@ -0,0 +1,538 @@
+/* Optimized strcasestr implementation for PowerPC64/POWER8.
+ Copyright (C) 2016-2018 Free Software 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>
+#include <locale-defines.h>
+
+/* Char * [r3] strcasestr (char *s [r3], char * pat[r4]) */
+
+/* The performance gain is obtained by comparing 16 bytes. */
+
+/* When the first char of r4 is hit ITERATIONS times in r3
+ fallback to default. */
+#define ITERATIONS 64
+
+#ifndef STRCASESTR
+# define STRCASESTR __strcasestr
+#endif
+
+#ifndef STRLEN
+/* For builds without IFUNC support, local calls should be made to internal
+ GLIBC symbol (created by libc_hidden_builtin_def). */
+# ifdef SHARED
+# define STRLEN __GI_strlen
+# else
+# define STRLEN strlen
+# endif
+#endif
+
+#ifndef STRNLEN
+/* For builds without IFUNC support, local calls should be made to internal
+ GLIBC symbol (created by libc_hidden_builtin_def). */
+# ifdef SHARED
+# define STRNLEN __GI_strnlen
+# else
+# define STRNLEN __strnlen
+# endif
+#endif
+
+#ifndef STRCHR
+# ifdef SHARED
+# define STRCHR __GI_strchr
+# else
+# define STRCHR strchr
+# endif
+#endif
+
+/* Convert 16 bytes of v4 and reg to lowercase and compare. */
+#define TOLOWER(reg) \
+ vcmpgtub v6, v4, v1; \
+ vcmpgtub v7, v2, v4; \
+ vand v8, v7, v6; \
+ vand v8, v8, v3; \
+ vor v4, v8, v4; \
+ vcmpgtub v6, reg, v1; \
+ vcmpgtub v7, v2, reg; \
+ vand v8, v7, v6; \
+ vand v8, v8, v3; \
+ vor reg, v8, reg; \
+ vcmpequb. v6, reg, v4;
+
+/* TODO: change these to the actual instructions when the minimum required
+ binutils allows it. */
+#ifdef _ARCH_PWR8
+#define VCLZD_V8_v7 vclzd v8, v7;
+#else
+#define VCLZD_V8_v7 .long 0x11003fc2
+#endif
+
+#define FRAMESIZE (FRAME_MIN_SIZE+48)
+/* TODO: change this to .machine power8 when the minimum required binutils
+ allows it. */
+ .machine power7
+ENTRY (STRCASESTR, 4)
+ CALL_MCOUNT 2
+ mflr r0 /* Load link register LR to r0. */
+ std r31, -8(r1) /* Save callers register r31. */
+ std r30, -16(r1) /* Save callers register r30. */
+ std r29, -24(r1) /* Save callers register r29. */
+ std r28, -32(r1) /* Save callers register r28. */
+ std r27, -40(r1) /* Save callers register r27. */
+ std r0, 16(r1) /* Store the link register. */
+ cfi_offset(r31, -8)
+ cfi_offset(r30, -16)
+ cfi_offset(r29, -24)
+ cfi_offset(r28, -32)
+ cfi_offset(r27, -40)
+ cfi_offset(lr, 16)
+ stdu r1, -FRAMESIZE(r1) /* Create the stack frame. */
+ cfi_adjust_cfa_offset(FRAMESIZE)
+
+ dcbt 0, r3
+ dcbt 0, r4
+ cmpdi cr7, r3, 0 /* Input validation. */
+ beq cr7, L(retnull)
+ cmpdi cr7, r4, 0
+ beq cr7, L(retnull)
+
+ mr r29, r3
+ mr r30, r4
+ /* Load first byte from r4 and check if its null. */
+ lbz r6, 0(r4)
+ cmpdi cr7, r6, 0
+ beq cr7, L(ret_r3)
+
+ ld r10, __libc_tsd_LOCALE@got@tprel(r2)
+ add r9, r10, __libc_tsd_LOCALE@tls
+ ld r9, 0(r9)
+ ld r9, LOCALE_CTYPE_TOUPPER(r9)
+ sldi r10, r6, 2 /* Convert to upper case. */
+ lwzx r28, r9, r10
+
+ ld r10, __libc_tsd_LOCALE@got@tprel(r2)
+ add r11, r10, __libc_tsd_LOCALE@tls
+ ld r11, 0(r11)
+ ld r11, LOCALE_CTYPE_TOLOWER(r11)
+ sldi r10, r6, 2 /* Convert to lower case. */
+ lwzx r27, r11, r10
+
+ /* Check if the first char is present. */
+ mr r4, r27
+ bl STRCHR
+ nop
+ mr r5, r3
+ mr r3, r29
+ mr r29, r5
+ mr r4, r28
+ bl STRCHR
+ nop
+ cmpdi cr7, r29, 0
+ beq cr7, L(firstpos)
+ cmpdi cr7, r3, 0
+ beq cr7, L(skipcheck)
+ cmpw cr7, r3, r29
+ ble cr7, L(firstpos)
+ /* Move r3 to the first occurence. */
+L(skipcheck):
+ mr r3, r29
+L(firstpos):
+ mr r29, r3
+
+ sldi r9, r27, 8
+ or r28, r9, r28
+ /* Reg r27 is used to count the number of iterations. */
+ li r27, 0
+ /* If first char of search str is not present. */
+ cmpdi cr7, r3, 0
+ ble cr7, L(end)
+
+ /* Find the length of pattern. */
+ mr r3, r30
+ bl STRLEN
+ nop
+
+ cmpdi cr7, r3, 0 /* If search str is null. */
+ beq cr7, L(ret_r3)
+
+ mr r31, r3
+ mr r4, r3
+ mr r3, r29
+ bl STRNLEN
+ nop
+
+ cmpd cr7, r3, r31 /* If len(r3) < len(r4). */
+ blt cr7, L(retnull)
+
+ mr r3, r29
+
+ /* Locales not matching ASCII for single bytes. */
+ ld r10, __libc_tsd_LOCALE@got@tprel(r2)
+ add r9, r10, __libc_tsd_LOCALE@tls
+ ld r9, 0(r9)
+ ld r7, 0(r9)
+ addi r7, r7, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES
+ lwz r8, 0(r7)
+ cmpdi cr7, r8, 1
+ beq cr7, L(bytebybyte)
+
+ /* If len(r4) < 16 handle byte by byte. */
+ /* For shorter strings we will not use vector registers. */
+ cmpdi cr7, r31, 16
+ blt cr7, L(bytebybyte)
+
+ /* Comparison values used for TOLOWER. */
+ /* Load v1 = 64('A' - 1), v2 = 91('Z' + 1), v3 = 32 in each byte. */
+ vspltish v0, 0
+ vspltisb v5, 2
+ vspltisb v4, 4
+ vsl v3, v5, v4
+ vaddubm v1, v3, v3
+ vspltisb v5, 15
+ vaddubm v2, v5, v5
+ vaddubm v2, v1, v2
+ vspltisb v4, -3
+ vaddubm v2, v2, v4
+
+ /*
+ 1. Load 16 bytes from r3 and r4
+ 2. Check if there is null, If yes, proceed byte by byte path.
+ 3. Else,Convert both to lowercase and compare.
+ 4. If they are same proceed to 1.
+ 5. If they dont match, find if first char of r4 is present in the
+ loaded 16 byte of r3.
+ 6. If yes, move position, load next 16 bytes of r3 and proceed to 2.
+ */
+
+ mr r8, r3 /* Save r3 for future use. */
+ mr r4, r30 /* Restore r4. */
+ clrldi r10, r4, 60
+ lvx v5, 0, r4 /* Load 16 bytes from r4. */
+ cmpdi cr7, r10, 0
+ beq cr7, L(begin2)
+ /* If r4 is unaligned, load another 16 bytes. */
+#ifdef __LITTLE_ENDIAN__
+ lvsr v7, 0, r4
+#else
+ lvsl v7, 0, r4
+#endif
+ addi r5, r4, 16
+ lvx v9, 0, r5
+#ifdef __LITTLE_ENDIAN__
+ vperm v5, v9, v5, v7
+#else
+ vperm v5, v5, v9, v7
+#endif
+L(begin2):
+ lvx v4, 0, r3
+ vcmpequb. v7, v0, v4 /* Check for null. */
+ beq cr6, L(nullchk6)
+ b L(trailcheck)
+
+ .align 4
+L(nullchk6):
+ clrldi r10, r3, 60
+ cmpdi cr7, r10, 0
+ beq cr7, L(next16)
+#ifdef __LITTLE_ENDIAN__
+ lvsr v7, 0, r3
+#else
+ lvsl v7, 0, r3
+#endif
+ addi r5, r3, 16
+ /* If r3 is unaligned, load another 16 bytes. */
+ lvx v10, 0, r5
+#ifdef __LITTLE_ENDIAN__
+ vperm v4, v10, v4, v7
+#else
+ vperm v4, v4, v10, v7
+#endif
+L(next16):
+ vcmpequb. v6, v0, v5 /* Check for null. */
+ beq cr6, L(nullchk)
+ b L(trailcheck)
+
+ .align 4
+L(nullchk):
+ vcmpequb. v6, v0, v4
+ beq cr6, L(nullchk1)
+ b L(retnull)
+
+ .align 4
+L(nullchk1):
+ /* Convert both v3 and v4 to lower. */
+ TOLOWER(v5)
+ /* If both are same, branch to match. */
+ blt cr6, L(match)
+ /* Find if the first char is present in next 15 bytes. */
+#ifdef __LITTLE_ENDIAN__
+ vspltb v6, v5, 15
+ vsldoi v7, v0, v4, 15
+#else
+ vspltb v6, v5, 0
+ vspltisb v7, 8
+ vslo v7, v4, v7
+#endif
+ vcmpequb v7, v6, v7
+ vcmpequb. v6, v0, v7
+ /* Shift r3 by 16 bytes and proceed. */
+ blt cr6, L(shift16)
+ VCLZD_V8_v7
+#ifdef __LITTLE_ENDIAN__
+ vspltb v6, v8, 15
+#else
+ vspltb v6, v8, 7
+#endif
+ vcmpequb. v6, v6, v1
+ /* Shift r3 by 8 bytes and proceed. */
+ blt cr6, L(shift8)
+ b L(begin)
+
+ .align 4
+L(match):
+ /* There is a match of 16 bytes, check next bytes. */
+ cmpdi cr7, r31, 16
+ mr r29, r3
+ beq cr7, L(ret_r3)
+
+L(secondmatch):
+ addi r3, r3, 16
+ addi r4, r4, 16
+ /* Load next 16 bytes of r3 and r4 and compare. */
+ clrldi r10, r4, 60
+ cmpdi cr7, r10, 0
+ beq cr7, L(nextload)
+ /* Handle unaligned case. */
+ vor v6, v9, v9
+ vcmpequb. v7, v0, v6
+ beq cr6, L(nullchk2)
+ b L(trailcheck)
+
+ .align 4
+L(nullchk2):
+#ifdef __LITTLE_ENDIAN__
+ lvsr v7, 0, r4
+#else
+ lvsl v7, 0, r4
+#endif
+ addi r5, r4, 16
+ /* If r4 is unaligned, load another 16 bytes. */
+ lvx v9, 0, r5
+#ifdef __LITTLE_ENDIAN__
+ vperm v11, v9, v6, v7
+#else
+ vperm v11, v6, v9, v7
+#endif
+ b L(compare)
+
+ .align 4
+L(nextload):
+ lvx v11, 0, r4
+L(compare):
+ vcmpequb. v7, v0, v11
+ beq cr6, L(nullchk3)
+ b L(trailcheck)
+
+ .align 4
+L(nullchk3):
+ clrldi r10, r3, 60
+ cmpdi cr7, r10, 0
+ beq cr7, L(nextload1)
+ /* Handle unaligned case. */
+ vor v4, v10, v10
+ vcmpequb. v7, v0, v4
+ beq cr6, L(nullchk4)
+ b L(retnull)
+
+ .align 4
+L(nullchk4):
+#ifdef __LITTLE_ENDIAN__
+ lvsr v7, 0, r3
+#else
+ lvsl v7, 0, r3
+#endif
+ addi r5, r3, 16
+ /* If r3 is unaligned, load another 16 bytes. */
+ lvx v10, 0, r5
+#ifdef __LITTLE_ENDIAN__
+ vperm v4, v10, v4, v7
+#else
+ vperm v4, v4, v10, v7
+#endif
+ b L(compare1)
+
+ .align 4
+L(nextload1):
+ lvx v4, 0, r3
+L(compare1):
+ vcmpequb. v7, v0, v4
+ beq cr6, L(nullchk5)
+ b L(retnull)
+
+ .align 4
+L(nullchk5):
+ /* Convert both v3 and v4 to lower. */
+ TOLOWER(v11)
+ /* If both are same, branch to secondmatch. */
+ blt cr6, L(secondmatch)
+ /* Continue the search. */
+ b L(begin)
+
+ .align 4
+L(trailcheck):
+ ld r10, __libc_tsd_LOCALE@got@tprel(r2)
+ add r11, r10, __libc_tsd_LOCALE@tls
+ ld r11, 0(r11)
+ ld r11, LOCALE_CTYPE_TOLOWER(r11)
+L(loop2):
+ lbz r5, 0(r3) /* Load byte from r3. */
+ lbz r6, 0(r4) /* Load next byte from r4. */
+ cmpdi cr7, r6, 0 /* Is it null? */
+ beq cr7, L(updater3)
+ cmpdi cr7, r5, 0 /* Is it null? */
+ beq cr7, L(retnull) /* If yes, return. */
+ addi r3, r3, 1
+ addi r4, r4, 1 /* Increment r4. */
+ sldi r10, r5, 2 /* Convert to lower case. */
+ lwzx r10, r11, r10
+ sldi r7, r6, 2 /* Convert to lower case. */
+ lwzx r7, r11, r7
+ cmpw cr7, r7, r10 /* Compare with byte from r4. */
+ bne cr7, L(begin)
+ b L(loop2)
+
+ .align 4
+L(shift8):
+ addi r8, r8, 7
+ b L(begin)
+ .align 4
+L(shift16):
+ addi r8, r8, 15
+ .align 4
+L(begin):
+ addi r8, r8, 1
+ mr r3, r8
+ /* When our iterations exceed ITERATIONS,fall back to default. */
+ addi r27, r27, 1
+ cmpdi cr7, r27, ITERATIONS
+ beq cr7, L(default)
+ mr r4, r30 /* Restore r4. */
+ b L(begin2)
+
+ /* Handling byte by byte. */
+ .align 4
+L(loop1):
+ mr r3, r8
+ addi r27, r27, 1
+ cmpdi cr7, r27, ITERATIONS
+ beq cr7, L(default)
+ mr r29, r8
+ srdi r4, r28, 8
+ /* Check if the first char is present. */
+ bl STRCHR
+ nop
+ mr r5, r3
+ mr r3, r29
+ mr r29, r5
+ sldi r4, r28, 56
+ srdi r4, r4, 56
+ bl STRCHR
+ nop
+ cmpdi cr7, r29, 0
+ beq cr7, L(nextpos)
+ cmpdi cr7, r3, 0
+ beq cr7, L(skipcheck1)
+ cmpw cr7, r3, r29
+ ble cr7, L(nextpos)
+ /* Move r3 to first occurence. */
+L(skipcheck1):
+ mr r3, r29
+L(nextpos):
+ mr r29, r3
+ cmpdi cr7, r3, 0
+ ble cr7, L(retnull)
+L(bytebybyte):
+ ld r10, __libc_tsd_LOCALE@got@tprel(r2)
+ add r11, r10, __libc_tsd_LOCALE@tls
+ ld r11, 0(r11)
+ ld r11, LOCALE_CTYPE_TOLOWER(r11)
+ mr r4, r30 /* Restore r4. */
+ mr r8, r3 /* Save r3. */
+ addi r8, r8, 1
+
+L(loop):
+ addi r3, r3, 1
+ lbz r5, 0(r3) /* Load byte from r3. */
+ addi r4, r4, 1 /* Increment r4. */
+ lbz r6, 0(r4) /* Load next byte from r4. */
+ cmpdi cr7, r6, 0 /* Is it null? */
+ beq cr7, L(updater3)
+ cmpdi cr7, r5, 0 /* Is it null? */
+ beq cr7, L(retnull) /* If yes, return. */
+ sldi r10, r5, 2 /* Convert to lower case. */
+ lwzx r10, r11, r10
+ sldi r7, r6, 2 /* Convert to lower case. */
+ lwzx r7, r11, r7
+ cmpw cr7, r7, r10 /* Compare with byte from r4. */
+ bne cr7, L(loop1)
+ b L(loop)
+
+ /* Handling return values. */
+ .align 4
+L(updater3):
+ subf r3, r31, r3 /* Reduce r31 (len of r4) from r3. */
+ b L(end)
+
+ .align 4
+L(ret_r3):
+ mr r3, r29 /* Return point of match. */
+ b L(end)
+
+ .align 4
+L(retnull):
+ li r3, 0 /* Substring was not found. */
+ b L(end)
+
+ .align 4
+L(default):
+ mr r4, r30
+ bl __strcasestr_ppc
+ nop
+
+ .align 4
+L(end):
+ addi r1, r1, FRAMESIZE /* Restore stack pointer. */
+ cfi_adjust_cfa_offset(-FRAMESIZE)
+ ld r0, 16(r1) /* Restore the saved link register. */
+ ld r27, -40(r1)
+ ld r28, -32(r1)
+ ld r29, -24(r1) /* Restore callers save register r29. */
+ ld r30, -16(r1) /* Restore callers save register r30. */
+ ld r31, -8(r1) /* Restore callers save register r31. */
+ cfi_restore(lr)
+ cfi_restore(r27)
+ cfi_restore(r28)
+ cfi_restore(r29)
+ cfi_restore(r30)
+ cfi_restore(r31)
+ mtlr r0 /* Branch to link register. */
+ blr
+END (STRCASESTR)
+
+weak_alias (__strcasestr, strcasestr)
+libc_hidden_def (__strcasestr)
+libc_hidden_builtin_def (strcasestr)
diff --git a/sysdeps/powerpc/powerpc64/power8/strchr.S b/sysdeps/powerpc/powerpc64/power8/strchr.S
new file mode 100644
index 0000000000..c5e28d9c9e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strchr.S
@@ -0,0 +1,377 @@
+/* Optimized strchr implementation for PowerPC64/POWER8.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#ifdef USE_AS_STRCHRNUL
+# ifndef STRCHRNUL
+# define FUNC_NAME __strchrnul
+# else
+# define FUNC_NAME STRCHRNUL
+# endif
+#else
+# ifndef STRCHR
+# define FUNC_NAME strchr
+# else
+# define FUNC_NAME STRCHR
+# endif
+#endif /* !USE_AS_STRCHRNUL */
+
+/* int [r3] strchr (char *s [r3], int c [r4]) */
+/* TODO: change these to the actual instructions when the minimum required
+ binutils allows it. */
+#define MTVRD(v,r) .long (0x7c000167 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#define MFVRD(r,v) .long (0x7c000067 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#define VBPERMQ(t,a,b) .long (0x1000054c \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+/* TODO: change this to .machine power8 when the minimum required binutils
+ allows it. */
+ .machine power7
+ENTRY_TOCLESS (FUNC_NAME)
+ CALL_MCOUNT 2
+ dcbt 0,r3
+ clrrdi r8,r3,3 /* Align the address to doubleword boundary. */
+ cmpdi cr7,r4,0
+ ld r12,0(r8) /* Load doubleword from memory. */
+ li r0,0 /* Doubleword with null chars to use
+ with cmpb. */
+
+ rlwinm r6,r3,3,26,28 /* Calculate padding. */
+
+ beq cr7,L(null_match)
+
+ /* Replicate byte to doubleword. */
+ insrdi r4,r4,8,48
+ insrdi r4,r4,16,32
+ insrdi r4,r4,32,0
+
+ /* Now r4 has a doubleword of c bytes and r0 has
+ a doubleword of null bytes. */
+
+ cmpb r10,r12,r4 /* Compare each byte against c byte. */
+ cmpb r11,r12,r0 /* Compare each byte against null byte. */
+
+ /* Move the doublewords left and right to discard the bits that are
+ not part of the string and bring them back as zeros. */
+#ifdef __LITTLE_ENDIAN__
+ srd r10,r10,r6
+ srd r11,r11,r6
+ sld r10,r10,r6
+ sld r11,r11,r6
+#else
+ sld r10,r10,r6
+ sld r11,r11,r6
+ srd r10,r10,r6
+ srd r11,r11,r6
+#endif
+ or r5,r10,r11 /* OR the results to speed things up. */
+ cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes
+ have been found. */
+ bne cr7,L(done)
+
+ mtcrf 0x01,r8
+
+ /* Are we now aligned to a doubleword boundary? If so, skip to
+ the main loop. Otherwise, go through the alignment code. */
+
+ bt 28,L(loop)
+
+ /* Handle WORD2 of pair. */
+ ldu r12,8(r8)
+ cmpb r10,r12,r4
+ cmpb r11,r12,r0
+ or r5,r10,r11
+ cmpdi cr7,r5,0
+ bne cr7,L(done)
+ b L(loop) /* We branch here (rather than falling through)
+ to skip the nops due to heavy alignment
+ of the loop below. */
+
+ .p2align 5
+L(loop):
+ /* Load two doublewords, compare and merge in a
+ single register for speed. This is an attempt
+ to speed up the null-checking process for bigger strings. */
+ ld r12,8(r8)
+ ldu r9,16(r8)
+ cmpb r10,r12,r4
+ cmpb r11,r12,r0
+ cmpb r6,r9,r4
+ cmpb r7,r9,r0
+ or r5,r10,r11
+ or r9,r6,r7
+ or r12,r5,r9
+ cmpdi cr7,r12,0
+ beq cr7,L(vector)
+ /* OK, one (or both) of the doublewords contains a c/null byte. Check
+ the first doubleword and decrement the address in case the first
+ doubleword really contains a c/null byte. */
+
+ cmpdi cr6,r5,0
+ addi r8,r8,-8
+ bne cr6,L(done)
+
+ /* The c/null byte must be in the second doubleword. Adjust the
+ address again and move the result of cmpb to r10 so we can calculate
+ the pointer. */
+
+ mr r10,r6
+ mr r11,r7
+ addi r8,r8,8
+#ifdef USE_AS_STRCHRNUL
+ mr r5, r9
+#endif
+ /* r10/r11 have the output of the cmpb instructions, that is,
+ 0xff in the same position as the c/null byte in the original
+ doubleword from the string. Use that to calculate the pointer. */
+L(done):
+#ifdef USE_AS_STRCHRNUL
+ mr r10, r5
+#endif
+#ifdef __LITTLE_ENDIAN__
+ addi r3,r10,-1
+ andc r3,r3,r10
+ popcntd r0,r3
+# ifndef USE_AS_STRCHRNUL
+ addi r4,r11,-1
+ andc r4,r4,r11
+ cmpld cr7,r3,r4
+ bgt cr7,L(no_match)
+# endif
+#else
+ cntlzd r0,r10 /* Count leading zeros before c matches. */
+# ifndef USE_AS_STRCHRNUL
+ cmpld cr7,r11,r10
+ bgt cr7,L(no_match)
+# endif
+#endif
+ srdi r0,r0,3 /* Convert leading zeros to bytes. */
+ add r3,r8,r0 /* Return address of the matching c byte
+ or null in case c was not found. */
+ blr
+
+ /* Check the first 32B in GPR's and move to vectorized loop. */
+ .p2align 5
+L(vector):
+ addi r3, r8, 8
+ andi. r10, r3, 31
+ bne cr0, L(loop)
+ vspltisb v0, 0
+ /* Precompute vbpermq constant. */
+ vspltisb v10, 3
+ lvsl v11, r0, r0
+ vslb v10, v11, v10
+ MTVRD(v1,r4)
+ li r5, 16
+ vspltb v1, v1, 7
+ /* Compare 32 bytes in each loop. */
+L(continue):
+ lvx v4, 0, r3
+ lvx v5, r3, r5
+ vcmpequb v2, v0, v4
+ vcmpequb v3, v0, v5
+ vcmpequb v6, v1, v4
+ vcmpequb v7, v1, v5
+ vor v8, v2, v3
+ vor v9, v6, v7
+ vor v11, v8, v9
+ vcmpequb. v11, v0, v11
+ addi r3, r3, 32
+ blt cr6, L(continue)
+ /* One (or both) of the quadwords contains a c/null byte. */
+ addi r3, r3, -32
+#ifndef USE_AS_STRCHRNUL
+ vcmpequb. v11, v0, v9
+ blt cr6, L(no_match)
+#endif
+ /* Permute the first bit of each byte into bits 48-63. */
+ VBPERMQ(v2, v2, v10)
+ VBPERMQ(v3, v3, v10)
+ VBPERMQ(v6, v6, v10)
+ VBPERMQ(v7, v7, v10)
+ /* Shift each component into its correct position for merging. */
+#ifdef __LITTLE_ENDIAN__
+ vsldoi v3, v3, v3, 2
+ vsldoi v7, v7, v7, 2
+#else
+ vsldoi v2, v2, v2, 6
+ vsldoi v3, v3, v3, 4
+ vsldoi v6, v6, v6, 6
+ vsldoi v7, v7, v7, 4
+#endif
+
+ /* Merge the results and move to a GPR. */
+ vor v1, v3, v2
+ vor v2, v6, v7
+ vor v4, v1, v2
+ MFVRD(r5, v4)
+#ifdef __LITTLE_ENDIAN__
+ addi r6, r5, -1
+ andc r6, r6, r5
+ popcntd r6, r6
+#else
+ cntlzd r6, r5 /* Count leading zeros before the match. */
+#endif
+ add r3, r3, r6 /* Compute final length. */
+ /* Return NULL if null found before c. */
+#ifndef USE_AS_STRCHRNUL
+ lbz r4, 0(r3)
+ cmpdi cr7, r4, 0
+ beq cr7, L(no_match)
+#endif
+ blr
+
+#ifndef USE_AS_STRCHRNUL
+ .align 4
+L(no_match):
+ li r3,0
+ blr
+#endif
+
+/* We are here because strchr was called with a null byte. */
+ .align 4
+L(null_match):
+ /* r0 has a doubleword of null bytes. */
+
+ cmpb r5,r12,r0 /* Compare each byte against null bytes. */
+
+ /* Move the doublewords left and right to discard the bits that are
+ not part of the string and bring them back as zeros. */
+#ifdef __LITTLE_ENDIAN__
+ srd r5,r5,r6
+ sld r5,r5,r6
+#else
+ sld r5,r5,r6
+ srd r5,r5,r6
+#endif
+ cmpdi cr7,r5,0 /* If r10 == 0, no c or null bytes
+ have been found. */
+ bne cr7,L(done_null)
+
+ mtcrf 0x01,r8
+
+ /* Are we now aligned to a quadword boundary? If so, skip to
+ the main loop. Otherwise, go through the alignment code. */
+
+ bt 28,L(loop_null)
+
+ /* Handle WORD2 of pair. */
+ ldu r12,8(r8)
+ cmpb r5,r12,r0
+ cmpdi cr7,r5,0
+ bne cr7,L(done_null)
+ b L(loop_null) /* We branch here (rather than falling through)
+ to skip the nops due to heavy alignment
+ of the loop below. */
+
+ /* Main loop to look for the end of the string. Since it's a
+ small loop (< 8 instructions), align it to 32-bytes. */
+ .p2align 5
+L(loop_null):
+ /* Load two doublewords, compare and merge in a
+ single register for speed. This is an attempt
+ to speed up the null-checking process for bigger strings. */
+ ld r12,8(r8)
+ ldu r11,16(r8)
+ cmpb r5,r12,r0
+ cmpb r10,r11,r0
+ or r6,r5,r10
+ cmpdi cr7,r6,0
+ beq cr7,L(vector1)
+
+ /* OK, one (or both) of the doublewords contains a null byte. Check
+ the first doubleword and decrement the address in case the first
+ doubleword really contains a null byte. */
+
+ cmpdi cr6,r5,0
+ addi r8,r8,-8
+ bne cr6,L(done_null)
+
+ /* The null byte must be in the second doubleword. Adjust the address
+ again and move the result of cmpb to r10 so we can calculate the
+ pointer. */
+
+ mr r5,r10
+ addi r8,r8,8
+
+ /* r5 has the output of the cmpb instruction, that is, it contains
+ 0xff in the same position as the null byte in the original
+ doubleword from the string. Use that to calculate the pointer. */
+L(done_null):
+#ifdef __LITTLE_ENDIAN__
+ addi r0,r5,-1
+ andc r0,r0,r5
+ popcntd r0,r0
+#else
+ cntlzd r0,r5 /* Count leading zeros before the match. */
+#endif
+ srdi r0,r0,3 /* Convert leading zeros to bytes. */
+ add r3,r8,r0 /* Return address of the matching null byte. */
+ blr
+ .p2align 5
+L(vector1):
+ addi r3, r8, 8
+ andi. r10, r3, 31
+ bne cr0, L(loop_null)
+ vspltisb v8, -1
+ vspltisb v0, 0
+ vspltisb v10, 3
+ lvsl v11, r0, r0
+ vslb v10, v11, v10
+ li r5, 16
+L(continue1):
+ lvx v4, 0, r3
+ lvx v5, r3, r5
+ vcmpequb v2, v0, v4
+ vcmpequb v3, v0, v5
+ vor v8, v2, v3
+ vcmpequb. v11, v0, v8
+ addi r3, r3, 32
+ blt cr6, L(continue1)
+ addi r3, r3, -32
+L(end1):
+ VBPERMQ(v2, v2, v10)
+ VBPERMQ(v3, v3, v10)
+ /* Shift each component into its correct position for merging. */
+#ifdef __LITTLE_ENDIAN__
+ vsldoi v3, v3, v3, 2
+#else
+ vsldoi v2, v2, v2, 6
+ vsldoi v3, v3, v3, 4
+#endif
+
+ /* Merge the results and move to a GPR. */
+ vor v4, v3, v2
+ MFVRD(r5, v4)
+#ifdef __LITTLE_ENDIAN__
+ addi r6, r5, -1
+ andc r6, r6, r5
+ popcntd r6, r6
+#else
+ cntlzd r6, r5 /* Count leading zeros before the match. */
+#endif
+ add r3, r3, r6 /* Compute final length. */
+ blr
+END (FUNC_NAME)
+
+#ifndef USE_AS_STRCHRNUL
+weak_alias (strchr, index)
+libc_hidden_builtin_def (strchr)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power8/strchrnul.S b/sysdeps/powerpc/powerpc64/power8/strchrnul.S
new file mode 100644
index 0000000000..022ad67a6b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strchrnul.S
@@ -0,0 +1,23 @@
+/* Optimized strchrnul implementation for PowerPC64/POWER8.
+ Copyright (C) 2016-2018 Free Software 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 USE_AS_STRCHRNUL 1
+#include <sysdeps/powerpc/powerpc64/power8/strchr.S>
+
+weak_alias (__strchrnul,strchrnul)
+libc_hidden_builtin_def (__strchrnul)
diff --git a/sysdeps/powerpc/powerpc64/power8/strcmp.S b/sysdeps/powerpc/powerpc64/power8/strcmp.S
index 4d6c477194..15e7351d1b 100644
--- a/sysdeps/powerpc/powerpc64/power8/strcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/strcmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC64/POWER8.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,10 @@
#include <sysdep.h>
+#ifndef STRCMP
+# define STRCMP strcmp
+#endif
+
/* Implements the function
size_t [r3] strcmp (const char *s1 [r3], const char *s2 [r4])
@@ -27,24 +31,24 @@
64K as default, the page cross handling assumes minimum page size of
4k. */
-EALIGN (strcmp, 4, 0)
+ENTRY_TOCLESS (STRCMP, 4)
li r0,0
- /* Check if [s1]+32 or [s2]+32 will cross a 4K page boundary using
+ /* Check if [s1]+16 or [s2]+16 will cross a 4K page boundary using
the code:
(((size_t) s1) % PAGE_SIZE > (PAGE_SIZE - ITER_SIZE))
- with PAGE_SIZE being 4096 and ITER_SIZE begin 32. */
+ with PAGE_SIZE being 4096 and ITER_SIZE begin 16. */
rldicl r7,r3,0,52
rldicl r9,r4,0,52
- cmpldi cr7,r7,4096-32
+ cmpldi cr7,r7,4096-16
bgt cr7,L(pagecross_check)
- cmpldi cr5,r9,4096-32
+ cmpldi cr5,r9,4096-16
bgt cr5,L(pagecross_check)
- /* For short string up to 32 bytes, load both s1 and s2 using
+ /* For short string up to 16 bytes, load both s1 and s2 using
unaligned dwords and compare. */
ld r8,0(r3)
ld r10,0(r4)
@@ -60,25 +64,11 @@ EALIGN (strcmp, 4, 0)
orc. r9,r12,r11
bne cr0,L(different_nocmpb)
- ld r8,16(r3)
- ld r10,16(r4)
- cmpb r12,r8,r0
- cmpb r11,r8,r10
- orc. r9,r12,r11
- bne cr0,L(different_nocmpb)
-
- ld r8,24(r3)
- ld r10,24(r4)
- cmpb r12,r8,r0
- cmpb r11,r8,r10
- orc. r9,r12,r11
- bne cr0,L(different_nocmpb)
-
- addi r7,r3,32
- addi r4,r4,32
+ addi r7,r3,16
+ addi r4,r4,16
L(align_8b):
- /* Now it has checked for first 32 bytes, align source1 to doubleword
+ /* Now it has checked for first 16 bytes, align source1 to doubleword
and adjust source2 address. */
rldicl r9,r7,0,61 /* source1 alignment to doubleword */
subf r4,r9,r4 /* Adjust source2 address based on source1
@@ -253,5 +243,5 @@ L(pagecross_retdiff):
L(pagecross_nullfound):
li r3,0
b L(pagecross_retdiff)
-END (strcmp)
+END (STRCMP)
libc_hidden_builtin_def (strcmp)
diff --git a/sysdeps/powerpc/powerpc64/power8/strcpy.S b/sysdeps/powerpc/powerpc64/power8/strcpy.S
index 5130831c6a..956faf714f 100644
--- a/sysdeps/powerpc/powerpc64/power8/strcpy.S
+++ b/sysdeps/powerpc/powerpc64/power8/strcpy.S
@@ -1,5 +1,5 @@
/* Optimized strcpy/stpcpy implementation for PowerPC64/POWER8.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,10 +19,18 @@
#include <sysdep.h>
#ifdef USE_AS_STPCPY
-# define FUNC_NAME __stpcpy
+# ifndef STPCPY
+# define FUNC_NAME __stpcpy
+# else
+# define FUNC_NAME STPCPY
+# endif
#else
-# define FUNC_NAME strcpy
-#endif
+# ifndef STRCPY
+# define FUNC_NAME strcpy
+# else
+# define FUNC_NAME STRCPY
+# endif
+#endif /* !USE_AS_STPCPY */
/* Implements the function
@@ -39,8 +47,8 @@
64K as default, the page cross handling assumes minimum page size of
4k. */
- .machine power7
-EALIGN (FUNC_NAME, 4, 0)
+ .machine power8
+ENTRY_TOCLESS (FUNC_NAME, 4)
li r0,0 /* Doubleword with null chars to use
with cmpb. */
@@ -112,7 +120,7 @@ L(pagecross):
ldu r8, 8(r7)
L(loop_before):
- /* Save the two doublewords readed from source and align the source
+ /* Save the two doublewords read from source and align the source
to 16 bytes for the loop. */
mr r11,r3
std r12,0(r11)
@@ -121,7 +129,150 @@ L(loop_before):
rldicl r9,r4,0,60
subf r7,r9,r7
subf r11,r9,r11
- b L(loop_start)
+ /* Source is adjusted to 16B alignment and destination r11 is
+ also moved based on that adjustment. Now check if r11 is
+ also 16B aligned to move to vectorized loop. */
+ andi. r6, r11, 0xF
+ bne L(loop_start)
+
+ /* Prepare for the loop. */
+ subf r4, r9, r4 /* Adjust r4 based on alignment. */
+ li r7, 16 /* Load required offsets. */
+ li r8, 32
+ li r9, 48
+ vspltisb v0, 0
+ addi r4, r4, 16
+ /* Are we 64-byte aligned? If so, jump to the vectorized loop.
+ Else copy 16B till r4 is 64B aligned. */
+ andi. r6, r4, 63
+ beq L(qw_loop)
+
+ lvx v6, 0, r4 /* Load 16 bytes from memory. */
+ vcmpequb. v5, v0, v6 /* Check for null. */
+ bne cr6, L(qw_done)
+ stvx v6, 0, r11 /* Store 16 bytes. */
+ addi r4, r4, 16 /* Increment the address. */
+ addi r11, r11, 16
+ andi. r6, r4, 63
+ beq L(qw_loop)
+
+ lvx v6, 0, r4
+ vcmpequb. v5, v0, v6
+ bne cr6, L(qw_done)
+ stvx v6, 0, r11
+ addi r4, r4, 16
+ addi r11, r11, 16
+ andi. r6, r4, 63
+ beq L(qw_loop)
+
+ lvx v6, 0, r4
+ vcmpequb. v5, v0, v6
+ bne cr6, L(qw_done)
+ stvx v6, 0, r11
+ addi r4, r4, 16
+ addi r11, r11, 16
+
+ .align 4
+L(qw_loop):
+ lvx v1, r4, r0 /* Load 4 quadwords. */
+ lvx v2, r4, r7
+ lvx v3, r4, r8
+ lvx v4, r4, r9
+ vminub v5, v1, v2 /* Compare and merge into one VR for speed. */
+ vminub v8, v3, v4
+ vminub v7, v5, v8
+ vcmpequb. v7, v7, v0 /* Check for NULLs. */
+ bne cr6, L(qw_loop_done)
+ stvx v1, r11, r0 /* Store 4 quadwords. */
+ stvx v2, r11, r7
+ stvx v3, r11, r8
+ stvx v4, r11, r9
+ addi r4, r4, 64 /* Adjust address for the next iteration. */
+ addi r11, r11, 64 /* Adjust address for the next iteration. */
+
+ lvx v1, r4, r0 /* Load 4 quadwords. */
+ lvx v2, r4, r7
+ lvx v3, r4, r8
+ lvx v4, r4, r9
+ vminub v5, v1, v2 /* Compare and merge into one VR for speed. */
+ vminub v8, v3, v4
+ vminub v7, v5, v8
+ vcmpequb. v7, v7, v0 /* Check for NULLs. */
+ bne cr6, L(qw_loop_done)
+ stvx v1, r11, r0 /* Store 4 quadwords. */
+ stvx v2, r11, r7
+ stvx v3, r11, r8
+ stvx v4, r11, r9
+ addi r4, r4, 64 /* Adjust address for the next iteration. */
+ addi r11, r11, 64 /* Adjust address for the next iteration. */
+
+ lvx v1, r4, r0 /* Load 4 quadwords. */
+ lvx v2, r4, r7
+ lvx v3, r4, r8
+ lvx v4, r4, r9
+ vminub v5, v1, v2 /* Compare and merge into one VR for speed. */
+ vminub v8, v3, v4
+ vminub v7, v5, v8
+ vcmpequb. v7, v7, v0 /* Check for NULLs. */
+ bne cr6, L(qw_loop_done)
+ stvx v1, r11, r0 /* Store 4 quadwords. */
+ stvx v2, r11, r7
+ stvx v3, r11, r8
+ stvx v4, r11, r9
+ addi r4, r4, 64 /* Adjust address for the next iteration. */
+ addi r11, r11, 64 /* Adjust address for the next iteration. */
+ b L(qw_loop)
+
+ .align 4
+L(qw_loop_done):
+ /* Null found in one of the 4 loads. */
+ vcmpequb. v7, v1, v0
+ vor v6, v1, v1
+ bne cr6, L(qw_done)
+ /* Not on the first 16B, So store it. */
+ stvx v1, r11, r0
+ addi r4, r4, 16
+ addi r11, r11, 16
+ vcmpequb. v7, v2, v0
+ vor v6, v2, v2
+ bne cr6, L(qw_done)
+ /* Not on the second 16B, So store it. */
+ stvx v2, r11, r0
+ addi r4, r4, 16
+ addi r11, r11, 16
+ vcmpequb. v7, v3, v0
+ vor v6, v3, v3
+ bne cr6, L(qw_done)
+ /* Not on the third 16B, So store it. */
+ stvx v6, r11, r0
+ addi r4, r4, 16
+ addi r11, r11, 16
+ vor v6, v4, v4
+
+ .align 4
+L(qw_done):
+ mr r7, r4
+ /* Move the result to GPR. */
+#ifdef __LITTLE_ENDIAN__
+ vsldoi v4, v6, v0, 8
+ mfvrd r12, v4
+#else
+ mfvrd r12, v6
+#endif
+ /* Check for null in the first 8 bytes. */
+ cmpb r10, r12, r0
+ cmpdi cr6, r10, 0
+ bne cr6, L(done2)
+ /* Null found in second doubleword. */
+#ifdef __LITTLE_ENDIAN__
+ mfvrd r6, v6
+#else
+ vsldoi v6, v6, v0, 8
+ mfvrd r6, v6
+#endif
+ cmpb r10, r6, r0
+ addi r7, r7, 8
+ b L(done2)
.align 5
L(loop):
diff --git a/sysdeps/powerpc/powerpc64/power8/strcspn.S b/sysdeps/powerpc/powerpc64/power8/strcspn.S
new file mode 100644
index 0000000000..c2d130e7db
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strcspn.S
@@ -0,0 +1,20 @@
+/* Optimized strcspn implementation for PowerPC64/POWER8.
+ Copyright (C) 2016-2018 Free Software 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 USE_AS_STRCSPN 1
+#include <sysdeps/powerpc/powerpc64/power8/strspn.S>
diff --git a/sysdeps/powerpc/powerpc64/power8/strlen.S b/sysdeps/powerpc/powerpc64/power8/strlen.S
new file mode 100644
index 0000000000..719b5c604c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strlen.S
@@ -0,0 +1,290 @@
+/* Optimized strlen implementation for PowerPC64/POWER8 using a vectorized
+ loop.
+ Copyright (C) 2016-2018 Free Software 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>
+
+/* TODO: change these to the actual instructions when the minimum required
+ binutils allows it. */
+#define MFVRD(r,v) .long (0x7c000067 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#define VBPERMQ(t,a,b) .long (0x1000054c \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+
+/* int [r3] strlen (char *s [r3]) */
+
+#ifndef STRLEN
+# define STRLEN strlen
+#endif
+
+/* TODO: change this to .machine power8 when the minimum required binutils
+ allows it. */
+ .machine power7
+ENTRY_TOCLESS (STRLEN, 4)
+ CALL_MCOUNT 1
+ dcbt 0,r3
+ clrrdi r4,r3,3 /* Align the address to doubleword boundary. */
+ rlwinm r6,r3,3,26,28 /* Calculate padding. */
+ li r0,0 /* Doubleword with null chars to use
+ with cmpb. */
+ li r5,-1 /* MASK = 0xffffffffffffffff. */
+ ld r12,0(r4) /* Load doubleword from memory. */
+#ifdef __LITTLE_ENDIAN__
+ sld r5,r5,r6
+#else
+ srd r5,r5,r6 /* MASK = MASK >> padding. */
+#endif
+ orc r9,r12,r5 /* Mask bits that are not part of the string. */
+ cmpb r10,r9,r0 /* Check for null bytes in DWORD1. */
+ cmpdi cr7,r10,0 /* If r10 == 0, no null's have been found. */
+ bne cr7,L(done)
+
+ /* For shorter strings (< 64 bytes), we will not use vector registers,
+ as the overhead isn't worth it. So, let's use GPRs instead. This
+ will be done the same way as we do in the POWER7 implementation.
+ Let's see if we are aligned to a quadword boundary. If so, we can
+ jump to the first (non-vectorized) loop. Otherwise, we have to
+ handle the next DWORD first. */
+ mtcrf 0x01,r4
+ mr r9,r4
+ addi r9,r9,8
+ bt 28,L(align64)
+
+ /* Handle the next 8 bytes so we are aligned to a quadword
+ boundary. */
+ ldu r5,8(r4)
+ cmpb r10,r5,r0
+ cmpdi cr7,r10,0
+ addi r9,r9,8
+ bne cr7,L(done)
+
+L(align64):
+ /* Proceed to the old (POWER7) implementation, checking two doublewords
+ per iteraction. For the first 56 bytes, we will just check for null
+ characters. After that, we will also check if we are 64-byte aligned
+ so we can jump to the vectorized implementation. We will unroll
+ these loops to avoid excessive branching. */
+ ld r6,8(r4)
+ ldu r5,16(r4)
+ cmpb r10,r6,r0
+ cmpb r11,r5,r0
+ or r5,r10,r11
+ cmpdi cr7,r5,0
+ addi r9,r9,16
+ bne cr7,L(dword_zero)
+
+ ld r6,8(r4)
+ ldu r5,16(r4)
+ cmpb r10,r6,r0
+ cmpb r11,r5,r0
+ or r5,r10,r11
+ cmpdi cr7,r5,0
+ addi r9,r9,16
+ bne cr7,L(dword_zero)
+
+ ld r6,8(r4)
+ ldu r5,16(r4)
+ cmpb r10,r6,r0
+ cmpb r11,r5,r0
+ or r5,r10,r11
+ cmpdi cr7,r5,0
+ addi r9,r9,16
+ bne cr7,L(dword_zero)
+
+ /* Are we 64-byte aligned? If so, jump to the vectorized loop.
+ Note: aligning to 64-byte will necessarily slow down performance for
+ strings around 64 bytes in length due to the extra comparisons
+ required to check alignment for the vectorized loop. This is a
+ necessary tradeoff we are willing to take in order to speed up the
+ calculation for larger strings. */
+ andi. r10,r9,63
+ beq cr0,L(preloop)
+ ld r6,8(r4)
+ ldu r5,16(r4)
+ cmpb r10,r6,r0
+ cmpb r11,r5,r0
+ or r5,r10,r11
+ cmpdi cr7,r5,0
+ addi r9,r9,16
+ bne cr7,L(dword_zero)
+
+ andi. r10,r9,63
+ beq cr0,L(preloop)
+ ld r6,8(r4)
+ ldu r5,16(r4)
+ cmpb r10,r6,r0
+ cmpb r11,r5,r0
+ or r5,r10,r11
+ cmpdi cr7,r5,0
+ addi r9,r9,16
+ bne cr7,L(dword_zero)
+
+ andi. r10,r9,63
+ beq cr0,L(preloop)
+ ld r6,8(r4)
+ ldu r5,16(r4)
+ cmpb r10,r6,r0
+ cmpb r11,r5,r0
+ or r5,r10,r11
+ cmpdi cr7,r5,0
+ addi r9,r9,16
+
+ /* At this point, we are necessarily 64-byte aligned. If no zeroes were
+ found, jump to the vectorized loop. */
+ beq cr7,L(preloop)
+
+L(dword_zero):
+ /* OK, one (or both) of the doublewords contains a null byte. Check
+ the first doubleword and decrement the address in case the first
+ doubleword really contains a null byte. */
+
+ cmpdi cr6,r10,0
+ addi r4,r4,-8
+ bne cr6,L(done)
+
+ /* The null byte must be in the second doubleword. Adjust the address
+ again and move the result of cmpb to r10 so we can calculate the
+ length. */
+
+ mr r10,r11
+ addi r4,r4,8
+
+ /* If the null byte was found in the non-vectorized code, compute the
+ final length. r10 has the output of the cmpb instruction, that is,
+ it contains 0xff in the same position as the null byte in the
+ original doubleword from the string. Use that to calculate the
+ length. */
+L(done):
+#ifdef __LITTLE_ENDIAN__
+ addi r9, r10,-1 /* Form a mask from trailing zeros. */
+ andc r9, r9,r10
+ popcntd r0, r9 /* Count the bits in the mask. */
+#else
+ cntlzd r0,r10 /* Count leading zeros before the match. */
+#endif
+ subf r5,r3,r4
+ srdi r0,r0,3 /* Convert leading/trailing zeros to bytes. */
+ add r3,r5,r0 /* Compute final length. */
+ blr
+
+ /* Vectorized implementation starts here. */
+ .p2align 4
+L(preloop):
+ /* Set up for the loop. */
+ mr r4,r9
+ li r7, 16 /* Load required offsets. */
+ li r8, 32
+ li r9, 48
+ li r12, 8
+ vxor v0,v0,v0 /* VR with null chars to use with
+ vcmpequb. */
+
+ /* Main loop to look for the end of the string. We will read in
+ 64-byte chunks. Align it to 32 bytes and unroll it 3 times to
+ leverage the icache performance. */
+ .p2align 5
+L(loop):
+ lvx v1,r4,r0 /* Load 4 quadwords. */
+ lvx v2,r4,r7
+ lvx v3,r4,r8
+ lvx v4,r4,r9
+ vminub v5,v1,v2 /* Compare and merge into one VR for speed. */
+ vminub v6,v3,v4
+ vminub v7,v5,v6
+ vcmpequb. v7,v7,v0 /* Check for NULLs. */
+ addi r4,r4,64 /* Adjust address for the next iteration. */
+ bne cr6,L(vmx_zero)
+
+ lvx v1,r4,r0 /* Load 4 quadwords. */
+ lvx v2,r4,r7
+ lvx v3,r4,r8
+ lvx v4,r4,r9
+ vminub v5,v1,v2 /* Compare and merge into one VR for speed. */
+ vminub v6,v3,v4
+ vminub v7,v5,v6
+ vcmpequb. v7,v7,v0 /* Check for NULLs. */
+ addi r4,r4,64 /* Adjust address for the next iteration. */
+ bne cr6,L(vmx_zero)
+
+ lvx v1,r4,r0 /* Load 4 quadwords. */
+ lvx v2,r4,r7
+ lvx v3,r4,r8
+ lvx v4,r4,r9
+ vminub v5,v1,v2 /* Compare and merge into one VR for speed. */
+ vminub v6,v3,v4
+ vminub v7,v5,v6
+ vcmpequb. v7,v7,v0 /* Check for NULLs. */
+ addi r4,r4,64 /* Adjust address for the next iteration. */
+ beq cr6,L(loop)
+
+L(vmx_zero):
+ /* OK, we found a null byte. Let's look for it in the current 64-byte
+ block and mark it in its corresponding VR. */
+ vcmpequb v1,v1,v0
+ vcmpequb v2,v2,v0
+ vcmpequb v3,v3,v0
+ vcmpequb v4,v4,v0
+
+ /* We will now 'compress' the result into a single doubleword, so it
+ can be moved to a GPR for the final calculation. First, we
+ generate an appropriate mask for vbpermq, so we can permute bits into
+ the first halfword. */
+ vspltisb v10,3
+ lvsl v11,r0,r0
+ vslb v10,v11,v10
+
+ /* Permute the first bit of each byte into bits 48-63. */
+ VBPERMQ(v1,v1,v10)
+ VBPERMQ(v2,v2,v10)
+ VBPERMQ(v3,v3,v10)
+ VBPERMQ(v4,v4,v10)
+
+ /* Shift each component into its correct position for merging. */
+#ifdef __LITTLE_ENDIAN__
+ vsldoi v2,v2,v2,2
+ vsldoi v3,v3,v3,4
+ vsldoi v4,v4,v4,6
+#else
+ vsldoi v1,v1,v1,6
+ vsldoi v2,v2,v2,4
+ vsldoi v3,v3,v3,2
+#endif
+
+ /* Merge the results and move to a GPR. */
+ vor v1,v2,v1
+ vor v2,v3,v4
+ vor v4,v1,v2
+ MFVRD(r10,v4)
+
+ /* Adjust address to the begninning of the current 64-byte block. */
+ addi r4,r4,-64
+
+#ifdef __LITTLE_ENDIAN__
+ addi r9, r10,-1 /* Form a mask from trailing zeros. */
+ andc r9, r9,r10
+ popcntd r0, r9 /* Count the bits in the mask. */
+#else
+ cntlzd r0,r10 /* Count leading zeros before the match. */
+#endif
+ subf r5,r3,r4
+ add r3,r5,r0 /* Compute final length. */
+ blr
+
+END (STRLEN)
+libc_hidden_builtin_def (strlen)
diff --git a/sysdeps/powerpc/powerpc64/power8/strncase.S b/sysdeps/powerpc/powerpc64/power8/strncase.S
new file mode 100644
index 0000000000..050b63ab91
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strncase.S
@@ -0,0 +1,20 @@
+/* Optimized strncasecmp implementation for POWER8.
+ Copyright (C) 2016-2018 Free Software 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 USE_AS_STRNCASECMP 1
+#include <sysdeps/powerpc/powerpc64/power8/strcasecmp.S>
diff --git a/sysdeps/powerpc/powerpc64/power8/strncmp.S b/sysdeps/powerpc/powerpc64/power8/strncmp.S
index 1ce9e3fc65..2eefa4a2ba 100644
--- a/sysdeps/powerpc/powerpc64/power8/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strncmp implementation for PowerPC64/POWER8.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,10 @@
#include <sysdep.h>
+#ifndef STRNCMP
+# define STRNCMP strncmp
+#endif
+
/* Implements the function
int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t [r5] n)
@@ -28,7 +32,7 @@
4k. */
.machine power7
-EALIGN (strncmp, 4, 0)
+ENTRY_TOCLESS (STRNCMP, 4)
/* Check if size is 0. */
mr. r10,r5
beq cr0,L(ret0)
@@ -319,5 +323,5 @@ L(byte_ne_4):
extsw r10,r9
mr r9,r8
b L(size_reached_1)
-END(strncmp)
+END(STRNCMP)
libc_hidden_builtin_def(strncmp)
diff --git a/sysdeps/powerpc/powerpc64/power8/strncpy.S b/sysdeps/powerpc/powerpc64/power8/strncpy.S
index 17c3afb5fe..e8c5c71f87 100644
--- a/sysdeps/powerpc/powerpc64/power8/strncpy.S
+++ b/sysdeps/powerpc/powerpc64/power8/strncpy.S
@@ -1,5 +1,5 @@
/* Optimized strncpy/stpncpy implementation for PowerPC64/POWER8.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,11 +19,32 @@
#include <sysdep.h>
#ifdef USE_AS_STPNCPY
-# define FUNC_NAME __stpncpy
+# ifndef STPNCPY
+# define FUNC_NAME __stpncpy
+# else
+# define FUNC_NAME STPNCPY
+# endif
#else
-# define FUNC_NAME strncpy
+# ifndef STRNCPY
+# define FUNC_NAME strncpy
+# else
+# define FUNC_NAME STRNCPY
+# endif
+#endif /* !USE_AS_STPNCPY */
+
+#ifndef MEMSET
+/* For builds without IFUNC support, local calls should be made to internal
+ GLIBC symbol (created by libc_hidden_builtin_def). */
+# ifdef SHARED
+# define MEMSET_is_local
+# define MEMSET __GI_memset
+# else
+# define MEMSET memset
+# endif
#endif
+#define FRAMESIZE (FRAME_MIN_SIZE+48)
+
/* Implements the function
char * [r3] strncpy (char *dest [r3], const char *src [r4], size_t n [r5])
@@ -40,7 +61,12 @@
4k. */
.machine power7
-EALIGN (FUNC_NAME, 4, 0)
+#ifdef MEMSET_is_local
+ENTRY_TOCLESS (FUNC_NAME, 4)
+#else
+ENTRY (FUNC_NAME, 4)
+#endif
+ CALL_MCOUNT 3
/* Check if the [src]+15 will cross a 4K page by checking if the bit
indicating the page size changes. Basically:
@@ -54,8 +80,7 @@ EALIGN (FUNC_NAME, 4, 0)
addi r10,r4,16
rlwinm r9,r4,0,19,19
- /* Since it is a leaf function, save some non-volatile registers on the
- protected/red zone. */
+ /* Save some non-volatile registers on the stack. */
std r26,-48(r1)
std r27,-40(r1)
@@ -69,6 +94,14 @@ EALIGN (FUNC_NAME, 4, 0)
std r30,-16(r1)
std r31,-8(r1)
+ /* Update CFI. */
+ cfi_offset(r26, -48)
+ cfi_offset(r27, -40)
+ cfi_offset(r28, -32)
+ cfi_offset(r29, -24)
+ cfi_offset(r30, -16)
+ cfi_offset(r31, -8)
+
beq cr7,L(unaligned_lt_16)
rldicl r9,r4,0,61
subfic r8,r9,8
@@ -180,79 +213,66 @@ L(short_path_loop_end):
ld r31,-8(r1)
blr
- /* This code pads the remainder dest with NULL bytes. The algorithm
- calculate the remanining size and issues a doubleword unrolled
- loops followed by a byte a byte set. */
+ /* This code pads the remainder of dest with NULL bytes. The algorithm
+ calculates the remaining size and calls memset. */
.align 4
L(zero_pad_start):
mr r5,r10
mr r9,r6
L(zero_pad_start_1):
- srdi. r8,r5,r3
- mr r10,r9
-#ifdef USE_AS_STPNCPY
- mr r3,r9
+ /* At this point:
+ - r5 holds the number of bytes that still have to be written to
+ dest.
+ - r9 points to the position, in dest, where the first null byte
+ will be written.
+ The above statements are true both when control reaches this label
+ from a branch or when falling through the previous lines. */
+#ifndef USE_AS_STPNCPY
+ mr r30,r3 /* Save the return value of strncpy. */
+#endif
+ /* Prepare the call to memset. */
+ mr r3,r9 /* Pointer to the area to be zero-filled. */
+ li r4,0 /* Byte to be written (zero). */
+
+ /* We delayed the creation of the stack frame, as well as the saving of
+ the link register, because only at this point, we are sure that
+ doing so is actually needed. */
+
+ /* Save the link register. */
+ mflr r0
+ std r0,16(r1)
+
+ /* Create the stack frame. */
+ stdu r1,-FRAMESIZE(r1)
+ cfi_adjust_cfa_offset(FRAMESIZE)
+ cfi_offset(lr, 16)
+
+ bl MEMSET
+#ifndef MEMSET_is_local
+ nop
#endif
- beq- cr0,L(zero_pad_loop_b_start)
- cmpldi cr7,r8,1
- li cr7,0
- std r7,0(r9)
- beq cr7,L(zero_pad_loop_b_prepare)
- addic. r8,r8,-2
- addi r10,r9,r16
- std r7,8(r9)
- beq cr0,L(zero_pad_loop_dw_2)
- std r7,16(r9)
- li r9,0
- b L(zero_pad_loop_dw_1)
-
- .align 4
-L(zero_pad_loop_dw):
- addi r10,r10,16
- std r9,-8(r10)
- beq cr0,L(zero_pad_loop_dw_2)
- std r9,0(r10)
-L(zero_pad_loop_dw_1):
- cmpldi cr7,r8,1
- std r9,0(r10)
- addic. r8,r8,-2
- bne cr7,L(zero_pad_loop_dw)
- addi r10,r10,8
-L(zero_pad_loop_dw_2):
- rldicl r5,r5,0,61
-L(zero_pad_loop_b_start):
- cmpdi cr7,r5,0
- addi r5,r5,-1
- addi r9,r10,-1
- add r10,r10,5
- subf r10,r9,r10
- li r8,0
- beq- cr7,L(short_path_loop_end)
-
- /* Write remaining 1-8 bytes. */
- .align 4
- addi r9,r9,1
- mtocrf 0x1,r10
- bf 29,4f
- stw r8,0(r9)
- addi r9,r9,4
- .align 4
-4: bf 30,2f
- sth r8,0(r9)
- addi r9,r9,2
+ ld r0,FRAMESIZE+16(r1)
- .align 4
-2: bf 31,1f
- stb r8,0(r9)
+#ifndef USE_AS_STPNCPY
+ mr r3,r30 /* Restore the return value of strncpy, i.e.:
+ dest. For stpncpy, the return value is the
+ same as return value of memset. */
+#endif
- /* Restore non-volatile registers. */
-1: ld r26,-48(r1)
- ld r27,-40(r1)
- ld r28,-32(r1)
- ld r29,-24(r1)
- ld r30,-16(r1)
- ld r31,-8(r1)
+ /* Restore non-volatile registers and return. */
+ ld r26,FRAMESIZE-48(r1)
+ ld r27,FRAMESIZE-40(r1)
+ ld r28,FRAMESIZE-32(r1)
+ ld r29,FRAMESIZE-24(r1)
+ ld r30,FRAMESIZE-16(r1)
+ ld r31,FRAMESIZE-8(r1)
+ /* Restore the stack frame. */
+ addi r1,r1,FRAMESIZE
+ cfi_adjust_cfa_offset(-FRAMESIZE)
+ /* Restore the link register. */
+ mtlr r0
+ cfi_restore(lr)
blr
/* The common case where [src]+16 will not cross a 4K page boundary.
@@ -301,7 +321,7 @@ L(pagecross):
#endif
orc r9,r7,r9 /* Mask bits that are not part of the
string. */
- li cr7,0
+ li r7,0
cmpb r9,r9,r7 /* Check for null bytes in DWORD1. */
cmpdi cr7,r9,0
bne cr7,L(short_path_prepare_2)
@@ -312,14 +332,14 @@ L(pagecross):
/* For next checks we have aligned address, so we check for more
three doublewords to make sure we can read 16 unaligned bytes
to start the bulk copy with 16 aligned addresses. */
- ld cr7,8(r11)
+ ld r7,8(r11)
cmpb r9,r7,r9
cmpdi cr7,r9,0
bne cr7,L(short_path_prepare_2)
- addi cr7,r8,-8
+ addi r7,r8,-8
cmpldi cr7,r7,8
ble cr7,L(short_path_prepare_2)
- ld cr7,16(r11)
+ ld r7,16(r11)
cmpb r9,r7,r9
cmpdi cr7,r9,0
bne cr7,L(short_path_prepare_2)
@@ -443,18 +463,12 @@ L(short_path_prepare_2_3):
mr r4,r28
mr r9,r29
b L(short_path_2)
-L(zero_pad_loop_b_prepare):
- addi r10,r9,8
- rldicl r5,r5,0,61
- b L(zero_pad_loop_b_start)
L(zero_pad_start_prepare_1):
mr r5,r6
mr r9,r8
b L(zero_pad_start_1)
END (FUNC_NAME)
-#ifdef USE_AS_STPNCPY
-libc_hidden_def (__stpncpy)
-#else
+#ifndef USE_AS_STPNCPY
libc_hidden_builtin_def (strncpy)
#endif
diff --git a/sysdeps/powerpc/powerpc64/power8/strnlen.S b/sysdeps/powerpc/powerpc64/power8/strnlen.S
new file mode 100644
index 0000000000..a98dfba4bd
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strnlen.S
@@ -0,0 +1,425 @@
+/* Optimized strnlen implementation for POWER8 using a vmx loop.
+
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* It is implemented the following heuristic:
+ 1. Case maxlen <= 32: align the pointer to 8 bytes to loop through
+ reading doublewords. Uses the POWER7 algorithm.
+ 2. Case maxlen > 32: check for null bytes in the first 16 bytes using
+ unaligned accesses. Return length if found. Otherwise:
+ 2.1 Case maxlen < 64: deduct the bytes previously read, align
+ the pointer to 16 bytes and loop through reading quadwords
+ until find null bytes or reach maxlen.
+ 2.2 Case maxlen > 64: deduct the bytes previously read, align
+ the pointer to 64 bytes and set up a counter to loop through
+ reading in strides of 64 bytes. In case it finished the loop
+ with null bytes not found, process the remainder bytes by
+ switching to the loop to heuristic in 2.1. */
+
+#include <sysdep.h>
+
+/* Define default page size to 4KB. */
+#define PAGE_SIZE 4096
+
+/* The following macros implement Power ISA v2.07 opcodes
+ that could not be used directly into this code to the keep
+ compatibility with older binutils versions. */
+
+/* Move from vector register doubleword. */
+#define MFVRD(r,v) .long (0x7c000067 | ((v)<<(32-11)) | ((r)<<(32-16)))
+
+/* Move to vector register doubleword. */
+#define MTVRD(v,r) .long (0x7c000167 | ((v)<<(32-11)) | ((r)<<(32-16)))
+
+/* Vector Bit Permute Quadword. */
+#define VBPERMQ(t,a,b) .long (0x1000054c \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+
+/* Vector Population Count Halfword. */
+#define VPOPCNTH(t,b) .long (0x10000743 | ((t)<<(32-11)) | ((b)<<(32-21)))
+
+/* Vector Count Leading Zeros Halfword. */
+#define VCLZH(t,b) .long (0x10000742 | ((t)<<(32-11)) | ((b)<<(32-21)))
+
+
+/* int [r3] strnlen (char *s [r3], size_t maxlen [r4]) */
+/* TODO: change to power8 when minimum required binutils allows it. */
+ .machine power7
+ENTRY_TOCLESS (__strnlen)
+ CALL_MCOUNT 2
+ dcbt 0,r3
+
+ cmpldi r4,32 /* Check if maxlen <= 32. */
+ ble L(small_range) /* If maxlen <= 32. */
+
+ /* Upcoming 16 bytes unaligned accesses cannot cross the page boundary
+ otherwise the processor throws an memory access error.
+ Use following code to check there is room for such as accesses:
+ (((size_t) s) % PAGE_SIZE > (PAGE_SIZE - 16)
+ If it is disallowed then switch to the code that handles
+ the string when maxlen <= 32. */
+ clrldi r10,r3,52
+ cmpldi cr7,r10,PAGE_SIZE-16
+ bgt cr7,L(small_range) /* If less than 16B of page end. */
+
+ /* Compute our permute constant r8. */
+ li r7,0
+ /* Compute a bpermd constant to move bit 0 of each word into
+ a halfword value, and count trailing zeros. */
+#ifdef __LITTLE_ENDIAN__
+ li r8,0x2820
+ oris r8,r8,0x3830
+ sldi r8,r8,32
+ ori r8,r8,0x0800
+ oris r8,r8,0x1810
+#else
+ li r8,0x1018
+ oris r8,r8,0x0008
+ sldi r8,r8,32
+ ori r8,r8,0x3038
+ oris r8,r8,0x2028
+#endif
+
+ /* maxlen > 32. Optimistically check for null bytes in the first
+ 16 bytes of the string using unaligned accesses. */
+ ld r5,0(r3)
+ ld r6,8(r3)
+ cmpb r10,r7,r5 /* Check for null bytes in DWORD1. */
+ cmpb r11,r7,r6 /* Check for null bytes in DWORD2. */
+ or. r7,r10,r11
+ bne cr0, L(early_find) /* If found null bytes. */
+
+ /* At this point maxlen > 32 and null bytes were not found at first
+ 16 bytes. Prepare for loop using VMX. */
+
+ /* r3 == s, r4 == maxlen. All other volatile regs are unused now. */
+
+ addi r5,r3,16 /* Align up, or just add the 16B we
+ already checked. */
+ li r0,15
+ and r7,r5,r0 /* Find offset into 16B alignment. */
+ andc r5,r5,r0 /* Quadword align up s to the next quadword. */
+ li r0,16
+ subf r0,r7,r0
+ subf r4,r0,r4 /* Deduct unaligned bytes from maxlen. */
+
+
+ /* Compute offsets for vmx loads, and precompute the vbpermq
+ constants for both the 64B and 16B loops. */
+ li r6,0
+ vspltisb v0,0
+ vspltisb v10,3
+ lvsl v11,r6,r6
+ vslb v10,v11,v10
+
+ cmpldi r4,64 /* Check maxlen < 64. */
+ blt L(smaller) /* If maxlen < 64 */
+
+ /* In order to begin the 64B loop, it needs to be 64
+ bytes aligned. So read quadwords until it is aligned or found null
+ bytes. At worst case it will be aligned after the fourth iteration,
+ so unroll the loop to avoid counter checking. */
+ andi. r7,r5,63 /* Check if is 64 bytes aligned. */
+ beq cr0,L(preloop_64B) /* If it is already 64B aligned. */
+ lvx v1,r5,r6
+ vcmpequb. v1,v1,v0
+ addi r5,r5,16
+ addi r4,r4,-16 /* Decrement maxlen in 16 bytes. */
+ bne cr6,L(found_aligning64B) /* If found null bytes. */
+
+ /* Unroll 2x above code block until aligned or find null bytes. */
+ andi. r7,r5,63
+ beq cr0,L(preloop_64B)
+ lvx v1,r5,r6
+ vcmpequb. v1,v1,v0
+ addi r5,r5,16
+ addi r4,r4,-16
+ bne cr6,L(found_aligning64B)
+
+ andi. r7,r5,63
+ beq cr0,L(preloop_64B)
+ lvx v1,r5,r6
+ vcmpequb. v1,v1,v0
+ addi r5,r5,16
+ addi r4,r4,-16
+ bne cr6,L(found_aligning64B)
+
+ /* At this point it should be 16 bytes aligned.
+ Prepare for the 64B loop. */
+ .p2align 4
+L(preloop_64B):
+ /* Check if maxlen became is less than 64, therefore disallowing the
+ 64B loop. If it happened switch to the 16B loop code. */
+ cmpldi r4,64 /* Check if maxlen < 64. */
+ blt L(smaller) /* If maxlen < 64. */
+ /* Set some constant values. */
+ li r7,16
+ li r10,32
+ li r9,48
+
+ /* Compute the number of 64 bytes iterations needed. */
+ srdi r11,r4,6 /* Compute loop count (maxlen / 64). */
+ andi. r4,r4,63 /* Set maxlen the remainder (maxlen % 64). */
+ mtctr r11 /* Move loop count to counter register. */
+
+ /* Handle maxlen > 64. Loop over the bytes in strides of 64B. */
+ .p2align 4
+L(loop_64B):
+ lvx v1,r5,r6 /* r5 is the pointer to s. */
+ lvx v2,r5,r7
+ lvx v3,r5,r10
+ lvx v4,r5,r9
+ /* Compare the four 16B vectors to obtain the least 16 values.
+ Null bytes should emerge into v7, then check for null bytes. */
+ vminub v5,v1,v2
+ vminub v6,v3,v4
+ vminub v7,v5,v6
+ vcmpequb. v7,v7,v0 /* Check for null bytes. */
+ addi r5,r5,64 /* Add pointer to next iteraction. */
+ bne cr6,L(found_64B) /* If found null bytes. */
+ bdnz L(loop_64B) /* Continue the loop if count > 0. */
+
+/* Hit loop end without null match. So branch to handle the remainder. */
+
+ /* Prepare a 16B loop to handle two cases:
+ 1. If 32 > maxlen < 64.
+ 2. If maxlen >= 64, and reached end of the 64B loop with null
+ bytes not found. Thus handle the remainder bytes here. */
+ .p2align 4
+L(smaller):
+ cmpldi r4,0 /* Check maxlen is zero. */
+ beq L(done) /* If maxlen is zero. */
+
+ /* Place rounded up number of qw's to check into a vmx
+ register, and use some vector tricks to minimize
+ branching. */
+ MTVRD(v7,r4) /* Copy maxlen from GPR to vector register. */
+ vspltisb v5,1
+ vspltisb v6,15
+ vspltb v2,v7,7
+ vaddubs v3,v5,v6
+
+#ifdef __LITTLE_ENDIAN__
+ vspltish v5,1 /* Compute 16 in each byte. */
+#endif
+
+ /* Loop in 16B aligned incremements now. */
+ .p2align 4
+L(loop_16B):
+ lvx v1,r5,r6 /* Load quadword into vector register. */
+ addi r5,r5,16 /* Increment address to next 16B block. */
+ vor v7,v2,v2 /* Save loop count (v2) into v7. */
+ vsububs v2,v2,v3 /* Subtract 16B from count, saturate at 0. */
+ vminub v4,v1,v2
+ vcmpequb. v4,v4,v0 /* Checking for null bytes. */
+ beq cr6,L(loop_16B) /* If null bytes not found. */
+
+ vcmpequb v1,v1,v0
+ VBPERMQ(v1,v1,v10)
+#ifdef __LITTLE_ENDIAN__
+ vsubuhm v2,v1,v5 /* Form a mask of trailing zeros. */
+ vandc v2,v2,v1
+ VPOPCNTH(v1,v2) /* Count of trailing zeros, 16 if none. */
+#else
+ VCLZH(v1,v1) /* Count the leading zeros, 16 if none. */
+#endif
+ /* Truncate to maximum allowable offset. */
+ vcmpgtub v2,v1,v7 /* Compare and truncate for matches beyond
+ maxlen. */
+ vsel v1,v1,v7,v2 /* 0-16 is now in byte 7. */
+
+ MFVRD(r0,v1)
+ addi r5,r5,-16 /* Undo speculative bump. */
+ extsb r0,r0 /* Clear whatever gunk is in the high 56b. */
+ add r5,r5,r0 /* Add the offset of whatever was found. */
+L(done):
+ subf r3,r3,r5 /* Length is equal to the offset of null byte
+ matched minus the pointer to s. */
+ blr /* Done. */
+
+ /* Handle case of maxlen > 64 and found null bytes in last block
+ of 64 bytes read. */
+ .p2align 4
+L(found_64B):
+ /* A zero was found. Reduce the result. */
+ vcmpequb v1,v1,v0
+ vcmpequb v2,v2,v0
+ vcmpequb v3,v3,v0
+ vcmpequb v4,v4,v0
+
+ /* Permute the first bit of each byte into bits 48-63. */
+ VBPERMQ(v1,v1,v10)
+ VBPERMQ(v2,v2,v10)
+ VBPERMQ(v3,v3,v10)
+ VBPERMQ(v4,v4,v10)
+
+ /* Shift each component into its correct position for merging. */
+#ifdef __LITTLE_ENDIAN__
+ vsldoi v2,v2,v2,2
+ vsldoi v3,v3,v3,4
+ vsldoi v4,v4,v4,6
+#else
+ vsldoi v1,v1,v1,6
+ vsldoi v2,v2,v2,4
+ vsldoi v3,v3,v3,2
+#endif
+
+ /* Merge the results and move to a GPR. */
+ vor v1,v2,v1
+ vor v2,v3,v4
+ vor v4,v1,v2
+
+ /* Adjust address to the start of the current 64B block. */
+ addi r5,r5,-64
+
+ MFVRD(r10,v4)
+#ifdef __LITTLE_ENDIAN__
+ addi r9,r10,-1 /* Form a mask from trailing zeros. */
+ andc r9,r9,r10
+ popcntd r0,r9 /* Count the bits in the mask. */
+#else
+ cntlzd r0,r10 /* Count leading zeros before the match. */
+#endif
+ subf r5,r3,r5
+ add r3,r5,r0 /* Compute final length. */
+ blr /* Done. */
+
+ /* Handle case where null bytes were found while aligning
+ as a preparation for the 64B loop. */
+ .p2align 4
+L(found_aligning64B):
+ VBPERMQ(v1,v1,v10)
+#ifdef __LITTLE_ENDIAN__
+ MFVRD(r10,v1)
+ addi r9,r10,-1 /* Form a mask from trailing zeros. */
+ andc r9,r9,r10
+ popcntd r0,r9 /* Count the bits in the mask. */
+#else
+ vsldoi v1,v1,v1,6
+ MFVRD(r10,v1)
+ cntlzd r0,r10 /* Count leading zeros before the match. */
+#endif
+ addi r5,r5,-16 /* Adjust address to offset of last 16 bytes
+ read. */
+ /* Calculate length as subtracted the pointer to s of last 16 bytes
+ offset, added with the bytes before the match. */
+ subf r5,r3,r5
+ add r3,r5,r0
+ blr /* Done. */
+
+ /* Handle case of maxlen > 32 and found a null bytes within the first
+ 16 bytes of s. */
+ .p2align 4
+L(early_find):
+ bpermd r5,r8,r10 /* r8 contains the bit permute constants. */
+ bpermd r6,r8,r11
+ sldi r5,r5,8
+ or r5,r5,r6 /* r5 should hold a 16B mask of
+ a potential 0. */
+ cntlzd r5,r5 /* Count leading zeros. */
+ addi r3,r5,-48 /* Deduct the 48 leading zeros always
+ present. */
+ blr /* Done. */
+
+ /* Handle case of maxlen <= 32. Use the POWER7 algorithm. */
+ .p2align 4
+L(small_range):
+ clrrdi r8,r3,3 /* Align the pointer to 8B. */
+ li r0,0
+ /* Register's content at this point:
+ r3 == pointer to s, r4 == maxlen, r8 == pointer to s aligned to 8B,
+ r7 == last acceptable address. */
+ cmpldi r4,0 /* Check if maxlen is zero. */
+ beq L(end_max) /* If maxlen is zero. */
+
+ /* Calculate the last acceptable address and check for possible
+ addition overflow by using satured math:
+ r7 = r3 + r4
+ r7 |= -(r7 < x) */
+ add r7,r3,r4
+ subfc r6,r3,r7
+ subfe r9,r9,r9
+ extsw r6,r9
+ or r7,r7,r6
+ addi r7,r7,-1
+
+ clrrdi r7,r7,3 /* Align to 8B address of last
+ acceptable address. */
+
+ rlwinm r6,r3,3,26,28 /* Calculate padding. */
+ ld r12,0(r8) /* Load aligned doubleword. */
+ cmpb r10,r12,r0 /* Check for null bytes. */
+#ifdef __LITTLE_ENDIAN__
+ srd r10,r10,r6
+ sld r10,r10,r6
+#else
+ sld r10,r10,r6
+ srd r10,r10,r6
+#endif /* __LITTLE_ENDIAN__ */
+ cmpldi cr7,r10,0
+ bne cr7,L(done_small) /* If found null byte. */
+
+ cmpld r8,r7 /* Check if reached maxlen. */
+ beq L(end_max) /* If reached maxlen. */
+
+ /* Still handling case of maxlen <= 32. Read doubleword aligned until
+ find null bytes or reach maxlen. */
+ .p2align 4
+L(loop_small):
+ ldu r12,8(r8) /* Load next doubleword and update r8. */
+ cmpb r10,r12,r0 /* Check for null bytes. */
+ cmpldi cr6,r10,0
+ bne cr6,L(done_small) /* If found null bytes. */
+ cmpld r8,r7 /* Check if reached maxlen. */
+ bne L(loop_small) /* If it has more bytes to read. */
+ mr r3,r4 /* Reached maxlen with null bytes not found.
+ Length is equal to maxlen. */
+ blr /* Done. */
+
+ /* Still handling case of maxlen <= 32. Found null bytes.
+ Registers: r10 == match bits within doubleword, r8 == address of
+ last doubleword read, r3 == pointer to s, r4 == maxlen. */
+ .p2align 4
+L(done_small):
+#ifdef __LITTLE_ENDIAN__
+ /* Count trailing zeros. */
+ addi r0,r10,-1
+ andc r0,r0,r10
+ popcntd r0,r0
+#else
+ cntlzd r0,r10 /* Count leading zeros before the match. */
+#endif
+ sub r3,r8,r3 /* Calculate total of bytes before the match. */
+ srdi r0,r0,3 /* Convert leading/trailing zeros to bytes. */
+ add r3,r3,r0 /* Length until the match. */
+ cmpld r3,r4 /* Check length is greater than maxlen. */
+ blelr
+ mr r3,r4 /* If length is greater than maxlen, return
+ maxlen. */
+ blr
+
+ /* Handle case of reached maxlen with null bytes not found. */
+ .p2align 4
+L(end_max):
+ mr r3,r4 /* Length is equal to maxlen. */
+ blr /* Done. */
+
+
+END (__strnlen)
+libc_hidden_def (__strnlen)
+weak_alias (__strnlen, strnlen)
+libc_hidden_def (strnlen)
diff --git a/sysdeps/powerpc/powerpc64/power8/strrchr.S b/sysdeps/powerpc/powerpc64/power8/strrchr.S
new file mode 100644
index 0000000000..6ff8a528b6
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strrchr.S
@@ -0,0 +1,468 @@
+/* Optimized strrchr implementation for PowerPC64/POWER7 using cmpb insn.
+ Copyright (C) 2017-2018 Free Software 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>
+
+/* char *[r3] strrchr (char *s [r3], int c [r4]) */
+/* TODO: change these to the actual instructions when the minimum required
+ binutils allows it. */
+#define MTVRD(v,r) .long (0x7c000167 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#define MFVRD(r,v) .long (0x7c000067 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#define VBPERMQ(t,a,b) .long (0x1000054c \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+#define VCLZD(r,v) .long (0x100007c2 | ((r)<<(32-11)) | ((v)<<(32-21)))
+#define VPOPCNTD(r,v) .long (0x100007c3 | ((r)<<(32-11)) | ((v)<<(32-21)))
+#define VADDUQM(t,a,b) .long (0x10000100 \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+#ifdef __LITTLE_ENDIAN__
+/* Find the match position from v6 and place result in r6. */
+# define CALCULATE_MATCH() \
+ VBPERMQ(v6, v6, v10); \
+ vsldoi v6, v6, v6, 6; \
+ MFVRD(r7, v6); \
+ cntlzd r6, r7; \
+ subfic r6, r6, 15;
+/*
+ * Find the first null position to mask bytes after null.
+ * (reg): vcmpequb result: v2 for 1st qw v3 for 2nd qw.
+ * Result placed at v2.
+ */
+# define FIND_NULL_POS(reg) \
+ vspltisb v11, -1; \
+ VADDUQM(v11, reg, v11); \
+ vandc v11, v11, reg; \
+ VPOPCNTD(v2, v11); \
+ vspltb v11, v2, 15; \
+ vcmpequb. v11, v11, v9; \
+ blt cr6, 1f; \
+ vsldoi v9, v0, v9, 1; \
+ vslo v2, v2, v9; \
+1: \
+ vsumsws v2, v2, v0;
+#else
+# define CALCULATE_MATCH() \
+ VBPERMQ(v6, v6, v10); \
+ MFVRD(r7, v6); \
+ addi r6, r7, -1; \
+ andc r6, r6, r7; \
+ popcntd r6, r6; \
+ subfic r6, r6, 15;
+# define FIND_NULL_POS(reg) \
+ VCLZD(v2, reg); \
+ vspltb v11, v2, 7; \
+ vcmpequb. v11, v11, v9; \
+ blt cr6, 1f; \
+ vsldoi v9, v0, v9, 1; \
+ vsro v2, v2, v9; \
+1: \
+ vsumsws v2, v2, v0;
+#endif /* !__LITTLE_ENDIAN__ */
+
+#ifndef STRRCHR
+# define STRRCHR strrchr
+#endif
+ .machine power7
+ENTRY_TOCLESS (STRRCHR)
+ CALL_MCOUNT 2
+ dcbt 0,r3
+ clrrdi r8,r3,3 /* Align the address to doubleword boundary. */
+ cmpdi cr7,r4,0
+ ld r12,0(r8) /* Load doubleword from memory. */
+ li r9,0 /* Used to store last occurence. */
+ li r0,0 /* Doubleword with null chars to use
+ with cmpb. */
+
+ rlwinm r6,r3,3,26,28 /* Calculate padding. */
+
+ beq cr7,L(null_match)
+
+ /* Replicate byte to doubleword. */
+ insrdi r4,r4,8,48
+ insrdi r4,r4,16,32
+ insrdi r4,r4,32,0
+
+ /* r4 is changed now. If it's passed more chars, then
+ check for null again. */
+ cmpdi cr7,r4,0
+ beq cr7,L(null_match)
+ /* Now r4 has a doubleword of c bytes and r0 has
+ a doubleword of null bytes. */
+
+ cmpb r10,r12,r4 /* Compare each byte against c byte. */
+ cmpb r11,r12,r0 /* Compare each byte against null byte. */
+
+ /* Move the doublewords left and right to discard the bits that are
+ not part of the string and bring them back as zeros. */
+#ifdef __LITTLE_ENDIAN__
+ srd r10,r10,r6
+ srd r11,r11,r6
+ sld r10,r10,r6
+ sld r11,r11,r6
+#else
+ sld r10,r10,r6
+ sld r11,r11,r6
+ srd r10,r10,r6
+ srd r11,r11,r6
+#endif
+ or r5,r10,r11 /* OR the results to speed things up. */
+ cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes
+ have been found. */
+ bne cr7,L(done)
+
+L(align):
+ andi. r12, r8, 15
+
+ /* Are we now aligned to a doubleword boundary? If so, skip to
+ the main loop. Otherwise, go through the alignment code. */
+
+ bne cr0, L(loop)
+
+ /* Handle WORD2 of pair. */
+ ldu r12,8(r8)
+ cmpb r10,r12,r4
+ cmpb r11,r12,r0
+ or r5,r10,r11
+ cmpdi cr7,r5,0
+ bne cr7,L(done)
+ b L(loop) /* We branch here (rather than falling through)
+ to skip the nops due to heavy alignment
+ of the loop below. */
+ .p2align 5
+L(loop):
+ /* Load two doublewords, compare and merge in a
+ single register for speed. This is an attempt
+ to speed up the null-checking process for bigger strings. */
+ ld r12,8(r8)
+ ldu r7,16(r8)
+ cmpb r10,r12,r4
+ cmpb r11,r12,r0
+ cmpb r6,r7,r4
+ cmpb r7,r7,r0
+ or r12,r10,r11
+ or r5,r6,r7
+ or r5,r12,r5
+ cmpdi cr7,r5,0
+ beq cr7,L(vector)
+
+ /* OK, one (or both) of the doublewords contains a c/null byte. Check
+ the first doubleword and decrement the address in case the first
+ doubleword really contains a c/null byte. */
+ cmpdi cr6,r12,0
+ addi r8,r8,-8
+ bne cr6,L(done)
+
+ /* The c/null byte must be in the second doubleword. Adjust the
+ address again and move the result of cmpb to r10 so we can calculate
+ the pointer. */
+
+ mr r10,r6
+ mr r11,r7
+ addi r8,r8,8
+
+ /* r10/r11 have the output of the cmpb instructions, that is,
+ 0xff in the same position as the c/null byte in the original
+ doubleword from the string. Use that to calculate the pointer. */
+
+L(done):
+ /* If there are more than one 0xff in r11, find the first position of
+ 0xff in r11 and fill r10 with 0 from that position. */
+ cmpdi cr7,r11,0
+ beq cr7,L(no_null)
+#ifdef __LITTLE_ENDIAN__
+ addi r3,r11,-1
+ andc r3,r3,r11
+ popcntd r0,r3
+#else
+ cntlzd r0,r11
+#endif
+ subfic r0,r0,63
+ li r6,-1
+#ifdef __LITTLE_ENDIAN__
+ srd r0,r6,r0
+#else
+ sld r0,r6,r0
+#endif
+ and r10,r0,r10
+L(no_null):
+#ifdef __LITTLE_ENDIAN__
+ cntlzd r0,r10 /* Count leading zeros before c matches. */
+ addi r3,r10,-1
+ andc r3,r3,r10
+ addi r10,r11,-1
+ andc r10,r10,r11
+ cmpld cr7,r3,r10
+ bgt cr7,L(no_match)
+#else
+ addi r3,r10,-1 /* Count trailing zeros before c matches. */
+ andc r3,r3,r10
+ popcntd r0,r3
+ cmpld cr7,r11,r10
+ bgt cr7,L(no_match)
+#endif
+ srdi r0,r0,3 /* Convert trailing zeros to bytes. */
+ subfic r0,r0,7
+ add r9,r8,r0 /* Return address of the matching c byte
+ or null in case c was not found. */
+ li r0,0
+ cmpdi cr7,r11,0 /* If r11 == 0, no null's have been found. */
+ beq cr7,L(align)
+
+ .align 4
+L(no_match):
+ mr r3,r9
+ blr
+
+/* Check the first 32B in GPR's and move to vectorized loop. */
+ .p2align 5
+L(vector):
+ addi r3, r8, 8
+ /* Make sure 32B aligned. */
+ andi. r10, r3, 31
+ bne cr0, L(loop)
+ vspltisb v0, 0
+ /* Precompute vbpermq constant. */
+ vspltisb v10, 3
+ lvsl v11, r0, r0
+ vslb v10, v11, v10
+ MTVRD(v1, r4)
+ li r5, 16
+ vspltb v1, v1, 7
+ /* Compare 32 bytes in each loop. */
+L(continue):
+ lvx v4, 0, r3
+ lvx v5, r3, r5
+ vcmpequb v2, v0, v4
+ vcmpequb v3, v0, v5
+ vcmpequb v6, v1, v4
+ vcmpequb v7, v1, v5
+ vor v8, v2, v3
+ vor v9, v6, v7
+ vor v11, v8, v9
+ vcmpequb. v11, v0, v11
+ addi r3, r3, 32
+ blt cr6, L(continue)
+ vcmpequb. v8, v0, v8
+ blt cr6, L(match)
+
+ /* One (or both) of the quadwords contains c/null. */
+ vspltisb v8, 2
+ vspltisb v9, 5
+ /* Precompute values used for comparison. */
+ vsl v9, v8, v9 /* v9 = 0x4040404040404040. */
+ vaddubm v8, v9, v9
+ vsldoi v8, v0, v8, 1 /* v8 = 0x80. */
+
+ /* Check if null is in second qw. */
+ vcmpequb. v11, v0, v2
+ blt cr6, L(secondqw)
+
+ /* Null found in first qw. */
+ addi r8, r3, -32
+ /* Calculate the null position. */
+ FIND_NULL_POS(v2)
+ /* Check if null is in the first byte. */
+ vcmpequb. v11, v0, v2
+ blt cr6, L(no_match)
+ vsububm v2, v8, v2
+ /* Mask unwanted bytes after null. */
+#ifdef __LITTLE_ENDIAN__
+ vslo v6, v6, v2
+ vsro v6, v6, v2
+#else
+ vsro v6, v6, v2
+ vslo v6, v6, v2
+#endif
+ vcmpequb. v11, v0, v6
+ blt cr6, L(no_match)
+ /* Found a match before null. */
+ CALCULATE_MATCH()
+ add r3, r8, r6
+ blr
+
+L(secondqw):
+ addi r8, r3, -16
+ FIND_NULL_POS(v3)
+ vcmpequb. v11, v0, v2
+ blt cr6, L(no_match1)
+ vsububm v2, v8, v2
+ /* Mask unwanted bytes after null. */
+#ifdef __LITTLE_ENDIAN__
+ vslo v7, v7, v2
+ vsro v7, v7, v2
+#else
+ vsro v7, v7, v2
+ vslo v7, v7, v2
+#endif
+ vcmpequb. v11, v0, v7
+ blt cr6, L(no_match1)
+ addi r8, r8, 16
+ vor v6, v0, v7
+L(no_match1):
+ addi r8, r8, -16
+ vcmpequb. v11, v0, v6
+ blt cr6, L(no_match)
+ /* Found a match before null. */
+ CALCULATE_MATCH()
+ add r3, r8, r6
+ blr
+
+L(match):
+ /* One (or both) of the quadwords contains a match. */
+ mr r8, r3
+ vcmpequb. v8, v0, v7
+ blt cr6, L(firstqw)
+ /* Match found in second qw. */
+ addi r8, r8, 16
+ vor v6, v0, v7
+L(firstqw):
+ addi r8, r8, -32
+ CALCULATE_MATCH()
+ add r9, r8, r6 /* Compute final length. */
+ b L(continue)
+/* We are here because strrchr was called with a null byte. */
+ .align 4
+L(null_match):
+ /* r0 has a doubleword of null bytes. */
+
+ cmpb r5,r12,r0 /* Compare each byte against null bytes. */
+
+ /* Move the doublewords left and right to discard the bits that are
+ not part of the string and bring them back as zeros. */
+#ifdef __LITTLE_ENDIAN__
+ srd r5,r5,r6
+ sld r5,r5,r6
+#else
+ sld r5,r5,r6
+ srd r5,r5,r6
+#endif
+ cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes
+ have been found. */
+ bne cr7,L(done_null)
+
+ andi. r12, r8, 15
+
+ /* Are we now aligned to a quadword boundary? If so, skip to
+ the main loop. Otherwise, go through the alignment code. */
+
+ bne cr0, L(loop_null)
+
+ /* Handle WORD2 of pair. */
+ ldu r12,8(r8)
+ cmpb r5,r12,r0
+ cmpdi cr7,r5,0
+ bne cr7,L(done_null)
+ b L(loop_null) /* We branch here (rather than falling through)
+ to skip the nops due to heavy alignment
+ of the loop below. */
+
+ /* Main loop to look for the end of the string. Since it's a
+ small loop (< 8 instructions), align it to 32-bytes. */
+ .p2align 5
+L(loop_null):
+ /* Load two doublewords, compare and merge in a
+ single register for speed. This is an attempt
+ to speed up the null-checking process for bigger strings. */
+ ld r12,8(r8)
+ ldu r11,16(r8)
+ cmpb r5,r12,r0
+ cmpb r10,r11,r0
+ or r6,r5,r10
+ cmpdi cr7,r6,0
+ beq cr7,L(vector1)
+
+ /* OK, one (or both) of the doublewords contains a null byte. Check
+ the first doubleword and decrement the address in case the first
+ doubleword really contains a null byte. */
+
+ cmpdi cr6,r5,0
+ addi r8,r8,-8
+ bne cr6,L(done_null)
+
+ /* The null byte must be in the second doubleword. Adjust the address
+ again and move the result of cmpb to r10 so we can calculate the
+ pointer. */
+
+ mr r5,r10
+ addi r8,r8,8
+
+ /* r5 has the output of the cmpb instruction, that is, it contains
+ 0xff in the same position as the null byte in the original
+ doubleword from the string. Use that to calculate the pointer. */
+L(done_null):
+#ifdef __LITTLE_ENDIAN__
+ addi r0,r5,-1
+ andc r0,r0,r5
+ popcntd r0,r0
+#else
+ cntlzd r0,r5 /* Count leading zeros before the match. */
+#endif
+ srdi r0,r0,3 /* Convert trailing zeros to bytes. */
+ add r3,r8,r0 /* Return address of the matching null byte. */
+ blr
+/* Check the first 32B in GPR's and move to vectorized loop. */
+ .p2align 5
+L(vector1):
+ addi r3, r8, 8
+ /* Make sure 32B aligned. */
+ andi. r10, r3, 31
+ bne cr0, L(loop_null)
+ vspltisb v0, 0
+ /* Precompute vbpermq constant. */
+ vspltisb v10, 3
+ lvsl v11, r0, r0
+ vslb v10, v11, v10
+ li r5, 16
+ /* Compare 32 bytes in each loop. */
+L(continue1):
+ lvx v4, 0, r3
+ lvx v5, r3, r5
+ vcmpequb v2, v0, v4
+ vcmpequb v3, v0, v5
+ vor v8, v2, v3
+ vcmpequb. v11, v0, v8
+ addi r3, r3, 32
+ blt cr6, L(continue1)
+ addi r3, r3, -32
+ VBPERMQ(v2, v2, v10)
+ VBPERMQ(v3, v3, v10)
+ /* Shift each component into its correct position for merging. */
+#ifdef __LITTLE_ENDIAN__
+ vsldoi v3, v3, v3, 2
+#else
+ vsldoi v2, v2, v2, 6
+ vsldoi v3, v3, v3, 4
+#endif
+ /* Merge the results and move to a GPR. */
+ vor v4, v3, v2
+ MFVRD(r5, v4)
+#ifdef __LITTLE_ENDIAN__
+ addi r6, r5, -1
+ andc r6, r6, r5
+ popcntd r6, r6
+#else
+ cntlzd r6, r5 /* Count leading zeros before the match. */
+#endif
+ add r3, r3, r6 /* Compute final length. */
+ blr
+END_GEN_TB (STRRCHR, TB_TOCLESS)
+weak_alias (strrchr, rindex)
+libc_hidden_builtin_def (strrchr)
diff --git a/sysdeps/powerpc/powerpc64/power8/strspn.S b/sysdeps/powerpc/powerpc64/power8/strspn.S
new file mode 100644
index 0000000000..095f6d6f41
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/strspn.S
@@ -0,0 +1,202 @@
+/* Optimized strspn implementation for Power8.
+
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+/* size_t [r3] strspn (const char *string [r3],
+ const char *needleAccept [r4]) */
+
+/* This takes a novel approach by computing a 256 bit mask whereby
+ each set bit implies the byte is "accepted". P8 vector hardware
+ has extremely efficient hardware for selecting bits from a mask.
+
+ One might ask "why not use bpermd for short strings"? It is
+ so slow that its performance about matches the generic PPC64
+ variant without any fancy masking, with the added expense of
+ making the mask. That was the first variant of this. */
+
+
+
+#include "sysdep.h"
+
+#ifndef USE_AS_STRCSPN
+# define USE_AS_STRCSPN 0
+# ifndef STRSPN
+# define STRSPN strspn
+# endif
+# define INITIAL_MASK 0
+# define UPDATE_MASK(RA, RS, RB) or RA, RS, RB
+#else
+# ifndef STRSPN
+# define STRSPN strcspn
+# endif
+# define INITIAL_MASK -1
+# define UPDATE_MASK(RA, RS, RB) andc RA, RS, RB
+#endif
+
+/* Simple macro to use VSX instructions in overlapping VR's. */
+#define XXVR(insn, vrt, vra, vrb) \
+ insn 32+vrt, 32+vra, 32+vrb
+
+/* ISA 2.07B instructions are not all defined for older binutils.
+ Macros are defined below for these newer instructions in order
+ to maintain compatibility. */
+
+/* Note, TX/SX is always set as VMX regs are the high 32 VSX regs. */
+#define MTVRD(v,r) .long (0x7c000167 | ((v)<<(32-11)) | ((r)<<(32-16)))
+#define MFVRD(r,v) .long (0x7c000067 | ((v)<<(32-11)) | ((r)<<(32-16)))
+
+#define VBPERMQ(t,a,b) .long (0x1000054c \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+
+ /* This can be updated to power8 once the minimum version of
+ binutils supports power8 and the above instructions. */
+ .machine power7
+ENTRY_TOCLESS (STRSPN, 4)
+ CALL_MCOUNT 2
+
+ /* Generate useful constants for later on. */
+ vspltisb v1, 7
+ vspltisb v2, -1
+ vslb v1, v1, v1 /* 0x80 to swap high bit for vbpermq. */
+ vspltisb v10, 0
+ vsldoi v4, v10, v2, 2 /* 0xFFFF into vr4. */
+ XXVR(xxmrgld, v4, v4, v10) /* Mask for checking matches. */
+
+ /* Prepare to compute 256b mask. */
+ addi r4, r4, -1
+ li r5, INITIAL_MASK
+ li r6, INITIAL_MASK
+ li r7, INITIAL_MASK
+ li r8, INITIAL_MASK
+
+#if USE_AS_STRCSPN
+ /* Ensure the null character never matches by clearing ISA bit 0 in
+ in r5 which is the bit which will check for it in the later usage
+ of vbpermq. */
+ srdi r5, r5, 1
+#endif
+
+ li r11, 1
+ sldi r11, r11, 63
+
+ /* Start interleaved Mask computation.
+ This will eventually or 1's into ignored bits from vbpermq. */
+ lvsr v11, 0, r3
+ vspltb v11, v11, 0 /* Splat shift constant. */
+
+ /* Build a 256b mask in r5-r8. */
+ .align 4
+L(next_needle):
+ lbzu r9, 1(r4)
+
+ cmpldi cr0, r9, 0
+ cmpldi cr1, r9, 128
+
+ /* This is a little tricky. srd only uses the first 7 bits,
+ and if bit 7 is set, value is always 0. So, we can
+ effectively shift 128b in this case. */
+ xori r12, r9, 0x40 /* Invert bit 6. */
+ srd r10, r11, r9 /* Mask for bits 0-63. */
+ srd r12, r11, r12 /* Mask for bits 64-127. */
+
+ beq cr0, L(start_cmp)
+
+ /* Now, or the value into the correct GPR. */
+ bge cr1,L(needle_gt128)
+ UPDATE_MASK (r5, r5, r10) /* 0 - 63. */
+ UPDATE_MASK (r6, r6, r12) /* 64 - 127. */
+ b L(next_needle)
+
+ .align 4
+L(needle_gt128):
+ UPDATE_MASK (r7, r7, r10) /* 128 - 191. */
+ UPDATE_MASK (r8, r8, r12) /* 192 - 255. */
+ b L(next_needle)
+
+
+ .align 4
+L(start_cmp):
+ /* Move and merge bitmap into 2 VRs. bpermd is slower on P8. */
+ mr r0, r3 /* Save r3 for final length computation. */
+ MTVRD (v5, r5)
+ MTVRD (v6, r6)
+ MTVRD (v7, r7)
+ MTVRD (v8, r8)
+
+ /* Continue interleaved mask generation. */
+#ifdef __LITTLE_ENDIAN__
+ vsrw v11, v2, v11 /* Note, shift ignores higher order bits. */
+ vsplth v11, v11, 0 /* Only care about the high 16 bits of v10. */
+#else
+ vslw v11, v2, v11 /* Note, shift ignores higher order bits. */
+ vsplth v11, v11, 1 /* Only care about the low 16 bits of v10. */
+#endif
+ lvx v0, 0, r3 /* Note, unaligned load ignores lower bits. */
+
+ /* Do the merging of the bitmask. */
+ XXVR(xxmrghd, v5, v5, v6)
+ XXVR(xxmrghd, v6, v7, v8)
+
+ /* Finish mask generation. */
+ vand v11, v11, v4 /* Throwaway bits not in the mask. */
+
+ /* Compare the first 1-16B, while masking unwanted bytes. */
+ clrrdi r3, r3, 4 /* Note, counts from qw boundaries. */
+ vxor v9, v0, v1 /* Swap high bit. */
+ VBPERMQ (v8, v5, v0)
+ VBPERMQ (v7, v6, v9)
+ vor v7, v7, v8
+ vor v7, v7, v11 /* Ignore non-participating bytes. */
+ vcmpequh. v8, v7, v4
+ bnl cr6, L(done)
+
+ addi r3, r3, 16
+
+ .align 4
+L(vec):
+ lvx v0, 0, r3
+ addi r3, r3, 16
+ vxor v9, v0, v1 /* Swap high bit. */
+ VBPERMQ (v8, v5, v0)
+ VBPERMQ (v7, v6, v9)
+ vor v7, v7, v8
+ vcmpequh. v8, v7, v4
+ blt cr6, L(vec)
+
+ addi r3, r3, -16
+L(done):
+ subf r3, r0, r3
+ MFVRD (r10, v7)
+
+#ifdef __LITTLE_ENDIAN__
+ addi r0, r10, 1 /* Count the trailing 1's. */
+ andc r10, r10, r0
+ popcntd r10, r10
+#else
+ xori r10, r10, 0xffff /* Count leading 1's by inverting. */
+ addi r3, r3, -48 /* Account for the extra leading zeros. */
+ cntlzd r10, r10
+#endif
+
+ add r3, r3, r10
+ blr
+
+END(STRSPN)
+libc_hidden_builtin_def (STRSPN)
diff --git a/sysdeps/powerpc/powerpc64/power9/Implies b/sysdeps/powerpc/powerpc64/power9/Implies
deleted file mode 100644
index fad2505ab9..0000000000
--- a/sysdeps/powerpc/powerpc64/power9/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/power8/fpu
-powerpc/powerpc64/power8
diff --git a/sysdeps/powerpc/powerpc64/power9/fpu/Implies b/sysdeps/powerpc/powerpc64/power9/fpu/Implies
deleted file mode 100644
index fad2505ab9..0000000000
--- a/sysdeps/powerpc/powerpc64/power9/fpu/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/power8/fpu
-powerpc/powerpc64/power8
diff --git a/sysdeps/powerpc/powerpc64/power9/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/power9/fpu/multiarch/Implies
deleted file mode 100644
index f11e1bdba2..0000000000
--- a/sysdeps/powerpc/powerpc64/power9/fpu/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power8/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power9/multiarch/Implies b/sysdeps/powerpc/powerpc64/power9/multiarch/Implies
deleted file mode 100644
index dd6bca4b36..0000000000
--- a/sysdeps/powerpc/powerpc64/power9/multiarch/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/power8/multiarch
diff --git a/sysdeps/powerpc/powerpc64/power9/strcmp.S b/sysdeps/powerpc/powerpc64/power9/strcmp.S
new file mode 100644
index 0000000000..98243a9d51
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power9/strcmp.S
@@ -0,0 +1,268 @@
+/* Optimized strcmp implementation for PowerPC64/POWER9.
+ Copyright (C) 2016-2018 Free Software 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 __LITTLE_ENDIAN__
+#include <sysdep.h>
+
+#ifndef STRCMP
+# define STRCMP strcmp
+#endif
+
+/* Implements the function
+
+ int [r3] strcmp (const char *s1 [r3], const char *s2 [r4])
+
+ The implementation uses unaligned doubleword access for first 32 bytes
+ as in POWER8 patch and uses vectorised loops after that. */
+
+/* TODO: Change this to actual instructions when minimum binutils is upgraded
+ to 2.27. Macros are defined below for these newer instructions in order
+ to maintain compatibility. */
+# define VCTZLSBB(r,v) .long (0x10010602 | ((r)<<(32-11)) | ((v)<<(32-21)))
+
+# define VEXTUBRX(t,a,b) .long (0x1000070d \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+
+# define VCMPNEZB(t,a,b) .long (0x10000507 \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+
+/* Get 16 bytes for unaligned case.
+ reg1: Vector to hold next 16 bytes.
+ reg2: Address to read from.
+ reg3: Permute control vector. */
+# define GET16BYTES(reg1, reg2, reg3) \
+ lvx reg1, 0, reg2; \
+ vperm v8, v2, reg1, reg3; \
+ vcmpequb. v8, v0, v8; \
+ beq cr6, 1f; \
+ vspltisb v9, 0; \
+ b 2f; \
+ .align 4; \
+1: \
+ addi r6, reg2, 16; \
+ lvx v9, 0, r6; \
+2: \
+ vperm reg1, v9, reg1, reg3;
+
+/* TODO: change this to .machine power9 when the minimum required binutils
+ allows it. */
+
+ .machine power7
+ENTRY_TOCLESS (STRCMP, 4)
+ li r0, 0
+
+ /* Check if [s1]+16 or [s2]+16 will cross a 4K page boundary using
+ the code:
+
+ (((size_t) s1) % PAGE_SIZE > (PAGE_SIZE - ITER_SIZE))
+
+ with PAGE_SIZE being 4096 and ITER_SIZE begin 16. */
+
+ rldicl r7, r3, 0, 52
+ rldicl r9, r4, 0, 52
+ cmpldi cr7, r7, 4096-16
+ bgt cr7, L(pagecross_check)
+ cmpldi cr5, r9, 4096-16
+ bgt cr5, L(pagecross_check)
+
+ /* For short strings up to 16 bytes, load both s1 and s2 using
+ unaligned dwords and compare. */
+ ld r8, 0(r3)
+ ld r10, 0(r4)
+ cmpb r12, r8, r0
+ cmpb r11, r8, r10
+ orc. r9, r12, r11
+ bne cr0, L(different_nocmpb)
+
+ ld r8, 8(r3)
+ ld r10, 8(r4)
+ cmpb r12, r8, r0
+ cmpb r11, r8, r10
+ orc. r9, r12, r11
+ bne cr0, L(different_nocmpb)
+
+ addi r7, r3, 16
+ addi r4, r4, 16
+
+L(align):
+ /* Now it has checked for first 16 bytes. */
+ vspltisb v0, 0
+ vspltisb v2, -1
+ lvsr v6, 0, r4 /* Compute mask. */
+ or r5, r4, r7
+ andi. r5, r5, 0xF
+ beq cr0, L(aligned)
+ andi. r5, r7, 0xF
+ beq cr0, L(s1_align)
+ lvsr v10, 0, r7 /* Compute mask. */
+
+ /* Both s1 and s2 are unaligned. */
+ GET16BYTES(v4, r7, v10)
+ GET16BYTES(v5, r4, v6)
+ VCMPNEZB(v7, v5, v4)
+ beq cr6, L(match)
+ b L(different)
+
+ /* Align s1 to qw and adjust s2 address. */
+ .align 4
+L(match):
+ clrldi r6, r7, 60
+ subfic r5, r6, 16
+ add r7, r7, r5
+ add r4, r4, r5
+ andi. r5, r4, 0xF
+ beq cr0, L(aligned)
+ lvsr v6, 0, r4
+ /* There are 2 loops depending on the input alignment.
+ Each loop gets 16 bytes from s1 and s2 and compares.
+ Loop until a mismatch or null occurs. */
+L(s1_align):
+ lvx v4, r7, r0
+ GET16BYTES(v5, r4, v6)
+ VCMPNEZB(v7, v5, v4)
+ addi r7, r7, 16
+ addi r4, r4, 16
+ bne cr6, L(different)
+
+ lvx v4, r7, r0
+ GET16BYTES(v5, r4, v6)
+ VCMPNEZB(v7, v5, v4)
+ addi r7, r7, 16
+ addi r4, r4, 16
+ bne cr6, L(different)
+
+ lvx v4, r7, r0
+ GET16BYTES(v5, r4, v6)
+ VCMPNEZB(v7, v5, v4)
+ addi r7, r7, 16
+ addi r4, r4, 16
+ bne cr6, L(different)
+
+ lvx v4, r7, r0
+ GET16BYTES(v5, r4, v6)
+ VCMPNEZB(v7, v5, v4)
+ addi r7, r7, 16
+ addi r4, r4, 16
+ beq cr6, L(s1_align)
+ b L(different)
+
+ .align 4
+L(aligned):
+ lvx v4, 0, r7
+ lvx v5, 0, r4
+ VCMPNEZB(v7, v5, v4)
+ addi r7, r7, 16
+ addi r4, r4, 16
+ bne cr6, L(different)
+
+ lvx v4, 0, r7
+ lvx v5, 0, r4
+ VCMPNEZB(v7, v5, v4)
+ addi r7, r7, 16
+ addi r4, r4, 16
+ bne cr6, L(different)
+
+ lvx v4, 0, r7
+ lvx v5, 0, r4
+ VCMPNEZB(v7, v5, v4)
+ addi r7, r7, 16
+ addi r4, r4, 16
+ bne cr6, L(different)
+
+ lvx v4, 0, r7
+ lvx v5, 0, r4
+ VCMPNEZB(v7, v5, v4)
+ addi r7, r7, 16
+ addi r4, r4, 16
+ beq cr6, L(aligned)
+
+ /* Calculate and return the difference. */
+L(different):
+ VCTZLSBB(r6, v7)
+ VEXTUBRX(r5, r6, v4)
+ VEXTUBRX(r4, r6, v5)
+ subf r3, r4, r5
+ extsw r3, r3
+ blr
+
+ .align 4
+L(different_nocmpb):
+ neg r3, r9
+ and r9, r9, r3
+ cntlzd r9, r9
+ subfic r9, r9, 63
+ srd r3, r8, r9
+ srd r10, r10, r9
+ rldicl r10, r10, 0, 56
+ rldicl r3, r3, 0, 56
+ subf r3, r10, r3
+ extsw r3, r3
+ blr
+
+ .align 4
+L(pagecross_check):
+ subfic r9, r9, 4096
+ subfic r7, r7, 4096
+ cmpld cr7, r7, r9
+ bge cr7, L(pagecross)
+ mr r7, r9
+
+ /* If unaligned 16 bytes reads across a 4K page boundary, it uses
+ a simple byte a byte comparison until the page alignment for s1
+ is reached. */
+L(pagecross):
+ add r7, r3, r7
+ subf r9, r3, r7
+ mtctr r9
+
+ .align 4
+L(pagecross_loop):
+ /* Loads a byte from s1 and s2, compare if *s1 is equal to *s2
+ and if *s1 is '\0'. */
+ lbz r9, 0(r3)
+ lbz r10, 0(r4)
+ addi r3, r3, 1
+ addi r4, r4, 1
+ cmplw cr7, r9, r10
+ cmpdi cr5, r9, r0
+ bne cr7, L(pagecross_ne)
+ beq cr5, L(pagecross_nullfound)
+ bdnz L(pagecross_loop)
+ b L(align)
+
+ .align 4
+L(pagecross_ne):
+ extsw r3, r9
+ mr r9, r10
+L(pagecross_retdiff):
+ subf r9, r9, r3
+ extsw r3, r9
+ blr
+
+ .align 4
+L(pagecross_nullfound):
+ li r3, 0
+ b L(pagecross_retdiff)
+END (STRCMP)
+libc_hidden_builtin_def (strcmp)
+#else
+#include <sysdeps/powerpc/powerpc64/power8/strcmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power9/strncmp.S b/sysdeps/powerpc/powerpc64/power9/strncmp.S
new file mode 100644
index 0000000000..40be98ff45
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power9/strncmp.S
@@ -0,0 +1,379 @@
+/* Optimized strncmp implementation for PowerPC64/POWER9.
+ Copyright (C) 2016-2018 Free Software 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 __LITTLE_ENDIAN__
+#include <sysdep.h>
+
+/* Implements the function
+
+ int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t [r5] n)
+
+ The implementation uses unaligned doubleword access to avoid specialized
+ code paths depending of data alignment for first 32 bytes and uses
+ vectorised loops after that. */
+
+#ifndef STRNCMP
+# define STRNCMP strncmp
+#endif
+
+/* TODO: Change this to actual instructions when minimum binutils is upgraded
+ to 2.27. Macros are defined below for these newer instructions in order
+ to maintain compatibility. */
+# define VCTZLSBB(r,v) .long (0x10010602 | ((r)<<(32-11)) | ((v)<<(32-21)))
+
+# define VEXTUBRX(t,a,b) .long (0x1000070d \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+
+# define VCMPNEZB(t,a,b) .long (0x10000507 \
+ | ((t)<<(32-11)) \
+ | ((a)<<(32-16)) \
+ | ((b)<<(32-21)) )
+
+/* Get 16 bytes for unaligned case.
+ reg1: Vector to hold next 16 bytes.
+ reg2: Address to read from.
+ reg3: Permute control vector. */
+# define GET16BYTES(reg1, reg2, reg3) \
+ lvx reg1, 0, reg2; \
+ vperm v8, v2, reg1, reg3; \
+ vcmpequb. v8, v0, v8; \
+ beq cr6, 1f; \
+ vspltisb v9, 0; \
+ b 2f; \
+ .align 4; \
+1: \
+ cmplw cr6, r5, r11; \
+ ble cr6, 2f; \
+ addi r6, reg2, 16; \
+ lvx v9, 0, r6; \
+2: \
+ vperm reg1, v9, reg1, reg3;
+
+/* TODO: change this to .machine power9 when minimum binutils
+ is upgraded to 2.27. */
+ .machine power7
+ENTRY_TOCLESS (STRNCMP, 4)
+ /* Check if size is 0. */
+ cmpdi cr0, r5, 0
+ beq cr0, L(ret0)
+ li r0, 0
+
+ /* Check if [s1]+32 or [s2]+32 will cross a 4K page boundary using
+ the code:
+
+ (((size_t) s1) % PAGE_SIZE > (PAGE_SIZE - ITER_SIZE))
+
+ with PAGE_SIZE being 4096 and ITER_SIZE begin 32. */
+ rldicl r8, r3, 0, 52
+ cmpldi cr7, r8, 4096-32
+ bgt cr7, L(pagecross)
+ rldicl r9, r4, 0, 52
+ cmpldi cr7, r9, 4096-32
+ bgt cr7, L(pagecross)
+
+ /* For short strings up to 32 bytes, load both s1 and s2 using
+ unaligned dwords and compare. */
+
+ ld r7, 0(r3)
+ ld r9, 0(r4)
+ li r8, 0
+ cmpb r8, r7, r8
+ cmpb r6, r7, r9
+ orc. r8, r8, r6
+ bne cr0, L(different1)
+
+ /* If the strings compared are equal, but size is less or equal
+ to 8, return 0. */
+ cmpldi cr7, r5, 8
+ li r9, 0
+ ble cr7, L(ret1)
+ addi r5, r5, -8
+
+ ld r7, 8(r3)
+ ld r9, 8(r4)
+ cmpb r8, r7, r8
+ cmpb r6, r7, r9
+ orc. r8, r8, r6
+ bne cr0, L(different1)
+ cmpldi cr7, r5, 8
+ mr r9, r8
+ ble cr7, L(ret1)
+ /* Update pointers and size. */
+ addi r5, r5, -8
+ addi r3, r3, 16
+ addi r4, r4, 16
+
+ ld r7, 0(r3)
+ ld r9, 0(r4)
+ li r8, 0
+ cmpb r8, r7, r8
+ cmpb r6, r7, r9
+ orc. r8, r8, r6
+ bne cr0, L(different1)
+ cmpldi cr7, r5, 8
+ li r9, 0
+ ble cr7, L(ret1)
+ addi r5, r5, -8
+
+ ld r7, 8(r3)
+ ld r9, 8(r4)
+ cmpb r8, r7, r8
+ cmpb r6, r7, r9
+ orc. r8, r8, r6
+ bne cr0, L(different1)
+ cmpldi cr7, r5, 8
+ mr r9, r8
+ ble cr7, L(ret1)
+
+ /* Update pointers and size. */
+ addi r5, r5, -8
+ addi r3, r3, 16
+ addi r4, r4, 16
+L(align):
+ /* Now it has checked for first 32 bytes, align source1 to doubleword
+ and adjust source2 address. */
+ vspltisb v0, 0
+ vspltisb v2, -1
+ or r6, r4, r3
+ andi. r6, r6, 0xF
+ beq cr0, L(aligned)
+ lvsr v6, 0, r4 /* Compute mask. */
+ clrldi r6, r4, 60
+ subfic r11, r6, 16
+ andi. r6, r3, 0xF
+ beq cr0, L(s1_align)
+ /* Both s1 and s2 are unaligned. */
+ GET16BYTES(v5, r4, v6)
+ lvsr v10, 0, r3 /* Compute mask. */
+ clrldi r6, r3, 60
+ subfic r11, r6, 16
+ GET16BYTES(v4, r3, v10)
+ VCMPNEZB(v7, v5, v4)
+ beq cr6, L(match)
+ b L(different)
+
+ /* Align s1 to qw and adjust s2 address. */
+ .align 4
+L(match):
+ cmpldi cr7, r5, 16
+ ble cr7, L(ret0)
+ subf r5, r11, r5
+ add r3, r3, r11
+ add r4, r4, r11
+ andi. r11, r4, 0xF
+ beq cr0, L(aligned)
+ lvsr v6, 0, r4
+ clrldi r6, r4, 60
+ subfic r11, r6, 16
+ /* There are 2 loops depending on the input alignment.
+ Each loop gets 16 bytes from s1 and s2, checks for null
+ and compares them. Loops until a mismatch or null occurs. */
+L(s1_align):
+ lvx v4, 0, r3
+ GET16BYTES(v5, r4, v6)
+ VCMPNEZB(v7, v5, v4)
+ bne cr6, L(different)
+ cmpldi cr7, r5, 16
+ ble cr7, L(ret0)
+ addi r5, r5, -16
+ addi r3, r3, 16
+ addi r4, r4, 16
+
+ lvx v4, 0, r3
+ GET16BYTES(v5, r4, v6)
+ VCMPNEZB(v7, v5, v4)
+ bne cr6, L(different)
+ cmpldi cr7, r5, 16
+ ble cr7, L(ret0)
+ addi r5, r5, -16
+ addi r3, r3, 16
+ addi r4, r4, 16
+
+ lvx v4, 0, r3
+ GET16BYTES(v5, r4, v6)
+ VCMPNEZB(v7, v5, v4)
+ bne cr6, L(different)
+ cmpldi cr7, r5, 16
+ ble cr7, L(ret0)
+ addi r5, r5, -16
+ addi r3, r3, 16
+ addi r4, r4, 16
+
+ lvx v4, 0, r3
+ GET16BYTES(v5, r4, v6)
+ VCMPNEZB(v7, v5, v4)
+ bne cr6, L(different)
+ cmpldi cr7, r5, 16
+ ble cr7, L(ret0)
+ addi r5, r5, -16
+ addi r3, r3, 16
+ addi r4, r4, 16
+ b L(s1_align)
+ .align 4
+L(aligned):
+ lvx v4, 0, r3
+ lvx v5, 0, r4
+ VCMPNEZB(v7, v5, v4)
+ bne cr6, L(different)
+ cmpldi cr7, r5, 16
+ ble cr7, L(ret0)
+ addi r5, r5, -16
+ addi r3, r3, 16
+ addi r4, r4, 16
+
+ lvx v4, 0, r3
+ lvx v5, 0, r4
+ VCMPNEZB(v7, v5, v4)
+ bne cr6, L(different)
+ cmpldi cr7, r5, 16
+ ble cr7, L(ret0)
+ addi r5, r5, -16
+ addi r3, r3, 16
+ addi r4, r4, 16
+
+ lvx v4, 0, r3
+ lvx v5, 0, r4
+ VCMPNEZB(v7, v5, v4)
+ bne cr6, L(different)
+ cmpldi cr7, r5, 16
+ ble cr7, L(ret0)
+ addi r5, r5, -16
+ addi r3, r3, 16
+ addi r4, r4, 16
+
+ lvx v4, 0, r3
+ lvx v5, 0, r4
+ VCMPNEZB(v7, v5, v4)
+ bne cr6, L(different)
+ cmpldi cr7, r5, 16
+ ble cr7, L(ret0)
+ addi r5, r5, -16
+ addi r3, r3, 16
+ addi r4, r4, 16
+ b L(aligned)
+ /* Calculate and return the difference. */
+L(different):
+ VCTZLSBB(r6, v7)
+ cmplw cr7, r5, r6
+ ble cr7, L(ret0)
+ VEXTUBRX(r5, r6, v4)
+ VEXTUBRX(r4, r6, v5)
+ subf r3, r4, r5
+ extsw r3, r3
+ blr
+
+ .align 4
+L(ret0):
+ li r9, 0
+L(ret1):
+ mr r3, r9
+ blr
+
+ /* The code now checks if r8 and r5 are different by issuing a
+ cmpb and shifts the result based on its output:
+
+ leadzero = (__builtin_ffsl (z1) - 1);
+ leadzero = leadzero > (n-1)*8 ? (n-1)*8 : leadzero;
+ r1 = (r1 >> leadzero) & 0xFFUL;
+ r2 = (r2 >> leadzero) & 0xFFUL;
+ return r1 - r2; */
+
+ .align 4
+L(different1):
+ neg r11, r8
+ sldi r5, r5, 3
+ and r8, r11, r8
+ addi r5, r5, -8
+ cntlzd r8, r8
+ subfic r8, r8, 63
+ extsw r8, r8
+ cmpld cr7, r8, r5
+ ble cr7, L(different2)
+ mr r8, r5
+L(different2):
+ extsw r8, r8
+ srd r7, r7, r8
+ srd r9, r9, r8
+ rldicl r3, r7, 0, 56
+ rldicl r9, r9, 0, 56
+ subf r9, r9, 3
+ extsw r9, r9
+ mr r3, r9
+ blr
+
+ /* If unaligned 16 bytes reads across a 4K page boundary, it uses
+ a simple byte a byte comparison until the page alignment for s1
+ is reached. */
+ .align 4
+L(pagecross):
+ lbz r7, 0(r3)
+ lbz r9, 0(r4)
+ subfic r8, r8,4095
+ cmplw cr7, r9, r7
+ bne cr7, L(byte_ne_3)
+ cmpdi cr7, r9, 0
+ beq cr7, L(byte_ne_0)
+ addi r5, r5, -1
+ subf r7, r8, r5
+ subf r9, r7, r5
+ addi r9, r9, 1
+ mtctr r9
+ b L(pagecross_loop1)
+
+ .align 4
+L(pagecross_loop0):
+ beq cr7, L(ret0)
+ lbz r9, 0(r3)
+ lbz r8, 0(r4)
+ addi r5, r5, -1
+ cmplw cr7, r9, r8
+ cmpdi cr5, r9, 0
+ bne cr7, L(byte_ne_2)
+ beq cr5, L(byte_ne_0)
+L(pagecross_loop1):
+ cmpdi cr7, r5, 0
+ addi r3, r3, 1
+ addi r4, r4, 1
+ bdnz L(pagecross_loop0)
+ cmpdi cr7, r7, 0
+ li r9, 0
+ bne+ cr7, L(align)
+ b L(ret1)
+
+ .align 4
+L(byte_ne_0):
+ li r7, 0
+L(byte_ne_1):
+ subf r9, r9, r7
+ extsw r9, r9
+ b L(ret1)
+
+ .align 4
+L(byte_ne_2):
+ extsw r7, r9
+ mr r9, r8
+ b L(byte_ne_1)
+L(byte_ne_3):
+ extsw r7, r7
+ b L(byte_ne_1)
+END(STRNCMP)
+libc_hidden_builtin_def(strncmp)
+#else
+#include <sysdeps/powerpc/powerpc64/power8/strncmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/ppc-mcount.S b/sysdeps/powerpc/powerpc64/ppc-mcount.S
index 51a4db3048..2d3f14d4cd 100644
--- a/sysdeps/powerpc/powerpc64/ppc-mcount.S
+++ b/sysdeps/powerpc/powerpc64/ppc-mcount.S
@@ -1,5 +1,5 @@
/* PowerPC64-specific implementation of profiling support.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,13 +24,15 @@
ENTRY(_mcount)
mflr r4
ld r11, 0(r1)
+ std r4, FRAME_LR_SAVE(r1)
stdu r1,-FRAME_MIN_SIZE(r1)
cfi_adjust_cfa_offset (FRAME_MIN_SIZE)
- std r4, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1)
cfi_offset (lr, FRAME_LR_SAVE)
ld r3, FRAME_LR_SAVE(r11)
bl JUMPTARGET(__mcount_internal)
+#ifndef SHARED
nop
+#endif
ld r0, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1)
mtlr r0
addi r1,r1,FRAME_MIN_SIZE
diff --git a/sysdeps/powerpc/powerpc64/register-dump.h b/sysdeps/powerpc/powerpc64/register-dump.h
index db499d4a04..57a9a02b6d 100644
--- a/sysdeps/powerpc/powerpc64/register-dump.h
+++ b/sysdeps/powerpc/powerpc64/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/setjmp-bug21895.c b/sysdeps/powerpc/powerpc64/setjmp-bug21895.c
new file mode 100644
index 0000000000..945a251d95
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/setjmp-bug21895.c
@@ -0,0 +1,51 @@
+/* Shared object part of test for setjmp interoperability with static
+ dlopen BZ #21895.
+ Copyright (C) 2017-2018 Free Software 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 <string.h>
+#include <setjmp.h>
+
+/* Copy r1 adress to a local variable. */
+#define GET_STACK_POINTER(sp) \
+ ({ \
+ asm volatile ("mr %0, 1\n\t" \
+ : "=r" (sp)); \
+ })
+
+jmp_buf jb;
+void (*bar)(jmp_buf, unsigned long);
+
+void
+lbar (unsigned long sp)
+{
+ bar(jb, sp);
+ for(;;);
+}
+
+void
+foo (void)
+{
+ unsigned long sp;
+ /* Copy r1 (stack pointer) to sp. It will be use later to get
+ TOC area. */
+ GET_STACK_POINTER(sp);
+ setjmp(jb);
+ lbar(sp);
+
+ for(;;);
+}
diff --git a/sysdeps/powerpc/powerpc64/setjmp-common.S b/sysdeps/powerpc/powerpc64/setjmp-common.S
index 83361f537c..ae92bb9b92 100644
--- a/sysdeps/powerpc/powerpc64/setjmp-common.S
+++ b/sysdeps/powerpc/powerpc64/setjmp-common.S
@@ -1,5 +1,5 @@
/* setjmp for PowerPC64.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -232,3 +232,14 @@ L(no_vmx):
blr
#endif
END (__sigsetjmp_symbol)
+
+#if defined SHARED && !IS_IN (rtld) && !defined __NO_VMX__
+/* When called from within libc we need a special version of __sigsetjmp
+ that saves r2 since the call won't go via a plt call stub. See
+ bugz #269. */
+ENTRY (__GI___sigsetjmp)
+ std r2,FRAME_TOC_SAVE(r1) /* Save the callers TOC in the save area. */
+ CALL_MCOUNT 1
+ b JUMPTARGET (GLUE(__sigsetjmp_symbol,_ent))
+END (__GI___sigsetjmp)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/setjmp.S b/sysdeps/powerpc/powerpc64/setjmp.S
index dd0fbf5725..a0f0e768f2 100644
--- a/sysdeps/powerpc/powerpc64/setjmp.S
+++ b/sysdeps/powerpc/powerpc64/setjmp.S
@@ -1,5 +1,5 @@
/* AltiVec (new) version of setjmp for PowerPC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/start.S b/sysdeps/powerpc/powerpc64/start.S
index d35b5ec1b4..bd7189310c 100644
--- a/sysdeps/powerpc/powerpc64/start.S
+++ b/sysdeps/powerpc/powerpc64/start.S
@@ -1,5 +1,5 @@
/* Startup code for programs linked with GNU libc. PowerPC64 version.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -62,7 +62,7 @@ L(start_addresses):
.L01:
.tc L(start_addresses)[TC],L(start_addresses)
.section ".text"
-ENTRY(_start)
+ENTRY (_start)
/* Save the stack pointer, in case we're statically linked under Linux. */
mr r9,r1
/* Set up an initial stack frame, and clear the LR. */
@@ -78,7 +78,7 @@ ENTRY(_start)
/* and continue in libc-start, in glibc. */
b JUMPTARGET(__libc_start_main)
-/* The linker needs this nop to recognize that it's OK to call via a
+/* Older versions of ld need this nop to recognize that it's OK to call via a
TOC adjusting stub. */
nop
diff --git a/sysdeps/powerpc/powerpc64/strchr.S b/sysdeps/powerpc/powerpc64/strchr.S
index 19c695d7e7..f4fbbea103 100644
--- a/sysdeps/powerpc/powerpc64/strchr.S
+++ b/sysdeps/powerpc/powerpc64/strchr.S
@@ -1,5 +1,5 @@
/* Optimized strchr implementation for PowerPC64.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,11 @@
/* char * [r3] strchr (const char *s [r3] , int c [r4] ) */
-ENTRY (strchr)
+#ifndef STRCHR
+# define STRCHR strchr
+#endif
+
+ENTRY_TOCLESS (STRCHR)
CALL_MCOUNT 2
#define rTMP1 r0
@@ -145,7 +149,7 @@ L(foundit):
#endif
add rRTN, rSTR, rCLZB
blr
-END (strchr)
+END (STRCHR)
weak_alias (strchr, index)
libc_hidden_builtin_def (strchr)
diff --git a/sysdeps/powerpc/powerpc64/strcmp.S b/sysdeps/powerpc/powerpc64/strcmp.S
index d4fb5b364a..1862a2e5ce 100644
--- a/sysdeps/powerpc/powerpc64/strcmp.S
+++ b/sysdeps/powerpc/powerpc64/strcmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC64.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,11 @@
/* int [r3] strcmp (const char *s1 [r3], const char *s2 [r4]) */
-EALIGN (strcmp, 4, 0)
+#ifndef STRCMP
+# define STRCMP strcmp
+#endif
+
+ENTRY_TOCLESS (STRCMP, 4)
CALL_MCOUNT 2
#define rTMP2 r0
@@ -172,5 +176,5 @@ L(u3): sub rRTN, rWORD1, rWORD2
L(u4): lbz rWORD1, -1(rSTR1)
sub rRTN, rWORD1, rWORD2
blr
-END (strcmp)
+END (STRCMP)
libc_hidden_builtin_def (strcmp)
diff --git a/sysdeps/powerpc/powerpc64/strcspn.S b/sysdeps/powerpc/powerpc64/strcspn.S
deleted file mode 100644
index 31e619dde0..0000000000
--- a/sysdeps/powerpc/powerpc64/strcspn.S
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Optimized strcspn implementation for PowerPC64.
- Copyright (C) 2014-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>
-
-/* size_t [r3] strcspn (const char [r4] *s, const char [r5] *reject) */
-
-EALIGN (strcspn, 4, 0)
- CALL_MCOUNT 3
-
- /* The idea to speed up the algorithm is to create a lookup table
- for fast check if input character should be considered. For ASCII
- or ISO-8859-X character sets it has 256 positions. */
-
- /* PPC64 ELF ABI stack is aligned to 16 bytes. */
- addi r9,r1,-256
- /* Clear the table with 0 values */
- li r6, 0
- li r8, 4
- mtctr r8
- mr r10, r9
- .align 4
-L(zerohash):
- std r6, 0(r10)
- std r6, 8(r10)
- std r6, 16(r10)
- std r6, 24(r10)
- std r6, 32(r10)
- std r6, 40(r10)
- std r6, 48(r10)
- std r6, 56(r10)
- addi r10, r10, 64
- bdnz L(zerohash)
-
- lbz r10,0(r4)
- cmpdi cr7,r10,0 /* reject[0] == '\0' ? */
- li r8,1
- beq cr7,L(finish_table) /* If reject[0] == '\0' skip */
-
- /* Initialize the table as:
- for (i=0; reject[i]; i++
- table[reject[i]]] = 1 */
- .align 4
-L(init_table):
- stbx r8,r9,r10
- lbzu r10,1(r4)
- cmpdi cr7,r10,0 /* If reject[0] == '\0' finish */
- bne cr7,L(init_table)
-L(finish_table):
- /* set table[0] = 1 */
- li r10,1
- stb r10,0(r9)
- li r10,0
- b L(mainloop)
-
- /* Unrool the loop 4 times and check using the table as:
- i = 0;
- while (1)
- {
- if (table[input[i++]] == 1)
- return i - 1;
- if (table[input[i++]] == 1)
- return i - 1;
- if (table[input[i++]] == 1)
- return i - 1;
- if (table[input[i++]] == 1)
- return i - 1;
- } */
- .align 4
-L(unroll):
- lbz r8,1(r3)
- addi r10,r10,4
- lbzx r8,r9,r8
- cmpwi r7,r8,1
- beq cr7,L(end)
- lbz r8,2(r3)
- addi r3,r3,4
- lbzx r8,r9,r8
- cmpwi cr7,r8,1
- beq cr7,L(end2)
- lbz r8,3(r7)
- lbzx r8,r9,r8
- cmpwi cr7,r8,1
- beq cr7,L(end3)
-L(mainloop):
- lbz r8,0(r3)
- mr r7,r3
- addi r6,r10,1
- addi r4,r10,2
- addi r5,r10,3
- lbzx r8,r9,8
- cmpwi cr7,r8,1
- bne cr7,L(unroll)
- mr r3,r10
- blr
-
- .align 4
-L(end):
- mr r3,r6
- blr
-
- .align 4
-L(end2):
- mr r3,r4
- blr
-
- .align 4
-L(end3):
- mr r3,r5
- blr
-END (strcspn)
-libc_hidden_builtin_def (strcspn)
diff --git a/sysdeps/powerpc/powerpc64/strlen.S b/sysdeps/powerpc/powerpc64/strlen.S
index 3175090d60..4604f9c90f 100644
--- a/sysdeps/powerpc/powerpc64/strlen.S
+++ b/sysdeps/powerpc/powerpc64/strlen.S
@@ -1,5 +1,5 @@
/* Optimized strlen implementation for PowerPC64.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -80,7 +80,11 @@
/* int [r3] strlen (char *s [r3]) */
-ENTRY (strlen)
+#ifndef STRLEN
+# define STRLEN strlen
+#endif
+
+ENTRY_TOCLESS (STRLEN)
CALL_MCOUNT 1
#define rTMP4 r0
@@ -195,5 +199,5 @@ L(done1):
blr
#endif
-END (strlen)
+END (STRLEN)
libc_hidden_builtin_def (strlen)
diff --git a/sysdeps/powerpc/powerpc64/strncmp.S b/sysdeps/powerpc/powerpc64/strncmp.S
index 11b9e4c657..bf535838df 100644
--- a/sysdeps/powerpc/powerpc64/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/strncmp.S
@@ -1,5 +1,5 @@
/* Optimized strcmp implementation for PowerPC64.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,11 @@
/* int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */
-EALIGN (strncmp, 4, 0)
+#ifndef STRNCMP
+# define STRNCMP strncmp
+#endif
+
+ENTRY_TOCLESS (STRNCMP, 4)
CALL_MCOUNT 3
#define rTMP2 r0
@@ -202,5 +206,5 @@ L(u1):
L(u2): lbzu rWORD1, -1(rSTR1)
L(u3): sub rRTN, rWORD1, rWORD2
blr
-END (strncmp)
+END (STRNCMP)
libc_hidden_builtin_def (strncmp)
diff --git a/sysdeps/powerpc/powerpc64/strpbrk.S b/sysdeps/powerpc/powerpc64/strpbrk.S
deleted file mode 100644
index 5e9d1a66aa..0000000000
--- a/sysdeps/powerpc/powerpc64/strpbrk.S
+++ /dev/null
@@ -1,135 +0,0 @@
-/* Optimized strpbrk implementation for PowerPC64.
- Copyright (C) 2014-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>
-
-/* char [r3] *strpbrk(const char [r4] *s, const char [r5] *accept) */
-
-EALIGN (strpbrk, 4, 0)
- CALL_MCOUNT 3
-
- lbz r10,0(r4)
- cmpdi cr7,r10,0 /* accept[0] == '\0' ? */
- beq cr7,L(nullfound)
-
- /* The idea to speed up the algorithm is to create a lookup table
- for fast check if input character should be considered. For ASCII
- or ISO-8859-X character sets it has 256 positions. */
-
- /* PPC64 ELF ABI stack is aligned to 16 bytes. */
- addi r9,r1,-256
- /* Clear the table with 0 values */
- li r6, 0
- li r7, 4
- mtctr r7
- mr r8, r9
- .align 4
-L(zerohash):
- std r6, 0(r8)
- std r6, 8(r8)
- std r6, 16(r8)
- std r6, 24(r8)
- std r6, 32(r8)
- std r6, 40(r8)
- std r6, 48(r8)
- std r6, 56(r8)
- addi r8, r8, 64
- bdnz L(zerohash)
-
- /* Initialize the table as:
- for (i=0; accept[i]; i++
- table[accept[i]]] = 1 */
- li r0,1
- .align 4
-L(init_table):
- stbx r0,r9,r10
- lbzu r10,1(r4)
- cmpdi r0,r10,0
- bne cr0,L(init_table)
-L(finish_table):
- /* set table[0] = 1 */
- li r4,1
- stb r4,0(r9)
- b L(mainloop)
-
- /* Unrool the loop 4 times and check using the table as:
- i = 0;
- while (1)
- {
- if (table[input[i++]] == 1)
- return (s[i -1] ? s + i - 1: NULL);
- if (table[input[i++]] == 1)
- return (s[i -1] ? s + i - 1: NULL);
- if (table[input[i++]] == 1)
- return (s[i -1] ? s + i - 1: NULL);
- if (table[input[i++]] == 1)
- return (s[i -1] ? s + i - 1: NULL);
- } */
- .align 4
-L(unroll):
- lbz r0,1(r3)
- lbzx r8,r9,r0
- cmpwi cr6,r8,1
- beq cr6,L(checkend2)
- lbz r10,2(r3)
- lbzx r4,r9,r10
- cmpwi cr7,r4,1
- beq cr7,L(checkend3)
- lbz r12,3(r3)
- addi r3,r3,4
- lbzx r11,r9,r12
- cmpwi cr0,r11,1
- beq cr0,L(checkend)
-L(mainloop):
- lbz r12,0(r3)
- addi r11,r3,1
- addi r5,r3,2
- addi r7,r3,3
- lbzx r6,r9,r12
- cmpwi cr1,r6,1
- bne cr1,L(unroll)
- cmpdi cr0,r12,0
- beq cr0,L(nullfound)
-L(end):
- blr
-
- .align 4
-L(checkend):
- cmpdi cr1,r12,0
- mr r3,r7
- bne cr1,L(end)
-L(nullfound):
- /* return NULL */
- li 3,0
- blr
-
- .align 4
-L(checkend2):
- cmpdi cr7,r0,0
- mr r3,r11
- beq cr7,L(nullfound)
- blr
-
- .align 4
-L(checkend3):
- cmpdi cr6,r10,0
- mr r3,r5
- beq cr6,L(nullfound)
- blr
-END (strpbrk)
-libc_hidden_builtin_def (strpbrk)
diff --git a/sysdeps/powerpc/powerpc64/strspn.S b/sysdeps/powerpc/powerpc64/strspn.S
deleted file mode 100644
index cf10da1997..0000000000
--- a/sysdeps/powerpc/powerpc64/strspn.S
+++ /dev/null
@@ -1,144 +0,0 @@
-/* Optimized strspn implementation for PowerPC64.
-
- Copyright (C) 2014-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/>. */
-
-/* size_t [r3] strspn (const char *string [r3],
- const char *needleAccept [r4] */
-
-/* Performance gains are grabbed through following techniques:
-
- > hashing of needle.
- > hashing avoids scanning of duplicate entries in needle
- across the string.
- > unrolling when scanning for character in string
- across hash table. */
-
-/* Algorithm is as below:
- 1. A empty hash table/dictionary is created comprising of
- 256 ascii character set
- 2. When hash entry is found in needle , the hash index
- is initialized to 1
- 3. The string is scanned until end and for every character,
- its corresponding hash index is compared.
- 4. initial length of string (count) until first hit of
- accept needle to be found is set to 0
- 4. If hash index is set to 1 for the index of string,
- count is returned.
- 5. Otherwise count is incremented and scanning continues
- until end of string. */
-
-#include <sysdep.h>
-
-EALIGN(strspn, 4, 0)
- CALL_MCOUNT 3
-
- /* PPC64 ELF ABI stack is aligned to 16 bytes. */
- addi r9,r1,-256
- /* Clear the table with 0 values */
- li r6, 0
- li r8, 4
- mtctr r8
- mr r10, r9
- .align 4
-L(zerohash):
- std r6, 0(r10)
- std r6, 8(r10)
- std r6, 16(r10)
- std r6, 24(r10)
- std r6, 32(r10)
- std r6, 40(r10)
- std r6, 48(r10)
- std r6, 56(r10)
- addi r10, r10, 64
- bdnz L(zerohash)
-
- lbz r10,0(r4)
- li r8, 1 /* r8=1, marker into hash if found in
- needle */
- cmpdi cr7, r10, 0 /* accept needle is NULL */
- beq cr7, L(skipHashing) /* if needle is NULL, skip hashing */
-
- .align 4 /* align section to 16 byte boundary */
-L(hashing):
- stbx r8, r9, r10 /* update hash with marker for the pivot of
- the needle */
- lbzu r10, 1(r4) /* load needle into r10 and update to next */
- cmpdi cr7, r10, 0 /* if needle is has reached NULL, continue */
- bne cr7, L(hashing) /* loop to hash the needle */
-
-L(skipHashing):
- li r10, 0 /* load counter = 0 */
- b L(beginScan)
-
- .align 4 /* align section to 16 byte boundary */
-L(scanUnroll):
- lbzx r8, r9, r8 /* load r8 with hash value at index */
- cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found
- accept needle */
- beq cr7, L(ret1stIndex) /* we have hit accept needle, return the
- count */
-
- lbz r8, 1(r3) /* load string[1] into r8 */
- addi r10, r10, 4 /* increment counter */
- lbzx r8, r9, r8 /* load r8 with hash value at index */
- cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found
- accept needle */
- beq cr7, L(ret2ndIndex) /* we have hit accept needle, return the
- count */
-
- lbz r8, 2(r3) /* load string[2] into r8 */
- lbzx r8, r9, r8 /* load r8 with hash value at index */
- cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found
- accept needle */
- beq cr7, L(ret3rdIndex) /* we have hit accept needle, return the
- count */
-
- lbz r8, 3(r3) /* load string[3] into r8 */
- lbzx r8, r9, r8 /* load r8 with hash value at index */
- addi r3, r3, 4 /* unroll factor , increment string by 4 */
- cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found
- accept needle */
- beq cr7,L(ret4thIndex) /* we have hit accept needle, return the
- count */
-
-L(beginScan):
- lbz r8, 0(r3) /* load string[0] into r8 */
- addi r6, r10, 1 /* place holder for counter + 1 */
- addi r5, r10, 2 /* place holder for counter + 2 */
- addi r4, r10, 3 /* place holder for counter + 3 */
- cmpdi cr7, r8, 0 /* if we hit marker in hash, we have found
- accept needle */
- bne cr7, L(scanUnroll) /* continue scanning */
-
-L(ret1stIndex):
- mr r3, r10 /* update r3 for return */
- blr /* return */
-
-L(ret2ndIndex):
- mr r3, r6 /* update r3 for return */
- blr /* return */
-
-L(ret3rdIndex):
- mr r3, r5 /* update r3 for return */
- blr /* return */
-
-L(ret4thIndex):
- mr r3, r4 /* update r3 for return */
- blr /* done */
-END(strspn)
-libc_hidden_builtin_def (strspn)
diff --git a/sysdeps/powerpc/powerpc64/strtok.S b/sysdeps/powerpc/powerpc64/strtok.S
deleted file mode 100644
index 51ce9b291e..0000000000
--- a/sysdeps/powerpc/powerpc64/strtok.S
+++ /dev/null
@@ -1,226 +0,0 @@
-/* Optimized strtok implementation for PowerPC64.
-
- Copyright (C) 2014-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/>. */
-
-/* Performance gains are grabbed through following techniques:
-
- > hashing of needle.
- > hashing avoids scanning of duplicate entries in needle
- across the string.
- > unrolling when scanning for character in string
- across hash table. */
-
-/* Algorithm is as below:
- 1. A empty hash table/dictionary is created comprising of
- 256 ascii character set
- 2. When hash entry is found in needle , the hash index
- is initialized to 1
- 3. The string is scanned until end and for every character,
- its corresponding hash index is compared.
- 4. initial length of string (count) until first hit of
- accept needle is calculated and moved.(strspn)
- 5. The string is again scanned until end and for every character,
- its corresponding hash index is compared.(strpbrk)
- 6. If hash index is set to 1 for the index of string,
- set it to null and set the saveptr to point to the next char.
- 7. Otherwise count is incremented and scanning continues
- until end of string. */
-
-#include <sysdep.h>
-#ifdef USE_AS_STRTOK_R
-# define FUNC_NAME __strtok_r
-#else
-# define FUNC_NAME strtok
-#endif
-
-EALIGN(FUNC_NAME, 4, 0)
-#ifdef USE_AS_STRTOK_R
- CALL_MCOUNT 3
- cmpdi cr7, r3, 0 /* Is input null? */
- bne cr7, L(inputnotNull)
- ld r3, 0(r5) /* Load from r5 */
-#else
- CALL_MCOUNT 2
- addis r5, r2, .LANCHOR0@toc@ha
- cmpdi cr7, r3, 0 /* Is r3 NULL? */
- bne cr7, L(inputnotNull)
- ld r3, .LANCHOR0@toc@l(r5) /* Load from saveptr */
-#endif
-L(inputnotNull):
- mr r7, r3
- cmpdi cr7, r3, 0
- beq cr7, L(returnNULL)
- lbz r8, 0(r3)
- cmpdi cr7, r8, 0
- beq cr7, L(returnNULL)
-
- addi r9, r1, -256 /* r9 is a hash of 256 bytes */
-
- /*Iniatliaze hash table with Zeroes */
- li r6, 0
- li r8, 4
- mtctr r8
- mr r10, r9
- .align 4
-L(zerohash):
- std r6, 0(r10)
- std r6, 8(r10)
- std r6, 16(r10)
- std r6, 24(r10)
- std r6, 32(r10)
- std r6, 40(r10)
- std r6, 48(r10)
- std r6, 56(r10)
- addi r10, r10, 64
- bdnz L(zerohash)
-
-
- lbz r10, 0(r4) /* load r10 with needle (r4) */
- li r8, 1 /* r8=1, marker into hash if found in
- needle */
-
- cmpdi cr7, r10, 0 /* accept needle is NULL */
- beq cr7, L(skipHashing) /* if needle is NULL, skip hashing */
-
- .align 4 /* align section to 16 byte boundary */
-L(hashing):
- stbx r8, r9, r10 /* update hash with marker for the pivot of
- the needle */
- lbzu r10, 1(r4) /* load needle into r10 and update to next */
- cmpdi cr7, r10, 0 /* if needle is has reached NULL, continue */
- bne cr7, L(hashing) /* loop to hash the needle */
-
-L(skipHashing):
- b L(beginScan)
-
- .align 4 /* align section to 16 byte boundary */
-L(scanUnroll):
- lbzx r8, r9, r8 /* load r8 with hash value at index */
- cmpwi cr7, r8, 0 /* check the hash value */
- beq cr7, L(ret1stIndex) /* we have hit accept needle */
-
- lbz r8, 1(r7) /* load string[1] into r8 */
- lbzx r8, r9, r8 /* load r8 with hash value at index */
- cmpwi cr7, r8, 0 /* check the hash value */
- beq cr7, L(ret2ndIndex) /* we have hit accept needle */
-
- lbz r8, 2(r7) /* load string[1] into r8 */
- lbzx r8, r9, r8 /* load r8 with hash value at index */
- cmpwi cr7, r8, 0 /* check the hash value */
- beq cr7, L(ret3rdIndex) /* we have hit accept needle */
-
- lbz r8, 3(r7) /* load string[1] into r8 */
- addi r7, r7, 4
- lbzx r8, r9, r8 /* load r8 with hash value at index */
- cmpwi cr7, r8, 0 /* check the hash value */
- beq cr7,L(ret4thIndex) /* we have hit accept needle */
-
-L(beginScan):
- lbz r8, 0(r7) /* load string[0] into r8 */
- addi r6, r7, 1
- addi r11, r7, 2
- addi r4, r7, 3
- cmpdi cr7, r8, 0 /* check if its null */
- bne cr7, L(scanUnroll) /* continue scanning */
-
-L(ret1stIndex):
- mr r3, r7
- b L(next)
-L(ret2ndIndex):
- mr r3, r6
- b L(next)
-L(ret3rdIndex):
- mr r3, r11
- b L(next)
-L(ret4thIndex):
- mr r3, r4
-L(next):
- mr r7, r3
- lbz r8, 0(r7)
- cmpdi cr7, r8, 0
- beq cr7, L(returnNULL)
- li r8, 1
- li r10, 0 /* load counter = 0 */
- stbx r8, r9, r10 /* update hash for NULL */
- b L(mainloop)
-
-L(unroll):
- lbz r8, 1(r7) /* load string[1] into r8 */
- lbzx r8, r9, r8 /* load r8 with hash value at index */
- cmpwi r7, r8, 1 /* check the hash */
- beq cr7, L(foundat1st) /* we have hit accept needle */
- lbz r8, 2(r7)
- lbzx r8, r9, r8
- cmpwi cr7, r8, 1
- beq cr7, L(foundat2nd)
- lbz r8, 3(r7)
- addi r7, r7, 4
- lbzx r8, r9, r8
- cmpwi cr7, r8, 1
- beq cr7, L(foundat3rd)
-L(mainloop):
- lbz r8, 0(r7)
- addi r6, r7, 1
- addi r11, r7, 2
- addi r4, r7, 3
- lbzx r8, r9, r8
- cmpwi cr7, r8, 1
- bne cr7, L(unroll) /* continue scanning */
-
- b L(found)
-L(foundat1st):
- mr r7, r6
- b L(found)
-L(foundat2nd):
- mr r7, r11
- b L(found)
-L(foundat3rd):
- mr r7, r4
-L(found):
- lbz r8, 0(r7)
- cmpdi cr7, r8, 0
- beq cr7, L(end)
- li r10, 0
- stb r10, 0(r7) /* Terminate string */
- addi r7, r7, 1 /* Store the pointer to the next char */
-L(end):
-#ifdef USE_AS_STRTOK_R
- std r7, 0(r5) /* Update saveptr */
-#else
- std r7, .LANCHOR0@toc@l(r5)
-#endif
- blr /* done */
-L(returnNULL):
-#ifndef USE_AS_STRTOK_R
- li r7, 0
-#endif
- li r3, 0 /* return NULL */
- b L(end)
-END(FUNC_NAME)
-#ifdef USE_AS_STRTOK_R
-libc_hidden_builtin_def (strtok_r)
-#else
- .section ".bss"
- .align 3
- .set .LANCHOR0,. + 0
- .type olds, @object
- .size olds, 8
-olds:
- .zero 8
-libc_hidden_builtin_def (strtok)
-#endif
diff --git a/sysdeps/powerpc/powerpc64/strtok_r.S b/sysdeps/powerpc/powerpc64/strtok_r.S
deleted file mode 100644
index 2df0ce42b3..0000000000
--- a/sysdeps/powerpc/powerpc64/strtok_r.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Optimized strtok_r implementation for PowerPC64.
- Copyright (C) 2014-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 USE_AS_STRTOK_R
-#include <sysdeps/powerpc/powerpc64/strtok.S>
-
-weak_alias (__strtok_r, strtok_r)
-libc_hidden_def (__strtok_r)
-libc_hidden_builtin_def (strtok_r)
diff --git a/sysdeps/powerpc/powerpc64/submul_1.S b/sysdeps/powerpc/powerpc64/submul_1.S
index 0f289377df..7d2dea0281 100644
--- a/sysdeps/powerpc/powerpc64/submul_1.S
+++ b/sysdeps/powerpc/powerpc64/submul_1.S
@@ -1,6 +1,6 @@
/* PowerPC64 __mpn_addmul_1 -- Multiply a limb vector with a limb and subtract
the result to a second limb vector.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h
index 7393944ba6..2df1d9b6e6 100644
--- a/sysdeps/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/powerpc/powerpc64/sysdep.h
@@ -1,5 +1,5 @@
/* Assembly macros for 64-bit PowerPC.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,66 +21,40 @@
#ifdef __ASSEMBLER__
/* Stack frame offsets. */
-#if _CALL_ELF != 2
-#define FRAME_MIN_SIZE 112
-#define FRAME_MIN_SIZE_PARM 112
#define FRAME_BACKCHAIN 0
#define FRAME_CR_SAVE 8
#define FRAME_LR_SAVE 16
+#if _CALL_ELF != 2
+#define FRAME_MIN_SIZE 112
+#define FRAME_MIN_SIZE_PARM 112
#define FRAME_TOC_SAVE 40
#define FRAME_PARM_SAVE 48
-#define FRAME_PARM1_SAVE 48
-#define FRAME_PARM2_SAVE 56
-#define FRAME_PARM3_SAVE 64
-#define FRAME_PARM4_SAVE 72
-#define FRAME_PARM5_SAVE 80
-#define FRAME_PARM6_SAVE 88
-#define FRAME_PARM7_SAVE 96
-#define FRAME_PARM8_SAVE 104
-#define FRAME_PARM9_SAVE 112
#else
#define FRAME_MIN_SIZE 32
#define FRAME_MIN_SIZE_PARM 96
-#define FRAME_BACKCHAIN 0
-#define FRAME_CR_SAVE 8
-#define FRAME_LR_SAVE 16
#define FRAME_TOC_SAVE 24
#define FRAME_PARM_SAVE 32
-#define FRAME_PARM1_SAVE 32
-#define FRAME_PARM2_SAVE 40
-#define FRAME_PARM3_SAVE 48
-#define FRAME_PARM4_SAVE 56
-#define FRAME_PARM5_SAVE 64
-#define FRAME_PARM6_SAVE 72
-#define FRAME_PARM7_SAVE 80
-#define FRAME_PARM8_SAVE 88
-#define FRAME_PARM9_SAVE 96
#endif
/* Support macros for CALL_MCOUNT. */
-#if _CALL_ELF == 2
-#define call_mcount_parm_offset (-64)
-#else
-#define call_mcount_parm_offset FRAME_PARM_SAVE
-#endif
.macro SAVE_ARG NARG
.if \NARG
SAVE_ARG \NARG-1
- std 2+\NARG,call_mcount_parm_offset-8+8*(\NARG)(1)
+ std 2+\NARG,-FRAME_MIN_SIZE_PARM+FRAME_PARM_SAVE-8+8*(\NARG)(1)
.endif
.endm
.macro REST_ARG NARG
.if \NARG
REST_ARG \NARG-1
- ld 2+\NARG,FRAME_MIN_SIZE_PARM+call_mcount_parm_offset-8+8*(\NARG)(1)
+ ld 2+\NARG,FRAME_PARM_SAVE-8+8*(\NARG)(1)
.endif
.endm
.macro CFI_SAVE_ARG NARG
.if \NARG
CFI_SAVE_ARG \NARG-1
- cfi_offset(2+\NARG,call_mcount_parm_offset-8+8*(\NARG))
+ cfi_offset(2+\NARG,-FRAME_MIN_SIZE_PARM+FRAME_PARM_SAVE-8+8*(\NARG))
.endif
.endm
@@ -132,25 +106,25 @@
# define OPD_ENT(name) .quad BODY_LABEL (name), .TOC.@tocbase, 0
#endif
-#define ENTRY_1(name) \
+#define ENTRY_1(name) \
.type BODY_LABEL(name),@function; \
.globl name; \
.section ".opd","aw"; \
- .align 3; \
-name##: OPD_ENT (name); \
- .previous;
+ .p2align 3;FUNC_LABEL(name): \
+ OPD_ENT (name); \
+ .previous
-#define DOT_LABEL(X) X
+#define FUNC_LABEL(X) X
#define BODY_LABEL(X) .LY##X
-#define ENTRY_2(name) \
+#define ENTRY_2(name) \
.type name,@function; \
ENTRY_1(name)
-#define END_2(name) \
+#define END_2(name) \
.size name,.-BODY_LABEL(name); \
- .size BODY_LABEL(name),.-BODY_LABEL(name);
+ .size BODY_LABEL(name),.-BODY_LABEL(name)
#define LOCALENTRY(name)
-#else /* _CALL_ELF */
+#else /* _CALL_ELF == 2 */
/* Macro to prepare for calling via a function pointer. */
.macro PPC64_LOAD_FUNCPTR PTR
@@ -158,48 +132,65 @@ name##: OPD_ENT (name); \
mtctr r12
.endm
-#define DOT_LABEL(X) X
+#define FUNC_LABEL(X) X
#define BODY_LABEL(X) X
-#define ENTRY_2(name) \
+#define ENTRY_2(name) \
.globl name; \
- .type name,@function;
-#define END_2(name) \
- .size name,.-name;
-#define LOCALENTRY(name) \
-1: addis r2,r12,.TOC.-1b@ha; \
- addi r2,r2,.TOC.-1b@l; \
- .localentry name,.-name;
+ .type name,@function
+#define END_2(name) \
+ .size name,.-name
+#define LOCALENTRY(name) \
+1: addis r2,r12,.TOC.-1b@ha; \
+ addi r2,r2,.TOC.-1b@l; \
+ .localentry name,.-name
#endif /* _CALL_ELF */
-#define ENTRY(name) \
- .section ".text"; \
- ENTRY_2(name) \
- .align ALIGNARG(2); \
-BODY_LABEL(name): \
- cfi_startproc; \
- LOCALENTRY(name)
+ .macro NOPS NARG
+ .if \NARG
+ NOPS \NARG-1
+ nop
+ .endif
+ .endm
+
+ .macro ENTRY_3 name, alignp2=2, nopwords=0
+ .text
+ ENTRY_2(\name)
+ .p2align \alignp2
+ NOPS \nopwords
+BODY_LABEL(\name):
+ .endm
-#define EALIGN_W_0 /* No words to insert. */
-#define EALIGN_W_1 nop
-#define EALIGN_W_2 nop;nop
-#define EALIGN_W_3 nop;nop;nop
-#define EALIGN_W_4 EALIGN_W_3;nop
-#define EALIGN_W_5 EALIGN_W_4;nop
-#define EALIGN_W_6 EALIGN_W_5;nop
-#define EALIGN_W_7 EALIGN_W_6;nop
-
-/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
- past a 2^alignt boundary. */
-#define EALIGN(name, alignt, words) \
- .section ".text"; \
- ENTRY_2(name) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
-BODY_LABEL(name): \
+/* Use ENTRY_TOCLESS for functions that make no use of r2 and
+ guarantee r2 is unchanged on exit. Any function that has @toc or
+ @got relocs uses r2. Functions that call other functions via the
+ PLT use r2. Use ENTRY for functions that may use or change r2.
+ The first argument is the function name.
+ The optional second argument specifies alignment of the function's
+ code, as the logarithm base two of the byte alignment. For
+ example, a value of four aligns to a sixteen byte boundary.
+ The optional third argument specifies the number of NOPs to emit
+ before the start of the function's code. */
+#ifndef PROF
+#define ENTRY_TOCLESS(name, ...) \
+ ENTRY_3 name, ## __VA_ARGS__; \
+ cfi_startproc
+
+#define ENTRY(name, ...) \
+ ENTRY_TOCLESS(name, ## __VA_ARGS__); \
+ LOCALENTRY(name)
+#else
+/* The call to _mcount is potentially via the plt, so profiling code
+ is never free of an r2 use. */
+#define ENTRY_TOCLESS(name, ...) \
+ ENTRY_3 name, ## __VA_ARGS__; \
cfi_startproc; \
LOCALENTRY(name)
+#define ENTRY(name, ...) \
+ ENTRY_TOCLESS(name, ## __VA_ARGS__)
+#endif
+
/* Local labels stripped out by the linker. */
#undef L
#define L(x) .L##x
@@ -246,7 +237,7 @@ LT_LABEL(name): ; \
LT_LABELSUFFIX(name,_name_start): ;\
.ascii stringify(name) ; \
LT_LABELSUFFIX(name,_name_end): ; \
- .align 2 ;
+ .p2align 2
#define TRACEBACK_MASK(name,mask) \
LT_LABEL(name): ; \
@@ -257,23 +248,23 @@ LT_LABEL(name): ; \
LT_LABELSUFFIX(name,_name_start): ;\
.ascii stringify(name) ; \
LT_LABELSUFFIX(name,_name_end): ; \
- .align 2 ;
+ .p2align 2
/* END generates Traceback tables */
#undef END
#define END(name) \
cfi_endproc; \
- TRACEBACK(name) \
+ TRACEBACK(name); \
END_2(name)
/* This form supports more informative traceback tables */
#define END_GEN_TB(name,mask) \
cfi_endproc; \
- TRACEBACK_MASK(name,mask) \
+ TRACEBACK_MASK(name,mask); \
END_2(name)
-#if !IS_IN(rtld) && defined (ENABLE_LOCK_ELISION)
-# define ABORT_TRANSACTION \
+#if !IS_IN(rtld)
+# define ABORT_TRANSACTION_IMPL \
cmpdi 13,0; \
beq 1f; \
lwz 0,TM_CAPABLE(13); \
@@ -281,11 +272,12 @@ LT_LABELSUFFIX(name,_name_end): ; \
beq 1f; \
li 11,_ABORT_SYSCALL; \
tabort. 11; \
- .align 4; \
+ .p2align 4; \
1:
#else
-# define ABORT_TRANSACTION
+# define ABORT_TRANSACTION_IMPL
#endif
+#define ABORT_TRANSACTION ABORT_TRANSACTION_IMPL
#define DO_CALL(syscall) \
ABORT_TRANSACTION \
@@ -294,12 +286,12 @@ LT_LABELSUFFIX(name,_name_end): ; \
/* ppc64 is always PIC */
#undef JUMPTARGET
-#define JUMPTARGET(name) DOT_LABEL(name)
+#define JUMPTARGET(name) FUNC_LABEL(name)
#define PSEUDO(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- DO_CALL (SYS_ify (syscall_name));
+ .section ".text"; \
+ ENTRY (name); \
+ DO_CALL (SYS_ify (syscall_name))
#ifdef SHARED
#define TAIL_CALL_SYSCALL_ERROR \
@@ -340,9 +332,9 @@ LT_LABELSUFFIX(name,_name_end): ; \
END (name)
#define PSEUDO_NOERRNO(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- DO_CALL (SYS_ify (syscall_name));
+ .section ".text"; \
+ ENTRY (name); \
+ DO_CALL (SYS_ify (syscall_name))
#define PSEUDO_RET_NOERRNO \
blr
@@ -354,9 +346,9 @@ LT_LABELSUFFIX(name,_name_end): ; \
END (name)
#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- DO_CALL (SYS_ify (syscall_name));
+ .section ".text"; \
+ ENTRY (name); \
+ DO_CALL (SYS_ify (syscall_name))
#define PSEUDO_RET_ERRVAL \
blr
@@ -372,53 +364,53 @@ LT_LABELSUFFIX(name,_name_end): ; \
#if _CALL_ELF != 2
#define PPC64_LOAD_FUNCPTR(ptr) \
- "ld 12,0(" #ptr ");\n" \
- "ld 2,8(" #ptr ");\n" \
- "mtctr 12;\n" \
- "ld 11,16(" #ptr ");"
+ "ld 12,0(" #ptr ")\n" \
+ "ld 2,8(" #ptr ")\n" \
+ "mtctr 12\n" \
+ "ld 11,16(" #ptr ")"
#ifdef USE_PPC64_OVERLAPPING_OPD
-# define OPD_ENT(name) ".quad " BODY_PREFIX #name ", .TOC.@tocbase;"
+# define OPD_ENT(name) ".quad " BODY_PREFIX #name ", .TOC.@tocbase"
#else
-# define OPD_ENT(name) ".quad " BODY_PREFIX #name ", .TOC.@tocbase, 0;"
+# define OPD_ENT(name) ".quad " BODY_PREFIX #name ", .TOC.@tocbase, 0"
#endif
#define ENTRY_1(name) \
- ".type " BODY_PREFIX #name ",@function;\n" \
- ".globl " #name ";\n" \
- ".pushsection \".opd\",\"aw\";\n" \
- ".align 3;\n" \
+ ".type " BODY_PREFIX #name ",@function\n" \
+ ".globl " #name "\n" \
+ ".pushsection \".opd\",\"aw\"\n" \
+ ".p2align 3\n" \
#name ":\n" \
OPD_ENT (name) "\n" \
- ".popsection;"
+ ".popsection"
#define DOT_PREFIX ""
#define BODY_PREFIX ".LY"
#define ENTRY_2(name) \
- ".type " #name ",@function;\n" \
+ ".type " #name ",@function\n" \
ENTRY_1(name)
#define END_2(name) \
- ".size " #name ",.-" BODY_PREFIX #name ";\n" \
- ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";"
+ ".size " #name ",.-" BODY_PREFIX #name "\n" \
+ ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name
#define LOCALENTRY(name)
#else /* _CALL_ELF */
#define PPC64_LOAD_FUNCPTR(ptr) \
- "mr 12," #ptr ";\n" \
- "mtctr 12;"
+ "mr 12," #ptr "\n" \
+ "mtctr 12"
#define DOT_PREFIX ""
#define BODY_PREFIX ""
#define ENTRY_2(name) \
- ".type " #name ",@function;\n" \
- ".globl " #name ";"
+ ".type " #name ",@function\n" \
+ ".globl " #name
#define END_2(name) \
- ".size " #name ",.-" #name ";"
+ ".size " #name ",.-" #name
#define LOCALENTRY(name) \
- "1: addis 2,12,.TOC.-1b@ha;\n" \
- "addi 2,2,.TOC.-1b@l;\n" \
- ".localentry " #name ",.-" #name ";"
+ "1: addis 2,12,.TOC.-1b@ha\n" \
+ "addi 2,2,.TOC.-1b@l\n" \
+ ".localentry " #name ",.-" #name
#endif /* _CALL_ELF */
diff --git a/sysdeps/powerpc/powerpc64/tls-macros.h b/sysdeps/powerpc/powerpc64/tls-macros.h
index 42a95ec5c1..79a0b2579c 100644
--- a/sysdeps/powerpc/powerpc64/tls-macros.h
+++ b/sysdeps/powerpc/powerpc64/tls-macros.h
@@ -18,13 +18,11 @@
__result; \
})
-#define __TLS_GET_ADDR "__tls_get_addr"
-
/* PowerPC64 Local Dynamic TLS access. */
#define TLS_LD(x) \
({ int * __result; \
asm ("addi 3,2," #x "@got@tlsld\n\t" \
- "bl " __TLS_GET_ADDR "\n\t" \
+ "bl __tls_get_addr\n\t" \
"nop \n\t" \
"addis %0,3," #x "@dtprel@ha\n\t" \
"addi %0,%0," #x "@dtprel@l" \
@@ -36,7 +34,7 @@
#define TLS_GD(x) \
({ register int *__result __asm__ ("r3"); \
asm ("addi 3,2," #x "@got@tlsgd\n\t" \
- "bl " __TLS_GET_ADDR "\n\t" \
+ "bl __tls_get_addr\n\t" \
"nop " \
: "=r" (__result) : \
: __TLS_CALL_CLOBBERS); \
diff --git a/sysdeps/powerpc/powerpc64/tst-audit.h b/sysdeps/powerpc/powerpc64/tst-audit.h
index f856682e71..1d8ea6fd76 100644
--- a/sysdeps/powerpc/powerpc64/tst-audit.h
+++ b/sysdeps/powerpc/powerpc64/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. PowerPC64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/powerpc64/tst-setjmp-bug21895-static.c b/sysdeps/powerpc/powerpc64/tst-setjmp-bug21895-static.c
new file mode 100644
index 0000000000..31ee88cd62
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/tst-setjmp-bug21895-static.c
@@ -0,0 +1,75 @@
+/* Test setjmp interoperability with static dlopen BZ #21895.
+ Copyright (C) 2017-2018 Free Software 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 <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+
+/* Set TOC area pointed by sp to zero. */
+#define SET_TOC_TO_ZERO(sp) \
+ ({ \
+ unsigned int zero = 0; \
+ asm volatile ("std %0, 24(%1)\n\t" :: "r" (zero), "r" (sp)); \
+ })
+
+static void
+bar (jmp_buf jb, unsigned long sp)
+{
+ static int i;
+ if (i++==1)
+ exit(0); /* Success. */
+
+ /* This will set TOC are on caller frame (foo) to zero. __longjmp
+ must restore r2 otherwise a segmentation fault will happens after
+ it jumps back to foo. */
+ SET_TOC_TO_ZERO(sp);
+ longjmp(jb, i);
+}
+
+static int
+do_test (void)
+{
+ void *h = dlopen("setjmp-bug21895.so", RTLD_NOW);
+ if (!h)
+ {
+ puts(dlerror());
+ return 1;
+ }
+
+ void (*pfoo)(void) = dlsym(h, "foo");
+ if (!pfoo)
+ {
+ puts(dlerror());
+ return 1;
+ }
+
+ void (**ppbar)(jmp_buf, unsigned long) = dlsym(h, "bar");
+ if (!ppbar)
+ {
+ puts(dlerror());
+ return 1;
+ }
+
+ *ppbar = bar;
+ pfoo();
+
+ for(;;);
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure
index 0c6fdde7aa..e3ad6ec57f 100644
--- a/sysdeps/powerpc/preconfigure
+++ b/sysdeps/powerpc/preconfigure
@@ -1,8 +1,11 @@
# preconfigure fragment for powerpc.
case "$machine" in
+powerpc64le)
+ base_machine=powerpc machine=powerpc/powerpc64/le
+ ;;
powerpc64*)
- base_machine=powerpc machine=powerpc/powerpc64
+ base_machine=powerpc machine=powerpc/powerpc64/be
;;
powerpc*)
# Check for e500.
@@ -13,5 +16,6 @@ powerpc*)
base_machine=powerpc machine=powerpc/powerpc32
fi
rm -f conftest.i
+ with_fp_cond="!defined __NO_FPRS__"
;;
esac
diff --git a/sysdeps/powerpc/sched_cpucount.c b/sysdeps/powerpc/sched_cpucount.c
index 0e19fb190a..d0fc97bb33 100644
--- a/sysdeps/powerpc/sched_cpucount.c
+++ b/sysdeps/powerpc/sched_cpucount.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/sigjmp.c b/sysdeps/powerpc/sigjmp.c
index 1c5d68659e..a6e821eef4 100644
--- a/sysdeps/powerpc/sigjmp.c
+++ b/sysdeps/powerpc/sigjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/sotruss-lib.c b/sysdeps/powerpc/sotruss-lib.c
index 524e7fd3a8..fcfcc12b00 100644
--- a/sysdeps/powerpc/sotruss-lib.c
+++ b/sysdeps/powerpc/sotruss-lib.c
@@ -1,5 +1,5 @@
/* PowerPC specific sotruss-lib functions.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/stackinfo.h b/sysdeps/powerpc/stackinfo.h
index 72501cef9c..19d51df27f 100644
--- a/sysdeps/powerpc/stackinfo.h
+++ b/sysdeps/powerpc/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/strcat.c b/sysdeps/powerpc/strcat.c
deleted file mode 100644
index 35b2841704..0000000000
--- a/sysdeps/powerpc/strcat.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* strcat version that uses fast strcpy/strlen.
- 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 <string.h>
-
-#ifndef STRCAT
-# undef strcat
-# define STRCAT strcat
-#endif
-
-/* Append SRC on the end of DEST. */
-char *
-STRCAT(char *dest, const char *src)
-{
- strcpy (dest + strlen (dest), src);
- return dest;
-}
-libc_hidden_builtin_def (STRCAT)
diff --git a/sysdeps/powerpc/sys/platform/ppc.h b/sysdeps/powerpc/sys/platform/ppc.h
index 4d8a41165b..24947a06e3 100644
--- a/sysdeps/powerpc/sys/platform/ppc.h
+++ b/sysdeps/powerpc/sys/platform/ppc.h
@@ -1,5 +1,5 @@
/* Facilities specific to the PowerPC architecture
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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/powerpc/sysdep.h b/sysdeps/powerpc/sysdep.h
index 800623af37..8a6d236caa 100644
--- a/sysdeps/powerpc/sysdep.h
+++ b/sysdeps/powerpc/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,10 +21,8 @@
*/
#define _SYSDEPS_SYSDEP_H 1
#include <bits/hwcap.h>
-#ifdef ENABLE_LOCK_ELISION
#include <tls.h>
#include <htm.h>
-#endif
#define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC)
@@ -176,7 +174,7 @@
we abort transaction just before syscalls.
[1] Documentation/powerpc/transactional_memory.txt [Syscalls] */
-#if !IS_IN(rtld) && defined (ENABLE_LOCK_ELISION)
+#if !IS_IN(rtld) && !defined(__SPE__)
# define ABORT_TRANSACTION \
({ \
if (THREAD_GET_TM_CAPABLE ()) \
diff --git a/sysdeps/powerpc/test-arith.c b/sysdeps/powerpc/test-arith.c
index 97253c2578..f70b495037 100644
--- a/sysdeps/powerpc/test-arith.c
+++ b/sysdeps/powerpc/test-arith.c
@@ -1,5 +1,5 @@
/* Test floating-point arithmetic operations.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/test-get_hwcap-static.c b/sysdeps/powerpc/test-get_hwcap-static.c
index ed7e6f284d..d7d8afb788 100644
--- a/sysdeps/powerpc/test-get_hwcap-static.c
+++ b/sysdeps/powerpc/test-get_hwcap-static.c
@@ -1,5 +1,5 @@
/* Check __ppc_get_hwcap() and __ppc_get_at_plaftorm() functionality.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/test-get_hwcap.c b/sysdeps/powerpc/test-get_hwcap.c
index 14fe73b177..0f06f14753 100644
--- a/sysdeps/powerpc/test-get_hwcap.c
+++ b/sysdeps/powerpc/test-get_hwcap.c
@@ -1,5 +1,5 @@
/* Check __ppc_get_hwcap() and __ppc_get_at_plaftorm() functionality.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,9 @@
#include <stdint.h>
#include <pthread.h>
+#include <support/check.h>
+#include <support/xthread.h>
+
#include <sys/auxv.h>
#include <dl-procinfo.h>
@@ -148,7 +151,6 @@ do_test (void)
pthread_attr_t attr;
pthread_attr_init (&attr);
pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_JOINABLE);
- void *status;
long i = 0;
@@ -160,22 +162,10 @@ do_test (void)
/* Check for other thread. */
i++;
- if (pthread_create (&threads[i], &attr, t1, (void *)i))
- {
- printf ("FAIL: error creating thread %ld.\n", i);
- return 1;
- }
+ threads[i] = xpthread_create (&attr, t1, (void *)i);
pthread_attr_destroy (&attr);
- if (pthread_join (threads[i], &status))
- {
- printf ("FAIL: error joining thread %ld.\n", i);
- return 1;
- }
- if (status)
- {
- return 1;
- }
+ TEST_VERIFY_EXIT (xpthread_join (threads[i]) == NULL);
printf("PASS: HWCAP, HWCAP2 and AT_PLATFORM are correctly set in the TCB for"
" all threads.\n");
@@ -184,5 +174,4 @@ do_test (void)
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
diff --git a/sysdeps/powerpc/test-gettimebase.c b/sysdeps/powerpc/test-gettimebase.c
index d6e13242af..a55949763a 100644
--- a/sysdeps/powerpc/test-gettimebase.c
+++ b/sysdeps/powerpc/test-gettimebase.c
@@ -1,5 +1,5 @@
/* Check __ppc_get_timebase() for architecture changes
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -43,5 +43,4 @@ do_test (void)
return 1;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
diff --git a/sysdeps/powerpc/tst-set_ppr.c b/sysdeps/powerpc/tst-set_ppr.c
new file mode 100644
index 0000000000..c4f8096bf8
--- /dev/null
+++ b/sysdeps/powerpc/tst-set_ppr.c
@@ -0,0 +1,102 @@
+/* Test the implementation of __ppc_set_ppr_* functions.
+ Copyright (C) 2017-2018 Free Software 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 <inttypes.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <sys/auxv.h>
+
+#include <sys/platform/ppc.h>
+
+#include <support/test-driver.h>
+
+#ifdef __powerpc64__
+ typedef uint64_t ppr_t;
+# define MFPPR "mfppr"
+ /* The thread priority value is obtained from bits 11:13. */
+# define EXTRACT_THREAD_PRIORITY(x) ((x >> 50) & 7)
+#else
+ typedef uint32_t ppr_t;
+# define MFPPR "mfppr32"
+ /* For 32-bit, the upper 32 bits of the Program Priority Register (PPR)
+ are used, so the thread priority value is obtained from bits 43:46. */
+# define EXTRACT_THREAD_PRIORITY(x) ((x >> 18) & 7)
+#endif /* !__powerpc64__ */
+
+/* Read the thread priority value set in the PPR. */
+static __inline__ ppr_t
+get_thread_priority (void)
+{
+ /* Read the PPR. */
+ ppr_t ppr;
+ asm volatile (MFPPR" %0" : "=r"(ppr));
+ /* Return the thread priority value. */
+ return EXTRACT_THREAD_PRIORITY (ppr);
+}
+
+/* Check the thread priority bits of PPR are set as expected. */
+uint8_t
+check_thread_priority (uint8_t expected)
+{
+ ppr_t actual = get_thread_priority ();
+
+ if (actual != expected)
+ {
+ printf ("FAIL: Expected %"PRIu8" got %"PRIuMAX".\n", expected,
+ (uintmax_t) actual);
+ return 1;
+ }
+ printf ("PASS: Thread priority set to %"PRIu8" correctly.\n", expected);
+ return 0;
+}
+
+/* The Power ISA 2.06 allows the following thread priorities for any
+ problem state program: low (2), medium low (3), and medium (4).
+ Power ISA 2.07b added very low (1).
+ Check whether the values set by __ppc_set_ppr_* are correct. */
+static int
+do_test (void)
+{
+ /* Check for the minimum required Power ISA to run these tests. */
+ if ((getauxval (AT_HWCAP) & PPC_FEATURE_ARCH_2_06) == 0)
+ {
+ printf ("Requires an environment that implements the Power ISA version"
+ " 2.06 or greater.\n");
+ return EXIT_UNSUPPORTED;
+ }
+
+ uint8_t rc = 0;
+
+#ifdef _ARCH_PWR8
+ __ppc_set_ppr_very_low ();
+ rc |= check_thread_priority (1);
+#endif /* _ARCH_PWR8 */
+
+ __ppc_set_ppr_low ();
+ rc |= check_thread_priority (2);
+
+ __ppc_set_ppr_med_low ();
+ rc |= check_thread_priority (3);
+
+ __ppc_set_ppr_med ();
+ rc |= check_thread_priority (4);
+
+ return rc;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/powerpc/tst-stack-align.h b/sysdeps/powerpc/tst-stack-align.h
index 4bfccab6d5..7fd7013b69 100644
--- a/sysdeps/powerpc/tst-stack-align.h
+++ b/sysdeps/powerpc/tst-stack-align.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/powerpc/tst-tlsifunc-static.c b/sysdeps/powerpc/tst-tlsifunc-static.c
new file mode 100644
index 0000000000..7cc566b0d3
--- /dev/null
+++ b/sysdeps/powerpc/tst-tlsifunc-static.c
@@ -0,0 +1,19 @@
+/* Test if an executable can read from the TLS from an STT_GNU_IFUNC resolver.
+ Copyright (C) 2017-2018 Free Software 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-tlsifunc.c"
diff --git a/sysdeps/powerpc/tst-tlsifunc.c b/sysdeps/powerpc/tst-tlsifunc.c
new file mode 100644
index 0000000000..75cfb3e656
--- /dev/null
+++ b/sysdeps/powerpc/tst-tlsifunc.c
@@ -0,0 +1,129 @@
+/* Test if an executable can read from the TLS from an STT_GNU_IFUNC resolver.
+ Copyright (C) 2017-2018 Free Software 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 <stdint.h>
+#include <inttypes.h>
+#include <libc-symbols.h>
+#include <tls-macros.h>
+
+__thread int bar;
+static int *bar_ptr = NULL;
+
+static uint32_t resolver_platform = 0;
+
+int foo (void);
+
+int tcb_test (void);
+
+/* Offsets copied from tcb-offsets.h. */
+#ifdef __powerpc64__
+# define __TPREG "r13"
+# define __ATPLATOFF -28764
+#else
+# define __TPREG "r2"
+# define __ATPLATOFF -28724
+#endif
+
+uint32_t
+get_platform (void)
+{
+ register unsigned long tp __asm__ (__TPREG);
+ uint32_t tmp;
+
+ __asm__ ("lwz %0,%1(%2)\n"
+ : "=r" (tmp)
+ : "i" (__ATPLATOFF), "b" (tp));
+
+ return tmp;
+}
+
+void
+init_foo (void)
+{
+ bar_ptr = TLS_GD (bar);
+}
+
+int
+my_foo (void)
+{
+ printf ("&bar = %p and bar_ptr = %p.\n", &bar, bar_ptr);
+ return bar_ptr != NULL;
+}
+
+__ifunc (foo, foo, my_foo, void, init_foo);
+
+void
+init_tcb_test (void)
+{
+ resolver_platform = get_platform ();
+}
+
+int
+my_tcb_test (void)
+{
+ printf ("resolver_platform = 0x%"PRIx32
+ " and current platform = 0x%"PRIx32".\n",
+ resolver_platform, get_platform ());
+ return resolver_platform != 0;
+}
+
+__ifunc (tcb_test, tcb_test, my_tcb_test, void, init_tcb_test);
+
+static int
+do_test (void)
+{
+ int ret = 0;
+
+ if (foo ())
+ printf ("PASS: foo IFUNC resolver called once.\n");
+ else
+ {
+ printf ("FAIL: foo IFUNC resolver not called once.\n");
+ ret = 1;
+ }
+
+ if (&bar == bar_ptr)
+ printf ("PASS: bar address read from IFUNC resolver is correct.\n");
+ else
+ {
+ printf ("FAIL: bar address read from IFUNC resolver is incorrect.\n");
+ ret = 1;
+ }
+
+ if (tcb_test ())
+ printf ("PASS: tcb_test IFUNC resolver called once.\n");
+ else
+ {
+ printf ("FAIL: tcb_test IFUNC resolver not called once.\n");
+ ret = 1;
+ }
+
+ if (resolver_platform == get_platform ())
+ printf ("PASS: platform read from IFUNC resolver is correct.\n");
+ else
+ {
+ printf ("FAIL: platform read from IFUNC resolver is incorrect.\n");
+ ret = 1;
+ }
+
+ return ret;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/powerpc/tst-tlsopt-powerpc.c b/sysdeps/powerpc/tst-tlsopt-powerpc.c
index c9a14cbfdc..cc682b2ed0 100644
--- a/sysdeps/powerpc/tst-tlsopt-powerpc.c
+++ b/sysdeps/powerpc/tst-tlsopt-powerpc.c
@@ -1,52 +1,11 @@
/* glibc test for __tls_get_addr optimization. */
-#include <stdio.h>
-#include "../../elf/tls-macros.h"
-#include "dl-tls.h"
-
-/* common 'int' variable in TLS. */
-COMMON_INT_DEF(foo);
-
-
-#define TEST_FUNCTION do_test ()
static int
do_test (void)
{
- int result = 0;
-
- /* Get variable using general dynamic model. */
- int *ap = TLS_GD (foo);
- if (*ap != 0)
- {
- printf ("foo = %d\n", *ap);
- result = 1;
- }
-
- tls_index *tls_arg;
-#ifdef __powerpc64__
- register unsigned long thread_pointer __asm__ ("r13");
- asm ("addi %0,2,foo@got@tlsgd" : "=r" (tls_arg));
-#else
- register unsigned long thread_pointer __asm__ ("r2");
- asm ("bcl 20,31,1f\n1:\t"
- "mflr %0\n\t"
- "addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t"
- "addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t"
- "addi %0,%0,foo@got@tlsgd" : "=b" (tls_arg));
-#endif
-
- if (tls_arg->ti_module != 0)
- {
- printf ("tls_index not optimized, binutils too old?\n");
- result = 1;
- }
- else if (tls_arg->ti_offset + thread_pointer != (unsigned long) ap)
- {
- printf ("tls_index->ti_offset wrong value\n");
- result = 1;
- }
+ extern int tls_get_addr_opt_test (void);
- return result;
+ return tls_get_addr_opt_test ();
}
-#include "../../test-skeleton.c"
+#include <support/test-driver.c>
diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile
index 332a461bf1..ea4f889489 100644
--- a/sysdeps/pthread/Makefile
+++ b/sysdeps/pthread/Makefile
@@ -1,5 +1,5 @@
# sysdeps makefile fragment for all pthread-supporting configurations.
-# Copyright (C) 2014-2016 Free Software Foundation, Inc.
+# Copyright (C) 2014-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/pthread/aio_cancel.c b/sysdeps/pthread/aio_cancel.c
index 448a312157..dc259a6e48 100644
--- a/sysdeps/pthread/aio_cancel.c
+++ b/sysdeps/pthread/aio_cancel.c
@@ -1,5 +1,5 @@
/* Cancel requests associated with given file descriptor.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/pthread/aio_error.c b/sysdeps/pthread/aio_error.c
index 88545b0e0d..ca01a1ee10 100644
--- a/sysdeps/pthread/aio_error.c
+++ b/sysdeps/pthread/aio_error.c
@@ -1,5 +1,5 @@
/* Return error status of asynchronous I/O request.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/pthread/aio_fsync.c b/sysdeps/pthread/aio_fsync.c
index 20516cfc8b..8238b26192 100644
--- a/sysdeps/pthread/aio_fsync.c
+++ b/sysdeps/pthread/aio_fsync.c
@@ -1,5 +1,5 @@
/* Synchronize I/O in given file descriptor.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/pthread/aio_misc.c b/sysdeps/pthread/aio_misc.c
index f55570d23b..fb13d6210b 100644
--- a/sysdeps/pthread/aio_misc.c
+++ b/sysdeps/pthread/aio_misc.c
@@ -1,5 +1,5 @@
/* Handle general operations.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -159,7 +159,6 @@ get_elem (void)
void
-internal_function
__aio_free_request (struct requestlist *elem)
{
elem->running = no;
@@ -169,7 +168,6 @@ __aio_free_request (struct requestlist *elem)
struct requestlist *
-internal_function
__aio_find_req (aiocb_union *elem)
{
struct requestlist *runp = requests;
@@ -192,7 +190,6 @@ __aio_find_req (aiocb_union *elem)
struct requestlist *
-internal_function
__aio_find_req_fd (int fildes)
{
struct requestlist *runp = requests;
@@ -206,7 +203,6 @@ __aio_find_req_fd (int fildes)
void
-internal_function
__aio_remove_request (struct requestlist *last, struct requestlist *req,
int all)
{
@@ -299,7 +295,6 @@ weak_alias (__aio_init, aio_init)
/* The main function of the async I/O handling. It enqueues requests
and if necessary starts and handles threads. */
struct requestlist *
-internal_function
__aio_enqueue_request (aiocb_union *aiocbp, int operation)
{
int result = 0;
@@ -350,10 +345,6 @@ __aio_enqueue_request (aiocb_union *aiocbp, int operation)
return NULL;
}
newp->aiocbp = aiocbp;
-#ifdef BROKEN_THREAD_SIGNALS
- newp->caller_pid = (aiocbp->aiocb.aio_sigevent.sigev_notify == SIGEV_SIGNAL
- ? getpid () : 0);
-#endif
newp->waiting = NULL;
aiocbp->aiocb.__abs_prio = prio;
diff --git a/sysdeps/pthread/aio_misc.h b/sysdeps/pthread/aio_misc.h
index e042998717..45fc9994ce 100644
--- a/sysdeps/pthread/aio_misc.h
+++ b/sysdeps/pthread/aio_misc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -54,11 +54,6 @@ struct waitlist
volatile unsigned int *counterp;
/* The next field is used in asynchronous `lio_listio' operations. */
struct sigevent *sigevp;
-#ifdef BROKEN_THREAD_SIGNALS
- /* XXX See requestlist, it's used to work around the broken signal
- handling in Linux. */
- pid_t caller_pid;
-#endif
};
@@ -86,12 +81,6 @@ struct requestlist
/* Pointer to the actual data. */
aiocb_union *aiocbp;
-#ifdef BROKEN_THREAD_SIGNALS
- /* PID of the initiator thread.
- XXX This is only necessary for the broken signal handling on Linux. */
- pid_t caller_pid;
-#endif
-
/* List of waiting processes. */
struct waitlist *waiting;
};
@@ -104,40 +93,30 @@ extern pthread_mutex_t __aio_requests_mutex attribute_hidden;
/* Enqueue request. */
extern struct requestlist *__aio_enqueue_request (aiocb_union *aiocbp,
int operation)
- attribute_hidden internal_function;
+ attribute_hidden;
/* Find request entry for given AIO control block. */
-extern struct requestlist *__aio_find_req (aiocb_union *elem)
- attribute_hidden internal_function;
+extern struct requestlist *__aio_find_req (aiocb_union *elem) attribute_hidden;
/* Find request entry for given file descriptor. */
-extern struct requestlist *__aio_find_req_fd (int fildes)
- attribute_hidden internal_function;
+extern struct requestlist *__aio_find_req_fd (int fildes) attribute_hidden;
/* Remove request from the list. */
extern void __aio_remove_request (struct requestlist *last,
struct requestlist *req, int all)
- attribute_hidden internal_function;
+ attribute_hidden;
/* Release the entry for the request. */
-extern void __aio_free_request (struct requestlist *req)
- attribute_hidden internal_function;
+extern void __aio_free_request (struct requestlist *req) attribute_hidden;
/* Notify initiator of request and tell this everybody listening. */
-extern void __aio_notify (struct requestlist *req)
- attribute_hidden internal_function;
+extern void __aio_notify (struct requestlist *req) attribute_hidden;
/* Notify initiator of request. */
-#ifdef BROKEN_THREAD_SIGNALS
-extern int __aio_notify_only (struct sigevent *sigev, pid_t caller_pid)
- attribute_hidden internal_function;
-#else
-extern int __aio_notify_only (struct sigevent *sigev)
- attribute_hidden internal_function;
-#endif
+extern int __aio_notify_only (struct sigevent *sigev) attribute_hidden;
/* Send the signal. */
extern int __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
- attribute_hidden internal_function;
+ attribute_hidden;
#endif /* aio_misc.h */
diff --git a/sysdeps/pthread/aio_notify.c b/sysdeps/pthread/aio_notify.c
index 75f3229667..394083172a 100644
--- a/sysdeps/pthread/aio_notify.c
+++ b/sysdeps/pthread/aio_notify.c
@@ -1,5 +1,5 @@
/* Notify initiator of AIO request.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -48,12 +48,7 @@ notify_func_wrapper (void *arg)
int
-internal_function
-#ifdef BROKEN_THREAD_SIGNALS
-__aio_notify_only (struct sigevent *sigev, pid_t caller_pid)
-#else
__aio_notify_only (struct sigevent *sigev)
-#endif
{
int result = 0;
@@ -99,15 +94,9 @@ __aio_notify_only (struct sigevent *sigev)
#if _POSIX_REALTIME_SIGNALS > 0
/* Note that the standard gives us the option of using a plain
non-queuing signal here when SA_SIGINFO is not set for the signal. */
-# ifdef BROKEN_THREAD_SIGNALS
- if (__aio_sigqueue (sigev->sigev_signo, sigev->sigev_value, caller_pid)
- < 0)
- result = -1;
-# else
if (__aio_sigqueue (sigev->sigev_signo, sigev->sigev_value, getpid ())
< 0)
result = -1;
-# endif
#else
/* There are no queued signals on this system at all. */
result = raise (sigev->sigev_signo);
@@ -119,17 +108,12 @@ __aio_notify_only (struct sigevent *sigev)
void
-internal_function
__aio_notify (struct requestlist *req)
{
struct waitlist *waitlist;
struct aiocb *aiocbp = &req->aiocbp->aiocb;
-#ifdef BROKEN_THREAD_SIGNALS
- if (__aio_notify_only (&aiocbp->aio_sigevent, req->caller_pid) != 0)
-#else
if (__aio_notify_only (&aiocbp->aio_sigevent) != 0)
-#endif
{
/* XXX What shall we do if already an error is set by
read/write/fsync? */
@@ -162,11 +146,7 @@ __aio_notify (struct requestlist *req)
this request is the last one, send the signal. */
if (--*waitlist->counterp == 0)
{
-#ifdef BROKEN_THREAD_SIGNALS
- __aio_notify_only (waitlist->sigevp, waitlist->caller_pid);
-#else
__aio_notify_only (waitlist->sigevp);
-#endif
/* This is tricky. See lio_listio.c for the reason why
this works. */
free ((void *) waitlist->counterp);
diff --git a/sysdeps/pthread/aio_read.c b/sysdeps/pthread/aio_read.c
index 79bec53d8f..6c4dc42dee 100644
--- a/sysdeps/pthread/aio_read.c
+++ b/sysdeps/pthread/aio_read.c
@@ -1,5 +1,5 @@
/* Asynchronous read.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/pthread/aio_read64.c b/sysdeps/pthread/aio_read64.c
index b778056b4e..ad680104f2 100644
--- a/sysdeps/pthread/aio_read64.c
+++ b/sysdeps/pthread/aio_read64.c
@@ -1,5 +1,5 @@
/* Asynchronous read, 64bit offset version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/pthread/aio_suspend.c b/sysdeps/pthread/aio_suspend.c
index ba9fb65c42..010cbf84df 100644
--- a/sysdeps/pthread/aio_suspend.c
+++ b/sysdeps/pthread/aio_suspend.c
@@ -1,5 +1,5 @@
/* Suspend until termination of a requests.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -145,9 +145,6 @@ aio_suspend (const struct aiocb *const list[], int nent,
waitlist[cnt].next = requestlist[cnt]->waiting;
waitlist[cnt].counterp = &cntr;
waitlist[cnt].sigevp = NULL;
-#ifdef BROKEN_THREAD_SIGNALS
- waitlist[cnt].caller_pid = 0; /* Not needed. */
-#endif
requestlist[cnt]->waiting = &waitlist[cnt];
any = true;
}
diff --git a/sysdeps/pthread/aio_write.c b/sysdeps/pthread/aio_write.c
index 8dfc3013e9..c6b09e3b14 100644
--- a/sysdeps/pthread/aio_write.c
+++ b/sysdeps/pthread/aio_write.c
@@ -1,5 +1,5 @@
/* Asynchronous write.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/pthread/aio_write64.c b/sysdeps/pthread/aio_write64.c
index ef14c45982..94084c787f 100644
--- a/sysdeps/pthread/aio_write64.c
+++ b/sysdeps/pthread/aio_write64.c
@@ -1,5 +1,5 @@
/* Asynchronous write, 64bit offset version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/pthread/allocalim.h b/sysdeps/pthread/allocalim.h
index 076889463b..99f74838dd 100644
--- a/sysdeps/pthread/allocalim.h
+++ b/sysdeps/pthread/allocalim.h
@@ -1,5 +1,5 @@
/* Determine whether block of given size can be allocated on the stack or not.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,9 @@ extern __always_inline
int
__libc_use_alloca (size_t size)
{
- return (__builtin_expect (size <= PTHREAD_STACK_MIN / 4, 1)
- || __builtin_expect (__libc_alloca_cutoff (size), 1));
+ return (__glibc_likely (__libc_alloca_cutoff (size))
+#ifdef PTHREAD_STACK_MIN
+ || __glibc_likely (size <= PTHREAD_STACK_MIN / 4)
+#endif
+ );
}
diff --git a/sysdeps/pthread/bits/sigthread.h b/sysdeps/pthread/bits/sigthread.h
index 32ef1a974a..b1fb6150e4 100644
--- a/sysdeps/pthread/bits/sigthread.h
+++ b/sysdeps/pthread/bits/sigthread.h
@@ -1,5 +1,5 @@
/* Signal handling function for threaded programs.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,10 +20,11 @@
#define _BITS_SIGTHREAD_H 1
#if !defined _SIGNAL_H && !defined _PTHREAD_H
-# error "Never include this file directly. Use <pthread.h> instead"
+# error "Never include this file directly. Use <signal.h> instead"
#endif
/* Functions for handling signals. */
+#include <bits/types/__sigset_t.h>
/* Modify the signal mask for the calling thread. The arguments have
the same meaning as for sigprocmask(2). */
diff --git a/sysdeps/pthread/bits/types/sigevent_t.h b/sysdeps/pthread/bits/types/sigevent_t.h
new file mode 100644
index 0000000000..f242f14615
--- /dev/null
+++ b/sysdeps/pthread/bits/types/sigevent_t.h
@@ -0,0 +1,18 @@
+#ifndef __sigevent_t_defined
+#define __sigevent_t_defined 1
+
+#include <bits/types.h>
+#include <bits/types/__sigval_t.h>
+#include <bits/pthreadtypes.h>
+
+/* Structure to transport application-defined values with signals. */
+typedef struct sigevent
+ {
+ __sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ void (*sigev_notify_function) (__sigval_t); /* Function to start. */
+ pthread_attr_t *sigev_notify_attributes; /* Really pthread_attr_t.*/
+ } sigevent_t;
+
+#endif
diff --git a/sysdeps/pthread/flockfile.c b/sysdeps/pthread/flockfile.c
index 4972da4453..4dc3f75035 100644
--- a/sysdeps/pthread/flockfile.c
+++ b/sysdeps/pthread/flockfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -18,13 +18,13 @@
#include <pthread.h>
#include <stdio.h>
-#include <libio.h>
#include <stdio-lock.h>
void
__flockfile (FILE *stream)
{
+ stream->_flags2 |= _IO_FLAGS2_NEED_LOCK;
_IO_lock_lock (*stream->_lock);
}
strong_alias (__flockfile, _IO_flockfile)
diff --git a/sysdeps/pthread/ftrylockfile.c b/sysdeps/pthread/ftrylockfile.c
index c899fcc6bf..3fff61f3c6 100644
--- a/sysdeps/pthread/ftrylockfile.c
+++ b/sysdeps/pthread/ftrylockfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/pthread/funlockfile.c b/sysdeps/pthread/funlockfile.c
index 866266af2b..27afe8c131 100644
--- a/sysdeps/pthread/funlockfile.c
+++ b/sysdeps/pthread/funlockfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -18,7 +18,6 @@
#include <pthread.h>
#include <stdio.h>
-#include <libio.h>
#include <stdio-lock.h>
diff --git a/sysdeps/pthread/lio_listio.c b/sysdeps/pthread/lio_listio.c
index da83889c8e..ebf3c21fba 100644
--- a/sysdeps/pthread/lio_listio.c
+++ b/sysdeps/pthread/lio_listio.c
@@ -1,5 +1,5 @@
/* Enqueue and list of read or write requests.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -107,14 +107,7 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
pthread_mutex_unlock (&__aio_requests_mutex);
if (LIO_MODE (mode) == LIO_NOWAIT)
- {
-#ifdef BROKEN_THREAD_SIGNALS
- __aio_notify_only (sig,
- sig->sigev_notify == SIGEV_SIGNAL ? getpid () : 0);
-#else
__aio_notify_only (sig);
-#endif
- }
return result;
}
@@ -140,9 +133,6 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
waitlist[cnt].next = requests[cnt]->waiting;
waitlist[cnt].counterp = &total;
waitlist[cnt].sigevp = NULL;
-#ifdef BROKEN_THREAD_SIGNALS
- waitlist[cnt].caller_pid = 0; /* Not needed. */
-#endif
requests[cnt]->waiting = &waitlist[cnt];
++total;
}
@@ -190,9 +180,6 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
}
else
{
-#ifdef BROKEN_THREAD_SIGNALS
- pid_t caller_pid = sig->sigev_notify == SIGEV_SIGNAL ? getpid () : 0;
-#endif
total = 0;
for (cnt = 0; cnt < nent; ++cnt)
@@ -209,9 +196,6 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
waitlist->list[cnt].next = requests[cnt]->waiting;
waitlist->list[cnt].counterp = &waitlist->counter;
waitlist->list[cnt].sigevp = &waitlist->sigev;
-#ifdef BROKEN_THREAD_SIGNALS
- waitlist->list[cnt].caller_pid = caller_pid;
-#endif
requests[cnt]->waiting = &waitlist->list[cnt];
++total;
}
diff --git a/sysdeps/pthread/lio_listio64.c b/sysdeps/pthread/lio_listio64.c
index b5558517d1..09f098aceb 100644
--- a/sysdeps/pthread/lio_listio64.c
+++ b/sysdeps/pthread/lio_listio64.c
@@ -1,5 +1,5 @@
/* Enqueue and list of read or write requests, 64bit offset version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/pthread/posix-timer.h b/sysdeps/pthread/posix-timer.h
index 0782a0715e..d7af9a017a 100644
--- a/sysdeps/pthread/posix-timer.h
+++ b/sysdeps/pthread/posix-timer.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX timer implementation on top of NPTL.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@@ -87,7 +87,7 @@ extern struct thread_node __timer_signal_thread_rclk;
/* Return pointer to timer structure corresponding to ID. */
#define timer_id2ptr(timerid) ((struct timer_node *) timerid)
-#define timer_ptr2id(timerid) ((void *) timerid)
+#define timer_ptr2id(timerid) ((timer_t) timerid)
/* Check whether timer is valid; global mutex must be held. */
static inline int
diff --git a/sysdeps/pthread/semaphore.h b/sysdeps/pthread/semaphore.h
index 9927db7667..ff672ebd24 100644
--- a/sysdeps/pthread/semaphore.h
+++ b/sysdeps/pthread/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,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/pthread/timer_create.c b/sysdeps/pthread/timer_create.c
index 887d38971a..2381a60d6f 100644
--- a/sysdeps/pthread/timer_create.c
+++ b/sysdeps/pthread/timer_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@@ -77,7 +77,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
{
newtimer->event.sigev_notify = SIGEV_SIGNAL;
newtimer->event.sigev_signo = SIGALRM;
- newtimer->event.sigev_value.sival_ptr = timer_ptr2id (newtimer);
+ newtimer->event.sigev_value.sival_ptr = newtimer;
newtimer->event.sigev_notify_function = 0;
}
diff --git a/sysdeps/pthread/timer_delete.c b/sysdeps/pthread/timer_delete.c
index f8f335a07b..0daab37624 100644
--- a/sysdeps/pthread/timer_delete.c
+++ b/sysdeps/pthread/timer_delete.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
diff --git a/sysdeps/pthread/timer_getoverr.c b/sysdeps/pthread/timer_getoverr.c
index 07c2cc503a..edd519964d 100644
--- a/sysdeps/pthread/timer_getoverr.c
+++ b/sysdeps/pthread/timer_getoverr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
diff --git a/sysdeps/pthread/timer_gettime.c b/sysdeps/pthread/timer_gettime.c
index c93e3358a7..f5f060afec 100644
--- a/sysdeps/pthread/timer_gettime.c
+++ b/sysdeps/pthread/timer_gettime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@@ -50,7 +50,7 @@ timer_gettime (timer_t timerid, struct itimerspec *value)
{
if (armed)
{
- clock_gettime (clock, &now);
+ __clock_gettime (clock, &now);
if (timespec_compare (&now, &expiry) < 0)
timespec_sub (&value->it_value, &expiry, &now);
else
diff --git a/sysdeps/pthread/timer_routines.c b/sysdeps/pthread/timer_routines.c
index 7aa4437a61..c12246792b 100644
--- a/sysdeps/pthread/timer_routines.c
+++ b/sysdeps/pthread/timer_routines.c
@@ -1,5 +1,5 @@
/* Helper code for POSIX timer implementation on NPTL.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@@ -29,8 +29,11 @@
#include <sys/syscall.h>
#include "posix-timer.h"
-#include <nptl/pthreadP.h>
+#include <timer_routines.h>
+#ifndef DELAYTIMER_MAX
+# define DELAYTIMER_MAX INT_MAX
+#endif
/* Number of threads used. */
#define THREAD_MAXNODES 16
@@ -373,7 +376,7 @@ thread_func (void *arg)
/* This assumes that the elements of the list of one thread
are all for the same clock. */
- clock_gettime (timer->clock, &now);
+ __clock_gettime (timer->clock, &now);
while (1)
{
@@ -460,10 +463,14 @@ int
__timer_thread_start (struct thread_node *thread)
{
int retval = 1;
+ sigset_t set, oset;
assert (!thread->exists);
thread->exists = 1;
+ sigfillset (&set);
+ pthread_sigmask (SIG_SETMASK, &set, &oset);
+
if (pthread_create (&thread->id, &thread->attr,
(void *(*) (void *)) thread_func, thread) != 0)
{
@@ -471,6 +478,8 @@ __timer_thread_start (struct thread_node *thread)
retval = -1;
}
+ pthread_sigmask (SIG_SETMASK, &oset, NULL);
+
return retval;
}
@@ -482,31 +491,6 @@ __timer_thread_wakeup (struct thread_node *thread)
}
-/* Compare two pthread_attr_t thread attributes for exact equality.
- Returns 1 if they are equal, otherwise zero if they are not equal
- or contain illegal values. This version is NPTL-specific for
- performance reason. One could use the access functions to get the
- values of all the fields of the attribute structure. */
-static int
-thread_attr_compare (const pthread_attr_t *left, const pthread_attr_t *right)
-{
- struct pthread_attr *ileft = (struct pthread_attr *) left;
- struct pthread_attr *iright = (struct pthread_attr *) right;
-
- return (ileft->flags == iright->flags
- && ileft->schedpolicy == iright->schedpolicy
- && (ileft->schedparam.sched_priority
- == iright->schedparam.sched_priority)
- && ileft->guardsize == iright->guardsize
- && ileft->stackaddr == iright->stackaddr
- && ileft->stacksize == iright->stacksize
- && ((ileft->cpuset == NULL && iright->cpuset == NULL)
- || (ileft->cpuset != NULL && iright->cpuset != NULL
- && ileft->cpusetsize == iright->cpusetsize
- && memcmp (ileft->cpuset, iright->cpuset,
- ileft->cpusetsize) == 0)));
-}
-
/* Search the list of active threads and find one which has matching
attributes. Global mutex lock must be held by caller. */
diff --git a/sysdeps/pthread/timer_settime.c b/sysdeps/pthread/timer_settime.c
index 4de6bd9efb..8a71a506f8 100644
--- a/sysdeps/pthread/timer_settime.c
+++ b/sysdeps/pthread/timer_settime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@@ -55,7 +55,7 @@ timer_settime (timer_t timerid, int flags, const struct itimerspec *value,
if ((flags & TIMER_ABSTIME) == 0)
{
- clock_gettime (timer->clock, &now);
+ __clock_gettime (timer->clock, &now);
have_now = 1;
}
@@ -80,7 +80,7 @@ timer_settime (timer_t timerid, int flags, const struct itimerspec *value,
if (! have_now)
{
pthread_mutex_unlock (&__timer_mutex);
- clock_gettime (timer->clock, &now);
+ __clock_gettime (timer->clock, &now);
have_now = 1;
pthread_mutex_lock (&__timer_mutex);
timer_addref (timer);
diff --git a/sysdeps/pthread/tst-timer.c b/sysdeps/pthread/tst-timer.c
index d3c9762899..7a943afb7c 100644
--- a/sysdeps/pthread/tst-timer.c
+++ b/sysdeps/pthread/tst-timer.c
@@ -1,5 +1,5 @@
/* Tests for POSIX timer implementation.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@@ -23,6 +23,7 @@
#include <time.h>
#include <unistd.h>
#include <stdlib.h>
+#include <stdint.h>
static void
diff --git a/sysdeps/riscv/Implies b/sysdeps/riscv/Implies
new file mode 100644
index 0000000000..c88325b8be
--- /dev/null
+++ b/sysdeps/riscv/Implies
@@ -0,0 +1,5 @@
+init_array
+
+ieee754/ldbl-128
+ieee754/dbl-64
+ieee754/flt-32
diff --git a/sysdeps/riscv/Makefile b/sysdeps/riscv/Makefile
new file mode 100644
index 0000000000..20a9968106
--- /dev/null
+++ b/sysdeps/riscv/Makefile
@@ -0,0 +1,7 @@
+ifeq ($(subdir),misc)
+sysdep_headers += sys/asm.h
+endif
+
+# RISC-V's assembler also needs to know about PIC as it changes the definition
+# of some assembler macros.
+ASFLAGS-.os += $(pic-ccflag)
diff --git a/sysdeps/riscv/__longjmp.S b/sysdeps/riscv/__longjmp.S
new file mode 100644
index 0000000000..0b9e5e10e2
--- /dev/null
+++ b/sysdeps/riscv/__longjmp.S
@@ -0,0 +1,57 @@
+/* longjmp, RISC-V version.
+ Copyright (C) 1996-2018 Free Software 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>
+#include <sys/asm.h>
+
+ENTRY (__longjmp)
+ REG_L ra, 0*SZREG(a0)
+ REG_L s0, 1*SZREG(a0)
+ REG_L s1, 2*SZREG(a0)
+ REG_L s2, 3*SZREG(a0)
+ REG_L s3, 4*SZREG(a0)
+ REG_L s4, 5*SZREG(a0)
+ REG_L s5, 6*SZREG(a0)
+ REG_L s6, 7*SZREG(a0)
+ REG_L s7, 8*SZREG(a0)
+ REG_L s8, 9*SZREG(a0)
+ REG_L s9, 10*SZREG(a0)
+ REG_L s10,11*SZREG(a0)
+ REG_L s11,12*SZREG(a0)
+ REG_L sp, 13*SZREG(a0)
+
+#ifndef __riscv_float_abi_soft
+ FREG_L fs0, 14*SZREG+ 0*SZFREG(a0)
+ FREG_L fs1, 14*SZREG+ 1*SZFREG(a0)
+ FREG_L fs2, 14*SZREG+ 2*SZFREG(a0)
+ FREG_L fs3, 14*SZREG+ 3*SZFREG(a0)
+ FREG_L fs4, 14*SZREG+ 4*SZFREG(a0)
+ FREG_L fs5, 14*SZREG+ 5*SZFREG(a0)
+ FREG_L fs6, 14*SZREG+ 6*SZFREG(a0)
+ FREG_L fs7, 14*SZREG+ 7*SZFREG(a0)
+ FREG_L fs8, 14*SZREG+ 8*SZFREG(a0)
+ FREG_L fs9, 14*SZREG+ 9*SZFREG(a0)
+ FREG_L fs10,14*SZREG+10*SZFREG(a0)
+ FREG_L fs11,14*SZREG+11*SZFREG(a0)
+#endif
+
+ seqz a0, a1
+ add a0, a0, a1 # a0 = (a1 == 0) ? 1 : a1
+ ret
+
+END (__longjmp)
diff --git a/sysdeps/riscv/bits/endian.h b/sysdeps/riscv/bits/endian.h
new file mode 100644
index 0000000000..4aaf559d4f
--- /dev/null
+++ b/sysdeps/riscv/bits/endian.h
@@ -0,0 +1,5 @@
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/sysdeps/riscv/bits/fenv.h b/sysdeps/riscv/bits/fenv.h
new file mode 100644
index 0000000000..e23b7e253d
--- /dev/null
+++ b/sysdeps/riscv/bits/fenv.h
@@ -0,0 +1,74 @@
+/* Floating point environment, RISC-V version.
+ Copyright (C) 1998-2018 Free Software 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 _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+enum
+ {
+ FE_INEXACT =
+#define FE_INEXACT (0x01)
+ FE_INEXACT,
+ FE_UNDERFLOW =
+#define FE_UNDERFLOW (0x02)
+ FE_UNDERFLOW,
+ FE_OVERFLOW =
+#define FE_OVERFLOW (0x04)
+ FE_OVERFLOW,
+ FE_DIVBYZERO =
+#define FE_DIVBYZERO (0x08)
+ FE_DIVBYZERO,
+ FE_INVALID =
+#define FE_INVALID (0x10)
+ FE_INVALID
+ };
+
+#define FE_ALL_EXCEPT \
+ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+enum
+ {
+ FE_TONEAREST =
+#define FE_TONEAREST (0x0)
+ FE_TONEAREST,
+ FE_TOWARDZERO =
+#define FE_TOWARDZERO (0x1)
+ FE_TOWARDZERO,
+ FE_DOWNWARD =
+#define FE_DOWNWARD (0x2)
+ FE_DOWNWARD,
+ FE_UPWARD =
+#define FE_UPWARD (0x3)
+ FE_UPWARD
+ };
+
+
+typedef unsigned int fexcept_t;
+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/riscv/bits/link.h b/sysdeps/riscv/bits/link.h
new file mode 100644
index 0000000000..cedc4ad9b2
--- /dev/null
+++ b/sysdeps/riscv/bits/link.h
@@ -0,0 +1,56 @@
+/* Machine-specific declarations for dynamic linker interface. RISC-V version.
+ Copyright (C) 2005-2018 Free Software 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 _LINK_H
+# error "Never include <bits/link.h> directly; use <link.h> instead."
+#endif
+
+typedef struct La_riscv_regs
+{
+ unsigned long int lr_reg[8]; /* a0 - a7 */
+ double lr_fpreg[8]; /* fa0 - fa7 */
+ unsigned long int lr_ra;
+ unsigned long int lr_sp;
+} La_riscv_regs;
+
+/* Return values for calls from PLT on RISC-V. */
+typedef struct La_riscv_retval
+{
+ unsigned long int lrv_a0;
+ unsigned long int lrv_a1;
+ double lrv_fa0;
+ double lrv_fa1;
+} La_riscv_retval;
+
+__BEGIN_DECLS
+
+extern ElfW(Addr) la_riscv_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx,
+ uintptr_t *__refcook,
+ uintptr_t *__defcook,
+ La_riscv_regs *__regs,
+ unsigned int *__flags,
+ const char *__symname,
+ long int *__framesizep);
+extern unsigned int la_riscv_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx,
+ uintptr_t *__refcook,
+ uintptr_t *__defcook,
+ const La_riscv_regs *__inregs,
+ La_riscv_retval *__outregs,
+ const char *__symname);
+
+__END_DECLS
diff --git a/sysdeps/riscv/bits/setjmp.h b/sysdeps/riscv/bits/setjmp.h
new file mode 100644
index 0000000000..988ad6b1d6
--- /dev/null
+++ b/sysdeps/riscv/bits/setjmp.h
@@ -0,0 +1,39 @@
+/* Define the machine-dependent type `jmp_buf'. RISC-V version.
+ Copyright (C) 2011-2018 Free Software 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 _RISCV_BITS_SETJMP_H
+#define _RISCV_BITS_SETJMP_H
+
+typedef struct __jmp_buf_internal_tag
+ {
+ /* Program counter. */
+ long int __pc;
+ /* Callee-saved registers. */
+ long int __regs[12];
+ /* Stack pointer. */
+ long int __sp;
+
+ /* Callee-saved floating point registers. */
+#if defined __riscv_float_abi_double
+ double __fpregs[12];
+#elif !defined __riscv_float_abi_soft
+# error unsupported FLEN
+#endif
+ } __jmp_buf[1];
+
+#endif /* _RISCV_BITS_SETJMP_H */
diff --git a/sysdeps/riscv/bits/wordsize.h b/sysdeps/riscv/bits/wordsize.h
new file mode 100644
index 0000000000..67a16ba622
--- /dev/null
+++ b/sysdeps/riscv/bits/wordsize.h
@@ -0,0 +1,29 @@
+/* Determine the wordsize from the preprocessor defines. RISC-V version.
+ Copyright (C) 2002-2018 Free Software 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/>. */
+
+#if __riscv_xlen == (__SIZEOF_POINTER__ * 8)
+# define __WORDSIZE __riscv_xlen
+#else
+# error unsupported ABI
+#endif
+
+#if __riscv_xlen == 64
+# define __WORDSIZE_TIME64_COMPAT32 1
+#else
+# error "rv32i-based targets are not supported"
+#endif
diff --git a/sysdeps/riscv/bsd-_setjmp.c b/sysdeps/riscv/bsd-_setjmp.c
new file mode 100644
index 0000000000..0d413101ce
--- /dev/null
+++ b/sysdeps/riscv/bsd-_setjmp.c
@@ -0,0 +1 @@
+/* _setjmp is implemented in setjmp.S */
diff --git a/sysdeps/riscv/bsd-setjmp.c b/sysdeps/riscv/bsd-setjmp.c
new file mode 100644
index 0000000000..ee7c5e3437
--- /dev/null
+++ b/sysdeps/riscv/bsd-setjmp.c
@@ -0,0 +1 @@
+/* setjmp is implemented in setjmp.S */
diff --git a/sysdeps/riscv/configure b/sysdeps/riscv/configure
new file mode 100644
index 0000000000..53f5f1b5f1
--- /dev/null
+++ b/sysdeps/riscv/configure
@@ -0,0 +1,4 @@
+# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/riscv/elf.
+
+$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
diff --git a/sysdeps/riscv/configure.ac b/sysdeps/riscv/configure.ac
new file mode 100644
index 0000000000..34f62d4b4b
--- /dev/null
+++ b/sysdeps/riscv/configure.ac
@@ -0,0 +1,4 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/riscv/elf.
+
+AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/sysdeps/riscv/dl-machine.h b/sysdeps/riscv/dl-machine.h
new file mode 100644
index 0000000000..4cbde333ac
--- /dev/null
+++ b/sysdeps/riscv/dl-machine.h
@@ -0,0 +1,323 @@
+/* Machine-dependent ELF dynamic relocation inline functions. RISC-V version.
+ Copyright (C) 2011-2018 Free Software 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 dl_machine_h
+#define dl_machine_h
+
+#define ELF_MACHINE_NAME "RISC-V"
+
+#include <entry.h>
+#include <elf/elf.h>
+#include <sys/asm.h>
+#include <dl-tls.h>
+
+#ifndef _RTLD_PROLOGUE
+# define _RTLD_PROLOGUE(entry) \
+ ".globl\t" __STRING (entry) "\n\t" \
+ ".type\t" __STRING (entry) ", @function\n" \
+ __STRING (entry) ":\n\t"
+#endif
+
+#ifndef _RTLD_EPILOGUE
+# define _RTLD_EPILOGUE(entry) \
+ ".size\t" __STRING (entry) ", . - " __STRING (entry) "\n\t"
+#endif
+
+#define ELF_MACHINE_JMP_SLOT R_RISCV_JUMP_SLOT
+
+#define elf_machine_type_class(type) \
+ ((ELF_RTYPE_CLASS_PLT * ((type) == ELF_MACHINE_JMP_SLOT \
+ || (__WORDSIZE == 32 && (type) == R_RISCV_TLS_DTPREL32) \
+ || (__WORDSIZE == 32 && (type) == R_RISCV_TLS_DTPMOD32) \
+ || (__WORDSIZE == 32 && (type) == R_RISCV_TLS_TPREL32) \
+ || (__WORDSIZE == 64 && (type) == R_RISCV_TLS_DTPREL64) \
+ || (__WORDSIZE == 64 && (type) == R_RISCV_TLS_DTPMOD64) \
+ || (__WORDSIZE == 64 && (type) == R_RISCV_TLS_TPREL64))) \
+ | (ELF_RTYPE_CLASS_COPY * ((type) == R_RISCV_COPY)))
+
+#define ELF_MACHINE_NO_REL 1
+#define ELF_MACHINE_NO_RELA 0
+
+/* Return nonzero iff ELF header is compatible with the running host. */
+static inline int __attribute_used__
+elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
+{
+ /* We can only run RISC-V binaries. */
+ if (ehdr->e_machine != EM_RISCV)
+ return 0;
+
+ /* Ensure the library's floating-point ABI matches that of the running
+ system. For now we don't support mixing XLEN, so there's no need (or way)
+ to check it matches. */
+#ifdef __riscv_float_abi_double
+ if ((ehdr->e_flags & EF_RISCV_FLOAT_ABI) != EF_RISCV_FLOAT_ABI_DOUBLE)
+ return 0;
+#else
+ if ((ehdr->e_flags & EF_RISCV_FLOAT_ABI) != EF_RISCV_FLOAT_ABI_SOFT)
+ return 0;
+#endif
+
+ return 1;
+}
+
+/* Return the link-time address of _DYNAMIC. */
+static inline ElfW(Addr)
+elf_machine_dynamic (void)
+{
+ extern ElfW(Addr) _GLOBAL_OFFSET_TABLE_ __attribute__ ((visibility ("hidden")));
+ return _GLOBAL_OFFSET_TABLE_;
+}
+
+#define STRINGXP(X) __STRING (X)
+#define STRINGXV(X) STRINGV_ (X)
+#define STRINGV_(...) # __VA_ARGS__
+
+/* Return the run-time load address of the shared object. */
+static inline ElfW(Addr)
+elf_machine_load_address (void)
+{
+ ElfW(Addr) load_addr;
+ asm ("lla %0, _DYNAMIC" : "=r" (load_addr));
+ return load_addr - elf_machine_dynamic ();
+}
+
+/* Initial entry point code for the dynamic linker.
+ The C function `_dl_start' is the real entry point;
+ its return value is the user program's entry point. */
+
+#define RTLD_START asm (\
+ ".text\n\
+ " _RTLD_PROLOGUE (ENTRY_POINT) "\
+ mv a0, sp\n\
+ jal _dl_start\n\
+ # Stash user entry point in s0.\n\
+ mv s0, a0\n\
+ # See if we were run as a command with the executable file\n\
+ # name as an extra leading argument.\n\
+ lw a0, _dl_skip_args\n\
+ # Load the original argument count.\n\
+ " STRINGXP (REG_L) " a1, 0(sp)\n\
+ # Subtract _dl_skip_args from it.\n\
+ sub a1, a1, a0\n\
+ # Adjust the stack pointer to skip _dl_skip_args words.\n\
+ sll a0, a0, " STRINGXP (PTRLOG) "\n\
+ add sp, sp, a0\n\
+ # Save back the modified argument count.\n\
+ " STRINGXP (REG_S) " a1, 0(sp)\n\
+ # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\
+ " STRINGXP (REG_L) " a0, _rtld_local\n\
+ add a2, sp, " STRINGXP (SZREG) "\n\
+ sll a3, a1, " STRINGXP (PTRLOG) "\n\
+ add a3, a3, a2\n\
+ add a3, a3, " STRINGXP (SZREG) "\n\
+ # Call the function to run the initializers.\n\
+ jal _dl_init\n\
+ # Pass our finalizer function to _start.\n\
+ lla a0, _dl_fini\n\
+ # Jump to the user entry point.\n\
+ jr s0\n\
+ " _RTLD_EPILOGUE (ENTRY_POINT) "\
+ .previous" \
+);
+
+/* Names of the architecture-specific auditing callback functions. */
+#define ARCH_LA_PLTENTER riscv_gnu_pltenter
+#define ARCH_LA_PLTEXIT riscv_gnu_pltexit
+
+/* Bias .got.plt entry by the offset requested by the PLT header. */
+#define elf_machine_plt_value(map, reloc, value) (value)
+
+static inline ElfW(Addr)
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
+ const ElfW(Rela) *reloc,
+ ElfW(Addr) *reloc_addr, ElfW(Addr) value)
+{
+ return *reloc_addr = value;
+}
+
+#endif /* !dl_machine_h */
+
+#ifdef RESOLVE_MAP
+
+/* Perform a relocation described by R_INFO at the location pointed to
+ by RELOC_ADDR. SYM is the relocation symbol specified by R_INFO and
+ MAP is the object containing the reloc. */
+
+auto inline void
+__attribute__ ((always_inline))
+elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
+ const ElfW(Sym) *sym, const struct r_found_version *version,
+ void *const reloc_addr, int skip_ifunc)
+{
+ ElfW(Addr) r_info = reloc->r_info;
+ const unsigned long int r_type = ELFW (R_TYPE) (r_info);
+ ElfW(Addr) *addr_field = (ElfW(Addr) *) reloc_addr;
+ const ElfW(Sym) *const __attribute__ ((unused)) refsym = sym;
+ struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
+ ElfW(Addr) value = 0;
+ if (sym_map != NULL)
+ value = SYMBOL_ADDRESS (sym_map, sym, true) + reloc->r_addend;
+
+ switch (r_type)
+ {
+#ifndef RTLD_BOOTSTRAP
+ case __WORDSIZE == 64 ? R_RISCV_TLS_DTPMOD64 : R_RISCV_TLS_DTPMOD32:
+ if (sym_map)
+ *addr_field = sym_map->l_tls_modid;
+ break;
+
+ case __WORDSIZE == 64 ? R_RISCV_TLS_DTPREL64 : R_RISCV_TLS_DTPREL32:
+ if (sym != NULL)
+ *addr_field = TLS_DTPREL_VALUE (sym) + reloc->r_addend;
+ break;
+
+ case __WORDSIZE == 64 ? R_RISCV_TLS_TPREL64 : R_RISCV_TLS_TPREL32:
+ if (sym != NULL)
+ {
+ CHECK_STATIC_TLS (map, sym_map);
+ *addr_field = TLS_TPREL_VALUE (sym_map, sym) + reloc->r_addend;
+ }
+ break;
+
+ case R_RISCV_COPY:
+ {
+ if (__glibc_unlikely (sym == NULL))
+ /* This can happen in trace mode if an object could not be
+ found. */
+ break;
+
+ /* Handle TLS copy relocations. */
+ if (__glibc_unlikely (ELFW (ST_TYPE) (sym->st_info) == STT_TLS))
+ {
+ /* There's nothing to do if the symbol is in .tbss. */
+ if (__glibc_likely (sym->st_value >= sym_map->l_tls_initimage_size))
+ break;
+ value += (ElfW(Addr)) sym_map->l_tls_initimage - sym_map->l_addr;
+ }
+
+ size_t size = sym->st_size;
+ if (__glibc_unlikely (sym->st_size != refsym->st_size))
+ {
+ const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+ if (sym->st_size > refsym->st_size)
+ size = refsym->st_size;
+ if (sym->st_size > refsym->st_size || GLRO(dl_verbose))
+ _dl_error_printf ("\
+ %s: Symbol `%s' has different size in shared object, consider re-linking\n",
+ rtld_progname ?: "<program name unknown>",
+ strtab + refsym->st_name);
+ }
+
+ memcpy (reloc_addr, (void *)value, size);
+ break;
+ }
+#endif
+
+#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
+ case R_RISCV_RELATIVE:
+ {
+# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
+ /* This is defined in rtld.c, but nowhere in the static libc.a;
+ make the reference weak so static programs can still link.
+ This declaration cannot be done when compiling rtld.c
+ (i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
+ common defn for _dl_rtld_map, which is incompatible with a
+ weak decl in the same file. */
+# ifndef SHARED
+ weak_extern (GL(dl_rtld_map));
+# endif
+ if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */
+# endif
+ *addr_field = map->l_addr + reloc->r_addend;
+ break;
+ }
+#endif
+
+ case R_RISCV_JUMP_SLOT:
+ case __WORDSIZE == 64 ? R_RISCV_64 : R_RISCV_32:
+ *addr_field = value;
+ break;
+
+ case R_RISCV_NONE:
+ break;
+
+ default:
+ _dl_reloc_bad_type (map, r_type, 0);
+ break;
+ }
+}
+
+auto inline void
+__attribute__ ((always_inline))
+elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
+ void *const reloc_addr)
+{
+ *(ElfW(Addr) *) reloc_addr = l_addr + reloc->r_addend;
+}
+
+auto inline void
+__attribute__ ((always_inline))
+elf_machine_lazy_rel (struct link_map *map, ElfW(Addr) l_addr,
+ const ElfW(Rela) *reloc, int skip_ifunc)
+{
+ ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset);
+ const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info);
+
+ /* Check for unexpected PLT reloc type. */
+ if (__glibc_likely (r_type == R_RISCV_JUMP_SLOT))
+ {
+ if (__glibc_unlikely (map->l_mach.plt == 0))
+ {
+ if (l_addr)
+ *reloc_addr += l_addr;
+ }
+ else
+ *reloc_addr = map->l_mach.plt;
+ }
+ else
+ _dl_reloc_bad_type (map, r_type, 1);
+}
+
+/* Set up the loaded object described by L so its stub function
+ will jump to the on-demand fixup code __dl_runtime_resolve. */
+
+auto inline int
+__attribute__ ((always_inline))
+elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
+{
+#ifndef RTLD_BOOTSTRAP
+ /* If using PLTs, fill in the first two entries of .got.plt. */
+ if (l->l_info[DT_JMPREL])
+ {
+ extern void _dl_runtime_resolve (void) __attribute__ ((visibility ("hidden")));
+ ElfW(Addr) *gotplt = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]);
+ /* If a library is prelinked but we have to relocate anyway,
+ we have to be able to undo the prelinking of .got.plt.
+ The prelinker saved the address of .plt for us here. */
+ if (gotplt[1])
+ l->l_mach.plt = gotplt[1] + l->l_addr;
+ gotplt[0] = (ElfW(Addr)) &_dl_runtime_resolve;
+ gotplt[1] = (ElfW(Addr)) l;
+ }
+#endif
+
+ return lazy;
+}
+
+#endif /* RESOLVE_MAP */
diff --git a/sysdeps/tile/dl-tls.h b/sysdeps/riscv/dl-tls.h
index d26c6befc5..ab2d860314 100644
--- a/sysdeps/tile/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -1,6 +1,6 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Thread-local storage handling in the ELF dynamic linker. RISC-V version.
+ Copyright (C) 2011-2018 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
@@ -24,14 +24,12 @@ typedef struct
unsigned long int ti_offset;
} tls_index;
-/* Fast-path function to get a TLS pointer. */
-extern void *__tls_get_addr (tls_index *ti);
-
/* The thread pointer points to the first static TLS block. */
#define TLS_TP_OFFSET 0
-/* Dynamic thread vector pointers at the start of each TLS block. */
-#define TLS_DTV_OFFSET 0
+/* Dynamic thread vector pointers point 0x800 past the start of each
+ TLS block. */
+#define TLS_DTV_OFFSET 0x800
/* Compute the value for a GOTTPREL reloc. */
#define TLS_TPREL_VALUE(sym_map, sym) \
@@ -41,5 +39,10 @@ extern void *__tls_get_addr (tls_index *ti);
#define TLS_DTPREL_VALUE(sym) \
((sym)->st_value - TLS_DTV_OFFSET)
+extern void *__tls_get_addr (tls_index *ti);
+
+#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
+#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
+
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-trampoline.S b/sysdeps/riscv/dl-trampoline.S
new file mode 100644
index 0000000000..cda3be9f4e
--- /dev/null
+++ b/sysdeps/riscv/dl-trampoline.S
@@ -0,0 +1,90 @@
+/* RISC-V PLT trampoline
+ Copyright (C) 2017-2018 Free Software 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>
+#include <sys/asm.h>
+
+/* Assembler veneer called from the PLT header code for lazy loading.
+ The PLT header passes its own args in t0-t2. */
+
+#ifdef __riscv_float_abi_soft
+# define FRAME_SIZE (-((-10 * SZREG) & ALMASK))
+#else
+# define FRAME_SIZE (-((-10 * SZREG - 8 * SZFREG) & ALMASK))
+#endif
+
+ENTRY (_dl_runtime_resolve)
+ # Save arguments to stack.
+ addi sp, sp, -FRAME_SIZE
+ REG_S ra, 9*SZREG(sp)
+ REG_S a0, 1*SZREG(sp)
+ REG_S a1, 2*SZREG(sp)
+ REG_S a2, 3*SZREG(sp)
+ REG_S a3, 4*SZREG(sp)
+ REG_S a4, 5*SZREG(sp)
+ REG_S a5, 6*SZREG(sp)
+ REG_S a6, 7*SZREG(sp)
+ REG_S a7, 8*SZREG(sp)
+
+#ifndef __riscv_float_abi_soft
+ FREG_S fa0, (10*SZREG + 0*SZFREG)(sp)
+ FREG_S fa1, (10*SZREG + 1*SZFREG)(sp)
+ FREG_S fa2, (10*SZREG + 2*SZFREG)(sp)
+ FREG_S fa3, (10*SZREG + 3*SZFREG)(sp)
+ FREG_S fa4, (10*SZREG + 4*SZFREG)(sp)
+ FREG_S fa5, (10*SZREG + 5*SZFREG)(sp)
+ FREG_S fa6, (10*SZREG + 6*SZFREG)(sp)
+ FREG_S fa7, (10*SZREG + 7*SZFREG)(sp)
+#endif
+
+ # Update .got.plt and obtain runtime address of callee.
+ slli a1, t1, 1
+ mv a0, t0 # link map
+ add a1, a1, t1 # reloc offset (== thrice the .got.plt offset)
+ la a2, _dl_fixup
+ jalr a2
+ mv t1, a0
+
+ # Restore arguments from stack.
+ REG_L ra, 9*SZREG(sp)
+ REG_L a0, 1*SZREG(sp)
+ REG_L a1, 2*SZREG(sp)
+ REG_L a2, 3*SZREG(sp)
+ REG_L a3, 4*SZREG(sp)
+ REG_L a4, 5*SZREG(sp)
+ REG_L a5, 6*SZREG(sp)
+ REG_L a6, 7*SZREG(sp)
+ REG_L a7, 8*SZREG(sp)
+
+#ifndef __riscv_float_abi_soft
+ FREG_L fa0, (10*SZREG + 0*SZFREG)(sp)
+ FREG_L fa1, (10*SZREG + 1*SZFREG)(sp)
+ FREG_L fa2, (10*SZREG + 2*SZFREG)(sp)
+ FREG_L fa3, (10*SZREG + 3*SZFREG)(sp)
+ FREG_L fa4, (10*SZREG + 4*SZFREG)(sp)
+ FREG_L fa5, (10*SZREG + 5*SZFREG)(sp)
+ FREG_L fa6, (10*SZREG + 6*SZFREG)(sp)
+ FREG_L fa7, (10*SZREG + 7*SZFREG)(sp)
+#endif
+
+ addi sp, sp, FRAME_SIZE
+
+ # Invoke the callee.
+ jr t1
+END (_dl_runtime_resolve)
diff --git a/sysdeps/riscv/e_sqrtl.c b/sysdeps/riscv/e_sqrtl.c
new file mode 100644
index 0000000000..55a875d9fb
--- /dev/null
+++ b/sysdeps/riscv/e_sqrtl.c
@@ -0,0 +1,37 @@
+/* long double square root in software floating-point emulation.
+ Copyright (C) 1997-2018 Free Software 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 <stdlib.h>
+#include <soft-fp/soft-fp.h>
+#include <soft-fp/quad.h>
+
+long double
+__ieee754_sqrtl (const long double a)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (A); FP_DECL_Q (C);
+ long double c;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (A, a);
+ FP_SQRT_Q (C, A);
+ FP_PACK_Q (c, C);
+ FP_HANDLE_EXCEPTIONS;
+ return c;
+}
+strong_alias (__ieee754_sqrtl, __sqrtl_finite)
diff --git a/sysdeps/riscv/fpu_control.h b/sysdeps/riscv/fpu_control.h
new file mode 100644
index 0000000000..c050d279b2
--- /dev/null
+++ b/sysdeps/riscv/fpu_control.h
@@ -0,0 +1,74 @@
+/* FPU control word bits. RISC-V version.
+ Copyright (C) 1996-2018 Free Software 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 _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+#include <features.h>
+
+#ifndef __riscv_flen
+
+# define _FPU_RESERVED 0xffffffff
+# define _FPU_DEFAULT 0x00000000
+typedef unsigned int fpu_control_t;
+# define _FPU_GETCW(cw) (cw) = 0
+# define _FPU_SETCW(cw) do { } while (0)
+extern fpu_control_t __fpu_control;
+
+#else /* __riscv_flen */
+
+# define _FPU_RESERVED 0
+# define _FPU_DEFAULT 0
+# define _FPU_IEEE _FPU_DEFAULT
+
+/* Type of the control word. */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
+
+/* Macros for accessing the hardware control word. */
+# define _FPU_GETCW(cw) __asm__ volatile ("frsr %0" : "=r" (cw))
+# define _FPU_SETCW(cw) __asm__ volatile ("fssr %z0" : : "rJ" (cw))
+
+/* Default control word set at startup. */
+extern fpu_control_t __fpu_control;
+
+# define _FCLASS(x) (__extension__ ({ int __res; \
+ if (sizeof (x) * 8 > __riscv_flen) __builtin_trap (); \
+ if (sizeof (x) == 4) asm ("fclass.s %0, %1" : "=r" (__res) : "f" (x)); \
+ else if (sizeof (x) == 8) asm ("fclass.d %0, %1" : "=r" (__res) : "f" (x)); \
+ else __builtin_trap (); \
+ __res; }))
+
+# define _FCLASS_MINF (1 << 0)
+# define _FCLASS_MNORM (1 << 1)
+# define _FCLASS_MSUBNORM (1 << 2)
+# define _FCLASS_MZERO (1 << 3)
+# define _FCLASS_PZERO (1 << 4)
+# define _FCLASS_PSUBNORM (1 << 5)
+# define _FCLASS_PNORM (1 << 6)
+# define _FCLASS_PINF (1 << 7)
+# define _FCLASS_SNAN (1 << 8)
+# define _FCLASS_QNAN (1 << 9)
+# define _FCLASS_ZERO (_FCLASS_MZERO | _FCLASS_PZERO)
+# define _FCLASS_SUBNORM (_FCLASS_MSUBNORM | _FCLASS_PSUBNORM)
+# define _FCLASS_NORM (_FCLASS_MNORM | _FCLASS_PNORM)
+# define _FCLASS_INF (_FCLASS_MINF | _FCLASS_PINF)
+# define _FCLASS_NAN (_FCLASS_SNAN | _FCLASS_QNAN)
+
+#endif /* __riscv_flen */
+
+#endif /* fpu_control.h */
diff --git a/sysdeps/tile/gccframe.h b/sysdeps/riscv/gccframe.h
index 18b6e016a3..3dc62863af 100644
--- a/sysdeps/tile/gccframe.h
+++ b/sysdeps/riscv/gccframe.h
@@ -1,6 +1,6 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Definition of object in frame unwind info. RISC-V version.
+ Copyright (C) 2001-2018 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,6 +16,6 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#define FIRST_PSEUDO_REGISTER 64
+#define FIRST_PSEUDO_REGISTER 66
#include <sysdeps/generic/gccframe.h>
diff --git a/sysdeps/riscv/jmpbuf-offsets.h b/sysdeps/riscv/jmpbuf-offsets.h
new file mode 100644
index 0000000000..fff4d0d9c6
--- /dev/null
+++ b/sysdeps/riscv/jmpbuf-offsets.h
@@ -0,0 +1,23 @@
+/* Private macros for accessing __jmp_buf contents. RISC-V version.
+ Copyright (C) 2018 Free Software 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 <jmpbuf-unwind.h>
+
+/* Helper for generic ____longjmp_chk(). */
+#define JB_FRAME_ADDRESS(buf) \
+ ((void *) _jmpbuf_sp (buf))
diff --git a/sysdeps/tile/jmpbuf-unwind.h b/sysdeps/riscv/jmpbuf-unwind.h
index be38584580..2e5f37f102 100644
--- a/sysdeps/tile/jmpbuf-unwind.h
+++ b/sysdeps/riscv/jmpbuf-unwind.h
@@ -1,7 +1,6 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Examine __jmp_buf for unwinding frames. RISC-V version.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
- Based on work contributed by Jakub Jelinek <jakub@redhat.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
@@ -18,23 +17,22 @@
<http://www.gnu.org/licenses/>. */
#include <setjmp.h>
-#include <jmpbuf-offsets.h>
#include <stdint.h>
#include <unwind.h>
#include <sysdep.h>
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle ((jmpbuf)[JB_SP]))
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp))
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) (long) _Unwind_GetCFA (_context), _adj)
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
static inline uintptr_t __attribute__ ((unused))
_jmpbuf_sp (__jmp_buf regs)
{
- uintptr_t sp = regs[JB_SP];
+ uintptr_t sp = regs[0].__sp;
#ifdef PTR_DEMANGLE
PTR_DEMANGLE (sp);
#endif
diff --git a/sysdeps/riscv/ldsodefs.h b/sysdeps/riscv/ldsodefs.h
new file mode 100644
index 0000000000..c032b73a9c
--- /dev/null
+++ b/sysdeps/riscv/ldsodefs.h
@@ -0,0 +1,47 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ Copyright (C) 2011-2018 Free Software 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 _RISCV_LDSODEFS_H
+#define _RISCV_LDSODEFS_H 1
+
+#include <elf.h>
+
+struct La_riscv_regs;
+struct La_riscv_retval;
+
+#define ARCH_PLTENTER_MEMBERS \
+ ElfW(Addr) (*riscv_gnu_pltenter) (ElfW(Sym) *, unsigned int, \
+ uintptr_t *, uintptr_t *, \
+ const struct La_riscv_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep);
+
+#define ARCH_PLTEXIT_MEMBERS \
+ unsigned int (*riscv_gnu_pltexit) (ElfW(Sym) *, unsigned int, \
+ uintptr_t *, uintptr_t *, \
+ const struct La_riscv_regs *, \
+ struct La_riscv_retval *, \
+ const char *);
+
+/* The RISC-V ABI specifies that the dynamic section has to be read-only. */
+
+#define DL_RO_DYN_SECTION 1
+
+#include_next <ldsodefs.h>
+
+#endif
diff --git a/sysdeps/riscv/libc-tls.c b/sysdeps/riscv/libc-tls.c
new file mode 100644
index 0000000000..c72abc1d34
--- /dev/null
+++ b/sysdeps/riscv/libc-tls.c
@@ -0,0 +1,32 @@
+/* Thread-local storage handling in the ELF dynamic linker. RISC-V version.
+ Copyright (C) 2011-2018 Free Software 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 <csu/libc-tls.c>
+#include <dl-tls.h>
+
+/* On RISC-V, linker optimizations are not required, so __tls_get_addr
+ can be called even in statically linked binaries. In this case module
+ must be always 1 and PT_TLS segment exist in the binary, otherwise it
+ would not link. */
+
+void *
+__tls_get_addr (tls_index *ti)
+{
+ dtv_t *dtv = THREAD_DTV ();
+ return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET;
+}
diff --git a/sysdeps/riscv/linkmap.h b/sysdeps/riscv/linkmap.h
new file mode 100644
index 0000000000..ac170bb342
--- /dev/null
+++ b/sysdeps/riscv/linkmap.h
@@ -0,0 +1,4 @@
+struct link_map_machine
+ {
+ ElfW(Addr) plt; /* Address of .plt. */
+ };
diff --git a/sysdeps/riscv/machine-gmon.h b/sysdeps/riscv/machine-gmon.h
new file mode 100644
index 0000000000..a50d50a2e1
--- /dev/null
+++ b/sysdeps/riscv/machine-gmon.h
@@ -0,0 +1,37 @@
+/* RISC-V definitions for profiling support.
+ Copyright (C) 1996-2018 Free Software 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/>. */
+
+/* Accept 'frompc' address as argument from the function that calls
+ _mcount for profiling. Use __builtin_return_address (0)
+ for the 'selfpc' address. */
+
+#include <sysdep.h>
+
+static void mcount_internal (unsigned long int frompc,
+ unsigned long int selfpc);
+
+#define _MCOUNT_DECL(frompc, selfpc) \
+static inline void mcount_internal (unsigned long int frompc, \
+unsigned long int selfpc)
+
+#define MCOUNT \
+void _mcount (void *frompc) \
+{ \
+ mcount_internal ((unsigned long int) frompc, \
+ (unsigned long int) RETURN_ADDRESS (0)); \
+}
diff --git a/sysdeps/riscv/math-tests.h b/sysdeps/riscv/math-tests.h
new file mode 100644
index 0000000000..32a8356a78
--- /dev/null
+++ b/sysdeps/riscv/math-tests.h
@@ -0,0 +1,42 @@
+/* Configuration for math tests. RISC-V version
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Copied from the aarch64 version
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/>. */
+
+/* Trapping exceptions are not supported on RISC-V. */
+#define EXCEPTION_ENABLE_SUPPORTED(EXCEPT) ((EXCEPT) == 0)
+
+/* Despite not supporting trapping exceptions, we support setting
+ floating-point exception flags on hard-float targets. These are not
+ supported on soft-float targets. */
+#ifndef __riscv_flen
+# define EXCEPTION_TESTS_float 0
+# define EXCEPTION_TESTS_double 0
+# define EXCEPTION_TESTS_long_double 0
+#endif
+
+/* On soft-float targets we only support the "to nearest" rounding mode. */
+#ifndef __riscv_flen
+# define ROUNDING_TESTS_float(MODE) ((MODE) == FE_TONEAREST)
+# define ROUNDING_TESTS_double(MODE) ((MODE) == FE_TONEAREST)
+# define ROUNDING_TESTS_long_double(MODE) ((MODE) == FE_TONEAREST)
+#endif
+
+/* RISC-V floating-point instructions do not preserve NaN payloads. */
+#define SNAN_TESTS_PRESERVE_PAYLOAD 0
+
+#include_next <math-tests.h>
diff --git a/sysdeps/riscv/memusage.h b/sysdeps/riscv/memusage.h
new file mode 100644
index 0000000000..a29e0d1e03
--- /dev/null
+++ b/sysdeps/riscv/memusage.h
@@ -0,0 +1,21 @@
+/* Machine-specific definitions for memory usage profiling, RISC-V version.
+ Copyright (C) 2000-2018 Free Software 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 GETSP() ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; })
+
+#include <sysdeps/generic/memusage.h>
diff --git a/sysdeps/riscv/nofpu/Implies b/sysdeps/riscv/nofpu/Implies
new file mode 100644
index 0000000000..abcbadb25f
--- /dev/null
+++ b/sysdeps/riscv/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/riscv/nofpu/libm-test-ulps b/sysdeps/riscv/nofpu/libm-test-ulps
new file mode 100644
index 0000000000..365f950074
--- /dev/null
+++ b/sysdeps/riscv/nofpu/libm-test-ulps
@@ -0,0 +1,2198 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "acos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "acos_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "acosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "acosh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "acosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "asin":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "asin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "asin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "asin_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "asinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "asinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "asinh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "atan":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "atan2":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "atan2_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "atan2_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "atan2_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "atan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "atan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "atan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "atanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "atanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "atanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "cabs":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cabs_downward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cabs_towardzero":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cabs_upward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "cacos":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cacos":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cacos_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+ildouble: 6
+ldouble: 6
+
+Function: Real part of "cacos_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cacos_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cacos_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
+
+Function: Real part of "cacosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cacosh":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cacosh_downward":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "cacosh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "cacosh_upward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 6
+ldouble: 6
+
+Function: Imaginary part of "cacosh_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "carg":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "carg_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "carg_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "carg_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "casin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "casin":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+ildouble: 6
+ldouble: 6
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "casin_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
+
+Function: Real part of "casinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "casinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "casinh_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+ildouble: 6
+ldouble: 6
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "casinh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "casinh_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
+
+Function: Imaginary part of "casinh_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "catan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catan_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catan_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "catanh_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "cbrt":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cbrt_downward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cbrt_upward":
+double: 5
+float: 1
+idouble: 5
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ccos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ccos_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ccos_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ccos_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ccos_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ccos_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ccosh_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ccosh_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ccosh_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ccosh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ccosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cexp":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "cexp":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "cexp_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cexp_downward":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cexp_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "clog":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "clog":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "clog10":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "clog10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "clog10_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "clog10_downward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "clog10_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "clog10_towardzero":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "clog10_upward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "clog10_upward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "clog_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "clog_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "clog_towardzero":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "clog_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "clog_upward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "clog_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "cos":
+ildouble: 1
+ldouble: 1
+
+Function: "cos_downward":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+
+Function: "cos_towardzero":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cos_upward":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+
+Function: "cosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cosh_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 2
+
+Function: "cosh_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 2
+
+Function: "cosh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 3
+
+Function: Real part of "cpow":
+double: 2
+float: 5
+idouble: 2
+ifloat: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "cpow":
+float: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "cpow_downward":
+double: 4
+float: 8
+idouble: 4
+ifloat: 8
+ildouble: 6
+ldouble: 6
+
+Function: Imaginary part of "cpow_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cpow_towardzero":
+double: 4
+float: 8
+idouble: 4
+ifloat: 8
+ildouble: 6
+ldouble: 6
+
+Function: Imaginary part of "cpow_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cpow_upward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cpow_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "csin":
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "csin_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csin_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csin_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csin_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "csinh":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "csinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "csinh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csinh_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csinh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csinh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "csinh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "csqrt_upward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "csqrt_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctan_downward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctan_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "ctan_towardzero":
+double: 5
+float: 2
+idouble: 5
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctan_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "ctan_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_downward":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_downward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "ctanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 5
+float: 2
+idouble: 5
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "erf":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "erf_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "erf_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "erf_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "erfc":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "erfc_downward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 5
+ldouble: 5
+
+Function: "erfc_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "erfc_upward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 5
+ldouble: 5
+
+Function: "exp":
+ildouble: 1
+ldouble: 1
+
+Function: "exp10":
+double: 2
+idouble: 2
+ildouble: 2
+ldouble: 2
+
+Function: "exp10_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "exp10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "exp10_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "exp2":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "exp2_downward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "exp2_towardzero":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "exp2_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "exp_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "expm1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "expm1_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "expm1_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "expm1_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "gamma":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "gamma_downward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 8
+ldouble: 8
+
+Function: "gamma_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "gamma_upward":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+ildouble: 8
+ldouble: 8
+
+Function: "hypot":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "hypot_downward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "hypot_towardzero":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "hypot_upward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "j0":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "j0_downward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: "j0_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "j0_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: "j1":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "j1_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "j1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "j1_upward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 3
+ldouble: 3
+
+Function: "jn":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 7
+ldouble: 7
+
+Function: "jn_downward":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+ildouble: 8
+ldouble: 8
+
+Function: "jn_towardzero":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+ildouble: 8
+ldouble: 8
+
+Function: "jn_upward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+ildouble: 7
+ldouble: 7
+
+Function: "lgamma":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "lgamma_downward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 8
+ldouble: 8
+
+Function: "lgamma_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "lgamma_upward":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+ildouble: 8
+ldouble: 8
+
+Function: "log":
+ildouble: 1
+ldouble: 1
+
+Function: "log10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: "log10_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 1
+ldouble: 1
+
+Function: "log10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "log10_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: "log1p":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "log1p_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "log1p_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "log1p_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "log2":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "log2_downward":
+double: 3
+idouble: 3
+ildouble: 3
+ldouble: 3
+
+Function: "log2_towardzero":
+double: 2
+idouble: 2
+ildouble: 1
+ldouble: 1
+
+Function: "log2_upward":
+double: 3
+idouble: 3
+ildouble: 1
+ldouble: 1
+
+Function: "log_downward":
+ildouble: 1
+ldouble: 1
+
+Function: "log_towardzero":
+ildouble: 2
+ldouble: 2
+
+Function: "log_upward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "pow":
+ildouble: 2
+ldouble: 2
+
+Function: "pow_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "pow_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "pow_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "sin":
+ildouble: 1
+ldouble: 1
+
+Function: "sin_downward":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+
+Function: "sin_towardzero":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+
+Function: "sin_upward":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+
+Function: "sincos":
+ildouble: 1
+ldouble: 1
+
+Function: "sincos_downward":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+
+Function: "sincos_towardzero":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+
+Function: "sincos_upward":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+
+Function: "sinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "sinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: "sinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "sinh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "tan":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "tan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: "tan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "tan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "tanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "tanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "tanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "tanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: "tgamma":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: "tgamma_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 5
+ldouble: 5
+
+Function: "tgamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+ildouble: 5
+ldouble: 5
+
+Function: "tgamma_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: "y0":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "y0_downward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: "y0_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: "y0_upward":
+double: 2
+float: 5
+idouble: 2
+ifloat: 5
+ildouble: 3
+ldouble: 3
+
+Function: "y1":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "y1_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "y1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "y1_upward":
+double: 5
+float: 2
+idouble: 5
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: "yn":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "yn_downward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 5
+ldouble: 5
+
+Function: "yn_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "yn_upward":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+ildouble: 5
+ldouble: 5
+
+# end of automatic generation
diff --git a/sysdeps/riscv/nofpu/libm-test-ulps-name b/sysdeps/riscv/nofpu/libm-test-ulps-name
new file mode 100644
index 0000000000..cb17236aa7
--- /dev/null
+++ b/sysdeps/riscv/nofpu/libm-test-ulps-name
@@ -0,0 +1 @@
+RISC-V soft-float
diff --git a/sysdeps/riscv/nptl/Makefile b/sysdeps/riscv/nptl/Makefile
new file mode 100644
index 0000000000..c3cc7f36da
--- /dev/null
+++ b/sysdeps/riscv/nptl/Makefile
@@ -0,0 +1,26 @@
+# Makefile for sysdeps/riscv/nptl.
+# Copyright (C) 2005-2018 Free Software 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),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
+
+ifeq ($(subdir),nptl)
+libpthread-sysdep_routines += nptl-sysdep
+libpthread-shared-only-routines += nptl-sysdep
+endif
diff --git a/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h b/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..f6a55b6233
--- /dev/null
+++ b/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,68 @@
+/* Machine-specific pthread type layouts. RISC-V version.
+ Copyright (C) 2011-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <endian.h>
+
+#if __riscv_xlen == 64
+# define __SIZEOF_PTHREAD_ATTR_T 56
+# define __SIZEOF_PTHREAD_MUTEX_T 40
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+# define __SIZEOF_PTHREAD_COND_T 48
+# define __SIZEOF_PTHREAD_CONDATTR_T 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 56
+# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+# define __SIZEOF_PTHREAD_BARRIER_T 32
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+#else
+# error "rv32i-based systems are not supported"
+#endif
+
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_USE_UNION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+/* There is a lot of padding in this structure. While it's not strictly
+ necessary on RISC-V, we're going to leave it in to be on the safe side in
+ case it's needed in the future. Most other architectures have the padding,
+ so this gives us the same extensibility as everyone else has. */
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+ int __cur_writer;
+ int __shared;
+ unsigned long int __pad1;
+ unsigned long int __pad2;
+ unsigned int __flags;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/riscv/nptl/bits/semaphore.h b/sysdeps/riscv/nptl/bits/semaphore.h
new file mode 100644
index 0000000000..2fed17d0e5
--- /dev/null
+++ b/sysdeps/riscv/nptl/bits/semaphore.h
@@ -0,0 +1,33 @@
+/* Machine-specific POSIX semaphore type layouts. RISC-V version.
+ Copyright (C) 2002-2018 Free Software 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 _SEMAPHORE_H
+# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
+#endif
+
+#define __SIZEOF_SEM_T (4 * __SIZEOF_POINTER__)
+
+/* Value returned if `sem_open' failed. */
+#define SEM_FAILED ((sem_t *) 0)
+
+
+typedef union
+{
+ char __size[__SIZEOF_SEM_T];
+ long int __align;
+} sem_t;
diff --git a/sysdeps/riscv/nptl/libc-lowlevellock.c b/sysdeps/riscv/nptl/libc-lowlevellock.c
new file mode 100644
index 0000000000..9523fb46a5
--- /dev/null
+++ b/sysdeps/riscv/nptl/libc-lowlevellock.c
@@ -0,0 +1,8 @@
+/* This kludge works around a libpthread static linking problem:
+ https://sourceware.org/bugzilla/show_bug.cgi?id=15648. */
+
+#ifndef SHARED
+# define __lll_lock_wait_private weak_function __lll_lock_wait_private
+#endif
+
+#include <lowlevellock.c>
diff --git a/sysdeps/riscv/nptl/nptl-sysdep.S b/sysdeps/riscv/nptl/nptl-sysdep.S
new file mode 100644
index 0000000000..3f5c2a364a
--- /dev/null
+++ b/sysdeps/riscv/nptl/nptl-sysdep.S
@@ -0,0 +1,2 @@
+/* Pull in __syscall_error. */
+#include <sysdep.S>
diff --git a/sysdeps/riscv/nptl/pthread-offsets.h b/sysdeps/riscv/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..5f7031834f
--- /dev/null
+++ b/sysdeps/riscv/nptl/pthread-offsets.h
@@ -0,0 +1,24 @@
+/* RISC-V pthread offsets
+ Copyright (C) 2017-2018 Free Software 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 __PTHREAD_MUTEX_NUSERS_OFFSET 12
+#define __PTHREAD_MUTEX_KIND_OFFSET 16
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 24
diff --git a/sysdeps/tile/nptl/pthreaddef.h b/sysdeps/riscv/nptl/pthreaddef.h
index 2392ca3751..442422aefb 100644
--- a/sysdeps/tile/nptl/pthreaddef.h
+++ b/sysdeps/riscv/nptl/pthreaddef.h
@@ -1,6 +1,6 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* pthread machine parameter definitions, RISC-V version.
+ Copyright (C) 2011-2018 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,9 +16,6 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <stdlib.h>
-#include <string.h>
-
/* Default stack size. */
#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
@@ -31,6 +28,5 @@
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
-
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
diff --git a/sysdeps/riscv/nptl/tcb-offsets.sym b/sysdeps/riscv/nptl/tcb-offsets.sym
new file mode 100644
index 0000000000..ab4981f2e2
--- /dev/null
+++ b/sysdeps/riscv/nptl/tcb-offsets.sym
@@ -0,0 +1,6 @@
+#include <sysdep.h>
+#include <tls.h>
+
+#define thread_offsetof(mem) (long)(offsetof (struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
+
+MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
diff --git a/sysdeps/riscv/nptl/tls.h b/sysdeps/riscv/nptl/tls.h
new file mode 100644
index 0000000000..7745d59044
--- /dev/null
+++ b/sysdeps/riscv/nptl/tls.h
@@ -0,0 +1,146 @@
+/* Definition for thread-local data handling. NPTL/RISC-V version.
+ Copyright (C) 2011-2018 Free Software 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 _RISCV_TLS_H
+#define _RISCV_TLS_H 1
+
+#include <dl-sysdep.h>
+
+#ifndef __ASSEMBLER__
+# include <stdbool.h>
+# include <stddef.h>
+# include <stdint.h>
+# include <dl-dtv.h>
+
+register void *__thread_self asm ("tp");
+# define READ_THREAD_POINTER() ({ __thread_self; })
+
+/* Get system call information. */
+# include <sysdep.h>
+
+/* The TP points to the start of the thread blocks. */
+# define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
+
+/* Get the thread descriptor definition. */
+# include <nptl/descr.h>
+
+typedef struct
+{
+ dtv_t *dtv;
+ void *private;
+} tcbhead_t;
+
+/* This is the size of the initial TCB. Because our TCB is before the thread
+ pointer, we don't need this. */
+# define TLS_INIT_TCB_SIZE 0
+
+/* Alignment requirements for the initial TCB. */
+# define TLS_INIT_TCB_ALIGN __alignof__ (struct pthread)
+
+/* This is the size of the TCB. Because our TCB is before the thread
+ pointer, we don't need this. */
+# define TLS_TCB_SIZE 0
+
+/* Alignment requirements for the TCB. */
+# define TLS_TCB_ALIGN __alignof__ (struct pthread)
+
+/* This is the size we need before TCB - actually, it includes the TCB. */
+# define TLS_PRE_TCB_SIZE \
+ (sizeof (struct pthread) \
+ + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1)))
+
+/* The thread pointer tp points to the end of the TCB.
+ The pthread_descr structure is immediately in front of the TCB. */
+# define TLS_TCB_OFFSET 0
+
+/* Install the dtv pointer. The pointer passed is to the element with
+ index -1 which contain the length. */
+# define INSTALL_DTV(tcbp, dtvp) \
+ (((tcbhead_t *) (tcbp))[-1].dtv = (dtvp) + 1)
+
+/* Install new dtv for current thread. */
+# define INSTALL_NEW_DTV(dtv) \
+ (THREAD_DTV() = (dtv))
+
+/* Return dtv of given thread descriptor. */
+# define GET_DTV(tcbp) \
+ (((tcbhead_t *) (tcbp))[-1].dtv)
+
+/* Code to initially initialize the thread pointer. */
+# define TLS_INIT_TP(tcbp) \
+ ({ __thread_self = (char*)tcbp + TLS_TCB_OFFSET; NULL; })
+
+/* Return the address of the dtv for the current thread. */
+# define THREAD_DTV() \
+ (((tcbhead_t *) (READ_THREAD_POINTER () - TLS_TCB_OFFSET))[-1].dtv)
+
+/* Return the thread descriptor for the current thread. */
+# define THREAD_SELF \
+ ((struct pthread *) (READ_THREAD_POINTER () \
+ - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
+
+/* Value passed to 'clone' for initialization of the thread register. */
+# define TLS_DEFINE_INIT_TP(tp, pd) \
+ void *tp = (void *) (pd) + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE
+
+/* Magic for libthread_db to know how to do THREAD_SELF. */
+# define DB_THREAD_SELF \
+ CONST_THREAD_AREA (32, TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
+
+/* Access to data in the thread descriptor is easy. */
+# define THREAD_GETMEM(descr, member) \
+ descr->member
+# define THREAD_GETMEM_NC(descr, member, idx) \
+ descr->member[idx]
+# define THREAD_SETMEM(descr, member, value) \
+ descr->member = (value)
+# define THREAD_SETMEM_NC(descr, member, idx, value) \
+ descr->member[idx] = (value)
+
+/* l_tls_offset == 0 is perfectly valid, so we have to use some different
+ value to mean unset l_tls_offset. */
+# define NO_TLS_OFFSET -1
+
+/* Get and set the global scope generation counter in struct pthread. */
+# define THREAD_GSCOPE_IN_TCB 1
+# define THREAD_GSCOPE_FLAG_UNUSED 0
+# define THREAD_GSCOPE_FLAG_USED 1
+# define THREAD_GSCOPE_FLAG_WAIT 2
+# define THREAD_GSCOPE_RESET_FLAG() \
+ do \
+ { int __res \
+ = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
+ THREAD_GSCOPE_FLAG_UNUSED); \
+ if (__res == THREAD_GSCOPE_FLAG_WAIT) \
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
+ } \
+ while (0)
+# define THREAD_GSCOPE_SET_FLAG() \
+ do \
+ { \
+ THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED; \
+ atomic_write_barrier (); \
+ } \
+ while (0)
+# define THREAD_GSCOPE_WAIT() \
+ GL(dl_wait_lookup_done) ()
+
+#endif /* __ASSEMBLER__ */
+
+#endif /* tls.h */
diff --git a/sysdeps/riscv/preconfigure b/sysdeps/riscv/preconfigure
new file mode 100644
index 0000000000..d9adb31b64
--- /dev/null
+++ b/sysdeps/riscv/preconfigure
@@ -0,0 +1,71 @@
+case "$machine" in
+riscv*)
+ xlen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_xlen \(.*\)/\1/p'`
+ flen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_flen \(.*\)/\1/p'`
+ float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_float_abi_\([^ ]*\) .*/\1/p'`
+ atomic=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep '#define __riscv_atomic' | cut -d' ' -f2`
+
+ case "$xlen" in
+ 32)
+ echo "glibc does not yet support 32-bit systems" >&2
+ exit 1
+ ;;
+ 64)
+ ;;
+ *)
+ echo "Unable to determine XLEN" >&2
+ exit 1
+ ;;
+ esac
+
+ case "$flen" in
+ 64)
+ float_machine=rvd
+ with_fp_cond=1
+ ;;
+ 32)
+ echo "glibc does not yet support systems with the F but not D extensions" >&2
+ exit 1
+ ;;
+ "")
+ with_fp_cond=0
+ ;;
+ *)
+ echo "Unable to determine FLEN" >&2
+ exit 1
+ ;;
+ esac
+
+ case "$float_abi" in
+ soft)
+ abi_flen=0
+ ;;
+ single)
+ echo "glibc does not yet support the single floating-point ABI" >&2
+ exit 1
+ ;;
+ double)
+ abi_flen=64
+ ;;
+ *)
+ echo "Unable to determine floating-point ABI" >&2
+ exit 1
+ ;;
+ esac
+
+ case "$atomic" in
+ __riscv_atomic)
+ ;;
+ *)
+ echo "glibc requires the A extension" >&2
+ exit 1
+ ;;
+ esac
+
+ base_machine=riscv
+ machine=riscv/rv$xlen/$float_machine
+
+ $as_echo "#define RISCV_ABI_XLEN $xlen" >>confdefs.h
+ $as_echo "#define RISCV_ABI_FLEN $abi_flen" >>confdefs.h
+ ;;
+esac
diff --git a/sysdeps/riscv/rv64/Implies-after b/sysdeps/riscv/rv64/Implies-after
new file mode 100644
index 0000000000..a8cae95f9d
--- /dev/null
+++ b/sysdeps/riscv/rv64/Implies-after
@@ -0,0 +1 @@
+wordsize-64
diff --git a/sysdeps/riscv/rv64/rvd/Implies b/sysdeps/riscv/rv64/rvd/Implies
new file mode 100644
index 0000000000..42fb132d12
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/Implies
@@ -0,0 +1,3 @@
+riscv/rv64/rvf
+riscv/rvd
+riscv/rvf
diff --git a/sysdeps/riscv/rv64/rvd/libm-test-ulps b/sysdeps/riscv/rv64/rvd/libm-test-ulps
new file mode 100644
index 0000000000..f8feadcd0d
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/libm-test-ulps
@@ -0,0 +1,2198 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "acos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "acos_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "acosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "acosh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "acosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "asin":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "asin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "asin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "asin_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "asinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "asinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "asinh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "atan":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "atan2":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "atan2_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "atan2_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "atan2_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "atan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "atan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "atan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "atanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "atanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "atanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "cabs":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cabs_downward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cabs_towardzero":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cabs_upward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "cacos":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cacos":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cacos_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+ildouble: 6
+ldouble: 6
+
+Function: Real part of "cacos_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cacos_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cacos_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
+
+Function: Real part of "cacosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cacosh":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cacosh_downward":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "cacosh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "cacosh_upward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 6
+ldouble: 6
+
+Function: Imaginary part of "cacosh_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "carg":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "carg_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "carg_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "carg_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "casin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "casin":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+ildouble: 6
+ldouble: 6
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "casin_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "casin_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
+
+Function: Real part of "casinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "casinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "casinh_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+ildouble: 6
+ldouble: 6
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "casinh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "casinh_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
+
+Function: Imaginary part of "casinh_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "catan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catan_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catan_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "catanh_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "cbrt":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cbrt_downward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cbrt_upward":
+double: 5
+float: 1
+idouble: 5
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ccos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ccos_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ccos_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ccos_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ccos_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ccos_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ccosh_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ccosh_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ccosh_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ccosh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ccosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cexp":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "cexp":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "cexp_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cexp_downward":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cexp_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "clog":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "clog":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "clog10":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "clog10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "clog10_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "clog10_downward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "clog10_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "clog10_towardzero":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "clog10_upward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "clog10_upward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "clog_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "clog_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "clog_towardzero":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "clog_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "clog_upward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "clog_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "cos":
+ildouble: 1
+ldouble: 1
+
+Function: "cos_downward":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+
+Function: "cos_towardzero":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cos_upward":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+
+Function: "cosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cosh_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 2
+
+Function: "cosh_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 2
+
+Function: "cosh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 3
+
+Function: Real part of "cpow":
+double: 2
+float: 5
+idouble: 2
+ifloat: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "cpow":
+float: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "cpow_downward":
+double: 4
+float: 8
+idouble: 4
+ifloat: 8
+ildouble: 6
+ldouble: 6
+
+Function: Imaginary part of "cpow_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cpow_towardzero":
+double: 4
+float: 8
+idouble: 4
+ifloat: 8
+ildouble: 6
+ldouble: 6
+
+Function: Imaginary part of "cpow_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "cpow_upward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "cpow_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "csin":
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "csin_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csin_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csin_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csin_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "csinh":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "csinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "csinh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csinh_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csinh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csinh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "csinh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "csqrt_upward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "csqrt_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctan_downward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctan_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "ctan_towardzero":
+double: 5
+float: 2
+idouble: 5
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctan_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "ctan_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Real part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctanh":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_downward":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_downward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "ctanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 5
+float: 2
+idouble: 5
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "erf":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "erf_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "erf_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "erf_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "erfc":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "erfc_downward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 5
+ldouble: 5
+
+Function: "erfc_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "erfc_upward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 5
+ldouble: 5
+
+Function: "exp":
+ildouble: 1
+ldouble: 1
+
+Function: "exp10":
+double: 2
+idouble: 2
+ildouble: 2
+ldouble: 2
+
+Function: "exp10_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "exp10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "exp10_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "exp2":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "exp2_downward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "exp2_towardzero":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "exp2_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "exp_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "expm1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "expm1_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "expm1_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "expm1_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "gamma":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "gamma_downward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 8
+ldouble: 8
+
+Function: "gamma_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "gamma_upward":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+ildouble: 8
+ldouble: 8
+
+Function: "hypot":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "hypot_downward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "hypot_towardzero":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "hypot_upward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "j0":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "j0_downward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: "j0_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "j0_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: "j1":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "j1_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "j1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "j1_upward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 3
+ldouble: 3
+
+Function: "jn":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 7
+ldouble: 7
+
+Function: "jn_downward":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+ildouble: 8
+ldouble: 8
+
+Function: "jn_towardzero":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+ildouble: 8
+ldouble: 8
+
+Function: "jn_upward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+ildouble: 7
+ldouble: 7
+
+Function: "lgamma":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "lgamma_downward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 8
+ldouble: 8
+
+Function: "lgamma_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "lgamma_upward":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+ildouble: 8
+ldouble: 8
+
+Function: "log":
+ildouble: 1
+ldouble: 1
+
+Function: "log10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: "log10_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 1
+ldouble: 1
+
+Function: "log10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "log10_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: "log1p":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "log1p_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "log1p_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "log1p_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "log2":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "log2_downward":
+double: 3
+idouble: 3
+ildouble: 3
+ldouble: 3
+
+Function: "log2_towardzero":
+double: 2
+idouble: 2
+ildouble: 1
+ldouble: 1
+
+Function: "log2_upward":
+double: 3
+idouble: 3
+ildouble: 1
+ldouble: 1
+
+Function: "log_downward":
+ildouble: 1
+ldouble: 1
+
+Function: "log_towardzero":
+ildouble: 2
+ldouble: 2
+
+Function: "log_upward":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+Function: "pow":
+ildouble: 2
+ldouble: 2
+
+Function: "pow_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "pow_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "pow_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "sin":
+ildouble: 1
+ldouble: 1
+
+Function: "sin_downward":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+
+Function: "sin_towardzero":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+
+Function: "sin_upward":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+
+Function: "sincos":
+ildouble: 1
+ldouble: 1
+
+Function: "sincos_downward":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+
+Function: "sincos_towardzero":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+
+Function: "sincos_upward":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+
+Function: "sinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "sinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: "sinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "sinh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "tan":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "tan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: "tan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "tan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "tanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "tanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: "tanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: "tanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: "tgamma":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: "tgamma_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 5
+ldouble: 5
+
+Function: "tgamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+ildouble: 5
+ldouble: 5
+
+Function: "tgamma_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: "y0":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: "y0_downward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 4
+ldouble: 4
+
+Function: "y0_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 3
+ldouble: 3
+
+Function: "y0_upward":
+double: 2
+float: 5
+idouble: 2
+ifloat: 5
+ildouble: 3
+ldouble: 3
+
+Function: "y1":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "y1_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 4
+ldouble: 4
+
+Function: "y1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
+Function: "y1_upward":
+double: 5
+float: 2
+idouble: 5
+ifloat: 2
+ildouble: 5
+ldouble: 5
+
+Function: "yn":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "yn_downward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+ildouble: 5
+ldouble: 5
+
+Function: "yn_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 5
+ldouble: 5
+
+Function: "yn_upward":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+ildouble: 5
+ldouble: 5
+
+# end of automatic generation
diff --git a/sysdeps/riscv/rv64/rvd/libm-test-ulps-name b/sysdeps/riscv/rv64/rvd/libm-test-ulps-name
new file mode 100644
index 0000000000..827fcdca19
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/libm-test-ulps-name
@@ -0,0 +1 @@
+RISC-V
diff --git a/sysdeps/riscv/rv64/rvd/s_ceil.c b/sysdeps/riscv/rv64/rvd/s_ceil.c
new file mode 100644
index 0000000000..af99ecca3d
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_ceil.c
@@ -0,0 +1,52 @@
+/* ceil(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+double
+__ceil (double x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ double mag = fabs (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1ULL << __DBL_MANT_DIG__))
+ {
+ int64_t i;
+ double new_x;
+
+ asm volatile ("fcvt.l.d %0, %1, rup" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.d.l %0, %1, rup" : "=f" (new_x) : "r" (i));
+
+ /* ceil(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysign (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/riscv/rv64/rvd/s_floor.c b/sysdeps/riscv/rv64/rvd/s_floor.c
new file mode 100644
index 0000000000..f34af98cce
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_floor.c
@@ -0,0 +1,52 @@
+/* floor(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+double
+__floor (double x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ double mag = fabs (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1ULL << __DBL_MANT_DIG__))
+ {
+ int64_t i;
+ double new_x;
+
+ asm volatile ("fcvt.l.d %0, %1, rdn" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.d.l %0, %1, rdn" : "=f" (new_x) : "r" (i));
+
+ /* floor(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysign (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/riscv/rv64/rvd/s_llrint.c b/sysdeps/riscv/rv64/rvd/s_llrint.c
new file mode 100644
index 0000000000..8f37090d74
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_llrint.c
@@ -0,0 +1,30 @@
+/* llrint(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+long long int
+__llrint (double x)
+{
+ int64_t res;
+ asm ("fcvt.l.d %0, %1" : "=r" (res) : "f" (x));
+ return res;
+}
+
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/riscv/rv64/rvd/s_llround.c b/sysdeps/riscv/rv64/rvd/s_llround.c
new file mode 100644
index 0000000000..b7e448876b
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_llround.c
@@ -0,0 +1,30 @@
+/* llround(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+long long int
+__llround (double x)
+{
+ int64_t res;
+ asm ("fcvt.l.d %0, %1, rmm" : "=r" (res) : "f" (x));
+ return res;
+}
+
+libm_alias_double (__llround, llround)
diff --git a/sysdeps/riscv/rv64/rvd/s_lrint.c b/sysdeps/riscv/rv64/rvd/s_lrint.c
new file mode 100644
index 0000000000..48f61be966
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_lrint.c
@@ -0,0 +1,30 @@
+/* lrint(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+long int
+__lrint (double x)
+{
+ int64_t res;
+ asm ("fcvt.l.d %0, %1" : "=r" (res) : "f" (x));
+ return res;
+}
+
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/riscv/rv64/rvd/s_lround.c b/sysdeps/riscv/rv64/rvd/s_lround.c
new file mode 100644
index 0000000000..392233cd04
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_lround.c
@@ -0,0 +1,30 @@
+/* llround(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+long int
+__lround (double x)
+{
+ int64_t res;
+ asm ("fcvt.l.d %0, %1, rmm" : "=r" (res) : "f" (x));
+ return res;
+}
+
+libm_alias_double (__lround, lround)
diff --git a/sysdeps/riscv/rv64/rvd/s_nearbyint.c b/sysdeps/riscv/rv64/rvd/s_nearbyint.c
new file mode 100644
index 0000000000..e17f038429
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_nearbyint.c
@@ -0,0 +1,52 @@
+/* nearbyint(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+double
+__nearbyint (double x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ double mag = fabs (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1ULL << __DBL_MANT_DIG__))
+ {
+ int64_t i;
+ double new_x;
+
+ asm volatile ("fcvt.l.d %0, %1" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.d.l %0, %1" : "=f" (new_x) : "r" (i));
+
+ /* nearbyint(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysign (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/riscv/rv64/rvd/s_rint.c b/sysdeps/riscv/rv64/rvd/s_rint.c
new file mode 100644
index 0000000000..ef2380ea7f
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_rint.c
@@ -0,0 +1,52 @@
+/* rint(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+double
+__rint (double x)
+{
+ bool nan;
+ double mag;
+
+ nan = isnan (x);
+ mag = fabs (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1ULL << __DBL_MANT_DIG__))
+ {
+ int64_t i;
+ double new_x;
+
+ asm ("fcvt.l.d %0, %1" : "=r" (i) : "f" (x));
+ asm ("fcvt.d.l %0, %1" : "=f" (new_x) : "r" (i));
+
+ /* rint(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysign (new_x, x);
+ }
+
+ return x;
+}
+
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/riscv/rv64/rvd/s_round.c b/sysdeps/riscv/rv64/rvd/s_round.c
new file mode 100644
index 0000000000..22cff63e09
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_round.c
@@ -0,0 +1,52 @@
+/* round(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+double
+__round (double x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ double mag = fabs (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1ULL << __DBL_MANT_DIG__))
+ {
+ int64_t i;
+ double new_x;
+
+ asm volatile ("fcvt.l.d %0, %1, rmm" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.d.l %0, %1, rmm" : "=f" (new_x) : "r" (i));
+
+ /* round(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysign (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_double (__round, round)
diff --git a/sysdeps/riscv/rv64/rvd/s_roundeven.c b/sysdeps/riscv/rv64/rvd/s_roundeven.c
new file mode 100644
index 0000000000..26a0b2ded3
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_roundeven.c
@@ -0,0 +1,53 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+double
+__roundeven (double x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ double mag = fabs (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1ULL << __DBL_MANT_DIG__))
+ {
+ int64_t i;
+ double new_x;
+
+ asm volatile ("fcvt.l.d %0, %1, rne" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.d.l %0, %1, rne" : "=f" (new_x) : "r" (i));
+
+ /* roundeven(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysign (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+hidden_def (__roundeven)
+libm_alias_double (__roundeven, roundeven)
diff --git a/sysdeps/riscv/rv64/rvd/s_trunc.c b/sysdeps/riscv/rv64/rvd/s_trunc.c
new file mode 100644
index 0000000000..a0f78e6cd1
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_trunc.c
@@ -0,0 +1,52 @@
+/* trunc(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+#include <stdint.h>
+
+double
+__trunc (double x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ double mag = fabs (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1ULL << __DBL_MANT_DIG__))
+ {
+ int64_t i;
+ double new_x;
+
+ asm volatile ("fcvt.l.d %0, %1, rtz" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.d.l %0, %1, rtz" : "=f" (new_x) : "r" (i));
+
+ /* trunc(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysign (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/riscv/rv64/rvf/Implies b/sysdeps/riscv/rv64/rvf/Implies
new file mode 100644
index 0000000000..66c401443b
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvf/Implies
@@ -0,0 +1 @@
+riscv/rvf
diff --git a/sysdeps/riscv/rv64/rvf/s_llrintf.c b/sysdeps/riscv/rv64/rvf/s_llrintf.c
new file mode 100644
index 0000000000..ddfda6cfe2
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvf/s_llrintf.c
@@ -0,0 +1,30 @@
+/* Round argument to nearest integral value according to current direction.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+long long int
+__llrintf (float x)
+{
+ int64_t res;
+ asm ("fcvt.l.s %0, %1" : "=r" (res) : "f" (x));
+ return res;
+}
+
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/riscv/rv64/rvf/s_llroundf.c b/sysdeps/riscv/rv64/rvf/s_llroundf.c
new file mode 100644
index 0000000000..7132f81d2f
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvf/s_llroundf.c
@@ -0,0 +1,30 @@
+/* Round float value to long long int. RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+long long int
+__llroundf (float x)
+{
+ int64_t res;
+ asm ("fcvt.l.s %0, %1, rmm" : "=r" (res) : "f" (x));
+ return res;
+}
+
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/riscv/rv64/rvf/s_lrintf.c b/sysdeps/riscv/rv64/rvf/s_lrintf.c
new file mode 100644
index 0000000000..d8b2fe88bf
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvf/s_lrintf.c
@@ -0,0 +1,31 @@
+/* lrintf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+long int
+__lrintf (float x)
+{
+ int64_t res;
+ asm ("fcvt.l.s %0, %1" : "=r" (res) : "f" (x));
+ return res;
+}
+
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/riscv/rv64/rvf/s_lroundf.c b/sysdeps/riscv/rv64/rvf/s_lroundf.c
new file mode 100644
index 0000000000..010ce6904d
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvf/s_lroundf.c
@@ -0,0 +1,31 @@
+/* lroundf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+long int
+__lroundf (float x)
+{
+ int64_t res;
+ asm ("fcvt.l.s %0, %1, rmm" : "=r" (res) : "f" (x));
+ return res;
+}
+
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/riscv/rvd/e_sqrt.c b/sysdeps/riscv/rvd/e_sqrt.c
new file mode 100644
index 0000000000..66627eec21
--- /dev/null
+++ b/sysdeps/riscv/rvd/e_sqrt.c
@@ -0,0 +1,27 @@
+/* Double precision floating point square root. RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+double
+__ieee754_sqrt (double x)
+{
+ asm ("fsqrt.d %0, %1" : "=f" (x) : "f" (x));
+ return x;
+}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/sysdeps/riscv/rvd/s_copysign.c b/sysdeps/riscv/rvd/s_copysign.c
new file mode 100644
index 0000000000..36fef55aa2
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_copysign.c
@@ -0,0 +1,28 @@
+/* Copy sign bit between floating-point values. RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+
+double
+__copysign (double x, double y)
+{
+ asm ("fsgnj.d %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
+ return x;
+}
+libm_alias_double (__copysign, copysign)
diff --git a/sysdeps/riscv/rvd/s_finite.c b/sysdeps/riscv/rvd/s_finite.c
new file mode 100644
index 0000000000..402ae3fa3a
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_finite.c
@@ -0,0 +1,28 @@
+/* finite(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+__finite (double x)
+{
+ return _FCLASS (x) & ~(_FCLASS_INF | _FCLASS_NAN);
+}
+hidden_def (__finite)
+weak_alias (__finite, finite)
diff --git a/sysdeps/riscv/rvd/s_fma.c b/sysdeps/riscv/rvd/s_fma.c
new file mode 100644
index 0000000000..165557962f
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_fma.c
@@ -0,0 +1,30 @@
+/* Double precision floating point fused multiply-add. RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <fenv.h>
+#include <ieee754.h>
+#include <libm-alias-double.h>
+
+double
+__fma (double x, double y, double z)
+{
+ asm ("fmadd.d %0, %1, %2, %3" : "=f" (x) : "f" (x), "f" (y), "f" (z));
+ return x;
+}
+libm_alias_double (__fma, fma)
diff --git a/sysdeps/riscv/rvd/s_fmax.c b/sysdeps/riscv/rvd/s_fmax.c
new file mode 100644
index 0000000000..22e91bfc4b
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_fmax.c
@@ -0,0 +1,35 @@
+/* fmax(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+
+double
+__fmax (double x, double y)
+{
+ double res;
+
+ if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
+ return x + y;
+ else
+ asm ("fmax.d %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
+
+ return res;
+}
+libm_alias_double (__fmax, fmax)
diff --git a/sysdeps/riscv/rvd/s_fmin.c b/sysdeps/riscv/rvd/s_fmin.c
new file mode 100644
index 0000000000..7b35230cac
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_fmin.c
@@ -0,0 +1,35 @@
+/* fmin(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+
+double
+__fmin (double x, double y)
+{
+ double res;
+
+ if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
+ return x + y;
+ else
+ asm ("fmin.d %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
+
+ return res;
+}
+libm_alias_double (__fmin, fmin)
diff --git a/sysdeps/riscv/rvd/s_fpclassify.c b/sysdeps/riscv/rvd/s_fpclassify.c
new file mode 100644
index 0000000000..fe693c2f4a
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_fpclassify.c
@@ -0,0 +1,36 @@
+/* fpclassify(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+__fpclassify (double x)
+{
+ int cls = _FCLASS (x);
+ if (__builtin_expect (cls & _FCLASS_NORM, _FCLASS_NORM))
+ return FP_NORMAL;
+ if (__builtin_expect (cls & _FCLASS_ZERO, _FCLASS_ZERO))
+ return FP_ZERO;
+ if (__builtin_expect (cls & _FCLASS_SUBNORM, _FCLASS_SUBNORM))
+ return FP_SUBNORMAL;
+ if (__builtin_expect (cls & _FCLASS_INF, _FCLASS_INF))
+ return FP_INFINITE;
+ return FP_NAN;
+}
+libm_hidden_def (__fpclassify)
diff --git a/sysdeps/riscv/rvd/s_isinf.c b/sysdeps/riscv/rvd/s_isinf.c
new file mode 100644
index 0000000000..1b9767a718
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_isinf.c
@@ -0,0 +1,29 @@
+/* isinf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+__isinf (double x)
+{
+ int cls = _FCLASS (x);
+ return -((cls & _FCLASS_MINF) ? 1 : 0) | ((cls & _FCLASS_PINF) ? 1 : 0);
+}
+hidden_def (__isinf)
+weak_alias (__isinf, isinf)
diff --git a/sysdeps/riscv/rvd/s_isnan.c b/sysdeps/riscv/rvd/s_isnan.c
new file mode 100644
index 0000000000..3739de7ec7
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_isnan.c
@@ -0,0 +1,28 @@
+/* isnan(). RISC_V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+__isnan (double x)
+{
+ return (_FCLASS (x) & _FCLASS_NAN) != 0;
+}
+hidden_def (__isnan)
+weak_alias (__isnan, isnan)
diff --git a/sysdeps/riscv/rvd/s_issignaling.c b/sysdeps/riscv/rvd/s_issignaling.c
new file mode 100644
index 0000000000..1b65206e9a
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_issignaling.c
@@ -0,0 +1,27 @@
+/* issignaling(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+__issignaling (double x)
+{
+ return (_FCLASS (x) & _FCLASS_SNAN) != 0;
+}
+libm_hidden_def (__issignaling)
diff --git a/sysdeps/riscv/rvf/e_sqrtf.c b/sysdeps/riscv/rvf/e_sqrtf.c
new file mode 100644
index 0000000000..711d93e430
--- /dev/null
+++ b/sysdeps/riscv/rvf/e_sqrtf.c
@@ -0,0 +1,27 @@
+/* Single precision floating point square root. RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+float
+__ieee754_sqrtf (float x)
+{
+ asm ("fsqrt.s %0, %1" : "=f" (x) : "f" (x));
+ return x;
+}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/sysdeps/riscv/rvf/fclrexcpt.c b/sysdeps/riscv/rvf/fclrexcpt.c
new file mode 100644
index 0000000000..bdad377e88
--- /dev/null
+++ b/sysdeps/riscv/rvf/fclrexcpt.c
@@ -0,0 +1,28 @@
+/* Clear given exceptions in current floating-point environment.
+ Copyright (C) 1998-2018 Free Software 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
+feclearexcept (int excepts)
+{
+ asm volatile ("csrc fflags, %0" : : "r" (excepts));
+ return 0;
+}
+libm_hidden_def (feclearexcept)
diff --git a/sysdeps/riscv/rvf/fegetenv.c b/sysdeps/riscv/rvf/fegetenv.c
new file mode 100644
index 0000000000..1c29413be5
--- /dev/null
+++ b/sysdeps/riscv/rvf/fegetenv.c
@@ -0,0 +1,32 @@
+/* Store current floating-point environment.
+ Copyright (C) 1998-2018 Free Software 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
+__fegetenv (fenv_t *envp)
+{
+ _FPU_GETCW (*envp);
+
+ /* Success. */
+ return 0;
+}
+libm_hidden_def (__fegetenv)
+weak_alias (__fegetenv, fegetenv)
+libm_hidden_weak (fegetenv)
diff --git a/sysdeps/riscv/rvf/fegetmode.c b/sysdeps/riscv/rvf/fegetmode.c
new file mode 100644
index 0000000000..67ae14c4ff
--- /dev/null
+++ b/sysdeps/riscv/rvf/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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/riscv/rvf/fegetround.c b/sysdeps/riscv/rvf/fegetround.c
new file mode 100644
index 0000000000..f7692a827b
--- /dev/null
+++ b/sysdeps/riscv/rvf/fegetround.c
@@ -0,0 +1,29 @@
+/* Return current rounding direction.
+ Copyright (C) 1998-2018 Free Software 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 <math_private.h>
+
+int
+__fegetround (void)
+{
+ return riscv_getround ();
+}
+libm_hidden_def (__fegetround)
+weak_alias (__fegetround, fegetround)
+libm_hidden_weak (fegetround)
diff --git a/sysdeps/riscv/rvf/feholdexcpt.c b/sysdeps/riscv/rvf/feholdexcpt.c
new file mode 100644
index 0000000000..ea9060f3dc
--- /dev/null
+++ b/sysdeps/riscv/rvf/feholdexcpt.c
@@ -0,0 +1,30 @@
+/* Store current floating-point environment and clear exceptions.
+ Copyright (C) 2000-2018 Free Software 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 <math_private.h>
+
+int
+__feholdexcept (fenv_t *envp)
+{
+ libc_feholdexcept_riscv (envp);
+ return 0;
+}
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/riscv/rvf/fesetenv.c b/sysdeps/riscv/rvf/fesetenv.c
new file mode 100644
index 0000000000..5d02d80101
--- /dev/null
+++ b/sysdeps/riscv/rvf/fesetenv.c
@@ -0,0 +1,30 @@
+/* Install given floating-point environment.
+ Copyright (C) 1998-2018 Free Software 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 <math_private.h>
+
+int
+__fesetenv (const fenv_t *envp)
+{
+ libc_fesetenv_riscv (envp);
+ return 0;
+}
+libm_hidden_def (__fesetenv)
+weak_alias (__fesetenv, fesetenv)
+libm_hidden_weak (fesetenv)
diff --git a/sysdeps/riscv/rvf/fesetexcept.c b/sysdeps/riscv/rvf/fesetexcept.c
new file mode 100644
index 0000000000..70059aa61a
--- /dev/null
+++ b/sysdeps/riscv/rvf/fesetexcept.c
@@ -0,0 +1,26 @@
+/* Set given exception flags. RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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)
+{
+ asm volatile ("csrs fflags, %0" : : "r" (excepts));
+ return 0;
+}
diff --git a/sysdeps/riscv/rvf/fesetmode.c b/sysdeps/riscv/rvf/fesetmode.c
new file mode 100644
index 0000000000..d39c5626fe
--- /dev/null
+++ b/sysdeps/riscv/rvf/fesetmode.c
@@ -0,0 +1,31 @@
+/* Install given floating-point control modes. RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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)
+{
+ asm volatile ("csrc fcsr, %0" : : "r" (~FE_ALL_EXCEPT));
+
+ if (modep != FE_DFL_MODE)
+ asm volatile ("csrs fcsr, %0" : : "r" (*modep & ~FE_ALL_EXCEPT));
+
+ return 0;
+}
diff --git a/sysdeps/riscv/rvf/fesetround.c b/sysdeps/riscv/rvf/fesetround.c
new file mode 100644
index 0000000000..bf705ef0c9
--- /dev/null
+++ b/sysdeps/riscv/rvf/fesetround.c
@@ -0,0 +1,39 @@
+/* Set current rounding direction.
+ Copyright (C) 1998-2018 Free Software 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 <math_private.h>
+
+int
+__fesetround (int round)
+{
+ switch (round)
+ {
+ case FE_TONEAREST:
+ case FE_TOWARDZERO:
+ case FE_DOWNWARD:
+ case FE_UPWARD:
+ riscv_setround (round);
+ return 0;
+ default:
+ return round; /* A nonzero value. */
+ }
+}
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
diff --git a/sysdeps/riscv/rvf/feupdateenv.c b/sysdeps/riscv/rvf/feupdateenv.c
new file mode 100644
index 0000000000..133d7eca11
--- /dev/null
+++ b/sysdeps/riscv/rvf/feupdateenv.c
@@ -0,0 +1,30 @@
+/* Install given floating-point environment and raise exceptions.
+ Copyright (C) 1998-2018 Free Software 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 <math_private.h>
+
+int
+__feupdateenv (const fenv_t *envp)
+{
+ libc_feupdateenv_riscv (envp);
+ return 0;
+}
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/riscv/rvf/fgetexcptflg.c b/sysdeps/riscv/rvf/fgetexcptflg.c
new file mode 100644
index 0000000000..367f0135d4
--- /dev/null
+++ b/sysdeps/riscv/rvf/fgetexcptflg.c
@@ -0,0 +1,30 @@
+/* Store current representation for exceptions.
+ Copyright (C) 1998-2018 Free Software 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 <math_private.h>
+
+int
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+ /* Get the current exceptions. */
+ *flagp = riscv_getflags () & excepts;
+
+ /* Success. */
+ return 0;
+}
diff --git a/sysdeps/riscv/rvf/fraiseexcpt.c b/sysdeps/riscv/rvf/fraiseexcpt.c
new file mode 100644
index 0000000000..dee90c3476
--- /dev/null
+++ b/sysdeps/riscv/rvf/fraiseexcpt.c
@@ -0,0 +1,30 @@
+/* Raise given exceptions.
+ Copyright (C) 2000-2018 Free Software 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
+__feraiseexcept (int excepts)
+{
+ asm volatile ("csrs fflags, %0" : : "r" (excepts));
+ return 0;
+}
+libm_hidden_def (__feraiseexcept)
+weak_alias (__feraiseexcept, feraiseexcept)
+libm_hidden_weak (feraiseexcept)
diff --git a/sysdeps/riscv/rvf/fsetexcptflg.c b/sysdeps/riscv/rvf/fsetexcptflg.c
new file mode 100644
index 0000000000..9e5bebf289
--- /dev/null
+++ b/sysdeps/riscv/rvf/fsetexcptflg.c
@@ -0,0 +1,30 @@
+/* Set floating-point environment exception handling.
+ Copyright (C) 1998-2018 Free Software 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
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+ fexcept_t flags = *flagp;
+ asm volatile ("csrc fflags, %0" : : "r" (excepts));
+ asm volatile ("csrs fflags, %0" : : "r" (flags & excepts));
+
+ return 0;
+}
diff --git a/sysdeps/riscv/rvf/ftestexcept.c b/sysdeps/riscv/rvf/ftestexcept.c
new file mode 100644
index 0000000000..a248bd6319
--- /dev/null
+++ b/sysdeps/riscv/rvf/ftestexcept.c
@@ -0,0 +1,27 @@
+/* Test exception in current environment.
+ Copyright (C) 1998-2018 Free Software 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 <math_private.h>
+
+int
+fetestexcept (int excepts)
+{
+ return libc_fetestexcept_riscv (excepts);
+}
+libm_hidden_def (fetestexcept)
diff --git a/sysdeps/riscv/rvf/get-rounding-mode.h b/sysdeps/riscv/rvf/get-rounding-mode.h
new file mode 100644
index 0000000000..42891324dd
--- /dev/null
+++ b/sysdeps/riscv/rvf/get-rounding-mode.h
@@ -0,0 +1,32 @@
+/* Determine floating-point rounding mode within libc. RISC-V version.
+ Copyright (C) 2015-2018 Free Software 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 _RISCV_GET_ROUNDING_MODE_H
+#define _RISCV_GET_ROUNDING_MODE_H
+
+/* Return the floating-point rounding mode. */
+
+static inline int
+get_rounding_mode (void)
+{
+ int rm;
+ asm volatile ("frrm %0" : "=r" (rm));
+ return rm;
+}
+
+#endif /* get-rounding-mode.h */
diff --git a/sysdeps/riscv/rvf/math_private.h b/sysdeps/riscv/rvf/math_private.h
new file mode 100644
index 0000000000..cdb7858fc8
--- /dev/null
+++ b/sysdeps/riscv/rvf/math_private.h
@@ -0,0 +1,161 @@
+/* Private floating point rounding and exceptions handling. RISC-V version.
+ Copyright (C) 2014-2018 Free Software 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 RISCV_MATH_PRIVATE_H
+#define RISCV_MATH_PRIVATE_H 1
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <get-rounding-mode.h>
+
+static __always_inline int
+riscv_getround (void)
+{
+ return get_rounding_mode ();
+}
+
+static __always_inline void
+riscv_setround (int rm)
+{
+ asm volatile ("fsrm %z0" : : "rJ" (rm));
+}
+
+static __always_inline int
+riscv_getflags (void)
+{
+ int flags;
+ asm volatile ("frflags %0" : "=r" (flags));
+ return flags;
+}
+
+static __always_inline void
+riscv_setflags (int flags)
+{
+ asm volatile ("fsflags %z0" : : "rJ" (flags));
+}
+
+static __always_inline void
+libc_feholdexcept_riscv (fenv_t *envp)
+{
+ asm volatile ("csrrc %0, fcsr, %1" : "=r" (*envp) : "i" (FE_ALL_EXCEPT));
+}
+
+#define libc_feholdexcept libc_feholdexcept_riscv
+#define libc_feholdexceptf libc_feholdexcept_riscv
+#define libc_feholdexceptl libc_feholdexcept_riscv
+
+static __always_inline void
+libc_fesetround_riscv (int round)
+{
+ riscv_setround (round);
+}
+
+#define libc_fesetround libc_fesetround_riscv
+#define libc_fesetroundf libc_fesetround_riscv
+#define libc_fesetroundl libc_fesetround_riscv
+
+static __always_inline void
+libc_feholdexcept_setround_riscv (fenv_t *envp, int round)
+{
+ libc_fesetround_riscv (round);
+ libc_feholdexcept_riscv (envp);
+}
+
+#define libc_feholdexcept_setround libc_feholdexcept_setround_riscv
+#define libc_feholdexcept_setroundf libc_feholdexcept_setround_riscv
+#define libc_feholdexcept_setroundl libc_feholdexcept_setround_riscv
+
+static __always_inline int
+libc_fetestexcept_riscv (int ex)
+{
+ return riscv_getflags () & ex;
+}
+
+#define libc_fetestexcept libc_fetestexcept_riscv
+#define libc_fetestexceptf libc_fetestexcept_riscv
+#define libc_fetestexceptl libc_fetestexcept_riscv
+
+static __always_inline void
+libc_fesetenv_riscv (const fenv_t *envp)
+{
+ long int env = (long int) envp - (long int) FE_DFL_ENV;
+ if (env != 0)
+ env = *envp;
+
+ _FPU_SETCW (env);
+}
+
+#define libc_fesetenv libc_fesetenv_riscv
+#define libc_fesetenvf libc_fesetenv_riscv
+#define libc_fesetenvl libc_fesetenv_riscv
+#define libc_feresetround_noex libc_fesetenv_riscv
+#define libc_feresetround_noexf libc_fesetenv_riscv
+#define libc_feresetround_noexl libc_fesetenv_riscv
+
+static __always_inline int
+libc_feupdateenv_test_riscv (const fenv_t *envp, int ex)
+{
+ fenv_t env = *envp;
+ int flags = riscv_getflags ();
+ asm volatile ("csrw fcsr, %z0" : : "rJ" (env | flags));
+ return flags & ex;
+}
+
+#define libc_feupdateenv_test libc_feupdateenv_test_riscv
+#define libc_feupdateenv_testf libc_feupdateenv_test_riscv
+#define libc_feupdateenv_testl libc_feupdateenv_test_riscv
+
+static __always_inline void
+libc_feupdateenv_riscv (const fenv_t *envp)
+{
+ _FPU_SETCW (*envp | riscv_getflags ());
+}
+
+#define libc_feupdateenv libc_feupdateenv_riscv
+#define libc_feupdateenvf libc_feupdateenv_riscv
+#define libc_feupdateenvl libc_feupdateenv_riscv
+
+static __always_inline void
+libc_feholdsetround_riscv (fenv_t *envp, int round)
+{
+ /* Note this implementation makes an improperly-formatted fenv_t and
+ so should only be used in conjunction with libc_feresetround. */
+ int old_round;
+ asm volatile ("csrrw %0, frm, %z1" : "=r" (old_round) : "rJ" (round));
+ *envp = old_round;
+}
+
+#define libc_feholdsetround libc_feholdsetround_riscv
+#define libc_feholdsetroundf libc_feholdsetround_riscv
+#define libc_feholdsetroundl libc_feholdsetround_riscv
+
+static __always_inline void
+libc_feresetround_riscv (fenv_t *envp)
+{
+ /* Note this implementation takes an improperly-formatted fenv_t and
+ so should only be used in conjunction with libc_feholdsetround. */
+ riscv_setround (*envp);
+}
+
+#define libc_feresetround libc_feresetround_riscv
+#define libc_feresetroundf libc_feresetround_riscv
+#define libc_feresetroundl libc_feresetround_riscv
+
+#include_next <math_private.h>
+
+#endif
diff --git a/sysdeps/riscv/rvf/s_ceilf.c b/sysdeps/riscv/rvf/s_ceilf.c
new file mode 100644
index 0000000000..d7e291acf8
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_ceilf.c
@@ -0,0 +1,52 @@
+/* ceilf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+float
+__ceilf (float x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ float mag = fabsf (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1 << __FLT_MANT_DIG__))
+ {
+ int32_t i;
+ float new_x;
+
+ asm volatile ("fcvt.w.s %0, %1, rup" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.s.w %0, %1, rup" : "=f" (new_x) : "r" (i));
+
+ /* ceil(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysignf (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/riscv/rvf/s_copysignf.c b/sysdeps/riscv/rvf/s_copysignf.c
new file mode 100644
index 0000000000..4d1c122f7e
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_copysignf.c
@@ -0,0 +1,28 @@
+/* copysignf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+float
+__copysignf (float x, float y)
+{
+ asm ("fsgnj.s %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
+ return x;
+}
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/riscv/rvf/s_finitef.c b/sysdeps/riscv/rvf/s_finitef.c
new file mode 100644
index 0000000000..04ce08719b
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_finitef.c
@@ -0,0 +1,28 @@
+/* finitef(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+__finitef (float x)
+{
+ return _FCLASS (x) & ~(_FCLASS_INF | _FCLASS_NAN);
+}
+hidden_def (__finitef)
+weak_alias (__finitef, finitef)
diff --git a/sysdeps/riscv/rvf/s_floorf.c b/sysdeps/riscv/rvf/s_floorf.c
new file mode 100644
index 0000000000..3c9c625e2f
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_floorf.c
@@ -0,0 +1,52 @@
+/* floorf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+float
+__floorf (float x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ float mag = fabsf (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1 << __FLT_MANT_DIG__))
+ {
+ int32_t i;
+ float new_x;
+
+ asm volatile ("fcvt.w.s %0, %1, rdn" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.s.w %0, %1, rdn" : "=f" (new_x) : "r" (i));
+
+ /* floor(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysignf (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/riscv/rvf/s_fmaf.c b/sysdeps/riscv/rvf/s_fmaf.c
new file mode 100644
index 0000000000..946e7ed0c9
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_fmaf.c
@@ -0,0 +1,30 @@
+/* fmaf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <fenv.h>
+#include <ieee754.h>
+#include <libm-alias-float.h>
+
+float
+__fmaf (float x, float y, float z)
+{
+ asm ("fmadd.s %0, %1, %2, %3" : "=f" (x) : "f" (x), "f" (y), "f" (z));
+ return x;
+}
+libm_alias_float (__fma, fma)
diff --git a/sysdeps/riscv/rvf/s_fmaxf.c b/sysdeps/riscv/rvf/s_fmaxf.c
new file mode 100644
index 0000000000..63f7e3d664
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_fmaxf.c
@@ -0,0 +1,35 @@
+/* fmaxf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+float
+__fmaxf (float x, float y)
+{
+ float res;
+
+ if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
+ return x + y;
+ else
+ asm ("fmax.s %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
+
+ return res;
+}
+libm_alias_float (__fmax, fmax)
diff --git a/sysdeps/riscv/rvf/s_fminf.c b/sysdeps/riscv/rvf/s_fminf.c
new file mode 100644
index 0000000000..82cca4e37d
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_fminf.c
@@ -0,0 +1,35 @@
+/* fminf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+float
+__fminf (float x, float y)
+{
+ float res;
+
+ if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
+ return x + y;
+ else
+ asm ("fmin.s %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
+
+ return res;
+}
+libm_alias_float (__fmin, fmin)
diff --git a/sysdeps/riscv/rvf/s_fpclassifyf.c b/sysdeps/riscv/rvf/s_fpclassifyf.c
new file mode 100644
index 0000000000..4abcf3edac
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_fpclassifyf.c
@@ -0,0 +1,36 @@
+/* fpclassifyf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+__fpclassifyf (float x)
+{
+ int cls = _FCLASS (x);
+ if (__builtin_expect (cls & _FCLASS_NORM, _FCLASS_NORM))
+ return FP_NORMAL;
+ if (__builtin_expect (cls & _FCLASS_ZERO, _FCLASS_ZERO))
+ return FP_ZERO;
+ if (__builtin_expect (cls & _FCLASS_SUBNORM, _FCLASS_SUBNORM))
+ return FP_SUBNORMAL;
+ if (__builtin_expect (cls & _FCLASS_INF, _FCLASS_INF))
+ return FP_INFINITE;
+ return FP_NAN;
+}
+libm_hidden_def (__fpclassifyf)
diff --git a/sysdeps/riscv/rvf/s_isinff.c b/sysdeps/riscv/rvf/s_isinff.c
new file mode 100644
index 0000000000..1c7413190c
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_isinff.c
@@ -0,0 +1,29 @@
+/* isinff(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+__isinff (float x)
+{
+ int cls = _FCLASS (x);
+ return -((cls & _FCLASS_MINF) ? 1 : 0) | ((cls & _FCLASS_PINF) ? 1 : 0);
+}
+hidden_def (__isinff)
+weak_alias (__isinff, isinff)
diff --git a/sysdeps/riscv/rvf/s_isnanf.c b/sysdeps/riscv/rvf/s_isnanf.c
new file mode 100644
index 0000000000..30a88bb23c
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_isnanf.c
@@ -0,0 +1,28 @@
+/* isnanf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+__isnanf (float x)
+{
+ return (_FCLASS (x) & _FCLASS_NAN) != 0;
+}
+hidden_def (__isnanf)
+weak_alias (__isnanf, isnanf)
diff --git a/sysdeps/riscv/rvf/s_issignalingf.c b/sysdeps/riscv/rvf/s_issignalingf.c
new file mode 100644
index 0000000000..e67efc794b
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_issignalingf.c
@@ -0,0 +1,27 @@
+/* issignalingf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+__issignalingf (float x)
+{
+ return (_FCLASS (x) & _FCLASS_SNAN) != 0;
+}
+libm_hidden_def (__issignalingf)
diff --git a/sysdeps/riscv/rvf/s_nearbyintf.c b/sysdeps/riscv/rvf/s_nearbyintf.c
new file mode 100644
index 0000000000..d653794d71
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_nearbyintf.c
@@ -0,0 +1,52 @@
+/* Round to int floating-point values. RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+float
+__nearbyintf (float x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ float mag = fabsf (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1 << __FLT_MANT_DIG__))
+ {
+ int32_t i;
+ float new_x;
+
+ asm volatile ("fcvt.w.s %0, %1" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.s.w %0, %1" : "=f" (new_x) : "r" (i));
+
+ /* nearbyint(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysignf (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/riscv/rvf/s_rintf.c b/sysdeps/riscv/rvf/s_rintf.c
new file mode 100644
index 0000000000..2ec3877a4f
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_rintf.c
@@ -0,0 +1,52 @@
+/* rintf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+float
+__rintf (float x)
+{
+ bool nan;
+ float mag;
+
+ nan = isnan (x);
+ mag = fabsf (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1 << __FLT_MANT_DIG__))
+ {
+ int32_t i;
+ float new_x;
+
+ asm ("fcvt.w.s %0, %1" : "=r" (i) : "f" (x));
+ asm ("fcvt.s.w %0, %1" : "=f" (new_x) : "r" (i));
+
+ /* rint(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysignf (new_x, x);
+ }
+
+ return x;
+}
+
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/riscv/rvf/s_roundevenf.c b/sysdeps/riscv/rvf/s_roundevenf.c
new file mode 100644
index 0000000000..48086c28ee
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_roundevenf.c
@@ -0,0 +1,52 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+float
+__roundevenf (float x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ float mag = fabsf (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1 << __FLT_MANT_DIG__))
+ {
+ int32_t i;
+ float new_x;
+
+ asm volatile ("fcvt.w.s %0, %1, rne" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.s.w %0, %1, rne" : "=f" (new_x) : "r" (i));
+
+ /* roundeven(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysignf (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_float (__roundeven, roundeven)
diff --git a/sysdeps/riscv/rvf/s_roundf.c b/sysdeps/riscv/rvf/s_roundf.c
new file mode 100644
index 0000000000..dedf57cbb3
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_roundf.c
@@ -0,0 +1,52 @@
+/* roundf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+float
+__roundf (float x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ float mag = fabsf (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1 << __FLT_MANT_DIG__))
+ {
+ int32_t i;
+ float new_x;
+
+ asm volatile ("fcvt.w.s %0, %1, rmm" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.s.w %0, %1, rmm" : "=f" (new_x) : "r" (i));
+
+ /* round(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysignf (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_float (__round, round)
diff --git a/sysdeps/riscv/rvf/s_truncf.c b/sysdeps/riscv/rvf/s_truncf.c
new file mode 100644
index 0000000000..e23926a2ae
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_truncf.c
@@ -0,0 +1,52 @@
+/* truncf(). RISC-V version.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+#include <stdint.h>
+
+float
+__truncf (float x)
+{
+ int flags = riscv_getflags ();
+ bool nan = isnan (x);
+ float mag = fabsf (x);
+
+ if (nan)
+ return x + x;
+
+ if (mag < (1 << __FLT_MANT_DIG__))
+ {
+ int32_t i;
+ float new_x;
+
+ asm volatile ("fcvt.w.s %0, %1, rtz" : "=r" (i) : "f" (x));
+ asm volatile ("fcvt.s.w %0, %1, rtz" : "=f" (new_x) : "r" (i));
+
+ /* trunc(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ x = copysignf (new_x, x);
+
+ riscv_setflags (flags);
+ }
+
+ return x;
+}
+
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/riscv/setjmp.S b/sysdeps/riscv/setjmp.S
new file mode 100644
index 0000000000..cfbd276fc3
--- /dev/null
+++ b/sysdeps/riscv/setjmp.S
@@ -0,0 +1,74 @@
+/* setjmp for RISC-V.
+ Copyright (C) 1996-2018 Free Software 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>
+#include <sys/asm.h>
+
+ENTRY (_setjmp)
+ li a1, 0
+ j __sigsetjmp
+END (_setjmp)
+ENTRY (setjmp)
+ li a1, 1
+ /* Fallthrough */
+END (setjmp)
+ENTRY (__sigsetjmp)
+ REG_S ra, 0*SZREG(a0)
+ REG_S s0, 1*SZREG(a0)
+ REG_S s1, 2*SZREG(a0)
+ REG_S s2, 3*SZREG(a0)
+ REG_S s3, 4*SZREG(a0)
+ REG_S s4, 5*SZREG(a0)
+ REG_S s5, 6*SZREG(a0)
+ REG_S s6, 7*SZREG(a0)
+ REG_S s7, 8*SZREG(a0)
+ REG_S s8, 9*SZREG(a0)
+ REG_S s9, 10*SZREG(a0)
+ REG_S s10,11*SZREG(a0)
+ REG_S s11,12*SZREG(a0)
+ REG_S sp, 13*SZREG(a0)
+
+#ifndef __riscv_float_abi_soft
+ FREG_S fs0, 14*SZREG+ 0*SZFREG(a0)
+ FREG_S fs1, 14*SZREG+ 1*SZFREG(a0)
+ FREG_S fs2, 14*SZREG+ 2*SZFREG(a0)
+ FREG_S fs3, 14*SZREG+ 3*SZFREG(a0)
+ FREG_S fs4, 14*SZREG+ 4*SZFREG(a0)
+ FREG_S fs5, 14*SZREG+ 5*SZFREG(a0)
+ FREG_S fs6, 14*SZREG+ 6*SZFREG(a0)
+ FREG_S fs7, 14*SZREG+ 7*SZFREG(a0)
+ FREG_S fs8, 14*SZREG+ 8*SZFREG(a0)
+ FREG_S fs9, 14*SZREG+ 9*SZFREG(a0)
+ FREG_S fs10,14*SZREG+10*SZFREG(a0)
+ FREG_S fs11,14*SZREG+11*SZFREG(a0)
+#endif
+
+#if !IS_IN (libc) && IS_IN (rtld)
+ /* In ld.so we never save the signal mask. */
+ li a0, 0
+ ret
+#else
+ /* Make a tail call to __sigjmp_save; it takes the same args. */
+ j __sigjmp_save
+#endif
+
+
+END (__sigsetjmp)
+
+hidden_def (__sigsetjmp)
+weak_alias (_setjmp, __GI__setjmp)
diff --git a/sysdeps/riscv/sfp-machine.h b/sysdeps/riscv/sfp-machine.h
new file mode 100644
index 0000000000..e3884433f3
--- /dev/null
+++ b/sysdeps/riscv/sfp-machine.h
@@ -0,0 +1,101 @@
+/* RISC-V softfloat definitions
+ Copyright (C) 2017-2018 Free Software 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>
+
+#if __riscv_xlen == 32
+
+# error "rv32i-based targets are not supported"
+
+#else
+
+# define _FP_W_TYPE_SIZE 64
+# define _FP_W_TYPE unsigned long long
+# define _FP_WS_TYPE signed long long
+# define _FP_I_TYPE long long
+
+# define _FP_MUL_MEAT_S(R, X, Y) \
+ _FP_MUL_MEAT_1_imm (_FP_WFRACBITS_S, R, X, Y)
+# define _FP_MUL_MEAT_D(R, X, Y) \
+ _FP_MUL_MEAT_1_wide (_FP_WFRACBITS_D, R, X, Y, umul_ppmm)
+# define _FP_MUL_MEAT_Q(R, X, Y) \
+ _FP_MUL_MEAT_2_wide_3mul (_FP_WFRACBITS_Q, R, X, Y, umul_ppmm)
+
+# define _FP_MUL_MEAT_DW_S(R, X, Y) \
+ _FP_MUL_MEAT_DW_1_imm (_FP_WFRACBITS_S, R, X, Y)
+# define _FP_MUL_MEAT_DW_D(R, X, Y) \
+ _FP_MUL_MEAT_DW_1_wide (_FP_WFRACBITS_D, R, X, Y, umul_ppmm)
+# define _FP_MUL_MEAT_DW_Q(R, X, Y) \
+ _FP_MUL_MEAT_DW_2_wide_3mul (_FP_WFRACBITS_Q, R, X, Y, umul_ppmm)
+
+# define _FP_DIV_MEAT_S(R, X, Y) _FP_DIV_MEAT_1_imm (S, R, X, Y, _FP_DIV_HELP_imm)
+# define _FP_DIV_MEAT_D(R, X, Y) _FP_DIV_MEAT_1_udiv_norm (D, R, X, Y)
+# define _FP_DIV_MEAT_Q(R, X, Y) _FP_DIV_MEAT_2_udiv (Q, R, X, Y)
+
+# define _FP_NANFRAC_S _FP_QNANBIT_S
+# define _FP_NANFRAC_D _FP_QNANBIT_D
+# define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0
+
+#endif
+
+#define _FP_NANSIGN_S 0
+#define _FP_NANSIGN_D 0
+#define _FP_NANSIGN_Q 0
+
+#define _FP_KEEPNANFRACP 0
+#define _FP_QNANNEGATEDP 0
+
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do { \
+ R##_s = _FP_NANSIGN_##fs; \
+ _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs); \
+ R##_c = FP_CLS_NAN; \
+ } while (0)
+
+#define _FP_DECL_EX int _frm __attribute__ ((unused));
+#define FP_ROUNDMODE _frm
+
+#define FP_RND_NEAREST FE_TONEAREST
+#define FP_RND_ZERO FE_TOWARDZERO
+#define FP_RND_PINF FE_UPWARD
+#define FP_RND_MINF FE_DOWNWARD
+
+#define FP_EX_INVALID FE_INVALID
+#define FP_EX_OVERFLOW FE_OVERFLOW
+#define FP_EX_UNDERFLOW FE_UNDERFLOW
+#define FP_EX_DIVZERO FE_DIVBYZERO
+#define FP_EX_INEXACT FE_INEXACT
+
+#define _FP_TININESS_AFTER_ROUNDING 1
+
+#ifdef __riscv_flen
+# define FP_INIT_ROUNDMODE \
+do { \
+ __asm__ volatile ("frrm %0" : "=r" (_frm)); \
+} while (0)
+
+# define FP_HANDLE_EXCEPTIONS \
+do { \
+ if (__builtin_expect (_fex, 0)) \
+ __asm__ volatile ("csrs fflags, %0" : : "rK" (_fex)); \
+} while (0)
+#else
+# define FP_INIT_ROUNDMODE _frm = FP_RND_NEAREST
+#endif
diff --git a/sysdeps/riscv/sotruss-lib.c b/sysdeps/riscv/sotruss-lib.c
new file mode 100644
index 0000000000..f35b554db5
--- /dev/null
+++ b/sysdeps/riscv/sotruss-lib.c
@@ -0,0 +1,51 @@
+/* Override generic sotruss-lib.c to define actual functions for RISC-V.
+ Copyright (C) 2012-2018 Free Software 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 HAVE_ARCH_PLTENTER
+#define HAVE_ARCH_PLTEXIT
+
+#include <elf/sotruss-lib.c>
+
+ElfW(Addr)
+la_riscv_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
+ unsigned int ndx __attribute__ ((unused)),
+ uintptr_t *refcook, uintptr_t *defcook,
+ La_riscv_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ print_enter (refcook, defcook, symname,
+ regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
+ *flags);
+
+ /* No need to copy anything, we will not need the parameters in any case. */
+ *framesizep = 0;
+
+ return sym->st_value;
+}
+
+unsigned int
+la_riscv_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook,
+ const struct La_riscv_regs *inregs,
+ struct La_riscv_retval *outregs,
+ const char *symname)
+{
+ print_exit (refcook, defcook, symname, outregs->lrv_a0);
+
+ return 0;
+}
diff --git a/sysdeps/riscv/stackinfo.h b/sysdeps/riscv/stackinfo.h
new file mode 100644
index 0000000000..5b4f91c6a1
--- /dev/null
+++ b/sysdeps/riscv/stackinfo.h
@@ -0,0 +1,33 @@
+/* Stack environment definitions for RISC-V.
+ Copyright (C) 2011-2018 Free Software 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 file contains a bit of information about the stack allocation
+ of the processor. */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H 1
+
+#include <elf.h>
+
+/* On RISC-V the stack grows down. */
+#define _STACK_GROWS_DOWN 1
+
+/* Default to a non-executable stack. */
+#define DEFAULT_STACK_PERMS (PF_R | PF_W)
+
+#endif /* stackinfo.h */
diff --git a/sysdeps/riscv/start.S b/sysdeps/riscv/start.S
new file mode 100644
index 0000000000..4635ddb5eb
--- /dev/null
+++ b/sysdeps/riscv/start.S
@@ -0,0 +1,81 @@
+/* Startup code compliant to the ELF RISC-V ABI.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 __ASSEMBLY__ 1
+#include <entry.h>
+#include <sysdep.h>
+#include <sys/asm.h>
+
+/* The entry point's job is to call __libc_start_main. Per the ABI,
+ a0 contains the address of a function to be passed to atexit.
+ __libc_start_main wants this in a5. */
+
+ENTRY (ENTRY_POINT)
+ call .Lload_gp
+ mv a5, a0 /* rtld_fini. */
+ /* main may be in a shared library. */
+ la a0, main
+ REG_L a1, 0(sp) /* argc. */
+ addi a2, sp, SZREG /* argv. */
+ andi sp, sp, ALMASK /* Align stack. */
+ lla a3, __libc_csu_init
+ lla a4, __libc_csu_fini
+ mv a6, sp /* stack_end. */
+
+ tail __libc_start_main@plt
+END (ENTRY_POINT)
+
+/* Dynamic links need the global pointer to be initialized prior to calling
+ any shared library's initializers, so we use preinit_array to load it.
+ This doesn't cut it for static links, though, since the global pointer
+ needs to be initialized before calling __libc_start_main in that case.
+ So we redundantly initialize it at the beginning of _start. */
+
+.Lload_gp:
+.option push
+.option norelax
+ lla gp, __global_pointer$
+.option pop
+ ret
+
+ .section .preinit_array,"aw"
+ .dc.a .Lload_gp
+
+/* Define a symbol for the first piece of initialized data. */
+ .data
+ .globl __data_start
+__data_start:
+ .weak data_start
+ data_start = __data_start
diff --git a/sysdeps/riscv/sys/asm.h b/sysdeps/riscv/sys/asm.h
new file mode 100644
index 0000000000..ddb84b683b
--- /dev/null
+++ b/sysdeps/riscv/sys/asm.h
@@ -0,0 +1,63 @@
+/* Miscellaneous macros.
+ Copyright (C) 2000-2018 Free Software 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 _SYS_ASM_H
+#define _SYS_ASM_H
+
+/* Macros to handle different pointer/register sizes for 32/64-bit code. */
+#if __riscv_xlen == 64
+# define PTRLOG 3
+# define SZREG 8
+# define REG_S sd
+# define REG_L ld
+#elif __riscv_xlen == 32
+# error "rv32i-based targets are not supported"
+#else
+# error __riscv_xlen must equal 32 or 64
+#endif
+
+#if !defined __riscv_float_abi_soft
+/* For ABI uniformity, reserve 8 bytes for floats, even if double-precision
+ floating-point is not supported in hardware. */
+# if defined __riscv_float_abi_double
+# define FREG_L fld
+# define FREG_S fsd
+# define SZFREG 8
+# else
+# error unsupported FLEN
+# endif
+#endif
+
+/* Declare leaf routine. */
+#define LEAF(symbol) \
+ .globl symbol; \
+ .align 2; \
+ .type symbol,@function; \
+symbol: \
+ cfi_startproc;
+
+/* Mark end of function. */
+#undef END
+#define END(function) \
+ cfi_endproc; \
+ .size function,.-function
+
+/* Stack alignment. */
+#define ALMASK ~15
+
+#endif /* sys/asm.h */
diff --git a/sysdeps/riscv/tininess.h b/sysdeps/riscv/tininess.h
new file mode 100644
index 0000000000..1db37790f8
--- /dev/null
+++ b/sysdeps/riscv/tininess.h
@@ -0,0 +1 @@
+#define TININESS_AFTER_ROUNDING 1
diff --git a/sysdeps/riscv/tls-macros.h b/sysdeps/riscv/tls-macros.h
new file mode 100644
index 0000000000..7f0dd926d0
--- /dev/null
+++ b/sysdeps/riscv/tls-macros.h
@@ -0,0 +1,47 @@
+/* Macros to support TLS testing in times of missing compiler support.
+ Copyright (C) 2017-2018 Free Software 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/cdefs.h>
+#include <sys/asm.h>
+#include <sysdep.h>
+#include "dl-tls.h"
+
+#define TLS_GD(x) \
+ ({ void *__result; \
+ asm ("la.tls.gd %0, " #x "\n\t" \
+ : "=r" (__result)); \
+ __tls_get_addr (__result); })
+
+#define TLS_LD(x) TLS_GD(x)
+
+#define TLS_IE(x) \
+ ({ void *__result; \
+ asm ("la.tls.ie %0, " #x "\n\t" \
+ "add %0, %0, tp\n\t" \
+ : "=r" (__result)); \
+ __result; })
+
+#define TLS_LE(x) \
+ ({ void *__result; \
+ asm ("lui %0, %%tprel_hi(" #x ")\n\t" \
+ "add %0, %0, tp, %%tprel_add(" #x ")\n\t" \
+ "addi %0, %0, %%tprel_lo(" #x ")\n\t" \
+ : "=r" (__result)); \
+ __result; })
diff --git a/sysdeps/riscv/tst-audit.h b/sysdeps/riscv/tst-audit.h
new file mode 100644
index 0000000000..7cce56d104
--- /dev/null
+++ b/sysdeps/riscv/tst-audit.h
@@ -0,0 +1,23 @@
+/* Definitions for testing PLT entry/exit auditing. RISC-V version.
+ Copyright (C) 2005-2018 Free Software 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 pltenter la_riscv_gnu_pltenter
+#define pltexit la_riscv_gnu_pltexit
+#define La_regs La_riscv_regs
+#define La_retval La_riscv_retval
+#define int_retval lrv_a0
diff --git a/sysdeps/s390/Makefile b/sysdeps/s390/Makefile
new file mode 100644
index 0000000000..8a54f88cd7
--- /dev/null
+++ b/sysdeps/s390/Makefile
@@ -0,0 +1,31 @@
+ifeq ($(subdir),iconvdata)
+ISO-8859-1_CP037_Z900-routines := iso-8859-1_cp037_z900
+ISO-8859-1_CP037_Z900-map := gconv.map
+
+UTF8_UTF32_Z9-routines := utf8-utf32-z9
+UTF8_UTF32_Z9-map := gconv.map
+
+UTF16_UTF32_Z9-routines := utf16-utf32-z9
+UTF16_UTF32_Z9-map := gconv.map
+
+UTF8_UTF16_Z9-routines := utf8-utf16-z9
+UTF8_UTF16_Z9-map := gconv.map
+
+s390x-iconv-modules = ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9 UTF16_UTF32_Z9 UTF8_UTF32_Z9
+
+extra-modules-left += $(s390x-iconv-modules)
+include extra-module.mk
+
+cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines))
+lib := iconvdata
+include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
+
+extra-objs += $(addsuffix .so, $(s390x-iconv-modules))
+install-others += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
+
+$(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules)) : \
+$(inst_gconvdir)/%.so: $(objpfx)%.so $(+force)
+ $(do-install-program)
+
+sysdeps-gconv-modules = ../sysdeps/s390/gconv-modules
+endif
diff --git a/sysdeps/s390/asm-syntax.h b/sysdeps/s390/asm-syntax.h
index 64a03b7419..2c37abf483 100644
--- a/sysdeps/s390/asm-syntax.h
+++ b/sysdeps/s390/asm-syntax.h
@@ -1,5 +1,5 @@
/* Definitions for S/390 syntax variations.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in the GNU MP Library.
diff --git a/sysdeps/s390/atomic-machine.h b/sysdeps/s390/atomic-machine.h
index 4ba41077e4..b80b55ecd2 100644
--- a/sysdeps/s390/atomic-machine.h
+++ b/sysdeps/s390/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -43,78 +43,119 @@ typedef uintptr_t uatomicptr_t;
typedef intmax_t atomic_max_t;
typedef uintmax_t uatomic_max_t;
-#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* Activate all C11 atomic builtins.
+ Note:
+ E.g. in nptl/pthread_key_delete.c if compiled with GCCs 6 and before,
+ an extra stack-frame is generated and the old value is stored on stack
+ before cs instruction but it never loads this value from stack.
+ An unreleased GCC 7 omit those stack operations.
-#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
- (abort (), (__typeof (*mem)) 0)
+ E.g. in nptl/pthread_once.c the condition code of cs instruction is
+ evaluated by a sequence of ipm, sra, compare and jump instructions instead
+ of one conditional jump instruction. This also occurs with an unreleased
+ GCC 7.
-#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
- (abort (), (__typeof (*mem)) 0)
-
-#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
- ({ __typeof (mem) __archmem = (mem); \
- __typeof (*mem) __archold = (oldval); \
- __asm__ __volatile__ ("cs %0,%2,%1" \
- : "+d" (__archold), "=Q" (*__archmem) \
- : "d" (newval), "m" (*__archmem) : "cc", "memory" ); \
- __archold; })
+ The atomic_fetch_abc_def C11 builtins are now using load-and-abc instructions
+ on z196 zarch and higher cpus instead of a loop with compare-and-swap
+ instruction. */
+#define USE_ATOMIC_COMPILER_BUILTINS 1
#ifdef __s390x__
# define __HAVE_64B_ATOMICS 1
-# define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
- ({ __typeof (mem) __archmem = (mem); \
- __typeof (*mem) __archold = (oldval); \
- __asm__ __volatile__ ("csg %0,%2,%1" \
- : "+d" (__archold), "=Q" (*__archmem) \
- : "d" ((long) (newval)), "m" (*__archmem) : "cc", "memory" ); \
- __archold; })
#else
# define __HAVE_64B_ATOMICS 0
-/* For 31 bit we do not really need 64-bit compare-and-exchange. We can
- implement them by use of the csd instruction. The straightforward
- implementation causes warnings so we skip the definition for now. */
-# define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
- (abort (), (__typeof (*mem)) 0)
#endif
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
+/* Implement some of the non-C11 atomic macros from include/atomic.h
+ with help of the C11 atomic builtins. The other non-C11 atomic macros
+ are using the macros defined here. */
+
+/* Atomically store NEWVAL in *MEM if *MEM is equal to OLDVAL.
+ Return the old *MEM value. */
+#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ ({ __atomic_check_size((mem)); \
+ typeof ((__typeof (*(mem))) *(mem)) __atg1_oldval = (oldval); \
+ __atomic_compare_exchange_n (mem, (void *) &__atg1_oldval, \
+ newval, 1, __ATOMIC_ACQUIRE, \
+ __ATOMIC_RELAXED); \
+ __atg1_oldval; })
+#define atomic_compare_and_exchange_val_rel(mem, newval, oldval) \
+ ({ __atomic_check_size((mem)); \
+ typeof ((__typeof (*(mem))) *(mem)) __atg1_2_oldval = (oldval); \
+ __atomic_compare_exchange_n (mem, (void *) &__atg1_2_oldval, \
+ newval, 1, __ATOMIC_RELEASE, \
+ __ATOMIC_RELAXED); \
+ __atg1_2_oldval; })
+
+/* Atomically store NEWVAL in *MEM if *MEM is equal to OLDVAL.
+ Return zero if *MEM was changed or non-zero if no exchange happened. */
+#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ ({ __atomic_check_size((mem)); \
+ typeof ((__typeof (*(mem))) *(mem)) __atg2_oldval = (oldval); \
+ !__atomic_compare_exchange_n (mem, (void *) &__atg2_oldval, newval, \
+ 1, __ATOMIC_ACQUIRE, \
+ __ATOMIC_RELAXED); })
+#define catomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ atomic_compare_and_exchange_bool_acq (mem, newval, oldval)
+
/* Store NEWVALUE in *MEM and return the old value. */
-/* On s390, the atomic_exchange_acq is different from generic implementation,
- because the generic one does not use the condition-code of cs-instruction
- to determine if looping is needed. Instead it saves the old-value and
- compares it against old-value returned by cs-instruction. */
-#ifdef __s390x__
-# define atomic_exchange_acq(mem, newvalue) \
- ({ __typeof (mem) __atg5_memp = (mem); \
- __typeof (*(mem)) __atg5_oldval = *__atg5_memp; \
- __typeof (*(mem)) __atg5_value = (newvalue); \
- if (sizeof (*mem) == 4) \
- __asm__ __volatile__ ("0: cs %0,%2,%1\n" \
- " jl 0b" \
- : "+d" (__atg5_oldval), "=Q" (*__atg5_memp) \
- : "d" (__atg5_value), "m" (*__atg5_memp) \
- : "cc", "memory" ); \
- else if (sizeof (*mem) == 8) \
- __asm__ __volatile__ ("0: csg %0,%2,%1\n" \
- " jl 0b" \
- : "+d" ( __atg5_oldval), "=Q" (*__atg5_memp) \
- : "d" ((long) __atg5_value), "m" (*__atg5_memp) \
- : "cc", "memory" ); \
- else \
- abort (); \
- __atg5_oldval; })
-#else
-# define atomic_exchange_acq(mem, newvalue) \
- ({ __typeof (mem) __atg5_memp = (mem); \
- __typeof (*(mem)) __atg5_oldval = *__atg5_memp; \
- __typeof (*(mem)) __atg5_value = (newvalue); \
- if (sizeof (*mem) == 4) \
- __asm__ __volatile__ ("0: cs %0,%2,%1\n" \
- " jl 0b" \
- : "+d" (__atg5_oldval), "=Q" (*__atg5_memp) \
- : "d" (__atg5_value), "m" (*__atg5_memp) \
- : "cc", "memory" ); \
- else \
- abort (); \
- __atg5_oldval; })
-#endif
+#define atomic_exchange_acq(mem, newvalue) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_exchange_n (mem, newvalue, __ATOMIC_ACQUIRE); })
+#define atomic_exchange_rel(mem, newvalue) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_exchange_n (mem, newvalue, __ATOMIC_RELEASE); })
+
+/* Add VALUE to *MEM and return the old value of *MEM. */
+/* The gcc builtin uses load-and-add instruction on z196 zarch and higher cpus
+ instead of a loop with compare-and-swap instruction. */
+# define atomic_exchange_and_add_acq(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_add ((mem), (operand), __ATOMIC_ACQUIRE); })
+# define atomic_exchange_and_add_rel(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_add ((mem), (operand), __ATOMIC_RELEASE); })
+#define catomic_exchange_and_add(mem, value) \
+ atomic_exchange_and_add (mem, value)
+
+/* Atomically *mem |= mask and return the old value of *mem. */
+/* The gcc builtin uses load-and-or instruction on z196 zarch and higher cpus
+ instead of a loop with compare-and-swap instruction. */
+#define atomic_or_val(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_or ((mem), (operand), __ATOMIC_ACQUIRE); })
+/* Atomically *mem |= mask. */
+#define atomic_or(mem, mask) \
+ do { \
+ atomic_or_val (mem, mask); \
+ } while (0)
+#define catomic_or(mem, mask) \
+ atomic_or (mem, mask)
+
+/* Atomically *mem |= 1 << bit and return true if the bit was set in old value
+ of *mem. */
+/* The load-and-or instruction is used on z196 zarch and higher cpus
+ instead of a loop with compare-and-swap instruction. */
+#define atomic_bit_test_set(mem, bit) \
+ ({ __typeof (*(mem)) __atg14_old; \
+ __typeof (mem) __atg14_memp = (mem); \
+ __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit)); \
+ __atg14_old = atomic_or_val (__atg14_memp, __atg14_mask); \
+ __atg14_old & __atg14_mask; })
+
+/* Atomically *mem &= mask and return the old value of *mem. */
+/* The gcc builtin uses load-and-and instruction on z196 zarch and higher cpus
+ instead of a loop with compare-and-swap instruction. */
+#define atomic_and_val(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_and ((mem), (operand), __ATOMIC_ACQUIRE); })
+/* Atomically *mem &= mask. */
+#define atomic_and(mem, mask) \
+ do { \
+ atomic_and_val (mem, mask); \
+ } while (0)
+#define catomic_and(mem, mask) \
+ atomic_and(mem, mask)
diff --git a/sysdeps/s390/bits/byteswap-16.h b/sysdeps/s390/bits/byteswap-16.h
deleted file mode 100644
index 87514d1b92..0000000000
--- a/sysdeps/s390/bits/byteswap-16.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Macros to swap the order of bytes in 16-bit integer values. s390 version
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 _BITS_BYTESWAP_H
-# error "Never use <bits/byteswap-16.h> directly; include <byteswap.h> instead."
-#endif
-
-#include <bits/wordsize.h>
-
-/* Swap bytes in 16 bit value. */
-#if defined __GNUC__ && __GNUC__ >= 2
-# if __WORDSIZE == 64
-# define __bswap_16(x) \
- (__extension__ \
- ({ unsigned short int __v, __x = (unsigned short int) (x); \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_16 (__x); \
- else { \
- unsigned short int __tmp = (unsigned short int) (__x); \
- __asm__ __volatile__ ( \
- "lrvh %0,%1" \
- : "=&d" (__v) : "m" (__tmp) ); \
- } \
- __v; }))
-# else
-# define __bswap_16(x) \
- (__extension__ \
- ({ unsigned short int __v, __x = (unsigned short int) (x); \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_16 (__x); \
- else { \
- unsigned short int __tmp = (unsigned short int) (__x); \
- __asm__ __volatile__ ( \
- "sr %0,%0\n" \
- "la 1,%1\n" \
- "icm %0,2,1(1)\n" \
- "ic %0,0(1)" \
- : "=&d" (__v) : "m" (__tmp) : "1"); \
- } \
- __v; }))
-# endif
-#else
-/* This is better than nothing. */
-static __inline unsigned short int
-__bswap_16 (unsigned short int __bsx)
-{
- return __bswap_constant_16 (__bsx);
-}
-#endif
diff --git a/sysdeps/s390/bits/byteswap.h b/sysdeps/s390/bits/byteswap.h
deleted file mode 100644
index 6a8cb9d82b..0000000000
--- a/sysdeps/s390/bits/byteswap.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Macros to swap the order of bytes in integer values. s390 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
-# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
-#endif
-
-#include <bits/wordsize.h>
-
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H 1
-
-#define __bswap_constant_16(x) \
- ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
-
-/* Get __bswap_16. */
-#include <bits/byteswap-16.h>
-
-/* Swap bytes in 32 bit value. */
-#define __bswap_constant_32(x) \
- ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
- (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
-
-#if defined __GNUC__ && __GNUC__ >= 2
-# if __WORDSIZE == 64
-# define __bswap_32(x) \
- (__extension__ \
- ({ unsigned int __v, __x = (x); \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_32 (__x); \
- else { \
- unsigned int __tmp = (unsigned int) (__x); \
- __asm__ __volatile__ ( \
- "lrv %0,%1" \
- : "=&d" (__v) : "m" (__tmp)); \
- } \
- __v; }))
-# else
-# define __bswap_32(x) \
- (__extension__ \
- ({ unsigned int __v, __x = (x); \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_32 (__x); \
- else { \
- unsigned int __tmp = (unsigned int) (__x); \
- __asm__ __volatile__ ( \
- "la 1,%1\n" \
- "icm %0,8,3(1)\n" \
- "icm %0,4,2(1)\n" \
- "icm %0,2,1(1)\n" \
- "ic %0,0(1)" \
- : "=&d" (__v) : "m" (__tmp) : "1"); \
- } \
- __v; }))
-# endif
-#else
-static __inline unsigned int
-__bswap_32 (unsigned int __bsx)
-{
- return __bswap_constant_32 (__bsx);
-}
-#endif
-
-/* Swap bytes in 64 bit value. */
-#if defined __GNUC__ && __GNUC__ >= 2
-# define __bswap_constant_64(x) \
- (__extension__ ((((x) & 0xff00000000000000ul) >> 56) \
- | (((x) & 0x00ff000000000000ul) >> 40) \
- | (((x) & 0x0000ff0000000000ul) >> 24) \
- | (((x) & 0x000000ff00000000ul) >> 8) \
- | (((x) & 0x00000000ff000000ul) << 8) \
- | (((x) & 0x0000000000ff0000ul) << 24) \
- | (((x) & 0x000000000000ff00ul) << 40) \
- | (((x) & 0x00000000000000fful) << 56)))
-
-# if __WORDSIZE == 64
-# define __bswap_64(x) \
- (__extension__ \
- ({ unsigned long __w, __x = (x); \
- if (__builtin_constant_p (x)) \
- __w = __bswap_constant_64 (__x); \
- else { \
- unsigned long __tmp = (unsigned long) (__x); \
- __asm__ __volatile__ ( \
- "lrvg %0,%1" \
- : "=&d" (__w) : "m" (__tmp)); \
- } \
- __w; }))
-# else
-# define __bswap_64(x) \
- __extension__ \
- ({ union { unsigned long long int __ll; \
- unsigned long int __l[2]; } __w, __r; \
- __w.__ll = (x); \
- __r.__l[0] = __bswap_32 (__w.__l[1]); \
- __r.__l[1] = __bswap_32 (__w.__l[0]); \
- __r.__ll; })
-# endif
-#else
-# define __bswap_constant_64(x) \
- ((((x) & 0xff00000000000000ull) >> 56) \
- | (((x) & 0x00ff000000000000ull) >> 40) \
- | (((x) & 0x0000ff0000000000ull) >> 24) \
- | (((x) & 0x000000ff00000000ull) >> 8) \
- | (((x) & 0x00000000ff000000ull) << 8) \
- | (((x) & 0x0000000000ff0000ull) << 24) \
- | (((x) & 0x000000000000ff00ull) << 40) \
- | (((x) & 0x00000000000000ffull) << 56))
-
-__extension__
-static __inline unsigned long long int
-__bswap_64 (unsigned long long int __bsx)
-{
- return __bswap_constant_64 (__bsx);
-}
-#endif
-
-#endif /* _BITS_BYTESWAP_H */
diff --git a/sysdeps/s390/bits/flt-eval-method.h b/sysdeps/s390/bits/flt-eval-method.h
new file mode 100644
index 0000000000..b0663e80cc
--- /dev/null
+++ b/sysdeps/s390/bits/flt-eval-method.h
@@ -0,0 +1,24 @@
+/* Define __GLIBC_FLT_EVAL_METHOD. S/390 version.
+ Copyright (C) 2016-2018 Free Software 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/flt-eval-method.h> directly; include <math.h> instead."
+#endif
+
+/* This value is used because of a historical mistake. */
+#define __GLIBC_FLT_EVAL_METHOD 1
diff --git a/sysdeps/s390/bits/link.h b/sysdeps/s390/bits/link.h
index 2ef7f44225..8d17e9245b 100644
--- a/sysdeps/s390/bits/link.h
+++ b/sysdeps/s390/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,9 @@
# error "Never include <bits/link.h> directly; use <link.h> instead."
#endif
+#if defined HAVE_S390_VX_ASM_SUPPORT
+typedef char La_s390_vr[16];
+#endif
#if __ELF_NATIVE_CLASS == 32
@@ -32,6 +35,16 @@ typedef struct La_s390_32_regs
uint32_t lr_r6;
double lr_fp0;
double lr_fp2;
+# if defined HAVE_S390_VX_ASM_SUPPORT
+ La_s390_vr lr_v24;
+ La_s390_vr lr_v25;
+ La_s390_vr lr_v26;
+ La_s390_vr lr_v27;
+ La_s390_vr lr_v28;
+ La_s390_vr lr_v29;
+ La_s390_vr lr_v30;
+ La_s390_vr lr_v31;
+# endif
} La_s390_32_regs;
/* Return values for calls from PLT on s390-32. */
@@ -40,6 +53,9 @@ typedef struct La_s390_32_retval
uint32_t lrv_r2;
uint32_t lrv_r3;
double lrv_fp0;
+# if defined HAVE_S390_VX_ASM_SUPPORT
+ La_s390_vr lrv_v24;
+# endif
} La_s390_32_retval;
@@ -77,6 +93,16 @@ typedef struct La_s390_64_regs
double lr_fp2;
double lr_fp4;
double lr_fp6;
+# if defined HAVE_S390_VX_ASM_SUPPORT
+ La_s390_vr lr_v24;
+ La_s390_vr lr_v25;
+ La_s390_vr lr_v26;
+ La_s390_vr lr_v27;
+ La_s390_vr lr_v28;
+ La_s390_vr lr_v29;
+ La_s390_vr lr_v30;
+ La_s390_vr lr_v31;
+# endif
} La_s390_64_regs;
/* Return values for calls from PLT on s390-64. */
@@ -84,6 +110,9 @@ typedef struct La_s390_64_retval
{
uint64_t lrv_r2;
double lrv_fp0;
+# if defined HAVE_S390_VX_ASM_SUPPORT
+ La_s390_vr lrv_v24;
+# endif
} La_s390_64_retval;
diff --git a/sysdeps/s390/bits/mathdef.h b/sysdeps/s390/bits/mathdef.h
deleted file mode 100644
index 8c47ade208..0000000000
--- a/sysdeps/s390/bits/mathdef.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* Normally, there is no long double type and the `float' and `double'
- expressions are evaluated as `double'. */
-typedef double float_t; /* `float' expressions are evaluated as
- `double'. */
-typedef double double_t; /* `double' expressions are evaluated as
- `double'. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647)
-# define FP_ILOGBNAN 2147483647
-
-#endif /* ISO C99 */
diff --git a/sysdeps/s390/bits/setjmp.h b/sysdeps/s390/bits/setjmp.h
index 8d29e8dbd8..07229c292f 100644
--- a/sysdeps/s390/bits/setjmp.h
+++ b/sysdeps/s390/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/bits/string.h b/sysdeps/s390/bits/string.h
deleted file mode 100644
index 39e0b7fe7c..0000000000
--- a/sysdeps/s390/bits/string.h
+++ /dev/null
@@ -1,252 +0,0 @@
-/* Optimized, inlined string functions. S/390 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* Use the unaligned string inline ABI. */
-#define _STRING_INLINE_unaligned 1
-
-/* We only provide optimizations if the user selects them and if
- GNU CC is used. */
-#if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \
- && defined __GNUC__ && __GNUC__ >= 2
-
-#ifndef __STRING_INLINE
-# ifndef __extern_inline
-# define __STRING_INLINE inline
-# else
-# define __STRING_INLINE __extern_inline
-# endif
-#endif
-
-#define _HAVE_STRING_ARCH_strlen 1
-#ifndef _FORCE_INLINES
-#define strlen(str) __strlen_g ((str))
-
-__STRING_INLINE size_t __strlen_g (const char *) __asm__ ("strlen");
-
-__STRING_INLINE size_t
-__strlen_g (const char *__str)
-{
- char *__ptr, *__tmp;
-
- __ptr = (char *) 0;
- __tmp = (char *) __str;
- __asm__ __volatile__ (" la 0,0\n"
- "0: srst %0,%1\n"
- " jo 0b\n"
- : "+&a" (__ptr), "+&a" (__tmp) :
- : "cc", "memory", "0" );
- return (size_t) (__ptr - __str);
-}
-#endif
-
-/* Copy SRC to DEST. */
-#define _HAVE_STRING_ARCH_strcpy 1
-#ifndef _FORCE_INLINES
-#define strcpy(dest, src) __strcpy_g ((dest), (src))
-
-__STRING_INLINE char *__strcpy_g (char *, const char *) __asm__ ("strcpy");
-
-__STRING_INLINE char *
-__strcpy_g (char *__dest, const char *__src)
-{
- char *tmp = __dest;
-
- __asm__ __volatile__ (" la 0,0\n"
- "0: mvst %0,%1\n"
- " jo 0b"
- : "+&a" (__dest), "+&a" (__src) :
- : "cc", "memory", "0" );
- return tmp;
-}
-#endif
-
-#define _HAVE_STRING_ARCH_strncpy 1
-#ifndef _FORCE_INLINES
-#define strncpy(dest, src, n) __strncpy_g ((dest), (src), (n))
-
-__STRING_INLINE char *__strncpy_g (char *, const char *, size_t)
- __asm__ ("strncpy");
-
-__STRING_INLINE char *
-__strncpy_g (char *__dest, const char *__src, size_t __n)
-{
- char *__ret = __dest;
- char *__ptr;
- size_t __diff;
-
- if (__n > 0) {
- __diff = (size_t) (__dest - __src);
- __ptr = (char *) __src;
- __asm__ __volatile__ (" j 1f\n"
- "0: la %0,1(%0)\n"
- "1: icm 0,1,0(%0)\n"
- " stc 0,0(%2,%0)\n"
- " jz 3f\n"
-#if defined(__s390x__)
- " brctg %1,0b\n"
-#else
- " brct %1,0b\n"
-#endif
- " j 4f\n"
- "2: la %0,1(%0)\n"
- " stc 0,0(%2,%0)\n"
-#if defined(__s390x__)
- "3: brctg %1,2b\n"
-#else
- "3: brct %1,2b\n"
-#endif
- "4:"
- : "+&a" (__ptr), "+&a" (__n) : "a" (__diff)
- : "cc", "memory", "0" );
- }
- return __ret;
-}
-#endif
-
-/* Append SRC onto DEST. */
-#define _HAVE_STRING_ARCH_strcat 1
-#ifndef _FORCE_INLINES
-#define strcat(dest, src) __strcat_g ((dest), (src))
-
-__STRING_INLINE char *__strcat_g (char *, const char *) __asm__ ("strcat");
-
-__STRING_INLINE char *
-__strcat_g (char *__dest, const char *__src)
-{
- char *__ret = __dest;
- char *__ptr, *__tmp;
-
- /* Move __ptr to the end of __dest. */
- __ptr = (char *) 0;
- __tmp = __dest;
- __asm__ __volatile__ (" la 0,0\n"
- "0: srst %0,%1\n"
- " jo 0b\n"
- : "+&a" (__ptr), "+&a" (__tmp) :
- : "cc", "0" );
-
- /* Now do the copy. */
- __asm__ __volatile__ (" la 0,0\n"
- "0: mvst %0,%1\n"
- " jo 0b"
- : "+&a" (__ptr), "+&a" (__src) :
- : "cc", "memory", "0" );
- return __ret;
-}
-#endif
-
-/* Append no more than N characters from SRC onto DEST. */
-#define _HAVE_STRING_ARCH_strncat 1
-#ifndef _FORCE_INLINES
-#define strncat(dest, src, n) __strncat_g ((dest), (src), (n))
-
-__STRING_INLINE char *__strncat_g (char *, const char *, size_t)
- __asm__ ("strncat");
-
-__STRING_INLINE char *
-__strncat_g (char *__dest, const char *__src, size_t __n)
-{
- char *__ret = __dest;
- char *__ptr, *__tmp;
- size_t __diff;
-
- if (__n > 0) {
- /* Move __ptr to the end of __dest. */
- __ptr = (char *) 0;
- __tmp = __dest;
- __asm__ __volatile__ (" la 0,0\n"
- "0: srst %0,%1\n"
- " jo 0b\n"
- : "+&a" (__ptr), "+&a" (__tmp) :
- : "cc", "memory", "0" );
-
- __diff = (size_t) (__ptr - __src);
- __tmp = (char *) __src;
- __asm__ __volatile__ (" j 1f\n"
- "0: la %0,1(%0)\n"
- "1: icm 0,1,0(%0)\n"
- " stc 0,0(%2,%0)\n"
- " jz 2f\n"
-#if defined(__s390x__)
- " brctg %1,0b\n"
-#else
- " brct %1,0b\n"
-#endif
- " slr 0,0\n"
- " stc 0,1(%2,%0)\n"
- "2:"
- : "+&a" (__tmp), "+&a" (__n) : "a" (__diff)
- : "cc", "memory", "0" );
-
- }
- return __ret;
-}
-#endif
-
-/* Search N bytes of S for C. */
-#define _HAVE_STRING_ARCH_memchr 1
-#ifndef _FORCE_INLINES
-__STRING_INLINE void *
-memchr (const void *__str, int __c, size_t __n)
-{
- char *__ptr, *__tmp;
-
- __tmp = (char *) __str;
- __ptr = (char *) __tmp + __n;
- __asm__ __volatile__ (" lhi 0,0xff\n"
- " nr 0,%2\n"
- "0: srst %0,%1\n"
- " jo 0b\n"
- " brc 13,1f\n"
- " la %0,0\n"
- "1:"
- : "+&a" (__ptr), "+&a" (__tmp) : "d" (__c)
- : "cc", "memory", "0" );
- return __ptr;
-}
-#endif
-
-/* Compare S1 and S2. */
-#define _HAVE_STRING_ARCH_strcmp 1
-#ifndef _FORCE_INLINES
-__STRING_INLINE int
-strcmp (const char *__s1, const char *__s2)
-{
- char *__p1, *__p2;
- int __ret;
-
- __p1 = (char *) __s1;
- __p2 = (char *) __s2;
- __asm__ __volatile__ (" slr 0,0\n"
- "0: clst %1,%2\n"
- " jo 0b\n"
- " ipm %0\n"
- " srl %0,28"
- : "=d" (__ret), "+&a" (__p1), "+&a" (__p2) :
- : "cc", "memory", "0" );
- __ret = (__ret == 0) ? 0 : (__ret == 1) ? -1 : 1;
- return __ret;
-}
-#endif
-
-#endif /* Use string inlines && GNU CC. */
diff --git a/sysdeps/s390/bits/xtitypes.h b/sysdeps/s390/bits/xtitypes.h
index 3c9606a636..462b126d11 100644
--- a/sysdeps/s390/bits/xtitypes.h
+++ b/sysdeps/s390/bits/xtitypes.h
@@ -1,5 +1,5 @@
/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>. S390/S390x
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure
index 0fa54c3061..74b415f2ab 100644
--- a/sysdeps/s390/configure
+++ b/sysdeps/s390/configure
@@ -4,71 +4,6 @@
$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
-for ac_prog in $AS
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AS="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AS" && break
-done
-
-if test -z "$AS"; then
- ac_verc_fail=yes
-else
- # Found it, now check the version.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $AS" >&5
-$as_echo_n "checking version of $AS... " >&6; }
- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 2.2[4-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
-$as_echo "$ac_prog_version" >&6; }
-fi
-if test $ac_verc_fail = yes; then
- critic_missing="$critic_missing The program AS is required in version >= 2.24 for target S390."
-fi
-
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_tbegin" >&5
$as_echo_n "checking for __builtin_tbegin... " >&6; }
if ${libc_cv_gcc_builtin_tbegin+:} false; then :
@@ -100,7 +35,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_builtin_tbegin" >&5
$as_echo "$libc_cv_gcc_builtin_tbegin" >&6; }
-if test "$enable_lock_elision" = yes && test "$libc_cv_gcc_builtin_tbegin" = no ; then
+if test "$libc_cv_gcc_builtin_tbegin" = no ; then
critic_missing="$critic_missing The used GCC has no support for __builtin_tbegin, which is needed for lock-elision on target S390."
fi
@@ -144,6 +79,74 @@ else
$as_echo "$as_me: WARNING: Use binutils with vector-support in order to use optimized implementations." >&2;}
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 vector support in gcc" >&5
+$as_echo_n "checking for S390 vector support in gcc... " >&6; }
+if ${libc_cv_gcc_s390_vx+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.c <<\EOF
+void testvecclobber ()
+{
+ __asm__ ("" : : : "v16");
+}
+EOF
+if { ac_try='${CC-cc} --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_gcc_s390_vx=yes
+else
+ libc_cv_gcc_s390_vx=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_s390_vx" >&5
+$as_echo "$libc_cv_gcc_s390_vx" >&6; }
+
+if test "$libc_cv_gcc_s390_vx" = yes ;
+then
+ $as_echo "#define HAVE_S390_VX_GCC_SUPPORT 1" >>confdefs.h
+
+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 4da134e9a0..1cdb021282 100644
--- a/sysdeps/s390/configure.ac
+++ b/sysdeps/s390/configure.ac
@@ -5,12 +5,6 @@ dnl It is always possible to access static and hidden symbols in an
dnl position independent way.
AC_DEFINE(PI_STATIC_AND_HIDDEN)
-dnl Accept as 2.24 or newer.
-AC_CHECK_PROG_VER(AS, $AS, --version,
- [GNU assembler.* \([0-9]*\.[0-9.]*\)],
- [2.2[4-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*], critic_missing="$critic_missing The program AS is required in version >= 2.24 for target S390.")
-
-
AC_CACHE_CHECK(for __builtin_tbegin, libc_cv_gcc_builtin_tbegin, [dnl
cat > conftest.c <<\EOF
#include <htmintrin.h>
@@ -32,7 +26,7 @@ else
fi
rm -f conftest* ])
-if test "$enable_lock_elision" = yes && test "$libc_cv_gcc_builtin_tbegin" = no ; then
+if test "$libc_cv_gcc_builtin_tbegin" = no ; then
critic_missing="$critic_missing The used GCC has no support for __builtin_tbegin, which is needed for lock-elision on target S390."
fi
@@ -64,6 +58,53 @@ else
AC_MSG_WARN([Use binutils with vector-support in order to use optimized implementations.])
fi
+AC_CACHE_CHECK(for S390 vector support in gcc, libc_cv_gcc_s390_vx, [dnl
+cat > conftest.c <<\EOF
+void testvecclobber ()
+{
+ __asm__ ("" : : : "v16");
+}
+EOF
+dnl
+dnl test, if gcc supports S390 vector registers as clobber in inline assembly
+if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
+then
+ libc_cv_gcc_s390_vx=yes
+else
+ libc_cv_gcc_s390_vx=no
+fi
+rm -f conftest* ])
+
+if test "$libc_cv_gcc_s390_vx" = yes ;
+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/dl-irel.h b/sysdeps/s390/dl-irel.h
index 38c5761a6e..d8ba7ba427 100644
--- a/sysdeps/s390/dl-irel.h
+++ b/sysdeps/s390/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
Version for S/390 32 and 64 bit.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/dl-procinfo.c b/sysdeps/s390/dl-procinfo.c
index 22c4cf7a01..86c964caff 100644
--- a/sysdeps/s390/dl-procinfo.c
+++ b/sysdeps/s390/dl-procinfo.c
@@ -1,5 +1,5 @@
/* Data for s390 version of processor capability information.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2006.
@@ -46,11 +46,12 @@
#if !defined PROCINFO_DECL && defined SHARED
._dl_s390_cap_flags
#else
-PROCINFO_CLASS const char _dl_s390_cap_flags[12][9]
+PROCINFO_CLASS const char _dl_s390_cap_flags[15][9]
#endif
#ifndef PROCINFO_DECL
= {
- "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", "edat", "etf3eh", "highgprs", "te", "vx"
+ "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", "edat", "etf3eh",
+ "highgprs", "te", "vx", "vxd", "vxe", "gs"
}
#endif
#if !defined SHARED || defined PROCINFO_DECL
@@ -62,11 +63,11 @@ PROCINFO_CLASS const char _dl_s390_cap_flags[12][9]
#if !defined PROCINFO_DECL && defined SHARED
._dl_s390_platforms
#else
-PROCINFO_CLASS const char _dl_s390_platforms[8][7]
+PROCINFO_CLASS const char _dl_s390_platforms[9][7]
#endif
#ifndef PROCINFO_DECL
= {
- "g5", "z900", "z990", "z9-109", "z10", "z196", "zEC12", "z13"
+ "g5", "z900", "z990", "z9-109", "z10", "z196", "zEC12", "z13", "z14"
}
#endif
#if !defined SHARED || defined PROCINFO_DECL
diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h
index 4ae276e4ed..b0383bfb4c 100644
--- a/sysdeps/s390/dl-procinfo.h
+++ b/sysdeps/s390/dl-procinfo.h
@@ -1,5 +1,5 @@
/* s390 version of processor capability information handling macros.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2006.
@@ -21,9 +21,9 @@
#define _DL_PROCINFO_H 1
#include <ldsodefs.h>
-#define _DL_HWCAP_COUNT 12
+#define _DL_HWCAP_COUNT 15
-#define _DL_PLATFORMS_COUNT 8
+#define _DL_PLATFORMS_COUNT 9
/* The kernel provides up to 32 capability bits with elf_hwcap. */
#define _DL_FIRST_PLATFORM 32
@@ -51,6 +51,9 @@ enum
HWCAP_S390_HIGH_GPRS = 1 << 9,
HWCAP_S390_TE = 1 << 10,
HWCAP_S390_VX = 1 << 11,
+ HWCAP_S390_VXD = 1 << 12,
+ HWCAP_S390_VXE = 1 << 13,
+ HWCAP_S390_GS = 1 << 14,
};
#define HWCAP_IMPORTANT (HWCAP_S390_ZARCH | HWCAP_S390_LDISP \
@@ -66,13 +69,6 @@ _dl_hwcap_string (int idx)
return GLRO(dl_s390_cap_flags)[idx];
};
-static inline const char *
-__attribute__ ((unused))
-_dl_platform_string (int idx)
-{
- return GLRO(dl_s390_platforms)[idx - _DL_FIRST_PLATFORM];
-};
-
static inline int
__attribute__ ((unused, always_inline))
_dl_string_hwcap (const char *str)
diff --git a/sysdeps/s390/dl-tls.h b/sysdeps/s390/dl-tls.h
index 503048a622..7a843f29ad 100644
--- a/sysdeps/s390/dl-tls.h
+++ b/sysdeps/s390/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. s390 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -102,6 +102,3 @@ extern void *__tls_get_addr_internal (tls_index *ti);
+ (unsigned long) __builtin_thread_pointer (); })
#endif
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/s390/ffs.c b/sysdeps/s390/ffs.c
index 7808185569..d46eec8e48 100644
--- a/sysdeps/s390/ffs.c
+++ b/sysdeps/s390/ffs.c
@@ -1,6 +1,6 @@
/* ffs -- find first set bit in a word, counted from least significant end.
S/390 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/fix-fp-int-convert-overflow.h b/sysdeps/s390/fix-fp-int-convert-overflow.h
index 61279edc19..b60d4c54ac 100644
--- a/sysdeps/s390/fix-fp-int-convert-overflow.h
+++ b/sysdeps/s390/fix-fp-int-convert-overflow.h
@@ -1,5 +1,5 @@
/* Fix for conversion of floating point to integer overflow. S390 version.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/fpu/bits/fenv.h b/sysdeps/s390/fpu/bits/fenv.h
index 6de74b9939..079e71f3a5 100644
--- a/sysdeps/s390/fpu/bits/fenv.h
+++ b/sysdeps/s390/fpu/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow <djbarrow@de.ibm.com>.
@@ -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/bits/mathinline.h b/sysdeps/s390/fpu/bits/mathinline.h
deleted file mode 100644
index 7c09a5c7da..0000000000
--- a/sysdeps/s390/fpu/bits/mathinline.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Inline math functions for s390.
- Copyright (C) 2004-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/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_inline
-#endif
-
-#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
- && defined __OPTIMIZE__
-
-#ifdef __USE_ISOC99
-
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
-}
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
- __extension__ union { double __d; long __i; } __u = { __d: __x };
- return __u.__i < 0;
-}
-
-# ifndef __NO_LONG_DOUBLE_MATH
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- __extension__ union { long double __l; int __i[4]; } __u = { __l: __x };
- return __u.__i[0] < 0;
-}
-# else
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- return __signbit ((double) __x);
-}
-# endif
-
-#endif /* C99 */
-
-/* This code is used internally in the GNU libc. */
-#ifdef __LIBC_INTERNAL_MATH_INLINES
-
-__MATH_INLINE double
-__NTH (__ieee754_sqrt (double x))
-{
- double res;
-
- __asm__ ( "sqdbr %0,%1" : "=f" (res) : "f" (x) );
- return res;
-}
-
-__MATH_INLINE float
-__NTH (__ieee754_sqrtf (float x))
-{
- float res;
-
- __asm__ ( "sqebr %0,%1" : "=f" (res) : "f" (x) );
- return res;
-}
-
-# if !defined __NO_LONG_DOUBLE_MATH
-__MATH_INLINE long double
-__NTH (sqrtl (long double __x))
-{
- long double res;
-
- __asm__ ( "sqxbr %0,%1" : "=f" (res) : "f" (__x) );
- return res;
-}
-# endif /* !__NO_LONG_DOUBLE_MATH */
-
-#endif /* __LIBC_INTERNAL_MATH_INLINES */
-
-#endif /* __NO_MATH_INLINES */
diff --git a/sysdeps/s390/fpu/e_sqrt.c b/sysdeps/s390/fpu/e_sqrt.c
index efdb2865b9..b8b362a6bb 100644
--- a/sysdeps/s390/fpu/e_sqrt.c
+++ b/sysdeps/s390/fpu/e_sqrt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/fpu/e_sqrtf.c b/sysdeps/s390/fpu/e_sqrtf.c
index 38160acc12..2c67e3e656 100644
--- a/sysdeps/s390/fpu/e_sqrtf.c
+++ b/sysdeps/s390/fpu/e_sqrtf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/fpu/e_sqrtl.c b/sysdeps/s390/fpu/e_sqrtl.c
index add859a3a8..209242b516 100644
--- a/sysdeps/s390/fpu/e_sqrtl.c
+++ b/sysdeps/s390/fpu/e_sqrtl.c
@@ -1,5 +1,5 @@
/* Square root. S/390 FPU version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/fpu/fclrexcpt.c b/sysdeps/s390/fpu/fclrexcpt.c
index b19899a2eb..27b7255a79 100644
--- a/sysdeps/s390/fpu/fclrexcpt.c
+++ b/sysdeps/s390/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/fpu/fedisblxcpt.c b/sysdeps/s390/fpu/fedisblxcpt.c
index d3b49789b9..fc0ac27cc3 100644
--- a/sysdeps/s390/fpu/fedisblxcpt.c
+++ b/sysdeps/s390/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
diff --git a/sysdeps/s390/fpu/feenablxcpt.c b/sysdeps/s390/fpu/feenablxcpt.c
index b9aab5976a..067d8e9fa3 100644
--- a/sysdeps/s390/fpu/feenablxcpt.c
+++ b/sysdeps/s390/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
diff --git a/sysdeps/s390/fpu/fegetenv.c b/sysdeps/s390/fpu/fegetenv.c
index 3b912b66cf..709fbd9c19 100644
--- a/sysdeps/s390/fpu/fegetenv.c
+++ b/sysdeps/s390/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
diff --git a/sysdeps/s390/fpu/fegetexcept.c b/sysdeps/s390/fpu/fegetexcept.c
index dc5033c550..0fd39f14e4 100644
--- a/sysdeps/s390/fpu/fegetexcept.c
+++ b/sysdeps/s390/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
diff --git a/sysdeps/s390/fpu/fegetmode.c b/sysdeps/s390/fpu/fegetmode.c
new file mode 100644
index 0000000000..d6a5feff3d
--- /dev/null
+++ b/sysdeps/s390/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. S/390 version.
+ Copyright (C) 2016-2018 Free Software 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/fegetround.c b/sysdeps/s390/fpu/fegetround.c
index bca8517577..3c38bc9189 100644
--- a/sysdeps/s390/fpu/fegetround.c
+++ b/sysdeps/s390/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
diff --git a/sysdeps/s390/fpu/feholdexcpt.c b/sysdeps/s390/fpu/feholdexcpt.c
index 2700028016..5daee5675d 100644
--- a/sysdeps/s390/fpu/feholdexcpt.c
+++ b/sysdeps/s390/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
@@ -24,7 +24,7 @@ int __feholdexcept (fenv_t *envp)
{
fexcept_t fpc;
/* Store the environment. */
- fegetenv (envp);
+ __fegetenv (envp);
/* Clear the current sticky bits as more than one exception
may be generated. */
fpc = envp->__fpc & ~(FPC_FLAGS_MASK | FPC_DXC_MASK);
diff --git a/sysdeps/s390/fpu/fenv_libc.h b/sysdeps/s390/fpu/fenv_libc.h
index dff8fd92e5..0b4b7aad99 100644
--- a/sysdeps/s390/fpu/fenv_libc.h
+++ b/sysdeps/s390/fpu/fenv_libc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
diff --git a/sysdeps/s390/fpu/fesetenv.c b/sysdeps/s390/fpu/fesetenv.c
index 694a538c1e..c6c275d79d 100644
--- a/sysdeps/s390/fpu/fesetenv.c
+++ b/sysdeps/s390/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
@@ -20,8 +20,6 @@
#include <fenv_libc.h>
#include <fpu_control.h>
#include <stddef.h>
-#include <asm/ptrace.h>
-#include <sys/ptrace.h>
#include <unistd.h>
int
diff --git a/sysdeps/s390/fpu/fesetexcept.c b/sysdeps/s390/fpu/fesetexcept.c
new file mode 100644
index 0000000000..e41853e25e
--- /dev/null
+++ b/sysdeps/s390/fpu/fesetexcept.c
@@ -0,0 +1,33 @@
+/* Set given exception flags. S/390 version.
+ Copyright (C) 2016-2018 Free Software 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/sysdeps/s390/fpu/fesetmode.c b/sysdeps/s390/fpu/fesetmode.c
new file mode 100644
index 0000000000..37ede8f115
--- /dev/null
+++ b/sysdeps/s390/fpu/fesetmode.c
@@ -0,0 +1,39 @@
+/* Install given floating-point control modes. S/390 version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define FPC_STATUS (FPC_FLAGS_MASK | FPC_DXC_MASK)
+
+int
+fesetmode (const femode_t *modep)
+{
+ fpu_control_t fpc;
+
+ _FPU_GETCW (fpc);
+ fpc &= FPC_STATUS;
+ if (modep == FE_DFL_MODE)
+ fpc |= _FPU_DEFAULT;
+ else
+ fpc |= *modep & ~FPC_STATUS;
+ _FPU_SETCW (fpc);
+
+ return 0;
+}
diff --git a/sysdeps/s390/fpu/fesetround.c b/sysdeps/s390/fpu/fesetround.c
index 5b15a1973d..d8a84d2c96 100644
--- a/sysdeps/s390/fpu/fesetround.c
+++ b/sysdeps/s390/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
diff --git a/sysdeps/s390/fpu/fetestexceptflag.c b/sysdeps/s390/fpu/fetestexceptflag.c
new file mode 100644
index 0000000000..784d356f7b
--- /dev/null
+++ b/sysdeps/s390/fpu/fetestexceptflag.c
@@ -0,0 +1,31 @@
+/* Test exception in saved exception state. S/390 version.
+ Copyright (C) 2016-2018 Free Software 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/feupdateenv.c b/sysdeps/s390/fpu/feupdateenv.c
index 1aad35ec13..4888e1a864 100644
--- a/sysdeps/s390/fpu/feupdateenv.c
+++ b/sysdeps/s390/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
diff --git a/sysdeps/s390/fpu/fgetexcptflg.c b/sysdeps/s390/fpu/fgetexcptflg.c
index 09b7cfd99c..2a0f6dc77c 100644
--- a/sysdeps/s390/fpu/fgetexcptflg.c
+++ b/sysdeps/s390/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
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..2ad36817c7
--- /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-2018 Free Software 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/fpu_control.h b/sysdeps/s390/fpu/fpu_control.h
index e0266a703e..cb8bca2c56 100644
--- a/sysdeps/s390/fpu/fpu_control.h
+++ b/sysdeps/s390/fpu/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word definitions. Stub version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com) and
Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/fpu/fraiseexcpt.c b/sysdeps/s390/fpu/fraiseexcpt.c
index 92a1a7db68..c1edf7a732 100644
--- a/sysdeps/s390/fpu/fraiseexcpt.c
+++ b/sysdeps/s390/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com) and
Martin Schwidefsky (schwidefsky@de.ibm.com).
@@ -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..e50684c574 100644
--- a/sysdeps/s390/fpu/fsetexcptflg.c
+++ b/sysdeps/s390/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
@@ -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/ftestexcept.c b/sysdeps/s390/fpu/ftestexcept.c
index 45cfcb52d0..727b9b342d 100644
--- a/sysdeps/s390/fpu/ftestexcept.c
+++ b/sysdeps/s390/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
diff --git a/sysdeps/s390/fpu/get-rounding-mode.h b/sysdeps/s390/fpu/get-rounding-mode.h
index 5150b0ab25..ae40791af6 100644
--- a/sysdeps/s390/fpu/get-rounding-mode.h
+++ b/sysdeps/s390/fpu/get-rounding-mode.h
@@ -1,5 +1,5 @@
/* Determine floating-point rounding mode within libc. S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/fpu/libm-test-ulps b/sysdeps/s390/fpu/libm-test-ulps
index bc5795b361..fec59c7d60 100644
--- a/sysdeps/s390/fpu/libm-test-ulps
+++ b/sysdeps/s390/fpu/libm-test-ulps
@@ -40,9 +40,9 @@ ildouble: 2
ldouble: 2
Function: "acosh_downward":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 3
ldouble: 3
@@ -126,9 +126,7 @@ ildouble: 4
ldouble: 4
Function: "atan":
-double: 1
float: 1
-idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -252,42 +250,42 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "cacos_downward":
double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "cacos_towardzero":
-double: 5
-float: 3
-idouble: 5
-ifloat: 3
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -300,17 +298,17 @@ ildouble: 3
ldouble: 3
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -324,57 +322,55 @@ ildouble: 2
ldouble: 2
Function: Real part of "cacosh_downward":
-double: 5
-float: 3
-idouble: 5
-ifloat: 3
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-ildouble: 2
-ldouble: 2
-
-Function: Real part of "cacosh_towardzero":
-double: 5
+double: 3
float: 3
-idouble: 5
+idouble: 3
ifloat: 3
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Real part of "cacosh_upward":
double: 4
-float: 4
+float: 3
idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+ifloat: 3
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
Function: "carg":
-double: 1
float: 1
-idouble: 1
ifloat: 1
ildouble: 2
ldouble: 2
@@ -412,18 +408,18 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -432,8 +428,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "casin_towardzero":
double: 3
@@ -444,33 +440,33 @@ ildouble: 3
ldouble: 3
Function: Imaginary part of "casin_towardzero":
-double: 5
-float: 3
-idouble: 5
-ifloat: 3
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
ildouble: 5
ldouble: 5
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -488,22 +484,22 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
Function: Real part of "casinh_towardzero":
-double: 5
-float: 3
-idouble: 5
-ifloat: 3
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -516,23 +512,25 @@ ildouble: 3
ldouble: 3
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
ildouble: 3
ldouble: 3
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -547,9 +545,9 @@ ldouble: 1
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -558,36 +556,38 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 2
+ldouble: 2
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
+ifloat: 2
+ildouble: 2
+ldouble: 2
Function: Real part of "catan_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catan_upward":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -600,7 +600,9 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -610,8 +612,8 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catanh_downward":
double: 1
@@ -623,11 +625,11 @@ ldouble: 2
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
+ifloat: 2
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catanh_towardzero":
double: 1
@@ -639,17 +641,19 @@ ldouble: 2
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
idouble: 4
-ifloat: 3
+ifloat: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "cbrt":
double: 3
@@ -765,9 +769,9 @@ ldouble: 1
Function: Real part of "ccosh_downward":
double: 1
-float: 3
+float: 2
idouble: 1
-ifloat: 3
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -884,9 +888,7 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "clog":
-double: 1
float: 1
-idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -900,18 +902,18 @@ 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
Function: Real part of "clog10_downward":
double: 5
-float: 4
+float: 5
idouble: 5
-ifloat: 4
+ifloat: 5
ildouble: 3
ldouble: 3
@@ -1004,32 +1006,26 @@ ildouble: 2
ldouble: 2
Function: "cos":
-float: 1
-ifloat: 1
+double: 1
+idouble: 1
ildouble: 1
ldouble: 1
Function: "cos_downward":
double: 1
-float: 2
idouble: 1
-ifloat: 2
ildouble: 3
ldouble: 3
Function: "cos_towardzero":
double: 1
-float: 1
idouble: 1
-ifloat: 1
ildouble: 1
ldouble: 1
Function: "cos_upward":
double: 1
-float: 2
idouble: 1
-ifloat: 2
ildouble: 2
ldouble: 2
@@ -1203,9 +1199,9 @@ ldouble: 1
Function: Real part of "csinh_downward":
double: 2
-float: 2
+float: 1
idouble: 2
-ifloat: 2
+ifloat: 1
ildouble: 2
ldouble: 2
@@ -1323,9 +1319,9 @@ ldouble: 3
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -1339,9 +1335,9 @@ ldouble: 4
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1363,17 +1359,17 @@ ldouble: 5
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "ctan_upward":
double: 2
-float: 3
+float: 2
idouble: 2
-ifloat: 3
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1395,9 +1391,9 @@ ldouble: 3
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
idouble: 4
-ifloat: 1
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1427,9 +1423,9 @@ ldouble: 3
Function: Real part of "ctanh_upward":
double: 2
-float: 3
+float: 2
idouble: 2
-ifloat: 3
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1506,8 +1502,6 @@ ildouble: 5
ldouble: 5
Function: "exp":
-float: 1
-ifloat: 1
ildouble: 1
ldouble: 1
@@ -1543,25 +1537,19 @@ ldouble: 3
Function: "exp2":
double: 1
-float: 1
idouble: 1
-ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp2_downward":
double: 1
-float: 1
idouble: 1
-ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp2_towardzero":
double: 1
-float: 1
idouble: 1
-ifloat: 1
ildouble: 1
ldouble: 1
@@ -1575,15 +1563,21 @@ ldouble: 2
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "expm1":
double: 1
@@ -1619,9 +1613,9 @@ ldouble: 3
Function: "gamma":
double: 3
-float: 4
+float: 3
idouble: 3
-ifloat: 4
+ifloat: 3
ildouble: 5
ldouble: 5
@@ -1683,9 +1677,9 @@ ldouble: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 4
ldouble: 4
@@ -1771,9 +1765,9 @@ ldouble: 7
Function: "lgamma":
double: 3
-float: 4
+float: 3
idouble: 3
-ifloat: 4
+ifloat: 3
ildouble: 5
ldouble: 5
@@ -1802,8 +1796,6 @@ ildouble: 8
ldouble: 8
Function: "log":
-float: 1
-ifloat: 1
ildouble: 1
ldouble: 1
@@ -1825,9 +1817,9 @@ ldouble: 1
Function: "log10_towardzero":
double: 2
-float: 2
+float: 1
idouble: 2
-ifloat: 2
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -1881,84 +1873,40 @@ ldouble: 2
Function: "log2_downward":
double: 3
-float: 3
idouble: 3
-ifloat: 3
ildouble: 3
ldouble: 3
Function: "log2_towardzero":
double: 2
-float: 2
idouble: 2
-ifloat: 2
ildouble: 1
ldouble: 1
Function: "log2_upward":
double: 3
-float: 3
idouble: 3
-ifloat: 3
ildouble: 1
ldouble: 1
Function: "log_downward":
-float: 2
-ifloat: 2
ildouble: 1
ldouble: 1
Function: "log_towardzero":
-float: 1
-ifloat: 1
ildouble: 2
ldouble: 2
Function: "log_upward":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
ildouble: 1
ldouble: 1
Function: "pow":
-float: 1
-ifloat: 1
-ildouble: 2
-ldouble: 2
-
-Function: "pow10":
-double: 2
-idouble: 2
+double: 1
+idouble: 1
ildouble: 2
ldouble: 2
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
Function: "pow_downward":
double: 1
float: 1
@@ -1984,62 +1932,50 @@ ildouble: 2
ldouble: 2
Function: "sin":
-float: 1
-ifloat: 1
+double: 1
+idouble: 1
ildouble: 1
ldouble: 1
Function: "sin_downward":
double: 1
-float: 2
idouble: 1
-ifloat: 2
ildouble: 3
ldouble: 3
Function: "sin_towardzero":
double: 1
-float: 1
idouble: 1
-ifloat: 1
ildouble: 2
ldouble: 2
Function: "sin_upward":
double: 1
-float: 2
idouble: 1
-ifloat: 2
ildouble: 3
ldouble: 3
Function: "sincos":
-float: 1
-ifloat: 1
+double: 1
+idouble: 1
ildouble: 1
ldouble: 1
Function: "sincos_downward":
double: 1
-float: 2
idouble: 1
-ifloat: 2
ildouble: 3
ldouble: 3
Function: "sincos_towardzero":
double: 1
-float: 1
idouble: 1
-ifloat: 1
ildouble: 2
ldouble: 2
Function: "sincos_upward":
double: 1
-float: 2
idouble: 1
-ifloat: 2
ildouble: 3
ldouble: 3
@@ -2179,9 +2115,9 @@ ldouble: 3
Function: "y0_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 4
ldouble: 4
@@ -2195,9 +2131,9 @@ ldouble: 3
Function: "y0_upward":
double: 2
-float: 3
+float: 5
idouble: 2
-ifloat: 3
+ifloat: 5
ildouble: 3
ldouble: 3
@@ -2235,17 +2171,17 @@ ldouble: 5
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 5
ldouble: 5
Function: "yn_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 5
ldouble: 5
@@ -2259,9 +2195,9 @@ ldouble: 5
Function: "yn_upward":
double: 4
-float: 3
+float: 5
idouble: 4
-ifloat: 3
+ifloat: 5
ildouble: 5
ldouble: 5
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/fpu/s_fma.c b/sysdeps/s390/fpu/s_fma.c
index 7d7e563b7e..93405d0662 100644
--- a/sysdeps/s390/fpu/s_fma.c
+++ b/sysdeps/s390/fpu/s_fma.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation. S/390 version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-double.h>
double
__fma (double x, double y, double z)
@@ -27,10 +28,5 @@ __fma (double x, double y, double z)
return r;
}
#ifndef __fma
-weak_alias (__fma, fma)
-#endif
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fma, __fmal)
-weak_alias (__fmal, fmal)
+libm_alias_double (__fma, fma)
#endif
diff --git a/sysdeps/s390/fpu/s_fmaf.c b/sysdeps/s390/fpu/s_fmaf.c
index 50af2bbc5b..0768495f16 100644
--- a/sysdeps/s390/fpu/s_fmaf.c
+++ b/sysdeps/s390/fpu/s_fmaf.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation. S/390 version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-float.h>
float
__fmaf (float x, float y, float z)
@@ -27,5 +28,5 @@ __fmaf (float x, float y, float z)
return r;
}
#ifndef __fmaf
-weak_alias (__fmaf, fmaf)
+libm_alias_float (__fma, fma)
#endif
diff --git a/sysdeps/s390/gccframe.h b/sysdeps/s390/gccframe.h
index ac0b6b9c4b..ad41f1f0ab 100644
--- a/sysdeps/s390/gccframe.h
+++ b/sysdeps/s390/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. s390 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/gconv-modules b/sysdeps/s390/gconv-modules
new file mode 100644
index 0000000000..c24b4571f5
--- /dev/null
+++ b/sysdeps/s390/gconv-modules
@@ -0,0 +1,50 @@
+# GNU libc iconv configuration.
+# Copyright (C) 1997-2018 Free Software 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/>.
+
+# All lines contain the following information:
+
+# If the lines start with `module'
+# fromset: either a name triple or a regular expression triple.
+# toset: a name triple or an expression with \N to get regular
+# expression matching results.
+# filename: filename of the module implementing the transformation.
+# If it is not absolute the path is made absolute by prepending
+# the directory the configuration file is found in.
+# cost: optional cost of the transformation. Default is 1.
+
+# If the lines start with `alias'
+# alias: alias name which is not really recognized.
+# name: the real name of the character set
+
+# S/390 hardware accelerated modules
+# from to module cost
+module ISO-8859-1// IBM037// ISO-8859-1_CP037_Z900 1
+module IBM037// ISO-8859-1// ISO-8859-1_CP037_Z900 1
+module ISO-10646/UTF8/ UTF-32// UTF8_UTF32_Z9 1
+module UTF-32BE// ISO-10646/UTF8/ UTF8_UTF32_Z9 1
+module ISO-10646/UTF8/ UTF-32BE// UTF8_UTF32_Z9 1
+module UTF-16BE// UTF-32// UTF16_UTF32_Z9 1
+module UTF-32BE// UTF-16// UTF16_UTF32_Z9 1
+module INTERNAL UTF-16// UTF16_UTF32_Z9 1
+module UTF-32BE// UTF-16BE// UTF16_UTF32_Z9 1
+module INTERNAL UTF-16BE// UTF16_UTF32_Z9 1
+module UTF-16BE// UTF-32BE// UTF16_UTF32_Z9 1
+module UTF-16BE// INTERNAL UTF16_UTF32_Z9 1
+module UTF-16BE// ISO-10646/UTF8/ UTF8_UTF16_Z9 1
+module ISO-10646/UTF8/ UTF-16// UTF8_UTF16_Z9 1
+module ISO-10646/UTF8/ UTF-16BE// UTF8_UTF16_Z9 1
diff --git a/sysdeps/s390/gmp-mparam.h b/sysdeps/s390/gmp-mparam.h
index 0f7ec7af0c..fe7d708b78 100644
--- a/sysdeps/s390/gmp-mparam.h
+++ b/sysdeps/s390/gmp-mparam.h
@@ -1,5 +1,5 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU MP Library.
diff --git a/sysdeps/s390/s390-64/iso-8859-1_cp037_z900.c b/sysdeps/s390/iso-8859-1_cp037_z900.c
index c59f87f18d..8428d77e57 100644
--- a/sysdeps/s390/s390-64/iso-8859-1_cp037_z900.c
+++ b/sysdeps/s390/iso-8859-1_cp037_z900.c
@@ -1,8 +1,7 @@
/* Conversion between ISO 8859-1 and IBM037.
- This module uses the Z900 variant of the Translate One To One
- instruction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ This module uses the translate instruction.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -176,50 +175,76 @@ __attribute__ ((aligned (8))) =
#define MIN_NEEDED_FROM 1
#define MIN_NEEDED_TO 1
-/* The Z900 variant of troo forces us to always specify a test
- character which ends the translation. So if we run into the
- situation where the translation has been interrupted due to the
- test character we translate the character by hand and jump back
- into the instruction. */
+# if defined __s390x__
+# define BRANCH_ON_COUNT(REG,LBL) "brctg %" #REG "," #LBL "\n\t"
+# else
+# define BRANCH_ON_COUNT(REG,LBL) "brct %" #REG "," #LBL "\n\t"
+# endif
-#define TROO_LOOP(TABLE) \
+#define TR_LOOP(TABLE) \
{ \
- register const unsigned char test __asm__ ("0") = 0; \
- register const unsigned char *pTable __asm__ ("1") = TABLE; \
- register unsigned char *pOutput __asm__ ("2") = outptr; \
- register uint64_t length __asm__ ("3"); \
- const unsigned char* pInput = inptr; \
- uint64_t tmp; \
+ size_t length = (inend - inptr < outend - outptr \
+ ? inend - inptr : outend - outptr); \
\
- length = (inend - inptr < outend - outptr \
- ? inend - inptr : outend - outptr); \
+ /* Process in 256 byte blocks. */ \
+ if (__builtin_expect (length >= 256, 0)) \
+ { \
+ size_t blocks = length / 256; \
+ __asm__ __volatile__("0: mvc 0(256,%[R_OUT]),0(%[R_IN])\n\t" \
+ " tr 0(256,%[R_OUT]),0(%[R_TBL])\n\t" \
+ " la %[R_IN],256(%[R_IN])\n\t" \
+ " la %[R_OUT],256(%[R_OUT])\n\t" \
+ BRANCH_ON_COUNT ([R_LI], 0b) \
+ : /* outputs */ [R_IN] "+a" (inptr) \
+ , [R_OUT] "+a" (outptr), [R_LI] "+d" (blocks) \
+ : /* inputs */ [R_TBL] "a" (TABLE) \
+ : /* clobber list */ "memory" \
+ ); \
+ length = length % 256; \
+ } \
\
- __asm__ volatile ("0: \n\t" \
- " troo %0,%1 \n\t" \
- " jz 1f \n\t" \
- " jo 0b \n\t" \
- " llgc %3,0(%1) \n\t" \
- " la %3,0(%3,%4) \n\t" \
- " mvc 0(1,%0),0(%3) \n\t" \
- " aghi %1,1 \n\t" \
- " aghi %0,1 \n\t" \
- " aghi %2,-1 \n\t" \
- " j 0b \n\t" \
- "1: \n" \
+ /* Process remaining 0...248 bytes in 8byte blocks. */ \
+ if (length >= 8) \
+ { \
+ size_t blocks = length / 8; \
+ for (int i = 0; i < blocks; i++) \
+ { \
+ outptr[0] = TABLE[inptr[0]]; \
+ outptr[1] = TABLE[inptr[1]]; \
+ outptr[2] = TABLE[inptr[2]]; \
+ outptr[3] = TABLE[inptr[3]]; \
+ outptr[4] = TABLE[inptr[4]]; \
+ outptr[5] = TABLE[inptr[5]]; \
+ outptr[6] = TABLE[inptr[6]]; \
+ outptr[7] = TABLE[inptr[7]]; \
+ inptr += 8; \
+ outptr += 8; \
+ } \
+ length = length % 8; \
+ } \
\
- : "+a" (pOutput), "+a" (pInput), "+d" (length), "=&a" (tmp) \
- : "a" (pTable), "d" (test) \
- : "cc"); \
- \
- inptr = pInput; \
- outptr = pOutput; \
+ /* Process remaining 0...7 bytes. */ \
+ switch (length) \
+ { \
+ case 7: outptr[6] = TABLE[inptr[6]]; \
+ case 6: outptr[5] = TABLE[inptr[5]]; \
+ case 5: outptr[4] = TABLE[inptr[4]]; \
+ case 4: outptr[3] = TABLE[inptr[3]]; \
+ case 3: outptr[2] = TABLE[inptr[2]]; \
+ case 2: outptr[1] = TABLE[inptr[1]]; \
+ case 1: outptr[0] = TABLE[inptr[0]]; \
+ case 0: break; \
+ } \
+ inptr += length; \
+ outptr += length; \
}
+
/* First define the conversion function from ISO 8859-1 to CP037. */
#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
#define LOOPFCT FROM_LOOP
-#define BODY TROO_LOOP (table_iso8859_1_to_cp037)
+#define BODY TR_LOOP (table_iso8859_1_to_cp037)
#include <iconv/loop.c>
@@ -228,7 +253,7 @@ __attribute__ ((aligned (8))) =
#define MIN_NEEDED_INPUT MIN_NEEDED_TO
#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
#define LOOPFCT TO_LOOP
-#define BODY TROO_LOOP (table_cp037_iso8859_1);
+#define BODY TR_LOOP (table_cp037_iso8859_1);
#include <iconv/loop.c>
diff --git a/sysdeps/s390/jmpbuf-offsets.h b/sysdeps/s390/jmpbuf-offsets.h
index bf23695cd2..7c6aafd8fa 100644
--- a/sysdeps/s390/jmpbuf-offsets.h
+++ b/sysdeps/s390/jmpbuf-offsets.h
@@ -1,5 +1,5 @@
/* Private macros for accessing __jmp_buf contents. S/390 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/jmpbuf-unwind.h b/sysdeps/s390/jmpbuf-unwind.h
index 1e1b4a8b6d..9d42f3056b 100644
--- a/sysdeps/s390/jmpbuf-unwind.h
+++ b/sysdeps/s390/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/s390/ldsodefs.h b/sysdeps/s390/ldsodefs.h
index b22d364be4..e545d953fb 100644
--- a/sysdeps/s390/ldsodefs.h
+++ b/sysdeps/s390/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/libc-tls.c b/sysdeps/s390/libc-tls.c
index 1df435c1f4..85ede75275 100644
--- a/sysdeps/s390/libc-tls.c
+++ b/sysdeps/s390/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. S390 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/linkmap.h b/sysdeps/s390/linkmap.h
index fc1fba363a..283615b99a 100644
--- a/sysdeps/s390/linkmap.h
+++ b/sysdeps/s390/linkmap.h
@@ -2,12 +2,12 @@
struct link_map_machine
{
Elf64_Addr plt; /* Address of .plt + 0x2e */
- Elf64_Addr gotplt; /* Address of .got + 0x18 */
+ const Elf64_Rela *jmprel; /* Address of first JMP_SLOT reloc */
};
#else
struct link_map_machine
{
Elf32_Addr plt; /* Address of .plt + 0x2c */
- Elf32_Addr gotplt; /* Address of .got + 0x0c */
+ const Elf32_Rela *jmprel; /* Address of first JMP_SLOT reloc */
};
#endif
diff --git a/sysdeps/s390/longjmp.c b/sysdeps/s390/longjmp.c
index 25b0145933..e61cdba2a3 100644
--- a/sysdeps/s390/longjmp.c
+++ b/sysdeps/s390/longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,6 @@
but were reverted before 2.20. Thus both versions are the same function. */
strong_alias (__libc_siglongjmp, __libc_longjmp)
-libc_hidden_def (__libc_longjmp)
weak_alias (__libc_siglongjmp, __v1_longjmp)
weak_alias (__libc_siglongjmp, __v2_longjmp)
diff --git a/sysdeps/s390/machine-gmon.h b/sysdeps/s390/machine-gmon.h
index 0c978754f6..a7b77c41ca 100644
--- a/sysdeps/s390/machine-gmon.h
+++ b/sysdeps/s390/machine-gmon.h
@@ -1,5 +1,5 @@
/* s390-specific implementation of profiling support.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/mempcpy.S b/sysdeps/s390/mempcpy.S
new file mode 100644
index 0000000000..18ef29213e
--- /dev/null
+++ b/sysdeps/s390/mempcpy.S
@@ -0,0 +1,19 @@
+/* CPU specific mempcpy without multiarch - 32/64 bit S/390 version.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+/* mempcpy is implemented in memcpy.S. */
diff --git a/sysdeps/s390/memusage.h b/sysdeps/s390/memusage.h
index 888d708b29..c408acd416 100644
--- a/sysdeps/s390/memusage.h
+++ b/sysdeps/s390/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/8bit-generic.c b/sysdeps/s390/multiarch/8bit-generic.c
new file mode 100644
index 0000000000..d608beaa62
--- /dev/null
+++ b/sysdeps/s390/multiarch/8bit-generic.c
@@ -0,0 +1,402 @@
+/* Generic conversion to and from 8bit charsets - S390 version.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+#if defined HAVE_S390_VX_ASM_SUPPORT
+
+# if defined HAVE_S390_VX_GCC_SUPPORT
+# define ASM_CLOBBER_VR(NR) , NR
+# else
+# define ASM_CLOBBER_VR(NR)
+# endif
+
+/* Generate the conversion loop routines without vector instructions as
+ fallback, if vector instructions aren't available at runtime. */
+# define IGNORE_ICONV_SKELETON
+# define from_generic __from_generic_c
+# define to_generic __to_generic_c
+# include "iconvdata/8bit-generic.c"
+# undef IGNORE_ICONV_SKELETON
+# undef from_generic
+# undef to_generic
+
+/* Generate the converion routines with vector instructions. The vector
+ routines can only be used with charsets where the maximum UCS4 value
+ fits in 1 byte size. Then the hardware translate-instruction is used
+ to translate between multiple generic characters and "1 byte UCS4"
+ characters at once. The vector instructions are used to convert between
+ the "1 byte UCS4" and UCS4. */
+# include <ifunc-resolve.h>
+
+# undef FROM_LOOP
+# undef TO_LOOP
+# define FROM_LOOP __from_generic_vx
+# define TO_LOOP __to_generic_vx
+
+# define MIN_NEEDED_FROM 1
+# define MIN_NEEDED_TO 4
+# define ONE_DIRECTION 0
+
+/* First define the conversion function from the 8bit charset to UCS4. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define LOOPFCT FROM_LOOP
+# define BODY_FROM_ORIG \
+ { \
+ uint32_t ch = to_ucs4[*inptr]; \
+ \
+ if (HAS_HOLES && __builtin_expect (ch == L'\0', 0) && *inptr != '\0') \
+ { \
+ /* This is an illegal character. */ \
+ STANDARD_FROM_LOOP_ERR_HANDLER (1); \
+ } \
+ \
+ put32 (outptr, ch); \
+ outptr += 4; \
+ ++inptr; \
+ }
+
+# define BODY \
+ { \
+ if (__builtin_expect (inend - inptr < 16, 1) \
+ || outend - outptr < 64) \
+ /* Convert remaining bytes with c code. */ \
+ BODY_FROM_ORIG \
+ else \
+ { \
+ /* Convert 16 ... 256 bytes at once with tr-instruction. */ \
+ size_t index; \
+ char buf[256]; \
+ size_t loop_count = (inend - inptr) / 16; \
+ if (loop_count > (outend - outptr) / 64) \
+ loop_count = (outend - outptr) / 64; \
+ if (loop_count > 16) \
+ loop_count = 16; \
+ __asm__ volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ " sllk %[R_I],%[R_LI],4\n\t" \
+ " ahi %[R_I],-1\n\t" \
+ /* Execute mvc and tr with correct len. */ \
+ " exrl %[R_I],21f\n\t" \
+ " exrl %[R_I],22f\n\t" \
+ /* Post-processing. */ \
+ " lghi %[R_I],0\n\t" \
+ " vzero %%v0\n\t" \
+ "0: \n\t" \
+ /* Find invalid character - value is zero. */ \
+ " vl %%v16,0(%[R_I],%[R_BUF])\n\t" \
+ " vceqbs %%v23,%%v0,%%v16\n\t" \
+ " jle 10f\n\t" \
+ "1: \n\t" \
+ /* Enlarge to UCS4. */ \
+ " vuplhb %%v17,%%v16\n\t" \
+ " vupllb %%v18,%%v16\n\t" \
+ " vuplhh %%v19,%%v17\n\t" \
+ " vupllh %%v20,%%v17\n\t" \
+ " vuplhh %%v21,%%v18\n\t" \
+ " vupllh %%v22,%%v18\n\t" \
+ /* Store 64bytes to buf_out. */ \
+ " vstm %%v19,%%v22,0(%[R_OUT])\n\t" \
+ " aghi %[R_I],16\n\t" \
+ " la %[R_OUT],64(%[R_OUT])\n\t" \
+ " brct %[R_LI],0b\n\t" \
+ " la %[R_IN],0(%[R_I],%[R_IN])\n\t" \
+ " j 20f\n\t" \
+ "21: mvc 0(1,%[R_BUF]),0(%[R_IN])\n\t" \
+ "22: tr 0(1,%[R_BUF]),0(%[R_TBL])\n\t" \
+ /* Possibly invalid character found. */ \
+ "10: \n\t" \
+ /* Test if input was zero, too. */ \
+ " vl %%v24,0(%[R_I],%[R_IN])\n\t" \
+ " vceqb %%v24,%%v0,%%v24\n\t" \
+ /* Zeros in buf (v23) and inptr (v24) are marked \
+ with one bits. After xor, invalid characters \
+ are marked as one bits. Proceed, if no \
+ invalid characters are found. */ \
+ " vx %%v24,%%v23,%%v24\n\t" \
+ " vfenebs %%v24,%%v24,%%v0\n\t" \
+ " jo 1b\n\t" \
+ /* Found an invalid translation. \
+ Store the preceding chars. */ \
+ " la %[R_IN],0(%[R_I],%[R_IN])\n\t" \
+ " vlgvb %[R_I],%%v24,7\n\t" \
+ " la %[R_IN],0(%[R_I],%[R_IN])\n\t" \
+ " sll %[R_I],2\n\t" \
+ " ahi %[R_I],-1\n\t" \
+ " jl 20f\n\t" \
+ " lgr %[R_LI],%[R_I]\n\t" \
+ " vuplhb %%v17,%%v16\n\t" \
+ " vuplhh %%v19,%%v17\n\t" \
+ " vstl %%v19,%[R_I],0(%[R_OUT])\n\t" \
+ " ahi %[R_I],-16\n\t" \
+ " jl 11f\n\t" \
+ " vupllh %%v20,%%v17\n\t" \
+ " vstl %%v20,%[R_I],16(%[R_OUT])\n\t" \
+ " ahi %[R_I],-16\n\t" \
+ " jl 11f\n\t" \
+ " vupllb %%v18,%%v16\n\t" \
+ " vuplhh %%v21,%%v18\n\t" \
+ " vstl %%v21,%[R_I],32(%[R_OUT])\n\t" \
+ " ahi %[R_I],-16\n\t" \
+ " jl 11f\n\t" \
+ " vupllh %%v22,%%v18\n\t" \
+ " vstl %%v22,%[R_I],48(%[R_OUT])\n\t" \
+ "11: \n\t" \
+ " la %[R_OUT],1(%[R_LI],%[R_OUT])\n\t" \
+ "20: \n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (inptr) \
+ , [R_OUT] "+a" (outptr), [R_I] "=&a" (index) \
+ , [R_LI] "+a" (loop_count) \
+ : /* inputs */ [R_BUF] "a" (buf) \
+ , [R_TBL] "a" (to_ucs1) \
+ : /* clobber list*/ "memory", "cc" \
+ ASM_CLOBBER_VR ("v0") ASM_CLOBBER_VR ("v16") \
+ ASM_CLOBBER_VR ("v17") ASM_CLOBBER_VR ("v18") \
+ ASM_CLOBBER_VR ("v19") ASM_CLOBBER_VR ("v20") \
+ ASM_CLOBBER_VR ("v21") ASM_CLOBBER_VR ("v22") \
+ ASM_CLOBBER_VR ("v23") ASM_CLOBBER_VR ("v24") \
+ ); \
+ /* Error occured? */ \
+ if (loop_count != 0) \
+ { \
+ /* Found an invalid character! */ \
+ STANDARD_FROM_LOOP_ERR_HANDLER (1); \
+ } \
+ } \
+ }
+
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+
+/* Next, define the other direction - from UCS4 to 8bit charset. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
+# define LOOPFCT TO_LOOP
+# define BODY_TO_ORIG \
+ { \
+ uint32_t ch = get32 (inptr); \
+ \
+ if (__builtin_expect (ch >= sizeof (from_ucs4) / sizeof (from_ucs4[0]), 0)\
+ || (__builtin_expect (from_ucs4[ch], '\1') == '\0' && ch != 0)) \
+ { \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ \
+ /* This is an illegal character. */ \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ } \
+ \
+ *outptr++ = from_ucs4[ch]; \
+ inptr += 4; \
+ }
+# define BODY \
+ { \
+ if (__builtin_expect (inend - inptr < 64, 1) \
+ || outend - outptr < 16) \
+ /* Convert remaining bytes with c code. */ \
+ BODY_TO_ORIG \
+ else \
+ { \
+ /* Convert 64 ... 1024 bytes at once with tr-instruction. */ \
+ size_t index, tmp; \
+ char buf[256]; \
+ size_t loop_count = (inend - inptr) / 64; \
+ uint32_t max = sizeof (from_ucs4) / sizeof (from_ucs4[0]); \
+ if (loop_count > (outend - outptr) / 16) \
+ loop_count = (outend - outptr) / 16; \
+ if (loop_count > 16) \
+ loop_count = 16; \
+ size_t remaining_loop_count = loop_count; \
+ /* Step 1: Check for ch>=max, ch == 0 and shorten to bytes. \
+ (ch == 0 is no error, but is handled differently) */ \
+ __asm__ volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ /* Setup to check for ch >= max. */ \
+ " vzero %%v21\n\t" \
+ " vleih %%v21,-24576,0\n\t" /* element 0: > */ \
+ " vleih %%v21,-8192,2\n\t" /* element 1: =<> */ \
+ " vlvgf %%v20,%[R_MAX],0\n\t" /* element 0: val */ \
+ /* Process in 64byte - 16 characters blocks. */ \
+ " lghi %[R_I],0\n\t" \
+ " lghi %[R_TMP],0\n\t" \
+ "0: \n\t" \
+ " vlm %%v16,%%v19,0(%[R_IN])\n\t" \
+ /* Test for ch >= max and ch == 0. */ \
+ " vstrczfs %%v22,%%v16,%%v20,%%v21\n\t" \
+ " jno 10f\n\t" \
+ " vstrczfs %%v22,%%v17,%%v20,%%v21\n\t" \
+ " jno 11f\n\t" \
+ " vstrczfs %%v22,%%v18,%%v20,%%v21\n\t" \
+ " jno 12f\n\t" \
+ " vstrczfs %%v22,%%v19,%%v20,%%v21\n\t" \
+ " jno 13f\n\t" \
+ /* Shorten to byte values. */ \
+ " vpkf %%v16,%%v16,%%v17\n\t" \
+ " vpkf %%v18,%%v18,%%v19\n\t" \
+ " vpkh %%v16,%%v16,%%v18\n\t" \
+ /* Store 16bytes to buf. */ \
+ " vst %%v16,0(%[R_I],%[R_BUF])\n\t" \
+ /* Loop until all blocks are processed. */ \
+ " la %[R_IN],64(%[R_IN])\n\t" \
+ " aghi %[R_I],16\n\t" \
+ " brct %[R_LI],0b\n\t" \
+ " j 20f\n\t" \
+ /* Found error ch >= max or ch == 0. */ \
+ "13: aghi %[R_TMP],4\n\t" \
+ "12: aghi %[R_TMP],4\n\t" \
+ "11: aghi %[R_TMP],4\n\t" \
+ "10: vlgvb %[R_I],%%v22,7\n\t" \
+ " srlg %[R_I],%[R_I],2\n\t" \
+ " agr %[R_I],%[R_TMP]\n\t" \
+ "20: \n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (inptr) \
+ , [R_I] "=&a" (index) \
+ , [R_TMP] "=d" (tmp) \
+ , [R_LI] "+d" (remaining_loop_count) \
+ : /* inputs */ [R_BUF] "a" (buf) \
+ , [R_MAX] "d" (max) \
+ : /* clobber list*/ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v20") ASM_CLOBBER_VR ("v21") \
+ ASM_CLOBBER_VR ("v22") \
+ ); \
+ /* Error occured in step 1? An error (ch >= max || ch == 0) \
+ occured, if remaining_loop_count > 0. The error occured \
+ at character-index (index) after already processed blocks. */ \
+ loop_count -= remaining_loop_count; \
+ if (loop_count > 0) \
+ { \
+ /* Step 2: Translate already processed blocks in buf and \
+ check for errors (from_ucs4[ch] == 0). */ \
+ __asm__ volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ " sllk %[R_I],%[R_LI],4\n\t" \
+ " ahi %[R_I],-1\n\t" \
+ /* Execute tr with correct len. */ \
+ " exrl %[R_I],21f\n\t" \
+ /* Post-processing. */ \
+ " lghi %[R_I],0\n\t" \
+ "0: \n\t" \
+ /* Find invalid character - value == 0. */ \
+ " vl %%v16,0(%[R_I],%[R_BUF])\n\t" \
+ " vfenezbs %%v17,%%v16,%%v16\n\t" \
+ " je 10f\n\t" \
+ /* Store 16bytes to buf_out. */ \
+ " vst %%v16,0(%[R_I],%[R_OUT])\n\t" \
+ " aghi %[R_I],16\n\t" \
+ " brct %[R_LI],0b\n\t" \
+ " la %[R_OUT],0(%[R_I],%[R_OUT])\n\t" \
+ " j 20f\n\t" \
+ "21: tr 0(1,%[R_BUF]),0(%[R_TBL])\n\t" \
+ /* Found an error: from_ucs4[ch] == 0. */ \
+ "10: la %[R_OUT],0(%[R_I],%[R_OUT])\n\t" \
+ " vlgvb %[R_I],%%v17,7\n\t" \
+ "20: \n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_OUT] "+a" (outptr) \
+ , [R_I] "=&a" (tmp) \
+ , [R_LI] "+d" (loop_count) \
+ : /* inputs */ [R_BUF] "a" (buf) \
+ , [R_TBL] "a" (from_ucs4) \
+ : /* clobber list*/ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") \
+ ASM_CLOBBER_VR ("v17") \
+ ); \
+ /* Error occured in processed bytes of step 2? \
+ Thus possible error in step 1 is obselete.*/ \
+ if (tmp < 16) \
+ { \
+ index = tmp; \
+ inptr -= loop_count * 64; \
+ } \
+ } \
+ /* Error occured in step 1/2? */ \
+ if (index < 16) \
+ { \
+ /* Found an invalid character (see step 2) or zero \
+ (see step 1) at index! Convert the chars before index \
+ manually. If there is a zero at index detected by step 1, \
+ there could be invalid characters before this zero. */ \
+ int i; \
+ uint32_t ch; \
+ for (i = 0; i < index; i++) \
+ { \
+ ch = get32 (inptr); \
+ if (__builtin_expect (from_ucs4[ch], '\1') == '\0') \
+ break; \
+ *outptr++ = from_ucs4[ch]; \
+ inptr += 4; \
+ } \
+ if (i == index) \
+ { \
+ ch = get32 (inptr); \
+ if (ch == 0) \
+ { \
+ /* This is no error, but handled differently. */ \
+ *outptr++ = from_ucs4[ch]; \
+ inptr += 4; \
+ continue; \
+ } \
+ } \
+ \
+ /* iconv/loop.c disables -Wmaybe-uninitialized for a false \
+ positive warning in this code with -Os and has a \
+ comment referencing this code accordingly. Updates in \
+ one place may require updates in the other. */ \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ \
+ /* This is an illegal character. */ \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ } \
+ } \
+ }
+
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+
+
+/* Generate ifunc'ed loop function. */
+s390_libc_ifunc_expr (__from_generic_c, __from_generic,
+ (sizeof (from_ucs4) / sizeof (from_ucs4[0]) <= 256
+ && hwcap & HWCAP_S390_VX)
+ ? __from_generic_vx
+ : __from_generic_c);
+
+s390_libc_ifunc_expr (__to_generic_c, __to_generic,
+ (sizeof (from_ucs4) / sizeof (from_ucs4[0]) <= 256
+ && hwcap & HWCAP_S390_VX)
+ ? __to_generic_vx
+ : __to_generic_c);
+
+strong_alias (__to_generic_c_single, __to_generic_single)
+
+# undef FROM_LOOP
+# undef TO_LOOP
+# define FROM_LOOP __from_generic
+# define TO_LOOP __to_generic
+# include <iconv/skeleton.c>
+
+#else
+/* Generate this module without ifunc if build environment lacks vector
+ support. Instead the common 8bit-generic.c is used. */
+# include "iconvdata/8bit-generic.c"
+#endif /* !defined HAVE_S390_VX_ASM_SUPPORT */
diff --git a/sysdeps/s390/multiarch/Makefile b/sysdeps/s390/multiarch/Makefile
index 0805b07984..c893ebc565 100644
--- a/sysdeps/s390/multiarch/Makefile
+++ b/sysdeps/s390/multiarch/Makefile
@@ -18,7 +18,8 @@ sysdep_routines += strlen strlen-vx strlen-c \
memchr memchr-vx \
rawmemchr rawmemchr-vx rawmemchr-c \
memccpy memccpy-vx memccpy-c \
- memrchr memrchr-vx memrchr-c
+ memrchr memrchr-vx memrchr-c \
+ mempcpy
endif
ifeq ($(subdir),wcsmbs)
@@ -42,3 +43,17 @@ sysdep_routines += wcslen wcslen-vx wcslen-c \
wmemset wmemset-vx wmemset-c \
wmemcmp wmemcmp-vx wmemcmp-c
endif
+
+ifeq ($(subdir),iconvdata)
+override define generate-8bit-table
+$(make-target-directory)
+LC_ALL=C $(SHELL) ./gen-8bit.sh $< > $(@:stmp=T)
+LC_ALL=C $(SHELL) ../sysdeps/s390/multiarch/gen-8bit.sh $< >> $(@:stmp=T)
+$(move-if-change) $(@:stmp=T) $(@:stmp=h)
+touch $@
+endef
+endif
+
+ifeq ($(subdir),iconv)
+sysdep_routines += gconv_simple
+endif
diff --git a/sysdeps/s390/multiarch/gconv_simple.c b/sysdeps/s390/multiarch/gconv_simple.c
new file mode 100644
index 0000000000..aaa1ebf74a
--- /dev/null
+++ b/sysdeps/s390/multiarch/gconv_simple.c
@@ -0,0 +1,1266 @@
+/* Simple transformations functions - s390 version.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+#if defined HAVE_S390_VX_ASM_SUPPORT
+# include <ifunc-resolve.h>
+
+# if defined HAVE_S390_VX_GCC_SUPPORT
+# define ASM_CLOBBER_VR(NR) , NR
+# else
+# define ASM_CLOBBER_VR(NR)
+# endif
+
+# define ICONV_C_NAME(NAME) __##NAME##_c
+# define ICONV_VX_NAME(NAME) __##NAME##_vx
+# define ICONV_VX_IFUNC(FUNC) \
+ extern __typeof (ICONV_C_NAME (FUNC)) __##FUNC; \
+ s390_vx_libc_ifunc (__##FUNC) \
+ int FUNC (struct __gconv_step *step, struct __gconv_step_data *data, \
+ const unsigned char **inptrp, const unsigned char *inend, \
+ unsigned char **outbufstart, size_t *irreversible, \
+ int do_flush, int consume_incomplete) \
+ { \
+ return __##FUNC (step, data, inptrp, inend,outbufstart, \
+ irreversible, do_flush, consume_incomplete); \
+ }
+# define ICONV_VX_SINGLE(NAME) \
+ static __typeof (NAME##_single) __##NAME##_vx_single __attribute__((alias(#NAME "_single")));
+
+/* Generate the transformations which are used, if the target machine does not
+ support vector instructions. */
+# define __gconv_transform_ascii_internal \
+ ICONV_C_NAME (__gconv_transform_ascii_internal)
+# define __gconv_transform_internal_ascii \
+ ICONV_C_NAME (__gconv_transform_internal_ascii)
+# define __gconv_transform_internal_ucs4le \
+ ICONV_C_NAME (__gconv_transform_internal_ucs4le)
+# define __gconv_transform_ucs4_internal \
+ ICONV_C_NAME (__gconv_transform_ucs4_internal)
+# define __gconv_transform_ucs4le_internal \
+ ICONV_C_NAME (__gconv_transform_ucs4le_internal)
+# define __gconv_transform_ucs2_internal \
+ ICONV_C_NAME (__gconv_transform_ucs2_internal)
+# define __gconv_transform_ucs2reverse_internal \
+ ICONV_C_NAME (__gconv_transform_ucs2reverse_internal)
+# define __gconv_transform_internal_ucs2 \
+ ICONV_C_NAME (__gconv_transform_internal_ucs2)
+# define __gconv_transform_internal_ucs2reverse \
+ ICONV_C_NAME (__gconv_transform_internal_ucs2reverse)
+
+
+# include <iconv/gconv_simple.c>
+
+# undef __gconv_transform_ascii_internal
+# undef __gconv_transform_internal_ascii
+# undef __gconv_transform_internal_ucs4le
+# undef __gconv_transform_ucs4_internal
+# undef __gconv_transform_ucs4le_internal
+# undef __gconv_transform_ucs2_internal
+# undef __gconv_transform_ucs2reverse_internal
+# undef __gconv_transform_internal_ucs2
+# undef __gconv_transform_internal_ucs2reverse
+
+/* Now define the functions with vector support. */
+# if defined __s390x__
+# define CONVERT_32BIT_SIZE_T(REG)
+# else
+# define CONVERT_32BIT_SIZE_T(REG) "llgfr %" #REG ",%" #REG "\n\t"
+# endif
+
+/* Convert from ISO 646-IRV to the internal (UCS4-like) format. */
+# define DEFINE_INIT 0
+# define DEFINE_FINI 0
+# define MIN_NEEDED_FROM 1
+# define MIN_NEEDED_TO 4
+# define FROM_DIRECTION 1
+# define FROM_LOOP ICONV_VX_NAME (ascii_internal_loop)
+# define TO_LOOP ICONV_VX_NAME (ascii_internal_loop) /* This is not used. */
+# define FUNCTION_NAME ICONV_VX_NAME (__gconv_transform_ascii_internal)
+# define ONE_DIRECTION 1
+
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define LOOPFCT FROM_LOOP
+# define BODY_ORIG_ERROR \
+ /* The value is too large. We don't try transliteration here since \
+ this is not an error because of the lack of possibilities to \
+ represent the result. This is a genuine bug in the input since \
+ ASCII does not allow such values. */ \
+ STANDARD_FROM_LOOP_ERR_HANDLER (1);
+
+# define BODY_ORIG \
+ { \
+ if (__glibc_unlikely (*inptr > '\x7f')) \
+ { \
+ BODY_ORIG_ERROR \
+ } \
+ else \
+ { \
+ /* It's an one byte sequence. */ \
+ *((uint32_t *) outptr) = *inptr++; \
+ outptr += sizeof (uint32_t); \
+ } \
+ }
+# define BODY \
+ { \
+ size_t len = inend - inptr; \
+ if (len > (outend - outptr) / 4) \
+ len = (outend - outptr) / 4; \
+ size_t loop_count, tmp; \
+ __asm__ volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_LEN]) \
+ " vrepib %%v30,0x7f\n\t" /* For compare > 0x7f. */ \
+ " srlg %[R_LI],%[R_LEN],4\n\t" \
+ " vrepib %%v31,0x20\n\t" \
+ " clgije %[R_LI],0,1f\n\t" \
+ "0: \n\t" /* Handle 16-byte blocks. */ \
+ " vl %%v16,0(%[R_IN])\n\t" \
+ /* Checking for values > 0x7f. */ \
+ " vstrcbs %%v17,%%v16,%%v30,%%v31\n\t" \
+ " jno 10f\n\t" \
+ /* Enlarge to UCS4. */ \
+ " vuplhb %%v17,%%v16\n\t" \
+ " vupllb %%v18,%%v16\n\t" \
+ " vuplhh %%v19,%%v17\n\t" \
+ " vupllh %%v20,%%v17\n\t" \
+ " vuplhh %%v21,%%v18\n\t" \
+ " vupllh %%v22,%%v18\n\t" \
+ /* Store 64bytes to buf_out. */ \
+ " vstm %%v19,%%v22,0(%[R_OUT])\n\t" \
+ " la %[R_IN],16(%[R_IN])\n\t" \
+ " la %[R_OUT],64(%[R_OUT])\n\t" \
+ " brctg %[R_LI],0b\n\t" \
+ " lghi %[R_LI],15\n\t" \
+ " ngr %[R_LEN],%[R_LI]\n\t" \
+ " je 20f\n\t" /* Jump away if no remaining bytes. */ \
+ /* Handle remaining bytes. */ \
+ "1: aghik %[R_LI],%[R_LEN],-1\n\t" \
+ " jl 20f\n\t" /* Jump away if no remaining bytes. */ \
+ " vll %%v16,%[R_LI],0(%[R_IN])\n\t" \
+ /* Checking for values > 0x7f. */ \
+ " vstrcbs %%v17,%%v16,%%v30,%%v31\n\t" \
+ " vlgvb %[R_TMP],%%v17,7\n\t" \
+ " clr %[R_TMP],%[R_LI]\n\t" \
+ " locrh %[R_TMP],%[R_LEN]\n\t" \
+ " locghih %[R_LEN],0\n\t" \
+ " j 12f\n\t" \
+ "10:\n\t" \
+ /* Found a value > 0x7f. \
+ Store the preceding chars. */ \
+ " vlgvb %[R_TMP],%%v17,7\n\t" \
+ "12: la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " sllk %[R_TMP],%[R_TMP],2\n\t" \
+ " ahi %[R_TMP],-1\n\t" \
+ " jl 20f\n\t" \
+ " lgr %[R_LI],%[R_TMP]\n\t" \
+ " vuplhb %%v17,%%v16\n\t" \
+ " vuplhh %%v19,%%v17\n\t" \
+ " vstl %%v19,%[R_LI],0(%[R_OUT])\n\t" \
+ " ahi %[R_LI],-16\n\t" \
+ " jl 11f\n\t" \
+ " vupllh %%v20,%%v17\n\t" \
+ " vstl %%v20,%[R_LI],16(%[R_OUT])\n\t" \
+ " ahi %[R_LI],-16\n\t" \
+ " jl 11f\n\t" \
+ " vupllb %%v18,%%v16\n\t" \
+ " vuplhh %%v21,%%v18\n\t" \
+ " vstl %%v21,%[R_LI],32(%[R_OUT])\n\t" \
+ " ahi %[R_LI],-16\n\t" \
+ " jl 11f\n\t" \
+ " vupllh %%v22,%%v18\n\t" \
+ " vstl %%v22,%[R_LI],48(%[R_OUT])\n\t" \
+ "11:\n\t" \
+ " la %[R_OUT],1(%[R_TMP],%[R_OUT])\n\t" \
+ "20:\n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_OUT] "+a" (outptr) \
+ , [R_IN] "+a" (inptr) \
+ , [R_LEN] "+d" (len) \
+ , [R_LI] "=d" (loop_count) \
+ , [R_TMP] "=a" (tmp) \
+ : /* inputs */ \
+ : /* clobber list*/ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v20") ASM_CLOBBER_VR ("v21") \
+ ASM_CLOBBER_VR ("v22") ASM_CLOBBER_VR ("v30") \
+ ASM_CLOBBER_VR ("v31") \
+ ); \
+ if (len > 0) \
+ { \
+ /* Found an invalid character at the next input byte. */ \
+ BODY_ORIG_ERROR \
+ } \
+ }
+
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+# include <iconv/skeleton.c>
+# undef BODY_ORIG
+# undef BODY_ORIG_ERROR
+ICONV_VX_IFUNC (__gconv_transform_ascii_internal)
+
+/* Convert from the internal (UCS4-like) format to ISO 646-IRV. */
+# define DEFINE_INIT 0
+# define DEFINE_FINI 0
+# define MIN_NEEDED_FROM 4
+# define MIN_NEEDED_TO 1
+# define FROM_DIRECTION 1
+# define FROM_LOOP ICONV_VX_NAME (internal_ascii_loop)
+# define TO_LOOP ICONV_VX_NAME (internal_ascii_loop) /* This is not used. */
+# define FUNCTION_NAME ICONV_VX_NAME (__gconv_transform_internal_ascii)
+# define ONE_DIRECTION 1
+
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define LOOPFCT FROM_LOOP
+# define BODY_ORIG_ERROR \
+ UNICODE_TAG_HANDLER (*((const uint32_t *) inptr), 4); \
+ STANDARD_TO_LOOP_ERR_HANDLER (4);
+
+# define BODY_ORIG \
+ { \
+ if (__glibc_unlikely (*((const uint32_t *) inptr) > 0x7f)) \
+ { \
+ BODY_ORIG_ERROR \
+ } \
+ else \
+ { \
+ /* It's an one byte sequence. */ \
+ *outptr++ = *((const uint32_t *) inptr); \
+ inptr += sizeof (uint32_t); \
+ } \
+ }
+# define BODY \
+ { \
+ size_t len = (inend - inptr) / 4; \
+ if (len > outend - outptr) \
+ len = outend - outptr; \
+ size_t loop_count, tmp, tmp2; \
+ __asm__ volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_LEN]) \
+ /* Setup to check for ch > 0x7f. */ \
+ " vzero %%v21\n\t" \
+ " srlg %[R_LI],%[R_LEN],4\n\t" \
+ " vleih %%v21,8192,0\n\t" /* element 0: > */ \
+ " vleih %%v21,-8192,2\n\t" /* element 1: =<> */ \
+ " vleif %%v20,127,0\n\t" /* element 0: 127 */ \
+ " lghi %[R_TMP],0\n\t" \
+ " clgije %[R_LI],0,1f\n\t" \
+ "0:\n\t" \
+ " vlm %%v16,%%v19,0(%[R_IN])\n\t" \
+ /* Shorten to byte values. */ \
+ " vpkf %%v23,%%v16,%%v17\n\t" \
+ " vpkf %%v24,%%v18,%%v19\n\t" \
+ " vpkh %%v23,%%v23,%%v24\n\t" \
+ /* Checking for values > 0x7f. */ \
+ " vstrcfs %%v22,%%v16,%%v20,%%v21\n\t" \
+ " jno 10f\n\t" \
+ " vstrcfs %%v22,%%v17,%%v20,%%v21\n\t" \
+ " jno 11f\n\t" \
+ " vstrcfs %%v22,%%v18,%%v20,%%v21\n\t" \
+ " jno 12f\n\t" \
+ " vstrcfs %%v22,%%v19,%%v20,%%v21\n\t" \
+ " jno 13f\n\t" \
+ /* Store 16bytes to outptr. */ \
+ " vst %%v23,0(%[R_OUT])\n\t" \
+ " la %[R_IN],64(%[R_IN])\n\t" \
+ " la %[R_OUT],16(%[R_OUT])\n\t" \
+ " brctg %[R_LI],0b\n\t" \
+ " lghi %[R_LI],15\n\t" \
+ " ngr %[R_LEN],%[R_LI]\n\t" \
+ " je 20f\n\t" /* Jump away if no remaining bytes. */ \
+ /* Handle remaining bytes. */ \
+ "1: sllg %[R_LI],%[R_LEN],2\n\t" \
+ " aghi %[R_LI],-1\n\t" \
+ " jl 20f\n\t" /* Jump away if no remaining bytes. */ \
+ /* Load remaining 1...63 bytes. */ \
+ " vll %%v16,%[R_LI],0(%[R_IN])\n\t" \
+ " ahi %[R_LI],-16\n\t" \
+ " jl 2f\n\t" \
+ " vll %%v17,%[R_LI],16(%[R_IN])\n\t" \
+ " ahi %[R_LI],-16\n\t" \
+ " jl 2f\n\t" \
+ " vll %%v18,%[R_LI],32(%[R_IN])\n\t" \
+ " ahi %[R_LI],-16\n\t" \
+ " jl 2f\n\t" \
+ " vll %%v19,%[R_LI],48(%[R_IN])\n\t" \
+ "2:\n\t" \
+ /* Shorten to byte values. */ \
+ " vpkf %%v23,%%v16,%%v17\n\t" \
+ " vpkf %%v24,%%v18,%%v19\n\t" \
+ " vpkh %%v23,%%v23,%%v24\n\t" \
+ " sllg %[R_LI],%[R_LEN],2\n\t" \
+ " aghi %[R_LI],-16\n\t" \
+ " jl 3f\n\t" /* v16 is not fully loaded. */ \
+ " vstrcfs %%v22,%%v16,%%v20,%%v21\n\t" \
+ " jno 10f\n\t" \
+ " aghi %[R_LI],-16\n\t" \
+ " jl 4f\n\t" /* v17 is not fully loaded. */ \
+ " vstrcfs %%v22,%%v17,%%v20,%%v21\n\t" \
+ " jno 11f\n\t" \
+ " aghi %[R_LI],-16\n\t" \
+ " jl 5f\n\t" /* v18 is not fully loaded. */ \
+ " vstrcfs %%v22,%%v18,%%v20,%%v21\n\t" \
+ " jno 12f\n\t" \
+ " aghi %[R_LI],-16\n\t" \
+ /* v19 is not fully loaded. */ \
+ " lghi %[R_TMP],12\n\t" \
+ " vstrcfs %%v22,%%v19,%%v20,%%v21\n\t" \
+ "6: vlgvb %[R_I],%%v22,7\n\t" \
+ " aghi %[R_LI],16\n\t" \
+ " clrjl %[R_I],%[R_LI],14f\n\t" \
+ " lgr %[R_I],%[R_LEN]\n\t" \
+ " lghi %[R_LEN],0\n\t" \
+ " j 15f\n\t" \
+ "3: vstrcfs %%v22,%%v16,%%v20,%%v21\n\t" \
+ " j 6b\n\t" \
+ "4: vstrcfs %%v22,%%v17,%%v20,%%v21\n\t" \
+ " lghi %[R_TMP],4\n\t" \
+ " j 6b\n\t" \
+ "5: vstrcfs %%v22,%%v17,%%v20,%%v21\n\t" \
+ " lghi %[R_TMP],8\n\t" \
+ " j 6b\n\t" \
+ /* Found a value > 0x7f. */ \
+ "13: ahi %[R_TMP],4\n\t" \
+ "12: ahi %[R_TMP],4\n\t" \
+ "11: ahi %[R_TMP],4\n\t" \
+ "10: vlgvb %[R_I],%%v22,7\n\t" \
+ "14: srlg %[R_I],%[R_I],2\n\t" \
+ " agr %[R_I],%[R_TMP]\n\t" \
+ " je 20f\n\t" \
+ /* Store characters before invalid one... */ \
+ "15: aghi %[R_I],-1\n\t" \
+ " vstl %%v23,%[R_I],0(%[R_OUT])\n\t" \
+ /* ... and update pointers. */ \
+ " la %[R_OUT],1(%[R_I],%[R_OUT])\n\t" \
+ " sllg %[R_I],%[R_I],2\n\t" \
+ " la %[R_IN],4(%[R_I],%[R_IN])\n\t" \
+ "20:\n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_OUT] "+a" (outptr) \
+ , [R_IN] "+a" (inptr) \
+ , [R_LEN] "+d" (len) \
+ , [R_LI] "=d" (loop_count) \
+ , [R_I] "=a" (tmp2) \
+ , [R_TMP] "=d" (tmp) \
+ : /* inputs */ \
+ : /* clobber list*/ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v20") ASM_CLOBBER_VR ("v21") \
+ ASM_CLOBBER_VR ("v22") ASM_CLOBBER_VR ("v23") \
+ ASM_CLOBBER_VR ("v24") \
+ ); \
+ if (len > 0) \
+ { \
+ /* Found an invalid character > 0x7f at next character. */ \
+ BODY_ORIG_ERROR \
+ } \
+ }
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+# include <iconv/skeleton.c>
+# undef BODY_ORIG
+# undef BODY_ORIG_ERROR
+ICONV_VX_IFUNC (__gconv_transform_internal_ascii)
+
+
+/* Convert from internal UCS4 to UCS4 little endian form. */
+# define DEFINE_INIT 0
+# define DEFINE_FINI 0
+# define MIN_NEEDED_FROM 4
+# define MIN_NEEDED_TO 4
+# define FROM_DIRECTION 1
+# define FROM_LOOP ICONV_VX_NAME (internal_ucs4le_loop)
+# define TO_LOOP ICONV_VX_NAME (internal_ucs4le_loop) /* This is not used. */
+# define FUNCTION_NAME ICONV_VX_NAME (__gconv_transform_internal_ucs4le)
+# define ONE_DIRECTION 0
+
+static inline int
+__attribute ((always_inline))
+ICONV_VX_NAME (internal_ucs4le_loop) (struct __gconv_step *step,
+ struct __gconv_step_data *step_data,
+ const unsigned char **inptrp,
+ const unsigned char *inend,
+ unsigned char **outptrp,
+ unsigned char *outend,
+ size_t *irreversible)
+{
+ const unsigned char *inptr = *inptrp;
+ unsigned char *outptr = *outptrp;
+ int result;
+ size_t len = MIN (inend - inptr, outend - outptr) / 4;
+ size_t loop_count;
+ __asm__ volatile (".machine push\n\t"
+ ".machine \"z13\"\n\t"
+ ".machinemode \"zarch_nohighgprs\"\n\t"
+ CONVERT_32BIT_SIZE_T ([R_LEN])
+ " bras %[R_LI],1f\n\t"
+ /* Vector permute mask: */
+ " .long 0x03020100,0x7060504,0x0B0A0908,0x0F0E0D0C\n\t"
+ "1: vl %%v20,0(%[R_LI])\n\t"
+ /* Process 64byte (16char) blocks. */
+ " srlg %[R_LI],%[R_LEN],4\n\t"
+ " clgije %[R_LI],0,10f\n\t"
+ "0: vlm %%v16,%%v19,0(%[R_IN])\n\t"
+ " vperm %%v16,%%v16,%%v16,%%v20\n\t"
+ " vperm %%v17,%%v17,%%v17,%%v20\n\t"
+ " vperm %%v18,%%v18,%%v18,%%v20\n\t"
+ " vperm %%v19,%%v19,%%v19,%%v20\n\t"
+ " vstm %%v16,%%v19,0(%[R_OUT])\n\t"
+ " la %[R_IN],64(%[R_IN])\n\t"
+ " la %[R_OUT],64(%[R_OUT])\n\t"
+ " brctg %[R_LI],0b\n\t"
+ " llgfr %[R_LEN],%[R_LEN]\n\t"
+ " nilf %[R_LEN],15\n\t"
+ /* Process 16byte (4char) blocks. */
+ "10: srlg %[R_LI],%[R_LEN],2\n\t"
+ " clgije %[R_LI],0,20f\n\t"
+ "11: vl %%v16,0(%[R_IN])\n\t"
+ " vperm %%v16,%%v16,%%v16,%%v20\n\t"
+ " vst %%v16,0(%[R_OUT])\n\t"
+ " la %[R_IN],16(%[R_IN])\n\t"
+ " la %[R_OUT],16(%[R_OUT])\n\t"
+ " brctg %[R_LI],11b\n\t"
+ " nill %[R_LEN],3\n\t"
+ /* Process <16bytes. */
+ "20: sll %[R_LEN],2\n\t"
+ " ahi %[R_LEN],-1\n\t"
+ " jl 30f\n\t"
+ " vll %%v16,%[R_LEN],0(%[R_IN])\n\t"
+ " vperm %%v16,%%v16,%%v16,%%v20\n\t"
+ " vstl %%v16,%[R_LEN],0(%[R_OUT])\n\t"
+ " la %[R_IN],1(%[R_LEN],%[R_IN])\n\t"
+ " la %[R_OUT],1(%[R_LEN],%[R_OUT])\n\t"
+ "30: \n\t"
+ ".machine pop"
+ : /* outputs */ [R_OUT] "+a" (outptr)
+ , [R_IN] "+a" (inptr)
+ , [R_LI] "=a" (loop_count)
+ , [R_LEN] "+a" (len)
+ : /* inputs */
+ : /* clobber list*/ "memory", "cc"
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17")
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19")
+ ASM_CLOBBER_VR ("v20")
+ );
+ *inptrp = inptr;
+ *outptrp = outptr;
+
+ /* Determine the status. */
+ if (*inptrp == inend)
+ result = __GCONV_EMPTY_INPUT;
+ else if (*outptrp + 4 > outend)
+ result = __GCONV_FULL_OUTPUT;
+ else
+ result = __GCONV_INCOMPLETE_INPUT;
+
+ return result;
+}
+
+ICONV_VX_SINGLE (internal_ucs4le_loop)
+# include <iconv/skeleton.c>
+ICONV_VX_IFUNC (__gconv_transform_internal_ucs4le)
+
+
+/* Transform from UCS4 to the internal, UCS4-like format. Unlike
+ for the other direction we have to check for correct values here. */
+# define DEFINE_INIT 0
+# define DEFINE_FINI 0
+# define MIN_NEEDED_FROM 4
+# define MIN_NEEDED_TO 4
+# define FROM_DIRECTION 1
+# define FROM_LOOP ICONV_VX_NAME (ucs4_internal_loop)
+# define TO_LOOP ICONV_VX_NAME (ucs4_internal_loop) /* This is not used. */
+# define FUNCTION_NAME ICONV_VX_NAME (__gconv_transform_ucs4_internal)
+# define ONE_DIRECTION 0
+
+
+static inline int
+__attribute ((always_inline))
+ICONV_VX_NAME (ucs4_internal_loop) (struct __gconv_step *step,
+ struct __gconv_step_data *step_data,
+ const unsigned char **inptrp,
+ const unsigned char *inend,
+ unsigned char **outptrp,
+ unsigned char *outend,
+ size_t *irreversible)
+{
+ int flags = step_data->__flags;
+ const unsigned char *inptr = *inptrp;
+ unsigned char *outptr = *outptrp;
+ int result;
+ size_t len, loop_count;
+ do
+ {
+ len = MIN (inend - inptr, outend - outptr) / 4;
+ __asm__ volatile (".machine push\n\t"
+ ".machine \"z13\"\n\t"
+ ".machinemode \"zarch_nohighgprs\"\n\t"
+ CONVERT_32BIT_SIZE_T ([R_LEN])
+ /* Setup to check for ch > 0x7fffffff. */
+ " larl %[R_LI],9f\n\t"
+ " vlm %%v20,%%v21,0(%[R_LI])\n\t"
+ " srlg %[R_LI],%[R_LEN],2\n\t"
+ " clgije %[R_LI],0,1f\n\t"
+ /* Process 16byte (4char) blocks. */
+ "0: vl %%v16,0(%[R_IN])\n\t"
+ " vstrcfs %%v22,%%v16,%%v20,%%v21\n\t"
+ " jno 10f\n\t"
+ " vst %%v16,0(%[R_OUT])\n\t"
+ " la %[R_IN],16(%[R_IN])\n\t"
+ " la %[R_OUT],16(%[R_OUT])\n\t"
+ " brctg %[R_LI],0b\n\t"
+ " llgfr %[R_LEN],%[R_LEN]\n\t"
+ " nilf %[R_LEN],3\n\t"
+ /* Process <16bytes. */
+ "1: sll %[R_LEN],2\n\t"
+ " ahik %[R_LI],%[R_LEN],-1\n\t"
+ " jl 20f\n\t" /* No further bytes available. */
+ " vll %%v16,%[R_LI],0(%[R_IN])\n\t"
+ " vstrcfs %%v22,%%v16,%%v20,%%v21\n\t"
+ " vlgvb %[R_LI],%%v22,7\n\t"
+ " clr %[R_LI],%[R_LEN]\n\t"
+ " locgrhe %[R_LI],%[R_LEN]\n\t"
+ " locghihe %[R_LEN],0\n\t"
+ " j 11f\n\t"
+ /* v20: Vector string range compare values. */
+ "9: .long 0x7fffffff,0x0,0x0,0x0\n\t"
+ /* v21: Vector string range compare control-bits.
+ element 0: >; element 1: =<> (always true) */
+ " .long 0x20000000,0xE0000000,0x0,0x0\n\t"
+ /* Found a value > 0x7fffffff. */
+ "10: vlgvb %[R_LI],%%v22,7\n\t"
+ /* Store characters before invalid one. */
+ "11: aghi %[R_LI],-1\n\t"
+ " jl 20f\n\t"
+ " vstl %%v16,%[R_LI],0(%[R_OUT])\n\t"
+ " la %[R_IN],1(%[R_LI],%[R_IN])\n\t"
+ " la %[R_OUT],1(%[R_LI],%[R_OUT])\n\t"
+ "20:\n\t"
+ ".machine pop"
+ : /* outputs */ [R_OUT] "+a" (outptr)
+ , [R_IN] "+a" (inptr)
+ , [R_LI] "=a" (loop_count)
+ , [R_LEN] "+d" (len)
+ : /* inputs */
+ : /* clobber list*/ "memory", "cc"
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v20")
+ ASM_CLOBBER_VR ("v21") ASM_CLOBBER_VR ("v22")
+ );
+ if (len > 0)
+ {
+ /* The value is too large. We don't try transliteration here since
+ this is not an error because of the lack of possibilities to
+ represent the result. This is a genuine bug in the input since
+ UCS4 does not allow such values. */
+ if (irreversible == NULL)
+ /* We are transliterating, don't try to correct anything. */
+ return __GCONV_ILLEGAL_INPUT;
+
+ if (flags & __GCONV_IGNORE_ERRORS)
+ {
+ /* Just ignore this character. */
+ ++*irreversible;
+ inptr += 4;
+ continue;
+ }
+
+ *inptrp = inptr;
+ *outptrp = outptr;
+ return __GCONV_ILLEGAL_INPUT;
+ }
+ }
+ while (len > 0);
+
+ *inptrp = inptr;
+ *outptrp = outptr;
+
+ /* Determine the status. */
+ if (*inptrp == inend)
+ result = __GCONV_EMPTY_INPUT;
+ else if (*outptrp + 4 > outend)
+ result = __GCONV_FULL_OUTPUT;
+ else
+ result = __GCONV_INCOMPLETE_INPUT;
+
+ return result;
+}
+
+ICONV_VX_SINGLE (ucs4_internal_loop)
+# include <iconv/skeleton.c>
+ICONV_VX_IFUNC (__gconv_transform_ucs4_internal)
+
+
+/* Transform from UCS4-LE to the internal encoding. */
+# define DEFINE_INIT 0
+# define DEFINE_FINI 0
+# define MIN_NEEDED_FROM 4
+# define MIN_NEEDED_TO 4
+# define FROM_DIRECTION 1
+# define FROM_LOOP ICONV_VX_NAME (ucs4le_internal_loop)
+# define TO_LOOP ICONV_VX_NAME (ucs4le_internal_loop) /* This is not used. */
+# define FUNCTION_NAME ICONV_VX_NAME (__gconv_transform_ucs4le_internal)
+# define ONE_DIRECTION 0
+
+static inline int
+__attribute ((always_inline))
+ICONV_VX_NAME (ucs4le_internal_loop) (struct __gconv_step *step,
+ struct __gconv_step_data *step_data,
+ const unsigned char **inptrp,
+ const unsigned char *inend,
+ unsigned char **outptrp,
+ unsigned char *outend,
+ size_t *irreversible)
+{
+ int flags = step_data->__flags;
+ const unsigned char *inptr = *inptrp;
+ unsigned char *outptr = *outptrp;
+ int result;
+ size_t len, loop_count;
+ do
+ {
+ len = MIN (inend - inptr, outend - outptr) / 4;
+ __asm__ volatile (".machine push\n\t"
+ ".machine \"z13\"\n\t"
+ ".machinemode \"zarch_nohighgprs\"\n\t"
+ CONVERT_32BIT_SIZE_T ([R_LEN])
+ /* Setup to check for ch > 0x7fffffff. */
+ " larl %[R_LI],9f\n\t"
+ " vlm %%v20,%%v22,0(%[R_LI])\n\t"
+ " srlg %[R_LI],%[R_LEN],2\n\t"
+ " clgije %[R_LI],0,1f\n\t"
+ /* Process 16byte (4char) blocks. */
+ "0: vl %%v16,0(%[R_IN])\n\t"
+ " vperm %%v16,%%v16,%%v16,%%v22\n\t"
+ " vstrcfs %%v23,%%v16,%%v20,%%v21\n\t"
+ " jno 10f\n\t"
+ " vst %%v16,0(%[R_OUT])\n\t"
+ " la %[R_IN],16(%[R_IN])\n\t"
+ " la %[R_OUT],16(%[R_OUT])\n\t"
+ " brctg %[R_LI],0b\n\t"
+ " llgfr %[R_LEN],%[R_LEN]\n\t"
+ " nilf %[R_LEN],3\n\t"
+ /* Process <16bytes. */
+ "1: sll %[R_LEN],2\n\t"
+ " ahik %[R_LI],%[R_LEN],-1\n\t"
+ " jl 20f\n\t" /* No further bytes available. */
+ " vll %%v16,%[R_LI],0(%[R_IN])\n\t"
+ " vperm %%v16,%%v16,%%v16,%%v22\n\t"
+ " vstrcfs %%v23,%%v16,%%v20,%%v21\n\t"
+ " vlgvb %[R_LI],%%v23,7\n\t"
+ " clr %[R_LI],%[R_LEN]\n\t"
+ " locgrhe %[R_LI],%[R_LEN]\n\t"
+ " locghihe %[R_LEN],0\n\t"
+ " j 11f\n\t"
+ /* v20: Vector string range compare values. */
+ "9: .long 0x7fffffff,0x0,0x0,0x0\n\t"
+ /* v21: Vector string range compare control-bits.
+ element 0: >; element 1: =<> (always true) */
+ " .long 0x20000000,0xE0000000,0x0,0x0\n\t"
+ /* v22: Vector permute mask. */
+ " .long 0x03020100,0x7060504,0x0B0A0908,0x0F0E0D0C\n\t"
+ /* Found a value > 0x7fffffff. */
+ "10: vlgvb %[R_LI],%%v23,7\n\t"
+ /* Store characters before invalid one. */
+ "11: aghi %[R_LI],-1\n\t"
+ " jl 20f\n\t"
+ " vstl %%v16,%[R_LI],0(%[R_OUT])\n\t"
+ " la %[R_IN],1(%[R_LI],%[R_IN])\n\t"
+ " la %[R_OUT],1(%[R_LI],%[R_OUT])\n\t"
+ "20:\n\t"
+ ".machine pop"
+ : /* outputs */ [R_OUT] "+a" (outptr)
+ , [R_IN] "+a" (inptr)
+ , [R_LI] "=a" (loop_count)
+ , [R_LEN] "+d" (len)
+ : /* inputs */
+ : /* clobber list*/ "memory", "cc"
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v20")
+ ASM_CLOBBER_VR ("v21") ASM_CLOBBER_VR ("v22")
+ ASM_CLOBBER_VR ("v23")
+ );
+ if (len > 0)
+ {
+ /* The value is too large. We don't try transliteration here since
+ this is not an error because of the lack of possibilities to
+ represent the result. This is a genuine bug in the input since
+ UCS4 does not allow such values. */
+ if (irreversible == NULL)
+ /* We are transliterating, don't try to correct anything. */
+ return __GCONV_ILLEGAL_INPUT;
+
+ if (flags & __GCONV_IGNORE_ERRORS)
+ {
+ /* Just ignore this character. */
+ ++*irreversible;
+ inptr += 4;
+ continue;
+ }
+
+ *inptrp = inptr;
+ *outptrp = outptr;
+ return __GCONV_ILLEGAL_INPUT;
+ }
+ }
+ while (len > 0);
+
+ *inptrp = inptr;
+ *outptrp = outptr;
+
+ /* Determine the status. */
+ if (*inptrp == inend)
+ result = __GCONV_EMPTY_INPUT;
+ else if (*inptrp + 4 > inend)
+ result = __GCONV_INCOMPLETE_INPUT;
+ else
+ {
+ assert (*outptrp + 4 > outend);
+ result = __GCONV_FULL_OUTPUT;
+ }
+
+ return result;
+}
+ICONV_VX_SINGLE (ucs4le_internal_loop)
+# include <iconv/skeleton.c>
+ICONV_VX_IFUNC (__gconv_transform_ucs4le_internal)
+
+/* Convert from UCS2 to the internal (UCS4-like) format. */
+# define DEFINE_INIT 0
+# define DEFINE_FINI 0
+# define MIN_NEEDED_FROM 2
+# define MIN_NEEDED_TO 4
+# define FROM_DIRECTION 1
+# define FROM_LOOP ICONV_VX_NAME (ucs2_internal_loop)
+# define TO_LOOP ICONV_VX_NAME (ucs2_internal_loop) /* This is not used. */
+# define FUNCTION_NAME ICONV_VX_NAME (__gconv_transform_ucs2_internal)
+# define ONE_DIRECTION 1
+
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define LOOPFCT FROM_LOOP
+# define BODY_ORIG_ERROR \
+ /* Surrogate characters in UCS-2 input are not valid. Reject \
+ them. (Catching this here is not security relevant.) */ \
+ STANDARD_FROM_LOOP_ERR_HANDLER (2);
+# define BODY_ORIG \
+ { \
+ uint16_t u1 = get16 (inptr); \
+ \
+ if (__glibc_unlikely (u1 >= 0xd800 && u1 < 0xe000)) \
+ { \
+ BODY_ORIG_ERROR \
+ } \
+ \
+ *((uint32_t *) outptr) = u1; \
+ outptr += sizeof (uint32_t); \
+ inptr += 2; \
+ }
+# define BODY \
+ { \
+ size_t len, tmp, tmp2; \
+ len = MIN ((inend - inptr) / 2, (outend - outptr) / 4); \
+ __asm__ volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_LEN]) \
+ /* Setup to check for ch >= 0xd800 && ch < 0xe000. */ \
+ " larl %[R_TMP],9f\n\t" \
+ " vlm %%v20,%%v21,0(%[R_TMP])\n\t" \
+ " srlg %[R_TMP],%[R_LEN],3\n\t" \
+ " clgije %[R_TMP],0,1f\n\t" \
+ /* Process 16byte (8char) blocks. */ \
+ "0: vl %%v16,0(%[R_IN])\n\t" \
+ " vstrchs %%v19,%%v16,%%v20,%%v21\n\t" \
+ /* Enlarge UCS2 to UCS4. */ \
+ " vuplhh %%v17,%%v16\n\t" \
+ " vupllh %%v18,%%v16\n\t" \
+ " jno 10f\n\t" \
+ /* Store 32bytes to buf_out. */ \
+ " vstm %%v17,%%v18,0(%[R_OUT])\n\t" \
+ " la %[R_IN],16(%[R_IN])\n\t" \
+ " la %[R_OUT],32(%[R_OUT])\n\t" \
+ " brctg %[R_TMP],0b\n\t" \
+ " llgfr %[R_LEN],%[R_LEN]\n\t" \
+ " nilf %[R_LEN],7\n\t" \
+ /* Process <16bytes. */ \
+ "1: sll %[R_LEN],1\n\t" \
+ " ahik %[R_TMP],%[R_LEN],-1\n\t" \
+ " jl 20f\n\t" /* No further bytes available. */ \
+ " vll %%v16,%[R_TMP],0(%[R_IN])\n\t" \
+ " vstrchs %%v19,%%v16,%%v20,%%v21\n\t" \
+ /* Enlarge UCS2 to UCS4. */ \
+ " vuplhh %%v17,%%v16\n\t" \
+ " vupllh %%v18,%%v16\n\t" \
+ " vlgvb %[R_TMP],%%v19,7\n\t" \
+ " clr %[R_TMP],%[R_LEN]\n\t" \
+ " locgrhe %[R_TMP],%[R_LEN]\n\t" \
+ " locghihe %[R_LEN],0\n\t" \
+ " j 11f\n\t" \
+ /* v20: Vector string range compare values. */ \
+ "9: .short 0xd800,0xe000,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ /* v21: Vector string range compare control-bits. \
+ element 0: =>; element 1: < */ \
+ " .short 0xa000,0x4000,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ /* Found an element: ch >= 0xd800 && ch < 0xe000 */ \
+ "10: vlgvb %[R_TMP],%%v19,7\n\t" \
+ "11: la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " sll %[R_TMP],1\n\t" \
+ " lgr %[R_TMP2],%[R_TMP]\n\t" \
+ " ahi %[R_TMP],-1\n\t" \
+ " jl 20f\n\t" \
+ " vstl %%v17,%[R_TMP],0(%[R_OUT])\n\t" \
+ " ahi %[R_TMP],-16\n\t" \
+ " jl 19f\n\t" \
+ " vstl %%v18,%[R_TMP],16(%[R_OUT])\n\t" \
+ "19: la %[R_OUT],0(%[R_TMP2],%[R_OUT])\n\t" \
+ "20: \n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_OUT] "+a" (outptr) \
+ , [R_IN] "+a" (inptr) \
+ , [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=a" (tmp2) \
+ , [R_LEN] "+d" (len) \
+ : /* inputs */ \
+ : /* clobber list*/ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v20") ASM_CLOBBER_VR ("v21") \
+ ); \
+ if (len > 0) \
+ { \
+ /* Found an invalid character at next input-char. */ \
+ BODY_ORIG_ERROR \
+ } \
+ }
+
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+# include <iconv/skeleton.c>
+# undef BODY_ORIG
+# undef BODY_ORIG_ERROR
+ICONV_VX_IFUNC (__gconv_transform_ucs2_internal)
+
+/* Convert from UCS2 in other endianness to the internal (UCS4-like) format. */
+# define DEFINE_INIT 0
+# define DEFINE_FINI 0
+# define MIN_NEEDED_FROM 2
+# define MIN_NEEDED_TO 4
+# define FROM_DIRECTION 1
+# define FROM_LOOP ICONV_VX_NAME (ucs2reverse_internal_loop)
+# define TO_LOOP ICONV_VX_NAME (ucs2reverse_internal_loop) /* This is not used.*/
+# define FUNCTION_NAME ICONV_VX_NAME (__gconv_transform_ucs2reverse_internal)
+# define ONE_DIRECTION 1
+
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define LOOPFCT FROM_LOOP
+# define BODY_ORIG_ERROR \
+ /* Surrogate characters in UCS-2 input are not valid. Reject \
+ them. (Catching this here is not security relevant.) */ \
+ if (! ignore_errors_p ()) \
+ { \
+ result = __GCONV_ILLEGAL_INPUT; \
+ break; \
+ } \
+ inptr += 2; \
+ ++*irreversible; \
+ continue;
+
+# define BODY_ORIG \
+ { \
+ uint16_t u1 = bswap_16 (get16 (inptr)); \
+ \
+ if (__glibc_unlikely (u1 >= 0xd800 && u1 < 0xe000)) \
+ { \
+ BODY_ORIG_ERROR \
+ } \
+ \
+ *((uint32_t *) outptr) = u1; \
+ outptr += sizeof (uint32_t); \
+ inptr += 2; \
+ }
+# define BODY \
+ { \
+ size_t len, tmp, tmp2; \
+ len = MIN ((inend - inptr) / 2, (outend - outptr) / 4); \
+ __asm__ volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_LEN]) \
+ /* Setup to check for ch >= 0xd800 && ch < 0xe000. */ \
+ " larl %[R_TMP],9f\n\t" \
+ " vlm %%v20,%%v22,0(%[R_TMP])\n\t" \
+ " srlg %[R_TMP],%[R_LEN],3\n\t" \
+ " clgije %[R_TMP],0,1f\n\t" \
+ /* Process 16byte (8char) blocks. */ \
+ "0: vl %%v16,0(%[R_IN])\n\t" \
+ " vperm %%v16,%%v16,%%v16,%%v22\n\t" \
+ " vstrchs %%v19,%%v16,%%v20,%%v21\n\t" \
+ /* Enlarge UCS2 to UCS4. */ \
+ " vuplhh %%v17,%%v16\n\t" \
+ " vupllh %%v18,%%v16\n\t" \
+ " jno 10f\n\t" \
+ /* Store 32bytes to buf_out. */ \
+ " vstm %%v17,%%v18,0(%[R_OUT])\n\t" \
+ " la %[R_IN],16(%[R_IN])\n\t" \
+ " la %[R_OUT],32(%[R_OUT])\n\t" \
+ " brctg %[R_TMP],0b\n\t" \
+ " llgfr %[R_LEN],%[R_LEN]\n\t" \
+ " nilf %[R_LEN],7\n\t" \
+ /* Process <16bytes. */ \
+ "1: sll %[R_LEN],1\n\t" \
+ " ahik %[R_TMP],%[R_LEN],-1\n\t" \
+ " jl 20f\n\t" /* No further bytes available. */ \
+ " vll %%v16,%[R_TMP],0(%[R_IN])\n\t" \
+ " vperm %%v16,%%v16,%%v16,%%v22\n\t" \
+ " vstrchs %%v19,%%v16,%%v20,%%v21\n\t" \
+ /* Enlarge UCS2 to UCS4. */ \
+ " vuplhh %%v17,%%v16\n\t" \
+ " vupllh %%v18,%%v16\n\t" \
+ " vlgvb %[R_TMP],%%v19,7\n\t" \
+ " clr %[R_TMP],%[R_LEN]\n\t" \
+ " locgrhe %[R_TMP],%[R_LEN]\n\t" \
+ " locghihe %[R_LEN],0\n\t" \
+ " j 11f\n\t" \
+ /* v20: Vector string range compare values. */ \
+ "9: .short 0xd800,0xe000,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ /* v21: Vector string range compare control-bits. \
+ element 0: =>; element 1: < */ \
+ " .short 0xa000,0x4000,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ /* v22: Vector permute mask. */ \
+ " .short 0x0100,0x0302,0x0504,0x0706\n\t" \
+ " .short 0x0908,0x0b0a,0x0d0c,0x0f0e\n\t" \
+ /* Found an element: ch >= 0xd800 && ch < 0xe000 */ \
+ "10: vlgvb %[R_TMP],%%v19,7\n\t" \
+ "11: la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " sll %[R_TMP],1\n\t" \
+ " lgr %[R_TMP2],%[R_TMP]\n\t" \
+ " ahi %[R_TMP],-1\n\t" \
+ " jl 20f\n\t" \
+ " vstl %%v17,%[R_TMP],0(%[R_OUT])\n\t" \
+ " ahi %[R_TMP],-16\n\t" \
+ " jl 19f\n\t" \
+ " vstl %%v18,%[R_TMP],16(%[R_OUT])\n\t" \
+ "19: la %[R_OUT],0(%[R_TMP2],%[R_OUT])\n\t" \
+ "20: \n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_OUT] "+a" (outptr) \
+ , [R_IN] "+a" (inptr) \
+ , [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=a" (tmp2) \
+ , [R_LEN] "+d" (len) \
+ : /* inputs */ \
+ : /* clobber list*/ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v20") ASM_CLOBBER_VR ("v21") \
+ ASM_CLOBBER_VR ("v22") \
+ ); \
+ if (len > 0) \
+ { \
+ /* Found an invalid character at next input-char. */ \
+ BODY_ORIG_ERROR \
+ } \
+ }
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+# include <iconv/skeleton.c>
+# undef BODY_ORIG
+# undef BODY_ORIG_ERROR
+ICONV_VX_IFUNC (__gconv_transform_ucs2reverse_internal)
+
+/* Convert from the internal (UCS4-like) format to UCS2. */
+#define DEFINE_INIT 0
+#define DEFINE_FINI 0
+#define MIN_NEEDED_FROM 4
+#define MIN_NEEDED_TO 2
+#define FROM_DIRECTION 1
+#define FROM_LOOP ICONV_VX_NAME (internal_ucs2_loop)
+#define TO_LOOP ICONV_VX_NAME (internal_ucs2_loop) /* This is not used. */
+#define FUNCTION_NAME ICONV_VX_NAME (__gconv_transform_internal_ucs2)
+#define ONE_DIRECTION 1
+
+#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+#define LOOPFCT FROM_LOOP
+#define BODY_ORIG \
+ { \
+ uint32_t val = *((const uint32_t *) inptr); \
+ \
+ if (__glibc_unlikely (val >= 0x10000)) \
+ { \
+ UNICODE_TAG_HANDLER (val, 4); \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ } \
+ else if (__glibc_unlikely (val >= 0xd800 && val < 0xe000)) \
+ { \
+ /* Surrogate characters in UCS-4 input are not valid. \
+ We must catch this, because the UCS-2 output might be \
+ interpreted as UTF-16 by other programs. If we let \
+ surrogates pass through, attackers could make a security \
+ hole exploit by synthesizing any desired plane 1-16 \
+ character. */ \
+ result = __GCONV_ILLEGAL_INPUT; \
+ if (! ignore_errors_p ()) \
+ break; \
+ inptr += 4; \
+ ++*irreversible; \
+ continue; \
+ } \
+ else \
+ { \
+ put16 (outptr, val); \
+ outptr += sizeof (uint16_t); \
+ inptr += 4; \
+ } \
+ }
+# define BODY \
+ { \
+ if (__builtin_expect (inend - inptr < 32, 1) \
+ || outend - outptr < 16) \
+ /* Convert remaining bytes with c code. */ \
+ BODY_ORIG \
+ else \
+ { \
+ /* Convert in 32 byte blocks. */ \
+ size_t loop_count = (inend - inptr) / 32; \
+ size_t tmp, tmp2; \
+ if (loop_count > (outend - outptr) / 16) \
+ loop_count = (outend - outptr) / 16; \
+ __asm__ volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_LI]) \
+ " larl %[R_I],3f\n\t" \
+ " vlm %%v20,%%v23,0(%[R_I])\n\t" \
+ "0: \n\t" \
+ " vlm %%v16,%%v17,0(%[R_IN])\n\t" \
+ /* Shorten UCS4 to UCS2. */ \
+ " vpkf %%v18,%%v16,%%v17\n\t" \
+ " vstrcfs %%v19,%%v16,%%v20,%%v21\n\t" \
+ " jno 11f\n\t" \
+ "1: vstrcfs %%v19,%%v17,%%v20,%%v21\n\t" \
+ " jno 10f\n\t" \
+ /* Store 16bytes to buf_out. */ \
+ "2: vst %%v18,0(%[R_OUT])\n\t" \
+ " la %[R_IN],32(%[R_IN])\n\t" \
+ " la %[R_OUT],16(%[R_OUT])\n\t" \
+ " brctg %[R_LI],0b\n\t" \
+ " j 20f\n\t" \
+ /* Setup to check for ch >= 0xd800. (v20, v21) */ \
+ "3: .long 0xd800,0xd800,0x0,0x0\n\t" \
+ " .long 0xa0000000,0xa0000000,0x0,0x0\n\t" \
+ /* Setup to check for ch >= 0xe000 \
+ && ch < 0x10000. (v22,v23) */ \
+ " .long 0xe000,0x10000,0x0,0x0\n\t" \
+ " .long 0xa0000000,0x40000000,0x0,0x0\n\t" \
+ /* v16 contains only valid chars. Check in v17: \
+ ch >= 0xe000 && ch <= 0xffff. */ \
+ "10: vstrcfs %%v19,%%v17,%%v22,%%v23,8\n\t" \
+ " jo 2b\n\t" /* All ch's in this range, proceed. */ \
+ " lghi %[R_TMP],16\n\t" \
+ " j 12f\n\t" \
+ /* Maybe v16 contains invalid chars. \
+ Check ch >= 0xe000 && ch <= 0xffff. */ \
+ "11: vstrcfs %%v19,%%v16,%%v22,%%v23,8\n\t" \
+ " jo 1b\n\t" /* All ch's in this range, proceed. */ \
+ " lghi %[R_TMP],0\n\t" \
+ "12: vlgvb %[R_I],%%v19,7\n\t" \
+ " agr %[R_I],%[R_TMP]\n\t" \
+ " la %[R_IN],0(%[R_I],%[R_IN])\n\t" \
+ " srl %[R_I],1\n\t" \
+ " ahi %[R_I],-1\n\t" \
+ " jl 20f\n\t" \
+ " vstl %%v18,%[R_I],0(%[R_OUT])\n\t" \
+ " la %[R_OUT],1(%[R_I],%[R_OUT])\n\t" \
+ "20:\n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_OUT] "+a" (outptr) \
+ , [R_IN] "+a" (inptr) \
+ , [R_LI] "+d" (loop_count) \
+ , [R_I] "=a" (tmp2) \
+ , [R_TMP] "=d" (tmp) \
+ : /* inputs */ \
+ : /* clobber list*/ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v20") ASM_CLOBBER_VR ("v21") \
+ ASM_CLOBBER_VR ("v22") ASM_CLOBBER_VR ("v23") \
+ ); \
+ if (loop_count > 0) \
+ { \
+ /* Found an invalid character at next character. */ \
+ BODY_ORIG \
+ } \
+ } \
+ }
+#define LOOP_NEED_FLAGS
+#include <iconv/loop.c>
+#include <iconv/skeleton.c>
+# undef BODY_ORIG
+ICONV_VX_IFUNC (__gconv_transform_internal_ucs2)
+
+/* Convert from the internal (UCS4-like) format to UCS2 in other endianness. */
+#define DEFINE_INIT 0
+#define DEFINE_FINI 0
+#define MIN_NEEDED_FROM 4
+#define MIN_NEEDED_TO 2
+#define FROM_DIRECTION 1
+#define FROM_LOOP ICONV_VX_NAME (internal_ucs2reverse_loop)
+#define TO_LOOP ICONV_VX_NAME (internal_ucs2reverse_loop)/* This is not used.*/
+#define FUNCTION_NAME ICONV_VX_NAME (__gconv_transform_internal_ucs2reverse)
+#define ONE_DIRECTION 1
+
+#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+#define LOOPFCT FROM_LOOP
+#define BODY_ORIG \
+ { \
+ uint32_t val = *((const uint32_t *) inptr); \
+ if (__glibc_unlikely (val >= 0x10000)) \
+ { \
+ UNICODE_TAG_HANDLER (val, 4); \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ } \
+ else if (__glibc_unlikely (val >= 0xd800 && val < 0xe000)) \
+ { \
+ /* Surrogate characters in UCS-4 input are not valid. \
+ We must catch this, because the UCS-2 output might be \
+ interpreted as UTF-16 by other programs. If we let \
+ surrogates pass through, attackers could make a security \
+ hole exploit by synthesizing any desired plane 1-16 \
+ character. */ \
+ if (! ignore_errors_p ()) \
+ { \
+ result = __GCONV_ILLEGAL_INPUT; \
+ break; \
+ } \
+ inptr += 4; \
+ ++*irreversible; \
+ continue; \
+ } \
+ else \
+ { \
+ put16 (outptr, bswap_16 (val)); \
+ outptr += sizeof (uint16_t); \
+ inptr += 4; \
+ } \
+ }
+# define BODY \
+ { \
+ if (__builtin_expect (inend - inptr < 32, 1) \
+ || outend - outptr < 16) \
+ /* Convert remaining bytes with c code. */ \
+ BODY_ORIG \
+ else \
+ { \
+ /* Convert in 32 byte blocks. */ \
+ size_t loop_count = (inend - inptr) / 32; \
+ size_t tmp, tmp2; \
+ if (loop_count > (outend - outptr) / 16) \
+ loop_count = (outend - outptr) / 16; \
+ __asm__ volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_LI]) \
+ " larl %[R_I],3f\n\t" \
+ " vlm %%v20,%%v24,0(%[R_I])\n\t" \
+ "0: \n\t" \
+ " vlm %%v16,%%v17,0(%[R_IN])\n\t" \
+ /* Shorten UCS4 to UCS2 and byteswap. */ \
+ " vpkf %%v18,%%v16,%%v17\n\t" \
+ " vperm %%v18,%%v18,%%v18,%%v24\n\t" \
+ " vstrcfs %%v19,%%v16,%%v20,%%v21\n\t" \
+ " jno 11f\n\t" \
+ "1: vstrcfs %%v19,%%v17,%%v20,%%v21\n\t" \
+ " jno 10f\n\t" \
+ /* Store 16bytes to buf_out. */ \
+ "2: vst %%v18,0(%[R_OUT])\n\t" \
+ " la %[R_IN],32(%[R_IN])\n\t" \
+ " la %[R_OUT],16(%[R_OUT])\n\t" \
+ " brctg %[R_LI],0b\n\t" \
+ " j 20f\n\t" \
+ /* Setup to check for ch >= 0xd800. (v20, v21) */ \
+ "3: .long 0xd800,0xd800,0x0,0x0\n\t" \
+ " .long 0xa0000000,0xa0000000,0x0,0x0\n\t" \
+ /* Setup to check for ch >= 0xe000 \
+ && ch < 0x10000. (v22,v23) */ \
+ " .long 0xe000,0x10000,0x0,0x0\n\t" \
+ " .long 0xa0000000,0x40000000,0x0,0x0\n\t" \
+ /* Vector permute mask (v24) */ \
+ " .short 0x0100,0x0302,0x0504,0x0706\n\t" \
+ " .short 0x0908,0x0b0a,0x0d0c,0x0f0e\n\t" \
+ /* v16 contains only valid chars. Check in v17: \
+ ch >= 0xe000 && ch <= 0xffff. */ \
+ "10: vstrcfs %%v19,%%v17,%%v22,%%v23,8\n\t" \
+ " jo 2b\n\t" /* All ch's in this range, proceed. */ \
+ " lghi %[R_TMP],16\n\t" \
+ " j 12f\n\t" \
+ /* Maybe v16 contains invalid chars. \
+ Check ch >= 0xe000 && ch <= 0xffff. */ \
+ "11: vstrcfs %%v19,%%v16,%%v22,%%v23,8\n\t" \
+ " jo 1b\n\t" /* All ch's in this range, proceed. */ \
+ " lghi %[R_TMP],0\n\t" \
+ "12: vlgvb %[R_I],%%v19,7\n\t" \
+ " agr %[R_I],%[R_TMP]\n\t" \
+ " la %[R_IN],0(%[R_I],%[R_IN])\n\t" \
+ " srl %[R_I],1\n\t" \
+ " ahi %[R_I],-1\n\t" \
+ " jl 20f\n\t" \
+ " vstl %%v18,%[R_I],0(%[R_OUT])\n\t" \
+ " la %[R_OUT],1(%[R_I],%[R_OUT])\n\t" \
+ "20:\n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_OUT] "+a" (outptr) \
+ , [R_IN] "+a" (inptr) \
+ , [R_LI] "+d" (loop_count) \
+ , [R_I] "=a" (tmp2) \
+ , [R_TMP] "=d" (tmp) \
+ : /* inputs */ \
+ : /* clobber list*/ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v20") ASM_CLOBBER_VR ("v21") \
+ ASM_CLOBBER_VR ("v22") ASM_CLOBBER_VR ("v23") \
+ ASM_CLOBBER_VR ("v24") \
+ ); \
+ if (loop_count > 0) \
+ { \
+ /* Found an invalid character at next character. */ \
+ BODY_ORIG \
+ } \
+ } \
+ }
+#define LOOP_NEED_FLAGS
+#include <iconv/loop.c>
+#include <iconv/skeleton.c>
+# undef BODY_ORIG
+ICONV_VX_IFUNC (__gconv_transform_internal_ucs2reverse)
+
+
+#else
+/* Generate the internal transformations without ifunc if build environment
+ lacks vector support. Instead simply include the common version. */
+# include <iconv/gconv_simple.c>
+#endif /* !defined HAVE_S390_VX_ASM_SUPPORT */
diff --git a/sysdeps/s390/multiarch/gen-8bit.sh b/sysdeps/s390/multiarch/gen-8bit.sh
new file mode 100644
index 0000000000..6f88c4bd9d
--- /dev/null
+++ b/sysdeps/s390/multiarch/gen-8bit.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+echo "static const uint8_t to_ucs1[256] = {"
+sed -ne '/^[^[:space:]]*[[:space:]]*.x00/d;/^END/q' \
+ -e 's/^<U00\(..\)>[[:space:]]*.x\(..\).*/ [0x\2] = 0x\1,/p' \
+ "$@" | sort -u
+echo "};"
diff --git a/sysdeps/s390/multiarch/iconv/skeleton.c b/sysdeps/s390/multiarch/iconv/skeleton.c
new file mode 100644
index 0000000000..8774a536ca
--- /dev/null
+++ b/sysdeps/s390/multiarch/iconv/skeleton.c
@@ -0,0 +1,21 @@
+/* Skeleton for a conversion module - S390 version.
+ Copyright (C) 2016-2018 Free Software 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 IGNORE_ICONV_SKELETON
+# include_next <iconv/skeleton.c>
+#endif
diff --git a/sysdeps/s390/multiarch/ifunc-impl-list.c b/sysdeps/s390/multiarch/ifunc-impl-list.c
index 62a435983c..ec3373ae26 100644
--- a/sysdeps/s390/multiarch/ifunc-impl-list.c
+++ b/sysdeps/s390/multiarch/ifunc-impl-list.c
@@ -1,5 +1,5 @@
/* Enumerate available IFUNC implementations of a function. s390/s390x version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -69,6 +69,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
S390_IS_Z10 (stfle_bits), __memcpy_z10)
IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_default))
+ IFUNC_IMPL (i, name, mempcpy,
+ IFUNC_IMPL_ADD (array, i, mempcpy,
+ S390_IS_Z196 (stfle_bits), ____mempcpy_z196)
+ IFUNC_IMPL_ADD (array, i, mempcpy,
+ S390_IS_Z10 (stfle_bits), ____mempcpy_z10)
+ IFUNC_IMPL_ADD (array, i, mempcpy, 1, ____mempcpy_default))
+
#endif /* SHARED */
#ifdef HAVE_S390_VX_ASM_SUPPORT
diff --git a/sysdeps/s390/multiarch/ifunc-resolve.h b/sysdeps/s390/multiarch/ifunc-resolve.h
index 744a0d8d6d..b42ed922fd 100644
--- a/sysdeps/s390/multiarch/ifunc-resolve.h
+++ b/sysdeps/s390/multiarch/ifunc-resolve.h
@@ -1,6 +1,6 @@
/* IFUNC resolver function for CPU specific functions.
32/64 bit S/390 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,55 +40,51 @@
".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" \
- ".globl __GI_" #FUNC "\n\t" \
- ".set __GI_" #FUNC "," #FUNC "\n"); \
- \
+#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_ifunc_redirected(TYPE_FUNC, FUNC) \
+ s390_vx_libc_ifunc2_redirected(TYPE_FUNC, FUNC, FUNC)
-#define s390_vx_libc_ifunc2(RESOLVERFUNC, 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);
+
+#define s390_libc_ifunc_expr_init()
+#define s390_libc_ifunc_expr(TYPE_FUNC, FUNC, EXPR) \
+ __ifunc (TYPE_FUNC, FUNC, EXPR, unsigned long int hwcap, \
+ s390_libc_ifunc_expr_init);
diff --git a/sysdeps/s390/multiarch/memccpy-c.c b/sysdeps/s390/multiarch/memccpy-c.c
index 9309bd108b..1f4c548199 100644
--- a/sysdeps/s390/multiarch/memccpy-c.c
+++ b/sysdeps/s390/multiarch/memccpy-c.c
@@ -1,5 +1,5 @@
/* Default memccpy implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/memccpy-vx.S b/sysdeps/s390/multiarch/memccpy-vx.S
index 2db9b2cef4..150aa0e4a4 100644
--- a/sysdeps/s390/multiarch/memccpy-vx.S
+++ b/sysdeps/s390/multiarch/memccpy-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of memccpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/memccpy.c b/sysdeps/s390/multiarch/memccpy.c
index 0a0936e340..30aae82321 100644
--- a/sysdeps/s390/multiarch/memccpy.c
+++ b/sysdeps/s390/multiarch/memccpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of memccpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/memchr-vx.S b/sysdeps/s390/multiarch/memchr-vx.S
index 875eee2b43..77d31e0036 100644
--- a/sysdeps/s390/multiarch/memchr-vx.S
+++ b/sysdeps/s390/multiarch/memchr-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of memchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/memchr.c b/sysdeps/s390/multiarch/memchr.c
index f80de1cc1f..3885ebaa4d 100644
--- a/sysdeps/s390/multiarch/memchr.c
+++ b/sysdeps/s390/multiarch/memchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of memchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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
new file mode 100644
index 0000000000..363fe47aef
--- /dev/null
+++ b/sysdeps/s390/multiarch/mempcpy.c
@@ -0,0 +1,32 @@
+/* Multiple versions of mempcpy.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+
+#if defined SHARED && IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
+# define __NO_STRING_INLINES
+# define NO_MEMPCPY_STPCPY_REDIRECT
+# include <string.h>
+# undef mempcpy
+# undef __mempcpy
+# include <ifunc-resolve.h>
+
+s390_libc_ifunc (__redirect___mempcpy, ____mempcpy, __mempcpy)
+weak_alias (__mempcpy, mempcpy);
+#endif
diff --git a/sysdeps/s390/multiarch/memrchr-c.c b/sysdeps/s390/multiarch/memrchr-c.c
index af54097376..1e3c914a5d 100644
--- a/sysdeps/s390/multiarch/memrchr-c.c
+++ b/sysdeps/s390/multiarch/memrchr-c.c
@@ -1,5 +1,5 @@
/* Default memrchr implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/memrchr-vx.S b/sysdeps/s390/multiarch/memrchr-vx.S
index fdb8c30ebe..8e81f5ed75 100644
--- a/sysdeps/s390/multiarch/memrchr-vx.S
+++ b/sysdeps/s390/multiarch/memrchr-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of memrchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/memrchr.c b/sysdeps/s390/multiarch/memrchr.c
index 7681890d01..43a44abcf6 100644
--- a/sysdeps/s390/multiarch/memrchr.c
+++ b/sysdeps/s390/multiarch/memrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of memrchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/rawmemchr-c.c b/sysdeps/s390/multiarch/rawmemchr-c.c
index 20dcdb5a28..f43c883a76 100644
--- a/sysdeps/s390/multiarch/rawmemchr-c.c
+++ b/sysdeps/s390/multiarch/rawmemchr-c.c
@@ -1,5 +1,5 @@
/* Default rawmemchr implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/rawmemchr-vx.S b/sysdeps/s390/multiarch/rawmemchr-vx.S
index 5af2419e98..d5778be068 100644
--- a/sysdeps/s390/multiarch/rawmemchr-vx.S
+++ b/sysdeps/s390/multiarch/rawmemchr-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of rawmemchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/rawmemchr.c b/sysdeps/s390/multiarch/rawmemchr.c
index 7186ccd9d4..5fdb2252df 100644
--- a/sysdeps/s390/multiarch/rawmemchr.c
+++ b/sysdeps/s390/multiarch/rawmemchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of rawmemchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/stpcpy-c.c
index 85a8a93c7f..4a1c3e5832 100644
--- a/sysdeps/s390/multiarch/stpcpy-c.c
+++ b/sysdeps/s390/multiarch/stpcpy-c.c
@@ -1,5 +1,5 @@
/* Default stpcpy implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/stpcpy-vx.S b/sysdeps/s390/multiarch/stpcpy-vx.S
index da9f2760de..6c17def0fc 100644
--- a/sysdeps/s390/multiarch/stpcpy-vx.S
+++ b/sysdeps/s390/multiarch/stpcpy-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of stpcpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/stpcpy.c b/sysdeps/s390/multiarch/stpcpy.c
index dcde01278b..654f9dfbef 100644
--- a/sysdeps/s390/multiarch/stpcpy.c
+++ b/sysdeps/s390/multiarch/stpcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of stpcpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/stpncpy-c.c
index 32b61a8e3e..45e50aa9e7 100644
--- a/sysdeps/s390/multiarch/stpncpy-c.c
+++ b/sysdeps/s390/multiarch/stpncpy-c.c
@@ -1,5 +1,5 @@
/* Default stpncpy implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/stpncpy-vx.S b/sysdeps/s390/multiarch/stpncpy-vx.S
index 2e536d9e0f..922bd7a355 100644
--- a/sysdeps/s390/multiarch/stpncpy-vx.S
+++ b/sysdeps/s390/multiarch/stpncpy-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of stpncpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/stpncpy.c b/sysdeps/s390/multiarch/stpncpy.c
index f5335b42ac..f7f9d51a50 100644
--- a/sysdeps/s390/multiarch/stpncpy.c
+++ b/sysdeps/s390/multiarch/stpncpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of stpncpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/strcat-c.c
index ae7cc2149d..f871faa7b5 100644
--- a/sysdeps/s390/multiarch/strcat-c.c
+++ b/sysdeps/s390/multiarch/strcat-c.c
@@ -1,5 +1,5 @@
/* Default strcat implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strcat-vx.S b/sysdeps/s390/multiarch/strcat-vx.S
index e77fc2aa2f..3abbbccced 100644
--- a/sysdeps/s390/multiarch/strcat-vx.S
+++ b/sysdeps/s390/multiarch/strcat-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strcat.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strcat.c b/sysdeps/s390/multiarch/strcat.c
index c3b5e1c9d6..7d4126b44f 100644
--- a/sysdeps/s390/multiarch/strcat.c
+++ b/sysdeps/s390/multiarch/strcat.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcat.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/strchr-c.c
index 2250dbbf5e..606cb56788 100644
--- a/sysdeps/s390/multiarch/strchr-c.c
+++ b/sysdeps/s390/multiarch/strchr-c.c
@@ -1,5 +1,5 @@
/* Default strchr implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strchr-vx.S b/sysdeps/s390/multiarch/strchr-vx.S
index 4fe5dc0293..6e744fb82f 100644
--- a/sysdeps/s390/multiarch/strchr-vx.S
+++ b/sysdeps/s390/multiarch/strchr-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strchr.c b/sysdeps/s390/multiarch/strchr.c
index 3c8c7e4600..8aa33a51cc 100644
--- a/sysdeps/s390/multiarch/strchr.c
+++ b/sysdeps/s390/multiarch/strchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of strchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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/strchrnul-c.c b/sysdeps/s390/multiarch/strchrnul-c.c
index 1f77c40cea..020cebcf3e 100644
--- a/sysdeps/s390/multiarch/strchrnul-c.c
+++ b/sysdeps/s390/multiarch/strchrnul-c.c
@@ -1,5 +1,5 @@
/* Default strchrnul implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strchrnul-vx.S b/sysdeps/s390/multiarch/strchrnul-vx.S
index 43ca29ead0..d561825e04 100644
--- a/sysdeps/s390/multiarch/strchrnul-vx.S
+++ b/sysdeps/s390/multiarch/strchrnul-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strchrnul.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strchrnul.c b/sysdeps/s390/multiarch/strchrnul.c
index 627c084521..62dfc6bd90 100644
--- a/sysdeps/s390/multiarch/strchrnul.c
+++ b/sysdeps/s390/multiarch/strchrnul.c
@@ -1,5 +1,5 @@
/* Multiple versions of strchrnul.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strcmp-vx.S b/sysdeps/s390/multiarch/strcmp-vx.S
index edf557b5eb..bcaeb564d4 100644
--- a/sysdeps/s390/multiarch/strcmp-vx.S
+++ b/sysdeps/s390/multiarch/strcmp-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strcmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strcmp.c b/sysdeps/s390/multiarch/strcmp.c
index c4ccd34420..7c8b17b304 100644
--- a/sysdeps/s390/multiarch/strcmp.c
+++ b/sysdeps/s390/multiarch/strcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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-vx.S b/sysdeps/s390/multiarch/strcpy-vx.S
index d3472b821d..52197f57f7 100644
--- a/sysdeps/s390/multiarch/strcpy-vx.S
+++ b/sysdeps/s390/multiarch/strcpy-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strcpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strcpy.c b/sysdeps/s390/multiarch/strcpy.c
index f348199112..8f32a13f67 100644
--- a/sysdeps/s390/multiarch/strcpy.c
+++ b/sysdeps/s390/multiarch/strcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/strcspn-c.c
index bc195b6625..7b454f5b56 100644
--- a/sysdeps/s390/multiarch/strcspn-c.c
+++ b/sysdeps/s390/multiarch/strcspn-c.c
@@ -1,5 +1,5 @@
/* Default strcspn implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strcspn-vx.S b/sysdeps/s390/multiarch/strcspn-vx.S
index 1c6250661e..ea1668742b 100644
--- a/sysdeps/s390/multiarch/strcspn-vx.S
+++ b/sysdeps/s390/multiarch/strcspn-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strcspn.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strcspn.c b/sysdeps/s390/multiarch/strcspn.c
index c23452a791..418ffcdded 100644
--- a/sysdeps/s390/multiarch/strcspn.c
+++ b/sysdeps/s390/multiarch/strcspn.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcspn.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/strlen-c.c
index 63c0d9e3e6..a2c8e43624 100644
--- a/sysdeps/s390/multiarch/strlen-c.c
+++ b/sysdeps/s390/multiarch/strlen-c.c
@@ -1,5 +1,5 @@
/* Default strlen implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strlen-vx.S b/sysdeps/s390/multiarch/strlen-vx.S
index 3fe834a0c7..9308b33237 100644
--- a/sysdeps/s390/multiarch/strlen-vx.S
+++ b/sysdeps/s390/multiarch/strlen-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strlen.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strlen.c b/sysdeps/s390/multiarch/strlen.c
index 098d4e1e58..0edf8b7d02 100644
--- a/sysdeps/s390/multiarch/strlen.c
+++ b/sysdeps/s390/multiarch/strlen.c
@@ -1,5 +1,5 @@
/* Multiple versions of strlen.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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/strncat-c.c b/sysdeps/s390/multiarch/strncat-c.c
index 538b1fa51e..9e6c245ccb 100644
--- a/sysdeps/s390/multiarch/strncat-c.c
+++ b/sysdeps/s390/multiarch/strncat-c.c
@@ -1,5 +1,5 @@
/* Default strncat implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,6 @@
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
# define STRNCAT __strncat_c
-
+# define STRNCAT_PRIMARY
# include <string/strncat.c>
#endif
diff --git a/sysdeps/s390/multiarch/strncat-vx.S b/sysdeps/s390/multiarch/strncat-vx.S
index b9857c1233..e6584d0f43 100644
--- a/sysdeps/s390/multiarch/strncat-vx.S
+++ b/sysdeps/s390/multiarch/strncat-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strncat.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strncat.c b/sysdeps/s390/multiarch/strncat.c
index eb1410d5ac..94b8dffa85 100644
--- a/sysdeps/s390/multiarch/strncat.c
+++ b/sysdeps/s390/multiarch/strncat.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncat.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strncmp-c.c b/sysdeps/s390/multiarch/strncmp-c.c
index e781aefbe3..e54277ec1b 100644
--- a/sysdeps/s390/multiarch/strncmp-c.c
+++ b/sysdeps/s390/multiarch/strncmp-c.c
@@ -1,5 +1,5 @@
/* Default strncmp implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strncmp-vx.S b/sysdeps/s390/multiarch/strncmp-vx.S
index 9c4b207f41..168fd657da 100644
--- a/sysdeps/s390/multiarch/strncmp-vx.S
+++ b/sysdeps/s390/multiarch/strncmp-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strncmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strncmp.c b/sysdeps/s390/multiarch/strncmp.c
index 9a72c79bfd..0ec472c3b0 100644
--- a/sysdeps/s390/multiarch/strncmp.c
+++ b/sysdeps/s390/multiarch/strncmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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-vx.S b/sysdeps/s390/multiarch/strncpy-vx.S
index 08a0b29e8b..2a37b7b84e 100644
--- a/sysdeps/s390/multiarch/strncpy-vx.S
+++ b/sysdeps/s390/multiarch/strncpy-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strncpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strncpy.c b/sysdeps/s390/multiarch/strncpy.c
index 1464551875..2d4c456d96 100644
--- a/sysdeps/s390/multiarch/strncpy.c
+++ b/sysdeps/s390/multiarch/strncpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/strnlen-c.c
index 99ad65a103..353e83ed35 100644
--- a/sysdeps/s390/multiarch/strnlen-c.c
+++ b/sysdeps/s390/multiarch/strnlen-c.c
@@ -1,5 +1,5 @@
/* Default strnlen implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strnlen-vx.S b/sysdeps/s390/multiarch/strnlen-vx.S
index 3e3a31dd9c..fc659a956c 100644
--- a/sysdeps/s390/multiarch/strnlen-vx.S
+++ b/sysdeps/s390/multiarch/strnlen-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strnlen.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strnlen.c b/sysdeps/s390/multiarch/strnlen.c
index 48c3bb73e6..0f9cff5d69 100644
--- a/sysdeps/s390/multiarch/strnlen.c
+++ b/sysdeps/s390/multiarch/strnlen.c
@@ -1,5 +1,5 @@
/* Multiple versions of strnlen.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/strpbrk-c.c
index 49c5e1258b..2c0517aeb5 100644
--- a/sysdeps/s390/multiarch/strpbrk-c.c
+++ b/sysdeps/s390/multiarch/strpbrk-c.c
@@ -1,5 +1,5 @@
/* Default strpbrk implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strpbrk-vx.S b/sysdeps/s390/multiarch/strpbrk-vx.S
index 6a0bbd9d19..e19c550ed4 100644
--- a/sysdeps/s390/multiarch/strpbrk-vx.S
+++ b/sysdeps/s390/multiarch/strpbrk-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strpbrk.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strpbrk.c b/sysdeps/s390/multiarch/strpbrk.c
index cdc139929f..11afc268f7 100644
--- a/sysdeps/s390/multiarch/strpbrk.c
+++ b/sysdeps/s390/multiarch/strpbrk.c
@@ -1,5 +1,5 @@
/* Multiple versions of strpbrk.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/strrchr-c.c
index 2513af956d..53ceb8086f 100644
--- a/sysdeps/s390/multiarch/strrchr-c.c
+++ b/sysdeps/s390/multiarch/strrchr-c.c
@@ -1,5 +1,5 @@
/* Default strrchr implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strrchr-vx.S b/sysdeps/s390/multiarch/strrchr-vx.S
index 175d2cba3c..8b3b989631 100644
--- a/sysdeps/s390/multiarch/strrchr-vx.S
+++ b/sysdeps/s390/multiarch/strrchr-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strrchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strrchr.c b/sysdeps/s390/multiarch/strrchr.c
index e515d6b6e6..e00e25a3a4 100644
--- a/sysdeps/s390/multiarch/strrchr.c
+++ b/sysdeps/s390/multiarch/strrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of strrchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/strspn-c.c
index 8928d3cc24..0efe61bfb2 100644
--- a/sysdeps/s390/multiarch/strspn-c.c
+++ b/sysdeps/s390/multiarch/strspn-c.c
@@ -1,5 +1,5 @@
/* Default strspn implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strspn-vx.S b/sysdeps/s390/multiarch/strspn-vx.S
index 65d295937a..6aa823e63b 100644
--- a/sysdeps/s390/multiarch/strspn-vx.S
+++ b/sysdeps/s390/multiarch/strspn-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of strspn.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/strspn.c b/sysdeps/s390/multiarch/strspn.c
index 7c26af8ced..bedbe98cfc 100644
--- a/sysdeps/s390/multiarch/strspn.c
+++ b/sysdeps/s390/multiarch/strspn.c
@@ -1,5 +1,5 @@
/* Multiple versions of strspn.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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/utf16-utf32-z9.c b/sysdeps/s390/multiarch/utf16-utf32-z9.c
new file mode 100644
index 0000000000..46a23b09bf
--- /dev/null
+++ b/sysdeps/s390/multiarch/utf16-utf32-z9.c
@@ -0,0 +1,48 @@
+/* Conversion between UTF-16 and UTF-32 BE/internal - multiarch s390 version.
+
+ Copyright (C) 2017-2018 Free Software 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 <sysdeps/s390/utf16-utf32-z9.c>
+#include <ifunc-resolve.h>
+
+#undef FROM_LOOP
+#define FROM_LOOP __from_utf16_loop
+#undef TO_LOOP
+#define TO_LOOP __to_utf16_loop
+
+#define _SINGLE_NAME(NAME) NAME##_single
+#define SINGLE_NAME(NAME) _SINGLE_NAME(NAME)
+strong_alias (SINGLE_NAME (FROM_LOOP_DEFAULT), SINGLE_NAME (FROM_LOOP))
+strong_alias (SINGLE_NAME (TO_LOOP_DEFAULT), SINGLE_NAME (TO_LOOP))
+
+/* Generate ifunc'ed loop functions for FROM/TO_LOOP. */
+s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP,
+ (HAVE_FROM_VX_CU && (hwcap & HWCAP_S390_VXE))
+ ? FROM_LOOP_VX_CU
+ : (HAVE_FROM_VX && (hwcap & HWCAP_S390_VX))
+ ? FROM_LOOP_VX
+ : FROM_LOOP_DEFAULT);
+
+s390_libc_ifunc_expr (TO_LOOP_DEFAULT, TO_LOOP,
+ (HAVE_TO_VX_CU && (hwcap & HWCAP_S390_VXE))
+ ? TO_LOOP_VX_CU
+ : (HAVE_TO_VX && (hwcap & HWCAP_S390_VX))
+ ? TO_LOOP_VX
+ : TO_LOOP_DEFAULT);
+
+#include <iconv/skeleton.c>
diff --git a/sysdeps/s390/multiarch/utf8-utf16-z9.c b/sysdeps/s390/multiarch/utf8-utf16-z9.c
new file mode 100644
index 0000000000..ad9b3fbcea
--- /dev/null
+++ b/sysdeps/s390/multiarch/utf8-utf16-z9.c
@@ -0,0 +1,50 @@
+/* Conversion between UTF-8 and UTF-16 - multiarch s390 version.
+
+ Copyright (C) 2017-2018 Free Software 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 <sysdeps/s390/utf8-utf16-z9.c>
+#include <ifunc-resolve.h>
+
+#undef FROM_LOOP
+#define FROM_LOOP __from_utf8_loop
+#undef TO_LOOP
+#define TO_LOOP __to_utf8_loop
+
+#define _SINGLE_NAME(NAME) NAME##_single
+#define SINGLE_NAME(NAME) _SINGLE_NAME(NAME)
+strong_alias (SINGLE_NAME (FROM_LOOP_DEFAULT), SINGLE_NAME (FROM_LOOP))
+strong_alias (SINGLE_NAME (TO_LOOP_DEFAULT), SINGLE_NAME (TO_LOOP))
+
+/* Generate ifunc'ed loop functions for FROM/TO_LOOP. */
+s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP,
+ (HAVE_FROM_VX && (hwcap & HWCAP_S390_VX))
+ ? FROM_LOOP_VX
+ : (HAVE_FROM_CU && (hwcap & HWCAP_S390_ZARCH
+ && hwcap & HWCAP_S390_HIGH_GPRS
+ && hwcap & HWCAP_S390_ETF3EH))
+ ? FROM_LOOP_CU
+ : FROM_LOOP_DEFAULT);
+
+s390_libc_ifunc_expr (TO_LOOP_DEFAULT, TO_LOOP,
+ (HAVE_TO_VX_CU && (hwcap & HWCAP_S390_VXE))
+ ? TO_LOOP_VX_CU
+ : (HAVE_TO_VX && (hwcap & HWCAP_S390_VX))
+ ? TO_LOOP_VX
+ : TO_LOOP_DEFAULT);
+
+#include <iconv/skeleton.c>
diff --git a/sysdeps/s390/multiarch/utf8-utf32-z9.c b/sysdeps/s390/multiarch/utf8-utf32-z9.c
new file mode 100644
index 0000000000..011feeeea8
--- /dev/null
+++ b/sysdeps/s390/multiarch/utf8-utf32-z9.c
@@ -0,0 +1,50 @@
+/* Conversion between UTF-8 and UTF-32 - multiarch s390 version.
+
+ Copyright (C) 2017-2018 Free Software 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 <sysdeps/s390/utf8-utf32-z9.c>
+#include <ifunc-resolve.h>
+
+#undef FROM_LOOP
+#define FROM_LOOP __from_utf8_loop
+#undef TO_LOOP
+#define TO_LOOP __to_utf8_loop
+
+#define _SINGLE_NAME(NAME) NAME##_single
+#define SINGLE_NAME(NAME) _SINGLE_NAME(NAME)
+strong_alias (SINGLE_NAME (FROM_LOOP_DEFAULT), SINGLE_NAME (FROM_LOOP))
+strong_alias (SINGLE_NAME (TO_LOOP_DEFAULT), SINGLE_NAME (TO_LOOP))
+
+/* Generate ifunc'ed loop functions for FROM/TO_LOOP. */
+s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP,
+ (HAVE_FROM_VX && (hwcap & HWCAP_S390_VX))
+ ? FROM_LOOP_VX
+ : (HAVE_FROM_CU && (hwcap & HWCAP_S390_ZARCH
+ && hwcap & HWCAP_S390_HIGH_GPRS
+ && hwcap & HWCAP_S390_ETF3EH))
+ ? FROM_LOOP_CU
+ : FROM_LOOP_DEFAULT);
+
+s390_libc_ifunc_expr (TO_LOOP_DEFAULT, TO_LOOP,
+ (HAVE_TO_VX_CU && (hwcap & HWCAP_S390_VXE))
+ ? TO_LOOP_VX_CU
+ : (HAVE_TO_VX && (hwcap & HWCAP_S390_VX))
+ ? TO_LOOP_VX
+ : TO_LOOP_DEFAULT);
+
+#include <iconv/skeleton.c>
diff --git a/sysdeps/s390/multiarch/wcpcpy-c.c b/sysdeps/s390/multiarch/wcpcpy-c.c
index b4849a3321..e3282fde19 100644
--- a/sysdeps/s390/multiarch/wcpcpy-c.c
+++ b/sysdeps/s390/multiarch/wcpcpy-c.c
@@ -1,5 +1,5 @@
/* Default wcslen implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcpcpy-vx.S b/sysdeps/s390/multiarch/wcpcpy-vx.S
index 8a466c6a37..bff6e85628 100644
--- a/sysdeps/s390/multiarch/wcpcpy-vx.S
+++ b/sysdeps/s390/multiarch/wcpcpy-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcpcpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcpcpy.c b/sysdeps/s390/multiarch/wcpcpy.c
index 8afd98d7d4..f19d376d85 100644
--- a/sysdeps/s390/multiarch/wcpcpy.c
+++ b/sysdeps/s390/multiarch/wcpcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcpcpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcpncpy-c.c b/sysdeps/s390/multiarch/wcpncpy-c.c
index 86db27b525..1f44bacea9 100644
--- a/sysdeps/s390/multiarch/wcpncpy-c.c
+++ b/sysdeps/s390/multiarch/wcpncpy-c.c
@@ -1,5 +1,5 @@
/* Default wcsncpy implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcpncpy-vx.S b/sysdeps/s390/multiarch/wcpncpy-vx.S
index ca0203f451..004f512e1f 100644
--- a/sysdeps/s390/multiarch/wcpncpy-vx.S
+++ b/sysdeps/s390/multiarch/wcpncpy-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcpncpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcpncpy.c b/sysdeps/s390/multiarch/wcpncpy.c
index 13bc543a8a..b72265fbe9 100644
--- a/sysdeps/s390/multiarch/wcpncpy.c
+++ b/sysdeps/s390/multiarch/wcpncpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcpncpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscat-c.c b/sysdeps/s390/multiarch/wcscat-c.c
index bceec55408..9a31c65a0b 100644
--- a/sysdeps/s390/multiarch/wcscat-c.c
+++ b/sysdeps/s390/multiarch/wcscat-c.c
@@ -1,5 +1,5 @@
/* Default wcscat implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscat-vx.S b/sysdeps/s390/multiarch/wcscat-vx.S
index 8353caafa9..2164a8da41 100644
--- a/sysdeps/s390/multiarch/wcscat-vx.S
+++ b/sysdeps/s390/multiarch/wcscat-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcscat.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscat.c b/sysdeps/s390/multiarch/wcscat.c
index 8d71c2f1b9..33e4f6da3f 100644
--- a/sysdeps/s390/multiarch/wcscat.c
+++ b/sysdeps/s390/multiarch/wcscat.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcscat.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcschr-c.c b/sysdeps/s390/multiarch/wcschr-c.c
index 9ba1d5f861..8d6679c7f2 100644
--- a/sysdeps/s390/multiarch/wcschr-c.c
+++ b/sysdeps/s390/multiarch/wcschr-c.c
@@ -1,5 +1,5 @@
/* Default wcschr implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcschr-vx.S b/sysdeps/s390/multiarch/wcschr-vx.S
index ff7d1c4b4e..94e5df7f36 100644
--- a/sysdeps/s390/multiarch/wcschr-vx.S
+++ b/sysdeps/s390/multiarch/wcschr-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcschr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcschr.c b/sysdeps/s390/multiarch/wcschr.c
index fb51097cd6..f44138f771 100644
--- a/sysdeps/s390/multiarch/wcschr.c
+++ b/sysdeps/s390/multiarch/wcschr.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcschr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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/wcschrnul-c.c b/sysdeps/s390/multiarch/wcschrnul-c.c
index bbee3288fe..00e776a3ad 100644
--- a/sysdeps/s390/multiarch/wcschrnul-c.c
+++ b/sysdeps/s390/multiarch/wcschrnul-c.c
@@ -1,5 +1,5 @@
/* Default wcschrnul implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcschrnul-vx.S b/sysdeps/s390/multiarch/wcschrnul-vx.S
index e54e48d894..ebcd32b870 100644
--- a/sysdeps/s390/multiarch/wcschrnul-vx.S
+++ b/sysdeps/s390/multiarch/wcschrnul-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcschrnul.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcschrnul.c b/sysdeps/s390/multiarch/wcschrnul.c
index 7436a596bd..807d7ee089 100644
--- a/sysdeps/s390/multiarch/wcschrnul.c
+++ b/sysdeps/s390/multiarch/wcschrnul.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcschrnul.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscmp-c.c b/sysdeps/s390/multiarch/wcscmp-c.c
index 3add8e4095..ce0817ae97 100644
--- a/sysdeps/s390/multiarch/wcscmp-c.c
+++ b/sysdeps/s390/multiarch/wcscmp-c.c
@@ -1,5 +1,5 @@
/* Default wcscmp implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscmp-vx.S b/sysdeps/s390/multiarch/wcscmp-vx.S
index 549ae3c733..14267dbfc7 100644
--- a/sysdeps/s390/multiarch/wcscmp-vx.S
+++ b/sysdeps/s390/multiarch/wcscmp-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcscmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscmp.c b/sysdeps/s390/multiarch/wcscmp.c
index 705ef4596e..5ee0fd4d88 100644
--- a/sysdeps/s390/multiarch/wcscmp.c
+++ b/sysdeps/s390/multiarch/wcscmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcscmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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/wcscpy-c.c b/sysdeps/s390/multiarch/wcscpy-c.c
index 3450c00048..4a510f466b 100644
--- a/sysdeps/s390/multiarch/wcscpy-c.c
+++ b/sysdeps/s390/multiarch/wcscpy-c.c
@@ -1,5 +1,5 @@
/* Default wcscpy implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscpy-vx.S b/sysdeps/s390/multiarch/wcscpy-vx.S
index 2077893130..c2e81055be 100644
--- a/sysdeps/s390/multiarch/wcscpy-vx.S
+++ b/sysdeps/s390/multiarch/wcscpy-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcscpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscpy.c b/sysdeps/s390/multiarch/wcscpy.c
index 8c5f54910b..e69baa6c59 100644
--- a/sysdeps/s390/multiarch/wcscpy.c
+++ b/sysdeps/s390/multiarch/wcscpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcscpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscspn-c.c b/sysdeps/s390/multiarch/wcscspn-c.c
index e8fd2a53d9..161e52e686 100644
--- a/sysdeps/s390/multiarch/wcscspn-c.c
+++ b/sysdeps/s390/multiarch/wcscspn-c.c
@@ -1,5 +1,5 @@
/* Default wcscscpn implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscspn-vx.S b/sysdeps/s390/multiarch/wcscspn-vx.S
index b0b1066658..06bc4e25d0 100644
--- a/sysdeps/s390/multiarch/wcscspn-vx.S
+++ b/sysdeps/s390/multiarch/wcscspn-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcscspn.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcscspn.c b/sysdeps/s390/multiarch/wcscspn.c
index ebd77734ac..707327522a 100644
--- a/sysdeps/s390/multiarch/wcscspn.c
+++ b/sysdeps/s390/multiarch/wcscspn.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcscspn.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcslen-c.c b/sysdeps/s390/multiarch/wcslen-c.c
index dcbe3094d9..32a23e206d 100644
--- a/sysdeps/s390/multiarch/wcslen-c.c
+++ b/sysdeps/s390/multiarch/wcslen-c.c
@@ -1,5 +1,5 @@
/* Default wcslen implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcslen-vx.S b/sysdeps/s390/multiarch/wcslen-vx.S
index dafb7b799d..337cbed6ec 100644
--- a/sysdeps/s390/multiarch/wcslen-vx.S
+++ b/sysdeps/s390/multiarch/wcslen-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcslen.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcslen.c b/sysdeps/s390/multiarch/wcslen.c
index 540845f70a..3a1d1a32c9 100644
--- a/sysdeps/s390/multiarch/wcslen.c
+++ b/sysdeps/s390/multiarch/wcslen.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcslen.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsncat-c.c b/sysdeps/s390/multiarch/wcsncat-c.c
index e8cc219eac..2cf1a76385 100644
--- a/sysdeps/s390/multiarch/wcsncat-c.c
+++ b/sysdeps/s390/multiarch/wcsncat-c.c
@@ -1,5 +1,5 @@
/* Default wcsncat implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsncat-vx.S b/sysdeps/s390/multiarch/wcsncat-vx.S
index 4264f6d21d..1d3935690d 100644
--- a/sysdeps/s390/multiarch/wcsncat-vx.S
+++ b/sysdeps/s390/multiarch/wcsncat-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcsncat.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsncat.c b/sysdeps/s390/multiarch/wcsncat.c
index 62073321e8..c49b8ff786 100644
--- a/sysdeps/s390/multiarch/wcsncat.c
+++ b/sysdeps/s390/multiarch/wcsncat.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcsncat.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsncmp-c.c b/sysdeps/s390/multiarch/wcsncmp-c.c
index 8f2573810d..92ab5e8b50 100644
--- a/sysdeps/s390/multiarch/wcsncmp-c.c
+++ b/sysdeps/s390/multiarch/wcsncmp-c.c
@@ -1,5 +1,5 @@
/* Default wcsncmp implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsncmp-vx.S b/sysdeps/s390/multiarch/wcsncmp-vx.S
index e77f17dcaf..34c203bc90 100644
--- a/sysdeps/s390/multiarch/wcsncmp-vx.S
+++ b/sysdeps/s390/multiarch/wcsncmp-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcsncmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsncmp.c b/sysdeps/s390/multiarch/wcsncmp.c
index 3482d90e4e..ee5f08c1e4 100644
--- a/sysdeps/s390/multiarch/wcsncmp.c
+++ b/sysdeps/s390/multiarch/wcsncmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcsncmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsncpy-c.c b/sysdeps/s390/multiarch/wcsncpy-c.c
index b63d86ef5f..6b89b8c14b 100644
--- a/sysdeps/s390/multiarch/wcsncpy-c.c
+++ b/sysdeps/s390/multiarch/wcsncpy-c.c
@@ -1,5 +1,5 @@
/* Default wcsncpy implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsncpy-vx.S b/sysdeps/s390/multiarch/wcsncpy-vx.S
index 33cc33f28b..b3400d50d9 100644
--- a/sysdeps/s390/multiarch/wcsncpy-vx.S
+++ b/sysdeps/s390/multiarch/wcsncpy-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcsncpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsncpy.c b/sysdeps/s390/multiarch/wcsncpy.c
index eb225a97b4..7209c7d431 100644
--- a/sysdeps/s390/multiarch/wcsncpy.c
+++ b/sysdeps/s390/multiarch/wcsncpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcsncpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsnlen-c.c b/sysdeps/s390/multiarch/wcsnlen-c.c
index 89984e9f18..8f43f5104f 100644
--- a/sysdeps/s390/multiarch/wcsnlen-c.c
+++ b/sysdeps/s390/multiarch/wcsnlen-c.c
@@ -1,5 +1,5 @@
/* Default wcsnlen implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsnlen-vx.S b/sysdeps/s390/multiarch/wcsnlen-vx.S
index 1ba00c3cae..420f29fbc0 100644
--- a/sysdeps/s390/multiarch/wcsnlen-vx.S
+++ b/sysdeps/s390/multiarch/wcsnlen-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcsnlen.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsnlen.c b/sysdeps/s390/multiarch/wcsnlen.c
index 4308472a81..5234074b1f 100644
--- a/sysdeps/s390/multiarch/wcsnlen.c
+++ b/sysdeps/s390/multiarch/wcsnlen.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcsnlen.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcspbrk-c.c b/sysdeps/s390/multiarch/wcspbrk-c.c
index 8b74eaf017..6b6e7aade4 100644
--- a/sysdeps/s390/multiarch/wcspbrk-c.c
+++ b/sysdeps/s390/multiarch/wcspbrk-c.c
@@ -1,5 +1,5 @@
/* Default wcspbrk implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcspbrk-vx.S b/sysdeps/s390/multiarch/wcspbrk-vx.S
index 3e28e9aa90..5c89ec5d33 100644
--- a/sysdeps/s390/multiarch/wcspbrk-vx.S
+++ b/sysdeps/s390/multiarch/wcspbrk-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcspbrk.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcspbrk.c b/sysdeps/s390/multiarch/wcspbrk.c
index 198144d2c5..97876328b5 100644
--- a/sysdeps/s390/multiarch/wcspbrk.c
+++ b/sysdeps/s390/multiarch/wcspbrk.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcspbrk.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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/wcsrchr-c.c b/sysdeps/s390/multiarch/wcsrchr-c.c
index eac588b79e..615250358b 100644
--- a/sysdeps/s390/multiarch/wcsrchr-c.c
+++ b/sysdeps/s390/multiarch/wcsrchr-c.c
@@ -1,5 +1,5 @@
/* Default wcsrchr implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsrchr-vx.S b/sysdeps/s390/multiarch/wcsrchr-vx.S
index 0b99edc7a5..e40a554e5d 100644
--- a/sysdeps/s390/multiarch/wcsrchr-vx.S
+++ b/sysdeps/s390/multiarch/wcsrchr-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcsrchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsrchr.c b/sysdeps/s390/multiarch/wcsrchr.c
index 9281e12898..aa0b8a8f82 100644
--- a/sysdeps/s390/multiarch/wcsrchr.c
+++ b/sysdeps/s390/multiarch/wcsrchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcsrchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsspn-c.c b/sysdeps/s390/multiarch/wcsspn-c.c
index 54c2698bd8..2c0bd0f4e6 100644
--- a/sysdeps/s390/multiarch/wcsspn-c.c
+++ b/sysdeps/s390/multiarch/wcsspn-c.c
@@ -1,5 +1,5 @@
/* Default wcsspn implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsspn-vx.S b/sysdeps/s390/multiarch/wcsspn-vx.S
index e1785ea7cf..548f2ad164 100644
--- a/sysdeps/s390/multiarch/wcsspn-vx.S
+++ b/sysdeps/s390/multiarch/wcsspn-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wcsspn.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wcsspn.c b/sysdeps/s390/multiarch/wcsspn.c
index 167a881d13..7743144a8c 100644
--- a/sysdeps/s390/multiarch/wcsspn.c
+++ b/sysdeps/s390/multiarch/wcsspn.c
@@ -1,5 +1,5 @@
/* Multiple versions of wcsspn.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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.c b/sysdeps/s390/multiarch/wmemchr-c.c
index 32dddc6c3d..089392b512 100644
--- a/sysdeps/s390/multiarch/wmemchr-c.c
+++ b/sysdeps/s390/multiarch/wmemchr-c.c
@@ -1,5 +1,5 @@
/* Default wmemchr implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wmemchr-vx.S b/sysdeps/s390/multiarch/wmemchr-vx.S
index a729681341..db057b579a 100644
--- a/sysdeps/s390/multiarch/wmemchr-vx.S
+++ b/sysdeps/s390/multiarch/wmemchr-vx.S
@@ -1,5 +1,5 @@
/* Vector optimized 32/64 bit S/390 version of wmemchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wmemchr.c b/sysdeps/s390/multiarch/wmemchr.c
index f2bfe3c7a5..6b55c1d7fa 100644
--- a/sysdeps/s390/multiarch/wmemchr.c
+++ b/sysdeps/s390/multiarch/wmemchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of wmemchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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/wmemcmp-c.c b/sysdeps/s390/multiarch/wmemcmp-c.c
index 683385431e..2fd39d5013 100644
--- a/sysdeps/s390/multiarch/wmemcmp-c.c
+++ b/sysdeps/s390/multiarch/wmemcmp-c.c
@@ -1,5 +1,5 @@
/* Default wmemcmp implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wmemcmp-vx.S b/sysdeps/s390/multiarch/wmemcmp-vx.S
index 761cc17771..e2fc21e419 100644
--- a/sysdeps/s390/multiarch/wmemcmp-vx.S
+++ b/sysdeps/s390/multiarch/wmemcmp-vx.S
@@ -1,5 +1,5 @@
/* Vector Optimized 32/64 bit S/390 version of wmemcmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wmemcmp.c b/sysdeps/s390/multiarch/wmemcmp.c
index 95106fcaf9..a4cb440c45 100644
--- a/sysdeps/s390/multiarch/wmemcmp.c
+++ b/sysdeps/s390/multiarch/wmemcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of wmemcmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wmemset-c.c b/sysdeps/s390/multiarch/wmemset-c.c
index 61ccd8fc09..1969cf93dc 100644
--- a/sysdeps/s390/multiarch/wmemset-c.c
+++ b/sysdeps/s390/multiarch/wmemset-c.c
@@ -1,5 +1,5 @@
/* Default wmemset implementation for S/390.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wmemset-vx.S b/sysdeps/s390/multiarch/wmemset-vx.S
index 7a28bb4ca6..0c2f6337b0 100644
--- a/sysdeps/s390/multiarch/wmemset-vx.S
+++ b/sysdeps/s390/multiarch/wmemset-vx.S
@@ -1,5 +1,5 @@
/* Vector Optimized 32/64 bit S/390 version of wmemset.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/multiarch/wmemset.c b/sysdeps/s390/multiarch/wmemset.c
index e9e695fc0a..149b481470 100644
--- a/sysdeps/s390/multiarch/wmemset.c
+++ b/sysdeps/s390/multiarch/wmemset.c
@@ -1,5 +1,5 @@
/* Multiple versions of wmemset.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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..2b0d392c06 100644
--- a/sysdeps/s390/nptl/Makefile
+++ b/sysdeps/s390/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -20,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-arch.h b/sysdeps/s390/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..20db42c8a0
--- /dev/null
+++ b/sysdeps/s390/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,79 @@
+/* Copyright (C) 2003-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __SIZEOF_PTHREAD_ATTR_T 56
+# define __SIZEOF_PTHREAD_MUTEX_T 40
+# define __SIZEOF_PTHREAD_RWLOCK_T 56
+# define __SIZEOF_PTHREAD_BARRIER_T 32
+#else
+# define __SIZEOF_PTHREAD_ATTR_T 36
+# define __SIZEOF_PTHREAD_MUTEX_T 24
+# define __SIZEOF_PTHREAD_RWLOCK_T 32
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+#endif
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Definitions for internal mutex struct. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 1
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND (__WORDSIZE != 64)
+#define __PTHREAD_MUTEX_USE_UNION (__WORDSIZE != 64)
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+#if __WORDSIZE == 64
+ int __cur_writer;
+ int __shared;
+ unsigned long int __pad1;
+ unsigned long int __pad2;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned int __flags;
+# else
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ int __cur_writer;
+#endif
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/s390/nptl/bits/pthreadtypes.h b/sysdeps/s390/nptl/bits/pthreadtypes.h
deleted file mode 100644
index 40d10fea59..0000000000
--- a/sysdeps/s390/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,248 +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/>. */
-
-#ifndef _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define __SIZEOF_PTHREAD_ATTR_T 56
-# define __SIZEOF_PTHREAD_MUTEX_T 40
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 56
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 32
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#else
-# define __SIZEOF_PTHREAD_ATTR_T 36
-# define __SIZEOF_PTHREAD_MUTEX_T 24
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 32
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 20
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#endif
-
-
-/* Thread identifiers. The structure of the attribute type is not
- exposed on purpose. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-#if __WORDSIZE == 64
-typedef struct __pthread_internal_list
-{
- struct __pthread_internal_list *__prev;
- struct __pthread_internal_list *__next;
-} __pthread_list_t;
-#else
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-#endif
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is not exposed on purpose. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
-#if __WORDSIZE == 64
- unsigned int __nusers;
-#endif
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
-#if __WORDSIZE == 64
-# ifdef ENABLE_LOCK_ELISION
- short __spins;
- short __elision;
- /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-# define __PTHREAD_SPINS 0, 0
-# else
- int __spins;
- /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-# define __PTHREAD_SPINS 0
-# endif
- __pthread_list_t __list;
-# define __PTHREAD_MUTEX_HAVE_PREV 1
-#else
- unsigned int __nusers;
- __extension__ union
- {
-# ifdef ENABLE_LOCK_ELISION
- struct
- {
- short __espins;
- short __elision;
- } _d;
-# define __spins _d.__espins
-# define __elision _d.__elision
- /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-# define __PTHREAD_SPINS { 0, 0 }
-# else
- int __spins;
- /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-# define __PTHREAD_SPINS 0
-# endif
- __pthread_slist_t __list;
- };
-#endif
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is not exposed on purpose. */
-typedef union
-{
-# if __WORDSIZE == 64
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- int __writer;
- int __shared;
- unsigned long int __pad1;
- unsigned long int __pad2;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned int __flags;
- } __data;
-# else
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- unsigned char __pad1;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- int __writer;
- } __data;
-# endif
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/s390/nptl/bits/semaphore.h b/sysdeps/s390/nptl/bits/semaphore.h
index 0d756abc42..cb1b294922 100644
--- a/sysdeps/s390/nptl/bits/semaphore.h
+++ b/sysdeps/s390/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
diff --git a/sysdeps/s390/nptl/pthread-offsets.h b/sysdeps/s390/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..bdda1f197e
--- /dev/null
+++ b/sysdeps/s390/nptl/pthread-offsets.h
@@ -0,0 +1,15 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __PTHREAD_MUTEX_NUSERS_OFFSET 12
+# define __PTHREAD_MUTEX_KIND_OFFSET 16
+# define __PTHREAD_MUTEX_SPINS_OFFSET 20
+# define __PTHREAD_MUTEX_ELISION_OFFSET 22
+# define __PTHREAD_MUTEX_LIST_OFFSET 24
+#else
+# define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+# define __PTHREAD_MUTEX_KIND_OFFSET 12
+# define __PTHREAD_MUTEX_SPINS_OFFSET 20
+# define __PTHREAD_MUTEX_ELISION_OFFSET 22
+# define __PTHREAD_MUTEX_LIST_OFFSET 20
+#endif
diff --git a/sysdeps/s390/nptl/pthread_spin_init.c b/sysdeps/s390/nptl/pthread_spin_init.c
deleted file mode 100644
index 7d3568fd6f..0000000000
--- a/sysdeps/s390/nptl/pthread_spin_init.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Martin Schwidefsky <schwidefsky@de.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/>. */
-
-/* Not needed. pthread_spin_init is an alias for pthread_spin_unlock. */
diff --git a/sysdeps/s390/nptl/pthread_spin_lock.c b/sysdeps/s390/nptl/pthread_spin_lock.c
deleted file mode 100644
index def6a24275..0000000000
--- a/sysdeps/s390/nptl/pthread_spin_lock.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Martin Schwidefsky <schwidefsky@de.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 "pthreadP.h"
-
-int
-pthread_spin_lock (pthread_spinlock_t *lock)
-{
- int oldval;
-
- __asm__ __volatile__ ("0: lhi %0,0\n"
- " cs %0,%2,%1\n"
- " jl 0b"
- : "=&d" (oldval), "=Q" (*lock)
- : "d" (1), "m" (*lock) : "cc" );
- return 0;
-}
diff --git a/sysdeps/s390/nptl/pthread_spin_trylock.c b/sysdeps/s390/nptl/pthread_spin_trylock.c
deleted file mode 100644
index 4c00e0833f..0000000000
--- a/sysdeps/s390/nptl/pthread_spin_trylock.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Martin Schwidefsky <schwidefsky@de.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 <errno.h>
-#include "pthreadP.h"
-
-int
-pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- int old;
-
- __asm__ __volatile__ ("cs %0,%3,%1"
- : "=d" (old), "=Q" (*lock)
- : "0" (0), "d" (1), "m" (*lock) : "cc" );
-
- return old != 0 ? EBUSY : 0;
-}
diff --git a/sysdeps/s390/nptl/pthread_spin_unlock.c b/sysdeps/s390/nptl/pthread_spin_unlock.c
deleted file mode 100644
index 0dcc2d0cb5..0000000000
--- a/sysdeps/s390/nptl/pthread_spin_unlock.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Martin Schwidefsky <schwidefsky@de.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/>. */
-
-/* Ugly hack to avoid the declaration of pthread_spin_init. */
-#define pthread_spin_init pthread_spin_init_XXX
-#include "pthreadP.h"
-#undef pthread_spin_init
-
-int
-pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__ (" xc %O0(4,%R0),%0\n"
- " bcr 15,0"
- : "=Q" (*lock) : "m" (*lock) : "cc" );
- return 0;
-}
-strong_alias (pthread_spin_unlock, pthread_spin_init)
diff --git a/sysdeps/s390/nptl/pthreaddef.h b/sysdeps/s390/nptl/pthreaddef.h
index d483f11103..410ae7b896 100644
--- a/sysdeps/s390/nptl/pthreaddef.h
+++ b/sysdeps/s390/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/nptl/tcb-offsets.sym b/sysdeps/s390/nptl/tcb-offsets.sym
index 9cfae211e0..9c1c01f353 100644
--- a/sysdeps/s390/nptl/tcb-offsets.sym
+++ b/sysdeps/s390/nptl/tcb-offsets.sym
@@ -3,5 +3,4 @@
MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
STACK_GUARD offsetof (tcbhead_t, stack_guard)
-PID offsetof (struct pthread, pid)
TID offsetof (struct pthread, tid)
diff --git a/sysdeps/s390/nptl/tls.h b/sysdeps/s390/nptl/tls.h
index e4c3ec7830..220bdfffb3 100644
--- a/sysdeps/s390/nptl/tls.h
+++ b/sysdeps/s390/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/s390 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,19 +27,7 @@
# include <stdlib.h>
# include <list.h>
# include <kernel-features.h>
-
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
-
+# include <dl-dtv.h>
typedef struct
{
@@ -51,11 +39,7 @@ typedef struct
uintptr_t sysinfo;
uintptr_t stack_guard;
int gscope_flag;
-#ifndef __ASSUME_PRIVATE_FUTEX
- int private_futex;
-#else
int __glibc_reserved1;
-#endif
/* GCC split stack support. */
void *__private_ss;
} tcbhead_t;
@@ -181,6 +165,7 @@ typedef struct
#define THREAD_COPY_POINTER_GUARD(descr)
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/s390/s390-32/Makefile b/sysdeps/s390/s390-32/Makefile
index 057862d91b..a07f2986ae 100644
--- a/sysdeps/s390/s390-32/Makefile
+++ b/sysdeps/s390/s390-32/Makefile
@@ -1,5 +1,3 @@
-pic-ccflag = -fpic
-
ifeq ($(subdir),gmon)
sysdep_routines += s390-mcount
endif
diff --git a/sysdeps/s390/s390-32/__longjmp.c b/sysdeps/s390/s390-32/__longjmp.c
index 2631cfd32f..eb3f78b383 100644
--- a/sysdeps/s390/s390-32/__longjmp.c
+++ b/sysdeps/s390/s390-32/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/s390/s390-32/add_n.S b/sysdeps/s390/s390-32/add_n.S
index b8e915712e..0232a1b31e 100644
--- a/sysdeps/s390/s390-32/add_n.S
+++ b/sysdeps/s390/s390-32/add_n.S
@@ -1,6 +1,6 @@
/* Add two limb vectors of the same length > 0 and store sum in a third
limb vector.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU MP Library.
diff --git a/sysdeps/s390/s390-32/addmul_1.S b/sysdeps/s390/s390-32/addmul_1.S
index 160c599d16..ff592cf34e 100644
--- a/sysdeps/s390/s390-32/addmul_1.S
+++ b/sysdeps/s390/s390-32/addmul_1.S
@@ -1,6 +1,6 @@
/* S390 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
the result to a second limb vector.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU MP Library.
diff --git a/sysdeps/s390/s390-32/backtrace.c b/sysdeps/s390/s390-32/backtrace.c
index a8290ed86a..f9e85b26d9 100644
--- a/sysdeps/s390/s390-32/backtrace.c
+++ b/sysdeps/s390/s390-32/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-32/bcopy.S b/sysdeps/s390/s390-32/bcopy.S
index cc64cb9aa7..560e04fdee 100644
--- a/sysdeps/s390/s390-32/bcopy.S
+++ b/sysdeps/s390/s390-32/bcopy.S
@@ -1,6 +1,6 @@
/* bcopy -- copy a block from source to destination. S/390 version.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/bits/wordsize.h b/sysdeps/s390/s390-32/bits/wordsize.h
index da791fa28e..129e47182b 100644
--- a/sysdeps/s390/s390-32/bits/wordsize.h
+++ b/sysdeps/s390/s390-32/bits/wordsize.h
@@ -5,15 +5,7 @@
#else
# define __WORDSIZE 32
# define __WORDSIZE32_SIZE_ULONG 1
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
-#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
- the `long double' function variants to be redirects to the double
- functions. */
-# define __LONG_DOUBLE_MATH_OPTIONAL 1
-# ifndef __LONG_DOUBLE_128__
-# define __NO_LONG_DOUBLE_MATH 1
-# endif
-#endif
+#define __WORDSIZE_TIME64_COMPAT32 0
diff --git a/sysdeps/s390/s390-32/bzero.S b/sysdeps/s390/s390-32/bzero.S
index 4cbb62e06e..897aa2154a 100644
--- a/sysdeps/s390/s390-32/bzero.S
+++ b/sysdeps/s390/s390-32/bzero.S
@@ -1,6 +1,6 @@
/* bzero -- set a block of memory to zero. IBM S390 version
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/crti.S b/sysdeps/s390/s390-32/crti.S
index 5db5b1e900..44b1a704fd 100644
--- a/sysdeps/s390/s390-32/crti.S
+++ b/sysdeps/s390/s390-32/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for S/390.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -57,6 +57,7 @@
.section .init,"ax",@progbits
.globl _init
+ .hidden _init
.type _init,@function
.align 4
_init:
@@ -88,6 +89,7 @@ _init:
.section .fini,"ax",@progbits
.globl _fini
+ .hidden _fini
.type _fini,@function
.align 4
_fini:
diff --git a/sysdeps/s390/s390-32/crtn.S b/sysdeps/s390/s390-32/crtn.S
index 73677917dc..6cc476ea43 100644
--- a/sysdeps/s390/s390-32/crtn.S
+++ b/sysdeps/s390/s390-32/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for S/390.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h
index 14bde3b58d..ded41adff8 100644
--- a/sysdeps/s390/s390-32/dl-machine.h
+++ b/sysdeps/s390/s390-32/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. S390 Version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Carl Pederson & Martin Schwidefsky.
This file is part of the GNU C Library.
@@ -89,6 +89,11 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
{
extern void _dl_runtime_resolve (Elf32_Word);
extern void _dl_runtime_profile (Elf32_Word);
+#if defined HAVE_S390_VX_ASM_SUPPORT
+ extern void _dl_runtime_resolve_vx (Elf32_Word);
+ extern void _dl_runtime_profile_vx (Elf32_Word);
+#endif
+
if (l->l_info[DT_JMPREL] && lazy)
{
@@ -104,7 +109,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
if (got[1])
{
l->l_mach.plt = got[1] + l->l_addr;
- l->l_mach.gotplt = (Elf32_Addr) &got[3];
+ l->l_mach.jmprel = (const Elf32_Rela *) D_PTR (l, l_info[DT_JMPREL]);
}
got[1] = (Elf32_Addr) l; /* Identify this shared object. */
@@ -116,7 +121,14 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
end in this function. */
if (__glibc_unlikely (profile))
{
+#if defined HAVE_S390_VX_ASM_SUPPORT
+ if (GLRO(dl_hwcap) & HWCAP_S390_VX)
+ got[2] = (Elf32_Addr) &_dl_runtime_profile_vx;
+ else
+ got[2] = (Elf32_Addr) &_dl_runtime_profile;
+#else
got[2] = (Elf32_Addr) &_dl_runtime_profile;
+#endif
if (GLRO(dl_profile) != NULL
&& _dl_name_match_p (GLRO(dl_profile), l))
@@ -125,9 +137,18 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
GL(dl_profile_map) = l;
}
else
- /* This function will get called to fix up the GOT entry indicated by
- the offset on the stack, and then jump to the resolved address. */
- got[2] = (Elf32_Addr) &_dl_runtime_resolve;
+ {
+ /* This function will get called to fix up the GOT entry indicated by
+ the offset on the stack, and then jump to the resolved address. */
+#if defined HAVE_S390_VX_ASM_SUPPORT
+ if (GLRO(dl_hwcap) & HWCAP_S390_VX)
+ got[2] = (Elf32_Addr) &_dl_runtime_resolve_vx;
+ else
+ got[2] = (Elf32_Addr) &_dl_runtime_resolve;
+#else
+ got[2] = (Elf32_Addr) &_dl_runtime_resolve;
+#endif
+ }
}
return lazy;
@@ -273,6 +294,7 @@ dl_platform_init (void)
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
@@ -336,7 +358,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *const refsym = sym;
#endif
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
@@ -485,9 +507,7 @@ elf_machine_lazy_rel (struct link_map *map,
if (__builtin_expect (map->l_mach.plt, 0) == 0)
*reloc_addr += l_addr;
else
- *reloc_addr =
- map->l_mach.plt
- + (((Elf32_Addr) reloc_addr) - map->l_mach.gotplt) * 8;
+ *reloc_addr = map->l_mach.plt + (reloc - map->l_mach.jmprel) * 32;
}
else if (__glibc_likely (r_type == R_390_IRELATIVE))
{
diff --git a/sysdeps/s390/s390-32/dl-sysdep.h b/sysdeps/s390/s390-32/dl-sysdep.h
index d550d15985..b2e063ff09 100644
--- a/sysdeps/s390/s390-32/dl-sysdep.h
+++ b/sysdeps/s390/s390-32/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. S/390 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/dl-trampoline.S b/sysdeps/s390/s390-32/dl-trampoline.S
index 1645610383..1ec409bc56 100644
--- a/sysdeps/s390/s390-32/dl-trampoline.S
+++ b/sysdeps/s390/s390-32/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. s390 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software 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,130 +16,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* This code is used in dl-runtime.c to call the `fixup' function
- and then redirect to the address it returns. */
-
-/* The PLT stubs will call _dl_runtime_resolve/_dl_runtime_profile
- * with the following linkage:
- * r2 - r6 : parameter registers
- * f0, f2 : floating point parameter registers
- * 24(r15), 28(r15) : PLT arguments PLT1, PLT2
- * 96(r15) : additional stack parameters
- * The normal clobber rules for function calls apply:
- * r0 - r5 : call clobbered
- * r6 - r13 : call saved
- * r14 : return address (call clobbered)
- * r15 : stack pointer (call saved)
- * f4, f6 : call saved
- * f0 - f3, f5, f7 - f15 : call clobbered
- */
-
#include <sysdep.h>
.text
- .globl _dl_runtime_resolve
- .type _dl_runtime_resolve, @function
- cfi_startproc
- .align 16
-_dl_runtime_resolve:
- stm %r2,%r5,32(%r15) # save registers
- st %r14,8(%r15)
- cfi_offset (r14, -88)
- lr %r0,%r15 # create stack frame
- ahi %r15,-96
- cfi_adjust_cfa_offset (96)
- st 0,0(%r15)
- lm %r2,%r3,120(%r15) # load args saved by PLT
- basr %r1,0
-0: l %r14,1f-0b(%r1)
- bas %r14,0(%r14,%r1) # call resolver
- lr %r1,%r2 # function addr returned in r2
- ahi %r15,96 # remove stack frame
- cfi_adjust_cfa_offset (-96)
- l %r14,8(15) # restore registers
- lm %r2,%r5,32(%r15)
- br %r1
-1: .long _dl_fixup - 0b
- cfi_endproc
- .size _dl_runtime_resolve, .-_dl_runtime_resolve
-
-
-#ifndef PROF
- .globl _dl_runtime_profile
- .type _dl_runtime_profile, @function
- cfi_startproc
- .align 16
-_dl_runtime_profile:
- stm %r2,%r6,32(%r15) # save registers
- std %f0,56(%r15)
- std %f2,64(%r15)
- st %r6,8(%r15)
- st %r12,12(%r15)
- st %r14,16(%r15)
- cfi_offset (r6, -64)
- cfi_offset (f0, -40)
- cfi_offset (f2, -32)
- cfi_offset (r12, -84)
- cfi_offset (r14, -80)
- lr %r12,%r15 # create stack frame
- cfi_def_cfa_register (12)
- ahi %r15,-96
- st %r12,0(%r15)
- lm %r2,%r3,24(%r12) # load arguments saved by PLT
- lr %r4,%r14 # return address as third parameter
- basr %r1,0
-0: l %r14,6f-0b(%r1)
- la %r5,32(%r12) # pointer to struct La_s390_32_regs
- la %r6,20(%r12) # long int * framesize
- bas %r14,0(%r14,%r1) # call resolver
- lr %r1,%r2 # function addr returned in r2
- icm %r0,15,20(%r12) # load & test framesize
- jnm 2f
-
- lm %r2,%r6,32(%r12)
- ld %f0,56(%r12)
- ld %f2,64(%r12)
- lr %r15,%r12 # remove stack frame
- cfi_def_cfa_register (15)
- l %r14,16(%r15) # restore registers
- l %r12,12(%r15)
- br %r1 # tail-call to the resolved function
-
- cfi_def_cfa_register (12)
-2: jz 4f # framesize == 0 ?
- ahi %r0,7 # align framesize to 8
- lhi %r2,-8
- nr %r0,%r2
- slr %r15,%r0 # make room for framesize bytes
- st %r12,0(%r15)
- la %r2,96(%r15)
- la %r3,96(%r12)
- srl %r0,3
-3: mvc 0(8,%r2),0(%r3) # copy additional parameters
- la %r2,8(%r2)
- la %r3,8(%r3)
- brct %r0,3b
-4: lm %r2,%r6,32(%r12) # load register parameters
- ld %f0,56(%r12)
- ld %f2,64(%r12)
- basr %r14,%r1 # call resolved function
- stm %r2,%r3,72(%r12)
- std %f0,80(%r12)
- lm %r2,%r3,24(%r12) # load arguments saved by PLT
- basr %r1,0
-5: l %r14,7f-5b(%r1)
- la %r4,32(%r12) # pointer to struct La_s390_32_regs
- la %r5,72(%r12) # pointer to struct La_s390_32_retval
- basr %r14,%r1 # call _dl_call_pltexit
-
- lr %r15,%r12 # remove stack frame
- cfi_def_cfa_register (15)
- l %r14,16(%r15) # restore registers
- l %r12,12(%r15)
- br %r14
-
-6: .long _dl_profile_fixup - 0b
-7: .long _dl_call_pltexit - 5b
- cfi_endproc
- .size _dl_runtime_profile, .-_dl_runtime_profile
+/* Create variant of _dl_runtime_resolve/profile for machines before z13.
+ No vector registers are saved/restored. */
+#include <dl-trampoline.h>
+
+#if defined HAVE_S390_VX_ASM_SUPPORT
+/* Create variant of _dl_runtime_resolve/profile for z13 and newer.
+ The vector registers are saved/restored, too.*/
+# define _dl_runtime_resolve _dl_runtime_resolve_vx
+# define _dl_runtime_profile _dl_runtime_profile_vx
+# define RESTORE_VRS
+# include <dl-trampoline.h>
#endif
diff --git a/sysdeps/s390/s390-32/dl-trampoline.h b/sysdeps/s390/s390-32/dl-trampoline.h
new file mode 100644
index 0000000000..d36c002743
--- /dev/null
+++ b/sysdeps/s390/s390-32/dl-trampoline.h
@@ -0,0 +1,230 @@
+/* PLT trampolines. s390 version.
+ Copyright (C) 2016-2018 Free Software 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 code is used in dl-runtime.c to call the `fixup' function
+ and then redirect to the address it returns. */
+
+/* The PLT stubs will call _dl_runtime_resolve/_dl_runtime_profile
+ * with the following linkage:
+ * r2 - r6 : parameter registers
+ * f0, f2 : floating point parameter registers
+ * v24, v26, v28, v30, v25, v27, v29, v31 : vector parameter registers
+ * 24(r15), 28(r15) : PLT arguments PLT1, PLT2
+ * 96(r15) : additional stack parameters
+ * The normal clobber rules for function calls apply:
+ * r0 - r5 : call clobbered
+ * r6 - r13 : call saved
+ * r14 : return address (call clobbered)
+ * r15 : stack pointer (call saved)
+ * f4, f6 : call saved
+ * f0 - f3, f5, f7 - f15 : call clobbered
+ * v0 - v3, v5, v7 - v15 : bytes 0-7 overlap with fprs: call clobbered
+ bytes 8-15: call clobbered
+ * v4, v6 : bytes 0-7 overlap with f4, f6: call saved
+ bytes 8-15: call clobbered
+ * v16 - v31 : call clobbered
+ */
+
+
+ .globl _dl_runtime_resolve
+ .type _dl_runtime_resolve, @function
+ cfi_startproc
+ .align 16
+_dl_runtime_resolve:
+ stm %r2,%r5,32(%r15) # save registers
+ cfi_offset (r2, -64)
+ cfi_offset (r3, -60)
+ cfi_offset (r4, -56)
+ cfi_offset (r5, -52)
+ stm %r14,%r15,48(%r15)
+ cfi_offset (r14, -48)
+ cfi_offset (r15, -44)
+ std %f0,56(%r15)
+ cfi_offset (f0, -40)
+ std %f2,64(%r15)
+ cfi_offset (f2, -32)
+ lr %r0,%r15
+ lm %r2,%r3,24(%r15) # load args saved by PLT
+#ifdef RESTORE_VRS
+ ahi %r15,-224 # create stack frame
+ cfi_adjust_cfa_offset (224)
+ .machine push
+ .machine "z13"
+ .machinemode "zarch_nohighgprs"
+ vstm %v24,%v31,96(%r15) # store call-clobbered vr arguments
+ cfi_offset (v24, -224)
+ cfi_offset (v25, -208)
+ cfi_offset (v26, -192)
+ cfi_offset (v27, -176)
+ cfi_offset (v28, -160)
+ cfi_offset (v29, -144)
+ cfi_offset (v30, -128)
+ cfi_offset (v31, -112)
+ .machine pop
+#else
+ ahi %r15,-96 # create stack frame
+ cfi_adjust_cfa_offset (96)
+#endif
+ st %r0,0(%r15) # write backchain
+ basr %r1,0
+0: l %r14,1f-0b(%r1)
+ bas %r14,0(%r14,%r1) # call _dl_fixup
+ lr %r1,%r2 # function addr returned in r2
+#ifdef RESTORE_VRS
+ .machine push
+ .machine "z13"
+ .machinemode "zarch_nohighgprs"
+ vlm %v24,%v31,96(%r15) # restore vector registers
+ .machine pop
+ lm %r14,%r15,272(%r15)# remove stack frame and restore registers
+#else
+ lm %r14,%r15,144(%r15)# remove stack frame and restore registers
+#endif
+ cfi_def_cfa_offset (96)
+ ld %f0,56(%r15)
+ ld %f2,64(%r15)
+ lm %r2,%r5,32(%r15)
+ br %r1
+1: .long _dl_fixup - 0b
+ cfi_endproc
+ .size _dl_runtime_resolve, .-_dl_runtime_resolve
+
+
+#ifndef PROF
+ .globl _dl_runtime_profile
+ .type _dl_runtime_profile, @function
+ cfi_startproc
+ .align 16
+_dl_runtime_profile:
+ st %r12,12(%r15) # r12 is used as backup of r15
+ cfi_offset (r12, -84)
+ st %r14,16(%r15)
+ cfi_offset (r14, -80)
+ lr %r12,%r15 # backup stack pointer
+ cfi_def_cfa_register (12)
+ ahi %r15,-264 # create stack frame:
+ # 96 + sizeof(La_s390_32_regs)
+ st %r12,0(%r15) # save backchain
+
+ stm %r2,%r6,96(%r15) # save registers
+ cfi_offset (r2, -264) # + r6 needed as arg for
+ cfi_offset (r3, -260) # _dl_profile_fixup
+ cfi_offset (r4, -256)
+ cfi_offset (r5, -252)
+ cfi_offset (r6, -248)
+ std %f0,120(%r15)
+ cfi_offset (f0, -240)
+ std %f2,128(%r15)
+ cfi_offset (f2, -232)
+#ifdef RESTORE_VRS
+ .machine push
+ .machine "z13"
+ .machinemode "zarch_nohighgprs"
+ vstm %v24,%v31,136(%r15) # store call-clobbered vr arguments
+ cfi_offset (v24, -224)
+ cfi_offset (v25, -208)
+ cfi_offset (v26, -192)
+ cfi_offset (v27, -176)
+ cfi_offset (v28, -160)
+ cfi_offset (v29, -144)
+ cfi_offset (v30, -128)
+ cfi_offset (v31, -112)
+ .machine pop
+#endif
+
+ lm %r2,%r3,24(%r12) # load arguments saved by PLT
+ lr %r4,%r14 # return address as third parameter
+ basr %r1,0
+0: l %r14,6f-0b(%r1)
+ la %r5,96(%r15) # pointer to struct La_s390_32_regs
+ la %r6,20(%r12) # long int * framesize
+ bas %r14,0(%r14,%r1) # call resolver
+ lr %r1,%r2 # function addr returned in r2
+ ld %f0,120(%r15) # restore call-clobbered arg fprs
+ ld %f2,128(%r15)
+#ifdef RESTORE_VRS
+ .machine push
+ .machine "z13"
+ .machinemode "zarch_nohighgprs"
+ vlm %v24,%v31,136(%r15) # restore call-clobbered arg vrs
+ .machine pop
+#endif
+ icm %r0,15,20(%r12) # load & test framesize
+ jnm 2f
+
+ lm %r2,%r6,96(%r15) # framesize < 0 means no pltexit call
+ # so we can do a tail call without
+ # copying the arg overflow area
+ lr %r15,%r12 # remove stack frame
+ cfi_def_cfa_register (15)
+ l %r14,16(%r15) # restore registers
+ l %r12,12(%r15)
+ br %r1 # tail-call to the resolved function
+
+ cfi_def_cfa_register (12)
+2: la %r4,96(%r15) # pointer to struct La_s390_32_regs
+ st %r4,32(%r12)
+ jz 4f # framesize == 0 ?
+ ahi %r0,7 # align framesize to 8
+ lhi %r2,-8
+ nr %r0,%r2
+ slr %r15,%r0 # make room for framesize bytes
+ st %r12,0(%r15) # save backchain
+ la %r2,96(%r15)
+ la %r3,96(%r12)
+ srl %r0,3
+3: mvc 0(8,%r2),0(%r3) # copy additional parameters
+ la %r2,8(%r2)
+ la %r3,8(%r3)
+ brct %r0,3b
+4: lm %r2,%r6,0(%r4) # load register parameters
+ basr %r14,%r1 # call resolved function
+ stm %r2,%r3,40(%r12) # store return values r2, r3, f0
+ std %f0,48(%r12) # to struct La_s390_32_retval
+#ifdef RESTORE_VRS
+ .machine push
+ .machine "z13"
+ vst %v24,56(%r12) # store return value v24
+ .machine pop
+#endif
+ lm %r2,%r4,24(%r12) # r2, r3: load arguments saved by PLT
+ # r4: pointer to struct La_s390_32_regs
+ basr %r1,0
+5: l %r14,7f-5b(%r1)
+ la %r5,40(%r12) # pointer to struct La_s390_32_retval
+ bas %r14,0(%r14,%r1) # call _dl_call_pltexit
+
+ lr %r15,%r12 # remove stack frame
+ cfi_def_cfa_register (15)
+ l %r14,16(%r15) # restore registers
+ l %r12,12(%r15)
+ lm %r2,%r3,40(%r15) # restore return values
+ ld %f0,48(%r15)
+#ifdef RESTORE_VRS
+ .machine push
+ .machine "z13"
+ vl %v24,56(%r15) # restore return value v24
+ .machine pop
+#endif
+ br %r14
+
+6: .long _dl_profile_fixup - 0b
+7: .long _dl_call_pltexit - 5b
+ cfi_endproc
+ .size _dl_runtime_profile, .-_dl_runtime_profile
+#endif
diff --git a/sysdeps/s390/s390-32/memchr.S b/sysdeps/s390/s390-32/memchr.S
index 5c82af4b90..54f9b85f57 100644
--- a/sysdeps/s390/s390-32/memchr.S
+++ b/sysdeps/s390/s390-32/memchr.S
@@ -1,5 +1,5 @@
/* Search a character in a block of memory. For IBM S390
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/s390/s390-32/memcmp.S b/sysdeps/s390/s390-32/memcmp.S
index 50ab61c77f..f9ad0bc745 100644
--- a/sysdeps/s390/s390-32/memcmp.S
+++ b/sysdeps/s390/s390-32/memcmp.S
@@ -1,5 +1,5 @@
/* memcmp - compare two memory blocks. 32 bit S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/memcpy.S b/sysdeps/s390/s390-32/memcpy.S
index 62ecbbf619..493cc18aba 100644
--- a/sysdeps/s390/s390-32/memcpy.S
+++ b/sysdeps/s390/s390-32/memcpy.S
@@ -1,5 +1,5 @@
/* memcpy - copy a block from source to destination. S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,58 +25,65 @@
%r3 = address of source memory area
%r4 = number of bytes to copy. */
-#ifdef USE_MULTIARCH
-ENTRY(__memcpy_default)
-#else
-ENTRY(memcpy)
+ .text
+ENTRY(__mempcpy)
+ .machine "g5"
+ lr %r1,%r2 # Use as dest
+ la %r2,0(%r4,%r2) # Return dest + n
+ j .L_G5_start
+END(__mempcpy)
+#ifndef USE_MULTIARCH
+libc_hidden_def (__mempcpy)
+weak_alias (__mempcpy, mempcpy)
+libc_hidden_builtin_def (mempcpy)
#endif
+
+ENTRY(memcpy)
.machine "g5"
- st %r13,52(%r15)
- .cfi_offset 13, -44
- basr %r13,0
-.L_G5_16:
+ lr %r1,%r2 # r1: Use as dest ; r2: Return dest
+.L_G5_start:
ltr %r4,%r4
- je .L_G5_4
+ je .L_G5_99
ahi %r4,-1
lr %r5,%r4
srl %r5,8
ltr %r5,%r5
- lr %r1,%r2
- jne .L_G5_12
- ex %r4,.L_G5_17-.L_G5_16(%r13)
+ jne .L_G5_13
.L_G5_4:
- l %r13,52(%r15)
+ basr %r5,0
+.L_G5_16:
+ ex %r4,.L_G5_17-.L_G5_16(%r5)
+.L_G5_99:
br %r14
.L_G5_13:
- chi %r5,4096 # Switch to mvcle for copies >1MB
+ chi %r5,4096 # Switch to mvcle for copies >1MB
jh __memcpy_mvcle
.L_G5_12:
mvc 0(256,%r1),0(%r3)
la %r1,256(%r1)
la %r3,256(%r3)
brct %r5,.L_G5_12
- ex %r4,.L_G5_17-.L_G5_16(%r13)
j .L_G5_4
.L_G5_17:
mvc 0(1,%r1),0(%r3)
-#ifdef USE_MULTIARCH
-END(__memcpy_default)
-#else
END(memcpy)
+#ifndef USE_MULTIARCH
libc_hidden_builtin_def (memcpy)
#endif
ENTRY(__memcpy_mvcle)
- # Using as standalone function will result in unexpected
- # results since the length field is incremented by 1 in order to
- # compensate the changes already done in the functions above.
- ahi %r4,1 # length + 1
- lr %r5,%r4 # source length
- lr %r4,%r3 # source address
- lr %r3,%r5 # destination length = source length
+ # Using as standalone function will result in unexpected
+ # results since the length field is incremented by 1 in order to
+ # compensate the changes already done in the functions above.
+ lr %r0,%r2 # backup return dest [ + n ]
+ ahi %r4,1 # length + 1
+ lr %r5,%r4 # source length
+ lr %r4,%r3 # source address
+ lr %r2,%r1 # destination address
+ lr %r3,%r5 # destination length = source length
.L_MVCLE_1:
- mvcle %r2,%r4,0 # thats it, MVCLE is your friend
- jo .L_MVCLE_1
- lr %r2,%r1 # return destination address
- br %r14
+ mvcle %r2,%r4,0 # thats it, MVCLE is your friend
+ jo .L_MVCLE_1
+ lr %r2,%r0 # return destination address
+ br %r14
END(__memcpy_mvcle)
diff --git a/sysdeps/s390/s390-32/memset.S b/sysdeps/s390/s390-32/memset.S
index eca65d4a49..57f08e1cae 100644
--- a/sysdeps/s390/s390-32/memset.S
+++ b/sysdeps/s390/s390-32/memset.S
@@ -1,5 +1,5 @@
/* Set a block of memory to some byte value. For IBM S390
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/mul_1.S b/sysdeps/s390/s390-32/mul_1.S
index 50df39c17f..6fa4fae437 100644
--- a/sysdeps/s390/s390-32/mul_1.S
+++ b/sysdeps/s390/s390-32/mul_1.S
@@ -1,6 +1,6 @@
/* __mpn_mul_1 -- Multiply a limb vector with a limb and store
the result in a second limb vector.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU MP Library.
diff --git a/sysdeps/s390/s390-32/multiarch/memchr.c b/sysdeps/s390/s390-32/multiarch/memchr.c
index 2281e43056..5e1610afa4 100644
--- a/sysdeps/s390/s390-32/multiarch/memchr.c
+++ b/sysdeps/s390/s390-32/multiarch/memchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of memchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/multiarch/memcmp-s390.S b/sysdeps/s390/s390-32/multiarch/memcmp-s390.S
index e9ee6d2270..e53b508c98 100644
--- a/sysdeps/s390/s390-32/multiarch/memcmp-s390.S
+++ b/sysdeps/s390/s390-32/multiarch/memcmp-s390.S
@@ -1,5 +1,5 @@
/* CPU specific memcmp implementations. 32 bit S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -101,4 +101,7 @@ END(__memcmp_z10)
.set memcmp,__memcmp_default
.weak bcmp
.set bcmp,__memcmp_default
+#elif defined SHARED && IS_IN (libc)
+.globl __GI_memcmp
+.set __GI_memcmp,__memcmp_default
#endif
diff --git a/sysdeps/s390/s390-32/multiarch/memcmp.c b/sysdeps/s390/s390-32/multiarch/memcmp.c
index 44f72dc8ca..1e6f31806e 100644
--- a/sysdeps/s390/s390-32/multiarch/memcmp.c
+++ b/sysdeps/s390/s390-32/multiarch/memcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of memcmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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-s390.S b/sysdeps/s390/s390-32/multiarch/memcpy-s390.S
index 4e30cdf6c6..aad13bd07c 100644
--- a/sysdeps/s390/s390-32/multiarch/memcpy-s390.S
+++ b/sysdeps/s390/s390-32/multiarch/memcpy-s390.S
@@ -1,5 +1,5 @@
/* CPU specific memcpy implementations. 32 bit S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,14 +29,23 @@
#if defined SHARED && IS_IN (libc)
+ENTRY(____mempcpy_z196)
+ .machine "z196"
+ .machinemode "zarch_nohighgprs"
+ lr %r1,%r2 # Use as dest
+ la %r2,0(%r4,%r2) # Return dest + n
+ j .L_Z196_start
+END(____mempcpy_z196)
+
ENTRY(__memcpy_z196)
.machine "z196"
.machinemode "zarch_nohighgprs"
+ lr %r1,%r2 # r1: Use as dest ; r2: Return dest
+.L_Z196_start:
llgfr %r4,%r4
ltgr %r4,%r4
je .L_Z196_4
aghi %r4,-1
- lr %r1,%r2
srlg %r5,%r4,8
ltgr %r5,%r5
jne .L_Z196_5
@@ -60,13 +69,22 @@ ENTRY(__memcpy_z196)
mvc 0(1,%r1),0(%r3)
END(__memcpy_z196)
+ENTRY(____mempcpy_z10)
+ .machine "z10"
+ .machinemode "zarch_nohighgprs"
+ lr %r1,%r2 # Use as dest
+ la %r2,0(%r4,%r2) # Return dest + n
+ j .L_Z10_start
+END(____mempcpy_z10)
+
ENTRY(__memcpy_z10)
.machine "z10"
.machinemode "zarch_nohighgprs"
+ lr %r1,%r2 # r1: Use as dest ; r2: Return dest
+.L_Z10_start:
llgfr %r4,%r4
cgije %r4,0,.L_Z10_4
aghi %r4,-1
- lr %r1,%r2
srlg %r5,%r4,8
cgijlh %r5,0,.L_Z10_13
.L_Z10_3:
@@ -88,11 +106,23 @@ ENTRY(__memcpy_z10)
mvc 0(1,%r1),0(%r3)
END(__memcpy_z10)
+# define __mempcpy ____mempcpy_default
#endif /* SHARED && IS_IN (libc) */
+#define memcpy __memcpy_default
#include "../memcpy.S"
+#undef memcpy
-#if !defined SHARED || !IS_IN (libc)
+#if defined SHARED && IS_IN (libc)
+.globl __GI_memcpy
+.set __GI_memcpy,__memcpy_default
+.globl __GI_mempcpy
+.set __GI_mempcpy,____mempcpy_default
+.globl __GI___mempcpy
+.set __GI___mempcpy,____mempcpy_default
+#else
.globl memcpy
.set memcpy,__memcpy_default
+.weak mempcpy
+.set mempcpy,__mempcpy
#endif
diff --git a/sysdeps/s390/s390-32/multiarch/memcpy.c b/sysdeps/s390/s390-32/multiarch/memcpy.c
index 2a98aa0b82..c9577a854a 100644
--- a/sysdeps/s390/s390-32/multiarch/memcpy.c
+++ b/sysdeps/s390/s390-32/multiarch/memcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of memcpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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-s390.S b/sysdeps/s390/s390-32/multiarch/memset-s390.S
index 47277c13a6..b092073d6b 100644
--- a/sysdeps/s390/s390-32/multiarch/memset-s390.S
+++ b/sysdeps/s390/s390-32/multiarch/memset-s390.S
@@ -1,5 +1,5 @@
/* Set a block of memory to some byte value. 32 bit S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -110,4 +110,7 @@ END(__memset_mvcle)
#if !IS_IN (libc)
.globl memset
.set memset,__memset_default
+#elif defined SHARED && IS_IN (libc)
+.globl __GI_memset
+.set __GI_memset,__memset_default
#endif
diff --git a/sysdeps/s390/s390-32/multiarch/memset.c b/sysdeps/s390/s390-32/multiarch/memset.c
index 89b8102f2a..760b3e9df2 100644
--- a/sysdeps/s390/s390-32/multiarch/memset.c
+++ b/sysdeps/s390/s390-32/multiarch/memset.c
@@ -1,5 +1,5 @@
/* Multiple versions of memset.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,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-32/multiarch/strcmp.c b/sysdeps/s390/s390-32/multiarch/strcmp.c
index b7eebc017f..d06b0f3436 100644
--- a/sysdeps/s390/s390-32/multiarch/strcmp.c
+++ b/sysdeps/s390/s390-32/multiarch/strcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/multiarch/strcpy.c b/sysdeps/s390/s390-32/multiarch/strcpy.c
index ae140d22b7..6a22e31a03 100644
--- a/sysdeps/s390/s390-32/multiarch/strcpy.c
+++ b/sysdeps/s390/s390-32/multiarch/strcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/multiarch/strncpy.c b/sysdeps/s390/s390-32/multiarch/strncpy.c
index 28a2af72e4..57f9df18d1 100644
--- a/sysdeps/s390/s390-32/multiarch/strncpy.c
+++ b/sysdeps/s390/s390-32/multiarch/strncpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/s390-mcount.S b/sysdeps/s390/s390-32/s390-mcount.S
index a27f434fbf..153777e1b8 100644
--- a/sysdeps/s390/s390-32/s390-mcount.S
+++ b/sysdeps/s390/s390-32/s390-mcount.S
@@ -1,5 +1,5 @@
-/* S/390-specific implemetation of profiling support.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* S/390-specific implementation of profiling support.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com)
diff --git a/sysdeps/s390/s390-32/setjmp.S b/sysdeps/s390/s390-32/setjmp.S
index dbacb0fdf2..fd2f991682 100644
--- a/sysdeps/s390/s390-32/setjmp.S
+++ b/sysdeps/s390/s390-32/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for s390, ELF version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -24,17 +24,16 @@
#include <shlib-compat.h>
#include <stap-probe.h>
-#if !IS_IN (rtld)
-# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
- /* we need a unique name in case of symbol versioning. */
-# define setjmp __v1setjmp
-# define _setjmp __v1_setjmp
-# define __sigsetjmp __v1__sigsetjmp
-
-# undef libc_hidden_def
-# define libc_hidden_def(name) strong_alias(_setjmp, __GI__setjmp)
-# endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */
-#endif /* !IS_IN (rtld) */
+#if !IS_IN (rtld) && defined SHARED \
+ && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
+# define NEED_COMPAT_SYMBOLS 1
+/* We need a unique name in case of symbol versioning. */
+# define setjmp __v1setjmp
+# define _setjmp __v1_setjmp
+# define __sigsetjmp __v1__sigsetjmp
+#else
+# define NEED_COMPAT_SYMBOLS 0
+#endif
/* We include the BSD entry points here as well. */
ENTRY (setjmp)
@@ -47,7 +46,11 @@ ENTRY(_setjmp)
lhi %r3,0 /* second argument of zero */
j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */
END (_setjmp)
+#if NEED_COMPAT_SYMBOLS
+strong_alias (_setjmp, __GI__setjmp)
+#else
libc_hidden_def (_setjmp)
+#endif
ENTRY(__setjmp)
lhi %r3,0 /* second argument of zero */
@@ -92,15 +95,19 @@ ENTRY(__sigsetjmp)
.L1: .long __sigjmp_save
#endif
END (__sigsetjmp)
+#if NEED_COMPAT_SYMBOLS
+strong_alias (__sigsetjmp, __GI___sigsetjmp)
+#else
+libc_hidden_def (__sigsetjmp)
+#endif
-#if !IS_IN (rtld)
-# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
+#if NEED_COMPAT_SYMBOLS
/* In glibc release 2.19 new versions of setjmp-functions were introduced,
but were reverted before 2.20. Thus both versions are the same function. */
-# undef setjmp
-# undef _setjmp
-# undef __sigsetjmp
+# undef setjmp
+# undef _setjmp
+# undef __sigsetjmp
strong_alias (__v1setjmp, __v2setjmp);
versioned_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0);
@@ -113,5 +120,4 @@ compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19);
strong_alias (__v1__sigsetjmp, __v2__sigsetjmp);
versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0);
compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19);
-# endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */
-#endif /* if !IS_IN (rtld) */
+#endif /* NEED_COMPAT_SYMBOLS */
diff --git a/sysdeps/s390/s390-32/start.S b/sysdeps/s390/s390-32/start.S
index 1fbc64d2e4..1483642985 100644
--- a/sysdeps/s390/s390-32/start.S
+++ b/sysdeps/s390/s390-32/start.S
@@ -1,5 +1,5 @@
/* Startup code compliant to the ELF s390 ABI.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -34,6 +34,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <sysdep.h>
+
/*
This is the canonical entry point, usually the first thing in the text
segment. Most registers' values are unspecified, except for:
@@ -57,6 +59,10 @@
.globl _start
.type _start,@function
_start:
+ cfi_startproc
+ /* Mark r14 as undefined in order to stop unwinding here! */
+ cfi_undefined (r14)
+
/* Check if the kernel provides highgprs facility if needed by
the binary. */
@@ -188,6 +194,7 @@ _start:
/* crash if __libc_start_main returns */
.word 0
+ cfi_endproc
.Llit:
#ifndef PIC
.L1: .long __libc_csu_init
diff --git a/sysdeps/s390/s390-32/strcmp.S b/sysdeps/s390/s390-32/strcmp.S
index 71f113ebab..3cf3f239fd 100644
--- a/sysdeps/s390/s390-32/strcmp.S
+++ b/sysdeps/s390/s390-32/strcmp.S
@@ -1,6 +1,6 @@
/* strcmp - compare two string. S/390 version.
This file is part of the GNU C Library.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/strcpy.S b/sysdeps/s390/s390-32/strcpy.S
index 5cdc350f91..d49136ee92 100644
--- a/sysdeps/s390/s390-32/strcpy.S
+++ b/sysdeps/s390/s390-32/strcpy.S
@@ -1,6 +1,6 @@
/* strcpy - copy a string from source to destination. For IBM S390
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/strncpy.S b/sysdeps/s390/s390-32/strncpy.S
index 75800b3ee6..9086eb1c70 100644
--- a/sysdeps/s390/s390-32/strncpy.S
+++ b/sysdeps/s390/s390-32/strncpy.S
@@ -1,7 +1,7 @@
/* strncpy - copy at most n characters from a string from source to
destination. For IBM S390
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-32/sub_n.S b/sysdeps/s390/s390-32/sub_n.S
index f8de2c2a5e..e7fdb604ff 100644
--- a/sysdeps/s390/s390-32/sub_n.S
+++ b/sysdeps/s390/s390-32/sub_n.S
@@ -1,6 +1,6 @@
/* __mpn_sub_n -- Add two limb vectors of the same length > 0 and store
sum in a third limb vector.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU MP Library.
diff --git a/sysdeps/s390/s390-32/symbol-hacks.h b/sysdeps/s390/s390-32/symbol-hacks.h
new file mode 100644
index 0000000000..879ce2f517
--- /dev/null
+++ b/sysdeps/s390/s390-32/symbol-hacks.h
@@ -0,0 +1,21 @@
+/* Hacks needed for symbol manipulation. s390 version.
+ Copyright (C) 2017-2018 Free Software 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 <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
+
+#include_next "symbol-hacks.h"
diff --git a/sysdeps/s390/s390-32/sysdep.h b/sysdeps/s390/s390-32/sysdep.h
index 26e9285dbd..7e2763fe92 100644
--- a/sysdeps/s390/s390-32/sysdep.h
+++ b/sysdeps/s390/s390-32/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for s390.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -82,14 +82,14 @@ lose: SYSCALL_PIC_SETUP \
END (name)
#undef JUMPTARGET
-#ifdef PIC
+#ifdef SHARED
#define JUMPTARGET(name) name##@PLT
#define SYSCALL_PIC_SETUP \
- bras %r12,1f \
-0: .long _GLOBAL_OFFSET_TABLE_-0b \
+ bras %r12,1f; \
+0: .long _GLOBAL_OFFSET_TABLE_-0b; \
1: al %r12,0(%r12)
#else
-#define JUMPTARGET(name) name
+#define JUMPTARGET(name) name
#define SYSCALL_PIC_SETUP /* Nothing. */
#endif
diff --git a/sysdeps/s390/s390-32/tls-macros.h b/sysdeps/s390/s390-32/tls-macros.h
index 09b42aa37a..153523a4ae 100644
--- a/sysdeps/s390/s390-32/tls-macros.h
+++ b/sysdeps/s390/s390-32/tls-macros.h
@@ -8,15 +8,17 @@
#ifdef PIC
# define TLS_IE(x) \
- ({ unsigned long __offset, __got; \
+ ({ unsigned long __offset, __save12; \
__asm__ ("bras %0,1f\n" \
"0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
".long " #x "@gotntpoff\n" \
- "1:\tl %1,0(%0)\n\t" \
- "la %1,0(%1,%0)\n\t" \
+ "1:\tlr %1,%%r12\n\t" \
+ "l %%r12,0(%0)\n\t" \
+ "la %%r12,0(%0,%%r12)\n\t" \
"l %0,4(%0)\n\t" \
- "l %0,0(%0,%1):tls_load:" #x "\n" \
- : "=&a" (__offset), "=&a" (__got) : : "cc" ); \
+ "l %0,0(%0,%%r12):tls_load:" #x "\n\t" \
+ "lr %%r12,%1\n" \
+ : "=&a" (__offset), "=&a" (__save12) : : "cc" ); \
(int *) (__builtin_thread_pointer() + __offset); })
#else
# define TLS_IE(x) \
@@ -47,7 +49,7 @@
"alr %0,%%r2\n\t" \
"lr %%r12,%1" \
: "=&a" (__offset), "=&a" (__save12) \
- : : "cc", "0", "1", "2", "3", "4", "5" ); \
+ : : "cc", "0", "1", "2", "3", "4", "5", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#else
# define TLS_LD(x) \
@@ -63,7 +65,8 @@
"bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \
"l %0,12(%0)\n\t" \
"alr %0,%%r2" \
- : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
+ : "=&a" (__offset) \
+ : : "cc", "0", "1", "2", "3", "4", "5", "12", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#endif
@@ -83,7 +86,7 @@
"lr %0,%%r2\n\t" \
"lr %%r12,%1" \
: "=&a" (__offset), "=&a" (__save12) \
- : : "cc", "0", "1", "2", "3", "4", "5" ); \
+ : : "cc", "0", "1", "2", "3", "4", "5", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#else
# define TLS_GD(x) \
@@ -97,6 +100,7 @@
"l %%r2,8(%0)\n\t" \
"bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \
"lr %0,%%r2" \
- : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
+ : "=&a" (__offset) \
+ : : "cc", "0", "1", "2", "3", "4", "5", "12", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#endif
diff --git a/sysdeps/s390/s390-32/tst-audit.h b/sysdeps/s390/s390-32/tst-audit.h
index 8908602cff..173b1ec40c 100644
--- a/sysdeps/s390/s390-32/tst-audit.h
+++ b/sysdeps/s390/s390-32/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. S/390 32-bit version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
index ce4f0c5c88..b4d793bb3d 100644
--- a/sysdeps/s390/s390-64/Makefile
+++ b/sysdeps/s390/s390-64/Makefile
@@ -1,5 +1,3 @@
-pic-ccflag = -fpic
-
ifeq ($(subdir),gmon)
sysdep_routines += s390x-mcount
endif
@@ -9,84 +7,3 @@ CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
CFLAGS-dl-load.c += -Wno-unused
CFLAGS-dl-reloc.c += -Wno-unused
endif
-
-ifeq ($(subdir),iconvdata)
-ISO-8859-1_CP037_Z900-routines := iso-8859-1_cp037_z900
-ISO-8859-1_CP037_Z900-map := gconv.map
-
-UTF8_UTF32_Z9-routines := utf8-utf32-z9
-UTF8_UTF32_Z9-map := gconv.map
-
-UTF16_UTF32_Z9-routines := utf16-utf32-z9
-UTF16_UTF32_Z9-map := gconv.map
-
-UTF8_UTF16_Z9-routines := utf8-utf16-z9
-UTF8_UTF16_Z9-map := gconv.map
-
-s390x-iconv-modules = ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9 UTF16_UTF32_Z9 UTF8_UTF32_Z9
-
-extra-modules-left += $(s390x-iconv-modules)
-include extra-module.mk
-
-cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines))
-lib := iconvdata
-include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
-
-extra-objs += $(addsuffix .so, $(s390x-iconv-modules))
-install-others += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
-
-$(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules)) : \
-$(inst_gconvdir)/%.so: $(objpfx)%.so $(+force)
- $(do-install-program)
-
-$(objpfx)gconv-modules-s390: gconv-modules $(+force)
- cp $< $@
- echo >> $@
- echo "# S/390 hardware accelerated modules" >> $@
- echo -n "module ISO-8859-1// IBM037// " >> $@
- echo " ISO-8859-1_CP037_Z900 1" >> $@
- echo -n "module IBM037// ISO-8859-1// " >> $@
- echo " ISO-8859-1_CP037_Z900 1" >> $@
- echo -n "module ISO-10646/UTF8/ UTF-32// " >> $@
- echo " UTF8_UTF32_Z9 1" >> $@
- echo -n "module UTF-32BE// ISO-10646/UTF8/ " >> $@
- echo " UTF8_UTF32_Z9 1" >> $@
- echo -n "module ISO-10646/UTF8/ UTF-32BE// " >> $@
- echo " UTF8_UTF32_Z9 1" >> $@
- echo -n "module UTF-16BE// UTF-32// " >> $@
- echo " UTF16_UTF32_Z9 1" >> $@
- echo -n "module UTF-32BE// UTF-16// " >> $@
- echo " UTF16_UTF32_Z9 1" >> $@
- echo -n "module INTERNAL UTF-16// " >> $@
- echo " UTF16_UTF32_Z9 1" >> $@
- echo -n "module UTF-32BE// UTF-16BE// " >> $@
- echo " UTF16_UTF32_Z9 1" >> $@
- echo -n "module INTERNAL UTF-16BE// " >> $@
- echo " UTF16_UTF32_Z9 1" >> $@
- echo -n "module UTF-16BE// UTF-32BE// " >> $@
- echo " UTF16_UTF32_Z9 1" >> $@
- echo -n "module UTF-16BE// INTERNAL " >> $@
- echo " UTF16_UTF32_Z9 1" >> $@
- echo -n "module UTF-16BE// ISO-10646/UTF8/ " >> $@
- echo " UTF8_UTF16_Z9 1" >> $@
- echo -n "module ISO-10646/UTF8/ UTF-16// " >> $@
- echo " UTF8_UTF16_Z9 1" >> $@
- echo -n "module ISO-10646/UTF8/ UTF-16BE// " >> $@
- echo " UTF8_UTF16_Z9 1" >> $@
-
-$(inst_gconvdir)/gconv-modules: $(objpfx)gconv-modules-s390 $(+force)
- $(do-install)
-ifeq (no,$(cross-compiling))
-# Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
-# if this libc has more gconv modules than the previously installed one.
- if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
- LC_ALL=C \
- $(rtld-prefix) \
- $(common-objpfx)iconv/iconvconfig \
- $(addprefix --prefix=,$(install_root)); \
- fi
-else
- @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
-endif
-
-endif
diff --git a/sysdeps/s390/s390-64/__longjmp.c b/sysdeps/s390/s390-64/__longjmp.c
index 66005b82ac..17aa0810e6 100644
--- a/sysdeps/s390/s390-64/__longjmp.c
+++ b/sysdeps/s390/s390-64/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/s390/s390-64/add_n.S b/sysdeps/s390/s390-64/add_n.S
index 11bc60170b..5cbc6d0d8e 100644
--- a/sysdeps/s390/s390-64/add_n.S
+++ b/sysdeps/s390/s390-64/add_n.S
@@ -1,6 +1,6 @@
/* Add two limb vectors of the same length > 0 and store sum in a third
limb vector.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU MP Library.
diff --git a/sysdeps/s390/s390-64/backtrace.c b/sysdeps/s390/s390-64/backtrace.c
index 5f8b7f8fff..3efcbe4096 100644
--- a/sysdeps/s390/s390-64/backtrace.c
+++ b/sysdeps/s390/s390-64/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state. 64 bit S/390 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-64/bcopy.S b/sysdeps/s390/s390-64/bcopy.S
index 7eeeae499c..806dd15d02 100644
--- a/sysdeps/s390/s390-64/bcopy.S
+++ b/sysdeps/s390/s390-64/bcopy.S
@@ -1,6 +1,6 @@
/* bcopy -- copy a block from source to destination. 64 bit S/390 version.
This file is part of the GNU C Library.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-64/bits/wordsize.h b/sysdeps/s390/s390-64/bits/wordsize.h
index da791fa28e..00e88b0628 100644
--- a/sysdeps/s390/s390-64/bits/wordsize.h
+++ b/sysdeps/s390/s390-64/bits/wordsize.h
@@ -5,15 +5,7 @@
#else
# define __WORDSIZE 32
# define __WORDSIZE32_SIZE_ULONG 1
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
-#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
- the `long double' function variants to be redirects to the double
- functions. */
-# define __LONG_DOUBLE_MATH_OPTIONAL 1
-# ifndef __LONG_DOUBLE_128__
-# define __NO_LONG_DOUBLE_MATH 1
-# endif
-#endif
+#define __WORDSIZE_TIME64_COMPAT32 0
diff --git a/sysdeps/s390/s390-64/bzero.S b/sysdeps/s390/s390-64/bzero.S
index 891efc2d6e..b321665298 100644
--- a/sysdeps/s390/s390-64/bzero.S
+++ b/sysdeps/s390/s390-64/bzero.S
@@ -1,6 +1,6 @@
/* bzero -- set a block of memory to zero. 64 bit S/390 version.
This file is part of the GNU C Library.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-64/crti.S b/sysdeps/s390/s390-64/crti.S
index 248ef83dbe..f676eb5259 100644
--- a/sysdeps/s390/s390-64/crti.S
+++ b/sysdeps/s390/s390-64/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for 64 bit S/390.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -59,6 +59,7 @@
.section .init,"ax",@progbits
.align 4
.globl _init
+ .hidden _init
.type _init,@function
_init:
stmg %r6,%r15,48(%r15)
@@ -81,6 +82,7 @@ _init:
.section .fini,"ax",@progbits
.align 4
.globl _fini
+ .hidden _fini
.type _fini,@function
_fini:
stmg %r6,%r15,48(%r15)
diff --git a/sysdeps/s390/s390-64/crtn.S b/sysdeps/s390/s390-64/crtn.S
index ce906acffc..8ae6394b72 100644
--- a/sysdeps/s390/s390-64/crtn.S
+++ b/sysdeps/s390/s390-64/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for 64 bit S/390.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h
index cb81aafc5d..f22db7860b 100644
--- a/sysdeps/s390/s390-64/dl-machine.h
+++ b/sysdeps/s390/s390-64/dl-machine.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions.
64 bit S/390 Version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -26,6 +26,7 @@
#include <sys/param.h>
#include <string.h>
#include <link.h>
+#include <sysdeps/s390/dl-procinfo.h>
#include <dl-irel.h>
#define ELF_MACHINE_IRELATIVE R_390_IRELATIVE
@@ -78,6 +79,10 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
{
extern void _dl_runtime_resolve (Elf64_Word);
extern void _dl_runtime_profile (Elf64_Word);
+#if defined HAVE_S390_VX_ASM_SUPPORT
+ extern void _dl_runtime_resolve_vx (Elf64_Word);
+ extern void _dl_runtime_profile_vx (Elf64_Word);
+#endif
if (l->l_info[DT_JMPREL] && lazy)
{
@@ -93,7 +98,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
if (got[1])
{
l->l_mach.plt = got[1] + l->l_addr;
- l->l_mach.gotplt = (Elf64_Addr) &got[3];
+ l->l_mach.jmprel = (const Elf64_Rela *) D_PTR (l, l_info[DT_JMPREL]);
}
got[1] = (Elf64_Addr) l; /* Identify this shared object. */
@@ -105,7 +110,14 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
end in this function. */
if (__glibc_unlikely (profile))
{
+#if defined HAVE_S390_VX_ASM_SUPPORT
+ if (GLRO(dl_hwcap) & HWCAP_S390_VX)
+ got[2] = (Elf64_Addr) &_dl_runtime_profile_vx;
+ else
+ got[2] = (Elf64_Addr) &_dl_runtime_profile;
+#else
got[2] = (Elf64_Addr) &_dl_runtime_profile;
+#endif
if (GLRO(dl_profile) != NULL
&& _dl_name_match_p (GLRO(dl_profile), l))
@@ -114,9 +126,18 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
GL(dl_profile_map) = l;
}
else
- /* This function will get called to fix up the GOT entry indicated by
- the offset on the stack, and then jump to the resolved address. */
- got[2] = (Elf64_Addr) &_dl_runtime_resolve;
+ {
+ /* This function will get called to fix up the GOT entry indicated by
+ the offset on the stack, and then jump to the resolved address. */
+#if defined HAVE_S390_VX_ASM_SUPPORT
+ if (GLRO(dl_hwcap) & HWCAP_S390_VX)
+ got[2] = (Elf64_Addr) &_dl_runtime_resolve_vx;
+ else
+ got[2] = (Elf64_Addr) &_dl_runtime_resolve;
+#else
+ got[2] = (Elf64_Addr) &_dl_runtime_resolve;
+#endif
+ }
}
return lazy;
@@ -221,6 +242,7 @@ dl_platform_init (void)
static inline Elf64_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf64_Rela *reloc,
Elf64_Addr *reloc_addr, Elf64_Addr value)
{
@@ -283,7 +305,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
const Elf64_Sym *const refsym = sym;
#endif
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf64_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf64_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
@@ -439,9 +461,7 @@ elf_machine_lazy_rel (struct link_map *map,
if (__builtin_expect (map->l_mach.plt, 0) == 0)
*reloc_addr += l_addr;
else
- *reloc_addr =
- map->l_mach.plt
- + (((Elf64_Addr) reloc_addr) - map->l_mach.gotplt) * 4;
+ *reloc_addr = map->l_mach.plt + (reloc - map->l_mach.jmprel) * 32;
}
else if (__glibc_likely (r_type == R_390_IRELATIVE))
{
diff --git a/sysdeps/s390/s390-64/dl-trampoline.S b/sysdeps/s390/s390-64/dl-trampoline.S
index 6919ed0138..03c8f0415b 100644
--- a/sysdeps/s390/s390-64/dl-trampoline.S
+++ b/sysdeps/s390/s390-64/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. s390x version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software 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,126 +16,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* The PLT stubs will call _dl_runtime_resolve/_dl_runtime_profile
- * with the following linkage:
- * r2 - r6 : parameter registers
- * f0, f2, f4, f6 : floating point parameter registers
- * 48(r15), 56(r15) : PLT arguments PLT1, PLT2
- * 160(r15) : additional stack parameters
- * The normal clobber rules for function calls apply:
- * r0 - r5 : call clobbered
- * r6 - r13 : call saved
- * r14 : return address (call clobbered)
- * r15 : stack pointer (call saved)
- * f1, f3, f5, f7 : call saved
- * f0 - f3, f5, f7 - f15 : call clobbered
- */
-
#include <sysdep.h>
.text
- .globl _dl_runtime_resolve
- .type _dl_runtime_resolve, @function
- cfi_startproc
- .align 16
-_dl_runtime_resolve:
- stmg %r2,%r5,64(15) # save call-clobbered argument registers
- stg %r14,96(15)
- cfi_offset (r14, -64)
- lgr %r0,%r15
- aghi %r15,-160 # create stack frame
- cfi_adjust_cfa_offset (160)
- stg %r0,0(%r15) # write backchain
- lmg %r2,%r3,208(%r15)# load args saved by PLT
- brasl %r14,_dl_fixup # call fixup
- lgr %r1,%r2 # function addr returned in r2
- aghi %r15,160 # remove stack frame
- cfi_adjust_cfa_offset (-160)
- lg %r14,96(15) # restore registers
- lmg %r2,%r5,64(15)
- br %r1
- cfi_endproc
- .size _dl_runtime_resolve, .-_dl_runtime_resolve
-
-
-#ifndef PROF
- .globl _dl_runtime_profile
- .type _dl_runtime_profile, @function
- cfi_startproc
- .align 16
-_dl_runtime_profile:
- stmg %r2,%r6,64(%r15) # save call-clobbered arg regs
- std %f0,104(%r15) # + r6 needed as arg for
- std %f2,112(%r15) # _dl_profile_fixup
- std %f4,120(%r15)
- std %f6,128(%r15)
- stg %r12,24(%r15) # r12 is used as backup of r15
- stg %r14,32(%r15)
- cfi_offset (r6, -96)
- cfi_offset (f0, -56)
- cfi_offset (f2, -48)
- cfi_offset (f4, -40)
- cfi_offset (f6, -32)
- cfi_offset (r12, -136)
- cfi_offset (r14, -128)
- lgr %r12,%r15 # backup stack pointer
- cfi_def_cfa_register (12)
- aghi %r15,-160 # create stack frame
- stg %r12,0(%r15) # save backchain
- lmg %r2,%r3,48(%r12) # load arguments saved by PLT
- lgr %r4,%r14 # return address as third parameter
- la %r5,64(%r12) # pointer to struct La_s390_32_regs
- la %r6,40(%r12) # long int * framesize
- brasl %r14,_dl_profile_fixup # call resolver
- lgr %r1,%r2 # function addr returned in r2
- lg %r0,40(%r12) # load framesize
- ltgr %r0,%r0
- jnm 1f
-
- lmg %r2,%r6,64(%r12) # framesize < 0 means no pltexit call
- ld %f0,104(%r12) # so we can do a tail call without
- ld %f2,112(%r12) # copying the arg overflow area
- ld %f4,120(%r12)
- ld %f6,128(%r12)
-
- lgr %r15,%r12 # remove stack frame
- cfi_def_cfa_register (15)
- lg %r14,32(%r15) # restore registers
- lg %r12,24(%r15)
- br %r1 # tail-call to resolved function
-
- cfi_def_cfa_register (12)
-1: jz 4f # framesize == 0 ?
- aghi %r0,7 # align framesize to 8
- nill %r0,0xfff8
- slgr %r15,%r0 # make room for framesize bytes
- stg %r12,0(%r15)
- la %r2,160(%r15)
- la %r3,160(%r12)
- srlg %r0,%r0,3
-3: mvc 0(8,%r2),0(%r3) # copy additional parameters
- la %r2,8(%r2)
- la %r3,8(%r3)
- brctg %r0,3b
-4: lmg %r2,%r6,64(%r12) # load register parameters
- ld %f0,104(%r12) # restore call-clobbered arg regs
- ld %f2,112(%r12)
- ld %f4,120(%r12)
- ld %f6,128(%r12)
- basr %r14,%r1 # call resolved function
- stg %r2,136(%r12)
- std %f0,144(%r12)
- lmg %r2,%r3,48(%r12) # load arguments saved by PLT
- la %r4,32(%r12) # pointer to struct La_s390_32_regs
- la %r5,72(%r12) # pointer to struct La_s390_32_retval
- brasl %r14,_dl_call_pltexit
-
- lgr %r15,%r12 # remove stack frame
- cfi_def_cfa_register (15)
- lg %r14,32(%r15) # restore registers
- lg %r12,24(%r15)
- br %r14
-
- cfi_endproc
- .size _dl_runtime_profile, .-_dl_runtime_profile
+/* Create variant of _dl_runtime_resolve/profile for machines before z13.
+ No vector registers are saved/restored. */
+#include <dl-trampoline.h>
+
+#if defined HAVE_S390_VX_ASM_SUPPORT
+/* Create variant of _dl_runtime_resolve/profile for z13 and newer.
+ The vector registers are saved/restored, too.*/
+# define _dl_runtime_resolve _dl_runtime_resolve_vx
+# define _dl_runtime_profile _dl_runtime_profile_vx
+# define RESTORE_VRS
+# include <dl-trampoline.h>
#endif
diff --git a/sysdeps/s390/s390-64/dl-trampoline.h b/sysdeps/s390/s390-64/dl-trampoline.h
new file mode 100644
index 0000000000..d313fd521d
--- /dev/null
+++ b/sysdeps/s390/s390-64/dl-trampoline.h
@@ -0,0 +1,224 @@
+/* PLT trampolines. s390x version.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+/* The PLT stubs will call _dl_runtime_resolve/_dl_runtime_profile
+ * with the following linkage:
+ * r2 - r6 : parameter registers
+ * f0, f2, f4, f6 : floating point parameter registers
+ * v24, v26, v28, v30, v25, v27, v29, v31 : vector parameter registers
+ * 48(r15), 56(r15) : PLT arguments PLT1, PLT2
+ * 160(r15) : additional stack parameters
+ * The normal clobber rules for function calls apply:
+ * r0 - r5 : call clobbered
+ * r6 - r13 : call saved
+ * r14 : return address (call clobbered)
+ * r15 : stack pointer (call saved)
+ * f0 - f7 : call clobbered
+ * f8 - f15 : call saved
+ * v0 - v7 : bytes 0-7 overlap with f0-f7: call clobbered
+ bytes 8-15: call clobbered
+ * v8 - v15 : bytes 0-7 overlap with f8-f15: call saved
+ bytes 8-15: call clobbered
+ * v16 - v31 : call clobbered
+ */
+
+ .globl _dl_runtime_resolve
+ .type _dl_runtime_resolve, @function
+ cfi_startproc
+ .align 16
+_dl_runtime_resolve:
+ stmg %r2,%r5,64(%r15) # save call-clobbered argument registers
+ cfi_offset (r2, -96)
+ cfi_offset (r3, -88)
+ cfi_offset (r4, -80)
+ cfi_offset (r5, -72)
+ stmg %r14,%r15,96(%r15)
+ cfi_offset (r14, -64)
+ cfi_offset (r15, -56)
+ std %f0,112(%r15)
+ cfi_offset (f0, -48)
+ std %f2,120(%r15)
+ cfi_offset (f2, -40)
+ std %f4,128(%r15)
+ cfi_offset (f4, -32)
+ std %f6,136(%r15)
+ cfi_offset (f6, -24)
+ lmg %r2,%r3,48(%r15) # load args for fixup saved by PLT
+ lgr %r0,%r15
+#ifdef RESTORE_VRS
+ aghi %r15,-288 # create stack frame
+ cfi_adjust_cfa_offset (288)
+ .machine push
+ .machine "z13"
+ vstm %v24,%v31,160(%r15)# store call-clobbered vector argument registers
+ cfi_offset (v24, -288)
+ cfi_offset (v25, -272)
+ cfi_offset (v26, -256)
+ cfi_offset (v27, -240)
+ cfi_offset (v28, -224)
+ cfi_offset (v29, -208)
+ cfi_offset (v30, -192)
+ cfi_offset (v31, -176)
+ .machine pop
+#else
+ aghi %r15,-160 # create stack frame
+ cfi_adjust_cfa_offset (160)
+#endif
+ stg %r0,0(%r15) # write backchain
+ brasl %r14,_dl_fixup # call _dl_fixup
+ lgr %r1,%r2 # function addr returned in r2
+#ifdef RESTORE_VRS
+ .machine push
+ .machine "z13"
+ vlm %v24,%v31,160(%r15)# restore vector registers
+ .machine pop
+ lmg %r14,%r15,384(%r15)# remove stack frame and restore registers
+#else
+ lmg %r14,%r15,256(%r15)# remove stack frame and restore registers
+#endif
+ cfi_def_cfa_offset (160)
+ ld %f0,112(%r15)
+ ld %f2,120(%r15)
+ ld %f4,128(%r15)
+ ld %f6,136(%r15)
+ lmg %r2,%r5,64(%r15)
+ br %r1
+ cfi_endproc
+ .size _dl_runtime_resolve, .-_dl_runtime_resolve
+
+
+#ifndef PROF
+ .globl _dl_runtime_profile
+ .type _dl_runtime_profile, @function
+ cfi_startproc
+ .align 16
+_dl_runtime_profile:
+ stg %r12,24(%r15) # r12 is used as backup of r15
+ cfi_offset (r12, -136)
+ stg %r14,32(%r15)
+ cfi_offset (r14, -128)
+ lgr %r12,%r15 # backup stack pointer
+ cfi_def_cfa_register (12)
+ aghi %r15,-360 # create stack frame:
+ # 160 + sizeof(La_s390_64_regs)
+ stg %r12,0(%r15) # save backchain
+
+ stmg %r2,%r6,160(%r15) # save call-clobbered arg regs
+ cfi_offset (r2, -360) # + r6 needed as arg for
+ cfi_offset (r3, -352) # _dl_profile_fixup
+ cfi_offset (r4, -344)
+ cfi_offset (r5, -336)
+ cfi_offset (r6, -328)
+ std %f0,200(%r15)
+ cfi_offset (f0, -320)
+ std %f2,208(%r15)
+ cfi_offset (f2, -312)
+ std %f4,216(%r15)
+ cfi_offset (f4, -304)
+ std %f6,224(%r15)
+ cfi_offset (f6, -296)
+#ifdef RESTORE_VRS
+ .machine push
+ .machine "z13"
+ vstm %v24,%v31,232(%r15) # store call-clobbered vector arguments
+ cfi_offset (v24, -288)
+ cfi_offset (v25, -272)
+ cfi_offset (v26, -256)
+ cfi_offset (v27, -240)
+ cfi_offset (v28, -224)
+ cfi_offset (v29, -208)
+ cfi_offset (v30, -192)
+ cfi_offset (v31, -176)
+ .machine pop
+#endif
+ lmg %r2,%r3,48(%r12) # load arguments saved by PLT
+ lgr %r4,%r14 # return address as third parameter
+ la %r5,160(%r15) # pointer to struct La_s390_64_regs
+ la %r6,40(%r12) # long int * framesize
+ brasl %r14,_dl_profile_fixup # call resolver
+ lgr %r1,%r2 # function addr returned in r2
+ ld %f0,200(%r15) # restore call-clobbered arg fprs
+ ld %f2,208(%r15)
+ ld %f4,216(%r15)
+ ld %f6,224(%r15)
+#ifdef RESTORE_VRS
+ .machine push
+ .machine "z13"
+ vlm %v24,%v31,232(%r15) # restore call-clobbered arg vrs
+ .machine pop
+#endif
+ lg %r0,40(%r12) # load framesize
+ ltgr %r0,%r0
+ jnm 1f
+
+ lmg %r2,%r6,160(%r15) # framesize < 0 means no pltexit call
+ # so we can do a tail call without
+ # copying the arg overflow area
+ lgr %r15,%r12 # remove stack frame
+ cfi_def_cfa_register (15)
+ lg %r14,32(%r15) # restore registers
+ lg %r12,24(%r15)
+ br %r1 # tail-call to resolved function
+
+ cfi_def_cfa_register (12)
+1: la %r4,160(%r15) # pointer to struct La_s390_64_regs
+ stg %r4,64(%r12)
+ jz 4f # framesize == 0 ?
+ aghi %r0,7 # align framesize to 8
+ nill %r0,0xfff8
+ slgr %r15,%r0 # make room for framesize bytes
+ stg %r12,0(%r15) # save backchain
+ la %r2,160(%r15)
+ la %r3,160(%r12)
+ srlg %r0,%r0,3
+3: mvc 0(8,%r2),0(%r3) # copy additional parameters
+ la %r2,8(%r2) # depending on framesize
+ la %r3,8(%r3)
+ brctg %r0,3b
+4: lmg %r2,%r6,0(%r4) # restore call-clobbered arg gprs
+ basr %r14,%r1 # call resolved function
+ stg %r2,72(%r12) # store return values r2, f0
+ std %f0,80(%r12) # to struct La_s390_64_retval
+#ifdef RESTORE_VRS
+ .machine push
+ .machine "z13"
+ vst %v24,88(%r12) # store return value v24
+ .machine pop
+#endif
+ lmg %r2,%r4,48(%r12) # r2, r3: load arguments saved by PLT
+ # r4: pointer to struct La_s390_64_regs
+ la %r5,72(%r12) # pointer to struct La_s390_64_retval
+ brasl %r14,_dl_call_pltexit
+
+ lgr %r15,%r12 # remove stack frame
+ cfi_def_cfa_register (15)
+ lg %r14,32(%r15) # restore registers
+ lg %r12,24(%r15)
+ lg %r2,72(%r15) # restore return values
+ ld %f0,80(%r15)
+#ifdef RESTORE_VRS
+ .machine push
+ .machine "z13"
+ vl %v24,88(%r15) # restore return value v24
+ .machine pop
+#endif
+ br %r14 # Jump back to caller
+
+ cfi_endproc
+ .size _dl_runtime_profile, .-_dl_runtime_profile
+#endif
diff --git a/sysdeps/s390/s390-64/memchr.S b/sysdeps/s390/s390-64/memchr.S
index 8d50dcfe86..a19fcafa14 100644
--- a/sysdeps/s390/s390-64/memchr.S
+++ b/sysdeps/s390/s390-64/memchr.S
@@ -1,5 +1,5 @@
/* Search a character in a block of memory. 64 bit S/390 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-64/memcmp.S b/sysdeps/s390/s390-64/memcmp.S
index 5e79d544bf..005b19de45 100644
--- a/sysdeps/s390/s390-64/memcmp.S
+++ b/sysdeps/s390/s390-64/memcmp.S
@@ -1,5 +1,5 @@
/* memcmp - compare two memory blocks. 64 bit S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-64/memcpy.S b/sysdeps/s390/s390-64/memcpy.S
index e84a3572cb..2e5490df23 100644
--- a/sysdeps/s390/s390-64/memcpy.S
+++ b/sysdeps/s390/s390-64/memcpy.S
@@ -1,5 +1,5 @@
/* memcpy - copy a block from source to destination. 64 bit S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,19 +27,27 @@
.text
+ENTRY(__mempcpy)
+ .machine "z900"
+ lgr %r1,%r2 # Use as dest
+ la %r2,0(%r4,%r2) # Return dest + n
+ j .L_Z900_start
+END(__mempcpy)
+#ifndef USE_MULTIARCH
+libc_hidden_def (__mempcpy)
+weak_alias (__mempcpy, mempcpy)
+libc_hidden_builtin_def (mempcpy)
+#endif
-#ifdef USE_MULTIARCH
-ENTRY(__memcpy_default)
-#else
ENTRY(memcpy)
-#endif
.machine "z900"
+ lgr %r1,%r2 # r1: Use as dest ; r2: Return dest
+.L_Z900_start:
ltgr %r4,%r4
je .L_Z900_4
aghi %r4,-1
srlg %r5,%r4,8
ltgr %r5,%r5
- lgr %r1,%r2
jne .L_Z900_13
.L_Z900_3:
larl %r5,.L_Z900_15
@@ -47,7 +55,7 @@ ENTRY(memcpy)
.L_Z900_4:
br %r14
.L_Z900_13:
- chi %r5,4096 # Switch to mvcle for copies >1MB
+ cghi %r5,4096 # Switch to mvcle for copies >1MB
jh __memcpy_mvcle
.L_Z900_12:
mvc 0(256,%r1),0(%r3)
@@ -57,25 +65,24 @@ ENTRY(memcpy)
j .L_Z900_3
.L_Z900_15:
mvc 0(1,%r1),0(%r3)
-
-#ifdef USE_MULTIARCH
-END(__memcpy_default)
-#else
END(memcpy)
+#ifndef USE_MULTIARCH
libc_hidden_builtin_def (memcpy)
#endif
ENTRY(__memcpy_mvcle)
- # Using as standalone function will result in unexpected
- # results since the length field is incremented by 1 in order to
- # compensate the changes already done in the functions above.
- aghi %r4,1 # length + 1
- lgr %r5,%r4 # source length
- lgr %r4,%r3 # source address
- lgr %r3,%r5 # destination length = source length
+ # Using as standalone function will result in unexpected
+ # results since the length field is incremented by 1 in order to
+ # compensate the changes already done in the functions above.
+ lgr %r0,%r2 # backup return dest [ + n ]
+ aghi %r4,1 # length + 1
+ lgr %r5,%r4 # source length
+ lgr %r4,%r3 # source address
+ lgr %r2,%r1 # destination address
+ lgr %r3,%r5 # destination length = source length
.L_MVCLE_1:
- mvcle %r2,%r4,0 # thats it, MVCLE is your friend
- jo .L_MVCLE_1
- lgr %r2,%r1 # return destination address
- br %r14
+ mvcle %r2,%r4,0 # thats it, MVCLE is your friend
+ jo .L_MVCLE_1
+ lgr %r2,%r0 # return destination address
+ br %r14
END(__memcpy_mvcle)
diff --git a/sysdeps/s390/s390-64/memset.S b/sysdeps/s390/s390-64/memset.S
index cab7855549..8799c6592c 100644
--- a/sysdeps/s390/s390-64/memset.S
+++ b/sysdeps/s390/s390-64/memset.S
@@ -1,5 +1,5 @@
/* Set a block of memory to some byte value. 64 bit S/390 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-64/multiarch/memchr.c b/sysdeps/s390/s390-64/multiarch/memchr.c
index 2281e43056..5e1610afa4 100644
--- a/sysdeps/s390/s390-64/multiarch/memchr.c
+++ b/sysdeps/s390/s390-64/multiarch/memchr.c
@@ -1,5 +1,5 @@
/* Multiple versions of memchr.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-64/multiarch/memcmp-s390x.S b/sysdeps/s390/s390-64/multiarch/memcmp-s390x.S
index 2a4c0ae9a6..35f9bf9cf7 100644
--- a/sysdeps/s390/s390-64/multiarch/memcmp-s390x.S
+++ b/sysdeps/s390/s390-64/multiarch/memcmp-s390x.S
@@ -1,5 +1,5 @@
/* CPU specific memcmp implementations. 64 bit S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -98,4 +98,7 @@ END(__memcmp_z10)
.set memcmp,__memcmp_default
.weak bcmp
.set bcmp,__memcmp_default
+#elif defined SHARED && IS_IN (libc)
+.globl __GI_memcmp
+.set __GI_memcmp,__memcmp_default
#endif
diff --git a/sysdeps/s390/s390-64/multiarch/memcmp.c b/sysdeps/s390/s390-64/multiarch/memcmp.c
index 44f72dc8ca..1e6f31806e 100644
--- a/sysdeps/s390/s390-64/multiarch/memcmp.c
+++ b/sysdeps/s390/s390-64/multiarch/memcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of memcmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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-s390x.S b/sysdeps/s390/s390-64/multiarch/memcpy-s390x.S
index 69fa562060..6d60a70834 100644
--- a/sysdeps/s390/s390-64/multiarch/memcpy-s390x.S
+++ b/sysdeps/s390/s390-64/multiarch/memcpy-s390x.S
@@ -1,5 +1,5 @@
/* CPU specific memcpy implementations. 64 bit S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,12 +29,20 @@
#if defined SHARED && IS_IN (libc)
+ENTRY(____mempcpy_z196)
+ .machine "z196"
+ lgr %r1,%r2 # Use as dest
+ la %r2,0(%r4,%r2) # Return dest + n
+ j .L_Z196_start
+END(____mempcpy_z196)
+
ENTRY(__memcpy_z196)
.machine "z196"
+ lgr %r1,%r2 # r1: Use as dest ; r2: Return dest
+.L_Z196_start:
ltgr %r4,%r4
je .L_Z196_4
aghi %r4,-1
- lgr %r1,%r2
srlg %r5,%r4,8
ltgr %r5,%r5
jne .L_Z196_5
@@ -58,11 +66,19 @@ ENTRY(__memcpy_z196)
mvc 0(1,%r1),0(%r3)
END(__memcpy_z196)
+ENTRY(____mempcpy_z10)
+ .machine "z10"
+ lgr %r1,%r2 # Use as dest
+ la %r2,0(%r4,%r2) # Return dest + n
+ j .L_Z10_start
+END(____mempcpy_z10)
+
ENTRY(__memcpy_z10)
.machine "z10"
+ lgr %r1,%r2 # r1: Use as dest ; r2: Return dest
+.L_Z10_start:
cgije %r4,0,.L_Z10_4
aghi %r4,-1
- lgr %r1,%r2
srlg %r5,%r4,8
cgijlh %r5,0,.L_Z10_13
.L_Z10_3:
@@ -84,11 +100,23 @@ ENTRY(__memcpy_z10)
mvc 0(1,%r1),0(%r3)
END(__memcpy_z10)
+# define __mempcpy ____mempcpy_default
#endif /* SHARED && IS_IN (libc) */
+#define memcpy __memcpy_default
#include "../memcpy.S"
+#undef memcpy
-#if !defined SHARED || !IS_IN (libc)
+#if defined SHARED && IS_IN (libc)
+.globl __GI_memcpy
+.set __GI_memcpy,__memcpy_default
+.globl __GI_mempcpy
+.set __GI_mempcpy,____mempcpy_default
+.globl __GI___mempcpy
+.set __GI___mempcpy,____mempcpy_default
+#else
.globl memcpy
.set memcpy,__memcpy_default
+.weak mempcpy
+.set mempcpy,__mempcpy
#endif
diff --git a/sysdeps/s390/s390-64/multiarch/memcpy.c b/sysdeps/s390/s390-64/multiarch/memcpy.c
index 2a98aa0b82..c9577a854a 100644
--- a/sysdeps/s390/s390-64/multiarch/memcpy.c
+++ b/sysdeps/s390/s390-64/multiarch/memcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of memcpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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-s390x.S b/sysdeps/s390/s390-64/multiarch/memset-s390x.S
index 05e068279d..0c5aaef34f 100644
--- a/sysdeps/s390/s390-64/multiarch/memset-s390x.S
+++ b/sysdeps/s390/s390-64/multiarch/memset-s390x.S
@@ -1,5 +1,5 @@
/* Set a block of memory to some byte value. 64 bit S/390 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -106,4 +106,7 @@ END(__memset_mvcle)
#if !IS_IN (libc)
.globl memset
.set memset,__memset_default
+#elif defined SHARED && IS_IN (libc)
+.globl __GI_memset
+.set __GI_memset,__memset_default
#endif
diff --git a/sysdeps/s390/s390-64/multiarch/memset.c b/sysdeps/s390/s390-64/multiarch/memset.c
index 89b8102f2a..760b3e9df2 100644
--- a/sysdeps/s390/s390-64/multiarch/memset.c
+++ b/sysdeps/s390/s390-64/multiarch/memset.c
@@ -1,5 +1,5 @@
/* Multiple versions of memset.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,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/multiarch/strcmp.c b/sysdeps/s390/s390-64/multiarch/strcmp.c
index b7eebc017f..d06b0f3436 100644
--- a/sysdeps/s390/s390-64/multiarch/strcmp.c
+++ b/sysdeps/s390/s390-64/multiarch/strcmp.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcmp.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-64/multiarch/strcpy.c b/sysdeps/s390/s390-64/multiarch/strcpy.c
index ae140d22b7..6a22e31a03 100644
--- a/sysdeps/s390/s390-64/multiarch/strcpy.c
+++ b/sysdeps/s390/s390-64/multiarch/strcpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of strcpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-64/multiarch/strncpy.c b/sysdeps/s390/s390-64/multiarch/strncpy.c
index 28a2af72e4..57f9df18d1 100644
--- a/sysdeps/s390/s390-64/multiarch/strncpy.c
+++ b/sysdeps/s390/s390-64/multiarch/strncpy.c
@@ -1,5 +1,5 @@
/* Multiple versions of strncpy.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-64/s390x-mcount.S b/sysdeps/s390/s390-64/s390x-mcount.S
index cb67ddb7ff..c6b5d65e17 100644
--- a/sysdeps/s390/s390-64/s390x-mcount.S
+++ b/sysdeps/s390/s390-64/s390x-mcount.S
@@ -1,5 +1,5 @@
-/* 64 bit S/390-specific implemetation of profiling support.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* 64 bit S/390-specific implementation of profiling support.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com)
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-64/setjmp.S b/sysdeps/s390/s390-64/setjmp.S
index bbcb70db5f..f512589fb9 100644
--- a/sysdeps/s390/s390-64/setjmp.S
+++ b/sysdeps/s390/s390-64/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for 64 bit S/390, ELF version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -24,17 +24,16 @@
#include <shlib-compat.h>
#include <stap-probe.h>
-#if !IS_IN (rtld)
-# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
- /* we need a unique name in case of symbol versioning. */
-# define setjmp __v1setjmp
-# define _setjmp __v1_setjmp
-# define __sigsetjmp __v1__sigsetjmp
-
-# undef libc_hidden_def
-# define libc_hidden_def(name) strong_alias(_setjmp, __GI__setjmp)
-# endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */
-#endif /* !IS_IN (rtld) */
+#if !IS_IN (rtld) && defined SHARED \
+ && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
+# define NEED_COMPAT_SYMBOLS 1
+/* We need a unique name in case of symbol versioning. */
+# define setjmp __v1setjmp
+# define _setjmp __v1_setjmp
+# define __sigsetjmp __v1__sigsetjmp
+#else
+# define NEED_COMPAT_SYMBOLS 0
+#endif
/* We include the BSD entry points here as well. */
ENTRY (setjmp)
@@ -47,7 +46,11 @@ ENTRY(_setjmp)
slgr %r3,%r3 /* Second argument of zero. */
j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */
END (_setjmp)
+#if NEED_COMPAT_SYMBOLS
+strong_alias (_setjmp, __GI__setjmp)
+#else
libc_hidden_def (_setjmp)
+#endif
ENTRY(__setjmp)
slgr %r3,%r3 /* Second argument of zero. */
@@ -87,15 +90,19 @@ ENTRY(__sigsetjmp)
jg __sigjmp_save
#endif
END (__sigsetjmp)
+#if NEED_COMPAT_SYMBOLS
+strong_alias (__sigsetjmp, __GI___sigsetjmp)
+#else
+libc_hidden_def (__sigsetjmp)
+#endif
-#if !IS_IN (rtld)
-# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
+#if NEED_COMPAT_SYMBOLS
/* In glibc release 2.19 new versions of setjmp-functions were introduced,
but were reverted before 2.20. Thus both versions are the same function. */
-# undef setjmp
-# undef _setjmp
-# undef __sigsetjmp
+# undef setjmp
+# undef _setjmp
+# undef __sigsetjmp
strong_alias (__v1setjmp, __v2setjmp);
versioned_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0);
@@ -108,5 +115,4 @@ compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19);
strong_alias (__v1__sigsetjmp, __v2__sigsetjmp);
versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0);
compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19);
-# endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */
-#endif /* if !IS_IN (rtld) */
+#endif /* NEED_COMPAT_SYMBOLS */
diff --git a/sysdeps/s390/s390-64/start.S b/sysdeps/s390/s390-64/start.S
index e261460dd5..79e7b69f1d 100644
--- a/sysdeps/s390/s390-64/start.S
+++ b/sysdeps/s390/s390-64/start.S
@@ -1,5 +1,5 @@
/* Startup code compliant to the 64 bit S/390 ELF ABI.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -34,6 +34,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <sysdep.h>
+
/*
This is the canonical entry point, usually the first thing in the text
segment. Most registers' values are unspecified, except for:
@@ -57,6 +59,9 @@
.globl _start
.type _start,@function
_start:
+ cfi_startproc
+ /* Mark r14 as undefined in order to stop unwinding here! */
+ cfi_undefined (r14)
/* Load argc and argv from stack. */
la %r4,8(%r15) # get argv
lg %r3,0(%r15) # get argc
@@ -91,6 +96,8 @@ _start:
/* Crash if __libc_start_main returns. */
.word 0
+ cfi_endproc
+
/* Define a symbol for the first piece of initialized data. */
.data
.globl __data_start
diff --git a/sysdeps/s390/s390-64/strcmp.S b/sysdeps/s390/s390-64/strcmp.S
index 245b54cc9d..6cf1addd8b 100644
--- a/sysdeps/s390/s390-64/strcmp.S
+++ b/sysdeps/s390/s390-64/strcmp.S
@@ -1,6 +1,6 @@
/* strcmp - compare two string. 64 bit S/390 version.
This file is part of the GNU C Library.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/s390-64/strcpy.S b/sysdeps/s390/s390-64/strcpy.S
index 9864e98b24..203c73c905 100644
--- a/sysdeps/s390/s390-64/strcpy.S
+++ b/sysdeps/s390/s390-64/strcpy.S
@@ -1,5 +1,5 @@
/* strcpy - copy a string from source to destination. 64 bit S/390 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-64/strncpy.S b/sysdeps/s390/s390-64/strncpy.S
index 56c8a526ae..be40aa32d5 100644
--- a/sysdeps/s390/s390-64/strncpy.S
+++ b/sysdeps/s390/s390-64/strncpy.S
@@ -1,6 +1,6 @@
/* strncpy - copy at most n characters from a string from source to
destination. 64 bit S/390 version
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-64/sub_n.S b/sysdeps/s390/s390-64/sub_n.S
index 7318836db9..ad5c7fc9ca 100644
--- a/sysdeps/s390/s390-64/sub_n.S
+++ b/sysdeps/s390/s390-64/sub_n.S
@@ -1,6 +1,6 @@
/* __mpn_sub_n -- Add two limb vectors of the same length > 0 and store
sum in a third limb vector. 64 bit S/390 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU MP Library.
diff --git a/sysdeps/s390/s390-64/sysdep.h b/sysdeps/s390/s390-64/sysdep.h
index 7fac89da51..a573e08e92 100644
--- a/sysdeps/s390/s390-64/sysdep.h
+++ b/sysdeps/s390/s390-64/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for 64 bit S/390.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -77,7 +77,7 @@ lose: SYSCALL_PIC_SETUP \
END (name)
#undef JUMPTARGET
-#ifdef PIC
+#ifdef SHARED
#define JUMPTARGET(name) name##@PLT
#define SYSCALL_PIC_SETUP \
larl %r12,_GLOBAL_OFFSET_TABLE_
diff --git a/sysdeps/s390/s390-64/tls-macros.h b/sysdeps/s390/s390-64/tls-macros.h
index d70ea6ce0c..449a843d69 100644
--- a/sysdeps/s390/s390-64/tls-macros.h
+++ b/sysdeps/s390/s390-64/tls-macros.h
@@ -8,13 +8,15 @@
#ifdef PIC
# define TLS_IE(x) \
- ({ unsigned long __offset, __got; \
+ ({ unsigned long __offset, __save12; \
__asm__ ("bras %0,0f\n\t" \
".quad " #x "@gotntpoff\n" \
- "0:\tlarl %1,_GLOBAL_OFFSET_TABLE_\n\t" \
+ "0:\tlgr %1,%%r12\n\t" \
+ "larl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
"lg %0,0(%0)\n\t" \
- "lg %0,0(%0,%1):tls_load:" #x "\n" \
- : "=&a" (__offset), "=&a" (__got) : : "cc" ); \
+ "lg %0,0(%0,%%r12):tls_load:" #x "\n\t" \
+ "lgr %%r12,%1\n" \
+ : "=&a" (__offset), "=&a" (__save12) : : "cc" ); \
(int *) (__builtin_thread_pointer() + __offset); })
#else
# define TLS_IE(x) \
diff --git a/sysdeps/s390/s390-64/tst-audit.h b/sysdeps/s390/s390-64/tst-audit.h
index 3283e95037..954373e24f 100644
--- a/sysdeps/s390/s390-64/tst-audit.h
+++ b/sysdeps/s390/s390-64/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. S/390 64-bit version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-64/utf16-utf32-z9.c b/sysdeps/s390/s390-64/utf16-utf32-z9.c
deleted file mode 100644
index a3863ee244..0000000000
--- a/sysdeps/s390/s390-64/utf16-utf32-z9.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/* Conversion between UTF-16 and UTF-32 BE/internal.
-
- This module uses the Z9-109 variants of the Convert Unicode
- instructions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
-
- Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
- Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- Thanks to Daniel Appich who covered the relevant performance work
- in his diploma thesis.
-
- This is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <stdint.h>
-#include <unistd.h>
-#include <dl-procinfo.h>
-#include <gconv.h>
-
-/* UTF-32 big endian byte order mark. */
-#define BOM_UTF32 0x0000feffu
-
-/* UTF-16 big endian byte order mark. */
-#define BOM_UTF16 0xfeff
-
-#define DEFINE_INIT 0
-#define DEFINE_FINI 0
-#define MIN_NEEDED_FROM 2
-#define MAX_NEEDED_FROM 4
-#define MIN_NEEDED_TO 4
-#define FROM_LOOP from_utf16_loop
-#define TO_LOOP to_utf16_loop
-#define FROM_DIRECTION (dir == from_utf16)
-#define ONE_DIRECTION 0
-#define PREPARE_LOOP \
- enum direction dir = ((struct utf16_data *) step->__data)->dir; \
- int emit_bom = ((struct utf16_data *) step->__data)->emit_bom; \
- \
- if (emit_bom && !data->__internal_use \
- && data->__invocation_counter == 0) \
- { \
- if (dir == to_utf16) \
- { \
- /* Emit the UTF-16 Byte Order Mark. */ \
- if (__glibc_unlikely (outbuf + 2 > outend)) \
- return __GCONV_FULL_OUTPUT; \
- \
- put16u (outbuf, BOM_UTF16); \
- outbuf += 2; \
- } \
- else \
- { \
- /* Emit the UTF-32 Byte Order Mark. */ \
- if (__glibc_unlikely (outbuf + 4 > outend)) \
- return __GCONV_FULL_OUTPUT; \
- \
- put32u (outbuf, BOM_UTF32); \
- outbuf += 4; \
- } \
- }
-
-/* Direction of the transformation. */
-enum direction
-{
- illegal_dir,
- to_utf16,
- from_utf16
-};
-
-struct utf16_data
-{
- enum direction dir;
- int emit_bom;
-};
-
-
-extern int gconv_init (struct __gconv_step *step);
-int
-gconv_init (struct __gconv_step *step)
-{
- /* Determine which direction. */
- struct utf16_data *new_data;
- enum direction dir = illegal_dir;
- int emit_bom;
- int result;
-
- emit_bom = (__strcasecmp (step->__to_name, "UTF-32//") == 0
- || __strcasecmp (step->__to_name, "UTF-16//") == 0);
-
- if (__strcasecmp (step->__from_name, "UTF-16BE//") == 0
- && (__strcasecmp (step->__to_name, "UTF-32//") == 0
- || __strcasecmp (step->__to_name, "UTF-32BE//") == 0
- || __strcasecmp (step->__to_name, "INTERNAL") == 0))
- {
- dir = from_utf16;
- }
- else if ((__strcasecmp (step->__to_name, "UTF-16//") == 0
- || __strcasecmp (step->__to_name, "UTF-16BE//") == 0)
- && (__strcasecmp (step->__from_name, "UTF-32BE//") == 0
- || __strcasecmp (step->__from_name, "INTERNAL") == 0))
- {
- dir = to_utf16;
- }
-
- result = __GCONV_NOCONV;
- if (dir != illegal_dir)
- {
- new_data = (struct utf16_data *) malloc (sizeof (struct utf16_data));
-
- result = __GCONV_NOMEM;
- if (new_data != NULL)
- {
- new_data->dir = dir;
- new_data->emit_bom = emit_bom;
- step->__data = new_data;
-
- if (dir == from_utf16)
- {
- step->__min_needed_from = MIN_NEEDED_FROM;
- step->__max_needed_from = MIN_NEEDED_FROM;
- step->__min_needed_to = MIN_NEEDED_TO;
- step->__max_needed_to = MIN_NEEDED_TO;
- }
- else
- {
- step->__min_needed_from = MIN_NEEDED_TO;
- step->__max_needed_from = MIN_NEEDED_TO;
- step->__min_needed_to = MIN_NEEDED_FROM;
- step->__max_needed_to = MIN_NEEDED_FROM;
- }
-
- step->__stateful = 0;
-
- result = __GCONV_OK;
- }
- }
-
- return result;
-}
-
-
-extern void gconv_end (struct __gconv_step *data);
-void
-gconv_end (struct __gconv_step *data)
-{
- free (data->__data);
-}
-
-/* The macro for the hardware loop. This is used for both
- directions. */
-#define HARDWARE_CONVERT(INSTRUCTION) \
- { \
- register const unsigned char* pInput __asm__ ("8") = inptr; \
- register unsigned long long inlen __asm__ ("9") = inend - inptr; \
- register unsigned char* pOutput __asm__ ("10") = outptr; \
- register unsigned long long outlen __asm__("11") = outend - outptr; \
- uint64_t cc = 0; \
- \
- __asm__ volatile (".machine push \n\t" \
- ".machine \"z9-109\" \n\t" \
- "0: " INSTRUCTION " \n\t" \
- ".machine pop \n\t" \
- " jo 0b \n\t" \
- " ipm %2 \n" \
- : "+a" (pOutput), "+a" (pInput), "+d" (cc), \
- "+d" (outlen), "+d" (inlen) \
- : \
- : "cc", "memory"); \
- \
- inptr = pInput; \
- outptr = pOutput; \
- cc >>= 28; \
- \
- if (cc == 1) \
- { \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- else if (cc == 2) \
- { \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
- }
-
-/* Conversion function from UTF-16 to UTF-32 internal/BE. */
-
-#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
-#define MAX_NEEDED_INPUT MAX_NEEDED_FROM
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
-#define LOOPFCT FROM_LOOP
-/* The software routine is copied from utf-16.c (minus bytes
- swapping). */
-#define BODY \
- { \
- /* The hardware instruction currently fails to report an error for \
- isolated low surrogates so we have to disable the instruction \
- until this gets resolved. */ \
- if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */ \
- { \
- HARDWARE_CONVERT ("cu24 %0, %1, 1"); \
- if (inptr != inend) \
- { \
- /* Check if the third byte is \
- a valid start of a UTF-16 surrogate. */ \
- if (inend - inptr == 3 && (inptr[3] & 0xfc) != 0xdc) \
- STANDARD_FROM_LOOP_ERR_HANDLER (3); \
- \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- continue; \
- } \
- \
- uint16_t u1 = get16 (inptr); \
- \
- if (__builtin_expect (u1 < 0xd800, 1) || u1 > 0xdfff) \
- { \
- /* No surrogate. */ \
- put32 (outptr, u1); \
- inptr += 2; \
- } \
- else \
- { \
- /* An isolated low-surrogate was found. This has to be \
- considered ill-formed. */ \
- if (__glibc_unlikely (u1 >= 0xdc00)) \
- { \
- STANDARD_FROM_LOOP_ERR_HANDLER (2); \
- } \
- /* It's a surrogate character. At least the first word says \
- it is. */ \
- if (__glibc_unlikely (inptr + 4 > inend)) \
- { \
- /* We don't have enough input for another complete input \
- character. */ \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- \
- inptr += 2; \
- uint16_t u2 = get16 (inptr); \
- if (__builtin_expect (u2 < 0xdc00, 0) \
- || __builtin_expect (u2 > 0xdfff, 0)) \
- { \
- /* This is no valid second word for a surrogate. */ \
- inptr -= 2; \
- STANDARD_FROM_LOOP_ERR_HANDLER (2); \
- } \
- \
- put32 (outptr, ((u1 - 0xd7c0) << 10) + (u2 - 0xdc00)); \
- inptr += 2; \
- } \
- outptr += 4; \
- }
-#define LOOP_NEED_FLAGS
-#include <iconv/loop.c>
-
-/* Conversion from UTF-32 internal/BE to UTF-16. */
-
-#define MIN_NEEDED_INPUT MIN_NEEDED_TO
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
-#define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
-#define LOOPFCT TO_LOOP
-/* The software routine is copied from utf-16.c (minus bytes
- swapping). */
-#define BODY \
- { \
- if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) \
- { \
- HARDWARE_CONVERT ("cu42 %0, %1"); \
- \
- if (inptr != inend) \
- { \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- continue; \
- } \
- \
- uint32_t c = get32 (inptr); \
- \
- if (__builtin_expect (c <= 0xd7ff, 1) \
- || (c >=0xdc00 && c <= 0xffff)) \
- { \
- /* Two UTF-16 chars. */ \
- put16 (outptr, c); \
- } \
- else if (__builtin_expect (c >= 0x10000, 1) \
- && __builtin_expect (c <= 0x10ffff, 1)) \
- { \
- /* Four UTF-16 chars. */ \
- uint16_t zabcd = ((c & 0x1f0000) >> 16) - 1; \
- uint16_t out; \
- \
- /* Generate a surrogate character. */ \
- if (__glibc_unlikely (outptr + 4 > outend)) \
- { \
- /* Overflow in the output buffer. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- \
- out = 0xd800; \
- out |= (zabcd & 0xff) << 6; \
- out |= (c >> 10) & 0x3f; \
- put16 (outptr, out); \
- outptr += 2; \
- \
- out = 0xdc00; \
- out |= c & 0x3ff; \
- put16 (outptr, out); \
- } \
- else \
- { \
- STANDARD_TO_LOOP_ERR_HANDLER (4); \
- } \
- outptr += 2; \
- inptr += 4; \
- }
-#define LOOP_NEED_FLAGS
-#include <iconv/loop.c>
-
-#include <iconv/skeleton.c>
diff --git a/sysdeps/s390/s390-64/utf8-utf16-z9.c b/sysdeps/s390/s390-64/utf8-utf16-z9.c
deleted file mode 100644
index 4148ed796b..0000000000
--- a/sysdeps/s390/s390-64/utf8-utf16-z9.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* Conversion between UTF-16 and UTF-32 BE/internal.
-
- This module uses the Z9-109 variants of the Convert Unicode
- instructions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
-
- Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
- Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- Thanks to Daniel Appich who covered the relevant performance work
- in his diploma thesis.
-
- This is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <stdint.h>
-#include <unistd.h>
-#include <dl-procinfo.h>
-#include <gconv.h>
-
-/* UTF-16 big endian byte order mark. */
-#define BOM_UTF16 0xfeff
-
-#define DEFINE_INIT 0
-#define DEFINE_FINI 0
-#define MIN_NEEDED_FROM 1
-#define MAX_NEEDED_FROM 4
-#define MIN_NEEDED_TO 2
-#define MAX_NEEDED_TO 4
-#define FROM_LOOP from_utf8_loop
-#define TO_LOOP to_utf8_loop
-#define FROM_DIRECTION (dir == from_utf8)
-#define ONE_DIRECTION 0
-#define PREPARE_LOOP \
- enum direction dir = ((struct utf8_data *) step->__data)->dir; \
- int emit_bom = ((struct utf8_data *) step->__data)->emit_bom; \
- \
- if (emit_bom && !data->__internal_use \
- && data->__invocation_counter == 0) \
- { \
- /* Emit the UTF-16 Byte Order Mark. */ \
- if (__glibc_unlikely (outbuf + 2 > outend)) \
- return __GCONV_FULL_OUTPUT; \
- \
- put16u (outbuf, BOM_UTF16); \
- outbuf += 2; \
- }
-
-/* Direction of the transformation. */
-enum direction
-{
- illegal_dir,
- to_utf8,
- from_utf8
-};
-
-struct utf8_data
-{
- enum direction dir;
- int emit_bom;
-};
-
-
-extern int gconv_init (struct __gconv_step *step);
-int
-gconv_init (struct __gconv_step *step)
-{
- /* Determine which direction. */
- struct utf8_data *new_data;
- enum direction dir = illegal_dir;
- int emit_bom;
- int result;
-
- emit_bom = (__strcasecmp (step->__to_name, "UTF-16//") == 0);
-
- if (__strcasecmp (step->__from_name, "ISO-10646/UTF8/") == 0
- && (__strcasecmp (step->__to_name, "UTF-16//") == 0
- || __strcasecmp (step->__to_name, "UTF-16BE//") == 0))
- {
- dir = from_utf8;
- }
- else if (__strcasecmp (step->__from_name, "UTF-16BE//") == 0
- && __strcasecmp (step->__to_name, "ISO-10646/UTF8/") == 0)
- {
- dir = to_utf8;
- }
-
- result = __GCONV_NOCONV;
- if (dir != illegal_dir)
- {
- new_data = (struct utf8_data *) malloc (sizeof (struct utf8_data));
-
- result = __GCONV_NOMEM;
- if (new_data != NULL)
- {
- new_data->dir = dir;
- new_data->emit_bom = emit_bom;
- step->__data = new_data;
-
- if (dir == from_utf8)
- {
- step->__min_needed_from = MIN_NEEDED_FROM;
- step->__max_needed_from = MIN_NEEDED_FROM;
- step->__min_needed_to = MIN_NEEDED_TO;
- step->__max_needed_to = MIN_NEEDED_TO;
- }
- else
- {
- step->__min_needed_from = MIN_NEEDED_TO;
- step->__max_needed_from = MIN_NEEDED_TO;
- step->__min_needed_to = MIN_NEEDED_FROM;
- step->__max_needed_to = MIN_NEEDED_FROM;
- }
-
- step->__stateful = 0;
-
- result = __GCONV_OK;
- }
- }
-
- return result;
-}
-
-
-extern void gconv_end (struct __gconv_step *data);
-void
-gconv_end (struct __gconv_step *data)
-{
- free (data->__data);
-}
-
-/* The macro for the hardware loop. This is used for both
- directions. */
-#define HARDWARE_CONVERT(INSTRUCTION) \
- { \
- register const unsigned char* pInput __asm__ ("8") = inptr; \
- register unsigned long long inlen __asm__ ("9") = inend - inptr; \
- register unsigned char* pOutput __asm__ ("10") = outptr; \
- register unsigned long long outlen __asm__("11") = outend - outptr; \
- uint64_t cc = 0; \
- \
- __asm__ volatile (".machine push \n\t" \
- ".machine \"z9-109\" \n\t" \
- "0: " INSTRUCTION " \n\t" \
- ".machine pop \n\t" \
- " jo 0b \n\t" \
- " ipm %2 \n" \
- : "+a" (pOutput), "+a" (pInput), "+d" (cc), \
- "+d" (outlen), "+d" (inlen) \
- : \
- : "cc", "memory"); \
- \
- inptr = pInput; \
- outptr = pOutput; \
- cc >>= 28; \
- \
- if (cc == 1) \
- { \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- else if (cc == 2) \
- { \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
- }
-
-/* Conversion function from UTF-8 to UTF-16. */
-
-#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
-#define MAX_NEEDED_INPUT MAX_NEEDED_FROM
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
-#define MAX_NEEDED_OUTPUT MAX_NEEDED_TO
-#define LOOPFCT FROM_LOOP
-/* The software implementation is based on the code in gconv_simple.c. */
-#define BODY \
- { \
- if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) \
- { \
- HARDWARE_CONVERT ("cu12 %0, %1, 1"); \
- \
- if (inptr != inend) \
- { \
- int i; \
- for (i = 1; inptr + i < inend; ++i) \
- if ((inptr[i] & 0xc0) != 0x80) \
- break; \
- \
- if (__glibc_likely (inptr + i == inend)) \
- { \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- STANDARD_FROM_LOOP_ERR_HANDLER (i); \
- } \
- continue; \
- } \
- \
- /* Next input byte. */ \
- uint16_t ch = *inptr; \
- \
- if (__glibc_likely (ch < 0x80)) \
- { \
- /* One byte sequence. */ \
- ++inptr; \
- } \
- else \
- { \
- uint_fast32_t cnt; \
- uint_fast32_t i; \
- \
- if (ch >= 0xc2 && ch < 0xe0) \
- { \
- /* We expect two bytes. The first byte cannot be 0xc0 \
- or 0xc1, otherwise the wide character could have been \
- represented using a single byte. */ \
- cnt = 2; \
- ch &= 0x1f; \
- } \
- else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \
- { \
- /* We expect three bytes. */ \
- cnt = 3; \
- ch &= 0x0f; \
- } \
- else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \
- { \
- /* We expect four bytes. */ \
- cnt = 4; \
- ch &= 0x07; \
- } \
- else \
- { \
- /* Search the end of this ill-formed UTF-8 character. This \
- is the next byte with (x & 0xc0) != 0x80. */ \
- i = 0; \
- do \
- ++i; \
- while (inptr + i < inend \
- && (*(inptr + i) & 0xc0) == 0x80 \
- && i < 5); \
- \
- errout: \
- STANDARD_FROM_LOOP_ERR_HANDLER (i); \
- } \
- \
- if (__glibc_unlikely (inptr + cnt > inend)) \
- { \
- /* We don't have enough input. But before we report \
- that check that all the bytes are correct. */ \
- for (i = 1; inptr + i < inend; ++i) \
- if ((inptr[i] & 0xc0) != 0x80) \
- break; \
- \
- if (__glibc_likely (inptr + i == inend)) \
- { \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- \
- goto errout; \
- } \
- \
- if (cnt == 4) \
- { \
- /* For 4 byte UTF-8 chars two UTF-16 chars (high and \
- low) are needed. */ \
- uint16_t zabcd, high, low; \
- \
- if (__glibc_unlikely (outptr + 4 > outend)) \
- { \
- /* Overflow in the output buffer. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- \
- /* See Principles of Operations cu12. */ \
- zabcd = (((inptr[0] & 0x7) << 2) | \
- ((inptr[1] & 0x30) >> 4)) - 1; \
- \
- /* z-bit must be zero after subtracting 1. */ \
- if (zabcd & 0x10) \
- STANDARD_FROM_LOOP_ERR_HANDLER (4) \
- \
- high = (uint16_t)(0xd8 << 8); /* high surrogate id */ \
- high |= zabcd << 6; /* abcd bits */ \
- high |= (inptr[1] & 0xf) << 2; /* efgh bits */ \
- high |= (inptr[2] & 0x30) >> 4; /* ij bits */ \
- \
- low = (uint16_t)(0xdc << 8); /* low surrogate id */ \
- low |= ((uint16_t)inptr[2] & 0xc) << 6; /* kl bits */ \
- low |= (inptr[2] & 0x3) << 6; /* mn bits */ \
- low |= inptr[3] & 0x3f; /* opqrst bits */ \
- \
- put16 (outptr, high); \
- outptr += 2; \
- put16 (outptr, low); \
- outptr += 2; \
- inptr += 4; \
- continue; \
- } \
- else \
- { \
- /* Read the possible remaining bytes. */ \
- for (i = 1; i < cnt; ++i) \
- { \
- uint16_t byte = inptr[i]; \
- \
- if ((byte & 0xc0) != 0x80) \
- /* This is an illegal encoding. */ \
- break; \
- \
- ch <<= 6; \
- ch |= byte & 0x3f; \
- } \
- inptr += cnt; \
- \
- } \
- } \
- /* Now adjust the pointers and store the result. */ \
- *((uint16_t *) outptr) = ch; \
- outptr += sizeof (uint16_t); \
- }
-
-#define LOOP_NEED_FLAGS
-#include <iconv/loop.c>
-
-/* Conversion from UTF-16 to UTF-8. */
-
-#define MIN_NEEDED_INPUT MIN_NEEDED_TO
-#define MAX_NEEDED_INPUT MAX_NEEDED_TO
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
-#define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
-#define LOOPFCT TO_LOOP
-/* The software routine is based on the functionality of the S/390
- hardware instruction (cu21) as described in the Principles of
- Operation. */
-#define BODY \
- { \
- /* The hardware instruction currently fails to report an error for \
- isolated low surrogates so we have to disable the instruction \
- until this gets resolved. */ \
- if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */ \
- { \
- HARDWARE_CONVERT ("cu21 %0, %1, 1"); \
- if (inptr != inend) \
- { \
- /* Check if the third byte is \
- a valid start of a UTF-16 surrogate. */ \
- if (inend - inptr == 3 && (inptr[3] & 0xfc) != 0xdc) \
- STANDARD_TO_LOOP_ERR_HANDLER (3); \
- \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- continue; \
- } \
- \
- uint16_t c = get16 (inptr); \
- \
- if (__glibc_likely (c <= 0x007f)) \
- { \
- /* Single byte UTF-8 char. */ \
- *outptr = c & 0xff; \
- outptr++; \
- } \
- else if (c >= 0x0080 && c <= 0x07ff) \
- { \
- /* Two byte UTF-8 char. */ \
- \
- if (__glibc_unlikely (outptr + 2 > outend)) \
- { \
- /* Overflow in the output buffer. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- \
- outptr[0] = 0xc0; \
- outptr[0] |= c >> 6; \
- \
- outptr[1] = 0x80; \
- outptr[1] |= c & 0x3f; \
- \
- outptr += 2; \
- } \
- else if ((c >= 0x0800 && c <= 0xd7ff) || c > 0xdfff) \
- { \
- /* Three byte UTF-8 char. */ \
- \
- if (__glibc_unlikely (outptr + 3 > outend)) \
- { \
- /* Overflow in the output buffer. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- outptr[0] = 0xe0; \
- outptr[0] |= c >> 12; \
- \
- outptr[1] = 0x80; \
- outptr[1] |= (c >> 6) & 0x3f; \
- \
- outptr[2] = 0x80; \
- outptr[2] |= c & 0x3f; \
- \
- outptr += 3; \
- } \
- else if (c >= 0xd800 && c <= 0xdbff) \
- { \
- /* Four byte UTF-8 char. */ \
- uint16_t low, uvwxy; \
- \
- if (__glibc_unlikely (outptr + 4 > outend)) \
- { \
- /* Overflow in the output buffer. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- inptr += 2; \
- if (__glibc_unlikely (inptr + 2 > inend)) \
- { \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- \
- low = get16 (inptr); \
- \
- if ((low & 0xfc00) != 0xdc00) \
- { \
- inptr -= 2; \
- STANDARD_TO_LOOP_ERR_HANDLER (2); \
- } \
- uvwxy = ((c >> 6) & 0xf) + 1; \
- outptr[0] = 0xf0; \
- outptr[0] |= uvwxy >> 2; \
- \
- outptr[1] = 0x80; \
- outptr[1] |= (uvwxy << 4) & 0x30; \
- outptr[1] |= (c >> 2) & 0x0f; \
- \
- outptr[2] = 0x80; \
- outptr[2] |= (c & 0x03) << 4; \
- outptr[2] |= (low >> 6) & 0x0f; \
- \
- outptr[3] = 0x80; \
- outptr[3] |= low & 0x3f; \
- \
- outptr += 4; \
- } \
- else \
- { \
- STANDARD_TO_LOOP_ERR_HANDLER (2); \
- } \
- inptr += 2; \
- }
-#define LOOP_NEED_FLAGS
-#include <iconv/loop.c>
-
-#include <iconv/skeleton.c>
diff --git a/sysdeps/s390/s390-64/utf8-utf32-z9.c b/sysdeps/s390/s390-64/utf8-utf32-z9.c
deleted file mode 100644
index defd47d251..0000000000
--- a/sysdeps/s390/s390-64/utf8-utf32-z9.c
+++ /dev/null
@@ -1,511 +0,0 @@
-/* Conversion between UTF-8 and UTF-32 BE/internal.
-
- This module uses the Z9-109 variants of the Convert Unicode
- instructions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
-
- Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
- Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- Thanks to Daniel Appich who covered the relevant performance work
- in his diploma thesis.
-
- This is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <stdint.h>
-#include <unistd.h>
-#include <dl-procinfo.h>
-#include <gconv.h>
-
-/* UTF-32 big endian byte order mark. */
-#define BOM 0x0000feffu
-
-#define DEFINE_INIT 0
-#define DEFINE_FINI 0
-/* These definitions apply to the UTF-8 to UTF-32 direction. The
- software implementation for UTF-8 still supports multibyte
- characters up to 6 bytes whereas the hardware variant does not. */
-#define MIN_NEEDED_FROM 1
-#define MAX_NEEDED_FROM 6
-#define MIN_NEEDED_TO 4
-#define FROM_LOOP from_utf8_loop
-#define TO_LOOP to_utf8_loop
-#define FROM_DIRECTION (dir == from_utf8)
-#define ONE_DIRECTION 0
-#define PREPARE_LOOP \
- enum direction dir = ((struct utf8_data *) step->__data)->dir; \
- int emit_bom = ((struct utf8_data *) step->__data)->emit_bom; \
- \
- if (emit_bom && !data->__internal_use \
- && data->__invocation_counter == 0) \
- { \
- /* Emit the Byte Order Mark. */ \
- if (__glibc_unlikely (outbuf + 4 > outend)) \
- return __GCONV_FULL_OUTPUT; \
- \
- put32u (outbuf, BOM); \
- outbuf += 4; \
- }
-
-/* Direction of the transformation. */
-enum direction
-{
- illegal_dir,
- to_utf8,
- from_utf8
-};
-
-struct utf8_data
-{
- enum direction dir;
- int emit_bom;
-};
-
-
-extern int gconv_init (struct __gconv_step *step);
-int
-gconv_init (struct __gconv_step *step)
-{
- /* Determine which direction. */
- struct utf8_data *new_data;
- enum direction dir = illegal_dir;
- int emit_bom;
- int result;
-
- emit_bom = (__strcasecmp (step->__to_name, "UTF-32//") == 0);
-
- if (__strcasecmp (step->__from_name, "ISO-10646/UTF8/") == 0
- && (__strcasecmp (step->__to_name, "UTF-32//") == 0
- || __strcasecmp (step->__to_name, "UTF-32BE//") == 0
- || __strcasecmp (step->__to_name, "INTERNAL") == 0))
- {
- dir = from_utf8;
- }
- else if (__strcasecmp (step->__to_name, "ISO-10646/UTF8/") == 0
- && (__strcasecmp (step->__from_name, "UTF-32BE//") == 0
- || __strcasecmp (step->__from_name, "INTERNAL") == 0))
- {
- dir = to_utf8;
- }
-
- result = __GCONV_NOCONV;
- if (dir != illegal_dir)
- {
- new_data = (struct utf8_data *) malloc (sizeof (struct utf8_data));
-
- result = __GCONV_NOMEM;
- if (new_data != NULL)
- {
- new_data->dir = dir;
- new_data->emit_bom = emit_bom;
- step->__data = new_data;
-
- if (dir == from_utf8)
- {
- step->__min_needed_from = MIN_NEEDED_FROM;
- step->__max_needed_from = MIN_NEEDED_FROM;
- step->__min_needed_to = MIN_NEEDED_TO;
- step->__max_needed_to = MIN_NEEDED_TO;
- }
- else
- {
- step->__min_needed_from = MIN_NEEDED_TO;
- step->__max_needed_from = MIN_NEEDED_TO;
- step->__min_needed_to = MIN_NEEDED_FROM;
- step->__max_needed_to = MIN_NEEDED_FROM;
- }
-
- step->__stateful = 0;
-
- result = __GCONV_OK;
- }
- }
-
- return result;
-}
-
-
-extern void gconv_end (struct __gconv_step *data);
-void
-gconv_end (struct __gconv_step *data)
-{
- free (data->__data);
-}
-
-/* The macro for the hardware loop. This is used for both
- directions. */
-#define HARDWARE_CONVERT(INSTRUCTION) \
- { \
- register const unsigned char* pInput __asm__ ("8") = inptr; \
- register unsigned long long inlen __asm__ ("9") = inend - inptr; \
- register unsigned char* pOutput __asm__ ("10") = outptr; \
- register unsigned long long outlen __asm__("11") = outend - outptr; \
- uint64_t cc = 0; \
- \
- __asm__ volatile (".machine push \n\t" \
- ".machine \"z9-109\" \n\t" \
- "0: " INSTRUCTION " \n\t" \
- ".machine pop \n\t" \
- " jo 0b \n\t" \
- " ipm %2 \n" \
- : "+a" (pOutput), "+a" (pInput), "+d" (cc), \
- "+d" (outlen), "+d" (inlen) \
- : \
- : "cc", "memory"); \
- \
- inptr = pInput; \
- outptr = pOutput; \
- cc >>= 28; \
- \
- if (cc == 1) \
- { \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- else if (cc == 2) \
- { \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
- }
-
-/* Conversion function from UTF-8 to UTF-32 internal/BE. */
-
-#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
-#define MAX_NEEDED_INPUT MAX_NEEDED_FROM
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
-#define LOOPFCT FROM_LOOP
-/* The software routine is copied from gconv_simple.c. */
-#define BODY \
- { \
- if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) \
- { \
- HARDWARE_CONVERT ("cu14 %0, %1, 1"); \
- \
- if (inptr != inend) \
- { \
- int i; \
- for (i = 1; inptr + i < inend; ++i) \
- if ((inptr[i] & 0xc0) != 0x80) \
- break; \
- \
- if (__glibc_likely (inptr + i == inend)) \
- { \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- STANDARD_FROM_LOOP_ERR_HANDLER (i); \
- } \
- continue; \
- } \
- \
- /* Next input byte. */ \
- uint32_t ch = *inptr; \
- \
- if (__glibc_likely (ch < 0x80)) \
- { \
- /* One byte sequence. */ \
- ++inptr; \
- } \
- else \
- { \
- uint_fast32_t cnt; \
- uint_fast32_t i; \
- \
- if (ch >= 0xc2 && ch < 0xe0) \
- { \
- /* We expect two bytes. The first byte cannot be 0xc0 or \
- 0xc1, otherwise the wide character could have been \
- represented using a single byte. */ \
- cnt = 2; \
- ch &= 0x1f; \
- } \
- else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \
- { \
- /* We expect three bytes. */ \
- cnt = 3; \
- ch &= 0x0f; \
- } \
- else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \
- { \
- /* We expect four bytes. */ \
- cnt = 4; \
- ch &= 0x07; \
- } \
- else if (__glibc_likely ((ch & 0xfc) == 0xf8)) \
- { \
- /* We expect five bytes. */ \
- cnt = 5; \
- ch &= 0x03; \
- } \
- else if (__glibc_likely ((ch & 0xfe) == 0xfc)) \
- { \
- /* We expect six bytes. */ \
- cnt = 6; \
- ch &= 0x01; \
- } \
- else \
- { \
- /* Search the end of this ill-formed UTF-8 character. This \
- is the next byte with (x & 0xc0) != 0x80. */ \
- i = 0; \
- do \
- ++i; \
- while (inptr + i < inend \
- && (*(inptr + i) & 0xc0) == 0x80 \
- && i < 5); \
- \
- errout: \
- STANDARD_FROM_LOOP_ERR_HANDLER (i); \
- } \
- \
- if (__glibc_unlikely (inptr + cnt > inend)) \
- { \
- /* We don't have enough input. But before we report \
- that check that all the bytes are correct. */ \
- for (i = 1; inptr + i < inend; ++i) \
- if ((inptr[i] & 0xc0) != 0x80) \
- break; \
- \
- if (__glibc_likely (inptr + i == inend)) \
- { \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- \
- goto errout; \
- } \
- \
- /* Read the possible remaining bytes. */ \
- for (i = 1; i < cnt; ++i) \
- { \
- uint32_t byte = inptr[i]; \
- \
- if ((byte & 0xc0) != 0x80) \
- /* This is an illegal encoding. */ \
- break; \
- \
- ch <<= 6; \
- ch |= byte & 0x3f; \
- } \
- \
- /* If i < cnt, some trail byte was not >= 0x80, < 0xc0. \
- If cnt > 2 and ch < 2^(5*cnt-4), the wide character ch could \
- have been represented with fewer than cnt bytes. */ \
- if (i < cnt || (cnt > 2 && (ch >> (5 * cnt - 4)) == 0)) \
- { \
- /* This is an illegal encoding. */ \
- goto errout; \
- } \
- \
- inptr += cnt; \
- } \
- \
- /* Now adjust the pointers and store the result. */ \
- *((uint32_t *) outptr) = ch; \
- outptr += sizeof (uint32_t); \
- }
-#define LOOP_NEED_FLAGS
-
-#define STORE_REST \
- { \
- /* We store the remaining bytes while converting them into the UCS4 \
- format. We can assume that the first byte in the buffer is \
- correct and that it requires a larger number of bytes than there \
- are in the input buffer. */ \
- wint_t ch = **inptrp; \
- size_t cnt, r; \
- \
- state->__count = inend - *inptrp; \
- \
- if (ch >= 0xc2 && ch < 0xe0) \
- { \
- /* We expect two bytes. The first byte cannot be 0xc0 or \
- 0xc1, otherwise the wide character could have been \
- represented using a single byte. */ \
- cnt = 2; \
- ch &= 0x1f; \
- } \
- else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \
- { \
- /* We expect three bytes. */ \
- cnt = 3; \
- ch &= 0x0f; \
- } \
- else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \
- { \
- /* We expect four bytes. */ \
- cnt = 4; \
- ch &= 0x07; \
- } \
- else if (__glibc_likely ((ch & 0xfc) == 0xf8)) \
- { \
- /* We expect five bytes. */ \
- cnt = 5; \
- ch &= 0x03; \
- } \
- else \
- { \
- /* We expect six bytes. */ \
- cnt = 6; \
- ch &= 0x01; \
- } \
- \
- /* The first byte is already consumed. */ \
- r = cnt - 1; \
- while (++(*inptrp) < inend) \
- { \
- ch <<= 6; \
- ch |= **inptrp & 0x3f; \
- --r; \
- } \
- \
- /* Shift for the so far missing bytes. */ \
- ch <<= r * 6; \
- \
- /* Store the number of bytes expected for the entire sequence. */ \
- state->__count |= cnt << 8; \
- \
- /* Store the value. */ \
- state->__value.__wch = ch; \
- }
-
-#define UNPACK_BYTES \
- { \
- static const unsigned char inmask[5] = { 0xc0, 0xe0, 0xf0, 0xf8, 0xfc }; \
- wint_t wch = state->__value.__wch; \
- size_t ntotal = state->__count >> 8; \
- \
- inlen = state->__count & 255; \
- \
- bytebuf[0] = inmask[ntotal - 2]; \
- \
- do \
- { \
- if (--ntotal < inlen) \
- bytebuf[ntotal] = 0x80 | (wch & 0x3f); \
- wch >>= 6; \
- } \
- while (ntotal > 1); \
- \
- bytebuf[0] |= wch; \
- }
-
-#define CLEAR_STATE \
- state->__count = 0
-
-#include <iconv/loop.c>
-
-/* Conversion from UTF-32 internal/BE to UTF-8. */
-
-#define MIN_NEEDED_INPUT MIN_NEEDED_TO
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
-#define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
-#define LOOPFCT TO_LOOP
-/* The software routine mimics the S/390 cu41 instruction. */
-#define BODY \
- { \
- if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) \
- { \
- HARDWARE_CONVERT ("cu41 %0, %1"); \
- \
- if (inptr != inend) \
- { \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- continue; \
- } \
- \
- uint32_t wc = *((const uint32_t *) inptr); \
- \
- if (__glibc_likely (wc <= 0x7f)) \
- { \
- /* Single UTF-8 char. */ \
- *outptr = (uint8_t)wc; \
- outptr++; \
- } \
- else if (wc <= 0x7ff) \
- { \
- /* Two UTF-8 chars. */ \
- if (__glibc_unlikely (outptr + 2 > outend)) \
- { \
- /* Overflow in the output buffer. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- \
- outptr[0] = 0xc0; \
- outptr[0] |= wc >> 6; \
- \
- outptr[1] = 0x80; \
- outptr[1] |= wc & 0x3f; \
- \
- outptr += 2; \
- } \
- else if (wc <= 0xffff) \
- { \
- /* Three UTF-8 chars. */ \
- if (__glibc_unlikely (outptr + 3 > outend)) \
- { \
- /* Overflow in the output buffer. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- outptr[0] = 0xe0; \
- outptr[0] |= wc >> 12; \
- \
- outptr[1] = 0x80; \
- outptr[1] |= (wc >> 6) & 0x3f; \
- \
- outptr[2] = 0x80; \
- outptr[2] |= wc & 0x3f; \
- \
- outptr += 3; \
- } \
- else if (wc <= 0x10ffff) \
- { \
- /* Four UTF-8 chars. */ \
- if (__glibc_unlikely (outptr + 4 > outend)) \
- { \
- /* Overflow in the output buffer. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- outptr[0] = 0xf0; \
- outptr[0] |= wc >> 18; \
- \
- outptr[1] = 0x80; \
- outptr[1] |= (wc >> 12) & 0x3f; \
- \
- outptr[2] = 0x80; \
- outptr[2] |= (wc >> 6) & 0x3f; \
- \
- outptr[3] = 0x80; \
- outptr[3] |= wc & 0x3f; \
- \
- outptr += 4; \
- } \
- else \
- { \
- STANDARD_TO_LOOP_ERR_HANDLER (4); \
- } \
- inptr += 4; \
- }
-#define LOOP_NEED_FLAGS
-#include <iconv/loop.c>
-
-#include <iconv/skeleton.c>
diff --git a/sysdeps/s390/sotruss-lib.c b/sysdeps/s390/sotruss-lib.c
index 8c53bc5b79..90b8f77e55 100644
--- a/sysdeps/s390/sotruss-lib.c
+++ b/sysdeps/s390/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for s390.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/stackinfo.h b/sysdeps/s390/stackinfo.h
index 0d4b70abd7..e429f361ae 100644
--- a/sysdeps/s390/stackinfo.h
+++ b/sysdeps/s390/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/string_private.h b/sysdeps/s390/string_private.h
index 9e11eee3dc..32e40d3603 100644
--- a/sysdeps/s390/string_private.h
+++ b/sysdeps/s390/string_private.h
@@ -1,5 +1,5 @@
/* Define _STRING_ARCH_unaligned. S/390 version.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/s390/utf16-utf32-z9.c b/sysdeps/s390/utf16-utf32-z9.c
new file mode 100644
index 0000000000..27086d3e8a
--- /dev/null
+++ b/sysdeps/s390/utf16-utf32-z9.c
@@ -0,0 +1,819 @@
+/* Conversion between UTF-16 and UTF-32 BE/internal.
+
+ This module uses the Z9-109 variants of the Convert Unicode
+ instructions.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+
+ Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+ Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ Thanks to Daniel Appich who covered the relevant performance work
+ in his diploma thesis.
+
+ This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <stdint.h>
+#include <unistd.h>
+#include <gconv.h>
+#include <string.h>
+
+/* Select which versions should be defined depending on support
+ for multiarch, vector and used minimum architecture level. */
+#define HAVE_FROM_C 1
+#define FROM_LOOP_DEFAULT FROM_LOOP_C
+#define HAVE_TO_C 1
+#define TO_LOOP_DEFAULT TO_LOOP_C
+
+#if defined HAVE_S390_VX_ASM_SUPPORT && defined USE_MULTIARCH
+# define HAVE_FROM_VX 1
+# define HAVE_FROM_VX_CU 1
+# define HAVE_TO_VX 1
+# define HAVE_TO_VX_CU 1
+#else
+# define HAVE_FROM_VX 0
+# define HAVE_FROM_VX_CU 0
+# define HAVE_TO_VX 0
+# define HAVE_TO_VX_CU 0
+#endif
+
+#if defined HAVE_S390_VX_GCC_SUPPORT
+# define ASM_CLOBBER_VR(NR) , NR
+#else
+# define ASM_CLOBBER_VR(NR)
+#endif
+
+#if defined __s390x__
+# define CONVERT_32BIT_SIZE_T(REG)
+#else
+# define CONVERT_32BIT_SIZE_T(REG) "llgfr %" #REG ",%" #REG "\n\t"
+#endif
+
+/* UTF-32 big endian byte order mark. */
+#define BOM_UTF32 0x0000feffu
+
+/* UTF-16 big endian byte order mark. */
+#define BOM_UTF16 0xfeff
+
+#define DEFINE_INIT 0
+#define DEFINE_FINI 0
+#define MIN_NEEDED_FROM 2
+#define MAX_NEEDED_FROM 4
+#define MIN_NEEDED_TO 4
+#define FROM_LOOP FROM_LOOP_DEFAULT
+#define TO_LOOP TO_LOOP_DEFAULT
+#define FROM_DIRECTION (dir == from_utf16)
+#define ONE_DIRECTION 0
+
+/* Direction of the transformation. */
+enum direction
+{
+ illegal_dir,
+ to_utf16,
+ from_utf16
+};
+
+struct utf16_data
+{
+ enum direction dir;
+ int emit_bom;
+};
+
+
+extern int gconv_init (struct __gconv_step *step);
+int
+gconv_init (struct __gconv_step *step)
+{
+ /* Determine which direction. */
+ struct utf16_data *new_data;
+ enum direction dir = illegal_dir;
+ int emit_bom;
+ int result;
+
+ emit_bom = (__strcasecmp (step->__to_name, "UTF-32//") == 0
+ || __strcasecmp (step->__to_name, "UTF-16//") == 0);
+
+ if (__strcasecmp (step->__from_name, "UTF-16BE//") == 0
+ && (__strcasecmp (step->__to_name, "UTF-32//") == 0
+ || __strcasecmp (step->__to_name, "UTF-32BE//") == 0
+ || __strcasecmp (step->__to_name, "INTERNAL") == 0))
+ {
+ dir = from_utf16;
+ }
+ else if ((__strcasecmp (step->__to_name, "UTF-16//") == 0
+ || __strcasecmp (step->__to_name, "UTF-16BE//") == 0)
+ && (__strcasecmp (step->__from_name, "UTF-32BE//") == 0
+ || __strcasecmp (step->__from_name, "INTERNAL") == 0))
+ {
+ dir = to_utf16;
+ }
+
+ result = __GCONV_NOCONV;
+ if (dir != illegal_dir)
+ {
+ new_data = (struct utf16_data *) malloc (sizeof (struct utf16_data));
+
+ result = __GCONV_NOMEM;
+ if (new_data != NULL)
+ {
+ new_data->dir = dir;
+ new_data->emit_bom = emit_bom;
+ step->__data = new_data;
+
+ if (dir == from_utf16)
+ {
+ step->__min_needed_from = MIN_NEEDED_FROM;
+ step->__max_needed_from = MIN_NEEDED_FROM;
+ step->__min_needed_to = MIN_NEEDED_TO;
+ step->__max_needed_to = MIN_NEEDED_TO;
+ }
+ else
+ {
+ step->__min_needed_from = MIN_NEEDED_TO;
+ step->__max_needed_from = MIN_NEEDED_TO;
+ step->__min_needed_to = MIN_NEEDED_FROM;
+ step->__max_needed_to = MIN_NEEDED_FROM;
+ }
+
+ step->__stateful = 0;
+
+ result = __GCONV_OK;
+ }
+ }
+
+ return result;
+}
+
+
+extern void gconv_end (struct __gconv_step *data);
+void
+gconv_end (struct __gconv_step *data)
+{
+ free (data->__data);
+}
+
+#define PREPARE_LOOP \
+ enum direction dir = ((struct utf16_data *) step->__data)->dir; \
+ int emit_bom = ((struct utf16_data *) step->__data)->emit_bom; \
+ \
+ if (emit_bom && !data->__internal_use \
+ && data->__invocation_counter == 0) \
+ { \
+ if (dir == to_utf16) \
+ { \
+ /* Emit the UTF-16 Byte Order Mark. */ \
+ if (__glibc_unlikely (outbuf + 2 > outend)) \
+ return __GCONV_FULL_OUTPUT; \
+ \
+ put16u (outbuf, BOM_UTF16); \
+ outbuf += 2; \
+ } \
+ else \
+ { \
+ /* Emit the UTF-32 Byte Order Mark. */ \
+ if (__glibc_unlikely (outbuf + 4 > outend)) \
+ return __GCONV_FULL_OUTPUT; \
+ \
+ put32u (outbuf, BOM_UTF32); \
+ outbuf += 4; \
+ } \
+ }
+
+/* Conversion function from UTF-16 to UTF-32 internal/BE. */
+
+#if HAVE_FROM_C == 1
+/* The software routine is copied from utf-16.c (minus bytes
+ swapping). */
+# define BODY_FROM_C \
+ { \
+ uint16_t u1 = get16 (inptr); \
+ \
+ if (__builtin_expect (u1 < 0xd800, 1) || u1 > 0xdfff) \
+ { \
+ /* No surrogate. */ \
+ put32 (outptr, u1); \
+ inptr += 2; \
+ } \
+ else \
+ { \
+ /* An isolated low-surrogate was found. This has to be \
+ considered ill-formed. */ \
+ if (__glibc_unlikely (u1 >= 0xdc00)) \
+ { \
+ STANDARD_FROM_LOOP_ERR_HANDLER (2); \
+ } \
+ /* It's a surrogate character. At least the first word says \
+ it is. */ \
+ if (__glibc_unlikely (inptr + 4 > inend)) \
+ { \
+ /* We don't have enough input for another complete input \
+ character. */ \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ \
+ inptr += 2; \
+ uint16_t u2 = get16 (inptr); \
+ if (__builtin_expect (u2 < 0xdc00, 0) \
+ || __builtin_expect (u2 > 0xdfff, 0)) \
+ { \
+ /* This is no valid second word for a surrogate. */ \
+ inptr -= 2; \
+ STANDARD_FROM_LOOP_ERR_HANDLER (2); \
+ } \
+ \
+ put32 (outptr, ((u1 - 0xd7c0) << 10) + (u2 - 0xdc00)); \
+ inptr += 2; \
+ } \
+ outptr += 4; \
+ }
+
+
+/* Generate loop-function with software routing. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define FROM_LOOP_C __from_utf16_loop_c
+# define LOOPFCT FROM_LOOP_C
+# define LOOP_NEED_FLAGS
+# define BODY BODY_FROM_C
+# include <iconv/loop.c>
+#else
+# define FROM_LOOP_C NULL
+#endif /* HAVE_FROM_C != 1 */
+
+#if HAVE_FROM_VX == 1
+# define BODY_FROM_VX \
+ { \
+ size_t inlen = inend - inptr; \
+ size_t outlen = outend - outptr; \
+ unsigned long tmp, tmp2, tmp3; \
+ asm volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ /* Setup to check for surrogates. */ \
+ " larl %[R_TMP],9f\n\t" \
+ " vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_INLEN]) \
+ CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
+ /* Loop which handles UTF-16 chars <0xd800, >0xdfff. */ \
+ "0: clgijl %[R_INLEN],16,2f\n\t" \
+ " clgijl %[R_OUTLEN],32,2f\n\t" \
+ "1: vl %%v16,0(%[R_IN])\n\t" \
+ /* Check for surrogate chars. */ \
+ " vstrchs %%v19,%%v16,%%v30,%%v31\n\t" \
+ " jno 10f\n\t" \
+ /* Enlarge to UTF-32. */ \
+ " vuplhh %%v17,%%v16\n\t" \
+ " la %[R_IN],16(%[R_IN])\n\t" \
+ " vupllh %%v18,%%v16\n\t" \
+ " aghi %[R_INLEN],-16\n\t" \
+ /* Store 32 bytes to buf_out. */ \
+ " vstm %%v17,%%v18,0(%[R_OUT])\n\t" \
+ " aghi %[R_OUTLEN],-32\n\t" \
+ " la %[R_OUT],32(%[R_OUT])\n\t" \
+ " clgijl %[R_INLEN],16,2f\n\t" \
+ " clgijl %[R_OUTLEN],32,2f\n\t" \
+ " j 1b\n\t" \
+ /* Setup to check for ch >= 0xd800 && ch <= 0xdfff. (v30, v31) */ \
+ "9: .short 0xd800,0xdfff,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ " .short 0xa000,0xc000,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ /* At least one uint16_t is in range of surrogates. \
+ Store the preceding chars. */ \
+ "10: vlgvb %[R_TMP],%%v19,7\n\t" \
+ " vuplhh %%v17,%%v16\n\t" \
+ " sllg %[R_TMP3],%[R_TMP],1\n\t" /* Number of out bytes. */ \
+ " ahik %[R_TMP2],%[R_TMP3],-1\n\t" /* Highest index to store. */ \
+ " jl 12f\n\t" \
+ " vstl %%v17,%[R_TMP2],0(%[R_OUT])\n\t" \
+ " vupllh %%v18,%%v16\n\t" \
+ " ahi %[R_TMP2],-16\n\t" \
+ " jl 11f\n\t" \
+ " vstl %%v18,%[R_TMP2],16(%[R_OUT])\n\t" \
+ "11: \n\t" /* Update pointers. */ \
+ " la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " slgr %[R_INLEN],%[R_TMP]\n\t" \
+ " la %[R_OUT],0(%[R_TMP3],%[R_OUT])\n\t" \
+ " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \
+ /* Calculate remaining uint16_t values in loaded vrs. */ \
+ "12: lghi %[R_TMP2],16\n\t" \
+ " slgr %[R_TMP2],%[R_TMP]\n\t" \
+ " srl %[R_TMP2],1\n\t" \
+ " llh %[R_TMP],0(%[R_IN])\n\t" \
+ " aghi %[R_OUTLEN],-4\n\t" \
+ " j 16f\n\t" \
+ /* Handle remaining bytes. */ \
+ "2: \n\t" \
+ /* Zero, one or more bytes available? */ \
+ " clgfi %[R_INLEN],1\n\t" \
+ " je 97f\n\t" /* Only one byte available. */ \
+ " jl 99f\n\t" /* End if no bytes available. */ \
+ /* Calculate remaining uint16_t values in inptr. */ \
+ " srlg %[R_TMP2],%[R_INLEN],1\n\t" \
+ /* Handle remaining uint16_t values. */ \
+ "13: llh %[R_TMP],0(%[R_IN])\n\t" \
+ " slgfi %[R_OUTLEN],4\n\t" \
+ " jl 96f \n\t" \
+ " clfi %[R_TMP],0xd800\n\t" \
+ " jhe 15f\n\t" \
+ "14: st %[R_TMP],0(%[R_OUT])\n\t" \
+ " la %[R_IN],2(%[R_IN])\n\t" \
+ " aghi %[R_INLEN],-2\n\t" \
+ " la %[R_OUT],4(%[R_OUT])\n\t" \
+ " brctg %[R_TMP2],13b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ /* Handle UTF-16 surrogate pair. */ \
+ "15: clfi %[R_TMP],0xdfff\n\t" \
+ " jh 14b\n\t" /* Jump away if ch > 0xdfff. */ \
+ "16: clfi %[R_TMP],0xdc00\n\t" \
+ " jhe 98f\n\t" /* Jump away in case of low-surrogate. */ \
+ " slgfi %[R_INLEN],4\n\t" \
+ " jl 97f\n\t" /* Big enough input? */ \
+ " llh %[R_TMP3],2(%[R_IN])\n\t" /* Load low surrogate. */ \
+ " slfi %[R_TMP],0xd7c0\n\t" \
+ " sll %[R_TMP],10\n\t" \
+ " risbgn %[R_TMP],%[R_TMP3],54,63,0\n\t" /* Insert klmnopqrst. */ \
+ " nilf %[R_TMP3],0xfc00\n\t" \
+ " clfi %[R_TMP3],0xdc00\n\t" /* Check if it starts with 0xdc00. */ \
+ " jne 98f\n\t" \
+ " st %[R_TMP],0(%[R_OUT])\n\t" \
+ " la %[R_IN],4(%[R_IN])\n\t" \
+ " la %[R_OUT],4(%[R_OUT])\n\t" \
+ " aghi %[R_TMP2],-2\n\t" \
+ " jh 13b\n\t" /* Handle remaining uint16_t values. */ \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ "96: \n\t" /* Return full output. */ \
+ " lghi %[R_RES],%[RES_OUT_FULL]\n\t" \
+ " j 99f\n\t" \
+ "97: \n\t" /* Return incomplete input. */ \
+ " lghi %[R_RES],%[RES_IN_FULL]\n\t" \
+ " j 99f\n\t" \
+ "98:\n\t" /* Return Illegal character. */ \
+ " lghi %[R_RES],%[RES_IN_ILL]\n\t" \
+ "99:\n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (inptr) \
+ , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (outptr) \
+ , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=d" (tmp2), [R_TMP3] "=a" (tmp3) \
+ , [R_RES] "+d" (result) \
+ : /* inputs */ \
+ [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \
+ , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \
+ , [RES_IN_FULL] "i" (__GCONV_INCOMPLETE_INPUT) \
+ : /* clobber list */ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v30") ASM_CLOBBER_VR ("v31") \
+ ); \
+ if (__glibc_likely (inptr == inend) \
+ || result != __GCONV_ILLEGAL_INPUT) \
+ break; \
+ \
+ STANDARD_FROM_LOOP_ERR_HANDLER (2); \
+ }
+
+/* Generate loop-function with hardware vector instructions. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define FROM_LOOP_VX __from_utf16_loop_vx
+# define LOOPFCT FROM_LOOP_VX
+# define LOOP_NEED_FLAGS
+# define BODY BODY_FROM_VX
+# include <iconv/loop.c>
+#else
+# define FROM_LOOP_VX NULL
+#endif /* HAVE_FROM_VX != 1 */
+
+#if HAVE_FROM_VX_CU == 1
+#define BODY_FROM_VX_CU \
+ { \
+ register const unsigned char* pInput asm ("8") = inptr; \
+ register size_t inlen asm ("9") = inend - inptr; \
+ register unsigned char* pOutput asm ("10") = outptr; \
+ register size_t outlen asm ("11") = outend - outptr; \
+ unsigned long tmp, tmp2, tmp3; \
+ asm volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ /* Setup to check for surrogates. */ \
+ " larl %[R_TMP],9f\n\t" \
+ " vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_INLEN]) \
+ CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
+ /* Loop which handles UTF-16 chars <0xd800, >0xdfff. */ \
+ "0: clgijl %[R_INLEN],16,20f\n\t" \
+ " clgijl %[R_OUTLEN],32,20f\n\t" \
+ "1: vl %%v16,0(%[R_IN])\n\t" \
+ /* Check for surrogate chars. */ \
+ " vstrchs %%v19,%%v16,%%v30,%%v31\n\t" \
+ " jno 10f\n\t" \
+ /* Enlarge to UTF-32. */ \
+ " vuplhh %%v17,%%v16\n\t" \
+ " la %[R_IN],16(%[R_IN])\n\t" \
+ " vupllh %%v18,%%v16\n\t" \
+ " aghi %[R_INLEN],-16\n\t" \
+ /* Store 32 bytes to buf_out. */ \
+ " vstm %%v17,%%v18,0(%[R_OUT])\n\t" \
+ " aghi %[R_OUTLEN],-32\n\t" \
+ " la %[R_OUT],32(%[R_OUT])\n\t" \
+ " clgijl %[R_INLEN],16,20f\n\t" \
+ " clgijl %[R_OUTLEN],32,20f\n\t" \
+ " j 1b\n\t" \
+ /* Setup to check for ch >= 0xd800 && ch <= 0xdfff. (v30, v31) */ \
+ "9: .short 0xd800,0xdfff,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ " .short 0xa000,0xc000,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ /* At least one uint16_t is in range of surrogates. \
+ Store the preceding chars. */ \
+ "10: vlgvb %[R_TMP],%%v19,7\n\t" \
+ " vuplhh %%v17,%%v16\n\t" \
+ " sllg %[R_TMP3],%[R_TMP],1\n\t" /* Number of out bytes. */ \
+ " ahik %[R_TMP2],%[R_TMP3],-1\n\t" /* Highest index to store. */ \
+ " jl 20f\n\t" \
+ " vstl %%v17,%[R_TMP2],0(%[R_OUT])\n\t" \
+ " vupllh %%v18,%%v16\n\t" \
+ " ahi %[R_TMP2],-16\n\t" \
+ " jl 11f\n\t" \
+ " vstl %%v18,%[R_TMP2],16(%[R_OUT])\n\t" \
+ "11: \n\t" /* Update pointers. */ \
+ " la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " slgr %[R_INLEN],%[R_TMP]\n\t" \
+ " la %[R_OUT],0(%[R_TMP3],%[R_OUT])\n\t" \
+ " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \
+ /* Handles UTF16 surrogates with convert instruction. */ \
+ "20: cu24 %[R_OUT],%[R_IN],1\n\t" \
+ " jo 0b\n\t" /* Try vector implemenation again. */ \
+ " lochil %[R_RES],%[RES_OUT_FULL]\n\t" /* cc == 1. */ \
+ " lochih %[R_RES],%[RES_IN_ILL]\n\t" /* cc == 2. */ \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (pInput) \
+ , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (pOutput) \
+ , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=d" (tmp2), [R_TMP3] "=a" (tmp3) \
+ , [R_RES] "+d" (result) \
+ : /* inputs */ \
+ [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \
+ , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \
+ : /* clobber list */ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v30") ASM_CLOBBER_VR ("v31") \
+ ); \
+ inptr = pInput; \
+ outptr = pOutput; \
+ \
+ if (__glibc_likely (inlen == 0) \
+ || result == __GCONV_FULL_OUTPUT) \
+ break; \
+ if (inlen == 1) \
+ { \
+ /* Input does not contain a complete utf16 character. */ \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ else if (result != __GCONV_ILLEGAL_INPUT) \
+ { \
+ /* Input is >= 2 and < 4 bytes (as cu24 would have processed \
+ a possible next utf16 character) and not illegal. \
+ => we have a single high surrogate at end of input. */ \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ \
+ STANDARD_FROM_LOOP_ERR_HANDLER (2); \
+ }
+
+/* Generate loop-function with hardware vector and utf-convert instructions. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define FROM_LOOP_VX_CU __from_utf16_loop_vx_cu
+# define LOOPFCT FROM_LOOP_VX_CU
+# define LOOP_NEED_FLAGS
+# define BODY BODY_FROM_VX_CU
+# include <iconv/loop.c>
+#else
+# define FROM_LOOP_VX_CU NULL
+#endif /* HAVE_FROM_VX_CU != 1 */
+
+/* Conversion from UTF-32 internal/BE to UTF-16. */
+
+#if HAVE_TO_C == 1
+/* The software routine is copied from utf-16.c (minus bytes
+ swapping). */
+# define BODY_TO_C \
+ { \
+ uint32_t c = get32 (inptr); \
+ \
+ if (__builtin_expect (c <= 0xd7ff, 1) \
+ || (c > 0xdfff && c <= 0xffff)) \
+ { \
+ /* Two UTF-16 chars. */ \
+ put16 (outptr, c); \
+ } \
+ else if (__builtin_expect (c >= 0x10000, 1) \
+ && __builtin_expect (c <= 0x10ffff, 1)) \
+ { \
+ /* Four UTF-16 chars. */ \
+ uint16_t zabcd = ((c & 0x1f0000) >> 16) - 1; \
+ uint16_t out; \
+ \
+ /* Generate a surrogate character. */ \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
+ { \
+ /* Overflow in the output buffer. */ \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ \
+ out = 0xd800; \
+ out |= (zabcd & 0xff) << 6; \
+ out |= (c >> 10) & 0x3f; \
+ put16 (outptr, out); \
+ outptr += 2; \
+ \
+ out = 0xdc00; \
+ out |= c & 0x3ff; \
+ put16 (outptr, out); \
+ } \
+ else \
+ { \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ } \
+ outptr += 2; \
+ inptr += 4; \
+ }
+
+/* Generate loop-function with software routing. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
+# define TO_LOOP_C __to_utf16_loop_c
+# define LOOPFCT TO_LOOP_C
+# define LOOP_NEED_FLAGS
+# define BODY BODY_TO_C
+# include <iconv/loop.c>
+#else
+# define TO_LOOP_C NULL
+#endif /* HAVE_TO_C != 1 */
+
+#if HAVE_TO_VX == 1
+# define BODY_TO_VX \
+ { \
+ size_t inlen = inend - inptr; \
+ size_t outlen = outend - outptr; \
+ unsigned long tmp, tmp2, tmp3; \
+ asm volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ /* Setup to check for surrogates. */ \
+ " larl %[R_TMP],9f\n\t" \
+ " vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_INLEN]) \
+ CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
+ /* Loop which handles UTF-32 chars \
+ ch < 0xd800 || (ch > 0xdfff && ch < 0x10000). */ \
+ "0: clgijl %[R_INLEN],32,2f\n\t" \
+ " clgijl %[R_OUTLEN],16,2f\n\t" \
+ "1: vlm %%v16,%%v17,0(%[R_IN])\n\t" \
+ " lghi %[R_TMP2],0\n\t" \
+ /* Shorten to UTF-16. */ \
+ " vpkf %%v18,%%v16,%%v17\n\t" \
+ /* Check for surrogate chars. */ \
+ " vstrcfs %%v19,%%v16,%%v30,%%v31\n\t" \
+ " jno 10f\n\t" \
+ " vstrcfs %%v19,%%v17,%%v30,%%v31\n\t" \
+ " jno 11f\n\t" \
+ /* Store 16 bytes to buf_out. */ \
+ " vst %%v18,0(%[R_OUT])\n\t" \
+ " la %[R_IN],32(%[R_IN])\n\t" \
+ " aghi %[R_INLEN],-32\n\t" \
+ " aghi %[R_OUTLEN],-16\n\t" \
+ " la %[R_OUT],16(%[R_OUT])\n\t" \
+ " clgijl %[R_INLEN],32,2f\n\t" \
+ " clgijl %[R_OUTLEN],16,2f\n\t" \
+ " j 1b\n\t" \
+ /* Calculate remaining uint32_t values in inptr. */ \
+ "2: \n\t" \
+ " clgije %[R_INLEN],0,99f\n\t" \
+ " clgijl %[R_INLEN],4,92f\n\t" \
+ " srlg %[R_TMP2],%[R_INLEN],2\n\t" \
+ " j 20f\n\t" \
+ /* Setup to check for ch >= 0xd800 && ch <= 0xdfff \
+ and check for ch >= 0x10000. (v30, v31) */ \
+ "9: .long 0xd800,0xdfff,0x10000,0x10000\n\t" \
+ " .long 0xa0000000,0xc0000000, 0xa0000000,0xa0000000\n\t" \
+ /* At least on UTF32 char is in range of surrogates. \
+ Store the preceding characters. */ \
+ "11: ahi %[R_TMP2],16\n\t" \
+ "10: vlgvb %[R_TMP],%%v19,7\n\t" \
+ " agr %[R_TMP],%[R_TMP2]\n\t" \
+ " srlg %[R_TMP3],%[R_TMP],1\n\t" /* Number of out bytes. */ \
+ " ahik %[R_TMP2],%[R_TMP3],-1\n\t" /* Highest index to store. */ \
+ " jl 12f\n\t" \
+ " vstl %%v18,%[R_TMP2],0(%[R_OUT])\n\t" \
+ /* Update pointers. */ \
+ " la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " slgr %[R_INLEN],%[R_TMP]\n\t" \
+ " la %[R_OUT],0(%[R_TMP3],%[R_OUT])\n\t" \
+ " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \
+ /* Calculate remaining uint32_t values in vrs. */ \
+ "12: lghi %[R_TMP2],8\n\t" \
+ " srlg %[R_TMP3],%[R_TMP3],1\n\t" \
+ " slgr %[R_TMP2],%[R_TMP3]\n\t" \
+ /* Handle remaining UTF-32 characters. */ \
+ "20: l %[R_TMP],0(%[R_IN])\n\t" \
+ " aghi %[R_INLEN],-4\n\t" \
+ /* Test if ch is 2byte UTF-16 char. */ \
+ " clfi %[R_TMP],0xffff\n\t" \
+ " jh 21f\n\t" \
+ /* Handle 2 byte UTF16 char. */ \
+ " lgr %[R_TMP3],%[R_TMP]\n\t" \
+ " nilf %[R_TMP],0xf800\n\t" \
+ " clfi %[R_TMP],0xd800\n\t" \
+ " je 91f\n\t" /* Do not accept UTF-16 surrogates. */ \
+ " slgfi %[R_OUTLEN],2\n\t" \
+ " jl 90f \n\t" \
+ " sth %[R_TMP3],0(%[R_OUT])\n\t" \
+ " la %[R_IN],4(%[R_IN])\n\t" \
+ " la %[R_OUT],2(%[R_OUT])\n\t" \
+ " brctg %[R_TMP2],20b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ /* Test if ch is 4byte UTF-16 char. */ \
+ "21: clfi %[R_TMP],0x10ffff\n\t" \
+ " jh 91f\n\t" /* ch > 0x10ffff is not allowed! */ \
+ /* Handle 4 byte UTF16 char. */ \
+ " slgfi %[R_OUTLEN],4\n\t" \
+ " jl 90f \n\t" \
+ " slfi %[R_TMP],0x10000\n\t" /* zabcd = uvwxy - 1. */ \
+ " llilf %[R_TMP3],0xd800dc00\n\t" \
+ " la %[R_IN],4(%[R_IN])\n\t" \
+ " risbgn %[R_TMP3],%[R_TMP],38,47,6\n\t" /* High surrogate. */ \
+ " risbgn %[R_TMP3],%[R_TMP],54,63,0\n\t" /* Low surrogate. */ \
+ " st %[R_TMP3],0(%[R_OUT])\n\t" \
+ " la %[R_OUT],4(%[R_OUT])\n\t" \
+ " brctg %[R_TMP2],20b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ "92: lghi %[R_RES],%[RES_IN_FULL]\n\t" \
+ " j 99f\n\t" \
+ "91: lghi %[R_RES],%[RES_IN_ILL]\n\t" \
+ " j 99f\n\t" \
+ "90: lghi %[R_RES],%[RES_OUT_FULL]\n\t" \
+ "99: \n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (inptr) \
+ , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (outptr) \
+ , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=d" (tmp2), [R_TMP3] "=a" (tmp3) \
+ , [R_RES] "+d" (result) \
+ : /* inputs */ \
+ [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \
+ , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \
+ , [RES_IN_FULL] "i" (__GCONV_INCOMPLETE_INPUT) \
+ : /* clobber list */ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v30") ASM_CLOBBER_VR ("v31") \
+ ); \
+ if (__glibc_likely (inptr == inend) \
+ || result != __GCONV_ILLEGAL_INPUT) \
+ break; \
+ \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ }
+
+/* Generate loop-function with hardware vector instructions. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
+# define TO_LOOP_VX __to_utf16_loop_vx
+# define LOOPFCT TO_LOOP_VX
+# define LOOP_NEED_FLAGS
+# define BODY BODY_TO_VX
+# include <iconv/loop.c>
+#else
+# define TO_LOOP_VX NULL
+#endif /* HAVE_TO_VX != 1 */
+
+#if HAVE_TO_VX_CU == 1
+#define BODY_TO_VX_CU \
+ { \
+ register const unsigned char* pInput asm ("8") = inptr; \
+ register size_t inlen asm ("9") = inend - inptr; \
+ register unsigned char* pOutput asm ("10") = outptr; \
+ register size_t outlen asm ("11") = outend - outptr; \
+ unsigned long tmp, tmp2, tmp3; \
+ asm volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ /* Setup to check for surrogates. */ \
+ " larl %[R_TMP],9f\n\t" \
+ " vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_INLEN]) \
+ CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
+ /* Loop which handles UTF-32 chars \
+ ch < 0xd800 || (ch > 0xdfff && ch < 0x10000). */ \
+ "0: clgijl %[R_INLEN],32,20f\n\t" \
+ " clgijl %[R_OUTLEN],16,20f\n\t" \
+ "1: vlm %%v16,%%v17,0(%[R_IN])\n\t" \
+ " lghi %[R_TMP2],0\n\t" \
+ /* Shorten to UTF-16. */ \
+ " vpkf %%v18,%%v16,%%v17\n\t" \
+ /* Check for surrogate chars. */ \
+ " vstrcfs %%v19,%%v16,%%v30,%%v31\n\t" \
+ " jno 10f\n\t" \
+ " vstrcfs %%v19,%%v17,%%v30,%%v31\n\t" \
+ " jno 11f\n\t" \
+ /* Store 16 bytes to buf_out. */ \
+ " vst %%v18,0(%[R_OUT])\n\t" \
+ " la %[R_IN],32(%[R_IN])\n\t" \
+ " aghi %[R_INLEN],-32\n\t" \
+ " aghi %[R_OUTLEN],-16\n\t" \
+ " la %[R_OUT],16(%[R_OUT])\n\t" \
+ " clgijl %[R_INLEN],32,20f\n\t" \
+ " clgijl %[R_OUTLEN],16,20f\n\t" \
+ " j 1b\n\t" \
+ /* Setup to check for ch >= 0xd800 && ch <= 0xdfff \
+ and check for ch >= 0x10000. (v30, v31) */ \
+ "9: .long 0xd800,0xdfff,0x10000,0x10000\n\t" \
+ " .long 0xa0000000,0xc0000000, 0xa0000000,0xa0000000\n\t" \
+ /* At least one UTF32 char is in range of surrogates. \
+ Store the preceding characters. */ \
+ "11: ahi %[R_TMP2],16\n\t" \
+ "10: vlgvb %[R_TMP],%%v19,7\n\t" \
+ " agr %[R_TMP],%[R_TMP2]\n\t" \
+ " srlg %[R_TMP3],%[R_TMP],1\n\t" /* Number of out bytes. */ \
+ " ahik %[R_TMP2],%[R_TMP3],-1\n\t" /* Highest index to store. */ \
+ " jl 20f\n\t" \
+ " vstl %%v18,%[R_TMP2],0(%[R_OUT])\n\t" \
+ /* Update pointers. */ \
+ " la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " slgr %[R_INLEN],%[R_TMP]\n\t" \
+ " la %[R_OUT],0(%[R_TMP3],%[R_OUT])\n\t" \
+ " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \
+ /* Handles UTF16 surrogates with convert instruction. */ \
+ "20: cu42 %[R_OUT],%[R_IN]\n\t" \
+ " jo 0b\n\t" /* Try vector implemenation again. */ \
+ " lochil %[R_RES],%[RES_OUT_FULL]\n\t" /* cc == 1. */ \
+ " lochih %[R_RES],%[RES_IN_ILL]\n\t" /* cc == 2. */ \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (pInput) \
+ , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (pOutput) \
+ , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=d" (tmp2), [R_TMP3] "=a" (tmp3) \
+ , [R_RES] "+d" (result) \
+ : /* inputs */ \
+ [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \
+ , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \
+ : /* clobber list */ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v30") ASM_CLOBBER_VR ("v31") \
+ ); \
+ inptr = pInput; \
+ outptr = pOutput; \
+ \
+ if (__glibc_likely (inlen == 0) \
+ || result == __GCONV_FULL_OUTPUT) \
+ break; \
+ if (inlen < 4) \
+ { \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ }
+
+/* Generate loop-function with hardware vector and utf-convert instructions. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
+# define TO_LOOP_VX_CU __to_utf16_loop_vx_cu
+# define LOOPFCT TO_LOOP_VX_CU
+# define LOOP_NEED_FLAGS
+# define BODY BODY_TO_VX_CU
+# include <iconv/loop.c>
+#else
+# define TO_LOOP_VX_CU NULL
+#endif /* HAVE_TO_VX_CU != 1 */
+
+/* This file also exists in sysdeps/s390/multiarch/ which
+ generates ifunc resolvers for FROM/TO_LOOP functions
+ and includes iconv/skeleton.c afterwards. */
+#if ! defined USE_MULTIARCH
+# include <iconv/skeleton.c>
+#endif
diff --git a/sysdeps/s390/utf8-utf16-z9.c b/sysdeps/s390/utf8-utf16-z9.c
new file mode 100644
index 0000000000..409d64c578
--- /dev/null
+++ b/sysdeps/s390/utf8-utf16-z9.c
@@ -0,0 +1,942 @@
+/* Conversion between UTF-8 and UTF-16 - s390 version.
+
+ This module uses the Z9-109 variants of the Convert Unicode
+ instructions.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+
+ Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+ Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ Thanks to Daniel Appich who covered the relevant performance work
+ in his diploma thesis.
+
+ This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <stdint.h>
+#include <unistd.h>
+#include <gconv.h>
+#include <string.h>
+
+/* Select which versions should be defined depending on support
+ for multiarch, vector and used minimum architecture level. */
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
+# define HAVE_FROM_C 0
+# define FROM_LOOP_DEFAULT FROM_LOOP_CU
+#else
+# define HAVE_FROM_C 1
+# define FROM_LOOP_DEFAULT FROM_LOOP_C
+#endif
+
+#define HAVE_TO_C 1
+#define TO_LOOP_DEFAULT TO_LOOP_C
+
+#if defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT || defined USE_MULTIARCH
+# define HAVE_FROM_CU 1
+#else
+# define HAVE_FROM_CU 0
+#endif
+
+#if defined HAVE_S390_VX_ASM_SUPPORT && defined USE_MULTIARCH
+# define HAVE_FROM_VX 1
+# define HAVE_TO_VX 1
+# define HAVE_TO_VX_CU 1
+#else
+# define HAVE_FROM_VX 0
+# define HAVE_TO_VX 0
+# define HAVE_TO_VX_CU 0
+#endif
+
+#if defined HAVE_S390_VX_GCC_SUPPORT
+# define ASM_CLOBBER_VR(NR) , NR
+#else
+# define ASM_CLOBBER_VR(NR)
+#endif
+
+#if defined __s390x__
+# define CONVERT_32BIT_SIZE_T(REG)
+#else
+# define CONVERT_32BIT_SIZE_T(REG) "llgfr %" #REG ",%" #REG "\n\t"
+#endif
+
+/* Defines for skeleton.c. */
+#define DEFINE_INIT 0
+#define DEFINE_FINI 0
+#define MIN_NEEDED_FROM 1
+#define MAX_NEEDED_FROM 4
+#define MIN_NEEDED_TO 2
+#define MAX_NEEDED_TO 4
+#define FROM_LOOP FROM_LOOP_DEFAULT
+#define TO_LOOP TO_LOOP_DEFAULT
+#define FROM_DIRECTION (dir == from_utf8)
+#define ONE_DIRECTION 0
+
+
+/* UTF-16 big endian byte order mark. */
+#define BOM_UTF16 0xfeff
+
+/* Direction of the transformation. */
+enum direction
+{
+ illegal_dir,
+ to_utf8,
+ from_utf8
+};
+
+struct utf8_data
+{
+ enum direction dir;
+ int emit_bom;
+};
+
+
+extern int gconv_init (struct __gconv_step *step);
+int
+gconv_init (struct __gconv_step *step)
+{
+ /* Determine which direction. */
+ struct utf8_data *new_data;
+ enum direction dir = illegal_dir;
+ int emit_bom;
+ int result;
+
+ emit_bom = (__strcasecmp (step->__to_name, "UTF-16//") == 0);
+
+ if (__strcasecmp (step->__from_name, "ISO-10646/UTF8/") == 0
+ && (__strcasecmp (step->__to_name, "UTF-16//") == 0
+ || __strcasecmp (step->__to_name, "UTF-16BE//") == 0))
+ {
+ dir = from_utf8;
+ }
+ else if (__strcasecmp (step->__from_name, "UTF-16BE//") == 0
+ && __strcasecmp (step->__to_name, "ISO-10646/UTF8/") == 0)
+ {
+ dir = to_utf8;
+ }
+
+ result = __GCONV_NOCONV;
+ if (dir != illegal_dir)
+ {
+ new_data = (struct utf8_data *) malloc (sizeof (struct utf8_data));
+
+ result = __GCONV_NOMEM;
+ if (new_data != NULL)
+ {
+ new_data->dir = dir;
+ new_data->emit_bom = emit_bom;
+ step->__data = new_data;
+
+ if (dir == from_utf8)
+ {
+ step->__min_needed_from = MIN_NEEDED_FROM;
+ step->__max_needed_from = MIN_NEEDED_FROM;
+ step->__min_needed_to = MIN_NEEDED_TO;
+ step->__max_needed_to = MIN_NEEDED_TO;
+ }
+ else
+ {
+ step->__min_needed_from = MIN_NEEDED_TO;
+ step->__max_needed_from = MIN_NEEDED_TO;
+ step->__min_needed_to = MIN_NEEDED_FROM;
+ step->__max_needed_to = MIN_NEEDED_FROM;
+ }
+
+ step->__stateful = 0;
+
+ result = __GCONV_OK;
+ }
+ }
+
+ return result;
+}
+
+
+extern void gconv_end (struct __gconv_step *data);
+void
+gconv_end (struct __gconv_step *data)
+{
+ free (data->__data);
+}
+
+/* The macro for the hardware loop. This is used for both
+ directions. */
+#define HARDWARE_CONVERT(INSTRUCTION) \
+ { \
+ register const unsigned char* pInput __asm__ ("8") = inptr; \
+ register size_t inlen __asm__ ("9") = inend - inptr; \
+ register unsigned char* pOutput __asm__ ("10") = outptr; \
+ register size_t outlen __asm__("11") = outend - outptr; \
+ unsigned long cc = 0; \
+ \
+ __asm__ __volatile__ (".machine push \n\t" \
+ ".machine \"z9-109\" \n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ "0: " INSTRUCTION " \n\t" \
+ ".machine pop \n\t" \
+ " jo 0b \n\t" \
+ " ipm %2 \n" \
+ : "+a" (pOutput), "+a" (pInput), "+d" (cc), \
+ "+d" (outlen), "+d" (inlen) \
+ : \
+ : "cc", "memory"); \
+ \
+ inptr = pInput; \
+ outptr = pOutput; \
+ cc >>= 28; \
+ \
+ if (cc == 1) \
+ { \
+ result = __GCONV_FULL_OUTPUT; \
+ } \
+ else if (cc == 2) \
+ { \
+ result = __GCONV_ILLEGAL_INPUT; \
+ } \
+ }
+
+#define PREPARE_LOOP \
+ enum direction dir = ((struct utf8_data *) step->__data)->dir; \
+ int emit_bom = ((struct utf8_data *) step->__data)->emit_bom; \
+ \
+ if (emit_bom && !data->__internal_use \
+ && data->__invocation_counter == 0) \
+ { \
+ /* Emit the UTF-16 Byte Order Mark. */ \
+ if (__glibc_unlikely (outbuf + 2 > outend)) \
+ return __GCONV_FULL_OUTPUT; \
+ \
+ put16u (outbuf, BOM_UTF16); \
+ outbuf += 2; \
+ }
+
+/* Conversion function from UTF-8 to UTF-16. */
+#define BODY_FROM_HW(ASM) \
+ { \
+ ASM; \
+ if (__glibc_likely (inptr == inend) \
+ || result == __GCONV_FULL_OUTPUT) \
+ break; \
+ \
+ int i; \
+ for (i = 1; inptr + i < inend && i < 5; ++i) \
+ if ((inptr[i] & 0xc0) != 0x80) \
+ break; \
+ \
+ if (__glibc_likely (inptr + i == inend \
+ && result == __GCONV_EMPTY_INPUT)) \
+ { \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ STANDARD_FROM_LOOP_ERR_HANDLER (i); \
+ }
+
+#if HAVE_FROM_VX == 1
+# define HW_FROM_VX \
+ { \
+ register const unsigned char* pInput asm ("8") = inptr; \
+ register size_t inlen asm ("9") = inend - inptr; \
+ register unsigned char* pOutput asm ("10") = outptr; \
+ register size_t outlen asm("11") = outend - outptr; \
+ unsigned long tmp, tmp2, tmp3; \
+ asm volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ " vrepib %%v30,0x7f\n\t" /* For compare > 0x7f. */ \
+ " vrepib %%v31,0x20\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_INLEN]) \
+ CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
+ /* Loop which handles UTF-8 chars <=0x7f. */ \
+ "0: clgijl %[R_INLEN],16,20f\n\t" \
+ " clgijl %[R_OUTLEN],32,20f\n\t" \
+ "1: vl %%v16,0(%[R_IN])\n\t" \
+ " vstrcbs %%v17,%%v16,%%v30,%%v31\n\t" \
+ " jno 10f\n\t" /* Jump away if not all bytes are 1byte \
+ UTF8 chars. */ \
+ /* Enlarge to UTF-16. */ \
+ " vuplhb %%v18,%%v16\n\t" \
+ " la %[R_IN],16(%[R_IN])\n\t" \
+ " vupllb %%v19,%%v16\n\t" \
+ " aghi %[R_INLEN],-16\n\t" \
+ /* Store 32 bytes to buf_out. */ \
+ " vstm %%v18,%%v19,0(%[R_OUT])\n\t" \
+ " aghi %[R_OUTLEN],-32\n\t" \
+ " la %[R_OUT],32(%[R_OUT])\n\t" \
+ " clgijl %[R_INLEN],16,20f\n\t" \
+ " clgijl %[R_OUTLEN],32,20f\n\t" \
+ " j 1b\n\t" \
+ "10:\n\t" \
+ /* At least one byte is > 0x7f. \
+ Store the preceding 1-byte chars. */ \
+ " vlgvb %[R_TMP],%%v17,7\n\t" \
+ " sllk %[R_TMP2],%[R_TMP],1\n\t" /* Compute highest \
+ index to store. */ \
+ " llgfr %[R_TMP3],%[R_TMP2]\n\t" \
+ " ahi %[R_TMP2],-1\n\t" \
+ " jl 20f\n\t" \
+ " vuplhb %%v18,%%v16\n\t" \
+ " vstl %%v18,%[R_TMP2],0(%[R_OUT])\n\t" \
+ " ahi %[R_TMP2],-16\n\t" \
+ " jl 11f\n\t" \
+ " vupllb %%v19,%%v16\n\t" \
+ " vstl %%v19,%[R_TMP2],16(%[R_OUT])\n\t" \
+ "11: \n\t" /* Update pointers. */ \
+ " la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " slgr %[R_INLEN],%[R_TMP]\n\t" \
+ " la %[R_OUT],0(%[R_TMP3],%[R_OUT])\n\t" \
+ " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \
+ /* Handle multibyte utf8-char with convert instruction. */ \
+ "20: cu12 %[R_OUT],%[R_IN],1\n\t" \
+ " jo 0b\n\t" /* Try vector implemenation again. */ \
+ " lochil %[R_RES],%[RES_OUT_FULL]\n\t" /* cc == 1. */ \
+ " lochih %[R_RES],%[RES_IN_ILL]\n\t" /* cc == 2. */ \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (pInput) \
+ , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (pOutput) \
+ , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=d" (tmp2), [R_TMP3] "=a" (tmp3) \
+ , [R_RES] "+d" (result) \
+ : /* inputs */ \
+ [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \
+ , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \
+ : /* clobber list */ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v30") ASM_CLOBBER_VR ("v31") \
+ ); \
+ inptr = pInput; \
+ outptr = pOutput; \
+ }
+# define BODY_FROM_VX BODY_FROM_HW (HW_FROM_VX)
+
+/* Generate loop-function with hardware vector and utf-convert instructions. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_TO
+# define FROM_LOOP_VX __from_utf8_loop_vx
+# define LOOPFCT FROM_LOOP_VX
+# define LOOP_NEED_FLAGS
+# define BODY BODY_FROM_VX
+# include <iconv/loop.c>
+#else
+# define FROM_LOOP_VX NULL
+#endif /* HAVE_FROM_VX != 1 */
+
+#if HAVE_FROM_CU == 1
+# define BODY_FROM_ETF3EH BODY_FROM_HW (HARDWARE_CONVERT ("cu12 %0, %1, 1"))
+
+/* Generate loop-function with hardware utf-convert instruction. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_TO
+# define FROM_LOOP_CU __from_utf8_loop_etf3eh
+# define LOOPFCT FROM_LOOP_CU
+# define LOOP_NEED_FLAGS
+# define BODY BODY_FROM_ETF3EH
+# include <iconv/loop.c>
+#else
+# define FROM_LOOP_CU NULL
+#endif /* HAVE_FROM_CU != 1 */
+
+#if HAVE_FROM_C == 1
+/* The software implementation is based on the code in gconv_simple.c. */
+# define BODY_FROM_C \
+ { \
+ /* Next input byte. */ \
+ uint16_t ch = *inptr; \
+ \
+ if (__glibc_likely (ch < 0x80)) \
+ { \
+ /* One byte sequence. */ \
+ ++inptr; \
+ } \
+ else \
+ { \
+ uint_fast32_t cnt; \
+ uint_fast32_t i; \
+ \
+ if (ch >= 0xc2 && ch < 0xe0) \
+ { \
+ /* We expect two bytes. The first byte cannot be 0xc0 \
+ or 0xc1, otherwise the wide character could have been \
+ represented using a single byte. */ \
+ cnt = 2; \
+ ch &= 0x1f; \
+ } \
+ else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \
+ { \
+ /* We expect three bytes. */ \
+ cnt = 3; \
+ ch &= 0x0f; \
+ } \
+ else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \
+ { \
+ /* We expect four bytes. */ \
+ cnt = 4; \
+ ch &= 0x07; \
+ } \
+ else \
+ { \
+ /* Search the end of this ill-formed UTF-8 character. This \
+ is the next byte with (x & 0xc0) != 0x80. */ \
+ i = 0; \
+ do \
+ ++i; \
+ while (inptr + i < inend \
+ && (*(inptr + i) & 0xc0) == 0x80 \
+ && i < 5); \
+ \
+ errout: \
+ STANDARD_FROM_LOOP_ERR_HANDLER (i); \
+ } \
+ \
+ if (__glibc_unlikely (inptr + cnt > inend)) \
+ { \
+ /* We don't have enough input. But before we report \
+ that check that all the bytes are correct. */ \
+ for (i = 1; inptr + i < inend; ++i) \
+ if ((inptr[i] & 0xc0) != 0x80) \
+ break; \
+ \
+ if (__glibc_likely (inptr + i == inend)) \
+ { \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ \
+ goto errout; \
+ } \
+ \
+ if (cnt == 4) \
+ { \
+ /* For 4 byte UTF-8 chars two UTF-16 chars (high and \
+ low) are needed. */ \
+ uint16_t zabcd, high, low; \
+ \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
+ { \
+ /* Overflow in the output buffer. */ \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ \
+ /* Check if tail-bytes >= 0x80, < 0xc0. */ \
+ for (i = 1; i < cnt; ++i) \
+ { \
+ if ((inptr[i] & 0xc0) != 0x80) \
+ /* This is an illegal encoding. */ \
+ goto errout; \
+ } \
+ \
+ /* See Principles of Operations cu12. */ \
+ zabcd = (((inptr[0] & 0x7) << 2) | \
+ ((inptr[1] & 0x30) >> 4)) - 1; \
+ \
+ /* z-bit must be zero after subtracting 1. */ \
+ if (zabcd & 0x10) \
+ STANDARD_FROM_LOOP_ERR_HANDLER (4) \
+ \
+ high = (uint16_t)(0xd8 << 8); /* high surrogate id */ \
+ high |= zabcd << 6; /* abcd bits */ \
+ high |= (inptr[1] & 0xf) << 2; /* efgh bits */ \
+ high |= (inptr[2] & 0x30) >> 4; /* ij bits */ \
+ \
+ low = (uint16_t)(0xdc << 8); /* low surrogate id */ \
+ low |= ((uint16_t)inptr[2] & 0xc) << 6; /* kl bits */ \
+ low |= (inptr[2] & 0x3) << 6; /* mn bits */ \
+ low |= inptr[3] & 0x3f; /* opqrst bits */ \
+ \
+ put16 (outptr, high); \
+ outptr += 2; \
+ put16 (outptr, low); \
+ outptr += 2; \
+ inptr += 4; \
+ continue; \
+ } \
+ else \
+ { \
+ /* Read the possible remaining bytes. */ \
+ for (i = 1; i < cnt; ++i) \
+ { \
+ uint16_t byte = inptr[i]; \
+ \
+ if ((byte & 0xc0) != 0x80) \
+ /* This is an illegal encoding. */ \
+ break; \
+ \
+ ch <<= 6; \
+ ch |= byte & 0x3f; \
+ } \
+ \
+ /* If i < cnt, some trail byte was not >= 0x80, < 0xc0. \
+ If cnt > 2 and ch < 2^(5*cnt-4), the wide character ch could \
+ have been represented with fewer than cnt bytes. */ \
+ if (i < cnt || (cnt > 2 && (ch >> (5 * cnt - 4)) == 0) \
+ /* Do not accept UTF-16 surrogates. */ \
+ || (ch >= 0xd800 && ch <= 0xdfff)) \
+ { \
+ /* This is an illegal encoding. */ \
+ goto errout; \
+ } \
+ \
+ inptr += cnt; \
+ } \
+ } \
+ /* Now adjust the pointers and store the result. */ \
+ *((uint16_t *) outptr) = ch; \
+ outptr += sizeof (uint16_t); \
+ }
+
+/* Generate loop-function with software implementation. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_TO
+# define FROM_LOOP_C __from_utf8_loop_c
+# define LOOPFCT FROM_LOOP_C
+# define LOOP_NEED_FLAGS
+# define BODY BODY_FROM_C
+# include <iconv/loop.c>
+#else
+# define FROM_LOOP_C NULL
+#endif /* HAVE_FROM_C != 1 */
+
+/* Conversion from UTF-16 to UTF-8. */
+
+#if HAVE_TO_C == 1
+/* The software routine is based on the functionality of the S/390
+ hardware instruction (cu21) as described in the Principles of
+ Operation. */
+# define BODY_TO_C \
+ { \
+ uint16_t c = get16 (inptr); \
+ \
+ if (__glibc_likely (c <= 0x007f)) \
+ { \
+ /* Single byte UTF-8 char. */ \
+ *outptr = c & 0xff; \
+ outptr++; \
+ } \
+ else if (c >= 0x0080 && c <= 0x07ff) \
+ { \
+ /* Two byte UTF-8 char. */ \
+ \
+ if (__glibc_unlikely (outptr + 2 > outend)) \
+ { \
+ /* Overflow in the output buffer. */ \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ \
+ outptr[0] = 0xc0; \
+ outptr[0] |= c >> 6; \
+ \
+ outptr[1] = 0x80; \
+ outptr[1] |= c & 0x3f; \
+ \
+ outptr += 2; \
+ } \
+ else if ((c >= 0x0800 && c <= 0xd7ff) || c > 0xdfff) \
+ { \
+ /* Three byte UTF-8 char. */ \
+ \
+ if (__glibc_unlikely (outptr + 3 > outend)) \
+ { \
+ /* Overflow in the output buffer. */ \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ outptr[0] = 0xe0; \
+ outptr[0] |= c >> 12; \
+ \
+ outptr[1] = 0x80; \
+ outptr[1] |= (c >> 6) & 0x3f; \
+ \
+ outptr[2] = 0x80; \
+ outptr[2] |= c & 0x3f; \
+ \
+ outptr += 3; \
+ } \
+ else if (c >= 0xd800 && c <= 0xdbff) \
+ { \
+ /* Four byte UTF-8 char. */ \
+ uint16_t low, uvwxy; \
+ \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
+ { \
+ /* Overflow in the output buffer. */ \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ if (__glibc_unlikely (inptr + 4 > inend)) \
+ { \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ \
+ inptr += 2; \
+ low = get16 (inptr); \
+ \
+ if ((low & 0xfc00) != 0xdc00) \
+ { \
+ inptr -= 2; \
+ STANDARD_TO_LOOP_ERR_HANDLER (2); \
+ } \
+ uvwxy = ((c >> 6) & 0xf) + 1; \
+ outptr[0] = 0xf0; \
+ outptr[0] |= uvwxy >> 2; \
+ \
+ outptr[1] = 0x80; \
+ outptr[1] |= (uvwxy << 4) & 0x30; \
+ outptr[1] |= (c >> 2) & 0x0f; \
+ \
+ outptr[2] = 0x80; \
+ outptr[2] |= (c & 0x03) << 4; \
+ outptr[2] |= (low >> 6) & 0x0f; \
+ \
+ outptr[3] = 0x80; \
+ outptr[3] |= low & 0x3f; \
+ \
+ outptr += 4; \
+ } \
+ else \
+ { \
+ STANDARD_TO_LOOP_ERR_HANDLER (2); \
+ } \
+ inptr += 2; \
+ }
+
+/* Generate loop-function with software implementation. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
+# define MAX_NEEDED_INPUT MAX_NEEDED_TO
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
+# define TO_LOOP_C __to_utf8_loop_c
+# define LOOPFCT TO_LOOP_C
+# define BODY BODY_TO_C
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+#else
+# define TO_LOOP_C NULL
+#endif /* HAVE_TO_C != 1 */
+
+#if HAVE_TO_VX == 1
+# define BODY_TO_VX \
+ { \
+ size_t inlen = inend - inptr; \
+ size_t outlen = outend - outptr; \
+ unsigned long tmp, tmp2, tmp3; \
+ asm volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ /* Setup to check for values <= 0x7f. */ \
+ " larl %[R_TMP],9f\n\t" \
+ " vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_INLEN]) \
+ CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
+ /* Loop which handles UTF-16 chars <=0x7f. */ \
+ "0: clgijl %[R_INLEN],32,2f\n\t" \
+ " clgijl %[R_OUTLEN],16,2f\n\t" \
+ "1: vlm %%v16,%%v17,0(%[R_IN])\n\t" \
+ " lghi %[R_TMP2],0\n\t" \
+ /* Check for > 1byte UTF-8 chars. */ \
+ " vstrchs %%v19,%%v16,%%v30,%%v31\n\t" \
+ " jno 10f\n\t" /* Jump away if not all bytes are 1byte \
+ UTF8 chars. */ \
+ " vstrchs %%v19,%%v17,%%v30,%%v31\n\t" \
+ " jno 11f\n\t" /* Jump away if not all bytes are 1byte \
+ UTF8 chars. */ \
+ /* Shorten to UTF-8. */ \
+ " vpkh %%v18,%%v16,%%v17\n\t" \
+ " la %[R_IN],32(%[R_IN])\n\t" \
+ " aghi %[R_INLEN],-32\n\t" \
+ /* Store 16 bytes to buf_out. */ \
+ " vst %%v18,0(%[R_OUT])\n\t" \
+ " aghi %[R_OUTLEN],-16\n\t" \
+ " la %[R_OUT],16(%[R_OUT])\n\t" \
+ " clgijl %[R_INLEN],32,2f\n\t" \
+ " clgijl %[R_OUTLEN],16,2f\n\t" \
+ " j 1b\n\t" \
+ /* Setup to check for ch > 0x7f. (v30, v31) */ \
+ "9: .short 0x7f,0x7f,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ " .short 0x2000,0x2000,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ /* At least one byte is > 0x7f. \
+ Store the preceding 1-byte chars. */ \
+ "11: lghi %[R_TMP2],16\n\t" /* match was found in v17. */ \
+ "10:\n\t" \
+ " vlgvb %[R_TMP],%%v19,7\n\t" \
+ /* Shorten to UTF-8. */ \
+ " vpkh %%v18,%%v16,%%v17\n\t" \
+ " ar %[R_TMP],%[R_TMP2]\n\t" /* Number of in bytes. */ \
+ " srlg %[R_TMP3],%[R_TMP],1\n\t" /* Number of out bytes. */ \
+ " ahik %[R_TMP2],%[R_TMP3],-1\n\t" /* Highest index to store. */ \
+ " jl 13f\n\t" \
+ " vstl %%v18,%[R_TMP2],0(%[R_OUT])\n\t" \
+ /* Update pointers. */ \
+ " la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " slgr %[R_INLEN],%[R_TMP]\n\t" \
+ " la %[R_OUT],0(%[R_TMP3],%[R_OUT])\n\t" \
+ " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \
+ "13: \n\t" \
+ /* Calculate remaining uint16_t values in loaded vrs. */ \
+ " lghi %[R_TMP2],16\n\t" \
+ " slgr %[R_TMP2],%[R_TMP3]\n\t" \
+ " llh %[R_TMP],0(%[R_IN])\n\t" \
+ " aghi %[R_INLEN],-2\n\t" \
+ " j 22f\n\t" \
+ /* Handle remaining bytes. */ \
+ "2: \n\t" \
+ /* Zero, one or more bytes available? */ \
+ " clgfi %[R_INLEN],1\n\t" \
+ " locghie %[R_RES],%[RES_IN_FULL]\n\t" /* Only one byte. */ \
+ " jle 99f\n\t" /* End if less than two bytes. */ \
+ /* Calculate remaining uint16_t values in inptr. */ \
+ " srlg %[R_TMP2],%[R_INLEN],1\n\t" \
+ /* Handle multibyte utf8-char. */ \
+ "20: llh %[R_TMP],0(%[R_IN])\n\t" \
+ " aghi %[R_INLEN],-2\n\t" \
+ /* Test if ch is 1-byte UTF-8 char. */ \
+ "21: clijh %[R_TMP],0x7f,22f\n\t" \
+ /* Handle 1-byte UTF-8 char. */ \
+ "31: slgfi %[R_OUTLEN],1\n\t" \
+ " jl 90f \n\t" \
+ " stc %[R_TMP],0(%[R_OUT])\n\t" \
+ " la %[R_IN],2(%[R_IN])\n\t" \
+ " la %[R_OUT],1(%[R_OUT])\n\t" \
+ " brctg %[R_TMP2],20b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ /* Test if ch is 2-byte UTF-8 char. */ \
+ "22: clfi %[R_TMP],0x7ff\n\t" \
+ " jh 23f\n\t" \
+ /* Handle 2-byte UTF-8 char. */ \
+ "32: slgfi %[R_OUTLEN],2\n\t" \
+ " jl 90f \n\t" \
+ " llill %[R_TMP3],0xc080\n\t" \
+ " la %[R_IN],2(%[R_IN])\n\t" \
+ " risbgn %[R_TMP3],%[R_TMP],51,55,2\n\t" /* 1. byte. */ \
+ " risbgn %[R_TMP3],%[R_TMP],58,63,0\n\t" /* 2. byte. */ \
+ " sth %[R_TMP3],0(%[R_OUT])\n\t" \
+ " la %[R_OUT],2(%[R_OUT])\n\t" \
+ " brctg %[R_TMP2],20b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ /* Test if ch is 3-byte UTF-8 char. */ \
+ "23: clfi %[R_TMP],0xd7ff\n\t" \
+ " jh 24f\n\t" \
+ /* Handle 3-byte UTF-8 char. */ \
+ "33: slgfi %[R_OUTLEN],3\n\t" \
+ " jl 90f \n\t" \
+ " llilf %[R_TMP3],0xe08080\n\t" \
+ " la %[R_IN],2(%[R_IN])\n\t" \
+ " risbgn %[R_TMP3],%[R_TMP],44,47,4\n\t" /* 1. byte. */ \
+ " risbgn %[R_TMP3],%[R_TMP],50,55,2\n\t" /* 2. byte. */ \
+ " risbgn %[R_TMP3],%[R_TMP],58,63,0\n\t" /* 3. byte. */ \
+ " stcm %[R_TMP3],7,0(%[R_OUT])\n\t" \
+ " la %[R_OUT],3(%[R_OUT])\n\t" \
+ " brctg %[R_TMP2],20b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ /* Test if ch is 4-byte UTF-8 char. */ \
+ "24: clfi %[R_TMP],0xdfff\n\t" \
+ " jh 33b\n\t" /* Handle this 3-byte UTF-8 char. */ \
+ " clfi %[R_TMP],0xdbff\n\t" \
+ " locghih %[R_RES],%[RES_IN_ILL]\n\t" \
+ " jh 99f\n\t" /* Jump away if this is a low surrogate \
+ without a preceding high surrogate. */ \
+ /* Handle 4-byte UTF-8 char. */ \
+ "34: slgfi %[R_OUTLEN],4\n\t" \
+ " jl 90f \n\t" \
+ " slgfi %[R_INLEN],2\n\t" \
+ " locghil %[R_RES],%[RES_IN_FULL]\n\t" \
+ " jl 99f\n\t" /* Jump away if low surrogate is missing. */ \
+ " llilf %[R_TMP3],0xf0808080\n\t" \
+ " aghi %[R_TMP],0x40\n\t" \
+ " risbgn %[R_TMP3],%[R_TMP],37,39,16\n\t" /* 1. byte: uvw */ \
+ " risbgn %[R_TMP3],%[R_TMP],42,43,14\n\t" /* 2. byte: xy */ \
+ " risbgn %[R_TMP3],%[R_TMP],44,47,14\n\t" /* 2. byte: efgh */ \
+ " risbgn %[R_TMP3],%[R_TMP],50,51,12\n\t" /* 3. byte: ij */ \
+ " llh %[R_TMP],2(%[R_IN])\n\t" /* Load low surrogate. */ \
+ " risbgn %[R_TMP3],%[R_TMP],52,55,2\n\t" /* 3. byte: klmn */ \
+ " risbgn %[R_TMP3],%[R_TMP],58,63,0\n\t" /* 4. byte: opqrst */ \
+ " nilf %[R_TMP],0xfc00\n\t" \
+ " clfi %[R_TMP],0xdc00\n\t" /* Check if it starts with 0xdc00. */ \
+ " locghine %[R_RES],%[RES_IN_ILL]\n\t" \
+ " jne 99f\n\t" /* Jump away if low surrogate is invalid. */ \
+ " st %[R_TMP3],0(%[R_OUT])\n\t" \
+ " la %[R_IN],4(%[R_IN])\n\t" \
+ " la %[R_OUT],4(%[R_OUT])\n\t" \
+ " aghi %[R_TMP2],-2\n\t" \
+ " jh 20b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ /* Exit with __GCONV_FULL_OUTPUT. */ \
+ "90: lghi %[R_RES],%[RES_OUT_FULL]\n\t" \
+ "99: \n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (inptr) \
+ , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (outptr) \
+ , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=d" (tmp2), [R_TMP3] "=a" (tmp3) \
+ , [R_RES] "+d" (result) \
+ : /* inputs */ \
+ [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \
+ , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \
+ , [RES_IN_FULL] "i" (__GCONV_INCOMPLETE_INPUT) \
+ : /* clobber list */ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v30") ASM_CLOBBER_VR ("v31") \
+ ); \
+ if (__glibc_likely (inptr == inend) \
+ || result != __GCONV_ILLEGAL_INPUT) \
+ break; \
+ \
+ STANDARD_TO_LOOP_ERR_HANDLER (2); \
+ }
+
+/* Generate loop-function with vector implementation. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
+# define MAX_NEEDED_INPUT MAX_NEEDED_TO
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
+# define TO_LOOP_VX __to_utf8_loop_vx
+# define LOOPFCT TO_LOOP_VX
+# define BODY BODY_TO_VX
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+#else
+# define TO_LOOP_VX NULL
+#endif /* HAVE_TO_VX != 1 */
+
+#if HAVE_TO_VX_CU == 1
+#define BODY_TO_VX_CU \
+ { \
+ register const unsigned char* pInput asm ("8") = inptr; \
+ register size_t inlen asm ("9") = inend - inptr; \
+ register unsigned char* pOutput asm ("10") = outptr; \
+ register size_t outlen asm ("11") = outend - outptr; \
+ unsigned long tmp, tmp2, tmp3; \
+ asm volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ /* Setup to check for values <= 0x7f. */ \
+ " larl %[R_TMP],9f\n\t" \
+ " vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_INLEN]) \
+ CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
+ /* Loop which handles UTF-16 chars <=0x7f. */ \
+ "0: clgijl %[R_INLEN],32,20f\n\t" \
+ " clgijl %[R_OUTLEN],16,20f\n\t" \
+ "1: vlm %%v16,%%v17,0(%[R_IN])\n\t" \
+ " lghi %[R_TMP2],0\n\t" \
+ /* Check for > 1byte UTF-8 chars. */ \
+ " vstrchs %%v19,%%v16,%%v30,%%v31\n\t" \
+ " jno 10f\n\t" /* Jump away if not all bytes are 1byte \
+ UTF8 chars. */ \
+ " vstrchs %%v19,%%v17,%%v30,%%v31\n\t" \
+ " jno 11f\n\t" /* Jump away if not all bytes are 1byte \
+ UTF8 chars. */ \
+ /* Shorten to UTF-8. */ \
+ " vpkh %%v18,%%v16,%%v17\n\t" \
+ " la %[R_IN],32(%[R_IN])\n\t" \
+ " aghi %[R_INLEN],-32\n\t" \
+ /* Store 16 bytes to buf_out. */ \
+ " vst %%v18,0(%[R_OUT])\n\t" \
+ " aghi %[R_OUTLEN],-16\n\t" \
+ " la %[R_OUT],16(%[R_OUT])\n\t" \
+ " clgijl %[R_INLEN],32,20f\n\t" \
+ " clgijl %[R_OUTLEN],16,20f\n\t" \
+ " j 1b\n\t" \
+ /* Setup to check for ch > 0x7f. (v30, v31) */ \
+ "9: .short 0x7f,0x7f,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ " .short 0x2000,0x2000,0x0,0x0,0x0,0x0,0x0,0x0\n\t" \
+ /* At least one byte is > 0x7f. \
+ Store the preceding 1-byte chars. */ \
+ "11: lghi %[R_TMP2],16\n\t" /* match was found in v17. */ \
+ "10: vlgvb %[R_TMP],%%v19,7\n\t" \
+ /* Shorten to UTF-8. */ \
+ " vpkh %%v18,%%v16,%%v17\n\t" \
+ " ar %[R_TMP],%[R_TMP2]\n\t" /* Number of in bytes. */ \
+ " srlg %[R_TMP3],%[R_TMP],1\n\t" /* Number of out bytes. */ \
+ " ahik %[R_TMP2],%[R_TMP3],-1\n\t" /* Highest index to store. */ \
+ " jl 20f\n\t" \
+ " vstl %%v18,%[R_TMP2],0(%[R_OUT])\n\t" \
+ /* Update pointers. */ \
+ " la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " slgr %[R_INLEN],%[R_TMP]\n\t" \
+ " la %[R_OUT],0(%[R_TMP3],%[R_OUT])\n\t" \
+ " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \
+ /* Handles UTF16 surrogates with convert instruction. */ \
+ "20: cu21 %[R_OUT],%[R_IN],1\n\t" \
+ " jo 0b\n\t" /* Try vector implemenation again. */ \
+ " lochil %[R_RES],%[RES_OUT_FULL]\n\t" /* cc == 1. */ \
+ " lochih %[R_RES],%[RES_IN_ILL]\n\t" /* cc == 2. */ \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (pInput) \
+ , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (pOutput) \
+ , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=d" (tmp2), [R_TMP3] "=a" (tmp3) \
+ , [R_RES] "+d" (result) \
+ : /* inputs */ \
+ [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \
+ , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \
+ : /* clobber list */ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v30") ASM_CLOBBER_VR ("v31") \
+ ); \
+ inptr = pInput; \
+ outptr = pOutput; \
+ \
+ if (__glibc_likely (inlen == 0) \
+ || result == __GCONV_FULL_OUTPUT) \
+ break; \
+ if (inlen == 1) \
+ { \
+ /* Input does not contain a complete utf16 character. */ \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ else if (result != __GCONV_ILLEGAL_INPUT) \
+ { \
+ /* Input is >= 2 and < 4 bytes (as cu21 would have processed \
+ a possible next utf16 character) and not illegal. \
+ => we have a single high surrogate at end of input. */ \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ \
+ STANDARD_TO_LOOP_ERR_HANDLER (2); \
+ }
+
+/* Generate loop-function with vector and utf-convert instructions. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
+# define MAX_NEEDED_INPUT MAX_NEEDED_TO
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
+# define TO_LOOP_VX_CU __to_utf8_loop_vx_cu
+# define LOOPFCT TO_LOOP_VX_CU
+# define BODY BODY_TO_VX_CU
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+#else
+# define TO_LOOP_VX_CU NULL
+#endif /* HAVE_TO_VX_CU != 1 */
+
+/* This file also exists in sysdeps/s390/multiarch/ which
+ generates ifunc resolvers for FROM/TO_LOOP functions
+ and includes iconv/skeleton.c afterwards. */
+#if ! defined USE_MULTIARCH
+# include <iconv/skeleton.c>
+#endif
diff --git a/sysdeps/s390/utf8-utf32-z9.c b/sysdeps/s390/utf8-utf32-z9.c
new file mode 100644
index 0000000000..c09d9b5bbd
--- /dev/null
+++ b/sysdeps/s390/utf8-utf32-z9.c
@@ -0,0 +1,983 @@
+/* Conversion between UTF-8 and UTF-32 BE/internal.
+
+ This module uses the Z9-109 variants of the Convert Unicode
+ instructions.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+
+ Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+ Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ Thanks to Daniel Appich who covered the relevant performance work
+ in his diploma thesis.
+
+ This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <stdint.h>
+#include <unistd.h>
+#include <gconv.h>
+#include <string.h>
+
+/* Select which versions should be defined depending on support
+ for multiarch, vector and used minimum architecture level. */
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
+# define HAVE_FROM_C 0
+# define FROM_LOOP_DEFAULT FROM_LOOP_CU
+#else
+# define HAVE_FROM_C 1
+# define FROM_LOOP_DEFAULT FROM_LOOP_C
+#endif
+
+#define HAVE_TO_C 1
+#define TO_LOOP_DEFAULT TO_LOOP_C
+
+#if defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT || defined USE_MULTIARCH
+# define HAVE_FROM_CU 1
+#else
+# define HAVE_FROM_CU 0
+#endif
+
+#if defined HAVE_S390_VX_ASM_SUPPORT && defined USE_MULTIARCH
+# define HAVE_FROM_VX 1
+# define HAVE_TO_VX 1
+# define HAVE_TO_VX_CU 1
+#else
+# define HAVE_FROM_VX 0
+# define HAVE_TO_VX 0
+# define HAVE_TO_VX_CU 0
+#endif
+
+#if defined HAVE_S390_VX_GCC_SUPPORT
+# define ASM_CLOBBER_VR(NR) , NR
+#else
+# define ASM_CLOBBER_VR(NR)
+#endif
+
+#if defined __s390x__
+# define CONVERT_32BIT_SIZE_T(REG)
+#else
+# define CONVERT_32BIT_SIZE_T(REG) "llgfr %" #REG ",%" #REG "\n\t"
+#endif
+
+/* Defines for skeleton.c. */
+#define DEFINE_INIT 0
+#define DEFINE_FINI 0
+#define MIN_NEEDED_FROM 1
+#define MAX_NEEDED_FROM 6
+#define MIN_NEEDED_TO 4
+#define FROM_LOOP FROM_LOOP_DEFAULT
+#define TO_LOOP TO_LOOP_DEFAULT
+#define FROM_DIRECTION (dir == from_utf8)
+#define ONE_DIRECTION 0
+
+/* UTF-32 big endian byte order mark. */
+#define BOM 0x0000feffu
+
+/* Direction of the transformation. */
+enum direction
+{
+ illegal_dir,
+ to_utf8,
+ from_utf8
+};
+
+struct utf8_data
+{
+ enum direction dir;
+ int emit_bom;
+};
+
+
+extern int gconv_init (struct __gconv_step *step);
+int
+gconv_init (struct __gconv_step *step)
+{
+ /* Determine which direction. */
+ struct utf8_data *new_data;
+ enum direction dir = illegal_dir;
+ int emit_bom;
+ int result;
+
+ emit_bom = (__strcasecmp (step->__to_name, "UTF-32//") == 0);
+
+ if (__strcasecmp (step->__from_name, "ISO-10646/UTF8/") == 0
+ && (__strcasecmp (step->__to_name, "UTF-32//") == 0
+ || __strcasecmp (step->__to_name, "UTF-32BE//") == 0
+ || __strcasecmp (step->__to_name, "INTERNAL") == 0))
+ {
+ dir = from_utf8;
+ }
+ else if (__strcasecmp (step->__to_name, "ISO-10646/UTF8/") == 0
+ && (__strcasecmp (step->__from_name, "UTF-32BE//") == 0
+ || __strcasecmp (step->__from_name, "INTERNAL") == 0))
+ {
+ dir = to_utf8;
+ }
+
+ result = __GCONV_NOCONV;
+ if (dir != illegal_dir)
+ {
+ new_data = (struct utf8_data *) malloc (sizeof (struct utf8_data));
+
+ result = __GCONV_NOMEM;
+ if (new_data != NULL)
+ {
+ new_data->dir = dir;
+ new_data->emit_bom = emit_bom;
+ step->__data = new_data;
+
+ if (dir == from_utf8)
+ {
+ step->__min_needed_from = MIN_NEEDED_FROM;
+ step->__max_needed_from = MIN_NEEDED_FROM;
+ step->__min_needed_to = MIN_NEEDED_TO;
+ step->__max_needed_to = MIN_NEEDED_TO;
+ }
+ else
+ {
+ step->__min_needed_from = MIN_NEEDED_TO;
+ step->__max_needed_from = MIN_NEEDED_TO;
+ step->__min_needed_to = MIN_NEEDED_FROM;
+ step->__max_needed_to = MIN_NEEDED_FROM;
+ }
+
+ step->__stateful = 0;
+
+ result = __GCONV_OK;
+ }
+ }
+
+ return result;
+}
+
+
+extern void gconv_end (struct __gconv_step *data);
+void
+gconv_end (struct __gconv_step *data)
+{
+ free (data->__data);
+}
+
+/* The macro for the hardware loop. This is used for both
+ directions. */
+#define HARDWARE_CONVERT(INSTRUCTION) \
+ { \
+ register const unsigned char* pInput __asm__ ("8") = inptr; \
+ register size_t inlen __asm__ ("9") = inend - inptr; \
+ register unsigned char* pOutput __asm__ ("10") = outptr; \
+ register size_t outlen __asm__("11") = outend - outptr; \
+ unsigned long cc = 0; \
+ \
+ __asm__ __volatile__ (".machine push \n\t" \
+ ".machine \"z9-109\" \n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ "0: " INSTRUCTION " \n\t" \
+ ".machine pop \n\t" \
+ " jo 0b \n\t" \
+ " ipm %2 \n" \
+ : "+a" (pOutput), "+a" (pInput), "+d" (cc), \
+ "+d" (outlen), "+d" (inlen) \
+ : \
+ : "cc", "memory"); \
+ \
+ inptr = pInput; \
+ outptr = pOutput; \
+ cc >>= 28; \
+ \
+ if (cc == 1) \
+ { \
+ result = __GCONV_FULL_OUTPUT; \
+ } \
+ else if (cc == 2) \
+ { \
+ result = __GCONV_ILLEGAL_INPUT; \
+ } \
+ }
+
+#define PREPARE_LOOP \
+ enum direction dir = ((struct utf8_data *) step->__data)->dir; \
+ int emit_bom = ((struct utf8_data *) step->__data)->emit_bom; \
+ \
+ if (emit_bom && !data->__internal_use \
+ && data->__invocation_counter == 0) \
+ { \
+ /* Emit the Byte Order Mark. */ \
+ if (__glibc_unlikely (outbuf + 4 > outend)) \
+ return __GCONV_FULL_OUTPUT; \
+ \
+ put32u (outbuf, BOM); \
+ outbuf += 4; \
+ }
+
+/* Conversion function from UTF-8 to UTF-32 internal/BE. */
+
+#define STORE_REST_COMMON \
+ { \
+ /* We store the remaining bytes while converting them into the UCS4 \
+ format. We can assume that the first byte in the buffer is \
+ correct and that it requires a larger number of bytes than there \
+ are in the input buffer. */ \
+ wint_t ch = **inptrp; \
+ size_t cnt, r; \
+ \
+ state->__count = inend - *inptrp; \
+ \
+ assert (ch != 0xc0 && ch != 0xc1); \
+ if (ch >= 0xc2 && ch < 0xe0) \
+ { \
+ /* We expect two bytes. The first byte cannot be 0xc0 or \
+ 0xc1, otherwise the wide character could have been \
+ represented using a single byte. */ \
+ cnt = 2; \
+ ch &= 0x1f; \
+ } \
+ else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \
+ { \
+ /* We expect three bytes. */ \
+ cnt = 3; \
+ ch &= 0x0f; \
+ } \
+ else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \
+ { \
+ /* We expect four bytes. */ \
+ cnt = 4; \
+ ch &= 0x07; \
+ } \
+ else if (__glibc_likely ((ch & 0xfc) == 0xf8)) \
+ { \
+ /* We expect five bytes. */ \
+ cnt = 5; \
+ ch &= 0x03; \
+ } \
+ else \
+ { \
+ /* We expect six bytes. */ \
+ cnt = 6; \
+ ch &= 0x01; \
+ } \
+ \
+ /* The first byte is already consumed. */ \
+ r = cnt - 1; \
+ while (++(*inptrp) < inend) \
+ { \
+ ch <<= 6; \
+ ch |= **inptrp & 0x3f; \
+ --r; \
+ } \
+ \
+ /* Shift for the so far missing bytes. */ \
+ ch <<= r * 6; \
+ \
+ /* Store the number of bytes expected for the entire sequence. */ \
+ state->__count |= cnt << 8; \
+ \
+ /* Store the value. */ \
+ state->__value.__wch = ch; \
+ }
+
+#define UNPACK_BYTES_COMMON \
+ { \
+ static const unsigned char inmask[5] = { 0xc0, 0xe0, 0xf0, 0xf8, 0xfc }; \
+ wint_t wch = state->__value.__wch; \
+ size_t ntotal = state->__count >> 8; \
+ \
+ inlen = state->__count & 255; \
+ \
+ bytebuf[0] = inmask[ntotal - 2]; \
+ \
+ do \
+ { \
+ if (--ntotal < inlen) \
+ bytebuf[ntotal] = 0x80 | (wch & 0x3f); \
+ wch >>= 6; \
+ } \
+ while (ntotal > 1); \
+ \
+ bytebuf[0] |= wch; \
+ }
+
+#define CLEAR_STATE_COMMON \
+ state->__count = 0
+
+#define BODY_FROM_HW(ASM) \
+ { \
+ ASM; \
+ if (__glibc_likely (inptr == inend) \
+ || result == __GCONV_FULL_OUTPUT) \
+ break; \
+ \
+ int i; \
+ for (i = 1; inptr + i < inend && i < 5; ++i) \
+ if ((inptr[i] & 0xc0) != 0x80) \
+ break; \
+ \
+ if (__glibc_likely (inptr + i == inend \
+ && result == __GCONV_EMPTY_INPUT)) \
+ { \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ STANDARD_FROM_LOOP_ERR_HANDLER (i); \
+ }
+
+#if HAVE_FROM_C == 1
+/* The software routine is copied from gconv_simple.c. */
+# define BODY_FROM_C \
+ { \
+ /* Next input byte. */ \
+ uint32_t ch = *inptr; \
+ \
+ if (__glibc_likely (ch < 0x80)) \
+ { \
+ /* One byte sequence. */ \
+ ++inptr; \
+ } \
+ else \
+ { \
+ uint_fast32_t cnt; \
+ uint_fast32_t i; \
+ \
+ if (ch >= 0xc2 && ch < 0xe0) \
+ { \
+ /* We expect two bytes. The first byte cannot be 0xc0 or \
+ 0xc1, otherwise the wide character could have been \
+ represented using a single byte. */ \
+ cnt = 2; \
+ ch &= 0x1f; \
+ } \
+ else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \
+ { \
+ /* We expect three bytes. */ \
+ cnt = 3; \
+ ch &= 0x0f; \
+ } \
+ else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \
+ { \
+ /* We expect four bytes. */ \
+ cnt = 4; \
+ ch &= 0x07; \
+ } \
+ else \
+ { \
+ /* Search the end of this ill-formed UTF-8 character. This \
+ is the next byte with (x & 0xc0) != 0x80. */ \
+ i = 0; \
+ do \
+ ++i; \
+ while (inptr + i < inend \
+ && (*(inptr + i) & 0xc0) == 0x80 \
+ && i < 5); \
+ \
+ errout: \
+ STANDARD_FROM_LOOP_ERR_HANDLER (i); \
+ } \
+ \
+ if (__glibc_unlikely (inptr + cnt > inend)) \
+ { \
+ /* We don't have enough input. But before we report \
+ that check that all the bytes are correct. */ \
+ for (i = 1; inptr + i < inend; ++i) \
+ if ((inptr[i] & 0xc0) != 0x80) \
+ break; \
+ \
+ if (__glibc_likely (inptr + i == inend)) \
+ { \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ \
+ goto errout; \
+ } \
+ \
+ /* Read the possible remaining bytes. */ \
+ for (i = 1; i < cnt; ++i) \
+ { \
+ uint32_t byte = inptr[i]; \
+ \
+ if ((byte & 0xc0) != 0x80) \
+ /* This is an illegal encoding. */ \
+ break; \
+ \
+ ch <<= 6; \
+ ch |= byte & 0x3f; \
+ } \
+ \
+ /* If i < cnt, some trail byte was not >= 0x80, < 0xc0. \
+ If cnt > 2 and ch < 2^(5*cnt-4), the wide character ch could \
+ have been represented with fewer than cnt bytes. */ \
+ if (i < cnt || (cnt > 2 && (ch >> (5 * cnt - 4)) == 0) \
+ /* Do not accept UTF-16 surrogates. */ \
+ || (ch >= 0xd800 && ch <= 0xdfff) \
+ || (ch > 0x10ffff)) \
+ { \
+ /* This is an illegal encoding. */ \
+ goto errout; \
+ } \
+ \
+ inptr += cnt; \
+ } \
+ \
+ /* Now adjust the pointers and store the result. */ \
+ *((uint32_t *) outptr) = ch; \
+ outptr += sizeof (uint32_t); \
+ }
+
+/* These definitions apply to the UTF-8 to UTF-32 direction. The
+ software implementation for UTF-8 still supports multibyte
+ characters up to 6 bytes whereas the hardware variant does not. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define FROM_LOOP_C __from_utf8_loop_c
+# define LOOPFCT FROM_LOOP_C
+
+# define LOOP_NEED_FLAGS
+
+# define STORE_REST STORE_REST_COMMON
+# define UNPACK_BYTES UNPACK_BYTES_COMMON
+# define CLEAR_STATE CLEAR_STATE_COMMON
+# define BODY BODY_FROM_C
+# include <iconv/loop.c>
+#else
+# define FROM_LOOP_C NULL
+#endif /* HAVE_FROM_C != 1 */
+
+#if HAVE_FROM_CU == 1
+/* This hardware routine uses the Convert UTF8 to UTF32 (cu14) instruction. */
+# define BODY_FROM_ETF3EH BODY_FROM_HW (HARDWARE_CONVERT ("cu14 %0, %1, 1"))
+
+/* Generate loop-function with hardware utf-convert instruction. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define FROM_LOOP_CU __from_utf8_loop_etf3eh
+# define LOOPFCT FROM_LOOP_CU
+
+# define LOOP_NEED_FLAGS
+
+# define STORE_REST STORE_REST_COMMON
+# define UNPACK_BYTES UNPACK_BYTES_COMMON
+# define CLEAR_STATE CLEAR_STATE_COMMON
+# define BODY BODY_FROM_ETF3EH
+# include <iconv/loop.c>
+#else
+# define FROM_LOOP_CU NULL
+#endif /* HAVE_FROM_CU != 1 */
+
+#if HAVE_FROM_VX == 1
+# define HW_FROM_VX \
+ { \
+ register const unsigned char* pInput asm ("8") = inptr; \
+ register size_t inlen asm ("9") = inend - inptr; \
+ register unsigned char* pOutput asm ("10") = outptr; \
+ register size_t outlen asm("11") = outend - outptr; \
+ unsigned long tmp, tmp2, tmp3; \
+ asm volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ " vrepib %%v30,0x7f\n\t" /* For compare > 0x7f. */ \
+ " vrepib %%v31,0x20\n\t" \
+ CONVERT_32BIT_SIZE_T ([R_INLEN]) \
+ CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
+ /* Loop which handles UTF-8 chars <=0x7f. */ \
+ "0: clgijl %[R_INLEN],16,20f\n\t" \
+ " clgijl %[R_OUTLEN],64,20f\n\t" \
+ "1: vl %%v16,0(%[R_IN])\n\t" \
+ " vstrcbs %%v17,%%v16,%%v30,%%v31\n\t" \
+ " jno 10f\n\t" /* Jump away if not all bytes are 1byte \
+ UTF8 chars. */ \
+ /* Enlarge to UCS4. */ \
+ " vuplhb %%v18,%%v16\n\t" \
+ " vupllb %%v19,%%v16\n\t" \
+ " la %[R_IN],16(%[R_IN])\n\t" \
+ " vuplhh %%v20,%%v18\n\t" \
+ " aghi %[R_INLEN],-16\n\t" \
+ " vupllh %%v21,%%v18\n\t" \
+ " aghi %[R_OUTLEN],-64\n\t" \
+ " vuplhh %%v22,%%v19\n\t" \
+ " vupllh %%v23,%%v19\n\t" \
+ /* Store 64 bytes to buf_out. */ \
+ " vstm %%v20,%%v23,0(%[R_OUT])\n\t" \
+ " la %[R_OUT],64(%[R_OUT])\n\t" \
+ " clgijl %[R_INLEN],16,20f\n\t" \
+ " clgijl %[R_OUTLEN],64,20f\n\t" \
+ " j 1b\n\t" \
+ "10: \n\t" \
+ /* At least one byte is > 0x7f. \
+ Store the preceding 1-byte chars. */ \
+ " vlgvb %[R_TMP],%%v17,7\n\t" \
+ " sllk %[R_TMP2],%[R_TMP],2\n\t" /* Compute highest \
+ index to store. */ \
+ " llgfr %[R_TMP3],%[R_TMP2]\n\t" \
+ " ahi %[R_TMP2],-1\n\t" \
+ " jl 20f\n\t" \
+ " vuplhb %%v18,%%v16\n\t" \
+ " vuplhh %%v20,%%v18\n\t" \
+ " vstl %%v20,%[R_TMP2],0(%[R_OUT])\n\t" \
+ " ahi %[R_TMP2],-16\n\t" \
+ " jl 11f\n\t" \
+ " vupllh %%v21,%%v18\n\t" \
+ " vstl %%v21,%[R_TMP2],16(%[R_OUT])\n\t" \
+ " ahi %[R_TMP2],-16\n\t" \
+ " jl 11f\n\t" \
+ " vupllb %%v19,%%v16\n\t" \
+ " vuplhh %%v22,%%v19\n\t" \
+ " vstl %%v22,%[R_TMP2],32(%[R_OUT])\n\t" \
+ " ahi %[R_TMP2],-16\n\t" \
+ " jl 11f\n\t" \
+ " vupllh %%v23,%%v19\n\t" \
+ " vstl %%v23,%[R_TMP2],48(%[R_OUT])\n\t" \
+ "11: \n\t" \
+ /* Update pointers. */ \
+ " la %[R_IN],0(%[R_TMP],%[R_IN])\n\t" \
+ " slgr %[R_INLEN],%[R_TMP]\n\t" \
+ " la %[R_OUT],0(%[R_TMP3],%[R_OUT])\n\t" \
+ " slgr %[R_OUTLEN],%[R_TMP3]\n\t" \
+ /* Handle multibyte utf8-char with convert instruction. */ \
+ "20: cu14 %[R_OUT],%[R_IN],1\n\t" \
+ " jo 0b\n\t" /* Try vector implemenation again. */ \
+ " lochil %[R_RES],%[RES_OUT_FULL]\n\t" /* cc == 1. */ \
+ " lochih %[R_RES],%[RES_IN_ILL]\n\t" /* cc == 2. */ \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (pInput) \
+ , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (pOutput) \
+ , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=d" (tmp2), [R_TMP3] "=a" (tmp3) \
+ , [R_RES] "+d" (result) \
+ : /* inputs */ \
+ [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \
+ , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \
+ : /* clobber list */ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v20") ASM_CLOBBER_VR ("v21") \
+ ASM_CLOBBER_VR ("v22") ASM_CLOBBER_VR ("v30") \
+ ASM_CLOBBER_VR ("v31") \
+ ); \
+ inptr = pInput; \
+ outptr = pOutput; \
+ }
+# define BODY_FROM_VX BODY_FROM_HW (HW_FROM_VX)
+
+/* Generate loop-function with hardware vector and utf-convert instructions. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+# define FROM_LOOP_VX __from_utf8_loop_vx
+# define LOOPFCT FROM_LOOP_VX
+
+# define LOOP_NEED_FLAGS
+
+# define STORE_REST STORE_REST_COMMON
+# define UNPACK_BYTES UNPACK_BYTES_COMMON
+# define CLEAR_STATE CLEAR_STATE_COMMON
+# define BODY BODY_FROM_VX
+# include <iconv/loop.c>
+#else
+# define FROM_LOOP_VX NULL
+#endif /* HAVE_FROM_VX != 1 */
+
+#if HAVE_TO_C == 1
+/* The software routine mimics the S/390 cu41 instruction. */
+# define BODY_TO_C \
+ { \
+ uint32_t wc = *((const uint32_t *) inptr); \
+ \
+ if (__glibc_likely (wc <= 0x7f)) \
+ { \
+ /* Single UTF-8 char. */ \
+ *outptr = (uint8_t)wc; \
+ outptr++; \
+ } \
+ else if (wc <= 0x7ff) \
+ { \
+ /* Two UTF-8 chars. */ \
+ if (__glibc_unlikely (outptr + 2 > outend)) \
+ { \
+ /* Overflow in the output buffer. */ \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ \
+ outptr[0] = 0xc0; \
+ outptr[0] |= wc >> 6; \
+ \
+ outptr[1] = 0x80; \
+ outptr[1] |= wc & 0x3f; \
+ \
+ outptr += 2; \
+ } \
+ else if (wc <= 0xffff) \
+ { \
+ /* Three UTF-8 chars. */ \
+ if (__glibc_unlikely (outptr + 3 > outend)) \
+ { \
+ /* Overflow in the output buffer. */ \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ if (wc >= 0xd800 && wc <= 0xdfff) \
+ { \
+ /* Do not accept UTF-16 surrogates. */ \
+ result = __GCONV_ILLEGAL_INPUT; \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ } \
+ outptr[0] = 0xe0; \
+ outptr[0] |= wc >> 12; \
+ \
+ outptr[1] = 0x80; \
+ outptr[1] |= (wc >> 6) & 0x3f; \
+ \
+ outptr[2] = 0x80; \
+ outptr[2] |= wc & 0x3f; \
+ \
+ outptr += 3; \
+ } \
+ else if (wc <= 0x10ffff) \
+ { \
+ /* Four UTF-8 chars. */ \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
+ { \
+ /* Overflow in the output buffer. */ \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ outptr[0] = 0xf0; \
+ outptr[0] |= wc >> 18; \
+ \
+ outptr[1] = 0x80; \
+ outptr[1] |= (wc >> 12) & 0x3f; \
+ \
+ outptr[2] = 0x80; \
+ outptr[2] |= (wc >> 6) & 0x3f; \
+ \
+ outptr[3] = 0x80; \
+ outptr[3] |= wc & 0x3f; \
+ \
+ outptr += 4; \
+ } \
+ else \
+ { \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ } \
+ inptr += 4; \
+ }
+
+/* Generate loop-function with software routing. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
+# define TO_LOOP_C __to_utf8_loop_c
+# define LOOPFCT TO_LOOP_C
+# define BODY BODY_TO_C
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+#else
+# define TO_LOOP_C NULL
+#endif /* HAVE_TO_C != 1 */
+
+#if HAVE_TO_VX == 1
+/* The hardware routine uses the S/390 vector instructions. */
+# define BODY_TO_VX \
+ { \
+ size_t inlen = inend - inptr; \
+ size_t outlen = outend - outptr; \
+ unsigned long tmp, tmp2, tmp3; \
+ asm volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ " vleif %%v20,127,0\n\t" /* element 0: 127 */ \
+ " vzero %%v21\n\t" \
+ " vleih %%v21,8192,0\n\t" /* element 0: > */ \
+ " vleih %%v21,-8192,2\n\t" /* element 1: =<> */ \
+ CONVERT_32BIT_SIZE_T ([R_INLEN]) \
+ CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
+ /* Loop which handles UTF-32 chars <=0x7f. */ \
+ "0: clgijl %[R_INLEN],64,2f\n\t" \
+ " clgijl %[R_OUTLEN],16,2f\n\t" \
+ "1: vlm %%v16,%%v19,0(%[R_IN])\n\t" \
+ " lghi %[R_TMP2],0\n\t" \
+ /* Shorten to byte values. */ \
+ " vpkf %%v23,%%v16,%%v17\n\t" \
+ " vpkf %%v24,%%v18,%%v19\n\t" \
+ " vpkh %%v23,%%v23,%%v24\n\t" \
+ /* Checking for values > 0x7f. */ \
+ " vstrcfs %%v22,%%v16,%%v20,%%v21\n\t" \
+ " jno 10f\n\t" \
+ " vstrcfs %%v22,%%v17,%%v20,%%v21\n\t" \
+ " jno 11f\n\t" \
+ " vstrcfs %%v22,%%v18,%%v20,%%v21\n\t" \
+ " jno 12f\n\t" \
+ " vstrcfs %%v22,%%v19,%%v20,%%v21\n\t" \
+ " jno 13f\n\t" \
+ /* Store 16bytes to outptr. */ \
+ " vst %%v23,0(%[R_OUT])\n\t" \
+ " aghi %[R_INLEN],-64\n\t" \
+ " aghi %[R_OUTLEN],-16\n\t" \
+ " la %[R_IN],64(%[R_IN])\n\t" \
+ " la %[R_OUT],16(%[R_OUT])\n\t" \
+ " clgijl %[R_INLEN],64,2f\n\t" \
+ " clgijl %[R_OUTLEN],16,2f\n\t" \
+ " j 1b\n\t" \
+ /* Found a value > 0x7f. */ \
+ "13: ahi %[R_TMP2],4\n\t" \
+ "12: ahi %[R_TMP2],4\n\t" \
+ "11: ahi %[R_TMP2],4\n\t" \
+ "10: vlgvb %[R_TMP],%%v22,7\n\t" \
+ " srlg %[R_TMP],%[R_TMP],2\n\t" \
+ " agr %[R_TMP],%[R_TMP2]\n\t" \
+ " je 16f\n\t" \
+ /* Store characters before invalid one... */ \
+ " slgr %[R_OUTLEN],%[R_TMP]\n\t" \
+ "15: aghi %[R_TMP],-1\n\t" \
+ " vstl %%v23,%[R_TMP],0(%[R_OUT])\n\t" \
+ /* ... and update pointers. */ \
+ " aghi %[R_TMP],1\n\t" \
+ " la %[R_OUT],0(%[R_TMP],%[R_OUT])\n\t" \
+ " sllg %[R_TMP2],%[R_TMP],2\n\t" \
+ " la %[R_IN],0(%[R_TMP2],%[R_IN])\n\t" \
+ " slgr %[R_INLEN],%[R_TMP2]\n\t" \
+ /* Calculate remaining uint32_t values in loaded vrs. */ \
+ "16: lghi %[R_TMP2],16\n\t" \
+ " sgr %[R_TMP2],%[R_TMP]\n\t" \
+ " l %[R_TMP],0(%[R_IN])\n\t" \
+ " aghi %[R_INLEN],-4\n\t" \
+ " j 22f\n\t" \
+ /* Handle remaining bytes. */ \
+ "2: clgije %[R_INLEN],0,99f\n\t" \
+ " clgijl %[R_INLEN],4,92f\n\t" \
+ /* Calculate remaining uint32_t values in inptr. */ \
+ " srlg %[R_TMP2],%[R_INLEN],2\n\t" \
+ /* Handle multibyte utf8-char. */ \
+ "20: l %[R_TMP],0(%[R_IN])\n\t" \
+ " aghi %[R_INLEN],-4\n\t" \
+ /* Test if ch is 1byte UTF-8 char. */ \
+ "21: clijh %[R_TMP],0x7f,22f\n\t" \
+ /* Handle 1-byte UTF-8 char. */ \
+ "31: slgfi %[R_OUTLEN],1\n\t" \
+ " jl 90f \n\t" \
+ " stc %[R_TMP],0(%[R_OUT])\n\t" \
+ " la %[R_IN],4(%[R_IN])\n\t" \
+ " la %[R_OUT],1(%[R_OUT])\n\t" \
+ " brctg %[R_TMP2],20b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ /* Test if ch is 2byte UTF-8 char. */ \
+ "22: clfi %[R_TMP],0x7ff\n\t" \
+ " jh 23f\n\t" \
+ /* Handle 2-byte UTF-8 char. */ \
+ "32: slgfi %[R_OUTLEN],2\n\t" \
+ " jl 90f \n\t" \
+ " llill %[R_TMP3],0xc080\n\t" \
+ " risbgn %[R_TMP3],%[R_TMP],51,55,2\n\t" /* 1. byte. */ \
+ " risbgn %[R_TMP3],%[R_TMP],58,63,0\n\t" /* 2. byte. */ \
+ " sth %[R_TMP3],0(%[R_OUT])\n\t" \
+ " la %[R_IN],4(%[R_IN])\n\t" \
+ " la %[R_OUT],2(%[R_OUT])\n\t" \
+ " brctg %[R_TMP2],20b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ /* Test if ch is 3-byte UTF-8 char. */ \
+ "23: clfi %[R_TMP],0xffff\n\t" \
+ " jh 24f\n\t" \
+ /* Handle 3-byte UTF-8 char. */ \
+ "33: slgfi %[R_OUTLEN],3\n\t" \
+ " jl 90f \n\t" \
+ " llilf %[R_TMP3],0xe08080\n\t" \
+ " risbgn %[R_TMP3],%[R_TMP],44,47,4\n\t" /* 1. byte. */ \
+ " risbgn %[R_TMP3],%[R_TMP],50,55,2\n\t" /* 2. byte. */ \
+ " risbgn %[R_TMP3],%[R_TMP],58,63,0\n\t" /* 3. byte. */ \
+ /* Test if ch is a UTF-16 surrogate: ch & 0xf800 == 0xd800 */ \
+ " nilf %[R_TMP],0xf800\n\t" \
+ " clfi %[R_TMP],0xd800\n\t" \
+ " je 91f\n\t" /* Do not accept UTF-16 surrogates. */ \
+ " stcm %[R_TMP3],7,0(%[R_OUT])\n\t" \
+ " la %[R_IN],4(%[R_IN])\n\t" \
+ " la %[R_OUT],3(%[R_OUT])\n\t" \
+ " brctg %[R_TMP2],20b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ /* Test if ch is 4-byte UTF-8 char. */ \
+ "24: clfi %[R_TMP],0x10ffff\n\t" \
+ " jh 91f\n\t" /* ch > 0x10ffff is not allowed! */ \
+ /* Handle 4-byte UTF-8 char. */ \
+ "34: slgfi %[R_OUTLEN],4\n\t" \
+ " jl 90f \n\t" \
+ " llilf %[R_TMP3],0xf0808080\n\t" \
+ " risbgn %[R_TMP3],%[R_TMP],37,39,6\n\t" /* 1. byte. */ \
+ " risbgn %[R_TMP3],%[R_TMP],42,47,4\n\t" /* 2. byte. */ \
+ " risbgn %[R_TMP3],%[R_TMP],50,55,2\n\t" /* 3. byte. */ \
+ " risbgn %[R_TMP3],%[R_TMP],58,63,0\n\t" /* 4. byte. */ \
+ " st %[R_TMP3],0(%[R_OUT])\n\t" \
+ " la %[R_IN],4(%[R_IN])\n\t" \
+ " la %[R_OUT],4(%[R_OUT])\n\t" \
+ " brctg %[R_TMP2],20b\n\t" \
+ " j 0b\n\t" /* Switch to vx-loop. */ \
+ "92: lghi %[R_RES],%[RES_IN_FULL]\n\t" \
+ " j 99f\n\t" \
+ "91: lghi %[R_RES],%[RES_IN_ILL]\n\t" \
+ " j 99f\n\t" \
+ "90: lghi %[R_RES],%[RES_OUT_FULL]\n\t" \
+ "99: \n\t" \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (inptr) \
+ , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (outptr) \
+ , [R_OUTLEN] "+d" (outlen), [R_TMP] "=a" (tmp) \
+ , [R_TMP2] "=a" (tmp2), [R_TMP3] "=d" (tmp3) \
+ , [R_RES] "+d" (result) \
+ : /* inputs */ \
+ [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \
+ , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \
+ , [RES_IN_FULL] "i" (__GCONV_INCOMPLETE_INPUT) \
+ : /* clobber list */ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v20") ASM_CLOBBER_VR ("v21") \
+ ASM_CLOBBER_VR ("v22") ASM_CLOBBER_VR ("v23") \
+ ASM_CLOBBER_VR ("v24") \
+ ); \
+ if (__glibc_likely (inptr == inend) \
+ || result != __GCONV_ILLEGAL_INPUT) \
+ break; \
+ \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ }
+
+/* Generate loop-function with hardware vector instructions. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
+# define TO_LOOP_VX __to_utf8_loop_vx
+# define LOOPFCT TO_LOOP_VX
+# define BODY BODY_TO_VX
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+#else
+# define TO_LOOP_VX NULL
+#endif /* HAVE_TO_VX != 1 */
+
+#if HAVE_TO_VX_CU == 1
+#define BODY_TO_VX_CU \
+ { \
+ register const unsigned char* pInput asm ("8") = inptr; \
+ register size_t inlen asm ("9") = inend - inptr; \
+ register unsigned char* pOutput asm ("10") = outptr; \
+ register size_t outlen asm ("11") = outend - outptr; \
+ unsigned long tmp, tmp2; \
+ asm volatile (".machine push\n\t" \
+ ".machine \"z13\"\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ " vleif %%v20,127,0\n\t" /* element 0: 127 */ \
+ " vzero %%v21\n\t" \
+ " vleih %%v21,8192,0\n\t" /* element 0: > */ \
+ " vleih %%v21,-8192,2\n\t" /* element 1: =<> */ \
+ CONVERT_32BIT_SIZE_T ([R_INLEN]) \
+ CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
+ /* Loop which handles UTF-32 chars <= 0x7f. */ \
+ "0: clgijl %[R_INLEN],64,20f\n\t" \
+ " clgijl %[R_OUTLEN],16,20f\n\t" \
+ "1: vlm %%v16,%%v19,0(%[R_IN])\n\t" \
+ " lghi %[R_TMP],0\n\t" \
+ /* Shorten to byte values. */ \
+ " vpkf %%v23,%%v16,%%v17\n\t" \
+ " vpkf %%v24,%%v18,%%v19\n\t" \
+ " vpkh %%v23,%%v23,%%v24\n\t" \
+ /* Checking for values > 0x7f. */ \
+ " vstrcfs %%v22,%%v16,%%v20,%%v21\n\t" \
+ " jno 10f\n\t" \
+ " vstrcfs %%v22,%%v17,%%v20,%%v21\n\t" \
+ " jno 11f\n\t" \
+ " vstrcfs %%v22,%%v18,%%v20,%%v21\n\t" \
+ " jno 12f\n\t" \
+ " vstrcfs %%v22,%%v19,%%v20,%%v21\n\t" \
+ " jno 13f\n\t" \
+ /* Store 16bytes to outptr. */ \
+ " vst %%v23,0(%[R_OUT])\n\t" \
+ " aghi %[R_INLEN],-64\n\t" \
+ " aghi %[R_OUTLEN],-16\n\t" \
+ " la %[R_IN],64(%[R_IN])\n\t" \
+ " la %[R_OUT],16(%[R_OUT])\n\t" \
+ " clgijl %[R_INLEN],64,20f\n\t" \
+ " clgijl %[R_OUTLEN],16,20f\n\t" \
+ " j 1b\n\t" \
+ /* Found a value > 0x7f. */ \
+ "13: ahi %[R_TMP],4\n\t" \
+ "12: ahi %[R_TMP],4\n\t" \
+ "11: ahi %[R_TMP],4\n\t" \
+ "10: vlgvb %[R_I],%%v22,7\n\t" \
+ " srlg %[R_I],%[R_I],2\n\t" \
+ " agr %[R_I],%[R_TMP]\n\t" \
+ " je 20f\n\t" \
+ /* Store characters before invalid one... */ \
+ " slgr %[R_OUTLEN],%[R_I]\n\t" \
+ "15: aghi %[R_I],-1\n\t" \
+ " vstl %%v23,%[R_I],0(%[R_OUT])\n\t" \
+ /* ... and update pointers. */ \
+ " aghi %[R_I],1\n\t" \
+ " la %[R_OUT],0(%[R_I],%[R_OUT])\n\t" \
+ " sllg %[R_I],%[R_I],2\n\t" \
+ " la %[R_IN],0(%[R_I],%[R_IN])\n\t" \
+ " slgr %[R_INLEN],%[R_I]\n\t" \
+ /* Handle multibyte utf8-char with convert instruction. */ \
+ "20: cu41 %[R_OUT],%[R_IN]\n\t" \
+ " jo 0b\n\t" /* Try vector implemenation again. */ \
+ " lochil %[R_RES],%[RES_OUT_FULL]\n\t" /* cc == 1. */ \
+ " lochih %[R_RES],%[RES_IN_ILL]\n\t" /* cc == 2. */ \
+ ".machine pop" \
+ : /* outputs */ [R_IN] "+a" (pInput) \
+ , [R_INLEN] "+d" (inlen), [R_OUT] "+a" (pOutput) \
+ , [R_OUTLEN] "+d" (outlen), [R_TMP] "=d" (tmp) \
+ , [R_I] "=a" (tmp2) \
+ , [R_RES] "+d" (result) \
+ : /* inputs */ \
+ [RES_OUT_FULL] "i" (__GCONV_FULL_OUTPUT) \
+ , [RES_IN_ILL] "i" (__GCONV_ILLEGAL_INPUT) \
+ : /* clobber list */ "memory", "cc" \
+ ASM_CLOBBER_VR ("v16") ASM_CLOBBER_VR ("v17") \
+ ASM_CLOBBER_VR ("v18") ASM_CLOBBER_VR ("v19") \
+ ASM_CLOBBER_VR ("v20") ASM_CLOBBER_VR ("v21") \
+ ASM_CLOBBER_VR ("v22") ASM_CLOBBER_VR ("v23") \
+ ASM_CLOBBER_VR ("v24") \
+ ); \
+ inptr = pInput; \
+ outptr = pOutput; \
+ \
+ if (__glibc_likely (inptr == inend) \
+ || result == __GCONV_FULL_OUTPUT) \
+ break; \
+ if (inptr + 4 > inend) \
+ { \
+ result = __GCONV_INCOMPLETE_INPUT; \
+ break; \
+ } \
+ STANDARD_TO_LOOP_ERR_HANDLER (4); \
+ }
+
+/* Generate loop-function with hardware vector and utf-convert instructions. */
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
+# define TO_LOOP_VX_CU __to_utf8_loop_vx_cu
+# define LOOPFCT TO_LOOP_VX_CU
+# define BODY BODY_TO_VX_CU
+# define LOOP_NEED_FLAGS
+# include <iconv/loop.c>
+#else
+# define TO_LOOP_VX_CU NULL
+#endif /* HAVE_TO_VX_CU != 1 */
+
+/* This file also exists in sysdeps/s390/multiarch/ which
+ generates ifunc resolvers for FROM/TO_LOOP functions
+ and includes iconv/skeleton.c afterwards. */
+#if ! defined USE_MULTIARCH
+# include <iconv/skeleton.c>
+#endif
diff --git a/sysdeps/sh/Implies b/sysdeps/sh/Implies
index 1fdc53d034..780c4e2467 100644
--- a/sysdeps/sh/Implies
+++ b/sysdeps/sh/Implies
@@ -1,4 +1,3 @@
-sh/soft-fp
wordsize-32
ieee754/flt-32
ieee754/dbl-64
diff --git a/sysdeps/sh/Makefile b/sysdeps/sh/Makefile
index 0c6db9a9d4..de8fa0bc0e 100644
--- a/sysdeps/sh/Makefile
+++ b/sysdeps/sh/Makefile
@@ -5,7 +5,3 @@ endif
ifeq ($(subdir),gmon)
sysdep_routines += _mcount
endif
-
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
diff --git a/sysdeps/sh/____longjmp_chk.S b/sysdeps/sh/____longjmp_chk.S
index 149c19c661..dec3924327 100644
--- a/sysdeps/sh/____longjmp_chk.S
+++ b/sysdeps/sh/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/_mcount.S b/sysdeps/sh/_mcount.S
index 74fbf19a50..8b08959b55 100644
--- a/sysdeps/sh/_mcount.S
+++ b/sysdeps/sh/_mcount.S
@@ -1,5 +1,5 @@
/* Machine-specific calling sequence for `mcount' profiling function. SuperH
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by NIIBE Yutaka <gniibe@m17n.org>
This file is part of the GNU C Library.
diff --git a/sysdeps/sh/backtrace.c b/sysdeps/sh/backtrace.c
deleted file mode 100644
index 4f3eafb09c..0000000000
--- a/sysdeps/sh/backtrace.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../x86_64/backtrace.c"
diff --git a/sysdeps/sh/bits/fenv.h b/sysdeps/sh/bits/fenv.h
index 254c50fb97..56e9ffad0d 100644
--- a/sysdeps/sh/bits/fenv.h
+++ b/sysdeps/sh/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/bits/huge_val.h b/sysdeps/sh/bits/huge_val.h
deleted file mode 100644
index a92e31e783..0000000000
--- a/sysdeps/sh/bits/huge_val.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- SH version.
- Copyright (C) 1992-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/huge_val.h> directly; include <math.h> instead."
-#endif
-
-/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VAL (__builtin_huge_val())
-#elif __GNUC_PREREQ(2,96)
-# define HUGE_VAL (__extension__ 0x1.0p2047)
-#elif defined __GNUC__
-
-# define HUGE_VAL \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
- { __l: 0x000000007ff00000ULL }).__d)
-
-#else /* not GCC */
-
-# include <endian.h>
-
-typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
-
-# if __BYTE_ORDER == __BIG_ENDIAN
-# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0x7f, 0xf0, 0, 0 }
-# endif
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __HUGE_VAL_bytes { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 }
-# endif
-
-static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
-# define HUGE_VAL (__huge_val.__d)
-
-#endif /* GCC. */
diff --git a/sysdeps/sh/bits/link.h b/sysdeps/sh/bits/link.h
index 8e5d83cb71..f153cc3632 100644
--- a/sysdeps/sh/bits/link.h
+++ b/sysdeps/sh/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/bits/setjmp.h b/sysdeps/sh/bits/setjmp.h
index d1cf8f624c..6f45edc4f7 100644
--- a/sysdeps/sh/bits/setjmp.h
+++ b/sysdeps/sh/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/bsd-_setjmp.S b/sysdeps/sh/bsd-_setjmp.S
index ddd9523135..b75d1a3f15 100644
--- a/sysdeps/sh/bsd-_setjmp.S
+++ b/sysdeps/sh/bsd-_setjmp.S
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. SH version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/bsd-setjmp.S b/sysdeps/sh/bsd-setjmp.S
index bd57a5ae8d..7732de45ee 100644
--- a/sysdeps/sh/bsd-setjmp.S
+++ b/sysdeps/sh/bsd-setjmp.S
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. SH version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/crti.S b/sysdeps/sh/crti.S
index ca56c333d9..c0707406f5 100644
--- a/sysdeps/sh/crti.S
+++ b/sysdeps/sh/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for SH.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,6 +58,7 @@
.section .init,"ax",@progbits
.align 5
.global _init
+ .hidden _init
.type _init, @function
_init:
mov.l r12,@-r15
@@ -103,6 +104,7 @@ _init:
.section .fini,"ax",@progbits
.align 5
.global _fini
+ .hidden _fini
.type _fini, @function
_fini:
mov.l r12,@-r15
diff --git a/sysdeps/sh/crtn.S b/sysdeps/sh/crtn.S
index 870924bf93..138ae9a58a 100644
--- a/sysdeps/sh/crtn.S
+++ b/sysdeps/sh/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for SH.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/dl-machine.h b/sysdeps/sh/dl-machine.h
index 5bb37d0ccb..d85f40f1a7 100644
--- a/sysdeps/sh/dl-machine.h
+++ b/sysdeps/sh/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. SH version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -230,6 +230,7 @@ dl_platform_init (void)
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
@@ -319,7 +320,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *const refsym = sym;
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ value = SYMBOL_ADDRESS (sym_map, sym, true);
value += reloc->r_addend;
switch (r_type)
@@ -389,7 +390,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
break;
case R_SH_DIR32:
{
-#ifndef RTLD_BOOTSTRAP
+#if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP
/* This is defined in rtld.c, but nowhere in the static
libc.a; make the reference weak so static programs can
still link. This declaration cannot be done when
@@ -405,7 +406,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
binding found in the user program or a loaded library
rather than the dynamic linker's built-in definitions
used while loading those libraries. */
- value -= map->l_addr + refsym->st_value + reloc->r_addend;
+ value -= SYMBOL_ADDRESS (map, refsym, true) + reloc->r_addend;
#endif
COPY_UNALIGNED_WORD (&value, reloc_addr_arg,
(int) reloc_addr_arg & 3);
diff --git a/sysdeps/sh/dl-tls.h b/sysdeps/sh/dl-tls.h
index 276ec54760..b2102a9472 100644
--- a/sysdeps/sh/dl-tls.h
+++ b/sysdeps/sh/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. SH version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,3 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/sh/dl-trampoline.S b/sysdeps/sh/dl-trampoline.S
index 09bbf79fb7..0c8f84d26d 100644
--- a/sysdeps/sh/dl-trampoline.S
+++ b/sysdeps/sh/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. SH version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/fpu_control.h b/sysdeps/sh/fpu_control.h
index b8b048c659..7f220faf97 100644
--- a/sysdeps/sh/fpu_control.h
+++ b/sysdeps/sh/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word definitions. SH version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/gccframe.h b/sysdeps/sh/gccframe.h
index a08dd1d17b..a89e8220c8 100644
--- a/sysdeps/sh/gccframe.h
+++ b/sysdeps/sh/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. sh version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/gmp-mparam.h b/sysdeps/sh/gmp-mparam.h
index 4bce2300a2..94c09894a1 100644
--- a/sysdeps/sh/gmp-mparam.h
+++ b/sysdeps/sh/gmp-mparam.h
@@ -1,6 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright (C) 1991-2016 Free Software Foundation, Inc.
+Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/sh/jmpbuf-offsets.h b/sysdeps/sh/jmpbuf-offsets.h
index bf5d8a240d..0d2fdc66ba 100644
--- a/sysdeps/sh/jmpbuf-offsets.h
+++ b/sysdeps/sh/jmpbuf-offsets.h
@@ -1,5 +1,5 @@
/* Private macros for accessing __jmp_buf contents. SH version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/jmpbuf-unwind.h b/sysdeps/sh/jmpbuf-unwind.h
index 8c55c2d218..65ee3dbf96 100644
--- a/sysdeps/sh/jmpbuf-unwind.h
+++ b/sysdeps/sh/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/sh/ldbl-classify-compat.h b/sysdeps/sh/ldbl-classify-compat.h
new file mode 100644
index 0000000000..d3b978cdff
--- /dev/null
+++ b/sysdeps/sh/ldbl-classify-compat.h
@@ -0,0 +1,8 @@
+#ifndef SH_LDBL_CLASSIFY_COMPAT_H
+#define SH_LDBL_CLASSIFY_COMPAT_H 1
+
+/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
+ when built without long double support. */
+#define LDBL_CLASSIFY_COMPAT 1
+
+#endif
diff --git a/sysdeps/sh/ldsodefs.h b/sysdeps/sh/ldsodefs.h
index 6f84842479..964dda39c7 100644
--- a/sysdeps/sh/ldsodefs.h
+++ b/sysdeps/sh/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/libc-tls.c b/sysdeps/sh/libc-tls.c
index aee6ff370c..da9aab27cb 100644
--- a/sysdeps/sh/libc-tls.c
+++ b/sysdeps/sh/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. SH version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/libm-test-ulps b/sysdeps/sh/libm-test-ulps
index 4c43510849..d614decfb1 100644
--- a/sysdeps/sh/libm-test-ulps
+++ b/sysdeps/sh/libm-test-ulps
@@ -1,13 +1,31 @@
# Begin of automatic generation
# Maximal error of functions:
-Function: "acos_towardzero":
+Function: "acos":
float: 1
ifloat: 1
-Function: "acosh":
+Function: "acos_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
+
+Function: "acosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asin":
+float: 1
+ifloat: 1
Function: "asin_towardzero":
double: 1
@@ -18,16 +36,55 @@ ifloat: 1
Function: "asinh":
double: 1
float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "atan":
+float: 1
ifloat: 1
Function: "atan2":
float: 1
ifloat: 1
-Function: "atanh":
+Function: "atan2_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan_towardzero":
+double: 1
float: 1
+idouble: 1
ifloat: 1
+Function: "atanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "cabs":
+double: 1
+idouble: 1
+
+Function: "cabs_towardzero":
+double: 1
+idouble: 1
+
Function: Real part of "cacos":
double: 1
float: 2
@@ -35,18 +92,52 @@ idouble: 1
ifloat: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cacos_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Imaginary part of "cacos_towardzero":
+double: 4
+float: 2
+idouble: 4
ifloat: 2
Function: Real part of "cacosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacosh":
double: 1
float: 2
idouble: 1
ifloat: 2
-Function: Imaginary part of "cacosh":
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "carg":
+float: 1
+ifloat: 1
+
+Function: "carg_towardzero":
double: 1
float: 2
idouble: 1
@@ -59,15 +150,27 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
+ifloat: 2
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: Imaginary part of "casin_towardzero":
+double: 4
+float: 2
+idouble: 4
ifloat: 2
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
Function: Imaginary part of "casinh":
@@ -76,8 +179,22 @@ float: 1
idouble: 1
ifloat: 1
+Function: Real part of "casinh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Imaginary part of "catan":
@@ -86,6 +203,18 @@ float: 1
idouble: 1
ifloat: 1
+Function: Real part of "catan_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "catan_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
Function: Real part of "catanh":
double: 1
float: 1
@@ -93,13 +222,33 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-Function: "cbrt":
+Function: Real part of "catanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "catanh_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
+ifloat: 2
+
+Function: "cbrt":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+idouble: 3
ifloat: 1
Function: Real part of "ccos":
@@ -114,6 +263,18 @@ float: 1
idouble: 1
ifloat: 1
+Function: Real part of "ccos_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccos_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
Function: Real part of "ccosh":
double: 1
float: 1
@@ -126,6 +287,18 @@ float: 1
idouble: 1
ifloat: 1
+Function: Real part of "ccosh_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
Function: Real part of "cexp":
double: 2
float: 1
@@ -138,49 +311,77 @@ float: 2
idouble: 1
ifloat: 2
-Function: Real part of "clog":
+Function: Real part of "cexp_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Real part of "clog":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
Function: Imaginary part of "clog":
float: 1
ifloat: 1
Function: Real part of "clog10":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: Imaginary part of "clog10":
double: 2
float: 2
idouble: 2
ifloat: 2
-Function: Imaginary part of "clog10":
+Function: Real part of "clog10_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: Imaginary part of "clog10_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "clog_towardzero":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Imaginary part of "clog_towardzero":
double: 1
-float: 1
+float: 3
idouble: 1
-ifloat: 1
+ifloat: 3
Function: "cos":
-float: 1
-ifloat: 1
-
-Function: "cos_tonearest":
-float: 1
-ifloat: 1
-
-Function: "cos_towardzero":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: "cosh":
+Function: "cos_towardzero":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: "cosh_tonearest":
+Function: "cosh":
double: 1
float: 1
idouble: 1
@@ -194,65 +395,101 @@ ifloat: 1
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
Function: Imaginary part of "cpow":
float: 2
ifloat: 2
-Function: Real part of "csin":
+Function: Real part of "cpow_towardzero":
+double: 4
+float: 8
+idouble: 4
+ifloat: 8
+
+Function: Imaginary part of "cpow_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
-
-Function: Real part of "csinh":
-float: 1
-ifloat: 1
+ifloat: 2
-Function: Imaginary part of "csinh":
+Function: Real part of "csin":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: Real part of "csqrt":
+Function: Real part of "csin_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Imaginary part of "csin_towardzero":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: Imaginary part of "csqrt":
-double: 1
+Function: Real part of "csinh":
float: 1
-idouble: 1
ifloat: 1
-Function: Real part of "ctan":
+Function: Imaginary part of "csinh":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: Imaginary part of "ctan":
+Function: Real part of "csinh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
+
+Function: Imaginary part of "csinh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Real part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
-Function: Real part of "ctan_tonearest":
+Function: Real part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Real part of "ctan":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: Imaginary part of "ctan_tonearest":
+Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: Real part of "ctan_towardzero":
double: 5
@@ -268,23 +505,11 @@ ifloat: 3
Function: Real part of "ctanh":
double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: Imaginary part of "ctanh":
-double: 2
float: 2
idouble: 2
ifloat: 2
-Function: Real part of "ctanh_tonearest":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: Imaginary part of "ctanh_tonearest":
+Function: Imaginary part of "ctanh":
double: 2
float: 2
idouble: 2
@@ -304,37 +529,53 @@ ifloat: 3
Function: "erf":
double: 1
+float: 1
idouble: 1
+ifloat: 1
-Function: "erfc":
+Function: "erf_towardzero":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: "exp10":
-double: 1
-idouble: 1
+Function: "erfc":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
-Function: "exp10_tonearest":
-double: 1
-idouble: 1
+Function: "erfc_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "exp10":
+double: 2
+idouble: 2
Function: "exp10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp2":
double: 1
idouble: 1
-Function: "exp_towardzero":
+Function: "exp2_towardzero":
double: 1
idouble: 1
-Function: "expm1":
+Function: "exp_towardzero":
double: 1
float: 1
idouble: 1
ifloat: 1
-Function: "expm1_tonearest":
+Function: "expm1":
double: 1
float: 1
idouble: 1
@@ -342,21 +583,31 @@ ifloat: 1
Function: "expm1_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Function: "fma_towardzero":
double: 1
idouble: 1
Function: "gamma":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: "gamma_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: "hypot":
double: 1
-float: 1
idouble: 1
-ifloat: 1
-Function: "hypot":
+Function: "hypot_towardzero":
double: 1
idouble: 1
@@ -366,60 +617,102 @@ float: 2
idouble: 2
ifloat: 2
+Function: "j0_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
Function: "j1":
double: 1
float: 2
idouble: 1
ifloat: 2
+Function: "j1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
Function: "jn":
double: 4
float: 4
idouble: 4
ifloat: 4
+Function: "jn_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
Function: "lgamma":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: "lgamma_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
Function: "log":
float: 1
ifloat: 1
Function: "log10":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
-Function: "log1p":
+Function: "log10_towardzero":
+double: 2
float: 1
+idouble: 2
ifloat: 1
-Function: "pow":
+Function: "log1p":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-Function: "pow10":
-double: 1
-idouble: 1
+Function: "log1p_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
-Function: "pow_tonearest":
+Function: "log2":
+double: 2
float: 1
+idouble: 2
ifloat: 1
-Function: "pow_towardzero":
+Function: "log2_towardzero":
+double: 2
+idouble: 2
+
+Function: "pow":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-Function: "sin":
+Function: "pow_towardzero":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-Function: "sin_tonearest":
+Function: "sin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: "sin_towardzero":
@@ -429,12 +722,32 @@ idouble: 1
ifloat: 1
Function: "sincos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-Function: "sinh_towardzero":
+Function: "sincos_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
+
+Function: "sinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "sinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tan":
+float: 1
+ifloat: 1
Function: "tan_towardzero":
double: 1
@@ -442,11 +755,29 @@ float: 1
idouble: 1
ifloat: 1
+Function: "tanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
Function: "tgamma":
-double: 4
-float: 3
-idouble: 4
-ifloat: 3
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "tgamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
Function: "y0":
double: 2
@@ -454,16 +785,34 @@ float: 1
idouble: 2
ifloat: 1
+Function: "y0_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
Function: "y1":
double: 3
float: 2
idouble: 3
ifloat: 2
-Function: "yn":
+Function: "y1_towardzero":
double: 3
float: 2
idouble: 3
ifloat: 2
+Function: "yn":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "yn_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
# end of automatic generation
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/machine-gmon.h b/sysdeps/sh/machine-gmon.h
index 917de968af..def170d632 100644
--- a/sysdeps/sh/machine-gmon.h
+++ b/sysdeps/sh/machine-gmon.h
@@ -1,5 +1,5 @@
/* Machine-dependent definitions for profiling support. SH version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/math_private.h b/sysdeps/sh/math_private.h
deleted file mode 100644
index d13f2d49d3..0000000000
--- a/sysdeps/sh/math_private.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef SH_MATH_PRIVATE_H
-#define SH_MATH_PRIVATE_H 1
-
-/* Enable __finitel, __isinfl, and __isnanl for binary compatibility
- when built without long double support. */
-#define LDBL_CLASSIFY_COMPAT 1
-
-#include_next <math_private.h>
-
-#endif
diff --git a/sysdeps/sh/memcpy.S b/sysdeps/sh/memcpy.S
index 3a9816d8d1..d89f8bace3 100644
--- a/sysdeps/sh/memcpy.S
+++ b/sysdeps/sh/memcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Optimized by Toshiyasu Morita <toshiyasu.morita@hsa.hitachi.com>
diff --git a/sysdeps/sh/memset.S b/sysdeps/sh/memset.S
index 50a42e06cf..8901253f8a 100644
--- a/sysdeps/sh/memset.S
+++ b/sysdeps/sh/memset.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Optimized by Toshiyasu Morita <toshiyasu.morita@hsa.hitachi.com>
diff --git a/sysdeps/sh/memusage.h b/sysdeps/sh/memusage.h
index 49a3ed10d6..1e0e1c64a2 100644
--- a/sysdeps/sh/memusage.h
+++ b/sysdeps/sh/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/nofpu/Implies b/sysdeps/sh/nofpu/Implies
new file mode 100644
index 0000000000..abcbadb25f
--- /dev/null
+++ b/sysdeps/sh/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/sh/nptl/bits/pthreadtypes-arch.h b/sysdeps/sh/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..d383d53ce5
--- /dev/null
+++ b/sysdeps/sh/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,71 @@
+/* Copyright (C) 2002-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <endian.h>
+
+#define __SIZEOF_PTHREAD_ATTR_T 36
+#define __SIZEOF_PTHREAD_MUTEX_T 24
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCK_T 32
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIER_T 20
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Definitions for internal mutex struct. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1
+#define __PTHREAD_MUTEX_USE_UNION 1
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+#else
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ unsigned char __shared;
+ unsigned char __pad1;
+ unsigned char __pad2;
+#endif
+ unsigned long int __cur_writer;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/sh/nptl/bits/pthreadtypes.h b/sysdeps/sh/nptl/bits/pthreadtypes.h
deleted file mode 100644
index 13fbd7379a..0000000000
--- a/sysdeps/sh/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/* Copyright (C) 2002-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 _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <endian.h>
-
-#define __SIZEOF_PTHREAD_ATTR_T 36
-#define __SIZEOF_PTHREAD_MUTEX_T 24
-#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-#define __SIZEOF_PTHREAD_COND_T 48
-#define __SIZEOF_PTHREAD_COND_COMPAT_T 12
-#define __SIZEOF_PTHREAD_CONDATTR_T 4
-#define __SIZEOF_PTHREAD_RWLOCK_T 32
-#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-#define __SIZEOF_PTHREAD_BARRIER_T 20
-#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-
-
-/* Thread identifiers. The structure of the attribute type is not
- exposed on purpose. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is not exposed on purpose. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- long int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- long int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
-#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned char __pad1;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
-#else
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- unsigned char __shared;
- unsigned char __pad1;
- unsigned char __pad2;
-#endif
- pthread_t __writer;
- } __data;
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/sh/nptl/bits/semaphore.h b/sysdeps/sh/nptl/bits/semaphore.h
index 1a1dae1ed6..2f906e0ecb 100644
--- a/sysdeps/sh/nptl/bits/semaphore.h
+++ b/sysdeps/sh/nptl/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/sh/nptl/pthread-offsets.h b/sysdeps/sh/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..9617354dc7
--- /dev/null
+++ b/sysdeps/sh/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+#define __PTHREAD_MUTEX_KIND_OFFSET 12
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 20
diff --git a/sysdeps/sh/nptl/pthread_spin_init.c b/sysdeps/sh/nptl/pthread_spin_init.c
index b9b33719fd..1c49df4f03 100644
--- a/sysdeps/sh/nptl/pthread_spin_init.c
+++ b/sysdeps/sh/nptl/pthread_spin_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/sh/nptl/pthread_spin_lock.c b/sysdeps/sh/nptl/pthread_spin_lock.c
index aaf2b23aab..343ec85f5c 100644
--- a/sysdeps/sh/nptl/pthread_spin_lock.c
+++ b/sysdeps/sh/nptl/pthread_spin_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/nptl/pthread_spin_trylock.S b/sysdeps/sh/nptl/pthread_spin_trylock.S
index aaa409c23a..c68b088629 100644
--- a/sysdeps/sh/nptl/pthread_spin_trylock.S
+++ b/sysdeps/sh/nptl/pthread_spin_trylock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/nptl/pthread_spin_unlock.S b/sysdeps/sh/nptl/pthread_spin_unlock.S
index f0cb20e3c5..7e75f83313 100644
--- a/sysdeps/sh/nptl/pthread_spin_unlock.S
+++ b/sysdeps/sh/nptl/pthread_spin_unlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/nptl/pthreaddef.h b/sysdeps/sh/nptl/pthreaddef.h
index 6a94868841..97c7e07100 100644
--- a/sysdeps/sh/nptl/pthreaddef.h
+++ b/sysdeps/sh/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/nptl/tcb-offsets.sym b/sysdeps/sh/nptl/tcb-offsets.sym
index ac63b5b93b..234207779d 100644
--- a/sysdeps/sh/nptl/tcb-offsets.sym
+++ b/sysdeps/sh/nptl/tcb-offsets.sym
@@ -4,13 +4,9 @@
RESULT offsetof (struct pthread, result)
TID offsetof (struct pthread, tid)
-PID offsetof (struct pthread, pid)
CANCELHANDLING offsetof (struct pthread, cancelhandling)
CLEANUP_JMP_BUF offsetof (struct pthread, cleanup_jmp_buf)
MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads)
TLS_PRE_TCB_SIZE sizeof (struct pthread)
MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock)
POINTER_GUARD offsetof (tcbhead_t, pointer_guard)
-#ifndef __ASSUME_PRIVATE_FUTEX
-PRIVATE_FUTEX offsetof (struct pthread, header.private_futex)
-#endif
diff --git a/sysdeps/sh/nptl/tls.h b/sysdeps/sh/nptl/tls.h
index 6f128c9e95..2585312f27 100644
--- a/sysdeps/sh/nptl/tls.h
+++ b/sysdeps/sh/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/SH version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,17 +28,7 @@
# include <stdlib.h>
# include <list.h>
# include <sysdep.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
typedef struct
{
@@ -151,6 +141,7 @@ typedef struct
((tcbhead_t *) (descr + 1))->pointer_guard = __tcbp->pointer_guard;})
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/sh/preconfigure b/sysdeps/sh/preconfigure
index c1f6537797..16e29273df 100644
--- a/sysdeps/sh/preconfigure
+++ b/sysdeps/sh/preconfigure
@@ -1,6 +1,12 @@
# preconfigure fragment for sh.
case "$machine" in
-sh3*) base_machine=sh machine=sh/sh3 ;;
-sh4*) base_machine=sh machine=sh/sh4 ;;
+sh3*) base_machine=sh
+ machine=sh/sh3
+ with_fp_cond="defined __SH_FPU_ANY__"
+ ;;
+sh4*) base_machine=sh
+ machine=sh/sh4
+ with_fp_cond="defined __SH_FPU_ANY__"
+ ;;
esac
diff --git a/sysdeps/sh/s_fma.c b/sysdeps/sh/s_fma.c
deleted file mode 100644
index d92438d448..0000000000
--- a/sysdeps/sh/s_fma.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef __SH_FPU_ANY__
-# include <sysdeps/ieee754/dbl-64/s_fma.c>
-#else
-# include <soft-fp/fmadf4.c>
-#endif
diff --git a/sysdeps/sh/s_fmaf.c b/sysdeps/sh/s_fmaf.c
deleted file mode 100644
index 3b811ae6da..0000000000
--- a/sysdeps/sh/s_fmaf.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef __SH_FPU_ANY__
-# include <sysdeps/ieee754/dbl-64/s_fmaf.c>
-#else
-# include <soft-fp/fmasf4.c>
-#endif
diff --git a/sysdeps/sh/soft-fp/sfp-machine.h b/sysdeps/sh/sfp-machine.h
index 81474e8a7c..81474e8a7c 100644
--- a/sysdeps/sh/soft-fp/sfp-machine.h
+++ b/sysdeps/sh/sfp-machine.h
diff --git a/sysdeps/sh/sh3/__longjmp.S b/sysdeps/sh/sh3/__longjmp.S
index d9c2e2fd9c..2c5eb9ca0f 100644
--- a/sysdeps/sh/sh3/__longjmp.S
+++ b/sysdeps/sh/sh3/__longjmp.S
@@ -1,5 +1,5 @@
/* longjmp for SH.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/sh3/setjmp.S b/sysdeps/sh/sh3/setjmp.S
index 4e484c34b2..ec6d96fa2b 100644
--- a/sysdeps/sh/sh3/setjmp.S
+++ b/sysdeps/sh/sh3/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for SH3.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -78,3 +78,4 @@ ENTRY (__sigsetjmp)
# endif
#endif
END (__sigsetjmp)
+hidden_def (__sigsetjmp)
diff --git a/sysdeps/sh/sh4/__longjmp.S b/sysdeps/sh/sh4/__longjmp.S
index e9a90f7ded..bcd1e7de40 100644
--- a/sysdeps/sh/sh4/__longjmp.S
+++ b/sysdeps/sh/sh4/__longjmp.S
@@ -1,5 +1,5 @@
/* longjmp for SH.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/sh4/bits/mathdef.h b/sysdeps/sh/sh4/bits/mathdef.h
deleted file mode 100644
index 90dbebb3fa..0000000000
--- a/sysdeps/sh/sh4/bits/mathdef.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* 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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-
-/* FIXME! This file describes properties of the compiler, not the machine;
- it should not be part of libc!
-
- FIXME! This file does not deal with the -fshort-double option of
- gcc! */
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* SH has both `float' and `double' arithmetic. */
-typedef float float_t;
-typedef double double_t;
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 0x80000001
-# define FP_ILOGBNAN 0x7fffffff
-
-#endif /* ISO C99 */
-
-#ifndef __NO_LONG_DOUBLE_MATH
-/* Signal that we do not really have a `long double'. The disables the
- declaration of all the `long double' function variants. */
-# define __NO_LONG_DOUBLE_MATH 1
-#endif
diff --git a/sysdeps/sh/sh4/fpu/fclrexcpt.c b/sysdeps/sh/sh4/fpu/fclrexcpt.c
index 60a62840d6..c83650a7e4 100644
--- a/sysdeps/sh/sh4/fpu/fclrexcpt.c
+++ b/sysdeps/sh/sh4/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
diff --git a/sysdeps/sh/sh4/fpu/fedisblxcpt.c b/sysdeps/sh/sh4/fpu/fedisblxcpt.c
index dc090ac23b..c7948f5f88 100644
--- a/sysdeps/sh/sh4/fpu/fedisblxcpt.c
+++ b/sysdeps/sh/sh4/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012.
diff --git a/sysdeps/sh/sh4/fpu/feenablxcpt.c b/sysdeps/sh/sh4/fpu/feenablxcpt.c
index 7b1bb5f1f2..f9e24d7780 100644
--- a/sysdeps/sh/sh4/fpu/feenablxcpt.c
+++ b/sysdeps/sh/sh4/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012.
diff --git a/sysdeps/sh/sh4/fpu/fegetenv.c b/sysdeps/sh/sh4/fpu/fegetenv.c
index ae2fd927bf..138b09b54b 100644
--- a/sysdeps/sh/sh4/fpu/fegetenv.c
+++ b/sysdeps/sh/sh4/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/sh4/fpu/fegetexcept.c b/sysdeps/sh/sh4/fpu/fegetexcept.c
index e5d3cbeae6..2181546b62 100644
--- a/sysdeps/sh/sh4/fpu/fegetexcept.c
+++ b/sysdeps/sh/sh4/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012.
diff --git a/sysdeps/sh/sh4/fpu/fegetmode.c b/sysdeps/sh/sh4/fpu/fegetmode.c
new file mode 100644
index 0000000000..516a881409
--- /dev/null
+++ b/sysdeps/sh/sh4/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. SH4 version.
+ Copyright (C) 2016-2018 Free Software 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/fegetround.c b/sysdeps/sh/sh4/fpu/fegetround.c
index 64cf868fb6..fafba2dc36 100644
--- a/sysdeps/sh/sh4/fpu/fegetround.c
+++ b/sysdeps/sh/sh4/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
diff --git a/sysdeps/sh/sh4/fpu/feholdexcpt.c b/sysdeps/sh/sh4/fpu/feholdexcpt.c
index 09c10917fc..6f2d024efc 100644
--- a/sysdeps/sh/sh4/fpu/feholdexcpt.c
+++ b/sysdeps/sh/sh4/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/sh4/fpu/fesetenv.c b/sysdeps/sh/sh4/fpu/fesetenv.c
index de0440ec97..241c2559fc 100644
--- a/sysdeps/sh/sh4/fpu/fesetenv.c
+++ b/sysdeps/sh/sh4/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/sh4/fpu/fesetexcept.c b/sysdeps/sh/sh4/fpu/fesetexcept.c
new file mode 100644
index 0000000000..9ce7ef6bbc
--- /dev/null
+++ b/sysdeps/sh/sh4/fpu/fesetexcept.c
@@ -0,0 +1,32 @@
+/* Set given exception flags. SH4 version.
+ Copyright (C) 2016-2018 Free Software 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..a54f5dd8b1
--- /dev/null
+++ b/sysdeps/sh/sh4/fpu/fesetmode.c
@@ -0,0 +1,38 @@
+/* Install given floating-point control modes. SH4 version.
+ Copyright (C) 2016-2018 Free Software 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/sh/sh4/fpu/fesetround.c b/sysdeps/sh/sh4/fpu/fesetround.c
index 6300b5a870..3248c9609e 100644
--- a/sysdeps/sh/sh4/fpu/fesetround.c
+++ b/sysdeps/sh/sh4/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
diff --git a/sysdeps/sh/sh4/fpu/feupdateenv.c b/sysdeps/sh/sh4/fpu/feupdateenv.c
index 4283162089..4a95951802 100644
--- a/sysdeps/sh/sh4/fpu/feupdateenv.c
+++ b/sysdeps/sh/sh4/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012.
diff --git a/sysdeps/sh/sh4/fpu/fgetexcptflg.c b/sysdeps/sh/sh4/fpu/fgetexcptflg.c
index 076360bc36..a73e501ea8 100644
--- a/sysdeps/sh/sh4/fpu/fgetexcptflg.c
+++ b/sysdeps/sh/sh4/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/sh4/fpu/fraiseexcpt.c b/sysdeps/sh/sh4/fpu/fraiseexcpt.c
index fb58ed5af0..12b9adc0ce 100644
--- a/sysdeps/sh/sh4/fpu/fraiseexcpt.c
+++ b/sysdeps/sh/sh4/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012.
diff --git a/sysdeps/sh/sh4/fpu/fsetexcptflg.c b/sysdeps/sh/sh4/fpu/fsetexcptflg.c
index a162af3161..0948037393 100644
--- a/sysdeps/sh/sh4/fpu/fsetexcptflg.c
+++ b/sysdeps/sh/sh4/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/sh4/fpu/ftestexcept.c b/sysdeps/sh/sh4/fpu/ftestexcept.c
index c35c483ede..5de9910481 100644
--- a/sysdeps/sh/sh4/fpu/ftestexcept.c
+++ b/sysdeps/sh/sh4/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/sh4/setjmp.S b/sysdeps/sh/sh4/setjmp.S
index b42446560d..854cb57849 100644
--- a/sysdeps/sh/sh4/setjmp.S
+++ b/sysdeps/sh/sh4/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for SH4.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -87,3 +87,4 @@ ENTRY (__sigsetjmp)
# endif
#endif
END (__sigsetjmp)
+hidden_def (__sigsetjmp)
diff --git a/sysdeps/sh/sotruss-lib.c b/sysdeps/sh/sotruss-lib.c
index 4f3e936077..8facac53e3 100644
--- a/sysdeps/sh/sotruss-lib.c
+++ b/sysdeps/sh/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Override generic sotruss-lib.c to define actual functions for SH.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/sh/stackinfo.h b/sysdeps/sh/stackinfo.h
index 4a3c872f5f..9570a36c75 100644
--- a/sysdeps/sh/stackinfo.h
+++ b/sysdeps/sh/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/start.S b/sysdeps/sh/start.S
index 1ec1bbf421..f52077abca 100644
--- a/sysdeps/sh/start.S
+++ b/sysdeps/sh/start.S
@@ -1,5 +1,5 @@
/* Startup code for SH & ELF.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/strlen.S b/sysdeps/sh/strlen.S
index 151f376bb3..2b09a781b1 100644
--- a/sysdeps/sh/strlen.S
+++ b/sysdeps/sh/strlen.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
diff --git a/sysdeps/sh/sysdep.h b/sysdeps/sh/sysdep.h
index 8de871ece0..37889fb0cc 100644
--- a/sysdeps/sh/sysdep.h
+++ b/sysdeps/sh/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for SH.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sh/tst-audit.h b/sysdeps/sh/tst-audit.h
index ffb2e77c8c..74473cdfe6 100644
--- a/sysdeps/sh/tst-audit.h
+++ b/sysdeps/sh/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. SH version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/sparc/Makefile b/sysdeps/sparc/Makefile
index 31aaeaed8f..3f0c096400 100644
--- a/sysdeps/sparc/Makefile
+++ b/sysdeps/sparc/Makefile
@@ -3,10 +3,6 @@ long-double-fcts = yes
pie-ccflag = -fPIE
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
-
ifeq ($(subdir),gmon)
sysdep_routines += sparc-mcount
endif
diff --git a/sysdeps/sparc/backtrace.c b/sysdeps/sparc/backtrace.c
index 0c1c9b5c72..e259408893 100644
--- a/sysdeps/sparc/backtrace.c
+++ b/sysdeps/sparc/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>
diff --git a/sysdeps/sparc/bits/huge_vall.h b/sysdeps/sparc/bits/huge_vall.h
deleted file mode 100644
index 6ba058e183..0000000000
--- a/sysdeps/sparc/bits/huge_vall.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* `HUGE_VALL' constant for IEEE 754 machines (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992-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/huge_vall.h> directly; include <math.h> instead."
-#endif
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VALL (__builtin_huge_vall())
-#else
-# include <bits/wordsize.h>
-# if __WORDSIZE == 32
-# define HUGE_VALL ((long double) HUGE_VAL)
-# elif __GNUC_PREREQ(2,96)
-# define HUGE_VALL (__extension__ 0x1.0p32767L)
-# elif defined __GNUC__
-
-# define HUGE_VALL \
- (__extension__ \
- ((union { struct { unsigned long __h, __l; } __i; long double __d; }) \
- { __i: { __h: 0x7fff000000000000UL, __l: 0 } }).__d)
-
-# else /* not GCC */
-
-typedef union { unsigned char __c[16]; long double __d; } __huge_vall_t;
-# define __HUGE_VALL_bytes { 0x7f, 0xff, 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
-static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
-# define HUGE_VALL (__huge_vall.__d)
-
-# endif /* GCC. */
-#endif /* GCC 3.3. */
diff --git a/sysdeps/sparc/bits/hwcap.h b/sysdeps/sparc/bits/hwcap.h
index edd71ec2df..a991029f02 100644
--- a/sysdeps/sparc/bits/hwcap.h
+++ b/sysdeps/sparc/bits/hwcap.h
@@ -1,5 +1,5 @@
/* Defines for bits in AT_HWCAP.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -48,3 +48,4 @@
#define HWCAP_SPARC_PAUSE 0x01000000
#define HWCAP_SPARC_CBCOND 0x02000000
#define HWCAP_SPARC_CRYPTO 0x04000000
+#define HWCAP_SPARC_ADP 0x08000000
diff --git a/sysdeps/sparc/bits/link.h b/sysdeps/sparc/bits/link.h
index 7e21be6831..f4781a0107 100644
--- a/sysdeps/sparc/bits/link.h
+++ b/sysdeps/sparc/bits/link.h
@@ -1,5 +1,5 @@
/* Machine-specific audit interfaces for dynamic linker. SPARC version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/bits/mathdef.h b/sysdeps/sparc/bits/mathdef.h
deleted file mode 100644
index 94a102a1d4..0000000000
--- a/sysdeps/sparc/bits/mathdef.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-/* FIXME! This file describes properties of the compiler, not the machine;
- it should not be part of libc! */
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* SPARC has both `float' and `double' arithmetic. */
-typedef float float_t;
-typedef double double_t;
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647)
-# define FP_ILOGBNAN (2147483647)
-
-#endif /* ISO C99 */
diff --git a/sysdeps/sparc/bits/string.h b/sysdeps/sparc/bits/string.h
deleted file mode 100644
index 10beca6a5a..0000000000
--- a/sysdeps/sparc/bits/string.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Optimized, inlined string functions. SPARC version.
- Copyright (C) 2000-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 _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* sparc uses the aligned string inline ABI. */
-#define _STRING_INLINE_unaligned 0
-
-/* sparc32 and sparc64 strchr(x, '\0') perform better than
- __rawmemchr(x, '\0'). */
-#define _HAVE_STRING_ARCH_strchr 1
-
-/* Don't inline mempcpy into memcpy as sparc has an optimized mempcpy. */
-#define _HAVE_STRING_ARCH_mempcpy 1
diff --git a/sysdeps/sparc/configure b/sysdeps/sparc/configure
index 90a86f6da3..bc6ac14e9f 100644
--- a/sysdeps/sparc/configure
+++ b/sysdeps/sparc/configure
@@ -1,48 +1,6 @@
# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/sparc.
-# Check for support of VIS3 et al. instructions in the assembler.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sparc assembler VIS3 support" >&5
-$as_echo_n "checking for sparc assembler VIS3 support... " >&6; }
-if ${libc_cv_sparc_as_vis3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.S <<\EOF
- .text
-foo: fmadds %f1, %f2, %f3, %f5
- fmaddd %f2, %f4, %f8, %f10
- fhadds %f2, %f3, %f5
- fhaddd %f4, %f8, %f10
- pdistn %f2, %f4, %g1
- movdtox %f10, %o0
- movstouw %f9, %o1
- movstosw %f7, %o2
- movxtod %o3, %f18
- movwtos %o4, %f15
- flcmps %fcc0, %f3, %f5
- flcmpd %fcc1, %f4, %f6
-EOF
-if { ac_try='${CC-cc} -c $CFLAGS -Wa,-Av9d conftest.S'
- { { 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_sparc_as_vis3=yes
-else
- libc_cv_sparc_as_vis3=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sparc_as_vis3" >&5
-$as_echo "$libc_cv_sparc_as_vis3" >&6; }
-if test $libc_cv_sparc_as_vis3 = yes; then
- $as_echo "#define HAVE_AS_VIS3_SUPPORT 1" >>confdefs.h
-
-fi
-config_vars="$config_vars
-have-as-vis3 = $libc_cv_sparc_as_vis3"
-
# Check for a GCC emitting GOTDATA relocations.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sparc gcc GOTDATA reloc support" >&5
$as_echo_n "checking for sparc gcc GOTDATA reloc support... " >&6; }
diff --git a/sysdeps/sparc/configure.ac b/sysdeps/sparc/configure.ac
index 982077c9b9..43ad541464 100644
--- a/sysdeps/sparc/configure.ac
+++ b/sysdeps/sparc/configure.ac
@@ -1,35 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/sparc.
-# Check for support of VIS3 et al. instructions in the assembler.
-AC_CACHE_CHECK(for sparc assembler VIS3 support, libc_cv_sparc_as_vis3, [dnl
-cat > conftest.S <<\EOF
- .text
-foo: fmadds %f1, %f2, %f3, %f5
- fmaddd %f2, %f4, %f8, %f10
- fhadds %f2, %f3, %f5
- fhaddd %f4, %f8, %f10
- pdistn %f2, %f4, %g1
- movdtox %f10, %o0
- movstouw %f9, %o1
- movstosw %f7, %o2
- movxtod %o3, %f18
- movwtos %o4, %f15
- flcmps %fcc0, %f3, %f5
- flcmpd %fcc1, %f4, %f6
-EOF
-dnl
-if AC_TRY_COMMAND([${CC-cc} -c $CFLAGS -Wa,-Av9d conftest.S]); then
- libc_cv_sparc_as_vis3=yes
-else
- libc_cv_sparc_as_vis3=no
-fi
-rm -f conftest*])
-if test $libc_cv_sparc_as_vis3 = yes; then
- AC_DEFINE(HAVE_AS_VIS3_SUPPORT)
-fi
-LIBC_CONFIG_VAR([have-as-vis3], [$libc_cv_sparc_as_vis3])
-
# Check for a GCC emitting GOTDATA relocations.
AC_CACHE_CHECK(for sparc gcc GOTDATA reloc support, libc_cv_sparc_gcc_gotdata, [dnl
changequote(,)dnl
diff --git a/sysdeps/sparc/crti.S b/sysdeps/sparc/crti.S
index 2e917b57b1..a7d1a08acc 100644
--- a/sysdeps/sparc/crti.S
+++ b/sysdeps/sparc/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for sparc.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,6 +66,7 @@
.section .init,"ax",@progbits
.p2align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
save %sp, -STACKFRAME_SIZE, %sp
@@ -88,6 +89,7 @@ _init:
.section .fini,"ax",@progbits
.p2align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
save %sp, -STACKFRAME_SIZE, %sp
diff --git a/sysdeps/sparc/crtn.S b/sysdeps/sparc/crtn.S
index 576d4b432c..ca98b1e10b 100644
--- a/sysdeps/sparc/crtn.S
+++ b/sysdeps/sparc/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for sparc.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/dl-dtprocnum.h b/sysdeps/sparc/dl-dtprocnum.h
index 004334e47e..8362b7264a 100644
--- a/sysdeps/sparc/dl-dtprocnum.h
+++ b/sysdeps/sparc/dl-dtprocnum.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions. SPARC version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/dl-procinfo.c b/sysdeps/sparc/dl-procinfo.c
index 7151fd512b..73c4298ff5 100644
--- a/sysdeps/sparc/dl-procinfo.c
+++ b/sysdeps/sparc/dl-procinfo.c
@@ -1,5 +1,5 @@
/* Data for Linux/sparc version of processor capability information.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
@@ -46,13 +46,13 @@
#if !defined PROCINFO_DECL && defined SHARED
._dl_sparc_cap_flags
#else
-PROCINFO_CLASS const char _dl_sparc_cap_flags[27][11]
+PROCINFO_CLASS const char _dl_sparc_cap_flags[28][11]
#endif
#ifndef PROCINFO_DECL
= { "flush", "stbar", "swap", "muldiv", "v9", "ultra3", "v9v", "v9v2",
"mul32", "div32", "fsmuld", "v8plus", "popc", "vis", "vis2",
"ASIBlkInit", "fmaf", "vis3", "hpc", "random", "trans", "fjfmau",
- "ima", "cspare", "pause", "cbcond", "crypto" }
+ "ima", "cspare", "pause", "cbcond", "crypto", "adp" }
#endif
#if !defined SHARED || defined PROCINFO_DECL
;
diff --git a/sysdeps/sparc/dl-procinfo.h b/sysdeps/sparc/dl-procinfo.h
index e187541590..64a85d6c7f 100644
--- a/sysdeps/sparc/dl-procinfo.h
+++ b/sysdeps/sparc/dl-procinfo.h
@@ -1,5 +1,5 @@
/* Linux/sparc version of processor capability information handling macros.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -23,7 +23,7 @@
#include <ldsodefs.h>
#include <sysdep.h>
-#define _DL_HWCAP_COUNT 27
+#define _DL_HWCAP_COUNT 28
static inline int
__attribute__ ((unused))
@@ -71,9 +71,6 @@ _dl_string_hwcap (const char *str)
#define HWCAP_IMPORTANT (HWCAP_IMPORTANT_V9 | HWCAP_SPARC_ULTRA3 \
| HWCAP_SPARC_BLKINIT | HWCAP_SPARC_N2)
-/* There are no different platforms defined. */
-#define _dl_platform_string(idx) ""
-
/* There're no platforms to filter out. */
#define _DL_HWCAP_PLATFORM 0
diff --git a/sysdeps/sparc/dl-sysdep.h b/sysdeps/sparc/dl-sysdep.h
index a9a7f1b345..e8678cc55a 100644
--- a/sysdeps/sparc/dl-sysdep.h
+++ b/sysdeps/sparc/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. SPARC version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/dl-tls.h b/sysdeps/sparc/dl-tls.h
index 2bfd366747..048d232237 100644
--- a/sysdeps/sparc/dl-tls.h
+++ b/sysdeps/sparc/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. SPARC version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,3 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/sparc/fpu/bits/fenv.h b/sysdeps/sparc/fpu/bits/fenv.h
index 29328f714f..7f978423f2 100644
--- a/sysdeps/sparc/fpu/bits/fenv.h
+++ b/sysdeps/sparc/fpu/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -91,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/bits/mathinline.h b/sysdeps/sparc/fpu/bits/mathinline.h
deleted file mode 100644
index 283f024f8c..0000000000
--- a/sysdeps/sparc/fpu/bits/mathinline.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/* Inline math functions for SPARC.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.com>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#include <bits/wordsize.h>
-
-#ifdef __GNUC__
-
-#if defined __USE_ISOC99 && !__GNUC_PREREQ (3, 0)
-# undef isgreater
-# undef isgreaterequal
-# undef isless
-# undef islessequal
-# undef islessgreater
-# undef isunordered
-
-# if __WORDSIZE == 32
-
-# ifndef __NO_LONG_DOUBLE_MATH
-
-# define __unordered_cmp(x, y) \
- (__extension__ \
- ({ unsigned __r; \
- if (sizeof (x) == 4 && sizeof (y) == 4) \
- { \
- float __x = (x); float __y = (y); \
- __asm__ ("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x), \
- "f" (__y) : "cc"); \
- } \
- else if (sizeof (x) <= 8 && sizeof (y) <= 8) \
- { \
- double __x = (x); double __y = (y); \
- __asm__ ("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x), \
- "f" (__y) : "cc"); \
- } \
- else \
- { \
- long double __x = (x); long double __y = (y); \
- extern int _Q_cmp (const long double a, const long double b); \
- __r = _Q_cmp (__x, __y) << 10; \
- } \
- __r; }))
-
-# else
-
-# define __unordered_cmp(x, y) \
- (__extension__ \
- ({ unsigned __r; \
- if (sizeof (x) == 4 && sizeof (y) == 4) \
- { \
- float __x = (x); float __y = (y); \
- __asm__ ("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x), \
- "f" (__y) : "cc"); \
- } \
- else \
- { \
- double __x = (x); double __y = (y); \
- __asm__ ("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x), \
- "f" (__y) : "cc"); \
- } \
- __r; }))
-
-# endif
-
-# define isgreater(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (2 << 10))
-# define isgreaterequal(x, y) ((__unordered_cmp (x, y) & (1 << 10)) == 0)
-# define isless(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (1 << 10))
-# define islessequal(x, y) ((__unordered_cmp (x, y) & (2 << 10)) == 0)
-# define islessgreater(x, y) (((__unordered_cmp (x, y) + (1 << 10)) & (2 << 10)) != 0)
-# define isunordered(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (3 << 10))
-
-# else /* sparc64 */
-
-# define __unordered_v9cmp(x, y, op, qop) \
- (__extension__ \
- ({ unsigned __r; \
- if (sizeof (x) == 4 && sizeof (y) == 4) \
- { \
- float __x = (x); float __y = (y); \
- __asm__ ("fcmps\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0" \
- : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc"); \
- } \
- else if (sizeof (x) <= 8 && sizeof (y) <= 8) \
- { \
- double __x = (x); double __y = (y); \
- __asm__ ("fcmpd\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0" \
- : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc"); \
- } \
- else \
- { \
- long double __x = (x); long double __y = (y); \
- extern int _Qp_cmp (const long double *a, const long double *b); \
- __r = qop; \
- } \
- __r; }))
-
-# define isgreater(x, y) __unordered_v9cmp(x, y, "g", _Qp_cmp (&__x, &__y) == 2)
-# define isgreaterequal(x, y) __unordered_v9cmp(x, y, "ge", (_Qp_cmp (&__x, &__y) & 1) == 0)
-# define isless(x, y) __unordered_v9cmp(x, y, "l", _Qp_cmp (&__x, &__y) == 1)
-# define islessequal(x, y) __unordered_v9cmp(x, y, "le", (_Qp_cmp (&__x, &__y) & 2) == 0)
-# define islessgreater(x, y) __unordered_v9cmp(x, y, "lg", ((_Qp_cmp (&__x, &__y) + 1) & 2) != 0)
-# define isunordered(x, y) __unordered_v9cmp(x, y, "u", _Qp_cmp (&__x, &__y) == 3)
-
-# endif /* sparc64 */
-
-#endif /* __USE_ISOC99 */
-
-#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) && defined __OPTIMIZE__
-
-# ifndef __extern_inline
-# define __MATH_INLINE __inline
-# else
-# define __MATH_INLINE __extern_inline
-# endif /* __cplusplus */
-
-/* The gcc, version 2.7 or below, has problems with all this inlining
- code. So disable it for this version of the compiler. */
-# if __GNUC_PREREQ (2, 8)
-
-# ifdef __USE_ISOC99
-
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
-}
-
-# if __WORDSIZE == 32
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
- __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
- return __u.__i[0] < 0;
-}
-
-# ifndef __NO_LONG_DOUBLE_MATH
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- __extension__ union { long double __l; int __i[4]; } __u = { __l: __x };
- return __u.__i[0] < 0;
-}
-# else
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- return __signbit ((double)__x);
-}
-# endif
-
-# else /* sparc64 */
-
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
- __extension__ union { double __d; long int __i; } __u = { __d: __x };
- return __u.__i < 0;
-}
-
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- __extension__ union { long double __l; long int __i[2]; } __u = { __l: __x };
- return __u.__i[0] < 0;
-}
-
-# endif /* sparc64 */
-
-# endif /* __USE_ISOC99 */
-
-# if !defined __NO_MATH_INLINES && !__GNUC_PREREQ (3, 2)
-
-__MATH_INLINE double
-__NTH (sqrt (double __x))
-{
- register double __r;
- __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x));
- return __r;
-}
-
-__MATH_INLINE float
-__NTH (sqrtf (float __x))
-{
- register float __r;
- __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x));
- return __r;
-}
-
-# if __WORDSIZE == 64
-__MATH_INLINE long double
-__NTH (sqrtl (long double __x))
-{
- long double __r;
- extern void _Qp_sqrt (long double *, const long double *);
- _Qp_sqrt (&__r, &__x);
- return __r;
-}
-# elif !defined __NO_LONG_DOUBLE_MATH
-__MATH_INLINE long double
-sqrtl (long double __x) __THROW
-{
- extern long double _Q_sqrt (const long double);
- return _Q_sqrt (__x);
-}
-# endif /* sparc64 */
-
-# endif /* !__NO_MATH_INLINES && !GCC 3.2+ */
-
-/* This code is used internally in the GNU libc. */
-# ifdef __LIBC_INTERNAL_MATH_INLINES
-__MATH_INLINE double
-__ieee754_sqrt (double __x)
-{
- register double __r;
- __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x));
- return __r;
-}
-
-__MATH_INLINE float
-__ieee754_sqrtf (float __x)
-{
- register float __r;
- __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x));
- return __r;
-}
-
-# if __WORDSIZE == 64
-__MATH_INLINE long double
-__ieee754_sqrtl (long double __x)
-{
- long double __r;
- extern void _Qp_sqrt (long double *, const long double *);
- _Qp_sqrt(&__r, &__x);
- return __r;
-}
-# elif !defined __NO_LONG_DOUBLE_MATH
-__MATH_INLINE long double
-__ieee754_sqrtl (long double __x)
-{
- extern long double _Q_sqrt (const long double);
- return _Q_sqrt (__x);
-}
-# endif /* sparc64 */
-# endif /* __LIBC_INTERNAL_MATH_INLINES */
-# endif /* gcc 2.8+ */
-
-# ifdef __USE_ISOC99
-
-# ifndef __NO_MATH_INLINES
-
-__MATH_INLINE double __NTH (fdim (double __x, double __y));
-__MATH_INLINE double
-__NTH (fdim (double __x, double __y))
-{
- return __x <= __y ? 0 : __x - __y;
-}
-
-__MATH_INLINE float __NTH (fdimf (float __x, float __y));
-__MATH_INLINE float
-__NTH (fdimf (float __x, float __y))
-{
- return __x <= __y ? 0 : __x - __y;
-}
-
-# endif /* !__NO_MATH_INLINES */
-# endif /* __USE_ISOC99 */
-#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
-#endif /* __GNUC__ */
diff --git a/sysdeps/sparc/fpu/fclrexcpt.c b/sysdeps/sparc/fpu/fclrexcpt.c
index 12bf1322fb..87961d71dd 100644
--- a/sysdeps/sparc/fpu/fclrexcpt.c
+++ b/sysdeps/sparc/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/fedisblxcpt.c b/sysdeps/sparc/fpu/fedisblxcpt.c
index ba69e1f2d0..6321e7f188 100644
--- a/sysdeps/sparc/fpu/fedisblxcpt.c
+++ b/sysdeps/sparc/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
diff --git a/sysdeps/sparc/fpu/feenablxcpt.c b/sysdeps/sparc/fpu/feenablxcpt.c
index 688909e637..94eda112a9 100644
--- a/sysdeps/sparc/fpu/feenablxcpt.c
+++ b/sysdeps/sparc/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
diff --git a/sysdeps/sparc/fpu/fegetenv.c b/sysdeps/sparc/fpu/fegetenv.c
index 54e3c90186..25af627589 100644
--- a/sysdeps/sparc/fpu/fegetenv.c
+++ b/sysdeps/sparc/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/fegetexcept.c b/sysdeps/sparc/fpu/fegetexcept.c
index c982c20a44..0078bf6d7a 100644
--- a/sysdeps/sparc/fpu/fegetexcept.c
+++ b/sysdeps/sparc/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
diff --git a/sysdeps/sparc/fpu/fegetmode.c b/sysdeps/sparc/fpu/fegetmode.c
new file mode 100644
index 0000000000..9fd50ec7a1
--- /dev/null
+++ b/sysdeps/sparc/fpu/fegetmode.c
@@ -0,0 +1,26 @@
+/* Store current floating-point control modes. SPARC version.
+ Copyright (C) 2016-2018 Free Software 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/fegetround.c b/sysdeps/sparc/fpu/fegetround.c
index d75fb668ad..ece7a713d5 100644
--- a/sysdeps/sparc/fpu/fegetround.c
+++ b/sysdeps/sparc/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/feholdexcpt.c b/sysdeps/sparc/fpu/feholdexcpt.c
index b029646582..53f8b67096 100644
--- a/sysdeps/sparc/fpu/feholdexcpt.c
+++ b/sysdeps/sparc/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/fesetenv.c b/sysdeps/sparc/fpu/fesetenv.c
index f3dc0a781d..297015da0c 100644
--- a/sysdeps/sparc/fpu/fesetenv.c
+++ b/sysdeps/sparc/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/fesetexcept.c b/sysdeps/sparc/fpu/fesetexcept.c
new file mode 100644
index 0000000000..6a7ff60fbd
--- /dev/null
+++ b/sysdeps/sparc/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. SPARC version.
+ Copyright (C) 2016-2018 Free Software 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..49929545c5
--- /dev/null
+++ b/sysdeps/sparc/fpu/fesetmode.c
@@ -0,0 +1,38 @@
+/* Install given floating-point control modes. SPARC version.
+ Copyright (C) 2016-2018 Free Software 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/fesetround.c b/sysdeps/sparc/fpu/fesetround.c
index 6d665a5c6f..2d538f5856 100644
--- a/sysdeps/sparc/fpu/fesetround.c
+++ b/sysdeps/sparc/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/feupdateenv.c b/sysdeps/sparc/fpu/feupdateenv.c
index 5a32f1fbd8..2c06882fdd 100644
--- a/sysdeps/sparc/fpu/feupdateenv.c
+++ b/sysdeps/sparc/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/fgetexcptflg.c b/sysdeps/sparc/fpu/fgetexcptflg.c
index c8040c6829..5e34db1a5e 100644
--- a/sysdeps/sparc/fpu/fgetexcptflg.c
+++ b/sysdeps/sparc/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/fpu_control.h b/sysdeps/sparc/fpu/fpu_control.h
index c7cb8a4f62..fbd7c75530 100644
--- a/sysdeps/sparc/fpu/fpu_control.h
+++ b/sysdeps/sparc/fpu/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word bits. SPARC version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza
diff --git a/sysdeps/sparc/fpu/fraiseexcpt.c b/sysdeps/sparc/fpu/fraiseexcpt.c
index 156362126c..964c4f4ab2 100644
--- a/sysdeps/sparc/fpu/fraiseexcpt.c
+++ b/sysdeps/sparc/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/fsetexcptflg.c b/sysdeps/sparc/fpu/fsetexcptflg.c
index 4c33c629f2..634b60d216 100644
--- a/sysdeps/sparc/fpu/fsetexcptflg.c
+++ b/sysdeps/sparc/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/ftestexcept.c b/sysdeps/sparc/fpu/ftestexcept.c
index 621fef6dde..a31689431a 100644
--- a/sysdeps/sparc/fpu/ftestexcept.c
+++ b/sysdeps/sparc/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/fpu/libm-test-ulps b/sysdeps/sparc/fpu/libm-test-ulps
index cf6a2929d3..84aed3a4e2 100644
--- a/sysdeps/sparc/fpu/libm-test-ulps
+++ b/sysdeps/sparc/fpu/libm-test-ulps
@@ -250,36 +250,36 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "cacos_downward":
double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "cacos_towardzero":
double: 5
@@ -298,17 +298,17 @@ ildouble: 3
ldouble: 3
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -330,12 +330,12 @@ ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-ildouble: 2
-ldouble: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+ildouble: 4
+ldouble: 4
Function: Real part of "cacosh_towardzero":
double: 5
@@ -346,28 +346,28 @@ ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Real part of "cacosh_upward":
double: 4
float: 4
idouble: 4
ifloat: 4
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
Function: "carg":
float: 1
@@ -408,18 +408,18 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -428,8 +428,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "casin_towardzero":
double: 3
@@ -448,25 +448,25 @@ ildouble: 5
ldouble: 5
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -484,14 +484,14 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -512,23 +512,25 @@ ildouble: 3
ldouble: 3
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
ildouble: 3
ldouble: 3
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -543,9 +545,9 @@ ldouble: 1
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -559,25 +561,27 @@ ldouble: 3
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
Function: Real part of "catan_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catan_upward":
double: 3
@@ -596,7 +600,9 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -619,9 +625,9 @@ ldouble: 2
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -635,17 +641,19 @@ ldouble: 2
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
idouble: 4
-ifloat: 3
+ifloat: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "cbrt":
double: 3
@@ -998,7 +1006,9 @@ ildouble: 2
ldouble: 2
Function: "cos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -1061,9 +1071,9 @@ ldouble: 3
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
ildouble: 4
ldouble: 4
@@ -1317,9 +1327,9 @@ ldouble: 3
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -1333,9 +1343,9 @@ ldouble: 4
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1357,9 +1367,9 @@ ldouble: 5
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 5
ldouble: 5
@@ -1373,9 +1383,9 @@ ldouble: 5
Function: Real part of "ctanh":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -1389,9 +1399,9 @@ ldouble: 3
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
idouble: 4
-ifloat: 1
+ifloat: 2
ildouble: 5
ldouble: 5
@@ -1569,15 +1579,21 @@ ldouble: 2
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
Function: "expm1":
double: 1
@@ -1677,9 +1693,9 @@ ldouble: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 4
ldouble: 4
@@ -1709,9 +1725,9 @@ ldouble: 4
Function: "j1_downward":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 4
ldouble: 4
@@ -1918,41 +1934,13 @@ ildouble: 1
ldouble: 1
Function: "pow":
+double: 1
float: 3
+idouble: 1
ifloat: 3
ildouble: 2
ldouble: 2
-Function: "pow10":
-double: 2
-idouble: 2
-ildouble: 2
-ldouble: 2
-
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 3
-ldouble: 3
-
Function: "pow_downward":
double: 1
float: 3
@@ -1978,7 +1966,9 @@ ildouble: 2
ldouble: 2
Function: "sin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2008,7 +1998,9 @@ ildouble: 3
ldouble: 3
Function: "sincos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2173,9 +2165,9 @@ ldouble: 3
Function: "y0_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 4
ldouble: 4
@@ -2189,9 +2181,9 @@ ldouble: 3
Function: "y0_upward":
double: 3
-float: 4
+float: 5
idouble: 3
-ifloat: 4
+ifloat: 5
ildouble: 3
ldouble: 3
@@ -2229,17 +2221,17 @@ ldouble: 5
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 5
ldouble: 5
Function: "yn_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 5
ldouble: 5
@@ -2253,9 +2245,9 @@ ldouble: 5
Function: "yn_upward":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
ildouble: 5
ldouble: 5
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/gccframe.h b/sysdeps/sparc/gccframe.h
index 78f4ac7845..c4e6a9ca8f 100644
--- a/sysdeps/sparc/gccframe.h
+++ b/sysdeps/sparc/gccframe.h
@@ -1,5 +1,5 @@
/* Definition of object in frame unwind info. sparc version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/ldsodefs.h b/sysdeps/sparc/ldsodefs.h
index 5fa78aaf2d..3365550b5f 100644
--- a/sysdeps/sparc/ldsodefs.h
+++ b/sysdeps/sparc/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/machine-gmon.h b/sysdeps/sparc/machine-gmon.h
index ad052a99b8..5b07916111 100644
--- a/sysdeps/sparc/machine-gmon.h
+++ b/sysdeps/sparc/machine-gmon.h
@@ -1,5 +1,5 @@
/* sparc-specific implementation of profiling support.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2008
@@ -22,10 +22,10 @@
/* We must not pollute the global namespace. */
#define mcount_internal __mcount_internal
-extern void mcount_internal (u_long frompc, u_long selfpc) internal_function;
+extern void mcount_internal (u_long frompc, u_long selfpc);
#define _MCOUNT_DECL(frompc, selfpc) \
-void internal_function mcount_internal (u_long frompc, u_long selfpc)
+void mcount_internal (u_long frompc, u_long selfpc)
/* Define MCOUNT as empty since we have the implementation in another
file. */
diff --git a/sysdeps/sparc/memusage.h b/sysdeps/sparc/memusage.h
index a861139848..0ed392e95f 100644
--- a/sysdeps/sparc/memusage.h
+++ b/sysdeps/sparc/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/nptl/bits/pthreadtypes-arch.h b/sysdeps/sparc/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..3effddeb43
--- /dev/null
+++ b/sysdeps/sparc/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,81 @@
+/* Machine-specific pthread type layouts. SPARC version.
+ Copyright (C) 2003-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __SIZEOF_PTHREAD_ATTR_T 56
+# define __SIZEOF_PTHREAD_MUTEX_T 40
+# define __SIZEOF_PTHREAD_CONDATTR_T 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 56
+# define __SIZEOF_PTHREAD_BARRIER_T 32
+#else
+# define __SIZEOF_PTHREAD_ATTR_T 36
+# define __SIZEOF_PTHREAD_MUTEX_T 24
+# define __SIZEOF_PTHREAD_CONDATTR_T 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 32
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+#endif
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Definitions for internal mutex struct. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND (__WORDSIZE != 64)
+#define __PTHREAD_MUTEX_USE_UNION (__WORDSIZE != 64)
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+#if __WORDSIZE == 64
+ int __cur_writer;
+ int __shared;
+ unsigned long int __pad1;
+ unsigned long int __pad2;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned int __flags;
+#else
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ int __cur_writer;
+#endif
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/sparc/nptl/bits/pthreadtypes.h b/sysdeps/sparc/nptl/bits/pthreadtypes.h
deleted file mode 100644
index d45cb61277..0000000000
--- a/sysdeps/sparc/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/* Machine-specific pthread type layouts. SPARC version.
- 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/>. */
-
-#ifndef _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define __SIZEOF_PTHREAD_ATTR_T 56
-# define __SIZEOF_PTHREAD_MUTEX_T 40
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 56
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 32
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#else
-# define __SIZEOF_PTHREAD_ATTR_T 36
-# define __SIZEOF_PTHREAD_MUTEX_T 24
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 32
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 20
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#endif
-
-
-/* Thread identifiers. The structure of the attribute type is
- deliberately not exposed. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-#if __WORDSIZE == 64
-typedef struct __pthread_internal_list
-{
- struct __pthread_internal_list *__prev;
- struct __pthread_internal_list *__next;
-} __pthread_list_t;
-#else
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-#endif
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is deliberately not exposed. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
-#if __WORDSIZE == 64
- unsigned int __nusers;
-#endif
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
-#if __WORDSIZE == 64
- int __spins;
- __pthread_list_t __list;
-# define __PTHREAD_MUTEX_HAVE_PREV 1
-#else
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
-#endif
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is deliberately not exposed. */
-typedef union
-{
-# if __WORDSIZE == 64
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- int __writer;
- int __shared;
- unsigned long int __pad1;
- unsigned long int __pad2;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned int __flags;
- } __data;
-# else
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- unsigned char __pad1;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- int __writer;
- } __data;
-# endif
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/sparc/nptl/bits/semaphore.h b/sysdeps/sparc/nptl/bits/semaphore.h
index a87fed0155..aeac74c9c7 100644
--- a/sysdeps/sparc/nptl/bits/semaphore.h
+++ b/sysdeps/sparc/nptl/bits/semaphore.h
@@ -1,5 +1,5 @@
/* Machine-specific POSIX semaphore type layouts. SPARC version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/sparc/nptl/pthread-offsets.h b/sysdeps/sparc/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..bdda1f197e
--- /dev/null
+++ b/sysdeps/sparc/nptl/pthread-offsets.h
@@ -0,0 +1,15 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __PTHREAD_MUTEX_NUSERS_OFFSET 12
+# define __PTHREAD_MUTEX_KIND_OFFSET 16
+# define __PTHREAD_MUTEX_SPINS_OFFSET 20
+# define __PTHREAD_MUTEX_ELISION_OFFSET 22
+# define __PTHREAD_MUTEX_LIST_OFFSET 24
+#else
+# define __PTHREAD_MUTEX_NUSERS_OFFSET 16
+# define __PTHREAD_MUTEX_KIND_OFFSET 12
+# define __PTHREAD_MUTEX_SPINS_OFFSET 20
+# define __PTHREAD_MUTEX_ELISION_OFFSET 22
+# define __PTHREAD_MUTEX_LIST_OFFSET 20
+#endif
diff --git a/sysdeps/sparc/nptl/tcb-offsets.sym b/sysdeps/sparc/nptl/tcb-offsets.sym
index 923af8a5b7..f75d02065e 100644
--- a/sysdeps/sparc/nptl/tcb-offsets.sym
+++ b/sysdeps/sparc/nptl/tcb-offsets.sym
@@ -3,5 +3,4 @@
MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
POINTER_GUARD offsetof (tcbhead_t, pointer_guard)
-PID offsetof (struct pthread, pid)
TID offsetof (struct pthread, tid)
diff --git a/sysdeps/sparc/nptl/tls.h b/sysdeps/sparc/nptl/tls.h
index 08c055220a..2a79868ee2 100644
--- a/sysdeps/sparc/nptl/tls.h
+++ b/sysdeps/sparc/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. NPTL/sparc version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,17 +27,7 @@
# include <stdlib.h>
# include <list.h>
# include <kernel-features.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
+# include <dl-dtv.h>
typedef struct
{
@@ -55,9 +45,6 @@ typedef struct
#if __WORDSIZE != 64
int gscope_flag;
#endif
-#ifndef __ASSUME_PRIVATE_FUTEX
- int private_futex;
-#endif
} tcbhead_t;
#else /* __ASSEMBLER__ */
@@ -151,6 +138,7 @@ register struct pthread *__thread_self __asm__("%g7");
((descr)->header.pointer_guard = THREAD_GET_POINTER_GUARD ())
/* Get and set the global scope generation counter in struct pthread. */
+#define THREAD_GSCOPE_IN_TCB 1
#define THREAD_GSCOPE_FLAG_UNUSED 0
#define THREAD_GSCOPE_FLAG_USED 1
#define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/sparc/sparc-ifunc.h b/sysdeps/sparc/sparc-ifunc.h
index 6bc08cf87e..561aeea2f8 100644
--- a/sysdeps/sparc/sparc-ifunc.h
+++ b/sysdeps/sparc/sparc-ifunc.h
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,160 +17,25 @@
#include <sysdep.h>
-#ifdef __ASSEMBLER__
+#define INIT_ARCH()
-# ifdef SHARED
+#define sparc_libc_ifunc_redirected(redirected_name, name, expr) \
+ __ifunc (redirected_name, name, expr(hwcap), int hwcap, INIT_ARCH)
-# define SPARC_ASM_IFUNC_DFLT(name, dflt) \
-ENTRY (__##name) \
- .type __##name, @gnu_indirect_function; \
- SETUP_PIC_REG_LEAF(o3, o5); \
- sethi %gdop_hix22(dflt), %o1; \
- xor %o1, %gdop_lox10(dflt), %o1; \
- add %o3, %o1, %o1; \
- retl; \
- mov %o1, %o0; \
-END (__##name)
+#define sparc_libm_ifunc(name, expr) \
+ __ifunc (name, name, expr, int hwcap, libm_ifunc_init)
-# define SPARC_ASM_IFUNC1(name, m1, f1, dflt) \
-ENTRY (__##name) \
- .type __##name, @gnu_indirect_function; \
- SETUP_PIC_REG_LEAF(o3, o5); \
- set m1, %o1; \
- andcc %o0, %o1, %g0; \
- be 9f; \
- nop; \
- sethi %gdop_hix22(f1), %o1; \
- xor %o1, %gdop_lox10(f1), %o1; \
- ba 10f; \
- nop; \
-9: sethi %gdop_hix22(dflt), %o1; \
- xor %o1, %gdop_lox10(dflt), %o1; \
-10: add %o3, %o1, %o1; \
- retl; \
- mov %o1, %o0; \
-END (__##name)
+#define sparc_libc_ifunc(name, expr) sparc_libm_ifunc (name, expr)
-# define SPARC_ASM_IFUNC2(name, m1, f1, m2, f2, dflt) \
-ENTRY (__##name) \
- .type __##name, @gnu_indirect_function; \
- SETUP_PIC_REG_LEAF(o3, o5); \
- set m1, %o1; \
- andcc %o0, %o1, %g0; \
- be 8f; \
- nop; \
- sethi %gdop_hix22(f1), %o1; \
- xor %o1, %gdop_lox10(f1), %o1; \
- ba 10f; \
- nop; \
-8: set m2, %o1; \
- andcc %o0, %o1, %g0; \
- be 9f; \
- nop; \
- sethi %gdop_hix22(f2), %o1; \
- xor %o1, %gdop_lox10(f2), %o1; \
- ba 10f; \
- nop; \
-9: sethi %gdop_hix22(dflt), %o1; \
- xor %o1, %gdop_lox10(dflt), %o1; \
-10: add %o3, %o1, %o1; \
- retl; \
- mov %o1, %o0; \
-END (__##name)
+#define sparc_libm_ifunc_redirected(redirected_name, name, expr) \
+ __ifunc (redirected_name, name, expr, int hwcap, libm_ifunc_init)
-# else /* SHARED */
-
-# ifdef __arch64__
-# define SET(SYM, TMP, REG) setx SYM, TMP, REG
-# else
-# define SET(SYM, TMP, REG) set SYM, REG
-# endif
-
-# define SPARC_ASM_IFUNC_DFLT(name, dflt) \
-ENTRY (__##name) \
- .type __##name, @gnu_indirect_function; \
- SET(dflt, %g1, %o1); \
- retl; \
- mov %o1, %o0; \
-END (__##name)
-
-# define SPARC_ASM_IFUNC1(name, m1, f1, dflt) \
-ENTRY (__##name) \
- .type __##name, @gnu_indirect_function; \
- set m1, %o1; \
- andcc %o0, %o1, %g0; \
- be 9f; \
- nop; \
- SET(f1, %g1, %o1); \
- ba 10f; \
- nop; \
-9: SET(dflt, %g1, %o1); \
-10: retl; \
- mov %o1, %o0; \
-END (__##name)
-
-# define SPARC_ASM_IFUNC2(name, m1, f1, m2, f2, dflt) \
-ENTRY (__##name) \
- .type __##name, @gnu_indirect_function; \
- set m1, %o1; \
- andcc %o0, %o1, %g0; \
- be 8f; \
- nop; \
- SET(f1, %g1, %o1); \
- ba 10f; \
- nop; \
-8: set m2, %o1; \
- andcc %o0, %o1, %g0; \
- be 9f; \
- nop; \
- SET(f2, %g1, %o1); \
- ba 10f; \
- nop; \
-9: SET(dflt, %g1, %o1); \
-10: retl; \
- mov %o1, %o0; \
-END (__##name)
-
-# endif /* SHARED */
-
-#define SPARC_ASM_VIS2_IFUNC(name) \
- SPARC_ASM_IFUNC1(name, HWCAP_SPARC_VIS2, \
- __##name##_vis2, __##name##_generic)
-
-# ifdef HAVE_AS_VIS3_SUPPORT
-
-#define SPARC_ASM_VIS3_IFUNC(name) \
- SPARC_ASM_IFUNC1(name, HWCAP_SPARC_VIS3, \
- __##name##_vis3, __##name##_generic)
-
-#define SPARC_ASM_VIS3_VIS2_IFUNC(name) \
- SPARC_ASM_IFUNC2(name, HWCAP_SPARC_VIS3, \
- __##name##_vis3, \
- HWCAP_SPARC_VIS2, \
- __##name##_vis2, __##name##_generic)
-
-# else /* HAVE_AS_VIS3_SUPPORT */
-
-#define SPARC_ASM_VIS3_IFUNC(name) \
- SPARC_ASM_IFUNC_DFLT(name, __##name##_generic)
-
-#define SPARC_ASM_VIS3_VIS2_IFUNC(name) \
- SPARC_ASM_VIS2_IFUNC(name)
-
-# endif /* HAVE_AS_VIS3_SUPPORT */
-
-
-#else /* __ASSEMBLER__ */
-
-# define sparc_libm_ifunc(name, expr) \
- extern void *name##_ifunc (int) __asm__ (#name); \
- void *name##_ifunc (int hwcap) \
- { \
- __typeof (name) *res = expr; \
- return res; \
- } \
- __asm__ (".type " #name ", %gnu_indirect_function");
-
-# define sparc_libc_ifunc(name, expr) sparc_libm_ifunc (name, expr)
-
-#endif /* __ASSEMBLER__ */
+/* It essentially does libc_hidden_builtin_def (name) and redirect
+ the internal redirected symbol to ifunc implementation. */
+#if defined SHARED
+# define sparc_ifunc_redirected_hidden_def(redirect_name, name) \
+ __hidden_ver1 (name, __GI_##name, redirect_name) \
+ __attribute__ ((visibility ("hidden")));
+#else
+# define sparc_ifunc_redirected_hidden_def(redirect_name, name)
+#endif
diff --git a/sysdeps/sparc/sparc-mcount.S b/sysdeps/sparc/sparc-mcount.S
index 0afb9488ea..9c08464f6b 100644
--- a/sysdeps/sparc/sparc-mcount.S
+++ b/sysdeps/sparc/sparc-mcount.S
@@ -1,5 +1,5 @@
-/* sparc-specific implemetation of profiling support.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* sparc-specific implementation of profiling support.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2008.
diff --git a/sysdeps/sparc/sparc32/Implies b/sysdeps/sparc/sparc32/Implies
index 436436a651..f57542eb82 100644
--- a/sysdeps/sparc/sparc32/Implies
+++ b/sysdeps/sparc/sparc32/Implies
@@ -3,4 +3,3 @@ wordsize-32
ieee754/ldbl-128
ieee754/dbl-64
ieee754/flt-32
-sparc/sparc32/soft-fp
diff --git a/sysdeps/sparc/sparc32/Makefile b/sysdeps/sparc/sparc32/Makefile
index 42e24f780a..6a1b3716eb 100644
--- a/sysdeps/sparc/sparc32/Makefile
+++ b/sysdeps/sparc/sparc32/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2016 Free Software Foundation, Inc.
+# Copyright (C) 1991-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -37,13 +37,28 @@ divrem := sdiv udiv rem urem
+divrem-S-udiv := false
+divrem-S-urem := false
$(divrem:%=$(sysdep_dir)/sparc/sparc32/%.S): $(sysdep_dir)/sparc/sparc32/divrem.m4
- (echo "define(NAME,\`.$(+divrem-NAME)')\
- define(OP,\`$(+divrem-OP-$(+divrem-NAME))')\
- define(S,\`$(+divrem-S-$(+divrem-NAME))')\
- /* This file is generated from divrem.m4; DO NOT EDIT! */"; \
+ (echo -n "define(NAME,\`.$(+divrem-NAME)')"; \
+ echo -n " define(OP,\`$(+divrem-OP-$(+divrem-NAME))')"; \
+ echo -n " define(S,\`$(+divrem-S-$(+divrem-NAME))')"; \
+ echo " /* This file is generated from divrem.m4; DO NOT EDIT! */"; \
cat $<) | $(M4) > $@-tmp
# Make it unwritable so noone will edit it by mistake.
-chmod a-w $@-tmp
mv -f $@-tmp $@
sysdep-realclean := $(sysdep-realclean) $(divrem:%=sysdeps/sparc/sparc32/%.S)
+
+# libgcc __divdi3 and __moddi3 uses .udiv and since it is also exported by
+# libc.so linker will create PLTs for the symbol. To avoid it we strong alias
+# the exported libc one to __wrap_.udiv and use linker option --wrap to make any
+# call to .udiv to call the wrapper symbol.
+libc.so-gnulib += -Wl,--wrap=.udiv
+
+ifeq ($(subdir),soft-fp)
+sparc32-quad-routines := q_add q_cmp q_cmpe q_div q_dtoq q_feq q_fge \
+ q_fgt q_fle q_flt q_fne q_itoq q_mul q_neg q_qtod q_qtoi \
+ q_qtos q_qtou q_qtoull q_qtoll q_sqrt q_stoq q_sub q_utoq \
+ q_ulltoq q_lltoq q_util
+sysdep_routines += $(sparc32-quad-routines)
+
+endif
diff --git a/sysdeps/sparc/sparc32/Versions b/sysdeps/sparc/sparc32/Versions
index 6d3bfe880e..9d00162864 100644
--- a/sysdeps/sparc/sparc32/Versions
+++ b/sysdeps/sparc/sparc32/Versions
@@ -2,6 +2,12 @@ libc {
GLIBC_2.0 {
.div; .mul; .rem; .udiv; .umul; .urem;
}
+ GLIBC_2.4 {
+ _Q_add; _Q_cmp; _Q_cmpe; _Q_div; _Q_dtoq; _Q_feq; _Q_fge; _Q_fgt;
+ _Q_fle; _Q_flt; _Q_fne; _Q_itoq; _Q_mul; _Q_neg; _Q_qtod; _Q_qtoi;
+ _Q_qtos; _Q_qtou; _Q_qtoull; _Q_qtoll; _Q_sqrt; _Q_stoq; _Q_sub;
+ _Q_utoq; _Q_ulltoq; _Q_lltoq;
+ }
}
libm {
GLIBC_2.23 {
diff --git a/sysdeps/sparc/sparc32/__longjmp.S b/sysdeps/sparc/sparc32/__longjmp.S
index c8404dbaf3..8abb8ed7ff 100644
--- a/sysdeps/sparc/sparc32/__longjmp.S
+++ b/sysdeps/sparc/sparc32/__longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/add_n.S b/sysdeps/sparc/sparc32/add_n.S
index a0f6f7fe23..2fae8b9c32 100644
--- a/sysdeps/sparc/sparc32/add_n.S
+++ b/sysdeps/sparc/sparc32/add_n.S
@@ -1,7 +1,7 @@
! SPARC __mpn_add_n -- Add two limb vectors of the same length > 0 and store
! sum in a third limb vector.
!
-! Copyright (C) 1995-2016 Free Software Foundation, Inc.
+! Copyright (C) 1995-2018 Free Software Foundation, Inc.
!
! This file is part of the GNU MP Library.
!
diff --git a/sysdeps/sparc/sparc32/addmul_1.S b/sysdeps/sparc/sparc32/addmul_1.S
index 13524e48f2..bbabe1ffcd 100644
--- a/sysdeps/sparc/sparc32/addmul_1.S
+++ b/sysdeps/sparc/sparc32/addmul_1.S
@@ -1,7 +1,7 @@
! SPARC __mpn_addmul_1 -- Multiply a limb vector with a limb and add
! the result to a second limb vector.
!
-! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+! Copyright (C) 1992-2018 Free Software Foundation, Inc.
!
! This file is part of the GNU MP Library.
!
diff --git a/sysdeps/sparc/sparc32/alloca.S b/sysdeps/sparc/sparc32/alloca.S
index fc88bb82a3..b37a495367 100644
--- a/sysdeps/sparc/sparc32/alloca.S
+++ b/sysdeps/sparc/sparc32/alloca.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/atomic-machine.h b/sysdeps/sparc/sparc32/atomic-machine.h
index d6e68f9301..31871dc344 100644
--- a/sysdeps/sparc/sparc32/atomic-machine.h
+++ b/sysdeps/sparc/sparc32/atomic-machine.h
@@ -1,5 +1,5 @@
/* Atomic operations. sparc32 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -50,6 +50,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
/* We have no compare and swap, just test and set.
The following implementation contends on 64 global locks
diff --git a/sysdeps/sparc/sparc32/bits/setjmp.h b/sysdeps/sparc/sparc32/bits/setjmp.h
index 6c1b8f0cc2..381dec2191 100644
--- a/sysdeps/sparc/sparc32/bits/setjmp.h
+++ b/sysdeps/sparc/sparc32/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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/divrem.m4 b/sysdeps/sparc/sparc32/divrem.m4
index 30d532ad77..c08c530020 100644
--- a/sysdeps/sparc/sparc32/divrem.m4
+++ b/sysdeps/sparc/sparc32/divrem.m4
@@ -72,15 +72,15 @@ define(DEVELOP_QUOTIENT_BITS,
ifelse($1, N,
` b 9f
add Q, ($2*2+1), Q
- ', ` DEVELOP_QUOTIENT_BITS(incr($1), `eval(2*$2+1)')')
+', ` DEVELOP_QUOTIENT_BITS(incr($1), `eval(2*$2+1)')')
LOC($1.eval(2**N+$2)):
! remainder is negative
addcc R,V,R
ifelse($1, N,
` b 9f
add Q, ($2*2-1), Q
- ', ` DEVELOP_QUOTIENT_BITS(incr($1), `eval(2*$2-1)')')
- ifelse($1, 1, `9:')')dnl
+', ` DEVELOP_QUOTIENT_BITS(incr($1), `eval(2*$2-1)')')
+ifelse($1, 1, `9:')')dnl
#include <sysdep.h>
#include <sys/trap.h>
@@ -230,3 +230,5 @@ ifelse(S, `true',
ifelse(OP, `div', `mov Q, %o0', `mov R, %o0')
END(NAME)
+ifelse(OP, `div', ifelse(S, `false', `strong_alias (.udiv, __wrap_.udiv)
+'))dnl
diff --git a/sysdeps/sparc/sparc32/dl-irel.h b/sysdeps/sparc/sparc32/dl-irel.h
index 986bf0c6c5..ffca36864f 100644
--- a/sysdeps/sparc/sparc32/dl-irel.h
+++ b/sysdeps/sparc/sparc32/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
SPARC 32-bit version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h
index 41d67ea2bb..042d02c7ca 100644
--- a/sysdeps/sparc/sparc32/dl-machine.h
+++ b/sysdeps/sparc/sparc32/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. SPARC version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,7 @@
#include <sysdep.h>
#include <tls.h>
#include <dl-plt.h>
+#include <elf/dl-hwcaps.h>
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
@@ -36,10 +37,9 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
return 1;
else if (ehdr->e_machine == EM_SPARC32PLUS)
{
- /* XXX The following is wrong! Dave Miller rejected to implement it
- correctly. If this causes problems shoot *him*! */
-#ifdef SHARED
- return GLRO(dl_hwcap) & GLRO(dl_hwcap_mask) & HWCAP_SPARC_V9;
+#if HAVE_TUNABLES || defined SHARED
+ uint64_t hwcap_mask = GET_HWCAP_MASK();
+ return GLRO(dl_hwcap) & hwcap_mask & HWCAP_SPARC_V9;
#else
return GLRO(dl_hwcap) & HWCAP_SPARC_V9;
#endif
@@ -294,6 +294,7 @@ _dl_start_user:\n\
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
@@ -375,12 +376,13 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
if (__builtin_expect (ELF32_ST_BIND (sym->st_info) == STB_LOCAL, 0)
&& sym->st_shndx != SHN_UNDEF)
{
+ sym_map = map;
value = map->l_addr;
}
else
{
sym_map = RESOLVE_MAP (&sym, version, r_type);
- value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ value = SYMBOL_ADDRESS (sym_map, sym, true);
}
#else
value = 0;
diff --git a/sysdeps/sparc/sparc32/dl-plt.h b/sysdeps/sparc/sparc32/dl-plt.h
index 1b914ea177..c09c0692ad 100644
--- a/sysdeps/sparc/sparc32/dl-plt.h
+++ b/sysdeps/sparc/sparc32/dl-plt.h
@@ -1,5 +1,5 @@
/* PLT fixups. Sparc 32-bit version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/dl-trampoline.S b/sysdeps/sparc/sparc32/dl-trampoline.S
index b8916d5ef0..098ffcfacc 100644
--- a/sysdeps/sparc/sparc32/dl-trampoline.S
+++ b/sysdeps/sparc/sparc32/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. Sparc 32-bit version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/e_sqrt.c b/sysdeps/sparc/sparc32/e_sqrt.c
index 9fab5e3027..d25e779473 100644
--- a/sysdeps/sparc/sparc32/e_sqrt.c
+++ b/sysdeps/sparc/sparc32/e_sqrt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/fpu/e_sqrtl.c b/sysdeps/sparc/sparc32/fpu/e_sqrtl.c
index b0ce44a579..181a39c1cb 100644
--- a/sysdeps/sparc/sparc32/fpu/e_sqrtl.c
+++ b/sysdeps/sparc/sparc32/fpu/e_sqrtl.c
@@ -1,5 +1,5 @@
/* Long double square root, sparc32 version.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/fpu/s_copysign.S b/sysdeps/sparc/sparc32/fpu/s_copysign.S
index 402091483a..7743ee0c67 100644
--- a/sysdeps/sparc/sparc32/fpu/s_copysign.S
+++ b/sysdeps/sparc/sparc32/fpu/s_copysign.S
@@ -1,5 +1,5 @@
/* copysign function, sparc32 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,8 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
ENTRY (__copysign)
sethi %hi(0x80000000), %g1
@@ -28,4 +30,7 @@ ENTRY (__copysign)
retl
ldd [%sp + 72], %f0
END (__copysign)
-weak_alias (__copysign, copysign) \ No newline at end of file
+libm_alias_double (__copysign, copysign)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
+compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/sparc/sparc32/fpu/s_copysignf.S b/sysdeps/sparc/sparc32/fpu/s_copysignf.S
index d60d7c85fd..becfc92e6d 100644
--- a/sysdeps/sparc/sparc32/fpu/s_copysignf.S
+++ b/sysdeps/sparc/sparc32/fpu/s_copysignf.S
@@ -1,5 +1,5 @@
/* float copysign function, sparc32 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
ENTRY (__copysignf)
sethi %hi(0x80000000), %g1
@@ -28,4 +29,4 @@ ENTRY (__copysignf)
retl
ld [%sp + 68], %f0
END (__copysignf)
-weak_alias (__copysignf, copysignf) \ No newline at end of file
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/sparc/sparc32/fpu/s_fabs.S b/sysdeps/sparc/sparc32/fpu/s_fabs.S
index d4c88339c9..db639c94c2 100644
--- a/sysdeps/sparc/sparc32/fpu/s_fabs.S
+++ b/sysdeps/sparc/sparc32/fpu/s_fabs.S
@@ -1,5 +1,5 @@
/* Float absolute value, sparc32 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,8 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
ENTRY (__fabs)
st %o0, [%sp+72]
@@ -25,4 +27,4 @@ ENTRY (__fabs)
retl
fabss %f0, %f0
END (__fabs)
-weak_alias (__fabs, fabs)
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc32/fpu/s_fabsf.S b/sysdeps/sparc/sparc32/fpu/s_fabsf.S
index 9a69af6751..5fcab24125 100644
--- a/sysdeps/sparc/sparc32/fpu/s_fabsf.S
+++ b/sysdeps/sparc/sparc32/fpu/s_fabsf.S
@@ -1,5 +1,5 @@
/* Float absolute value, sparc32 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
ENTRY (__fabsf)
st %o0, [%sp+68]
@@ -25,4 +26,4 @@ ENTRY (__fabsf)
retl
fabss %f0, %f0
END (__fabsf)
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc32/fpu/s_fabsl.c b/sysdeps/sparc/sparc32/fpu/s_fabsl.c
index 3c03b92828..411a2e1511 100644
--- a/sysdeps/sparc/sparc32/fpu/s_fabsl.c
+++ b/sysdeps/sparc/sparc32/fpu/s_fabsl.c
@@ -1,8 +1,9 @@
#include <math.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-ldouble.h>
long double __fabsl (long double x)
{
return __builtin_fabsl (x);
}
-long_double_symbol (libm, __fabsl, fabsl);
+libm_alias_ldouble (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc32/fpu/s_fdim.S b/sysdeps/sparc/sparc32/fpu/s_fdim.S
deleted file mode 100644
index e93970faae..0000000000
--- a/sysdeps/sparc/sparc32/fpu/s_fdim.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Compute positive difference, sparc 32-bit.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <math_ldbl_opt.h>
-
-ENTRY(__fdim)
- std %o0, [%sp + 72]
- std %o2, [%sp + 80]
- ldd [%sp + 72], %f0
- ldd [%sp + 80], %f2
- fcmpd %f0, %f2
- st %g0, [%sp + 72]
- fbug 1f
- st %g0, [%sp + 76]
- ldd [%sp + 72], %f0
- fnegs %f0, %f2
- fmovs %f1, %f3
-1: retl
- fsubd %f0, %f2, %f0
-END(__fdim)
-weak_alias (__fdim, fdim)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
diff --git a/sysdeps/sparc/sparc32/fpu/s_fdimf.S b/sysdeps/sparc/sparc32/fpu/s_fdimf.S
deleted file mode 100644
index c3fe8afa98..0000000000
--- a/sysdeps/sparc/sparc32/fpu/s_fdimf.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Compute positive difference, sparc 32-bit.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY(__fdimf)
- st %o0, [%sp + 72]
- st %o1, [%sp + 76]
- ld [%sp + 72], %f0
- ld [%sp + 76], %f1
- fcmps %f0, %f1
- fbug 1f
- st %g0, [%sp + 72]
- ld [%sp + 72], %f0
- fnegs %f0, %f1
-1: retl
- fsubs %f0, %f1, %f0
-END(__fdimf)
-weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/sparc/sparc32/fpu/s_signbit.S b/sysdeps/sparc/sparc32/fpu/s_signbit.S
index c048b45556..341d668aa5 100644
--- a/sysdeps/sparc/sparc32/fpu/s_signbit.S
+++ b/sysdeps/sparc/sparc32/fpu/s_signbit.S
@@ -1,5 +1,5 @@
/* signbit(). sparc32 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,11 +22,9 @@ ENTRY (__signbit)
retl
srl %o0, 31, %o0
END (__signbit)
-weak_alias (__signbit, signbit)
/* On 32-bit the double version will also always work for
single-precision since in both cases the word with the
sign bit in it is passed always in register %o0. */
strong_alias (__signbit, __signbitf)
hidden_def (__signbitf)
-weak_alias (__signbitf, signbitf)
diff --git a/sysdeps/sparc/sparc32/fpu/s_signbitl.S b/sysdeps/sparc/sparc32/fpu/s_signbitl.S
index 782b121b9d..8f0832a60e 100644
--- a/sysdeps/sparc/sparc32/fpu/s_signbitl.S
+++ b/sysdeps/sparc/sparc32/fpu/s_signbitl.S
@@ -1,5 +1,5 @@
/* signbitl(). sparc32 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/fpu/w_sqrt.S b/sysdeps/sparc/sparc32/fpu/w_sqrt.S
deleted file mode 100644
index 9c66b5c356..0000000000
--- a/sysdeps/sparc/sparc32/fpu/w_sqrt.S
+++ /dev/null
@@ -1,53 +0,0 @@
-/* sqrt function. sparc32 version.
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY (__sqrt)
- clr %g1
- std %g0, [%sp + 72]
- std %o0, [%sp + 80]
- ldd [%sp + 72], %f8
- ldd [%sp + 80], %f0
- fcmpd %f0, %f8
- fbl 1f
- nop
-8: retl
- fsqrtd %f0, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ld [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
-#else
- sethi %hi(_LIB_VERSION), %g1
- or %g1, %lo(_LIB_VERSION), %g1
-#endif
- ld [%g1], %g1
- cmp %g1, -1
- be 8b
- mov %o0, %o2
- mov %o1, %o3
- mov 26, %o4
- mov %o7, %g1
- call __kernel_standard
- mov %g1, %o7
-END (__sqrt)
-
-weak_alias (__sqrt, sqrt)
diff --git a/sysdeps/sparc/sparc32/fpu/w_sqrtf.S b/sysdeps/sparc/sparc32/fpu/w_sqrtf.S
deleted file mode 100644
index a16ab4240a..0000000000
--- a/sysdeps/sparc/sparc32/fpu/w_sqrtf.S
+++ /dev/null
@@ -1,51 +0,0 @@
-/* sqrtf function. sparc32 version.
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY (__sqrtf)
- st %g0, [%sp + 68]
- st %o0, [%sp + 72]
- ld [%sp + 68], %f8
- ld [%sp + 72], %f0
- fcmps %f0, %f8
- fbl 1f
- nop
-8: retl
- fsqrts %f0, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ld [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
-#else
- sethi %hi(_LIB_VERSION), %g1
- or %g1, %lo(_LIB_VERSION), %g1
-#endif
- ld [%g1], %g1
- cmp %g1, -1
- be 8b
- mov %o0, %o1
- mov 126, %o2
- mov %o7, %g1
- call __kernel_standard_f
- mov %g1, %o7
-END (__sqrtf)
-
-weak_alias (__sqrtf, sqrtf)
diff --git a/sysdeps/sparc/sparc32/ieee754.h b/sysdeps/sparc/sparc32/ieee754.h
index fb42140933..d7173b6a8b 100644
--- a/sysdeps/sparc/sparc32/ieee754.h
+++ b/sysdeps/sparc/sparc32/ieee754.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/jmpbuf-offsets.h b/sysdeps/sparc/sparc32/jmpbuf-offsets.h
index 23ca44f257..53c4d44135 100644
--- a/sysdeps/sparc/sparc32/jmpbuf-offsets.h
+++ b/sysdeps/sparc/sparc32/jmpbuf-offsets.h
@@ -1,5 +1,5 @@
/* Private macros for accessing __jmp_buf contents. SPARC version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/jmpbuf-unwind.h b/sysdeps/sparc/sparc32/jmpbuf-unwind.h
index 19925f6f09..8a4656cb58 100644
--- a/sysdeps/sparc/sparc32/jmpbuf-unwind.h
+++ b/sysdeps/sparc/sparc32/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/sparc/sparc32/lowlevellock.c b/sysdeps/sparc/sparc32/lowlevellock.c
index ac42d64225..8b18559bb6 100644
--- a/sysdeps/sparc/sparc32/lowlevellock.c
+++ b/sysdeps/sparc/sparc32/lowlevellock.c
@@ -1,5 +1,5 @@
/* low level locking for pthread library. SPARC version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
diff --git a/sysdeps/sparc/sparc32/lshift.S b/sysdeps/sparc/sparc32/lshift.S
index c98dcd0858..f2cef11d0e 100644
--- a/sysdeps/sparc/sparc32/lshift.S
+++ b/sysdeps/sparc/sparc32/lshift.S
@@ -1,6 +1,6 @@
! Sparc __mpn_lshift --
!
-! Copyright (C) 1995-2016 Free Software Foundation, Inc.
+! Copyright (C) 1995-2018 Free Software Foundation, Inc.
!
! This file is part of the GNU MP Library.
!
diff --git a/sysdeps/sparc/sparc32/memchr.S b/sysdeps/sparc/sparc32/memchr.S
index 9e7a25c4f1..fc8fa3ea3a 100644
--- a/sysdeps/sparc/sparc32/memchr.S
+++ b/sysdeps/sparc/sparc32/memchr.S
@@ -1,7 +1,7 @@
/* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less
than N.
For SPARC v7.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
David S. Miller <davem@caip.rutgers.edu>.
diff --git a/sysdeps/sparc/sparc32/memcpy.S b/sysdeps/sparc/sparc32/memcpy.S
index 539272ae9d..48b3ba87d5 100644
--- a/sysdeps/sparc/sparc32/memcpy.S
+++ b/sysdeps/sparc/sparc32/memcpy.S
@@ -1,6 +1,6 @@
/* Copy SIZE bytes from SRC to DEST.
For SPARC v7.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@caip.rutgers.edu>,
Eddie C. Dost <ecd@skynet.be> and
diff --git a/sysdeps/sparc/sparc32/memset.S b/sysdeps/sparc/sparc32/memset.S
index 13d51c03b9..034e1bc88b 100644
--- a/sysdeps/sparc/sparc32/memset.S
+++ b/sysdeps/sparc/sparc32/memset.S
@@ -1,6 +1,6 @@
/* Set a block of memory to some byte value.
For SPARC v7.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@caip.rutgers.edu> and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc32/mul_1.S b/sysdeps/sparc/sparc32/mul_1.S
index fc6e121eb0..9fbd2e1319 100644
--- a/sysdeps/sparc/sparc32/mul_1.S
+++ b/sysdeps/sparc/sparc32/mul_1.S
@@ -1,7 +1,7 @@
! SPARC __mpn_mul_1 -- Multiply a limb vector with a limb and store
! the result in a second limb vector.
!
-! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+! Copyright (C) 1992-2018 Free Software Foundation, Inc.
!
! This file is part of the GNU MP Library.
!
diff --git a/sysdeps/sparc/sparc32/pthread_spin_lock.S b/sysdeps/sparc/sparc32/pthread_spin_lock.S
index c3c73fbf1c..a2feb1926a 100644
--- a/sysdeps/sparc/sparc32/pthread_spin_lock.S
+++ b/sysdeps/sparc/sparc32/pthread_spin_lock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/pthread_spin_trylock.S b/sysdeps/sparc/sparc32/pthread_spin_trylock.S
index be1ff8fe48..2574eff88f 100644
--- a/sysdeps/sparc/sparc32/pthread_spin_trylock.S
+++ b/sysdeps/sparc/sparc32/pthread_spin_trylock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/pthreaddef.h b/sysdeps/sparc/sparc32/pthreaddef.h
index d82d8e7334..57fe5fd514 100644
--- a/sysdeps/sparc/sparc32/pthreaddef.h
+++ b/sysdeps/sparc/sparc32/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_add.c b/sysdeps/sparc/sparc32/q_add.c
index 2a1d002de5..81c84d2b97 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_add.c
+++ b/sysdeps/sparc/sparc32/q_add.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return a + b
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_cmp.c b/sysdeps/sparc/sparc32/q_cmp.c
index d34836551f..6700df153b 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_cmp.c
+++ b/sysdeps/sparc/sparc32/q_cmp.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Compare a and b, return float condition code.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_cmpe.c b/sysdeps/sparc/sparc32/q_cmpe.c
index cf6e5efd29..b2c5ddfd00 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_cmpe.c
+++ b/sysdeps/sparc/sparc32/q_cmpe.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Compare a and b, return float condition code.
Signal exception (unless masked) if unordered.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_div.c b/sysdeps/sparc/sparc32/q_div.c
index 20348e1163..66e50b2836 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_div.c
+++ b/sysdeps/sparc/sparc32/q_div.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return a / b
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_dtoq.c b/sysdeps/sparc/sparc32/q_dtoq.c
index 17540d6061..17a1b6ac49 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_dtoq.c
+++ b/sysdeps/sparc/sparc32/q_dtoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (long double)(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_feq.c b/sysdeps/sparc/sparc32/q_feq.c
index 9fcfe33912..3b1e00c7c6 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_feq.c
+++ b/sysdeps/sparc/sparc32/q_feq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if a == b
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_fge.c b/sysdeps/sparc/sparc32/q_fge.c
index 78e7b34784..c0aa6051aa 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_fge.c
+++ b/sysdeps/sparc/sparc32/q_fge.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if a >= b
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_fgt.c b/sysdeps/sparc/sparc32/q_fgt.c
index f8ef167a0e..81a7e5330c 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_fgt.c
+++ b/sysdeps/sparc/sparc32/q_fgt.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if a > b
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_fle.c b/sysdeps/sparc/sparc32/q_fle.c
index 210434b043..e2d8ed5cea 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_fle.c
+++ b/sysdeps/sparc/sparc32/q_fle.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if a <= b
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_flt.c b/sysdeps/sparc/sparc32/q_flt.c
index add0a0d37c..e26fc6a484 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_flt.c
+++ b/sysdeps/sparc/sparc32/q_flt.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if a < b
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_fne.c b/sysdeps/sparc/sparc32/q_fne.c
index f06ab0f416..bb35da52de 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_fne.c
+++ b/sysdeps/sparc/sparc32/q_fne.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if a != b
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_itoq.c b/sysdeps/sparc/sparc32/q_itoq.c
index f4b1ff0940..3f94204815 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_itoq.c
+++ b/sysdeps/sparc/sparc32/q_itoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (long double)(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c b/sysdeps/sparc/sparc32/q_lltoq.c
index c5c2af1bba..c785c2b98b 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_lltoq.c
+++ b/sysdeps/sparc/sparc32/q_lltoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (long double)a
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_mul.c b/sysdeps/sparc/sparc32/q_mul.c
index 13f35a83c7..3bb5b7a819 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_mul.c
+++ b/sysdeps/sparc/sparc32/q_mul.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return a * b
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_neg.c b/sysdeps/sparc/sparc32/q_neg.c
index b0abb9c238..1e0e0b7678 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_neg.c
+++ b/sysdeps/sparc/sparc32/q_neg.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return !a
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtod.c b/sysdeps/sparc/sparc32/q_qtod.c
index a1974a61fd..5ad733a694 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_qtod.c
+++ b/sysdeps/sparc/sparc32/q_qtod.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (double)a
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoi.c b/sysdeps/sparc/sparc32/q_qtoi.c
index 58ad27b7b4..0b5af2327e 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_qtoi.c
+++ b/sysdeps/sparc/sparc32/q_qtoi.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (int)a
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c b/sysdeps/sparc/sparc32/q_qtoll.c
index 11061d0c11..34c7b0b301 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_qtoll.c
+++ b/sysdeps/sparc/sparc32/q_qtoll.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (long long)a
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtos.c b/sysdeps/sparc/sparc32/q_qtos.c
index 690bd33887..8e21c8270d 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_qtos.c
+++ b/sysdeps/sparc/sparc32/q_qtos.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (float)a
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtou.c b/sysdeps/sparc/sparc32/q_qtou.c
index e0d37ff973..0f2e55780a 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_qtou.c
+++ b/sysdeps/sparc/sparc32/q_qtou.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (unsigned int)a
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c b/sysdeps/sparc/sparc32/q_qtoull.c
index 581f89f5eb..1501e81fba 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_qtoull.c
+++ b/sysdeps/sparc/sparc32/q_qtoull.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (unsigned long long)a
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_sqrt.c b/sysdeps/sparc/sparc32/q_sqrt.c
index 999398e5df..d4d455c6cb 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_sqrt.c
+++ b/sysdeps/sparc/sparc32/q_sqrt.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return sqrtl(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_stoq.c b/sysdeps/sparc/sparc32/q_stoq.c
index 9dc7674202..97896d73bb 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_stoq.c
+++ b/sysdeps/sparc/sparc32/q_stoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
c = (long double)(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_sub.c b/sysdeps/sparc/sparc32/q_sub.c
index 96a65249d6..dd25722c25 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_sub.c
+++ b/sysdeps/sparc/sparc32/q_sub.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
c = a - b
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c b/sysdeps/sparc/sparc32/q_ulltoq.c
index 9f7410ba47..abed54fc33 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c
+++ b/sysdeps/sparc/sparc32/q_ulltoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (long double)(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_util.c b/sysdeps/sparc/sparc32/q_util.c
index 1da2ddc8ad..82b7a84c37 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_util.c
+++ b/sysdeps/sparc/sparc32/q_util.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Helper routine for _Q_* routines.
Simulate exceptions using double arithmetics.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/soft-fp/q_utoq.c b/sysdeps/sparc/sparc32/q_utoq.c
index d627286d29..cd0707e037 100644
--- a/sysdeps/sparc/sparc32/soft-fp/q_utoq.c
+++ b/sysdeps/sparc/sparc32/q_utoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
c = (long double)(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc32/rem.S b/sysdeps/sparc/sparc32/rem.S
index 349d7c0115..79e09a9ef8 100644
--- a/sysdeps/sparc/sparc32/rem.S
+++ b/sysdeps/sparc/sparc32/rem.S
@@ -341,7 +341,7 @@ LOC(4.9):
- 9:
+9:
LOC(end_regular_divide):
subcc %o4, 1, %o4
bge LOC(divloop)
diff --git a/sysdeps/sparc/sparc32/rshift.S b/sysdeps/sparc/sparc32/rshift.S
index f6289520a8..925decb485 100644
--- a/sysdeps/sparc/sparc32/rshift.S
+++ b/sysdeps/sparc/sparc32/rshift.S
@@ -1,6 +1,6 @@
! sparc __mpn_rshift --
!
-! Copyright (C) 1995-2016 Free Software Foundation, Inc.
+! Copyright (C) 1995-2018 Free Software Foundation, Inc.
!
! This file is part of the GNU MP Library.
!
diff --git a/sysdeps/sparc/sparc32/sdiv.S b/sysdeps/sparc/sparc32/sdiv.S
index d1d4ee31f8..ab29718827 100644
--- a/sysdeps/sparc/sparc32/sdiv.S
+++ b/sysdeps/sparc/sparc32/sdiv.S
@@ -341,7 +341,7 @@ LOC(4.9):
- 9:
+9:
LOC(end_regular_divide):
subcc %o4, 1, %o4
bge LOC(divloop)
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_post.c b/sysdeps/sparc/sparc32/sem_post.c
index 415a3d5486..623e6bf9a7 100644
--- a/sysdeps/sparc/sparc32/sem_post.c
+++ b/sysdeps/sparc/sparc32/sem_post.c
@@ -1,5 +1,5 @@
/* sem_post -- post to a POSIX semaphore. Generic futex-using version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
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/sem_waitcommon.c b/sysdeps/sparc/sparc32/sem_waitcommon.c
index 5340f57477..1ddd65f745 100644
--- a/sysdeps/sparc/sparc32/sem_waitcommon.c
+++ b/sysdeps/sparc/sparc32/sem_waitcommon.c
@@ -1,5 +1,5 @@
/* sem_waitcommon -- wait on a semaphore, shared code.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
diff --git a/sysdeps/sparc/sparc32/setjmp.S b/sysdeps/sparc/sparc32/setjmp.S
index 6d0989fd65..eaa0af2539 100644
--- a/sysdeps/sparc/sparc32/setjmp.S
+++ b/sysdeps/sparc/sparc32/setjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,6 +53,7 @@ ENTRY (__sigsetjmp)
call __sigjmp_save
mov %g1, %o7
END(__sigsetjmp)
+hidden_def (__sigsetjmp)
weak_extern(_setjmp)
weak_extern(setjmp)
diff --git a/sysdeps/sparc/sparc32/sfp-machine.h b/sysdeps/sparc/sparc32/sfp-machine.h
new file mode 100644
index 0000000000..ee5f33911a
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sfp-machine.h
@@ -0,0 +1,218 @@
+/* Machine-dependent software floating-point definitions.
+ Sparc userland (_Q_*) version.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com),
+ Jakub Jelinek (jj@ultra.linux.cz) and
+ David S. Miller (davem@redhat.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <fpu_control.h>
+#include <stdlib.h>
+
+#define _FP_W_TYPE_SIZE 32
+#define _FP_W_TYPE unsigned long
+#define _FP_WS_TYPE signed long
+#define _FP_I_TYPE long
+
+#define _FP_MUL_MEAT_S(R,X,Y) \
+ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_D(R,X,Y) \
+ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y) \
+ _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_udiv(S,R,X,Y)
+#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
+#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
+#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
+#define _FP_NANSIGN_S 0
+#define _FP_NANSIGN_D 0
+#define _FP_NANSIGN_Q 0
+
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
+
+/* If one NaN is signaling and the other is not,
+ * we choose that one, otherwise we choose X.
+ */
+/* For _Qp_* and _Q_*, this should prefer X, for
+ * CPU instruction emulation this should prefer Y.
+ * (see SPAMv9 B.2.2 section).
+ */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do { \
+ if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
+ && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
+ { \
+ R##_s = Y##_s; \
+ _FP_FRAC_COPY_##wc(R,Y); \
+ } \
+ else \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc(R,X); \
+ } \
+ R##_c = FP_CLS_NAN; \
+ } while (0)
+
+/* Some assembly to speed things up. */
+#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
+ __asm__ ("addcc %r7,%8,%2\n\
+ addxcc %r5,%6,%1\n\
+ addx %r3,%4,%0" \
+ : "=r" ((USItype)(r2)), \
+ "=&r" ((USItype)(r1)), \
+ "=&r" ((USItype)(r0)) \
+ : "%rJ" ((USItype)(x2)), \
+ "rI" ((USItype)(y2)), \
+ "%rJ" ((USItype)(x1)), \
+ "rI" ((USItype)(y1)), \
+ "%rJ" ((USItype)(x0)), \
+ "rI" ((USItype)(y0)) \
+ : "cc")
+
+#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
+ __asm__ ("subcc %r7,%8,%2\n\
+ subxcc %r5,%6,%1\n\
+ subx %r3,%4,%0" \
+ : "=r" ((USItype)(r2)), \
+ "=&r" ((USItype)(r1)), \
+ "=&r" ((USItype)(r0)) \
+ : "%rJ" ((USItype)(x2)), \
+ "rI" ((USItype)(y2)), \
+ "%rJ" ((USItype)(x1)), \
+ "rI" ((USItype)(y1)), \
+ "%rJ" ((USItype)(x0)), \
+ "rI" ((USItype)(y0)) \
+ : "cc")
+
+#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
+ do { \
+ /* We need to fool gcc, as we need to pass more than 10 \
+ input/outputs. */ \
+ register USItype _t1 __asm__ ("g1"), _t2 __asm__ ("g2"); \
+ __asm__ __volatile__ ("\
+ addcc %r8,%9,%1\n\
+ addxcc %r6,%7,%0\n\
+ addxcc %r4,%5,%%g2\n\
+ addx %r2,%3,%%g1" \
+ : "=&r" ((USItype)(r1)), \
+ "=&r" ((USItype)(r0)) \
+ : "%rJ" ((USItype)(x3)), \
+ "rI" ((USItype)(y3)), \
+ "%rJ" ((USItype)(x2)), \
+ "rI" ((USItype)(y2)), \
+ "%rJ" ((USItype)(x1)), \
+ "rI" ((USItype)(y1)), \
+ "%rJ" ((USItype)(x0)), \
+ "rI" ((USItype)(y0)) \
+ : "cc", "g1", "g2"); \
+ __asm__ __volatile__ ("" : "=r" (_t1), "=r" (_t2)); \
+ r3 = _t1; r2 = _t2; \
+ } while (0)
+
+#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
+ do { \
+ /* We need to fool gcc, as we need to pass more than 10 \
+ input/outputs. */ \
+ register USItype _t1 __asm__ ("g1"), _t2 __asm__ ("g2"); \
+ __asm__ __volatile__ ("\
+ subcc %r8,%9,%1\n\
+ subxcc %r6,%7,%0\n\
+ subxcc %r4,%5,%%g2\n\
+ subx %r2,%3,%%g1" \
+ : "=&r" ((USItype)(r1)), \
+ "=&r" ((USItype)(r0)) \
+ : "%rJ" ((USItype)(x3)), \
+ "rI" ((USItype)(y3)), \
+ "%rJ" ((USItype)(x2)), \
+ "rI" ((USItype)(y2)), \
+ "%rJ" ((USItype)(x1)), \
+ "rI" ((USItype)(y1)), \
+ "%rJ" ((USItype)(x0)), \
+ "rI" ((USItype)(y0)) \
+ : "cc", "g1", "g2"); \
+ __asm__ __volatile__ ("" : "=r" (_t1), "=r" (_t2)); \
+ r3 = _t1; r2 = _t2; \
+ } while (0)
+
+#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0) __FP_FRAC_SUB_3(x2,x1,x0,x2,x1,x0,y2,y1,y0)
+
+#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0) __FP_FRAC_SUB_4(x3,x2,x1,x0,x3,x2,x1,x0,y3,y2,y1,y0)
+
+#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i) \
+ __asm__ ("addcc %3,%4,%3\n\
+ addxcc %2,%%g0,%2\n\
+ addxcc %1,%%g0,%1\n\
+ addx %0,%%g0,%0" \
+ : "=&r" ((USItype)(x3)), \
+ "=&r" ((USItype)(x2)), \
+ "=&r" ((USItype)(x1)), \
+ "=&r" ((USItype)(x0)) \
+ : "rI" ((USItype)(i)), \
+ "0" ((USItype)(x3)), \
+ "1" ((USItype)(x2)), \
+ "2" ((USItype)(x1)), \
+ "3" ((USItype)(x0)) \
+ : "cc")
+
+/* Obtain the current rounding mode. */
+#ifndef FP_ROUNDMODE
+#define FP_ROUNDMODE ((_fcw >> 30) & 0x3)
+#endif
+
+/* Exception flags. */
+#define FP_EX_INVALID (1 << 4)
+#define FP_EX_OVERFLOW (1 << 3)
+#define FP_EX_UNDERFLOW (1 << 2)
+#define FP_EX_DIVZERO (1 << 1)
+#define FP_EX_INEXACT (1 << 0)
+
+#define _FP_TININESS_AFTER_ROUNDING 0
+
+#define _FP_DECL_EX \
+ fpu_control_t _fcw __attribute__ ((unused)) = (FP_RND_NEAREST << 30)
+
+#define FP_INIT_ROUNDMODE \
+do { \
+ _FPU_GETCW(_fcw); \
+} while (0)
+
+#define FP_TRAPPING_EXCEPTIONS ((_fcw >> 23) & 0x1f)
+#define FP_INHIBIT_RESULTS ((_fcw >> 23) & _fex)
+
+/* Simulate exceptions using double arithmetics. */
+extern void ___Q_simulate_exceptions(int exc);
+
+#define FP_HANDLE_EXCEPTIONS \
+do { \
+ if (!_fex) \
+ { \
+ /* This is the common case, so we do it inline. \
+ * We need to clear cexc bits if any. \
+ */ \
+ extern unsigned long long ___Q_zero; \
+ __asm__ __volatile__("ldd [%0], %%f30\n\t" \
+ "faddd %%f30, %%f30, %%f30" \
+ : : "r" (&___Q_zero) : "f30"); \
+ } \
+ else \
+ ___Q_simulate_exceptions (_fex); \
+} while (0)
diff --git a/sysdeps/sparc/sparc32/soft-fp/Makefile b/sysdeps/sparc/sparc32/soft-fp/Makefile
deleted file mode 100644
index b3b498a0d2..0000000000
--- a/sysdeps/sparc/sparc32/soft-fp/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# Software floating-point emulation.
-# Makefile for SPARC v8 long double utility functions (_Q_*).
-# Copyright (C) 1999-2016 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-# Contributed by Jakub Jelinek (jj@ultra.linux.cz).
-#
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License 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),soft-fp)
-sparc32-quad-routines := q_add q_cmp q_cmpe q_div q_dtoq q_feq q_fge \
- q_fgt q_fle q_flt q_fne q_itoq q_mul q_neg q_qtod q_qtoi \
- q_qtos q_qtou q_qtoull q_qtoll q_sqrt q_stoq q_sub q_utoq \
- q_ulltoq q_lltoq q_util
-sysdep_routines += $(sparc32-quad-routines)
-
-endif
diff --git a/sysdeps/sparc/sparc32/soft-fp/Versions b/sysdeps/sparc/sparc32/soft-fp/Versions
deleted file mode 100644
index 6a09249c46..0000000000
--- a/sysdeps/sparc/sparc32/soft-fp/Versions
+++ /dev/null
@@ -1,8 +0,0 @@
-libc {
- GLIBC_2.4 {
- _Q_add; _Q_cmp; _Q_cmpe; _Q_div; _Q_dtoq; _Q_feq; _Q_fge; _Q_fgt;
- _Q_fle; _Q_flt; _Q_fne; _Q_itoq; _Q_mul; _Q_neg; _Q_qtod; _Q_qtoi;
- _Q_qtos; _Q_qtou; _Q_qtoull; _Q_qtoll; _Q_sqrt; _Q_stoq; _Q_sub;
- _Q_utoq; _Q_ulltoq; _Q_lltoq;
- }
-}
diff --git a/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h b/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h
deleted file mode 100644
index 1b896cc575..0000000000
--- a/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/* Machine-dependent software floating-point definitions.
- Sparc userland (_Q_*) version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com),
- Jakub Jelinek (jj@ultra.linux.cz) and
- David S. Miller (davem@redhat.com).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <fpu_control.h>
-#include <stdlib.h>
-
-#define _FP_W_TYPE_SIZE 32
-#define _FP_W_TYPE unsigned long
-#define _FP_WS_TYPE signed long
-#define _FP_I_TYPE long
-
-#define _FP_MUL_MEAT_S(R,X,Y) \
- _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_D(R,X,Y) \
- _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_Q(R,X,Y) \
- _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_udiv(S,R,X,Y)
-#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
-#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
-
-#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
-#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
-#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
-#define _FP_NANSIGN_S 0
-#define _FP_NANSIGN_D 0
-#define _FP_NANSIGN_Q 0
-
-#define _FP_KEEPNANFRACP 1
-#define _FP_QNANNEGATEDP 0
-
-/* If one NaN is signaling and the other is not,
- * we choose that one, otherwise we choose X.
- */
-/* For _Qp_* and _Q_*, this should prefer X, for
- * CPU instruction emulation this should prefer Y.
- * (see SPAMv9 B.2.2 section).
- */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
- do { \
- if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
- && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
- { \
- R##_s = Y##_s; \
- _FP_FRAC_COPY_##wc(R,Y); \
- } \
- else \
- { \
- R##_s = X##_s; \
- _FP_FRAC_COPY_##wc(R,X); \
- } \
- R##_c = FP_CLS_NAN; \
- } while (0)
-
-/* Some assembly to speed things up. */
-#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
- __asm__ ("addcc %r7,%8,%2\n\
- addxcc %r5,%6,%1\n\
- addx %r3,%4,%0" \
- : "=r" ((USItype)(r2)), \
- "=&r" ((USItype)(r1)), \
- "=&r" ((USItype)(r0)) \
- : "%rJ" ((USItype)(x2)), \
- "rI" ((USItype)(y2)), \
- "%rJ" ((USItype)(x1)), \
- "rI" ((USItype)(y1)), \
- "%rJ" ((USItype)(x0)), \
- "rI" ((USItype)(y0)) \
- : "cc")
-
-#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
- __asm__ ("subcc %r7,%8,%2\n\
- subxcc %r5,%6,%1\n\
- subx %r3,%4,%0" \
- : "=r" ((USItype)(r2)), \
- "=&r" ((USItype)(r1)), \
- "=&r" ((USItype)(r0)) \
- : "%rJ" ((USItype)(x2)), \
- "rI" ((USItype)(y2)), \
- "%rJ" ((USItype)(x1)), \
- "rI" ((USItype)(y1)), \
- "%rJ" ((USItype)(x0)), \
- "rI" ((USItype)(y0)) \
- : "cc")
-
-#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
- do { \
- /* We need to fool gcc, as we need to pass more than 10 \
- input/outputs. */ \
- register USItype _t1 __asm__ ("g1"), _t2 __asm__ ("g2"); \
- __asm__ __volatile__ ("\
- addcc %r8,%9,%1\n\
- addxcc %r6,%7,%0\n\
- addxcc %r4,%5,%%g2\n\
- addx %r2,%3,%%g1" \
- : "=&r" ((USItype)(r1)), \
- "=&r" ((USItype)(r0)) \
- : "%rJ" ((USItype)(x3)), \
- "rI" ((USItype)(y3)), \
- "%rJ" ((USItype)(x2)), \
- "rI" ((USItype)(y2)), \
- "%rJ" ((USItype)(x1)), \
- "rI" ((USItype)(y1)), \
- "%rJ" ((USItype)(x0)), \
- "rI" ((USItype)(y0)) \
- : "cc", "g1", "g2"); \
- __asm__ __volatile__ ("" : "=r" (_t1), "=r" (_t2)); \
- r3 = _t1; r2 = _t2; \
- } while (0)
-
-#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
- do { \
- /* We need to fool gcc, as we need to pass more than 10 \
- input/outputs. */ \
- register USItype _t1 __asm__ ("g1"), _t2 __asm__ ("g2"); \
- __asm__ __volatile__ ("\
- subcc %r8,%9,%1\n\
- subxcc %r6,%7,%0\n\
- subxcc %r4,%5,%%g2\n\
- subx %r2,%3,%%g1" \
- : "=&r" ((USItype)(r1)), \
- "=&r" ((USItype)(r0)) \
- : "%rJ" ((USItype)(x3)), \
- "rI" ((USItype)(y3)), \
- "%rJ" ((USItype)(x2)), \
- "rI" ((USItype)(y2)), \
- "%rJ" ((USItype)(x1)), \
- "rI" ((USItype)(y1)), \
- "%rJ" ((USItype)(x0)), \
- "rI" ((USItype)(y0)) \
- : "cc", "g1", "g2"); \
- __asm__ __volatile__ ("" : "=r" (_t1), "=r" (_t2)); \
- r3 = _t1; r2 = _t2; \
- } while (0)
-
-#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0) __FP_FRAC_SUB_3(x2,x1,x0,x2,x1,x0,y2,y1,y0)
-
-#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0) __FP_FRAC_SUB_4(x3,x2,x1,x0,x3,x2,x1,x0,y3,y2,y1,y0)
-
-#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i) \
- __asm__ ("addcc %3,%4,%3\n\
- addxcc %2,%%g0,%2\n\
- addxcc %1,%%g0,%1\n\
- addx %0,%%g0,%0" \
- : "=&r" ((USItype)(x3)), \
- "=&r" ((USItype)(x2)), \
- "=&r" ((USItype)(x1)), \
- "=&r" ((USItype)(x0)) \
- : "rI" ((USItype)(i)), \
- "0" ((USItype)(x3)), \
- "1" ((USItype)(x2)), \
- "2" ((USItype)(x1)), \
- "3" ((USItype)(x0)) \
- : "cc")
-
-/* Obtain the current rounding mode. */
-#ifndef FP_ROUNDMODE
-#define FP_ROUNDMODE ((_fcw >> 30) & 0x3)
-#endif
-
-/* Exception flags. */
-#define FP_EX_INVALID (1 << 4)
-#define FP_EX_OVERFLOW (1 << 3)
-#define FP_EX_UNDERFLOW (1 << 2)
-#define FP_EX_DIVZERO (1 << 1)
-#define FP_EX_INEXACT (1 << 0)
-
-#define _FP_TININESS_AFTER_ROUNDING 0
-
-#define _FP_DECL_EX \
- fpu_control_t _fcw __attribute__ ((unused)) = (FP_RND_NEAREST << 30)
-
-#define FP_INIT_ROUNDMODE \
-do { \
- _FPU_GETCW(_fcw); \
-} while (0)
-
-#define FP_TRAPPING_EXCEPTIONS ((_fcw >> 23) & 0x1f)
-#define FP_INHIBIT_RESULTS ((_fcw >> 23) & _fex)
-
-/* Simulate exceptions using double arithmetics. */
-extern void ___Q_simulate_exceptions(int exc);
-
-#define FP_HANDLE_EXCEPTIONS \
-do { \
- if (!_fex) \
- { \
- /* This is the common case, so we do it inline. \
- * We need to clear cexc bits if any. \
- */ \
- extern unsigned long long ___Q_zero; \
- __asm__ __volatile__("ldd [%0], %%f30\n\t" \
- "faddd %%f30, %%f30, %%f30" \
- : : "r" (&___Q_zero) : "f30"); \
- } \
- else \
- ___Q_simulate_exceptions (_fex); \
-} while (0)
diff --git a/sysdeps/sparc/sparc32/sparcv8/addmul_1.S b/sysdeps/sparc/sparc32/sparcv8/addmul_1.S
index 45c364ee99..ba2d56bdb2 100644
--- a/sysdeps/sparc/sparc32/sparcv8/addmul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv8/addmul_1.S
@@ -1,7 +1,7 @@
! SPARC v8 __mpn_addmul_1 -- Multiply a limb vector with a limb and
! add the result to a second limb vector.
-! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+! Copyright (C) 1992-2018 Free Software Foundation, Inc.
! This file is part of the GNU MP Library.
diff --git a/sysdeps/sparc/sparc32/sparcv8/mul_1.S b/sysdeps/sparc/sparc32/sparcv8/mul_1.S
index dd157c514e..eb2ffd5dc4 100644
--- a/sysdeps/sparc/sparc32/sparcv8/mul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv8/mul_1.S
@@ -1,7 +1,7 @@
! SPARC v8 __mpn_mul_1 -- Multiply a limb vector with a single limb and
! store the product in a second limb vector.
-! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+! Copyright (C) 1992-2018 Free Software Foundation, Inc.
! This file is part of the GNU MP Library.
diff --git a/sysdeps/sparc/sparc32/sparcv8/submul_1.S b/sysdeps/sparc/sparc32/sparcv8/submul_1.S
index 35c68e89e0..2272645b1d 100644
--- a/sysdeps/sparc/sparc32/sparcv8/submul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv8/submul_1.S
@@ -1,7 +1,7 @@
! SPARC v8 __mpn_submul_1 -- Multiply a limb vector with a limb and
! subtract the result from a second limb vector.
-! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+! Copyright (C) 1992-2018 Free Software Foundation, Inc.
! This file is part of the GNU MP Library.
diff --git a/sysdeps/sparc/sparc32/sparcv8/udiv.S b/sysdeps/sparc/sparc32/sparcv8/udiv.S
index d71954351e..e9cab4e4ef 100644
--- a/sysdeps/sparc/sparc32/sparcv8/udiv.S
+++ b/sysdeps/sparc/sparc32/sparcv8/udiv.S
@@ -13,3 +13,4 @@ ENTRY(.udiv)
udiv %o0, %o1, %o0
END(.udiv)
+strong_alias (.udiv, __wrap_.udiv)
diff --git a/sysdeps/sparc/sparc32/sparcv9/Makefile b/sysdeps/sparc/sparc32/sparcv9/Makefile
index fefc742478..45507eabdb 100644
--- a/sysdeps/sparc/sparc32/sparcv9/Makefile
+++ b/sysdeps/sparc/sparc32/sparcv9/Makefile
@@ -1,18 +1,9 @@
-sysdep-CFLAGS += -mcpu=ultrasparc -Wa,-Av9a
+sysdep-CFLAGS += -mcpu=ultrasparc -Wa,-Av9a -mvis
-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
# nscd uses atomic_spin_nop which in turn requires cpu_relax
ifeq ($(subdir),nscd)
diff --git a/sysdeps/sparc/sparc32/sparcv9/addmul_1.S b/sysdeps/sparc/sparc32/sparcv9/addmul_1.S
index 11b73f4195..a85212b29b 100644
--- a/sysdeps/sparc/sparc32/sparcv9/addmul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv9/addmul_1.S
@@ -1,7 +1,7 @@
! SPARC v9 32-bit __mpn_addmul_1 -- Multiply a limb vector with a limb
! and add the result to a second limb vector.
!
-! Copyright (C) 2013-2016 Free Software Foundation, Inc.
+! Copyright (C) 2013-2018 Free Software Foundation, Inc.
! This file is part of the GNU C Library.
! Contributed by David S. Miller <davem@davemloft.net>
!
diff --git a/sysdeps/sparc/sparc32/sparcv9/atomic-machine.h b/sysdeps/sparc/sparc32/sparcv9/atomic-machine.h
index b02ceae95b..c4c5239f51 100644
--- a/sysdeps/sparc/sparc32/sparcv9/atomic-machine.h
+++ b/sysdeps/sparc/sparc32/sparcv9/atomic-machine.h
@@ -1,5 +1,5 @@
/* Atomic operations. sparcv9 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -47,6 +47,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 0
+
#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
(abort (), (__typeof (*mem)) 0)
diff --git a/sysdeps/sparc/sparc32/sparcv9/cpu_relax.S b/sysdeps/sparc/sparc32/sparcv9/cpu_relax.S
deleted file mode 100644
index 41a5e72b25..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/cpu_relax.S
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/sparc/sparc64/cpu_relax.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/cpu_relax.c b/sysdeps/sparc/sparc32/sparcv9/cpu_relax.c
new file mode 100644
index 0000000000..1670cf6558
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/cpu_relax.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/cpu_relax.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
index 0d92813d7b..1a26ee19c3 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
@@ -1,15 +1,23 @@
ifeq ($(subdir),math)
-libm-sysdep_routines += s_ceil-vis2 s_ceilf-vis2 \
- s_floor-vis2 s_floorf-vis2
-ifeq ($(have-as-vis3),yes)
-libm-sysdep_routines += m_copysignf-vis3 m_copysign-vis3 s_ceilf-vis3 \
- s_ceil-vis3 s_fabs-vis3 s_fabsf-vis3 s_floor-vis3 \
- s_floorf-vis3 s_llrintf-vis3 s_llrint-vis3 \
- s_rintf-vis3 s_rint-vis3 w_sqrt-vis3 w_sqrtf-vis3 \
- s_fminf-vis3 s_fmin-vis3 s_fmaxf-vis3 s_fmax-vis3 \
- s_fmaf-vis3 s_fma-vis3 s_fdimf-vis3 s_fdim-vis3 \
- s_nearbyint-vis3 s_nearbyintf-vis3 s_truncf-vis3 \
- s_trunc-vis3
-sysdep_routines += s_copysignf-vis3 s_copysign-vis3
-endif
+
+# These functions are built both for libc and libm because they're required
+# by printf. While the libc objects have the prefix s_, the libm ones are
+# prefixed with m_.
+sysdep_calls := s_copysignf-vis3 s_copysign-vis3 s_copysignf-generic \
+ s_copysign-generic
+
+sysdep_routines += $(sysdep_calls)
+libm-sysdep_routines += s_fabs-vis3 s_fabsf-vis3 s_fabs-generic \
+ s_fabsf-generic s_llrintf-vis3 s_llrint-vis3 \
+ s_llrintf-generic s_llrint-generic \
+ s_rintf-vis3 s_rint-vis3 s_rintf-generic \
+ s_rint-generic s_fmaf-vis3 s_fma-vis3 s_fma-generic \
+ s_fmaf-generic s_nearbyint-vis3 s_nearbyintf-vis3 \
+ s_nearbyint-generic s_nearbyintf-generic \
+ s_fdimf-vis3 s_fdim-vis3 s_fdim-generic \
+ s_fdimf-generic \
+ $(sysdep_calls:s_%=m_%)
+
+CFLAGS-s_fdimf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_fdim-vis3.c += -Wa,-Av9d -mvis3
endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S
deleted file mode 100644
index edc24b3064..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ceil function, sparc32 v9 vis2 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceil_vis2)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o0, 32, %o0
- or %o0, %o1, %o0
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fzero ZERO
- ldd [%sp + 72], %f0
- fnegd ZERO, SIGN_BIT
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
- ldd [%sp + 72], %f16
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__ceil_vis2)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S
deleted file mode 100644
index 8b14c6896a..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ceil function, sparc32 v9 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceil_vis3)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o0, 32, %o0
- sllx %o2, 32, %o2
- or %o0, %o1, %o0
- movxtod %o0, %f0
- fzero ZERO
- fnegd ZERO, SIGN_BIT
- movxtod %o2, %f16
- fabsd %f0, %f14
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__ceil_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S
deleted file mode 100644
index efc8d49365..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(ceil)
-
-weak_alias (__ceil, ceil)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __ceil __ceil_generic
-
-#include "../s_ceil.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S
deleted file mode 100644
index 019681b5f2..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Float ceil function, sparc32 v9 vis2 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceilf_vis2)
- st %o0, [%sp + 68]
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- ld [%sp + 68], %f0
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + 68]
- fabss %f0, %f14
- ld [%sp + 68], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- fadds %f0, %f16, %f1
- siam (1 << 2) | 0
- fsubs %f1, %f16, %f1
- siam (0 << 2)
- retl
- fors %f1, SIGN_BIT, %f0
-END (__ceilf_vis2)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S
deleted file mode 100644
index 1bf306a115..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Float ceil function, sparc32 v9 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceilf_vis3)
- movwtos %o0, %f0
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2, %f16
- fabss %f0, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- fadds %f0, %f16, %f1
- siam (1 << 2) | 0
- fsubs %f1, %f16, %f1
- siam (0 << 2)
- retl
- fors %f1, SIGN_BIT, %f0
-END (__ceilf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S
deleted file mode 100644
index 1c72a5728e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(ceilf)
-
-weak_alias (__ceilf, ceilf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __ceilf __ceilf_generic
-
-#include "../s_ceilf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S
new file mode 100644
index 0000000000..9aa3486277
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S
@@ -0,0 +1,8 @@
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
+#define __copysign __copysign_generic
+#undef libm_alias_double
+#define libm_alias_double(a, b)
+#undef compat_symbol
+#define compat_symbol(a, b, c, d)
+#include <sysdeps/sparc/sparc32/fpu/s_copysign.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S
index 802c77217d..8d6b047618 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S
@@ -1,5 +1,5 @@
/* copysign function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S
deleted file mode 100644
index cdd98c00f4..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(copysign)
-
-weak_alias (__copysign, copysign)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __copysign __copysign_generic
-
-#include "../../../fpu/s_copysign.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c
new file mode 100644
index 0000000000..291e697d99
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c
@@ -0,0 +1,37 @@
+/* copysign ifunc resolver, Linux/sparc32 version.
+ Copyright (C) 2017-2018 Free Software 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 __copysign __redirect_copysign
+#include <math.h>
+#include <math_ldbl_opt.h>
+#undef __copysign
+#include <libm-alias-double.h>
+#include <sparc-ifunc.h>
+
+extern __typeof (__redirect_copysign) __copysign_vis3 attribute_hidden;
+extern __typeof (__redirect_copysign) __copysign_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_copysign, __copysign,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __copysign_vis3
+ : __copysign_generic);
+libm_alias_double (__copysign, copysign)
+
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
+compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S
new file mode 100644
index 0000000000..685027500a
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-float.h>
+#define __copysignf __copysignf_generic
+#undef libm_alias_float
+#define libm_alias_float(a, b)
+#include <sysdeps/sparc/sparc32/fpu/s_copysignf.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S
index 82ce4adf2c..dfe48da8e2 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S
@@ -1,5 +1,5 @@
/* float copysign function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S
deleted file mode 100644
index cd409550de..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(copysignf)
-
-weak_alias (__copysignf, copysignf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __copysignf __copysignf_generic
-
-#include "../../../fpu/s_copysignf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c
new file mode 100644
index 0000000000..c051167b48
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c
@@ -0,0 +1,30 @@
+/* copysign ifunc resolver, Linux/sparc32 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+#include <libm-alias-float.h>
+
+extern __typeof (copysignf) __copysignf_vis3 attribute_hidden;
+extern __typeof (copysignf) __copysignf_generic attribute_hidden;
+
+sparc_libm_ifunc (__copysignf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __copysignf_vis3
+ : __copysignf_generic);
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-generic.S
new file mode 100644
index 0000000000..267dbd2352
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-double.h>
+#define __fabs __fabs_generic
+#undef libm_alias_double
+#define libm_alias_double(a, b)
+#include <sysdeps/sparc/sparc32/fpu/s_fabs.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S
index ea40b6fb66..e183d7d138 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S
@@ -1,5 +1,5 @@
/* Float absolute value, sparc32+v9 vis3 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S
deleted file mode 100644
index 86c63989a4..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fabs)
-
-weak_alias (__fabs, fabs)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fabs __fabs_generic
-
-#include "../s_fabs.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.c
new file mode 100644
index 0000000000..e4edf0124d
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.c
@@ -0,0 +1,32 @@
+/* fabs ifunc resolver, Linux/sparc32 version.
+ Copyright (C) 2017-2018 Free Software 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 __fabs __redirect_fabs
+#include <math.h>
+#undef __fabs
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (__redirect_fabs) __fabs_vis3 attribute_hidden;
+extern __typeof (__redirect_fabs) __fabs_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_fabs, __fabs,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __fabs_vis3
+ : __fabs_generic);
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-generic.S
new file mode 100644
index 0000000000..b6fb38f34c
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-float.h>
+#define __fabsf __fabsf_generic
+#undef libm_alias_float
+#define libm_alias_float(a, b)
+#include <sysdeps/sparc/sparc32/fpu/s_fabsf.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S
index be44e85719..805da5ed07 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S
@@ -1,5 +1,5 @@
/* Float absolute value, sparc32 vis3 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S
deleted file mode 100644
index 0f2e11e01f..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fabsf)
-
-weak_alias (__fabsf, fabsf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fabsf __fabsf_generic
-
-#include "../../../fpu/s_fabsf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.c
new file mode 100644
index 0000000000..252ad8f714
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.c
@@ -0,0 +1,30 @@
+/* fabsf ifunc resolver, Linux/sparc32 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+#include <libm-alias-float.h>
+
+extern __typeof (fabsf) __fabsf_vis3 attribute_hidden;
+extern __typeof (fabsf) __fabsf_generic attribute_hidden;
+
+sparc_libm_ifunc (__fabsf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __fabsf_vis3
+ : __fabsf_generic);
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c
new file mode 100644
index 0000000000..30ee54b0c1
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c
@@ -0,0 +1,4 @@
+#define __fdim __fdim_generic
+#define declare_mgen_alias(t, f)
+
+#include <math/s_fdim.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S
deleted file mode 100644
index 4a479b1a59..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Compute positive difference, sparc 32-bit+v9+vis3.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY(__fdim_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- movwtos %o2, %f2
- movwtos %o3, %f3
- fcmpd %f0, %f2
- fbug 1f
- nop
- fzero %f0
- fnegd %f0, %f2
-1: retl
- fsubd %f0, %f2, %f0
-END(__fdim_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c
new file mode 100644
index 0000000000..297f5ab730
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c
@@ -0,0 +1,24 @@
+/* Compute positive difference, sparc 32-bit+v9+vis3.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define __fdim __fdim_vis3
+#define declare_mgen_alias(t, f)
+
+#include <math/s_fdim.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S
deleted file mode 100644
index 4b13408244..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(fdim)
-
-weak_alias (__fdim, fdim)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __fdim __fdim_generic
-
-#include "../s_fdim.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
new file mode 100644
index 0000000000..5b35daee13
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
@@ -0,0 +1,29 @@
+/* Compute positive difference, sparc 32-bit.
+ Copyright (C) 2016-2018 Free Software 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_ldbl_opt.h>
+#include <first-versions.h>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-double.h>
+
+extern double __fdim_vis3 (double, double);
+extern double __fdim_generic (double, double);
+
+sparc_libm_ifunc(__fdim, hwcap & HWCAP_SPARC_VIS3 ? __fdim_vis3 : __fdim_generic);
+libm_alias_double (__fdim, fdim)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c
new file mode 100644
index 0000000000..17090b54df
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c
@@ -0,0 +1,3 @@
+#define __fdimf __fdimf_generic
+#define declare_mgen_alias(t, f)
+#include <math/s_fdimf.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S
deleted file mode 100644
index 081fc15b62..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Compute positive difference, sparc 32-bit+v9+vis3.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY(__fdimf_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- fcmps %f0, %f1
- fbug 1f
- nop
- fzeros %f0
- fnegs %f0, %f1
-1: retl
- fsubs %f0, %f1, %f0
-END(__fdimf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c
new file mode 100644
index 0000000000..84aeba3280
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c
@@ -0,0 +1,24 @@
+/* Float compute positive difference, sparc 32-bit+v9+vis3.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#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.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S
deleted file mode 100644
index 30381d6a59..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fdimf)
-
-weak_alias (__fdimf, fdimf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fdimf __fdimf_generic
-
-#include "../s_fdimf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c
new file mode 100644
index 0000000000..7fab2a8163
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c
@@ -0,0 +1,27 @@
+/* Float compute positive difference, sparc 32-bit.
+ Copyright (C) 2016-2018 Free Software 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 <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
+
+extern float __fdimf_vis3 (float, float);
+extern float __fdimf_generic (float, float);
+
+sparc_libm_ifunc(__fdimf, hwcap & HWCAP_SPARC_VIS3 ? __fdimf_vis3 : __fdimf_generic);
+libm_alias_float (__fdim, fdim)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S
deleted file mode 100644
index 0180d103b6..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S
+++ /dev/null
@@ -1,61 +0,0 @@
-/* floor function, sparc32 v9 vis2 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floor_vis2)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o0, 32, %o0
- or %o0, %o1, %o0
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fzero ZERO
- ldd [%sp + 72], %f0
- fnegd ZERO, SIGN_BIT
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
- ldd [%sp + 72], %f16
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__floor_vis2)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S
deleted file mode 100644
index 7b91620a42..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/* floor function, sparc32 v9 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floor_vis3)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o0, 32, %o0
- sllx %o2, 32, %o2
- or %o0, %o1, %o0
- movxtod %o0, %f0
- fzero ZERO
- fnegd ZERO, SIGN_BIT
- movxtod %o2, %f16
- fabsd %f0, %f14
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__floor_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S
deleted file mode 100644
index 1fe4b95ea6..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(floor)
-
-weak_alias (__floor, floor)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __floor __floor_generic
-
-#include "../s_floor.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S
deleted file mode 100644
index 77e9f4bcc1..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Float floor function, sparc32 v9 vis2 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floorf_vis2)
- st %o0, [%sp + 68]
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- ld [%sp + 68], %f0
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + 68]
- fabss %f0, %f14
- ld [%sp + 68], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- fadds %f0, %f16, %f1
- siam (1 << 2) | 0
- fsubs %f1, %f16, %f1
- siam (0 << 2)
- retl
- fors %f1, SIGN_BIT, %f0
-END (__floorf_vis2)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S
deleted file mode 100644
index bf7da6fbfa..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Float floor function, sparc32 v9 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floorf_vis3)
- movwtos %o0, %f0
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2, %f16
- fabss %f0, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- fadds %f0, %f16, %f1
- siam (1 << 2) | 0
- fsubs %f1, %f16, %f1
- siam (0 << 2)
- retl
- fors %f1, SIGN_BIT, %f0
-END (__floorf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S
deleted file mode 100644
index d2a83cb9b8..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(floorf)
-
-weak_alias (__floorf, floorf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __floorf __floorf_generic
-
-#include "../s_floorf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c
new file mode 100644
index 0000000000..e40816facb
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c
@@ -0,0 +1,2 @@
+#define __fma __fma_generic
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S
index 2bf5508858..6c27aefca2 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S
@@ -1,5 +1,5 @@
/* fma function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
index 3f2f1622c8..804272ff8e 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
@@ -1,14 +1,10 @@
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
extern double __fma_vis3 (double, double, double);
extern double __fma_generic (double, double, double);
sparc_libm_ifunc(__fma, hwcap & HWCAP_SPARC_FMAF ? __fma_vis3 : __fma_generic);
-weak_alias (__fma, fma)
-
-# define __fma __fma_generic
-#endif
-
-#include <sysdeps/ieee754/dbl-64/s_fma.c>
+libm_alias_double (__fma, fma)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c
new file mode 100644
index 0000000000..218eeb3115
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c
@@ -0,0 +1,2 @@
+#define __fmaf __fmaf_generic
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S
index 0aca947c25..8aa4b68088 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S
@@ -1,5 +1,5 @@
/* fmaf function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
index 7a273a3b13..e82c4a4031 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
@@ -1,14 +1,9 @@
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
extern float __fmaf_vis3 (float, float, float);
extern float __fmaf_generic (float, float, float);
sparc_libm_ifunc(__fmaf, hwcap & HWCAP_SPARC_FMAF ? __fmaf_vis3 : __fmaf_generic);
-weak_alias (__fmaf, fmaf)
-
-# define __fmaf __fmaf_generic
-#endif
-
-#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
+libm_alias_float (__fma, fma)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S
deleted file mode 100644
index 271a7303d1..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/* fmax function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY (__fmax_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- movwtos %o2, %f2
- movwtos %o3, %f3
- flcmpd %fcc1, %f0, %f2
- retl
- fmovdlg %fcc1, %f2, %f0
-END (__fmax_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S
deleted file mode 100644
index e996860485..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(fmax)
-
-weak_alias (__fmax, fmax)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __fmax __fmax_generic
-
-#include "../s_fmax.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S
deleted file mode 100644
index 3ee159b306..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S
+++ /dev/null
@@ -1,28 +0,0 @@
-/* fmaxf function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY (__fmaxf_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- flcmps %fcc1, %f0, %f1
- retl
- fmovslg %fcc1, %f1, %f0
-END (__fmaxf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S
deleted file mode 100644
index daa91579c4..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fmaxf)
-
-weak_alias (__fmaxf, fmaxf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fmaxf __fmaxf_generic
-
-#include "../s_fmaxf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S
deleted file mode 100644
index 6d7991cf6e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/* fmin function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY (__fmin_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- movwtos %o2, %f2
- movwtos %o3, %f3
- flcmpd %fcc1, %f0, %f2
- retl
- fmovdge %fcc1, %f2, %f0
-END (__fmin_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S
deleted file mode 100644
index b7ea51f475..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(fmin)
-
-weak_alias (__fmin, fmin)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __fmin __fmin_generic
-
-#include "../s_fmin.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S
deleted file mode 100644
index a71af068cd..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S
+++ /dev/null
@@ -1,28 +0,0 @@
-/* fminf function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY (__fminf_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- flcmps %fcc1, %f0, %f1
- retl
- fmovsge %fcc1, %f1, %f0
-END (__fminf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S
deleted file mode 100644
index c4690e1df9..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fminf)
-
-weak_alias (__fminf, fminf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fminf __fminf_generic
-
-#include "../s_fminf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S
new file mode 100644
index 0000000000..1aedc80f4f
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-double.h>
+#define __llrint __llrint_generic
+#undef libm_alias_double
+#define libm_alias_double(a,b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S
index f070fbcaf3..f3be7b978a 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S
@@ -1,5 +1,5 @@
/* llrint(), sparc32 v9 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S
deleted file mode 100644
index fd23041404..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(llrint)
-
-weak_alias (__llrint, llrint)
-
-strong_alias (__llrint, __lllrint)
-weak_alias (__lllrint, lllrint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef strong_alias
-# define strong_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __llrint __llrint_generic
-
-#include "../s_llrint.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c
new file mode 100644
index 0000000000..599a76c59d
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c
@@ -0,0 +1,32 @@
+/* llrint ifunc resolver, Linux/sparc32 version.
+ Copyright (C) 2017-2018 Free Software 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 __llrint __redirect_llrint
+#include <math.h>
+#undef __llrint
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (__redirect_llrint) __llrint_vis3 attribute_hidden;
+extern __typeof (__redirect_llrint) __llrint_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_llrint, __llrint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __llrint_vis3
+ : __llrint_generic);
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S
new file mode 100644
index 0000000000..af4e752be3
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-float.h>
+#define __llrintf __llrintf_generic
+#undef libm_alias_float
+#define libm_alias_float(a, b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S
index 0cb2eb3f34..f295a19158 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S
@@ -1,5 +1,5 @@
/* llrintf(), sparc32 v9 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S
deleted file mode 100644
index 8af5244e7e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(llrintf)
-
-weak_alias (__llrintf, llrintf)
-
-strong_alias (__llrintf, __lllrintf)
-weak_alias (__lllrintf, lllrintf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef strong_alias
-# define strong_alias(a, b)
-
-#define __llrintf __llrintf_generic
-
-#include "../s_llrintf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c
new file mode 100644
index 0000000000..46802c22c8
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c
@@ -0,0 +1,30 @@
+/* llrintf ifunc resolver, Linux/sparc32 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+#include <libm-alias-float.h>
+
+extern __typeof (llrintf) __llrintf_vis3 attribute_hidden;
+extern __typeof (llrintf) __llrintf_generic attribute_hidden;
+
+sparc_libm_ifunc (__llrintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __llrintf_vis3
+ : __llrintf_generic);
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S
new file mode 100644
index 0000000000..b869bbb6b9
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-double.h>
+#define __nearbyint __nearbyint_generic
+#undef libm_alias_double
+#define libm_alias_double(a, b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
index 4475e8c315..1edeb93d2f 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc32 v9 vis3 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -36,14 +36,15 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyint_vis3)
+ sllx %o0, 32, %o0
+ or %o0, %o1, %o0
+ movxtod %o0, %f0
+ fcmpd %fcc3, %f0, %f0 /* Check for sNaN */
st %fsr, [%sp + 88]
sethi %hi(TWO_FIFTYTWO), %o2
sethi %hi(0xf8003e0), %o5
ld [%sp + 88], %o4
- sllx %o0, 32, %o0
or %o5, %lo(0xf8003e0), %o5
- or %o0, %o1, %o0
- movxtod %o0, %f0
andn %o4, %o5, %o4
fzero ZERO
st %o4, [%sp + 80]
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S
deleted file mode 100644
index 47da9eaafe..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(nearbyint)
-
-weak_alias (__nearbyint, nearbyint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __nearbyint __nearbyint_generic
-
-#include "../s_nearbyint.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c
new file mode 100644
index 0000000000..3db79bb975
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c
@@ -0,0 +1,32 @@
+/* nearbyint ifunc resolver, Linux/sparc32 version.
+ Copyright (C) 2017-2018 Free Software 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 __nearbyint __redirect_nearbyint
+#include <math.h>
+#undef __nearbyint
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (__redirect_nearbyint) __nearbyint_vis3 attribute_hidden;
+extern __typeof (__redirect_nearbyint) __nearbyint_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_nearbyint, __nearbyint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __nearbyint_vis3
+ : __nearbyint_generic);
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S
new file mode 100644
index 0000000000..302fb94c80
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-float.h>
+#define __nearbyintf __nearbyintf_generic
+#undef libm_alias_float
+#define libm_alias_float(a, b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S
index e39134b686..8ce15647c5 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc32 v9 vis3 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -35,8 +35,9 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyintf_vis3)
- st %fsr, [%sp + 88]
movwtos %o0, %f1
+ fcmps %fcc3, %f1, %f1 /* Check for sNaN */
+ st %fsr, [%sp + 88]
sethi %hi(TWO_TWENTYTHREE), %o2
sethi %hi(0xf8003e0), %o5
ld [%sp + 88], %o4
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S
deleted file mode 100644
index 95100c1bfc..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(nearbyintf)
-
-weak_alias (__nearbyintf, nearbyintf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __nearbyintf __nearbyintf_generic
-
-#include "../s_nearbyintf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c
new file mode 100644
index 0000000000..f899932a34
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c
@@ -0,0 +1,30 @@
+/* nearbyintf ifunc resolver, Linux/sparc32 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+#include <libm-alias-float.h>
+
+extern __typeof (nearbyintf) __nearbyintf_vis3 attribute_hidden;
+extern __typeof (nearbyintf) __nearbyintf_generic attribute_hidden;
+
+sparc_libm_ifunc (__nearbyintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __nearbyintf_vis3
+ : __nearbyintf_generic);
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-generic.S
new file mode 100644
index 0000000000..b122ba2739
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-double.h>
+#define __rint __rint_generic
+#undef libm_alias_double
+#define libm_alias_double(a, b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S
index 7610f38070..fe70d49f07 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc32 v9 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S
deleted file mode 100644
index de893faebf..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(rint)
-
-weak_alias (__rint, rint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __rint __rint_generic
-
-#include "../s_rint.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c
new file mode 100644
index 0000000000..bba7228355
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c
@@ -0,0 +1,32 @@
+/* rint ifunc resolver, Linux/sparc32 version.
+ Copyright (C) 2017-2018 Free Software 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 __rint __redirect_rint
+#include <math.h>
+#undef __rint
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (__redirect_rint) __rint_vis3 attribute_hidden;
+extern __typeof (__redirect_rint) __rint_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_rint, __rint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __rint_vis3
+ : __rint_generic);
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S
new file mode 100644
index 0000000000..dce957aa9b
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-float.h>
+#define __rintf __rintf_generic
+#undef libm_alias_float
+#define libm_alias_float(a, b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S
index 68b4a17ca7..63b9c67846 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc32 v9 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S
deleted file mode 100644
index 38fd936086..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(rintf)
-
-weak_alias (__rintf, rintf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __rintf __rintf_generic
-
-#include "../s_rintf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.c
new file mode 100644
index 0000000000..74c5e25359
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.c
@@ -0,0 +1,30 @@
+/* rintf ifunc resolver, Linux/sparc32 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+#include <libm-alias-float.h>
+
+extern __typeof (rintf) __rintf_vis3 attribute_hidden;
+extern __typeof (rintf) __rintf_generic attribute_hidden;
+
+sparc_libm_ifunc (__rintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __rintf_vis3
+ : __rintf_generic);
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S
deleted file mode 100644
index 7f212d927e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc32 v9 vis3 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <math_ldbl_opt.h>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__trunc_vis3)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o0, 32, %o0
- or %o0, %o1, %o0
- fzero ZERO
- movxtod %o0, %f0
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- movxtod %o2, %f16
- fabsd %f0, %f14
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f14
- fand %f0, SIGN_BIT, SIGN_BIT
- fdtox %f14, %f14
- fxtod %f14, %f14
- faddd %f0, ZERO, %f18
- fmovduge %fcc3, %f18, %f14
- retl
- for %f14, SIGN_BIT, %f0
-END (__trunc_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S
deleted file mode 100644
index 3787fa1f11..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(trunc)
-
-weak_alias (__trunc, trunc)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __trunc __trunc_generic
-
-#include "../s_trunc.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S
deleted file mode 100644
index 2acd04dae8..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc32 v9 vis3 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__truncf_vis3)
- movwtos %o0, %f1
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2, %f16
- fabss %f1, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f14
- fands %f1, SIGN_BIT, SIGN_BIT
- fstoi %f14, %f14
- fitos %f14, %f14
- fadds %f1, ZERO, %f18
- fmovsuge %fcc3, %f18, %f14
- retl
- fors %f14, SIGN_BIT, %f0
-END (__truncf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S
deleted file mode 100644
index 2ca2517334..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(truncf)
-
-weak_alias (__truncf, truncf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __truncf __truncf_generic
-
-#include "../s_truncf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S
deleted file mode 100644
index 8ccee58ef1..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* sqrt function. sparc32 v9 vis3 version.
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY (__sqrt_vis3)
- movwtos %o0, %f0
- fzero %f8
- movwtos %o1, %f1
- fcmpd %f0, %f8
- fbl 1f
- nop
-8: retl
- fsqrtd %f0, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ld [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
-#else
- sethi %hi(_LIB_VERSION), %g1
- or %g1, %lo(_LIB_VERSION), %g1
-#endif
- ld [%g1], %g1
- cmp %g1, -1
- be 8b
- mov %o0, %o2
- mov %o1, %o3
- mov 26, %o4
- mov %o7, %g1
- call __kernel_standard
- mov %g1, %o7
-END (__sqrt_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S
deleted file mode 100644
index 3b070721d2..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(sqrt)
-
-weak_alias (__sqrt, sqrt)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __sqrt __sqrt_generic
-
-#include "../w_sqrt.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S
deleted file mode 100644
index 7b388833b9..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S
+++ /dev/null
@@ -1,47 +0,0 @@
-/* sqrtf function. sparc32 v9 vis3 version.
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY (__sqrtf_vis3)
- movwtos %o0, %f0
- fzeros %f8
- fcmps %f0, %f8
- fbl 1f
- nop
-8: retl
- fsqrts %f0, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ld [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
-#else
- sethi %hi(_LIB_VERSION), %g1
- or %g1, %lo(_LIB_VERSION), %g1
-#endif
- ld [%g1], %g1
- cmp %g1, -1
- be 8b
- mov %o0, %o1
- mov 126, %o2
- mov %o7, %g1
- call __kernel_standard_f
- mov %g1, %o7
-END (__sqrtf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S
deleted file mode 100644
index 777a04058c..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(sqrtf)
-
-weak_alias (__sqrtf, sqrtf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __sqrtf __sqrtf_generic
-
-#include "../w_sqrtf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S
deleted file mode 100644
index 0c477eeeb7..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ceil function, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <math_ldbl_opt.h>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceil)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o0, 32, %o0
- sethi %hi(ONE_DOT_ZERO), %o3
- or %o0, %o1, %o0
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fzero ZERO
- sllx %o3, 32, %o3
-
- ldd [%sp + 72], %f0
- fnegd ZERO, SIGN_BIT
-
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
-
- ldd [%sp + 72], %f16
- fcmpd %fcc3, %f14, %f16
-
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
-
- for %f16, SIGN_BIT, %f16
- faddd %f0, %f16, %f18
- fsubd %f18, %f16, %f18
- fcmpd %fcc2, %f18, %f0
- stx %o3, [%sp + 72]
-
- ldd [%sp + 72], %f20
- fmovduge %fcc2, ZERO, %f20
- faddd %f18, %f20, %f0
- fabsd %f0, %f0
- retl
- for %f0, SIGN_BIT, %f0
-END (__ceil)
-weak_alias (__ceil, ceil)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S
deleted file mode 100644
index 08612617cb..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Float ceil function, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceilf)
- st %o0, [%sp + 68]
- sethi %hi(TWO_TWENTYTHREE), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzeros ZERO
-
- ld [%sp + 68], %f0
- fnegs ZERO, SIGN_BIT
-
- st %o2, [%sp + 68]
- fabss %f0, %f14
-
- ld [%sp + 68], %f16
- fcmps %fcc3, %f14, %f16
-
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
-
- fors %f16, SIGN_BIT, %f16
- fadds %f0, %f16, %f1
- fsubs %f1, %f16, %f1
- fcmps %fcc2, %f1, %f0
- st %o3, [%sp + 68]
-
- ld [%sp + 68], %f9
- fmovsuge %fcc2, ZERO, %f9
- fadds %f1, %f9, %f0
- fabss %f0, %f0
- retl
- fors %f0, SIGN_BIT, %f0
-END (__ceilf)
-weak_alias (__ceilf, ceilf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S
index e1d02b8dfe..bdc453da0d 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S
@@ -1,5 +1,5 @@
/* Float absolute value, sparc32+v9 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,8 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
ENTRY (__fabs)
st %o0, [%sp+72]
@@ -25,4 +27,4 @@ ENTRY (__fabs)
retl
fabsd %f0, %f0
END (__fabs)
-weak_alias (__fabs, fabs)
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S
deleted file mode 100644
index 37f7f44dfa..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Compute positive difference, sparc 32-bit+v9.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <math_ldbl_opt.h>
-
-ENTRY(__fdim)
- std %o0, [%sp + 72]
- std %o2, [%sp + 80]
- ldd [%sp + 72], %f0
- ldd [%sp + 80], %f2
- fcmpd %f0, %f2
- fbug 1f
- nop
- fzero %f0
- fnegd %f0, %f2
-1: retl
- fsubd %f0, %f2, %f0
-END(__fdim)
-weak_alias (__fdim, fdim)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S
deleted file mode 100644
index 9e0e3f21be..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Compute positive difference, sparc 32-bit+v9.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY(__fdimf)
- st %o0, [%sp + 72]
- st %o1, [%sp + 76]
- ld [%sp + 72], %f0
- ld [%sp + 76], %f1
- fcmps %f0, %f1
- fbug 1f
- nop
- fzeros %f0
- fnegs %f0, %f1
-1: retl
- fsubs %f0, %f1, %f0
-END(__fdimf)
-weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S
deleted file mode 100644
index c59f864d0e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S
+++ /dev/null
@@ -1,92 +0,0 @@
-/* floor function, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <math_ldbl_opt.h>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floor)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o0, 32, %o0
- sethi %hi(ONE_DOT_ZERO), %o3
- or %o0, %o1, %o0
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fzero ZERO
- sllx %o3, 32, %o3
-
- ldd [%sp + 72], %f0
- fnegd ZERO, SIGN_BIT
-
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
-
- ldd [%sp + 72], %f16
- fcmpd %fcc3, %f14, %f16
-
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
-
- for %f16, SIGN_BIT, %f16
- faddd %f0, %f16, %f18
- fsubd %f18, %f16, %f18
- fcmpd %fcc2, %f18, %f0
- stx %o3, [%sp + 72]
-
- ldd [%sp + 72], %f20
- fmovdule %fcc2, ZERO, %f20
- fsubd %f18, %f20, %f0
- fabsd %f0, %f0
- retl
- for %f0, SIGN_BIT, %f0
-END (__floor)
-weak_alias (__floor, floor)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S
deleted file mode 100644
index 64b1042940..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Float floor function, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floorf)
- st %o0, [%sp + 68]
- sethi %hi(TWO_TWENTYTHREE), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzeros ZERO
-
- ld [%sp + 68], %f0
- fnegs ZERO, SIGN_BIT
-
- st %o2, [%sp + 68]
- fabss %f0, %f14
-
- ld [%sp + 68], %f16
- fcmps %fcc3, %f14, %f16
-
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
-
- fors %f16, SIGN_BIT, %f16
- fadds %f0, %f16, %f1
- fsubs %f1, %f16, %f1
- fcmps %fcc2, %f1, %f0
- st %o3, [%sp + 68]
-
- ld [%sp + 68], %f9
- fmovsule %fcc2, ZERO, %f9
- fsubs %f1, %f9, %f0
- fabss %f0, %f0
- retl
- fors %f0, SIGN_BIT, %f0
-END (__floorf)
-weak_alias (__floorf, floorf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S
deleted file mode 100644
index 37b664c602..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/* fmax function, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <math_ldbl_opt.h>
-
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__fmax)
- std %o0, [%sp + 72]
- std %o2, [%sp + 80]
- ldd [%sp + 72], %f0
- ldd [%sp + 80], %f2
- fcmpd %fcc1, %f2, %f2
- fzero SIGN_BIT
- fmovdu %fcc1, %f0, %f2
- fnegd SIGN_BIT, SIGN_BIT
- fcmpd %fcc2, %f0, %f2
- fmovdul %fcc2, %f2, %f0
- fand %f0, %f2, %f4
- fandnot2 SIGN_BIT, %f4, %f4
- retl
- fandnot2 %f0, %f4, %f0
-END (__fmax)
-weak_alias (__fmax, fmax)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S
deleted file mode 100644
index e18553714e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* fmaxf function, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__fmaxf)
- st %o0, [%sp + 72]
- st %o1, [%sp + 76]
- ld [%sp + 72], %f1
- ld [%sp + 76], %f3
- fcmps %fcc1, %f3, %f3
- fzeros SIGN_BIT
- fmovsu %fcc1, %f1, %f3
- fnegs SIGN_BIT, SIGN_BIT
- fcmps %fcc2, %f1, %f3
- fmovsul %fcc2, %f3, %f1
- fands %f1, %f3, %f4
- fandnot2s SIGN_BIT, %f4, %f4
- retl
- fandnot2s %f1, %f4, %f0
-END (__fmaxf)
-weak_alias (__fmaxf, fmaxf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S
deleted file mode 100644
index 3d929b20b4..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/* fmin function, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <math_ldbl_opt.h>
-
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__fmin)
- std %o0, [%sp + 72]
- std %o2, [%sp + 80]
- ldd [%sp + 72], %f0
- ldd [%sp + 80], %f2
- fcmpd %fcc1, %f2, %f2
- fzero SIGN_BIT
- fmovdu %fcc1, %f0, %f2
- fnegd SIGN_BIT, SIGN_BIT
- fcmpd %fcc2, %f0, %f2
- fmovdug %fcc2, %f2, %f0
- for %f0, %f2, %f4
- fand %f4, SIGN_BIT, %f4
- retl
- for %f0, %f4, %f0
-END (__fmin)
-weak_alias (__fmin, fmin)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S
deleted file mode 100644
index 5343583a57..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* fminf function, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__fminf)
- st %o0, [%sp + 72]
- st %o1, [%sp + 76]
- ld [%sp + 72], %f1
- ld [%sp + 76], %f3
- fcmps %fcc1, %f3, %f3
- fzeros SIGN_BIT
- fmovsu %fcc1, %f1, %f3
- fnegs SIGN_BIT, SIGN_BIT
- fcmps %fcc2, %f1, %f3
- fmovsug %fcc2, %f3, %f1
- fors %f1, %f3, %f4
- fands %f4, SIGN_BIT, %f4
- retl
- fors %f1, %f4, %f0
-END (__fminf)
-weak_alias (__fminf, fminf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
index 4e4362cac5..29ae8c6a29 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S
index e1fe6245d2..8e645eaaec 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S
@@ -1,5 +1,5 @@
/* llrint(), sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -19,6 +19,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -65,8 +66,4 @@ ENTRY (__llrint)
retl
ldd [%sp + 72], %o0
END (__llrint)
-weak_alias (__llrint, llrint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-#endif
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S
index 36a95d4bcf..501a09c8b2 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S
@@ -1,5 +1,5 @@
/* llrintf(), sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -59,4 +60,4 @@ ENTRY (__llrintf)
retl
ldd [%sp + 72], %o0
END (__llrintf)
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S
deleted file mode 100644
index fb653037ea..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S
+++ /dev/null
@@ -1,72 +0,0 @@
-/* lrint(), sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <math_ldbl_opt.h>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__lrint)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o0, 32, %o0
-
- or %o0, %o1, %o0
- fzero ZERO
-
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
-
- ldd [%sp + 72], %f0
-
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
-
- ldd [%sp + 72], %f16
- fcmpd %fcc3, %f14, %f16
-
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
-
- for %f16, SIGN_BIT, %f16
- faddd %f0, %f16, %f6
- fsubd %f6, %f16, %f0
- fabsd %f0, %f0
- for %f0, SIGN_BIT, %f0
- fdtoi %f0, %f3
- st %f3, [%sp + 72]
- retl
- ld [%sp + 72], %o0
-END (__lrint)
-weak_alias (__lrint, lrint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S
index 54085f1cde..dbd6c9347e 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S
@@ -1,5 +1,5 @@
/* lrintf(), sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -59,4 +60,4 @@ ENTRY (__lrintf)
retl
ld [%sp + 68], %o0
END (__lrintf)
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
index 29b56b471c..88f410ec52 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc32 v9 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -21,6 +21,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -36,20 +37,21 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyint)
+ sllx %o0, 32, %o0
+ or %o0, %o1, %o0
+ stx %o0, [%sp + 72]
+ ldd [%sp + 72], %f0
+ fcmpd %fcc3, %f0, %f0 /* Check for sNaN */
st %fsr, [%sp + 88]
sethi %hi(TWO_FIFTYTWO), %o2
sethi %hi(0xf8003e0), %o5
ld [%sp + 88], %o4
- sllx %o0, 32, %o0
or %o5, %lo(0xf8003e0), %o5
- or %o0, %o1, %o0
andn %o4, %o5, %o4
fzero ZERO
st %o4, [%sp + 80]
- stx %o0, [%sp + 72]
sllx %o2, 32, %o2
fnegd ZERO, SIGN_BIT
- ldd [%sp + 72], %f0
ld [%sp + 80], %fsr
stx %o2, [%sp + 72]
fabsd %f0, %f14
@@ -65,8 +67,4 @@ ENTRY (__nearbyint)
retl
ld [%sp + 88], %fsr
END (__nearbyint)
-weak_alias (__nearbyint, nearbyint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1)
-#endif
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S
index e2188b20a4..00af8a8889 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc32 v9 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -20,6 +20,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -35,8 +36,10 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyintf)
- st %fsr, [%sp + 88]
st %o0, [%sp + 68]
+ ld [%sp + 68], %f1
+ fcmps %fcc3, %f1, %f1 /* Check for sNaN */
+ st %fsr, [%sp + 88]
sethi %hi(TWO_TWENTYTHREE), %o2
sethi %hi(0xf8003e0), %o5
ld [%sp + 88], %o4
@@ -45,7 +48,6 @@ ENTRY (__nearbyintf)
fnegs ZERO, SIGN_BIT
andn %o4, %o5, %o4
st %o4, [%sp + 80]
- ld [%sp + 68], %f1
ld [%sp + 80], %fsr
st %o2, [%sp + 68]
fabss %f1, %f14
@@ -61,4 +63,4 @@ ENTRY (__nearbyintf)
retl
ld [%sp + 88], %fsr
END (__nearbyintf)
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S
index e44bd7edb5..c65f0c1f59 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -19,6 +19,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -62,8 +63,4 @@ ENTRY (__rint)
retl
for %f0, SIGN_BIT, %f0
END (__rint)
-weak_alias (__rint, rint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0)
-#endif
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S
index bbf9f7b32a..df8bc450a1 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -56,4 +57,4 @@ ENTRY (__rintf)
retl
fors %f0, SIGN_BIT, %f0
END (__rintf)
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S
deleted file mode 100644
index 6f2ed8a515..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc32 v9 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <math_ldbl_opt.h>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__trunc)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o0, 32, %o0
- or %o0, %o1, %o0
- fzero ZERO
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- ldd [%sp + 72], %f0
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
- ldd [%sp + 72], %f16
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f14
- fand %f0, SIGN_BIT, SIGN_BIT
- fdtox %f14, %f14
- fxtod %f14, %f14
- faddd %f0, ZERO, %f18
- fmovduge %fcc3, %f18, %f14
- retl
- for %f14, SIGN_BIT, %f0
-END (__trunc)
-weak_alias (__trunc, trunc)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S
deleted file mode 100644
index eab9cfd0db..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc32 v9 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__truncf)
- st %o0, [%sp + 68]
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- ld [%sp + 68], %f1
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + 68]
- fabss %f1, %f14
- ld [%sp + 68], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f14
- fands %f1, SIGN_BIT, SIGN_BIT
- fstoi %f14, %f14
- fitos %f14, %f14
- fadds %f1, ZERO, %f18
- fmovsuge %fcc3, %f18, %f14
- retl
- fors %f14, SIGN_BIT, %f0
-END (__truncf)
-weak_alias (__truncf, truncf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt.S b/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt.S
deleted file mode 100644
index 55e29a2958..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt.S
+++ /dev/null
@@ -1,51 +0,0 @@
-/* sqrt function. sparc32 v9 version.
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY (__sqrt)
- std %o0, [%sp + 80]
- fzero %f8
- ldd [%sp + 80], %f0
- fcmpd %f0, %f8
- fbl 1f
- nop
-8: retl
- fsqrtd %f0, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ld [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
-#else
- sethi %hi(_LIB_VERSION), %g1
- or %g1, %lo(_LIB_VERSION), %g1
-#endif
- ld [%g1], %g1
- cmp %g1, -1
- be 8b
- mov %o0, %o2
- mov %o1, %o3
- mov 26, %o4
- mov %o7, %g1
- call __kernel_standard
- mov %g1, %o7
-END (__sqrt)
-
-weak_alias (__sqrt, sqrt)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf.S
deleted file mode 100644
index 9e4f29434e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* sqrtf function. sparc32 v9 version.
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY (__sqrtf)
- st %o0, [%sp + 72]
- fzeros %f8
- ld [%sp + 72], %f0
- fcmps %f0, %f8
- fbl 1f
- nop
-8: retl
- fsqrts %f0, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ld [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
-#else
- sethi %hi(_LIB_VERSION), %g1
- or %g1, %lo(_LIB_VERSION), %g1
-#endif
- ld [%g1], %g1
- cmp %g1, -1
- be 8b
- mov %o0, %o1
- mov 126, %o2
- mov %o7, %g1
- call __kernel_standard_f
- mov %g1, %o7
-END (__sqrtf)
-
-weak_alias (__sqrtf, sqrtf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
index 8ff96fe614..42451966f6 100644
--- a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
+++ b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. sparcv9 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@redhat.com>, 2001.
diff --git a/sysdeps/sparc/sparc32/sparcv9/memmove.S b/sysdeps/sparc/sparc32/sparcv9/memmove.S
new file mode 100644
index 0000000000..39adeb2f99
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/memmove.S
@@ -0,0 +1,2 @@
+#define XCC icc
+#include <sparc64/memmove.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/mul_1.S b/sysdeps/sparc/sparc32/sparcv9/mul_1.S
index 37c8540edf..8bfe3318c8 100644
--- a/sysdeps/sparc/sparc32/sparcv9/mul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv9/mul_1.S
@@ -1,7 +1,7 @@
! SPARC v9 32-bit __mpn_mul_1 -- Multiply a limb vector with a single
! limb and store the product in a second limb vector.
!
-! Copyright (C) 2013-2016 Free Software Foundation, Inc.
+! Copyright (C) 2013-2018 Free Software Foundation, Inc.
! This file is part of the GNU C Library.
! Contributed by David S. Miller <davem@davemloft.net>
!
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
index 4ad7aff914..a6d08f3a00 100644
--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
@@ -8,5 +8,7 @@ endif
ifeq ($(subdir),string)
sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \
- memset-niagara1 memcpy-niagara4 memset-niagara4
+ memset-niagara1 memcpy-niagara4 memset-niagara4 \
+ memcpy-ultra1 memset-ultra1 memcpy-memmove-niagara7 \
+ memmove-ultra1 memset-niagara7
endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c
new file mode 100644
index 0000000000..cf6803ef44
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/bzero.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-memmove-niagara7.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-memmove-niagara7.S
new file mode 100644
index 0000000000..16da150717
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-memmove-niagara7.S
@@ -0,0 +1,2 @@
+#define XCC icc
+#include <sparc64/multiarch/memcpy-memmove-niagara7.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S
new file mode 100644
index 0000000000..65604eb3a8
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S
@@ -0,0 +1,33 @@
+/* Default SPARC32 memcpy implementation.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# include <sysdep.h>
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(x, y)
+# undef libc_hidden_def
+# define libc_hidden_def(name)
+
+# define memcpy __memcpy_ultra1
+# define __memcpy_large __memcpy_large_ultra1
+# define __mempcpy __mempcpy_ultra1
+# include <sysdeps/sparc/sparc32/sparcv9/memcpy.S>
+#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S
deleted file mode 100644
index 14df91e005..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#define ASI_PNF 0x82
-#define ASI_BLK_P 0xf0
-#define XCC icc
-#include <sparc64/multiarch/memcpy.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c
new file mode 100644
index 0000000000..369acac087
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/memcpy.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memmove-ultra1.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memmove-ultra1.S
new file mode 100644
index 0000000000..35ba76beff
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memmove-ultra1.S
@@ -0,0 +1,4 @@
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#define memmove __memmove_ultra1
+#include <sysdeps/sparc/sparc32/sparcv9/memmove.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c
new file mode 100644
index 0000000000..616a538cb4
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/mempcpy.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara7.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara7.S
new file mode 100644
index 0000000000..de91aa4d5a
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara7.S
@@ -0,0 +1,2 @@
+#define XCC icc
+#include <sparc64/multiarch/memset-niagara7.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S
new file mode 100644
index 0000000000..dd8343478a
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S
@@ -0,0 +1,30 @@
+/* Default SPARC memset implementation.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# include <sysdep.h>
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(x, y)
+
+# define memset __memset_ultra1
+# define __bzero __bzero_ultra1
+# include <sysdeps/sparc/sparc32/sparcv9/memset.S>
+#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S
deleted file mode 100644
index 8f8264337d..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#define ASI_PNF 0x82
-#define ASI_BLK_P 0xf0
-#define XCC icc
-#include <sparc64/multiarch/memset.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c
new file mode 100644
index 0000000000..a6c57342fa
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/memset.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memmove.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memmove.c
new file mode 100644
index 0000000000..2c880612f3
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memmove.c
@@ -0,0 +1 @@
+#include <sparc64/multiarch/rtld-memmove.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/rtld-memmove.c b/sysdeps/sparc/sparc32/sparcv9/rtld-memmove.c
new file mode 100644
index 0000000000..a2fe190bf3
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/rtld-memmove.c
@@ -0,0 +1 @@
+#include <sparc64/rtld-memmove.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/sparc32/sparcv9/submul_1.S b/sysdeps/sparc/sparc32/sparcv9/submul_1.S
index 3dc864b706..7df0a08054 100644
--- a/sysdeps/sparc/sparc32/sparcv9/submul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv9/submul_1.S
@@ -1,7 +1,7 @@
! SPARC v9 32-bit __mpn_submul_1 -- Multiply a limb vector with a limb
! and subtract the result from a second limb vector.
!
-! Copyright (C) 2013-2016 Free Software Foundation, Inc.
+! Copyright (C) 2013-2018 Free Software Foundation, Inc.
! This file is part of the GNU C Library.
! Contributed by David S. Miller <davem@davemloft.net>
!
diff --git a/sysdeps/sparc/sparc32/sparcv9/udiv.S b/sysdeps/sparc/sparc32/sparcv9/udiv.S
index de79899756..368f85ede2 100644
--- a/sysdeps/sparc/sparc32/sparcv9/udiv.S
+++ b/sysdeps/sparc/sparc32/sparcv9/udiv.S
@@ -15,3 +15,4 @@ ENTRY(.udiv)
udiv %o0, %o1, %o0
END(.udiv)
+strong_alias (.udiv, __wrap_.udiv)
diff --git a/sysdeps/sparc/sparc32/start.S b/sysdeps/sparc/sparc32/start.S
index d9dd9daff1..46ba8b6afa 100644
--- a/sysdeps/sparc/sparc32/start.S
+++ b/sysdeps/sparc/sparc32/start.S
@@ -1,5 +1,5 @@
/* Startup code for elf32-sparc
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
@@ -42,7 +42,7 @@
.global _start
.type _start,#function
_start:
-#ifdef SHARED
+#ifdef PIC
SETUP_PIC_REG(l7)
#endif
@@ -57,7 +57,7 @@ _start:
add %sp, 23*4, %o2
/* Load the addresses of the user entry points. */
-#ifndef SHARED
+#ifndef PIC
sethi %hi(main), %o0
sethi %hi(__libc_csu_init), %o3
sethi %hi(__libc_csu_fini), %o4
diff --git a/sysdeps/sparc/sparc32/stpcpy.S b/sysdeps/sparc/sparc32/stpcpy.S
index 5dd535a909..225a17d46b 100644
--- a/sysdeps/sparc/sparc32/stpcpy.S
+++ b/sysdeps/sparc/sparc32/stpcpy.S
@@ -1,6 +1,6 @@
/* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For SPARC v7.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc32/strcat.S b/sysdeps/sparc/sparc32/strcat.S
index 09b41300fb..cd49930a31 100644
--- a/sysdeps/sparc/sparc32/strcat.S
+++ b/sysdeps/sparc/sparc32/strcat.S
@@ -1,6 +1,6 @@
/* strcat (dest, src) -- Append SRC on the end of DEST.
For SPARC v7.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc32/strchr.S b/sysdeps/sparc/sparc32/strchr.S
index 1755f5d3f9..24654a3ea4 100644
--- a/sysdeps/sparc/sparc32/strchr.S
+++ b/sysdeps/sparc/sparc32/strchr.S
@@ -1,6 +1,6 @@
/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For SPARC v7.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
David S. Miller <davem@caip.rutgers.edu>.
diff --git a/sysdeps/sparc/sparc32/strcmp.S b/sysdeps/sparc/sparc32/strcmp.S
index 6676073874..c477302b7f 100644
--- a/sysdeps/sparc/sparc32/strcmp.S
+++ b/sysdeps/sparc/sparc32/strcmp.S
@@ -1,6 +1,6 @@
/* Compare two strings for differences.
For SPARC v7.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc32/strcpy.S b/sysdeps/sparc/sparc32/strcpy.S
index 1bb802d60a..e793668e1a 100644
--- a/sysdeps/sparc/sparc32/strcpy.S
+++ b/sysdeps/sparc/sparc32/strcpy.S
@@ -1,6 +1,6 @@
/* Copy SRC to DEST returning DEST.
For SPARC v7.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc32/strlen.S b/sysdeps/sparc/sparc32/strlen.S
index 13840f962c..cad88b1f6b 100644
--- a/sysdeps/sparc/sparc32/strlen.S
+++ b/sysdeps/sparc/sparc32/strlen.S
@@ -1,6 +1,6 @@
/* Determine the length of a string.
For SPARC v7.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
David S. Miller <davem@davemloft.net>.
diff --git a/sysdeps/sparc/sparc32/sub_n.S b/sysdeps/sparc/sparc32/sub_n.S
index a23404ed65..df640e481d 100644
--- a/sysdeps/sparc/sparc32/sub_n.S
+++ b/sysdeps/sparc/sparc32/sub_n.S
@@ -1,7 +1,7 @@
! SPARC __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
! store difference in a third limb vector.
!
-! Copyright (C) 1995-2016 Free Software Foundation, Inc.
+! Copyright (C) 1995-2018 Free Software Foundation, Inc.
!
! This file is part of the GNU MP Library.
!
diff --git a/sysdeps/sparc/sparc32/submul_1.S b/sysdeps/sparc/sparc32/submul_1.S
index c80ef6d34a..481947e869 100644
--- a/sysdeps/sparc/sparc32/submul_1.S
+++ b/sysdeps/sparc/sparc32/submul_1.S
@@ -1,7 +1,7 @@
! SPARC __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
! the result from a second limb vector.
!
-! Copyright (C) 1992-2016 Free Software Foundation, Inc.
+! Copyright (C) 1992-2018 Free Software Foundation, Inc.
!
! This file is part of the GNU MP Library.
!
diff --git a/sysdeps/sparc/sparc32/tst-audit.h b/sysdeps/sparc/sparc32/tst-audit.h
index 03b1dcea10..d68b586798 100644
--- a/sysdeps/sparc/sparc32/tst-audit.h
+++ b/sysdeps/sparc/sparc32/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. SPARC32 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/sparc/sparc32/udiv.S b/sysdeps/sparc/sparc32/udiv.S
index 8dfff66158..1db6796431 100644
--- a/sysdeps/sparc/sparc32/udiv.S
+++ b/sysdeps/sparc/sparc32/udiv.S
@@ -328,7 +328,7 @@ LOC(4.9):
- 9:
+9:
LOC(end_regular_divide):
subcc %o4, 1, %o4
bge LOC(divloop)
@@ -344,3 +344,4 @@ LOC(got_result):
mov %o2, %o0
END(.udiv)
+strong_alias (.udiv, __wrap_.udiv)
diff --git a/sysdeps/sparc/sparc32/urem.S b/sysdeps/sparc/sparc32/urem.S
index d3a1a441fd..83fb4c242e 100644
--- a/sysdeps/sparc/sparc32/urem.S
+++ b/sysdeps/sparc/sparc32/urem.S
@@ -328,7 +328,7 @@ LOC(4.9):
- 9:
+9:
LOC(end_regular_divide):
subcc %o4, 1, %o4
bge LOC(divloop)
diff --git a/sysdeps/sparc/sparc64/Implies b/sysdeps/sparc/sparc64/Implies
index 7abc50efcc..fe5eccd855 100644
--- a/sysdeps/sparc/sparc64/Implies
+++ b/sysdeps/sparc/sparc64/Implies
@@ -4,4 +4,3 @@ ieee754/ldbl-128
ieee754/dbl-64/wordsize-64
ieee754/dbl-64
ieee754/flt-32
-sparc/sparc64/soft-fp
diff --git a/sysdeps/sparc/sparc64/Makefile b/sysdeps/sparc/sparc64/Makefile
index 3a12510307..16b760539e 100644
--- a/sysdeps/sparc/sparc64/Makefile
+++ b/sysdeps/sparc/sparc64/Makefile
@@ -1,14 +1,33 @@
+# Makefile for SPARC 64-bit.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+# Contributed by Jakub Jelinek (jj@ultra.linux.cz).
+#
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License 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/>.
+
+sysdep-CFLAGS += -Wa,-Av9a -mvis
+
ifeq ($(subdir),string)
sysdep_routines += align-cpy
endif
-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
# nscd uses atomic_spin_nop which in turn requires cpu_relax
ifeq ($(subdir),nscd)
@@ -18,3 +37,15 @@ endif
ifeq ($(subdir),nptl)
libpthread-routines += cpu_relax
endif
+
+ifeq ($(subdir),soft-fp)
+sparc64-quad-routines := qp_add qp_cmp qp_cmpe qp_div qp_dtoq qp_feq qp_fge \
+ qp_fgt qp_fle qp_flt qp_fne qp_itoq qp_mul qp_neg qp_qtod qp_qtoi \
+ qp_qtos qp_qtoui qp_qtoux qp_qtox qp_sqrt qp_stoq qp_sub qp_uitoq \
+ qp_uxtoq qp_xtoq qp_util
+sysdep_routines += $(sparc64-quad-routines)
+endif
+
+ifeq ($(subdir),math)
+CPPFLAGS += -I../soft-fp/
+endif
diff --git a/sysdeps/sparc/sparc64/Versions b/sysdeps/sparc/sparc64/Versions
index 4cef7bcc71..b2661ede85 100644
--- a/sysdeps/sparc/sparc64/Versions
+++ b/sysdeps/sparc/sparc64/Versions
@@ -4,6 +4,12 @@ libc {
__align_cpy_1; __align_cpy_2; __align_cpy_4;
__align_cpy_8; __align_cpy_16;
}
+ GLIBC_2.2 {
+ _Qp_add; _Qp_cmp; _Qp_cmpe; _Qp_div; _Qp_dtoq; _Qp_feq; _Qp_fge; _Qp_fgt;
+ _Qp_fle; _Qp_flt; _Qp_fne; _Qp_itoq; _Qp_mul; _Qp_neg; _Qp_qtod; _Qp_qtoi;
+ _Qp_qtos; _Qp_qtoui; _Qp_qtoux; _Qp_qtox; _Qp_sqrt; _Qp_stoq; _Qp_sub;
+ _Qp_uitoq; _Qp_uxtoq; _Qp_xtoq;
+ }
}
libm {
GLIBC_2.1 {
diff --git a/sysdeps/sparc/sparc64/add_n.S b/sysdeps/sparc/sparc64/add_n.S
index f208965d20..f804090c0d 100644
--- a/sysdeps/sparc/sparc64/add_n.S
+++ b/sysdeps/sparc/sparc64/add_n.S
@@ -1,7 +1,7 @@
/* SPARC v9 __mpn_add_n -- Add two limb vectors of the same length > 0 and
store sum in a third limb vector.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/sparc/sparc64/addmul_1.S b/sysdeps/sparc/sparc64/addmul_1.S
index 4a0b39b86d..b36ce03764 100644
--- a/sysdeps/sparc/sparc64/addmul_1.S
+++ b/sysdeps/sparc/sparc64/addmul_1.S
@@ -1,7 +1,7 @@
/* SPARC v9 __mpn_addmul_1 -- Multiply a limb vector with a single limb and
add the product to a second limb vector.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/sparc/sparc64/align-cpy.S b/sysdeps/sparc/sparc64/align-cpy.S
index 55ac0ed6c1..945a81a9e2 100644
--- a/sysdeps/sparc/sparc64/align-cpy.S
+++ b/sysdeps/sparc/sparc64/align-cpy.S
@@ -1,6 +1,6 @@
/* Aligned copy routines specified by Sparc V9 ABI.
For 64-bit sparc.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@davemloft.net)
diff --git a/sysdeps/sparc/sparc64/atomic-machine.h b/sysdeps/sparc/sparc64/atomic-machine.h
index c1777fa950..a737dda2c4 100644
--- a/sysdeps/sparc/sparc64/atomic-machine.h
+++ b/sysdeps/sparc/sparc64/atomic-machine.h
@@ -1,5 +1,5 @@
/* Atomic operations. sparc64 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -47,6 +47,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 1
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
(abort (), (__typeof (*mem)) 0)
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/cpu_relax.S b/sysdeps/sparc/sparc64/cpu_relax.S
deleted file mode 100644
index e527589d19..0000000000
--- a/sysdeps/sparc/sparc64/cpu_relax.S
+++ /dev/null
@@ -1,67 +0,0 @@
-/* CPU strand yielding for busy loops.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- Contributed by David S. Miller (davem@davemloft.net)
- 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>
-
- .text
-__cpu_relax_generic:
- rd %ccr, %g0
- rd %ccr, %g0
- rd %ccr, %g0
- retl
- nop
- .size __cpu_relax_generic,.-__cpu_relax_generic
-
-__cpu_relax_pause:
- wr %g0, 128, %asr27
- retl
- nop
- .size __cpu_relax_pause,.-__cpu_relax_pause
-
-ENTRY(__cpu_relax)
- .type __cpu_relax, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_PAUSE, %o1
- andcc %o0, %o1, %g0
- be 1f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__cpu_relax_pause), %o1
- xor %o1, %gdop_lox10(__cpu_relax_pause), %o1
-# else
- set __cpu_relax_pause, %o1
-# endif
- ba 10f
- nop
-1:
-# ifdef SHARED
- sethi %gdop_hix22(__cpu_relax_generic), %o1
- xor %o1, %gdop_lox10(__cpu_relax_generic), %o1
-# else
- set __cpu_relax_generic, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(__cpu_relax)
diff --git a/sysdeps/sparc/sparc64/cpu_relax.c b/sysdeps/sparc/sparc64/cpu_relax.c
new file mode 100644
index 0000000000..c485777f8f
--- /dev/null
+++ b/sysdeps/sparc/sparc64/cpu_relax.c
@@ -0,0 +1,38 @@
+/* CPU strand yielding for busy loops. Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+
+static void
+__cpu_relax_generic (void)
+{
+ asm volatile ("rd %ccr, %g0;"
+ "rd %ccr, %g0;"
+ "rd %ccr, %g0");
+}
+
+static void
+__cpu_relax_pause (void)
+{
+ asm volatile ("wr %g0, 128, %asr27");
+}
+
+sparc_libc_ifunc (__cpu_relax,
+ hwcap & HWCAP_SPARC_PAUSE
+ ? __cpu_relax_pause
+ : __cpu_relax_generic)
diff --git a/sysdeps/sparc/sparc64/dl-irel.h b/sysdeps/sparc/sparc64/dl-irel.h
index cbb519187a..c5cd3057ac 100644
--- a/sysdeps/sparc/sparc64/dl-irel.h
+++ b/sysdeps/sparc/sparc64/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
SPARC 64-bit version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h
index 713aeb7734..cd6a6996cb 100644
--- a/sysdeps/sparc/sparc64/dl-machine.h
+++ b/sysdeps/sparc/sparc64/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. Sparc64 version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -85,6 +85,7 @@ elf_machine_load_address (void)
static inline Elf64_Addr __attribute__ ((always_inline))
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf64_Rela *reloc,
Elf64_Addr *reloc_addr, Elf64_Addr value)
{
@@ -402,12 +403,13 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
if (__builtin_expect (ELF64_ST_BIND (sym->st_info) == STB_LOCAL, 0)
&& sym->st_shndx != SHN_UNDEF)
{
+ sym_map = map;
value = map->l_addr;
}
else
{
sym_map = RESOLVE_MAP (&sym, version, r_type);
- value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ value = SYMBOL_ADDRESS (sym_map, sym, true);
}
#else
value = 0;
@@ -537,6 +539,12 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
case R_SPARC_DISP32:
*(unsigned int *) reloc_addr = (value - (Elf64_Addr) reloc_addr);
break;
+ case R_SPARC_DISP64:
+ *reloc_addr = (value - (Elf64_Addr) reloc_addr);
+ break;
+ case R_SPARC_REGISTER:
+ *reloc_addr = value;
+ break;
case R_SPARC_WDISP30:
*(unsigned int *) reloc_addr =
((*(unsigned int *)reloc_addr & 0xc0000000) |
diff --git a/sysdeps/sparc/sparc64/dl-plt.h b/sysdeps/sparc/sparc64/dl-plt.h
index b8c3f9474e..46b690c1ad 100644
--- a/sysdeps/sparc/sparc64/dl-plt.h
+++ b/sysdeps/sparc/sparc64/dl-plt.h
@@ -1,5 +1,5 @@
/* PLT fixups. Sparc 64-bit version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/dl-trampoline.S b/sysdeps/sparc/sparc64/dl-trampoline.S
index 65eb8e1a75..4948b88b96 100644
--- a/sysdeps/sparc/sparc64/dl-trampoline.S
+++ b/sysdeps/sparc/sparc64/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. Sparc 64-bit version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/e_sqrtl.c b/sysdeps/sparc/sparc64/fpu/e_sqrtl.c
index 3a09383daa..68bd584e35 100644
--- a/sysdeps/sparc/sparc64/fpu/e_sqrtl.c
+++ b/sysdeps/sparc/sparc64/fpu/e_sqrtl.c
@@ -1,5 +1,5 @@
/* Long double square root, sparc64 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
index 6a9274b4fa..3321e1d916 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
@@ -1,18 +1,30 @@
ifeq ($(subdir),math)
-libm-sysdep_routines += s_ceil-vis2 s_ceilf-vis2 \
- s_floor-vis2 s_floorf-vis2
-ifeq ($(have-as-vis3),yes)
-libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 s_ceilf-vis3 \
- s_ceil-vis3 m_finitef-vis3 m_finite-vis3 \
- s_floorf-vis3 s_floor-vis3 m_isinff-vis3 \
- m_isinf-vis3 m_isnanf-vis3 m_isnan-vis3 \
- s_lrintf-vis3 s_lrint-vis3 s_rintf-vis3 \
- s_rint-vis3 s_fminf-vis3 s_fmin-vis3 \
- s_fmaxf-vis3 s_fmax-vis3 s_fmaf-vis3 \
- s_fma-vis3 s_nearbyint-vis3 s_nearbyintf-vis3 \
- s_truncf-vis3 s_trunc-vis3
-sysdep_routines += s_signbitf-vis3 s_signbit-vis3 s_finitef-vis3 \
- s_finite-vis3 s_isinff-vis3 s_isinf-vis3 \
- s_isnanf-vis3 s_isnan-vis3
-endif
+# These functions are built both for libc and libm because they're required
+# by printf. While the libc objects have the prefix s_, the libm ones are
+# prefixed with m_.
+sysdep_calls := s_signbitf-vis3 s_signbit-vis3 s_signbitf-generic \
+ s_signbit-generic s_finitef-vis3 s_finite-vis3 \
+ s_finitef-generic s_finite-generic \
+ s_isinff-vis3 s_isinf-vis3 s_isinff-generic s_isinf-generic \
+ s_isnanf-vis3 s_isnan-vis3 s_isnanf-generic s_isnan-generic
+
+sysdep_routines += $(sysdep_calls)
+libm-sysdep_routines += s_lrintf-vis3 s_lrint-vis3 s_lrintf-generic \
+ s_lrint-generic s_rintf-vis3 s_rint-vis3 \
+ s_rintf-generic s_rint-generic \
+ s_fmaf-vis3 s_fma-vis3 s_fmaf-generic s_fma-generic \
+ s_nearbyint-vis3 s_nearbyintf-vis3 \
+ s_nearbyint-generic s_nearbyintf-generic \
+ s_ceilf-vis3 s_ceil-vis3 s_ceilf-generic \
+ s_ceil-generic s_floorf-vis3 s_floor-vis3 \
+ s_floorf-generic s_floor-generic s_truncf-vis3 \
+ s_trunc-vis3 s_truncf-generic s_trunc-generic \
+ $(sysdep_calls:s_%=m_%)
+
+CFLAGS-s_ceilf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_ceil-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_floorf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_floor-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_truncf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_trunc-vis3.c += -Wa,-Av9d -mvis3
endif
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c
new file mode 100644
index 0000000000..febea745e1
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c
@@ -0,0 +1,2 @@
+#define __ceil __ceil_generic
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S
deleted file mode 100644
index fd1bf38662..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ceil function, sparc64 vis2 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceil_vis2)
- sethi %hi(TWO_FIFTYTWO), %o2
- fzero ZERO
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- stx %o2, [%sp + STACK_BIAS + 128]
- fabsd %f0, %f14
- ldd [%sp + STACK_BIAS + 128], %f16
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__ceil_vis2)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S
deleted file mode 100644
index e6fa3f53d2..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ceil function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceil_vis3)
- sethi %hi(TWO_FIFTYTWO), %o2
- fzero ZERO
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- movxtod %o2, %f16
- fabsd %f0, %f14
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__ceil_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c
new file mode 100644
index 0000000000..a03a0090f0
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c
@@ -0,0 +1,23 @@
+/* ceil function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define __ceil __ceil_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S
deleted file mode 100644
index e7822bc307..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(ceil)
-
-weak_alias (__ceil, ceil)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __ceil __ceil_generic
-
-#include "../s_ceil.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
new file mode 100644
index 0000000000..3d34622d43
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
@@ -0,0 +1,30 @@
+/* ceil function, sparc64 version.
+ Copyright (C) 2016-2018 Free Software 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 <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-double.h>
+
+extern __typeof (ceil) __ceil_vis3 attribute_hidden;
+extern __typeof (ceil) __ceil_generic attribute_hidden;
+
+sparc_libm_ifunc (__ceil,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __ceil_vis3
+ : __ceil_generic)
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c
new file mode 100644
index 0000000000..ce75035954
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c
@@ -0,0 +1,2 @@
+#define __ceilf __ceilf_generic
+#include <sysdeps/ieee754/flt-32/s_ceilf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S
deleted file mode 100644
index fe57a52a4a..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Float ceil function, sparc64 vis2 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceilf_vis2)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + STACK_BIAS + 128]
- fabss %f1, %f14
- ld [%sp + STACK_BIAS + 128], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- fadds %f1, %f16, %f5
- siam (1 << 2) | 0
- fsubs %f5, %f16, %f5
- siam (0 << 2)
- retl
- fors %f5, SIGN_BIT, %f0
-END (__ceilf_vis2)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S
deleted file mode 100644
index 9a0f9c567e..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Float ceil function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceilf_vis3)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2, %f16
- fabss %f1, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- fadds %f1, %f16, %f5
- siam (1 << 2) | 0
- fsubs %f5, %f16, %f5
- siam (0 << 2)
- retl
- fors %f5, SIGN_BIT, %f0
-END (__ceilf_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c
new file mode 100644
index 0000000000..eb9ed6f7de
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c
@@ -0,0 +1,23 @@
+/* Float ceil function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define __ceilf __ceilf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_ceilf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S
deleted file mode 100644
index 1c72a5728e..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(ceilf)
-
-weak_alias (__ceilf, ceilf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __ceilf __ceilf_generic
-
-#include "../s_ceilf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
new file mode 100644
index 0000000000..18d2eb565d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
@@ -0,0 +1,30 @@
+/* Float ceil function, sparc64 version.
+ Copyright (C) 2016-2018 Free Software 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 <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
+
+extern __typeof (ceilf) __ceilf_vis3 attribute_hidden;
+extern __typeof (ceilf) __ceilf_generic attribute_hidden;
+
+sparc_libm_ifunc (__ceilf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __ceilf_vis3
+ : __ceilf_generic);
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S
new file mode 100644
index 0000000000..dfbf32fc3f
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S
@@ -0,0 +1,6 @@
+#define __finite __finite_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_finite.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S
index 6d4297b9ed..0cd3fd50c9 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S
@@ -1,5 +1,5 @@
/* finite(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S
deleted file mode 100644
index 78406a62b1..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(finite)
-
-hidden_def (__finite)
-weak_alias (__finite, finite)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __finite __finite_generic
-
-#include "../s_finite.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c
new file mode 100644
index 0000000000..b51ed19438
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c
@@ -0,0 +1,37 @@
+/* finite ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 __finite __redirect___finite
+#define __finitef __redirect___finitef
+#define __finitel __redirect___finitel
+#include <math.h>
+#undef __finite
+#undef __finitef
+#undef __finitel
+#include <sparc-ifunc.h>
+
+extern __typeof (finite) __finite_vis3 attribute_hidden;
+extern __typeof (finite) __finite_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect___finite, __finite,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __finite_vis3
+ : __finite_generic);
+
+sparc_ifunc_redirected_hidden_def (__redirect___finite, __finite)
+weak_alias (__finite, finite)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S
new file mode 100644
index 0000000000..38880765fe
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S
@@ -0,0 +1,6 @@
+#define __finitef __finitef_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_finitef.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S
index 8cc6149063..d0391f6dbf 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S
@@ -1,5 +1,5 @@
/* finitef(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S
deleted file mode 100644
index cafd41fd92..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(finitef)
-
-hidden_def (__finitef)
-weak_alias (__finitef, finitef)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __finitef __finitef_generic
-
-#include "../s_finitef.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c
new file mode 100644
index 0000000000..92cc5ef075
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c
@@ -0,0 +1,33 @@
+/* finitef ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 __finitef __redirect___finitef
+#include <math.h>
+#undef __finitef
+#include <sparc-ifunc.h>
+
+extern __typeof (finitef) __finitef_vis3 attribute_hidden;
+extern __typeof (finitef) __finitef_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect___finitef, __finitef,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __finitef_vis3
+ : __finitef_generic);
+
+sparc_ifunc_redirected_hidden_def (__redirect___finitef, __finitef)
+weak_alias (__finitef, finitef)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c
new file mode 100644
index 0000000000..0f3361a9fb
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c
@@ -0,0 +1,2 @@
+#define __floor __floor_generic
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S
deleted file mode 100644
index 84fda73d95..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* floor function, sparc64 vis2 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floor_vis2)
- sethi %hi(TWO_FIFTYTWO), %o2
- fzero ZERO
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- stx %o2, [%sp + STACK_BIAS + 128]
- fabsd %f0, %f14
- ldd [%sp + STACK_BIAS + 128], %f16
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__floor_vis2)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S
deleted file mode 100644
index 1b275c2c63..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* floor function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floor_vis3)
- sethi %hi(TWO_FIFTYTWO), %o2
- fzero ZERO
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- movxtod %o2, %f16
- fabsd %f0, %f14
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__floor_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c
new file mode 100644
index 0000000000..d9974161b0
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c
@@ -0,0 +1,23 @@
+/* floor function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define __floor __floor_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S
deleted file mode 100644
index 989ccab56d..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(floor)
-
-weak_alias (__floor, floor)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __floor __floor_generic
-
-#include "../s_floor.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
new file mode 100644
index 0000000000..6e5ecd2b5d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
@@ -0,0 +1,30 @@
+/* floor function, sparc64 version.
+ Copyright (C) 2016-2018 Free Software 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 <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-double.h>
+
+extern __typeof (floor) __floor_vis3 attribute_hidden;
+extern __typeof (floor) __floor_generic attribute_hidden;
+
+sparc_libm_ifunc (__floor,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __floor_vis3
+ : __floor_generic);
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c
new file mode 100644
index 0000000000..28c377b787
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c
@@ -0,0 +1,2 @@
+#define __floorf __floorf_generic
+#include <sysdeps/ieee754/flt-32/s_floorf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S
deleted file mode 100644
index ab7e110ee9..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Float floor function, sparc64 vis2 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floorf_vis2)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + STACK_BIAS + 128]
- fabss %f1, %f14
- ld [%sp + STACK_BIAS + 128], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- fadds %f1, %f16, %f5
- siam (1 << 2) | 0
- fsubs %f5, %f16, %f5
- siam (0 << 2)
- retl
- fors %f5, SIGN_BIT, %f0
-END (__floorf_vis2)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S
deleted file mode 100644
index b71e1cc2dc..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Float floor function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floorf_vis3)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2, %f16
- fabss %f1, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- fadds %f1, %f16, %f5
- siam (1 << 2) | 0
- fsubs %f5, %f16, %f5
- siam (0 << 2)
- retl
- fors %f5, SIGN_BIT, %f0
-END (__floorf_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c
new file mode 100644
index 0000000000..d970da3752
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c
@@ -0,0 +1,23 @@
+/* Float floor function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define __floorf __floorf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_floorf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S
deleted file mode 100644
index d2a83cb9b8..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(floorf)
-
-weak_alias (__floorf, floorf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __floorf __floorf_generic
-
-#include "../s_floorf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
new file mode 100644
index 0000000000..b79fd83fa4
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
@@ -0,0 +1,30 @@
+/* Float floor function, sparc64 version.
+ Copyright (C) 2016-2018 Free Software 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 <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
+
+extern __typeof (floorf) __floorf_vis3 attribute_hidden;
+extern __typeof (floorf) __floorf_generic attribute_hidden;
+
+sparc_libm_ifunc (__floorf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __floorf_vis3
+ : __floorf_generic);
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c
new file mode 100644
index 0000000000..e40816facb
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c
@@ -0,0 +1,2 @@
+#define __fma __fma_generic
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S
index d43002caa5..ba50b3a657 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S
@@ -1,5 +1,5 @@
/* fma function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
index 3f2f1622c8..34b4f45150 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
@@ -1,14 +1,12 @@
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
-
-extern double __fma_vis3 (double, double, double);
-extern double __fma_generic (double, double, double);
-
-sparc_libm_ifunc(__fma, hwcap & HWCAP_SPARC_FMAF ? __fma_vis3 : __fma_generic);
-weak_alias (__fma, fma)
-
-# define __fma __fma_generic
-#endif
-
-#include <sysdeps/ieee754/dbl-64/s_fma.c>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-double.h>
+
+extern __typeof (fma) __fma_vis3 attribute_hidden;
+extern __typeof (fma) __fma_generic attribute_hidden;
+
+sparc_libm_ifunc (__fma,
+ hwcap & HWCAP_SPARC_FMAF
+ ? __fma_vis3
+ : __fma_generic);
+libm_alias_double (__fma, fma)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c
new file mode 100644
index 0000000000..218eeb3115
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c
@@ -0,0 +1,2 @@
+#define __fmaf __fmaf_generic
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S
index 4ee6ee407c..fbfa5fd869 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S
@@ -1,5 +1,5 @@
/* fmaf function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
index 7a273a3b13..08f71c8bba 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
@@ -1,14 +1,12 @@
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
-
-extern float __fmaf_vis3 (float, float, float);
-extern float __fmaf_generic (float, float, float);
-
-sparc_libm_ifunc(__fmaf, hwcap & HWCAP_SPARC_FMAF ? __fmaf_vis3 : __fmaf_generic);
-weak_alias (__fmaf, fmaf)
-
-# define __fmaf __fmaf_generic
-#endif
-
-#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
+
+extern __typeof (fmaf) __fmaf_vis3 attribute_hidden;
+extern __typeof (fmaf) __fmaf_generic attribute_hidden;
+
+sparc_libm_ifunc (__fmaf,
+ hwcap & HWCAP_SPARC_FMAF
+ ? __fmaf_vis3
+ : __fmaf_generic)
+libm_alias_float (__fma, fma)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S
deleted file mode 100644
index 9a5c075375..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* fmax function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY (__fmax_vis3)
- flcmpd %fcc1, %f0, %f2
- retl
- fmovdlg %fcc1, %f2, %f0
-END (__fmax_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S
deleted file mode 100644
index d5e59d8d1e..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fmax)
-
-weak_alias (__fmax, fmax)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fmax __fmax_generic
-
-#include "../s_fmax.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S
deleted file mode 100644
index 50ee6fe101..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* fmaxf function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY (__fmaxf_vis3)
- flcmps %fcc1, %f1, %f3
- fmovs %f1, %f0
- retl
- fmovslg %fcc1, %f3, %f0
-END (__fmaxf_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S
deleted file mode 100644
index daa91579c4..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fmaxf)
-
-weak_alias (__fmaxf, fmaxf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fmaxf __fmaxf_generic
-
-#include "../s_fmaxf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S
deleted file mode 100644
index b8c3fe0357..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* fmin function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY (__fmin_vis3)
- flcmpd %fcc1, %f0, %f2
- retl
- fmovdge %fcc1, %f2, %f0
-END (__fmin_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S
deleted file mode 100644
index b2aec1bbc0..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fmin)
-
-weak_alias (__fmin, fmin)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fmin __fmin_generic
-
-#include "../s_fmin.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S
deleted file mode 100644
index e716f4ac02..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* fminf function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY (__fminf_vis3)
- flcmps %fcc1, %f1, %f3
- fmovs %f1, %f0
- retl
- fmovsge %fcc1, %f3, %f0
-END (__fminf_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S
deleted file mode 100644
index c4690e1df9..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fminf)
-
-weak_alias (__fminf, fminf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fminf __fminf_generic
-
-#include "../s_fminf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S
new file mode 100644
index 0000000000..ebaf054025
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S
@@ -0,0 +1,6 @@
+#define __isinf __isinf_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <./sysdeps/sparc/sparc64/fpu/s_isinf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S
index 702de3e938..bb5e6a0772 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S
@@ -1,5 +1,5 @@
/* isinf(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S
deleted file mode 100644
index ed9b62640d..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(isinf)
-
-hidden_def (__isinf)
-weak_alias (__isinf, isinf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __isinf __isinf_generic
-
-#include "../s_isinf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c
new file mode 100644
index 0000000000..2eea299486
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c
@@ -0,0 +1,37 @@
+/* isinf ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 __isinf __redirect___isinf
+#define __isinff __redirect___isinff
+#define __isinfl __redirect___isinfl
+#include <math.h>
+#undef __isinf
+#undef __isinff
+#undef __isinfl
+#include <sparc-ifunc.h>
+
+extern __typeof (isinf) __isinf_vis3 attribute_hidden;
+extern __typeof (isinf) __isinf_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect___isinf, __isinf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __isinf_vis3
+ : __isinf_generic)
+
+sparc_ifunc_redirected_hidden_def (__redirect___isinf, __isinf)
+weak_alias (__isinf, isinf)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S
new file mode 100644
index 0000000000..d37243f216
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S
@@ -0,0 +1,6 @@
+#define __isinff __isinff_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_isinff.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S
index 92e6e5c7ae..a80c22905f 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S
@@ -1,5 +1,5 @@
/* isinff(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S
deleted file mode 100644
index 04517398f8..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(isinff)
-
-hidden_def (__isinff)
-weak_alias (__isinff, isinff)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __isinff __isinff_generic
-
-#include "../s_isinff.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c
new file mode 100644
index 0000000000..3b814c89fd
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c
@@ -0,0 +1,33 @@
+/* isinff ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 __isinff __redirect___isinff
+#include <math.h>
+#undef __isinff
+#include <sparc-ifunc.h>
+
+extern __typeof (isinff) __isinff_vis3 attribute_hidden;
+extern __typeof (isinff) __isinff_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect___isinff, __isinff,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __isinff_vis3
+ : __isinff_generic);
+
+sparc_ifunc_redirected_hidden_def (__redirect___isinff, __isinff)
+weak_alias (__isinff, isinff)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S
new file mode 100644
index 0000000000..64d4430d82
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S
@@ -0,0 +1,6 @@
+#define __isnan __isnan_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_isnan.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S
index a891e6be3c..aefb2c77c7 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S
@@ -1,5 +1,5 @@
/* isnan(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S
deleted file mode 100644
index 40e985a5d4..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(isnan)
-
-hidden_def (__isnan)
-weak_alias (__isnan, isnan)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __isnan __isnan_generic
-
-#include "../s_isnan.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c
new file mode 100644
index 0000000000..ccf6fbe93a
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c
@@ -0,0 +1,37 @@
+/* isnan ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 __isnan __redirect___isnan
+#define __isnanf __redirect___isnanf
+#define __isnanl __redirect___isnanl
+#include <math.h>
+#undef __isnan
+#undef __isnanf
+#undef __isnanl
+#include <sparc-ifunc.h>
+
+extern __typeof (isnan) __isnan_vis3 attribute_hidden;
+extern __typeof (isnan) __isnan_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect___isnan, __isnan,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __isnan_vis3
+ : __isnan_generic);
+
+sparc_ifunc_redirected_hidden_def (__redirect___isnan, __isnan)
+weak_alias (__isnan, isnan)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S
new file mode 100644
index 0000000000..5c82f7d101
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S
@@ -0,0 +1,6 @@
+#define __isnanf __isnanf_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_isnanf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S
index 0efaae016f..74c93aa228 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S
@@ -1,5 +1,5 @@
/* isnanf(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S
deleted file mode 100644
index 6b53b69d2e..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(isnanf)
-
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __isnanf __isnanf_generic
-
-#include "../s_isnanf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c
new file mode 100644
index 0000000000..8ad3ccbc64
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c
@@ -0,0 +1,33 @@
+/* isnanf ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 __isnanf __redirect___isnanf
+#include <math.h>
+#undef __isnanf
+#include <sparc-ifunc.h>
+
+extern __typeof (isnanf) __isnanf_vis3 attribute_hidden;
+extern __typeof (isnanf) __isnanf_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect___isnanf, __isnanf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __isnanf_vis3
+ : __isnanf_generic);
+
+sparc_ifunc_redirected_hidden_def (__redirect___isnanf,__isnanf)
+weak_alias (__isnanf, isnanf)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S
new file mode 100644
index 0000000000..e6ab999a66
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S
@@ -0,0 +1,6 @@
+#define __lrint __lrint_generic
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_lrint.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S
index 8ec42ad576..865bc4b9d7 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S
@@ -1,5 +1,5 @@
/* lrint(), sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S
deleted file mode 100644
index 94af8f028c..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(lrint)
-
-weak_alias (__lrint, lrint)
-
-strong_alias (__lrint, __llrint)
-weak_alias (__llrint, llrint)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef strong_alias
-# define strong_alias(a, b)
-
-#define __lrint __lrint_generic
-
-#include "../s_lrint.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c
new file mode 100644
index 0000000000..159bcd9aa6
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c
@@ -0,0 +1,40 @@
+/* lrint/llrint ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 lrint __redirect_lrint
+#define llrint __redirect_llrint
+#define __lrint __redirect___lrint
+#define __llrint __redirect___llrint
+#include <math.h>
+#undef lrint
+#undef llrint
+#undef __lrint
+#undef __llrint
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (__redirect_lrint) __lrint_vis3 attribute_hidden;
+extern __typeof (__redirect_lrint) __lrint_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_lrint, __lrint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __lrint_vis3
+ : __lrint_generic);
+libm_alias_double (__lrint, lrint)
+strong_alias (__lrint, __llrint)
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S
new file mode 100644
index 0000000000..4cfbf4ae72
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S
@@ -0,0 +1,6 @@
+#define __lrintf __lrintf_generic
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_lrintf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S
index 943a2b14b2..229205e98a 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S
@@ -1,5 +1,5 @@
/* lrintf(), sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S
deleted file mode 100644
index e6ea4061c3..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(lrintf)
-
-weak_alias (__lrintf, lrintf)
-
-strong_alias (__lrintf, __llrintf)
-weak_alias (__llrintf, llrintf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef strong_alias
-# define strong_alias(a, b)
-
-#define __lrintf __lrintf_generic
-
-#include "../s_lrintf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c
new file mode 100644
index 0000000000..ccb7cd9723
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c
@@ -0,0 +1,40 @@
+/* lrintf/llrintf ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 lrintf __redirect_lrintf
+#define llrintf __redirect_llrintf
+#define __lrintf __redirect_lrintf
+#define __llrintf __redirect_llrintf
+#include <math.h>
+#undef lrintf
+#undef llrintf
+#undef __lrintf
+#undef __llrintf
+#include <sparc-ifunc.h>
+#include <libm-alias-float.h>
+
+extern __typeof (__redirect_lrintf) __lrintf_vis3 attribute_hidden;
+extern __typeof (__redirect_lrintf) __lrintf_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_lrintf, __lrintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __lrintf_vis3
+ : __lrintf_generic);
+libm_alias_float (__lrint, lrint)
+strong_alias (__lrintf, __llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S
new file mode 100644
index 0000000000..efe238326d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S
@@ -0,0 +1,4 @@
+#define __nearbyint __nearbyint_generic
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_nearbyint.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S
index fff277ae49..29b53e917c 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc64 vis3 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -35,6 +35,7 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyint_vis3)
+ fcmpd %fcc3, %f0, %f0 /* Check for sNaN */
stx %fsr, [%sp + STACK_BIAS + 144]
sethi %hi(TWO_FIFTYTWO), %o2
sllx %o2, 32, %o2
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S
deleted file mode 100644
index bb75ab3606..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(nearbyint)
-
-weak_alias (__nearbyint, nearbyint)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __nearbyint __nearbyint_generic
-
-#include "../s_nearbyint.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c
new file mode 100644
index 0000000000..b58cbdcc9b
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c
@@ -0,0 +1,30 @@
+/* nearbyint ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (nearbyint) __nearbyint_vis3 attribute_hidden;
+extern __typeof (nearbyint) __nearbyint_generic attribute_hidden;
+
+sparc_libm_ifunc (__nearbyint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __nearbyint_vis3
+ : __nearbyint_generic);
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S
new file mode 100644
index 0000000000..a2e38e9983
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S
@@ -0,0 +1,4 @@
+#define __nearbyintf __nearbyintf_generic
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_nearbyintf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S
index c6e94ba73b..de2dbe9c93 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc64 vis3 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -35,6 +35,7 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyintf_vis3)
+ fcmps %fcc3, %f1, %f1 /* Check for sNaN */
stx %fsr, [%sp + STACK_BIAS + 144]
sethi %hi(0xf8003e0), %o5
sethi %hi(TWO_TWENTYTHREE), %o2
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S
deleted file mode 100644
index 95100c1bfc..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(nearbyintf)
-
-weak_alias (__nearbyintf, nearbyintf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __nearbyintf __nearbyintf_generic
-
-#include "../s_nearbyintf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c
new file mode 100644
index 0000000000..bd18ea2fcb
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c
@@ -0,0 +1,30 @@
+/* nearbyintf ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+#include <libm-alias-float.h>
+
+extern __typeof (nearbyintf) __nearbyintf_vis3 attribute_hidden;
+extern __typeof (nearbyintf) __nearbyintf_generic attribute_hidden;
+
+sparc_libm_ifunc (__nearbyintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __nearbyintf_vis3
+ : __nearbyintf_generic);
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S
new file mode 100644
index 0000000000..d92743423e
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S
@@ -0,0 +1,4 @@
+#define __rint __rint_generic
+#undef weak_alias
+#define weak_alias(a, b)
+#include <sysdeps/sparc/sparc64/fpu/s_rint.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S
index c2a8e58cfe..19343c3de9 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S
deleted file mode 100644
index cc980eb8c7..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(rint)
-
-weak_alias (__rint, rint)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __rint __rint_generic
-
-#include "../s_rint.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c
new file mode 100644
index 0000000000..ae782b0b60
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c
@@ -0,0 +1,30 @@
+/* rint ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (rint) __rint_vis3 attribute_hidden;
+extern __typeof (rint) __rint_generic attribute_hidden;
+
+sparc_libm_ifunc (__rint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __rint_vis3
+ : __rint_generic);
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S
new file mode 100644
index 0000000000..30da5f039d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S
@@ -0,0 +1,4 @@
+#define __rintf __rintf_generic
+#undef weak_alias
+#define weak_alias(a, b)
+#include <sysdeps/sparc/sparc64/fpu/s_rintf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S
index 1dde1df91c..86a81c96d2 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S
deleted file mode 100644
index 38fd936086..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(rintf)
-
-weak_alias (__rintf, rintf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __rintf __rintf_generic
-
-#include "../s_rintf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c
new file mode 100644
index 0000000000..e0265c47aa
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c
@@ -0,0 +1,30 @@
+/* rintf ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+#include <libm-alias-float.h>
+
+extern __typeof (rintf) __rintf_vis3 attribute_hidden;
+extern __typeof (rintf) __rintf_generic attribute_hidden;
+
+sparc_libm_ifunc (__rintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __rintf_vis3
+ : __rintf_generic);
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S
new file mode 100644
index 0000000000..dfa40aca8f
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S
@@ -0,0 +1,6 @@
+#define __signbit __signbit_generic
+#undef strong_alias
+#define strong_alias(a, b)
+#undef hidden_def
+#define hidden_def(a)
+#include <sysdeps/sparc/sparc64/fpu/s_signbit.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S
index e2c9f7ddab..4bc1571ce7 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S
@@ -1,5 +1,5 @@
/* signbit(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S
deleted file mode 100644
index e69550c474..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(signbit)
-
-weak_alias (__signbit, signbit)
-
-/* On 64-bit the double version will also always work for
- long-double-precision since in both cases the word with the
- sign bit in it is passed always in register %f0. */
-strong_alias (__signbit, __signbitl)
-hidden_def (__signbitl)
-weak_alias (__signbitl, signbitl)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef strong_alias
-# define strong_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __signbit __signbit_generic
-
-#include "../s_signbit.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c
new file mode 100644
index 0000000000..28d18b93af
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c
@@ -0,0 +1,37 @@
+/* signbit ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 __signbit __redirect_signbit
+#include <math.h>
+#undef __signbit
+
+#include <sparc-ifunc.h>
+
+extern __typeof (__redirect_signbit) __signbit_vis3 attribute_hidden;
+extern __typeof (__redirect_signbit) __signbit_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_signbit, __signbit,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __signbit_vis3
+ : __signbit_generic);
+
+/* On 64-bit the double version will also always work for
+ long-double-precision since in both cases the word with the
+ sign bit in it is passed always in register %f0. */
+strong_alias (__signbit, __signbitl)
+sparc_ifunc_redirected_hidden_def (__redirect_signbit, __signbitl)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S
new file mode 100644
index 0000000000..851ff350d1
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S
@@ -0,0 +1,2 @@
+#define __signbitf __signbitf_generic
+#include <sysdeps/sparc/sparc64/fpu/s_signbitf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S
index 2dab5f9f31..bafa7d1c57 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S
@@ -1,5 +1,5 @@
/* signbitf(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S
deleted file mode 100644
index c35c79f88a..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(signbitf)
-
-weak_alias (__signbitf, signbitf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __signbitf __signbitf_generic
-
-#include "../s_signbitf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c
new file mode 100644
index 0000000000..b2648ee937
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c
@@ -0,0 +1,28 @@
+/* signbit ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <sparc-ifunc.h>
+
+extern int __signbitf_vis3 (float) attribute_hidden;
+extern int __signbitf_generic (float) attribute_hidden;
+
+sparc_libm_ifunc(__signbitf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __signbitf_vis3
+ : __signbitf_generic);
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c
new file mode 100644
index 0000000000..00abd2a643
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c
@@ -0,0 +1,2 @@
+#define __trunc __trunc_generic
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S
deleted file mode 100644
index 63d01485cb..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc64 vis3 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__trunc_vis3)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o2, 32, %o2
- fzero ZERO
- fnegd ZERO, SIGN_BIT
- movxtod %o2, %f16
- fabsd %f0, %f14
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f14
- fand %f0, SIGN_BIT, SIGN_BIT
- fdtox %f14, %f14
- fxtod %f14, %f14
- faddd %f0, ZERO, %f18
- fmovduge %fcc3, %f18, %f14
- retl
- for %f14, SIGN_BIT, %f0
-END (__trunc_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c
new file mode 100644
index 0000000000..a89916ba89
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c
@@ -0,0 +1,23 @@
+/* trunc function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define __trunc __trunc_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S
deleted file mode 100644
index 0d6f43a189..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(trunc)
-
-weak_alias (__trunc, trunc)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __trunc __trunc_generic
-
-#include "../s_trunc.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
new file mode 100644
index 0000000000..82ad6ffcca
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
@@ -0,0 +1,30 @@
+/* trunc function, sparc64 version.
+ Copyright (C) 2016-2018 Free Software 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 <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-double.h>
+
+extern __typeof (trunc) __trunc_vis3 attribute_hidden;
+extern __typeof (trunc) __trunc_generic attribute_hidden;
+
+sparc_libm_ifunc (__trunc,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __trunc_vis3
+ : __trunc_generic);
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c
new file mode 100644
index 0000000000..7e5d91e742
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c
@@ -0,0 +1,2 @@
+#define __truncf __truncf_generic
+#include <sysdeps/ieee754/flt-32/s_truncf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S
deleted file mode 100644
index 10b09c262c..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc64 vis3 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__truncf_vis3)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2,%f16
- fabss %f1, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f14
- fands %f1, SIGN_BIT, SIGN_BIT
- fstoi %f14, %f14
- fitos %f14, %f14
- fadds %f1, ZERO, %f18
- fmovsuge %fcc3, %f18, %f14
- retl
- fors %f14, SIGN_BIT, %f0
-END (__truncf_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c
new file mode 100644
index 0000000000..676b1b47aa
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c
@@ -0,0 +1,23 @@
+/* Float trunc function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define __truncf __truncf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_truncf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S
deleted file mode 100644
index 2ca2517334..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(truncf)
-
-weak_alias (__truncf, truncf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __truncf __truncf_generic
-
-#include "../s_truncf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c
new file mode 100644
index 0000000000..1c7a4a038f
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c
@@ -0,0 +1,30 @@
+/* Float trunc function, sparc64 version.
+ Copyright (C) 2016-2018 Free Software 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 <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
+
+extern __typeof (truncf) __truncf_vis3 attribute_hidden;
+extern __typeof (truncf) __truncf_generic attribute_hidden;
+
+sparc_libm_ifunc (__truncf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __truncf_vis3
+ : __truncf_generic)
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/sparc/sparc64/fpu/s_ceil.S b/sysdeps/sparc/sparc64/fpu/s_ceil.S
deleted file mode 100644
index 2c74438de4..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_ceil.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/* ceil function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceil)
- sethi %hi(TWO_FIFTYTWO), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzero ZERO
-
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
-
- sllx %o3, 32, %o3
- stx %o2, [%sp + STACK_BIAS + 128]
- fabsd %f0, %f14
-
- ldd [%sp + STACK_BIAS + 128], %f16
- fcmpd %fcc3, %f14, %f16
-
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
-
- for %f16, SIGN_BIT, %f16
- faddd %f0, %f16, %f18
- fsubd %f18, %f16, %f18
- fcmpd %fcc2, %f18, %f0
- stx %o3, [%sp + STACK_BIAS + 128]
-
- ldd [%sp + STACK_BIAS + 128], %f20
- fmovduge %fcc2, ZERO, %f20
- faddd %f18, %f20, %f0
- fabsd %f0, %f0
- retl
- for %f0, SIGN_BIT, %f0
-END (__ceil)
-weak_alias (__ceil, ceil)
diff --git a/sysdeps/sparc/sparc64/fpu/s_ceilf.S b/sysdeps/sparc/sparc64/fpu/s_ceilf.S
deleted file mode 100644
index 5542dc4818..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_ceilf.S
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Float ceil function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceilf)
- sethi %hi(TWO_TWENTYTHREE), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzeros ZERO
-
- fnegs ZERO, SIGN_BIT
-
- st %o2, [%sp + STACK_BIAS + 128]
- fabss %f1, %f14
-
- ld [%sp + STACK_BIAS + 128], %f16
- fcmps %fcc3, %f14, %f16
-
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
-
- fors %f16, SIGN_BIT, %f16
- fadds %f1, %f16, %f5
- fsubs %f5, %f16, %f5
- fcmps %fcc2, %f5, %f1
- st %o3, [%sp + STACK_BIAS + 128]
-
- ld [%sp + STACK_BIAS + 128], %f9
- fmovsuge %fcc2, ZERO, %f9
- fadds %f5, %f9, %f0
- fabss %f0, %f0
- retl
- fors %f0, SIGN_BIT, %f0
-END (__ceilf)
-weak_alias (__ceilf, ceilf)
diff --git a/sysdeps/sparc/sparc64/fpu/s_copysign.S b/sysdeps/sparc/sparc64/fpu/s_copysign.S
index 390b463525..f3f207dea0 100644
--- a/sysdeps/sparc/sparc64/fpu/s_copysign.S
+++ b/sysdeps/sparc/sparc64/fpu/s_copysign.S
@@ -1,5 +1,5 @@
/* copysign function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
ENTRY (__copysign)
fzeros %f7
@@ -27,4 +28,4 @@ ENTRY (__copysign)
retl
fors %f0, %f9, %f0
END (__copysign)
-weak_alias (__copysign, copysign) \ No newline at end of file
+libm_alias_double (__copysign, copysign)
diff --git a/sysdeps/sparc/sparc64/fpu/s_copysignf.S b/sysdeps/sparc/sparc64/fpu/s_copysignf.S
index def4b6bf97..6fb25c3322 100644
--- a/sysdeps/sparc/sparc64/fpu/s_copysignf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_copysignf.S
@@ -1,5 +1,5 @@
/* float copysign function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
ENTRY (__copysignf)
fzeros %f7
@@ -27,4 +28,4 @@ ENTRY (__copysignf)
retl
fors %f1, %f9, %f0
END (__copysignf)
-weak_alias (__copysignf, copysignf) \ No newline at end of file
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fabs.c b/sysdeps/sparc/sparc64/fpu/s_fabs.c
index db5ecf2162..7862290da3 100644
--- a/sysdeps/sparc/sparc64/fpu/s_fabs.c
+++ b/sysdeps/sparc/sparc64/fpu/s_fabs.c
@@ -1,5 +1,7 @@
+#include <libm-alias-double.h>
+
double __fabs (double x)
{
return __builtin_fabs (x);
}
-weak_alias (__fabs, fabs)
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fabsf.c b/sysdeps/sparc/sparc64/fpu/s_fabsf.c
index 8a218e4942..5f54f80bf5 100644
--- a/sysdeps/sparc/sparc64/fpu/s_fabsf.c
+++ b/sysdeps/sparc/sparc64/fpu/s_fabsf.c
@@ -1,5 +1,7 @@
+#include <libm-alias-float.h>
+
float __fabsf (float x)
{
return __builtin_fabsf (x);
}
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fabsl.c b/sysdeps/sparc/sparc64/fpu/s_fabsl.c
index 67e9f47071..72e1c51340 100644
--- a/sysdeps/sparc/sparc64/fpu/s_fabsl.c
+++ b/sysdeps/sparc/sparc64/fpu/s_fabsl.c
@@ -1,5 +1,7 @@
+#include <libm-alias-ldouble.h>
+
long double __fabsl (long double x)
{
return __builtin_fabsl (x);
}
-weak_alias (__fabsl, fabsl)
+libm_alias_ldouble (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fdim.S b/sysdeps/sparc/sparc64/fpu/s_fdim.S
deleted file mode 100644
index 7fae72a251..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_fdim.S
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Compute positive difference, sparc 64-bit.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <math_ldbl_opt.h>
-
-ENTRY(__fdim)
- fcmpd %f0, %f2
- fbug 1f
- nop
- fzero %f0
- fnegd %f0, %f2
-1: retl
- fsubd %f0, %f2, %f0
-END(__fdim)
-weak_alias (__fdim, fdim)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fdimf.S b/sysdeps/sparc/sparc64/fpu/s_fdimf.S
deleted file mode 100644
index 356c23c4e3..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_fdimf.S
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Compute positive difference, sparc 64-bit.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
-ENTRY(__fdimf)
- fcmps %f1, %f3
- fbug 1f
- nop
- fzeros %f1
- fnegs %f1, %f3
-1: retl
- fsubs %f1, %f3, %f0
-END(__fdimf)
-weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/sparc/sparc64/fpu/s_finite.S b/sysdeps/sparc/sparc64/fpu/s_finite.S
index aa80fa0d83..b3018bbbcd 100644
--- a/sysdeps/sparc/sparc64/fpu/s_finite.S
+++ b/sysdeps/sparc/sparc64/fpu/s_finite.S
@@ -1,5 +1,5 @@
/* finite(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/s_finitef.S b/sysdeps/sparc/sparc64/fpu/s_finitef.S
index cdcdf34417..e82af81079 100644
--- a/sysdeps/sparc/sparc64/fpu/s_finitef.S
+++ b/sysdeps/sparc/sparc64/fpu/s_finitef.S
@@ -1,5 +1,5 @@
/* finitef(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/s_floor.S b/sysdeps/sparc/sparc64/fpu/s_floor.S
deleted file mode 100644
index aded393595..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_floor.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/* floor function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floor)
- sethi %hi(TWO_FIFTYTWO), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzero ZERO
-
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
-
- sllx %o3, 32, %o3
- stx %o2, [%sp + STACK_BIAS + 128]
- fabsd %f0, %f14
-
- ldd [%sp + STACK_BIAS + 128], %f16
- fcmpd %fcc3, %f14, %f16
-
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
-
- for %f16, SIGN_BIT, %f16
- faddd %f0, %f16, %f18
- fsubd %f18, %f16, %f18
- fcmpd %fcc2, %f18, %f0
- stx %o3, [%sp + STACK_BIAS + 128]
-
- ldd [%sp + STACK_BIAS + 128], %f20
- fmovdule %fcc2, ZERO, %f20
- fsubd %f18, %f20, %f0
- fabsd %f0, %f0
- retl
- for %f0, SIGN_BIT, %f0
-END (__floor)
-weak_alias (__floor, floor)
diff --git a/sysdeps/sparc/sparc64/fpu/s_floorf.S b/sysdeps/sparc/sparc64/fpu/s_floorf.S
deleted file mode 100644
index 9f20549d8f..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_floorf.S
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Float floor function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floorf)
- sethi %hi(TWO_TWENTYTHREE), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzeros ZERO
-
- fnegs ZERO, SIGN_BIT
-
- st %o2, [%sp + STACK_BIAS + 128]
- fabss %f1, %f14
-
- ld [%sp + STACK_BIAS + 128], %f16
- fcmps %fcc3, %f14, %f16
-
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
-
- fors %f16, SIGN_BIT, %f16
- fadds %f1, %f16, %f5
- fsubs %f5, %f16, %f5
- fcmps %fcc2, %f5, %f1
- st %o3, [%sp + STACK_BIAS + 128]
-
- ld [%sp + STACK_BIAS + 128], %f9
- fmovsule %fcc2, ZERO, %f9
- fsubs %f5, %f9, %f0
- fabss %f0, %f0
- retl
- fors %f0, SIGN_BIT, %f0
-END (__floorf)
-weak_alias (__floorf, floorf)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fmax.S b/sysdeps/sparc/sparc64/fpu/s_fmax.S
deleted file mode 100644
index 2082354991..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_fmax.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* fmax function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__fmax)
- fcmpd %fcc1, %f2, %f2
- fzero SIGN_BIT
- fmovdu %fcc1, %f0, %f2
- fnegd SIGN_BIT, SIGN_BIT
- fcmpd %fcc2, %f0, %f2
- fmovdul %fcc2, %f2, %f0
- fand %f0, %f2, %f4
- fandnot2 SIGN_BIT, %f4, %f4
- retl
- fandnot2 %f0, %f4, %f0
-END (__fmax)
-weak_alias (__fmax, fmax)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fmaxf.S b/sysdeps/sparc/sparc64/fpu/s_fmaxf.S
deleted file mode 100644
index 1117d7a840..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_fmaxf.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* fmaxf function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__fmaxf)
- fcmps %fcc1, %f3, %f3
- fzeros SIGN_BIT
- fmovsu %fcc1, %f1, %f3
- fnegs SIGN_BIT, SIGN_BIT
- fcmps %fcc2, %f1, %f3
- fmovsul %fcc2, %f3, %f1
- fands %f1, %f3, %f4
- fandnot2s SIGN_BIT, %f4, %f4
- retl
- fandnot2s %f1, %f4, %f0
-END (__fmaxf)
-weak_alias (__fmaxf, fmaxf)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fmin.S b/sysdeps/sparc/sparc64/fpu/s_fmin.S
deleted file mode 100644
index d93f76a38a..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_fmin.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* fmin function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__fmin)
- fcmpd %fcc1, %f2, %f2
- fzero SIGN_BIT
- fmovdu %fcc1, %f0, %f2
- fnegd SIGN_BIT, SIGN_BIT
- fcmpd %fcc2, %f0, %f2
- fmovdug %fcc2, %f2, %f0
- for %f0, %f2, %f4
- fand %f4, SIGN_BIT, %f4
- retl
- for %f0, %f4, %f0
-END (__fmin)
-weak_alias (__fmin, fmin)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fminf.S b/sysdeps/sparc/sparc64/fpu/s_fminf.S
deleted file mode 100644
index bfa2e5b7e6..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_fminf.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* fminf function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__fminf)
- fcmps %fcc1, %f3, %f3
- fzeros SIGN_BIT
- fmovsu %fcc1, %f1, %f3
- fnegs SIGN_BIT, SIGN_BIT
- fcmps %fcc2, %f1, %f3
- fmovsug %fcc2, %f3, %f1
- fors %f1, %f3, %f4
- fands %f4, SIGN_BIT, %f4
- retl
- fors %f1, %f4, %f0
-END (__fminf)
-weak_alias (__fminf, fminf)
diff --git a/sysdeps/sparc/sparc64/fpu/s_isinf.S b/sysdeps/sparc/sparc64/fpu/s_isinf.S
index b9da758d71..6365bc438b 100644
--- a/sysdeps/sparc/sparc64/fpu/s_isinf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_isinf.S
@@ -1,5 +1,5 @@
/* isinf(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/s_isinff.S b/sysdeps/sparc/sparc64/fpu/s_isinff.S
index a68845672f..9737d91102 100644
--- a/sysdeps/sparc/sparc64/fpu/s_isinff.S
+++ b/sysdeps/sparc/sparc64/fpu/s_isinff.S
@@ -1,5 +1,5 @@
/* isinff(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/s_isnan.S b/sysdeps/sparc/sparc64/fpu/s_isnan.S
index 342b987203..47ac0cf247 100644
--- a/sysdeps/sparc/sparc64/fpu/s_isnan.S
+++ b/sysdeps/sparc/sparc64/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/s_isnanf.S b/sysdeps/sparc/sparc64/fpu/s_isnanf.S
index 43e232260a..32e80219f7 100644
--- a/sysdeps/sparc/sparc64/fpu/s_isnanf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_isnanf.S
@@ -1,5 +1,5 @@
/* isnanf(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/fpu/s_lrint.S b/sysdeps/sparc/sparc64/fpu/s_lrint.S
index 0e21aba06d..907a466be5 100644
--- a/sysdeps/sparc/sparc64/fpu/s_lrint.S
+++ b/sysdeps/sparc/sparc64/fpu/s_lrint.S
@@ -1,5 +1,5 @@
/* lrint(), sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -57,7 +58,7 @@ ENTRY (__lrint)
retl
ldx [%sp + STACK_BIAS + 128], %o0
END (__lrint)
-weak_alias (__lrint, lrint)
+libm_alias_double (__lrint, lrint)
strong_alias (__lrint, __llrint)
-weak_alias (__llrint, llrint)
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_lrintf.S b/sysdeps/sparc/sparc64/fpu/s_lrintf.S
index 275222ff2d..7a341f6fc5 100644
--- a/sysdeps/sparc/sparc64/fpu/s_lrintf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_lrintf.S
@@ -1,5 +1,5 @@
/* lrintf(), sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -56,7 +57,7 @@ ENTRY (__lrintf)
retl
ldx [%sp + STACK_BIAS + 128], %o0
END (__lrintf)
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
strong_alias (__lrintf, __llrintf)
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_nearbyint.S b/sysdeps/sparc/sparc64/fpu/s_nearbyint.S
index caf4d729e0..a8f099779f 100644
--- a/sysdeps/sparc/sparc64/fpu/s_nearbyint.S
+++ b/sysdeps/sparc/sparc64/fpu/s_nearbyint.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -20,6 +20,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -35,6 +36,7 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyint)
+ fcmpd %fcc3, %f0, %f0 /* Check for sNaN */
stx %fsr, [%sp + STACK_BIAS + 144]
sethi %hi(TWO_FIFTYTWO), %o2
sllx %o2, 32, %o2
@@ -60,4 +62,4 @@ ENTRY (__nearbyint)
retl
ldx [%sp + STACK_BIAS + 144], %fsr
END (__nearbyint)
-weak_alias (__nearbyint, nearbyint)
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S b/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S
index 4232eca9ad..361ea5800d 100644
--- a/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc64 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -20,6 +20,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -35,6 +36,7 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyintf)
+ fcmps %fcc3, %f1, %f1 /* Check for sNaN */
stx %fsr, [%sp + STACK_BIAS + 144]
sethi %hi(0xf8003e0), %o5
sethi %hi(TWO_TWENTYTHREE), %o2
@@ -59,4 +61,4 @@ ENTRY (__nearbyintf)
retl
ldx [%sp + STACK_BIAS + 144], %fsr
END (__nearbyintf)
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_rint.S b/sysdeps/sparc/sparc64/fpu/s_rint.S
index afdb4329fb..23745fb7e5 100644
--- a/sysdeps/sparc/sparc64/fpu/s_rint.S
+++ b/sysdeps/sparc/sparc64/fpu/s_rint.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -54,4 +55,4 @@ ENTRY (__rint)
retl
for %f0, SIGN_BIT, %f0
END (__rint)
-weak_alias (__rint, rint)
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_rintf.S b/sysdeps/sparc/sparc64/fpu/s_rintf.S
index f9448957cf..7eeb175aa7 100644
--- a/sysdeps/sparc/sparc64/fpu/s_rintf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_rintf.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -53,4 +54,4 @@ ENTRY (__rintf)
retl
fors %f0, SIGN_BIT, %f0
END (__rintf)
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_signbit.S b/sysdeps/sparc/sparc64/fpu/s_signbit.S
index 1452c90f95..57fc717a48 100644
--- a/sysdeps/sparc/sparc64/fpu/s_signbit.S
+++ b/sysdeps/sparc/sparc64/fpu/s_signbit.S
@@ -1,5 +1,5 @@
/* signbit(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,11 +24,9 @@ ENTRY (__signbit)
retl
srl %o0, 31, %o0
END (__signbit)
-weak_alias (__signbit, signbit)
/* On 64-bit the double version will also always work for
long-double-precision since in both cases the word with the
sign bit in it is passed always in register %f0. */
strong_alias (__signbit, __signbitl)
hidden_def (__signbitl)
-weak_alias (__signbitl, signbitl)
diff --git a/sysdeps/sparc/sparc64/fpu/s_signbitf.S b/sysdeps/sparc/sparc64/fpu/s_signbitf.S
index 40d43d6c91..0b20f0189a 100644
--- a/sysdeps/sparc/sparc64/fpu/s_signbitf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_signbitf.S
@@ -1,5 +1,5 @@
/* signbitf(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,4 +24,3 @@ ENTRY (__signbitf)
retl
srl %o0, 31, %o0
END (__signbitf)
-weak_alias (__signbitf, signbitf)
diff --git a/sysdeps/sparc/sparc64/fpu/s_trunc.S b/sysdeps/sparc/sparc64/fpu/s_trunc.S
deleted file mode 100644
index 34ecb142d4..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_trunc.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc64 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__trunc)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o2, 32, %o2
- fzero ZERO
- fnegd ZERO, SIGN_BIT
- stx %o2, [%sp + STACK_BIAS + 128]
- fabsd %f0, %f14
- ldd [%sp + STACK_BIAS + 128], %f16
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f14
- fand %f0, SIGN_BIT, SIGN_BIT
- fdtox %f14, %f14
- fxtod %f14, %f14
- faddd %f0, ZERO, %f18
- fmovduge %fcc3, %f18, %f14
- retl
- for %f14, SIGN_BIT, %f0
-END (__trunc)
-weak_alias (__trunc, trunc)
diff --git a/sysdeps/sparc/sparc64/fpu/s_truncf.S b/sysdeps/sparc/sparc64/fpu/s_truncf.S
deleted file mode 100644
index 7bc7235bec..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_truncf.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc64 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__truncf)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + STACK_BIAS + 128]
- fabss %f1, %f14
- ld [%sp + STACK_BIAS + 128], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f14
- fands %f1, SIGN_BIT, SIGN_BIT
- fstoi %f14, %f14
- fitos %f14, %f14
- fadds %f1, ZERO, %f18
- fmovsuge %fcc3, %f18, %f14
- retl
- fors %f14, SIGN_BIT, %f0
-END (__truncf)
-weak_alias (__truncf, truncf)
diff --git a/sysdeps/sparc/sparc64/fpu/w_sqrt.S b/sysdeps/sparc/sparc64/fpu/w_sqrt.S
deleted file mode 100644
index baa7c47fd2..0000000000
--- a/sysdeps/sparc/sparc64/fpu/w_sqrt.S
+++ /dev/null
@@ -1,48 +0,0 @@
-/* sqrt function. sparc64 version.
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY (__sqrt)
- fzero %f8
- fcmpd %fcc2, %f0, %f8
- fbl,pn %fcc2, 1f
- nop
-8: retl
- fsqrtd %f0, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ldx [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
-#else
- sethi %hi(_LIB_VERSION), %g1
- or %g1, %lo(_LIB_VERSION), %g1
-#endif
- ld [%g1], %g1
- cmp %g1, -1
- be,pt %icc, 8b
- fmovd %f0, %f2
- mov 26, %o2
- mov %o7, %g1
- call __kernel_standard
- mov %g1, %o7
-END (__sqrt)
-
-weak_alias (__sqrt, sqrt)
diff --git a/sysdeps/sparc/sparc64/fpu/w_sqrtf.S b/sysdeps/sparc/sparc64/fpu/w_sqrtf.S
deleted file mode 100644
index 4d1fedbd62..0000000000
--- a/sysdeps/sparc/sparc64/fpu/w_sqrtf.S
+++ /dev/null
@@ -1,48 +0,0 @@
-/* sqrtf function. sparc64 version.
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY (__sqrtf)
- fzeros %f8
- fcmps %fcc2, %f1, %f8
- fbl,pn %fcc2, 1f
- nop
-8: retl
- fsqrts %f1, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ldx [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
-#else
- sethi %hi(_LIB_VERSION), %g1
- or %g1, %lo(_LIB_VERSION), %g1
-#endif
- ld [%g1], %g1
- cmp %g1, -1
- be,pt %icc, 8b
- fmovs %f1, %f3
- mov 126, %o2
- mov %o7, %g1
- call __kernel_standard_f
- mov %g1, %o7
-END (__sqrtf)
-
-weak_alias (__sqrtf, sqrtf)
diff --git a/sysdeps/sparc/sparc64/hp-timing.h b/sysdeps/sparc/sparc64/hp-timing.h
index 14ad1a4bea..6632564106 100644
--- a/sysdeps/sparc/sparc64/hp-timing.h
+++ b/sysdeps/sparc/sparc64/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. sparc64 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@redhat.com>, 2001.
diff --git a/sysdeps/sparc/sparc64/jmpbuf-unwind.h b/sysdeps/sparc/sparc64/jmpbuf-unwind.h
index 11a8dd8221..c07688dd2b 100644
--- a/sysdeps/sparc/sparc64/jmpbuf-unwind.h
+++ b/sysdeps/sparc/sparc64/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2005.
@@ -22,15 +22,16 @@
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_gregs[MC_O6] + 2047)
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((unsigned long int) (address) \
+ < (jmpbuf)->__uc_mcontext.__mc_gregs[MC_O6] + 2047)
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
_JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
((uintptr_t) (_address) - (_adj) \
- < (uintptr_t) (_jmpbuf)[0].uc_mcontext.mc_gregs[MC_O6] + 2047 - (_adj))
+ < (uintptr_t) (_jmpbuf)[0].__uc_mcontext.__mc_gregs[MC_O6] + 2047 - (_adj))
/* We use the normal lobngjmp for unwinding. */
#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
diff --git a/sysdeps/sparc/sparc64/lshift.S b/sysdeps/sparc/sparc64/lshift.S
index d67dc3ab02..9fa0f99aea 100644
--- a/sysdeps/sparc/sparc64/lshift.S
+++ b/sysdeps/sparc/sparc64/lshift.S
@@ -1,6 +1,6 @@
/* SPARC v9 __mpn_lshift --
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/sparc/sparc64/memchr.S b/sysdeps/sparc/sparc64/memchr.S
index d3e75f6647..1024cb0000 100644
--- a/sysdeps/sparc/sparc64/memchr.S
+++ b/sysdeps/sparc/sparc64/memchr.S
@@ -1,7 +1,7 @@
/* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less
than N.
For SPARC v9.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index 24d3a6d822..46ac800102 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -1,6 +1,6 @@
/* Compare two memory blocks for differences in the first COUNT bytes.
For SPARC v9.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc64/memcpy.S b/sysdeps/sparc/sparc64/memcpy.S
index 3a286c4156..e1542d26bf 100644
--- a/sysdeps/sparc/sparc64/memcpy.S
+++ b/sysdeps/sparc/sparc64/memcpy.S
@@ -1,6 +1,6 @@
/* Copy SIZE bytes from SRC to DEST.
For UltraSPARC.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@caip.rutgers.edu) and
Jakub Jelinek (jakub@redhat.com).
diff --git a/sysdeps/sparc/sparc64/memmove.S b/sysdeps/sparc/sparc64/memmove.S
new file mode 100644
index 0000000000..117786bc1c
--- /dev/null
+++ b/sysdeps/sparc/sparc64/memmove.S
@@ -0,0 +1,186 @@
+/* Copy memory to memory until the specified number of bytes
+ has been copied. Overlap is handled correctly.
+ For SPARC V9.
+ Copyright (C) 2017-2018 Free Software 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>
+
+#ifndef XCC
+# define XCC xcc
+ .register %g2, #scratch
+#endif
+
+ENTRY(memmove)
+ mov %o0, %g2 /* Save pointer to destination */
+ cmp %o1, %o0 /* if from address is >= to use forward copy */
+ bgeu,a %XCC, 2f /* else use backward if ... */
+ cmp %o2, 17 /* delay slot, for small counts copy bytes */
+
+ sub %o0, %o1, %o4 /* get difference of two addresses */
+ cmp %o2, %o4 /* compare size and difference of addresses */
+ bgu %XCC, .Lovbc /* if size is bigger, have to do overlapped copy */
+ cmp %o2, 17 /* delay slot, for small counts copy bytes */
+/*
+ * normal, copy forwards
+ */
+2: ble %XCC, .Ldbytecp
+ andcc %o1, 3, %o5 /* is src word aligned */
+ bz,pn %icc, .Laldst
+ cmp %o5, 2 /* is src half-word aligned */
+ be,pn %icc, .Ls2alg
+ cmp %o5, 3 /* src is byte aligned */
+ ldub [%o1], %o3 /* move 1 or 3 bytes to align it */
+ inc 1, %o1
+ stb %o3, [%o0] /* move a byte to align src */
+ inc 1, %o0
+ bne,pn %icc, .Ls2alg
+ dec %o2
+ b .Lald /* now go align dest */
+ andcc %o0, 3, %o5
+
+.Ls2alg:
+ lduh [%o1], %o3 /* know src is 2 byte aligned */
+ inc 2, %o1
+ srl %o3, 8, %o4
+ stb %o4, [%o0] /* have to do bytes, */
+ stb %o3, [%o0 + 1] /* don't know dst alingment */
+ inc 2, %o0
+ dec 2, %o2
+
+.Laldst:
+ andcc %o0, 3, %o5 /* align the destination address */
+.Lald: bz,pn %icc, .Lw4cp
+ cmp %o5, 2
+ bz,pn %icc, .Lw2cp
+ cmp %o5, 3
+.Lw3cp:
+ lduw [%o1], %o4
+ inc 4, %o1
+ srl %o4, 24, %o5
+ stb %o5, [%o0]
+ bne,pt %icc, .Lw1cp
+ inc %o0
+ dec 1, %o2
+ andn %o2, 3, %o3 /* i3 is aligned word count */
+ dec 4, %o3 /* avoid reading beyond tail of src */
+ sub %o1, %o0, %o1 /* i1 gets the difference */
+
+1: sll %o4, 8, %g1 /* save residual bytes */
+ lduw [%o1+%o0], %o4
+ deccc 4, %o3
+ srl %o4, 24, %o5 /* merge with residual */
+ or %o5, %g1, %g1
+ st %g1, [%o0]
+ bnz,pt %XCC, 1b
+ inc 4, %o0
+ sub %o1, 3, %o1 /* used one byte of last word read */
+ and %o2, 3, %o2
+ b 7f
+ inc 4, %o2
+
+.Lw1cp:
+ srl %o4, 8, %o5
+ sth %o5, [%o0]
+ inc 2, %o0
+ dec 3, %o2
+ andn %o2, 3, %o3
+ dec 4, %o3 /* avoid reading beyond tail of src */
+ sub %o1, %o0, %o1 /* i1 gets the difference */
+
+2: sll %o4, 24, %g1 /* save residual bytes */
+ lduw [%o1+%o0], %o4
+ deccc 4, %o3
+ srl %o4, 8, %o5 /* merge with residual */
+ or %o5, %g1, %g1
+ st %g1, [%o0]
+ bnz,pt %XCC, 2b
+ inc 4, %o0
+ sub %o1, 1, %o1 /* used three bytes of last word read */
+ and %o2, 3, %o2
+ b 7f
+ inc 4, %o2
+
+.Lw2cp:
+ lduw [%o1], %o4
+ inc 4, %o1
+ srl %o4, 16, %o5
+ sth %o5, [%o0]
+ inc 2, %o0
+ dec 2, %o2
+ andn %o2, 3, %o3 /* i3 is aligned word count */
+ dec 4, %o3 /* avoid reading beyond tail of src */
+ sub %o1, %o0, %o1 /* i1 gets the difference */
+
+3: sll %o4, 16, %g1 /* save residual bytes */
+ lduw [%o1+%o0], %o4
+ deccc 4, %o3
+ srl %o4, 16, %o5 /* merge with residual */
+ or %o5, %g1, %g1
+ st %g1, [%o0]
+ bnz,pt %XCC, 3b
+ inc 4, %o0
+ sub %o1, 2, %o1 /* used two bytes of last word read */
+ and %o2, 3, %o2
+ b 7f
+ inc 4, %o2
+
+.Lw4cp:
+ andn %o2, 3, %o3 /* i3 is aligned word count */
+ sub %o1, %o0, %o1 /* i1 gets the difference */
+
+1: lduw [%o1+%o0], %o4 /* read from address */
+ deccc 4, %o3 /* decrement count */
+ st %o4, [%o0] /* write at destination address */
+ bg,pt %XCC, 1b
+ inc 4, %o0 /* increment to address */
+ b 7f
+ and %o2, 3, %o2 /* number of leftover bytes, if any */
+
+/*
+ * differenced byte copy, works with any alignment
+ */
+.Ldbytecp:
+ b 7f
+ sub %o1, %o0, %o1 /* i1 gets the difference */
+
+4: stb %o4, [%o0] /* write to address */
+ inc %o0 /* inc to address */
+7: deccc %o2 /* decrement count */
+ bge,a %XCC, 4b /* loop till done */
+ ldub [%o1+%o0], %o4 /* read from address */
+ retl
+ mov %g2, %o0 /* return pointer to destination */
+
+/*
+ * an overlapped copy that must be done "backwards"
+ */
+.Lovbc:
+ add %o1, %o2, %o1 /* get to end of source space */
+ add %o0, %o2, %o0 /* get to end of destination space */
+ sub %o1, %o0, %o1 /* i1 gets the difference */
+
+5: dec %o0 /* decrement to address */
+ ldub [%o1+%o0], %o3 /* read a byte */
+ deccc %o2 /* decrement count */
+ bg,pt %XCC, 5b /* loop until done */
+ stb %o3, [%o0] /* write byte */
+ retl
+ mov %g2, %o0 /* return pointer to destination */
+END(memmove)
+
+libc_hidden_builtin_def (memmove)
diff --git a/sysdeps/sparc/sparc64/memset.S b/sysdeps/sparc/sparc64/memset.S
index 48002ebb58..72ae8e1ca1 100644
--- a/sysdeps/sparc/sparc64/memset.S
+++ b/sysdeps/sparc/sparc64/memset.S
@@ -1,6 +1,6 @@
/* Set a block of memory to some byte value.
For UltraSPARC.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@caip.rutgers.edu) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/mul_1.S b/sysdeps/sparc/sparc64/mul_1.S
index 42b3b5c0de..4b7f4dbbeb 100644
--- a/sysdeps/sparc/sparc64/mul_1.S
+++ b/sysdeps/sparc/sparc64/mul_1.S
@@ -1,7 +1,7 @@
/* SPARC v9 __mpn_mul_1 -- Multiply a limb vector with a single limb and
store the product in a second limb vector.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/sparc/sparc64/multiarch/Makefile b/sysdeps/sparc/sparc64/multiarch/Makefile
index 55b757f9ad..eaf758e7aa 100644
--- a/sysdeps/sparc/sparc64/multiarch/Makefile
+++ b/sysdeps/sparc/sparc64/multiarch/Makefile
@@ -8,11 +8,15 @@ endif
ifeq ($(subdir),string)
sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \
- memset-niagara1 memcpy-niagara4 memset-niagara4
+ memset-niagara1 memcpy-niagara4 memset-niagara4 \
+ memcpy-ultra1 memset-ultra1 memcpy-memmove-niagara7 \
+ memmove-ultra1 memset-niagara7
endif
ifeq ($(subdir),stdlib)
-sysdep_routines += mul_1-vis3 addmul_1-vis3 submul_1-vis3 add_n-vis3 sub_n-vis3
+sysdep_routines += mul_1-vis3 mul_1-generic addmul_1-vis3 addmul_1-generic \
+ submul_1-vis3 submul_1-generic add_n-vis3 add_n-generic \
+ sub_n-vis3 sub_n-generic
endif
ifeq ($(subdir),math)
diff --git a/sysdeps/sparc/sparc64/multiarch/add_n-generic.S b/sysdeps/sparc/sparc64/multiarch/add_n-generic.S
new file mode 100644
index 0000000000..a16e7091b4
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/add_n-generic.S
@@ -0,0 +1,2 @@
+#define __mpn_add_n __mpn_add_n_generic
+#include <sysdeps/sparc/sparc64/add_n.S>
diff --git a/sysdeps/sparc/sparc64/multiarch/add_n-vis3.S b/sysdeps/sparc/sparc64/multiarch/add_n-vis3.S
index 0fda45a208..b4f1ef5181 100644
--- a/sysdeps/sparc/sparc64/multiarch/add_n-vis3.S
+++ b/sysdeps/sparc/sparc64/multiarch/add_n-vis3.S
@@ -1,7 +1,7 @@
! SPARC v9 64-bit VIS3 __mpn_add_n -- Add two limb vectors of the same length > 0 and
! store sum in a third limb vector.
!
-! Copyright (C) 2013-2016 Free Software Foundation, Inc.
+! Copyright (C) 2013-2018 Free Software Foundation, Inc.
! This file is part of the GNU C Library.
! Contributed by David S. Miller <davem@davemloft.net>
!
diff --git a/sysdeps/sparc/sparc64/multiarch/add_n.S b/sysdeps/sparc/sparc64/multiarch/add_n.S
deleted file mode 100644
index 8e67d75921..0000000000
--- a/sysdeps/sparc/sparc64/multiarch/add_n.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Multiple versions of add_n
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- Contributed by David S. Miller (davem@davemloft.net)
- 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>
-
-ENTRY(__mpn_add_n)
- .type __mpn_add_n, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_VIS3, %o1
- andcc %o0, %o1, %g0
- be 1f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__mpn_add_n_vis3), %o1
- xor %o1, %gdop_lox10(__mpn_add_n_vis3), %o1
-# else
- set __mpn_add_n_vis3, %o1
-# endif
- ba 10f
- nop
-1:
-# ifdef SHARED
- sethi %gdop_hix22(__mpn_add_n_generic), %o1
- xor %o1, %gdop_lox10(__mpn_add_n_generic), %o1
-# else
- set __mpn_add_n_generic, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(__mpn_add_n)
-
-#define __mpn_add_n __mpn_add_n_generic
-#include "../add_n.S"
diff --git a/sysdeps/sparc/sparc64/multiarch/add_n.c b/sysdeps/sparc/sparc64/multiarch/add_n.c
new file mode 100644
index 0000000000..47b0d0e3bc
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/add_n.c
@@ -0,0 +1,28 @@
+/* __mpn_add_n ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <gmp.h>
+#include <sparc-ifunc.h>
+
+extern __typeof (mpn_add_n) __mpn_add_n_vis3 attribute_hidden;
+extern __typeof (mpn_add_n) __mpn_add_n_generic attribute_hidden;
+
+sparc_libm_ifunc (__mpn_add_n,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __mpn_add_n_vis3
+ : __mpn_add_n_generic)
diff --git a/sysdeps/sparc/sparc64/multiarch/addmul_1-generic.S b/sysdeps/sparc/sparc64/multiarch/addmul_1-generic.S
new file mode 100644
index 0000000000..5bf1da7fde
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/addmul_1-generic.S
@@ -0,0 +1,2 @@
+#define __mpn_addmul_1 __mpn_addmul_1_generic
+#include <sysdeps/sparc/sparc64/addmul_1.S>
diff --git a/sysdeps/sparc/sparc64/multiarch/addmul_1-vis3.S b/sysdeps/sparc/sparc64/multiarch/addmul_1-vis3.S
index 9a2f6acd9c..b5e808bddd 100644
--- a/sysdeps/sparc/sparc64/multiarch/addmul_1-vis3.S
+++ b/sysdeps/sparc/sparc64/multiarch/addmul_1-vis3.S
@@ -1,7 +1,7 @@
! SPARC v9 64-bit VIS3 __mpn_addmul_1 -- Multiply a limb vector with a
! limb and add the result to a second limb vector.
!
-! Copyright (C) 2013-2016 Free Software Foundation, Inc.
+! Copyright (C) 2013-2018 Free Software Foundation, Inc.
! This file is part of the GNU C Library.
! Contributed by David S. Miller <davem@davemloft.net>
!
diff --git a/sysdeps/sparc/sparc64/multiarch/addmul_1.S b/sysdeps/sparc/sparc64/multiarch/addmul_1.S
deleted file mode 100644
index 4763edd457..0000000000
--- a/sysdeps/sparc/sparc64/multiarch/addmul_1.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Multiple versions of addmul_1
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- Contributed by David S. Miller (davem@davemloft.net)
- 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>
-
-ENTRY(__mpn_addmul_1)
- .type __mpn_addmul_1, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_VIS3, %o1
- andcc %o0, %o1, %g0
- be 1f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__mpn_addmul_1_vis3), %o1
- xor %o1, %gdop_lox10(__mpn_addmul_1_vis3), %o1
-# else
- set __mpn_addmul_1_vis3, %o1
-# endif
- ba 10f
- nop
-1:
-# ifdef SHARED
- sethi %gdop_hix22(__mpn_addmul_1_generic), %o1
- xor %o1, %gdop_lox10(__mpn_addmul_1_generic), %o1
-# else
- set __mpn_addmul_1_generic, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(__mpn_addmul_1)
-
-#define __mpn_addmul_1 __mpn_addmul_1_generic
-#include "../addmul_1.S"
diff --git a/sysdeps/sparc/sparc64/multiarch/addmul_1.c b/sysdeps/sparc/sparc64/multiarch/addmul_1.c
new file mode 100644
index 0000000000..afaeca870d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/addmul_1.c
@@ -0,0 +1,28 @@
+/* __mpn_addmul_1 ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <gmp.h>
+#include <sparc-ifunc.h>
+
+extern __typeof (mpn_addmul_1) __mpn_addmul_1_vis3 attribute_hidden;
+extern __typeof (mpn_addmul_1) __mpn_addmul_1_generic attribute_hidden;
+
+sparc_libm_ifunc (__mpn_addmul_1,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __mpn_addmul_1_vis3
+ : __mpn_addmul_1_generic)
diff --git a/sysdeps/sparc/sparc64/multiarch/bzero.c b/sysdeps/sparc/sparc64/multiarch/bzero.c
new file mode 100644
index 0000000000..3af2ff3d47
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/bzero.c
@@ -0,0 +1,33 @@
+/* Multiple versions of bzero. SPARC64/Linux version.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define bzero __redirect_bzero
+# include <string.h>
+# undef bzero
+
+# include <sparc-ifunc.h>
+
+# define SYMBOL_NAME bzero
+# include "ifunc-memset.h"
+
+sparc_libc_ifunc_redirected (__redirect_bzero, __bzero, IFUNC_SELECTOR)
+weak_alias (__bzero, bzero)
+
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c b/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
index e52eeb0650..91c6565c7a 100644
--- a/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
@@ -1,5 +1,5 @@
/* Enumerate available IFUNC implementations of a function. sparc version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,6 +36,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
hwcap = GLRO(dl_hwcap);
IFUNC_IMPL (i, name, memcpy,
+ IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_SPARC_ADP,
+ __memcpy_niagara7)
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_SPARC_CRYPTO,
__memcpy_niagara4)
IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_SPARC_N2,
@@ -47,6 +49,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ultra1));
IFUNC_IMPL (i, name, mempcpy,
+ IFUNC_IMPL_ADD (array, i, mempcpy, hwcap & HWCAP_SPARC_ADP,
+ __mempcpy_niagara7)
IFUNC_IMPL_ADD (array, i, mempcpy, hwcap & HWCAP_SPARC_CRYPTO,
__mempcpy_niagara4)
IFUNC_IMPL_ADD (array, i, mempcpy, hwcap & HWCAP_SPARC_N2,
@@ -58,6 +62,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_ultra1));
IFUNC_IMPL (i, name, bzero,
+ IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_ADP,
+ __bzero_niagara7)
IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_CRYPTO,
__bzero_niagara4)
IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_BLKINIT,
@@ -65,11 +71,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ultra1));
IFUNC_IMPL (i, name, memset,
+ IFUNC_IMPL_ADD (array, i, memset, hwcap & HWCAP_SPARC_ADP,
+ __memset_niagara7)
IFUNC_IMPL_ADD (array, i, memset, hwcap & HWCAP_SPARC_CRYPTO,
__memset_niagara4)
IFUNC_IMPL_ADD (array, i, memset, hwcap & HWCAP_SPARC_BLKINIT,
__memset_niagara1)
IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ultra1));
+ IFUNC_IMPL (i, name, memmove,
+ IFUNC_IMPL_ADD (array, i, memmove, hwcap & HWCAP_SPARC_ADP,
+ __memmove_niagara7)
+ IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_ultra1));
+
return i;
}
diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h
new file mode 100644
index 0000000000..73ea15297a
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h
@@ -0,0 +1,43 @@
+/* Common definition for memcpy and mempcpy implementation.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <ifunc-init.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara7) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara4) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara1) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra1) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (int hwcap)
+{
+ if (hwcap & HWCAP_SPARC_ADP)
+ return OPTIMIZE (niagara7);
+ if (hwcap & HWCAP_SPARC_CRYPTO)
+ return OPTIMIZE (niagara4);
+ if (hwcap & HWCAP_SPARC_N2)
+ return OPTIMIZE (niagara2);
+ if (hwcap & HWCAP_SPARC_BLKINIT)
+ return OPTIMIZE (niagara1);
+ if (hwcap & HWCAP_SPARC_ULTRA3)
+ return OPTIMIZE (ultra3);
+ return OPTIMIZE (ultra1);
+}
diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memmove.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memmove.h
new file mode 100644
index 0000000000..4b89ff4baf
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memmove.h
@@ -0,0 +1,31 @@
+/* Common definition for memmove implementation.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <ifunc-init.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara7) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra1) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (int hwcap)
+{
+ if (hwcap & HWCAP_SPARC_ADP)
+ return OPTIMIZE (niagara7);
+ return OPTIMIZE (ultra1);
+}
diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h
new file mode 100644
index 0000000000..d554638bd6
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h
@@ -0,0 +1,37 @@
+/* Common definition for memset/bzero implementation.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <ifunc-init.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara7) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara4) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara1) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra1) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (int hwcap)
+{
+ if (hwcap & HWCAP_SPARC_ADP)
+ return OPTIMIZE (niagara7);
+ if (hwcap & HWCAP_SPARC_CRYPTO)
+ return OPTIMIZE (niagara4);
+ if (hwcap & HWCAP_SPARC_BLKINIT)
+ return OPTIMIZE (niagara1);
+ return OPTIMIZE (ultra1);
+}
diff --git a/sysdeps/sparc/sparc64/multiarch/md5-crop.S b/sysdeps/sparc/sparc64/multiarch/md5-crop.S
index de1ba6df2f..764a8aae48 100644
--- a/sysdeps/sparc/sparc64/multiarch/md5-crop.S
+++ b/sysdeps/sparc/sparc64/multiarch/md5-crop.S
@@ -1,5 +1,5 @@
/* MD5 using sparc crypto opcodes.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@davemloft.net)
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-memmove-niagara7.S b/sysdeps/sparc/sparc64/multiarch/memcpy-memmove-niagara7.S
new file mode 100644
index 0000000000..61ba1ed408
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-memmove-niagara7.S
@@ -0,0 +1,980 @@
+/* Copy SIZE bytes from SRC to DEST. For SUN4V M7.
+ Copyright (C) 2017-2018 Free Software 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>
+
+#ifndef XCC
+# define XCC xcc
+#endif
+ .register %g2,#scratch
+ .register %g3,#scratch
+ .register %g6,#scratch
+
+#define FPRS_FEF 0x04
+
+/*
+ * ASI_STBI_P marks the cache line as "least recently used"
+ * which means if many threads are active, it has a high chance
+ * of being pushed out of the cache between the first initializing
+ * store and the final stores.
+ * Thus, in this algorithm we use ASI_STBIMRU_P which marks the
+ * cache line as "most recently used" for all but the last cache
+ * line.
+ */
+
+#define ASI_BLK_INIT_QUAD_LDD_P 0xe2
+#define ASI_ST_BLK_INIT_MRU_P 0xf2
+
+#define ASI_STBI_P ASI_BLK_INIT_QUAD_LDD_P
+#define ASI_STBIMRU_P ASI_ST_BLK_INIT_MRU_P
+
+#define BLOCK_SIZE 64 /* L2 data cache line size */
+#define SHORTCOPY 3
+#define SHORTCHECK 14
+#define SHORT_LONG 64 /* max copy for short longword-aligned case */
+ /* must be at least 64 */
+#define SMALL_MAX 255 /* max small copy for word/long aligned */
+#define SMALL_UMAX 128 /* max small copy for unaligned case */
+#define MED_WMAX 1023 /* max copy for medium word-aligned case */
+#define MED_MAX 511 /* max copy for medium longword-aligned case */
+#define ST_CHUNK 20 /* ST_CHUNK - block of values for BIS Store */
+/* on T4, prefetch 20 is a strong read prefetch to L1 and L2 data cache
+ * prefetch 20 can cause inst pipeline to delay if data is in memory
+ * prefetch 21 is a strong read prefetch to L2 data cache, not L1 data cache */
+#define ALIGN_PRE 20 /* distance for aligned prefetch loop */
+
+#define EX_ST(x) x
+#define EX_RETVAL(x) x
+#define STORE_ASI(src,addr) stxa src, [addr] ASI_STBIMRU_P
+#define STORE_INIT(src,addr) stxa src, [addr] ASI_STBI_P
+
+#if IS_IN (libc)
+
+ .text
+
+ENTRY(__memmove_niagara7)
+ /* %o0=dst, %o1=src, %o2=len */
+ cmp %o1, %o0 /* if from address is >= to use forward copy */
+ bgeu,pn %XCC, .Lforcpy /* else use backward if ... */
+ sub %o0, %o1, %o4 /* get difference of two addresses */
+ cmp %o2, %o4 /* compare size and difference of addresses */
+ bleu,pn %XCC, .Lforcpy /* if size is bigger, do overlapped copy */
+ add %o1, %o2, %o5 /* get to end of source space */
+
+/* an overlapped copy that must be done "backwards" */
+.Lchksize:
+ cmp %o2, 8 /* less than 8 byte do byte copy */
+ blu,pn %XCC, 2f /* else continue */
+
+/* Now size is bigger than 8 */
+.Ldbalign:
+ add %o0, %o2, %g1 /* get to end of dest space */
+ andcc %g1, 7, %o3 /* %o3 has cnt til dst 8 byte align */
+ bz,a,pn %XCC, .Ldbbck /* skip if dst is 8 byte aligned */
+ andn %o2, 7, %o3 /* force %o3 cnt to multiple of 8 */
+ sub %o2, %o3, %o2 /* update o2 with new count */
+
+1: dec %o5 /* decrement source */
+ ldub [%o5], %g1 /* load one byte */
+ deccc %o3 /* decrement count */
+ bgu,pt %XCC, 1b /* if not done keep copying */
+ stb %g1, [%o5+%o4] /* store one byte into dest */
+ andncc %o2, 7, %o3 /* force %o3 cnt to multiple of 8 */
+ bz,pn %XCC, 2f /* if size < 8, move to byte copy */
+
+/* Now Destination is 8 byte aligned */
+.Ldbbck:
+ andcc %o5, 7, %o0 /* %o0 has src offset */
+ bz,a,pn %XCC, .Ldbcopybc /* if src is aligned do fast memmove */
+ sub %o2, %o3, %o2 /* Residue bytes in %o2 */
+
+.Lcpy_dbwdbc: /* alignment of src is needed */
+ sub %o2, 8, %o2 /* set size one loop ahead */
+ sll %o0, 3, %g1 /* %g1 is left shift */
+ mov 64, %g5 /* init %g5 to be 64 */
+ sub %g5, %g1, %g5 /* %g5 rightshift = (64 - leftshift) */
+ sub %o5, %o0, %o5 /* align the src at 8 bytes. */
+ add %o4, %o0, %o4 /* increase diff between src & dst */
+ ldx [%o5], %o1 /* load first 8 bytes */
+ srlx %o1, %g5, %o1
+1: sub %o5, 8, %o5 /* subtract 8 from src */
+ ldx [%o5], %o0 /* load 8 byte */
+ sllx %o0, %g1, %o3 /* shift loaded val left to tmp reg */
+ or %o1, %o3, %o3 /* align data */
+ stx %o3, [%o5+%o4] /* store 8 byte */
+ subcc %o2, 8, %o2 /* subtract 8 byte from size */
+ bg,pt %XCC, 1b /* if size > 0 continue */
+ srlx %o0, %g5, %o1 /* move extra byte for the next use */
+
+ srl %g1, 3, %o0 /* restore %o0 value for alignment */
+ add %o5, %o0, %o5 /* restore src alignment */
+ sub %o4, %o0, %o4 /* restore diff between src & dest */
+
+ ba 2f /* branch to the trailing byte copy */
+ add %o2, 8, %o2 /* restore size value */
+
+.Ldbcopybc: /* alignment of src is not needed */
+1: sub %o5, 8, %o5 /* subtract from src */
+ ldx [%o5], %g1 /* load 8 bytes */
+ subcc %o3, 8, %o3 /* subtract from size */
+ bgu,pt %XCC, 1b /* if size is bigger 0 continue */
+ stx %g1, [%o5+%o4] /* store 8 bytes to destination */
+
+ ba 2f
+ nop
+
+.Lbcbyte:
+1: ldub [%o5], %g1 /* load one byte */
+ stb %g1, [%o5+%o4] /* store one byte */
+2: deccc %o2 /* decrement size */
+ bgeu,a,pt %XCC, 1b /* if size is >= 0 continue */
+ dec %o5 /* decrement from address */
+
+.Lexitbc: /* exit from backward copy */
+ retl
+ add %o5, %o4, %o0 /* restore dest addr */
+
+
+/* Check to see if memmove is large aligned copy
+ * If so, use special version of copy that avoids
+ * use of block store init. */
+.Lforcpy:
+ cmp %o2, SMALL_MAX /* check for not small case */
+ blt,pn %XCC, .Lmv_short /* merge with memcpy */
+ mov %o0, %g1 /* save %o0 */
+ neg %o0, %o5
+ andcc %o5, 7, %o5 /* bytes till DST 8 byte aligned */
+ brz,pt %o5, .Lmv_dst_aligned_on_8
+
+/* %o5 has the bytes to be written in partial store. */
+ sub %o2, %o5, %o2
+ sub %o1, %o0, %o1 /* %o1 gets the difference */
+7: /* dst aligning loop */
+ ldub [%o1+%o0], %o4 /* load one byte */
+ subcc %o5, 1, %o5
+ stb %o4, [%o0]
+ bgu,pt %XCC, 7b
+ add %o0, 1, %o0 /* advance dst */
+ add %o1, %o0, %o1 /* restore %o1 */
+.Lmv_dst_aligned_on_8:
+ andcc %o1, 7, %o5
+ brnz,pn %o5, .Lsrc_dst_unaligned_on_8
+ prefetch [%o1 + (1 * BLOCK_SIZE)], 20
+
+.Lmv_src_dst_aligned_on_8:
+/* check if we are copying MED_MAX or more bytes */
+ cmp %o2, MED_MAX /* limit to store buffer size */
+ bleu,pt %XCC, .Lmedlong
+ prefetch [%o1 + (2 * BLOCK_SIZE)], 20
+
+/* The mv_align loop below mimics the memcpy code for large aligned copies,
+ * but does not use the ASI_STBI_P (block initializing store) performance
+ * optimization. This is used when memcpy is incorrectly invoked with
+ * overlapping buffers. */
+
+.Lmv_large_align8_copy: /* Src and dst share 8 byte align */
+ /* align dst to 64 byte boundary */
+ andcc %o0, 0x3f, %o3 /* check for dst 64 byte aligned */
+ brz,pn %o3, .Lmv_aligned_on_64
+ sub %o3, 64, %o3 /* %o3 has negative bytes to move */
+ add %o2, %o3, %o2 /* adjust remaining count */
+.Lmv_align_to_64:
+ ldx [%o1], %o4
+ add %o1, 8, %o1 /* increment src ptr */
+ addcc %o3, 8, %o3
+ stx %o4, [%o0]
+ brnz,pt %o3, .Lmv_align_to_64
+ add %o0, 8, %o0 /* increment dst ptr */
+
+.Lmv_aligned_on_64:
+ andn %o2, 0x3f, %o5 /* %o5 is multiple of block size */
+ and %o2, 0x3f, %o2 /* residue bytes in %o2 */
+.Lmv_align_loop:
+ ldx [%o1],%o4
+ stx %o4,[%o0]
+ prefetch [%o0 + (10 * BLOCK_SIZE)], 22
+ prefetch [%o1 + (10 * BLOCK_SIZE)], 21
+ subcc %o5, 64, %o5
+ ldx [%o1+8],%o4
+ stx %o4,[%o0+8]
+ ldx [%o1+16],%o4
+ stx %o4,[%o0+16]
+ ldx [%o1+24],%o4
+ stx %o4,[%o0+24]
+ ldx [%o1+32],%o4
+ stx %o4,[%o0+32]
+ ldx [%o1+40],%o4
+ stx %o4,[%o0+40]
+ ldx [%o1+48],%o4
+ add %o1, 64, %o1
+ stx %o4,[%o0+48]
+ add %o0, 64, %o0
+ ldx [%o1-8],%o4
+ bgt,pt %XCC, .Lmv_align_loop
+ stx %o4,[%o0-8]
+
+ ba .Lmedlong
+ nop
+END(__memmove_niagara7)
+
+ENTRY(__mempcpy_niagara7)
+ /* %o0=dst, %o1=src, %o2=len */
+ ba,pt %icc, 101f
+ add %o0, %o2, %g1 /* save dst + len */
+END(__mempcpy_niagara7)
+
+ .align 32
+ENTRY(__memcpy_niagara7)
+100: /* %o0=dst, %o1=src, %o2=len */
+ mov %o0, %g1 /* save %o0 */
+101:
+#ifndef __arch64__
+ srl %o2, 0, %o2
+#endif
+ cmp %o2, SMALL_MAX /* check for not small case */
+ bgeu,pn %XCC, .Lmedium /* go to larger cases */
+.Lmv_short:
+ cmp %o2, SHORTCOPY /* check for really short case */
+ ble,pn %XCC, .Lsmallfin
+ or %o0, %o1, %o4 /* prepare alignment check */
+ andcc %o4, 0x3, %o5 /* test for word alignment */
+ bnz,pn %XCC, .Lsmallunalign /* branch to non-word aligned case */
+ nop
+ subcc %o2, 7, %o2 /* adjust count */
+ ble,pn %XCC, .Lsmallwordx
+ andcc %o4, 0x7, %o5 /* test for long alignment */
+/* 8 or more bytes, src and dest start on word boundary
+ * %o4 contains or %o0, %o1 */
+.Lsmalllong:
+ bnz,pn %XCC, .Lsmallwords /* branch to word aligned case */
+ cmp %o2, SHORT_LONG-7
+ bge,a %XCC, .Lmedl64 /* if we branch */
+ sub %o2,56,%o2 /* adjust %o2 to -63 off count */
+
+/* slightly unroll the small_long_loop to improve very short copies */
+ cmp %o2, 32-7
+ blt,a,pn %XCC, .Lsmall_long_l
+ sub %o1, %o0, %o1 /* %o1 gets the difference */
+
+ ldx [%o1], %o5
+ ldx [%o1+8], %o4
+ ldx [%o1+16], %o3
+
+ subcc %o2, 24, %o2
+ sub %o1, %o0, %o1 /* %o1 gets the difference */
+
+ stx %o5, [%o0] /* write word */
+ stx %o4, [%o0+8] /* write word */
+ stx %o3, [%o0+16] /* write word */
+
+ add %o0, 24, %o0
+
+/* end loop unroll */
+
+.Lsmall_long_l:
+ ldx [%o1+%o0], %o3
+ subcc %o2, 8, %o2
+ add %o0, 8, %o0
+ bgu,pn %XCC, .Lsmall_long_l /* loop until done */
+ stx %o3, [%o0-8] /* write word */
+ addcc %o2, 7, %o2 /* restore %o2 to correct count */
+ bnz,pn %XCC, .Lsmall_long_x /* check for completion */
+ add %o1, %o0, %o1 /* restore %o1 */
+ retl
+ mov EX_RETVAL(%g1), %o0 /* restore %o0 */
+.Lsmall_long_x:
+ cmp %o2, 4 /* check for 4 or more bytes left */
+ blt,pn %XCC, .Lsmallleft3 /* if not, go to finish up */
+ nop
+ lduw [%o1], %o3
+ add %o1, 4, %o1
+ subcc %o2, 4, %o2
+ stw %o3, [%o0]
+ bnz,pn %XCC, .Lsmallleft3
+ add %o0, 4, %o0
+ retl
+ mov EX_RETVAL(%g1), %o0 /* restore %o0 */
+
+ .align 32
+/* src and dest start on word boundary; 7 or fewer bytes */
+.Lsmallwordx:
+ lduw [%o1], %o3 /* read word */
+ addcc %o2, 3, %o2 /* restore count */
+ bz,pt %XCC, .Lsmallexit
+ stw %o3, [%o0] /* write word */
+ deccc %o2 /* reduce count for cc test */
+ ldub [%o1+4], %o3 /* load one byte */
+ bz,pt %XCC, .Lsmallexit
+ stb %o3, [%o0+4] /* store one byte */
+ ldub [%o1+5], %o3 /* load second byte */
+ deccc %o2
+ bz,pt %XCC, .Lsmallexit
+ stb %o3, [%o0+5] /* store second byte */
+ ldub [%o1+6], %o3 /* load third byte */
+ stb %o3, [%o0+6] /* store third byte */
+.Lsmallexit:
+ retl
+ mov EX_RETVAL(%g1), %o0 /* restore %o0 */
+
+ .align 32
+.Lsmallunalign:
+ cmp %o2, SHORTCHECK
+ ble,pn %XCC, .Lsmallrest
+ cmp %o2, SMALL_UMAX
+ bge,pt %XCC, .Lmedium_join
+ andcc %o1, 0x3, %o5 /* is src word aligned */
+ bz,pn %XCC, .Laldst
+ cmp %o5, 2 /* is src half-word aligned */
+ be,pt %XCC, .Ls2algn
+ cmp %o5, 3 /* src is byte aligned */
+.Ls1algn:
+ ldub [%o1], %o3 /* move 1 or 3 bytes to align it */
+ inc 1, %o1
+ stb %o3, [%o0] /* move a byte to align src */
+ inc 1, %o0
+ bne,pt %XCC, .Ls2algn
+ dec %o2
+ b .Lald /* now go align dest */
+ andcc %o0, 0x3, %o5
+
+.Ls2algn:
+ lduh [%o1], %o3 /* know src is 2 byte aligned */
+ inc 2, %o1
+ srl %o3, 8, %o4
+ stb %o4, [%o0] /* have to do bytes, */
+ stb %o3, [%o0 + 1] /* do not know dst alignment */
+ inc 2, %o0
+ dec 2, %o2
+
+.Laldst:
+ andcc %o0, 0x3, %o5 /* align the destination address */
+.Lald:
+ bz,pn %XCC, .Lw4cp
+ cmp %o5, 2
+ be,pn %XCC, .Lw2cp
+ cmp %o5, 3
+.Lw3cp: lduw [%o1], %o4
+ inc 4, %o1
+ srl %o4, 24, %o5
+ stb %o5, [%o0]
+ bne,pt %XCC, .Lw1cp
+ inc %o0
+ dec 1, %o2
+ andn %o2, 3, %o3 /* %o3 is aligned word count */
+ dec 4, %o3 /* avoid reading beyond tail of src */
+ sub %o1, %o0, %o1 /* %o1 gets the difference */
+
+1: sll %o4, 8, %g5 /* save residual bytes */
+ lduw [%o1+%o0], %o4
+ deccc 4, %o3
+ srl %o4, 24, %o5 /* merge with residual */
+ or %o5, %g5, %g5
+ st %g5, [%o0]
+ bnz,pt %XCC, 1b
+ inc 4, %o0
+ sub %o1, 3, %o1 /* used one byte of last word read */
+ and %o2, 3, %o2
+ b 7f
+ inc 4, %o2
+
+.Lw1cp: srl %o4, 8, %o5
+ sth %o5, [%o0]
+ inc 2, %o0
+ dec 3, %o2
+ andn %o2, 3, %o3 /* %o3 is aligned word count */
+ dec 4, %o3 /* avoid reading beyond tail of src */
+ sub %o1, %o0, %o1 /* %o1 gets the difference */
+
+2: sll %o4, 24, %g5 /* save residual bytes */
+ lduw [%o1+%o0], %o4
+ deccc 4, %o3
+ srl %o4, 8, %o5 /* merge with residual */
+ or %o5, %g5, %g5
+ st %g5, [%o0]
+ bnz,pt %XCC, 2b
+ inc 4, %o0
+ sub %o1, 1, %o1 /* used 3 bytes of last word read */
+ and %o2, 3, %o2
+ b 7f
+ inc 4, %o2
+
+.Lw2cp: lduw [%o1], %o4
+ inc 4, %o1
+ srl %o4, 16, %o5
+ sth %o5, [%o0]
+ inc 2, %o0
+ dec 2, %o2
+ andn %o2, 3, %o3 /* %o3 is aligned word count */
+ dec 4, %o3 /* avoid reading beyond tail of src */
+ sub %o1, %o0, %o1 /* %o1 gets the difference */
+
+3: sll %o4, 16, %g5 /* save residual bytes */
+ lduw [%o1+%o0], %o4
+ deccc 4, %o3
+ srl %o4, 16, %o5 /* merge with residual */
+ or %o5, %g5, %g5
+ st %g5, [%o0]
+ bnz,pt %XCC, 3b
+ inc 4, %o0
+ sub %o1, 2, %o1 /* used two bytes of last word read */
+ and %o2, 3, %o2
+ b 7f
+ inc 4, %o2
+
+.Lw4cp: andn %o2, 3, %o3 /* %o3 is aligned word count */
+ sub %o1, %o0, %o1 /* %o1 gets the difference */
+
+1: lduw [%o1+%o0], %o4 /* read from address */
+ deccc 4, %o3 /* decrement count */
+ st %o4, [%o0] /* write at destination address */
+ bgu,pt %XCC, 1b
+ inc 4, %o0 /* increment to address */
+ and %o2, 3, %o2 /* number of leftover bytes, if any */
+
+ /* simple finish up byte copy, works with any alignment */
+7:
+ add %o1, %o0, %o1 /* restore %o1 */
+.Lsmallrest:
+ tst %o2
+ bz,pt %XCC, .Lsmallx
+ cmp %o2, 4
+ blt,pn %XCC, .Lsmallleft3
+ nop
+ sub %o2, 3, %o2
+.Lsmallnotalign4:
+ ldub [%o1], %o3 /* read byte */
+ subcc %o2, 4, %o2 /* reduce count by 4 */
+ stb %o3, [%o0] /* write byte */
+ ldub [%o1+1], %o3 /* repeat for total of 4 bytes */
+ add %o1, 4, %o1 /* advance SRC by 4 */
+ stb %o3, [%o0+1]
+ ldub [%o1-2], %o3
+ add %o0, 4, %o0 /* advance DST by 4 */
+ stb %o3, [%o0-2]
+ ldub [%o1-1], %o3
+ bgu,pt %XCC, .Lsmallnotalign4 /* loop til 3 or fewer bytes remain */
+ stb %o3, [%o0-1]
+ addcc %o2, 3, %o2 /* restore count */
+ bz,pt %XCC, .Lsmallx
+.Lsmallleft3: /* 1, 2, or 3 bytes remain */
+ subcc %o2, 1, %o2
+ ldub [%o1], %o3 /* load one byte */
+ bz,pt %XCC, .Lsmallx
+ stb %o3, [%o0] /* store one byte */
+ ldub [%o1+1], %o3 /* load second byte */
+ subcc %o2, 1, %o2
+ bz,pt %XCC, .Lsmallx
+ stb %o3, [%o0+1] /* store second byte */
+ ldub [%o1+2], %o3 /* load third byte */
+ stb %o3, [%o0+2] /* store third byte */
+.Lsmallx:
+ retl
+ mov EX_RETVAL(%g1), %o0 /* restore %o0 */
+
+.Lsmallfin:
+ tst %o2
+ bnz,pn %XCC, .Lsmallleft3
+ nop
+ retl
+ mov EX_RETVAL(%g1), %o0 /* restore %o0 */
+
+ .align 16
+.Lsmallwords:
+ lduw [%o1], %o3 /* read word */
+ subcc %o2, 8, %o2 /* update count */
+ stw %o3, [%o0] /* write word */
+ add %o1, 8, %o1 /* update SRC */
+ lduw [%o1-4], %o3 /* read word */
+ add %o0, 8, %o0 /* update DST */
+ bgu,pt %XCC, .Lsmallwords /* loop until done */
+ stw %o3, [%o0-4] /* write word */
+ addcc %o2, 7, %o2 /* restore count */
+ bz,pt %XCC, .Lsmallexit /* check for completion */
+ cmp %o2, 4 /* check for 4 or more bytes left */
+ blt,pt %XCC, .Lsmallleft3 /* if not, go to finish up */
+ nop
+ lduw [%o1], %o3
+ add %o1, 4, %o1
+ subcc %o2, 4, %o2
+ add %o0, 4, %o0
+ bnz,pn %XCC, .Lsmallleft3
+ stw %o3, [%o0-4]
+ retl
+ mov EX_RETVAL(%g1), %o0 /* restore %o0 */
+
+ .align 16
+.Lmedium:
+.Lmedium_join:
+ neg %o0, %o5
+ andcc %o5, 7, %o5 /* bytes till DST 8 byte aligned */
+ brz,pt %o5, .Ldst_aligned_on_8
+
+ /* %o5 has the bytes to be written in partial store. */
+ sub %o2, %o5, %o2
+ sub %o1, %o0, %o1 /* %o1 gets the difference */
+7: /* dst aligning loop */
+ ldub [%o1+%o0], %o4 /* load one byte */
+ subcc %o5, 1, %o5
+ stb %o4, [%o0]
+ bgu,pt %XCC, 7b
+ add %o0, 1, %o0 /* advance dst */
+ add %o1, %o0, %o1 /* restore %o1 */
+.Ldst_aligned_on_8:
+ andcc %o1, 7, %o5
+ brnz,pt %o5, .Lsrc_dst_unaligned_on_8
+ nop
+
+.Lsrc_dst_aligned_on_8:
+ /* check if we are copying MED_MAX or more bytes */
+ cmp %o2, MED_MAX /* limit to store buffer size */
+ bgu,pn %XCC, .Llarge_align8_copy
+ nop
+/*
+ * Special case for handling when src and dest are both long word aligned
+ * and total data to move is less than MED_MAX bytes
+ */
+.Lmedlong:
+ subcc %o2, 63, %o2 /* adjust length to allow cc test */
+ ble,pn %XCC, .Lmedl63 /* skip big loop if < 64 bytes */
+ nop
+.Lmedl64:
+ ldx [%o1], %o4 /* load */
+ subcc %o2, 64, %o2 /* decrement length count */
+ stx %o4, [%o0] /* and store */
+ ldx [%o1+8], %o3 /* a block of 64 bytes */
+ stx %o3, [%o0+8]
+ ldx [%o1+16], %o4
+ stx %o4, [%o0+16]
+ ldx [%o1+24], %o3
+ stx %o3, [%o0+24]
+ ldx [%o1+32], %o4 /* load */
+ stx %o4, [%o0+32] /* and store */
+ ldx [%o1+40], %o3 /* a block of 64 bytes */
+ add %o1, 64, %o1 /* increase src ptr by 64 */
+ stx %o3, [%o0+40]
+ ldx [%o1-16], %o4
+ add %o0, 64, %o0 /* increase dst ptr by 64 */
+ stx %o4, [%o0-16]
+ ldx [%o1-8], %o3
+ bgu,pt %XCC, .Lmedl64 /* repeat if at least 64 bytes left */
+ stx %o3, [%o0-8]
+.Lmedl63:
+ addcc %o2, 32, %o2 /* adjust remaining count */
+ ble,pt %XCC, .Lmedl31 /* to skip if 31 or fewer bytes left */
+ nop
+ ldx [%o1], %o4 /* load */
+ sub %o2, 32, %o2 /* decrement length count */
+ stx %o4, [%o0] /* and store */
+ ldx [%o1+8], %o3 /* a block of 32 bytes */
+ add %o1, 32, %o1 /* increase src ptr by 32 */
+ stx %o3, [%o0+8]
+ ldx [%o1-16], %o4
+ add %o0, 32, %o0 /* increase dst ptr by 32 */
+ stx %o4, [%o0-16]
+ ldx [%o1-8], %o3
+ stx %o3, [%o0-8]
+.Lmedl31:
+ addcc %o2, 16, %o2 /* adjust remaining count */
+ ble,pt %XCC, .Lmedl15 /* skip if 15 or fewer bytes left */
+ nop
+ ldx [%o1], %o4 /* load and store 16 bytes */
+ add %o1, 16, %o1 /* increase src ptr by 16 */
+ stx %o4, [%o0]
+ sub %o2, 16, %o2 /* decrease count by 16 */
+ ldx [%o1-8], %o3
+ add %o0, 16, %o0 /* increase dst ptr by 16 */
+ stx %o3, [%o0-8]
+.Lmedl15:
+ addcc %o2, 15, %o2 /* restore count */
+ bz,pt %XCC, .Lsmallexit /* exit if finished */
+ cmp %o2, 8
+ blt,pt %XCC, .Lmedw7 /* skip if 7 or fewer bytes left */
+ tst %o2
+ ldx [%o1], %o4 /* load 8 bytes */
+ add %o1, 8, %o1 /* increase src ptr by 8 */
+ add %o0, 8, %o0 /* increase dst ptr by 8 */
+ subcc %o2, 8, %o2 /* decrease count by 8 */
+ bnz,pn %XCC, .Lmedw7
+ stx %o4, [%o0-8] /* and store 8 bytes */
+ retl
+ mov EX_RETVAL(%g1), %o0 /* restore %o0 */
+
+ .align 16
+.Lsrc_dst_unaligned_on_8:
+ /* DST is 8-byte aligned, src is not */
+ andcc %o1, 0x3, %o5 /* test word alignment */
+ bnz,pt %XCC, .Lunalignsetup /* branch if not word aligned */
+ nop
+
+/*
+ * Handle all cases where src and dest are aligned on word
+ * boundaries. Use unrolled loops for better performance.
+ * This option wins over standard large data move when
+ * source and destination is in cache for medium
+ * to short data moves.
+ */
+ cmp %o2, MED_WMAX /* limit to store buffer size */
+ bge,pt %XCC, .Lunalignrejoin /* otherwise rejoin main loop */
+ nop
+
+ subcc %o2, 31, %o2 /* adjust length to allow cc test */
+ /* for end of loop */
+ ble,pt %XCC, .Lmedw31 /* skip big loop if less than 16 */
+.Lmedw32:
+ ld [%o1], %o4 /* move a block of 32 bytes */
+ sllx %o4, 32, %o5
+ ld [%o1+4], %o4
+ or %o4, %o5, %o5
+ stx %o5, [%o0]
+ subcc %o2, 32, %o2 /* decrement length count */
+ ld [%o1+8], %o4
+ sllx %o4, 32, %o5
+ ld [%o1+12], %o4
+ or %o4, %o5, %o5
+ stx %o5, [%o0+8]
+ add %o1, 32, %o1 /* increase src ptr by 32 */
+ ld [%o1-16], %o4
+ sllx %o4, 32, %o5
+ ld [%o1-12], %o4
+ or %o4, %o5, %o5
+ stx %o5, [%o0+16]
+ add %o0, 32, %o0 /* increase dst ptr by 32 */
+ ld [%o1-8], %o4
+ sllx %o4, 32, %o5
+ ld [%o1-4], %o4
+ or %o4, %o5, %o5
+ bgu,pt %XCC, .Lmedw32 /* repeat if at least 32 bytes left */
+ stx %o5, [%o0-8]
+.Lmedw31:
+ addcc %o2, 31, %o2 /* restore count */
+ bz,pt %XCC, .Lsmallexit /* exit if finished */
+ cmp %o2, 16
+ blt,pt %XCC, .Lmedw15
+ nop
+ ld [%o1], %o4 /* move a block of 16 bytes */
+ sllx %o4, 32, %o5
+ subcc %o2, 16, %o2 /* decrement length count */
+ ld [%o1+4], %o4
+ or %o4, %o5, %o5
+ stx %o5, [%o0]
+ add %o1, 16, %o1 /* increase src ptr by 16 */
+ ld [%o1-8], %o4
+ add %o0, 16, %o0 /* increase dst ptr by 16 */
+ sllx %o4, 32, %o5
+ ld [%o1-4], %o4
+ or %o4, %o5, %o5
+ stx %o5, [%o0-8]
+.Lmedw15:
+ bz,pt %XCC, .Lsmallexit /* exit if finished */
+ cmp %o2, 8
+ blt,pn %XCC, .Lmedw7 /* skip if 7 or fewer bytes left */
+ tst %o2
+ ld [%o1], %o4 /* load 4 bytes */
+ subcc %o2, 8, %o2 /* decrease count by 8 */
+ stw %o4, [%o0] /* and store 4 bytes */
+ add %o1, 8, %o1 /* increase src ptr by 8 */
+ ld [%o1-4], %o3 /* load 4 bytes */
+ add %o0, 8, %o0 /* increase dst ptr by 8 */
+ stw %o3, [%o0-4] /* and store 4 bytes */
+ bz,pt %XCC, .Lsmallexit /* exit if finished */
+.Lmedw7: /* count is ge 1, less than 8 */
+ cmp %o2, 4 /* check for 4 bytes left */
+ blt,pn %XCC, .Lsmallleft3 /* skip if 3 or fewer bytes left */
+ nop
+ ld [%o1], %o4 /* load 4 bytes */
+ add %o1, 4, %o1 /* increase src ptr by 4 */
+ add %o0, 4, %o0 /* increase dst ptr by 4 */
+ subcc %o2, 4, %o2 /* decrease count by 4 */
+ bnz,pt %XCC, .Lsmallleft3
+ stw %o4, [%o0-4] /* and store 4 bytes */
+ retl
+ mov EX_RETVAL(%g1), %o0 /* restore %o0 */
+
+ .align 16
+.Llarge_align8_copy: /* Src and dst 8 byte aligned */
+ /* align dst to 64 byte boundary */
+ andcc %o0, 0x3f, %o3 /* check for dst 64 byte aligned */
+ brz,pn %o3, .Laligned_to_64
+ andcc %o0, 8, %o3 /* odd long words to move? */
+ brz,pt %o3, .Laligned_to_16
+ nop
+ ldx [%o1], %o4
+ sub %o2, 8, %o2
+ add %o1, 8, %o1 /* increment src ptr */
+ add %o0, 8, %o0 /* increment dst ptr */
+ stx %o4, [%o0-8]
+.Laligned_to_16:
+ andcc %o0, 16, %o3 /* pair of long words to move? */
+ brz,pt %o3, .Laligned_to_32
+ nop
+ ldx [%o1], %o4
+ sub %o2, 16, %o2
+ stx %o4, [%o0]
+ add %o1, 16, %o1 /* increment src ptr */
+ ldx [%o1-8], %o4
+ add %o0, 16, %o0 /* increment dst ptr */
+ stx %o4, [%o0-8]
+.Laligned_to_32:
+ andcc %o0, 32, %o3 /* four long words to move? */
+ brz,pt %o3, .Laligned_to_64
+ nop
+ ldx [%o1], %o4
+ sub %o2, 32, %o2
+ stx %o4, [%o0]
+ ldx [%o1+8], %o4
+ stx %o4, [%o0+8]
+ ldx [%o1+16], %o4
+ stx %o4, [%o0+16]
+ add %o1, 32, %o1 /* increment src ptr */
+ ldx [%o1-8], %o4
+ add %o0, 32, %o0 /* increment dst ptr */
+ stx %o4, [%o0-8]
+.Laligned_to_64:
+/* Following test is included to avoid issues where existing executables
+ * incorrectly call memcpy with overlapping src and dest instead of memmove
+ *
+ * if ( (src ge dst) and (dst+len > src)) go to overlap case
+ * if ( (src lt dst) and (src+len > dst)) go to overlap case
+ */
+ cmp %o1,%o0
+ bge,pt %XCC, 1f
+ nop
+/* src+len > dst? */
+ add %o1, %o2, %o4
+ cmp %o4, %o0
+ bgt,pt %XCC, .Lmv_aligned_on_64
+ nop
+ ba 2f
+ nop
+1:
+/* dst+len > src? */
+ add %o0, %o2, %o4
+ cmp %o4, %o1
+ bgt,pt %XCC, .Lmv_aligned_on_64
+ nop
+2:
+/* handle non-overlapped copies
+ *
+ * Using block init store (BIS) instructions to avoid fetching cache
+ * lines from memory. Use ST_CHUNK stores to first element of each cache
+ * line (similar to prefetching) to avoid overfilling STQ or miss buffers.
+ * Gives existing cache lines time to be moved out of L1/L2/L3 cache.
+ */
+ andn %o2, 0x3f, %o5 /* %o5 is multiple of block size */
+ and %o2, 0x3f, %o2 /* residue bytes in %o2 */
+
+/* We use ASI_STBIMRU_P for the first store to each cache line
+ * followed by ASI_STBI_P (mark as LRU) for the last store. That
+ * mixed approach reduces the chances the cache line is removed
+ * before we finish setting it, while minimizing the effects on
+ * other cached values during a large memcpy
+ *
+ * Intermediate stores can be normal since first BIS activates the
+ * cache line in the L2 cache.
+ *
+ * ST_CHUNK batches up initial BIS operations for several cache lines
+ * to allow multiple requests to not be blocked by overflowing the
+ * the store miss buffer. Then the matching stores for all those
+ * BIS operations are executed.
+ */
+
+.Lalign_loop:
+ cmp %o5, ST_CHUNK*64
+ blu,pt %XCC, .Lalign_short
+ mov ST_CHUNK, %o3
+ sllx %o3, 6, %g5 /* ST_CHUNK*64 */
+
+.Lalign_loop_start:
+ prefetch [%o1 + (ALIGN_PRE * BLOCK_SIZE)], 21
+ subcc %o3, 2, %o3
+ ldx [%o1], %o4
+ add %o1, 128, %o1
+ EX_ST(STORE_ASI(%o4, %o0))
+ add %o0, 64, %o0
+ ldx [%o1-64], %o4
+ EX_ST(STORE_ASI(%o4, %o0))
+ add %o0, 64, %o0
+ bgu,pt %XCC, .Lalign_loop_start
+ prefetch [%o1 + ((ALIGN_PRE-1) * BLOCK_SIZE)], 21
+
+ mov ST_CHUNK, %o3
+ sub %o1, %g5, %o1 /* reset %o1 */
+ sub %o0, %g5, %o0 /* reset %o0 */
+
+ sub %o0, 8, %o0 /* adjust %o0 for ASI alignment */
+.Lalign_loop_rest:
+ ldx [%o1+8],%o4
+ add %o0, 64, %o0
+ stx %o4, [%o0-48]
+ subcc %o3, 1, %o3
+ ldx [%o1+16],%o4
+ stx %o4, [%o0-40]
+ sub %o5, 64, %o5
+ ldx [%o1+24],%o4
+ stx %o4, [%o0-32]
+ ldx [%o1+32],%o4
+ stx %o4, [%o0-24]
+ ldx [%o1+40],%o4
+ stx %o4, [%o0-16]
+ ldx [%o1+48],%o4
+ stx %o4, [%o0-8]
+ add %o1, 64, %o1
+ ldx [%o1-8],%o4
+ bgu,pt %XCC, .Lalign_loop_rest
+ EX_ST(STORE_INIT(%o4,%o0)) /* mark cache line as LRU */
+
+ mov ST_CHUNK, %o3
+ cmp %o5, ST_CHUNK*64
+ bgu,pt %XCC, .Lalign_loop_start
+ add %o0, 8, %o0 /* restore %o0 from ASI alignment */
+
+ cmp %o5, 0
+ beq,pt %XCC, .Lalign_done
+
+/* no prefetches needed in these loops
+ * since we are within ALIGN_PRE of the end */
+.Lalign_short:
+ srl %o5, 6, %o3
+.Lalign_loop_short:
+ subcc %o3, 1, %o3
+ ldx [%o1], %o4
+ add %o1, 64, %o1
+ EX_ST(STORE_ASI(%o4, %o0))
+ bgu,pt %XCC, .Lalign_loop_short
+ add %o0, 64, %o0
+
+ sub %o1, %o5, %o1 /* reset %o1 */
+ sub %o0, %o5, %o0 /* reset %o0 */
+
+ sub %o0, 8, %o0 /* adjust %o0 for ASI alignment */
+.Lalign_short_rest:
+ ldx [%o1+8],%o4
+ add %o0, 64, %o0
+ stx %o4, [%o0-48]
+ ldx [%o1+16],%o4
+ subcc %o5, 64, %o5
+ stx %o4, [%o0-40]
+ ldx [%o1+24],%o4
+ stx %o4, [%o0-32]
+ ldx [%o1+32],%o4
+ stx %o4, [%o0-24]
+ ldx [%o1+40],%o4
+ stx %o4, [%o0-16]
+ ldx [%o1+48],%o4
+ stx %o4, [%o0-8]
+ add %o1, 64, %o1
+ ldx [%o1-8],%o4
+ bgu,pt %XCC, .Lalign_short_rest
+ EX_ST(STORE_INIT(%o4,%o0)) /* mark cache line as LRU */
+
+ add %o0, 8, %o0 /* restore %o0 from ASI alignment */
+
+.Lalign_done:
+ cmp %o2, 0
+ membar #StoreStore
+ bne,pt %XCC, .Lmedl63
+ subcc %o2, 63, %o2 /* adjust length to allow cc test */
+ retl
+ mov EX_RETVAL(%g1), %o0 /* restore %o0 */
+
+ .align 16
+ /* Dst is on 8 byte boundary; src is not; remaining cnt > SMALL_MAX */
+ /* Since block load/store and BIS are not in use for unaligned data,
+ * no need to align dst on 64 byte cache line boundary */
+.Lunalignsetup:
+.Lunalignrejoin:
+ rd %fprs, %g5 /* check for unused fp */
+ /* if fprs.fef == 0, set it.
+ * Setting it when already set costs more than checking */
+ andcc %g5, FPRS_FEF, %g5 /* test FEF, fprs.du = fprs.dl = 0 */
+ bz,a %XCC, 1f
+ wr %g0, FPRS_FEF, %fprs /* fprs.fef = 1 */
+1:
+ andn %o2, 0x3f, %o5 /* %o5 is multiple of block size */
+ and %o2, 0x3f, %o2 /* residue bytes in %o2 */
+ cmp %o2, 8 /* Insure we do not load beyond */
+ bgt,pt %XCC, .Lunalign_adjust /* end of source buffer */
+ andn %o1, 0x7, %o4 /* %o4 has 8 byte aligned src addr */
+ add %o2, 64, %o2 /* adjust to leave loop */
+ sub %o5, 64, %o5 /* early if necessary */
+.Lunalign_adjust:
+ alignaddr %o1, %g0, %g0 /* generate %gsr */
+ add %o1, %o5, %o1 /* advance %o1 to after blocks */
+ ldd [%o4], %f0
+.Lunalign_loop:
+ prefetch [%o0 + (9 * BLOCK_SIZE)], 20
+ ldd [%o4+8], %f2
+ faligndata %f0, %f2, %f16
+ ldd [%o4+16], %f4
+ subcc %o5, BLOCK_SIZE, %o5
+ std %f16, [%o0]
+ faligndata %f2, %f4, %f18
+ ldd [%o4+24], %f6
+ std %f18, [%o0+8]
+ faligndata %f4, %f6, %f20
+ ldd [%o4+32], %f8
+ std %f20, [%o0+16]
+ faligndata %f6, %f8, %f22
+ ldd [%o4+40], %f10
+ std %f22, [%o0+24]
+ faligndata %f8, %f10, %f24
+ ldd [%o4+48], %f12
+ std %f24, [%o0+32]
+ faligndata %f10, %f12, %f26
+ ldd [%o4+56], %f14
+ add %o4, BLOCK_SIZE, %o4
+ std %f26, [%o0+40]
+ faligndata %f12, %f14, %f28
+ ldd [%o4], %f0
+ std %f28, [%o0+48]
+ faligndata %f14, %f0, %f30
+ std %f30, [%o0+56]
+ add %o0, BLOCK_SIZE, %o0
+ bgu,pt %XCC, .Lunalign_loop
+ prefetch [%o4 + (11 * BLOCK_SIZE)], 20
+
+ /* Handle trailing bytes, 64 to 127
+ * Dest long word aligned, Src not long word aligned */
+ cmp %o2, 15
+ bleu,pt %XCC, .Lunalign_short
+
+ andn %o2, 0x7, %o5 /* %o5 is multiple of 8 */
+ and %o2, 0x7, %o2 /* residue bytes in %o2 */
+ add %o2, 8, %o2
+ sub %o5, 8, %o5 /* do not load past end of src */
+ andn %o1, 0x7, %o4 /* %o4 has 8 byte aligned src addr */
+ add %o1, %o5, %o1 /* move %o1 to after multiple of 8 */
+ ldd [%o4], %f0 /* fetch partial word */
+.Lunalign_by8:
+ ldd [%o4+8], %f2
+ add %o4, 8, %o4
+ faligndata %f0, %f2, %f16
+ subcc %o5, 8, %o5
+ std %f16, [%o0]
+ fsrc2 %f2, %f0
+ bgu,pt %XCC, .Lunalign_by8
+ add %o0, 8, %o0
+
+.Lunalign_short: /* restore fprs state */
+ brnz,pt %g5, .Lsmallrest
+ nop
+ ba .Lsmallrest
+ wr %g5, %g0, %fprs
+END(__memcpy_niagara7)
+
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S
index a3b69f9ef1..50b37af104 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S
@@ -1,5 +1,5 @@
/* Copy SIZE bytes from SRC to DEST. For SUN4V Niagara.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@davemloft.net)
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S
index 9b3e1651b1..91d9eb3221 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S
@@ -1,5 +1,5 @@
/* Copy SIZE bytes from SRC to DEST. For SUN4V Niagara-2.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@davemloft.net)
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S
index 7234a7bf75..096a11cfd8 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S
@@ -1,5 +1,5 @@
/* Copy SIZE bytes from SRC to DEST. For SUN4V Niagara-4.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@davemloft.net)
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S
new file mode 100644
index 0000000000..8e0b3e2d48
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S
@@ -0,0 +1,33 @@
+/* Default SPARC64 memcpy implementation.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# include <sysdep.h>
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(x, y)
+# undef libc_hidden_def
+# define libc_hidden_def(name)
+
+# define memcpy __memcpy_ultra1
+# define __memcpy_large __memcpy_large_ultra1
+# define __mempcpy __mempcpy_ultra1
+# include <sysdeps/sparc/sparc64/memcpy.S>
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
index 5b00c35d44..41cd606f59 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
@@ -1,6 +1,6 @@
/* Copy SIZE bytes from SRC to DEST.
For UltraSPARC-III.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@redhat.com)
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.S b/sysdeps/sparc/sparc64/multiarch/memcpy.S
deleted file mode 100644
index 328f62152b..0000000000
--- a/sysdeps/sparc/sparc64/multiarch/memcpy.S
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Multiple versions of memcpy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by David S. Miller (davem@davemloft.net)
- 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>
-
-#if IS_IN (libc)
- .text
-ENTRY(memcpy)
- .type memcpy, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_CRYPTO, %o1
- andcc %o0, %o1, %g0
- be 1f
- andcc %o0, HWCAP_SPARC_N2, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__memcpy_niagara4), %o1
- xor %o1, %gdop_lox10(__memcpy_niagara4), %o1
-# else
- set __memcpy_niagara4, %o1
-# endif
- ba 10f
- nop
-1: be 1f
- andcc %o0, HWCAP_SPARC_BLKINIT, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__memcpy_niagara2), %o1
- xor %o1, %gdop_lox10(__memcpy_niagara2), %o1
-# else
- set __memcpy_niagara2, %o1
-# endif
- ba 10f
- nop
-1: be 1f
- andcc %o0, HWCAP_SPARC_ULTRA3, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__memcpy_niagara1), %o1
- xor %o1, %gdop_lox10(__memcpy_niagara1), %o1
-# else
- set __memcpy_niagara1, %o1
-# endif
- ba 10f
- nop
-1: be 9f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__memcpy_ultra3), %o1
- xor %o1, %gdop_lox10(__memcpy_ultra3), %o1
-# else
- set __memcpy_ultra3, %o1
-# endif
- ba 10f
- nop
-9:
-# ifdef SHARED
- sethi %gdop_hix22(__memcpy_ultra1), %o1
- xor %o1, %gdop_lox10(__memcpy_ultra1), %o1
-# else
- set __memcpy_ultra1, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(memcpy)
-
-ENTRY(__mempcpy)
- .type __mempcpy, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_CRYPTO, %o1
- andcc %o0, %o1, %g0
- be 1f
- andcc %o0, HWCAP_SPARC_N2, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__mempcpy_niagara4), %o1
- xor %o1, %gdop_lox10(__mempcpy_niagara4), %o1
-# else
- set __mempcpy_niagara4, %o1
-# endif
- ba 10f
- nop
-1: be 1f
- andcc %o0, HWCAP_SPARC_BLKINIT, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__mempcpy_niagara2), %o1
- xor %o1, %gdop_lox10(__mempcpy_niagara2), %o1
-# else
- set __mempcpy_niagara2, %o1
-# endif
- ba 10f
- nop
-1: be 1f
- andcc %o0, HWCAP_SPARC_ULTRA3, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__mempcpy_niagara1), %o1
- xor %o1, %gdop_lox10(__mempcpy_niagara1), %o1
-# else
- set __mempcpy_niagara1, %o1
-# endif
- ba 10f
- nop
-1: be 9f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__mempcpy_ultra3), %o1
- xor %o1, %gdop_lox10(__mempcpy_ultra3), %o1
-# else
- set __mempcpy_ultra3, %o1
-# endif
- ba 10f
- nop
-9:
-# ifdef SHARED
- sethi %gdop_hix22(__mempcpy_ultra1), %o1
- xor %o1, %gdop_lox10(__mempcpy_ultra1), %o1
-# else
- set __mempcpy_ultra1, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(__mempcpy)
-
-libc_hidden_builtin_def (memcpy)
-
-libc_hidden_def (__mempcpy)
-weak_alias (__mempcpy, mempcpy)
-libc_hidden_builtin_def (mempcpy)
-
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
-#undef weak_alias
-#define weak_alias(x, y)
-#undef libc_hidden_def
-#define libc_hidden_def(name)
-
-#define memcpy __memcpy_ultra1
-#define __mempcpy __mempcpy_ultra1
-
-#endif
-
-#include "../memcpy.S"
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.c b/sysdeps/sparc/sparc64/multiarch/memcpy.c
new file mode 100644
index 0000000000..7adb2936c7
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy.c
@@ -0,0 +1,33 @@
+/* Multiple versions of memcpy. SPARC64/Linux version.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define memcpy __redirect_memcpy
+# include <string.h>
+# undef memcpy
+
+# include <sparc-ifunc.h>
+
+# define SYMBOL_NAME memcpy
+# include "ifunc-memcpy.h"
+
+sparc_libc_ifunc_redirected (__redirect_memcpy, memcpy, IFUNC_SELECTOR)
+
+sparc_ifunc_redirected_hidden_def (__redirect_memcpy, memcpy)
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memmove-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memmove-ultra1.S
new file mode 100644
index 0000000000..2ed85d92e6
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memmove-ultra1.S
@@ -0,0 +1,4 @@
+#define memmove __memmove_ultra1
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#include <sysdeps/sparc/sparc64/memmove.S>
diff --git a/sysdeps/sparc/sparc64/multiarch/memmove.c b/sysdeps/sparc/sparc64/multiarch/memmove.c
new file mode 100644
index 0000000000..878d532cea
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memmove.c
@@ -0,0 +1,33 @@
+/* Multiple versions of memmove.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define memmove __redirect_memmove
+# include <string.h>
+# undef memmove
+
+# include <sparc-ifunc.h>
+
+# define SYMBOL_NAME memmove
+# include "ifunc-memmove.h"
+
+sparc_libc_ifunc_redirected (__redirect_memmove, memmove, IFUNC_SELECTOR);
+
+sparc_ifunc_redirected_hidden_def (__redirect_memmove, memmove)
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/mempcpy.c b/sysdeps/sparc/sparc64/multiarch/mempcpy.c
new file mode 100644
index 0000000000..ab398c6b08
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/mempcpy.c
@@ -0,0 +1,39 @@
+/* Multiple versions of mempcpy. SPARC64/Linux version.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
+# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
+# include <string.h>
+# undef mempcpy
+# undef __mempcpy
+
+# include <sparc-ifunc.h>
+
+# define SYMBOL_NAME mempcpy
+# include "ifunc-memcpy.h"
+
+sparc_libc_ifunc_redirected (__redirect_mempcpy, __mempcpy, IFUNC_SELECTOR)
+
+sparc_ifunc_redirected_hidden_def (__redirect___mempcpy, __mempcpy)
+weak_alias (__mempcpy, mempcpy)
+sparc_ifunc_redirected_hidden_def (__redirect_mempcpy, mempcpy)
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S
index fe3e09df73..8752b16f4a 100644
--- a/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S
+++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S
@@ -1,5 +1,5 @@
/* Set a block of memory to some byte value. For SUN4V Niagara.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@davemloft.net)
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S
index 85ab05485f..2198463a27 100644
--- a/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S
+++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S
@@ -1,5 +1,5 @@
/* Set a block of memory to some byte value. For SUN4V Niagara-4.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@davemloft.net)
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S
new file mode 100644
index 0000000000..77910c7b62
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S
@@ -0,0 +1,334 @@
+/* Set a block of memory to some byte value. For SUN4V M7.
+ Copyright (C) 2017-2018 Free Software 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>
+
+#ifndef XCC
+# define XCC xcc
+#endif
+ .register %g2, #scratch
+ .register %g3, #scratch
+
+/* The algorithm is as follows :
+ *
+ * For small 7 or fewer bytes stores, bytes will be stored.
+ *
+ * For less than 32 bytes stores, align the address on 4 byte boundary.
+ * Then store as many 4-byte chunks, followed by trailing bytes.
+ *
+ * For sizes greater than 32 bytes, align the address on 8 byte boundary.
+ * if (count >= 64) {
+ * store 8-bytes chunks to align the address on 64 byte boundary
+ * if (value to be set is zero && count >= MIN_ZERO) {
+ * Using BIS stores, set the first long word of each
+ * 64-byte cache line to zero which will also clear the
+ * other seven long words of the cache line.
+ * }
+ * else if (count >= MIN_LOOP) {
+ * Using BIS stores, set the first long word of each of
+ * ST_CHUNK cache lines (64 bytes each) before the main
+ * loop is entered.
+ * In the main loop, continue pre-setting the first long
+ * word of each cache line ST_CHUNK lines in advance while
+ * setting the other seven long words (56 bytes) of each
+ * cache line until fewer than ST_CHUNK*64 bytes remain.
+ * Then set the remaining seven long words of each cache
+ * line that has already had its first long word set.
+ * }
+ * store remaining data in 64-byte chunks until less than
+ * 64 bytes remain.
+ * }
+ * Store as many 8-byte chunks, followed by trailing bytes.
+ *
+ *
+ * BIS = Block Init Store
+ * Doing the advance store of the first element of the cache line
+ * initiates the displacement of a cache line while only using a single
+ * instruction in the pipeline. That avoids various pipeline delays,
+ * such as filling the miss buffer. The performance effect is
+ * similar to prefetching for normal stores.
+ * The special case for zero fills runs faster and uses fewer instruction
+ * cycles than the normal memset loop.
+ *
+ * We only use BIS for memset of greater than MIN_LOOP bytes because a sequence
+ * BIS stores must be followed by a membar #StoreStore. The benefit of
+ * the BIS store must be balanced against the cost of the membar operation.
+ */
+
+/*
+ * ASI_STBI_P marks the cache line as "least recently used"
+ * which means if many threads are active, it has a high chance
+ * of being pushed out of the cache between the first initializing
+ * store and the final stores.
+ * Thus, we use ASI_STBIMRU_P which marks the cache line as
+ * "most recently used" for all but the last store to the cache line.
+ */
+
+#define ASI_BLK_INIT_QUAD_LDD_P 0xe2
+#define ASI_ST_BLK_INIT_MRU_P 0xf2
+
+#define ASI_STBI_P ASI_BLK_INIT_QUAD_LDD_P
+#define ASI_STBIMRU_P ASI_ST_BLK_INIT_MRU_P
+
+#define ST_CHUNK 24 /* multiple of 4 due to loop unrolling */
+#define MIN_LOOP (ST_CHUNK)*64
+#define MIN_ZERO 256
+
+#define EX_ST(x) x
+#define EX_RETVAL(x) x
+#define STORE_ASI(src,addr) stxa src, [addr] ASI_STBIMRU_P
+#define STORE_INIT(src,addr) stxa src, [addr] ASI_STBI_P
+
+#if IS_IN (libc)
+
+ .text
+ .align 32
+
+ENTRY(__bzero_niagara7)
+ /* bzero (dst, size) */
+ mov %o1, %o2
+ mov 0, %o1
+ /* fall through into memset code */
+END(__bzero_niagara7)
+
+ENTRY(__memset_niagara7)
+ /* memset (src, c, size) */
+ mov %o0, %o5 /* copy sp1 before using it */
+ cmp %o2, 7 /* if small counts, just write bytes */
+ bleu,pn %XCC, .Lwrchar
+ and %o1, 0xff, %o1 /* o1 is (char)c */
+
+ sll %o1, 8, %o3
+ or %o1, %o3, %o1 /* now o1 has 2 bytes of c */
+ sll %o1, 16, %o3
+ cmp %o2, 32
+ blu,pn %XCC, .Lwdalign
+ or %o1, %o3, %o1 /* now o1 has 4 bytes of c */
+
+ sllx %o1, 32, %o3
+ or %o1, %o3, %o1 /* now o1 has 8 bytes of c */
+
+.Ldbalign:
+ andcc %o5, 7, %o3 /* is sp1 aligned on a 8 byte bound? */
+ bz,pt %XCC, .Lblkalign /* already long word aligned */
+ sub %o3, 8, %o3 /* -(bytes till long word aligned) */
+
+ add %o2, %o3, %o2 /* update o2 with new count */
+ /* Set -(%o3) bytes till sp1 long word aligned */
+1: stb %o1, [%o5] /* there is at least 1 byte to set */
+ inccc %o3 /* byte clearing loop */
+ bl,pt %XCC, 1b
+ inc %o5
+
+ /* Now sp1 is long word aligned (sp1 is found in %o5) */
+.Lblkalign:
+ cmp %o2, 64 /* check if there are 64 bytes to set */
+ blu,pn %XCC, .Lwrshort
+ mov %o2, %o3
+
+ andcc %o5, 63, %o3 /* is sp1 block aligned? */
+ bz,pt %XCC, .Lblkwr /* now block aligned */
+ sub %o3, 64, %o3 /* o3 is -(bytes till block aligned) */
+ add %o2, %o3, %o2 /* o2 is the remainder */
+
+ /* Store -(%o3) bytes till dst is block (64 byte) aligned. */
+ /* Use long word stores. */
+ /* Recall that dst is already long word aligned */
+1:
+ addcc %o3, 8, %o3
+ stx %o1, [%o5]
+ bl,pt %XCC, 1b
+ add %o5, 8, %o5
+
+ /* Now sp1 is block aligned */
+.Lblkwr:
+ andn %o2, 63, %o4 /* calculate size of blocks in bytes */
+ brz,pn %o1, .Lwrzero /* special case if c == 0 */
+ and %o2, 63, %o3 /* %o3 = bytes left after blk stores */
+
+ cmp %o4, MIN_LOOP /* check for enough bytes to set */
+ blu,pn %XCC, .Lshort_set /* to justify cost of membar */
+ nop /* must be > pre-cleared lines */
+
+ /* initial cache-clearing stores */
+ /* get store pipeline moving */
+
+/* Primary memset loop for large memsets */
+.Lwr_loop:
+ mov ST_CHUNK, %g1
+.Lwr_loop_start:
+ subcc %g1, 4, %g1
+ EX_ST(STORE_ASI(%o1,%o5))
+ add %o5, 64, %o5
+ EX_ST(STORE_ASI(%o1,%o5))
+ add %o5, 64, %o5
+ EX_ST(STORE_ASI(%o1,%o5))
+ add %o5, 64, %o5
+ EX_ST(STORE_ASI(%o1,%o5))
+ bgu %XCC, .Lwr_loop_start
+ add %o5, 64, %o5
+
+ sub %o5, ST_CHUNK*64, %o5 /* reset %o5 */
+ mov ST_CHUNK, %g1
+ sub %o5, 8, %o5 /* adjust %o5 for ASI store */
+
+.Lwr_loop_rest:
+ stx %o1,[%o5+8+8]
+ sub %o4, 64, %o4
+ stx %o1,[%o5+16+8]
+ subcc %g1, 1, %g1
+ stx %o1,[%o5+24+8]
+ stx %o1,[%o5+32+8]
+ stx %o1,[%o5+40+8]
+ add %o5, 64, %o5
+ stx %o1,[%o5-8]
+ bgu %XCC, .Lwr_loop_rest
+ EX_ST(STORE_INIT(%o1,%o5))
+
+ add %o5, 8, %o5 /* restore %o5 offset */
+
+ /* If more than ST_CHUNK*64 bytes remain to set, continue */
+ /* setting the first long word of each cache line in advance */
+ /* to keep the store pipeline moving. */
+
+ cmp %o4, ST_CHUNK*64
+ bge,pt %XCC, .Lwr_loop_start
+ mov ST_CHUNK, %g1
+
+ brz,a,pn %o4, .Lasi_done
+ nop
+
+ sub %o5, 8, %o5 /* adjust %o5 for ASI store */
+.Lwr_loop_small:
+ add %o5, 8, %o5 /* adjust %o5 for ASI store */
+ EX_ST(STORE_ASI(%o1,%o5))
+ stx %o1,[%o5+8]
+ stx %o1,[%o5+16]
+ stx %o1,[%o5+24]
+ stx %o1,[%o5+32]
+ subcc %o4, 64, %o4
+ stx %o1,[%o5+40]
+ add %o5, 56, %o5
+ stx %o1,[%o5-8]
+ bgu,pt %XCC, .Lwr_loop_small
+ EX_ST(STORE_INIT(%o1,%o5))
+
+ ba .Lasi_done
+ add %o5, 8, %o5 /* restore %o5 offset */
+
+/* Special case loop for zero fill memsets */
+/* For each 64 byte cache line, single STBI to first element */
+/* clears line */
+.Lwrzero:
+ cmp %o4, MIN_ZERO /* check if enough bytes to set */
+ /* to pay %asi + membar cost */
+ blu %XCC, .Lshort_set
+ nop
+ sub %o4, 256, %o4
+
+.Lwrzero_loop:
+ mov 64, %g3
+ EX_ST(STORE_INIT(%o1,%o5))
+ subcc %o4, 256, %o4
+ EX_ST(STORE_INIT(%o1,%o5+%g3))
+ add %o5, 256, %o5
+ sub %g3, 192, %g3
+ EX_ST(STORE_INIT(%o1,%o5+%g3))
+ add %g3, 64, %g3
+ bge,pt %XCC, .Lwrzero_loop
+ EX_ST(STORE_INIT(%o1,%o5+%g3))
+ add %o4, 256, %o4
+
+ brz,pn %o4, .Lbsi_done
+ nop
+.Lwrzero_small:
+ EX_ST(STORE_INIT(%o1,%o5))
+ subcc %o4, 64, %o4
+ bgu,pt %XCC, .Lwrzero_small
+ add %o5, 64, %o5
+
+.Lasi_done:
+.Lbsi_done:
+ membar #StoreStore /* required by use of BSI */
+
+.Lshort_set:
+ cmp %o4, 64 /* check if 64 bytes to set */
+ blu %XCC, 5f
+ nop
+4: /* set final blocks of 64 bytes */
+ stx %o1, [%o5]
+ stx %o1, [%o5+8]
+ stx %o1, [%o5+16]
+ stx %o1, [%o5+24]
+ subcc %o4, 64, %o4
+ stx %o1, [%o5+32]
+ stx %o1, [%o5+40]
+ add %o5, 64, %o5
+ stx %o1, [%o5-16]
+ bgu,pt %XCC, 4b
+ stx %o1, [%o5-8]
+
+5:
+ /* Set the remaining long words */
+.Lwrshort:
+ subcc %o3, 8, %o3 /* Can we store any long words? */
+ blu,pn %XCC, .Lwrchars
+ and %o2, 7, %o2 /* calc bytes left after long words */
+6:
+ subcc %o3, 8, %o3
+ stx %o1, [%o5] /* store the long words */
+ bgeu,pt %XCC, 6b
+ add %o5, 8, %o5
+
+.Lwrchars: /* check for extra chars */
+ brnz %o2, .Lwrfin
+ nop
+ retl
+ nop
+
+.Lwdalign:
+ andcc %o5, 3, %o3 /* is sp1 aligned on a word boundary */
+ bz,pn %XCC, .Lwrword
+ andn %o2, 3, %o3 /* create word sized count in %o3 */
+
+ dec %o2 /* decrement count */
+ stb %o1, [%o5] /* clear a byte */
+ b .Lwdalign
+ inc %o5 /* next byte */
+
+.Lwrword:
+ subcc %o3, 4, %o3
+ st %o1, [%o5] /* 4-byte writing loop */
+ bnz,pt %XCC, .Lwrword
+ add %o5, 4, %o5
+ and %o2, 3, %o2 /* leftover count, if any */
+
+.Lwrchar:
+ /* Set the remaining bytes, if any */
+ brz %o2, .Lexit
+ nop
+.Lwrfin:
+ deccc %o2
+ stb %o1, [%o5]
+ bgu,pt %XCC, .Lwrfin
+ inc %o5
+.Lexit:
+ retl /* %o0 was preserved */
+ nop
+END(__memset_niagara7)
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S
new file mode 100644
index 0000000000..dd9d2c17cd
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S
@@ -0,0 +1,30 @@
+/* Default SPARC64 memset implementation.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# include <sysdep.h>
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(x, y)
+
+# define memset __memset_ultra1
+# define __bzero __bzero_ultra1
+# include <sysdeps/sparc/sparc64/memset.S>
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memset.S b/sysdeps/sparc/sparc64/multiarch/memset.S
deleted file mode 100644
index bd0e160d70..0000000000
--- a/sysdeps/sparc/sparc64/multiarch/memset.S
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Multiple versions of memset and bzero
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by David S. Miller (davem@davemloft.net)
- 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>
-
-#if IS_IN (libc)
- .text
-ENTRY(memset)
- .type memset, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_CRYPTO, %o1
- andcc %o0, %o1, %g0
- be 1f
- andcc %o0, HWCAP_SPARC_BLKINIT, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__memset_niagara4), %o1
- xor %o1, %gdop_lox10(__memset_niagara4), %o1
-# else
- set __memset_niagara4, %o1
-# endif
- ba 10f
- nop
-1: be 9f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__memset_niagara1), %o1
- xor %o1, %gdop_lox10(__memset_niagara1), %o1
-# else
- set __memset_niagara1, %o1
-# endif
- ba 10f
- nop
-9:
-# ifdef SHARED
- sethi %gdop_hix22(__memset_ultra1), %o1
- xor %o1, %gdop_lox10(__memset_ultra1), %o1
-# else
- set __memset_ultra1, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(memset)
-
-ENTRY(__bzero)
- .type bzero, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_CRYPTO, %o1
- andcc %o0, %o1, %g0
- be 1f
- andcc %o0, HWCAP_SPARC_BLKINIT, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__bzero_niagara4), %o1
- xor %o1, %gdop_lox10(__bzero_niagara4), %o1
-# else
- set __bzero_niagara4, %o1
-# endif
- ba 10f
- nop
-1: be 9f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__bzero_niagara1), %o1
- xor %o1, %gdop_lox10(__bzero_niagara1), %o1
-# else
- set __bzero_niagara1, %o1
-# endif
- ba 10f
- nop
-9:
-# ifdef SHARED
- sethi %gdop_hix22(__bzero_ultra1), %o1
- xor %o1, %gdop_lox10(__bzero_ultra1), %o1
-# else
- set __bzero_ultra1, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(__bzero)
-
-weak_alias (__bzero, bzero)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-libc_hidden_builtin_def (memset)
-
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
-
-#define memset __memset_ultra1
-#define __bzero __bzero_ultra1
-
-#endif
-
-#include "../memset.S"
diff --git a/sysdeps/sparc/sparc64/multiarch/memset.c b/sysdeps/sparc/sparc64/multiarch/memset.c
new file mode 100644
index 0000000000..c2920c7df7
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memset.c
@@ -0,0 +1,33 @@
+/* Multiple versions of memset. SPARC64/Linux version.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define memset __redirect_memset
+# include <string.h>
+# undef memset
+
+# include <sparc-ifunc.h>
+
+# define SYMBOL_NAME memset
+# include "ifunc-memset.h"
+
+sparc_libc_ifunc_redirected (__redirect_memset, memset, IFUNC_SELECTOR)
+sparc_ifunc_redirected_hidden_def (__redirect_memset, memset)
+
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/mul_1-generic.S b/sysdeps/sparc/sparc64/multiarch/mul_1-generic.S
new file mode 100644
index 0000000000..f1b7e6026a
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/mul_1-generic.S
@@ -0,0 +1,2 @@
+#define __mpn_mul_1 __mpn_mul_1_generic
+#include <sysdeps/sparc/sparc64/mul_1.S>
diff --git a/sysdeps/sparc/sparc64/multiarch/mul_1-vis3.S b/sysdeps/sparc/sparc64/multiarch/mul_1-vis3.S
index d2ddd110b0..79452919cc 100644
--- a/sysdeps/sparc/sparc64/multiarch/mul_1-vis3.S
+++ b/sysdeps/sparc/sparc64/multiarch/mul_1-vis3.S
@@ -1,7 +1,7 @@
! SPARC v9 64-bit VIS3 __mpn_mul_1 -- Multiply a limb vector with a single
! limb and store the product in a second limb vector.
!
-! Copyright (C) 2013-2016 Free Software Foundation, Inc.
+! Copyright (C) 2013-2018 Free Software Foundation, Inc.
! This file is part of the GNU C Library.
! Contributed by David S. Miller <davem@davemloft.net>
!
diff --git a/sysdeps/sparc/sparc64/multiarch/mul_1.S b/sysdeps/sparc/sparc64/multiarch/mul_1.S
deleted file mode 100644
index 0a1fbdbc51..0000000000
--- a/sysdeps/sparc/sparc64/multiarch/mul_1.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Multiple versions of mul_1
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- Contributed by David S. Miller (davem@davemloft.net)
- 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>
-
-ENTRY(__mpn_mul_1)
- .type __mpn_mul_1, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_VIS3, %o1
- andcc %o0, %o1, %g0
- be 1f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__mpn_mul_1_vis3), %o1
- xor %o1, %gdop_lox10(__mpn_mul_1_vis3), %o1
-# else
- set __mpn_mul_1_vis3, %o1
-# endif
- ba 10f
- nop
-1:
-# ifdef SHARED
- sethi %gdop_hix22(__mpn_mul_1_generic), %o1
- xor %o1, %gdop_lox10(__mpn_mul_1_generic), %o1
-# else
- set __mpn_mul_1_generic, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(__mpn_mul_1)
-
-#define __mpn_mul_1 __mpn_mul_1_generic
-#include "../mul_1.S"
diff --git a/sysdeps/sparc/sparc64/multiarch/mul_1.c b/sysdeps/sparc/sparc64/multiarch/mul_1.c
new file mode 100644
index 0000000000..0b8d0cf0da
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/mul_1.c
@@ -0,0 +1,28 @@
+/* __mpn_mul_1 ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <gmp.h>
+#include <sparc-ifunc.h>
+
+extern __typeof (mpn_mul_1) __mpn_mul_1_vis3 attribute_hidden;
+extern __typeof (mpn_mul_1) __mpn_mul_1_generic attribute_hidden;
+
+sparc_libm_ifunc (__mpn_mul_1,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __mpn_mul_1_vis3
+ : __mpn_mul_1_generic)
diff --git a/sysdeps/sparc/sparc64/multiarch/rtld-memmove.c b/sysdeps/sparc/sparc64/multiarch/rtld-memmove.c
new file mode 100644
index 0000000000..e6d9a5c686
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/rtld-memmove.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/rtld-memmove.c>
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/sha256-crop.S b/sysdeps/sparc/sparc64/multiarch/sha256-crop.S
index 55186780eb..0f07b8d8a2 100644
--- a/sysdeps/sparc/sparc64/multiarch/sha256-crop.S
+++ b/sysdeps/sparc/sparc64/multiarch/sha256-crop.S
@@ -1,5 +1,5 @@
/* SHA256 using sparc crypto opcodes.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@davemloft.net)
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/sparc/sparc64/multiarch/sha512-crop.S b/sysdeps/sparc/sparc64/multiarch/sha512-crop.S
index c08a580e0c..f22eef3206 100644
--- a/sysdeps/sparc/sparc64/multiarch/sha512-crop.S
+++ b/sysdeps/sparc/sparc64/multiarch/sha512-crop.S
@@ -1,5 +1,5 @@
/* SHA512 using sparc crypto opcodes.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller (davem@davemloft.net)
diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n-generic.S b/sysdeps/sparc/sparc64/multiarch/sub_n-generic.S
new file mode 100644
index 0000000000..7cece934a7
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/sub_n-generic.S
@@ -0,0 +1,2 @@
+#define __mpn_sub_n __mpn_sub_n_generic
+#include <sysdeps/sparc/sparc64/sub_n.S>
diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n-vis3.S b/sysdeps/sparc/sparc64/multiarch/sub_n-vis3.S
index cc659ed7f4..b71c93d36d 100644
--- a/sysdeps/sparc/sparc64/multiarch/sub_n-vis3.S
+++ b/sysdeps/sparc/sparc64/multiarch/sub_n-vis3.S
@@ -1,7 +1,7 @@
! SPARC v9 64-bit VIS3 __mpn_sub_n -- Subtract two limb vectors of the same length > 0
! and store difference in a third limb vector.
!
-! Copyright (C) 2013-2016 Free Software Foundation, Inc.
+! Copyright (C) 2013-2018 Free Software Foundation, Inc.
! This file is part of the GNU C Library.
! Contributed by David S. Miller <davem@davemloft.net>
!
diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n.S b/sysdeps/sparc/sparc64/multiarch/sub_n.S
deleted file mode 100644
index f69d909614..0000000000
--- a/sysdeps/sparc/sparc64/multiarch/sub_n.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Multiple versions of sub_n
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- Contributed by David S. Miller (davem@davemloft.net)
- 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>
-
-ENTRY(__mpn_sub_n)
- .type __mpn_sub_n, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_VIS3, %o1
- andcc %o0, %o1, %g0
- be 1f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__mpn_sub_n_vis3), %o1
- xor %o1, %gdop_lox10(__mpn_sub_n_vis3), %o1
-# else
- set __mpn_sub_n_vis3, %o1
-# endif
- ba 10f
- nop
-1:
-# ifdef SHARED
- sethi %gdop_hix22(__mpn_sub_n_generic), %o1
- xor %o1, %gdop_lox10(__mpn_sub_n_generic), %o1
-# else
- set __mpn_sub_n_generic, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(__mpn_sub_n)
-
-#define __mpn_sub_n __mpn_sub_n_generic
-#include "../sub_n.S"
diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n.c b/sysdeps/sparc/sparc64/multiarch/sub_n.c
new file mode 100644
index 0000000000..2c1f428932
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/sub_n.c
@@ -0,0 +1,28 @@
+/* __mpn_sub_n ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <gmp.h>
+#include <sparc-ifunc.h>
+
+extern __typeof (mpn_sub_n) __mpn_sub_n_vis3 attribute_hidden;
+extern __typeof (mpn_sub_n) __mpn_sub_n_generic attribute_hidden;
+
+sparc_libm_ifunc (__mpn_sub_n,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __mpn_sub_n_vis3
+ : __mpn_sub_n_generic)
diff --git a/sysdeps/sparc/sparc64/multiarch/submul_1-generic.S b/sysdeps/sparc/sparc64/multiarch/submul_1-generic.S
new file mode 100644
index 0000000000..4c1536023d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/submul_1-generic.S
@@ -0,0 +1,2 @@
+#define __mpn_submul_1 __mpn_submul_1_generic
+#include <sysdeps/sparc/sparc64/submul_1.S>
diff --git a/sysdeps/sparc/sparc64/multiarch/submul_1-vis3.S b/sysdeps/sparc/sparc64/multiarch/submul_1-vis3.S
index e92c73e912..823f90afdd 100644
--- a/sysdeps/sparc/sparc64/multiarch/submul_1-vis3.S
+++ b/sysdeps/sparc/sparc64/multiarch/submul_1-vis3.S
@@ -1,7 +1,7 @@
! SPARC v9 64-bit VIS3 __mpn_submul_1 -- Multiply a limb vector with a
! limb and subtract the result from a second limb vector.
!
-! Copyright (C) 2013-2016 Free Software Foundation, Inc.
+! Copyright (C) 2013-2018 Free Software Foundation, Inc.
! This file is part of the GNU C Library.
! Contributed by David S. Miller <davem@davemloft.net>
!
diff --git a/sysdeps/sparc/sparc64/multiarch/submul_1.S b/sysdeps/sparc/sparc64/multiarch/submul_1.S
deleted file mode 100644
index f0d9f2ffe3..0000000000
--- a/sysdeps/sparc/sparc64/multiarch/submul_1.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Multiple versions of submul_1
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- Contributed by David S. Miller (davem@davemloft.net)
- 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>
-
-ENTRY(__mpn_submul_1)
- .type __mpn_submul_1, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_VIS3, %o1
- andcc %o0, %o1, %g0
- be 1f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__mpn_submul_1_vis3), %o1
- xor %o1, %gdop_lox10(__mpn_submul_1_vis3), %o1
-# else
- set __mpn_submul_1_vis3, %o1
-# endif
- ba 10f
- nop
-1:
-# ifdef SHARED
- sethi %gdop_hix22(__mpn_submul_1_generic), %o1
- xor %o1, %gdop_lox10(__mpn_submul_1_generic), %o1
-# else
- set __mpn_submul_1_generic, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(__mpn_submul_1)
-
-#define __mpn_submul_1 __mpn_submul_1_generic
-#include "../submul_1.S"
diff --git a/sysdeps/sparc/sparc64/multiarch/submul_1.c b/sysdeps/sparc/sparc64/multiarch/submul_1.c
new file mode 100644
index 0000000000..6934c6915a
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/submul_1.c
@@ -0,0 +1,28 @@
+/* __mpn_submul_1 ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software 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 <gmp.h>
+#include <sparc-ifunc.h>
+
+extern __typeof (mpn_submul_1) __mpn_submul_1_vis3 attribute_hidden;
+extern __typeof (mpn_submul_1) __mpn_submul_1_generic attribute_hidden;
+
+sparc_libm_ifunc (__mpn_submul_1,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __mpn_submul_1_vis3
+ : __mpn_submul_1_generic)
diff --git a/sysdeps/sparc/sparc64/pthread_spin_lock.S b/sysdeps/sparc/sparc64/pthread_spin_lock.S
index 1232e950d2..a0cff0d49f 100644
--- a/sysdeps/sparc/sparc64/pthread_spin_lock.S
+++ b/sysdeps/sparc/sparc64/pthread_spin_lock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/pthread_spin_trylock.S b/sysdeps/sparc/sparc64/pthread_spin_trylock.S
index 7fa19a66ac..b8e63322b2 100644
--- a/sysdeps/sparc/sparc64/pthread_spin_trylock.S
+++ b/sysdeps/sparc/sparc64/pthread_spin_trylock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/pthread_spin_unlock.S b/sysdeps/sparc/sparc64/pthread_spin_unlock.S
index ce7de6ff34..e6da4cc188 100644
--- a/sysdeps/sparc/sparc64/pthread_spin_unlock.S
+++ b/sysdeps/sparc/sparc64/pthread_spin_unlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/pthreaddef.h b/sysdeps/sparc/sparc64/pthreaddef.h
index 4cebc8473d..62e2290b23 100644
--- a/sysdeps/sparc/sparc64/pthreaddef.h
+++ b/sysdeps/sparc/sparc64/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_add.c b/sysdeps/sparc/sparc64/qp_add.c
index bc3bb3dee0..aa9262f40e 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_add.c
+++ b/sysdeps/sparc/sparc64/qp_add.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = (*a) + (*b)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_cmp.c b/sysdeps/sparc/sparc64/qp_cmp.c
index c3e67501f1..0f97e94cf1 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_cmp.c
+++ b/sysdeps/sparc/sparc64/qp_cmp.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Compare (*a) and (*b), return float condition code.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_cmpe.c b/sysdeps/sparc/sparc64/qp_cmpe.c
index ab514283c8..8ff9d400d6 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_cmpe.c
+++ b/sysdeps/sparc/sparc64/qp_cmpe.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Compare (*a) and (*b), return float condition code.
Signal exception (unless masked) if unordered.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_div.c b/sysdeps/sparc/sparc64/qp_div.c
index 3598713fda..11a5571368 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_div.c
+++ b/sysdeps/sparc/sparc64/qp_div.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = (*a) / (*b)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c b/sysdeps/sparc/sparc64/qp_dtoq.c
index e151fb9198..a53040559d 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c
+++ b/sysdeps/sparc/sparc64/qp_dtoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = (long double)(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_feq.c b/sysdeps/sparc/sparc64/qp_feq.c
index 47e2d54e08..19d44a3612 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_feq.c
+++ b/sysdeps/sparc/sparc64/qp_feq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if (*a) == (*b)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_fge.c b/sysdeps/sparc/sparc64/qp_fge.c
index 9ca01e2d7e..1c652f7a3a 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_fge.c
+++ b/sysdeps/sparc/sparc64/qp_fge.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if (*a) >= (*b)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_fgt.c b/sysdeps/sparc/sparc64/qp_fgt.c
index c5a944c3a4..203ad06525 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_fgt.c
+++ b/sysdeps/sparc/sparc64/qp_fgt.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if (*a) > (*b)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_fle.c b/sysdeps/sparc/sparc64/qp_fle.c
index 39adf9eba2..e6b188038d 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_fle.c
+++ b/sysdeps/sparc/sparc64/qp_fle.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if (*a) <= (*b)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_flt.c b/sysdeps/sparc/sparc64/qp_flt.c
index 5887458ced..64cd908f5c 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_flt.c
+++ b/sysdeps/sparc/sparc64/qp_flt.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if (*a) < (*b)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_fne.c b/sysdeps/sparc/sparc64/qp_fne.c
index efcaed5497..2b859d8bb2 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_fne.c
+++ b/sysdeps/sparc/sparc64/qp_fne.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return 1 if (*a) != (*b)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_itoq.c b/sysdeps/sparc/sparc64/qp_itoq.c
index 0284eaa80e..626eef7602 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_itoq.c
+++ b/sysdeps/sparc/sparc64/qp_itoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = (long double)(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_mul.c b/sysdeps/sparc/sparc64/qp_mul.c
index 7f48e8f077..20583ea026 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_mul.c
+++ b/sysdeps/sparc/sparc64/qp_mul.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = (*a) * (*b)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_neg.S b/sysdeps/sparc/sparc64/qp_neg.S
index 78e9bf6994..7671a0ef49 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_neg.S
+++ b/sysdeps/sparc/sparc64/qp_neg.S
@@ -1,6 +1,6 @@
/* Quad floating-point emulation.
(*c) = !(*a)
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtod.c b/sysdeps/sparc/sparc64/qp_qtod.c
index 1e77bdda0e..c0f0e5370e 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_qtod.c
+++ b/sysdeps/sparc/sparc64/qp_qtod.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (double)(*a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c b/sysdeps/sparc/sparc64/qp_qtoi.c
index 1761dd0b0e..ca511e9fe5 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c
+++ b/sysdeps/sparc/sparc64/qp_qtoi.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (int)(*a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtos.c b/sysdeps/sparc/sparc64/qp_qtos.c
index 1f6853c45a..f78e15aca3 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_qtos.c
+++ b/sysdeps/sparc/sparc64/qp_qtos.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (float)(*a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c b/sysdeps/sparc/sparc64/qp_qtoui.c
index 680d8e674f..3822dbd469 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c
+++ b/sysdeps/sparc/sparc64/qp_qtoui.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (unsigned int)(*a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c b/sysdeps/sparc/sparc64/qp_qtoux.c
index 72ddc455bb..d51192a17c 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c
+++ b/sysdeps/sparc/sparc64/qp_qtoux.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (unsigned long)(*a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtox.c b/sysdeps/sparc/sparc64/qp_qtox.c
index cd25f0c836..50f1057a9b 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_qtox.c
+++ b/sysdeps/sparc/sparc64/qp_qtox.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Return (long)(*a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_sqrt.c b/sysdeps/sparc/sparc64/qp_sqrt.c
index 36a41d0985..1b986392cb 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_sqrt.c
+++ b/sysdeps/sparc/sparc64/qp_sqrt.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = sqrtl(*a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_stoq.c b/sysdeps/sparc/sparc64/qp_stoq.c
index 581da8eeee..88e5620b63 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_stoq.c
+++ b/sysdeps/sparc/sparc64/qp_stoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = (long double)(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_sub.c b/sysdeps/sparc/sparc64/qp_sub.c
index 0ffe2ab6d1..e400c63d33 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_sub.c
+++ b/sysdeps/sparc/sparc64/qp_sub.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = (*a) - (*b)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c b/sysdeps/sparc/sparc64/qp_uitoq.c
index bf4706efd8..0d43555c82 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c
+++ b/sysdeps/sparc/sparc64/qp_uitoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = (long double)(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_util.c b/sysdeps/sparc/sparc64/qp_util.c
index 02ed3508c9..fc9edf2153 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_util.c
+++ b/sysdeps/sparc/sparc64/qp_util.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Helper routine for _Qp_* routines.
Simulate exceptions using double arithmetics.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c b/sysdeps/sparc/sparc64/qp_uxtoq.c
index eaef32b812..ed2a8985d6 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c
+++ b/sysdeps/sparc/sparc64/qp_uxtoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = (long double)(a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c b/sysdeps/sparc/sparc64/qp_xtoq.c
index 952262e2cc..fe3e8e764d 100644
--- a/sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c
+++ b/sysdeps/sparc/sparc64/qp_xtoq.c
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
(*c) = (long double)(*a)
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
diff --git a/sysdeps/sparc/sparc64/rawmemchr.S b/sysdeps/sparc/sparc64/rawmemchr.S
index 657361d17c..dd5e1a6c21 100644
--- a/sysdeps/sparc/sparc64/rawmemchr.S
+++ b/sysdeps/sparc/sparc64/rawmemchr.S
@@ -1,6 +1,6 @@
/* rawmemchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For SPARC v9.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>.
This version is developed using the same algorithm as the fast C
diff --git a/sysdeps/sparc/sparc64/rshift.S b/sysdeps/sparc/sparc64/rshift.S
index a41acc23d4..c00ea983b3 100644
--- a/sysdeps/sparc/sparc64/rshift.S
+++ b/sysdeps/sparc/sparc64/rshift.S
@@ -1,6 +1,6 @@
/* SPARC v9 __mpn_rshift --
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/sparc/sparc64/rtld-memmove.c b/sysdeps/sparc/sparc64/rtld-memmove.c
new file mode 100644
index 0000000000..1e73c6b442
--- /dev/null
+++ b/sysdeps/sparc/sparc64/rtld-memmove.c
@@ -0,0 +1,2 @@
+#include <string/wordcopy.c>
+#include <string/memmove.c>
diff --git a/sysdeps/sparc/sparc64/sfp-machine.h b/sysdeps/sparc/sparc64/sfp-machine.h
new file mode 100644
index 0000000000..333f1988f3
--- /dev/null
+++ b/sysdeps/sparc/sparc64/sfp-machine.h
@@ -0,0 +1,147 @@
+/* Machine-dependent software floating-point definitions.
+ Sparc64 userland (_Q_* and _Qp_*) version.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com),
+ Jakub Jelinek (jj@ultra.linux.cz) and
+ David S. Miller (davem@redhat.com).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <fpu_control.h>
+#include <fenv.h>
+#include <stdlib.h>
+
+#define _FP_W_TYPE_SIZE 64
+#define _FP_W_TYPE unsigned long
+#define _FP_WS_TYPE signed long
+#define _FP_I_TYPE long
+
+/* Helper macros for _FP_MUL_MEAT_2_120_240_double. */
+#define _FP_MUL_MEAT_SET_FE_TZ \
+do { \
+ static fpu_control_t _fetz = _FPU_RC_DOWN; \
+ _FPU_SETCW(_fetz); \
+} while (0)
+#ifndef _FP_MUL_MEAT_RESET_FE
+#define _FP_MUL_MEAT_RESET_FE _FPU_SETCW(_fcw)
+#endif
+
+#define _FP_MUL_MEAT_S(R,X,Y) \
+ _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y)
+#define _FP_MUL_MEAT_D(R,X,Y) \
+ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y) \
+ _FP_MUL_MEAT_2_120_240_double(_FP_WFRACBITS_Q,R,X,Y, \
+ _FP_MUL_MEAT_SET_FE_TZ, \
+ _FP_MUL_MEAT_RESET_FE)
+
+#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
+#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
+#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1)
+#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1
+#define _FP_NANSIGN_S 0
+#define _FP_NANSIGN_D 0
+#define _FP_NANSIGN_Q 0
+
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
+
+/* If one NaN is signaling and the other is not,
+ * we choose that one, otherwise we choose Y.
+ */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do { \
+ if ((_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs) \
+ && !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)) \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc(R,X); \
+ } \
+ else \
+ { \
+ R##_s = Y##_s; \
+ _FP_FRAC_COPY_##wc(R,Y); \
+ } \
+ R##_c = FP_CLS_NAN; \
+ } while (0)
+
+/* Obtain the current rounding mode. */
+#ifndef FP_ROUNDMODE
+#define FP_ROUNDMODE ((_fcw >> 30) & 0x3)
+#endif
+
+/* Exception flags. */
+#define FP_EX_INVALID (1 << 4)
+#define FP_EX_OVERFLOW (1 << 3)
+#define FP_EX_UNDERFLOW (1 << 2)
+#define FP_EX_DIVZERO (1 << 1)
+#define FP_EX_INEXACT (1 << 0)
+
+#define _FP_TININESS_AFTER_ROUNDING 0
+
+#define _FP_DECL_EX \
+ fpu_control_t _fcw __attribute__ ((unused)) = (FP_RND_NEAREST << 30)
+
+#define FP_INIT_ROUNDMODE \
+do { \
+ _FPU_GETCW(_fcw); \
+} while (0)
+
+#define FP_TRAPPING_EXCEPTIONS ((_fcw >> 23) & 0x1f)
+#define FP_INHIBIT_RESULTS ((_fcw >> 23) & _fex)
+
+/* Simulate exceptions using double arithmetics. */
+extern void __Qp_handle_exceptions(int exc);
+
+#define FP_HANDLE_EXCEPTIONS \
+do { \
+ if (!_fex) \
+ { \
+ /* This is the common case, so we do it inline. \
+ * We need to clear cexc bits if any. \
+ */ \
+ __asm__ __volatile__("fzero %%f62\n\t" \
+ "faddd %%f62, %%f62, %%f62" \
+ : : : "f62"); \
+ } \
+ else \
+ { \
+ __Qp_handle_exceptions (_fex); \
+ } \
+} while (0)
+
+#define QP_HANDLE_EXCEPTIONS(_a) \
+do { \
+ if ((_fcw >> 23) & _fex) \
+ { \
+ _a; \
+ } \
+ else \
+ { \
+ _fcw = (_fcw & ~0x1fL) | (_fex << 5) | _fex; \
+ _FPU_SETCW(_fcw); \
+ } \
+} while (0)
+
+#define QP_NO_EXCEPTIONS \
+ __asm ("fzero %%f62\n\t" \
+ "faddd %%f62, %%f62, %%f62" : : : "f62")
+
+#define QP_CLOBBER "memory", "f52", "f54", "f56", "f58", "f60", "f62"
+#define QP_CLOBBER_CC QP_CLOBBER , "cc"
diff --git a/sysdeps/sparc/sparc64/soft-fp/Makefile b/sysdeps/sparc/sparc64/soft-fp/Makefile
deleted file mode 100644
index 5e87aafe7b..0000000000
--- a/sysdeps/sparc/sparc64/soft-fp/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-# Software floating-point emulation.
-# Makefile for SPARC v9 ABI mandated long double utility
-# functions (_Qp_*).
-# Copyright (C) 1999-2016 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-# Contributed by Jakub Jelinek (jj@ultra.linux.cz).
-#
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License 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),soft-fp)
-sparc64-quad-routines := qp_add qp_cmp qp_cmpe qp_div qp_dtoq qp_feq qp_fge \
- qp_fgt qp_fle qp_flt qp_fne qp_itoq qp_mul qp_neg qp_qtod qp_qtoi \
- qp_qtos qp_qtoui qp_qtoux qp_qtox qp_sqrt qp_stoq qp_sub qp_uitoq \
- qp_uxtoq qp_xtoq qp_util
-sysdep_routines += $(sparc64-quad-routines)
-endif
-
-ifeq ($(subdir),math)
-CPPFLAGS += -I../soft-fp/
-endif
diff --git a/sysdeps/sparc/sparc64/soft-fp/Versions b/sysdeps/sparc/sparc64/soft-fp/Versions
deleted file mode 100644
index 9e89c3c3ef..0000000000
--- a/sysdeps/sparc/sparc64/soft-fp/Versions
+++ /dev/null
@@ -1,8 +0,0 @@
-libc {
- GLIBC_2.2 {
- _Qp_add; _Qp_cmp; _Qp_cmpe; _Qp_div; _Qp_dtoq; _Qp_feq; _Qp_fge; _Qp_fgt;
- _Qp_fle; _Qp_flt; _Qp_fne; _Qp_itoq; _Qp_mul; _Qp_neg; _Qp_qtod; _Qp_qtoi;
- _Qp_qtos; _Qp_qtoui; _Qp_qtoux; _Qp_qtox; _Qp_sqrt; _Qp_stoq; _Qp_sub;
- _Qp_uitoq; _Qp_uxtoq; _Qp_xtoq;
- }
-}
diff --git a/sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c b/sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c
deleted file mode 100644
index 9c5b8560bf..0000000000
--- a/sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Software floating-point emulation.
- ilogbl(x, exp)
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-/* ilogbl(long double x)
- * return the binary exponent of non-zero x
- * ilogbl(0) = 0x80000001
- * ilogbl(inf/NaN) = 0x7fffffff (no signal is raised)
- */
-
-#include "soft-fp.h"
-#include "quad.h"
-#include <math.h>
-
-int __ieee754_ilogbl (long double x)
-{
- FP_DECL_EX;
- FP_DECL_Q(X);
-
-/*
- FP_UNPACK_Q(X, x);
- switch (X_c)
- {
- case FP_CLS_ZERO:
- return FP_ILOGB0;
- case FP_CLS_NAN:
- case FP_CLS_INF:
- return FP_ILOGBNAN;
- default:
- return X_e;
- }
- */
- FP_UNPACK_RAW_Q(X, x);
- switch (X_e)
- {
- default:
- return X_e - _FP_EXPBIAS_Q;
- case 0:
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
- if (_FP_FRAC_ZEROP_4(X))
- return FP_ILOGB0;
- else
- {
- _FP_I_TYPE shift;
- _FP_FRAC_CLZ_4(shift, X);
- shift -= _FP_FRACXBITS_Q;
- return X_e - _FP_EXPBIAS_Q - 1 + shift;
- }
-#else
- if (_FP_FRAC_ZEROP_2(X))
- return FP_ILOGB0;
- else
- {
- _FP_I_TYPE shift;
- _FP_FRAC_CLZ_2(shift, X);
- shift -= _FP_FRACXBITS_Q;
- return X_e - _FP_EXPBIAS_Q - 1 + shift;
- }
-#endif
- case _FP_EXPBIAS_Q:
- return FP_ILOGBNAN;
- }
-}
diff --git a/sysdeps/sparc/sparc64/soft-fp/s_frexpl.c b/sysdeps/sparc/sparc64/soft-fp/s_frexpl.c
deleted file mode 100644
index 8ca974fa4c..0000000000
--- a/sysdeps/sparc/sparc64/soft-fp/s_frexpl.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Software floating-point emulation.
- frexpl(x, exp)
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-/*
- * for non-zero x
- * x = frexpl(arg,&exp);
- * return a long double fp quantity x such that 0.5 <= |x| <1.0
- * and the corresponding binary exponent "exp". That is
- * arg = x*2^exp.
- * If arg is inf, 0.0, or NaN, then frexpl(arg,&exp) returns arg
- * with *exp=0.
- */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double __frexpl(long double arg, int *exp)
-{
- FP_DECL_EX;
- FP_DECL_Q(A);
- long double r;
-
- *exp = 0;
- FP_UNPACK_Q(A, arg);
- if (A_c != FP_CLS_NORMAL)
- return arg;
- *exp = A_e + 1;
- A_e = -1;
- FP_PACK_Q(r, A);
-
- return r;
-}
-
-weak_alias (__frexpl, frexpl)
diff --git a/sysdeps/sparc/sparc64/soft-fp/s_scalblnl.c b/sysdeps/sparc/sparc64/soft-fp/s_scalblnl.c
deleted file mode 100644
index 90d273e066..0000000000
--- a/sysdeps/sparc/sparc64/soft-fp/s_scalblnl.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Software floating-point emulation.
- scalblnl(x, exp)
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-/*
- * scalblnl (long double x, long int n)
- * scalblnl(x,n) returns x* 2**n computed by exponent
- * manipulation rather than by actually performing an
- * exponentiation or a multiplication.
- */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double __scalblnl(long double arg, int exp)
-{
- FP_DECL_EX;
- FP_DECL_Q(A);
- long double r;
-
- FP_UNPACK_Q(A, arg);
- switch (A_c)
- {
- case FP_CLS_ZERO:
- return arg;
- case FP_CLS_NAN:
- case FP_CLS_INF:
- FP_HANDLE_EXCEPTIONS;
- return arg;
- }
- A_e += exp;
- FP_PACK_Q(r, A);
- FP_HANDLE_EXCEPTIONS;
-
- return r;
-}
diff --git a/sysdeps/sparc/sparc64/soft-fp/s_scalbnl.c b/sysdeps/sparc/sparc64/soft-fp/s_scalbnl.c
deleted file mode 100644
index ba62ec7e0c..0000000000
--- a/sysdeps/sparc/sparc64/soft-fp/s_scalbnl.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Software floating-point emulation.
- scalbnl(x, exp)
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-/*
- * scalbnl (long double x, int n)
- * scalbnl(x,n) returns x* 2**n computed by exponent
- * manipulation rather than by actually performing an
- * exponentiation or a multiplication.
- */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double __scalbnl(long double arg, int exp)
-{
- FP_DECL_EX;
- FP_DECL_Q(A);
- long double r;
-
- FP_UNPACK_Q(A, arg);
- switch (A_c)
- {
- case FP_CLS_ZERO:
- return arg;
- case FP_CLS_NAN:
- case FP_CLS_INF:
- FP_HANDLE_EXCEPTIONS;
- return arg;
- }
- A_e += exp;
- FP_PACK_Q(r, A);
- FP_HANDLE_EXCEPTIONS;
-
- return r;
-}
diff --git a/sysdeps/sparc/sparc64/soft-fp/sfp-machine.h b/sysdeps/sparc/sparc64/soft-fp/sfp-machine.h
deleted file mode 100644
index 72c03a03bb..0000000000
--- a/sysdeps/sparc/sparc64/soft-fp/sfp-machine.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Machine-dependent software floating-point definitions.
- Sparc64 userland (_Q_* and _Qp_*) version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com),
- Jakub Jelinek (jj@ultra.linux.cz) and
- David S. Miller (davem@redhat.com).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <fpu_control.h>
-#include <fenv.h>
-#include <stdlib.h>
-
-#define _FP_W_TYPE_SIZE 64
-#define _FP_W_TYPE unsigned long
-#define _FP_WS_TYPE signed long
-#define _FP_I_TYPE long
-
-/* Helper macros for _FP_MUL_MEAT_2_120_240_double. */
-#define _FP_MUL_MEAT_SET_FE_TZ \
-do { \
- static fpu_control_t _fetz = _FPU_RC_DOWN; \
- _FPU_SETCW(_fetz); \
-} while (0)
-#ifndef _FP_MUL_MEAT_RESET_FE
-#define _FP_MUL_MEAT_RESET_FE _FPU_SETCW(_fcw)
-#endif
-
-#define _FP_MUL_MEAT_S(R,X,Y) \
- _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y)
-#define _FP_MUL_MEAT_D(R,X,Y) \
- _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_Q(R,X,Y) \
- _FP_MUL_MEAT_2_120_240_double(_FP_WFRACBITS_Q,R,X,Y, \
- _FP_MUL_MEAT_SET_FE_TZ, \
- _FP_MUL_MEAT_RESET_FE)
-
-#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
-#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
-#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
-
-#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
-#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1)
-#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1
-#define _FP_NANSIGN_S 0
-#define _FP_NANSIGN_D 0
-#define _FP_NANSIGN_Q 0
-
-#define _FP_KEEPNANFRACP 1
-#define _FP_QNANNEGATEDP 0
-
-/* If one NaN is signaling and the other is not,
- * we choose that one, otherwise we choose Y.
- */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
- do { \
- if ((_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs) \
- && !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)) \
- { \
- R##_s = X##_s; \
- _FP_FRAC_COPY_##wc(R,X); \
- } \
- else \
- { \
- R##_s = Y##_s; \
- _FP_FRAC_COPY_##wc(R,Y); \
- } \
- R##_c = FP_CLS_NAN; \
- } while (0)
-
-/* Obtain the current rounding mode. */
-#ifndef FP_ROUNDMODE
-#define FP_ROUNDMODE ((_fcw >> 30) & 0x3)
-#endif
-
-/* Exception flags. */
-#define FP_EX_INVALID (1 << 4)
-#define FP_EX_OVERFLOW (1 << 3)
-#define FP_EX_UNDERFLOW (1 << 2)
-#define FP_EX_DIVZERO (1 << 1)
-#define FP_EX_INEXACT (1 << 0)
-
-#define _FP_TININESS_AFTER_ROUNDING 0
-
-#define _FP_DECL_EX \
- fpu_control_t _fcw __attribute__ ((unused)) = (FP_RND_NEAREST << 30)
-
-#define FP_INIT_ROUNDMODE \
-do { \
- _FPU_GETCW(_fcw); \
-} while (0)
-
-#define FP_TRAPPING_EXCEPTIONS ((_fcw >> 23) & 0x1f)
-#define FP_INHIBIT_RESULTS ((_fcw >> 23) & _fex)
-
-/* Simulate exceptions using double arithmetics. */
-extern void __Qp_handle_exceptions(int exc);
-
-#define FP_HANDLE_EXCEPTIONS \
-do { \
- if (!_fex) \
- { \
- /* This is the common case, so we do it inline. \
- * We need to clear cexc bits if any. \
- */ \
- __asm__ __volatile__("fzero %%f62\n\t" \
- "faddd %%f62, %%f62, %%f62" \
- : : : "f62"); \
- } \
- else \
- { \
- __Qp_handle_exceptions (_fex); \
- } \
-} while (0)
-
-#define QP_HANDLE_EXCEPTIONS(_a) \
-do { \
- if ((_fcw >> 23) & _fex) \
- { \
- _a; \
- } \
- else \
- { \
- _fcw = (_fcw & ~0x1fL) | (_fex << 5) | _fex; \
- _FPU_SETCW(_fcw); \
- } \
-} while (0)
-
-#define QP_NO_EXCEPTIONS \
- __asm ("fzero %%f62\n\t" \
- "faddd %%f62, %%f62, %%f62" : : : "f62")
-
-#define QP_CLOBBER "memory", "f52", "f54", "f56", "f58", "f60", "f62"
-#define QP_CLOBBER_CC QP_CLOBBER , "cc"
diff --git a/sysdeps/sparc/sparc64/start.S b/sysdeps/sparc/sparc64/start.S
index 818725d771..75ff5093dc 100644
--- a/sysdeps/sparc/sparc64/start.S
+++ b/sysdeps/sparc/sparc64/start.S
@@ -1,5 +1,5 @@
/* Startup code for elf64-sparc
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
@@ -42,7 +42,7 @@
.global _start
.type _start,#function
_start:
-#ifdef SHARED
+#ifdef PIC
SETUP_PIC_REG(l7)
#endif
@@ -58,7 +58,7 @@ _start:
add %sp, STACK_BIAS+23*8, %o2
/* Load the addresses of the user entry points. */
-#ifndef SHARED
+#ifndef PIC
sethi %hi(main), %o0
sethi %hi(__libc_csu_init), %o3
sethi %hi(__libc_csu_fini), %o4
diff --git a/sysdeps/sparc/sparc64/stpcpy.S b/sysdeps/sparc/sparc64/stpcpy.S
index 4b277e00cc..64996d6448 100644
--- a/sysdeps/sparc/sparc64/stpcpy.S
+++ b/sysdeps/sparc/sparc64/stpcpy.S
@@ -1,6 +1,6 @@
/* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For SPARC v9.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc64/stpncpy.S b/sysdeps/sparc/sparc64/stpncpy.S
index 05f5e4d66f..15eddc1315 100644
--- a/sysdeps/sparc/sparc64/stpncpy.S
+++ b/sysdeps/sparc/sparc64/stpncpy.S
@@ -2,7 +2,7 @@
SRC to DEST, returning the address of the terminating '\0' in
DEST, if any, or else DEST + N.
For SPARC v9.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>.
diff --git a/sysdeps/sparc/sparc64/strcat.S b/sysdeps/sparc/sparc64/strcat.S
index 9996907e7d..b07de53914 100644
--- a/sysdeps/sparc/sparc64/strcat.S
+++ b/sysdeps/sparc/sparc64/strcat.S
@@ -1,6 +1,6 @@
/* strcat (dest, src) -- Append SRC on the end of DEST.
For SPARC v9.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz> and
Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>.
diff --git a/sysdeps/sparc/sparc64/strchr.S b/sysdeps/sparc/sparc64/strchr.S
index 31738abdfc..c026bb2507 100644
--- a/sysdeps/sparc/sparc64/strchr.S
+++ b/sysdeps/sparc/sparc64/strchr.S
@@ -1,6 +1,6 @@
/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For SPARC v9.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc64/strcmp.S b/sysdeps/sparc/sparc64/strcmp.S
index 424d3c4cf5..ddd6337479 100644
--- a/sysdeps/sparc/sparc64/strcmp.S
+++ b/sysdeps/sparc/sparc64/strcmp.S
@@ -1,6 +1,6 @@
/* Compare two strings for differences.
For SPARC v9.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>
diff --git a/sysdeps/sparc/sparc64/strcpy.S b/sysdeps/sparc/sparc64/strcpy.S
index 7693e3bda2..aad7a77878 100644
--- a/sysdeps/sparc/sparc64/strcpy.S
+++ b/sysdeps/sparc/sparc64/strcpy.S
@@ -1,6 +1,6 @@
/* Copy SRC to DEST returning DEST.
For SPARC v9.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc64/strcspn.S b/sysdeps/sparc/sparc64/strcspn.S
index 5d8d0c872f..40996fed8d 100644
--- a/sysdeps/sparc/sparc64/strcspn.S
+++ b/sysdeps/sparc/sparc64/strcspn.S
@@ -1,7 +1,7 @@
/* strcspn (str, ss) -- Return the length of the initial segment of STR
which contains no characters from SS.
For SPARC v9.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
diff --git a/sysdeps/sparc/sparc64/strlen.S b/sysdeps/sparc/sparc64/strlen.S
index 23f11cc3a4..f843139e55 100644
--- a/sysdeps/sparc/sparc64/strlen.S
+++ b/sysdeps/sparc/sparc64/strlen.S
@@ -1,5 +1,5 @@
/* Determine the length of a string. For SPARC v9.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>,
Jakub Jelinek <jj@ultra.linux.cz>, and
diff --git a/sysdeps/sparc/sparc64/strncmp.S b/sysdeps/sparc/sparc64/strncmp.S
index 0acb5769ec..924190bf2d 100644
--- a/sysdeps/sparc/sparc64/strncmp.S
+++ b/sysdeps/sparc/sparc64/strncmp.S
@@ -2,7 +2,7 @@
equal to or greater than zero if S1 is lexicographically less than,
equal to or greater than S2.
For SPARC v9.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc64/strncpy.S b/sysdeps/sparc/sparc64/strncpy.S
index 7469031255..a59671c037 100644
--- a/sysdeps/sparc/sparc64/strncpy.S
+++ b/sysdeps/sparc/sparc64/strncpy.S
@@ -2,7 +2,7 @@
null-terminated string from SRC to DST. If SRC does not cover all of
COUNT, the balance is zeroed.
For SPARC v9.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/sparc/sparc64/strpbrk.S b/sysdeps/sparc/sparc64/strpbrk.S
index f04507d034..4b26566c9f 100644
--- a/sysdeps/sparc/sparc64/strpbrk.S
+++ b/sysdeps/sparc/sparc64/strpbrk.S
@@ -1,7 +1,7 @@
/* strpbrk (s, accept) -- Find the first occurrence in S of any character in
ACCEPT.
For SPARC v9.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
diff --git a/sysdeps/sparc/sparc64/strspn.S b/sysdeps/sparc/sparc64/strspn.S
index 7fe8e5487a..2a028aa135 100644
--- a/sysdeps/sparc/sparc64/strspn.S
+++ b/sysdeps/sparc/sparc64/strspn.S
@@ -1,7 +1,7 @@
/* strspn (str, ss) -- Return the length of the maximum initial segment
of S which contains only characters in ACCEPT.
For SPARC v9.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
diff --git a/sysdeps/sparc/sparc64/sub_n.S b/sysdeps/sparc/sparc64/sub_n.S
index ca5b666e29..2c8eca17a0 100644
--- a/sysdeps/sparc/sparc64/sub_n.S
+++ b/sysdeps/sparc/sparc64/sub_n.S
@@ -1,7 +1,7 @@
/* SPARC v9 __mpn_sub_n -- Subtract two limb vectors of the same length > 0
and store difference in a third limb vector.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/sparc/sparc64/submul_1.S b/sysdeps/sparc/sparc64/submul_1.S
index da71caadd2..490988303d 100644
--- a/sysdeps/sparc/sparc64/submul_1.S
+++ b/sysdeps/sparc/sparc64/submul_1.S
@@ -1,7 +1,7 @@
/* SPARC v9 __mpn_submul_1 -- Multiply a limb vector with a single limb and
subtract the product from a second limb vector.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/sparc/sparc64/tst-audit.h b/sysdeps/sparc/sparc64/tst-audit.h
index 73b1393ebe..315094d039 100644
--- a/sysdeps/sparc/sparc64/tst-audit.h
+++ b/sysdeps/sparc/sparc64/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. SPARC64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/sparc/stackinfo.h b/sysdeps/sparc/stackinfo.h
index 707ccd6b68..f75adfb5f7 100644
--- a/sysdeps/sparc/stackinfo.h
+++ b/sysdeps/sparc/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sysdep.h b/sysdeps/sparc/sysdep.h
index 8c7e4e0cca..487852c7ec 100644
--- a/sysdeps/sparc/sysdep.h
+++ b/sysdeps/sparc/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/tile/Implies b/sysdeps/tile/Implies
deleted file mode 100644
index 5b29b26128..0000000000
--- a/sysdeps/tile/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-ieee754/dbl-64
-ieee754/flt-32
diff --git a/sysdeps/tile/Makefile b/sysdeps/tile/Makefile
deleted file mode 100644
index 3cd4d1e752..0000000000
--- a/sysdeps/tile/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# We don't support long doubles as a distinct type. We don't need to set
-# this variable; it's here mostly for documentational purposes.
-
-long-double-fcts = no
-
-ifeq ($(subdir),gmon)
-sysdep_routines += _mcount
-endif
-
-ifeq ($(subdir),elf)
-# Extra shared linker files to link only into dl-allobjs.so.
-sysdep-rtld-routines += dl-start __tls_get_addr
-endif
diff --git a/sysdeps/tile/Versions b/sysdeps/tile/Versions
deleted file mode 100644
index b275d7ff3b..0000000000
--- a/sysdeps/tile/Versions
+++ /dev/null
@@ -1,6 +0,0 @@
-libc {
- GLIBC_2.12 {
- # name requested by gcc community.
- __mcount;
- }
-}
diff --git a/sysdeps/tile/__longjmp.S b/sysdeps/tile/__longjmp.S
deleted file mode 100644
index dd2f0c1a4e..0000000000
--- a/sysdeps/tile/__longjmp.S
+++ /dev/null
@@ -1,57 +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 <sysdep.h>
-#include <jmpbuf-offsets.h>
-#include <asm-syntax.h>
-#include <arch/spr_def.h>
-
-/* PL to return to via iret in longjmp */
-#define RETURN_PL 0
-
- .text
-ENTRY (__longjmp)
- FEEDBACK_ENTER(__longjmp)
-
-#define RESTORE(r) { LD r, r0 ; ADDI_PTR r0, r0, REGSIZE }
- FOR_EACH_CALLEE_SAVED_REG(RESTORE)
-
- /* Make longjmp(buf, 0) return "1" instead.
- At the same time, construct our iret context; we set ICS so
- we can validly load EX_CONTEXT for iret without being
- interrupted halfway through. */
- {
- LD r2, r0 /* retrieve ICS bit from jmp_buf */
- movei r3, 1
- CMPEQI r0, r1, 0
- }
- {
- mtspr INTERRUPT_CRITICAL_SECTION, r3
- shli r2, r2, SPR_EX_CONTEXT_0_1__ICS_SHIFT
- }
- {
- mtspr EX_CONTEXT_0_0, lr
- ori r2, r2, RETURN_PL
- }
- {
- or r0, r1, r0
- mtspr EX_CONTEXT_0_1, r2
- }
- iret
- jrp lr /* Keep the backtracer happy. */
-END (__longjmp)
diff --git a/sysdeps/tile/__tls_get_addr.S b/sysdeps/tile/__tls_get_addr.S
deleted file mode 100644
index 089dccfeaa..0000000000
--- a/sysdeps/tile/__tls_get_addr.S
+++ /dev/null
@@ -1,152 +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 <sysdep.h>
-#include <tls.h>
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-#define LOG_SIZEOF_DTV_T 4
-#else
-#define LOG_SIZEOF_DTV_T 3
-#endif
-
-/* On entry, r0 points to two words, the module and the offset.
- On return, r0 holds the pointer to the relevant TLS memory.
- Only registers r25..r29 are clobbered by the call. */
-
- .text
-ENTRY (__tls_get_addr)
- {
- lnk r25
- ADDI_PTR r27, tp, DTV_OFFSET
- }
-.Llnk:
-#ifdef __tilegx__
- {
- LD_PTR r27, r27 /* r27 = THREAD_DTV() */
- moveli r26, hw1_last(_rtld_local + TLS_GENERATION_OFFSET - .Llnk)
- }
- shl16insli r26, r26, hw0(_rtld_local + TLS_GENERATION_OFFSET - .Llnk)
- {
- ADD_PTR r25, r25, r26
- LD_PTR r26, r0 /* r26 = ti_module */
- }
-#else
- {
- LD_PTR r27, r27 /* r27 = THREAD_DTV() */
- addli r25, r25, lo16(_rtld_local + TLS_GENERATION_OFFSET - .Llnk)
- }
- {
- auli r25, r25, ha16(_rtld_local + TLS_GENERATION_OFFSET - .Llnk)
- LD_PTR r26, r0 /* r26 = ti_module */
- }
-#endif
- LD_PTR r25, r25 /* r25 = DL(dl_tls_generation) */
- {
- LD_PTR r28, r27 /* r28 = THREAD_DTV()->counter */
- ADDI_PTR r29, r0, __SIZEOF_POINTER__
- }
- {
- LD_PTR r29, r29 /* r29 = ti_offset */
- CMPEQ r25, r28, r25 /* r25 nonzero if generation OK */
- shli r28, r26, LOG_SIZEOF_DTV_T /* byte index into dtv array */
- }
- {
- BEQZ r25, .Lslowpath
- CMPEQI r25, r26, -1 /* r25 nonzero if ti_module invalid */
- }
- {
- BNEZ r25, .Lslowpath
- ADD_PTR r28, r28, r27 /* pointer into module array */
- }
- LD_PTR r26, r28 /* r26 = module TLS pointer */
- CMPEQI r25, r26, -1 /* check r26 == TLS_DTV_UNALLOCATED */
- BNEZ r25, .Lslowpath
- {
- ADD_PTR r0, r26, r29
- jrp lr
- }
-
-.Lslowpath:
- {
- ST sp, lr
- ADDLI_PTR r29, sp, - (25 * REGSIZE)
- }
- cfi_offset (lr, 0)
- {
- ST r29, sp
- ADDLI_PTR sp, sp, - (26 * REGSIZE)
- }
- cfi_def_cfa_offset (26 * REGSIZE)
- ADDI_PTR r29, sp, (2 * REGSIZE)
- { ST r29, r1; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r2; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r3; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r4; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r5; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r6; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r7; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r8; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r9; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r10; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r11; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r12; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r13; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r14; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r15; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r16; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r17; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r18; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r19; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r20; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r21; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r22; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r23; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r24; ADDI_PTR r29, r29, REGSIZE }
- .hidden __tls_get_addr_slow
- jal __tls_get_addr_slow
- ADDI_PTR r29, sp, (2 * REGSIZE)
- { LD r1, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r2, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r3, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r4, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r5, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r6, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r7, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r8, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r9, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r10, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r11, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r12, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r13, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r14, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r15, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r16, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r17, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r18, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r19, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r20, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r21, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r22, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r23, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r24, r29; ADDLI_PTR sp, sp, (26 * REGSIZE) }
- cfi_def_cfa_offset (0)
- LD lr, sp
- jrp lr
-END (__tls_get_addr)
diff --git a/sysdeps/tile/_mcount.S b/sysdeps/tile/_mcount.S
deleted file mode 100644
index c784a4e3b8..0000000000
--- a/sysdeps/tile/_mcount.S
+++ /dev/null
@@ -1,87 +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.
- Based on work contributed by David Mosberger (davidm@cs.arizona.edu).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <http://www.gnu.org/licenses/>. */
-
-/* Assembly stub to invoke __mcount_internal(). Compiler-generated
- code calls mcount after executing a function's prologue, placing
- the "lr" register in "r10" for the call. As a result "lr" is the
- function that invoked mcount, and "r10" is mcount's caller's
- caller. However, we have to save all the parameter registers here
- before invoking _mcount_internal. Callee-save and temporary
- registers need no special attention. We save r10 and restore it to
- lr on the way out, to properly handle the case of ENTRY() in
- assembly code, before lr is saved. We use the name __mcount since
- the gcc community prefers using the reserved namespace. */
-
-#include <sysdep.h>
-
- .text
-ENTRY(__mcount)
- {
- ST sp, lr
- ADDI_PTR r29, sp, - (12 * REGSIZE)
- }
- cfi_offset (lr, 0)
- {
- ADDI_PTR sp, sp, - (13 * REGSIZE)
- ST r29, sp
- ADDI_PTR r29, r29, REGSIZE
- }
- cfi_def_cfa_offset (13 * REGSIZE)
- { ST r29, r0; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r1; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r2; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r3; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r4; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r5; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r6; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r7; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r8; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r9; ADDI_PTR r29, r29, REGSIZE }
- { ST r29, r10; ADDI_PTR r29, r29, REGSIZE; move r0, r10 }
- {
- move r1, lr
- jal __mcount_internal
- }
- {
- ADDI_PTR r29, sp, (2 * REGSIZE)
- }
- { LD r0, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r1, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r2, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r3, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r4, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r5, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r6, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r7, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r8, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r9, r29; ADDI_PTR r29, r29, REGSIZE }
- { LD r10, r29; ADDI_PTR sp, sp, (13 * REGSIZE) }
- cfi_def_cfa_offset (0)
- {
- LD lr, sp
- }
- {
- move lr, r10
- jrp lr
- }
-END(__mcount)
-
-#undef mcount
-weak_alias (__mcount, _mcount) /* exported in gmon/Versions */
-weak_alias (__mcount, mcount) /* exported in stdlib/Versions */
diff --git a/sysdeps/tile/abort-instr.h b/sysdeps/tile/abort-instr.h
deleted file mode 100644
index 0f57da5198..0000000000
--- a/sysdeps/tile/abort-instr.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* An instruction which should crash any program is `hlt'. */
-#define ABORT_INSTRUCTION asm ("ill")
diff --git a/sysdeps/tile/atomic-machine.h b/sysdeps/tile/atomic-machine.h
deleted file mode 100644
index 651e0d930a..0000000000
--- a/sysdeps/tile/atomic-machine.h
+++ /dev/null
@@ -1,86 +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/>. */
-
-/* The sub-architecture headers provide definitions for these macros
- that work for "int" and "long" size values only:
-
- atomic_compare_and_exchange_val_acq()
- atomic_exchange_acq()
- atomic_exchange_and_add()
- atomic_and_val()
- atomic_or_val()
- atomic_decrement_if_positive() [tilegx only]
-
- Here we provide generic definitions true for all Tilera chips. */
-
-#include <stdint.h>
-#include <features.h>
-
-typedef int32_t atomic32_t;
-typedef uint32_t uatomic32_t;
-typedef int_fast32_t atomic_fast32_t;
-typedef uint_fast32_t uatomic_fast32_t;
-
-typedef int64_t atomic64_t;
-typedef uint64_t uatomic64_t;
-typedef int_fast64_t atomic_fast64_t;
-typedef uint_fast64_t uatomic_fast64_t;
-
-typedef intptr_t atomicptr_t;
-typedef uintptr_t uatomicptr_t;
-typedef intmax_t atomic_max_t;
-typedef uintmax_t uatomic_max_t;
-
-/* Barrier macro. */
-#define atomic_full_barrier() __sync_synchronize()
-
-/* APIs with "release" semantics. */
-#define atomic_compare_and_exchange_val_rel(mem, n, o) \
- ({ \
- atomic_full_barrier (); \
- atomic_compare_and_exchange_val_acq ((mem), (n), (o)); \
- })
-#define atomic_compare_and_exchange_bool_rel(mem, n, o) \
- ({ \
- atomic_full_barrier (); \
- atomic_compare_and_exchange_bool_acq ((mem), (n), (o)); \
- })
-#define atomic_exchange_rel(mem, n) \
- ({ \
- atomic_full_barrier (); \
- atomic_exchange_acq ((mem), (n)); \
- })
-
-/* Various macros that should just be synonyms. */
-#define catomic_exchange_and_add atomic_exchange_and_add
-#define atomic_and(mem, mask) ((void) atomic_and_val ((mem), (mask)))
-#define catomic_and atomic_and
-#define atomic_or(mem, mask) ((void) atomic_or_val ((mem), (mask)))
-#define catomic_or atomic_or
-
-/* atomic_bit_test_set in terms of atomic_or_val. */
-#define atomic_bit_test_set(mem, bit) \
- ({ __typeof (*(mem)) __att0_mask = ((__typeof (*(mem))) 1 << (bit)); \
- atomic_or_val ((mem), __att0_mask) & __att0_mask; })
-
-/*
- * This non-existent symbol is called for unsupporrted sizes,
- * indicating a bug in the caller.
- */
-extern int __atomic_error_bad_argument_size(void)
- __attribute__ ((warning ("bad sizeof atomic argument")));
diff --git a/sysdeps/tile/backtrace.c b/sysdeps/tile/backtrace.c
deleted file mode 100644
index 27ce597b39..0000000000
--- a/sysdeps/tile/backtrace.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/x86_64/backtrace.c>
diff --git a/sysdeps/tile/bits/byteswap.h b/sysdeps/tile/bits/byteswap.h
deleted file mode 100644
index 819446af90..0000000000
--- a/sysdeps/tile/bits/byteswap.h
+++ /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/>. */
-
-#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
-# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
-#endif
-
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H 1
-
-#include <bits/types.h>
-
-/* gcc __builtin_bswap64() can constant-fold, etc, so always use it. */
-#define __bswap_16(x) ((unsigned short)(__builtin_bswap32(x) >> 16))
-#define __bswap_32(x) ((unsigned int)__builtin_bswap32(x))
-#define __bswap_64(x) ((__uint64_t)__builtin_bswap64(x))
-
-#define __bswap_constant_16(x) __bswap_16(x)
-#define __bswap_constant_32(x) __bswap_32(x)
-#define __bswap_constant_64(x) __bswap_64(x)
-
-#endif /* _BITS_BYTESWAP_H */
diff --git a/sysdeps/tile/bits/endian.h b/sysdeps/tile/bits/endian.h
deleted file mode 100644
index 835042a7ac..0000000000
--- a/sysdeps/tile/bits/endian.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Set endianness for tile. */
-
-#ifndef _ENDIAN_H
-# error "Never use <bits/endian.h> directly; include <endian.h> instead."
-#endif
-
-#if defined __BIG_ENDIAN__
-# define __BYTE_ORDER __BIG_ENDIAN
-#else
-# define __BYTE_ORDER __LITTLE_ENDIAN
-#endif
diff --git a/sysdeps/tile/bits/fenv.h b/sysdeps/tile/bits/fenv.h
deleted file mode 100644
index a87a39fc28..0000000000
--- a/sysdeps/tile/bits/fenv.h
+++ /dev/null
@@ -1,45 +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/>. */
-
-#ifndef _FENV_H
-# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
-#endif
-
-/* The TILE-Gx hardware does not provide floating-point exception
- handling, and TILEPro does not support any floating-point operations. */
-#define FE_ALL_EXCEPT 0
-
-/* TILE-Gx supports only round-to-nearest. The software
- floating-point support also acts this way. */
-enum
- {
- __FE_UNDEFINED = 0,
-
- FE_TONEAREST =
-#define FE_TONEAREST 1
- FE_TONEAREST,
- };
-
-/* Type representing exception flags (if there were any). */
-typedef unsigned int fexcept_t;
-
-/* Type representing floating-point environment. */
-typedef unsigned int fenv_t;
-
-/* If the default argument is used we use this value. */
-#define FE_DFL_ENV ((const fenv_t *) -1l)
diff --git a/sysdeps/tile/bits/link.h b/sysdeps/tile/bits/link.h
deleted file mode 100644
index a27fc06349..0000000000
--- a/sysdeps/tile/bits/link.h
+++ /dev/null
@@ -1,57 +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/>. */
-
-#ifndef _LINK_H
-# error "Never include <bits/link.h> directly; use <link.h> instead."
-#endif
-
-#define __need_int_reg_t
-#include <arch/abi.h>
-
-
-/* Registers for entry into PLT. */
-typedef struct La_tile_regs
-{
- __uint_reg_t lr_reg[10];
-} La_tile_regs;
-
-/* Return values for calls from PLT. */
-typedef struct La_tile_retval
-{
- /* Up to ten registers can be used for a return value (e.g. small struct). */
- __uint_reg_t lrv_reg[10];
-} La_tile_retval;
-
-
-__BEGIN_DECLS
-
-extern ElfW(Addr) la_tile_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx,
- uintptr_t *__refcook,
- uintptr_t *__defcook,
- La_tile_regs *__regs,
- unsigned int *__flags,
- const char *__symname,
- long int *__framesizep);
-extern unsigned int la_tile_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx,
- uintptr_t *__refcook,
- uintptr_t *__defcook,
- const La_tile_regs *__inregs,
- La_tile_retval *__outregs,
- const char *__symname);
-
-__END_DECLS
diff --git a/sysdeps/tile/bits/mathdef.h b/sysdeps/tile/bits/mathdef.h
deleted file mode 100644
index 2db81b46ea..0000000000
--- a/sysdeps/tile/bits/mathdef.h
+++ /dev/null
@@ -1,54 +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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* "float" and "double" expressions evaluated as "float" and "double". */
-typedef float float_t;
-typedef double double_t;
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647)
-# define FP_ILOGBNAN (2147483647)
-
-/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l}
- builtins are supported. */
-# ifdef __FP_FAST_FMA
-# define FP_FAST_FMA 1
-# endif
-
-# ifdef __FP_FAST_FMAF
-# define FP_FAST_FMAF 1
-# endif
-
-# ifdef __FP_FAST_FMAL
-# define FP_FAST_FMAL 1
-# endif
-
-#endif /* ISO C99 */
-
-#ifndef __NO_LONG_DOUBLE_MATH
-/* Signal that we do not really have a `long double'. This disables the
- declaration of all the `long double' function variants. */
-# define __NO_LONG_DOUBLE_MATH 1
-#endif
diff --git a/sysdeps/tile/bits/mathinline.h b/sysdeps/tile/bits/mathinline.h
deleted file mode 100644
index 20a89a193e..0000000000
--- a/sysdeps/tile/bits/mathinline.h
+++ /dev/null
@@ -1,44 +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/>. */
-
-#ifndef _MATH_H
-# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_always_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_always_inline
-#endif
-
-
-#if defined __USE_ISOC99 && defined __GNUC__
-
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
- return __builtin_signbitf (__x);
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
- return __builtin_signbit (__x);
-}
-
-#endif
diff --git a/sysdeps/tile/bits/setjmp.h b/sysdeps/tile/bits/setjmp.h
deleted file mode 100644
index 5af986ba8d..0000000000
--- a/sysdeps/tile/bits/setjmp.h
+++ /dev/null
@@ -1,36 +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/>. */
-
-/* Define the machine-dependent type `jmp_buf'. TILE version. */
-#ifndef _BITS_SETJMP_H
-#define _BITS_SETJMP_H 1
-
-#if !defined _SETJMP_H && !defined _PTHREAD_H
-# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
-#endif
-
-#ifndef _ASM
-
-#define __need_int_reg_t
-#include <arch/abi.h>
-
-typedef __uint_reg_t __jmp_buf[32];
-
-#endif
-
-#endif /* bits/setjmp.h */
diff --git a/sysdeps/tile/bsd-_setjmp.S b/sysdeps/tile/bsd-_setjmp.S
deleted file mode 100644
index 4e6a2da560..0000000000
--- a/sysdeps/tile/bsd-_setjmp.S
+++ /dev/null
@@ -1 +0,0 @@
-/* _setjmp is in setjmp.S */
diff --git a/sysdeps/tile/bsd-setjmp.S b/sysdeps/tile/bsd-setjmp.S
deleted file mode 100644
index 1da848d2f1..0000000000
--- a/sysdeps/tile/bsd-setjmp.S
+++ /dev/null
@@ -1 +0,0 @@
-/* setjmp is in setjmp.S */
diff --git a/sysdeps/tile/bzero.S b/sysdeps/tile/bzero.S
deleted file mode 100644
index f49a8170ba..0000000000
--- a/sysdeps/tile/bzero.S
+++ /dev/null
@@ -1,30 +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 <sysdep.h>
-
- .text
-ENTRY(__bzero)
- FEEDBACK_ENTER(__bzero)
- {
- move r2, r1
- move r1, zero
- }
- j __memset
-END(__bzero)
-weak_alias (__bzero, bzero)
diff --git a/sysdeps/tile/configure b/sysdeps/tile/configure
deleted file mode 100644
index 534c7dbc5d..0000000000
--- a/sysdeps/tile/configure
+++ /dev/null
@@ -1,7 +0,0 @@
-# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
- # Local configure fragment for sysdeps/tile.
-
-# We can always access static and hidden symbols in a position independent way.
-$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
-
-# work around problem with autoconf and empty lines at the end of files
diff --git a/sysdeps/tile/configure.ac b/sysdeps/tile/configure.ac
deleted file mode 100644
index 6e246a3bc9..0000000000
--- a/sysdeps/tile/configure.ac
+++ /dev/null
@@ -1,6 +0,0 @@
-GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
-# Local configure fragment for sysdeps/tile.
-
-# We can always access static and hidden symbols in a position independent way.
-AC_DEFINE(PI_STATIC_AND_HIDDEN)
-# work around problem with autoconf and empty lines at the end of files
diff --git a/sysdeps/tile/crti.S b/sysdeps/tile/crti.S
deleted file mode 100644
index 7f77d5dba2..0000000000
--- a/sysdeps/tile/crti.S
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Special .init and .fini section support for tile.
- 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.
-
- In addition to the permissions in the GNU Lesser General Public
- License, the Free Software Foundation gives you unlimited
- permission to link the compiled version of this file with other
- programs, and to distribute those programs without any restriction
- coming from the use of this file. (The GNU Lesser General Public
- License restrictions do apply in other respects; for example, they
- cover modification of the file, and distribution when not linked
- into another program.)
-
- Note that people who make modified versions of this file are not
- obligated to grant this special exception for their modified
- versions; it is their choice whether to do so. The GNU Lesser
- General Public License gives permission to release a modified
- version without this exception; this exception also makes it
- possible to release a modified version which carries forward this
- exception.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-/* crti.S puts a function prologue at the beginning of the .init and
- .fini sections and defines global symbols for those addresses, so
- they can be called as functions. The symbols _init and _fini are
- magic and cause the linker to emit DT_INIT and DT_FINI. */
-
-#include <libc-symbols.h>
-#include <sysdep.h>
-
-#ifndef PREINIT_FUNCTION
-# define PREINIT_FUNCTION __gmon_start__
-#endif
-
-#ifndef PREINIT_FUNCTION_WEAK
-# define PREINIT_FUNCTION_WEAK 1
-#endif
-
-#if PREINIT_FUNCTION_WEAK
- weak_extern (PREINIT_FUNCTION)
-#else
- .hidden PREINIT_FUNCTION
-#endif
-
- .section .init,"ax",@progbits
- .align 8
- .globl _init
- .type _init, @function
-_init:
- {
- move r29, sp
- ADDI_PTR r28, sp, -REGSIZE
- ST sp, lr
- }
- ADDI_PTR sp, sp, -(2 * REGSIZE)
- ST r28, r29
-#if PREINIT_FUNCTION_WEAK
- lnk r2
-0:
-# ifdef __tilegx__
- moveli r1, hw2_last(_GLOBAL_OFFSET_TABLE_ - 0b)
- {
- shl16insli r1, r1, hw1(_GLOBAL_OFFSET_TABLE_ - 0b)
- moveli r0, hw1_last_got(PREINIT_FUNCTION)
- }
- {
- shl16insli r1, r1, hw0(_GLOBAL_OFFSET_TABLE_ - 0b)
- shl16insli r0, r0, hw0_got(PREINIT_FUNCTION)
- }
-# else
- {
- moveli r1, lo16(_GLOBAL_OFFSET_TABLE_ - 0b)
- moveli r0, got_lo16(PREINIT_FUNCTION)
- }
- {
- auli r1, r1, ha16(_GLOBAL_OFFSET_TABLE_ - 0b)
- auli r0, r0, got_ha16(PREINIT_FUNCTION)
- }
-# endif
- ADD_PTR r0, r0, r1
- ADD_PTR r0, r0, r2
- LD_PTR r0, r0
- BEQZ r0, .Lno_weak_fn
- jalr r0
-#elif defined(__tilegx__) && !defined(NO_PLT_PCREL)
- /* Since we are calling from the start of the object to the PLT,
- call by loading the full address into a register. */
- lnk r2
-0:
- moveli r0, hw2_last_plt(PREINIT_FUNCTION - 0b)
- shl16insli r0, r0, hw1_plt(PREINIT_FUNCTION - 0b)
- shl16insli r0, r0, hw0_plt(PREINIT_FUNCTION - 0b)
- add r0, r0, r2
- jalr r0
-#else
- jal plt(PREINIT_FUNCTION)
-#endif
-.Lno_weak_fn:
-
- .section .fini,"ax",@progbits
- .align 8
- .globl _fini
- .type _fini, @function
-_fini:
- {
- move r29, sp
- ADDI_PTR r28, sp, -REGSIZE
- ST sp, lr
- }
- ADDI_PTR sp, sp, -(2 * REGSIZE)
- ST r28, r29
diff --git a/sysdeps/tile/crtn.S b/sysdeps/tile/crtn.S
deleted file mode 100644
index 69d60875ce..0000000000
--- a/sysdeps/tile/crtn.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Special .init and .fini section support for tile.
- 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.
-
- In addition to the permissions in the GNU Lesser General Public
- License, the Free Software Foundation gives you unlimited
- permission to link the compiled version of this file with other
- programs, and to distribute those programs without any restriction
- coming from the use of this file. (The GNU Lesser General Public
- License restrictions do apply in other respects; for example, they
- cover modification of the file, and distribution when not linked
- into another program.)
-
- Note that people who make modified versions of this file are not
- obligated to grant this special exception for their modified
- versions; it is their choice whether to do so. The GNU Lesser
- General Public License gives permission to release a modified
- version without this exception; this exception also makes it
- possible to release a modified version which carries forward this
- exception.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-/* crtn.S puts function epilogues in the .init and .fini sections
- corresponding to the prologues in crti.S. */
-
-#include <sysdep.h>
-
- .section .init,"ax",@progbits
- ADDI_PTR r29, sp, (2 * REGSIZE)
- {
- ADDI_PTR sp, sp, (2 * REGSIZE)
- LD lr, r29
- }
- jrp lr
-
- .section .fini,"ax",@progbits
- ADDI_PTR r29, sp, (2 * REGSIZE)
- {
- ADDI_PTR sp, sp, (2 * REGSIZE)
- LD lr, r29
- }
- jrp lr
diff --git a/sysdeps/tile/dl-lookupcfg.h b/sysdeps/tile/dl-lookupcfg.h
deleted file mode 100644
index 8a472b82a3..0000000000
--- a/sysdeps/tile/dl-lookupcfg.h
+++ /dev/null
@@ -1,27 +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/>. */
-
-#define DL_UNMAP_IS_SPECIAL
-
-#include_next <dl-lookupcfg.h>
-
-struct link_map;
-
-void internal_function _dl_unmap (struct link_map *map);
-
-#define DL_UNMAP(map) _dl_unmap (map)
diff --git a/sysdeps/tile/dl-machine.h b/sysdeps/tile/dl-machine.h
deleted file mode 100644
index e0946e1edb..0000000000
--- a/sysdeps/tile/dl-machine.h
+++ /dev/null
@@ -1,919 +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.
- Based on work contributed by by Carl Pederson & Martin Schwidefsky.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 dl_machine_h
-#define dl_machine_h
-
-#ifdef __tilegx__
-#define ELF_MACHINE_NAME "tilegx"
-#else
-#define ELF_MACHINE_NAME "tilepro"
-#endif
-
-#include <sys/param.h>
-#include <string.h>
-#include <link.h>
-#include <bits/wordsize.h>
-#include <arch/icache.h>
-#include <arch/opcode.h>
-
-/* Return nonzero iff ELF header is compatible with the running host. */
-static inline int
-elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
-{
-#if defined __tilegx__
- if (ehdr->e_machine != EM_TILEGX)
- return 0;
-# if __WORDSIZE == 32
- return (ehdr->e_ident[EI_CLASS] == ELFCLASS32);
-# else
- return (ehdr->e_ident[EI_CLASS] == ELFCLASS64);
-# endif
-#elif defined __tilepro__
- return ehdr->e_machine == EM_TILEPRO;
-#else
-# error "Unknown tile architecture."
-#endif
-}
-
-
-/* Return the link-time address of _DYNAMIC. Conveniently, this is the
- first element of the GOT. This must be inlined in a function which
- uses global data. */
-
-static inline ElfW(Addr)
-elf_machine_dynamic (void)
-{
- ElfW(Addr) *got;
-
-#ifdef __tilegx__
- ElfW(Addr) tmp;
- asm( " { lnk %0; moveli %1, hw2_last(_GLOBAL_OFFSET_TABLE_ - 1f) }\n"
- "1: shl16insli %1, %1, hw1(_GLOBAL_OFFSET_TABLE_ - 1b)\n"
- " shl16insli %1, %1, hw0(_GLOBAL_OFFSET_TABLE_ - 1b)\n"
- " add %0, %0, %1"
- : "=r" (got), "=r" (tmp));
-#else
- asm( " lnk %0\n"
- "1: addli %0, %0, lo16(_GLOBAL_OFFSET_TABLE_ - 1b)\n"
- " auli %0, %0, ha16(_GLOBAL_OFFSET_TABLE_ - 1b)"
- : "=r" (got));
-#endif
-
- return *got;
-}
-
-
-/* Return the run-time load address of the shared object. */
-static inline ElfW(Addr)
-elf_machine_load_address (void)
-{
- ElfW(Addr) *got;
- ElfW(Addr) dynamic;
-
-#ifdef __tilegx__
- ElfW(Addr) tmp;
- asm( " lnk %2\n"
- "1: {\n"
- " moveli %0, hw2_last(_GLOBAL_OFFSET_TABLE_ - 1b)\n"
- " moveli %1, hw2_last(_DYNAMIC - 1b)\n"
- " }\n"
- " {\n"
- " shl16insli %0, %0, hw1(_GLOBAL_OFFSET_TABLE_ - 1b)\n"
- " shl16insli %1, %1, hw1(_DYNAMIC - 1b)\n"
- " }\n"
- " {\n"
- " shl16insli %0, %0, hw0(_GLOBAL_OFFSET_TABLE_ - 1b)\n"
- " shl16insli %1, %1, hw0(_DYNAMIC - 1b)\n"
- " }\n"
- " {\n"
- " add %0, %0, %2\n"
- " add %1, %1, %2\n"
- " }"
- : "=r" (got), "=r" (dynamic), "=r" (tmp));
-#else
- asm( " lnk %0\n"
- "1: {\n"
- " addli %0, %0, lo16(_GLOBAL_OFFSET_TABLE_ - 1b)\n"
- " addli %1, %0, lo16(_DYNAMIC - 1b)\n"
- " }\n"
- " {\n"
- " auli %0, %0, ha16(_GLOBAL_OFFSET_TABLE_ - 1b)\n"
- " auli %1, %1, ha16(_DYNAMIC - 1b)\n"
- " }\n"
- : "=r" (got), "=r" (dynamic));
-#endif
-
- return dynamic - *got;
-}
-
-/* Flush some range of the instruction cache. If invoked prior to
- actually setting dl_pagesize, we conservatively use 4KB, which
- is the smallest page size we could plausibly be running with. */
-static inline void
-_dl_flush_icache (const void *addr, unsigned long size)
-{
- invalidate_icache (addr, size, GLRO(dl_pagesize) ? : 4096);
-}
-
-/* Set up the loaded object described by L so its unrelocated PLT
- entries will jump to the on-demand fixup code in dl-runtime.c. */
-
-static inline int __attribute__ ((unused))
-elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
-{
- ElfW(Addr) *gotplt;
- extern void _dl_runtime_resolve (ElfW(Word));
- extern void _dl_runtime_profile (ElfW(Word));
-
- if (l->l_info[DT_JMPREL] && lazy)
- {
- gotplt = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]);
-
- /* The GOT entries for functions in the PLT have not yet been filled
- in. Their initial contents will arrange when called to put in
- registers an offset into the .rel.plt section, and gotplt[0], then
- jump to gotplt[1]. */
-
- /* Identify this shared object. */
- gotplt[0] = (ElfW(Addr)) l;
-
- /* The gotplt[1] entry contains the address of a function which gets
- called to get the address of a so far unresolved function and jump
- to it. The profiling extension of the dynamic linker allows to
- intercept the calls to collect information. In this case we don't
- store the address in the GOTPLT so that all future calls also end
- in this function. */
- if (__builtin_expect (profile, 0))
- {
- gotplt[1] = (ElfW(Addr)) &_dl_runtime_profile;
-
- if (GLRO(dl_profile) != NULL
- && _dl_name_match_p (GLRO(dl_profile), l))
- /* This is the object we are looking for. Say that we really
- want profiling and the timers are started. */
- GL(dl_profile_map) = l;
- }
- else
- /* This function will get called to fix up the GOTPLT entry
- indicated by the offset on the stack, and then jump to the
- resolved address. */
- gotplt[1] = (ElfW(Addr)) &_dl_runtime_resolve;
- }
-
- return lazy;
-}
-
-#if __WORDSIZE == 32
-/* Mask identifying addresses reserved for the user program,
- where the dynamic linker should not map anything. */
-#define ELF_MACHINE_USER_ADDRESS_MASK 0xf8000000UL
-#endif
-
-/* Initial entry point code for the dynamic linker.
- The C function `_dl_start' is the real entry point;
- its return value is the user program's entry point. */
-
-#define RTLD_START asm (".globl _dl_start");
-
-#ifndef RTLD_START_SPECIAL_INIT
-#define RTLD_START_SPECIAL_INIT /* nothing */
-#endif
-
-/* Wrap a generic Tilera relocation type. */
-#ifdef __tilegx__
-#define R_TILE(x) R_TILEGX_##x
-#define __R_TILE_TLS(x,c) R_TILEGX_TLS_##x##c
-#define _R_TILE_TLS(x,c) __R_TILE_TLS(x,c)
-#define R_TILE_TLS(x) _R_TILE_TLS(x,__ELF_NATIVE_CLASS)
-#else
-#define R_TILE(x) R_TILEPRO_##x
-#define R_TILE_TLS(x) R_TILEPRO_TLS_##x##32
-#endif
-
-/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
- TLS variable, so undefined references should not be allowed to
- define the value.
- ELF_RTYPE_CLASS_COPY iff TYPE should not be allowed to resolve to one
- of the main executable's symbols, as for a COPY reloc. */
-#define elf_machine_type_class(type) \
- ((((type) == R_TILE(JMP_SLOT) || (type) == R_TILE_TLS(DTPMOD) \
- || (type) == R_TILE_TLS(DTPOFF) || (type) == R_TILE_TLS(TPOFF)) \
- * ELF_RTYPE_CLASS_PLT) \
- | (((type) == R_TILE(COPY)) * ELF_RTYPE_CLASS_COPY))
-
-/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
-#define ELF_MACHINE_JMP_SLOT R_TILE(JMP_SLOT)
-
-/* TILE never uses Elf32_Rel relocations. */
-#define ELF_MACHINE_NO_REL 1
-#define ELF_MACHINE_NO_RELA 0
-
-/* We define an initialization functions. This is called very early in
- _dl_sysdep_start. */
-#define DL_PLATFORM_INIT dl_platform_init ()
-
-static inline void __attribute__ ((unused))
-dl_platform_init (void)
-{
- if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
- /* Avoid an empty string which would disturb us. */
- GLRO(dl_platform) = NULL;
-}
-
-static inline ElfW(Addr)
-elf_machine_fixup_plt (struct link_map *map, lookup_t t,
- const ElfW(Rela) *reloc,
- ElfW(Addr) *reloc_addr, ElfW(Addr) value)
-{
- return *reloc_addr = value;
-}
-
-/* Return the final value of a plt relocation. */
-static inline ElfW(Addr)
-elf_machine_plt_value (struct link_map *map, const ElfW(Rela) *reloc,
- ElfW(Addr) value)
-{
- return value;
-}
-
-/* Support notifying the simulator about new objects. */
-void internal_function _dl_after_load (struct link_map *l);
-#define DL_AFTER_LOAD _dl_after_load
-
-/* Names of the architecture-specific auditing callback functions. */
-#define ARCH_LA_PLTENTER tile_gnu_pltenter
-#define ARCH_LA_PLTEXIT tile_gnu_pltexit
-
-#endif /* !dl_machine_h */
-
-
-#ifdef RESOLVE_MAP
-
-struct reloc_howto
-{
- /* Right shift operand by this number of bits. */
- unsigned char right_shift;
-
-#ifdef __tilegx__
- /* If nonzero, this is updating a code bundle. */
- unsigned char is_bundle_update;
-#else
- /* If nonzero, add 0x8000 to the value. */
- unsigned char add_0x8000;
-#endif
-
- /* If nonzero, subtract the containing address from the address. */
- unsigned char is_pcrel;
-
- /* Size in bytes, or 0 if this table entry should be ignored. */
- unsigned char byte_size;
-};
-
-/* Relocation information. Cannot contain create_* function pointers
- because then the table would not be position-independent. */
-static const struct reloc_howto howto[] =
-{
-#ifdef __tilegx__
-
-# if __WORDSIZE == 32
- /* The GX -m32 loader only handles 32-bit types, so it will be confused
- by shifts larger than that. We convert them to just sign-extend;
- they usually indicate a program bug or missed optimization, but we
- have to handle them correctly anyway. */
-# define S32 31
-# define S48 31
-# else
-# define S32 32
-# define S48 48
-# endif
-
- /* R_TILEGX_NONE */ { 0, 0, 0, 0 },
- /* R_TILEGX_64 */ { 0, 0, 0, 8 },
- /* R_TILEGX_32 */ { 0, 0, 0, 4 },
- /* R_TILEGX_16 */ { 0, 0, 0, 2 },
- /* R_TILEGX_8 */ { 0, 0, 0, 1 },
- /* R_TILEGX_64_PCREL */ { 0, 0, 1, 8 },
- /* R_TILEGX_32_PCREL */ { 0, 0, 1, 4 },
- /* R_TILEGX_16_PCREL */ { 0, 0, 1, 2 },
- /* R_TILEGX_8_PCREL */ { 0, 0, 1, 1 },
- /* R_TILEGX_HW0 */ { 0, 0, 0, 0 },
- /* R_TILEGX_HW1 */ { 16, 0, 0, 0 },
- /* R_TILEGX_HW2 */ { S32, 0, 0, 0 },
- /* R_TILEGX_HW3 */ { S48, 0, 0, 0 },
- /* R_TILEGX_HW0_LAST */ { 0, 0, 0, 0 },
- /* R_TILEGX_HW1_LAST */ { 16, 0, 0, 0 },
- /* R_TILEGX_HW2_LAST */ { S32, 0, 0, 0 },
- /* R_TILEGX_COPY */ { 0, 0, 0, 0 },
- /* R_TILEGX_GLOB_DAT */ { 0, 0, 0, 8 },
- /* R_TILEGX_JMP_SLOT */ { 0, 0, 0, 0 },
- /* R_TILEGX_RELATIVE */ { 0, 0, 0, 0 },
- /* R_TILEGX_BROFF_X1 */ { 3, 1, 1, 8 },
- /* R_TILEGX_JUMPOFF_X1 */ { 3, 1, 1, 8 },
- /* R_TILEGX_JUMPOFF_X1_PLT */ { 3, 1, 1, 8 },
- /* R_TILEGX_IMM8_X0 */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM8_Y0 */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM8_X1 */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM8_Y1 */ { 0, 1, 0, 8 },
- /* R_TILEGX_DEST_IMM8_X1 */ { 0, 1, 0, 8 },
- /* R_TILEGX_MT_IMM14_X1 */ { 0, 1, 0, 8 },
- /* R_TILEGX_MF_IMM14_X1 */ { 0, 1, 0, 8 },
- /* R_TILEGX_MMSTART_X0 */ { 0, 1, 0, 8 },
- /* R_TILEGX_MMEND_X0 */ { 0, 1, 0, 8 },
- /* R_TILEGX_SHAMT_X0 */ { 0, 1, 0, 8 },
- /* R_TILEGX_SHAMT_X1 */ { 0, 1, 0, 8 },
- /* R_TILEGX_SHAMT_Y0 */ { 0, 1, 0, 8 },
- /* R_TILEGX_SHAMT_Y1 */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW0 */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW0 */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW1 */ { 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW1 */ { 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW2 */ { S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW2 */ { S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW3 */ { S48, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW3 */ { S48, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW0_LAST */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW0_LAST */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW1_LAST */ { 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW1_LAST */ { 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW2_LAST */ { S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW2_LAST */ { S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW0_PCREL */ { 0, 1, 1, 8 },
- /* R_TILEGX_IMM16_X1_HW0_PCREL */ { 0, 1, 1, 8 },
- /* R_TILEGX_IMM16_X0_HW1_PCREL */ { 16, 1, 1, 8 },
- /* R_TILEGX_IMM16_X1_HW1_PCREL */ { 16, 1, 1, 8 },
- /* R_TILEGX_IMM16_X0_HW2_PCREL */ { S32, 1, 1, 8 },
- /* R_TILEGX_IMM16_X1_HW2_PCREL */ { S32, 1, 1, 8 },
- /* R_TILEGX_IMM16_X0_HW3_PCREL */ { S48, 1, 1, 8 },
- /* R_TILEGX_IMM16_X1_HW3_PCREL */ { S48, 1, 1, 8 },
- /* R_TILEGX_IMM16_X0_HW0_LAST_PCREL */ { 0, 1, 1, 8 },
- /* R_TILEGX_IMM16_X1_HW0_LAST_PCREL */ { 0, 1, 1, 8 },
- /* R_TILEGX_IMM16_X0_HW1_LAST_PCREL */ { 16, 1, 1, 8 },
- /* R_TILEGX_IMM16_X1_HW1_LAST_PCREL */ { 16, 1, 1, 8 },
- /* R_TILEGX_IMM16_X0_HW2_LAST_PCREL */ { S32, 1, 1, 8 },
- /* R_TILEGX_IMM16_X1_HW2_LAST_PCREL */ { S32, 1, 1, 8 },
- /* R_TILEGX_IMM16_X0_HW0_GOT */ { 0, 1, 0, 0 },
- /* R_TILEGX_IMM16_X1_HW0_GOT */ { 0, 1, 0, 0 },
- /* R_TILEGX_IMM16_X0_HW1_GOT */ { 16, 1, 0, 0 },
- /* R_TILEGX_IMM16_X1_HW1_GOT */ { 16, 1, 0, 0 },
- /* R_TILEGX_IMM16_X0_HW2_GOT */ { S32, 1, 0, 0 },
- /* R_TILEGX_IMM16_X1_HW2_GOT */ { S32, 1, 0, 0 },
- /* R_TILEGX_IMM16_X0_HW3_GOT */ { S48, 1, 0, 0 },
- /* R_TILEGX_IMM16_X1_HW3_GOT */ { S48, 1, 0, 0 },
- /* R_TILEGX_IMM16_X0_HW0_LAST_GOT */ { 0, 1, 0, 0 },
- /* R_TILEGX_IMM16_X1_HW0_LAST_GOT */ { 0, 1, 0, 0 },
- /* R_TILEGX_IMM16_X0_HW1_LAST_GOT */ { 16, 1, 0, 0 },
- /* R_TILEGX_IMM16_X1_HW1_LAST_GOT */ { 16, 1, 0, 0 },
- /* R_TILEGX_IMM16_X0_HW2_LAST_GOT */ { S32, 1, 0, 0 },
- /* R_TILEGX_IMM16_X1_HW2_LAST_GOT */ { S32, 1, 0, 0 },
- /* R_TILEGX_IMM16_X0_HW0_TLS_GD */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW0_TLS_GD */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW1_TLS_GD */ { 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW1_TLS_GD */ { 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW2_TLS_GD */ { S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW2_TLS_GD */ { S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW3_TLS_GD */ { S48, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW3_TLS_GD */ { S48, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD */{ 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD */{ 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD */{ 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD */{ 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW2_LAST_TLS_GD */{ S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW2_LAST_TLS_GD */{ S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW0_TLS_IE */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW0_TLS_IE */ { 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW1_TLS_IE */ { 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW1_TLS_IE */ { 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW2_TLS_IE */ { S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW2_TLS_IE */ { S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW3_TLS_IE */ { S48, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW3_TLS_IE */ { S48, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE */{ 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE */{ 0, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE */{ 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE */{ 16, 1, 0, 8 },
- /* R_TILEGX_IMM16_X0_HW2_LAST_TLS_IE */{ S32, 1, 0, 8 },
- /* R_TILEGX_IMM16_X1_HW2_LAST_TLS_IE */{ S32, 1, 0, 8 },
- /* R_TILEGX_TLS_DTPMOD64 */ { 0, 0, 0, 0 },
- /* R_TILEGX_TLS_DTPOFF64 */ { 0, 0, 0, 0 },
- /* R_TILEGX_TLS_TPOFF64 */ { 0, 0, 0, 0 },
- /* R_TILEGX_TLS_DTPMOD32 */ { 0, 0, 0, 0 },
- /* R_TILEGX_TLS_DTPOFF32 */ { 0, 0, 0, 0 },
- /* R_TILEGX_TLS_TPOFF32 */ { 0, 0, 0, 0 }
-#else
- /* R_TILEPRO_NONE */ { 0, 0, 0, 0 },
- /* R_TILEPRO_32 */ { 0, 0, 0, 4 },
- /* R_TILEPRO_16 */ { 0, 0, 0, 2 },
- /* R_TILEPRO_8 */ { 0, 0, 0, 1 },
- /* R_TILEPRO_32_PCREL */ { 0, 0, 1, 4 },
- /* R_TILEPRO_16_PCREL */ { 0, 0, 1, 2 },
- /* R_TILEPRO_8_PCREL */ { 0, 0, 1, 1 },
- /* R_TILEPRO_LO16 */ { 0, 0, 0, 2 },
- /* R_TILEPRO_HI16 */ { 16, 0, 0, 2 },
- /* R_TILEPRO_HA16 */ { 16, 1, 0, 2 },
- /* R_TILEPRO_COPY */ { 0, 0, 0, 0 },
- /* R_TILEPRO_GLOB_DAT */ { 0, 0, 0, 4 },
- /* R_TILEPRO_JMP_SLOT */ { 0, 0, 0, 0 },
- /* R_TILEPRO_RELATIVE */ { 0, 0, 0, 0 },
- /* R_TILEPRO_BROFF_X1 */ { 3, 0, 1, 8 },
- /* R_TILEPRO_JOFFLONG_X1 */ { 3, 0, 1, 8 },
- /* R_TILEPRO_JOFFLONG_X1_PLT */ { 3, 0, 1, 8 },
- /* R_TILEPRO_IMM8_X0 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM8_Y0 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM8_X1 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM8_Y1 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_MT_IMM15_X1 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_MF_IMM15_X1 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X0 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X1 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X0_LO */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X1_LO */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X0_HI */ { 16, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X1_HI */ { 16, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X0_HA */ { 16, 1, 0, 8 },
- /* R_TILEPRO_IMM16_X1_HA */ { 16, 1, 0, 8 },
- /* R_TILEPRO_IMM16_X0_PCREL */ { 0, 0, 1, 8 },
- /* R_TILEPRO_IMM16_X1_PCREL */ { 0, 0, 1, 8 },
- /* R_TILEPRO_IMM16_X0_LO_PCREL */ { 0, 0, 1, 8 },
- /* R_TILEPRO_IMM16_X1_LO_PCREL */ { 0, 0, 1, 8 },
- /* R_TILEPRO_IMM16_X0_HI_PCREL */ { 16, 0, 1, 8 },
- /* R_TILEPRO_IMM16_X1_HI_PCREL */ { 16, 0, 1, 8 },
- /* R_TILEPRO_IMM16_X0_HA_PCREL */ { 16, 1, 1, 8 },
- /* R_TILEPRO_IMM16_X1_HA_PCREL */ { 16, 1, 1, 8 },
- /* R_TILEPRO_IMM16_X0_GOT */ { 0, 0, 0, 0 },
- /* R_TILEPRO_IMM16_X1_GOT */ { 0, 0, 0, 0 },
- /* R_TILEPRO_IMM16_X0_GOT_LO */ { 0, 0, 0, 0 },
- /* R_TILEPRO_IMM16_X1_GOT_LO */ { 0, 0, 0, 0 },
- /* R_TILEPRO_IMM16_X0_GOT_HI */ { 0, 0, 0, 0 },
- /* R_TILEPRO_IMM16_X1_GOT_HI */ { 0, 0, 0, 0 },
- /* R_TILEPRO_IMM16_X0_GOT_HA */ { 0, 0, 0, 0 },
- /* R_TILEPRO_IMM16_X1_GOT_HA */ { 0, 0, 0, 0 },
- /* R_TILEPRO_MMSTART_X0 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_MMEND_X0 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_MMSTART_X1 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_MMEND_X1 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_SHAMT_X0 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_SHAMT_X1 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_SHAMT_Y0 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_SHAMT_Y1 */ { 0, 0, 0, 8 },
- /* R_TILEPRO_SN_BROFF */ { 0, 0, 0, 0 },
- /* R_TILEPRO_SN_IMM8 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_SN_UIMM8 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_SN_BYTE0 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_SN_BYTE1 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_SN_BYTE2 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_SN_BYTE3 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_SN_SPCREL0 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_SN_SPCREL1 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_SN_SPCREL2 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_SN_SPCREL3 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_IMM16_X0_TLS_GD */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X1_TLS_GD */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X0_TLS_GD_LO */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X1_TLS_GD_LO */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X0_TLS_GD_HI */ { 16, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X1_TLS_GD_HI */ { 16, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X0_TLS_GD_HA */ { 16, 1, 0, 8 },
- /* R_TILEPRO_IMM16_X1_TLS_GD_HA */ { 16, 1, 0, 8 },
- /* R_TILEPRO_IMM16_X0_TLS_IE */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X1_TLS_IE */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X0_TLS_IE_LO */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X1_TLS_IE_LO */ { 0, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X0_TLS_IE_HI */ { 16, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X1_TLS_IE_HI */ { 16, 0, 0, 8 },
- /* R_TILEPRO_IMM16_X0_TLS_IE_HA */ { 16, 1, 0, 8 },
- /* R_TILEPRO_IMM16_X1_TLS_IE_HA */ { 16, 1, 0, 8 },
- /* R_TILEPRO_TLS_DTPMOD32 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_TLS_DTPOFF32 */ { 0, 0, 0, 0 },
- /* R_TILEPRO_TLS_TPOFF32 */ { 0, 0, 0, 0 },
-#endif
-};
-
-#if __ELF_NATIVE_CLASS == 32
-#define ELFW_R_TYPE ELF32_R_TYPE
-#define ELFW_ST_TYPE ELF32_ST_TYPE
-#else
-#define ELFW_R_TYPE ELF64_R_TYPE
-#define ELFW_ST_TYPE ELF64_ST_TYPE
-#endif
-
-/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
- MAP is the object containing the reloc. */
-
-auto inline void __attribute__ ((always_inline))
-elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
- const ElfW(Sym) *sym, const struct r_found_version *version,
- void *const reloc_addr_arg, int skip_ifunc)
-{
- ElfW(Addr) *const reloc_addr = reloc_addr_arg;
- const unsigned int r_type = ELFW_R_TYPE (reloc->r_info);
-
-#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
- if (__builtin_expect (r_type == R_TILE(RELATIVE), 0))
- {
-# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
- /* This is defined in rtld.c, but nowhere in the static libc.a;
- make the reference weak so static programs can still link.
- This declaration cannot be done when compiling rtld.c
- (i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
- common defn for _dl_rtld_map, which is incompatible with a
- weak decl in the same file. */
-# ifndef SHARED
- weak_extern (GL(dl_rtld_map));
-# endif
- if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */
-# endif
- *reloc_addr = map->l_addr + reloc->r_addend;
- return;
- }
-#endif
-
- if (__builtin_expect (r_type == R_TILE(NONE), 0))
- return;
-
-#if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP
- const ElfW(Sym) *const refsym = sym;
-#endif
- struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- ElfW(Addr) value;
-
- if (sym == NULL)
- value = 0;
- else if (ELFW_ST_TYPE (sym->st_info) == STT_SECTION)
- value = map->l_addr; /* like a RELATIVE reloc */
- else
- value = sym_map->l_addr + sym->st_value;
-
- if (sym != NULL
- && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
- && __builtin_expect (!skip_ifunc, 1))
- value = ((Elf64_Addr (*) (void)) value) ();
-
- switch (r_type)
- {
- case R_TILE(JMP_SLOT):
- elf_machine_fixup_plt (map, 0, reloc, reloc_addr,
- value + reloc->r_addend);
- return;
-
-#ifndef RESOLVE_CONFLICT_FIND_MAP
- case R_TILE_TLS(DTPMOD):
-# ifdef RTLD_BOOTSTRAP
- /* During startup the dynamic linker is always the module
- with index 1.
- XXX If this relocation is necessary move before RESOLVE
- call. */
- *reloc_addr = 1;
-# else
- /* Get the information from the link map returned by the
- resolv function. */
- if (sym_map != NULL)
- *reloc_addr = sym_map->l_tls_modid;
-# endif
- return;
- case R_TILE_TLS(DTPOFF):
-# ifndef RTLD_BOOTSTRAP
- /* During relocation all TLS symbols are defined and used.
- Therefore the offset is already correct. */
- if (sym != NULL)
- *reloc_addr = sym->st_value + reloc->r_addend;
-# endif
- return;
- case R_TILE_TLS(TPOFF):
-# ifdef RTLD_BOOTSTRAP
- *reloc_addr = sym->st_value + reloc->r_addend + map->l_tls_offset;
-# else
- if (sym != NULL)
- {
- CHECK_STATIC_TLS (map, sym_map);
- *reloc_addr = (sym->st_value + reloc->r_addend
- + sym_map->l_tls_offset);
- }
-#endif
- return;
-#endif /* use TLS */
-
-#if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP
- /* Not needed in dl-conflict.c. */
- case R_TILE(COPY):
- if (sym == NULL)
- /* This can happen in trace mode if an object could not be found. */
- return;
- if (__builtin_expect (sym->st_size > refsym->st_size, 0)
- || (__builtin_expect (sym->st_size < refsym->st_size, 0)
- && __builtin_expect (GLRO(dl_verbose), 0)))
- {
- const char *strtab;
-
- strtab = (const char *) D_PTR (map,l_info[DT_STRTAB]);
- _dl_error_printf ("%s: Symbol `%s' has different size in shared"
- " object, consider re-linking\n",
- RTLD_PROGNAME, strtab + refsym->st_name);
- }
- memcpy (reloc_addr_arg, (void *) value,
- MIN (sym->st_size, refsym->st_size));
- return;
-#endif
- }
-
- /* All remaining relocations must be in the lookup table. */
- const struct reloc_howto *h = &howto[r_type];
- if ((unsigned int) r_type >= sizeof howto / sizeof howto[0] ||
- h->byte_size == 0)
- {
-#if !defined RTLD_BOOTSTRAP || defined _NDEBUG
- /* We add these checks in the version to relocate ld.so only
- if we are still debugging. */
- _dl_reloc_bad_type (map, r_type, 0);
-#endif
- return;
- }
-
- value += reloc->r_addend;
-
- /* The lookup table entry knows how to perform this reloc. */
- if (h->is_pcrel)
- value -= (ElfW(Addr)) reloc_addr;
-
-#ifndef __tilegx__
- if (h->add_0x8000)
- value += 0x8000;
-#endif
-
- value = ((long) value) >> h->right_shift;
-
- switch (h->byte_size)
- {
- case 1:
- *(char *) reloc_addr = value;
- return;
- case 2:
- *(short *) reloc_addr = value;
- return;
- case 4:
- *(int *) reloc_addr = value;
- return;
-#ifdef __tilegx__
- case 8:
- if (!h->is_bundle_update)
- {
- *(ElfW(Addr) *) reloc_addr = value;
- return;
- }
-#endif
- }
-
- /* We are updating a bundle, so use the function pointer that
- swizzles the operand bits into the right location. */
-
- tile_bundle_bits *p = (tile_bundle_bits *) reloc_addr;
- tile_bundle_bits bits = *p;
-
-#define MUNGE_SIGNED(func, length) do { \
- bits = ((bits & ~create_##func (-1)) | create_##func (value)); \
- ElfW(Addr) result = get_##func (bits); \
- int signbits = __WORDSIZE - length; \
- result = (long) (result << signbits) >> signbits; \
- if (result != value) \
- _dl_signal_error (0, map->l_name, NULL, \
- "relocation value too large for " #func); \
- } while (0)
-
-#define MUNGE(func) MUNGE_SIGNED(func, __WORDSIZE)
-
-#define MUNGE_NOCHECK(func) \
- bits = ((bits & ~create_##func (-1)) | create_##func (value))
-
- switch (r_type)
- {
-#ifdef __tilegx__
- case R_TILEGX_BROFF_X1:
- MUNGE_SIGNED (BrOff_X1, 17);
- break;
- case R_TILEGX_JUMPOFF_X1:
- case R_TILEGX_JUMPOFF_X1_PLT:
- MUNGE_SIGNED (JumpOff_X1, 27);
- break;
- case R_TILEGX_IMM8_X0:
- MUNGE_SIGNED (Imm8_X0, 8);
- break;
- case R_TILEGX_IMM8_Y0:
- MUNGE_SIGNED (Imm8_Y0, 8);
- break;
- case R_TILEGX_IMM8_X1:
- MUNGE_SIGNED (Imm8_X1, 8);
- break;
- case R_TILEGX_IMM8_Y1:
- MUNGE_SIGNED (Imm8_Y1, 8);
- break;
- case R_TILEGX_MT_IMM14_X1:
- MUNGE (MT_Imm14_X1);
- break;
- case R_TILEGX_MF_IMM14_X1:
- MUNGE (MF_Imm14_X1);
- break;
- case R_TILEGX_IMM16_X0_HW0:
- case R_TILEGX_IMM16_X0_HW1:
- case R_TILEGX_IMM16_X0_HW2:
- case R_TILEGX_IMM16_X0_HW3:
- case R_TILEGX_IMM16_X0_HW0_PCREL:
- case R_TILEGX_IMM16_X0_HW1_PCREL:
- case R_TILEGX_IMM16_X0_HW2_PCREL:
- case R_TILEGX_IMM16_X0_HW3_PCREL:
- case R_TILEGX_IMM16_X0_HW0_TLS_GD:
- case R_TILEGX_IMM16_X0_HW0_TLS_IE:
- MUNGE_NOCHECK (Imm16_X0);
- break;
- case R_TILEGX_IMM16_X0_HW0_LAST:
- case R_TILEGX_IMM16_X0_HW1_LAST:
- case R_TILEGX_IMM16_X0_HW2_LAST:
- case R_TILEGX_IMM16_X0_HW0_LAST_PCREL:
- case R_TILEGX_IMM16_X0_HW1_LAST_PCREL:
- case R_TILEGX_IMM16_X0_HW2_LAST_PCREL:
- case R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD:
- case R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD:
- case R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE:
- case R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE:
- MUNGE_SIGNED (Imm16_X0, 16);
- break;
- case R_TILEGX_IMM16_X1_HW0:
- case R_TILEGX_IMM16_X1_HW1:
- case R_TILEGX_IMM16_X1_HW2:
- case R_TILEGX_IMM16_X1_HW3:
- case R_TILEGX_IMM16_X1_HW0_PCREL:
- case R_TILEGX_IMM16_X1_HW1_PCREL:
- case R_TILEGX_IMM16_X1_HW2_PCREL:
- case R_TILEGX_IMM16_X1_HW3_PCREL:
- case R_TILEGX_IMM16_X1_HW0_TLS_GD:
- case R_TILEGX_IMM16_X1_HW0_TLS_IE:
- MUNGE_NOCHECK (Imm16_X1);
- break;
- case R_TILEGX_IMM16_X1_HW0_LAST:
- case R_TILEGX_IMM16_X1_HW1_LAST:
- case R_TILEGX_IMM16_X1_HW2_LAST:
- case R_TILEGX_IMM16_X1_HW0_LAST_PCREL:
- case R_TILEGX_IMM16_X1_HW1_LAST_PCREL:
- case R_TILEGX_IMM16_X1_HW2_LAST_PCREL:
- case R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD:
- case R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD:
- case R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE:
- case R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE:
- MUNGE_SIGNED (Imm16_X1, 16);
- break;
- case R_TILEGX_MMSTART_X0:
- MUNGE (BFStart_X0);
- break;
- case R_TILEGX_MMEND_X0:
- MUNGE (BFEnd_X0);
- break;
- case R_TILEGX_SHAMT_X0:
- MUNGE (ShAmt_X0);
- break;
- case R_TILEGX_SHAMT_X1:
- MUNGE (ShAmt_X1);
- break;
- case R_TILEGX_SHAMT_Y0:
- MUNGE (ShAmt_Y0);
- break;
- case R_TILEGX_SHAMT_Y1:
- MUNGE (ShAmt_Y1);
- break;
-#else
- case R_TILEPRO_BROFF_X1:
- MUNGE_SIGNED (BrOff_X1, 17);
- break;
- case R_TILEPRO_JOFFLONG_X1:
- case R_TILEPRO_JOFFLONG_X1_PLT:
- MUNGE_NOCHECK (JOffLong_X1); /* holds full 32-bit value */
- break;
- case R_TILEPRO_IMM8_X0:
- MUNGE_SIGNED (Imm8_X0, 8);
- break;
- case R_TILEPRO_IMM8_Y0:
- MUNGE_SIGNED (Imm8_Y0, 8);
- break;
- case R_TILEPRO_IMM8_X1:
- MUNGE_SIGNED (Imm8_X1, 8);
- break;
- case R_TILEPRO_IMM8_Y1:
- MUNGE_SIGNED (Imm8_Y1, 8);
- break;
- case R_TILEPRO_MT_IMM15_X1:
- MUNGE (MT_Imm15_X1);
- break;
- case R_TILEPRO_MF_IMM15_X1:
- MUNGE (MF_Imm15_X1);
- break;
- case R_TILEPRO_IMM16_X0_LO:
- case R_TILEPRO_IMM16_X0_HI:
- case R_TILEPRO_IMM16_X0_HA:
- case R_TILEPRO_IMM16_X0_LO_PCREL:
- case R_TILEPRO_IMM16_X0_HI_PCREL:
- case R_TILEPRO_IMM16_X0_HA_PCREL:
- case R_TILEPRO_IMM16_X0_TLS_GD_LO:
- case R_TILEPRO_IMM16_X0_TLS_GD_HI:
- case R_TILEPRO_IMM16_X0_TLS_GD_HA:
- case R_TILEPRO_IMM16_X0_TLS_IE_LO:
- case R_TILEPRO_IMM16_X0_TLS_IE_HI:
- case R_TILEPRO_IMM16_X0_TLS_IE_HA:
- MUNGE_NOCHECK (Imm16_X0);
- break;
- case R_TILEPRO_IMM16_X0:
- case R_TILEPRO_IMM16_X0_PCREL:
- case R_TILEPRO_IMM16_X0_TLS_GD:
- case R_TILEPRO_IMM16_X0_TLS_IE:
- MUNGE_SIGNED (Imm16_X0, 16);
- break;
- case R_TILEPRO_IMM16_X1_LO:
- case R_TILEPRO_IMM16_X1_HI:
- case R_TILEPRO_IMM16_X1_HA:
- case R_TILEPRO_IMM16_X1_LO_PCREL:
- case R_TILEPRO_IMM16_X1_HI_PCREL:
- case R_TILEPRO_IMM16_X1_HA_PCREL:
- case R_TILEPRO_IMM16_X1_TLS_GD_LO:
- case R_TILEPRO_IMM16_X1_TLS_GD_HI:
- case R_TILEPRO_IMM16_X1_TLS_GD_HA:
- case R_TILEPRO_IMM16_X1_TLS_IE_LO:
- case R_TILEPRO_IMM16_X1_TLS_IE_HI:
- case R_TILEPRO_IMM16_X1_TLS_IE_HA:
- MUNGE_NOCHECK (Imm16_X1);
- break;
- case R_TILEPRO_IMM16_X1:
- case R_TILEPRO_IMM16_X1_PCREL:
- case R_TILEPRO_IMM16_X1_TLS_GD:
- case R_TILEPRO_IMM16_X1_TLS_IE:
- MUNGE_SIGNED (Imm16_X1, 16);
- break;
- case R_TILEPRO_MMSTART_X0:
- MUNGE (MMStart_X0);
- break;
- case R_TILEPRO_MMEND_X0:
- MUNGE (MMEnd_X0);
- break;
- case R_TILEPRO_MMSTART_X1:
- MUNGE (MMStart_X1);
- break;
- case R_TILEPRO_MMEND_X1:
- MUNGE (MMEnd_X1);
- break;
- case R_TILEPRO_SHAMT_X0:
- MUNGE (ShAmt_X0);
- break;
- case R_TILEPRO_SHAMT_X1:
- MUNGE (ShAmt_X1);
- break;
- case R_TILEPRO_SHAMT_Y0:
- MUNGE (ShAmt_Y0);
- break;
- case R_TILEPRO_SHAMT_Y1:
- MUNGE (ShAmt_Y1);
- break;
-#endif
- }
-#undef MUNGE
- *p = bits;
- _dl_flush_icache (p, sizeof (*p));
-}
-
-auto inline void __attribute__ ((always_inline))
-elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
- void *const reloc_addr_arg)
-{
- ElfW(Addr) *const reloc_addr = reloc_addr_arg;
- *reloc_addr = l_addr + reloc->r_addend;
-}
-
-auto inline void __attribute__ ((always_inline))
-elf_machine_lazy_rel (struct link_map *map,
- ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
- int skip_ifunc)
-{
- const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
-
- /* Check for unexpected PLT reloc type. */
- if (__builtin_expect (r_type == R_TILE(JMP_SLOT), 1))
- {
- *(ElfW(Addr) *) (l_addr + reloc->r_offset) += l_addr;
- }
- else
- _dl_reloc_bad_type (map, r_type, 1);
-}
-
-#endif /* RESOLVE_MAP */
diff --git a/sysdeps/tile/dl-runtime.c b/sysdeps/tile/dl-runtime.c
deleted file mode 100644
index 8142167836..0000000000
--- a/sysdeps/tile/dl-runtime.c
+++ /dev/null
@@ -1,159 +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/>. */
-
-/* Like x86_64, we pass the index of the relocation and not its offset.
- In _dl_profile_fixup and _dl_call_pltexit we also use the index.
- Therefore it is wasteful to compute the offset in the trampoline
- just to reverse the operation immediately afterwards. */
-#define reloc_offset reloc_arg * sizeof (PLTREL)
-#define reloc_index reloc_arg
-
-#include <elf/dl-runtime.c>
-
-#include <sys/mman.h>
-#include <arch/sim.h>
-#include <dl-unmap-segments.h>
-
-/* Like realpath(), but simplified: no dynamic memory use, no lstat(),
- no set_errno(), no valid "rpath" on error, etc. This handles some
- simple cases where the simulator might not have a valid entry for
- a loaded Elf object, in particular dlopen() with a relative path.
- For this relatively rare case, one could also imagine using
- link_map.l_origin to avoid the getcwd() here, but the simpler code
- here seems like a better solution. */
-static char *
-dl_realpath (const char *name, char *rpath)
-{
- char *dest;
- const char *start, *end;
-
- if (name[0] != '/')
- {
- if (!__getcwd (rpath, PATH_MAX))
- return NULL;
- dest = __rawmemchr (rpath, '\0');
- }
- else
- {
- rpath[0] = '/';
- dest = rpath + 1;
- }
-
- for (start = end = name; *start; start = end)
- {
- /* Skip sequence of multiple path-separators. */
- while (*start == '/')
- ++start;
-
- /* Find end of path component. */
- for (end = start; *end && *end != '/'; ++end)
- /* Nothing. */;
-
- if (end - start == 0)
- break;
- else if (end - start == 1 && start[0] == '.')
- /* nothing */;
- else if (end - start == 2 && start[0] == '.' && start[1] == '.')
- {
- /* Back up to previous component, ignore if at root already. */
- if (dest > rpath + 1)
- while ((--dest)[-1] != '/');
- }
- else
- {
- if (dest[-1] != '/')
- *dest++ = '/';
-
- if (dest + (end - start) >= rpath + PATH_MAX)
- return NULL;
-
- dest = __mempcpy (dest, start, end - start);
- *dest = '\0';
- }
- }
- if (dest > rpath + 1 && dest[-1] == '/')
- --dest;
- *dest = '\0';
-
- return rpath;
-}
-
-/* Support notifying the simulator about new objects. */
-void internal_function
-_dl_after_load (struct link_map *l)
-{
- int shift;
- char pathbuf[PATH_MAX];
- char *path;
-
- /* Don't bother if not in the simulator. */
- if (__insn_mfspr (SPR_SIM_CONTROL) == 0)
- return;
-
-#define DLPUTC(c) __insn_mtspr (SPR_SIM_CONTROL, \
- (SIM_CONTROL_DLOPEN \
- | ((c) << _SIM_CONTROL_OPERATOR_BITS)))
-
- /* Write the library address in hex. */
- DLPUTC ('0');
- DLPUTC ('x');
- for (shift = (int) sizeof (unsigned long) * 8 - 4; shift >= 0; shift -= 4)
- DLPUTC ("0123456789abcdef"[(l->l_map_start >> shift) & 0xF]);
- DLPUTC (':');
-
- /* Write the library path, including the terminating '\0'. */
- path = dl_realpath (l->l_name, pathbuf) ?: l->l_name;
- for (size_t i = 0;; i++)
- {
- DLPUTC (path[i]);
- if (path[i] == '\0')
- break;
- }
-#undef DLPUTC
-}
-
-/* Support notifying the simulator about removed objects prior to munmap(). */
-static void
-sim_dlclose (ElfW(Addr) map_start)
-{
- int shift;
-
- /* Don't bother if not in the simulator. */
- if (__insn_mfspr (SPR_SIM_CONTROL) == 0)
- return;
-
-#define DLPUTC(c) __insn_mtspr (SPR_SIM_CONTROL, \
- (SIM_CONTROL_DLCLOSE \
- | ((c) << _SIM_CONTROL_OPERATOR_BITS)))
-
- /* Write the library address in hex. */
- DLPUTC ('0');
- DLPUTC ('x');
- for (shift = (int) sizeof (unsigned long) * 8 - 4; shift >= 0; shift -= 4)
- DLPUTC ("0123456789abcdef"[(map_start >> shift) & 0xF]);
- DLPUTC ('\0');
-
-#undef DLPUTC
-}
-
-void internal_function
-_dl_unmap (struct link_map *map)
-{
- sim_dlclose (map->l_map_start);
- _dl_unmap_segments (map);
-}
diff --git a/sysdeps/tile/dl-start.S b/sysdeps/tile/dl-start.S
deleted file mode 100644
index c9c8654857..0000000000
--- a/sysdeps/tile/dl-start.S
+++ /dev/null
@@ -1,114 +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 <sysdep.h>
-
- /* Get address of "sym" in "reg" assuming r51 holds ".Llink". */
- .macro pic_addr reg, sym
-#ifdef __tilegx__
- moveli \reg, hw1_last(\sym - .Llink)
- shl16insli \reg, \reg, hw0(\sym - .Llink)
- ADD_PTR \reg, r51, \reg
-#else
- ADDLI_PTR \reg, r51, lo16(\sym - .Llink)
- auli \reg, \reg, ha16(\sym - .Llink)
-#endif
- .endm
-
- .text
-ENTRY (_start)
- /* Linux starts us with sp pointing at the conventional Elf layout,
- but we need to allow two 'caller' words for our ABI convention. */
- {
- move r52, sp
- andi sp, sp, -8
- }
- cfi_def_cfa_register (r52)
- {
- /* Point sp at base of ABI area; point r4 to the caller-sp word. */
- ADDI_PTR sp, sp, -(2 * REGSIZE)
- ADDI_PTR r4, sp, -REGSIZE
- }
- {
- /* Save zero for caller sp in our 'caller' save area, and make
- sure lr has a zero value, to limit backtraces. */
- move lr, zero
- ST r4, zero
- }
- {
- move r0, r52
- jal _dl_start
- }
- /* Save returned start of user program address for later. */
- move r50, r0
-
- /* See if we were invoked explicitly with the dynamic loader,
- in which case we have to adjust the argument vector. */
- lnk r51; .Llink:
- pic_addr r4, _dl_skip_args
- LD4U r4, r4
- BEQZT r4, .Lno_skip
-
- /* Load the argc word at the initial sp and adjust it.
- We basically jump "sp" up over the first few argv entries
- and write "argc" a little higher up in memory, to be the
- base of the new kernel-initialized stack area. */
- LD_PTR r0, r52
- {
- sub r0, r0, r4
- SHL_PTR_ADD r52, r4, r52
- }
- {
- ST_PTR r52, r0
- SHL_PTR_ADD sp, r4, sp
- }
- andi sp, sp, -8
-
-.Lno_skip:
- /* Call_dl_init (_dl_loaded, argc, argv, envp). See elf/start.s
- for the layout of memory here; r52 is pointing to "+0". */
- pic_addr r0, _rtld_local
- {
- LD_PTR r1, r52 /* load argc in r1 */
- ADDLI_PTR r2, r52, __SIZEOF_POINTER__ /* point r2 at argv */
- }
- {
- LD_PTR r0, r0 /* yields _rtld_global._ns_loaded */
- addi r3, r1, 1
- move lr, zero
- }
- {
- SHL_PTR_ADD r3, r3, r2 /* point r3 at envp */
- jal _dl_init
- }
-
- /* Call user program whose address we saved in r50.
- We invoke it just like a static binary, but with _dl_fini
- in r0 so we can distinguish. */
-
- pic_addr r0, _dl_fini
- move lr, zero
- {
- move sp, r52
- jr r50
- }
-
- /* Tell backtracer to give up (_start has no caller). */
- info 2 /* INFO_OP_CANNOT_BACKTRACE */
-
-END (_start)
diff --git a/sysdeps/tile/dl-tls.c b/sysdeps/tile/dl-tls.c
deleted file mode 100644
index 6791b98e98..0000000000
--- a/sysdeps/tile/dl-tls.c
+++ /dev/null
@@ -1,27 +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/>. */
-
-#ifdef SHARED
-/* We provide a fast-path version of __tls_get_addr to allow for
- the normal case to be fast, both by coding the function tightly,
- and more importantly by fixing its register clobber API so the
- compiler can avoid having to set up frames, etc., unnecessarily. */
-#define __tls_get_addr __tls_get_addr_slow
-#endif
-
-#include <elf/dl-tls.c>
diff --git a/sysdeps/tile/dl-trampoline.S b/sysdeps/tile/dl-trampoline.S
deleted file mode 100644
index fe0302b422..0000000000
--- a/sysdeps/tile/dl-trampoline.S
+++ /dev/null
@@ -1,193 +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 <sysdep.h>
-#include <arch/abi.h>
-
-/* This function is called via the PLT header, which is called
- from an individual PLT entry.
-
- At this point we have several values passed in:
-
- lr: return address to original user code
- r28: the tpnt value to pass to _dl_runtime_resolver
- r29: the PLT index of the invoked jump table entry.
-
- We set up a frame entry that looks like this (in int_reg_t units):
-
- +57: r25 return values from function...
- +56: r24
- [...]
- +33: r1
- +32: r0
- +31: PLT index
- +30: tpnt
- +29: stackframe
- +28: caller lr
- +27: r25 arguments to function...
- +26: r24
- [...]
- +3: r1
- +2: r0
- +1: standard ABI slot (sp)
- +0: standard ABI slot (callee lr)
-
- The entries from "stackframe" up are only used in _dl_profile_resolve.
- We save and restore r0 through r25, rather than the strictly
- architected r0 through r9, to support unusual calling conventions;
- for example, __tls_get_addr takes r0 and returns r0, but promises
- not to clobber r1 through r24 to support its usual fast path. */
-
-#define FRAME_SP (1 * REGSIZE)
-#define FRAME_REGS (2 * REGSIZE)
-#define FRAME_LR (28 * REGSIZE) /* Must follow FRAME_REGS */
-#define FRAME_STACKFRAME (29 * REGSIZE)
-#define FRAME_TPNT (30 * REGSIZE)
-#define FRAME_INDEX (31 * REGSIZE)
-#define FRAME_RETVAL (32 * REGSIZE)
-
-#define FRAME_SIZE_SMALL (30 * REGSIZE)
-#define FRAME_SIZE_LARGE (58 * REGSIZE)
-
-#define FOR_EACH_REG(f) \
- f(r0); f(r1); f(r2); f(r3); \
- f(r4); f(r5); f(r6); f(r7); \
- f(r8); f(r9); f(r10); f(r11); \
- f(r12); f(r13); f(r14); f(r15); \
- f(r16); f(r17); f(r18); f(r19); \
- f(r20); f(r21); f(r22); f(r23); \
- f(r24); f(r25)
-
-#define SAVE(REG) { ST r27, REG; ADDI_PTR r27, r27, REGSIZE }
-#define RESTORE(REG) { LD REG, r27; ADDI_PTR r27, r27, REGSIZE }
-
- .macro dl_resolve, name, profile, framesize
-.text
-.global \name
-.hidden \name
-/* Note that cpp expands ENTRY(\name) incorrectly. */
-.type \name,@function
-.align 8
-\name:
- cfi_startproc
- {
- ST sp, lr
- move r26, sp
- }
- {
- ADDLI_PTR sp, sp, -\framesize
- ADDLI_PTR r27, sp, FRAME_SP - \framesize
- }
- cfi_def_cfa_offset (\framesize)
- {
- ST r27, r26
- ADDI_PTR r27, r27, FRAME_REGS - FRAME_SP
- }
- FOR_EACH_REG(SAVE)
- {
- ST r27, lr
- ADDLI_PTR r27, sp, FRAME_TPNT
- }
- cfi_offset (lr, FRAME_LR - \framesize)
- .if \profile
- {
- move r0, r28 /* tpnt value */
- ST r27, r28
- ADDI_PTR r27, r27, FRAME_INDEX - FRAME_TPNT
- }
- {
- move r1, r29 /* PLT index */
- ST r27, r29
- }
- {
- move r2, lr /* retaddr */
- ADDI_PTR r3, sp, FRAME_REGS /* La_tile_regs pointer */
- }
- {
- ADDLI_PTR r4, sp, FRAME_STACKFRAME /* framesize pointer */
- jal _dl_profile_fixup
- }
- ADDLI_PTR r28, sp, FRAME_STACKFRAME
- LD_PTR r28, r28
- BGTZ r28, 1f
- .else
- {
- move r0, r28 /* tpnt value 1 */
- move r1, r29 /* PLT index 2 */
- }
- jal _dl_fixup
- .endif
- {
- /* Copy aside the return value so we can restore r0 below. */
- move r29, r0
- /* Set up r27 to let us start restoring registers. */
- ADDLI_PTR r27, sp, FRAME_REGS
- }
- FOR_EACH_REG(RESTORE)
- .if \profile
- ADDLI_PTR r28, sp, FRAME_STACKFRAME
- LD r28, r28
- BGTZ r28, 1f
- .endif
- {
- /* Restore original user return address. */
- LD lr, r27
- /* Pop off our stack frame. */
- ADDLI_PTR sp, sp, \framesize
- }
- cfi_def_cfa_offset (0)
- jr r29 /* Transfer control to freshly loaded code. */
- jrp lr /* Keep backtracer happy. */
-
- .if \profile
-1: jalr r29 /* Call resolved function. */
- {
- ADDLI_PTR r28, sp, FRAME_TPNT
- ADDLI_PTR r27, sp, FRAME_RETVAL
- }
- FOR_EACH_REG(SAVE)
- {
- LD r0, r28
- ADDI_PTR r28, r28, FRAME_INDEX - FRAME_TPNT
- }
- {
- LD r1, r28
- ADDLI_PTR r2, sp, FRAME_REGS
- }
- {
- ADDLI_PTR r3, sp, FRAME_RETVAL
- jal _dl_call_pltexit
- }
- {
- ADDLI_PTR lr, sp, FRAME_LR
- ADDLI_PTR r27, sp, FRAME_RETVAL
- }
- FOR_EACH_REG(RESTORE)
- {
- LD lr, lr
- ADDLI_PTR sp, sp, \framesize
- }
- jrp lr
- .endif
-END (\name)
- .endm
-
- dl_resolve _dl_runtime_resolve, 0, FRAME_SIZE_SMALL
-#ifndef PROF
- dl_resolve _dl_runtime_profile, 1, FRAME_SIZE_LARGE
-#endif
diff --git a/sysdeps/tile/ffs.c b/sysdeps/tile/ffs.c
deleted file mode 100644
index 88c8fc7ec4..0000000000
--- a/sysdeps/tile/ffs.c
+++ /dev/null
@@ -1,36 +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 <limits.h>
-#define ffsl __something_else
-#include <string.h>
-
-#undef ffs
-int
-__ffs (int x)
-{
- return __builtin_ffs (x);
-}
-weak_alias (__ffs, ffs)
-libc_hidden_def (__ffs)
-libc_hidden_builtin_def (ffs)
-
-#if ULONG_MAX == UINT_MAX
-#undef ffsl
-weak_alias (__ffs, ffsl)
-#endif
diff --git a/sysdeps/tile/ffsll.c b/sysdeps/tile/ffsll.c
deleted file mode 100644
index 7094a3c659..0000000000
--- a/sysdeps/tile/ffsll.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2011-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>
-#define ffsl __something_else
-#include <string.h>
-
-#undef ffsll
-int
-ffsll (long long x)
-{
- return __builtin_ffsll (x);
-}
-
-#if ULONG_MAX > UINT_MAX
-#undef ffsl
-weak_alias (ffsll, ffsl)
-#endif
diff --git a/sysdeps/tile/jmpbuf-offsets.h b/sysdeps/tile/jmpbuf-offsets.h
deleted file mode 100644
index fd9ee24aa1..0000000000
--- a/sysdeps/tile/jmpbuf-offsets.h
+++ /dev/null
@@ -1,62 +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/>. */
-
-/* We don't use most of these symbols; they are here for documentation. */
-#define JB_R30 0
-#define JB_R31 1
-#define JB_R32 2
-#define JB_R33 3
-#define JB_R34 4
-#define JB_R35 5
-#define JB_R36 6
-#define JB_R37 7
-#define JB_R38 8
-#define JB_R39 9
-#define JB_R40 10
-#define JB_R41 11
-#define JB_R42 12
-#define JB_R43 13
-#define JB_R44 14
-#define JB_R45 15
-#define JB_R46 16
-#define JB_R47 17
-#define JB_R48 18
-#define JB_R49 19
-#define JB_R50 20
-#define JB_R51 21
-#define JB_FP 22 /* r52 */
-#define JB_TP 23 /* r53 */
-#define JB_SP 24 /* r54 */
-#define JB_PC 25 /* normally LR, r55 */
-#define JB_ICS 26 /* interrupt critical section bit */
-
-/* We save space for some extra state to accommodate future changes. */
-#define JB_LEN 32 /* number of words */
-
-#define JB_SIZE (JB_LEN * REGSIZE)
-
-/* Helper macro used by all the setjmp/longjmp assembly code. */
-#define FOR_EACH_CALLEE_SAVED_REG(f) \
- .no_require_canonical_reg_names; f(r30); f(r31); \
- f(r32); f(r33); f(r34); f(r35); f(r36); f(r37); f(r38); f(r39); \
- f(r40); f(r41); f(r42); f(r43); f(r44); f(r45); f(r46); f(r47); \
- f(r48); f(r49); f(r50); f(r51); f(r52); f(r53); f(r54); f(r55)
-
-/* Helper for generic ____longjmp_chk(). */
-#define JB_FRAME_ADDRESS(buf) \
- ((void *) (unsigned long) (buf[JB_SP]))
diff --git a/sysdeps/tile/ldsodefs.h b/sysdeps/tile/ldsodefs.h
deleted file mode 100644
index 45970bd64f..0000000000
--- a/sysdeps/tile/ldsodefs.h
+++ /dev/null
@@ -1,40 +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/>. */
-
-#ifndef _TILE_LDSODEFS_H
-#define _TILE_LDSODEFS_H 1
-
-#include <elf.h>
-
-struct La_tile_regs;
-struct La_tile_retval;
-
-#define ARCH_PLTENTER_MEMBERS \
- ElfW(Addr) (*tile_gnu_pltenter) (ElfW(Sym) *, unsigned int, uintptr_t *, \
- uintptr_t *, struct La_tile_regs *, \
- unsigned int *, const char *, \
- long int *)
-
-#define ARCH_PLTEXIT_MEMBERS \
- ElfW(Addr) (*tile_gnu_pltexit) (ElfW(Sym) *, unsigned int, uintptr_t *, \
- uintptr_t *, const struct La_tile_regs *, \
- struct La_tile_retval *, const char *)
-
-#include_next <ldsodefs.h>
-
-#endif
diff --git a/sysdeps/tile/libm-test-ulps b/sysdeps/tile/libm-test-ulps
deleted file mode 100644
index f1a01fdb30..0000000000
--- a/sysdeps/tile/libm-test-ulps
+++ /dev/null
@@ -1,394 +0,0 @@
-# Begin of automatic generation
-
-# Maximal error of functions:
-Function: "acos":
-float: 1
-ifloat: 1
-
-Function: "acosh":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
-Function: "asin":
-float: 1
-ifloat: 1
-
-Function: "asinh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: "atan":
-float: 1
-ifloat: 1
-
-Function: "atan2":
-float: 1
-ifloat: 1
-
-Function: "atanh":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
-Function: "cabs":
-double: 1
-idouble: 1
-
-Function: Real part of "cacos":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
-
-Function: Imaginary part of "cacos":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
-
-Function: Real part of "cacosh":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
-
-Function: Imaginary part of "cacosh":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
-
-Function: "carg":
-float: 1
-ifloat: 1
-
-Function: Real part of "casin":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Imaginary part of "casin":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
-
-Function: Real part of "casinh":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
-
-Function: Imaginary part of "casinh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Real part of "catan":
-float: 1
-ifloat: 1
-
-Function: Imaginary part of "catan":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Real part of "catanh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Imaginary part of "catanh":
-float: 1
-ifloat: 1
-
-Function: "cbrt":
-double: 3
-float: 1
-idouble: 3
-ifloat: 1
-
-Function: Real part of "ccos":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Imaginary part of "ccos":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Real part of "ccosh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Imaginary part of "ccosh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Real part of "cexp":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: Imaginary part of "cexp":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
-
-Function: Real part of "clog":
-double: 3
-float: 3
-idouble: 3
-ifloat: 3
-
-Function: Imaginary part of "clog":
-float: 1
-ifloat: 1
-
-Function: Real part of "clog10":
-double: 3
-float: 4
-idouble: 3
-ifloat: 4
-
-Function: Imaginary part of "clog10":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
-Function: "cos":
-float: 1
-ifloat: 1
-
-Function: "cosh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Real part of "cpow":
-double: 2
-float: 4
-idouble: 2
-ifloat: 4
-
-Function: Imaginary part of "cpow":
-float: 2
-ifloat: 2
-
-Function: Real part of "csin":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Real part of "csinh":
-float: 1
-ifloat: 1
-
-Function: Imaginary part of "csinh":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Real part of "csqrt":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
-Function: Imaginary part of "csqrt":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
-Function: Real part of "ctan":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: Imaginary part of "ctan":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: Real part of "ctanh":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: Imaginary part of "ctanh":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
-Function: "erf":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: "erfc":
-double: 3
-float: 2
-idouble: 3
-ifloat: 2
-
-Function: "exp":
-float: 1
-ifloat: 1
-
-Function: "exp10":
-double: 2
-idouble: 2
-
-Function: "exp2":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: "expm1":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: "gamma":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-
-Function: "hypot":
-double: 1
-idouble: 1
-
-Function: "j0":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
-Function: "j1":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
-
-Function: "jn":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-
-Function: "lgamma":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-
-Function: "log":
-float: 1
-ifloat: 1
-
-Function: "log10":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
-Function: "log1p":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-
-Function: "log2":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: "pow":
-float: 3
-ifloat: 3
-
-Function: "pow10":
-double: 2
-idouble: 2
-
-Function: "sin":
-float: 1
-ifloat: 1
-
-Function: "sincos":
-float: 1
-ifloat: 1
-
-Function: "sinh":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
-Function: "tan":
-float: 1
-ifloat: 1
-
-Function: "tanh":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-
-Function: "tgamma":
-double: 5
-float: 5
-idouble: 5
-ifloat: 5
-
-Function: "y0":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-
-Function: "y1":
-double: 3
-float: 2
-idouble: 3
-ifloat: 2
-
-Function: "yn":
-double: 3
-float: 2
-idouble: 3
-ifloat: 2
-
-# end of automatic generation
diff --git a/sysdeps/tile/machine-gmon.h b/sysdeps/tile/machine-gmon.h
deleted file mode 100644
index 5f2382c503..0000000000
--- a/sysdeps/tile/machine-gmon.h
+++ /dev/null
@@ -1,25 +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/>. */
-
-#define _MCOUNT_DECL(from, self) \
- void __mcount_internal (u_long from, u_long self)
-
-/* Call __mcount_internal with our the return PC for our caller, and
- the return PC our caller will return to. Empty since we use an
- assembly stub instead. */
-#define MCOUNT
diff --git a/sysdeps/tile/math_private.h b/sysdeps/tile/math_private.h
deleted file mode 100644
index 99daec4093..0000000000
--- a/sysdeps/tile/math_private.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef TILE_MATH_PRIVATE_H
-#define TILE_MATH_PRIVATE_H 1
-
-/* Internally, we suppress any use of exception or rounding other
- than what is supported by the hardware. This does mean that some
- code will silently fail to report exceptions, set rounding mode
- as expected, etc., but it allows math code to compile that otherwise
- wouldn't (such as math/s_fma.c) and so is valuable.
-
- We intentionally ignore the "exception" arguments of functions that
- take an exception, since we can't even evaluate the argument
- without causing a build failure. The extra level of statement
- expression wrapping avoids "statement with no effect" warnings.
- Since the callers don't check for errors anyway, we just claim
- success in every case.
-
- The overrides for libc_ functions must happen before we include
- the generic math_private.h, and the overrides for regular
- <fenv.h> functions must happen afterwards, to avoid clashing with
- the declarations of those functions. */
-
-#define libc_fesetround(rnd) ({ 0; })
-#define libc_fetestexcept(exc) ({ 0; })
-#define libc_feholdexcept_setround(env, exc) ({ (void) (env); 0; })
-#define libc_feupdateenv_test(env, exc) ({ (void) (env); 0; })
-
-#include_next <math_private.h>
-
-#define feraiseexcept(excepts) ({ 0; })
-#define __feraiseexcept(excepts) ({ 0; })
-#define feclearexcept(exc) ({ 0; })
-#define fetestexcept(exc) ({ 0; })
-extern inline int fegetenv (fenv_t *__e) { return 0; }
-extern inline int __fegetenv (fenv_t *__e) { return 0; }
-extern inline int fesetenv (const fenv_t *__e) { return 0; }
-extern inline int __fesetenv (const fenv_t *__e) { return 0; }
-extern inline int feupdateenv (const fenv_t *__e) { return 0; }
-extern inline int __feupdateenv (const fenv_t *__e) { return 0; }
-extern inline int fegetround (void) { return FE_TONEAREST; }
-extern inline int __fegetround (void) { return FE_TONEAREST; }
-extern inline int fesetround (int __d) { return 0; }
-extern inline int __fesetround (int __d) { return 0; }
-
-#endif
diff --git a/sysdeps/tile/memcmp.c b/sysdeps/tile/memcmp.c
deleted file mode 100644
index 3246fb1159..0000000000
--- a/sysdeps/tile/memcmp.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/* Copyright (C) 1991-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 HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#undef __ptr_t
-#define __ptr_t void *
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#endif
-
-#undef memcmp
-
-#ifndef MEMCMP
-# define MEMCMP memcmp
-#endif
-
-#ifdef _LIBC
-
-# include <memcopy.h>
-# include <endian.h>
-
-# if __BYTE_ORDER == __BIG_ENDIAN
-# define WORDS_BIGENDIAN
-# endif
-
-#else /* Not in the GNU C library. */
-
-# include <sys/types.h>
-
-/* Type to use for aligned memory operations.
- This should normally be the biggest type supported by a single load
- and store. Must be an unsigned type. */
-# define op_t unsigned long int
-# define OPSIZ (sizeof(op_t))
-
-/* Threshold value for when to enter the unrolled loops. */
-# define OP_T_THRES 16
-
-/* Type to use for unaligned operations. */
-typedef unsigned char byte;
-
-#endif /* In the GNU C library. */
-
-/* Provide the appropriate builtins to shift two registers based on
- the alignment of a pointer held in a third register, and to reverse
- the bytes in a word. */
-#ifdef __tilegx__
-#define DBLALIGN __insn_dblalign
-#define REVBYTES __insn_revbytes
-#else
-#define DBLALIGN __insn_dword_align
-#define REVBYTES __insn_bytex
-#endif
-
-#ifdef WORDS_BIGENDIAN
-# define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1)
-#else
-# define CMP_LT_OR_GT(a, b) (REVBYTES(a) > REVBYTES(b) ? 1 : -1)
-#endif
-
-/* BE VERY CAREFUL IF YOU CHANGE THIS CODE! */
-
-/* The strategy of this memcmp is:
-
- 1. Compare bytes until one of the block pointers is aligned.
-
- 2. Compare using memcmp_common_alignment or
- memcmp_not_common_alignment, regarding the alignment of the other
- block after the initial byte operations. The maximum number of
- full words (of type op_t) are compared in this way.
-
- 3. Compare the few remaining bytes. */
-
-static int memcmp_common_alignment (long, long, size_t) __THROW;
-
-/* memcmp_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN `op_t'
- objects (not LEN bytes!). Both SRCP1 and SRCP2 should be aligned for
- memory operations on `op_t's. */
-static int
-memcmp_common_alignment (long int srcp1, long int srcp2, size_t len)
-{
- op_t a0, a1;
- op_t b0, b1;
-
- switch (len % 4)
- {
- default: /* Avoid warning about uninitialized local variables. */
- case 2:
- a0 = ((op_t *) srcp1)[0];
- b0 = ((op_t *) srcp2)[0];
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- len += 2;
- goto do1;
- case 3:
- a1 = ((op_t *) srcp1)[0];
- b1 = ((op_t *) srcp2)[0];
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- len += 1;
- goto do2;
- case 0:
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- return 0;
- a0 = ((op_t *) srcp1)[0];
- b0 = ((op_t *) srcp2)[0];
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- goto do3;
- case 1:
- a1 = ((op_t *) srcp1)[0];
- b1 = ((op_t *) srcp2)[0];
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- len -= 1;
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- goto do0;
- /* Fall through. */
- }
-
- do
- {
- a0 = ((op_t *) srcp1)[0];
- b0 = ((op_t *) srcp2)[0];
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- if (__glibc_likely (a1 != b1))
- return CMP_LT_OR_GT (a1, b1);
-
- do3:
- a1 = ((op_t *) srcp1)[0];
- b1 = ((op_t *) srcp2)[0];
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- if (__glibc_likely (a0 != b0))
- return CMP_LT_OR_GT (a0, b0);
-
- do2:
- a0 = ((op_t *) srcp1)[0];
- b0 = ((op_t *) srcp2)[0];
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- if (__glibc_likely (a1 != b1))
- return CMP_LT_OR_GT (a1, b1);
-
- do1:
- a1 = ((op_t *) srcp1)[0];
- b1 = ((op_t *) srcp2)[0];
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- if (__glibc_likely (a0 != b0))
- return CMP_LT_OR_GT (a0, b0);
-
- len -= 4;
- }
- while (len != 0);
-
- /* This is the right position for do0. Please don't move
- it into the loop. */
- do0:
- if (__glibc_likely (a1 != b1))
- return CMP_LT_OR_GT (a1, b1);
- return 0;
-}
-
-static int memcmp_not_common_alignment (long, long, size_t) __THROW;
-
-/* memcmp_not_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN
- `op_t' objects (not LEN bytes!). SRCP2 should be aligned for memory
- operations on `op_t', but SRCP1 *should be unaligned*. */
-static int
-memcmp_not_common_alignment (long int srcp1, long int srcp2, size_t len)
-{
- void * srcp1i;
- op_t a0, a1, a2, a3;
- op_t b0, b1, b2, b3;
- op_t x;
-
- /* Calculate how to shift a word read at the memory operation
- aligned srcp1 to make it aligned for comparison. */
-
- srcp1i = (void *) srcp1;
-
- /* Make SRCP1 aligned by rounding it down to the beginning of the `op_t'
- it points in the middle of. */
- srcp1 &= -OPSIZ;
-
- switch (len % 4)
- {
- default: /* Avoid warning about uninitialized local variables. */
- case 2:
- a1 = ((op_t *) srcp1)[0];
- a2 = ((op_t *) srcp1)[1];
- b2 = ((op_t *) srcp2)[0];
- srcp1 += 2 * OPSIZ;
- srcp2 += 1 * OPSIZ;
- len += 2;
- goto do1;
- case 3:
- a0 = ((op_t *) srcp1)[0];
- a1 = ((op_t *) srcp1)[1];
- b1 = ((op_t *) srcp2)[0];
- srcp1 += 2 * OPSIZ;
- srcp2 += 1 * OPSIZ;
- len += 1;
- goto do2;
- case 0:
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- return 0;
- a3 = ((op_t *) srcp1)[0];
- a0 = ((op_t *) srcp1)[1];
- b0 = ((op_t *) srcp2)[0];
- srcp1 += 2 * OPSIZ;
- srcp2 += 1 * OPSIZ;
- goto do3;
- case 1:
- a2 = ((op_t *) srcp1)[0];
- a3 = ((op_t *) srcp1)[1];
- b3 = ((op_t *) srcp2)[0];
- srcp1 += 2 * OPSIZ;
- srcp2 += 1 * OPSIZ;
- len -= 1;
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- goto do0;
- /* Fall through. */
- }
-
- do
- {
- a0 = ((op_t *) srcp1)[0];
- b0 = ((op_t *) srcp2)[0];
- x = DBLALIGN (a2, a3, srcp1i);
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- if (__glibc_likely (x != b3))
- return CMP_LT_OR_GT (x, b3);
-
- do3:
- a1 = ((op_t *) srcp1)[0];
- b1 = ((op_t *) srcp2)[0];
- x = DBLALIGN (a3, a0, srcp1i);
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- if (__glibc_likely (x != b0))
- return CMP_LT_OR_GT (x, b0);
-
- do2:
- a2 = ((op_t *) srcp1)[0];
- b2 = ((op_t *) srcp2)[0];
- x = DBLALIGN (a0, a1, srcp1i);
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- if (__glibc_likely (x != b1))
- return CMP_LT_OR_GT (x, b1);
-
- do1:
- a3 = ((op_t *) srcp1)[0];
- b3 = ((op_t *) srcp2)[0];
- x = DBLALIGN (a1, a2, srcp1i);
- srcp1 += OPSIZ;
- srcp2 += OPSIZ;
- if (__glibc_likely (x != b2))
- return CMP_LT_OR_GT (x, b2);
-
- len -= 4;
- }
- while (len != 0);
-
- /* This is the right position for do0. Please don't move
- it into the loop. */
- do0:
- x = DBLALIGN (a2, a3, srcp1i);
- if (__glibc_likely (x != b3))
- return CMP_LT_OR_GT (x, b3);
- return 0;
-}
-
-int
-MEMCMP (const __ptr_t s1, const __ptr_t s2, size_t len)
-{
- op_t a0;
- op_t b0;
- long int srcp1 = (long int) s1;
- long int srcp2 = (long int) s2;
- int res;
-
- if (len >= OP_T_THRES)
- {
- /* There are at least some bytes to compare. No need to test
- for LEN == 0 in this alignment loop. */
- while (srcp2 % OPSIZ != 0)
- {
- a0 = ((byte *) srcp1)[0];
- b0 = ((byte *) srcp2)[0];
- srcp1 += 1;
- srcp2 += 1;
- res = a0 - b0;
- if (__glibc_likely (res != 0))
- return res;
- len -= 1;
- }
-
- /* SRCP2 is now aligned for memory operations on `op_t'.
- SRCP1 alignment determines if we can do a simple,
- aligned compare or need to shuffle bits. */
-
- if (srcp1 % OPSIZ == 0)
- res = memcmp_common_alignment (srcp1, srcp2, len / OPSIZ);
- else
- res = memcmp_not_common_alignment (srcp1, srcp2, len / OPSIZ);
- if (res != 0)
- return res;
-
- /* Number of bytes remaining in the interval [0..OPSIZ-1]. */
- srcp1 += len & -OPSIZ;
- srcp2 += len & -OPSIZ;
- len %= OPSIZ;
- }
-
- /* There are just a few bytes to compare. Use byte memory operations. */
- while (len != 0)
- {
- a0 = ((byte *) srcp1)[0];
- b0 = ((byte *) srcp2)[0];
- srcp1 += 1;
- srcp2 += 1;
- res = a0 - b0;
- if (__glibc_likely (res != 0))
- return res;
- len -= 1;
- }
-
- return 0;
-}
-libc_hidden_builtin_def(memcmp)
-#ifdef weak_alias
-# undef bcmp
-weak_alias (memcmp, bcmp)
-#endif
diff --git a/sysdeps/tile/memcopy.h b/sysdeps/tile/memcopy.h
deleted file mode 100644
index af6755fb99..0000000000
--- a/sysdeps/tile/memcopy.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* memcopy.h -- definitions for memory copy functions. Tile version.
- 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/>. */
-
-#include <sysdeps/generic/memcopy.h>
-#include <bits/wordsize.h>
-
-/* The tilegx implementation of memcpy is safe to use for memmove. */
-#ifdef __tilegx__
-# undef MEMCPY_OK_FOR_FWD_MEMMOVE
-# define MEMCPY_OK_FOR_FWD_MEMMOVE 1
-#endif
-
-/* Support more efficient copying on tilegx32, which supports
- long long as a native 64-bit type. */
-#if defined (__tilegx__) && __WORDSIZE == 32
-# undef op_t
-# define op_t unsigned long long int
-#endif
diff --git a/sysdeps/tile/nptl/Makefile b/sysdeps/tile/nptl/Makefile
deleted file mode 100644
index f1859e2728..0000000000
--- a/sysdeps/tile/nptl/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2002-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),csu)
-gen-as-const-headers += tcb-offsets.sym
-endif
diff --git a/sysdeps/tile/nptl/bits/pthreadtypes.h b/sysdeps/tile/nptl/bits/pthreadtypes.h
deleted file mode 100644
index 7d6865066a..0000000000
--- a/sysdeps/tile/nptl/bits/pthreadtypes.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Based on work contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
- 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/>. */
-
-#ifndef _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define __SIZEOF_PTHREAD_ATTR_T 56
-# define __SIZEOF_PTHREAD_MUTEX_T 40
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 56
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 32
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#else
-# define __SIZEOF_PTHREAD_ATTR_T 36
-# define __SIZEOF_PTHREAD_MUTEX_T 24
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 32
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 20
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#endif
-
-
-/* Thread identifiers. The structure of the attribute type is not
- exposed on purpose. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-#if __WORDSIZE == 64
-typedef struct __pthread_internal_list
-{
- struct __pthread_internal_list *__prev;
- struct __pthread_internal_list *__next;
-} __pthread_list_t;
-#else
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-#endif
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is not exposed on purpose. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
-#if __WORDSIZE == 64
- unsigned int __nusers;
-#endif
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
-#if __WORDSIZE == 64
- int __spins;
- __pthread_list_t __list;
-# define __PTHREAD_MUTEX_HAVE_PREV 1
-#else
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
-#endif
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is not exposed on purpose. */
-typedef union
-{
-# if __WORDSIZE == 64
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- int __writer;
- int __shared;
- unsigned long int __pad1;
- unsigned long int __pad2;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned int __flags;
- } __data;
-# else
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- unsigned char __shared;
- unsigned char __pad1;
- unsigned char __pad2;
- int __writer;
- } __data;
-# endif
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/tile/nptl/bits/semaphore.h b/sysdeps/tile/nptl/bits/semaphore.h
deleted file mode 100644
index 0c0fd9ba1d..0000000000
--- a/sysdeps/tile/nptl/bits/semaphore.h
+++ /dev/null
@@ -1,41 +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.
- Based on work 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/>. */
-
-#ifndef _SEMAPHORE_H
-# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
-#endif
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define __SIZEOF_SEM_T 32
-#else
-# define __SIZEOF_SEM_T 16
-#endif
-
-
-/* Value returned if `sem_open' failed. */
-#define SEM_FAILED ((sem_t *) 0)
-
-
-typedef union
-{
- char __size[__SIZEOF_SEM_T];
- long int __align;
-} sem_t;
diff --git a/sysdeps/tile/nptl/pthread_spin_lock.c b/sysdeps/tile/nptl/pthread_spin_lock.c
deleted file mode 100644
index a88a302f86..0000000000
--- a/sysdeps/tile/nptl/pthread_spin_lock.c
+++ /dev/null
@@ -1,56 +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 "pthreadP.h"
-#include <arch/spr_def.h>
-#include <atomic.h>
-
-/* Bound point for bounded exponential backoff */
-#define BACKOFF_MAX 2048
-
-/* Initial cycle delay for exponential backoff */
-#define BACKOFF_START 32
-
-#ifdef __tilegx__
-/* Use cmpexch() after the initial fast-path exch to avoid
- invalidating the cache line of the lock holder. */
-# define TNS(p) atomic_exchange_acq((p), 1)
-# define CMPTNS(p) atomic_compare_and_exchange_val_acq((p), 1, 0)
-#else
-# define TNS(p) __insn_tns(p)
-# define CMPTNS(p) __insn_tns(p)
-# define SPR_CYCLE SPR_CYCLE_LOW /* The low 32 bits are sufficient. */
-#endif
-
-int
-pthread_spin_lock (pthread_spinlock_t *lock)
-{
- if (__builtin_expect (TNS (lock) != 0, 0))
- {
- unsigned int backoff = BACKOFF_START;
- while (CMPTNS (lock) != 0)
- {
- unsigned int start = __insn_mfspr (SPR_CYCLE);
- while (__insn_mfspr (SPR_CYCLE) - start < backoff)
- ;
- if (backoff < BACKOFF_MAX)
- backoff *= 2;
- }
- }
- return 0;
-}
diff --git a/sysdeps/tile/nptl/pthread_spin_trylock.c b/sysdeps/tile/nptl/pthread_spin_trylock.c
deleted file mode 100644
index 5dbb9f123c..0000000000
--- a/sysdeps/tile/nptl/pthread_spin_trylock.c
+++ /dev/null
@@ -1,32 +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 "pthreadP.h"
-#include <errno.h>
-
-#ifdef __tilegx__
-#define TNS(p) __insn_exch4((p), 1)
-#else
-#define TNS(p) __insn_tns(p)
-#endif
-
-int
-pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- return (TNS (lock) == 0) ? 0 : EBUSY;
-}
diff --git a/sysdeps/tile/nptl/pthread_spin_unlock.c b/sysdeps/tile/nptl/pthread_spin_unlock.c
deleted file mode 100644
index 989a1da1db..0000000000
--- a/sysdeps/tile/nptl/pthread_spin_unlock.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* pthread_spin_unlock -- unlock a spin lock. Tile version.
- 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/>. */
-
-#include "pthreadP.h"
-#include <atomic.h>
-
-int
-pthread_spin_unlock (pthread_spinlock_t *lock)
-{
-#ifdef __tilegx__
- /* Use exchange() to bypass the write buffer. */
- atomic_exchange_rel (lock, 0);
-#else
- atomic_full_barrier ();
- *lock = 0;
-#endif
- return 0;
-}
diff --git a/sysdeps/tile/nptl/tcb-offsets.sym b/sysdeps/tile/nptl/tcb-offsets.sym
deleted file mode 100644
index 6740bc976f..0000000000
--- a/sysdeps/tile/nptl/tcb-offsets.sym
+++ /dev/null
@@ -1,17 +0,0 @@
-#define SHARED /* needed to get struct rtld_global from <ldsodefs.h> */
-#include <sysdep.h>
-#include <tls.h>
-#include <ldsodefs.h>
-
---
-
--- Abuse tls.h macros to derive offsets relative to the thread register.
-#define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
-
-MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
-PID_OFFSET thread_offsetof (pid)
-TID_OFFSET thread_offsetof (tid)
-POINTER_GUARD (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
-FEEDBACK_DATA_OFFSET (offsetof (tcbhead_t, feedback_data) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
-DTV_OFFSET (offsetof (tcbhead_t, dtv) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
-TLS_GENERATION_OFFSET offsetof (struct rtld_global, _dl_tls_generation)
diff --git a/sysdeps/tile/nptl/tls.h b/sysdeps/tile/nptl/tls.h
deleted file mode 100644
index c908fb8e1f..0000000000
--- a/sysdeps/tile/nptl/tls.h
+++ /dev/null
@@ -1,199 +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/>. */
-
-#ifndef _TLS_H
-#define _TLS_H 1
-
-# include <dl-sysdep.h>
-
-#ifndef __ASSEMBLER__
-# include <stdbool.h>
-# include <stddef.h>
-# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
-
-#else /* __ASSEMBLER__ */
-# include <tcb-offsets.h>
-#endif /* __ASSEMBLER__ */
-
-
-#ifndef __ASSEMBLER__
-
-/* Get system call information. */
-# include <sysdep.h>
-
-/* The TP points to the start of the thread blocks. */
-# define TLS_DTV_AT_TP 1
-# define TLS_TCB_AT_TP 0
-
-/* We use the multiple_threads field in the pthread struct */
-#define TLS_MULTIPLE_THREADS_IN_TCB 1
-
-/* Get the thread descriptor definition. */
-# include <nptl/descr.h>
-
-/* The stack_guard is accessed directly by GCC -fstack-protector code,
- so it is a part of public ABI. The dtv and pointer_guard fields
- are private. */
-typedef struct
-{
- void *feedback_data;
- uintptr_t pointer_guard;
- uintptr_t stack_guard;
- dtv_t *dtv;
-} tcbhead_t;
-
-/* This is the size of the initial TCB. Because our TCB is before the thread
- pointer, we don't need this. */
-# define TLS_INIT_TCB_SIZE 0
-
-/* Alignment requirements for the initial TCB. */
-# define TLS_INIT_TCB_ALIGN __alignof__ (struct pthread)
-
-/* This is the size of the TCB. Because our TCB is before the thread
- pointer, we don't need this. */
-# define TLS_TCB_SIZE 0
-
-/* Alignment requirements for the TCB. */
-# define TLS_TCB_ALIGN __alignof__ (struct pthread)
-
-/* This is the size we need before TCB - actually, it includes the TCB. */
-# define TLS_PRE_TCB_SIZE \
- (sizeof (struct pthread) \
- + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1)))
-
-/* Return the thread descriptor (tp) for the current thread. */
-register void *__thread_pointer asm ("tp");
-
-/* The thread pointer (in hardware register tp) points to the end of
- the TCB. The pthread_descr structure is immediately in front of the TCB. */
-# define TLS_TCB_OFFSET 0
-
-/* Install the dtv pointer. The pointer passed is to the element with
- index -1 which contain the length. */
-# define INSTALL_DTV(tcbp, dtvp) \
- (((tcbhead_t *) (tcbp))[-1].dtv = (dtvp) + 1)
-
-/* Install new dtv for current thread. */
-# define INSTALL_NEW_DTV(dtv) (THREAD_DTV() = (dtv))
-
-/* Return dtv of given thread descriptor. */
-# define GET_DTV(tcbp) (((tcbhead_t *) (tcbp))[-1].dtv)
-
-/* Code to initially initialize the thread pointer (tp). */
-# define TLS_INIT_TP(tcbp) \
- (__thread_pointer = (char *)(tcbp) + TLS_TCB_OFFSET, NULL)
-
-/* Value passed to 'clone' for initialization of the thread register. */
-# define TLS_DEFINE_INIT_TP(tp, pd) \
- void *tp = (void *) (pd) + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE
-
-/* Return the address of the dtv for the current thread. */
-# define THREAD_DTV() \
- (((tcbhead_t *) (__thread_pointer - TLS_TCB_OFFSET))[-1].dtv)
-
-/* Return the thread descriptor for the current thread. */
-# define THREAD_SELF \
- ((struct pthread *) (__thread_pointer \
- - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
-
-/* Magic for libthread_db to know how to do THREAD_SELF. */
-#ifdef __tilegx__
-# define DB_THREAD_SELF \
- REGISTER (64, 64, REG_TP * 8, - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
-#else
-# define DB_THREAD_SELF \
- REGISTER (32, 32, REG_TP * 4, - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
-#endif
-
-/* Read member of the thread descriptor directly. */
-# define THREAD_GETMEM(descr, member) (descr->member)
-
-/* Same as THREAD_GETMEM, but the member offset can be non-constant. */
-# define THREAD_GETMEM_NC(descr, member, idx) \
- (descr->member[idx])
-
-/* Set member of the thread descriptor directly. */
-# define THREAD_SETMEM(descr, member, value) \
- (descr->member = (value))
-
-/* Same as THREAD_SETMEM, but the member offset can be non-constant. */
-# define THREAD_SETMEM_NC(descr, member, idx, value) \
- (descr->member[idx] = (value))
-
-/* Set the stack guard field in TCB head. */
-# define THREAD_SET_STACK_GUARD(value) \
- (((tcbhead_t *) ((char *) __thread_pointer \
- - TLS_TCB_OFFSET))[-1].stack_guard = (value))
-# define THREAD_COPY_STACK_GUARD(descr) \
- (((tcbhead_t *) ((char *) (descr) \
- + TLS_PRE_TCB_SIZE))[-1].stack_guard \
- = ((tcbhead_t *) ((char *) __thread_pointer \
- - TLS_TCB_OFFSET))[-1].stack_guard)
-
-/* Set the pointer guard field in TCB head. */
-# define THREAD_GET_POINTER_GUARD() \
- (((tcbhead_t *) ((char *) __thread_pointer \
- - TLS_TCB_OFFSET))[-1].pointer_guard)
-# define THREAD_SET_POINTER_GUARD(value) \
- (THREAD_GET_POINTER_GUARD () = (value))
-# define THREAD_COPY_POINTER_GUARD(descr) \
- (((tcbhead_t *) ((char *) (descr) \
- + TLS_PRE_TCB_SIZE))[-1].pointer_guard \
- = THREAD_GET_POINTER_GUARD())
-
-/* l_tls_offset == 0 is perfectly valid on Tile, so we have to use some
- different value to mean unset l_tls_offset. */
-# define NO_TLS_OFFSET -1
-
-/* Get and set the global scope generation counter in struct pthread. */
-#define THREAD_GSCOPE_FLAG_UNUSED 0
-#define THREAD_GSCOPE_FLAG_USED 1
-#define THREAD_GSCOPE_FLAG_WAIT 2
-#define THREAD_GSCOPE_RESET_FLAG() \
- do \
- { int __res \
- = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
- THREAD_GSCOPE_FLAG_UNUSED); \
- if (__res == THREAD_GSCOPE_FLAG_WAIT) \
- lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
- } \
- while (0)
-#define THREAD_GSCOPE_SET_FLAG() \
- do \
- { \
- THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED; \
- atomic_write_barrier (); \
- } \
- while (0)
-#define THREAD_GSCOPE_WAIT() \
- GL(dl_wait_lookup_done) ()
-
-#endif /* __ASSEMBLER__ */
-
-#endif /* tls.h */
diff --git a/sysdeps/tile/preconfigure b/sysdeps/tile/preconfigure
deleted file mode 100644
index dfe050cc6d..0000000000
--- a/sysdeps/tile/preconfigure
+++ /dev/null
@@ -1,12 +0,0 @@
-# This is a -*- sh -*-
-case "$machine" in
- tilepro)
- base_machine=tile machine=tile/tilepro ;;
- tilegx)
- base_machine=tile
- if $CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep -q __LP64__; then
- machine=tile/tilegx/tilegx64
- else
- machine=tile/tilegx/tilegx32
- fi ;;
-esac
diff --git a/sysdeps/tile/s_fma.c b/sysdeps/tile/s_fma.c
deleted file mode 100644
index d9613fa67c..0000000000
--- a/sysdeps/tile/s_fma.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <soft-fp/fmadf4.c>
diff --git a/sysdeps/tile/s_fmaf.c b/sysdeps/tile/s_fmaf.c
deleted file mode 100644
index aa5c9b2d91..0000000000
--- a/sysdeps/tile/s_fmaf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <soft-fp/fmasf4.c>
diff --git a/sysdeps/tile/setjmp.S b/sysdeps/tile/setjmp.S
deleted file mode 100644
index 4f08e9a9c2..0000000000
--- a/sysdeps/tile/setjmp.S
+++ /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 <sysdep.h>
-#include <jmpbuf-offsets.h>
-
- .text
-
- /* Keep traditional entry points in with sigsetjmp(). */
-ENTRY(setjmp)
- { movei r1, 1; j 1f }
-END(setjmp)
-
-ENTRY(_setjmp)
- { movei r1, 0; j 1f }
-END(_setjmp)
-libc_hidden_def (_setjmp)
-
-ENTRY(__sigsetjmp)
- FEEDBACK_ENTER(__sigsetjmp)
-1:
- move r2, r0
-
-#define SAVE(r) { ST r2, r ; ADDI_PTR r2, r2, REGSIZE }
- FOR_EACH_CALLEE_SAVED_REG(SAVE)
-
- mfspr r3, INTERRUPT_CRITICAL_SECTION
- ST r2, r3
- j plt(__sigjmp_save)
- jrp lr /* Keep the backtracer happy. */
-END(__sigsetjmp)
diff --git a/sysdeps/tile/sfp-machine.h b/sysdeps/tile/sfp-machine.h
deleted file mode 100644
index aad7791543..0000000000
--- a/sysdeps/tile/sfp-machine.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Machine-dependent software floating-point definitions, tile version.
- 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/>. */
-
-#include <bits/wordsize.h>
-
-#define _FP_W_TYPE_SIZE __WORDSIZE
-#define _FP_W_TYPE unsigned long
-#define _FP_WS_TYPE signed long
-#define _FP_I_TYPE long
-
-#if _FP_W_TYPE_SIZE == 64
-
-#define _FP_MUL_MEAT_S(R,X,Y) \
- _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y)
-#define _FP_MUL_MEAT_D(R,X,Y) \
- _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_Q(R,X,Y) \
- _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_MUL_MEAT_DW_S(R,X,Y) \
- _FP_MUL_MEAT_DW_1_imm(_FP_WFRACBITS_S,R,X,Y)
-#define _FP_MUL_MEAT_DW_D(R,X,Y) \
- _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_DW_Q(R,X,Y) \
- _FP_MUL_MEAT_DW_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
-#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
-#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
-
-#define _FP_NANFRAC_S _FP_QNANBIT_S
-#define _FP_NANFRAC_D _FP_QNANBIT_D
-#define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0
-
-#else /* _FP_W_TYPE_SIZE == 32 */
-
-#define _FP_MUL_MEAT_S(R,X,Y) \
- _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_D(R,X,Y) \
- _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_Q(R,X,Y) \
- _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_MUL_MEAT_DW_S(R,X,Y) \
- _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_DW_D(R,X,Y) \
- _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_DW_Q(R,X,Y) \
- _FP_MUL_MEAT_DW_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
-#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
-#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
-
-#define _FP_NANFRAC_S _FP_QNANBIT_S
-#define _FP_NANFRAC_D _FP_QNANBIT_D, 0
-#define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0, 0, 0
-
-#endif
-
-#define _FP_NANSIGN_S 1
-#define _FP_NANSIGN_D 1
-#define _FP_NANSIGN_Q 1
-
-#define _FP_KEEPNANFRACP 1
-#define _FP_QNANNEGATEDP 0
-
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
- do { \
- if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
- && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
- { \
- R##_s = Y##_s; \
- _FP_FRAC_COPY_##wc(R,Y); \
- } \
- else \
- { \
- R##_s = X##_s; \
- _FP_FRAC_COPY_##wc(R,X); \
- } \
- R##_c = FP_CLS_NAN; \
- } while (0)
-
-#define _FP_TININESS_AFTER_ROUNDING 0
diff --git a/sysdeps/tile/sotruss-lib.c b/sysdeps/tile/sotruss-lib.c
deleted file mode 100644
index 80b578635b..0000000000
--- a/sysdeps/tile/sotruss-lib.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Override generic sotruss-lib.c to define actual functions for tile.
- 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/>. */
-
-#define HAVE_ARCH_PLTENTER
-#define HAVE_ARCH_PLTEXIT
-
-#include <elf/sotruss-lib.c>
-
-ElfW(Addr)
-la_tile_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
- unsigned int ndx __attribute__ ((unused)),
- uintptr_t *refcook, uintptr_t *defcook,
- La_tile_regs *regs, unsigned int *flags,
- const char *symname, long int *framesizep)
-{
- print_enter (refcook, defcook, symname,
- regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
- *flags);
-
- /* No need to copy anything, we will not need the parameters in any case. */
- *framesizep = 0;
-
- return sym->st_value;
-}
-
-unsigned int
-la_tile_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, const struct La_tile_regs *inregs,
- struct La_tile_retval *outregs, const char *symname)
-{
- print_exit (refcook, defcook, symname, outregs->lrv_reg[0]);
-
- return 0;
-}
diff --git a/sysdeps/tile/stackguard-macros.h b/sysdeps/tile/stackguard-macros.h
deleted file mode 100644
index f2e041b99b..0000000000
--- a/sysdeps/tile/stackguard-macros.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <bits/wordsize.h>
-
-#ifdef __tilegx__
-# if __WORDSIZE == 64
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("addi %0, tp, -16; ld %0, %0" : "=r" (x)); x; })
-# define POINTER_CHK_GUARD \
- ({ uintptr_t x; asm ("addi %0, tp, -24; ld %0, %0" : "=r" (x)); x; })
-# else
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("addi %0, tp, -8; ld4s %0, %0" : "=r" (x)); x; })
-# define POINTER_CHK_GUARD \
- ({ uintptr_t x; asm ("addi %0, tp, -12; ld4s %0, %0" : "=r" (x)); x; })
-# endif
-#else
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("addi %0, tp, -8; lw %0, %0" : "=r" (x)); x; })
-# define POINTER_CHK_GUARD \
- ({ uintptr_t x; asm ("addi %0, tp, -12; lw %0, %0" : "=r" (x)); x; })
-#endif
diff --git a/sysdeps/tile/stackinfo.h b/sysdeps/tile/stackinfo.h
deleted file mode 100644
index 4a2fd85565..0000000000
--- a/sysdeps/tile/stackinfo.h
+++ /dev/null
@@ -1,48 +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/>. */
-
-/* This file contains a bit of information about the stack allocation
- of the processor. */
-
-#ifndef _STACKINFO_H
-#define _STACKINFO_H 1
-
-#include <elf.h>
-
-/* On tile the stack grows down. */
-#define _STACK_GROWS_DOWN 1
-
-/* Default to a non-executable stack. */
-#define DEFAULT_STACK_PERMS (PF_R|PF_W)
-
-/* Access to the stack pointer. The macros are used in alloca_account
- for which they need to act as barriers as well, hence the additional
- (unnecessary) parameters. */
-#define stackinfo_get_sp() \
- ({ void *p__; asm volatile ("move %0, sp" : "=r" (p__)); p__; })
-#if defined __tilegx__ && __WORDSIZE == 32
-#define __stackinfo_sub "subx"
-#else
-#define __stackinfo_sub "sub"
-#endif
-#define stackinfo_sub_sp(ptr) \
- ({ ptrdiff_t d__; \
- asm volatile (__stackinfo_sub " %0, %0, sp" : "=r" (d__) : "0" (ptr)); \
- d__; })
-
-#endif /* stackinfo.h */
diff --git a/sysdeps/tile/start.S b/sysdeps/tile/start.S
deleted file mode 100644
index 911f66f319..0000000000
--- a/sysdeps/tile/start.S
+++ /dev/null
@@ -1,203 +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.
-
- In addition to the permissions in the GNU Lesser General Public
- License, the Free Software Foundation gives you unlimited
- permission to link the compiled version of this file with other
- programs, and to distribute those programs without any restriction
- coming from the use of this file. (The GNU Lesser General Public
- License restrictions do apply in other respects; for example, they
- cover modification of the file, and distribution when not linked
- into another program.)
-
- Note that people who make modified versions of this file are not
- obligated to grant this special exception for their modified
- versions; it is their choice whether to do so. The GNU Lesser
- General Public License gives permission to release a modified
- version without this exception; this exception also makes it
- possible to release a modified version which carries forward this
- exception.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 is the canonical entry point, usually the first thing in the text
- segment. The ELF standard tells us that the stack is set up like this on
- entry (the left side is the offset from "sp"), in units of
- __SIZEOF_POINTER__ entries:
-
- +0 argc
- +1 argv[0]
- ...
- +(argc+1) NULL
- +(argc+2) envp[0]
- ...
- NULL
- ... ElfInfo
-
- The ElfInfo is pairs of key/value long words following the envp
- pointers and terminated by a zero-valued key.
-
- Although not mandated by the standard, it happens to be the case
- that we store the actual argv and envp strings immediately after
- the ElfInfo data on the stack.
-
- On entry r0 points to the shared library termination function, or 0
- if there isn't one.
-*/
-
-#include <features.h>
-#include <sysdep.h>
-#include <arch/abi.h>
-
-/* Just create no-ops if we don't support PC-relative PLT relocations. */
-#ifdef NO_PLT_PCREL
-# define hw2_last_plt(x) 0
-# define hw1_plt(x) 0
-# define hw0_plt(x) 0
-#endif
-
- .text
- .global _start
- .type _start,@function
- .align 8
-_start:
- /* Linux starts us with sp pointing at the conventional Elf layout,
- but we need to allow two "caller" words for our ABI convention. */
- {
- /* Load argc (stored as a "long", equivalent to a pointer type). */
- LD_PTR r1, sp
-
- /* Save incoming 'sp', which points to the Elf argument block. */
- move r52, sp
- }
-
- {
- /* Allocate stack frame callee space for __libc_start_main. */
- ADDI_PTR r12, sp, -(2 * REGSIZE)
- }
-
- {
- /* Get our PC. */
- lnk r13
-
- /* sp is not necessarily properly aligned on startup because
- of the way ld.so pops off leading argv elements. So align it. */
- andi sp, r12, -8
- }
-.Lmy_pc:
-
- {
- /* Pass the address of the shared library termination function. */
- move r5, r0
-
- /* Compute location where __libc_start_main's caller is supposed to
- store its frame pointer. */
- ADDI_PTR r12, sp, REGSIZE
-
- /* Zero out callee space for return address. Unnecessary but free.
- This is just paranoia to help backtracing not go awry. */
- ST sp, zero
- }
- {
- /* Zero out our frame pointer for __libc_start_main. */
- ST r12, zero
-
- /* Zero out lr to make __libc_start_main the end of backtrace. */
- move lr, zero
-
- /* Compute a pointer to argv. envp will be determined
- later in __libc_start_main. We set up the first argument
- (the address of main) below. */
- ADDI_PTR r2, r52, __SIZEOF_POINTER__
- }
- {
- /* Pass the highest stack address to user code. */
- ADDI_PTR r6, sp, (2 * REGSIZE)
-
- /* Pass address of main() in r0, and of our own entry
- points to .fini and .init in r3 and r4. */
-#ifdef __tilegx__
- moveli r0, hw2_last(main - .Lmy_pc)
- }
- {
- shl16insli r0, r0, hw1(main - .Lmy_pc)
- moveli r3, hw2_last(__libc_csu_init - .Lmy_pc)
- }
- {
- shl16insli r0, r0, hw0(main - .Lmy_pc)
- shl16insli r3, r3, hw1(__libc_csu_init - .Lmy_pc)
- }
- {
- ADD_PTR r0, r0, r13
- shl16insli r3, r3, hw0(__libc_csu_init - .Lmy_pc)
- }
- {
- moveli r12, hw2_last_plt(__libc_start_main - .Lmy_pc)
- ADD_PTR r3, r3, r13
- }
- {
- shl16insli r12, r12, hw1_plt(__libc_start_main - .Lmy_pc)
- moveli r4, hw2_last(__libc_csu_fini - .Lmy_pc)
- }
- {
- shl16insli r12, r12, hw0_plt(__libc_start_main - .Lmy_pc)
- shl16insli r4, r4, hw1(__libc_csu_fini - .Lmy_pc)
- }
- {
- ADD_PTR r12, r12, r13
- shl16insli r4, r4, hw0(__libc_csu_fini - .Lmy_pc)
- }
- {
- ADD_PTR r4, r4, r13
-# ifdef NO_PLT_PCREL
- j plt(__libc_start_main)
-# else
- jr r12
-# endif
- }
-#else
- addli r0, r13, lo16(main - .Lmy_pc)
- }
- {
- auli r0, r0, ha16(main - .Lmy_pc)
- addli r3, r13, lo16(__libc_csu_init - .Lmy_pc)
- }
- {
- auli r3, r3, ha16(__libc_csu_init - .Lmy_pc)
- addli r4, r13, lo16(__libc_csu_fini - .Lmy_pc)
- }
- {
- auli r4, r4, ha16(__libc_csu_fini - .Lmy_pc)
- /* Call the user's main function, and exit with its value.
- But let the libc call main. */
- j plt(__libc_start_main)
- }
-#endif
-
- {
- /* Tell backtracer to give up (_start has no caller). */
- info INFO_OP_CANNOT_BACKTRACE
- }
-.size _start, .-_start
-
-/* Define a symbol for the first piece of initialized data. */
- .data
- .global __data_start
- .align 8
-__data_start:
- .long 0
- .weak data_start
- data_start = __data_start
diff --git a/sysdeps/tile/sysdep.h b/sysdeps/tile/sysdep.h
deleted file mode 100644
index e0adb948bf..0000000000
--- a/sysdeps/tile/sysdep.h
+++ /dev/null
@@ -1,110 +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 <sysdeps/generic/sysdep.h>
-#include <bits/wordsize.h>
-#include <arch/abi.h>
-
-#if defined __ASSEMBLER__ || defined REQUEST_ASSEMBLER_MACROS
-
-#include <feedback.h>
-
-/* Make use of .size directive. */
-#define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
-
-/* Define an entry point visible from C. */
-#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- .type C_SYMBOL_NAME(name),@function; \
- .align 8; \
- C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- ASM_SIZE_DIRECTIVE(name)
-
-/* Since C identifiers are not normally prefixed with an underscore
- on this system, the asm identifier `syscall_error' intrudes on the
- C name space. Make sure we use an innocuous name. */
-#define syscall_error __syscall_error
-#define mcount __mcount
-
-/* If compiled for profiling, call `mcount' at the start of each function.
- The mcount code requires the caller PC in r10. The `mcount' function
- sets lr back to the value r10 had on entry when it returns. */
-#ifdef PROF
-#define CALL_MCOUNT { move r10, lr; jal mcount }
-#else
-#define CALL_MCOUNT /* Do nothing. */
-#endif
-
-/* Local label name for asm code. */
-#define L(name) .L##name
-
-/* Specify the size in bytes of a machine register. */
-#ifdef __tilegx__
-#define REGSIZE 8
-#else
-#define REGSIZE 4
-#endif
-
-/* Support a limited form of shared assembly between tilepro and tilegx.
- The presumption is that LD/ST are used for manipulating registers.
- Since opcode parsing is case-insensitive, we don't need to provide
- definitions for these on tilegx. */
-#ifndef __tilegx__
-#define LD lw
-#define LD4U lw
-#define ST sw
-#define ST4 sw
-#define BNEZ bnz
-#define BEQZ bz
-#define BEQZT bzt
-#define BGTZ bgz
-#define CMPEQI seqi
-#define CMPEQ seq
-#define CMOVEQZ mvz
-#define CMOVNEZ mvnz
-#endif
-
-/* Provide "pointer-oriented" instruction variants. These differ not
- just for tilepro vs tilegx, but also for tilegx -m64 vs -m32. */
-#if defined __tilegx__ && __WORDSIZE == 32
-#define ADD_PTR addx
-#define ADDI_PTR addxi
-#define ADDLI_PTR addxli
-#define LD_PTR ld4s
-#define ST_PTR st4
-#define SHL_PTR_ADD shl2add
-#else
-#define ADD_PTR add
-#define ADDI_PTR addi
-#define ADDLI_PTR addli
-#define LD_PTR LD
-#define ST_PTR ST
-#ifdef __tilegx__
-#define SHL_PTR_ADD shl3add
-#else
-#define SHL_PTR_ADD s2a
-#endif
-#endif
-
-#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/tile/tilegx/Implies b/sysdeps/tile/tilegx/Implies
deleted file mode 100644
index ade71c1957..0000000000
--- a/sysdeps/tile/tilegx/Implies
+++ /dev/null
@@ -1 +0,0 @@
-ieee754/dbl-64/wordsize-64
diff --git a/sysdeps/tile/tilegx/Makefile b/sysdeps/tile/tilegx/Makefile
deleted file mode 100644
index 4281dd98fc..0000000000
--- a/sysdeps/tile/tilegx/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-include $(common-objpfx)cflags-mcmodel-large.mk
-
-# Check for gcc to support the command-line switch, and for
-# binutils to support the hwN_plt() assembly operators and relocations.
-$(common-objpfx)cflags-mcmodel-large.mk: $(common-objpfx)config.make
- mcmodel=no; \
- (echo 'int main() { return getuid(); }' | \
- $(CC) -o /dev/null -xc - -mcmodel=large -fpic) && mcmodel=yes; \
- echo "cflags-mcmodel-large = $$mcmodel" > $@
-
-ifeq (yes,$(cflags-mcmodel-large))
-
-ifeq ($(subdir),csu)
-# elf-init.c is in libc_nonshared.o (the end of the shared object) but
-# must reach the _init symbol at the very start of the shared object.
-CFLAGS-elf-init.c += -mcmodel=large
-
-# __gmon_start__ is at the very start of the shared object when linked
-# with profiling, but calls to libc.so via the PLT at the very end.
-CFLAGS-gmon-start.c += -mcmodel=large
-endif
-
-else
-
-# Don't try to compile assembly code with hwN_plt() directives if the
-# toolchain doesn't support -mcmodel=large.
-ifeq ($(subdir),csu)
-CPPFLAGS-start.S += -DNO_PLT_PCREL
-CPPFLAGS-crti.S += -DNO_PLT_PCREL
-endif
-ifeq ($(subdir),nptl)
-CPPFLAGS-pt-crti.S += -DNO_PLT_PCREL
-endif
-
-endif
diff --git a/sysdeps/tile/tilegx/atomic-machine.h b/sysdeps/tile/tilegx/atomic-machine.h
deleted file mode 100644
index 588149ebdd..0000000000
--- a/sysdeps/tile/tilegx/atomic-machine.h
+++ /dev/null
@@ -1,60 +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/>. */
-
-#ifndef _ATOMIC_MACHINE_H
-#define _ATOMIC_MACHINE_H 1
-
-#include <arch/spr_def.h>
-
-#ifdef _LP64
-# define __HAVE_64B_ATOMICS 1
-#else
-/* tilegx32 does have 64-bit atomics, but assumptions in the semaphore
- code mean that unaligned 64-bit atomics will be used if this symbol
- is true, and unaligned atomics are not supported on tile. */
-# define __HAVE_64B_ATOMICS 0
-#endif
-
-#define USE_ATOMIC_COMPILER_BUILTINS 0
-
-/* Pick appropriate 8- or 4-byte instruction. */
-#define __atomic_update(mem, v, op) \
- ((__typeof (*(mem))) (__typeof (*(mem) - *(mem))) \
- ((sizeof (*(mem)) == 8) ? \
- __insn_##op ((void *) (mem), (int64_t) (__typeof((v) - (v))) (v)) : \
- (sizeof (*(mem)) == 4) ? \
- __insn_##op##4 ((void *) (mem), (int32_t) (__typeof ((v) - (v))) (v)) : \
- __atomic_error_bad_argument_size()))
-
-#define atomic_compare_and_exchange_val_acq(mem, n, o) \
- ({ __insn_mtspr (SPR_CMPEXCH_VALUE, (int64_t) (__typeof ((o) - (o))) (o)); \
- __atomic_update (mem, n, cmpexch); })
-#define atomic_exchange_acq(mem, newvalue) \
- __atomic_update (mem, newvalue, exch)
-#define atomic_exchange_and_add(mem, value) \
- __atomic_update (mem, value, fetchadd)
-#define atomic_and_val(mem, mask) \
- __atomic_update (mem, mask, fetchand)
-#define atomic_or_val(mem, mask) \
- __atomic_update (mem, mask, fetchor)
-#define atomic_decrement_if_positive(mem) \
- __atomic_update (mem, -1, fetchaddgez)
-
-#include <sysdeps/tile/atomic-machine.h>
-
-#endif /* atomic-machine.h */
diff --git a/sysdeps/tile/tilegx/bits/wordsize.h b/sysdeps/tile/tilegx/bits/wordsize.h
deleted file mode 100644
index 5d4e4b4470..0000000000
--- a/sysdeps/tile/tilegx/bits/wordsize.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Determine the wordsize from the preprocessor defines. */
-
-#ifdef __LP64__
-# define __WORDSIZE 64
-# define __WORDSIZE_TIME64_COMPAT32 1
-#else
-# define __WORDSIZE 32
-#endif
diff --git a/sysdeps/tile/tilegx/memchr.c b/sysdeps/tile/tilegx/memchr.c
deleted file mode 100644
index f70bf4041f..0000000000
--- a/sysdeps/tile/tilegx/memchr.c
+++ /dev/null
@@ -1,73 +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 <string.h>
-#include <stdint.h>
-#include "string-endian.h"
-
-void *
-__memchr (const void *s, int c, size_t n)
-{
- const uint64_t *last_word_ptr;
- const uint64_t *p;
- const char *last_byte_ptr;
- uintptr_t s_int;
- uint64_t goal, before_mask, v, bits;
- char *ret;
-
- if (__builtin_expect (n == 0, 0))
- {
- /* Don't dereference any memory if the array is empty. */
- return NULL;
- }
-
- /* Get an aligned pointer. */
- s_int = (uintptr_t) s;
- p = (const uint64_t *) (s_int & -8);
-
- /* Create eight copies of the byte for which we are looking. */
- goal = copy_byte(c);
-
- /* Read the first word, but munge it so that bytes before the array
- will not match goal. */
- before_mask = MASK (s_int);
- v = (*p | before_mask) ^ (goal & before_mask);
-
- /* Compute the address of the last byte. */
- last_byte_ptr = (const char *) s + n - 1;
-
- /* Compute the address of the word containing the last byte. */
- last_word_ptr = (const uint64_t *) ((uintptr_t) last_byte_ptr & -8);
-
- while ((bits = __insn_v1cmpeq (v, goal)) == 0)
- {
- if (__builtin_expect (p == last_word_ptr, 0))
- {
- /* We already read the last word in the array, so give up. */
- return NULL;
- }
- v = *++p;
- }
-
- /* We found a match, but it might be in a byte past the end
- of the array. */
- ret = ((char *) p) + (CFZ (bits) >> 3);
- return (ret <= last_byte_ptr) ? ret : NULL;
-}
-weak_alias (__memchr, memchr)
-libc_hidden_builtin_def (memchr)
diff --git a/sysdeps/tile/tilegx/memcpy.c b/sysdeps/tile/tilegx/memcpy.c
deleted file mode 100644
index 804d0887bc..0000000000
--- a/sysdeps/tile/tilegx/memcpy.c
+++ /dev/null
@@ -1,272 +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 <string.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <memcopy.h>
-#include <arch/chip.h>
-
-/* How many cache lines ahead should we prefetch? */
-#define PREFETCH_LINES_AHEAD 3
-
-void * inhibit_loop_to_libcall
-__memcpy (void *__restrict dstv, const void *__restrict srcv, size_t n)
-{
- char *__restrict dst1 = (char *) dstv;
- const char *__restrict src1 = (const char *) srcv;
- const char *__restrict src1_end;
- const char *__restrict prefetch;
- op_t *__restrict dst8; /* 8-byte pointer to destination memory. */
- op_t final; /* Final bytes to write to trailing word, if any */
- long i;
-
- if (n < 16)
- {
- for (; n; n--)
- *dst1++ = *src1++;
- return dstv;
- }
-
- /* Locate the end of source memory we will copy. Don't prefetch
- past this. */
- src1_end = src1 + n - 1;
-
- /* Prefetch ahead a few cache lines, but not past the end. */
- prefetch = src1;
- for (i = 0; i < PREFETCH_LINES_AHEAD; i++)
- {
- __insn_prefetch (prefetch);
- prefetch += CHIP_L2_LINE_SIZE ();
- prefetch = (prefetch < src1_end) ? prefetch : src1;
- }
-
- /* Copy bytes until dst is word-aligned. */
- for (; (uintptr_t) dst1 & (sizeof (op_t) - 1); n--)
- *dst1++ = *src1++;
-
- /* 8-byte pointer to destination memory. */
- dst8 = (op_t *) dst1;
-
- if (__builtin_expect ((uintptr_t) src1 & (sizeof (op_t) - 1), 0))
- {
- /* Misaligned copy. Use glibc's _wordcopy_fwd_dest_aligned, but
- inline it to avoid prologue/epilogue. TODO: Consider
- prefetching and using wh64 as well. */
- void * srci;
- op_t a0, a1, a2, a3;
- long int dstp = (long int) dst1;
- long int srcp = (long int) src1;
- long int len = n / OPSIZ;
-
- /* Save the initial source pointer so we know the number of
- bytes to shift for merging two unaligned results. */
- srci = (void *) srcp;
-
- /* Make SRCP aligned by rounding it down to the beginning of the
- `op_t' it points in the middle of. */
- srcp &= -OPSIZ;
-
- switch (len % 4)
- {
- case 2:
- a1 = ((op_t *) srcp)[0];
- a2 = ((op_t *) srcp)[1];
- len += 2;
- srcp += 2 * OPSIZ;
- goto do1;
- case 3:
- a0 = ((op_t *) srcp)[0];
- a1 = ((op_t *) srcp)[1];
- len += 1;
- srcp += 2 * OPSIZ;
- goto do2;
- case 0:
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- return dstv;
- a3 = ((op_t *) srcp)[0];
- a0 = ((op_t *) srcp)[1];
- len += 0;
- srcp += 2 * OPSIZ;
- goto do3;
- case 1:
- a2 = ((op_t *) srcp)[0];
- a3 = ((op_t *) srcp)[1];
- srcp += 2 * OPSIZ;
- len -= 1;
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- goto do0;
- goto do4; /* No-op. */
- }
-
- do
- {
- do4:
- a0 = ((op_t *) srcp)[0];
- a2 = __insn_dblalign (a2, a3, srci);
- ((op_t *) dstp)[0] = a2;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do3:
- a1 = ((op_t *) srcp)[0];
- a3 = __insn_dblalign (a3, a0, srci);
- ((op_t *) dstp)[0] = a3;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do2:
- a2 = ((op_t *) srcp)[0];
- a0 = __insn_dblalign (a0, a1, srci);
- ((op_t *) dstp)[0] = a0;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do1:
- a3 = ((op_t *) srcp)[0];
- a1 = __insn_dblalign (a1, a2, srci);
- ((op_t *) dstp)[0] = a1;
- srcp += OPSIZ;
- dstp += OPSIZ;
- len -= 4;
- }
- while (len != 0);
-
- /* This is the right position for do0. Please don't move
- it into the loop. */
- do0:
- ((op_t *) dstp)[0] = __insn_dblalign (a2, a3, srci);
-
- n = n % OPSIZ;
- if (n == 0)
- return dstv;
-
- a0 = ((const char *) srcp <= src1_end) ? ((op_t *) srcp)[0] : 0;
-
- final = __insn_dblalign (a3, a0, srci);
- dst8 = (op_t *)(dstp + OPSIZ);
- }
- else
- {
- /* Aligned copy. */
-
- const op_t *__restrict src8 = (const op_t *) src1;
-
- /* src8 and dst8 are both word-aligned. */
- if (n >= CHIP_L2_LINE_SIZE ())
- {
- /* Copy until 'dst' is cache-line-aligned. */
- for (; (uintptr_t) dst8 & (CHIP_L2_LINE_SIZE () - 1);
- n -= sizeof (op_t))
- *dst8++ = *src8++;
-
- for (; n >= CHIP_L2_LINE_SIZE ();)
- {
- op_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-
- /* Prefetch and advance to next line to prefetch, but
- don't go past the end. */
- __insn_prefetch (prefetch);
- prefetch += CHIP_L2_LINE_SIZE ();
- prefetch = (prefetch < src1_end) ? prefetch :
- (const char *) src8;
-
- /* Do all the loads before wh64. This is necessary if
- [src8, src8+7] and [dst8, dst8+7] share the same
- cache line and dst8 <= src8, as can be the case when
- called from memmove, or with code tested on x86 whose
- memcpy always works with forward copies. */
- tmp0 = *src8++;
- tmp1 = *src8++;
- tmp2 = *src8++;
- tmp3 = *src8++;
- tmp4 = *src8++;
- tmp5 = *src8++;
- tmp6 = *src8++;
- tmp7 = *src8++;
-
- __insn_wh64 (dst8);
-
- *dst8++ = tmp0;
- *dst8++ = tmp1;
- *dst8++ = tmp2;
- *dst8++ = tmp3;
- *dst8++ = tmp4;
- *dst8++ = tmp5;
- *dst8++ = tmp6;
- *dst8++ = tmp7;
-
- n -= 64;
- }
-#if CHIP_L2_LINE_SIZE() != 64
-# error "Fix code that assumes particular L2 cache line size."
-#endif
- }
-
- for (; n >= sizeof (op_t); n -= sizeof (op_t))
- *dst8++ = *src8++;
-
- if (__builtin_expect (n == 0, 1))
- return dstv;
-
- final = *src8;
- }
-
- /* n != 0 if we get here. Write out any trailing bytes. */
- dst1 = (char *) dst8;
-#ifndef __BIG_ENDIAN__
- if (n & 4)
- {
- *(uint32_t *) dst1 = final;
- dst1 += 4;
- final >>= 32;
- n &= 3;
- }
- if (n & 2)
- {
- *(uint16_t *) dst1 = final;
- dst1 += 2;
- final >>= 16;
- n &= 1;
- }
- if (n)
- *(uint8_t *) dst1 = final;
-#else
- if (n & 4)
- {
- *(uint32_t *) dst1 = final >> 32;
- dst1 += 4;
- }
- else
- {
- final >>= 32;
- }
- if (n & 2)
- {
- *(uint16_t *) dst1 = final >> 16;
- dst1 += 2;
- }
- else
- {
- final >>= 16;
- }
- if (n & 1)
- *(uint8_t *) dst1 = final >> 8;
-#endif
-
- return dstv;
-}
-weak_alias (__memcpy, memcpy)
-libc_hidden_builtin_def (memcpy)
diff --git a/sysdeps/tile/tilegx/memset.c b/sysdeps/tile/tilegx/memset.c
deleted file mode 100644
index b27c5f3fb9..0000000000
--- a/sysdeps/tile/tilegx/memset.c
+++ /dev/null
@@ -1,151 +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 <arch/chip.h>
-#include <string.h>
-#include <stdint.h>
-#include "string-endian.h"
-
-void * inhibit_loop_to_libcall
-__memset (void *s, int c, size_t n)
-{
- uint64_t *out64;
- int n64, to_align64;
- uint64_t v64;
- uint8_t *out8 = s;
-
- /* Experimentation shows that a trivial tight loop is a win up until
- around a size of 20, where writing a word at a time starts to win. */
-#define BYTE_CUTOFF 20
-
-#if BYTE_CUTOFF < 7
- /* This must be at least at least this big, or some code later
- on doesn't work. */
-# error "BYTE_CUTOFF is too small."
-#endif
-
- if (n < BYTE_CUTOFF)
- {
- /* Strangely, this turns out to be the tightest way to write
- this loop. */
- if (n != 0)
- {
- do
- {
- /* Strangely, combining these into one line performs worse. */
- *out8 = c;
- out8++;
- }
- while (--n != 0);
- }
-
- return s;
- }
-
- /* Align 'out8'. We know n >= 7 so this won't write past the end. */
- while (((uintptr_t) out8 & 7) != 0)
- {
- *out8++ = c;
- --n;
- }
-
- /* Align 'n'. */
- while (n & 7)
- out8[--n] = c;
-
- out64 = (uint64_t *) out8;
- n64 = n >> 3;
-
- /* Tile input byte out to 64 bits. */
- v64 = copy_byte(c);
-
- /* This must be at least 8 or the following loop doesn't work. */
-#define CACHE_LINE_SIZE_IN_DOUBLEWORDS (CHIP_L2_LINE_SIZE() / 8)
-
- /* Determine how many words we need to emit before the 'out32'
- pointer becomes aligned modulo the cache line size. */
- to_align64 = (-((uintptr_t) out64 >> 3)) &
- (CACHE_LINE_SIZE_IN_DOUBLEWORDS - 1);
-
- /* Only bother aligning and using wh64 if there is at least
- one full cache line to process. This check also prevents
- overrunning the end of the buffer with alignment words. */
- if (to_align64 <= n64 - CACHE_LINE_SIZE_IN_DOUBLEWORDS)
- {
- int lines_left;
-
- /* Align out64 mod the cache line size so we can use wh64. */
- n64 -= to_align64;
- for (; to_align64 != 0; to_align64--)
- {
- *out64 = v64;
- out64++;
- }
-
- /* Use unsigned divide to turn this into a right shift. */
- lines_left = (unsigned) n64 / CACHE_LINE_SIZE_IN_DOUBLEWORDS;
-
- do
- {
- /* Only wh64 a few lines at a time, so we don't exceed the
- maximum number of victim lines. */
- int x = ((lines_left < CHIP_MAX_OUTSTANDING_VICTIMS ()) ? lines_left
- : CHIP_MAX_OUTSTANDING_VICTIMS ());
- uint64_t *wh = out64;
- int i = x;
- int j;
-
- lines_left -= x;
-
- do
- {
- __insn_wh64 (wh);
- wh += CACHE_LINE_SIZE_IN_DOUBLEWORDS;
- }
- while (--i);
-
- for (j = x * (CACHE_LINE_SIZE_IN_DOUBLEWORDS / 4); j != 0; j--)
- {
- *out64++ = v64;
- *out64++ = v64;
- *out64++ = v64;
- *out64++ = v64;
- }
- }
- while (lines_left != 0);
-
- /* We processed all full lines above, so only this many
- words remain to be processed. */
- n64 &= CACHE_LINE_SIZE_IN_DOUBLEWORDS - 1;
- }
-
- /* Now handle any leftover values. */
- if (n64 != 0)
- {
- do
- {
- *out64 = v64;
- out64++;
- }
- while (--n64 != 0);
- }
-
- return s;
-}
-weak_alias (__memset, memset)
-libc_hidden_builtin_def (memset)
diff --git a/sysdeps/tile/tilegx/memusage.h b/sysdeps/tile/tilegx/memusage.h
deleted file mode 100644
index 696f98f827..0000000000
--- a/sysdeps/tile/tilegx/memusage.h
+++ /dev/null
@@ -1,31 +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 <stdint.h>
-#include <arch/spr_def.h>
-
-#define GETSP() ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; })
-
-#define GETTIME(low,high) \
- { \
- uint64_t cycles = __insn_mfspr (SPR_CYCLE); \
- low = cycles & 0xffffffff; \
- high = cycles >> 32; \
- }
-
-#include <sysdeps/generic/memusage.h>
diff --git a/sysdeps/tile/tilegx/rawmemchr.c b/sysdeps/tile/tilegx/rawmemchr.c
deleted file mode 100644
index cdbf918193..0000000000
--- a/sysdeps/tile/tilegx/rawmemchr.c
+++ /dev/null
@@ -1,45 +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 <string.h>
-#include <stdint.h>
-#include "string-endian.h"
-
-void *
-__rawmemchr (const void *s, int c)
-{
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint64_t *p = (const uint64_t *) (s_int & -8);
-
- /* Create eight copies of the byte for which we are looking. */
- const uint64_t goal = copy_byte(c);
-
- /* Read the first word, but munge it so that bytes before the array
- will not match goal. */
- const uint64_t before_mask = MASK (s_int);
- uint64_t v = (*p | before_mask) ^ (goal & before_mask);
-
- uint64_t bits;
- while ((bits = __insn_v1cmpeq (v, goal)) == 0)
- v = *++p;
-
- return ((char *) p) + (CFZ (bits) >> 3);
-}
-libc_hidden_def (__rawmemchr)
-weak_alias (__rawmemchr, rawmemchr)
diff --git a/sysdeps/tile/tilegx/strcasestr.c b/sysdeps/tile/tilegx/strcasestr.c
deleted file mode 100644
index 683d311bc1..0000000000
--- a/sysdeps/tile/tilegx/strcasestr.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Return the offset of one string within another.
- Copyright (C) 1994-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/>. */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#include <string.h>
-
-#include <ctype.h>
-#include <stdbool.h>
-#include <strings.h>
-
-#define USE_AS_STRCASESTR
-#define STRSTR __strcasestr
-#define STRSTR2 strcasestr2
-#define STRCHR strcasechr
-#define STRSTR_SCAN strcasestr_scan
-
-#undef strcasestr
-#undef __strcasestr
-
-#ifndef STRCASESTR
-#define STRCASESTR __strcasestr
-#endif
-
-#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
-
-#define CANON_ELEMENT(c) TOLOWER (c)
-#define CMP_FUNC(p1, p2, l) \
- __strncasecmp ((const char *) (p1), (const char *) (p2), l)
-
-#include "strstr.c"
-
-#ifndef NO_ALIAS
-weak_alias (__strcasestr, strcasestr)
-#endif
diff --git a/sysdeps/tile/tilegx/strchr.c b/sysdeps/tile/tilegx/strchr.c
deleted file mode 100644
index 67866d53a9..0000000000
--- a/sysdeps/tile/tilegx/strchr.c
+++ /dev/null
@@ -1,67 +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 <string.h>
-#include <stdint.h>
-#include "string-endian.h"
-
-#undef strchr
-
-char *
-strchr (const char *s, int c)
-{
- int z, g;
-
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint64_t *p = (const uint64_t *) (s_int & -8);
-
- /* Create eight copies of the byte for which we are looking. */
- const uint64_t goal = copy_byte(c);
-
- /* Read the first aligned word, but force bytes before the string to
- match neither zero nor goal (we make sure the high bit of each byte
- is 1, and the low 7 bits are all the opposite of the goal byte). */
- const uint64_t before_mask = MASK (s_int);
- uint64_t v = (*p | before_mask) ^ (goal & __insn_v1shrui (before_mask, 1));
-
- uint64_t zero_matches, goal_matches;
- while (1)
- {
- /* Look for a terminating '\0'. */
- zero_matches = __insn_v1cmpeqi (v, 0);
-
- /* Look for the goal byte. */
- goal_matches = __insn_v1cmpeq (v, goal);
-
- if (__builtin_expect ((zero_matches | goal_matches) != 0, 0))
- break;
-
- v = *++p;
- }
-
- z = CFZ (zero_matches);
- g = CFZ (goal_matches);
-
- /* If we found c before '\0' we got a match. Note that if c == '\0'
- then g == z, and we correctly return the address of the '\0'
- rather than NULL. */
- return (g <= z) ? ((char *) p) + (g >> 3) : NULL;
-}
-weak_alias (strchr, index)
-libc_hidden_builtin_def (strchr)
diff --git a/sysdeps/tile/tilegx/strchrnul.c b/sysdeps/tile/tilegx/strchrnul.c
deleted file mode 100644
index 53e734d090..0000000000
--- a/sysdeps/tile/tilegx/strchrnul.c
+++ /dev/null
@@ -1,64 +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 <string.h>
-#include <stdint.h>
-#include "string-endian.h"
-
-char *
-__strchrnul (const char *s, int c)
-{
- int z, g;
-
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint64_t *p = (const uint64_t *) (s_int & -8);
-
- /* Create eight copies of the byte for which we are looking. */
- const uint64_t goal = copy_byte(c);
-
- /* Read the first aligned word, but force bytes before the string to
- match neither zero nor goal (we make sure the high bit of each byte
- is 1, and the low 7 bits are all the opposite of the goal byte). */
- const uint64_t before_mask = MASK (s_int);
- uint64_t v = (*p | before_mask) ^ (goal & __insn_v1shrui (before_mask, 1));
-
- uint64_t zero_matches, goal_matches;
- while (1)
- {
- /* Look for a terminating '\0'. */
- zero_matches = __insn_v1cmpeqi (v, 0);
-
- /* Look for the goal byte. */
- goal_matches = __insn_v1cmpeq (v, goal);
-
- if (__builtin_expect ((zero_matches | goal_matches) != 0, 0))
- break;
-
- v = *++p;
- }
-
- z = CFZ (zero_matches);
- g = CFZ (goal_matches);
-
- /* Return a pointer to the NUL or goal, whichever is first. */
- if (z < g)
- g = z;
- return ((char *) p) + (g >> 3);
-}
-weak_alias (__strchrnul, strchrnul)
diff --git a/sysdeps/tile/tilegx/string-endian.h b/sysdeps/tile/tilegx/string-endian.h
deleted file mode 100644
index 0f89321ec0..0000000000
--- a/sysdeps/tile/tilegx/string-endian.h
+++ /dev/null
@@ -1,58 +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 <endian.h>
-#include <stdint.h>
-
-/* Provide a set of macros to help keep endianness #ifdefs out of
- the string functions.
-
- MASK: Provide a mask based on the pointer alignment that
- sets up non-zero bytes before the beginning of the string.
- The MASK expression works because shift counts are taken mod 64.
-
- NULMASK: Clear bytes beyond a given point in the string.
-
- CFZ: Find the first zero bit in the 8 string bytes in a long.
-
- REVCZ: Find the last zero bit in the 8 string bytes in a long.
-
- STRSHIFT: Shift N bits towards the start of the string. */
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define MASK(x) (__insn_shl(1ULL, (x << 3)) - 1)
-#define NULMASK(x) ((2ULL << x) - 1)
-#define CFZ(x) __insn_ctz(x)
-#define REVCZ(x) __insn_clz(x)
-#define STRSHIFT(x,n) ((x) >> n)
-#else
-#define MASK(x) (__insn_shl(-2LL, ((-x << 3) - 1)))
-#define NULMASK(x) (-2LL << (63 - x))
-#define CFZ(x) __insn_clz(x)
-#define REVCZ(x) __insn_ctz(x)
-#define STRSHIFT(x,n) ((x) << n)
-#endif
-
-/* Create eight copies of the byte in a uint64_t. Byte Shuffle uses
- the bytes of srcB as the index into the dest vector to select a
- byte. With all indices of zero, the first byte is copied into all
- the other bytes. */
-static inline uint64_t copy_byte(uint8_t byte)
-{
- return __insn_shufflebytes(byte, 0, 0);
-}
diff --git a/sysdeps/tile/tilegx/strlen.c b/sysdeps/tile/tilegx/strlen.c
deleted file mode 100644
index 8b9ad02386..0000000000
--- a/sysdeps/tile/tilegx/strlen.c
+++ /dev/null
@@ -1,39 +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 <string.h>
-#include <stdint.h>
-#include "string-endian.h"
-
-size_t
-strlen (const char *s)
-{
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint64_t *p = (const uint64_t *) (s_int & -8);
-
- /* Read and MASK the first word. */
- uint64_t v = *p | MASK (s_int);
-
- uint64_t bits;
- while ((bits = __insn_v1cmpeqi (v, 0)) == 0)
- v = *++p;
-
- return ((const char *) p) + (CFZ (bits) >> 3) - s;
-}
-libc_hidden_builtin_def (strlen)
diff --git a/sysdeps/tile/tilegx/strnlen.c b/sysdeps/tile/tilegx/strnlen.c
deleted file mode 100644
index e37cdd7847..0000000000
--- a/sysdeps/tile/tilegx/strnlen.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* 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/>. */
-
-#include <string.h>
-#include <stdint.h>
-#include "string-endian.h"
-
-/* Find the length of S, but scan at most MAXLEN characters. If no
- '\0' terminator is found in that many characters, return MAXLEN. */
-size_t
-__strnlen (const char *s, size_t maxlen)
-{
- /* When maxlen is 0, can't read any bytes or it might cause a page fault. */
- if (maxlen == 0)
- return 0;
-
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint64_t *p = (const uint64_t *) (s_int & -8);
- size_t bytes_read = sizeof (*p) - (s_int & (sizeof (*p) - 1));
-
- /* Read and MASK the first word. */
- uint64_t v = *p | MASK (s_int);
-
- uint64_t bits;
- while ((bits = __insn_v1cmpeqi (v, 0)) == 0)
- {
- if (bytes_read >= maxlen)
- {
- /* Read maxlen bytes and didn't find the terminator. */
- return maxlen;
- }
- v = *++p;
- bytes_read += sizeof (v);
- }
-
- /* Found '\0', check it is not larger than maxlen */
- size_t len = ((const char *) p) + (CFZ (bits) >> 3) - s;
- return (len < maxlen ? len : maxlen);
-}
-libc_hidden_def (__strnlen)
-weak_alias (__strnlen, strnlen)
-libc_hidden_def (strnlen)
diff --git a/sysdeps/tile/tilegx/strrchr.c b/sysdeps/tile/tilegx/strrchr.c
deleted file mode 100644
index 42e8496da9..0000000000
--- a/sysdeps/tile/tilegx/strrchr.c
+++ /dev/null
@@ -1,68 +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 <string.h>
-#include <stdint.h>
-#include "string-endian.h"
-
-char *
-strrchr (const char *s, int c)
-{
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint64_t *p = (const uint64_t *) (s_int & -8);
-
- /* Create eight copies of the byte for which we are looking. */
- const uint64_t goal = copy_byte(c);
-
- /* Read the first aligned word, but force bytes before the string to
- match neither zero nor goal (we make sure the high bit of each byte
- is 1, and the low 7 bits are all the opposite of the goal byte). */
- const uint64_t before_mask = MASK (s_int);
- uint64_t v = (*p | before_mask) ^ (goal & __insn_v1shrui (before_mask, 1));
- const char *found = NULL;
- uint64_t zero_matches, goal_matches;
- while (1)
- {
- /* Look for a terminating '\0'. */
- zero_matches = __insn_v1cmpeqi (v, 0);
-
- /* Look for the goal byte. */
- goal_matches = __insn_v1cmpeq (v, goal);
-
- /* If we found the goal, record the last offset. */
- if (__builtin_expect (goal_matches != 0, 0))
- {
- if (__builtin_expect (zero_matches != 0, 0))
- {
- /* Clear any goal after the first zero. */
- int first_nul = CFZ (zero_matches);
- goal_matches &= NULMASK (first_nul);
- }
- if (__builtin_expect (goal_matches != 0, 1))
- found = ((char *) p) + 7 - (REVCZ (goal_matches) >> 3);
- }
-
- if (__builtin_expect (zero_matches != 0, 0))
- return (char *) found;
-
- v = *++p;
- }
-}
-weak_alias (strrchr, rindex)
-libc_hidden_builtin_def (strrchr)
diff --git a/sysdeps/tile/tilegx/strstr.c b/sysdeps/tile/tilegx/strstr.c
deleted file mode 100644
index 6679025f1e..0000000000
--- a/sysdeps/tile/tilegx/strstr.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/* 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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* Specification of strstr. */
-#include <string.h>
-
-#include <stdbool.h>
-#include "string-endian.h"
-
-#define RETURN_TYPE char *
-#define AVAILABLE(h, h_l, j, n_l) \
- (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
- && ((h_l) = (j) + (n_l)))
-#include "str-two-way.h"
-typeof(two_way_short_needle) two_way_short_needle __attribute__((unused));
-
-#undef strstr
-
-#ifndef STRSTR
-#define STRSTR strstr
-#endif
-
-#ifndef STRSTR2
-#define STRSTR2 strstr2
-#endif
-
-#ifndef STRCHR
-#define STRCHR strchr
-#endif
-
-#ifndef STRSTR_SCAN
-#define STRSTR_SCAN strstr_scan
-#endif
-
-#ifndef TOLOWER
-# define TOLOWER(Ch) (Ch)
-#endif
-
-#ifdef USE_AS_STRCASESTR
-
-static uint64_t
-vec_tolower (uint64_t cc)
-{
- /* For Uppercases letters, add 32 to convert to lower case. */
- uint64_t less_than_eq_Z = __insn_v1cmpltui (cc, 'Z' + 1);
- uint64_t less_than_A = __insn_v1cmpltui (cc, 'A');
- uint64_t is_upper = __insn_v1cmpne (less_than_eq_Z, less_than_A);
- return __insn_v1add (cc,__insn_v1shli (is_upper, 5));
-}
-
-/* There is no strcasechr() defined, but needed for 1 byte case
- of strcasestr(), so create it here. */
-
-static char *
-strcasechr (const char *s, int c)
-{
- int z, g;
-
- c = tolower (c);
-
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint64_t *p = (const uint64_t *) (s_int & -8);
-
- /* Create eight copies of the byte for which we are looking. */
- const uint64_t goal = copy_byte(c);
-
- /* Read the first aligned word, but force bytes before the string to
- match neither zero nor goal (we make sure the high bit of each byte
- is 1, and the low 7 bits are all the opposite of the goal byte). */
- const uint64_t before_mask = MASK (s_int);
- uint64_t v =
- (vec_tolower (*p) | before_mask) ^ (goal & __insn_v1shrui (before_mask, 1));
-
- uint64_t zero_matches, goal_matches;
- while (1)
- {
- /* Look for a terminating '\0'. */
- zero_matches = __insn_v1cmpeqi (v, 0);
-
- /* Look for the goal byte. */
- goal_matches = __insn_v1cmpeq (v, goal);
-
- if (__builtin_expect ((zero_matches | goal_matches) != 0, 0))
- break;
-
- v = vec_tolower (*++p);
- }
-
- z = CFZ (zero_matches);
- g = CFZ (goal_matches);
-
- /* If we found c before '\0' we got a match. Note that if c == '\0'
- then g == z, and we correctly return the address of the '\0'
- rather than NULL. */
- return (g <= z) ? ((char *) p) + (g >> 3) : NULL;
-}
-
-# define vec_load(p) vec_tolower (*(p))
-# define STRCHR strcasechr
-# define CMP_FUNC __strncasecmp
-
-#else
-
-# define vec_load(p) (*(p))
-# define STRCHR strchr
-# define CMP_FUNC memcmp
-
-#endif
-
-
-/* Compare 2-character needle using SIMD. */
-static char *
-STRSTR2 (const char *haystack_start, const char *needle)
-{
- int z, g;
-
- __insn_prefetch (haystack_start + 64);
-
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) haystack_start;
- const uint64_t *p = (const uint64_t *) (s_int & -8);
-
- /* Create eight copies of the first byte for which we are looking. */
- const uint64_t byte1 = copy_byte (TOLOWER (*needle));
- /* Create eight copies of the second byte for which we are looking. */
- const uint64_t byte2 = copy_byte (TOLOWER (*(needle + 1)));
-
- /* Read the first aligned word, but force bytes before the string to
- match neither zero nor goal (we make sure the high bit of each byte
- is 1, and the low 7 bits are all the opposite of the goal byte). */
- const uint64_t before_mask = MASK (s_int);
- uint64_t v =
- (vec_load (p) | before_mask) ^ (byte1 & __insn_v1shrui (before_mask, 1));
-
- uint64_t zero_matches, goal_matches;
- while (1)
- {
- /* Look for a terminating '\0'. */
- zero_matches = __insn_v1cmpeqi (v, 0);
- uint64_t byte1_matches = __insn_v1cmpeq (v, byte1);
- if (__builtin_expect (zero_matches != 0, 0))
- {
- /* This is the last vector. Don't worry about matches
- crossing into the next vector. Shift the second byte
- back 1 byte to align it with the first byte, then and to
- check for both matching. Each vector has a 1 in the LSB
- of the byte if there was match. */
- uint64_t byte2_matches = __insn_v1cmpeq (v, byte2);
- goal_matches = byte1_matches & STRSHIFT (byte2_matches, 8);
- break;
- }
- else
- {
- /* This is not the last vector, so load the next vector now.
- And compare byte2 to the 8-bytes starting 1 byte shifted from v,
- which goes 1-byte into the next vector. */
- uint64_t v2 = vec_load (p + 1);
- if (byte1_matches)
- {
- /* 8-bytes starting 1 byte into v. */
- v = __insn_dblalign (v, v2, (void*)1);
- uint64_t byte2_matches_shifted = __insn_v1cmpeq (v, byte2);
- goal_matches = byte1_matches & byte2_matches_shifted;
- if (__builtin_expect (goal_matches != 0, 0))
- break;
- }
- __insn_prefetch (p + 4);
- /* Move to next vector. */
- v = v2;
- p++;
- }
- }
-
- z = CFZ (zero_matches);
- g = CFZ (goal_matches);
-
- /* If we found the match before '\0' we got a true match. Note that
- if c == '\0' then g == z, and we correctly return the address of
- the '\0' rather than NULL. */
- return (g <= z) ? ((char *) p) + (g >> 3) : NULL;
-}
-
-/* Scan for NEEDLE, using the first two characters as a filter. */
-static char *
-STRSTR_SCAN (const char *haystack, const char *needle,
- unsigned int needle_len)
-{
- char *match;
- while (1)
- {
- match = STRSTR2 (haystack, needle);
- if (match == NULL)
- return NULL;
- /* Found first two characters of needle, check for remainder. */
- if (CMP_FUNC (match + 2, needle + 2, needle_len - 2) == 0)
- return match;
- /* Move past the previous match. Could be +2 instead of +1 if
- first two characters are different, but that tested slower. */
- haystack = match + 1;
- }
-}
-
-/* Return the first occurrence of NEEDLE in HAYSTACK. Return HAYSTACK
- if NEEDLE is empty, otherwise NULL if NEEDLE is not found in
- HAYSTACK. */
-char *
-STRSTR (const char *haystack_start, const char *needle_start)
-{
- const char *haystack = haystack_start;
- const char *needle = needle_start;
- __insn_prefetch (haystack);
- size_t needle_len = strlen (needle_start); /* Length of NEEDLE. */
- size_t haystack_len; /* Known minimum length of HAYSTACK. */
-
- if (needle_len <= 2)
- {
- if (needle_len == 1)
- return STRCHR (haystack_start, *needle_start);
- if (needle_len == 0)
- return (char *) haystack_start;
- else
- return STRSTR2 (haystack_start, needle_start);
- }
-
- /* Fail if NEEDLE is longer than HAYSTACK. */
- if (__strnlen (haystack, needle_len) < needle_len)
- return NULL;
-
- /* Perform the search. Abstract memory is considered to be an array
- of 'unsigned char' values, not an array of 'char' values. See
- ISO C 99 section 6.2.6.1. */
- if (needle_len < 40)
- return STRSTR_SCAN (haystack_start, needle_start, needle_len);
- else
- {
- /* Reduce the size of haystack using STRSTR2, since it has a smaller
- linear coefficient than the Two-Way algorithm. */
- haystack = STRSTR2 (haystack_start, needle_start);
- if (haystack == NULL)
- return NULL;
- needle = needle_start;
- haystack_len = (haystack > haystack_start + needle_len ? 1
- : needle_len + haystack_start - haystack);
-
- return two_way_long_needle ((const unsigned char *) haystack,
- haystack_len,
- (const unsigned char *) needle, needle_len);
- }
-}
-#ifndef USE_AS_STRCASESTR
-libc_hidden_builtin_def (STRSTR)
-#endif
-
-#undef LONG_NEEDLE_THRESHOLD
diff --git a/sysdeps/tile/tilegx/tilegx32/Implies b/sysdeps/tile/tilegx/tilegx32/Implies
deleted file mode 100644
index 993b7f4cd1..0000000000
--- a/sysdeps/tile/tilegx/tilegx32/Implies
+++ /dev/null
@@ -1,3 +0,0 @@
-tile/tilegx
-tile
-wordsize-32
diff --git a/sysdeps/tile/tilegx/tilegx64/Implies b/sysdeps/tile/tilegx/tilegx64/Implies
deleted file mode 100644
index eb0686e0e6..0000000000
--- a/sysdeps/tile/tilegx/tilegx64/Implies
+++ /dev/null
@@ -1,3 +0,0 @@
-tile/tilegx
-tile
-wordsize-64
diff --git a/sysdeps/tile/tilepro/Implies b/sysdeps/tile/tilepro/Implies
deleted file mode 100644
index 709e1dc122..0000000000
--- a/sysdeps/tile/tilepro/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-tile
-wordsize-32
diff --git a/sysdeps/tile/tilepro/atomic-machine.h b/sysdeps/tile/tilepro/atomic-machine.h
deleted file mode 100644
index 702e17d77d..0000000000
--- a/sysdeps/tile/tilepro/atomic-machine.h
+++ /dev/null
@@ -1,88 +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/>. */
-
-#ifndef _ATOMIC_MACHINE_H
-#define _ATOMIC_MACHINE_H 1
-
-#include <asm/unistd.h>
-
-#define __HAVE_64B_ATOMICS 0
-#define USE_ATOMIC_COMPILER_BUILTINS 0
-
-/* 32-bit integer compare-and-exchange. */
-static __inline __attribute__ ((always_inline))
-int __atomic_cmpxchg_32 (volatile int *mem, int newval, int oldval)
-{
- int result;
- __asm__ __volatile__ ("swint1"
- : "=R00" (result), "=m" (*mem)
- : "R10" (__NR_FAST_cmpxchg), "R00" (mem),
- "R01" (oldval), "R02" (newval), "m" (*mem)
- : "r20", "r21", "r22", "r23", "r24",
- "r25", "r26", "r27", "r28", "r29", "memory");
- return result;
-}
-
-#define atomic_compare_and_exchange_val_acq(mem, n, o) \
- ({ \
- if (sizeof (*(mem)) != 4) \
- __atomic_error_bad_argument_size (); \
- (__typeof (*(mem))) \
- __atomic_cmpxchg_32 ((int *) (mem), (int) (n), (int) (o)); \
- })
-
-/* Atomically compute:
- int old = *ptr;
- *ptr = (old & mask) + addend;
- return old; */
-
-static __inline __attribute__ ((always_inline))
-int __atomic_update_32 (volatile int *mem, int mask, int addend)
-{
- int result;
- __asm__ __volatile__ ("swint1"
- : "=R00" (result), "=m" (*mem)
- : "R10" (__NR_FAST_atomic_update), "R00" (mem),
- "R01" (mask), "R02" (addend), "m" (*mem)
- : "r20", "r21", "r22", "r23", "r24",
- "r25", "r26", "r27", "r28", "r29", "memory");
- return result;
-}
-
-/* Size-checked verson of __atomic_update_32. */
-#define __atomic_update(mem, mask, addend) \
- ({ \
- if (sizeof (*(mem)) != 4) \
- __atomic_error_bad_argument_size (); \
- (__typeof (*(mem))) \
- __atomic_update_32 ((int *) (mem), (int) (mask), (int) (addend)); \
- })
-
-#define atomic_exchange_acq(mem, newvalue) \
- __atomic_update ((mem), 0, (newvalue))
-#define atomic_exchange_and_add(mem, value) \
- __atomic_update ((mem), -1, (value))
-#define atomic_and_val(mem, mask) \
- __atomic_update ((mem), (mask), 0)
-#define atomic_or_val(mem, mask) \
- ({ __typeof (mask) __att1_v = (mask); \
- __atomic_update ((mem), ~__att1_v, __att1_v); })
-
-#include <sysdeps/tile/atomic-machine.h>
-
-#endif /* atomic-machine.h */
diff --git a/sysdeps/tile/tilepro/bits/wordsize.h b/sysdeps/tile/tilepro/bits/wordsize.h
deleted file mode 100644
index da587a2f12..0000000000
--- a/sysdeps/tile/tilepro/bits/wordsize.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Determine the wordsize from the preprocessor defines. */
-
-#define __WORDSIZE 32
diff --git a/sysdeps/tile/tilepro/memchr.c b/sysdeps/tile/tilepro/memchr.c
deleted file mode 100644
index 9f149d28c1..0000000000
--- a/sysdeps/tile/tilepro/memchr.c
+++ /dev/null
@@ -1,72 +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 <string.h>
-#include <stdint.h>
-
-void *
-__memchr (const void *s, int c, size_t n)
-{
- const uint32_t *last_word_ptr;
- const uint32_t *p;
- const char *last_byte_ptr;
- uintptr_t s_int;
- uint32_t goal, before_mask, v, bits;
- char *ret;
-
- if (__builtin_expect (n == 0, 0))
- {
- /* Don't dereference any memory if the array is empty. */
- return NULL;
- }
-
- /* Get an aligned pointer. */
- s_int = (uintptr_t) s;
- p = (const uint32_t *) (s_int & -4);
-
- /* Create four copies of the byte for which we are looking. */
- goal = 0x01010101 * (uint8_t) c;
-
- /* Read the first word, but munge it so that bytes before the array
- will not match goal. Note that this shift count expression works
- because we know shift counts are taken mod 32. */
- before_mask = (1 << (s_int << 3)) - 1;
- v = (*p | before_mask) ^ (goal & before_mask);
-
- /* Compute the address of the last byte. */
- last_byte_ptr = (const char *) s + n - 1;
-
- /* Compute the address of the word containing the last byte. */
- last_word_ptr = (const uint32_t *) ((uintptr_t) last_byte_ptr & -4);
-
- while ((bits = __insn_seqb (v, goal)) == 0)
- {
- if (__builtin_expect (p == last_word_ptr, 0))
- {
- /* We already read the last word in the array, so give up. */
- return NULL;
- }
- v = *++p;
- }
-
- /* We found a match, but it might be in a byte past the end of the array. */
- ret = ((char *) p) + (__insn_ctz (bits) >> 3);
- return (ret <= last_byte_ptr) ? ret : NULL;
-}
-weak_alias (__memchr, memchr)
-libc_hidden_builtin_def (memchr)
diff --git a/sysdeps/tile/tilepro/memcpy.S b/sysdeps/tile/tilepro/memcpy.S
deleted file mode 100644
index a6bdfbdcff..0000000000
--- a/sysdeps/tile/tilepro/memcpy.S
+++ /dev/null
@@ -1,397 +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 <arch/chip.h>
-#include <sysdep.h>
-
- .text
-ENTRY (__memcpy)
- FEEDBACK_ENTER(__memcpy)
-
- /* r0 is the dest, r1 is the source, r2 is the size. */
-
- /* Save aside original dest so we can return it at the end. */
- { sw sp, lr; move r23, r0; or r4, r0, r1 }
- cfi_offset (lr, 0)
-
- /* Check for an empty size. */
- { bz r2, .Ldone; andi r4, r4, 3 }
-
- /* Check for an unaligned source or dest. */
- { bnz r4, .Lcopy_unaligned_maybe_many; addli r4, r2, -256 }
-
-.Lcheck_aligned_copy_size:
- /* If we are copying < 256 bytes, branch to simple case. */
- { blzt r4, .Lcopy_8_check; slti_u r8, r2, 8 }
-
- /* Copying >= 256 bytes, so jump to complex prefetching loop. */
- { andi r6, r1, 63; j .Lcopy_many }
-
-/* Aligned 4 byte at a time copy loop. */
-
-.Lcopy_8_loop:
- /* Copy two words at a time to hide load latency. */
- { lw r3, r1; addi r1, r1, 4; slti_u r8, r2, 16 }
- { lw r4, r1; addi r1, r1, 4 }
- { sw r0, r3; addi r0, r0, 4; addi r2, r2, -4 }
- { sw r0, r4; addi r0, r0, 4; addi r2, r2, -4 }
-.Lcopy_8_check:
- { bzt r8, .Lcopy_8_loop; slti_u r4, r2, 4 }
-
- /* Copy odd leftover word, if any. */
- { bnzt r4, .Lcheck_odd_stragglers }
- { lw r3, r1; addi r1, r1, 4 }
- { sw r0, r3; addi r0, r0, 4; addi r2, r2, -4 }
-
-.Lcheck_odd_stragglers:
- { bnz r2, .Lcopy_unaligned_few }
-
-.Ldone:
- { move r0, r23; jrp lr }
-
-/* Prefetching multiple cache line copy handler (for large transfers). */
-
- /* Copy words until r1 is cache-line-aligned. */
-.Lalign_loop:
- { lw r3, r1; addi r1, r1, 4 }
- { andi r6, r1, 63 }
- { sw r0, r3; addi r0, r0, 4; addi r2, r2, -4 }
-.Lcopy_many:
- { bnzt r6, .Lalign_loop; addi r9, r0, 63 }
-
- { addi r3, r1, 60; andi r9, r9, -64 }
-
- /* No need to prefetch dst, we'll just do the wh64
- right before we copy a line. */
- { lw r5, r3; addi r3, r3, 64; movei r4, 1 }
- /* Intentionally stall for a few cycles to leave L2 cache alone. */
- { bnzt zero, .; move r27, lr }
- { lw r6, r3; addi r3, r3, 64 }
- /* Intentionally stall for a few cycles to leave L2 cache alone. */
- { bnzt zero, . }
- { lw r7, r3; addi r3, r3, 64 }
- /* Intentionally stall for a few cycles to leave L2 cache alone. */
- { bz zero, .Lbig_loop2 }
-
- /* On entry to this loop:
- - r0 points to the start of dst line 0
- - r1 points to start of src line 0
- - r2 >= (256 - 60), only the first time the loop trips.
- - r3 contains r1 + 128 + 60 [pointer to end of source line 2]
- This is our prefetch address. When we get near the end
- rather than prefetching off the end this is changed to point
- to some "safe" recently loaded address.
- - r5 contains *(r1 + 60) [i.e. last word of source line 0]
- - r6 contains *(r1 + 64 + 60) [i.e. last word of source line 1]
- - r9 contains ((r0 + 63) & -64)
- [start of next dst cache line.] */
-
-.Lbig_loop:
- { jal .Lcopy_line2; add r15, r1, r2 }
-
-.Lbig_loop2:
- /* Copy line 0, first stalling until r5 is ready. */
- { move r12, r5; lw r16, r1 }
- { bz r4, .Lcopy_8_check; slti_u r8, r2, 8 }
- /* Prefetch several lines ahead. */
- { lw r5, r3; addi r3, r3, 64 }
- { jal .Lcopy_line }
-
- /* Copy line 1, first stalling until r6 is ready. */
- { move r12, r6; lw r16, r1 }
- { bz r4, .Lcopy_8_check; slti_u r8, r2, 8 }
- /* Prefetch several lines ahead. */
- { lw r6, r3; addi r3, r3, 64 }
- { jal .Lcopy_line }
-
- /* Copy line 2, first stalling until r7 is ready. */
- { move r12, r7; lw r16, r1 }
- { bz r4, .Lcopy_8_check; slti_u r8, r2, 8 }
- /* Prefetch several lines ahead. */
- { lw r7, r3; addi r3, r3, 64 }
- /* Use up a caches-busy cycle by jumping back to the top of the
- loop. Might as well get it out of the way now. */
- { j .Lbig_loop }
-
-
- /* On entry:
- - r0 points to the destination line.
- - r1 points to the source line.
- - r3 is the next prefetch address.
- - r9 holds the last address used for wh64.
- - r12 = WORD_15
- - r16 = WORD_0.
- - r17 == r1 + 16.
- - r27 holds saved lr to restore.
-
- On exit:
- - r0 is incremented by 64.
- - r1 is incremented by 64, unless that would point to a word
- beyond the end of the source array, in which case it is redirected
- to point to an arbitrary word already in the cache.
- - r2 is decremented by 64.
- - r3 is unchanged, unless it points to a word beyond the
- end of the source array, in which case it is redirected
- to point to an arbitrary word already in the cache.
- Redirecting is OK since if we are that close to the end
- of the array we will not come back to this subroutine
- and use the contents of the prefetched address.
- - r4 is nonzero iff r2 >= 64.
- - r9 is incremented by 64, unless it points beyond the
- end of the last full destination cache line, in which
- case it is redirected to a "safe address" that can be
- clobbered (sp - 64)
- - lr contains the value in r27. */
-
-/* r26 unused */
-
-.Lcopy_line:
- /* TODO: when r3 goes past the end, we would like to redirect it
- to prefetch the last partial cache line (if any) just once, for the
- benefit of the final cleanup loop. But we don't want to
- prefetch that line more than once, or subsequent prefetches
- will go into the RTF. But then .Lbig_loop should unconditionally
- branch to top of loop to execute final prefetch, and its
- nop should become a conditional branch. */
-
- /* We need two non-memory cycles here to cover the resources
- used by the loads initiated by the caller. */
- { add r15, r1, r2 }
-.Lcopy_line2:
- { slt_u r13, r3, r15; addi r17, r1, 16 }
-
- /* NOTE: this will stall for one cycle as L1 is busy. */
-
- /* Fill second L1D line. */
- { lw r17, r17; addi r1, r1, 48; mvz r3, r13, r1 } /* r17 = WORD_4 */
-
- /* Prepare destination line for writing. */
- { wh64 r9; addi r9, r9, 64 }
-
- /* Load seven words that are L1D hits to cover wh64 L2 usage. */
-
- /* Load the three remaining words from the last L1D line, which
- we know has already filled the L1D. */
- { lw r4, r1; addi r1, r1, 4; addi r20, r1, 16 } /* r4 = WORD_12 */
- { lw r8, r1; addi r1, r1, 4; slt_u r13, r20, r15 }/* r8 = WORD_13 */
- { lw r11, r1; addi r1, r1, -52; mvz r20, r13, r1 } /* r11 = WORD_14 */
-
- /* Load the three remaining words from the first L1D line, first
- stalling until it has filled by "looking at" r16. */
- { lw r13, r1; addi r1, r1, 4; move zero, r16 } /* r13 = WORD_1 */
- { lw r14, r1; addi r1, r1, 4 } /* r14 = WORD_2 */
- { lw r15, r1; addi r1, r1, 8; addi r10, r0, 60 } /* r15 = WORD_3 */
-
- /* Load second word from the second L1D line, first
- stalling until it has filled by "looking at" r17. */
- { lw r19, r1; addi r1, r1, 4; move zero, r17 } /* r19 = WORD_5 */
-
- /* Store last word to the destination line, potentially dirtying it
- for the first time, which keeps the L2 busy for two cycles. */
- { sw r10, r12 } /* store(WORD_15) */
-
- /* Use two L1D hits to cover the sw L2 access above. */
- { lw r10, r1; addi r1, r1, 4 } /* r10 = WORD_6 */
- { lw r12, r1; addi r1, r1, 4 } /* r12 = WORD_7 */
-
- /* Fill third L1D line. */
- { lw r18, r1; addi r1, r1, 4 } /* r18 = WORD_8 */
-
- /* Store first L1D line. */
- { sw r0, r16; addi r0, r0, 4; add r16, r0, r2 } /* store(WORD_0) */
- { sw r0, r13; addi r0, r0, 4; andi r16, r16, -64 } /* store(WORD_1) */
- { sw r0, r14; addi r0, r0, 4; slt_u r16, r9, r16 } /* store(WORD_2) */
- { sw r0, r15; addi r0, r0, 4; addi r13, sp, -64 } /* store(WORD_3) */
-
- /* Store second L1D line. */
- { sw r0, r17; addi r0, r0, 4; mvz r9, r16, r13 }/* store(WORD_4) */
- { sw r0, r19; addi r0, r0, 4 } /* store(WORD_5) */
- { sw r0, r10; addi r0, r0, 4 } /* store(WORD_6) */
- { sw r0, r12; addi r0, r0, 4 } /* store(WORD_7) */
-
- { lw r13, r1; addi r1, r1, 4; move zero, r18 } /* r13 = WORD_9 */
- { lw r14, r1; addi r1, r1, 4 } /* r14 = WORD_10 */
- { lw r15, r1; move r1, r20 } /* r15 = WORD_11 */
-
- /* Store third L1D line. */
- { sw r0, r18; addi r0, r0, 4 } /* store(WORD_8) */
- { sw r0, r13; addi r0, r0, 4 } /* store(WORD_9) */
- { sw r0, r14; addi r0, r0, 4 } /* store(WORD_10) */
- { sw r0, r15; addi r0, r0, 4 } /* store(WORD_11) */
-
- /* Store rest of fourth L1D line. */
- { sw r0, r4; addi r0, r0, 4 } /* store(WORD_12) */
- {
- sw r0, r8 /* store(WORD_13) */
- addi r0, r0, 4
- /* Will r2 be > 64 after we subtract 64 below? */
- shri r4, r2, 7
- }
- {
- sw r0, r11 /* store(WORD_14) */
- addi r0, r0, 8
- /* Record 64 bytes successfully copied. */
- addi r2, r2, -64
- }
-
- { jrp lr; move lr, r27 }
-
- /* Convey to the backtrace library that the stack frame is
- size zero, and the real return address is on the stack
- rather than in 'lr'. */
- { info 8 }
-
- .align 64
-.Lcopy_unaligned_maybe_many:
- /* Skip the setup overhead if we aren't copying many bytes. */
- { slti_u r8, r2, 20; sub r4, zero, r0 }
- { bnzt r8, .Lcopy_unaligned_few; andi r4, r4, 3 }
- { bz r4, .Ldest_is_word_aligned; add r18, r1, r2 }
-
-/* Unaligned 4 byte at a time copy handler. */
-
- /* Copy single bytes until r0 == 0 mod 4, so we can store words. */
-.Lalign_dest_loop:
- { lb_u r3, r1; addi r1, r1, 1; addi r4, r4, -1 }
- { sb r0, r3; addi r0, r0, 1; addi r2, r2, -1 }
- { bnzt r4, .Lalign_dest_loop; andi r3, r1, 3 }
-
- /* If source and dest are now *both* aligned, do an aligned copy. */
- { bz r3, .Lcheck_aligned_copy_size; addli r4, r2, -256 }
-
-.Ldest_is_word_aligned:
-
- { andi r8, r0, 63; lwadd_na r6, r1, 4}
- { slti_u r9, r2, 64; bz r8, .Ldest_is_L2_line_aligned }
-
- /* This copies unaligned words until either there are fewer
- than 4 bytes left to copy, or until the destination pointer
- is cache-aligned, whichever comes first.
-
- On entry:
- - r0 is the next store address.
- - r1 points 4 bytes past the load address corresponding to r0.
- - r2 >= 4
- - r6 is the next aligned word loaded. */
-.Lcopy_unaligned_src_words:
- { lwadd_na r7, r1, 4; slti_u r8, r2, 4 + 4 }
- /* stall */
- { dword_align r6, r7, r1; slti_u r9, r2, 64 + 4 }
- { swadd r0, r6, 4; addi r2, r2, -4 }
- { bnz r8, .Lcleanup_unaligned_words; andi r8, r0, 63 }
- { bnzt r8, .Lcopy_unaligned_src_words; move r6, r7 }
-
- /* On entry:
- - r0 is the next store address.
- - r1 points 4 bytes past the load address corresponding to r0.
- - r2 >= 4 (# of bytes left to store).
- - r6 is the next aligned src word value.
- - r9 = (r2 < 64U).
- - r18 points one byte past the end of source memory. */
-.Ldest_is_L2_line_aligned:
-
- {
- /* Not a full cache line remains. */
- bnz r9, .Lcleanup_unaligned_words
- move r7, r6
- }
-
- /* r2 >= 64 */
-
- /* Kick off two prefetches, but don't go past the end. */
- { addi r3, r1, 63 - 4; addi r8, r1, 64 + 63 - 4 }
- { prefetch r3; move r3, r8; slt_u r8, r8, r18 }
- { mvz r3, r8, r1; addi r8, r3, 64 }
- { prefetch r3; move r3, r8; slt_u r8, r8, r18 }
- { mvz r3, r8, r1; movei r17, 0 }
-
-.Lcopy_unaligned_line:
- /* Prefetch another line. */
- { prefetch r3; addi r15, r1, 60; addi r3, r3, 64 }
- /* Fire off a load of the last word we are about to copy. */
- { lw_na r15, r15; slt_u r8, r3, r18 }
-
- { mvz r3, r8, r1; wh64 r0 }
-
- /* This loop runs twice.
-
- On entry:
- - r17 is even before the first iteration, and odd before
- the second. It is incremented inside the loop. Encountering
- an even value at the end of the loop makes it stop. */
-.Lcopy_half_an_unaligned_line:
- {
- /* Stall until the last byte is ready. In the steady state this
- guarantees all words to load below will be in the L2 cache, which
- avoids shunting the loads to the RTF. */
- move zero, r15
- lwadd_na r7, r1, 16
- }
- { lwadd_na r11, r1, 12 }
- { lwadd_na r14, r1, -24 }
- { lwadd_na r8, r1, 4 }
- { lwadd_na r9, r1, 4 }
- {
- lwadd_na r10, r1, 8
- /* r16 = (r2 < 64), after we subtract 32 from r2 below. */
- slti_u r16, r2, 64 + 32
- }
- { lwadd_na r12, r1, 4; addi r17, r17, 1 }
- { lwadd_na r13, r1, 8; dword_align r6, r7, r1 }
- { swadd r0, r6, 4; dword_align r7, r8, r1 }
- { swadd r0, r7, 4; dword_align r8, r9, r1 }
- { swadd r0, r8, 4; dword_align r9, r10, r1 }
- { swadd r0, r9, 4; dword_align r10, r11, r1 }
- { swadd r0, r10, 4; dword_align r11, r12, r1 }
- { swadd r0, r11, 4; dword_align r12, r13, r1 }
- { swadd r0, r12, 4; dword_align r13, r14, r1 }
- { swadd r0, r13, 4; addi r2, r2, -32 }
- { move r6, r14; bbst r17, .Lcopy_half_an_unaligned_line }
-
- { bzt r16, .Lcopy_unaligned_line; move r7, r6 }
-
- /* On entry:
- - r0 is the next store address.
- - r1 points 4 bytes past the load address corresponding to r0.
- - r2 >= 0 (# of bytes left to store).
- - r7 is the next aligned src word value. */
-.Lcleanup_unaligned_words:
- /* Handle any trailing bytes. */
- { bz r2, .Lcopy_unaligned_done; slti_u r8, r2, 4 }
- { bzt r8, .Lcopy_unaligned_src_words; move r6, r7 }
-
- /* Move r1 back to the point where it corresponds to r0. */
- { addi r1, r1, -4 }
-
- /* Fall through */
-
-/* 1 byte at a time copy handler. */
-
-.Lcopy_unaligned_few:
- { lb_u r3, r1; addi r1, r1, 1 }
- { sb r0, r3; addi r0, r0, 1; addi r2, r2, -1 }
- { bnzt r2, .Lcopy_unaligned_few }
-
-.Lcopy_unaligned_done:
-
- { move r0, r23; jrp lr }
-
-END (__memcpy)
-
-weak_alias (__memcpy, memcpy)
-libc_hidden_builtin_def (memcpy)
diff --git a/sysdeps/tile/tilepro/memset.c b/sysdeps/tile/tilepro/memset.c
deleted file mode 100644
index c0ba94e64f..0000000000
--- a/sysdeps/tile/tilepro/memset.c
+++ /dev/null
@@ -1,151 +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 <string.h>
-#include <stdint.h>
-#include <arch/chip.h>
-
-void * inhibit_loop_to_libcall
-__memset (void *s, int c, size_t n)
-{
- uint32_t *out32;
- int n32;
- uint32_t v16, v32;
- uint8_t *out8 = s;
- int to_align32;
-
- /* Experimentation shows that a trivial tight loop is a win up until
- around a size of 20, where writing a word at a time starts to win. */
-#define BYTE_CUTOFF 20
-
-#if BYTE_CUTOFF < 3
- /* This must be at least at least this big, or some code later
- on doesn't work. */
-# error "BYTE_CUTOFF is too small."
-#endif
-
- if (n < BYTE_CUTOFF)
- {
- /* Strangely, this turns out to be the tightest way to write
- this loop. */
- if (n != 0)
- {
- do
- {
- /* Strangely, combining these into one line performs worse. */
- *out8 = c;
- out8++;
- }
- while (--n != 0);
- }
-
- return s;
- }
-
- /* Align 'out8'. We know n >= 3 so this won't write past the end. */
- while (((uintptr_t) out8 & 3) != 0)
- {
- *out8++ = c;
- --n;
- }
-
- /* Align 'n'. */
- while (n & 3)
- out8[--n] = c;
-
- out32 = (uint32_t *) out8;
- n32 = n >> 2;
-
- /* Tile input byte out to 32 bits. */
- v16 = __insn_intlb (c, c);
- v32 = __insn_intlh (v16, v16);
-
- /* This must be at least 8 or the following loop doesn't work. */
-#define CACHE_LINE_SIZE_IN_WORDS (CHIP_L2_LINE_SIZE() / 4)
-
- /* Determine how many words we need to emit before the 'out32'
- pointer becomes aligned modulo the cache line size. */
- to_align32 = (-((uintptr_t) out32 >> 2)) & (CACHE_LINE_SIZE_IN_WORDS - 1);
-
- /* Only bother aligning and using wh64 if there is at least one full
- cache line to process. This check also prevents overrunning the
- end of the buffer with alignment words. */
- if (to_align32 <= n32 - CACHE_LINE_SIZE_IN_WORDS)
- {
- int lines_left;
-
- /* Align out32 mod the cache line size so we can use wh64. */
- n32 -= to_align32;
- for (; to_align32 != 0; to_align32--)
- {
- *out32 = v32;
- out32++;
- }
-
- /* Use unsigned divide to turn this into a right shift. */
- lines_left = (unsigned) n32 / CACHE_LINE_SIZE_IN_WORDS;
-
- do
- {
- /* Only wh64 a few lines at a time, so we don't exceed the
- maximum number of victim lines. */
- int x = ((lines_left < CHIP_MAX_OUTSTANDING_VICTIMS ())? lines_left
- : CHIP_MAX_OUTSTANDING_VICTIMS ());
- uint32_t *wh = out32;
- int i = x;
- int j;
-
- lines_left -= x;
-
- do
- {
- __insn_wh64 (wh);
- wh += CACHE_LINE_SIZE_IN_WORDS;
- }
- while (--i);
-
- for (j = x * (CACHE_LINE_SIZE_IN_WORDS / 4); j != 0; j--)
- {
- *out32++ = v32;
- *out32++ = v32;
- *out32++ = v32;
- *out32++ = v32;
- }
- }
- while (lines_left != 0);
-
- /* We processed all full lines above, so only this many words
- remain to be processed. */
- n32 &= CACHE_LINE_SIZE_IN_WORDS - 1;
- }
-
- /* Now handle any leftover values. */
- if (n32 != 0)
- {
- do
- {
- *out32 = v32;
- out32++;
- }
- while (--n32 != 0);
- }
-
- return s;
-}
-weak_alias (__memset, memset)
-libc_hidden_builtin_def (memset)
diff --git a/sysdeps/tile/tilepro/memusage.h b/sysdeps/tile/tilepro/memusage.h
deleted file mode 100644
index 3d66c7248d..0000000000
--- a/sysdeps/tile/tilepro/memusage.h
+++ /dev/null
@@ -1,29 +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 <arch/spr_def.h>
-
-#define GETSP() ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; })
-
-#define GETTIME(low,high) \
- { \
- low = __insn_mfspr (SPR_CYCLE_LOW); \
- high = __insn_mfspr (SPR_CYCLE_HIGH); \
- }
-
-#include <sysdeps/generic/memusage.h>
diff --git a/sysdeps/tile/tilepro/rawmemchr.c b/sysdeps/tile/tilepro/rawmemchr.c
deleted file mode 100644
index 164028d545..0000000000
--- a/sysdeps/tile/tilepro/rawmemchr.c
+++ /dev/null
@@ -1,45 +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 <string.h>
-#include <stdint.h>
-
-void *
-__rawmemchr (const void *s, int c)
-{
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint32_t *p = (const uint32_t *) (s_int & -4);
-
- /* Create four copies of the byte for which we are looking. */
- const uint32_t goal = 0x01010101 * (uint8_t) c;
-
- /* Read the first word, but munge it so that bytes before the array
- will not match goal. Note that this shift count expression works
- because we know shift counts are taken mod 32. */
- const uint32_t before_mask = (1 << (s_int << 3)) - 1;
- uint32_t v = (*p | before_mask) ^ (goal & before_mask);
-
- uint32_t bits;
- while ((bits = __insn_seqb (v, goal)) == 0)
- v = *++p;
-
- return ((char *) p) + (__insn_ctz (bits) >> 3);
-}
-libc_hidden_def (__rawmemchr)
-weak_alias (__rawmemchr, rawmemchr)
diff --git a/sysdeps/tile/tilepro/strchr.c b/sysdeps/tile/tilepro/strchr.c
deleted file mode 100644
index 761763851b..0000000000
--- a/sysdeps/tile/tilepro/strchr.c
+++ /dev/null
@@ -1,68 +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 <string.h>
-#include <stdint.h>
-
-#undef strchr
-
-char *
-strchr (const char *s, int c)
-{
- int z, g;
-
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint32_t *p = (const uint32_t *) (s_int & -4);
-
- /* Create four copies of the byte for which we are looking. */
- const uint32_t goal = 0x01010101 * (uint8_t) c;
-
- /* Read the first aligned word, but force bytes before the string to
- match neither zero nor goal (we make sure the high bit of each
- byte is 1, and the low 7 bits are all the opposite of the goal
- byte). Note that this shift count expression works because we
- know shift counts are taken mod 32. */
- const uint32_t before_mask = (1 << (s_int << 3)) - 1;
- uint32_t v = (*p | before_mask) ^ (goal & __insn_shrib (before_mask, 1));
-
- uint32_t zero_matches, goal_matches;
- while (1)
- {
- /* Look for a terminating '\0'. */
- zero_matches = __insn_seqb (v, 0);
-
- /* Look for the goal byte. */
- goal_matches = __insn_seqb (v, goal);
-
- if (__builtin_expect ((zero_matches | goal_matches) != 0, 0))
- break;
-
- v = *++p;
- }
-
- z = __insn_ctz (zero_matches);
- g = __insn_ctz (goal_matches);
-
- /* If we found c before '\0' we got a match. Note that if c == '\0'
- then g == z, and we correctly return the address of the '\0'
- rather than NULL. */
- return (g <= z) ? ((char *) p) + (g >> 3) : NULL;
-}
-weak_alias (strchr, index)
-libc_hidden_builtin_def (strchr)
diff --git a/sysdeps/tile/tilepro/strchrnul.c b/sysdeps/tile/tilepro/strchrnul.c
deleted file mode 100644
index 5a6a596293..0000000000
--- a/sysdeps/tile/tilepro/strchrnul.c
+++ /dev/null
@@ -1,65 +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 <string.h>
-#include <stdint.h>
-
-char *
-__strchrnul (const char *s, int c)
-{
- int z, g;
-
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint32_t *p = (const uint32_t *) (s_int & -4);
-
- /* Create four copies of the byte for which we are looking. */
- const uint32_t goal = 0x01010101 * (uint8_t) c;
-
- /* Read the first aligned word, but force bytes before the string to
- match neither zero nor goal (we make sure the high bit of each
- byte is 1, and the low 7 bits are all the opposite of the goal
- byte). Note that this shift count expression works because we
- know shift counts are taken mod 32. */
- const uint32_t before_mask = (1 << (s_int << 3)) - 1;
- uint32_t v = (*p | before_mask) ^ (goal & __insn_shrib (before_mask, 1));
-
- uint32_t zero_matches, goal_matches;
- while (1)
- {
- /* Look for a terminating '\0'. */
- zero_matches = __insn_seqb (v, 0);
-
- /* Look for the goal byte. */
- goal_matches = __insn_seqb (v, goal);
-
- if (__builtin_expect ((zero_matches | goal_matches) != 0, 0))
- break;
-
- v = *++p;
- }
-
- z = __insn_ctz (zero_matches);
- g = __insn_ctz (goal_matches);
-
- /* Return a pointer to the NUL or goal, whichever is first. */
- if (z < g)
- g = z;
- return ((char *) p) + (g >> 3);
-}
-weak_alias (__strchrnul, strchrnul)
diff --git a/sysdeps/tile/tilepro/strlen.c b/sysdeps/tile/tilepro/strlen.c
deleted file mode 100644
index 0f0f4997e0..0000000000
--- a/sysdeps/tile/tilepro/strlen.c
+++ /dev/null
@@ -1,39 +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 <string.h>
-#include <stdint.h>
-
-size_t
-strlen (const char *s)
-{
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint32_t *p = (const uint32_t *) (s_int & -4);
-
- /* Read the first word, but force bytes before the string to be nonzero.
- This expression works because we know shift counts are taken mod 32. */
- uint32_t v = *p | ((1 << (s_int << 3)) - 1);
-
- uint32_t bits;
- while ((bits = __insn_seqb (v, 0)) == 0)
- v = *++p;
-
- return ((const char *) p) + (__insn_ctz (bits) >> 3) - s;
-}
-libc_hidden_builtin_def (strlen)
diff --git a/sysdeps/tile/tilepro/strrchr.c b/sysdeps/tile/tilepro/strrchr.c
deleted file mode 100644
index 49d0bfbea1..0000000000
--- a/sysdeps/tile/tilepro/strrchr.c
+++ /dev/null
@@ -1,73 +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 <string.h>
-#include <stdint.h>
-
-char *
-strrchr (const char *s, int c)
-{
- /* Get an aligned pointer. */
- const uintptr_t s_int = (uintptr_t) s;
- const uint32_t *p = (const uint32_t *) (s_int & -4);
-
- /* Create four copies of the byte for which we are looking. */
- const uint32_t goal = 0x01010101 * (uint8_t) c;
-
- /* Read the first aligned word, but force bytes before the string to
- match neither zero nor goal (we make sure the high bit of each
- byte is 1, and the low 7 bits are all the opposite of the goal
- byte). Note that this shift count expression works because we
- know shift counts are taken mod 32. */
- const uint32_t before_mask = (1 << (s_int << 3)) - 1;
- uint32_t v = (*p | before_mask) ^ (goal & __insn_shrib (before_mask, 1));
- const char *found = NULL;
- uint32_t zero_matches, goal_matches;
- while (1)
- {
- /* Look for a terminating '\0'. */
- zero_matches = __insn_seqb (v, 0);
-
- /* Look for the goal byte. */
- goal_matches = __insn_seqb (v, goal);
-
- /* If we found the goal, record the last offset. */
- if (__builtin_expect (goal_matches != 0, 0))
- {
- if (__builtin_expect (zero_matches != 0, 0))
- {
- /* Clear any goal after the first zero. */
- int first_nul = __insn_ctz (zero_matches);
- /* The number of top bits we need to clear is
- 32 - (first_nul + 8). */
- int shift_amt = (24 - first_nul);
- goal_matches <<= shift_amt;
- goal_matches >>= shift_amt;
- }
- if (__builtin_expect (goal_matches != 0, 1))
- found = ((char *) p) + 3 - (__insn_clz (goal_matches) >> 3);
- }
-
- if (__builtin_expect (zero_matches != 0, 0))
- return (char *) found;
-
- v = *++p;
- }
-}
-weak_alias (strrchr, rindex)
-libc_hidden_builtin_def (strrchr)
diff --git a/sysdeps/tile/tls-macros.h b/sysdeps/tile/tls-macros.h
deleted file mode 100644
index dfa6f30acb..0000000000
--- a/sysdeps/tile/tls-macros.h
+++ /dev/null
@@ -1,84 +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/>. */
-
-#ifdef __tilegx__
-#define TLS_GD_OFFSET(x) \
- "moveli r0, hw1_last_tls_gd(" #x ")\n\t" \
- "shl16insli r0, r0, hw0_tls_gd(" #x ")\n\t" \
- "addi r0, %1, tls_add(" #x ")\n\t"
-#else
-#define TLS_GD_OFFSET(x) \
- "auli r0, %1, tls_gd_ha16(" #x ")\n\t" \
- "addli r0, r0, tls_gd_lo16(" #x ")\n\t"
-#endif
-
-#define TLS_GD(x) \
- ({ \
- int *__retval; \
- extern char _GLOBAL_OFFSET_TABLE_[]; \
- \
- asm (TLS_GD_OFFSET(x) \
- "jal tls_gd_call(" #x ")\n\t" \
- "addi %0, r0, tls_gd_add(" #x ")" : \
- "=&r" (__retval) : "r" (_GLOBAL_OFFSET_TABLE_) : \
- "r0", "r25", "r26", "r27", "r28", "r29"); \
- __retval; })
-
-/* No special support for LD mode. */
-#define TLS_LD TLS_GD
-
-#ifdef __tilegx__
-#define TLS_IE_OFFSET(x) \
- "moveli %0, hw1_last_tls_ie(" #x ")\n\t" \
- "shl16insli %0, %0, hw0_tls_ie(" #x ")\n\t" \
- "addi %0, %1, tls_add(" #x ")\n\t"
-#define LD_TLS "ld_tls"
-#else
-#define TLS_IE_OFFSET(x) \
- "auli %0, %1, tls_ie_ha16(" #x ")\n\t" \
- "addli %0, %0, tls_ie_lo16(" #x ")\n\t"
-#define LD_TLS "lw_tls"
-#endif
-
-#define TLS_IE(x) \
- ({ \
- int *__retval; \
- extern char _GLOBAL_OFFSET_TABLE_[]; \
- \
- asm (TLS_IE_OFFSET(x) \
- LD_TLS " %0, %0, tls_ie_load(" #x ")\n\t" \
- "add %0, %0, tp" : \
- "=&r" (__retval) : "r" (_GLOBAL_OFFSET_TABLE_)); \
- __retval; })
-
-#ifdef __tilegx__
-#define _TLS_LE(x) \
- "moveli %0, hw1_last_tls_le(" #x ")\n\t" \
- "shl16insli %0, %0, hw0_tls_le(" #x ")\n\t" \
- "add %0, %0, tp"
-#else
-#define _TLS_LE(x) \
- "auli %0, tp, tls_le_ha16(" #x ")\n\t" \
- "addli %0, %0, tls_le_lo16(" #x ")\n\t"
-#endif
-
-#define TLS_LE(x) \
- ({ \
- int *__retval; \
- asm (_TLS_LE(x) : "=r" (__retval)); \
- __retval; })
diff --git a/sysdeps/tile/tst-audit.h b/sysdeps/tile/tst-audit.h
deleted file mode 100644
index 6b6e5e85e9..0000000000
--- a/sysdeps/tile/tst-audit.h
+++ /dev/null
@@ -1,23 +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/>. */
-
-#define pltenter la_tile_gnu_pltenter
-#define pltexit la_tile_gnu_pltexit
-#define La_regs La_tile_regs
-#define La_retval La_tile_retval
-#define int_retval lrv_reg[0]
diff --git a/sysdeps/tile/wordcopy.c b/sysdeps/tile/wordcopy.c
deleted file mode 100644
index 64263883f7..0000000000
--- a/sysdeps/tile/wordcopy.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/* wordcopy.c -- subroutines for memory copy functions. Tile version.
- Copyright (C) 1991-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/>. */
-
-/* To optimize for tile, we make the following changes from the
- default glibc version:
- - Use the double align instruction instead of the MERGE macro.
- - Since we don't have offset addressing mode, make sure the loads /
- stores in the inner loop always have indices of 0.
- - Use post-increment addresses in the inner loops, which yields
- better scheduling. */
-
-/* BE VERY CAREFUL IF YOU CHANGE THIS CODE...! */
-
-#include <stddef.h>
-#include <memcopy.h>
-
-/* Provide the appropriate dblalign builtin to shift two registers
- based on the alignment of a pointer held in a third register. */
-#ifdef __tilegx__
-#define DBLALIGN __insn_dblalign
-#else
-#define DBLALIGN __insn_dword_align
-#endif
-
-/* _wordcopy_fwd_aligned -- Copy block beginning at SRCP to
- block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
- Both SRCP and DSTP should be aligned for memory operations on `op_t's. */
-
-void
-_wordcopy_fwd_aligned (long int dstp, long int srcp, size_t len)
-{
- op_t a0, a1;
-
- switch (len % 8)
- {
- case 2:
- a0 = ((op_t *) srcp)[0];
- srcp += OPSIZ;
- len += 6;
- goto do1;
- case 3:
- a1 = ((op_t *) srcp)[0];
- srcp += OPSIZ;
- len += 5;
- goto do2;
- case 4:
- a0 = ((op_t *) srcp)[0];
- srcp += OPSIZ;
- len += 4;
- goto do3;
- case 5:
- a1 = ((op_t *) srcp)[0];
- srcp += OPSIZ;
- len += 3;
- goto do4;
- case 6:
- a0 = ((op_t *) srcp)[0];
- srcp += OPSIZ;
- len += 2;
- goto do5;
- case 7:
- a1 = ((op_t *) srcp)[0];
- srcp += OPSIZ;
- len += 1;
- goto do6;
-
- case 0:
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- return;
- a0 = ((op_t *) srcp)[0];
- srcp += OPSIZ;
- goto do7;
- case 1:
- a1 = ((op_t *) srcp)[0];
- srcp += OPSIZ;
- len -= 1;
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- goto do0;
- goto do8; /* No-op. */
- }
-
- do
- {
- do8:
- a0 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a1;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do7:
- a1 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a0;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do6:
- a0 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a1;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do5:
- a1 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a0;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do4:
- a0 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a1;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do3:
- a1 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a0;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do2:
- a0 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a1;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do1:
- a1 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a0;
- srcp += OPSIZ;
- dstp += OPSIZ;
-
- len -= 8;
- }
- while (len != 0);
-
- /* This is the right position for do0. Please don't move
- it into the loop. */
- do0:
- ((op_t *) dstp)[0] = a1;
-}
-
-/* _wordcopy_fwd_dest_aligned -- Copy block beginning at SRCP to
- block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
- DSTP should be aligned for memory operations on `op_t's, but SRCP must
- *not* be aligned. */
-
-void
-_wordcopy_fwd_dest_aligned (long int dstp, long int srcp, size_t len)
-{
- void * srci;
- op_t a0, a1, a2, a3;
-
- /* Save the initial source pointer so we know the number of bytes to
- shift for merging two unaligned results. */
- srci = (void *) srcp;
-
- /* Make SRCP aligned by rounding it down to the beginning of the `op_t'
- it points in the middle of. */
- srcp &= -OPSIZ;
-
- switch (len % 4)
- {
- case 2:
- a1 = ((op_t *) srcp)[0];
- a2 = ((op_t *) srcp)[1];
- len += 2;
- srcp += 2 * OPSIZ;
- goto do1;
- case 3:
- a0 = ((op_t *) srcp)[0];
- a1 = ((op_t *) srcp)[1];
- len += 1;
- srcp += 2 * OPSIZ;
- goto do2;
- case 0:
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- return;
- a3 = ((op_t *) srcp)[0];
- a0 = ((op_t *) srcp)[1];
- len += 0;
- srcp += 2 * OPSIZ;
- goto do3;
- case 1:
- a2 = ((op_t *) srcp)[0];
- a3 = ((op_t *) srcp)[1];
- srcp += 2 * OPSIZ;
- len -= 1;
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- goto do0;
- goto do4; /* No-op. */
- }
-
- do
- {
- do4:
- a0 = ((op_t *) srcp)[0];
- a2 = DBLALIGN (a2, a3, srci);
- ((op_t *) dstp)[0] = a2;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do3:
- a1 = ((op_t *) srcp)[0];
- a3 = DBLALIGN (a3, a0, srci);
- ((op_t *) dstp)[0] = a3;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do2:
- a2 = ((op_t *) srcp)[0];
- a0 = DBLALIGN (a0, a1, srci);
- ((op_t *) dstp)[0] = a0;
- srcp += OPSIZ;
- dstp += OPSIZ;
- do1:
- a3 = ((op_t *) srcp)[0];
- a1 = DBLALIGN (a1, a2, srci);
- ((op_t *) dstp)[0] = a1;
- srcp += OPSIZ;
- dstp += OPSIZ;
- len -= 4;
- }
- while (len != 0);
-
- /* This is the right position for do0. Please don't move
- it into the loop. */
- do0:
- ((op_t *) dstp)[0] = DBLALIGN (a2, a3, srci);
-}
-
-/* _wordcopy_bwd_aligned -- Copy block finishing right before
- SRCP to block finishing right before DSTP with LEN `op_t' words
- (not LEN bytes!). Both SRCP and DSTP should be aligned for memory
- operations on `op_t's. */
-
-void
-_wordcopy_bwd_aligned (long int dstp, long int srcp, size_t len)
-{
- op_t a0, a1;
- long int srcp1;
-
- srcp1 = srcp - 1 * OPSIZ;
- srcp -= 2 * OPSIZ;
- dstp -= 1 * OPSIZ;
-
- switch (len % 8)
- {
- case 2:
- a0 = ((op_t *) srcp1)[0];
- len += 6;
- goto do1;
- case 3:
- a1 = ((op_t *) srcp1)[0];
- len += 5;
- goto do2;
- case 4:
- a0 = ((op_t *) srcp1)[0];
- len += 4;
- goto do3;
- case 5:
- a1 = ((op_t *) srcp1)[0];
- len += 3;
- goto do4;
- case 6:
- a0 = ((op_t *) srcp1)[0];
- len += 2;
- goto do5;
- case 7:
- a1 = ((op_t *) srcp1)[0];
- len += 1;
- goto do6;
-
- case 0:
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- return;
- a0 = ((op_t *) srcp1)[0];
- goto do7;
- case 1:
- a1 = ((op_t *) srcp1)[0];
- len -= 1;
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- goto do0;
- goto do8; /* No-op. */
- }
-
- do
- {
- do8:
- a0 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a1;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- do7:
- a1 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a0;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- do6:
- a0 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a1;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- do5:
- a1 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a0;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- do4:
- a0 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a1;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- do3:
- a1 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a0;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- do2:
- a0 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a1;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- do1:
- a1 = ((op_t *) srcp)[0];
- ((op_t *) dstp)[0] = a0;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
-
- len -= 8;
- }
- while (len != 0);
-
- /* This is the right position for do0. Please don't move
- it into the loop. */
- do0:
- ((op_t *) dstp)[0] = a1;
-}
-
-/* _wordcopy_bwd_dest_aligned -- Copy block finishing right
- before SRCP to block finishing right before DSTP with LEN `op_t'
- words (not LEN bytes!). DSTP should be aligned for memory
- operations on `op_t', but SRCP must *not* be aligned. */
-
-void
-_wordcopy_bwd_dest_aligned (long int dstp, long int srcp, size_t len)
-{
- void * srci;
- op_t a0, a1, a2, a3;
- op_t b0, b1, b2, b3;
-
- /* Save the initial source pointer so we know the number of bytes to
- shift for merging two unaligned results. */
- srci = (void *) srcp;
-
- /* Make SRCP aligned by rounding it down to the beginning of the op_t
- it points in the middle of. */
- srcp &= -OPSIZ;
- srcp += OPSIZ;
-
- switch (len % 4)
- {
- case 2:
- srcp -= 3 * OPSIZ;
- dstp -= 1 * OPSIZ;
- b2 = ((op_t *) srcp)[2];
- b1 = a1 = ((op_t *) srcp)[1];
- len += 2;
- goto do1;
- case 3:
- srcp -= 3 * OPSIZ;
- dstp -= 1 * OPSIZ;
- b3 = ((op_t *) srcp)[2];
- b2 = a2 = ((op_t *) srcp)[1];
- len += 1;
- goto do2;
- case 0:
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- return;
- srcp -= 3 * OPSIZ;
- dstp -= 1 * OPSIZ;
- b0 = ((op_t *) srcp)[2];
- b3 = a3 = ((op_t *) srcp)[1];
- goto do3;
- case 1:
- srcp -= 3 * OPSIZ;
- dstp -= 1 * OPSIZ;
- b1 = ((op_t *) srcp)[2];
- b0 = a0 = ((op_t *) srcp)[1];
- len -= 1;
- if (OP_T_THRES <= 3 * OPSIZ && len == 0)
- goto do0;
- goto do4; /* No-op. */
- }
-
- do
- {
- do4:
- b3 = a3 = ((op_t *) srcp)[0];
- a0 = DBLALIGN (a0, b1, srci);
- ((op_t *) dstp)[0] = a0;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- do3:
- b2 = a2 = ((op_t *) srcp)[0];
- a3 = DBLALIGN (a3, b0, srci);
- ((op_t *) dstp)[0] = a3;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- do2:
- b1 = a1 = ((op_t *) srcp)[0];
- a2 = DBLALIGN (a2, b3, srci);
- ((op_t *) dstp)[0] = a2;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
- do1:
- b0 = a0 = ((op_t *) srcp)[0];
- a1 = DBLALIGN (a1, b2, srci);
- ((op_t *) dstp)[0] = a1;
- srcp -= OPSIZ;
- dstp -= OPSIZ;
-
- len -= 4;
- }
- while (len != 0);
-
- /* This is the right position for do0. Please don't move
- it into the loop. */
- do0:
- a0 = DBLALIGN (a0, b1, srci);
- ((op_t *) dstp)[0] = a0;
-}
diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
index fcc002683f..e768c0bef5 100644
--- a/sysdeps/unix/Makefile
+++ b/sysdeps/unix/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2016 Free Software Foundation, Inc.
+# Copyright (C) 1991-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
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/alpha/getegid.S b/sysdeps/unix/alpha/getegid.S
index 6d73b96427..97ee854ff0 100644
--- a/sysdeps/unix/alpha/getegid.S
+++ b/sysdeps/unix/alpha/getegid.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/alpha/geteuid.S b/sysdeps/unix/alpha/geteuid.S
index 75508c5217..1ec51425ac 100644
--- a/sysdeps/unix/alpha/geteuid.S
+++ b/sysdeps/unix/alpha/geteuid.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/alpha/getppid.S b/sysdeps/unix/alpha/getppid.S
index 4d6be75156..740992446c 100644
--- a/sysdeps/unix/alpha/getppid.S
+++ b/sysdeps/unix/alpha/getppid.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/alpha/pipe.S b/sysdeps/unix/alpha/pipe.S
index a3a42ba91f..bbd359e257 100644
--- a/sysdeps/unix/alpha/pipe.S
+++ b/sysdeps/unix/alpha/pipe.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger (davidm@cs.arizona.edu).
diff --git a/sysdeps/unix/alpha/sysdep.S b/sysdeps/unix/alpha/sysdep.S
index d996981996..35fda0c67a 100644
--- a/sysdeps/unix/alpha/sysdep.S
+++ b/sysdeps/unix/alpha/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h
index 6bc2b4e05a..104aa8e48b 100644
--- a/sysdeps/unix/alpha/sysdep.h
+++ b/sysdeps/unix/alpha/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
diff --git a/sysdeps/unix/arm/sysdep.S b/sysdeps/unix/arm/sysdep.S
index 91ac495cc9..4d94432687 100644
--- a/sysdeps/unix/arm/sysdep.S
+++ b/sysdeps/unix/arm/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/arm/sysdep.h b/sysdeps/unix/arm/sysdep.h
index fe59829cbf..8694192fd9 100644
--- a/sysdeps/unix/arm/sysdep.h
+++ b/sysdeps/unix/arm/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/bsd/bits/signum.h b/sysdeps/unix/bsd/bits/signum.h
index 022007cf8a..85e11d6882 100644
--- a/sysdeps/unix/bsd/bits/signum.h
+++ b/sysdeps/unix/bsd/bits/signum.h
@@ -1,5 +1,5 @@
/* Signal number definitions. BSD version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software 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,58 +16,20 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _SIGNAL_H
+#ifndef _BITS_SIGNUM_H
+#define _BITS_SIGNUM_H 1
-/* This file defines the fake signal functions and signal
- number constants for 4.2 or 4.3 BSD-derived Unix system. */
-
-/* Fake signal functions. */
-#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
-#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
-#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
-
-#ifdef __USE_UNIX98
-# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+#ifndef _SIGNAL_H
+#error "Never include <bits/signum.h> directly; use <signal.h> instead."
#endif
+#include <bits/signum-generic.h>
-/* Signals. */
-#define SIGHUP 1 /* Hangup (POSIX). */
-#define SIGINT 2 /* Interrupt (ANSI). */
-#define SIGQUIT 3 /* Quit (POSIX). */
-#define SIGILL 4 /* Illegal instruction (ANSI). */
-#define SIGABRT SIGIOT /* Abort (ANSI). */
-#define SIGTRAP 5 /* Trace trap (POSIX). */
-#define SIGIOT 6 /* IOT trap (4.2 BSD). */
-#define SIGEMT 7 /* EMT trap (4.2 BSD). */
-#define SIGFPE 8 /* Floating-point exception (ANSI). */
-#define SIGKILL 9 /* Kill, unblockable (POSIX). */
-#define SIGBUS 10 /* Bus error (4.2 BSD). */
-#define SIGSEGV 11 /* Segmentation violation (ANSI). */
-#define SIGSYS 12 /* Bad argument to system call (4.2 BSD). */
-#define SIGPIPE 13 /* Broken pipe (POSIX). */
-#define SIGALRM 14 /* Alarm clock (POSIX). */
-#define SIGTERM 15 /* Termination (ANSI). */
-#define SIGURG 16 /* Urgent condition on socket (4.2 BSD). */
-#define SIGSTOP 17 /* Stop, unblockable (POSIX). */
-#define SIGTSTP 18 /* Keyboard stop (POSIX). */
-#define SIGCONT 19 /* Continue (POSIX). */
-#define SIGCHLD 20 /* Child status has changed (POSIX). */
-#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
-#define SIGTTIN 21 /* Background read from tty (POSIX). */
-#define SIGTTOU 22 /* Background write to tty (POSIX). */
-#define SIGIO 23 /* I/O now possible (4.2 BSD). */
-#define SIGPOLL SIGIO /* Same as SIGIO? (SVID). */
-#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */
-#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */
-#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */
-#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */
-#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */
+/* Adjustments and additions to the signal number constants for
+ 4.2 or 4.3 BSD-derived Unix systems. */
+
+#define SIGEMT 7 /* Emulator trap (4.2 BSD). */
#define SIGINFO 29 /* Information request (4.4 BSD). */
-#define SIGUSR1 30 /* User-defined signal 1 (POSIX). */
-#define SIGUSR2 31 /* User-defined signal 2 (POSIX). */
#define SIGLOST 32 /* Resource lost (Sun); server died (GNU). */
-#endif /* <signal.h> included. */
-
-#define _NSIG 33 /* Biggest signal number + 1. */
+#endif /* bits/signum.h. */
diff --git a/sysdeps/unix/bsd/bits/sockaddr.h b/sysdeps/unix/bsd/bits/sockaddr.h
index aa127689bf..8a8030638f 100644
--- a/sysdeps/unix/bsd/bits/sockaddr.h
+++ b/sysdeps/unix/bsd/bits/sockaddr.h
@@ -1,5 +1,5 @@
-/* Definition of `struct sockaddr_*' common members. 4.4 BSD version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Definition of struct sockaddr_* common members and sizes, BSD version.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,4 +39,7 @@ typedef unsigned char sa_family_t;
#define _HAVE_SA_LEN 1 /* We have the sa_len field. */
+/* Size of struct sockaddr_storage. */
+#define _SS_SIZE 128
+
#endif /* bits/sockaddr.h */
diff --git a/sysdeps/unix/bsd/ftime.c b/sysdeps/unix/bsd/ftime.c
index 812b32c147..10011b6bae 100644
--- a/sysdeps/unix/bsd/ftime.c
+++ b/sysdeps/unix/bsd/ftime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/bsd/getpt.c b/sysdeps/unix/bsd/getpt.c
index 118fe63eeb..ea4947fb4f 100644
--- a/sysdeps/unix/bsd/getpt.c
+++ b/sysdeps/unix/bsd/getpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
diff --git a/sysdeps/unix/bsd/gtty.c b/sysdeps/unix/bsd/gtty.c
index 60a2063675..77e2a7268c 100644
--- a/sysdeps/unix/bsd/gtty.c
+++ b/sysdeps/unix/bsd/gtty.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,5 +22,5 @@
int
gtty (int fd, struct sgttyb *params)
{
- return ioctl (fd, TIOCGETP, (void *) params);
+ return __ioctl (fd, TIOCGETP, (void *) params);
}
diff --git a/sysdeps/unix/bsd/stty.c b/sysdeps/unix/bsd/stty.c
index 0ce8044533..8a0bbdef80 100644
--- a/sysdeps/unix/bsd/stty.c
+++ b/sysdeps/unix/bsd/stty.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,5 +22,5 @@
int
stty (int fd, const struct sgttyb *params)
{
- return ioctl (fd, TIOCSETP, (void *) params);
+ return __ioctl (fd, TIOCSETP, (void *) params);
}
diff --git a/sysdeps/unix/bsd/tcdrain.c b/sysdeps/unix/bsd/tcdrain.c
index 547187a0b6..6492694b64 100644
--- a/sysdeps/unix/bsd/tcdrain.c
+++ b/sysdeps/unix/bsd/tcdrain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/bsd/tcflow.c b/sysdeps/unix/bsd/tcflow.c
index e2839a3377..3eb5f61093 100644
--- a/sysdeps/unix/bsd/tcflow.c
+++ b/sysdeps/unix/bsd/tcflow.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,7 +40,7 @@ tcflow (int fd, int action)
`write'. Is there another way to do this? */
struct termios attr;
unsigned char c;
- if (tcgetattr (fd, &attr) < 0)
+ if (__tcgetattr (fd, &attr) < 0)
return -1;
c = attr.c_cc[action == TCIOFF ? VSTOP : VSTART];
if (c != _POSIX_VDISABLE && write (fd, &c, 1) < 1)
diff --git a/sysdeps/unix/bsd/tcflush.c b/sysdeps/unix/bsd/tcflush.c
index a6209bc384..d0f7b76974 100644
--- a/sysdeps/unix/bsd/tcflush.c
+++ b/sysdeps/unix/bsd/tcflush.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/bsd/tcgetattr.c b/sysdeps/unix/bsd/tcgetattr.c
index 71d67c8212..7a9acd17bd 100644
--- a/sysdeps/unix/bsd/tcgetattr.c
+++ b/sysdeps/unix/bsd/tcgetattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,4 +35,5 @@ __tcgetattr (int fd, struct termios *termios_p)
return __ioctl (fd, TIOCGETA, termios_p);
}
+libc_hidden_def (__tcgetattr)
weak_alias (__tcgetattr, tcgetattr)
diff --git a/sysdeps/unix/bsd/tcgetpgrp.c b/sysdeps/unix/bsd/tcgetpgrp.c
index b3dedce805..24d77e675b 100644
--- a/sysdeps/unix/bsd/tcgetpgrp.c
+++ b/sysdeps/unix/bsd/tcgetpgrp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/bsd/tcsendbrk.c b/sysdeps/unix/bsd/tcsendbrk.c
index 533b9d01cb..39ce08914e 100644
--- a/sysdeps/unix/bsd/tcsendbrk.c
+++ b/sysdeps/unix/bsd/tcsendbrk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/bsd/tcsetattr.c b/sysdeps/unix/bsd/tcsetattr.c
index bf5d992151..5803be4fc0 100644
--- a/sysdeps/unix/bsd/tcsetattr.c
+++ b/sysdeps/unix/bsd/tcsetattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/bsd/tcsetpgrp.c b/sysdeps/unix/bsd/tcsetpgrp.c
index 23bd42c141..10b8b60394 100644
--- a/sysdeps/unix/bsd/tcsetpgrp.c
+++ b/sysdeps/unix/bsd/tcsetpgrp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/bsd/ualarm.c b/sysdeps/unix/bsd/ualarm.c
index 92c245cd9d..3c317f6654 100644
--- a/sysdeps/unix/bsd/ualarm.c
+++ b/sysdeps/unix/bsd/ualarm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/bsd/unlockpt.c b/sysdeps/unix/bsd/unlockpt.c
index 436d8a2c0e..d771d3201e 100644
--- a/sysdeps/unix/bsd/unlockpt.c
+++ b/sysdeps/unix/bsd/unlockpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
@@ -32,5 +32,5 @@ unlockpt (int fd)
/* BSD doesn't have a lock, but it does have `revoke'. */
if (__ptsname_r (fd, buf, sizeof (buf)))
return -1;
- return revoke (buf);
+ return __revoke (buf);
}
diff --git a/sysdeps/unix/bsd/wait.c b/sysdeps/unix/bsd/wait.c
index 31de60e764..13c6cde851 100644
--- a/sysdeps/unix/bsd/wait.c
+++ b/sysdeps/unix/bsd/wait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
/* Wait for a child to die. When one does, put its status in *STAT_LOC
and return its process ID. For errors, return (pid_t) -1. */
__pid_t
-__libc_wait (__WAIT_STATUS_DEFN stat_loc)
+__libc_wait (int *stat_loc)
{
return __wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
}
diff --git a/sysdeps/unix/bsd/wait3.c b/sysdeps/unix/bsd/wait3.c
index 3f95ac7881..3c7f534a01 100644
--- a/sysdeps/unix/bsd/wait3.c
+++ b/sysdeps/unix/bsd/wait3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,7 @@
there. If the WUNTRACED bit is set in OPTIONS, return status for stopped
children; otherwise don't. */
pid_t
-__wait3 (__WAIT_STATUS stat_loc, int options, struct rusage *usage)
+__wait3 (int *stat_loc, int options, struct rusage *usage)
{
return __wait4 (WAIT_ANY, stat_loc, options, usage);
}
diff --git a/sysdeps/unix/bsd/waitpid.c b/sysdeps/unix/bsd/waitpid.c
index 083c686ad0..543b94fc9f 100644
--- a/sysdeps/unix/bsd/waitpid.c
+++ b/sysdeps/unix/bsd/waitpid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@
pid_t
__waitpid (pid_t pid, int *stat_loc, int options)
{
- return __wait4 (pid, (union wait *) stat_loc, options, NULL);
+ return __wait4 (pid, stat_loc, options, NULL);
}
libc_hidden_def (__waitpid)
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
index ffd6426dec..96df78ab1e 100644
--- a/sysdeps/unix/clock_gettime.c
+++ b/sysdeps/unix/clock_gettime.c
@@ -1,5 +1,5 @@
/* clock_gettime -- Get the current time from a POSIX clockid_t. Unix version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -79,7 +79,7 @@ static inline int
realtime_gettime (struct timespec *tp)
{
struct timeval tv;
- int retval = gettimeofday (&tv, NULL);
+ int retval = __gettimeofday (&tv, NULL);
if (retval == 0)
/* Convert into `timespec'. */
TIMEVAL_TO_TIMESPEC (&tv, tp);
@@ -103,7 +103,7 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
case CLOCK_REALTIME:
{
struct timeval tv;
- retval = gettimeofday (&tv, NULL);
+ retval = __gettimeofday (&tv, NULL);
if (retval == 0)
TIMEVAL_TO_TIMESPEC (&tv, tp);
}
diff --git a/sysdeps/unix/clock_nanosleep.c b/sysdeps/unix/clock_nanosleep.c
index ff36c81f7e..97b3d6b6ab 100644
--- a/sysdeps/unix/clock_nanosleep.c
+++ b/sysdeps/unix/clock_nanosleep.c
@@ -1,5 +1,5 @@
/* High-resolution sleep with the specified clock.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -71,7 +71,7 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
assert (sizeof (sec) >= sizeof (now.tv_sec));
/* Get the current time for this clock. */
- if (__builtin_expect (clock_gettime (clock_id, &now), 0) != 0)
+ if (__builtin_expect (__clock_gettime (clock_id, &now), 0) != 0)
return errno;
/* Compute the difference. */
@@ -96,6 +96,6 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
/* Not supported. */
return ENOTSUP;
- return __builtin_expect (nanosleep (req, rem), 0) ? errno : 0;
+ return __builtin_expect (__nanosleep (req, rem), 0) ? errno : 0;
}
weak_alias (__clock_nanosleep, clock_nanosleep)
diff --git a/sysdeps/unix/clock_settime.c b/sysdeps/unix/clock_settime.c
index a3fd267e9d..38813eddf7 100644
--- a/sysdeps/unix/clock_settime.c
+++ b/sysdeps/unix/clock_settime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,6 @@
#include <errno.h>
#include <time.h>
#include <sys/time.h>
-#include <libc-internal.h>
#include <ldsodefs.h>
@@ -90,7 +89,7 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp)
struct timeval tv; \
TIMESPEC_TO_TIMEVAL (&tv, tp); \
\
- retval = settimeofday (&tv, NULL); \
+ retval = __settimeofday (&tv, NULL); \
} while (0)
#ifdef SYSDEP_SETTIME
diff --git a/sysdeps/unix/get_child_max.c b/sysdeps/unix/get_child_max.c
index e2e8abce23..33553999c5 100644
--- a/sysdeps/unix/get_child_max.c
+++ b/sysdeps/unix/get_child_max.c
@@ -1,5 +1,5 @@
/* Get POSIX {CHILD_MAX} run-time limit value. Unix version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/getlogin.c b/sysdeps/unix/getlogin.c
index 75700d6b87..426e67d70f 100644
--- a/sysdeps/unix/getlogin.c
+++ b/sysdeps/unix/getlogin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/getlogin_r.c b/sysdeps/unix/getlogin_r.c
index a78e554860..444df7e4d3 100644
--- a/sysdeps/unix/getlogin_r.c
+++ b/sysdeps/unix/getlogin_r.c
@@ -1,5 +1,5 @@
/* Reentrant function to return the current login name. Unix version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -80,7 +80,7 @@ __getlogin_r (char *name, size_t name_len)
if (result == 0)
{
- size_t needed = strlen (ut->ut_user) + 1;
+ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
if (needed > name_len)
{
@@ -89,7 +89,8 @@ __getlogin_r (char *name, size_t name_len)
}
else
{
- memcpy (name, ut->ut_user, needed);
+ memcpy (name, ut->ut_user, needed - 1);
+ name[needed - 1] = 0;
result = 0;
}
}
diff --git a/sysdeps/unix/getpagesize.c b/sysdeps/unix/getpagesize.c
index 143492837e..7d44af087b 100644
--- a/sysdeps/unix/getpagesize.c
+++ b/sysdeps/unix/getpagesize.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/grantpt.c b/sysdeps/unix/grantpt.c
index 8bbab4afba..9d851a4e14 100644
--- a/sysdeps/unix/grantpt.c
+++ b/sysdeps/unix/grantpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
diff --git a/sysdeps/unix/i386/sysdep.S b/sysdeps/unix/i386/sysdep.S
index 1aa1b3b603..f996ce3878 100644
--- a/sysdeps/unix/i386/sysdep.S
+++ b/sysdeps/unix/i386/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/i386/sysdep.h b/sysdeps/unix/i386/sysdep.h
index 1a3959f9c6..98ba743c35 100644
--- a/sysdeps/unix/i386/sysdep.h
+++ b/sysdeps/unix/i386/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/ifreq.c b/sysdeps/unix/ifreq.c
index d23c94f923..087ff8705d 100644
--- a/sysdeps/unix/ifreq.c
+++ b/sysdeps/unix/ifreq.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>.
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
index 58d165e015..e39b2d6d52 100644
--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -12,7 +12,6 @@
#
# Syscall Signature Prefixes:
#
-# C: cancellable (i.e., this syscall is a cancellation point)
# E: errno and return value are not set by the call
# V: errno is not set, but errno or zero (success) is returned from the call
#
@@ -104,7 +103,7 @@ emit_weak_aliases()
fi
echo " echo 'versioned_symbol (libc, $source, $base, $ver)'; \\"
echo " echo '#else'; \\"
- echo " echo 'strong_alias ($strong, $base)'; \\"
+ echo " echo 'weak_alias ($strong, $base)'; \\"
echo " echo '#endif'; \\"
;;
*@*)
@@ -171,11 +170,9 @@ while read file srcfile caller syscall args strong weak; do
;;
esac
- cancellable=0
noerrno=0
errval=0
case $args in
- C*) cancellable=1; args=`echo $args | sed 's/C:\?//'`;;
E*) noerrno=1; args=`echo $args | sed 's/E:\?//'`;;
V*) errval=1; args=`echo $args | sed 's/V:\?//'`;;
esac
@@ -258,7 +255,6 @@ while read file srcfile caller syscall args strong weak; do
(echo '#define SYSCALL_NAME $syscall'; \\
echo '#define SYSCALL_NARGS $nargs'; \\
echo '#define SYSCALL_SYMBOL $strong'; \\
- echo '#define SYSCALL_CANCELLABLE $cancellable'; \\
echo '#define SYSCALL_NOERRNO $noerrno'; \\
echo '#define SYSCALL_ERRVAL $errval'; \\
echo '#include <syscall-template.S>'; \\"
@@ -284,15 +280,14 @@ while read file srcfile caller syscall args strong weak; do
\$(foreach p,\$(sysd-rules-targets),\$(objpfx)\$(patsubst %,\$p,$file).os): \\
\$(..)sysdeps/unix/make-syscalls.sh
\$(make-target-directory)
- (echo '#include <dl-vdso.h>'; \\
- echo 'extern void *${strong}_ifunc (void) __asm ("${strong}");'; \\
- echo 'void *'; \\
- echo '${strong}_ifunc (void)'; \\
- echo '{'; \\
- echo ' PREPARE_VERSION_KNOWN (symver, ${vdso_symver});'; \\
- echo ' return _dl_vdso_vsym ("${vdso_symbol}", &symver);'; \\
- echo '}'; \\
- echo 'asm (".type ${strong}, %gnu_indirect_function");'; \\
+ (echo '#define ${strong} __redirect_${strong}'; \\
+ echo '#include <dl-vdso.h>'; \\
+ echo '#undef ${strong}'; \\
+ echo '#define vdso_ifunc_init() \\'; \\
+ echo ' PREPARE_VERSION_KNOWN (symver, ${vdso_symver})'; \\
+ echo '__ifunc (__redirect_${strong}, ${strong},'; \\
+ echo ' _dl_vdso_vsym ("${vdso_symbol}", &symver), void,'; \\
+ echo ' vdso_ifunc_init)'; \\
EOF
# This is doing "hidden_def (${strong})", but the compiler
# doesn't know that we've defined ${strong} in the same file, so
diff --git a/sysdeps/unix/mips/mips32/sysdep.h b/sysdeps/unix/mips/mips32/sysdep.h
index fe937232ac..825d007489 100644
--- a/sysdeps/unix/mips/mips32/sysdep.h
+++ b/sysdeps/unix/mips/mips32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
diff --git a/sysdeps/unix/mips/mips64/n32/sysdep.h b/sysdeps/unix/mips/mips64/n32/sysdep.h
index e8fe3523f6..78c1eca872 100644
--- a/sysdeps/unix/mips/mips64/n32/sysdep.h
+++ b/sysdeps/unix/mips/mips64/n32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Alexandre Oliva <aoliva@redhat.com>.
diff --git a/sysdeps/unix/mips/mips64/n64/sysdep.h b/sysdeps/unix/mips/mips64/n64/sysdep.h
index 341f9a0dcc..a559917e64 100644
--- a/sysdeps/unix/mips/mips64/n64/sysdep.h
+++ b/sysdeps/unix/mips/mips64/n64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Alexandre Oliva <aoliva@redhat.com>.
diff --git a/sysdeps/unix/mips/pipe.S b/sysdeps/unix/mips/pipe.S
index 58a587eedb..6902a063df 100644
--- a/sysdeps/unix/mips/pipe.S
+++ b/sysdeps/unix/mips/pipe.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
diff --git a/sysdeps/unix/mips/sysdep.S b/sysdeps/unix/mips/sysdep.S
index e6f49164de..702d99e707 100644
--- a/sysdeps/unix/mips/sysdep.S
+++ b/sysdeps/unix/mips/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
diff --git a/sysdeps/unix/mips/sysdep.h b/sysdeps/unix/mips/sysdep.h
index f23e745b25..f3018a7779 100644
--- a/sysdeps/unix/mips/sysdep.h
+++ b/sysdeps/unix/mips/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
diff --git a/sysdeps/unix/powerpc/sysdep.h b/sysdeps/unix/powerpc/sysdep.h
index f719a2c44e..284062e956 100644
--- a/sysdeps/unix/powerpc/sysdep.h
+++ b/sysdeps/unix/powerpc/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/pt-fcntl.c b/sysdeps/unix/pt-fcntl.c
new file mode 100644
index 0000000000..3d64054dd0
--- /dev/null
+++ b/sysdeps/unix/pt-fcntl.c
@@ -0,0 +1,49 @@
+/* ABI compatibility for 'fcntl' symbol in libpthread ABI.
+ Copyright (C) 2018 Free Software 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 <stdarg.h>
+#include <shlib-compat.h>
+
+/* libpthread once had its own fcntl, though there was no apparent reason
+ for it. There is no use in having a separate symbol in libpthread, but
+ the historical ABI requires it. For static linking, there is no need to
+ provide anything here--the libc version will be linked in. For shared
+ library ABI compatibility, there must be __fcntl and fcntl symbols in
+ libpthread.so. */
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_28)
+
+static int
+fcntl_compat (int fd, int cmd, ...)
+{
+ void *arg;
+ va_list ap;
+ va_start (ap, cmd);
+ arg = va_arg (ap, void *);
+ va_end (ap);
+ return __libc_fcntl64 (fd, cmd, arg);
+}
+
+weak_alias (fcntl_compat, fcntl_alias)
+compat_symbol (libpthread, fcntl_alias, fcntl, GLIBC_2_0);
+
+weak_alias (fcntl_compat, __fcntl_alias)
+compat_symbol (libpthread, __fcntl_alias, __fcntl, GLIBC_2_0);
+
+#endif
diff --git a/sysdeps/unix/sh/sysdep.S b/sysdeps/unix/sh/sysdep.S
index 034a0bdc75..ea723c51cb 100644
--- a/sysdeps/unix/sh/sysdep.S
+++ b/sysdeps/unix/sh/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sh/sysdep.h b/sysdeps/unix/sh/sysdep.h
index f83f4c40f7..376ecbd769 100644
--- a/sysdeps/unix/sh/sysdep.h
+++ b/sysdeps/unix/sh/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sockatmark.c b/sysdeps/unix/sockatmark.c
index 9e3359d2ec..a87a4920b3 100644
--- a/sysdeps/unix/sockatmark.c
+++ b/sysdeps/unix/sockatmark.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/stime.c b/sysdeps/unix/stime.c
index 17f372bb2b..bbdeb3c6f2 100644
--- a/sysdeps/unix/stime.c
+++ b/sysdeps/unix/stime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/syscall-template.S b/sysdeps/unix/syscall-template.S
index f3e3c6d92b..89060bf3ee 100644
--- a/sysdeps/unix/syscall-template.S
+++ b/sysdeps/unix/syscall-template.S
@@ -1,5 +1,5 @@
/* Assembly code template for system call stubs.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software 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,9 +17,8 @@
<http://www.gnu.org/licenses/>. */
/* The real guts of this work are in the macros defined in the
- machine- and kernel-specific sysdep.h header file. When we
- are defining a cancellable system call, the sysdep-cancel.h
- versions of those macros are what we really use.
+ machine- and kernel-specific sysdep.h header file. Cancellable syscalls
+ should be implemented using C implementation with SYSCALL_CANCEL macro.
Each system call's object is built by a rule in sysd-syscalls
generated by make-syscalls.sh that #include's this file after
@@ -27,7 +26,6 @@
SYSCALL_NAME syscall name
SYSCALL_NARGS number of arguments this call takes
SYSCALL_SYMBOL primary symbol name
- SYSCALL_CANCELLABLE 1 if the call is a cancelation point
SYSCALL_NOERRNO 1 to define a no-errno version (see below)
SYSCALL_ERRVAL 1 to define an error-value version (see below)
@@ -41,11 +39,7 @@
instructions long and the untrained eye might not distinguish them from
some compiled code that inexplicably lacks source line information. */
-#if SYSCALL_CANCELLABLE
-# include <sysdep-cancel.h>
-#else
-# include <sysdep.h>
-#endif
+#include <sysdep.h>
/* This indirection is needed so that SYMBOL gets macro-expanded. */
#define syscall_hidden_def(SYMBOL) hidden_def (SYMBOL)
diff --git a/sysdeps/unix/syscall.S b/sysdeps/unix/syscall.S
index 23e9be1ad1..6d82a63e6d 100644
--- a/sysdeps/unix/syscall.S
+++ b/sysdeps/unix/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list
index 2254c761b4..61e5360b4d 100644
--- a/sysdeps/unix/syscalls.list
+++ b/sysdeps/unix/syscalls.list
@@ -19,7 +19,6 @@ fchmod - fchmod i:ii __fchmod fchmod
fchown - fchown i:iii __fchown fchown
fcntl - fcntl Ci:iiF __libc_fcntl __fcntl fcntl
fstatfs - fstatfs i:ip __fstatfs fstatfs
-fsync - fsync Ci:i __libc_fsync fsync
ftruncate - ftruncate i:ii __ftruncate ftruncate
getdomain - getdomainname i:si getdomainname
getgid - getgid Ei: __getgid getgid
@@ -45,7 +44,6 @@ madvise - madvise i:pii __madvise madvise
mkdir - mkdir i:si __mkdir mkdir
mmap - mmap b:aniiii __mmap mmap
mprotect - mprotect i:aii __mprotect mprotect
-msync - msync Ci:aii __libc_msync msync
munmap - munmap i:ai __munmap munmap
open - open Ci:siv __libc_open __open open
profil - profil i:piii __profil profil
diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h
index 94a2ce0e37..29c39618c2 100644
--- a/sysdeps/unix/sysdep.h
+++ b/sysdeps/unix/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,42 +24,95 @@
#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 = INLINE_SYSCALL_CALL (__VA_ARGS__); \
+ LIBC_CANCEL_RESET (sc_cancel_oldtype); \
+ } \
+ sc_ret; \
+ })
+
+/* Issue a syscall defined by syscall number plus any other argument
+ required. Any error will be returned unmodified (including errno). */
+#define INTERNAL_SYSCALL_CANCEL(...) \
+ ({ \
+ long int sc_ret; \
+ if (SINGLE_THREAD_P) \
+ sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); \
else \
{ \
int sc_cancel_oldtype = LIBC_CANCEL_ASYNC (); \
- sc_ret = __SYSCALL_CALL (__VA_ARGS__); \
+ sc_ret = INTERNAL_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 9999600633..f71cc39c7e 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -14,105 +14,90 @@ endif
ifeq ($(subdir),misc)
include $(firstword $(wildcard $(sysdirs:=/sysctl.mk)))
-sysdep_routines += clone llseek umount umount2 readahead \
- setfsuid setfsgid makedev epoll_pwait signalfd \
+sysdep_routines += clone umount umount2 readahead \
+ setfsuid setfsgid epoll_pwait signalfd \
eventfd eventfd_read eventfd_write prlimit \
- personality
+ personality epoll_wait tee vmsplice splice \
+ open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get
CFLAGS-gethostid.c = -fexceptions
-CFLAGS-tst-writev.c += "-DARTIFICIAL_LIMIT=0x80000000-__getpagesize()"
-
-# Note that bits/mman-linux.h is listed here though the file lives in the
-# top-level bits/ subdirectory instead of here in sysdeps/.../linux/bits/.
-# That is just so that other (non-Linux) configurations for whom the
-# bits/mman-linux.h definitions work well do not have to duplicate the
-# contents of the file. The file must still be listed in sysdep_headers
-# here and in any non-Linux configuration that uses it; other
-# configurations will not install the file.
+CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-vmsplice.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-splice.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-open_by_handle_at.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sync_file_range.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-tst-writev.c += "-DARTIFICIAL_LIMIT=(0x80000000-sysconf(_SC_PAGESIZE))"
+
sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
sys/klog.h \
sys/user.h sys/prctl.h \
sys/kd.h sys/soundcard.h sys/vt.h \
sys/quota.h sys/fsuid.h \
scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
- sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \
+ sys/raw.h sys/personality.h sys/epoll.h \
bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
sys/timerfd.h sys/fanotify.h bits/eventfd.h bits/inotify.h \
bits/signalfd.h bits/timerfd.h bits/epoll.h \
bits/socket_type.h bits/syscall.h bits/sysctl.h \
- bits/mman-linux.h
-
-tests += tst-clone tst-fanotify tst-personality
-
-# Generate the list of SYS_* macros for the system calls (__NR_* macros).
-
-# If there is more than one syscall list for different architecture
-# variants, the CPU/Makefile defines abi-variants to be a list of names
-# for those variants (e.g. 32 64), and, for each variant, defines
-# abi-$(variant)-options to be compiler options to cause <asm/unistd.h>
-# to define the desired list of syscalls and abi-$(variant)-condition to
-# be the condition for those options to use in a C #if condition.
-# abi-includes may be defined to a list of headers to include
-# in the generated header, if the default does not suffice.
-#
-# The generated header is compiled with `-ffreestanding' to avoid any
-# circular dependencies against the installed implementation headers.
-# Such a dependency would require the implementation header to be
-# installed before the generated header could be built (See bug 15711).
-# In current practice the generated header dependencies do not include
-# any of the implementation headers removed by the use of `-ffreestanding'.
-
-$(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/syscall.h
+ bits/mman-linux.h bits/mman-shared.h bits/ptrace-shared.h \
+ bits/siginfo-arch.h bits/siginfo-consts-arch.h
+
+tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
+ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
+ test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
+ tst-rlimit-infinity tst-ofdlocks
+tests-internal += tst-ofdlocks-compat
+
+
+# Generate the list of SYS_* macros for the system calls (__NR_*
+# macros). The file syscall-names.list contains all possible system
+# call names, and the generated header file produces SYS_* macros for
+# the __NR_* macros which are actually defined.
+
+generated += bits/syscall.h
+$(objpfx)bits/syscall.h: \
+ ../sysdeps/unix/sysv/linux/gen-syscall-h.awk \
+ ../sysdeps/unix/sysv/linux/syscall-names.list
$(make-target-directory)
- { \
- echo '/* Generated at libc build time from kernel syscall list. */';\
- echo ''; \
- echo '#ifndef _SYSCALL_H'; \
- echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \
- echo '#endif'; \
- echo ''; \
- $(foreach h,$(abi-includes), echo '#include <$(h)>';) \
- echo ''; \
- $(if $(abi-variants), \
- $(foreach v,$(abi-variants),\
- $(CC) -ffreestanding -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
- -x c $(sysincludes) $< $(abi-$(v)-options) \
- -D_LIBC -dM | \
- sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
- LC_ALL=C sort > $(@:.d=.h).new$(v); \
- $(if $(abi-$(v)-condition),\
- echo '#if $(abi-$(v)-condition)';) \
- cat $(@:.d=.h).new$(v); \
- $(if $(abi-$(v)-condition),echo '#endif';) \
- rm -f $(@:.d=.h).new$(v); \
- ), \
- $(CC) -ffreestanding -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
- -x c $(sysincludes) $< \
- -D_LIBC -dM | \
- sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
- LC_ALL=C sort;) \
- } > $(@:.d=.h).new
- mv -f $(@:.d=.h).new $(@:.d=.h)
-ifdef abi-variants
-ifneq (,$(objpfx))
- sed $(sed-remove-objpfx) \
- $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v)) > $(@:.h=.d)-t3
-else
- cat $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v)) \
- > $(@:.h=.d)-t3
-endif
- rm -f $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v))
- mv -f $(@:.h=.d)-t3 $(@:.h=.d)
-else
- mv -f $(@:.h=.d)-t $(@:.h=.d)
-endif
-
-ifndef no_deps
-# Get the generated list of dependencies (probably /usr/include/asm/unistd.h).
--include $(objpfx)bits/syscall.d
-endif
-generated += bits/syscall.h bits/syscall.d
-endif
+ LC_ALL=C $(AWK) -f $^ > $@-tmp
+ $(move-if-change) $@-tmp $@
+before-compile += $(objpfx)bits/syscall.h
+
+# All macros defined by <sys/syscall.h>. Include <bits/syscall.h>
+# explicitly because <sys/sycall.h> skips it if _LIBC is defined.
+$(objpfx)tst-syscall-list-macros.list: \
+ $(objpfx)bits/syscall.h ../sysdeps/unix/sysv/linux/sys/syscall.h
+ printf '#include <linux/version.h>\n\
+#include <sys/syscall.h>\n#include <bits/syscall.h>\n' | \
+ $(CC) -E -o $@-tmp $(CFLAGS) $(CPPFLAGS) -x c - -dM
+ $(move-if-change) $@-tmp $@
+
+# __NR_* system call names. Used by the test below.
+$(objpfx)tst-syscall-list-nr.list: \
+ ../sysdeps/unix/sysv/linux/filter-nr-syscalls.awk \
+ $(objpfx)tst-syscall-list-macros.list
+ LC_ALL=C $(AWK) -f $^ > $@-tmp
+ $(move-if-change) $@-tmp $@
+
+# SYS_* system call names. Used by the test below.
+$(objpfx)tst-syscall-list-sys.list: $(objpfx)tst-syscall-list-macros.list
+ LC_ALL=C $(AWK) '/^#define SYS_/ { print substr($$2, 5) }' $< > $@-tmp
+ $(move-if-change) $@-tmp $@
+
+tests-special += $(objpfx)tst-syscall-list.out
+$(objpfx)tst-syscall-list.out: \
+ ../sysdeps/unix/sysv/linux/tst-syscall-list.sh \
+ $(objpfx)tst-syscall-list-macros.list \
+ $(objpfx)tst-syscall-list-nr.list \
+ $(objpfx)tst-syscall-list-sys.list
+ $(BASH) $^ $(AWK) > $@; $(evaluate-test)
+
+# Separate object file for access to the constant from the UAPI header.
+$(objpfx)tst-sysconf-iov_max: $(objpfx)tst-sysconf-iov_max-uapi.o
+
+$(objpfx)tst-pkey: $(shared-thread-library)
+
+endif # $(subdir) == misc
ifeq ($(subdir),time)
sysdep_headers += sys/timex.h bits/timex.h
@@ -120,11 +105,27 @@ sysdep_headers += sys/timex.h bits/timex.h
sysdep_routines += ntp_gettime ntp_gettimex
endif
+ifeq ($(subdir),signal)
+tests-special += $(objpfx)tst-signal-numbers.out
+# Depending on signal.o* is a hack. What we actually want is a dependency
+# on signal.h and everything it includes. That's impractical to write
+# in this context, but signal.c includes signal.h and not much else so it'll
+# be conservatively correct.
+$(objpfx)tst-signal-numbers.out: \
+ ../sysdeps/unix/sysv/linux/tst-signal-numbers.sh \
+ $(objpfx)signal.o*
+ AWK=$(AWK) $(SHELL) ../sysdeps/unix/sysv/linux/tst-signal-numbers.sh \
+ $(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS)) \
+ < /dev/null > $@; $(evaluate-test)
+endif
+
ifeq ($(subdir),socket)
sysdep_headers += net/if_ppp.h net/ppp-comp.h \
net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
net/if_slip.h net/if_packet.h net/if_shaper.h
sysdep_routines += cmsg_nxthdr
+CFLAGS-recvmmsg.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sendmmsg.c = -fexceptions -fasynchronous-unwind-tables
endif
ifeq ($(subdir),sunrpc)
@@ -138,7 +139,7 @@ endif
ifeq ($(subdir),posix)
sysdep_headers += bits/initspin.h
-sysdep_routines += sched_getcpu
+sysdep_routines += sched_getcpu oldglob
tests += tst-affinity tst-affinity-pid
@@ -168,8 +169,15 @@ endif
ifeq ($(subdir),io)
sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
- sync_file_range fallocate fallocate64
+ sync_file_range fallocate fallocate64 \
+ close_nocancel fcntl_nocancel nanosleep_nocancel \
+ open_nocancel open64_nocancel \
+ openat_nocancel openat64_nocancel \
+ pause_nocancel read_nocancel waitpid_nocancel write_nocancel
+
sysdep_headers += bits/fcntl-linux.h
+
+tests += tst-fallocate tst-fallocate64
endif
ifeq ($(subdir),elf)
@@ -189,12 +197,13 @@ CFLAGS-mq_receive.c += -fexceptions
endif
ifeq ($(subdir),nscd)
-sysdep-CFLAGS += -DHAVE_EPOLL -DHAVE_SENDFILE -DHAVE_INOTIFY -DHAVE_NETLINK
+sysdep-CFLAGS += -DHAVE_EPOLL -DHAVE_INOTIFY -DHAVE_NETLINK
CFLAGS-gai.c += -DNEED_NETLINK
endif
ifeq ($(subdir),nptl)
-tests += tst-setgetname tst-align-clone tst-getpid1 tst-getpid2 \
+tests += tst-align-clone tst-getpid1 \
tst-thread-affinity-pthread tst-thread-affinity-pthread2 \
tst-thread-affinity-sched
+tests-internal += tst-setgetname
endif
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 202ffccc29..336c13b57d 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -166,9 +166,18 @@ libc {
GLIBC_2.15 {
process_vm_readv; process_vm_writev;
}
+ GLIBC_2.27 {
+ memfd_create;
+ mlock2;
+ pkey_alloc; pkey_free; pkey_set; pkey_get; pkey_mprotect;
+ }
GLIBC_PRIVATE {
# functions used in other libraries
__syscall_rt_sigqueueinfo;
+ __open_nocancel;
+ __read_nocancel;
+ __close_nocancel;
+ __sigtimedwait;
# functions used by nscd
__netlink_assert_response;
}
diff --git a/sysdeps/unix/sysv/linux/_G_config.h b/sysdeps/unix/sysv/linux/_G_config.h
index abec245606..0413716481 100644
--- a/sysdeps/unix/sysv/linux/_G_config.h
+++ b/sysdeps/unix/sysv/linux/_G_config.h
@@ -1,58 +1,15 @@
-/* This file is needed by libio to define various configuration parameters.
- These are always the same in the GNU C library. */
+/* Configuration parameters for stdio - Linux version. */
-#ifndef _G_config_h
-#define _G_config_h 1
-
-/* Define types for libio in terms of the standard internal type names. */
-
-#include <bits/types.h>
-#define __need_size_t
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-# define __need_wchar_t
-#endif
-#define __need_NULL
-#include <stddef.h>
-#define __need_mbstate_t
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-# define __need_wint_t
-#endif
-#include <wchar.h>
-typedef struct
-{
- __off_t __pos;
- __mbstate_t __state;
-} _G_fpos_t;
-typedef struct
-{
- __off64_t __pos;
- __mbstate_t __state;
-} _G_fpos64_t;
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-# include <gconv.h>
-typedef union
-{
- struct __gconv_info __cd;
- struct
- {
- struct __gconv_info __cd;
- struct __gconv_step_data __data;
- } __combined;
-} _G_iconv_t;
-#endif
-
-
-/* These library features are always available in the GNU C library. */
-#define _G_va_list __gnuc_va_list
+#ifndef __G_CONFIG_H
+#define __G_CONFIG_H 1
+/* Define to 1 if the operating system supports mmap, 0 otherwise.
+ This function is required by POSIX but might still be unavailable,
+ for instance when the hardware lacks support for virtual memory. */
#define _G_HAVE_MMAP 1
-#define _G_HAVE_MREMAP 1
-
-#define _G_IO_IO_FILE_VERSION 0x20001
-/* This is defined by <bits/stat.h> if `st_blksize' exists. */
-#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
-
-#define _G_BUFSIZ 8192
+/* Define to 1 if the operating system supports mremap, 0 otherwise.
+ This function is currently a Linux-specific extension. */
+#define _G_HAVE_MREMAP 1
-#endif /* _G_config.h */
+#endif /* bits/_G_config.h */
diff --git a/sysdeps/unix/sysv/linux/_exit.c b/sysdeps/unix/sysv/linux/_exit.c
index 7da0fd5112..7b68bd9730 100644
--- a/sysdeps/unix/sysv/linux/_exit.c
+++ b/sysdeps/unix/sysv/linux/_exit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/aarch64/Makefile b/sysdeps/unix/sysv/linux/aarch64/Makefile
index 6b4e620896..57bbfeaac6 100644
--- a/sysdeps/unix/sysv/linux/aarch64/Makefile
+++ b/sysdeps/unix/sysv/linux/aarch64/Makefile
@@ -28,8 +28,5 @@ ifeq (,$(filter $(default-abi),$(abi-variants)))
Unknown ABI, must be one of $(abi-variants)
endif
-abi-lp64-options := -U__AARCH64EB__
abi-lp64-condition := !defined __AARCH64EB__
-
-abi-lp64_be-options := -D__AARCH64EB__
abi-lp64_be-condition := defined __AARCH64EB__
diff --git a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
index 9b2ed3e8d0..92fc0191a5 100644
--- a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
+++ b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/aarch64/arch-fork.h b/sysdeps/unix/sysv/linux/aarch64/arch-fork.h
deleted file mode 100644
index f3d99002fa..0000000000
--- a/sysdeps/unix/sysv/linux/aarch64/arch-fork.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. AArch64 version.
- Copyright (C) 2005-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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 5, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
- NULL, NULL, NULL, &THREAD_SELF->tid)
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h b/sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h
index 658f696ef9..e09ff4125c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for the AArch64 Linux ABI.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -25,11 +25,17 @@
#define __O_NOFOLLOW 0100000
#define __O_DIRECT 0200000
-#define __O_LARGEFILE 0
+#ifdef __ILP32__
+# define __O_LARGEFILE 0400000
+#else
+# define __O_LARGEFILE 0
+#endif
+#ifdef __LP64__
# define F_GETLK64 5
# define F_SETLK64 6
# define F_SETLKW64 7
+#endif
struct flock
{
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
new file mode 100644
index 0000000000..083791349c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h
@@ -0,0 +1,51 @@
+/* Defines for bits in AT_HWCAP. AArch64 Linux version.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+#if !defined (_SYS_AUXV_H)
+# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
+#endif
+
+/* The following must match the kernel's <asm/hwcap.h>. */
+#define HWCAP_FP (1 << 0)
+#define HWCAP_ASIMD (1 << 1)
+#define HWCAP_EVTSTRM (1 << 2)
+#define HWCAP_AES (1 << 3)
+#define HWCAP_PMULL (1 << 4)
+#define HWCAP_SHA1 (1 << 5)
+#define HWCAP_SHA2 (1 << 6)
+#define HWCAP_CRC32 (1 << 7)
+#define HWCAP_ATOMICS (1 << 8)
+#define HWCAP_FPHP (1 << 9)
+#define HWCAP_ASIMDHP (1 << 10)
+#define HWCAP_CPUID (1 << 11)
+#define HWCAP_ASIMDRDM (1 << 12)
+#define HWCAP_JSCVT (1 << 13)
+#define HWCAP_FCMA (1 << 14)
+#define HWCAP_LRCPC (1 << 15)
+#define HWCAP_DCPOP (1 << 16)
+#define HWCAP_SHA3 (1 << 17)
+#define HWCAP_SM3 (1 << 18)
+#define HWCAP_SM4 (1 << 19)
+#define HWCAP_ASIMDDP (1 << 20)
+#define HWCAP_SHA512 (1 << 21)
+#define HWCAP_SVE (1 << 22)
+#define HWCAP_ASIMDFHM (1 << 23)
+#define HWCAP_DIT (1 << 24)
+#define HWCAP_USCAT (1 << 25)
+#define HWCAP_ILRCPC (1 << 26)
+#define HWCAP_FLAGM (1 << 27)
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/ipc.h b/sysdeps/unix/sysv/linux/aarch64/bits/ipc.h
index bc94471638..d66cf4412d 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/local_lim.h b/sysdeps/unix/sysv/linux/aarch64/bits/local_lim.h
index 8f2cc721cb..37aab9a24d 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/local_lim.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Linux version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/mman.h b/sysdeps/unix/sysv/linux/aarch64/bits/mman.h
index 7453e03be9..577566044d 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/mman.h
@@ -1,6 +1,6 @@
/* Definitions for POSIX memory map interface. Linux/AArch64 version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -36,6 +36,10 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_SYNC 0x80000 /* Perform synchronous page
+ faults for the mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h b/sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
index 5b09b7c8c3..712f3dafd4 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
@@ -1,5 +1,5 @@
/* sigstack, sigaltstack definitions.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,39 +16,17 @@
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
-
-/* Structure describing a signal stack (obsolete). */
-struct sigstack
- {
- void *ss_sp; /* Signal stack pointer. */
- int ss_onstack; /* Nonzero if executing on this stack. */
- };
-
-
-/* Possible values for `ss_flags.'. */
-enum
-{
- SS_ONSTACK = 1,
-#define SS_ONSTACK SS_ONSTACK
- SS_DISABLE
-#define SS_DISABLE SS_DISABLE
-};
-
/* Minimum stack size for a signal handler. */
#define MINSIGSTKSZ 5120
/* 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/clone.S b/sysdeps/unix/sysv/linux/aarch64/clone.S
index 596fb9cc77..e065304825 100644
--- a/sysdeps/unix/sysv/linux/aarch64/clone.S
+++ b/sysdeps/unix/sysv/linux/aarch64/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -23,12 +23,6 @@
#define _ERRNO_H 1
#include <bits/errno.h>
-#define CLONE_VM_BIT 8
-#define CLONE_VM (1 << CLONE_VM_BIT)
-
-#define CLONE_THREAD_BIT 16
-#define CLONE_THREAD (1 << CLONE_THREAD_BIT)
-
/* int clone(int (*fn)(void *arg), x0
void *child_stack, x1
int flags, x2
@@ -39,6 +33,13 @@
*/
.text
ENTRY(__clone)
+ DELOUSE (0)
+ DELOUSE (1)
+ DELOUSE (2)
+ DELOUSE (3)
+ DELOUSE (4)
+ DELOUSE (5)
+ DELOUSE (6)
/* Save args for the child. */
mov x10, x0
mov x11, x2
@@ -72,25 +73,15 @@ thread_start:
cfi_undefined (x30)
mov x29, 0
- tbnz x11, #CLONE_THREAD_BIT, 3f
- mov x0, #-1
- tbnz x11, #CLONE_VM_BIT, 2f
- mov x8, #SYS_ify(getpid)
- svc 0x0
-2:
- mrs x1, tpidr_el0
- sub x1, x1, #PTHREAD_SIZEOF
- str w0, [x1, #PTHREAD_PID_OFFSET]
- str w0, [x1, #PTHREAD_TID_OFFSET]
-3:
-
/* Pick the function arg and execute. */
mov x0, x12
blr x10
/* We are done, pass the return value through x0. */
- b HIDDEN_JUMPTARGET(_exit)
+ mov x8, #SYS_ify(exit)
+ svc 0x0
cfi_endproc
.size thread_start, .-thread_start
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/aarch64/configure b/sysdeps/unix/sysv/linux/aarch64/configure
index f48472c5b6..27d50e1d3c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/configure
+++ b/sysdeps/unix/sysv/linux/aarch64/configure
@@ -6,8 +6,8 @@ arch_minimum_kernel=3.7.0
test -n "$libc_cv_slibdir" ||
case "$prefix" in
/usr | /usr/)
- libc_cv_slibdir=/lib64
- libc_cv_rtlddir=/lib
+ libc_cv_slibdir='/lib64'
+ libc_cv_rtlddir='/lib'
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
# Locale data can be shared between 32-bit and 64-bit libraries.
diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
new file mode 100644
index 0000000000..39eba0186f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
@@ -0,0 +1,83 @@
+/* Initialize CPU feature data. AArch64 version.
+ This file is part of the GNU C Library.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <cpu-features.h>
+#include <sys/auxv.h>
+#include <elf/dl-hwcaps.h>
+
+#define DCZID_DZP_MASK (1 << 4)
+#define DCZID_BS_MASK (0xf)
+
+#if HAVE_TUNABLES
+struct cpu_list
+{
+ const char *name;
+ uint64_t midr;
+};
+
+static struct cpu_list cpu_list[] = {
+ {"falkor", 0x510FC000},
+ {"thunderxt88", 0x430F0A10},
+ {"thunderx2t99", 0x431F0AF0},
+ {"thunderx2t99p1", 0x420F5160},
+ {"phecda", 0x680F0000},
+ {"generic", 0x0}
+};
+
+static uint64_t
+get_midr_from_mcpu (const char *mcpu)
+{
+ for (int i = 0; i < sizeof (cpu_list) / sizeof (struct cpu_list); i++)
+ if (strcmp (mcpu, cpu_list[i].name) == 0)
+ return cpu_list[i].midr;
+
+ return UINT64_MAX;
+}
+#endif
+
+static inline void
+init_cpu_features (struct cpu_features *cpu_features)
+{
+ register uint64_t midr = UINT64_MAX;
+
+#if HAVE_TUNABLES
+ /* Get the tunable override. */
+ const char *mcpu = TUNABLE_GET (glibc, tune, cpu, const char *, NULL);
+ if (mcpu != NULL)
+ midr = get_midr_from_mcpu (mcpu);
+#endif
+
+ /* If there was no useful tunable override, query the MIDR if the kernel
+ allows it. */
+ if (midr == UINT64_MAX)
+ {
+ if (GLRO (dl_hwcap) & HWCAP_CPUID)
+ asm volatile ("mrs %0, midr_el1" : "=r"(midr));
+ else
+ midr = 0;
+ }
+
+ cpu_features->midr_el1 = midr;
+
+ /* Check if ZVA is enabled. */
+ unsigned dczid;
+ asm volatile ("mrs %0, dczid_el0" : "=r"(dczid));
+
+ if ((dczid & DCZID_DZP_MASK) == 0)
+ cpu_features->zva_size = 4 << (dczid & DCZID_BS_MASK);
+}
diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
new file mode 100644
index 0000000000..eb35adfbe9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
@@ -0,0 +1,61 @@
+/* Initialize CPU feature data. AArch64 version.
+ This file is part of the GNU C Library.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 _CPU_FEATURES_AARCH64_H
+#define _CPU_FEATURES_AARCH64_H
+
+#include <stdint.h>
+
+#define MIDR_PARTNUM_SHIFT 4
+#define MIDR_PARTNUM_MASK (0xfff << MIDR_PARTNUM_SHIFT)
+#define MIDR_PARTNUM(midr) \
+ (((midr) & MIDR_PARTNUM_MASK) >> MIDR_PARTNUM_SHIFT)
+#define MIDR_ARCHITECTURE_SHIFT 16
+#define MIDR_ARCHITECTURE_MASK (0xf << MIDR_ARCHITECTURE_SHIFT)
+#define MIDR_ARCHITECTURE(midr) \
+ (((midr) & MIDR_ARCHITECTURE_MASK) >> MIDR_ARCHITECTURE_SHIFT)
+#define MIDR_VARIANT_SHIFT 20
+#define MIDR_VARIANT_MASK (0xf << MIDR_VARIANT_SHIFT)
+#define MIDR_VARIANT(midr) \
+ (((midr) & MIDR_VARIANT_MASK) >> MIDR_VARIANT_SHIFT)
+#define MIDR_IMPLEMENTOR_SHIFT 24
+#define MIDR_IMPLEMENTOR_MASK (0xff << MIDR_IMPLEMENTOR_SHIFT)
+#define MIDR_IMPLEMENTOR(midr) \
+ (((midr) & MIDR_IMPLEMENTOR_MASK) >> MIDR_IMPLEMENTOR_SHIFT)
+
+#define IS_THUNDERX(midr) (MIDR_IMPLEMENTOR(midr) == 'C' \
+ && MIDR_PARTNUM(midr) == 0x0a1)
+
+#define IS_THUNDERX2PA(midr) (MIDR_IMPLEMENTOR(midr) == 'B' \
+ && MIDR_PARTNUM(midr) == 0x516)
+#define IS_THUNDERX2(midr) (MIDR_IMPLEMENTOR(midr) == 'C' \
+ && MIDR_PARTNUM(midr) == 0xaf)
+
+#define IS_FALKOR(midr) (MIDR_IMPLEMENTOR(midr) == 'Q' \
+ && MIDR_PARTNUM(midr) == 0xc00)
+
+#define IS_PHECDA(midr) (MIDR_IMPLEMENTOR(midr) == 'h' \
+ && MIDR_PARTNUM(midr) == 0x000)
+
+struct cpu_features
+{
+ uint64_t midr_el1;
+ unsigned zva_size;
+};
+
+#endif /* _CPU_FEATURES_AARCH64_H */
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
index 9c7b271e85..54b64893cc 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,11 @@
#include <ldconfig.h>
-#define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6)
+#ifdef __LP64__
+# define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6)
+#else
+# define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB32 | FLAG_ELF_LIBC6)
+#endif
#define _dl_cache_check_flags(flags) \
((flags) == _DL_CACHE_DEFAULT_ID)
@@ -27,18 +31,25 @@
do \
{ \
size_t len = strlen (dir); \
- char path[len + 3]; \
+ char path[len + 6]; \
memcpy (path, dir, len + 1); \
if (len >= 6 && ! memcmp (path + len - 6, "/lib64", 6)) \
{ \
len -= 2; \
path[len] = '\0'; \
} \
+ if (len >= 9 && ! memcmp (path + len - 9, "/libilp32", 9))\
+ { \
+ len -= 5; \
+ path[len] = '\0'; \
+ } \
add_dir (path); \
if (len >= 4 && ! memcmp (path + len - 4, "/lib", 4)) \
{ \
memcpy (path + len, "64", 3); \
add_dir (path); \
+ memcpy (path + len, "ilp32", 6); \
+ add_dir (path); \
} \
} while (0)
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c
new file mode 100644
index 0000000000..2ac06351cb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c
@@ -0,0 +1,81 @@
+/* Data for AArch64 version of processor capability information.
+ Linux version.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* If anything should be added here check whether the size of each string
+ is still ok with the given array size.
+
+ All the #ifdefs in the definitions are quite irritating but
+ necessary if we want to avoid duplicating the information. There
+ are three different modes:
+
+ - PROCINFO_DECL is defined. This means we are only interested in
+ declarations.
+
+ - PROCINFO_DECL is not defined:
+
+ + if SHARED is defined the file is included in an array
+ initializer. The .element = { ... } syntax is needed.
+
+ + if SHARED is not defined a normal array initialization is
+ needed.
+ */
+
+#ifndef PROCINFO_CLASS
+# define PROCINFO_CLASS
+#endif
+
+#if !IS_IN (ldconfig)
+# if !defined PROCINFO_DECL && defined SHARED
+ ._dl_aarch64_cpu_features
+# else
+PROCINFO_CLASS struct cpu_features _dl_aarch64_cpu_features
+# endif
+# ifndef PROCINFO_DECL
+= { }
+# endif
+# if !defined SHARED || defined PROCINFO_DECL
+;
+# else
+,
+# endif
+#endif
+
+/* Number of HWCAP bits set. */
+#define _DL_HWCAP_COUNT 28
+
+#if !defined PROCINFO_DECL && defined SHARED
+ ._dl_aarch64_cap_flags
+#else
+PROCINFO_CLASS const char _dl_aarch64_cap_flags[_DL_HWCAP_COUNT][10]
+#endif
+#ifndef PROCINFO_DECL
+/* Matches the names in arch/arm64/kernel/cpuinfo.c of Linux. */
+= { "fp", "asimd", "evtstrm", "aes", "pmull", "sha1", "sha2", "crc32",
+ "atomics", "fphp", "asimdhp", "cpuid", "asimdrdm", "jscvt", "fcma",
+ "lrcpc", "dcpop", "sha3", "sm3", "sm4", "asimddp", "sha512", "sve",
+ "asimdfhm", "dit", "uscat", "ilrcpc", "flagm" }
+#endif
+#if !defined SHARED || defined PROCINFO_DECL
+;
+#else
+,
+#endif
+
+#undef PROCINFO_DECL
+#undef PROCINFO_CLASS
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
new file mode 100644
index 0000000000..f746f52c8d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
@@ -0,0 +1,57 @@
+/* Processor capability information handling macros - aarch64 version.
+ Copyright (C) 2017-2018 Free Software 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 _DL_PROCINFO_H
+#define _DL_PROCINFO_H 1
+
+#include <sys/auxv.h>
+#include <unistd.h>
+#include <ldsodefs.h>
+#include <sysdep.h>
+
+/* We cannot provide a general printing function. */
+#define _dl_procinfo(type, word) -1
+
+/* No additional library search paths. */
+#define HWCAP_IMPORTANT HWCAP_ATOMICS
+
+static inline const char *
+__attribute__ ((unused))
+_dl_hwcap_string (int idx)
+{
+ return (unsigned)idx < _DL_HWCAP_COUNT ? GLRO(dl_aarch64_cap_flags)[idx] : "";
+};
+
+static inline int
+__attribute__ ((unused))
+_dl_string_hwcap (const char *str)
+{
+ for (int i = 0; i < _DL_HWCAP_COUNT; i++)
+ {
+ if (strcmp (str, _dl_hwcap_string (i)) == 0)
+ return i;
+ }
+ return -1;
+};
+
+/* There're no platforms to filter out. */
+#define _DL_HWCAP_PLATFORM 0
+
+#define _dl_string_platform(str) (-1)
+
+#endif /* dl-procinfo.h */
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-static.c b/sysdeps/unix/sysv/linux/aarch64/dl-static.c
index 39b20b3a57..13694b2a9e 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-static.c
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-static.c
@@ -1,5 +1,5 @@
/* Variable initialization. AArch64 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/aarch64/getcontext.S b/sysdeps/unix/sysv/linux/aarch64/getcontext.S
index c2dd5b8f93..479e8bf3b4 100644
--- a/sysdeps/unix/sysv/linux/aarch64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/aarch64/getcontext.S
@@ -1,6 +1,6 @@
/* Save current context.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -30,6 +30,7 @@
.text
ENTRY(__getcontext)
+ DELOUSE (0)
/* The saved context will return to the getcontext() call point
with a return value of 0 */
str xzr, [x0, oX0 + 0 * SZREG]
@@ -90,7 +91,7 @@ ENTRY(__getcontext)
/* Grab the signal mask */
/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
- add x2, x0, #UCONTEXT_SIGMASK
+ add PTR_REG (2), PTR_REG (0), #UCONTEXT_SIGMASK
mov x0, SIG_BLOCK
mov x1, 0
mov x3, _NSIG8
diff --git a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
new file mode 100644
index 0000000000..8ff83e4e7d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2018 Free Software 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/>. */
+
+/* Get the current time of day and timezone information,
+ putting it into *tv and *tz. If tz is null, *tz is not filled.
+ Returns 0 on success, -1 on errors. */
+
+#ifdef SHARED
+
+# define __gettimeofday __redirect___gettimeofday
+# include <sys/time.h>
+# undef __gettimeofday
+# define HAVE_VSYSCALL
+# include <dl-vdso.h>
+# include <sysdep-vdso.h>
+
+/* Used as a fallback in the ifunc resolver if VDSO is not available
+ and for libc.so internal __gettimeofday calls. */
+
+static int
+__gettimeofday_vsyscall (struct timeval *tv, struct timezone *tz)
+{
+ return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
+}
+
+/* PREPARE_VERSION will need an __LP64__ ifdef when ILP32 support
+ goes in. See _libc_vdso_platform_setup in
+ sysdeps/unix/sysv/linux/aarch64/init-first.c. */
+
+# undef INIT_ARCH
+# define INIT_ARCH() \
+ PREPARE_VERSION (linux_version, "LINUX_2.6.39", 123718537); \
+ void *vdso_gettimeofday = \
+ _dl_vdso_vsym ("__kernel_gettimeofday", &linux_version);
+
+libc_ifunc_hidden (__redirect___gettimeofday, __gettimeofday,
+ vdso_gettimeofday ?: (void *) __gettimeofday_vsyscall)
+
+__hidden_ver1 (__gettimeofday_vsyscall, __GI___gettimeofday,
+ __gettimeofday_vsyscall);
+
+#else
+
+# include <sys/time.h>
+# include <sysdep.h>
+int
+__gettimeofday (struct timeval *tv, struct timezone *tz)
+{
+ return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
+}
+libc_hidden_def (__gettimeofday)
+
+#endif
+
+weak_alias (__gettimeofday, gettimeofday)
+libc_hidden_weak (gettimeofday)
diff --git a/sysdeps/unix/sysv/linux/aarch64/init-first.c b/sysdeps/unix/sysv/linux/aarch64/init-first.c
index f7224a25a2..4c1895a1b9 100644
--- a/sysdeps/unix/sysv/linux/aarch64/init-first.c
+++ b/sysdeps/unix/sysv/linux/aarch64/init-first.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -27,17 +27,21 @@ int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);
static inline void
_libc_vdso_platform_setup (void)
{
- PREPARE_VERSION (linux2639, "LINUX_2.6.39", 123718537);
+#ifdef __LP64__
+ PREPARE_VERSION (linux_version, "LINUX_2.6.39", 123718537);
+#else
+ PREPARE_VERSION (linux_version, "LINUX_4.9", 61765625);
+#endif
- void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2639);
+ void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux_version);
PTR_MANGLE (p);
VDSO_SYMBOL(gettimeofday) = p;
- p = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2639);
+ p = _dl_vdso_vsym ("__kernel_clock_gettime", &linux_version);
PTR_MANGLE (p);
VDSO_SYMBOL(clock_gettime) = p;
- p = _dl_vdso_vsym ("__kernel_clock_getres", &linux2639);
+ p = _dl_vdso_vsym ("__kernel_clock_getres", &linux_version);
PTR_MANGLE (p);
VDSO_SYMBOL(clock_getres) = p;
}
diff --git a/sysdeps/unix/sysv/linux/aarch64/ioctl.S b/sysdeps/unix/sysv/linux/aarch64/ioctl.S
index eddd613590..e53e5d7710 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ioctl.S
+++ b/sysdeps/unix/sysv/linux/aarch64/ioctl.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -28,4 +28,5 @@ ENTRY(__ioctl)
ret
PSEUDO_END (__ioctl)
+libc_hidden_def (__ioctl)
weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/aarch64/ipc_priv.h b/sysdeps/unix/sysv/linux/aarch64/ipc_priv.h
new file mode 100644
index 0000000000..db527f3fbb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ipc_priv.h
@@ -0,0 +1,21 @@
+/* Old SysV permission definition for Linux. AArch64 version.
+ Copyright (C) 2016-2018 Free Software 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/ipc.h> /* For __key_t */
+
+#define __IPC_64 0x0
diff --git a/sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h
new file mode 100644
index 0000000000..608a7ad1f7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 312
+#define SIGJMP_BUF_SIZE 312
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 176
+#define SAVED_MASK_OFFSET 184
diff --git a/sysdeps/unix/sysv/linux/aarch64/kernel-features.h b/sysdeps/unix/sysv/linux/aarch64/kernel-features.h
index 556ba733aa..9cfa51471c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/aarch64/kernel-features.h
@@ -1,8 +1,6 @@
/* Set flags signalling availability of kernel features based on given
- kernel version number.
-
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
-
+ kernel version number. AArch64 version.
+ Copyright (C) 2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,13 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <linux/version.h>
-
-/* AArch64 support starts with 3.7.0, guaranteeing many kernel
- features. */
-
-#define __ASSUME_ACCEPT4_SYSCALL 1
-#define __ASSUME_RECVMMSG_SYSCALL 1
-#define __ASSUME_SENDMMSG_SYSCALL 1
-
#include_next <kernel-features.h>
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
diff --git a/sysdeps/unix/sysv/linux/aarch64/kernel_rt_sigframe.h b/sysdeps/unix/sysv/linux/aarch64/kernel_rt_sigframe.h
index 78749fb84a..599786f7b9 100644
--- a/sysdeps/unix/sysv/linux/aarch64/kernel_rt_sigframe.h
+++ b/sysdeps/unix/sysv/linux/aarch64/kernel_rt_sigframe.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -21,5 +21,5 @@
struct kernel_rt_sigframe
{
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
};
diff --git a/sysdeps/unix/sysv/linux/aarch64/ld.abilist b/sysdeps/unix/sysv/linux/aarch64/ld.abilist
index ab08a9845f..4ffe688649 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
-GLIBC_2.17 __libc_memalign F
GLIBC_2.17 __libc_stack_end D 0x8
GLIBC_2.17 __stack_chk_guard D 0x8
GLIBC_2.17 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
index ee91ef82af..5cbc2ca38f 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -21,6 +21,8 @@
#define SYSDEP_KNOWN_INTERPRETER_NAMES \
{ "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \
{ "/lib/ld-linux-aarch64_be.so.1", FLAG_ELF_LIBC6 }, \
+ { "/lib/ld-linux-aarch64_ilp32.so.1", FLAG_ELF_LIBC6 }, \
+ { "/lib/ld-linux-aarch64_be_ilp32.so.1", FLAG_ELF_LIBC6 }, \
{ "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
{ "/lib/ld-linux-armhf.so.3", FLAG_ELF_LIBC6 },
#define SYSDEP_KNOWN_LIBRARY_NAMES \
diff --git a/sysdeps/unix/sysv/linux/aarch64/ldsodefs.h b/sysdeps/unix/sysv/linux/aarch64/ldsodefs.h
index 4392b527e1..ff88292cec 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/aarch64/ldsodefs.h
@@ -1,5 +1,6 @@
-/* Run-time dynamic linker data structures for loaded ELF shared objects. Tile.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ AArch64 version.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/aarch64/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/aarch64/libBrokenLocale.abilist
index 5e54974368..0829ddef6d 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libanl.abilist b/sysdeps/unix/sysv/linux/aarch64/libanl.abilist
index 21330fc8d5..9492cd5290 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 gai_cancel F
GLIBC_2.17 gai_error F
GLIBC_2.17 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc-__read_tp.S b/sysdeps/unix/sysv/linux/aarch64/libc-__read_tp.S
index 39033ed01b..6f95d29f92 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc-__read_tp.S
+++ b/sysdeps/unix/sysv/linux/aarch64/libc-__read_tp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc-start.c b/sysdeps/unix/sysv/linux/aarch64/libc-start.c
new file mode 100644
index 0000000000..dd17deaea5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/libc-start.c
@@ -0,0 +1,28 @@
+/* Override csu/libc-start.c on AArch64.
+ Copyright (C) 2017-2018 Free Software 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 SHARED
+# include <ldsodefs.h>
+# include <cpu-features.c>
+
+extern struct cpu_features _dl_aarch64_cpu_features;
+
+# define ARCH_INIT_CPU_FEATURES() init_cpu_features (&_dl_aarch64_cpu_features)
+
+#endif
+#include <csu/libc-start.c>
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc-vdso.h b/sysdeps/unix/sysv/linux/aarch64/libc-vdso.h
index 5ec10df5fc..65b2228662 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/aarch64/libc-vdso.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 5799239a00..15f966f841 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 _Exit F
GLIBC_2.17 _IO_2_1_stderr_ D 0xe0
GLIBC_2.17 _IO_2_1_stdin_ D 0xe0
@@ -2076,14 +2075,66 @@ GLIBC_2.17 xdrstdio_create F
GLIBC_2.17 xencrypt F
GLIBC_2.17 xprt_register F
GLIBC_2.17 xprt_unregister F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
GLIBC_2.18 _mcount F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf128 F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof128 F
+GLIBC_2.27 strtof128_l F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof128 F
+GLIBC_2.27 wcstof128_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libcrypt.abilist b/sysdeps/unix/sysv/linux/aarch64/libcrypt.abilist
index 58944b3d83..4082747aa3 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 crypt F
GLIBC_2.17 crypt_r F
GLIBC_2.17 encrypt F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libdl.abilist b/sysdeps/unix/sysv/linux/aarch64/libdl.abilist
index 1b4b1f77ed..36340d5dd8 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libdl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 dladdr F
GLIBC_2.17 dladdr1 F
GLIBC_2.17 dlclose F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libm.abilist b/sysdeps/unix/sysv/linux/aarch64/libm.abilist
index 2123113e25..37e99a91bc 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 _LIB_VERSION D 0x4
GLIBC_2.17 __acos_finite F
GLIBC_2.17 __acosf_finite F
@@ -394,12 +393,642 @@ GLIBC_2.17 y1l F
GLIBC_2.17 yn F
GLIBC_2.17 ynf F
GLIBC_2.17 ynl F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl 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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf128 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf128 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf128 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f128 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf128 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf128 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf128 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf128 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf128 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef128 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf128 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf128 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf128 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf128 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf128 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf128 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf128 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf128 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf128 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf128 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf128 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f128 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf128 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf128 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf128 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf128 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf128 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf128 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf128 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf128 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf128 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf128 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf128 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf128 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf128 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf128 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff128 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f128 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f128 F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf128 F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f128 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf128 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf128 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf128 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf128 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf128 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf128 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf128 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf128 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf128 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf128 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf128 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf128 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf128 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf128 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf128 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f128 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f128 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf128 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf128 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf128 F
+GLIBC_2.27 lgammaf128_r F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf128 F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf128 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf128 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f128 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf128 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f128 F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf128 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf128 F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf128 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf128 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff128 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf128 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf128 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf128 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf128 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf128 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf128 F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf128 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof128 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf128 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf128 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf128 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf128 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf128 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf128 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf128 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf128 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf128 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf128 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf128 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf128 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf128 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf128 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf128 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf128 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf128 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf128 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf128 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f128 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f128 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf128 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libnsl.abilist b/sysdeps/unix/sysv/linux/aarch64/libnsl.abilist
index 63d47aef79..eae8dbe341 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __free_fdresult F
GLIBC_2.17 __nis_default_access F
GLIBC_2.17 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
index 0cf30ee02f..9a9e4cee85 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 _IO_flockfile F
GLIBC_2.17 _IO_ftrylockfile F
GLIBC_2.17 _IO_funlockfile F
@@ -221,6 +220,26 @@ GLIBC_2.17 vfork F
GLIBC_2.17 wait F
GLIBC_2.17 waitpid F
GLIBC_2.17 write F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libresolv.abilist b/sysdeps/unix/sysv/linux/aarch64/libresolv.abilist
index cf278eedb3..f7fdd26bd1 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __b64_ntop F
GLIBC_2.17 __b64_pton F
GLIBC_2.17 __dn_comp F
diff --git a/sysdeps/unix/sysv/linux/aarch64/librt.abilist b/sysdeps/unix/sysv/linux/aarch64/librt.abilist
index 523d22249a..5e81c82a25 100644
--- a/sysdeps/unix/sysv/linux/aarch64/librt.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __mq_open_2 F
GLIBC_2.17 aio_cancel F
GLIBC_2.17 aio_cancel64 F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libthread_db.abilist b/sysdeps/unix/sysv/linux/aarch64/libthread_db.abilist
index 3e382bf79d..3b84229ebc 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 td_init F
GLIBC_2.17 td_log F
GLIBC_2.17 td_symbol_list F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libutil.abilist b/sysdeps/unix/sysv/linux/aarch64/libutil.abilist
index 9c075bc0bd..99889de22e 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 forkpty F
GLIBC_2.17 login F
GLIBC_2.17 login_tty F
diff --git a/sysdeps/unix/sysv/linux/aarch64/localplt.data b/sysdeps/unix/sysv/linux/aarch64/localplt.data
index d7d673454f..a60053b914 100644
--- a/sysdeps/unix/sysv/linux/aarch64/localplt.data
+++ b/sysdeps/unix/sysv/linux/aarch64/localplt.data
@@ -7,12 +7,16 @@ libc.so: malloc
libc.so: memalign
libc.so: realloc
libm.so: matherr
-# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
-# internally to allocate aligned TLS storage. The other malloc family of
-# functions are expected to allow user symbol interposition.
+# The dynamic loader needs __tls_get_addr for TLS.
ld.so: __tls_get_addr
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/aarch64/makecontext.c b/sysdeps/unix/sysv/linux/aarch64/makecontext.c
index 34f91a3ebe..112adc21fe 100644
--- a/sysdeps/unix/sysv/linux/aarch64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/aarch64/makecontext.c
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -42,18 +42,18 @@ void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
extern void __startcontext (void);
- unsigned long int *sp;
+ uint64_t *sp;
va_list ap;
int i;
- sp = (unsigned long int *)
+ sp = (uint64_t *)
((uintptr_t) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
/* Allocate stack arguments. */
sp -= argc < 8 ? 0 : argc - 8;
/* Keep the stack aligned. */
- sp = (unsigned long int *) (((uintptr_t) sp) & -16L);
+ sp = (uint64_t *) (((uintptr_t) sp) & -16L);
ucp->uc_mcontext.regs[19] = (uintptr_t) ucp->uc_link;
ucp->uc_mcontext.sp = (uintptr_t) sp;
@@ -64,9 +64,9 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
va_start (ap, argc);
for (i = 0; i < argc; ++i)
if (i < 8)
- ucp->uc_mcontext.regs[i] = va_arg (ap, unsigned long int);
+ ucp->uc_mcontext.regs[i] = va_arg (ap, uint64_t);
else
- sp[i - 8] = va_arg (ap, unsigned long int);
+ sp[i - 8] = va_arg (ap, uint64_t);
va_end (ap);
}
diff --git a/sysdeps/unix/sysv/linux/aarch64/mmap.c b/sysdeps/unix/sysv/linux/aarch64/mmap.c
deleted file mode 100644
index 013338172f..0000000000
--- a/sysdeps/unix/sysv/linux/aarch64/mmap.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 2009-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/types.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <sys/syscall.h>
-#include <sysdep.h>
-#include <unistd.h>
-
-__ptr_t
-__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
-{
- return (__ptr_t) INLINE_SYSCALL (mmap, 6, addr, len, prot, flags, fd, offset);
-}
-
-weak_alias (__mmap, mmap)
-weak_alias (__mmap, mmap64)
-weak_alias (__mmap, __mmap64)
diff --git a/sysdeps/unix/sysv/linux/aarch64/profil-counter.h b/sysdeps/unix/sysv/linux/aarch64/profil-counter.h
index 3bec0d8860..67e6211e2f 100644
--- a/sysdeps/unix/sysv/linux/aarch64/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/aarch64/profil-counter.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/aarch64/pt-vfork.c b/sysdeps/unix/sysv/linux/aarch64/pt-vfork.c
index e035e11214..2b277f25ec 100644
--- a/sysdeps/unix/sysv/linux/aarch64/pt-vfork.c
+++ b/sysdeps/unix/sysv/linux/aarch64/pt-vfork.c
@@ -1,5 +1,5 @@
/* vfork ABI-compatibility entry points for libpthread.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/aarch64/readelflib.c b/sysdeps/unix/sysv/linux/aarch64/readelflib.c
index 6019b9aa1c..81b575101f 100644
--- a/sysdeps/unix/sysv/linux/aarch64/readelflib.c
+++ b/sysdeps/unix/sysv/linux/aarch64/readelflib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/aarch64/setcontext.S b/sysdeps/unix/sysv/linux/aarch64/setcontext.S
index d17f8c8b7a..604ed19f61 100644
--- a/sysdeps/unix/sysv/linux/aarch64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/aarch64/setcontext.S
@@ -1,6 +1,6 @@
/* Set current context.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -34,6 +34,7 @@
.text
ENTRY (__setcontext)
+ DELOUSE (0)
/* Save a copy of UCP. */
mov x9, x0
diff --git a/sysdeps/unix/sysv/linux/aarch64/sigaction.c b/sysdeps/unix/sysv/linux/aarch64/sigaction.c
index 3291924896..fef195eefb 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sigaction.c
+++ b/sysdeps/unix/sysv/linux/aarch64/sigaction.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-
+/* Copyright (C) 1997-2018 Free Software 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,55 +15,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
-#include <string.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
+/* Required for AArch32 compatibility. */
#define SA_RESTORER 0x04000000
-/* The difference here is that the sigaction structure used in the
- kernel is not the same as we use in the libc. Therefore we must
- translate it here. */
-#include <kernel_sigaction.h>
-
-int
-__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
-{
- int result;
- struct kernel_sigaction kact;
- struct kernel_sigaction koact;
-
- if (act)
- {
- kact.k_sa_handler = act->sa_handler;
- memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
- kact.sa_flags = act->sa_flags;
-#ifdef HAVE_SA_RESTORER
- if (kact.sa_flags & SA_RESTORER)
- kact.sa_restorer = act->sa_restorer;
-#endif
- }
+#define SET_SA_RESTORER(kact, act) \
+ ({ \
+ if ((kact)->sa_flags & SA_RESTORER) \
+ (kact)->sa_restorer = (act)->sa_restorer; \
+ })
- result = INLINE_SYSCALL (rt_sigaction, 4, sig,
- act ? &kact : NULL,
- oact ? &koact : NULL, _NSIG / 8);
- if (result >= 0 || errno != ENOSYS)
- {
- if (oact && result >= 0)
- {
- oact->sa_handler = koact.k_sa_handler;
- memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
- oact->sa_flags = koact.sa_flags;
-#ifdef HAVE_SA_RESTORER
- oact->sa_restorer = koact.sa_restorer;
-#endif
- }
- }
- return result;
-}
-libc_hidden_def (__libc_sigaction)
+#define RESET_SA_RESTORER(act, kact) \
+ (act)->sa_restorer = (kact)->sa_restorer;
-#include <nptl/sigaction.c>
+#include <sysdeps/unix/sysv/linux/sigaction.c>
diff --git a/sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h b/sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h
index a579501186..04596eff9c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h
@@ -1,5 +1,5 @@
/* AArch64 definitions for signal handling calling conventions.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,10 +16,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <stdint.h>
#include <sys/ucontext.h>
-#define SIGCONTEXT siginfo_t *_si, struct ucontext *
-#define GET_PC(ctx) ((void *) (ctx)->uc_mcontext.pc)
+#define SIGCONTEXT siginfo_t *_si, ucontext_t *
+#define GET_PC(ctx) ((void *) (uintptr_t) (ctx)->uc_mcontext.pc)
/* There is no reliable way to get the sigcontext unless we use a
three-argument signal handler. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S
index c1a16f3899..3f57a519ed 100644
--- a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S
@@ -1,6 +1,6 @@
/* Modify saved context.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -27,6 +27,7 @@
.text
ENTRY(__swapcontext)
+ DELOUSE (0)
/* Set the value returned when swapcontext() returns in this context. */
str xzr, [x0, oX0 + 0 * SZREG]
diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/elf.h b/sysdeps/unix/sysv/linux/aarch64/sys/elf.h
index 7a2b01bfd2..1e87fd9665 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sys/elf.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sys/elf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h b/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h
index 7e408c3f89..d48ba39551 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -36,7 +36,7 @@
__BEGIN_DECLS
/* Type for a general-purpose register. */
-typedef unsigned long elf_greg_t;
+typedef __uint64_t elf_greg_t;
/* And the whole bunch of them. We could have used `struct
pt_regs' directly in the typedef, but tradition says that
diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
index 506ecceee3..93e373c3ad 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
@@ -1,5 +1,5 @@
-/* `ptrace' debugger support interface. Linux version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* `ptrace' debugger support interface. Linux/AArch64 version.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -66,7 +66,7 @@ enum __ptrace_request
PTRACE_KILL = 8,
#define PT_KILL PTRACE_KILL
- /* Single step the process. */
+ /* Single step the process. */
PTRACE_SINGLESTEP = 9,
#define PT_STEP PTRACE_SINGLESTEP
@@ -78,18 +78,10 @@ enum __ptrace_request
PTRACE_DETACH = 17,
#define PT_DETACH PTRACE_DETACH
- PTRACE_GET_THREAD_AREA = 22,
-
- /* Continue and stop at the next (return from) syscall. */
+ /* Continue and stop at the next entry to or return from syscall. */
PTRACE_SYSCALL = 24,
#define PT_SYSCALL PTRACE_SYSCALL
- /* Get all hardware breakpoint registers. */
- PTRACE_GETHBPREGS = 29,
-
- /* Set all hardware breakpoint registers. */
- PTRACE_SETHBPREGS = 30,
-
/* Set ptrace filter options. */
PTRACE_SETOPTIONS = 0x4200,
#define PT_SETOPTIONS PTRACE_SETOPTIONS
@@ -119,7 +111,7 @@ enum __ptrace_request
PTRACE_SEIZE = 0x4206,
#define PTRACE_SEIZE PTRACE_SEIZE
- /* Trap seized trace. */
+ /* Trap seized tracee. */
PTRACE_INTERRUPT = 0x4207,
#define PTRACE_INTERRUPT PTRACE_INTERRUPT
@@ -127,78 +119,29 @@ enum __ptrace_request
PTRACE_LISTEN = 0x4208,
#define PTRACE_LISTEN PTRACE_LISTEN
+ /* Retrieve siginfo_t structures without removing signals from a queue. */
PTRACE_PEEKSIGINFO = 0x4209,
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+ /* Get the mask of blocked signals. */
PTRACE_GETSIGMASK = 0x420a,
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
+ /* Change the mask of blocked signals. */
PTRACE_SETSIGMASK = 0x420b,
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
- PTRACE_SECCOMP_GET_FILTER = 0x420c
+ /* Get seccomp BPF filters. */
+ PTRACE_SECCOMP_GET_FILTER = 0x420c,
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
-};
-
-
-/* Flag for PTRACE_LISTEN. */
-enum __ptrace_flags
-{
- PTRACE_SEIZE_DEVEL = 0x80000000
-};
-
-/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions
-{
- PTRACE_O_TRACESYSGOOD = 0x00000001,
- PTRACE_O_TRACEFORK = 0x00000002,
- PTRACE_O_TRACEVFORK = 0x00000004,
- PTRACE_O_TRACECLONE = 0x00000008,
- PTRACE_O_TRACEEXEC = 0x00000010,
- PTRACE_O_TRACEVFORKDONE = 0x00000020,
- PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_EXITKILL = 0x00100000,
- PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
- PTRACE_O_MASK = 0x003000ff
-};
-
-/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes
-{
- PTRACE_EVENT_FORK = 1,
- PTRACE_EVENT_VFORK = 2,
- PTRACE_EVENT_CLONE = 3,
- PTRACE_EVENT_EXEC = 4,
- PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6,
- PTRACE_EVENT_SECCOMP = 7
-};
-/* Arguments for PTRACE_PEEKSIGINFO. */
-struct __ptrace_peeksiginfo_args
-{
- __uint64_t off; /* From which siginfo to start. */
- __uint32_t flags; /* Flags for peeksiginfo. */
- __int32_t nr; /* How many siginfos to take. */
-};
-
-enum __ptrace_peeksiginfo_flags
-{
- /* Read signals from a shared (process wide) queue. */
- PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
+ /* Get seccomp BPF filter metadata. */
+ PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
};
-/* Perform process tracing functions. REQUEST is one of the values
- above, and determines the action to be taken.
- For all requests except PTRACE_TRACEME, PID specifies the process to be
- traced.
- PID and the other arguments described above for the various requests should
- appear (those that are used for the particular request) as:
- pid_t PID, void *ADDR, int DATA, void *ADDR2
- after REQUEST. */
-extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+#include <bits/ptrace-shared.h>
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h b/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
index 01da3ca858..f1b3ab59e2 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -22,12 +22,19 @@
#define _SYS_UCONTEXT_H 1
#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>. */
-#include <bits/sigcontext.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
+#ifdef __USE_MISC
+# include <sys/procfs.h>
+
typedef elf_greg_t greg_t;
@@ -36,21 +43,36 @@ typedef elf_gregset_t gregset_t;
/* Structure to describe FPU registers. */
typedef elf_fpregset_t fpregset_t;
+#endif
/* Context to describe whole processor state. This only describes
the core registers; coprocessor registers get saved elsewhere
(e.g. in uc_regspace, or somewhere unspecified on the stack
during non-RT signal handlers). */
-typedef struct sigcontext mcontext_t;
+typedef struct
+ {
+ unsigned long long int __ctx(fault_address);
+ unsigned long long int __ctx(regs)[31];
+ unsigned long long int __ctx(sp);
+ unsigned long long int __ctx(pc);
+ unsigned long long int __ctx(pstate);
+ /* This field contains extension records for additional processor
+ state such as the FP/SIMD state. It has to match the definition
+ of the corresponding field in the sigcontext struct, see the
+ arch/arm64/include/uapi/asm/sigcontext.h linux header for details. */
+ unsigned char __reserved[4096] __attribute__ ((__aligned__ (16)));
+ } mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long uc_flags;
- struct ucontext *uc_link;
+ unsigned long __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
- __sigset_t uc_sigmask;
+ sigset_t uc_sigmask;
mcontext_t uc_mcontext;
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/user.h b/sysdeps/unix/sysv/linux/aarch64/sys/user.h
index f6fc361e81..14993c9c85 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sys/user.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/aarch64/syscall.S b/sysdeps/unix/sysv/linux/aarch64/syscall.S
index 98c1b42ee9..c5c5e2416f 100644
--- a/sysdeps/unix/sysv/linux/aarch64/syscall.S
+++ b/sysdeps/unix/sysv/linux/aarch64/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysconf.c b/sysdeps/unix/sysv/linux/aarch64/sysconf.c
new file mode 100644
index 0000000000..c560f45f37
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/sysconf.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2017-2018 Free Software 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 <assert.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+
+static long int linux_sysconf (int name);
+
+/* Get the value of the system variable NAME. */
+long int
+__sysconf (int name)
+{
+ unsigned ctr;
+
+ /* Unfortunately, the registers that contain the actual cache info
+ (CCSIDR_EL1, CLIDR_EL1, and CSSELR_EL1) are protected by the Linux
+ kernel (though they need not have been). However, CTR_EL0 contains
+ the *minimum* linesize in the entire cache hierarchy, and is
+ accessible to userland, for use in __aarch64_sync_cache_range,
+ and it is a reasonable assumption that the L1 cache will have that
+ minimum line size. */
+ switch (name)
+ {
+ case _SC_LEVEL1_ICACHE_LINESIZE:
+ asm("mrs\t%0, ctr_el0" : "=r"(ctr));
+ return 4 << (ctr & 0xf);
+ case _SC_LEVEL1_DCACHE_LINESIZE:
+ asm("mrs\t%0, ctr_el0" : "=r"(ctr));
+ return 4 << ((ctr >> 16) & 0xf);
+ }
+
+ return linux_sysconf (name);
+}
+
+/* Now the generic Linux version. */
+#undef __sysconf
+#define __sysconf static linux_sysconf
+#include <sysdeps/unix/sysv/linux/sysconf.c>
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
deleted file mode 100644
index f7f9e593a6..0000000000
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
+++ /dev/null
@@ -1,134 +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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .section ".text"; \
-ENTRY (__##syscall_name##_nocancel); \
-.Lpseudo_nocancel: \
- DO_CALL (syscall_name, args); \
-.Lpseudo_finish: \
- cmn x0, 4095; \
- b.cs .Lsyscall_error; \
- .subsection 2; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
-ENTRY (name); \
- SINGLE_THREAD_P(16); \
- cbz w16, .Lpseudo_nocancel; \
- /* Setup common stack frame no matter the number of args. \
- Also save the first arg, since it's basically free. */ \
- stp x30, x0, [sp, -64]!; \
- cfi_adjust_cfa_offset (64); \
- cfi_rel_offset (x30, 0); \
- DOCARGS_##args; /* save syscall args around CENABLE. */ \
- CENABLE; \
- mov x16, x0; /* save mask around syscall. */ \
- UNDOCARGS_##args; /* restore syscall args. */ \
- DO_CALL (syscall_name, args); \
- str x0, [sp, 8]; /* save result around CDISABLE. */ \
- mov x0, x16; /* restore mask for CDISABLE. */ \
- CDISABLE; \
- /* Break down the stack frame, restoring result at once. */ \
- ldp x30, x0, [sp], 64; \
- cfi_adjust_cfa_offset (-64); \
- cfi_restore (x30); \
- b .Lpseudo_finish; \
- cfi_endproc; \
- .size name, .-name; \
- .previous
-
-# undef PSEUDO_END
-# define PSEUDO_END(name) \
- SYSCALL_ERROR_HANDLER; \
- cfi_endproc
-
-# define DOCARGS_0
-# define DOCARGS_1
-# define DOCARGS_2 str x1, [sp, 16]
-# define DOCARGS_3 stp x1, x2, [sp, 16]
-# define DOCARGS_4 DOCARGS_3; str x3, [sp, 32]
-# define DOCARGS_5 DOCARGS_3; stp x3, x4, [sp, 32]
-# define DOCARGS_6 DOCARGS_5; str x5, [sp, 48]
-
-# define UNDOCARGS_0
-# define UNDOCARGS_1 ldr x0, [sp, 8]
-# define UNDOCARGS_2 ldp x0, x1, [sp, 8]
-# define UNDOCARGS_3 UNDOCARGS_1; ldp x1, x2, [sp, 16]
-# define UNDOCARGS_4 UNDOCARGS_2; ldp x2, x3, [sp, 24]
-# define UNDOCARGS_5 UNDOCARGS_3; ldp x3, x4, [sp, 32]
-# define UNDOCARGS_6 UNDOCARGS_4; ldp x4, x5, [sp, 40]
-
-# if IS_IN (libpthread)
-# define CENABLE bl __pthread_enable_asynccancel
-# define CDISABLE bl __pthread_disable_asynccancel
-# define __local_multiple_threads __pthread_multiple_threads
-# elif IS_IN (libc)
-# define CENABLE bl __libc_enable_asynccancel
-# define CDISABLE bl __libc_disable_asynccancel
-# define __local_multiple_threads __libc_multiple_threads
-# elif IS_IN (librt)
-# define CENABLE bl __librt_enable_asynccancel
-# define CDISABLE bl __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-# if IS_IN (libpthread) || IS_IN (libc)
-# ifndef __ASSEMBLER__
-extern int __local_multiple_threads attribute_hidden;
-# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
-# else
-# define SINGLE_THREAD_P(R) \
- adrp x##R, __local_multiple_threads; \
- ldr w##R, [x##R, :lo12:__local_multiple_threads]
-# endif
-# else
-/* There is no __local_multiple_threads for librt, so use the TCB. */
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P(R) \
- mrs x##R, tpidr_el0; \
- sub x##R, x##R, PTHREAD_SIZEOF; \
- ldr w##R, [x##R, PTHREAD_MULTIPLE_THREADS_OFFSET]
-# endif
-# endif
-
-#elif !defined __ASSEMBLER__
-
-/* For rtld, et cetera. */
-# define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.c b/sysdeps/unix/sysv/linux/aarch64/sysdep.c
index f2d5480329..7c3a05b5ff 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.c
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index a397e50ef6..9ac2f0702a 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -108,7 +108,7 @@
.Lsyscall_error: \
adrp x1, :gottprel:errno; \
neg w2, w0; \
- ldr x1, [x1, :gottprel_lo12:errno]; \
+ ldr PTR_REG(1), [x1, :gottprel_lo12:errno]; \
mrs x3, tpidr_el0; \
mov x0, -1; \
str w2, [x1, x3]; \
@@ -157,6 +157,12 @@
# define HAVE_CLOCK_GETTIME_VSYSCALL 1
# define HAVE_GETTIMEOFDAY_VSYSCALL 1
+/* Previously AArch64 used the generic version without the libc_hidden_def
+ which lead in a non existent __send symbol in libc.so. */
+# undef HAVE_INTERNAL_SEND_SYMBOL
+
+# define SINGLE_THREAD_BY_GLOBAL 1
+
/* Define a macro which expands into the inline wrapper code for a system
call. */
# undef INLINE_SYSCALL
@@ -250,12 +256,14 @@
(!defined SHARED && (IS_IN (libc) \
|| IS_IN (libpthread))))
# ifdef __ASSEMBLER__
+/* Note, dst, src, guard, and tmp are all register numbers rather than
+ register names so they will work with both ILP32 and LP64. */
# define PTR_MANGLE(dst, src, guard, tmp) \
LDST_PCREL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local)); \
PTR_MANGLE2 (dst, src, guard)
/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */
# define PTR_MANGLE2(dst, src, guard)\
- eor dst, src, guard
+ eor x##dst, x##src, x##guard
# define PTR_DEMANGLE(dst, src, guard, tmp)\
PTR_MANGLE (dst, src, guard, tmp)
# define PTR_DEMANGLE2(dst, src, guard)\
@@ -268,12 +276,14 @@ extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
# endif
#else
# ifdef __ASSEMBLER__
+/* Note, dst, src, guard, and tmp are all register numbers rather than
+ register names so they will work with both ILP32 and LP64. */
# define PTR_MANGLE(dst, src, guard, tmp) \
LDST_GLOBAL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard)); \
PTR_MANGLE2 (dst, src, guard)
/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */
# define PTR_MANGLE2(dst, src, guard)\
- eor dst, src, guard
+ eor x##dst, x##src, x##guard
# define PTR_DEMANGLE(dst, src, guard, tmp)\
PTR_MANGLE (dst, src, guard, tmp)
# define PTR_DEMANGLE2(dst, src, guard)\
diff --git a/sysdeps/unix/sysv/linux/aarch64/ucontext-internal.h b/sysdeps/unix/sysv/linux/aarch64/ucontext-internal.h
index a311685e36..0ecfdd7a4c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ucontext-internal.h
+++ b/sysdeps/unix/sysv/linux/aarch64/ucontext-internal.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/aarch64/vfork.S b/sysdeps/unix/sysv/linux/aarch64/vfork.S
index 577895eeb2..9986fbddf5 100644
--- a/sysdeps/unix/sysv/linux/aarch64/vfork.S
+++ b/sysdeps/unix/sysv/linux/aarch64/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -27,27 +27,10 @@
ENTRY (__vfork)
- /* Save the TCB-cached PID away in w3, and then negate the TCB
- field. But if it's zero, set it to 0x80000000 instead. See
- raise.c for the logic that relies on this value. */
- mrs x2, tpidr_el0
- sub x2, x2, #PTHREAD_SIZEOF
- ldr w3, [x2, #PTHREAD_PID_OFFSET]
- mov w1, #0x80000000
- negs w0, w3
- csel w0, w1, w0, eq
- str w0, [x2, #PTHREAD_PID_OFFSET]
-
mov x0, #0x4111 /* CLONE_VM | CLONE_VFORK | SIGCHLD */
mov x1, sp
DO_CALL (clone, 2)
- /* Restore the original value of the TCB cache of the PID, if we're
- the parent. But in the child (syscall return value equals zero),
- leave things as they are. */
- cbz x0, 1f
- str w3, [x2, #PTHREAD_PID_OFFSET]
-1:
cmn x0, #4095
b.cs .Lsyscall_error
RET
diff --git a/sysdeps/unix/sysv/linux/accept.c b/sysdeps/unix/sysv/linux/accept.c
index 428853e00a..4d8c0e3593 100644
--- a/sysdeps/unix/sysv/linux/accept.c
+++ b/sysdeps/unix/sysv/linux/accept.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software 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,21 +15,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
#include <sys/socket.h>
-
#include <sysdep-cancel.h>
#include <socketcall.h>
-#include <sys/syscall.h>
-#include <kernel-features.h>
int
__libc_accept (int fd, __SOCKADDR_ARG addr, socklen_t *len)
{
#ifdef __ASSUME_ACCEPT_SYSCALL
return SYSCALL_CANCEL (accept, fd, addr.__sockaddr__, len);
-#elif defined __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL
+#elif defined __ASSUME_ACCEPT4_SYSCALL
return SYSCALL_CANCEL (accept4, fd, addr.__sockaddr__, len, 0);
#else
return SOCKETCALL_CANCEL (accept, fd, addr.__sockaddr__, len);
diff --git a/sysdeps/unix/sysv/linux/accept4.c b/sysdeps/unix/sysv/linux/accept4.c
index 1139e41cc7..8317c6843f 100644
--- a/sysdeps/unix/sysv/linux/accept4.c
+++ b/sysdeps/unix/sysv/linux/accept4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2008.
@@ -22,75 +22,15 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
+#include <socketcall.h>
#include <kernel-features.h>
-/* Do not use the accept4 syscall on socketcall architectures unless
- it was added at the same time as the socketcall support or can be
- assumed to be present. */
-#if defined __ASSUME_SOCKETCALL \
- && !defined __ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL \
- && !defined __ASSUME_ACCEPT4_SYSCALL
-# undef __NR_accept4
-#endif
-
-#ifdef __NR_accept4
int
accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
{
+#ifdef __ASSUME_ACCEPT4_SYSCALL
return SYSCALL_CANCEL (accept4, fd, addr.__sockaddr__, addr_len, flags);
-}
-#elif defined __NR_socketcall
-# include <socketcall.h>
-# ifdef __ASSUME_ACCEPT4_SOCKETCALL
-int
-accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
-{
+#else
return SOCKETCALL_CANCEL (accept4, fd, addr.__sockaddr__, addr_len, flags);
-}
-# else
-static int have_accept4;
-
-int
-accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
-{
- if (__glibc_likely (have_accept4 >= 0))
- {
- int ret = SOCKETCALL_CANCEL (accept4, fd, addr.__sockaddr__, addr_len,
- flags);
- /* The kernel returns -EINVAL for unknown socket operations.
- We need to convert that error to an ENOSYS error. */
- if (__builtin_expect (ret < 0, 0)
- && have_accept4 == 0
- && errno == EINVAL)
- {
- /* Try another call, this time with the FLAGS parameter
- cleared and an invalid file descriptor. This call will not
- cause any harm and it will return immediately. */
- ret = SOCKETCALL_CANCEL (invalid, -1);
- if (errno == EINVAL)
- {
- have_accept4 = -1;
- __set_errno (ENOSYS);
- }
- else
- {
- have_accept4 = 1;
- __set_errno (EINVAL);
- }
- return -1;
- }
- return ret;
- }
- __set_errno (ENOSYS);
- return -1;
-}
-# endif /* __ASSUME_ACCEPT4_SOCKETCALL */
-#else /* __NR_socketcall */
-int
-accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
-{
- __set_errno (ENOSYS);
- return -1;
-}
-stub_warning (accept4)
#endif
+}
diff --git a/sysdeps/unix/sysv/linux/access.c b/sysdeps/unix/sysv/linux/access.c
new file mode 100644
index 0000000000..2da8e68f47
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/access.c
@@ -0,0 +1,32 @@
+/* Linux implementation for access function.
+ Copyright (C) 2016-2018 Free Software 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 <unistd.h>
+#include <sysdep-cancel.h>
+
+int
+__access (const char *file, int type)
+{
+#ifdef __NR_access
+ return INLINE_SYSCALL_CALL (access, file, type);
+#else
+ return INLINE_SYSCALL_CALL (faccessat, AT_FDCWD, file, type);
+#endif
+}
+weak_alias (__access, access)
diff --git a/sysdeps/unix/sysv/linux/adjtime.c b/sysdeps/unix/sysv/linux/adjtime.c
index 555d82f15f..6edecb70e8 100644
--- a/sysdeps/unix/sysv/linux/adjtime.c
+++ b/sysdeps/unix/sysv/linux/adjtime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/aio_misc.h b/sysdeps/unix/sysv/linux/aio_misc.h
index 5f6d6eab7c..0d8aa45516 100644
--- a/sysdeps/unix/sysv/linux/aio_misc.h
+++ b/sysdeps/unix/sysv/linux/aio_misc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
diff --git a/sysdeps/unix/sysv/linux/aio_sigqueue.c b/sysdeps/unix/sysv/linux/aio_sigqueue.c
index 5693f07f4b..536f2ee9f5 100644
--- a/sysdeps/unix/sysv/linux/aio_sigqueue.c
+++ b/sysdeps/unix/sysv/linux/aio_sigqueue.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,7 +30,6 @@
/* Return any pending signal or wait for one for the given time. */
int
-internal_function
__aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
{
siginfo_t info;
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index c089545e9b..50f4fb1183 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -1,7 +1,3 @@
-ifeq ($(subdir),posix)
-sysdep_routines += oldglob
-endif
-
ifeq ($(subdir),stdlib)
gen-as-const-headers += ucontext-offsets.sym
endif
@@ -10,16 +6,13 @@ 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 \
+sysdep_routines += osf_gettimeofday osf_settimeofday \
osf_getitimer osf_setitimer osf_utimes \
osf_getrusage osf_wait4
-# Support old ipc control
-sysdep_routines += oldmsgctl oldsemctl oldshmctl
-
CFLAGS-ioperm.c = -Wa,-mev6
endif
@@ -39,5 +32,11 @@ 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
+
+ifeq ($(subdir),conform)
+# For bug 21260.
+conformtest-xfail-conds += alpha-linux
endif
diff --git a/sysdeps/unix/sysv/linux/alpha/Versions b/sysdeps/unix/sysv/linux/alpha/Versions
index 29b82f999b..3b7971c2a3 100644
--- a/sysdeps/unix/sysv/linux/alpha/Versions
+++ b/sysdeps/unix/sysv/linux/alpha/Versions
@@ -85,6 +85,9 @@ libc {
#errlist-compat 140
_sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
}
+ GLIBC_2.27 {
+ getrlimit; setrlimit; getrlimit64; setrlimit64;
+ }
GLIBC_PRIVATE {
__libc_alpha_cache_shape;
}
diff --git a/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S b/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S
index 66014c6a25..de5496175b 100644
--- a/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/adjtime.c b/sysdeps/unix/sysv/linux/alpha/adjtime.c
index e3ecdc62b7..fe534d301c 100644
--- a/sysdeps/unix/sysv/linux/alpha/adjtime.c
+++ b/sysdeps/unix/sysv/linux/alpha/adjtime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/arch-fork.h b/sysdeps/unix/sysv/linux/alpha/arch-fork.h
deleted file mode 100644
index 6c476c6362..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/arch-fork.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. Alpha version.
- 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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 5, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
- NULL, NULL, &THREAD_SELF->tid, NULL)
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/dirent.h b/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
index 98d297e4a7..9dbcdaf60e 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/epoll.h b/sysdeps/unix/sysv/linux/alpha/bits/epoll.h
index 2afa414b61..026ccb06fd 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/errno.h b/sysdeps/unix/sysv/linux/alpha/bits/errno.h
index 4e332d760e..c35b4ddb1f 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/errno.h
@@ -1,5 +1,5 @@
/* Error constants. Linux/Alpha specific version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,23 +16,29 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _ERRNO_H
+#ifndef _BITS_ERRNO_H
+#define _BITS_ERRNO_H 1
+
+#if !defined _ERRNO_H
+# error "Never include <bits/errno.h> directly; use <errno.h> instead."
+#endif
-# undef EDOM
-# undef EILSEQ
-# undef ERANGE
# include <linux/errno.h>
-/* Linux has no ENOTSUP error code. */
-# define ENOTSUP EOPNOTSUPP
+/* Older Linux headers do not define these constants. */
+# ifndef ENOTSUP
+# define ENOTSUP EOPNOTSUPP
+# endif
# ifndef ECANCELED
-# define ECANCELED 131
+# define ECANCELED 131
# endif
-/* Support for error codes to support robust mutexes was added later, too. */
# ifndef EOWNERDEAD
# define EOWNERDEAD 136
+# endif
+
+# ifndef ENOTRECOVERABLE
# define ENOTRECOVERABLE 137
# endif
@@ -44,22 +50,4 @@
# define EHWPOISON 139
# endif
-# ifndef __ASSEMBLER__
-/* Function to get address of global `errno' variable. */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
-
-# if !defined _LIBC || defined _LIBC_REENTRANT
-/* When using threads, errno is a per-thread value. */
-# define errno (*__errno_location ())
-# endif
-# endif /* !__ASSEMBLER__ */
-#endif /* _ERRNO_H */
-
-#if !defined _ERRNO_H && defined __need_Emath
-/* This is ugly but the kernel header is not clean enough. We must
- define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
- defined. */
-# define EDOM 33 /* Math argument out of domain of function. */
-# define EILSEQ 116 /* Illegal byte sequence. */
-# define ERANGE 34 /* Math result not representable. */
-#endif /* !_ERRNO_H && __need_Emath */
+#endif /* bits/errno.h. */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/eventfd.h b/sysdeps/unix/sysv/linux/alpha/bits/eventfd.h
index 0f5ddfd96d..09ba5c50e3 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/eventfd.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/eventfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
index 686a9c1abf..99c6053b86 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/inotify.h b/sysdeps/unix/sysv/linux/alpha/bits/inotify.h
index 8a3debb957..92ca6f5c3c 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/inotify.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h b/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h
index 7d89acde13..876f56dee9 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/ipc.h b/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
index 41e458e683..67a3d8dd6f 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h b/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h
index 0e7af25c49..7805fa510e 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Linux/Alpha version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/mman.h b/sysdeps/unix/sysv/linux/alpha/bits/mman.h
index 3b9e9a9049..3abfd8449f 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/Alpha version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,6 +36,8 @@
# define MAP_NONBLOCK 0x40000 /* Do not block on IO. */
# define MAP_STACK 0x80000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x100000 /* Create huge page mapping. */
+# define MAP_FIXED_NOREPLACE 0x200000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Flags for `mlockall'. */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/msq.h b/sysdeps/unix/sysv/linux/alpha/bits/msq.h
index 287c0e3bfb..d15802d109 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -57,6 +57,7 @@ struct msqid_ds
/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12
+# define MSG_STAT_ANY 13
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/netdb.h b/sysdeps/unix/sysv/linux/alpha/bits/netdb.h
index 086cb64aeb..a78e805d00 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/netdb.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/netdb.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
deleted file mode 100644
index 1a1779b5d4..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/* Machine-specific pthread type layouts. Alpha version.
- 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/>. */
-
-#ifndef _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#define __SIZEOF_PTHREAD_ATTR_T 56
-#define __SIZEOF_PTHREAD_MUTEX_T 40
-#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-#define __SIZEOF_PTHREAD_COND_T 48
-#define __SIZEOF_PTHREAD_CONDATTR_T 4
-#define __SIZEOF_PTHREAD_RWLOCK_T 56
-#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-#define __SIZEOF_PTHREAD_BARRIER_T 32
-#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-
-
-/* Thread identifiers. The structure of the attribute type is
- deliberately not exposed. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-typedef struct __pthread_internal_list
-{
- struct __pthread_internal_list *__prev;
- struct __pthread_internal_list *__next;
-} __pthread_list_t;
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is deliberately not exposed. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
- unsigned int __nusers;
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
- int __spins;
- __pthread_list_t __list;
-#define __PTHREAD_MUTEX_HAVE_PREV 1
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-#define __PTHREAD_SPINS 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- int __writer;
- int __shared;
- unsigned long int __pad1;
- unsigned long int __pad2;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned int __flags;
- } __data;
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/resource.h b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
index fbc8f5a026..dddcb0f049 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
@@ -1,5 +1,5 @@
/* Bit values & structures for resource limits. Alpha/Linux version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -112,13 +112,13 @@ enum __rlimit_resource
/* Value to indicate that there is no limit. */
#ifndef __USE_FILE_OFFSET64
-# define RLIM_INFINITY ((long int)(~0UL >> 1))
+# define RLIM_INFINITY ((__rlim_t) -1)
#else
-# define RLIM_INFINITY 0x7fffffffffffffffLL
+# define RLIM_INFINITY 0xffffffffffffffffuLL
#endif
#ifdef __USE_LARGEFILE64
-# define RLIM64_INFINITY 0x7fffffffffffffffLL
+# define RLIM64_INFINITY 0xffffffffffffffffuLL
#endif
/* We can represent all limits. */
@@ -175,51 +175,8 @@ enum __rusage_who
#endif
};
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
-
-/* Structure which says how much of each resource has been used. */
-struct rusage
- {
- /* Total amount of user time used. */
- struct timeval ru_utime;
- /* Total amount of system time used. */
- struct timeval ru_stime;
- /* Maximum resident set size (in kilobytes). */
- long int ru_maxrss;
- /* Amount of sharing of text segment memory
- with other processes (kilobyte-seconds). */
- long int ru_ixrss;
- /* Amount of data segment memory used (kilobyte-seconds). */
- long int ru_idrss;
- /* Amount of stack memory used (kilobyte-seconds). */
- long int ru_isrss;
- /* Number of soft page faults (i.e. those serviced by reclaiming
- a page from the list of pages awaiting reallocation. */
- long int ru_minflt;
- /* Number of hard page faults (i.e. those that required I/O). */
- long int ru_majflt;
- /* Number of times a process was swapped out of physical memory. */
- long int ru_nswap;
- /* Number of input operations via the file system. Note: This
- and `ru_oublock' do not include operations with the cache. */
- long int ru_inblock;
- /* Number of output operations via the file system. */
- long int ru_oublock;
- /* Number of IPC messages sent. */
- long int ru_msgsnd;
- /* Number of IPC messages received. */
- long int ru_msgrcv;
- /* Number of signals delivered. */
- long int ru_nsignals;
- /* Number of voluntary context switches, i.e. because the process
- gave up the process before it had to (usually to wait for some
- resource to be available). */
- long int ru_nvcsw;
- /* Number of involuntary context switches, i.e. a higher priority process
- became runnable or the current process used up its time slice. */
- long int ru_nivcsw;
- };
+#include <bits/types/struct_timeval.h>
+#include <bits/types/struct_rusage.h>
/* Priority limits. */
#define PRIO_MIN -20 /* Minimum priority a process can have. */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/sem.h b/sysdeps/unix/sysv/linux/alpha/bits/sem.h
index ce5304af99..d218cf4f92 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,6 +66,7 @@ struct semid_ds
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
+# define SEM_STAT_ANY 20
struct seminfo
{
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/semaphore.h b/sysdeps/unix/sysv/linux/alpha/bits/semaphore.h
index b0f5b42e9e..6d8bac3137 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/semaphore.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/semaphore.h
@@ -1,5 +1,5 @@
/* Machine-specific POSIX semaphore type layouts. Alpha version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/shm.h b/sysdeps/unix/sysv/linux/alpha/bits/shm.h
index dcda365653..16cd984e52 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -65,6 +65,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h b/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
index 1d41f51931..2700a4ac12 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
@@ -1,5 +1,5 @@
/* The proper definitions for Linux/Alpha sigaction.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,6 +16,9 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGACTION_H
+#define _BITS_SIGACTION_H 1
+
#ifndef _SIGNAL_H
# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
#endif
@@ -24,7 +27,7 @@
struct sigaction
{
/* Signal handler. */
-#ifdef __USE_POSIX199309
+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
union
{
/* Used if SA_SIGINFO is not set. */
@@ -51,10 +54,10 @@ struct sigaction
#define SA_NOCLDWAIT 0x00000020 /* Don't create zombie on child death. */
#define SA_SIGINFO 0x00000040 /* Invoke signal-catching function with
three arguments instead of one. */
-#if defined __USE_UNIX98 || defined __USE_MISC
+#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
# define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
#endif
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
# define SA_RESTART 0x00000002 /* Restart syscall on signal return. */
# define SA_NODEFER 0x00000008 /* Don't automatically block the signal
when its handler is being executed. */
@@ -73,3 +76,5 @@ struct sigaction
#define SIG_BLOCK 1 /* Block signals. */
#define SIG_UNBLOCK 2 /* Unblock signals. */
#define SIG_SETMASK 3 /* Set the set of blocked signals. */
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/signalfd.h b/sysdeps/unix/sysv/linux/alpha/bits/signalfd.h
index 580ed882fb..b59588b8ee 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/signalfd.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/signalfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/signum.h b/sysdeps/unix/sysv/linux/alpha/bits/signum.h
index ee60da0914..9df647816e 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/signum.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/signum.h
@@ -1,5 +1,5 @@
/* Signal number definitions. Linux/Alpha version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,66 +16,25 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _SIGNAL_H
+#ifndef _BITS_SIGNUM_H
+#define _BITS_SIGNUM_H 1
-/* Fake signal functions. */
-#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
-#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
-#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
-
-#ifdef __USE_UNIX98
-# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+#ifndef _SIGNAL_H
+#error "Never include <bits/signum.h> directly; use <signal.h> instead."
#endif
-/*
- * Linux/AXP has different signal numbers that Linux/i386: I'm trying
- * to make it OSF/1 binary compatible, at least for normal binaries.
- */
-#define SIGHUP 1
-#define SIGINT 2
-#define SIGQUIT 3
-#define SIGILL 4
-#define SIGTRAP 5
-#define SIGABRT 6
-#define SIGEMT 7
-#define SIGFPE 8
-#define SIGKILL 9
-#define SIGBUS 10
-#define SIGSEGV 11
-#define SIGSYS 12
-#define SIGPIPE 13
-#define SIGALRM 14
-#define SIGTERM 15
-#define SIGURG 16
-#define SIGSTOP 17
-#define SIGTSTP 18
-#define SIGCONT 19
-#define SIGCHLD 20
-#define SIGCLD SIGCHLD
-#define SIGTTIN 21
-#define SIGTTOU 22
-#define SIGIO 23
-#define SIGXCPU 24
-#define SIGXFSZ 25
-#define SIGVTALRM 26
-#define SIGPROF 27
-#define SIGWINCH 28
-#define SIGINFO 29
-#define SIGUSR1 30
-#define SIGUSR2 31
-
-#define SIGPOLL SIGIO
-#define SIGPWR SIGINFO
-#define SIGIOT SIGABRT
+#include <bits/signum-generic.h>
-#define _NSIG 65 /* Biggest signal number + 1. */
+/* Adjustments and additions to the signal number constants for
+ Linux/Alpha. Signal values on this platform were chosen for OSF/1
+ binary compatibility, and are therefore almost identical to the
+ BSD-derived defaults. */
-#define SIGRTMIN (__libc_current_sigrtmin ())
-#define SIGRTMAX (__libc_current_sigrtmax ())
+#define SIGEMT 7 /* Emulator trap (4.2 BSD). */
+#define SIGINFO 29 /* Information request (BSD). */
+#define SIGPWR SIGINFO /* Power failure imminent (System V). */
-/* These are the hard limits of the kernel. These values should not be
- used directly at user level. */
-#define __SIGRTMIN 32
-#define __SIGRTMAX (_NSIG - 1)
+#undef __SIGRTMAX
+#define __SIGRTMAX 64
#endif /* <signal.h> included. */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h b/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
index 6ad3363ddf..6adf3e4a77 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
@@ -1,5 +1,5 @@
/* sigstack, sigaltstack definitions.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software 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,39 +16,17 @@
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
-
-/* Structure describing a signal stack (obsolete). */
-struct sigstack
- {
- __ptr_t ss_sp; /* Signal stack pointer. */
- int ss_onstack; /* Nonzero if executing on this stack. */
- };
-
-
-/* Possible values for `ss_flags.'. */
-enum
-{
- SS_ONSTACK = 1,
-#define SS_ONSTACK SS_ONSTACK
- SS_DISABLE
-#define SS_DISABLE SS_DISABLE
-};
-
/* Minimum stack size for a signal handler. */
#define MINSIGSTKSZ 4096
/* 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/socket_type.h b/sysdeps/unix/sysv/linux/alpha/bits/socket_type.h
index 3d76fe3ae9..c27c8df6a8 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/socket_type.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/socket_type.h
@@ -1,5 +1,5 @@
/* Define enum __socket_type for Linux/Alpha.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/stat.h b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
index d70df127be..bd19bb4a8a 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/statfs.h b/sysdeps/unix/sysv/linux/alpha/bits/statfs.h
index b356a2e1c0..afb4688363 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h
index d9b5be9f44..24423e8fc9 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h
@@ -1,5 +1,5 @@
/* termios type and macro definitions. Linux version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -70,13 +70,10 @@ struct termios
#define ICRNL 0000400
#define IXON 0001000
#define IXOFF 0002000
-#ifdef __USE_MISC
- /* POSIX.1 doesn't want these... */
-# define IXANY 0004000
-# define IUCLC 0010000
-# define IMAXBEL 0020000
-# define IUTF8 0040000
-#endif
+#define IXANY 0004000
+#define IUCLC 0010000
+#define IMAXBEL 0020000
+#define IUTF8 0040000
/* c_oflag bits */
#define OPOST 0000001
@@ -93,8 +90,10 @@ struct termios
# define NLDLY 00001400
# define NL0 00000000
# define NL1 00000400
-# define NL2 00001000
-# define NL3 00001400
+# if defined __USE_MISC
+# define NL2 00001000
+# define NL3 00001400
+# endif
# define TABDLY 00006000
# define TAB0 00000000
# define TAB1 00002000
@@ -118,7 +117,7 @@ struct termios
#define VT1 00200000
#ifdef __USE_MISC
-# define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
+# define XTABS TAB3
#endif
/* c_cflag bit meaning */
@@ -185,7 +184,7 @@ struct termios
/* c_lflag bits */
#define ISIG 0x00000080
#define ICANON 0x00000100
-#if defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
# define XCASE 0x00004000
#endif
#define ECHO 0x00000008
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/timerfd.h b/sysdeps/unix/sysv/linux/alpha/bits/timerfd.h
index 62a66de66e..8f81eabe4c 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/timerfd.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/timerfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
index 3cfd887c39..d9a0b0467c 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Linux/Alpha version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,6 +66,9 @@
for C type-checking purposes. */
#define __OFF_T_MATCHES_OFF64_T 1
+/* And for __rlim_t and __rlim64_t. */
+#define __RLIM_T_MATCHES_RLIM64_T 1
+
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
index 51fc433d6e..91574cb296 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software 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,14 +16,4 @@
<http://www.gnu.org/licenses/>. */
#define __WORDSIZE 64
-
-#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
- the `long double' function variants to be redirects to the double
- functions. */
-# define __LONG_DOUBLE_MATH_OPTIONAL 1
-# ifndef __LONG_DOUBLE_128__
-# define __NO_LONG_DOUBLE_MATH 1
-# endif
-#endif
+#define __WORDSIZE_TIME64_COMPAT32 0
diff --git a/sysdeps/unix/sysv/linux/alpha/brk.S b/sysdeps/unix/sysv/linux/alpha/brk.S
index 1c32d38239..2c4e138240 100644
--- a/sysdeps/unix/sysv/linux/alpha/brk.S
+++ b/sysdeps/unix/sysv/linux/alpha/brk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe <brendan@zen.org>, 1993.
diff --git a/sysdeps/unix/sysv/linux/alpha/clone.S b/sysdeps/unix/sysv/linux/alpha/clone.S
index ec9c06d9af..810a2e5e78 100644
--- a/sysdeps/unix/sysv/linux/alpha/clone.S
+++ b/sysdeps/unix/sysv/linux/alpha/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>, 1996.
@@ -23,9 +23,6 @@
#define _ERRNO_H 1
#include <bits/errno.h>
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
/* int clone(int (*fn)(void *arg), void *child_stack, int flags,
void *arg, pid_t *ptid, void *tls, pid_t *ctid);
@@ -43,9 +40,11 @@
cfi_startproc
__clone:
#ifdef PROF
+ .set noat
ldgp gp,0(pv)
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
#endif
/* Sanity check arguments. */
@@ -92,13 +91,6 @@ thread_start:
cfi_def_cfa_register(fp)
cfi_undefined(ra)
- /* Check and see if we need to reset the PID. */
- ldq t0, 16(sp)
- lda t1, CLONE_THREAD
- and t0, t1, t2
- beq t2, 2f
-1:
-
/* Load up the arguments. */
ldq pv, 0(sp)
ldq a0, 8(sp)
@@ -108,33 +100,17 @@ thread_start:
jsr ra, (pv)
ldgp gp, 0(ra)
- /* Call _exit rather than doing it inline for breakpoint purposes. */
- mov v0, a0
-#ifdef PIC
- bsr ra, HIDDEN_JUMPTARGET(_exit) !samegp
-#else
- jsr ra, HIDDEN_JUMPTARGET(_exit)
-#endif
+ mov v0, a0
+ ldiq v0, __NR_exit
+ call_pal PAL_callsys
/* Die horribly. */
.align 4
halt
.align 4
-2:
- rduniq
- lda t1, CLONE_VM
- mov v0, s0
- lda v0, -1
- and t0, t1, t2
- bne t2, 3f
- lda v0, __NR_getxpid
- callsys
-3:
- stl v0, PID_OFFSET(s0)
- stl v0, TID_OFFSET(s0)
- br 1b
cfi_endproc
.end thread_start
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/alpha/creat.c b/sysdeps/unix/sysv/linux/alpha/creat.c
deleted file mode 100644
index 7a5afed58c..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/creat.c
+++ /dev/null
@@ -1,8 +0,0 @@
-/* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list defines creat and
- creat64 for most linux targets, but on alpha creat is not a syscall.
- If we do nothing, we'll wind up with creat64 being undefined, because
- the syscalls.list assumes the creat->creat64 alias was created. We
- could have overridden that with a create64.c, but we might as well do
- the right thing and set up creat64 as an alias. */
-#include <io/creat.c>
-weak_alias(creat, creat64)
diff --git a/sysdeps/unix/sysv/linux/alpha/dl-auxv.h b/sysdeps/unix/sysv/linux/alpha/dl-auxv.h
index 8619266aac..979ea2246e 100644
--- a/sysdeps/unix/sysv/linux/alpha/dl-auxv.h
+++ b/sysdeps/unix/sysv/linux/alpha/dl-auxv.h
@@ -1,5 +1,5 @@
/* Auxiliary vector processing for Linux/Alpha.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S b/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S
index 59cc15afb2..a6d854b6f8 100644
--- a/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S
+++ b/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/fxstat.c b/sysdeps/unix/sysv/linux/alpha/fxstat.c
index 91c9bb0c98..8a7a13ad69 100644
--- a/sysdeps/unix/sysv/linux/alpha/fxstat.c
+++ b/sysdeps/unix/sysv/linux/alpha/fxstat.c
@@ -1,5 +1,5 @@
/* fxstat using old-style Unix stat system call.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/fxstatat.c b/sysdeps/unix/sysv/linux/alpha/fxstatat.c
index 2f75273b1f..69ddbcd279 100644
--- a/sysdeps/unix/sysv/linux/alpha/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/alpha/fxstatat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/getcontext.S b/sysdeps/unix/sysv/linux/alpha/getcontext.S
index 3422871c59..84c6b00549 100644
--- a/sysdeps/unix/sysv/linux/alpha/getcontext.S
+++ b/sysdeps/unix/sysv/linux/alpha/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/getdents.c b/sysdeps/unix/sysv/linux/alpha/getdents.c
index dfecfef924..64ccf86c71 100644
--- a/sysdeps/unix/sysv/linux/alpha/getdents.c
+++ b/sysdeps/unix/sysv/linux/alpha/getdents.c
@@ -1,3 +1,11 @@
+/* Although Alpha defines _DIRENT_MATCHES_DIRENT64, 'struct dirent' and
+ 'struct dirent64' have slight different internal layout with d_ino
+ being a __ino_t on non-LFS version with an extra __pad field which should
+ be zeroed. */
+
+#include <dirent.h>
+#undef _DIRENT_MATCHES_DIRENT64
+#define _DIRENT_MATCHES_DIRENT64 0
#define DIRENT_SET_DP_INO(dp, value) \
do { (dp)->d_ino = (value); (dp)->__pad = 0; } while (0)
#include <sysdeps/unix/sysv/linux/getdents.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/getdents64.c b/sysdeps/unix/sysv/linux/alpha/getdents64.c
index 50f1368b74..940897de40 100644
--- a/sysdeps/unix/sysv/linux/alpha/getdents64.c
+++ b/sysdeps/unix/sysv/linux/alpha/getdents64.c
@@ -1 +1,10 @@
+/* Although Alpha defines _DIRENT_MATCHES_DIRENT64, 'struct dirent' and
+ 'struct dirent64' have slight different internal layout with d_ino
+ being a __ino_t on non-LFS version with an extra __pad field which should
+ be zeroed. */
+
+#include <dirent.h>
+/* It suppresses the __getdents64 to __getdents alias. */
+#undef _DIRENT_MATCHES_DIRENT64
+#define _DIRENT_MATCHES_DIRENT64 0
#include <sysdeps/unix/sysv/linux/getdents64.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/gethostname.c b/sysdeps/unix/sysv/linux/alpha/gethostname.c
index 1d5fdf8fad..6d9273c096 100644
--- a/sysdeps/unix/sysv/linux/alpha/gethostname.c
+++ b/sysdeps/unix/sysv/linux/alpha/gethostname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001
diff --git a/sysdeps/unix/sysv/linux/alpha/getrlimit64.c b/sysdeps/unix/sysv/linux/alpha/getrlimit64.c
new file mode 100644
index 0000000000..5502586462
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/getrlimit64.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2018 Free Software 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 USE_VERSIONED_RLIMIT
+#include <sysdeps/unix/sysv/linux/getrlimit64.c>
+versioned_symbol (libc, __getrlimit, getrlimit, GLIBC_2_27);
+versioned_symbol (libc, __getrlimit64, getrlimit64, GLIBC_2_27);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_27)
+/* RLIM64_INFINITY was supposed to be a glibc convention rather than
+ anything seen by the kernel, but it ended being passed to the kernel
+ through the prlimit64 syscall. Given that a lot of binaries with
+ the wrong constant value are in the wild, provide a wrapper function
+ fixing the value after the syscall. */
+# define OLD_RLIM64_INFINITY 0x7fffffffffffffffULL
+
+int
+attribute_compat_text_section
+__old_getrlimit64 (enum __rlimit_resource resource,
+ struct rlimit64 *rlimits)
+{
+ struct rlimit64 krlimits;
+
+ if (__getrlimit64 (resource, &krlimits) < 0)
+ return -1;
+
+ if (krlimits.rlim_cur == RLIM64_INFINITY)
+ rlimits->rlim_cur = OLD_RLIM64_INFINITY;
+ else
+ rlimits->rlim_cur = krlimits.rlim_cur;
+ if (krlimits.rlim_max == RLIM64_INFINITY)
+ rlimits->rlim_max = OLD_RLIM64_INFINITY;
+ else
+ rlimits->rlim_max = krlimits.rlim_max;
+
+ return 0;
+}
+
+strong_alias (__old_getrlimit64, __old_getrlimit)
+compat_symbol (libc, __old_getrlimit, getrlimit, GLIBC_2_0);
+compat_symbol (libc, __old_getrlimit64, getrlimit64, GLIBC_2_1);
+#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/getsysstats.c b/sysdeps/unix/sysv/linux/alpha/getsysstats.c
index 011586a605..99b513c255 100644
--- a/sysdeps/unix/sysv/linux/alpha/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/alpha/getsysstats.c
@@ -1,5 +1,5 @@
/* Determine various system internal values, Linux/Alpha version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>
diff --git a/sysdeps/unix/sysv/linux/alpha/glob-lstat-compat.c b/sysdeps/unix/sysv/linux/alpha/glob-lstat-compat.c
new file mode 100644
index 0000000000..a76471d4df
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/glob-lstat-compat.c
@@ -0,0 +1,2 @@
+#define GLOB_LSTAT_VERSION GLIBC_2_1
+#include <sysdeps/unix/sysv/linux/glob-lstat-compat.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/glob.c b/sysdeps/unix/sysv/linux/alpha/glob.c
deleted file mode 100644
index c5dfb85468..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/glob.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 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/>. */
-
-#define glob64 __no_glob64_decl
-#define globfree64 __no_globfree64_decl
-
-#include <sys/types.h>
-#include <glob.h>
-#include <shlib-compat.h>
-
-/* For Linux/Alpha we have to make the glob symbols versioned. */
-#define glob(pattern, flags, errfunc, pglob) \
- __new_glob (pattern, flags, errfunc, pglob)
-#define globfree(pglob) \
- __new_globfree (pglob)
-
-/* We need prototypes for these new names. */
-extern int __new_glob (const char *__pattern, int __flags,
- int (*__errfunc) (const char *, int),
- glob_t *__pglob);
-extern void __new_globfree (glob_t *__pglob);
-
-#include <posix/glob.c>
-
-#undef glob
-#undef globfree
-#undef glob64
-#undef globfree64
-
-versioned_symbol (libc, __new_glob, glob, GLIBC_2_1);
-versioned_symbol (libc, __new_globfree, globfree, GLIBC_2_1);
-libc_hidden_ver (__new_glob, glob)
-libc_hidden_ver (__new_globfree, globfree)
-
-weak_alias (__new_glob, glob64)
-weak_alias (__new_globfree, globfree64)
-libc_hidden_ver (__new_globfree, globfree64)
diff --git a/sysdeps/unix/sysv/linux/alpha/globfree.c b/sysdeps/unix/sysv/linux/alpha/globfree.c
new file mode 100644
index 0000000000..79c56ee3c4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/globfree.c
@@ -0,0 +1,37 @@
+/* Compat globfree. Linux/alpha version.
+ Copyright (C) 2017-2018 Free Software 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 globfree64 __no_globfree64_decl
+#include <sys/types.h>
+#include <glob.h>
+#include <shlib-compat.h>
+
+#define globfree(pglob) \
+ __new_globfree (pglob)
+
+extern void __new_globfree (glob_t *__pglob);
+
+#include <posix/globfree.c>
+
+#undef globfree64
+
+versioned_symbol (libc, __new_globfree, globfree, GLIBC_2_1);
+libc_hidden_ver (__new_globfree, globfree)
+
+weak_alias (__new_globfree, globfree64)
+libc_hidden_ver (__new_globfree, globfree64)
diff --git a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
index edf74242b5..406ee6ad14 100644
--- a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
+++ b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger <davidm@azstarnet.com>, 1995.
diff --git a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
index a6b131d18a..9673824a66 100644
--- a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
+++ b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger <davidm@azstarnet.com>, 1995.
diff --git a/sysdeps/unix/sysv/linux/alpha/ioperm.c b/sysdeps/unix/sysv/linux/alpha/ioperm.c
index e328a6e251..b41ce7662e 100644
--- a/sysdeps/unix/sysv/linux/alpha/ioperm.c
+++ b/sysdeps/unix/sysv/linux/alpha/ioperm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger.
diff --git a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h
index 67883be101..5b9f68de03 100644
--- a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h
+++ b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h
@@ -1 +1,32 @@
-#include <sysdeps/unix/sysv/linux/powerpc/ipc_priv.h>
+/* Old SysV permission definition for Linux. Alpha version.
+ Copyright (C) 2016-2018 Free Software 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/ipc.h> /* For __key_t */
+
+#define __IPC_64 0x100
+
+struct __old_ipc_perm
+{
+ __key_t __key; /* Key. */
+ unsigned int uid; /* Owner's user ID. */
+ unsigned int gid; /* Owner's group ID. */
+ unsigned int cuid; /* Creator's user ID. */
+ unsigned int cgid; /* Creator's group ID. */
+ unsigned int mode; /* Read/write permission. */
+ unsigned short int __seq; /* Sequence number. */
+};
diff --git a/sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h
new file mode 100644
index 0000000000..b595173e6f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 272
+#define SIGJMP_BUF_SIZE 272
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 136
+#define SAVED_MASK_OFFSET 144
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
index 2cd61ecaa4..402d2573d7 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,39 +20,36 @@
#ifndef _KERNEL_FEATURES_H
#define _KERNEL_FEATURES_H 1
-/* Support for recvmmsg was added for alpha in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
-
-/* Support for accept4 and sendmmsg was added for alpha in 3.2. */
-#if __LINUX_KERNEL_VERSION >= 0x030200
-# define __ASSUME_ACCEPT4_SYSCALL 1
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
-
#include_next <kernel-features.h>
#undef __ASSUME_ST_INO_64_BIT
-
-/* Support for fallocate was added for alpha after 2.6.33-rc1. */
-#if __LINUX_KERNEL_VERSION < 0x020621
-# undef __ASSUME_FALLOCATE
-#endif
+#define __ASSUME_ST_INO_64_BIT 0
/* There never has been support for fstat64. */
#undef __ASSUME_STATFS64
#define __ASSUME_STATFS64 0
-/* Support for various syscalls was added for alpha in 2.6.33. */
-#if __LINUX_KERNEL_VERSION < 0x020621
-# undef __ASSUME_PREADV
-# undef __ASSUME_PWRITEV
-# undef __ASSUME_IN_NONBLOCK
-# undef __ASSUME_PIPE2
-# undef __ASSUME_EVENTFD2
-# undef __ASSUME_SIGNALFD4
-# undef __ASSUME_DUP3
+/* Alpha defines SysV ipc shmat syscall with a different name. */
+#define __NR_shmat __NR_osf_shmat
+
+#define __ASSUME_RECV_SYSCALL 1
+#define __ASSUME_SEND_SYSCALL 1
+
+/* Support for the renameat2 syscall was added in 3.17. */
+#if __LINUX_KERNEL_VERSION < 0x031100
+# undef __ASSUME_RENAMEAT2
+#endif
+
+/* Support for the execveat syscall was added in 4.2. */
+#if __LINUX_KERNEL_VERSION < 0x040200
+# undef __ASSUME_EXECVEAT
+#endif
+
+/* Support for copy_file_range, statx was added in kernel 4.13. */
+#if __LINUX_KERNEL_VERSION < 0x040D00
+# undef __ASSUME_MLOCK2
+# undef __ASSUME_COPY_FILE_RANGE
+# undef __ASSUME_STATX
#endif
#endif /* _KERNEL_FEATURES_H */
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h b/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
index 4c35d969cf..25180ff9c9 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
@@ -1,15 +1,12 @@
-/* This is the sigaction struction from the Linux 2.1.20 kernel. */
+#ifndef _KERNEL_SIGACTION_H
+# define _KERNEL_SIGACTION_H
-struct old_kernel_sigaction {
- __sighandler_t k_sa_handler;
- unsigned long sa_mask;
- unsigned int sa_flags;
+/* This is the sigaction structure from the Linux 3.2 kernel. */
+struct kernel_sigaction
+{
+ __sighandler_t k_sa_handler;
+ unsigned int sa_flags;
+ sigset_t sa_mask;
};
-/* This is the sigaction structure from the Linux 2.1.68 kernel. */
-
-struct kernel_sigaction {
- __sighandler_t k_sa_handler;
- unsigned int sa_flags;
- sigset_t sa_mask;
-};
+#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
index 6708411407..d637e099cf 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
@@ -86,3 +86,4 @@ struct glibc21_stat
};
#define XSTAT_IS_XSTAT64 1
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_termios.h b/sysdeps/unix/sysv/linux/alpha/kernel_termios.h
index 518b555aaf..b72bd176ea 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel_termios.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel_termios.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/ld.abilist b/sysdeps/unix/sysv/linux/alpha/ld.abilist
index 9faf6eb2c6..98b66edabf 100644
--- a/sysdeps/unix/sysv/linux/alpha/ld.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/ld.abilist
@@ -1,14 +1,9 @@
-GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
GLIBC_2.0 _r_debug D 0x28
GLIBC_2.0 calloc F
GLIBC_2.0 free F
GLIBC_2.0 malloc F
GLIBC_2.0 realloc F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_stack_end D 0x8
GLIBC_2.1 _dl_mcount F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __stack_chk_guard D 0x8
diff --git a/sysdeps/unix/sysv/linux/alpha/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/alpha/libBrokenLocale.abilist
index 4a56bb68a3..54395f3c8d 100644
--- a/sysdeps/unix/sysv/linux/alpha/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/alpha/libanl.abilist b/sysdeps/unix/sysv/linux/alpha/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/alpha/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 0fa4ee9bea..e22b91655d 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -1339,7 +1337,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 _IO_2_1_stderr_ D 0xe0
GLIBC_2.1 _IO_2_1_stdin_ D 0xe0
GLIBC_2.1 _IO_2_1_stdout_ D 0xe0
@@ -1656,7 +1653,6 @@ GLIBC_2.1 xdr_uint16_t F
GLIBC_2.1 xdr_uint32_t F
GLIBC_2.1 xdr_uint8_t F
GLIBC_2.1 xdr_unixcred F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 _Exit F
GLIBC_2.1.1 __mempcpy_small F
GLIBC_2.1.1 __stpcpy_small F
@@ -1686,7 +1682,6 @@ GLIBC_2.1.1 xdr_longlong_t F
GLIBC_2.1.1 xdr_u_hyper F
GLIBC_2.1.1 xdr_u_longlong_t F
GLIBC_2.1.1 xdr_uint64_t F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
GLIBC_2.1.2 getaliasbyname_r F
GLIBC_2.1.2 getaliasent_r F
@@ -1714,13 +1709,10 @@ GLIBC_2.1.2 getservbyport_r F
GLIBC_2.1.2 getservent_r F
GLIBC_2.1.2 getspent_r F
GLIBC_2.1.2 getspnam_r F
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 __cxa_atexit F
GLIBC_2.1.3 __cxa_finalize F
GLIBC_2.1.3 __sigsuspend F
-GLIBC_2.1.4 GLIBC_2.1.4 A
GLIBC_2.1.4 pciconfig_iobase F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1747,33 +1739,28 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x458
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x458
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1782,7 +1769,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -1797,16 +1783,13 @@ GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 sys_errlist D 0x460
GLIBC_2.16 sys_nerr D 0x4
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_adjust_wcolumn F
GLIBC_2.2 _IO_fgetpos F
GLIBC_2.2 _IO_fgetpos64 F
@@ -1971,34 +1954,85 @@ GLIBC_2.2 wcsftime F
GLIBC_2.2 wmempcpy F
GLIBC_2.2 wprintf F
GLIBC_2.2 wscanf F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
GLIBC_2.2.2 wordexp F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 getrlimit F
+GLIBC_2.27 getrlimit64 F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 setrlimit F
+GLIBC_2.27 setrlimit64 F
+GLIBC_2.27 strfromf128 F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof128 F
+GLIBC_2.27 strtof128_l F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof128 F
+GLIBC_2.27 wcstof128_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2090,7 +2124,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2103,7 +2136,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x208
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2124,7 +2156,6 @@ GLIBC_2.3.3 strtoll_l F
GLIBC_2.3.3 strtoull_l F
GLIBC_2.3.3 sys_sigabbrev D 0x208
GLIBC_2.3.3 sys_siglist D 0x208
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 _OtsAddX F
GLIBC_2.3.4 _OtsConvertFloatTX F
GLIBC_2.3.4 _OtsConvertFloatXT F
@@ -2170,7 +2201,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
@@ -2398,7 +2428,6 @@ GLIBC_2.4 wcstold F
GLIBC_2.4 wcstold_l F
GLIBC_2.4 wprintf F
GLIBC_2.4 wscanf F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2416,7 +2445,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2424,7 +2452,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2463,7 +2490,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __nldbl___asprintf_chk F
@@ -2480,7 +2506,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/alpha/libcrypt.abilist b/sysdeps/unix/sysv/linux/alpha/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/alpha/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/alpha/libdl.abilist b/sysdeps/unix/sysv/linux/alpha/libdl.abilist
index 5536f6e0a9..7826fde951 100644
--- a/sysdeps/unix/sysv/linux/alpha/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 dlopen F
GLIBC_2.1 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/alpha/libm.abilist b/sysdeps/unix/sysv/linux/alpha/libm.abilist
index 611dfe1aa5..2773d61cd1 100644
--- a/sysdeps/unix/sysv/linux/alpha/libm.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _LIB_VERSION D 0x4
GLIBC_2.0 __atan2 F
GLIBC_2.0 acos F
@@ -156,7 +155,6 @@ GLIBC_2.0 y1l F
GLIBC_2.0 yn F
GLIBC_2.0 ynf F
GLIBC_2.0 ynl F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __clog10 F
GLIBC_2.1 __clog10f F
GLIBC_2.1 __clog10l F
@@ -309,7 +307,6 @@ GLIBC_2.1 tgammal F
GLIBC_2.1 trunc F
GLIBC_2.1 truncf F
GLIBC_2.1 truncl F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -390,14 +387,12 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
GLIBC_2.18 __sqrt_finite F
GLIBC_2.18 __sqrtf_finite F
GLIBC_2.18 __sqrtl_finite F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 feclearexcept F
GLIBC_2.2 fedisableexcept F
GLIBC_2.2 feenableexcept F
@@ -408,12 +403,646 @@ GLIBC_2.2 feraiseexcept F
GLIBC_2.2 fesetenv F
GLIBC_2.2 fesetexceptflag F
GLIBC_2.2 feupdateenv F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.3.4 GLIBC_2.3.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl 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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf128 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf128 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf128 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f128 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf128 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf128 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf128 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf128 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf128 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef128 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf128 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf128 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf128 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf128 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf128 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf128 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf128 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf128 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf128 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf128 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf128 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f128 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf128 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf128 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf128 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf128 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf128 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf128 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf128 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf128 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf128 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf128 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf128 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf128 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf128 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf128 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff128 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f128 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f128 F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf128 F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f128 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf128 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf128 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf128 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf128 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf128 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf128 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf128 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf128 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf128 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf128 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf128 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf128 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf128 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf128 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf128 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f128 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f128 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf128 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf128 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf128 F
+GLIBC_2.27 lgammaf128_r F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf128 F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf128 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf128 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f128 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf128 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f128 F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf128 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf128 F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf128 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf128 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff128 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf128 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf128 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf128 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf128 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf128 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf128 F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf128 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof128 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf128 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf128 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf128 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf128 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf128 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf128 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf128 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf128 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf128 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf128 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf128 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf128 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf128 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf128 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf128 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf128 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf128 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf128 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf128 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f128 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f128 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf128 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 __nldbl_daddl F
+GLIBC_2.28 __nldbl_ddivl F
+GLIBC_2.28 __nldbl_dmull F
+GLIBC_2.28 __nldbl_dsubl F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.3.4 __c1_cabsf F
GLIBC_2.3.4 __c1_cacosf F
GLIBC_2.3.4 __c1_cacoshf F
@@ -460,7 +1089,6 @@ GLIBC_2.3.4 csinhf F
GLIBC_2.3.4 csqrtf F
GLIBC_2.3.4 ctanf F
GLIBC_2.3.4 ctanhf F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/alpha/libnsl.abilist b/sysdeps/unix/sysv/linux/alpha/libnsl.abilist
index a23db2aeaf..add3d66a7a 100644
--- a/sysdeps/unix/sysv/linux/alpha/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __free_fdresult F
GLIBC_2.1 __nis_default_access F
GLIBC_2.1 __nis_default_group F
@@ -120,5 +118,4 @@ GLIBC_2.1 readColdStartFile F
GLIBC_2.1 writeColdStartFile F
GLIBC_2.1 xdr_cback_data F
GLIBC_2.1 xdr_obj_p F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 xdr_ypall F
diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
index 7e121d45f8..b413007ccb 100644
--- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_flockfile F
GLIBC_2.0 _IO_ftrylockfile F
GLIBC_2.0 _IO_funlockfile F
@@ -119,7 +118,6 @@ GLIBC_2.0 vfork F
GLIBC_2.0 wait F
GLIBC_2.0 waitpid F
GLIBC_2.0 write F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_allocate_rtsig F
GLIBC_2.1 __libc_current_sigrtmax F
GLIBC_2.1 __libc_current_sigrtmin F
@@ -154,24 +152,18 @@ GLIBC_2.1 sem_init F
GLIBC_2.1 sem_post F
GLIBC_2.1 sem_trywait F
GLIBC_2.1 sem_wait F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 sem_close F
GLIBC_2.1.1 sem_open F
GLIBC_2.1.1 sem_unlink F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __open64 F
GLIBC_2.2 __pread64 F
GLIBC_2.2 __pthread_rwlock_destroy F
@@ -212,18 +204,35 @@ GLIBC_2.2 pthread_yield F
GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -241,13 +250,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/alpha/libresolv.abilist b/sysdeps/unix/sysv/linux/alpha/libresolv.abilist
index 2d92a35e81..06f995151c 100644
--- a/sysdeps/unix/sysv/linux/alpha/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/alpha/librt.abilist b/sysdeps/unix/sysv/linux/alpha/librt.abilist
index 8699f6ccc4..d7a049cf60 100644
--- a/sysdeps/unix/sysv/linux/alpha/librt.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 aio_cancel F
GLIBC_2.1 aio_cancel64 F
GLIBC_2.1 aio_error F
@@ -16,7 +15,6 @@ GLIBC_2.1 aio_write F
GLIBC_2.1 aio_write64 F
GLIBC_2.1 lio_listio F
GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 clock_getcpuclockid F
GLIBC_2.2 clock_getres F
GLIBC_2.2 clock_gettime F
@@ -29,16 +27,13 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 aio_cancel F
GLIBC_2.3 aio_cancel64 F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 timer_create F
GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -49,8 +44,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/alpha/libthread_db.abilist b/sysdeps/unix/sysv/linux/alpha/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/alpha/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/alpha/libutil.abilist b/sysdeps/unix/sysv/linux/alpha/libutil.abilist
index 89c67755c4..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/alpha/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
diff --git a/sysdeps/unix/sysv/linux/alpha/localplt.data b/sysdeps/unix/sysv/linux/alpha/localplt.data
index e2a4311cbd..c69eb04ce5 100644
--- a/sysdeps/unix/sysv/linux/alpha/localplt.data
+++ b/sysdeps/unix/sysv/linux/alpha/localplt.data
@@ -15,21 +15,25 @@ libc.so: _OtsNeqX ?
libc.so: _OtsNintXQ ?
libc.so: _OtsSubX ?
libc.so: _Unwind_Find_FDE
-libc.so: calloc ?
-libc.so: free ?
-libc.so: malloc ?
-libc.so: memalign ?
-libc.so: realloc ?
-libm.so: matherr
+libc.so: calloc + RELA R_ALPHA_GLOB_DAT
+libc.so: free + RELA R_ALPHA_GLOB_DAT
+libc.so: malloc + RELA R_ALPHA_GLOB_DAT
+libc.so: memalign + RELA R_ALPHA_GLOB_DAT
+libc.so: realloc + RELA R_ALPHA_GLOB_DAT
+libm.so: matherr + RELA R_ALPHA_GLOB_DAT
# We used to offer inline functions that used this, so it must be exported.
# Ought to reorg things such that carg isn't thus forced to use a plt.
libm.so: __atan2
-# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
-# internally to allocate aligned TLS storage. The other malloc family of
-# functions are expected to allow user symbol interposition.
-ld.so: __tls_get_addr
-ld.so: __libc_memalign
-ld.so: malloc
-ld.so: calloc
-ld.so: realloc
-ld.so: free
+# The dynamic loader needs __tls_get_addr for TLS.
+ld.so: __tls_get_addr ?
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
+ld.so: malloc + RELA R_ALPHA_GLOB_DAT
+ld.so: calloc + RELA R_ALPHA_GLOB_DAT
+ld.so: realloc + RELA R_ALPHA_GLOB_DAT
+ld.so: free + RELA R_ALPHA_GLOB_DAT
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error + RELA R_ALPHA_GLOB_DAT
+ld.so: _dl_catch_error + RELA R_ALPHA_GLOB_DAT
+ld.so: _dl_signal_exception + RELA R_ALPHA_GLOB_DAT
+ld.so: _dl_catch_exception + RELA R_ALPHA_GLOB_DAT
diff --git a/sysdeps/unix/sysv/linux/alpha/lxstat.c b/sysdeps/unix/sysv/linux/alpha/lxstat.c
index c48c076baf..986fc13cd6 100644
--- a/sysdeps/unix/sysv/linux/alpha/lxstat.c
+++ b/sysdeps/unix/sysv/linux/alpha/lxstat.c
@@ -1,5 +1,5 @@
/* lxstat using old-style Unix stat system call.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/makecontext.S b/sysdeps/unix/sysv/linux/alpha/makecontext.S
index a61cf48d48..cae2144e03 100644
--- a/sysdeps/unix/sysv/linux/alpha/makecontext.S
+++ b/sysdeps/unix/sysv/linux/alpha/makecontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/msgctl.c b/sysdeps/unix/sysv/linux/alpha/msgctl.c
deleted file mode 100644
index d65a5b93d6..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/msgctl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/arm/msgctl.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/oldglob.c b/sysdeps/unix/sysv/linux/alpha/oldglob.c
index ffaba8198f..6585dd7c2f 100644
--- a/sysdeps/unix/sysv/linux/alpha/oldglob.c
+++ b/sysdeps/unix/sysv/linux/alpha/oldglob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,7 +36,7 @@ typedef struct
are used instead of the normal file access functions. */
void (*gl_closedir) (void *);
struct dirent *(*gl_readdir) (void *);
- __ptr_t (*gl_opendir) (const char *);
+ void *(*gl_opendir) (const char *);
int (*gl_lstat) (const char *, struct stat *);
int (*gl_stat) (const char *, struct stat *);
} old_glob_t;
@@ -59,7 +59,9 @@ __old_glob (const char *pattern, int flags,
correct.gl_closedir = pglob->gl_closedir;
correct.gl_readdir = pglob->gl_readdir;
correct.gl_opendir = pglob->gl_opendir;
- correct.gl_lstat = pglob->gl_lstat;
+ /* Set gl_lstat and gl_stat for both gl_stat for compatibility with old
+ implementation that did not follow dangling symlinks. */
+ correct.gl_lstat = pglob->gl_stat;
correct.gl_stat = pglob->gl_stat;
result = glob (pattern, flags, errfunc, &correct);
@@ -72,7 +74,7 @@ __old_glob (const char *pattern, int flags,
pglob->gl_closedir = correct.gl_closedir;
pglob->gl_readdir = correct.gl_readdir;
pglob->gl_opendir = correct.gl_opendir;
- pglob->gl_lstat = correct.gl_lstat;
+ /* Only need to restore gl_stat. */
pglob->gl_stat = correct.gl_stat;
return result;
diff --git a/sysdeps/unix/sysv/linux/alpha/pt-vfork.S b/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
index 5f749e4f87..7ecaa78dd0 100644
--- a/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
+++ b/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
@@ -1,5 +1,5 @@
/* vfork ABI-compatibility entry points for libpthread.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/register-dump.h b/sysdeps/unix/sysv/linux/alpha/register-dump.h
index ff7ca0c0f1..f693c68a44 100644
--- a/sysdeps/unix/sysv/linux/alpha/register-dump.h
+++ b/sysdeps/unix/sysv/linux/alpha/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S b/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
index fef8b167ed..ca25eee611 100644
--- a/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
+++ b/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@cygnus.com>, 1998
diff --git a/sysdeps/unix/sysv/linux/alpha/select.c b/sysdeps/unix/sysv/linux/alpha/select.c
new file mode 100644
index 0000000000..9db925c4e2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/select.c
@@ -0,0 +1,53 @@
+/* Linux/alpha select implementation.
+ Copyright (C) 2017-2018 Free Software 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/time.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <errno.h>
+#include <sysdep-cancel.h>
+#include <shlib-compat.h>
+
+int
+__new_select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+ struct timeval *timeout)
+{
+ return SYSCALL_CANCEL (select, nfds, readfds, writefds, exceptfds, timeout);
+}
+strong_alias (__new_select, __select)
+libc_hidden_def (__select)
+
+default_symbol_version (__new_select, select, GLIBC_2.1);
+
+strong_alias (__new_select, __new_select_private);
+symbol_version (__new_select_private, __select, GLIBC_2.1);
+
+/* Old timeval32 compat calls. */
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
+int
+__select_tv32 (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+ struct timeval *timeout)
+{
+ return SYSCALL_CANCEL (osf_select, nfds, readfds, writefds, exceptfds,
+ timeout);
+}
+strong_alias (__select_tv32, __select_tv32_1)
+
+compat_symbol (libc, __select_tv32, __select, GLIBC_2_0);
+compat_symbol (libc, __select_tv32_1, select, GLIBC_2_0);
+#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/semctl.c b/sysdeps/unix/sysv/linux/alpha/semctl.c
deleted file mode 100644
index 4cb834ad97..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/semctl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/arm/semctl.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/setcontext.S b/sysdeps/unix/sysv/linux/alpha/setcontext.S
index ad216b230e..5b7a806a6f 100644
--- a/sysdeps/unix/sysv/linux/alpha/setcontext.S
+++ b/sysdeps/unix/sysv/linux/alpha/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/setfpucw.c b/sysdeps/unix/sysv/linux/alpha/setfpucw.c
index 957d9d40ac..4cbdd2db37 100644
--- a/sysdeps/unix/sysv/linux/alpha/setfpucw.c
+++ b/sysdeps/unix/sysv/linux/alpha/setfpucw.c
@@ -1,5 +1,5 @@
/* Set FP exception mask and rounding mode.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/setrlimit64.c b/sysdeps/unix/sysv/linux/alpha/setrlimit64.c
new file mode 100644
index 0000000000..871c878b7e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/setrlimit64.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2018 Free Software 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 USE_VERSIONED_RLIMIT
+#include <sysdeps/unix/sysv/linux/setrlimit64.c>
+versioned_symbol (libc, __setrlimit, setrlimit, GLIBC_2_27);
+versioned_symbol (libc, __setrlimit64, setrlimit64, GLIBC_2_27);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_27)
+/* RLIM64_INFINITY was supposed to be a glibc convention rather than
+ anything seen by the kernel, but it ended being passed to the kernel
+ through the prlimit64 syscall. Given that a lot of binaries with
+ the wrong constant value are in the wild, provide a wrapper function
+ fixing the value before the syscall. */
+# define OLD_RLIM64_INFINITY 0x7fffffffffffffffULL
+
+int
+attribute_compat_text_section
+__old_setrlimit64 (enum __rlimit_resource resource,
+ const struct rlimit64 *rlimits)
+{
+ struct rlimit64 krlimits;
+
+ if (rlimits->rlim_cur == OLD_RLIM64_INFINITY)
+ krlimits.rlim_cur = RLIM64_INFINITY;
+ else
+ krlimits.rlim_cur = rlimits->rlim_cur;
+ if (rlimits->rlim_max == OLD_RLIM64_INFINITY)
+ krlimits.rlim_max = RLIM64_INFINITY;
+ else
+ krlimits.rlim_max = rlimits->rlim_max;
+
+ return __setrlimit64 (resource, &krlimits);
+}
+
+strong_alias (__old_setrlimit64, __old_setrlimit)
+compat_symbol (libc, __old_setrlimit, setrlimit, GLIBC_2_0);
+compat_symbol (libc, __old_setrlimit64, setrlimit64, GLIBC_2_1);
+#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/shmctl.c b/sysdeps/unix/sysv/linux/alpha/shmctl.c
deleted file mode 100644
index f73ed6f246..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/shmctl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/arm/shmctl.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/sigaction.c b/sysdeps/unix/sysv/linux/alpha/sigaction.c
index 28f8e44de2..8051043587 100644
--- a/sysdeps/unix/sysv/linux/alpha/sigaction.c
+++ b/sysdeps/unix/sysv/linux/alpha/sigaction.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h b/sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h
index 66bf868784..a0a57f3988 100644
--- a/sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software 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,9 +16,4 @@
<http://www.gnu.org/licenses/>. */
#define SIGCONTEXT int _code, struct sigcontext *
-#define SIGCONTEXT_EXTRA_ARGS _code,
#define GET_PC(ctx) ((void *) (ctx)->sc_pc)
-#define GET_FRAME(ctx) ((void *) (ctx)->sc_regs[15])
-#define GET_STACK(ctx) ((void *) (ctx)->sc_regs[30])
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/alpha/sigprocmask.c b/sysdeps/unix/sysv/linux/alpha/sigprocmask.c
index 35ffaf3072..a79f3e147d 100644
--- a/sysdeps/unix/sysv/linux/alpha/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/alpha/sigprocmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger (davidm@azstarnet.com).
@@ -54,4 +54,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
return 0;
}
+libc_hidden_def (__sigprocmask)
weak_alias (__sigprocmask, sigprocmask);
diff --git a/sysdeps/unix/sysv/linux/alpha/sigsuspend.S b/sysdeps/unix/sysv/linux/alpha/sigsuspend.S
deleted file mode 100644
index 246e1e03a2..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/sigsuspend.S
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Mosberger <davidm@cs.arizona.edu>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-/* sigsuspend is a special syscall since it needs to dereference the
- sigset. This will have to change when we have more than 64 signals. */
-
-#include <sysdep-cancel.h>
-
-#undef PSEUDO_PREPARE_ARGS
-#define PSEUDO_PREPARE_ARGS ldq a0, 0(a0);
-
-PSEUDO(__sigsuspend, sigsuspend, 1)
- ret
-PSEUDO_END(__sigsuspend)
-libc_hidden_def (__sigsuspend)
-weak_alias (__sigsuspend, sigsuspend)
-strong_alias (__sigsuspend, __libc_sigsuspend)
diff --git a/sysdeps/unix/sysv/linux/alpha/sizes.h b/sysdeps/unix/sysv/linux/alpha/sizes.h
index 53e08b0d99..9a48a825d9 100644
--- a/sysdeps/unix/sysv/linux/alpha/sizes.h
+++ b/sysdeps/unix/sysv/linux/alpha/sizes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/swapcontext.S b/sysdeps/unix/sysv/linux/alpha/swapcontext.S
index d31b290b2a..686b6b6344 100644
--- a/sysdeps/unix/sysv/linux/alpha/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/alpha/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/acct.h b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
index 01da7bf035..f6e55ad85d 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/acct.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,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/io.h b/sysdeps/unix/sysv/linux/alpha/sys/io.h
index 6091d9dbef..df50f7e7d5 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/io.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/io.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
index f622a59638..a6cbb025fb 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -71,7 +71,7 @@ struct elf_prstatus
unsigned long int pr_sigpend; /* Set of pending signals. */
unsigned long int pr_sighold; /* Set of held signals. */
#if 0
- struct sigaltstack pr_altstack; /* Alternate stack info. */
+ stack_t pr_altstack; /* Alternate stack info. */
struct sigaction pr_action; /* Signal action for current sig. */
#endif
__pid_t pr_pid;
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h b/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
index a42e662cf5..6aa614e43d 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,42 +19,76 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
-#include <bits/sigcontext.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
/* Type for general register. */
typedef long int greg_t;
/* Number of general registers. */
-#define NGREG 33
+#define __NGREG 33
+#ifdef __USE_MISC
+# define NGREG __NGREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
/* Type for floating-point register. */
typedef long int fpreg_t;
/* Number of general registers. */
-#define NFPREG 32
+#define __NFPREG 32
+#ifdef __USE_MISC
+# define NFPREG __NFPREG
+#endif
/* Container for all general registers. */
-typedef fpreg_t fpregset_t[NFPREG];
+typedef fpreg_t fpregset_t[__NFPREG];
/* A machine context is exactly a sigcontext. */
-typedef struct sigcontext mcontext_t;
+typedef struct
+ {
+ long int __ctx(sc_onstack);
+ long int __ctx(sc_mask);
+ long int __ctx(sc_pc);
+ long int __ctx(sc_ps);
+ long int __ctx(sc_regs)[32];
+ long int __ctx(sc_ownedfp);
+ long int __ctx(sc_fpregs)[32];
+ unsigned long int __ctx(sc_fpcr);
+ unsigned long int __ctx(sc_fp_control);
+ unsigned long int __glibc_reserved1, __glibc_reserved2;
+ unsigned long int __ctx(sc_ssize);
+ char *__ctx(sc_sbase);
+ unsigned long int __ctx(sc_traparg_a0);
+ unsigned long int __ctx(sc_traparg_a1);
+ unsigned long int __ctx(sc_traparg_a2);
+ unsigned long int __ctx(sc_fp_trap_pc);
+ unsigned long int __ctx(sc_fp_trigger_sum);
+ unsigned long int __ctx(sc_fp_trigger_inst);
+ } mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
unsigned long __uc_osf_sigmask;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
+ sigset_t uc_sigmask;
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/user.h b/sysdeps/unix/sysv/linux/alpha/sys/user.h
index 1a7c9c4889..548afcf0ce 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@
than gdb/strace unless you know what you are doing. */
#include <asm/reg.h>
+#include <stddef.h>
struct user
{
diff --git a/sysdeps/unix/sysv/linux/alpha/syscall.S b/sysdeps/unix/sysv/linux/alpha/syscall.S
index 1bf458c374..1cf18fb82f 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscall.S
+++ b/sysdeps/unix/sysv/linux/alpha/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger <davidm@azstarnet.com>, 1996.
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index cad1fc362e..12cd021b60 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -1,36 +1,15 @@
# File name Caller Syscall name # args Strong name Weak names
-oldmsgctl EXTRA msgctl i:iip __old_msgctl msgctl@GLIBC_2.0
-msgget - msgget i:ii __msgget msgget
-msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
-msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
-shmat - osf_shmat i:ipi __shmat shmat
-oldshmctl EXTRA shmctl i:iip __old_shmctl shmctl@GLIBC_2.0
-shmdt - shmdt i:s __shmdt shmdt
-shmget - shmget i:iii __shmget shmget
-semop - semop i:ipi __semop semop
-semtimedop - semtimedop i:ipip semtimedop
-semget - semget i:iii __semget semget
-oldsemctl EXTRA semctl i:iiii __old_semctl semctl@GLIBC_2.0
-
sigstack - sigstack 2 sigstack
getpriority - getpriority i:ii __getpriority getpriority
# proper socket implementations:
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
-connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
-recv - recv Ci:ibni __libc_recv __recv recv
-recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom
-recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg
-send - send Ci:ibni __libc_send __send send
-sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg
-sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
@@ -44,7 +23,6 @@ pciconfig_write EXTRA pciconfig_write 5 pciconfig_write
pciconfig_iobase EXTRA pciconfig_iobase 3 __pciconfig_iobase pciconfig_iobase
# support old timeval32 entry points
-osf_select - osf_select C:5 __select_tv32 __select@GLIBC_2.0 select@GLIBC_2.0
osf_gettimeofday - osf_gettimeofday 2 __gettimeofday_tv32 __gettimeofday@GLIBC_2.0 gettimeofday@GLIBC_2.0
osf_settimeofday - osf_settimeofday 2 __settimeofday_tv32 settimeofday@GLIBC_2.0
osf_getitimer - osf_getitimer 2 __getitimer_tv32 getitimer@GLIBC_2.0
@@ -54,7 +32,6 @@ osf_getrusage - osf_getrusage 2 __getrusage_tv32 getrusage@GLIBC_2.0
osf_wait4 - osf_wait4 4 __wait4_tv32 wait4@GLIBC_2.0
# support new timeval64 entry points
-select - select C:5 __GI___select select@@GLIBC_2.1 __select@@GLIBC_2.1
gettimeofday - gettimeofday 2 __GI___gettimeofday gettimeofday@@GLIBC_2.1 __gettimeofday@@GLIBC_2.1
settimeofday - settimeofday 2 __settimeofday settimeofday@@GLIBC_2.1
getitimer - getitimer 2 __getitimer getitimer@@GLIBC_2.1
diff --git a/sysdeps/unix/sysv/linux/alpha/sysconf.c b/sysdeps/unix/sysv/linux/alpha/sysconf.c
index 2fd4981d60..a1d56ca88b 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysconf.c
+++ b/sysdeps/unix/sysv/linux/alpha/sysconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h b/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
deleted file mode 100644
index ddfed5d497..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
+++ /dev/null
@@ -1,174 +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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-/* ??? Assumes that nothing comes between PSEUDO and PSEUDO_END
- besides "ret". */
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .globl __##syscall_name##_nocancel; \
- .type __##syscall_name##_nocancel, @function; \
- .usepv __##syscall_name##_nocancel, std; \
- .align 4; \
- cfi_startproc; \
-__LABEL(__##syscall_name##_nocancel) \
- ldgp gp, 0(pv); \
- PSEUDO_PROF; \
-__LABEL($pseudo_nocancel) \
- PSEUDO_PREPARE_ARGS; \
- lda v0, SYS_ify(syscall_name); \
- call_pal PAL_callsys; \
- bne a3, SYSCALL_ERROR_LABEL; \
-__LABEL($pseudo_ret) \
- .subsection 2; \
- .size __##syscall_name##_nocancel, .-__##syscall_name##_nocancel; \
- .globl name; \
- .type name, @function; \
- .usepv name, std; \
- .align 4; \
- cfi_startproc; \
-__LABEL(name) \
- ldgp gp, 0(pv); \
- PSEUDO_PROF; \
- SINGLE_THREAD_P(t0); \
- beq t0, $pseudo_nocancel; \
- subq sp, 64, sp; \
- cfi_def_cfa_offset(64); \
- stq ra, 0(sp); \
- cfi_offset(ra, -64); \
- SAVE_ARGS_##args; \
- CENABLE; \
- LOAD_ARGS_##args; \
- /* Save the CENABLE return value in RA. That register \
- is preserved across syscall and the real return \
- address is saved on the stack. */ \
- mov v0, ra; \
- lda v0, SYS_ify(syscall_name); \
- call_pal PAL_callsys; \
- stq v0, 8(sp); \
- mov ra, a0; \
- bne a3, $multi_error; \
- CDISABLE; \
- ldq ra, 0(sp); \
- ldq v0, 8(sp); \
- addq sp, 64, sp; \
- cfi_remember_state; \
- cfi_restore(ra); \
- cfi_def_cfa_offset(0); \
- ret; \
- cfi_restore_state; \
-__LABEL($multi_error) \
- CDISABLE; \
- ldq ra, 0(sp); \
- ldq v0, 8(sp); \
- addq sp, 64, sp; \
- cfi_restore(ra); \
- cfi_def_cfa_offset(0); \
- SYSCALL_ERROR_FALLTHRU; \
- SYSCALL_ERROR_HANDLER; \
- cfi_endproc; \
- .previous
-
-# undef PSEUDO_END
-# define PSEUDO_END(sym) \
- cfi_endproc; \
- .subsection 2; \
- .size sym, .-sym
-
-# define SAVE_ARGS_0 /* Nothing. */
-# define SAVE_ARGS_1 SAVE_ARGS_0; stq a0, 8(sp)
-# define SAVE_ARGS_2 SAVE_ARGS_1; stq a1, 16(sp)
-# define SAVE_ARGS_3 SAVE_ARGS_2; stq a2, 24(sp)
-# define SAVE_ARGS_4 SAVE_ARGS_3; stq a3, 32(sp)
-# define SAVE_ARGS_5 SAVE_ARGS_4; stq a4, 40(sp)
-# define SAVE_ARGS_6 SAVE_ARGS_5; stq a5, 48(sp)
-
-# define LOAD_ARGS_0 /* Nothing. */
-# define LOAD_ARGS_1 LOAD_ARGS_0; ldq a0, 8(sp)
-# define LOAD_ARGS_2 LOAD_ARGS_1; ldq a1, 16(sp)
-# define LOAD_ARGS_3 LOAD_ARGS_2; ldq a2, 24(sp)
-# define LOAD_ARGS_4 LOAD_ARGS_3; ldq a3, 32(sp)
-# define LOAD_ARGS_5 LOAD_ARGS_4; ldq a4, 40(sp)
-# define LOAD_ARGS_6 LOAD_ARGS_5; ldq a5, 48(sp)
-
-# if IS_IN (libpthread)
-# define __local_enable_asynccancel __pthread_enable_asynccancel
-# define __local_disable_asynccancel __pthread_disable_asynccancel
-# define __local_multiple_threads __pthread_multiple_threads
-# elif IS_IN (libc)
-# define __local_enable_asynccancel __libc_enable_asynccancel
-# define __local_disable_asynccancel __libc_disable_asynccancel
-# define __local_multiple_threads __libc_multiple_threads
-# elif IS_IN (librt)
-# define __local_enable_asynccancel __librt_enable_asynccancel
-# define __local_disable_asynccancel __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-# ifdef PIC
-# define CENABLE bsr ra, __local_enable_asynccancel !samegp
-# define CDISABLE bsr ra, __local_disable_asynccancel !samegp
-# else
-# define CENABLE jsr ra, __local_enable_asynccancel; ldgp ra, 0(gp)
-# define CDISABLE jsr ra, __local_disable_asynccancel; ldgp ra, 0(gp)
-# endif
-
-# if IS_IN (libpthread) || IS_IN (libc)
-# ifndef __ASSEMBLER__
-extern int __local_multiple_threads attribute_hidden;
-# define SINGLE_THREAD_P \
- __builtin_expect (__local_multiple_threads == 0, 1)
-# elif defined(PIC)
-# define SINGLE_THREAD_P(reg) ldl reg, __local_multiple_threads(gp) !gprel
-# else
-# define SINGLE_THREAD_P(reg) \
- ldah reg, __local_multiple_threads(gp) !gprelhigh; \
- ldl reg, __local_multiple_threads(reg) !gprellow
-# endif
-# else
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P(reg) \
- call_pal PAL_rduniq; \
- ldl reg, MULTIPLE_THREADS_OFFSET($0)
-# endif
-# endif
-
-#else
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h
index b6efc666e5..080405021f 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysdep.h
+++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
@@ -70,6 +70,8 @@
# define __NR_pwrite __NR_pwrite64
#endif
+#define SINGLE_THREAD_BY_GLOBAL 1
+
/*
* In order to get the hidden arguments for rt_sigaction set up
* properly, we need to call the assembly version. This shouldn't
diff --git a/sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym b/sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym
index f95ff75636..9e86f8a7ca 100644
--- a/sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym
+++ b/sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym
@@ -7,12 +7,12 @@ UC_OSF_SIGMASK offsetof (ucontext_t, __uc_osf_sigmask)
UC_STACK offsetof (ucontext_t, uc_stack)
UC_SIGCTX offsetof (ucontext_t, uc_mcontext)
UC_SIGMASK offsetof (ucontext_t, uc_sigmask)
-SC_REGS offsetof (struct sigcontext, sc_regs)
-SC_FPREGS offsetof (struct sigcontext, sc_fpregs)
-SC_PC offsetof (struct sigcontext, sc_pc)
-SC_PS offsetof (struct sigcontext, sc_ps)
-SC_FPCRS offsetof (struct sigcontext, sc_fpcr)
-SC_MASK offsetof (struct sigcontext, sc_mask)
-SC_FPCR offsetof (struct sigcontext, sc_fpcr)
+SC_REGS offsetof (mcontext_t, sc_regs)
+SC_FPREGS offsetof (mcontext_t, sc_fpregs)
+SC_PC offsetof (mcontext_t, sc_pc)
+SC_PS offsetof (mcontext_t, sc_ps)
+SC_FPCRS offsetof (mcontext_t, sc_fpcr)
+SC_MASK offsetof (mcontext_t, sc_mask)
+SC_FPCR offsetof (mcontext_t, sc_fpcr)
SS_SP offsetof (stack_t, ss_sp)
SS_SIZE offsetof (stack_t, ss_size)
diff --git a/sysdeps/unix/sysv/linux/alpha/vfork.S b/sysdeps/unix/sysv/linux/alpha/vfork.S
index 9fc199ac41..73333da583 100644
--- a/sysdeps/unix/sysv/linux/alpha/vfork.S
+++ b/sysdeps/unix/sysv/linux/alpha/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,24 +25,9 @@ ENTRY(__libc_vfork)
rduniq
mov v0, a1
- /* Save the TCB-cached PID away in A2, and then negate the TCB
- field. But if it's zero, set it to 0x80000000 instead. See
- raise.c for the logic that relies on this value. */
- ldl a2, PID_OFFSET(v0)
- ldah t0, -0x8000
- negl a2, t1
- cmovne a2, t1, t0
- stl t0, PID_OFFSET(v0);
-
lda v0, SYS_ify(vfork)
call_pal PAL_callsys
- /* Restore the original value of the TCB cache of the PID, if we're
- the parent. But in the child (syscall return value equals zero),
- leave things as they are. */
- beq v0, 1f
- stl a2, PID_OFFSET(a1)
-1:
/* Normal error check and return. */
bne a3, SYSCALL_ERROR_LABEL
ret
diff --git a/sysdeps/unix/sysv/linux/alpha/xstat.c b/sysdeps/unix/sysv/linux/alpha/xstat.c
index eeb986b5d5..67ef9d109d 100644
--- a/sysdeps/unix/sysv/linux/alpha/xstat.c
+++ b/sysdeps/unix/sysv/linux/alpha/xstat.c
@@ -1,5 +1,5 @@
/* xstat using old-style Unix stat system call.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/xstatconv.c b/sysdeps/unix/sysv/linux/alpha/xstatconv.c
index fa44165359..f77af380ff 100644
--- a/sysdeps/unix/sysv/linux/alpha/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/alpha/xstatconv.c
@@ -1,5 +1,5 @@
/* Convert between the kernel's `struct stat' format, and libc's.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alpha/xstatconv.h b/sysdeps/unix/sysv/linux/alpha/xstatconv.h
index fcf9767250..0ebb9c7339 100644
--- a/sysdeps/unix/sysv/linux/alpha/xstatconv.h
+++ b/sysdeps/unix/sysv/linux/alpha/xstatconv.h
@@ -1,5 +1,5 @@
/* Convert between the kernel's `struct stat' format, and libc's.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/alphasort64.c b/sysdeps/unix/sysv/linux/alphasort64.c
new file mode 100644
index 0000000000..7bacdff561
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alphasort64.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1992-2018 Free Software 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 alphasort __no_alphasort_decl
+#include <dirent.h>
+#undef alphasort
+#include <string.h>
+
+int
+__alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
+{
+ return strcoll ((*a)->d_name, (*b)->d_name);
+}
+
+#if _DIRENT_MATCHES_DIRENT64
+weak_alias (__alphasort64, alphasort64)
+weak_alias (__alphasort64, alphasort)
+#else
+# include <shlib-compat.h>
+versioned_symbol (libc, __alphasort64, alphasort64, GLIBC_2_2);
+# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+# include <olddirent.h>
+
+int
+attribute_compat_text_section
+__old_alphasort64 (const struct __old_dirent64 **a,
+ const struct __old_dirent64 **b)
+{
+ return strcoll ((*a)->d_name, (*b)->d_name);
+}
+
+compat_symbol (libc, __old_alphasort64, alphasort64, GLIBC_2_1);
+# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */
+#endif /* _DIRENT_MATCHES_DIRENT64 */
diff --git a/sysdeps/unix/sysv/linux/arch-fork.h b/sysdeps/unix/sysv/linux/arch-fork.h
index 5a28eb97fe..046d9fc60d 100644
--- a/sysdeps/unix/sysv/linux/arch-fork.h
+++ b/sysdeps/unix/sysv/linux/arch-fork.h
@@ -1,5 +1,5 @@
-/* ARCH_FORK definition for Linux fork implementation. Stub version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* arch_fork definition for Linux fork implementation.
+ Copyright (C) 2014-2018 Free Software 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,12 +16,41 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* This file should define the function-like macro of no arguments
- ARCH_FORK to an INLINE_SYSCALL invocation of the clone-like system
- call, passing the CLONE_CHILD_SETTID and CLONE_CHILD_CLEARTID flags
- and &THREAD_SELF->tid as the TID address.
+#ifndef __ARCH_FORK_H
+#define __ARCH_FORK_H
- Machines that lack an arch-fork.h header file will hit an #error in
- fork.c; this stub file doesn't contain an #error itself mainly for
- the transition period of migrating old machine-specific fork.c files
- to machine-specific arch-fork.h instead. */
+#include <unistd.h>
+
+/* Call the clone syscall with fork semantic. The CTID address is used
+ to store the child thread ID at its locationm, to erase it in child memory
+ when the child exits, and do a wakeup on the futex at that address.
+
+ The architecture with non-default kernel abi semantic should correctlly
+ override it with one of the supported calling convention (check generic
+ kernel-features.h for the clone abi variants). */
+static inline pid_t
+arch_fork (void *ctid)
+{
+ const int flags = CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD;
+ long int ret;
+#ifdef __ASSUME_CLONE_BACKWARDS
+# ifdef INLINE_CLONE_SYSCALL
+ ret = INLINE_CLONE_SYSCALL (flags, 0, NULL, 0, ctid);
+# else
+ ret = INLINE_SYSCALL_CALL (clone, flags, 0, NULL, 0, ctid);
+# endif
+#elif defined(__ASSUME_CLONE_BACKWARDS2)
+ ret = INLINE_SYSCALL_CALL (clone, 0, flags, NULL, ctid, 0);
+#elif defined(__ASSUME_CLONE_BACKWARDS3)
+ ret = INLINE_SYSCALL_CALL (clone, flags, 0, 0, NULL, ctid, 0);
+#elif defined(__ASSUME_CLONE2)
+ ret = INLINE_SYSCALL_CALL (clone2, flags, 0, 0, NULL, ctid, 0);
+#elif defined(__ASSUME_CLONE_DEFAULT)
+ ret = INLINE_SYSCALL_CALL (clone, flags, 0, NULL, ctid, 0);
+#else
+# error "Undefined clone variant"
+#endif
+ return ret;
+}
+
+#endif /* __ARCH_FORK_H */
diff --git a/sysdeps/unix/sysv/linux/arm/Makefile b/sysdeps/unix/sysv/linux/arm/Makefile
index 270cb73f70..4adc35de04 100644
--- a/sysdeps/unix/sysv/linux/arm/Makefile
+++ b/sysdeps/unix/sysv/linux/arm/Makefile
@@ -12,10 +12,6 @@ ifeq ($(subdir),signal)
sysdep_routines += sigrestorer
endif
-ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64
-endif
-
ifeq ($(subdir),stdlib)
gen-as-const-headers += ucontext_i.sym
endif
@@ -67,7 +63,5 @@ Unknown ABI, must be one of $(abi-variants)
endif
abi-includes :=
-abi-soft-options := -U__ARM_PCS_VFP
abi-soft-condition := !defined __ARM_PCS_VFP
-abi-hard-options := -D__ARM_PCS_VFP
abi-hard-condition := defined __ARM_PCS_VFP
diff --git a/sysdeps/unix/sysv/linux/arm/Versions b/sysdeps/unix/sysv/linux/arm/Versions
index 5ff2225f24..7e5ba53455 100644
--- a/sysdeps/unix/sysv/linux/arm/Versions
+++ b/sysdeps/unix/sysv/linux/arm/Versions
@@ -7,6 +7,9 @@ libc {
GLIBC_2.11 {
fallocate64;
}
+ GLIBC_2.24 {
+ recvmsg; sendmsg;
+ }
GLIBC_PRIVATE {
# A copy of sigaction lives in libpthread, and needs these.
__default_sa_restorer; __default_rt_sa_restorer;
diff --git a/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S b/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
index e2baf7e9eb..1b2901a221 100644
--- a/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
index c8e002b753..871702317a 100644
--- a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
+++ b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/alphasort64.c b/sysdeps/unix/sysv/linux/arm/alphasort64.c
deleted file mode 100644
index 0b5ae47d2f..0000000000
--- a/sysdeps/unix/sysv/linux/arm/alphasort64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/alphasort64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/arch-fork.h b/sysdeps/unix/sysv/linux/arm/arch-fork.h
deleted file mode 100644
index dcccd06819..0000000000
--- a/sysdeps/unix/sysv/linux/arm/arch-fork.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. ARM version.
- Copyright (C) 2014-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 <sched.h>
-#include <sysdep.h>
-#include <tls.h>
-
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 5, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
- NULL, NULL, NULL, &THREAD_SELF->tid)
diff --git a/sysdeps/unix/sysv/linux/arm/arm-features.h b/sysdeps/unix/sysv/linux/arm/arm-features.h
index dd6b2fdaf6..92044a61a2 100644
--- a/sysdeps/unix/sysv/linux/arm/arm-features.h
+++ b/sysdeps/unix/sysv/linux/arm/arm-features.h
@@ -1,5 +1,5 @@
/* Macros to test for CPU features on ARM. Linux version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/atomic-machine.h b/sysdeps/unix/sysv/linux/arm/atomic-machine.h
index fb6f39d4f6..ad165274d8 100644
--- a/sysdeps/unix/sysv/linux/arm/atomic-machine.h
+++ b/sysdeps/unix/sysv/linux/arm/atomic-machine.h
@@ -1,5 +1,5 @@
/* Atomic operations. ARM/Linux version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
index 4fbe30d19e..d9c105b834 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/bits/hwcap.h b/sysdeps/unix/sysv/linux/arm/bits/hwcap.h
index 4e1011579b..1568f49ce3 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/hwcap.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/hwcap.h
@@ -1,5 +1,5 @@
/* Defines for bits in AT_HWCAP. ARM Linux version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/bits/mman.h b/sysdeps/unix/sysv/linux/arm/bits/mman.h
index 8062651a01..63813dcee7 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/ARM version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,6 +34,10 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_SYNC 0x80000 /* Perform synchronous page
+ faults for the mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Include generic Linux declarations. */
diff --git a/sysdeps/unix/sysv/linux/arm/bits/shm.h b/sysdeps/unix/sysv/linux/arm/bits/shm.h
index 48b05cfb3c..e3d4916a50 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -68,6 +68,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/arm/brk.c b/sysdeps/unix/sysv/linux/arm/brk.c
index b3415e9a82..43a4586a6a 100644
--- a/sysdeps/unix/sysv/linux/arm/brk.c
+++ b/sysdeps/unix/sysv/linux/arm/brk.c
@@ -1,5 +1,5 @@
/* brk system call for Linux/ARM.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/clone.S b/sysdeps/unix/sysv/linux/arm/clone.S
index 460a8f5ae8..288b734256 100644
--- a/sysdeps/unix/sysv/linux/arm/clone.S
+++ b/sysdeps/unix/sysv/linux/arm/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Pat Beirne <patb@corelcomputer.com>
@@ -24,9 +24,6 @@
#define _ERRNO_H 1
#include <bits/errno.h>
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
pid_t *ptid, struct user_desc *tls, pid_t *ctid); */
@@ -70,27 +67,16 @@ PSEUDO_END (__clone)
1:
.fnstart
.cantunwind
- tst ip, #CLONE_THREAD
- bne 3f
- GET_TLS (lr)
- mov r1, r0
- tst ip, #CLONE_VM
- ldr r7, =SYS_ify(getpid)
- ite ne
- movne r0, #-1
- swieq 0x0
- NEGOFF_ADJ_BASE (r1, TID_OFFSET)
- str r0, NEGOFF_OFF1 (r1, TID_OFFSET)
- str r0, NEGOFF_OFF2 (r1, PID_OFFSET, TID_OFFSET)
-3:
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
ldr ip, [sp], #8
BLX (ip)
@ and we are done, passing the return value through r0
- b PLTJMP(HIDDEN_JUMPTARGET(_exit))
+ ldr r7, =SYS_ify(exit)
+ swi 0x0
.fnend
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/arm/dl-cache.h b/sysdeps/unix/sysv/linux/arm/dl-cache.h
index 5ad5f4b33b..252af4245a 100644
--- a/sysdeps/unix/sysv/linux/arm/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/arm/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/dl-machine.h b/sysdeps/unix/sysv/linux/arm/dl-machine.h
index e13d5c9923..64e2448c2d 100644
--- a/sysdeps/unix/sysv/linux/arm/dl-machine.h
+++ b/sysdeps/unix/sysv/linux/arm/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. ARM/Linux version
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.c b/sysdeps/unix/sysv/linux/arm/dl-procinfo.c
index ea43d6cab9..185e34764b 100644
--- a/sysdeps/unix/sysv/linux/arm/dl-procinfo.c
+++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.c
@@ -1,5 +1,5 @@
/* Data for Linux/ARM version of processor capability information.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>, 2001.
@@ -46,7 +46,7 @@
#if !defined PROCINFO_DECL && defined SHARED
._dl_arm_cap_flags
#else
-PROCINFO_CLASS const char _dl_arm_cap_flags[37][10]
+PROCINFO_CLASS const char _dl_arm_cap_flags[27][10]
#endif
#ifndef PROCINFO_DECL
= {
diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
index 659a7cbbfd..31f2f04c0b 100644
--- a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
@@ -1,5 +1,5 @@
/* Linux/ARM version of processor capability information handling macros.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>, 2001.
@@ -23,7 +23,7 @@
#include <ldsodefs.h>
#include <sysdep.h>
-#define _DL_HWCAP_COUNT 37
+#define _DL_HWCAP_COUNT 27
/* Low 22 bits are allocated in HWCAP. */
#define _DL_HWCAP_LAST 21
diff --git a/sysdeps/unix/sysv/linux/arm/fcntl.c b/sysdeps/unix/sysv/linux/arm/fcntl.c
deleted file mode 100644
index ea951bc4f9..0000000000
--- a/sysdeps/unix/sysv/linux/arm/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/arm/ftruncate64.c b/sysdeps/unix/sysv/linux/arm/ftruncate64.c
deleted file mode 100644
index 0e8d8ba408..0000000000
--- a/sysdeps/unix/sysv/linux/arm/ftruncate64.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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 <sys/types.h>
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Truncate the file FD refers to to LENGTH bytes. */
-int
-__ftruncate64 (int fd, off64_t length)
-{
- unsigned int low = length & 0xffffffff;
- unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (ftruncate64, 4, fd, 0,
- __LONG_LONG_PAIR (high, low));
- return result;
-}
-weak_alias (__ftruncate64, ftruncate64)
diff --git a/sysdeps/unix/sysv/linux/arm/getcontext.S b/sysdeps/unix/sysv/linux/arm/getcontext.S
index df5b9803d0..e7284157dc 100644
--- a/sysdeps/unix/sysv/linux/arm/getcontext.S
+++ b/sysdeps/unix/sysv/linux/arm/getcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/getdents64.c b/sysdeps/unix/sysv/linux/arm/getdents64.c
deleted file mode 100644
index 0c75fb5a06..0000000000
--- a/sysdeps/unix/sysv/linux/arm/getdents64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getdents64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/getrlimit64.c b/sysdeps/unix/sysv/linux/arm/getrlimit64.c
deleted file mode 100644
index fef018f471..0000000000
--- a/sysdeps/unix/sysv/linux/arm/getrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/glob64.c b/sysdeps/unix/sysv/linux/arm/glob64.c
deleted file mode 100644
index 82a9a296a7..0000000000
--- a/sysdeps/unix/sysv/linux/arm/glob64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/glob64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/init-first.c b/sysdeps/unix/sysv/linux/arm/init-first.c
index 633820017a..f4293b1cf8 100644
--- a/sysdeps/unix/sysv/linux/arm/init-first.c
+++ b/sysdeps/unix/sysv/linux/arm/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. Linux/ARM.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/arm/ioperm.c b/sysdeps/unix/sysv/linux/arm/ioperm.c
index 97ff8b85d6..4c0bb63d51 100644
--- a/sysdeps/unix/sysv/linux/arm/ioperm.c
+++ b/sysdeps/unix/sysv/linux/arm/ioperm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Phil Blundell, based on the Alpha version by
David Mosberger.
diff --git a/sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h
new file mode 100644
index 0000000000..eb64802525
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 392
+#define SIGJMP_BUF_SIZE 392
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 256
+#define SAVED_MASK_OFFSET 260
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index 6f1606c833..7831ab1e0f 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software 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,28 +17,28 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-/* Support for the recvmmsg syscall was added in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
-
-/* Support for the accept4 syscall was added in 2.6.36. */
-#if __LINUX_KERNEL_VERSION >= 0x020624
-# define __ASSUME_ACCEPT4_SYSCALL 1
-#endif
-
-/* Support for the sendmmsg syscall was added in 3.0. */
-#if __LINUX_KERNEL_VERSION >= 0x030000
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
-
#include_next <kernel-features.h>
/* The ARM kernel before 3.14.3 may or may not support
futex_atomic_cmpxchg_inatomic, depending on kernel
configuration. */
#if __LINUX_KERNEL_VERSION < 0x030E03
-# undef __ASSUME_FUTEX_LOCK_PI
-# undef __ASSUME_REQUEUE_PI
# 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
+
+#define __ASSUME_RECV_SYSCALL 1
+#define __ASSUME_SEND_SYSCALL 1
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
diff --git a/sysdeps/unix/sysv/linux/arm/ld.abilist b/sysdeps/unix/sysv/linux/arm/ld.abilist
index 4de351ea3f..a301c6ebc4 100644
--- a/sysdeps/unix/sysv/linux/arm/ld.abilist
+++ b/sysdeps/unix/sysv/linux/arm/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
-GLIBC_2.4 __libc_memalign F
GLIBC_2.4 __libc_stack_end D 0x4
GLIBC_2.4 __stack_chk_guard D 0x4
GLIBC_2.4 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/arm/ldconfig.h b/sysdeps/unix/sysv/linux/arm/ldconfig.h
index 620b6c2657..1ab8cf3cbb 100644
--- a/sysdeps/unix/sysv/linux/arm/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/arm/ldconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/ldsodefs.h b/sysdeps/unix/sysv/linux/arm/ldsodefs.h
index f8b8eca8ed..fc8edce3d6 100644
--- a/sysdeps/unix/sysv/linux/arm/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/arm/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/arm/libBrokenLocale.abilist
index e80f213955..7e60a808d8 100644
--- a/sysdeps/unix/sysv/linux/arm/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/arm/libanl.abilist b/sysdeps/unix/sysv/linux/arm/libanl.abilist
index df0c397ddc..a8fafedb66 100644
--- a/sysdeps/unix/sysv/linux/arm/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 gai_cancel F
GLIBC_2.4 gai_error F
GLIBC_2.4 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S b/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S
index 5b6b5044f9..d26ad1f8d3 100644
--- a/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S
+++ b/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/libc-vdso.h b/sysdeps/unix/sysv/linux/arm/libc-vdso.h
index bf5f01277c..52dd355818 100644
--- a/sysdeps/unix/sysv/linux/arm/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/arm/libc-vdso.h
@@ -1,5 +1,5 @@
/* VDSO function pointer declarations. Linux/ARM.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/arm/libc.abilist b/sysdeps/unix/sysv/linux/arm/libc.abilist
index db9fa350f0..a231812eea 100644
--- a/sysdeps/unix/sysv/linux/arm/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libc.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -24,7 +23,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -32,26 +30,22 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x21c
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x21c
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -60,7 +54,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -71,24 +64,65 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.4 _Exit F
GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
@@ -2066,7 +2100,6 @@ GLIBC_2.4 xdrstdio_create F
GLIBC_2.4 xencrypt F
GLIBC_2.4 xprt_register F
GLIBC_2.4 xprt_unregister F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2084,7 +2117,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2092,7 +2124,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2119,7 +2150,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __gnu_mcount_nc F
@@ -2131,7 +2161,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/arm/libcrypt.abilist b/sysdeps/unix/sysv/linux/arm/libcrypt.abilist
index 04f1f02fa3..78a25b6df2 100644
--- a/sysdeps/unix/sysv/linux/arm/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 crypt F
GLIBC_2.4 crypt_r F
GLIBC_2.4 encrypt F
diff --git a/sysdeps/unix/sysv/linux/arm/libdl.abilist b/sysdeps/unix/sysv/linux/arm/libdl.abilist
index 89a750a0a3..40132b1374 100644
--- a/sysdeps/unix/sysv/linux/arm/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libdl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 dladdr F
GLIBC_2.4 dladdr1 F
GLIBC_2.4 dlclose F
diff --git a/sysdeps/unix/sysv/linux/arm/libm.abilist b/sysdeps/unix/sysv/linux/arm/libm.abilist
index e65e2309cd..e126eb07e3 100644
--- a/sysdeps/unix/sysv/linux/arm/libm.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -53,15 +52,407 @@ GLIBC_2.15 __y1_finite F
GLIBC_2.15 __y1f_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F
GLIBC_2.4 __clog10f F
diff --git a/sysdeps/unix/sysv/linux/arm/libnsl.abilist b/sysdeps/unix/sysv/linux/arm/libnsl.abilist
index 2b2e49e6a1..a005a75181 100644
--- a/sysdeps/unix/sysv/linux/arm/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __free_fdresult F
GLIBC_2.4 __nis_default_access F
GLIBC_2.4 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/arm/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/libpthread.abilist
index 91545c1542..af82a4c632 100644
--- a/sysdeps/unix/sysv/linux/arm/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libpthread.abilist
@@ -1,15 +1,32 @@
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.4 _IO_flockfile F
GLIBC_2.4 _IO_ftrylockfile F
GLIBC_2.4 _IO_funlockfile F
diff --git a/sysdeps/unix/sysv/linux/arm/libresolv.abilist b/sysdeps/unix/sysv/linux/arm/libresolv.abilist
index c7023be532..2dd5094f76 100644
--- a/sysdeps/unix/sysv/linux/arm/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __b64_ntop F
GLIBC_2.4 __b64_pton F
GLIBC_2.4 __dn_comp F
@@ -64,7 +63,6 @@ GLIBC_2.4 res_gethostbyname F
GLIBC_2.4 res_gethostbyname2 F
GLIBC_2.4 res_send_setqhook F
GLIBC_2.4 res_send_setrhook F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/arm/librt.abilist b/sysdeps/unix/sysv/linux/arm/librt.abilist
index b47aa0cc9c..cfbbd27557 100644
--- a/sysdeps/unix/sysv/linux/arm/librt.abilist
+++ b/sysdeps/unix/sysv/linux/arm/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 aio_cancel F
GLIBC_2.4 aio_cancel64 F
GLIBC_2.4 aio_error F
@@ -38,5 +37,4 @@ GLIBC_2.4 timer_delete F
GLIBC_2.4 timer_getoverrun F
GLIBC_2.4 timer_gettime F
GLIBC_2.4 timer_settime F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/arm/libthread_db.abilist b/sysdeps/unix/sysv/linux/arm/libthread_db.abilist
index 4cffcd2238..065a2626c8 100644
--- a/sysdeps/unix/sysv/linux/arm/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 td_init F
GLIBC_2.4 td_log F
GLIBC_2.4 td_symbol_list F
diff --git a/sysdeps/unix/sysv/linux/arm/libutil.abilist b/sysdeps/unix/sysv/linux/arm/libutil.abilist
index 0b4f746094..cc1420e68c 100644
--- a/sysdeps/unix/sysv/linux/arm/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 forkpty F
GLIBC_2.4 login F
GLIBC_2.4 login_tty F
diff --git a/sysdeps/unix/sysv/linux/arm/localplt.data b/sysdeps/unix/sysv/linux/arm/localplt.data
index 4301703553..7bd541c28a 100644
--- a/sysdeps/unix/sysv/linux/arm/localplt.data
+++ b/sysdeps/unix/sysv/linux/arm/localplt.data
@@ -5,14 +5,17 @@ libc.so: memalign
libc.so: raise
libc.so: realloc
libm.so: matherr
-libpthread.so: __errno_location
libpthread.so: raise
-# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
-# internally to allocate aligned TLS storage. The other malloc family of
-# functions are expected to allow user symbol interposition.
+# The dynamic loader needs __tls_get_addr for TLS.
ld.so: __tls_get_addr
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/arm/makecontext.c b/sysdeps/unix/sysv/linux/arm/makecontext.c
index a19fc69076..92781fe3cf 100644
--- a/sysdeps/unix/sysv/linux/arm/makecontext.c
+++ b/sysdeps/unix/sysv/linux/arm/makecontext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/mmap.c b/sysdeps/unix/sysv/linux/arm/mmap.c
deleted file mode 100644
index c5524a4aff..0000000000
--- a/sysdeps/unix/sysv/linux/arm/mmap.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Copyright (C) 2015-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 <sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c>
diff --git a/sysdeps/unix/sysv/linux/arm/msgctl.c b/sysdeps/unix/sysv/linux/arm/msgctl.c
deleted file mode 100644
index 83c6744545..0000000000
--- a/sysdeps/unix/sysv/linux/arm/msgctl.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/msg.h>
-#include <ipc_priv.h>
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-
-int
-__new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
-{
- return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, buf);
-}
-
-#include <shlib-compat.h>
-versioned_symbol (libc, __new_msgctl, msgctl, GLIBC_2_2);
diff --git a/sysdeps/unix/sysv/linux/arm/oldgetrlimit.c b/sysdeps/unix/sysv/linux/arm/oldgetrlimit.c
deleted file mode 100644
index 6e25b021ab..0000000000
--- a/sysdeps/unix/sysv/linux/arm/oldgetrlimit.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty. */
diff --git a/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c
deleted file mode 100644
index 4c27e957bf..0000000000
--- a/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/oldsetrlimit.c b/sysdeps/unix/sysv/linux/arm/oldsetrlimit.c
deleted file mode 100644
index 6e25b021ab..0000000000
--- a/sysdeps/unix/sysv/linux/arm/oldsetrlimit.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty. */
diff --git a/sysdeps/unix/sysv/linux/arm/posix_fadvise.c b/sysdeps/unix/sysv/linux/arm/posix_fadvise.c
deleted file mode 100644
index 616e381c85..0000000000
--- a/sysdeps/unix/sysv/linux/arm/posix_fadvise.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2005-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>
-
-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_fadvise (int fd, off_t offset, off_t len, int advise)
-{
- /* ARM only has a syscall for fadvise64_64. */
- return __posix_fadvise64_l64 (fd, offset, len, advise);
-}
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/pread.c b/sysdeps/unix/sysv/linux/arm/pread.c
deleted file mode 100644
index 8c9b878978..0000000000
--- a/sysdeps/unix/sysv/linux/arm/pread.c
+++ /dev/null
@@ -1,36 +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/>. */
-
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
- /* In the ARM EABI, 64-bit values are aligned to even/odd register
- pairs for syscalls. */
- return SYSCALL_CANCEL (pread64, fd, buf, count, 0,
- __LONG_LONG_PAIR (offset >> 31, offset));
-}
-
-strong_alias (__libc_pread, __pread)
-weak_alias (__libc_pread, pread)
diff --git a/sysdeps/unix/sysv/linux/arm/pread64.c b/sysdeps/unix/sysv/linux/arm/pread64.c
deleted file mode 100644
index 3364b6a829..0000000000
--- a/sysdeps/unix/sysv/linux/arm/pread64.c
+++ /dev/null
@@ -1,37 +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/>. */
-
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
- /* In the ARM EABI, 64-bit values are aligned to even/odd register
- pairs for syscalls. */
- return SYSCALL_CANCEL (pread64, fd, buf, count, 0,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
-}
-
-weak_alias (__libc_pread64, __pread64)
-weak_alias (__libc_pread64, pread64)
diff --git a/sysdeps/unix/sysv/linux/arm/profil-counter.h b/sysdeps/unix/sysv/linux/arm/profil-counter.h
index 5d9d6b4c24..120e07ae21 100644
--- a/sysdeps/unix/sysv/linux/arm/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/arm/profil-counter.h
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Linux/ARM version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/pwrite.c b/sysdeps/unix/sysv/linux/arm/pwrite.c
deleted file mode 100644
index d4132f1c2a..0000000000
--- a/sysdeps/unix/sysv/linux/arm/pwrite.c
+++ /dev/null
@@ -1,36 +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/>. */
-
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
- /* In the ARM EABI, 64-bit values are aligned to even/odd register
- pairs for syscalls. */
- return SYSCALL_CANCEL (pwrite64, fd, buf, count, 0,
- __LONG_LONG_PAIR (offset >> 31, offset));
-}
-
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__libc_pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/arm/pwrite64.c b/sysdeps/unix/sysv/linux/arm/pwrite64.c
deleted file mode 100644
index 1b70560724..0000000000
--- a/sysdeps/unix/sysv/linux/arm/pwrite64.c
+++ /dev/null
@@ -1,38 +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/>. */
-
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
- /* In the ARM EABI, 64-bit values are aligned to even/odd register
- pairs for syscalls. */
- return SYSCALL_CANCEL (pwrite64, fd, buf, count, 0,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
-}
-
-weak_alias (__libc_pwrite64, __pwrite64)
-libc_hidden_weak (__pwrite64)
-weak_alias (__libc_pwrite64, pwrite64)
diff --git a/sysdeps/unix/sysv/linux/arm/readahead.c b/sysdeps/unix/sysv/linux/arm/readahead.c
deleted file mode 100644
index 9824e6ff81..0000000000
--- a/sysdeps/unix/sysv/linux/arm/readahead.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Provide kernel hint to read ahead.
- Copyright (C) 2002-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 <endian.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-
-ssize_t
-__readahead (int fd, off64_t offset, size_t count)
-{
- return INLINE_SYSCALL (readahead, 5, fd, 0,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)),
- count);
-}
-
-weak_alias (__readahead, readahead)
diff --git a/sysdeps/unix/sysv/linux/arm/readdir64.c b/sysdeps/unix/sysv/linux/arm/readdir64.c
deleted file mode 100644
index 2ea26dd409..0000000000
--- a/sysdeps/unix/sysv/linux/arm/readdir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/readdir64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/readdir64_r.c b/sysdeps/unix/sysv/linux/arm/readdir64_r.c
deleted file mode 100644
index 9f54f897e3..0000000000
--- a/sysdeps/unix/sysv/linux/arm/readdir64_r.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c>
diff --git a/sysdeps/unix/sysv/linux/arm/readelflib.c b/sysdeps/unix/sysv/linux/arm/readelflib.c
index e6ae72e08d..a493e3a07f 100644
--- a/sysdeps/unix/sysv/linux/arm/readelflib.c
+++ b/sysdeps/unix/sysv/linux/arm/readelflib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
Jakub Jelinek <jakub@redhat.com>, 1999.
diff --git a/sysdeps/unix/sysv/linux/arm/register-dump.h b/sysdeps/unix/sysv/linux/arm/register-dump.h
index e9b491fdae..5f85802817 100644
--- a/sysdeps/unix/sysv/linux/arm/register-dump.h
+++ b/sysdeps/unix/sysv/linux/arm/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <pb@nexus.co.uk>, 1998.
@@ -44,7 +44,7 @@ hexvalue (unsigned long int value, char *buf, size_t len)
}
static void
-register_dump (int fd, const struct ucontext *ctx)
+register_dump (int fd, const ucontext_t *ctx)
{
char regs[21][8];
struct iovec iov[97];
diff --git a/sysdeps/unix/sysv/linux/arm/scandir64.c b/sysdeps/unix/sysv/linux/arm/scandir64.c
deleted file mode 100644
index 506fd8877c..0000000000
--- a/sysdeps/unix/sysv/linux/arm/scandir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/scandir64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/semctl.c b/sysdeps/unix/sysv/linux/arm/semctl.c
deleted file mode 100644
index 79d9d3e0db..0000000000
--- a/sysdeps/unix/sysv/linux/arm/semctl.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <stdarg.h>
-#include <sys/sem.h>
-#include <ipc_priv.h>
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-
-/* Define a `union semun' suitable for Linux here. */
-union semun
-{
- int val; /* value for SETVAL */
- struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
- unsigned short int *array; /* array for GETALL & SETALL */
- struct seminfo *__buf; /* buffer for IPC_INFO */
-};
-
-int
-__new_semctl (int semid, int semnum, int cmd, ...)
-{
- union semun arg;
- va_list ap;
-
- va_start (ap, cmd);
-
- /* Get the argument. */
- arg = va_arg (ap, union semun);
-
- va_end (ap);
-
- return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
- arg.array);
-}
-
-#include <shlib-compat.h>
-versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);
diff --git a/sysdeps/unix/sysv/linux/arm/setcontext.S b/sysdeps/unix/sysv/linux/arm/setcontext.S
index 603e508858..7a0cd48090 100644
--- a/sysdeps/unix/sysv/linux/arm/setcontext.S
+++ b/sysdeps/unix/sysv/linux/arm/setcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -86,12 +86,19 @@ weak_alias(__setcontext, setcontext)
/* Called when a makecontext() context returns. Start the
context in R4 or fall through to exit(). */
+ /* Unwind descriptors are looked up based on PC - 2, so we have to
+ make sure to mark the instruction preceding the __startcontext
+ label as .cantunwind. */
+ .fnstart
+ .cantunwind
+ nop
ENTRY(__startcontext)
movs r0, r4
bne PLTJMP(__setcontext)
@ New context was 0 - exit
b PLTJMP(HIDDEN_JUMPTARGET(exit))
+ .fnend
END(__startcontext)
#ifdef PIC
diff --git a/sysdeps/unix/sysv/linux/arm/setegid.c b/sysdeps/unix/sysv/linux/arm/setegid.c
deleted file mode 100644
index 2e3a54c893..0000000000
--- a/sysdeps/unix/sysv/linux/arm/setegid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setegid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/seteuid.c b/sysdeps/unix/sysv/linux/arm/seteuid.c
deleted file mode 100644
index 18e41d08c1..0000000000
--- a/sysdeps/unix/sysv/linux/arm/seteuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/seteuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setgid.c b/sysdeps/unix/sysv/linux/arm/setgid.c
deleted file mode 100644
index 377021d9ec..0000000000
--- a/sysdeps/unix/sysv/linux/arm/setgid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setgid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setgroups.c b/sysdeps/unix/sysv/linux/arm/setgroups.c
deleted file mode 100644
index 0e7086278f..0000000000
--- a/sysdeps/unix/sysv/linux/arm/setgroups.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* We also have to rewrite the kernel gid_t to the user land type. */
-#include <sysdeps/unix/sysv/linux/i386/setgroups.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setregid.c b/sysdeps/unix/sysv/linux/arm/setregid.c
deleted file mode 100644
index 99c57ad20f..0000000000
--- a/sysdeps/unix/sysv/linux/arm/setregid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setregid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setresgid.c b/sysdeps/unix/sysv/linux/arm/setresgid.c
deleted file mode 100644
index daca1a4833..0000000000
--- a/sysdeps/unix/sysv/linux/arm/setresgid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setresgid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setresuid.c b/sysdeps/unix/sysv/linux/arm/setresuid.c
deleted file mode 100644
index 3aeabe9ad7..0000000000
--- a/sysdeps/unix/sysv/linux/arm/setresuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setresuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setreuid.c b/sysdeps/unix/sysv/linux/arm/setreuid.c
deleted file mode 100644
index 8ad61226e9..0000000000
--- a/sysdeps/unix/sysv/linux/arm/setreuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setuid.c b/sysdeps/unix/sysv/linux/arm/setuid.c
deleted file mode 100644
index de394379be..0000000000
--- a/sysdeps/unix/sysv/linux/arm/setuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/shmctl.c b/sysdeps/unix/sysv/linux/arm/shmctl.c
deleted file mode 100644
index 23c4b8d0e1..0000000000
--- a/sysdeps/unix/sysv/linux/arm/shmctl.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/shm.h>
-#include <ipc_priv.h>
-#include <sysdep.h>
-#include <sys/syscall.h>
-#include <bits/wordsize.h>
-
-
-int
-__new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
-{
- return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, buf);
-}
-
-#include <shlib-compat.h>
-versioned_symbol (libc, __new_shmctl, shmctl, GLIBC_2_2);
diff --git a/sysdeps/unix/sysv/linux/arm/sigaction.c b/sysdeps/unix/sysv/linux/arm/sigaction.c
index b84abed975..c828250815 100644
--- a/sysdeps/unix/sysv/linux/arm/sigaction.c
+++ b/sysdeps/unix/sysv/linux/arm/sigaction.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software 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,70 +15,25 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
-#include <string.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* The difference here is that the sigaction structure used in the
- kernel is not the same as we use in the libc. Therefore we must
- translate it here. */
-#include <kernel_sigaction.h>
-
#define SA_RESTORER 0x04000000
extern void __default_sa_restorer (void);
extern void __default_rt_sa_restorer (void);
-/* When RT signals are in use we need to use a different return stub. */
-#define choose_restorer(flags) \
- (flags & SA_SIGINFO) ? __default_rt_sa_restorer \
- : __default_sa_restorer
-
-/* If ACT is not NULL, change the action for SIG to *ACT.
- If OACT is not NULL, put the old action for SIG in *OACT. */
-int
-__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
-{
- int result;
-
- struct kernel_sigaction kact, koact;
-
- if (act)
- {
- kact.k_sa_handler = act->sa_handler;
- memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
- kact.sa_flags = act->sa_flags;
-#ifdef HAVE_SA_RESTORER
- if (kact.sa_flags & SA_RESTORER)
- kact.sa_restorer = act->sa_restorer;
- else
- {
- kact.sa_restorer = choose_restorer (kact.sa_flags);
- kact.sa_flags |= SA_RESTORER;
- }
-#endif
- }
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- result = INLINE_SYSCALL (rt_sigaction, 4, sig,
- act ? &kact : NULL,
- oact ? &koact : NULL, _NSIG / 8);
-
- if (oact && result >= 0)
- {
- oact->sa_handler = koact.k_sa_handler;
- memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
- oact->sa_flags = koact.sa_flags;
-#ifdef HAVE_SA_RESTORER
- oact->sa_restorer = koact.sa_restorer;
-#endif
- }
- return result;
-}
-libc_hidden_def (__libc_sigaction)
-
-#include <nptl/sigaction.c>
+#define SET_SA_RESTORER(kact, act) \
+ ({ \
+ if ((kact)->sa_flags & SA_RESTORER) \
+ (kact)->sa_restorer = (act)->sa_restorer; \
+ else \
+ { \
+ (kact)->sa_restorer = ((kact)->sa_flags & SA_SIGINFO) \
+ ? __default_rt_sa_restorer \
+ : __default_sa_restorer; \
+ (kact)->sa_flags |= SA_RESTORER; \
+ } \
+ })
+
+#define RESET_SA_RESTORER(act, kact) \
+ (act)->sa_restorer = (kact)->sa_restorer;
+
+#include <sysdeps/unix/sysv/linux/sigaction.c>
diff --git a/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h b/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
index 315281ff7f..b8e79c2c4c 100644
--- a/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>, 1999.
@@ -18,22 +18,13 @@
#include <sys/ucontext.h>
-#define SIGCONTEXT siginfo_t *_si, struct ucontext *
-#define SIGCONTEXT_EXTRA_ARGS _si,
+#define SIGCONTEXT siginfo_t *_si, ucontext_t *
/* The sigcontext structure changed between 2.0 and 2.1 kernels. On any
modern system we should be able to assume that the "new" format will be
in use. */
#define GET_PC(ctx) ((void *) (ctx)->uc_mcontext.arm_pc)
-#define GET_FRAME(ctx) ADVANCE_STACK_FRAME ((void *) ctx->uc_mcontext.arm_fp)
-#define GET_STACK(ctx) ((void *) (ctx)->uc_mcontext.arm_sp)
-
-#define ADVANCE_STACK_FRAME(frm) \
- ((struct layout *)frm - 1)
-
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
/* There is no reliable way to get the sigcontext unless we use a
three-argument signal handler. */
diff --git a/sysdeps/unix/sysv/linux/arm/sigrestorer.S b/sysdeps/unix/sysv/linux/arm/sigrestorer.S
index 48e843a286..24a9c93f42 100644
--- a/sysdeps/unix/sysv/linux/arm/sigrestorer.S
+++ b/sysdeps/unix/sysv/linux/arm/sigrestorer.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/swapcontext.S b/sysdeps/unix/sysv/linux/arm/swapcontext.S
index fccf72e5ee..b42ca2a1ec 100644
--- a/sysdeps/unix/sysv/linux/arm/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/arm/swapcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/sys/elf.h b/sysdeps/unix/sysv/linux/arm/sys/elf.h
index 430bd1c7ef..8faa721210 100644
--- a/sysdeps/unix/sysv/linux/arm/sys/elf.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/elf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/sys/io.h b/sysdeps/unix/sysv/linux/arm/sys/io.h
index 9b585b9503..152e8f8efa 100644
--- a/sysdeps/unix/sysv/linux/arm/sys/io.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/io.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/sys/procfs.h b/sysdeps/unix/sysv/linux/arm/sys/procfs.h
index 73da7f1ee0..6f177af923 100644
--- a/sysdeps/unix/sysv/linux/arm/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/sys/ptrace.h b/sysdeps/unix/sysv/linux/arm/sys/ptrace.h
new file mode 100644
index 0000000000..bc54a1e5e2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/sys/ptrace.h
@@ -0,0 +1,208 @@
+/* `ptrace' debugger support interface. Linux/ARM version.
+ Copyright (C) 1996-2018 Free Software 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
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H 1
+
+#include <features.h>
+#include <bits/types.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.' */
+enum __ptrace_request
+{
+ /* Indicate that the process making this request should be traced.
+ All signals received by this process can be intercepted by its
+ parent, and its parent can use the other `ptrace' requests. */
+ PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+ /* Return the word in the process's text space at address ADDR. */
+ PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+ /* Return the word in the process's data space at address ADDR. */
+ PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+ /* Return the word in the process's user area at offset ADDR. */
+ PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+ /* Write the word DATA into the process's text space at address ADDR. */
+ PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+ /* Write the word DATA into the process's data space at address ADDR. */
+ PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+ /* Write the word DATA into the process's user area at offset ADDR. */
+ PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+ /* Continue the process. */
+ PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+ /* Kill the process. */
+ PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+ /* Single step the process. */
+ PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+ /* Get all general purpose registers used by a process. */
+ PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+ /* Set all general purpose registers used by a process. */
+ PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+ /* Get all floating point registers used by a process. */
+ PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+ /* Set all floating point registers used by a process. */
+ PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+ /* Attach to a process that is already running. */
+ PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+ /* Detach from a process attached to with PTRACE_ATTACH. */
+ PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+ /* Get the iWMMXt state of a process. */
+ PTRACE_GETWMMXREGS = 18,
+#define PT_GETWMMXREGS PTRACE_GETWMMXREGS
+
+ /* Set the iWMMXt state of a process. */
+ PTRACE_SETWMMXREGS = 19,
+#define PT_SETWMMXREGS PTRACE_SETWMMXREGS
+
+ /* Get the thread pointer of a process. */
+ PTRACE_GET_THREAD_AREA = 22,
+#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
+
+ /* Change the syscall number of a process. */
+ PTRACE_SET_SYSCALL = 23,
+#define PT_SET_SYSCALL PTRACE_SET_SYSCALL
+
+ /* Continue and stop at the next entry to or return from syscall. */
+ PTRACE_SYSCALL = 24,
+#define PT_SYSCALL PTRACE_SYSCALL
+
+ /* Get the Crunch state of a process. */
+ PTRACE_GETCRUNCHREGS = 25,
+#define PT_GETCRUNCHREGS PTRACE_GETCRUNCHREGS
+
+ /* Set the Crunch state of a process. */
+ PTRACE_SETCRUNCHREGS = 26,
+#define PT_SETCRUNCHREGS PTRACE_SETCRUNCHREGS
+
+ /* Get all VFP registers used by a process. */
+ PTRACE_GETVFPREGS = 27,
+#define PT_GETVFPREGS PTRACE_GETVFPREGS
+
+ /* Set all VFP registers used by a process. */
+ PTRACE_SETVFPREGS = 28,
+#define PT_SETVFPREGS PTRACE_SETVFPREGS
+
+ /* Get all hardware breakpoint registers. */
+ PTRACE_GETHBPREGS = 29,
+#define PT_GETHBPREGS PTRACE_GETHBPREGS
+
+ /* Set all hardware breakpoint registers. */
+ PTRACE_SETHBPREGS = 30,
+#define PT_SETHBPREGS PTRACE_SETHBPREGS
+
+ /* Get the ELF fdpic loadmap address. */
+ PTRACE_GETFDPIC = 31,
+#define PT_GETFDPIC PTRACE_GETFDPIC
+
+ /* Set ptrace filter options. */
+ PTRACE_SETOPTIONS = 0x4200,
+#define PT_SETOPTIONS PTRACE_SETOPTIONS
+
+ /* Get last ptrace message. */
+ PTRACE_GETEVENTMSG = 0x4201,
+#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
+
+ /* Get siginfo for process. */
+ PTRACE_GETSIGINFO = 0x4202,
+#define PT_GETSIGINFO PTRACE_GETSIGINFO
+
+ /* Set new siginfo for process. */
+ PTRACE_SETSIGINFO = 0x4203,
+#define PT_SETSIGINFO PTRACE_SETSIGINFO
+
+ /* Get register content. */
+ PTRACE_GETREGSET = 0x4204,
+#define PTRACE_GETREGSET PTRACE_GETREGSET
+
+ /* Set register content. */
+ PTRACE_SETREGSET = 0x4205,
+#define PTRACE_SETREGSET PTRACE_SETREGSET
+
+ /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
+ signal or group stop state. */
+ PTRACE_SEIZE = 0x4206,
+#define PTRACE_SEIZE PTRACE_SEIZE
+
+ /* Trap seized tracee. */
+ PTRACE_INTERRUPT = 0x4207,
+#define PTRACE_INTERRUPT PTRACE_INTERRUPT
+
+ /* Wait for next group event. */
+ PTRACE_LISTEN = 0x4208,
+#define PTRACE_LISTEN PTRACE_LISTEN
+
+ /* Retrieve siginfo_t structures without removing signals from a queue. */
+ PTRACE_PEEKSIGINFO = 0x4209,
+#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+
+ /* Get the mask of blocked signals. */
+ PTRACE_GETSIGMASK = 0x420a,
+#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
+
+ /* Change the mask of blocked signals. */
+ PTRACE_SETSIGMASK = 0x420b,
+#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
+
+ /* Get seccomp BPF filters. */
+ PTRACE_SECCOMP_GET_FILTER = 0x420c,
+#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+ /* Get seccomp BPF filter metadata. */
+ PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
+};
+
+
+#include <bits/ptrace-shared.h>
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/sysdeps/unix/sysv/linux/arm/sys/ucontext.h b/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
index f32eadc099..831d0293f1 100644
--- a/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,16 +21,22 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
-#include <bits/sigcontext.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
+#ifdef __USE_MISC
typedef int greg_t;
/* Number of general registers. */
-#define NGREG 18
+# define NGREG 18
/* Container for all general registers. */
typedef greg_t gregset_t[NGREG];
@@ -39,37 +45,37 @@ typedef greg_t gregset_t[NGREG];
enum
{
REG_R0 = 0,
-#define REG_R0 REG_R0
+# define REG_R0 REG_R0
REG_R1 = 1,
-#define REG_R1 REG_R1
+# define REG_R1 REG_R1
REG_R2 = 2,
-#define REG_R2 REG_R2
+# define REG_R2 REG_R2
REG_R3 = 3,
-#define REG_R3 REG_R3
+# define REG_R3 REG_R3
REG_R4 = 4,
-#define REG_R4 REG_R4
+# define REG_R4 REG_R4
REG_R5 = 5,
-#define REG_R5 REG_R5
+# define REG_R5 REG_R5
REG_R6 = 6,
-#define REG_R6 REG_R6
+# define REG_R6 REG_R6
REG_R7 = 7,
-#define REG_R7 REG_R7
+# define REG_R7 REG_R7
REG_R8 = 8,
-#define REG_R8 REG_R8
+# define REG_R8 REG_R8
REG_R9 = 9,
-#define REG_R9 REG_R9
+# define REG_R9 REG_R9
REG_R10 = 10,
-#define REG_R10 REG_R10
+# define REG_R10 REG_R10
REG_R11 = 11,
-#define REG_R11 REG_R11
+# define REG_R11 REG_R11
REG_R12 = 12,
-#define REG_R12 REG_R12
+# define REG_R12 REG_R12
REG_R13 = 13,
-#define REG_R13 REG_R13
+# define REG_R13 REG_R13
REG_R14 = 14,
-#define REG_R14 REG_R14
+# define REG_R14 REG_R14
REG_R15 = 15
-#define REG_R15 REG_R15
+# define REG_R15 REG_R15
};
struct _libc_fpstate
@@ -91,22 +97,48 @@ struct _libc_fpstate
};
/* Structure to describe FPU registers. */
typedef struct _libc_fpstate fpregset_t;
+#endif
/* Context to describe whole processor state. This only describes
the core registers; coprocessor registers get saved elsewhere
(e.g. in uc_regspace, or somewhere unspecified on the stack
during non-RT signal handlers). */
-typedef struct sigcontext mcontext_t;
+typedef struct
+ {
+ unsigned long int __ctx(trap_no);
+ unsigned long int __ctx(error_code);
+ unsigned long int __ctx(oldmask);
+ unsigned long int __ctx(arm_r0);
+ unsigned long int __ctx(arm_r1);
+ unsigned long int __ctx(arm_r2);
+ unsigned long int __ctx(arm_r3);
+ unsigned long int __ctx(arm_r4);
+ unsigned long int __ctx(arm_r5);
+ unsigned long int __ctx(arm_r6);
+ unsigned long int __ctx(arm_r7);
+ unsigned long int __ctx(arm_r8);
+ unsigned long int __ctx(arm_r9);
+ unsigned long int __ctx(arm_r10);
+ unsigned long int __ctx(arm_fp);
+ unsigned long int __ctx(arm_ip);
+ unsigned long int __ctx(arm_sp);
+ unsigned long int __ctx(arm_lr);
+ unsigned long int __ctx(arm_pc);
+ unsigned long int __ctx(arm_cpsr);
+ unsigned long int __ctx(fault_address);
+ } mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long uc_flags;
- struct ucontext *uc_link;
+ unsigned long __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
- unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
+ sigset_t uc_sigmask;
+ unsigned long __ctx(uc_regspace)[128] __attribute__((__aligned__(8)));
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/arm/sys/user.h b/sysdeps/unix/sysv/linux/arm/sys/user.h
index 8c28608cbe..bc520fab65 100644
--- a/sysdeps/unix/sysv/linux/arm/sys/user.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/syscall.S b/sysdeps/unix/sysv/linux/arm/syscall.S
index d0bec6d6c9..d531910855 100644
--- a/sysdeps/unix/sysv/linux/arm/syscall.S
+++ b/sysdeps/unix/sysv/linux/arm/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list
index c06954f824..13441f7eb4 100644
--- a/sysdeps/unix/sysv/linux/arm/syscalls.list
+++ b/sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -21,32 +21,12 @@ fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
personality EXTRA personality Ei:i __personality personality
-# Semaphore and shm system calls. msgctl, shmctl, and semctl have C
-# wrappers (to set __IPC_64).
-msgget - msgget i:ii __msgget msgget
-msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
-msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
-shmat - shmat i:ipi __shmat shmat
-shmdt - shmdt i:s __shmdt shmdt
-shmget - shmget i:iii __shmget shmget
-semop - semop i:ipi __semop semop
-semtimedop - semtimedop i:ipip semtimedop
-semget - semget i:iii __semget semget
-
# proper socket implementations:
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
-connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
-recv - recv Ci:ibni __libc_recv __recv recv
-recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom
-recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg
-send - send Ci:ibni __libc_send __send send
-sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg
-sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h b/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
deleted file mode 100644
index e24c099288..0000000000
--- a/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
+++ /dev/null
@@ -1,241 +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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-/* NOTE: We do mark syscalls with unwind annotations, for the benefit of
- cancellation; but they're really only accurate at the point of the
- syscall. The ARM unwind directives are not rich enough without adding
- a custom personality function. */
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY (__##syscall_name##_nocancel); \
- CFI_SECTIONS; \
- DO_CALL (syscall_name, args); \
- cmn r0, $4096; \
- PSEUDO_RET; \
- END (__##syscall_name##_nocancel); \
- ENTRY (name); \
- SINGLE_THREAD_P; \
- DOARGS_##args; \
- bne .Lpseudo_cancel; \
- cfi_remember_state; \
- ldr r7, =SYS_ify (syscall_name); \
- swi 0x0; \
- UNDOARGS_##args; \
- cmn r0, $4096; \
- PSEUDO_RET; \
- cfi_restore_state; \
- .Lpseudo_cancel: \
- .fnstart; /* matched by the .fnend in UNDOARGS below. */ \
- DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
- CENABLE; \
- mov ip, r0; /* put mask in safe place. */ \
- UNDOCARGS_##args; /* restore syscall args. */ \
- ldr r7, =SYS_ify (syscall_name); \
- swi 0x0; /* do the call. */ \
- mov r7, r0; /* save syscall return value. */ \
- mov r0, ip; /* get mask back. */ \
- CDISABLE; \
- mov r0, r7; /* retrieve return value. */ \
- RESTORE_LR_##args; \
- UNDOARGS_##args; \
- cmn r0, $4096
-
-/* DOARGS pushes eight bytes on the stack for five arguments, twelve bytes for
- six arguments, and four bytes for fewer. In order to preserve doubleword
- alignment, sometimes we must save an extra register. */
-
-# define RESTART_UNWIND \
- .fnend; \
- .fnstart; \
- .save {r7}; \
- .save {lr}
-
-# define DOCARGS_0 \
- .save {r7}; \
- push {lr}; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
- .save {lr}
-# define UNDOCARGS_0
-# define RESTORE_LR_0 \
- pop {lr}; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (lr)
-
-# define DOCARGS_1 \
- .save {r7}; \
- push {r0, r1, lr}; \
- cfi_adjust_cfa_offset (12); \
- cfi_rel_offset (lr, 8); \
- .save {lr}; \
- .pad #8
-# define UNDOCARGS_1 \
- ldr r0, [sp], #8; \
- cfi_adjust_cfa_offset (-8); \
- RESTART_UNWIND
-# define RESTORE_LR_1 \
- RESTORE_LR_0
-
-# define DOCARGS_2 \
- .save {r7}; \
- push {r0, r1, lr}; \
- cfi_adjust_cfa_offset (12); \
- cfi_rel_offset (lr, 8); \
- .save {lr}; \
- .pad #8
-# define UNDOCARGS_2 \
- pop {r0, r1}; \
- cfi_adjust_cfa_offset (-8); \
- RESTART_UNWIND
-# define RESTORE_LR_2 \
- RESTORE_LR_0
-
-# define DOCARGS_3 \
- .save {r7}; \
- push {r0, r1, r2, r3, lr}; \
- cfi_adjust_cfa_offset (20); \
- cfi_rel_offset (lr, 16); \
- .save {lr}; \
- .pad #16
-# define UNDOCARGS_3 \
- pop {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- RESTART_UNWIND
-# define RESTORE_LR_3 \
- RESTORE_LR_0
-
-# define DOCARGS_4 \
- .save {r7}; \
- push {r0, r1, r2, r3, lr}; \
- cfi_adjust_cfa_offset (20); \
- cfi_rel_offset (lr, 16); \
- .save {lr}; \
- .pad #16
-# define UNDOCARGS_4 \
- pop {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- RESTART_UNWIND
-# define RESTORE_LR_4 \
- RESTORE_LR_0
-
-/* r4 is only stmfd'ed for correct stack alignment. */
-# define DOCARGS_5 \
- .save {r4, r7}; \
- push {r0, r1, r2, r3, r4, lr}; \
- cfi_adjust_cfa_offset (24); \
- cfi_rel_offset (lr, 20); \
- .save {lr}; \
- .pad #20
-# define UNDOCARGS_5 \
- pop {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- .fnend; \
- .fnstart; \
- .save {r4, r7}; \
- .save {lr}; \
- .pad #4
-# define RESTORE_LR_5 \
- pop {r4, lr}; \
- cfi_adjust_cfa_offset (-8); \
- /* r4 will be marked as restored later. */ \
- cfi_restore (lr)
-
-# define DOCARGS_6 \
- .save {r4, r5, r7}; \
- push {r0, r1, r2, r3, lr}; \
- cfi_adjust_cfa_offset (20); \
- cfi_rel_offset (lr, 16); \
- .save {lr}; \
- .pad #16
-# define UNDOCARGS_6 \
- pop {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- .fnend; \
- .fnstart; \
- .save {r4, r5, r7}; \
- .save {lr};
-# define RESTORE_LR_6 \
- RESTORE_LR_0
-
-# if IS_IN (libpthread)
-# define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
-# define CDISABLE bl PLTJMP(__pthread_disable_asynccancel)
-# define __local_multiple_threads __pthread_multiple_threads
-# elif IS_IN (libc)
-# define CENABLE bl PLTJMP(__libc_enable_asynccancel)
-# define CDISABLE bl PLTJMP(__libc_disable_asynccancel)
-# define __local_multiple_threads __libc_multiple_threads
-# elif IS_IN (librt)
-# define CENABLE bl PLTJMP(__librt_enable_asynccancel)
-# define CDISABLE bl PLTJMP(__librt_disable_asynccancel)
-# else
-# error Unsupported library
-# endif
-
-# if IS_IN (libpthread) || IS_IN (libc)
-# ifndef __ASSEMBLER__
-extern int __local_multiple_threads attribute_hidden;
-# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
-# else
-# define SINGLE_THREAD_P \
- LDST_PCREL(ldr, ip, ip, __local_multiple_threads); \
- teq ip, #0
-# endif
-# else
-/* There is no __local_multiple_threads for librt, so use the TCB. */
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P \
- push {r0, lr}; \
- cfi_adjust_cfa_offset (8); \
- cfi_rel_offset (lr, 4); \
- GET_TLS (lr); \
- NEGOFF_ADJ_BASE (r0, MULTIPLE_THREADS_OFFSET); \
- ldr ip, NEGOFF_OFF1 (r0, MULTIPLE_THREADS_OFFSET); \
- pop {r0, lr}; \
- cfi_adjust_cfa_offset (-8); \
- cfi_restore (lr); \
- teq ip, #0
-# endif
-# endif
-
-#elif !defined __ASSEMBLER__
-
-/* For rtld, et cetera. */
-# define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.S b/sysdeps/unix/sysv/linux/arm/sysdep.S
index 65e0de3070..1ee8716c10 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep.S
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h
index 3986547a60..174c530412 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
ARM changes by Philip Blundell, <pjb27@cam.ac.uk>, May 1997.
@@ -437,6 +437,8 @@ __local_syscall_error: \
#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
INTERNAL_SYSCALL_RAW (number, err, nr, args)
+#define SINGLE_THREAD_BY_GLOBAL 1
+
#endif /* __ASSEMBLER__ */
#endif /* linux/arm/sysdep.h */
diff --git a/sysdeps/unix/sysv/linux/arm/tls.h b/sysdeps/unix/sysv/linux/arm/tls.h
index e0eac67c2c..c910111d2c 100644
--- a/sysdeps/unix/sysv/linux/arm/tls.h
+++ b/sysdeps/unix/sysv/linux/arm/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. ARM/Linux version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/arm/truncate64.c b/sysdeps/unix/sysv/linux/arm/truncate64.c
deleted file mode 100644
index 28563afb94..0000000000
--- a/sysdeps/unix/sysv/linux/arm/truncate64.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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 <sys/types.h>
-#include <endian.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Truncate the file FD refers to to LENGTH bytes. */
-int
-truncate64 (const char *path, off64_t length)
-{
- unsigned int low = length & 0xffffffff;
- unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (truncate64, 4, path, 0,
- __LONG_LONG_PAIR (high, low));
- return result;
-}
diff --git a/sysdeps/unix/sysv/linux/arm/umount.c b/sysdeps/unix/sysv/linux/arm/umount.c
deleted file mode 100644
index 133ca11a39..0000000000
--- a/sysdeps/unix/sysv/linux/arm/umount.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Huggins-Daines <dhd@debian.org>, 2000.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-/* Since we don't have an oldumount system call, do what the kernel
- does down here. */
-
-extern long int __umount2 (const char *name, int flags);
-
-long int
-__umount (const char *name)
-{
- return __umount2 (name, 0);
-}
-
-weak_alias (__umount, umount);
diff --git a/sysdeps/unix/sysv/linux/arm/versionsort64.c b/sysdeps/unix/sysv/linux/arm/versionsort64.c
deleted file mode 100644
index 144b691e56..0000000000
--- a/sysdeps/unix/sysv/linux/arm/versionsort64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/versionsort64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/vfork.S b/sysdeps/unix/sysv/linux/arm/vfork.S
index 500f5ca4be..53fae8aa50 100644
--- a/sysdeps/unix/sysv/linux/arm/vfork.S
+++ b/sysdeps/unix/sysv/linux/arm/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>.
@@ -28,16 +28,6 @@
and the process ID of the new process to the old process. */
ENTRY (__vfork)
- /* Save the PID value. */
- GET_TLS (r2)
- NEGOFF_ADJ_BASE2 (r2, r0, PID_OFFSET) /* Save the TLS addr in r2. */
- ldr r3, NEGOFF_OFF1 (r2, PID_OFFSET) /* Load the saved PID. */
- rsbs r0, r3, #0 /* Negate it, and test for zero. */
- /* Use 0x80000000 if it was 0. See raise.c for how this is used. */
- it eq
- moveq r0, #0x80000000
- str r0, NEGOFF_OFF1 (r2, PID_OFFSET) /* Store the temp PID. */
-
/* The DO_CALL macro saves r7 on the stack, to enable generation
of ARM unwind info. Since the stack is initially shared between
parent and child of vfork, that saved value could be corrupted.
@@ -57,11 +47,6 @@ ENTRY (__vfork)
mov r7, ip
cfi_restore (r7)
- /* Restore the old PID value in the parent. */
- cmp r0, #0 /* If we are the parent... */
- it ne
- strne r3, NEGOFF_OFF1 (r2, PID_OFFSET) /* restore the saved PID. */
-
cmn a1, #4096
it cc
RETINSTR(cc, lr)
diff --git a/sysdeps/unix/sysv/linux/bind.c b/sysdeps/unix/sysv/linux/bind.c
index 05848fdec3..98c35bcd63 100644
--- a/sysdeps/unix/sysv/linux/bind.c
+++ b/sysdeps/unix/sysv/linux/bind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/dirent.h b/sysdeps/unix/sysv/linux/bits/dirent.h
index 31b1961598..f312720547 100644
--- a/sysdeps/unix/sysv/linux/bits/dirent.h
+++ b/sysdeps/unix/sysv/linux/bits/dirent.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -54,4 +54,6 @@ struct dirent64
#if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T
/* Inform libc code that these two types are effectively identical. */
# define _DIRENT_MATCHES_DIRENT64 1
+#else
+# define _DIRENT_MATCHES_DIRENT64 0
#endif
diff --git a/sysdeps/unix/sysv/linux/bits/epoll.h b/sysdeps/unix/sysv/linux/bits/epoll.h
index 9e8c220eec..d4aea329ac 100644
--- a/sysdeps/unix/sysv/linux/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/bits/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/errno.h b/sysdeps/unix/sysv/linux/bits/errno.h
index 6b5a71e390..e0f7f0b6ae 100644
--- a/sysdeps/unix/sysv/linux/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/bits/errno.h
@@ -1,5 +1,5 @@
/* Error constants. Linux specific version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,24 +16,29 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _ERRNO_H
+#ifndef _BITS_ERRNO_H
+#define _BITS_ERRNO_H 1
+
+#if !defined _ERRNO_H
+# error "Never include <bits/errno.h> directly; use <errno.h> instead."
+#endif
-# undef EDOM
-# undef EILSEQ
-# undef ERANGE
# include <linux/errno.h>
-/* Linux has no ENOTSUP error code. */
-# define ENOTSUP EOPNOTSUPP
+/* Older Linux headers do not define these constants. */
+# ifndef ENOTSUP
+# define ENOTSUP EOPNOTSUPP
+# endif
-/* Older Linux versions also had no ECANCELED error code. */
# ifndef ECANCELED
-# define ECANCELED 125
+# define ECANCELED 125
# endif
-/* Support for error codes to support robust mutexes was added later, too. */
# ifndef EOWNERDEAD
# define EOWNERDEAD 130
+# endif
+
+#ifndef ENOTRECOVERABLE
# define ENOTRECOVERABLE 131
# endif
@@ -45,22 +50,4 @@
# define EHWPOISON 133
# endif
-# ifndef __ASSEMBLER__
-/* Function to get address of global `errno' variable. */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
-
-# if !defined _LIBC || defined _LIBC_REENTRANT
-/* When using threads, errno is a per-thread value. */
-# define errno (*__errno_location ())
-# endif
-# endif /* !__ASSEMBLER__ */
-#endif /* _ERRNO_H */
-
-#if !defined _ERRNO_H && defined __need_Emath
-/* This is ugly but the kernel header is not clean enough. We must
- define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
- defined. */
-# define EDOM 33 /* Math argument out of domain of function. */
-# define EILSEQ 84 /* Illegal byte sequence. */
-# define ERANGE 34 /* Math result not representable. */
-#endif /* !_ERRNO_H && __need_Emath */
+#endif /* bits/errno.h. */
diff --git a/sysdeps/unix/sysv/linux/bits/eventfd.h b/sysdeps/unix/sysv/linux/bits/eventfd.h
index 63c49449f2..5941174216 100644
--- a/sysdeps/unix/sysv/linux/bits/eventfd.h
+++ b/sysdeps/unix/sysv/linux/bits/eventfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index 7e5b0aecdc..269494261e 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@
*/
#ifdef __USE_GNU
-# include <bits/uio.h>
+# include <bits/types/struct_iovec.h>
#endif
/* open/fcntl. */
@@ -76,7 +76,7 @@
#endif
#ifndef __O_DIRECTORY
-# define __O_DIRECTORY 0200000
+# define __O_DIRECTORY 0200000
#endif
#ifndef __O_NOFOLLOW
# define __O_NOFOLLOW 0400000
@@ -104,9 +104,9 @@
# ifndef __USE_FILE_OFFSET64
# define F_GETLK 5 /* Get record locking info. */
# define F_SETLK 6 /* Set record locking info (non-blocking). */
-# define F_SETLKW 7 /* Set record locking info (blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
# else
-# define F_GETLK F_GETLK64 /* Get record locking info. */
+# define F_GETLK F_GETLK64 /* Get record locking info. */
# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
# endif
@@ -114,7 +114,7 @@
#ifndef F_GETLK64
# define F_GETLK64 12 /* Get record locking info. */
# define F_SETLK64 13 /* Set record locking info (non-blocking). */
-# define F_SETLKW64 14 /* Set record locking info (blocking). */
+# define F_SETLKW64 14 /* Set record locking info (blocking). */
#endif
/* open file description locks.
@@ -139,27 +139,27 @@
#endif
#ifdef __USE_XOPEN2K8
-# define O_DIRECTORY __O_DIRECTORY /* Must be a directory. */
-# define O_NOFOLLOW __O_NOFOLLOW /* Do not follow links. */
+# define O_DIRECTORY __O_DIRECTORY /* Must be a directory. */
+# define O_NOFOLLOW __O_NOFOLLOW /* Do not follow links. */
# define O_CLOEXEC __O_CLOEXEC /* Set close_on_exec. */
#endif
#ifdef __USE_GNU
-# define O_DIRECT __O_DIRECT /* Direct disk access. */
+# define O_DIRECT __O_DIRECT /* Direct disk access. */
# define O_NOATIME __O_NOATIME /* Do not set atime. */
# define O_PATH __O_PATH /* Resolve pathname but do not open file. */
# define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */
#endif
-/* For now, Linux has no separate synchronicitiy options for read
+/* For now, Linux has no separate synchronicity options for read
operations. We define O_RSYNC therefore as the same as O_SYNC
since this is a superset. */
#if defined __USE_POSIX199309 || defined __USE_UNIX98
# define O_DSYNC __O_DSYNC /* Synchronize data. */
# if defined __O_RSYNC
-# define O_RSYNC __O_RSYNC /* Synchronize read operations. */
+# define O_RSYNC __O_RSYNC /* Synchronize read operations. */
# else
-# define O_RSYNC O_SYNC /* Synchronize read operations. */
+# define O_RSYNC O_SYNC /* Synchronize read operations. */
# endif
#endif
@@ -197,11 +197,18 @@
#endif
#ifdef __USE_GNU
-# define F_SETLEASE 1024 /* Set a lease. */
+# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notifications on a directory. */
# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */
+# define F_ADD_SEALS 1033 /* Add seals to file. */
+# define F_GET_SEALS 1034 /* Get seals for file. */
+/* Set / get write life time hints. */
+# define F_GET_RW_HINT 1035
+# define F_SET_RW_HINT 1036
+# define F_GET_FILE_RW_HINT 1037
+# define F_SET_FILE_RW_HINT 1038
#endif
#ifdef __USE_XOPEN2K8
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
@@ -214,8 +221,8 @@
#ifndef F_RDLCK
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
# define F_RDLCK 0 /* Read lock. */
-# define F_WRLCK 1 /* Write lock. */
-# define F_UNLCK 2 /* Remove lock. */
+# define F_WRLCK 1 /* Write lock. */
+# define F_UNLCK 2 /* Remove lock. */
#endif
@@ -235,10 +242,10 @@
#endif
#ifdef __USE_GNU
-# define LOCK_MAND 32 /* This is a mandatory flock: */
-# define LOCK_READ 64 /* ... which allows concurrent read operations. */
+# define LOCK_MAND 32 /* This is a mandatory flock: */
+# define LOCK_READ 64 /* ... which allows concurrent read operations. */
# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
-# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
+# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
#endif
#ifdef __USE_GNU
@@ -271,6 +278,24 @@ struct f_owner_ex
};
#endif
+#ifdef __USE_GNU
+/* Types of seals. */
+# define F_SEAL_SEAL 0x0001 /* Prevent further seals from being set. */
+# define F_SEAL_SHRINK 0x0002 /* Prevent file from shrinking. */
+# define F_SEAL_GROW 0x0004 /* Prevent file from growing. */
+# define F_SEAL_WRITE 0x0008 /* Prevent writes. */
+#endif
+
+#ifdef __USE_GNU
+/* Hint values for F_{GET,SET}_RW_HINT. */
+# define RWF_WRITE_LIFE_NOT_SET 0
+# define RWH_WRITE_LIFE_NONE 1
+# define RWH_WRITE_LIFE_SHORT 2
+# define RWH_WRITE_LIFE_MEDIUM 3
+# define RWH_WRITE_LIFE_LONG 4
+# define RWH_WRITE_LIFE_EXTREME 5
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_MISC
@@ -289,7 +314,7 @@ struct f_owner_ex
#ifdef __USE_XOPEN2K
# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
# define POSIX_FADV_DONTNEED __POSIX_FADV_DONTNEED /* Don't need these pages. */
# define POSIX_FADV_NOREUSE __POSIX_FADV_NOREUSE /* Data will be accessed once. */
@@ -318,15 +343,7 @@ struct f_owner_ex
/* Flags for fallocate. */
-# define FALLOC_FL_KEEP_SIZE 1 /* Don't extend size of file
- even if offset + len is
- greater than file size. */
-# define FALLOC_FL_PUNCH_HOLE 2 /* Create a hole in the file. */
-# define FALLOC_FL_COLLAPSE_RANGE 8 /* Remove a range of a file
- without leaving a
- hole. */
-# define FALLOC_FL_ZERO_RANGE 16 /* Convert a range of a
- file to zeros. */
+# include <linux/falloc.h>
/* File handle structure. */
@@ -347,7 +364,7 @@ __BEGIN_DECLS
#ifdef __USE_GNU
/* Provide kernel hint to read ahead. */
-extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
+extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__THROW;
@@ -363,23 +380,23 @@ extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
This function is a possible cancellation point and therefore not
marked with __THROW. */
-extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
- size_t __count, unsigned int __flags);
+extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+ size_t __count, unsigned int __flags);
/* Splice two files together.
This function is a possible cancellation point and therefore not
marked with __THROW. */
-extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
- __off64_t *__offout, size_t __len,
- unsigned int __flags);
+extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+ __off64_t *__offout, size_t __len,
+ unsigned int __flags);
/* In-kernel implementation of tee for pipe buffers.
This function is a possible cancellation point and therefore not
marked with __THROW. */
-extern ssize_t tee (int __fdin, int __fdout, size_t __len,
- unsigned int __flags);
+extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
+ unsigned int __flags);
/* Reserve storage for the data of the file associated with FD.
diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
index 3b01f12d93..2c86102629 100644
--- a/sysdeps/unix/sysv/linux/bits/in.h
+++ b/sysdeps/unix/sysv/linux/bits/in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,12 +25,20 @@
kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the
defines), sockaddr_in6, or ipv6_mreq. Same for in6_ptkinfo or ip6_mtuinfo
in linux/ipv6.h. The ABI used by the linux-kernel and glibc match exactly.
- Neither the linux kernel nor glibc should break this ABI without coordination. */
-#if defined _UAPI_LINUX_IN6_H || defined _UAPI_IPV6_H
+ Neither the linux kernel nor glibc should break this ABI without coordination.
+ In upstream kernel 56c176c9 the _UAPI prefix was stripped so we need to check
+ for _LINUX_IN6_H and _IPV6_H now, and keep checking the old versions for
+ maximum backwards compatibility. */
+#if defined _UAPI_LINUX_IN6_H \
+ || defined _UAPI_IPV6_H \
+ || defined _LINUX_IN6_H \
+ || defined _IPV6_H
/* This is not quite the same API since the kernel always defines s6_addr16 and
s6_addr32. This is not a violation of POSIX since POSIX says "at least the
following member" and that holds true. */
-# define __USE_KERNEL_IPV6_DEFS
+# define __USE_KERNEL_IPV6_DEFS 1
+#else
+# define __USE_KERNEL_IPV6_DEFS 0
#endif
/* Options for use with `getsockopt' and `setsockopt' at the IP level.
@@ -45,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 */
@@ -93,6 +101,7 @@
#define IP_NODEFRAG 22
#define IP_CHECKSUM 23
#define IP_BIND_ADDRESS_NO_PORT 24
+#define IP_RECVFRAGSIZE 25
/* IP_MTU_DISCOVER arguments. */
#define IP_PMTUDISC_DONT 0 /* Never send DF frames. */
@@ -184,6 +193,7 @@ struct in_pktinfo
#define IPV6_LEAVE_ANYCAST 28
#define IPV6_IPSEC_POLICY 34
#define IPV6_XFRM_POLICY 35
+#define IPV6_HDRINCL 36
/* Advanced API (RFC3542) (1). */
#define IPV6_RECVPKTINFO 49
@@ -205,9 +215,26 @@ struct in_pktinfo
#define IPV6_RECVTCLASS 66
#define IPV6_TCLASS 67
+#define IPV6_AUTOFLOWLABEL 70
+
+/* RFC5014. */
+#define IPV6_ADDR_PREFERENCES 72
+
+/* RFC5082. */
+#define IPV6_MINHOPCOUNT 73
+
+#define IPV6_ORIGDSTADDR 74
+#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
+#define IPV6_TRANSPARENT 75
+#define IPV6_UNICAST_IF 76
+#define IPV6_RECVFRAGSIZE 77
+#define IPV6_FREEBIND 78
+
/* Obsolete synonyms for the above. */
-#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
-#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+#if !__USE_KERNEL_IPV6_DEFS
+# define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+# define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+#endif
#define IPV6_RXHOPOPTS IPV6_HOPOPTS
#define IPV6_RXDSTOPTS IPV6_DSTOPTS
diff --git a/sysdeps/unix/sysv/linux/bits/inotify.h b/sysdeps/unix/sysv/linux/bits/inotify.h
index dc9f627a92..d16087625b 100644
--- a/sysdeps/unix/sysv/linux/bits/inotify.h
+++ b/sysdeps/unix/sysv/linux/bits/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/bits/ioctl-types.h
index b3bfdb1cf2..28fd1db025 100644
--- a/sysdeps/unix/sysv/linux/bits/ioctl-types.h
+++ b/sysdeps/unix/sysv/linux/bits/ioctl-types.h
@@ -1,5 +1,5 @@
/* Structure types for pre-termios terminal ioctls. Linux version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/ioctls.h b/sysdeps/unix/sysv/linux/bits/ioctls.h
index cbfedca70f..b719f6ef2a 100644
--- a/sysdeps/unix/sysv/linux/bits/ioctls.h
+++ b/sysdeps/unix/sysv/linux/bits/ioctls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/ipc.h b/sysdeps/unix/sysv/linux/bits/ipc.h
index f7e4d81f96..46656c54cb 100644
--- a/sysdeps/unix/sysv/linux/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/local_lim.h b/sysdeps/unix/sysv/linux/bits/local_lim.h
index 3f353f72b8..2d82ada43c 100644
--- a/sysdeps/unix/sysv/linux/bits/local_lim.h
+++ b/sysdeps/unix/sysv/linux/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Linux version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/mman-linux.h b/sysdeps/unix/sysv/linux/bits/mman-linux.h
new file mode 100644
index 0000000000..70edeb6d60
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/mman-linux.h
@@ -0,0 +1,117 @@
+/* Definitions for POSIX memory map interface. Linux generic version.
+ Copyright (C) 2001-2018 Free Software 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 _SYS_MMAN_H
+# error "Never use <bits/mman-linux.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+ But the kernel header is not namespace clean. */
+
+
+/* Protections are chosen from these bits, OR'd together. The
+ implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ without PROT_READ. The only guarantees are that no writing will be
+ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ 0x1 /* Page can be read. */
+#define PROT_WRITE 0x2 /* Page can be written. */
+#define PROT_EXEC 0x4 /* Page can be executed. */
+#define PROT_NONE 0x0 /* Page can not be accessed. */
+#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
+ growsdown vma (mprotect only). */
+#define PROT_GROWSUP 0x02000000 /* Extend change to start of
+ growsup vma (mprotect only). */
+
+/* Sharing types (must choose one and only one of these). */
+#define MAP_SHARED 0x01 /* Share changes. */
+#define MAP_PRIVATE 0x02 /* Changes are private. */
+#ifdef __USE_MISC
+# define MAP_SHARED_VALIDATE 0x03 /* Share changes and validate
+ extension flags. */
+# define MAP_TYPE 0x0f /* Mask for type of mapping. */
+#endif
+
+/* Other flags. */
+#define MAP_FIXED 0x10 /* Interpret addr exactly. */
+#ifdef __USE_MISC
+# define MAP_FILE 0
+# ifdef __MAP_ANONYMOUS
+# define MAP_ANONYMOUS __MAP_ANONYMOUS /* Don't use a file. */
+# else
+# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
+# endif
+# define MAP_ANON MAP_ANONYMOUS
+/* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */
+# define MAP_HUGE_SHIFT 26
+# define MAP_HUGE_MASK 0x3f
+#endif
+
+/* Flags to `msync'. */
+#define MS_ASYNC 1 /* Sync memory asynchronously. */
+#define MS_SYNC 4 /* Synchronous memory sync. */
+#define MS_INVALIDATE 2 /* Invalidate the caches. */
+
+/* Flags for `mremap'. */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+# define MREMAP_FIXED 2
+#endif
+
+/* Advice to `madvise'. */
+#ifdef __USE_MISC
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_FREE 8 /* Free pages only if memory pressure. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
+# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
+# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
+# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
+ overrides the coredump filter bits. */
+# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
+# define MADV_WIPEONFORK 18 /* Zero memory on fork, child only. */
+# define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK. */
+# define MADV_HWPOISON 100 /* Poison a page for testing. */
+#endif
+
+/* The POSIX people had to invent similar names for the same things. */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+#endif
+
+/* Flags for `mlockall'. */
+#ifndef MCL_CURRENT
+# define MCL_CURRENT 1 /* Lock all currently mapped pages. */
+# define MCL_FUTURE 2 /* Lock all additions to address
+ space. */
+# define MCL_ONFAULT 4 /* Lock all pages that are
+ faulted in. */
+#endif
+
+#include <bits/mman-shared.h>
diff --git a/sysdeps/unix/sysv/linux/bits/mman-shared.h b/sysdeps/unix/sysv/linux/bits/mman-shared.h
new file mode 100644
index 0000000000..d15ba95c9d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/mman-shared.h
@@ -0,0 +1,76 @@
+/* Memory-mapping-related declarations/definitions, not architecture-specific.
+ Copyright (C) 2017-2018 Free Software 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 _SYS_MMAN_H
+# error "Never use <bits/mman-shared.h> directly; include <sys/mman.h> instead."
+#endif
+
+#ifdef __USE_GNU
+/* Flags for memfd_create. */
+# ifndef MFD_CLOEXEC
+# define MFD_CLOEXEC 1U
+# define MFD_ALLOW_SEALING 2U
+# define MFD_HUGETLB 4U
+# endif
+
+/* Flags for mlock2. */
+# ifndef MLOCK_ONFAULT
+# define MLOCK_ONFAULT 1U
+# endif
+
+/* Access rights for pkey_alloc. */
+# ifndef PKEY_DISABLE_ACCESS
+# define PKEY_DISABLE_ACCESS 0x1
+# define PKEY_DISABLE_WRITE 0x2
+# endif
+
+__BEGIN_DECLS
+
+/* Create a new memory file descriptor. NAME is a name for debugging.
+ FLAGS is a combination of the MFD_* constants. */
+int memfd_create (const char *__name, unsigned int __flags) __THROW;
+
+/* Lock pages from ADDR (inclusive) to ADDR + LENGTH (exclusive) into
+ memory. FLAGS is a combination of the MLOCK_* flags above. */
+int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW;
+
+/* Allocate a new protection key, with the PKEY_DISABLE_* bits
+ specified in ACCESS_RIGHTS. The protection key mask for the
+ current thread is updated to match the access privilege for the new
+ key. */
+int pkey_alloc (unsigned int __flags, unsigned int __access_rights) __THROW;
+
+/* Update the access rights for the current thread for KEY, which must
+ have been allocated using pkey_alloc. */
+int pkey_set (int __key, unsigned int __access_rights) __THROW;
+
+/* Return the access rights for the current thread for KEY, which must
+ have been allocated using pkey_alloc. */
+int pkey_get (int __key) __THROW;
+
+/* Free an allocated protection key, which must have been allocated
+ using pkey_alloc. */
+int pkey_free (int __key) __THROW;
+
+/* Apply memory protection flags for KEY to the specified address
+ range. */
+int pkey_mprotect (void *__addr, size_t __len, int __prot, int __pkey) __THROW;
+
+__END_DECLS
+
+#endif /* __USE_GNU */
diff --git a/sysdeps/unix/sysv/linux/bits/mqueue.h b/sysdeps/unix/sysv/linux/bits/mqueue.h
index abe7b6470d..321e1c369a 100644
--- a/sysdeps/unix/sysv/linux/bits/mqueue.h
+++ b/sysdeps/unix/sysv/linux/bits/mqueue.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/msq.h b/sysdeps/unix/sysv/linux/bits/msq.h
index 6fe4e59203..319521018d 100644
--- a/sysdeps/unix/sysv/linux/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -60,6 +60,7 @@ struct msqid_ds
/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12
+# define MSG_STAT_ANY 13
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
diff --git a/sysdeps/unix/sysv/linux/bits/param.h b/sysdeps/unix/sysv/linux/bits/param.h
index 45675d1d0b..03486c167d 100644
--- a/sysdeps/unix/sysv/linux/bits/param.h
+++ b/sysdeps/unix/sysv/linux/bits/param.h
@@ -1,5 +1,5 @@
/* Old-style Unix parameters and limits. Linux version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/poll.h b/sysdeps/unix/sysv/linux/bits/poll.h
index a582118d7d..4bd9db6fab 100644
--- a/sysdeps/unix/sysv/linux/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/bits/poll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/posix_opt.h b/sysdeps/unix/sysv/linux/bits/posix_opt.h
index 5fb31b1732..2339d4a147 100644
--- a/sysdeps/unix/sysv/linux/bits/posix_opt.h
+++ b/sysdeps/unix/sysv/linux/bits/posix_opt.h
@@ -1,5 +1,5 @@
/* Define POSIX options for Linux.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/ptrace-shared.h b/sysdeps/unix/sysv/linux/bits/ptrace-shared.h
new file mode 100644
index 0000000000..03a779140c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/ptrace-shared.h
@@ -0,0 +1,85 @@
+/* `ptrace' debugger support interface. Linux version,
+ not architecture-specific.
+ Copyright (C) 1996-2018 Free Software 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 _SYS_PTRACE_H
+# error "Never use <bits/ptrace-shared.h> directly; include <sys/ptrace.h> instead."
+#endif
+
+/* Options set using PTRACE_SETOPTIONS. */
+enum __ptrace_setoptions
+{
+ PTRACE_O_TRACESYSGOOD = 0x00000001,
+ PTRACE_O_TRACEFORK = 0x00000002,
+ PTRACE_O_TRACEVFORK = 0x00000004,
+ PTRACE_O_TRACECLONE = 0x00000008,
+ PTRACE_O_TRACEEXEC = 0x00000010,
+ PTRACE_O_TRACEVFORKDONE = 0x00000020,
+ PTRACE_O_TRACEEXIT = 0x00000040,
+ PTRACE_O_TRACESECCOMP = 0x00000080,
+ PTRACE_O_EXITKILL = 0x00100000,
+ PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
+ PTRACE_O_MASK = 0x003000ff
+};
+
+enum __ptrace_eventcodes
+{
+/* Wait extended result codes for the above trace options. */
+ PTRACE_EVENT_FORK = 1,
+ PTRACE_EVENT_VFORK = 2,
+ PTRACE_EVENT_CLONE = 3,
+ PTRACE_EVENT_EXEC = 4,
+ PTRACE_EVENT_VFORK_DONE = 5,
+ PTRACE_EVENT_EXIT = 6,
+ PTRACE_EVENT_SECCOMP = 7,
+/* Extended result codes enabled by means other than options. */
+ PTRACE_EVENT_STOP = 128
+};
+
+/* Arguments for PTRACE_PEEKSIGINFO. */
+struct __ptrace_peeksiginfo_args
+{
+ __uint64_t off; /* From which siginfo to start. */
+ __uint32_t flags; /* Flags for peeksiginfo. */
+ __int32_t nr; /* How many siginfos to take. */
+};
+
+enum __ptrace_peeksiginfo_flags
+{
+ /* Read signals from a shared (process wide) queue. */
+ PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
+};
+
+/* Argument and results of PTRACE_SECCOMP_GET_METADATA. */
+struct __ptrace_seccomp_metadata
+{
+ __uint64_t filter_off; /* Input: which filter. */
+ __uint64_t flags; /* Output: filter's flags. */
+};
+
+/* Perform process tracing functions. REQUEST is one of the values
+ above, and determines the action to be taken.
+ For all requests except PTRACE_TRACEME, PID specifies the process to be
+ traced.
+
+ PID and the other arguments described above for the various requests should
+ appear (those that are used for the particular request) as:
+ pid_t PID, void *ADDR, int DATA, void *ADDR2
+ after REQUEST. */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
diff --git a/sysdeps/unix/sysv/linux/bits/resource.h b/sysdeps/unix/sysv/linux/bits/resource.h
index 8af0e0e95e..fafbadf94f 100644
--- a/sysdeps/unix/sysv/linux/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/bits/resource.h
@@ -1,5 +1,5 @@
/* Bit values & structures for resource limits. Linux version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -175,113 +175,8 @@ enum __rusage_who
#endif
};
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
-
-/* Structure which says how much of each resource has been used. */
-
-/* The purpose of all the unions is to have the kernel-compatible layout
- while keeping the API type as 'long int', and among machines where
- __syscall_slong_t is not 'long int', this only does the right thing
- for little-endian ones, like x32. */
-struct rusage
- {
- /* Total amount of user time used. */
- struct timeval ru_utime;
- /* Total amount of system time used. */
- struct timeval ru_stime;
- /* Maximum resident set size (in kilobytes). */
- __extension__ union
- {
- long int ru_maxrss;
- __syscall_slong_t __ru_maxrss_word;
- };
- /* Amount of sharing of text segment memory
- with other processes (kilobyte-seconds). */
- /* Maximum resident set size (in kilobytes). */
- __extension__ union
- {
- long int ru_ixrss;
- __syscall_slong_t __ru_ixrss_word;
- };
- /* Amount of data segment memory used (kilobyte-seconds). */
- __extension__ union
- {
- long int ru_idrss;
- __syscall_slong_t __ru_idrss_word;
- };
- /* Amount of stack memory used (kilobyte-seconds). */
- __extension__ union
- {
- long int ru_isrss;
- __syscall_slong_t __ru_isrss_word;
- };
- /* Number of soft page faults (i.e. those serviced by reclaiming
- a page from the list of pages awaiting reallocation. */
- __extension__ union
- {
- long int ru_minflt;
- __syscall_slong_t __ru_minflt_word;
- };
- /* Number of hard page faults (i.e. those that required I/O). */
- __extension__ union
- {
- long int ru_majflt;
- __syscall_slong_t __ru_majflt_word;
- };
- /* Number of times a process was swapped out of physical memory. */
- __extension__ union
- {
- long int ru_nswap;
- __syscall_slong_t __ru_nswap_word;
- };
- /* Number of input operations via the file system. Note: This
- and `ru_oublock' do not include operations with the cache. */
- __extension__ union
- {
- long int ru_inblock;
- __syscall_slong_t __ru_inblock_word;
- };
- /* Number of output operations via the file system. */
- __extension__ union
- {
- long int ru_oublock;
- __syscall_slong_t __ru_oublock_word;
- };
- /* Number of IPC messages sent. */
- __extension__ union
- {
- long int ru_msgsnd;
- __syscall_slong_t __ru_msgsnd_word;
- };
- /* Number of IPC messages received. */
- __extension__ union
- {
- long int ru_msgrcv;
- __syscall_slong_t __ru_msgrcv_word;
- };
- /* Number of signals delivered. */
- __extension__ union
- {
- long int ru_nsignals;
- __syscall_slong_t __ru_nsignals_word;
- };
- /* Number of voluntary context switches, i.e. because the process
- gave up the process before it had to (usually to wait for some
- resource to be available). */
- __extension__ union
- {
- long int ru_nvcsw;
- __syscall_slong_t __ru_nvcsw_word;
- };
- /* Number of involuntary context switches, i.e. a higher priority process
- became runnable or the current process used up its time slice. */
- __extension__ union
- {
- long int ru_nivcsw;
- __syscall_slong_t __ru_nivcsw_word;
- };
- };
+#include <bits/types/struct_timeval.h>
+#include <bits/types/struct_rusage.h>
/* Priority limits. */
#define PRIO_MIN -20 /* Minimum priority a process can have. */
diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h
index 4f5305a095..34f27a7d9b 100644
--- a/sysdeps/unix/sysv/linux/bits/sched.h
+++ b/sysdeps/unix/sysv/linux/bits/sched.h
@@ -1,6 +1,6 @@
/* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,20 +17,22 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef __need_schedparam
+#ifndef _BITS_SCHED_H
+#define _BITS_SCHED_H 1
#ifndef _SCHED_H
# error "Never include <bits/sched.h> directly; use <sched.h> instead."
#endif
-
/* Scheduling algorithms. */
#define SCHED_OTHER 0
#define SCHED_FIFO 1
#define SCHED_RR 2
#ifdef __USE_GNU
# define SCHED_BATCH 3
+# define SCHED_ISO 4
# define SCHED_IDLE 5
+# define SCHED_DEADLINE 6
# define SCHED_RESET_ON_FORK 0x40000000
#endif
@@ -60,6 +62,7 @@
force CLONE_PTRACE on this clone. */
# define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in
the child. */
+# define CLONE_NEWCGROUP 0x02000000 /* New cgroup namespace. */
# define CLONE_NEWUTS 0x04000000 /* New utsname group. */
# define CLONE_NEWIPC 0x08000000 /* New ipcs. */
# define CLONE_NEWUSER 0x10000000 /* New user namespace. */
@@ -68,11 +71,7 @@
# define CLONE_IO 0x80000000 /* Clone I/O context. */
#endif
-/* The official definition. */
-struct sched_param
- {
- int __sched_priority;
- };
+#include <bits/types/struct_sched_param.h>
__BEGIN_DECLS
@@ -91,120 +90,6 @@ extern int sched_getcpu (void) __THROW;
extern int setns (int __fd, int __nstype) __THROW;
#endif
-
-__END_DECLS
-
-#endif /* need schedparam */
-
-#if !defined __defined_schedparam \
- && (defined __need_schedparam || defined _SCHED_H)
-# define __defined_schedparam 1
-/* Data structure to describe a process' schedulability. */
-struct __sched_param
- {
- int __sched_priority;
- };
-# undef __need_schedparam
-#endif
-
-
-#if defined _SCHED_H && !defined __cpu_set_t_defined
-# define __cpu_set_t_defined
-/* Size definition for CPU sets. */
-# define __CPU_SETSIZE 1024
-# define __NCPUBITS (8 * sizeof (__cpu_mask))
-
-/* Type for array elements in 'cpu_set_t'. */
-typedef __CPU_MASK_TYPE __cpu_mask;
-
-/* Basic access functions. */
-# define __CPUELT(cpu) ((cpu) / __NCPUBITS)
-# define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
-
-/* Data structure to describe CPU mask. */
-typedef struct
-{
- __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
-} cpu_set_t;
-
-/* Access functions for CPU masks. */
-# if __GNUC_PREREQ (2, 91)
-# define __CPU_ZERO_S(setsize, cpusetp) \
- do __builtin_memset (cpusetp, '\0', setsize); while (0)
-# else
-# define __CPU_ZERO_S(setsize, cpusetp) \
- do { \
- size_t __i; \
- size_t __imax = (setsize) / sizeof (__cpu_mask); \
- __cpu_mask *__bits = (cpusetp)->__bits; \
- for (__i = 0; __i < __imax; ++__i) \
- __bits[__i] = 0; \
- } while (0)
-# endif
-# define __CPU_SET_S(cpu, setsize, cpusetp) \
- (__extension__ \
- ({ size_t __cpu = (cpu); \
- __cpu / 8 < (setsize) \
- ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
- |= __CPUMASK (__cpu)) \
- : 0; }))
-# define __CPU_CLR_S(cpu, setsize, cpusetp) \
- (__extension__ \
- ({ size_t __cpu = (cpu); \
- __cpu / 8 < (setsize) \
- ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
- &= ~__CPUMASK (__cpu)) \
- : 0; }))
-# define __CPU_ISSET_S(cpu, setsize, cpusetp) \
- (__extension__ \
- ({ size_t __cpu = (cpu); \
- __cpu / 8 < (setsize) \
- ? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
- & __CPUMASK (__cpu))) != 0 \
- : 0; }))
-
-# define __CPU_COUNT_S(setsize, cpusetp) \
- __sched_cpucount (setsize, cpusetp)
-
-# if __GNUC_PREREQ (2, 91)
-# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
- (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0)
-# else
-# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
- (__extension__ \
- ({ const __cpu_mask *__arr1 = (cpusetp1)->__bits; \
- const __cpu_mask *__arr2 = (cpusetp2)->__bits; \
- size_t __imax = (setsize) / sizeof (__cpu_mask); \
- size_t __i; \
- for (__i = 0; __i < __imax; ++__i) \
- if (__arr1[__i] != __arr2[__i]) \
- break; \
- __i == __imax; }))
-# endif
-
-# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
- (__extension__ \
- ({ cpu_set_t *__dest = (destset); \
- const __cpu_mask *__arr1 = (srcset1)->__bits; \
- const __cpu_mask *__arr2 = (srcset2)->__bits; \
- size_t __imax = (setsize) / sizeof (__cpu_mask); \
- size_t __i; \
- for (__i = 0; __i < __imax; ++__i) \
- ((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i]; \
- __dest; }))
-
-# define __CPU_ALLOC_SIZE(count) \
- ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask))
-# define __CPU_ALLOC(count) __sched_cpualloc (count)
-# define __CPU_FREE(cpuset) __sched_cpufree (cpuset)
-
-__BEGIN_DECLS
-
-extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
- __THROW;
-extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur;
-extern void __sched_cpufree (cpu_set_t *__set) __THROW;
-
__END_DECLS
-#endif
+#endif /* bits/sched.h */
diff --git a/sysdeps/unix/sysv/linux/bits/sem.h b/sysdeps/unix/sysv/linux/bits/sem.h
index f7efb3f133..7ccd600517 100644
--- a/sysdeps/unix/sysv/linux/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -68,6 +68,7 @@ struct semid_ds
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
+# define SEM_STAT_ANY 20
struct seminfo
{
diff --git a/sysdeps/unix/sysv/linux/bits/shm.h b/sysdeps/unix/sysv/linux/bits/shm.h
index ce90b04d88..896c1d96bf 100644
--- a/sysdeps/unix/sysv/linux/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -68,6 +68,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/bits/sigaction.h b/sysdeps/unix/sysv/linux/bits/sigaction.h
index 8c995fec03..a4225c8787 100644
--- a/sysdeps/unix/sysv/linux/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/bits/sigaction.h
@@ -1,5 +1,5 @@
/* The proper definitions for Linux's sigaction.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software 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,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGACTION_H
+#define _BITS_SIGACTION_H 1
+
#ifndef _SIGNAL_H
# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
#endif
@@ -24,7 +27,7 @@
struct sigaction
{
/* Signal handler. */
-#ifdef __USE_POSIX199309
+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
union
{
/* Used if SA_SIGINFO is not set. */
@@ -54,10 +57,10 @@ struct sigaction
#define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */
#define SA_SIGINFO 4 /* Invoke signal-catching function with
three arguments instead of one. */
-#if defined __USE_UNIX98 || defined __USE_MISC
+#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
#endif
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
its handler is being executed. */
@@ -76,3 +79,5 @@ struct sigaction
#define SIG_BLOCK 0 /* Block signals. */
#define SIG_UNBLOCK 1 /* Unblock signals. */
#define SIG_SETMASK 2 /* Set the set of blocked signals. */
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/sigcontext.h b/sysdeps/unix/sysv/linux/bits/sigcontext.h
index 46cacb7b2c..4828d59f90 100644
--- a/sysdeps/unix/sysv/linux/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/bits/sigcontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software 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,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/sigevent-consts.h b/sysdeps/unix/sysv/linux/bits/sigevent-consts.h
new file mode 100644
index 0000000000..897b7d26ff
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/sigevent-consts.h
@@ -0,0 +1,41 @@
+/* sigevent constants. Linux version.
+ Copyright (C) 1997-2018 Free Software 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 _BITS_SIGEVENT_CONSTS_H
+#define _BITS_SIGEVENT_CONSTS_H 1
+
+#if !defined _SIGNAL_H && !defined _AIO_H
+#error "Don't include <bits/sigevent-consts.h> directly; use <signal.h> instead."
+#endif
+
+/* `sigev_notify' values. */
+enum
+{
+ SIGEV_SIGNAL = 0, /* Notify via signal. */
+# define SIGEV_SIGNAL SIGEV_SIGNAL
+ SIGEV_NONE, /* Other notification: meaningless. */
+# define SIGEV_NONE SIGEV_NONE
+ SIGEV_THREAD, /* Deliver via thread creation. */
+# define SIGEV_THREAD SIGEV_THREAD
+
+ SIGEV_THREAD_ID = 4 /* Send signal to specific thread.
+ This is a Linux extension. */
+#define SIGEV_THREAD_ID SIGEV_THREAD_ID
+};
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/siginfo-arch.h b/sysdeps/unix/sysv/linux/bits/siginfo-arch.h
new file mode 100644
index 0000000000..00018fa620
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/siginfo-arch.h
@@ -0,0 +1,7 @@
+/* Architecture-specific adjustments to siginfo_t. */
+#ifndef _BITS_SIGINFO_ARCH_H
+#define _BITS_SIGINFO_ARCH_H 1
+
+/* This architecture has no adjustments to make to siginfo_t. */
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/siginfo-consts-arch.h b/sysdeps/unix/sysv/linux/bits/siginfo-consts-arch.h
new file mode 100644
index 0000000000..96b4edbccd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/siginfo-consts-arch.h
@@ -0,0 +1,7 @@
+/* Architecture-specific additional siginfo constants. */
+#ifndef _BITS_SIGINFO_CONSTS_ARCH_H
+#define _BITS_SIGINFO_CONSTS_ARCH_H 1
+
+/* This architecture has no additional siginfo constants. */
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
new file mode 100644
index 0000000000..193bd9c471
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
@@ -0,0 +1,191 @@
+/* siginfo constants. Linux version.
+ Copyright (C) 1997-2018 Free Software 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 _BITS_SIGINFO_CONSTS_H
+#define _BITS_SIGINFO_CONSTS_H 1
+
+#ifndef _SIGNAL_H
+#error "Don't include <bits/siginfo-consts.h> directly; use <signal.h> instead."
+#endif
+
+/* Most of these constants are uniform across all architectures, but there
+ is one exception. */
+#include <bits/siginfo-arch.h>
+#ifndef __SI_ASYNCIO_AFTER_SIGIO
+# define __SI_ASYNCIO_AFTER_SIGIO 1
+#endif
+
+/* Values for `si_code'. Positive values are reserved for kernel-generated
+ signals. */
+enum
+{
+ SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
+ SI_TKILL = -6, /* Sent by tkill. */
+ SI_SIGIO, /* Sent by queued SIGIO. */
+#if __SI_ASYNCIO_AFTER_SIGIO
+ SI_ASYNCIO, /* Sent by AIO completion. */
+ SI_MESGQ, /* Sent by real time mesq state change. */
+ SI_TIMER, /* Sent by timer expiration. */
+#else
+ SI_MESGQ,
+ SI_TIMER,
+ SI_ASYNCIO,
+#endif
+ SI_QUEUE, /* Sent by sigqueue. */
+ SI_USER, /* Sent by kill, sigsend. */
+ SI_KERNEL = 0x80 /* Send by kernel. */
+
+#define SI_ASYNCNL SI_ASYNCNL
+#define SI_TKILL SI_TKILL
+#define SI_SIGIO SI_SIGIO
+#define SI_ASYNCIO SI_ASYNCIO
+#define SI_MESGQ SI_MESGQ
+#define SI_TIMER SI_TIMER
+#define SI_ASYNCIO SI_ASYNCIO
+#define SI_QUEUE SI_QUEUE
+#define SI_USER SI_USER
+#define SI_KERNEL SI_KERNEL
+};
+
+
+# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+/* `si_code' values for SIGILL signal. */
+enum
+{
+ ILL_ILLOPC = 1, /* Illegal opcode. */
+# define ILL_ILLOPC ILL_ILLOPC
+ ILL_ILLOPN, /* Illegal operand. */
+# define ILL_ILLOPN ILL_ILLOPN
+ ILL_ILLADR, /* Illegal addressing mode. */
+# define ILL_ILLADR ILL_ILLADR
+ ILL_ILLTRP, /* Illegal trap. */
+# define ILL_ILLTRP ILL_ILLTRP
+ ILL_PRVOPC, /* Privileged opcode. */
+# define ILL_PRVOPC ILL_PRVOPC
+ ILL_PRVREG, /* Privileged register. */
+# define ILL_PRVREG ILL_PRVREG
+ ILL_COPROC, /* Coprocessor error. */
+# define ILL_COPROC ILL_COPROC
+ ILL_BADSTK /* Internal stack error. */
+# define ILL_BADSTK ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal. */
+enum
+{
+ FPE_INTDIV = 1, /* Integer divide by zero. */
+# define FPE_INTDIV FPE_INTDIV
+ FPE_INTOVF, /* Integer overflow. */
+# define FPE_INTOVF FPE_INTOVF
+ FPE_FLTDIV, /* Floating point divide by zero. */
+# define FPE_FLTDIV FPE_FLTDIV
+ FPE_FLTOVF, /* Floating point overflow. */
+# define FPE_FLTOVF FPE_FLTOVF
+ FPE_FLTUND, /* Floating point underflow. */
+# define FPE_FLTUND FPE_FLTUND
+ FPE_FLTRES, /* Floating point inexact result. */
+# define FPE_FLTRES FPE_FLTRES
+ FPE_FLTINV, /* Floating point invalid operation. */
+# define FPE_FLTINV FPE_FLTINV
+ FPE_FLTSUB /* Subscript out of range. */
+# define FPE_FLTSUB FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal. */
+enum
+{
+ SEGV_MAPERR = 1, /* Address not mapped to object. */
+# define SEGV_MAPERR SEGV_MAPERR
+ SEGV_ACCERR, /* Invalid permissions for mapped object. */
+# define SEGV_ACCERR SEGV_ACCERR
+ SEGV_BNDERR, /* Bounds checking failure. */
+# define SEGV_BNDERR SEGV_BNDERR
+ SEGV_PKUERR /* Protection key checking failure. */
+# define SEGV_PKUERR SEGV_PKUERR
+};
+
+/* `si_code' values for SIGBUS signal. */
+enum
+{
+ BUS_ADRALN = 1, /* Invalid address alignment. */
+# define BUS_ADRALN BUS_ADRALN
+ BUS_ADRERR, /* Non-existant physical address. */
+# define BUS_ADRERR BUS_ADRERR
+ BUS_OBJERR, /* Object specific hardware error. */
+# define BUS_OBJERR BUS_OBJERR
+ BUS_MCEERR_AR, /* Hardware memory error: action required. */
+# define BUS_MCEERR_AR BUS_MCEERR_AR
+ BUS_MCEERR_AO /* Hardware memory error: action optional. */
+# define BUS_MCEERR_AO BUS_MCEERR_AO
+};
+# endif
+
+# ifdef __USE_XOPEN_EXTENDED
+/* `si_code' values for SIGTRAP signal. */
+enum
+{
+ TRAP_BRKPT = 1, /* Process breakpoint. */
+# define TRAP_BRKPT TRAP_BRKPT
+ TRAP_TRACE /* Process trace trap. */
+# define TRAP_TRACE TRAP_TRACE
+};
+# endif
+
+# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+/* `si_code' values for SIGCHLD signal. */
+enum
+{
+ CLD_EXITED = 1, /* Child has exited. */
+# define CLD_EXITED CLD_EXITED
+ CLD_KILLED, /* Child was killed. */
+# define CLD_KILLED CLD_KILLED
+ CLD_DUMPED, /* Child terminated abnormally. */
+# define CLD_DUMPED CLD_DUMPED
+ CLD_TRAPPED, /* Traced child has trapped. */
+# define CLD_TRAPPED CLD_TRAPPED
+ CLD_STOPPED, /* Child has stopped. */
+# define CLD_STOPPED CLD_STOPPED
+ CLD_CONTINUED /* Stopped child has continued. */
+# define CLD_CONTINUED CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal. */
+enum
+{
+ POLL_IN = 1, /* Data input available. */
+# define POLL_IN POLL_IN
+ POLL_OUT, /* Output buffers available. */
+# define POLL_OUT POLL_OUT
+ POLL_MSG, /* Input message available. */
+# define POLL_MSG POLL_MSG
+ POLL_ERR, /* I/O error. */
+# define POLL_ERR POLL_ERR
+ POLL_PRI, /* High priority input available. */
+# define POLL_PRI POLL_PRI
+ POLL_HUP /* Device disconnected. */
+# define POLL_HUP POLL_HUP
+};
+# endif
+
+/* Architectures might also add architecture-specific constants.
+ These are all considered GNU extensions. */
+#ifdef __USE_GNU
+# include <bits/siginfo-consts-arch.h>
+#endif
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h
deleted file mode 100644
index b8f130b9e8..0000000000
--- a/sysdeps/unix/sysv/linux/bits/siginfo.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/* siginfo_t, sigevent and constants. Linux version.
- 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/>. */
-
-#if !defined _SIGNAL_H && !defined __need_siginfo_t \
- && !defined __need_sigevent_t
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-#if (!defined __have_sigval_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t \
- || defined __need_sigevent_t))
-# define __have_sigval_t 1
-
-/* Type for data associated with a signal. */
-typedef union sigval
- {
- int sival_int;
- void *sival_ptr;
- } sigval_t;
-#endif
-
-#if (!defined __have_siginfo_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t))
-# define __have_siginfo_t 1
-
-# define __SI_MAX_SIZE 128
-# if __WORDSIZE == 64
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-typedef struct
- {
- int si_signo; /* Signal number. */
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int si_code; /* Signal code. */
-
- union
- {
- int _pad[__SI_PAD_SIZE];
-
- /* kill(). */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- } _kill;
-
- /* POSIX.1b timers. */
- struct
- {
- int si_tid; /* Timer ID. */
- int si_overrun; /* Overrun count. */
- sigval_t si_sigval; /* Signal value. */
- } _timer;
-
- /* POSIX.1b signals. */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- sigval_t si_sigval; /* Signal value. */
- } _rt;
-
- /* SIGCHLD. */
- struct
- {
- __pid_t si_pid; /* Which child. */
- __uid_t si_uid; /* Real user ID of sending process. */
- int si_status; /* Exit value or signal. */
- __clock_t si_utime;
- __clock_t si_stime;
- } _sigchld;
-
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
- struct
- {
- void *si_addr; /* Faulting insn/memory ref. */
- short int si_addr_lsb; /* Valid LSB of the reported address. */
- } _sigfault;
-
- /* SIGPOLL. */
- struct
- {
- long int si_band; /* Band event for SIGPOLL. */
- int si_fd;
- } _sigpoll;
-
- /* SIGSYS. */
- struct
- {
- void *_call_addr; /* Calling user insn. */
- int _syscall; /* Triggering system call number. */
- unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
- } _sigsys;
- } _sifields;
- } siginfo_t;
-
-
-/* X/Open requires some more fields with fixed names. */
-# define si_pid _sifields._kill.si_pid
-# define si_uid _sifields._kill.si_uid
-# define si_timerid _sifields._timer.si_tid
-# define si_overrun _sifields._timer.si_overrun
-# define si_status _sifields._sigchld.si_status
-# define si_utime _sifields._sigchld.si_utime
-# define si_stime _sifields._sigchld.si_stime
-# define si_value _sifields._rt.si_sigval
-# define si_int _sifields._rt.si_sigval.sival_int
-# define si_ptr _sifields._rt.si_sigval.sival_ptr
-# define si_addr _sifields._sigfault.si_addr
-# define si_addr_lsb _sifields._sigfault.si_addr_lsb
-# define si_band _sifields._sigpoll.si_band
-# define si_fd _sifields._sigpoll.si_fd
-# define si_call_addr _sifields._sigsys._call_addr
-# define si_syscall _sifields._sigsys._syscall
-# define si_arch _sifields._sigsys._arch
-
-
-/* Values for `si_code'. Positive values are reserved for kernel-generated
- signals. */
-enum
-{
- SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
-# define SI_ASYNCNL SI_ASYNCNL
- SI_TKILL = -6, /* Sent by tkill. */
-# define SI_TKILL SI_TKILL
- SI_SIGIO, /* Sent by queued SIGIO. */
-# define SI_SIGIO SI_SIGIO
- SI_ASYNCIO, /* Sent by AIO completion. */
-# define SI_ASYNCIO SI_ASYNCIO
- SI_MESGQ, /* Sent by real time mesq state change. */
-# define SI_MESGQ SI_MESGQ
- SI_TIMER, /* Sent by timer expiration. */
-# define SI_TIMER SI_TIMER
- SI_QUEUE, /* Sent by sigqueue. */
-# define SI_QUEUE SI_QUEUE
- SI_USER, /* Sent by kill, sigsend. */
-# define SI_USER SI_USER
- SI_KERNEL = 0x80 /* Send by kernel. */
-#define SI_KERNEL SI_KERNEL
-};
-
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGILL signal. */
-enum
-{
- ILL_ILLOPC = 1, /* Illegal opcode. */
-# define ILL_ILLOPC ILL_ILLOPC
- ILL_ILLOPN, /* Illegal operand. */
-# define ILL_ILLOPN ILL_ILLOPN
- ILL_ILLADR, /* Illegal addressing mode. */
-# define ILL_ILLADR ILL_ILLADR
- ILL_ILLTRP, /* Illegal trap. */
-# define ILL_ILLTRP ILL_ILLTRP
- ILL_PRVOPC, /* Privileged opcode. */
-# define ILL_PRVOPC ILL_PRVOPC
- ILL_PRVREG, /* Privileged register. */
-# define ILL_PRVREG ILL_PRVREG
- ILL_COPROC, /* Coprocessor error. */
-# define ILL_COPROC ILL_COPROC
- ILL_BADSTK /* Internal stack error. */
-# define ILL_BADSTK ILL_BADSTK
-};
-
-/* `si_code' values for SIGFPE signal. */
-enum
-{
- FPE_INTDIV = 1, /* Integer divide by zero. */
-# define FPE_INTDIV FPE_INTDIV
- FPE_INTOVF, /* Integer overflow. */
-# define FPE_INTOVF FPE_INTOVF
- FPE_FLTDIV, /* Floating point divide by zero. */
-# define FPE_FLTDIV FPE_FLTDIV
- FPE_FLTOVF, /* Floating point overflow. */
-# define FPE_FLTOVF FPE_FLTOVF
- FPE_FLTUND, /* Floating point underflow. */
-# define FPE_FLTUND FPE_FLTUND
- FPE_FLTRES, /* Floating point inexact result. */
-# define FPE_FLTRES FPE_FLTRES
- FPE_FLTINV, /* Floating point invalid operation. */
-# define FPE_FLTINV FPE_FLTINV
- FPE_FLTSUB /* Subscript out of range. */
-# define FPE_FLTSUB FPE_FLTSUB
-};
-
-/* `si_code' values for SIGSEGV signal. */
-enum
-{
- SEGV_MAPERR = 1, /* Address not mapped to object. */
-# define SEGV_MAPERR SEGV_MAPERR
- SEGV_ACCERR /* Invalid permissions for mapped object. */
-# define SEGV_ACCERR SEGV_ACCERR
-};
-
-/* `si_code' values for SIGBUS signal. */
-enum
-{
- BUS_ADRALN = 1, /* Invalid address alignment. */
-# define BUS_ADRALN BUS_ADRALN
- BUS_ADRERR, /* Non-existant physical address. */
-# define BUS_ADRERR BUS_ADRERR
- BUS_OBJERR, /* Object specific hardware error. */
-# define BUS_OBJERR BUS_OBJERR
- BUS_MCEERR_AR, /* Hardware memory error: action required. */
-# define BUS_MCEERR_AR BUS_MCEERR_AR
- BUS_MCEERR_AO /* Hardware memory error: action optional. */
-# define BUS_MCEERR_AO BUS_MCEERR_AO
-};
-# endif
-
-# ifdef __USE_XOPEN_EXTENDED
-/* `si_code' values for SIGTRAP signal. */
-enum
-{
- TRAP_BRKPT = 1, /* Process breakpoint. */
-# define TRAP_BRKPT TRAP_BRKPT
- TRAP_TRACE /* Process trace trap. */
-# define TRAP_TRACE TRAP_TRACE
-};
-# endif
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGCHLD signal. */
-enum
-{
- CLD_EXITED = 1, /* Child has exited. */
-# define CLD_EXITED CLD_EXITED
- CLD_KILLED, /* Child was killed. */
-# define CLD_KILLED CLD_KILLED
- CLD_DUMPED, /* Child terminated abnormally. */
-# define CLD_DUMPED CLD_DUMPED
- CLD_TRAPPED, /* Traced child has trapped. */
-# define CLD_TRAPPED CLD_TRAPPED
- CLD_STOPPED, /* Child has stopped. */
-# define CLD_STOPPED CLD_STOPPED
- CLD_CONTINUED /* Stopped child has continued. */
-# define CLD_CONTINUED CLD_CONTINUED
-};
-
-/* `si_code' values for SIGPOLL signal. */
-enum
-{
- POLL_IN = 1, /* Data input available. */
-# define POLL_IN POLL_IN
- POLL_OUT, /* Output buffers available. */
-# define POLL_OUT POLL_OUT
- POLL_MSG, /* Input message available. */
-# define POLL_MSG POLL_MSG
- POLL_ERR, /* I/O error. */
-# define POLL_ERR POLL_ERR
- POLL_PRI, /* High priority input available. */
-# define POLL_PRI POLL_PRI
- POLL_HUP /* Device disconnected. */
-# define POLL_HUP POLL_HUP
-};
-# endif
-
-# undef __need_siginfo_t
-#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
-
-
-#if (defined _SIGNAL_H || defined __need_sigevent_t) \
- && !defined __have_sigevent_t
-# define __have_sigevent_t 1
-
-/* Structure to transport application-defined values with signals. */
-# define __SIGEV_MAX_SIZE 64
-# if __WORDSIZE == 64
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-/* Forward declaration. */
-# ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-# endif
-
-typedef struct sigevent
- {
- sigval_t sigev_value;
- int sigev_signo;
- int sigev_notify;
-
- union
- {
- int _pad[__SIGEV_PAD_SIZE];
-
- /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
- thread to receive the signal. */
- __pid_t _tid;
-
- struct
- {
- void (*_function) (sigval_t); /* Function to start. */
- pthread_attr_t *_attribute; /* Thread attributes. */
- } _sigev_thread;
- } _sigev_un;
- } sigevent_t;
-
-/* POSIX names to access some of the members. */
-# define sigev_notify_function _sigev_un._sigev_thread._function
-# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
-
-/* `sigev_notify' values. */
-enum
-{
- SIGEV_SIGNAL = 0, /* Notify via signal. */
-# define SIGEV_SIGNAL SIGEV_SIGNAL
- SIGEV_NONE, /* Other notification: meaningless. */
-# define SIGEV_NONE SIGEV_NONE
- SIGEV_THREAD, /* Deliver via thread creation. */
-# define SIGEV_THREAD SIGEV_THREAD
-
- SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
-#define SIGEV_THREAD_ID SIGEV_THREAD_ID
-};
-
-#endif /* have _SIGNAL_H. */
diff --git a/sysdeps/unix/sysv/linux/bits/signalfd.h b/sysdeps/unix/sysv/linux/bits/signalfd.h
index bac90e5d51..9e5271e868 100644
--- a/sysdeps/unix/sysv/linux/bits/signalfd.h
+++ b/sysdeps/unix/sysv/linux/bits/signalfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/signum.h b/sysdeps/unix/sysv/linux/bits/signum.h
index 0e4eea1f57..0f70ce5059 100644
--- a/sysdeps/unix/sysv/linux/bits/signum.h
+++ b/sysdeps/unix/sysv/linux/bits/signum.h
@@ -1,5 +1,5 @@
/* Signal number definitions. Linux version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software 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,64 +16,43 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _SIGNAL_H
+#ifndef _BITS_SIGNUM_H
+#define _BITS_SIGNUM_H 1
-/* Fake signal functions. */
-#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
-#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
-#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
-
-#ifdef __USE_UNIX98
-# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+#ifndef _SIGNAL_H
+#error "Never include <bits/signum.h> directly; use <signal.h> instead."
#endif
-
-/* Signals. */
-#define SIGHUP 1 /* Hangup (POSIX). */
-#define SIGINT 2 /* Interrupt (ANSI). */
-#define SIGQUIT 3 /* Quit (POSIX). */
-#define SIGILL 4 /* Illegal instruction (ANSI). */
-#define SIGTRAP 5 /* Trace trap (POSIX). */
-#define SIGABRT 6 /* Abort (ANSI). */
-#define SIGIOT 6 /* IOT trap (4.2 BSD). */
-#define SIGBUS 7 /* BUS error (4.2 BSD). */
-#define SIGFPE 8 /* Floating-point exception (ANSI). */
-#define SIGKILL 9 /* Kill, unblockable (POSIX). */
-#define SIGUSR1 10 /* User-defined signal 1 (POSIX). */
-#define SIGSEGV 11 /* Segmentation violation (ANSI). */
-#define SIGUSR2 12 /* User-defined signal 2 (POSIX). */
-#define SIGPIPE 13 /* Broken pipe (POSIX). */
-#define SIGALRM 14 /* Alarm clock (POSIX). */
-#define SIGTERM 15 /* Termination (ANSI). */
-#define SIGSTKFLT 16 /* Stack fault. */
-#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
-#define SIGCHLD 17 /* Child status has changed (POSIX). */
-#define SIGCONT 18 /* Continue (POSIX). */
-#define SIGSTOP 19 /* Stop, unblockable (POSIX). */
-#define SIGTSTP 20 /* Keyboard stop (POSIX). */
-#define SIGTTIN 21 /* Background read from tty (POSIX). */
-#define SIGTTOU 22 /* Background write to tty (POSIX). */
-#define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */
-#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */
-#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */
-#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */
-#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */
-#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */
-#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
-#define SIGIO 29 /* I/O now possible (4.2 BSD). */
-#define SIGPWR 30 /* Power failure restart (System V). */
-#define SIGSYS 31 /* Bad system call. */
-#define SIGUNUSED 31
-
-#define _NSIG 65 /* Biggest signal number + 1
- (including real-time signals). */
-
-#define SIGRTMIN (__libc_current_sigrtmin ())
-#define SIGRTMAX (__libc_current_sigrtmax ())
-
-/* These are the hard limits of the kernel. These values should not be
- used directly at user level. */
-#define __SIGRTMIN 32
-#define __SIGRTMAX (_NSIG - 1)
+#include <bits/signum-generic.h>
+
+/* Adjustments and additions to the signal number constants for
+ most Linux systems. */
+
+#define SIGSTKFLT 16 /* Stack fault (obsolete). */
+#define SIGPWR 30 /* Power failure imminent. */
+
+#undef SIGBUS
+#define SIGBUS 7
+#undef SIGUSR1
+#define SIGUSR1 10
+#undef SIGUSR2
+#define SIGUSR2 12
+#undef SIGCHLD
+#define SIGCHLD 17
+#undef SIGCONT
+#define SIGCONT 18
+#undef SIGSTOP
+#define SIGSTOP 19
+#undef SIGTSTP
+#define SIGTSTP 20
+#undef SIGURG
+#define SIGURG 23
+#undef SIGPOLL
+#define SIGPOLL 29
+#undef SIGSYS
+#define SIGSYS 31
+
+#undef __SIGRTMAX
+#define __SIGRTMAX 64
#endif /* <signal.h> included. */
diff --git a/sysdeps/unix/sysv/linux/bits/sigset.h b/sysdeps/unix/sysv/linux/bits/sigset.h
deleted file mode 100644
index 72de7b5c58..0000000000
--- a/sysdeps/unix/sysv/linux/bits/sigset.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* __sig_atomic_t, __sigset_t, and related definitions. Linux version.
- Copyright (C) 1991-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 _SIGSET_H_types
-# define _SIGSET_H_types 1
-
-typedef int __sig_atomic_t;
-
-/* A `sigset_t' has a bit for each signal. */
-
-# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
-typedef struct
- {
- unsigned long int __val[_SIGSET_NWORDS];
- } __sigset_t;
-
-#endif
-
-
-/* We only want to define these functions if <signal.h> was actually
- included; otherwise we were included just to define the types. Since we
- are namespace-clean, it wouldn't hurt to define extra macros. But
- trouble can be caused by functions being defined (e.g., any global
- register vars declared later will cause compilation errors). */
-
-#if !defined _SIGSET_H_fns && defined _SIGNAL_H
-# define _SIGSET_H_fns 1
-
-# ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE __extern_inline
-# endif
-
-/* Return a mask that includes the bit for SIG only. */
-# define __sigmask(sig) \
- (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int))))
-
-/* Return the word index for SIG. */
-# define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int)))
-
-# if defined __GNUC__ && __GNUC__ >= 2
-# define __sigemptyset(set) \
- (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
- sigset_t *__set = (set); \
- while (--__cnt >= 0) __set->__val[__cnt] = 0; \
- 0; }))
-# define __sigfillset(set) \
- (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
- sigset_t *__set = (set); \
- while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \
- 0; }))
-
-# ifdef __USE_GNU
-/* The POSIX does not specify for handling the whole signal set in one
- command. This is often wanted and so we define three more functions
- here. */
-# define __sigisemptyset(set) \
- (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
- const sigset_t *__set = (set); \
- int __ret = __set->__val[--__cnt]; \
- while (!__ret && --__cnt >= 0) \
- __ret = __set->__val[__cnt]; \
- __ret == 0; }))
-# define __sigandset(dest, left, right) \
- (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
- sigset_t *__dest = (dest); \
- const sigset_t *__left = (left); \
- const sigset_t *__right = (right); \
- while (--__cnt >= 0) \
- __dest->__val[__cnt] = (__left->__val[__cnt] \
- & __right->__val[__cnt]); \
- 0; }))
-# define __sigorset(dest, left, right) \
- (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
- sigset_t *__dest = (dest); \
- const sigset_t *__left = (left); \
- const sigset_t *__right = (right); \
- while (--__cnt >= 0) \
- __dest->__val[__cnt] = (__left->__val[__cnt] \
- | __right->__val[__cnt]); \
- 0; }))
-# endif
-# endif
-
-/* These functions needn't check for a bogus signal number -- error
- checking is done in the non __ versions. */
-
-extern int __sigismember (const __sigset_t *, int);
-extern int __sigaddset (__sigset_t *, int);
-extern int __sigdelset (__sigset_t *, int);
-
-# ifdef __USE_EXTERN_INLINES
-# define __SIGSETFN(NAME, BODY, CONST) \
- _EXTERN_INLINE int \
- NAME (CONST __sigset_t *__set, int __sig) \
- { \
- unsigned long int __mask = __sigmask (__sig); \
- unsigned long int __word = __sigword (__sig); \
- return BODY; \
- }
-
-__SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, const)
-__SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), )
-__SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), )
-
-# undef __SIGSETFN
-# endif
-
-
-#endif /* ! _SIGSET_H_fns. */
diff --git a/sysdeps/unix/sysv/linux/bits/sigstack.h b/sysdeps/unix/sysv/linux/bits/sigstack.h
index 115a98ec6b..c9e7ddfcaf 100644
--- a/sysdeps/unix/sysv/linux/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/bits/sigstack.h
@@ -1,5 +1,5 @@
/* sigstack, sigaltstack definitions.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software 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,39 +16,17 @@
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
-
-/* Structure describing a signal stack (obsolete). */
-struct sigstack
- {
- void *ss_sp; /* Signal stack pointer. */
- int ss_onstack; /* Nonzero if executing on this stack. */
- };
-
-
-/* Possible values for `ss_flags.'. */
-enum
-{
- SS_ONSTACK = 1,
-#define SS_ONSTACK SS_ONSTACK
- SS_DISABLE
-#define SS_DISABLE SS_DISABLE
-};
-
/* Minimum stack size for a signal handler. */
#define MINSIGSTKSZ 2048
/* 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 0581c79bc3..fa409f0fab 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -1,5 +1,5 @@
/* System-specific socket constants and types. Linux version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -82,7 +82,10 @@ typedef __socklen_t socklen_t;
#define PF_ALG 38 /* Algorithm sockets. */
#define PF_NFC 39 /* NFC sockets. */
#define PF_VSOCK 40 /* vSockets. */
-#define PF_MAX 41 /* For now.. */
+#define PF_KCM 41 /* Kernel Connection Multiplexor. */
+#define PF_QIPCRTR 42 /* Qualcomm IPC Router. */
+#define PF_SMC 43 /* SMC sockets. */
+#define PF_MAX 44 /* For now.. */
/* Address families. */
#define AF_UNSPEC PF_UNSPEC
@@ -129,6 +132,9 @@ typedef __socklen_t socklen_t;
#define AF_ALG PF_ALG
#define AF_NFC PF_NFC
#define AF_VSOCK PF_VSOCK
+#define AF_KCM PF_KCM
+#define AF_QIPCRTR PF_QIPCRTR
+#define AF_SMC PF_SMC
#define AF_MAX PF_MAX
/* Socket level values. Others are defined in the appropriate headers.
@@ -142,6 +148,22 @@ typedef __socklen_t socklen_t;
#define SOL_ATM 264 /* ATM layer (cell level). */
#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
#define SOL_IRDA 266
+#define SOL_NETBEUI 267
+#define SOL_LLC 268
+#define SOL_DCCP 269
+#define SOL_NETLINK 270
+#define SOL_TIPC 271
+#define SOL_RXRPC 272
+#define SOL_PPPOL2TP 273
+#define SOL_BLUETOOTH 274
+#define SOL_PNPIPE 275
+#define SOL_RDS 276
+#define SOL_IUCV 277
+#define SOL_CAIF 278
+#define SOL_ALG 279
+#define SOL_NFC 280
+#define SOL_KCM 281
+#define SOL_TLS 282
/* Maximum queue length specifiable by listen. */
#define SOMAXCONN 128
@@ -158,16 +180,16 @@ struct sockaddr
/* Structure large enough to hold any socket address (with the historical
- exception of AF_UNIX). We reserve 128 bytes. */
+ exception of AF_UNIX). */
#define __ss_aligntype unsigned long int
-#define _SS_SIZE 128
-#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+#define _SS_PADSIZE \
+ (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype))
struct sockaddr_storage
{
__SOCKADDR_COMMON (ss_); /* Address family, etc. */
- __ss_aligntype __ss_align; /* Force desired alignment. */
char __ss_padding[_SS_PADSIZE];
+ __ss_aligntype __ss_align; /* Force desired alignment. */
};
@@ -213,6 +235,10 @@ enum
#define MSG_MORE MSG_MORE
MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/
#define MSG_WAITFORONE MSG_WAITFORONE
+ MSG_BATCH = 0x40000, /* sendmmsg: more messages coming. */
+#define MSG_BATCH MSG_BATCH
+ MSG_ZEROCOPY = 0x4000000, /* Use user data in kernel path. */
+#define MSG_ZEROCOPY MSG_ZEROCOPY
MSG_FASTOPEN = 0x20000000, /* Send data in TCP SYN. */
#define MSG_FASTOPEN MSG_FASTOPEN
@@ -252,13 +278,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))
@@ -344,6 +370,21 @@ struct ucred
# define __SYS_SOCKET_H_undef_SIOCSPGRP
# endif
#endif
+#ifndef IOCSIZE_MASK
+# define __SYS_SOCKET_H_undef_IOCSIZE_MASK
+#endif
+#ifndef IOCSIZE_SHIFT
+# define __SYS_SOCKET_H_undef_IOCSIZE_SHIFT
+#endif
+#ifndef IOC_IN
+# define __SYS_SOCKET_H_undef_IOC_IN
+#endif
+#ifndef IOC_INOUT
+# define __SYS_SOCKET_H_undef_IOC_INOUT
+#endif
+#ifndef IOC_OUT
+# define __SYS_SOCKET_H_undef_IOC_OUT
+#endif
/* Get socket manipulation related informations from kernel headers. */
#include <asm/socket.h>
@@ -378,6 +419,26 @@ struct ucred
# undef SIOCSPGRP
# endif
#endif
+#ifdef __SYS_SOCKET_H_undef_IOCSIZE_MASK
+# undef __SYS_SOCKET_H_undef_IOCSIZE_MASK
+# undef IOCSIZE_MASK
+#endif
+#ifdef __SYS_SOCKET_H_undef_IOCSIZE_SHIFT
+# undef __SYS_SOCKET_H_undef_IOCSIZE_SHIFT
+# undef IOCSIZE_SHIFT
+#endif
+#ifdef __SYS_SOCKET_H_undef_IOC_IN
+# undef __SYS_SOCKET_H_undef_IOC_IN
+# undef IOC_IN
+#endif
+#ifdef __SYS_SOCKET_H_undef_IOC_INOUT
+# undef __SYS_SOCKET_H_undef_IOC_INOUT
+# undef IOC_INOUT
+#endif
+#ifdef __SYS_SOCKET_H_undef_IOC_OUT
+# undef __SYS_SOCKET_H_undef_IOC_OUT
+# undef IOC_OUT
+#endif
/* Structure used to manipulate the SO_LINGER option. */
struct linger
diff --git a/sysdeps/unix/sysv/linux/bits/socket_type.h b/sysdeps/unix/sysv/linux/bits/socket_type.h
index 8501efb98d..035394ab77 100644
--- a/sysdeps/unix/sysv/linux/bits/socket_type.h
+++ b/sysdeps/unix/sysv/linux/bits/socket_type.h
@@ -1,5 +1,5 @@
/* Define enum __socket_type for generic Linux.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/ss_flags.h b/sysdeps/unix/sysv/linux/bits/ss_flags.h
new file mode 100644
index 0000000000..f7fb9d02a3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/ss_flags.h
@@ -0,0 +1,35 @@
+/* ss_flags values for stack_t. Linux version.
+ Copyright (C) 1998-2018 Free Software 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 _BITS_SS_FLAGS_H
+#define _BITS_SS_FLAGS_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never include this file directly. Use <signal.h> instead"
+#endif
+
+/* Possible values for `ss_flags'. */
+enum
+{
+ SS_ONSTACK = 1,
+#define SS_ONSTACK SS_ONSTACK
+ SS_DISABLE
+#define SS_DISABLE SS_DISABLE
+};
+
+#endif /* bits/ss_flags.h */
diff --git a/sysdeps/unix/sysv/linux/bits/stat.h b/sysdeps/unix/sysv/linux/bits/stat.h
index 30d92f3968..48ef82d862 100644
--- a/sysdeps/unix/sysv/linux/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/statfs.h b/sysdeps/unix/sysv/linux/bits/statfs.h
index 28b5952400..f073867e22 100644
--- a/sysdeps/unix/sysv/linux/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/statvfs.h b/sysdeps/unix/sysv/linux/bits/statvfs.h
index 9244401874..0d95901a22 100644
--- a/sysdeps/unix/sysv/linux/bits/statvfs.h
+++ b/sysdeps/unix/sysv/linux/bits/statvfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/sys_errlist.h b/sysdeps/unix/sysv/linux/bits/sys_errlist.h
index c6385f1227..4f725e95ff 100644
--- a/sysdeps/unix/sysv/linux/bits/sys_errlist.h
+++ b/sysdeps/unix/sysv/linux/bits/sys_errlist.h
@@ -1,5 +1,5 @@
/* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h
index bbf093dc67..35efa97576 100644
--- a/sysdeps/unix/sysv/linux/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/bits/termios.h
@@ -1,5 +1,5 @@
/* termios type and macro definitions. Linux version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -177,7 +177,7 @@ struct termios
/* c_lflag bits */
#define ISIG 0000001
#define ICANON 0000002
-#if defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
# define XCASE 0000004
#endif
#define ECHO 0000010
diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h
index 87eb51f2ed..3df0dfd33a 100644
--- a/sysdeps/unix/sysv/linux/bits/time.h
+++ b/sysdeps/unix/sysv/linux/bits/time.h
@@ -1,5 +1,5 @@
/* System-dependent timing definitions. Linux version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,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/timerfd.h b/sysdeps/unix/sysv/linux/bits/timerfd.h
index 0ba607e168..305f1e4e9b 100644
--- a/sysdeps/unix/sysv/linux/bits/timerfd.h
+++ b/sysdeps/unix/sysv/linux/bits/timerfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/timex.h b/sysdeps/unix/sysv/linux/bits/timex.h
index 5eb7ccbd2e..1dbcc0b57d 100644
--- a/sysdeps/unix/sysv/linux/bits/timex.h
+++ b/sysdeps/unix/sysv/linux/bits/timex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,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/bits/types/__sigset_t.h b/sysdeps/unix/sysv/linux/bits/types/__sigset_t.h
new file mode 100644
index 0000000000..e2f18acf30
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/types/__sigset_t.h
@@ -0,0 +1,10 @@
+#ifndef ____sigset_t_defined
+#define ____sigset_t_defined
+
+#define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
+typedef struct
+{
+ unsigned long int __val[_SIGSET_NWORDS];
+} __sigset_t;
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/types/sigevent_t.h b/sysdeps/unix/sysv/linux/bits/types/sigevent_t.h
new file mode 100644
index 0000000000..e8b28de7e3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/types/sigevent_t.h
@@ -0,0 +1,48 @@
+#ifndef __sigevent_t_defined
+#define __sigevent_t_defined 1
+
+#include <bits/wordsize.h>
+#include <bits/types.h>
+#include <bits/types/__sigval_t.h>
+
+#define __SIGEV_MAX_SIZE 64
+#if __WORDSIZE == 64
+# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+#else
+# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+#endif
+
+/* Forward declaration. */
+#ifndef __have_pthread_attr_t
+typedef union pthread_attr_t pthread_attr_t;
+# define __have_pthread_attr_t 1
+#endif
+
+/* Structure to transport application-defined values with signals. */
+typedef struct sigevent
+ {
+ __sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+
+ union
+ {
+ int _pad[__SIGEV_PAD_SIZE];
+
+ /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+ thread to receive the signal. */
+ __pid_t _tid;
+
+ struct
+ {
+ void (*_function) (__sigval_t); /* Function to start. */
+ pthread_attr_t *_attribute; /* Thread attributes. */
+ } _sigev_thread;
+ } _sigev_un;
+ } sigevent_t;
+
+/* POSIX names to access some of the members. */
+#define sigev_notify_function _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/types/siginfo_t.h b/sysdeps/unix/sysv/linux/bits/types/siginfo_t.h
new file mode 100644
index 0000000000..33766d1813
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/types/siginfo_t.h
@@ -0,0 +1,151 @@
+#ifndef __siginfo_t_defined
+#define __siginfo_t_defined 1
+
+#include <bits/wordsize.h>
+#include <bits/types.h>
+#include <bits/types/__sigval_t.h>
+
+#define __SI_MAX_SIZE 128
+#if __WORDSIZE == 64
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
+#else
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
+#endif
+
+/* Some fields of siginfo_t have architecture-specific variations. */
+#include <bits/siginfo-arch.h>
+#ifndef __SI_ALIGNMENT
+# define __SI_ALIGNMENT /* nothing */
+#endif
+#ifndef __SI_BAND_TYPE
+# define __SI_BAND_TYPE long int
+#endif
+#ifndef __SI_CLOCK_T
+# define __SI_CLOCK_T __clock_t
+#endif
+#ifndef __SI_ERRNO_THEN_CODE
+# define __SI_ERRNO_THEN_CODE 1
+#endif
+#ifndef __SI_HAVE_SIGSYS
+# define __SI_HAVE_SIGSYS 1
+#endif
+#ifndef __SI_SIGFAULT_ADDL
+# define __SI_SIGFAULT_ADDL /* nothing */
+#endif
+
+typedef struct
+ {
+ int si_signo; /* Signal number. */
+#if __SI_ERRNO_THEN_CODE
+ int si_errno; /* If non-zero, an errno value associated with
+ this signal, as defined in <errno.h>. */
+ int si_code; /* Signal code. */
+#else
+ int si_code;
+ int si_errno;
+#endif
+#if __WORDSIZE == 64
+ int __pad0; /* Explicit padding. */
+#endif
+
+ union
+ {
+ int _pad[__SI_PAD_SIZE];
+
+ /* kill(). */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ } _kill;
+
+ /* POSIX.1b timers. */
+ struct
+ {
+ int si_tid; /* Timer ID. */
+ int si_overrun; /* Overrun count. */
+ __sigval_t si_sigval; /* Signal value. */
+ } _timer;
+
+ /* POSIX.1b signals. */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ __sigval_t si_sigval; /* Signal value. */
+ } _rt;
+
+ /* SIGCHLD. */
+ struct
+ {
+ __pid_t si_pid; /* Which child. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ int si_status; /* Exit value or signal. */
+ __SI_CLOCK_T si_utime;
+ __SI_CLOCK_T si_stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
+ struct
+ {
+ void *si_addr; /* Faulting insn/memory ref. */
+ __SI_SIGFAULT_ADDL
+ short int si_addr_lsb; /* Valid LSB of the reported address. */
+ union
+ {
+ /* used when si_code=SEGV_BNDERR */
+ struct
+ {
+ void *_lower;
+ void *_upper;
+ } _addr_bnd;
+ /* used when si_code=SEGV_PKUERR */
+ __uint32_t _pkey;
+ } _bounds;
+ } _sigfault;
+
+ /* SIGPOLL. */
+ struct
+ {
+ long int si_band; /* Band event for SIGPOLL. */
+ int si_fd;
+ } _sigpoll;
+
+ /* SIGSYS. */
+#if __SI_HAVE_SIGSYS
+ struct
+ {
+ void *_call_addr; /* Calling user insn. */
+ int _syscall; /* Triggering system call number. */
+ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
+ } _sigsys;
+#endif
+ } _sifields;
+ } siginfo_t __SI_ALIGNMENT;
+
+
+/* X/Open requires some more fields with fixed names. */
+#define si_pid _sifields._kill.si_pid
+#define si_uid _sifields._kill.si_uid
+#define si_timerid _sifields._timer.si_tid
+#define si_overrun _sifields._timer.si_overrun
+#define si_status _sifields._sigchld.si_status
+#define si_utime _sifields._sigchld.si_utime
+#define si_stime _sifields._sigchld.si_stime
+#define si_value _sifields._rt.si_sigval
+#define si_int _sifields._rt.si_sigval.sival_int
+#define si_ptr _sifields._rt.si_sigval.sival_ptr
+#define si_addr _sifields._sigfault.si_addr
+#define si_addr_lsb _sifields._sigfault.si_addr_lsb
+#define si_lower _sifields._sigfault._bounds._addr_bnd._lower
+#define si_upper _sifields._sigfault._bounds._addr_bnd._upper
+#define si_pkey _sifields._sigfault._bounds._pkey
+#define si_band _sifields._sigpoll.si_band
+#define si_fd _sifields._sigpoll.si_fd
+#if __SI_HAVE_SIGSYS
+# define si_call_addr _sifields._sigsys._call_addr
+# define si_syscall _sifields._sigsys._syscall
+# define si_arch _sifields._sigsys._arch
+#endif
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/types/stack_t.h b/sysdeps/unix/sysv/linux/bits/types/stack_t.h
new file mode 100644
index 0000000000..ce809ade4a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/types/stack_t.h
@@ -0,0 +1,33 @@
+/* Define stack_t. Linux version.
+ Copyright (C) 1998-2018 Free Software 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 __stack_t_defined
+#define __stack_t_defined 1
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Structure describing a signal stack. */
+typedef struct
+ {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } stack_t;
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/uio-ext.h b/sysdeps/unix/sysv/linux/bits/uio-ext.h
new file mode 100644
index 0000000000..8698bc1200
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/uio-ext.h
@@ -0,0 +1,53 @@
+/* Operating system-specific extensions to sys/uio.h - Linux version.
+ Copyright (C) 1996-2018 Free Software 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 _BITS_UIO_EXT_H
+#define _BITS_UIO_EXT_H 1
+
+#ifndef _SYS_UIO_H
+# error "Never include <bits/uio-ext.h> directly; use <sys/uio.h> instead."
+#endif
+
+__BEGIN_DECLS
+
+/* Read from another process' address space. */
+extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec,
+ unsigned long int __liovcnt,
+ const struct iovec *__rvec,
+ unsigned long int __riovcnt,
+ unsigned long int __flags)
+ __THROW;
+
+/* Write to another process' address space. */
+extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
+ unsigned long int __liovcnt,
+ const struct iovec *__rvec,
+ unsigned long int __riovcnt,
+ unsigned long int __flags)
+ __THROW;
+
+/* Flags for preadv2/pwritev2. */
+#define RWF_HIPRI 0x00000001 /* High priority request. */
+#define RWF_DSYNC 0x00000002 /* per-IO O_DSYNC. */
+#define RWF_SYNC 0x00000004 /* per-IO O_SYNC. */
+#define RWF_NOWAIT 0x00000008 /* per-IO nonblocking mode. */
+#define RWF_APPEND 0x00000010 /* per-IO O_APPEND. */
+
+__END_DECLS
+
+#endif /* bits/uio-ext.h */
diff --git a/sysdeps/unix/sysv/linux/bits/uio.h b/sysdeps/unix/sysv/linux/bits/uio.h
deleted file mode 100644
index 7684b3ed32..0000000000
--- a/sysdeps/unix/sysv/linux/bits/uio.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* 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/>. */
-
-#if !defined _SYS_UIO_H && !defined _FCNTL_H
-# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
-#endif
-
-#ifndef _BITS_UIO_H
-#define _BITS_UIO_H 1
-
-#include <sys/types.h>
-
-
-/* We should normally use the Linux kernel header file to define this
- type and macros but this calls for trouble because of the header
- includes other kernel headers. */
-
-/* Size of object which can be written atomically.
-
- This macro has different values in different kernel versions. The
- latest versions of the kernel use 1024 and this is good choice. Since
- the C library implementation of readv/writev is able to emulate the
- functionality even if the currently running kernel does not support
- this large value the readv/writev call will not fail because of this. */
-#define UIO_MAXIOV 1024
-
-
-/* Structure for scatter/gather I/O. */
-struct iovec
- {
- void *iov_base; /* Pointer to data. */
- size_t iov_len; /* Length of data. */
- };
-
-#endif
-
-
-#ifdef __USE_GNU
-# if defined _SYS_UIO_H && !defined _BITS_UIO_H_FOR_SYS_UIO_H
-# define _BITS_UIO_H_FOR_SYS_UIO_H 1
-
-__BEGIN_DECLS
-
-/* Read from another process' address space. */
-extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec,
- unsigned long int __liovcnt,
- const struct iovec *__rvec,
- unsigned long int __riovcnt,
- unsigned long int __flags)
- __THROW;
-
-/* Write to another process' address space. */
-extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
- unsigned long int __liovcnt,
- const struct iovec *__rvec,
- unsigned long int __riovcnt,
- unsigned long int __flags)
- __THROW;
-
-__END_DECLS
-
-# endif
-#endif
diff --git a/sysdeps/unix/sysv/linux/bits/uio_lim.h b/sysdeps/unix/sysv/linux/bits/uio_lim.h
new file mode 100644
index 0000000000..a443fd8e5f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/uio_lim.h
@@ -0,0 +1,32 @@
+/* Implementation limits related to sys/uio.h - Linux version.
+ Copyright (C) 2017-2018 Free Software 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 _BITS_UIO_LIM_H
+#define _BITS_UIO_LIM_H 1
+
+/* Maximum length of the 'struct iovec' array in a single call to
+ readv or writev.
+
+ This macro has different values in different kernel versions. The
+ latest versions of the kernel use 1024 and this is good choice. Since
+ the C library implementation of readv/writev is able to emulate the
+ functionality even if the currently running kernel does not support
+ this large value the readv/writev call will not fail because of this. */
+#define __IOV_MAX 1024
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/utsname.h b/sysdeps/unix/sysv/linux/bits/utsname.h
index 070795e84a..9cc1c3523d 100644
--- a/sysdeps/unix/sysv/linux/bits/utsname.h
+++ b/sysdeps/unix/sysv/linux/bits/utsname.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/bits/waitflags.h b/sysdeps/unix/sysv/linux/bits/waitflags.h
index 90dd8ebff7..e8b1dddfe4 100644
--- a/sysdeps/unix/sysv/linux/bits/waitflags.h
+++ b/sysdeps/unix/sysv/linux/bits/waitflags.h
@@ -1,5 +1,5 @@
/* Definitions of flag bits for `waitpid' et al.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,10 +26,12 @@
#define WUNTRACED 2 /* Report status of stopped children. */
/* Bits in the fourth argument to `waitid'. */
-#define WSTOPPED 2 /* Report stopped child (same as WUNTRACED). */
-#define WEXITED 4 /* Report dead child. */
-#define WCONTINUED 8 /* Report continued child. */
-#define WNOWAIT 0x01000000 /* Don't reap, just poll status. */
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+# define WSTOPPED 2 /* Report stopped child (same as WUNTRACED). */
+# define WEXITED 4 /* Report dead child. */
+# define WCONTINUED 8 /* Report continued child. */
+# define WNOWAIT 0x01000000 /* Don't reap, just poll status. */
+#endif
#define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads
in this group */
diff --git a/sysdeps/unix/sysv/linux/check_native.c b/sysdeps/unix/sysv/linux/check_native.c
index b3cbbe369d..6eed8d74e0 100644
--- a/sysdeps/unix/sysv/linux/check_native.c
+++ b/sysdeps/unix/sysv/linux/check_native.c
@@ -1,5 +1,5 @@
/* Determine whether interfaces use native transport. Linux version.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -41,7 +41,7 @@ void
__check_native (uint32_t a1_index, int *a1_native,
uint32_t a2_index, int *a2_native)
{
- int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ int fd = __socket (PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE);
struct sockaddr_nl nladdr;
memset (&nladdr, '\0', sizeof (nladdr));
@@ -111,10 +111,13 @@ __check_native (uint32_t a1_index, int *a1_native,
{
struct msghdr msg =
{
- (void *) &nladdr, sizeof (nladdr),
- &iov, 1,
- NULL, 0,
- 0
+ .msg_name = (void *) &nladdr,
+ .msg_namelen = sizeof (nladdr),
+ .msg_iov = &iov,
+ .msg_iovlen = 1,
+ .msg_control = NULL,
+ .msg_controllen = 0,
+ .msg_flags = 0
};
ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
@@ -164,7 +167,7 @@ __check_native (uint32_t a1_index, int *a1_native,
while (! done);
out:
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
return;
diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
index d55953a64d..04cd104aec 100644
--- a/sysdeps/unix/sysv/linux/check_pf.c
+++ b/sysdeps/unix/sysv/linux/check_pf.c
@@ -1,5 +1,5 @@
/* Determine protocol families for which interfaces exist. Linux version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -158,10 +158,13 @@ make_request (int fd, pid_t pid)
{
struct msghdr msg =
{
- (void *) &nladdr, sizeof (nladdr),
- &iov, 1,
- NULL, 0,
- 0
+ .msg_name = (void *) &nladdr,
+ .msg_namelen = sizeof (nladdr),
+ .msg_iov = &iov,
+ .msg_iovlen = 1,
+ .msg_control = NULL,
+ .msg_controllen = 0,
+ .msg_flags = 0
};
ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
@@ -310,7 +313,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
}
else
{
- int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ int fd = __socket (PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE);
if (__glibc_likely (fd >= 0))
{
@@ -325,7 +328,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
&addr_len) == 0)
data = make_request (fd, nladdr.nl_pid);
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
}
if (data != NULL)
diff --git a/sysdeps/unix/sysv/linux/clock.c b/sysdeps/unix/sysv/linux/clock.c
index 0df58c557f..d3771bd862 100644
--- a/sysdeps/unix/sysv/linux/clock.c
+++ b/sysdeps/unix/sysv/linux/clock.c
@@ -1,5 +1,5 @@
/* Return the time used by the program so far (user time + system time).
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
index 0d8ca6319c..190a47950e 100644
--- a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
+++ b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
@@ -1,5 +1,5 @@
/* clock_getcpuclockid -- Get a clockid_t for process CPU time. Linux version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c
index 817b2dec8c..5d94f59afe 100644
--- a/sysdeps/unix/sysv/linux/clock_getres.c
+++ b/sysdeps/unix/sysv/linux/clock_getres.c
@@ -1,5 +1,5 @@
/* clock_getres -- Get the resolution of a POSIX clockid_t. Linux version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c
index f6be61bcb6..d837fa36b1 100644
--- a/sysdeps/unix/sysv/linux/clock_gettime.c
+++ b/sysdeps/unix/sysv/linux/clock_gettime.c
@@ -1,5 +1,5 @@
/* clock_gettime -- Get current time from a POSIX clockid_t. Linux version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c b/sysdeps/unix/sysv/linux/clock_nanosleep.c
index 637244964e..93d5d6ef12 100644
--- a/sysdeps/unix/sysv/linux/clock_nanosleep.c
+++ b/sysdeps/unix/sysv/linux/clock_nanosleep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/clock_settime.c b/sysdeps/unix/sysv/linux/clock_settime.c
index bfd3064998..5f3f22f74b 100644
--- a/sysdeps/unix/sysv/linux/clock_settime.c
+++ b/sysdeps/unix/sysv/linux/clock_settime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nacl/close.c b/sysdeps/unix/sysv/linux/close.c
index 5d33d2a1f7..fa0938bd89 100644
--- a/sysdeps/nacl/close.c
+++ b/sysdeps/unix/sysv/linux/close.c
@@ -1,5 +1,5 @@
-/* Close a file descriptor. NaCl version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Linux close syscall implementation.
+ Copyright (C) 2017-2018 Free Software 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,14 +17,14 @@
<http://www.gnu.org/licenses/>. */
#include <unistd.h>
-#include <nacl-interfaces.h>
-
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
/* Close the file descriptor FD. */
int
__close (int fd)
{
- return NACL_CALL (__nacl_irt_fdio.close (fd), 0);
+ return SYSCALL_CANCEL (close, fd);
}
libc_hidden_def (__close)
strong_alias (__close, __libc_close)
diff --git a/sysdeps/unix/sysv/linux/close_nocancel.c b/sysdeps/unix/sysv/linux/close_nocancel.c
new file mode 100644
index 0000000000..7d744f9096
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/close_nocancel.c
@@ -0,0 +1,28 @@
+/* Linux close syscall implementation -- non-cancellable.
+ Copyright (C) 2018 Free Software 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 <sysdep-cancel.h>
+#include <not-cancel.h>
+
+int
+__close_nocancel (int fd)
+{
+ return INLINE_SYSCALL_CALL (close, fd);
+}
+libc_hidden_def (__close_nocancel)
diff --git a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
index f38cea47ef..bab0be6884 100644
--- a/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
+++ b/sysdeps/unix/sysv/linux/cmsg_nxthdr.c
@@ -1,5 +1,5 @@
/* Return point to next ancillary data entry in message header.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,3 +37,4 @@ __cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg)
return NULL;
return cmsg;
}
+libc_hidden_def (__cmsg_nxthdr)
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index ef9d4256d3..cace758c01 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -1,34 +1,3 @@
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/unix/sysv/linux.
@@ -39,13 +8,13 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
$as_echo_n "checking installed Linux kernel header files... " >&6; }
-if ${libc_cv_linux2632+:} false; then :
+if ${libc_cv_linux320+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <linux/version.h>
-#if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < (2 *65536+ 6 *256+ 32) /* 2.6.32 */
+#if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < (3 *65536+ 2 *256+ 0) /* 3.2.0 */
# error kernel headers missing or too old
#endif
int
@@ -57,20 +26,20 @@ main ()
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- libc_cv_linux2632='2.6.32 or later'
+ libc_cv_linux320='3.2.0 or later'
else
- libc_cv_linux2632='missing or too old!'
+ libc_cv_linux320='missing or too old!'
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux2632" >&5
-$as_echo "$libc_cv_linux2632" >&6; }
-if test "$libc_cv_linux2632" != '2.6.32 or later'; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux320" >&5
+$as_echo "$libc_cv_linux320" >&6; }
+if test "$libc_cv_linux320" != '3.2.0 or later'; then
as_fn_error $? "GNU libc requires kernel header files from
-Linux 2.6.32 or later to be installed before configuring.
+Linux 3.2.0 or later to be installed before configuring.
The kernel header files are found usually in /usr/include/asm and
/usr/include/linux; make sure these directories use files from
-Linux 2.6.32 or later. This check uses <linux/version.h>, so
+Linux 3.2.0 or later. This check uses <linux/version.h>, so
make sure that file was built correctly when installing the kernel header
files. To use kernel headers not from /usr/include/linux, use the
configure option --with-headers." "$LINENO" 5
@@ -82,7 +51,7 @@ fi
# set arch_minimum_kernel already, let that override our defaults here.
# Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
# if appropriate too.
-test -n "$arch_minimum_kernel" || arch_minimum_kernel=2.6.32
+test -n "$arch_minimum_kernel" || arch_minimum_kernel=3.2.0
if test -n "$minimum_kernel"; then
user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
@@ -137,17 +106,6 @@ else
*** compatible kernel version" "$LINENO" 5
fi
-# Until we start requiring 2.6.37+ headers, we need to check for the
-# availability of linux/fanotify.h for testing purposes.
-ac_fn_c_check_header_compile "$LINENO" "linux/fanotify.h" "ac_cv_header_linux_fanotify_h" "/* No default includes. */
-"
-if test "x$ac_cv_header_linux_fanotify_h" = xyes; then :
- $as_echo "#define HAVE_LINUX_FANOTIFY_H 1" >>confdefs.h
-
-fi
-
-
-
if test -n "$sysheaders"; then
CPPFLAGS=$OLD_CPPFLAGS
fi
diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac
index 6738e2d653..13abda0a51 100644
--- a/sysdeps/unix/sysv/linux/configure.ac
+++ b/sysdeps/unix/sysv/linux/configure.ac
@@ -1,7 +1,7 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/unix/sysv/linux.
-define([LIBC_LINUX_VERSION],[2.6.32])dnl
+define([LIBC_LINUX_VERSION],[3.2.0])dnl
if test -n "$sysheaders"; then
OLD_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
@@ -33,7 +33,7 @@ fi
# set arch_minimum_kernel already, let that override our defaults here.
# Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
# if appropriate too.
-test -n "$arch_minimum_kernel" || arch_minimum_kernel=2.6.32
+test -n "$arch_minimum_kernel" || arch_minimum_kernel=3.2.0
if test -n "$minimum_kernel"; then
changequote(,)
user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
@@ -65,12 +65,6 @@ else
*** compatible kernel version])
fi
-# Until we start requiring 2.6.37+ headers, we need to check for the
-# availability of linux/fanotify.h for testing purposes.
-AC_CHECK_HEADER(linux/fanotify.h,
- [AC_DEFINE(HAVE_LINUX_FANOTIFY_H)], ,
- [/* No default includes. */])
-
if test -n "$sysheaders"; then
CPPFLAGS=$OLD_CPPFLAGS
fi
diff --git a/sysdeps/unix/sysv/linux/connect.c b/sysdeps/unix/sysv/linux/connect.c
index 5fe84d38f7..fd8a84bc3e 100644
--- a/sysdeps/unix/sysv/linux/connect.c
+++ b/sysdeps/unix/sysv/linux/connect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software 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,14 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
#include <sys/socket.h>
-
#include <sysdep-cancel.h>
#include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
int
__libc_connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
diff --git a/sysdeps/unix/sysv/linux/copy_file_range.c b/sysdeps/unix/sysv/linux/copy_file_range.c
new file mode 100644
index 0000000000..7b1a50f752
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/copy_file_range.c
@@ -0,0 +1,46 @@
+/* Linux implementation of copy_file_range.
+ Copyright (C) 2017-2018 Free Software 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 <sysdep-cancel.h>
+#include <unistd.h>
+
+/* Include the fallback implementation. */
+#ifndef __ASSUME_COPY_FILE_RANGE
+#define COPY_FILE_RANGE_DECL static
+#define COPY_FILE_RANGE copy_file_range_compat
+#include <io/copy_file_range-compat.c>
+#endif
+
+ssize_t
+copy_file_range (int infd, __off64_t *pinoff,
+ int outfd, __off64_t *poutoff,
+ size_t length, unsigned int flags)
+{
+#ifdef __NR_copy_file_range
+ ssize_t ret = SYSCALL_CANCEL (copy_file_range, infd, pinoff, outfd, poutoff,
+ length, flags);
+# ifndef __ASSUME_COPY_FILE_RANGE
+ if (ret == -1 && errno == ENOSYS)
+ ret = copy_file_range_compat (infd, pinoff, outfd, poutoff, length, flags);
+# endif
+ return ret;
+#else /* !__NR_copy_file_range */
+ return copy_file_range_compat (infd, pinoff, outfd, poutoff, length, flags);
+#endif
+}
diff --git a/sysdeps/unix/sysv/linux/creat.c b/sysdeps/unix/sysv/linux/creat.c
new file mode 100644
index 0000000000..c996cbd3cc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/creat.c
@@ -0,0 +1,40 @@
+/* Linux default implementation for creat.
+ Copyright (C) 2017-2018 Free Software 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 <sysdep-cancel.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+/* Create FILE with protections MODE. */
+int
+__creat (const char *file, mode_t mode)
+{
+# ifdef __NR_creat
+ return SYSCALL_CANCEL (creat, file, mode);
+# else
+ return __open (file, O_WRONLY | O_CREAT | O_TRUNC, mode);
+# endif
+}
+weak_alias (__creat, creat)
+
+LIBC_CANCEL_HANDLED ();
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/creat64.c b/sysdeps/unix/sysv/linux/creat64.c
new file mode 100644
index 0000000000..d3ada38c9c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/creat64.c
@@ -0,0 +1,41 @@
+/* Linux default implementation for LFS creat.
+ Copyright (C) 2017-2018 Free Software 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 <sysdep-cancel.h>
+
+/* Create FILE with protections MODE. */
+int
+__creat64 (const char *file, mode_t mode)
+{
+#if defined __OFF_T_MATCHES_OFF64_T && defined __NR_creat
+ return SYSCALL_CANCEL (creat, file, mode);
+#else
+ /* We need to pass O_LARGEFILE. */
+ return __open64 (file, O_WRONLY | O_CREAT | O_TRUNC, mode);
+#endif
+}
+weak_alias (__creat64, creat64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (__creat64, __creat)
+weak_alias (__creat64, creat)
+#endif
+
+LIBC_CANCEL_HANDLED ();
diff --git a/sysdeps/unix/sysv/linux/createthread.c b/sysdeps/unix/sysv/linux/createthread.c
index 6d32cece48..5879e51bd2 100644
--- a/sysdeps/unix/sysv/linux/createthread.c
+++ b/sysdeps/unix/sysv/linux/createthread.c
@@ -1,5 +1,5 @@
/* Low-level thread creation for NPTL. Linux version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -28,8 +28,9 @@
#include <arch-fork.h>
-
-#ifndef ARCH_CLONE
+#ifdef __NR_clone2
+# define ARCH_CLONE __clone2
+#else
# define ARCH_CLONE __clone
#endif
@@ -46,7 +47,7 @@ static int start_thread (void *arg) __attribute__ ((noreturn));
static int
create_thread (struct pthread *pd, const struct pthread_attr *attr,
- bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
+ bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
{
/* Determine whether the newly created threads has to be started
stopped since we have to set the scheduling parameters or set the
@@ -54,13 +55,11 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
if (attr != NULL
&& (__glibc_unlikely (attr->cpuset != NULL)
|| __glibc_unlikely ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0)))
- stopped_start = true;
+ *stopped_start = true;
- pd->stopped_start = stopped_start;
- if (__glibc_unlikely (stopped_start))
- /* We make sure the thread does not run far by forcing it to get a
- lock. We lock it here too so that the new thread cannot continue
- until we tell it to. */
+ pd->stopped_start = *stopped_start;
+ if (__glibc_unlikely (*stopped_start))
+ /* See CONCURRENCY NOTES in nptl/pthread_creat.c. */
lll_lock (pd->lock, LLL_PRIVATE);
/* We rely heavily on various flags the CLONE function understands:
@@ -117,7 +116,7 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
/* Set the affinity mask if necessary. */
if (attr->cpuset != NULL)
{
- assert (stopped_start);
+ assert (*stopped_start);
res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid,
attr->cpusetsize, attr->cpuset);
@@ -128,10 +127,10 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
/* The operation failed. We have to kill the thread.
We let the normal cancellation mechanism do the work. */
+ pid_t pid = __getpid ();
INTERNAL_SYSCALL_DECL (err2);
- (void) INTERNAL_SYSCALL (tgkill, err2, 3,
- THREAD_GETMEM (THREAD_SELF, pid),
- pd->tid, SIGCANCEL);
+ (void) INTERNAL_SYSCALL_CALL (tgkill, err2, pid, pd->tid,
+ SIGCANCEL);
return INTERNAL_SYSCALL_ERRNO (res, err);
}
@@ -140,7 +139,7 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
/* Set the scheduling parameters. */
if ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0)
{
- assert (stopped_start);
+ assert (*stopped_start);
res = INTERNAL_SYSCALL (sched_setscheduler, err, 3, pd->tid,
pd->schedpolicy, &pd->schedparam);
diff --git a/sysdeps/unix/sysv/linux/default-sched.h b/sysdeps/unix/sysv/linux/default-sched.h
index 55610882d4..456352a845 100644
--- a/sysdeps/unix/sysv/linux/default-sched.h
+++ b/sysdeps/unix/sysv/linux/default-sched.h
@@ -1,5 +1,5 @@
/* Determine calling thread's scheduling parameters. Linux version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/device-nrs.h b/sysdeps/unix/sysv/linux/device-nrs.h
index 78fc79c78a..6fd7ad0150 100644
--- a/sysdeps/unix/sysv/linux/device-nrs.h
+++ b/sysdeps/unix/sysv/linux/device-nrs.h
@@ -1,5 +1,5 @@
/* Device numbers of devices used in the implementation. Linux version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,7 +39,7 @@
/* Test whether given device is a tty. */
#define DEV_TTY_P(statp) \
- ({ int __dev_major = major ((statp)->st_rdev); \
+ ({ int __dev_major = __gnu_dev_major ((statp)->st_rdev); \
__dev_major >= DEV_TTY_LOW_MAJOR && __dev_major <= DEV_TTY_HIGH_MAJOR; })
#endif /* device-nrs.h */
diff --git a/sysdeps/unix/sysv/linux/dl-execstack.c b/sysdeps/unix/sysv/linux/dl-execstack.c
index 5e2397f845..8ea69bdde3 100644
--- a/sysdeps/unix/sysv/linux/dl-execstack.c
+++ b/sysdeps/unix/sysv/linux/dl-execstack.c
@@ -1,5 +1,5 @@
/* Stack executability handling for GNU dynamic linker. Linux version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,6 @@
#include <libintl.h>
#include <stdbool.h>
#include <stackinfo.h>
-#include <caller.h>
#include <sysdep.h>
@@ -30,7 +29,6 @@ extern int __stack_prot attribute_relro attribute_hidden;
int
-internal_function
_dl_make_stack_executable (void **stack_endp)
{
/* This gives us the highest/lowest page that needs to be changed. */
@@ -38,12 +36,6 @@ _dl_make_stack_executable (void **stack_endp)
& -(intptr_t) GLRO(dl_pagesize));
int result = 0;
- /* Challenge the caller. */
- if (__builtin_expect (__check_caller (RETURN_ADDRESS (0),
- allow_ldso|allow_libpthread) != 0, 0)
- || __builtin_expect (*stack_endp != __libc_stack_end, 0))
- return EPERM;
-
if (__builtin_expect (__mprotect ((void *) page, GLRO(dl_pagesize),
__stack_prot) == 0, 1))
goto return_success;
diff --git a/sysdeps/unix/sysv/linux/dl-librecon.h b/sysdeps/unix/sysv/linux/dl-librecon.h
index 23baf309b2..dd01db4b77 100644
--- a/sysdeps/unix/sysv/linux/dl-librecon.h
+++ b/sysdeps/unix/sysv/linux/dl-librecon.h
@@ -1,5 +1,5 @@
/* Optional code to distinguish library flavours.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2001.
@@ -28,7 +28,7 @@ _dl_osversion_init (char *assume_kernel)
for (i = 0; i < 3; i++, p = q + 1)
{
- j = __strtoul_internal (p, &q, 0, 0);
+ j = _dl_strtoul (p, &q);
if (j >= 255 || p == q || (i < 2 && *q && *q != '.'))
{
osversion = 0;
diff --git a/sysdeps/unix/sysv/linux/dl-openat64.c b/sysdeps/unix/sysv/linux/dl-openat64.c
index 1138779174..6094c11be0 100644
--- a/sysdeps/unix/sysv/linux/dl-openat64.c
+++ b/sysdeps/unix/sysv/linux/dl-openat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmain.com>, 2003.
@@ -27,9 +27,5 @@ openat64 (int dfd, const char *file, int oflag, ...)
{
assert (!__OPEN_NEEDS_MODE (oflag));
-#ifdef __NR_openat
return INLINE_SYSCALL (openat, 3, dfd, file, oflag | O_LARGEFILE);
-#else
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-#endif
}
diff --git a/sysdeps/unix/sysv/linux/dl-origin.c b/sysdeps/unix/sysv/linux/dl-origin.c
index a56020349f..a87ee83b15 100644
--- a/sysdeps/unix/sysv/linux/dl-origin.c
+++ b/sysdeps/unix/sysv/linux/dl-origin.c
@@ -1,5 +1,5 @@
/* Find path of executable.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
index ac72c927d8..416ef93c47 100644
--- a/sysdeps/unix/sysv/linux/dl-osinfo.h
+++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
@@ -1,5 +1,5 @@
/* Operating system specific code for generic dynamic loader functions. Linux.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
index 977e4bce92..0477e0e5fa 100644
--- a/sysdeps/unix/sysv/linux/dl-sysdep.c
+++ b/sysdeps/unix/sysv/linux/dl-sysdep.c
@@ -1,5 +1,5 @@
/* Dynamic linker system dependencies for Linux.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,7 @@
#include <sys/param.h>
#include <sys/utsname.h>
#include <ldsodefs.h>
+#include <not-cancel.h>
#ifdef SHARED
# define DL_SYSDEP_INIT frob_brk ()
@@ -87,11 +88,11 @@ _dl_discover_osversion (void)
if (__uname (&uts))
{
/* This was not successful. Now try reading the /proc filesystem. */
- int fd = __open ("/proc/sys/kernel/osrelease", O_RDONLY);
+ int fd = __open64_nocancel ("/proc/sys/kernel/osrelease", O_RDONLY);
if (fd < 0)
return -1;
- ssize_t reslen = __read (fd, bufmem, sizeof (bufmem));
- __close (fd);
+ ssize_t reslen = __read_nocancel (fd, bufmem, sizeof (bufmem));
+ __close_nocancel (fd);
if (reslen <= 0)
/* This also didn't work. We give up since we cannot
make sure the library can actually work. */
diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.h b/sysdeps/unix/sysv/linux/dl-sysdep.h
index cd2f2975c2..9750145404 100644
--- a/sysdeps/unix/sysv/linux/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. Linux version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/dl-vdso.c b/sysdeps/unix/sysv/linux/dl-vdso.c
index 8744330b62..ee48efebe0 100644
--- a/sysdeps/unix/sysv/linux/dl-vdso.c
+++ b/sysdeps/unix/sysv/linux/dl-vdso.c
@@ -1,5 +1,5 @@
/* ELF symbol resolve functions for VDSO objects.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,6 @@
void *
-internal_function
_dl_vdso_vsym (const char *name, const struct r_found_version *vers)
{
struct link_map *map = GLRO (dl_sysinfo_map);
diff --git a/sysdeps/unix/sysv/linux/dl-vdso.h b/sysdeps/unix/sysv/linux/dl-vdso.h
index c1fc1c27d3..7b668d0862 100644
--- a/sysdeps/unix/sysv/linux/dl-vdso.h
+++ b/sysdeps/unix/sysv/linux/dl-vdso.h
@@ -1,5 +1,5 @@
/* ELF symbol resolve functions for VDSO objects.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,10 +44,12 @@
#define VDSO_HASH_LINUX_2_6_15 123718565
#define VDSO_NAME_LINUX_2_6_29 "LINUX_2.6.29"
#define VDSO_HASH_LINUX_2_6_29 123718585
+#define VDSO_NAME_LINUX_4_15 "LINUX_4.15"
+#define VDSO_HASH_LINUX_4_15 182943605
/* Functions for resolving symbols in the VDSO link map. */
extern void *_dl_vdso_vsym (const char *name,
const struct r_found_version *version)
- internal_function attribute_hidden;
+ attribute_hidden;
#endif /* dl-vdso.h */
diff --git a/sysdeps/unix/sysv/linux/dl-writev.h b/sysdeps/unix/sysv/linux/dl-writev.h
index feb196cb3b..772ac9fa5d 100644
--- a/sysdeps/unix/sysv/linux/dl-writev.h
+++ b/sysdeps/unix/sysv/linux/dl-writev.h
@@ -1,5 +1,5 @@
/* Message-writing for the dynamic linker. Linux version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/epoll_pwait.c b/sysdeps/unix/sysv/linux/epoll_pwait.c
index d67965f3e8..f90df70af7 100644
--- a/sysdeps/unix/sysv/linux/epoll_pwait.c
+++ b/sysdeps/unix/sysv/linux/epoll_pwait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/generic/epoll_wait.c b/sysdeps/unix/sysv/linux/epoll_wait.c
index 9f2bec9b5e..c2aa83ca22 100644
--- a/sysdeps/unix/sysv/linux/generic/epoll_wait.c
+++ b/sysdeps/unix/sysv/linux/epoll_wait.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Linux epoll_wait syscall implementation.
+ Copyright (C) 2017-2018 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
@@ -21,8 +21,14 @@
#include <sys/types.h>
#include <sys/epoll.h>
+#include <sysdep-cancel.h>
+
int
epoll_wait (int epfd, struct epoll_event *events, int maxevents, int timeout)
{
+#ifdef __NR_epoll_wait
+ return SYSCALL_CANCEL (epoll_wait, epfd, events, maxevents, timeout);
+#else
return epoll_pwait (epfd, events, maxevents, timeout, NULL);
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/errqueue.h b/sysdeps/unix/sysv/linux/errqueue.h
index 3aaa7c7f09..176b14d51c 100644
--- a/sysdeps/unix/sysv/linux/errqueue.h
+++ b/sysdeps/unix/sysv/linux/errqueue.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,13 +25,13 @@
struct sock_extended_err
{
- u_int32_t ee_errno;
- u_int8_t ee_origin;
- u_int8_t ee_type;
- u_int8_t ee_code;
- u_int8_t ee_pad;
- u_int32_t ee_info;
- u_int32_t ee_data;
+ uint32_t ee_errno;
+ uint8_t ee_origin;
+ uint8_t ee_type;
+ uint8_t ee_code;
+ uint8_t ee_pad;
+ uint32_t ee_info;
+ uint32_t ee_data;
};
#define SO_EE_ORIGIN_NONE 0
diff --git a/sysdeps/unix/sysv/linux/eventfd.c b/sysdeps/unix/sysv/linux/eventfd.c
deleted file mode 100644
index ba193ba65e..0000000000
--- a/sysdeps/unix/sysv/linux/eventfd.c
+++ /dev/null
@@ -1,51 +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 <sys/eventfd.h>
-#include <sysdep.h>
-#include <kernel-features.h>
-
-
-int
-eventfd (unsigned int count, int flags)
-{
-#ifdef __NR_eventfd2
- int res = INLINE_SYSCALL (eventfd2, 2, count, flags);
-# ifndef __ASSUME_EVENTFD2
- if (res != -1 || errno != ENOSYS)
-# endif
- return res;
-#endif
-
-#ifndef __ASSUME_EVENTFD2
- /* The old system call has no flag parameter which is bad. So we have
- to wait until we have to support to pass additional values to the
- kernel (sys_indirect) before implementing setting flags like
- O_NONBLOCK etc. */
- if (flags != 0)
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-
-# ifdef __NR_eventfd
- return INLINE_SYSCALL (eventfd, 1, count);
-# else
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-# endif
-#elif !defined __NR_eventfd2
-# error "__ASSUME_EVENTFD2 defined but not __NR_eventfd2"
-#endif
-}
diff --git a/sysdeps/unix/sysv/linux/eventfd_read.c b/sysdeps/unix/sysv/linux/eventfd_read.c
index 8ccedcc045..ba5c8929ce 100644
--- a/sysdeps/unix/sysv/linux/eventfd_read.c
+++ b/sysdeps/unix/sysv/linux/eventfd_read.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/eventfd_write.c b/sysdeps/unix/sysv/linux/eventfd_write.c
index 19708a1904..ed568591f7 100644
--- a/sysdeps/unix/sysv/linux/eventfd_write.c
+++ b/sysdeps/unix/sysv/linux/eventfd_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/exit-thread.h b/sysdeps/unix/sysv/linux/exit-thread.h
index a28db19b1c..d3933923c3 100644
--- a/sysdeps/unix/sysv/linux/exit-thread.h
+++ b/sysdeps/unix/sysv/linux/exit-thread.h
@@ -1,5 +1,5 @@
/* Call to terminate the current thread. Linux version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c
index 64c6cd16d9..ea42b2303f 100644
--- a/sysdeps/unix/sysv/linux/faccessat.c
+++ b/sysdeps/unix/sysv/linux/faccessat.c
@@ -1,5 +1,5 @@
/* Test for access to file, relative to open directory. Linux version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/fallocate.c b/sysdeps/unix/sysv/linux/fallocate.c
index 6a58a5f50a..bc27ea7ab9 100644
--- a/sysdeps/unix/sysv/linux/fallocate.c
+++ b/sysdeps/unix/sysv/linux/fallocate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,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..c6d4f11d24 100644
--- a/sysdeps/unix/sysv/linux/fallocate64.c
+++ b/sysdeps/unix/sysv/linux/fallocate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,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/fatal-prepare.h b/sysdeps/unix/sysv/linux/fatal-prepare.h
index 3acc6a8317..e24781692d 100644
--- a/sysdeps/unix/sysv/linux/fatal-prepare.h
+++ b/sysdeps/unix/sysv/linux/fatal-prepare.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/fchmodat.c b/sysdeps/unix/sysv/linux/fchmodat.c
index e69915599f..3e2c58a00f 100644
--- a/sysdeps/unix/sysv/linux/fchmodat.c
+++ b/sysdeps/unix/sysv/linux/fchmodat.c
@@ -1,5 +1,5 @@
/* Change the protections of file relative to open directory. Linux version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/fcntl.c b/sysdeps/unix/sysv/linux/fcntl.c
index fbac93930b..cbab7b401a 100644
--- a/sysdeps/unix/sysv/linux/fcntl.c
+++ b/sysdeps/unix/sysv/linux/fcntl.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Linux fcntl syscall implementation.
+ Copyright (C) 2000-2018 Free Software 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,35 +16,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <assert.h>
-#include <errno.h>
-#include <sysdep-cancel.h> /* Must come before <fcntl.h>. */
#include <fcntl.h>
#include <stdarg.h>
+#include <errno.h>
+#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-
-static int
-do_fcntl (int fd, int cmd, void *arg)
-{
- if (cmd != F_GETOWN)
- return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
-
- INTERNAL_SYSCALL_DECL (err);
- struct f_owner_ex fex;
- int res = INTERNAL_SYSCALL (fcntl, err, 3, fd, F_GETOWN_EX, &fex);
- if (!INTERNAL_SYSCALL_ERROR_P (res, err))
- return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
-
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (res,
- err));
-}
+#ifndef __OFF_T_MATCHES_OFF64_T
+# ifndef FCNTL_ADJUST_CMD
+# define FCNTL_ADJUST_CMD(__cmd) __cmd
+# endif
-#ifndef NO_CANCELLATION
int
-__fcntl_nocancel (int fd, int cmd, ...)
+__libc_fcntl (int fd, int cmd, ...)
{
va_list ap;
void *arg;
@@ -52,13 +37,70 @@ __fcntl_nocancel (int fd, int cmd, ...)
arg = va_arg (ap, void *);
va_end (ap);
- return do_fcntl (fd, cmd, arg);
+ cmd = FCNTL_ADJUST_CMD (cmd);
+
+ switch (cmd)
+ {
+ case F_SETLKW:
+ case F_SETLKW64:
+ return SYSCALL_CANCEL (fcntl64, fd, cmd, arg);
+ case F_OFD_SETLKW:
+ {
+ struct flock *flk = (struct flock *) arg;
+ struct flock64 flk64 =
+ {
+ .l_type = flk->l_type,
+ .l_whence = flk->l_whence,
+ .l_start = flk->l_start,
+ .l_len = flk->l_len,
+ .l_pid = flk->l_pid
+ };
+ return SYSCALL_CANCEL (fcntl64, fd, cmd, &flk64);
+ }
+ case F_OFD_GETLK:
+ case F_OFD_SETLK:
+ {
+ struct flock *flk = (struct flock *) arg;
+ struct flock64 flk64 =
+ {
+ .l_type = flk->l_type,
+ .l_whence = flk->l_whence,
+ .l_start = flk->l_start,
+ .l_len = flk->l_len,
+ .l_pid = flk->l_pid
+ };
+ int ret = INLINE_SYSCALL_CALL (fcntl64, fd, cmd, &flk64);
+ if (ret == -1)
+ return -1;
+ if ((off_t) flk64.l_start != flk64.l_start
+ || (off_t) flk64.l_len != flk64.l_len)
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+ flk->l_type = flk64.l_type;
+ flk->l_whence = flk64.l_whence;
+ flk->l_start = flk64.l_start;
+ flk->l_len = flk64.l_len;
+ flk->l_pid = flk64.l_pid;
+ return ret;
+ }
+ /* Since only F_SETLKW{64}/F_OLD_SETLK are cancellation entrypoints and
+ only OFD locks require LFS handling, all others flags are handled
+ unmodified by calling __NR_fcntl64. */
+ default:
+ return __fcntl64_nocancel_adjusted (fd, cmd, arg);
+ }
}
-#endif
+libc_hidden_def (__libc_fcntl)
+weak_alias (__libc_fcntl, __fcntl)
+libc_hidden_weak (__fcntl)
+# include <shlib-compat.h>
+# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_28)
int
-__libc_fcntl (int fd, int cmd, ...)
+__old_libc_fcntl64 (int fd, int cmd, ...)
{
va_list ap;
void *arg;
@@ -67,19 +109,14 @@ __libc_fcntl (int fd, int cmd, ...)
arg = va_arg (ap, void *);
va_end (ap);
- if (SINGLE_THREAD_P || cmd != F_SETLKW)
- return do_fcntl (fd, cmd, arg);
-
- int oldtype = LIBC_CANCEL_ASYNC ();
-
- int result = do_fcntl (fd, cmd, arg);
-
- LIBC_CANCEL_RESET (oldtype);
-
- return result;
+ /* Previous versions called __NR_fcntl64 for fcntl (which did not handle
+ OFD locks in LFS mode). */
+ return __libc_fcntl64 (fd, cmd, arg);
}
-libc_hidden_def (__libc_fcntl)
-
-weak_alias (__libc_fcntl, __fcntl)
-libc_hidden_weak (__fcntl)
+compat_symbol (libc, __old_libc_fcntl64, fcntl, GLIBC_2_0);
+versioned_symbol (libc, __libc_fcntl, fcntl, GLIBC_2_28);
+# else
weak_alias (__libc_fcntl, fcntl)
+# endif
+
+#endif /* __OFF_T_MATCHES_OFF64_T */
diff --git a/sysdeps/unix/sysv/linux/fcntl64.c b/sysdeps/unix/sysv/linux/fcntl64.c
new file mode 100644
index 0000000000..f21667ae43
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/fcntl64.c
@@ -0,0 +1,63 @@
+/* Manipulate file descriptor. Linux LFS version.
+ Copyright (C) 2018 Free Software 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 fcntl __no_decl_fcntl
+#define __fcntl __no_decl___fcntl
+#include <fcntl.h>
+#undef fcntl
+#undef __fcntl
+#include <stdarg.h>
+#include <errno.h>
+#include <sysdep-cancel.h>
+
+#ifndef __NR_fcntl64
+# define __NR_fcntl64 __NR_fcntl
+#endif
+
+#ifndef FCNTL_ADJUST_CMD
+# define FCNTL_ADJUST_CMD(__cmd) __cmd
+#endif
+
+int
+__libc_fcntl64 (int fd, int cmd, ...)
+{
+ va_list ap;
+ void *arg;
+
+ va_start (ap, cmd);
+ arg = va_arg (ap, void *);
+ va_end (ap);
+
+ cmd = FCNTL_ADJUST_CMD (cmd);
+
+ if (cmd == F_SETLKW || cmd == F_SETLKW64 || cmd == F_OFD_SETLKW)
+ return SYSCALL_CANCEL (fcntl64, fd, cmd, arg);
+
+ return __fcntl64_nocancel_adjusted (fd, cmd, arg);
+}
+libc_hidden_def (__libc_fcntl64)
+weak_alias (__libc_fcntl64, __fcntl64)
+libc_hidden_weak (__fcntl64)
+weak_alias (__libc_fcntl64, fcntl64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (__libc_fcntl64, __libc_fcntl)
+weak_alias (__libc_fcntl64, __fcntl)
+weak_alias (__libc_fcntl64, __GI___fcntl)
+weak_alias (__libc_fcntl64, fcntl)
+#endif
diff --git a/sysdeps/unix/sysv/linux/fcntl_nocancel.c b/sysdeps/unix/sysv/linux/fcntl_nocancel.c
new file mode 100644
index 0000000000..dd336b5679
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/fcntl_nocancel.c
@@ -0,0 +1,65 @@
+/* Linux fcntl syscall implementation -- non-cancellable.
+ Copyright (C) 2018 Free Software 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 <stdarg.h>
+#include <errno.h>
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
+
+#ifndef __NR_fcntl64
+# define __NR_fcntl64 __NR_fcntl
+#endif
+
+#ifndef FCNTL_ADJUST_CMD
+# define FCNTL_ADJUST_CMD(__cmd) __cmd
+#endif
+
+int
+__fcntl64_nocancel (int fd, int cmd, ...)
+{
+ va_list ap;
+ void *arg;
+
+ va_start (ap, cmd);
+ arg = va_arg (ap, void *);
+ va_end (ap);
+
+ cmd = FCNTL_ADJUST_CMD (cmd);
+
+ return __fcntl64_nocancel_adjusted (fd, cmd, arg);
+}
+hidden_def (__fcntl64_nocancel)
+
+int
+__fcntl64_nocancel_adjusted (int fd, int cmd, void *arg)
+{
+ if (cmd == F_GETOWN)
+ {
+ INTERNAL_SYSCALL_DECL (err);
+ struct f_owner_ex fex;
+ int res = INTERNAL_SYSCALL_CALL (fcntl64, err, fd, F_GETOWN_EX, &fex);
+ if (!INTERNAL_SYSCALL_ERROR_P (res, err))
+ return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
+
+ return INLINE_SYSCALL_ERROR_RETURN_VALUE
+ (INTERNAL_SYSCALL_ERRNO (res, err));
+ }
+
+ return INLINE_SYSCALL_CALL (fcntl64, fd, cmd, (void *) arg);
+}
diff --git a/sysdeps/unix/sysv/linux/fd_to_filename.h b/sysdeps/unix/sysv/linux/fd_to_filename.h
index 54f59046aa..297716b0ae 100644
--- a/sysdeps/unix/sysv/linux/fd_to_filename.h
+++ b/sysdeps/unix/sysv/linux/fd_to_filename.h
@@ -1,5 +1,5 @@
/* Query filename corresponding to an open FD. Linux version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nacl/fdatasync.c b/sysdeps/unix/sysv/linux/fdatasync.c
index 737267bb55..c3b5b4262d 100644
--- a/sysdeps/nacl/fdatasync.c
+++ b/sysdeps/unix/sysv/linux/fdatasync.c
@@ -1,5 +1,6 @@
-/* Make all changes done to file data actually appear on disk. NaCl version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Synchronize a file's in-core state with storage device Linux
+ implementation.
+ Copyright (C) 2017-2018 Free Software 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,12 +18,12 @@
<http://www.gnu.org/licenses/>. */
#include <unistd.h>
-#include <nacl-interfaces.h>
+#include <sysdep-cancel.h>
/* Synchronize at least the data part of a file with the underlying
media. */
int
fdatasync (int fd)
{
- return NACL_CALL (__nacl_irt_dev_fdio.fdatasync (fd), 0);
+ return SYSCALL_CANCEL (fdatasync, fd);
}
diff --git a/sysdeps/unix/sysv/linux/fexecve.c b/sysdeps/unix/sysv/linux/fexecve.c
index 1800d6402b..3560b711ca 100644
--- a/sysdeps/unix/sysv/linux/fexecve.c
+++ b/sysdeps/unix/sysv/linux/fexecve.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,8 +19,13 @@
#include <stddef.h>
#include <stdio.h>
#include <unistd.h>
+#include <fcntl.h>
#include <sys/stat.h>
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <kernel-features.h>
+
/* Execute the file FD refers to, overlaying the running program image.
ARGV and ENVP are passed to the new program, as for `execve'. */
@@ -33,6 +38,16 @@ fexecve (int fd, char *const argv[], char *const envp[])
return -1;
}
+#ifdef __NR_execveat
+ /* Avoid implicit array coercion in syscall macros. */
+ INLINE_SYSCALL (execveat, 5, fd, "", &argv[0], &envp[0], AT_EMPTY_PATH);
+# ifndef __ASSUME_EXECVEAT
+ if (errno != ENOSYS)
+ return -1;
+# endif
+#endif
+
+#ifndef __ASSUME_EXECVEAT
/* We use the /proc filesystem to get the information. If it is not
mounted we fail. */
char buf[sizeof "/proc/self/fd/" + sizeof (int) * 3];
@@ -50,6 +65,7 @@ fexecve (int fd, char *const argv[], char *const envp[])
save = ENOSYS;
__set_errno (save);
+#endif
return -1;
}
diff --git a/sysdeps/unix/sysv/linux/filter-nr-syscalls.awk b/sysdeps/unix/sysv/linux/filter-nr-syscalls.awk
new file mode 100644
index 0000000000..270693d8ab
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/filter-nr-syscalls.awk
@@ -0,0 +1,35 @@
+# Filter preprocessor __NR_* macros and extract system call names.
+# Copyright (C) 2017-2018 Free Software 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/>.
+
+# Skip reserved system calls.
+/^#define __NR_(unused|reserved)[0-9]+ / {
+ next;
+}
+
+# Skip pseudo-system calls which describe ranges.
+/^#define __NR_(syscalls|arch_specific_syscall|(OABI_)?SYSCALL_BASE) / {
+ next;
+}
+/^#define __NR_(|64_|[NO]32_)Linux(_syscalls)? / {
+ next;
+}
+
+# Print the remaining _NR_* macros as system call names.
+/^#define __NR_/ {
+ print substr($2, 6);
+}
diff --git a/sysdeps/unix/sysv/linux/fips-private.h b/sysdeps/unix/sysv/linux/fips-private.h
index 6b38e6197a..8dc5772f71 100644
--- a/sysdeps/unix/sysv/linux/fips-private.h
+++ b/sysdeps/unix/sysv/linux/fips-private.h
@@ -1,5 +1,5 @@
/* FIPS compliance status test for GNU/Linux systems.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -42,15 +42,15 @@ fips_enabled_p (void)
if (checked == FIPS_UNTESTED)
{
- int fd = open_not_cancel_2 ("/proc/sys/crypto/fips_enabled", O_RDONLY);
+ int fd = __open_nocancel ("/proc/sys/crypto/fips_enabled", O_RDONLY);
if (fd != -1)
{
/* This is more than enough, the file contains a single integer. */
char buf[32];
ssize_t n;
- n = TEMP_FAILURE_RETRY (read_not_cancel (fd, buf, sizeof (buf) - 1));
- close_not_cancel_no_status (fd);
+ n = TEMP_FAILURE_RETRY (__read_nocancel (fd, buf, sizeof (buf) - 1));
+ __close_nocancel_nostatus (fd);
if (n > 0)
{
diff --git a/sysdeps/unix/sysv/linux/fpathconf.c b/sysdeps/unix/sysv/linux/fpathconf.c
index 55b616bc04..ce439c8fbe 100644
--- a/sysdeps/unix/sysv/linux/fpathconf.c
+++ b/sysdeps/unix/sysv/linux/fpathconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about descriptor FD. Linux version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/fstatfs64.c b/sysdeps/unix/sysv/linux/fstatfs64.c
index a624de697b..78c9a83bae 100644
--- a/sysdeps/unix/sysv/linux/fstatfs64.c
+++ b/sysdeps/unix/sysv/linux/fstatfs64.c
@@ -1,5 +1,5 @@
/* Return information about the filesystem on which FD resides.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,9 +18,21 @@
#include <errno.h>
#include <string.h>
-#include <sys/statfs.h>
#include <stddef.h>
#include <sysdep.h>
+#include <kernel_stat.h>
+
+/* Hide the prototypes for __fstatfs and fstatfs so that GCC will not
+ complain about the different function signatures if they are aliased
+ to __fstat64. If STATFS_IS_STATFS64 is not zero then the statfs and
+ statfs64 structures have an identical layout but different type names. */
+
+#if STATFS_IS_STATFS64
+# define __fstatfs __fstatfs_disable
+# define fstatfs fstatfs_disable
+#endif
+#include <sys/statfs.h>
+
#include <kernel-features.h>
/* Defined in statfs64.c. */
@@ -70,3 +82,11 @@ __fstatfs64 (int fd, struct statfs64 *buf)
#endif
}
weak_alias (__fstatfs64, fstatfs64)
+
+#undef __fstatfs
+#undef fstatfs
+
+#if STATFS_IS_STATFS64
+weak_alias (__fstatfs64, __fstatfs)
+weak_alias (__fstatfs64, fstatfs)
+#endif
diff --git a/sysdeps/unix/sysv/linux/fstatvfs.c b/sysdeps/unix/sysv/linux/fstatvfs.c
index aea3914054..07c61c9fbd 100644
--- a/sysdeps/unix/sysv/linux/fstatvfs.c
+++ b/sysdeps/unix/sysv/linux/fstatvfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -19,11 +19,7 @@
#include <stddef.h>
#include <sys/stat.h>
#include <sys/statfs.h>
-#include <sys/statvfs.h>
-
-extern void __internal_statvfs (const char *name, struct statvfs *buf,
- struct statfs *fsbuf, int fd);
-
+#include "internal_statvfs.h"
int
__fstatvfs (int fd, struct statvfs *buf)
diff --git a/sysdeps/unix/sysv/linux/fstatvfs64.c b/sysdeps/unix/sysv/linux/fstatvfs64.c
index 36e61f112a..bf59eff1b9 100644
--- a/sysdeps/unix/sysv/linux/fstatvfs64.c
+++ b/sysdeps/unix/sysv/linux/fstatvfs64.c
@@ -1,5 +1,5 @@
/* Return information about the filesystem on which FD resides.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,14 +20,9 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/statfs.h>
-#include <sys/statvfs.h>
+#include "internal_statvfs.h"
#include <kernel-features.h>
-
-extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf,
- struct statfs64 *fsbuf, int fd);
-
-
/* Return information about the filesystem on which FD resides. */
int
__fstatvfs64 (int fd, struct statvfs64 *buf)
diff --git a/sysdeps/nacl/fsync.c b/sysdeps/unix/sysv/linux/fsync.c
index e346561dac..db101a219d 100644
--- a/sysdeps/nacl/fsync.c
+++ b/sysdeps/unix/sysv/linux/fsync.c
@@ -1,5 +1,6 @@
-/* Make all changes done to FD actually appear on disk. NaCl version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Synchronize a file's in-core state with storage device Linux
+ implementation.
+ Copyright (C) 2017-2018 Free Software 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,11 +18,11 @@
<http://www.gnu.org/licenses/>. */
#include <unistd.h>
-#include <nacl-interfaces.h>
+#include <sysdep-cancel.h>
/* Make all changes done to FD actually appear on disk. */
int
fsync (int fd)
{
- return NACL_CALL (__nacl_irt_dev_fdio.fsync (fd), 0);
+ return SYSCALL_CANCEL (fsync, fd);
}
diff --git a/sysdeps/unix/sysv/linux/ftruncate.c b/sysdeps/unix/sysv/linux/ftruncate.c
new file mode 100644
index 0000000000..539fad9369
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ftruncate.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 2016-2018 Free Software 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 <sysdep.h>
+#include <errno.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+/* Truncate the file FD refers to LENGTH bytes. */
+int
+__ftruncate (int fd, off_t length)
+{
+# ifndef __NR_ftruncate
+ return INLINE_SYSCALL_CALL (ftruncate64, fd,
+ __ALIGNMENT_ARG SYSCALL_LL (length));
+# else
+ return INLINE_SYSCALL_CALL (ftruncate, fd, length);
+# endif
+}
+weak_alias (__ftruncate, ftruncate)
+#endif
diff --git a/sysdeps/unix/sysv/linux/ftruncate64.c b/sysdeps/unix/sysv/linux/ftruncate64.c
index a6bf878ddf..eadc7d3438 100644
--- a/sysdeps/unix/sysv/linux/ftruncate64.c
+++ b/sysdeps/unix/sysv/linux/ftruncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software 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,22 +15,24 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sys/types.h>
-#include <errno.h>
-#include <endian.h>
#include <unistd.h>
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
+
+#ifndef __NR_ftruncate64
+# define __NR_ftruncate64 __NR_ftruncate
+#endif
/* Truncate the file referenced by FD to LENGTH bytes. */
int
__ftruncate64 (int fd, off64_t length)
{
- unsigned int low = length & 0xffffffff;
- unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (ftruncate64, 3, fd,
- __LONG_LONG_PAIR (high, low));
- return result;
+ return INLINE_SYSCALL_CALL (ftruncate64, fd,
+ __ALIGNMENT_ARG SYSCALL_LL64 (length));
}
weak_alias (__ftruncate64, ftruncate64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (__ftruncate64, __ftruncate)
+weak_alias (__ftruncate64, ftruncate);
+#endif
diff --git a/sysdeps/unix/sysv/linux/futex-internal.h b/sysdeps/unix/sysv/linux/futex-internal.h
index 1add836ebc..96a07b05b9 100644
--- a/sysdeps/unix/sysv/linux/futex-internal.h
+++ b/sysdeps/unix/sysv/linux/futex-internal.h
@@ -1,5 +1,5 @@
/* futex operations for glibc-internal use. Linux version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/futimens.c b/sysdeps/unix/sysv/linux/futimens.c
index 3176e65eaf..bc7fe54331 100644
--- a/sysdeps/unix/sysv/linux/futimens.c
+++ b/sysdeps/unix/sysv/linux/futimens.c
@@ -1,5 +1,5 @@
/* Change access and modification times of open file. Linux version.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,15 +31,8 @@
int
futimens (int fd, const struct timespec tsp[2])
{
-#ifdef __NR_utimensat
if (fd < 0)
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EBADF);
/* Avoid implicit array coercion in syscall macros. */
return INLINE_SYSCALL (utimensat, 4, fd, NULL, &tsp[0], 0);
-#else
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-#endif
}
-#ifndef __NR_utimensat
-stub_warning (futimens)
-#endif
diff --git a/sysdeps/unix/sysv/linux/futimes.c b/sysdeps/unix/sysv/linux/futimes.c
index 38e916361d..9e6267cda7 100644
--- a/sysdeps/unix/sysv/linux/futimes.c
+++ b/sysdeps/unix/sysv/linux/futimes.c
@@ -1,5 +1,5 @@
/* futimes -- change access and modification times of open file. Linux version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/futimesat.c b/sysdeps/unix/sysv/linux/futimesat.c
index 127e2a4463..186db6da48 100644
--- a/sysdeps/unix/sysv/linux/futimesat.c
+++ b/sysdeps/unix/sysv/linux/futimesat.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* futimesat -- Change access and modification times of file. Linux version.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c
index 858679dd55..f763e03b27 100644
--- a/sysdeps/unix/sysv/linux/fxstat.c
+++ b/sysdeps/unix/sysv/linux/fxstat.c
@@ -1,5 +1,5 @@
/* fxstat using old-style Unix fstat system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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);
@@ -54,7 +54,7 @@ __fxstat (int vers, int fd, struct stat *buf)
hidden_def (__fxstat)
weak_alias (__fxstat, _fxstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
#undef __fxstat64
strong_alias (__fxstat, __fxstat64);
hidden_ver (__fxstat, __fxstat64)
diff --git a/sysdeps/unix/sysv/linux/fxstat64.c b/sysdeps/unix/sysv/linux/fxstat64.c
index 5468dd6c60..0d053897a0 100644
--- a/sysdeps/unix/sysv/linux/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/fxstat64.c
@@ -1,5 +1,5 @@
/* fxstat64 using Linux fstat64 system call.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/fxstatat.c b/sysdeps/unix/sysv/linux/fxstatat.c
index f716bf31c2..d41a3f3193 100644
--- a/sysdeps/unix/sysv/linux/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/fxstatat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,7 +58,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
err));
}
libc_hidden_def (__fxstatat)
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
# undef __fxstatat64
strong_alias (__fxstatat, __fxstatat64);
libc_hidden_def (__fxstatat64)
diff --git a/sysdeps/unix/sysv/linux/fxstatat64.c b/sysdeps/unix/sysv/linux/fxstatat64.c
index 7ffa2d4a9b..baa9a60a66 100644
--- a/sysdeps/unix/sysv/linux/fxstatat64.c
+++ b/sysdeps/unix/sysv/linux/fxstatat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/gai_sigqueue.c b/sysdeps/unix/sysv/linux/gai_sigqueue.c
index d548e7b184..8213332be9 100644
--- a/sysdeps/unix/sysv/linux/gai_sigqueue.c
+++ b/sysdeps/unix/sysv/linux/gai_sigqueue.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,7 +30,6 @@
/* Return any pending signal or wait for one for the given time. */
int
-internal_function
__gai_sigqueue (int sig, const union sigval val, pid_t caller_pid)
{
siginfo_t info;
diff --git a/sysdeps/unix/sysv/linux/gen-syscall-h.awk b/sysdeps/unix/sysv/linux/gen-syscall-h.awk
new file mode 100644
index 0000000000..4a264a29a7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/gen-syscall-h.awk
@@ -0,0 +1,81 @@
+# Generate SYS_* macros from a list in a text file.
+# Copyright (C) 2017-2018 Free Software 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/>.
+
+# Emit a conditional definition for SYS_NAME.
+function emit(name) {
+ print "#ifdef __NR_" name;
+ print "# define SYS_" name " __NR_" name;
+ print "#endif";
+ print "";
+}
+
+# Bail out with an error.
+function fatal(message) {
+ print FILENAME ":" FNR ": " message > "/dev/stderr";
+ exit 1;
+}
+
+BEGIN {
+ name = "";
+ kernel = "";
+}
+
+# Skip empty lines and comments.
+/^\s*(|#.*)$/ {
+ next;
+}
+
+# Kernel version. Used for documentation purposes only.
+/^kernel [0-9.]+$/ {
+ if (kernel != "") {
+ fatal("duplicate kernel directive");
+ }
+ kernel = $2;
+ print "/* Generated at libc build time from syscall list. */";
+ print "/* The system call list corresponds to kernel " kernel ". */";
+ print "";
+ print "#ifndef _SYSCALL_H"
+ print "# error \"Never use <bits/syscall.h> directly; include <sys/syscall.h> instead.\"";
+ print "#endif";
+ print "";
+ split($2, kernel_version, ".");
+ kernel_major = kernel_version[1];
+ kernel_minor = kernel_version[2];
+ kernel_version_code = kernel_major * 65536 + kernel_minor * 256;
+ print "#define __GLIBC_LINUX_VERSION_CODE " kernel_version_code;
+ print "";
+ next;
+}
+
+# If there is just one word, it is a system call.
+/^[a-zA-Z_][a-zA-Z0-9_]+$/ {
+ if (kernel == "") {
+ fatal("expected kernel directive before this line");
+ }
+ if ($1 <= name) {
+ fatal("name " name " violates ordering");
+ }
+ emit($1);
+ name = $1;
+ next;
+}
+
+# The rest has to be syntax errors.
+// {
+ fatal("unrecognized syntax");
+}
diff --git a/sysdeps/unix/sysv/linux/generic/Makefile b/sysdeps/unix/sysv/linux/generic/Makefile
index c1daee2396..7e27e79772 100644
--- a/sysdeps/unix/sysv/linux/generic/Makefile
+++ b/sysdeps/unix/sysv/linux/generic/Makefile
@@ -1,3 +1,3 @@
ifeq ($(subdir),misc)
-sysdep_routines += epoll_create epoll_wait inotify_init
+sysdep_routines += epoll_create inotify_init
endif
diff --git a/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c b/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c
index 112d629b68..f8251b811a 100644
--- a/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/access.c b/sysdeps/unix/sysv/linux/generic/access.c
deleted file mode 100644
index 586aa93757..0000000000
--- a/sysdeps/unix/sysv/linux/generic/access.c
+++ /dev/null
@@ -1,31 +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 <stddef.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sysdep-cancel.h>
-
-/* Test for access to FILE. */
-int
-__access (const char *file, int type)
-{
- return INLINE_SYSCALL (faccessat, 3, AT_FDCWD, file, type);
-}
-weak_alias (__access, access)
diff --git a/sysdeps/unix/sysv/linux/generic/bits/fcntl.h b/sysdeps/unix/sysv/linux/generic/bits/fcntl.h
index 7161890d9c..cdc1f32fa2 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for the generic Linux ABI.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/bits/msq.h b/sysdeps/unix/sysv/linux/generic/bits/msq.h
index 2f3b7b2331..fe2bff6b12 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -67,6 +67,7 @@ struct msqid_ds
/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12
+# define MSG_STAT_ANY 13
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
diff --git a/sysdeps/unix/sysv/linux/generic/bits/sem.h b/sysdeps/unix/sysv/linux/generic/bits/sem.h
index c8437b7753..9c8b318efb 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -74,6 +74,7 @@ struct semid_ds
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
+# define SEM_STAT_ANY 20
struct seminfo
{
diff --git a/sysdeps/unix/sysv/linux/generic/bits/shm.h b/sysdeps/unix/sysv/linux/generic/bits/shm.h
index 81918c8961..30d0097b02 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -76,6 +76,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/generic/bits/stat.h b/sysdeps/unix/sysv/linux/generic/bits/stat.h
index dd8d799dd3..08e86ef086 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/bits/statfs.h b/sysdeps/unix/sysv/linux/generic/bits/statfs.h
index 7d5aa2df6a..846dd5f618 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
index c31bba2f7c..a2cb3433bf 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -70,6 +70,11 @@
/* Same for ino_t and ino64_t. */
# define __INO_T_MATCHES_INO64_T 1
+
+/* And for __rlim_t and __rlim64_t. */
+# define __RLIM_T_MATCHES_RLIM64_T 1
+#else
+# define __RLIM_T_MATCHES_RLIM64_T 0
#endif
/* Number of descriptors that can fit in an `fd_set'. */
diff --git a/sysdeps/unix/sysv/linux/generic/brk.c b/sysdeps/unix/sysv/linux/generic/brk.c
index 1b84004da5..ed47915cba 100644
--- a/sysdeps/unix/sysv/linux/generic/brk.c
+++ b/sysdeps/unix/sysv/linux/generic/brk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/chmod.c b/sysdeps/unix/sysv/linux/generic/chmod.c
index f1efa247d6..d598c8ae85 100644
--- a/sysdeps/unix/sysv/linux/generic/chmod.c
+++ b/sysdeps/unix/sysv/linux/generic/chmod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -28,4 +28,6 @@ __chmod (const char *file, mode_t mode)
{
return INLINE_SYSCALL (fchmodat, 3, AT_FDCWD, file, mode);
}
+
+libc_hidden_def (__chmod)
weak_alias (__chmod, chmod)
diff --git a/sysdeps/unix/sysv/linux/generic/chown.c b/sysdeps/unix/sysv/linux/generic/chown.c
index 3453b5197b..5d2ddb192f 100644
--- a/sysdeps/unix/sysv/linux/generic/chown.c
+++ b/sysdeps/unix/sysv/linux/generic/chown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/creat.c b/sysdeps/unix/sysv/linux/generic/creat.c
deleted file mode 100644
index 33aee64a5f..0000000000
--- a/sysdeps/unix/sysv/linux/generic/creat.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 <fcntl.h>
-#include <sys/types.h>
-#include <sysdep-cancel.h>
-
-#undef creat
-
-/* Create FILE with protections MODE. */
-int
-creat (const char *file, mode_t mode)
-{
- return __open (file, O_WRONLY | O_CREAT | O_TRUNC, mode);
-}
-
-/* __open handles cancellation. */
-LIBC_CANCEL_HANDLED ();
-
-#if __WORDSIZE == 64
-weak_alias (creat, creat64)
-#endif
diff --git a/sysdeps/unix/sysv/linux/generic/dl-origin.c b/sysdeps/unix/sysv/linux/generic/dl-origin.c
index 3ad2a85095..d07c863c2c 100644
--- a/sysdeps/unix/sysv/linux/generic/dl-origin.c
+++ b/sysdeps/unix/sysv/linux/generic/dl-origin.c
@@ -1,5 +1,5 @@
/* Find path of executable.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/unix/sysv/linux/generic/dup2.c b/sysdeps/unix/sysv/linux/generic/dup2.c
index d5afb5e9a3..294908ef2c 100644
--- a/sysdeps/unix/sysv/linux/generic/dup2.c
+++ b/sysdeps/unix/sysv/linux/generic/dup2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/epoll_create.c b/sysdeps/unix/sysv/linux/generic/epoll_create.c
index 9c863ef52d..bb5f77d1bf 100644
--- a/sysdeps/unix/sysv/linux/generic/epoll_create.c
+++ b/sysdeps/unix/sysv/linux/generic/epoll_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/futimesat.c b/sysdeps/unix/sysv/linux/generic/futimesat.c
index b04efb934b..64058edd18 100644
--- a/sysdeps/unix/sysv/linux/generic/futimesat.c
+++ b/sysdeps/unix/sysv/linux/generic/futimesat.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* futimesat -- Change access and modification times of file. Linux version.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/getdents.c b/sysdeps/unix/sysv/linux/generic/getdents.c
deleted file mode 100644
index 14dbbc71a0..0000000000
--- a/sysdeps/unix/sysv/linux/generic/getdents.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in getdents64.c */
diff --git a/sysdeps/unix/sysv/linux/generic/getdents64.c b/sysdeps/unix/sysv/linux/generic/getdents64.c
deleted file mode 100644
index 3e4469931a..0000000000
--- a/sysdeps/unix/sysv/linux/generic/getdents64.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 <stddef.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <bits/wordsize.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* The kernel struct linux_dirent64 matches the 'struct getdents64' type. */
-ssize_t
-__getdents64 (int fd, char *buf, size_t nbytes)
-{
- return INLINE_SYSCALL (getdents64, 3, fd, buf, nbytes);
-}
-
-#if __WORDSIZE == 64
-strong_alias (__getdents64, __getdents)
-#endif
diff --git a/sysdeps/unix/sysv/linux/generic/inotify_init.c b/sysdeps/unix/sysv/linux/generic/inotify_init.c
index da9c71501f..ab49fb835c 100644
--- a/sysdeps/unix/sysv/linux/generic/inotify_init.c
+++ b/sysdeps/unix/sysv/linux/generic/inotify_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/kernel_stat.h b/sysdeps/unix/sysv/linux/generic/kernel_stat.h
index be12819d36..2f36a51576 100644
--- a/sysdeps/unix/sysv/linux/generic/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/generic/kernel_stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -23,4 +23,8 @@
/* We provide separate 32-bit API versions that check for EOVERFLOW. */
#if __WORDSIZE == 64
# define XSTAT_IS_XSTAT64 1
+#else
+# define XSTAT_IS_XSTAT64 0
#endif
+
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/generic/lchown.c b/sysdeps/unix/sysv/linux/generic/lchown.c
index 5e77c82736..8e503f54b2 100644
--- a/sysdeps/unix/sysv/linux/generic/lchown.c
+++ b/sysdeps/unix/sysv/linux/generic/lchown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/link.c b/sysdeps/unix/sysv/linux/generic/link.c
index e3294f5ee6..6f0ec63108 100644
--- a/sysdeps/unix/sysv/linux/generic/link.c
+++ b/sysdeps/unix/sysv/linux/generic/link.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/lxstat.c b/sysdeps/unix/sysv/linux/generic/lxstat.c
index f97c2d5fe1..b175c85bea 100644
--- a/sysdeps/unix/sysv/linux/generic/lxstat.c
+++ b/sysdeps/unix/sysv/linux/generic/lxstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -41,7 +41,7 @@ __lxstat (int vers, const char *name, struct stat *buf)
hidden_def (__lxstat)
weak_alias (__lxstat, _lxstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
#undef __lxstat64
strong_alias (__lxstat, __lxstat64);
hidden_ver (__lxstat, __lxstat64)
diff --git a/sysdeps/unix/sysv/linux/generic/mkdir.c b/sysdeps/unix/sysv/linux/generic/mkdir.c
index 91cd53c4f6..a597622d7d 100644
--- a/sysdeps/unix/sysv/linux/generic/mkdir.c
+++ b/sysdeps/unix/sysv/linux/generic/mkdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -30,4 +30,6 @@ __mkdir (const char *path, mode_t mode)
{
return INLINE_SYSCALL (mkdirat, 3, AT_FDCWD, path, mode);
}
+
+libc_hidden_def (__mkdir)
weak_alias (__mkdir, mkdir)
diff --git a/sysdeps/unix/sysv/linux/generic/open.c b/sysdeps/unix/sysv/linux/generic/open.c
deleted file mode 100644
index 931ba237b8..0000000000
--- a/sysdeps/unix/sysv/linux/generic/open.c
+++ /dev/null
@@ -1,62 +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 <stdarg.h>
-#include <stdio.h>
-#include <sysdep-cancel.h>
-
-/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG,
- a third argument is the file protection. */
-int
-__libc_open (const char *file, int oflag, ...)
-{
- int mode = 0;
-
- if (__OPEN_NEEDS_MODE (oflag))
- {
- va_list arg;
- va_start (arg, oflag);
- mode = va_arg (arg, int);
- va_end (arg);
- }
-
- return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag, mode);
-}
-libc_hidden_def (__libc_open)
-
-weak_alias (__libc_open, __open)
-libc_hidden_weak (__open)
-weak_alias (__libc_open, open)
-
-int
-__open_nocancel (const char *file, int oflag, ...)
-{
- int mode = 0;
-
- if (__OPEN_NEEDS_MODE (oflag))
- {
- va_list arg;
- va_start (arg, oflag);
- mode = va_arg (arg, int);
- va_end (arg);
- }
-
- return INLINE_SYSCALL (openat, 4, AT_FDCWD, file, oflag, mode);
-}
diff --git a/sysdeps/unix/sysv/linux/generic/open64.c b/sysdeps/unix/sysv/linux/generic/open64.c
deleted file mode 100644
index 4c1e3a30e4..0000000000
--- a/sysdeps/unix/sysv/linux/generic/open64.c
+++ /dev/null
@@ -1,44 +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 <stdarg.h>
-#include <stdio.h>
-#include <sysdep-cancel.h>
-
-/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG,
- a third argument is the file protection. */
-int
-__libc_open64 (const char *file, int oflag, ...)
-{
- int mode = 0;
-
- if (__OPEN_NEEDS_MODE (oflag))
- {
- va_list arg;
- va_start (arg, oflag);
- mode = va_arg (arg, int);
- va_end (arg);
- }
-
- return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag | O_LARGEFILE, mode);
-}
-weak_alias (__libc_open64, __open64)
-libc_hidden_weak (__open64)
-weak_alias (__libc_open64, open64)
diff --git a/sysdeps/unix/sysv/linux/generic/pause.c b/sysdeps/unix/sysv/linux/generic/pause.c
deleted file mode 100644
index 9864ca007a..0000000000
--- a/sysdeps/unix/sysv/linux/generic/pause.c
+++ /dev/null
@@ -1,39 +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 <signal.h>
-#include <unistd.h>
-#include <sysdep-cancel.h>
-
-/* Suspend the process until a signal arrives.
- This always returns -1 and sets errno to EINTR. */
-
-int
-__libc_pause (void)
-{
- sigset_t set;
-
- int rc =
- SYSCALL_CANCEL (rt_sigprocmask, SIG_BLOCK, NULL, &set, _NSIG / 8);
- if (rc == 0)
- rc = SYSCALL_CANCEL (rt_sigsuspend, &set, _NSIG / 8);
-
- return rc;
-}
-
-weak_alias (__libc_pause, pause)
diff --git a/sysdeps/unix/sysv/linux/generic/pipe.c b/sysdeps/unix/sysv/linux/generic/pipe.c
index 1efa2c196e..d33052cad0 100644
--- a/sysdeps/unix/sysv/linux/generic/pipe.c
+++ b/sysdeps/unix/sysv/linux/generic/pipe.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/readlink.c b/sysdeps/unix/sysv/linux/generic/readlink.c
index 93878344b3..6c7b62af3f 100644
--- a/sysdeps/unix/sysv/linux/generic/readlink.c
+++ b/sysdeps/unix/sysv/linux/generic/readlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/readlink_chk.c b/sysdeps/unix/sysv/linux/generic/readlink_chk.c
index 82a2ca5fc4..9240408a6b 100644
--- a/sysdeps/unix/sysv/linux/generic/readlink_chk.c
+++ b/sysdeps/unix/sysv/linux/generic/readlink_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/recv.c b/sysdeps/unix/sysv/linux/generic/recv.c
deleted file mode 100644
index 7adebf201e..0000000000
--- a/sysdeps/unix/sysv/linux/generic/recv.c
+++ /dev/null
@@ -1,32 +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 <stdlib.h>
-#include <sys/types.h>
-#include <sysdep-cancel.h>
-#include <libc-symbols.h>
-
-ssize_t
-__libc_recv (int sockfd, void *buffer, size_t len, int flags)
-{
- return SYSCALL_CANCEL (recvfrom, sockfd, buffer, len, flags,
- NULL, NULL);
-}
-strong_alias (__libc_recv, __recv)
-libc_hidden_def (__recv)
-weak_alias (__libc_recv, recv)
diff --git a/sysdeps/unix/sysv/linux/generic/rename.c b/sysdeps/unix/sysv/linux/generic/rename.c
deleted file mode 100644
index 174c147eb4..0000000000
--- a/sysdeps/unix/sysv/linux/generic/rename.c
+++ /dev/null
@@ -1,29 +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 <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sysdep.h>
-
-/* Rename the file OLD to NEW. */
-int
-rename (const char *old, const char *new)
-{
- return INLINE_SYSCALL (renameat, 4, AT_FDCWD, old, AT_FDCWD, new);
-}
diff --git a/sysdeps/unix/sysv/linux/generic/rmdir.c b/sysdeps/unix/sysv/linux/generic/rmdir.c
index 0c37354782..8c6ffa0c5d 100644
--- a/sysdeps/unix/sysv/linux/generic/rmdir.c
+++ b/sysdeps/unix/sysv/linux/generic/rmdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/select.c b/sysdeps/unix/sysv/linux/generic/select.c
deleted file mode 100644
index 6b63cfc9a7..0000000000
--- a/sysdeps/unix/sysv/linux/generic/select.c
+++ /dev/null
@@ -1,62 +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 <sys/time.h>
-#include <sys/types.h>
-#include <sys/select.h>
-#include <errno.h>
-#include <sysdep-cancel.h>
-
-/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
- readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
- (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out
- after waiting the interval specified therein. Returns the number of ready
- descriptors, or -1 for errors. */
-
-int
-__select(int nfds, fd_set *readfds,
- fd_set *writefds, fd_set *exceptfds,
- struct timeval *timeout)
-{
- int result;
- struct timespec ts, *tsp = NULL;
-
- if (timeout)
- {
- TIMEVAL_TO_TIMESPEC (timeout, &ts);
- tsp = &ts;
- }
-
- result = SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds, tsp,
- NULL);
-
- if (timeout)
- {
- /* Linux by default will update the timeout after a pselect6 syscall
- (though the pselect() glibc call suppresses this behavior).
- Since select() on Linux has the same behavior as the pselect6
- syscall, we update the timeout here. */
- TIMESPEC_TO_TIMEVAL (timeout, &ts);
- }
-
- return result;
-}
-libc_hidden_def (__select)
-
-weak_alias (__select, select)
-weak_alias (__select, __libc_select)
diff --git a/sysdeps/unix/sysv/linux/generic/send.c b/sysdeps/unix/sysv/linux/generic/send.c
deleted file mode 100644
index 2399f207e1..0000000000
--- a/sysdeps/unix/sysv/linux/generic/send.c
+++ /dev/null
@@ -1,30 +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 <stdlib.h>
-#include <sys/types.h>
-#include <sysdep-cancel.h>
-#include <libc-symbols.h>
-
-ssize_t
-__libc_send (int sockfd, const void *buffer, size_t len, int flags)
-{
- return SYSCALL_CANCEL (sendto, sockfd, buffer, len, flags, NULL, 0);
-}
-strong_alias (__libc_send, __send)
-weak_alias (__libc_send, send)
diff --git a/sysdeps/unix/sysv/linux/generic/symlink.c b/sysdeps/unix/sysv/linux/generic/symlink.c
index e350734972..db991c81d8 100644
--- a/sysdeps/unix/sysv/linux/generic/symlink.c
+++ b/sysdeps/unix/sysv/linux/generic/symlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list
index 4b2e74762f..ed8b216d47 100644
--- a/sysdeps/unix/sysv/linux/generic/syscalls.list
+++ b/sysdeps/unix/sysv/linux/generic/syscalls.list
@@ -1,32 +1,12 @@
# File name Caller Syscall name # args Strong name Weak names
-# SysV APIs
-msgget - msgget i:ii __msgget msgget
-msgctl - msgctl i:iip __msgctl msgctl
-msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
-msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
-semget - semget i:iii __semget semget
-semctl - semctl i:iiii __semctl semctl
-semtimedop - semtimedop i:ipip semtimedop
-semop - semop i:ipi __semop semop
-shmget - shmget i:iii __shmget shmget
-shmctl - shmctl i:iip __shmctl shmctl
-shmat - shmat i:ipi __shmat shmat
-shmdt - shmdt i:s __shmdt shmdt
-
# Socket APIs
socket - socket i:iii __socket socket
socketpair - socketpair i:iiif __socketpair socketpair
bind - bind i:ipi __bind bind
listen - listen i:ii __listen listen
-accept - accept Ci:iBN __libc_accept __accept accept
-connect - connect Ci:ipi __libc_connect __connect connect
getsockname - getsockname i:ipp __getsockname getsockname
getpeername - getpeername i:ipp __getpeername getpeername
-sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
-recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
shutdown - shutdown i:ii __shutdown shutdown
-sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg
-recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg
diff --git a/sysdeps/unix/sysv/linux/generic/sysctl.c b/sysdeps/unix/sysv/linux/generic/sysctl.c
index 7c08874668..61e7fa8149 100644
--- a/sysdeps/unix/sysv/linux/generic/sysctl.c
+++ b/sysdeps/unix/sysv/linux/generic/sysctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h
index 4f2c65d074..81a1011f46 100644
--- a/sysdeps/unix/sysv/linux/generic/sysdep.h
+++ b/sysdeps/unix/sysv/linux/generic/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -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
@@ -31,13 +33,3 @@
#define __NR_pread __NR_pread64
#define __NR_pwrite __NR_pwrite64
#endif
-
-/* Provide a dummy argument that can be used to force register
- alignment for register pairs if required by the syscall ABI. */
-#ifdef __ASSUME_ALIGNED_REGISTER_PAIRS
-#define __ALIGNMENT_ARG 0,
-#define __ALIGNMENT_COUNT(a,b) b
-#else
-#define __ALIGNMENT_ARG
-#define __ALIGNMENT_COUNT(a,b) a
-#endif
diff --git a/sysdeps/unix/sysv/linux/generic/umount.c b/sysdeps/unix/sysv/linux/generic/umount.c
deleted file mode 100644
index df0a5f71c3..0000000000
--- a/sysdeps/unix/sysv/linux/generic/umount.c
+++ /dev/null
@@ -1,30 +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/>. */
-
-/* Since the generic Linux syscall ABI doesn't have an oldumount system call,
- do what the kernel does down here. */
-
-extern long int __umount2 (const char *name, int flags);
-
-long int
-__umount (const char *name)
-{
- return __umount2 (name, 0);
-}
-
-weak_alias (__umount, umount);
diff --git a/sysdeps/unix/sysv/linux/generic/unlink.c b/sysdeps/unix/sysv/linux/generic/unlink.c
index a6d5ca834d..f07712f8a8 100644
--- a/sysdeps/unix/sysv/linux/generic/unlink.c
+++ b/sysdeps/unix/sysv/linux/generic/unlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/ustat.c b/sysdeps/unix/sysv/linux/generic/ustat.c
deleted file mode 100644
index 62ec623fb8..0000000000
--- a/sysdeps/unix/sysv/linux/generic/ustat.c
+++ /dev/null
@@ -1,32 +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/ustat.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* This deprecated syscall is no longer used (replaced with fstat). */
-int
-ustat (dev_t dev, struct ustat *ubuf)
-{
- __set_errno (ENOSYS);
- return -1;
-}
-stub_warning (ustat)
diff --git a/sysdeps/unix/sysv/linux/generic/utimes.c b/sysdeps/unix/sysv/linux/generic/utimes.c
index 9d8ece4b7a..b8227fc4ef 100644
--- a/sysdeps/unix/sysv/linux/generic/utimes.c
+++ b/sysdeps/unix/sysv/linux/generic/utimes.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* utimes -- Change access and modification times of file. Linux version.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c
deleted file mode 100644
index e2c87e7ef6..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c
+++ /dev/null
@@ -1,86 +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 <assert.h>
-#include <errno.h>
-#include <sysdep-cancel.h> /* Must come before <fcntl.h>. */
-#include <fcntl.h>
-#include <stdarg.h>
-
-#include <sys/syscall.h>
-
-
-static int
-do_fcntl (int fd, int cmd, void *arg)
-{
- if (cmd != F_GETOWN)
- return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
-
- INTERNAL_SYSCALL_DECL (err);
- struct f_owner_ex fex;
- int res = INTERNAL_SYSCALL (fcntl64, err, 3, fd, F_GETOWN_EX, &fex);
- if (!INTERNAL_SYSCALL_ERROR_P (res, err))
- return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
-
- __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
- return -1;
-}
-
-
-#ifndef NO_CANCELLATION
-int
-__fcntl_nocancel (int fd, int cmd, ...)
-{
- va_list ap;
- void *arg;
-
- va_start (ap, cmd);
- arg = va_arg (ap, void *);
- va_end (ap);
-
- return do_fcntl (fd, cmd, arg);
-}
-#endif
-
-
-int
-__libc_fcntl (int fd, int cmd, ...)
-{
- va_list ap;
- void *arg;
-
- va_start (ap, cmd);
- arg = va_arg (ap, void *);
- va_end (ap);
-
- if (SINGLE_THREAD_P || cmd != F_SETLKW)
- return do_fcntl (fd, cmd, arg);
-
- int oldtype = LIBC_CANCEL_ASYNC ();
-
- int result = do_fcntl (fd, cmd, arg);
-
- LIBC_CANCEL_RESET (oldtype);
-
- return result;
-}
-libc_hidden_def (__libc_fcntl)
-
-weak_alias (__libc_fcntl, __fcntl)
-libc_hidden_weak (__fcntl)
-weak_alias (__libc_fcntl, fcntl)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c
index be9599a3eb..5aebf2334c 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -18,8 +18,10 @@
#include <errno.h>
#include <sys/statfs.h>
+#include <kernel_stat.h>
#include <stddef.h>
+#if !STATFS_IS_STATFS64
#include "overflow.h"
/* Return information about the filesystem on which FD resides. */
@@ -30,3 +32,4 @@ __fstatfs (int fd, struct statfs *buf)
return rc ?: statfs_overflow (buf);
}
weak_alias (__fstatfs, fstatfs)
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c
deleted file mode 100644
index e1b500d434..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c
+++ /dev/null
@@ -1,31 +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 <unistd.h>
-
-/* Truncate the file FD refers to to LENGTH bytes. */
-int
-__ftruncate (int fd, off_t length)
-{
- return INLINE_SYSCALL (ftruncate64, __ALIGNMENT_COUNT (3, 4), fd,
- __ALIGNMENT_ARG
- __LONG_LONG_PAIR (length >> 31, length));
-}
-weak_alias (__ftruncate, ftruncate)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c
deleted file mode 100644
index 946f05a80c..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c
+++ /dev/null
@@ -1,32 +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 <unistd.h>
-
-/* Truncate the file FD refers to to LENGTH bytes. */
-int
-__ftruncate64 (int fd, off64_t length)
-{
- unsigned int low = length & 0xffffffff;
- unsigned int high = length >> 32;
- return INLINE_SYSCALL (ftruncate64, __ALIGNMENT_COUNT (3, 4), fd,
- __ALIGNMENT_ARG __LONG_LONG_PAIR (high, low));
-}
-weak_alias (__ftruncate64, ftruncate64)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c
index dd5201192c..b5c766ddf3 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -25,6 +25,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#if !XSTAT_IS_XSTAT64
#include "overflow.h"
/* Get information about the file FD in BUF. */
@@ -43,3 +44,4 @@ __fxstat (int vers, int fd, struct stat *buf)
hidden_def (__fxstat)
weak_alias (__fxstat, _fxstat);
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c
new file mode 100644
index 0000000000..c558388b8c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c
@@ -0,0 +1,36 @@
+/* __fxstat64 () implementation.
+ Copyright (C) 2016-2018 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/>. */
+
+/* Hide the prototypes for __fxstat and _fxstat so that GCC will not
+ complain about the different function signatures if they are aliased
+ to __fxstat64. If XSTAT_IS_XSTAT64 is set to non-zero then the stat and
+ stat64 structures have an identical layout but different type names. */
+
+#define __fxstat __fxstat_disable
+#define _fxstat _fxstat_disable
+
+#include <sysdeps/unix/sysv/linux/fxstat64.c>
+
+#undef __fxstat
+#undef _fxstat
+#if XSTAT_IS_XSTAT64
+weak_alias (__fxstat64, __fxstat)
+weak_alias (__fxstat64, _fxstat)
+hidden_ver (__fxstat64, __fxstat)
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c
index dc7f934908..0bda8f7ac4 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -26,6 +26,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#if !XSTAT_IS_XSTAT64
#include "overflow.h"
/* Get information about the file NAME in BUF. */
@@ -42,3 +43,4 @@ __fxstatat (int vers, int fd, const char *file, struct stat *buf, int flag)
return -1;
}
libc_hidden_def (__fxstatat)
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c
new file mode 100644
index 0000000000..602bf4b28a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c
@@ -0,0 +1,37 @@
+/* __fxstatat64 () implementation.
+ Copyright (C) 2016-2018 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/>. */
+
+/* Hide the prototype for __fxstatat so that GCC will not complain about
+ the different function signature if it is aliased to __fxstatat64.
+ If XSTAT_IS_XSTAT64 is set to non-zero then the stat and stat64 structures
+ have an identical layout but different type names. */
+
+#define __fxstatat __fxstatat_disable
+
+#include <sys/stat.h>
+#undef _STAT_VER_LINUX
+#define _STAT_VER_LINUX _STAT_VER_KERNEL
+
+#include <sysdeps/unix/sysv/linux/fxstatat64.c>
+
+#undef __fxstatat
+#if XSTAT_IS_XSTAT64
+weak_alias (__fxstatat64, __fxstatat)
+libc_hidden_ver (__fxstatat64, __fxstatat)
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c
deleted file mode 100644
index bc3a80ec30..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Simplified from sysdeps/unix/sysv/linux/getdents.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.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <alloca.h>
-#include <assert.h>
-#include <errno.h>
-#include <dirent.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/param.h>
-#include <sys/types.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Pack the dirent64 struct down into 32-bit offset/inode fields, and
- ensure that no overflow occurs. */
-ssize_t
-__getdents (int fd, char *buf, size_t nbytes)
-{
- union
- {
- struct dirent64 k; /* Kernel structure. */
- struct dirent u;
- char b[1];
- } *kbuf = (void *) buf, *outp, *inp;
- size_t kbytes = nbytes;
- off64_t last_offset = -1;
- ssize_t retval;
-
- const size_t size_diff = (offsetof (struct dirent64, d_name)
- - offsetof (struct dirent, d_name));
- if (nbytes <= sizeof (struct dirent))
- {
- kbytes = nbytes + offsetof (struct dirent64, d_name)
- - offsetof (struct dirent, d_name);
- kbuf = __alloca(kbytes);
- }
-
- retval = INLINE_SYSCALL (getdents64, 3, fd, kbuf, kbytes);
- if (retval == -1)
- return -1;
-
- /* These two pointers might alias the same memory buffer.
- Standard C requires that we always use the same type for them,
- so we must use the union type. */
- inp = kbuf;
- outp = (void *) buf;
-
- while (&inp->b < &kbuf->b + retval)
- {
- const size_t alignment = __alignof__ (struct dirent);
- /* Since inp->k.d_reclen is already aligned for the kernel
- structure this may compute a value that is bigger
- than necessary. */
- size_t old_reclen = inp->k.d_reclen;
- size_t new_reclen = ((old_reclen - size_diff + alignment - 1)
- & ~(alignment - 1));
-
- /* Copy the data out of the old structure into temporary space.
- Then copy the name, which may overlap if BUF == KBUF. */
- const uint64_t d_ino = inp->k.d_ino;
- const int64_t d_off = inp->k.d_off;
- const uint8_t d_type = inp->k.d_type;
-
- memmove (outp->u.d_name, inp->k.d_name,
- old_reclen - offsetof (struct dirent64, d_name));
-
- /* Now we have copied the data from INP and access only OUTP. */
-
- outp->u.d_ino = d_ino;
- outp->u.d_off = d_off;
- if ((sizeof (outp->u.d_ino) != sizeof (inp->k.d_ino)
- && outp->u.d_ino != d_ino)
- || (sizeof (outp->u.d_off) != sizeof (inp->k.d_off)
- && outp->u.d_off != d_off))
- {
- /* Overflow. If there was at least one entry before this one,
- return them without error, otherwise signal overflow. */
- if (last_offset != -1)
- {
- __lseek64 (fd, last_offset, SEEK_SET);
- return outp->b - buf;
- }
- __set_errno (EOVERFLOW);
- return -1;
- }
-
- last_offset = d_off;
- outp->u.d_reclen = new_reclen;
- outp->u.d_type = d_type;
-
- inp = (void *) inp + old_reclen;
- outp = (void *) outp + new_reclen;
- }
-
- return outp->b - buf;
-}
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/lseek.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c
deleted file mode 100644
index dbf0b2652b..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c
+++ /dev/null
@@ -1,38 +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 <unistd.h>
-#include <sys/types.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-#include "overflow.h"
-
-off_t
-__lseek (int fd, off_t offset, int whence)
-{
- loff_t res;
- int rc = INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 31),
- (off_t) offset, &res, whence);
- return rc ?: lseek_overflow (res);
-}
-libc_hidden_def (__lseek)
-weak_alias (__lseek, lseek)
-strong_alias (__lseek, __libc_lseek)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c
index 395f98b06f..c278a4dbce 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -25,6 +25,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#if !XSTAT_IS_XSTAT64
#include "overflow.h"
/* Get information about the file NAME in BUF. */
@@ -41,3 +42,4 @@ __lxstat (int vers, const char *name, struct stat *buf)
return -1;
}
hidden_def (__lxstat)
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c
index e1c15a8cc2..761dd16233 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -16,6 +16,13 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Hide the prototype for __lxstat so that GCC will not complain about
+ the different function signature if it is aliased to __lxstat64.
+ If XSTAT_IS_XSTAT64 is set to non-zero then the stat and stat64
+ structures have an identical layout but different type names. */
+
+#define __lxstat __lxstat_disable
+
#include <errno.h>
#include <stddef.h>
#include <fcntl.h>
@@ -36,3 +43,9 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf)
return -1;
}
hidden_def (__lxstat64)
+
+#undef __lxstat
+#if XSTAT_IS_XSTAT64
+strong_alias (__lxstat64, __lxstat)
+hidden_ver (__lxstat64, __lxstat)
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c
deleted file mode 100644
index 6d294a428e..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c
+++ /dev/null
@@ -1,40 +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 <sys/types.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <sysdep.h>
-
-#ifndef MMAP_PAGE_UNIT
-# define MMAP_PAGE_UNIT 4096UL
-#endif
-
-__ptr_t
-__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
-{
- if (offset & (MMAP_PAGE_UNIT - 1))
- {
- __set_errno (EINVAL);
- return MAP_FAILED;
- }
- return (__ptr_t) INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, fd,
- offset / MMAP_PAGE_UNIT);
-}
-
-weak_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
index 452cf55875..9d70532150 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
@@ -1,5 +1,5 @@
/* Overflow tests for stat, statfs, and lseek functions.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
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/generic/wordsize-32/pread.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c
deleted file mode 100644
index 0dff648111..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.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.
- Based on work 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 <assert.h>
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
- assert (sizeof (offset) == 4);
- return SYSCALL_CANCEL (pread64, fd,
- buf, count, __ALIGNMENT_ARG
- __LONG_LONG_PAIR (offset >> 31, offset));
-}
-strong_alias (__libc_pread, __pread)
-weak_alias (__libc_pread, pread)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c
deleted file mode 100644
index 8931900007..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c
+++ /dev/null
@@ -1,34 +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.
- Based on work 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 <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
- return SYSCALL_CANCEL (pread64, fd, buf, count, __ALIGNMENT_ARG
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
-}
-weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, pread64)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c
deleted file mode 100644
index ec30d4c0b7..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c
+++ /dev/null
@@ -1,38 +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.
- Based on work 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 <assert.h>
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-#include <sys/uio.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_preadv (int fd, const struct iovec *vector, int count, off_t offset)
-{
- assert (sizeof (offset) == 4);
- return SYSCALL_CANCEL (preadv, fd,
- vector, count, __ALIGNMENT_ARG
- __LONG_LONG_PAIR (offset >> 31, offset));
-}
-strong_alias (__libc_preadv, __preadv)
-weak_alias (__libc_preadv, preadv)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c
deleted file mode 100644
index fc008c67c5..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c
+++ /dev/null
@@ -1,38 +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.
- Based on work 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 <endian.h>
-#include <unistd.h>
-#include <sys/uio.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_preadv64 (int fd, const struct iovec *vector, int count, off64_t offset)
-{
- return SYSCALL_CANCEL (preadv, fd,
- vector, count, __ALIGNMENT_ARG
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
-}
-
-strong_alias (__libc_preadv64, __preadv64)
-weak_alias (__libc_preadv64, preadv64)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c
deleted file mode 100644
index f9f1e0da36..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c
+++ /dev/null
@@ -1,36 +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.
- Based on work 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 <assert.h>
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
- assert (sizeof (offset) == 4);
- return SYSCALL_CANCEL (pwrite64, fd, buf, count, __ALIGNMENT_ARG
- __LONG_LONG_PAIR (offset >> 31, offset));
-}
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__libc_pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c
deleted file mode 100644
index 53aaa47fbd..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c
+++ /dev/null
@@ -1,35 +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.
- Based on work 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 <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
- return SYSCALL_CANCEL (pwrite64, fd, buf, count, __ALIGNMENT_ARG
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
-}
-weak_alias (__libc_pwrite64, __pwrite64)
-libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c
deleted file mode 100644
index 9ef11b564c..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.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.
- Based on work 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 <assert.h>
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-#include <sys/uio.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pwritev (int fd, const struct iovec *vector, int count, off_t offset)
-{
- assert (sizeof (offset) == 4);
- return SYSCALL_CANCEL (pwritev, fd, vector, count, __ALIGNMENT_ARG
- __LONG_LONG_PAIR (offset >> 31, offset));
-}
-strong_alias (__libc_pwritev, __pwritev)
-weak_alias (__libc_pwritev, pwritev)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c
deleted file mode 100644
index 49b723dffe..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c
+++ /dev/null
@@ -1,38 +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.
- Based on work 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 <endian.h>
-#include <unistd.h>
-#include <sys/uio.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pwritev64 (int fd, const struct iovec *vector, int count,
- off64_t offset)
-{
- return SYSCALL_CANCEL (pwritev, fd,
- vector, count, __ALIGNMENT_ARG
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
-}
-strong_alias (__libc_pwritev64, pwritev64)
-weak_alias (__libc_pwritev64, __pwritev64)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c
index 51050c0971..5860f28844 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c
index 1937f0555f..4e1ba15885 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -18,8 +18,10 @@
#include <errno.h>
#include <sys/statfs.h>
+#include <kernel_stat.h>
#include <stddef.h>
+#if !STATFS_IS_STATFS64
#include "overflow.h"
/* Return information about the filesystem on which FILE resides. */
@@ -31,3 +33,4 @@ __statfs (const char *file, struct statfs *buf)
}
libc_hidden_def (__statfs)
weak_alias (__statfs, statfs)
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list b/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list
index f055c68519..b775008a37 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list
@@ -1,7 +1,5 @@
# File name Caller Syscall name # args Strong name Weak names
# rlimit APIs
-getrlimit - getrlimit i:ip __getrlimit getrlimit
-setrlimit - setrlimit i:ip __setrlimit setrlimit
prlimit64 EXTRA prlimit64 i:iipp prlimit64
fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c
deleted file mode 100644
index 25799517da..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c
+++ /dev/null
@@ -1,31 +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 <unistd.h>
-
-/* Truncate PATH to LENGTH bytes. */
-int
-__truncate (const char *path, off_t length)
-{
- return INLINE_SYSCALL (truncate64, __ALIGNMENT_COUNT (3, 4), path,
- __ALIGNMENT_ARG
- __LONG_LONG_PAIR (length >> 31, length));
-}
-weak_alias (__truncate, truncate)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate64.c
deleted file mode 100644
index f2927ea857..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate64.c
+++ /dev/null
@@ -1,31 +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 <unistd.h>
-
-/* Truncate the file PATH to LENGTH bytes. */
-int
-truncate64 (const char *path, off64_t length)
-{
- unsigned int low = length & 0xffffffff;
- unsigned int high = length >> 32;
- return INLINE_SYSCALL (truncate64, __ALIGNMENT_COUNT (3, 4), path,
- __ALIGNMENT_ARG __LONG_LONG_PAIR (high, low));
-}
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c
index fdd2cb0ed8..1fd57ff9ed 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -25,6 +25,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#if !XSTAT_IS_XSTAT64
#include "overflow.h"
/* Get information about the file NAME in BUF. */
@@ -41,3 +42,4 @@ __xstat (int vers, const char *name, struct stat *buf)
return -1;
}
hidden_def (__xstat)
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c
index 225233780b..ae704958ba 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -16,6 +16,13 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Hide the prototype for __xstat so that GCC will not complain about
+ the different function signature if it is aliased to __xstat64.
+ If XSTAT_IS_XSTAT64 is set to non-zero then the stat and stat64
+ structures have an identical layout but different type names. */
+
+#define __xstat __xstat_disable
+
#include <errno.h>
#include <stddef.h>
#include <fcntl.h>
@@ -36,3 +43,9 @@ __xstat64 (int vers, const char *name, struct stat64 *buf)
return -1;
}
hidden_def (__xstat64)
+
+#undef __xstat
+#if XSTAT_IS_XSTAT64
+strong_alias (__xstat64, __xstat)
+hidden_ver (__xstat64, __xstat)
+#endif
diff --git a/sysdeps/unix/sysv/linux/generic/xmknod.c b/sysdeps/unix/sysv/linux/generic/xmknod.c
index 76b197f50a..9c9e634e41 100644
--- a/sysdeps/unix/sysv/linux/generic/xmknod.c
+++ b/sysdeps/unix/sysv/linux/generic/xmknod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
diff --git a/sysdeps/unix/sysv/linux/generic/xstat.c b/sysdeps/unix/sysv/linux/generic/xstat.c
index 3d82b87e4a..39acac633e 100644
--- a/sysdeps/unix/sysv/linux/generic/xstat.c
+++ b/sysdeps/unix/sysv/linux/generic/xstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -41,7 +41,7 @@ __xstat (int vers, const char *name, struct stat *buf)
hidden_def (__xstat)
weak_alias (__xstat, _xstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
#undef __xstat64
strong_alias (__xstat, __xstat64);
hidden_ver (__xstat, __xstat64)
diff --git a/sysdeps/unix/sysv/linux/gentempfd.c b/sysdeps/unix/sysv/linux/gentempfd.c
new file mode 100644
index 0000000000..ece6a7593c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/gentempfd.c
@@ -0,0 +1,35 @@
+/* Generate a temporary file descriptor. Linux version.
+ Copyright (C) 2017-2018 Free Software 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 <fcntl.h>
+#include <errno.h>
+#include <string.h>
+
+int
+__gen_tempfd (int flags)
+{
+ int fd = __open (P_tmpdir, O_RDWR | O_TMPFILE | O_EXCL | flags,
+ S_IRUSR | S_IWUSR);
+ if (fd < 0 && errno == ENOENT && strcmp (P_tmpdir, "/tmp") != 0)
+ fd = __open ("/tmp", O_RDWR | O_TMPFILE | O_EXCL | flags,
+ S_IRUSR | S_IWUSR);
+
+ return fd;
+}
+libc_hidden_def (__gen_tempfd)
diff --git a/sysdeps/unix/sysv/linux/getclktck.c b/sysdeps/unix/sysv/linux/getclktck.c
index 27d080effe..7abd4147c6 100644
--- a/sysdeps/unix/sysv/linux/getclktck.c
+++ b/sysdeps/unix/sysv/linux/getclktck.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c
index 3f21ae743f..866b9d26d5 100644
--- a/sysdeps/unix/sysv/linux/getcwd.c
+++ b/sysdeps/unix/sysv/linux/getcwd.c
@@ -1,5 +1,5 @@
/* Determine current working directory. Linux version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -40,7 +40,7 @@
named `cwd'. Reading the content of this link immediate gives us the
information. But we have to take care for systems which do not have
the proc filesystem mounted. Use the POSIX implementation in this case. */
-static char *generic_getcwd (char *buf, size_t size) internal_function;
+static char *generic_getcwd (char *buf, size_t size);
char *
__getcwd (char *buf, size_t size)
@@ -76,7 +76,7 @@ __getcwd (char *buf, size_t size)
int retval;
retval = INLINE_SYSCALL (getcwd, 2, path, alloc_size);
- if (retval >= 0)
+ if (retval > 0 && path[0] == '/')
{
#ifndef NO_ALLOCATION
if (buf == NULL && size == 0)
@@ -92,10 +92,10 @@ __getcwd (char *buf, size_t size)
return buf;
}
- /* The system call cannot handle paths longer than a page.
- Neither can the magic symlink in /proc/self. Just use the
+ /* The system call either cannot handle paths longer than a page
+ or can succeed without returning an absolute path. Just use the
generic implementation right away. */
- if (errno == ENAMETOOLONG)
+ if (retval >= 0 || errno == ENAMETOOLONG)
{
#ifndef NO_ALLOCATION
if (buf == NULL && size == 0)
@@ -130,6 +130,6 @@ __getcwd (char *buf, size_t size)
weak_alias (__getcwd, getcwd)
/* Get the code for the generic version. */
-#define GETCWD_RETURN_TYPE static char * internal_function
+#define GETCWD_RETURN_TYPE static char *
#define __getcwd generic_getcwd
#include <sysdeps/posix/getcwd.c>
diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c
index 1f2404e142..6d09a5be70 100644
--- a/sysdeps/unix/sysv/linux/getdents.c
+++ b/sysdeps/unix/sysv/linux/getdents.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Get directory entries. Linux non-LFS version.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -12,290 +13,103 @@
Lesser General Public License 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
+ License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <alloca.h>
-#include <assert.h>
-#include <errno.h>
#include <dirent.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sysdep.h>
-#include <sys/syscall.h>
+#if !_DIRENT_MATCHES_DIRENT64
-#include <linux/posix_types.h>
+# include <unistd.h>
+# include <string.h>
+# include <errno.h>
-#include <kernel-features.h>
-
-#ifdef __NR_getdents64
-# ifndef __ASSUME_GETDENTS64_SYSCALL
-# ifndef __GETDENTS
-/* The variable is shared between all *getdents* calls. */
-int __have_no_getdents64 attribute_hidden;
-# else
-extern int __have_no_getdents64 attribute_hidden;
-# endif
-# define have_no_getdents64_defined 1
+# ifndef DIRENT_SET_DP_INO
+# define DIRENT_SET_DP_INO(dp, value) (dp)->d_ino = (value)
# endif
-#endif
-#ifndef have_no_getdents64_defined
-# define __have_no_getdents64 0
-#endif
-
-/* For Linux we need a special version of this file since the
- definition of `struct dirent' is not the same for the kernel and
- the libc. There is one additional field which might be introduced
- in the kernel structure in the future.
-
- Here is the kernel definition of `struct dirent' as of 2.1.20: */
-struct kernel_dirent
- {
- long int d_ino;
- __kernel_off_t d_off;
- unsigned short int d_reclen;
- char d_name[256];
- };
-
-struct kernel_dirent64
- {
- uint64_t d_ino;
- int64_t d_off;
- unsigned short int d_reclen;
- unsigned char d_type;
- char d_name[256];
- };
-
-#ifndef __GETDENTS
-# define __GETDENTS __getdents
-#endif
-#ifndef DIRENT_TYPE
-# define DIRENT_TYPE struct dirent
-#endif
-#ifndef DIRENT_SET_DP_INO
-# define DIRENT_SET_DP_INO(dp, value) (dp)->d_ino = (value)
-#endif
-
-/* The problem here is that we cannot simply read the next NBYTES
- bytes. We need to take the additional field into account. We use
- some heuristic. Assuming the directory contains names with 14
- characters on average we can compute an estimated number of entries
- which fit in the buffer. Taking this number allows us to specify a
- reasonable number of bytes to read. If we should be wrong, we can
- reset the file descriptor. In practice the kernel is limiting the
- amount of data returned much more then the reduced buffer size. */
+/* Pack the dirent64 struct down into 32-bit offset/inode fields, and
+ ensure that no overflow occurs. */
ssize_t
-internal_function
-__GETDENTS (int fd, char *buf, size_t nbytes)
+__getdents (int fd, char *buf, size_t nbytes)
{
+ union
+ {
+ /* For !_DIRENT_MATCHES_DIRENT64 kernel 'linux_dirent64' has the same
+ layout of 'struct dirent64'. */
+ struct dirent64 k;
+ struct dirent u;
+ char b[1];
+ } *kbuf = (void *) buf, *outp, *inp;
+ size_t kbytes = nbytes;
+ off64_t last_offset = -1;
ssize_t retval;
- /* The d_ino and d_off fields in kernel_dirent and dirent must have
- the same sizes and alignments. */
- if (sizeof (DIRENT_TYPE) == sizeof (struct dirent)
- && (sizeof (((struct kernel_dirent *) 0)->d_ino)
- == sizeof (((struct dirent *) 0)->d_ino))
- && (sizeof (((struct kernel_dirent *) 0)->d_off)
- == sizeof (((struct dirent *) 0)->d_off))
- && (offsetof (struct kernel_dirent, d_off)
- == offsetof (struct dirent, d_off))
- && (offsetof (struct kernel_dirent, d_reclen)
- == offsetof (struct dirent, d_reclen)))
- {
- retval = INLINE_SYSCALL (getdents, 3, fd, buf, nbytes);
+# define size_diff (offsetof (struct dirent64, d_name) \
+ - offsetof (struct dirent, d_name))
+ char kbuftmp[sizeof (struct dirent) + size_diff];
+ if (nbytes <= sizeof (struct dirent))
+ kbuf = (void*) kbuftmp;
- /* The kernel added the d_type value after the name. Change
- this now. */
- if (retval != -1)
- {
- union
- {
- struct kernel_dirent k;
- struct dirent u;
- } *kbuf = (void *) buf;
+ retval = INLINE_SYSCALL_CALL (getdents64, fd, kbuf, kbytes);
+ if (retval == -1)
+ return -1;
- while ((char *) kbuf < buf + retval)
- {
- char d_type = *((char *) kbuf + kbuf->k.d_reclen - 1);
- memmove (kbuf->u.d_name, kbuf->k.d_name,
- strlen (kbuf->k.d_name) + 1);
- kbuf->u.d_type = d_type;
+ /* These two pointers might alias the same memory buffer.
+ Standard C requires that we always use the same type for them,
+ so we must use the union type. */
+ inp = kbuf;
+ outp = (void *) buf;
- kbuf = (void *) ((char *) kbuf + kbuf->k.d_reclen);
- }
- }
-
- return retval;
- }
-
- off64_t last_offset = -1;
-
-#ifdef __NR_getdents64
- if (!__have_no_getdents64)
+ while (&inp->b < &kbuf->b + retval)
{
-# ifndef __ASSUME_GETDENTS64_SYSCALL
- int saved_errno = errno;
-# endif
- union
- {
- struct kernel_dirent64 k;
- DIRENT_TYPE u;
- char b[1];
- } *kbuf = (void *) buf, *outp, *inp;
- size_t kbytes = nbytes;
- if (offsetof (DIRENT_TYPE, d_name)
- < offsetof (struct kernel_dirent64, d_name)
- && nbytes <= sizeof (DIRENT_TYPE))
- {
- kbytes = nbytes + offsetof (struct kernel_dirent64, d_name)
- - offsetof (DIRENT_TYPE, d_name);
- kbuf = __alloca(kbytes);
- }
- retval = INLINE_SYSCALL (getdents64, 3, fd, kbuf, kbytes);
-# ifndef __ASSUME_GETDENTS64_SYSCALL
- if (retval != -1 || (errno != EINVAL && errno != ENOSYS))
-# endif
- {
- const size_t size_diff = (offsetof (struct kernel_dirent64, d_name)
- - offsetof (DIRENT_TYPE, d_name));
-
- /* Return the error if encountered. */
- if (retval == -1)
- return -1;
-
- /* If the structure returned by the kernel is identical to what we
- need, don't do any conversions. */
- if (offsetof (DIRENT_TYPE, d_name)
- == offsetof (struct kernel_dirent64, d_name)
- && sizeof (outp->u.d_ino) == sizeof (inp->k.d_ino)
- && sizeof (outp->u.d_off) == sizeof (inp->k.d_off))
- return retval;
-
- /* These two pointers might alias the same memory buffer.
- Standard C requires that we always use the same type for them,
- so we must use the union type. */
- inp = kbuf;
- outp = (void *) buf;
-
- while (&inp->b < &kbuf->b + retval)
- {
- const size_t alignment = __alignof__ (DIRENT_TYPE);
- /* Since inp->k.d_reclen is already aligned for the kernel
- structure this may compute a value that is bigger
- than necessary. */
- size_t old_reclen = inp->k.d_reclen;
- size_t new_reclen = ((old_reclen - size_diff + alignment - 1)
- & ~(alignment - 1));
-
- /* Copy the data out of the old structure into temporary space.
- Then copy the name, which may overlap if BUF == KBUF. */
- const uint64_t d_ino = inp->k.d_ino;
- const int64_t d_off = inp->k.d_off;
- const uint8_t d_type = inp->k.d_type;
-
- memmove (outp->u.d_name, inp->k.d_name,
- old_reclen - offsetof (struct kernel_dirent64, d_name));
-
- /* Now we have copied the data from INP and access only OUTP. */
-
- DIRENT_SET_DP_INO (&outp->u, d_ino);
- outp->u.d_off = d_off;
- if ((sizeof (outp->u.d_ino) != sizeof (inp->k.d_ino)
- && outp->u.d_ino != d_ino)
- || (sizeof (outp->u.d_off) != sizeof (inp->k.d_off)
- && outp->u.d_off != d_off))
- {
- /* Overflow. If there was at least one entry
- before this one, return them without error,
- otherwise signal overflow. */
- if (last_offset != -1)
- {
- __lseek64 (fd, last_offset, SEEK_SET);
- return outp->b - buf;
- }
- __set_errno (EOVERFLOW);
- return -1;
- }
-
- last_offset = d_off;
- outp->u.d_reclen = new_reclen;
- outp->u.d_type = d_type;
-
- inp = (void *) inp + old_reclen;
- outp = (void *) outp + new_reclen;
- }
-
- return outp->b - buf;
- }
-
-# ifndef __ASSUME_GETDENTS64_SYSCALL
- __set_errno (saved_errno);
- __have_no_getdents64 = 1;
-# endif
+ const size_t alignment = _Alignof (struct dirent);
+ /* Since inp->k.d_reclen is already aligned for the kernel
+ structure this may compute a value that is bigger
+ than necessary. */
+ size_t old_reclen = inp->k.d_reclen;
+ size_t new_reclen = ((old_reclen - size_diff + alignment - 1)
+ & ~(alignment - 1));
+
+ /* Copy the data out of the old structure into temporary space.
+ Then copy the name, which may overlap if BUF == KBUF. */
+ const uint64_t d_ino = inp->k.d_ino;
+ const int64_t d_off = inp->k.d_off;
+ const uint8_t d_type = inp->k.d_type;
+
+ memmove (outp->u.d_name, inp->k.d_name,
+ old_reclen - offsetof (struct dirent64, d_name));
+
+ /* Now we have copied the data from INP and access only OUTP. */
+
+ DIRENT_SET_DP_INO (&outp->u, d_ino);
+ outp->u.d_off = d_off;
+ if ((sizeof (outp->u.d_ino) != sizeof (inp->k.d_ino)
+ && outp->u.d_ino != d_ino)
+ || (sizeof (outp->u.d_off) != sizeof (inp->k.d_off)
+ && outp->u.d_off != d_off))
+ {
+ /* Overflow. If there was at least one entry before this one,
+ return them without error, otherwise signal overflow. */
+ if (last_offset != -1)
+ {
+ __lseek64 (fd, last_offset, SEEK_SET);
+ return outp->b - buf;
+ }
+ return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW);
+ }
+
+ last_offset = d_off;
+ outp->u.d_reclen = new_reclen;
+ outp->u.d_type = d_type;
+
+ inp = (void *) inp + old_reclen;
+ outp = (void *) outp + new_reclen;
}
-#endif
- {
- size_t red_nbytes;
- struct kernel_dirent *skdp, *kdp;
- const size_t size_diff = (offsetof (DIRENT_TYPE, d_name)
- - offsetof (struct kernel_dirent, d_name));
-
- red_nbytes = MIN (nbytes
- - ((nbytes / (offsetof (DIRENT_TYPE, d_name) + 14))
- * size_diff),
- nbytes - size_diff);
-
- skdp = kdp = __alloca (red_nbytes);
-
- retval = INLINE_SYSCALL (getdents, 3, fd, (char *) kdp, red_nbytes);
-
- if (retval == -1)
- return -1;
- DIRENT_TYPE *dp = (DIRENT_TYPE *) buf;
- while ((char *) kdp < (char *) skdp + retval)
- {
- const size_t alignment = __alignof__ (DIRENT_TYPE);
- /* Since kdp->d_reclen is already aligned for the kernel structure
- this may compute a value that is bigger than necessary. */
- size_t new_reclen = ((kdp->d_reclen + size_diff + alignment - 1)
- & ~(alignment - 1));
- if ((char *) dp + new_reclen > buf + nbytes)
- {
- /* Our heuristic failed. We read too many entries. Reset
- the stream. */
- assert (last_offset != -1);
- __lseek64 (fd, last_offset, SEEK_SET);
-
- if ((char *) dp == buf)
- {
- /* The buffer the user passed in is too small to hold even
- one entry. */
- __set_errno (EINVAL);
- return -1;
- }
-
- break;
- }
-
- last_offset = kdp->d_off;
- DIRENT_SET_DP_INO(dp, kdp->d_ino);
- dp->d_off = kdp->d_off;
- dp->d_reclen = new_reclen;
- dp->d_type = *((char *) kdp + kdp->d_reclen - 1);
- memcpy (dp->d_name, kdp->d_name,
- kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
+ return outp->b - buf;
+}
- dp = (DIRENT_TYPE *) ((char *) dp + new_reclen);
- kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen);
- }
+# undef DIRENT_SET_DP_INO
- return (char *) dp - buf;
- }
-}
+#endif /* _DIRENT_MATCHES_DIRENT64 */
diff --git a/sysdeps/unix/sysv/linux/getdents64.c b/sysdeps/unix/sysv/linux/getdents64.c
index 805917e274..3bde0cf4f0 100644
--- a/sysdeps/unix/sysv/linux/getdents64.c
+++ b/sysdeps/unix/sysv/linux/getdents64.c
@@ -1,3 +1,76 @@
-#define __GETDENTS __getdents64
-#define DIRENT_TYPE struct dirent64
-#include <sysdeps/unix/sysv/linux/getdents.c>
+/* Get directory entries. Linux LFS version.
+ Copyright (C) 1997-2018 Free Software 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 <string.h>
+#include <dirent.h>
+#include <errno.h>
+
+/* The kernel struct linux_dirent64 matches the 'struct getdents64' type. */
+ssize_t
+__getdents64 (int fd, char *buf, size_t nbytes)
+{
+ return INLINE_SYSCALL_CALL (getdents64, fd, buf, nbytes);
+}
+
+#if _DIRENT_MATCHES_DIRENT64
+strong_alias (__getdents64, __getdents)
+#else
+# include <shlib-compat.h>
+
+# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+# include <olddirent.h>
+
+/* kernel definition of as of 3.2. */
+struct compat_linux_dirent
+{
+ /* Both d_ino and d_off are compat_ulong_t which are defined in all
+ architectures as 'u32'. */
+ uint32_t d_ino;
+ uint32_t d_off;
+ unsigned short d_reclen;
+ char d_name[1];
+};
+
+ssize_t
+__old_getdents64 (int fd, char *buf, size_t nbytes)
+{
+ ssize_t retval = INLINE_SYSCALL_CALL (getdents, fd, buf, nbytes);
+
+ /* The kernel added the d_type value after the name. Change this now. */
+ if (retval != -1)
+ {
+ union
+ {
+ struct compat_linux_dirent k;
+ struct dirent u;
+ } *kbuf = (void *) buf;
+
+ while ((char *) kbuf < buf + retval)
+ {
+ char d_type = *((char *) kbuf + kbuf->k.d_reclen - 1);
+ memmove (kbuf->u.d_name, kbuf->k.d_name,
+ strlen (kbuf->k.d_name) + 1);
+ kbuf->u.d_type = d_type;
+
+ kbuf = (void *) ((char *) kbuf + kbuf->k.d_reclen);
+ }
+ }
+ return retval;
+}
+# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */
+#endif /* _DIRENT_MATCHES_DIRENT64 */
diff --git a/sysdeps/unix/sysv/linux/getdirentries.c b/sysdeps/unix/sysv/linux/getdirentries.c
index f31bcd74ae..23f626b474 100644
--- a/sysdeps/unix/sysv/linux/getdirentries.c
+++ b/sysdeps/unix/sysv/linux/getdirentries.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software 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,26 +16,21 @@
<http://www.gnu.org/licenses/>. */
#include <dirent.h>
-#include <unistd.h>
-
-#ifndef GETDIRENTRIES
-# define GETDIRENTRIES getdirentries
-# define __GETDENTS __getdents
-#else
-# define off_t off64_t
-# define __lseek __lseek64
-#endif
+
+#if !_DIRENT_MATCHES_DIRENT64
+# include <unistd.h>
ssize_t
-GETDIRENTRIES (int fd, char *buf, size_t nbytes, off_t *basep)
+getdirentries (int fd, char *buf, size_t nbytes, off_t *basep)
{
- off_t base = __lseek (fd, (off_t) 0, SEEK_CUR);
- ssize_t result;
+ off_t base = __lseek (fd, 0, SEEK_CUR);
- result = __GETDENTS (fd, buf, nbytes);
+ ssize_t result = __getdents (fd, buf, nbytes);
if (result != -1)
*basep = base;
return result;
}
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/getdirentries64.c b/sysdeps/unix/sysv/linux/getdirentries64.c
index e486a36a12..532f2fc177 100644
--- a/sysdeps/unix/sysv/linux/getdirentries64.c
+++ b/sysdeps/unix/sysv/linux/getdirentries64.c
@@ -1,3 +1,39 @@
-#define GETDIRENTRIES getdirentries64
-#define __GETDENTS __getdents64
-#include "getdirentries.c"
+/* Get directory entries in a filesystem-independent format. LFS version.
+ Copyright (C) 1993-2018 Free Software 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 getdirentries __no_getdirentries_decl
+#include <dirent.h>
+#undef getdirentries
+#include <unistd.h>
+
+ssize_t
+getdirentries64 (int fd, char *buf, size_t nbytes, off64_t *basep)
+{
+ off64_t base = __lseek64 (fd, (off_t) 0, SEEK_CUR);
+
+ ssize_t result = __getdents64 (fd, buf, nbytes);
+
+ if (result != -1)
+ *basep = base;
+
+ return result;
+}
+
+#if _DIRENT_MATCHES_DIRENT64
+weak_alias (getdirentries64, getdirentries)
+#endif
diff --git a/sysdeps/unix/sysv/linux/getdtsz.c b/sysdeps/unix/sysv/linux/getdtsz.c
index 01cde8301a..0f47c4026f 100644
--- a/sysdeps/unix/sysv/linux/getdtsz.c
+++ b/sysdeps/unix/sysv/linux/getdtsz.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/getentropy.c b/sysdeps/unix/sysv/linux/getentropy.c
new file mode 100644
index 0000000000..561f8f4c7c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/getentropy.c
@@ -0,0 +1,73 @@
+/* Implementation of getentropy based on the getrandom system call.
+ Copyright (C) 2016-2018 Free Software 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/random.h>
+#include <assert.h>
+#include <errno.h>
+#include <unistd.h>
+
+#ifdef __NR_getrandom
+/* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on
+ success and -1 on failure. */
+int
+getentropy (void *buffer, size_t length)
+{
+ /* The interface is documented to return EIO for buffer lengths
+ longer than 256 bytes. */
+ if (length > 256)
+ {
+ __set_errno (EIO);
+ return -1;
+ }
+
+ /* Try to fill the buffer completely. Even with the 256 byte limit
+ above, we might still receive an EINTR error (when blocking
+ during boot). */
+ void *end = buffer + length;
+ while (buffer < end)
+ {
+ /* NB: No cancellation point. */
+ ssize_t bytes = INLINE_SYSCALL_CALL (getrandom, buffer, end - buffer, 0);
+ if (bytes < 0)
+ {
+ if (errno == EINTR)
+ /* Try again if interrupted by a signal. */
+ continue;
+ else
+ return -1;
+ }
+ if (bytes == 0)
+ {
+ /* No more bytes available. This should not happen under
+ normal circumstances. */
+ __set_errno (EIO);
+ return -1;
+ }
+ /* Try again in case of a short read. */
+ buffer += bytes;
+ }
+ return 0;
+}
+#else
+int
+getentropy (void *buffer, size_t length)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+#endif
diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c
index 73e5c76091..2e20f034dc 100644
--- a/sysdeps/unix/sysv/linux/gethostid.c
+++ b/sysdeps/unix/sysv/linux/gethostid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <unistd.h>
#include <netdb.h>
#include <not-cancel.h>
+#include <stdbool.h>
#define HOSTIDFILE "/etc/hostid"
@@ -47,13 +48,13 @@ sethostid (long int id)
}
/* Open file for writing. Everybody is allowed to read this file. */
- fd = open_not_cancel (HOSTIDFILE, O_CREAT|O_WRONLY|O_TRUNC, 0644);
+ fd = __open_nocancel (HOSTIDFILE, O_CREAT|O_WRONLY|O_TRUNC, 0644);
if (fd < 0)
return -1;
- written = write_not_cancel (fd, &id32, sizeof (id32));
+ written = __write_nocancel (fd, &id32, sizeof (id32));
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
return written != sizeof (id32) ? -1 : 0;
}
@@ -63,13 +64,12 @@ sethostid (long int id)
# include <sys/param.h>
# include <resolv/netdb.h>
# include <netinet/in.h>
+# include <scratch_buffer.h>
long int
gethostid (void)
{
char hostname[MAXHOSTNAMELEN + 1];
- size_t buflen;
- char *buffer;
struct hostent hostbuf, *hp;
int32_t id;
struct in_addr in;
@@ -77,40 +77,54 @@ gethostid (void)
int fd;
/* First try to get the ID from a former invocation of sethostid. */
- fd = open_not_cancel (HOSTIDFILE, O_RDONLY|O_LARGEFILE, 0);
+ fd = __open_nocancel (HOSTIDFILE, O_RDONLY|O_LARGEFILE, 0);
if (fd >= 0)
{
- ssize_t n = read_not_cancel (fd, &id, sizeof (id));
+ ssize_t n = __read_nocancel (fd, &id, sizeof (id));
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
if (n == sizeof (id))
return id;
}
- /* Getting from the file was not successful. An intelligent guess for
- a unique number of a host is its IP address. Return this. */
+ /* Getting from the file was not successful. An intelligent guess
+ for a unique number of a host is its IP address. To get the IP
+ address we need to know the host name. */
if (__gethostname (hostname, MAXHOSTNAMELEN) < 0 || hostname[0] == '\0')
/* This also fails. Return and arbitrary value. */
return 0;
- buflen = 1024;
- buffer = __alloca (buflen);
-
- /* To get the IP address we need to know the host name. */
- while (__gethostbyname_r (hostname, &hostbuf, buffer, buflen, &hp, &herr)
- != 0
- || hp == NULL)
- if (herr != NETDB_INTERNAL || errno != ERANGE)
- return 0;
- else
- /* Enlarge buffer. */
- buffer = extend_alloca (buffer, buflen, 2 * buflen);
+ /* Determine the IP address of the host name. */
+ struct scratch_buffer tmpbuf;
+ scratch_buffer_init (&tmpbuf);
+ while (true)
+ {
+ int ret = __gethostbyname_r (hostname, &hostbuf,
+ tmpbuf.data, tmpbuf.length, &hp, &herr);
+ if (ret == 0)
+ break;
+ else
+ {
+ /* Enlarge the buffer on ERANGE. */
+ if (herr == NETDB_INTERNAL && errno == ERANGE)
+ {
+ if (!scratch_buffer_grow (&tmpbuf))
+ return 0;
+ }
+ /* Other errors are a failure. Return an arbitrary value. */
+ else
+ {
+ scratch_buffer_free (&tmpbuf);
+ return 0;
+ }
+ }
+ }
in.s_addr = 0;
memcpy (&in, hp->h_addr,
(int) sizeof (in) < hp->h_length ? (int) sizeof (in) : hp->h_length);
-
+ scratch_buffer_free (&tmpbuf);
/* For the return value to be not exactly the IP address we do some
bit fiddling. */
return (int32_t) (in.s_addr << 16 | in.s_addr >> 16);
diff --git a/sysdeps/unix/sysv/linux/getipv4sourcefilter.c b/sysdeps/unix/sysv/linux/getipv4sourcefilter.c
index a625f22fdb..c0052c5c04 100644
--- a/sysdeps/unix/sysv/linux/getipv4sourcefilter.c
+++ b/sysdeps/unix/sysv/linux/getipv4sourcefilter.c
@@ -1,5 +1,5 @@
/* Get IPv4 source filter. Linux version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
diff --git a/sysdeps/unix/sysv/linux/getloadavg.c b/sysdeps/unix/sysv/linux/getloadavg.c
index bd3d65c7b6..fbe46e5c29 100644
--- a/sysdeps/unix/sysv/linux/getloadavg.c
+++ b/sysdeps/unix/sysv/linux/getloadavg.c
@@ -1,5 +1,5 @@
/* Get system load averages. Linux (/proc/loadavg) version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@ getloadavg (double loadavg[], int nelem)
{
int fd;
- fd = open_not_cancel_2 ("/proc/loadavg", O_RDONLY);
+ fd = __open_nocancel ("/proc/loadavg", O_RDONLY);
if (fd < 0)
return -1;
else
@@ -42,8 +42,8 @@ getloadavg (double loadavg[], int nelem)
ssize_t nread;
int i;
- nread = read_not_cancel (fd, buf, sizeof buf - 1);
- close_not_cancel_no_status (fd);
+ nread = __read_nocancel (fd, buf, sizeof buf - 1);
+ __close_nocancel_nostatus (fd);
if (nread <= 0)
return -1;
buf[nread - 1] = '\0';
diff --git a/sysdeps/unix/sysv/linux/getlogin.c b/sysdeps/unix/sysv/linux/getlogin.c
index 1ac0049d40..e5e67fd253 100644
--- a/sysdeps/unix/sysv/linux/getlogin.c
+++ b/sysdeps/unix/sysv/linux/getlogin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/getlogin_r.c b/sysdeps/unix/sysv/linux/getlogin_r.c
index 408907f162..14587712a7 100644
--- a/sysdeps/unix/sysv/linux/getlogin_r.c
+++ b/sysdeps/unix/sysv/linux/getlogin_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <pwd.h>
#include <unistd.h>
#include <not-cancel.h>
+#include <scratch_buffer.h>
#define STATIC static
static int getlogin_r_fd0 (char *name, size_t namesize);
@@ -34,16 +35,16 @@ int
attribute_hidden
__getlogin_r_loginuid (char *name, size_t namesize)
{
- int fd = open_not_cancel_2 ("/proc/self/loginuid", O_RDONLY);
+ int fd = __open_nocancel ("/proc/self/loginuid", O_RDONLY);
if (fd == -1)
return -1;
/* We are reading a 32-bit number. 12 bytes are enough for the text
representation. If not, something is wrong. */
char uidbuf[12];
- ssize_t n = TEMP_FAILURE_RETRY (read_not_cancel (fd, uidbuf,
+ ssize_t n = TEMP_FAILURE_RETRY (__read_nocancel (fd, uidbuf,
sizeof (uidbuf)));
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
uid_t uid;
char *endp;
@@ -54,29 +55,31 @@ __getlogin_r_loginuid (char *name, size_t namesize)
endp == uidbuf || *endp != '\0'))
return -1;
- size_t buflen = 1024;
- char *buf = alloca (buflen);
- bool use_malloc = false;
+ /* If there is no login uid, linux sets /proc/self/loginid to the sentinel
+ value of, (uid_t) -1, so check if that value is set and return early to
+ avoid making unneeded nss lookups. */
+ if (uid == (uid_t) -1)
+ {
+ __set_errno (ENXIO);
+ return ENXIO;
+ }
+
struct passwd pwd;
struct passwd *tpwd;
int result = 0;
int res;
+ struct scratch_buffer tmpbuf;
+ scratch_buffer_init (&tmpbuf);
- while ((res = __getpwuid_r (uid, &pwd, buf, buflen, &tpwd)) == ERANGE)
- if (__libc_use_alloca (2 * buflen))
- buf = extend_alloca (buf, buflen, 2 * buflen);
- else
- {
- buflen *= 2;
- char *newp = realloc (use_malloc ? buf : NULL, buflen);
- if (newp == NULL)
- {
- result = ENOMEM;
- goto out;
- }
- buf = newp;
- use_malloc = true;
- }
+ while ((res = __getpwuid_r (uid, &pwd,
+ tmpbuf.data, tmpbuf.length, &tpwd)) == ERANGE)
+ {
+ if (!scratch_buffer_grow (&tmpbuf))
+ {
+ result = ENOMEM;
+ goto out;
+ }
+ }
if (res != 0 || tpwd == NULL)
{
@@ -95,9 +98,7 @@ __getlogin_r_loginuid (char *name, size_t namesize)
memcpy (name, pwd.pw_name, needed);
out:
- if (use_malloc)
- free (buf);
-
+ scratch_buffer_free (&tmpbuf);
return result;
}
diff --git a/sysdeps/unix/sysv/linux/getpagesize.c b/sysdeps/unix/sysv/linux/getpagesize.c
index 9d1058c5e5..56f21601f6 100644
--- a/sysdeps/unix/sysv/linux/getpagesize.c
+++ b/sysdeps/unix/sysv/linux/getpagesize.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/getpeername.c b/sysdeps/unix/sysv/linux/getpeername.c
index 51179a2db5..aee5054d74 100644
--- a/sysdeps/unix/sysv/linux/getpeername.c
+++ b/sysdeps/unix/sysv/linux/getpeername.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/getpid.c b/sysdeps/unix/sysv/linux/getpid.c
deleted file mode 100644
index 1124549326..0000000000
--- a/sysdeps/unix/sysv/linux/getpid.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* 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.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <tls.h>
-#include <sysdep.h>
-
-
-#if IS_IN (libc)
-static inline __attribute__((always_inline)) pid_t really_getpid (pid_t oldval);
-
-static inline __attribute__((always_inline)) pid_t
-really_getpid (pid_t oldval)
-{
- if (__glibc_likely (oldval == 0))
- {
- pid_t selftid = THREAD_GETMEM (THREAD_SELF, tid);
- if (__glibc_likely (selftid != 0))
- return selftid;
- }
-
- INTERNAL_SYSCALL_DECL (err);
- pid_t result = INTERNAL_SYSCALL (getpid, err, 0);
-
- /* We do not set the PID field in the TID here since we might be
- called from a signal handler while the thread executes fork. */
- if (oldval == 0)
- THREAD_SETMEM (THREAD_SELF, tid, result);
- return result;
-}
-#endif
-
-pid_t
-__getpid (void)
-{
-#if !IS_IN (libc)
- INTERNAL_SYSCALL_DECL (err);
- pid_t result = INTERNAL_SYSCALL (getpid, err, 0);
-#else
- pid_t result = THREAD_GETMEM (THREAD_SELF, pid);
- if (__glibc_unlikely (result <= 0))
- result = really_getpid (result);
-#endif
- return result;
-}
-
-libc_hidden_def (__getpid)
-weak_alias (__getpid, getpid)
-libc_hidden_def (getpid)
diff --git a/sysdeps/unix/sysv/linux/getpriority.c b/sysdeps/unix/sysv/linux/getpriority.c
index 180722b0b1..10652d2ad0 100644
--- a/sysdeps/unix/sysv/linux/getpriority.c
+++ b/sysdeps/unix/sysv/linux/getpriority.c
@@ -1,5 +1,5 @@
/* getpriority for Linux.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/getpt.c b/sysdeps/unix/sysv/linux/getpt.c
index c2ffbe7706..77aa468d83 100644
--- a/sysdeps/unix/sysv/linux/getpt.c
+++ b/sysdeps/unix/sysv/linux/getpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
@@ -31,7 +31,7 @@
#define _PATH_DEVPTS _PATH_DEV "pts"
/* Prototype for function that opens BSD-style master pseudo-terminals. */
-int __bsd_getpt (void);
+extern int __bsd_getpt (void) attribute_hidden;
/* Open a master pseudo terminal and return its file descriptor. */
int
diff --git a/sysdeps/unix/sysv/linux/getrandom.c b/sysdeps/unix/sysv/linux/getrandom.c
new file mode 100644
index 0000000000..435b037399
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/getrandom.c
@@ -0,0 +1,43 @@
+/* Implementation of the getrandom system call.
+ Copyright (C) 2016-2018 Free Software 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/random.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sysdep-cancel.h>
+
+#ifdef __NR_getrandom
+/* Write up to LENGTH bytes of randomness starting at BUFFER.
+ Return the number of bytes written, or -1 on error. */
+ssize_t
+getrandom (void *buffer, size_t length, unsigned int flags)
+{
+ return SYSCALL_CANCEL (getrandom, buffer, length, flags);
+}
+#else
+/* Always provide a definition, even if the kernel headers lack the
+ system call number. */
+ssize_t
+getrandom (void *buffer, size_t length, unsigned int flags)
+{
+ /* Ideally, we would add a cancellation point here, but we currently
+ cannot do so inside libc. */
+ __set_errno (ENOSYS);
+ return -1;
+}
+#endif
diff --git a/sysdeps/unix/sysv/linux/getrlimit.c b/sysdeps/unix/sysv/linux/getrlimit.c
new file mode 100644
index 0000000000..c48790bf63
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/getrlimit.c
@@ -0,0 +1,56 @@
+/* Linux getrlimit implementation (32 bits rlim_t).
+ Copyright (C) 2016-2018 Free Software 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/resource.h>
+#include <sys/types.h>
+#include <shlib-compat.h>
+
+#if !__RLIM_T_MATCHES_RLIM64_T
+
+/* The __NR_getrlimit compatibility implementation is required iff
+ __NR_ugetrlimit is also defined (meaning an old broken RLIM_INFINITY
+ definition). */
+# ifndef __NR_ugetrlimit
+# define __NR_ugetrlimit __NR_getrlimit
+# undef SHLIB_COMPAT
+# define SHLIB_COMPAT(a, b, c) 0
+# endif
+
+int
+__new_getrlimit (enum __rlimit_resource resource, struct rlimit *rlim)
+{
+ return INLINE_SYSCALL_CALL (ugetrlimit, resource, rlim);
+}
+weak_alias (__new_getrlimit, __getrlimit)
+hidden_weak (__getrlimit)
+
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
+/* Back compatible 2Gig limited rlimit. */
+int
+__old_getrlimit (enum __rlimit_resource resource, struct rlimit *rlim)
+{
+ return INLINE_SYSCALL_CALL (getrlimit, resource, rlim);
+}
+compat_symbol (libc, __old_getrlimit, getrlimit, GLIBC_2_0);
+versioned_symbol (libc, __new_getrlimit, getrlimit, GLIBC_2_2);
+# else
+weak_alias (__new_getrlimit, getrlimit)
+# endif
+
+#endif /* __RLIM_T_MATCHES_RLIM64_T */
diff --git a/sysdeps/unix/sysv/linux/getrlimit64.c b/sysdeps/unix/sysv/linux/getrlimit64.c
index d055a7f839..a14ca58096 100644
--- a/sysdeps/unix/sysv/linux/getrlimit64.c
+++ b/sysdeps/unix/sysv/linux/getrlimit64.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Linux getrlimit64 implementation (64 bits rlim_t).
+ Copyright (C) 2010-2018 Free Software 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,43 +17,71 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
-#include <sys/resource.h>
#include <sys/types.h>
-#include <sysdep.h>
-#include <kernel-features.h>
+#include <shlib-compat.h>
+
+/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T
+ linking getrlimit64 to {__}getrlimit does not throw a type error. */
+#undef getrlimit
+#undef __getrlimit
+#define getrlimit getrlimit_redirect
+#define __getrlimit __getrlimit_redirect
+#include <sys/resource.h>
+#undef getrlimit
+#undef __getrlimit
/* Put the soft and hard limits for RESOURCE in *RLIMITS.
Returns 0 if successful, -1 if not (and sets errno). */
int
__getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
{
-#ifdef __ASSUME_PRLIMIT64
- return INLINE_SYSCALL (prlimit64, 4, 0, resource, NULL, rlimits);
-#else
-# ifdef __NR_prlimit64
- int res = INLINE_SYSCALL (prlimit64, 4, 0, resource, NULL, rlimits);
- if (res == 0 || errno != ENOSYS)
- return res;
+ return INLINE_SYSCALL_CALL (prlimit64, 0, resource, NULL, rlimits);
+}
+libc_hidden_def (__getrlimit64)
+
+#if __RLIM_T_MATCHES_RLIM64_T
+/* If both rlim_t and rlimt64_t are essentially the same type we can use
+ alias both interfaces. */
+strong_alias (__getrlimit64, __GI_getrlimit)
+strong_alias (__getrlimit64, __GI___getrlimit)
+strong_alias (__getrlimit64, __getrlimit)
+/* Alpha defines a versioned getrlimit{64}. */
+# ifndef USE_VERSIONED_RLIMIT
+weak_alias (__getrlimit64, getrlimit)
+weak_alias (__getrlimit64, getrlimit64)
+libc_hidden_weak (getrlimit64)
+# else
+weak_alias (__getrlimit64, __GI_getrlimit64)
# endif
+
+#elif SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+/* Back compatible 2GiB limited rlimit. */
+extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *)
+ attribute_hidden;
+
+int
+attribute_compat_text_section
+__old_getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
+{
struct rlimit rlimits32;
- if (__getrlimit (resource, &rlimits32) < 0)
+ if (__new_getrlimit (resource, &rlimits32) < 0)
return -1;
if (rlimits32.rlim_cur == RLIM_INFINITY)
- rlimits->rlim_cur = RLIM64_INFINITY;
+ rlimits->rlim_cur = RLIM64_INFINITY >> 1;
else
rlimits->rlim_cur = rlimits32.rlim_cur;
if (rlimits32.rlim_max == RLIM_INFINITY)
- rlimits->rlim_max = RLIM64_INFINITY;
+ rlimits->rlim_max = RLIM64_INFINITY >> 1;
else
rlimits->rlim_max = rlimits32.rlim_max;
return 0;
-#endif
}
-libc_hidden_def (__getrlimit64)
-#ifndef getrlimit64
+versioned_symbol (libc, __getrlimit64, getrlimit64, GLIBC_2_2);
+compat_symbol (libc, __old_getrlimit64, getrlimit64, GLIBC_2_1);
+#else
weak_alias (__getrlimit64, getrlimit64)
libc_hidden_weak (getrlimit64)
-#endif
+#endif /* __RLIM_T_MATCHES_RLIM64_T */
diff --git a/sysdeps/unix/sysv/linux/getsockname.c b/sysdeps/unix/sysv/linux/getsockname.c
index 0b55def606..1874aebbb4 100644
--- a/sysdeps/unix/sysv/linux/getsockname.c
+++ b/sysdeps/unix/sysv/linux/getsockname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c
index 079fee1281..4422f88594 100644
--- a/sysdeps/unix/sysv/linux/getsockopt.c
+++ b/sysdeps/unix/sysv/linux/getsockopt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/getsourcefilter.c b/sysdeps/unix/sysv/linux/getsourcefilter.c
index e9644146a7..d983b1272a 100644
--- a/sysdeps/unix/sysv/linux/getsourcefilter.c
+++ b/sysdeps/unix/sysv/linux/getsourcefilter.c
@@ -1,5 +1,5 @@
/* Get source filter. Linux version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -31,6 +31,7 @@
#include <netrose/rose.h>
#include <sys/param.h>
#include <sys/socket.h>
+#include "getsourcefilter.h"
static const struct
diff --git a/sysdeps/unix/sysv/linux/getsourcefilter.h b/sysdeps/unix/sysv/linux/getsourcefilter.h
new file mode 100644
index 0000000000..3a74343e4d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/getsourcefilter.h
@@ -0,0 +1,20 @@
+/* __get_sol function prototype.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* Defined in getsourcefilter.c. */
+extern int __get_sol (int af, socklen_t len) attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c
index 530ab08531..05533bcc3b 100644
--- a/sysdeps/unix/sysv/linux/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/getsysstats.c
@@ -1,5 +1,5 @@
/* Determine various system internal values, Linux version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -85,7 +85,7 @@ next_line (int fd, char *const buffer, char **cp, char **re,
*re = buffer + (*re - *cp);
*cp = buffer;
- ssize_t n = read_not_cancel (fd, *re, buffer_end - *re);
+ ssize_t n = __read_nocancel (fd, *re, buffer_end - *re);
if (n < 0)
return NULL;
@@ -96,7 +96,7 @@ next_line (int fd, char *const buffer, char **cp, char **re,
{
/* Truncate too long lines. */
*re = buffer + 3 * (buffer_end - buffer) / 4;
- n = read_not_cancel (fd, *re, buffer_end - *re);
+ n = __read_nocancel (fd, *re, buffer_end - *re);
if (n < 0)
return NULL;
@@ -143,7 +143,7 @@ __get_nprocs (void)
char *re = buffer_end;
const int flags = O_RDONLY | O_CLOEXEC;
- int fd = open_not_cancel_2 ("/sys/devices/system/cpu/online", flags);
+ int fd = __open_nocancel ("/sys/devices/system/cpu/online", flags);
char *l;
int result = 0;
if (fd != -1)
@@ -180,7 +180,7 @@ __get_nprocs (void)
}
while (l < re);
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
if (result > 0)
goto out;
@@ -188,10 +188,13 @@ __get_nprocs (void)
cp = buffer_end;
re = buffer_end;
- result = 1;
+
+ /* Default to an SMP system in case we cannot obtain an accurate
+ number. */
+ result = 2;
/* The /proc/stat format is more uniform, use it by default. */
- fd = open_not_cancel_2 ("/proc/stat", flags);
+ fd = __open_nocancel ("/proc/stat", flags);
if (fd != -1)
{
result = 0;
@@ -204,15 +207,15 @@ __get_nprocs (void)
else if (isdigit (l[3]))
++result;
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
}
else
{
- fd = open_not_cancel_2 ("/proc/cpuinfo", flags);
+ fd = __open_nocancel ("/proc/cpuinfo", flags);
if (fd != -1)
{
GET_NPROCS_PARSER (fd, buffer, cp, re, buffer_end, result);
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
}
}
@@ -223,6 +226,7 @@ __get_nprocs (void)
return result;
}
+libc_hidden_def (__get_nprocs)
weak_alias (__get_nprocs, get_nprocs)
@@ -276,6 +280,7 @@ __get_nprocs_conf (void)
return result;
}
+libc_hidden_def (__get_nprocs_conf)
weak_alias (__get_nprocs_conf, get_nprocs_conf)
@@ -317,6 +322,7 @@ __get_phys_pages (void)
__sysinfo (&info);
return sysinfo_mempages (info.totalram, info.mem_unit);
}
+libc_hidden_def (__get_phys_pages)
weak_alias (__get_phys_pages, get_phys_pages)
long int
@@ -327,4 +333,5 @@ __get_avphys_pages (void)
__sysinfo (&info);
return sysinfo_mempages (info.freeram, info.mem_unit);
}
+libc_hidden_def (__get_avphys_pages)
weak_alias (__get_avphys_pages, get_avphys_pages)
diff --git a/sysdeps/unix/sysv/linux/gettimeofday.c b/sysdeps/unix/sysv/linux/gettimeofday.c
index 0bea541318..cd971ddfcf 100644
--- a/sysdeps/unix/sysv/linux/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/gettimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/glob-lstat-compat.c b/sysdeps/unix/sysv/linux/glob-lstat-compat.c
new file mode 100644
index 0000000000..64dab9af52
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/glob-lstat-compat.c
@@ -0,0 +1,47 @@
+/* Compat glob which does not use gl_lstat for GLOB_ALTDIRFUNC.
+ Linux version which handles LFS when required.
+ Copyright (C) 2017-2018 Free Software 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/stat.h>
+#include <kernel_stat.h>
+#include <shlib-compat.h>
+
+#define glob64 __no_glob64_decl
+#include <glob.h>
+#undef glob64
+
+#define __glob __glob_lstat_compat
+
+#define GLOB_ATTRIBUTE attribute_compat_text_section
+
+/* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */
+#define GLOB_NO_LSTAT
+
+#include <posix/glob.c>
+
+#ifndef GLOB_LSTAT_VERSION
+# define GLOB_LSTAT_VERSION GLIBC_2_0
+#endif
+
+#if SHLIB_COMPAT(libc, GLOB_LSTAT_VERSION, GLIBC_2_27)
+compat_symbol (libc, __glob_lstat_compat, glob, GLOB_LSTAT_VERSION);
+# if XSTAT_IS_XSTAT64
+strong_alias (__glob_lstat_compat, __glob64_lstat_compat)
+compat_symbol (libc, __glob64_lstat_compat, glob64, GLOB_LSTAT_VERSION);
+# endif
+#endif
diff --git a/sysdeps/unix/sysv/linux/glob.c b/sysdeps/unix/sysv/linux/glob.c
new file mode 100644
index 0000000000..2fccbe1b1d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/glob.c
@@ -0,0 +1,31 @@
+/* Find pathnames matching a pattern. Linux version.
+ Copyright (C) 2017-2018 Free Software 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/stat.h>
+#include <kernel_stat.h>
+
+#define glob64 __no_glob64_decl
+#define __glob64 __no___glob64_decl
+#include <posix/glob.c>
+#undef glob64
+#undef __glob64
+
+#if XSTAT_IS_XSTAT64
+strong_alias (__glob, __glob64)
+versioned_symbol (libc, __glob64, glob64, GLIBC_2_27);
+#endif
diff --git a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c
new file mode 100644
index 0000000000..4475e0091c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c
@@ -0,0 +1,56 @@
+/* Compat glob which does not use gl_lstat for GLOB_ALTDIRFUNC.
+ Linux version which handles LFS when required.
+ Copyright (C) 2017-2018 Free Software 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/stat.h>
+#include <kernel_stat.h>
+
+#if !XSTAT_IS_XSTAT64
+# include <glob.h>
+# include <dirent.h>
+# include <sys/stat.h>
+# include <shlib-compat.h>
+
+# define dirent dirent64
+# define __readdir(dirp) __readdir64 (dirp)
+
+# define glob_t glob64_t
+# define __glob __glob64_lstat_compat
+# define globfree globfree64
+
+# undef stat
+# define stat stat64
+
+# define COMPILE_GLOB64 1
+
+# define GLOB_ATTRIBUTE attribute_compat_text_section
+
+/* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */
+# define GLOB_NO_LSTAT
+
+# include <posix/glob.c>
+
+# if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_27)
+# ifndef GLOB_NO_OLD_VERSION
+# define GLOB_LSTAT_START_VER GLIBC_2_2
+# else
+# define GLOB_LSTAT_START_VER GLIBC_2_1
+# endif
+compat_symbol (libc, __glob64_lstat_compat, glob64, GLOB_LSTAT_START_VER);
+# endif
+#endif /* XSTAT_IS_XSTAT64 */
diff --git a/sysdeps/unix/sysv/linux/glob64.c b/sysdeps/unix/sysv/linux/glob64.c
new file mode 100644
index 0000000000..48a0e5a225
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/glob64.c
@@ -0,0 +1,51 @@
+/* Find pathnames matching a pattern. Linux version.
+ Copyright (C) 2017-2018 Free Software 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/stat.h>
+#include <kernel_stat.h>
+
+#if !XSTAT_IS_XSTAT64
+# include <glob.h>
+# include <dirent.h>
+# include <sys/stat.h>
+
+# define dirent dirent64
+# define __readdir(dirp) __readdir64 (dirp)
+
+# define glob_t glob64_t
+# define __glob __glob64
+# define globfree(pglob) globfree64 (pglob)
+
+# undef stat
+# define stat stat64
+
+# define COMPILE_GLOB64 1
+
+# include <posix/glob.c>
+
+# include <shlib-compat.h>
+
+# ifdef GLOB_NO_OLD_VERSION
+strong_alias (__glob64, glob64)
+libc_hidden_def (glob64)
+# else
+libc_hidden_def (__glob64)
+versioned_symbol (libc, __glob64, glob64, GLIBC_2_27);
+libc_hidden_ver (__glob64, glob64)
+# endif
+#endif /* XSTAT_IS_XSTAT64 */
diff --git a/sysdeps/unix/sysv/linux/globfree.c b/sysdeps/unix/sysv/linux/globfree.c
new file mode 100644
index 0000000000..b7222c23bf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/globfree.c
@@ -0,0 +1,30 @@
+/* Frees the dynamically allocated storage from an earlier call to glob.
+ Linux version.
+ Copyright (C) 2017-2018 Free Software 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/stat.h>
+#include <kernel_stat.h>
+
+#define globfree64 __no_globfree64_decl
+#include <posix/globfree.c>
+#undef globfree64
+
+#if XSTAT_IS_XSTAT64
+weak_alias (globfree, globfree64)
+libc_hidden_ver (globfree, globfree64)
+#endif
diff --git a/sysdeps/unix/sysv/linux/globfree64.c b/sysdeps/unix/sysv/linux/globfree64.c
new file mode 100644
index 0000000000..1d7d32c3a9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/globfree64.c
@@ -0,0 +1,36 @@
+/* Frees the dynamically allocated storage from an earlier call to glob.
+ Linux version.
+ Copyright (C) 2017-2018 Free Software 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/stat.h>
+#include <kernel_stat.h>
+
+#if !XSTAT_IS_XSTAT64
+
+# include <glob.h>
+
+# define glob_t glob64_t
+# define globfree(pglob) globfree64 (pglob)
+
+# undef stat
+# define stat stat64
+
+# include <posix/globfree.c>
+
+libc_hidden_def (globfree64)
+#endif
diff --git a/sysdeps/unix/sysv/linux/grantpt.c b/sysdeps/unix/sysv/linux/grantpt.c
index 8cebde36ed..2030e07fa6 100644
--- a/sysdeps/unix/sysv/linux/grantpt.c
+++ b/sysdeps/unix/sysv/linux/grantpt.c
@@ -26,14 +26,14 @@ close_all_fds (void)
char *endp;
long int fd = strtol (d->d_name, &endp, 10);
if (*endp == '\0' && fd != PTY_FILENO && fd != dirfd (dir))
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
}
__closedir (dir);
- int nullfd = open_not_cancel_2 (_PATH_DEVNULL, O_RDONLY);
+ int nullfd = __open_nocancel (_PATH_DEVNULL, O_RDONLY);
assert (nullfd == STDIN_FILENO);
- nullfd = open_not_cancel_2 (_PATH_DEVNULL, O_WRONLY);
+ nullfd = __open_nocancel (_PATH_DEVNULL, O_WRONLY);
assert (nullfd == STDOUT_FILENO);
__dup2 (STDOUT_FILENO, STDERR_FILENO);
}
diff --git a/sysdeps/unix/sysv/linux/hppa/Makefile b/sysdeps/unix/sysv/linux/hppa/Makefile
index 68569013fb..e1637f54f5 100644
--- a/sysdeps/unix/sysv/linux/hppa/Makefile
+++ b/sysdeps/unix/sysv/linux/hppa/Makefile
@@ -2,3 +2,10 @@
ifeq ($(subdir),stdlib)
gen-as-const-headers += ucontext_i.sym
endif
+
+# Supporting non-executable stacks on HPPA requires changes to both
+# the Linux kernel and glibc. The kernel currently needs an executable
+# stack for syscall restarts and signal returns.
+ifeq ($(subdir),elf)
+test-xfail-check-execstack = yes
+endif
diff --git a/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c b/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c
index 0ab90cfeb3..a91dd258a9 100644
--- a/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,7 @@
destroyed must all have stack values higher than ours. */ \
if ((unsigned long) (sp) > this_sp) \
{ \
- struct sigaltstack oss; \
+ stack_t oss; \
INTERNAL_SYSCALL_DECL (err); \
int result = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss);\
/* If we aren't using an alternate stack then we have already \
diff --git a/sysdeps/unix/sysv/linux/hppa/arch-fork.h b/sysdeps/unix/sysv/linux/hppa/arch-fork.h
deleted file mode 100644
index cf9dd35bfd..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/arch-fork.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. HPPA version.
- Copyright (C) 2005-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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-/* Argument 1 - Clone flags.
- 2 - Child stack pointer.
- 3 - Parent tid pointer.
- 4 - New TLS area pointer.
- 5 - Child tid pointer. */
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 5, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
- NULL, NULL, NULL, &THREAD_SELF->tid)
diff --git a/sysdeps/unix/sysv/linux/hppa/atomic-machine.h b/sysdeps/unix/sysv/linux/hppa/atomic-machine.h
index 3f0fd15e72..2302c1fe12 100644
--- a/sysdeps/unix/sysv/linux/hppa/atomic-machine.h
+++ b/sysdeps/unix/sysv/linux/hppa/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Carlos O'Donell <carlos@baldric.uwo.ca>, 2005.
@@ -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
@@ -46,6 +39,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
/* prev = *addr;
if (prev == old)
*addr = new;
@@ -62,7 +58,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 +70,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/bits/epoll.h b/sysdeps/unix/sysv/linux/hppa/bits/epoll.h
index 424135194a..16b85f4a4c 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/errno.h b/sysdeps/unix/sysv/linux/hppa/bits/errno.h
index 79df20ed92..f3188efb6d 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/errno.h
@@ -1,5 +1,5 @@
/* Error constants. Linux/HPPA specific version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,17 +16,22 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _ERRNO_H
+#ifndef _BITS_ERRNO_H
+#define _BITS_ERRNO_H 1
+
+#if !defined _ERRNO_H
+# error "Never include <bits/errno.h> directly; use <errno.h> instead."
+#endif
-# undef EDOM
-# undef EILSEQ
-# undef ERANGE
# include <linux/errno.h>
-/* Linux also has no ECANCELED error code. Since it is not used here
- we define it to an invalid value. */
+/* Older Linux headers do not define these constants. */
+# ifndef ENOTSUP
+# define ENOTSUP EOPNOTSUPP
+# endif
+
# ifndef ECANCELED
-# define ECANCELED ECANCELLED
+# define ECANCELED 253
# endif
# ifndef EOWNERDEAD
@@ -45,22 +50,4 @@
# define EHWPOISON 257
# endif
-# ifndef __ASSEMBLER__
-/* Function to get address of global `errno' variable. */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
-
-# if !defined _LIBC || defined _LIBC_REENTRANT
-/* When using threads, errno is a per-thread value. */
-# define errno (*__errno_location ())
-# endif
-# endif /* !__ASSEMBLER__ */
-#endif /* _ERRNO_H */
-
-#if !defined _ERRNO_H && defined __need_Emath
-/* This is ugly but the kernel header is not clean enough. We must
- define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
- defined. */
-# define EDOM 33 /* Math argument out of domain of function. */
-# define EILSEQ 47 /* Illegal byte sequence. */
-# define ERANGE 34 /* Math result not representable. */
-#endif /* !_ERRNO_H && __need_Emath */
+#endif /* bits/errno.h. */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/eventfd.h b/sysdeps/unix/sysv/linux/hppa/bits/eventfd.h
index 7c20b3d7e6..3743b94351 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/eventfd.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/eventfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
index c7557b9f50..2071609085 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/inotify.h b/sysdeps/unix/sysv/linux/hppa/bits/inotify.h
index d22de78687..3923126dd9 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/inotify.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h b/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h
index a09eb0662b..78b1e61826 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/ipc.h b/sysdeps/unix/sysv/linux/hppa/bits/ipc.h
index 61df01d805..dd8324602b 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/sysdeps/unix/sysv/linux/hppa/bits/mman.h
index cbb3ab5a48..1c7d3708e6 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/HPPA version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,7 +34,9 @@
#define MAP_SHARED 0x01 /* Share changes */
#define MAP_PRIVATE 0x02 /* Changes are private */
#ifdef __USE_MISC
-# define MAP_TYPE 0x03 /* Mask for type of mapping */
+# define MAP_SHARED_VALIDATE 0x03 /* Share changes and validate
+ extension flags. */
+# define MAP_TYPE 0x2b /* Mask for type of mapping */
#endif
/* Other flags. */
@@ -60,6 +62,8 @@
# define MAP_NONBLOCK 0x20000 /* Do not block on IO */
# define MAP_STACK 0x40000 /* Create for process/thread stacks */
# define MAP_HUGETLB 0x80000 /* Create a huge page mapping */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Flags to "msync" */
@@ -85,9 +89,7 @@
# define MADV_SEQUENTIAL 2 /* Expect sequential page references */
# define MADV_WILLNEED 3 /* Will need these pages */
# define MADV_DONTNEED 4 /* Dont need these pages */
-# define MADV_SPACEAVAIL 5 /* Insure that resources are reserved */
-# define MADV_VPS_PURGE 6 /* Purge pages from VM page cache */
-# define MADV_VPS_INHERIT 7 /* Inherit parents page size */
+# define MADV_FREE 8 /* Free pages only if memory pressure. */
# define MADV_REMOVE 9 /* Remove these pages and resources. */
# define MADV_DONTFORK 10 /* Do not inherit across fork. */
# define MADV_DOFORK 11 /* Do inherit across fork. */
@@ -98,6 +100,10 @@
# define MADV_DONTDUMP 69 /* Explicity exclude from the core dump,
overrides the coredump filter bits */
# define MADV_DODUMP 70 /* Clear the MADV_NODUMP flag */
+# define MADV_WIPEONFORK 71 /* Zero memory on fork, child only. */
+# define MADV_KEEPONFORK 72 /* Undo MADV_WIPEONFORK. */
+# define MADV_HWPOISON 100 /* Poison a page for testing. */
+# define MADV_SOFT_OFFLINE 101 /* Soft offline page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
@@ -108,3 +114,5 @@
# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
#endif
+
+#include <bits/mman-shared.h>
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/msq.h b/sysdeps/unix/sysv/linux/hppa/bits/msq.h
index 5cd13011b9..b0cfb591e9 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -67,6 +67,7 @@ struct msqid_ds
/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12
+# define MSG_STAT_ANY 13
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/sem.h b/sysdeps/unix/sysv/linux/hppa/bits/sem.h
index 9be4775b11..12b849ae79 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -73,6 +73,7 @@ struct semid_ds
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
+# define SEM_STAT_ANY 20
struct seminfo
{
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/shm.h b/sysdeps/unix/sysv/linux/hppa/bits/shm.h
index 60bb625eba..4967c94190 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,7 +37,7 @@
#define SHM_UNLOCK 12 /* unlock segment (root only) */
/* Segment low boundary address multiple. */
-#define SHMLBA 0x00400000 /* address needs to be 4 Mb aligned */
+#define SHMLBA 0x1000
/* Type to count number of attaches. */
typedef unsigned long int shmatt_t;
@@ -74,6 +74,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h b/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h
index ff57c56bd7..09b9e4e4e6 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h
@@ -1,5 +1,5 @@
/* Definitions for Linux/HPPA sigaction.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,6 +16,9 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGACTION_H
+#define _BITS_SIGACTION_H 1
+
#ifndef _SIGNAL_H
# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
#endif
@@ -26,7 +29,7 @@
struct sigaction
{
/* Signal handler. */
-#ifdef __USE_POSIX199309
+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
union
{
/* Used if SA_SIGINFO is not set. */
@@ -57,10 +60,10 @@ struct sigaction
#define SA_NOCLDWAIT 0x00000080 /* Don't create zombie on child death. */
#define SA_SIGINFO 0x00000010 /* Invoke signal-catching function with
three arguments instead of one. */
-#if defined __USE_UNIX98 || defined __USE_MISC
+#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
# define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
#endif
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
# define SA_RESETHAND 0x00000004 /* Reset to SIG_DFL on entry to handler. */
# define SA_NODEFER 0x00000020 /* Don't automatically block the signal
when its handler is being executed. */
@@ -79,3 +82,5 @@ struct sigaction
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
#define SIG_SETMASK 2 /* for setting the signal mask */
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/signalfd.h b/sysdeps/unix/sysv/linux/hppa/bits/signalfd.h
index 81d7d60f35..ef997876e6 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/signalfd.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/signalfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/signum.h b/sysdeps/unix/sysv/linux/hppa/bits/signum.h
index 9fe717a3a7..f1628fdaee 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/signum.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/signum.h
@@ -1,5 +1,5 @@
/* Signal number definitions. Linux/HPPA version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software 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,74 +16,60 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _SIGNAL_H
+#ifndef _BITS_SIGNUM_H
+#define _BITS_SIGNUM_H 1
-/* Fake signal functions. */
-#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
-#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
-#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
-
-#ifdef __USE_UNIX98
-# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+#ifndef _SIGNAL_H
+#error "Never include <bits/signum.h> directly; use <signal.h> instead."
#endif
+#include <bits/signum-generic.h>
-/* Signals. */
-#define SIGHUP 1 /* Hangup (POSIX). */
-#define SIGINT 2 /* Interrupt (ANSI). */
-#define SIGQUIT 3 /* Quit (POSIX). */
-#define SIGILL 4 /* Illegal instruction (ANSI). */
-#define SIGTRAP 5 /* Trace trap (POSIX). */
-#define SIGABRT 6 /* Abort (ANSI). */
-#define SIGIOT 6 /* IOT trap (4.2 BSD). */
-#define SIGSTKFLT 7 /* Stack fault. */
-#define SIGFPE 8 /* Floating-point exception (ANSI). */
-#define SIGKILL 9 /* Kill, unblockable (POSIX). */
-#define SIGBUS 10 /* BUS error (4.2 BSD). */
-#define SIGSEGV 11 /* Segmentation violation (ANSI). */
-#define SIGXCPU 12 /* CPU limit exceeded (4.2 BSD). */
-#define SIGPIPE 13 /* Broken pipe (POSIX). */
-#define SIGALRM 14 /* Alarm clock (POSIX). */
-#define SIGTERM 15 /* Termination (ANSI). */
-#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
-#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
-#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
-#define SIGCHLD 18 /* Child status has changed (POSIX). */
-#define SIGPWR 19 /* Power failure restart (System V). */
-#define SIGVTALRM 20 /* Virtual alarm clock (4.2 BSD). */
-#define SIGPROF 21 /* Profiling alarm clock (4.2 BSD). */
-#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
-#define SIGIO 22 /* I/O now possible (4.2 BSD). */
-#define SIGWINCH 23 /* Window size change (4.3 BSD, Sun). */
-#define SIGSTOP 24 /* Stop, unblockable (POSIX). */
-#define SIGTSTP 25 /* Keyboard stop (POSIX). */
-#define SIGCONT 26 /* Continue (POSIX). */
-#define SIGTTIN 27 /* Background read from tty (POSIX). */
-#define SIGTTOU 28 /* Background write to tty (POSIX). */
-#define SIGURG 29 /* Urgent condition on socket (4.2 BSD). */
-#define SIGXFSZ 30 /* File size limit exceeded (4.2 BSD). */
-#define SIGSYS 31 /* Bad system call. */
-#define SIGUNUSED 31
+/* Adjustments and additions to the signal number constants for
+ Linux/HPPA. These values were originally chosen for HP/UX
+ compatibility, but were renumbered as of kernel 3.17 and glibc 2.21
+ to accommodate software (notably systemd) that assumed at least 29
+ real-time signal numbers would be available. SIGEMT and SIGLOST
+ were removed, and the values of SIGSTKFLT, SIGXCPU, XIGXFSZ, and
+ SIGSYS were changed, enabling __SIGRTMIN to be 32. */
-#define _NSIG 65 /* Biggest signal number + 1
- (including real-time signals). */
+#define SIGSTKFLT 7 /* Stack fault (obsolete). */
+#define SIGPWR 19 /* Power failure imminent. */
-#define SIGRTMIN (__libc_current_sigrtmin ())
-#define SIGRTMAX (__libc_current_sigrtmax ())
+#undef SIGXCPU
+#define SIGXCPU 12
+#undef SIGUSR1
+#define SIGUSR1 16
+#undef SIGUSR2
+#define SIGUSR2 17
+#undef SIGCHLD
+#define SIGCHLD 18
+#undef SIGVTALRM
+#define SIGVTALRM 20
+#undef SIGPROF
+#define SIGPROF 21
+#undef SIGPOLL
+#define SIGPOLL 22
+#undef SIGWINCH
+#define SIGWINCH 23
+#undef SIGSTOP
+#define SIGSTOP 24
+#undef SIGTSTP
+#define SIGTSTP 25
+#undef SIGCONT
+#define SIGCONT 26
+#undef SIGTTIN
+#define SIGTTIN 27
+#undef SIGTTOU
+#define SIGTTOU 28
+#undef SIGURG
+#define SIGURG 29
+#undef SIGXFSZ
+#define SIGXFSZ 30
+#undef SIGSYS
+#define SIGSYS 31
-/* These are the hard limits of the kernel. These values should not be
- used directly at user level. */
-/* In the Linux kernel version 3.17, and glibc 2.21, the signal numbers
- were rearranged in order to make hppa like every other arch. Previously
- we started __SIGRTMIN at 37, and that meant several pieces of important
- software, including systemd, would fail to build. To support systemd we
- removed SIGEMT and SIGLOST, and rearranged the others according to
- expected values. This is technically an ABI incompatible change, but
- because zero applications use SIGSTKFLT, SIGXCPU, SIGXFSZ and SIGSYS
- nothing broke. Nothing uses SIGEMT and SIGLOST, and they were present
- for HPUX compatibility which is no longer supported. Thus because
- nothing breaks we don't do any compatibility work here. */
-#define __SIGRTMIN 32 /* Kernel > 3.17. */
-#define __SIGRTMAX (_NSIG - 1)
+#undef __SIGRTMAX
+#define __SIGRTMAX 64
#endif /* <signal.h> included. */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/socket_type.h b/sysdeps/unix/sysv/linux/hppa/bits/socket_type.h
index 8197685841..7733e35424 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/socket_type.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/socket_type.h
@@ -1,5 +1,5 @@
/* Define enum __socket_type for Linux/HP-PARISC.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/timerfd.h b/sysdeps/unix/sysv/linux/hppa/bits/timerfd.h
index df6c7727c4..f0c491289c 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/timerfd.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/timerfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/brk.c b/sysdeps/unix/sysv/linux/hppa/brk.c
index 1cc9fa7cdb..58f928fb7f 100644
--- a/sysdeps/unix/sysv/linux/hppa/brk.c
+++ b/sysdeps/unix/sysv/linux/hppa/brk.c
@@ -1,5 +1,5 @@
/* brk system call for Linux/HPPA.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S
index e80fd8d579..0c581ec53b 100644
--- a/sysdeps/unix/sysv/linux/hppa/clone.S
+++ b/sysdeps/unix/sysv/linux/hppa/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000.
Based on the Alpha version by Richard Henderson <rth@tamu.edu>, 1996.
@@ -64,9 +64,12 @@
ENTRY(__clone)
/* Prologue */
stwm %r4, 64(%sp)
+ .cfi_def_cfa_offset -64
+ .cfi_offset 4, 0
stw %sp, -4(%sp)
#ifdef PIC
stw %r19, -32(%sp)
+ .cfi_offset 19, 32
#endif
/* Sanity check arguments. */
@@ -132,24 +135,6 @@ ENTRY(__clone)
ldwm -64(%sp), %r4
.LthreadStart:
-# define CLONE_VM_BIT 23 /* 0x00000100 */
-# define CLONE_THREAD_BIT 15 /* 0x00010000 */
- /* Load original clone flags.
- If CLONE_THREAD was passed, don't reset the PID/TID.
- If CLONE_VM was passed, we need to store -1 to PID/TID.
- If CLONE_VM and CLONE_THREAD were not set store the result
- of getpid to PID/TID. */
- ldw -56(%sp), %r26
- bb,<,n %r26, CLONE_THREAD_BIT, 1f
- bb,< %r26, CLONE_VM_BIT, 2f
- ldi -1, %ret0
- ble 0x100(%sr2, %r0)
- ldi __NR_getpid, %r20
-2:
- mfctl %cr27, %r26
- stw %ret0, PID_THREAD_OFFSET(%r26)
- stw %ret0, TID_THREAD_OFFSET(%r26)
-1:
/* Load up the arguments. */
ldw -60(%sp), %arg0
ldw -64(%sp), %r22
@@ -165,14 +150,15 @@ ENTRY(__clone)
#ifdef PIC
copy %r4, %r19
#endif
- /* The call to _exit needs saved r19. */
- bl _exit, %rp
- copy %ret0, %arg0
+ copy %r28, %r26
+ ble 0x100(%sr2, %r0)
+ ldi __NR_exit, %r20
- /* We should not return from _exit.
+ /* We should not return from exit.
We do not restore r4, or the stack state. */
iitlbp %r0, (%sr0, %r0)
PSEUDO_END(__clone)
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/hppa/fcntl.c b/sysdeps/unix/sysv/linux/hppa/fcntl.c
deleted file mode 100644
index ea951bc4f9..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/hppa/getcontext.S b/sysdeps/unix/sysv/linux/hppa/getcontext.S
index d2e0db0323..b8f978fde8 100644
--- a/sysdeps/unix/sysv/linux/hppa/getcontext.S
+++ b/sysdeps/unix/sysv/linux/hppa/getcontext.S
@@ -1,5 +1,5 @@
/* Get current user context.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Helge Deller <deller@gmx.de>, 2008.
@@ -129,9 +129,14 @@ ENTRY(__getcontext)
fstds %fr31, 0(%r1)
/* Prologue */
+ stw %r2, -20(%sp)
+ .cfi_offset 2, -20
stwm %r4, 64(%sp)
+ .cfi_def_cfa_offset -64
+ .cfi_offset 4, 0
#ifdef PIC
stw %r19, -32(%sp)
+ .cfi_offset 19, 32
#endif
/* Set up the trampoline registers.
@@ -142,21 +147,26 @@ ENTRY(__getcontext)
stw %r4, oR24(%r26)
stw %r5, oR25(%r26)
stw %r6, oR26(%r26)
+#ifdef PIC
+ addil LT%__getcontext_ret, %r19
+ ldw RT%__getcontext_ret(%r1), %r1
+#else
ldil L%__getcontext_ret, %r1
ldo R%__getcontext_ret(%r1), %r1
+#endif
stw %r1, oR2(%r26)
/* Save the current signal mask. */
/* sigprocmask(SIG_BLOCK, NULL, &ucp->uc_sigmask); */
ldo oSIGMASK(%r26), %r24
copy %r0, %r25
- bl sigprocmask, %r2
+ bl __sigprocmask, %r2
ldi SIG_BLOCK, %r26
/* Epilogue */
ldw -84(%sp), %r2
#ifdef PIC
- ldw -96(%sp), %r19
+ ldw -32(%sp), %r19
#endif
bv %r0(%r2)
ldwm -64(%sp), %r4
diff --git a/sysdeps/unix/sysv/linux/hppa/getdents64.c b/sysdeps/unix/sysv/linux/hppa/getdents64.c
deleted file mode 100644
index 0c75fb5a06..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/getdents64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getdents64.c>
diff --git a/sysdeps/unix/sysv/linux/hppa/getrlimit64.c b/sysdeps/unix/sysv/linux/hppa/getrlimit64.c
deleted file mode 100644
index fef018f471..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/getrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/hppa/internaltypes.h b/sysdeps/unix/sysv/linux/hppa/internaltypes.h
deleted file mode 100644
index 651ce2ee45..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/internaltypes.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#include_next <internaltypes.h>
-#ifndef _INTERNAL_TYPES_H_HPPA_
-#define _INTERNAL_TYPES_H_HPPA_ 1
-#include <atomic.h>
-
-/* In GLIBC 2.10 HPPA switched from Linuxthreads to NPTL, and in order
-to maintain ABI compatibility with pthread_cond_t, some care had to be
-taken.
-
-The NPTL pthread_cond_t grew in size. When HPPA switched to NPTL, we
-dropped the use of ldcw, and switched to the kernel helper routine for
-compare-and-swap. This allowed HPPA to use the 4-word 16-byte aligned
-lock words, and alignment words to store the additional pthread_cond_t
-data. Once organized properly the new NPTL pthread_cond_t was 1 word
-smaller than the Linuxthreads version.
-
-However, we were faced with the case that users may have initialized the
-pthread_cond_t with PTHREAD_COND_INITIALIZER. In this case, the first
-four words were set to one, and must be cleared before any NPTL code
-used these words.
-
-We didn't want to use LDCW, because it continues to be a source of bugs
-when applications memset pthread_cond_t to all zeroes by accident. This
-works on all other architectures where lock words are unlocked at zero.
-Remember that because of the semantics of LDCW, a locked word is set to
-zero, and an unlocked word is set to 1.
-
-Instead we used atomic_compare_and_exchange_val_acq, but we couldn't use
-this on any of the pthread_cond_t words, otherwise it might interfere
-with the current operation of the structure. To solve this problem we
-used the left over word.
-
-If the stucture was initialized by a legacy Linuxthread
-PTHREAD_COND_INITIALIZER it contained a 1, and this indicates that the
-structure requires zeroing for NPTL. The first thread to come upon a
-pthread_cond_t with a 1 in the __initializer field, will
-compare-and-swap the value, placing a 2 there which will cause all other
-threads using the same pthread_cond_t to wait for the completion of the
-initialization. Lastly, we use a store (with memory barrier) to change
-__initializer from 2 to 0. Note that the store is strongly ordered, but
-we use the PA 1.1 compatible form which is ",ma" with zero offset.
-
-In the future, when the application is recompiled with NPTL
-PTHREAD_COND_INITIALIZER it will be a quick compare-and-swap, which
-fails because __initializer is zero, and the structure will be used as
-is correctly. */
-
-#define cond_compat_clear(var) \
-({ \
- int tmp = 0; \
- var->__data.__lock = 0; \
- var->__data.__futex = 0; \
- var->__data.__mutex = NULL; \
- /* Clear __initializer last, to indicate initialization is done. */ \
- __asm__ __volatile__ ("stw,ma %1,0(%0)" \
- : : "r" (&var->__data.__initializer), "r" (tmp) : "memory"); \
-})
-
-#define cond_compat_check_and_clear(var) \
-({ \
- int ret; \
- volatile int *value = &var->__data.__initializer; \
- if ((ret = atomic_compare_and_exchange_val_acq(value, 2, 1))) \
- { \
- if (ret == 1) \
- { \
- /* Initialize structure. */ \
- cond_compat_clear (var); \
- } \
- else \
- { \
- /* Yield until structure is initialized. */ \
- while (*value == 2) sched_yield (); \
- } \
- } \
-})
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/ipc_priv.h b/sysdeps/unix/sysv/linux/hppa/ipc_priv.h
new file mode 100644
index 0000000000..43fa53013a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/ipc_priv.h
@@ -0,0 +1,21 @@
+/* Old SysV permission definition for Linux. Hppa version.
+ Copyright (C) 2017-2018 Free Software 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/ipc.h> /* For __key_t */
+
+#define __IPC_64 0x0
diff --git a/sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h
new file mode 100644
index 0000000000..6ede0d6af7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 304
+#define SIGJMP_BUF_SIZE 304
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 168
+#define SAVED_MASK_OFFSET 172
diff --git a/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
index a3fcf17d53..ef3c4ddfd7 100644
--- a/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,17 +18,6 @@
<http://www.gnu.org/licenses/>. */
-/* Support for the accept4 and recvmmsg syscalls was added in 2.6.34. */
-#if __LINUX_KERNEL_VERSION >= 0x020622
-# define __ASSUME_ACCEPT4_SYSCALL 1
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
-
-/* Support for the sendmmsg syscall was added in 3.1. */
-#if __LINUX_KERNEL_VERSION >= 0x030100
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
-
/* Support for the utimes syscall was added in 3.14. */
#if __LINUX_KERNEL_VERSION >= 0x030e00
# define __ASSUME_UTIMES 1
@@ -36,7 +25,13 @@
#include_next <kernel-features.h>
-/* The prlimit64 syscall was added for PA in 2.6.37. */
-#if __LINUX_KERNEL_VERSION < 0x020625
-# undef __ASSUME_PRLIMIT64
+#define __ASSUME_RECV_SYSCALL 1
+#define __ASSUME_SEND_SYSCALL 1
+
+/* Support for the execveat syscall was added in 4.0. */
+#if __LINUX_KERNEL_VERSION < 0x040000
+# undef __ASSUME_EXECVEAT
#endif
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
index e3ea72402f..a3ac53a1ef 100644
--- a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
@@ -29,3 +29,6 @@ struct kernel_stat {
#define _HAVE_STAT_NSEC
#define _HAVE_STAT64_NSEC
+
+#define XSTAT_IS_XSTAT64 0
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/hppa/ld.abilist b/sysdeps/unix/sysv/linux/hppa/ld.abilist
index dc3ebf48c5..0387614d8f 100644
--- a/sysdeps/unix/sysv/linux/hppa/ld.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
-GLIBC_2.2 __libc_memalign F
GLIBC_2.2 __libc_stack_end D 0x4
GLIBC_2.2 _dl_mcount F
GLIBC_2.2 _r_debug D 0x14
@@ -7,7 +5,5 @@ GLIBC_2.2 calloc F
GLIBC_2.2 free F
GLIBC_2.2 malloc F
GLIBC_2.2 realloc F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/unix/sysv/linux/hppa/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/hppa/libBrokenLocale.abilist
index 21343df781..0e4d814909 100644
--- a/sysdeps/unix/sysv/linux/hppa/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/hppa/libanl.abilist b/sysdeps/unix/sysv/linux/hppa/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/hppa/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 1d30644651..24b11b15c0 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -24,7 +23,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -32,24 +30,20 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x404
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x404
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 prlimit F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -58,7 +52,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -69,7 +62,6 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 _sys_errlist D 0x410
GLIBC_2.17 _sys_nerr D 0x4
GLIBC_2.17 clock_getcpuclockid F
@@ -81,11 +73,8 @@ GLIBC_2.17 prlimit64 F
GLIBC_2.17 secure_getenv F
GLIBC_2.17 sys_errlist D 0x410
GLIBC_2.17 sys_nerr D 0x4
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.19 GLIBC_2.19 A
GLIBC_2.19 fanotify_mark F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _Exit F
GLIBC_2.2 _IO_2_1_stderr_ D 0xa0
GLIBC_2.2 _IO_2_1_stdin_ D 0xa0
@@ -1826,33 +1815,71 @@ GLIBC_2.2 xdrstdio_create F
GLIBC_2.2 xencrypt F
GLIBC_2.2 xprt_register F
GLIBC_2.2 xprt_unregister F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -1946,7 +1973,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -1959,7 +1985,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x104
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -1980,7 +2005,6 @@ GLIBC_2.3.3 sched_setaffinity F
GLIBC_2.3.3 semtimedop F
GLIBC_2.3.3 sys_sigabbrev D 0x104
GLIBC_2.3.3 sys_siglist D 0x104
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2010,7 +2034,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2087,7 +2110,6 @@ GLIBC_2.4 sys_errlist D 0x400
GLIBC_2.4 sys_nerr D 0x4
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2105,7 +2127,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2113,7 +2134,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2140,7 +2160,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2151,7 +2170,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/hppa/libcrypt.abilist b/sysdeps/unix/sysv/linux/hppa/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/hppa/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/hppa/libdl.abilist b/sysdeps/unix/sysv/linux/hppa/libdl.abilist
index 5536f6e0a9..7826fde951 100644
--- a/sysdeps/unix/sysv/linux/hppa/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 dlopen F
GLIBC_2.1 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/hppa/libm.abilist b/sysdeps/unix/sysv/linux/hppa/libm.abilist
index 9b7f40a4c9..679bbfbd59 100644
--- a/sysdeps/unix/sysv/linux/hppa/libm.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -53,10 +52,8 @@ GLIBC_2.15 __y1_finite F
GLIBC_2.15 __y1f_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _LIB_VERSION D 0x4
GLIBC_2.2 __clog10 F
GLIBC_2.2 __clog10f F
@@ -368,10 +365,403 @@ GLIBC_2.2 y1l F
GLIBC_2.2 yn F
GLIBC_2.2 ynf F
GLIBC_2.2 ynl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.4 exp2l F
diff --git a/sysdeps/unix/sysv/linux/hppa/libnsl.abilist b/sysdeps/unix/sysv/linux/hppa/libnsl.abilist
index a23db2aeaf..add3d66a7a 100644
--- a/sysdeps/unix/sysv/linux/hppa/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __free_fdresult F
GLIBC_2.1 __nis_default_access F
GLIBC_2.1 __nis_default_group F
@@ -120,5 +118,4 @@ GLIBC_2.1 readColdStartFile F
GLIBC_2.1 writeColdStartFile F
GLIBC_2.1 xdr_cback_data F
GLIBC_2.1 xdr_obj_p F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 xdr_ypall F
diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
index a73aa43c55..bcba07f575 100644
--- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
@@ -1,15 +1,11 @@
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_flockfile F
GLIBC_2.2 _IO_ftrylockfile F
GLIBC_2.2 _IO_funlockfile F
@@ -200,18 +196,35 @@ GLIBC_2.2 vfork F
GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -227,13 +240,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/hppa/libresolv.abilist b/sysdeps/unix/sysv/linux/hppa/libresolv.abilist
index 4d50e7c8c6..157a33ce35 100644
--- a/sysdeps/unix/sysv/linux/hppa/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/hppa/librt.abilist b/sysdeps/unix/sysv/linux/hppa/librt.abilist
index 15e4418863..595f1b712a 100644
--- a/sysdeps/unix/sysv/linux/hppa/librt.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 aio_cancel F
GLIBC_2.1 aio_cancel64 F
GLIBC_2.1 aio_error F
@@ -16,7 +15,6 @@ GLIBC_2.1 aio_write F
GLIBC_2.1 aio_write64 F
GLIBC_2.1 lio_listio F
GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 clock_getcpuclockid F
GLIBC_2.2 clock_getres F
GLIBC_2.2 clock_gettime F
@@ -29,7 +27,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -40,8 +37,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/hppa/libthread_db.abilist b/sysdeps/unix/sysv/linux/hppa/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/hppa/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/hppa/libutil.abilist b/sysdeps/unix/sysv/linux/hppa/libutil.abilist
index 89c67755c4..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/hppa/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
diff --git a/sysdeps/unix/sysv/linux/hppa/localplt.data b/sysdeps/unix/sysv/linux/hppa/localplt.data
new file mode 100644
index 0000000000..5f3475de19
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/localplt.data
@@ -0,0 +1,24 @@
+# See scripts/check-localplt.awk for how this file is processed.
+# PLT use is required for the malloc family and for matherr because
+# users can define their own functions and have library internals call them.
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libc.so: __sigsetjmp
+libc.so: _IO_funlockfile
+libc.so: __errno_location
+libm.so: matherr
+libpthread.so: __errno_location
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/hppa/makecontext.c b/sysdeps/unix/sysv/linux/hppa/makecontext.c
index ff82b9f457..f1d1263832 100644
--- a/sysdeps/unix/sysv/linux/hppa/makecontext.c
+++ b/sysdeps/unix/sysv/linux/hppa/makecontext.c
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Helge Deller <deller@gmx.de>, 2008.
diff --git a/sysdeps/unix/sysv/linux/hppa/mmap.c b/sysdeps/unix/sysv/linux/hppa/mmap.c
deleted file mode 100644
index e6ba454fcc..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/mmap.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 1994-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/types.h>
-#include <sys/mman.h>
-#include <errno.h>
-
-/* Map addresses starting near ADDR and extending for LEN bytes. From
- OFFSET into the file FD describes according to PROT and FLAGS. If ADDR
- is nonzero, it is the desired mapping address. If the MAP_FIXED bit is
- set in FLAGS, the mapping will be at ADDR exactly (which must be
- page-aligned); otherwise the system chooses a convenient nearby address.
- The return value is the actual mapping address chosen or MAP_FAILED
- for errors (in which case `errno' is set). A successful `mmap' call
- deallocates any previous mapping for the affected region. */
-
-#include <sysdep.h>
-
-__ptr_t
-__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
-{
-
- __ptr_t ret;
-
- ret = (__ptr_t) INLINE_SYSCALL (mmap, 6, addr, len, prot, flags, fd, offset);
-
- /* check if it's really a negative number */
- if(((unsigned long)ret & 0xfffff000) == 0xfffff000)
- return MAP_FAILED;
-
- return ret;
-
-}
-
-weak_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/hppa/profil-counter.h b/sysdeps/unix/sysv/linux/hppa/profil-counter.h
index c9c0874659..4e8bfb41ee 100644
--- a/sysdeps/unix/sysv/linux/hppa/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/hppa/profil-counter.h
@@ -1,5 +1,5 @@
/* Machine-dependent SIGPROF signal handler. PA-RISC version
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/>. */
static void
-__profil_counter (int signr, siginfo_t *si, struct ucontext *uctx)
+__profil_counter (int signr, siginfo_t *si, ucontext_t *uctx)
{
unsigned long ip = uctx->uc_mcontext.sc_iaoq[0] & ~0x3;
profil_count ((void *) ip);
diff --git a/sysdeps/unix/sysv/linux/hppa/pt-vfork.S b/sysdeps/unix/sysv/linux/hppa/pt-vfork.S
index df532362d2..45f7620d90 100644
--- a/sysdeps/unix/sysv/linux/hppa/pt-vfork.S
+++ b/sysdeps/unix/sysv/linux/hppa/pt-vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,26 +25,6 @@
replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
and the process ID of the new process to the old process. */
-/* Load the thread register.
- Load the saved PID value.
- Negate the value.
- Store the temporary PID. */
-#define SAVE_PID \
- mfctl %cr27, %r26 ASM_LINE_SEP \
- ldw PID_THREAD_OFFSET(%r26),%r1 ASM_LINE_SEP \
- sub %r0,%r1,%r1 ASM_LINE_SEP \
- stw %r1,PID_THREAD_OFFSET(%r26) ASM_LINE_SEP
-/* If we are the parent...
- Get the thread pointer.
- Load the saved PID.
- Negate the value (got back original)
- Restore the PID. */
-#define RESTORE_PID \
- cmpb,=,n %r0,%ret0,.Lthread_start ASM_LINE_SEP \
- mfctl %cr27, %r26 ASM_LINE_SEP \
- ldw PID_THREAD_OFFSET(%r26),%r1 ASM_LINE_SEP \
- sub %r0,%r1,%r1 ASM_LINE_SEP \
- stw %r1,PID_THREAD_OFFSET(%r26) ASM_LINE_SEP \
.Lthread_start: ASM_LINE_SEP
/* r26, r25, r24, r23 are free since vfork has no arguments */
@@ -58,16 +38,10 @@ ENTRY(__vfork)
copy %r19, %r25 /* parent */
#endif
- /* Save the process PID */
- SAVE_PID
-
/* Syscall saves and restores all register states */
ble 0x100(%sr2,%r0)
ldi __NR_vfork,%r20
- /* Conditionally restore the PID */
- RESTORE_PID
-
/* Check for error */
ldi -4096,%r1
comclr,>>= %r1,%ret0,%r0 /* Note: unsigned compare. */
@@ -84,7 +58,10 @@ ENTRY(__vfork)
that there is no child now, so it's safe to create
a frame. */
stw %rp, -20(%sp)
+ .cfi_offset 2, -20
stwm %r3, 64(%sp)
+ .cfi_def_cfa_offset -64
+ .cfi_offset 3, 0
stw %sp, -4(%sp)
sub %r0,%ret0,%r3
diff --git a/sysdeps/unix/sysv/linux/hppa/pthread.h b/sysdeps/unix/sysv/linux/hppa/pthread.h
index 398d203b70..11a024db59 100644
--- a/sysdeps/unix/sysv/linux/hppa/pthread.h
+++ b/sysdeps/unix/sysv/linux/hppa/pthread.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,7 @@
#include <bits/pthreadtypes.h>
#include <bits/setjmp.h>
#include <bits/wordsize.h>
+#include <bits/types/struct_timespec.h>
/* Detach state. */
@@ -82,32 +83,18 @@ enum
#endif
-#ifdef __PTHREAD_MUTEX_HAVE_PREV
-# define PTHREAD_MUTEX_INITIALIZER \
- { { 0, 0, 0, 0, 0, __PTHREAD_SPINS, { 0, 0 } } }
-# ifdef __USE_GNU
-# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, __PTHREAD_SPINS, { 0, 0 } } }
-# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, __PTHREAD_SPINS, { 0, 0 } } }
-# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __PTHREAD_SPINS, { 0, 0 } } }
-# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __PTHREAD_SPINS, { 0, 0 } } }
-
-# endif
-#else
-# define PTHREAD_MUTEX_INITIALIZER \
- { { 0, 0, 0, 0, 0, { __PTHREAD_SPINS } } }
-# ifdef __USE_GNU
-# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { __PTHREAD_SPINS } } }
-# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { __PTHREAD_SPINS } } }
-# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { __PTHREAD_SPINS } } }
-
-# endif
+#define PTHREAD_MUTEX_INITIALIZER \
+ { { 0, 0, 0, 0, { 0, 0, 0, 0 }, 0, { __PTHREAD_SPINS }, { 0, 0 } } }
+#ifdef __USE_GNU
+# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, { 0, 0, 0, 0 }, 0, \
+ { __PTHREAD_SPINS }, { 0, 0 } } }
+# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, { 0, 0, 0, 0 }, 0, \
+ { __PTHREAD_SPINS }, { 0, 0 } } }
+# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, { 0, 0, 0, 0 }, 0, \
+ { __PTHREAD_SPINS }, { 0, 0 } } }
#endif
@@ -130,25 +117,14 @@ enum
# endif
#endif
+
/* Read-write lock initializers. */
# define PTHREAD_RWLOCK_INITIALIZER \
- { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } }
+ { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
# ifdef __USE_GNU
-# ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED
-# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
- { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, \
- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
-# else
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
- { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \
- 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } }
-# else
-# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\
- 0 } }
-# endif
-# endif
+# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+ { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 0, 0, 0 } }
# endif
#endif /* Unix98 or XOpen2K */
@@ -183,9 +159,8 @@ enum
};
-
/* Conditional variable handling. */
-#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }
+#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, {0, 0}, 0, 0, {0, 0} } }
/* Cleanup buffers */
@@ -1161,43 +1136,3 @@ __NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2))
__END_DECLS
#endif /* pthread.h */
-
-#ifndef _PTHREAD_H_HPPA_
-#define _PTHREAD_H_HPPA_ 1
-
-/* The pthread_cond_t initializer is compatible only with NPTL. We do not
- want to be forwards compatible, we eventually want to drop the code
- that has to clear the old LT initializer. */
-#undef PTHREAD_COND_INITIALIZER
-#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, (void *) 0, 0, 0, 0, 0, 0 } }
-
-/* The pthread_mutex_t and pthread_rwlock_t initializers are compatible
- only with NPTL. NPTL assumes pthread_rwlock_t is all zero. */
-#undef PTHREAD_MUTEX_INITIALIZER
-#undef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
-#undef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
-#undef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
-/* Mutex initializers. */
-#define PTHREAD_MUTEX_INITIALIZER \
- { { 0, 0, 0, 0, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } }
-#ifdef __USE_GNU
-# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } }
-# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } }
-# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } }
-#endif
-
-#undef PTHREAD_RWLOCK_INITIALIZER
-#undef PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
-/* Read-write lock initializers. */
-#define PTHREAD_RWLOCK_INITIALIZER \
- { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
-#ifdef __USE_GNU
-# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
- { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\
- 0, 0, 0 } }
-#endif /* Unix98 or XOpen2K */
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/pthread_cond_broadcast.c b/sysdeps/unix/sysv/linux/hppa/pthread_cond_broadcast.c
deleted file mode 100644
index e05c13c898..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/pthread_cond_broadcast.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 INCLUDED_SELF
-# define INCLUDED_SELF
-# include <pthread_cond_broadcast.c>
-#else
-# include <pthread.h>
-# include <pthreadP.h>
-# include <internaltypes.h>
-# include <shlib-compat.h>
-int
-__pthread_cond_broadcast (pthread_cond_t *cond)
-{
- cond_compat_check_and_clear (cond);
- return __pthread_cond_broadcast_internal (cond);
-}
-versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
- GLIBC_2_3_2);
-# undef versioned_symbol
-# define versioned_symbol(lib, local, symbol, version)
-# undef __pthread_cond_broadcast
-# define __pthread_cond_broadcast __pthread_cond_broadcast_internal
-# include_next <pthread_cond_broadcast.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/pthread_cond_destroy.c b/sysdeps/unix/sysv/linux/hppa/pthread_cond_destroy.c
deleted file mode 100644
index a7bab156b4..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/pthread_cond_destroy.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 INCLUDED_SELF
-# define INCLUDED_SELF
-# include <pthread_cond_destroy.c>
-#else
-# include <pthread.h>
-# include <pthreadP.h>
-# include <internaltypes.h>
-# include <shlib-compat.h>
-int
-__pthread_cond_destroy (pthread_cond_t *cond)
-{
- cond_compat_check_and_clear (cond);
- return __pthread_cond_destroy_internal (cond);
-}
-versioned_symbol (libpthread, __pthread_cond_destroy, pthread_cond_destroy,
- GLIBC_2_3_2);
-# undef versioned_symbol
-# define versioned_symbol(lib, local, symbol, version)
-# undef __pthread_cond_destroy
-# define __pthread_cond_destroy __pthread_cond_destroy_internal
-# include_next <pthread_cond_destroy.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/pthread_cond_init.c b/sysdeps/unix/sysv/linux/hppa/pthread_cond_init.c
deleted file mode 100644
index 4a1af81679..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/pthread_cond_init.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 INCLUDED_SELF
-# define INCLUDED_SELF
-# include <pthread_cond_init.c>
-#else
-# include <pthread.h>
-# include <pthreadP.h>
-# include <internaltypes.h>
-# include <shlib-compat.h>
-int
-__pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *cond_attr)
-{
- cond_compat_clear (cond);
- return __pthread_cond_init_internal (cond, cond_attr);
-}
-versioned_symbol (libpthread, __pthread_cond_init, pthread_cond_init,
- GLIBC_2_3_2);
-# undef versioned_symbol
-# define versioned_symbol(lib, local, symbol, version)
-# undef __pthread_cond_init
-# define __pthread_cond_init __pthread_cond_init_internal
-# include_next <pthread_cond_init.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/pthread_cond_signal.c b/sysdeps/unix/sysv/linux/hppa/pthread_cond_signal.c
deleted file mode 100644
index 36b6cbef5e..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/pthread_cond_signal.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 INCLUDED_SELF
-# define INCLUDED_SELF
-# include <pthread_cond_signal.c>
-#else
-# include <pthread.h>
-# include <pthreadP.h>
-# include <internaltypes.h>
-# include <shlib-compat.h>
-int
-__pthread_cond_signal (pthread_cond_t *cond)
-{
- cond_compat_check_and_clear (cond);
- return __pthread_cond_signal_internal (cond);
-}
-versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal,
- GLIBC_2_3_2);
-# undef versioned_symbol
-# define versioned_symbol(lib, local, symbol, version)
-# undef __pthread_cond_signal
-# define __pthread_cond_signal __pthread_cond_signal_internal
-# include_next <pthread_cond_signal.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c b/sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c
deleted file mode 100644
index ec6fd23f58..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 INCLUDED_SELF
-# define INCLUDED_SELF
-# include <pthread_cond_timedwait.c>
-#else
-# include <pthread.h>
-# include <pthreadP.h>
-# include <internaltypes.h>
-# include <shlib-compat.h>
-int
-__pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
- const struct timespec *abstime)
-{
- cond_compat_check_and_clear (cond);
- return __pthread_cond_timedwait_internal (cond, mutex, abstime);
-}
-versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
- GLIBC_2_3_2);
-# undef versioned_symbol
-# define versioned_symbol(lib, local, symbol, version)
-# undef __pthread_cond_timedwait
-# define __pthread_cond_timedwait __pthread_cond_timedwait_internal
-# include_next <pthread_cond_timedwait.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c b/sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c
deleted file mode 100644
index 8f028317c6..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 INCLUDED_SELF
-# define INCLUDED_SELF
-# include <pthread_cond_wait.c>
-#else
-# include <pthread.h>
-# include <pthreadP.h>
-# include <internaltypes.h>
-# include <shlib-compat.h>
-int
-__pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)
-{
- cond_compat_check_and_clear (cond);
- return __pthread_cond_wait_internal (cond, mutex);
-}
-versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
- GLIBC_2_3_2);
-# undef versioned_symbol
-# define versioned_symbol(lib, local, symbol, version)
-# undef __pthread_cond_wait
-# define __pthread_cond_wait __pthread_cond_wait_internal
-# include_next <pthread_cond_wait.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/setcontext.S b/sysdeps/unix/sysv/linux/hppa/setcontext.S
index 78e69baa2d..d5ebc7c4f6 100644
--- a/sysdeps/unix/sysv/linux/hppa/setcontext.S
+++ b/sysdeps/unix/sysv/linux/hppa/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Helge Deller <deller@gmx.de>, 2008.
@@ -25,9 +25,14 @@
ENTRY(__setcontext)
/* Prologue */
+ stw %r2, -20(%sp)
+ .cfi_offset 2, -20
stwm %r3, 64(%sp)
+ .cfi_def_cfa_offset -64
+ .cfi_offset 3, 0
#ifdef PIC
stw %r19, -32(%sp)
+ .cfi_offset 19, 32
#endif
/* Save ucp. */
@@ -38,7 +43,7 @@ ENTRY(__setcontext)
/* sigprocmask(SIG_BLOCK, &ucp->uc_sigmask, NULL); */
copy %r0, %r24
ldo oSIGMASK(%r3), %r25
- bl sigprocmask, %r2
+ bl __sigprocmask, %r2
ldi SIG_SETMASK, %r26
comib,<>,n 0,%ret0,.Lerror
@@ -141,14 +146,14 @@ ENTRY(__setcontext)
/* No further context available. Exit now. */
bl HIDDEN_JUMPTARGET(exit), %r2
- ldi -1, %r26
+ ldi 0, %r26
.Lerror:
/* Epilogue */
ldw -84(%r30), %r2
#ifdef PIC
- ldw -96(%r30), %r19
+ ldw -32(%r30), %r19
#endif
bv %r0(%r2)
ldwm -64(%r30), %r3
diff --git a/sysdeps/unix/sysv/linux/hppa/swapcontext.c b/sysdeps/unix/sysv/linux/hppa/swapcontext.c
index eaa23ebc1f..a026f122c6 100644
--- a/sysdeps/unix/sysv/linux/hppa/swapcontext.c
+++ b/sysdeps/unix/sysv/linux/hppa/swapcontext.c
@@ -1,5 +1,5 @@
/* Swap to new context.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Helge Deller <deller@gmx.de>, 2008.
diff --git a/sysdeps/unix/sysv/linux/hppa/sys/procfs.h b/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
index 7dff51571d..b0a1de2778 100644
--- a/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
index f6fd367bd9..6037227b2a 100644
--- a/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,19 +21,24 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
-#include <bits/sigcontext.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
+#ifdef __USE_MISC
/* Type for general register. */
typedef unsigned long int greg_t;
/* Number of general registers. */
-#define NGREG 80
-#define NFPREG 32
+# define NGREG 80
+# define NFPREG 32
/* Container for all general registers. */
typedef struct gregset
@@ -45,22 +50,33 @@ typedef struct gregset
} gregset_t;
/* Container for all FPU registers. */
-typedef struct fpregset
+typedef struct
{
double fp_dregs[32];
} fpregset_t;
+#endif
/* Context to describe whole processor state. */
-typedef struct sigcontext mcontext_t;
+typedef struct
+ {
+ unsigned long int __ctx(sc_flags);
+ unsigned long int __ctx(sc_gr)[32];
+ unsigned long long int __ctx(sc_fr)[32];
+ unsigned long int __ctx(sc_iasq)[2];
+ unsigned long int __ctx(sc_iaoq)[2];
+ unsigned long int __ctx(sc_sar);
+ } mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
+ sigset_t uc_sigmask;
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/hppa/syscall.c b/sysdeps/unix/sysv/linux/hppa/syscall.c
index 0c25201a40..2dc78ea25d 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscall.c
+++ b/sysdeps/unix/sysv/linux/hppa/syscall.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
index d29c35866d..cd37573b89 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -1,40 +1,16 @@
# File name Caller Syscall name # args Strong name Weak names
-# semaphore and shm system calls
-msgctl - msgctl i:iip __msgctl msgctl
-msgget - msgget i:ii __msgget msgget
-msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
-msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
-shmat - shmat i:ipi __shmat shmat
-shmctl - shmctl i:iip __shmctl shmctl
-shmdt - shmdt i:s __shmdt shmdt
-shmget - shmget i:iii __shmget shmget
-semop - semop i:ipi __semop semop
-semtimedop - semtimedop i:ipip semtimedop
-semget - semget i:iii __semget semget
-semctl - semctl i:iiii __semctl semctl
-
# proper socket implementations:
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
-connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
-recv - recv Ci:ibni __libc_recv __recv recv
-recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom
-recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg
-send - send Ci:ibni __libc_send __send send
-sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg
-sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
socketpair - socketpair i:iiif __socketpair socketpair
-setrlimit - setrlimit i:ip __setrlimit setrlimit
-getrlimit - getrlimit i:ip __getrlimit getrlimit
prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17
fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.19
personality EXTRA personality Ei:i __personality personality
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h b/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h
deleted file mode 100644
index cafc752a2a..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/* Copyright (C) 2005-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>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# ifndef NO_ERROR
-# define NO_ERROR -0x1000
-# endif
-
-/* The syscall cancellation mechanism requires userspace
- assistance, the following code does roughly this:
-
- do arguments (read arg5 and arg6 to registers)
- setup frame
-
- check if there are threads, yes jump to pseudo_cancel
-
- unthreaded:
- syscall
- check syscall return (jump to pre_end)
- set errno
- set return to -1
- (jump to pre_end)
-
- pseudo_cancel:
- cenable
- syscall
- cdisable
- check syscall return (jump to pre_end)
- set errno
- set return to -1
-
- pre_end
- restore stack
-
- It is expected that 'ret' and 'END' macros will
- append an 'undo arguments' and 'return' to the
- this PSEUDO macro. */
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- ENTRY (__##syscall_name##_nocancel) \
- DOARGS_##args ASM_LINE_SEP \
- stwm TREG, 64(%sp) ASM_LINE_SEP \
- .cfi_offset TREG, 0 ASM_LINE_SEP \
- .cfi_adjust_cfa_offset 64 ASM_LINE_SEP \
- stw %sp, -4(%sp) ASM_LINE_SEP \
- .cfi_offset 30, -4 ASM_LINE_SEP \
- stw %r19, -32(%sp) ASM_LINE_SEP \
- .cfi_offset 19, -32 ASM_LINE_SEP \
- /* Save r19 */ ASM_LINE_SEP \
- SAVE_PIC(TREG) ASM_LINE_SEP \
- /* Do syscall, delay loads # */ ASM_LINE_SEP \
- ble 0x100(%sr2,%r0) ASM_LINE_SEP \
- ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \
- ldi NO_ERROR,%r1 ASM_LINE_SEP \
- cmpb,>>=,n %r1,%ret0,L(pre_nc_end) ASM_LINE_SEP \
- /* Restore r19 from TREG */ ASM_LINE_SEP \
- LOAD_PIC(TREG) /* delay */ ASM_LINE_SEP \
- SYSCALL_ERROR_HANDLER ASM_LINE_SEP \
- /* Use TREG for temp storage */ ASM_LINE_SEP \
- copy %ret0, TREG /* delay */ ASM_LINE_SEP \
- /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \
- /* do a -1*syscall_ret0 */ ASM_LINE_SEP \
- sub %r0, TREG, TREG ASM_LINE_SEP \
- /* Store into errno location */ ASM_LINE_SEP \
- stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \
- /* return -1 as error */ ASM_LINE_SEP \
- ldi -1, %ret0 ASM_LINE_SEP \
-L(pre_nc_end): ASM_LINE_SEP \
- /* No need to LOAD_PIC */ ASM_LINE_SEP \
- /* Undo frame */ ASM_LINE_SEP \
- ldwm -64(%sp),TREG ASM_LINE_SEP \
- .cfi_adjust_cfa_offset -64 ASM_LINE_SEP \
- /* Restore rp before exit */ ASM_LINE_SEP \
- ldw -20(%sp), %rp ASM_LINE_SEP \
- .cfi_restore 2 ASM_LINE_SEP \
- ret ASM_LINE_SEP \
- END(__##syscall_name##_nocancel) ASM_LINE_SEP \
- /**********************************************/ASM_LINE_SEP \
- ENTRY (name) \
- DOARGS_##args ASM_LINE_SEP \
- stwm TREG, 64(%sp) ASM_LINE_SEP \
- .cfi_adjust_cfa_offset 64 ASM_LINE_SEP \
- stw %sp, -4(%sp) ASM_LINE_SEP \
- .cfi_offset 30, -4 ASM_LINE_SEP \
- stw %r19, -32(%sp) ASM_LINE_SEP \
- .cfi_offset 19, -32 ASM_LINE_SEP \
- /* Done setting up frame, continue... */ ASM_LINE_SEP \
- SINGLE_THREAD_P ASM_LINE_SEP \
- cmpib,<>,n 0,%ret0,L(pseudo_cancel) ASM_LINE_SEP \
-L(unthreaded): ASM_LINE_SEP \
- /* Save r19 */ ASM_LINE_SEP \
- SAVE_PIC(TREG) ASM_LINE_SEP \
- /* Do syscall, delay loads # */ ASM_LINE_SEP \
- ble 0x100(%sr2,%r0) ASM_LINE_SEP \
- ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \
- ldi NO_ERROR,%r1 ASM_LINE_SEP \
- cmpb,>>=,n %r1,%ret0,L(pre_end) ASM_LINE_SEP \
- /* Restore r19 from TREG */ ASM_LINE_SEP \
- LOAD_PIC(TREG) /* delay */ ASM_LINE_SEP \
- SYSCALL_ERROR_HANDLER ASM_LINE_SEP \
- /* Use TREG for temp storage */ ASM_LINE_SEP \
- copy %ret0, TREG /* delay */ ASM_LINE_SEP \
- /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \
- /* do a -1*syscall_ret0 */ ASM_LINE_SEP \
- sub %r0, TREG, TREG ASM_LINE_SEP \
- /* Store into errno location */ ASM_LINE_SEP \
- stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \
- b L(pre_end) ASM_LINE_SEP \
- /* return -1 as error */ ASM_LINE_SEP \
- ldi -1, %ret0 /* delay */ ASM_LINE_SEP \
-L(pseudo_cancel): ASM_LINE_SEP \
- PUSHARGS_##args /* Save args */ ASM_LINE_SEP \
- /* Save r19 into TREG */ ASM_LINE_SEP \
- CENABLE /* FUNC CALL */ ASM_LINE_SEP \
- SAVE_PIC(TREG) /* delay */ ASM_LINE_SEP \
- /* restore syscall args */ ASM_LINE_SEP \
- POPARGS_##args ASM_LINE_SEP \
- /* save mask from cenable (use stub rp slot) */ ASM_LINE_SEP \
- stw %ret0, -24(%sp) ASM_LINE_SEP \
- /* ... SYSCALL ... */ ASM_LINE_SEP \
- ble 0x100(%sr2,%r0) ASM_LINE_SEP \
- ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \
- /* ............... */ ASM_LINE_SEP \
- LOAD_PIC(TREG) ASM_LINE_SEP \
- /* pass mask as arg0 to cdisable */ ASM_LINE_SEP \
- ldw -24(%sp), %r26 ASM_LINE_SEP \
- CDISABLE ASM_LINE_SEP \
- stw %ret0, -24(%sp) /* delay */ ASM_LINE_SEP \
- /* Restore syscall return */ ASM_LINE_SEP \
- ldw -24(%sp), %ret0 ASM_LINE_SEP \
- /* compare error */ ASM_LINE_SEP \
- ldi NO_ERROR,%r1 ASM_LINE_SEP \
- /* branch if no error */ ASM_LINE_SEP \
- cmpb,>>=,n %r1,%ret0,L(pre_end) ASM_LINE_SEP \
- LOAD_PIC(TREG) /* cond. nullify */ ASM_LINE_SEP \
- copy %ret0, TREG /* save syscall return */ ASM_LINE_SEP \
- SYSCALL_ERROR_HANDLER ASM_LINE_SEP \
- /* make syscall res value positive */ ASM_LINE_SEP \
- sub %r0, TREG, TREG /* delay */ ASM_LINE_SEP \
- /* No need to LOAD_PIC */ ASM_LINE_SEP \
- /* store into errno location */ ASM_LINE_SEP \
- stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \
- /* return -1 */ ASM_LINE_SEP \
- ldi -1, %ret0 ASM_LINE_SEP \
-L(pre_end): ASM_LINE_SEP \
- /* No need to LOAD_PIC */ ASM_LINE_SEP \
- /* Undo frame */ ASM_LINE_SEP \
- ldwm -64(%sp),TREG ASM_LINE_SEP \
- .cfi_adjust_cfa_offset -64 ASM_LINE_SEP \
- /* Restore rp before exit */ ASM_LINE_SEP \
- ldw -20(%sp), %rp ASM_LINE_SEP \
- .cfi_restore 2 ASM_LINE_SEP
-
-/* Save arguments into our frame */
-# define PUSHARGS_0 /* nothing to do */
-# define PUSHARGS_1 PUSHARGS_0 stw %r26, -36(%sr0,%sp) ASM_LINE_SEP \
- .cfi_offset 26, -36 ASM_LINE_SEP
-# define PUSHARGS_2 PUSHARGS_1 stw %r25, -40(%sr0,%sp) ASM_LINE_SEP \
- .cfi_offset 25, -40 ASM_LINE_SEP
-# define PUSHARGS_3 PUSHARGS_2 stw %r24, -44(%sr0,%sp) ASM_LINE_SEP \
- .cfi_offset 24, -44 ASM_LINE_SEP
-# define PUSHARGS_4 PUSHARGS_3 stw %r23, -48(%sr0,%sp) ASM_LINE_SEP \
- .cfi_offset 23, -48 ASM_LINE_SEP
-# define PUSHARGS_5 PUSHARGS_4 stw %r22, -52(%sr0,%sp) ASM_LINE_SEP \
- .cfi_offset 22, -52 ASM_LINE_SEP
-# define PUSHARGS_6 PUSHARGS_5 stw %r21, -56(%sr0,%sp) ASM_LINE_SEP \
- .cfi_offset 21, -56 ASM_LINE_SEP
-
-/* Bring them back from the stack */
-# define POPARGS_0 /* nothing to do */
-# define POPARGS_1 POPARGS_0 ldw -36(%sr0,%sp), %r26 ASM_LINE_SEP \
- .cfi_restore 26 ASM_LINE_SEP
-# define POPARGS_2 POPARGS_1 ldw -40(%sr0,%sp), %r25 ASM_LINE_SEP \
- .cfi_restore 25 ASM_LINE_SEP
-# define POPARGS_3 POPARGS_2 ldw -44(%sr0,%sp), %r24 ASM_LINE_SEP \
- .cfi_restore 24 ASM_LINE_SEP
-# define POPARGS_4 POPARGS_3 ldw -48(%sr0,%sp), %r23 ASM_LINE_SEP \
- .cfi_restore 23 ASM_LINE_SEP
-# define POPARGS_5 POPARGS_4 ldw -52(%sr0,%sp), %r22 ASM_LINE_SEP \
- .cfi_restore 22 ASM_LINE_SEP
-# define POPARGS_6 POPARGS_5 ldw -56(%sr0,%sp), %r21 ASM_LINE_SEP \
- .cfi_restore 21 ASM_LINE_SEP
-
-# if IS_IN (libpthread)
-# ifdef PIC
-# define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \
- bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \
- bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP
-# else
-# define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \
- bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \
- bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP
-# endif
-# elif IS_IN (libc)
-# ifdef PIC
-# define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \
- bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __libc_disable_asynccancel,code ASM_LINE_SEP \
- bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP
-# else
-# define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \
- bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __libc_disable_asynccancel,code ASM_LINE_SEP \
- bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP
-# endif
-# elif IS_IN (librt)
-# ifdef PIC
-# define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \
- bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \
- bl __librt_disable_asynccancel,%r2 ASM_LINE_SEP
-# else
-# define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \
- bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \
- bl __librt_disable_asynccancel,%r2 ASM_LINE_SEP
-# endif
-# else
-# error Unsupported library
-# endif
-
-# if IS_IN (libpthread)
-# define __local_multiple_threads __pthread_multiple_threads
-# elif IS_IN (libc)
-# define __local_multiple_threads __libc_multiple_threads
-# elif IS_IN (librt)
-# define __local_multiple_threads __librt_multiple_threads
-# else
-# error Unsupported library
-# endif
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-/* Read the value of header.multiple_threads from the thread pointer */
-# define SINGLE_THREAD_P \
- mfctl %cr27, %ret0 ASM_LINE_SEP \
- ldw MULTIPLE_THREADS_THREAD_OFFSET(%sr0,%ret0),%ret0 ASM_LINE_SEP
-# endif
-#elif !defined __ASSEMBLER__
-
-/* This code should never be used but we define it anyhow. */
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-/* IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) */
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.c b/sysdeps/unix/sysv/linux/hppa/sysdep.c
index 5418d8f41b..a7df70e034 100644
--- a/sysdeps/unix/sysv/linux/hppa/sysdep.c
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h
index b459f0ad8d..acff4fa626 100644
--- a/sysdeps/unix/sysv/linux/hppa/sysdep.h
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for PA-RISC.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000.
@@ -49,11 +49,9 @@
to another function */
#define TREG 4
#define SAVE_PIC(SREG) \
- copy %r19, SREG ASM_LINE_SEP \
- .cfi_register 19, SREG
+ copy %r19, SREG
#define LOAD_PIC(LREG) \
- copy LREG , %r19 ASM_LINE_SEP \
- .cfi_restore 19
+ copy LREG , %r19
/* Inline assembly defines */
#define TREG_ASM "%r4" /* Cant clobber r3, it holds framemarker */
#define SAVE_ASM_PIC " copy %%r19, %" TREG_ASM "\n"
@@ -292,12 +290,11 @@
#define DO_CALL(syscall_name, args) \
/* Create a frame */ ASM_LINE_SEP \
stwm TREG, 64(%sp) ASM_LINE_SEP \
+ .cfi_def_cfa_offset -64 ASM_LINE_SEP \
.cfi_offset TREG, 0 ASM_LINE_SEP \
- .cfi_adjust_cfa_offset 64 ASM_LINE_SEP \
stw %sp, -4(%sp) ASM_LINE_SEP \
- .cfi_offset 30, -4 ASM_LINE_SEP \
stw %r19, -32(%sp) ASM_LINE_SEP \
- .cfi_offset 19, -32 ASM_LINE_SEP \
+ .cfi_offset 19, 32 ASM_LINE_SEP \
/* Save r19 */ ASM_LINE_SEP \
SAVE_PIC(TREG) ASM_LINE_SEP \
/* Do syscall, delay loads # */ ASM_LINE_SEP \
@@ -320,10 +317,8 @@
L(pre_end): ASM_LINE_SEP \
/* Restore our frame, restoring TREG */ ASM_LINE_SEP \
ldwm -64(%sp), TREG ASM_LINE_SEP \
- .cfi_adjust_cfa_offset -64 ASM_LINE_SEP \
/* Restore return pointer */ ASM_LINE_SEP \
- ldw -20(%sp),%rp ASM_LINE_SEP \
- .cfi_restore 2 ASM_LINE_SEP
+ ldw -20(%sp),%rp ASM_LINE_SEP
/* We do nothing with the return, except hand it back to someone else */
#undef DO_CALL_NOERRNO
@@ -509,4 +504,6 @@ L(pre_end): ASM_LINE_SEP \
#define PTR_MANGLE(var) (void) (var)
#define PTR_DEMANGLE(var) (void) (var)
+#define SINGLE_THREAD_BY_GLOBAL 1
+
#endif /* _LINUX_HPPA_SYSDEP_H */
diff --git a/sysdeps/unix/sysv/linux/hppa/umount.c b/sysdeps/unix/sysv/linux/hppa/umount.c
deleted file mode 100644
index 208fbec994..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/umount.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/mips/mips64/umount.c>
diff --git a/sysdeps/unix/sysv/linux/hppa/utimes.c b/sysdeps/unix/sysv/linux/hppa/utimes.c
index 197a0d2990..04ae0d19a2 100644
--- a/sysdeps/unix/sysv/linux/hppa/utimes.c
+++ b/sysdeps/unix/sysv/linux/hppa/utimes.c
@@ -1,5 +1,5 @@
/* Implement utimes for hppa.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
index 71ba61e9d7..da716e2c1b 100644
--- a/sysdeps/unix/sysv/linux/i386/Makefile
+++ b/sysdeps/unix/sysv/linux/i386/Makefile
@@ -3,38 +3,24 @@ default-abi := 32
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
-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
+tests += tst-bz21269
+$(objpfx)tst-bz21269: $(shared-thread-library)
endif
ifeq ($(subdir),elf)
+sysdep-dl-routines += libc-do-syscall
sysdep-others += lddlibc4
install-bin += lddlibc4
endif
-# fallocate, posix_fallocate use six-argument inline syscalls.
ifeq ($(subdir),io)
sysdep_routines += libc-do-syscall
endif
-# libpthread uses six-argument inline syscalls.
ifeq ($(subdir),nptl)
libpthread-sysdep_routines += libc-do-syscall
-endif
-
-ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64
+libpthread-shared-only-routines += libc-do-syscall
endif
ifeq ($(subdir),stdlib)
@@ -43,14 +29,21 @@ endif
ifeq ($(subdir),csu)
sysdep-dl-routines += sysdep
+ifeq (yes,$(build-shared))
+sysdep_routines += divdi3
+shared-only-routines += divdi3
+CPPFLAGS-divdi3.c = -Din_divdi3_c
+endif
endif
ifeq ($(subdir),nptl)
# pull in __syscall_error routine
libpthread-routines += sysdep
+libpthread-shared-only-routines += sysdep
endif
ifeq ($(subdir),rt)
# pull in __syscall_error routine
librt-routines += sysdep
+librt-shared-only-routines += sysdep
endif
diff --git a/sysdeps/unix/sysv/linux/i386/Versions b/sysdeps/unix/sysv/linux/i386/Versions
index f3544acb75..b59ace48da 100644
--- a/sysdeps/unix/sysv/linux/i386/Versions
+++ b/sysdeps/unix/sysv/linux/i386/Versions
@@ -46,6 +46,6 @@ libc {
fallocate64;
}
GLIBC_PRIVATE {
- __modify_ldt;
+ __modify_ldt; __uname;
}
}
diff --git a/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S b/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
index 5e13ef749a..a7640d9892 100644
--- a/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software 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,9 +17,14 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
+#include <jmp_buf-ssp.h>
#include <asm-syntax.h>
#include <stap-probe.h>
+/* Don't restore shadow stack register if shadow stack isn't enabled. */
+#if !SHSTK_ENABLED
+# undef SHADOW_STACK_POINTER_OFFSET
+#endif
.section .rodata.str1.1,"aMS",@progbits,1
.type longjmp_msg,@object
@@ -33,9 +38,11 @@ longjmp_msg:
cfi_register(%ebx,%ecx); \
LOAD_PIC_REG (bx); \
leal longjmp_msg@GOTOFF(%ebx), %eax; \
+ movl %eax, (%esp); \
call HIDDEN_JUMPTARGET(__fortify_fail)
#else
# define CALL_FAIL movl $longjmp_msg, %eax; \
+ movl %eax, (%esp); \
call HIDDEN_JUMPTARGET(__fortify_fail)
#endif
@@ -44,6 +51,38 @@ longjmp_msg:
ENTRY (____longjmp_chk)
movl 4(%esp), %ecx /* User's jmp_buf in %ecx. */
+#ifdef SHADOW_STACK_POINTER_OFFSET
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+ /* Check if Shadow Stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %gs:FEATURE_1_OFFSET
+ jz L(skip_ssp)
+# else
+ xorl %edx, %edx
+# endif
+ /* Check and adjust the Shadow-Stack-Pointer. */
+ rdsspd %edx
+ /* And compare it with the saved ssp value. */
+ subl SHADOW_STACK_POINTER_OFFSET(%ecx), %edx
+ je L(skip_ssp)
+ /* Count the number of frames to adjust and adjust it
+ with incssp instruction. The instruction can adjust
+ the ssp by [0..255] value only thus use a loop if
+ the number of frames is bigger than 255. */
+ negl %edx
+ shrl $2, %edx
+ /* NB: We saved Shadow-Stack-Pointer of setjmp. Since we are
+ restoring Shadow-Stack-Pointer of setjmp's caller, we
+ need to unwind shadow stack by one more frame. */
+ addl $1, %edx
+ movl $255, %ebx
+L(loop):
+ cmpl %ebx, %edx
+ cmovb %edx, %ebx
+ incsspd %ebx
+ subl %ebx, %edx
+ ja L(loop)
+L(skip_ssp):
+#endif
/* Save the return address now. */
movl (JB_PC*4)(%ecx), %edx
/* Get the stack pointer. */
diff --git a/sysdeps/unix/sysv/linux/i386/_exit.S b/sysdeps/unix/sysv/linux/i386/_exit.S
index e1550e6439..a10eedecc4 100644
--- a/sysdeps/unix/sysv/linux/i386/_exit.S
+++ b/sysdeps/unix/sysv/linux/i386/_exit.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/alphasort64.c b/sysdeps/unix/sysv/linux/i386/alphasort64.c
deleted file mode 100644
index 32a8474ad8..0000000000
--- a/sysdeps/unix/sysv/linux/i386/alphasort64.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 1992-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 <dirent.h>
-#include <string.h>
-
-int
-__alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
-{
- return strcoll ((*a)->d_name, (*b)->d_name);
-}
-
-#include <shlib-compat.h>
-
-versioned_symbol (libc, __alphasort64, alphasort64, GLIBC_2_2);
-
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-
-#include <sysdeps/unix/sysv/linux/i386/olddirent.h>
-
-int
-__old_alphasort64 (const struct __old_dirent64 **a,
- const struct __old_dirent64 **b);
-
-int
-attribute_compat_text_section
-__old_alphasort64 (const struct __old_dirent64 **a,
- const struct __old_dirent64 **b)
-{
- return strcoll ((*a)->d_name, (*b)->d_name);
-}
-
-compat_symbol (libc, __old_alphasort64, alphasort64, GLIBC_2_1);
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/arch-fork.h b/sysdeps/unix/sysv/linux/i386/arch-fork.h
deleted file mode 100644
index 0d4624d558..0000000000
--- a/sysdeps/unix/sysv/linux/i386/arch-fork.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Internal definitions for thread-friendly fork implementation. Linux/i386.
- 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 <sched.h>
-#include <sysdep.h>
-#include <tls.h>
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 5, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \
- NULL, NULL, &THREAD_SELF->tid)
diff --git a/sysdeps/unix/sysv/linux/i386/brk.c b/sysdeps/unix/sysv/linux/i386/brk.c
index 6e55a1bd45..7b8a1a0f6d 100644
--- a/sysdeps/unix/sysv/linux/i386/brk.c
+++ b/sysdeps/unix/sysv/linux/i386/brk.c
@@ -1,5 +1,5 @@
/* brk system call for Linux/i386.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software 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,6 +16,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#if BUILD_PIE_DEFAULT
+/* Can't use "call *%gs:SYSINFO_OFFSET" during statup in static PIE. */
+# define I386_USE_SYSENTER 0
+#endif
+
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>
diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S
index 7d818c1e46..e3b0cf18f7 100644
--- a/sysdeps/unix/sysv/linux/i386/clone.S
+++ b/sysdeps/unix/sysv/linux/i386/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu)
@@ -39,9 +39,6 @@
#define __NR_clone 120
#define SYS_clone 120
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
.text
ENTRY (__clone)
/* Sanity check arguments. */
@@ -108,9 +105,6 @@ L(thread_start):
cfi_undefined (eip);
/* Note: %esi is zero. */
movl %esi,%ebp /* terminate the stack frame */
- testl $CLONE_THREAD, %edi
- je L(newpid)
-L(haspid):
call *%ebx
#ifdef PIC
call L(here)
@@ -122,21 +116,7 @@ L(here):
movl $SYS_ify(exit), %eax
ENTER_KERNEL
- .subsection 2
-L(newpid):
- testl $CLONE_VM, %edi
- movl $-1, %eax
- jne L(nomoregetpid)
- movl $SYS_ify(getpid), %eax
- ENTER_KERNEL
-L(nomoregetpid):
- movl %eax, %gs:PID
- movl %eax, %gs:TID
- jmp L(haspid)
- .previous
- cfi_endproc;
-
- cfi_startproc
PSEUDO_END (__clone)
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/i386/configure b/sysdeps/unix/sysv/linux/i386/configure
index f119e62fc3..0327590486 100644
--- a/sysdeps/unix/sysv/linux/i386/configure
+++ b/sysdeps/unix/sysv/linux/i386/configure
@@ -1,5 +1,44 @@
# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/unix/sysv/linux/i386.
+# Check if CFLAGS allows compiler to use ebp register in inline assembly.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler flags allows ebp in inline assembly" >&5
+$as_echo_n "checking if compiler flags allows ebp in inline assembly... " >&6; }
+if ${libc_cv_can_use_register_asm_ebp+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ void foo (int i)
+ {
+ register int reg asm ("ebp") = i;
+ asm ("# %0" : : "r" (reg));
+ }
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ libc_cv_can_use_register_asm_ebp=yes
+else
+ libc_cv_can_use_register_asm_ebp=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_can_use_register_asm_ebp" >&5
+$as_echo "$libc_cv_can_use_register_asm_ebp" >&6; }
+if test $libc_cv_can_use_register_asm_ebp = yes; then
+ $as_echo "#define CAN_USE_REGISTER_ASM_EBP 1" >>confdefs.h
+
+fi
+
libc_cv_gcc_unwind_find_fde=yes
ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
diff --git a/sysdeps/unix/sysv/linux/i386/configure.ac b/sysdeps/unix/sysv/linux/i386/configure.ac
index 64ab2cc2c8..9e980784bb 100644
--- a/sysdeps/unix/sysv/linux/i386/configure.ac
+++ b/sysdeps/unix/sysv/linux/i386/configure.ac
@@ -1,5 +1,22 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/unix/sysv/linux/i386.
+# Check if CFLAGS allows compiler to use ebp register in inline assembly.
+AC_CACHE_CHECK([if compiler flags allows ebp in inline assembly],
+ libc_cv_can_use_register_asm_ebp, [
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+ void foo (int i)
+ {
+ register int reg asm ("ebp") = i;
+ asm ("# %0" : : "r" (reg));
+ }])],
+ [libc_cv_can_use_register_asm_ebp=yes],
+ [libc_cv_can_use_register_asm_ebp=no])
+])
+if test $libc_cv_can_use_register_asm_ebp = yes; then
+ AC_DEFINE(CAN_USE_REGISTER_ASM_EBP)
+fi
+
libc_cv_gcc_unwind_find_fde=yes
ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
diff --git a/sysdeps/unix/sysv/linux/i386/dl-librecon.h b/sysdeps/unix/sysv/linux/i386/dl-librecon.h
index bd8f515342..d320ea81fc 100644
--- a/sysdeps/unix/sysv/linux/i386/dl-librecon.h
+++ b/sysdeps/unix/sysv/linux/i386/dl-librecon.h
@@ -1,5 +1,5 @@
/* Optional code to distinguish library flavours.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/unix/sysv/linux/i386/dl-procinfo.h b/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
index ed87322e57..b454367b72 100644
--- a/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
@@ -1,5 +1,5 @@
/* Linux/i386 version of processor capability information handling macros.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -17,9 +17,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdeps/i386/dl-procinfo.h>
-#include <ldsodefs.h>
-
+#ifndef _DL_I386_PROCINFO_H
+#define _DL_I386_PROCINFO_H 1
+#include <sysdeps/x86/dl-procinfo.h>
#undef _dl_procinfo
static inline int
@@ -36,7 +36,7 @@ _dl_procinfo (unsigned int type, unsigned long int word)
_dl_printf ("AT_HWCAP: ");
- for (i = 0; i < _DL_HWCAP_COUNT; ++i)
+ for (i = 0; i < 32; ++i)
if (word & (1 << i))
_dl_printf (" %s", GLRO(dl_x86_cap_flags)[i]);
@@ -44,3 +44,4 @@ _dl_procinfo (unsigned int type, unsigned long int word)
return 0;
}
+#endif
diff --git a/sysdeps/unix/sysv/linux/i386/dl-sysdep.h b/sysdeps/unix/sysv/linux/i386/dl-sysdep.h
index a1463e0259..ade0279abc 100644
--- a/sysdeps/unix/sysv/linux/i386/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. i386 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/fcntl.c b/sysdeps/unix/sysv/linux/i386/fcntl.c
deleted file mode 100644
index b96434777b..0000000000
--- a/sysdeps/unix/sysv/linux/i386/fcntl.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Copyright (C) 2000-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 <assert.h>
-#include <errno.h>
-#include <sysdep-cancel.h> /* Must come before <fcntl.h>. */
-#include <fcntl.h>
-#include <stdarg.h>
-
-#include <sys/syscall.h>
-
-#ifndef NO_CANCELLATION
-int
-__fcntl_nocancel (int fd, int cmd, ...)
-{
- va_list ap;
- void *arg;
-
- va_start (ap, cmd);
- arg = va_arg (ap, void *);
- va_end (ap);
-
- return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
-}
-#endif /* NO_CANCELLATION */
-
-
-int
-__libc_fcntl (int fd, int cmd, ...)
-{
- va_list ap;
- void *arg;
-
- va_start (ap, cmd);
- arg = va_arg (ap, void *);
- va_end (ap);
-
- if ((cmd != F_SETLKW) && (cmd != F_SETLKW64))
- return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
-
- return SYSCALL_CANCEL (fcntl64, fd, cmd, arg);
-}
-libc_hidden_def (__libc_fcntl)
-
-weak_alias (__libc_fcntl, __fcntl)
-libc_hidden_weak (__fcntl)
-weak_alias (__libc_fcntl, fcntl)
diff --git a/sysdeps/unix/sysv/linux/i386/fxstat.c b/sysdeps/unix/sysv/linux/i386/fxstat.c
index c1a7613ca7..83917e8495 100644
--- a/sysdeps/unix/sysv/linux/i386/fxstat.c
+++ b/sysdeps/unix/sysv/linux/i386/fxstat.c
@@ -1,5 +1,5 @@
/* fxstat using old-style Unix fstat system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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;
@@ -54,7 +54,7 @@ __fxstat (int vers, int fd, struct stat *buf)
hidden_def (__fxstat)
weak_alias (__fxstat, _fxstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
#undef __fxstat64
strong_alias (__fxstat, __fxstat64);
hidden_ver (__fxstat, __fxstat64)
diff --git a/sysdeps/unix/sysv/linux/i386/fxstatat.c b/sysdeps/unix/sysv/linux/i386/fxstatat.c
index 5f7ac56acc..bcd07fc382 100644
--- a/sysdeps/unix/sysv/linux/i386/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/i386/fxstatat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -49,7 +49,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
return __xstat32_conv (vers, &st64, st);
}
libc_hidden_def (__fxstatat)
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
# undef __fxstatat64
strong_alias (__fxstatat, __fxstatat64);
libc_hidden_ver (__fxstatat, __fxstatat64)
diff --git a/sysdeps/unix/sysv/linux/i386/get_clockfreq.c b/sysdeps/unix/sysv/linux/i386/get_clockfreq.c
index bb0f26a494..633f186be8 100644
--- a/sysdeps/unix/sysv/linux/i386/get_clockfreq.c
+++ b/sysdeps/unix/sysv/linux/i386/get_clockfreq.c
@@ -1,5 +1,5 @@
/* Get frequency of the system processor. i386/Linux version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,8 +20,6 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-#include <libc-internal.h>
-
hp_timing_t
__get_clockfreq (void)
diff --git a/sysdeps/unix/sysv/linux/i386/getcontext.S b/sysdeps/unix/sysv/linux/i386/getcontext.S
index e21cc923f8..26ca08a8c7 100644
--- a/sysdeps/unix/sysv/linux/i386/getcontext.S
+++ b/sysdeps/unix/sysv/linux/i386/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
diff --git a/sysdeps/unix/sysv/linux/i386/getdents64.c b/sysdeps/unix/sysv/linux/i386/getdents64.c
deleted file mode 100644
index aa7ff8fe71..0000000000
--- a/sysdeps/unix/sysv/linux/i386/getdents64.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Copyright (C) 2000-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 __GETDENTS __getdents64
-#define DIRENT_TYPE struct dirent64
-
-#include <sysdeps/unix/sysv/linux/getdents.c>
-
-#include <shlib-compat.h>
-
-#undef __READDIR
-#undef __GETDENTS
-#undef DIRENT_TYPE
-
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-
-#include <sysdeps/unix/sysv/linux/i386/olddirent.h>
-
-#define __GETDENTS __old_getdents64
-#define DIRENT_TYPE struct __old_dirent64
-#define kernel_dirent old_kernel_dirent
-#define kernel_dirent64 old_kernel_dirent64
-
-#include <sysdeps/unix/sysv/linux/getdents.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/getmsg.c b/sysdeps/unix/sysv/linux/i386/getmsg.c
index 87689a95d7..0ae87f2a9e 100644
--- a/sysdeps/unix/sysv/linux/i386/getmsg.c
+++ b/sysdeps/unix/sysv/linux/i386/getmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/getrlimit64.c b/sysdeps/unix/sysv/linux/i386/getrlimit64.c
deleted file mode 100644
index 7f3d227beb..0000000000
--- a/sysdeps/unix/sysv/linux/i386/getrlimit64.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 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/>. */
-
-#define getrlimit64 __new_getrlimit64
-
-#include "../getrlimit64.c"
-
-#undef getrlimit64
-#include <shlib-compat.h>
-versioned_symbol (libc, __getrlimit64, getrlimit64, GLIBC_2_2);
-strong_alias (__getrlimit64, __GI_getrlimit64)
diff --git a/sysdeps/unix/sysv/linux/i386/gettimeofday.c b/sysdeps/unix/sysv/linux/i386/gettimeofday.c
index 965bb81a4b..6f561ffe39 100644
--- a/sysdeps/unix/sysv/linux/i386/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/i386/gettimeofday.c
@@ -1,5 +1,5 @@
/* gettimeofday - get the time. Linux/i386 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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/glob64.c b/sysdeps/unix/sysv/linux/i386/glob64.c
deleted file mode 100644
index b4fcd1a73c..0000000000
--- a/sysdeps/unix/sysv/linux/i386/glob64.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <dirent.h>
-#include <glob.h>
-#include <sys/stat.h>
-
-#define dirent dirent64
-#define __readdir(dirp) __readdir64 (dirp)
-
-#define glob_t glob64_t
-#define glob(pattern, flags, errfunc, pglob) \
- __glob64 (pattern, flags, errfunc, pglob)
-#define globfree(pglob) globfree64 (pglob)
-
-#undef stat
-#define stat stat64
-#undef __stat
-#define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
-
-#define NO_GLOB_PATTERN_P 1
-
-#define COMPILE_GLOB64 1
-
-#include <posix/glob.c>
-
-#include "shlib-compat.h"
-
-libc_hidden_def (globfree64)
-
-versioned_symbol (libc, __glob64, glob64, GLIBC_2_2);
-libc_hidden_ver (__glob64, glob64)
-
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-
-#include <sysdeps/unix/sysv/linux/i386/olddirent.h>
-
-int __old_glob64 (const char *__pattern, int __flags,
- int (*__errfunc) (const char *, int),
- glob64_t *__pglob);
-
-#undef dirent
-#define dirent __old_dirent64
-#undef __readdir
-#define __readdir(dirp) __old_readdir64 (dirp)
-#undef glob
-#define glob(pattern, flags, errfunc, pglob) \
- __old_glob64 (pattern, flags, errfunc, pglob)
-#define glob_in_dir __old_glob_in_dir
-#define GLOB_ATTRIBUTE attribute_compat_text_section
-
-#define GLOB_ONLY_P 1
-
-#include <posix/glob.c>
-
-compat_symbol (libc, __old_glob64, glob64, GLIBC_2_1);
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h b/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
index 6da9aa6f8e..83de2f5040 100644
--- a/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. IA-32 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S b/sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S
deleted file mode 100644
index f697e5bd06..0000000000
--- a/sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* 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.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 HAVE_CMOV 1
-#include "../pthread_cond_timedwait.S"
diff --git a/sysdeps/unix/sysv/linux/i386/init-first.c b/sysdeps/unix/sysv/linux/i386/init-first.c
index 3b1250f9ee..82ac7f5cf2 100644
--- a/sysdeps/unix/sysv/linux/i386/init-first.c
+++ b/sysdeps/unix/sysv/linux/i386/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. Linux/i386.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h
new file mode 100644
index 0000000000..554bbed309
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 156
+#define SIGJMP_BUF_SIZE 156
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 24
+#define SAVED_MASK_OFFSET 28
diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h
index 4f5e0a4cc9..f3cfd48c44 100644
--- a/sysdeps/unix/sysv/linux/i386/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number. i386 version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,38 +20,34 @@
/* i386 uses socketcall. */
#define __ASSUME_SOCKETCALL 1
-/* The recvmmsg syscall was added for i386 in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
-#define __ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL 1
-
-/* The sendmmsg syscall was added for i386 in 3.0. */
-#if __LINUX_KERNEL_VERSION >= 0x030000
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
-#define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL 1
-
/* Direct socketcalls available with kernel 4.3. */
#if __LINUX_KERNEL_VERSION >= 0x040300
# define __ASSUME_SOCKET_SYSCALL 1
# define __ASSUME_SOCKETPAIR_SYSCALL 1
# define __ASSUME_BIND_SYSCALL 1
-# define __ASSUME_CONNECT_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT4_SYSCALL 1
-# define __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL 1
# define __ASSUME_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
# define __ASSUME_GETPEERNAME_SYSCALL 1
-# define __ASSUME_SENDTO_SYSCALL 1
-# define __ASSUME_SENDTO_FOR_SEND_SYSCALL 1
-# define __ASSUME_SENDMSG_SYSCALL 1
-# define __ASSUME_RECVFROM_SYSCALL 1
-# define __ASSUME_RECVFROM_FOR_RECV_SYSCALL 1
-# define __ASSUME_RECVMSG_SYSCALL 1
# define __ASSUME_SHUTDOWN_SYSCALL 1
#endif
#include_next <kernel-features.h>
+
+#undef __ASSUME_ACCEPT_SYSCALL
+
+#if __LINUX_KERNEL_VERSION < 0x040300
+# undef __ASSUME_ACCEPT4_SYSCALL
+# undef __ASSUME_SENDMSG_SYSCALL
+# undef __ASSUME_RECVMSG_SYSCALL
+# undef __ASSUME_CONNECT_SYSCALL
+# undef __ASSUME_RECVFROM_SYSCALL
+# undef __ASSUME_SENDTO_SYSCALL
+#endif
+
+/* i686 only supports ipc syscall. */
+#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
diff --git a/sysdeps/unix/sysv/linux/i386/ld.abilist b/sysdeps/unix/sysv/linux/i386/ld.abilist
index b8914ed642..edb7307228 100644
--- a/sysdeps/unix/sysv/linux/i386/ld.abilist
+++ b/sysdeps/unix/sysv/linux/i386/ld.abilist
@@ -1,14 +1,9 @@
-GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
GLIBC_2.0 _r_debug D 0x14
GLIBC_2.0 calloc F
GLIBC_2.0 free F
GLIBC_2.0 malloc F
GLIBC_2.0 realloc F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_stack_end D 0x4
GLIBC_2.1 _dl_mcount F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 ___tls_get_addr F
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/i386/ldconfig.h b/sysdeps/unix/sysv/linux/i386/ldconfig.h
index a363e828d6..ad8f826509 100644
--- a/sysdeps/unix/sysv/linux/i386/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/i386/ldconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/i386/libBrokenLocale.abilist
index 4a56bb68a3..54395f3c8d 100644
--- a/sysdeps/unix/sysv/linux/i386/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/i386/libanl.abilist b/sysdeps/unix/sysv/linux/i386/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/i386/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/i386/libc-do-syscall.S b/sysdeps/unix/sysv/linux/i386/libc-do-syscall.S
index 92ca0fca74..35aac82cc8 100644
--- a/sysdeps/unix/sysv/linux/i386/libc-do-syscall.S
+++ b/sysdeps/unix/sysv/linux/i386/libc-do-syscall.S
@@ -1,5 +1,5 @@
/* Out-of-line syscall stub for six-argument syscalls from C.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/libc-lowlevellock.S b/sysdeps/unix/sysv/linux/i386/libc-lowlevellock.S
index 575d064f1f..a1ddaaf77a 100644
--- a/sysdeps/unix/sysv/linux/i386/libc-lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/i386/libc-lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 8f3502dfdb..9762c81365 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -1316,7 +1314,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 _IO_2_1_stderr_ D 0x98
GLIBC_2.1 _IO_2_1_stdin_ D 0x98
GLIBC_2.1 _IO_2_1_stdout_ D 0x98
@@ -1622,7 +1619,6 @@ GLIBC_2.1 xdr_uint16_t F
GLIBC_2.1 xdr_uint32_t F
GLIBC_2.1 xdr_uint8_t F
GLIBC_2.1 xdr_unixcred F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 _Exit F
GLIBC_2.1.1 __memcpy_by2 F
GLIBC_2.1.1 __memcpy_by4 F
@@ -1692,7 +1688,6 @@ GLIBC_2.1.1 xdr_longlong_t F
GLIBC_2.1.1 xdr_u_hyper F
GLIBC_2.1.1 xdr_u_longlong_t F
GLIBC_2.1.1 xdr_uint64_t F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
GLIBC_2.1.2 getaliasbyname_r F
GLIBC_2.1.2 getaliasent_r F
@@ -1720,11 +1715,9 @@ GLIBC_2.1.2 getservbyport_r F
GLIBC_2.1.2 getservent_r F
GLIBC_2.1.2 getspent_r F
GLIBC_2.1.2 getspnam_r F
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 __cxa_atexit F
GLIBC_2.1.3 __cxa_finalize F
GLIBC_2.1.3 __sigsuspend F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1750,7 +1743,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -1758,27 +1750,23 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x21c
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x21c
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 __fentry__ F
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1787,7 +1775,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -1798,16 +1785,13 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_adjust_wcolumn F
GLIBC_2.2 _IO_fgetpos F
GLIBC_2.2 _IO_fgetpos64 F
@@ -1984,33 +1968,83 @@ GLIBC_2.2 wcsftime F
GLIBC_2.2 wmempcpy F
GLIBC_2.2 wprintf F
GLIBC_2.2 wscanf F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 __strtof128_internal F
+GLIBC_2.26 __wcstof128_internal F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.26 strfromf128 F
+GLIBC_2.26 strtof128 F
+GLIBC_2.26 strtof128_l F
+GLIBC_2.26 wcstof128 F
+GLIBC_2.26 wcstof128_l F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2104,7 +2138,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2117,7 +2150,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x104
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2138,7 +2170,6 @@ GLIBC_2.3.3 sched_setaffinity F
GLIBC_2.3.3 semtimedop F
GLIBC_2.3.3 sys_sigabbrev D 0x104
GLIBC_2.3.3 sys_siglist D 0x104
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2169,7 +2200,6 @@ GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 vm86 F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2246,7 +2276,6 @@ GLIBC_2.4 sys_errlist D 0x210
GLIBC_2.4 sys_nerr D 0x4
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2264,7 +2293,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2272,7 +2300,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2299,7 +2326,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2310,7 +2336,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/i386/libcrypt.abilist b/sysdeps/unix/sysv/linux/i386/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/i386/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/i386/libdl.abilist b/sysdeps/unix/sysv/linux/i386/libdl.abilist
index 5536f6e0a9..7826fde951 100644
--- a/sysdeps/unix/sysv/linux/i386/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 dlopen F
GLIBC_2.1 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/i386/libm.abilist b/sysdeps/unix/sysv/linux/i386/libm.abilist
index 78b542e935..3110c1f4fa 100644
--- a/sysdeps/unix/sysv/linux/i386/libm.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _LIB_VERSION D 0x4
GLIBC_2.0 acos F
GLIBC_2.0 acosf F
@@ -155,7 +154,6 @@ GLIBC_2.0 y1l F
GLIBC_2.0 yn F
GLIBC_2.0 ynf F
GLIBC_2.0 ynl F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __clog10 F
GLIBC_2.1 __clog10f F
GLIBC_2.1 __clog10l F
@@ -311,7 +309,6 @@ GLIBC_2.1 tgammal F
GLIBC_2.1 trunc F
GLIBC_2.1 truncf F
GLIBC_2.1 truncl F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -393,11 +390,9 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __expl F
GLIBC_2.2 __expm1l F
GLIBC_2.2 feclearexcept F
@@ -410,9 +405,673 @@ GLIBC_2.2 feraiseexcept F
GLIBC_2.2 fesetenv F
GLIBC_2.2 fesetexceptflag F
GLIBC_2.2 feupdateenv F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.26 __acosf128_finite F
+GLIBC_2.26 __acoshf128_finite F
+GLIBC_2.26 __asinf128_finite F
+GLIBC_2.26 __atan2f128_finite F
+GLIBC_2.26 __atanhf128_finite F
+GLIBC_2.26 __coshf128_finite F
+GLIBC_2.26 __exp10f128_finite F
+GLIBC_2.26 __exp2f128_finite F
+GLIBC_2.26 __expf128_finite F
+GLIBC_2.26 __finitef128 F
+GLIBC_2.26 __fmodf128_finite F
+GLIBC_2.26 __fpclassifyf128 F
+GLIBC_2.26 __gammaf128_r_finite F
+GLIBC_2.26 __hypotf128_finite F
+GLIBC_2.26 __iseqsigf128 F
+GLIBC_2.26 __isinff128 F
+GLIBC_2.26 __isnanf128 F
+GLIBC_2.26 __issignalingf128 F
+GLIBC_2.26 __j0f128_finite F
+GLIBC_2.26 __j1f128_finite F
+GLIBC_2.26 __jnf128_finite F
+GLIBC_2.26 __lgammaf128_r_finite F
+GLIBC_2.26 __log10f128_finite F
+GLIBC_2.26 __log2f128_finite F
+GLIBC_2.26 __logf128_finite F
+GLIBC_2.26 __powf128_finite F
+GLIBC_2.26 __remainderf128_finite F
+GLIBC_2.26 __signbitf128 F
+GLIBC_2.26 __sinhf128_finite F
+GLIBC_2.26 __sqrtf128_finite F
+GLIBC_2.26 __y0f128_finite F
+GLIBC_2.26 __y1f128_finite F
+GLIBC_2.26 __ynf128_finite F
+GLIBC_2.26 acosf128 F
+GLIBC_2.26 acoshf128 F
+GLIBC_2.26 asinf128 F
+GLIBC_2.26 asinhf128 F
+GLIBC_2.26 atan2f128 F
+GLIBC_2.26 atanf128 F
+GLIBC_2.26 atanhf128 F
+GLIBC_2.26 cabsf128 F
+GLIBC_2.26 cacosf128 F
+GLIBC_2.26 cacoshf128 F
+GLIBC_2.26 canonicalizef128 F
+GLIBC_2.26 cargf128 F
+GLIBC_2.26 casinf128 F
+GLIBC_2.26 casinhf128 F
+GLIBC_2.26 catanf128 F
+GLIBC_2.26 catanhf128 F
+GLIBC_2.26 cbrtf128 F
+GLIBC_2.26 ccosf128 F
+GLIBC_2.26 ccoshf128 F
+GLIBC_2.26 ceilf128 F
+GLIBC_2.26 cexpf128 F
+GLIBC_2.26 cimagf128 F
+GLIBC_2.26 clog10f128 F
+GLIBC_2.26 clogf128 F
+GLIBC_2.26 conjf128 F
+GLIBC_2.26 copysignf128 F
+GLIBC_2.26 cosf128 F
+GLIBC_2.26 coshf128 F
+GLIBC_2.26 cpowf128 F
+GLIBC_2.26 cprojf128 F
+GLIBC_2.26 crealf128 F
+GLIBC_2.26 csinf128 F
+GLIBC_2.26 csinhf128 F
+GLIBC_2.26 csqrtf128 F
+GLIBC_2.26 ctanf128 F
+GLIBC_2.26 ctanhf128 F
+GLIBC_2.26 erfcf128 F
+GLIBC_2.26 erff128 F
+GLIBC_2.26 exp10f128 F
+GLIBC_2.26 exp2f128 F
+GLIBC_2.26 expf128 F
+GLIBC_2.26 expm1f128 F
+GLIBC_2.26 fabsf128 F
+GLIBC_2.26 fdimf128 F
+GLIBC_2.26 floorf128 F
+GLIBC_2.26 fmaf128 F
+GLIBC_2.26 fmaxf128 F
+GLIBC_2.26 fmaxmagf128 F
+GLIBC_2.26 fminf128 F
+GLIBC_2.26 fminmagf128 F
+GLIBC_2.26 fmodf128 F
+GLIBC_2.26 frexpf128 F
+GLIBC_2.26 fromfpf128 F
+GLIBC_2.26 fromfpxf128 F
+GLIBC_2.26 getpayloadf128 F
+GLIBC_2.26 hypotf128 F
+GLIBC_2.26 ilogbf128 F
+GLIBC_2.26 j0f128 F
+GLIBC_2.26 j1f128 F
+GLIBC_2.26 jnf128 F
+GLIBC_2.26 ldexpf128 F
+GLIBC_2.26 lgammaf128 F
+GLIBC_2.26 lgammaf128_r F
+GLIBC_2.26 llogbf128 F
+GLIBC_2.26 llrintf128 F
+GLIBC_2.26 llroundf128 F
+GLIBC_2.26 log10f128 F
+GLIBC_2.26 log1pf128 F
+GLIBC_2.26 log2f128 F
+GLIBC_2.26 logbf128 F
+GLIBC_2.26 logf128 F
+GLIBC_2.26 lrintf128 F
+GLIBC_2.26 lroundf128 F
+GLIBC_2.26 modff128 F
+GLIBC_2.26 nanf128 F
+GLIBC_2.26 nearbyintf128 F
+GLIBC_2.26 nextafterf128 F
+GLIBC_2.26 nextdownf128 F
+GLIBC_2.26 nextupf128 F
+GLIBC_2.26 powf128 F
+GLIBC_2.26 remainderf128 F
+GLIBC_2.26 remquof128 F
+GLIBC_2.26 rintf128 F
+GLIBC_2.26 roundevenf128 F
+GLIBC_2.26 roundf128 F
+GLIBC_2.26 scalblnf128 F
+GLIBC_2.26 scalbnf128 F
+GLIBC_2.26 setpayloadf128 F
+GLIBC_2.26 setpayloadsigf128 F
+GLIBC_2.26 sincosf128 F
+GLIBC_2.26 sinf128 F
+GLIBC_2.26 sinhf128 F
+GLIBC_2.26 sqrtf128 F
+GLIBC_2.26 tanf128 F
+GLIBC_2.26 tanhf128 F
+GLIBC_2.26 tgammaf128 F
+GLIBC_2.26 totalorderf128 F
+GLIBC_2.26 totalordermagf128 F
+GLIBC_2.26 truncf128 F
+GLIBC_2.26 ufromfpf128 F
+GLIBC_2.26 ufromfpxf128 F
+GLIBC_2.26 y0f128 F
+GLIBC_2.26 y1f128 F
+GLIBC_2.26 ynf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/i386/libnsl.abilist b/sysdeps/unix/sysv/linux/i386/libnsl.abilist
index a23db2aeaf..add3d66a7a 100644
--- a/sysdeps/unix/sysv/linux/i386/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __free_fdresult F
GLIBC_2.1 __nis_default_access F
GLIBC_2.1 __nis_default_group F
@@ -120,5 +118,4 @@ GLIBC_2.1 readColdStartFile F
GLIBC_2.1 writeColdStartFile F
GLIBC_2.1 xdr_cback_data F
GLIBC_2.1 xdr_obj_p F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 xdr_ypall F
diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
index 8f9c3254be..bece86d246 100644
--- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_flockfile F
GLIBC_2.0 _IO_ftrylockfile F
GLIBC_2.0 _IO_funlockfile F
@@ -119,7 +118,6 @@ GLIBC_2.0 vfork F
GLIBC_2.0 wait F
GLIBC_2.0 waitpid F
GLIBC_2.0 write F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_allocate_rtsig F
GLIBC_2.1 __libc_current_sigrtmax F
GLIBC_2.1 __libc_current_sigrtmin F
@@ -154,24 +152,18 @@ GLIBC_2.1 sem_init F
GLIBC_2.1 sem_post F
GLIBC_2.1 sem_trywait F
GLIBC_2.1 sem_wait F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 sem_close F
GLIBC_2.1.1 sem_open F
GLIBC_2.1.1 sem_unlink F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __open64 F
GLIBC_2.2 __pread64 F
GLIBC_2.2 __pthread_rwlock_destroy F
@@ -212,18 +204,35 @@ GLIBC_2.2 pthread_yield F
GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -239,13 +248,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/i386/libresolv.abilist b/sysdeps/unix/sysv/linux/i386/libresolv.abilist
index 4d50e7c8c6..157a33ce35 100644
--- a/sysdeps/unix/sysv/linux/i386/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/i386/librt.abilist b/sysdeps/unix/sysv/linux/i386/librt.abilist
index 15e4418863..595f1b712a 100644
--- a/sysdeps/unix/sysv/linux/i386/librt.abilist
+++ b/sysdeps/unix/sysv/linux/i386/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 aio_cancel F
GLIBC_2.1 aio_cancel64 F
GLIBC_2.1 aio_error F
@@ -16,7 +15,6 @@ GLIBC_2.1 aio_write F
GLIBC_2.1 aio_write64 F
GLIBC_2.1 lio_listio F
GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 clock_getcpuclockid F
GLIBC_2.2 clock_getres F
GLIBC_2.2 clock_gettime F
@@ -29,7 +27,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -40,8 +37,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/i386/libthread_db.abilist b/sysdeps/unix/sysv/linux/i386/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/i386/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/i386/libutil.abilist b/sysdeps/unix/sysv/linux/i386/libutil.abilist
index 89c67755c4..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/i386/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
diff --git a/sysdeps/unix/sysv/linux/i386/localplt.data b/sysdeps/unix/sysv/linux/i386/localplt.data
index 4ce8447673..f6f20a5d15 100644
--- a/sysdeps/unix/sysv/linux/i386/localplt.data
+++ b/sysdeps/unix/sysv/linux/i386/localplt.data
@@ -6,12 +6,15 @@ libc.so: free + REL R_386_GLOB_DAT
libc.so: malloc + REL R_386_GLOB_DAT
libc.so: memalign + REL R_386_GLOB_DAT
libc.so: realloc + REL R_386_GLOB_DAT
-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 + REL R_386_GLOB_DAT
+libm.so: matherr + REL R_386_GLOB_DAT
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc + REL R_386_GLOB_DAT
ld.so: calloc + REL R_386_GLOB_DAT
ld.so: realloc + REL R_386_GLOB_DAT
ld.so: free + REL R_386_GLOB_DAT
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error + REL R_386_GLOB_DAT
+ld.so: _dl_catch_error + REL R_386_GLOB_DAT
+ld.so: _dl_signal_exception + REL R_386_GLOB_DAT
+ld.so: _dl_catch_exception + REL R_386_GLOB_DAT
diff --git a/sysdeps/unix/sysv/linux/i386/lockf64.c b/sysdeps/unix/sysv/linux/i386/lockf64.c
index 9acdb2d13b..8a17c13cbe 100644
--- a/sysdeps/unix/sysv/linux/i386/lockf64.c
+++ b/sysdeps/unix/sysv/linux/i386/lockf64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/lowlevellock.S b/sysdeps/unix/sysv/linux/i386/lowlevellock.S
index c1d4c96827..feda390eeb 100644
--- a/sysdeps/unix/sysv/linux/i386/lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/i386/lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -25,48 +25,16 @@
.text
-#ifdef __ASSUME_PRIVATE_FUTEX
-# define LOAD_PRIVATE_FUTEX_WAIT(reg) \
+#define LOAD_PRIVATE_FUTEX_WAIT(reg) \
movl $(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
-# define LOAD_PRIVATE_FUTEX_WAKE(reg) \
+#define LOAD_PRIVATE_FUTEX_WAKE(reg) \
movl $(FUTEX_WAKE | FUTEX_PRIVATE_FLAG), reg
-# define LOAD_FUTEX_WAIT(reg) \
+#define LOAD_FUTEX_WAIT(reg) \
xorl $(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
-# define LOAD_FUTEX_WAIT_ABS(reg) \
+#define LOAD_FUTEX_WAIT_ABS(reg) \
xorl $(FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME), reg
-# define LOAD_FUTEX_WAKE(reg) \
+#define LOAD_FUTEX_WAKE(reg) \
xorl $(FUTEX_WAKE | FUTEX_PRIVATE_FLAG), reg
-#else
-# if FUTEX_WAIT == 0
-# define LOAD_PRIVATE_FUTEX_WAIT(reg) \
- movl %gs:PRIVATE_FUTEX, reg
-# else
-# define LOAD_PRIVATE_FUTEX_WAIT(reg) \
- movl %gs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAIT, reg
-# endif
-# define LOAD_PRIVATE_FUTEX_WAKE(reg) \
- movl %gs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAKE, reg
-# if FUTEX_WAIT == 0
-# define LOAD_FUTEX_WAIT(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %gs:PRIVATE_FUTEX, reg
-# else
-# define LOAD_FUTEX_WAIT(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %gs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAIT, reg
-# endif
-# define LOAD_FUTEX_WAIT_ABS(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %gs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, reg
-# define LOAD_FUTEX_WAKE(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %gs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAKE, reg
-#endif
.globl __lll_lock_wait_private
.type __lll_lock_wait_private,@function
diff --git a/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/sysdeps/unix/sysv/linux/i386/lowlevellock.h
index 7ae32196a5..38fbc2556f 100644
--- a/sysdeps/unix/sysv/linux/i386/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/i386/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -26,7 +26,14 @@
# include <sys/param.h>
# include <bits/pthreadtypes.h>
# include <kernel-features.h>
-# include <tcb-offsets.h>
+/* <tcb-offsets.h> is generated from tcb-offsets.sym to define offsets
+ and sizes of types in <tls.h> as well as <pthread.h> which includes
+ <lowlevellock.h> via nptl/descr.h. Don't include <tcb-offsets.h>
+ when generating <tcb-offsets.h> to avoid circular dependency which
+ may lead to build hang on a many-core machine. */
+# ifndef GEN_AS_CONST_HEADERS
+# include <tcb-offsets.h>
+# endif
# ifndef LOCK_INSTR
# ifdef UP
@@ -132,20 +139,6 @@
} \
})
-#define lll_robust_lock(futex, id, private) \
- ({ int result, ignore1, ignore2; \
- __asm __volatile (LOCK_INSTR "cmpxchgl %1, %2\n\t" \
- "jz 18f\n\t" \
- "1:\tleal %2, %%edx\n" \
- "0:\tmovl %7, %%ecx\n" \
- "2:\tcall __lll_robust_lock_wait\n" \
- "18:" \
- : "=a" (result), "=c" (ignore1), "=m" (futex), \
- "=&d" (ignore2) \
- : "0" (0), "1" (id), "m" (futex), "g" ((int) (private))\
- : "memory"); \
- result; })
-
/* Special version of lll_lock which causes the unlock function to
always wakeup waiters. */
@@ -165,22 +158,6 @@
})
-#define lll_robust_cond_lock(futex, id, private) \
- ({ int result, ignore1, ignore2; \
- __asm __volatile (LOCK_INSTR "cmpxchgl %1, %2\n\t" \
- "jz 18f\n\t" \
- "1:\tleal %2, %%edx\n" \
- "0:\tmovl %7, %%ecx\n" \
- "2:\tcall __lll_robust_lock_wait\n" \
- "18:" \
- : "=a" (result), "=c" (ignore1), "=m" (futex), \
- "=&d" (ignore2) \
- : "0" (0), "1" (id | FUTEX_WAITERS), "m" (futex), \
- "g" ((int) (private)) \
- : "memory"); \
- result; })
-
-
#define lll_timedlock(futex, timeout, private) \
({ int result, ignore1, ignore2, ignore3; \
__asm __volatile (LOCK_INSTR "cmpxchgl %1, %3\n\t" \
@@ -203,21 +180,6 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
#define lll_timedlock_elision(futex, adapt_count, timeout, private) \
__lll_timedlock_elision(&(futex), &(adapt_count), timeout, private)
-#define lll_robust_timedlock(futex, timeout, id, private) \
- ({ int result, ignore1, ignore2, ignore3; \
- __asm __volatile (LOCK_INSTR "cmpxchgl %1, %3\n\t" \
- "jz 18f\n\t" \
- "1:\tleal %3, %%ecx\n" \
- "0:\tmovl %8, %%edx\n" \
- "2:\tcall __lll_robust_timedlock_wait\n" \
- "18:" \
- : "=a" (result), "=c" (ignore1), "=&d" (ignore2), \
- "=m" (futex), "=S" (ignore3) \
- : "0" (0), "1" (id), "m" (futex), "m" (timeout), \
- "4" ((int) (private)) \
- : "memory"); \
- result; })
-
#if !IS_IN (libc) || defined UP
# define __lll_unlock_asm LOCK_INSTR "subl $1, %0\n\t"
#else
@@ -255,21 +217,6 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
} \
})
-#define lll_robust_unlock(futex, private) \
- (void) \
- ({ int ignore, ignore2; \
- __asm __volatile (LOCK_INSTR "andl %3, %0\n\t" \
- "je 18f\n\t" \
- "1:\tleal %0, %%eax\n" \
- "0:\tmovl %5, %%ecx\n" \
- "2:\tcall __lll_unlock_wake\n" \
- "18:" \
- : "=m" (futex), "=&a" (ignore), "=&c" (ignore2) \
- : "i" (FUTEX_WAITERS), "m" (futex), \
- "g" ((int) (private)) \
- : "memory"); \
- })
-
#define lll_islocked(futex) \
(futex != LLL_LOCK_INITIALIZER)
@@ -297,12 +244,7 @@ extern int __lll_timedwait_tid (int *tid, const struct timespec *abstime)
({ \
int __result = 0; \
if ((tid) != 0) \
- { \
- if ((abstime)->tv_nsec < 0 || (abstime)->tv_nsec >= 1000000000) \
- __result = EINVAL; \
- else \
- __result = __lll_timedwait_tid (&(tid), (abstime)); \
- } \
+ __result = __lll_timedwait_tid (&(tid), (abstime)); \
__result; })
diff --git a/sysdeps/unix/sysv/linux/i386/lowlevelrobustlock.S b/sysdeps/unix/sysv/linux/i386/lowlevelrobustlock.S
deleted file mode 100644
index fd96b1a771..0000000000
--- a/sysdeps/unix/sysv/linux/i386/lowlevelrobustlock.S
+++ /dev/null
@@ -1,232 +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 <sysdep.h>
-#include <pthread-errnos.h>
-#include <lowlevellock.h>
-#include <lowlevelrobustlock.h>
-#include <kernel-features.h>
-
- .text
-
-#define FUTEX_WAITERS 0x80000000
-#define FUTEX_OWNER_DIED 0x40000000
-
-#ifdef __ASSUME_PRIVATE_FUTEX
-# define LOAD_FUTEX_WAIT(reg) \
- xorl $(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
-#else
-# if FUTEX_WAIT == 0
-# define LOAD_FUTEX_WAIT(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %gs:PRIVATE_FUTEX, reg
-# else
-# define LOAD_FUTEX_WAIT(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %gs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAIT, reg
-# endif
-#endif
-
- .globl __lll_robust_lock_wait
- .type __lll_robust_lock_wait,@function
- .hidden __lll_robust_lock_wait
- .align 16
-__lll_robust_lock_wait:
- cfi_startproc
- pushl %edx
- cfi_adjust_cfa_offset(4)
- pushl %ebx
- cfi_adjust_cfa_offset(4)
- pushl %esi
- cfi_adjust_cfa_offset(4)
- cfi_offset(%edx, -8)
- cfi_offset(%ebx, -12)
- cfi_offset(%esi, -16)
-
- movl %edx, %ebx
- xorl %esi, %esi /* No timeout. */
- LOAD_FUTEX_WAIT (%ecx)
-
-4: movl %eax, %edx
- orl $FUTEX_WAITERS, %edx
-
- testl $FUTEX_OWNER_DIED, %eax
- jnz 3f
-
- cmpl %edx, %eax /* NB: %edx == 2 */
- je 1f
-
- LOCK
- cmpxchgl %edx, (%ebx)
- jnz 2f
-
-1: movl $SYS_futex, %eax
- ENTER_KERNEL
-
- movl (%ebx), %eax
-
-2: test %eax, %eax
- jne 4b
-
- movl %gs:TID, %edx
- orl $FUTEX_WAITERS, %edx
- LOCK
- cmpxchgl %edx, (%ebx)
- jnz 4b
- /* NB: %eax == 0 */
-
-3: popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
- popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
- popl %edx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edx)
- ret
- cfi_endproc
- .size __lll_robust_lock_wait,.-__lll_robust_lock_wait
-
-
- .globl __lll_robust_timedlock_wait
- .type __lll_robust_timedlock_wait,@function
- .hidden __lll_robust_timedlock_wait
- .align 16
-__lll_robust_timedlock_wait:
- cfi_startproc
- /* Check for a valid timeout value. */
- cmpl $1000000000, 4(%edx)
- jae 3f
-
- pushl %edi
- cfi_adjust_cfa_offset(4)
- pushl %esi
- cfi_adjust_cfa_offset(4)
- pushl %ebx
- cfi_adjust_cfa_offset(4)
- pushl %ebp
- cfi_adjust_cfa_offset(4)
- cfi_offset(%edi, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%ebx, -16)
- cfi_offset(%ebp, -20)
-
- /* Stack frame for the timespec and timeval structs. */
- subl $12, %esp
- cfi_adjust_cfa_offset(12)
-
- movl %ecx, %ebp
- movl %edx, %edi
-
-1: movl %eax, 8(%esp)
-
- /* Get current time. */
- movl %esp, %ebx
- xorl %ecx, %ecx
- movl $__NR_gettimeofday, %eax
- ENTER_KERNEL
-
- /* Compute relative timeout. */
- movl 4(%esp), %eax
- movl $1000, %edx
- mul %edx /* Milli seconds to nano seconds. */
- movl (%edi), %ecx
- movl 4(%edi), %edx
- subl (%esp), %ecx
- subl %eax, %edx
- jns 4f
- addl $1000000000, %edx
- subl $1, %ecx
-4: testl %ecx, %ecx
- js 8f /* Time is already up. */
-
- /* Store relative timeout. */
- movl %ecx, (%esp)
- movl %edx, 4(%esp)
-
- movl %ebp, %ebx
-
- movl 8(%esp), %edx
- movl %edx, %eax
- orl $FUTEX_WAITERS, %edx
-
- testl $FUTEX_OWNER_DIED, %eax
- jnz 6f
-
- cmpl %eax, %edx
- je 2f
-
- LOCK
- cmpxchgl %edx, (%ebx)
- movl $0, %ecx /* Must use mov to avoid changing cc. */
- jnz 5f
-
-2:
- /* Futex call. */
- movl %esp, %esi
- movl 20(%esp), %ecx
- LOAD_FUTEX_WAIT (%ecx)
- movl $SYS_futex, %eax
- ENTER_KERNEL
- movl %eax, %ecx
-
- movl (%ebx), %eax
-
-5: testl %eax, %eax
- jne 7f
-
- movl %gs:TID, %edx
- orl $FUTEX_WAITERS, %edx
- LOCK
- cmpxchgl %edx, (%ebx)
- jnz 7f
-
-6: addl $12, %esp
- cfi_adjust_cfa_offset(-12)
- popl %ebp
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebp)
- popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
- popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
- popl %edi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edi)
- ret
-
-3: movl $EINVAL, %eax
- ret
-
- cfi_adjust_cfa_offset(28)
- cfi_offset(%edi, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%ebx, -16)
- cfi_offset(%ebp, -20)
- /* Check whether the time expired. */
-7: cmpl $-ETIMEDOUT, %ecx
- jne 1b
-
-8: movl $ETIMEDOUT, %eax
- jmp 6b
- cfi_endproc
- .size __lll_robust_timedlock_wait,.-__lll_robust_timedlock_wait
diff --git a/sysdeps/unix/sysv/linux/i386/lxstat.c b/sysdeps/unix/sysv/linux/i386/lxstat.c
index 3ddaf74c8f..0049fd1840 100644
--- a/sysdeps/unix/sysv/linux/i386/lxstat.c
+++ b/sysdeps/unix/sysv/linux/i386/lxstat.c
@@ -1,5 +1,5 @@
/* lxstat using old-style Unix lstat system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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;
@@ -55,7 +55,7 @@ __lxstat (int vers, const char *name, struct stat *buf)
hidden_def (__lxstat)
weak_alias (__lxstat, _lxstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
#undef __lxstat64
strong_alias (__lxstat, __lxstat64);
hidden_ver (__lxstat, __lxstat64)
diff --git a/sysdeps/unix/sysv/linux/i386/makecontext.S b/sysdeps/unix/sysv/linux/i386/makecontext.S
index 5f659108ff..e3ca3dc0d5 100644
--- a/sysdeps/unix/sysv/linux/i386/makecontext.S
+++ b/sysdeps/unix/sysv/linux/i386/makecontext.S
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -108,9 +108,19 @@ L(exitcode):
call HIDDEN_JUMPTARGET(__setcontext)
/* If this returns (which can happen if the syscall fails) we'll
exit the program with the return error value (-1). */
+ jmp L(call_exit)
- movl %eax, (%esp)
-2: call HIDDEN_JUMPTARGET(exit)
+2:
+ /* Exit with status 0. */
+ xorl %eax, %eax
+
+L(call_exit):
+ /* Align the stack and pass the exit code (from %eax). */
+ andl $0xfffffff0, %esp
+ subl $12, %esp
+ pushl %eax
+
+ call HIDDEN_JUMPTARGET(exit)
/* The 'exit' call should never return. In case it does cause
the process to terminate. */
hlt
diff --git a/sysdeps/unix/sysv/linux/i386/mmap.c b/sysdeps/unix/sysv/linux/i386/mmap.c
deleted file mode 100644
index a3ebfae96e..0000000000
--- a/sysdeps/unix/sysv/linux/i386/mmap.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 2015-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/types.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <sysdep.h>
-
-#ifndef MMAP_PAGE_UNIT
-# define MMAP_PAGE_UNIT 4096UL
-#endif
-
-__ptr_t
-__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
-{
- if (offset & (MMAP_PAGE_UNIT - 1))
- return (__ptr_t) INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
- return (__ptr_t) INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, fd,
- offset / MMAP_PAGE_UNIT);
-}
-
-weak_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c
deleted file mode 100644
index ad86a07203..0000000000
--- a/sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (C) 1991-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 is a compatibility file. If we don't build the libc with
- versioning don't compile this file. */
-#include <shlib-compat.h>
-#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
-
-#include <errno.h>
-#include <sys/resource.h>
-#include <sys/types.h>
-
-extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *);
-extern int __old_getrlimit64 (enum __rlimit_resource resource,
- struct rlimit64 *rlimits);
-
-
-/* Put the soft and hard limits for RESOURCE in *RLIMITS.
- Returns 0 if successful, -1 if not (and sets errno). */
-int
-attribute_compat_text_section
-__old_getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
-{
- struct rlimit rlimits32;
-
- if (__new_getrlimit (resource, &rlimits32) < 0)
- return -1;
-
- if (rlimits32.rlim_cur == RLIM_INFINITY)
- rlimits->rlim_cur = RLIM64_INFINITY >> 1;
- else
- rlimits->rlim_cur = rlimits32.rlim_cur;
- if (rlimits32.rlim_max == RLIM_INFINITY)
- rlimits->rlim_max = RLIM64_INFINITY >> 1;
- else
- rlimits->rlim_max = rlimits32.rlim_max;
-
- return 0;
-}
-
-compat_symbol (libc, __old_getrlimit64, getrlimit64, GLIBC_2_1);
-
-#endif /* SHLIB_COMPAT */
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/profil-counter.h b/sysdeps/unix/sysv/linux/i386/profil-counter.h
index 3f858ac0ec..871709961c 100644
--- a/sysdeps/unix/sysv/linux/i386/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/i386/profil-counter.h
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Linux/i386 version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S b/sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
deleted file mode 100644
index 599668830d..0000000000
--- a/sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
+++ /dev/null
@@ -1,241 +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 <sysdep.h>
-#include <shlib-compat.h>
-#include <lowlevellock.h>
-#include <lowlevelcond.h>
-#include <kernel-features.h>
-#include <pthread-pi-defines.h>
-#include <pthread-errnos.h>
-#include <stap-probe.h>
-
- .text
-
- /* int pthread_cond_broadcast (pthread_cond_t *cond) */
- .globl __pthread_cond_broadcast
- .type __pthread_cond_broadcast, @function
- .align 16
-__pthread_cond_broadcast:
- cfi_startproc
- pushl %ebx
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%ebx, 0)
- pushl %esi
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%esi, 0)
- pushl %edi
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%edi, 0)
- pushl %ebp
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%ebp, 0)
- cfi_remember_state
-
- movl 20(%esp), %ebx
-
- LIBC_PROBE (cond_broadcast, 1, %edx)
-
- /* Get internal lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %edx, (%ebx)
-#else
- cmpxchgl %edx, cond_lock(%ebx)
-#endif
- jnz 1f
-
-2: addl $cond_futex, %ebx
- movl total_seq+4-cond_futex(%ebx), %eax
- movl total_seq-cond_futex(%ebx), %ebp
- cmpl wakeup_seq+4-cond_futex(%ebx), %eax
- ja 3f
- jb 4f
- cmpl wakeup_seq-cond_futex(%ebx), %ebp
- jna 4f
-
- /* Cause all currently waiting threads to recognize they are
- woken up. */
-3: movl %ebp, wakeup_seq-cond_futex(%ebx)
- movl %eax, wakeup_seq-cond_futex+4(%ebx)
- movl %ebp, woken_seq-cond_futex(%ebx)
- movl %eax, woken_seq-cond_futex+4(%ebx)
- addl %ebp, %ebp
- addl $1, broadcast_seq-cond_futex(%ebx)
- movl %ebp, (%ebx)
-
- /* Get the address of the mutex used. */
- movl dep_mutex-cond_futex(%ebx), %edi
-
- /* Unlock. */
- LOCK
- subl $1, cond_lock-cond_futex(%ebx)
- jne 7f
-
- /* Don't use requeue for pshared condvars. */
-8: cmpl $-1, %edi
- je 9f
-
- /* Do not use requeue for pshared condvars. */
- testl $PS_BIT, MUTEX_KIND(%edi)
- jne 9f
-
- /* Requeue to a non-robust PI mutex if the PI bit is set and
- the robust bit is not set. */
- movl MUTEX_KIND(%edi), %eax
- andl $(ROBUST_BIT|PI_BIT), %eax
- cmpl $PI_BIT, %eax
- je 81f
-
- /* Wake up all threads. */
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $(FUTEX_CMP_REQUEUE|FUTEX_PRIVATE_FLAG), %ecx
-#else
- movl %gs:PRIVATE_FUTEX, %ecx
- orl $FUTEX_CMP_REQUEUE, %ecx
-#endif
- movl $SYS_futex, %eax
- movl $0x7fffffff, %esi
- movl $1, %edx
- /* Get the address of the futex involved. */
-# if MUTEX_FUTEX != 0
- addl $MUTEX_FUTEX, %edi
-# endif
-/* FIXME: Until Ingo fixes 4G/4G vDSO, 6 arg syscalls are broken for sysenter.
- ENTER_KERNEL */
- int $0x80
-
- /* For any kind of error, which mainly is EAGAIN, we try again
- with WAKE. The general test also covers running on old
- kernels. */
- cmpl $0xfffff001, %eax
- jae 9f
-
-6: xorl %eax, %eax
- popl %ebp
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebp)
- 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)
- ret
-
- cfi_restore_state
-
-81: movl $(FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
- movl $SYS_futex, %eax
- movl $0x7fffffff, %esi
- movl $1, %edx
- /* Get the address of the futex involved. */
-# if MUTEX_FUTEX != 0
- addl $MUTEX_FUTEX, %edi
-# endif
- int $0x80
-
- /* For any kind of error, which mainly is EAGAIN, we try again
- with WAKE. The general test also covers running on old
- kernels. */
- cmpl $0xfffff001, %eax
- jb 6b
- jmp 9f
-
- /* Initial locking failed. */
-1:
-#if cond_lock == 0
- movl %ebx, %edx
-#else
- leal cond_lock(%ebx), %edx
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_lock_wait
- jmp 2b
-
- .align 16
- /* Unlock. */
-4: LOCK
- subl $1, cond_lock-cond_futex(%ebx)
- je 6b
-
- /* Unlock in loop requires wakeup. */
-5: leal cond_lock-cond_futex(%ebx), %eax
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_futex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
- jmp 6b
-
- /* Unlock in loop requires wakeup. */
-7: leal cond_lock-cond_futex(%ebx), %eax
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_futex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
- jmp 8b
-
-9: /* The futex requeue functionality is not available. */
- movl $0x7fffffff, %edx
-#if FUTEX_PRIVATE_FLAG > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_futex(%ebx)
- sete %cl
- subl $1, %ecx
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
- addl $FUTEX_WAKE, %ecx
- movl $SYS_futex, %eax
- ENTER_KERNEL
- jmp 6b
- cfi_endproc
- .size __pthread_cond_broadcast, .-__pthread_cond_broadcast
-versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
- GLIBC_2_3_2)
diff --git a/sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S b/sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
deleted file mode 100644
index 0038775d3f..0000000000
--- a/sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
+++ /dev/null
@@ -1,216 +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 <sysdep.h>
-#include <shlib-compat.h>
-#include <lowlevellock.h>
-#include <lowlevelcond.h>
-#include <kernel-features.h>
-#include <pthread-pi-defines.h>
-#include <pthread-errnos.h>
-#include <stap-probe.h>
-
- .text
-
- /* int pthread_cond_signal (pthread_cond_t *cond) */
- .globl __pthread_cond_signal
- .type __pthread_cond_signal, @function
- .align 16
-__pthread_cond_signal:
-
- cfi_startproc
- pushl %ebx
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%ebx, 0)
- pushl %edi
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%edi, 0)
- cfi_remember_state
-
- movl 12(%esp), %edi
-
- LIBC_PROBE (cond_signal, 1, %edi)
-
- /* Get internal lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %edx, (%edi)
-#else
- cmpxchgl %edx, cond_lock(%edi)
-#endif
- jnz 1f
-
-2: leal cond_futex(%edi), %ebx
- movl total_seq+4(%edi), %eax
- movl total_seq(%edi), %ecx
- cmpl wakeup_seq+4(%edi), %eax
-#if cond_lock != 0
- /* Must use leal to preserve the flags. */
- leal cond_lock(%edi), %edi
-#endif
- ja 3f
- jb 4f
- cmpl wakeup_seq-cond_futex(%ebx), %ecx
- jbe 4f
-
- /* Bump the wakeup number. */
-3: addl $1, wakeup_seq-cond_futex(%ebx)
- adcl $0, wakeup_seq-cond_futex+4(%ebx)
- addl $1, (%ebx)
-
- /* Wake up one thread. */
- pushl %esi
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%esi, 0)
- pushl %ebp
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%ebp, 0)
-
-#if FUTEX_PRIVATE_FLAG > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_futex(%ebx)
- sete %cl
- je 8f
-
- movl dep_mutex-cond_futex(%ebx), %edx
- /* Requeue to a non-robust PI mutex if the PI bit is set and
- the robust bit is not set. */
- movl MUTEX_KIND(%edx), %eax
- andl $(ROBUST_BIT|PI_BIT), %eax
- cmpl $PI_BIT, %eax
- je 9f
-
-8: subl $1, %ecx
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
- addl $FUTEX_WAKE_OP, %ecx
- movl $SYS_futex, %eax
- movl $1, %edx
- movl $1, %esi
- movl $FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, %ebp
- /* FIXME: Until Ingo fixes 4G/4G vDSO, 6 arg syscalls are broken for
- sysenter.
- ENTER_KERNEL */
- int $0x80
- popl %ebp
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebp)
- popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
-
- /* For any kind of error, we try again with WAKE.
- The general test also covers running on old kernels. */
- cmpl $-4095, %eax
- jae 7f
-
-6: xorl %eax, %eax
- popl %edi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edi)
- popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
- ret
-
- cfi_restore_state
-
-9: movl $(FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
- movl $SYS_futex, %eax
- movl $1, %edx
- xorl %esi, %esi
- movl dep_mutex-cond_futex(%ebx), %edi
- movl (%ebx), %ebp
- /* FIXME: Until Ingo fixes 4G/4G vDSO, 6 arg syscalls are broken for
- sysenter.
- ENTER_KERNEL */
- int $0x80
- popl %ebp
- popl %esi
-
- leal -cond_futex(%ebx), %edi
-
- /* For any kind of error, we try again with WAKE.
- The general test also covers running on old kernels. */
- cmpl $-4095, %eax
- jb 4f
-
-7:
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
- orl $FUTEX_WAKE, %ecx
-
- movl $SYS_futex, %eax
- /* %edx should be 1 already from $FUTEX_WAKE_OP syscall.
- movl $1, %edx */
- ENTER_KERNEL
-
- /* Unlock. Note that at this point %edi always points to
- cond_lock. */
-4: LOCK
- subl $1, (%edi)
- je 6b
-
- /* Unlock in loop requires wakeup. */
-5: movl %edi, %eax
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_futex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
- jmp 6b
-
- /* Initial locking failed. */
-1:
-#if cond_lock == 0
- movl %edi, %edx
-#else
- leal cond_lock(%edi), %edx
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%edi)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_lock_wait
- jmp 2b
-
- cfi_endproc
- .size __pthread_cond_signal, .-__pthread_cond_signal
-versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal,
- GLIBC_2_3_2)
diff --git a/sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S b/sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
deleted file mode 100644
index 96f8a8dc73..0000000000
--- a/sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
+++ /dev/null
@@ -1,973 +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 <sysdep.h>
-#include <shlib-compat.h>
-#include <lowlevellock.h>
-#include <lowlevelcond.h>
-#include <pthread-errnos.h>
-#include <pthread-pi-defines.h>
-#include <kernel-features.h>
-#include <stap-probe.h>
-
- .text
-
-/* int pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
- const struct timespec *abstime) */
- .globl __pthread_cond_timedwait
- .type __pthread_cond_timedwait, @function
- .align 16
-__pthread_cond_timedwait:
-.LSTARTCODE:
- cfi_startproc
-#ifdef SHARED
- cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
- DW.ref.__gcc_personality_v0)
- cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
-#else
- cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
- cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
-#endif
-
- pushl %ebp
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%ebp, 0)
- pushl %edi
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%edi, 0)
- pushl %esi
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%esi, 0)
- pushl %ebx
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%ebx, 0)
-
- movl 20(%esp), %ebx
- movl 28(%esp), %ebp
-
- LIBC_PROBE (cond_timedwait, 3, %ebx, 24(%esp), %ebp)
-
- cmpl $1000000000, 4(%ebp)
- movl $EINVAL, %eax
- jae 18f
-
- /* Stack frame:
-
- esp + 32
- +--------------------------+
- esp + 24 | timeout value |
- +--------------------------+
- esp + 20 | futex pointer |
- +--------------------------+
- esp + 16 | pi-requeued flag |
- +--------------------------+
- esp + 12 | old broadcast_seq value |
- +--------------------------+
- esp + 4 | old wake_seq value |
- +--------------------------+
- esp + 0 | old cancellation mode |
- +--------------------------+
- */
-
-#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
-# ifdef PIC
- LOAD_PIC_REG (cx)
- cmpl $0, __have_futex_clock_realtime@GOTOFF(%ecx)
-# else
- cmpl $0, __have_futex_clock_realtime
-# endif
- je .Lreltmo
-#endif
-
- /* Get internal lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %edx, (%ebx)
-#else
- cmpxchgl %edx, cond_lock(%ebx)
-#endif
- jnz 1f
-
- /* Store the reference to the mutex. If there is already a
- different value in there this is a bad user bug. */
-2: cmpl $-1, dep_mutex(%ebx)
- movl 24(%esp), %eax
- je 17f
- movl %eax, dep_mutex(%ebx)
-
- /* Unlock the mutex. */
-17: xorl %edx, %edx
- call __pthread_mutex_unlock_usercnt
-
- testl %eax, %eax
- jne 16f
-
- addl $1, total_seq(%ebx)
- adcl $0, total_seq+4(%ebx)
- addl $1, cond_futex(%ebx)
- addl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
-
-#ifdef __ASSUME_FUTEX_CLOCK_REALTIME
-# define FRAME_SIZE 24
-#else
-# define FRAME_SIZE 32
-#endif
- subl $FRAME_SIZE, %esp
- cfi_adjust_cfa_offset(FRAME_SIZE)
- cfi_remember_state
-
- /* Get and store current wakeup_seq value. */
- movl wakeup_seq(%ebx), %edi
- movl wakeup_seq+4(%ebx), %edx
- movl broadcast_seq(%ebx), %eax
- movl %edi, 4(%esp)
- movl %edx, 8(%esp)
- movl %eax, 12(%esp)
-
- /* Reset the pi-requeued flag. */
- movl $0, 16(%esp)
-
- cmpl $0, (%ebp)
- movl $-ETIMEDOUT, %esi
- js 6f
-
-8: movl cond_futex(%ebx), %edi
- movl %edi, 20(%esp)
-
- /* Unlock. */
- LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- jne 3f
-
-.LcleanupSTART:
-4: call __pthread_enable_asynccancel
- movl %eax, (%esp)
-
- leal (%ebp), %esi
-#if FUTEX_PRIVATE_FLAG > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- sete %cl
- je 40f
-
- movl dep_mutex(%ebx), %edi
- /* Requeue to a non-robust PI mutex if the PI bit is set and
- the robust bit is not set. */
- movl MUTEX_KIND(%edi), %eax
- andl $(ROBUST_BIT|PI_BIT), %eax
- cmpl $PI_BIT, %eax
- jne 40f
-
- movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
- /* The following only works like this because we only support
- two clocks, represented using a single bit. */
- testl $1, cond_nwaiters(%ebx)
- /* XXX Need to implement using sete instead of a jump. */
- jne 42f
- orl $FUTEX_CLOCK_REALTIME, %ecx
-
-42: movl 20(%esp), %edx
- addl $cond_futex, %ebx
-.Ladd_cond_futex_pi:
- movl $SYS_futex, %eax
- ENTER_KERNEL
- subl $cond_futex, %ebx
-.Lsub_cond_futex_pi:
- movl %eax, %esi
- /* Set the pi-requeued flag only if the kernel has returned 0. The
- kernel does not hold the mutex on ETIMEDOUT or any other error. */
- cmpl $0, %eax
- sete 16(%esp)
- je 41f
-
- /* When a futex syscall with FUTEX_WAIT_REQUEUE_PI returns
- successfully, it has already locked the mutex for us and the
- pi_flag (16(%esp)) is set to denote that fact. However, if another
- thread changed the futex value before we entered the wait, the
- syscall may return an EAGAIN and the mutex is not locked. We go
- ahead with a success anyway since later we look at the pi_flag to
- decide if we got the mutex or not. The sequence numbers then make
- sure that only one of the threads actually wake up. We retry using
- normal FUTEX_WAIT only if the kernel returned ENOSYS, since normal
- and PI futexes don't mix.
-
- Note that we don't check for EAGAIN specifically; we assume that the
- only other error the futex function could return is EAGAIN (barring
- the ETIMEOUT of course, for the timeout case in futex) since
- anything else would mean an error in our function. It is too
- expensive to do that check for every call (which is quite common in
- case of a large number of threads), so it has been skipped. */
- cmpl $-ENOSYS, %eax
- jne 41f
- xorl %ecx, %ecx
-
-40: subl $1, %ecx
- movl $0, 16(%esp)
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
- addl $FUTEX_WAIT_BITSET, %ecx
- /* The following only works like this because we only support
- two clocks, represented using a single bit. */
- testl $1, cond_nwaiters(%ebx)
- jne 30f
- orl $FUTEX_CLOCK_REALTIME, %ecx
-30:
- movl 20(%esp), %edx
- movl $0xffffffff, %ebp
- addl $cond_futex, %ebx
-.Ladd_cond_futex:
- movl $SYS_futex, %eax
- ENTER_KERNEL
- subl $cond_futex, %ebx
-.Lsub_cond_futex:
- movl 28+FRAME_SIZE(%esp), %ebp
- movl %eax, %esi
-
-41: movl (%esp), %eax
- call __pthread_disable_asynccancel
-.LcleanupEND:
-
- /* Lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %edx, (%ebx)
-#else
- cmpxchgl %edx, cond_lock(%ebx)
-#endif
- jnz 5f
-
-6: movl broadcast_seq(%ebx), %eax
- cmpl 12(%esp), %eax
- jne 23f
-
- movl woken_seq(%ebx), %eax
- movl woken_seq+4(%ebx), %ecx
-
- movl wakeup_seq(%ebx), %edi
- movl wakeup_seq+4(%ebx), %edx
-
- cmpl 8(%esp), %edx
- jne 7f
- cmpl 4(%esp), %edi
- je 15f
-
-7: cmpl %ecx, %edx
- jne 9f
- cmp %eax, %edi
- jne 9f
-
-15: cmpl $-ETIMEDOUT, %esi
- je 28f
-
- /* We need to go back to futex_wait. If we're using requeue_pi, then
- release the mutex we had acquired and go back. */
- movl 16(%esp), %edx
- test %edx, %edx
- jz 8b
-
- /* Adjust the mutex values first and then unlock it. The unlock
- should always succeed or else the kernel did not lock the mutex
- correctly. */
- movl dep_mutex(%ebx), %eax
- call __pthread_mutex_cond_lock_adjust
- xorl %edx, %edx
- call __pthread_mutex_unlock_usercnt
- jmp 8b
-
-28: addl $1, wakeup_seq(%ebx)
- adcl $0, wakeup_seq+4(%ebx)
- addl $1, cond_futex(%ebx)
- movl $ETIMEDOUT, %esi
- jmp 14f
-
-23: xorl %esi, %esi
- jmp 24f
-
-9: xorl %esi, %esi
-14: addl $1, woken_seq(%ebx)
- adcl $0, woken_seq+4(%ebx)
-
-24: subl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
-
- /* Wake up a thread which wants to destroy the condvar object. */
- movl total_seq(%ebx), %eax
- andl total_seq+4(%ebx), %eax
- cmpl $0xffffffff, %eax
- jne 25f
- movl cond_nwaiters(%ebx), %eax
- andl $~((1 << nwaiters_shift) - 1), %eax
- jne 25f
-
- addl $cond_nwaiters, %ebx
- movl $SYS_futex, %eax
-#if FUTEX_PRIVATE_FLAG > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_nwaiters(%ebx)
- sete %cl
- subl $1, %ecx
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
- addl $FUTEX_WAKE, %ecx
- movl $1, %edx
- ENTER_KERNEL
- subl $cond_nwaiters, %ebx
-
-25: LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- jne 10f
-
-11: movl 24+FRAME_SIZE(%esp), %eax
- /* With requeue_pi, the mutex lock is held in the kernel. */
- movl 16(%esp), %ecx
- testl %ecx, %ecx
- jnz 27f
-
- call __pthread_mutex_cond_lock
-26: addl $FRAME_SIZE, %esp
- cfi_adjust_cfa_offset(-FRAME_SIZE)
-
- /* We return the result of the mutex_lock operation if it failed. */
- testl %eax, %eax
-#ifdef HAVE_CMOV
- cmovel %esi, %eax
-#else
- jne 22f
- movl %esi, %eax
-22:
-#endif
-
-18: popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
- popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
- popl %edi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edi)
- popl %ebp
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebp)
-
- ret
-
- cfi_restore_state
-
-27: call __pthread_mutex_cond_lock_adjust
- xorl %eax, %eax
- jmp 26b
-
- cfi_adjust_cfa_offset(-FRAME_SIZE);
- /* Initial locking failed. */
-1:
-#if cond_lock == 0
- movl %ebx, %edx
-#else
- leal cond_lock(%ebx), %edx
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_lock_wait
- jmp 2b
-
- /* The initial unlocking of the mutex failed. */
-16:
- LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- jne 18b
-
- movl %eax, %esi
-#if cond_lock == 0
- movl %ebx, %eax
-#else
- leal cond_lock(%ebx), %eax
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
-
- movl %esi, %eax
- jmp 18b
-
- cfi_adjust_cfa_offset(FRAME_SIZE)
-
- /* Unlock in loop requires wakeup. */
-3:
-#if cond_lock == 0
- movl %ebx, %eax
-#else
- leal cond_lock(%ebx), %eax
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
- jmp 4b
-
- /* Locking in loop failed. */
-5:
-#if cond_lock == 0
- movl %ebx, %edx
-#else
- leal cond_lock(%ebx), %edx
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_lock_wait
- jmp 6b
-
- /* Unlock after loop requires wakeup. */
-10:
-#if cond_lock == 0
- movl %ebx, %eax
-#else
- leal cond_lock(%ebx), %eax
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
- jmp 11b
-
-#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
- cfi_adjust_cfa_offset(-FRAME_SIZE)
-.Lreltmo:
- /* Get internal lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-# if cond_lock == 0
- cmpxchgl %edx, (%ebx)
-# else
- cmpxchgl %edx, cond_lock(%ebx)
-# endif
- jnz 101f
-
- /* Store the reference to the mutex. If there is already a
- different value in there this is a bad user bug. */
-102: cmpl $-1, dep_mutex(%ebx)
- movl 24(%esp), %eax
- je 117f
- movl %eax, dep_mutex(%ebx)
-
- /* Unlock the mutex. */
-117: xorl %edx, %edx
- call __pthread_mutex_unlock_usercnt
-
- testl %eax, %eax
- jne 16b
-
- addl $1, total_seq(%ebx)
- adcl $0, total_seq+4(%ebx)
- addl $1, cond_futex(%ebx)
- addl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
-
- subl $FRAME_SIZE, %esp
- cfi_adjust_cfa_offset(FRAME_SIZE)
-
- /* Get and store current wakeup_seq value. */
- movl wakeup_seq(%ebx), %edi
- movl wakeup_seq+4(%ebx), %edx
- movl broadcast_seq(%ebx), %eax
- movl %edi, 4(%esp)
- movl %edx, 8(%esp)
- movl %eax, 12(%esp)
-
- /* Reset the pi-requeued flag. */
- movl $0, 16(%esp)
-
- /* Get the current time. */
-108: movl %ebx, %edx
-# ifdef __NR_clock_gettime
- /* Get the clock number. */
- movl cond_nwaiters(%ebx), %ebx
- andl $((1 << nwaiters_shift) - 1), %ebx
- /* Only clocks 0 and 1 are allowed so far. Both are handled in the
- kernel. */
- leal 24(%esp), %ecx
- movl $__NR_clock_gettime, %eax
- ENTER_KERNEL
- movl %edx, %ebx
-
- /* Compute relative timeout. */
- movl (%ebp), %ecx
- movl 4(%ebp), %edx
- subl 24(%esp), %ecx
- subl 28(%esp), %edx
-# else
- /* Get the current time. */
- leal 24(%esp), %ebx
- xorl %ecx, %ecx
- movl $__NR_gettimeofday, %eax
- ENTER_KERNEL
- movl %edx, %ebx
-
- /* Compute relative timeout. */
- movl 28(%esp), %eax
- movl $1000, %edx
- mul %edx /* Milli seconds to nano seconds. */
- movl (%ebp), %ecx
- movl 4(%ebp), %edx
- subl 24(%esp), %ecx
- subl %eax, %edx
-# endif
- jns 112f
- addl $1000000000, %edx
- subl $1, %ecx
-112: testl %ecx, %ecx
- movl $-ETIMEDOUT, %esi
- js 106f
-
- /* Store relative timeout. */
-121: movl %ecx, 24(%esp)
- movl %edx, 28(%esp)
-
- movl cond_futex(%ebx), %edi
- movl %edi, 20(%esp)
-
- /* Unlock. */
- LOCK
-# if cond_lock == 0
- subl $1, (%ebx)
-# else
- subl $1, cond_lock(%ebx)
-# endif
- jne 103f
-
-.LcleanupSTART2:
-104: call __pthread_enable_asynccancel
- movl %eax, (%esp)
-
- leal 24(%esp), %esi
-# if FUTEX_PRIVATE_FLAG > 255
- xorl %ecx, %ecx
-# endif
- cmpl $-1, dep_mutex(%ebx)
- sete %cl
- subl $1, %ecx
-# ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-# else
- andl %gs:PRIVATE_FUTEX, %ecx
-# endif
-# if FUTEX_WAIT != 0
- addl $FUTEX_WAIT, %ecx
-# endif
- movl 20(%esp), %edx
- addl $cond_futex, %ebx
-.Ladd_cond_futex2:
- movl $SYS_futex, %eax
- ENTER_KERNEL
- subl $cond_futex, %ebx
-.Lsub_cond_futex2:
- movl %eax, %esi
-
-141: movl (%esp), %eax
- call __pthread_disable_asynccancel
-.LcleanupEND2:
-
-
- /* Lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-# if cond_lock == 0
- cmpxchgl %edx, (%ebx)
-# else
- cmpxchgl %edx, cond_lock(%ebx)
-# endif
- jnz 105f
-
-106: movl broadcast_seq(%ebx), %eax
- cmpl 12(%esp), %eax
- jne 23b
-
- movl woken_seq(%ebx), %eax
- movl woken_seq+4(%ebx), %ecx
-
- movl wakeup_seq(%ebx), %edi
- movl wakeup_seq+4(%ebx), %edx
-
- cmpl 8(%esp), %edx
- jne 107f
- cmpl 4(%esp), %edi
- je 115f
-
-107: cmpl %ecx, %edx
- jne 9b
- cmp %eax, %edi
- jne 9b
-
-115: cmpl $-ETIMEDOUT, %esi
- je 28b
-
- jmp 8b
-
- cfi_adjust_cfa_offset(-FRAME_SIZE)
- /* Initial locking failed. */
-101:
-# if cond_lock == 0
- movl %ebx, %edx
-# else
- leal cond_lock(%ebx), %edx
-# endif
-# if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-# endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-# if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-# endif
- call __lll_lock_wait
- jmp 102b
-
- cfi_adjust_cfa_offset(FRAME_SIZE)
-
- /* Unlock in loop requires wakeup. */
-103:
-# if cond_lock == 0
- movl %ebx, %eax
-# else
- leal cond_lock(%ebx), %eax
-# endif
-# if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-# endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-# if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-# endif
- call __lll_unlock_wake
- jmp 104b
-
- /* Locking in loop failed. */
-105:
-# if cond_lock == 0
- movl %ebx, %edx
-# else
- leal cond_lock(%ebx), %edx
-# endif
-# if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-# endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-# if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-# endif
- call __lll_lock_wait
- jmp 106b
-#endif
-
- .size __pthread_cond_timedwait, .-__pthread_cond_timedwait
-versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
- GLIBC_2_3_2)
-
-
- .type __condvar_tw_cleanup2, @function
-__condvar_tw_cleanup2:
- subl $cond_futex, %ebx
- .size __condvar_tw_cleanup2, .-__condvar_tw_cleanup2
- .type __condvar_tw_cleanup, @function
-__condvar_tw_cleanup:
- movl %eax, %esi
-
- /* Get internal lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %edx, (%ebx)
-#else
- cmpxchgl %edx, cond_lock(%ebx)
-#endif
- jz 1f
-
-#if cond_lock == 0
- movl %ebx, %edx
-#else
- leal cond_lock(%ebx), %edx
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_lock_wait
-
-1: movl broadcast_seq(%ebx), %eax
- cmpl 12(%esp), %eax
- jne 3f
-
- /* We increment the wakeup_seq counter only if it is lower than
- total_seq. If this is not the case the thread was woken and
- then canceled. In this case we ignore the signal. */
- movl total_seq(%ebx), %eax
- movl total_seq+4(%ebx), %edi
- cmpl wakeup_seq+4(%ebx), %edi
- jb 6f
- ja 7f
- cmpl wakeup_seq(%ebx), %eax
- jbe 7f
-
-6: addl $1, wakeup_seq(%ebx)
- adcl $0, wakeup_seq+4(%ebx)
- addl $1, cond_futex(%ebx)
-
-7: addl $1, woken_seq(%ebx)
- adcl $0, woken_seq+4(%ebx)
-
-3: subl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
-
- /* Wake up a thread which wants to destroy the condvar object. */
- xorl %edi, %edi
- movl total_seq(%ebx), %eax
- andl total_seq+4(%ebx), %eax
- cmpl $0xffffffff, %eax
- jne 4f
- movl cond_nwaiters(%ebx), %eax
- andl $~((1 << nwaiters_shift) - 1), %eax
- jne 4f
-
- addl $cond_nwaiters, %ebx
- movl $SYS_futex, %eax
-#if FUTEX_PRIVATE_FLAG > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_nwaiters(%ebx)
- sete %cl
- subl $1, %ecx
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
- addl $FUTEX_WAKE, %ecx
- movl $1, %edx
- ENTER_KERNEL
- subl $cond_nwaiters, %ebx
- movl $1, %edi
-
-4: LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- je 2f
-
-#if cond_lock == 0
- movl %ebx, %eax
-#else
- leal cond_lock(%ebx), %eax
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
-
- /* Wake up all waiters to make sure no signal gets lost. */
-2: testl %edi, %edi
- jnz 5f
- addl $cond_futex, %ebx
-#if FUTEX_PRIVATE_FLAG > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_futex(%ebx)
- sete %cl
- subl $1, %ecx
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
- addl $FUTEX_WAKE, %ecx
- movl $SYS_futex, %eax
- movl $0x7fffffff, %edx
- ENTER_KERNEL
-
- /* Lock the mutex only if we don't own it already. This only happens
- in case of PI mutexes, if we got cancelled after a successful
- return of the futex syscall and before disabling async
- cancellation. */
-5: movl 24+FRAME_SIZE(%esp), %eax
- movl MUTEX_KIND(%eax), %ebx
- andl $(ROBUST_BIT|PI_BIT), %ebx
- cmpl $PI_BIT, %ebx
- jne 8f
-
- movl (%eax), %ebx
- andl $TID_MASK, %ebx
- cmpl %ebx, %gs:TID
- jne 8f
- /* We managed to get the lock. Fix it up before returning. */
- call __pthread_mutex_cond_lock_adjust
- jmp 9f
-
-8: call __pthread_mutex_cond_lock
-
-9: movl %esi, (%esp)
-.LcallUR:
- call _Unwind_Resume
- hlt
-.LENDCODE:
- cfi_endproc
- .size __condvar_tw_cleanup, .-__condvar_tw_cleanup
-
-
- .section .gcc_except_table,"a",@progbits
-.LexceptSTART:
- .byte DW_EH_PE_omit # @LPStart format (omit)
- .byte DW_EH_PE_omit # @TType format (omit)
- .byte DW_EH_PE_sdata4 # call-site format
- # DW_EH_PE_sdata4
- .uleb128 .Lcstend-.Lcstbegin
-.Lcstbegin:
- .long .LcleanupSTART-.LSTARTCODE
- .long .Ladd_cond_futex_pi-.LcleanupSTART
- .long __condvar_tw_cleanup-.LSTARTCODE
- .uleb128 0
- .long .Ladd_cond_futex_pi-.LSTARTCODE
- .long .Lsub_cond_futex_pi-.Ladd_cond_futex_pi
- .long __condvar_tw_cleanup2-.LSTARTCODE
- .uleb128 0
- .long .Lsub_cond_futex_pi-.LSTARTCODE
- .long .Ladd_cond_futex-.Lsub_cond_futex_pi
- .long __condvar_tw_cleanup-.LSTARTCODE
- .uleb128 0
- .long .Ladd_cond_futex-.LSTARTCODE
- .long .Lsub_cond_futex-.Ladd_cond_futex
- .long __condvar_tw_cleanup2-.LSTARTCODE
- .uleb128 0
- .long .Lsub_cond_futex-.LSTARTCODE
- .long .LcleanupEND-.Lsub_cond_futex
- .long __condvar_tw_cleanup-.LSTARTCODE
- .uleb128 0
-#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
- .long .LcleanupSTART2-.LSTARTCODE
- .long .Ladd_cond_futex2-.LcleanupSTART2
- .long __condvar_tw_cleanup-.LSTARTCODE
- .uleb128 0
- .long .Ladd_cond_futex2-.LSTARTCODE
- .long .Lsub_cond_futex2-.Ladd_cond_futex2
- .long __condvar_tw_cleanup2-.LSTARTCODE
- .uleb128 0
- .long .Lsub_cond_futex2-.LSTARTCODE
- .long .LcleanupEND2-.Lsub_cond_futex2
- .long __condvar_tw_cleanup-.LSTARTCODE
- .uleb128 0
-#endif
- .long .LcallUR-.LSTARTCODE
- .long .LENDCODE-.LcallUR
- .long 0
- .uleb128 0
-.Lcstend:
-
-
-#ifdef SHARED
- .hidden DW.ref.__gcc_personality_v0
- .weak DW.ref.__gcc_personality_v0
- .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
- .align 4
- .type DW.ref.__gcc_personality_v0, @object
- .size DW.ref.__gcc_personality_v0, 4
-DW.ref.__gcc_personality_v0:
- .long __gcc_personality_v0
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S b/sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
deleted file mode 100644
index 94302b0641..0000000000
--- a/sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
+++ /dev/null
@@ -1,641 +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 <sysdep.h>
-#include <shlib-compat.h>
-#include <lowlevellock.h>
-#include <lowlevelcond.h>
-#include <tcb-offsets.h>
-#include <pthread-errnos.h>
-#include <pthread-pi-defines.h>
-#include <kernel-features.h>
-#include <stap-probe.h>
-
-
- .text
-
-/* int pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex) */
- .globl __pthread_cond_wait
- .type __pthread_cond_wait, @function
- .align 16
-__pthread_cond_wait:
-.LSTARTCODE:
- cfi_startproc
-#ifdef SHARED
- cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
- DW.ref.__gcc_personality_v0)
- cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
-#else
- cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
- cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
-#endif
-
- pushl %ebp
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%ebp, 0)
- pushl %edi
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%edi, 0)
- pushl %esi
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%esi, 0)
- pushl %ebx
- cfi_adjust_cfa_offset(4)
- cfi_rel_offset(%ebx, 0)
-
- xorl %esi, %esi
- movl 20(%esp), %ebx
-
- LIBC_PROBE (cond_wait, 2, 24(%esp), %ebx)
-
- /* Get internal lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %edx, (%ebx)
-#else
- cmpxchgl %edx, cond_lock(%ebx)
-#endif
- jnz 1f
-
- /* Store the reference to the mutex. If there is already a
- different value in there this is a bad user bug. */
-2: cmpl $-1, dep_mutex(%ebx)
- movl 24(%esp), %eax
- je 15f
- movl %eax, dep_mutex(%ebx)
-
- /* Unlock the mutex. */
-15: xorl %edx, %edx
- call __pthread_mutex_unlock_usercnt
-
- testl %eax, %eax
- jne 12f
-
- addl $1, total_seq(%ebx)
- adcl $0, total_seq+4(%ebx)
- addl $1, cond_futex(%ebx)
- addl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
-
-#define FRAME_SIZE 20
- subl $FRAME_SIZE, %esp
- cfi_adjust_cfa_offset(FRAME_SIZE)
- cfi_remember_state
-
- /* Get and store current wakeup_seq value. */
- movl wakeup_seq(%ebx), %edi
- movl wakeup_seq+4(%ebx), %edx
- movl broadcast_seq(%ebx), %eax
- movl %edi, 4(%esp)
- movl %edx, 8(%esp)
- movl %eax, 12(%esp)
-
- /* Reset the pi-requeued flag. */
-8: movl $0, 16(%esp)
- movl cond_futex(%ebx), %ebp
-
- /* Unlock. */
- LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- jne 3f
-
-.LcleanupSTART:
-4: call __pthread_enable_asynccancel
- movl %eax, (%esp)
-
- xorl %ecx, %ecx
- cmpl $-1, dep_mutex(%ebx)
- sete %cl
- je 18f
-
- movl dep_mutex(%ebx), %edi
- /* Requeue to a non-robust PI mutex if the PI bit is set and
- the robust bit is not set. */
- movl MUTEX_KIND(%edi), %eax
- andl $(ROBUST_BIT|PI_BIT), %eax
- cmpl $PI_BIT, %eax
- jne 18f
-
- movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
- movl %ebp, %edx
- xorl %esi, %esi
- addl $cond_futex, %ebx
-.Ladd_cond_futex_pi:
- movl $SYS_futex, %eax
- ENTER_KERNEL
- subl $cond_futex, %ebx
-.Lsub_cond_futex_pi:
- /* Set the pi-requeued flag only if the kernel has returned 0. The
- kernel does not hold the mutex on error. */
- cmpl $0, %eax
- sete 16(%esp)
- je 19f
-
- /* When a futex syscall with FUTEX_WAIT_REQUEUE_PI returns
- successfully, it has already locked the mutex for us and the
- pi_flag (16(%esp)) is set to denote that fact. However, if another
- thread changed the futex value before we entered the wait, the
- syscall may return an EAGAIN and the mutex is not locked. We go
- ahead with a success anyway since later we look at the pi_flag to
- decide if we got the mutex or not. The sequence numbers then make
- sure that only one of the threads actually wake up. We retry using
- normal FUTEX_WAIT only if the kernel returned ENOSYS, since normal
- and PI futexes don't mix.
-
- Note that we don't check for EAGAIN specifically; we assume that the
- only other error the futex function could return is EAGAIN since
- anything else would mean an error in our function. It is too
- expensive to do that check for every call (which is quite common in
- case of a large number of threads), so it has been skipped. */
- cmpl $-ENOSYS, %eax
- jne 19f
- xorl %ecx, %ecx
-
-18: subl $1, %ecx
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
-#if FUTEX_WAIT != 0
- addl $FUTEX_WAIT, %ecx
-#endif
- movl %ebp, %edx
- addl $cond_futex, %ebx
-.Ladd_cond_futex:
- movl $SYS_futex, %eax
- ENTER_KERNEL
- subl $cond_futex, %ebx
-.Lsub_cond_futex:
-
-19: movl (%esp), %eax
- call __pthread_disable_asynccancel
-.LcleanupEND:
-
- /* Lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %edx, (%ebx)
-#else
- cmpxchgl %edx, cond_lock(%ebx)
-#endif
- jnz 5f
-
-6: movl broadcast_seq(%ebx), %eax
- cmpl 12(%esp), %eax
- jne 16f
-
- movl woken_seq(%ebx), %eax
- movl woken_seq+4(%ebx), %ecx
-
- movl wakeup_seq(%ebx), %edi
- movl wakeup_seq+4(%ebx), %edx
-
- cmpl 8(%esp), %edx
- jne 7f
- cmpl 4(%esp), %edi
- je 22f
-
-7: cmpl %ecx, %edx
- jne 9f
- cmp %eax, %edi
- je 22f
-
-9: addl $1, woken_seq(%ebx)
- adcl $0, woken_seq+4(%ebx)
-
- /* Unlock */
-16: subl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
-
- /* Wake up a thread which wants to destroy the condvar object. */
- movl total_seq(%ebx), %eax
- andl total_seq+4(%ebx), %eax
- cmpl $0xffffffff, %eax
- jne 17f
- movl cond_nwaiters(%ebx), %eax
- andl $~((1 << nwaiters_shift) - 1), %eax
- jne 17f
-
- addl $cond_nwaiters, %ebx
- movl $SYS_futex, %eax
-#if FUTEX_PRIVATE_FLAG > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_nwaiters(%ebx)
- sete %cl
- subl $1, %ecx
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
- addl $FUTEX_WAKE, %ecx
- movl $1, %edx
- ENTER_KERNEL
- subl $cond_nwaiters, %ebx
-
-17: LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- jne 10f
-
- /* With requeue_pi, the mutex lock is held in the kernel. */
-11: movl 24+FRAME_SIZE(%esp), %eax
- movl 16(%esp), %ecx
- testl %ecx, %ecx
- jnz 21f
-
- call __pthread_mutex_cond_lock
-20: addl $FRAME_SIZE, %esp
- cfi_adjust_cfa_offset(-FRAME_SIZE);
-
-14: popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
- popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
- popl %edi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edi)
- popl %ebp
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebp)
-
- /* We return the result of the mutex_lock operation. */
- ret
-
- cfi_restore_state
-
-21: call __pthread_mutex_cond_lock_adjust
- xorl %eax, %eax
- jmp 20b
-
- cfi_adjust_cfa_offset(-FRAME_SIZE);
-
- /* We need to go back to futex_wait. If we're using requeue_pi, then
- release the mutex we had acquired and go back. */
-22: movl 16(%esp), %edx
- test %edx, %edx
- jz 8b
-
- /* Adjust the mutex values first and then unlock it. The unlock
- should always succeed or else the kernel did not lock the mutex
- correctly. */
- movl dep_mutex(%ebx), %eax
- call __pthread_mutex_cond_lock_adjust
- xorl %edx, %edx
- call __pthread_mutex_unlock_usercnt
- jmp 8b
-
- /* Initial locking failed. */
-1:
-#if cond_lock == 0
- movl %ebx, %edx
-#else
- leal cond_lock(%ebx), %edx
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_lock_wait
- jmp 2b
-
- /* The initial unlocking of the mutex failed. */
-12:
- LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- jne 14b
-
- movl %eax, %esi
-#if cond_lock == 0
- movl %ebx, %eax
-#else
- leal cond_lock(%ebx), %eax
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
-
- movl %esi, %eax
- jmp 14b
-
- cfi_adjust_cfa_offset(FRAME_SIZE)
-
- /* Unlock in loop requires wakeup. */
-3:
-#if cond_lock == 0
- movl %ebx, %eax
-#else
- leal cond_lock(%ebx), %eax
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
- jmp 4b
-
- /* Locking in loop failed. */
-5:
-#if cond_lock == 0
- movl %ebx, %edx
-#else
- leal cond_lock(%ebx), %edx
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_lock_wait
- jmp 6b
-
- /* Unlock after loop requires wakeup. */
-10:
-#if cond_lock == 0
- movl %ebx, %eax
-#else
- leal cond_lock(%ebx), %eax
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
- jmp 11b
-
- .size __pthread_cond_wait, .-__pthread_cond_wait
-versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
- GLIBC_2_3_2)
-
-
- .type __condvar_w_cleanup2, @function
-__condvar_w_cleanup2:
- subl $cond_futex, %ebx
- .size __condvar_w_cleanup2, .-__condvar_w_cleanup2
-.LSbl4:
- .type __condvar_w_cleanup, @function
-__condvar_w_cleanup:
- movl %eax, %esi
-
- /* Get internal lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %edx, (%ebx)
-#else
- cmpxchgl %edx, cond_lock(%ebx)
-#endif
- jz 1f
-
-#if cond_lock == 0
- movl %ebx, %edx
-#else
- leal cond_lock(%ebx), %edx
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_lock_wait
-
-1: movl broadcast_seq(%ebx), %eax
- cmpl 12(%esp), %eax
- jne 3f
-
- /* We increment the wakeup_seq counter only if it is lower than
- total_seq. If this is not the case the thread was woken and
- then canceled. In this case we ignore the signal. */
- movl total_seq(%ebx), %eax
- movl total_seq+4(%ebx), %edi
- cmpl wakeup_seq+4(%ebx), %edi
- jb 6f
- ja 7f
- cmpl wakeup_seq(%ebx), %eax
- jbe 7f
-
-6: addl $1, wakeup_seq(%ebx)
- adcl $0, wakeup_seq+4(%ebx)
- addl $1, cond_futex(%ebx)
-
-7: addl $1, woken_seq(%ebx)
- adcl $0, woken_seq+4(%ebx)
-
-3: subl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
-
- /* Wake up a thread which wants to destroy the condvar object. */
- xorl %edi, %edi
- movl total_seq(%ebx), %eax
- andl total_seq+4(%ebx), %eax
- cmpl $0xffffffff, %eax
- jne 4f
- movl cond_nwaiters(%ebx), %eax
- andl $~((1 << nwaiters_shift) - 1), %eax
- jne 4f
-
- addl $cond_nwaiters, %ebx
- movl $SYS_futex, %eax
-#if FUTEX_PRIVATE_FLAG > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_nwaiters(%ebx)
- sete %cl
- subl $1, %ecx
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
- addl $FUTEX_WAKE, %ecx
- movl $1, %edx
- ENTER_KERNEL
- subl $cond_nwaiters, %ebx
- movl $1, %edi
-
-4: LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- je 2f
-
-#if cond_lock == 0
- movl %ebx, %eax
-#else
- leal cond_lock(%ebx), %eax
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
-
- /* Wake up all waiters to make sure no signal gets lost. */
-2: testl %edi, %edi
- jnz 5f
- addl $cond_futex, %ebx
-#if FUTEX_PRIVATE_FLAG > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex-cond_futex(%ebx)
- sete %cl
- subl $1, %ecx
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %ecx
-#else
- andl %gs:PRIVATE_FUTEX, %ecx
-#endif
- addl $FUTEX_WAKE, %ecx
- movl $SYS_futex, %eax
- movl $0x7fffffff, %edx
- ENTER_KERNEL
-
- /* Lock the mutex only if we don't own it already. This only happens
- in case of PI mutexes, if we got cancelled after a successful
- return of the futex syscall and before disabling async
- cancellation. */
-5: movl 24+FRAME_SIZE(%esp), %eax
- movl MUTEX_KIND(%eax), %ebx
- andl $(ROBUST_BIT|PI_BIT), %ebx
- cmpl $PI_BIT, %ebx
- jne 8f
-
- movl (%eax), %ebx
- andl $TID_MASK, %ebx
- cmpl %ebx, %gs:TID
- jne 8f
- /* We managed to get the lock. Fix it up before returning. */
- call __pthread_mutex_cond_lock_adjust
- jmp 9f
-
-8: call __pthread_mutex_cond_lock
-
-9: movl %esi, (%esp)
-.LcallUR:
- call _Unwind_Resume
- hlt
-.LENDCODE:
- cfi_endproc
- .size __condvar_w_cleanup, .-__condvar_w_cleanup
-
-
- .section .gcc_except_table,"a",@progbits
-.LexceptSTART:
- .byte DW_EH_PE_omit # @LPStart format (omit)
- .byte DW_EH_PE_omit # @TType format (omit)
- .byte DW_EH_PE_sdata4 # call-site format
- # DW_EH_PE_sdata4
- .uleb128 .Lcstend-.Lcstbegin
-.Lcstbegin:
- .long .LcleanupSTART-.LSTARTCODE
- .long .Ladd_cond_futex_pi-.LcleanupSTART
- .long __condvar_w_cleanup-.LSTARTCODE
- .uleb128 0
- .long .Ladd_cond_futex_pi-.LSTARTCODE
- .long .Lsub_cond_futex_pi-.Ladd_cond_futex_pi
- .long __condvar_w_cleanup2-.LSTARTCODE
- .uleb128 0
- .long .Lsub_cond_futex_pi-.LSTARTCODE
- .long .Ladd_cond_futex-.Lsub_cond_futex_pi
- .long __condvar_w_cleanup-.LSTARTCODE
- .uleb128 0
- .long .Ladd_cond_futex-.LSTARTCODE
- .long .Lsub_cond_futex-.Ladd_cond_futex
- .long __condvar_w_cleanup2-.LSTARTCODE
- .uleb128 0
- .long .Lsub_cond_futex-.LSTARTCODE
- .long .LcleanupEND-.Lsub_cond_futex
- .long __condvar_w_cleanup-.LSTARTCODE
- .uleb128 0
- .long .LcallUR-.LSTARTCODE
- .long .LENDCODE-.LcallUR
- .long 0
- .uleb128 0
-.Lcstend:
-
-#ifdef SHARED
- .hidden DW.ref.__gcc_personality_v0
- .weak DW.ref.__gcc_personality_v0
- .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
- .align 4
- .type DW.ref.__gcc_personality_v0, @object
- .size DW.ref.__gcc_personality_v0, 4
-DW.ref.__gcc_personality_v0:
- .long __gcc_personality_v0
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/putmsg.c b/sysdeps/unix/sysv/linux/i386/putmsg.c
index 2d58bf9310..e08dbd625a 100644
--- a/sysdeps/unix/sysv/linux/i386/putmsg.c
+++ b/sysdeps/unix/sysv/linux/i386/putmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/readdir64.c b/sysdeps/unix/sysv/linux/i386/readdir64.c
deleted file mode 100644
index 50cde6a94e..0000000000
--- a/sysdeps/unix/sysv/linux/i386/readdir64.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (C) 2000-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 __READDIR __readdir64
-#define __GETDENTS __getdents64
-#define DIRENT_TYPE struct dirent64
-
-#include <sysdeps/posix/readdir.c>
-
-#include <shlib-compat.h>
-
-#undef __READDIR
-#undef __GETDENTS
-#undef DIRENT_TYPE
-
-versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
-
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-
-#include <sysdeps/unix/sysv/linux/i386/olddirent.h>
-
-#define __READDIR attribute_compat_text_section __old_readdir64
-#define __GETDENTS __old_getdents64
-#define DIRENT_TYPE struct __old_dirent64
-
-#include <sysdeps/posix/readdir.c>
-
-compat_symbol (libc, __old_readdir64, readdir64, GLIBC_2_1);
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/readdir64_r.c b/sysdeps/unix/sysv/linux/i386/readdir64_r.c
deleted file mode 100644
index 3e7875d2d2..0000000000
--- a/sysdeps/unix/sysv/linux/i386/readdir64_r.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (C) 2000-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 __READDIR_R __readdir64_r
-#define __GETDENTS __getdents64
-#define DIRENT_TYPE struct dirent64
-
-#include <sysdeps/posix/readdir_r.c>
-
-#undef __READDIR_R
-#undef __GETDENTS
-#undef DIRENT_TYPE
-
-#include <shlib-compat.h>
-
-versioned_symbol (libc, __readdir64_r, readdir64_r, GLIBC_2_2);
-
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-
-#include <sysdeps/unix/sysv/linux/i386/olddirent.h>
-
-#define __READDIR_R attribute_compat_text_section __old_readdir64_r
-#define __GETDENTS __old_getdents64
-#define DIRENT_TYPE struct __old_dirent64
-
-#include <sysdeps/posix/readdir_r.c>
-
-compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/readelflib.c b/sysdeps/unix/sysv/linux/i386/readelflib.c
index 58872102c2..3a84559592 100644
--- a/sysdeps/unix/sysv/linux/i386/readelflib.c
+++ b/sysdeps/unix/sysv/linux/i386/readelflib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
Jakub Jelinek <jakub@redhat.com>, 2000.
diff --git a/sysdeps/unix/sysv/linux/i386/register-dump.h b/sysdeps/unix/sysv/linux/i386/register-dump.h
index 756b2e0b7c..1570a74533 100644
--- a/sysdeps/unix/sysv/linux/i386/register-dump.h
+++ b/sysdeps/unix/sysv/linux/i386/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/unix/sysv/linux/i386/scandir64.c b/sysdeps/unix/sysv/linux/i386/scandir64.c
deleted file mode 100644
index fd6fbc90d9..0000000000
--- a/sysdeps/unix/sysv/linux/i386/scandir64.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Copyright (C) 2000-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 <dirent.h>
-
-#define SCANDIR __scandir64
-#define SCANDIR_TAIL __scandir64_tail
-#define DIRENT_TYPE struct dirent64
-
-#include <dirent/scandir.c>
-
-#undef SCANDIR
-#undef SCANDIR_TAIL
-#undef DIRENT_TYPE
-
-#include <shlib-compat.h>
-
-versioned_symbol (libc, __scandir64, scandir64, GLIBC_2_2);
-
-#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
-# include <string.h>
-# include <errno.h>
-# include "olddirent.h"
-
-int
-__old_scandir64 (const char *dir, struct __old_dirent64 ***namelist,
- int (*select) (const struct __old_dirent64 *),
- int (*cmp) (const struct __old_dirent64 **,
- const struct __old_dirent64 **))
-{
- DIR *dp = __opendir (dir);
- struct __old_dirent64 **v = NULL;
- size_t vsize = 0;
- struct scandir_cancel_struct c;
- struct __old_dirent64 *d;
- int save;
-
- if (dp == NULL)
- return -1;
-
- save = errno;
- __set_errno (0);
-
- c.dp = dp;
- c.v = NULL;
- c.cnt = 0;
- __libc_cleanup_push (__scandir_cancel_handler, &c);
-
- while ((d = __old_readdir64 (dp)) != NULL)
- {
- int use_it = select == NULL;
-
- if (! use_it)
- {
- use_it = select (d);
- /* The select function might have changed errno. It was
- zero before and it need to be again to make the latter
- tests work. */
- __set_errno (0);
- }
-
- if (use_it)
- {
- struct __old_dirent64 *vnew;
- size_t dsize;
-
- /* Ignore errors from select or readdir */
- __set_errno (0);
-
- if (__glibc_unlikely (c.cnt == vsize))
- {
- struct __old_dirent64 **new;
- if (vsize == 0)
- vsize = 10;
- else
- vsize *= 2;
- new = (struct __old_dirent64 **) realloc (v,
- vsize * sizeof (*v));
- if (new == NULL)
- break;
- v = new;
- c.v = (void *) v;
- }
-
- dsize = &d->d_name[_D_ALLOC_NAMLEN (d)] - (char *) d;
- vnew = (struct __old_dirent64 *) malloc (dsize);
- if (vnew == NULL)
- break;
-
- v[c.cnt++] = (struct __old_dirent64 *) memcpy (vnew, d, dsize);
- }
- }
-
- if (__builtin_expect (errno, 0) != 0)
- {
- save = errno;
-
- while (c.cnt > 0)
- free (v[--c.cnt]);
- free (v);
- c.cnt = -1;
- }
- else
- {
- /* Sort the list if we have a comparison function to sort with. */
- if (cmp != NULL)
- qsort (v, c.cnt, sizeof (*v),
- (int (*) (const void *, const void *)) cmp);
-
- *namelist = v;
- }
-
- __libc_cleanup_pop (0);
-
- (void) __closedir (dp);
- __set_errno (save);
-
- return c.cnt;
-}
-compat_symbol (libc, __old_scandir64, scandir64, GLIBC_2_1);
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/setcontext.S b/sysdeps/unix/sysv/linux/i386/setcontext.S
index f950d3b047..a604fca0ac 100644
--- a/sysdeps/unix/sysv/linux/i386/setcontext.S
+++ b/sysdeps/unix/sysv/linux/i386/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
diff --git a/sysdeps/unix/sysv/linux/i386/setegid.c b/sysdeps/unix/sysv/linux/i386/setegid.c
deleted file mode 100644
index f495f32712..0000000000
--- a/sysdeps/unix/sysv/linux/i386/setegid.c
+++ /dev/null
@@ -1,35 +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 <errno.h>
-#include <unistd.h>
-#include <setxid.h>
-
-
-int
-setegid (gid_t gid)
-{
- int result;
-
- if (gid == (gid_t) ~0)
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-
- result = INLINE_SETXID_SYSCALL (setresgid32, 3, -1, gid, -1);
-
- return result;
-}
-libc_hidden_def (setegid)
diff --git a/sysdeps/unix/sysv/linux/i386/seteuid.c b/sysdeps/unix/sysv/linux/i386/seteuid.c
deleted file mode 100644
index bf53ce481d..0000000000
--- a/sysdeps/unix/sysv/linux/i386/seteuid.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-#include <setxid.h>
-
-
-int
-seteuid (uid_t uid)
-{
- int result;
-
- if (uid == (uid_t) ~0)
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-
- result = INLINE_SETXID_SYSCALL (setresuid32, 3, -1, uid, -1);
-
- return result;
-}
-libc_hidden_def (seteuid)
diff --git a/sysdeps/unix/sysv/linux/i386/setgid.c b/sysdeps/unix/sysv/linux/i386/setgid.c
deleted file mode 100644
index 6c10e11667..0000000000
--- a/sysdeps/unix/sysv/linux/i386/setgid.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* 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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-#include <setxid.h>
-#include <linux/posix_types.h>
-
-int
-__setgid (gid_t gid)
-{
- int result;
-
- result = INLINE_SETXID_SYSCALL (setgid32, 1, gid);
-
- return result;
-}
-#ifndef __setgid
-weak_alias (__setgid, setgid)
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/setgroups.c b/sysdeps/unix/sysv/linux/i386/setgroups.c
deleted file mode 100644
index 89611cee9f..0000000000
--- a/sysdeps/unix/sysv/linux/i386/setgroups.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 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 <errno.h>
-#include <grp.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-#include <setxid.h>
-#include <linux/posix_types.h>
-
-/* Set the group set for the current user to GROUPS (N of them). For
- Linux we must convert the array of groups into the format that the
- kernel expects. */
-int
-setgroups (size_t n, const gid_t *groups)
-{
- return INLINE_SETXID_SYSCALL (setgroups32, 2, n, groups);
-}
-libc_hidden_def (setgroups)
diff --git a/sysdeps/unix/sysv/linux/i386/setregid.c b/sysdeps/unix/sysv/linux/i386/setregid.c
deleted file mode 100644
index 6bb2479bb2..0000000000
--- a/sysdeps/unix/sysv/linux/i386/setregid.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* 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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-#include <setxid.h>
-#include <linux/posix_types.h>
-
-int
-__setregid (gid_t rgid, gid_t egid)
-{
- int result;
-
- result = INLINE_SETXID_SYSCALL (setregid32, 2, rgid, egid);
-
- return result;
-}
-#ifndef __setregid
-weak_alias (__setregid, setregid)
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/setresgid.c b/sysdeps/unix/sysv/linux/i386/setresgid.c
deleted file mode 100644
index d17438991e..0000000000
--- a/sysdeps/unix/sysv/linux/i386/setresgid.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-#include <setxid.h>
-#include <linux/posix_types.h>
-
-
-int
-__setresgid (gid_t rgid, gid_t egid, gid_t sgid)
-{
- int result;
-
- result = INLINE_SETXID_SYSCALL (setresgid32, 3, rgid, egid, sgid);
-
- return result;
-}
-libc_hidden_def (__setresgid)
-#ifndef __setresgid
-weak_alias (__setresgid, setresgid)
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/setresuid.c b/sysdeps/unix/sysv/linux/i386/setresuid.c
deleted file mode 100644
index e2be1f77f5..0000000000
--- a/sysdeps/unix/sysv/linux/i386/setresuid.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-#include <setxid.h>
-#include <linux/posix_types.h>
-
-
-int
-__setresuid (uid_t ruid, uid_t euid, uid_t suid)
-{
- int result;
-
- result = INLINE_SETXID_SYSCALL (setresuid32, 3, ruid, euid, suid);
-
- return result;
-}
-libc_hidden_def (__setresuid)
-#ifndef __setresuid
-weak_alias (__setresuid, setresuid)
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/setreuid.c b/sysdeps/unix/sysv/linux/i386/setreuid.c
deleted file mode 100644
index e46c121634..0000000000
--- a/sysdeps/unix/sysv/linux/i386/setreuid.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-#include <setxid.h>
-#include <linux/posix_types.h>
-
-
-int
-__setreuid (uid_t ruid, uid_t euid)
-{
- int result;
-
- result = INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid);
-
- return result;
-}
-#ifndef __setreuid
-weak_alias (__setreuid, setreuid)
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/setuid.c b/sysdeps/unix/sysv/linux/i386/setuid.c
deleted file mode 100644
index 200000566f..0000000000
--- a/sysdeps/unix/sysv/linux/i386/setuid.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-#include <setxid.h>
-#include <linux/posix_types.h>
-
-
-int
-__setuid (uid_t uid)
-{
- int result;
-
- result = INLINE_SETXID_SYSCALL (setuid32, 1, uid);
-
- return result;
-}
-#ifndef __setuid
-weak_alias (__setuid, setuid)
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c
index fcff4f408a..df9fa0ca5b 100644
--- a/sysdeps/unix/sysv/linux/i386/sigaction.c
+++ b/sysdeps/unix/sysv/linux/i386/sigaction.c
@@ -1,5 +1,5 @@
/* POSIX.1 `sigaction' call for Linux/i386.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software 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,78 +16,30 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <errno.h>
-#include <stddef.h>
#include <signal.h>
-#include <string.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
#include <ldsodefs.h>
-/* The difference here is that the sigaction structure used in the
- kernel is not the same as we use in the libc. Therefore we must
- translate it here. */
-#include <kernel_sigaction.h>
-
-/* We do not globally define the SA_RESTORER flag so do it here. */
#define SA_RESTORER 0x04000000
-
-/* Using the hidden attribute here does not change the code but it
- helps to avoid warnings. */
-#ifdef __NR_rt_sigaction
extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
-#endif
extern void restore (void) asm ("__restore") attribute_hidden;
+#define SET_SA_RESTORER(kact, act) \
+ ({ \
+ if (GLRO(dl_sysinfo_dso) == NULL) \
+ { \
+ (kact)->sa_flags |= SA_RESTORER; \
+ (kact)->sa_restorer = (((act)->sa_flags & SA_SIGINFO) \
+ ? &restore_rt : &restore); \
+ } \
+ else \
+ (kact)->sa_restorer = NULL; \
+ })
-/* If ACT is not NULL, change the action for SIG to *ACT.
- If OACT is not NULL, put the old action for SIG in *OACT. */
-int
-__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
-{
- int result;
-
- struct kernel_sigaction kact, koact;
-
- if (act)
- {
- kact.k_sa_handler = act->sa_handler;
- kact.sa_flags = act->sa_flags;
- memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
-
- if (GLRO(dl_sysinfo_dso) == NULL)
- {
- kact.sa_flags |= SA_RESTORER;
-
- kact.sa_restorer = ((act->sa_flags & SA_SIGINFO)
- ? &restore_rt : &restore);
- }
- }
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- INTERNAL_SYSCALL_DECL (err);
- result = INTERNAL_SYSCALL (rt_sigaction, err, 4,
- sig, act ? &kact : NULL,
- oact ? &koact : NULL, _NSIG / 8);
- if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result,
- err));
- else if (oact && result >= 0)
- {
- oact->sa_handler = koact.k_sa_handler;
- memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
- oact->sa_flags = koact.sa_flags;
- oact->sa_restorer = koact.sa_restorer;
- }
- return result;
-}
-libc_hidden_def (__libc_sigaction)
+#define RESET_SA_RESTORER(act, kact) \
+ (act)->sa_restorer = (kact)->sa_restorer
-#include <nptl/sigaction.c>
+#include <sysdeps/unix/sysv/linux/sigaction.c>
/* NOTE: Please think twice before making any changes to the bits of
code below. GDB needs some intimate knowledge about it to
@@ -108,10 +60,8 @@ asm \
" int $0x80" \
);
-#ifdef __NR_rt_sigaction
/* The return code for realtime-signals. */
RESTORE (restore_rt, __NR_rt_sigreturn)
-#endif
/* For the boring old signals. */
#undef RESTORE2
diff --git a/sysdeps/unix/sysv/linux/i386/sigcontextinfo.h b/sysdeps/unix/sysv/linux/i386/sigcontextinfo.h
index 769188b6cc..5dee976814 100644
--- a/sysdeps/unix/sysv/linux/i386/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/i386/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -17,34 +17,4 @@
<http://www.gnu.org/licenses/>. */
#define SIGCONTEXT struct sigcontext
-#define SIGCONTEXT_EXTRA_ARGS
#define GET_PC(ctx) ((void *) ctx.eip)
-#define GET_FRAME(ctx) ((void *) ctx.ebp)
-#define GET_STACK(ctx) ((void *) ctx.esp_at_signal)
-#define CALL_SIGHANDLER(handler, signo, ctx) \
-do { \
- int __tmp1, __tmp2, __tmp3, __tmp4; \
- __asm __volatile ("movl\t%%esp, %%edi\n\t" \
- "andl\t$-16, %%esp\n\t" \
- "subl\t%8, %%esp\n\t" \
- "movl\t%%edi, %c8-4(%%esp)\n\t" \
- "movl\t%1, 0(%%esp)\n\t" \
- "leal\t4(%%esp), %%edi\n\t" \
- "cld\n\t" \
- "rep\tmovsl\n\t" \
- "call\t*%0\n\t" \
- "cld\n\t" \
- "movl\t%9, %%ecx\n\t" \
- "subl\t%%edi, %%esi\n\t" \
- "leal\t4(%%esp,%%esi,1), %%edi\n\t" \
- "leal\t4(%%esp), %%esi\n\t" \
- "rep\tmovsl\n\t" \
- "movl\t%c8-4(%%esp), %%esp\n\t" \
- : "=a" (__tmp1), "=d" (__tmp2), "=S" (__tmp3), \
- "=c" (__tmp4) \
- : "0" (handler), "1" (signo), "2" (&ctx), \
- "3" (sizeof (struct sigcontext) / 4), \
- "n" ((sizeof (struct sigcontext) + 19) & ~15), \
- "i" (sizeof (struct sigcontext) / 4) \
- : "cc", "edi"); \
-} while (0)
diff --git a/sysdeps/unix/sysv/linux/i386/smp.h b/sysdeps/unix/sysv/linux/i386/smp.h
index c0ec72159d..5457bb27d3 100644
--- a/sysdeps/unix/sysv/linux/i386/smp.h
+++ b/sysdeps/unix/sysv/linux/i386/smp.h
@@ -1,5 +1,5 @@
/* Determine whether the host has multiple processors. Linux version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,18 +36,18 @@ is_smp_system (void)
char *cp;
/* Try reading the number using `sysctl' first. */
- if (uname (&u.uts) == 0)
+ if (__uname (&u.uts) == 0)
cp = u.uts.version;
else
{
/* This was not successful. Now try reading the /proc filesystem. */
- int fd = open_not_cancel_2 ("/proc/sys/kernel/version", O_RDONLY);
+ int fd = __open64_nocancel ("/proc/sys/kernel/version", O_RDONLY);
if (__builtin_expect (fd, 0) == -1
- || read_not_cancel (fd, u.buf, sizeof (u.buf)) <= 0)
+ || __read_nocancel (fd, u.buf, sizeof (u.buf)) <= 0)
/* This also didn't work. We give up and say it's a UP machine. */
u.buf[0] = '\0';
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
cp = u.buf;
}
diff --git a/sysdeps/unix/sysv/linux/i386/startup.h b/sysdeps/unix/sysv/linux/i386/startup.h
new file mode 100644
index 0000000000..ecc82aa090
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/startup.h
@@ -0,0 +1,36 @@
+/* Linux/i386 definitions of functions used by static libc main startup.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if BUILD_PIE_DEFAULT
+# include <abort-instr.h>
+
+/* Can't use "call *%gs:SYSINFO_OFFSET" during statup in static PIE. */
+# define I386_USE_SYSENTER 0
+
+__attribute__ ((__noreturn__))
+static inline void
+_startup_fatal (const char *message __attribute__ ((unused)))
+{
+ /* This is only called very early during startup in static PIE.
+ FIXME: How can it be improved? */
+ ABORT_INSTRUCTION;
+ __builtin_unreachable ();
+}
+#else
+# include_next <startup.h>
+#endif
diff --git a/sysdeps/unix/sysv/linux/i386/swapcontext.S b/sysdeps/unix/sysv/linux/i386/swapcontext.S
index d115274ff8..431f22c708 100644
--- a/sysdeps/unix/sysv/linux/i386/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/i386/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
diff --git a/sysdeps/unix/sysv/linux/i386/syscall.S b/sysdeps/unix/sysv/linux/i386/syscall.S
index ca6f83ba77..03d4573507 100644
--- a/sysdeps/unix/sysv/linux/i386/syscall.S
+++ b/sysdeps/unix/sysv/linux/i386/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/syscalls.list b/sysdeps/unix/sysv/linux/i386/syscalls.list
index 6282ff8e2f..58020dfae5 100644
--- a/sysdeps/unix/sysv/linux/i386/syscalls.list
+++ b/sysdeps/unix/sysv/linux/i386/syscalls.list
@@ -18,9 +18,6 @@ setfsuid - setfsuid32 Ei:i setfsuid
modify_ldt EXTRA modify_ldt i:ipi __modify_ldt modify_ldt
vm86old EXTRA vm86old i:p __vm86old vm86@GLIBC_2.0
vm86 - vm86 i:ip __vm86 vm86@@GLIBC_2.3.4
-oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
-setrlimit - setrlimit i:ip __setrlimit setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
-waitpid - waitpid Ci:ipi __waitpid waitpid
prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
deleted file mode 100644
index 69687cbf44..0000000000
--- a/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY (name) \
- cmpl $0, %gs:MULTIPLE_THREADS_OFFSET; \
- jne L(pseudo_cancel); \
- .type __##syscall_name##_nocancel,@function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- DO_CALL (syscall_name, args); \
- cmpl $-4095, %eax; \
- jae SYSCALL_ERROR_LABEL; \
- ret; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
- L(pseudo_cancel): \
- CENABLE \
- SAVE_OLDTYPE_##args \
- PUSHCARGS_##args \
- DOCARGS_##args \
- movl $SYS_ify (syscall_name), %eax; \
- ENTER_KERNEL; \
- POPCARGS_##args; \
- POPSTATE_##args \
- cmpl $-4095, %eax; \
- jae SYSCALL_ERROR_LABEL
-
-# define SAVE_OLDTYPE_0 movl %eax, %ecx;
-# define SAVE_OLDTYPE_1 SAVE_OLDTYPE_0
-# define SAVE_OLDTYPE_2 pushl %eax; cfi_adjust_cfa_offset (4);
-# define SAVE_OLDTYPE_3 SAVE_OLDTYPE_2
-# define SAVE_OLDTYPE_4 SAVE_OLDTYPE_2
-# define SAVE_OLDTYPE_5 SAVE_OLDTYPE_2
-# define SAVE_OLDTYPE_6 SAVE_OLDTYPE_2
-
-# define PUSHCARGS_0 /* No arguments to push. */
-# define DOCARGS_0 /* No arguments to frob. */
-# define POPCARGS_0 /* No arguments to pop. */
-# define _PUSHCARGS_0 /* No arguments to push. */
-# define _POPCARGS_0 /* No arguments to pop. */
-
-# define PUSHCARGS_1 movl %ebx, %edx; cfi_register (ebx, edx); PUSHCARGS_0
-# define DOCARGS_1 _DOARGS_1 (4)
-# define POPCARGS_1 POPCARGS_0; movl %edx, %ebx; cfi_restore (ebx);
-# define _PUSHCARGS_1 pushl %ebx; cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (ebx, 0); _PUSHCARGS_0
-# define _POPCARGS_1 _POPCARGS_0; popl %ebx; \
- cfi_adjust_cfa_offset (-4); cfi_restore (ebx);
-
-# define PUSHCARGS_2 PUSHCARGS_1
-# define DOCARGS_2 _DOARGS_2 (12)
-# define POPCARGS_2 POPCARGS_1
-# define _PUSHCARGS_2 _PUSHCARGS_1
-# define _POPCARGS_2 _POPCARGS_1
-
-# define PUSHCARGS_3 _PUSHCARGS_2
-# define DOCARGS_3 _DOARGS_3 (20)
-# define POPCARGS_3 _POPCARGS_3
-# define _PUSHCARGS_3 _PUSHCARGS_2
-# define _POPCARGS_3 _POPCARGS_2
-
-# define PUSHCARGS_4 _PUSHCARGS_4
-# define DOCARGS_4 _DOARGS_4 (28)
-# define POPCARGS_4 _POPCARGS_4
-# define _PUSHCARGS_4 pushl %esi; cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (esi, 0); _PUSHCARGS_3
-# define _POPCARGS_4 _POPCARGS_3; popl %esi; \
- cfi_adjust_cfa_offset (-4); cfi_restore (esi);
-
-# define PUSHCARGS_5 _PUSHCARGS_5
-# define DOCARGS_5 _DOARGS_5 (36)
-# define POPCARGS_5 _POPCARGS_5
-# define _PUSHCARGS_5 pushl %edi; cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (edi, 0); _PUSHCARGS_4
-# define _POPCARGS_5 _POPCARGS_4; popl %edi; \
- cfi_adjust_cfa_offset (-4); cfi_restore (edi);
-
-# define PUSHCARGS_6 _PUSHCARGS_6
-# define DOCARGS_6 _DOARGS_6 (44)
-# define POPCARGS_6 _POPCARGS_6
-# define _PUSHCARGS_6 pushl %ebp; cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (ebp, 0); _PUSHCARGS_5
-# define _POPCARGS_6 _POPCARGS_5; popl %ebp; \
- cfi_adjust_cfa_offset (-4); cfi_restore (ebp);
-
-# if IS_IN (libpthread)
-# define CENABLE call __pthread_enable_asynccancel;
-# define CDISABLE call __pthread_disable_asynccancel
-# elif IS_IN (libc)
-# define CENABLE call __libc_enable_asynccancel;
-# define CDISABLE call __libc_disable_asynccancel
-# elif IS_IN (librt)
-# define CENABLE call __librt_enable_asynccancel;
-# define CDISABLE call __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-# define POPSTATE_0 \
- pushl %eax; cfi_adjust_cfa_offset (4); movl %ecx, %eax; \
- CDISABLE; popl %eax; cfi_adjust_cfa_offset (-4);
-# define POPSTATE_1 POPSTATE_0
-# define POPSTATE_2 xchgl (%esp), %eax; CDISABLE; popl %eax; \
- cfi_adjust_cfa_offset (-4);
-# define POPSTATE_3 POPSTATE_2
-# define POPSTATE_4 POPSTATE_3
-# define POPSTATE_5 POPSTATE_4
-# define POPSTATE_6 POPSTATE_5
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P cmpl $0, %gs:MULTIPLE_THREADS_OFFSET
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.c b/sysdeps/unix/sysv/linux/i386/sysdep.c
index 98ffc6ecde..b809628901 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.c
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 5fcb175e18..3255cc78b8 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
@@ -34,19 +34,21 @@
#undef SYS_ify
#define SYS_ify(syscall_name) __NR_##syscall_name
-#if defined USE_DL_SYSINFO \
- && (IS_IN (libc) || IS_IN (libpthread))
-# define I386_USE_SYSENTER 1
-#else
-# undef I386_USE_SYSENTER
+#ifndef I386_USE_SYSENTER
+# if defined USE_DL_SYSINFO \
+ && (IS_IN (libc) || IS_IN (libpthread))
+# define I386_USE_SYSENTER 1
+# else
+# define I386_USE_SYSENTER 0
+# endif
#endif
/* Since GCC 5 and above can properly spill %ebx with PIC when needed,
we can inline syscalls with 6 arguments if GCC 5 or above is used
to compile glibc. Disable GCC 5 optimization when compiling for
- profiling since asm ("ebp") can't be used to put the 6th argument
- in %ebp for syscall. */
-#if __GNUC_PREREQ (5,0) && !defined PROF
+ profiling or when -fno-omit-frame-pointer is used since asm ("ebp")
+ can't be used to put the 6th argument in %ebp for syscall. */
+#if __GNUC_PREREQ (5,0) && !defined PROF && CAN_USE_REGISTER_ASM_EBP
# define OPTIMIZE_FOR_GCC_5
#endif
@@ -110,8 +112,8 @@
/* The original calling convention for system calls on Linux/i386 is
to use int $0x80. */
-#ifdef I386_USE_SYSENTER
-# ifdef SHARED
+#if I386_USE_SYSENTER
+# ifdef PIC
# define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
# else
# define ENTER_KERNEL call *_dl_sysinfo
@@ -357,9 +359,9 @@ struct libc_do_syscall_args
register unsigned int resultvar; \
INTERNAL_SYSCALL_MAIN_##nr (name, err, args); \
(int) resultvar; })
-#ifdef I386_USE_SYSENTER
+#if I386_USE_SYSENTER
# ifdef OPTIMIZE_FOR_GCC_5
-# ifdef SHARED
+# ifdef PIC
# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \
LOADREGS_##nr(args) \
asm volatile ( \
@@ -395,7 +397,7 @@ struct libc_do_syscall_args
(int) resultvar; })
# endif
# else /* GCC 5 */
-# ifdef SHARED
+# ifdef PIC
# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \
EXTRAVAR_##nr \
asm volatile ( \
@@ -494,7 +496,7 @@ struct libc_do_syscall_args
#define LOADARGS_0
#ifdef __PIC__
-# if defined I386_USE_SYSENTER && defined SHARED
+# if I386_USE_SYSENTER && defined PIC
# define LOADARGS_1 \
"bpushl .L__X'%k3, %k3\n\t"
# define LOADARGS_5 \
@@ -521,7 +523,7 @@ struct libc_do_syscall_args
#define RESTOREARGS_0
#ifdef __PIC__
-# if defined I386_USE_SYSENTER && defined SHARED
+# if I386_USE_SYSENTER && defined PIC
# define RESTOREARGS_1 \
"bpopl .L__X'%k3, %k3\n\t"
# define RESTOREARGS_5 \
diff --git a/sysdeps/unix/sysv/linux/i386/time.c b/sysdeps/unix/sysv/linux/i386/time.c
index 62b78b22de..5f6f8b7734 100644
--- a/sysdeps/unix/sysv/linux/i386/time.c
+++ b/sysdeps/unix/sysv/linux/i386/time.c
@@ -1,5 +1,5 @@
/* time -- Get number of seconds since Epoch. Linux/i386 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,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/tst-bz21269.c b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c
new file mode 100644
index 0000000000..6ee3fc62be
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c
@@ -0,0 +1,235 @@
+/* Test for i386 sigaction sa_restorer handling (BZ#21269)
+ Copyright (C) 2017 Free Software 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 is based on Linux test tools/testing/selftests/x86/ldt_gdt.c,
+ more specifically in do_multicpu_tests function. The main changes
+ are:
+
+ - C11 atomics instead of plain access.
+ - Remove x86_64 support which simplifies the syscall handling
+ and fallbacks.
+ - Replicate only the test required to trigger the issue for the
+ BZ#21269. */
+
+#include <stdatomic.h>
+
+#include <asm/ldt.h>
+#include <linux/futex.h>
+
+#include <setjmp.h>
+#include <signal.h>
+#include <errno.h>
+#include <sys/syscall.h>
+#include <sys/mman.h>
+
+#include <support/xunistd.h>
+#include <support/check.h>
+#include <support/xthread.h>
+
+static int
+xset_thread_area (struct user_desc *u_info)
+{
+ long ret = syscall (SYS_set_thread_area, u_info);
+ TEST_VERIFY_EXIT (ret == 0);
+ return ret;
+}
+
+static void
+xmodify_ldt (int func, const void *ptr, unsigned long bytecount)
+{
+ TEST_VERIFY_EXIT (syscall (SYS_modify_ldt, 1, ptr, bytecount) == 0);
+}
+
+static int
+futex (int *uaddr, int futex_op, int val, void *timeout, int *uaddr2,
+ int val3)
+{
+ return syscall (SYS_futex, uaddr, futex_op, val, timeout, uaddr2, val3);
+}
+
+static void
+xsethandler (int sig, void (*handler)(int, siginfo_t *, void *), int flags)
+{
+ struct sigaction sa = { 0 };
+ sa.sa_sigaction = handler;
+ sa.sa_flags = SA_SIGINFO | flags;
+ TEST_VERIFY_EXIT (sigemptyset (&sa.sa_mask) == 0);
+ TEST_VERIFY_EXIT (sigaction (sig, &sa, 0) == 0);
+}
+
+static jmp_buf jmpbuf;
+
+static void
+sigsegv_handler (int sig, siginfo_t *info, void *ctx_void)
+{
+ siglongjmp (jmpbuf, 1);
+}
+
+/* Points to an array of 1024 ints, each holding its own index. */
+static const unsigned int *counter_page;
+static struct user_desc *low_user_desc;
+static struct user_desc *low_user_desc_clear; /* Used to delete GDT entry. */
+static int gdt_entry_num;
+
+static void
+setup_counter_page (void)
+{
+ long page_size = sysconf (_SC_PAGE_SIZE);
+ TEST_VERIFY_EXIT (page_size > 0);
+ unsigned int *page = xmmap (NULL, page_size, PROT_READ | PROT_WRITE,
+ MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1);
+ for (int i = 0; i < (page_size / sizeof (unsigned int)); i++)
+ page[i] = i;
+ counter_page = page;
+}
+
+static void
+setup_low_user_desc (void)
+{
+ low_user_desc = xmmap (NULL, 2 * sizeof (struct user_desc),
+ PROT_READ | PROT_WRITE,
+ MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1);
+
+ low_user_desc->entry_number = -1;
+ low_user_desc->base_addr = (unsigned long) &counter_page[1];
+ low_user_desc->limit = 0xffff;
+ low_user_desc->seg_32bit = 1;
+ low_user_desc->contents = 0;
+ low_user_desc->read_exec_only = 0;
+ low_user_desc->limit_in_pages = 1;
+ low_user_desc->seg_not_present = 0;
+ low_user_desc->useable = 0;
+
+ xset_thread_area (low_user_desc);
+
+ low_user_desc_clear = low_user_desc + 1;
+ low_user_desc_clear->entry_number = gdt_entry_num;
+ low_user_desc_clear->read_exec_only = 1;
+ low_user_desc_clear->seg_not_present = 1;
+}
+
+/* Possible values of futex:
+ 0: thread is idle.
+ 1: thread armed.
+ 2: thread should clear LDT entry 0.
+ 3: thread should exit. */
+static atomic_uint ftx;
+
+static void *
+threadproc (void *ctx)
+{
+ while (1)
+ {
+ futex ((int *) &ftx, FUTEX_WAIT, 1, NULL, NULL, 0);
+ while (atomic_load (&ftx) != 2)
+ {
+ if (atomic_load (&ftx) >= 3)
+ return NULL;
+ }
+
+ /* clear LDT entry 0. */
+ const struct user_desc desc = { 0 };
+ xmodify_ldt (1, &desc, sizeof (desc));
+
+ /* If ftx == 2, set it to zero, If ftx == 100, quit. */
+ if (atomic_fetch_add (&ftx, -2) != 2)
+ return NULL;
+ }
+}
+
+
+/* As described in testcase, for historical reasons x86_32 Linux (and compat
+ on x86_64) interprets SA_RESTORER clear with nonzero sa_restorer as a
+ request for stack switching if the SS segment is 'funny' (this is default
+ scenario for vDSO system). This means that anything that tries to mix
+ signal handling with segmentation should explicit clear the sa_restorer.
+
+ This testcase check if sigaction in fact does it by changing the local
+ descriptor table (LDT) through the modify_ldt syscall and triggering
+ a synchronous segfault on iret fault by trying to install an invalid
+ segment. With a correct zeroed sa_restorer it should not trigger an
+ 'real' SEGSEGV and allows the siglongjmp in signal handler. */
+
+static int
+do_test (void)
+{
+ setup_counter_page ();
+ setup_low_user_desc ();
+
+ pthread_t thread;
+ unsigned short orig_ss;
+
+ xsethandler (SIGSEGV, sigsegv_handler, 0);
+ /* 32-bit kernels send SIGILL instead of SIGSEGV on IRET faults. */
+ xsethandler (SIGILL, sigsegv_handler, 0);
+ /* Some kernels send SIGBUS instead. */
+ xsethandler (SIGBUS, sigsegv_handler, 0);
+
+ thread = xpthread_create (0, threadproc, 0);
+
+ asm volatile ("mov %%ss, %0" : "=rm" (orig_ss));
+
+ for (int i = 0; i < 5; i++)
+ {
+ if (sigsetjmp (jmpbuf, 1) != 0)
+ continue;
+
+ /* Make sure the thread is ready after the last test. */
+ while (atomic_load (&ftx) != 0)
+ ;
+
+ struct user_desc desc = {
+ .entry_number = 0,
+ .base_addr = 0,
+ .limit = 0xffff,
+ .seg_32bit = 1,
+ .contents = 0,
+ .read_exec_only = 0,
+ .limit_in_pages = 1,
+ .seg_not_present = 0,
+ .useable = 0
+ };
+
+ xmodify_ldt (0x11, &desc, sizeof (desc));
+
+ /* Arm the thread. */
+ ftx = 1;
+ futex ((int*) &ftx, FUTEX_WAKE, 0, NULL, NULL, 0);
+
+ asm volatile ("mov %0, %%ss" : : "r" (0x7));
+
+ /* Fire up thread modify_ldt call. */
+ atomic_store (&ftx, 2);
+
+ while (atomic_load (&ftx) != 0)
+ ;
+
+ /* On success, modify_ldt will segfault us synchronously and we will
+ escape via siglongjmp. */
+ support_record_failure ();
+ }
+
+ atomic_store (&ftx, 100);
+ futex ((int*) &ftx, FUTEX_WAKE, 0, NULL, NULL, 0);
+
+ xpthread_join (thread);
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/i386/versionsort64.c b/sysdeps/unix/sysv/linux/i386/versionsort64.c
deleted file mode 100644
index 2a9934fb92..0000000000
--- a/sysdeps/unix/sysv/linux/i386/versionsort64.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 1992-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 <dirent.h>
-#include <string.h>
-
-int
-__versionsort64 (const struct dirent64 **a, const struct dirent64 **b)
-{
- return __strverscmp ((*a)->d_name, (*b)->d_name);
-}
-
-#include <shlib-compat.h>
-
-versioned_symbol (libc, __versionsort64, versionsort64, GLIBC_2_2);
-
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-
-#include <sysdeps/unix/sysv/linux/i386/olddirent.h>
-
-int
-__old_versionsort64 (const struct __old_dirent64 **a,
- const struct __old_dirent64 **b);
-
-int
-attribute_compat_text_section
-__old_versionsort64 (const struct __old_dirent64 **a,
- const struct __old_dirent64 **b)
-{
- return __strverscmp ((*a)->d_name, (*b)->d_name);
-}
-
-compat_symbol (libc, __old_versionsort64, versionsort64, GLIBC_2_1);
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/vfork.S b/sysdeps/unix/sysv/linux/i386/vfork.S
index 7a1d3373bb..ce6dbfac48 100644
--- a/sysdeps/unix/sysv/linux/i386/vfork.S
+++ b/sysdeps/unix/sysv/linux/i386/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
@@ -21,6 +21,38 @@
#include <bits/errno.h>
#include <tcb-offsets.h>
+#if SHSTK_ENABLED
+/* The shadow stack prevents us from pushing the saved return PC onto
+ the stack and returning normally. Instead we pop the shadow stack
+ and return directly. This is the safest way to return and ensures
+ any stack manipulations done by the vfork'd child doesn't cause the
+ parent to terminate when CET is enabled. */
+# undef SYSCALL_ERROR_HANDLER
+# ifdef PIC
+# define SYSCALL_ERROR_HANDLER \
+0: \
+ calll .L1; \
+.L1: \
+ popl %edx; \
+.L2: \
+ addl $_GLOBAL_OFFSET_TABLE_ + (.L2 - .L1), %edx; \
+ movl __libc_errno@gotntpoff(%edx), %edx; \
+ negl %eax; \
+ movl %eax, %gs:(%edx); \
+ orl $-1, %eax; \
+ jmp 1b;
+# else
+# define SYSCALL_ERROR_HANDLER \
+0: \
+ movl __libc_errno@indntpoff, %edx; \
+ negl %eax; \
+ movl %eax, %gs:(%edx); \
+ orl $-1, %eax; \
+ jmp 1b;
+# endif
+# undef SYSCALL_ERROR_LABEL
+# define SYSCALL_ERROR_LABEL 0f
+#endif
/* Clone the calling process, but without copying the whole address space.
The calling process is suspended until the new process exits or is
@@ -34,39 +66,45 @@ ENTRY (__vfork)
cfi_adjust_cfa_offset (-4)
cfi_register (%eip, %ecx)
- /* Save the TCB-cached PID away in %edx, and then negate the TCB
- field. But if it's zero, set it to 0x80000000 instead. See
- raise.c for the logic that relies on this value. */
- movl %gs:PID, %edx
- movl %edx, %eax
- negl %eax
- jne 1f
- movl $0x80000000, %eax
-1: movl %eax, %gs:PID
-
-
/* Stuff the syscall number in EAX and enter into the kernel. */
movl $SYS_ify (vfork), %eax
int $0x80
+#if !SHSTK_ENABLED
/* Jump to the return PC. Don't jump directly since this
disturbs the branch target cache. Instead push the return
address back on the stack. */
pushl %ecx
cfi_adjust_cfa_offset (4)
-
- /* Restore the original value of the TCB cache of the PID, if we're
- the parent. But in the child (syscall return value equals zero),
- leave things as they are. */
- testl %eax, %eax
- je 1f
- movl %edx, %gs:PID
-1:
+#endif
cmpl $-4095, %eax
/* Branch forward if it failed. */
jae SYSCALL_ERROR_LABEL
+#if SHSTK_ENABLED
+1:
+ /* Check if shadow stack is in use. */
+ xorl %edx, %edx
+ rdsspd %edx
+ testl %edx, %edx
+ /* Normal return if shadow stack isn't in use. */
+ je L(no_shstk)
+
+ /* Pop return address from shadow stack and jump back to caller
+ directly. */
+ movl $1, %edx
+ incsspd %edx
+ jmp *%ecx
+
+L(no_shstk):
+ /* Jump to the return PC. Don't jump directly since this
+ disturbs the branch target cache. Instead push the return
+ address back on the stack. */
+ pushl %ecx
+ cfi_adjust_cfa_offset (4)
+#endif
+
ret
PSEUDO_END (__vfork)
diff --git a/sysdeps/unix/sysv/linux/i386/xstat.c b/sysdeps/unix/sysv/linux/i386/xstat.c
index eb8549944b..eea1bea046 100644
--- a/sysdeps/unix/sysv/linux/i386/xstat.c
+++ b/sysdeps/unix/sysv/linux/i386/xstat.c
@@ -1,5 +1,5 @@
/* xstat using old-style Unix stat system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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;
@@ -54,7 +54,7 @@ __xstat (int vers, const char *name, struct stat *buf)
}
hidden_def (__xstat)
weak_alias (__xstat, _xstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
# undef __xstat64
strong_alias (__xstat, __xstat64);
hidden_ver (__xstat, __xstat64)
diff --git a/sysdeps/unix/sysv/linux/ia64/Makefile b/sysdeps/unix/sysv/linux/ia64/Makefile
index 1de62c528a..97fc7df0b1 100644
--- a/sysdeps/unix/sysv/linux/ia64/Makefile
+++ b/sysdeps/unix/sysv/linux/ia64/Makefile
@@ -19,8 +19,14 @@ endif
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
endif
ifeq ($(subdir),nptl)
libpthread-sysdep_routines += __ia64_longjmp unwind_longjmp __sigstack_longjmp
endif
+
+ifeq ($(subdir),conform)
+# For bug 21634.
+conformtest-xfail-conds += ia64-linux
+endif
diff --git a/sysdeps/unix/sysv/linux/ia64/Versions b/sysdeps/unix/sysv/linux/ia64/Versions
index b38d6ef62e..116f4e8503 100644
--- a/sysdeps/unix/sysv/linux/ia64/Versions
+++ b/sysdeps/unix/sysv/linux/ia64/Versions
@@ -22,6 +22,9 @@ libc {
GLIBC_2.2.6 {
getunwind;
}
+ GLIBC_2.24 {
+ recvmsg; sendmsg;
+ }
}
libpthread {
GLIBC_2.3.3 {
diff --git a/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S
index 1b149aa1ec..6fbf4a631d 100644
--- a/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S b/sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S
index 33434338d4..6b5d05b05f 100644
--- a/sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S
+++ b/sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/__longjmp.S b/sysdeps/unix/sysv/linux/ia64/__longjmp.S
index 146617aab4..b66caeca2a 100644
--- a/sysdeps/unix/sysv/linux/ia64/__longjmp.S
+++ b/sysdeps/unix/sysv/linux/ia64/__longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c b/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c
index 18ff2c9b95..efe43535c6 100644
--- a/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c
+++ b/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/__start_context.S b/sysdeps/unix/sysv/linux/ia64/__start_context.S
index 97fdd94585..0271b2ed46 100644
--- a/sysdeps/unix/sysv/linux/ia64/__start_context.S
+++ b/sysdeps/unix/sysv/linux/ia64/__start_context.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/arch-fork.h b/sysdeps/unix/sysv/linux/ia64/arch-fork.h
deleted file mode 100644
index ad700ca3a4..0000000000
--- a/sysdeps/unix/sysv/linux/ia64/arch-fork.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. IA64 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone2, 6, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
- NULL, 0, NULL, &THREAD_SELF->tid, NULL)
-
-#define ARCH_CLONE __clone2
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
index 8ba72f6163..7790c09693 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/IA64.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/ipc.h b/sysdeps/unix/sysv/linux/ia64/bits/ipc.h
index ead551f9ad..4f5bd2f09d 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h b/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h
index 91376c1aaa..80c61ed4f0 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Linux/IA-64 version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/mman.h b/sysdeps/unix/sysv/linux/ia64/bits/mman.h
index d67da7bd04..51071fda56 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/ia64 version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,6 +35,10 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_SYNC 0x80000 /* Perform synchronous page
+ faults for the mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Include generic Linux declarations. */
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/msq.h b/sysdeps/unix/sysv/linux/ia64/bits/msq.h
index 86418cd5ff..acf64e8fd9 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contribute by David Mosberger-Tang <davidm@hpl.hp.com>
@@ -58,6 +58,7 @@ struct msqid_ds
/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12
+# define MSG_STAT_ANY 13
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/sem.h b/sysdeps/unix/sysv/linux/ia64/bits/sem.h
index 33901f5fcc..e2637076ae 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
@@ -67,6 +67,7 @@ struct semid_ds
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
+# define SEM_STAT_ANY 20
struct seminfo
{
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h b/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h
index dbeb04d315..f91a6aea37 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h
@@ -1,5 +1,5 @@
/* Define the machine-dependent type `jmp_buf'. Linux/IA-64 version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/shm.h b/sysdeps/unix/sysv/linux/ia64/bits/shm.h
index 89303bbc90..814f61bd7e 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -61,6 +61,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h b/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h
index 6fcf26ed36..76edba2deb 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h
@@ -1,5 +1,5 @@
/* Definitions for Linux/ia64 sigaction.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGACTION_H
+#define _BITS_SIGACTION_H 1
+
#ifndef _SIGNAL_H
# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
#endif
@@ -24,7 +27,7 @@
struct sigaction
{
/* Signal handler. */
-#ifdef __USE_POSIX199309
+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
union
{
/* Used if SA_SIGINFO is not set. */
@@ -51,10 +54,10 @@ struct sigaction
#define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */
#define SA_NOCLDWAIT 0x00000002 /* Don't create zombie on child death. */
#define SA_SIGINFO 0x00000004
-#if defined __USE_UNIX98 || defined __USE_MISC
+#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
#endif
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
# define SA_NODEFER 0x40000000 /* Don't automatically block the signal
when its handler is being executed. */
@@ -73,3 +76,5 @@ struct sigaction
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
#define SIG_SETMASK 2 /* for setting the signal mask */
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h b/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
index 591e7a22f0..130a8fa63c 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jes Sorensen <jes@linuxcare.com>, July 2000
@@ -16,16 +16,19 @@
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>
+#include <bits/types/struct_sigstack.h>
+#include <bits/types/stack_t.h>
+#include <bits/ss_flags.h>
struct __ia64_fpreg
{
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/siginfo-arch.h b/sysdeps/unix/sysv/linux/ia64/bits/siginfo-arch.h
new file mode 100644
index 0000000000..8b5647062c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/bits/siginfo-arch.h
@@ -0,0 +1,17 @@
+/* Architecture-specific adjustments to siginfo_t. ia64 version. */
+#ifndef _BITS_SIGINFO_ARCH_H
+
+#define __SI_HAVE_SIGSYS 0
+
+#define __SI_SIGFAULT_ADDL \
+ int _si_imm; \
+ unsigned int _si_flags; \
+ unsigned long int _si_isr;
+
+#ifdef __USE_GNU
+# define si_imm _sifields._sigfault._si_imm
+# define si_segvflags _sifields._sigfault._si_flags
+# define si_isr _sifields._sigfault._si_isr
+#endif
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/siginfo-consts-arch.h b/sysdeps/unix/sysv/linux/ia64/bits/siginfo-consts-arch.h
new file mode 100644
index 0000000000..4c5c4da516
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/bits/siginfo-consts-arch.h
@@ -0,0 +1,45 @@
+/* Architecture-specific additional siginfo constants. ia64 version. */
+#ifndef _BITS_SIGINFO_CONSTS_ARCH_H
+#define _BITS_SIGINFO_CONSTS_ARCH_H 1
+
+/* `si_code' values for SIGILL signal. */
+enum
+{
+ ILL_BADIADDR = ILL_BADSTK + 1, /* Unimplemented instruction address. */
+#define ILL_BADIADDR ILL_BADIADDR
+ ILL_BREAK
+#define ILL_BREAK ILL_BREAK
+};
+
+/* `si_code' values for SIGFPE signal. */
+enum
+{
+ FPE_DECOVF = FPE_FLTSUB + 1,
+#define FPE_DECOVF FPE_DECOVF
+ FPE_DECDIV,
+#define FPE_DECDIV FPE_DECDIV
+ FPE_DECERR,
+#define FPE_DECERR FPE_DECERR
+ FPE_INVASC,
+#define FPE_INVASC FPE_INVASC
+ FPE_INVDEC
+#define FPE_INVDEC FPE_INVDEC
+};
+
+/* `si_code' values for SIGSEGV signal. */
+enum
+{
+ SEGV_PSTKOVF = SEGV_ACCERR + 1
+#define SEGV_PSTKOVF SEGV_PSTKOVF
+};
+
+/* `si_code' values for SIGTRAP signal. */
+enum
+{
+ TRAP_BRANCH = TRAP_TRACE + 1,
+#define TRAP_BRANCH TRAP_BRANCH
+ TRAP_HWBKPT
+#define TRAP_HWBKPT TRAP_HWBKPT
+};
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h b/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h
deleted file mode 100644
index 80c21ef30d..0000000000
--- a/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h
+++ /dev/null
@@ -1,360 +0,0 @@
-/* siginfo_t, sigevent and constants. Linux/ia64 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-#if !defined _SIGNAL_H && !defined __need_siginfo_t \
- && !defined __need_sigevent_t
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-#if (!defined __have_sigval_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t \
- || defined __need_sigevent_t))
-# define __have_sigval_t 1
-
-/* Type for data associated with a signal. */
-typedef union sigval
- {
- int sival_int;
- void *sival_ptr;
- } sigval_t;
-#endif
-
-#if (!defined __have_siginfo_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t))
-# define __have_siginfo_t 1
-
-# define __SI_MAX_SIZE 128
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
-
-typedef struct
- {
- int si_signo; /* Signal number. */
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int si_code; /* Signal code. */
- int __pad0; /* Explicit padding. */
-
- union
- {
- int _pad[__SI_PAD_SIZE];
-
- /* kill(). */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- } _kill;
-
- /* POSIX.1b timers. */
- struct
- {
- int si_tid; /* Timer ID. */
- int si_overrun; /* Overrun count. */
- sigval_t si_sigval; /* Signal value. */
- } _timer;
-
- /* POSIX.1b signals. */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- sigval_t si_sigval; /* Signal value. */
- } _rt;
-
- /* SIGCHLD. */
- struct
- {
- __pid_t si_pid; /* Which child. */
- __uid_t si_uid; /* Real user ID of sending process. */
- int si_status; /* Exit value or signal. */
- __clock_t si_utime;
- __clock_t si_stime;
- } _sigchld;
-
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
- struct
- {
- void *si_addr; /* Faulting insn/memory ref. */
- int _si_imm;
- unsigned int _si_flags;
- unsigned long int _si_isr;
- short int si_addr_lsb; /* Valid LSB of the reported address. */
- } _sigfault;
-
- /* SIGPOLL. */
- struct
- {
- long int si_band; /* Band event for SIGPOLL. */
- int si_fd;
- } _sigpoll;
- } _sifields;
- } siginfo_t;
-
-
-/* X/Open requires some more fields with fixed names. */
-# define si_pid _sifields._kill.si_pid
-# define si_uid _sifields._kill.si_uid
-# define si_timerid _sifields._timer.si_tid
-# define si_overrun _sifields._timer.si_overrun
-# define si_status _sifields._sigchld.si_status
-# define si_utime _sifields._sigchld.si_utime
-# define si_stime _sifields._sigchld.si_stime
-# define si_value _sifields._rt.si_sigval
-# define si_int _sifields._rt.si_sigval.sival_int
-# define si_ptr _sifields._rt.si_sigval.sival_ptr
-# define si_addr _sifields._sigfault.si_addr
-# define si_addr_lsb _sifields._sigfault.si_addr_lsb
-# define si_band _sifields._sigpoll.si_band
-# define si_fd _sifields._sigpoll.si_fd
-
-# ifdef __USE_GNU
-# define si_imm _sifields._sigfault._si_imm
-# define si_segvflags _sifields._sigfault._si_flags
-# define si_isr _sifields._sigfault._si_isr
-# endif
-
-/* Values for `si_code'. Positive values are reserved for kernel-generated
- signals. */
-enum
-{
- SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
-# define SI_ASYNCNL SI_ASYNCNL
- SI_TKILL = -6, /* Sent by tkill. */
-# define SI_TKILL SI_TKILL
- SI_SIGIO, /* Sent by queued SIGIO. */
-# define SI_SIGIO SI_SIGIO
- SI_ASYNCIO, /* Sent by AIO completion. */
-# define SI_ASYNCIO SI_ASYNCIO
- SI_MESGQ, /* Sent by real time mesq state change. */
-# define SI_MESGQ SI_MESGQ
- SI_TIMER, /* Sent by timer expiration. */
-# define SI_TIMER SI_TIMER
- SI_QUEUE, /* Sent by sigqueue. */
-# define SI_QUEUE SI_QUEUE
- SI_USER, /* Sent by kill, sigsend. */
-# define SI_USER SI_USER
- SI_KERNEL = 0x80 /* Send by kernel. */
-#define SI_KERNEL SI_KERNEL
-};
-
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGILL signal. */
-enum
-{
- ILL_ILLOPC = 1, /* Illegal opcode. */
-# define ILL_ILLOPC ILL_ILLOPC
- ILL_ILLOPN, /* Illegal operand. */
-# define ILL_ILLOPN ILL_ILLOPN
- ILL_ILLADR, /* Illegal addressing mode. */
-# define ILL_ILLADR ILL_ILLADR
- ILL_ILLTRP, /* Illegal trap. */
-# define ILL_ILLTRP ILL_ILLTRP
- ILL_PRVOPC, /* Privileged opcode. */
-# define ILL_PRVOPC ILL_PRVOPC
- ILL_PRVREG, /* Privileged register. */
-# define ILL_PRVREG ILL_PRVREG
- ILL_COPROC, /* Coprocessor error. */
-# define ILL_COPROC ILL_COPROC
- ILL_BADSTK, /* Internal stack error. */
-# define ILL_BADSTK ILL_BADSTK
- ILL_BADIADDR /* Unimplemented instruction address. */
-# define ILL_BADIADDR ILL_BADIADDR
-
-# ifdef __USE_GNU
- , ILL_BREAK
-# define ILL_BREAK ILL_BREAK
-# endif
-};
-
-/* `si_code' values for SIGFPE signal. */
-enum
-{
- FPE_INTDIV = 1, /* Integer divide by zero. */
-# define FPE_INTDIV FPE_INTDIV
- FPE_INTOVF, /* Integer overflow. */
-# define FPE_INTOVF FPE_INTOVF
- FPE_FLTDIV, /* Floating point divide by zero. */
-# define FPE_FLTDIV FPE_FLTDIV
- FPE_FLTOVF, /* Floating point overflow. */
-# define FPE_FLTOVF FPE_FLTOVF
- FPE_FLTUND, /* Floating point underflow. */
-# define FPE_FLTUND FPE_FLTUND
- FPE_FLTRES, /* Floating point inexact result. */
-# define FPE_FLTRES FPE_FLTRES
- FPE_FLTINV, /* Floating point invalid operation. */
-# define FPE_FLTINV FPE_FLTINV
- FPE_FLTSUB /* Subscript out of range. */
-# define FPE_FLTSUB FPE_FLTSUB
-# ifdef __USE_GNU
- , FPE_DECOVF
-# define FPE_DECOVF FPE_DECOVF
- , FPE_DECDIV
-# define FPE_DECDIV FPE_DECDIV
- , FPE_DECERR
-# define FPE_DECERR FPE_DECERR
- , FPE_INVASC
-# define FPE_INVASC FPE_INVASC
- , FPE_INVDEC
-# define FPE_INVDEC FPE_INVDEC
-# endif
-};
-
-/* `si_code' values for SIGSEGV signal. */
-enum
-{
- SEGV_MAPERR = 1, /* Address not mapped to object. */
-# define SEGV_MAPERR SEGV_MAPERR
- SEGV_ACCERR /* Invalid permissions for mapped object. */
-# define SEGV_ACCERR SEGV_ACCERR
-# ifdef __USE_GNU
- , SEGV_PSTKOVF /* Paragraph stack overflow. */
-# define SEGV_PSTKOVF SEGV_PSTKOVF
-# endif
-};
-
-/* `si_code' values for SIGBUS signal. */
-enum
-{
- BUS_ADRALN = 1, /* Invalid address alignment. */
-# define BUS_ADRALN BUS_ADRALN
- BUS_ADRERR, /* Non-existant physical address. */
-# define BUS_ADRERR BUS_ADRERR
- BUS_OBJERR, /* Object specific hardware error. */
-# define BUS_OBJERR BUS_OBJERR
- BUS_MCEERR_AR, /* Hardware memory error: action required. */
-# define BUS_MCEERR_AR BUS_MCEERR_AR
- BUS_MCEERR_AO /* Hardware memory error: action optional. */
-# define BUS_MCEERR_AO BUS_MCEERR_AO
-};
-# endif
-
-# ifdef __USE_XOPEN_EXTENDED
-/* `si_code' values for SIGTRAP signal. */
-enum
-{
- TRAP_BRKPT = 1, /* Process breakpoint. */
-# define TRAP_BRKPT TRAP_BRKPT
- TRAP_TRACE /* Process trace trap. */
-# define TRAP_TRACE TRAP_TRACE
-
-# ifdef __USE_GNU
- , TRAP_BRANCH
-# define TRAP_BRANCH TRAP_BRANCH
- , TRAP_HWBKPT
-# define TRAP_HWBKPT TRAP_HWBKPT
-# endif
-};
-# endif
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGCHLD signal. */
-enum
-{
- CLD_EXITED = 1, /* Child has exited. */
-# define CLD_EXITED CLD_EXITED
- CLD_KILLED, /* Child was killed. */
-# define CLD_KILLED CLD_KILLED
- CLD_DUMPED, /* Child terminated abnormally. */
-# define CLD_DUMPED CLD_DUMPED
- CLD_TRAPPED, /* Traced child has trapped. */
-# define CLD_TRAPPED CLD_TRAPPED
- CLD_STOPPED, /* Child has stopped. */
-# define CLD_STOPPED CLD_STOPPED
- CLD_CONTINUED /* Stopped child has continued. */
-# define CLD_CONTINUED CLD_CONTINUED
-};
-
-/* `si_code' values for SIGPOLL signal. */
-enum
-{
- POLL_IN = 1, /* Data input available. */
-# define POLL_IN POLL_IN
- POLL_OUT, /* Output buffers available. */
-# define POLL_OUT POLL_OUT
- POLL_MSG, /* Input message available. */
-# define POLL_MSG POLL_MSG
- POLL_ERR, /* I/O error. */
-# define POLL_ERR POLL_ERR
- POLL_PRI, /* High priority input available. */
-# define POLL_PRI POLL_PRI
- POLL_HUP /* Device disconnected. */
-# define POLL_HUP POLL_HUP
-};
-# endif
-
-# undef __need_siginfo_t
-#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
-
-
-#if (defined _SIGNAL_H || defined __need_sigevent_t) \
- && !defined __have_sigevent_t
-# define __have_sigevent_t 1
-
-/* Structure to transport application-defined values with signals. */
-# define __SIGEV_MAX_SIZE 64
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
-
-/* Forward declaration. */
-# ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-# endif
-
-typedef struct sigevent
- {
- sigval_t sigev_value;
- int sigev_signo;
- int sigev_notify;
-
- union
- {
- int _pad[__SIGEV_PAD_SIZE];
-
- /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
- thread to receive the signal. */
- __pid_t _tid;
-
- struct
- {
- void (*_function) (sigval_t); /* Function to start. */
- pthread_attr_t *_attribute; /* Thread attributes. */
- } _sigev_thread;
- } _sigev_un;
- } sigevent_t;
-
-/* POSIX names to access some of the members. */
-# define sigev_notify_function _sigev_un._sigev_thread._function
-# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
-
-/* `sigev_notify' values. */
-enum
-{
- SIGEV_SIGNAL = 0, /* Notify via signal. */
-# define SIGEV_SIGNAL SIGEV_SIGNAL
- SIGEV_NONE, /* Other notification: meaningless. */
-# define SIGEV_NONE SIGEV_NONE
- SIGEV_THREAD, /* Deliver via thread creation. */
-# define SIGEV_THREAD SIGEV_THREAD
-
- SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
-#define SIGEV_THREAD_ID SIGEV_THREAD_ID
-};
-
-#endif /* have _SIGNAL_H. */
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h b/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
index 0cd5e84043..89d3917c0a 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
@@ -1,5 +1,5 @@
/* sigstack, sigaltstack definitions.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software 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,30 +16,13 @@
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
-
-/* Structure describing a signal stack (obsolete). */
-struct sigstack
- {
- __ptr_t ss_sp; /* Signal stack pointer. */
- int ss_onstack; /* Nonzero if executing on this stack. */
- };
-
-
-/* Possible values for `ss_flags.'. */
-enum
-{
- SS_ONSTACK = 1,
-#define SS_ONSTACK SS_ONSTACK
- SS_DISABLE
-#define SS_DISABLE SS_DISABLE
-};
-
/* Minimum stack size for a signal handler.
Yes, this should be 131072 but the constant got defined incorrectly
@@ -50,13 +33,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/bits/stat.h b/sysdeps/unix/sysv/linux/ia64/bits/stat.h
index 51cf061287..63d8b5c08e 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/brk.S b/sysdeps/unix/sysv/linux/ia64/brk.S
index f056574d91..a29a0169b4 100644
--- a/sysdeps/unix/sysv/linux/ia64/brk.S
+++ b/sysdeps/unix/sysv/linux/ia64/brk.S
@@ -1,5 +1,5 @@
/* brk system call for Linux/ia64
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Stephane Eranian <eranian@hpl.hp.com> and
Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
diff --git a/sysdeps/unix/sysv/linux/ia64/clone2.S b/sysdeps/unix/sysv/linux/ia64/clone2.S
index 9b257b3c9b..b381817dfa 100644
--- a/sysdeps/unix/sysv/linux/ia64/clone2.S
+++ b/sysdeps/unix/sysv/linux/ia64/clone2.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -67,35 +67,23 @@ ENTRY(__clone2)
(CHILD) mov loc0=gp
(PARENT) ret
;;
- tbit.nz p6,p0=in3,16 /* CLONE_THREAD */
- tbit.z p7,p10=in3,8 /* CLONE_VM */
-(p6) br.cond.dptk 1f
- ;;
- mov r15=SYS_ify (getpid)
-(p10) addl r8=-1,r0
-(p7) break __BREAK_SYSCALL
- ;;
- add r9=PID,r13
- add r10=TID,r13
- ;;
- st4 [r9]=r8
- st4 [r10]=r8
- ;;
-1: ld8 out1=[in0],8 /* Retrieve code pointer. */
+ ld8 out1=[in0],8 /* Retrieve code pointer. */
mov out0=in4 /* Pass proper argument to fn */
;;
ld8 gp=[in0] /* Load function gp. */
mov b6=out1
br.call.dptk.many rp=b6 /* Call fn(arg) in the child */
;;
- mov out0=r8 /* Argument to _exit */
+ mov out0=r8 /* Argument to exit */
mov gp=loc0
- .globl HIDDEN_JUMPTARGET(_exit)
- br.call.dpnt.many rp=HIDDEN_JUMPTARGET(_exit)
- /* call _exit with result from fn. */
+ mov r15=SYS_ify (exit)
+ .save rp, r0
+ break __BREAK_SYSCALL
ret /* Not reached. */
PSEUDO_END(__clone2)
+libc_hidden_def (__clone2)
+
/* For now we leave __clone undefined. This is unlikely to be a */
/* problem, since at least the i386 __clone in glibc always failed */
/* with a 0 sp (eventhough the kernel explicitly handled it). */
diff --git a/sysdeps/unix/sysv/linux/ia64/configure b/sysdeps/unix/sysv/linux/ia64/configure
index 1d4e5d18d6..3cf72371ef 100644
--- a/sysdeps/unix/sysv/linux/ia64/configure
+++ b/sysdeps/unix/sysv/linux/ia64/configure
@@ -2,3 +2,7 @@
# Local configure fragment for sysdeps/unix/sysv/linux/ia64
ldd_rewrite_script=$dir/ldd-rewrite.sed
+
+# First version with support for the accept4 system call.
+# Linux 3.3 includes it as well.
+arch_minimum_kernel=3.2.18
diff --git a/sysdeps/unix/sysv/linux/ia64/configure.ac b/sysdeps/unix/sysv/linux/ia64/configure.ac
index 4fb564721b..94a578c12d 100644
--- a/sysdeps/unix/sysv/linux/ia64/configure.ac
+++ b/sysdeps/unix/sysv/linux/ia64/configure.ac
@@ -2,3 +2,7 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/unix/sysv/linux/ia64
ldd_rewrite_script=$dir/ldd-rewrite.sed
+
+# First version with support for the accept4 system call.
+# Linux 3.3 includes it as well.
+arch_minimum_kernel=3.2.18
diff --git a/sysdeps/unix/sysv/linux/ia64/dl-cache.h b/sysdeps/unix/sysv/linux/ia64/dl-cache.h
index 801a062271..3bea05fa9c 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/ia64/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/dl-static.c b/sysdeps/unix/sysv/linux/ia64/dl-static.c
index 003fd8dc65..52c956ac65 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-static.c
+++ b/sysdeps/unix/sysv/linux/ia64/dl-static.c
@@ -1,5 +1,5 @@
/* Variable initialization. IA-64 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
index 1a1a62a3a4..977336b871 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. IA-64 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c b/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c
index 2ff557d7eb..f9d683a902 100644
--- a/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c
+++ b/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c
@@ -1,5 +1,5 @@
/* Get frequency of the system processor. IA-64/Linux version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,6 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-#include <libc-internal.h>
hp_timing_t
diff --git a/sysdeps/unix/sysv/linux/ia64/getcontext.S b/sysdeps/unix/sysv/linux/ia64/getcontext.S
index d2e39f6967..cf1dfe74f1 100644
--- a/sysdeps/unix/sysv/linux/ia64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/ia64/getcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/has_cpuclock.c b/sysdeps/unix/sysv/linux/ia64/has_cpuclock.c
index f80981303d..75f3ef9f4d 100644
--- a/sysdeps/unix/sysv/linux/ia64/has_cpuclock.c
+++ b/sysdeps/unix/sysv/linux/ia64/has_cpuclock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,18 +30,18 @@ has_cpuclock (void)
if (__builtin_expect (itc_usable == 0, 0))
{
int newval = 1;
- int fd = open_not_cancel_2 ("/proc/sal/itc_drift", O_RDONLY);
+ int fd = __open_nocancel ("/proc/sal/itc_drift", O_RDONLY);
if (__builtin_expect (fd != -1, 1))
{
char buf[16];
/* We expect the file to contain a single digit followed by
a newline. If the format changes we better not rely on
the file content. */
- if (read_not_cancel (fd, buf, sizeof buf) != 2
+ if (__read_nocancel (fd, buf, sizeof buf) != 2
|| buf[0] != '0' || buf[1] != '\n')
newval = -1;
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
}
itc_usable = newval;
diff --git a/sysdeps/unix/sysv/linux/ia64/ioperm.c b/sysdeps/unix/sysv/linux/ia64/ioperm.c
index f373ca863e..af02a995c1 100644
--- a/sysdeps/unix/sysv/linux/ia64/ioperm.c
+++ b/sysdeps/unix/sysv/linux/ia64/ioperm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/ipc_priv.h b/sysdeps/unix/sysv/linux/ia64/ipc_priv.h
new file mode 100644
index 0000000000..1d877ffdb0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/ipc_priv.h
@@ -0,0 +1,21 @@
+/* Old SysV permission definition for Linux. IA64 version.
+ Copyright (C) 2017-2018 Free Software 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/ipc.h> /* For __key_t */
+
+#define __IPC_64 0x0
diff --git a/sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h
new file mode 100644
index 0000000000..41788657ec
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 704
+#define SIGJMP_BUF_SIZE 704
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 560
+#define SAVED_MASK_OFFSET 568
diff --git a/sysdeps/unix/sysv/linux/ia64/kernel-features.h b/sysdeps/unix/sysv/linux/ia64/kernel-features.h
index ec7660d491..4fde73fba1 100644
--- a/sysdeps/unix/sysv/linux/ia64/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/ia64/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,21 +20,16 @@
#ifndef _KERNEL_FEATURES_H
#define _KERNEL_FEATURES_H 1
-/* Support for the recvmmsg syscall was added in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
+#include_next <kernel-features.h>
-/* Support for the sendmmsg syscall was added in 3.0. */
-#if __LINUX_KERNEL_VERSION >= 0x030000
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
+#define __ASSUME_RECV_SYSCALL 1
+#define __ASSUME_SEND_SYSCALL 1
+#define __ASSUME_ACCEPT4_SYSCALL 1
-/* Support for the accept4 syscall was added in 3.3. */
-#if __LINUX_KERNEL_VERSION >= 0x030300
-# define __ASSUME_ACCEPT4_SYSCALL 1
-#endif
+/* No statx system call on ia64 yet. */
+#undef __ASSUME_STATX
-#include_next <kernel-features.h>
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE2
#endif /* _KERNEL_FEATURES_H */
diff --git a/sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h b/sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h
new file mode 100644
index 0000000000..fc9f29603c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h
@@ -0,0 +1,7 @@
+/* This is the sigaction structure from the Linux 3.2 kernel. */
+struct kernel_sigaction
+{
+ __sighandler_t k_sa_handler;
+ unsigned long sa_flags;
+ sigset_t sa_mask; /* mask last for extensibility */
+};
diff --git a/sysdeps/unix/sysv/linux/ia64/kernel_stat.h b/sysdeps/unix/sysv/linux/ia64/kernel_stat.h
index 2f6fbb22dd..98adda41fc 100644
--- a/sysdeps/unix/sysv/linux/ia64/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/ia64/kernel_stat.h
@@ -1,5 +1,5 @@
/* Definition of `struct stat' used in the kernel.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,3 +18,4 @@
#define STAT_IS_KERNEL_STAT 1
#define XSTAT_IS_XSTAT64 1
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/ia64/ld.abilist b/sysdeps/unix/sysv/linux/ia64/ld.abilist
index 9041ccbe60..82042472c3 100644
--- a/sysdeps/unix/sysv/linux/ia64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
-GLIBC_2.2 __libc_memalign F
GLIBC_2.2 __libc_stack_end D 0x8
GLIBC_2.2 _dl_mcount F
GLIBC_2.2 _r_debug D 0x28
@@ -7,6 +5,4 @@ GLIBC_2.2 calloc F
GLIBC_2.2 free F
GLIBC_2.2 malloc F
GLIBC_2.2 realloc F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/ia64/ldconfig.h b/sysdeps/unix/sysv/linux/ia64/ldconfig.h
index d5d3646f5b..d97ace388c 100644
--- a/sysdeps/unix/sysv/linux/ia64/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/ia64/ldconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/ldsodefs.h b/sysdeps/unix/sysv/linux/ia64/ldsodefs.h
index cf38d11733..3bdc347b6d 100644
--- a/sysdeps/unix/sysv/linux/ia64/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/ia64/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects. IA64.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/ia64/libBrokenLocale.abilist
index 21343df781..0e4d814909 100644
--- a/sysdeps/unix/sysv/linux/ia64/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/ia64/libanl.abilist b/sysdeps/unix/sysv/linux/ia64/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/ia64/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index 921ec55eeb..50c94adff9 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -25,33 +24,28 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x438
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x438
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -60,7 +54,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -71,16 +64,13 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _Exit F
GLIBC_2.2 _IO_2_1_stderr_ D 0xe0
GLIBC_2.2 _IO_2_1_stdin_ D 0xe0
@@ -1846,35 +1836,84 @@ GLIBC_2.2 xdrstdio_create F
GLIBC_2.2 xencrypt F
GLIBC_2.2 xprt_register F
GLIBC_2.2 xprt_unregister F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
GLIBC_2.2.2 wordexp F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
GLIBC_2.2.6 getunwind F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 __strtof128_internal F
+GLIBC_2.26 __wcstof128_internal F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.26 strfromf128 F
+GLIBC_2.26 strtof128 F
+GLIBC_2.26 strtof128_l F
+GLIBC_2.26 wcstof128 F
+GLIBC_2.26 wcstof128_l F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -1966,7 +2005,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -1979,7 +2017,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x208
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2000,7 +2037,6 @@ GLIBC_2.3.3 strtoll_l F
GLIBC_2.3.3 strtoull_l F
GLIBC_2.3.3 sys_sigabbrev D 0x208
GLIBC_2.3.3 sys_siglist D 0x208
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2030,7 +2066,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2107,7 +2142,6 @@ GLIBC_2.4 sys_errlist D 0x420
GLIBC_2.4 sys_nerr D 0x4
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2125,7 +2159,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2133,7 +2166,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2160,7 +2192,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2171,7 +2202,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/ia64/libcrypt.abilist b/sysdeps/unix/sysv/linux/ia64/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/ia64/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/ia64/libdl.abilist b/sysdeps/unix/sysv/linux/ia64/libdl.abilist
index 5536f6e0a9..7826fde951 100644
--- a/sysdeps/unix/sysv/linux/ia64/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 dlopen F
GLIBC_2.1 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/ia64/libm.abilist b/sysdeps/unix/sysv/linux/ia64/libm.abilist
index 6d4cc72e0e..33a99ff678 100644
--- a/sysdeps/unix/sysv/linux/ia64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __j0_finite F
GLIBC_2.15 __j0f_finite F
GLIBC_2.15 __j0l_finite F
@@ -17,11 +16,9 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _LIB_VERSION D 0x4
GLIBC_2.2 __clog10 F
GLIBC_2.2 __clog10f F
@@ -336,12 +333,675 @@ GLIBC_2.2 y1l F
GLIBC_2.2 yn F
GLIBC_2.2 ynf F
GLIBC_2.2 ynl F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 matherrf F
GLIBC_2.2.3 matherrl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.26 __acosf128_finite F
+GLIBC_2.26 __acoshf128_finite F
+GLIBC_2.26 __asinf128_finite F
+GLIBC_2.26 __atan2f128_finite F
+GLIBC_2.26 __atanhf128_finite F
+GLIBC_2.26 __coshf128_finite F
+GLIBC_2.26 __exp10f128_finite F
+GLIBC_2.26 __exp2f128_finite F
+GLIBC_2.26 __expf128_finite F
+GLIBC_2.26 __finitef128 F
+GLIBC_2.26 __fmodf128_finite F
+GLIBC_2.26 __fpclassifyf128 F
+GLIBC_2.26 __gammaf128_r_finite F
+GLIBC_2.26 __hypotf128_finite F
+GLIBC_2.26 __iseqsigf128 F
+GLIBC_2.26 __isinff128 F
+GLIBC_2.26 __isnanf128 F
+GLIBC_2.26 __issignalingf128 F
+GLIBC_2.26 __j0f128_finite F
+GLIBC_2.26 __j1f128_finite F
+GLIBC_2.26 __jnf128_finite F
+GLIBC_2.26 __lgammaf128_r_finite F
+GLIBC_2.26 __log10f128_finite F
+GLIBC_2.26 __log2f128_finite F
+GLIBC_2.26 __logf128_finite F
+GLIBC_2.26 __powf128_finite F
+GLIBC_2.26 __remainderf128_finite F
+GLIBC_2.26 __signbitf128 F
+GLIBC_2.26 __sinhf128_finite F
+GLIBC_2.26 __sqrtf128_finite F
+GLIBC_2.26 __y0f128_finite F
+GLIBC_2.26 __y1f128_finite F
+GLIBC_2.26 __ynf128_finite F
+GLIBC_2.26 acosf128 F
+GLIBC_2.26 acoshf128 F
+GLIBC_2.26 asinf128 F
+GLIBC_2.26 asinhf128 F
+GLIBC_2.26 atan2f128 F
+GLIBC_2.26 atanf128 F
+GLIBC_2.26 atanhf128 F
+GLIBC_2.26 cabsf128 F
+GLIBC_2.26 cacosf128 F
+GLIBC_2.26 cacoshf128 F
+GLIBC_2.26 canonicalizef128 F
+GLIBC_2.26 cargf128 F
+GLIBC_2.26 casinf128 F
+GLIBC_2.26 casinhf128 F
+GLIBC_2.26 catanf128 F
+GLIBC_2.26 catanhf128 F
+GLIBC_2.26 cbrtf128 F
+GLIBC_2.26 ccosf128 F
+GLIBC_2.26 ccoshf128 F
+GLIBC_2.26 ceilf128 F
+GLIBC_2.26 cexpf128 F
+GLIBC_2.26 cimagf128 F
+GLIBC_2.26 clog10f128 F
+GLIBC_2.26 clogf128 F
+GLIBC_2.26 conjf128 F
+GLIBC_2.26 copysignf128 F
+GLIBC_2.26 cosf128 F
+GLIBC_2.26 coshf128 F
+GLIBC_2.26 cpowf128 F
+GLIBC_2.26 cprojf128 F
+GLIBC_2.26 crealf128 F
+GLIBC_2.26 csinf128 F
+GLIBC_2.26 csinhf128 F
+GLIBC_2.26 csqrtf128 F
+GLIBC_2.26 ctanf128 F
+GLIBC_2.26 ctanhf128 F
+GLIBC_2.26 erfcf128 F
+GLIBC_2.26 erff128 F
+GLIBC_2.26 exp10f128 F
+GLIBC_2.26 exp2f128 F
+GLIBC_2.26 expf128 F
+GLIBC_2.26 expm1f128 F
+GLIBC_2.26 fabsf128 F
+GLIBC_2.26 fdimf128 F
+GLIBC_2.26 floorf128 F
+GLIBC_2.26 fmaf128 F
+GLIBC_2.26 fmaxf128 F
+GLIBC_2.26 fmaxmagf128 F
+GLIBC_2.26 fminf128 F
+GLIBC_2.26 fminmagf128 F
+GLIBC_2.26 fmodf128 F
+GLIBC_2.26 frexpf128 F
+GLIBC_2.26 fromfpf128 F
+GLIBC_2.26 fromfpxf128 F
+GLIBC_2.26 getpayloadf128 F
+GLIBC_2.26 hypotf128 F
+GLIBC_2.26 ilogbf128 F
+GLIBC_2.26 j0f128 F
+GLIBC_2.26 j1f128 F
+GLIBC_2.26 jnf128 F
+GLIBC_2.26 ldexpf128 F
+GLIBC_2.26 lgammaf128 F
+GLIBC_2.26 lgammaf128_r F
+GLIBC_2.26 llogbf128 F
+GLIBC_2.26 llrintf128 F
+GLIBC_2.26 llroundf128 F
+GLIBC_2.26 log10f128 F
+GLIBC_2.26 log1pf128 F
+GLIBC_2.26 log2f128 F
+GLIBC_2.26 logbf128 F
+GLIBC_2.26 logf128 F
+GLIBC_2.26 lrintf128 F
+GLIBC_2.26 lroundf128 F
+GLIBC_2.26 modff128 F
+GLIBC_2.26 nanf128 F
+GLIBC_2.26 nearbyintf128 F
+GLIBC_2.26 nextafterf128 F
+GLIBC_2.26 nextdownf128 F
+GLIBC_2.26 nextupf128 F
+GLIBC_2.26 powf128 F
+GLIBC_2.26 remainderf128 F
+GLIBC_2.26 remquof128 F
+GLIBC_2.26 rintf128 F
+GLIBC_2.26 roundevenf128 F
+GLIBC_2.26 roundf128 F
+GLIBC_2.26 scalblnf128 F
+GLIBC_2.26 scalbnf128 F
+GLIBC_2.26 setpayloadf128 F
+GLIBC_2.26 setpayloadsigf128 F
+GLIBC_2.26 sincosf128 F
+GLIBC_2.26 sinf128 F
+GLIBC_2.26 sinhf128 F
+GLIBC_2.26 sqrtf128 F
+GLIBC_2.26 tanf128 F
+GLIBC_2.26 tanhf128 F
+GLIBC_2.26 tgammaf128 F
+GLIBC_2.26 totalorderf128 F
+GLIBC_2.26 totalordermagf128 F
+GLIBC_2.26 truncf128 F
+GLIBC_2.26 ufromfpf128 F
+GLIBC_2.26 ufromfpxf128 F
+GLIBC_2.26 y0f128 F
+GLIBC_2.26 y1f128 F
+GLIBC_2.26 ynf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/ia64/libnsl.abilist b/sysdeps/unix/sysv/linux/ia64/libnsl.abilist
index a23db2aeaf..add3d66a7a 100644
--- a/sysdeps/unix/sysv/linux/ia64/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __free_fdresult F
GLIBC_2.1 __nis_default_access F
GLIBC_2.1 __nis_default_group F
@@ -120,5 +118,4 @@ GLIBC_2.1 readColdStartFile F
GLIBC_2.1 writeColdStartFile F
GLIBC_2.1 xdr_cback_data F
GLIBC_2.1 xdr_obj_p F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 xdr_ypall F
diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
index d4c8dedd6c..ccc9449826 100644
--- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
@@ -1,15 +1,11 @@
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_flockfile F
GLIBC_2.2 _IO_ftrylockfile F
GLIBC_2.2 _IO_funlockfile F
@@ -200,18 +196,35 @@ GLIBC_2.2 vfork F
GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -229,13 +242,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/ia64/libresolv.abilist b/sysdeps/unix/sysv/linux/ia64/libresolv.abilist
index 2d92a35e81..06f995151c 100644
--- a/sysdeps/unix/sysv/linux/ia64/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/ia64/librt.abilist b/sysdeps/unix/sysv/linux/ia64/librt.abilist
index aa32ef3be0..804622a14a 100644
--- a/sysdeps/unix/sysv/linux/ia64/librt.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 aio_cancel F
GLIBC_2.1 aio_cancel64 F
GLIBC_2.1 aio_error F
@@ -16,7 +15,6 @@ GLIBC_2.1 aio_write F
GLIBC_2.1 aio_write64 F
GLIBC_2.1 lio_listio F
GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 clock_getcpuclockid F
GLIBC_2.2 clock_getres F
GLIBC_2.2 clock_gettime F
@@ -29,13 +27,11 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 timer_create F
GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -46,8 +42,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/ia64/libthread_db.abilist b/sysdeps/unix/sysv/linux/ia64/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/ia64/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/ia64/libutil.abilist b/sysdeps/unix/sysv/linux/ia64/libutil.abilist
index 89c67755c4..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/ia64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
diff --git a/sysdeps/unix/sysv/linux/ia64/localplt.data b/sysdeps/unix/sysv/linux/ia64/localplt.data
index b628ca4dfc..3820e2a4e6 100644
--- a/sysdeps/unix/sysv/linux/ia64/localplt.data
+++ b/sysdeps/unix/sysv/linux/ia64/localplt.data
@@ -6,11 +6,14 @@ libc.so: realloc
libm.so: matherr
libm.so: matherrf
libm.so: matherrl
-# 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
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/ia64/makecontext.c b/sysdeps/unix/sysv/linux/ia64/makecontext.c
index 6a53849afe..0652a6768d 100644
--- a/sysdeps/unix/sysv/linux/ia64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/ia64/makecontext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
@@ -40,7 +40,7 @@ do { \
void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
- struct sigcontext *sc = &ucp->uc_mcontext;
+ mcontext_t *sc = &ucp->uc_mcontext;
extern void __start_context (ucontext_t *link, long gp, ...);
unsigned long stack_start, stack_end;
va_list ap;
diff --git a/sysdeps/unix/sysv/linux/ia64/mmap_internal.h b/sysdeps/unix/sysv/linux/ia64/mmap_internal.h
new file mode 100644
index 0000000000..cc46836913
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/mmap_internal.h
@@ -0,0 +1,29 @@
+/* Common mmap definition for Linux implementation. Linux/ia64 version.
+ Copyright (C) 2017-2018 Free Software 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 MMAP_IA64_INTERNAL_LINUX_H
+#define MMAP_IA64_INTERNAL_LINUX_H
+
+/* Linux allows PAGE_SHIFT in range of [12-16] and expect
+ mmap2 offset to be provided in based on the configured pagesize.
+ Determine the shift dynamically with getpagesize. */
+#define MMAP2_PAGE_UNIT -1
+
+#include_next <mmap_internal.h>
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/ia64/pipe.S b/sysdeps/unix/sysv/linux/ia64/pipe.S
index d7d323914a..de23fb39a3 100644
--- a/sysdeps/unix/sysv/linux/ia64/pipe.S
+++ b/sysdeps/unix/sysv/linux/ia64/pipe.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger <davidm@hpl.hp.com>
diff --git a/sysdeps/unix/sysv/linux/ia64/profil-counter.h b/sysdeps/unix/sysv/linux/ia64/profil-counter.h
index bbdc7afc72..c07c1e587c 100644
--- a/sysdeps/unix/sysv/linux/ia64/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/ia64/profil-counter.h
@@ -1,5 +1,5 @@
/* Machine-dependent SIGPROF signal handler. IA-64 version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/pt-vfork.S b/sysdeps/unix/sysv/linux/ia64/pt-vfork.S
index d5acf7e1fc..61f3e387b4 100644
--- a/sysdeps/unix/sysv/linux/ia64/pt-vfork.S
+++ b/sysdeps/unix/sysv/linux/ia64/pt-vfork.S
@@ -1,5 +1,5 @@
/* vfork ABI-compatibility entry points for libpthread. IA64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/readelflib.c b/sysdeps/unix/sysv/linux/ia64/readelflib.c
index 87e836a53d..81401b00e0 100644
--- a/sysdeps/unix/sysv/linux/ia64/readelflib.c
+++ b/sysdeps/unix/sysv/linux/ia64/readelflib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/register-dump.h b/sysdeps/unix/sysv/linux/ia64/register-dump.h
index 04e831e3bf..952b4e9de0 100644
--- a/sysdeps/unix/sysv/linux/ia64/register-dump.h
+++ b/sysdeps/unix/sysv/linux/ia64/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
diff --git a/sysdeps/unix/sysv/linux/ia64/setcontext.S b/sysdeps/unix/sysv/linux/ia64/setcontext.S
index 731dac9ed9..9fb8d1e325 100644
--- a/sysdeps/unix/sysv/linux/ia64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/ia64/setcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/setjmp.S b/sysdeps/unix/sysv/linux/ia64/setjmp.S
index 876a44960d..fb0325bf9e 100644
--- a/sysdeps/unix/sysv/linux/ia64/setjmp.S
+++ b/sysdeps/unix/sysv/linux/ia64/setjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/sigaction.c b/sysdeps/unix/sysv/linux/ia64/sigaction.c
deleted file mode 100644
index cb3c4e74ef..0000000000
--- a/sysdeps/unix/sysv/linux/ia64/sigaction.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Linux/IA64 specific sigaction
- Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* Linux/ia64 only has rt signals, thus we do not even want to try falling
- back to the old style signals as the default Linux handler does. */
-
-#include <errno.h>
-#include <signal.h>
-#include <string.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* The variable is shared between all wrappers around signal handling
- functions which have RT equivalents. This is the definition. */
-
-
-/* If ACT is not NULL, change the action for SIG to *ACT.
- If OACT is not NULL, put the old action for SIG in *OACT. */
-int
-__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
-{
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigaction, 4, sig, act, oact, _NSIG / 8);
-}
-libc_hidden_def (__libc_sigaction)
-
-#include <nptl/sigaction.c>
diff --git a/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym b/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym
index 943e68a667..ac3e3c8dea 100644
--- a/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym
+++ b/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym
@@ -2,15 +2,15 @@
#include <sys/ucontext.h>
--
-SC_NAT offsetof (struct sigcontext, sc_nat)
-SC_BSP offsetof (struct sigcontext, sc_ar_bsp)
-SC_RNAT offsetof (struct sigcontext, sc_ar_rnat)
-SC_UNAT offsetof (struct sigcontext, sc_ar_unat)
-SC_FPSR offsetof (struct sigcontext, sc_ar_fpsr)
-SC_PFS offsetof (struct sigcontext, sc_ar_pfs)
-SC_LC offsetof (struct sigcontext, sc_ar_lc)
-SC_PR offsetof (struct sigcontext, sc_pr)
-SC_BR offsetof (struct sigcontext, sc_br)
-SC_GR offsetof (struct sigcontext, sc_gr)
-SC_FR offsetof (struct sigcontext, sc_fr)
-SC_MASK offsetof (struct sigcontext, sc_mask)
+SC_NAT offsetof (mcontext_t, sc_nat)
+SC_BSP offsetof (mcontext_t, sc_ar_bsp)
+SC_RNAT offsetof (mcontext_t, sc_ar_rnat)
+SC_UNAT offsetof (mcontext_t, sc_ar_unat)
+SC_FPSR offsetof (mcontext_t, sc_ar_fpsr)
+SC_PFS offsetof (mcontext_t, sc_ar_pfs)
+SC_LC offsetof (mcontext_t, sc_ar_lc)
+SC_PR offsetof (mcontext_t, sc_pr)
+SC_BR offsetof (mcontext_t, sc_br)
+SC_GR offsetof (mcontext_t, sc_gr)
+SC_FR offsetof (mcontext_t, sc_fr)
+SC_MASK offsetof (mcontext_t, sc_mask)
diff --git a/sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h b/sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h
index ac5df46e49..4163aa34a4 100644
--- a/sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software 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,10 +16,4 @@
<http://www.gnu.org/licenses/>. */
#define SIGCONTEXT siginfo_t *_si, struct sigcontext *
-#define SIGCONTEXT_EXTRA_ARGS _si,
#define GET_PC(ctx) ((ctx)->sc_ip)
-#define GET_FRAME(ctx) ((void *) 0)
-#define GET_STACK(ctx) ((void *) 0)
-
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/ia64/sigpending.c b/sysdeps/unix/sysv/linux/ia64/sigpending.c
deleted file mode 100644
index fac1775b1f..0000000000
--- a/sysdeps/unix/sysv/linux/ia64/sigpending.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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/>. */
-
-/* Linux/ia64 only has rt signals, thus we do not even want to try falling
- back to the old style signals as the default Linux handler does. */
-
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Change the set of blocked signals to SET,
- wait until a signal arrives, and restore the set of blocked signals. */
-int
-sigpending (sigset_t *set)
-{
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
-}
diff --git a/sysdeps/unix/sysv/linux/ia64/sigprocmask.c b/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
index 7a3eed1a0d..6bc366131f 100644
--- a/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Linux/IA64 specific sigprocmask
Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
@@ -36,4 +36,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
real size of the user-level sigset_t. */
return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
+libc_hidden_def (__sigprocmask)
weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/ia64/swapcontext.c b/sysdeps/unix/sysv/linux/ia64/swapcontext.c
index f307f492b3..b33c1c6771 100644
--- a/sysdeps/unix/sysv/linux/ia64/swapcontext.c
+++ b/sysdeps/unix/sysv/linux/ia64/swapcontext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/sys/io.h b/sysdeps/unix/sysv/linux/ia64/sys/io.h
index d3768ababd..fb5376eebc 100644
--- a/sysdeps/unix/sysv/linux/ia64/sys/io.h
+++ b/sysdeps/unix/sysv/linux/ia64/sys/io.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
diff --git a/sysdeps/unix/sysv/linux/ia64/sys/procfs.h b/sysdeps/unix/sysv/linux/ia64/sys/procfs.h
index 8012590b6f..c9c30b9270 100644
--- a/sysdeps/unix/sysv/linux/ia64/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/ia64/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/ucontext.h>
+#include <bits/sigcontext.h>
#include <sys/user.h>
__BEGIN_DECLS
@@ -73,7 +74,7 @@ struct elf_prstatus
unsigned long int pr_sigpend; /* Set of pending signals. */
unsigned long int pr_sighold; /* Set of held signals. */
#if 0
- struct sigaltstack pr_altstack; /* Alternate stack info. */
+ stack_t pr_altstack; /* Alternate stack info. */
struct sigaction pr_action; /* Signal action for current sig. */
#endif
__pid_t pr_pid;
diff --git a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
index b568a66871..e00b1212fc 100644
--- a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Linux/ia64 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <features.h>
#include <sys/ucontext.h>
+#include <bits/sigcontext.h>
#include <bits/types.h>
__BEGIN_DECLS
@@ -66,8 +67,7 @@ enum __ptrace_request
PTRACE_KILL = 8,
#define PT_KILL PTRACE_KILL
- /* Single step the process.
- This is not supported on all machines. */
+ /* Single step the process. */
PTRACE_SINGLESTEP = 9,
#define PT_STEP PTRACE_SINGLESTEP
@@ -91,7 +91,7 @@ enum __ptrace_request
PTRACE_SETREGS = 19,
#define PT_SETREGS PTRACE_SETREGS
- /* Continue and stop at the next (return from) syscall. */
+ /* Continue and stop at the next entry to or return from syscall. */
PTRACE_SYSCALL = 24,
#define PT_SYSCALL PTRACE_SYSCALL
@@ -132,26 +132,28 @@ enum __ptrace_request
PTRACE_LISTEN = 0x4208,
#define PTRACE_LISTEN PTRACE_LISTEN
+ /* Retrieve siginfo_t structures without removing signals from a queue. */
PTRACE_PEEKSIGINFO = 0x4209,
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+ /* Get the mask of blocked signals. */
PTRACE_GETSIGMASK = 0x420a,
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
+ /* Change the mask of blocked signals. */
PTRACE_SETSIGMASK = 0x420b,
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
- PTRACE_SECCOMP_GET_FILTER = 0x420c
+ /* Get seccomp BPF filters. */
+ PTRACE_SECCOMP_GET_FILTER = 0x420c,
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
-};
-
-/* Flag for PTRACE_LISTEN. */
-enum __ptrace_flags
-{
- PTRACE_SEIZE_DEVEL = 0x80000000
+ /* Get seccomp BPF filter metadata. */
+ PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
};
+
/* pt_all_user_regs is used for PTRACE_GETREGS/PTRACE_SETREGS. */
struct __pt_all_user_regs
{
@@ -167,58 +169,7 @@ struct __pt_all_user_regs
struct __ia64_fpreg fr[128];
};
-/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions
-{
- PTRACE_O_TRACESYSGOOD = 0x00000001,
- PTRACE_O_TRACEFORK = 0x00000002,
- PTRACE_O_TRACEVFORK = 0x00000004,
- PTRACE_O_TRACECLONE = 0x00000008,
- PTRACE_O_TRACEEXEC = 0x00000010,
- PTRACE_O_TRACEVFORKDONE = 0x00000020,
- PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_EXITKILL = 0x00100000,
- PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
- PTRACE_O_MASK = 0x003000ff
-};
-
-/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes
-{
- PTRACE_EVENT_FORK = 1,
- PTRACE_EVENT_VFORK = 2,
- PTRACE_EVENT_CLONE = 3,
- PTRACE_EVENT_EXEC = 4,
- PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6,
- PTRACE_EVENT_SECCOMP = 7
-};
-
-/* Arguments for PTRACE_PEEKSIGINFO. */
-struct __ptrace_peeksiginfo_args
-{
- __uint64_t off; /* From which siginfo to start. */
- __uint32_t flags; /* Flags for peeksiginfo. */
- __int32_t nr; /* How many siginfos to take. */
-};
-
-enum __ptrace_peeksiginfo_flags
-{
- /* Read signals from a shared (process wide) queue. */
- PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
-};
-
-/* Perform process tracing functions. REQUEST is one of the values
- above, and determines the action to be taken.
- For all requests except PTRACE_TRACEME, PID specifies the process to be
- traced.
-
- PID and the other arguments described above for the various requests should
- appear (those that are used for the particular request) as:
- pid_t PID, void *ADDR, int DATA, void *ADDR2
- after REQUEST. */
-extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+#include <bits/ptrace-shared.h>
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/ia64/sys/rse.h b/sysdeps/unix/sysv/linux/ia64/sys/rse.h
index 883f01f340..47af186d8e 100644
--- a/sysdeps/unix/sysv/linux/ia64/sys/rse.h
+++ b/sysdeps/unix/sysv/linux/ia64/sys/rse.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h b/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
index c79fced452..e2a34afbdf 100644
--- a/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,29 +19,70 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
-#include <bits/sigcontext.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
/*
* These are here mostly for backwards compatibility with older Unices.
- * IA-64 Linux does not distinguish between "struct sigcontext" and
+ * IA-64 Linux does not distinguish between "mcontext_t" and
* "ucontext_t" as all the necessary info is inside the former.
*/
-typedef struct sigcontext mcontext_t;
+struct __ia64_fpreg_mcontext
+ {
+ union
+ {
+ unsigned long __ctx(bits)[2];
+ } __ctx(u);
+ } __attribute__ ((__aligned__ (16)));
+
+typedef struct
+ {
+ unsigned long int __ctx(sc_flags);
+ unsigned long int __ctx(sc_nat);
+ stack_t __ctx(sc_stack);
+ unsigned long int __ctx(sc_ip);
+ unsigned long int __ctx(sc_cfm);
+ unsigned long int __ctx(sc_um);
+ unsigned long int __ctx(sc_ar_rsc);
+ unsigned long int __ctx(sc_ar_bsp);
+ unsigned long int __ctx(sc_ar_rnat);
+ unsigned long int __ctx(sc_ar_ccv);
+ unsigned long int __ctx(sc_ar_unat);
+ unsigned long int __ctx(sc_ar_fpsr);
+ unsigned long int __ctx(sc_ar_pfs);
+ unsigned long int __ctx(sc_ar_lc);
+ unsigned long int __ctx(sc_pr);
+ unsigned long int __ctx(sc_br)[8];
+ unsigned long int __ctx(sc_gr)[32];
+ struct __ia64_fpreg_mcontext __ctx(sc_fr)[128];
+ unsigned long int __ctx(sc_rbs_base);
+ unsigned long int __ctx(sc_loadrs);
+ unsigned long int __ctx(sc_ar25);
+ unsigned long int __ctx(sc_ar26);
+ unsigned long int __ctx(sc_rsvd)[12];
+ unsigned long int __ctx(sc_mask);
+ } mcontext_t;
#if __GNUC_PREREQ (3, 5)
# define _SC_GR0_OFFSET \
- __builtin_offsetof (struct sigcontext, sc_gr[0])
+ __builtin_offsetof (mcontext_t, __ctx(sc_gr)[0])
#elif defined __GNUC__
# define _SC_GR0_OFFSET \
- (((char *) &((struct sigcontext *) 0)->sc_gr[0]) - (char *) 0)
+ (((char *) &((mcontext_t *) 0)->__ctx(sc_gr)[0]) - (char *) 0)
#else
# define _SC_GR0_OFFSET 0xc8 /* pray that this is correct... */
#endif
-typedef struct ucontext
+typedef struct ucontext_t
{
union
{
@@ -49,7 +90,7 @@ typedef struct ucontext
struct
{
unsigned long _pad[_SC_GR0_OFFSET/8];
- struct ucontext *_link; /* this should overlay sc_gr[0] */
+ struct ucontext_t *_link; /* this should overlay sc_gr[0] */
}
_uc;
}
@@ -58,8 +99,8 @@ typedef struct ucontext
ucontext_t;
#define uc_mcontext _u._mc
-#define uc_sigmask _u._mc.sc_mask
-#define uc_stack _u._mc.sc_stack
+#define uc_sigmask _u._mc.__ctx(sc_mask)
+#define uc_stack _u._mc.__ctx(sc_stack)
#define uc_link _u._uc._link
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/ia64/sys/user.h b/sysdeps/unix/sysv/linux/ia64/sys/user.h
index 0578fac518..40583283a8 100644
--- a/sysdeps/unix/sysv/linux/ia64/sys/user.h
+++ b/sysdeps/unix/sysv/linux/ia64/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/syscall.S b/sysdeps/unix/sysv/linux/ia64/syscall.S
index 955cb9cd30..75c67da32e 100644
--- a/sysdeps/unix/sysv/linux/ia64/syscall.S
+++ b/sysdeps/unix/sysv/linux/ia64/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jes Sorensen <Jes.Sorensen@cern.ch>.
diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list
index 8642bac152..56f4138c43 100644
--- a/sysdeps/unix/sysv/linux/ia64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list
@@ -4,34 +4,12 @@ umount2 - umount 2 __umount2 umount2
getpriority - getpriority i:ii __getpriority getpriority
-# semaphore and shm system calls
-msgctl - msgctl i:iip __msgctl msgctl
-msgget - msgget i:ii __msgget msgget
-msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
-msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
-shmat - shmat i:ipi __shmat shmat
-shmctl - shmctl i:iip __shmctl shmctl
-shmdt - shmdt i:s __shmdt shmdt
-shmget - shmget i:iii __shmget shmget
-semop - semop i:ipi __semop semop
-semtimedop - semtimedop i:ipip semtimedop
-semget - semget i:iii __semget semget
-semctl - semctl i:iiii __semctl semctl
-
# proper socket implementations:
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
-connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
-recv - recv Ci:ibni __libc_recv __recv recv
-recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom
-recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg
-send - send Ci:ibni __libc_send __send send
-sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg
-sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
diff --git a/sysdeps/unix/sysv/linux/ia64/sysconf.c b/sysdeps/unix/sysv/linux/ia64/sysconf.c
index c78d33c534..6c39db5a4a 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysconf.c
+++ b/sysdeps/unix/sysv/linux/ia64/sysconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux/ia64 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
deleted file mode 100644
index d325e51f9a..0000000000
--- a/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# undef PSEUDO
-
-# if IS_IN (libc)
-# define SYSDEP_CANCEL_ERRNO __libc_errno
-# else
-# define SYSDEP_CANCEL_ERRNO errno
-# endif
-# define SYSDEP_CANCEL_ERROR(args) \
-.section .gnu.linkonce.t.__syscall_error_##args, "ax"; \
- .align 32; \
- .proc __syscall_error_##args; \
- .global __syscall_error_##args; \
- .hidden __syscall_error_##args; \
- .size __syscall_error_##args, 64; \
-__syscall_error_##args: \
- .prologue; \
- .regstk args, 5, args, 0; \
- .save ar.pfs, loc0; \
- .save rp, loc1; \
- .body; \
- addl loc4 = @ltoff(@tprel(SYSDEP_CANCEL_ERRNO)), gp;; \
- ld8 loc4 = [loc4]; \
- mov rp = loc1;; \
- mov r8 = -1; \
- add loc4 = loc4, r13;; \
- st4 [loc4] = loc3; \
- mov ar.pfs = loc0
-
-# ifndef USE_DL_SYSINFO
-
-# define PSEUDO(name, syscall_name, args) \
-.text; \
-ENTRY (name) \
- adds r14 = MULTIPLE_THREADS_OFFSET, r13;; \
- ld4 r14 = [r14]; \
- mov r15 = SYS_ify(syscall_name);; \
- cmp4.ne p6, p7 = 0, r14; \
-(p6) br.cond.spnt .Lpseudo_cancel;; \
- break __BREAK_SYSCALL;; \
- cmp.eq p6,p0=-1,r10; \
-(p6) br.cond.spnt.few __syscall_error; \
- ret;; \
- .endp name; \
- .proc __GC_##name; \
- .globl __GC_##name; \
- .hidden __GC_##name; \
-__GC_##name: \
-.Lpseudo_cancel: \
- .prologue; \
- .regstk args, 5, args, 0; \
- .save ar.pfs, loc0; \
- alloc loc0 = ar.pfs, args, 5, args, 0; \
- .save rp, loc1; \
- mov loc1 = rp;; \
- .body; \
- CENABLE;; \
- mov loc2 = r8; \
- COPY_ARGS_##args \
- mov r15 = SYS_ify(syscall_name); \
- break __BREAK_SYSCALL;; \
- mov loc3 = r8; \
- mov loc4 = r10; \
- mov out0 = loc2; \
- CDISABLE;; \
- cmp.eq p6,p0=-1,loc4; \
-(p6) br.cond.spnt.few __syscall_error_##args; \
- mov r8 = loc3; \
- mov rp = loc1; \
- mov ar.pfs = loc0; \
-.Lpseudo_end: \
- ret; \
- .endp __GC_##name; \
- SYSDEP_CANCEL_ERROR(args)
-
-# else /* USE_DL_SYSINFO */
-
-# define PSEUDO(name, syscall_name, args) \
-.text; \
-ENTRY (name) \
- .prologue; \
- adds r2 = SYSINFO_OFFSET, r13; \
- adds r14 = MULTIPLE_THREADS_OFFSET, r13; \
- .save ar.pfs, r11; \
- mov r11 = ar.pfs;; \
- .body; \
- ld4 r14 = [r14]; \
- ld8 r2 = [r2]; \
- mov r15 = SYS_ify(syscall_name);; \
- cmp4.ne p6, p7 = 0, r14; \
- mov b7 = r2; \
-(p6) br.cond.spnt .Lpseudo_cancel; \
- br.call.sptk.many b6 = b7;; \
- mov ar.pfs = r11; \
- cmp.eq p6,p0 = -1, r10; \
-(p6) br.cond.spnt.few __syscall_error; \
- ret;; \
- .endp name; \
- \
- .proc __##syscall_name##_nocancel; \
- .globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- .prologue; \
- adds r2 = SYSINFO_OFFSET, r13; \
- .save ar.pfs, r11; \
- mov r11 = ar.pfs;; \
- .body; \
- ld8 r2 = [r2]; \
- mov r15 = SYS_ify(syscall_name);; \
- mov b7 = r2; \
- br.call.sptk.many b6 = b7;; \
- mov ar.pfs = r11; \
- cmp.eq p6,p0 = -1, r10; \
-(p6) br.cond.spnt.few __syscall_error; \
- ret;; \
- .endp __##syscall_name##_nocancel; \
- \
- .proc __GC_##name; \
- .globl __GC_##name; \
- .hidden __GC_##name; \
-__GC_##name: \
-.Lpseudo_cancel: \
- .prologue; \
- .regstk args, 5, args, 0; \
- .save ar.pfs, loc0; \
- alloc loc0 = ar.pfs, args, 5, args, 0; \
- adds loc4 = SYSINFO_OFFSET, r13; \
- .save rp, loc1; \
- mov loc1 = rp;; \
- .body; \
- ld8 loc4 = [loc4]; \
- CENABLE;; \
- mov loc2 = r8; \
- mov b7 = loc4; \
- COPY_ARGS_##args \
- mov r15 = SYS_ify(syscall_name); \
- br.call.sptk.many b6 = b7;; \
- mov loc3 = r8; \
- mov loc4 = r10; \
- mov out0 = loc2; \
- CDISABLE;; \
- cmp.eq p6,p0=-1,loc4; \
-(p6) br.cond.spnt.few __syscall_error_##args; \
- mov r8 = loc3; \
- mov rp = loc1; \
- mov ar.pfs = loc0; \
-.Lpseudo_end: \
- ret; \
- .endp __GC_##name; \
- SYSDEP_CANCEL_ERROR(args)
-
-# endif /* USE_DL_SYSINFO */
-
-# undef PSEUDO_END
-# define PSEUDO_END(name) .endp
-
-# if IS_IN (libpthread)
-# define CENABLE br.call.sptk.many b0 = __pthread_enable_asynccancel
-# define CDISABLE br.call.sptk.many b0 = __pthread_disable_asynccancel
-# elif IS_IN (libc)
-# define CENABLE br.call.sptk.many b0 = __libc_enable_asynccancel
-# define CDISABLE br.call.sptk.many b0 = __libc_disable_asynccancel
-# elif IS_IN (librt)
-# define CENABLE br.call.sptk.many b0 = __librt_enable_asynccancel
-# define CDISABLE br.call.sptk.many b0 = __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-# define COPY_ARGS_0 /* Nothing */
-# define COPY_ARGS_1 COPY_ARGS_0 mov out0 = in0;
-# define COPY_ARGS_2 COPY_ARGS_1 mov out1 = in1;
-# define COPY_ARGS_3 COPY_ARGS_2 mov out2 = in2;
-# define COPY_ARGS_4 COPY_ARGS_3 mov out3 = in3;
-# define COPY_ARGS_5 COPY_ARGS_4 mov out4 = in4;
-# define COPY_ARGS_6 COPY_ARGS_5 mov out5 = in5;
-# define COPY_ARGS_7 COPY_ARGS_6 mov out6 = in6;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P \
- adds r14 = MULTIPLE_THREADS_OFFSET, r13 ;; ld4 r14 = [r14] ;; cmp4.ne p6, p7 = 0, r14
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.S b/sysdeps/unix/sysv/linux/ia64/sysdep.S
index e0417a0c7b..ee92a5597c 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep.S
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h
index 8dfc582914..f8f8d900c6 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
Based on code originally written by David Mosberger-Tang
diff --git a/sysdeps/unix/sysv/linux/ia64/system.c b/sysdeps/unix/sysv/linux/ia64/system.c
index 4b1bcf824e..d09fefefe6 100644
--- a/sysdeps/unix/sysv/linux/ia64/system.c
+++ b/sysdeps/unix/sysv/linux/ia64/system.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/tst-setcontext2.c b/sysdeps/unix/sysv/linux/ia64/tst-setcontext2.c
new file mode 100644
index 0000000000..eecc29514d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/tst-setcontext2.c
@@ -0,0 +1,24 @@
+/* Work around incorrect type of IA64 uc_sigmask.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#undef sigismember
+#define sigismember(set, signo) sigismember ((const sigset_t *) (set), (signo))
+
+#include <stdlib/tst-setcontext2.c>
diff --git a/sysdeps/unix/sysv/linux/ia64/tst-setcontext4.c b/sysdeps/unix/sysv/linux/ia64/tst-setcontext4.c
new file mode 100644
index 0000000000..17916d451f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/tst-setcontext4.c
@@ -0,0 +1,26 @@
+/* The uc_sigmask on IA64 has the wrong type and this needs fixing,
+ but until that change is evaluated, we fix this here with a cast.
+ See https://sourceware.org/bugzilla/show_bug.cgi?id=21634
+ Copyright (C) 2018 Free Software 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>
+
+#undef sigismember
+#define sigismember(set, signo) sigismember ((const sigset_t *) (set), (signo))
+
+#include <stdlib/tst-setcontext4.c>
diff --git a/sysdeps/unix/sysv/linux/ia64/ucontext_i.h b/sysdeps/unix/sysv/linux/ia64/ucontext_i.h
index 4ca3ba0785..3d1e3672f5 100644
--- a/sysdeps/unix/sysv/linux/ia64/ucontext_i.h
+++ b/sysdeps/unix/sysv/linux/ia64/ucontext_i.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/umount.c b/sysdeps/unix/sysv/linux/ia64/umount.c
deleted file mode 100644
index 1246c7e659..0000000000
--- a/sysdeps/unix/sysv/linux/ia64/umount.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* umount system call for Linux/ia64.
- 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 <sys/mount.h>
-#include <errno.h>
-
-#include <sysdep.h>
-
-/* Unmount a filesystem. */
-int
-umount (const char *special_file)
-{
- return INLINE_SYSCALL (umount, 2, special_file, 0);
-}
diff --git a/sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
index 87cac5735d..85c1c9b373 100644
--- a/sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
+++ b/sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
diff --git a/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c b/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
index 9c20d251ca..91600c83f3 100644
--- a/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
+++ b/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ia64/vfork.S b/sysdeps/unix/sysv/linux/ia64/vfork.S
index 9154d7c0fd..ff37bde754 100644
--- a/sysdeps/unix/sysv/linux/ia64/vfork.S
+++ b/sysdeps/unix/sysv/linux/ia64/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,32 +33,12 @@ ENTRY (__libc_vfork)
.prologue // work around a GAS bug which triggers if
.body // first .prologue is not at the beginning of proc.
alloc r2=ar.pfs,0,0,2,0
- adds r14=PID,r13
- ;;
- ld4 r16=[r14]
- ;;
- sub r15=0,r16
- cmp.eq p6,p0=0,r16
- ;;
-(p6) movl r15=0x80000000
mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD
mov out1=0 /* Standard sp value. */
;;
- st4 [r14]=r15
DO_CALL (SYS_ify (clone))
cmp.eq p6,p0=0,r8
- adds r14=PID,r13
(p6) br.cond.dptk 1f
- ;;
- ld4 r15=[r14]
- ;;
- extr.u r16=r15,0,31
- ;;
- cmp.eq p0,p6=0,r16
- ;;
-(p6) sub r16=0,r15
- ;;
- st4 [r14]=r16
1:
cmp.eq p6,p0=-1,r10
(p6) br.cond.spnt.few __syscall_error
diff --git a/sysdeps/unix/sysv/linux/ia64/wordexp.c b/sysdeps/unix/sysv/linux/ia64/wordexp.c
index c34ebd55c6..ba8d9fa14e 100644
--- a/sysdeps/unix/sysv/linux/ia64/wordexp.c
+++ b/sysdeps/unix/sysv/linux/ia64/wordexp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c
index 7c3bb6cb04..e3d08982d9 100644
--- a/sysdeps/unix/sysv/linux/if_index.c
+++ b/sysdeps/unix/sysv/linux/if_index.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -43,16 +43,22 @@ __if_nametoindex (const char *ifname)
if (fd < 0)
return 0;
+ if (strlen (ifname) >= IFNAMSIZ)
+ {
+ __set_errno (ENODEV);
+ return 0;
+ }
+
strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
{
int saved_errno = errno;
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
if (saved_errno == EINVAL)
__set_errno (ENOSYS);
return 0;
}
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
return ifr.ifr_ifindex;
#endif
}
@@ -224,7 +230,7 @@ __if_indextoname (unsigned int ifindex, char *ifname)
ifr.ifr_ifindex = ifindex;
status = __ioctl (fd, SIOCGIFNAME, &ifr);
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
if (status < 0)
{
diff --git a/sysdeps/unix/sysv/linux/ifaddrs.c b/sysdeps/unix/sysv/linux/ifaddrs.c
index ca38d1a243..ac0e1e5738 100644
--- a/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -1,5 +1,5 @@
/* getifaddrs -- get names and addresses of all network interfaces
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -161,10 +161,13 @@ __netlink_request (struct netlink_handle *h, int type)
{
struct msghdr msg =
{
- (void *) &nladdr, sizeof (nladdr),
- &iov, 1,
- NULL, 0,
- 0
+ .msg_name = (void *) &nladdr,
+ .msg_namelen = sizeof (nladdr),
+ .msg_iov = &iov,
+ .msg_iovlen = 1,
+ .msg_control = NULL,
+ .msg_controllen = 0,
+ .msg_flags = 0
};
read_len = TEMP_FAILURE_RETRY (__recvmsg (h->fd, &msg, 0));
@@ -252,7 +255,7 @@ __netlink_open (struct netlink_handle *h)
{
struct sockaddr_nl nladdr;
- h->fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ h->fd = __socket (PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE);
if (h->fd < 0)
goto out;
@@ -283,7 +286,6 @@ __netlink_open (struct netlink_handle *h)
Since we get at first all RTM_NEWLINK entries, it can never happen
that a RTM_NEWADDR index is not known to this map. */
static int
-internal_function
map_newlink (int index, struct ifaddrs_storage *ifas, int *map, int max)
{
int i;
@@ -368,6 +370,14 @@ getifaddrs_internal (struct ifaddrs **ifap)
if ((pid_t) nlh->nlmsg_pid != nh.pid || nlh->nlmsg_seq != nlp->seq)
continue;
+ /* If the dump got interrupted, we can't rely on the results
+ so try again. */
+ if (nlh->nlmsg_flags & NLM_F_DUMP_INTR)
+ {
+ result = -EAGAIN;
+ goto exit_free;
+ }
+
if (nlh->nlmsg_type == NLMSG_DONE)
break; /* ok */
@@ -831,6 +841,7 @@ __getifaddrs (struct ifaddrs **ifap)
return res;
}
weak_alias (__getifaddrs, getifaddrs)
+libc_hidden_def (__getifaddrs)
libc_hidden_weak (getifaddrs)
@@ -840,4 +851,5 @@ __freeifaddrs (struct ifaddrs *ifa)
free (ifa);
}
weak_alias (__freeifaddrs, freeifaddrs)
+libc_hidden_def (__freeifaddrs)
libc_hidden_weak (freeifaddrs)
diff --git a/sysdeps/unix/sysv/linux/ifreq.c b/sysdeps/unix/sysv/linux/ifreq.c
index 8d7d39efec..c1a94f9343 100644
--- a/sysdeps/unix/sysv/linux/ifreq.c
+++ b/sysdeps/unix/sysv/linux/ifreq.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>.
diff --git a/sysdeps/unix/sysv/linux/include/bits/syscall.h b/sysdeps/unix/sysv/linux/include/bits/syscall.h
new file mode 100644
index 0000000000..3e60262486
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/include/bits/syscall.h
@@ -0,0 +1,3 @@
+/* The real bits/syscall.h is generated during the build, in
+ $(objdir)/misc/bits. */
+#include <misc/bits/syscall.h>
diff --git a/sysdeps/unix/sysv/linux/include/sys/sysinfo.h b/sysdeps/unix/sysv/linux/include/sys/sysinfo.h
index 50077fb08c..de61c87c02 100644
--- a/sysdeps/unix/sysv/linux/include/sys/sysinfo.h
+++ b/sysdeps/unix/sysv/linux/include/sys/sysinfo.h
@@ -1,5 +1,5 @@
/* Internal declarations for sys/sysinfo.h.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,9 @@
#include_next <sys/sysinfo.h>
-extern __typeof (sysinfo) __sysinfo __THROW;
+# ifndef _ISOMAC
+extern __typeof (sysinfo) __sysinfo __THROW attribute_hidden;
+
+# 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..8bd0b11be7 100644
--- a/sysdeps/unix/sysv/linux/include/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/include/sys/timex.h
@@ -1,5 +1,5 @@
/* Internal declarations for sys/timex.h.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,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/internal-signals.h b/sysdeps/unix/sysv/linux/internal-signals.h
new file mode 100644
index 0000000000..5ff4cf83d5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/internal-signals.h
@@ -0,0 +1,91 @@
+/* Special use of signals internally. Linux version.
+ Copyright (C) 2014-2018 Free Software 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 __INTERNAL_SIGNALS_H
+# define __INTERNAL_SIGNALS_H
+
+#include <signal.h>
+#include <sigsetops.h>
+#include <stdbool.h>
+#include <sysdep.h>
+
+/* The signal used for asynchronous cancelation. */
+#define SIGCANCEL __SIGRTMIN
+
+
+/* Signal needed for the kernel-supported POSIX timer implementation.
+ We can reuse the cancellation signal since we can distinguish
+ cancellation from timer expirations. */
+#define SIGTIMER SIGCANCEL
+
+
+/* Signal used to implement the setuid et.al. functions. */
+#define SIGSETXID (__SIGRTMIN + 1)
+
+
+/* Return is sig is used internally. */
+static inline bool
+__is_internal_signal (int sig)
+{
+ return (sig == SIGCANCEL) || (sig == SIGSETXID);
+}
+
+/* Remove internal glibc signal from the mask. */
+static inline void
+__clear_internal_signals (sigset_t *set)
+{
+ __sigdelset (set, SIGCANCEL);
+ __sigdelset (set, SIGSETXID);
+}
+
+#define SIGALL_SET \
+ ((__sigset_t) { .__val = {[0 ... _SIGSET_NWORDS-1 ] = -1 } })
+
+/* Block all signals, including internal glibc ones. */
+static inline int
+__libc_signal_block_all (sigset_t *set)
+{
+ INTERNAL_SYSCALL_DECL (err);
+ return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &SIGALL_SET,
+ set, _NSIG / 8);
+}
+
+/* Block all application signals (excluding internal glibc ones). */
+static inline int
+__libc_signal_block_app (sigset_t *set)
+{
+ sigset_t allset = SIGALL_SET;
+ __clear_internal_signals (&allset);
+ INTERNAL_SYSCALL_DECL (err);
+ return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &allset, set,
+ _NSIG / 8);
+}
+
+/* Restore current process signal mask. */
+static inline int
+__libc_signal_restore_set (const sigset_t *set)
+{
+ INTERNAL_SYSCALL_DECL (err);
+ return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, set, NULL,
+ _NSIG / 8);
+}
+
+/* Used to communicate with signal handler. */
+extern struct xid_command *__xidcmd attribute_hidden;
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c
index 012f93fe66..bf2f9edba5 100644
--- a/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -26,7 +26,7 @@
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/statfs.h>
-#include <sys/statvfs.h>
+#include "internal_statvfs.h"
#include "linux_fsinfo.h"
#include <kernel-features.h>
@@ -39,190 +39,6 @@
# define STATFS statfs
# define STATVFS statvfs
# define INTERNAL_STATVFS __internal_statvfs
-
-
-# ifndef __ASSUME_STATFS_F_FLAGS
-int
-__statvfs_getflags (const char *name, int fstype, int fd)
-{
- struct stat64 st;
-
- if ((fd < 0 ? stat64 (name, &st) : fstat64 (fd, &st)) < 0)
- return 0;
-
- const char *fsname = NULL;
- const char *fsname2 = NULL;
- const char *fsname3 = NULL;
-
- /* Map the filesystem type we got from the statfs call to a string. */
- switch (fstype)
- {
- case EXT2_SUPER_MAGIC:
- fsname = "ext4";
- fsname2 = "ext3";
- fsname3 = "ext2";
- break;
- case DEVPTS_SUPER_MAGIC:
- fsname= "devpts";
- break;
- case SHMFS_SUPER_MAGIC:
- fsname = "tmpfs";
- break;
- case PROC_SUPER_MAGIC:
- fsname = "proc";
- break;
- case USBDEVFS_SUPER_MAGIC:
- fsname = "usbdevfs";
- break;
- case AUTOFS_SUPER_MAGIC:
- fsname = "autofs";
- break;
- case NFS_SUPER_MAGIC:
- fsname = "nfs";
- break;
- case SYSFS_MAGIC:
- fsname = "sysfs";
- break;
- case REISERFS_SUPER_MAGIC:
- fsname = "reiserfs";
- break;
- case XFS_SUPER_MAGIC:
- fsname = "xfs";
- break;
- case JFS_SUPER_MAGIC:
- fsname = "jfs";
- break;
- case HPFS_SUPER_MAGIC:
- fsname = "hpfs";
- break;
- case DEVFS_SUPER_MAGIC:
- fsname = "devfs";
- break;
- case ISOFS_SUPER_MAGIC:
- fsname = "iso9660";
- break;
- case MSDOS_SUPER_MAGIC:
- fsname = "msdos";
- break;
- case NTFS_SUPER_MAGIC:
- fsname = "ntfs";
- break;
- case LOGFS_MAGIC_U32:
- fsname = "logfs";
- break;
- case BTRFS_SUPER_MAGIC:
- fsname = "btrfs";
- break;
- case CGROUP_SUPER_MAGIC:
- fsname = "cgroup";
- break;
- case LUSTRE_SUPER_MAGIC:
- fsname = "lustre";
- break;
- case F2FS_SUPER_MAGIC:
- fsname = "f2fs";
- break;
- case EFIVARFS_MAGIC:
- fsname = "efivarfs";
- break;
- }
-
- FILE *mtab = __setmntent ("/proc/mounts", "r");
- if (mtab == NULL)
- mtab = __setmntent (_PATH_MOUNTED, "r");
-
- int result = 0;
- if (mtab != NULL)
- {
- bool success = false;
- struct mntent mntbuf;
- char tmpbuf[1024];
-
- /* No locking needed. */
- (void) __fsetlocking (mtab, FSETLOCKING_BYCALLER);
-
- again:
- while (__getmntent_r (mtab, &mntbuf, tmpbuf, sizeof (tmpbuf)))
- {
- /* In a first round we look for a given mount point, if
- we have a name. */
- if (name != NULL && strcmp (name, mntbuf.mnt_dir) != 0)
- continue;
- /* We need to look at the entry only if the filesystem
- name matches. If we have a filesystem name. */
- else if (fsname != NULL
- && strcmp (fsname, mntbuf.mnt_type) != 0
- && (fsname2 == NULL
- || strcmp (fsname2, mntbuf.mnt_type) != 0)
- && (fsname3 == NULL
- || strcmp (fsname3, mntbuf.mnt_type) != 0))
- continue;
-
- /* Find out about the device the current entry is for. */
- struct stat64 fsst;
- if (stat64 (mntbuf.mnt_dir, &fsst) >= 0
- && st.st_dev == fsst.st_dev)
- {
- /* Bingo, we found the entry for the device FD is on.
- Now interpret the option string. */
- char *cp = mntbuf.mnt_opts;
- char *opt;
-
- while ((opt = strsep (&cp, ",")) != NULL)
- if (strcmp (opt, "ro") == 0)
- result |= ST_RDONLY;
- else if (strcmp (opt, "nosuid") == 0)
- result |= ST_NOSUID;
- else if (strcmp (opt, "noexec") == 0)
- result |= ST_NOEXEC;
- else if (strcmp (opt, "nodev") == 0)
- result |= ST_NODEV;
- else if (strcmp (opt, "sync") == 0)
- result |= ST_SYNCHRONOUS;
- else if (strcmp (opt, "mand") == 0)
- result |= ST_MANDLOCK;
- else if (strcmp (opt, "noatime") == 0)
- result |= ST_NOATIME;
- else if (strcmp (opt, "nodiratime") == 0)
- result |= ST_NODIRATIME;
- else if (strcmp (opt, "relatime") == 0)
- result |= ST_RELATIME;
-
- /* We can stop looking for more entries. */
- success = true;
- break;
- }
- }
- /* Maybe the kernel names for the filesystems changed or the
- statvfs call got a name which was not the mount point. Check
- again, this time without checking for name matches first. */
- if (! success && (name != NULL || fsname != NULL))
- {
- if (name != NULL)
- /* Try without a mount point name. */
- name = NULL;
- else
- {
- /* Try without a filesystem name. */
- assert (fsname != NULL);
- fsname = fsname2 = fsname3 = NULL;
- }
-
- /* It is not strictly allowed to use rewind here. But
- this code is part of the implementation so it is
- acceptable. */
- rewind (mtab);
-
- goto again;
- }
-
- /* Close the file. */
- __endmntent (mtab);
- }
-
- return result;
-}
-# endif
#else
extern int __statvfs_getflags (const char *name, int fstype, int fd);
#endif
@@ -267,14 +83,5 @@ INTERNAL_STATVFS (const char *name, struct STATVFS *buf,
/* XXX I have no idea how to compute f_favail. Any idea??? */
buf->f_favail = buf->f_ffree;
-#ifndef __ASSUME_STATFS_F_FLAGS
- if ((fsbuf->f_flags & ST_VALID) == 0)
- /* Determining the flags is tricky. We have to read /proc/mounts or
- the /etc/mtab file and search for the entry which matches the given
- file. The way we can test for matching filesystem is using the
- device number. */
- buf->f_flag = __statvfs_getflags (name, fsbuf->f_type, fd);
- else
-#endif
- buf->f_flag = fsbuf->f_flags ^ ST_VALID;
+ buf->f_flag = fsbuf->f_flags ^ ST_VALID;
}
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.h b/sysdeps/unix/sysv/linux/internal_statvfs.h
new file mode 100644
index 0000000000..58ffe686d9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.h
@@ -0,0 +1,26 @@
+/* Internal statvfs/statvfs64 function prototypes.
+ Copyright (C) 2017-2018 Free Software 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/statvfs.h>
+
+extern void __internal_statvfs (const char *name, struct statvfs *buf,
+ struct statfs *fsbuf, int fd)
+ attribute_hidden;
+extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf,
+ struct statfs64 *fsbuf, int fd)
+ attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/ipc_ops.h b/sysdeps/unix/sysv/linux/ipc_ops.h
new file mode 100644
index 0000000000..cd599ab72e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ipc_ops.h
@@ -0,0 +1,30 @@
+/* The codes for the functions to use the ipc syscall multiplexer.
+ Copyright (C) 2016-2018 Free Software 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 IPCOP_semop 1
+#define IPCOP_semget 2
+#define IPCOP_semctl 3
+#define IPCOP_semtimedop 4
+#define IPCOP_msgsnd 11
+#define IPCOP_msgrcv 12
+#define IPCOP_msgget 13
+#define IPCOP_msgctl 14
+#define IPCOP_shmat 21
+#define IPCOP_shmdt 22
+#define IPCOP_shmget 23
+#define IPCOP_shmctl 24
diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h
index 7ded4638a3..22565d43e2 100644
--- a/sysdeps/unix/sysv/linux/ipc_priv.h
+++ b/sysdeps/unix/sysv/linux/ipc_priv.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Old SysV permission definition for Linux. Default version.
+ Copyright (C) 1995-2018 Free Software 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,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sys/ipc.h>
+#include <sys/ipc.h> /* For __key_t */
#define __IPC_64 0x100
@@ -30,17 +31,9 @@ struct __old_ipc_perm
unsigned short int __seq; /* Sequence number. */
};
+#define SEMCTL_ARG_ADDRESS(__arg) &__arg.array
-/* The codes for the functions to use the ipc syscall multiplexer. */
-#define IPCOP_semop 1
-#define IPCOP_semget 2
-#define IPCOP_semctl 3
-#define IPCOP_semtimedop 4
-#define IPCOP_msgsnd 11
-#define IPCOP_msgrcv 12
-#define IPCOP_msgget 13
-#define IPCOP_msgctl 14
-#define IPCOP_shmat 21
-#define IPCOP_shmdt 22
-#define IPCOP_shmget 23
-#define IPCOP_shmctl 24
+#define MSGRCV_ARGS(__msgp, __msgtyp) \
+ ((long int []){ (long int) __msgp, __msgtyp })
+
+#include <ipc_ops.h>
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 9832f41167..5543d92d7e 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,9 +37,6 @@
introduced. If somebody cares these values can afterwards be
corrected. */
-/* The sendfile syscall was introduced in 2.2.0. */
-#define __ASSUME_SENDFILE 1
-
/* Some architectures use the socketcall multiplexer for some or all
socket-related operations instead of separate syscalls.
__ASSUME_SOCKETCALL is defined for such architectures. */
@@ -48,17 +45,12 @@
and still does not have a 64-bit inode field. */
#define __ASSUME_ST_INO_64_BIT 1
-/* The getdents64 syscall was introduced in 2.4.0-test7 (but later for
- MIPS n32). */
-#define __ASSUME_GETDENTS64_SYSCALL 1
-
/* The statfs64 syscalls are available in 2.5.74 (but not for alpha). */
#define __ASSUME_STATFS64 1
/* pselect/ppoll were introduced just after 2.6.16-rc1. On x86_64 and
SH this appeared first in 2.6.19-rc1, on ia64 in 2.6.22-rc1. */
#define __ASSUME_PSELECT 1
-#define __ASSUME_PPOLL 1
/* The *at syscalls were introduced just after 2.6.16-rc1. On PPC
they were introduced in 2.6.17-rc1, on SH in 2.6.19-rc1. */
@@ -69,47 +61,9 @@
configurations). */
#define __ASSUME_SET_ROBUST_LIST 1
-/* Support for PI futexes was added in 2.6.18 (but some architectures
- lack futex_atomic_cmpxchg_inatomic in some configurations). */
-#define __ASSUME_FUTEX_LOCK_PI 1
-
-/* Support for private futexes was added in 2.6.22. */
-#define __ASSUME_PRIVATE_FUTEX 1
-
-/* Support for fallocate was added in 2.6.23, on s390
- only after 2.6.23-rc1. */
-#define __ASSUME_FALLOCATE 1
-
-/* Support for various CLOEXEC and NONBLOCK flags was added in
- 2.6.23. */
-#define __ASSUME_O_CLOEXEC 1
-
/* Support for various CLOEXEC and NONBLOCK flags was added in
2.6.27. */
#define __ASSUME_IN_NONBLOCK 1
-#define __ASSUME_PIPE2 1
-#define __ASSUME_EVENTFD2 1
-#define __ASSUME_SIGNALFD4 1
-#define __ASSUME_DUP3 1
-
-/* Support for accept4 functionality was added in 2.6.28, but for some
- architectures using a separate syscall rather than socketcall that
- syscall was only added later, and some architectures first had
- socketcall support then a separate syscall. Define
- __ASSUME_ACCEPT4_SOCKETCALL if glibc uses socketcall on this
- architecture and accept4 is available through socketcall,
- __ASSUME_ACCEPT4_SYSCALL if it is available through a separate
- syscall, __ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL if it became
- available through a separate syscall at the same time as through
- socketcall, and __ASSUME_ACCEPT4 if the accept4 function is known
- to work. */
-#ifdef __ASSUME_SOCKETCALL
-# define __ASSUME_ACCEPT4_SOCKETCALL 1
-#endif
-
-#if defined __ASSUME_ACCEPT4_SOCKETCALL || defined __ASSUME_ACCEPT4_SYSCALL
-# define __ASSUME_ACCEPT4 1
-#endif
/* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29. */
#define __ASSUME_FUTEX_CLOCK_REALTIME 1
@@ -118,43 +72,85 @@
#define __ASSUME_PREADV 1
#define __ASSUME_PWRITEV 1
-/* Support for FUTEX_*_REQUEUE_PI was added in 2.6.31 (but some
- architectures lack futex_atomic_cmpxchg_inatomic in some
- configurations). */
-#define __ASSUME_REQUEUE_PI 1
-
-/* Support for recvmmsg functionality was added in 2.6.33. The macros
- defined correspond to those for accept4. */
-#if __LINUX_KERNEL_VERSION >= 0x020621 && defined __ASSUME_SOCKETCALL
-# define __ASSUME_RECVMMSG_SOCKETCALL 1
+/* Support for sendmmsg functionality was added in 3.0. */
+#define __ASSUME_SENDMMSG 1
+
+/* On most architectures, most socket syscalls are supported for all
+ supported kernel versions, but on some socketcall architectures
+ separate syscalls were only added later. */
+#define __ASSUME_SENDMSG_SYSCALL 1
+#define __ASSUME_RECVMSG_SYSCALL 1
+#define __ASSUME_ACCEPT_SYSCALL 1
+#define __ASSUME_CONNECT_SYSCALL 1
+#define __ASSUME_RECVFROM_SYSCALL 1
+#define __ASSUME_SENDTO_SYSCALL 1
+#define __ASSUME_ACCEPT4_SYSCALL 1
+#define __ASSUME_RECVMMSG_SYSCALL 1
+#define __ASSUME_SENDMMSG_SYSCALL 1
+
+/* Support for SysV IPC through wired syscalls. All supported architectures
+ either support ipc syscall and/or all the ipc correspondent syscalls. */
+#define __ASSUME_DIRECT_SYSVIPC_SYSCALLS 1
+
+/* Support for p{read,write}v2 was added in 4.6. However Linux default
+ implementation does not assume the __ASSUME_* and instead use a fallback
+ implementation based on p{read,write}v and returning an error for
+ non supported flags. */
+
+/* Support for the renameat2 system call was added in kernel 3.15. */
+#if __LINUX_KERNEL_VERSION >= 0x030F00
+# define __ASSUME_RENAMEAT2
#endif
-#if defined __ASSUME_RECVMMSG_SOCKETCALL || defined __ASSUME_RECVMMSG_SYSCALL
-# define __ASSUME_RECVMMSG 1
+/* Support for the execveat syscall was added in 3.19. */
+#if __LINUX_KERNEL_VERSION >= 0x031300
+# define __ASSUME_EXECVEAT 1
#endif
-/* Support for /proc/self/task/$tid/comm and /proc/$pid/task/$tid/comm was
- added in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_PROC_PID_TASK_COMM 1
+#if __LINUX_KERNEL_VERSION >= 0x040400
+# define __ASSUME_MLOCK2 1
#endif
-/* statfs fills in f_flags since 2.6.36. */
-#if __LINUX_KERNEL_VERSION >= 0x020624
-# define __ASSUME_STATFS_F_FLAGS 1
+#if __LINUX_KERNEL_VERSION >= 0x040500
+# define __ASSUME_COPY_FILE_RANGE 1
#endif
-/* prlimit64 is available in 2.6.36. */
-#if __LINUX_KERNEL_VERSION >= 0x020624
-# define __ASSUME_PRLIMIT64 1
+/* Support for statx was added in kernel 4.11. */
+#if __LINUX_KERNEL_VERSION >= 0x040B00
+# define __ASSUME_STATX 1
#endif
-/* Support for sendmmsg functionality was added in 3.0. The macros
- defined correspond to those for accept4 and recvmmsg. */
-#if __LINUX_KERNEL_VERSION >= 0x030000 && defined __ASSUME_SOCKETCALL
-# define __ASSUME_SENDMMSG_SOCKETCALL 1
-#endif
+/* Support for clone call used on fork. The signature varies across the
+ architectures with current 4 different variants:
-#if defined __ASSUME_SENDMMSG_SOCKETCALL || defined __ASSUME_SENDMMSG_SYSCALL
-# define __ASSUME_SENDMMSG 1
-#endif
+ 1. long int clone (unsigned long flags, unsigned long newsp,
+ int *parent_tidptr, unsigned long tls,
+ int *child_tidptr)
+
+ 2. long int clone (unsigned long newsp, unsigned long clone_flags,
+ int *parent_tidptr, int * child_tidptr,
+ unsigned long tls)
+
+ 3. long int clone (unsigned long flags, unsigned long newsp,
+ int stack_size, int *parent_tidptr,
+ int *child_tidptr, unsigned long tls)
+
+ 4. long int clone (unsigned long flags, unsigned long newsp,
+ int *parent_tidptr, int *child_tidptr,
+ unsigned long tls)
+
+ The fourth variant is intended to be used as the default for newer ports,
+ Also IA64 uses the third variant but with __NR_clone2 instead of
+ __NR_clone.
+
+ The macros names to define the variant used for the architecture is
+ similar to kernel:
+
+ - __ASSUME_CLONE_BACKWARDS: for variant 1.
+ - __ASSUME_CLONE_BACKWARDS2: for variant 2 (s390).
+ - __ASSUME_CLONE_BACKWARDS3: for variant 3 (microblaze).
+ - __ASSUME_CLONE_DEFAULT: for variant 4.
+ - __ASSUME_CLONE2: for clone2 with variant 3 (ia64).
+ */
+
+#define __ASSUME_CLONE_DEFAULT 1
diff --git a/sysdeps/unix/sysv/linux/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/kernel-posix-timers.h
index 0de5326bb2..31f5199786 100644
--- a/sysdeps/unix/sysv/linux/kernel-posix-timers.h
+++ b/sysdeps/unix/sysv/linux/kernel-posix-timers.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/kernel_sigaction.h b/sysdeps/unix/sysv/linux/kernel_sigaction.h
index d005cbce98..2dbec08099 100644
--- a/sysdeps/unix/sysv/linux/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/kernel_sigaction.h
@@ -1,19 +1,20 @@
-/* This is the sigaction structure from the Linux 2.1.20 kernel. */
+#ifndef _KERNEL_SIGACTION_H
+# define _KERNEL_SIGACTION_H
-#define HAVE_SA_RESTORER
-
-struct old_kernel_sigaction {
- __sighandler_t k_sa_handler;
- unsigned long sa_mask;
- unsigned long sa_flags;
- void (*sa_restorer) (void);
+/* This is the sigaction structure from the Linux 3.2 kernel. */
+struct kernel_sigaction
+{
+ __sighandler_t k_sa_handler;
+ unsigned long sa_flags;
+#ifdef SA_RESTORER
+ void (*sa_restorer) (void);
+#endif
+ sigset_t sa_mask;
};
-/* This is the sigaction structure from the Linux 2.1.68 kernel. */
+#ifndef SA_RESTORER
+# define SET_SA_RESTORER(kact, act)
+# define RESET_SA_RESTORER(act, kact)
+#endif
-struct kernel_sigaction {
- __sighandler_t k_sa_handler;
- unsigned long sa_flags;
- void (*sa_restorer) (void);
- sigset_t sa_mask;
-};
+#endif
diff --git a/sysdeps/unix/sysv/linux/kernel_stat.h b/sysdeps/unix/sysv/linux/kernel_stat.h
index dcdab48dbb..eecc962de3 100644
--- a/sysdeps/unix/sysv/linux/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/kernel_stat.h
@@ -33,3 +33,6 @@ struct kernel_stat
#define _HAVE_STAT64___PAD2
#define _HAVE_STAT64___ST_INO
#define _HAVE_STAT64_NSEC
+
+#define XSTAT_IS_XSTAT64 0
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/kernel_termios.h b/sysdeps/unix/sysv/linux/kernel_termios.h
index dad4e920f8..6f505c7b61 100644
--- a/sysdeps/unix/sysv/linux/kernel_termios.h
+++ b/sysdeps/unix/sysv/linux/kernel_termios.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/lddlibc4.c b/sysdeps/unix/sysv/linux/lddlibc4.c
index 691b119cdc..e4e4ebf14e 100644
--- a/sysdeps/unix/sysv/linux/lddlibc4.c
+++ b/sysdeps/unix/sysv/linux/lddlibc4.c
@@ -1,5 +1,5 @@
/* Stub for ldd script to print Linux libc4 dependencies.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -69,7 +69,7 @@ main (int argc, char *argv[])
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2016");
+"), "2018");
return 0;
}
diff --git a/sysdeps/unix/sysv/linux/ldsodefs.h b/sysdeps/unix/sysv/linux/ldsodefs.h
index 1f4d9e31d0..edd4fa1d9f 100644
--- a/sysdeps/unix/sysv/linux/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,12 +18,12 @@
#ifndef _LDSODEFS_H
-/* Get the real definitions. */
-#include_next <ldsodefs.h>
-
/* We have the auxiliary vector. */
#define HAVE_AUX_VECTOR
+/* Get the real definitions. */
+#include_next <ldsodefs.h>
+
/* We can assume that the kernel always provides the AT_UID, AT_EUID,
AT_GID, and AT_EGID values in the auxiliary vector from 2.4.0 or so on. */
#define HAVE_AUX_XID
diff --git a/sysdeps/unix/sysv/linux/libc_fatal.c b/sysdeps/unix/sysv/linux/libc_fatal.c
index 25361357ba..bd65403c61 100644
--- a/sysdeps/unix/sysv/linux/libc_fatal.c
+++ b/sysdeps/unix/sysv/linux/libc_fatal.c
@@ -1,5 +1,5 @@
/* Catastrophic failure reports. Linux version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -48,18 +48,18 @@ backtrace_and_maps (int do_abort, bool written, int fd)
if (n > 2)
{
#define strnsize(str) str, strlen (str)
-#define writestr(str) write_not_cancel (fd, str)
+#define writestr(str) __write_nocancel (fd, str)
writestr (strnsize ("======= Backtrace: =========\n"));
__backtrace_symbols_fd (addrs + 1, n - 1, fd);
writestr (strnsize ("======= Memory map: ========\n"));
- int fd2 = open_not_cancel_2 ("/proc/self/maps", O_RDONLY);
+ int fd2 = __open_nocancel ("/proc/self/maps", O_RDONLY);
char buf[1024];
ssize_t n2;
- while ((n2 = read_not_cancel (fd2, buf, sizeof (buf))) > 0)
- if (write_not_cancel (fd, buf, n2) != n2)
+ while ((n2 = __read_nocancel (fd2, buf, sizeof (buf))) > 0)
+ if (__write_nocancel (fd, buf, n2) != n2)
break;
- close_not_cancel_no_status (fd2);
+ __close_nocancel_nostatus (fd2);
}
}
}
diff --git a/sysdeps/unix/sysv/linux/linux_fsinfo.h b/sysdeps/unix/sysv/linux/linux_fsinfo.h
index c09273d56f..d01195ce88 100644
--- a/sysdeps/unix/sysv/linux/linux_fsinfo.h
+++ b/sysdeps/unix/sysv/linux/linux_fsinfo.h
@@ -1,5 +1,5 @@
/* Constants from kernel header for various FSes.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/listen.c b/sysdeps/unix/sysv/linux/listen.c
index 52cd50f439..79d4a8ad28 100644
--- a/sysdeps/unix/sysv/linux/listen.c
+++ b/sysdeps/unix/sysv/linux/listen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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/lowlevellock-futex.h b/sysdeps/unix/sysv/linux/lowlevellock-futex.h
index 7111bac943..fc834ed16e 100644
--- a/sysdeps/unix/sysv/linux/lowlevellock-futex.h
+++ b/sysdeps/unix/sysv/linux/lowlevellock-futex.h
@@ -1,5 +1,5 @@
/* Low-level locking access to futex facilities. Linux version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,31 +53,16 @@
#if IS_IN (libc) || IS_IN (rtld)
/* In libc.so or ld.so all futexes are private. */
-# ifdef __ASSUME_PRIVATE_FUTEX
-# define __lll_private_flag(fl, private) \
+# define __lll_private_flag(fl, private) \
({ \
/* Prevent warnings in callers of this macro. */ \
int __lll_private_flag_priv __attribute__ ((unused)); \
__lll_private_flag_priv = (private); \
((fl) | FUTEX_PRIVATE_FLAG); \
})
-# else
-# define __lll_private_flag(fl, private) \
- ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
-# endif
#else
-# ifdef __ASSUME_PRIVATE_FUTEX
-# define __lll_private_flag(fl, private) \
+# define __lll_private_flag(fl, private) \
(((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
-# else
-# define __lll_private_flag(fl, private) \
- (__builtin_constant_p (private) \
- ? ((private) == 0 \
- ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \
- : (fl)) \
- : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
- & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
-# endif
#endif
#define lll_futex_syscall(nargs, futexp, op, ...) \
diff --git a/sysdeps/unix/sysv/linux/lseek.c b/sysdeps/unix/sysv/linux/lseek.c
new file mode 100644
index 0000000000..49d11ab65a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/lseek.c
@@ -0,0 +1,57 @@
+/* Linux lseek implementation, 32 bits off_t.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+/* 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_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..2ad6a610c8 100644
--- a/sysdeps/unix/sysv/linux/lseek64.c
+++ b/sysdeps/unix/sysv/linux/lseek64.c
@@ -1 +1,53 @@
-/* We don't need a definition since the llseek function is what we need. */
+/* Linux lseek implementation, 64 bits off_t.
+ Copyright (C) 2016-2018 Free Software 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>
+#include <shlib-compat.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)
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_28)
+strong_alias (__lseek64, __compat_llseek)
+compat_symbol (libc, __compat_llseek, llseek, GLIBC_2_0);
+#endif
diff --git a/sysdeps/unix/sysv/linux/lutimes.c b/sysdeps/unix/sysv/linux/lutimes.c
index 69d3cfa0b3..4f2f9ec7d6 100644
--- a/sysdeps/unix/sysv/linux/lutimes.c
+++ b/sysdeps/unix/sysv/linux/lutimes.c
@@ -1,6 +1,6 @@
/* Change access and/or modification date of file. Do not follow symbolic
links.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,6 @@
int
lutimes (const char *file, const struct timeval tvp[2])
{
-#ifdef __NR_utimensat
/* The system call espects timespec, not timeval. */
struct timespec ts[2];
if (tvp != NULL)
@@ -42,11 +41,4 @@ lutimes (const char *file, const struct timeval tvp[2])
return INLINE_SYSCALL (utimensat, 4, AT_FDCWD, file, tvp ? ts : NULL,
AT_SYMLINK_NOFOLLOW);
-#else
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-#endif
}
-
-#ifndef __NR_utimensat
-stub_warning (lutimes)
-#endif
diff --git a/sysdeps/unix/sysv/linux/lxstat.c b/sysdeps/unix/sysv/linux/lxstat.c
index e36204aa1b..cc31b6dcb1 100644
--- a/sysdeps/unix/sysv/linux/lxstat.c
+++ b/sysdeps/unix/sysv/linux/lxstat.c
@@ -1,5 +1,5 @@
/* lxstat using old-style Unix lstat system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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);
@@ -53,7 +53,7 @@ __lxstat (int vers, const char *name, struct stat *buf)
hidden_def (__lxstat)
weak_alias (__lxstat, _lxstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
#undef __lxstat64
strong_alias (__lxstat, __lxstat64);
hidden_ver (__lxstat, __lxstat64)
diff --git a/sysdeps/unix/sysv/linux/lxstat64.c b/sysdeps/unix/sysv/linux/lxstat64.c
index 09a678a3a9..d05fa14537 100644
--- a/sysdeps/unix/sysv/linux/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/lxstat64.c
@@ -1,5 +1,5 @@
/* lxstat64 using Linux lstat64 system call.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,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/Makefile b/sysdeps/unix/sysv/linux/m68k/Makefile
index 61c355ac2a..ce1f696a6f 100644
--- a/sysdeps/unix/sysv/linux/m68k/Makefile
+++ b/sysdeps/unix/sysv/linux/m68k/Makefile
@@ -4,6 +4,11 @@ m68k-syntax-flag = -DMOTOROLA_SYNTAX
ifeq ($(subdir),csu)
sysdep_routines += m68k-helpers
+ifeq (yes,$(build-shared))
+sysdep_routines += divdi3
+shared-only-routines += divdi3
+CPPFLAGS-divdi3.c = -Din_divdi3_c
+endif
endif
ifeq ($(subdir),misc)
@@ -18,7 +23,3 @@ sysdep-rtld-routines += m68k-vdso
sysdep-others += lddlibc4
install-bin += lddlibc4
endif
-
-ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64
-endif
diff --git a/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c b/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c
index 812767572d..dfd3b13244 100644
--- a/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
register unsigned long this_sp asm ("sp"); \
if ((unsigned long) (sp) < this_sp) \
{ \
- struct sigaltstack oss; \
+ stack_t oss; \
INTERNAL_SYSCALL_DECL (err); \
int result = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss); \
if (!INTERNAL_SYSCALL_ERROR_P (result, err) \
diff --git a/sysdeps/unix/sysv/linux/m68k/alphasort64.c b/sysdeps/unix/sysv/linux/m68k/alphasort64.c
deleted file mode 100644
index 0b5ae47d2f..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/alphasort64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/alphasort64.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/arch-fork.h b/sysdeps/unix/sysv/linux/m68k/arch-fork.h
deleted file mode 100644
index 8ab12a6936..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/arch-fork.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. m68k version.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 5, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \
- NULL, &THREAD_SELF->tid, NULL)
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
index 9f35ed23ad..0c6c7d9bb0 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/mman.h b/sysdeps/unix/sysv/linux/m68k/bits/mman.h
index dd2dd77fe7..8d355feda9 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/m68k version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,6 +34,10 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_SYNC 0x80000 /* Perform synchronous page
+ faults for the mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Include generic Linux declarations. */
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/poll.h b/sysdeps/unix/sysv/linux/m68k/bits/poll.h
index cb067057b5..6652a21da7 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/poll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/sockaddr.h b/sysdeps/unix/sysv/linux/m68k/bits/sockaddr.h
new file mode 100644
index 0000000000..f5ac4987af
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/bits/sockaddr.h
@@ -0,0 +1,42 @@
+/* Definition of struct sockaddr_* members and sizes, Linux/m68k version.
+ Copyright (C) 1995-2018 Free Software 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/>. */
+
+/*
+ * Never include this file directly; use <sys/socket.h> instead.
+ */
+
+#ifndef _BITS_SOCKADDR_H
+#define _BITS_SOCKADDR_H 1
+
+
+/* POSIX.1g specifies this type name for the `sa_family' member. */
+typedef unsigned short int sa_family_t;
+
+/* This macro is used to declare the initial common members
+ of the data types used for socket addresses, `struct sockaddr',
+ `struct sockaddr_in', `struct sockaddr_un', etc. */
+
+#define __SOCKADDR_COMMON(sa_prefix) \
+ sa_family_t sa_prefix##family
+
+#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
+
+/* Size of struct sockaddr_storage. */
+#define _SS_SIZE 126
+
+#endif /* bits/sockaddr.h */
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/stat.h b/sysdeps/unix/sysv/linux/m68k/bits/stat.h
index 0bc329cc5a..4296247248 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/brk.c b/sysdeps/unix/sysv/linux/m68k/brk.c
index 71aefda351..9e8cac0873 100644
--- a/sysdeps/unix/sysv/linux/m68k/brk.c
+++ b/sysdeps/unix/sysv/linux/m68k/brk.c
@@ -1,5 +1,5 @@
/* brk system call for Linux/m68k.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/clone.S b/sysdeps/unix/sysv/linux/m68k/clone.S
index 8b40df27c4..0951c89023 100644
--- a/sysdeps/unix/sysv/linux/m68k/clone.S
+++ b/sysdeps/unix/sysv/linux/m68k/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
@@ -24,9 +24,6 @@
#include <bits/errno.h>
#include <tls.h>
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
void *parent_tidptr, void *tls, void *child_tidptr) */
@@ -91,33 +88,14 @@ ENTRY (__clone)
tstl %d0
jmi SYSCALL_ERROR_LABEL
- jeq thread_start
+ jeq 1f
rts
-thread_start:
+1:
cfi_startproc
cfi_undefined (pc) /* Mark end of stack */
subl %fp, %fp /* terminate the stack frame */
- /* Check and see if we need to reset the PID. */
- movel %d1, %a1
- andl #CLONE_THREAD, %d1
- jne donepid
- movel %a1, %d1
- movel #-1, %d0
- andl #CLONE_VM, %d1
- jne gotpid
- movel #SYS_ify (getpid), %d0
- trap #0
-gotpid:
- movel %a0, -(%sp)
- movel %d0, -(%sp)
- bsrl __m68k_read_tp@PLTPC
- movel (%sp)+, %d0
- movel %d0, PID_OFFSET(%a0)
- movel %d0, TID_OFFSET(%a0)
- movel (%sp)+, %a0
-donepid:
jsr (%a0)
movel %d0, %d1
movel #SYS_ify (exit), %d0
@@ -127,4 +105,5 @@ donepid:
cfi_startproc
PSEUDO_END (__clone)
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h b/sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h
index 61c30b31fa..f402ac6139 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
@@ -39,6 +39,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
/* The only basic operation needed is compare and exchange. */
/* For ColdFire we'll have to trap into the kernel mode anyway,
so trap from the library rather then from the kernel wrapper. */
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/fpu/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/m68k/coldfire/fpu/jmp_buf-macros.h
new file mode 100644
index 0000000000..9b25281277
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/fpu/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 256
+#define SIGJMP_BUF_SIZE 256
+#define JMP_BUF_ALIGN 2
+#define SIGJMP_BUF_ALIGN 2
+#define MASK_WAS_SAVED_OFFSET 124
+#define SAVED_MASK_OFFSET 128
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
index 4de351ea3f..a301c6ebc4 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
-GLIBC_2.4 __libc_memalign F
GLIBC_2.4 __libc_stack_end D 0x4
GLIBC_2.4 __stack_chk_guard D 0x4
GLIBC_2.4 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libBrokenLocale.abilist
index e80f213955..7e60a808d8 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist
index df0c397ddc..a8fafedb66 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 gai_cancel F
GLIBC_2.4 gai_error F
GLIBC_2.4 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 019095b4c2..f57be98e49 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -24,7 +23,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -32,7 +30,6 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 __m68k_read_tp F
GLIBC_2.12 _sys_errlist D 0x21c
GLIBC_2.12 _sys_nerr D 0x4
@@ -40,19 +37,16 @@ GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x21c
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -61,7 +55,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -72,24 +65,65 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.4 _Exit F
GLIBC_2.4 _IO_2_1_stderr_ D 0x98
GLIBC_2.4 _IO_2_1_stdin_ D 0x98
@@ -2046,7 +2080,6 @@ GLIBC_2.4 xdrstdio_create F
GLIBC_2.4 xencrypt F
GLIBC_2.4 xprt_register F
GLIBC_2.4 xprt_unregister F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2064,7 +2097,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2072,7 +2104,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2099,7 +2130,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2110,7 +2140,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libcrypt.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libcrypt.abilist
index 04f1f02fa3..78a25b6df2 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 crypt F
GLIBC_2.4 crypt_r F
GLIBC_2.4 encrypt F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libdl.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libdl.abilist
index 89a750a0a3..40132b1374 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libdl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 dladdr F
GLIBC_2.4 dladdr1 F
GLIBC_2.4 dlclose F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
index e65e2309cd..e126eb07e3 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -53,15 +52,407 @@ GLIBC_2.15 __y1_finite F
GLIBC_2.15 __y1f_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F
GLIBC_2.4 __clog10f F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libnsl.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libnsl.abilist
index 2b2e49e6a1..a005a75181 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __free_fdresult F
GLIBC_2.4 __nis_default_access F
GLIBC_2.4 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
index 91545c1542..af82a4c632 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
@@ -1,15 +1,32 @@
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.4 _IO_flockfile F
GLIBC_2.4 _IO_ftrylockfile F
GLIBC_2.4 _IO_funlockfile F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libresolv.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libresolv.abilist
index c7023be532..2dd5094f76 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __b64_ntop F
GLIBC_2.4 __b64_pton F
GLIBC_2.4 __dn_comp F
@@ -64,7 +63,6 @@ GLIBC_2.4 res_gethostbyname F
GLIBC_2.4 res_gethostbyname2 F
GLIBC_2.4 res_send_setqhook F
GLIBC_2.4 res_send_setrhook F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
index b47aa0cc9c..cfbbd27557 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 aio_cancel F
GLIBC_2.4 aio_cancel64 F
GLIBC_2.4 aio_error F
@@ -38,5 +37,4 @@ GLIBC_2.4 timer_delete F
GLIBC_2.4 timer_getoverrun F
GLIBC_2.4 timer_gettime F
GLIBC_2.4 timer_settime F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libthread_db.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libthread_db.abilist
index 4cffcd2238..065a2626c8 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 td_init F
GLIBC_2.4 td_log F
GLIBC_2.4 td_symbol_list F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist
index 0b4f746094..cc1420e68c 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 forkpty F
GLIBC_2.4 login F
GLIBC_2.4 login_tty F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/localplt.data b/sysdeps/unix/sysv/linux/m68k/coldfire/localplt.data
new file mode 100644
index 0000000000..4a07bf387e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/localplt.data
@@ -0,0 +1,18 @@
+libc.so: __m68k_read_tp
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/nofpu/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/m68k/coldfire/nofpu/jmp_buf-macros.h
new file mode 100644
index 0000000000..24fa289e64
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/nofpu/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 192
+#define SIGJMP_BUF_SIZE 192
+#define JMP_BUF_ALIGN 2
+#define SIGJMP_BUF_ALIGN 2
+#define MASK_WAS_SAVED_OFFSET 60
+#define SAVED_MASK_OFFSET 64
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h b/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h
index 7a3ab07140..a8d6cbef99 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/dl-static.c b/sysdeps/unix/sysv/linux/m68k/dl-static.c
index 5234de6795..566e7649a9 100644
--- a/sysdeps/unix/sysv/linux/m68k/dl-static.c
+++ b/sysdeps/unix/sysv/linux/m68k/dl-static.c
@@ -1,5 +1,5 @@
/* Variable initialization. M68K version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/fcntl.c b/sysdeps/unix/sysv/linux/m68k/fcntl.c
deleted file mode 100644
index ea951bc4f9..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/getdents64.c b/sysdeps/unix/sysv/linux/m68k/getdents64.c
deleted file mode 100644
index 0c75fb5a06..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/getdents64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getdents64.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/getpagesize.c b/sysdeps/unix/sysv/linux/m68k/getpagesize.c
index e07e6ed712..168da2f181 100644
--- a/sysdeps/unix/sysv/linux/m68k/getpagesize.c
+++ b/sysdeps/unix/sysv/linux/m68k/getpagesize.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>.
diff --git a/sysdeps/unix/sysv/linux/m68k/getrlimit64.c b/sysdeps/unix/sysv/linux/m68k/getrlimit64.c
deleted file mode 100644
index fef018f471..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/getrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/getsysstats.c b/sysdeps/unix/sysv/linux/m68k/getsysstats.c
index 682548c0cc..f457ea5e6b 100644
--- a/sysdeps/unix/sysv/linux/m68k/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/m68k/getsysstats.c
@@ -1,5 +1,5 @@
/* Determine various system internal values, Linux/m68k version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de>
diff --git a/sysdeps/unix/sysv/linux/m68k/glob64.c b/sysdeps/unix/sysv/linux/m68k/glob64.c
deleted file mode 100644
index 82a9a296a7..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/glob64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/glob64.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/init-first.c b/sysdeps/unix/sysv/linux/m68k/init-first.c
index fb62f53d3f..384a96c16d 100644
--- a/sysdeps/unix/sysv/linux/m68k/init-first.c
+++ b/sysdeps/unix/sysv/linux/m68k/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. Linux/m68k.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index 1b9fbc30d4..6980f922e3 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,39 +22,36 @@
/* Direct socketcalls available with kernel 4.3. */
#if __LINUX_KERNEL_VERSION >= 0x040300
-# define __ASSUME_RECVMMSG_SYSCALL 1
-# define __ASSUME_SENDMMSG_SYSCALL 1
# define __ASSUME_SOCKET_SYSCALL 1
# define __ASSUME_SOCKETPAIR_SYSCALL 1
# define __ASSUME_BIND_SYSCALL 1
-# define __ASSUME_CONNECT_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT4_SYSCALL 1
-# define __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL 1
# define __ASSUME_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
# define __ASSUME_GETPEERNAME_SYSCALL 1
-# define __ASSUME_SENDTO_SYSCALL 1
-# define __ASSUME_SENDTO_FOR_SEND_SYSCALL 1
-# define __ASSUME_SENDMSG_SYSCALL 1
-# define __ASSUME_RECVFROM_SYSCALL 1
-# define __ASSUME_RECVFROM_FOR_RECV_SYSCALL 1
-# define __ASSUME_RECVMSG_SYSCALL 1
# define __ASSUME_SHUTDOWN_SYSCALL 1
#endif
#include_next <kernel-features.h>
-/* These syscalls were added only in 3.0 for m68k. */
-#if __LINUX_KERNEL_VERSION < 0x030000
-# undef __ASSUME_PSELECT
-# undef __ASSUME_PPOLL
+#undef __ASSUME_ACCEPT_SYSCALL
+
+#if __LINUX_KERNEL_VERSION < 0x040300
+# undef __ASSUME_ACCEPT4_SYSCALL
+# undef __ASSUME_RECVMMSG_SYSCALL
+# undef __ASSUME_SENDMMSG_SYSCALL
+# undef __ASSUME_SENDMSG_SYSCALL
+# undef __ASSUME_RECVMSG_SYSCALL
+# undef __ASSUME_CONNECT_SYSCALL
+# undef __ASSUME_RECVFROM_SYSCALL
+# undef __ASSUME_SENDTO_SYSCALL
#endif
/* No support for PI futexes or robust mutexes before 3.10 for m68k. */
#if __LINUX_KERNEL_VERSION < 0x030a00
-# undef __ASSUME_FUTEX_LOCK_PI
-# undef __ASSUME_REQUEUE_PI
# undef __ASSUME_SET_ROBUST_LIST
#endif
+
+/* m68k only supports ipc syscall. */
+#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
new file mode 100644
index 0000000000..54972feb13
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h
@@ -0,0 +1,22 @@
+#ifndef _KERNEL_SIGACTION_H
+# define _KERNEL_SIGACTION_H
+
+#include <signal.h>
+
+#define SA_RESTORER 0x04000000
+
+/* This is the sigaction structure from the Linux 3.2 kernel. */
+struct kernel_sigaction
+{
+ __sighandler_t k_sa_handler;
+ sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer) (void);
+};
+
+#define SET_SA_RESTORER(kact, act) \
+ (kact)->sa_restorer = (act)->sa_restorer
+#define RESET_SA_RESTORER(act, kact) \
+ (act)->sa_restorer = (kact)->sa_restorer
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/m68k/ldsodefs.h b/sysdeps/unix/sysv/linux/m68k/ldsodefs.h
index 6177905b52..5f1e91b9cc 100644
--- a/sysdeps/unix/sysv/linux/m68k/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/m68k/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects. M68K.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/localplt.data b/sysdeps/unix/sysv/linux/m68k/localplt.data
deleted file mode 100644
index 88124c4460..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/localplt.data
+++ /dev/null
@@ -1,16 +0,0 @@
-libc.so: _Unwind_Find_FDE
-libc.so: __m68k_read_tp
-libc.so: calloc
-libc.so: free
-libc.so: malloc
-libc.so: memalign
-libc.so: realloc
-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
-ld.so: malloc
-ld.so: calloc
-ld.so: realloc
-ld.so: free
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/getcontext.S b/sysdeps/unix/sysv/linux/m68k/m680x0/getcontext.S
index 6c7be2bb28..7fdf17ad11 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/getcontext.S
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/m68k/m680x0/jmp_buf-macros.h
new file mode 100644
index 0000000000..2f62ecb4b3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 288
+#define SIGJMP_BUF_SIZE 288
+#define JMP_BUF_ALIGN 2
+#define SIGJMP_BUF_ALIGN 2
+#define MASK_WAS_SAVED_OFFSET 156
+#define SAVED_MASK_OFFSET 160
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
index ee3458906d..c9ec45cf1c 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
@@ -1,14 +1,9 @@
-GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
GLIBC_2.0 _r_debug D 0x14
GLIBC_2.0 calloc F
GLIBC_2.0 free F
GLIBC_2.0 malloc F
GLIBC_2.0 realloc F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_stack_end D 0x4
GLIBC_2.1 _dl_mcount F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libBrokenLocale.abilist
index 4a56bb68a3..54395f3c8d 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index a999a4812e..ddc7ebca67 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -1314,7 +1312,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 _IO_2_1_stderr_ D 0x98
GLIBC_2.1 _IO_2_1_stdin_ D 0x98
GLIBC_2.1 _IO_2_1_stdout_ D 0x98
@@ -1618,7 +1615,6 @@ GLIBC_2.1 xdr_uint16_t F
GLIBC_2.1 xdr_uint32_t F
GLIBC_2.1 xdr_uint8_t F
GLIBC_2.1 xdr_unixcred F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 _Exit F
GLIBC_2.1.1 __mempcpy_small F
GLIBC_2.1.1 __stpcpy_small F
@@ -1648,7 +1644,6 @@ GLIBC_2.1.1 xdr_longlong_t F
GLIBC_2.1.1 xdr_u_hyper F
GLIBC_2.1.1 xdr_u_longlong_t F
GLIBC_2.1.1 xdr_uint64_t F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
GLIBC_2.1.2 getaliasbyname_r F
GLIBC_2.1.2 getaliasent_r F
@@ -1676,11 +1671,9 @@ GLIBC_2.1.2 getservbyport_r F
GLIBC_2.1.2 getservent_r F
GLIBC_2.1.2 getspent_r F
GLIBC_2.1.2 getspnam_r F
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 __cxa_atexit F
GLIBC_2.1.3 __cxa_finalize F
GLIBC_2.1.3 __sigsuspend F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1706,7 +1699,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -1714,7 +1706,6 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 __m68k_read_tp F
GLIBC_2.12 _sys_errlist D 0x21c
GLIBC_2.12 _sys_nerr D 0x4
@@ -1722,19 +1713,16 @@ GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x21c
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1743,7 +1731,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -1754,16 +1741,13 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_adjust_wcolumn F
GLIBC_2.2 _IO_fgetpos F
GLIBC_2.2 _IO_fgetpos64 F
@@ -1940,33 +1924,71 @@ GLIBC_2.2 wcsftime F
GLIBC_2.2 wmempcpy F
GLIBC_2.2 wprintf F
GLIBC_2.2 wscanf F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2060,7 +2082,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2073,7 +2094,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x104
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2094,7 +2114,6 @@ GLIBC_2.3.3 sched_setaffinity F
GLIBC_2.3.3 semtimedop F
GLIBC_2.3.3 sys_sigabbrev D 0x104
GLIBC_2.3.3 sys_siglist D 0x104
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2124,7 +2143,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2201,7 +2219,6 @@ GLIBC_2.4 sys_errlist D 0x210
GLIBC_2.4 sys_nerr D 0x4
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2219,7 +2236,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2227,7 +2243,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2254,7 +2269,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2265,7 +2279,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libcrypt.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libdl.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libdl.abilist
index 5536f6e0a9..7826fde951 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 dlopen F
GLIBC_2.1 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
index 2d31935916..40ac529f7f 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _LIB_VERSION D 0x4
GLIBC_2.0 acos F
GLIBC_2.0 acosf F
@@ -155,7 +154,6 @@ GLIBC_2.0 y1l F
GLIBC_2.0 yn F
GLIBC_2.0 ynf F
GLIBC_2.0 ynl F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __clog10 F
GLIBC_2.1 __clog10f F
GLIBC_2.1 __clog10l F
@@ -311,7 +309,6 @@ GLIBC_2.1 tgammal F
GLIBC_2.1 trunc F
GLIBC_2.1 truncf F
GLIBC_2.1 truncl F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -393,11 +390,9 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 feclearexcept F
GLIBC_2.2 fedisableexcept F
GLIBC_2.2 feenableexcept F
@@ -408,9 +403,404 @@ GLIBC_2.2 feraiseexcept F
GLIBC_2.2 fesetenv F
GLIBC_2.2 fesetexceptflag F
GLIBC_2.2 feupdateenv F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libnsl.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libnsl.abilist
index a23db2aeaf..add3d66a7a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __free_fdresult F
GLIBC_2.1 __nis_default_access F
GLIBC_2.1 __nis_default_group F
@@ -120,5 +118,4 @@ GLIBC_2.1 readColdStartFile F
GLIBC_2.1 writeColdStartFile F
GLIBC_2.1 xdr_cback_data F
GLIBC_2.1 xdr_obj_p F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 xdr_ypall F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
index 8f9c3254be..bece86d246 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_flockfile F
GLIBC_2.0 _IO_ftrylockfile F
GLIBC_2.0 _IO_funlockfile F
@@ -119,7 +118,6 @@ GLIBC_2.0 vfork F
GLIBC_2.0 wait F
GLIBC_2.0 waitpid F
GLIBC_2.0 write F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_allocate_rtsig F
GLIBC_2.1 __libc_current_sigrtmax F
GLIBC_2.1 __libc_current_sigrtmin F
@@ -154,24 +152,18 @@ GLIBC_2.1 sem_init F
GLIBC_2.1 sem_post F
GLIBC_2.1 sem_trywait F
GLIBC_2.1 sem_wait F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 sem_close F
GLIBC_2.1.1 sem_open F
GLIBC_2.1.1 sem_unlink F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __open64 F
GLIBC_2.2 __pread64 F
GLIBC_2.2 __pthread_rwlock_destroy F
@@ -212,18 +204,35 @@ GLIBC_2.2 pthread_yield F
GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -239,13 +248,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libresolv.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libresolv.abilist
index 4d50e7c8c6..157a33ce35 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
index 15e4418863..595f1b712a 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 aio_cancel F
GLIBC_2.1 aio_cancel64 F
GLIBC_2.1 aio_error F
@@ -16,7 +15,6 @@ GLIBC_2.1 aio_write F
GLIBC_2.1 aio_write64 F
GLIBC_2.1 lio_listio F
GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 clock_getcpuclockid F
GLIBC_2.2 clock_getres F
GLIBC_2.2 clock_gettime F
@@ -29,7 +27,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -40,8 +37,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libthread_db.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist
index 89c67755c4..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/localplt.data b/sysdeps/unix/sysv/linux/m68k/m680x0/localplt.data
new file mode 100644
index 0000000000..c70d6ea301
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/localplt.data
@@ -0,0 +1,19 @@
+libc.so: _Unwind_Find_FDE
+libc.so: __m68k_read_tp
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/makecontext.S b/sysdeps/unix/sysv/linux/m68k/m680x0/makecontext.S
index c0fc8a9c41..841364936b 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/makecontext.S
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/makecontext.S
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/setcontext.S b/sysdeps/unix/sysv/linux/m68k/m680x0/setcontext.S
index bab13b5c75..5dc7561ede 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/setcontext.S
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/swapcontext.S b/sysdeps/unix/sysv/linux/m68k/m680x0/swapcontext.S
index 84bcd66b56..48e903f745 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list b/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list
deleted file mode 100644
index b0ad68936d..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list
+++ /dev/null
@@ -1,4 +0,0 @@
-# File name Caller Syscall name Args Strong name Weak names
-
-oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
-setrlimit - setrlimit i:ip __setrlimit setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h b/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h
index 9bbd9845b6..a0bf2d0bd3 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S b/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
index c80ecf7e8c..2921f6a12d 100644
--- a/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
+++ b/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/unix/sysv/linux/m68k/m68k-vdso.c b/sysdeps/unix/sysv/linux/m68k/m68k-vdso.c
index 0878f16fa9..3b7700e6a6 100644
--- a/sysdeps/unix/sysv/linux/m68k/m68k-vdso.c
+++ b/sysdeps/unix/sysv/linux/m68k/m68k-vdso.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/unix/sysv/linux/m68k/m68k-vdso.h b/sysdeps/unix/sysv/linux/m68k/m68k-vdso.h
index 713926b487..6caf15c356 100644
--- a/sysdeps/unix/sysv/linux/m68k/m68k-vdso.h
+++ b/sysdeps/unix/sysv/linux/m68k/m68k-vdso.h
@@ -1,5 +1,5 @@
/* Resolve function pointers to VDSO functions.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
diff --git a/sysdeps/unix/sysv/linux/m68k/mmap.S b/sysdeps/unix/sysv/linux/m68k/mmap.S
deleted file mode 100644
index 855b190b8a..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/mmap.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/* 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 <sysdep.h>
-
- .text
-ENTRY (__mmap)
-
- move.l #SYS_ify (mmap), %d0 /* System call number in %d0. */
-
- lea 4(%sp), %a0 /* Address of args is 1st arg. */
- move.l %a0, %d1
-
- /* Do the system call trap. */
- trap #0
-
- /* Kludge: negative numbers are among the legal return values.
- If %d0 is between -4096 and 0 then there was an error. */
- cmp.l #-4096, %d0
- jhi SYSCALL_ERROR_LABEL
-
- /* Successful; return the syscall's value. Copy it to %a0 because
- mmap is declared to return a pointer. */
- move.l %d0, %a0
- rts
-PSEUDO_END (__mmap)
-
-weak_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/m68k/mmap64.c b/sysdeps/unix/sysv/linux/m68k/mmap64.c
deleted file mode 100644
index 8bf8987017..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/mmap64.c
+++ /dev/null
@@ -1,5 +0,0 @@
-/* ColdFire and Sun 3 kernels have PAGE_SHIFT set to 13 and expect
- mmap2 offset to be provided in 8K pages. Determine the shift
- dynamically with getpagesize. */
-#define MMAP2_PAGE_SHIFT -1
-#include <sysdeps/unix/sysv/linux/mmap64.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/mmap_internal.h b/sysdeps/unix/sysv/linux/m68k/mmap_internal.h
new file mode 100644
index 0000000000..cf6d3ee886
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/mmap_internal.h
@@ -0,0 +1,29 @@
+/* Common mmap definition for Linux implementation. Linux/m68k version.
+ Copyright (C) 2017-2018 Free Software 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 MMAP_M68K_INTERNAL_LINUX_H
+#define MMAP_M68K_INTERNAL_LINUX_H
+
+/* ColdFire and Sun 3 kernels have PAGE_SHIFT set to 13 and expect
+ mmap2 offset to be provided in 8K pages. Determine the shift
+ dynamically with getpagesize. */
+#define MMAP2_PAGE_UNIT -1
+
+#include_next <mmap_internal.h>
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/m68k/mremap.S b/sysdeps/unix/sysv/linux/m68k/mremap.S
index 808bdc10f8..d077c74614 100644
--- a/sysdeps/unix/sysv/linux/m68k/mremap.S
+++ b/sysdeps/unix/sysv/linux/m68k/mremap.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,4 +25,5 @@ PSEUDO (__mremap, mremap, 5)
move.l %d0, %a0
rts
PSEUDO_END (__mremap)
+libc_hidden_def (__mremap)
weak_alias (__mremap, mremap)
diff --git a/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c
deleted file mode 100644
index 4c27e957bf..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/readdir64.c b/sysdeps/unix/sysv/linux/m68k/readdir64.c
deleted file mode 100644
index 2ea26dd409..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/readdir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/readdir64.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/readdir64_r.c b/sysdeps/unix/sysv/linux/m68k/readdir64_r.c
deleted file mode 100644
index 9f54f897e3..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/readdir64_r.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/register-dump.h b/sysdeps/unix/sysv/linux/m68k/register-dump.h
index a9cfcd5252..c0cc7f6156 100644
--- a/sysdeps/unix/sysv/linux/m68k/register-dump.h
+++ b/sysdeps/unix/sysv/linux/m68k/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
diff --git a/sysdeps/unix/sysv/linux/m68k/scandir64.c b/sysdeps/unix/sysv/linux/m68k/scandir64.c
deleted file mode 100644
index 506fd8877c..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/scandir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/scandir64.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/semtimedop.S b/sysdeps/unix/sysv/linux/m68k/semtimedop.S
deleted file mode 100644
index b291070f5a..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/semtimedop.S
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@suse.de>, 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 <sysdep.h>
-
-#define SYSOP_semtimedop 4
-
-#define SVRSP 8 /* saved register space */
-#define PARMS 4+SVRSP /* space for 3 saved regs */
-#define SEMID PARMS
-#define SOPS SEMID+4
-#define NSOPS SOPS+4
-#define TIMEOUT NSOPS+4
-
- .text
-ENTRY (semtimedop)
-
- /* Save registers. */
- move.l %d2, %a1
- move.l %d3, -(%sp)
- cfi_adjust_cfa_offset (4)
- move.l %d5, -(%sp)
- cfi_adjust_cfa_offset (4)
- cfi_register (%d2, %a1)
- cfi_rel_offset (%d3, 0)
- cfi_rel_offset (%d5, 4)
-
- move.l #SYSOP_semtimedop, %d1
- move.l SEMID(%sp), %d2
- move.l NSOPS(%sp), %d3
- move.l SOPS(%sp), %d5
- move.l TIMEOUT(%sp), %a0
- move.l #SYS_ify (ipc), %d0
-
- trap #0
-
- /* Restore registers. */
- move.l (%sp)+, %d5
- cfi_adjust_cfa_offset (-4)
- cfi_restore (%d5)
- move.l (%sp)+, %d3
- cfi_adjust_cfa_offset (-4)
- cfi_restore (%d3)
- move.l %a1, %d2
- cfi_restore (%d2)
-
- /* Check for error. */
- tst.l %d0
- jmi SYSCALL_ERROR_LABEL
-
- /* Successful; return the syscall's value. */
- ret
-
-PSEUDO_END (semtimedop)
diff --git a/sysdeps/unix/sysv/linux/m68k/setegid.c b/sysdeps/unix/sysv/linux/m68k/setegid.c
deleted file mode 100644
index 2e3a54c893..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/setegid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setegid.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/seteuid.c b/sysdeps/unix/sysv/linux/m68k/seteuid.c
deleted file mode 100644
index 18e41d08c1..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/seteuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/seteuid.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/setgid.c b/sysdeps/unix/sysv/linux/m68k/setgid.c
deleted file mode 100644
index 377021d9ec..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/setgid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setgid.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/setgroups.c b/sysdeps/unix/sysv/linux/m68k/setgroups.c
deleted file mode 100644
index 0e7086278f..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/setgroups.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* We also have to rewrite the kernel gid_t to the user land type. */
-#include <sysdeps/unix/sysv/linux/i386/setgroups.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/setregid.c b/sysdeps/unix/sysv/linux/m68k/setregid.c
deleted file mode 100644
index 99c57ad20f..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/setregid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setregid.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/setresgid.c b/sysdeps/unix/sysv/linux/m68k/setresgid.c
deleted file mode 100644
index daca1a4833..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/setresgid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setresgid.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/setresuid.c b/sysdeps/unix/sysv/linux/m68k/setresuid.c
deleted file mode 100644
index 3aeabe9ad7..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/setresuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setresuid.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/setreuid.c b/sysdeps/unix/sysv/linux/m68k/setreuid.c
deleted file mode 100644
index 8ad61226e9..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/setreuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/setuid.c b/sysdeps/unix/sysv/linux/m68k/setuid.c
deleted file mode 100644
index de394379be..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/setuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setuid.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h b/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h
index 817d57871b..98e28beb8a 100644
--- a/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>, 1998.
@@ -17,9 +17,4 @@
<http://www.gnu.org/licenses/>. */
#define SIGCONTEXT int _code, struct sigcontext *
-#define SIGCONTEXT_EXTRA_ARGS _code,
#define GET_PC(ctx) ((void *) (ctx)->sc_pc)
-#define GET_FRAME(ctx) ((void *) __builtin_frame_address (1))
-#define GET_STACK(ctx) ((void *) (ctx)->sc_usp)
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/m68k/sys/procfs.h b/sysdeps/unix/sysv/linux/m68k/sys/procfs.h
index dd2938c143..fda6d980b9 100644
--- a/sysdeps/unix/sysv/linux/m68k/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/m68k/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/sys/reg.h b/sysdeps/unix/sysv/linux/m68k/sys/reg.h
index ac3244f071..fe257276b9 100644
--- a/sysdeps/unix/sysv/linux/m68k/sys/reg.h
+++ b/sysdeps/unix/sysv/linux/m68k/sys/reg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h b/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
index d8ee5423a5..48b8a09629 100644
--- a/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,92 +21,110 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
/* Type for general register. */
typedef int greg_t;
/* Number of general registers. */
-#define NGREG 18
+#define __NGREG 18
+#ifdef __USE_MISC
+# define NGREG __NGREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
+#ifdef __USE_MISC
/* Number of each register is the `gregset_t' array. */
enum
{
R_D0 = 0,
-#define R_D0 R_D0
+# define R_D0 R_D0
R_D1 = 1,
-#define R_D1 R_D1
+# define R_D1 R_D1
R_D2 = 2,
-#define R_D2 R_D2
+# define R_D2 R_D2
R_D3 = 3,
-#define R_D3 R_D3
+# define R_D3 R_D3
R_D4 = 4,
-#define R_D4 R_D4
+# define R_D4 R_D4
R_D5 = 5,
-#define R_D5 R_D5
+# define R_D5 R_D5
R_D6 = 6,
-#define R_D6 R_D6
+# define R_D6 R_D6
R_D7 = 7,
-#define R_D7 R_D7
+# define R_D7 R_D7
R_A0 = 8,
-#define R_A0 R_A0
+# define R_A0 R_A0
R_A1 = 9,
-#define R_A1 R_A1
+# define R_A1 R_A1
R_A2 = 10,
-#define R_A2 R_A2
+# define R_A2 R_A2
R_A3 = 11,
-#define R_A3 R_A3
+# define R_A3 R_A3
R_A4 = 12,
-#define R_A4 R_A4
+# define R_A4 R_A4
R_A5 = 13,
-#define R_A5 R_A5
+# define R_A5 R_A5
R_A6 = 14,
-#define R_A6 R_A6
+# define R_A6 R_A6
R_A7 = 15,
-#define R_A7 R_A7
+# define R_A7 R_A7
R_SP = 15,
-#define R_SP R_SP
+# define R_SP R_SP
R_PC = 16,
-#define R_PC R_PC
+# define R_PC R_PC
R_PS = 17
-#define R_PS R_PS
+# define R_PS R_PS
};
+#endif
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
/* Structure to describe FPU registers. */
-typedef struct fpregset
+typedef struct
{
- int f_pcr;
- int f_psr;
- int f_fpiaddr;
+ int __ctx(f_pcr);
+ int __ctx(f_psr);
+ int __ctx(f_fpiaddr);
#ifdef __mcoldfire__
- int f_fpregs[8][2];
+ int __ctx(f_fpregs)[8][2];
#else
- int f_fpregs[8][3];
+ int __ctx(f_fpregs)[8][3];
#endif
} fpregset_t;
/* Context to describe whole processor state. */
typedef struct
{
- int version;
- gregset_t gregs;
- fpregset_t fpregs;
+ int __ctx(version);
+ gregset_t __ctx(gregs);
+ fpregset_t __ctx(fpregs);
} mcontext_t;
-#define MCONTEXT_VERSION 2
+#ifdef __USE_MISC
+# define MCONTEXT_VERSION 2
+#endif
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long uc_flags;
- struct ucontext *uc_link;
+ unsigned long __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
- unsigned long uc_filler[80];
- __sigset_t uc_sigmask;
+ unsigned long __glibc_reserved1[80];
+ sigset_t uc_sigmask;
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/m68k/sys/user.h b/sysdeps/unix/sysv/linux/m68k/sys/user.h
index fe1051a31d..e1c3a85358 100644
--- a/sysdeps/unix/sysv/linux/m68k/sys/user.h
+++ b/sysdeps/unix/sysv/linux/m68k/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/syscall.S b/sysdeps/unix/sysv/linux/m68k/syscall.S
index c153c0a601..67f1c22609 100644
--- a/sysdeps/unix/sysv/linux/m68k/syscall.S
+++ b/sysdeps/unix/sysv/linux/m68k/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/syscalls.list b/sysdeps/unix/sysv/linux/m68k/syscalls.list
index 4260f3e55f..55a377b841 100644
--- a/sysdeps/unix/sysv/linux/m68k/syscalls.list
+++ b/sysdeps/unix/sysv/linux/m68k/syscalls.list
@@ -3,7 +3,6 @@
chown - chown32 i:sii __chown chown
lchown - lchown32 i:sii __lchown lchown
fchown - fchown32 i:iii __fchown fchown
-waitpid - waitpid Ci:ipi __waitpid waitpid
getegid - getegid32 Ei: __getegid getegid
geteuid - geteuid32 Ei: __geteuid geteuid
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h b/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
deleted file mode 100644
index a12989f702..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY (name) \
- SINGLE_THREAD_P; \
- jne .Lpseudo_cancel; \
- .type __##syscall_name##_nocancel,@function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- DO_CALL (syscall_name, args); \
- cmp.l &-4095, %d0; \
- jcc SYSCALL_ERROR_LABEL; \
- rts; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
- .Lpseudo_cancel: \
- CENABLE; \
- DOCARGS_##args \
- move.l %d0, -(%sp); /* Save result of CENABLE. */ \
- cfi_adjust_cfa_offset (4); \
- move.l &SYS_ify (syscall_name), %d0; \
- trap &0; \
- move.l %d0, %d2; \
- CDISABLE; \
- addq.l &4, %sp; /* Remove result of CENABLE from the stack. */ \
- cfi_adjust_cfa_offset (-4); \
- move.l %d2, %d0; \
- UNDOCARGS_##args \
- cmp.l &-4095, %d0; \
- jcc SYSCALL_ERROR_LABEL
-
-/* Note: we use D2 to save syscall's return value as D0 will be clobbered in
- CDISABLE. */
-# define DOCARGS_0 move.l %d2, -(%sp); \
- cfi_adjust_cfa_offset (4); cfi_rel_offset (%d2, 0);
-# define UNDOCARGS_0 move.l (%sp)+, %d2; \
- cfi_adjust_cfa_offset (-4); cfi_restore (%d2);
-
-# define DOCARGS_1 _DOCARGS_1 (4); DOCARGS_0
-# define _DOCARGS_1(n) move.l n(%sp), %d1;
-# define UNDOCARGS_1 UNDOCARGS_0
-
-# define DOCARGS_2 _DOCARGS_2 (8)
-# define _DOCARGS_2(n) DOCARGS_0 move.l n+4(%sp), %d2; _DOCARGS_1 (n)
-# define UNDOCARGS_2 UNDOCARGS_0
-
-# define DOCARGS_3 _DOCARGS_3 (12)
-# define _DOCARGS_3(n) move.l %d3, -(%sp); \
- cfi_adjust_cfa_offset (4); cfi_rel_offset (%d3, 0); \
- move.l n+4(%sp), %d3; _DOCARGS_2 (n)
-# define UNDOCARGS_3 UNDOCARGS_2 move.l (%sp)+, %d3; \
- cfi_adjust_cfa_offset (-4); cfi_restore (%d3);
-
-# define DOCARGS_4 _DOCARGS_4 (16)
-# define _DOCARGS_4(n) move.l %d4, -(%sp); \
- cfi_adjust_cfa_offset (4); cfi_rel_offset (%d4, 0); \
- move.l n+4(%sp), %d4; _DOCARGS_3 (n)
-# define UNDOCARGS_4 UNDOCARGS_3 move.l (%sp)+, %d4; \
- cfi_adjust_cfa_offset (-4); cfi_restore (%d4);
-
-# define DOCARGS_5 _DOCARGS_5 (20)
-# define _DOCARGS_5(n) move.l %d5, -(%sp); \
- cfi_adjust_cfa_offset (4); cfi_rel_offset (%d5, 0); \
- move.l n+4(%sp), %d5; _DOCARGS_4 (n)
-# define UNDOCARGS_5 UNDOCARGS_4 move.l (%sp)+, %d5; \
- cfi_adjust_cfa_offset (-4); cfi_restore (%d5);
-
-# define DOCARGS_6 _DOCARGS_6 (24)
-# define _DOCARGS_6(n) move.l n(%sp), %a0; _DOCARGS_5 (n-4)
-# define UNDOCARGS_6 UNDOCARGS_5
-
-# ifdef PIC
-# define PSEUDO_JMP(sym) jbsr sym ## @PLTPC
-# else
-# define PSEUDO_JMP(sym) jbsr sym
-# endif
-
-# if IS_IN (libpthread)
-# define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__pthread_disable_asynccancel)
-# elif IS_IN (libc)
-# define CENABLE PSEUDO_JMP (__libc_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__libc_disable_asynccancel)
-# elif IS_IN (librt)
-# define CENABLE PSEUDO_JMP (__librt_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__librt_disable_asynccancel)
-# else
-# error Unsupported library
-# endif
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P \
- PSEUDO_JMP (__m68k_read_tp); \
- tst.l MULTIPLE_THREADS_OFFSET(%a0)
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION (1)
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, \
- 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.S b/sysdeps/unix/sysv/linux/m68k/sysdep.S
index b7d6ab904d..18c0d9cf8b 100644
--- a/sysdeps/unix/sysv/linux/m68k/sysdep.S
+++ b/sysdeps/unix/sysv/linux/m68k/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h
index ce48496fd4..a8da24ebf4 100644
--- a/sysdeps/unix/sysv/linux/m68k/sysdep.h
+++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>,
December 1995.
diff --git a/sysdeps/unix/sysv/linux/m68k/versionsort64.c b/sysdeps/unix/sysv/linux/m68k/versionsort64.c
deleted file mode 100644
index 144b691e56..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/versionsort64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/versionsort64.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/vfork.S b/sysdeps/unix/sysv/linux/m68k/vfork.S
index 1625a7b7a0..014e91159a 100644
--- a/sysdeps/unix/sysv/linux/m68k/vfork.S
+++ b/sysdeps/unix/sysv/linux/m68k/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
@@ -28,18 +28,6 @@
ENTRY (__vfork)
- /* Save the TCB-cached PID away in %d1, and then negate the TCB
- field. But if it's zero, set it to 0x80000000 instead. See
- raise.c for the logic that relies on this value. */
- jbsr __m68k_read_tp@PLTPC
- movel %a0, %a1
- movel PID_OFFSET(%a1), %d0
- movel %d0, %d1
- negl %d0
- jne 1f
- movel #0x80000000, %d0
-1: movel %d0, PID_OFFSET(%a1)
-
/* Pop the return PC value into A0. */
movel %sp@+, %a0
cfi_adjust_cfa_offset (-4)
@@ -49,14 +37,6 @@ ENTRY (__vfork)
movel #SYS_ify (vfork), %d0
trap #0
- /* Restore the original value of the TCB cache of the PID, if we're
- the parent. But in the child (syscall return value equals zero),
- leave things as they are. */
- tstl %d0
- jeq 1f
- movel %d1, PID_OFFSET(%a1)
-1:
-
tstl %d0
jmi .Lerror /* Branch forward if it failed. */
diff --git a/sysdeps/unix/sysv/linux/makedev.c b/sysdeps/unix/sysv/linux/makedev.c
deleted file mode 100644
index 68c18ca333..0000000000
--- a/sysdeps/unix/sysv/linux/makedev.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Definitions of functions to access `dev_t' values.
- 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 <endian.h>
-#include <sys/sysmacros.h>
-
-unsigned int
-gnu_dev_major (unsigned long long int dev)
-{
- return ((dev >> 8) & 0xfff) | ((unsigned int) (dev >> 32) & ~0xfff);
-}
-
-unsigned int
-gnu_dev_minor (unsigned long long int dev)
-{
- return (dev & 0xff) | ((unsigned int) (dev >> 12) & ~0xff);
-}
-
-unsigned long long int
-gnu_dev_makedev (unsigned int major, unsigned int minor)
-{
- return ((minor & 0xff) | ((major & 0xfff) << 8)
- | (((unsigned long long int) (minor & ~0xff)) << 12)
- | (((unsigned long long int) (major & ~0xfff)) << 32));
-}
diff --git a/sysdeps/unix/sysv/linux/malloc-sysdep.h b/sysdeps/unix/sysv/linux/malloc-sysdep.h
index f4a850fb3d..364a78ee86 100644
--- a/sysdeps/unix/sysv/linux/malloc-sysdep.h
+++ b/sysdeps/unix/sysv/linux/malloc-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific malloc support functions. Linux version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -42,14 +42,14 @@ check_may_shrink_heap (void)
if (__builtin_expect (may_shrink_heap == 0, 1))
{
- int fd = open_not_cancel_2 ("/proc/sys/vm/overcommit_memory",
- O_RDONLY | O_CLOEXEC);
+ int fd = __open_nocancel ("/proc/sys/vm/overcommit_memory",
+ O_RDONLY | O_CLOEXEC);
if (fd >= 0)
{
char val;
- ssize_t n = read_not_cancel (fd, &val, 1);
+ ssize_t n = __read_nocancel (fd, &val, 1);
may_shrink_heap = n > 0 && val == '2';
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
}
}
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/____longjmp_chk.S b/sysdeps/unix/sysv/linux/microblaze/____longjmp_chk.S
index 4b10e0489d..8eb4d5ec51 100644
--- a/sysdeps/unix/sysv/linux/microblaze/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/microblaze/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/microblaze/arch-fork.h b/sysdeps/unix/sysv/linux/microblaze/arch-fork.h
deleted file mode 100644
index 6073a393d2..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/arch-fork.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. MicroBlaze version.
- Copyright (C) 2014-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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 5, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \
- NULL, NULL, &THREAD_SELF->tid)
diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/fcntl.h b/sysdeps/unix/sysv/linux/microblaze/bits/fcntl.h
index e485846933..04bec4d550 100644
--- a/sysdeps/unix/sysv/linux/microblaze/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/microblaze/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/mman.h b/sysdeps/unix/sysv/linux/microblaze/bits/mman.h
index 6f9dc5b707..fe1b376720 100644
--- a/sysdeps/unix/sysv/linux/microblaze/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/microblaze/bits/mman.h
@@ -1,6 +1,6 @@
/* Definitions for POSIX memory map interface. Linux/MicroBlaze version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -36,6 +36,10 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_SYNC 0x80000 /* Perform synchronous page
+ faults for the mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Include generic Linux declarations. */
diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/stat.h b/sysdeps/unix/sysv/linux/microblaze/bits/stat.h
index 7143f2dc92..b69e054967 100644
--- a/sysdeps/unix/sysv/linux/microblaze/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/microblaze/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/microblaze/brk.c b/sysdeps/unix/sysv/linux/microblaze/brk.c
index 3c72471c63..25d7defe79 100644
--- a/sysdeps/unix/sysv/linux/microblaze/brk.c
+++ b/sysdeps/unix/sysv/linux/microblaze/brk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/microblaze/clock-compat.c b/sysdeps/unix/sysv/linux/microblaze/clock-compat.c
new file mode 100644
index 0000000000..6d7ca6ab6f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/microblaze/clock-compat.c
@@ -0,0 +1,31 @@
+/* ABI compatibility redirects for clock_* symbols in librt.
+ MicroBlaze version.
+ Copyright (C) 2017-2018 Free Software 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 <shlib-compat.h>
+
+/* These symbols were accidentally included in librt for MicroBlaze
+ despite the first release coming after the general obsoletion in
+ librt, so ensure they remain as part of the ABI. */
+
+#ifdef SHARED
+# undef SHLIB_COMPAT
+# define SHLIB_COMPAT(lib, introduced, obsoleted) 1
+#endif
+
+#include <rt/clock-compat.c>
diff --git a/sysdeps/unix/sysv/linux/microblaze/clone.S b/sysdeps/unix/sysv/linux/microblaze/clone.S
index 035d88b29f..ffc97ab7b3 100644
--- a/sysdeps/unix/sysv/linux/microblaze/clone.S
+++ b/sysdeps/unix/sysv/linux/microblaze/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -69,4 +69,5 @@ L(thread_start):
nop
PSEUDO_END(__clone)
+libc_hidden_def (__clone)
weak_alias (__clone,clone)
diff --git a/sysdeps/unix/sysv/linux/microblaze/fcntl.c b/sysdeps/unix/sysv/linux/microblaze/fcntl.c
deleted file mode 100644
index ea951bc4f9..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/microblaze/futimesat.c b/sysdeps/unix/sysv/linux/microblaze/futimesat.c
deleted file mode 100644
index 9ce61900bd..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/futimesat.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Implement futimesat for MicroBlaze.
- Copyright (C) 2014-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/>. */
-
-/* MicroBlaze always had the utimensat syscall but gained the
- futimesat syscall later, so use the linux-generic implementation of
- futimesat in terms of the utimensat syscall unless the futimesat
- syscall is known to be available. */
-
-#include <kernel-features.h>
-
-#ifdef __ASSUME_FUTIMESAT
-# include <sysdeps/unix/sysv/linux/futimesat.c>
-#else
-# include <sysdeps/unix/sysv/linux/generic/futimesat.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/microblaze/getsysstats.c b/sysdeps/unix/sysv/linux/microblaze/getsysstats.c
index a5fff9f31e..82c0353761 100644
--- a/sysdeps/unix/sysv/linux/microblaze/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/microblaze/getsysstats.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h
new file mode 100644
index 0000000000..9c435f7967
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 216
+#define SIGJMP_BUF_SIZE 216
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 84
+#define SAVED_MASK_OFFSET 88
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
index d1950ef348..e8e2ac6a87 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,55 +24,49 @@
#define __ASSUME_BIND_SYSCALL 1
#define __ASSUME_CONNECT_SYSCALL 1
#define __ASSUME_LISTEN_SYSCALL 1
-#define __ASSUME_ACCEPT_SYSCALL 1
#define __ASSUME_GETSOCKNAME_SYSCALL 1
#define __ASSUME_GETPEERNAME_SYSCALL 1
#define __ASSUME_SOCKETPAIR_SYSCALL 1
#define __ASSUME_SEND_SYSCALL 1
-#define __ASSUME_SENDTO_SYSCALL 1
#define __ASSUME_RECV_SYSCALL 1
-#define __ASSUME_RECVFROM_SYSCALL 1
#define __ASSUME_SHUTDOWN_SYSCALL 1
#define __ASSUME_GETSOCKOPT_SYSCALL 1
#define __ASSUME_SETSOCKOPT_SYSCALL 1
-#define __ASSUME_SENDMSG_SYSCALL 1
-#define __ASSUME_RECVMSG_SYSCALL 1
-/* Support for the accept4 and recvmmsg syscalls was added in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_ACCEPT4_SYSCALL 1
-# define __ASSUME_RECVMMSG_SYSCALL 1
+#include_next <kernel-features.h>
+
+/* Support for the pselect6, preadv and pwritev syscalls was added in
+ 3.15. */
+#if __LINUX_KERNEL_VERSION < 0x030f00
+# undef __ASSUME_PSELECT
+# undef __ASSUME_PREADV
+# undef __ASSUME_PWRITEV
#endif
-#define __ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL 1
/* Support for the sendmmsg syscall was added in 3.3. */
-#if __LINUX_KERNEL_VERSION >= 0x030300
-# define __ASSUME_SENDMMSG_SYSCALL 1
+#if __LINUX_KERNEL_VERSION < 0x030300
+# undef __ASSUME_SENDMMSG_SYSCALL
#endif
-/* Support for the futimesat syscall was added in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_FUTIMESAT 1
+/* Support for the renameat2 syscall was added in 3.17. */
+#if __LINUX_KERNEL_VERSION < 0x031100
+# undef __ASSUME_RENAMEAT2
#endif
-#include_next <kernel-features.h>
-
-/* Support for futex_atomic_cmpxchg_inatomic was added in 2.6.33. */
-#if __LINUX_KERNEL_VERSION < 0x020621
-# undef __ASSUME_FUTEX_LOCK_PI
-# undef __ASSUME_REQUEUE_PI
-# undef __ASSUME_SET_ROBUST_LIST
+/* Support for the execveat syscall was added in 4.0. */
+#if __LINUX_KERNEL_VERSION < 0x040000
+# undef __ASSUME_EXECVEAT
#endif
-/* The prlimit64 syscall was added for MicroBlaze in 2.6.37. */
-#if __LINUX_KERNEL_VERSION < 0x020625
-# undef __ASSUME_PRLIMIT64
+/* Support for the copy_file_range syscall was added in 4.10. */
+#if __LINUX_KERNEL_VERSION < 0x040A00
+# undef __ASSUME_COPY_FILE_RANGE
#endif
-/* Support for the pselect6, preadv and pwritev syscalls was added in
- 3.15. */
-#if __LINUX_KERNEL_VERSION < 0x030f00
-# undef __ASSUME_PSELECT
-# undef __ASSUME_PREADV
-# undef __ASSUME_PWRITEV
+/* Support for statx was added in kernel 4.12. */
+#if __LINUX_KERNEL_VERSION < 0X040C00
+# undef __ASSUME_STATX
#endif
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS3
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
index edcc15d7fa..93355ad8a3 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
@@ -1,5 +1,5 @@
/* Definition of `struct stat' used in the kernel
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -47,3 +47,6 @@ struct kernel_stat
#define _HAVE_STAT___UNUSED5
#define _HAVE_STAT64___UNUSED5
};
+
+#define XSTAT_IS_XSTAT64 0
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/microblaze/ld.abilist b/sysdeps/unix/sysv/linux/microblaze/ld.abilist
index f486acb399..aa0d71150a 100644
--- a/sysdeps/unix/sysv/linux/microblaze/ld.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 __libc_memalign F
GLIBC_2.18 __libc_stack_end D 0x4
GLIBC_2.18 __stack_chk_guard D 0x4
GLIBC_2.18 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/microblaze/libBrokenLocale.abilist
index 76d989d468..bc5edf6352 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libanl.abilist b/sysdeps/unix/sysv/linux/microblaze/libanl.abilist
index cb616b1c3e..67c7554803 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 gai_cancel F
GLIBC_2.18 gai_error F
GLIBC_2.18 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/libc.abilist
index 0a08bba592..daed511f00 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libc.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 _Exit F
GLIBC_2.18 _IO_2_1_stderr_ D 0x98
GLIBC_2.18 _IO_2_1_stdin_ D 0x98
@@ -2079,11 +2078,55 @@ GLIBC_2.18 xdrstdio_create F
GLIBC_2.18 xencrypt F
GLIBC_2.18 xprt_register F
GLIBC_2.18 xprt_unregister F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libcrypt.abilist b/sysdeps/unix/sysv/linux/microblaze/libcrypt.abilist
index 75fa78890a..4b37b33ee5 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 crypt F
GLIBC_2.18 crypt_r F
GLIBC_2.18 encrypt F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libdl.abilist b/sysdeps/unix/sysv/linux/microblaze/libdl.abilist
index 7cad5061b0..46b5716dbe 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libdl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 dladdr F
GLIBC_2.18 dladdr1 F
GLIBC_2.18 dlclose F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libm.abilist b/sysdeps/unix/sysv/linux/microblaze/libm.abilist
index 149fd4f2be..4a2c2e669e 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libm.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 _LIB_VERSION D 0x4
GLIBC_2.18 __acos_finite F
GLIBC_2.18 __acosf_finite F
@@ -367,8 +366,402 @@ GLIBC_2.18 y1l F
GLIBC_2.18 yn F
GLIBC_2.18 ynf F
GLIBC_2.18 ynl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libnsl.abilist b/sysdeps/unix/sysv/linux/microblaze/libnsl.abilist
index 959b74b90e..48a9e04eb8 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __free_fdresult F
GLIBC_2.18 __nis_default_access F
GLIBC_2.18 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/libpthread.abilist
index 00d948b60a..5067375d23 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 _IO_flockfile F
GLIBC_2.18 _IO_ftrylockfile F
GLIBC_2.18 _IO_funlockfile F
@@ -223,3 +222,24 @@ GLIBC_2.18 vfork F
GLIBC_2.18 wait F
GLIBC_2.18 waitpid F
GLIBC_2.18 write F
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libresolv.abilist b/sysdeps/unix/sysv/linux/microblaze/libresolv.abilist
index 765bc12438..b04f0397c8 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __b64_ntop F
GLIBC_2.18 __b64_pton F
GLIBC_2.18 __dn_comp F
diff --git a/sysdeps/unix/sysv/linux/microblaze/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/librt.abilist
index 9f6ecb0770..fb85d8729e 100644
--- a/sysdeps/unix/sysv/linux/microblaze/librt.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __mq_open_2 F
GLIBC_2.18 aio_cancel F
GLIBC_2.18 aio_cancel64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libthread_db.abilist b/sysdeps/unix/sysv/linux/microblaze/libthread_db.abilist
index 6387ad13a8..511767701c 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 td_init F
GLIBC_2.18 td_log F
GLIBC_2.18 td_symbol_list F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libutil.abilist b/sysdeps/unix/sysv/linux/microblaze/libutil.abilist
index af2c3048cc..0da0a40c22 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 forkpty F
GLIBC_2.18 login F
GLIBC_2.18 login_tty F
diff --git a/sysdeps/unix/sysv/linux/microblaze/localplt.data b/sysdeps/unix/sysv/linux/microblaze/localplt.data
index 176d61818e..8ca23897df 100644
--- a/sysdeps/unix/sysv/linux/microblaze/localplt.data
+++ b/sysdeps/unix/sysv/linux/microblaze/localplt.data
@@ -5,13 +5,16 @@ libc.so: malloc
libc.so: memalign
libc.so: realloc
libm.so: matherr
-libpthread.so: __errno_location
-# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
-# internally to allocate aligned TLS storage. The other malloc family of
-# functions are expected to allow user symbol interposition.
-ld.so: __tls_get_addr
-ld.so: __libc_memalign
+# The dynamic loader needs __tls_get_addr for TLS.
+ld.so: __tls_get_addr ?
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/microblaze/mmap.S b/sysdeps/unix/sysv/linux/microblaze/mmap.S
deleted file mode 100644
index 057217acff..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/mmap.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (C) 2009-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
- .text
-ENTRY (__mmap)
- addik r3,r0,-EINVAL
- andi r4,r10,0xfff
- bnei r4,L(skip)
- addik r12,r0,SYS_ify(mmap2)
- sra r10,r10
- sra r10,r10
- sra r10,r10
- sra r10,r10
- sra r10,r10
- sra r10,r10
- sra r10,r10
- sra r10,r10
- sra r10,r10
- sra r10,r10
- sra r10,r10
- sra r10,r10 ; /* mmap2 takes the offset in pages. */
- brki r14,8
- nop
-L(skip):
- addik r4,r0,-4095
- cmpu r4,r4,r3
- bgei r4,SYSCALL_ERROR_LABEL
- rtsd r15,8
- nop
-PSEUDO_END (__mmap)
-
-weak_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/microblaze/msgctl.c b/sysdeps/unix/sysv/linux/microblaze/msgctl.c
deleted file mode 100644
index d65a5b93d6..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/msgctl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/arm/msgctl.c>
diff --git a/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S b/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S
index 65cc3823ac..74bc1cdf74 100644
--- a/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S
+++ b/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S
@@ -1 +1,49 @@
-#include <sysdeps/unix/sysv/linux/alpha/pt-vfork.S>
+/* vfork ABI-compatibility entry points for libpthread.
+ Copyright (C) 2014-2018 Free Software 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>
+#include <shlib-compat.h>
+
+/* libpthread used to have its own vfork implementation that differed
+ from libc's only in having a pointless micro-optimization. There
+ is no longer any use to having a separate copy in libpthread, but
+ the historical ABI requires it. For static linking, there is no
+ need to provide anything here--the libc version will be linked in.
+ For shared library ABI compatibility, there must be __vfork and
+ vfork symbols in libpthread.so.
+
+ As of GCC 7, microblaze can *not* rely on the compiler to generate
+ a tail call from this vfork to __libc_vfork. */
+
+#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \
+ || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20))
+
+ENTRY (vfork_compat)
+ bri __libc_vfork@PLT
+END (vfork_compat)
+
+#endif
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20)
+compat_symbol (libpthread, vfork_compat, vfork, GLIBC_2_0)
+#endif
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)
+strong_alias (vfork_compat, vfork_compat2)
+compat_symbol (libpthread, vfork_compat2, __vfork, GLIBC_2_1_2)
+#endif
diff --git a/sysdeps/unix/sysv/linux/microblaze/semctl.c b/sysdeps/unix/sysv/linux/microblaze/semctl.c
deleted file mode 100644
index 4cb834ad97..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/semctl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/arm/semctl.c>
diff --git a/sysdeps/unix/sysv/linux/microblaze/setgroups.c b/sysdeps/unix/sysv/linux/microblaze/setgroups.c
deleted file mode 100644
index cb9a7708e3..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/setgroups.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setgroups.c>
diff --git a/sysdeps/unix/sysv/linux/microblaze/shmctl.c b/sysdeps/unix/sysv/linux/microblaze/shmctl.c
deleted file mode 100644
index f73ed6f246..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/shmctl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/arm/shmctl.c>
diff --git a/sysdeps/unix/sysv/linux/microblaze/sigcontextinfo.h b/sysdeps/unix/sysv/linux/microblaze/sigcontextinfo.h
index 8e2775219c..c99d0d7300 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/microblaze/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,10 +16,5 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define SIGCONTEXT int _code, struct ucontext *
-#define SIGCONTEXT_EXTRA_ARGS _code,
+#define SIGCONTEXT int _code, ucontext_t *
#define GET_PC(ctx) ((void *) (ctx)->uc_mcontext.regs.pc)
-#define GET_FRAME(ctx) ((void *) (ctx)->uc_mcontext.regs.sp)
-#define GET_STACK(ctx) ((void *) (ctx)->uc_mcontext.regs.sp)
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/microblaze/sys/procfs.h b/sysdeps/unix/sysv/linux/microblaze/sys/procfs.h
index 7541301c19..17c52519e7 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/microblaze/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h b/sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h
new file mode 100644
index 0000000000..1f6312c81d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h
@@ -0,0 +1,92 @@
+/* Data structures for user-level context switching. MicroBlaze version.
+ Copyright (C) 1997-2018 Free Software 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 _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#include <features.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
+typedef struct
+ {
+ struct
+ {
+ unsigned long int __ctx(r0);
+ unsigned long int __ctx(r1);
+ unsigned long int __ctx(r2);
+ unsigned long int __ctx(r3);
+ unsigned long int __ctx(r4);
+ unsigned long int __ctx(r5);
+ unsigned long int __ctx(r6);
+ unsigned long int __ctx(r7);
+ unsigned long int __ctx(r8);
+ unsigned long int __ctx(r9);
+ unsigned long int __ctx(r10);
+ unsigned long int __ctx(r11);
+ unsigned long int __ctx(r12);
+ unsigned long int __ctx(r13);
+ unsigned long int __ctx(r14);
+ unsigned long int __ctx(r15);
+ unsigned long int __ctx(r16);
+ unsigned long int __ctx(r17);
+ unsigned long int __ctx(r18);
+ unsigned long int __ctx(r19);
+ unsigned long int __ctx(r20);
+ unsigned long int __ctx(r21);
+ unsigned long int __ctx(r22);
+ unsigned long int __ctx(r23);
+ unsigned long int __ctx(r24);
+ unsigned long int __ctx(r25);
+ unsigned long int __ctx(r26);
+ unsigned long int __ctx(r27);
+ unsigned long int __ctx(r28);
+ unsigned long int __ctx(r29);
+ unsigned long int __ctx(r30);
+ unsigned long int __ctx(r31);
+ unsigned long int __ctx(pc);
+ unsigned long int __ctx(msr);
+ unsigned long int __ctx(ear);
+ unsigned long int __ctx(esr);
+ unsigned long int __ctx(fsr);
+ int __ctx(pt_mode);
+ } __ctx(regs);
+ unsigned long int __ctx(oldmask);
+ } mcontext_t;
+
+/* Userlevel context. */
+typedef struct ucontext_t
+ {
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ sigset_t uc_sigmask;
+ } ucontext_t;
+
+#undef __ctx
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/microblaze/sys/user.h b/sysdeps/unix/sysv/linux/microblaze/sys/user.h
index 7b23e12419..fa09c5dbf2 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sys/user.h
+++ b/sysdeps/unix/sysv/linux/microblaze/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/microblaze/syscall.S b/sysdeps/unix/sysv/linux/microblaze/syscall.S
index 527e43b08b..ece52e766c 100644
--- a/sysdeps/unix/sysv/linux/microblaze/syscall.S
+++ b/sysdeps/unix/sysv/linux/microblaze/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/microblaze/syscalls.list b/sysdeps/unix/sysv/linux/microblaze/syscalls.list
index da0fd4ec98..932c9cccc8 100644
--- a/sysdeps/unix/sysv/linux/microblaze/syscalls.list
+++ b/sysdeps/unix/sysv/linux/microblaze/syscalls.list
@@ -5,15 +5,3 @@ cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush
prlimit64 EXTRA prlimit64 i:iipp prlimit64
fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
personality EXTRA personality Ei:i __personality personality
-
-# Semaphore and shm system calls. msgctl, shmctl, and semctl have C
-# wrappers (to set __IPC_64).
-msgget - msgget i:ii __msgget msgget
-msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
-msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
-shmat - shmat i:ipi __shmat shmat
-shmdt - shmdt i:s __shmdt shmdt
-shmget - shmget i:iii __shmget shmget
-semop - semop i:ipi __semop semop
-semtimedop - semtimedop i:ipip semtimedop
-semget - semget i:iii __semget semget
diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h b/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
deleted file mode 100644
index 2fc5c49f2a..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* Copyright (C) 2014-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>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# if !IS_IN (librt) || !defined(PIC)
-# define AC_STACK_SIZE 16 /* space for r15, async_cancel arg and 2 temp words */
-# define AC_SET_GOT /* empty */
-# define AC_RESTORE_GOT /* empty */
-# else
-# define AC_STACK_SIZE 20 /* extra 4 bytes for r20 */
-# define AC_SET_GOT \
- swi r20, r1, AC_STACK_SIZE-4; \
- mfs r20, rpc; \
- addik r20, r20, _GLOBAL_OFFSET_TABLE_+8;
-# define AC_RESTORE_GOT \
- lwi r20, r1, AC_STACK_SIZE-4;
-# endif
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY (name) \
- SINGLE_THREAD_P(r12); \
- bnei r12, L(pseudo_cancel); \
- .globl __##syscall_name##_nocancel; \
- .type __##syscall_name##_nocancel,@function; \
-__##syscall_name##_nocancel: \
- DO_CALL (syscall_name, args); \
- addik r4, r0, -4095; \
- cmpu r4, r4, r3; \
- bgei r4, SYSCALL_ERROR_LABEL; \
- rtsd r15, 8; \
- nop; \
- .size __##syscall_name##_nocancel, .-__##syscall_name##_nocancel; \
-L(pseudo_cancel): \
- addik r1, r1, -AC_STACK_SIZE; \
- swi r15, r1, 0; \
- AC_SET_GOT \
- DOCARGS_##args \
- CENABLE; \
- swi r3, r1, 8; \
- UNDOCARGS_##args \
- DO_CALL (syscall_name, args); \
- swi r3, r1, 12; \
- lwi r5, r1, 8; \
- CDISABLE; \
- lwi r3, r1, 12; \
- lwi r15, r1, 0; \
- AC_RESTORE_GOT \
- addik r1, r1, AC_STACK_SIZE; \
- addik r4, r0, -4095; \
- cmpu r4, r4, r3; \
- bgei r4, SYSCALL_ERROR_LABEL; \
- rtsd r15, 8; \
- nop;
-
-/*
- * Macros to save/restore syscall arguments across CENABLE
- * The arguments are saved into the caller's stack (original r1 + 4)
- */
-
-# define DOCARGS_0
-# define DOCARGS_1 swi r5, r1, AC_STACK_SIZE + 4;
-# define DOCARGS_2 swi r6, r1, AC_STACK_SIZE + 8; DOCARGS_1
-# define DOCARGS_3 swi r7, r1, AC_STACK_SIZE + 12; DOCARGS_2
-# define DOCARGS_4 swi r8, r1, AC_STACK_SIZE + 16; DOCARGS_3
-# define DOCARGS_5 swi r9, r1, AC_STACK_SIZE + 20; DOCARGS_4
-# define DOCARGS_6 swi r10, r1, AC_STACK_SIZE + 24; DOCARGS_5
-
-# define UNDOCARGS_0
-# define UNDOCARGS_1 lwi r5, r1, AC_STACK_SIZE + 4;
-# define UNDOCARGS_2 UNDOCARGS_1 lwi r6, r1, AC_STACK_SIZE + 8;
-# define UNDOCARGS_3 UNDOCARGS_2 lwi r7, r1, AC_STACK_SIZE + 12;
-# define UNDOCARGS_4 UNDOCARGS_3 lwi r8, r1, AC_STACK_SIZE + 16;
-# define UNDOCARGS_5 UNDOCARGS_4 lwi r9, r1, AC_STACK_SIZE + 20;
-# define UNDOCARGS_6 UNDOCARGS_5 lwi r10, r1, AC_STACK_SIZE + 24;
-
-# ifdef PIC
-# define PSEUDO_JMP(sym) brlid r15, sym##@PLTPC; addk r0, r0, r0
-# else
-# define PSEUDO_JMP(sym) brlid r15, sym; addk r0, r0, r0
-# endif
-
-# if IS_IN (libpthread)
-# define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__pthread_disable_asynccancel)
-# define __local_multiple_threads __pthread_multiple_threads
-# elif IS_IN (libc)
-# define CENABLE PSEUDO_JMP (__libc_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__libc_disable_asynccancel)
-# define __local_multiple_threads __libc_multiple_threads
-# elif IS_IN (librt)
-# define CENABLE PSEUDO_JMP (__librt_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__librt_disable_asynccancel)
-# else
-# error Unsupported library
-# endif
-
-
-# if IS_IN (libpthread) || IS_IN (libc)
-# ifndef __ASSEMBLER__
-extern int __local_multiple_threads attribute_hidden;
-# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
-# else
-# if !defined PIC
-# define SINGLE_THREAD_P(reg) lwi reg, r0, __local_multiple_threads;
-# else
-# define SINGLE_THREAD_P(reg) \
- mfs reg, rpc; \
- addik reg, reg, _GLOBAL_OFFSET_TABLE_+8; \
- lwi reg, reg, __local_multiple_threads@GOT; \
- lwi reg, reg, 0;
-# endif
-# endif
-# else
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P(reg) \
- lwi reg, r0, MULTIPLE_THREADS_OFFSET(reg)
-# endif
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION (1)
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.S b/sysdeps/unix/sysv/linux/microblaze/sysdep.S
index 51c26e44b5..3f8591c0e4 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sysdep.S
+++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/sysdeps/unix/sysv/linux/microblaze/sysdep.h
index abc13c25ca..7b05047ad4 100644
--- a/sysdeps/unix/sysv/linux/microblaze/sysdep.h
+++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -209,70 +209,70 @@ SYSCALL_ERROR_LABEL_DCL: \
# define inline_syscall0(name,dummy) \
({ \
- register long ret __asm__("r3"); \
+ register long __ret __asm__("r3"); \
register long __r12 __asm__("r12") = name; \
__asm__ __volatile__( "brki r14,8; nop;" \
- : "=r"(ret) \
+ : "=r"(__ret) \
: "r"(__r12) \
- : SYSCALL_CLOBBERS_0 ); ret; \
+ : SYSCALL_CLOBBERS_0 ); __ret; \
})
# define inline_syscall1(name,arg1) \
({ \
- register long ret __asm__("r3"); \
+ register long __ret __asm__("r3"); \
register long __r12 __asm__("r12") = name; \
register long __r5 __asm__("r5") = (long)(arg1); \
__asm__ __volatile__( "brki r14,8; nop;" \
- : "=r"(ret) \
+ : "=r"(__ret) \
: "r"(__r5), "r"(__r12) \
- : SYSCALL_CLOBBERS_1 ); ret; \
+ : SYSCALL_CLOBBERS_1 ); __ret; \
})
# define inline_syscall2(name,arg1,arg2) \
({ \
- register long ret __asm__("r3"); \
+ register long __ret __asm__("r3"); \
register long __r12 __asm__("r12") = name; \
register long __r5 __asm__("r5") = (long)(arg1); \
register long __r6 __asm__("r6") = (long)(arg2); \
__asm__ __volatile__( "brki r14,8; nop;" \
- : "=r"(ret) \
+ : "=r"(__ret) \
: "r"(__r5), "r"(__r6), "r"(__r12) \
- : SYSCALL_CLOBBERS_2 ); ret; \
+ : SYSCALL_CLOBBERS_2 ); __ret; \
})
# define inline_syscall3(name,arg1,arg2,arg3) \
({ \
- register long ret __asm__("r3"); \
+ register long __ret __asm__("r3"); \
register long __r12 __asm__("r12") = name; \
register long __r5 __asm__("r5") = (long)(arg1); \
register long __r6 __asm__("r6") = (long)(arg2); \
register long __r7 __asm__("r7") = (long)(arg3); \
__asm__ __volatile__( "brki r14,8; nop;" \
- : "=r"(ret) \
+ : "=r"(__ret) \
: "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r12) \
- : SYSCALL_CLOBBERS_3 ); ret; \
+ : SYSCALL_CLOBBERS_3 ); __ret; \
})
# define inline_syscall4(name,arg1,arg2,arg3,arg4) \
({ \
- register long ret __asm__("r3"); \
+ register long __ret __asm__("r3"); \
register long __r12 __asm__("r12") = name; \
register long __r5 __asm__("r5") = (long)(arg1); \
register long __r6 __asm__("r6") = (long)(arg2); \
register long __r7 __asm__("r7") = (long)(arg3); \
register long __r8 __asm__("r8") = (long)(arg4); \
__asm__ __volatile__( "brki r14,8; nop;" \
- : "=r"(ret) \
+ : "=r"(__ret) \
: "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r12) \
- : SYSCALL_CLOBBERS_4 ); ret; \
+ : SYSCALL_CLOBBERS_4 ); __ret; \
})
# define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \
({ \
- register long ret __asm__("r3"); \
+ register long __ret __asm__("r3"); \
register long __r12 __asm__("r12") = name; \
register long __r5 __asm__("r5") = (long)(arg1); \
register long __r6 __asm__("r6") = (long)(arg2); \
@@ -280,15 +280,15 @@ SYSCALL_ERROR_LABEL_DCL: \
register long __r8 __asm__("r8") = (long)(arg4); \
register long __r9 __asm__("r9") = (long)(arg5); \
__asm__ __volatile__( "brki r14,8; nop;" \
- : "=r"(ret) \
+ : "=r"(__ret) \
: "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r9), "r"(__r12) \
- : SYSCALL_CLOBBERS_5 ); ret; \
+ : SYSCALL_CLOBBERS_5 ); __ret; \
})
# define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \
({ \
- register long ret __asm__("r3"); \
+ register long __ret __asm__("r3"); \
register long __r12 __asm__("r12") = name; \
register long __r5 __asm__("r5") = (long)(arg1); \
register long __r6 __asm__("r6") = (long)(arg2); \
@@ -297,10 +297,10 @@ SYSCALL_ERROR_LABEL_DCL: \
register long __r9 __asm__("r9") = (long)(arg5); \
register long __r10 __asm__("r10") = (long)(arg6); \
__asm__ __volatile__( "brki r14,8; nop;" \
- : "=r"(ret) \
+ : "=r"(__ret) \
: "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r9), "r"(__r10), \
"r"(__r12) \
- : SYSCALL_CLOBBERS_6 ); ret; \
+ : SYSCALL_CLOBBERS_6 ); __ret; \
})
@@ -308,6 +308,8 @@ SYSCALL_ERROR_LABEL_DCL: \
# define PTR_MANGLE(var) (void) (var)
# define PTR_DEMANGLE(var) (void) (var)
+# define SINGLE_THREAD_BY_GLOBAL 1
+
#endif /* not __ASSEMBLER__ */
#endif /* _LINUX_MICROBLAZE_SYSDEP_H */
diff --git a/sysdeps/unix/sysv/linux/microblaze/vfork.S b/sysdeps/unix/sysv/linux/microblaze/vfork.S
index 9592cb4f28..01b0037b23 100644
--- a/sysdeps/unix/sysv/linux/microblaze/vfork.S
+++ b/sysdeps/unix/sysv/linux/microblaze/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -43,3 +43,4 @@ PSEUDO_END (__vfork)
libc_hidden_def (__vfork)
weak_alias (__vfork, vfork)
+strong_alias (__vfork, __libc_vfork)
diff --git a/sysdeps/unix/sysv/linux/mips/Makefile b/sysdeps/unix/sysv/linux/mips/Makefile
index 8127025503..8217f42e75 100644
--- a/sysdeps/unix/sysv/linux/mips/Makefile
+++ b/sysdeps/unix/sysv/linux/mips/Makefile
@@ -19,75 +19,39 @@ endif
abi-includes := sgidefs.h
# _MIPS_SIM_ABI32 == 1, _MIPS_SIM_NABI32 == 2, _MIPS_SIM_ABI64 == 3
-abi-o32_soft-options := -U_MIPS_SIM -D_MIPS_SIM=1 \
- -D__mips_soft_float -U__mips_hard_float \
- -U__mips_nan2008
abi-o32_soft-condition := !defined(__mips_nan2008) \
&& defined(__mips_soft_float) \
&& (_MIPS_SIM == _MIPS_SIM_ABI32)
-abi-o32_hard-options := -U_MIPS_SIM -D_MIPS_SIM=1 \
- -D__mips_hard_float -U__mips_soft_float \
- -U__mips_nan2008
abi-o32_hard-condition := !defined(__mips_nan2008) \
&& defined(__mips_hard_float) \
&& (_MIPS_SIM == _MIPS_SIM_ABI32)
-abi-o32_soft_2008-options := -U_MIPS_SIM -D_MIPS_SIM=1 \
- -D__mips_soft_float -U__mips_hard_float \
- -D__mips_nan2008
abi-o32_soft_2008-condition := defined(__mips_nan2008) \
&& defined(__mips_soft_float) \
&& (_MIPS_SIM == _MIPS_SIM_ABI32)
-abi-o32_hard_2008-options := -U_MIPS_SIM -D_MIPS_SIM=1 \
- -D__mips_hard_float -U__mips_soft_float \
- -D__mips_nan2008
abi-o32_hard_2008-condition := defined(__mips_nan2008) \
&& defined(__mips_hard_float) \
&& (_MIPS_SIM == _MIPS_SIM_ABI32)
-abi-n32_soft-options := -U_MIPS_SIM -D_MIPS_SIM=2 \
- -D__mips_soft_float -U__mips_hard_float \
- -U__mips_nan2008
abi-n32_soft-condition := !defined(__mips_nan2008) \
&& defined(__mips_soft_float) \
&& (_MIPS_SIM == _MIPS_SIM_NABI32)
-abi-n32_hard-options := -U_MIPS_SIM -D_MIPS_SIM=2 \
- -D__mips_hard_float -U__mips_soft_float \
- -U__mips_nan2008
abi-n32_hard-condition := !defined(__mips_nan2008) \
&& defined(__mips_hard_float) \
&& (_MIPS_SIM == _MIPS_SIM_NABI32)
-abi-n32_soft_2008-options := -U_MIPS_SIM -D_MIPS_SIM=2 \
- -D__mips_soft_float -U__mips_hard_float \
- -D__mips_nan2008
abi-n32_soft_2008-condition := defined(__mips_nan2008) \
&& defined(__mips_soft_float) \
&& (_MIPS_SIM == _MIPS_SIM_NABI32)
-abi-n32_hard_2008-options := -U_MIPS_SIM -D_MIPS_SIM=2 \
- -D__mips_hard_float -U__mips_soft_float \
- -D__mips_nan2008
abi-n32_hard_2008-condition := defined(__mips_nan2008) \
&& defined(__mips_hard_float) \
&& (_MIPS_SIM == _MIPS_SIM_NABI32)
-abi-n64_soft-options := -U_MIPS_SIM -D_MIPS_SIM=3 \
- -D__mips_soft_float -U__mips_hard_float \
- -U__mips_nan2008
abi-n64_soft-condition := !defined(__mips_nan2008) \
&& defined(__mips_soft_float) \
&& (_MIPS_SIM == _MIPS_SIM_ABI64)
-abi-n64_hard-options := -U_MIPS_SIM -D_MIPS_SIM=3 \
- -D__mips_hard_float -U__mips_soft_float \
- -U__mips_nan2008
abi-n64_hard-condition := !defined(__mips_nan2008) \
&& defined(__mips_hard_float) \
&& (_MIPS_SIM == _MIPS_SIM_ABI64)
-abi-n64_soft_2008-options := -U_MIPS_SIM -D_MIPS_SIM=3 \
- -D__mips_soft_float -U__mips_hard_float \
- -D__mips_nan2008
abi-n64_soft_2008-condition := defined(__mips_nan2008) \
&& defined(__mips_soft_float) \
&& (_MIPS_SIM == _MIPS_SIM_ABI64)
-abi-n64_hard_2008-options := -U_MIPS_SIM -D_MIPS_SIM=3 \
- -D__mips_hard_float -U__mips_soft_float \
- -D__mips_nan2008
abi-n64_hard_2008-condition := defined(__mips_nan2008) \
&& defined(__mips_hard_float) \
&& (_MIPS_SIM == _MIPS_SIM_ABI64)
@@ -96,7 +60,15 @@ ifeq ($(subdir),elf)
ifeq ($(build-shared),yes)
# This is needed for DSO loading from static binaries.
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/Versions b/sysdeps/unix/sysv/linux/mips/Versions
index a56322a8eb..453f276aad 100644
--- a/sysdeps/unix/sysv/linux/mips/Versions
+++ b/sysdeps/unix/sysv/linux/mips/Versions
@@ -37,4 +37,8 @@ libc {
GLIBC_2.11 {
fallocate64;
}
+ GLIBC_PRIVATE {
+ # nptl/pthread_cond_timedwait.c uses INTERNAL_VSYSCALL(clock_gettime).
+ __vdso_clock_gettime;
+ }
}
diff --git a/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c b/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c
index 5fd871cbe5..50e2a1e616 100644
--- a/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/_test_and_set.c b/sysdeps/unix/sysv/linux/mips/_test_and_set.c
index c3c1408fb6..8aefc27dbf 100644
--- a/sysdeps/unix/sysv/linux/mips/_test_and_set.c
+++ b/sysdeps/unix/sysv/linux/mips/_test_and_set.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000.
diff --git a/sysdeps/unix/sysv/linux/mips/arch-fork.h b/sysdeps/unix/sysv/linux/mips/arch-fork.h
deleted file mode 100644
index 5f945378ee..0000000000
--- a/sysdeps/unix/sysv/linux/mips/arch-fork.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/arch-fork.h>
diff --git a/sysdeps/unix/sysv/linux/mips/bits/epoll.h b/sysdeps/unix/sysv/linux/mips/bits/epoll.h
index 9e8c220eec..d4aea329ac 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/errno.h b/sysdeps/unix/sysv/linux/mips/bits/errno.h
index bab50aa62b..85aca35dbe 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/errno.h
@@ -1,5 +1,5 @@
/* Error constants. MIPS/Linux specific version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,23 +16,28 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _ERRNO_H
+#ifndef _BITS_ERRNO_H
+
+#if !defined _ERRNO_H
+# error "Never include <bits/errno.h> directly; use <errno.h> instead."
+#endif
-# undef EDOM
-# undef EILSEQ
-# undef ERANGE
# include <linux/errno.h>
-/* Linux has no ENOTSUP error code. */
-# define ENOTSUP EOPNOTSUPP
+/* Older Linux headers do not define these constants. */
+# ifndef ENOTSUP
+# define ENOTSUP EOPNOTSUPP
+# endif
# ifndef ECANCELED
-# define ECANCELED 158
+# define ECANCELED 158
# endif
-/* Support for error codes to support robust mutexes was added later, too. */
# ifndef EOWNERDEAD
# define EOWNERDEAD 165
+# endif
+
+# ifndef ENOTRECOVERABLE
# define ENOTRECOVERABLE 166
# endif
@@ -44,22 +49,4 @@
# define EHWPOISON 168
# endif
-# ifndef __ASSEMBLER__
-/* Function to get address of global `errno' variable. */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
-
-# if !defined _LIBC || defined _LIBC_REENTRANT
-/* When using threads, errno is a per-thread value. */
-# define errno (*__errno_location ())
-# endif
-# endif /* !__ASSEMBLER__ */
-#endif /* _ERRNO_H */
-
-#if !defined _ERRNO_H && defined __need_Emath
-/* This is ugly but the kernel header is not clean enough. We must
- define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
- defined. */
-# define EDOM 33 /* Math argument out of domain of function. */
-# define EILSEQ 88 /* Illegal byte sequence. */
-# define ERANGE 34 /* Math result not representable. */
-#endif /* !_ERRNO_H && __need_Emath */
+#endif /* bits/errno.h. */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/eventfd.h b/sysdeps/unix/sysv/linux/mips/bits/eventfd.h
index 46e83f9056..bb896b1330 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/eventfd.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/eventfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
index 6092f2a520..4e37b398bd 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/inotify.h b/sysdeps/unix/sysv/linux/mips/bits/inotify.h
index 33d75f947b..0ba5a2a321 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/inotify.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
index c50de51da6..9d73b1a1fe 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
@@ -1,5 +1,5 @@
/* Structure types for pre-termios terminal ioctls. Linux/MIPS version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/ipc.h b/sysdeps/unix/sysv/linux/mips/bits/ipc.h
index e688410191..d5e968711c 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/local_lim.h b/sysdeps/unix/sysv/linux/mips/bits/local_lim.h
index c647347c57..e32ad5ad70 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/local_lim.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. MIPS Linux version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/mman.h b/sysdeps/unix/sysv/linux/mips/bits/mman.h
index fcca87e614..102bc6dd03 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/MIPS version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,6 +34,8 @@
# define MAP_NONBLOCK 0x20000 /* do not block on IO */
# define MAP_STACK 0x40000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x80000 /* Create huge page mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
#define __MAP_ANONYMOUS 0x0800
diff --git a/sysdeps/unix/sysv/linux/mips/bits/msq.h b/sysdeps/unix/sysv/linux/mips/bits/msq.h
index 623d570aaa..9999aa99db 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -75,6 +75,7 @@ struct msqid_ds
/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12
+# define MSG_STAT_ANY 13
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
diff --git a/sysdeps/unix/sysv/linux/mips/bits/poll.h b/sysdeps/unix/sysv/linux/mips/bits/poll.h
index cb067057b5..6652a21da7 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/poll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h
index 4ce5ff6dd0..89d878820b 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/resource.h
@@ -1,5 +1,5 @@
/* Bit values & structures for resource limits. Linux/MIPS version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -183,51 +183,8 @@ enum __rusage_who
#endif
};
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
-
-/* Structure which says how much of each resource has been used. */
-struct rusage
- {
- /* Total amount of user time used. */
- struct timeval ru_utime;
- /* Total amount of system time used. */
- struct timeval ru_stime;
- /* Maximum resident set size (in kilobytes). */
- long int ru_maxrss;
- /* Amount of sharing of text segment memory
- with other processes (kilobyte-seconds). */
- long int ru_ixrss;
- /* Amount of data segment memory used (kilobyte-seconds). */
- long int ru_idrss;
- /* Amount of stack memory used (kilobyte-seconds). */
- long int ru_isrss;
- /* Number of soft page faults (i.e. those serviced by reclaiming
- a page from the list of pages awaiting reallocation. */
- long int ru_minflt;
- /* Number of hard page faults (i.e. those that required I/O). */
- long int ru_majflt;
- /* Number of times a process was swapped out of physical memory. */
- long int ru_nswap;
- /* Number of input operations via the file system. Note: This
- and `ru_oublock' do not include operations with the cache. */
- long int ru_inblock;
- /* Number of output operations via the file system. */
- long int ru_oublock;
- /* Number of IPC messages sent. */
- long int ru_msgsnd;
- /* Number of IPC messages received. */
- long int ru_msgrcv;
- /* Number of signals delivered. */
- long int ru_nsignals;
- /* Number of voluntary context switches, i.e. because the process
- gave up the process before it had to (usually to wait for some
- resource to be available). */
- long int ru_nvcsw;
- /* Number of involuntary context switches, i.e. a higher priority process
- became runnable or the current process used up its time slice. */
- long int ru_nivcsw;
- };
+#include <bits/types/struct_timeval.h>
+#include <bits/types/struct_rusage.h>
/* Priority limits. */
#define PRIO_MIN -20 /* Minimum priority a process can have. */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/sem.h b/sysdeps/unix/sysv/linux/mips/bits/sem.h
index ce5304af99..d218cf4f92 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,6 +66,7 @@ struct semid_ds
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
+# define SEM_STAT_ANY 20
struct seminfo
{
diff --git a/sysdeps/unix/sysv/linux/mips/bits/shm.h b/sysdeps/unix/sysv/linux/mips/bits/shm.h
index fb801237f6..22068d7729 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -62,6 +62,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
index df0479a361..4fb0626483 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
@@ -1,5 +1,5 @@
/* The proper definitions for Linux/MIPS's sigaction.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software 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,6 +16,9 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGACTION_H
+#define _BITS_SIGACTION_H 1
+
#ifndef _SIGNAL_H
# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
#endif
@@ -27,7 +30,7 @@ struct sigaction
int sa_flags;
/* Signal handler. */
-#ifdef __USE_POSIX199309
+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
union
{
/* Used if SA_SIGINFO is not set. */
@@ -60,10 +63,10 @@ struct sigaction
#define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */
#define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with
three arguments instead of one. */
-#if defined __USE_UNIX98 || defined __USE_MISC
+#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
#endif
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
@@ -87,3 +90,5 @@ struct sigaction
# define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility:
set only the low 32 bit of the sigset. */
#endif
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h b/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h
index 5f79981ab2..84fccb44e9 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library.
+/* Copyright (C) 1996-2018 Free Software 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
diff --git a/sysdeps/unix/sysv/linux/mips/bits/siginfo-arch.h b/sysdeps/unix/sysv/linux/mips/bits/siginfo-arch.h
new file mode 100644
index 0000000000..cd3af7db06
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/siginfo-arch.h
@@ -0,0 +1,13 @@
+/* Architecture-specific adjustments to siginfo_t. MIPS version. */
+#ifndef _BITS_SIGINFO_ARCH_H
+#define _BITS_SIGINFO_ARCH_H 1
+
+/* MIPS has the si_code and si_errno fields in the opposite order from
+ all other architectures. */
+#define __SI_ERRNO_THEN_CODE 0
+
+/* MIPS also has different values for SI_ASYNCIO, SI_MESGQ, and SI_TIMER
+ than all other architectures. */
+#define __SI_ASYNCIO_AFTER_SIGIO 0
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/bits/siginfo.h b/sysdeps/unix/sysv/linux/mips/bits/siginfo.h
deleted file mode 100644
index 05760011fb..0000000000
--- a/sysdeps/unix/sysv/linux/mips/bits/siginfo.h
+++ /dev/null
@@ -1,344 +0,0 @@
-/* siginfo_t, sigevent and constants. Linux/MIPS version.
- 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/>. */
-
-#if !defined _SIGNAL_H && !defined __need_siginfo_t \
- && !defined __need_sigevent_t
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-#if (!defined __have_sigval_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t \
- || defined __need_sigevent_t))
-# define __have_sigval_t 1
-
-/* Type for data associated with a signal. */
-typedef union sigval
- {
- int sival_int;
- void *sival_ptr;
- } sigval_t;
-#endif
-
-#if (!defined __have_siginfo_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t))
-# define __have_siginfo_t 1
-
-# define __SI_MAX_SIZE 128
-# if __WORDSIZE == 64
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-
-typedef struct
- {
- int si_signo; /* Signal number. */
- int si_code; /* Signal code. */
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int __pad0[__SI_MAX_SIZE / sizeof (int) - __SI_PAD_SIZE - 3];
- /* Explicit padding. */
-
- union
- {
- int _pad[__SI_PAD_SIZE];
-
- /* kill(). */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- } _kill;
-
- /* POSIX.1b timers. */
- struct
- {
- int si_tid; /* Timer ID. */
- int si_overrun; /* Overrun count. */
- sigval_t si_sigval; /* Signal value. */
- } _timer;
-
- /* POSIX.1b signals. */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- sigval_t si_sigval; /* Signal value. */
- } _rt;
-
- /* SIGCHLD. */
- struct
- {
- __pid_t si_pid; /* Which child. */
- __uid_t si_uid; /* Real user ID of sending process. */
- int si_status; /* Exit value or signal. */
- __clock_t si_utime;
- __clock_t si_stime;
- } _sigchld;
-
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
- struct
- {
- void *si_addr; /* Faulting insn/memory ref. */
- short int si_addr_lsb; /* Valid LSB of the reported address. */
- } _sigfault;
-
- /* SIGPOLL. */
- struct
- {
- long int si_band; /* Band event for SIGPOLL. */
- int si_fd;
- } _sigpoll;
-
- /* SIGSYS. */
- struct
- {
- void *_call_addr; /* Calling user insn. */
- int _syscall; /* Triggering system call number. */
- unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
- } _sigsys;
- } _sifields;
- } siginfo_t;
-
-
-/* X/Open requires some more fields with fixed names. */
-# define si_pid _sifields._kill.si_pid
-# define si_uid _sifields._kill.si_uid
-# define si_timerid _sifields._timer.si_tid
-# define si_overrun _sifields._timer.si_overrun
-# define si_status _sifields._sigchld.si_status
-# define si_utime _sifields._sigchld.si_utime
-# define si_stime _sifields._sigchld.si_stime
-# define si_value _sifields._rt.si_sigval
-# define si_int _sifields._rt.si_sigval.sival_int
-# define si_ptr _sifields._rt.si_sigval.sival_ptr
-# define si_addr _sifields._sigfault.si_addr
-# define si_addr_lsb _sifields._sigfault.si_addr_lsb
-# define si_band _sifields._sigpoll.si_band
-# define si_fd _sifields._sigpoll.si_fd
-# define si_call_addr _sifields._sigsys._call_addr
-# define si_syscall _sifields._sigsys._syscall
-# define si_arch _sifields._sigsys._arch
-
-
-/* Values for `si_code'. Positive values are reserved for kernel-generated
- signals. */
-enum
-{
- SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
-# define SI_ASYNCNL SI_ASYNCNL
- SI_TKILL = -6, /* Sent by tkill. */
-# define SI_TKILL SI_TKILL
- SI_SIGIO, /* Sent by queued SIGIO. */
-# define SI_SIGIO SI_SIGIO
- SI_MESGQ, /* Sent by real time mesq state change. */
-# define SI_MESGQ SI_MESGQ
- SI_TIMER, /* Sent by real time mesq state change. */
-# define SI_TIMER SI_TIMER
- SI_ASYNCIO, /* Sent by AIO completion. */
-# define SI_ASYNCIO SI_ASYNCIO
- SI_QUEUE, /* Sent by sigqueue. */
-# define SI_QUEUE SI_QUEUE
- SI_USER, /* Sent by kill, sigsend. */
-# define SI_USER SI_USER
- SI_KERNEL = 0x80 /* Send by kernel. */
-#define SI_KERNEL SI_KERNEL
-};
-
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGILL signal. */
-enum
-{
- ILL_ILLOPC = 1, /* Illegal opcode. */
-# define ILL_ILLOPC ILL_ILLOPC
- ILL_ILLOPN, /* Illegal operand. */
-# define ILL_ILLOPN ILL_ILLOPN
- ILL_ILLADR, /* Illegal addressing mode. */
-# define ILL_ILLADR ILL_ILLADR
- ILL_ILLTRP, /* Illegal trap. */
-# define ILL_ILLTRP ILL_ILLTRP
- ILL_PRVOPC, /* Privileged opcode. */
-# define ILL_PRVOPC ILL_PRVOPC
- ILL_PRVREG, /* Privileged register. */
-# define ILL_PRVREG ILL_PRVREG
- ILL_COPROC, /* Coprocessor error. */
-# define ILL_COPROC ILL_COPROC
- ILL_BADSTK /* Internal stack error. */
-# define ILL_BADSTK ILL_BADSTK
-};
-
-/* `si_code' values for SIGFPE signal. */
-enum
-{
- FPE_INTDIV = 1, /* Integer divide by zero. */
-# define FPE_INTDIV FPE_INTDIV
- FPE_INTOVF, /* Integer overflow. */
-# define FPE_INTOVF FPE_INTOVF
- FPE_FLTDIV, /* Floating point divide by zero. */
-# define FPE_FLTDIV FPE_FLTDIV
- FPE_FLTOVF, /* Floating point overflow. */
-# define FPE_FLTOVF FPE_FLTOVF
- FPE_FLTUND, /* Floating point underflow. */
-# define FPE_FLTUND FPE_FLTUND
- FPE_FLTRES, /* Floating point inexact result. */
-# define FPE_FLTRES FPE_FLTRES
- FPE_FLTINV, /* Floating point invalid operation. */
-# define FPE_FLTINV FPE_FLTINV
- FPE_FLTSUB /* Subscript out of range. */
-# define FPE_FLTSUB FPE_FLTSUB
-};
-
-/* `si_code' values for SIGSEGV signal. */
-enum
-{
- SEGV_MAPERR = 1, /* Address not mapped to object. */
-# define SEGV_MAPERR SEGV_MAPERR
- SEGV_ACCERR /* Invalid permissions for mapped object. */
-# define SEGV_ACCERR SEGV_ACCERR
-};
-
-/* `si_code' values for SIGBUS signal. */
-enum
-{
- BUS_ADRALN = 1, /* Invalid address alignment. */
-# define BUS_ADRALN BUS_ADRALN
- BUS_ADRERR, /* Non-existant physical address. */
-# define BUS_ADRERR BUS_ADRERR
- BUS_OBJERR, /* Object specific hardware error. */
-# define BUS_OBJERR BUS_OBJERR
- BUS_MCEERR_AR, /* Hardware memory error: action required. */
-# define BUS_MCEERR_AR BUS_MCEERR_AR
- BUS_MCEERR_AO /* Hardware memory error: action optional. */
-# define BUS_MCEERR_AO BUS_MCEERR_AO
-};
-# endif
-
-# ifdef __USE_XOPEN_EXTENDED
-/* `si_code' values for SIGTRAP signal. */
-enum
-{
- TRAP_BRKPT = 1, /* Process breakpoint. */
-# define TRAP_BRKPT TRAP_BRKPT
- TRAP_TRACE /* Process trace trap. */
-# define TRAP_TRACE TRAP_TRACE
-};
-# endif
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGCHLD signal. */
-enum
-{
- CLD_EXITED = 1, /* Child has exited. */
-# define CLD_EXITED CLD_EXITED
- CLD_KILLED, /* Child was killed. */
-# define CLD_KILLED CLD_KILLED
- CLD_DUMPED, /* Child terminated abnormally. */
-# define CLD_DUMPED CLD_DUMPED
- CLD_TRAPPED, /* Traced child has trapped. */
-# define CLD_TRAPPED CLD_TRAPPED
- CLD_STOPPED, /* Child has stopped. */
-# define CLD_STOPPED CLD_STOPPED
- CLD_CONTINUED /* Stopped child has continued. */
-# define CLD_CONTINUED CLD_CONTINUED
-};
-
-/* `si_code' values for SIGPOLL signal. */
-enum
-{
- POLL_IN = 1, /* Data input available. */
-# define POLL_IN POLL_IN
- POLL_OUT, /* Output buffers available. */
-# define POLL_OUT POLL_OUT
- POLL_MSG, /* Input message available. */
-# define POLL_MSG POLL_MSG
- POLL_ERR, /* I/O error. */
-# define POLL_ERR POLL_ERR
- POLL_PRI, /* High priority input available. */
-# define POLL_PRI POLL_PRI
- POLL_HUP /* Device disconnected. */
-# define POLL_HUP POLL_HUP
-};
-# endif
-
-# undef __need_siginfo_t
-#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
-
-
-#if (defined _SIGNAL_H || defined __need_sigevent_t) \
- && !defined __have_sigevent_t
-# define __have_sigevent_t 1
-
-/* Structure to transport application-defined values with signals. */
-# define __SIGEV_MAX_SIZE 64
-# if __WORDSIZE == 64
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-/* Forward declaration. */
-# ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-# endif
-
-typedef struct sigevent
- {
- sigval_t sigev_value;
- int sigev_signo;
- int sigev_notify;
-
- union
- {
- int _pad[__SIGEV_PAD_SIZE];
-
- /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
- thread to receive the signal. */
- __pid_t _tid;
-
- struct
- {
- void (*_function) (sigval_t); /* Function to start. */
- pthread_attr_t *_attribute; /* Thread attributes. */
- } _sigev_thread;
- } _sigev_un;
- } sigevent_t;
-
-/* POSIX names to access some of the members. */
-# define sigev_notify_function _sigev_un._sigev_thread._function
-# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
-
-/* `sigev_notify' values. */
-enum
-{
- SIGEV_SIGNAL = 0, /* Notify via signal. */
-# define SIGEV_SIGNAL SIGEV_SIGNAL
- SIGEV_NONE, /* Other notification: meaningless. */
-# define SIGEV_NONE SIGEV_NONE
- SIGEV_THREAD, /* Deliver via thread creation. */
-# define SIGEV_THREAD SIGEV_THREAD
-
- SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
-#define SIGEV_THREAD_ID SIGEV_THREAD_ID
-};
-
-#endif /* have _SIGNAL_H. */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/signalfd.h b/sysdeps/unix/sysv/linux/mips/bits/signalfd.h
index 2908a19fb0..17382a84ed 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/signalfd.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/signalfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/signum.h b/sysdeps/unix/sysv/linux/mips/bits/signum.h
index c3ae4e1dc8..979300c88d 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/signum.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/signum.h
@@ -1,5 +1,5 @@
-/* Signal number definitions. Linux version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Signal number definitions. Linux/MIPS version.
+ Copyright (C) 1995-2018 Free Software 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,63 +16,53 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _SIGNAL_H
+#ifndef _BITS_SIGNUM_H
+#define _BITS_SIGNUM_H 1
-/* Fake signal functions. */
-#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
-#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
-#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
-
-#ifdef __USE_UNIX98
-# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+#ifndef _SIGNAL_H
+#error "Never include <bits/signum.h> directly; use <signal.h> instead."
#endif
+#include <bits/signum-generic.h>
-#define SIGHUP 1 /* Hangup (POSIX). */
-#define SIGINT 2 /* Interrupt (ANSI). */
-#define SIGQUIT 3 /* Quit (POSIX). */
-#define SIGILL 4 /* Illegal instruction (ANSI). */
-#define SIGTRAP 5 /* Trace trap (POSIX). */
-#define SIGIOT 6 /* IOT trap (4.2 BSD). */
-#define SIGABRT SIGIOT /* Abort (ANSI). */
-#define SIGEMT 7
-#define SIGFPE 8 /* Floating-point exception (ANSI). */
-#define SIGKILL 9 /* Kill, unblockable (POSIX). */
-#define SIGBUS 10 /* BUS error (4.2 BSD). */
-#define SIGSEGV 11 /* Segmentation violation (ANSI). */
-#define SIGSYS 12
-#define SIGPIPE 13 /* Broken pipe (POSIX). */
-#define SIGALRM 14 /* Alarm clock (POSIX). */
-#define SIGTERM 15 /* Termination (ANSI). */
-#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
-#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
-#define SIGCHLD 18 /* Child status has changed (POSIX). */
-#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
-#define SIGPWR 19 /* Power failure restart (System V). */
-#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
-#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
-#define SIGIO 22 /* I/O now possible (4.2 BSD). */
-#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
-#define SIGSTOP 23 /* Stop, unblockable (POSIX). */
-#define SIGTSTP 24 /* Keyboard stop (POSIX). */
-#define SIGCONT 25 /* Continue (POSIX). */
-#define SIGTTIN 26 /* Background read from tty (POSIX). */
-#define SIGTTOU 27 /* Background write to tty (POSIX). */
-#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
-#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
-#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
-#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
-
+/* Adjustments and additions to the signal number constants for
+ Linux/MIPS. */
-#define _NSIG 128 /* Biggest signal number + 1
- (including real-time signals). */
+#define SIGEMT 7 /* Emulator trap. */
+#define SIGPWR 19 /* Power failure imminent. */
-#define SIGRTMIN (__libc_current_sigrtmin ())
-#define SIGRTMAX (__libc_current_sigrtmax ())
+#undef SIGUSR1
+#define SIGUSR1 16
+#undef SIGUSR2
+#define SIGUSR2 17
+#undef SIGCHLD
+#define SIGCHLD 18
+#undef SIGWINCH
+#define SIGWINCH 20
+#undef SIGURG
+#define SIGURG 21
+#undef SIGPOLL
+#define SIGPOLL 22
+#undef SIGSTOP
+#define SIGSTOP 23
+#undef SIGTSTP
+#define SIGTSTP 24
+#undef SIGCONT
+#define SIGCONT 25
+#undef SIGTTIN
+#define SIGTTIN 26
+#undef SIGTTOU
+#define SIGTTOU 27
+#undef SIGVTALRM
+#define SIGVTALRM 28
+#undef SIGPROF
+#define SIGPROF 29
+#undef SIGXCPU
+#define SIGXCPU 30
+#undef SIGXFSZ
+#define SIGXFSZ 31
-/* These are the hard limits of the kernel. These values should not be
- used directly at user level. */
-#define __SIGRTMIN 32
-#define __SIGRTMAX (_NSIG - 1)
+#undef __SIGRTMAX
+#define __SIGRTMAX 127
#endif /* <signal.h> included. */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigstack.h b/sysdeps/unix/sysv/linux/mips/bits/sigstack.h
deleted file mode 100644
index 2e9665444a..0000000000
--- a/sysdeps/unix/sysv/linux/mips/bits/sigstack.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* sigstack, sigaltstack definitions.
- 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/>. */
-
-#ifndef _SIGNAL_H
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-
-/* Structure describing a signal stack (obsolete). */
-struct sigstack
- {
- void *ss_sp; /* Signal stack pointer. */
- int ss_onstack; /* Nonzero if executing on this stack. */
- };
-
-
-/* Possible values for `ss_flags.'. */
-enum
-{
- SS_ONSTACK = 1,
-#define SS_ONSTACK SS_ONSTACK
- SS_DISABLE
-#define SS_DISABLE SS_DISABLE
-};
-
-/* Minimum stack size for a signal handler. */
-#define MINSIGSTKSZ 2048
-
-/* 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;
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket_type.h b/sysdeps/unix/sysv/linux/mips/bits/socket_type.h
index ae4558e71b..ba1513ac81 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/socket_type.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket_type.h
@@ -1,5 +1,5 @@
/* Define enum __socket_type for Linux/MIPS.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h
index a46a4457b8..02fc6363f8 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/statfs.h b/sysdeps/unix/sysv/linux/mips/bits/statfs.h
index 470410b1af..ddd39aaab1 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h
index 7013cdd823..7969144633 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h
@@ -1,5 +1,5 @@
/* termios type and macro definitions. Linux/MIPS version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -175,7 +175,7 @@ struct termios
/* c_lflag bits */
#define ISIG 0000001 /* Enable signals. */
#define ICANON 0000002 /* Do erase and kill processing. */
-#if defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
# define XCASE 0000004
#endif
#define ECHO 0000010 /* Enable echo. */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/timerfd.h b/sysdeps/unix/sysv/linux/mips/bits/timerfd.h
index 6a3ff65f72..e66b2244b3 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/timerfd.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/timerfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/stack_t.h b/sysdeps/unix/sysv/linux/mips/bits/types/stack_t.h
new file mode 100644
index 0000000000..c188f191be
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/types/stack_t.h
@@ -0,0 +1,33 @@
+/* Define stack_t. MIPS Linux version.
+ Copyright (C) 1998-2018 Free Software 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 __stack_t_defined
+#define __stack_t_defined 1
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Structure describing a signal stack. */
+typedef struct
+ {
+ void *ss_sp;
+ size_t ss_size;
+ int ss_flags;
+ } stack_t;
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/brk.c b/sysdeps/unix/sysv/linux/mips/brk.c
index 7efe6c2be1..396d5c76ea 100644
--- a/sysdeps/unix/sysv/linux/mips/brk.c
+++ b/sysdeps/unix/sysv/linux/mips/brk.c
@@ -1,5 +1,5 @@
/* brk system call for Linux/MIPS.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/clone.S b/sysdeps/unix/sysv/linux/mips/clone.S
index 755e8ccafe..24cd50e4f8 100644
--- a/sysdeps/unix/sysv/linux/mips/clone.S
+++ b/sysdeps/unix/sysv/linux/mips/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ralf Baechle <ralf@linux-mips.org>, 1996.
@@ -25,9 +25,6 @@
#include <bits/errno.h>
#include <tls.h>
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
void *parent_tidptr, void *tls, void *child_tidptr) */
@@ -130,12 +127,6 @@ L(thread_start):
SAVE_GP (GPOFF)
/* The stackframe has been created on entry of clone(). */
- /* Check and see if we need to reset the PID. */
- LONG_L a0,(PTRSIZE*2)(sp)
- and a1,a0,CLONE_THREAD
- beqz a1,L(restore_pid)
-L(donepid):
-
/* Restore the arg for user's function. */
PTR_L t9,0(sp) /* Function pointer. */
PTR_L a0,PTRSIZE(sp) /* Argument pointer. */
@@ -143,27 +134,11 @@ L(donepid):
/* Call the user's function. */
jal t9
- /* Call _exit rather than doing it inline for breakpoint purposes. */
move a0,v0
-#ifdef __PIC__
- PTR_LA t9,_exit
- jalr t9
-#else
- jal _exit
-#endif
-
-L(restore_pid):
- and a1,a0,CLONE_VM
- li v0,-1
- bnez a1,L(gotpid)
- li v0,__NR_getpid
+ li v0,__NR_exit
syscall
-L(gotpid):
- READ_THREAD_POINTER(v1)
- INT_S v0,PID_OFFSET(v1)
- INT_S v0,TID_OFFSET(v1)
- b L(donepid)
END(__thread_start)
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure
index a5513fad48..1ee7f41a36 100644
--- a/sysdeps/unix/sysv/linux/mips/configure
+++ b/sysdeps/unix/sysv/linux/mips/configure
@@ -442,8 +442,8 @@ mips/mips64/n64/*)
test -n "$libc_cv_slibdir" ||
case "$prefix" in
/usr | /usr/)
- libc_cv_slibdir=/lib64
- libc_cv_rtlddir=/lib64
+ libc_cv_slibdir='/lib64'
+ libc_cv_rtlddir='/lib64'
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
# Locale data can be shared between 32-bit and 64-bit libraries.
@@ -456,8 +456,8 @@ mips/mips64/n32/*)
test -n "$libc_cv_slibdir" ||
case "$prefix" in
/usr | /usr/)
- libc_cv_slibdir=/lib32
- libc_cv_rtlddir=/lib32
+ libc_cv_slibdir='/lib32'
+ libc_cv_rtlddir='/lib32'
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib32';
# Locale data can be shared between 32-bit and 64-bit libraries.
diff --git a/sysdeps/unix/sysv/linux/mips/dl-cache.h b/sysdeps/unix/sysv/linux/mips/dl-cache.h
index 18b695a0a0..b0d2a87fe5 100644
--- a/sysdeps/unix/sysv/linux/mips/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/mips/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/dl-static.c b/sysdeps/unix/sysv/linux/mips/dl-static.c
index 554967e072..b6a225adef 100644
--- a/sysdeps/unix/sysv/linux/mips/dl-static.c
+++ b/sysdeps/unix/sysv/linux/mips/dl-static.c
@@ -1,5 +1,5 @@
/* Variable initialization. MIPS version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/getcontext.S b/sysdeps/unix/sysv/linux/mips/getcontext.S
index 75636a6761..7d01fac4ab 100644
--- a/sysdeps/unix/sysv/linux/mips/getcontext.S
+++ b/sysdeps/unix/sysv/linux/mips/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
@@ -38,6 +38,12 @@ MASK = 0x10000000
#endif
FRAMESZ = ((LOCALSZ * SZREG) + ALSZ) & ALMASK
GPOFF = FRAMESZ - (1 * SZREG)
+MCONTEXT_GREGSZ = 8
+#if _MIPS_SIM == _ABIO32 && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+MCONTEXT_GREGOFF = 4
+#else
+MCONTEXT_GREGOFF = 0
+#endif
NESTED (__getcontext, FRAMESZ, ra)
.mask MASK, 0
@@ -74,23 +80,24 @@ NESTED (__getcontext, FRAMESZ, ra)
/* Store a magic flag. */
li v1, 1
- REG_S v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */
-
- REG_S s0, (16 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s1, (17 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s2, (18 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s3, (19 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s4, (20 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s5, (21 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s6, (22 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s7, (23 * SZREG + MCONTEXT_GREGS)(a0)
+ /* zero */
+ REG_S v1, (MCONTEXT_GREGOFF + 0 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+
+ REG_S s0, (MCONTEXT_GREGOFF + 16 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s1, (MCONTEXT_GREGOFF + 17 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s2, (MCONTEXT_GREGOFF + 18 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s3, (MCONTEXT_GREGOFF + 19 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s4, (MCONTEXT_GREGOFF + 20 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s5, (MCONTEXT_GREGOFF + 21 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s6, (MCONTEXT_GREGOFF + 22 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s7, (MCONTEXT_GREGOFF + 23 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
- REG_S _GP, (28 * SZREG + MCONTEXT_GREGS)(a0)
+ REG_S _GP, (MCONTEXT_GREGOFF + 28 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
#endif
- REG_S _SP, (29 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S fp, (30 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S ra, (31 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S ra, MCONTEXT_PC(a0)
+ REG_S _SP, (MCONTEXT_GREGOFF + 29 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S fp, (MCONTEXT_GREGOFF + 30 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S ra, (MCONTEXT_GREGOFF + 31 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S ra, (MCONTEXT_GREGOFF + MCONTEXT_PC)(a0)
#ifdef __mips_hard_float
# if _MIPS_SIM == _ABI64
diff --git a/sysdeps/unix/sysv/linux/mips/getrlimit64.c b/sysdeps/unix/sysv/linux/mips/getrlimit64.c
index 8c9c8cff2b..5a5e24f114 100644
--- a/sysdeps/unix/sysv/linux/mips/getrlimit64.c
+++ b/sysdeps/unix/sysv/linux/mips/getrlimit64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/getsysstats.c b/sysdeps/unix/sysv/linux/mips/getsysstats.c
index 9bd1687d54..a9b95f43f2 100644
--- a/sysdeps/unix/sysv/linux/mips/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/mips/getsysstats.c
@@ -1,5 +1,5 @@
/* Determine various system internal values, Linux/MIPS version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/init-first.c b/sysdeps/unix/sysv/linux/mips/init-first.c
new file mode 100644
index 0000000000..0cf8279c73
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/init-first.c
@@ -0,0 +1,44 @@
+/* Initialization code run first thing by the ELF startup code.
+ Copyright (C) 2016-2018 Free Software 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 SHARED
+# include <dl-vdso.h>
+# include <libc-vdso.h>
+
+int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *) attribute_hidden;
+int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
+
+static inline void
+_libc_vdso_platform_setup (void)
+{
+ PREPARE_VERSION_KNOWN (linux26, LINUX_2_6);
+
+ void *p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux26);
+ PTR_MANGLE (p);
+ VDSO_SYMBOL (gettimeofday) = p;
+
+ p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux26);
+ PTR_MANGLE (p);
+ VDSO_SYMBOL (clock_gettime) = p;
+}
+
+# define VDSO_SETUP _libc_vdso_platform_setup
+#endif
+
+#include <csu/init-first.c>
diff --git a/sysdeps/unix/sysv/linux/mips/ipc_priv.h b/sysdeps/unix/sysv/linux/mips/ipc_priv.h
deleted file mode 100644
index 67883be101..0000000000
--- a/sysdeps/unix/sysv/linux/mips/ipc_priv.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/powerpc/ipc_priv.h>
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index 83f7a4704d..ce798ccffe 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,31 +19,34 @@
#include <sgidefs.h>
-/* Support for the accept4 syscall was added in 2.6.31. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
+#include_next <kernel-features.h>
-/* Support for the recvmmsg syscall was added in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_RECVMMSG_SYSCALL 1
+/* The MIPS kernel does not support futex_atomic_cmpxchg_inatomic if
+ emulating LL/SC. */
+#if __mips == 1 || defined _MIPS_ARCH_R5900
+# undef __ASSUME_SET_ROBUST_LIST
#endif
-/* Support for the sendmmsg syscall was added in 3.1. */
-#if __LINUX_KERNEL_VERSION >= 0x030100
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
+/* Define this if your 32-bit syscall API requires 64-bit register
+ pairs to start with an even-number register. */
+#if _MIPS_SIM == _ABIO32
+# define __ASSUME_ALIGNED_REGISTER_PAIRS 1
+/* mips32 only supports ipc syscall. */
+# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
-#include_next <kernel-features.h>
+/* The o32 MIPS fadvise64 syscall behaves as fadvise64_64. */
+# define __ASSUME_FADVISE64_AS_64_64 1
-/* The n32 syscall ABI did not have a getdents64 syscall until
- 2.6.35. */
-#if _MIPS_SIM == _ABIN32 && __LINUX_KERNEL_VERSION < 0x020623
-# undef __ASSUME_GETDENTS64_SYSCALL
+/* mips32 support wire-up network syscalls. */
+# define __ASSUME_RECV_SYSCALL 1
+# define __ASSUME_SEND_SYSCALL 1
#endif
-/* The MIPS kernel does not support futex_atomic_cmpxchg_inatomic if
- emulating LL/SC. */
-#if __mips == 1 || defined _MIPS_ARCH_R5900
-# undef __ASSUME_FUTEX_LOCK_PI
-# undef __ASSUME_REQUEUE_PI
-# undef __ASSUME_SET_ROBUST_LIST
+/* Define that mips64-n32 is a ILP32 ABI to set the correct interface to
+ pass 64-bits values through syscalls. */
+#if _MIPS_SIM == _ABIN32
+# define __ASSUME_WORDSIZE64_ILP32 1
#endif
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
diff --git a/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h b/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h
index e870b207de..8f62b575cf 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h
@@ -6,7 +6,7 @@ typedef struct kernel_rt_sigframe
uint32_t rs_ass[4];
uint32_t rs_code[2];
siginfo_t rs_info;
- struct ucontext rs_uc;
+ ucontext_t rs_uc;
uint32_t rs_altcode[8] __attribute__ ((__aligned__ (1 << 7)));
}
kernel_rt_sigframe_t;
diff --git a/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h b/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h
index b6f52cc9c9..beef976cc3 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h
@@ -1,40 +1,12 @@
-/* This is the sigaction structure from the Linux 2.1.24 kernel. */
-
-#include <sgidefs.h>
-
-#define HAVE_SA_RESTORER
-
-struct old_kernel_sigaction {
- unsigned int sa_flags;
- __sighandler_t k_sa_handler;
- unsigned long sa_mask;
- unsigned int __pad0[3]; /* reserved, keep size constant */
-
- /* Abi says here follows reserved int[2] */
- void (*sa_restorer)(void);
-#if (_MIPS_SZPTR < 64)
- /*
- * For 32 bit code we have to pad struct sigaction to get
- * constant size for the ABI
- */
- int pad1[1]; /* reserved */
-#endif
+#ifndef _KERNEL_SIGACTION_H
+# define _KERNEL_SIGACTION_H
+
+/* This is the sigaction structure from the Linux 3.2 kernel. */
+struct kernel_sigaction
+{
+ unsigned int sa_flags;
+ __sighandler_t k_sa_handler;
+ sigset_t sa_mask;
};
-
-#define _KERNEL_NSIG 128
-#define _KERNEL_NSIG_BPW _MIPS_SZLONG
-#define _KERNEL_NSIG_WORDS (_KERNEL_NSIG / _KERNEL_NSIG_BPW)
-
-typedef struct {
- unsigned long sig[_KERNEL_NSIG_WORDS];
-} kernel_sigset_t;
-
-/* This is the sigaction structure from the Linux 2.1.68 kernel. */
-struct kernel_sigaction {
- unsigned int sa_flags;
- __sighandler_t k_sa_handler;
- kernel_sigset_t sa_mask;
- void (*sa_restorer)(void);
- int s_resv[1]; /* reserved */
-};
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/kernel_stat.h b/sysdeps/unix/sysv/linux/mips/kernel_stat.h
index e785bcd8cf..388df1bfff 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel_stat.h
@@ -55,3 +55,6 @@ struct kernel_stat
unsigned int st_gen;
};
#endif
+
+#define XSTAT_IS_XSTAT64 0
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/mips/kernel_termios.h b/sysdeps/unix/sysv/linux/mips/kernel_termios.h
index 4d5f5de61e..1c54b19428 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel_termios.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel_termios.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/ldsodefs.h b/sysdeps/unix/sysv/linux/mips/ldsodefs.h
index 3d2289cea8..68a0a99bb1 100644
--- a/sysdeps/unix/sysv/linux/mips/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/mips/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects. MIPS.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/libc-abis b/sysdeps/unix/sysv/linux/mips/libc-abis
index 14ff60322a..eaea558720 100644
--- a/sysdeps/unix/sysv/linux/mips/libc-abis
+++ b/sysdeps/unix/sysv/linux/mips/libc-abis
@@ -14,3 +14,5 @@ UNIQUE
#
# MIPS O32 FP64
MIPS_O32_FP64 mips*-*-linux*
+# Absolute (SHN_ABS) symbols working correctly.
+ABSOLUTE
diff --git a/sysdeps/unix/sysv/linux/mips/libc-vdso.h b/sysdeps/unix/sysv/linux/mips/libc-vdso.h
new file mode 100644
index 0000000000..c36e22dc40
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/libc-vdso.h
@@ -0,0 +1,33 @@
+/* VDSO function pointer declarations.
+ Copyright (C) 2016-2018 Free Software 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 _LIBC_VDSO_H
+#define _LIBC_VDSO_H
+
+#ifdef SHARED
+
+# include <sysdep-vdso.h>
+
+extern int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
+ attribute_hidden;
+extern int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
+
+#endif
+
+#endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/mips/makecontext.S b/sysdeps/unix/sysv/linux/mips/makecontext.S
index 66600c7513..09102b708e 100644
--- a/sysdeps/unix/sysv/linux/mips/makecontext.S
+++ b/sysdeps/unix/sysv/linux/mips/makecontext.S
@@ -1,5 +1,5 @@
/* Modify saved context.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
@@ -53,6 +53,12 @@ NARGREGS = 8
A3OFF = FRAMESZ + (3 * SZREG) /* caller-allocated */
NARGREGS = 4
#endif
+MCONTEXT_GREGSZ = 8
+#if _MIPS_SIM == _ABIO32 && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+MCONTEXT_GREGOFF = 4
+#else
+MCONTEXT_GREGOFF = 0
+#endif
NESTED (__makecontext, FRAMESZ, ra)
.mask MASK, -(ARGSZ * SZREG)
@@ -89,7 +95,8 @@ NESTED (__makecontext, FRAMESZ, ra)
/* Store a magic flag. */
li v1, 1
- REG_S v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */
+ /* zero */
+ REG_S v1, (MCONTEXT_GREGOFF + 0 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
/* Set up the stack. */
PTR_L t0, STACK_SP(a0)
@@ -100,14 +107,14 @@ NESTED (__makecontext, FRAMESZ, ra)
blez a2, 2f /* no arguments */
/* Store register arguments. */
- PTR_ADDIU t2, a0, MCONTEXT_GREGS + 4 * SZREG
+ PTR_ADDIU t2, a0, MCONTEXT_GREGS + 4 * MCONTEXT_GREGSZ + MCONTEXT_GREGOFF
move t3, zero
0:
addiu t3, 1
REG_L v1, (t1)
PTR_ADDIU t1, SZREG
REG_S v1, (t2)
- PTR_ADDIU t2, SZREG
+ PTR_ADDIU t2, MCONTEXT_GREGSZ
bgeu t3, a2, 2f /* all done */
bltu t3, NARGREGS, 0b /* next */
@@ -138,13 +145,17 @@ NESTED (__makecontext, FRAMESZ, ra)
#else
PTR_LA t9, 99f
#endif
- REG_S t0, (29 * SZREG + MCONTEXT_GREGS)(a0) /* sp */
- REG_S v1, (16 * SZREG + MCONTEXT_GREGS)(a0) /* s0 */
+ /* sp */
+ REG_S t0, (MCONTEXT_GREGOFF + 29 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ /* s0 */
+ REG_S v1, (MCONTEXT_GREGOFF + 16 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
#ifdef __PIC__
- REG_S gp, (17 * SZREG + MCONTEXT_GREGS)(a0) /* s1 */
+ /* s1 */
+ REG_S gp, (MCONTEXT_GREGOFF + 17 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
#endif
- REG_S t9, (31 * SZREG + MCONTEXT_GREGS)(a0) /* ra */
- REG_S a1, MCONTEXT_PC(a0)
+ /* ra */
+ REG_S t9, (MCONTEXT_GREGOFF + 31 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S a1, (MCONTEXT_GREGOFF + MCONTEXT_PC)(a0)
#ifdef __PIC__
RESTORE_GP64_STACK
@@ -153,6 +164,11 @@ NESTED (__makecontext, FRAMESZ, ra)
#endif
jr ra
+ /* We need to terminate the FDE to stop unwinding if backtrace was
+ called within a context created by makecontext. */
+ cfi_endproc
+ nop
+
99:
#ifdef __PIC__
move gp, s1
@@ -186,6 +202,8 @@ NESTED (__makecontext, FRAMESZ, ra)
1:
lb zero, (zero)
b 1b
+
+ cfi_startproc
PSEUDO_END (__makecontext)
weak_alias (__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/Makefile b/sysdeps/unix/sysv/linux/mips/mips32/Makefile
new file mode 100644
index 0000000000..aa1aa8fe80
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/Makefile
@@ -0,0 +1,12 @@
+ifeq ($(subdir),conform)
+# For bugs 17786 and 21278.
+conformtest-xfail-conds += mips-o32-linux
+endif
+
+ifeq ($(subdir),misc)
+sysdep_routines += mips-syscall5 mips-syscall6 mips-syscall7
+endif
+
+ifeq ($(subdir),stdlib)
+tests += bug-getcontext-mips-gp
+endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/Versions b/sysdeps/unix/sysv/linux/mips/mips32/Versions
index 9621fb5cae..9337f8fe3d 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/Versions
+++ b/sysdeps/unix/sysv/linux/mips/mips32/Versions
@@ -3,4 +3,7 @@ libc {
getrlimit64;
setrlimit64;
}
+ GLIBC_PRIVATE {
+ __mips_syscall5; __mips_syscall6; __mips_syscall7;
+ }
}
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/accept4.c b/sysdeps/unix/sysv/linux/mips/mips32/accept4.c
deleted file mode 100644
index e5f9dfeb51..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/accept4.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2008-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/>. */
-
-/* Avoid accept4.c trying to use a definition based on the socketcall
- syscall and internal_accept4.S. */
-
-#include <errno.h>
-#include <signal.h>
-#include <sys/socket.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#undef __NR_socketcall
-
-#include <sysdeps/unix/sysv/linux/accept4.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/bug-getcontext-mips-gp.c b/sysdeps/unix/sysv/linux/mips/mips32/bug-getcontext-mips-gp.c
new file mode 100644
index 0000000000..d181715bd4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/bug-getcontext-mips-gp.c
@@ -0,0 +1,63 @@
+/* Tests register values retreived by getcontext() for mips o32.
+ Copyright (C) 2017-2018 Free Software 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ucontext.h>
+
+
+#if !defined __mips__ || _MIPS_SIM != _ABIO32
+# error "MIPS O32 specific test."
+#endif
+
+#define SP_REG 29
+
+static int
+do_test (void)
+{
+ ucontext_t ctx;
+ memset (&ctx, 0, sizeof (ctx));
+ int status = getcontext (&ctx);
+ if (status)
+ {
+ printf ("\ngetcontext() failed, errno: %d.\n", errno);
+ return 1;
+ }
+
+ if (ctx.uc_mcontext.gregs[SP_REG] == 0
+ || ctx.uc_mcontext.gregs[SP_REG] > 0xffffffff)
+ {
+ printf ("\nError getcontext(): invalid $sp = 0x%llx.\n",
+ ctx.uc_mcontext.gregs[SP_REG]);
+ return 1;
+ }
+
+ if (ctx.uc_mcontext.pc == 0
+ || ctx.uc_mcontext.pc > 0xffffffff)
+ {
+ printf ("\nError getcontext(): invalid ctx.uc_mcontext.pc = 0x%llx.\n",
+ ctx.uc_mcontext.pc);
+ return 1;
+ }
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fcntl.c b/sysdeps/unix/sysv/linux/mips/mips32/fcntl.c
deleted file mode 100644
index ea951bc4f9..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 2ab9e944a3..dda9797e0e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -1312,7 +1310,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1338,7 +1335,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -1346,22 +1342,18 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1370,7 +1362,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -1381,21 +1372,17 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
GLIBC_2.18 __mips_fpu_getcw F
GLIBC_2.18 __mips_fpu_setcw F
-GLIBC_2.19 GLIBC_2.19 A
GLIBC_2.19 getrlimit64 F
GLIBC_2.19 setrlimit64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _Exit F
GLIBC_2.2 _IO_2_1_stderr_ D 0xa0
GLIBC_2.2 _IO_2_1_stdin_ D 0xa0
@@ -1915,33 +1902,71 @@ GLIBC_2.2 xdr_uint32_t F
GLIBC_2.2 xdr_uint64_t F
GLIBC_2.2 xdr_uint8_t F
GLIBC_2.2 xdr_unixcred F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2031,7 +2056,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2044,7 +2068,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x200
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2065,7 +2088,6 @@ GLIBC_2.3.3 sched_setaffinity F
GLIBC_2.3.3 semtimedop F
GLIBC_2.3.3 sys_sigabbrev D 0x200
GLIBC_2.3.3 sys_siglist D 0x200
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2095,7 +2117,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2168,7 +2189,6 @@ GLIBC_2.4 renameat F
GLIBC_2.4 symlinkat F
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2186,7 +2206,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2194,7 +2213,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2221,7 +2239,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2232,9 +2249,7 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
GLIBC_2.9 pipe2 F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/ftruncate64.c b/sysdeps/unix/sysv/linux/mips/mips32/ftruncate64.c
deleted file mode 100644
index 0e8d8ba408..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/ftruncate64.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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 <sys/types.h>
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Truncate the file FD refers to to LENGTH bytes. */
-int
-__ftruncate64 (int fd, off64_t length)
-{
- unsigned int low = length & 0xffffffff;
- unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (ftruncate64, 4, fd, 0,
- __LONG_LONG_PAIR (high, low));
- return result;
-}
-weak_alias (__ftruncate64, ftruncate64)
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h
new file mode 100644
index 0000000000..d46d69ecbd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 240
+#define SIGJMP_BUF_SIZE 240
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 104
+#define SAVED_MASK_OFFSET 108
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
index afdb905811..55d48868e8 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
@@ -1,15 +1,9 @@
-GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
GLIBC_2.0 _r_debug D 0x14
GLIBC_2.0 calloc F
GLIBC_2.0 free F
GLIBC_2.0 malloc F
GLIBC_2.0 realloc F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __libc_stack_end D 0x4
GLIBC_2.2 _dl_mcount F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __stack_chk_guard D 0x4
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libBrokenLocale.abilist
index 8c497b477e..54395f3c8d 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libBrokenLocale.abilist
@@ -1,3 +1 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __ctype_get_mb_cur_max F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist
index bcfbf9e199..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist
@@ -1,6 +1,4 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
GLIBC_2.2.3 getaddrinfo_a F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libcidn.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libcidn.abilist
deleted file mode 100644
index db6b02789d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/libcidn.abilist
+++ /dev/null
@@ -1 +0,0 @@
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libcrypt.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libcrypt.abilist
index c9d2e54530..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
@@ -6,4 +5,3 @@ GLIBC_2.0 encrypt_r F
GLIBC_2.0 fcrypt F
GLIBC_2.0 setkey F
GLIBC_2.0 setkey_r F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libdl.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libdl.abilist
index 55f8a1e5e9..6d377d93a4 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libdl.abilist
@@ -1,15 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 dlopen F
GLIBC_2.2 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
index e599e82d6e..ff011f86f2 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _LIB_VERSION D 0x4
GLIBC_2.0 acos F
GLIBC_2.0 acosf F
@@ -155,7 +154,6 @@ GLIBC_2.0 y1l F
GLIBC_2.0 yn F
GLIBC_2.0 ynf F
GLIBC_2.0 ynl F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -210,10 +208,8 @@ GLIBC_2.15 __y1_finite F
GLIBC_2.15 __y1f_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __clog10 F
GLIBC_2.2 __clog10f F
GLIBC_2.2 __clog10l F
@@ -369,11 +365,403 @@ GLIBC_2.2 tgammal F
GLIBC_2.2 trunc F
GLIBC_2.2 truncf F
GLIBC_2.2 truncl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.4 exp2l F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libnsl.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libnsl.abilist
index 53b4608235..8675e27a8a 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __free_fdresult F
GLIBC_2.2 __nis_default_access F
GLIBC_2.2 __nis_default_group F
@@ -121,4 +119,3 @@ GLIBC_2.2 writeColdStartFile F
GLIBC_2.2 xdr_cback_data F
GLIBC_2.2 xdr_obj_p F
GLIBC_2.2 xdr_ypall F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libnss_compat.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libnss_compat.abilist
deleted file mode 100644
index db6b02789d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/libnss_compat.abilist
+++ /dev/null
@@ -1 +0,0 @@
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libnss_db.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libnss_db.abilist
deleted file mode 100644
index db6b02789d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/libnss_db.abilist
+++ /dev/null
@@ -1 +0,0 @@
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libnss_dns.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libnss_dns.abilist
deleted file mode 100644
index db6b02789d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/libnss_dns.abilist
+++ /dev/null
@@ -1 +0,0 @@
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libnss_files.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libnss_files.abilist
deleted file mode 100644
index db6b02789d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/libnss_files.abilist
+++ /dev/null
@@ -1 +0,0 @@
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libnss_hesiod.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libnss_hesiod.abilist
deleted file mode 100644
index db6b02789d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/libnss_hesiod.abilist
+++ /dev/null
@@ -1 +0,0 @@
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libnss_nis.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libnss_nis.abilist
deleted file mode 100644
index db6b02789d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/libnss_nis.abilist
+++ /dev/null
@@ -1 +0,0 @@
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libnss_nisplus.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libnss_nisplus.abilist
deleted file mode 100644
index db6b02789d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/libnss_nisplus.abilist
+++ /dev/null
@@ -1 +0,0 @@
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
index 280d99d974..02144967c6 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_flockfile F
GLIBC_2.0 _IO_ftrylockfile F
GLIBC_2.0 _IO_funlockfile F
@@ -119,18 +118,14 @@ GLIBC_2.0 vfork F
GLIBC_2.0 wait F
GLIBC_2.0 waitpid F
GLIBC_2.0 write F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __libc_allocate_rtsig F
GLIBC_2.2 __libc_current_sigrtmax F
GLIBC_2.2 __libc_current_sigrtmin F
@@ -209,18 +204,35 @@ GLIBC_2.2 sem_timedwait F
GLIBC_2.2 sem_trywait F
GLIBC_2.2 sem_unlink F
GLIBC_2.2 sem_wait F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -238,13 +250,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
@@ -254,4 +264,3 @@ GLIBC_2.4 pthread_mutexattr_getrobust_np F
GLIBC_2.4 pthread_mutexattr_setprioceiling F
GLIBC_2.4 pthread_mutexattr_setprotocol F
GLIBC_2.4 pthread_mutexattr_setrobust_np F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libresolv.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libresolv.abilist
index 1f89eb6cd9..157a33ce35 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
@@ -98,4 +94,3 @@ GLIBC_2.9 ns_skiprr F
GLIBC_2.9 ns_sprintrr F
GLIBC_2.9 ns_sprintrrf F
GLIBC_2.9 ns_subdomain F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
index 61f63e1524..84837c8a2e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 aio_cancel F
GLIBC_2.2 aio_cancel64 F
GLIBC_2.2 aio_error F
@@ -28,7 +27,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -39,9 +37,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libthread_db.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libthread_db.abilist
index e47140b61c..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,10 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist
index ce712a238c..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist
@@ -1,8 +1,6 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
GLIBC_2.0 logout F
GLIBC_2.0 logwtmp F
GLIBC_2.0 openpty F
-_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips-syscall5.S b/sysdeps/unix/sysv/linux/mips/mips32/mips-syscall5.S
new file mode 100644
index 0000000000..02031b19e7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips-syscall5.S
@@ -0,0 +1,35 @@
+/* MIPS syscall wrappers.
+ Copyright (C) 2017-2018 Free Software 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>
+#include <sys/asm.h>
+
+ .text
+ .set nomips16
+
+/* long long __mips_syscall5 (long arg1, long arg2, long arg3, long arg4,
+ long arg5,
+ long number) */
+
+ENTRY(__mips_syscall5)
+ lw v0, 20(sp)
+ syscall
+ move v1, a3
+ jr ra
+END(__mips_syscall5)
+libc_hidden_def (__mips_syscall5)
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips-syscall6.S b/sysdeps/unix/sysv/linux/mips/mips32/mips-syscall6.S
new file mode 100644
index 0000000000..7c2a77d2d6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips-syscall6.S
@@ -0,0 +1,35 @@
+/* MIPS syscall wrappers.
+ Copyright (C) 2017-2018 Free Software 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>
+#include <sys/asm.h>
+
+ .text
+ .set nomips16
+
+/* long long __mips_syscall6 (long arg1, long arg2, long arg3, long arg4,
+ long arg5, long arg6,
+ long number) */
+
+ENTRY(__mips_syscall6)
+ lw v0, 24(sp)
+ syscall
+ move v1, a3
+ jr ra
+END(__mips_syscall6)
+libc_hidden_def (__mips_syscall6)
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips-syscall7.S b/sysdeps/unix/sysv/linux/mips/mips32/mips-syscall7.S
new file mode 100644
index 0000000000..6fc4d060e9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips-syscall7.S
@@ -0,0 +1,35 @@
+/* MIPS syscall wrappers.
+ Copyright (C) 2017-2018 Free Software 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>
+#include <sys/asm.h>
+
+ .text
+ .set nomips16
+
+/* long long __mips_syscall7 (long arg1, long arg2, long arg3, long arg4,
+ long arg5, long arg6, long arg7,
+ long number) */
+
+ENTRY(__mips_syscall7)
+ lw v0, 28(sp)
+ syscall
+ move v1, a3
+ jr ra
+END(__mips_syscall7)
+libc_hidden_def (__mips_syscall7)
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile b/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile
index fa9fcb7e6f..6869bf4f7c 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile
@@ -1,13 +1,9 @@
ifeq ($(subdir),misc)
sysdep_routines += mips16-syscall0 mips16-syscall1 mips16-syscall2
-sysdep_routines += mips16-syscall3 mips16-syscall4 mips16-syscall5
-sysdep_routines += mips16-syscall6 mips16-syscall7
+sysdep_routines += mips16-syscall3 mips16-syscall4
CFLAGS-mips16-syscall0.c += -fexceptions
CFLAGS-mips16-syscall1.c += -fexceptions
CFLAGS-mips16-syscall2.c += -fexceptions
CFLAGS-mips16-syscall3.c += -fexceptions
CFLAGS-mips16-syscall4.c += -fexceptions
-CFLAGS-mips16-syscall5.c += -fexceptions
-CFLAGS-mips16-syscall6.c += -fexceptions
-CFLAGS-mips16-syscall7.c += -fexceptions
endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions b/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions
index 73bcfb566c..bb21747f44 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions
@@ -1,6 +1,6 @@
libc {
GLIBC_PRIVATE {
__mips16_syscall0; __mips16_syscall1; __mips16_syscall2; __mips16_syscall3;
- __mips16_syscall4; __mips16_syscall5; __mips16_syscall6; __mips16_syscall7;
+ __mips16_syscall4;
}
}
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h
index cef8387c25..23695ddaea 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h
@@ -1,5 +1,5 @@
/* MIPS16 syscall wrappers.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,19 +19,6 @@
#ifndef MIPS16_SYSCALL_H
#define MIPS16_SYSCALL_H 1
-#define __nomips16 __attribute__ ((nomips16))
-
-union __mips16_syscall_return
- {
- long long val;
- struct
- {
- long v0;
- long v1;
- }
- reg;
- };
-
long long __nomips16 __mips16_syscall0 (long number);
#define __mips16_syscall0(dummy, number) \
__mips16_syscall0 ((long) (number))
@@ -61,29 +48,22 @@ long long __nomips16 __mips16_syscall4 (long a0, long a1, long a2, long a3,
(long) (a3), \
(long) (number))
-long long __nomips16 __mips16_syscall5 (long a0, long a1, long a2, long a3,
- long a4,
- long number);
+/* The remaining ones use regular MIPS wrappers. */
+
#define __mips16_syscall5(a0, a1, a2, a3, a4, number) \
- __mips16_syscall5 ((long) (a0), (long) (a1), (long) (a2), \
- (long) (a3), (long) (a4), \
- (long) (number))
+ __mips_syscall5 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), (long) (a4), \
+ (long) (number))
-long long __nomips16 __mips16_syscall6 (long a0, long a1, long a2, long a3,
- long a4, long a5,
- long number);
#define __mips16_syscall6(a0, a1, a2, a3, a4, a5, number) \
- __mips16_syscall6 ((long) (a0), (long) (a1), (long) (a2), \
- (long) (a3), (long) (a4), (long) (a5), \
- (long) (number))
+ __mips_syscall6 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), (long) (a4), (long) (a5), \
+ (long) (number))
-long long __nomips16 __mips16_syscall7 (long a0, long a1, long a2, long a3,
- long a4, long a5, long a6,
- long number);
#define __mips16_syscall7(a0, a1, a2, a3, a4, a5, a6, number) \
- __mips16_syscall7 ((long) (a0), (long) (a1), (long) (a2), \
- (long) (a3), (long) (a4), (long) (a5), \
- (long) (a6), \
- (long) (number))
+ __mips_syscall7 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), (long) (a4), (long) (a5), \
+ (long) (a6), \
+ (long) (number))
#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c
index c3414f5e90..57ac2a5109 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c
@@ -1,5 +1,5 @@
/* MIPS16 syscall wrappers.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software 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,14 +17,13 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <mips16-syscall.h>
#undef __mips16_syscall0
long long __nomips16
__mips16_syscall0 (long number)
{
- union __mips16_syscall_return ret;
+ union __mips_syscall_return ret;
ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 0);
return ret.val;
}
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c
index 5fb190923e..1ba5c8b79f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c
@@ -1,5 +1,5 @@
/* MIPS16 syscall wrappers.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <mips16-syscall.h>
#undef __mips16_syscall1
@@ -25,7 +24,7 @@ long long __nomips16
__mips16_syscall1 (long a0,
long number)
{
- union __mips16_syscall_return ret;
+ union __mips_syscall_return ret;
ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 1,
a0);
return ret.val;
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c
index e44fc80c2f..400cb5e08b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c
@@ -1,5 +1,5 @@
/* MIPS16 syscall wrappers.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <mips16-syscall.h>
#undef __mips16_syscall2
@@ -25,7 +24,7 @@ long long __nomips16
__mips16_syscall2 (long a0, long a1,
long number)
{
- union __mips16_syscall_return ret;
+ union __mips_syscall_return ret;
ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 2,
a0, a1);
return ret.val;
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c
index 5759eb620d..5b87b1bddc 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c
@@ -1,5 +1,5 @@
/* MIPS16 syscall wrappers.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <mips16-syscall.h>
#undef __mips16_syscall3
@@ -25,7 +24,7 @@ long long __nomips16
__mips16_syscall3 (long a0, long a1, long a2,
long number)
{
- union __mips16_syscall_return ret;
+ union __mips_syscall_return ret;
ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 3,
a0, a1, a2);
return ret.val;
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c
index 9dc63a6be8..2dbc5b7e8e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c
+++ b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c
@@ -1,5 +1,5 @@
/* MIPS16 syscall wrappers.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <mips16-syscall.h>
#undef __mips16_syscall4
@@ -25,7 +24,7 @@ long long __nomips16
__mips16_syscall4 (long a0, long a1, long a2, long a3,
long number)
{
- union __mips16_syscall_return ret;
+ union __mips_syscall_return ret;
ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 4,
a0, a1, a2, a3);
return ret.val;
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c
deleted file mode 100644
index 2d2a6d1778..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* MIPS16 syscall wrappers.
- 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/>. */
-
-#include <sysdep.h>
-#include <mips16-syscall.h>
-
-#undef __mips16_syscall5
-
-long long __nomips16
-__mips16_syscall5 (long a0, long a1, long a2, long a3,
- long a4,
- long number)
-{
- union __mips16_syscall_return ret;
- ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 5,
- a0, a1, a2, a3, a4);
- return ret.val;
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c
deleted file mode 100644
index 35b9dc8258..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* MIPS16 syscall wrappers.
- 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/>. */
-
-#include <sysdep.h>
-#include <mips16-syscall.h>
-
-#undef __mips16_syscall6
-
-long long __nomips16
-__mips16_syscall6 (long a0, long a1, long a2, long a3,
- long a4, long a5,
- long number)
-{
- union __mips16_syscall_return ret;
- ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 6,
- a0, a1, a2, a3, a4, a5);
- return ret.val;
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c b/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c
deleted file mode 100644
index d12ae43a84..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* MIPS16 syscall wrappers.
- 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/>. */
-
-#include <sysdep.h>
-#include <mips16-syscall.h>
-
-#undef __mips16_syscall7
-
-long long __nomips16
-__mips16_syscall7 (long a0, long a1, long a2, long a3,
- long a4, long a5, long a6,
- long number)
-{
- union __mips16_syscall_return ret;
- ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 7,
- a0, a1, a2, a3, a4, a5, a6);
- return ret.val;
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/mmap.c b/sysdeps/unix/sysv/linux/mips/mips32/mmap.c
deleted file mode 100644
index f30b1da58e..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/mmap.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index b9b4b74bfc..42e930d565 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -1312,7 +1310,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1338,7 +1335,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -1346,22 +1342,18 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1370,7 +1362,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -1381,19 +1372,15 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.19 GLIBC_2.19 A
GLIBC_2.19 getrlimit64 F
GLIBC_2.19 setrlimit64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _Exit F
GLIBC_2.2 _IO_2_1_stderr_ D 0xa0
GLIBC_2.2 _IO_2_1_stdin_ D 0xa0
@@ -1913,33 +1900,71 @@ GLIBC_2.2 xdr_uint32_t F
GLIBC_2.2 xdr_uint64_t F
GLIBC_2.2 xdr_uint8_t F
GLIBC_2.2 xdr_unixcred F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2029,7 +2054,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2042,7 +2066,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x200
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2063,7 +2086,6 @@ GLIBC_2.3.3 sched_setaffinity F
GLIBC_2.3.3 semtimedop F
GLIBC_2.3.3 sys_sigabbrev D 0x200
GLIBC_2.3.3 sys_siglist D 0x200
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2093,7 +2115,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2166,7 +2187,6 @@ GLIBC_2.4 renameat F
GLIBC_2.4 symlinkat F
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2184,7 +2204,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2192,7 +2211,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2219,7 +2237,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2230,9 +2247,7 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
GLIBC_2.9 pipe2 F
-_gp_disp _gp_disp A
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/readahead.c b/sysdeps/unix/sysv/linux/mips/mips32/readahead.c
deleted file mode 100644
index 80170c3e8a..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/readahead.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/arm/readahead.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c b/sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c
deleted file mode 100644
index c2a3440baa..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 2010-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/>. */
-
-/* Avoid recvmmsg.c trying to use a definition based on the socketcall
- syscall and internal_recvmmsg.S. */
-
-#include <errno.h>
-#include <sys/socket.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#undef __NR_socketcall
-
-#include <sysdeps/unix/sysv/linux/recvmmsg.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c b/sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c
deleted file mode 100644
index 7cd4e15d1b..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 2011-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/>. */
-
-/* Avoid sendmmsg.c trying to use a definition based on the socketcall
- syscall and internal_sendmmsg.S. */
-
-#include <errno.h>
-#include <sys/socket.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#undef __NR_socketcall
-
-#include <sysdeps/unix/sysv/linux/sendmmsg.c>
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/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index 2160df7d59..cbe9cd2bda 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -98,6 +98,19 @@
#undef INTERNAL_SYSCALL
#undef INTERNAL_SYSCALL_NCS
+#define __nomips16 __attribute__ ((nomips16))
+
+union __mips_syscall_return
+ {
+ long long val;
+ struct
+ {
+ long v0;
+ long v1;
+ }
+ reg;
+ };
+
#ifdef __mips16
/* There's no MIPS16 syscall instruction, so we go through out-of-line
standard MIPS wrappers. These do use inline snippets below though,
@@ -112,7 +125,7 @@
# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
({ \
- union __mips16_syscall_return _sc_ret; \
+ union __mips_syscall_return _sc_ret; \
_sc_ret.val = __mips16_syscall##nr (args, number); \
err = _sc_ret.reg.v1; \
_sc_ret.reg.v0; \
@@ -121,13 +134,13 @@
# define INTERNAL_SYSCALL_MIPS16(number, err, nr, args...) \
internal_syscall##nr ("lw\t%0, %2\n\t", \
"R" (number), \
- 0, err, args)
+ number, err, args)
#else /* !__mips16 */
# define INTERNAL_SYSCALL(name, err, nr, args...) \
internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t", \
"IK" (SYS_ify (name)), \
- 0, err, args)
+ SYS_ify (name), err, args)
# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
internal_syscall##nr (MOVE32 "\t%0, %2\n\t", \
@@ -262,115 +275,95 @@
_sys_result; \
})
-/* We need to use a frame pointer for the functions in which we
- adjust $sp around the syscall, or debug information and unwind
- information will be $sp relative and thus wrong during the syscall. As
- of GCC 4.7, this is sufficient. */
-#define FORCE_FRAME_POINTER \
- void *volatile __fp_force __attribute__ ((unused)) = alloca (4)
+/* Standalone MIPS wrappers used for 5, 6, and 7 argument syscalls,
+ which require stack arguments. We rely on the compiler arranging
+ wrapper's arguments according to the MIPS o32 function calling
+ convention, which is reused by syscalls, except for the syscall
+ number passed and the error flag returned (taken care of in the
+ wrapper called). This relieves us from relying on non-guaranteed
+ compiler specifics required for the stack arguments to be pushed,
+ which would be the case if these syscalls were inlined. */
+
+long long __nomips16 __mips_syscall5 (long arg1, long arg2, long arg3,
+ long arg4, long arg5,
+ long number);
+libc_hidden_proto (__mips_syscall5, nomips16)
#define internal_syscall5(v0_init, input, number, err, \
arg1, arg2, arg3, arg4, arg5) \
({ \
- long _sys_result; \
- \
- FORCE_FRAME_POINTER; \
- { \
- register long __s0 asm ("$16") __attribute__ ((unused)) \
- = (number); \
- register long __v0 asm ("$2"); \
- register long __a0 asm ("$4") = (long) (arg1); \
- register long __a1 asm ("$5") = (long) (arg2); \
- register long __a2 asm ("$6") = (long) (arg3); \
- register long __a3 asm ("$7") = (long) (arg4); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- "subu\t$29, 32\n\t" \
- "sw\t%6, 16($29)\n\t" \
- v0_init \
- "syscall\n\t" \
- "addiu\t$29, 32\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
- : input, "r" (__a0), "r" (__a1), "r" (__a2), \
- "r" ((long) (arg5)) \
- : __SYSCALL_CLOBBERS); \
- err = __a3; \
- _sys_result = __v0; \
- } \
- _sys_result; \
+ union __mips_syscall_return _sc_ret; \
+ _sc_ret.val = __mips_syscall5 ((long) (arg1), \
+ (long) (arg2), \
+ (long) (arg3), \
+ (long) (arg4), \
+ (long) (arg5), \
+ (long) (number)); \
+ err = _sc_ret.reg.v1; \
+ _sc_ret.reg.v0; \
})
+long long __nomips16 __mips_syscall6 (long arg1, long arg2, long arg3,
+ long arg4, long arg5, long arg6,
+ long number);
+libc_hidden_proto (__mips_syscall6, nomips16)
+
#define internal_syscall6(v0_init, input, number, err, \
arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
- long _sys_result; \
- \
- FORCE_FRAME_POINTER; \
- { \
- register long __s0 asm ("$16") __attribute__ ((unused)) \
- = (number); \
- register long __v0 asm ("$2"); \
- register long __a0 asm ("$4") = (long) (arg1); \
- register long __a1 asm ("$5") = (long) (arg2); \
- register long __a2 asm ("$6") = (long) (arg3); \
- register long __a3 asm ("$7") = (long) (arg4); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- "subu\t$29, 32\n\t" \
- "sw\t%6, 16($29)\n\t" \
- "sw\t%7, 20($29)\n\t" \
- v0_init \
- "syscall\n\t" \
- "addiu\t$29, 32\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
- : input, "r" (__a0), "r" (__a1), "r" (__a2), \
- "r" ((long) (arg5)), "r" ((long) (arg6)) \
- : __SYSCALL_CLOBBERS); \
- err = __a3; \
- _sys_result = __v0; \
- } \
- _sys_result; \
+ union __mips_syscall_return _sc_ret; \
+ _sc_ret.val = __mips_syscall6 ((long) (arg1), \
+ (long) (arg2), \
+ (long) (arg3), \
+ (long) (arg4), \
+ (long) (arg5), \
+ (long) (arg6), \
+ (long) (number)); \
+ err = _sc_ret.reg.v1; \
+ _sc_ret.reg.v0; \
})
+long long __nomips16 __mips_syscall7 (long arg1, long arg2, long arg3,
+ long arg4, long arg5, long arg6,
+ long arg7,
+ long number);
+libc_hidden_proto (__mips_syscall7, nomips16)
+
#define internal_syscall7(v0_init, input, number, err, \
arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
({ \
- long _sys_result; \
- \
- FORCE_FRAME_POINTER; \
- { \
- register long __s0 asm ("$16") __attribute__ ((unused)) \
- = (number); \
- register long __v0 asm ("$2"); \
- register long __a0 asm ("$4") = (long) (arg1); \
- register long __a1 asm ("$5") = (long) (arg2); \
- register long __a2 asm ("$6") = (long) (arg3); \
- register long __a3 asm ("$7") = (long) (arg4); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- "subu\t$29, 32\n\t" \
- "sw\t%6, 16($29)\n\t" \
- "sw\t%7, 20($29)\n\t" \
- "sw\t%8, 24($29)\n\t" \
- v0_init \
- "syscall\n\t" \
- "addiu\t$29, 32\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
- : input, "r" (__a0), "r" (__a1), "r" (__a2), \
- "r" ((long) (arg5)), "r" ((long) (arg6)), "r" ((long) (arg7)) \
- : __SYSCALL_CLOBBERS); \
- err = __a3; \
- _sys_result = __v0; \
- } \
- _sys_result; \
+ union __mips_syscall_return _sc_ret; \
+ _sc_ret.val = __mips_syscall7 ((long) (arg1), \
+ (long) (arg2), \
+ (long) (arg3), \
+ (long) (arg4), \
+ (long) (arg5), \
+ (long) (arg6), \
+ (long) (arg7), \
+ (long) (number)); \
+ err = _sc_ret.reg.v1; \
+ _sc_ret.reg.v0; \
})
#define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \
"$14", "$15", "$24", "$25", "hi", "lo", "memory"
+/* Standard MIPS syscalls have an error flag, and return a positive errno
+ when the error flag is set. Emulate this behaviour for vsyscalls so that
+ the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly. */
+#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \
+ ({ \
+ long _ret = funcptr (args); \
+ err = ((unsigned long) (_ret) >= (unsigned long) -4095L); \
+ if (err) \
+ _ret = -_ret; \
+ _ret; \
+ })
+
+/* List of system calls which are supported as vsyscalls. */
+#define HAVE_CLOCK_GETTIME_VSYSCALL 1
+#define HAVE_GETTIMEOFDAY_VSYSCALL 1
+
#endif /* __ASSEMBLER__ */
/* Pointer mangling is not yet supported for MIPS. */
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c b/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c
deleted file mode 100644
index 28563afb94..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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 <sys/types.h>
-#include <endian.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Truncate the file FD refers to to LENGTH bytes. */
-int
-truncate64 (const char *path, off64_t length)
-{
- unsigned int low = length & 0xffffffff;
- unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (truncate64, 4, path, 0,
- __LONG_LONG_PAIR (high, low));
- return result;
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/Makefile b/sysdeps/unix/sysv/linux/mips/mips64/Makefile
index b4fb190bba..fcb48c0f56 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/Makefile
+++ b/sysdeps/unix/sysv/linux/mips/mips64/Makefile
@@ -1,13 +1,3 @@
-ifeq ($(subdir),socket)
-CFLAGS-recv.c += -fexceptions
-CFLAGS-send.c += -fexceptions
-endif
-
-ifeq ($(subdir),nptl)
-CFLAGS-recv.c += -fexceptions
-CFLAGS-send.c += -fexceptions
-endif
-
ifeq ($(subdir),signal)
# sigaction.c defines static functions in asms and refers to them from
# C code, resulting in "'restore_rt' used but never defined" (which
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ftruncate64.c b/sysdeps/unix/sysv/linux/mips/mips64/ftruncate64.c
deleted file mode 100644
index 6e25b021ab..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/ftruncate64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty. */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
index 937054f5e9..071957c85b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
@@ -1,5 +1,5 @@
/* fxstat64 using 64-bit MIPS fstat system call.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
index 70c1b08c6e..17327e4452 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c b/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c
new file mode 100644
index 0000000000..136baad6dc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c
@@ -0,0 +1,112 @@
+/* Get directory entries. Linux/MIPSn64 LFS version.
+ Copyright (C) 2018 Free Software 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 <string.h>
+#include <dirent.h>
+#include <errno.h>
+#include <assert.h>
+#include <sys/param.h>
+#include <unistd.h>
+#include <scratch_buffer.h>
+
+ssize_t
+__getdents64 (int fd, char *buf, size_t nbytes)
+{
+#ifdef __NR_getdents64
+ ssize_t ret = INLINE_SYSCALL_CALL (getdents64, fd, buf, nbytes);
+ if (ret != -1)
+ return ret;
+#endif
+
+ /* Unfortunately getdents64 was only wire-up for MIPS n64 on Linux 3.10.
+ If syscall is not available it need to fallback to non-LFS one. */
+
+ struct kernel_dirent
+ {
+ unsigned long d_ino;
+ unsigned long d_off;
+ unsigned short int d_reclen;
+ char d_name[256];
+ };
+
+ const size_t size_diff = (offsetof (struct dirent64, d_name)
+ - offsetof (struct kernel_dirent, d_name));
+
+ size_t red_nbytes = MIN (nbytes
+ - ((nbytes / (offsetof (struct dirent64, d_name)
+ + 14)) * size_diff),
+ nbytes - size_diff);
+
+ struct scratch_buffer tmpbuf;
+ scratch_buffer_init (&tmpbuf);
+ if (!scratch_buffer_set_array_size (&tmpbuf, red_nbytes, sizeof (uint8_t)))
+ INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOMEM);
+
+ struct kernel_dirent *skdp, *kdp;
+ skdp = kdp = tmpbuf.data;
+
+ ssize_t retval = INLINE_SYSCALL_CALL (getdents, fd, kdp, red_nbytes);
+ if (retval == -1)
+ {
+ scratch_buffer_free (&tmpbuf);
+ return -1;
+ }
+
+ off64_t last_offset = -1;
+ struct dirent64 *dp = (struct dirent64 *) buf;
+ while ((char *) kdp < (char *) skdp + retval)
+ {
+ const size_t alignment = _Alignof (struct dirent64);
+ /* Since kdp->d_reclen is already aligned for the kernel structure
+ this may compute a value that is bigger than necessary. */
+ size_t new_reclen = ((kdp->d_reclen + size_diff + alignment - 1)
+ & ~(alignment - 1));
+ if ((char *) dp + new_reclen > buf + nbytes)
+ {
+ /* Our heuristic failed. We read too many entries. Reset
+ the stream. */
+ assert (last_offset != -1);
+ __lseek64 (fd, last_offset, SEEK_SET);
+
+ if ((char *) dp == buf)
+ {
+ scratch_buffer_free (&tmpbuf);
+ return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
+ }
+
+ break;
+ }
+
+ last_offset = kdp->d_off;
+ dp->d_ino = kdp->d_ino;
+ dp->d_off = kdp->d_off;
+ dp->d_reclen = new_reclen;
+ dp->d_type = *((char *) kdp + kdp->d_reclen - 1);
+ memcpy (dp->d_name, kdp->d_name,
+ kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
+
+ dp = (struct dirent64 *) ((char *) dp + new_reclen);
+ kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen);
+ }
+
+ scratch_buffer_free (&tmpbuf);
+ return (char *) dp - buf;
+}
+#if _DIRENT_MATCHES_DIRENT64
+strong_alias (__getdents64, __getdents)
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h b/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h
new file mode 100644
index 0000000000..269ce9ea60
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h
@@ -0,0 +1,32 @@
+/* Old SysV permission definition for Linux. MIPS64 version.
+ Copyright (C) 2016-2018 Free Software 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/ipc.h>
+
+#define __IPC_64 0x100
+
+struct __old_ipc_perm
+{
+ __key_t __key; /* Key. */
+ int uid; /* Owner's user ID. */
+ int gid; /* Owner's group ID. */
+ int cuid; /* Creator's user ID. */
+ int cgid; /* Creator's group ID. */
+ int mode; /* Read/write permission. */
+ unsigned short int __seq; /* Sequence number. */
+};
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h b/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h
index 3d5a7399dd..ac9b092b2a 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libBrokenLocale.abilist
index 4a56bb68a3..54395f3c8d 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libcrypt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libdl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libdl.abilist
index b4c577e4a6..6d377d93a4 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 dlopen F
GLIBC_2.2 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
index 164ba55263..c19ee985a6 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _LIB_VERSION D 0x4
GLIBC_2.0 acos F
GLIBC_2.0 acosf F
@@ -155,7 +154,6 @@ GLIBC_2.0 y1l F
GLIBC_2.0 yn F
GLIBC_2.0 ynf F
GLIBC_2.0 ynl F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -237,11 +235,9 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __clog10 F
GLIBC_2.2 __clog10f F
GLIBC_2.2 __clog10l F
@@ -400,9 +396,639 @@ GLIBC_2.2 tgammal F
GLIBC_2.2 trunc F
GLIBC_2.2 truncf F
GLIBC_2.2 truncl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl 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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf128 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf128 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf128 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f128 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf128 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf128 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf128 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf128 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf128 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef128 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf128 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf128 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf128 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf128 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf128 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf128 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf128 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf128 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf128 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf128 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf128 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f128 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf128 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf128 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf128 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf128 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf128 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf128 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf128 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf128 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf128 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf128 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf128 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf128 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf128 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf128 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff128 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f128 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f128 F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf128 F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f128 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf128 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf128 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf128 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf128 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf128 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf128 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf128 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf128 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf128 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf128 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf128 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf128 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf128 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf128 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf128 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f128 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f128 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf128 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf128 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf128 F
+GLIBC_2.27 lgammaf128_r F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf128 F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf128 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf128 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f128 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf128 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f128 F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf128 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf128 F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf128 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf128 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff128 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf128 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf128 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf128 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf128 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf128 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf128 F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf128 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof128 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf128 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf128 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf128 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf128 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf128 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf128 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf128 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf128 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf128 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf128 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf128 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf128 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf128 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf128 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf128 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf128 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf128 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf128 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf128 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f128 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f128 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf128 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libnsl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libnsl.abilist
index d5b6e6997d..8675e27a8a 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __free_fdresult F
GLIBC_2.2 __nis_default_access F
GLIBC_2.2 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
index ad55bdd0e2..02144967c6 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_flockfile F
GLIBC_2.0 _IO_ftrylockfile F
GLIBC_2.0 _IO_funlockfile F
@@ -119,18 +118,14 @@ GLIBC_2.0 vfork F
GLIBC_2.0 wait F
GLIBC_2.0 waitpid F
GLIBC_2.0 write F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __libc_allocate_rtsig F
GLIBC_2.2 __libc_current_sigrtmax F
GLIBC_2.2 __libc_current_sigrtmin F
@@ -209,18 +204,35 @@ GLIBC_2.2 sem_timedwait F
GLIBC_2.2 sem_trywait F
GLIBC_2.2 sem_unlink F
GLIBC_2.2 sem_wait F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -238,13 +250,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
index ff77db947e..84837c8a2e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 aio_cancel F
GLIBC_2.2 aio_cancel64 F
GLIBC_2.2 aio_error F
@@ -28,7 +27,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -39,8 +37,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libthread_db.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist
index 89c67755c4..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
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/lxstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
index 3d175d0391..64d3664f98 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
@@ -1,5 +1,5 @@
/* lxstat64 using 64-bit MIPS lstat system call.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c b/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
index c4dc7ff4c8..5c0245f17f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software 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,18 +15,11 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <sys/msg.h>
-#include <ipc_priv.h>
-#include <sysdep.h>
+#include <shlib-compat.h>
-int __msgctl (int msqid, int cmd, struct msqid_ds *buf);
+#undef SHLIB_COMPAT
+#define SHLIB_COMPAT(a, b, c) 0
-int
-__msgctl (int msqid, int cmd, struct msqid_ds *buf)
-{
- return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, buf);
-}
+#define DEFAULT_VERSION GLIBC_2_0
-#include <shlib-compat.h>
-versioned_symbol (libc, __msgctl, msgctl, GLIBC_2_0);
+#include <sysdeps/unix/sysv/linux/msgctl.c>
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/fcntl.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c
deleted file mode 100644
index ea951bc4f9..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h
new file mode 100644
index 0000000000..ed0f1232de
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 288
+#define SIGJMP_BUF_SIZE 288
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 152
+#define SAVED_MASK_OFFSET 156
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
index 6993e70bfa..55d48868e8 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
@@ -1,14 +1,9 @@
-GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
GLIBC_2.0 _r_debug D 0x14
GLIBC_2.0 calloc F
GLIBC_2.0 free F
GLIBC_2.0 malloc F
GLIBC_2.0 realloc F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __libc_stack_end D 0x4
GLIBC_2.2 _dl_mcount F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 14e12364ef..f89b44f3a1 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -1312,7 +1310,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1338,7 +1335,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -1346,22 +1342,18 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1370,7 +1362,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -1381,19 +1372,15 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.19 GLIBC_2.19 A
GLIBC_2.19 getrlimit64 F
GLIBC_2.19 setrlimit64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _Exit F
GLIBC_2.2 _IO_2_1_stderr_ D 0xa0
GLIBC_2.2 _IO_2_1_stdin_ D 0xa0
@@ -1911,33 +1898,81 @@ GLIBC_2.2 xdr_uint32_t F
GLIBC_2.2 xdr_uint64_t F
GLIBC_2.2 xdr_uint8_t F
GLIBC_2.2 xdr_unixcred F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf128 F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof128 F
+GLIBC_2.27 strtof128_l F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof128 F
+GLIBC_2.27 wcstof128_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2027,7 +2062,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2040,7 +2074,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x200
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2061,7 +2094,6 @@ GLIBC_2.3.3 sched_setaffinity F
GLIBC_2.3.3 semtimedop F
GLIBC_2.3.3 sys_sigabbrev D 0x200
GLIBC_2.3.3 sys_siglist D 0x200
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2091,7 +2123,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2164,7 +2195,6 @@ GLIBC_2.4 renameat F
GLIBC_2.4 symlinkat F
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2182,7 +2212,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2190,7 +2219,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2217,7 +2245,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2228,7 +2255,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libresolv.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libresolv.abilist
index 4d50e7c8c6..157a33ce35 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/lseek.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/lseek.c
new file mode 100644
index 0000000000..2180b52abc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/lseek.c
@@ -0,0 +1,36 @@
+/* MIPS n32 lseek implementation.
+ Copyright (C) 2017-2018 Free Software 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 <sys/types.h>
+#include <errno.h>
+
+off_t
+__lseek (int fd, off_t offset, int whence)
+{
+ off64_t res = __lseek64 (fd, offset, whence);
+ if (res != (off_t) res)
+ {
+ __set_errno (EOVERFLOW);
+ return (off_t) -1;
+ }
+ return (off_t) res;
+}
+libc_hidden_def (__lseek)
+weak_alias (__lseek, lseek)
+strong_alias (__lseek, __libc_lseek)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/mmap.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/mmap.c
deleted file mode 100644
index 7afe776c7d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/mmap.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* mmap for MIPS n32.
- 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/types.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <stdint.h>
-#include <sysdep.h>
-
-__ptr_t
-__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
-{
- /* To handle negative offsets consistently with other architectures,
- the offset must be zero-extended to 64-bit. */
- uint64_t offset_adj = (uint64_t) (uint32_t) offset;
- return (__ptr_t) INLINE_SYSCALL (mmap, 6, addr, len, prot, flags, fd,
- offset_adj);
-}
-
-weak_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/mmap_internal.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/mmap_internal.h
new file mode 100644
index 0000000000..b40505acbb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/mmap_internal.h
@@ -0,0 +1,28 @@
+/* Common mmap definition for Linux implementation. MIPS n32 version.
+ Copyright (C) 2016-2018 Free Software 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 MMAP_MIPS_N32_INTERNAL_H
+#define MMAP_MIPS_N32_INTERNAL_H
+
+/* To handle negative offsets consistently with other architectures,
+ the offset must be zero-extended to 64-bit. */
+#define MMAP_ADJUST_OFFSET(offset) (uint64_t) (uint32_t) offset
+
+#include_next <mmap_internal.h>
+
+#endif
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..9e6a584685 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
@@ -1,9 +1,8 @@
# File name Caller Syscall name # args Strong name Weak names
-mmap64 - mmap b:aniiii __mmap64 mmap64
-
-readahead - readahead i:iii __readahead readahead
-sync_file_range - sync_file_range Ci:iiii sync_file_range
+# C syscall macros cannot be used because this syscall has a 64-bit
+# return value.
+lseek64 - lseek i:iii __lseek64 __libc_lseek64 lseek64@@GLIBC_2.2 llseek@GLIBC_2.0:GLIBC_2.28
prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index 466dcdef80..8e3117d7a7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -295,6 +295,23 @@
#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
"$14", "$15", "$24", "$25", "hi", "lo", "memory"
+
+/* Standard MIPS syscalls have an error flag, and return a positive errno
+ when the error flag is set. Emulate this behaviour for vsyscalls so that
+ the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly. */
+#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \
+ ({ \
+ long _ret = funcptr (args); \
+ err = ((unsigned long) (_ret) >= (unsigned long) -4095L); \
+ if (err) \
+ _ret = -_ret; \
+ _ret; \
+ })
+
+/* List of system calls which are supported as vsyscalls. */
+#define HAVE_CLOCK_GETTIME_VSYSCALL 1
+#define HAVE_GETTIMEOFDAY_VSYSCALL 1
+
#endif /* __ASSEMBLER__ */
/* Pointer mangling is not yet supported for MIPS. */
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/glob64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c
deleted file mode 100644
index 33918ea6a5..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* glob64 is in glob.c */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
index 6d2e0af91e..67c5905673 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
@@ -1,4 +1,4 @@
-/* Copyright 2003-2016 Free Software Foundation, Inc.
+/* Copyright 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,4 +38,5 @@ L(error):
PSEUDO_END (__ioctl)
+libc_hidden_def (__ioctl)
weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h
new file mode 100644
index 0000000000..38b5b0636a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 304
+#define SIGJMP_BUF_SIZE 304
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 168
+#define SAVED_MASK_OFFSET 176
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
index 759e99b00c..44b345b7cf 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
@@ -1,14 +1,9 @@
-GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
GLIBC_2.0 _r_debug D 0x28
GLIBC_2.0 calloc F
GLIBC_2.0 free F
GLIBC_2.0 malloc F
GLIBC_2.0 realloc F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __libc_stack_end D 0x8
GLIBC_2.2 _dl_mcount F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __stack_chk_guard D 0x8
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index 53e0c9a350..1486af11d7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -1310,7 +1308,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1336,7 +1333,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -1344,22 +1340,18 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1368,7 +1360,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -1379,16 +1370,13 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _Exit F
GLIBC_2.2 _IO_2_1_stderr_ D 0xe0
GLIBC_2.2 _IO_2_1_stdin_ D 0xe0
@@ -1906,33 +1894,80 @@ GLIBC_2.2 xdr_uint32_t F
GLIBC_2.2 xdr_uint64_t F
GLIBC_2.2 xdr_uint8_t F
GLIBC_2.2 xdr_unixcred F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf128 F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof128 F
+GLIBC_2.27 strtof128_l F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof128 F
+GLIBC_2.27 wcstof128_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2020,7 +2055,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2033,7 +2067,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x400
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2055,7 +2088,6 @@ GLIBC_2.3.3 strtoll_l F
GLIBC_2.3.3 strtoull_l F
GLIBC_2.3.3 sys_sigabbrev D 0x400
GLIBC_2.3.3 sys_siglist D 0x400
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2085,7 +2117,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2158,7 +2189,6 @@ GLIBC_2.4 renameat F
GLIBC_2.4 symlinkat F
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2176,7 +2206,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2184,7 +2213,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2211,7 +2239,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2222,7 +2249,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libresolv.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libresolv.abilist
index 2d92a35e81..06f995151c 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/mmap64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/mmap64.c
deleted file mode 100644
index 0dbd384a6a..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/mmap64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* mmap64 is the same as mmap. */
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..28624b6311 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,35 @@
-/* posix_fadvise64 is in posix_fadvise.c */
+/* Copyright (C) 2003-2018 Free Software 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);
+#else
+_weak_alias (posix_fadvise, posix_fadvise64);
+#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/preadv64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c
deleted file mode 100644
index fd9320cfc7..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty since the preadv syscall is equivalent. */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c
deleted file mode 100644
index 8b72a2928b..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty since the pwritev syscall is equivalent. */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
index 890a74494a..8e7d516a2a 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
@@ -1,9 +1,5 @@
# File name Caller Syscall name # args Strong name Weak names
-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/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index db8b237eb7..c9046a06b8 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -291,6 +291,23 @@
#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
"$14", "$15", "$24", "$25", "hi", "lo", "memory"
+
+/* Standard MIPS syscalls have an error flag, and return a positive errno
+ when the error flag is set. Emulate this behaviour for vsyscalls so that
+ the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly. */
+#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \
+ ({ \
+ long _ret = funcptr (args); \
+ err = ((unsigned long) (_ret) >= (unsigned long) -4095L); \
+ if (err) \
+ _ret = -_ret; \
+ _ret; \
+ })
+
+/* List of system calls which are supported as vsyscalls. */
+#define HAVE_CLOCK_GETTIME_VSYSCALL 1
+#define HAVE_GETTIMEOFDAY_VSYSCALL 1
+
#endif /* __ASSEMBLER__ */
/* Pointer mangling is not yet supported for MIPS. */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/recv.c b/sysdeps/unix/sysv/linux/mips/mips64/recv.c
deleted file mode 100644
index b910525c92..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/recv.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/x86_64/recv.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/semctl.c b/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
index 1115a25a51..4987ed63e0 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software 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,39 +15,11 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stdarg.h>
-#include <sys/sem.h>
-#include <ipc_priv.h>
-#include <sysdep.h>
-
-/* Define a `union semun' suitable for Linux here. */
-union semun
-{
- int val; /* value for SETVAL */
- struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
- unsigned short int *array; /* array for GETALL & SETALL */
- struct seminfo *__buf; /* buffer for IPC_INFO */
-};
-
-int __semctl (int semid, int semnum, int cmd, ...);
-
-int
-__semctl (int semid, int semnum, int cmd, ...)
-{
- union semun arg;
- va_list ap;
-
- va_start (ap, cmd);
-
- /* Get the argument. */
- arg = va_arg (ap, union semun);
+#include <shlib-compat.h>
- va_end (ap);
+#undef SHLIB_COMPAT
+#define SHLIB_COMPAT(a, b, c) 0
- return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
- arg.array);
-}
+#define DEFAULT_VERSION GLIBC_2_0
-#include <shlib-compat.h>
-versioned_symbol (libc, __semctl, semctl, GLIBC_2_0);
+#include <sysdeps/unix/sysv/linux/semctl.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/send.c b/sysdeps/unix/sysv/linux/mips/mips64/send.c
deleted file mode 100644
index d2c2996a21..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/send.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/x86_64/send.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c b/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
index ea0fa94d34..6a5c4fbd20 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software 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,18 +15,11 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <sys/shm.h>
-#include <ipc_priv.h>
-#include <sysdep.h>
+#include <shlib-compat.h>
-int __shmctl (int shmid, int cmd, struct shmid_ds *buf);
+#undef SHLIB_COMPAT
+#define SHLIB_COMPAT(a, b, c) 0
-int
-__shmctl (int shmid, int cmd, struct shmid_ds *buf)
-{
- return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, buf);
-}
+#define DEFAULT_VERSION GLIBC_2_0
-#include <shlib-compat.h>
-versioned_symbol (libc, __shmctl, shmctl, GLIBC_2_0);
+#include <./sysdeps/unix/sysv/linux/shmctl.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscall.S b/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
index 98d00c0bf3..1968b19a0a 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
+++ b/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
deleted file mode 100644
index 66cc687abb..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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
-
-# Semaphore and shm system calls. msgctl, shmctl, and semctl have C
-# wrappers (to set __IPC_64).
-msgget - msgget i:ii __msgget msgget
-msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
-msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
-shmat - shmat i:ipi __shmat shmat
-shmdt - shmdt i:s __shmdt shmdt
-shmget - shmget i:iii __shmget shmget
-semop - semop i:ipi __semop semop
-semtimedop - semtimedop i:ipip semtimedop
-semget - semget i:iii __semget semget
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
deleted file mode 100644
index daf75e7350..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
+++ /dev/null
@@ -1,249 +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 <sysdep.h>
-#include <sysdeps/generic/sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-#include <sys/asm.h>
-
-/* Gas will put the initial save of $gp into the CIE, because it appears to
- happen before any instructions. So we use cfi_same_value instead of
- cfi_restore. */
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-#ifdef __PIC__
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .align 2; \
- L(pseudo_start): \
- cfi_startproc; \
- cfi_adjust_cfa_offset (STKSPACE); \
- cfi_rel_offset (gp, STKOFF_GP); \
- 99: PTR_LA t9,__syscall_error; \
- /* manual cpreturn */ \
- REG_L gp, STKOFF_GP(sp); \
- cfi_same_value (gp); \
- RESTORESTK; \
- jr t9; \
- .type __##syscall_name##_nocancel, @function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- SAVESTK; \
- .cpsetup t9, STKOFF_GP, __##syscall_name##_nocancel; \
- cfi_rel_offset (gp, STKOFF_GP); \
- li v0, SYS_ify(syscall_name); \
- syscall; \
- bne a3, zero, SYSCALL_ERROR_LABEL; \
- /* manual cpreturn */ \
- REG_L gp, STKOFF_GP(sp); \
- cfi_same_value (gp); \
- RESTORESTK; \
- ret; \
- cfi_endproc; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
- ENTRY (name) \
- SAVESTK; \
- .cpsetup t9, STKOFF_GP, name; \
- cfi_rel_offset (gp, STKOFF_GP); \
- SINGLE_THREAD_P(v1); \
- bne zero, v1, L(pseudo_cancel); \
- .set noreorder; \
- li v0, SYS_ify(syscall_name); \
- syscall; \
- .set reorder; \
- bne a3, zero, SYSCALL_ERROR_LABEL; \
- /* manual cpreturn */ \
- REG_L gp, STKOFF_GP(sp); \
- cfi_same_value (gp); \
- RESTORESTK; \
- ret; \
- L(pseudo_cancel): \
- cfi_adjust_cfa_offset (STKSPACE); \
- cfi_rel_offset (gp, STKOFF_GP); \
- REG_S ra, STKOFF_RA(sp); \
- cfi_rel_offset (ra, STKOFF_RA); \
- PUSHARGS_##args; /* save syscall args */ \
- CENABLE; \
- REG_S v0, STKOFF_SVMSK(sp); /* save mask */ \
- POPARGS_##args; /* restore syscall args */ \
- .set noreorder; \
- li v0, SYS_ify (syscall_name); \
- syscall; \
- .set reorder; \
- REG_S v0, STKOFF_SC_V0(sp); /* save syscall result */ \
- REG_S a3, STKOFF_SC_ERR(sp); /* save syscall error flag */ \
- REG_L a0, STKOFF_SVMSK(sp); /* pass mask as arg1 */ \
- CDISABLE; \
- REG_L a3, STKOFF_SC_ERR(sp); /* restore syscall error flag */ \
- REG_L ra, STKOFF_RA(sp); /* restore return address */ \
- REG_L v0, STKOFF_SC_V0(sp); /* restore syscall result */ \
- bne a3, zero, SYSCALL_ERROR_LABEL; \
- /* manual cpreturn */ \
- REG_L gp, STKOFF_GP(sp); \
- cfi_same_value (gp); \
- RESTORESTK; \
- L(pseudo_end):
-#else
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .align 2; \
- L(pseudo_start): \
- cfi_startproc; \
- cfi_adjust_cfa_offset (STKSPACE); \
- 99: RESTORESTK; \
- j __syscall_error; \
- .type __##syscall_name##_nocancel, @function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- SAVESTK; \
- li v0, SYS_ify(syscall_name); \
- syscall; \
- bne a3, zero, SYSCALL_ERROR_LABEL; \
- RESTORESTK; \
- ret; \
- cfi_endproc; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
- ENTRY (name) \
- SAVESTK; \
- SINGLE_THREAD_P(v1); \
- bne zero, v1, L(pseudo_cancel); \
- .set noreorder; \
- li v0, SYS_ify(syscall_name); \
- syscall; \
- .set reorder; \
- bne a3, zero, SYSCALL_ERROR_LABEL; \
- RESTORESTK; \
- ret; \
- L(pseudo_cancel): \
- cfi_adjust_cfa_offset (STKSPACE); \
- REG_S ra, STKOFF_RA(sp); \
- cfi_rel_offset (ra, STKOFF_RA); \
- PUSHARGS_##args; /* save syscall args */ \
- CENABLE; \
- REG_S v0, STKOFF_SVMSK(sp); /* save mask */ \
- POPARGS_##args; /* restore syscall args */ \
- .set noreorder; \
- li v0, SYS_ify (syscall_name); \
- syscall; \
- .set reorder; \
- REG_S v0, STKOFF_SC_V0(sp); /* save syscall result */ \
- REG_S a3, STKOFF_SC_ERR(sp); /* save syscall error flag */ \
- REG_L a0, STKOFF_SVMSK(sp); /* pass mask as arg1 */ \
- CDISABLE; \
- REG_L a3, STKOFF_SC_ERR(sp); /* restore syscall error flag */ \
- REG_L ra, STKOFF_RA(sp); /* restore return address */ \
- REG_L v0, STKOFF_SC_V0(sp); /* restore syscall result */ \
- bne a3, zero, SYSCALL_ERROR_LABEL; \
- RESTORESTK; \
- L(pseudo_end):
-#endif
-
-# undef PSEUDO_END
-# define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
-
-# define PUSHARGS_0 /* nothing to do */
-# define PUSHARGS_1 PUSHARGS_0 REG_S a0, STKOFF_A0(sp); cfi_rel_offset (a0, STKOFF_A0);
-# define PUSHARGS_2 PUSHARGS_1 REG_S a1, STKOFF_A1(sp); cfi_rel_offset (a1, STKOFF_A1);
-# define PUSHARGS_3 PUSHARGS_2 REG_S a2, STKOFF_A2(sp); cfi_rel_offset (a2, STKOFF_A2);
-# define PUSHARGS_4 PUSHARGS_3 REG_S a3, STKOFF_A3(sp); cfi_rel_offset (a3, STKOFF_A3);
-# define PUSHARGS_5 PUSHARGS_4 REG_S a4, STKOFF_A4(sp); cfi_rel_offset (a3, STKOFF_A4);
-# define PUSHARGS_6 PUSHARGS_5 REG_S a5, STKOFF_A5(sp); cfi_rel_offset (a3, STKOFF_A5);
-
-# define POPARGS_0 /* nothing to do */
-# define POPARGS_1 POPARGS_0 REG_L a0, STKOFF_A0(sp);
-# define POPARGS_2 POPARGS_1 REG_L a1, STKOFF_A1(sp);
-# define POPARGS_3 POPARGS_2 REG_L a2, STKOFF_A2(sp);
-# define POPARGS_4 POPARGS_3 REG_L a3, STKOFF_A3(sp);
-# define POPARGS_5 POPARGS_4 REG_L a4, STKOFF_A4(sp);
-# define POPARGS_6 POPARGS_5 REG_L a5, STKOFF_A5(sp);
-
-/* Save an even number of slots. Should be 0 if an even number of slots
- are used below, or SZREG if an odd number are used. */
-# ifdef __PIC__
-# define STK_PAD SZREG
-# else
-# define STK_PAD 0
-# endif
-
-/* Place values that we are more likely to use later in this sequence, i.e.
- closer to the SP at function entry. If you do that, the are more
- likely to already be in your d-cache. */
-# define STKOFF_A5 (STK_PAD)
-# define STKOFF_A4 (STKOFF_A5 + SZREG)
-# define STKOFF_A3 (STKOFF_A4 + SZREG)
-# define STKOFF_A2 (STKOFF_A3 + SZREG) /* MT and more args. */
-# define STKOFF_A1 (STKOFF_A2 + SZREG) /* MT and 2 args. */
-# define STKOFF_A0 (STKOFF_A1 + SZREG) /* MT and 1 arg. */
-# define STKOFF_RA (STKOFF_A0 + SZREG) /* Used if MT. */
-# define STKOFF_SC_V0 (STKOFF_RA + SZREG) /* Used if MT. */
-# define STKOFF_SC_ERR (STKOFF_SC_V0 + SZREG) /* Used if MT. */
-# define STKOFF_SVMSK (STKOFF_SC_ERR + SZREG) /* Used if MT. */
-
-# ifdef __PIC__
-# define STKOFF_GP (STKOFF_SVMSK + SZREG) /* Always used. */
-# define STKSPACE (STKOFF_GP + SZREG)
-# else
-# define STKSPACE (STKOFF_SVMSK + SZREG)
-# endif
-
-# define SAVESTK PTR_SUBU sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE)
-# define RESTORESTK PTR_ADDU sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE)
-
-# ifdef __PIC__
-# define PSEUDO_JMP(sym) PTR_LA t9, sym; jalr t9
-# else
-# define PSEUDO_JMP(sym) jal sym
-# endif
-
-# if IS_IN (libpthread)
-# define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__pthread_disable_asynccancel)
-# elif IS_IN (librt)
-# define CENABLE PSEUDO_JMP (__librt_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__librt_disable_asynccancel)
-# else
-# define CENABLE PSEUDO_JMP (__libc_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__libc_disable_asynccancel)
-# endif
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) \
- == 0, 1)
-# else
-# define SINGLE_THREAD_P(reg) \
- READ_THREAD_POINTER(reg); \
- lw reg, MULTIPLE_THREADS_OFFSET(reg)
-#endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/truncate64.c b/sysdeps/unix/sysv/linux/mips/mips64/truncate64.c
deleted file mode 100644
index 6e25b021ab..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/truncate64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty. */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/umount.c b/sysdeps/unix/sysv/linux/mips/mips64/umount.c
deleted file mode 100644
index 133ca11a39..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/umount.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Huggins-Daines <dhd@debian.org>, 2000.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-/* Since we don't have an oldumount system call, do what the kernel
- does down here. */
-
-extern long int __umount2 (const char *name, int flags);
-
-long int
-__umount (const char *name)
-{
- return __umount2 (name, 0);
-}
-
-weak_alias (__umount, umount);
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
index 27407df5e9..29821aca00 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
@@ -1,5 +1,5 @@
/* xstat64 using 64-bit MIPS stat system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/pread.c b/sysdeps/unix/sysv/linux/mips/pread.c
deleted file mode 100644
index 02755cbc9d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/pread.c
+++ /dev/null
@@ -1,54 +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/>. */
-
-#include <assert.h>
-#include <errno.h>
-#ifndef NO_SGIDEFS_H
-#include <sgidefs.h>
-#endif
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pread
-# error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
-#if _MIPS_SIM != _ABI64
- assert (sizeof (offset) == 4);
-#endif
-
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- return SYSCALL_CANCEL (pread, fd, buf, count, offset);
-#else
- return SYSCALL_CANCEL (pread, fd, buf, count, 0,
- __LONG_LONG_PAIR (offset >> 31, offset));
-#endif
-}
-
-strong_alias (__libc_pread, __pread)
-weak_alias (__libc_pread, pread)
diff --git a/sysdeps/unix/sysv/linux/mips/pread64.c b/sysdeps/unix/sysv/linux/mips/pread64.c
deleted file mode 100644
index ed0e91c451..0000000000
--- a/sysdeps/unix/sysv/linux/mips/pread64.c
+++ /dev/null
@@ -1,50 +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/>. */
-
-#include <errno.h>
-#ifndef NO_SGIDEFS_H
-#include <sgidefs.h>
-#endif
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pread
-# error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
-
-ssize_t
-__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- return SYSCALL_CANCEL (pread, fd, buf, count, offset);
-#else
- return SYSCALL_CANCEL (pread, fd, buf, count, 0,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
-#endif
-}
-
-weak_alias (__libc_pread64, __pread64)
-weak_alias (__libc_pread64, pread64)
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite.c b/sysdeps/unix/sysv/linux/mips/pwrite.c
deleted file mode 100644
index 31dea3aa73..0000000000
--- a/sysdeps/unix/sysv/linux/mips/pwrite.c
+++ /dev/null
@@ -1,54 +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/>. */
-
-#include <assert.h>
-#include <errno.h>
-#ifndef NO_SGIDEFS_H
-#include <sgidefs.h>
-#endif
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pwrite
-# error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
-#if _MIPS_SIM != _ABI64
- assert (sizeof (offset) == 4);
-#endif
-
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- return SYSCALL_CANCEL (pwrite, fd, buf, count, offset);
-#else
- return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
- __LONG_LONG_PAIR (offset >> 31, offset));
-#endif
-}
-
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__libc_pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite64.c b/sysdeps/unix/sysv/linux/mips/pwrite64.c
deleted file mode 100644
index 1905c57f69..0000000000
--- a/sysdeps/unix/sysv/linux/mips/pwrite64.c
+++ /dev/null
@@ -1,51 +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/>. */
-
-#include <errno.h>
-#ifndef NO_SGIDEFS_H
-#include <sgidefs.h>
-#endif
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pwrite
-# error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
-
-ssize_t
-__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- return SYSCALL_CANCEL (pwrite, fd, buf, count, offset);
-#else
- return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
-#endif
-}
-
-weak_alias (__libc_pwrite64, __pwrite64)
-libc_hidden_weak (__pwrite64)
-weak_alias (__libc_pwrite64, pwrite64)
diff --git a/sysdeps/unix/sysv/linux/mips/readelflib.c b/sysdeps/unix/sysv/linux/mips/readelflib.c
index bb607256cf..2c4c26db42 100644
--- a/sysdeps/unix/sysv/linux/mips/readelflib.c
+++ b/sysdeps/unix/sysv/linux/mips/readelflib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Alexandre Oliva <aoliva@redhat.com>
Based on work ../x86_64/readelflib.c,
diff --git a/sysdeps/unix/sysv/linux/mips/register-dump.h b/sysdeps/unix/sysv/linux/mips/register-dump.h
index 24cce3ec00..f1cb544044 100644
--- a/sysdeps/unix/sysv/linux/mips/register-dump.h
+++ b/sysdeps/unix/sysv/linux/mips/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
diff --git a/sysdeps/unix/sysv/linux/mips/setcontext.S b/sysdeps/unix/sysv/linux/mips/setcontext.S
index bcb4110e09..d71b16ceb1 100644
--- a/sysdeps/unix/sysv/linux/mips/setcontext.S
+++ b/sysdeps/unix/sysv/linux/mips/setcontext.S
@@ -1,5 +1,5 @@
/* Set current context.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
@@ -47,6 +47,12 @@ A0OFF = FRAMESZ - (1 * SZREG) /* callee-allocated */
#else
A0OFF = FRAMESZ + (0 * SZREG) /* caller-allocated */
#endif
+MCONTEXT_GREGSZ = 8
+#if _MIPS_SIM == _ABIO32 && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+MCONTEXT_GREGOFF = 4
+#else
+MCONTEXT_GREGOFF = 0
+#endif
NESTED (__setcontext, FRAMESZ, ra)
.mask MASK, -(ARGSZ * SZREG)
@@ -73,7 +79,8 @@ NESTED (__setcontext, FRAMESZ, ra)
/* Check for the magic flag. */
li v0, 1
- REG_L v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */
+ /* zero */
+ REG_L v1, (MCONTEXT_GREGOFF + 0 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
bne v0, v1, 98f
REG_S a0, A0OFF(sp)
@@ -117,32 +124,32 @@ NESTED (__setcontext, FRAMESZ, ra)
/* Note the contents of argument registers will be random
unless makecontext() has been called. */
- REG_L a0, (4 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a1, (5 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a2, (6 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a3, (7 * SZREG + MCONTEXT_GREGS)(v0)
+ REG_L a0, (MCONTEXT_GREGOFF + 4 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a1, (MCONTEXT_GREGOFF + 5 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a2, (MCONTEXT_GREGOFF + 6 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a3, (MCONTEXT_GREGOFF + 7 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
#if _MIPS_SIM != _ABIO32
- REG_L a4, (8 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a5, (9 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a6, (10 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a7, (11 * SZREG + MCONTEXT_GREGS)(v0)
+ REG_L a4, (MCONTEXT_GREGOFF + 8 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a5, (MCONTEXT_GREGOFF + 9 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a6, (MCONTEXT_GREGOFF + 10 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a7, (MCONTEXT_GREGOFF + 11 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
#endif
- REG_L s0, (16 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s1, (17 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s2, (18 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s3, (19 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s4, (20 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s5, (21 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s6, (22 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s7, (23 * SZREG + MCONTEXT_GREGS)(v0)
+ REG_L s0, (MCONTEXT_GREGOFF + 16 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s1, (MCONTEXT_GREGOFF + 17 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s2, (MCONTEXT_GREGOFF + 18 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s3, (MCONTEXT_GREGOFF + 19 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s4, (MCONTEXT_GREGOFF + 20 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s5, (MCONTEXT_GREGOFF + 21 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s6, (MCONTEXT_GREGOFF + 22 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s7, (MCONTEXT_GREGOFF + 23 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
- REG_L gp, (28 * SZREG + MCONTEXT_GREGS)(v0)
+ REG_L gp, (MCONTEXT_GREGOFF + 28 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
#endif
- REG_L sp, (29 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L fp, (30 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L ra, (31 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L t9, MCONTEXT_PC(v0)
+ REG_L sp, (MCONTEXT_GREGOFF + 29 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L fp, (MCONTEXT_GREGOFF + 30 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L ra, (MCONTEXT_GREGOFF + 31 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L t9, (MCONTEXT_GREGOFF + MCONTEXT_PC)(v0)
move v0, zero
jr t9
diff --git a/sysdeps/unix/sysv/linux/mips/setrlimit64.c b/sysdeps/unix/sysv/linux/mips/setrlimit64.c
index 2c0fde079e..d806a7e08b 100644
--- a/sysdeps/unix/sysv/linux/mips/setrlimit64.c
+++ b/sysdeps/unix/sysv/linux/mips/setrlimit64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/sigaction.c b/sysdeps/unix/sysv/linux/mips/sigaction.c
deleted file mode 100644
index a9383a1e5d..0000000000
--- a/sysdeps/unix/sysv/linux/mips/sigaction.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* 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 <errno.h>
-#include <sgidefs.h>
-#include <signal.h>
-#include <string.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-#include <sgidefs.h>
-
-/* The difference here is that the sigaction structure used in the
- kernel is not the same as we use in the libc. Therefore we must
- translate it here. */
-#include <kernel_sigaction.h>
-
-#if _MIPS_SIM != _ABIO32
-
-# ifdef __NR_rt_sigreturn
-static void restore_rt (void) asm ("__restore_rt");
-# endif
-# ifdef __NR_sigreturn
-static void restore (void) asm ("__restore");
-# endif
-#endif
-
-/* If ACT is not NULL, change the action for SIG to *ACT.
- If OACT is not NULL, put the old action for SIG in *OACT. */
-int
-__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
-{
- int result;
-
- struct kernel_sigaction kact, koact;
-
- if (act)
- {
- kact.k_sa_handler = act->sa_handler;
- memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kernel_sigset_t));
- kact.sa_flags = act->sa_flags;
-#ifdef HAVE_SA_RESTORER
-# if _MIPS_SIM == _ABIO32
- kact.sa_restorer = act->sa_restorer;
-# else
- kact.sa_restorer = &restore_rt;
-# endif
-#endif
- }
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- result = INLINE_SYSCALL (rt_sigaction, 4, sig,
- act ? &kact : NULL,
- oact ? &koact : NULL,
- sizeof (kernel_sigset_t));
-
- if (oact && result >= 0)
- {
- oact->sa_handler = koact.k_sa_handler;
- memcpy (&oact->sa_mask, &koact.sa_mask,
- sizeof (kernel_sigset_t));
- oact->sa_flags = koact.sa_flags;
-#ifdef HAVE_SA_RESTORER
- oact->sa_restorer = koact.sa_restorer;
-#endif
- }
- return result;
-}
-libc_hidden_def (__libc_sigaction)
-
-#include <nptl/sigaction.c>
-
-
-/* NOTE: Please think twice before making any changes to the bits of
- code below. GDB needs some intimate knowledge about it to
- recognize them as signal trampolines, and make backtraces through
- signal handlers work right. Important are both the names
- (__restore_rt) and the exact instruction sequence.
- If you ever feel the need to make any changes, please notify the
- appropriate GDB maintainer. */
-
-#define RESTORE(name, syscall) RESTORE2 (name, syscall)
-#define RESTORE2(name, syscall) \
-asm \
- ( \
- ".align 4\n" \
- "__" #name ":\n" \
- " li $2, " #syscall "\n" \
- " syscall\n" \
- );
-
-/* The return code for realtime-signals. */
-#if _MIPS_SIM != _ABIO32
-# ifdef __NR_rt_sigreturn
-RESTORE (restore_rt, __NR_rt_sigreturn)
-# endif
-# ifdef __NR_sigreturn
-RESTORE (restore, __NR_sigreturn)
-# endif
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h b/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h
index 8ad56db9b9..fb6e71b662 100644
--- a/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
@@ -22,21 +22,11 @@
#if _MIPS_SIM == _ABIO32
#define SIGCONTEXT unsigned long _code, struct sigcontext *
-#define SIGCONTEXT_EXTRA_ARGS _code,
#define GET_PC(ctx) ((void *) (unsigned long) ctx->sc_pc)
-#define GET_FRAME(ctx) ((void *) (unsigned long) ctx->sc_regs[30])
-#define GET_STACK(ctx) ((void *) (unsigned long) ctx->sc_regs[29])
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
#else
#define SIGCONTEXT unsigned long _code, ucontext_t *
-#define SIGCONTEXT_EXTRA_ARGS _code,
#define GET_PC(ctx) ((void *) (unsigned long) ctx->uc_mcontext.pc)
-#define GET_FRAME(ctx) ((void *) (unsigned long) ctx->uc_mcontext.gregs[30])
-#define GET_STACK(ctx) ((void *) (unsigned long) ctx->uc_mcontext.gregs[29])
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
#endif
diff --git a/sysdeps/unix/sysv/linux/mips/swapcontext.S b/sysdeps/unix/sysv/linux/mips/swapcontext.S
index 24198721fe..2051ed3e76 100644
--- a/sysdeps/unix/sysv/linux/mips/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/mips/swapcontext.S
@@ -1,5 +1,5 @@
/* Save and set current context.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
@@ -47,6 +47,12 @@ A1OFF = FRAMESZ - (1 * SZREG) /* callee-allocated */
#else
A1OFF = FRAMESZ + (1 * SZREG) /* caller-allocated */
#endif
+MCONTEXT_GREGSZ = 8
+#if _MIPS_SIM == _ABIO32 && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+MCONTEXT_GREGOFF = 4
+#else
+MCONTEXT_GREGOFF = 0
+#endif
NESTED (__swapcontext, FRAMESZ, ra)
.mask MASK, -(ARGSZ * SZREG)
@@ -83,23 +89,24 @@ NESTED (__swapcontext, FRAMESZ, ra)
/* Store a magic flag. */
li v1, 1
- REG_S v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */
-
- REG_S s0, (16 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s1, (17 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s2, (18 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s3, (19 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s4, (20 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s5, (21 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s6, (22 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S s7, (23 * SZREG + MCONTEXT_GREGS)(a0)
+ /* zero */
+ REG_S v1, (MCONTEXT_GREGOFF + 0 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+
+ REG_S s0, (MCONTEXT_GREGOFF + 16 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s1, (MCONTEXT_GREGOFF + 17 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s2, (MCONTEXT_GREGOFF + 18 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s3, (MCONTEXT_GREGOFF + 19 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s4, (MCONTEXT_GREGOFF + 20 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s5, (MCONTEXT_GREGOFF + 21 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s6, (MCONTEXT_GREGOFF + 22 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S s7, (MCONTEXT_GREGOFF + 23 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
- REG_S _GP, (28 * SZREG + MCONTEXT_GREGS)(a0)
+ REG_S _GP, (MCONTEXT_GREGOFF + 28 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
#endif
- REG_S _SP, (29 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S fp, (30 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S ra, (31 * SZREG + MCONTEXT_GREGS)(a0)
- REG_S ra, MCONTEXT_PC(a0)
+ REG_S _SP, (MCONTEXT_GREGOFF + 29 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S fp, (MCONTEXT_GREGOFF + 30 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S ra, (MCONTEXT_GREGOFF + 31 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(a0)
+ REG_S ra, (MCONTEXT_GREGOFF + MCONTEXT_PC)(a0)
#ifdef __mips_hard_float
# if _MIPS_SIM == _ABI64
@@ -167,32 +174,32 @@ NESTED (__swapcontext, FRAMESZ, ra)
/* Note the contents of argument registers will be random
unless makecontext() has been called. */
- REG_L a0, (4 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a1, (5 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a2, (6 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a3, (7 * SZREG + MCONTEXT_GREGS)(v0)
+ REG_L a0, (MCONTEXT_GREGOFF + 4 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a1, (MCONTEXT_GREGOFF + 5 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a2, (MCONTEXT_GREGOFF + 6 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a3, (MCONTEXT_GREGOFF + 7 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
#if _MIPS_SIM != _ABIO32
- REG_L a4, (8 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a5, (9 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a6, (10 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L a7, (11 * SZREG + MCONTEXT_GREGS)(v0)
+ REG_L a4, (MCONTEXT_GREGOFF + 8 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a5, (MCONTEXT_GREGOFF + 9 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a6, (MCONTEXT_GREGOFF + 10 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L a7, (MCONTEXT_GREGOFF + 11 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
#endif
- REG_L s0, (16 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s1, (17 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s2, (18 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s3, (19 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s4, (20 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s5, (21 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s6, (22 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L s7, (23 * SZREG + MCONTEXT_GREGS)(v0)
+ REG_L s0, (MCONTEXT_GREGOFF + 16 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s1, (MCONTEXT_GREGOFF + 17 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s2, (MCONTEXT_GREGOFF + 18 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s3, (MCONTEXT_GREGOFF + 19 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s4, (MCONTEXT_GREGOFF + 20 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s5, (MCONTEXT_GREGOFF + 21 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s6, (MCONTEXT_GREGOFF + 22 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L s7, (MCONTEXT_GREGOFF + 23 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
- REG_L gp, (28 * SZREG + MCONTEXT_GREGS)(v0)
+ REG_L gp, (MCONTEXT_GREGOFF + 28 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
#endif
- REG_L sp, (29 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L fp, (30 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L ra, (31 * SZREG + MCONTEXT_GREGS)(v0)
- REG_L t9, MCONTEXT_PC(v0)
+ REG_L sp, (MCONTEXT_GREGOFF + 29 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L fp, (MCONTEXT_GREGOFF + 30 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L ra, (MCONTEXT_GREGOFF + 31 * MCONTEXT_GREGSZ + MCONTEXT_GREGS)(v0)
+ REG_L t9, (MCONTEXT_GREGOFF + MCONTEXT_PC)(v0)
move v0, zero
jr t9
diff --git a/sysdeps/unix/sysv/linux/mips/sys/cachectl.h b/sysdeps/unix/sysv/linux/mips/sys/cachectl.h
index b347ac4fcf..51d9fcd28f 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/cachectl.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/cachectl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/sys/procfs.h b/sysdeps/unix/sysv/linux/mips/sys/procfs.h
index 2de7eba456..2be0c7e818 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/sys/sysmips.h b/sysdeps/unix/sysv/linux/mips/sys/sysmips.h
index 7b91706430..2e488fa69e 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/sysmips.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/sysmips.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
index b5d2e2ab10..ac2f3866f7 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library.
+/* Copyright (C) 1997-2018 Free Software 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
@@ -20,33 +20,43 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
#include <sgidefs.h>
-#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
-#include <bits/sigcontext.h>
/* Type for general register. Even in o32 we assume 64-bit registers,
like the kernel. */
__extension__ typedef unsigned long long int greg_t;
/* Number of general registers. */
-#define NGREG 32
-#define NFPREG 32
+#define __NGREG 32
+#define __NFPREG 32
+#ifdef __USE_MISC
+# define NGREG __NGREG
+# define NFPREG __NFPREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
/* Container for all FPU registers. */
-typedef struct fpregset {
+typedef struct {
union {
- double fp_dregs[NFPREG];
+ double __ctx(fp_dregs)[__NFPREG];
struct {
float _fp_fregs;
unsigned int _fp_pad;
- } fp_fregs[NFPREG];
- } fp_r;
+ } __ctx(fp_fregs)[__NFPREG];
+ } __ctx(fp_r);
} fpregset_t;
@@ -59,54 +69,56 @@ typedef struct fpregset {
still be rectified. */
typedef struct
{
- unsigned int regmask;
- unsigned int status;
- greg_t pc;
- gregset_t gregs;
- fpregset_t fpregs;
- unsigned int fp_owned;
- unsigned int fpc_csr;
- unsigned int fpc_eir;
- unsigned int used_math;
- unsigned int dsp;
- greg_t mdhi;
- greg_t mdlo;
- unsigned long hi1;
- unsigned long lo1;
- unsigned long hi2;
- unsigned long lo2;
- unsigned long hi3;
- unsigned long lo3;
+ unsigned int __ctx(regmask);
+ unsigned int __ctx(status);
+ greg_t __ctx(pc);
+ gregset_t __ctx(gregs);
+ fpregset_t __ctx(fpregs);
+ unsigned int __ctx(fp_owned);
+ unsigned int __ctx(fpc_csr);
+ unsigned int __ctx(fpc_eir);
+ unsigned int __ctx(used_math);
+ unsigned int __ctx(dsp);
+ greg_t __ctx(mdhi);
+ greg_t __ctx(mdlo);
+ unsigned long __ctx(hi1);
+ unsigned long __ctx(lo1);
+ unsigned long __ctx(hi2);
+ unsigned long __ctx(lo2);
+ unsigned long __ctx(hi3);
+ unsigned long __ctx(lo3);
} mcontext_t;
#else
typedef struct
{
- gregset_t gregs;
- fpregset_t fpregs;
- greg_t mdhi;
- greg_t hi1;
- greg_t hi2;
- greg_t hi3;
- greg_t mdlo;
- greg_t lo1;
- greg_t lo2;
- greg_t lo3;
- greg_t pc;
- unsigned int fpc_csr;
- unsigned int used_math;
- unsigned int dsp;
- unsigned int reserved;
+ gregset_t __ctx(gregs);
+ fpregset_t __ctx(fpregs);
+ greg_t __ctx(mdhi);
+ greg_t __ctx(hi1);
+ greg_t __ctx(hi2);
+ greg_t __ctx(hi3);
+ greg_t __ctx(mdlo);
+ greg_t __ctx(lo1);
+ greg_t __ctx(lo2);
+ greg_t __ctx(lo3);
+ greg_t __ctx(pc);
+ unsigned int __ctx(fpc_csr);
+ unsigned int __ctx(used_math);
+ unsigned int __ctx(dsp);
+ unsigned int __glibc_reserved1;
} mcontext_t;
#endif
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
+ sigset_t uc_sigmask;
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/mips/sys/user.h b/sysdeps/unix/sysv/linux/mips/sys/user.h
index b240438d0a..506c742c04 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/user.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,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/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list
index db731b149a..f3621cdd51 100644
--- a/sysdeps/unix/sysv/linux/mips/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/syscalls.list
@@ -12,19 +12,11 @@ sysmips - sysmips i:iiii __sysmips sysmips
# Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper;
# it's provided for compatibility, though.
#
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
-connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
-recv - recv Ci:ibni __libc_recv __recv recv
-recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom
-recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg
-send - send Ci:ibni __libc_send __send send
-sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg
-sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
diff --git a/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h b/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
deleted file mode 100644
index 13c196f0d3..0000000000
--- a/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
+++ /dev/null
@@ -1,190 +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 <sysdep.h>
-#include <sysdeps/generic/sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# ifdef __PIC__
-# define PSEUDO_CPLOAD .cpload t9;
-# define PSEUDO_ERRJMP la t9, __syscall_error; jr t9;
-# define PSEUDO_SAVEGP sw gp, 32(sp); cfi_rel_offset (gp, 32);
-# define PSEUDO_LOADGP lw gp, 32(sp);
-# else
-# define PSEUDO_CPLOAD
-# define PSEUDO_ERRJMP j __syscall_error;
-# define PSEUDO_SAVEGP
-# define PSEUDO_LOADGP
-# endif
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .align 2; \
- .set nomips16; \
- L(pseudo_start): \
- cfi_startproc; \
- 99: PSEUDO_ERRJMP \
- .type __##syscall_name##_nocancel, @function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- .set noreorder; \
- PSEUDO_CPLOAD \
- li v0, SYS_ify(syscall_name); \
- syscall; \
- .set reorder; \
- bne a3, zero, 99b; \
- ret; \
- cfi_endproc; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
- ENTRY (name) \
- .set noreorder; \
- PSEUDO_CPLOAD \
- .set reorder; \
- SINGLE_THREAD_P(v1); \
- bne zero, v1, L(pseudo_cancel); \
- .set noreorder; \
- li v0, SYS_ify(syscall_name); \
- syscall; \
- .set reorder; \
- bne a3, zero, 99b; \
- ret; \
- L(pseudo_cancel): \
- SAVESTK_##args; \
- sw ra, 28(sp); \
- cfi_rel_offset (ra, 28); \
- PSEUDO_SAVEGP \
- PUSHARGS_##args; /* save syscall args */ \
- CENABLE; \
- PSEUDO_LOADGP \
- sw v0, 44(sp); /* save mask */ \
- POPARGS_##args; /* restore syscall args */ \
- .set noreorder; \
- li v0, SYS_ify (syscall_name); \
- syscall; \
- .set reorder; \
- sw v0, 36(sp); /* save syscall result */ \
- sw a3, 40(sp); /* save syscall error flag */ \
- lw a0, 44(sp); /* pass mask as arg1 */ \
- CDISABLE; \
- PSEUDO_LOADGP \
- lw v0, 36(sp); /* restore syscall result */ \
- lw a3, 40(sp); /* restore syscall error flag */ \
- lw ra, 28(sp); /* restore return address */ \
- .set noreorder; \
- bne a3, zero, 99b; \
- RESTORESTK; \
- L(pseudo_end): \
- .set reorder;
-
-# undef PSEUDO_END
-# define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
-
-# define PUSHARGS_0 /* nothing to do */
-# define PUSHARGS_1 PUSHARGS_0 sw a0, 0(sp); cfi_rel_offset (a0, 0);
-# define PUSHARGS_2 PUSHARGS_1 sw a1, 4(sp); cfi_rel_offset (a1, 4);
-# define PUSHARGS_3 PUSHARGS_2 sw a2, 8(sp); cfi_rel_offset (a2, 8);
-# define PUSHARGS_4 PUSHARGS_3 sw a3, 12(sp); cfi_rel_offset (a3, 12);
-# define PUSHARGS_5 PUSHARGS_4 /* handled by SAVESTK_## */
-# define PUSHARGS_6 PUSHARGS_5
-# define PUSHARGS_7 PUSHARGS_6
-
-# define POPARGS_0 /* nothing to do */
-# define POPARGS_1 POPARGS_0 lw a0, 0(sp);
-# define POPARGS_2 POPARGS_1 lw a1, 4(sp);
-# define POPARGS_3 POPARGS_2 lw a2, 8(sp);
-# define POPARGS_4 POPARGS_3 lw a3, 12(sp);
-# define POPARGS_5 POPARGS_4 /* args already in new stackframe */
-# define POPARGS_6 POPARGS_5
-# define POPARGS_7 POPARGS_6
-
-
-# define STKSPACE 48
-# define SAVESTK_0 subu sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE)
-# define SAVESTK_1 SAVESTK_0
-# define SAVESTK_2 SAVESTK_1
-# define SAVESTK_3 SAVESTK_2
-# define SAVESTK_4 SAVESTK_3
-# define SAVESTK_5 lw t0, 16(sp); \
- SAVESTK_0; \
- sw t0, 16(sp)
-
-# define SAVESTK_6 lw t0, 16(sp); \
- lw t1, 20(sp); \
- SAVESTK_0; \
- sw t0, 16(sp); \
- sw t1, 20(sp)
-
-# define SAVESTK_7 lw t0, 16(sp); \
- lw t1, 20(sp); \
- lw t2, 24(sp); \
- SAVESTK_0; \
- sw t0, 16(sp); \
- sw t1, 20(sp); \
- sw t2, 24(sp)
-
-# define RESTORESTK addu sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE)
-
-
-# ifdef __PIC__
-/* We use jalr rather than jal. This means that the assembler will not
- automatically restore $gp (in case libc has multiple GOTs) so we must
- do it manually - which we have to do anyway since we don't use .cprestore.
- It also shuts up the assembler warning about not using .cprestore. */
-# define PSEUDO_JMP(sym) la t9, sym; jalr t9;
-# else
-# define PSEUDO_JMP(sym) jal sym;
-# endif
-
-# if IS_IN (libpthread)
-# define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__pthread_disable_asynccancel)
-# elif IS_IN (librt)
-# define CENABLE PSEUDO_JMP (__librt_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__librt_disable_asynccancel)
-# else
-# define CENABLE PSEUDO_JMP (__libc_enable_asynccancel)
-# define CDISABLE PSEUDO_JMP (__libc_disable_asynccancel)
-# endif
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) \
- == 0, 1)
-# else
-# define SINGLE_THREAD_P(reg) \
- READ_THREAD_POINTER(reg); \
- lw reg, MULTIPLE_THREADS_OFFSET(reg)
-#endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/ustat.c b/sysdeps/unix/sysv/linux/mips/ustat.c
index feffdc2f8b..786a5ef330 100644
--- a/sysdeps/unix/sysv/linux/mips/ustat.c
+++ b/sysdeps/unix/sysv/linux/mips/ustat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -16,20 +16,13 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <sys/ustat.h>
#include <sys/sysmacros.h>
-#include <sysdep.h>
-#include <sys/syscall.h>
+#define DEV_TO_KDEV(__dev) \
+ ({ \
+ unsigned long k_dev; \
+ k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff); \
+ k_dev; \
+ })
-int
-ustat (dev_t dev, struct ustat *ubuf)
-{
- unsigned long k_dev;
-
- /* We must convert the value to dev_t type used by the kernel. */
- k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff);
-
- return INLINE_SYSCALL (ustat, 2, k_dev, ubuf);
-}
+#include <sysdeps/unix/sysv/linux/ustat.c>
diff --git a/sysdeps/unix/sysv/linux/mips/vfork.S b/sysdeps/unix/sysv/linux/mips/vfork.S
index 8c66151437..8c993fd0a0 100644
--- a/sysdeps/unix/sysv/linux/mips/vfork.S
+++ b/sysdeps/unix/sysv/linux/mips/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,13 +31,13 @@
LOCALSZ= 1
FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
GPOFF= FRAMESZ-(1*SZREG)
-NESTED(__vfork,FRAMESZ,sp)
+NESTED(__libc_vfork,FRAMESZ,sp)
#ifdef __PIC__
SETUP_GP
#endif
PTR_SUBU sp, FRAMESZ
cfi_adjust_cfa_offset (FRAMESZ)
- SETUP_GP64_REG (a5, __vfork)
+ SETUP_GP64_REG (a5, __libc_vfork)
#ifdef __PIC__
SAVE_GP (GPOFF)
#endif
@@ -60,14 +60,6 @@ NESTED(__vfork,FRAMESZ,sp)
PTR_ADDU sp, FRAMESZ
cfi_adjust_cfa_offset (-FRAMESZ)
- /* Save the PID value. */
- READ_THREAD_POINTER(v1) /* Get the thread pointer. */
- lw a2, PID_OFFSET(v1) /* Load the saved PID. */
- subu a2, $0, a2 /* Negate it. */
- bnez a2, 1f /* If it was zero... */
- lui a2, 0x8000 /* use 0x80000000 instead. */
-1: sw a2, PID_OFFSET(v1) /* Store the temporary PID. */
-
li a0, 0x4112 /* CLONE_VM | CLONE_VFORK | SIGCHLD */
move a1, sp
@@ -75,17 +67,6 @@ NESTED(__vfork,FRAMESZ,sp)
li v0,__NR_clone
syscall
- /* Restore the old PID value in the parent. */
- beqz v0, 1f /* If we are the parent... */
- READ_THREAD_POINTER(v1) /* Get the thread pointer. */
- lw a2, PID_OFFSET(v1) /* Load the saved PID. */
- subu a2, $0, a2 /* Re-negate it. */
- lui a0, 0x8000 /* Load 0x80000000... */
- bne a2, a0, 2f /* ... compare against it... */
- li a2, 0 /* ... use 0 instead. */
-2: sw a2, PID_OFFSET(v1) /* Restore the PID. */
-1:
-
cfi_remember_state
bnez a3,L(error)
@@ -104,8 +85,10 @@ L(error):
RESTORE_GP64_REG
j __syscall_error
#endif
- END(__vfork)
+ END(__libc_vfork)
-libc_hidden_def(__vfork)
-weak_alias (__vfork, vfork)
-strong_alias (__vfork, __libc_vfork)
+#if IS_IN (libc)
+weak_alias (__libc_vfork, vfork)
+strong_alias (__libc_vfork, __vfork)
+libc_hidden_def (__vfork)
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/xstatconv.c b/sysdeps/unix/sysv/linux/mips/xstatconv.c
index 4f056304fd..d3c5cf7e43 100644
--- a/sysdeps/unix/sysv/linux/mips/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/mips/xstatconv.c
@@ -1,5 +1,5 @@
/* Convert between the kernel's `struct stat' format, and libc's.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -91,7 +91,7 @@ __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
int
__xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
{
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
return xstat_conv (vers, kbuf, ubuf);
#else
switch (vers)
diff --git a/sysdeps/unix/sysv/linux/mlock2.c b/sysdeps/unix/sysv/linux/mlock2.c
new file mode 100644
index 0000000000..435e26d0db
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mlock2.c
@@ -0,0 +1,40 @@
+/* Wrapper for the mlock2 system call with fallback to mlock.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/mman.h>
+#include <errno.h>
+#include <sysdep.h>
+
+int
+mlock2 (const void *addr, size_t length, unsigned int flags)
+{
+#ifdef __ASSUME_MLOCK2
+ return INLINE_SYSCALL_CALL (mlock2, addr, length, flags);
+#else
+ if (flags == 0)
+ return INLINE_SYSCALL_CALL (mlock, addr, length);
+# ifdef __NR_mlock2
+ int ret = INLINE_SYSCALL_CALL (mlock2, addr, length, flags);
+ if (ret == 0 || errno != ENOSYS)
+ return ret;
+# endif /* __NR_mlock2 */
+ /* Treat the missing system call as an invalid (non-zero) flag
+ argument. */
+ __set_errno (EINVAL);
+ return -1;
+#endif /* __ASSUME_MLOCK2 */
+}
diff --git a/sysdeps/unix/sysv/linux/mmap.c b/sysdeps/unix/sysv/linux/mmap.c
new file mode 100644
index 0000000000..da6ab2ef42
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mmap.c
@@ -0,0 +1,52 @@
+/* mmap - map files or devices into memory. Linux version.
+ Copyright (C) 2017-2018 Free Software 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 <unistd.h>
+#include <sys/mman.h>
+#include <sysdep.h>
+#include <stdint.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+# include <mmap_internal.h>
+
+/* An architecture may override this. */
+# ifndef MMAP_ADJUST_OFFSET
+# define MMAP_ADJUST_OFFSET(offset) offset
+# endif
+
+void *
+__mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
+{
+ MMAP_CHECK_PAGE_UNIT ();
+
+ if (offset & MMAP_OFF_LOW_MASK)
+ return (void *) INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
+
+#ifdef __NR_mmap2
+ return (void *) MMAP_CALL (mmap2, addr, len, prot, flags, fd,
+ offset / (uint32_t) MMAP2_PAGE_UNIT);
+#else
+ return (void *) MMAP_CALL (mmap, addr, len, prot, flags, fd,
+ MMAP_ADJUST_OFFSET (offset));
+#endif
+}
+weak_alias (__mmap, mmap)
+libc_hidden_def (__mmap)
+
+#endif /* __OFF_T_MATCHES_OFF64_T */
diff --git a/sysdeps/unix/sysv/linux/mmap64.c b/sysdeps/unix/sysv/linux/mmap64.c
index 4af0dfde3a..118624185e 100644
--- a/sysdeps/unix/sysv/linux/mmap64.c
+++ b/sysdeps/unix/sysv/linux/mmap64.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* mmap - map files or devices into memory. Linux version.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 1999.
@@ -19,39 +20,43 @@
#include <errno.h>
#include <unistd.h>
#include <sys/mman.h>
-#include <string.h>
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <mmap_internal.h>
-/* This is always 12, even on architectures where PAGE_SHIFT != 12. */
-#ifndef MMAP2_PAGE_SHIFT
-# define MMAP2_PAGE_SHIFT 12
-#endif
-#if MMAP2_PAGE_SHIFT == -1
-static int page_shift;
-#else
-#define page_shift MMAP2_PAGE_SHIFT
-#endif
+/* To avoid silent truncation of offset when using mmap2, do not accept
+ offset larger than 1 << (page_shift + off_t bits). For archictures with
+ 32 bits off_t and page size of 4096 it would be 1^44. */
+#define MMAP_OFF_HIGH_MASK \
+ ((-(MMAP2_PAGE_UNIT << 1) << (8 * sizeof (off_t) - 1)))
+#define MMAP_OFF_MASK (MMAP_OFF_HIGH_MASK | MMAP_OFF_LOW_MASK)
+
+/* An architecture may override this. */
+#ifndef MMAP_PREPARE
+# define MMAP_PREPARE(addr, len, prot, flags, fd, offset)
+#endif
void *
__mmap64 (void *addr, size_t len, int prot, int flags, int fd, off64_t offset)
{
-#if MMAP2_PAGE_SHIFT == -1
- if (page_shift == 0)
- {
- int page_size = __getpagesize ();
- page_shift = __ffs (page_size) - 1;
- }
-#endif
- if (offset & ((1 << page_shift) - 1))
+ MMAP_CHECK_PAGE_UNIT ();
+
+ if (offset & MMAP_OFF_MASK)
return (void *) INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
- void *result;
- result = (void *)
- INLINE_SYSCALL (mmap2, 6, addr,
- len, prot, flags, fd,
- (off_t) (offset >> page_shift));
- return result;
+
+ MMAP_PREPARE (addr, len, prot, flags, fd, offset);
+#ifdef __NR_mmap2
+ return (void *) MMAP_CALL (mmap2, addr, len, prot, flags, fd,
+ (off_t) (offset / MMAP2_PAGE_UNIT));
+#else
+ return (void *) MMAP_CALL (mmap, addr, len, prot, flags, fd, offset);
+#endif
}
weak_alias (__mmap64, mmap64)
+libc_hidden_def (__mmap64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (__mmap64, mmap)
+weak_alias (__mmap64, __mmap)
+libc_hidden_def (__mmap)
+#endif
diff --git a/sysdeps/unix/sysv/linux/mmap_internal.h b/sysdeps/unix/sysv/linux/mmap_internal.h
new file mode 100644
index 0000000000..b0c683ae98
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mmap_internal.h
@@ -0,0 +1,49 @@
+/* Common mmap definition for Linux implementation.
+ Copyright (C) 2017-2018 Free Software 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 MMAP_INTERNAL_LINUX_H
+#define MMAP_INTERNAL_LINUX_H 1
+
+/* This is the minimum mmap2 unit size accept by the kernel. An architecture
+ with multiple minimum page sizes (such as m68k) might define it as -1 and
+ thus it will queried at runtime. */
+#ifndef MMAP2_PAGE_UNIT
+# define MMAP2_PAGE_UNIT 4096ULL
+#endif
+
+#if MMAP2_PAGE_UNIT == -1
+static uint64_t page_unit;
+# define MMAP_CHECK_PAGE_UNIT() \
+ if (page_unit == 0) \
+ page_unit = __getpagesize ();
+# undef MMAP2_PAGE_UNIT
+# define MMAP2_PAGE_UNIT page_unit
+#else
+# define MMAP_CHECK_PAGE_UNIT()
+#endif
+
+/* Do not accept offset not multiple of page size. */
+#define MMAP_OFF_LOW_MASK (MMAP2_PAGE_UNIT - 1)
+
+/* An architecture may override this. */
+#ifndef MMAP_CALL
+# define MMAP_CALL(__nr, __addr, __len, __prot, __flags, __fd, __offset) \
+ INLINE_SYSCALL_CALL (__nr, __addr, __len, __prot, __flags, __fd, __offset)
+#endif
+
+#endif /* MMAP_INTERNAL_LINUX_H */
diff --git a/sysdeps/unix/sysv/linux/mq_close.c b/sysdeps/unix/sysv/linux/mq_close.c
index c8e68135e1..c3b1f7c02e 100644
--- a/sysdeps/unix/sysv/linux/mq_close.c
+++ b/sysdeps/unix/sysv/linux/mq_close.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mq_getattr.c b/sysdeps/unix/sysv/linux/mq_getattr.c
index 32d8427288..ee90b4cd4a 100644
--- a/sysdeps/unix/sysv/linux/mq_getattr.c
+++ b/sysdeps/unix/sysv/linux/mq_getattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mq_notify.c b/sysdeps/unix/sysv/linux/mq_notify.c
index ef14b2d2c4..3563e82cd4 100644
--- a/sysdeps/unix/sysv/linux/mq_notify.c
+++ b/sysdeps/unix/sysv/linux/mq_notify.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contribute by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -209,7 +209,7 @@ init_mq_netlink (void)
if (err != 0)
{
- close_not_cancel_no_status (netlink_socket);
+ __close_nocancel_nostatus (netlink_socket);
netlink_socket = -1;
}
}
diff --git a/sysdeps/unix/sysv/linux/mq_open.c b/sysdeps/unix/sysv/linux/mq_open.c
index 6bcafc389f..7d31a0349e 100644
--- a/sysdeps/unix/sysv/linux/mq_open.c
+++ b/sysdeps/unix/sysv/linux/mq_open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mq_receive.c b/sysdeps/unix/sysv/linux/mq_receive.c
index 55efdcdcd8..76e4002f76 100644
--- a/sysdeps/unix/sysv/linux/mq_receive.c
+++ b/sysdeps/unix/sysv/linux/mq_receive.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mq_send.c b/sysdeps/unix/sysv/linux/mq_send.c
index 025a1f3e8c..737c73e3e4 100644
--- a/sysdeps/unix/sysv/linux/mq_send.c
+++ b/sysdeps/unix/sysv/linux/mq_send.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/mq_timedreceive.c b/sysdeps/unix/sysv/linux/mq_timedreceive.c
new file mode 100644
index 0000000000..5da7eba949
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mq_timedreceive.c
@@ -0,0 +1,34 @@
+/* Receive a message from a message queue with a timeout. Linux version.
+ Copyright (C) 2017-2018 Free Software 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 <mqueue.h>
+#include <sysdep-cancel.h>
+
+/* Receive the oldest from highest priority messages in message queue
+ MQDES, stop waiting if ABS_TIMEOUT expires. */
+ssize_t
+__mq_timedreceive (mqd_t mqdes, char *__restrict msg_ptr, size_t msg_len,
+ unsigned int *__restrict msg_prio,
+ const struct timespec *__restrict abs_timeout)
+{
+ return SYSCALL_CANCEL (mq_timedreceive, mqdes, msg_ptr, msg_len, msg_prio,
+ abs_timeout);
+}
+hidden_def (__mq_timedreceive)
+weak_alias (__mq_timedreceive, mq_timedreceive)
+hidden_weak (mq_timedreceive)
diff --git a/sysdeps/unix/sysv/linux/mq_timedsend.c b/sysdeps/unix/sysv/linux/mq_timedsend.c
new file mode 100644
index 0000000000..bd6f628d2b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mq_timedsend.c
@@ -0,0 +1,33 @@
+/* Send a message to a message queue with a timeout. Linux version.
+ Copyright (C) 2017-2018 Free Software 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 <mqueue.h>
+#include <sysdep-cancel.h>
+
+/* Add message pointed by MSG_PTR to message queue MQDES, stop blocking
+ on full message queue if ABS_TIMEOUT expires. */
+int
+__mq_timedsend (mqd_t mqdes, const char *msg_ptr, size_t msg_len,
+ unsigned int msg_prio, const struct timespec *abs_timeout)
+{
+ return SYSCALL_CANCEL (mq_timedsend, mqdes, msg_ptr, msg_len, msg_prio,
+ abs_timeout);
+}
+hidden_def (__mq_timedsend)
+weak_alias (__mq_timedsend, mq_timedsend)
+hidden_weak (mq_timedsend)
diff --git a/sysdeps/unix/sysv/linux/mq_unlink.c b/sysdeps/unix/sysv/linux/mq_unlink.c
index 14e629fa63..769b58905a 100644
--- a/sysdeps/unix/sysv/linux/mq_unlink.c
+++ b/sysdeps/unix/sysv/linux/mq_unlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
index e48fbb3d11..7280cba31a 100644
--- a/sysdeps/unix/sysv/linux/msgctl.c
+++ b/sysdeps/unix/sysv/linux/msgctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -16,17 +16,30 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/msg.h>
#include <ipc_priv.h>
-
#include <sysdep.h>
-#include <string.h>
-#include <sys/syscall.h>
#include <shlib-compat.h>
+#include <errno.h>
+
+#ifndef DEFAULT_VERSION
+# define DEFAULT_VERSION GLIBC_2_2
+#endif
+
+int
+__new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
+{
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (msgctl, msqid, cmd | __IPC_64, buf);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_msgctl, msqid, cmd | __IPC_64, 0,
+ buf);
+#endif
+}
+versioned_symbol (libc, __new_msgctl, msgctl, DEFAULT_VERSION);
-#include <kernel-features.h>
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
struct __old_msqid_ds
{
struct __old_ipc_perm msg_perm; /* structure describing operation permission */
@@ -44,27 +57,15 @@ struct __old_msqid_ds
__ipc_pid_t msg_lrpid; /* pid of last msgrcv() */
};
-/* Allows to control internal state and destruction of message queue
- objects. */
-#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
-int __old_msgctl (int, int, struct __old_msqid_ds *);
-#endif
-int __new_msgctl (int, int, struct msqid_ds *);
-
-#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
int
attribute_compat_text_section
__old_msgctl (int msqid, int cmd, struct __old_msqid_ds *buf)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, msqid, cmd, 0, buf);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (msgctl, msqid, cmd | __IPC_64, buf);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_msgctl, msqid, cmd, 0, buf);
+#endif
}
compat_symbol (libc, __old_msgctl, msgctl, GLIBC_2_0);
#endif
-
-int
-__new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
-{
- return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, msqid, cmd | __IPC_64, 0, buf);
-}
-
-versioned_symbol (libc, __new_msgctl, msgctl, GLIBC_2_2);
diff --git a/sysdeps/unix/sysv/linux/msgget.c b/sysdeps/unix/sysv/linux/msgget.c
index ef98c75861..21cbb05d95 100644
--- a/sysdeps/unix/sysv/linux/msgget.c
+++ b/sysdeps/unix/sysv/linux/msgget.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -16,13 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/msg.h>
#include <ipc_priv.h>
-#include <stdlib.h> /* for definition of NULL */
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
/* Return descriptor for message queue associated with KEY. The MSGFLG
parameter describes how to proceed with clashing of key values. */
@@ -30,5 +27,9 @@
int
msgget (key_t key, int msgflg)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_msgget, key, msgflg, 0, NULL);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (msgget, key, msgflg);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_msgget, key, msgflg, 0, NULL);
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/msgrcv.c b/sysdeps/unix/sysv/linux/msgrcv.c
index c4dd219097..6883a4cf23 100644
--- a/sysdeps/unix/sysv/linux/msgrcv.c
+++ b/sysdeps/unix/sysv/linux/msgrcv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -16,33 +16,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/msg.h>
#include <ipc_priv.h>
-
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-/* Kludge to work around Linux' restriction of only up to five
- arguments to a system call. */
-struct ipc_kludge
- {
- void *msgp;
- long int msgtyp;
- };
-
ssize_t
__libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp,
int msgflg)
{
- /* The problem here is that Linux' calling convention only allows up to
- fives parameters to a system call. */
- struct ipc_kludge tmp;
-
- tmp.msgp = msgp;
- tmp.msgtyp = msgtyp;
-
- return SYSCALL_CANCEL (ipc, IPCOP_msgrcv, msqid, msgsz, msgflg, &tmp);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return SYSCALL_CANCEL (msgrcv, msqid, msgp, msgsz, msgtyp, msgflg);
+#else
+ return SYSCALL_CANCEL (ipc, IPCOP_msgrcv, msqid, msgsz, msgflg,
+ MSGRCV_ARGS (msgp, msgtyp));
+#endif
}
weak_alias (__libc_msgrcv, msgrcv)
diff --git a/sysdeps/unix/sysv/linux/msgsnd.c b/sysdeps/unix/sysv/linux/msgsnd.c
index 1457e434a0..897a9187d4 100644
--- a/sysdeps/unix/sysv/linux/msgsnd.c
+++ b/sysdeps/unix/sysv/linux/msgsnd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, August 1995.
@@ -16,17 +16,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/msg.h>
#include <ipc_priv.h>
-
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
int
__libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)
{
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return SYSCALL_CANCEL (msgsnd, msqid, msgp, msgsz, msgflg);
+#else
return SYSCALL_CANCEL (ipc, IPCOP_msgsnd, msqid, msgsz, msgflg,
- (void *) msgp);
+ msgp);
+#endif
}
weak_alias (__libc_msgsnd, msgsnd)
diff --git a/sysdeps/unix/sysv/linux/msync.c b/sysdeps/unix/sysv/linux/msync.c
new file mode 100644
index 0000000000..fa443e73de
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/msync.c
@@ -0,0 +1,26 @@
+/* Linux synchronize a file with a memory map implementation.
+ Copyright (C) 2017-2018 Free Software 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/mman.h>
+#include <sysdep-cancel.h>
+
+int
+msync (void *addr, size_t length, int flags)
+{
+ return SYSCALL_CANCEL (msync, addr, length, flags);
+}
diff --git a/sysdeps/unix/sysv/linux/nanosleep.c b/sysdeps/unix/sysv/linux/nanosleep.c
new file mode 100644
index 0000000000..56296046ca
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nanosleep.c
@@ -0,0 +1,31 @@
+/* Linux nanosleep syscall implementation.
+ Copyright (C) 2017-2018 Free Software 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 <time.h>
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
+
+/* Pause execution for a number of nanoseconds. */
+int
+__nanosleep (const struct timespec *requested_time,
+ struct timespec *remaining)
+{
+ return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
+}
+hidden_def (__nanosleep)
+weak_alias (__nanosleep, nanosleep)
diff --git a/sysdeps/unix/sysv/linux/nanosleep_nocancel.c b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c
new file mode 100644
index 0000000000..66f3efd09e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c
@@ -0,0 +1,29 @@
+/* Linux nanosleep syscall implementation -- non-cancellable.
+ Copyright (C) 2018 Free Software 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 <time.h>
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
+
+int
+__nanosleep_nocancel (const struct timespec *requested_time,
+ struct timespec *remaining)
+{
+ return INLINE_SYSCALL_CALL (nanosleep, requested_time, remaining);
+}
+hidden_def (__nanosleep_nocancel)
diff --git a/sysdeps/unix/sysv/linux/net/ethernet.h b/sysdeps/unix/sysv/linux/net/ethernet.h
index 3160e9341b..167d6f5841 100644
--- a/sysdeps/unix/sysv/linux/net/ethernet.h
+++ b/sysdeps/unix/sysv/linux/net/ethernet.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,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..ef4de77ab9 100644
--- a/sysdeps/unix/sysv/linux/net/if_arp.h
+++ b/sysdeps/unix/sysv/linux/net/if_arp.h
@@ -1,5 +1,5 @@
/* Definitions for Address Resolution Protocol.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -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
@@ -102,6 +101,7 @@ struct arphdr
#define ARPHRD_LAPB 516 /* LAPB. */
#define ARPHRD_DDCMP 517 /* Digital's DDCMP. */
#define ARPHRD_RAWHDLC 518 /* Raw HDLC. */
+#define ARPHRD_RAWIP 519 /* Raw IP. */
#define ARPHRD_TUNNEL 768 /* IPIP tunnel. */
#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */
@@ -171,7 +171,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_packet.h b/sysdeps/unix/sysv/linux/net/if_packet.h
index 67f9f98e96..eb8599a0ca 100644
--- a/sysdeps/unix/sysv/linux/net/if_packet.h
+++ b/sysdeps/unix/sysv/linux/net/if_packet.h
@@ -1,5 +1,5 @@
/* Definitions for use with Linux SOCK_PACKET sockets.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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..97b160877a 100644
--- a/sysdeps/unix/sysv/linux/net/if_shaper.h
+++ b/sysdeps/unix/sysv/linux/net/if_shaper.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/if_slip.h b/sysdeps/unix/sysv/linux/net/if_slip.h
index 25856d09f7..50050c6ae2 100644
--- a/sysdeps/unix/sysv/linux/net/if_slip.h
+++ b/sysdeps/unix/sysv/linux/net/if_slip.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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..3d68e577cd 100644
--- a/sysdeps/unix/sysv/linux/net/route.h
+++ b/sysdeps/unix/sysv/linux/net/route.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/netash/ash.h b/sysdeps/unix/sysv/linux/netash/ash.h
index 2ce600da7a..2c1437a078 100644
--- a/sysdeps/unix/sysv/linux/netash/ash.h
+++ b/sysdeps/unix/sysv/linux/netash/ash.h
@@ -1,5 +1,5 @@
/* Definitions for use with Linux AF_ASH sockets.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/netatalk/at.h b/sysdeps/unix/sysv/linux/netatalk/at.h
index 34945d89d9..9dc7f31cc0 100644
--- a/sysdeps/unix/sysv/linux/netatalk/at.h
+++ b/sysdeps/unix/sysv/linux/netatalk/at.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/netax25/ax25.h b/sysdeps/unix/sysv/linux/netax25/ax25.h
index 13883a06ed..297cbd56a9 100644
--- a/sysdeps/unix/sysv/linux/netax25/ax25.h
+++ b/sysdeps/unix/sysv/linux/netax25/ax25.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/neteconet/ec.h b/sysdeps/unix/sysv/linux/neteconet/ec.h
index 990f935afc..3c7d7f351c 100644
--- a/sysdeps/unix/sysv/linux/neteconet/ec.h
+++ b/sysdeps/unix/sysv/linux/neteconet/ec.h
@@ -1,5 +1,5 @@
/* Definitions for use with Linux AF_ECONET sockets.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/netinet/if_ether.h b/sysdeps/unix/sysv/linux/netinet/if_ether.h
index e9ed13774f..d5bbf60e91 100644
--- a/sysdeps/unix/sysv/linux/netinet/if_ether.h
+++ b/sysdeps/unix/sysv/linux/netinet/if_ether.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -70,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..55b33663d5 100644
--- a/sysdeps/unix/sysv/linux/netinet/if_fddi.h
+++ b/sysdeps/unix/sysv/linux/netinet/if_fddi.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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..350c40ffc3 100644
--- a/sysdeps/unix/sysv/linux/netinet/if_tr.h
+++ b/sysdeps/unix/sysv/linux/netinet/if_tr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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..bacea41718 100644
--- a/sysdeps/unix/sysv/linux/netipx/ipx.h
+++ b/sysdeps/unix/sysv/linux/netipx/ipx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/netiucv/iucv.h b/sysdeps/unix/sysv/linux/netiucv/iucv.h
index 13cfe98f09..378039d551 100644
--- a/sysdeps/unix/sysv/linux/netiucv/iucv.h
+++ b/sysdeps/unix/sysv/linux/netiucv/iucv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,4 +35,14 @@ struct sockaddr_iucv
__END_DECLS
+#define SOL_IUCV 277 /* IUCV level */
+
+/* IUCV socket options (SOL_IUCV) */
+#define SO_IPRMDATA_MSG 0x0080 /* Send/recv IPRM_DATA msgs */
+#define SO_MSGLIMIT 0x1000 /* Get/set IUCV MSGLIMIT */
+#define SO_MSGSIZE 0x0800 /* Get maximum msgsize */
+
+/* IUCV related control messages (scm) */
+#define SCM_IUCV_TRGCLS 0x0001 /* Target class control message */
+
#endif
diff --git a/sysdeps/unix/sysv/linux/netlink_assert_response.c b/sysdeps/unix/sysv/linux/netlink_assert_response.c
index e8e296bf4e..f31ccb52ff 100644
--- a/sysdeps/unix/sysv/linux/netlink_assert_response.c
+++ b/sysdeps/unix/sysv/linux/netlink_assert_response.c
@@ -1,5 +1,5 @@
/* Check recvmsg results for netlink sockets.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,7 +39,6 @@ get_address_family (int fd)
}
void
-internal_function
__netlink_assert_response (int fd, ssize_t result)
{
if (result < 0)
diff --git a/sysdeps/unix/sysv/linux/netlinkaccess.h b/sysdeps/unix/sysv/linux/netlinkaccess.h
index 2bb50f255b..dfb074f4f2 100644
--- a/sysdeps/unix/sysv/linux/netlinkaccess.h
+++ b/sysdeps/unix/sysv/linux/netlinkaccess.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,15 +44,16 @@ struct netlink_handle
};
-extern int __netlink_open (struct netlink_handle *h);
-extern void __netlink_close (struct netlink_handle *h);
-extern void __netlink_free_handle (struct netlink_handle *h);
-extern int __netlink_request (struct netlink_handle *h, int type);
+extern int __netlink_open (struct netlink_handle *h) attribute_hidden;
+extern void __netlink_close (struct netlink_handle *h) attribute_hidden;
+extern void __netlink_free_handle (struct netlink_handle *h)
+ attribute_hidden;
+extern int __netlink_request (struct netlink_handle *h, int type)
+ attribute_hidden;
/* Terminate the process if RESULT is an invalid recvmsg result for
the netlink socket FD. */
-void __netlink_assert_response (int fd, ssize_t result)
- internal_function;
+void __netlink_assert_response (int fd, ssize_t result);
libc_hidden_proto (__netlink_assert_response)
#endif /* netlinkaccess.h */
diff --git a/sysdeps/unix/sysv/linux/netpacket/packet.h b/sysdeps/unix/sysv/linux/netpacket/packet.h
index 52b67df9cb..8deb50b799 100644
--- a/sysdeps/unix/sysv/linux/netpacket/packet.h
+++ b/sysdeps/unix/sysv/linux/netpacket/packet.h
@@ -1,5 +1,5 @@
/* Definitions for use with Linux AF_PACKET sockets.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/netrom/netrom.h b/sysdeps/unix/sysv/linux/netrom/netrom.h
index 4d544ad1cb..50df246a5c 100644
--- a/sysdeps/unix/sysv/linux/netrom/netrom.h
+++ b/sysdeps/unix/sysv/linux/netrom/netrom.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/netrose/rose.h b/sysdeps/unix/sysv/linux/netrose/rose.h
index 3cb7f84eb0..3bfd661a39 100644
--- a/sysdeps/unix/sysv/linux/netrose/rose.h
+++ b/sysdeps/unix/sysv/linux/netrose/rose.h
@@ -1,5 +1,5 @@
/* Definitions for Rose packet radio address family.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,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/Makefile b/sysdeps/unix/sysv/linux/nios2/Makefile
index d0af9ec559..5688a16c38 100644
--- a/sysdeps/unix/sysv/linux/nios2/Makefile
+++ b/sysdeps/unix/sysv/linux/nios2/Makefile
@@ -3,11 +3,7 @@ gen-as-const-headers += ucontext_i.sym
endif
ifeq ($(subdir),misc)
-# MIPS/Tile-style cacheflush routine
+# MIPS-style cacheflush routine
sysdep_headers += sys/cachectl.h
sysdep_routines += cacheflush
endif
-
-ifeq ($(subdir),nptl)
-libpthread-routines := $(filter-out pt-vfork,$(libpthread-routines))
-endif
diff --git a/sysdeps/unix/sysv/linux/nios2/arch-fork.h b/sysdeps/unix/sysv/linux/nios2/arch-fork.h
deleted file mode 100644
index 41ff5f08cd..0000000000
--- a/sysdeps/unix/sysv/linux/nios2/arch-fork.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. Nios II version.
- Copyright (C) 2005-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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-/* Argument 1 - Clone flags.
- 2 - Child stack pointer.
- 3 - Parent tid pointer.
- 4 - Child tid pointer.
- 5 - New TLS area pointer. */
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 5, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
- NULL, NULL, &THREAD_SELF->tid, NULL)
diff --git a/sysdeps/unix/sysv/linux/nios2/atomic-machine.h b/sysdeps/unix/sysv/linux/nios2/atomic-machine.h
index e246dee578..32e17fb970 100644
--- a/sysdeps/unix/sysv/linux/nios2/atomic-machine.h
+++ b/sysdeps/unix/sysv/linux/nios2/atomic-machine.h
@@ -1,5 +1,5 @@
/* Low-level functions for atomic operations. Nios II version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,6 +34,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
(abort (), (__typeof (*mem)) 0)
#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
diff --git a/sysdeps/unix/sysv/linux/nios2/bits/mman.h b/sysdeps/unix/sysv/linux/nios2/bits/mman.h
index 43a3ff8070..50f92b4a86 100644
--- a/sysdeps/unix/sysv/linux/nios2/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/nios2/bits/mman.h
@@ -1,6 +1,6 @@
/* Definitions for POSIX memory map interface. Linux/Nios II version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -36,6 +36,10 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_SYNC 0x80000 /* Perform synchronous page
+ faults for the mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Include generic Linux declarations. */
diff --git a/sysdeps/unix/sysv/linux/nios2/cacheflush.c b/sysdeps/unix/sysv/linux/nios2/cacheflush.c
index 26ca8cfe9d..31a0bcc7e5 100644
--- a/sysdeps/unix/sysv/linux/nios2/cacheflush.c
+++ b/sysdeps/unix/sysv/linux/nios2/cacheflush.c
@@ -1,5 +1,5 @@
/* cacheflush system call for Nios II Linux.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/nios2/clone.S b/sysdeps/unix/sysv/linux/nios2/clone.S
index 4da5c19a73..fd3be46645 100644
--- a/sysdeps/unix/sysv/linux/nios2/clone.S
+++ b/sysdeps/unix/sysv/linux/nios2/clone.S
@@ -1,5 +1,5 @@
/* clone() implementation for Nios II.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andrew Jenner <andrew@codesourcery.com>, 2008.
@@ -25,9 +25,6 @@
#include <bits/errno.h>
#include <tcb-offsets.h>
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
void *parent_tidptr, void *tls, void *child_tidptr) */
@@ -69,18 +66,6 @@ thread_start:
cfi_startproc
cfi_undefined (ra)
- /* We expect the argument registers to be preserved across system
- calls and across task cloning, so flags should be in r4 here. */
- andhi r2, r4, %hi(CLONE_THREAD)
- bne r2, zero, 2f
- andi r3, r4, CLONE_VM
- movi r2, -1
- bne r3, zero, 3f
- DO_CALL (getpid, 0)
-3:
- stw r2, PID_OFFSET(r23)
- stw r2, TID_OFFSET(r23)
-2:
ldw r5, 4(sp) /* Function pointer. */
ldw r4, 0(sp) /* Argument pointer. */
addi sp, sp, 8
@@ -88,20 +73,12 @@ thread_start:
/* Call the user's function. */
callr r5
- /* _exit with the result. */
- mov r4, r2
-#ifdef PIC
- nextpc r22
-1: movhi r8, %hiadj(_gp_got - 1b)
- addi r8, r8, %lo(_gp_got - 1b)
- add r22, r22, r8
- ldw r8, %call(HIDDEN_JUMPTARGET(_exit))(r22)
- jmp r8
-#else
- jmpi _exit
-#endif
+ /* exit with the result. */
+ movi r2, SYS_ify (exit)
+ trap
cfi_endproc
cfi_startproc
PSEUDO_END (__clone)
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/nios2/getcontext.S b/sysdeps/unix/sysv/linux/nios2/getcontext.S
index 339da3b77f..8b5490cf60 100644
--- a/sysdeps/unix/sysv/linux/nios2/getcontext.S
+++ b/sysdeps/unix/sysv/linux/nios2/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/nios2/ipc_priv.h b/sysdeps/unix/sysv/linux/nios2/ipc_priv.h
new file mode 100644
index 0000000000..37c081c1b1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nios2/ipc_priv.h
@@ -0,0 +1,21 @@
+/* Old SysV permission definition for Linux. Nios II version.
+ Copyright (C) 2017-2018 Free Software 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/ipc.h> /* For __key_t */
+
+#define __IPC_64 0x0
diff --git a/sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h
new file mode 100644
index 0000000000..1cb9cab420
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 172
+#define SIGJMP_BUF_SIZE 172
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 40
+#define SAVED_MASK_OFFSET 44
diff --git a/sysdeps/unix/sysv/linux/nios2/kernel-features.h b/sysdeps/unix/sysv/linux/nios2/kernel-features.h
deleted file mode 100644
index c90df5da2a..0000000000
--- a/sysdeps/unix/sysv/linux/nios2/kernel-features.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Set flags signalling availability of kernel features based on given
- kernel version number.
-
- Copyright (C) 2009-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 <linux/version.h>
-
-/* The minimum supported kernel version for Nios II is 3.19.0,
- guaranteeing many kernel features. */
-
-#define __ASSUME_ACCEPT4_SYSCALL 1
-#define __ASSUME_RECVMMSG_SYSCALL 1
-#define __ASSUME_SENDMMSG_SYSCALL 1
-
-#include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/nios2/kernel_rt_sigframe.h b/sysdeps/unix/sysv/linux/nios2/kernel_rt_sigframe.h
index cedf5812b7..917088c52f 100644
--- a/sysdeps/unix/sysv/linux/nios2/kernel_rt_sigframe.h
+++ b/sysdeps/unix/sysv/linux/nios2/kernel_rt_sigframe.h
@@ -1,5 +1,5 @@
/* Linux kernel struct rt_sigframe declaration for Nios II.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,5 +22,5 @@
struct kernel_rt_sigframe
{
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
};
diff --git a/sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h b/sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h
new file mode 100644
index 0000000000..4ada322104
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h
@@ -0,0 +1,8 @@
+/* NIOS2 uses the generic Linux UAPI but defines SA_RESTORER. */
+#define SA_RESTORER 0x04000000
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
+
+#define SET_SA_RESTORER(kact, act) \
+ (kact)->sa_restorer = (act)->sa_restorer
+#define RESET_SA_RESTORER(act, kact) \
+ (act)->sa_restorer = (kact)->sa_restorer
diff --git a/sysdeps/unix/sysv/linux/nios2/ld.abilist b/sysdeps/unix/sysv/linux/nios2/ld.abilist
index 389bdaa0cb..110f1039fa 100644
--- a/sysdeps/unix/sysv/linux/nios2/ld.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
-GLIBC_2.21 __libc_memalign F
GLIBC_2.21 __libc_stack_end D 0x4
GLIBC_2.21 __stack_chk_guard D 0x4
GLIBC_2.21 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/nios2/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/nios2/libBrokenLocale.abilist
index 5acf5e6d61..f0210af954 100644
--- a/sysdeps/unix/sysv/linux/nios2/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/nios2/libanl.abilist b/sysdeps/unix/sysv/linux/nios2/libanl.abilist
index 04286b8fa1..6ff9c2d94e 100644
--- a/sysdeps/unix/sysv/linux/nios2/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 gai_cancel F
GLIBC_2.21 gai_error F
GLIBC_2.21 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index dff1ee9566..aab1c44e46 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 _Exit F
GLIBC_2.21 _IO_2_1_stderr_ D 0x98
GLIBC_2.21 _IO_2_1_stdin_ D 0x98
@@ -2120,11 +2119,55 @@ GLIBC_2.21 xdrstdio_create F
GLIBC_2.21 xencrypt F
GLIBC_2.21 xprt_register F
GLIBC_2.21 xprt_unregister F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
diff --git a/sysdeps/unix/sysv/linux/nios2/libcrypt.abilist b/sysdeps/unix/sysv/linux/nios2/libcrypt.abilist
index dae6b522ac..78a9a23dbd 100644
--- a/sysdeps/unix/sysv/linux/nios2/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 crypt F
GLIBC_2.21 crypt_r F
GLIBC_2.21 encrypt F
diff --git a/sysdeps/unix/sysv/linux/nios2/libdl.abilist b/sysdeps/unix/sysv/linux/nios2/libdl.abilist
index ae62e3f80e..79573c93dc 100644
--- a/sysdeps/unix/sysv/linux/nios2/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libdl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 dladdr F
GLIBC_2.21 dladdr1 F
GLIBC_2.21 dlclose F
diff --git a/sysdeps/unix/sysv/linux/nios2/libm.abilist b/sysdeps/unix/sysv/linux/nios2/libm.abilist
index ad02eff997..2ed649a655 100644
--- a/sysdeps/unix/sysv/linux/nios2/libm.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 _LIB_VERSION D 0x4
GLIBC_2.21 __acos_finite F
GLIBC_2.21 __acosf_finite F
@@ -367,8 +366,402 @@ GLIBC_2.21 y1l F
GLIBC_2.21 yn F
GLIBC_2.21 ynf F
GLIBC_2.21 ynl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/nios2/libnsl.abilist b/sysdeps/unix/sysv/linux/nios2/libnsl.abilist
index 40856aba99..9a3bbb310d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 __free_fdresult F
GLIBC_2.21 __nis_default_access F
GLIBC_2.21 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
index a10bbdec87..78cac2ae27 100644
--- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 _IO_flockfile F
GLIBC_2.21 _IO_ftrylockfile F
GLIBC_2.21 _IO_funlockfile F
@@ -221,3 +220,24 @@ GLIBC_2.21 tcdrain F
GLIBC_2.21 wait F
GLIBC_2.21 waitpid F
GLIBC_2.21 write F
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
diff --git a/sysdeps/unix/sysv/linux/nios2/libresolv.abilist b/sysdeps/unix/sysv/linux/nios2/libresolv.abilist
index b006fcafe7..2a2bec433f 100644
--- a/sysdeps/unix/sysv/linux/nios2/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 __b64_ntop F
GLIBC_2.21 __b64_pton F
GLIBC_2.21 __dn_comp F
diff --git a/sysdeps/unix/sysv/linux/nios2/librt.abilist b/sysdeps/unix/sysv/linux/nios2/librt.abilist
index 51b1c5bc03..b4ae7a2dc2 100644
--- a/sysdeps/unix/sysv/linux/nios2/librt.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 __mq_open_2 F
GLIBC_2.21 aio_cancel F
GLIBC_2.21 aio_cancel64 F
diff --git a/sysdeps/unix/sysv/linux/nios2/libthread_db.abilist b/sysdeps/unix/sysv/linux/nios2/libthread_db.abilist
index 96be90f65b..cb9e543f0e 100644
--- a/sysdeps/unix/sysv/linux/nios2/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 td_init F
GLIBC_2.21 td_log F
GLIBC_2.21 td_symbol_list F
diff --git a/sysdeps/unix/sysv/linux/nios2/libutil.abilist b/sysdeps/unix/sysv/linux/nios2/libutil.abilist
index 0c21934dc0..19608bd74d 100644
--- a/sysdeps/unix/sysv/linux/nios2/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.21 GLIBC_2.21 A
GLIBC_2.21 forkpty F
GLIBC_2.21 login F
GLIBC_2.21 login_tty F
diff --git a/sysdeps/unix/sysv/linux/nios2/localplt.data b/sysdeps/unix/sysv/linux/nios2/localplt.data
index 08c88dc9c0..4430a5891e 100644
--- a/sysdeps/unix/sysv/linux/nios2/localplt.data
+++ b/sysdeps/unix/sysv/linux/nios2/localplt.data
@@ -1,11 +1,10 @@
libc.so: realloc
-libc.so: __eqsf2
libc.so: __floatsisf
-libc.so: __gtdf2
+libc.so: __gtdf2 ?
libc.so: __ltdf2
libc.so: __gedf2
libc.so: malloc
-libc.so: __gtsf2
+libc.so: __gtsf2 ?
libc.so: __nesf2
libc.so: memalign
libc.so: __mulsf3
@@ -13,10 +12,10 @@ libc.so: __floatunsisf
libc.so: __addsf3
libc.so: __fixsfsi
libc.so: __subsf3
-libc.so: __unorddf2
+libc.so: __unorddf2 ?
libc.so: calloc
libc.so: __muldf3
-libc.so: __unordsf2
+libc.so: __unordsf2 ?
libc.so: free
libc.so: __subdf3
libc.so: __ledf2
@@ -26,12 +25,16 @@ libc.so: __floatsidf
libc.so: __divsf3
libc.so: __nedf2
libc.so: __eqdf2
+libc.so: __extendsfdf2
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
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/nios2/makecontext.c b/sysdeps/unix/sysv/linux/nios2/makecontext.c
index 93f1b777e8..e59fbafc97 100644
--- a/sysdeps/unix/sysv/linux/nios2/makecontext.c
+++ b/sysdeps/unix/sysv/linux/nios2/makecontext.c
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/nios2/pt-vfork.S b/sysdeps/unix/sysv/linux/nios2/pt-vfork.S
new file mode 100644
index 0000000000..147427a42d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nios2/pt-vfork.S
@@ -0,0 +1 @@
+# Nios2 does not require a stub for vfork in libpthread.
diff --git a/sysdeps/unix/sysv/linux/nios2/setcontext.S b/sysdeps/unix/sysv/linux/nios2/setcontext.S
index f10e8ffc0f..5e82bc99bb 100644
--- a/sysdeps/unix/sysv/linux/nios2/setcontext.S
+++ b/sysdeps/unix/sysv/linux/nios2/setcontext.S
@@ -1,5 +1,5 @@
/* Set current context.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -85,6 +85,18 @@ ENTRY(__setcontext)
PSEUDO_END (__setcontext)
weak_alias (__setcontext, setcontext)
+ /* We add an NOP here to separate between __setcontext/__startcontext.
+ The wanted behavior that happens is: when unwinding from a function
+ called inside a makecontext() context, FDE lookup will use
+ '&__startcontext - 1', then returns NULL for no FDE found,
+ and immediately ends the unwind, in a normal fashion.
+
+ If this NOP word does not exist, FDE lookup just repeatedly finds
+ __setcontext's FDE in an infinite loop, due to the convention of
+ using 'address - 1' for FDE lookup. Modifiying/deleting the below
+ __startcontext's FDE has no help on this. */
+ nop
+
ENTRY(__startcontext)
mov r4, r16
bne r4, zero, __setcontext
diff --git a/sysdeps/unix/sysv/linux/nios2/sigcontextinfo.h b/sysdeps/unix/sysv/linux/nios2/sigcontextinfo.h
index 1e604c94cb..57b9b50e96 100644
--- a/sysdeps/unix/sysv/linux/nios2/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/nios2/sigcontextinfo.h
@@ -1,5 +1,5 @@
/* Nios II definitions for signal handling calling conventions.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
#include <sys/ucontext.h>
#include "kernel-features.h"
-#define SIGCONTEXT siginfo_t *_si, struct ucontext *
+#define SIGCONTEXT siginfo_t *_si, ucontext_t *
#define GET_PC(ctx) ((void *) (ctx)->uc_mcontext.regs[27])
/* There is no reliable way to get the sigcontext unless we use a
diff --git a/sysdeps/unix/sysv/linux/nios2/swapcontext.S b/sysdeps/unix/sysv/linux/nios2/swapcontext.S
index c24dd126b4..1cd6576de1 100644
--- a/sysdeps/unix/sysv/linux/nios2/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/nios2/swapcontext.S
@@ -1,5 +1,5 @@
/* Modify saved context.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/nios2/sys/cachectl.h b/sysdeps/unix/sysv/linux/nios2/sys/cachectl.h
index 717e6ae843..1bc9eeffba 100644
--- a/sysdeps/unix/sysv/linux/nios2/sys/cachectl.h
+++ b/sysdeps/unix/sysv/linux/nios2/sys/cachectl.h
@@ -1,5 +1,5 @@
/* cacheflush - flush contents of instruction and/or data cache.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,9 +21,6 @@
#include <features.h>
-/* Get the kernel definition for the op bits. */
-#include <asm/cachectl.h>
-
__BEGIN_DECLS
#ifdef __USE_MISC
diff --git a/sysdeps/unix/sysv/linux/nios2/sys/procfs.h b/sysdeps/unix/sysv/linux/nios2/sys/procfs.h
index b0ccd9f357..a61fe96c6b 100644
--- a/sysdeps/unix/sysv/linux/nios2/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/nios2/sys/procfs.h
@@ -1,5 +1,5 @@
/* Core image file related definitions, Nios II version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h b/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
index a44ec61fa0..188a004ac2 100644
--- a/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
@@ -1,5 +1,5 @@
-/* struct ucontext definition, Nios II version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* ucontext_t definition, Nios II version.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,27 +22,40 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
/* These definitions must be in sync with the kernel. */
-#define MCONTEXT_VERSION 2
+#ifdef __USE_MISC
+# define MCONTEXT_VERSION 2
+#endif
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
/* Context to describe whole processor state. */
-typedef struct mcontext
+typedef struct
{
- int version;
- unsigned long regs[32];
+ int __ctx(version);
+ unsigned long __ctx(regs)[32];
} mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long uc_flags;
- struct ucontext *uc_link;
+ unsigned long __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
+ sigset_t uc_sigmask;
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/nios2/sys/user.h b/sysdeps/unix/sysv/linux/nios2/sys/user.h
index 1c042a852d..cddb960919 100644
--- a/sysdeps/unix/sysv/linux/nios2/sys/user.h
+++ b/sysdeps/unix/sysv/linux/nios2/sys/user.h
@@ -1,5 +1,5 @@
/* ptrace register data format definitions.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/nios2/syscall.S b/sysdeps/unix/sysv/linux/nios2/syscall.S
index 51b6d46aaf..a0298fc47d 100644
--- a/sysdeps/unix/sysv/linux/nios2/syscall.S
+++ b/sysdeps/unix/sysv/linux/nios2/syscall.S
@@ -1,5 +1,5 @@
/* syscall - indirect system call.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h b/sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h
deleted file mode 100644
index 8bd9e6bc68..0000000000
--- a/sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/* Assembler macros with cancellation support, Nios II version.
- 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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .type __##syscall_name##_nocancel, @function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- cfi_startproc; \
- DO_CALL (syscall_name, args); \
- bne r7, zero, SYSCALL_ERROR_LABEL; \
- ret; \
- cfi_endproc; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
- ENTRY (name) \
- SINGLE_THREAD_P(r2); \
- bne r2, zero, pseudo_cancel; \
- DO_CALL (syscall_name, args); \
- bne r7, zero, SYSCALL_ERROR_LABEL; \
- ret; \
- pseudo_cancel: \
- SAVESTK_##args; /* save syscall args and adjust stack */ \
- SAVEREG(ra, 0); /* save return address */ \
- SAVEREG(r22, 4); /* save GOT pointer */ \
- nextpc r22; \
-1: movhi r2, %hiadj(_gp_got - 1b); \
- addi r2, r2, %lo(_gp_got - 1b); \
- add r22, r22, r2; \
- CENABLE; \
- callr r3; \
- stw r2, 8(sp); /* save mask */ \
- LOADARGS_##args; \
- movi r2, SYS_ify(syscall_name); \
- trap; \
- stw r2, 12(sp); /* save syscall result */ \
- stw r7, 16(sp); /* save syscall error flag */ \
- ldw r4, 8(sp); /* pass mask as argument 1 */ \
- CDISABLE; \
- callr r3; \
- ldw r7, 16(sp); /* restore syscall error flag */ \
- ldw r2, 12(sp); /* restore syscall result */ \
- ldw ra, 0(sp); /* restore return address */ \
- ldw r22, 4(sp); /* restore GOT pointer */ \
- RESTORESTK_##args; \
- bne r7, zero, SYSCALL_ERROR_LABEL;
-
-
-# undef PSEUDO_END
-# define PSEUDO_END(sym) \
- SYSCALL_ERROR_HANDLER \
- END (sym)
-
-#define SAVEREG(REG, LOC) stw REG, LOC(sp); cfi_rel_offset (REG, LOC)
-#define SAVESTK(X) subi sp, sp, X; cfi_adjust_cfa_offset(X)
-#define SAVESTK_0 SAVESTK(20)
-#define SAVEARG_1 SAVEREG(r4, 20)
-#define SAVESTK_1 SAVESTK(24); SAVEARG_1
-#define SAVEARG_2 SAVEREG(r5, 24); SAVEARG_1
-#define SAVESTK_2 SAVESTK(28); SAVEARG_2
-#define SAVEARG_3 SAVEREG(r6, 28); SAVEARG_2
-#define SAVESTK_3 SAVESTK(32); SAVEARG_3
-#define SAVEARG_4 SAVEREG(r7, 32); SAVEARG_3
-#define SAVESTK_4 SAVESTK(36); SAVEARG_4
-#define SAVESTK_5 SAVESTK_4
-#define SAVESTK_6 SAVESTK_5
-
-#define LOADARGS_0
-#define LOADARGS_1 ldw r4, 20(sp)
-#define LOADARGS_2 LOADARGS_1; ldw r5, 24(sp)
-#define LOADARGS_3 LOADARGS_2; ldw r6, 28(sp)
-#define LOADARGS_4 LOADARGS_3; ldw r7, 32(sp)
-#define LOADARGS_5 LOADARGS_4; ldw r8, 36(sp)
-#define LOADARGS_6 LOADARGS_5; ldw r9, 40(sp)
-
-#define RESTORESTK(X) addi sp, sp, X; cfi_adjust_cfa_offset(-X)
-#define RESTORESTK_0 RESTORESTK(20)
-#define RESTORESTK_1 RESTORESTK(24)
-#define RESTORESTK_2 RESTORESTK(28)
-#define RESTORESTK_3 RESTORESTK(32)
-#define RESTORESTK_4 RESTORESTK(36)
-#define RESTORESTK_5 RESTORESTK(36)
-#define RESTORESTK_6 RESTORESTK(36)
-
-# if IS_IN (libpthread)
-# define CENABLE ldw r3, %call(__pthread_enable_asynccancel)(r22)
-# define CDISABLE ldw r3, %call(__pthread_disable_asynccancel)(r22)
-# elif IS_IN (librt)
-# define CENABLE ldw r3, %call(__librt_enable_asynccancel)(r22)
-# define CDISABLE ldw r3, %call(__librt_disable_asynccancel)(r22)
-# elif IS_IN (libc)
-# define CENABLE ldw r3, %call(__libc_enable_asynccancel)(r22)
-# define CDISABLE ldw r3, %call(__libc_disable_asynccancel)(r22)
-# else
-# error Unsupported library
-# endif
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) \
- == 0, 1)
-# else
-# define SINGLE_THREAD_P(reg) \
- ldw reg, MULTIPLE_THREADS_OFFSET(r23)
-#endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep.S b/sysdeps/unix/sysv/linux/nios2/sysdep.S
index 67e214a6ca..a481810192 100644
--- a/sysdeps/unix/sysv/linux/nios2/sysdep.S
+++ b/sysdeps/unix/sysv/linux/nios2/sysdep.S
@@ -1,5 +1,5 @@
/* Static library error handling code fragment for Nios II.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep.h b/sysdeps/unix/sysv/linux/nios2/sysdep.h
index 0935fa26d5..2e18809603 100644
--- a/sysdeps/unix/sysv/linux/nios2/sysdep.h
+++ b/sysdeps/unix/sysv/linux/nios2/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for Nios II.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -140,6 +140,10 @@
/* In order to get __set_errno() definition in INLINE_SYSCALL. */
#include <errno.h>
+/* Previously Nios2 used the generic version without the libc_hidden_def
+ which lead in a non existent __send symbol in libc.so. */
+# undef HAVE_INTERNAL_SEND_SYMBOL
+
/* Define a macro which expands into the inline wrapper code for a system
call. */
#undef INLINE_SYSCALL
diff --git a/sysdeps/unix/sysv/linux/nios2/vfork.S b/sysdeps/unix/sysv/linux/nios2/vfork.S
index c1bb9c7134..8aa99e6e26 100644
--- a/sysdeps/unix/sysv/linux/nios2/vfork.S
+++ b/sysdeps/unix/sysv/linux/nios2/vfork.S
@@ -1,5 +1,5 @@
/* vfork for Nios II Linux.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,20 +21,10 @@
ENTRY(__vfork)
- ldw r6, PID_OFFSET(r23)
- sub r7, zero, r6
- bne r7, zero, 2f
- movhi r7, %hi(0x80000000)
-2:
- stw r7, PID_OFFSET(r23)
-
movi r4, 0x4111 /* (CLONE_VM | CLONE_VFORK | SIGCHLD) */
mov r5, zero
DO_CALL (clone, 2)
- beq r2, zero, 1f
- stw r6, PID_OFFSET(r23)
-1:
bne r7, zero, SYSCALL_ERROR_LABEL
ret
diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
index d23136d2ad..09de92dee9 100644
--- a/sysdeps/unix/sysv/linux/not-cancel.h
+++ b/sysdeps/unix/sysv/linux/not-cancel.h
@@ -1,5 +1,5 @@
/* Uncancelable versions of cancelable interfaces. Linux/NPTL version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -20,90 +20,76 @@
#ifndef NOT_CANCEL_H
# define NOT_CANCEL_H
+#include <fcntl.h>
#include <sysdep.h>
#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
+#include <sys/wait.h>
+#include <time.h>
-/* Uncancelable open. */
-#ifdef __NR_open
-# define open_not_cancel(name, flags, mode) \
- INLINE_SYSCALL (open, 3, name, flags, mode)
-# define open_not_cancel_2(name, flags) \
- INLINE_SYSCALL (open, 2, name, flags)
-#else
-# define open_not_cancel(name, flags, mode) \
- INLINE_SYSCALL (openat, 4, AT_FDCWD, name, flags, mode)
-# define open_not_cancel_2(name, flags) \
- INLINE_SYSCALL (openat, 3, AT_FDCWD, name, flags)
-#endif
+/* Non cancellable open syscall. */
+__typeof (open) __open_nocancel;
-/* Uncancelable read. */
-#define __read_nocancel(fd, buf, len) \
- INLINE_SYSCALL (read, 3, fd, buf, len)
+/* Non cancellable open syscall (LFS version). */
+__typeof (open64) __open64_nocancel;
-/* Uncancelable write. */
-#define __write_nocancel(fd, buf, len) \
- INLINE_SYSCALL (write, 3, fd, buf, len)
-
-/* Uncancelable openat. */
-#define openat_not_cancel(fd, fname, oflag, mode) \
- INLINE_SYSCALL (openat, 4, fd, fname, oflag, mode)
-#define openat_not_cancel_3(fd, fname, oflag) \
- INLINE_SYSCALL (openat, 3, fd, fname, oflag)
-#define openat64_not_cancel(fd, fname, oflag, mode) \
- INLINE_SYSCALL (openat, 4, fd, fname, oflag | O_LARGEFILE, mode)
-#define openat64_not_cancel_3(fd, fname, oflag) \
- INLINE_SYSCALL (openat, 3, fd, fname, oflag | O_LARGEFILE)
+/* Non cancellable openat syscall. */
+__typeof (openat) __openat_nocancel;
-/* Uncancelable close. */
-#define __close_nocancel(fd) \
- INLINE_SYSCALL (close, 1, fd)
-#define close_not_cancel(fd) \
- __close_nocancel (fd)
-#define close_not_cancel_no_status(fd) \
- (void) ({ INTERNAL_SYSCALL_DECL (err); \
- INTERNAL_SYSCALL (close, err, 1, (fd)); })
-
-/* Uncancelable read. */
-#define read_not_cancel(fd, buf, n) \
- __read_nocancel (fd, buf, n)
+/* Non cacellable openat syscall (LFS version). */
+__typeof (openat64) __openat64_nocancel;
-/* Uncancelable write. */
-#define write_not_cancel(fd, buf, n) \
- __write_nocancel (fd, buf, n)
+/* Non cancellable read syscall. */
+__typeof (__read) __read_nocancel;
-/* Uncancelable writev. */
-#define writev_not_cancel_no_status(fd, iov, n) \
- (void) ({ INTERNAL_SYSCALL_DECL (err); \
- INTERNAL_SYSCALL (writev, err, 3, (fd), (iov), (n)); })
+/* Uncancelable write. */
+__typeof (__write) __write_nocancel;
-/* Uncancelable fcntl. */
-#define fcntl_not_cancel(fd, cmd, val) \
- __fcntl_nocancel (fd, cmd, val)
+/* Uncancelable close. */
+__typeof (__close) __close_nocancel;
+
+/* Non cancellable close syscall that does not also set errno in case of
+ failure. */
+static inline void
+__close_nocancel_nostatus (int fd)
+{
+ __close_nocancel (fd);
+}
+
+/* Non cancellable writev syscall that does not also set errno in case of
+ failure. */
+static inline void
+__writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt)
+{
+ INTERNAL_SYSCALL_DECL (err);
+ INTERNAL_SYSCALL_CALL (writev, err, fd, iov, iovcnt);
+}
/* Uncancelable waitpid. */
-#define __waitpid_nocancel(pid, stat_loc, options) \
- INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
-#define waitpid_not_cancel(pid, stat_loc, options) \
- __waitpid_nocancel(pid, stat_loc, options)
+__typeof (waitpid) __waitpid_nocancel;
/* Uncancelable pause. */
-#define pause_not_cancel() \
- ({ sigset_t set; \
- int __rc = INLINE_SYSCALL (rt_sigprocmask, 4, SIG_BLOCK, NULL, &set, \
- _NSIG / 8); \
- if (__rc == 0) \
- __rc = INLINE_SYSCALL (rt_sigsuspend, 2, &set, _NSIG / 8); \
- __rc; \
- })
+__typeof (pause) __pause_nocancel;
/* Uncancelable nanosleep. */
-#define nanosleep_not_cancel(requested_time, remaining) \
- INLINE_SYSCALL (nanosleep, 2, requested_time, remaining)
+__typeof (__nanosleep) __nanosleep_nocancel;
-/* Uncancelable sigsuspend. */
-#define sigsuspend_not_cancel(set) \
- INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8)
+/* Uncancelable fcntl. */
+__typeof (__fcntl) __fcntl64_nocancel;
+
+#if IS_IN (libc) || IS_IN (rtld)
+hidden_proto (__open_nocancel)
+hidden_proto (__open64_nocancel)
+hidden_proto (__openat_nocancel)
+hidden_proto (__openat64_nocancel)
+hidden_proto (__read_nocancel)
+hidden_proto (__write_nocancel)
+hidden_proto (__close_nocancel)
+hidden_proto (__waitpid_nocancel)
+hidden_proto (__pause_nocancel)
+hidden_proto (__nanosleep_nocancel)
+hidden_proto (__fcntl64_nocancel)
+#endif
#endif /* NOT_CANCEL_H */
diff --git a/sysdeps/unix/sysv/linux/not-errno.h b/sysdeps/unix/sysv/linux/not-errno.h
new file mode 100644
index 0000000000..106ba5c72e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/not-errno.h
@@ -0,0 +1,35 @@
+/* Syscall wrapper that do not set errno. Linux version.
+ Copyright (C) 2017-2018 Free Software 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 function is used on maybe_enable_malloc_check (elf/dl-tunables.c)
+ and to avoid having to build/use multiple versions if stack protection
+ in enabled it is defined as inline. */
+static inline int
+__access_noerrno (const char *pathname, int mode)
+{
+ int res;
+ INTERNAL_SYSCALL_DECL (err);
+#ifdef __NR_access
+ res = INTERNAL_SYSCALL_CALL (access, err, pathname, mode);
+#else
+ res = INTERNAL_SYSCALL_CALL (faccessat, err, AT_FDCWD, pathname, mode);
+#endif
+ if (INTERNAL_SYSCALL_ERROR_P (res, err))
+ return INTERNAL_SYSCALL_ERRNO (res, err);
+ return 0;
+}
diff --git a/sysdeps/unix/sysv/linux/nptl-signals.h b/sysdeps/unix/sysv/linux/nptl-signals.h
deleted file mode 100644
index 7560a21825..0000000000
--- a/sysdeps/unix/sysv/linux/nptl-signals.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Special use of signals in NPTL internals. Linux version.
- Copyright (C) 2014-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/>. */
-
-/* The signal used for asynchronous cancelation. */
-#define SIGCANCEL __SIGRTMIN
-
-
-/* Signal needed for the kernel-supported POSIX timer implementation.
- We can reuse the cancellation signal since we can distinguish
- cancellation from timer expirations. */
-#define SIGTIMER SIGCANCEL
-
-
-/* Signal used to implement the setuid et.al. functions. */
-#define SIGSETXID (__SIGRTMIN + 1)
-
-/* Used to communicate with signal handler. */
-extern struct xid_command *__xidcmd attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/nscd_setup_thread.c b/sysdeps/unix/sysv/linux/nscd_setup_thread.c
index 5a285d953d..645850604c 100644
--- a/sysdeps/unix/sysv/linux/nscd_setup_thread.c
+++ b/sysdeps/unix/sysv/linux/nscd_setup_thread.c
@@ -1,5 +1,5 @@
/* Setup of nscd worker threads. Linux verison.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
diff --git a/sysdeps/unix/sysv/linux/ntp_gettime.c b/sysdeps/unix/sysv/linux/ntp_gettime.c
index 95944c3a00..18650da94c 100644
--- a/sysdeps/unix/sysv/linux/ntp_gettime.c
+++ b/sysdeps/unix/sysv/linux/ntp_gettime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ntp_gettimex.c b/sysdeps/unix/sysv/linux/ntp_gettimex.c
index 9e879d2adc..e491549765 100644
--- a/sysdeps/unix/sysv/linux/ntp_gettimex.c
+++ b/sysdeps/unix/sysv/linux/ntp_gettimex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/i386/olddirent.h b/sysdeps/unix/sysv/linux/olddirent.h
index 71a4926290..1ed59c18ed 100644
--- a/sysdeps/unix/sysv/linux/i386/olddirent.h
+++ b/sysdeps/unix/sysv/linux/olddirent.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,10 +31,11 @@ struct __old_dirent64
/* Now define the internal interfaces. */
extern struct __old_dirent64 *__old_readdir64 (DIR *__dirp);
+libc_hidden_proto (__old_readdir64);
extern int __old_readdir64_r (DIR *__dirp, struct __old_dirent64 *__entry,
struct __old_dirent64 **__result);
extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes)
- internal_function;
+ attribute_hidden;
int __old_scandir64 (const char * __dir,
struct __old_dirent64 *** __namelist,
int (*__selector) (const struct __old_dirent64 *),
diff --git a/sysdeps/unix/sysv/linux/oldglob.c b/sysdeps/unix/sysv/linux/oldglob.c
new file mode 100644
index 0000000000..a034c2d930
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/oldglob.c
@@ -0,0 +1,46 @@
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) \
+ && !defined(GLOB_NO_OLD_VERSION)
+
+#include <dirent.h>
+#include <glob.h>
+#include <sys/stat.h>
+
+#include <olddirent.h>
+
+int __old_glob64 (const char *__pattern, int __flags,
+ int (*__errfunc) (const char *, int),
+ glob64_t *__pglob);
+libc_hidden_proto (__old_glob64);
+
+#define dirent __old_dirent64
+#define GL_READDIR(pglob, stream) \
+ ((struct __old_dirent64 *) (pglob)->gl_readdir (stream))
+#undef __readdir
+#define __readdir(dirp) __old_readdir64 (dirp)
+
+#define glob_t glob64_t
+#define __glob(pattern, flags, errfunc, pglob) \
+ __old_glob64 (pattern, flags, errfunc, pglob)
+#define globfree(pglob) globfree64(pglob)
+
+#define convert_dirent __old_convert_dirent
+#define glob_in_dir __old_glob_in_dir
+
+#undef stat
+#define stat stat64
+#undef __stat
+#define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
+
+/* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */
+#define GLOB_NO_LSTAT
+
+#define GLOB_ATTRIBUTE attribute_compat_text_section
+
+#include <posix/glob.c>
+
+libc_hidden_def (__old_glob64);
+
+compat_symbol (libc, __old_glob64, glob64, GLIBC_2_1);
+#endif
diff --git a/sysdeps/unix/sysv/linux/open.c b/sysdeps/unix/sysv/linux/open.c
new file mode 100644
index 0000000000..7f12292b87
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/open.c
@@ -0,0 +1,51 @@
+/* Linux open syscall implementation, non-LFS.
+ Copyright (C) 2017-2018 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 <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdarg.h>
+
+#include <sysdep-cancel.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG,
+ a third argument is the file protection. */
+int
+__libc_open (const char *file, int oflag, ...)
+{
+ int mode = 0;
+
+ if (__OPEN_NEEDS_MODE (oflag))
+ {
+ va_list arg;
+ va_start (arg, oflag);
+ mode = va_arg (arg, int);
+ va_end (arg);
+ }
+
+ return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag, mode);
+}
+libc_hidden_def (__libc_open)
+
+weak_alias (__libc_open, __open)
+libc_hidden_weak (__open)
+weak_alias (__libc_open, open)
+#endif
diff --git a/sysdeps/unix/sysv/linux/open64.c b/sysdeps/unix/sysv/linux/open64.c
index 01cbbb4f03..55ef658800 100644
--- a/sysdeps/unix/sysv/linux/open64.c
+++ b/sysdeps/unix/sysv/linux/open64.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Linux open syscall implementation, LFS.
+ Copyright (C) 1991-2018 Free Software 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,12 +16,20 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <fcntl.h>
#include <stdarg.h>
-#include <stdio.h>
+
#include <sysdep-cancel.h>
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+# define EXTRA_OPEN_FLAGS 0
+#else
+# define EXTRA_OPEN_FLAGS O_LARGEFILE
+#endif
+
/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG,
a third argument is the file protection. */
int
@@ -36,8 +45,17 @@ __libc_open64 (const char *file, int oflag, ...)
va_end (arg);
}
- return SYSCALL_CANCEL (open, file, oflag | O_LARGEFILE, mode);
+ return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag | EXTRA_OPEN_FLAGS,
+ mode);
}
-weak_alias (__libc_open64, __open64)
+
+strong_alias (__libc_open64, __open64)
libc_hidden_weak (__open64)
weak_alias (__libc_open64, open64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (__libc_open64, __libc_open)
+strong_alias (__libc_open64, __open)
+libc_hidden_weak (__open)
+weak_alias (__libc_open64, open)
+#endif
diff --git a/sysdeps/unix/sysv/linux/open64_nocancel.c b/sysdeps/unix/sysv/linux/open64_nocancel.c
new file mode 100644
index 0000000000..5d039eada6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/open64_nocancel.c
@@ -0,0 +1,54 @@
+/* Linux open syscall implementation, LFS, non-cancellable.
+ Copyright (C) 2018 Free Software 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/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdarg.h>
+
+#include <not-cancel.h>
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+# define EXTRA_OPEN_FLAGS 0
+#else
+# define EXTRA_OPEN_FLAGS O_LARGEFILE
+#endif
+
+int
+__open64_nocancel (const char *file, int oflag, ...)
+{
+ int mode = 0;
+
+ if (__OPEN_NEEDS_MODE (oflag))
+ {
+ va_list arg;
+ va_start (arg, oflag);
+ mode = va_arg (arg, int);
+ va_end (arg);
+ }
+
+ return INLINE_SYSCALL_CALL (openat, AT_FDCWD, file, oflag | EXTRA_OPEN_FLAGS,
+ mode);
+}
+
+hidden_def (__open64_nocancel)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (__open64_nocancel, __open_nocancel)
+hidden_def (__open_nocancel)
+#endif
diff --git a/sysdeps/unix/sysv/linux/open_by_handle_at.c b/sysdeps/unix/sysv/linux/open_by_handle_at.c
new file mode 100644
index 0000000000..906d60e770
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/open_by_handle_at.c
@@ -0,0 +1,37 @@
+/* Obtain handle for an open file via a handle. Linux implementation.
+ Copyright (C) 2017-2018 Free Software 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 <sysdep-cancel.h>
+
+int
+open_by_handle_at (int mount_fd, struct file_handle *handle, int flags)
+{
+#ifdef __NR_open_by_handle_at
+ return SYSCALL_CANCEL (open_by_handle_at, mount_fd, handle, flags);
+#else
+ __set_errno (ENOSYS);
+ return -1;
+#endif
+}
+
+#ifndef __NR_open_by_handle_at
+stub_warning (open_by_handle_at)
+#endif
diff --git a/sysdeps/unix/sysv/linux/open_nocancel.c b/sysdeps/unix/sysv/linux/open_nocancel.c
new file mode 100644
index 0000000000..2ee3e527cb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/open_nocancel.c
@@ -0,0 +1,46 @@
+/* Linux open syscall implementation, non-LFS, non-cancellable.
+ Copyright (C) 2018 Free Software 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/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdarg.h>
+
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+int
+__open_nocancel (const char *file, int oflag, ...)
+{
+ int mode = 0;
+
+ if (__OPEN_NEEDS_MODE (oflag))
+ {
+ va_list arg;
+ va_start (arg, oflag);
+ mode = va_arg (arg, int);
+ va_end (arg);
+ }
+
+ return INLINE_SYSCALL_CALL (openat, AT_FDCWD, file, oflag, mode);
+}
+hidden_def (__open_nocancel)
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/openat.c b/sysdeps/unix/sysv/linux/openat.c
index dd7605ffe2..d0ad242271 100644
--- a/sysdeps/unix/sysv/linux/openat.c
+++ b/sysdeps/unix/sysv/linux/openat.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Linux openat syscall implementation, non-LFS.
+ Copyright (C) 2005-2018 Free Software 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,31 +16,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sysdep-cancel.h>
-#include <not-cancel.h>
-
-
-#ifndef OPENAT
-# define OPENAT openat
-#endif
-#define UNDERIZE(name) UNDERIZE_1 (name)
-#define UNDERIZE_1(name) __##name
-#define __OPENAT UNDERIZE (OPENAT)
+#include <sysdep-cancel.h>
+#ifndef __OFF_T_MATCHES_OFF64_T
/* Open FILE with access OFLAG. Interpret relative paths relative to
the directory associated with FD. If OFLAG includes O_CREAT or
O_TMPFILE, a fourth argument is the file protection. */
int
-__OPENAT (int fd, const char *file, int oflag, ...)
+__libc_openat (int fd, const char *file, int oflag, ...)
{
mode_t mode = 0;
if (__OPEN_NEEDS_MODE (oflag))
@@ -50,12 +38,9 @@ __OPENAT (int fd, const char *file, int oflag, ...)
va_end (arg);
}
- /* We have to add the O_LARGEFILE flag for openat64. */
-#ifdef MORE_OFLAGS
- oflag |= MORE_OFLAGS;
-#endif
-
return SYSCALL_CANCEL (openat, fd, file, oflag, mode);
}
-libc_hidden_def (__OPENAT)
-weak_alias (__OPENAT, OPENAT)
+weak_alias (__libc_openat, __openat)
+libc_hidden_weak (__openat)
+weak_alias (__libc_openat, openat)
+#endif
diff --git a/sysdeps/unix/sysv/linux/openat64.c b/sysdeps/unix/sysv/linux/openat64.c
index 9e7a2b3737..536f4f5aff 100644
--- a/sysdeps/unix/sysv/linux/openat64.c
+++ b/sysdeps/unix/sysv/linux/openat64.c
@@ -1,4 +1,56 @@
-#define OPENAT openat64
-#define MORE_OFLAGS O_LARGEFILE
+/* Linux openat syscall implementation, LFS.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#include "openat.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.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <stdarg.h>
+
+#include <sysdep-cancel.h>
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+# define EXTRA_OPEN_FLAGS 0
+#else
+# define EXTRA_OPEN_FLAGS O_LARGEFILE
+#endif
+
+/* Open FILE with access OFLAG. Interpret relative paths relative to
+ the directory associated with FD. If OFLAG includes O_CREAT or
+ O_TMPFILE, a fourth argument is the file protection. */
+int
+__libc_openat64 (int fd, const char *file, int oflag, ...)
+{
+ mode_t mode = 0;
+ if (__OPEN_NEEDS_MODE (oflag))
+ {
+ va_list arg;
+ va_start (arg, oflag);
+ mode = va_arg (arg, mode_t);
+ va_end (arg);
+ }
+
+ return SYSCALL_CANCEL (openat, fd, file, oflag | EXTRA_OPEN_FLAGS, mode);
+}
+
+strong_alias (__libc_openat64, __openat64)
+libc_hidden_weak (__openat64)
+weak_alias (__libc_openat64, openat64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (__libc_openat64, __openat)
+libc_hidden_weak (__openat)
+weak_alias (__libc_openat64, openat)
+#endif
diff --git a/sysdeps/unix/sysv/linux/openat64_nocancel.c b/sysdeps/unix/sysv/linux/openat64_nocancel.c
new file mode 100644
index 0000000000..f3facc3b72
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/openat64_nocancel.c
@@ -0,0 +1,51 @@
+/* Linux openat syscall implementation, LFS, non-cancellable.
+ Copyright (C) 2018 Free Software 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 <stdarg.h>
+
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+# define EXTRA_OPEN_FLAGS 0
+#else
+# define EXTRA_OPEN_FLAGS O_LARGEFILE
+#endif
+
+int
+__openat64_nocancel (int fd, const char *file, int oflag, ...)
+{
+ mode_t mode = 0;
+ if (__OPEN_NEEDS_MODE (oflag))
+ {
+ va_list arg;
+ va_start (arg, oflag);
+ mode = va_arg (arg, mode_t);
+ va_end (arg);
+ }
+
+ return INLINE_SYSCALL_CALL (openat, fd, file, oflag | EXTRA_OPEN_FLAGS,
+ mode);
+}
+hidden_def (__openat64_nocancel)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (__openat64_nocancel, __openat_nocancel)
+hidden_def (__openat_nocancel)
+#endif
diff --git a/sysdeps/unix/sysv/linux/openat_nocancel.c b/sysdeps/unix/sysv/linux/openat_nocancel.c
new file mode 100644
index 0000000000..ac98238cda
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/openat_nocancel.c
@@ -0,0 +1,43 @@
+/* Linux openat syscall implementation, non-LFS, non-cancellable.
+ Copyright (C) 2018 Free Software 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 <stdarg.h>
+
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+int
+__openat_nocancel (int fd, const char *file, int oflag, ...)
+{
+ mode_t mode = 0;
+ if (__OPEN_NEEDS_MODE (oflag))
+ {
+ va_list arg;
+ va_start (arg, oflag);
+ mode = va_arg (arg, mode_t);
+ va_end (arg);
+ }
+
+ return INLINE_SYSCALL_CALL (openat, fd, file, oflag, mode);
+}
+hidden_def (__openat_nocancel)
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
deleted file mode 100644
index 1d1392ae58..0000000000
--- a/sysdeps/unix/sysv/linux/opendir.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (C) 2000-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 O_DIRECTORY_WORKS 1
-
-#include <sysdeps/posix/opendir.c>
diff --git a/sysdeps/unix/sysv/linux/opensock.c b/sysdeps/unix/sysv/linux/opensock.c
index 046468ca60..fd9445bc3b 100644
--- a/sysdeps/unix/sysv/linux/opensock.c
+++ b/sysdeps/unix/sysv/linux/opensock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
/* Return a socket of any type. The socket can be used in subsequent
ioctl calls to talk to the kernel. */
-int internal_function
+int
__opensock (void)
{
static int last_family; /* Available socket family we will use. */
diff --git a/sysdeps/unix/sysv/linux/pathconf.c b/sysdeps/unix/sysv/linux/pathconf.c
index 0c527368cf..59a50cea43 100644
--- a/sysdeps/unix/sysv/linux/pathconf.c
+++ b/sysdeps/unix/sysv/linux/pathconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -73,7 +73,7 @@ distinguish_extX (const struct statfs *fsbuf, const char *file, int fd)
return EXT2_LINK_MAX;
__snprintf (buf, sizeof (buf), "/sys/dev/block/%u:%u",
- gnu_dev_major (st.st_dev), gnu_dev_minor (st.st_dev));
+ __gnu_dev_major (st.st_dev), __gnu_dev_minor (st.st_dev));
ssize_t n = __readlink (buf, path, sizeof (path));
if (n != -1 && n < sizeof (path))
diff --git a/sysdeps/unix/sysv/linux/pathconf.h b/sysdeps/unix/sysv/linux/pathconf.h
index 7cc7c5e5e7..4c589a79df 100644
--- a/sysdeps/unix/sysv/linux/pathconf.h
+++ b/sysdeps/unix/sysv/linux/pathconf.h
@@ -1,5 +1,5 @@
/* Common parts of Linux implementation of pathconf and fpathconf.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,17 +24,21 @@
/* Used like: return __statfs_link_max (__statfs (name, &buf), &buf,
name, -1); */
extern long int __statfs_link_max (int result, const struct statfs *fsbuf,
- const char *file, int fd);
+ const char *file, int fd)
+ attribute_hidden;
/* Used like: return __statfs_filesize_max (__statfs (name, &buf), &buf); */
-extern long int __statfs_filesize_max (int result, const struct statfs *fsbuf);
+extern long int __statfs_filesize_max (int result, const struct statfs *fsbuf)
+ attribute_hidden;
/* Used like: return __statfs_link_max (__statfs (name, &buf), &buf); */
-extern long int __statfs_symlinks (int result, const struct statfs *fsbuf);
+extern long int __statfs_symlinks (int result, const struct statfs *fsbuf)
+ attribute_hidden;
/* Used like: return __statfs_chown_restricted (__statfs (name, &buf), &buf);*/
extern long int __statfs_chown_restricted (int result,
- const struct statfs *fsbuf);
+ const struct statfs *fsbuf)
+ attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/pause.c b/sysdeps/unix/sysv/linux/pause.c
new file mode 100644
index 0000000000..7b90365b98
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pause.c
@@ -0,0 +1,34 @@
+/* Linux pause syscall implementation.
+ Copyright (C) 2017-2018 Free Software 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 <unistd.h>
+#include <sysdep-cancel.h>
+
+/* Suspend the process until a signal arrives.
+ This always returns -1 and sets errno to EINTR. */
+int
+__libc_pause (void)
+{
+#ifdef __NR_pause
+ return SYSCALL_CANCEL (pause);
+#else
+ return SYSCALL_CANCEL (ppoll, NULL, 0, NULL, NULL);
+#endif
+}
+weak_alias (__libc_pause, pause)
diff --git a/sysdeps/unix/sysv/linux/pause_nocancel.c b/sysdeps/unix/sysv/linux/pause_nocancel.c
new file mode 100644
index 0000000000..322908c8ea
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pause_nocancel.c
@@ -0,0 +1,33 @@
+/* Linux pause syscall implementation -- non-cancellable.
+ Copyright (C) 2018 Free Software 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 <unistd.h>
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
+
+int
+__pause_nocancel (void)
+{
+#ifdef __NR_pause
+ return INLINE_SYSCALL_CALL (pause);
+#else
+ return INLINE_SYSCALL_CALL (ppoll, NULL, 0, NULL, NULL);
+#endif
+}
+hidden_def (__pause_nocancel)
diff --git a/sysdeps/unix/sysv/linux/personality.c b/sysdeps/unix/sysv/linux/personality.c
index 5485f49149..492f17c025 100644
--- a/sysdeps/unix/sysv/linux/personality.c
+++ b/sysdeps/unix/sysv/linux/personality.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/pkey_get.c b/sysdeps/unix/sysv/linux/pkey_get.c
new file mode 100644
index 0000000000..a38fae400f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pkey_get.c
@@ -0,0 +1,26 @@
+/* Obtaining the thread memory protection key, generic stub.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+pkey_get (int key)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
diff --git a/sysdeps/unix/sysv/linux/pkey_mprotect.c b/sysdeps/unix/sysv/linux/pkey_mprotect.c
new file mode 100644
index 0000000000..a947903538
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pkey_mprotect.c
@@ -0,0 +1,37 @@
+/* mprotect with a memory protection key.
+ Copyright (C) 2017-2018 Free Software 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/mman.h>
+#include <sys/syscall.h>
+#include <sysdep.h>
+
+int
+pkey_mprotect (void *addr, size_t len, int prot, int pkey)
+{
+ if (pkey == -1)
+ /* If the key is -1, the system call is precisely equivalent to
+ mprotect. */
+ return __mprotect (addr, len, prot);
+#ifdef __NR_pkey_mprotect
+ return INLINE_SYSCALL_CALL (pkey_mprotect, addr, len, prot, pkey);
+#else
+ __set_errno (ENOSYS);
+ return -1;
+#endif
+}
diff --git a/sysdeps/unix/sysv/linux/pkey_set.c b/sysdeps/unix/sysv/linux/pkey_set.c
new file mode 100644
index 0000000000..f6472b1526
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pkey_set.c
@@ -0,0 +1,26 @@
+/* Changing the thread memory protection key, generic stub.
+ Copyright (C) 2017-2018 Free Software 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>
+
+int
+pkey_set (int key, unsigned int access_rights)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
diff --git a/sysdeps/unix/sysv/linux/generic/poll.c b/sysdeps/unix/sysv/linux/poll.c
index ce99044b87..d60d3e36d7 100644
--- a/sysdeps/unix/sysv/linux/generic/poll.c
+++ b/sysdeps/unix/sysv/linux/poll.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Linux poll implementation.
+ Copyright (C) 2017-2018 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
@@ -25,6 +25,9 @@
int
__poll (struct pollfd *fds, nfds_t nfds, int timeout)
{
+#ifdef __NR_poll
+ return SYSCALL_CANCEL (poll, fds, nfds, timeout);
+#else
struct timespec timeout_ts;
struct timespec *timeout_ts_p = NULL;
@@ -36,6 +39,7 @@ __poll (struct pollfd *fds, nfds_t nfds, int timeout)
}
return SYSCALL_CANCEL (ppoll, fds, nfds, timeout_ts_p, NULL, 0);
+#endif
}
libc_hidden_def (__poll)
weak_alias (__poll, poll)
diff --git a/sysdeps/unix/sysv/linux/posix_fadvise.c b/sysdeps/unix/sysv/linux/posix_fadvise.c
index 093d707ccf..d676a68140 100644
--- a/sysdeps/unix/sysv/linux/posix_fadvise.c
+++ b/sysdeps/unix/sysv/linux/posix_fadvise.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,27 +22,47 @@
/* Advice the system about the expected behaviour of the application with
respect to the file associated with FD. */
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+/* Default implementation will use __NR_fadvise64 with expected argument
+ positions (for instance i386 and powerpc32 that uses __ALIGNMENT_ARG).
+
+ Second option will be used by arm which define __NR_arm_fadvise64_64
+ (redefined to __NR_fadvise64_64 in kernel-features.h) that behaves as
+ __NR_fadvise64_64 (without the aligment argument required for the ABI).
+
+ Third option will be used by mips o32. Mips will use a 7 argument
+ syscall with __NR_fadvise64.
+
+ 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);
+# if defined (__NR_fadvise64) && !defined (__ASSUME_FADVISE64_AS_64_64)
+ 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,
+ SYSCALL_LL (offset), SYSCALL_LL (len));
+# else
+
+# ifndef __NR_fadvise64_64
+# define __NR_fadvise64_64 __NR_fadvise64
+# 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..61dfe894ee 100644
--- a/sysdeps/unix/sysv/linux/posix_fadvise64.c
+++ b/sysdeps/unix/sysv/linux/posix_fadvise64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software 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,10 +17,22 @@
#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);
+libc_hidden_proto (__posix_fadvise64_l64)
+
+/* 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.
+
+ s390 implements fadvice64_64 using a specific struct with arguments
+ packed inside. This is the only implementation handled in arch-specific
+ code. */
+
+#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 +41,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 +69,11 @@ __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
+libc_hidden_def (__posix_fadvise64_l64)
diff --git a/sysdeps/unix/sysv/linux/posix_fallocate.c b/sysdeps/unix/sysv/linux/posix_fallocate.c
index fc9ac37893..766a48cb65 100644
--- a/sysdeps/unix/sysv/linux/posix_fallocate.c
+++ b/sysdeps/unix/sysv/linux/posix_fallocate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,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..e576f6f7c6 100644
--- a/sysdeps/unix/sysv/linux/posix_fallocate64.c
+++ b/sysdeps/unix/sysv/linux/posix_fallocate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <sysdep.h>
extern int __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len);
+libc_hidden_proto (__posix_fallocate64_l64)
#define __posix_fallocate64_l64 static internal_fallocate64
#include <sysdeps/posix/posix_fallocate64.c>
#undef __posix_fallocate64_l64
@@ -28,15 +29,18 @@ 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)
return INTERNAL_SYSCALL_ERRNO (res, err);
return internal_fallocate64 (fd, offset, len);
}
+libc_hidden_def (__posix_fallocate64_l64)
diff --git a/sysdeps/unix/sysv/linux/posix_madvise.c b/sysdeps/unix/sysv/linux/posix_madvise.c
index 8cb6ce9d73..b1e167211f 100644
--- a/sysdeps/unix/sysv/linux/posix_madvise.c
+++ b/sysdeps/unix/sysv/linux/posix_madvise.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/Makefile b/sysdeps/unix/sysv/linux/powerpc/Makefile
index c89ed9ec7d..19ac59d862 100644
--- a/sysdeps/unix/sysv/linux/powerpc/Makefile
+++ b/sysdeps/unix/sysv/linux/powerpc/Makefile
@@ -1,13 +1,11 @@
abi-variants := 32 64-v1 64-v2
-abi-32-options := -U__powerpc64__
abi-32-condition := __WORDSIZE == 32
-abi-64-v1-options := -D__powerpc64__ -U_CALL_ELF -D_CALL_ELF=1
abi-64-v1-condition := __WORDSIZE == 64 && _CALL_ELF != 2
-abi-64-v2-options := -D__powerpc64__ -U_CALL_ELF -D_CALL_ELF=2
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)
@@ -28,10 +26,12 @@ ifeq ($(subdir),misc)
sysdep_headers += bits/ppc.h
sysdep_routines += get_timebase_freq
tests += test-gettimebasefreq
+tests += test-powerpc-linux-sysconf
endif
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/arch-fork.h b/sysdeps/unix/sysv/linux/powerpc/arch-fork.h
deleted file mode 100644
index 5f945378ee..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/arch-fork.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/arch-fork.h>
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/environments.h b/sysdeps/unix/sysv/linux/powerpc/bits/environments.h
index edee623127..10542c95e1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/environments.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/environments.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
index e2f8bffa25..cd9ba6ed63 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/PowerPC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h
index 6ecac33a2a..1c75b2982c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h
@@ -1,5 +1,5 @@
/* Structure types for pre-termios terminal ioctls. Linux/powerpc version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h b/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h
index 5a87ac3d6f..50f2b6a7c9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h b/sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h
index 7032107390..049094e467 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Linux/PPC version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
index 21c5fa9e71..e652467c8c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/PowerPC version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,6 +36,8 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Flags for `mlockall'. */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/msq.h b/sysdeps/unix/sysv/linux/powerpc/bits/msq.h
index 0efa627a17..b98d293d54 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,6 +66,7 @@ struct msqid_ds
/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12
+# define MSG_STAT_ANY 13
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ppc.h b/sysdeps/unix/sysv/linux/powerpc/bits/ppc.h
index 66b1e00444..df7f7a69b6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/ppc.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/ppc.h
@@ -1,5 +1,5 @@
/* Facilities specific to the PowerPC architecture on Linux
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
deleted file mode 100644
index 345e79ae72..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Machine-specific pthread type layouts. PowerPC version.
- 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/>. */
-
-#ifndef _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define __SIZEOF_PTHREAD_ATTR_T 56
-# define __SIZEOF_PTHREAD_MUTEX_T 40
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 56
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 32
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#else
-# define __SIZEOF_PTHREAD_ATTR_T 36
-# define __SIZEOF_PTHREAD_MUTEX_T 24
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 32
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 20
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#endif
-
-
-/* Thread identifiers. The structure of the attribute type is
- deliberately not exposed. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-#if __WORDSIZE == 64
-typedef struct __pthread_internal_list
-{
- struct __pthread_internal_list *__prev;
- struct __pthread_internal_list *__next;
-} __pthread_list_t;
-#else
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-#endif
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is deliberately not exposed. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
-#if __WORDSIZE == 64
- unsigned int __nusers;
-#endif
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
-#if __WORDSIZE == 64
- short __spins;
- short __elision;
- __pthread_list_t __list;
-# define __PTHREAD_MUTEX_HAVE_PREV 1
-# define __PTHREAD_SPINS 0, 0
-#else
- unsigned int __nusers;
- __extension__ union
- {
- struct
- {
- short __espins;
- short __elision;
-# define __spins __elision_data.__espins
-# define __elision __elision_data.__elision
-# define __PTHREAD_SPINS { 0, 0 }
- } __elision_data;
- __pthread_slist_t __list;
- };
-#endif
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is deliberately not exposed. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is deliberately not exposed. */
-typedef union
-{
-# if __WORDSIZE == 64
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- int __writer;
- int __shared;
- unsigned char __rwelision;
- unsigned char __pad1[7];
- unsigned long int __pad2;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned int __flags;
-# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, {0, 0, 0, 0, 0, 0, 0 }
- } __data;
-# else
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- unsigned char __rwelision;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- int __writer;
-#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
- } __data;
-# endif
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/sem.h b/sysdeps/unix/sysv/linux/powerpc/bits/sem.h
index 0b0b191425..27b026cf61 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -72,6 +72,7 @@ struct semid_ds
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
+# define SEM_STAT_ANY 20
struct seminfo
{
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h b/sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h
index 5f711b81c6..8d6040adaa 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h
@@ -1,5 +1,5 @@
/* Machine-specific POSIX semaphore type layouts. PowerPC version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/shm.h b/sysdeps/unix/sysv/linux/powerpc/bits/shm.h
index 6e66bf7662..879023fb9a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -77,6 +77,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h b/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
index 5b9c0c1be9..cb01b0938d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
@@ -1,5 +1,5 @@
/* sigstack, sigaltstack definitions.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software 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,39 +16,17 @@
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
-
-/* Structure describing a signal stack (obsolete). */
-struct sigstack
- {
- void *ss_sp; /* Signal stack pointer. */
- int ss_onstack; /* Nonzero if executing on this stack. */
- };
-
-
-/* Possible values for `ss_flags.'. */
-enum
-{
- SS_ONSTACK = 1,
-#define SS_ONSTACK SS_ONSTACK
- SS_DISABLE
-#define SS_DISABLE SS_DISABLE
-};
-
/* Minimum stack size for a signal handler. */
#define MINSIGSTKSZ 4096
/* 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/stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
index f492825b7a..17654b5075 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
index e13ea3f676..1362cce551 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -187,7 +187,7 @@ struct termios {
/* c_lflag bits */
#define ISIG 0x00000080
#define ICANON 0x00000100
-#if defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
# define XCASE 0x00004000
#endif
#define ECHO 0x00000008
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
index 3e8a1e0a15..04ca9debf0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
@@ -5,15 +5,7 @@
# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
-#endif
-
-#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
-
-/* Signal the glibc ABI didn't used to have a `long double'.
- The changes all the `long double' function variants to be redirects
- to the double functions. */
-# define __LONG_DOUBLE_MATH_OPTIONAL 1
-# ifndef __LONG_DOUBLE_128__
-# define __NO_LONG_DOUBLE_MATH 1
-# endif
+# define __WORDSIZE_TIME64_COMPAT32 0
+# define __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-static.c b/sysdeps/unix/sysv/linux/powerpc/dl-static.c
index 821221f51e..d3722e1ad4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/dl-static.c
+++ b/sysdeps/unix/sysv/linux/powerpc/dl-static.c
@@ -1,5 +1,5 @@
/* Variable initialization. PowerPC version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
index 98ec2b3ec2..78051bc7bc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+++ b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
@@ -1,5 +1,5 @@
/* Operating system support for run-time dynamic linker. Linux/PPC version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-conf.c b/sysdeps/unix/sysv/linux/powerpc/elision-conf.c
index 21c3afdd86..906882a65e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-conf.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-conf.c
@@ -1,5 +1,5 @@
/* elision-conf.c: Lock elision tunable parameters.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,11 @@
#include <unistd.h>
#include <dl-procinfo.h>
+#if HAVE_TUNABLES
+# define TUNABLE_NAMESPACE elision
+#endif
+#include <elf/dl-tunables.h>
+
/* Reasonable initial tuning values, may be revised in the future.
This is a conservative initial value. */
@@ -50,7 +55,52 @@ struct elision_config __elision_aconf =
DEFAULT locks should be automatically use elision in pthread_mutex_lock().
Disabled for suid programs. Only used when elision is available. */
-int __pthread_force_elision attribute_hidden;
+int __pthread_force_elision attribute_hidden = 0;
+
+#if HAVE_TUNABLES
+static inline void
+__always_inline
+do_set_elision_enable (int32_t elision_enable)
+{
+ /* Enable elision if it's avaliable in hardware. It's not necessary to check
+ if __libc_enable_secure isn't enabled since elision_enable will be set
+ according to the default, which is disabled. */
+ if (elision_enable == 1)
+ __pthread_force_elision = (GLRO (dl_hwcap2)
+ & PPC_FEATURE2_HAS_HTM) ? 1 : 0;
+}
+
+/* The pthread->elision_enable tunable is 0 or 1 indicating that elision
+ should be disabled or enabled respectively. The feature will only be used
+ if it's supported by the hardware. */
+
+void
+TUNABLE_CALLBACK (set_elision_enable) (tunable_val_t *valp)
+{
+ int32_t elision_enable = (int32_t) valp->numval;
+ do_set_elision_enable (elision_enable);
+}
+
+#define TUNABLE_CALLBACK_FNDECL(__name, __type) \
+static inline void \
+__always_inline \
+do_set_elision_ ## __name (__type value) \
+{ \
+ __elision_aconf.__name = value; \
+} \
+void \
+TUNABLE_CALLBACK (set_elision_ ## __name) (tunable_val_t *valp) \
+{ \
+ __type value = (__type) (valp)->numval; \
+ do_set_elision_ ## __name (value); \
+}
+
+TUNABLE_CALLBACK_FNDECL (skip_lock_busy, int32_t);
+TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
+TUNABLE_CALLBACK_FNDECL (skip_lock_out_of_tbegin_retries, int32_t);
+TUNABLE_CALLBACK_FNDECL (try_tbegin, int32_t);
+TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
+#endif
/* Initialize elision. */
@@ -59,13 +109,26 @@ elision_init (int argc __attribute__ ((unused)),
char **argv __attribute__ ((unused)),
char **environ)
{
-#ifdef ENABLE_LOCK_ELISION
- int elision_available = (GLRO (dl_hwcap2) & PPC_FEATURE2_HAS_HTM) ? 1 : 0;
- __pthread_force_elision = __libc_enable_secure ? 0 : elision_available;
+#if HAVE_TUNABLES
+ /* Elision depends on tunables and must be explicitly turned on by setting
+ the appropriate tunable on a supported platform. */
+
+ TUNABLE_GET (enable, int32_t,
+ TUNABLE_CALLBACK (set_elision_enable));
+ TUNABLE_GET (skip_lock_busy, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_lock_busy));
+ TUNABLE_GET (skip_lock_internal_abort, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_lock_internal_abort));
+ TUNABLE_GET (skip_lock_after_retries, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_lock_out_of_tbegin_retries));
+ TUNABLE_GET (tries, int32_t,
+ TUNABLE_CALLBACK (set_elision_try_tbegin));
+ TUNABLE_GET (skip_trylock_internal_abort, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
#endif
+
if (!__pthread_force_elision)
- /* Disable elision on rwlocks. */
- __elision_aconf.try_tbegin = 0;
+ __elision_aconf.try_tbegin = 0; /* Disable elision on rwlocks. */
}
#ifdef SHARED
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-conf.h b/sysdeps/unix/sysv/linux/powerpc/elision-conf.h
index cf004b2299..85de593127 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-conf.h
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-conf.h
@@ -1,5 +1,5 @@
/* elision-conf.h: Lock elision tunable parameters.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-lock.c b/sysdeps/unix/sysv/linux/powerpc/elision-lock.c
index dd1e4c3b17..98a23f0dd2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-lock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-lock.c
@@ -1,5 +1,5 @@
/* elision-lock.c: Elided pthread mutex lock.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -45,7 +45,10 @@
int
__lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared)
{
- if (*adapt_count > 0)
+#ifndef __SPE__
+ /* adapt_count is accessed concurrently but is just a hint. Thus,
+ use atomic accesses but relaxed MO is sufficient. */
+ if (atomic_load_relaxed (adapt_count) > 0)
{
goto use_lock;
}
@@ -67,7 +70,8 @@ __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared)
if (_TEXASRU_FAILURE_PERSISTENT (__builtin_get_texasru ()))
{
if (aconf.skip_lock_internal_abort > 0)
- *adapt_count = aconf.skip_lock_internal_abort;
+ atomic_store_relaxed (adapt_count,
+ aconf.skip_lock_internal_abort);
goto use_lock;
}
}
@@ -75,8 +79,10 @@ __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared)
/* Fall back to locks for a bit if retries have been exhausted */
if (aconf.try_tbegin > 0 && aconf.skip_lock_out_of_tbegin_retries > 0)
- *adapt_count = aconf.skip_lock_out_of_tbegin_retries;
+ atomic_store_relaxed (adapt_count,
+ aconf.skip_lock_out_of_tbegin_retries);
use_lock:
+#endif
return LLL_LOCK ((*lock), pshared);
}
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-timed.c b/sysdeps/unix/sysv/linux/powerpc/elision-timed.c
index b3738e5e04..1082f566e4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-timed.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-timed.c
@@ -1,5 +1,5 @@
/* elision-timed.c: Lock elision timed lock.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c b/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
index 0807a6a432..fabb03b2c4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
@@ -1,5 +1,5 @@
/* elision-trylock.c: Lock eliding trylock for pthreads.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,11 +30,12 @@
int
__lll_trylock_elision (int *futex, short *adapt_count)
{
+#ifndef __SPE__
/* Implement POSIX semantics by forbiding nesting elided trylocks. */
__libc_tabort (_ABORT_NESTED_TRYLOCK);
/* Only try a transaction if it's worth it. */
- if (*adapt_count > 0)
+ if (atomic_load_relaxed (adapt_count) > 0)
{
goto use_lock;
}
@@ -49,7 +50,7 @@ __lll_trylock_elision (int *futex, short *adapt_count)
__libc_tend (0);
if (aconf.skip_lock_busy > 0)
- *adapt_count = aconf.skip_lock_busy;
+ atomic_store_relaxed (adapt_count, aconf.skip_lock_busy);
}
else
{
@@ -59,10 +60,12 @@ __lll_trylock_elision (int *futex, short *adapt_count)
result in another failure. Use normal locking now and
for the next couple of calls. */
if (aconf.skip_trylock_internal_abort > 0)
- *adapt_count = aconf.skip_trylock_internal_abort;
+ atomic_store_relaxed (adapt_count,
+ aconf.skip_trylock_internal_abort);
}
}
use_lock:
+#endif
return lll_trylock (*futex);
}
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c b/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
index 43c5a67df2..14e0680ee9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
@@ -1,5 +1,5 @@
/* elision-unlock.c: Commit an elided pthread lock.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,18 +23,25 @@
int
__lll_unlock_elision (int *lock, short *adapt_count, int pshared)
{
+#ifndef __SPE__
/* When the lock was free we're in a transaction. */
if (*lock == 0)
__libc_tend (0);
else
{
- lll_unlock ((*lock), pshared);
+ /* Update adapt_count in the critical section to prevent a
+ write-after-destroy error as mentioned in BZ 20822. The
+ following update of adapt_count has to be contained within
+ the critical region of the fall-back lock in order to not violate
+ the mutex destruction requirements. */
+ short __tmp = atomic_load_relaxed (adapt_count);
+ if (__tmp > 0)
+ atomic_store_relaxed (adapt_count, __tmp - 1);
- /* Update the adapt count AFTER completing the critical section.
- Doing this here prevents unneeded stalling when entering
- a critical section. Saving about 8% runtime on P8. */
- if (*adapt_count > 0)
- (*adapt_count)--;
+ lll_unlock ((*lock), pshared);
}
+#else
+ lll_unlock ((*lock), pshared);
+#endif
return 0;
}
diff --git a/sysdeps/unix/sysv/linux/powerpc/force-elision.h b/sysdeps/unix/sysv/linux/powerpc/force-elision.h
index 99c2669442..fe5d6ceade 100644
--- a/sysdeps/unix/sysv/linux/powerpc/force-elision.h
+++ b/sysdeps/unix/sysv/linux/powerpc/force-elision.h
@@ -1,5 +1,5 @@
/* force-elision.h: Automatic enabling of elision for mutexes
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software 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,7 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef ENABLE_LOCK_ELISION
/* Automatically enable elision for existing user lock kinds. */
#define FORCE_ELISION(m, s) \
if (__pthread_force_elision \
@@ -25,4 +24,3 @@
mutex->__data.__kind |= PTHREAD_MUTEX_ELISION_NP; \
s; \
}
-#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c b/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c
index 12a39b6865..3a2216021b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c
+++ b/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c
@@ -1,5 +1,5 @@
/* Get frequency of the system processor. powerpc/Linux version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,6 @@
#include <stdint.h>
#include <string.h>
#include <unistd.h>
-#include <libc-internal.h>
#include <sysdep.h>
#include <libc-vdso.h>
#include <not-cancel.h>
@@ -41,7 +40,7 @@ __get_clockfreq (void)
contains at least one line like:
timebase : 33333333
We search for this line and convert the number into an integer. */
- int fd = open_not_cancel_2 ("/proc/cpuinfo", O_RDONLY);
+ int fd = __open_nocancel ("/proc/cpuinfo", O_RDONLY);
if (__glibc_likely (fd != -1))
return result;
diff --git a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c
index 68acdffbf3..6435e1f315 100644
--- a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c
+++ b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c
@@ -1,5 +1,5 @@
/* Get the frequency of the time base.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/getdents64.c b/sysdeps/unix/sysv/linux/powerpc/getdents64.c
deleted file mode 100644
index 0c75fb5a06..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/getdents64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getdents64.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/getrlimit64.c b/sysdeps/unix/sysv/linux/powerpc/getrlimit64.c
deleted file mode 100644
index fef018f471..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/getrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
index 25a4e7caff..994a926a87 100644
--- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software 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,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/htm.h b/sysdeps/unix/sysv/linux/powerpc/htm.h
index 29cda8a741..6fbb1187c1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/htm.h
+++ b/sysdeps/unix/sysv/linux/powerpc/htm.h
@@ -2,7 +2,7 @@
compilers and assemblers that do not support the intrinsics and instructions
yet.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/init-first.c b/sysdeps/unix/sysv/linux/powerpc/init-first.c
index 0dff0b1ca4..0a4becbed6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/init-first.c
+++ b/sysdeps/unix/sysv/linux/powerpc/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. Linux/PowerPC.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/ioctl.c b/sysdeps/unix/sysv/linux/powerpc/ioctl.c
index f43e95c368..60cba4666e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/ioctl.c
+++ b/sysdeps/unix/sysv/linux/powerpc/ioctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -41,15 +41,15 @@ __ioctl (int fd, unsigned long int request, ...)
break;
case TCSETS:
- result = tcsetattr (fd, TCSANOW, (struct termios *) arg);
+ result = __tcsetattr (fd, TCSANOW, (struct termios *) arg);
break;
case TCSETSW:
- result = tcsetattr (fd, TCSADRAIN, (struct termios *) arg);
+ result = __tcsetattr (fd, TCSADRAIN, (struct termios *) arg);
break;
case TCSETSF:
- result = tcsetattr (fd, TCSAFLUSH, (struct termios *) arg);
+ result = __tcsetattr (fd, TCSAFLUSH, (struct termios *) arg);
break;
default:
@@ -61,4 +61,5 @@ __ioctl (int fd, unsigned long int request, ...)
return result;
}
+libc_hidden_def (__ioctl)
weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h b/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h
index baae7ab882..6231e46721 100644
--- a/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h
+++ b/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Old SysV permission definition for Linux. PowerPC version.
+ Copyright (C) 1995-2018 Free Software 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,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sys/ipc.h>
+#include <sys/ipc.h> /* For __key_t */
#define __IPC_64 0x100
@@ -30,17 +31,9 @@ struct __old_ipc_perm
unsigned short int __seq; /* Sequence number. */
};
+#define SEMCTL_ARG_ADDRESS(__arg) &__arg.array
-/* The codes for the functions to use the ipc syscall multiplexer. */
-#define IPCOP_semop 1
-#define IPCOP_semget 2
-#define IPCOP_semctl 3
-#define IPCOP_semtimedop 4
-#define IPCOP_msgsnd 11
-#define IPCOP_msgrcv 12
-#define IPCOP_msgget 13
-#define IPCOP_msgctl 14
-#define IPCOP_shmat 21
-#define IPCOP_shmdt 22
-#define IPCOP_shmget 23
-#define IPCOP_shmctl 24
+#define MSGRCV_ARGS(__msgp, __msgtyp) \
+ ((long int []){ (long int) __msgp, __msgtyp })
+
+#include <ipc_ops.h>
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index 14807adb27..503f562d76 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number. PowerPC version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,41 +20,35 @@
/* PowerPC uses socketcall. */
#define __ASSUME_SOCKETCALL 1
-/* The accept4 syscall was added for PowerPC in 2.6.37. */
-#if __LINUX_KERNEL_VERSION >= 0x020625
-# define __ASSUME_ACCEPT4_SYSCALL 1
-#endif
-
-/* The recvmmsg syscall was added for PowerPC in 2.6.37. */
-#if __LINUX_KERNEL_VERSION >= 0x020625
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
-
/* New syscalls added for PowerPC in 2.6.37. */
-#if __LINUX_KERNEL_VERSION >= 0x020625
-# define __ASSUME_SOCKET_SYSCALL 1
-# define __ASSUME_BIND_SYSCALL 1
-# define __ASSUME_CONNECT_SYSCALL 1
-# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT_SYSCALL 1
-# define __ASSUME_GETSOCKNAME_SYSCALL 1
-# define __ASSUME_GETPEERNAME_SYSCALL 1
-# define __ASSUME_SOCKETPAIR_SYSCALL 1
-# define __ASSUME_SEND_SYSCALL 1
-# define __ASSUME_SENDTO_SYSCALL 1
-# define __ASSUME_RECV_SYSCALL 1
-# define __ASSUME_RECVFROM_SYSCALL 1
-# define __ASSUME_SHUTDOWN_SYSCALL 1
-# define __ASSUME_GETSOCKOPT_SYSCALL 1
-# define __ASSUME_SETSOCKOPT_SYSCALL 1
-# define __ASSUME_SENDMSG_SYSCALL 1
-# define __ASSUME_RECVMSG_SYSCALL 1
+#define __ASSUME_SOCKET_SYSCALL 1
+#define __ASSUME_BIND_SYSCALL 1
+#define __ASSUME_CONNECT_SYSCALL 1
+#define __ASSUME_LISTEN_SYSCALL 1
+#define __ASSUME_GETSOCKNAME_SYSCALL 1
+#define __ASSUME_GETPEERNAME_SYSCALL 1
+#define __ASSUME_SOCKETPAIR_SYSCALL 1
+#define __ASSUME_SEND_SYSCALL 1
+#define __ASSUME_RECV_SYSCALL 1
+#define __ASSUME_SHUTDOWN_SYSCALL 1
+#define __ASSUME_GETSOCKOPT_SYSCALL 1
+#define __ASSUME_SETSOCKOPT_SYSCALL 1
+
+/* Define this if your 32-bit syscall API requires 64-bit register
+ pairs to start with an even-number register. */
+#ifndef __powerpc64__
+# define __ASSUME_ALIGNED_REGISTER_PAIRS 1
#endif
-/* The sendmmsg syscall was added for PowerPC in 3.0. */
-#if __LINUX_KERNEL_VERSION >= 0x030000
-# define __ASSUME_SENDMMSG_SYSCALL 1
+/* powerpc compat fadvise64_64 reorganize the syscall argument. */
+#ifndef __powerpc64__
+# define __ASSUME_FADVISE64_64_6ARG 1
#endif
-#define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL 1
#include_next <kernel-features.h>
+
+/* powerpc only supports ipc syscall. */
+#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h b/sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h
new file mode 100644
index 0000000000..aef3d5a3b3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h
@@ -0,0 +1,9 @@
+/* powerpc kernel sigaction is similar to generic Linux UAPI one,
+ but the architecture also defines SA_RESTORER. */
+#define SA_RESTORER 0x04000000
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
+
+#define SET_SA_RESTORER(kact, act) \
+ (kact)->sa_restorer = (act)->sa_restorer
+#define RESET_SA_RESTORER(act, kact) \
+ (act)->sa_restorer = (kact)->sa_restorer
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h b/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h
index 2b0074e657..8d76e0ae80 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/ldconfig.h b/sysdeps/unix/sysv/linux/powerpc/ldconfig.h
index 38959b4a3f..beca87e9f2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/powerpc/ldconfig.h
@@ -1,5 +1,5 @@
/* ldconfig default paths and libraries. Linux/PowerPC version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/ldsodefs.h b/sysdeps/unix/sysv/linux/powerpc/ldsodefs.h
index cd21c04ce6..118398bc10 100644
--- a/sysdeps/unix/sysv/linux/powerpc/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/powerpc/ldsodefs.h
@@ -1,6 +1,6 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
PowerPC version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/libc-start.c b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
index 0efd297409..f2ad0c355d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+++ b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/libc-start.h b/sysdeps/unix/sysv/linux/powerpc/libc-start.h
new file mode 100644
index 0000000000..689abb01a1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/libc-start.h
@@ -0,0 +1,30 @@
+/* PowerPC definitions for libc main startup.
+ Copyright (C) 2017-2018 Free Software 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 _LIBC_START_H
+#define _LIBC_START_H
+
+#ifndef SHARED
+/* IREL{,A} must happen after TCB initialization in order to allow IFUNC
+ resolvers to read TCB fields, e.g. hwcap and at_platform. */
+#define ARCH_SETUP_IREL()
+#define ARCH_SETUP_TLS() __libc_setup_tls ()
+#define ARCH_APPLY_IREL() apply_irel ()
+#endif /* ! SHARED */
+
+#endif /* _LIBC_START_H */
diff --git a/sysdeps/unix/sysv/linux/powerpc/libc-vdso.h b/sysdeps/unix/sysv/linux/powerpc/libc-vdso.h
index af0081bbcc..5fe817d6cb 100644
--- a/sysdeps/unix/sysv/linux/powerpc/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/powerpc/libc-vdso.h
@@ -1,5 +1,5 @@
/* Resolve function pointers to VDSO functions.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
index 9d63baa66d..8dea247cf9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
@@ -1,5 +1,5 @@
/* PowerPC specific lock definitions.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/not-errno.h b/sysdeps/unix/sysv/linux/powerpc/not-errno.h
new file mode 100644
index 0000000000..27da21bdf1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/not-errno.h
@@ -0,0 +1,30 @@
+/* Syscall wrapper that do not set errno. Linux powerpc version.
+ Copyright (C) 2018 Free Software 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/>. */
+
+/* __access_noerrno is used during process initialization in elf/dl-tunables.c
+ before the TCB is initialized, prohibiting the usage of
+ ABORT_TRANSACTION. */
+#undef ABORT_TRANSACTION
+#define ABORT_TRANSACTION
+
+#include "sysdeps/unix/sysv/linux/not-errno.h"
+
+/* Recover ABORT_TRANSACTION's previous value, in order to not affect
+ other syscalls. */
+#undef ABORT_TRANSACTION
+#define ABORT_TRANSACTION ABORT_TRANSACTION_IMPL
diff --git a/sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c
deleted file mode 100644
index 4c27e957bf..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
index 84324aa7e1..b2d7c8f6cc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
@@ -1,6 +1,15 @@
# See Makeconfig regarding the use of default-abi.
default-abi := 32
-ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64
+ifeq ($(subdir),csu)
+ifeq (yes,$(build-shared))
+sysdep_routines += divdi3
+shared-only-routines += divdi3
+CPPFLAGS-divdi3.c = -Din_divdi3_c
+endif
+endif
+
+ifeq ($(subdir),conform)
+# For bug 21635.
+conformtest-xfail-conds += powerpc32-linux
endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/____longjmp_chk.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/____longjmp_chk.S
index 9b591feac7..011bf0f1a7 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/alphasort64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/alphasort64.c
new file mode 100644
index 0000000000..c7de3a7547
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/alphasort64.c
@@ -0,0 +1,3 @@
+/* Although powerpc32 define _DIRENT_MATCHES_DIRENT64=0 and have compat
+ mode for 2.1, it does have a compat symbol for alphasort64. */
+#include <dirent/alphasort64.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S
index b4f8b2f9ef..2dc11845cb 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S
@@ -1,5 +1,5 @@
/* brk system call for Linux/ppc.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
index 28948eae84..7a05c280f2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
@@ -1,5 +1,5 @@
/* Wrapper around clone system call.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,10 +20,6 @@
#define _ERRNO_H 1
#include <bits/errno.h>
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
-
/* This is the only really unusual system call in PPC linux, but not
because of any weirdness in the system call itself; because of
all the freaky stuff we have to do to make the call useful. */
@@ -76,23 +72,11 @@ ENTRY (__clone)
crandc cr1*4+eq,cr1*4+eq,cr0*4+so
bne- cr1,L(parent) /* The '-' is to minimise the race. */
- andis. r0,r28,CLONE_THREAD>>16
- bne+ r0,L(oldpid)
- andi. r0,r28,CLONE_VM
- li r3,-1
- bne- r0,L(nomoregetpid)
- DO_CALL(SYS_ify(getpid))
-L(nomoregetpid):
- stw r3,TID(r2)
- stw r3,PID(r2)
-L(oldpid):
-
/* Call procedure. */
mtctr r30
mr r3,r31
bctrl
- /* Call _exit with result from procedure. */
- b HIDDEN_JUMPTARGET(_exit)
+ DO_CALL(SYS_ify(exit))
L(parent):
/* Parent. Restore registers & return. */
@@ -108,4 +92,5 @@ L(badargs):
cfi_startproc
END (__clone)
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/nofpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/nofpu/Implies
index 00365c1cfd..aab22f212c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/nofpu/Implies
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/nofpu/Implies
@@ -1,3 +1,2 @@
powerpc/powerpc32/e500/nofpu
powerpc/nofpu
-powerpc/soft-fp
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fcntl.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fcntl.c
deleted file mode 100644
index ea951bc4f9..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c
index 716f06e4dc..bc1180b8cc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c
@@ -1,5 +1,5 @@
/* Procedure definition for FE_MASK_ENV for Linux/ppc.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c
index b662653e35..010b87236b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c
@@ -1,5 +1,5 @@
/* Procedure definition for FE_NOMASK_ENV for Linux/ppc.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 6861846109..45839ed25b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -1322,7 +1320,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 _IO_2_1_stderr_ D 0xa0
GLIBC_2.1 _IO_2_1_stdin_ D 0xa0
GLIBC_2.1 _IO_2_1_stdout_ D 0xa0
@@ -1623,7 +1620,6 @@ GLIBC_2.1 xdr_uint16_t F
GLIBC_2.1 xdr_uint32_t F
GLIBC_2.1 xdr_uint8_t F
GLIBC_2.1 xdr_unixcred F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 _Exit F
GLIBC_2.1.1 __mempcpy_small F
GLIBC_2.1.1 __stpcpy_small F
@@ -1653,7 +1649,6 @@ GLIBC_2.1.1 xdr_longlong_t F
GLIBC_2.1.1 xdr_u_hyper F
GLIBC_2.1.1 xdr_u_longlong_t F
GLIBC_2.1.1 xdr_uint64_t F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
GLIBC_2.1.2 getaliasbyname_r F
GLIBC_2.1.2 getaliasent_r F
@@ -1681,11 +1676,9 @@ GLIBC_2.1.2 getservbyport_r F
GLIBC_2.1.2 getservent_r F
GLIBC_2.1.2 getspent_r F
GLIBC_2.1.2 getspnam_r F
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 __cxa_atexit F
GLIBC_2.1.3 __cxa_finalize F
GLIBC_2.1.3 __sigsuspend F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1711,7 +1704,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -1719,26 +1711,22 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x21c
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x21c
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1747,7 +1735,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __mcount_internal F
GLIBC_2.16 __poll_chk F
@@ -1759,7 +1746,6 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __ppc_get_timebase_freq F
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
@@ -1767,9 +1753,7 @@ GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_adjust_wcolumn F
GLIBC_2.2 _IO_fgetpos F
GLIBC_2.2 _IO_fgetpos64 F
@@ -1944,33 +1928,71 @@ GLIBC_2.2 wcsftime F
GLIBC_2.2 wmempcpy F
GLIBC_2.2 wprintf F
GLIBC_2.2 wscanf F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2064,7 +2086,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2077,7 +2098,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x104
GLIBC_2.3.3 getcontext F
GLIBC_2.3.3 gnu_dev_major F
@@ -2102,11 +2122,9 @@ GLIBC_2.3.3 setcontext F
GLIBC_2.3.3 swapcontext F
GLIBC_2.3.3 sys_sigabbrev D 0x104
GLIBC_2.3.3 sys_siglist D 0x104
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
-GLIBC_2.3.4 __longjmp F
GLIBC_2.3.4 __memcpy_chk F
GLIBC_2.3.4 __memmove_chk F
GLIBC_2.3.4 __mempcpy_chk F
@@ -2143,7 +2161,6 @@ GLIBC_2.3.4 siglongjmp F
GLIBC_2.3.4 swapcontext F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
@@ -2371,7 +2388,6 @@ GLIBC_2.4 wcstold F
GLIBC_2.4 wcstold_l F
GLIBC_2.4 wprintf F
GLIBC_2.4 wscanf F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2389,7 +2405,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2397,7 +2412,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2436,7 +2450,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __nldbl___asprintf_chk F
@@ -2453,7 +2466,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
index 5d2f263645..511b24b764 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _LIB_VERSION D 0x4
GLIBC_2.0 acos F
GLIBC_2.0 acosf F
@@ -155,7 +154,6 @@ GLIBC_2.0 y1l F
GLIBC_2.0 yn F
GLIBC_2.0 ynf F
GLIBC_2.0 ynl F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __clog10 F
GLIBC_2.1 __clog10f F
GLIBC_2.1 __clog10l F
@@ -312,7 +310,6 @@ GLIBC_2.1 tgammal F
GLIBC_2.1 trunc F
GLIBC_2.1 truncf F
GLIBC_2.1 truncl F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -394,11 +391,9 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 feclearexcept F
GLIBC_2.2 fedisableexcept F
GLIBC_2.2 feenableexcept F
@@ -409,12 +404,412 @@ GLIBC_2.2 feraiseexcept F
GLIBC_2.2 fesetenv F
GLIBC_2.2 fesetexceptflag F
GLIBC_2.2 feupdateenv F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 __nldbl_daddl F
+GLIBC_2.28 __nldbl_ddivl F
+GLIBC_2.28 __nldbl_dmull F
+GLIBC_2.28 __nldbl_dsubl F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data
index b25abf8006..e822e0a480 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data
@@ -5,11 +5,14 @@ libc.so: malloc
libc.so: memalign
libc.so: realloc
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
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c
deleted file mode 100644
index 9eee1d78fe..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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 <sys/types.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Truncate the file referenced by FD to LENGTH bytes. */
-int
-__ftruncate64 (int fd, off64_t length)
-{
- /* On PPC32 64bit values are aligned in odd/even register pairs. */
- int result = INLINE_SYSCALL (ftruncate64, 4, fd, 0,
- (long) (length >> 32),
- (long) length);
-
- return result;
-}
-weak_alias (__ftruncate64, ftruncate64)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
index d7f2766076..207dc90db0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
@@ -1,5 +1,5 @@
/* Save current context, powerpc32 common.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
index bb5b2fad73..adb3ec464e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c
deleted file mode 100644
index 82a9a296a7..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/glob64.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h
new file mode 100644
index 0000000000..11b0a8bb00
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 592
+#define SIGJMP_BUF_SIZE 592
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 448
+#define SAVED_MASK_OFFSET 452
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
index 75f7bcddd9..5829f9a610 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
@@ -1,5 +1,5 @@
/* Definition of `struct stat' used in the kernel.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -46,3 +46,6 @@ struct kernel_stat
#define _HAVE_STAT64___UNUSED5
#define _HAVE_STAT64___PAD2
#define _HAVE_STAT64_NSEC
+
+#define XSTAT_IS_XSTAT64 0
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
index 2eb4d5fef1..e8b0ea3a9b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
@@ -1,17 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
GLIBC_2.0 _r_debug D 0x14
GLIBC_2.0 calloc F
GLIBC_2.0 free F
GLIBC_2.0 malloc F
GLIBC_2.0 realloc F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_stack_end D 0x4
GLIBC_2.1 _dl_mcount F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 __tls_get_addr_opt F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __parse_hwcap_and_convert_at_platform F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libBrokenLocale.abilist
index 4a56bb68a3..54395f3c8d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libcrypt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libdl.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libdl.abilist
index 5536f6e0a9..7826fde951 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 dlopen F
GLIBC_2.1 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libnsl.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libnsl.abilist
index a23db2aeaf..add3d66a7a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __free_fdresult F
GLIBC_2.1 __nis_default_access F
GLIBC_2.1 __nis_default_group F
@@ -120,5 +118,4 @@ GLIBC_2.1 readColdStartFile F
GLIBC_2.1 writeColdStartFile F
GLIBC_2.1 xdr_cback_data F
GLIBC_2.1 xdr_obj_p F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 xdr_ypall F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
index 14c3a86b75..09e8447b06 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_flockfile F
GLIBC_2.0 _IO_ftrylockfile F
GLIBC_2.0 _IO_funlockfile F
@@ -119,7 +118,6 @@ GLIBC_2.0 vfork F
GLIBC_2.0 wait F
GLIBC_2.0 waitpid F
GLIBC_2.0 write F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_allocate_rtsig F
GLIBC_2.1 __libc_current_sigrtmax F
GLIBC_2.1 __libc_current_sigrtmin F
@@ -154,24 +152,18 @@ GLIBC_2.1 sem_init F
GLIBC_2.1 sem_post F
GLIBC_2.1 sem_trywait F
GLIBC_2.1 sem_wait F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 sem_close F
GLIBC_2.1.1 sem_open F
GLIBC_2.1.1 sem_unlink F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __open64 F
GLIBC_2.2 __pread64 F
GLIBC_2.2 __pthread_rwlock_destroy F
@@ -212,18 +204,35 @@ GLIBC_2.2 pthread_yield F
GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -239,7 +248,6 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 longjmp F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@@ -247,7 +255,6 @@ GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
GLIBC_2.3.4 siglongjmp F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
@@ -257,6 +264,5 @@ GLIBC_2.4 pthread_mutexattr_getrobust_np F
GLIBC_2.4 pthread_mutexattr_setprioceiling F
GLIBC_2.4 pthread_mutexattr_setprotocol F
GLIBC_2.4 pthread_mutexattr_setrobust_np F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 pthread_attr_setstack F
GLIBC_2.6 pthread_attr_setstacksize F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libresolv.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libresolv.abilist
index 4d50e7c8c6..157a33ce35 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
index 15e4418863..595f1b712a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 aio_cancel F
GLIBC_2.1 aio_cancel64 F
GLIBC_2.1 aio_error F
@@ -16,7 +15,6 @@ GLIBC_2.1 aio_write F
GLIBC_2.1 aio_write64 F
GLIBC_2.1 lio_listio F
GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 clock_getcpuclockid F
GLIBC_2.2 clock_getres F
GLIBC_2.2 clock_gettime F
@@ -29,7 +27,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -40,8 +37,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libthread_db.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist
index 89c67755c4..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
index 7411f2801c..f958616d73 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
@@ -1,5 +1,5 @@
/* Set up a context to call a function.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies
index 40836b6fb4..d0e048e87c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies
@@ -1,2 +1 @@
powerpc/nofpu
-powerpc/soft-fp
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/context-e500.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/context-e500.h
index 4cfcb187c6..f1357fa011 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/context-e500.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/context-e500.h
@@ -1,5 +1,5 @@
/* getcontext/setcontext/makecontext support for e500 high parts of registers.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S
index eced409967..ca90ae15e0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index fd611aa9b4..344e5ae87c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -1322,7 +1320,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 _IO_2_1_stderr_ D 0xa0
GLIBC_2.1 _IO_2_1_stdin_ D 0xa0
GLIBC_2.1 _IO_2_1_stdout_ D 0xa0
@@ -1623,7 +1620,6 @@ GLIBC_2.1 xdr_uint16_t F
GLIBC_2.1 xdr_uint32_t F
GLIBC_2.1 xdr_uint8_t F
GLIBC_2.1 xdr_unixcred F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 _Exit F
GLIBC_2.1.1 __mempcpy_small F
GLIBC_2.1.1 __stpcpy_small F
@@ -1653,7 +1649,6 @@ GLIBC_2.1.1 xdr_longlong_t F
GLIBC_2.1.1 xdr_u_hyper F
GLIBC_2.1.1 xdr_u_longlong_t F
GLIBC_2.1.1 xdr_uint64_t F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
GLIBC_2.1.2 getaliasbyname_r F
GLIBC_2.1.2 getaliasent_r F
@@ -1681,11 +1676,9 @@ GLIBC_2.1.2 getservbyport_r F
GLIBC_2.1.2 getservent_r F
GLIBC_2.1.2 getspent_r F
GLIBC_2.1.2 getspnam_r F
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 __cxa_atexit F
GLIBC_2.1.3 __cxa_finalize F
GLIBC_2.1.3 __sigsuspend F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1711,7 +1704,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -1719,26 +1711,22 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x21c
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x21c
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1747,7 +1735,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __mcount_internal F
GLIBC_2.16 __poll_chk F
@@ -1759,7 +1746,6 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __ppc_get_timebase_freq F
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
@@ -1767,14 +1753,11 @@ GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.19 GLIBC_2.19 A
GLIBC_2.19 __atomic_feclearexcept F
GLIBC_2.19 __atomic_feholdexcept F
GLIBC_2.19 __atomic_feupdateenv F
GLIBC_2.19 __flt_rounds F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_adjust_wcolumn F
GLIBC_2.2 _IO_fgetpos F
GLIBC_2.2 _IO_fgetpos64 F
@@ -1949,33 +1932,71 @@ GLIBC_2.2 wcsftime F
GLIBC_2.2 wmempcpy F
GLIBC_2.2 wprintf F
GLIBC_2.2 wscanf F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2069,7 +2090,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __adddf3 F
GLIBC_2.3.2 __addsf3 F
GLIBC_2.3.2 __divdf3 F
@@ -2111,7 +2131,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x104
GLIBC_2.3.3 getcontext F
GLIBC_2.3.3 gnu_dev_major F
@@ -2136,7 +2155,6 @@ GLIBC_2.3.3 setcontext F
GLIBC_2.3.3 swapcontext F
GLIBC_2.3.3 sys_sigabbrev D 0x104
GLIBC_2.3.3 sys_siglist D 0x104
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2176,7 +2194,6 @@ GLIBC_2.3.4 siglongjmp F
GLIBC_2.3.4 swapcontext F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
@@ -2416,7 +2433,6 @@ GLIBC_2.4 wcstold F
GLIBC_2.4 wcstold_l F
GLIBC_2.4 wprintf F
GLIBC_2.4 wscanf F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2434,7 +2450,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2442,7 +2457,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2481,7 +2495,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __nldbl___asprintf_chk F
@@ -2498,7 +2511,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
index 8b5edb52a0..a6e4e4edaa 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _LIB_VERSION D 0x4
GLIBC_2.0 acos F
GLIBC_2.0 acosf F
@@ -155,7 +154,6 @@ GLIBC_2.0 y1l F
GLIBC_2.0 yn F
GLIBC_2.0 ynf F
GLIBC_2.0 ynl F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __clog10 F
GLIBC_2.1 __clog10f F
GLIBC_2.1 __clog10l F
@@ -311,7 +309,6 @@ GLIBC_2.1 tgammal F
GLIBC_2.1 trunc F
GLIBC_2.1 truncf F
GLIBC_2.1 truncl F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -393,11 +390,9 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 feclearexcept F
GLIBC_2.2 fedisableexcept F
GLIBC_2.2 feenableexcept F
@@ -408,12 +403,412 @@ GLIBC_2.2 feraiseexcept F
GLIBC_2.2 fesetenv F
GLIBC_2.2 fesetexceptflag F
GLIBC_2.2 feupdateenv F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 __nldbl_daddl F
+GLIBC_2.28 __nldbl_ddivl F
+GLIBC_2.28 __nldbl_dmull F
+GLIBC_2.28 __nldbl_dsubl F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data
index 8c4e65d123..fead931d4e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data
@@ -35,11 +35,14 @@ libc.so: realloc
libm.so: copysignl ?
libm.so: fabsl
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
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S
index 4abc5fc9a6..0fbb7a814e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S
@@ -1,5 +1,5 @@
/* Jump to a new context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S
index 08cb796e9c..c2302c8f58 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and jump to a new context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise.c
deleted file mode 100644
index e846bf58c5..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise.c
+++ /dev/null
@@ -1,39 +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, 6, fd, 0,
- __LONG_LONG_PAIR (offset >> 31, 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/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/powerpc32/pread.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
deleted file mode 100644
index 2d67013ab3..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
+++ /dev/null
@@ -1,34 +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/>. */
-
-#include <assert.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
- /* On PPC32 64bit values are aligned in odd/even register pairs. */
- return SYSCALL_CANCEL (pread, fd, buf, count, 0, offset >> 31, offset);
-}
-
-strong_alias (__libc_pread, __pread)
-weak_alias (__libc_pread, pread)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
deleted file mode 100644
index 712ab72934..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
+++ /dev/null
@@ -1,35 +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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-
-ssize_t
-__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
- /* On PPC32 64bit values are aligned in odd/even register pairs. */
- return SYSCALL_CANCEL (pread, fd, buf, count, 0, (long) (offset >> 32),
- (long) offset);
-}
-
-weak_alias (__libc_pread64, __pread64)
-weak_alias (__libc_pread64, pread64)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
deleted file mode 100644
index 4001b47f46..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
+++ /dev/null
@@ -1,35 +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/>. */
-
-#include <assert.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
- /* On PPC32 64bit values are aligned in odd/even register pairs. */
- return SYSCALL_CANCEL (pwrite, fd, buf, count, 0, offset >> 31, offset);
-}
-
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__libc_pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
deleted file mode 100644
index 8a513fa2f9..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
+++ /dev/null
@@ -1,36 +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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-
-ssize_t
-__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
- /* On PPC32 64bit values are aligned in odd/even register pairs. */
- return SYSCALL_CANCEL (pwrite, fd, buf, count, 0, (long) (offset >> 32),
- (long) offset);
-}
-
-weak_alias (__libc_pwrite64, __pwrite64)
-libc_hidden_weak (__pwrite64)
-weak_alias (__libc_pwrite64, pwrite64)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/scandir64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/scandir64.c
deleted file mode 100644
index 506fd8877c..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/scandir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/scandir64.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
index f4ed9a9bbf..cc84e0bc45 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -1,5 +1,5 @@
/* Jump to a new context powerpc32 common.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
index 8b7d74b415..700289b273 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
@@ -1,5 +1,5 @@
/* Jump to a new context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
index 1aaa656ab4..7584acef08 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
@@ -1,5 +1,5 @@
/* Save current context and jump to a new context.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -271,7 +271,8 @@ ENTRY(__CONTEXT_FUNC_NAME)
/* Restore ucontext (parm1) from stack. */
lwz r12,_FRAME_PARM_SAVE1(r1)
- li r4,0
+ lwz r4,_FRAME_PARM_SAVE2(r1)
+ addi r4,r4,_UC_SIGMASK
stw r3,_UC_REGS_PTR(r12)
addi r5,r12,_UC_SIGMASK
li r3,SIG_SETMASK
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
index d97fe34c13..ec089f4c03 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and jump to a new context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
index 451d50884b..966856e64a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
@@ -3,12 +3,5 @@
chown - chown i:sii __chown chown@@GLIBC_2.1
lchown - lchown i:sii __lchown lchown@@GLIBC_2.0 chown@GLIBC_2.0
-# System calls with wrappers.
-oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
-setrlimit - setrlimit i:ip __setrlimit setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
-
-# Due to 64bit alignment there is a dummy second parameter
-readahead - readahead i:iiiii __readahead readahead
-
prlimit64 EXTRA prlimit64 i:iipp prlimit64
fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
deleted file mode 100644
index f29f0188fc..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Cancellable system call stubs. Linux/PowerPC version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Franz Sirl <Franz.Sirl-kernel@lauterbach.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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- SINGLE_THREAD_P; \
- bne- .Lpseudo_cancel; \
- .type __##syscall_name##_nocancel,@function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- DO_CALL (SYS_ify (syscall_name)); \
- PSEUDO_RET; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
- .Lpseudo_cancel: \
- stwu 1,-48(1); \
- cfi_adjust_cfa_offset (48); \
- mflr 9; \
- stw 9,52(1); \
- cfi_offset (lr, 4); \
- DOCARGS_##args; /* save syscall args around CENABLE. */ \
- CENABLE; \
- stw 3,16(1); /* store CENABLE return value (MASK). */ \
- UNDOCARGS_##args; /* restore syscall args. */ \
- DO_CALL (SYS_ify (syscall_name)); \
- mfcr 0; /* save CR/R3 around CDISABLE. */ \
- stw 3,8(1); \
- stw 0,12(1); \
- lwz 3,16(1); /* pass MASK to CDISABLE. */ \
- CDISABLE; \
- lwz 4,52(1); \
- lwz 0,12(1); /* restore CR/R3. */ \
- lwz 3,8(1); \
- mtlr 4; \
- mtcr 0; \
- addi 1,1,48;
-
-# define DOCARGS_0
-# define UNDOCARGS_0
-
-# define DOCARGS_1 stw 3,20(1); DOCARGS_0
-# define UNDOCARGS_1 lwz 3,20(1); UNDOCARGS_0
-
-# define DOCARGS_2 stw 4,24(1); DOCARGS_1
-# define UNDOCARGS_2 lwz 4,24(1); UNDOCARGS_1
-
-# define DOCARGS_3 stw 5,28(1); DOCARGS_2
-# define UNDOCARGS_3 lwz 5,28(1); UNDOCARGS_2
-
-# define DOCARGS_4 stw 6,32(1); DOCARGS_3
-# define UNDOCARGS_4 lwz 6,32(1); UNDOCARGS_3
-
-# define DOCARGS_5 stw 7,36(1); DOCARGS_4
-# define UNDOCARGS_5 lwz 7,36(1); UNDOCARGS_4
-
-# define DOCARGS_6 stw 8,40(1); DOCARGS_5
-# define UNDOCARGS_6 lwz 8,40(1); UNDOCARGS_5
-
-# if IS_IN (libpthread)
-# define CENABLE bl __pthread_enable_asynccancel@local
-# define CDISABLE bl __pthread_disable_asynccancel@local
-# elif IS_IN (libc)
-# define CENABLE bl __libc_enable_asynccancel@local
-# define CDISABLE bl __libc_disable_asynccancel@local
-# elif IS_IN (librt)
-# define CENABLE bl __librt_enable_asynccancel@local
-# define CDISABLE bl __librt_disable_asynccancel@local
-# else
-# error Unsupported library
-# endif
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P \
- lwz 10,MULTIPLE_THREADS_OFFSET(2); \
- cmpwi 10,0
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
index 6d8990c5de..f7277d59e1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,24 +22,6 @@
#include <sysdeps/unix/powerpc/sysdep.h>
#include <tls.h>
-/* Some systen calls got renamed over time, but retained the same semantics.
- Handle them here so they can be catched by both C and assembler stubs in
- glibc. */
-
-#ifdef __NR_pread64
-# ifdef __NR_pread
-# error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
-#ifdef __NR_pwrite64
-# ifdef __NR_pwrite
-# error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
/* For Linux we can use the system call table in the header file
/usr/include/asm/unistd.h
of the kernel. But these symbols do not follow the SYS_* syntax
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
deleted file mode 100644
index ccfdafa74b..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* 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 <sys/types.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Truncate the file referenced by FD to LENGTH bytes. */
-int
-truncate64 (const char *path, off64_t length)
-{
- /* On PPC32 64bit values are aligned in odd/even register pairs. */
- int result = INLINE_SYSCALL (truncate64, 4, path, 0,
- (long) (length >> 32),
- (long) length);
- return result;
-}
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/versionsort64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/versionsort64.c
new file mode 100644
index 0000000000..ee0e86672d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/versionsort64.c
@@ -0,0 +1,3 @@
+/* Although powerpc32 define _DIRENT_MATCHES_DIRENT64=0 and have compat
+ mode for 2.1, it does have a compat symbol for alphasort64. */
+#include <dirent/versionsort64.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S
index edbc7de1e6..2d096629bf 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,34 +27,8 @@
ENTRY (__vfork)
- /* Load the TCB-cached PID value and negates it. If It it is zero
- sets it to 0x800000. And then sets its value again on TCB field.
- See raise.c for the logic that relies on this value. */
-
- lwz r0,PID(r2)
- cmpwi cr0,r0,0
- neg r0,r0
- bne- cr0,1f
- lis r0,0x8000
-1: stw r0,PID(r2)
-
DO_CALL (SYS_ify (vfork))
- cmpwi cr1,r3,0
- beqlr- 1
-
- /* Restore the original value of the TCB cache of the PID, if we're
- the parent. But in the child (syscall return value equals zero),
- leave things as they are. */
- lwz r0,PID(r2)
- /* Cannot use clrlwi. here, because cr0 needs to be preserved
- until PSEUDO_RET. */
- clrlwi r4,r0,1
- cmpwi cr1,r4,0
- beq- cr1,1f
- neg r4,r0
-1: stw r4,PID(r2)
-
PSEUDO_RET
PSEUDO_END (__vfork)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/970/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/970/Implies
deleted file mode 100644
index 76a32ce7b5..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/970/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/970/fpu
-powerpc/powerpc64/970
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S
index bf84e7c46c..d4d7eb411c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/a2/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/a2/Implies
deleted file mode 100644
index 39b19e9c1f..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/a2/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/a2/fpu
-powerpc/powerpc64/a2
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/970/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/970/Implies
new file mode 100644
index 0000000000..1ef894bfe0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/970/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/be/970/fpu
+powerpc/powerpc64/be/970
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/a2/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/a2/Implies
new file mode 100644
index 0000000000..c8774754fc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/a2/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/be/a2/fpu
+powerpc/powerpc64/be/a2
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/cell/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/cell/Implies
new file mode 100644
index 0000000000..0da65967a2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/cell/Implies
@@ -0,0 +1,2 @@
+powerpc/powerpc64/be/cell/fpu
+powerpc/powerpc64/be/cell
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/cell/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/cell/fpu/Implies
new file mode 100644
index 0000000000..6c526bba1c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/cell/fpu/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/be/cell/fpu
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
index 5919b88fc7..c8cb7edf77 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
@@ -1,5 +1,5 @@
/* brk system call for Linux. PowerPC64 version.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/cell/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/cell/Implies
deleted file mode 100644
index 583d4084a4..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/cell/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-powerpc/powerpc64/cell/fpu
-powerpc/powerpc64/cell
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/cell/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/cell/fpu/Implies
deleted file mode 100644
index b6720ecda5..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/cell/fpu/Implies
+++ /dev/null
@@ -1 +0,0 @@
-powerpc/powerpc64/cell/fpu
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
index c8c6de8229..a4c8bbeac0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
@@ -1,5 +1,5 @@
/* Wrapper around clone system call. PowerPC64 version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,9 +20,6 @@
#define _ERRNO_H 1
#include <bits/errno.h>
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
/* This is the only really unusual system call in PPC linux, but not
because of any weirdness in the system call itself; because of
all the freaky stuff we have to do to make the call useful. */
@@ -78,32 +75,17 @@ ENTRY (__clone)
crandc cr1*4+eq,cr1*4+eq,cr0*4+so
bne- cr1,L(parent) /* The '-' is to minimise the race. */
- andis. r0,r29,CLONE_THREAD>>16
- bne+ cr0,L(oldpid)
- andi. r0,r29,CLONE_VM
- li r3,-1
- bne- cr0,L(nomoregetpid)
- DO_CALL(SYS_ify(getpid))
-L(nomoregetpid):
- stw r3,TID(r13)
- stw r3,PID(r13)
-L(oldpid):
-
std r2,FRAME_TOC_SAVE(r1)
/* Call procedure. */
PPC64_LOAD_FUNCPTR r30
mr r3,r31
bctrl
ld r2,FRAME_TOC_SAVE(r1)
- /* Call _exit with result from procedure. */
-#ifdef SHARED
- b JUMPTARGET(__GI__exit)
-#else
- b JUMPTARGET(_exit)
+
+ DO_CALL(SYS_ify(exit))
/* We won't ever get here but provide a nop so that the linker
will insert a toc adjusting stub if necessary. */
nop
-#endif
L(badargs):
cfi_startproc
@@ -126,4 +108,5 @@ L(parent):
END (__clone)
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
index af069700e9..ae7f254da4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
@@ -4,8 +4,8 @@
test -n "$libc_cv_slibdir" ||
case "$prefix" in
/usr | /usr/)
- libc_cv_slibdir=/lib64
- libc_cv_rtlddir=/lib64
+ libc_cv_slibdir='/lib64'
+ libc_cv_rtlddir='/lib64'
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
# Locale data can be shared between 32-bit and 64-bit libraries.
@@ -207,3 +207,27 @@ $as_echo "$libc_cv_ppc64_def_call_elf" >&6; }
libc_extra_cppflags="$libc_extra_cppflags -D_CALL_ELF=1"
fi
fi
+# Set minimum kernel version for ppc64le.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the machine type to set minimum kernel version" >&5
+$as_echo_n "checking the machine type to set minimum kernel version... " >&6; }
+if ${libc_cv_ppc64_le+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ yes
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ arch_minimum_kernel=3.10.0
+else
+ libc_cv_ppc64_le=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ppc64_le" >&5
+$as_echo "$libc_cv_ppc64_le" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
index 0822915c43..f9cba6e15d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
@@ -27,3 +27,10 @@ else
libc_extra_cppflags="$libc_extra_cppflags -D_CALL_ELF=1"
fi
fi
+# Set minimum kernel version for ppc64le.
+AC_CACHE_CHECK([the machine type to set minimum kernel version],
+ [libc_cv_ppc64_le],
+ [AC_EGREP_CPP(yes,[#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ yes
+ #endif
+ ], arch_minimum_kernel=3.10.0, libc_cv_ppc64_le=no)])
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/dl-cache.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/dl-cache.h
index ec69399bab..78dac07783 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c
deleted file mode 100644
index 0167c8fbd2..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright (C) 2000-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 <assert.h>
-#include <errno.h>
-#include <sysdep-cancel.h> /* Must come before <fcntl.h>. */
-#include <fcntl.h>
-#include <stdarg.h>
-
-#include <sys/syscall.h>
-
-
-#ifndef NO_CANCELLATION
-int
-__fcntl_nocancel (int fd, int cmd, ...)
-{
- va_list ap;
- void *arg;
-
- va_start (ap, cmd);
- arg = va_arg (ap, void *);
- va_end (ap);
-
- return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
-}
-#endif
-
-
-int
-__libc_fcntl (int fd, int cmd, ...)
-{
- va_list ap;
- void *arg;
-
- va_start (ap, cmd);
- arg = va_arg (ap, void *);
- va_end (ap);
-
- if (cmd >= F_GETLK64 && cmd <= F_SETLKW64)
- cmd -= F_GETLK64 - F_GETLK;
-
- if (cmd != F_SETLKW)
- return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
-
- return SYSCALL_CANCEL (fcntl, fd, cmd, arg);
-}
-libc_hidden_def (__libc_fcntl)
-
-weak_alias (__libc_fcntl, __fcntl)
-libc_hidden_weak (__fcntl)
-weak_alias (__libc_fcntl, fcntl)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
index 8e20cd55d0..31564bee6c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
@@ -1,5 +1,5 @@
/* Procedure definition for FE_MASK_ENV for Linux/ppc64.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
index 14ace1b2b8..486ef84386 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
@@ -1,5 +1,5 @@
/* Procedure definition for FE_NOMASK_ENV for Linux/ppc64.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
index 7fb2b1608b..3378e629be 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h
new file mode 100644
index 0000000000..d3e0d4e146
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 656
+#define SIGJMP_BUF_SIZE 656
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 512
+#define SAVED_MASK_OFFSET 520
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h
index fce8fbab91..2f7f7e8a8a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h
@@ -1,5 +1,5 @@
/* Definition of `struct stat' used in the kernel.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,3 +18,4 @@
#define STAT_IS_KERNEL_STAT 1
#define XSTAT_IS_XSTAT64 1
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist
index 27d451b46b..37c8f6684b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
-GLIBC_2.17 __libc_memalign F
GLIBC_2.17 __libc_stack_end D 0x8
GLIBC_2.17 __tls_get_addr F
GLIBC_2.17 _dl_mcount F
@@ -8,7 +6,5 @@ GLIBC_2.17 calloc F
GLIBC_2.17 free F
GLIBC_2.17 malloc F
GLIBC_2.17 realloc F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 __tls_get_addr_opt F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __parse_hwcap_and_convert_at_platform F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist
index 8914eb06b4..edfc9ca56f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist
@@ -1,9 +1,5 @@
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 __tls_get_addr_opt F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __parse_hwcap_and_convert_at_platform F
-GLIBC_2.3 GLIBC_2.3 A
-GLIBC_2.3 __libc_memalign F
GLIBC_2.3 __libc_stack_end D 0x8
GLIBC_2.3 __tls_get_addr F
GLIBC_2.3 _dl_mcount F
@@ -12,4 +8,3 @@ GLIBC_2.3 calloc F
GLIBC_2.3 free F
GLIBC_2.3 malloc F
GLIBC_2.3 realloc F
-GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h
index 7c079e2cd8..65c594cc29 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/Implies
new file mode 100644
index 0000000000..4eacd3ae86
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/Implies
@@ -0,0 +1 @@
+unix/sysv/linux/powerpc/powerpc64
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/float128-abi.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/float128-abi.h
new file mode 100644
index 0000000000..6b954cc673
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/float128-abi.h
@@ -0,0 +1,2 @@
+/* ABI version for _Float128 ABI introduction. */
+#define FLOAT128_VERSION GLIBC_2.26
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/fpu/Implies
new file mode 100644
index 0000000000..5da96db05b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/fpu/Implies
@@ -0,0 +1 @@
+unix/sysv/linux/powerpc/powerpc64/fpu
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale-le.abilist
index 5e54974368..0829ddef6d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale-le.abilist
@@ -1,2 +1 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale.abilist
index 40f6e08b75..fb7dfa4c1d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl-le.abilist
index 21330fc8d5..9492cd5290 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 gai_cancel F
GLIBC_2.17 gai_error F
GLIBC_2.17 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl.abilist
index 9036592d30..975593b41f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 gai_cancel F
GLIBC_2.3 gai_error F
GLIBC_2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
index a97bd43b8f..e26930e728 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 _Exit F
GLIBC_2.17 _IO_2_1_stderr_ D 0xe0
GLIBC_2.17 _IO_2_1_stdin_ D 0xe0
@@ -2165,13 +2164,67 @@ GLIBC_2.17 xdrstdio_create F
GLIBC_2.17 xencrypt F
GLIBC_2.17 xprt_register F
GLIBC_2.17 xprt_unregister F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 __strtof128_internal F
+GLIBC_2.26 __wcstof128_internal F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.26 strfromf128 F
+GLIBC_2.26 strtof128 F
+GLIBC_2.26 strtof128_l F
+GLIBC_2.26 wcstof128 F
+GLIBC_2.26 wcstof128_l F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
index 00772cb630..8c1781adf4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -25,33 +24,28 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x438
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x438
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -60,7 +54,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -71,7 +64,6 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __ppc_get_timebase_freq F
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
@@ -79,17 +71,58 @@ GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 _Exit F
GLIBC_2.3 _IO_2_1_stderr_ D 0xe0
GLIBC_2.3 _IO_2_1_stdin_ D 0xe0
@@ -1921,7 +1954,6 @@ GLIBC_2.3 xdrstdio_create F
GLIBC_2.3 xencrypt F
GLIBC_2.3 xprt_register F
GLIBC_2.3 xprt_unregister F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -1934,7 +1966,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x208
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -1955,7 +1986,6 @@ GLIBC_2.3.3 strtoll_l F
GLIBC_2.3.3 strtoull_l F
GLIBC_2.3.3 sys_sigabbrev D 0x208
GLIBC_2.3.3 sys_siglist D 0x208
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -1994,7 +2024,6 @@ GLIBC_2.3.4 siglongjmp F
GLIBC_2.3.4 swapcontext F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
@@ -2222,7 +2251,6 @@ GLIBC_2.4 wcstold F
GLIBC_2.4 wcstold_l F
GLIBC_2.4 wprintf F
GLIBC_2.4 wscanf F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2240,7 +2268,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2248,7 +2275,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2287,7 +2313,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __nldbl___asprintf_chk F
@@ -2304,7 +2329,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt-le.abilist
index 58944b3d83..4082747aa3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 crypt F
GLIBC_2.17 crypt_r F
GLIBC_2.17 encrypt F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt.abilist
index 52cf1ac766..069212877a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 crypt F
GLIBC_2.3 crypt_r F
GLIBC_2.3 encrypt F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl-le.abilist
index 1b4b1f77ed..36340d5dd8 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 dladdr F
GLIBC_2.17 dladdr1 F
GLIBC_2.17 dlclose F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl.abilist
index 764ddc1c19..5b472f45aa 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl.abilist
@@ -1,12 +1,9 @@
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 dladdr F
GLIBC_2.3 dlclose F
GLIBC_2.3 dlerror F
GLIBC_2.3 dlopen F
GLIBC_2.3 dlsym F
GLIBC_2.3 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
index ee066837af..1e1f2b8d6e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 _LIB_VERSION D 0x4
GLIBC_2.17 __acos_finite F
GLIBC_2.17 __acosf_finite F
@@ -399,12 +398,681 @@ GLIBC_2.17 y1l F
GLIBC_2.17 yn F
GLIBC_2.17 ynf F
GLIBC_2.17 ynl F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.26 __acosf128_finite F
+GLIBC_2.26 __acoshf128_finite F
+GLIBC_2.26 __asinf128_finite F
+GLIBC_2.26 __atan2f128_finite F
+GLIBC_2.26 __atanhf128_finite F
+GLIBC_2.26 __coshf128_finite F
+GLIBC_2.26 __exp10f128_finite F
+GLIBC_2.26 __exp2f128_finite F
+GLIBC_2.26 __expf128_finite F
+GLIBC_2.26 __finitef128 F
+GLIBC_2.26 __fmodf128_finite F
+GLIBC_2.26 __fpclassifyf128 F
+GLIBC_2.26 __gammaf128_r_finite F
+GLIBC_2.26 __hypotf128_finite F
+GLIBC_2.26 __iseqsigf128 F
+GLIBC_2.26 __isinff128 F
+GLIBC_2.26 __isnanf128 F
+GLIBC_2.26 __issignalingf128 F
+GLIBC_2.26 __j0f128_finite F
+GLIBC_2.26 __j1f128_finite F
+GLIBC_2.26 __jnf128_finite F
+GLIBC_2.26 __lgammaf128_r_finite F
+GLIBC_2.26 __log10f128_finite F
+GLIBC_2.26 __log2f128_finite F
+GLIBC_2.26 __logf128_finite F
+GLIBC_2.26 __powf128_finite F
+GLIBC_2.26 __remainderf128_finite F
+GLIBC_2.26 __signbitf128 F
+GLIBC_2.26 __sinhf128_finite F
+GLIBC_2.26 __sqrtf128_finite F
+GLIBC_2.26 __y0f128_finite F
+GLIBC_2.26 __y1f128_finite F
+GLIBC_2.26 __ynf128_finite F
+GLIBC_2.26 acosf128 F
+GLIBC_2.26 acoshf128 F
+GLIBC_2.26 asinf128 F
+GLIBC_2.26 asinhf128 F
+GLIBC_2.26 atan2f128 F
+GLIBC_2.26 atanf128 F
+GLIBC_2.26 atanhf128 F
+GLIBC_2.26 cabsf128 F
+GLIBC_2.26 cacosf128 F
+GLIBC_2.26 cacoshf128 F
+GLIBC_2.26 canonicalizef128 F
+GLIBC_2.26 cargf128 F
+GLIBC_2.26 casinf128 F
+GLIBC_2.26 casinhf128 F
+GLIBC_2.26 catanf128 F
+GLIBC_2.26 catanhf128 F
+GLIBC_2.26 cbrtf128 F
+GLIBC_2.26 ccosf128 F
+GLIBC_2.26 ccoshf128 F
+GLIBC_2.26 ceilf128 F
+GLIBC_2.26 cexpf128 F
+GLIBC_2.26 cimagf128 F
+GLIBC_2.26 clog10f128 F
+GLIBC_2.26 clogf128 F
+GLIBC_2.26 conjf128 F
+GLIBC_2.26 copysignf128 F
+GLIBC_2.26 cosf128 F
+GLIBC_2.26 coshf128 F
+GLIBC_2.26 cpowf128 F
+GLIBC_2.26 cprojf128 F
+GLIBC_2.26 crealf128 F
+GLIBC_2.26 csinf128 F
+GLIBC_2.26 csinhf128 F
+GLIBC_2.26 csqrtf128 F
+GLIBC_2.26 ctanf128 F
+GLIBC_2.26 ctanhf128 F
+GLIBC_2.26 erfcf128 F
+GLIBC_2.26 erff128 F
+GLIBC_2.26 exp10f128 F
+GLIBC_2.26 exp2f128 F
+GLIBC_2.26 expf128 F
+GLIBC_2.26 expm1f128 F
+GLIBC_2.26 fabsf128 F
+GLIBC_2.26 fdimf128 F
+GLIBC_2.26 floorf128 F
+GLIBC_2.26 fmaf128 F
+GLIBC_2.26 fmaxf128 F
+GLIBC_2.26 fmaxmagf128 F
+GLIBC_2.26 fminf128 F
+GLIBC_2.26 fminmagf128 F
+GLIBC_2.26 fmodf128 F
+GLIBC_2.26 frexpf128 F
+GLIBC_2.26 fromfpf128 F
+GLIBC_2.26 fromfpxf128 F
+GLIBC_2.26 getpayloadf128 F
+GLIBC_2.26 hypotf128 F
+GLIBC_2.26 ilogbf128 F
+GLIBC_2.26 j0f128 F
+GLIBC_2.26 j1f128 F
+GLIBC_2.26 jnf128 F
+GLIBC_2.26 ldexpf128 F
+GLIBC_2.26 lgammaf128 F
+GLIBC_2.26 lgammaf128_r F
+GLIBC_2.26 llogbf128 F
+GLIBC_2.26 llrintf128 F
+GLIBC_2.26 llroundf128 F
+GLIBC_2.26 log10f128 F
+GLIBC_2.26 log1pf128 F
+GLIBC_2.26 log2f128 F
+GLIBC_2.26 logbf128 F
+GLIBC_2.26 logf128 F
+GLIBC_2.26 lrintf128 F
+GLIBC_2.26 lroundf128 F
+GLIBC_2.26 modff128 F
+GLIBC_2.26 nanf128 F
+GLIBC_2.26 nearbyintf128 F
+GLIBC_2.26 nextafterf128 F
+GLIBC_2.26 nextdownf128 F
+GLIBC_2.26 nextupf128 F
+GLIBC_2.26 powf128 F
+GLIBC_2.26 remainderf128 F
+GLIBC_2.26 remquof128 F
+GLIBC_2.26 rintf128 F
+GLIBC_2.26 roundevenf128 F
+GLIBC_2.26 roundf128 F
+GLIBC_2.26 scalblnf128 F
+GLIBC_2.26 scalbnf128 F
+GLIBC_2.26 setpayloadf128 F
+GLIBC_2.26 setpayloadsigf128 F
+GLIBC_2.26 sincosf128 F
+GLIBC_2.26 sinf128 F
+GLIBC_2.26 sinhf128 F
+GLIBC_2.26 sqrtf128 F
+GLIBC_2.26 tanf128 F
+GLIBC_2.26 tanhf128 F
+GLIBC_2.26 tgammaf128 F
+GLIBC_2.26 totalorderf128 F
+GLIBC_2.26 totalordermagf128 F
+GLIBC_2.26 truncf128 F
+GLIBC_2.26 ufromfpf128 F
+GLIBC_2.26 ufromfpxf128 F
+GLIBC_2.26 y0f128 F
+GLIBC_2.26 y1f128 F
+GLIBC_2.26 ynf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 __nldbl_daddl F
+GLIBC_2.28 __nldbl_ddivl F
+GLIBC_2.28 __nldbl_dmull F
+GLIBC_2.28 __nldbl_dsubl F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
index 6c7fc9b4fc..331449dfcb 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -80,16 +79,415 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 __nldbl_daddl F
+GLIBC_2.28 __nldbl_ddivl F
+GLIBC_2.28 __nldbl_dmull F
+GLIBC_2.28 __nldbl_dsubl F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.3 _LIB_VERSION D 0x4
GLIBC_2.3 __clog10 F
GLIBC_2.3 __clog10f F
@@ -405,7 +803,6 @@ GLIBC_2.3 y1l F
GLIBC_2.3 yn F
GLIBC_2.3 ynf F
GLIBC_2.3 ynl F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl-le.abilist
index 63d47aef79..eae8dbe341 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __free_fdresult F
GLIBC_2.17 __nis_default_access F
GLIBC_2.17 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl.abilist
index 23ef56053e..4318dc30ce 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __free_fdresult F
GLIBC_2.3 __nis_default_access F
GLIBC_2.3 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist
index 0cf30ee02f..9a9e4cee85 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 _IO_flockfile F
GLIBC_2.17 _IO_ftrylockfile F
GLIBC_2.17 _IO_funlockfile F
@@ -221,6 +220,26 @@ GLIBC_2.17 vfork F
GLIBC_2.17 wait F
GLIBC_2.17 waitpid F
GLIBC_2.17 write F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist
index 464b91a61d..8300958d47 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist
@@ -1,15 +1,32 @@
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3 _IO_flockfile F
GLIBC_2.3 _IO_ftrylockfile F
GLIBC_2.3 _IO_funlockfile F
@@ -201,14 +218,12 @@ GLIBC_2.3 vfork F
GLIBC_2.3 wait F
GLIBC_2.3 waitpid F
GLIBC_2.3 write F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -224,7 +239,6 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 longjmp F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@@ -232,7 +246,6 @@ GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
GLIBC_2.3.4 siglongjmp F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
@@ -242,6 +255,5 @@ GLIBC_2.4 pthread_mutexattr_getrobust_np F
GLIBC_2.4 pthread_mutexattr_setprioceiling F
GLIBC_2.4 pthread_mutexattr_setprotocol F
GLIBC_2.4 pthread_mutexattr_setrobust_np F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 pthread_attr_setstack F
GLIBC_2.6 pthread_attr_setstacksize F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv-le.abilist
index cf278eedb3..f7fdd26bd1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __b64_ntop F
GLIBC_2.17 __b64_pton F
GLIBC_2.17 __dn_comp F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv.abilist
index 95def8eb0f..15f30deb34 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __b64_ntop F
GLIBC_2.3 __b64_pton F
GLIBC_2.3 __dn_comp F
@@ -63,9 +62,7 @@ GLIBC_2.3 res_gethostbyname F
GLIBC_2.3 res_gethostbyname2 F
GLIBC_2.3 res_send_setqhook F
GLIBC_2.3 res_send_setrhook F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt-le.abilist
index 523d22249a..5e81c82a25 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 __mq_open_2 F
GLIBC_2.17 aio_cancel F
GLIBC_2.17 aio_cancel64 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist
index e5b41488a2..e76b7eb495 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 aio_cancel F
GLIBC_2.3 aio_cancel64 F
GLIBC_2.3 aio_error F
@@ -28,13 +27,11 @@ GLIBC_2.3 timer_delete F
GLIBC_2.3 timer_getoverrun F
GLIBC_2.3 timer_gettime F
GLIBC_2.3 timer_settime F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 timer_create F
GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -45,8 +42,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db-le.abilist
index 3e382bf79d..3b84229ebc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 td_init F
GLIBC_2.17 td_log F
GLIBC_2.17 td_symbol_list F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db.abilist
index cd466b942b..cffc70d2fa 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_init F
GLIBC_2.3 td_log F
GLIBC_2.3 td_symbol_list F
@@ -38,5 +37,4 @@ GLIBC_2.3 td_thr_sigsetmask F
GLIBC_2.3 td_thr_tls_get_addr F
GLIBC_2.3 td_thr_tsd F
GLIBC_2.3 td_thr_validate F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil-le.abilist
index 9c075bc0bd..99889de22e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil-le.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 forkpty F
GLIBC_2.17 login F
GLIBC_2.17 login_tty F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil.abilist
index 812701762c..9cf1da7aa4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 forkpty F
GLIBC_2.3 login F
GLIBC_2.3 login_tty F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data
index 49d5de6019..c1209336d2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data
@@ -4,11 +4,14 @@ libc.so: malloc
libc.so: memalign
libc.so: realloc
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
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
index 9bd0b0032c..4febd49646 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,20 +23,20 @@
#include "ucontext_i.h"
#include <asm/errno.h>
-ENTRY(__makecontext)
+ENTRY (__makecontext)
CALL_MCOUNT 3
/* Save parameters into the parameter save area of callers frame. */
- std r3,FRAME_PARM1_SAVE(r1) /* ucontext_t *ucp */
- std r4,FRAME_PARM2_SAVE(r1) /* void (*func)(void) */
- std r5,FRAME_PARM3_SAVE(r1) /* int argc */
- std r6,FRAME_PARM4_SAVE(r1) /* ... */
- std r7,FRAME_PARM5_SAVE(r1)
- std r8,FRAME_PARM6_SAVE(r1)
- std r9,FRAME_PARM7_SAVE(r1)
- std r10,FRAME_PARM8_SAVE(r1)
+ std r3,FRAME_PARM_SAVE+0(r1) /* ucontext_t *ucp */
+ std r4,FRAME_PARM_SAVE+8(r1) /* void (*func)(void) */
+ std r5,FRAME_PARM_SAVE+16(r1) /* int argc */
+ std r6,FRAME_PARM_SAVE+24(r1) /* ... */
+ std r7,FRAME_PARM_SAVE+32(r1)
+ std r8,FRAME_PARM_SAVE+40(r1)
+ std r9,FRAME_PARM_SAVE+48(r1)
+ std r10,FRAME_PARM_SAVE+56(r1)
mflr r0
/* Get the address of the target functions first parameter. */
- addi r6,r1,FRAME_PARM4_SAVE
+ addi r6,r1,FRAME_PARM_SAVE+24
std r0,FRAME_LR_SAVE(r1)
cfi_offset (lr, FRAME_LR_SAVE)
stdu r1,-128(r1)
@@ -55,7 +55,7 @@ ENTRY(__makecontext)
clrrdi r7,r7,4
li r0,0
stdu r0,-64(r7)
- std r3,FRAME_PARM1_SAVE(r7) /* Store context in dummy parm1. */
+ std r3,FRAME_PARM_SAVE(r7) /* Store context in dummy parm1. */
mflr r0
std r2,FRAME_TOC_SAVE(r7) /* Store the TOC pointer for later. */
std r0,FRAME_LR_SAVE(r7)
@@ -102,7 +102,7 @@ L(parmloop2):
addi r0,r5,-8
ble cr1,L(noparms)
mtctr r0
- addi r9,r8,FRAME_PARM9_SAVE-8
+ addi r9,r8,FRAME_PARM_SAVE+64-8
L(parmloop):
ldu r0,8(r7)
stdu r0,8(r9)
@@ -148,7 +148,7 @@ L(noparms):
L(exitcode):
/* Recover the ucontext and TOC from the dummy frame. */
ld r1,FRAME_BACKCHAIN(r1) /* Unstack the parameter save area frame. */
- ld r3,FRAME_PARM1_SAVE(r1)
+ ld r3,FRAME_PARM_SAVE(r1)
ld r2,FRAME_TOC_SAVE(r1)
ld r3,UCONTEXT_LINK(r3) /* Load the resume context. */
cmpdi r3,0
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
index 688a79b5b9..c95e3a14db 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
@@ -1,5 +1,5 @@
/* Switch to context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
index a166dcc53f..50f7233080 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -163,6 +163,7 @@ ENTRY(__novec_swapcontext)
cmpdi r0,0
bne L(nv_do_sigret)
+ ld r8,.LC__dl_hwcap@toc(r2)
# ifdef SHARED
/* Load _rtld-global._dl_hwcap. */
ld r8,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r8)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
deleted file mode 100644
index d76a2ffdff..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
+++ /dev/null
@@ -1,30 +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_range2, fd, flags, from, to);
-}
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
deleted file mode 100644
index 6ba6f9b1e9..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
+++ /dev/null
@@ -1,3 +0,0 @@
-# File name Caller Syscall name # args Strong name Weak names
-
-getrlimit - ugetrlimit i:ip __getrlimit getrlimit getrlimit64 __getrlimit64
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
deleted file mode 100644
index 59d7d9ed6c..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Cancellable system call stubs. Linux/PowerPC64 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Franz Sirl <Franz.Sirl-kernel@lauterbach.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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# define DASHDASHPFX(str) __##str
-
-#if _CALL_ELF == 2
-#define CANCEL_FRAMESIZE (FRAME_MIN_SIZE+16+48)
-#define CANCEL_PARM_SAVE (FRAME_MIN_SIZE+16)
-#else
-#define CANCEL_FRAMESIZE (FRAME_MIN_SIZE+16)
-#define CANCEL_PARM_SAVE (CANCEL_FRAMESIZE+FRAME_PARM_SAVE)
-#endif
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- SINGLE_THREAD_P; \
- bne- .Lpseudo_cancel; \
- .type DASHDASHPFX(syscall_name##_nocancel),@function; \
- .globl DASHDASHPFX(syscall_name##_nocancel); \
- DASHDASHPFX(syscall_name##_nocancel): \
- DO_CALL (SYS_ify (syscall_name)); \
- PSEUDO_RET; \
- .size DASHDASHPFX(syscall_name##_nocancel),.-DASHDASHPFX(syscall_name##_nocancel); \
- .Lpseudo_cancel: \
- stdu 1,-CANCEL_FRAMESIZE(1); \
- cfi_adjust_cfa_offset (CANCEL_FRAMESIZE); \
- mflr 9; \
- std 9,CANCEL_FRAMESIZE+FRAME_LR_SAVE(1); \
- cfi_offset (lr, FRAME_LR_SAVE); \
- DOCARGS_##args; /* save syscall args around CENABLE. */ \
- CENABLE; \
- std 3,FRAME_MIN_SIZE(1); /* store CENABLE return value (MASK). */ \
- UNDOCARGS_##args; /* restore syscall args. */ \
- DO_CALL (SYS_ify (syscall_name)); \
- mfcr 0; /* save CR/R3 around CDISABLE. */ \
- std 3,FRAME_MIN_SIZE+8(1); \
- std 0,CANCEL_FRAMESIZE+FRAME_CR_SAVE(1); \
- cfi_offset (cr, FRAME_CR_SAVE); \
- ld 3,FRAME_MIN_SIZE(1); /* pass MASK to CDISABLE. */ \
- CDISABLE; \
- ld 9,CANCEL_FRAMESIZE+FRAME_LR_SAVE(1); \
- ld 0,CANCEL_FRAMESIZE+FRAME_CR_SAVE(1); /* restore CR/R3. */ \
- ld 3,FRAME_MIN_SIZE+8(1); \
- mtlr 9; \
- mtcr 0; \
- addi 1,1,CANCEL_FRAMESIZE; \
- cfi_adjust_cfa_offset (-CANCEL_FRAMESIZE); \
- cfi_restore (lr); \
- cfi_restore (cr)
-
-# define DOCARGS_0
-# define UNDOCARGS_0
-
-# define DOCARGS_1 std 3,CANCEL_PARM_SAVE(1); DOCARGS_0
-# define UNDOCARGS_1 ld 3,CANCEL_PARM_SAVE(1); UNDOCARGS_0
-
-# define DOCARGS_2 std 4,CANCEL_PARM_SAVE+8(1); DOCARGS_1
-# define UNDOCARGS_2 ld 4,CANCEL_PARM_SAVE+8(1); UNDOCARGS_1
-
-# define DOCARGS_3 std 5,CANCEL_PARM_SAVE+16(1); DOCARGS_2
-# define UNDOCARGS_3 ld 5,CANCEL_PARM_SAVE+16(1); UNDOCARGS_2
-
-# define DOCARGS_4 std 6,CANCEL_PARM_SAVE+24(1); DOCARGS_3
-# define UNDOCARGS_4 ld 6,CANCEL_PARM_SAVE+24(1); UNDOCARGS_3
-
-# define DOCARGS_5 std 7,CANCEL_PARM_SAVE+32(1); DOCARGS_4
-# define UNDOCARGS_5 ld 7,CANCEL_PARM_SAVE+32(1); UNDOCARGS_4
-
-# define DOCARGS_6 std 8,CANCEL_PARM_SAVE+40(1); DOCARGS_5
-# define UNDOCARGS_6 ld 8,CANCEL_PARM_SAVE+40(1); UNDOCARGS_5
-
-# if IS_IN (libpthread)
-# ifdef SHARED
-# define CENABLE bl JUMPTARGET(__pthread_enable_asynccancel)
-# define CDISABLE bl JUMPTARGET(__pthread_disable_asynccancel)
-# else
-# define CENABLE bl JUMPTARGET(__pthread_enable_asynccancel); nop
-# define CDISABLE bl JUMPTARGET(__pthread_disable_asynccancel); nop
-# endif
-# elif IS_IN (libc)
-# ifdef SHARED
-# define CENABLE bl JUMPTARGET(__libc_enable_asynccancel)
-# define CDISABLE bl JUMPTARGET(__libc_disable_asynccancel)
-# else
-# define CENABLE bl JUMPTARGET(__libc_enable_asynccancel); nop
-# define CDISABLE bl JUMPTARGET(__libc_disable_asynccancel); nop
-# endif
-# elif IS_IN (librt)
-# ifdef SHARED
-# define CENABLE bl JUMPTARGET(__librt_enable_asynccancel)
-# define CDISABLE bl JUMPTARGET(__librt_disable_asynccancel)
-# else
-# define CENABLE bl JUMPTARGET(__librt_enable_asynccancel); nop
-# define CDISABLE bl JUMPTARGET(__librt_disable_asynccancel); nop
-# endif
-# else
-# error Unsupported library
-# endif
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P \
- lwz 10,MULTIPLE_THREADS_OFFSET(13); \
- cmpwi 10,0
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
index 91fd096ad0..0956cf04a7 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,24 +29,6 @@
#include <errno.h>
#endif
-/* Some systen calls got renamed over time, but retained the same semantics.
- Handle them here so they can be catched by both C and assembler stubs in
- glibc. */
-
-#ifdef __NR_pread64
-# ifdef __NR_pread
-# error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
-#ifdef __NR_pwrite64
-# ifdef __NR_pwrite
-# error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
/* For Linux we can use the system call table in the header file
/usr/include/asm/unistd.h
of the kernel. But these symbols do not follow the SYS_* syntax
@@ -254,4 +236,13 @@
# endif
#endif
+/* In the PowerPC64 ABI, the unadorned F_GETLK* opcodes should be used
+ even by largefile64 code. */
+#define FCNTL_ADJUST_CMD(__cmd) \
+ ({ int cmd_ = (__cmd); \
+ if (cmd_ >= F_GETLK64 && cmd_ <= F_SETLKW64) \
+ cmd_ -= F_GETLK64 - F_GETLK; \
+ cmd_; })
+
+
#endif /* linux/powerpc/powerpc64/sysdep.h */
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/umount.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/umount.c
deleted file mode 100644
index e10b40f96c..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/umount.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/x86_64/umount.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
index 3083ab7b3c..5b8ace464e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,31 +28,8 @@
ENTRY (__vfork)
CALL_MCOUNT 0
- /* Load the TCB-cached PID value and negates it. If It it is zero
- sets it to 0x800000. And then sets its value again on TCB field.
- See raise.c for the logic that relies on this value. */
- lwz r0,PID(r13)
- cmpwi cr0,r0,0
- neg r0,r0
- bne- cr0,1f
- lis r0,0x8000
-1: stw r0,PID(r13)
-
DO_CALL (SYS_ify (vfork))
- cmpwi cr1,r3,0
- beqlr- 1
-
- /* Restore the original value of the TCB cache of the PID, if we're
- the parent. But in the child (syscall return value equals zero),
- leave things as they are. */
- lwz r0,PID(r13)
- clrlwi r4,r0,1
- cmpwi cr1,r4,0
- beq- cr1,1f
- neg r4,r0
-1: stw r4,PID(r13)
-
PSEUDO_RET
PSEUDO_END (__vfork)
diff --git a/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c b/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
index 3e9a5c84d7..5b3546143b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
+++ b/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_cond_lock.c b/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_cond_lock.c
index 249a0aadc4..fef27a0a07 100644
--- a/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_cond_lock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_cond_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_lock.c b/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_lock.c
index 54807d605c..d2a6c58d47 100644
--- a/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_lock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_lock.c
@@ -1,5 +1,5 @@
/* Elided version of pthread_mutex_lock.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_timedlock.c b/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_timedlock.c
index aa605e3de8..8cca3a27fa 100644
--- a/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_timedlock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_timedlock.c
@@ -1,5 +1,5 @@
/* Elided version of pthread_mutex_timedlock.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_trylock.c b/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_trylock.c
index 3854786a07..14520927a6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_trylock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_trylock.c
@@ -1,5 +1,5 @@
/* Elided version of pthread_mutex_trylock.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/readdir64.c b/sysdeps/unix/sysv/linux/powerpc/readdir64.c
deleted file mode 100644
index 2ea26dd409..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/readdir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/readdir64.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/readdir64_r.c b/sysdeps/unix/sysv/linux/powerpc/readdir64_r.c
deleted file mode 100644
index 9f54f897e3..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/readdir64_r.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/readelflib.c b/sysdeps/unix/sysv/linux/powerpc/readelflib.c
index 0d1d1ddff0..1463bfc81b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/readelflib.c
+++ b/sysdeps/unix/sysv/linux/powerpc/readelflib.c
@@ -1,5 +1,5 @@
/* Special checks on libraries for ldconfig. Linux/PowerPC version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h b/sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h
index 26df3b3539..0b682c75ef 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,9 +18,4 @@
#include <signal.h>
#define SIGCONTEXT struct sigcontext *
-#define SIGCONTEXT_EXTRA_ARGS
#define GET_PC(ctx) ((void *)((ctx)->regs->nip))
-#define GET_FRAME(ctx) (*(void **)((ctx)->regs->gpr[1]))
-#define GET_STACK(ctx) ((void *)((ctx)->regs->gpr[1]))
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h b/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
index aadeb9a296..d268c66ba3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -83,7 +83,7 @@ struct elf_prstatus
unsigned long int pr_sigpend; /* Set of pending signals. */
unsigned long int pr_sighold; /* Set of held signals. */
#if 0
- struct sigaltstack pr_altstack; /* Alternate stack info. */
+ stack_t pr_altstack; /* Alternate stack info. */
struct sigaction pr_action; /* Signal action for current sig. */
#endif
__pid_t pr_pid;
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
index b9ddee076d..9fde99c748 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
@@ -1,5 +1,5 @@
-/* `ptrace' debugger support interface. Linux version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* `ptrace' debugger support interface. Linux/PowerPC version.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,50 @@
__BEGIN_DECLS
+#if defined _LINUX_PTRACE_H || defined _ASM_POWERPC_PTRACE_H
+/* Do not let Linux headers macros interfere with enum __ptrace_request. */
+# undef PTRACE_ATTACH
+# undef PTRACE_CONT
+# undef PTRACE_DETACH
+# undef PTRACE_GET_DEBUGREG
+# undef PTRACE_GETEVENTMSG
+# undef PTRACE_GETEVRREGS
+# undef PTRACE_GETFPREGS
+# undef PTRACE_GETREGS
+# undef PTRACE_GETREGS64
+# undef PTRACE_GETREGSET
+# undef PTRACE_GETSIGINFO
+# undef PTRACE_GETSIGMASK
+# undef PTRACE_GETVRREGS
+# undef PTRACE_GETVSRREGS
+# undef PTRACE_INTERRUPT
+# undef PTRACE_KILL
+# undef PTRACE_LISTEN
+# undef PTRACE_PEEKDATA
+# undef PTRACE_PEEKSIGINFO
+# undef PTRACE_PEEKTEXT
+# undef PTRACE_POKEDATA
+# undef PTRACE_POKETEXT
+# undef PTRACE_SECCOMP_GET_FILTER
+# undef PTRACE_SECCOMP_GET_METADATA
+# undef PTRACE_SEIZE
+# undef PTRACE_SET_DEBUGREG
+# undef PTRACE_SETEVRREGS
+# undef PTRACE_SETFPREGS
+# undef PTRACE_SETOPTIONS
+# undef PTRACE_SETREGS
+# undef PTRACE_SETREGS64
+# undef PTRACE_SETREGSET
+# undef PTRACE_SETSIGINFO
+# undef PTRACE_SETSIGMASK
+# undef PTRACE_SETVRREGS
+# undef PTRACE_SETVSRREGS
+# undef PTRACE_SINGLEBLOCK
+# undef PTRACE_SINGLESTEP
+# undef PTRACE_SYSCALL
+# undef PTRACE_TRACEME
+#endif
+
/* Type of the REQUEST argument to `ptrace.' */
enum __ptrace_request
{
@@ -65,11 +109,26 @@ enum __ptrace_request
PTRACE_KILL = 8,
#define PT_KILL PTRACE_KILL
- /* Single step the process.
- This is not supported on all machines. */
+ /* Single step the process. */
PTRACE_SINGLESTEP = 9,
#define PT_STEP PTRACE_SINGLESTEP
+ /* Get all general purpose registers used by a process. */
+ PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+ /* Set all general purpose registers used by a process. */
+ PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+ /* Get all floating point registers used by a process. */
+ PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+ /* Set all floating point registers used by a process. */
+ PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
/* Attach to a process that is already running. */
PTRACE_ATTACH = 16,
#define PT_ATTACH PTRACE_ATTACH
@@ -78,10 +137,56 @@ enum __ptrace_request
PTRACE_DETACH = 17,
#define PT_DETACH PTRACE_DETACH
- /* Continue and stop at the next (return from) syscall. */
+ /* Get all altivec registers used by a process. */
+ PTRACE_GETVRREGS = 18,
+#define PT_GETVRREGS PTRACE_GETVRREGS
+
+ /* Set all altivec registers used by a process. */
+ PTRACE_SETVRREGS = 19,
+#define PT_SETVRREGS PTRACE_SETVRREGS
+
+ /* Get all SPE registers used by a process. */
+ PTRACE_GETEVRREGS = 20,
+#define PT_GETEVRREGS PTRACE_GETEVRREGS
+
+ /* Set all SPE registers used by a process. */
+ PTRACE_SETEVRREGS = 21,
+#define PT_SETEVRREGS PTRACE_SETEVRREGS
+
+ /* Same as PTRACE_GETREGS except a 32-bit process will obtain
+ the full 64-bit registers. Implemented by 64-bit kernels only. */
+ PTRACE_GETREGS64 = 22,
+#define PT_GETREGS64 PTRACE_GETREGS64
+
+ /* Same as PTRACE_SETREGS except a 32-bit process will set
+ the full 64-bit registers. Implemented by 64-bit kernels only. */
+ PTRACE_SETREGS64 = 23,
+#define PT_SETREGS64 PTRACE_SETREGS64
+
+ /* Continue and stop at the next entry to or return from syscall. */
PTRACE_SYSCALL = 24,
#define PT_SYSCALL PTRACE_SYSCALL
+ /* Get a debug register of a process. */
+ PTRACE_GET_DEBUGREG = 25,
+#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
+
+ /* Set a debug register of a process. */
+ PTRACE_SET_DEBUGREG = 26,
+#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
+
+ /* Get the first 32 VSX registers of a process. */
+ PTRACE_GETVSRREGS = 27,
+#define PT_GETVSRREGS PTRACE_GETVSRREGS
+
+ /* Set the first 32 VSX registers of a process. */
+ PTRACE_SETVSRREGS = 28,
+#define PT_SETVSRREGS PTRACE_SETVSRREGS
+
+ /* Execute process until next taken branch. */
+ PTRACE_SINGLEBLOCK = 256,
+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
+
/* Set ptrace filter options. */
PTRACE_SETOPTIONS = 0x4200,
#define PT_SETOPTIONS PTRACE_SETOPTIONS
@@ -119,78 +224,29 @@ enum __ptrace_request
PTRACE_LISTEN = 0x4208,
#define PTRACE_LISTEN PTRACE_LISTEN
+ /* Retrieve siginfo_t structures without removing signals from a queue. */
PTRACE_PEEKSIGINFO = 0x4209,
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+ /* Get the mask of blocked signals. */
PTRACE_GETSIGMASK = 0x420a,
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
+ /* Change the mask of blocked signals. */
PTRACE_SETSIGMASK = 0x420b,
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
- PTRACE_SECCOMP_GET_FILTER = 0x420c
+ /* Get seccomp BPF filters. */
+ PTRACE_SECCOMP_GET_FILTER = 0x420c,
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
-};
-
-
-/* Flag for PTRACE_LISTEN. */
-enum __ptrace_flags
-{
- PTRACE_SEIZE_DEVEL = 0x80000000
-};
-
-/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions
-{
- PTRACE_O_TRACESYSGOOD = 0x00000001,
- PTRACE_O_TRACEFORK = 0x00000002,
- PTRACE_O_TRACEVFORK = 0x00000004,
- PTRACE_O_TRACECLONE = 0x00000008,
- PTRACE_O_TRACEEXEC = 0x00000010,
- PTRACE_O_TRACEVFORKDONE = 0x00000020,
- PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_EXITKILL = 0x00100000,
- PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
- PTRACE_O_MASK = 0x003000ff
-};
-/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes
-{
- PTRACE_EVENT_FORK = 1,
- PTRACE_EVENT_VFORK = 2,
- PTRACE_EVENT_CLONE = 3,
- PTRACE_EVENT_EXEC = 4,
- PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6,
- PTRACE_EVENT_SECCOMP = 7
-};
-
-/* Arguments for PTRACE_PEEKSIGINFO. */
-struct __ptrace_peeksiginfo_args
-{
- __uint64_t off; /* From which siginfo to start. */
- __uint32_t flags; /* Flags for peeksiginfo. */
- __int32_t nr; /* How many siginfos to take. */
-};
-
-enum __ptrace_peeksiginfo_flags
-{
- /* Read signals from a shared (process wide) queue. */
- PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
+ /* Get seccomp BPF filter metadata. */
+ PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
};
-/* Perform process tracing functions. REQUEST is one of the values
- above, and determines the action to be taken.
- For all requests except PTRACE_TRACEME, PID specifies the process to be
- traced.
- PID and the other arguments described above for the various requests should
- appear (those that are used for the particular request) as:
- pid_t PID, void *ADDR, int DATA, void *ADDR2
- after REQUEST. */
-extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+#include <bits/ptrace-shared.h>
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
index 04100a2023..1bb6e4c8a6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,25 +19,35 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
-#include <bits/sigcontext.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
+struct __ctx(pt_regs);
#if __WORDSIZE == 32
/* Number of general registers. */
-# define NGREG 48
+# define __NGREG 48
+# ifdef __USE_MISC
+# define NGREG __NGREG
+# endif
/* Container for all general registers. */
-typedef unsigned long gregset_t[NGREG];
+typedef unsigned long gregset_t[__NGREG];
/* Container for floating-point registers and status */
typedef struct _libc_fpstate
{
- double fpregs[32];
- double fpscr;
+ double __ctx(fpregs)[32];
+ double __ctx(fpscr);
unsigned int _pad[2];
} fpregset_t;
@@ -45,18 +55,18 @@ typedef struct _libc_fpstate
Needs to be aligned on a 16-byte boundary. */
typedef struct _libc_vrstate
{
- unsigned int vrregs[32][4];
- unsigned int vrsave;
+ unsigned int __ctx(vrregs)[32][4];
+ unsigned int __ctx(vrsave);
unsigned int _pad[2];
- unsigned int vscr;
+ unsigned int __ctx(vscr);
} vrregset_t;
/* Context to describe whole processor state. */
typedef struct
{
- gregset_t gregs;
- fpregset_t fpregs;
- vrregset_t vrregs __attribute__((__aligned__(16)));
+ gregset_t __ctx(gregs);
+ fpregset_t __ctx(fpregs);
+ vrregset_t __ctx(vrregs) __attribute__((__aligned__(16)));
} mcontext_t;
#else
@@ -64,18 +74,24 @@ typedef struct
/* For 64-bit kernels with Altivec support, a machine context is exactly
* a sigcontext. For older kernel (without Altivec) the sigcontext matches
* the mcontext upto but not including the v_regs field. For kernels that
- * don't AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the
- * v_regs field may not exit and should not be referenced. The v_regd field
+ * don't set AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the
+ * v_regs field may not exist and should not be referenced. The v_regd field
* can be refernced safely only after verifying that PPC_FEATURE_HAS_ALTIVEC
* is set in AT_HWCAP. */
/* Number of general registers. */
-# define NGREG 48 /* includes r0-r31, nip, msr, lr, etc. */
-# define NFPREG 33 /* includes fp0-fp31 &fpscr. */
-# define NVRREG 34 /* includes v0-v31, vscr, & vrsave in split vectors */
-
-typedef unsigned long gregset_t[NGREG];
-typedef double fpregset_t[NFPREG];
+# define __NGREG 48 /* includes r0-r31, nip, msr, lr, etc. */
+# define __NFPREG 33 /* includes fp0-fp31 &fpscr. */
+# define __NVRREG 34 /* includes v0-v31, vscr, & vrsave in
+ split vectors */
+# ifdef __USE_MISC
+# define NGREG __NGREG
+# define NFPREG __NFPREG
+# define NVRREG __NVRREG
+# endif
+
+typedef unsigned long gregset_t[__NGREG];
+typedef double fpregset_t[__NFPREG];
/* Container for Altivec/VMX Vector Status and Control Register. Only 32-bits
but can only be copied to/from a 128-bit vector register. So we allocated
@@ -83,28 +99,28 @@ typedef double fpregset_t[NFPREG];
typedef struct _libc_vscr
{
unsigned int __pad[3];
- unsigned int vscr_word;
+ unsigned int __ctx(vscr_word);
} vscr_t;
/* Container for Altivec/VMX registers and status.
Must to be aligned on a 16-byte boundary. */
typedef struct _libc_vrstate
{
- unsigned int vrregs[32][4];
- vscr_t vscr;
- unsigned int vrsave;
+ unsigned int __ctx(vrregs)[32][4];
+ vscr_t __ctx(vscr);
+ unsigned int __ctx(vrsave);
unsigned int __pad[3];
} vrregset_t __attribute__((__aligned__(16)));
typedef struct {
unsigned long __glibc_reserved[4];
- int signal;
+ int __ctx(signal);
int __pad0;
- unsigned long handler;
- unsigned long oldmask;
- struct pt_regs *regs;
- gregset_t gp_regs;
- fpregset_t fp_regs;
+ unsigned long __ctx(handler);
+ unsigned long __ctx(oldmask);
+ struct __ctx(pt_regs) *__ctx(regs);
+ gregset_t __ctx(gp_regs);
+ fpregset_t __ctx(fp_regs);
/*
* To maintain compatibility with current implementations the sigcontext is
* extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t)
@@ -124,17 +140,17 @@ typedef struct {
* The entry with index 33 contains the vrsave as the first word (offset 0)
* within the quadword.
*/
- vrregset_t *v_regs;
- long vmx_reserve[NVRREG+NVRREG+1];
+ vrregset_t *__ctx(v_regs);
+ long __ctx(vmx_reserve)[__NVRREG+__NVRREG+1];
} mcontext_t;
#endif
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
#if __WORDSIZE == 32
/*
@@ -160,17 +176,20 @@ typedef struct ucontext
* old ucontext_t; it ensures that uc_mcontext.regs and uc_sigmask
* are at the same offset as previously.
*/
- int uc_pad[7];
- union uc_regs_ptr {
- struct pt_regs *regs;
- mcontext_t *uc_regs;
+ int __glibc_reserved1[7];
+ union __ctx(uc_regs_ptr) {
+ struct __ctx(pt_regs) *__ctx(regs);
+ mcontext_t *__ctx(uc_regs);
} uc_mcontext;
sigset_t uc_sigmask;
- char uc_reg_space[sizeof(mcontext_t) + 12]; /* last for extensibility */
+ /* last for extensibility */
+ char __ctx(uc_reg_space)[sizeof(mcontext_t) + 12];
#else /* 64-bit */
sigset_t uc_sigmask;
mcontext_t uc_mcontext; /* last for extensibility */
#endif
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/user.h b/sysdeps/unix/sysv/linux/powerpc/sys/user.h
index 97459fba80..a7bb39b9e5 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/user.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/syscall.S b/sysdeps/unix/sysv/linux/powerpc/syscall.S
index 17bc21543b..2da91721be 100644
--- a/sysdeps/unix/sysv/linux/powerpc/syscall.S
+++ b/sysdeps/unix/sysv/linux/powerpc/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/syscalls.list
deleted file mode 100644
index 4f821e9b01..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/syscalls.list
+++ /dev/null
@@ -1,3 +0,0 @@
-# File name Caller Syscall name # args Strong name Weak names
-
-waitpid - waitpid Ci:ipi __waitpid waitpid
diff --git a/sysdeps/unix/sysv/linux/powerpc/sysconf.c b/sysdeps/unix/sysv/linux/powerpc/sysconf.c
new file mode 100644
index 0000000000..43f308be0e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/sysconf.c
@@ -0,0 +1,75 @@
+/* Get system-specific information at run-time. Linux/powerpc version.
+ Copyright (C) 2017-2018 Free Software 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 <unistd.h>
+#include <sys/auxv.h>
+
+static long linux_sysconf (int name);
+
+static inline long
+auxv2sysconf_cache_associativity (unsigned long type)
+{
+ return (__getauxval (type) & 0xffff0000) >> 16;
+}
+
+static inline long
+auxv2sysconf_cache_linesize (unsigned long type)
+{
+ return __getauxval (type) & 0xffff;
+}
+
+/* Get the value of the system variable NAME. */
+long int
+__sysconf (int name)
+{
+ switch (name)
+ {
+ case _SC_LEVEL1_ICACHE_SIZE:
+ return __getauxval (AT_L1I_CACHESIZE);
+ case _SC_LEVEL1_ICACHE_ASSOC:
+ return auxv2sysconf_cache_associativity (AT_L1I_CACHEGEOMETRY);
+ case _SC_LEVEL1_ICACHE_LINESIZE:
+ return auxv2sysconf_cache_linesize (AT_L1I_CACHEGEOMETRY);
+ case _SC_LEVEL1_DCACHE_SIZE:
+ return __getauxval (AT_L1D_CACHESIZE);
+ case _SC_LEVEL1_DCACHE_ASSOC:
+ return auxv2sysconf_cache_associativity (AT_L1D_CACHEGEOMETRY);
+ case _SC_LEVEL1_DCACHE_LINESIZE:
+ return auxv2sysconf_cache_linesize (AT_L1D_CACHEGEOMETRY);
+ case _SC_LEVEL2_CACHE_SIZE:
+ return __getauxval (AT_L2_CACHESIZE);
+ case _SC_LEVEL2_CACHE_ASSOC:
+ return auxv2sysconf_cache_associativity (AT_L2_CACHEGEOMETRY);
+ case _SC_LEVEL2_CACHE_LINESIZE:
+ return auxv2sysconf_cache_linesize (AT_L2_CACHEGEOMETRY);
+ case _SC_LEVEL3_CACHE_SIZE:
+ return __getauxval (AT_L3_CACHESIZE);
+ case _SC_LEVEL3_CACHE_ASSOC:
+ return auxv2sysconf_cache_associativity (AT_L3_CACHEGEOMETRY);
+ case _SC_LEVEL3_CACHE_LINESIZE:
+ return auxv2sysconf_cache_linesize (AT_L3_CACHEGEOMETRY);
+ default:
+ return linux_sysconf (name);
+ }
+}
+
+/* Now the generic Linux version. */
+#undef __sysconf
+#define __sysconf static linux_sysconf
+#include "../sysconf.c"
diff --git a/sysdeps/unix/sysv/linux/powerpc/sysdep.c b/sysdeps/unix/sysv/linux/powerpc/sysdep.c
index 9744138f73..1eacc13185 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sysdep.c
+++ b/sysdeps/unix/sysv/linux/powerpc/sysdep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq.c b/sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq.c
index cb3d1fef0a..b17b4c00e5 100644
--- a/sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq.c
+++ b/sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq.c
@@ -1,5 +1,5 @@
/* Check __ppc_get_timebase_freq() for architecture changes
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/powerpc/test-powerpc-linux-sysconf.c b/sysdeps/unix/sysv/linux/powerpc/test-powerpc-linux-sysconf.c
new file mode 100644
index 0000000000..6fa77037d2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/test-powerpc-linux-sysconf.c
@@ -0,0 +1,73 @@
+/* Check use of sysconf() for cache geometries.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* Test use of sysconf() to get cache sizes, cache set associativity
+ and cache line sizes. */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <support/test-driver.h>
+
+#define call_str(f, name) f(name, #name)
+
+long
+do_sysconf (int name, const char * str)
+{
+ int rc = 0;
+ long val;
+ errno = 0;
+ val = sysconf (name);
+ if (val == -1) {
+ if (errno != EINVAL) {
+ printf("error: sysconf(%s): unexpected errno(%d)\n", str, errno);
+ exit (1);
+ }
+ printf ("info: sysconf(%s): unsupported\n", str);
+ rc = 1;
+ } else
+ printf ("sysconf(%s) = 0x%lx (%ld)\n", str, val, val);
+ return rc;
+}
+
+static int
+do_test (void)
+{
+ int rc = 0;
+
+ rc += call_str (do_sysconf, _SC_LEVEL1_ICACHE_SIZE);
+ rc += call_str (do_sysconf, _SC_LEVEL1_ICACHE_ASSOC);
+ rc += call_str (do_sysconf, _SC_LEVEL1_ICACHE_LINESIZE);
+ rc += call_str (do_sysconf, _SC_LEVEL1_DCACHE_SIZE);
+ rc += call_str (do_sysconf, _SC_LEVEL1_DCACHE_ASSOC);
+ rc += call_str (do_sysconf, _SC_LEVEL1_DCACHE_LINESIZE);
+ rc += call_str (do_sysconf, _SC_LEVEL2_CACHE_SIZE);
+ rc += call_str (do_sysconf, _SC_LEVEL2_CACHE_ASSOC);
+ rc += call_str (do_sysconf, _SC_LEVEL2_CACHE_LINESIZE);
+ rc += call_str (do_sysconf, _SC_LEVEL3_CACHE_SIZE);
+ rc += call_str (do_sysconf, _SC_LEVEL3_CACHE_ASSOC);
+ rc += call_str (do_sysconf, _SC_LEVEL3_CACHE_LINESIZE);
+
+ if (rc)
+ return EXIT_UNSUPPORTED;
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c
index 797341944c..8814bcc14f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/time.c
+++ b/sysdeps/unix/sysv/linux/powerpc/time.c
@@ -1,5 +1,5 @@
/* time system call for Linux/PowerPC.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,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/ppoll.c b/sysdeps/unix/sysv/linux/ppoll.c
index c4486af606..de7d3d6ac9 100644
--- a/sysdeps/unix/sysv/linux/ppoll.c
+++ b/sysdeps/unix/sysv/linux/ppoll.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
@@ -20,18 +20,9 @@
#include <signal.h>
#include <time.h>
#include <sys/poll.h>
-#include <kernel-features.h>
#include <sysdep-cancel.h>
-#ifdef __NR_ppoll
-# ifndef __ASSUME_PPOLL
-static int __generic_ppoll (struct pollfd *fds, nfds_t nfds,
- const struct timespec *timeout,
- const sigset_t *sigmask);
-# endif
-
-
int
ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
const sigset_t *sigmask)
@@ -45,24 +36,6 @@ ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
timeout = &tval;
}
- int result;
-
- result = SYSCALL_CANCEL (ppoll, fds, nfds, timeout, sigmask, _NSIG / 8);
-
-# ifndef __ASSUME_PPOLL
- if (result == -1 && errno == ENOSYS)
- result = __generic_ppoll (fds, nfds, timeout, sigmask);
-# endif
-
- return result;
+ return SYSCALL_CANCEL (ppoll, fds, nfds, timeout, sigmask, _NSIG / 8);
}
libc_hidden_def (ppoll)
-
-# ifndef __ASSUME_PPOLL
-# define ppoll static __generic_ppoll
-# endif
-#endif
-
-#ifndef __ASSUME_PPOLL
-# include <io/ppoll.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c
index 4aa3c6746b..5dc31097ca 100644
--- a/sysdeps/unix/sysv/linux/pread.c
+++ b/sysdeps/unix/sysv/linux/pread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -16,33 +16,22 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <assert.h>
-#include <errno.h>
-#include <endian.h>
#include <unistd.h>
-
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pread
-# error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
+#ifndef __OFF_T_MATCHES_OFF64_T
+# ifndef __NR_pread
+# define __NR_pread __NR_pread64
+# endif
ssize_t
__libc_pread (int fd, void *buf, size_t count, off_t offset)
{
- ssize_t result;
-
- assert (sizeof (offset) == 4);
- result = SYSCALL_CANCEL (pread, fd, buf, count,
- __LONG_LONG_PAIR (offset >> 31, offset));
-
- return result;
+ return SYSCALL_CANCEL (pread, fd, buf, count, SYSCALL_LL_PRW (offset));
}
strong_alias (__libc_pread, __pread)
+libc_hidden_weak (__pread)
weak_alias (__libc_pread, pread)
+#endif
diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c
index 7b5019ad06..6b52cff375 100644
--- a/sysdeps/unix/sysv/linux/pread64.c
+++ b/sysdeps/unix/sysv/linux/pread64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -16,28 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <endian.h>
#include <unistd.h>
-
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pread
-# error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
+#ifndef __NR_pread64
+# define __NR_pread64 __NR_pread
#endif
-
ssize_t
__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
{
- return SYSCALL_CANCEL (pread, fd, buf, count,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
+ return SYSCALL_CANCEL (pread64, fd, buf, count, SYSCALL_LL64_PRW (offset));
}
weak_alias (__libc_pread64, __pread64)
+libc_hidden_weak (__pread64)
weak_alias (__libc_pread64, pread64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (__libc_pread64, __libc_pread)
+weak_alias (__libc_pread64, __pread)
+weak_alias (__libc_pread64, pread)
+#endif
diff --git a/sysdeps/unix/sysv/linux/preadv.c b/sysdeps/unix/sysv/linux/preadv.c
index ca8da33119..ea5758429c 100644
--- a/sysdeps/unix/sysv/linux/preadv.c
+++ b/sysdeps/unix/sysv/linux/preadv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software 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,67 +15,41 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stddef.h>
-#include <sys/param.h>
-#include <stdint.h>
-#if __WORDSIZE == 64
-/* Hide the preadv64 declaration. */
-# define preadv64 __redirect_preadv64
-#endif
#include <sys/uio.h>
-
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#include <kernel-features.h>
-
-
-#ifndef PREADV
-# define PREADV preadv
-# define PREADV_REPLACEMENT __atomic_preadv_replacement
-# define PREAD __pread
-# define OFF_T off_t
-#endif
-#define LO_HI_LONG(val) \
- (off_t) val, \
- (off_t) ((((uint64_t) (val)) >> (sizeof (long) * 4)) >> (sizeof (long) * 4))
+#ifndef __OFF_T_MATCHES_OFF64_T
-#ifndef __ASSUME_PREADV
-static ssize_t PREADV_REPLACEMENT (int, const struct iovec *,
- int, OFF_T) internal_function;
-#endif
+# ifdef __ASSUME_PREADV
+# ifndef __NR_preadv
+# define __NR_preadv __NR_preadv64
+# endif
ssize_t
-PREADV (int fd, const struct iovec *vector, int count, OFF_T offset)
+preadv (int fd, const struct iovec *vector, int count, off_t offset)
{
-#ifdef __NR_preadv
- ssize_t result;
-
- result = SYSCALL_CANCEL (preadv, fd, vector, count, LO_HI_LONG (offset));
-
-# ifdef __ASSUME_PREADV
- return result;
-# endif
-#endif
-
-#ifndef __ASSUME_PREADV
-# ifdef __NR_preadv
+ return SYSCALL_CANCEL (preadv, fd, vector, count, LO_HI_LONG (offset));
+}
+# else
+static ssize_t __atomic_preadv_replacement (int, const struct iovec *,
+ int, off_t);
+ssize_t
+preadv (int fd, const struct iovec *vector, int count, off_t offset)
+{
+# ifdef __NR_preadv
+ ssize_t result = SYSCALL_CANCEL (preadv, fd, vector, count,
+ LO_HI_LONG (offset));
if (result >= 0 || errno != ENOSYS)
return result;
-# endif
-
- return PREADV_REPLACEMENT (fd, vector, count, offset);
-#endif
+# endif
+ return __atomic_preadv_replacement (fd, vector, count, offset);
}
-#if __WORDSIZE == 64
-# undef preadv64
-strong_alias (preadv, preadv64)
-#endif
+# define PREADV static __atomic_preadv_replacement
+# define PREAD __pread
+# define OFF_T off_t
+# include <sysdeps/posix/preadv_common.c>
+# endif /* __ASSUME_PREADV */
-#ifndef __ASSUME_PREADV
-# undef PREADV
-# define PREADV static internal_function PREADV_REPLACEMENT
-# include <sysdeps/posix/preadv.c>
+libc_hidden_def (preadv)
#endif
diff --git a/sysdeps/unix/sysv/linux/preadv2.c b/sysdeps/unix/sysv/linux/preadv2.c
new file mode 100644
index 0000000000..c8bf0764ef
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/preadv2.c
@@ -0,0 +1,58 @@
+/* Linux implementation of preadv2.
+ Copyright (C) 2017-2018 Free Software 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/uio.h>
+#include <sysdep-cancel.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+# if !defined (__NR_preadv2) && defined (__NR_pread64v2)
+# define __NR_preadv2 __NR_pread64v2
+# endif
+
+ssize_t
+preadv2 (int fd, const struct iovec *vector, int count, off_t offset,
+ int flags)
+{
+# ifdef __NR_preadv2
+ ssize_t result = SYSCALL_CANCEL (preadv2, fd, vector, count,
+ LO_HI_LONG (offset), flags);
+ if (result >= 0)
+ return result;
+# endif
+ /* Trying to emulate the preadv2 syscall flags is troublesome:
+
+ * We can not temporary change the file state of the O_DSYNC and O_SYNC
+ flags to emulate RWF_{D}SYNC (attempts to change the state of using
+ fcntl are silently ignored).
+
+ * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal
+ semantic not provided by any other flag (O_NONBLOCK for instance). */
+
+ if (flags != 0)
+ {
+ __set_errno (ENOTSUP);
+ return -1;
+ }
+ if (offset == -1)
+ return __readv (fd, vector, count);
+ else
+ return preadv (fd, vector, count, offset);
+}
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/preadv64.c b/sysdeps/unix/sysv/linux/preadv64.c
index 936ff1426c..5f4fba55e7 100644
--- a/sysdeps/unix/sysv/linux/preadv64.c
+++ b/sysdeps/unix/sysv/linux/preadv64.c
@@ -1,6 +1,56 @@
-#define PREADV preadv64
-#define PREADV_REPLACEMENT __atomic_preadv64_replacement
-#define PREAD __libc_pread64
-#define OFF_T off64_t
+/* Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#include "preadv.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.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/uio.h>
+#include <sysdep-cancel.h>
+
+#ifdef __ASSUME_PREADV
+
+# ifndef __NR_preadv64
+# define __NR_preadv64 __NR_preadv
+# endif
+
+ssize_t
+preadv64 (int fd, const struct iovec *vector, int count, off64_t offset)
+{
+ return SYSCALL_CANCEL (preadv64, fd, vector, count, LO_HI_LONG (offset));
+}
+#else
+static ssize_t __atomic_preadv64_replacement (int, const struct iovec *,
+ int, off64_t);
+ssize_t
+preadv64 (int fd, const struct iovec *vector, int count, off64_t offset)
+{
+#ifdef __NR_preadv64
+ ssize_t result = SYSCALL_CANCEL (preadv64, fd, vector, count,
+ LO_HI_LONG (offset));
+ if (result >= 0 || errno != ENOSYS)
+ return result;
+#endif
+ return __atomic_preadv64_replacement (fd, vector, count, offset);
+}
+# define PREADV static __atomic_preadv64_replacement
+# define PREAD __pread64
+# define OFF_T off64_t
+# include <sysdeps/posix/preadv_common.c>
+#endif
+libc_hidden_def (preadv64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (preadv64, preadv)
+libc_hidden_def (preadv)
+#endif
diff --git a/sysdeps/unix/sysv/linux/preadv64v2.c b/sysdeps/unix/sysv/linux/preadv64v2.c
new file mode 100644
index 0000000000..d7400a0252
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/preadv64v2.c
@@ -0,0 +1,59 @@
+/* Linux implementation of preadv2 (LFS version).
+ Copyright (C) 2017-2018 Free Software 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/uio.h>
+#include <sysdep-cancel.h>
+
+#if !defined(__NR_preadv64v2) && defined(__NR_preadv2)
+# define __NR_preadv64v2 __NR_preadv2
+#endif
+
+ssize_t
+preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
+ int flags)
+{
+#ifdef __NR_preadv64v2
+ ssize_t result = SYSCALL_CANCEL (preadv64v2, fd, vector, count,
+ LO_HI_LONG (offset), flags);
+ if (result >= 0)
+ return result;
+#endif
+ /* Trying to emulate the preadv2 syscall flags is troublesome:
+
+ * We can not temporary change the file state of the O_DSYNC and O_SYNC
+ flags to emulate RWF_{D}SYNC (attempts to change the state of using
+ fcntl are silently ignored).
+
+ * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal
+ semantic not provided by any other flag (O_NONBLOCK for instance). */
+
+ if (flags != 0)
+ {
+ __set_errno (ENOTSUP);
+ return -1;
+ }
+
+ if (offset == -1)
+ return __readv (fd, vector, count);
+ else
+ return preadv64 (fd, vector, count, offset);
+}
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (preadv64v2, preadv2)
+#endif
diff --git a/sysdeps/unix/sysv/linux/prlimit.c b/sysdeps/unix/sysv/linux/prlimit.c
index b0390d24be..2fa0642c76 100644
--- a/sysdeps/unix/sysv/linux/prlimit.c
+++ b/sysdeps/unix/sysv/linux/prlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,6 @@
#include <sys/syscall.h>
-#ifdef __NR_prlimit64
int
prlimit (__pid_t pid, enum __rlimit_resource resource,
const struct rlimit *new_rlimit, struct rlimit *old_rlimit)
@@ -51,21 +50,24 @@ prlimit (__pid_t pid, enum __rlimit_resource resource,
{
/* The prlimit64 syscall is ill-designed for 32-bit machines.
We have to provide a 32-bit variant since otherwise the LFS
- system would not work. But what shall we do if the syscall
- succeeds but the old values do not fit into a rlimit
- structure? We cannot return an error because the operation
- itself worked. Best is perhaps to return RLIM_INFINITY. */
+ system would not work. The infinity value can be translated,
+ but otherwise what shall we do if the syscall succeeds but the
+ old values do not fit into a rlimit structure? We cannot return
+ an error because the operation itself worked. Best is perhaps
+ to return RLIM_INFINITY. */
old_rlimit->rlim_cur = old_rlimit64_mem.rlim_cur;
if (old_rlimit->rlim_cur != old_rlimit64_mem.rlim_cur)
{
- if (new_rlimit == NULL)
+ if ((new_rlimit == NULL)
+ && (old_rlimit64_mem.rlim_cur != RLIM64_INFINITY))
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW);
old_rlimit->rlim_cur = RLIM_INFINITY;
}
old_rlimit->rlim_max = old_rlimit64_mem.rlim_max;
if (old_rlimit->rlim_max != old_rlimit64_mem.rlim_max)
{
- if (new_rlimit == NULL)
+ if ((new_rlimit == NULL)
+ && (old_rlimit64_mem.rlim_max != RLIM64_INFINITY))
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW);
old_rlimit->rlim_max = RLIM_INFINITY;
}
@@ -73,12 +75,3 @@ prlimit (__pid_t pid, enum __rlimit_resource resource,
return res;
}
-#else
-int
-prlimit (__pid_t pid, enum __rlimit_resource resource,
- const struct rlimit *new_rlimit, struct rlimit *old_rlimit)
-{
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-}
-stub_warning (prlimit)
-#endif
diff --git a/sysdeps/unix/sysv/linux/prof-freq.c b/sysdeps/unix/sysv/linux/prof-freq.c
index 44242511b7..6e30d95b32 100644
--- a/sysdeps/unix/sysv/linux/prof-freq.c
+++ b/sysdeps/unix/sysv/linux/prof-freq.c
@@ -1,5 +1,5 @@
/* Determine realtime clock frequency.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/pselect.c b/sysdeps/unix/sysv/linux/pselect.c
index 843d71a0f7..2b052e7b00 100644
--- a/sysdeps/unix/sysv/linux/pselect.c
+++ b/sysdeps/unix/sysv/linux/pselect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
diff --git a/sysdeps/unix/sysv/linux/pt-raise.c b/sysdeps/unix/sysv/linux/pt-raise.c
index 715bbe9f2e..b5513d4537 100644
--- a/sysdeps/unix/sysv/linux/pt-raise.c
+++ b/sysdeps/unix/sysv/linux/pt-raise.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* ISO C raise function for libpthread.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -16,22 +17,4 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-
-int
-raise (int sig)
-{
- /* raise is an async-safe function. It could be called while the
- fork function temporarily invalidated the PID field. Adjust for
- that. */
- pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
- if (__glibc_unlikely (pid < 0))
- pid = -pid;
-
- return INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid),
- sig);
-}
+#include <sysdeps/unix/sysv/linux/raise.c>
diff --git a/sysdeps/unix/sysv/linux/pthread-pids.h b/sysdeps/unix/sysv/linux/pthread-pids.h
index d42bba03cf..dcdac6e27b 100644
--- a/sysdeps/unix/sysv/linux/pthread-pids.h
+++ b/sysdeps/unix/sysv/linux/pthread-pids.h
@@ -1,5 +1,5 @@
/* Initialize pid and tid fields of struct pthread. Linux version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,5 +26,5 @@ static inline void
__pthread_initialize_pids (struct pthread *pd)
{
INTERNAL_SYSCALL_DECL (err);
- pd->pid = pd->tid = INTERNAL_SYSCALL (set_tid_address, err, 1, &pd->tid);
+ pd->tid = INTERNAL_SYSCALL_CALL (set_tid_address, err, &pd->tid);
}
diff --git a/sysdeps/unix/sysv/linux/pthread_getaffinity.c b/sysdeps/unix/sysv/linux/pthread_getaffinity.c
index a5e233eac6..ab89b98790 100644
--- a/sysdeps/unix/sysv/linux/pthread_getaffinity.c
+++ b/sysdeps/unix/sysv/linux/pthread_getaffinity.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c b/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
index 5fa232330e..f56a7c5c29 100644
--- a/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
+++ b/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
@@ -1,5 +1,5 @@
/* pthread_getcpuclockid -- Get POSIX clockid_t for a pthread_t. Linux version
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/pthread_getname.c b/sysdeps/unix/sysv/linux/pthread_getname.c
index 862c8c7ec5..726218b4df 100644
--- a/sysdeps/unix/sysv/linux/pthread_getname.c
+++ b/sysdeps/unix/sysv/linux/pthread_getname.c
@@ -1,5 +1,5 @@
/* pthread_getname_np -- Get thread name. Linux version
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -45,12 +45,12 @@ pthread_getname_np (pthread_t th, char *buf, size_t len)
char fname[sizeof (FMT) + 8];
sprintf (fname, FMT, (unsigned int) pd->tid);
- int fd = open_not_cancel_2 (fname, O_RDONLY);
+ int fd = __open64_nocancel (fname, O_RDONLY);
if (fd == -1)
return errno;
int res = 0;
- ssize_t n = TEMP_FAILURE_RETRY (read_not_cancel (fd, buf, len));
+ ssize_t n = TEMP_FAILURE_RETRY (__read_nocancel (fd, buf, len));
if (n < 0)
res = errno;
else
@@ -63,7 +63,7 @@ pthread_getname_np (pthread_t th, char *buf, size_t len)
buf[n] = '\0';
}
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
return res;
}
diff --git a/sysdeps/unix/sysv/linux/pthread_kill.c b/sysdeps/unix/sysv/linux/pthread_kill.c
index bcb3009675..3a6171b815 100644
--- a/sysdeps/unix/sysv/linux/pthread_kill.c
+++ b/sysdeps/unix/sysv/linux/pthread_kill.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -21,6 +21,7 @@
#include <pthreadP.h>
#include <tls.h>
#include <sysdep.h>
+#include <unistd.h>
int
@@ -49,15 +50,9 @@ __pthread_kill (pthread_t threadid, int signo)
/* We have a special syscall to do the work. */
INTERNAL_SYSCALL_DECL (err);
- /* One comment: The PID field in the TCB can temporarily be changed
- (in fork). But this must not affect this code here. Since this
- function would have to be called while the thread is executing
- fork, it would have to happen in a signal handler. But this is
- no allowed, pthread_kill is not guaranteed to be async-safe. */
- int val;
- val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
- tid, signo);
+ pid_t pid = __getpid ();
+ int val = INTERNAL_SYSCALL_CALL (tgkill, err, pid, tid, signo);
return (INTERNAL_SYSCALL_ERROR_P (val, err)
? INTERNAL_SYSCALL_ERRNO (val, err) : 0);
}
diff --git a/sysdeps/unix/sysv/linux/pthread_setaffinity.c b/sysdeps/unix/sysv/linux/pthread_setaffinity.c
index cd188370f8..faaa67d65e 100644
--- a/sysdeps/unix/sysv/linux/pthread_setaffinity.c
+++ b/sysdeps/unix/sysv/linux/pthread_setaffinity.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/pthread_setname.c b/sysdeps/unix/sysv/linux/pthread_setname.c
index 6c5e1d6e48..91b5273480 100644
--- a/sysdeps/unix/sysv/linux/pthread_setname.c
+++ b/sysdeps/unix/sysv/linux/pthread_setname.c
@@ -1,5 +1,5 @@
/* pthread_setname_np -- Set thread name. Linux version
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -46,18 +46,18 @@ pthread_setname_np (pthread_t th, const char *name)
char fname[sizeof (FMT) + 8];
sprintf (fname, FMT, (unsigned int) pd->tid);
- int fd = open_not_cancel_2 (fname, O_RDWR);
+ int fd = __open64_nocancel (fname, O_RDWR);
if (fd == -1)
return errno;
int res = 0;
- ssize_t n = TEMP_FAILURE_RETRY (write_not_cancel (fd, name, name_len));
+ ssize_t n = TEMP_FAILURE_RETRY (__write_nocancel (fd, name, name_len));
if (n < 0)
res = errno;
else if (n != name_len)
res = EIO;
- close_not_cancel_no_status (fd);
+ __close_nocancel_nostatus (fd);
return res;
}
diff --git a/sysdeps/unix/sysv/linux/pthread_sigmask.c b/sysdeps/unix/sysv/linux/pthread_sigmask.c
index 71cf69c08a..2eaf751def 100644
--- a/sysdeps/unix/sysv/linux/pthread_sigmask.c
+++ b/sysdeps/unix/sysv/linux/pthread_sigmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/unix/sysv/linux/pthread_sigqueue.c b/sysdeps/unix/sysv/linux/pthread_sigqueue.c
index 7694d5467c..d8061efdba 100644
--- a/sysdeps/unix/sysv/linux/pthread_sigqueue.c
+++ b/sysdeps/unix/sysv/linux/pthread_sigqueue.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
@@ -49,27 +49,22 @@ pthread_sigqueue (pthread_t threadid, int signo, const union sigval value)
if (signo == SIGCANCEL || signo == SIGTIMER || signo == SIGSETXID)
return EINVAL;
+ pid_t pid = getpid ();
+
/* Set up the siginfo_t structure. */
siginfo_t info;
memset (&info, '\0', sizeof (siginfo_t));
info.si_signo = signo;
info.si_code = SI_QUEUE;
- info.si_pid = THREAD_GETMEM (THREAD_SELF, pid);
+ info.si_pid = pid;
info.si_uid = getuid ();
info.si_value = value;
/* We have a special syscall to do the work. */
INTERNAL_SYSCALL_DECL (err);
- /* One comment: The PID field in the TCB can temporarily be changed
- (in fork). But this must not affect this code here. Since this
- function would have to be called while the thread is executing
- fork, it would have to happen in a signal handler. But this is
- no allowed, pthread_sigqueue is not guaranteed to be async-safe. */
- int val = INTERNAL_SYSCALL (rt_tgsigqueueinfo, err, 4,
- THREAD_GETMEM (THREAD_SELF, pid),
- tid, signo, &info);
-
+ int val = INTERNAL_SYSCALL_CALL (rt_tgsigqueueinfo, err, pid, tid, signo,
+ &info);
return (INTERNAL_SYSCALL_ERROR_P (val, err)
? INTERNAL_SYSCALL_ERRNO (val, err) : 0);
#else
diff --git a/sysdeps/unix/sysv/linux/ptrace.c b/sysdeps/unix/sysv/linux/ptrace.c
index 54dea7e6bb..e1f210be4c 100644
--- a/sysdeps/unix/sysv/linux/ptrace.c
+++ b/sysdeps/unix/sysv/linux/ptrace.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/ptsname.c b/sysdeps/unix/sysv/linux/ptsname.c
index 179ae6a293..a4c233680f 100644
--- a/sysdeps/unix/sysv/linux/ptsname.c
+++ b/sysdeps/unix/sysv/linux/ptsname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
@@ -29,16 +29,18 @@
#include <_itoa.h>
/* Check if DEV corresponds to a master pseudo terminal device. */
-#define MASTER_P(Dev) \
- (major ((Dev)) == 2 \
- || (major ((Dev)) == 4 && minor ((Dev)) >= 128 && minor ((Dev)) < 192) \
- || (major ((Dev)) >= 128 && major ((Dev)) < 136))
+#define MASTER_P(Dev) \
+ (__gnu_dev_major ((Dev)) == 2 \
+ || (__gnu_dev_major ((Dev)) == 4 \
+ && __gnu_dev_minor ((Dev)) >= 128 && __gnu_dev_minor ((Dev)) < 192) \
+ || (__gnu_dev_major ((Dev)) >= 128 && __gnu_dev_major ((Dev)) < 136))
/* Check if DEV corresponds to a slave pseudo terminal device. */
-#define SLAVE_P(Dev) \
- (major ((Dev)) == 3 \
- || (major ((Dev)) == 4 && minor ((Dev)) >= 192 && minor ((Dev)) < 256) \
- || (major ((Dev)) >= 136 && major ((Dev)) < 144))
+#define SLAVE_P(Dev) \
+ (__gnu_dev_major ((Dev)) == 3 \
+ || (__gnu_dev_major ((Dev)) == 4 \
+ && __gnu_dev_minor ((Dev)) >= 192 && __gnu_dev_minor ((Dev)) < 256) \
+ || (__gnu_dev_major ((Dev)) >= 136 && __gnu_dev_major ((Dev)) < 144))
/* Note that major number 4 corresponds to the old BSD style pseudo
terminal devices. As of Linux 2.1.115 these are no longer
@@ -72,12 +74,6 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
int save_errno = errno;
unsigned int ptyno;
- if (buf == NULL)
- {
- __set_errno (EINVAL);
- return EINVAL;
- }
-
if (!__isatty (fd))
{
__set_errno (ENOTTY);
@@ -128,7 +124,7 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
return ENOTTY;
}
- ptyno = minor (stp->st_rdev);
+ ptyno = __gnu_dev_minor (stp->st_rdev);
if (ptyno / 16 >= strlen (__libc_ptyname1))
{
diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c
index d02862ade7..ba7af38cd8 100644
--- a/sysdeps/unix/sysv/linux/pwrite.c
+++ b/sysdeps/unix/sysv/linux/pwrite.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -16,33 +16,22 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <assert.h>
-#include <errno.h>
-#include <endian.h>
#include <unistd.h>
-
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pwrite
-# error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
+#ifndef __OFF_T_MATCHES_OFF64_T
+# ifndef __NR_pwrite
+# define __NR_pwrite __NR_pwrite64
+# endif
ssize_t
__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
{
- ssize_t result;
-
- assert (sizeof (offset) == 4);
- result = SYSCALL_CANCEL (pwrite, fd, buf, count,
- __LONG_LONG_PAIR (offset >> 31, offset));
-
- return result;
+ return SYSCALL_CANCEL (pwrite, fd, buf, count, SYSCALL_LL_PRW (offset));
}
strong_alias (__libc_pwrite, __pwrite)
+libc_hidden_weak (__pwrite)
weak_alias (__libc_pwrite, pwrite)
+#endif
diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c
index d28e9b98da..d038647b83 100644
--- a/sysdeps/unix/sysv/linux/pwrite64.c
+++ b/sysdeps/unix/sysv/linux/pwrite64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -16,28 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <endian.h>
#include <unistd.h>
-
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pwrite
-# error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
+#ifndef __NR_pwrite64
+# define __NR_pwrite64 __NR_pwrite
#endif
-
ssize_t
__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
{
- return SYSCALL_CANCEL (pwrite, fd, buf, count,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
+ return SYSCALL_CANCEL (pwrite64, fd, buf, count, SYSCALL_LL64_PRW (offset));
}
+
weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_weak (__pwrite64)
weak_alias (__libc_pwrite64, pwrite64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (__libc_pwrite64, __libc_pwrite)
+weak_alias (__libc_pwrite64, __pwrite)
+weak_alias (__libc_pwrite64, pwrite)
+#endif
diff --git a/sysdeps/unix/sysv/linux/pwritev.c b/sysdeps/unix/sysv/linux/pwritev.c
index e66f08e1d2..034c3d71c1 100644
--- a/sysdeps/unix/sysv/linux/pwritev.c
+++ b/sysdeps/unix/sysv/linux/pwritev.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software 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,67 +15,41 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <sys/param.h>
-#if __WORDSIZE == 64 && !defined PWRITEV
-/* Hide the pwritev64 declaration. */
-# define pwritev64 __redirect_pwritev64
-#endif
#include <sys/uio.h>
-
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#include <kernel-features.h>
-
-
-#ifndef PWRITEV
-# define PWRITEV pwritev
-# define PWRITEV_REPLACEMENT __atomic_pwritev_replacement
-# define PWRITE __pwrite
-# define OFF_T off_t
-#endif
-#define LO_HI_LONG(val) \
- (off_t) val, \
- (off_t) ((((uint64_t) (val)) >> (sizeof (long) * 4)) >> (sizeof (long) * 4))
+#ifndef __OFF_T_MATCHES_OFF64_T
-#ifndef __ASSUME_PWRITEV
-static ssize_t PWRITEV_REPLACEMENT (int, const struct iovec *,
- int, OFF_T) internal_function;
-#endif
+# ifdef __ASSUME_PREADV
+# ifndef __NR_pwritev
+# define __NR_pwritev __NR_pwritev64
+# endif
ssize_t
-PWRITEV (int fd, const struct iovec *vector, int count, OFF_T offset)
+pwritev (int fd, const struct iovec *vector, int count, off_t offset)
{
-#ifdef __NR_pwritev
- ssize_t result;
-
- result = SYSCALL_CANCEL (pwritev, fd, vector, count, LO_HI_LONG (offset));
-
-# ifdef __ASSUME_PWRITEV
- return result;
-# endif
-#endif
-
-#ifndef __ASSUME_PWRITEV
-# ifdef __NR_pwritev
+ return SYSCALL_CANCEL (pwritev, fd, vector, count, LO_HI_LONG (offset));
+}
+# else
+static ssize_t __atomic_pwritev_replacement (int, const struct iovec *,
+ int, off_t);
+ssize_t
+pwritev (int fd, const struct iovec *vector, int count, off_t offset)
+{
+# ifdef __NR_pwritev
+ ssize_t result = SYSCALL_CANCEL (pwritev, fd, vector, count,
+ LO_HI_LONG (offset));
if (result >= 0 || errno != ENOSYS)
return result;
-# endif
-
- return PWRITEV_REPLACEMENT (fd, vector, count, offset);
-#endif
+# endif
+ return __atomic_pwritev_replacement (fd, vector, count, offset);
}
-#if __WORDSIZE == 64 && defined pwritev64
-# undef pwritev64
-strong_alias (pwritev, pwritev64)
-#endif
+# define PWRITEV static __atomic_pwritev_replacement
+# define PWRITE __pwrite
+# define OFF_T off_t
+# include <sysdeps/posix/pwritev_common.c>
+# endif /* __ASSUME_PREADV */
-#ifndef __ASSUME_PWRITEV
-# undef PWRITEV
-# define PWRITEV static internal_function PWRITEV_REPLACEMENT
-# include <sysdeps/posix/pwritev.c>
+libc_hidden_def (pwritev)
#endif
diff --git a/sysdeps/unix/sysv/linux/pwritev2.c b/sysdeps/unix/sysv/linux/pwritev2.c
new file mode 100644
index 0000000000..29c2264c8f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pwritev2.c
@@ -0,0 +1,54 @@
+/* Linux implementation of pwritev2.
+ Copyright (C) 2017-2018 Free Software 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/uio.h>
+#include <sysdep-cancel.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+ssize_t
+pwritev2 (int fd, const struct iovec *vector, int count, off_t offset,
+ int flags)
+{
+# ifdef __NR_pwritev2
+ ssize_t result = SYSCALL_CANCEL (pwritev2, fd, vector, count,
+ LO_HI_LONG (offset), flags);
+ if (result >= 0)
+ return result;
+# endif
+ /* Trying to emulate the pwritev2 syscall flags is troublesome:
+
+ * We can not temporary change the file state of the O_DSYNC and O_SYNC
+ flags to emulate RWF_{D}SYNC (attempts to change the state of using
+ fcntl are silently ignored).
+
+ * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal
+ semantic not provided by any other flag (O_NONBLOCK for instance). */
+
+ if (flags != 0)
+ {
+ __set_errno (ENOTSUP);
+ return -1;
+ }
+ if (offset == -1)
+ return __writev (fd, vector, count);
+ else
+ return pwritev (fd, vector, count, offset);
+}
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/pwritev64.c b/sysdeps/unix/sysv/linux/pwritev64.c
index 1e8168f103..2152ec163b 100644
--- a/sysdeps/unix/sysv/linux/pwritev64.c
+++ b/sysdeps/unix/sysv/linux/pwritev64.c
@@ -1,6 +1,56 @@
-#define PWRITEV pwritev64
-#define PWRITEV_REPLACEMENT __atomic_pwritev64_replacement
-#define PWRITE __pwrite64
-#define OFF_T off64_t
+/* Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#include "pwritev.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.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/uio.h>
+#include <sysdep-cancel.h>
+
+#ifdef __ASSUME_PWRITEV
+
+# ifndef __NR_pwritev64
+# define __NR_pwritev64 __NR_pwritev
+# endif
+
+ssize_t
+pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset)
+{
+ return SYSCALL_CANCEL (pwritev64, fd, vector, count, LO_HI_LONG (offset));
+}
+#else
+static ssize_t __atomic_pwritev64_replacement (int, const struct iovec *,
+ int, off64_t);
+ssize_t
+pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset)
+{
+#ifdef __NR_pwritev64
+ ssize_t result = SYSCALL_CANCEL (pwritev64, fd, vector, count,
+ LO_HI_LONG (offset));
+ if (result >= 0 || errno != ENOSYS)
+ return result;
+#endif
+ return __atomic_pwritev64_replacement (fd, vector, count, offset);
+}
+# define PWRITEV static __atomic_pwritev64_replacement
+# define PWRITE __pwrite64
+# define OFF_T off64_t
+# include <sysdeps/posix/pwritev_common.c>
+#endif
+libc_hidden_def (pwritev64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (pwritev64, pwritev)
+libc_hidden_def (pwritev)
+#endif
diff --git a/sysdeps/unix/sysv/linux/pwritev64v2.c b/sysdeps/unix/sysv/linux/pwritev64v2.c
new file mode 100644
index 0000000000..42da321149
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pwritev64v2.c
@@ -0,0 +1,58 @@
+/* Linux implementation of pwritev2 (LFS version).
+ Copyright (C) 2017-2018 Free Software 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/uio.h>
+#include <sysdep-cancel.h>
+
+#if !defined(__NR_pwritev64v2) && defined(__NR_pwritev2)
+# define __NR_pwritev64v2 __NR_pwritev2
+#endif
+
+ssize_t
+pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
+ int flags)
+{
+#ifdef __NR_pwritev64v2
+ ssize_t result = SYSCALL_CANCEL (pwritev64v2, fd, vector, count,
+ LO_HI_LONG (offset), flags);
+ if (result >= 0)
+ return result;
+#endif
+ /* Trying to emulate the pwritev2 syscall flags is troublesome:
+
+ * We can not temporary change the file state of the O_DSYNC and O_SYNC
+ flags to emulate RWF_{D}SYNC (attempts to change the state of using
+ fcntl are silently ignored).
+
+ * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal
+ semantic not provided by any other flag (O_NONBLOCK for instance). */
+
+ if (flags != 0)
+ {
+ __set_errno (ENOTSUP);
+ return -1;
+ }
+ if (offset == -1)
+ return __writev (fd, vector, count);
+ else
+ return pwritev64 (fd, vector, count, offset);
+}
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (pwritev64v2, pwritev2)
+#endif
diff --git a/sysdeps/unix/sysv/linux/raise.c b/sysdeps/unix/sysv/linux/raise.c
index 3795e6e5cc..b05eae202f 100644
--- a/sysdeps/unix/sysv/linux/raise.c
+++ b/sysdeps/unix/sysv/linux/raise.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -16,42 +16,38 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <limits.h>
#include <signal.h>
#include <sysdep.h>
-#include <nptl/pthreadP.h>
-
+#include <errno.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <internal-signals.h>
int
raise (int sig)
{
- struct pthread *pd = THREAD_SELF;
- pid_t pid = THREAD_GETMEM (pd, pid);
- pid_t selftid = THREAD_GETMEM (pd, tid);
- if (selftid == 0)
- {
- /* This system call is not supposed to fail. */
-#ifdef INTERNAL_SYSCALL
- INTERNAL_SYSCALL_DECL (err);
- selftid = INTERNAL_SYSCALL (gettid, err, 0);
-#else
- selftid = INLINE_SYSCALL (gettid, 0);
-#endif
- THREAD_SETMEM (pd, tid, selftid);
-
- /* We do not set the PID field in the TID here since we might be
- called from a signal handler while the thread executes fork. */
- pid = selftid;
- }
- else
- /* raise is an async-safe function. It could be called while the
- fork/vfork function temporarily invalidated the PID field. Adjust for
- that. */
- if (__glibc_unlikely (pid <= 0))
- pid = (pid & INT_MAX) == 0 ? selftid : -pid;
-
- return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
+ /* rt_sigprocmask may fail if:
+
+ 1. sigsetsize != sizeof (sigset_t) (EINVAL)
+ 2. a failure in copy from/to user space (EFAULT)
+ 3. an invalid 'how' operation (EINVAL)
+
+ The first case is already handle in glibc syscall call by using the arch
+ defined _NSIG. Second case is handled by using a stack allocated mask.
+ The last one should be handled by the block/unblock functions. */
+
+ sigset_t set;
+ __libc_signal_block_app (&set);
+
+ INTERNAL_SYSCALL_DECL (err);
+ pid_t pid = INTERNAL_SYSCALL (getpid, err, 0);
+ pid_t tid = INTERNAL_SYSCALL (gettid, err, 0);
+
+ int ret = INLINE_SYSCALL (tgkill, 3, pid, tid, sig);
+
+ __libc_signal_restore_set (&set);
+
+ return ret;
}
libc_hidden_def (raise)
weak_alias (raise, gsignal)
diff --git a/sysdeps/nacl/read.c b/sysdeps/unix/sysv/linux/read.c
index 3f42baf2e2..26d0bed404 100644
--- a/sysdeps/nacl/read.c
+++ b/sysdeps/unix/sysv/linux/read.c
@@ -1,5 +1,5 @@
-/* read -- Read data from a file descriptor. NaCl version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Linux read syscall implementation.
+ Copyright (C) 2017-2018 Free Software 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,16 +17,17 @@
<http://www.gnu.org/licenses/>. */
#include <unistd.h>
-#include <nacl-interfaces.h>
+#include <sysdep-cancel.h>
/* Read NBYTES into BUF from FD. Return the number read or -1. */
ssize_t
__libc_read (int fd, void *buf, size_t nbytes)
{
- size_t nread;
- return NACL_CALL (__nacl_irt_fdio.read (fd, buf, nbytes, &nread), nread);
+ return SYSCALL_CANCEL (read, fd, buf, nbytes);
}
libc_hidden_def (__libc_read)
+
+libc_hidden_def (__read)
weak_alias (__libc_read, __read)
-libc_hidden_weak (__read)
+libc_hidden_def (read)
weak_alias (__libc_read, read)
diff --git a/sysdeps/unix/sysv/linux/read_nocancel.c b/sysdeps/unix/sysv/linux/read_nocancel.c
new file mode 100644
index 0000000000..24699e3e21
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/read_nocancel.c
@@ -0,0 +1,28 @@
+/* Linux read syscall implementation -- non-cancellable.
+ Copyright (C) 2018 Free Software 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 <sysdep-cancel.h>
+#include <not-cancel.h>
+
+ssize_t
+__read_nocancel (int fd, void *buf, size_t nbytes)
+{
+ return INLINE_SYSCALL_CALL (read, fd, buf, nbytes);
+}
+hidden_def (__read_nocancel)
diff --git a/sysdeps/unix/sysv/linux/readahead.c b/sysdeps/unix/sysv/linux/readahead.c
index 92e54283f9..f84d210f34 100644
--- a/sysdeps/unix/sysv/linux/readahead.c
+++ b/sysdeps/unix/sysv/linux/readahead.c
@@ -1,5 +1,5 @@
/* Provide kernel hint to read ahead.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software 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,31 +16,15 @@
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 <errno.h>
#include <sysdep.h>
-#include <sys/syscall.h>
-
-
-#ifdef __NR_readahead
ssize_t
__readahead (int fd, off64_t offset, size_t count)
{
- return INLINE_SYSCALL (readahead, 4, fd,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)),
- count);
+ return INLINE_SYSCALL_CALL (readahead, fd,
+ __ALIGNMENT_ARG SYSCALL_LL64 (offset),
+ count);
}
-#else
-ssize_t
-__readahead (int fd, off64_t offset, size_t count)
-{
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-}
-stub_warning (readahead)
-#endif
-
weak_alias (__readahead, readahead)
diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
new file mode 100644
index 0000000000..b99bc96aad
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/readdir.c
@@ -0,0 +1,23 @@
+/* Read a directory. Linux no-LFS version.
+ Copyright (C) 2018 Free Software 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 <dirent.h>
+
+#if !_DIRENT_MATCHES_DIRENT64
+# include <sysdeps/posix/readdir.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
index 224f53db88..8f9308b651 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
@@ -1,7 +1,55 @@
-#define __READDIR __readdir64
-#define __GETDENTS __getdents64
+/* Read a directory. Linux LFS version.
+ Copyright (C) 1997-2018 Free Software 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/>. */
+
+/* When _DIRENT_MATCHES_DIRENT64 is defined we can alias 'readdir64' to
+ 'readdir'. However the function signatures are not equal due
+ different return types, so we need to suppress {__}readdir so weak
+ and strong alias do not throw conflicting types errors. */
+#define readdir __no_readdir_decl
+#define __readdir __no___readdir_decl
+#include <dirent.h>
+
+#define __READDIR __readdir64
+#define __GETDENTS __getdents64
#define DIRENT_TYPE struct dirent64
#include <sysdeps/posix/readdir.c>
+#undef __readdir
+#undef readdir
+
+libc_hidden_def (__readdir64)
+#if _DIRENT_MATCHES_DIRENT64
+strong_alias (__readdir64, __readdir)
weak_alias (__readdir64, readdir64)
+weak_alias (__readdir64, readdir)
+#else
+/* The compat code expects the 'struct direct' with d_ino being a __ino_t
+ instead of __ino64_t. */
+# include <shlib-compat.h>
+versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
+# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+# include <olddirent.h>
+# define __READDIR attribute_compat_text_section __old_readdir64
+# define __GETDENTS __old_getdents64
+# define DIRENT_TYPE struct __old_dirent64
+# include <sysdeps/posix/readdir.c>
+libc_hidden_def (__old_readdir64)
+compat_symbol (libc, __old_readdir64, readdir64, GLIBC_2_1);
+# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */
+#endif /* _DIRENT_MATCHES_DIRENT64 */
diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c
index 3dfbf4fd2c..ae3033ca06 100644
--- a/sysdeps/unix/sysv/linux/readdir64_r.c
+++ b/sysdeps/unix/sysv/linux/readdir64_r.c
@@ -1,7 +1,53 @@
+/* Read a directory in reentrant mode. Linux LFS version.
+ Copyright (C) 1997-2018 Free Software 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/>. */
+
+/* When _DIRENT_MATCHES_DIRENT64 is defined we can alias 'readdir64' to
+ 'readdir'. However the function signatures are not equal due
+ different return types, so we need to suppress {__}readdir so weak
+ and strong alias do not throw conflicting types errors. */
+#define readdir_r __no_readdir_r_decl
+#define __readdir_r __no___readdir_r_decl
+#include <dirent.h>
+
#define __READDIR_R __readdir64_r
-#define __GETDENTS __getdents64
+#define __GETDENTS __getdents64
#define DIRENT_TYPE struct dirent64
#include <sysdeps/posix/readdir_r.c>
+#undef __readdir_r
+#undef readdir_r
+
+#if _DIRENT_MATCHES_DIRENT64
+strong_alias (__readdir64_r, __readdir_r)
+weak_alias (__readdir64_r, readdir_r)
weak_alias (__readdir64_r, readdir64_r)
+#else
+/* The compat code expects the 'struct direct' with d_ino being a __ino_t
+ instead of __ino64_t. */
+# include <shlib-compat.h>
+versioned_symbol (libc, __readdir64_r, readdir64_r, GLIBC_2_2);
+# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+# include <olddirent.h>
+# define __READDIR_R attribute_compat_text_section __old_readdir64_r
+# define __GETDENTS __old_getdents64
+# define DIRENT_TYPE struct __old_dirent64
+# include <sysdeps/posix/readdir_r.c>
+compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
+# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */
+#endif /* _DIRENT_MATCHES_DIRENT64 */
diff --git a/sysdeps/unix/sysv/linux/readdir_r.c b/sysdeps/unix/sysv/linux/readdir_r.c
new file mode 100644
index 0000000000..7ca9e8e290
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/readdir_r.c
@@ -0,0 +1,23 @@
+/* Read a directory in reentrant mode. Linux no-LFS version.
+ Copyright (C) 2018 Free Software 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 <dirent.h>
+
+#if !_DIRENT_MATCHES_DIRENT64
+# include <sysdeps/posix/readdir_r.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/readonly-area.c b/sysdeps/unix/sysv/linux/readonly-area.c
index e4321e069e..5546bf7e82 100644
--- a/sysdeps/unix/sysv/linux/readonly-area.c
+++ b/sysdeps/unix/sysv/linux/readonly-area.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,7 +53,7 @@ __readonly_area (const char *ptr, size_t size)
char *line = NULL;
size_t linelen = 0;
- while (! feof_unlocked (fp))
+ while (! __feof_unlocked (fp))
{
if (_IO_getdelim (&line, &linelen, '\n', fp) <= 0)
break;
diff --git a/sysdeps/unix/sysv/linux/readv.c b/sysdeps/unix/sysv/linux/readv.c
new file mode 100644
index 0000000000..d27f258e9d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/readv.c
@@ -0,0 +1,29 @@
+/* Linux implementation for readv syscall.
+ Copyright (C) 2017-2018 Free Software 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 <sys/uio.h>
+#include <sysdep-cancel.h>
+
+ssize_t
+__readv (int fd, const struct iovec *iov, int iovcnt)
+{
+ return SYSCALL_CANCEL (readv, fd, iov, iovcnt);
+}
+libc_hidden_def (__readv)
+weak_alias (__readv, readv)
diff --git a/sysdeps/unix/sysv/linux/reboot.c b/sysdeps/unix/sysv/linux/reboot.c
index b231f6161d..050334ab52 100644
--- a/sysdeps/unix/sysv/linux/reboot.c
+++ b/sysdeps/unix/sysv/linux/reboot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/recv.c b/sysdeps/unix/sysv/linux/recv.c
index 250159fa6a..42158060aa 100644
--- a/sysdeps/unix/sysv/linux/recv.c
+++ b/sysdeps/unix/sysv/linux/recv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software 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,21 +15,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
#include <sys/socket.h>
-
#include <sysdep-cancel.h>
#include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
ssize_t
__libc_recv (int fd, void *buf, size_t len, int flags)
{
#ifdef __ASSUME_RECV_SYSCALL
return SYSCALL_CANCEL (recv, fd, buf, len, flags);
-#elif defined __ASSUME_RECVFROM_FOR_RECV_SYSCALL
+#elif defined __ASSUME_RECVFROM_SYSCALL
return SYSCALL_CANCEL (recvfrom, fd, buf, len, flags, NULL, NULL);
#else
return SOCKETCALL_CANCEL (recv, fd, buf, len, flags);
diff --git a/sysdeps/unix/sysv/linux/recvfrom.c b/sysdeps/unix/sysv/linux/recvfrom.c
index df4fecddf4..dcc170ace3 100644
--- a/sysdeps/unix/sysv/linux/recvfrom.c
+++ b/sysdeps/unix/sysv/linux/recvfrom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software 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,14 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
#include <sys/socket.h>
-
#include <sysdep-cancel.h>
#include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
ssize_t
__libc_recvfrom (int fd, void *buf, size_t len, int flags,
diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c
index bf18260b46..76d2c69fec 100644
--- a/sysdeps/unix/sysv/linux/recvmmsg.c
+++ b/sysdeps/unix/sysv/linux/recvmmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@redhat.com>, 2010.
@@ -21,73 +21,16 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
+#include <socketcall.h>
#include <kernel-features.h>
-/* Do not use the recvmmsg syscall on socketcall architectures unless
- it was added at the same time as the socketcall support or can be
- assumed to be present. */
-#if defined __ASSUME_SOCKETCALL \
- && !defined __ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL \
- && !defined __ASSUME_RECVMMSG_SYSCALL
-# undef __NR_recvmmsg
-#endif
-
-#ifdef __NR_recvmmsg
int
recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
struct timespec *tmo)
{
+#ifdef __ASSUME_RECVMMSG_SYSCALL
return SYSCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, tmo);
-}
-#elif defined __NR_socketcall
-# include <socketcall.h>
-# ifdef __ASSUME_RECVMMSG_SOCKETCALL
-int
-recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
- struct timespec *tmo)
-{
- return SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, tmo);
-}
-# else
-static int have_recvmmsg;
-
-int
-recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
- struct timespec *tmo)
-{
- if (__glibc_likely (have_recvmmsg >= 0))
- {
- int ret = SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags,
- tmo);
- /* The kernel returns -EINVAL for unknown socket operations.
- We need to convert that error to an ENOSYS error. */
- if (__builtin_expect (ret < 0, 0)
- && have_recvmmsg == 0
- && errno == EINVAL)
- {
- /* Try another call, this time with an invalid file
- descriptor and all other parameters cleared. This call
- will not cause any harm and it will return
- immediately. */
- ret = SOCKETCALL_CANCEL (invalid, -1);
- if (errno == EINVAL)
- {
- have_recvmmsg = -1;
- __set_errno (ENOSYS);
- }
- else
- {
- have_recvmmsg = 1;
- __set_errno (EINVAL);
- }
- return -1;
- }
- return ret;
- }
- __set_errno (ENOSYS);
- return -1;
-}
-# endif /* __ASSUME_RECVMMSG_SOCKETCALL */
#else
-# include <socket/recvmmsg.c>
+ return SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, tmo);
#endif
+}
diff --git a/sysdeps/unix/sysv/linux/recvmsg.c b/sysdeps/unix/sysv/linux/recvmsg.c
index 4caf22e8bf..7806127daf 100644
--- a/sysdeps/unix/sysv/linux/recvmsg.c
+++ b/sysdeps/unix/sysv/linux/recvmsg.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Linux recvmsg syscall wrapper.
+ Copyright (C) 2016-2018 Free Software 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,23 +16,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
#include <sys/socket.h>
-
#include <sysdep-cancel.h>
#include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
+#include <shlib-compat.h>
ssize_t
__libc_recvmsg (int fd, struct msghdr *msg, int flags)
{
-#ifdef __ASSUME_RECVMSG_SYSCALL
+# ifdef __ASSUME_RECVMSG_SYSCALL
return SYSCALL_CANCEL (recvmsg, fd, msg, flags);
-#else
+# else
return SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
-#endif
+# endif
}
weak_alias (__libc_recvmsg, recvmsg)
weak_alias (__libc_recvmsg, __recvmsg)
diff --git a/sysdeps/unix/sysv/linux/rename.c b/sysdeps/unix/sysv/linux/rename.c
new file mode 100644
index 0000000000..962c9f079a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/rename.c
@@ -0,0 +1,35 @@
+/* Linux implementation for rename function.
+ Copyright (C) 2016-2018 Free Software 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 <fcntl.h>
+#include <sysdep.h>
+#include <errno.h>
+
+/* Rename the file OLD to NEW. */
+int
+rename (const char *old, const char *new)
+{
+#if defined (__NR_rename)
+ return INLINE_SYSCALL_CALL (rename, old, new);
+#elif defined (__NR_renameat)
+ return INLINE_SYSCALL_CALL (renameat, AT_FDCWD, old, AT_FDCWD, new);
+#else
+ return INLINE_SYSCALL_CALL (renameat2, AT_FDCWD, old, AT_FDCWD, new, 0);
+#endif
+}
diff --git a/sysdeps/unix/sysv/linux/renameat.c b/sysdeps/unix/sysv/linux/renameat.c
new file mode 100644
index 0000000000..f85c5ae0ec
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/renameat.c
@@ -0,0 +1,34 @@
+/* Linux implementation for renameat function.
+ Copyright (C) 2016-2018 Free Software 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 <fcntl.h>
+#include <sysdep.h>
+#include <errno.h>
+
+int
+__renameat (int oldfd, const char *old, int newfd, const char *new)
+{
+#ifdef __NR_renameat
+ return INLINE_SYSCALL_CALL (renameat, oldfd, old, newfd, new);
+#else
+ return INLINE_SYSCALL_CALL (renameat2, oldfd, old, newfd, new, 0);
+#endif
+}
+libc_hidden_def (__renameat)
+weak_alias (__renameat, renameat)
diff --git a/sysdeps/unix/sysv/linux/renameat2.c b/sysdeps/unix/sysv/linux/renameat2.c
new file mode 100644
index 0000000000..919bb2a0d4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/renameat2.c
@@ -0,0 +1,44 @@
+/* Linux implementation for renameat2 function.
+ Copyright (C) 2018 Free Software 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 <stdio.h>
+#include <sysdep.h>
+
+int
+renameat2 (int oldfd, const char *old, int newfd, const char *new,
+ unsigned int flags)
+{
+#if !defined (__NR_renameat) || defined (__ASSUME_RENAMEAT2)
+ return INLINE_SYSCALL_CALL (renameat2, oldfd, old, newfd, new, flags);
+#else
+ if (flags == 0)
+ return __renameat (oldfd, old, newfd, new);
+# ifdef __NR_renameat2
+ /* For non-zero flags, try the renameat2 system call. */
+ int ret = INLINE_SYSCALL_CALL (renameat2, oldfd, old, newfd, new, flags);
+ if (ret != -1 || errno != ENOSYS)
+ /* Preserve non-error/non-ENOSYS return values. */
+ return ret;
+# endif
+ /* No kernel (header) support for renameat2. All flags are
+ unknown. */
+ __set_errno (EINVAL);
+ return -1;
+#endif
+}
diff --git a/sysdeps/unix/sysv/linux/riscv/Implies b/sysdeps/unix/sysv/linux/riscv/Implies
new file mode 100644
index 0000000000..6faec70115
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/Implies
@@ -0,0 +1 @@
+riscv/nptl
diff --git a/sysdeps/unix/sysv/linux/riscv/Makefile b/sysdeps/unix/sysv/linux/riscv/Makefile
new file mode 100644
index 0000000000..b47858769f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/Makefile
@@ -0,0 +1,25 @@
+ifeq ($(subdir),elf)
+sysdep_routines += dl-vdso
+ifeq ($(build-shared),yes)
+# This is needed for DSO loading from static binaries.
+sysdep-dl-routines += dl-static
+endif
+endif
+
+ifeq ($(subdir),misc)
+sysdep_headers += sys/cachectl.h
+sysdep_routines += flush-icache
+endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
+
+abi-variants := lp64 lp64d
+
+ifeq (,$(filter $(default-abi),$(abi-variants)))
+$(error Unknown ABI $(default-abi), must be one of $(abi-variants))
+endif
+
+abi-lp64-condition := defined __LP64__ && defined __riscv_float_abi_soft
+abi-lp64d-condition := defined __LP64__ && defined __riscv_float_abi_double
diff --git a/sysdeps/unix/sysv/linux/riscv/Versions b/sysdeps/unix/sysv/linux/riscv/Versions
new file mode 100644
index 0000000000..5625d2a0b8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/Versions
@@ -0,0 +1,11 @@
+ld {
+ GLIBC_PRIVATE {
+ # used for loading by static libraries
+ _dl_var_init;
+ }
+}
+libc {
+ GLIBC_2.27 {
+ __riscv_flush_icache;
+ }
+}
diff --git a/sysdeps/unix/sysv/linux/riscv/atomic-machine.h b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h
new file mode 100644
index 0000000000..3d967d3b08
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h
@@ -0,0 +1,194 @@
+/* Low-level functions for atomic operations. RISC-V version.
+ Copyright (C) 2014-2018 Free Software 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 _LINUX_RISCV_BITS_ATOMIC_H
+#define _LINUX_RISCV_BITS_ATOMIC_H 1
+
+#include <stdint.h>
+
+typedef int32_t atomic32_t;
+typedef uint32_t uatomic32_t;
+
+typedef int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+#define atomic_full_barrier() __sync_synchronize ()
+
+#ifdef __riscv_atomic
+
+# define __HAVE_64B_ATOMICS (__riscv_xlen >= 64)
+# define USE_ATOMIC_COMPILER_BUILTINS 1
+# define ATOMIC_EXCHANGE_USES_CAS 0
+
+/* Compare and exchange.
+ For all "bool" routines, we return FALSE if exchange succesful. */
+
+# define __arch_compare_and_exchange_bool_8_int(mem, newval, oldval, model) \
+ ({ \
+ typeof (*mem) __oldval = (oldval); \
+ !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \
+ model, __ATOMIC_RELAXED); \
+ })
+
+# define __arch_compare_and_exchange_bool_16_int(mem, newval, oldval, model) \
+ ({ \
+ typeof (*mem) __oldval = (oldval); \
+ !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \
+ model, __ATOMIC_RELAXED); \
+ })
+
+# define __arch_compare_and_exchange_bool_32_int(mem, newval, oldval, model) \
+ ({ \
+ typeof (*mem) __oldval = (oldval); \
+ !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \
+ model, __ATOMIC_RELAXED); \
+ })
+
+# define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \
+ ({ \
+ typeof (*mem) __oldval = (oldval); \
+ !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \
+ model, __ATOMIC_RELAXED); \
+ })
+
+# define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model) \
+ ({ \
+ typeof (*mem) __oldval = (oldval); \
+ __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \
+ model, __ATOMIC_RELAXED); \
+ __oldval; \
+ })
+
+# define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model) \
+ ({ \
+ typeof (*mem) __oldval = (oldval); \
+ __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \
+ model, __ATOMIC_RELAXED); \
+ __oldval; \
+ })
+
+# define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model) \
+ ({ \
+ typeof (*mem) __oldval = (oldval); \
+ __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \
+ model, __ATOMIC_RELAXED); \
+ __oldval; \
+ })
+
+# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \
+ ({ \
+ typeof (*mem) __oldval = (oldval); \
+ __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \
+ model, __ATOMIC_RELAXED); \
+ __oldval; \
+ })
+
+/* Atomic compare and exchange. */
+
+# define atomic_compare_and_exchange_bool_acq(mem, new, old) \
+ __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
+ mem, new, old, __ATOMIC_ACQUIRE)
+
+# define atomic_compare_and_exchange_val_acq(mem, new, old) \
+ __atomic_val_bysize (__arch_compare_and_exchange_val, int, \
+ mem, new, old, __ATOMIC_ACQUIRE)
+
+# define atomic_compare_and_exchange_val_rel(mem, new, old) \
+ __atomic_val_bysize (__arch_compare_and_exchange_val, int, \
+ mem, new, old, __ATOMIC_RELEASE)
+
+/* Atomic exchange (without compare). */
+
+# define __arch_exchange_8_int(mem, newval, model) \
+ __atomic_exchange_n (mem, newval, model)
+
+# define __arch_exchange_16_int(mem, newval, model) \
+ __atomic_exchange_n (mem, newval, model)
+
+# define __arch_exchange_32_int(mem, newval, model) \
+ __atomic_exchange_n (mem, newval, model)
+
+# define __arch_exchange_64_int(mem, newval, model) \
+ __atomic_exchange_n (mem, newval, model)
+
+# define atomic_exchange_acq(mem, value) \
+ __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_ACQUIRE)
+
+# define atomic_exchange_rel(mem, value) \
+ __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_RELEASE)
+
+/* Atomically add value and return the previous (unincremented) value. */
+
+# define __arch_exchange_and_add_8_int(mem, value, model) \
+ __atomic_fetch_add (mem, value, model)
+
+# define __arch_exchange_and_add_16_int(mem, value, model) \
+ __atomic_fetch_add (mem, value, model)
+
+# define __arch_exchange_and_add_32_int(mem, value, model) \
+ __atomic_fetch_add (mem, value, model)
+
+# define __arch_exchange_and_add_64_int(mem, value, model) \
+ __atomic_fetch_add (mem, value, model)
+
+# define atomic_exchange_and_add_acq(mem, value) \
+ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
+ __ATOMIC_ACQUIRE)
+
+# define atomic_exchange_and_add_rel(mem, value) \
+ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
+ __ATOMIC_RELEASE)
+
+/* Miscellaneous. */
+
+# define asm_amo(which, ordering, mem, value) ({ \
+ __atomic_check_size (mem); \
+ typeof (*mem) __tmp; \
+ if (sizeof (__tmp) == 4) \
+ asm volatile (which ".w" ordering "\t%0, %z2, %1" \
+ : "=r" (__tmp), "+A" (* (mem)) \
+ : "rJ" (value)); \
+ else if (sizeof (__tmp) == 8) \
+ asm volatile (which ".d" ordering "\t%0, %z2, %1" \
+ : "=r" (__tmp), "+A" (* (mem)) \
+ : "rJ" (value)); \
+ else \
+ abort (); \
+ __tmp; })
+
+# define atomic_max(mem, value) asm_amo ("amomaxu", ".aq", mem, value)
+# define atomic_min(mem, value) asm_amo ("amominu", ".aq", mem, value)
+
+# define atomic_bit_test_set(mem, bit) \
+ ({ typeof (*mem) __mask = (typeof (*mem))1 << (bit); \
+ asm_amo ("amoor", ".aq", mem, __mask) & __mask; })
+
+# define catomic_exchange_and_add(mem, value) \
+ atomic_exchange_and_add (mem, value)
+# define catomic_max(mem, value) atomic_max (mem, value)
+
+#else /* __riscv_atomic */
+# error "ISAs that do not subsume the A extension are not supported"
+#endif /* !__riscv_atomic */
+
+#endif /* bits/atomic.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/bits/fcntl.h b/sysdeps/unix/sysv/linux/riscv/bits/fcntl.h
new file mode 100644
index 0000000000..6bea085c70
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/bits/fcntl.h
@@ -0,0 +1,62 @@
+/* O_*, F_*, FD_* bit values for Linux / RISC-V.
+ Copyright (C) 2011-2018 Free Software 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 _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+/* In 64-bit ISA files are always with 64bit off_t and F_*LK64 are the same as
+ non-64-bit versions. It will need to be revised for 128-bit. */
+#if __WORDSIZE == 64
+# define __O_LARGEFILE 0
+
+# define F_GETLK64 5 /* Get record locking info. */
+# define F_SETLK64 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW64 7 /* Set record locking info (blocking). */
+#endif
+
+struct flock
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+#else
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+#endif
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+#endif
+
+/* Include generic Linux declarations. */
+#include <bits/fcntl-linux.h>
diff --git a/sysdeps/unix/sysv/linux/riscv/bits/mman.h b/sysdeps/unix/sysv/linux/riscv/bits/mman.h
new file mode 100644
index 0000000000..c01fb00728
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/bits/mman.h
@@ -0,0 +1,40 @@
+/* Definitions for POSIX memory map interface. Linux/RISC-V version.
+ Copyright (C) 1997-2018 Free Software 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 _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
+# define MAP_DENYWRITE 0x00800 /* ETXTBSY. */
+# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
+# define MAP_LOCKED 0x02000 /* Lock the mapping. */
+# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
+# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
+# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
+# define MAP_STACK 0x20000 /* Allocation is for a stack. */
+# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_SYNC 0x80000 /* Perform synchronous page
+ faults for the mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
+#endif
+
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h b/sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h
new file mode 100644
index 0000000000..9b896a6262
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h
@@ -0,0 +1,32 @@
+/* Machine-dependent signal context structure for Linux. RISC-V version.
+ Copyright (C) 1996-2018 Free Software
+ 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 _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
+
+struct sigcontext {
+ /* gregs[0] holds the program counter. */
+ unsigned long int gregs[32];
+ unsigned long long int fpregs[66] __attribute__ ((__aligned__ (16)));
+};
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/riscv/clone.S b/sysdeps/unix/sysv/linux/riscv/clone.S
new file mode 100644
index 0000000000..392af72b55
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/clone.S
@@ -0,0 +1,86 @@
+/* Wrapper around clone system call. RISC-V version.
+ Copyright (C) 1996-2018 Free Software 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/>. */
+
+/* clone() is even more special than fork() as it mucks with stacks
+ and invokes a function in the right context after its all over. */
+
+#include <sys/asm.h>
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+#include <tls.h>
+#include "tcb-offsets.h"
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
+ void *parent_tidptr, void *tls, void *child_tidptr) */
+
+ .text
+LEAF (__clone)
+
+ /* Sanity check arguments. */
+ beqz a0,L (invalid) /* No NULL function pointers. */
+ beqz a1,L (invalid) /* No NULL stack pointers. */
+
+ addi a1,a1,-16 /* Reserve argument save space. */
+ REG_S a0,0(a1) /* Save function pointer. */
+ REG_S a3,SZREG(a1) /* Save argument pointer. */
+
+ /* The syscall expects the args to be in different slots. */
+ mv a0,a2
+ mv a2,a4
+ mv a3,a5
+ mv a4,a6
+
+ /* Do the system call. */
+ li a7,__NR_clone
+ scall
+
+ bltz a0,L (error)
+ beqz a0,L (thread_start)
+
+ /* Successful return from the parent. */
+ ret
+
+L (invalid):
+ li a0, -EINVAL
+ /* Something bad happened -- no child created. */
+L (error):
+ j __syscall_error
+ END (__clone)
+
+/* Load up the arguments to the function. Put this block of code in
+ its own function so that we can terminate the stack trace with our
+ debug info. */
+
+ENTRY (__thread_start)
+L (thread_start):
+ /* Restore the arg for user's function. */
+ REG_L a1,0(sp) /* Function pointer. */
+ REG_L a0,SZREG(sp) /* Argument pointer. */
+
+ /* Call the user's function. */
+ jalr a1
+
+ /* Call exit with the function's return value. */
+ li a7, __NR_exit
+ scall
+
+ END (__thread_start)
+
+libc_hidden_def (__clone)
+weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/riscv/configure b/sysdeps/unix/sysv/linux/riscv/configure
new file mode 100755
index 0000000000..816e9145eb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/configure
@@ -0,0 +1,219 @@
+# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/unix/sysv/linux/riscv.
+
+arch_minimum_kernel=4.15.0
+
+libc_cv_riscv_int_abi=no
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+__SIZEOF_INT__ __SIZEOF_LONG__ __SIZEOF_POINTER__
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "4 8 8" >/dev/null 2>&1; then :
+ libc_cv_riscv_int_abi=lp64
+fi
+rm -f conftest*
+
+if test $libc_cv_riscv_int_abi = no; then
+ as_fn_error $? "Unable to determine integer ABI" "$LINENO" 5
+fi
+
+libc_cv_riscv_float_abi=no
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __riscv_float_abi_double
+ yes
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ libc_cv_riscv_float_abi=d
+fi
+rm -f conftest*
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __riscv_float_abi_soft
+ yes
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ libc_cv_riscv_float_abi=
+fi
+rm -f conftest*
+
+if test $libc_cv_riscv_float_abi = no; then
+ as_fn_error $? "Unable to determine floating-point ABI" "$LINENO" 5
+fi
+
+config_vars="$config_vars
+default-abi = $libc_cv_riscv_int_abi$libc_cv_riscv_float_abi"
+
+case $libc_cv_riscv_int_abi$libc_cv_riscv_float_abi-$machine in
+lp64-riscv/rv64/*)
+ test -n "$libc_cv_slibdir" ||
+case "$prefix" in
+/usr | /usr/)
+ libc_cv_slibdir='/lib64/lp64'
+ libc_cv_rtlddir='/lib'
+ if test "$libdir" = '${exec_prefix}/lib'; then
+ libdir='${exec_prefix}/lib64/lp64';
+ # Locale data can be shared between 32-bit and 64-bit libraries.
+ libc_cv_complocaledir='${exec_prefix}/lib/locale'
+ fi
+ ;;
+esac
+ ;;
+lp64d-riscv/rv64/*)
+ test -n "$libc_cv_slibdir" ||
+case "$prefix" in
+/usr | /usr/)
+ libc_cv_slibdir='/lib64/lp64d'
+ libc_cv_rtlddir='/lib'
+ if test "$libdir" = '${exec_prefix}/lib'; then
+ libdir='${exec_prefix}/lib64/lp64d';
+ # Locale data can be shared between 32-bit and 64-bit libraries.
+ libc_cv_complocaledir='${exec_prefix}/lib/locale'
+ fi
+ ;;
+esac
+ ;;
+esac
+
+ldd_rewrite_script=sysdeps/unix/sysv/linux/riscv/ldd-rewrite.sed
diff --git a/sysdeps/unix/sysv/linux/riscv/configure.ac b/sysdeps/unix/sysv/linux/riscv/configure.ac
new file mode 100644
index 0000000000..4fae013ec9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/configure.ac
@@ -0,0 +1,38 @@
+sinclude(./aclocal.m4)dnl Autoconf lossage
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/sysv/linux/riscv.
+
+arch_minimum_kernel=4.15.0
+
+libc_cv_riscv_int_abi=no
+AC_EGREP_CPP(4 8 8, [__SIZEOF_INT__ __SIZEOF_LONG__ __SIZEOF_POINTER__
+ ], libc_cv_riscv_int_abi=lp64)
+if test $libc_cv_riscv_int_abi = no; then
+ AC_MSG_ERROR([Unable to determine integer ABI])
+fi
+
+libc_cv_riscv_float_abi=no
+AC_EGREP_CPP(yes, [#ifdef __riscv_float_abi_double
+ yes
+ #endif
+ ],libc_cv_riscv_float_abi=d)
+AC_EGREP_CPP(yes, [#ifdef __riscv_float_abi_soft
+ yes
+ #endif
+ ],libc_cv_riscv_float_abi=)
+if test $libc_cv_riscv_float_abi = no; then
+ AC_MSG_ERROR([Unable to determine floating-point ABI])
+fi
+
+LIBC_CONFIG_VAR([default-abi], [$libc_cv_riscv_int_abi$libc_cv_riscv_float_abi])
+
+case $libc_cv_riscv_int_abi$libc_cv_riscv_float_abi-$machine in
+lp64-riscv/rv64/*)
+ LIBC_SLIBDIR_RTLDDIR([lib64/lp64], [lib])
+ ;;
+lp64d-riscv/rv64/*)
+ LIBC_SLIBDIR_RTLDDIR([lib64/lp64d], [lib])
+ ;;
+esac
+
+ldd_rewrite_script=sysdeps/unix/sysv/linux/riscv/ldd-rewrite.sed
diff --git a/sysdeps/unix/sysv/linux/riscv/dl-cache.h b/sysdeps/unix/sysv/linux/riscv/dl-cache.h
new file mode 100644
index 0000000000..cbd6ef5e09
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/dl-cache.h
@@ -0,0 +1,75 @@
+/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
+ Copyright (C) 2003-2018 Free Software 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 <ldconfig.h>
+
+/* For now we only support the natural XLEN ABI length on all targets, so the
+ only bits that need to go into ld.so.cache are the FLEG ABI length. */
+#if defined __riscv_float_abi_double
+# define _DL_CACHE_DEFAULT_ID (FLAG_RISCV_FLOAT_ABI_DOUBLE | FLAG_ELF_LIBC6)
+#else
+# define _DL_CACHE_DEFAULT_ID (FLAG_RISCV_FLOAT_ABI_SOFT | FLAG_ELF_LIBC6)
+#endif
+
+#define _dl_cache_check_flags(flags) \
+ ((flags) == _DL_CACHE_DEFAULT_ID)
+
+/* If given a path to one of our library directories, adds every library
+ directory via add_dir (), otherwise just adds the giver directory. On
+ RISC-V, libraries can be found in paths ending in:
+ - /lib64/lp64d
+ - /lib64/lp64
+ - /lib (only ld.so)
+ so this will add all of those paths.
+
+ According to Joseph Myers:
+ My reasoning for that would be: generic autoconf-configured (etc.)
+ software may only know about using the lib directory, so you want the
+ lib directory to be searched regardless of the ABI - but it's also
+ useful to be able to e.g. list /usr/local/lib in /etc/ld.so.conf for all
+ architectures and have that automatically imply /usr/local/lib64/lp64d
+ etc. so that libraries can be found that come from software that does
+ use the ABI-specific directories. */
+#define add_system_dir(dir) \
+ do \
+ { \
+ size_t len = strlen (dir); \
+ char path[len + 9]; \
+ memcpy (path, dir, len + 1); \
+ if (len >= 12 && ! memcmp(path + len - 12, "/lib64/lp64d", 12)) \
+ { \
+ len -= 8; \
+ path[len] = '\0'; \
+ } \
+ if (len >= 11 && ! memcmp(path + len - 11, "/lib64/lp64", 11)) \
+ { \
+ len -= 7; \
+ path[len] = '\0'; \
+ } \
+ add_dir (path); \
+ if (len >= 4 && ! memcmp(path + len - 4, "/lib", 4)) \
+ { \
+ memcpy (path + len, "64/lp64d", 9); \
+ add_dir (path); \
+ memcpy (path + len, "64/lp64", 8); \
+ add_dir (path); \
+ } \
+ } while (0)
+
+
+#include_next <dl-cache.h>
diff --git a/sysdeps/unix/sysv/linux/tile/dl-static.c b/sysdeps/unix/sysv/linux/riscv/dl-static.c
index b63e39c1ad..b2fbb171a7 100644
--- a/sysdeps/unix/sysv/linux/tile/dl-static.c
+++ b/sysdeps/unix/sysv/linux/riscv/dl-static.c
@@ -1,5 +1,5 @@
-/* Variable initialization. Tile version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Variable initialization. RISC-V version
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
void
_dl_var_init (void *array[])
{
- /* It has to match "variables" below. */
+ /* It has to match "variables" below. */
enum
{
DL_PAGESIZE = 0
diff --git a/sysdeps/unix/sysv/linux/riscv/flush-icache.c b/sysdeps/unix/sysv/linux/riscv/flush-icache.c
new file mode 100644
index 0000000000..d612ef4c6c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/flush-icache.c
@@ -0,0 +1,73 @@
+/* RISC-V instruction cache flushing VDSO calls
+ Copyright (C) 2017-2018 Free Software 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 <dl-vdso.h>
+#include <stdlib.h>
+#include <atomic.h>
+#include <sys/cachectl.h>
+#include <asm/syscalls.h>
+
+typedef int (*func_type) (void *, void *, unsigned long int);
+
+static int
+__riscv_flush_icache_syscall (void *start, void *end, unsigned long int flags)
+{
+ return INLINE_SYSCALL (riscv_flush_icache, 3, start, end, flags);
+}
+
+static func_type
+__lookup_riscv_flush_icache (void)
+{
+ PREPARE_VERSION_KNOWN (linux_version, LINUX_4_15);
+
+ func_type func = _dl_vdso_vsym ("__vdso_flush_icache", &linux_version);
+
+ /* If there is no vDSO entry then call the system call directly. All Linux
+ versions provide the vDSO entry, but QEMU's user-mode emulation doesn't
+ provide a vDSO. */
+ if (!func)
+ func = &__riscv_flush_icache_syscall;
+
+ return func;
+}
+
+#ifdef SHARED
+
+# define INIT_ARCH()
+libc_ifunc (__riscv_flush_icache, __lookup_riscv_flush_icache ())
+
+#else
+
+int
+__riscv_flush_icache (void *start, void *end, unsigned long int flags)
+{
+ static volatile func_type cached_func;
+
+ func_type func = atomic_load_relaxed (&cached_func);
+
+ if (!func)
+ {
+ func = __lookup_riscv_flush_icache ();
+ atomic_store_relaxed (&cached_func, func);
+ }
+
+ return func (start, end, flags);
+}
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/riscv/getcontext.S b/sysdeps/unix/sysv/linux/riscv/getcontext.S
new file mode 100644
index 0000000000..bde350f721
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/getcontext.S
@@ -0,0 +1,77 @@
+/* Save current context.
+ Copyright (C) 2009-2018 Free Software 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 "ucontext-macros.h"
+
+/* int getcontext (ucontext_t *ucp) */
+
+ .text
+LEAF (__getcontext)
+ SAVE_INT_REG (ra, 0, a0)
+ SAVE_INT_REG (ra, 1, a0)
+ SAVE_INT_REG (sp, 2, a0)
+ SAVE_INT_REG (s0, 8, a0)
+ SAVE_INT_REG (s1, 9, a0)
+ SAVE_INT_REG (x0, 10, a0) /* return 0 by overwriting a0. */
+ SAVE_INT_REG (s2, 18, a0)
+ SAVE_INT_REG (s3, 19, a0)
+ SAVE_INT_REG (s4, 20, a0)
+ SAVE_INT_REG (s5, 21, a0)
+ SAVE_INT_REG (s6, 22, a0)
+ SAVE_INT_REG (s7, 23, a0)
+ SAVE_INT_REG (s8, 24, a0)
+ SAVE_INT_REG (s9, 25, a0)
+ SAVE_INT_REG (s10, 26, a0)
+ SAVE_INT_REG (s11, 27, a0)
+
+#ifndef __riscv_float_abi_soft
+ frsr a1
+
+ SAVE_FP_REG (fs0, 8, a0)
+ SAVE_FP_REG (fs1, 9, a0)
+ SAVE_FP_REG (fs2, 18, a0)
+ SAVE_FP_REG (fs3, 19, a0)
+ SAVE_FP_REG (fs4, 20, a0)
+ SAVE_FP_REG (fs5, 21, a0)
+ SAVE_FP_REG (fs6, 22, a0)
+ SAVE_FP_REG (fs7, 23, a0)
+ SAVE_FP_REG (fs8, 24, a0)
+ SAVE_FP_REG (fs9, 25, a0)
+ SAVE_FP_REG (fs10, 26, a0)
+ SAVE_FP_REG (fs11, 27, a0)
+
+ sw a1, MCONTEXT_FSR(a0)
+#endif /* __riscv_float_abi_soft */
+
+/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
+ li a3, _NSIG8
+ add a2, a0, UCONTEXT_SIGMASK
+ mv a1, zero
+ li a0, SIG_BLOCK
+
+ li a7, SYS_ify (rt_sigprocmask)
+ scall
+ bltz a0, 99f
+
+ ret
+
+99: j __syscall_error
+
+PSEUDO_END (__getcontext)
+
+weak_alias (__getcontext, getcontext)
diff --git a/sysdeps/unix/sysv/linux/riscv/init-first.c b/sysdeps/unix/sysv/linux/riscv/init-first.c
new file mode 100644
index 0000000000..56abe51d96
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/init-first.c
@@ -0,0 +1,58 @@
+/* RISC-V VDSO initialization
+ Copyright (C) 2017-2018 Free Software 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 SHARED
+# include <dl-vdso.h>
+# include <libc-vdso.h>
+
+long int (*VDSO_SYMBOL (getcpu)) (unsigned int *, unsigned int *, void *)
+ attribute_hidden;
+long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
+ attribute_hidden;
+long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
+ attribute_hidden;
+long int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
+ attribute_hidden;
+
+static inline void
+_libc_vdso_platform_setup (void)
+{
+ PREPARE_VERSION_KNOWN (linux_version, LINUX_4_15);
+
+ void *p = _dl_vdso_vsym ("__vdso_getcpu", &linux_version);
+ PTR_MANGLE (p);
+ VDSO_SYMBOL (getcpu) = p;
+
+ p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux_version);
+ PTR_MANGLE (p);
+ VDSO_SYMBOL (gettimeofday) = p;
+
+ p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux_version);
+ PTR_MANGLE (p);
+ VDSO_SYMBOL (clock_gettime) = p;
+
+ p = _dl_vdso_vsym ("__vdso_clock_getres", &linux_version);
+ PTR_MANGLE (p);
+ VDSO_SYMBOL (clock_getres) = p;
+}
+
+# define VDSO_SETUP _libc_vdso_platform_setup
+#endif
+
+#include <csu/init-first.c>
diff --git a/sysdeps/unix/sysv/linux/riscv/ipc_priv.h b/sysdeps/unix/sysv/linux/riscv/ipc_priv.h
new file mode 100644
index 0000000000..937f06adfb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/ipc_priv.h
@@ -0,0 +1,21 @@
+/* Old SysV permission definition for Linux. RISC-V version.
+ Copyright (C) 2018 Free Software 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/ipc.h> /* For __key_t */
+
+#define __IPC_64 0x0
diff --git a/sysdeps/unix/sysv/linux/riscv/kernel-features.h b/sysdeps/unix/sysv/linux/riscv/kernel-features.h
new file mode 100644
index 0000000000..37f4d99a92
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/kernel-features.h
@@ -0,0 +1,23 @@
+/* Set flags signalling availability of kernel features based on given
+ kernel version number. RISC-V version.
+ Copyright (C) 2018 Free Software 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_next <kernel-features.h>
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
diff --git a/sysdeps/unix/sysv/linux/riscv/ldconfig.h b/sysdeps/unix/sysv/linux/riscv/ldconfig.h
new file mode 100644
index 0000000000..0ca798a870
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/ldconfig.h
@@ -0,0 +1,36 @@
+/* ldconfig default paths and libraries. Linux/RISC-V version.
+ Copyright (C) 2001-2018 Free Software 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 <sysdeps/generic/ldconfig.h>
+
+#define LD_SO_PREFIX "/lib/ld-linux-"
+#define LD_SO_SUFFIX ".so.1"
+
+#if __riscv_xlen == 64
+# define LD_SO_ABI "riscv64-lp64"
+#else
+# error "rv32i-based targets are not supported"
+#endif
+
+#define SYSDEP_KNOWN_INTERPRETER_NAMES \
+ { LD_SO_PREFIX LD_SO_ABI "d" LD_SO_SUFFIX, FLAG_ELF_LIBC6 }, \
+ { LD_SO_PREFIX LD_SO_ABI LD_SO_SUFFIX, FLAG_ELF_LIBC6 },
+
+#define SYSDEP_KNOWN_LIBRARY_NAMES \
+ { "libc.so.6", FLAG_ELF_LIBC6 }, \
+ { "libm.so.6", FLAG_ELF_LIBC6 },
diff --git a/sysdeps/unix/sysv/linux/riscv/ldd-rewrite.sed b/sysdeps/unix/sysv/linux/riscv/ldd-rewrite.sed
new file mode 100644
index 0000000000..377a9c6ef4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/ldd-rewrite.sed
@@ -0,0 +1 @@
+s_^\(RTLDLIST=\)\(.*lib/\)\(ld-linux\)-\(riscv64\)-\(lp64\)\(d*\)\(\.so\.[0-9.]*\)_\1"\2\3-\4-\5\7 \2\3-\4-\5d\7"_
diff --git a/sysdeps/unix/sysv/linux/riscv/ldsodefs.h b/sysdeps/unix/sysv/linux/riscv/ldsodefs.h
new file mode 100644
index 0000000000..b9421ffdfa
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/ldsodefs.h
@@ -0,0 +1,32 @@
+/* RISC-V dynamic linker data structures for loaded ELF shared objects.
+ Copyright (C) 2001-2018 Free Software 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 _LDSODEFS_H
+
+/* Get the real definitions. */
+#include_next <ldsodefs.h>
+
+/* Now define our stuff. */
+
+/* We need special support to initialize DSO loaded for statically linked
+ binaries. */
+extern void _dl_static_init (struct link_map *map);
+#undef DL_STATIC_INIT
+#define DL_STATIC_INIT(map) _dl_static_init (map)
+
+#endif /* ldsodefs.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/libc-vdso.h b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
new file mode 100644
index 0000000000..1d44b34e02
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
@@ -0,0 +1,38 @@
+/* RISC-V VDSO function declarations
+ Copyright (C) 2017-2018 Free Software 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 _LIBC_VDSO_H
+#define _LIBC_VDSO_H
+
+#ifdef SHARED
+
+# include <sysdep-vdso.h>
+
+extern long int (*VDSO_SYMBOL (getcpu)) (unsigned int *, unsigned int *, void *)
+ attribute_hidden;
+extern long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
+ attribute_hidden;
+extern long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
+ attribute_hidden;
+extern long int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
+ attribute_hidden;
+
+#endif
+
+#endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/riscv/localplt.data b/sysdeps/unix/sysv/linux/riscv/localplt.data
new file mode 100644
index 0000000000..14c02cb2d6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/localplt.data
@@ -0,0 +1,19 @@
+# See scripts/check-localplt.awk for how this file is processed.
+# PLT use is required for the malloc family and for matherr because
+# users can define their own functions and have library internals call them.
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/riscv/makecontext.c b/sysdeps/unix/sysv/linux/riscv/makecontext.c
new file mode 100644
index 0000000000..b8054a29b0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/makecontext.c
@@ -0,0 +1,78 @@
+/* Create new context. RISC-V version.
+ Copyright (C) 2001-2018 Free Software 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>
+#include <sys/asm.h>
+#include <sys/ucontext.h>
+#include <stdarg.h>
+#include <assert.h>
+
+void
+__makecontext (ucontext_t *ucp, void (*func) (void), int argc,
+ long int a0, long int a1, long int a2, long int a3, long int a4,
+ ...)
+{
+ extern void __start_context (void) attribute_hidden;
+ long int i, sp;
+
+ _Static_assert (REG_NARGS == 8, "__makecontext assumes 8 argument registers");
+
+ /* Set up the stack. */
+ sp = ((long int) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size) & ALMASK;
+
+ /* Set up the register context.
+ ra = s0 = 0, terminating the stack for backtracing purposes.
+ s1 = the function we must call.
+ s2 = the subsequent context to run. */
+ ucp->uc_mcontext.__gregs[REG_RA] = 0;
+ ucp->uc_mcontext.__gregs[REG_S0] = 0;
+ ucp->uc_mcontext.__gregs[REG_S1] = (long int) func;
+ ucp->uc_mcontext.__gregs[REG_S2] = (long int) ucp->uc_link;
+ ucp->uc_mcontext.__gregs[REG_SP] = sp;
+ ucp->uc_mcontext.__gregs[REG_PC] = (long int) &__start_context;
+
+ /* Put args in a0-a7, then put any remaining args on the stack. */
+ ucp->uc_mcontext.__gregs[REG_A0 + 0] = a0;
+ ucp->uc_mcontext.__gregs[REG_A0 + 1] = a1;
+ ucp->uc_mcontext.__gregs[REG_A0 + 2] = a2;
+ ucp->uc_mcontext.__gregs[REG_A0 + 3] = a3;
+ ucp->uc_mcontext.__gregs[REG_A0 + 4] = a4;
+
+ if (__glibc_unlikely (argc > 5))
+ {
+ va_list vl;
+ va_start (vl, a4);
+
+ long reg_args = argc < REG_NARGS ? argc : REG_NARGS;
+ for (i = 5; i < reg_args; i++)
+ ucp->uc_mcontext.__gregs[REG_A0 + i] = va_arg (vl, long);
+
+ long int stack_args = argc - reg_args;
+ if (stack_args > 0)
+ {
+ sp = (sp - stack_args * sizeof (long int)) & ALMASK;
+ ucp->uc_mcontext.__gregs[REG_SP] = sp;
+ for (i = 0; i < stack_args; i++)
+ ((long int *) sp)[i] = va_arg (vl, long int);
+ }
+
+ va_end (vl);
+ }
+}
+
+weak_alias (__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/riscv/profil-counter.h b/sysdeps/unix/sysv/linux/riscv/profil-counter.h
new file mode 100644
index 0000000000..748019ee1b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/profil-counter.h
@@ -0,0 +1,31 @@
+/* Low-level statistical profiling support function. Linux/RISC-V version.
+ Copyright (C) 1996-2018 Free Software 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 <sigcontextinfo.h>
+
+static void
+__profil_counter (int signo, const SIGCONTEXT scp)
+{
+ profil_count ((void *) GET_PC (scp));
+
+ /* This is a hack to prevent the compiler from implementing the
+ above function call as a sibcall. The sibcall would overwrite
+ the signal context. */
+ asm volatile ("");
+}
diff --git a/sysdeps/unix/sysv/linux/riscv/pt-vfork.S b/sysdeps/unix/sysv/linux/riscv/pt-vfork.S
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/pt-vfork.S
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/unix/sysv/linux/riscv/readelflib.c b/sysdeps/unix/sysv/linux/riscv/readelflib.c
new file mode 100644
index 0000000000..7e27e0c1d6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/readelflib.c
@@ -0,0 +1,97 @@
+/* Support for reading ELF files.
+ Copyright (C) 1999-2018 Free Software 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/>. */
+
+
+int process_elf32_file (const char *file_name, const char *lib, int *flag,
+ unsigned int *osversion, char **soname,
+ void *file_contents, size_t file_length);
+int process_elf64_file (const char *file_name, const char *lib, int *flag,
+ unsigned int *osversion, char **soname,
+ void *file_contents, size_t file_length);
+
+/* The ELF flags supported by our current glibc port:
+ - EF_RISCV_FLOAT_ABI: We support the soft and double ABIs.
+ - EF_RISCV_RVC: While the Linux ABI mandates the presence of the C
+ extension, we can still support libraries compiled without that extension
+ so we just ignore this flag.
+ - EF_RISCV_RVE: glibc (and Linux) don't support RV32E based systems.
+ - EF_RISCV_TSO: The TSO extension isn't supported, as doing so would require
+ some mechanism to ensure that the TSO extension is enabled which doesn't
+ currently exist. */
+#define SUPPORTED_ELF_FLAGS (EF_RISCV_FLOAT_ABI | EF_RISCV_RVC)
+
+/* Returns 0 if everything is ok, != 0 in case of error. */
+int
+process_elf_file (const char *file_name, const char *lib, int *flag,
+ unsigned int *osversion, char **soname, void *file_contents,
+ size_t file_length)
+{
+ ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
+ Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header;
+ Elf64_Ehdr *elf64_header = (Elf64_Ehdr *) elf_header;
+ int ret;
+ long flags;
+
+ /* RISC-V libraries are always libc.so.6+. */
+ *flag = FLAG_ELF_LIBC6;
+
+ if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
+ {
+ ret = process_elf32_file (file_name, lib, flag, osversion, soname,
+ file_contents, file_length);
+ flags = elf32_header->e_flags;
+ }
+ else
+ {
+ ret = process_elf64_file (file_name, lib, flag, osversion, soname,
+ file_contents, file_length);
+ flags = elf64_header->e_flags;
+ }
+
+ /* RISC-V linkers encode the floating point ABI as part of the ELF headers. */
+ switch (flags & EF_RISCV_FLOAT_ABI)
+ {
+ case EF_RISCV_FLOAT_ABI_SOFT:
+ *flag |= FLAG_RISCV_FLOAT_ABI_SOFT;
+ break;
+ case EF_RISCV_FLOAT_ABI_DOUBLE:
+ *flag |= FLAG_RISCV_FLOAT_ABI_DOUBLE;
+ break;
+ default:
+ return 1;
+ }
+
+ /* If there are any other ELF flags set then glibc doesn't support this
+ library. */
+ if (flags & ~SUPPORTED_ELF_FLAGS)
+ return 1;
+
+ return ret;
+}
+
+#undef __ELF_NATIVE_CLASS
+#undef process_elf_file
+#define process_elf_file process_elf32_file
+#define __ELF_NATIVE_CLASS 32
+#include "elf/readelflib.c"
+
+#undef __ELF_NATIVE_CLASS
+#undef process_elf_file
+#define process_elf_file process_elf64_file
+#define __ELF_NATIVE_CLASS 64
+#include "elf/readelflib.c"
diff --git a/sysdeps/unix/sysv/linux/riscv/register-dump.h b/sysdeps/unix/sysv/linux/riscv/register-dump.h
new file mode 100644
index 0000000000..234ce630f9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/register-dump.h
@@ -0,0 +1,63 @@
+/* Dump registers.
+ Copyright (C) 2000-2018 Free Software 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 <string.h>
+#include <_itoa.h>
+
+static void
+hexvalue (unsigned long int value, char *buf, size_t len)
+{
+ char *cp = _itoa_word (value, buf + len, 16, 0);
+ while (cp > buf)
+ *--cp = '0';
+}
+
+#define REGDUMP_NREGS 32
+#define REGDUMP_PER_LINE (80 / (__WORDSIZE / 4 + 4))
+
+static void
+register_dump (int fd, ucontext_t *ctx)
+{
+ int i;
+ char regvalue[__WORDSIZE / 4 + 1];
+ char str[82 * ((REGDUMP_NREGS + REGDUMP_PER_LINE - 1) / REGDUMP_PER_LINE)];
+
+ static const char names[REGDUMP_NREGS][4] = {
+ "pc", "ra", "sp", "gp", "tp", "t0", "t1", "t2",
+ "s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5",
+ "a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7",
+ "s8", "s9", "sA", "sB", "t3", "t4", "t5", "t6"
+ };
+
+ str[0] = 0;
+ for (i = 0; i < REGDUMP_NREGS; i++)
+ {
+ strcat (str, names[i]);
+ strcat (str, " ");
+ hexvalue (ctx->uc_mcontext.__gregs[i], regvalue, __WORDSIZE / 4);
+ strcat (str, regvalue);
+
+ if ((i + 1) % REGDUMP_PER_LINE == 0)
+ strcat (str, "\n");
+ }
+
+ write (fd, str, strlen (str));
+}
+
+#define REGISTER_DUMP register_dump (fd, ctx)
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/Implies b/sysdeps/unix/sysv/linux/riscv/rv64/Implies
new file mode 100644
index 0000000000..f042343bf7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/Implies
@@ -0,0 +1,3 @@
+unix/sysv/linux/riscv
+unix/sysv/linux/generic
+unix/sysv/linux/wordsize-64
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/c++-types.data b/sysdeps/unix/sysv/linux/riscv/rv64/c++-types.data
index ac925ccb36..ac925ccb36 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/c++-types.data
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/c++-types.data
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h
new file mode 100644
index 0000000000..34434a8d93
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h
@@ -0,0 +1,53 @@
+/* jump buffer constants for RISC-V
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* Produced by this program:
+
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <setjmp.h>
+ #include <stddef.h>
+
+ int main (int argc, char **argv)
+ {
+ printf ("#define JMP_BUF_SIZE %d\n", sizeof (jmp_buf));
+ printf ("#define JMP_BUF_ALIGN %d\n", __alignof__ (jmp_buf));
+ printf ("#define SIGJMP_BUF_SIZE %d\n", sizeof (sigjmp_buf));
+ printf ("#define SIGJMP_BUF_ALIGN %d\n", __alignof__ (sigjmp_buf));
+ printf ("#define MASK_WAS_SAVED_OFFSET %d\n", offsetof (struct __jmp_buf_tag, __mask_was_saved));
+ printf ("#define SAVED_MASK_OFFSET %d\n", offsetof (struct __jmp_buf_tag, __saved_mask));
+ } */
+
+#if defined __riscv_float_abi_soft
+# define JMP_BUF_SIZE 248
+# define JMP_BUF_ALIGN 8
+# define SIGJMP_BUF_SIZE 248
+# define SIGJMP_BUF_ALIGN 8
+# define MASK_WAS_SAVED_OFFSET 112
+# define SAVED_MASK_OFFSET 120
+#elif defined __riscv_float_abi_double
+# define JMP_BUF_SIZE 344
+# define JMP_BUF_ALIGN 8
+# define SIGJMP_BUF_SIZE 344
+# define SIGJMP_BUF_ALIGN 8
+# define MASK_WAS_SAVED_OFFSET 208
+# define SAVED_MASK_OFFSET 216
+#else
+# error "Unknown RISC-V floating-point ABI"
+#endif
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist
new file mode 100644
index 0000000000..b411871d06
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist
@@ -0,0 +1,9 @@
+GLIBC_2.27 __libc_stack_end D 0x8
+GLIBC_2.27 __stack_chk_guard D 0x8
+GLIBC_2.27 __tls_get_addr F
+GLIBC_2.27 _dl_mcount F
+GLIBC_2.27 _r_debug D 0x28
+GLIBC_2.27 calloc F
+GLIBC_2.27 free F
+GLIBC_2.27 malloc F
+GLIBC_2.27 realloc F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libBrokenLocale.abilist
new file mode 100644
index 0000000000..18968d3c01
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libBrokenLocale.abilist
@@ -0,0 +1 @@
+GLIBC_2.27 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libanl.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libanl.abilist
new file mode 100644
index 0000000000..711fc87c2a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libanl.abilist
@@ -0,0 +1,4 @@
+GLIBC_2.27 gai_cancel F
+GLIBC_2.27 gai_error F
+GLIBC_2.27 gai_suspend F
+GLIBC_2.27 getaddrinfo_a F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
new file mode 100644
index 0000000000..daacceebd6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -0,0 +1,2102 @@
+GLIBC_2.27 _Exit F
+GLIBC_2.27 _IO_2_1_stderr_ D 0xe0
+GLIBC_2.27 _IO_2_1_stdin_ D 0xe0
+GLIBC_2.27 _IO_2_1_stdout_ D 0xe0
+GLIBC_2.27 _IO_adjust_column F
+GLIBC_2.27 _IO_adjust_wcolumn F
+GLIBC_2.27 _IO_default_doallocate F
+GLIBC_2.27 _IO_default_finish F
+GLIBC_2.27 _IO_default_pbackfail F
+GLIBC_2.27 _IO_default_uflow F
+GLIBC_2.27 _IO_default_xsgetn F
+GLIBC_2.27 _IO_default_xsputn F
+GLIBC_2.27 _IO_do_write F
+GLIBC_2.27 _IO_doallocbuf F
+GLIBC_2.27 _IO_fclose F
+GLIBC_2.27 _IO_fdopen F
+GLIBC_2.27 _IO_feof F
+GLIBC_2.27 _IO_ferror F
+GLIBC_2.27 _IO_fflush F
+GLIBC_2.27 _IO_fgetpos F
+GLIBC_2.27 _IO_fgetpos64 F
+GLIBC_2.27 _IO_fgets F
+GLIBC_2.27 _IO_file_attach F
+GLIBC_2.27 _IO_file_close F
+GLIBC_2.27 _IO_file_close_it F
+GLIBC_2.27 _IO_file_doallocate F
+GLIBC_2.27 _IO_file_finish F
+GLIBC_2.27 _IO_file_fopen F
+GLIBC_2.27 _IO_file_init F
+GLIBC_2.27 _IO_file_jumps D 0xa8
+GLIBC_2.27 _IO_file_open F
+GLIBC_2.27 _IO_file_overflow F
+GLIBC_2.27 _IO_file_read F
+GLIBC_2.27 _IO_file_seek F
+GLIBC_2.27 _IO_file_seekoff F
+GLIBC_2.27 _IO_file_setbuf F
+GLIBC_2.27 _IO_file_stat F
+GLIBC_2.27 _IO_file_sync F
+GLIBC_2.27 _IO_file_underflow F
+GLIBC_2.27 _IO_file_write F
+GLIBC_2.27 _IO_file_xsputn F
+GLIBC_2.27 _IO_flockfile F
+GLIBC_2.27 _IO_flush_all F
+GLIBC_2.27 _IO_flush_all_linebuffered F
+GLIBC_2.27 _IO_fopen F
+GLIBC_2.27 _IO_fprintf F
+GLIBC_2.27 _IO_fputs F
+GLIBC_2.27 _IO_fread F
+GLIBC_2.27 _IO_free_backup_area F
+GLIBC_2.27 _IO_free_wbackup_area F
+GLIBC_2.27 _IO_fsetpos F
+GLIBC_2.27 _IO_fsetpos64 F
+GLIBC_2.27 _IO_ftell F
+GLIBC_2.27 _IO_ftrylockfile F
+GLIBC_2.27 _IO_funlockfile F
+GLIBC_2.27 _IO_fwrite F
+GLIBC_2.27 _IO_getc F
+GLIBC_2.27 _IO_getline F
+GLIBC_2.27 _IO_getline_info F
+GLIBC_2.27 _IO_gets F
+GLIBC_2.27 _IO_init F
+GLIBC_2.27 _IO_init_marker F
+GLIBC_2.27 _IO_init_wmarker F
+GLIBC_2.27 _IO_iter_begin F
+GLIBC_2.27 _IO_iter_end F
+GLIBC_2.27 _IO_iter_file F
+GLIBC_2.27 _IO_iter_next F
+GLIBC_2.27 _IO_least_wmarker F
+GLIBC_2.27 _IO_link_in F
+GLIBC_2.27 _IO_list_all D 0x8
+GLIBC_2.27 _IO_list_lock F
+GLIBC_2.27 _IO_list_resetlock F
+GLIBC_2.27 _IO_list_unlock F
+GLIBC_2.27 _IO_marker_delta F
+GLIBC_2.27 _IO_marker_difference F
+GLIBC_2.27 _IO_padn F
+GLIBC_2.27 _IO_peekc_locked F
+GLIBC_2.27 _IO_popen F
+GLIBC_2.27 _IO_printf F
+GLIBC_2.27 _IO_proc_close F
+GLIBC_2.27 _IO_proc_open F
+GLIBC_2.27 _IO_putc F
+GLIBC_2.27 _IO_puts F
+GLIBC_2.27 _IO_remove_marker F
+GLIBC_2.27 _IO_seekmark F
+GLIBC_2.27 _IO_seekoff F
+GLIBC_2.27 _IO_seekpos F
+GLIBC_2.27 _IO_seekwmark F
+GLIBC_2.27 _IO_setb F
+GLIBC_2.27 _IO_setbuffer F
+GLIBC_2.27 _IO_setvbuf F
+GLIBC_2.27 _IO_sgetn F
+GLIBC_2.27 _IO_sprintf F
+GLIBC_2.27 _IO_sputbackc F
+GLIBC_2.27 _IO_sputbackwc F
+GLIBC_2.27 _IO_sscanf F
+GLIBC_2.27 _IO_str_init_readonly F
+GLIBC_2.27 _IO_str_init_static F
+GLIBC_2.27 _IO_str_overflow F
+GLIBC_2.27 _IO_str_pbackfail F
+GLIBC_2.27 _IO_str_seekoff F
+GLIBC_2.27 _IO_str_underflow F
+GLIBC_2.27 _IO_sungetc F
+GLIBC_2.27 _IO_sungetwc F
+GLIBC_2.27 _IO_switch_to_get_mode F
+GLIBC_2.27 _IO_switch_to_main_wget_area F
+GLIBC_2.27 _IO_switch_to_wbackup_area F
+GLIBC_2.27 _IO_switch_to_wget_mode F
+GLIBC_2.27 _IO_un_link F
+GLIBC_2.27 _IO_ungetc F
+GLIBC_2.27 _IO_unsave_markers F
+GLIBC_2.27 _IO_unsave_wmarkers F
+GLIBC_2.27 _IO_vfprintf F
+GLIBC_2.27 _IO_vfscanf F
+GLIBC_2.27 _IO_vsprintf F
+GLIBC_2.27 _IO_wdefault_doallocate F
+GLIBC_2.27 _IO_wdefault_finish F
+GLIBC_2.27 _IO_wdefault_pbackfail F
+GLIBC_2.27 _IO_wdefault_uflow F
+GLIBC_2.27 _IO_wdefault_xsgetn F
+GLIBC_2.27 _IO_wdefault_xsputn F
+GLIBC_2.27 _IO_wdo_write F
+GLIBC_2.27 _IO_wdoallocbuf F
+GLIBC_2.27 _IO_wfile_jumps D 0xa8
+GLIBC_2.27 _IO_wfile_overflow F
+GLIBC_2.27 _IO_wfile_seekoff F
+GLIBC_2.27 _IO_wfile_sync F
+GLIBC_2.27 _IO_wfile_underflow F
+GLIBC_2.27 _IO_wfile_xsputn F
+GLIBC_2.27 _IO_wmarker_delta F
+GLIBC_2.27 _IO_wsetb F
+GLIBC_2.27 ___brk_addr D 0x8
+GLIBC_2.27 __adjtimex F
+GLIBC_2.27 __after_morecore_hook D 0x8
+GLIBC_2.27 __argz_count F
+GLIBC_2.27 __argz_next F
+GLIBC_2.27 __argz_stringify F
+GLIBC_2.27 __asprintf F
+GLIBC_2.27 __asprintf_chk F
+GLIBC_2.27 __assert F
+GLIBC_2.27 __assert_fail F
+GLIBC_2.27 __assert_perror_fail F
+GLIBC_2.27 __backtrace F
+GLIBC_2.27 __backtrace_symbols F
+GLIBC_2.27 __backtrace_symbols_fd F
+GLIBC_2.27 __bsd_getpgrp F
+GLIBC_2.27 __bzero F
+GLIBC_2.27 __check_rhosts_file D 0x4
+GLIBC_2.27 __chk_fail F
+GLIBC_2.27 __clone F
+GLIBC_2.27 __close F
+GLIBC_2.27 __cmsg_nxthdr F
+GLIBC_2.27 __confstr_chk F
+GLIBC_2.27 __connect F
+GLIBC_2.27 __ctype_b_loc F
+GLIBC_2.27 __ctype_get_mb_cur_max F
+GLIBC_2.27 __ctype_tolower_loc F
+GLIBC_2.27 __ctype_toupper_loc F
+GLIBC_2.27 __curbrk D 0x8
+GLIBC_2.27 __cxa_at_quick_exit F
+GLIBC_2.27 __cxa_atexit F
+GLIBC_2.27 __cxa_finalize F
+GLIBC_2.27 __cxa_thread_atexit_impl F
+GLIBC_2.27 __cyg_profile_func_enter F
+GLIBC_2.27 __cyg_profile_func_exit F
+GLIBC_2.27 __daylight D 0x4
+GLIBC_2.27 __dcgettext F
+GLIBC_2.27 __default_morecore F
+GLIBC_2.27 __dgettext F
+GLIBC_2.27 __dprintf_chk F
+GLIBC_2.27 __dup2 F
+GLIBC_2.27 __duplocale F
+GLIBC_2.27 __endmntent F
+GLIBC_2.27 __environ D 0x8
+GLIBC_2.27 __errno_location F
+GLIBC_2.27 __explicit_bzero_chk F
+GLIBC_2.27 __fbufsize F
+GLIBC_2.27 __fcntl F
+GLIBC_2.27 __fdelt_chk F
+GLIBC_2.27 __fdelt_warn F
+GLIBC_2.27 __ffs F
+GLIBC_2.27 __fgets_chk F
+GLIBC_2.27 __fgets_unlocked_chk F
+GLIBC_2.27 __fgetws_chk F
+GLIBC_2.27 __fgetws_unlocked_chk F
+GLIBC_2.27 __finite F
+GLIBC_2.27 __finitef F
+GLIBC_2.27 __finitel F
+GLIBC_2.27 __flbf F
+GLIBC_2.27 __fork F
+GLIBC_2.27 __fpending F
+GLIBC_2.27 __fprintf_chk F
+GLIBC_2.27 __fpu_control D 0x4
+GLIBC_2.27 __fpurge F
+GLIBC_2.27 __fread_chk F
+GLIBC_2.27 __fread_unlocked_chk F
+GLIBC_2.27 __freadable F
+GLIBC_2.27 __freading F
+GLIBC_2.27 __free_hook D 0x8
+GLIBC_2.27 __freelocale F
+GLIBC_2.27 __fsetlocking F
+GLIBC_2.27 __fwprintf_chk F
+GLIBC_2.27 __fwritable F
+GLIBC_2.27 __fwriting F
+GLIBC_2.27 __fxstat F
+GLIBC_2.27 __fxstat64 F
+GLIBC_2.27 __fxstatat F
+GLIBC_2.27 __fxstatat64 F
+GLIBC_2.27 __getauxval F
+GLIBC_2.27 __getcwd_chk F
+GLIBC_2.27 __getdelim F
+GLIBC_2.27 __getdomainname_chk F
+GLIBC_2.27 __getgroups_chk F
+GLIBC_2.27 __gethostname_chk F
+GLIBC_2.27 __getlogin_r_chk F
+GLIBC_2.27 __getmntent_r F
+GLIBC_2.27 __getpagesize F
+GLIBC_2.27 __getpgid F
+GLIBC_2.27 __getpid F
+GLIBC_2.27 __gets_chk F
+GLIBC_2.27 __gettimeofday F
+GLIBC_2.27 __getwd_chk F
+GLIBC_2.27 __gmtime_r F
+GLIBC_2.27 __h_errno_location F
+GLIBC_2.27 __isalnum_l F
+GLIBC_2.27 __isalpha_l F
+GLIBC_2.27 __isascii_l F
+GLIBC_2.27 __isblank_l F
+GLIBC_2.27 __iscntrl_l F
+GLIBC_2.27 __isctype F
+GLIBC_2.27 __isdigit_l F
+GLIBC_2.27 __isgraph_l F
+GLIBC_2.27 __isinf F
+GLIBC_2.27 __isinff F
+GLIBC_2.27 __isinfl F
+GLIBC_2.27 __islower_l F
+GLIBC_2.27 __isnan F
+GLIBC_2.27 __isnanf F
+GLIBC_2.27 __isnanl F
+GLIBC_2.27 __isoc99_fscanf F
+GLIBC_2.27 __isoc99_fwscanf F
+GLIBC_2.27 __isoc99_scanf F
+GLIBC_2.27 __isoc99_sscanf F
+GLIBC_2.27 __isoc99_swscanf F
+GLIBC_2.27 __isoc99_vfscanf F
+GLIBC_2.27 __isoc99_vfwscanf F
+GLIBC_2.27 __isoc99_vscanf F
+GLIBC_2.27 __isoc99_vsscanf F
+GLIBC_2.27 __isoc99_vswscanf F
+GLIBC_2.27 __isoc99_vwscanf F
+GLIBC_2.27 __isoc99_wscanf F
+GLIBC_2.27 __isprint_l F
+GLIBC_2.27 __ispunct_l F
+GLIBC_2.27 __isspace_l F
+GLIBC_2.27 __isupper_l F
+GLIBC_2.27 __iswalnum_l F
+GLIBC_2.27 __iswalpha_l F
+GLIBC_2.27 __iswblank_l F
+GLIBC_2.27 __iswcntrl_l F
+GLIBC_2.27 __iswctype F
+GLIBC_2.27 __iswctype_l F
+GLIBC_2.27 __iswdigit_l F
+GLIBC_2.27 __iswgraph_l F
+GLIBC_2.27 __iswlower_l F
+GLIBC_2.27 __iswprint_l F
+GLIBC_2.27 __iswpunct_l F
+GLIBC_2.27 __iswspace_l F
+GLIBC_2.27 __iswupper_l F
+GLIBC_2.27 __iswxdigit_l F
+GLIBC_2.27 __isxdigit_l F
+GLIBC_2.27 __ivaliduser F
+GLIBC_2.27 __key_decryptsession_pk_LOCAL D 0x8
+GLIBC_2.27 __key_encryptsession_pk_LOCAL D 0x8
+GLIBC_2.27 __key_gendes_LOCAL D 0x8
+GLIBC_2.27 __libc_allocate_rtsig F
+GLIBC_2.27 __libc_calloc F
+GLIBC_2.27 __libc_current_sigrtmax F
+GLIBC_2.27 __libc_current_sigrtmin F
+GLIBC_2.27 __libc_free F
+GLIBC_2.27 __libc_freeres F
+GLIBC_2.27 __libc_init_first F
+GLIBC_2.27 __libc_mallinfo F
+GLIBC_2.27 __libc_malloc F
+GLIBC_2.27 __libc_mallopt F
+GLIBC_2.27 __libc_memalign F
+GLIBC_2.27 __libc_pvalloc F
+GLIBC_2.27 __libc_realloc F
+GLIBC_2.27 __libc_sa_len F
+GLIBC_2.27 __libc_start_main F
+GLIBC_2.27 __libc_valloc F
+GLIBC_2.27 __longjmp_chk F
+GLIBC_2.27 __lseek F
+GLIBC_2.27 __lxstat F
+GLIBC_2.27 __lxstat64 F
+GLIBC_2.27 __malloc_hook D 0x8
+GLIBC_2.27 __mbrlen F
+GLIBC_2.27 __mbrtowc F
+GLIBC_2.27 __mbsnrtowcs_chk F
+GLIBC_2.27 __mbsrtowcs_chk F
+GLIBC_2.27 __mbstowcs_chk F
+GLIBC_2.27 __memalign_hook D 0x8
+GLIBC_2.27 __memcpy_chk F
+GLIBC_2.27 __memmove_chk F
+GLIBC_2.27 __mempcpy F
+GLIBC_2.27 __mempcpy_chk F
+GLIBC_2.27 __memset_chk F
+GLIBC_2.27 __monstartup F
+GLIBC_2.27 __morecore D 0x8
+GLIBC_2.27 __nanosleep F
+GLIBC_2.27 __newlocale F
+GLIBC_2.27 __nl_langinfo_l F
+GLIBC_2.27 __nss_configure_lookup F
+GLIBC_2.27 __nss_database_lookup F
+GLIBC_2.27 __nss_hostname_digits_dots F
+GLIBC_2.27 __nss_next F
+GLIBC_2.27 __obstack_printf_chk F
+GLIBC_2.27 __obstack_vprintf_chk F
+GLIBC_2.27 __open F
+GLIBC_2.27 __open64 F
+GLIBC_2.27 __open64_2 F
+GLIBC_2.27 __open_2 F
+GLIBC_2.27 __openat64_2 F
+GLIBC_2.27 __openat_2 F
+GLIBC_2.27 __overflow F
+GLIBC_2.27 __pipe F
+GLIBC_2.27 __poll F
+GLIBC_2.27 __poll_chk F
+GLIBC_2.27 __posix_getopt F
+GLIBC_2.27 __ppoll_chk F
+GLIBC_2.27 __pread64 F
+GLIBC_2.27 __pread64_chk F
+GLIBC_2.27 __pread_chk F
+GLIBC_2.27 __printf_chk F
+GLIBC_2.27 __printf_fp F
+GLIBC_2.27 __profile_frequency F
+GLIBC_2.27 __progname D 0x8
+GLIBC_2.27 __progname_full D 0x8
+GLIBC_2.27 __ptsname_r_chk F
+GLIBC_2.27 __pwrite64 F
+GLIBC_2.27 __rawmemchr F
+GLIBC_2.27 __rcmd_errstr D 0x8
+GLIBC_2.27 __read F
+GLIBC_2.27 __read_chk F
+GLIBC_2.27 __readlink_chk F
+GLIBC_2.27 __readlinkat_chk F
+GLIBC_2.27 __realloc_hook D 0x8
+GLIBC_2.27 __realpath_chk F
+GLIBC_2.27 __recv_chk F
+GLIBC_2.27 __recvfrom_chk F
+GLIBC_2.27 __register_atfork F
+GLIBC_2.27 __res_init F
+GLIBC_2.27 __res_nclose F
+GLIBC_2.27 __res_ninit F
+GLIBC_2.27 __res_randomid F
+GLIBC_2.27 __res_state F
+GLIBC_2.27 __riscv_flush_icache F
+GLIBC_2.27 __rpc_thread_createerr F
+GLIBC_2.27 __rpc_thread_svc_fdset F
+GLIBC_2.27 __rpc_thread_svc_max_pollfd F
+GLIBC_2.27 __rpc_thread_svc_pollfd F
+GLIBC_2.27 __sbrk F
+GLIBC_2.27 __sched_cpualloc F
+GLIBC_2.27 __sched_cpucount F
+GLIBC_2.27 __sched_cpufree F
+GLIBC_2.27 __sched_get_priority_max F
+GLIBC_2.27 __sched_get_priority_min F
+GLIBC_2.27 __sched_getparam F
+GLIBC_2.27 __sched_getscheduler F
+GLIBC_2.27 __sched_setscheduler F
+GLIBC_2.27 __sched_yield F
+GLIBC_2.27 __select F
+GLIBC_2.27 __send F
+GLIBC_2.27 __setmntent F
+GLIBC_2.27 __setpgid F
+GLIBC_2.27 __sigaction F
+GLIBC_2.27 __signbit F
+GLIBC_2.27 __signbitf F
+GLIBC_2.27 __signbitl F
+GLIBC_2.27 __sigpause F
+GLIBC_2.27 __sigsetjmp F
+GLIBC_2.27 __sigsuspend F
+GLIBC_2.27 __snprintf_chk F
+GLIBC_2.27 __sprintf_chk F
+GLIBC_2.27 __stack_chk_fail F
+GLIBC_2.27 __statfs F
+GLIBC_2.27 __stpcpy F
+GLIBC_2.27 __stpcpy_chk F
+GLIBC_2.27 __stpncpy F
+GLIBC_2.27 __stpncpy_chk F
+GLIBC_2.27 __strcasecmp F
+GLIBC_2.27 __strcasecmp_l F
+GLIBC_2.27 __strcasestr F
+GLIBC_2.27 __strcat_chk F
+GLIBC_2.27 __strcoll_l F
+GLIBC_2.27 __strcpy_chk F
+GLIBC_2.27 __strdup F
+GLIBC_2.27 __strerror_r F
+GLIBC_2.27 __strfmon_l F
+GLIBC_2.27 __strftime_l F
+GLIBC_2.27 __strncasecmp_l F
+GLIBC_2.27 __strncat_chk F
+GLIBC_2.27 __strncpy_chk F
+GLIBC_2.27 __strndup F
+GLIBC_2.27 __strsep_g F
+GLIBC_2.27 __strtod_internal F
+GLIBC_2.27 __strtod_l F
+GLIBC_2.27 __strtof_internal F
+GLIBC_2.27 __strtof_l F
+GLIBC_2.27 __strtok_r F
+GLIBC_2.27 __strtol_internal F
+GLIBC_2.27 __strtol_l F
+GLIBC_2.27 __strtold_internal F
+GLIBC_2.27 __strtold_l F
+GLIBC_2.27 __strtoll_internal F
+GLIBC_2.27 __strtoll_l F
+GLIBC_2.27 __strtoul_internal F
+GLIBC_2.27 __strtoul_l F
+GLIBC_2.27 __strtoull_internal F
+GLIBC_2.27 __strtoull_l F
+GLIBC_2.27 __strverscmp F
+GLIBC_2.27 __strxfrm_l F
+GLIBC_2.27 __swprintf_chk F
+GLIBC_2.27 __sysconf F
+GLIBC_2.27 __syslog_chk F
+GLIBC_2.27 __sysv_signal F
+GLIBC_2.27 __timezone D 0x8
+GLIBC_2.27 __toascii_l F
+GLIBC_2.27 __tolower_l F
+GLIBC_2.27 __toupper_l F
+GLIBC_2.27 __towctrans F
+GLIBC_2.27 __towctrans_l F
+GLIBC_2.27 __towlower_l F
+GLIBC_2.27 __towupper_l F
+GLIBC_2.27 __ttyname_r_chk F
+GLIBC_2.27 __tzname D 0x10
+GLIBC_2.27 __uflow F
+GLIBC_2.27 __underflow F
+GLIBC_2.27 __uselocale F
+GLIBC_2.27 __vasprintf_chk F
+GLIBC_2.27 __vdprintf_chk F
+GLIBC_2.27 __vfork F
+GLIBC_2.27 __vfprintf_chk F
+GLIBC_2.27 __vfscanf F
+GLIBC_2.27 __vfwprintf_chk F
+GLIBC_2.27 __vprintf_chk F
+GLIBC_2.27 __vsnprintf F
+GLIBC_2.27 __vsnprintf_chk F
+GLIBC_2.27 __vsprintf_chk F
+GLIBC_2.27 __vsscanf F
+GLIBC_2.27 __vswprintf_chk F
+GLIBC_2.27 __vsyslog_chk F
+GLIBC_2.27 __vwprintf_chk F
+GLIBC_2.27 __wait F
+GLIBC_2.27 __waitpid F
+GLIBC_2.27 __wcpcpy_chk F
+GLIBC_2.27 __wcpncpy_chk F
+GLIBC_2.27 __wcrtomb_chk F
+GLIBC_2.27 __wcscasecmp_l F
+GLIBC_2.27 __wcscat_chk F
+GLIBC_2.27 __wcscoll_l F
+GLIBC_2.27 __wcscpy_chk F
+GLIBC_2.27 __wcsftime_l F
+GLIBC_2.27 __wcsncasecmp_l F
+GLIBC_2.27 __wcsncat_chk F
+GLIBC_2.27 __wcsncpy_chk F
+GLIBC_2.27 __wcsnrtombs_chk F
+GLIBC_2.27 __wcsrtombs_chk F
+GLIBC_2.27 __wcstod_internal F
+GLIBC_2.27 __wcstod_l F
+GLIBC_2.27 __wcstof_internal F
+GLIBC_2.27 __wcstof_l F
+GLIBC_2.27 __wcstol_internal F
+GLIBC_2.27 __wcstol_l F
+GLIBC_2.27 __wcstold_internal F
+GLIBC_2.27 __wcstold_l F
+GLIBC_2.27 __wcstoll_internal F
+GLIBC_2.27 __wcstoll_l F
+GLIBC_2.27 __wcstombs_chk F
+GLIBC_2.27 __wcstoul_internal F
+GLIBC_2.27 __wcstoul_l F
+GLIBC_2.27 __wcstoull_internal F
+GLIBC_2.27 __wcstoull_l F
+GLIBC_2.27 __wcsxfrm_l F
+GLIBC_2.27 __wctomb_chk F
+GLIBC_2.27 __wctrans_l F
+GLIBC_2.27 __wctype_l F
+GLIBC_2.27 __wmemcpy_chk F
+GLIBC_2.27 __wmemmove_chk F
+GLIBC_2.27 __wmempcpy_chk F
+GLIBC_2.27 __wmemset_chk F
+GLIBC_2.27 __woverflow F
+GLIBC_2.27 __wprintf_chk F
+GLIBC_2.27 __write F
+GLIBC_2.27 __wuflow F
+GLIBC_2.27 __wunderflow F
+GLIBC_2.27 __xmknod F
+GLIBC_2.27 __xmknodat F
+GLIBC_2.27 __xpg_basename F
+GLIBC_2.27 __xpg_sigpause F
+GLIBC_2.27 __xpg_strerror_r F
+GLIBC_2.27 __xstat F
+GLIBC_2.27 __xstat64 F
+GLIBC_2.27 _authenticate F
+GLIBC_2.27 _dl_mcount_wrapper F
+GLIBC_2.27 _dl_mcount_wrapper_check F
+GLIBC_2.27 _environ D 0x8
+GLIBC_2.27 _exit F
+GLIBC_2.27 _flushlbf F
+GLIBC_2.27 _libc_intl_domainname D 0x5
+GLIBC_2.27 _longjmp F
+GLIBC_2.27 _mcleanup F
+GLIBC_2.27 _mcount F
+GLIBC_2.27 _nl_default_dirname D 0x12
+GLIBC_2.27 _nl_domain_bindings D 0x8
+GLIBC_2.27 _nl_msg_cat_cntr D 0x4
+GLIBC_2.27 _null_auth D 0x18
+GLIBC_2.27 _obstack_allocated_p F
+GLIBC_2.27 _obstack_begin F
+GLIBC_2.27 _obstack_begin_1 F
+GLIBC_2.27 _obstack_free F
+GLIBC_2.27 _obstack_memory_used F
+GLIBC_2.27 _obstack_newchunk F
+GLIBC_2.27 _res D 0x238
+GLIBC_2.27 _res_hconf D 0x48
+GLIBC_2.27 _rpc_dtablesize F
+GLIBC_2.27 _seterr_reply F
+GLIBC_2.27 _setjmp F
+GLIBC_2.27 _sys_errlist D 0x438
+GLIBC_2.27 _sys_nerr D 0x4
+GLIBC_2.27 _sys_siglist D 0x208
+GLIBC_2.27 _tolower F
+GLIBC_2.27 _toupper F
+GLIBC_2.27 a64l F
+GLIBC_2.27 abort F
+GLIBC_2.27 abs F
+GLIBC_2.27 accept F
+GLIBC_2.27 accept4 F
+GLIBC_2.27 access F
+GLIBC_2.27 acct F
+GLIBC_2.27 addmntent F
+GLIBC_2.27 addseverity F
+GLIBC_2.27 adjtime F
+GLIBC_2.27 adjtimex F
+GLIBC_2.27 alarm F
+GLIBC_2.27 aligned_alloc F
+GLIBC_2.27 alphasort F
+GLIBC_2.27 alphasort64 F
+GLIBC_2.27 argp_err_exit_status D 0x4
+GLIBC_2.27 argp_error F
+GLIBC_2.27 argp_failure F
+GLIBC_2.27 argp_help F
+GLIBC_2.27 argp_parse F
+GLIBC_2.27 argp_program_bug_address D 0x8
+GLIBC_2.27 argp_program_version D 0x8
+GLIBC_2.27 argp_program_version_hook D 0x8
+GLIBC_2.27 argp_state_help F
+GLIBC_2.27 argp_usage F
+GLIBC_2.27 argz_add F
+GLIBC_2.27 argz_add_sep F
+GLIBC_2.27 argz_append F
+GLIBC_2.27 argz_count F
+GLIBC_2.27 argz_create F
+GLIBC_2.27 argz_create_sep F
+GLIBC_2.27 argz_delete F
+GLIBC_2.27 argz_extract F
+GLIBC_2.27 argz_insert F
+GLIBC_2.27 argz_next F
+GLIBC_2.27 argz_replace F
+GLIBC_2.27 argz_stringify F
+GLIBC_2.27 asctime F
+GLIBC_2.27 asctime_r F
+GLIBC_2.27 asprintf F
+GLIBC_2.27 atof F
+GLIBC_2.27 atoi F
+GLIBC_2.27 atol F
+GLIBC_2.27 atoll F
+GLIBC_2.27 authdes_create F
+GLIBC_2.27 authdes_getucred F
+GLIBC_2.27 authdes_pk_create F
+GLIBC_2.27 authnone_create F
+GLIBC_2.27 authunix_create F
+GLIBC_2.27 authunix_create_default F
+GLIBC_2.27 backtrace F
+GLIBC_2.27 backtrace_symbols F
+GLIBC_2.27 backtrace_symbols_fd F
+GLIBC_2.27 basename F
+GLIBC_2.27 bcmp F
+GLIBC_2.27 bcopy F
+GLIBC_2.27 bind F
+GLIBC_2.27 bind_textdomain_codeset F
+GLIBC_2.27 bindresvport F
+GLIBC_2.27 bindtextdomain F
+GLIBC_2.27 brk F
+GLIBC_2.27 bsd_signal F
+GLIBC_2.27 bsearch F
+GLIBC_2.27 btowc F
+GLIBC_2.27 bzero F
+GLIBC_2.27 c16rtomb F
+GLIBC_2.27 c32rtomb F
+GLIBC_2.27 calloc F
+GLIBC_2.27 callrpc F
+GLIBC_2.27 canonicalize_file_name F
+GLIBC_2.27 capget F
+GLIBC_2.27 capset F
+GLIBC_2.27 catclose F
+GLIBC_2.27 catgets F
+GLIBC_2.27 catopen F
+GLIBC_2.27 cbc_crypt F
+GLIBC_2.27 cfgetispeed F
+GLIBC_2.27 cfgetospeed F
+GLIBC_2.27 cfmakeraw F
+GLIBC_2.27 cfsetispeed F
+GLIBC_2.27 cfsetospeed F
+GLIBC_2.27 cfsetspeed F
+GLIBC_2.27 chdir F
+GLIBC_2.27 chflags F
+GLIBC_2.27 chmod F
+GLIBC_2.27 chown F
+GLIBC_2.27 chroot F
+GLIBC_2.27 clearenv F
+GLIBC_2.27 clearerr F
+GLIBC_2.27 clearerr_unlocked F
+GLIBC_2.27 clnt_broadcast F
+GLIBC_2.27 clnt_create F
+GLIBC_2.27 clnt_pcreateerror F
+GLIBC_2.27 clnt_perrno F
+GLIBC_2.27 clnt_perror F
+GLIBC_2.27 clnt_spcreateerror F
+GLIBC_2.27 clnt_sperrno F
+GLIBC_2.27 clnt_sperror F
+GLIBC_2.27 clntraw_create F
+GLIBC_2.27 clnttcp_create F
+GLIBC_2.27 clntudp_bufcreate F
+GLIBC_2.27 clntudp_create F
+GLIBC_2.27 clntunix_create F
+GLIBC_2.27 clock F
+GLIBC_2.27 clock_adjtime F
+GLIBC_2.27 clock_getcpuclockid F
+GLIBC_2.27 clock_getres F
+GLIBC_2.27 clock_gettime F
+GLIBC_2.27 clock_nanosleep F
+GLIBC_2.27 clock_settime F
+GLIBC_2.27 clone F
+GLIBC_2.27 close F
+GLIBC_2.27 closedir F
+GLIBC_2.27 closelog F
+GLIBC_2.27 confstr F
+GLIBC_2.27 connect F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 copysign F
+GLIBC_2.27 copysignf F
+GLIBC_2.27 copysignl F
+GLIBC_2.27 creat F
+GLIBC_2.27 creat64 F
+GLIBC_2.27 ctermid F
+GLIBC_2.27 ctime F
+GLIBC_2.27 ctime_r F
+GLIBC_2.27 cuserid F
+GLIBC_2.27 daemon F
+GLIBC_2.27 daylight D 0x4
+GLIBC_2.27 dcgettext F
+GLIBC_2.27 dcngettext F
+GLIBC_2.27 delete_module F
+GLIBC_2.27 des_setparity F
+GLIBC_2.27 dgettext F
+GLIBC_2.27 difftime F
+GLIBC_2.27 dirfd F
+GLIBC_2.27 dirname F
+GLIBC_2.27 div F
+GLIBC_2.27 dl_iterate_phdr F
+GLIBC_2.27 dngettext F
+GLIBC_2.27 dprintf F
+GLIBC_2.27 drand48 F
+GLIBC_2.27 drand48_r F
+GLIBC_2.27 dup F
+GLIBC_2.27 dup2 F
+GLIBC_2.27 dup3 F
+GLIBC_2.27 duplocale F
+GLIBC_2.27 dysize F
+GLIBC_2.27 eaccess F
+GLIBC_2.27 ecb_crypt F
+GLIBC_2.27 ecvt F
+GLIBC_2.27 ecvt_r F
+GLIBC_2.27 endaliasent F
+GLIBC_2.27 endfsent F
+GLIBC_2.27 endgrent F
+GLIBC_2.27 endhostent F
+GLIBC_2.27 endmntent F
+GLIBC_2.27 endnetent F
+GLIBC_2.27 endnetgrent F
+GLIBC_2.27 endprotoent F
+GLIBC_2.27 endpwent F
+GLIBC_2.27 endrpcent F
+GLIBC_2.27 endservent F
+GLIBC_2.27 endsgent F
+GLIBC_2.27 endspent F
+GLIBC_2.27 endttyent F
+GLIBC_2.27 endusershell F
+GLIBC_2.27 endutent F
+GLIBC_2.27 endutxent F
+GLIBC_2.27 environ D 0x8
+GLIBC_2.27 envz_add F
+GLIBC_2.27 envz_entry F
+GLIBC_2.27 envz_get F
+GLIBC_2.27 envz_merge F
+GLIBC_2.27 envz_remove F
+GLIBC_2.27 envz_strip F
+GLIBC_2.27 epoll_create F
+GLIBC_2.27 epoll_create1 F
+GLIBC_2.27 epoll_ctl F
+GLIBC_2.27 epoll_pwait F
+GLIBC_2.27 epoll_wait F
+GLIBC_2.27 erand48 F
+GLIBC_2.27 erand48_r F
+GLIBC_2.27 err F
+GLIBC_2.27 error F
+GLIBC_2.27 error_at_line F
+GLIBC_2.27 error_message_count D 0x4
+GLIBC_2.27 error_one_per_line D 0x4
+GLIBC_2.27 error_print_progname D 0x8
+GLIBC_2.27 errx F
+GLIBC_2.27 ether_aton F
+GLIBC_2.27 ether_aton_r F
+GLIBC_2.27 ether_hostton F
+GLIBC_2.27 ether_line F
+GLIBC_2.27 ether_ntoa F
+GLIBC_2.27 ether_ntoa_r F
+GLIBC_2.27 ether_ntohost F
+GLIBC_2.27 euidaccess F
+GLIBC_2.27 eventfd F
+GLIBC_2.27 eventfd_read F
+GLIBC_2.27 eventfd_write F
+GLIBC_2.27 execl F
+GLIBC_2.27 execle F
+GLIBC_2.27 execlp F
+GLIBC_2.27 execv F
+GLIBC_2.27 execve F
+GLIBC_2.27 execvp F
+GLIBC_2.27 execvpe F
+GLIBC_2.27 exit F
+GLIBC_2.27 explicit_bzero F
+GLIBC_2.27 faccessat F
+GLIBC_2.27 fallocate F
+GLIBC_2.27 fallocate64 F
+GLIBC_2.27 fanotify_init F
+GLIBC_2.27 fanotify_mark F
+GLIBC_2.27 fattach F
+GLIBC_2.27 fchdir F
+GLIBC_2.27 fchflags F
+GLIBC_2.27 fchmod F
+GLIBC_2.27 fchmodat F
+GLIBC_2.27 fchown F
+GLIBC_2.27 fchownat F
+GLIBC_2.27 fclose F
+GLIBC_2.27 fcloseall F
+GLIBC_2.27 fcntl F
+GLIBC_2.27 fcvt F
+GLIBC_2.27 fcvt_r F
+GLIBC_2.27 fdatasync F
+GLIBC_2.27 fdetach F
+GLIBC_2.27 fdopen F
+GLIBC_2.27 fdopendir F
+GLIBC_2.27 feof F
+GLIBC_2.27 feof_unlocked F
+GLIBC_2.27 ferror F
+GLIBC_2.27 ferror_unlocked F
+GLIBC_2.27 fexecve F
+GLIBC_2.27 fflush F
+GLIBC_2.27 fflush_unlocked F
+GLIBC_2.27 ffs F
+GLIBC_2.27 ffsl F
+GLIBC_2.27 ffsll F
+GLIBC_2.27 fgetc F
+GLIBC_2.27 fgetc_unlocked F
+GLIBC_2.27 fgetgrent F
+GLIBC_2.27 fgetgrent_r F
+GLIBC_2.27 fgetpos F
+GLIBC_2.27 fgetpos64 F
+GLIBC_2.27 fgetpwent F
+GLIBC_2.27 fgetpwent_r F
+GLIBC_2.27 fgets F
+GLIBC_2.27 fgets_unlocked F
+GLIBC_2.27 fgetsgent F
+GLIBC_2.27 fgetsgent_r F
+GLIBC_2.27 fgetspent F
+GLIBC_2.27 fgetspent_r F
+GLIBC_2.27 fgetwc F
+GLIBC_2.27 fgetwc_unlocked F
+GLIBC_2.27 fgetws F
+GLIBC_2.27 fgetws_unlocked F
+GLIBC_2.27 fgetxattr F
+GLIBC_2.27 fileno F
+GLIBC_2.27 fileno_unlocked F
+GLIBC_2.27 finite F
+GLIBC_2.27 finitef F
+GLIBC_2.27 finitel F
+GLIBC_2.27 flistxattr F
+GLIBC_2.27 flock F
+GLIBC_2.27 flockfile F
+GLIBC_2.27 fmemopen F
+GLIBC_2.27 fmtmsg F
+GLIBC_2.27 fnmatch F
+GLIBC_2.27 fopen F
+GLIBC_2.27 fopen64 F
+GLIBC_2.27 fopencookie F
+GLIBC_2.27 fork F
+GLIBC_2.27 fpathconf F
+GLIBC_2.27 fprintf F
+GLIBC_2.27 fputc F
+GLIBC_2.27 fputc_unlocked F
+GLIBC_2.27 fputs F
+GLIBC_2.27 fputs_unlocked F
+GLIBC_2.27 fputwc F
+GLIBC_2.27 fputwc_unlocked F
+GLIBC_2.27 fputws F
+GLIBC_2.27 fputws_unlocked F
+GLIBC_2.27 fread F
+GLIBC_2.27 fread_unlocked F
+GLIBC_2.27 free F
+GLIBC_2.27 freeaddrinfo F
+GLIBC_2.27 freeifaddrs F
+GLIBC_2.27 freelocale F
+GLIBC_2.27 fremovexattr F
+GLIBC_2.27 freopen F
+GLIBC_2.27 freopen64 F
+GLIBC_2.27 frexp F
+GLIBC_2.27 frexpf F
+GLIBC_2.27 frexpl F
+GLIBC_2.27 fscanf F
+GLIBC_2.27 fseek F
+GLIBC_2.27 fseeko F
+GLIBC_2.27 fseeko64 F
+GLIBC_2.27 fsetpos F
+GLIBC_2.27 fsetpos64 F
+GLIBC_2.27 fsetxattr F
+GLIBC_2.27 fstatfs F
+GLIBC_2.27 fstatfs64 F
+GLIBC_2.27 fstatvfs F
+GLIBC_2.27 fstatvfs64 F
+GLIBC_2.27 fsync F
+GLIBC_2.27 ftell F
+GLIBC_2.27 ftello F
+GLIBC_2.27 ftello64 F
+GLIBC_2.27 ftime F
+GLIBC_2.27 ftok F
+GLIBC_2.27 ftruncate F
+GLIBC_2.27 ftruncate64 F
+GLIBC_2.27 ftrylockfile F
+GLIBC_2.27 fts64_children F
+GLIBC_2.27 fts64_close F
+GLIBC_2.27 fts64_open F
+GLIBC_2.27 fts64_read F
+GLIBC_2.27 fts64_set F
+GLIBC_2.27 fts_children F
+GLIBC_2.27 fts_close F
+GLIBC_2.27 fts_open F
+GLIBC_2.27 fts_read F
+GLIBC_2.27 fts_set F
+GLIBC_2.27 ftw F
+GLIBC_2.27 ftw64 F
+GLIBC_2.27 funlockfile F
+GLIBC_2.27 futimens F
+GLIBC_2.27 futimes F
+GLIBC_2.27 futimesat F
+GLIBC_2.27 fwide F
+GLIBC_2.27 fwprintf F
+GLIBC_2.27 fwrite F
+GLIBC_2.27 fwrite_unlocked F
+GLIBC_2.27 fwscanf F
+GLIBC_2.27 gai_strerror F
+GLIBC_2.27 gcvt F
+GLIBC_2.27 get_avphys_pages F
+GLIBC_2.27 get_current_dir_name F
+GLIBC_2.27 get_myaddress F
+GLIBC_2.27 get_nprocs F
+GLIBC_2.27 get_nprocs_conf F
+GLIBC_2.27 get_phys_pages F
+GLIBC_2.27 getaddrinfo F
+GLIBC_2.27 getaliasbyname F
+GLIBC_2.27 getaliasbyname_r F
+GLIBC_2.27 getaliasent F
+GLIBC_2.27 getaliasent_r F
+GLIBC_2.27 getauxval F
+GLIBC_2.27 getc F
+GLIBC_2.27 getc_unlocked F
+GLIBC_2.27 getchar F
+GLIBC_2.27 getchar_unlocked F
+GLIBC_2.27 getcontext F
+GLIBC_2.27 getcwd F
+GLIBC_2.27 getdate F
+GLIBC_2.27 getdate_err D 0x4
+GLIBC_2.27 getdate_r F
+GLIBC_2.27 getdelim F
+GLIBC_2.27 getdirentries F
+GLIBC_2.27 getdirentries64 F
+GLIBC_2.27 getdomainname F
+GLIBC_2.27 getdtablesize F
+GLIBC_2.27 getegid F
+GLIBC_2.27 getentropy F
+GLIBC_2.27 getenv F
+GLIBC_2.27 geteuid F
+GLIBC_2.27 getfsent F
+GLIBC_2.27 getfsfile F
+GLIBC_2.27 getfsspec F
+GLIBC_2.27 getgid F
+GLIBC_2.27 getgrent F
+GLIBC_2.27 getgrent_r F
+GLIBC_2.27 getgrgid F
+GLIBC_2.27 getgrgid_r F
+GLIBC_2.27 getgrnam F
+GLIBC_2.27 getgrnam_r F
+GLIBC_2.27 getgrouplist F
+GLIBC_2.27 getgroups F
+GLIBC_2.27 gethostbyaddr F
+GLIBC_2.27 gethostbyaddr_r F
+GLIBC_2.27 gethostbyname F
+GLIBC_2.27 gethostbyname2 F
+GLIBC_2.27 gethostbyname2_r F
+GLIBC_2.27 gethostbyname_r F
+GLIBC_2.27 gethostent F
+GLIBC_2.27 gethostent_r F
+GLIBC_2.27 gethostid F
+GLIBC_2.27 gethostname F
+GLIBC_2.27 getifaddrs F
+GLIBC_2.27 getipv4sourcefilter F
+GLIBC_2.27 getitimer F
+GLIBC_2.27 getline F
+GLIBC_2.27 getloadavg F
+GLIBC_2.27 getlogin F
+GLIBC_2.27 getlogin_r F
+GLIBC_2.27 getmntent F
+GLIBC_2.27 getmntent_r F
+GLIBC_2.27 getmsg F
+GLIBC_2.27 getnameinfo F
+GLIBC_2.27 getnetbyaddr F
+GLIBC_2.27 getnetbyaddr_r F
+GLIBC_2.27 getnetbyname F
+GLIBC_2.27 getnetbyname_r F
+GLIBC_2.27 getnetent F
+GLIBC_2.27 getnetent_r F
+GLIBC_2.27 getnetgrent F
+GLIBC_2.27 getnetgrent_r F
+GLIBC_2.27 getnetname F
+GLIBC_2.27 getopt F
+GLIBC_2.27 getopt_long F
+GLIBC_2.27 getopt_long_only F
+GLIBC_2.27 getpagesize F
+GLIBC_2.27 getpass F
+GLIBC_2.27 getpeername F
+GLIBC_2.27 getpgid F
+GLIBC_2.27 getpgrp F
+GLIBC_2.27 getpid F
+GLIBC_2.27 getpmsg F
+GLIBC_2.27 getppid F
+GLIBC_2.27 getpriority F
+GLIBC_2.27 getprotobyname F
+GLIBC_2.27 getprotobyname_r F
+GLIBC_2.27 getprotobynumber F
+GLIBC_2.27 getprotobynumber_r F
+GLIBC_2.27 getprotoent F
+GLIBC_2.27 getprotoent_r F
+GLIBC_2.27 getpt F
+GLIBC_2.27 getpublickey F
+GLIBC_2.27 getpw F
+GLIBC_2.27 getpwent F
+GLIBC_2.27 getpwent_r F
+GLIBC_2.27 getpwnam F
+GLIBC_2.27 getpwnam_r F
+GLIBC_2.27 getpwuid F
+GLIBC_2.27 getpwuid_r F
+GLIBC_2.27 getrandom F
+GLIBC_2.27 getresgid F
+GLIBC_2.27 getresuid F
+GLIBC_2.27 getrlimit F
+GLIBC_2.27 getrlimit64 F
+GLIBC_2.27 getrpcbyname F
+GLIBC_2.27 getrpcbyname_r F
+GLIBC_2.27 getrpcbynumber F
+GLIBC_2.27 getrpcbynumber_r F
+GLIBC_2.27 getrpcent F
+GLIBC_2.27 getrpcent_r F
+GLIBC_2.27 getrpcport F
+GLIBC_2.27 getrusage F
+GLIBC_2.27 gets F
+GLIBC_2.27 getsecretkey F
+GLIBC_2.27 getservbyname F
+GLIBC_2.27 getservbyname_r F
+GLIBC_2.27 getservbyport F
+GLIBC_2.27 getservbyport_r F
+GLIBC_2.27 getservent F
+GLIBC_2.27 getservent_r F
+GLIBC_2.27 getsgent F
+GLIBC_2.27 getsgent_r F
+GLIBC_2.27 getsgnam F
+GLIBC_2.27 getsgnam_r F
+GLIBC_2.27 getsid F
+GLIBC_2.27 getsockname F
+GLIBC_2.27 getsockopt F
+GLIBC_2.27 getsourcefilter F
+GLIBC_2.27 getspent F
+GLIBC_2.27 getspent_r F
+GLIBC_2.27 getspnam F
+GLIBC_2.27 getspnam_r F
+GLIBC_2.27 getsubopt F
+GLIBC_2.27 gettext F
+GLIBC_2.27 gettimeofday F
+GLIBC_2.27 getttyent F
+GLIBC_2.27 getttynam F
+GLIBC_2.27 getuid F
+GLIBC_2.27 getusershell F
+GLIBC_2.27 getutent F
+GLIBC_2.27 getutent_r F
+GLIBC_2.27 getutid F
+GLIBC_2.27 getutid_r F
+GLIBC_2.27 getutline F
+GLIBC_2.27 getutline_r F
+GLIBC_2.27 getutmp F
+GLIBC_2.27 getutmpx F
+GLIBC_2.27 getutxent F
+GLIBC_2.27 getutxid F
+GLIBC_2.27 getutxline F
+GLIBC_2.27 getw F
+GLIBC_2.27 getwc F
+GLIBC_2.27 getwc_unlocked F
+GLIBC_2.27 getwchar F
+GLIBC_2.27 getwchar_unlocked F
+GLIBC_2.27 getwd F
+GLIBC_2.27 getxattr F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 glob_pattern_p F
+GLIBC_2.27 globfree F
+GLIBC_2.27 globfree64 F
+GLIBC_2.27 gmtime F
+GLIBC_2.27 gmtime_r F
+GLIBC_2.27 gnu_dev_major F
+GLIBC_2.27 gnu_dev_makedev F
+GLIBC_2.27 gnu_dev_minor F
+GLIBC_2.27 gnu_get_libc_release F
+GLIBC_2.27 gnu_get_libc_version F
+GLIBC_2.27 grantpt F
+GLIBC_2.27 group_member F
+GLIBC_2.27 gsignal F
+GLIBC_2.27 gtty F
+GLIBC_2.27 h_errlist D 0x28
+GLIBC_2.27 h_nerr D 0x4
+GLIBC_2.27 hasmntopt F
+GLIBC_2.27 hcreate F
+GLIBC_2.27 hcreate_r F
+GLIBC_2.27 hdestroy F
+GLIBC_2.27 hdestroy_r F
+GLIBC_2.27 herror F
+GLIBC_2.27 host2netname F
+GLIBC_2.27 hsearch F
+GLIBC_2.27 hsearch_r F
+GLIBC_2.27 hstrerror F
+GLIBC_2.27 htonl F
+GLIBC_2.27 htons F
+GLIBC_2.27 iconv F
+GLIBC_2.27 iconv_close F
+GLIBC_2.27 iconv_open F
+GLIBC_2.27 if_freenameindex F
+GLIBC_2.27 if_indextoname F
+GLIBC_2.27 if_nameindex F
+GLIBC_2.27 if_nametoindex F
+GLIBC_2.27 imaxabs F
+GLIBC_2.27 imaxdiv F
+GLIBC_2.27 in6addr_any D 0x10
+GLIBC_2.27 in6addr_loopback D 0x10
+GLIBC_2.27 index F
+GLIBC_2.27 inet6_opt_append F
+GLIBC_2.27 inet6_opt_find F
+GLIBC_2.27 inet6_opt_finish F
+GLIBC_2.27 inet6_opt_get_val F
+GLIBC_2.27 inet6_opt_init F
+GLIBC_2.27 inet6_opt_next F
+GLIBC_2.27 inet6_opt_set_val F
+GLIBC_2.27 inet6_option_alloc F
+GLIBC_2.27 inet6_option_append F
+GLIBC_2.27 inet6_option_find F
+GLIBC_2.27 inet6_option_init F
+GLIBC_2.27 inet6_option_next F
+GLIBC_2.27 inet6_option_space F
+GLIBC_2.27 inet6_rth_add F
+GLIBC_2.27 inet6_rth_getaddr F
+GLIBC_2.27 inet6_rth_init F
+GLIBC_2.27 inet6_rth_reverse F
+GLIBC_2.27 inet6_rth_segments F
+GLIBC_2.27 inet6_rth_space F
+GLIBC_2.27 inet_addr F
+GLIBC_2.27 inet_aton F
+GLIBC_2.27 inet_lnaof F
+GLIBC_2.27 inet_makeaddr F
+GLIBC_2.27 inet_netof F
+GLIBC_2.27 inet_network F
+GLIBC_2.27 inet_nsap_addr F
+GLIBC_2.27 inet_nsap_ntoa F
+GLIBC_2.27 inet_ntoa F
+GLIBC_2.27 inet_ntop F
+GLIBC_2.27 inet_pton F
+GLIBC_2.27 init_module F
+GLIBC_2.27 initgroups F
+GLIBC_2.27 initstate F
+GLIBC_2.27 initstate_r F
+GLIBC_2.27 innetgr F
+GLIBC_2.27 inotify_add_watch F
+GLIBC_2.27 inotify_init F
+GLIBC_2.27 inotify_init1 F
+GLIBC_2.27 inotify_rm_watch F
+GLIBC_2.27 insque F
+GLIBC_2.27 ioctl F
+GLIBC_2.27 iruserok F
+GLIBC_2.27 iruserok_af F
+GLIBC_2.27 isalnum F
+GLIBC_2.27 isalnum_l F
+GLIBC_2.27 isalpha F
+GLIBC_2.27 isalpha_l F
+GLIBC_2.27 isascii F
+GLIBC_2.27 isastream F
+GLIBC_2.27 isatty F
+GLIBC_2.27 isblank F
+GLIBC_2.27 isblank_l F
+GLIBC_2.27 iscntrl F
+GLIBC_2.27 iscntrl_l F
+GLIBC_2.27 isctype F
+GLIBC_2.27 isdigit F
+GLIBC_2.27 isdigit_l F
+GLIBC_2.27 isfdtype F
+GLIBC_2.27 isgraph F
+GLIBC_2.27 isgraph_l F
+GLIBC_2.27 isinf F
+GLIBC_2.27 isinff F
+GLIBC_2.27 isinfl F
+GLIBC_2.27 islower F
+GLIBC_2.27 islower_l F
+GLIBC_2.27 isnan F
+GLIBC_2.27 isnanf F
+GLIBC_2.27 isnanl F
+GLIBC_2.27 isprint F
+GLIBC_2.27 isprint_l F
+GLIBC_2.27 ispunct F
+GLIBC_2.27 ispunct_l F
+GLIBC_2.27 isspace F
+GLIBC_2.27 isspace_l F
+GLIBC_2.27 isupper F
+GLIBC_2.27 isupper_l F
+GLIBC_2.27 iswalnum F
+GLIBC_2.27 iswalnum_l F
+GLIBC_2.27 iswalpha F
+GLIBC_2.27 iswalpha_l F
+GLIBC_2.27 iswblank F
+GLIBC_2.27 iswblank_l F
+GLIBC_2.27 iswcntrl F
+GLIBC_2.27 iswcntrl_l F
+GLIBC_2.27 iswctype F
+GLIBC_2.27 iswctype_l F
+GLIBC_2.27 iswdigit F
+GLIBC_2.27 iswdigit_l F
+GLIBC_2.27 iswgraph F
+GLIBC_2.27 iswgraph_l F
+GLIBC_2.27 iswlower F
+GLIBC_2.27 iswlower_l F
+GLIBC_2.27 iswprint F
+GLIBC_2.27 iswprint_l F
+GLIBC_2.27 iswpunct F
+GLIBC_2.27 iswpunct_l F
+GLIBC_2.27 iswspace F
+GLIBC_2.27 iswspace_l F
+GLIBC_2.27 iswupper F
+GLIBC_2.27 iswupper_l F
+GLIBC_2.27 iswxdigit F
+GLIBC_2.27 iswxdigit_l F
+GLIBC_2.27 isxdigit F
+GLIBC_2.27 isxdigit_l F
+GLIBC_2.27 jrand48 F
+GLIBC_2.27 jrand48_r F
+GLIBC_2.27 key_decryptsession F
+GLIBC_2.27 key_decryptsession_pk F
+GLIBC_2.27 key_encryptsession F
+GLIBC_2.27 key_encryptsession_pk F
+GLIBC_2.27 key_gendes F
+GLIBC_2.27 key_get_conv F
+GLIBC_2.27 key_secretkey_is_set F
+GLIBC_2.27 key_setnet F
+GLIBC_2.27 key_setsecret F
+GLIBC_2.27 kill F
+GLIBC_2.27 killpg F
+GLIBC_2.27 klogctl F
+GLIBC_2.27 l64a F
+GLIBC_2.27 labs F
+GLIBC_2.27 lchmod F
+GLIBC_2.27 lchown F
+GLIBC_2.27 lckpwdf F
+GLIBC_2.27 lcong48 F
+GLIBC_2.27 lcong48_r F
+GLIBC_2.27 ldexp F
+GLIBC_2.27 ldexpf F
+GLIBC_2.27 ldexpl F
+GLIBC_2.27 ldiv F
+GLIBC_2.27 lfind F
+GLIBC_2.27 lgetxattr F
+GLIBC_2.27 link F
+GLIBC_2.27 linkat F
+GLIBC_2.27 listen F
+GLIBC_2.27 listxattr F
+GLIBC_2.27 llabs F
+GLIBC_2.27 lldiv F
+GLIBC_2.27 llistxattr F
+GLIBC_2.27 llseek F
+GLIBC_2.27 localeconv F
+GLIBC_2.27 localtime F
+GLIBC_2.27 localtime_r F
+GLIBC_2.27 lockf F
+GLIBC_2.27 lockf64 F
+GLIBC_2.27 longjmp F
+GLIBC_2.27 lrand48 F
+GLIBC_2.27 lrand48_r F
+GLIBC_2.27 lremovexattr F
+GLIBC_2.27 lsearch F
+GLIBC_2.27 lseek F
+GLIBC_2.27 lseek64 F
+GLIBC_2.27 lsetxattr F
+GLIBC_2.27 lutimes F
+GLIBC_2.27 madvise F
+GLIBC_2.27 makecontext F
+GLIBC_2.27 mallinfo F
+GLIBC_2.27 malloc F
+GLIBC_2.27 malloc_info F
+GLIBC_2.27 malloc_stats F
+GLIBC_2.27 malloc_trim F
+GLIBC_2.27 malloc_usable_size F
+GLIBC_2.27 mallopt F
+GLIBC_2.27 mallwatch D 0x8
+GLIBC_2.27 mblen F
+GLIBC_2.27 mbrlen F
+GLIBC_2.27 mbrtoc16 F
+GLIBC_2.27 mbrtoc32 F
+GLIBC_2.27 mbrtowc F
+GLIBC_2.27 mbsinit F
+GLIBC_2.27 mbsnrtowcs F
+GLIBC_2.27 mbsrtowcs F
+GLIBC_2.27 mbstowcs F
+GLIBC_2.27 mbtowc F
+GLIBC_2.27 mcheck F
+GLIBC_2.27 mcheck_check_all F
+GLIBC_2.27 mcheck_pedantic F
+GLIBC_2.27 memalign F
+GLIBC_2.27 memccpy F
+GLIBC_2.27 memchr F
+GLIBC_2.27 memcmp F
+GLIBC_2.27 memcpy F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 memfrob F
+GLIBC_2.27 memmem F
+GLIBC_2.27 memmove F
+GLIBC_2.27 mempcpy F
+GLIBC_2.27 memrchr F
+GLIBC_2.27 memset F
+GLIBC_2.27 mincore F
+GLIBC_2.27 mkdir F
+GLIBC_2.27 mkdirat F
+GLIBC_2.27 mkdtemp F
+GLIBC_2.27 mkfifo F
+GLIBC_2.27 mkfifoat F
+GLIBC_2.27 mkostemp F
+GLIBC_2.27 mkostemp64 F
+GLIBC_2.27 mkostemps F
+GLIBC_2.27 mkostemps64 F
+GLIBC_2.27 mkstemp F
+GLIBC_2.27 mkstemp64 F
+GLIBC_2.27 mkstemps F
+GLIBC_2.27 mkstemps64 F
+GLIBC_2.27 mktemp F
+GLIBC_2.27 mktime F
+GLIBC_2.27 mlock F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 mlockall F
+GLIBC_2.27 mmap F
+GLIBC_2.27 mmap64 F
+GLIBC_2.27 modf F
+GLIBC_2.27 modff F
+GLIBC_2.27 modfl F
+GLIBC_2.27 moncontrol F
+GLIBC_2.27 monstartup F
+GLIBC_2.27 mount F
+GLIBC_2.27 mprobe F
+GLIBC_2.27 mprotect F
+GLIBC_2.27 mrand48 F
+GLIBC_2.27 mrand48_r F
+GLIBC_2.27 mremap F
+GLIBC_2.27 msgctl F
+GLIBC_2.27 msgget F
+GLIBC_2.27 msgrcv F
+GLIBC_2.27 msgsnd F
+GLIBC_2.27 msync F
+GLIBC_2.27 mtrace F
+GLIBC_2.27 munlock F
+GLIBC_2.27 munlockall F
+GLIBC_2.27 munmap F
+GLIBC_2.27 muntrace F
+GLIBC_2.27 name_to_handle_at F
+GLIBC_2.27 nanosleep F
+GLIBC_2.27 netname2host F
+GLIBC_2.27 netname2user F
+GLIBC_2.27 newlocale F
+GLIBC_2.27 nfsservctl F
+GLIBC_2.27 nftw F
+GLIBC_2.27 nftw64 F
+GLIBC_2.27 ngettext F
+GLIBC_2.27 nice F
+GLIBC_2.27 nl_langinfo F
+GLIBC_2.27 nl_langinfo_l F
+GLIBC_2.27 nrand48 F
+GLIBC_2.27 nrand48_r F
+GLIBC_2.27 ntohl F
+GLIBC_2.27 ntohs F
+GLIBC_2.27 ntp_adjtime F
+GLIBC_2.27 ntp_gettime F
+GLIBC_2.27 ntp_gettimex F
+GLIBC_2.27 obstack_alloc_failed_handler D 0x8
+GLIBC_2.27 obstack_exit_failure D 0x4
+GLIBC_2.27 obstack_free F
+GLIBC_2.27 obstack_printf F
+GLIBC_2.27 obstack_vprintf F
+GLIBC_2.27 on_exit F
+GLIBC_2.27 open F
+GLIBC_2.27 open64 F
+GLIBC_2.27 open_by_handle_at F
+GLIBC_2.27 open_memstream F
+GLIBC_2.27 open_wmemstream F
+GLIBC_2.27 openat F
+GLIBC_2.27 openat64 F
+GLIBC_2.27 opendir F
+GLIBC_2.27 openlog F
+GLIBC_2.27 optarg D 0x8
+GLIBC_2.27 opterr D 0x4
+GLIBC_2.27 optind D 0x4
+GLIBC_2.27 optopt D 0x4
+GLIBC_2.27 parse_printf_format F
+GLIBC_2.27 passwd2des F
+GLIBC_2.27 pathconf F
+GLIBC_2.27 pause F
+GLIBC_2.27 pclose F
+GLIBC_2.27 perror F
+GLIBC_2.27 personality F
+GLIBC_2.27 pipe F
+GLIBC_2.27 pipe2 F
+GLIBC_2.27 pivot_root F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 pmap_getmaps F
+GLIBC_2.27 pmap_getport F
+GLIBC_2.27 pmap_rmtcall F
+GLIBC_2.27 pmap_set F
+GLIBC_2.27 pmap_unset F
+GLIBC_2.27 poll F
+GLIBC_2.27 popen F
+GLIBC_2.27 posix_fadvise F
+GLIBC_2.27 posix_fadvise64 F
+GLIBC_2.27 posix_fallocate F
+GLIBC_2.27 posix_fallocate64 F
+GLIBC_2.27 posix_madvise F
+GLIBC_2.27 posix_memalign F
+GLIBC_2.27 posix_openpt F
+GLIBC_2.27 posix_spawn F
+GLIBC_2.27 posix_spawn_file_actions_addclose F
+GLIBC_2.27 posix_spawn_file_actions_adddup2 F
+GLIBC_2.27 posix_spawn_file_actions_addopen F
+GLIBC_2.27 posix_spawn_file_actions_destroy F
+GLIBC_2.27 posix_spawn_file_actions_init F
+GLIBC_2.27 posix_spawnattr_destroy F
+GLIBC_2.27 posix_spawnattr_getflags F
+GLIBC_2.27 posix_spawnattr_getpgroup F
+GLIBC_2.27 posix_spawnattr_getschedparam F
+GLIBC_2.27 posix_spawnattr_getschedpolicy F
+GLIBC_2.27 posix_spawnattr_getsigdefault F
+GLIBC_2.27 posix_spawnattr_getsigmask F
+GLIBC_2.27 posix_spawnattr_init F
+GLIBC_2.27 posix_spawnattr_setflags F
+GLIBC_2.27 posix_spawnattr_setpgroup F
+GLIBC_2.27 posix_spawnattr_setschedparam F
+GLIBC_2.27 posix_spawnattr_setschedpolicy F
+GLIBC_2.27 posix_spawnattr_setsigdefault F
+GLIBC_2.27 posix_spawnattr_setsigmask F
+GLIBC_2.27 posix_spawnp F
+GLIBC_2.27 ppoll F
+GLIBC_2.27 prctl F
+GLIBC_2.27 pread F
+GLIBC_2.27 pread64 F
+GLIBC_2.27 preadv F
+GLIBC_2.27 preadv2 F
+GLIBC_2.27 preadv64 F
+GLIBC_2.27 preadv64v2 F
+GLIBC_2.27 printf F
+GLIBC_2.27 printf_size F
+GLIBC_2.27 printf_size_info F
+GLIBC_2.27 prlimit F
+GLIBC_2.27 prlimit64 F
+GLIBC_2.27 process_vm_readv F
+GLIBC_2.27 process_vm_writev F
+GLIBC_2.27 profil F
+GLIBC_2.27 program_invocation_name D 0x8
+GLIBC_2.27 program_invocation_short_name D 0x8
+GLIBC_2.27 pselect F
+GLIBC_2.27 psiginfo F
+GLIBC_2.27 psignal F
+GLIBC_2.27 pthread_attr_destroy F
+GLIBC_2.27 pthread_attr_getdetachstate F
+GLIBC_2.27 pthread_attr_getinheritsched F
+GLIBC_2.27 pthread_attr_getschedparam F
+GLIBC_2.27 pthread_attr_getschedpolicy F
+GLIBC_2.27 pthread_attr_getscope F
+GLIBC_2.27 pthread_attr_init F
+GLIBC_2.27 pthread_attr_setdetachstate F
+GLIBC_2.27 pthread_attr_setinheritsched F
+GLIBC_2.27 pthread_attr_setschedparam F
+GLIBC_2.27 pthread_attr_setschedpolicy F
+GLIBC_2.27 pthread_attr_setscope F
+GLIBC_2.27 pthread_cond_broadcast F
+GLIBC_2.27 pthread_cond_destroy F
+GLIBC_2.27 pthread_cond_init F
+GLIBC_2.27 pthread_cond_signal F
+GLIBC_2.27 pthread_cond_timedwait F
+GLIBC_2.27 pthread_cond_wait F
+GLIBC_2.27 pthread_condattr_destroy F
+GLIBC_2.27 pthread_condattr_init F
+GLIBC_2.27 pthread_equal F
+GLIBC_2.27 pthread_exit F
+GLIBC_2.27 pthread_getschedparam F
+GLIBC_2.27 pthread_mutex_destroy F
+GLIBC_2.27 pthread_mutex_init F
+GLIBC_2.27 pthread_mutex_lock F
+GLIBC_2.27 pthread_mutex_unlock F
+GLIBC_2.27 pthread_self F
+GLIBC_2.27 pthread_setcancelstate F
+GLIBC_2.27 pthread_setcanceltype F
+GLIBC_2.27 pthread_setschedparam F
+GLIBC_2.27 ptrace F
+GLIBC_2.27 ptsname F
+GLIBC_2.27 ptsname_r F
+GLIBC_2.27 putc F
+GLIBC_2.27 putc_unlocked F
+GLIBC_2.27 putchar F
+GLIBC_2.27 putchar_unlocked F
+GLIBC_2.27 putenv F
+GLIBC_2.27 putgrent F
+GLIBC_2.27 putmsg F
+GLIBC_2.27 putpmsg F
+GLIBC_2.27 putpwent F
+GLIBC_2.27 puts F
+GLIBC_2.27 putsgent F
+GLIBC_2.27 putspent F
+GLIBC_2.27 pututline F
+GLIBC_2.27 pututxline F
+GLIBC_2.27 putw F
+GLIBC_2.27 putwc F
+GLIBC_2.27 putwc_unlocked F
+GLIBC_2.27 putwchar F
+GLIBC_2.27 putwchar_unlocked F
+GLIBC_2.27 pvalloc F
+GLIBC_2.27 pwrite F
+GLIBC_2.27 pwrite64 F
+GLIBC_2.27 pwritev F
+GLIBC_2.27 pwritev2 F
+GLIBC_2.27 pwritev64 F
+GLIBC_2.27 pwritev64v2 F
+GLIBC_2.27 qecvt F
+GLIBC_2.27 qecvt_r F
+GLIBC_2.27 qfcvt F
+GLIBC_2.27 qfcvt_r F
+GLIBC_2.27 qgcvt F
+GLIBC_2.27 qsort F
+GLIBC_2.27 qsort_r F
+GLIBC_2.27 quick_exit F
+GLIBC_2.27 quotactl F
+GLIBC_2.27 raise F
+GLIBC_2.27 rand F
+GLIBC_2.27 rand_r F
+GLIBC_2.27 random F
+GLIBC_2.27 random_r F
+GLIBC_2.27 rawmemchr F
+GLIBC_2.27 rcmd F
+GLIBC_2.27 rcmd_af F
+GLIBC_2.27 re_comp F
+GLIBC_2.27 re_compile_fastmap F
+GLIBC_2.27 re_compile_pattern F
+GLIBC_2.27 re_exec F
+GLIBC_2.27 re_match F
+GLIBC_2.27 re_match_2 F
+GLIBC_2.27 re_search F
+GLIBC_2.27 re_search_2 F
+GLIBC_2.27 re_set_registers F
+GLIBC_2.27 re_set_syntax F
+GLIBC_2.27 re_syntax_options D 0x8
+GLIBC_2.27 read F
+GLIBC_2.27 readahead F
+GLIBC_2.27 readdir F
+GLIBC_2.27 readdir64 F
+GLIBC_2.27 readdir64_r F
+GLIBC_2.27 readdir_r F
+GLIBC_2.27 readlink F
+GLIBC_2.27 readlinkat F
+GLIBC_2.27 readv F
+GLIBC_2.27 realloc F
+GLIBC_2.27 reallocarray F
+GLIBC_2.27 realpath F
+GLIBC_2.27 reboot F
+GLIBC_2.27 recv F
+GLIBC_2.27 recvfrom F
+GLIBC_2.27 recvmmsg F
+GLIBC_2.27 recvmsg F
+GLIBC_2.27 regcomp F
+GLIBC_2.27 regerror F
+GLIBC_2.27 regexec F
+GLIBC_2.27 regfree F
+GLIBC_2.27 register_printf_function F
+GLIBC_2.27 register_printf_modifier F
+GLIBC_2.27 register_printf_specifier F
+GLIBC_2.27 register_printf_type F
+GLIBC_2.27 registerrpc F
+GLIBC_2.27 remap_file_pages F
+GLIBC_2.27 remove F
+GLIBC_2.27 removexattr F
+GLIBC_2.27 remque F
+GLIBC_2.27 rename F
+GLIBC_2.27 renameat F
+GLIBC_2.27 revoke F
+GLIBC_2.27 rewind F
+GLIBC_2.27 rewinddir F
+GLIBC_2.27 rexec F
+GLIBC_2.27 rexec_af F
+GLIBC_2.27 rexecoptions D 0x4
+GLIBC_2.27 rindex F
+GLIBC_2.27 rmdir F
+GLIBC_2.27 rpc_createerr D 0x20
+GLIBC_2.27 rpmatch F
+GLIBC_2.27 rresvport F
+GLIBC_2.27 rresvport_af F
+GLIBC_2.27 rtime F
+GLIBC_2.27 ruserok F
+GLIBC_2.27 ruserok_af F
+GLIBC_2.27 ruserpass F
+GLIBC_2.27 sbrk F
+GLIBC_2.27 scalbn F
+GLIBC_2.27 scalbnf F
+GLIBC_2.27 scalbnl F
+GLIBC_2.27 scandir F
+GLIBC_2.27 scandir64 F
+GLIBC_2.27 scandirat F
+GLIBC_2.27 scandirat64 F
+GLIBC_2.27 scanf F
+GLIBC_2.27 sched_get_priority_max F
+GLIBC_2.27 sched_get_priority_min F
+GLIBC_2.27 sched_getaffinity F
+GLIBC_2.27 sched_getcpu F
+GLIBC_2.27 sched_getparam F
+GLIBC_2.27 sched_getscheduler F
+GLIBC_2.27 sched_rr_get_interval F
+GLIBC_2.27 sched_setaffinity F
+GLIBC_2.27 sched_setparam F
+GLIBC_2.27 sched_setscheduler F
+GLIBC_2.27 sched_yield F
+GLIBC_2.27 secure_getenv F
+GLIBC_2.27 seed48 F
+GLIBC_2.27 seed48_r F
+GLIBC_2.27 seekdir F
+GLIBC_2.27 select F
+GLIBC_2.27 semctl F
+GLIBC_2.27 semget F
+GLIBC_2.27 semop F
+GLIBC_2.27 semtimedop F
+GLIBC_2.27 send F
+GLIBC_2.27 sendfile F
+GLIBC_2.27 sendfile64 F
+GLIBC_2.27 sendmmsg F
+GLIBC_2.27 sendmsg F
+GLIBC_2.27 sendto F
+GLIBC_2.27 setaliasent F
+GLIBC_2.27 setbuf F
+GLIBC_2.27 setbuffer F
+GLIBC_2.27 setcontext F
+GLIBC_2.27 setdomainname F
+GLIBC_2.27 setegid F
+GLIBC_2.27 setenv F
+GLIBC_2.27 seteuid F
+GLIBC_2.27 setfsent F
+GLIBC_2.27 setfsgid F
+GLIBC_2.27 setfsuid F
+GLIBC_2.27 setgid F
+GLIBC_2.27 setgrent F
+GLIBC_2.27 setgroups F
+GLIBC_2.27 sethostent F
+GLIBC_2.27 sethostid F
+GLIBC_2.27 sethostname F
+GLIBC_2.27 setipv4sourcefilter F
+GLIBC_2.27 setitimer F
+GLIBC_2.27 setjmp F
+GLIBC_2.27 setlinebuf F
+GLIBC_2.27 setlocale F
+GLIBC_2.27 setlogin F
+GLIBC_2.27 setlogmask F
+GLIBC_2.27 setmntent F
+GLIBC_2.27 setnetent F
+GLIBC_2.27 setnetgrent F
+GLIBC_2.27 setns F
+GLIBC_2.27 setpgid F
+GLIBC_2.27 setpgrp F
+GLIBC_2.27 setpriority F
+GLIBC_2.27 setprotoent F
+GLIBC_2.27 setpwent F
+GLIBC_2.27 setregid F
+GLIBC_2.27 setresgid F
+GLIBC_2.27 setresuid F
+GLIBC_2.27 setreuid F
+GLIBC_2.27 setrlimit F
+GLIBC_2.27 setrlimit64 F
+GLIBC_2.27 setrpcent F
+GLIBC_2.27 setservent F
+GLIBC_2.27 setsgent F
+GLIBC_2.27 setsid F
+GLIBC_2.27 setsockopt F
+GLIBC_2.27 setsourcefilter F
+GLIBC_2.27 setspent F
+GLIBC_2.27 setstate F
+GLIBC_2.27 setstate_r F
+GLIBC_2.27 settimeofday F
+GLIBC_2.27 setttyent F
+GLIBC_2.27 setuid F
+GLIBC_2.27 setusershell F
+GLIBC_2.27 setutent F
+GLIBC_2.27 setutxent F
+GLIBC_2.27 setvbuf F
+GLIBC_2.27 setxattr F
+GLIBC_2.27 sgetsgent F
+GLIBC_2.27 sgetsgent_r F
+GLIBC_2.27 sgetspent F
+GLIBC_2.27 sgetspent_r F
+GLIBC_2.27 shmat F
+GLIBC_2.27 shmctl F
+GLIBC_2.27 shmdt F
+GLIBC_2.27 shmget F
+GLIBC_2.27 shutdown F
+GLIBC_2.27 sigaction F
+GLIBC_2.27 sigaddset F
+GLIBC_2.27 sigaltstack F
+GLIBC_2.27 sigandset F
+GLIBC_2.27 sigblock F
+GLIBC_2.27 sigdelset F
+GLIBC_2.27 sigemptyset F
+GLIBC_2.27 sigfillset F
+GLIBC_2.27 siggetmask F
+GLIBC_2.27 sighold F
+GLIBC_2.27 sigignore F
+GLIBC_2.27 siginterrupt F
+GLIBC_2.27 sigisemptyset F
+GLIBC_2.27 sigismember F
+GLIBC_2.27 siglongjmp F
+GLIBC_2.27 signal F
+GLIBC_2.27 signalfd F
+GLIBC_2.27 sigorset F
+GLIBC_2.27 sigpause F
+GLIBC_2.27 sigpending F
+GLIBC_2.27 sigprocmask F
+GLIBC_2.27 sigqueue F
+GLIBC_2.27 sigrelse F
+GLIBC_2.27 sigreturn F
+GLIBC_2.27 sigset F
+GLIBC_2.27 sigsetmask F
+GLIBC_2.27 sigstack F
+GLIBC_2.27 sigsuspend F
+GLIBC_2.27 sigtimedwait F
+GLIBC_2.27 sigwait F
+GLIBC_2.27 sigwaitinfo F
+GLIBC_2.27 sleep F
+GLIBC_2.27 snprintf F
+GLIBC_2.27 sockatmark F
+GLIBC_2.27 socket F
+GLIBC_2.27 socketpair F
+GLIBC_2.27 splice F
+GLIBC_2.27 sprintf F
+GLIBC_2.27 sprofil F
+GLIBC_2.27 srand F
+GLIBC_2.27 srand48 F
+GLIBC_2.27 srand48_r F
+GLIBC_2.27 srandom F
+GLIBC_2.27 srandom_r F
+GLIBC_2.27 sscanf F
+GLIBC_2.27 ssignal F
+GLIBC_2.27 sstk F
+GLIBC_2.27 statfs F
+GLIBC_2.27 statfs64 F
+GLIBC_2.27 statvfs F
+GLIBC_2.27 statvfs64 F
+GLIBC_2.27 stderr D 0x8
+GLIBC_2.27 stdin D 0x8
+GLIBC_2.27 stdout D 0x8
+GLIBC_2.27 stime F
+GLIBC_2.27 stpcpy F
+GLIBC_2.27 stpncpy F
+GLIBC_2.27 strcasecmp F
+GLIBC_2.27 strcasecmp_l F
+GLIBC_2.27 strcasestr F
+GLIBC_2.27 strcat F
+GLIBC_2.27 strchr F
+GLIBC_2.27 strchrnul F
+GLIBC_2.27 strcmp F
+GLIBC_2.27 strcoll F
+GLIBC_2.27 strcoll_l F
+GLIBC_2.27 strcpy F
+GLIBC_2.27 strcspn F
+GLIBC_2.27 strdup F
+GLIBC_2.27 strerror F
+GLIBC_2.27 strerror_l F
+GLIBC_2.27 strerror_r F
+GLIBC_2.27 strfmon F
+GLIBC_2.27 strfmon_l F
+GLIBC_2.27 strfromd F
+GLIBC_2.27 strfromf F
+GLIBC_2.27 strfromf128 F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strfroml F
+GLIBC_2.27 strfry F
+GLIBC_2.27 strftime F
+GLIBC_2.27 strftime_l F
+GLIBC_2.27 strlen F
+GLIBC_2.27 strncasecmp F
+GLIBC_2.27 strncasecmp_l F
+GLIBC_2.27 strncat F
+GLIBC_2.27 strncmp F
+GLIBC_2.27 strncpy F
+GLIBC_2.27 strndup F
+GLIBC_2.27 strnlen F
+GLIBC_2.27 strpbrk F
+GLIBC_2.27 strptime F
+GLIBC_2.27 strptime_l F
+GLIBC_2.27 strrchr F
+GLIBC_2.27 strsep F
+GLIBC_2.27 strsignal F
+GLIBC_2.27 strspn F
+GLIBC_2.27 strstr F
+GLIBC_2.27 strtod F
+GLIBC_2.27 strtod_l F
+GLIBC_2.27 strtof F
+GLIBC_2.27 strtof128 F
+GLIBC_2.27 strtof128_l F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 strtof_l F
+GLIBC_2.27 strtoimax F
+GLIBC_2.27 strtok F
+GLIBC_2.27 strtok_r F
+GLIBC_2.27 strtol F
+GLIBC_2.27 strtol_l F
+GLIBC_2.27 strtold F
+GLIBC_2.27 strtold_l F
+GLIBC_2.27 strtoll F
+GLIBC_2.27 strtoll_l F
+GLIBC_2.27 strtoq F
+GLIBC_2.27 strtoul F
+GLIBC_2.27 strtoul_l F
+GLIBC_2.27 strtoull F
+GLIBC_2.27 strtoull_l F
+GLIBC_2.27 strtoumax F
+GLIBC_2.27 strtouq F
+GLIBC_2.27 strverscmp F
+GLIBC_2.27 strxfrm F
+GLIBC_2.27 strxfrm_l F
+GLIBC_2.27 stty F
+GLIBC_2.27 svc_exit F
+GLIBC_2.27 svc_fdset D 0x80
+GLIBC_2.27 svc_getreq F
+GLIBC_2.27 svc_getreq_common F
+GLIBC_2.27 svc_getreq_poll F
+GLIBC_2.27 svc_getreqset F
+GLIBC_2.27 svc_max_pollfd D 0x4
+GLIBC_2.27 svc_pollfd D 0x8
+GLIBC_2.27 svc_register F
+GLIBC_2.27 svc_run F
+GLIBC_2.27 svc_sendreply F
+GLIBC_2.27 svc_unregister F
+GLIBC_2.27 svcauthdes_stats D 0x18
+GLIBC_2.27 svcerr_auth F
+GLIBC_2.27 svcerr_decode F
+GLIBC_2.27 svcerr_noproc F
+GLIBC_2.27 svcerr_noprog F
+GLIBC_2.27 svcerr_progvers F
+GLIBC_2.27 svcerr_systemerr F
+GLIBC_2.27 svcerr_weakauth F
+GLIBC_2.27 svcfd_create F
+GLIBC_2.27 svcraw_create F
+GLIBC_2.27 svctcp_create F
+GLIBC_2.27 svcudp_bufcreate F
+GLIBC_2.27 svcudp_create F
+GLIBC_2.27 svcudp_enablecache F
+GLIBC_2.27 svcunix_create F
+GLIBC_2.27 svcunixfd_create F
+GLIBC_2.27 swab F
+GLIBC_2.27 swapcontext F
+GLIBC_2.27 swapoff F
+GLIBC_2.27 swapon F
+GLIBC_2.27 swprintf F
+GLIBC_2.27 swscanf F
+GLIBC_2.27 symlink F
+GLIBC_2.27 symlinkat F
+GLIBC_2.27 sync F
+GLIBC_2.27 sync_file_range F
+GLIBC_2.27 syncfs F
+GLIBC_2.27 sys_errlist D 0x438
+GLIBC_2.27 sys_nerr D 0x4
+GLIBC_2.27 sys_sigabbrev D 0x208
+GLIBC_2.27 sys_siglist D 0x208
+GLIBC_2.27 syscall F
+GLIBC_2.27 sysconf F
+GLIBC_2.27 sysctl F
+GLIBC_2.27 sysinfo F
+GLIBC_2.27 syslog F
+GLIBC_2.27 system F
+GLIBC_2.27 sysv_signal F
+GLIBC_2.27 tcdrain F
+GLIBC_2.27 tcflow F
+GLIBC_2.27 tcflush F
+GLIBC_2.27 tcgetattr F
+GLIBC_2.27 tcgetpgrp F
+GLIBC_2.27 tcgetsid F
+GLIBC_2.27 tcsendbreak F
+GLIBC_2.27 tcsetattr F
+GLIBC_2.27 tcsetpgrp F
+GLIBC_2.27 tdelete F
+GLIBC_2.27 tdestroy F
+GLIBC_2.27 tee F
+GLIBC_2.27 telldir F
+GLIBC_2.27 tempnam F
+GLIBC_2.27 textdomain F
+GLIBC_2.27 tfind F
+GLIBC_2.27 time F
+GLIBC_2.27 timegm F
+GLIBC_2.27 timelocal F
+GLIBC_2.27 timerfd_create F
+GLIBC_2.27 timerfd_gettime F
+GLIBC_2.27 timerfd_settime F
+GLIBC_2.27 times F
+GLIBC_2.27 timespec_get F
+GLIBC_2.27 timezone D 0x8
+GLIBC_2.27 tmpfile F
+GLIBC_2.27 tmpfile64 F
+GLIBC_2.27 tmpnam F
+GLIBC_2.27 tmpnam_r F
+GLIBC_2.27 toascii F
+GLIBC_2.27 tolower F
+GLIBC_2.27 tolower_l F
+GLIBC_2.27 toupper F
+GLIBC_2.27 toupper_l F
+GLIBC_2.27 towctrans F
+GLIBC_2.27 towctrans_l F
+GLIBC_2.27 towlower F
+GLIBC_2.27 towlower_l F
+GLIBC_2.27 towupper F
+GLIBC_2.27 towupper_l F
+GLIBC_2.27 tr_break F
+GLIBC_2.27 truncate F
+GLIBC_2.27 truncate64 F
+GLIBC_2.27 tsearch F
+GLIBC_2.27 ttyname F
+GLIBC_2.27 ttyname_r F
+GLIBC_2.27 ttyslot F
+GLIBC_2.27 twalk F
+GLIBC_2.27 tzname D 0x10
+GLIBC_2.27 tzset F
+GLIBC_2.27 ualarm F
+GLIBC_2.27 ulckpwdf F
+GLIBC_2.27 ulimit F
+GLIBC_2.27 umask F
+GLIBC_2.27 umount F
+GLIBC_2.27 umount2 F
+GLIBC_2.27 uname F
+GLIBC_2.27 ungetc F
+GLIBC_2.27 ungetwc F
+GLIBC_2.27 unlink F
+GLIBC_2.27 unlinkat F
+GLIBC_2.27 unlockpt F
+GLIBC_2.27 unsetenv F
+GLIBC_2.27 unshare F
+GLIBC_2.27 updwtmp F
+GLIBC_2.27 updwtmpx F
+GLIBC_2.27 uselocale F
+GLIBC_2.27 user2netname F
+GLIBC_2.27 usleep F
+GLIBC_2.27 ustat F
+GLIBC_2.27 utime F
+GLIBC_2.27 utimensat F
+GLIBC_2.27 utimes F
+GLIBC_2.27 utmpname F
+GLIBC_2.27 utmpxname F
+GLIBC_2.27 valloc F
+GLIBC_2.27 vasprintf F
+GLIBC_2.27 vdprintf F
+GLIBC_2.27 verr F
+GLIBC_2.27 verrx F
+GLIBC_2.27 versionsort F
+GLIBC_2.27 versionsort64 F
+GLIBC_2.27 vfork F
+GLIBC_2.27 vfprintf F
+GLIBC_2.27 vfscanf F
+GLIBC_2.27 vfwprintf F
+GLIBC_2.27 vfwscanf F
+GLIBC_2.27 vhangup F
+GLIBC_2.27 vlimit F
+GLIBC_2.27 vmsplice F
+GLIBC_2.27 vprintf F
+GLIBC_2.27 vscanf F
+GLIBC_2.27 vsnprintf F
+GLIBC_2.27 vsprintf F
+GLIBC_2.27 vsscanf F
+GLIBC_2.27 vswprintf F
+GLIBC_2.27 vswscanf F
+GLIBC_2.27 vsyslog F
+GLIBC_2.27 vtimes F
+GLIBC_2.27 vwarn F
+GLIBC_2.27 vwarnx F
+GLIBC_2.27 vwprintf F
+GLIBC_2.27 vwscanf F
+GLIBC_2.27 wait F
+GLIBC_2.27 wait3 F
+GLIBC_2.27 wait4 F
+GLIBC_2.27 waitid F
+GLIBC_2.27 waitpid F
+GLIBC_2.27 warn F
+GLIBC_2.27 warnx F
+GLIBC_2.27 wcpcpy F
+GLIBC_2.27 wcpncpy F
+GLIBC_2.27 wcrtomb F
+GLIBC_2.27 wcscasecmp F
+GLIBC_2.27 wcscasecmp_l F
+GLIBC_2.27 wcscat F
+GLIBC_2.27 wcschr F
+GLIBC_2.27 wcschrnul F
+GLIBC_2.27 wcscmp F
+GLIBC_2.27 wcscoll F
+GLIBC_2.27 wcscoll_l F
+GLIBC_2.27 wcscpy F
+GLIBC_2.27 wcscspn F
+GLIBC_2.27 wcsdup F
+GLIBC_2.27 wcsftime F
+GLIBC_2.27 wcsftime_l F
+GLIBC_2.27 wcslen F
+GLIBC_2.27 wcsncasecmp F
+GLIBC_2.27 wcsncasecmp_l F
+GLIBC_2.27 wcsncat F
+GLIBC_2.27 wcsncmp F
+GLIBC_2.27 wcsncpy F
+GLIBC_2.27 wcsnlen F
+GLIBC_2.27 wcsnrtombs F
+GLIBC_2.27 wcspbrk F
+GLIBC_2.27 wcsrchr F
+GLIBC_2.27 wcsrtombs F
+GLIBC_2.27 wcsspn F
+GLIBC_2.27 wcsstr F
+GLIBC_2.27 wcstod F
+GLIBC_2.27 wcstod_l F
+GLIBC_2.27 wcstof F
+GLIBC_2.27 wcstof128 F
+GLIBC_2.27 wcstof128_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.27 wcstof_l F
+GLIBC_2.27 wcstoimax F
+GLIBC_2.27 wcstok F
+GLIBC_2.27 wcstol F
+GLIBC_2.27 wcstol_l F
+GLIBC_2.27 wcstold F
+GLIBC_2.27 wcstold_l F
+GLIBC_2.27 wcstoll F
+GLIBC_2.27 wcstoll_l F
+GLIBC_2.27 wcstombs F
+GLIBC_2.27 wcstoq F
+GLIBC_2.27 wcstoul F
+GLIBC_2.27 wcstoul_l F
+GLIBC_2.27 wcstoull F
+GLIBC_2.27 wcstoull_l F
+GLIBC_2.27 wcstoumax F
+GLIBC_2.27 wcstouq F
+GLIBC_2.27 wcswcs F
+GLIBC_2.27 wcswidth F
+GLIBC_2.27 wcsxfrm F
+GLIBC_2.27 wcsxfrm_l F
+GLIBC_2.27 wctob F
+GLIBC_2.27 wctomb F
+GLIBC_2.27 wctrans F
+GLIBC_2.27 wctrans_l F
+GLIBC_2.27 wctype F
+GLIBC_2.27 wctype_l F
+GLIBC_2.27 wcwidth F
+GLIBC_2.27 wmemchr F
+GLIBC_2.27 wmemcmp F
+GLIBC_2.27 wmemcpy F
+GLIBC_2.27 wmemmove F
+GLIBC_2.27 wmempcpy F
+GLIBC_2.27 wmemset F
+GLIBC_2.27 wordexp F
+GLIBC_2.27 wordfree F
+GLIBC_2.27 wprintf F
+GLIBC_2.27 write F
+GLIBC_2.27 writev F
+GLIBC_2.27 wscanf F
+GLIBC_2.27 xdecrypt F
+GLIBC_2.27 xdr_accepted_reply F
+GLIBC_2.27 xdr_array F
+GLIBC_2.27 xdr_authdes_cred F
+GLIBC_2.27 xdr_authdes_verf F
+GLIBC_2.27 xdr_authunix_parms F
+GLIBC_2.27 xdr_bool F
+GLIBC_2.27 xdr_bytes F
+GLIBC_2.27 xdr_callhdr F
+GLIBC_2.27 xdr_callmsg F
+GLIBC_2.27 xdr_char F
+GLIBC_2.27 xdr_cryptkeyarg F
+GLIBC_2.27 xdr_cryptkeyarg2 F
+GLIBC_2.27 xdr_cryptkeyres F
+GLIBC_2.27 xdr_des_block F
+GLIBC_2.27 xdr_double F
+GLIBC_2.27 xdr_enum F
+GLIBC_2.27 xdr_float F
+GLIBC_2.27 xdr_free F
+GLIBC_2.27 xdr_getcredres F
+GLIBC_2.27 xdr_hyper F
+GLIBC_2.27 xdr_int F
+GLIBC_2.27 xdr_int16_t F
+GLIBC_2.27 xdr_int32_t F
+GLIBC_2.27 xdr_int64_t F
+GLIBC_2.27 xdr_int8_t F
+GLIBC_2.27 xdr_key_netstarg F
+GLIBC_2.27 xdr_key_netstres F
+GLIBC_2.27 xdr_keybuf F
+GLIBC_2.27 xdr_keystatus F
+GLIBC_2.27 xdr_long F
+GLIBC_2.27 xdr_longlong_t F
+GLIBC_2.27 xdr_netnamestr F
+GLIBC_2.27 xdr_netobj F
+GLIBC_2.27 xdr_opaque F
+GLIBC_2.27 xdr_opaque_auth F
+GLIBC_2.27 xdr_pmap F
+GLIBC_2.27 xdr_pmaplist F
+GLIBC_2.27 xdr_pointer F
+GLIBC_2.27 xdr_quad_t F
+GLIBC_2.27 xdr_reference F
+GLIBC_2.27 xdr_rejected_reply F
+GLIBC_2.27 xdr_replymsg F
+GLIBC_2.27 xdr_rmtcall_args F
+GLIBC_2.27 xdr_rmtcallres F
+GLIBC_2.27 xdr_short F
+GLIBC_2.27 xdr_sizeof F
+GLIBC_2.27 xdr_string F
+GLIBC_2.27 xdr_u_char F
+GLIBC_2.27 xdr_u_hyper F
+GLIBC_2.27 xdr_u_int F
+GLIBC_2.27 xdr_u_long F
+GLIBC_2.27 xdr_u_longlong_t F
+GLIBC_2.27 xdr_u_quad_t F
+GLIBC_2.27 xdr_u_short F
+GLIBC_2.27 xdr_uint16_t F
+GLIBC_2.27 xdr_uint32_t F
+GLIBC_2.27 xdr_uint64_t F
+GLIBC_2.27 xdr_uint8_t F
+GLIBC_2.27 xdr_union F
+GLIBC_2.27 xdr_unixcred F
+GLIBC_2.27 xdr_vector F
+GLIBC_2.27 xdr_void F
+GLIBC_2.27 xdr_wrapstring F
+GLIBC_2.27 xdrmem_create F
+GLIBC_2.27 xdrrec_create F
+GLIBC_2.27 xdrrec_endofrecord F
+GLIBC_2.27 xdrrec_eof F
+GLIBC_2.27 xdrrec_skiprecord F
+GLIBC_2.27 xdrstdio_create F
+GLIBC_2.27 xencrypt F
+GLIBC_2.27 xprt_register F
+GLIBC_2.27 xprt_unregister F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libcrypt.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libcrypt.abilist
new file mode 100644
index 0000000000..9484dca79e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libcrypt.abilist
@@ -0,0 +1,7 @@
+GLIBC_2.27 crypt F
+GLIBC_2.27 crypt_r F
+GLIBC_2.27 encrypt F
+GLIBC_2.27 encrypt_r F
+GLIBC_2.27 fcrypt F
+GLIBC_2.27 setkey F
+GLIBC_2.27 setkey_r F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libdl.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libdl.abilist
new file mode 100644
index 0000000000..16adcae553
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libdl.abilist
@@ -0,0 +1,9 @@
+GLIBC_2.27 dladdr F
+GLIBC_2.27 dladdr1 F
+GLIBC_2.27 dlclose F
+GLIBC_2.27 dlerror F
+GLIBC_2.27 dlinfo F
+GLIBC_2.27 dlmopen F
+GLIBC_2.27 dlopen F
+GLIBC_2.27 dlsym F
+GLIBC_2.27 dlvsym F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist
new file mode 100644
index 0000000000..361fce20bb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist
@@ -0,0 +1,1021 @@
+GLIBC_2.27 __acos_finite F
+GLIBC_2.27 __acosf_finite F
+GLIBC_2.27 __acosh_finite F
+GLIBC_2.27 __acoshf_finite F
+GLIBC_2.27 __acoshl_finite F
+GLIBC_2.27 __acosl_finite F
+GLIBC_2.27 __asin_finite F
+GLIBC_2.27 __asinf_finite F
+GLIBC_2.27 __asinl_finite F
+GLIBC_2.27 __atan2_finite F
+GLIBC_2.27 __atan2f_finite F
+GLIBC_2.27 __atan2l_finite F
+GLIBC_2.27 __atanh_finite F
+GLIBC_2.27 __atanhf_finite F
+GLIBC_2.27 __atanhl_finite F
+GLIBC_2.27 __clog10 F
+GLIBC_2.27 __clog10f F
+GLIBC_2.27 __clog10l F
+GLIBC_2.27 __cosh_finite F
+GLIBC_2.27 __coshf_finite F
+GLIBC_2.27 __coshl_finite F
+GLIBC_2.27 __exp10_finite F
+GLIBC_2.27 __exp10f_finite F
+GLIBC_2.27 __exp10l_finite F
+GLIBC_2.27 __exp2_finite F
+GLIBC_2.27 __exp2f_finite F
+GLIBC_2.27 __exp2l_finite F
+GLIBC_2.27 __exp_finite F
+GLIBC_2.27 __expf_finite F
+GLIBC_2.27 __expl_finite F
+GLIBC_2.27 __finite F
+GLIBC_2.27 __finitef F
+GLIBC_2.27 __finitel F
+GLIBC_2.27 __fmod_finite F
+GLIBC_2.27 __fmodf_finite F
+GLIBC_2.27 __fmodl_finite F
+GLIBC_2.27 __fpclassify F
+GLIBC_2.27 __fpclassifyf F
+GLIBC_2.27 __fpclassifyl F
+GLIBC_2.27 __gamma_r_finite F
+GLIBC_2.27 __gammaf_r_finite F
+GLIBC_2.27 __gammal_r_finite F
+GLIBC_2.27 __hypot_finite F
+GLIBC_2.27 __hypotf_finite F
+GLIBC_2.27 __hypotl_finite F
+GLIBC_2.27 __iseqsig F
+GLIBC_2.27 __iseqsigf F
+GLIBC_2.27 __iseqsigl F
+GLIBC_2.27 __issignaling F
+GLIBC_2.27 __issignalingf F
+GLIBC_2.27 __issignalingl F
+GLIBC_2.27 __j0_finite F
+GLIBC_2.27 __j0f_finite F
+GLIBC_2.27 __j0l_finite F
+GLIBC_2.27 __j1_finite F
+GLIBC_2.27 __j1f_finite F
+GLIBC_2.27 __j1l_finite F
+GLIBC_2.27 __jn_finite F
+GLIBC_2.27 __jnf_finite F
+GLIBC_2.27 __jnl_finite F
+GLIBC_2.27 __lgamma_r_finite F
+GLIBC_2.27 __lgammaf_r_finite F
+GLIBC_2.27 __lgammal_r_finite F
+GLIBC_2.27 __log10_finite F
+GLIBC_2.27 __log10f_finite F
+GLIBC_2.27 __log10l_finite F
+GLIBC_2.27 __log2_finite F
+GLIBC_2.27 __log2f_finite F
+GLIBC_2.27 __log2l_finite F
+GLIBC_2.27 __log_finite F
+GLIBC_2.27 __logf_finite F
+GLIBC_2.27 __logl_finite F
+GLIBC_2.27 __pow_finite F
+GLIBC_2.27 __powf_finite F
+GLIBC_2.27 __powl_finite F
+GLIBC_2.27 __remainder_finite F
+GLIBC_2.27 __remainderf_finite F
+GLIBC_2.27 __remainderl_finite F
+GLIBC_2.27 __scalb_finite F
+GLIBC_2.27 __scalbf_finite F
+GLIBC_2.27 __scalbl_finite F
+GLIBC_2.27 __signbit F
+GLIBC_2.27 __signbitf F
+GLIBC_2.27 __signbitl F
+GLIBC_2.27 __signgam D 0x4
+GLIBC_2.27 __sinh_finite F
+GLIBC_2.27 __sinhf_finite F
+GLIBC_2.27 __sinhl_finite F
+GLIBC_2.27 __sqrt_finite F
+GLIBC_2.27 __sqrtf_finite F
+GLIBC_2.27 __sqrtl_finite F
+GLIBC_2.27 __y0_finite F
+GLIBC_2.27 __y0f_finite F
+GLIBC_2.27 __y0l_finite F
+GLIBC_2.27 __y1_finite F
+GLIBC_2.27 __y1f_finite F
+GLIBC_2.27 __y1l_finite F
+GLIBC_2.27 __yn_finite F
+GLIBC_2.27 __ynf_finite F
+GLIBC_2.27 __ynl_finite F
+GLIBC_2.27 acos F
+GLIBC_2.27 acosf F
+GLIBC_2.27 acosf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acosh F
+GLIBC_2.27 acoshf F
+GLIBC_2.27 acoshf128 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 acoshl F
+GLIBC_2.27 acosl F
+GLIBC_2.27 asin F
+GLIBC_2.27 asinf F
+GLIBC_2.27 asinf128 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinh F
+GLIBC_2.27 asinhf F
+GLIBC_2.27 asinhf128 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 asinhl F
+GLIBC_2.27 asinl F
+GLIBC_2.27 atan F
+GLIBC_2.27 atan2 F
+GLIBC_2.27 atan2f F
+GLIBC_2.27 atan2f128 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atan2l F
+GLIBC_2.27 atanf F
+GLIBC_2.27 atanf128 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanh F
+GLIBC_2.27 atanhf F
+GLIBC_2.27 atanhf128 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 atanhl F
+GLIBC_2.27 atanl F
+GLIBC_2.27 cabs F
+GLIBC_2.27 cabsf F
+GLIBC_2.27 cabsf128 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cabsl F
+GLIBC_2.27 cacos F
+GLIBC_2.27 cacosf F
+GLIBC_2.27 cacosf128 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacosh F
+GLIBC_2.27 cacoshf F
+GLIBC_2.27 cacoshf128 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 cacoshl F
+GLIBC_2.27 cacosl F
+GLIBC_2.27 canonicalize F
+GLIBC_2.27 canonicalizef F
+GLIBC_2.27 canonicalizef128 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 canonicalizel F
+GLIBC_2.27 carg F
+GLIBC_2.27 cargf F
+GLIBC_2.27 cargf128 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 cargl F
+GLIBC_2.27 casin F
+GLIBC_2.27 casinf F
+GLIBC_2.27 casinf128 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinh F
+GLIBC_2.27 casinhf F
+GLIBC_2.27 casinhf128 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 casinhl F
+GLIBC_2.27 casinl F
+GLIBC_2.27 catan F
+GLIBC_2.27 catanf F
+GLIBC_2.27 catanf128 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanh F
+GLIBC_2.27 catanhf F
+GLIBC_2.27 catanhf128 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 catanhl F
+GLIBC_2.27 catanl F
+GLIBC_2.27 cbrt F
+GLIBC_2.27 cbrtf F
+GLIBC_2.27 cbrtf128 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 cbrtl F
+GLIBC_2.27 ccos F
+GLIBC_2.27 ccosf F
+GLIBC_2.27 ccosf128 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccosh F
+GLIBC_2.27 ccoshf F
+GLIBC_2.27 ccoshf128 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ccoshl F
+GLIBC_2.27 ccosl F
+GLIBC_2.27 ceil F
+GLIBC_2.27 ceilf F
+GLIBC_2.27 ceilf128 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 ceill F
+GLIBC_2.27 cexp F
+GLIBC_2.27 cexpf F
+GLIBC_2.27 cexpf128 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cexpl F
+GLIBC_2.27 cimag F
+GLIBC_2.27 cimagf F
+GLIBC_2.27 cimagf128 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 cimagl F
+GLIBC_2.27 clog F
+GLIBC_2.27 clog10 F
+GLIBC_2.27 clog10f F
+GLIBC_2.27 clog10f128 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clog10l F
+GLIBC_2.27 clogf F
+GLIBC_2.27 clogf128 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 clogl F
+GLIBC_2.27 conj F
+GLIBC_2.27 conjf F
+GLIBC_2.27 conjf128 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 conjl F
+GLIBC_2.27 copysign F
+GLIBC_2.27 copysignf F
+GLIBC_2.27 copysignf128 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 copysignl F
+GLIBC_2.27 cos F
+GLIBC_2.27 cosf F
+GLIBC_2.27 cosf128 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 cosh F
+GLIBC_2.27 coshf F
+GLIBC_2.27 coshf128 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 coshl F
+GLIBC_2.27 cosl F
+GLIBC_2.27 cpow F
+GLIBC_2.27 cpowf F
+GLIBC_2.27 cpowf128 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cpowl F
+GLIBC_2.27 cproj F
+GLIBC_2.27 cprojf F
+GLIBC_2.27 cprojf128 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 cprojl F
+GLIBC_2.27 creal F
+GLIBC_2.27 crealf F
+GLIBC_2.27 crealf128 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 creall F
+GLIBC_2.27 csin F
+GLIBC_2.27 csinf F
+GLIBC_2.27 csinf128 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinh F
+GLIBC_2.27 csinhf F
+GLIBC_2.27 csinhf128 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csinhl F
+GLIBC_2.27 csinl F
+GLIBC_2.27 csqrt F
+GLIBC_2.27 csqrtf F
+GLIBC_2.27 csqrtf128 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 csqrtl F
+GLIBC_2.27 ctan F
+GLIBC_2.27 ctanf F
+GLIBC_2.27 ctanf128 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanh F
+GLIBC_2.27 ctanhf F
+GLIBC_2.27 ctanhf128 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 ctanhl F
+GLIBC_2.27 ctanl F
+GLIBC_2.27 drem F
+GLIBC_2.27 dremf F
+GLIBC_2.27 dreml F
+GLIBC_2.27 erf F
+GLIBC_2.27 erfc F
+GLIBC_2.27 erfcf F
+GLIBC_2.27 erfcf128 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erfcl F
+GLIBC_2.27 erff F
+GLIBC_2.27 erff128 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 erfl F
+GLIBC_2.27 exp F
+GLIBC_2.27 exp10 F
+GLIBC_2.27 exp10f F
+GLIBC_2.27 exp10f128 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp10l F
+GLIBC_2.27 exp2 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f128 F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 exp2l F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf128 F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expl F
+GLIBC_2.27 expm1 F
+GLIBC_2.27 expm1f F
+GLIBC_2.27 expm1f128 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 expm1l F
+GLIBC_2.27 fabs F
+GLIBC_2.27 fabsf F
+GLIBC_2.27 fabsf128 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fabsl F
+GLIBC_2.27 fdim F
+GLIBC_2.27 fdimf F
+GLIBC_2.27 fdimf128 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 fdiml F
+GLIBC_2.27 feclearexcept F
+GLIBC_2.27 fedisableexcept F
+GLIBC_2.27 feenableexcept F
+GLIBC_2.27 fegetenv F
+GLIBC_2.27 fegetexcept F
+GLIBC_2.27 fegetexceptflag F
+GLIBC_2.27 fegetmode F
+GLIBC_2.27 fegetround F
+GLIBC_2.27 feholdexcept F
+GLIBC_2.27 feraiseexcept F
+GLIBC_2.27 fesetenv F
+GLIBC_2.27 fesetexcept F
+GLIBC_2.27 fesetexceptflag F
+GLIBC_2.27 fesetmode F
+GLIBC_2.27 fesetround F
+GLIBC_2.27 fetestexcept F
+GLIBC_2.27 fetestexceptflag F
+GLIBC_2.27 feupdateenv F
+GLIBC_2.27 finite F
+GLIBC_2.27 finitef F
+GLIBC_2.27 finitel F
+GLIBC_2.27 floor F
+GLIBC_2.27 floorf F
+GLIBC_2.27 floorf128 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 floorl F
+GLIBC_2.27 fma F
+GLIBC_2.27 fmaf F
+GLIBC_2.27 fmaf128 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmal F
+GLIBC_2.27 fmax F
+GLIBC_2.27 fmaxf F
+GLIBC_2.27 fmaxf128 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxl F
+GLIBC_2.27 fmaxmag F
+GLIBC_2.27 fmaxmagf F
+GLIBC_2.27 fmaxmagf128 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fmaxmagl F
+GLIBC_2.27 fmin F
+GLIBC_2.27 fminf F
+GLIBC_2.27 fminf128 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminl F
+GLIBC_2.27 fminmag F
+GLIBC_2.27 fminmagf F
+GLIBC_2.27 fminmagf128 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fminmagl F
+GLIBC_2.27 fmod F
+GLIBC_2.27 fmodf F
+GLIBC_2.27 fmodf128 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 fmodl F
+GLIBC_2.27 frexp F
+GLIBC_2.27 frexpf F
+GLIBC_2.27 frexpf128 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 frexpl F
+GLIBC_2.27 fromfp F
+GLIBC_2.27 fromfpf F
+GLIBC_2.27 fromfpf128 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpl F
+GLIBC_2.27 fromfpx F
+GLIBC_2.27 fromfpxf F
+GLIBC_2.27 fromfpxf128 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 fromfpxl F
+GLIBC_2.27 gamma F
+GLIBC_2.27 gammaf F
+GLIBC_2.27 gammal F
+GLIBC_2.27 getpayload F
+GLIBC_2.27 getpayloadf F
+GLIBC_2.27 getpayloadf128 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 getpayloadl F
+GLIBC_2.27 hypot F
+GLIBC_2.27 hypotf F
+GLIBC_2.27 hypotf128 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 hypotl F
+GLIBC_2.27 ilogb F
+GLIBC_2.27 ilogbf F
+GLIBC_2.27 ilogbf128 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 ilogbl F
+GLIBC_2.27 j0 F
+GLIBC_2.27 j0f F
+GLIBC_2.27 j0f128 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j0l F
+GLIBC_2.27 j1 F
+GLIBC_2.27 j1f F
+GLIBC_2.27 j1f128 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 j1l F
+GLIBC_2.27 jn F
+GLIBC_2.27 jnf F
+GLIBC_2.27 jnf128 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 jnl F
+GLIBC_2.27 ldexp F
+GLIBC_2.27 ldexpf F
+GLIBC_2.27 ldexpf128 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 ldexpl F
+GLIBC_2.27 lgamma F
+GLIBC_2.27 lgamma_r F
+GLIBC_2.27 lgammaf F
+GLIBC_2.27 lgammaf128 F
+GLIBC_2.27 lgammaf128_r F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 lgammaf_r F
+GLIBC_2.27 lgammal F
+GLIBC_2.27 lgammal_r F
+GLIBC_2.27 llogb F
+GLIBC_2.27 llogbf F
+GLIBC_2.27 llogbf128 F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llogbl F
+GLIBC_2.27 llrint F
+GLIBC_2.27 llrintf F
+GLIBC_2.27 llrintf128 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llrintl F
+GLIBC_2.27 llround F
+GLIBC_2.27 llroundf F
+GLIBC_2.27 llroundf128 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 llroundl F
+GLIBC_2.27 log F
+GLIBC_2.27 log10 F
+GLIBC_2.27 log10f F
+GLIBC_2.27 log10f128 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log10l F
+GLIBC_2.27 log1p F
+GLIBC_2.27 log1pf F
+GLIBC_2.27 log1pf128 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log1pl F
+GLIBC_2.27 log2 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f128 F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 log2l F
+GLIBC_2.27 logb F
+GLIBC_2.27 logbf F
+GLIBC_2.27 logbf128 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logbl F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf128 F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 logl F
+GLIBC_2.27 lrint F
+GLIBC_2.27 lrintf F
+GLIBC_2.27 lrintf128 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lrintl F
+GLIBC_2.27 lround F
+GLIBC_2.27 lroundf F
+GLIBC_2.27 lroundf128 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 lroundl F
+GLIBC_2.27 modf F
+GLIBC_2.27 modff F
+GLIBC_2.27 modff128 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 modfl F
+GLIBC_2.27 nan F
+GLIBC_2.27 nanf F
+GLIBC_2.27 nanf128 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nanl F
+GLIBC_2.27 nearbyint F
+GLIBC_2.27 nearbyintf F
+GLIBC_2.27 nearbyintf128 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nearbyintl F
+GLIBC_2.27 nextafter F
+GLIBC_2.27 nextafterf F
+GLIBC_2.27 nextafterf128 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextafterl F
+GLIBC_2.27 nextdown F
+GLIBC_2.27 nextdownf F
+GLIBC_2.27 nextdownf128 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextdownl F
+GLIBC_2.27 nexttoward F
+GLIBC_2.27 nexttowardf F
+GLIBC_2.27 nexttowardl F
+GLIBC_2.27 nextup F
+GLIBC_2.27 nextupf F
+GLIBC_2.27 nextupf128 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 nextupl F
+GLIBC_2.27 pow F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf128 F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 powl F
+GLIBC_2.27 remainder F
+GLIBC_2.27 remainderf F
+GLIBC_2.27 remainderf128 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remainderl F
+GLIBC_2.27 remquo F
+GLIBC_2.27 remquof F
+GLIBC_2.27 remquof128 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 remquol F
+GLIBC_2.27 rint F
+GLIBC_2.27 rintf F
+GLIBC_2.27 rintf128 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 rintl F
+GLIBC_2.27 round F
+GLIBC_2.27 roundeven F
+GLIBC_2.27 roundevenf F
+GLIBC_2.27 roundevenf128 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundevenl F
+GLIBC_2.27 roundf F
+GLIBC_2.27 roundf128 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 roundl F
+GLIBC_2.27 scalb F
+GLIBC_2.27 scalbf F
+GLIBC_2.27 scalbl F
+GLIBC_2.27 scalbln F
+GLIBC_2.27 scalblnf F
+GLIBC_2.27 scalblnf128 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalblnl F
+GLIBC_2.27 scalbn F
+GLIBC_2.27 scalbnf F
+GLIBC_2.27 scalbnf128 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 scalbnl F
+GLIBC_2.27 setpayload F
+GLIBC_2.27 setpayloadf F
+GLIBC_2.27 setpayloadf128 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadl F
+GLIBC_2.27 setpayloadsig F
+GLIBC_2.27 setpayloadsigf F
+GLIBC_2.27 setpayloadsigf128 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 setpayloadsigl F
+GLIBC_2.27 signgam D 0x4
+GLIBC_2.27 significand F
+GLIBC_2.27 significandf F
+GLIBC_2.27 significandl F
+GLIBC_2.27 sin F
+GLIBC_2.27 sincos F
+GLIBC_2.27 sincosf F
+GLIBC_2.27 sincosf128 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sincosl F
+GLIBC_2.27 sinf F
+GLIBC_2.27 sinf128 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinh F
+GLIBC_2.27 sinhf F
+GLIBC_2.27 sinhf128 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sinhl F
+GLIBC_2.27 sinl F
+GLIBC_2.27 sqrt F
+GLIBC_2.27 sqrtf F
+GLIBC_2.27 sqrtf128 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 sqrtl F
+GLIBC_2.27 tan F
+GLIBC_2.27 tanf F
+GLIBC_2.27 tanf128 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanh F
+GLIBC_2.27 tanhf F
+GLIBC_2.27 tanhf128 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tanhl F
+GLIBC_2.27 tanl F
+GLIBC_2.27 tgamma F
+GLIBC_2.27 tgammaf F
+GLIBC_2.27 tgammaf128 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 tgammal F
+GLIBC_2.27 totalorder F
+GLIBC_2.27 totalorderf F
+GLIBC_2.27 totalorderf128 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalorderl F
+GLIBC_2.27 totalordermag F
+GLIBC_2.27 totalordermagf F
+GLIBC_2.27 totalordermagf128 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 totalordermagl F
+GLIBC_2.27 trunc F
+GLIBC_2.27 truncf F
+GLIBC_2.27 truncf128 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 truncl F
+GLIBC_2.27 ufromfp F
+GLIBC_2.27 ufromfpf F
+GLIBC_2.27 ufromfpf128 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpl F
+GLIBC_2.27 ufromfpx F
+GLIBC_2.27 ufromfpxf F
+GLIBC_2.27 ufromfpxf128 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 ufromfpxl F
+GLIBC_2.27 y0 F
+GLIBC_2.27 y0f F
+GLIBC_2.27 y0f128 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y0l F
+GLIBC_2.27 y1 F
+GLIBC_2.27 y1f F
+GLIBC_2.27 y1f128 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 y1l F
+GLIBC_2.27 yn F
+GLIBC_2.27 ynf F
+GLIBC_2.27 ynf128 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.27 ynl F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libnsl.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libnsl.abilist
new file mode 100644
index 0000000000..0767472d06
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libnsl.abilist
@@ -0,0 +1,120 @@
+GLIBC_2.27 __free_fdresult F
+GLIBC_2.27 __nis_default_access F
+GLIBC_2.27 __nis_default_group F
+GLIBC_2.27 __nis_default_owner F
+GLIBC_2.27 __nis_default_ttl F
+GLIBC_2.27 __nis_finddirectory F
+GLIBC_2.27 __nisbind_connect F
+GLIBC_2.27 __nisbind_create F
+GLIBC_2.27 __nisbind_destroy F
+GLIBC_2.27 __nisbind_next F
+GLIBC_2.27 __yp_check F
+GLIBC_2.27 nis_add F
+GLIBC_2.27 nis_add_entry F
+GLIBC_2.27 nis_addmember F
+GLIBC_2.27 nis_checkpoint F
+GLIBC_2.27 nis_clone_directory F
+GLIBC_2.27 nis_clone_object F
+GLIBC_2.27 nis_clone_result F
+GLIBC_2.27 nis_creategroup F
+GLIBC_2.27 nis_destroy_object F
+GLIBC_2.27 nis_destroygroup F
+GLIBC_2.27 nis_dir_cmp F
+GLIBC_2.27 nis_domain_of F
+GLIBC_2.27 nis_domain_of_r F
+GLIBC_2.27 nis_first_entry F
+GLIBC_2.27 nis_free_directory F
+GLIBC_2.27 nis_free_object F
+GLIBC_2.27 nis_free_request F
+GLIBC_2.27 nis_freenames F
+GLIBC_2.27 nis_freeresult F
+GLIBC_2.27 nis_freeservlist F
+GLIBC_2.27 nis_freetags F
+GLIBC_2.27 nis_getnames F
+GLIBC_2.27 nis_getservlist F
+GLIBC_2.27 nis_ismember F
+GLIBC_2.27 nis_leaf_of F
+GLIBC_2.27 nis_leaf_of_r F
+GLIBC_2.27 nis_lerror F
+GLIBC_2.27 nis_list F
+GLIBC_2.27 nis_local_directory F
+GLIBC_2.27 nis_local_group F
+GLIBC_2.27 nis_local_host F
+GLIBC_2.27 nis_local_principal F
+GLIBC_2.27 nis_lookup F
+GLIBC_2.27 nis_mkdir F
+GLIBC_2.27 nis_modify F
+GLIBC_2.27 nis_modify_entry F
+GLIBC_2.27 nis_name_of F
+GLIBC_2.27 nis_name_of_r F
+GLIBC_2.27 nis_next_entry F
+GLIBC_2.27 nis_perror F
+GLIBC_2.27 nis_ping F
+GLIBC_2.27 nis_print_directory F
+GLIBC_2.27 nis_print_entry F
+GLIBC_2.27 nis_print_group F
+GLIBC_2.27 nis_print_group_entry F
+GLIBC_2.27 nis_print_link F
+GLIBC_2.27 nis_print_object F
+GLIBC_2.27 nis_print_result F
+GLIBC_2.27 nis_print_rights F
+GLIBC_2.27 nis_print_table F
+GLIBC_2.27 nis_read_obj F
+GLIBC_2.27 nis_remove F
+GLIBC_2.27 nis_remove_entry F
+GLIBC_2.27 nis_removemember F
+GLIBC_2.27 nis_rmdir F
+GLIBC_2.27 nis_servstate F
+GLIBC_2.27 nis_sperrno F
+GLIBC_2.27 nis_sperror F
+GLIBC_2.27 nis_sperror_r F
+GLIBC_2.27 nis_stats F
+GLIBC_2.27 nis_verifygroup F
+GLIBC_2.27 nis_write_obj F
+GLIBC_2.27 readColdStartFile F
+GLIBC_2.27 writeColdStartFile F
+GLIBC_2.27 xdr_cback_data F
+GLIBC_2.27 xdr_domainname F
+GLIBC_2.27 xdr_keydat F
+GLIBC_2.27 xdr_mapname F
+GLIBC_2.27 xdr_obj_p F
+GLIBC_2.27 xdr_peername F
+GLIBC_2.27 xdr_valdat F
+GLIBC_2.27 xdr_yp_buf F
+GLIBC_2.27 xdr_ypall F
+GLIBC_2.27 xdr_ypbind_binding F
+GLIBC_2.27 xdr_ypbind_resp F
+GLIBC_2.27 xdr_ypbind_resptype F
+GLIBC_2.27 xdr_ypbind_setdom F
+GLIBC_2.27 xdr_ypdelete_args F
+GLIBC_2.27 xdr_ypmap_parms F
+GLIBC_2.27 xdr_ypmaplist F
+GLIBC_2.27 xdr_yppush_status F
+GLIBC_2.27 xdr_yppushresp_xfr F
+GLIBC_2.27 xdr_ypreq_key F
+GLIBC_2.27 xdr_ypreq_nokey F
+GLIBC_2.27 xdr_ypreq_xfr F
+GLIBC_2.27 xdr_ypresp_all F
+GLIBC_2.27 xdr_ypresp_key_val F
+GLIBC_2.27 xdr_ypresp_maplist F
+GLIBC_2.27 xdr_ypresp_master F
+GLIBC_2.27 xdr_ypresp_order F
+GLIBC_2.27 xdr_ypresp_val F
+GLIBC_2.27 xdr_ypresp_xfr F
+GLIBC_2.27 xdr_ypstat F
+GLIBC_2.27 xdr_ypupdate_args F
+GLIBC_2.27 xdr_ypxfrstat F
+GLIBC_2.27 yp_all F
+GLIBC_2.27 yp_bind F
+GLIBC_2.27 yp_first F
+GLIBC_2.27 yp_get_default_domain F
+GLIBC_2.27 yp_maplist F
+GLIBC_2.27 yp_master F
+GLIBC_2.27 yp_match F
+GLIBC_2.27 yp_next F
+GLIBC_2.27 yp_order F
+GLIBC_2.27 yp_unbind F
+GLIBC_2.27 yp_update F
+GLIBC_2.27 ypbinderr_string F
+GLIBC_2.27 yperr_string F
+GLIBC_2.27 ypprot_err F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
new file mode 100644
index 0000000000..c370fda73d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
@@ -0,0 +1,237 @@
+GLIBC_2.27 _IO_flockfile F
+GLIBC_2.27 _IO_ftrylockfile F
+GLIBC_2.27 _IO_funlockfile F
+GLIBC_2.27 __close F
+GLIBC_2.27 __connect F
+GLIBC_2.27 __errno_location F
+GLIBC_2.27 __fcntl F
+GLIBC_2.27 __h_errno_location F
+GLIBC_2.27 __libc_allocate_rtsig F
+GLIBC_2.27 __libc_current_sigrtmax F
+GLIBC_2.27 __libc_current_sigrtmin F
+GLIBC_2.27 __lseek F
+GLIBC_2.27 __nanosleep F
+GLIBC_2.27 __open F
+GLIBC_2.27 __open64 F
+GLIBC_2.27 __pread64 F
+GLIBC_2.27 __pthread_cleanup_routine F
+GLIBC_2.27 __pthread_getspecific F
+GLIBC_2.27 __pthread_key_create F
+GLIBC_2.27 __pthread_mutex_destroy F
+GLIBC_2.27 __pthread_mutex_init F
+GLIBC_2.27 __pthread_mutex_lock F
+GLIBC_2.27 __pthread_mutex_trylock F
+GLIBC_2.27 __pthread_mutex_unlock F
+GLIBC_2.27 __pthread_mutexattr_destroy F
+GLIBC_2.27 __pthread_mutexattr_init F
+GLIBC_2.27 __pthread_mutexattr_settype F
+GLIBC_2.27 __pthread_once F
+GLIBC_2.27 __pthread_register_cancel F
+GLIBC_2.27 __pthread_register_cancel_defer F
+GLIBC_2.27 __pthread_rwlock_destroy F
+GLIBC_2.27 __pthread_rwlock_init F
+GLIBC_2.27 __pthread_rwlock_rdlock F
+GLIBC_2.27 __pthread_rwlock_tryrdlock F
+GLIBC_2.27 __pthread_rwlock_trywrlock F
+GLIBC_2.27 __pthread_rwlock_unlock F
+GLIBC_2.27 __pthread_rwlock_wrlock F
+GLIBC_2.27 __pthread_setspecific F
+GLIBC_2.27 __pthread_unregister_cancel F
+GLIBC_2.27 __pthread_unregister_cancel_restore F
+GLIBC_2.27 __pthread_unwind_next F
+GLIBC_2.27 __pwrite64 F
+GLIBC_2.27 __read F
+GLIBC_2.27 __res_state F
+GLIBC_2.27 __send F
+GLIBC_2.27 __sigaction F
+GLIBC_2.27 __wait F
+GLIBC_2.27 __write F
+GLIBC_2.27 _pthread_cleanup_pop F
+GLIBC_2.27 _pthread_cleanup_pop_restore F
+GLIBC_2.27 _pthread_cleanup_push F
+GLIBC_2.27 _pthread_cleanup_push_defer F
+GLIBC_2.27 accept F
+GLIBC_2.27 close F
+GLIBC_2.27 connect F
+GLIBC_2.27 fcntl F
+GLIBC_2.27 flockfile F
+GLIBC_2.27 fsync F
+GLIBC_2.27 ftrylockfile F
+GLIBC_2.27 funlockfile F
+GLIBC_2.27 lseek F
+GLIBC_2.27 lseek64 F
+GLIBC_2.27 msync F
+GLIBC_2.27 nanosleep F
+GLIBC_2.27 open F
+GLIBC_2.27 open64 F
+GLIBC_2.27 pause F
+GLIBC_2.27 pread F
+GLIBC_2.27 pread64 F
+GLIBC_2.27 pthread_attr_destroy F
+GLIBC_2.27 pthread_attr_getaffinity_np F
+GLIBC_2.27 pthread_attr_getdetachstate F
+GLIBC_2.27 pthread_attr_getguardsize F
+GLIBC_2.27 pthread_attr_getinheritsched F
+GLIBC_2.27 pthread_attr_getschedparam F
+GLIBC_2.27 pthread_attr_getschedpolicy F
+GLIBC_2.27 pthread_attr_getscope F
+GLIBC_2.27 pthread_attr_getstack F
+GLIBC_2.27 pthread_attr_getstackaddr F
+GLIBC_2.27 pthread_attr_getstacksize F
+GLIBC_2.27 pthread_attr_init F
+GLIBC_2.27 pthread_attr_setaffinity_np F
+GLIBC_2.27 pthread_attr_setdetachstate F
+GLIBC_2.27 pthread_attr_setguardsize F
+GLIBC_2.27 pthread_attr_setinheritsched F
+GLIBC_2.27 pthread_attr_setschedparam F
+GLIBC_2.27 pthread_attr_setschedpolicy F
+GLIBC_2.27 pthread_attr_setscope F
+GLIBC_2.27 pthread_attr_setstack F
+GLIBC_2.27 pthread_attr_setstackaddr F
+GLIBC_2.27 pthread_attr_setstacksize F
+GLIBC_2.27 pthread_barrier_destroy F
+GLIBC_2.27 pthread_barrier_init F
+GLIBC_2.27 pthread_barrier_wait F
+GLIBC_2.27 pthread_barrierattr_destroy F
+GLIBC_2.27 pthread_barrierattr_getpshared F
+GLIBC_2.27 pthread_barrierattr_init F
+GLIBC_2.27 pthread_barrierattr_setpshared F
+GLIBC_2.27 pthread_cancel F
+GLIBC_2.27 pthread_cond_broadcast F
+GLIBC_2.27 pthread_cond_destroy F
+GLIBC_2.27 pthread_cond_init F
+GLIBC_2.27 pthread_cond_signal F
+GLIBC_2.27 pthread_cond_timedwait F
+GLIBC_2.27 pthread_cond_wait F
+GLIBC_2.27 pthread_condattr_destroy F
+GLIBC_2.27 pthread_condattr_getclock F
+GLIBC_2.27 pthread_condattr_getpshared F
+GLIBC_2.27 pthread_condattr_init F
+GLIBC_2.27 pthread_condattr_setclock F
+GLIBC_2.27 pthread_condattr_setpshared F
+GLIBC_2.27 pthread_create F
+GLIBC_2.27 pthread_detach F
+GLIBC_2.27 pthread_equal F
+GLIBC_2.27 pthread_exit F
+GLIBC_2.27 pthread_getaffinity_np F
+GLIBC_2.27 pthread_getattr_default_np F
+GLIBC_2.27 pthread_getattr_np F
+GLIBC_2.27 pthread_getconcurrency F
+GLIBC_2.27 pthread_getcpuclockid F
+GLIBC_2.27 pthread_getname_np F
+GLIBC_2.27 pthread_getschedparam F
+GLIBC_2.27 pthread_getspecific F
+GLIBC_2.27 pthread_join F
+GLIBC_2.27 pthread_key_create F
+GLIBC_2.27 pthread_key_delete F
+GLIBC_2.27 pthread_kill F
+GLIBC_2.27 pthread_kill_other_threads_np F
+GLIBC_2.27 pthread_mutex_consistent F
+GLIBC_2.27 pthread_mutex_consistent_np F
+GLIBC_2.27 pthread_mutex_destroy F
+GLIBC_2.27 pthread_mutex_getprioceiling F
+GLIBC_2.27 pthread_mutex_init F
+GLIBC_2.27 pthread_mutex_lock F
+GLIBC_2.27 pthread_mutex_setprioceiling F
+GLIBC_2.27 pthread_mutex_timedlock F
+GLIBC_2.27 pthread_mutex_trylock F
+GLIBC_2.27 pthread_mutex_unlock F
+GLIBC_2.27 pthread_mutexattr_destroy F
+GLIBC_2.27 pthread_mutexattr_getkind_np F
+GLIBC_2.27 pthread_mutexattr_getprioceiling F
+GLIBC_2.27 pthread_mutexattr_getprotocol F
+GLIBC_2.27 pthread_mutexattr_getpshared F
+GLIBC_2.27 pthread_mutexattr_getrobust F
+GLIBC_2.27 pthread_mutexattr_getrobust_np F
+GLIBC_2.27 pthread_mutexattr_gettype F
+GLIBC_2.27 pthread_mutexattr_init F
+GLIBC_2.27 pthread_mutexattr_setkind_np F
+GLIBC_2.27 pthread_mutexattr_setprioceiling F
+GLIBC_2.27 pthread_mutexattr_setprotocol F
+GLIBC_2.27 pthread_mutexattr_setpshared F
+GLIBC_2.27 pthread_mutexattr_setrobust F
+GLIBC_2.27 pthread_mutexattr_setrobust_np F
+GLIBC_2.27 pthread_mutexattr_settype F
+GLIBC_2.27 pthread_once F
+GLIBC_2.27 pthread_rwlock_destroy F
+GLIBC_2.27 pthread_rwlock_init F
+GLIBC_2.27 pthread_rwlock_rdlock F
+GLIBC_2.27 pthread_rwlock_timedrdlock F
+GLIBC_2.27 pthread_rwlock_timedwrlock F
+GLIBC_2.27 pthread_rwlock_tryrdlock F
+GLIBC_2.27 pthread_rwlock_trywrlock F
+GLIBC_2.27 pthread_rwlock_unlock F
+GLIBC_2.27 pthread_rwlock_wrlock F
+GLIBC_2.27 pthread_rwlockattr_destroy F
+GLIBC_2.27 pthread_rwlockattr_getkind_np F
+GLIBC_2.27 pthread_rwlockattr_getpshared F
+GLIBC_2.27 pthread_rwlockattr_init F
+GLIBC_2.27 pthread_rwlockattr_setkind_np F
+GLIBC_2.27 pthread_rwlockattr_setpshared F
+GLIBC_2.27 pthread_setaffinity_np F
+GLIBC_2.27 pthread_setattr_default_np F
+GLIBC_2.27 pthread_setcancelstate F
+GLIBC_2.27 pthread_setcanceltype F
+GLIBC_2.27 pthread_setconcurrency F
+GLIBC_2.27 pthread_setname_np F
+GLIBC_2.27 pthread_setschedparam F
+GLIBC_2.27 pthread_setschedprio F
+GLIBC_2.27 pthread_setspecific F
+GLIBC_2.27 pthread_sigmask F
+GLIBC_2.27 pthread_sigqueue F
+GLIBC_2.27 pthread_spin_destroy F
+GLIBC_2.27 pthread_spin_init F
+GLIBC_2.27 pthread_spin_lock F
+GLIBC_2.27 pthread_spin_trylock F
+GLIBC_2.27 pthread_spin_unlock F
+GLIBC_2.27 pthread_testcancel F
+GLIBC_2.27 pthread_timedjoin_np F
+GLIBC_2.27 pthread_tryjoin_np F
+GLIBC_2.27 pthread_yield F
+GLIBC_2.27 pwrite F
+GLIBC_2.27 pwrite64 F
+GLIBC_2.27 raise F
+GLIBC_2.27 read F
+GLIBC_2.27 recv F
+GLIBC_2.27 recvfrom F
+GLIBC_2.27 recvmsg F
+GLIBC_2.27 sem_close F
+GLIBC_2.27 sem_destroy F
+GLIBC_2.27 sem_getvalue F
+GLIBC_2.27 sem_init F
+GLIBC_2.27 sem_open F
+GLIBC_2.27 sem_post F
+GLIBC_2.27 sem_timedwait F
+GLIBC_2.27 sem_trywait F
+GLIBC_2.27 sem_unlink F
+GLIBC_2.27 sem_wait F
+GLIBC_2.27 send F
+GLIBC_2.27 sendmsg F
+GLIBC_2.27 sendto F
+GLIBC_2.27 sigaction F
+GLIBC_2.27 sigwait F
+GLIBC_2.27 tcdrain F
+GLIBC_2.27 wait F
+GLIBC_2.27 waitpid F
+GLIBC_2.27 write F
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libresolv.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libresolv.abilist
new file mode 100644
index 0000000000..eb9c1cb747
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libresolv.abilist
@@ -0,0 +1,79 @@
+GLIBC_2.27 __b64_ntop F
+GLIBC_2.27 __b64_pton F
+GLIBC_2.27 __dn_comp F
+GLIBC_2.27 __dn_count_labels F
+GLIBC_2.27 __dn_expand F
+GLIBC_2.27 __dn_skipname F
+GLIBC_2.27 __fp_nquery F
+GLIBC_2.27 __fp_query F
+GLIBC_2.27 __fp_resstat F
+GLIBC_2.27 __hostalias F
+GLIBC_2.27 __loc_aton F
+GLIBC_2.27 __loc_ntoa F
+GLIBC_2.27 __p_cdname F
+GLIBC_2.27 __p_cdnname F
+GLIBC_2.27 __p_class F
+GLIBC_2.27 __p_class_syms D 0xa8
+GLIBC_2.27 __p_fqname F
+GLIBC_2.27 __p_fqnname F
+GLIBC_2.27 __p_option F
+GLIBC_2.27 __p_query F
+GLIBC_2.27 __p_rcode F
+GLIBC_2.27 __p_time F
+GLIBC_2.27 __p_type F
+GLIBC_2.27 __p_type_syms D 0x450
+GLIBC_2.27 __putlong F
+GLIBC_2.27 __putshort F
+GLIBC_2.27 __res_close F
+GLIBC_2.27 __res_dnok F
+GLIBC_2.27 __res_hnok F
+GLIBC_2.27 __res_hostalias F
+GLIBC_2.27 __res_isourserver F
+GLIBC_2.27 __res_mailok F
+GLIBC_2.27 __res_mkquery F
+GLIBC_2.27 __res_nameinquery F
+GLIBC_2.27 __res_nmkquery F
+GLIBC_2.27 __res_nquery F
+GLIBC_2.27 __res_nquerydomain F
+GLIBC_2.27 __res_nsearch F
+GLIBC_2.27 __res_nsend F
+GLIBC_2.27 __res_ownok F
+GLIBC_2.27 __res_queriesmatch F
+GLIBC_2.27 __res_query F
+GLIBC_2.27 __res_querydomain F
+GLIBC_2.27 __res_search F
+GLIBC_2.27 __res_send F
+GLIBC_2.27 __sym_ntop F
+GLIBC_2.27 __sym_ntos F
+GLIBC_2.27 __sym_ston F
+GLIBC_2.27 _getlong F
+GLIBC_2.27 _getshort F
+GLIBC_2.27 inet_net_ntop F
+GLIBC_2.27 inet_net_pton F
+GLIBC_2.27 inet_neta F
+GLIBC_2.27 ns_datetosecs F
+GLIBC_2.27 ns_format_ttl F
+GLIBC_2.27 ns_get16 F
+GLIBC_2.27 ns_get32 F
+GLIBC_2.27 ns_initparse F
+GLIBC_2.27 ns_makecanon F
+GLIBC_2.27 ns_msg_getflag F
+GLIBC_2.27 ns_name_compress F
+GLIBC_2.27 ns_name_ntol F
+GLIBC_2.27 ns_name_ntop F
+GLIBC_2.27 ns_name_pack F
+GLIBC_2.27 ns_name_pton F
+GLIBC_2.27 ns_name_rollback F
+GLIBC_2.27 ns_name_skip F
+GLIBC_2.27 ns_name_uncompress F
+GLIBC_2.27 ns_name_unpack F
+GLIBC_2.27 ns_parse_ttl F
+GLIBC_2.27 ns_parserr F
+GLIBC_2.27 ns_put16 F
+GLIBC_2.27 ns_put32 F
+GLIBC_2.27 ns_samedomain F
+GLIBC_2.27 ns_samename F
+GLIBC_2.27 ns_skiprr F
+GLIBC_2.27 ns_sprintrr F
+GLIBC_2.27 ns_sprintrrf F
+GLIBC_2.27 ns_subdomain F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/librt.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/librt.abilist
new file mode 100644
index 0000000000..bfd262ecc5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/librt.abilist
@@ -0,0 +1,35 @@
+GLIBC_2.27 __mq_open_2 F
+GLIBC_2.27 aio_cancel F
+GLIBC_2.27 aio_cancel64 F
+GLIBC_2.27 aio_error F
+GLIBC_2.27 aio_error64 F
+GLIBC_2.27 aio_fsync F
+GLIBC_2.27 aio_fsync64 F
+GLIBC_2.27 aio_init F
+GLIBC_2.27 aio_read F
+GLIBC_2.27 aio_read64 F
+GLIBC_2.27 aio_return F
+GLIBC_2.27 aio_return64 F
+GLIBC_2.27 aio_suspend F
+GLIBC_2.27 aio_suspend64 F
+GLIBC_2.27 aio_write F
+GLIBC_2.27 aio_write64 F
+GLIBC_2.27 lio_listio F
+GLIBC_2.27 lio_listio64 F
+GLIBC_2.27 mq_close F
+GLIBC_2.27 mq_getattr F
+GLIBC_2.27 mq_notify F
+GLIBC_2.27 mq_open F
+GLIBC_2.27 mq_receive F
+GLIBC_2.27 mq_send F
+GLIBC_2.27 mq_setattr F
+GLIBC_2.27 mq_timedreceive F
+GLIBC_2.27 mq_timedsend F
+GLIBC_2.27 mq_unlink F
+GLIBC_2.27 shm_open F
+GLIBC_2.27 shm_unlink F
+GLIBC_2.27 timer_create F
+GLIBC_2.27 timer_delete F
+GLIBC_2.27 timer_getoverrun F
+GLIBC_2.27 timer_gettime F
+GLIBC_2.27 timer_settime F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libthread_db.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libthread_db.abilist
new file mode 100644
index 0000000000..4122e563a1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libthread_db.abilist
@@ -0,0 +1,40 @@
+GLIBC_2.27 td_init F
+GLIBC_2.27 td_log F
+GLIBC_2.27 td_symbol_list F
+GLIBC_2.27 td_ta_clear_event F
+GLIBC_2.27 td_ta_delete F
+GLIBC_2.27 td_ta_enable_stats F
+GLIBC_2.27 td_ta_event_addr F
+GLIBC_2.27 td_ta_event_getmsg F
+GLIBC_2.27 td_ta_get_nthreads F
+GLIBC_2.27 td_ta_get_ph F
+GLIBC_2.27 td_ta_get_stats F
+GLIBC_2.27 td_ta_map_id2thr F
+GLIBC_2.27 td_ta_map_lwp2thr F
+GLIBC_2.27 td_ta_new F
+GLIBC_2.27 td_ta_reset_stats F
+GLIBC_2.27 td_ta_set_event F
+GLIBC_2.27 td_ta_setconcurrency F
+GLIBC_2.27 td_ta_thr_iter F
+GLIBC_2.27 td_ta_tsd_iter F
+GLIBC_2.27 td_thr_clear_event F
+GLIBC_2.27 td_thr_dbresume F
+GLIBC_2.27 td_thr_dbsuspend F
+GLIBC_2.27 td_thr_event_enable F
+GLIBC_2.27 td_thr_event_getmsg F
+GLIBC_2.27 td_thr_get_info F
+GLIBC_2.27 td_thr_getfpregs F
+GLIBC_2.27 td_thr_getgregs F
+GLIBC_2.27 td_thr_getxregs F
+GLIBC_2.27 td_thr_getxregsize F
+GLIBC_2.27 td_thr_set_event F
+GLIBC_2.27 td_thr_setfpregs F
+GLIBC_2.27 td_thr_setgregs F
+GLIBC_2.27 td_thr_setprio F
+GLIBC_2.27 td_thr_setsigpending F
+GLIBC_2.27 td_thr_setxregs F
+GLIBC_2.27 td_thr_sigsetmask F
+GLIBC_2.27 td_thr_tls_get_addr F
+GLIBC_2.27 td_thr_tlsbase F
+GLIBC_2.27 td_thr_tsd F
+GLIBC_2.27 td_thr_validate F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist
new file mode 100644
index 0000000000..cbfec8d46e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist
@@ -0,0 +1,6 @@
+GLIBC_2.27 forkpty F
+GLIBC_2.27 login F
+GLIBC_2.27 login_tty F
+GLIBC_2.27 logout F
+GLIBC_2.27 logwtmp F
+GLIBC_2.27 openpty F
diff --git a/sysdeps/unix/sysv/linux/riscv/setcontext.S b/sysdeps/unix/sysv/linux/riscv/setcontext.S
new file mode 100644
index 0000000000..9f1c7b41fd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/setcontext.S
@@ -0,0 +1,114 @@
+/* Set current context.
+ Copyright (C) 2009-2018 Free Software 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 "ucontext-macros.h"
+
+/* int __setcontext (const ucontext_t *ucp)
+
+ Restores the machine context in UCP and thereby resumes execution
+ in that context.
+
+ This implementation is intended to be used for *synchronous* context
+ switches only. Therefore, it does not have to restore anything
+ other than the PRESERVED state. */
+
+ .text
+LEAF (__setcontext)
+
+ mv t0, a0 /* Save ucp into t0. */
+
+/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
+ li a3, _NSIG8
+ mv a2, zero
+ add a1, a0, UCONTEXT_SIGMASK
+ li a0, SIG_SETMASK
+
+ li a7, SYS_ify (rt_sigprocmask)
+ scall
+
+ bltz a0, 99f
+
+ cfi_def_cfa (t0, 0)
+
+#ifndef __riscv_float_abi_soft
+ lw t1, MCONTEXT_FSR(t0)
+
+ RESTORE_FP_REG_CFI (fs0, 8, t0)
+ RESTORE_FP_REG_CFI (fs1, 9, t0)
+ RESTORE_FP_REG_CFI (fs2, 18, t0)
+ RESTORE_FP_REG_CFI (fs3, 19, t0)
+ RESTORE_FP_REG_CFI (fs4, 20, t0)
+ RESTORE_FP_REG_CFI (fs5, 21, t0)
+ RESTORE_FP_REG_CFI (fs6, 22, t0)
+ RESTORE_FP_REG_CFI (fs7, 23, t0)
+ RESTORE_FP_REG_CFI (fs8, 24, t0)
+ RESTORE_FP_REG_CFI (fs9, 25, t0)
+ RESTORE_FP_REG_CFI (fs10, 26, t0)
+ RESTORE_FP_REG_CFI (fs11, 27, t0)
+
+ fssr t1
+#endif /* __riscv_float_abi_soft */
+
+ /* Note the contents of argument registers will be random
+ unless makecontext() has been called. */
+ RESTORE_INT_REG (t1, 0, t0)
+ RESTORE_INT_REG_CFI (ra, 1, t0)
+ RESTORE_INT_REG (sp, 2, t0)
+ RESTORE_INT_REG_CFI (s0, 8, t0)
+ RESTORE_INT_REG_CFI (s1, 9, t0)
+ RESTORE_INT_REG (a0, 10, t0)
+ RESTORE_INT_REG (a1, 11, t0)
+ RESTORE_INT_REG (a2, 12, t0)
+ RESTORE_INT_REG (a3, 13, t0)
+ RESTORE_INT_REG (a4, 14, t0)
+ RESTORE_INT_REG (a5, 15, t0)
+ RESTORE_INT_REG (a6, 16, t0)
+ RESTORE_INT_REG (a7, 17, t0)
+ RESTORE_INT_REG_CFI (s2, 18, t0)
+ RESTORE_INT_REG_CFI (s3, 19, t0)
+ RESTORE_INT_REG_CFI (s4, 20, t0)
+ RESTORE_INT_REG_CFI (s5, 21, t0)
+ RESTORE_INT_REG_CFI (s6, 22, t0)
+ RESTORE_INT_REG_CFI (s7, 23, t0)
+ RESTORE_INT_REG_CFI (s8, 24, t0)
+ RESTORE_INT_REG_CFI (s9, 25, t0)
+ RESTORE_INT_REG_CFI (s10, 26, t0)
+ RESTORE_INT_REG_CFI (s11, 27, t0)
+
+ jr t1
+
+99: j __syscall_error
+
+PSEUDO_END (__setcontext)
+weak_alias (__setcontext, setcontext)
+
+LEAF (__start_context)
+
+ /* Terminate call stack by noting ra == 0. Happily, s0 == 0 here. */
+ cfi_register (ra, s0)
+
+ /* Call the function passed to makecontext. */
+ jalr s1
+
+ /* Invoke subsequent context if present, else exit(0). */
+ mv a0, s2
+ beqz s2, 1f
+ jal __setcontext
+1: j exit
+
+PSEUDO_END (__start_context)
diff --git a/sysdeps/unix/sysv/linux/riscv/shlib-versions b/sysdeps/unix/sysv/linux/riscv/shlib-versions
new file mode 100644
index 0000000000..98c9b29cc4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/shlib-versions
@@ -0,0 +1,9 @@
+DEFAULT GLIBC_2.27
+
+%if RISCV_ABI_XLEN == 64 && RISCV_ABI_FLEN == 64
+ld=ld-linux-riscv64-lp64d.so.1
+%elif RISCV_ABI_XLEN == 64 && RISCV_ABI_FLEN == 0
+ld=ld-linux-riscv64-lp64.so.1
+%else
+%error cannot determine ABI
+%endif
diff --git a/sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h b/sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h
new file mode 100644
index 0000000000..147695398d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h
@@ -0,0 +1,22 @@
+/* RISC-V definitions for signal handling calling conventions.
+ Copyright (C) 2000-2018 Free Software 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/ucontext.h>
+
+#define SIGCONTEXT siginfo_t *_si, ucontext_t *
+#define GET_PC(ctx) ((void *) ctx->uc_mcontext.__gregs[REG_PC])
diff --git a/sysdeps/unix/sysv/linux/riscv/swapcontext.S b/sysdeps/unix/sysv/linux/riscv/swapcontext.S
new file mode 100644
index 0000000000..75b58dc668
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/swapcontext.S
@@ -0,0 +1,125 @@
+/* Save and set current context.
+ Copyright (C) 2009-2018 Free Software 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 "ucontext-macros.h"
+
+/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
+
+LEAF (__swapcontext)
+ mv t0, a1 /* Save ucp into t0. */
+
+ SAVE_INT_REG (ra, 0, a0)
+ SAVE_INT_REG (ra, 1, a0)
+ SAVE_INT_REG (sp, 2, a0)
+ SAVE_INT_REG (s0, 8, a0)
+ SAVE_INT_REG (s1, 9, a0)
+ SAVE_INT_REG (x0, 10, a0) /* return 0 by overwriting a0. */
+ SAVE_INT_REG (s2, 18, a0)
+ SAVE_INT_REG (s3, 19, a0)
+ SAVE_INT_REG (s4, 20, a0)
+ SAVE_INT_REG (s5, 21, a0)
+ SAVE_INT_REG (s6, 22, a0)
+ SAVE_INT_REG (s7, 23, a0)
+ SAVE_INT_REG (s8, 24, a0)
+ SAVE_INT_REG (s9, 25, a0)
+ SAVE_INT_REG (s10, 26, a0)
+ SAVE_INT_REG (s11, 27, a0)
+
+#ifndef __riscv_float_abi_soft
+ frsr a1
+
+ SAVE_FP_REG (fs0, 8, a0)
+ SAVE_FP_REG (fs1, 9, a0)
+ SAVE_FP_REG (fs2, 18, a0)
+ SAVE_FP_REG (fs3, 19, a0)
+ SAVE_FP_REG (fs4, 20, a0)
+ SAVE_FP_REG (fs5, 21, a0)
+ SAVE_FP_REG (fs6, 22, a0)
+ SAVE_FP_REG (fs7, 23, a0)
+ SAVE_FP_REG (fs8, 24, a0)
+ SAVE_FP_REG (fs9, 25, a0)
+ SAVE_FP_REG (fs10, 26, a0)
+ SAVE_FP_REG (fs11, 27, a0)
+
+ sw a1, MCONTEXT_FSR(a0)
+#endif /* __riscv_float_abi_soft */
+
+/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask, _NSIG8) */
+ li a3, _NSIG8
+ add a2, a0, UCONTEXT_SIGMASK
+ add a1, t0, UCONTEXT_SIGMASK
+ li a0, SIG_SETMASK
+
+ li a7, SYS_ify (rt_sigprocmask)
+ scall
+
+ bltz a0, 99f
+
+#ifndef __riscv_float_abi_soft
+ lw t1, MCONTEXT_FSR(t0)
+
+ RESTORE_FP_REG (fs0, 8, t0)
+ RESTORE_FP_REG (fs1, 9, t0)
+ RESTORE_FP_REG (fs2, 18, t0)
+ RESTORE_FP_REG (fs3, 19, t0)
+ RESTORE_FP_REG (fs4, 20, t0)
+ RESTORE_FP_REG (fs5, 21, t0)
+ RESTORE_FP_REG (fs6, 22, t0)
+ RESTORE_FP_REG (fs7, 23, t0)
+ RESTORE_FP_REG (fs8, 24, t0)
+ RESTORE_FP_REG (fs9, 25, t0)
+ RESTORE_FP_REG (fs10, 26, t0)
+ RESTORE_FP_REG (fs11, 27, t0)
+
+ fssr t1
+#endif /* __riscv_float_abi_soft */
+
+ /* Note the contents of argument registers will be random
+ unless makecontext() has been called. */
+ RESTORE_INT_REG (t1, 0, t0)
+ RESTORE_INT_REG (ra, 1, t0)
+ RESTORE_INT_REG (sp, 2, t0)
+ RESTORE_INT_REG (s0, 8, t0)
+ RESTORE_INT_REG (s1, 9, t0)
+ RESTORE_INT_REG (a0, 10, t0)
+ RESTORE_INT_REG (a1, 11, t0)
+ RESTORE_INT_REG (a2, 12, t0)
+ RESTORE_INT_REG (a3, 13, t0)
+ RESTORE_INT_REG (a4, 14, t0)
+ RESTORE_INT_REG (a5, 15, t0)
+ RESTORE_INT_REG (a6, 16, t0)
+ RESTORE_INT_REG (a7, 17, t0)
+ RESTORE_INT_REG (s2, 18, t0)
+ RESTORE_INT_REG (s3, 19, t0)
+ RESTORE_INT_REG (s4, 20, t0)
+ RESTORE_INT_REG (s5, 21, t0)
+ RESTORE_INT_REG (s6, 22, t0)
+ RESTORE_INT_REG (s7, 23, t0)
+ RESTORE_INT_REG (s8, 24, t0)
+ RESTORE_INT_REG (s9, 25, t0)
+ RESTORE_INT_REG (s10, 26, t0)
+ RESTORE_INT_REG (s11, 27, t0)
+
+ jr t1
+
+
+99: j __syscall_error
+
+PSEUDO_END (__swapcontext)
+
+weak_alias (__swapcontext, swapcontext)
diff --git a/sysdeps/unix/sysv/linux/riscv/sys/cachectl.h b/sysdeps/unix/sysv/linux/riscv/sys/cachectl.h
new file mode 100644
index 0000000000..46a2cb6082
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sys/cachectl.h
@@ -0,0 +1,32 @@
+/* RISC-V instruction cache flushing interface
+ Copyright (C) 2017-2018 Free Software 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 _SYS_CACHECTL_H
+#define _SYS_CACHECTL_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+extern int __riscv_flush_icache (void *__start, void *__end,
+ unsigned long int __flags);
+
+__END_DECLS
+
+#endif /* sys/cachectl.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/sys/procfs.h b/sysdeps/unix/sysv/linux/riscv/sys/procfs.h
new file mode 100644
index 0000000000..518de56741
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sys/procfs.h
@@ -0,0 +1,114 @@
+/* Core image file related definitions, RISC-V version.
+ Copyright (C) 1996-2018 Free Software 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 _SYS_PROCFS_H
+#define _SYS_PROCFS_H 1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+ systems. It provides a definition of the core file format for ELF
+ used on Linux. */
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#include <sys/ucontext.h>
+
+/* ELF register definitions */
+#define ELF_NGREG NGREG
+#define ELF_NFPREG NFPREG
+
+typedef unsigned long int elf_greg_t;
+typedef unsigned long int elf_gregset_t[32];
+typedef union __riscv_mc_fp_state elf_fpregset_t;
+
+__BEGIN_DECLS
+
+struct elf_siginfo
+ {
+ int si_signo; /* Signal number. */
+ int si_code; /* Extra code. */
+ int si_errno; /* Errno. */
+ };
+
+
+/* Definitions to generate Intel SVR4-like core files. These mostly
+ have the same names as the SVR4 types with "elf_" tacked on the
+ front to prevent clashes with linux definitions, and the typedef
+ forms have been avoided. This is mostly like the SVR4 structure,
+ but more Linuxy, with things that Linux does not support and which
+ gdb doesn't really use excluded. Fields present but not used are
+ marked with "XXX". */
+struct elf_prstatus
+ {
+ struct elf_siginfo pr_info; /* Info associated with signal. */
+ short int pr_cursig; /* Current signal. */
+ unsigned long int pr_sigpend; /* Set of pending signals. */
+ unsigned long int pr_sighold; /* Set of held signals. */
+ __pid_t pr_pid;
+ __pid_t pr_ppid;
+ __pid_t pr_pgrp;
+ __pid_t pr_sid;
+ struct timeval pr_utime; /* User time. */
+ struct timeval pr_stime; /* System time. */
+ struct timeval pr_cutime; /* Cumulative user time. */
+ struct timeval pr_cstime; /* Cumulative system time. */
+ elf_gregset_t pr_reg; /* GP registers. */
+ int pr_fpvalid; /* True if math copro being used. */
+ };
+
+
+#define ELF_PRARGSZ (80) /* Number of chars for args */
+
+struct elf_prpsinfo
+ {
+ char pr_state; /* Numeric process state. */
+ char pr_sname; /* Char for pr_state. */
+ char pr_zomb; /* Zombie. */
+ char pr_nice; /* Nice val. */
+ unsigned long int pr_flag; /* Flags. */
+ long int pr_uid;
+ long int pr_gid;
+ int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ /* Lots missing */
+ char pr_fname[16]; /* Filename of executable. */
+ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
+ };
+
+/* The rest of this file provides the types for emulation of the
+ Solaris <proc_service.h> interfaces that should be implemented by
+ users of libthread_db. */
+
+/* Addresses. */
+typedef void *psaddr_t;
+
+/* Register sets. Linux has different names. */
+typedef elf_gregset_t prgregset_t;
+typedef elf_fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+ therefore habe only ine PID type. */
+typedef __pid_t lwpid_t;
+
+/* Process status and info. In the end we do provide typedefs for them. */
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+__END_DECLS
+
+#endif /* sys/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h b/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
new file mode 100644
index 0000000000..7df430b504
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
@@ -0,0 +1,110 @@
+/* struct ucontext definition, RISC-V version.
+ Copyright (C) 1997-2018 Free Software 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/>. */
+
+/* Don't rely on this, the interface is currently messed up and may need to
+ be broken to be fixed. */
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#include <features.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+typedef unsigned long int __riscv_mc_gp_state[32];
+
+#ifdef __USE_MISC
+# define NGREG 32
+
+# define REG_PC 0
+# define REG_RA 1
+# define REG_SP 2
+# define REG_TP 4
+# define REG_S0 8
+# define REG_S1 9
+# define REG_A0 10
+# define REG_S2 18
+# define REG_NARGS 8
+
+typedef unsigned long int greg_t;
+
+/* Container for all general registers. */
+typedef __riscv_mc_gp_state gregset_t;
+
+/* Container for floating-point state. */
+typedef union __riscv_mc_fp_state fpregset_t;
+#endif
+
+struct __riscv_mc_f_ext_state
+ {
+ unsigned int __f[32];
+ unsigned int __fcsr;
+ };
+
+struct __riscv_mc_d_ext_state
+ {
+ unsigned long long int __f[32];
+ unsigned int __fcsr;
+ };
+
+struct __riscv_mc_q_ext_state
+ {
+ unsigned long long int __f[64] __attribute__ ((__aligned__ (16)));
+ unsigned int __fcsr;
+ /* Reserved for expansion of sigcontext structure. Currently zeroed
+ upon signal, and must be zero upon sigreturn. */
+ unsigned int __glibc_reserved[3];
+ };
+
+union __riscv_mc_fp_state
+ {
+ struct __riscv_mc_f_ext_state __f;
+ struct __riscv_mc_d_ext_state __d;
+ struct __riscv_mc_q_ext_state __q;
+ };
+
+typedef struct mcontext_t
+ {
+ __riscv_mc_gp_state __gregs;
+ union __riscv_mc_fp_state __fpregs;
+ } mcontext_t;
+
+/* Userlevel context. */
+typedef struct ucontext_t
+ {
+ unsigned long int __uc_flags;
+ struct ucontext_t *uc_link;
+ stack_t uc_stack;
+ sigset_t uc_sigmask;
+ /* There's some padding here to allow sigset_t to be expanded in the
+ future. Though this is unlikely, other architectures put uc_sigmask
+ at the end of this structure and explicitly state it can be
+ expanded, so we didn't want to box ourselves in here. */
+ char __glibc_reserved[1024 / 8 - sizeof (sigset_t)];
+ /* We can't put uc_sigmask at the end of this structure because we need
+ to be able to expand sigcontext in the future. For example, the
+ vector ISA extension will almost certainly add ISA state. We want
+ to ensure all user-visible ISA state can be saved and restored via a
+ ucontext, so we're putting this at the end in order to allow for
+ infinite extensibility. Since we know this will be extended and we
+ assume sigset_t won't be extended an extreme amount, we're
+ prioritizing this. */
+ mcontext_t uc_mcontext;
+ } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/sys/user.h b/sysdeps/unix/sysv/linux/riscv/sys/user.h
new file mode 100644
index 0000000000..7e648f2d5c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sys/user.h
@@ -0,0 +1,23 @@
+/* Copyright (C) 2001-2018 Free Software 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 _SYS_USER_H
+#define _SYS_USER_H 1
+
+
+
+#endif /* _SYS_USER_H */
diff --git a/sysdeps/unix/sysv/linux/riscv/syscall.c b/sysdeps/unix/sysv/linux/riscv/syscall.c
new file mode 100644
index 0000000000..6589dde385
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/syscall.c
@@ -0,0 +1,35 @@
+/* system call interface. Linux/RISC-V version.
+ Copyright (C) 2001-2018 Free Software 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>
+
+long int
+syscall (long int syscall_number, long int arg1, long int arg2, long int arg3,
+ long int arg4, long int arg5, long int arg6, long int arg7)
+{
+ long int ret;
+ INTERNAL_SYSCALL_DECL (err);
+
+ ret = INTERNAL_SYSCALL_NCS (syscall_number, err, 7, arg1, arg2, arg3, arg4,
+ arg5, arg6, arg7);
+
+ if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+ return __syscall_error (ret);
+
+ return ret;
+}
diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.S b/sysdeps/unix/sysv/linux/riscv/sysdep.S
new file mode 100644
index 0000000000..0d9c0b5bd9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.S
@@ -0,0 +1,51 @@
+/* syscall error handlers
+ Copyright (C) 2011-2018 Free Software 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>
+
+#if IS_IN (libc)
+# define errno __libc_errno
+#endif
+
+ENTRY (__syscall_error)
+ mv t0, ra
+ /* Fall through to __syscall_set_errno. */
+END (__syscall_error)
+
+/* Non-standard calling convention: argument in a0, return address in t0,
+ and clobber only t1. */
+ENTRY (__syscall_set_errno)
+ /* We got here because a0 < 0, but only codes in the range [-4095, -1]
+ represent errors. Otherwise, just return the result normally. */
+ li t1, -4096
+ bleu a0, t1, 1f
+ neg a0, a0
+#if RTLD_PRIVATE_ERRNO
+ sw a0, rtld_errno, t1
+#elif defined(__PIC__)
+ la.tls.ie t1, errno
+ add t1, t1, tp
+ sw a0, 0(t1)
+#else
+ lui t1, %tprel_hi(errno)
+ add t1, t1, tp, %tprel_add(errno)
+ sw a0, %tprel_lo(errno)(t1)
+#endif
+ li a0, -1
+1: jr t0
+END (__syscall_set_errno)
diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
new file mode 100644
index 0000000000..5470ea3d2a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
@@ -0,0 +1,325 @@
+/* Assembly macros for RISC-V.
+ Copyright (C) 2011-2018
+ 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 _LINUX_RISCV_SYSDEP_H
+#define _LINUX_RISCV_SYSDEP_H 1
+
+#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
+#include <tls.h>
+
+#ifdef __ASSEMBLER__
+
+# include <sys/asm.h>
+
+# define ENTRY(name) LEAF(name)
+
+# define L(label) .L ## label
+
+/* Performs a system call, handling errors by setting errno. Linux indicates
+ errors by setting a0 to a value between -1 and -4095. */
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args) \
+ .text; \
+ .align 2; \
+ ENTRY (name); \
+ li a7, SYS_ify (syscall_name); \
+ scall; \
+ li a7, -4096; \
+ bgtu a0, a7, .Lsyscall_error ## name;
+
+# undef PSEUDO_END
+# define PSEUDO_END(sym) \
+ SYSCALL_ERROR_HANDLER (sym) \
+ ret; \
+ END (sym)
+
+# if !IS_IN (libc)
+# if RTLD_PRIVATE_ERRNO
+# define SYSCALL_ERROR_HANDLER(name) \
+.Lsyscall_error ## name: \
+ li t1, -4096; \
+ neg a0, a0; \
+ sw a0, rtld_errno, t1; \
+ li a0, -1;
+# elif defined (__PIC__)
+# define SYSCALL_ERROR_HANDLER(name) \
+.Lsyscall_error ## name: \
+ la.tls.ie t1, errno; \
+ add t1, t1, tp; \
+ neg a0, a0; \
+ sw a0, 0(t1); \
+ li a0, -1;
+# else
+# define SYSCALL_ERROR_HANDLER(name) \
+.Lsyscall_error ## name: \
+ lui t1, %tprel_hi(errno); \
+ add t1, t1, tp, %tprel_add(errno); \
+ neg a0, a0; \
+ sw a0, %tprel_lo(errno)(t1); \
+ li a0, -1;
+# endif
+# else
+# define SYSCALL_ERROR_HANDLER(name) \
+.Lsyscall_error ## name: \
+ j __syscall_error;
+# endif
+
+/* Performs a system call, not setting errno. */
+# undef PSEUDO_NEORRNO
+# define PSEUDO_NOERRNO(name, syscall_name, args) \
+ .align 2; \
+ ENTRY (name); \
+ li a7, SYS_ify (syscall_name); \
+ scall;
+
+# undef PSEUDO_END_NOERRNO
+# define PSEUDO_END_NOERRNO(name) \
+ END (name)
+
+# undef ret_NOERRNO
+# define ret_NOERRNO ret
+
+/* Perfroms a system call, returning the error code. */
+# undef PSEUDO_ERRVAL
+# define PSEUDO_ERRVAL(name, syscall_name, args) \
+ PSEUDO_NOERRNO (name, syscall_name, args) \
+ neg a0, a0;
+
+# undef PSEUDO_END_ERRVAL
+# define PSEUDO_END_ERRVAL(name) \
+ END (name)
+
+# undef ret_ERRVAL
+# define ret_ERRVAL ret
+
+#endif /* __ASSEMBLER__ */
+
+/* In order to get __set_errno() definition in INLINE_SYSCALL. */
+#ifndef __ASSEMBLER__
+# include <errno.h>
+#endif
+
+#include <sysdeps/unix/sysdep.h>
+
+#undef SYS_ify
+#define SYS_ify(syscall_name) __NR_##syscall_name
+
+#ifndef __ASSEMBLER__
+
+/* List of system calls which are supported as vsyscalls. */
+# define HAVE_CLOCK_GETRES_VSYSCALL 1
+# define HAVE_CLOCK_GETTIME_VSYSCALL 1
+# define HAVE_GETTIMEOFDAY_VSYSCALL 1
+# define HAVE_GETCPU_VSYSCALL 1
+
+/* Define a macro which expands into the inline wrapper code for a system
+ call. */
+# undef INLINE_SYSCALL
+# define INLINE_SYSCALL(name, nr, args...) \
+ ({ INTERNAL_SYSCALL_DECL (err); \
+ long int __sys_result = INTERNAL_SYSCALL (name, err, nr, args); \
+ if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (__sys_result, ))) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (__sys_result, )); \
+ __sys_result = (unsigned long) -1; \
+ } \
+ __sys_result; })
+
+# define INTERNAL_SYSCALL_DECL(err) do { } while (0)
+
+# define INTERNAL_SYSCALL_ERROR_P(val, err) \
+ ((unsigned long int) (val) > -4096UL)
+
+# define INTERNAL_SYSCALL_ERRNO(val, err) (-val)
+
+# define INTERNAL_SYSCALL(name, err, nr, args...) \
+ internal_syscall##nr (SYS_ify (name), err, args)
+
+# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ internal_syscall##nr (number, err, args)
+
+# define internal_syscall0(number, err, dummy...) \
+({ \
+ long int _sys_result; \
+ \
+ { \
+ register long int __a7 asm ("a7") = number; \
+ register long int __a0 asm ("a0"); \
+ __asm__ volatile ( \
+ "scall\n\t" \
+ : "=r" (__a0) \
+ : "r" (__a7) \
+ : __SYSCALL_CLOBBERS); \
+ _sys_result = __a0; \
+ } \
+ _sys_result; \
+})
+
+# define internal_syscall1(number, err, arg0) \
+({ \
+ long int _sys_result; \
+ \
+ { \
+ register long int __a7 asm ("a7") = number; \
+ register long int __a0 asm ("a0") = (long int) (arg0); \
+ __asm__ volatile ( \
+ "scall\n\t" \
+ : "+r" (__a0) \
+ : "r" (__a7) \
+ : __SYSCALL_CLOBBERS); \
+ _sys_result = __a0; \
+ } \
+ _sys_result; \
+})
+
+# define internal_syscall2(number, err, arg0, arg1) \
+({ \
+ long int _sys_result; \
+ \
+ { \
+ register long int __a7 asm ("a7") = number; \
+ register long int __a0 asm ("a0") = (long int) (arg0); \
+ register long int __a1 asm ("a1") = (long int) (arg1); \
+ __asm__ volatile ( \
+ "scall\n\t" \
+ : "+r" (__a0) \
+ : "r" (__a7), "r" (__a1) \
+ : __SYSCALL_CLOBBERS); \
+ _sys_result = __a0; \
+ } \
+ _sys_result; \
+})
+
+# define internal_syscall3(number, err, arg0, arg1, arg2) \
+({ \
+ long int _sys_result; \
+ \
+ { \
+ register long int __a7 asm ("a7") = number; \
+ register long int __a0 asm ("a0") = (long int) (arg0); \
+ register long int __a1 asm ("a1") = (long int) (arg1); \
+ register long int __a2 asm ("a2") = (long int) (arg2); \
+ __asm__ volatile ( \
+ "scall\n\t" \
+ : "+r" (__a0) \
+ : "r" (__a7), "r" (__a1), "r" (__a2) \
+ : __SYSCALL_CLOBBERS); \
+ _sys_result = __a0; \
+ } \
+ _sys_result; \
+})
+
+# define internal_syscall4(number, err, arg0, arg1, arg2, arg3) \
+({ \
+ long int _sys_result; \
+ \
+ { \
+ register long int __a7 asm ("a7") = number; \
+ register long int __a0 asm ("a0") = (long int) (arg0); \
+ register long int __a1 asm ("a1") = (long int) (arg1); \
+ register long int __a2 asm ("a2") = (long int) (arg2); \
+ register long int __a3 asm ("a3") = (long int) (arg3); \
+ __asm__ volatile ( \
+ "scall\n\t" \
+ : "+r" (__a0) \
+ : "r" (__a7), "r" (__a1), "r" (__a2), "r" (__a3) \
+ : __SYSCALL_CLOBBERS); \
+ _sys_result = __a0; \
+ } \
+ _sys_result; \
+})
+
+# define internal_syscall5(number, err, arg0, arg1, arg2, arg3, arg4) \
+({ \
+ long int _sys_result; \
+ \
+ { \
+ register long int __a7 asm ("a7") = number; \
+ register long int __a0 asm ("a0") = (long int) (arg0); \
+ register long int __a1 asm ("a1") = (long int) (arg1); \
+ register long int __a2 asm ("a2") = (long int) (arg2); \
+ register long int __a3 asm ("a3") = (long int) (arg3); \
+ register long int __a4 asm ("a4") = (long int) (arg4); \
+ __asm__ volatile ( \
+ "scall\n\t" \
+ : "+r" (__a0) \
+ : "r" (__a7), "r"(__a1), "r"(__a2), "r"(__a3), "r" (__a4) \
+ : __SYSCALL_CLOBBERS); \
+ _sys_result = __a0; \
+ } \
+ _sys_result; \
+})
+
+# define internal_syscall6(number, err, arg0, arg1, arg2, arg3, arg4, arg5) \
+({ \
+ long int _sys_result; \
+ \
+ { \
+ register long int __a7 asm ("a7") = number; \
+ register long int __a0 asm ("a0") = (long int) (arg0); \
+ register long int __a1 asm ("a1") = (long int) (arg1); \
+ register long int __a2 asm ("a2") = (long int) (arg2); \
+ register long int __a3 asm ("a3") = (long int) (arg3); \
+ register long int __a4 asm ("a4") = (long int) (arg4); \
+ register long int __a5 asm ("a5") = (long int) (arg5); \
+ __asm__ volatile ( \
+ "scall\n\t" \
+ : "+r" (__a0) \
+ : "r" (__a7), "r" (__a1), "r" (__a2), "r" (__a3), \
+ "r" (__a4), "r" (__a5) \
+ : __SYSCALL_CLOBBERS); \
+ _sys_result = __a0; \
+ } \
+ _sys_result; \
+})
+
+# define internal_syscall7(number, err, arg0, arg1, arg2, arg3, arg4, arg5, arg6) \
+({ \
+ long int _sys_result; \
+ \
+ { \
+ register long int __a7 asm ("a7") = number; \
+ register long int __a0 asm ("a0") = (long int) (arg0); \
+ register long int __a1 asm ("a1") = (long int) (arg1); \
+ register long int __a2 asm ("a2") = (long int) (arg2); \
+ register long int __a3 asm ("a3") = (long int) (arg3); \
+ register long int __a4 asm ("a4") = (long int) (arg4); \
+ register long int __a5 asm ("a5") = (long int) (arg5); \
+ register long int __a6 asm ("a6") = (long int) (arg6); \
+ __asm__ volatile ( \
+ "scall\n\t" \
+ : "+r" (__a0) \
+ : "r" (__a7), "r" (__a1), "r" (__a2), "r" (__a3), \
+ "r" (__a4), "r" (__a5), "r" (__a6) \
+ : __SYSCALL_CLOBBERS); \
+ _sys_result = __a0; \
+ } \
+ _sys_result; \
+})
+
+# define __SYSCALL_CLOBBERS "memory"
+
+extern long int __syscall_error (long int neg_errno);
+
+#endif /* ! __ASSEMBLER__ */
+
+/* Pointer mangling is not supported. */
+#define PTR_MANGLE(var) (void) (var)
+#define PTR_DEMANGLE(var) (void) (var)
+
+#endif /* linux/riscv/sysdep.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/ucontext-macros.h b/sysdeps/unix/sysv/linux/riscv/ucontext-macros.h
new file mode 100644
index 0000000000..a73c3a9b04
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/ucontext-macros.h
@@ -0,0 +1,49 @@
+/* Macros for ucontext routines.
+ Copyright (C) 2017-2018 Free Software 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 _LINUX_RISCV_UCONTEXT_MACROS_H
+#define _LINUX_RISCV_UCONTEXT_MACROS_H
+
+#include <sysdep.h>
+#include <sys/asm.h>
+
+#include "ucontext_i.h"
+
+#define MCONTEXT_FSR (32 * SZFREG + MCONTEXT_FPREGS)
+
+#define SAVE_FP_REG(name, num, base) \
+ FREG_S name, ((num) * SZFREG + MCONTEXT_FPREGS)(base)
+
+#define RESTORE_FP_REG(name, num, base) \
+ FREG_L name, ((num) * SZFREG + MCONTEXT_FPREGS)(base)
+
+#define RESTORE_FP_REG_CFI(name, num, base) \
+ RESTORE_FP_REG (name, num, base); \
+ cfi_offset (name, (num) * SZFREG + MCONTEXT_FPREGS)
+
+#define SAVE_INT_REG(name, num, base) \
+ REG_S name, ((num) * SZREG + MCONTEXT_GREGS)(base)
+
+#define RESTORE_INT_REG(name, num, base) \
+ REG_L name, ((num) * SZREG + MCONTEXT_GREGS)(base)
+
+#define RESTORE_INT_REG_CFI(name, num, base) \
+ RESTORE_INT_REG (name, num, base); \
+ cfi_offset (name, (num) * SZREG + MCONTEXT_GREGS)
+
+#endif /* _LINUX_RISCV_UCONTEXT_MACROS_H */
diff --git a/sysdeps/unix/sysv/linux/riscv/ucontext_i.sym b/sysdeps/unix/sysv/linux/riscv/ucontext_i.sym
new file mode 100644
index 0000000000..be55b26310
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/ucontext_i.sym
@@ -0,0 +1,31 @@
+#include <inttypes.h>
+#include <signal.h>
+#include <stddef.h>
+#include <sys/ucontext.h>
+
+-- Constants used by the rt_sigprocmask call.
+
+SIG_BLOCK
+SIG_SETMASK
+
+_NSIG8 (_NSIG / 8)
+
+-- Offsets of the fields in the ucontext_t structure.
+#define ucontext(member) offsetof (ucontext_t, member)
+#define stack(member) ucontext (uc_stack.member)
+#define mcontext(member) ucontext (uc_mcontext.member)
+
+UCONTEXT_FLAGS ucontext (__uc_flags)
+UCONTEXT_LINK ucontext (uc_link)
+UCONTEXT_STACK ucontext (uc_stack)
+UCONTEXT_MCONTEXT ucontext (uc_mcontext)
+UCONTEXT_SIGMASK ucontext (uc_sigmask)
+
+STACK_SP stack (ss_sp)
+STACK_SIZE stack (ss_size)
+STACK_FLAGS stack (ss_flags)
+
+MCONTEXT_GREGS mcontext (__gregs)
+MCONTEXT_FPREGS mcontext (__fpregs)
+
+UCONTEXT_SIZE sizeof (ucontext_t)
diff --git a/sysdeps/unix/sysv/linux/riscv/vfork.S b/sysdeps/unix/sysv/linux/riscv/vfork.S
new file mode 100644
index 0000000000..6c53e93a92
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/vfork.S
@@ -0,0 +1,44 @@
+/* vfork for Linux, RISC-V version.
+ Copyright (C) 2005-2018 Free Software 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/>. */
+
+/* vfork() is just a special case of clone(). */
+
+#include <sys/asm.h>
+#include <sysdep.h>
+#define __ASSEMBLY__
+#include <linux/sched.h>
+#include <asm/signal.h>
+
+ .text
+LEAF (__libc_vfork)
+
+ li a0, (CLONE_VFORK | CLONE_VM | SIGCHLD)
+ mv a1, sp
+
+ li a7, __NR_clone
+ scall
+
+ bltz a0, 1f
+ ret
+
+1: j __syscall_error
+END (__libc_vfork)
+
+weak_alias (__libc_vfork, vfork)
+strong_alias (__libc_vfork, __vfork)
+libc_hidden_def (__vfork)
diff --git a/sysdeps/unix/sysv/linux/s390/Makefile b/sysdeps/unix/sysv/linux/s390/Makefile
index 497ffd566c..77f38523b5 100644
--- a/sysdeps/unix/sysv/linux/s390/Makefile
+++ b/sysdeps/unix/sysv/linux/s390/Makefile
@@ -1,11 +1,10 @@
abi-variants := 32 64
-abi-32-options := -U__s390x__
abi-32-condition := __WORDSIZE == 32
-abi-64-options := -D__s390x__
abi-64-condition := __WORDSIZE == 64
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
endif
ifeq ($(subdir),stdlib)
@@ -17,14 +16,16 @@ sysdep_routines += dl-vdso
endif
ifeq ($(subdir),nptl)
-ifeq ($(enable-lock-elision),yes)
libpthread-sysdep_routines += elision-lock elision-unlock elision-timed \
elision-trylock
-elision-CFLAGS = -mhtm
+elision-CFLAGS = -mhtm -msoft-float
CFLAGS-elision-lock.c = $(elision-CFLAGS)
CFLAGS-elision-timed.c = $(elision-CFLAGS)
CFLAGS-elision-trylock.c = $(elision-CFLAGS)
CFLAGS-elision-unlock.c = $(elision-CFLAGS)
endif
+
+ifeq ($(subdir),misc)
+tests += tst-ptrace-singleblock
endif
diff --git a/sysdeps/unix/sysv/linux/s390/arch-fork.h b/sysdeps/unix/sysv/linux/s390/arch-fork.h
deleted file mode 100644
index 58a55d5ad6..0000000000
--- a/sysdeps/unix/sysv/linux/s390/arch-fork.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. S390 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Martin Schwidefsky <schwidefsky@de.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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 5, \
- 0, CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
- NULL, &THREAD_SELF->tid, NULL)
diff --git a/sysdeps/unix/sysv/linux/s390/bits/elfclass.h b/sysdeps/unix/sysv/linux/s390/bits/elfclass.h
index f7503f8a27..3b0e123af4 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/elfclass.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/elfclass.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/bits/environments.h b/sysdeps/unix/sysv/linux/s390/bits/environments.h
index be74565b38..ca0f57525a 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/environments.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/environments.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
index 91790dcaf9..ac36abbac5 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/bits/hwcap.h b/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
index 468000b6e0..2564712399 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
@@ -1,5 +1,5 @@
/* Defines for bits in AT_HWCAP.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,3 +36,6 @@
#define HWCAP_S390_HIGH_GPRS 512
#define HWCAP_S390_TE 1024
#define HWCAP_S390_VX 2048
+#define HWCAP_S390_VXD 4096
+#define HWCAP_S390_VXE 8192
+#define HWCAP_S390_GS 16384
diff --git a/sysdeps/unix/sysv/linux/s390/bits/ipc.h b/sysdeps/unix/sysv/linux/s390/bits/ipc.h
index f7ffc90aeb..faacf1da67 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/bits/mman.h b/sysdeps/unix/sysv/linux/s390/bits/mman.h
index ffc90d3761..f103c1a65b 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/s390 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,6 +35,10 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_SYNC 0x80000 /* Perform synchronous page
+ faults for the mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Include generic Linux declarations. */
diff --git a/sysdeps/unix/sysv/linux/s390/bits/msq.h b/sysdeps/unix/sysv/linux/s390/bits/msq.h
index 6b49318d02..b5dee36af6 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -67,6 +67,7 @@ struct msqid_ds
/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12
+# define MSG_STAT_ANY 13
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
diff --git a/sysdeps/unix/sysv/linux/s390/bits/sem.h b/sysdeps/unix/sysv/linux/s390/bits/sem.h
index 1114eb2b98..1d0bd5cd9a 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -72,6 +72,7 @@ struct semid_ds
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
+# define SEM_STAT_ANY 20
struct seminfo
{
diff --git a/sysdeps/unix/sysv/linux/s390/bits/shm.h b/sysdeps/unix/sysv/linux/s390/bits/shm.h
index 93f96b62e0..65235ab85e 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -75,6 +75,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/s390/bits/sigaction.h b/sysdeps/unix/sysv/linux/s390/bits/sigaction.h
index d6ad0801ce..50c86cc527 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/sigaction.h
@@ -1,5 +1,5 @@
/* Definitions for 31 & 64 bit S/390 sigaction.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software 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,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGACTION_H
+#define _BITS_SIGACTION_H 1
+
#ifndef _SIGNAL_H
# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
#endif
@@ -27,7 +30,7 @@
struct sigaction
{
/* Signal handler. */
-#ifdef __USE_POSIX199309
+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
union
{
/* Used if SA_SIGINFO is not set. */
@@ -57,7 +60,7 @@ struct sigaction
struct sigaction
{
/* Signal handler. */
-#ifdef __USE_POSIX199309
+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
union
{
/* Used if SA_SIGINFO is not set. */
@@ -88,10 +91,10 @@ struct sigaction
#define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */
#define SA_SIGINFO 4 /* Invoke signal-catching function with
three arguments instead of one. */
-#if defined __USE_UNIX98 || defined __USE_MISC
+#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
#endif
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
its handler is being executed. */
@@ -110,3 +113,5 @@ struct sigaction
#define SIG_BLOCK 0 /* Block signals. */
#define SIG_UNBLOCK 1 /* Unblock signals. */
#define SIG_SETMASK 2 /* Set the set of blocked signals. */
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/bits/siginfo.h b/sysdeps/unix/sysv/linux/s390/bits/siginfo.h
deleted file mode 100644
index 32e88c256e..0000000000
--- a/sysdeps/unix/sysv/linux/s390/bits/siginfo.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/* siginfo_t, sigevent and constants. S/390 version.
- Copyright (C) 2001-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/>. */
-
-#if !defined _SIGNAL_H && !defined __need_siginfo_t \
- && !defined __need_sigevent_t
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-#if (!defined __have_sigval_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t \
- || defined __need_sigevent_t))
-# define __have_sigval_t 1
-
-/* Type for data associated with a signal. */
-typedef union sigval
- {
- int sival_int;
- void *sival_ptr;
- } sigval_t;
-#endif
-
-#if (!defined __have_siginfo_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t))
-# define __have_siginfo_t 1
-
-# define __SI_MAX_SIZE 128
-# if __WORDSIZE == 64
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-typedef struct
- {
- int si_signo; /* Signal number. */
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int si_code; /* Signal code. */
-
- union
- {
- int _pad[__SI_PAD_SIZE];
-
- /* kill(). */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- } _kill;
-
- /* POSIX.1b timers. */
- struct
- {
- int si_tid; /* Timer ID. */
- int si_overrun; /* Overrun count. */
- sigval_t si_sigval; /* Signal value. */
- } _timer;
-
- /* POSIX.1b signals. */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- sigval_t si_sigval; /* Signal value. */
- } _rt;
-
- /* SIGCHLD. */
- struct
- {
- __pid_t si_pid; /* Which child. */
- __uid_t si_uid; /* Real user ID of sending process. */
- int si_status; /* Exit value or signal. */
- __clock_t si_utime;
- __clock_t si_stime;
- } _sigchld;
-
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
- struct
- {
- void *si_addr; /* Faulting insn/memory ref. */
- short si_addr_lsb; /* Valid LSB of the reported address. */
- } _sigfault;
-
- /* SIGPOLL. */
- struct
- {
- long int si_band; /* Band event for SIGPOLL. */
- int si_fd;
- } _sigpoll;
-
- /* SIGSYS. */
- struct
- {
- void *_call_addr; /* Calling user insn. */
- int _syscall; /* Triggering system call number. */
- unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
- } _sigsys;
- } _sifields;
- } siginfo_t;
-
-
-/* X/Open requires some more fields with fixed names. */
-# define si_pid _sifields._kill.si_pid
-# define si_uid _sifields._kill.si_uid
-# define si_timerid _sifields._timer.si_tid
-# define si_overrun _sifields._timer.si_overrun
-# define si_status _sifields._sigchld.si_status
-# define si_utime _sifields._sigchld.si_utime
-# define si_stime _sifields._sigchld.si_stime
-# define si_value _sifields._rt.si_sigval
-# define si_int _sifields._rt.si_sigval.sival_int
-# define si_ptr _sifields._rt.si_sigval.sival_ptr
-# define si_addr _sifields._sigfault.si_addr
-# define si_addr_lsb _sifields._sigfault.si_addr_lsb
-# define si_band _sifields._sigpoll.si_band
-# define si_fd _sifields._sigpoll.si_fd
-# define si_call_addr _sifields._sigsys._call_addr
-# define si_syscall _sifields._sigsys._syscall
-# define si_arch _sifields._sigsys._arch
-
-
-/* Values for `si_code'. Positive values are reserved for kernel-generated
- signals. */
-enum
-{
- SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
-# define SI_ASYNCNL SI_ASYNCNL
- SI_TKILL = -6, /* Sent by tkill. */
-# define SI_TKILL SI_TKILL
- SI_SIGIO, /* Sent by queued SIGIO. */
-# define SI_SIGIO SI_SIGIO
- SI_ASYNCIO, /* Sent by AIO completion. */
-# define SI_ASYNCIO SI_ASYNCIO
- SI_MESGQ, /* Sent by real time mesq state change. */
-# define SI_MESGQ SI_MESGQ
- SI_TIMER, /* Sent by timer expiration. */
-# define SI_TIMER SI_TIMER
- SI_QUEUE, /* Sent by sigqueue. */
-# define SI_QUEUE SI_QUEUE
- SI_USER, /* Sent by kill, sigsend. */
-# define SI_USER SI_USER
- SI_KERNEL = 0x80 /* Send by kernel. */
-#define SI_KERNEL SI_KERNEL
-};
-
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGILL signal. */
-enum
-{
- ILL_ILLOPC = 1, /* Illegal opcode. */
-# define ILL_ILLOPC ILL_ILLOPC
- ILL_ILLOPN, /* Illegal operand. */
-# define ILL_ILLOPN ILL_ILLOPN
- ILL_ILLADR, /* Illegal addressing mode. */
-# define ILL_ILLADR ILL_ILLADR
- ILL_ILLTRP, /* Illegal trap. */
-# define ILL_ILLTRP ILL_ILLTRP
- ILL_PRVOPC, /* Privileged opcode. */
-# define ILL_PRVOPC ILL_PRVOPC
- ILL_PRVREG, /* Privileged register. */
-# define ILL_PRVREG ILL_PRVREG
- ILL_COPROC, /* Coprocessor error. */
-# define ILL_COPROC ILL_COPROC
- ILL_BADSTK /* Internal stack error. */
-# define ILL_BADSTK ILL_BADSTK
-};
-
-/* `si_code' values for SIGFPE signal. */
-enum
-{
- FPE_INTDIV = 1, /* Integer divide by zero. */
-# define FPE_INTDIV FPE_INTDIV
- FPE_INTOVF, /* Integer overflow. */
-# define FPE_INTOVF FPE_INTOVF
- FPE_FLTDIV, /* Floating point divide by zero. */
-# define FPE_FLTDIV FPE_FLTDIV
- FPE_FLTOVF, /* Floating point overflow. */
-# define FPE_FLTOVF FPE_FLTOVF
- FPE_FLTUND, /* Floating point underflow. */
-# define FPE_FLTUND FPE_FLTUND
- FPE_FLTRES, /* Floating point inexact result. */
-# define FPE_FLTRES FPE_FLTRES
- FPE_FLTINV, /* Floating point invalid operation. */
-# define FPE_FLTINV FPE_FLTINV
- FPE_FLTSUB /* Subscript out of range. */
-# define FPE_FLTSUB FPE_FLTSUB
-};
-
-/* `si_code' values for SIGSEGV signal. */
-enum
-{
- SEGV_MAPERR = 1, /* Address not mapped to object. */
-# define SEGV_MAPERR SEGV_MAPERR
- SEGV_ACCERR /* Invalid permissions for mapped object. */
-# define SEGV_ACCERR SEGV_ACCERR
-};
-
-/* `si_code' values for SIGBUS signal. */
-enum
-{
- BUS_ADRALN = 1, /* Invalid address alignment. */
-# define BUS_ADRALN BUS_ADRALN
- BUS_ADRERR, /* Non-existant physical address. */
-# define BUS_ADRERR BUS_ADRERR
- BUS_OBJERR, /* Object specific hardware error. */
-# define BUS_OBJERR BUS_OBJERR
- BUS_MCEERR_AR, /* Hardware memory error: action required. */
-# define BUS_MCEERR_AR BUS_MCEERR_AR
- BUS_MCEERR_AO /* Hardware memory error: action optional. */
-# define BUS_MCEERR_AO BUS_MCEERR_AO
-};
-# endif
-
-# ifdef __USE_XOPEN_EXTENDED
-/* `si_code' values for SIGTRAP signal. */
-enum
-{
- TRAP_BRKPT = 1, /* Process breakpoint. */
-# define TRAP_BRKPT TRAP_BRKPT
- TRAP_TRACE /* Process trace trap. */
-# define TRAP_TRACE TRAP_TRACE
-};
-# endif
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGCHLD signal. */
-enum
-{
- CLD_EXITED = 1, /* Child has exited. */
-# define CLD_EXITED CLD_EXITED
- CLD_KILLED, /* Child was killed. */
-# define CLD_KILLED CLD_KILLED
- CLD_DUMPED, /* Child terminated abnormally. */
-# define CLD_DUMPED CLD_DUMPED
- CLD_TRAPPED, /* Traced child has trapped. */
-# define CLD_TRAPPED CLD_TRAPPED
- CLD_STOPPED, /* Child has stopped. */
-# define CLD_STOPPED CLD_STOPPED
- CLD_CONTINUED /* Stopped child has continued. */
-# define CLD_CONTINUED CLD_CONTINUED
-};
-
-/* `si_code' values for SIGPOLL signal. */
-enum
-{
- POLL_IN = 1, /* Data input available. */
-# define POLL_IN POLL_IN
- POLL_OUT, /* Output buffers available. */
-# define POLL_OUT POLL_OUT
- POLL_MSG, /* Input message available. */
-# define POLL_MSG POLL_MSG
- POLL_ERR, /* I/O error. */
-# define POLL_ERR POLL_ERR
- POLL_PRI, /* High priority input available. */
-# define POLL_PRI POLL_PRI
- POLL_HUP /* Device disconnected. */
-# define POLL_HUP POLL_HUP
-};
-# endif
-
-# undef __need_siginfo_t
-#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
-
-
-#if (defined _SIGNAL_H || defined __need_sigevent_t) \
- && !defined __have_sigevent_t
-# define __have_sigevent_t 1
-
-/* Structure to transport application-defined values with signals. */
-# define __SIGEV_MAX_SIZE 64
-# if __WORDSIZE == 64
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-/* Forward declaration. */
-# ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-# endif
-
-typedef struct sigevent
- {
- sigval_t sigev_value;
- int sigev_signo;
- int sigev_notify;
-
- union
- {
- int _pad[__SIGEV_PAD_SIZE];
-
- /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
- thread to receive the signal. */
- __pid_t _tid;
-
- struct
- {
- void (*_function) (sigval_t); /* Function to start. */
- pthread_attr_t *_attribute; /* Thread attributes. */
- } _sigev_thread;
- } _sigev_un;
- } sigevent_t;
-
-/* POSIX names to access some of the members. */
-# define sigev_notify_function _sigev_un._sigev_thread._function
-# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
-
-/* `sigev_notify' values. */
-enum
-{
- SIGEV_SIGNAL = 0, /* Notify via signal. */
-# define SIGEV_SIGNAL SIGEV_SIGNAL
- SIGEV_NONE, /* Other notification: meaningless. */
-# define SIGEV_NONE SIGEV_NONE
- SIGEV_THREAD, /* Deliver via thread creation. */
-# define SIGEV_THREAD SIGEV_THREAD
-
- SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
-#define SIGEV_THREAD_ID SIGEV_THREAD_ID
-};
-
-#endif /* have _SIGNAL_H. */
diff --git a/sysdeps/unix/sysv/linux/s390/bits/stat.h b/sysdeps/unix/sysv/linux/s390/bits/stat.h
index 799b12f589..0b2be1362c 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/bits/statfs.h b/sysdeps/unix/sysv/linux/s390/bits/statfs.h
index bc8accd18b..559a1ae6c7 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
index 7ee0cef9fb..fdaa421958 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Linux/s390 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -75,6 +75,11 @@
/* Same for ino_t and ino64_t. */
# define __INO_T_MATCHES_INO64_T 1
+
+/* And for __rlim_t and __rlim64_t. */
+# define __RLIM_T_MATCHES_RLIM64_T 1
+#else
+# define __RLIM_T_MATCHES_RLIM64_T 0
#endif
/* Number of descriptors that can fit in an `fd_set'. */
diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmp.h b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
index ee990e9e80..b3fa362f47 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
@@ -1,5 +1,5 @@
/* The `struct utmp' type, describing entries in the utmp file. GNU version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -59,10 +59,13 @@ struct utmp
{
short int ut_type; /* Type of login. */
pid_t ut_pid; /* Process ID of login process. */
- char ut_line[UT_LINESIZE]; /* Devicename. */
+ char ut_line[UT_LINESIZE]
+ __attribute_nonstring__; /* Devicename. */
char ut_id[4]; /* Inittab ID. */
- char ut_user[UT_NAMESIZE]; /* Username. */
- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
+ char ut_user[UT_NAMESIZE]
+ __attribute_nonstring__; /* Username. */
+ char ut_host[UT_HOSTSIZE]
+ __attribute_nonstring__; /* Hostname for remote login. */
struct exit_status ut_exit; /* Exit status of a process marked
as DEAD_PROCESS. */
/* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h b/sysdeps/unix/sysv/linux/s390/bits/utmpx.h
index 608eaaea2f..3d3036c3b9 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/utmpx.h
@@ -1,5 +1,5 @@
/* Structures and definitions for the user accounting database. GNU version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/brk.c b/sysdeps/unix/sysv/linux/s390/brk.c
index c68fd99089..249f4936a9 100644
--- a/sysdeps/unix/sysv/linux/s390/brk.c
+++ b/sysdeps/unix/sysv/linux/s390/brk.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/dl-procinfo.h b/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
index 0c9f64bf68..d1516a05e3 100644
--- a/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
@@ -1,5 +1,5 @@
/* Linux/s390 version of processor capability information handling macros.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2006.
@@ -17,6 +17,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _DL_S390_PROCINFO_H
+#define _DL_S390_PROCINFO_H 1
#include <sysdeps/s390/dl-procinfo.h>
#include <ldsodefs.h>
@@ -44,3 +46,4 @@ _dl_procinfo (unsigned int type, unsigned long int word)
return 0;
}
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/elision-conf.c b/sysdeps/unix/sysv/linux/s390/elision-conf.c
index 4441fd93cc..9fa9747f6f 100644
--- a/sysdeps/unix/sysv/linux/s390/elision-conf.c
+++ b/sysdeps/unix/sysv/linux/s390/elision-conf.c
@@ -1,5 +1,5 @@
/* Lock elision tunable parameters.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,11 @@
#include <unistd.h>
#include <dl-procinfo.h>
+#if HAVE_TUNABLES
+# define TUNABLE_NAMESPACE elision
+#endif
+#include <elf/dl-tunables.h>
+
/* Reasonable initial tuning values, may be revised in the future.
This is a conservative initial value. */
@@ -53,6 +58,50 @@ struct elision_config __elision_aconf =
int __pthread_force_elision attribute_hidden = 0;
+#if HAVE_TUNABLES
+static inline void
+__always_inline
+do_set_elision_enable (int32_t elision_enable)
+{
+ /* Enable elision if it's avaliable in hardware. It's not necessary to check
+ if __libc_enable_secure isn't enabled since elision_enable will be set
+ according to the default, which is disabled. */
+ if (elision_enable == 1)
+ __pthread_force_elision = (GLRO (dl_hwcap) & HWCAP_S390_TE) ? 1 : 0;
+}
+
+/* The pthread->elision_enable tunable is 0 or 1 indicating that elision
+ should be disabled or enabled respectively. The feature will only be used
+ if it's supported by the hardware. */
+
+void
+TUNABLE_CALLBACK (set_elision_enable) (tunable_val_t *valp)
+{
+ int32_t elision_enable = (int32_t) valp->numval;
+ do_set_elision_enable (elision_enable);
+}
+
+#define TUNABLE_CALLBACK_FNDECL(__name, __type) \
+static inline void \
+__always_inline \
+do_set_elision_ ## __name (__type value) \
+{ \
+ __elision_aconf.__name = value; \
+} \
+void \
+TUNABLE_CALLBACK (set_elision_ ## __name) (tunable_val_t *valp) \
+{ \
+ __type value = (__type) (valp)->numval; \
+ do_set_elision_ ## __name (value); \
+}
+
+TUNABLE_CALLBACK_FNDECL (skip_lock_busy, int32_t);
+TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
+TUNABLE_CALLBACK_FNDECL (skip_lock_out_of_tbegin_retries, int32_t);
+TUNABLE_CALLBACK_FNDECL (try_tbegin, int32_t);
+TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
+#endif
+
/* Initialize elison. */
static void
@@ -60,11 +109,26 @@ elision_init (int argc __attribute__ ((unused)),
char **argv __attribute__ ((unused)),
char **environ)
{
- /* Set when the CPU and the kernel supports transactional execution.
- When false elision is never attempted. */
- int elision_available = (GLRO (dl_hwcap) & HWCAP_S390_TE) ? 1 : 0;
+#if HAVE_TUNABLES
+ /* Elision depends on tunables and must be explicitly turned on by setting
+ the appropriate tunable on a supported platform. */
+
+ TUNABLE_GET (enable, int32_t,
+ TUNABLE_CALLBACK (set_elision_enable));
+ TUNABLE_GET (skip_lock_busy, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_lock_busy));
+ TUNABLE_GET (skip_lock_internal_abort, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_lock_internal_abort));
+ TUNABLE_GET (skip_lock_after_retries, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_lock_out_of_tbegin_retries));
+ TUNABLE_GET (tries, int32_t,
+ TUNABLE_CALLBACK (set_elision_try_tbegin));
+ TUNABLE_GET (skip_trylock_internal_abort, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
+#endif
- __pthread_force_elision = __libc_enable_secure ? 0 : elision_available;
+ if (!__pthread_force_elision)
+ __elision_aconf.try_tbegin = 0; /* Disable elision on rwlocks. */
}
#ifdef SHARED
diff --git a/sysdeps/unix/sysv/linux/s390/elision-conf.h b/sysdeps/unix/sysv/linux/s390/elision-conf.h
index 46665756f0..f869e1d67b 100644
--- a/sysdeps/unix/sysv/linux/s390/elision-conf.h
+++ b/sysdeps/unix/sysv/linux/s390/elision-conf.h
@@ -1,5 +1,5 @@
/* Lock elision tunable parameters.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,7 +15,6 @@
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 ENABLE_LOCK_ELISION
#ifndef _ELISION_CONF_H
#define _ELISION_CONF_H 1
@@ -41,4 +40,3 @@ extern int __pthread_force_elision attribute_hidden;
#define HAVE_ELISION 1
#endif
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/elision-lock.c b/sysdeps/unix/sysv/linux/s390/elision-lock.c
index ecb507e989..e165d9d924 100644
--- a/sysdeps/unix/sysv/linux/s390/elision-lock.c
+++ b/sysdeps/unix/sysv/linux/s390/elision-lock.c
@@ -1,5 +1,5 @@
/* Elided pthread mutex lock.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
#include <pthread.h>
#include <pthreadP.h>
#include <lowlevellock.h>
-#include <htmintrin.h>
+#include <htm.h>
#include <elision-conf.h>
#include <stdint.h>
@@ -45,38 +45,41 @@
int
__lll_lock_elision (int *futex, short *adapt_count, EXTRAARG int private)
{
- if (*adapt_count > 0)
+ /* adapt_count can be accessed concurrently; these accesses can be both
+ inside of transactions (if critical sections are nested and the outer
+ critical section uses lock elision) and outside of transactions. Thus,
+ we need to use atomic accesses to avoid data races. However, the
+ value of adapt_count is just a hint, so relaxed MO accesses are
+ sufficient. */
+ if (atomic_load_relaxed (adapt_count) <= 0 && aconf.try_tbegin > 0)
{
- /* Lost updates are possible, but harmless. Due to races this might lead
- to *adapt_count becoming less than zero. */
- (*adapt_count)--;
- goto use_lock;
- }
-
- __asm__ volatile (".machinemode \"zarch_nohighgprs\"\n\t"
- ".machine \"all\""
- : : : "memory");
-
- int try_tbegin;
- for (try_tbegin = aconf.try_tbegin;
- try_tbegin > 0;
- try_tbegin--)
- {
- unsigned status;
- if (__builtin_expect
- ((status = __builtin_tbegin((void *)0)) == _HTM_TBEGIN_STARTED, 1))
+ /* Start a transaction and retry it automatically if it aborts with
+ _HTM_TBEGIN_TRANSIENT. This macro calls tbegin at most retry_cnt
+ + 1 times. The second argument is considered as retry_cnt. */
+ int status = __libc_tbegin_retry ((void *) 0, aconf.try_tbegin - 1);
+ if (__glibc_likely (status == _HTM_TBEGIN_STARTED))
{
- if (*futex == 0)
+ /* Check the futex to make sure nobody has touched it in the
+ mean time. This forces the futex into the cache and makes
+ sure the transaction aborts if another thread acquires the lock
+ concurrently. */
+ if (__glibc_likely (atomic_load_relaxed (futex) == 0))
+ /* Lock was free. Return to user code in a transaction. */
return 0;
- /* Lock was busy. Fall back to normal locking. */
- if (__builtin_expect (__builtin_tx_nesting_depth (), 1))
+
+ /* Lock was busy. Fall back to normal locking.
+ This can be the case if e.g. adapt_count was decremented to zero
+ by a former release and another thread has been waken up and
+ acquired it. */
+ if (__glibc_likely (__libc_tx_nesting_depth () <= 1))
{
/* In a non-nested transaction there is no need to abort,
- which is expensive. */
- __builtin_tend ();
+ which is expensive. Simply end the started transaction. */
+ __libc_tend ();
+ /* Don't try to use transactions for the next couple of times.
+ See above for why relaxed MO is sufficient. */
if (aconf.skip_lock_busy > 0)
- *adapt_count = aconf.skip_lock_busy;
- goto use_lock;
+ atomic_store_relaxed (adapt_count, aconf.skip_lock_busy);
}
else /* nesting depth is > 1 */
{
@@ -89,31 +92,34 @@ __lll_lock_elision (int *futex, short *adapt_count, EXTRAARG int private)
is zero.
The adapt_count of this inner mutex is not changed,
because using the default lock with the inner mutex
- would abort the outer transaction.
- */
- __builtin_tabort (_HTM_FIRST_USER_ABORT_CODE | 1);
+ would abort the outer transaction. */
+ __libc_tabort (_HTM_FIRST_USER_ABORT_CODE | 1);
+ __builtin_unreachable ();
}
}
+ else if (status != _HTM_TBEGIN_TRANSIENT)
+ {
+ /* A persistent abort (cc 1 or 3) indicates that a retry is
+ probably futile. Use the normal locking now and for the
+ next couple of calls.
+ Be careful to avoid writing to the lock. See above for why
+ relaxed MO is sufficient. */
+ if (aconf.skip_lock_internal_abort > 0)
+ atomic_store_relaxed (adapt_count,
+ aconf.skip_lock_internal_abort);
+ }
else
{
- if (status != _HTM_TBEGIN_TRANSIENT)
- {
- /* A persistent abort (cc 1 or 3) indicates that a retry is
- probably futile. Use the normal locking now and for the
- next couple of calls.
- Be careful to avoid writing to the lock. */
- if (aconf.skip_lock_internal_abort > 0)
- *adapt_count = aconf.skip_lock_internal_abort;
- goto use_lock;
- }
+ /* The transaction failed for some retries with
+ _HTM_TBEGIN_TRANSIENT. Use the normal locking now and for the
+ next couple of calls. */
+ if (aconf.skip_lock_out_of_tbegin_retries > 0)
+ atomic_store_relaxed (adapt_count,
+ aconf.skip_lock_out_of_tbegin_retries);
}
}
- /* Same logic as above, but for for a number of temporary failures in a
- row. */
- if (aconf.skip_lock_out_of_tbegin_retries > 0 && aconf.try_tbegin > 0)
- *adapt_count = aconf.skip_lock_out_of_tbegin_retries;
-
- use_lock:
+ /* Use normal locking as fallback path if the transaction does not
+ succeed. */
return LLL_LOCK ((*futex), private);
}
diff --git a/sysdeps/unix/sysv/linux/s390/elision-timed.c b/sysdeps/unix/sysv/linux/s390/elision-timed.c
index 9886b60439..592d6db64b 100644
--- a/sysdeps/unix/sysv/linux/s390/elision-timed.c
+++ b/sysdeps/unix/sysv/linux/s390/elision-timed.c
@@ -1,5 +1,5 @@
/* Lock elision timed lock.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/elision-trylock.c b/sysdeps/unix/sysv/linux/s390/elision-trylock.c
index 3d5a994ad9..2eb9b36772 100644
--- a/sysdeps/unix/sysv/linux/s390/elision-trylock.c
+++ b/sysdeps/unix/sysv/linux/s390/elision-trylock.c
@@ -1,5 +1,5 @@
/* Elided pthread mutex trylock.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
#include <pthread.h>
#include <pthreadP.h>
#include <lowlevellock.h>
-#include <htmintrin.h>
+#include <htm.h>
#include <elision-conf.h>
#define aconf __elision_aconf
@@ -30,15 +30,11 @@
int
__lll_trylock_elision (int *futex, short *adapt_count)
{
- __asm__ __volatile__ (".machinemode \"zarch_nohighgprs\"\n\t"
- ".machine \"all\""
- : : : "memory");
-
/* Implement POSIX semantics by forbiding nesting elided trylocks.
Sorry. After the abort the code is re-executed
non transactional and if the lock was already locked
return an error. */
- if (__builtin_tx_nesting_depth () > 0)
+ if (__libc_tx_nesting_depth () > 0)
{
/* Note that this abort may terminate an outermost transaction that
was created outside glibc.
@@ -46,49 +42,56 @@ __lll_trylock_elision (int *futex, short *adapt_count)
them to use the default lock instead of retrying transactions
until their try_tbegin is zero.
*/
- __builtin_tabort (_HTM_FIRST_USER_ABORT_CODE | 1);
+ __libc_tabort (_HTM_FIRST_USER_ABORT_CODE | 1);
+ __builtin_unreachable ();
}
- /* Only try a transaction if it's worth it. */
- if (*adapt_count <= 0)
+ /* adapt_count can be accessed concurrently; these accesses can be both
+ inside of transactions (if critical sections are nested and the outer
+ critical section uses lock elision) and outside of transactions. Thus,
+ we need to use atomic accesses to avoid data races. However, the
+ value of adapt_count is just a hint, so relaxed MO accesses are
+ sufficient. */
+ if (atomic_load_relaxed (adapt_count) <= 0 && aconf.try_tbegin > 0)
{
- unsigned status;
-
- if (__builtin_expect
- ((status = __builtin_tbegin ((void *)0)) == _HTM_TBEGIN_STARTED, 1))
+ int status = __libc_tbegin ((void *) 0);
+ if (__glibc_likely (status == _HTM_TBEGIN_STARTED))
{
- if (*futex == 0)
+ /* Check the futex to make sure nobody has touched it in the
+ mean time. This forces the futex into the cache and makes
+ sure the transaction aborts if another thread acquires the lock
+ concurrently. */
+ if (__glibc_likely (atomic_load_relaxed (futex) == 0))
+ /* Lock was free. Return to user code in a transaction. */
return 0;
- /* Lock was busy. Fall back to normal locking. */
- /* Since we are in a non-nested transaction there is no need to abort,
- which is expensive. */
- __builtin_tend ();
+
+ /* Lock was busy. Fall back to normal locking.
+ This can be the case if e.g. adapt_count was decremented to zero
+ by a former release and another thread has been waken up and
+ acquired it.
+ Since we are in a non-nested transaction there is no need to abort,
+ which is expensive. Simply end the started transaction. */
+ __libc_tend ();
/* Note: Changing the adapt_count here might abort a transaction on a
- different cpu, but that could happen anyway when the futex is
- acquired, so there's no need to check the nesting depth here. */
+ different CPU, but that could happen anyway when the futex is
+ acquired, so there's no need to check the nesting depth here.
+ See above for why relaxed MO is sufficient. */
if (aconf.skip_lock_busy > 0)
- *adapt_count = aconf.skip_lock_busy;
+ atomic_store_relaxed (adapt_count, aconf.skip_lock_busy);
}
- else
+ else if (status != _HTM_TBEGIN_TRANSIENT)
{
- if (status != _HTM_TBEGIN_TRANSIENT)
- {
- /* A persistent abort (cc 1 or 3) indicates that a retry is
- probably futile. Use the normal locking now and for the
- next couple of calls.
- Be careful to avoid writing to the lock. */
- if (aconf.skip_trylock_internal_abort > 0)
- *adapt_count = aconf.skip_trylock_internal_abort;
- }
+ /* A persistent abort (cc 1 or 3) indicates that a retry is
+ probably futile. Use the normal locking now and for the
+ next couple of calls.
+ Be careful to avoid writing to the lock. */
+ if (aconf.skip_trylock_internal_abort > 0)
+ *adapt_count = aconf.skip_trylock_internal_abort;
}
/* Could do some retries here. */
}
- else
- {
- /* Lost updates are possible, but harmless. Due to races this might lead
- to *adapt_count becoming less than zero. */
- (*adapt_count)--;
- }
+ /* Use normal locking as fallback path if the transaction does not
+ succeed. */
return lll_trylock (*futex);
}
diff --git a/sysdeps/unix/sysv/linux/s390/elision-unlock.c b/sysdeps/unix/sysv/linux/s390/elision-unlock.c
index 483abe15ff..ef14f9a744 100644
--- a/sysdeps/unix/sysv/linux/s390/elision-unlock.c
+++ b/sysdeps/unix/sysv/linux/s390/elision-unlock.c
@@ -1,5 +1,5 @@
/* Commit an elided pthread lock.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,21 +18,44 @@
#include <pthreadP.h>
#include <lowlevellock.h>
+#include <htm.h>
int
-__lll_unlock_elision(int *futex, int private)
+__lll_unlock_elision(int *futex, short *adapt_count, int private)
{
/* If the lock is free, we elided the lock earlier. This does not
necessarily mean that we are in a transaction, because the user code may
- have closed the transaction, but that is impossible to detect reliably. */
- if (*futex == 0)
+ have closed the transaction, but that is impossible to detect reliably.
+ Relaxed MO access to futex is sufficient because a correct program
+ will only release a lock it has acquired; therefore, it must either
+ changed the futex word's value to something !=0 or it must have used
+ elision; these are actions by the same thread, so these actions are
+ sequenced-before the relaxed load (and thus also happens-before the
+ relaxed load). Therefore, relaxed MO is sufficient. */
+ if (atomic_load_relaxed (futex) == 0)
{
- __asm__ volatile (".machinemode \"zarch_nohighgprs\"\n\t"
- ".machine \"all\""
- : : : "memory");
- __builtin_tend();
+ __libc_tend ();
}
else
- lll_unlock ((*futex), private);
+ {
+ /* Update the adapt_count while unlocking before completing the critical
+ section. adapt_count is accessed concurrently outside of a
+ transaction or a critical section (e.g. in elision-lock.c). So we need
+ to use atomic accesses. However, the value of adapt_count is just a
+ hint, so relaxed MO accesses are sufficient.
+ If adapt_count would be decremented while locking, multiple
+ CPUs, trying to lock the acquired mutex, will decrement adapt_count to
+ zero and another CPU will try to start a transaction, which will be
+ immediately aborted as the mutex is locked.
+ The update of adapt_count is done before releasing the lock as POSIX'
+ mutex destruction requirements disallow accesses to the mutex after it
+ has been released and thus could have been acquired or destroyed by
+ another thread. */
+ short adapt_count_val = atomic_load_relaxed (adapt_count);
+ if (adapt_count_val > 0)
+ atomic_store_relaxed (adapt_count, adapt_count_val - 1);
+
+ lll_unlock ((*futex), private);
+ }
return 0;
}
diff --git a/sysdeps/unix/sysv/linux/s390/force-elision.h b/sysdeps/unix/sysv/linux/s390/force-elision.h
index 994cf2ffe7..d8a1b9972f 100644
--- a/sysdeps/unix/sysv/linux/s390/force-elision.h
+++ b/sysdeps/unix/sysv/linux/s390/force-elision.h
@@ -1,5 +1,5 @@
/* Automatic enabling of elision for mutexes
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,7 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef ENABLE_LOCK_ELISION
/* Automatically enable elision for existing user lock kinds. */
#define FORCE_ELISION(m, s) \
if (__pthread_force_elision \
@@ -25,4 +24,3 @@
mutex->__data.__kind |= PTHREAD_MUTEX_ELISION_NP; \
s; \
}
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/fpu/s_fma.c b/sysdeps/unix/sysv/linux/s390/fpu/s_fma.c
deleted file mode 100644
index 2b2d505030..0000000000
--- a/sysdeps/unix/sysv/linux/s390/fpu/s_fma.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/s390/fpu/s_fma.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fma, fmal, GLIBC_2_1);
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/htm.h b/sysdeps/unix/sysv/linux/s390/htm.h
new file mode 100644
index 0000000000..b97f15f0c5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/htm.h
@@ -0,0 +1,187 @@
+/* Shared HTM header. Work around false transactional execution facility
+ intrinsics.
+
+ Copyright (C) 2016-2018 Free Software 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 _HTM_H
+#define _HTM_H 1
+
+#include <htmintrin.h>
+
+#ifdef __s390x__
+# define TX_FPRS_BYTES 64
+# define TX_SAVE_FPRS \
+ " std %%f8, 0(%[R_FPRS])\n\t" \
+ " std %%f9, 8(%[R_FPRS])\n\t" \
+ " std %%f10, 16(%[R_FPRS])\n\t" \
+ " std %%f11, 24(%[R_FPRS])\n\t" \
+ " std %%f12, 32(%[R_FPRS])\n\t" \
+ " std %%f13, 40(%[R_FPRS])\n\t" \
+ " std %%f14, 48(%[R_FPRS])\n\t" \
+ " std %%f15, 56(%[R_FPRS])\n\t"
+
+# define TX_RESTORE_FPRS \
+ " ld %%f8, 0(%[R_FPRS])\n\t" \
+ " ld %%f9, 8(%[R_FPRS])\n\t" \
+ " ld %%f10, 16(%[R_FPRS])\n\t" \
+ " ld %%f11, 24(%[R_FPRS])\n\t" \
+ " ld %%f12, 32(%[R_FPRS])\n\t" \
+ " ld %%f13, 40(%[R_FPRS])\n\t" \
+ " ld %%f14, 48(%[R_FPRS])\n\t" \
+ " ld %%f15, 56(%[R_FPRS])\n\t"
+
+#else
+
+# define TX_FPRS_BYTES 16
+# define TX_SAVE_FPRS \
+ " std %%f4, 0(%[R_FPRS])\n\t" \
+ " std %%f6, 8(%[R_FPRS])\n\t"
+
+# define TX_RESTORE_FPRS \
+ " ld %%f4, 0(%[R_FPRS])\n\t" \
+ " ld %%f6, 8(%[R_FPRS])\n\t"
+
+#endif /* ! __s390x__ */
+
+/* Use own inline assembly instead of __builtin_tbegin, as tbegin
+ has to filter program interruptions which can't be done with the builtin.
+ Now the fprs have to be saved / restored here, too.
+ The fpc is also not saved / restored with the builtin.
+ The used inline assembly does not clobber the volatile fprs / vrs!
+ Clobbering the latter ones would force the compiler to save / restore
+ the call saved fprs as those overlap with the vrs, but they only need to be
+ restored if the transaction fails but not if the transaction is successfully
+ started. Thus the user of the tbegin macros in this header file has to
+ compile the file / function with -msoft-float. It prevents gcc from using
+ fprs / vrs. */
+#define __libc_tbegin(tdb) __libc_tbegin_base(tdb,,,)
+
+#define __libc_tbegin_retry_output_regs , [R_TX_CNT] "+&d" (__tx_cnt)
+#define __libc_tbegin_retry_input_regs(retry_cnt) , [R_RETRY] "d" (retry_cnt)
+#define __libc_tbegin_retry_abort_path_insn \
+ /* If tbegin returned _HTM_TBEGIN_TRANSIENT, retry immediately so \
+ that max tbegin_cnt transactions are tried. Otherwise return and \
+ let the caller of this macro do the fallback path. */ \
+ " jnh 1f\n\t" /* cc 1/3: jump to fallback path. */ \
+ /* tbegin returned _HTM_TBEGIN_TRANSIENT: retry with transaction. */ \
+ " crje %[R_TX_CNT], %[R_RETRY], 1f\n\t" /* Reached max retries? */ \
+ " ahi %[R_TX_CNT], 1\n\t" \
+ " ppa %[R_TX_CNT], 0, 1\n\t" /* Transaction-Abort Assist. */ \
+ " j 2b\n\t" /* Loop to tbegin. */
+
+/* Same as __libc_tbegin except if tbegin aborts with _HTM_TBEGIN_TRANSIENT.
+ Then this macros restores the fpc, fprs and automatically retries up to
+ retry_cnt tbegins. Further saving of the state is omitted as it is already
+ saved. This macro calls tbegin at most as retry_cnt + 1 times. */
+#define __libc_tbegin_retry(tdb, retry_cnt) \
+ ({ int __ret; \
+ int __tx_cnt = 0; \
+ __ret = __libc_tbegin_base(tdb, \
+ __libc_tbegin_retry_abort_path_insn, \
+ __libc_tbegin_retry_output_regs, \
+ __libc_tbegin_retry_input_regs(retry_cnt)); \
+ __ret; \
+ })
+
+#define __libc_tbegin_base(tdb, abort_path_insn, output_regs, input_regs) \
+ ({ int __ret; \
+ int __fpc; \
+ char __fprs[TX_FPRS_BYTES]; \
+ __asm__ __volatile__ (".machine push\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ ".machine \"all\"\n\t" \
+ /* Save state at the outermost transaction. \
+ As extracting nesting depth is expensive \
+ on at least zEC12, save fprs at inner \
+ transactions, too. \
+ The fpc and fprs are saved here as they \
+ are not saved by tbegin. There exist no \
+ call-saved vrs, thus they are not saved \
+ here. */ \
+ " efpc %[R_FPC]\n\t" \
+ TX_SAVE_FPRS \
+ /* Begin transaction: save all gprs, allow \
+ ar modification and fp operations. Some \
+ program-interruptions (e.g. a null \
+ pointer access) are filtered and the \
+ transaction will abort. In this case \
+ the normal lock path will execute it \
+ again and result in a core dump wich does \
+ now show at tbegin but the real executed \
+ instruction. \
+ However it is not guaranteed that this \
+ retry operate on the same data and thus \
+ may not end in an program-interruption. \
+ Note: This could also be used to probe \
+ memory for being accessible! */ \
+ "2: tbegin 0, 0xFF0E\n\t" \
+ /* Branch away in abort case (this is the \
+ prefered sequence. See PoP in chapter 5 \
+ Transactional-Execution Facility \
+ Operation). */ \
+ " jnz 0f\n\t" \
+ /* Transaction has successfully started. */ \
+ " lhi %[R_RET], 0\n\t" \
+ " j 1f\n\t" \
+ /* Transaction has aborted. Now we are at \
+ the outermost transaction. Restore fprs \
+ and fpc. */ \
+ "0: ipm %[R_RET]\n\t" \
+ " srl %[R_RET], 28\n\t" \
+ " sfpc %[R_FPC]\n\t" \
+ TX_RESTORE_FPRS \
+ abort_path_insn \
+ "1:\n\t" \
+ ".machine pop\n" \
+ : [R_RET] "=&d" (__ret), \
+ [R_FPC] "=&d" (__fpc) \
+ output_regs \
+ : [R_FPRS] "a" (__fprs) \
+ input_regs \
+ : "cc", "memory"); \
+ __ret; \
+ })
+
+/* These builtins are usable in context of glibc lock elision code without any
+ changes. Use them. */
+#define __libc_tend() \
+ ({ __asm__ __volatile__ (".machine push\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ ".machine \"all\"\n\t"); \
+ int __ret = __builtin_tend (); \
+ __asm__ __volatile__ (".machine pop"); \
+ __ret; \
+ })
+
+#define __libc_tabort(abortcode) \
+ __asm__ __volatile__ (".machine push\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ ".machine \"all\"\n\t"); \
+ __builtin_tabort (abortcode); \
+ __asm__ __volatile__ (".machine pop")
+
+#define __libc_tx_nesting_depth() \
+ ({ __asm__ __volatile__ (".machine push\n\t" \
+ ".machinemode \"zarch_nohighgprs\"\n\t" \
+ ".machine \"all\"\n\t"); \
+ int __ret = __builtin_tx_nesting_depth (); \
+ __asm__ __volatile__ (".machine pop"); \
+ __ret; \
+ })
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/init-first.c b/sysdeps/unix/sysv/linux/s390/init-first.c
index d3a20fda30..3a862309bf 100644
--- a/sysdeps/unix/sysv/linux/s390/init-first.c
+++ b/sysdeps/unix/sysv/linux/s390/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. Linux/s390.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,6 +29,8 @@ long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
long int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *)
__attribute__ ((nocommon));
+long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
+ attribute_hidden;
static inline void
_libc_vdso_platform_setup (void)
@@ -46,6 +48,10 @@ _libc_vdso_platform_setup (void)
p = _dl_vdso_vsym ("__kernel_clock_getres", &linux2629);
PTR_MANGLE (p);
VDSO_SYMBOL (clock_getres) = p;
+
+ p = _dl_vdso_vsym ("__kernel_getcpu", &linux2629);
+ PTR_MANGLE (p);
+ VDSO_SYMBOL (getcpu) = p;
}
# define VDSO_SETUP _libc_vdso_platform_setup
diff --git a/sysdeps/unix/sysv/linux/s390/jmp-unwind.c b/sysdeps/unix/sysv/linux/s390/jmp-unwind.c
index d09dbbb00d..d653938777 100644
--- a/sysdeps/unix/sysv/linux/s390/jmp-unwind.c
+++ b/sysdeps/unix/sysv/linux/s390/jmp-unwind.c
@@ -1,5 +1,5 @@
/* Clean up stack frames unwound by longjmp. Linux/s390 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h
index b810542489..f718264926 100644
--- a/sysdeps/unix/sysv/linux/s390/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number. S/390 version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,26 +22,34 @@
/* Direct socketcalls available with kernel 4.3. */
#if __LINUX_KERNEL_VERSION >= 0x040300
-# define __ASSUME_RECVMMSG_SYSCALL 1
-# define __ASSUME_SENDMMSG_SYSCALL 1
# define __ASSUME_SOCKET_SYSCALL 1
# define __ASSUME_SOCKETPAIR_SYSCALL 1
# define __ASSUME_BIND_SYSCALL 1
-# define __ASSUME_CONNECT_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT4_SYSCALL 1
-# define __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL 1
# define __ASSUME_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
# define __ASSUME_GETPEERNAME_SYSCALL 1
-# define __ASSUME_SENDTO_SYSCALL 1
-# define __ASSUME_SENDTO_FOR_SEND_SYSCALL 1
-# define __ASSUME_SENDMSG_SYSCALL 1
-# define __ASSUME_RECVFROM_SYSCALL 1
-# define __ASSUME_RECVFROM_FOR_RECV_SYSCALL 1
-# define __ASSUME_RECVMSG_SYSCALL 1
# define __ASSUME_SHUTDOWN_SYSCALL 1
#endif
#include_next <kernel-features.h>
+
+#undef __ASSUME_ACCEPT_SYSCALL
+
+#if __LINUX_KERNEL_VERSION < 0x040300
+# undef __ASSUME_ACCEPT4_SYSCALL
+# undef __ASSUME_RECVMMSG_SYSCALL
+# undef __ASSUME_SENDMMSG_SYSCALL
+# undef __ASSUME_SENDMSG_SYSCALL
+# undef __ASSUME_RECVMSG_SYSCALL
+# undef __ASSUME_CONNECT_SYSCALL
+# undef __ASSUME_RECVFROM_SYSCALL
+# undef __ASSUME_SENDTO_SYSCALL
+#endif
+
+/* s390 only supports ipc syscall. */
+#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS2
diff --git a/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
new file mode 100644
index 0000000000..7a6a2c4f29
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/kernel_sigaction.h
@@ -0,0 +1,32 @@
+#include <bits/types/siginfo_t.h>
+
+#define SA_RESTORER 0x04000000
+
+/* This is the sigaction structure from the Linux 3.2 kernel. */
+struct kernel_sigaction
+{
+ union
+ {
+ __sighandler_t _sa_handler;
+ void (*_sa_sigaction)(int, siginfo_t *, void *);
+ } _u;
+#define k_sa_handler _u._sa_handler
+ /* The 'struct sigaction' definition in s390 kernel header
+ arch/s390/include/uapi/asm/signal.h is used for __NR_rt_sigaction
+ on 64 bits and for __NR_sigaction for 31 bits.
+
+ The expected layout for __NR_rt_sigaction for 31 bits is either
+ 'struct sigaction' from include/linux/signal_types.h or
+ 'struct compat_sigaction' from include/linux/compat.h.
+
+ So for __NR_rt_sigaction we can use the same layout for both s390x
+ and s390. */
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+ sigset_t sa_mask;
+};
+
+#define SET_SA_RESTORER(kact, act) \
+ (kact)->sa_restorer = (act)->sa_restorer
+#define RESET_SA_RESTORER(act, kact) \
+ (act)->sa_restorer = (kact)->sa_restorer
diff --git a/sysdeps/unix/sysv/linux/s390/ldconfig.h b/sysdeps/unix/sysv/linux/s390/ldconfig.h
index 661af55e53..59080e9095 100644
--- a/sysdeps/unix/sysv/linux/s390/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/s390/ldconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/libanl.abilist b/sysdeps/unix/sysv/linux/s390/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/s390/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/s390/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/s390/libc-vdso.h b/sysdeps/unix/sysv/linux/s390/libc-vdso.h
index d2a83161bb..664bd15f3d 100644
--- a/sysdeps/unix/sysv/linux/s390/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/s390/libc-vdso.h
@@ -1,5 +1,5 @@
/* Resolve function pointers to VDSO functions.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,6 +31,8 @@ extern long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
extern long int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);
+extern long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
+ attribute_hidden;
#endif
#endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/s390/localplt.data b/sysdeps/unix/sysv/linux/s390/localplt.data
index b25abf8006..e822e0a480 100644
--- a/sysdeps/unix/sysv/linux/s390/localplt.data
+++ b/sysdeps/unix/sysv/linux/s390/localplt.data
@@ -5,11 +5,14 @@ libc.so: malloc
libc.so: memalign
libc.so: realloc
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
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/s390/longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
index c5189f25cb..5c4b59284b 100644
--- a/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/sysdeps/unix/sysv/linux/s390/lowlevellock.h
index ada2e5b484..bd4b312d25 100644
--- a/sysdeps/unix/sysv/linux/s390/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/s390/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -22,7 +22,6 @@
#include <sysdeps/nptl/lowlevellock.h>
/* Transactional lock elision definitions. */
-# ifdef ENABLE_LOCK_ELISION
extern int __lll_timedlock_elision
(int *futex, short *adapt_count, const struct timespec *timeout, int private)
attribute_hidden;
@@ -33,7 +32,7 @@ extern int __lll_timedlock_elision
extern int __lll_lock_elision (int *futex, short *adapt_count, int private)
attribute_hidden;
-extern int __lll_unlock_elision(int *futex, int private)
+extern int __lll_unlock_elision(int *futex, short *adapt_count, int private)
attribute_hidden;
extern int __lll_trylock_elision(int *futex, short *adapt_count)
@@ -42,9 +41,8 @@ extern int __lll_trylock_elision(int *futex, short *adapt_count)
# define lll_lock_elision(futex, adapt_count, private) \
__lll_lock_elision (&(futex), &(adapt_count), private)
# define lll_unlock_elision(futex, adapt_count, private) \
- __lll_unlock_elision (&(futex), private)
+ __lll_unlock_elision (&(futex), &(adapt_count), private)
# define lll_trylock_elision(futex, adapt_count) \
__lll_trylock_elision(&(futex), &(adapt_count))
-# endif /* ENABLE_LOCK_ELISION */
#endif /* lowlevellock.h */
diff --git a/sysdeps/unix/sysv/linux/s390/mmap_internal.h b/sysdeps/unix/sysv/linux/s390/mmap_internal.h
new file mode 100644
index 0000000000..a0777c2682
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/mmap_internal.h
@@ -0,0 +1,32 @@
+/* mmap - map files or devices into memory. Linux/s390 version.
+ Copyright (C) 2017-2018 Free Software 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 MMAP_S390_INTERNAL_H
+# define MMAP_S390_INTERNAL_H
+
+#define MMAP_CALL(__nr, __addr, __len, __prot, __flags, __fd, __offset) \
+ ({ \
+ long int __args[6] = { (long int) (__addr), (long int) (__len), \
+ (long int) (__prot), (long int) (__flags), \
+ (long int) (__fd), (long int) (__offset) }; \
+ INLINE_SYSCALL_CALL (__nr, __args); \
+ })
+
+#include_next <mmap_internal.h>
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c b/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
index 10e825cb0f..bd41a84a18 100644
--- a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
+++ b/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,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_alias, __v2longjmp)
compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19);
-DEFINE_LONGJMP (__v2siglongjmp)
+strong_alias (siglongjmp_alias, __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/pthread_mutex_cond_lock.c b/sysdeps/unix/sysv/linux/s390/pthread_mutex_cond_lock.c
index 990d01c4ea..f93d3e4000 100644
--- a/sysdeps/unix/sysv/linux/s390/pthread_mutex_cond_lock.c
+++ b/sysdeps/unix/sysv/linux/s390/pthread_mutex_cond_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/pthread_mutex_lock.c b/sysdeps/unix/sysv/linux/s390/pthread_mutex_lock.c
index 00401f383d..ca4665441e 100644
--- a/sysdeps/unix/sysv/linux/s390/pthread_mutex_lock.c
+++ b/sysdeps/unix/sysv/linux/s390/pthread_mutex_lock.c
@@ -1,5 +1,5 @@
/* Elided version of pthread_mutex_lock.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/pthread_mutex_timedlock.c b/sysdeps/unix/sysv/linux/s390/pthread_mutex_timedlock.c
index 01ebd22830..b4a9837244 100644
--- a/sysdeps/unix/sysv/linux/s390/pthread_mutex_timedlock.c
+++ b/sysdeps/unix/sysv/linux/s390/pthread_mutex_timedlock.c
@@ -1,5 +1,5 @@
/* Elided version of pthread_mutex_timedlock.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/pthread_mutex_trylock.c b/sysdeps/unix/sysv/linux/s390/pthread_mutex_trylock.c
index 3bb6d93c92..60e66bef5f 100644
--- a/sysdeps/unix/sysv/linux/s390/pthread_mutex_trylock.c
+++ b/sysdeps/unix/sysv/linux/s390/pthread_mutex_trylock.c
@@ -1,5 +1,5 @@
/* Elided version of pthread_mutex_trylock.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/readelflib.c b/sysdeps/unix/sysv/linux/s390/readelflib.c
index 74c6e646ef..e937b75fbb 100644
--- a/sysdeps/unix/sysv/linux/s390/readelflib.c
+++ b/sysdeps/unix/sysv/linux/s390/readelflib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/Makefile b/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
index 626a96f04f..fd8cf92633 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
@@ -10,10 +10,6 @@ ifeq ($(subdir),misc)
sysdep_headers += sys/elf.h
endif
-ifeq ($(subdir),resource)
-sysdep_routines += oldgetrlimit64
-endif
-
ifeq ($(subdir),elf)
ifeq (yes,$(build-shared))
# This is needed to support g++ v2 and v3.
@@ -25,3 +21,11 @@ endif
ifeq ($(subdir),stdlib)
sysdep_routines += __makecontext_ret
endif
+
+ifeq ($(subdir),csu)
+ifeq (yes,$(build-shared))
+sysdep_routines += divdi3
+shared-only-routines += divdi3
+CPPFLAGS-divdi3.c = -Din_divdi3_c
+endif
+endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
index 156543d3eb..eb3a7b4776 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S b/sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S
index c177aebaa3..52c08a0ada 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software 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,40 +17,27 @@
#include <sysdep.h>
-/* We do not want .eh_frame info so that __makecontext_ret stops unwinding
- if backtrace was called within a context created by makecontext. (There
- is also no .eh_frame info for _start or thread_start.) */
-#undef cfi_startproc
-#define cfi_startproc
-#undef cfi_endproc
-#define cfi_endproc
-
ENTRY(__makecontext_ret)
+ /* Mark r14 as undefined in order to stop unwinding here! */
+ cfi_undefined (r14)
basr %r14,%r7
ltr %r8,%r8 /* Check whether uc_link is 0. */
jz 1f
lr %r2,%r8
br %r9
1: lhi %r2,0 /* EXIT return value. */
- basr %r13,0
-2:
-#ifdef PIC
- l %r12,4f-2b(%r13)
- la %r12,0(%r12,%r13) /* GOT pointer in r12 after this. */
- l %r1,3f-2b(%r13)
- bas %r14,0(%r1,%r12)
- .align 4
-3:
- .long HIDDEN_JUMPTARGET (exit)@GOTOFF
-4:
- .long _GLOBAL_OFFSET_TABLE_-2b
-#else
- l %r1,3f-2b(%r13)
- basr %r14,%r1
- .align 4
-3:
- .long HIDDEN_JUMPTARGET (exit)
+#ifdef NO_HIDDEN
+ /* If SHARED and NO_HIDDEN is defined, we need to setup got pointer
+ as HIDDEN_JUMPTARGET expands to JUMPTARGET which expands to
+ exit@PLT. Otherwise HIDDEN_JUMPTARGET expands to __GI_exit if
+ SHARED is defined and to exit if SHARED is not defined. */
+ SYSCALL_PIC_SETUP
#endif
- .align 2
+ basr %r1,0
+2:
+ al %r1,3f-2b(%r1)
+ basr %r14,%r1 /* Call exit. */
j .+2 /* Trap if exit returns for some reason. */
+3:
+ .long HIDDEN_JUMPTARGET (exit) - 2b
END(__makecontext_ret)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/alphasort64.c b/sysdeps/unix/sysv/linux/s390/s390-32/alphasort64.c
deleted file mode 100644
index 0b5ae47d2f..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/alphasort64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/alphasort64.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
index cb2afbb8d1..73ccc288a0 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
@@ -54,20 +54,16 @@ error:
PSEUDO_END (__clone)
thread_start:
- tmh %r3,1 /* CLONE_THREAD == 0x00010000 */
- jne 1f
- lhi %r2,-1
- tml %r3,256 /* CLONE_VM == 0x00000100 */
- jne 2f
- svc SYS_ify(getpid)
-2: ear %r3,%a0
- st %r2,PID(%r3)
- st %r2,TID(%r3)
-1:
+ cfi_startproc
+ /* Mark r14 as undefined in order to stop unwinding here! */
+ cfi_undefined (r14)
/* fn is in gpr 1, arg in gpr 0 */
lr %r2,%r0 /* set first parameter to void *arg */
ahi %r15,-96 /* make room on the stack for the save area */
xc 0(4,%r15),0(%r15)
basr %r14,%r1 /* jump to fn */
DO_CALL (exit, 1)
+ cfi_endproc
+
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/fcntl.c b/sysdeps/unix/sysv/linux/s390/s390-32/fcntl.c
deleted file mode 100644
index ea951bc4f9..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S b/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
index c5a74a3729..b95ea371fd 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getdents64.c b/sysdeps/unix/sysv/linux/s390/s390-32/getdents64.c
deleted file mode 100644
index 0c75fb5a06..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getdents64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getdents64.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c b/sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c
deleted file mode 100644
index fef018f471..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutent.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutent.c
index 2a9793b73b..c424774910 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutent.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c
index 6b047ea319..2928d63bf9 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutid.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutid.c
index 35f4935cad..6e36509a0a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutid.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c
index 48b074d434..79f8096688 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutline.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutline.c
index eb1c9bf770..dd1d98726e 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutline.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutline.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c
index 197d7bce33..c216947613 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c
index bf3d88054a..4d28c4a700 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c
index 1153d1ec93..f60c831fa3 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c
index c5404aeb77..c03f34b150 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c
index 3408b99720..9786e8bf0e 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/glob64-lstat-compat.c b/sysdeps/unix/sysv/linux/s390/s390-32/glob64-lstat-compat.c
new file mode 100644
index 0000000000..3016785fa1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/glob64-lstat-compat.c
@@ -0,0 +1,2 @@
+#define GLOB_NO_OLD_VERSION
+#include <sysdeps/unix/sysv/linux/glob64-lstat-compat.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h
new file mode 100644
index 0000000000..0f29ff90d0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 188
+#define SIGJMP_BUF_SIZE 188
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 56
+#define SAVED_MASK_OFFSET 60
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
index ec7491f5d7..0576c9575e 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
@@ -1,13 +1,8 @@
-GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
GLIBC_2.0 _r_debug D 0x14
GLIBC_2.0 calloc F
GLIBC_2.0 free F
GLIBC_2.0 malloc F
GLIBC_2.0 realloc F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_stack_end D 0x4
GLIBC_2.1 _dl_mcount F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_offset F
-GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libBrokenLocale.abilist
index 4a56bb68a3..54395f3c8d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 05cb85e5c1..3a5ec2a1e4 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -1313,7 +1311,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 _IO_2_1_stderr_ D 0xa0
GLIBC_2.1 _IO_2_1_stdin_ D 0xa0
GLIBC_2.1 _IO_2_1_stdout_ D 0xa0
@@ -1615,7 +1612,6 @@ GLIBC_2.1 xdr_uint16_t F
GLIBC_2.1 xdr_uint32_t F
GLIBC_2.1 xdr_uint8_t F
GLIBC_2.1 xdr_unixcred F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 _Exit F
GLIBC_2.1.1 __mempcpy_small F
GLIBC_2.1.1 __stpcpy_small F
@@ -1645,7 +1641,6 @@ GLIBC_2.1.1 xdr_longlong_t F
GLIBC_2.1.1 xdr_u_hyper F
GLIBC_2.1.1 xdr_u_longlong_t F
GLIBC_2.1.1 xdr_uint64_t F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
GLIBC_2.1.2 getaliasbyname_r F
GLIBC_2.1.2 getaliasent_r F
@@ -1673,11 +1668,9 @@ GLIBC_2.1.2 getservbyport_r F
GLIBC_2.1.2 getservent_r F
GLIBC_2.1.2 getspent_r F
GLIBC_2.1.2 getspnam_r F
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 __cxa_atexit F
GLIBC_2.1.3 __cxa_finalize F
GLIBC_2.1.3 __sigsuspend F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1703,7 +1696,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -1711,26 +1703,22 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x21c
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x21c
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1739,7 +1727,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -1750,16 +1737,13 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.19 GLIBC_2.19 A
GLIBC_2.19 __longjmp_chk F
GLIBC_2.19 __sigsetjmp F
GLIBC_2.19 _longjmp F
@@ -1768,7 +1752,6 @@ GLIBC_2.19 getcontext F
GLIBC_2.19 longjmp F
GLIBC_2.19 setjmp F
GLIBC_2.19 siglongjmp F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_adjust_wcolumn F
GLIBC_2.2 _IO_fgetpos F
GLIBC_2.2 _IO_fgetpos64 F
@@ -1944,33 +1927,81 @@ GLIBC_2.2 wcsftime F
GLIBC_2.2 wmempcpy F
GLIBC_2.2 wprintf F
GLIBC_2.2 wscanf F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf128 F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof128 F
+GLIBC_2.27 strtof128_l F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof128 F
+GLIBC_2.27 wcstof128_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2064,7 +2095,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2077,7 +2107,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x104
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2098,7 +2127,6 @@ GLIBC_2.3.3 sched_setaffinity F
GLIBC_2.3.3 semtimedop F
GLIBC_2.3.3 sys_sigabbrev D 0x104
GLIBC_2.3.3 sys_siglist D 0x104
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2128,7 +2156,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
@@ -2356,7 +2383,6 @@ GLIBC_2.4 wcstold F
GLIBC_2.4 wcstold_l F
GLIBC_2.4 wprintf F
GLIBC_2.4 wscanf F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2374,7 +2400,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2382,7 +2407,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2421,7 +2445,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __nldbl___asprintf_chk F
@@ -2438,7 +2461,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 getutent F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libcrypt.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libdl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libdl.abilist
index 5536f6e0a9..7826fde951 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 dlopen F
GLIBC_2.1 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
index 039ed5c521..643aa55498 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _LIB_VERSION D 0x4
GLIBC_2.0 acos F
GLIBC_2.0 acosf F
@@ -155,7 +154,6 @@ GLIBC_2.0 y1l F
GLIBC_2.0 yn F
GLIBC_2.0 ynf F
GLIBC_2.0 ynl F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __clog10 F
GLIBC_2.1 __clog10f F
GLIBC_2.1 __clog10l F
@@ -308,7 +306,6 @@ GLIBC_2.1 tgammal F
GLIBC_2.1 trunc F
GLIBC_2.1 truncf F
GLIBC_2.1 truncl F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -390,20 +387,652 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 fedisableexcept F
GLIBC_2.2 feenableexcept F
GLIBC_2.2 fegetexcept F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl 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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf128 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf128 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf128 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f128 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf128 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf128 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf128 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf128 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf128 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef128 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf128 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf128 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf128 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf128 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf128 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf128 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf128 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf128 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf128 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf128 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf128 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f128 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf128 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf128 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf128 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf128 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf128 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf128 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf128 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf128 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf128 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf128 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf128 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf128 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf128 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf128 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff128 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f128 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f128 F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf128 F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f128 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf128 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf128 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf128 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf128 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf128 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf128 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf128 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf128 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf128 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf128 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf128 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf128 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf128 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf128 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf128 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f128 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f128 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf128 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf128 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf128 F
+GLIBC_2.27 lgammaf128_r F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf128 F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf128 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf128 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f128 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf128 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f128 F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf128 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf128 F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf128 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf128 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff128 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf128 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf128 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf128 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf128 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf128 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf128 F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf128 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof128 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf128 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf128 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf128 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf128 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf128 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf128 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf128 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf128 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf128 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf128 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf128 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf128 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf128 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf128 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf128 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf128 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf128 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf128 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf128 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f128 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f128 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf128 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 __nldbl_daddl F
+GLIBC_2.28 __nldbl_ddivl F
+GLIBC_2.28 __nldbl_dmull F
+GLIBC_2.28 __nldbl_dsubl F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libnsl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libnsl.abilist
index a23db2aeaf..add3d66a7a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __free_fdresult F
GLIBC_2.1 __nis_default_access F
GLIBC_2.1 __nis_default_group F
@@ -120,5 +118,4 @@ GLIBC_2.1 readColdStartFile F
GLIBC_2.1 writeColdStartFile F
GLIBC_2.1 xdr_cback_data F
GLIBC_2.1 xdr_obj_p F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 xdr_ypall F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
index 3c5e11aafe..d05468f3b2 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_flockfile F
GLIBC_2.0 _IO_ftrylockfile F
GLIBC_2.0 _IO_funlockfile F
@@ -119,7 +118,6 @@ GLIBC_2.0 vfork F
GLIBC_2.0 wait F
GLIBC_2.0 waitpid F
GLIBC_2.0 write F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_allocate_rtsig F
GLIBC_2.1 __libc_current_sigrtmax F
GLIBC_2.1 __libc_current_sigrtmin F
@@ -154,27 +152,20 @@ GLIBC_2.1 sem_init F
GLIBC_2.1 sem_post F
GLIBC_2.1 sem_trywait F
GLIBC_2.1 sem_wait F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 sem_close F
GLIBC_2.1.1 sem_open F
GLIBC_2.1.1 sem_unlink F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.19 GLIBC_2.19 A
GLIBC_2.19 longjmp F
GLIBC_2.19 siglongjmp F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __open64 F
GLIBC_2.2 __pread64 F
GLIBC_2.2 __pthread_rwlock_destroy F
@@ -215,18 +206,35 @@ GLIBC_2.2 pthread_yield F
GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -242,13 +250,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libresolv.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libresolv.abilist
index 4d50e7c8c6..157a33ce35 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
index 15e4418863..595f1b712a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 aio_cancel F
GLIBC_2.1 aio_cancel64 F
GLIBC_2.1 aio_error F
@@ -16,7 +15,6 @@ GLIBC_2.1 aio_write F
GLIBC_2.1 aio_write64 F
GLIBC_2.1 lio_listio F
GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 clock_getcpuclockid F
GLIBC_2.2 clock_getres F
GLIBC_2.2 clock_gettime F
@@ -29,7 +27,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -40,8 +37,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libthread_db.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libutil.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libutil.abilist
index 8a99773ccf..bf735f7c00 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libutil.abilist
@@ -1,9 +1,7 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
GLIBC_2.0 logout F
GLIBC_2.0 logwtmp F
GLIBC_2.0 openpty F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 login F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/login.c b/sysdeps/unix/sysv/linux/s390/s390-32/login.c
index 1308de0041..8d5a8ba8aa 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/login.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/login.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/login32.c b/sysdeps/unix/sysv/linux/s390/s390-32/login32.c
index fe2409f3c7..256d107a23 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/login32.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/login32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c b/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
index b86de75ff7..d9b71cae33 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/mmap.S b/sysdeps/unix/sysv/linux/s390/s390-32/mmap.S
deleted file mode 100644
index f1e77c91df..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/mmap.S
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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
-
- .text
-ENTRY(__mmap)
- /* Save registers and setup stack frame. */
- stm %r6,%r15,24(%r15)
- cfi_offset (%r15, -36)
- cfi_offset (%r14, -40)
- cfi_offset (%r13, -44)
- cfi_offset (%r12, -48)
- cfi_offset (%r11, -52)
- cfi_offset (%r10, -56)
- cfi_offset (%r9, -60)
- cfi_offset (%r8, -64)
- cfi_offset (%r7, -68)
- cfi_offset (%r6, -72)
- lr %r1,%r15
- ahi %r15,-120 /* buy stack space */
- cfi_adjust_cfa_offset (120)
- st %r1,0(%r15) /* store back chain */
-
- /* Store parameters on stack, because mmap2
- * takes only one parameter: a pointer to the parameter area
- */
- st %r6,0x70(%r15) /* Store 'fd'. */
- st %r5,0x6C(%r15) /* Store 'flags'. */
- st %r4,0x68(%r15) /* Store 'prot'. */
- st %r3,0x64(%r15) /* Store 'length'. */
- st %r2,0x60(%r15) /* Store 'start'. */
- l %r1,216(%r15) /* Load offset. */
-
- tml %r1,0x0fff /* Offset page aligned ? */
- lhi %r2,-EINVAL
- jnz 1f /* No -> EINVAL. */
- srl %r1,12 /* mmap2 takes the offset in pages. */
- st %r1,0x74(%r15) /* Store page offset. */
- la %r2,0x60(%r15) /* Load address of parameter list. */
- svc SYS_ify(mmap2) /* Do the system call trap. */
-
-1: l %r15,0(%r15) /* Load back chain. */
- cfi_adjust_cfa_offset (-120)
- lm %r6,%r15,24(%r15) /* Load registers. */
-
- /* check gpr 2 for error */
- lhi %r0,-4096
- clr %r2,%r0
- jnl SYSCALL_ERROR_LABEL
-
- /* Successful; return the syscall's value. */
- br %r14
-
-PSEUDO_END (__mmap)
-
-weak_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S b/sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S
deleted file mode 100644
index 0e686bc73a..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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
-
- .text
-ENTRY(__mmap64)
- /* Save registers and setup stack frame. */
- stm %r6,%r15,24(%r15)
- cfi_offset (%r15, -36)
- cfi_offset (%r14, -40)
- cfi_offset (%r13, -44)
- cfi_offset (%r12, -48)
- cfi_offset (%r11, -52)
- cfi_offset (%r10, -56)
- cfi_offset (%r9, -60)
- cfi_offset (%r8, -64)
- cfi_offset (%r7, -68)
- cfi_offset (%r6, -72)
- lr %r1,%r15
- ahi %r15,-120 /* Buy stack space. */
- cfi_adjust_cfa_offset (120)
- st %r1,0(%r15) /* Store back chain. */
-
- /* Store parameters on stack, because mmap2
- * takes only one parameter: a pointer to the parameter area. */
- st %r6,0x70(%r15) /* Store 'fd'. */
- st %r5,0x6C(%r15) /* Store 'flags'. */
- st %r4,0x68(%r15) /* Store 'prot'. */
- st %r3,0x64(%r15) /* Store 'length'. */
- st %r2,0x60(%r15) /* Store 'start'. */
-
- lm %r0,%r1,216(%r15) /* Load 64 bit offset. */
- tml %r1,0x0fff /* Offset page aligned ? */
- jnz 2f /* No -> EINVAL. */
- srdl %r0,12 /* mmap2 takes the offset in pages. */
- ltr %r0,%r0 /* Offset > 2^44 ? */
- jnz 2f
- st %r1,0x74(%r15) /* Store page offset. */
-
- la %r2,0x60(%r15) /* Load address of parameter list. */
- svc SYS_ify(mmap2) /* Do the system call trap. */
-
- l %r15,0(%r15) /* Load back chain. */
- cfi_adjust_cfa_offset (-120)
- lm %r6,%r15,24(%r15) /* Load registers. */
-
- /* Check gpr 2 for error. */
- lhi %r0,-4096
- clr %r2,%r0
- jnl SYSCALL_ERROR_LABEL
-
- /* Successful; return the syscall's value. */
- br %r14
-
-2: lhi %r2,-EINVAL
- l %r15,0(%r15) /* Load back chain. */
- lm %r6,%r15,24(%r15) /* Load registers. */
- j SYSCALL_ERROR_LABEL
-
-PSEUDO_END (__mmap64)
-
-weak_alias (__mmap64, mmap64)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c
deleted file mode 100644
index 4c27e957bf..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/oldglob.c b/sysdeps/unix/sysv/linux/s390/s390-32/oldglob.c
new file mode 100644
index 0000000000..56d7d12ea6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/oldglob.c
@@ -0,0 +1,2 @@
+#define GLOB_NO_OLD_VERSION
+#include <sysdeps/unix/sysv/linux/oldglob.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c
index 469cb9070b..9f9326338f 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h b/sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h
index e093c2ac0d..a14b89cf08 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Linux/s390 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c b/sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c
index 2104f61634..705bf9c236 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c b/sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c
deleted file mode 100644
index 2ea26dd409..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/readdir64.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c
deleted file mode 100644
index 9f54f897e3..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h b/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h
index a5e0aea9dc..e230ac34dd 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/scandir64.c b/sysdeps/unix/sysv/linux/s390/s390-32/scandir64.c
deleted file mode 100644
index 506fd8877c..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/scandir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/scandir64.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S b/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
index 2acb368bbc..2dc42ab243 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setegid.c b/sysdeps/unix/sysv/linux/s390/s390-32/setegid.c
deleted file mode 100644
index 2e3a54c893..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setegid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setegid.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/seteuid.c b/sysdeps/unix/sysv/linux/s390/s390-32/seteuid.c
deleted file mode 100644
index 18e41d08c1..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/seteuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/seteuid.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setgid.c b/sysdeps/unix/sysv/linux/s390/s390-32/setgid.c
deleted file mode 100644
index 377021d9ec..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setgid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setgid.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setgroups.c b/sysdeps/unix/sysv/linux/s390/s390-32/setgroups.c
deleted file mode 100644
index 0e7086278f..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setgroups.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* We also have to rewrite the kernel gid_t to the user land type. */
-#include <sysdeps/unix/sysv/linux/i386/setgroups.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setregid.c b/sysdeps/unix/sysv/linux/s390/s390-32/setregid.c
deleted file mode 100644
index 99c57ad20f..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setregid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setregid.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setresgid.c b/sysdeps/unix/sysv/linux/s390/s390-32/setresgid.c
deleted file mode 100644
index daca1a4833..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setresgid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setresgid.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setresuid.c b/sysdeps/unix/sysv/linux/s390/s390-32/setresuid.c
deleted file mode 100644
index 3aeabe9ad7..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setresuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setresuid.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setreuid.c b/sysdeps/unix/sysv/linux/s390/s390-32/setreuid.c
deleted file mode 100644
index 8ad61226e9..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setreuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setuid.c b/sysdeps/unix/sysv/linux/s390/s390-32/setuid.c
deleted file mode 100644
index c8fa23e354..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setuid.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setuid.c>
-
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S b/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
index c676136904..52e69b2ece 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/syscall.S b/sysdeps/unix/sysv/linux/s390/s390-32/syscall.S
index 35999f206f..a78188be4f 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/syscall.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -49,19 +49,13 @@ ENTRY (syscall)
l %r6,192(%r15) /* fifth parameter */
l %r7,196(%r15) /* sixth parameter */
- basr %r8,0
-0: cl %r1,4f-0b(%r8) /* svc number < 256? */
- jl 2f
-1: svc 0
- j 3f
-2: ex %r1,1b-0b(%r8) /* lsb of R1 is subsituted as SVC number */
-3: l %r15,0(%r15) /* load back chain */
+ svc 0
+ l %r15,0(%r15) /* load back chain. */
cfi_adjust_cfa_offset (-96)
- lm %r6,15,24(%r15) /* load registers */
+ lm %r6,%r15,24(%r15) /* load registers. */
lhi %r0,-4095
clr %r2,%r0 /* check R2 for error */
jnl SYSCALL_ERROR_LABEL
br %r14 /* return to caller */
-4: .long 256
PSEUDO_END (syscall)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
index 141b16523d..300b13dd01 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
@@ -15,9 +15,6 @@ getgroups - getgroups32 i:ip __getgroups getgroups
setfsgid - setfsgid32 Ei:i setfsgid
setfsuid - setfsuid32 Ei:i setfsuid
-oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
-setrlimit - setrlimit i:ip __setrlimit setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
-
prlimit64 EXTRA prlimit64 i:iipp prlimit64
fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
personality EXTRA personality Ei:i __personality personality
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
deleted file mode 100644
index 2dda400b45..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
-L(pseudo_cancel): \
- cfi_startproc; \
- STM_##args \
- stm %r12,%r15,48(%r15); \
- cfi_offset (%r15, -36); \
- cfi_offset (%r14, -40); \
- cfi_offset (%r13, -44); \
- cfi_offset (%r12, -48); \
- lr %r14,%r15; \
- ahi %r15,-96; \
- cfi_adjust_cfa_offset (96); \
- st %r14,0(%r15); \
- basr %r13,0; \
-0: l %r1,1f-0b(%r13); \
- bas %r14,0(%r1,%r13); \
- lr %r0,%r2; \
- LM_##args \
- .if SYS_ify (syscall_name) < 256; \
- svc SYS_ify (syscall_name); \
- .else; \
- lhi %r1,SYS_ify (syscall_name); \
- svc 0; \
- .endif; \
- LR7_##args \
- l %r1,2f-0b(%r13); \
- lr %r12,%r2; \
- lr %r2,%r0; \
- bas %r14,0(%r1,%r13); \
- lr %r2,%r12; \
- lm %r12,%r15,48+96(%r15); \
- cfi_endproc; \
- j L(pseudo_check); \
-1: .long CENABLE-0b; \
-2: .long CDISABLE-0b; \
-ENTRY(name) \
- SINGLE_THREAD_P(%r1) \
- jne L(pseudo_cancel); \
-.type __##syscall_name##_nocancel,@function; \
-.globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- DO_CALL(syscall_name, args); \
-L(pseudo_check): \
- lhi %r4,-4095; \
- clr %r2,%r4; \
- jnl SYSCALL_ERROR_LABEL; \
-.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
-L(pseudo_end):
-
-# if IS_IN (libpthread)
-# define CENABLE __pthread_enable_asynccancel
-# define CDISABLE __pthread_disable_asynccancel
-# elif IS_IN (libc)
-# define CENABLE __libc_enable_asynccancel
-# define CDISABLE __libc_disable_asynccancel
-# elif IS_IN (librt)
-# define CENABLE __librt_enable_asynccancel
-# define CDISABLE __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-#define STM_0 /* Nothing */
-#define STM_1 st %r2,8(%r15);
-#define STM_2 stm %r2,%r3,8(%r15);
-#define STM_3 stm %r2,%r4,8(%r15);
-#define STM_4 stm %r2,%r5,8(%r15);
-#define STM_5 stm %r2,%r5,8(%r15);
-#define STM_6 stm %r2,%r7,8(%r15);
-
-#define LM_0 /* Nothing */
-#define LM_1 l %r2,8+96(%r15);
-#define LM_2 lm %r2,%r3,8+96(%r15);
-#define LM_3 lm %r2,%r4,8+96(%r15);
-#define LM_4 lm %r2,%r5,8+96(%r15);
-#define LM_5 lm %r2,%r5,8+96(%r15);
-#define LM_6 lm %r2,%r5,8+96(%r15); \
- cfi_offset (%r7, -68); \
- l %r7,96+96(%r15);
-
-#define LR7_0 /* Nothing */
-#define LR7_1 /* Nothing */
-#define LR7_2 /* Nothing */
-#define LR7_3 /* Nothing */
-#define LR7_4 /* Nothing */
-#define LR7_5 /* Nothing */
-#define LR7_6 l %r7,28+96(%r15); \
- cfi_restore (%r7);
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P(reg) \
- ear reg,%a0; \
- icm reg,15,MULTIPLE_THREADS_OFFSET(reg);
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
index fbc974a4c0..afc0f66a5f 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
index 3540416e0e..0d683a5bcb 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -271,46 +271,11 @@
#define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
#define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)
-#define CLOBBER_0 , "3", "4", "5"
-#define CLOBBER_1 , "3", "4", "5"
-#define CLOBBER_2 , "4", "5"
-#define CLOBBER_3 , "5"
-#define CLOBBER_4
-#define CLOBBER_5
-#define CLOBBER_6
-
/* List of system calls which are supported as vsyscalls. */
#define HAVE_CLOCK_GETRES_VSYSCALL 1
#define HAVE_CLOCK_GETTIME_VSYSCALL 1
#define HAVE_GETTIMEOFDAY_VSYSCALL 1
-
-/* This version is for internal uses when there is no desire
- to set errno */
-#define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...) \
- ({ \
- long int _ret = ENOSYS; \
- \
- __typeof (__vdso_##name) vdsop = __vdso_##name; \
- PTR_DEMANGLE (vdsop); \
- if (vdsop != NULL) \
- _ret = INTERNAL_VSYSCALL_CALL (vdsop, err, nr, ##args); \
- else \
- err = 1 << 28; \
- _ret; \
- })
-
-#define INTERNAL_VSYSCALL_CALL(fn, err, nr, args...) \
- ({ \
- DECLARGS_##nr(args) \
- register long _ret __asm__("2"); \
- __asm__ __volatile__ ( \
- "lr 10,14\n\t" \
- "basr 14,%1\n\t" \
- "lr 14,10\n\t" \
- : "=d" (_ret) \
- : "d" (fn) ASMFMT_##nr \
- : "cc", "memory", "0", "1", "10" CLOBBER_##nr); \
- _ret; })
+#define HAVE_GETCPU_VSYSCALL 1
/* Pointer mangling support. */
#if IS_IN (rtld)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c
index 93a1e0e3cb..b27ae89cc4 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c
index cf1ec962c5..2f4c82d408 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h
index ce9dd0fba1..e942645ad8 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h
index 58d4660d1a..877cbc4517 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c b/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c
index 52be3eccdc..8a72ea61b7 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h
index cf265beac1..05c5dc3b8b 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h
@@ -1,5 +1,5 @@
/* The `struct utmp' type, describing entries in the utmp file. GNU version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h
index 84887dd968..74397aabf6 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c
index c7adede94b..0b1978991f 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>.
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h
index 0cb671858f..37767d1e42 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h
@@ -1,5 +1,5 @@
/* The `struct utmp' type, describing entries in the utmp file. GNU version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/versionsort64.c b/sysdeps/unix/sysv/linux/s390/s390-32/versionsort64.c
deleted file mode 100644
index 144b691e56..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/versionsort64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/versionsort64.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S b/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S
index b7588ebd7c..58b7416073 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
@@ -28,21 +28,9 @@
and the process ID of the new process to the old process. */
ENTRY (__libc_vfork)
- ear %r4,%a0
- lhi %r1,1
- icm %r3,15,PID(%r4)
- sll %r1,31
- je 1f
- lcr %r1,%r3
-1: st %r1,PID(%r4)
-
/* Do vfork system call. */
svc SYS_ify (vfork)
- ltr %r2,%r2
- je 1f
- st %r3,PID(%r4)
-1:
/* Check for error. */
lhi %r4,-4095
clr %r2,%r4
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
index 7a87e451bd..7caab15e15 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S b/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S
index 33ce6dc6ce..d50115d7ad 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software 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,15 +17,9 @@
#include <sysdep.h>
-/* We do not want .eh_frame info so that __makecontext_ret stops unwinding
- if backtrace was called within a context created by makecontext. (There
- is also no .eh_frame info for _start or thread_start.) */
-#undef cfi_startproc
-#define cfi_startproc
-#undef cfi_endproc
-#define cfi_endproc
-
ENTRY(__makecontext_ret)
+ /* Mark r14 as undefined in order to stop unwinding here! */
+ cfi_undefined (r14)
basr %r14,%r7
ltgr %r8,%r8 /* Check whether uc_link is 0. */
jz 1f
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
index eddab351dd..18e2d943d6 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/clone.S
@@ -1,5 +1,5 @@
/* Wrapper around clone system call. 64 bit S/390 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -55,22 +55,16 @@ error:
PSEUDO_END (__clone)
thread_start:
- tmh %r3,1 /* CLONE_THREAD == 0x00010000 */
- jne 1f
- lhi %r2,-1
- tml %r3,256 /* CLONE_VM == 0x00000100 */
- jne 2f
- svc SYS_ify(getpid)
-2: ear %r3,%a0
- sllg %r3,%r3,32
- ear %r3,%a1
- st %r2,PID(%r3)
- st %r2,TID(%r3)
-1:
+ cfi_startproc
+ /* Mark r14 as undefined in order to stop unwinding here! */
+ cfi_undefined (r14)
/* fn is in gpr 1, arg in gpr 0 */
lgr %r2,%r0 /* set first parameter to void *arg */
aghi %r15,-160 /* make room on the stack for the save area */
xc 0(8,%r15),0(%r15)
basr %r14,%r1 /* jump to fn */
DO_CALL (exit, 1)
+ cfi_endproc
+
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/configure b/sysdeps/unix/sysv/linux/s390/s390-64/configure
index 7392cdfb42..e8e84362d4 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/configure
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/configure
@@ -4,8 +4,8 @@
test -n "$libc_cv_slibdir" ||
case "$prefix" in
/usr | /usr/)
- libc_cv_slibdir=/lib64
- libc_cv_rtlddir=/lib
+ libc_cv_slibdir='/lib64'
+ libc_cv_rtlddir='/lib'
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
# Locale data can be shared between 32-bit and 64-bit libraries.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/dl-cache.h b/sysdeps/unix/sysv/linux/s390/s390-64/dl-cache.h
index e149f119b8..b6d77a3a4c 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
index 6e725356b6..e8b15b899a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h
new file mode 100644
index 0000000000..4e5f348eaf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 280
+#define SIGJMP_BUF_SIZE 280
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 144
+#define SAVED_MASK_OFFSET 152
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h b/sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h
index 2f6fbb22dd..98adda41fc 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h
@@ -1,5 +1,5 @@
/* Definition of `struct stat' used in the kernel.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,3 +18,4 @@
#define STAT_IS_KERNEL_STAT 1
#define XSTAT_IS_XSTAT64 1
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
index c2e0d9660a..1fbb890d1d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
-GLIBC_2.2 __libc_memalign F
GLIBC_2.2 __libc_stack_end D 0x8
GLIBC_2.2 _dl_mcount F
GLIBC_2.2 _r_debug D 0x28
@@ -7,6 +5,4 @@ GLIBC_2.2 calloc F
GLIBC_2.2 free F
GLIBC_2.2 malloc F
GLIBC_2.2 realloc F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_offset F
-GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libBrokenLocale.abilist
index 21343df781..0e4d814909 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 1af185f474..3b5465558b 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -30,33 +28,28 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x438
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x438
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -65,7 +58,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -76,16 +68,13 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.19 GLIBC_2.19 A
GLIBC_2.19 __longjmp_chk F
GLIBC_2.19 __sigsetjmp F
GLIBC_2.19 _longjmp F
@@ -94,7 +83,6 @@ GLIBC_2.19 getcontext F
GLIBC_2.19 longjmp F
GLIBC_2.19 setjmp F
GLIBC_2.19 siglongjmp F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _Exit F
GLIBC_2.2 _IO_2_1_stderr_ D 0xe0
GLIBC_2.2 _IO_2_1_stdin_ D 0xe0
@@ -1845,33 +1833,80 @@ GLIBC_2.2 xdrstdio_create F
GLIBC_2.2 xencrypt F
GLIBC_2.2 xprt_register F
GLIBC_2.2 xprt_unregister F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf128 F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof128 F
+GLIBC_2.27 strtof128_l F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof128 F
+GLIBC_2.27 wcstof128_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -1963,7 +1998,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -1976,7 +2010,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x208
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -1997,7 +2030,6 @@ GLIBC_2.3.3 strtoll_l F
GLIBC_2.3.3 strtoull_l F
GLIBC_2.3.3 sys_sigabbrev D 0x208
GLIBC_2.3.3 sys_siglist D 0x208
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2027,7 +2059,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
@@ -2255,7 +2286,6 @@ GLIBC_2.4 wcstold F
GLIBC_2.4 wcstold_l F
GLIBC_2.4 wprintf F
GLIBC_2.4 wscanf F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2273,7 +2303,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2281,7 +2310,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2320,7 +2348,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __nldbl___asprintf_chk F
@@ -2337,7 +2364,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libcrypt.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libcrypt.abilist
index f2854f3a0a..f7f92ec540 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 crypt F
GLIBC_2.2 crypt_r F
GLIBC_2.2 encrypt F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libdl.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libdl.abilist
index 98b031bc6d..8110e39ce4 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libdl.abilist
@@ -1,12 +1,9 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 dladdr F
GLIBC_2.2 dlclose F
GLIBC_2.2 dlerror F
GLIBC_2.2 dlopen F
GLIBC_2.2 dlsym F
GLIBC_2.2 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
index 66c625daeb..8cc5fdfc0b 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -80,11 +79,9 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _LIB_VERSION D 0x4
GLIBC_2.2 __clog10 F
GLIBC_2.2 __clog10f F
@@ -396,12 +393,646 @@ GLIBC_2.2 y1l F
GLIBC_2.2 yn F
GLIBC_2.2 ynf F
GLIBC_2.2 ynl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl 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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf128 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf128 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf128 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f128 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf128 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf128 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf128 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf128 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf128 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef128 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf128 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf128 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf128 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf128 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf128 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf128 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf128 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf128 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf128 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf128 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf128 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f128 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf128 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf128 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf128 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf128 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf128 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf128 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf128 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf128 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf128 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf128 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf128 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf128 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf128 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf128 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff128 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f128 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f128 F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf128 F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f128 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf128 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf128 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf128 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf128 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf128 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf128 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf128 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf128 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf128 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf128 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf128 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf128 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf128 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf128 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf128 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f128 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f128 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf128 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf128 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf128 F
+GLIBC_2.27 lgammaf128_r F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf128 F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf128 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf128 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f128 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf128 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f128 F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf128 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf128 F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf128 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf128 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff128 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf128 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf128 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf128 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf128 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf128 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf128 F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf128 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof128 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf128 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf128 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf128 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf128 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf128 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf128 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf128 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf128 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf128 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf128 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf128 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf128 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf128 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf128 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf128 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf128 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf128 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf128 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf128 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f128 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f128 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf128 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 __nldbl_daddl F
+GLIBC_2.28 __nldbl_ddivl F
+GLIBC_2.28 __nldbl_dmull F
+GLIBC_2.28 __nldbl_dsubl F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libnsl.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libnsl.abilist
index ff0199f313..5dd8e13f5f 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __free_fdresult F
GLIBC_2.2 __nis_default_access F
GLIBC_2.2 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
index 83a1fcd239..e8161aa747 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
@@ -1,18 +1,13 @@
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.19 GLIBC_2.19 A
GLIBC_2.19 longjmp F
GLIBC_2.19 siglongjmp F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_flockfile F
GLIBC_2.2 _IO_ftrylockfile F
GLIBC_2.2 _IO_funlockfile F
@@ -203,18 +198,35 @@ GLIBC_2.2 vfork F
GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -230,13 +242,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libresolv.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libresolv.abilist
index 3cb1405aed..dcc4de5f55 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __b64_ntop F
GLIBC_2.2 __b64_pton F
GLIBC_2.2 __dn_comp F
@@ -63,9 +62,7 @@ GLIBC_2.2 res_gethostbyname F
GLIBC_2.2 res_gethostbyname2 F
GLIBC_2.2 res_send_setqhook F
GLIBC_2.2 res_send_setrhook F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
index 41c442bf60..41be3bb84b 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 aio_cancel F
GLIBC_2.2 aio_cancel64 F
GLIBC_2.2 aio_error F
@@ -28,13 +27,11 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 timer_create F
GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -45,8 +42,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libthread_db.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libthread_db.abilist
index 228bbc9de8..0956f0c3f9 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 td_init F
GLIBC_2.2 td_log F
GLIBC_2.2 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.2 td_thr_setxregs F
GLIBC_2.2 td_thr_sigsetmask F
GLIBC_2.2 td_thr_tsd F
GLIBC_2.2 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libutil.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libutil.abilist
index cff37bb42e..14bd135ea8 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 forkpty F
GLIBC_2.2 login F
GLIBC_2.2 login_tty F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c b/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c
index 626ab3604b..f3dae0ad70 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/mmap.S b/sysdeps/unix/sysv/linux/s390/s390-64/mmap.S
deleted file mode 100644
index 60fab732ef..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-64/mmap.S
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Wrapper around mmap system call. 64 bit S/390 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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
-
- .text
-
-ENTRY(__mmap)
- /* Save registers and setup stack frame. */
- stmg %r6,%r15,48(%r15)
- cfi_offset (%r15,-40)
- cfi_offset (%r14,-48)
- cfi_offset (%r13,-56)
- cfi_offset (%r12,-64)
- cfi_offset (%r11,-72)
- cfi_offset (%r10,-80)
- cfi_offset (%r9,-88)
- cfi_offset (%r8,-96)
- cfi_offset (%r7,-104)
- cfi_offset (%r6,-112)
- lgr %r1,%r15
- lg %r0,8(%r15) /* Load eos. */
- aghi %r15,-208 /* Buy stack space. */
- cfi_adjust_cfa_offset (208)
- stg %r1,0(%r15) /* Store back chain. */
- stg %r0,8(%r15) /* Store eos. */
-
- /* Store parameters on stack, because old_mmap
- takes only one parameter: a pointer to the parameter area. */
- mvc 200(8,%r15),368(%r15) /* Move 'offset'. */
- lgfr %r6,%r6
- stg %r6,192(%r15) /* Store 'fd'. */
- lgfr %r5,%r5
- stg %r5,184(%r15) /* Store 'flags'. */
- lgfr %r4,%r4
- stg %r4,176(%r15) /* Store 'prot'. */
- stg %r3,168(%r15) /* Store 'length'. */
- stg %r2,160(%r15) /* Store 'start'. */
-
- la %r2,160(%r15) /* Load address of parameter list. */
- /* Do the system call trap. */
- svc SYS_ify(mmap)
-
- lg %r15,0(%r15) /* Load back chain. */
- cfi_adjust_cfa_offset (-208)
- lmg %r6,%r15,48(%r15) /* Load registers. */
-
- /* Check gpr 2 for error. */
- lghi %r0,-4096
- clgr %r2,%r0
- jgnl SYSCALL_ERROR_LABEL
-
- /* Successful; return the syscall's value. */
- br %r14
-
-PSEUDO_END (__mmap)
-
-weak_alias (__mmap, mmap)
-weak_alias (__mmap, mmap64)
-weak_alias (__mmap, __mmap64)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h b/sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h
index bb23e8d9a4..34496152c7 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Linux/s390 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h b/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h
index 03982651c2..fc0af284de 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers. 64 bit S/390 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
index ea1ec069bc..180055dec4 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c b/sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c
deleted file mode 100644
index 1fd0f5f219..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (C) 2001-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/>. */
-
-/* 64 bit Linux for S/390 only has rt signals, thus we do not even want to try
- falling back to the old style signals as the default Linux handler does. */
-
-#include <errno.h>
-#include <signal.h>
-#include <string.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* The variable is shared between all wrappers around signal handling
- functions which have RT equivalents. This is the definition. */
-
-
-/* If ACT is not NULL, change the action for SIG to *ACT.
- If OACT is not NULL, put the old action for SIG in *OACT. */
-int
-__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
-{
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigaction, 4, sig, act, oact, _NSIG / 8);
-}
-libc_hidden_def (__libc_sigaction)
-
-#include <nptl/sigaction.c>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c b/sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c
deleted file mode 100644
index d2ed55749a..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 2001-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/>. */
-
-/* 64 bit Linux for S/390 only has rt signals, thus we do not even want to try
- falling back to the old style signals as the default Linux handler does. */
-
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Change the set of blocked signals to SET,
- wait until a signal arrives, and restore the set of blocked signals. */
-int
-sigpending (sigset_t *set)
-{
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
-}
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c b/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
index a02bdaaf1f..81352fe96a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,4 +34,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
real size of the user-level sigset_t. */
return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
+libc_hidden_def (__sigprocmask)
weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
index 83d267ce68..499f6e97a5 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscall.S b/sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
index 024ce98a5e..c8b2650115 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -49,20 +49,14 @@ ENTRY (syscall)
lg %r6,320(%r15) /* Fifth parameter. */
lg %r7,328(%r15) /* Sixth parameter. */
- basr %r8,0
-0: clg %r1,4f-0b(%r8) /* svc number < 256? */
- jl 2f
-1: svc 0
- j 3f
-2: ex %r1,1b-0b(%r8) /* lsb of R1 is subsituted as SVC number */
-3: lg %r15,0(%r15) /* load back chain */
+ svc 0
+ lg %r15,0(%r15) /* Load back chain. */
cfi_adjust_cfa_offset (-160)
- lmg %r6,15,48(%r15) /* Load registers. */
+ lmg %r6,%r15,48(%r15) /* Load registers. */
lghi %r0,-4095
clgr %r2,%r0 /* Check R2 for error. */
jgnl SYSCALL_ERROR_LABEL
br %r14 /* Return to caller. */
-4: .quad 256
PSEUDO_END (syscall)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
deleted file mode 100644
index 9f03d26fea..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
+++ /dev/null
@@ -1,14 +0,0 @@
-# File name Caller Syscall name # args Strong name Weak names
-
-# semaphore and shm system calls
-msgctl - msgctl i:iip __msgctl msgctl
-msgget - msgget i:ii __msgget msgget
-msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
-msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
-shmat - shmat i:ipi __shmat shmat
-shmctl - shmctl i:iip __shmctl shmctl
-shmdt - shmdt i:s __shmdt shmdt
-shmget - shmget i:iii __shmget shmget
-semop - semop i:ipi __semop semop
-semget - semget i:iii __semget semget
-semctl - semctl i:iiii __semctl semctl
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
deleted file mode 100644
index e7dea7197e..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
-L(pseudo_cancel): \
- cfi_startproc; \
- STM_##args \
- stmg %r13,%r15,104(%r15); \
- cfi_offset (%r15,-40); \
- cfi_offset (%r14,-48); \
- cfi_offset (%r13,-56); \
- lgr %r14,%r15; \
- aghi %r15,-160; \
- cfi_adjust_cfa_offset (160); \
- stg %r14,0(%r15); \
- brasl %r14,CENABLE; \
- lgr %r0,%r2; \
- LM_##args \
- .if SYS_ify (syscall_name) < 256; \
- svc SYS_ify (syscall_name); \
- .else; \
- lghi %r1,SYS_ify (syscall_name); \
- svc 0; \
- .endif; \
- LR7_##args \
- lgr %r13,%r2; \
- lgr %r2,%r0; \
- brasl %r14,CDISABLE; \
- lgr %r2,%r13; \
- lmg %r13,%r15,104+160(%r15); \
- cfi_endproc; \
- j L(pseudo_check); \
-ENTRY(name) \
- SINGLE_THREAD_P \
- jne L(pseudo_cancel); \
-.type __##syscall_name##_nocancel,@function; \
-.globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- DO_CALL(syscall_name, args); \
-L(pseudo_check): \
- lghi %r4,-4095; \
- clgr %r2,%r4; \
- jgnl SYSCALL_ERROR_LABEL; \
-.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
-L(pseudo_end):
-
-# if IS_IN (libpthread)
-# define CENABLE __pthread_enable_asynccancel
-# define CDISABLE __pthread_disable_asynccancel
-# define __local_multiple_threads __pthread_multiple_threads
-# elif IS_IN (libc)
-# define CENABLE __libc_enable_asynccancel
-# define CDISABLE __libc_disable_asynccancel
-# define __local_multiple_threads __libc_multiple_threads
-# elif IS_IN (librt)
-# define CENABLE __librt_enable_asynccancel
-# define CDISABLE __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-#define STM_0 /* Nothing */
-#define STM_1 stg %r2,16(%r15);
-#define STM_2 stmg %r2,%r3,16(%r15);
-#define STM_3 stmg %r2,%r4,16(%r15);
-#define STM_4 stmg %r2,%r5,16(%r15);
-#define STM_5 stmg %r2,%r5,16(%r15);
-#define STM_6 stmg %r2,%r7,16(%r15);
-
-#define LM_0 /* Nothing */
-#define LM_1 lg %r2,16+160(%r15);
-#define LM_2 lmg %r2,%r3,16+160(%r15);
-#define LM_3 lmg %r2,%r4,16+160(%r15);
-#define LM_4 lmg %r2,%r5,16+160(%r15);
-#define LM_5 lmg %r2,%r5,16+160(%r15);
-#define LM_6 lmg %r2,%r5,16+160(%r15); \
- cfi_offset (%r7, -104); \
- lg %r7,160+160(%r15);
-
-#define LR7_0 /* Nothing */
-#define LR7_1 /* Nothing */
-#define LR7_2 /* Nothing */
-#define LR7_3 /* Nothing */
-#define LR7_4 /* Nothing */
-#define LR7_5 /* Nothing */
-#define LR7_6 lg %r7,56+160(%r15); \
- cfi_restore (%r7);
-
-# if IS_IN (libpthread) || IS_IN (libc)
-# ifndef __ASSEMBLER__
-extern int __local_multiple_threads attribute_hidden;
-# define SINGLE_THREAD_P \
- __builtin_expect (__local_multiple_threads == 0, 1)
-# else
-# define SINGLE_THREAD_P \
- larl %r1,__local_multiple_threads; \
- icm %r0,15,0(%r1);
-# endif
-
-# else
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P \
- ear %r1,%a0; \
- sllg %r1,%r1,32; \
- ear %r1,%a1; \
- icm %r1,15,MULTIPLE_THREADS_OFFSET(%r1);
-# endif
-
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
index 8de648fe00..151686302a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
index 6f390ff626..0414fc5f2c 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for 64 bit S/390.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -277,46 +277,13 @@
#define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
#define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)
-#define CLOBBER_0 , "3", "4", "5"
-#define CLOBBER_1 , "3", "4", "5"
-#define CLOBBER_2 , "4", "5"
-#define CLOBBER_3 , "5"
-#define CLOBBER_4
-#define CLOBBER_5
-#define CLOBBER_6
-
/* List of system calls which are supported as vsyscalls. */
#define HAVE_CLOCK_GETRES_VSYSCALL 1
#define HAVE_CLOCK_GETTIME_VSYSCALL 1
#define HAVE_GETTIMEOFDAY_VSYSCALL 1
+#define HAVE_GETCPU_VSYSCALL 1
-/* This version is for internal uses when there is no desire
- to set errno */
-#define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...) \
- ({ \
- long int _ret = ENOSYS; \
- \
- __typeof (__vdso_##name) vdsop = __vdso_##name; \
- PTR_DEMANGLE (vdsop); \
- if (vdsop != NULL) \
- _ret = INTERNAL_VSYSCALL_CALL (vdsop, err, nr, ##args); \
- else \
- err = 1 << 28; \
- _ret; \
- })
-
-#define INTERNAL_VSYSCALL_CALL(fn, err, nr, args...) \
- ({ \
- DECLARGS_##nr(args) \
- register long _ret __asm__("2"); \
- __asm__ __volatile__ ( \
- "lgr 10,14\n\t" \
- "basr 14,%1\n\t" \
- "lgr 14,10\n\t" \
- : "=d" (_ret) \
- : "a" (fn) ASMFMT_##nr \
- : "cc", "memory", "0", "1", "10" CLOBBER_##nr); \
- _ret; })
+#define SINGLE_THREAD_BY_GLOBAL 1
/* Pointer mangling support. */
#if IS_IN (rtld)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S b/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S
index 0bd2161381..60030bad95 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
@@ -28,22 +28,9 @@
and the process ID of the new process to the old process. */
ENTRY (__libc_vfork)
- ear %r4,%a0
- sllg %r4,%r4,32
- ear %r4,%a1
- icm %r3,15,PID(%r4)
- llilh %r1,32768
- je 1f
- lcr %r1,%r3
-1: st %r1,PID(%r4)
-
/* Do vfork system call. */
svc SYS_ify (vfork)
- ltgr %r2,%r2
- je 1f
- st %r3,PID(%r4)
-1:
/* Check for error. */
lghi %r4,-4095
clgr %r2,%r4
diff --git a/sysdeps/unix/sysv/linux/s390/semtimedop.c b/sysdeps/unix/sysv/linux/s390/semtimedop.c
index f226953fd3..b405e4e73e 100644
--- a/sysdeps/unix/sysv/linux/s390/semtimedop.c
+++ b/sysdeps/unix/sysv/linux/s390/semtimedop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -16,12 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/sem.h>
#include <ipc_priv.h>
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
/* Perform user-defined atomical operation of array of semaphores. */
@@ -29,6 +27,10 @@ int
semtimedop (int semid, struct sembuf *sops, size_t nsops,
const struct timespec *timeout)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_semtimedop,
- semid, (int) nsops, timeout, sops);
+ /* The s390 sys_ipc variant has only five parameters instead of six
+ (as for default variant) and the only difference is the handling of
+ SEMTIMEDOP where on s390 the third parameter is used as a pointer
+ to a struct timespec where the generic variant uses fifth parameter. */
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, nsops, timeout,
+ sops);
}
diff --git a/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h b/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h
index fb6b6efc74..0826e58e2a 100644
--- a/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -19,9 +19,4 @@
#include <signal.h>
#define SIGCONTEXT struct sigcontext *
-#define SIGCONTEXT_EXTRA_ARGS
#define GET_PC(ctx) ((void *)((ctx)->sregs->regs.psw.addr))
-#define GET_FRAME(ctx) (*(void **)((ctx)->sregs->regs.gprs[11]))
-#define GET_STACK(ctx) ((void *)((ctx)->sregs->regs.gprs[15]))
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/s390/sys/elf.h b/sysdeps/unix/sysv/linux/s390/sys/elf.h
index fdfc5cd434..c464a0cf3e 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/elf.h
+++ b/sysdeps/unix/sysv/linux/s390/sys/elf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/sys/procfs.h b/sysdeps/unix/sysv/linux/s390/sys/procfs.h
index 030936f997..d6b10a9b4f 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/s390/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
index 15991f3e36..d60a034b11 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
@@ -1,5 +1,5 @@
-/* `ptrace' debugger support interface. Linux version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* `ptrace' debugger support interface. Linux/S390 version.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
This file is part of the GNU C Library.
@@ -24,24 +24,61 @@
#include <bits/types.h>
__BEGIN_DECLS
-#ifdef _LINUX_PTRACE_H
+#if defined _LINUX_PTRACE_H || defined _S390_PTRACE_H
/* Kludge to stop stuff gdb & strace compiles from getting upset
*/
-#undef PTRACE_TRACEME
-#undef PTRACE_PEEKTEXT
-#undef PTRACE_PEEKDATA
-#undef PTRACE_PEEKUSR
-#undef PTRACE_POKETEXT
-#undef PTRACE_POKEDATA
-#undef PTRACE_POKEUSR
-#undef PTRACE_CONT
-#undef PTRACE_KILL
-#undef PTRACE_SINGLESTEP
-
-#undef PTRACE_ATTACH
-#undef PTRACE_DETACH
-
-#undef PTRACE_SYSCALL
+# undef PTRACE_TRACEME
+# undef PTRACE_PEEKTEXT
+# undef PTRACE_PEEKDATA
+# undef PTRACE_POKETEXT
+# undef PTRACE_POKEDATA
+# undef PTRACE_CONT
+# undef PTRACE_KILL
+# undef PTRACE_SINGLESTEP
+# undef PTRACE_SINGLEBLOCK
+# undef PTRACE_ATTACH
+# undef PTRACE_DETACH
+# undef PTRACE_SYSCALL
+# undef PTRACE_SETOPTIONS
+# undef PTRACE_GETEVENTMSG
+# undef PTRACE_GETSIGINFO
+# undef PTRACE_SETSIGINFO
+# undef PTRACE_GETREGSET
+# undef PTRACE_SETREGSET
+# undef PTRACE_SEIZE
+# undef PTRACE_INTERRUPT
+# undef PTRACE_LISTEN
+# undef PTRACE_PEEKSIGINFO
+# undef PTRACE_GETSIGMASK
+# undef PTRACE_SETSIGMASK
+# undef PTRACE_SECCOMP_GET_FILTER
+# undef PTRACE_SECCOMP_GET_METADATA
+# undef PTRACE_PEEKUSR_AREA
+# undef PTRACE_POKEUSR_AREA
+# undef PTRACE_GET_LAST_BREAK
+# undef PTRACE_ENABLE_TE
+# undef PTRACE_DISABLE_TE
+# undef PTRACE_TE_ABORT_RAND
+# undef PTRACE_O_TRACESYSGOOD
+# undef PTRACE_O_TRACEFORK
+# undef PTRACE_O_TRACEVFORK
+# undef PTRACE_O_TRACECLONE
+# undef PTRACE_O_TRACEEXEC
+# undef PTRACE_O_TRACEVFORKDONE
+# undef PTRACE_O_TRACEEXIT
+# undef PTRACE_O_TRACESECCOMP
+# undef PTRACE_O_EXITKILL
+# undef PTRACE_O_SUSPEND_SECCOMP
+# undef PTRACE_O_MASK
+# undef PTRACE_EVENT_FORK
+# undef PTRACE_EVENT_VFORK
+# undef PTRACE_EVENT_CLONE
+# undef PTRACE_EVENT_EXEC
+# undef PTRACE_EVENT_VFORK_DONE
+# undef PTRACE_EVENT_EXIT
+# undef PTRACE_EVENT_SECCOMP
+# undef PTRACE_EVENT_STOP
+# undef PTRACE_PEEKSIGINFO_SHARED
#endif
/* Type of the REQUEST argument to `ptrace.' */
enum __ptrace_request
@@ -84,30 +121,13 @@ enum __ptrace_request
PTRACE_KILL = 8,
#define PT_KILL PTRACE_KILL
- /* Single step the process.
- This is not supported on all machines. */
+ /* Single step the process. */
PTRACE_SINGLESTEP = 9,
#define PT_STEP PTRACE_SINGLESTEP
- /* Get all general purpose registers used by a processes.
- This is not supported on all machines. */
- PTRACE_GETREGS = 12,
-#define PT_GETREGS PTRACE_GETREGS
-
- /* Set all general purpose registers used by a processes.
- This is not supported on all machines. */
- PTRACE_SETREGS = 13,
-#define PT_SETREGS PTRACE_SETREGS
-
- /* Get all floating point registers used by a processes.
- This is not supported on all machines. */
- PTRACE_GETFPREGS = 14,
-#define PT_GETFPREGS PTRACE_GETFPREGS
-
- /* Set all floating point registers used by a processes.
- This is not supported on all machines. */
- PTRACE_SETFPREGS = 15,
-#define PT_SETFPREGS PTRACE_SETFPREGS
+ /* Execute process until next taken branch. */
+ PTRACE_SINGLEBLOCK = 12,
+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
/* Attach to a process that is already running. */
PTRACE_ATTACH = 16,
@@ -117,7 +137,7 @@ enum __ptrace_request
PTRACE_DETACH = 17,
#define PT_DETACH PTRACE_DETACH
- /* Continue and stop at the next (return from) syscall. */
+ /* Continue and stop at the next entry to or return from syscall. */
PTRACE_SYSCALL = 24,
#define PT_SYSCALL PTRACE_SYSCALL
@@ -158,78 +178,47 @@ enum __ptrace_request
PTRACE_LISTEN = 0x4208,
#define PTRACE_LISTEN PTRACE_LISTEN
+ /* Retrieve siginfo_t structures without removing signals from a queue. */
PTRACE_PEEKSIGINFO = 0x4209,
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+ /* Get the mask of blocked signals. */
PTRACE_GETSIGMASK = 0x420a,
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
+ /* Change the mask of blocked signals. */
PTRACE_SETSIGMASK = 0x420b,
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
- PTRACE_SECCOMP_GET_FILTER = 0x420c
+ /* Get seccomp BPF filters. */
+ PTRACE_SECCOMP_GET_FILTER = 0x420c,
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
-};
+ /* Get seccomp BPF filter metadata. */
+ PTRACE_SECCOMP_GET_METADATA = 0x420d,
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
-/* Flag for PTRACE_LISTEN. */
-enum __ptrace_flags
-{
- PTRACE_SEIZE_DEVEL = 0x80000000
-};
+ PTRACE_PEEKUSR_AREA = 0x5000,
+#define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA
-/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions
-{
- PTRACE_O_TRACESYSGOOD = 0x00000001,
- PTRACE_O_TRACEFORK = 0x00000002,
- PTRACE_O_TRACEVFORK = 0x00000004,
- PTRACE_O_TRACECLONE = 0x00000008,
- PTRACE_O_TRACEEXEC = 0x00000010,
- PTRACE_O_TRACEVFORKDONE = 0x00000020,
- PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_EXITKILL = 0x00100000,
- PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
- PTRACE_O_MASK = 0x003000ff
-};
+ PTRACE_POKEUSR_AREA = 0x5001,
+#define PTRACE_POKEUSR_AREA PTRACE_POKEUSR_AREA
-/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes
-{
- PTRACE_EVENT_FORK = 1,
- PTRACE_EVENT_VFORK = 2,
- PTRACE_EVENT_CLONE = 3,
- PTRACE_EVENT_EXEC = 4,
- PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6,
- PTRACE_EVENT_SECCOMP = 7
-};
+ PTRACE_GET_LAST_BREAK = 0x5006,
+#define PTRACE_GET_LAST_BREAK PTRACE_GET_LAST_BREAK
-/* Arguments for PTRACE_PEEKSIGINFO. */
-struct __ptrace_peeksiginfo_args
-{
- __uint64_t off; /* From which siginfo to start. */
- __uint32_t flags; /* Flags for peeksiginfo. */
- __int32_t nr; /* How many siginfos to take. */
-};
+ PTRACE_ENABLE_TE = 0x5009,
+#define PTRACE_ENABLE_TE PTRACE_ENABLE_TE
-enum __ptrace_peeksiginfo_flags
-{
- /* Read signals from a shared (process wide) queue. */
- PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
+ PTRACE_DISABLE_TE = 0x5010,
+#define PTRACE_DISABLE_TE PTRACE_DISABLE_TE
+
+ PTRACE_TE_ABORT_RAND = 0x5011
+#define PTRACE_TE_ABORT_RAND PTRACE_TE_ABORT_RAND
};
-/* Perform process tracing functions. REQUEST is one of the values
- above, and determines the action to be taken.
- For all requests except PTRACE_TRACEME, PID specifies the process to be
- traced.
- PID and the other arguments described above for the various requests should
- appear (those that are used for the particular request) as:
- pid_t PID, void *ADDR, int DATA, void *ADDR2
- after REQUEST. */
-extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+#include <bits/ptrace-shared.h>
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h b/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
index 78f5fd77a1..5efdcfb76c 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
This file is part of the GNU C Library.
@@ -18,21 +18,24 @@
#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>. */
-#include <bits/sigcontext.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
/* Type for a program status word. */
typedef struct
{
- unsigned long mask;
- unsigned long addr;
+ unsigned long __ctx(mask);
+ unsigned long __ctx(addr);
} __attribute__ ((__aligned__(8))) __psw_t;
/* Type for a general-purpose register. */
@@ -44,44 +47,49 @@ typedef unsigned long greg_t;
that has the same size as s390_regs. This is needed for the
elf_prstatus structure. */
#if __WORDSIZE == 64
-# define NGREG 27
+# define __NGREG 27
#else
-# define NGREG 36
+# define __NGREG 36
+#endif
+#ifdef __USE_MISC
+# define NGREG __NGREG
#endif
/* Must match kernels psw_t alignment. */
-typedef greg_t gregset_t[NGREG] __attribute__ ((__aligned__(8)));
+typedef greg_t gregset_t[__NGREG] __attribute__ ((__aligned__(8)));
typedef union
{
- double d;
- float f;
+ double __ctx(d);
+ float __ctx(f);
} fpreg_t;
/* Register set for the floating-point registers. */
typedef struct
{
- unsigned int fpc;
- fpreg_t fprs[16];
+ unsigned int __ctx(fpc);
+ fpreg_t __ctx(fprs)[16];
} fpregset_t;
/* Context to describe whole processor state. */
typedef struct
{
- __psw_t psw;
- unsigned long gregs[16];
- unsigned int aregs[16];
- fpregset_t fpregs;
+ __psw_t __ctx(psw);
+ unsigned long __ctx(gregs)[16];
+ unsigned int __ctx(aregs)[16];
+ fpregset_t __ctx(fpregs);
} mcontext_t;
/* Userlevel context. */
-struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
- };
+ sigset_t uc_sigmask;
+ } ucontext_t;
+
+#undef __ctx
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/s390/sys/user.h b/sysdeps/unix/sysv/linux/s390/sys/user.h
index bb893e4bc3..05ecb3c083 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/user.h
+++ b/sysdeps/unix/sysv/linux/s390/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/sysconf.c b/sysdeps/unix/sysv/linux/s390/sysconf.c
index d6a9c81ff0..433b6ef890 100644
--- a/sysdeps/unix/sysv/linux/s390/sysconf.c
+++ b/sysdeps/unix/sysv/linux/s390/sysconf.c
@@ -1,5 +1,5 @@
/* Get system parameters, e.g. cache information. S390/S390x version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/system.c b/sysdeps/unix/sysv/linux/s390/system.c
index 6dfbdc4b38..d8ef461334 100644
--- a/sysdeps/unix/sysv/linux/s390/system.c
+++ b/sysdeps/unix/sysv/linux/s390/system.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c b/sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c
new file mode 100644
index 0000000000..c4419516f9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c
@@ -0,0 +1,178 @@
+/* Testing s390x PTRACE_SINGLEBLOCK ptrace request.
+ Copyright (C) 2017-2018 Free Software 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 <unistd.h>
+#include <sys/wait.h>
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <elf.h>
+#include <support/xunistd.h>
+#include <support/check.h>
+#include <string.h>
+#include <errno.h>
+
+/* Ensure that we use the PTRACE_SINGLEBLOCK definition from glibc ptrace.h
+ in tracer_func. We need the kernel ptrace.h for structs ptrace_area
+ and gregset_t. */
+#include <sys/ptrace.h>
+static const enum __ptrace_request req_singleblock = PTRACE_SINGLEBLOCK;
+#include <asm/ptrace.h>
+
+static void
+tracee_func (int pid)
+{
+ /* Dump the mapping information for manual inspection of the printed
+ tracee addresses. */
+ char str[80];
+ sprintf (str, "cat /proc/%d/maps", pid);
+ puts (str);
+ system (str);
+ fflush (stdout);
+
+ TEST_VERIFY_EXIT (ptrace (PTRACE_TRACEME) == 0);
+ /* Stop tracee. Afterwards the tracer_func can operate. */
+ kill (pid, SIGSTOP);
+
+ puts ("The PTRACE_SINGLEBLOCK of the tracer will stop after: "
+ "brasl %r14,<puts@plt>!");
+}
+
+static void
+tracer_func (int pid)
+{
+ unsigned long last_break;
+ ptrace_area parea;
+ gregset_t regs;
+ struct iovec parea2;
+ gregset_t regs2;
+
+ int status;
+ int ret;
+#define MAX_CHARS_IN_BUF 4096
+ char buf[MAX_CHARS_IN_BUF + 1];
+ size_t buf_count;
+
+ while (1)
+ {
+ /* Wait for the tracee to be stopped or exited. */
+ wait (&status);
+ if (WIFEXITED (status))
+ break;
+
+ /* Get information about tracee: gprs, last breaking address. */
+ parea.len = sizeof (regs);
+ parea.process_addr = (unsigned long) &regs;
+ parea.kernel_addr = 0;
+ TEST_VERIFY_EXIT (ptrace (PTRACE_PEEKUSR_AREA, pid, &parea) == 0);
+ TEST_VERIFY_EXIT (ptrace (PTRACE_GET_LAST_BREAK, pid, NULL, &last_break)
+ == 0);
+
+ parea2.iov_len = sizeof (regs2);
+ parea2.iov_base = &regs2;
+ TEST_VERIFY_EXIT (ptrace (PTRACE_GETREGSET, pid, NT_PRSTATUS, &parea2)
+ == 0);
+ TEST_VERIFY_EXIT (parea2.iov_len == sizeof (regs2));
+
+ /* Test if gprs obtained by PTRACE_PEEKUSR_AREA and PTRACE_GETREGESET
+ have the same values. */
+ TEST_VERIFY_EXIT (memcmp (&regs, &regs2, sizeof (regs)) == 0);
+
+ printf ("child IA: %p last_break: %p\n",
+ (void *) regs[1], (void *) last_break);
+
+ /* Execute tracee until next taken branch.
+
+ Note:
+ Before the commit which introduced this testcase,
+ <glibc>/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
+ uses ptrace-request 12 for PTRACE_GETREGS,
+ but <kernel>/include/uapi/linux/ptrace.h
+ uses 12 for PTRACE_SINGLEBLOCK.
+
+ The s390 kernel has no support for PTRACE_GETREGS!
+ Thus glibc ptrace.h is adjusted to match kernel ptrace.h.
+
+ The glibc sys/ptrace.h header contains the identifier
+ PTRACE_SINGLEBLOCK in enum __ptrace_request. In contrast, the kernel
+ asm/ptrace.h header defines PTRACE_SINGLEBLOCK.
+
+ This test ensures, that PTRACE_SINGLEBLOCK defined in glibc
+ works as expected. If the kernel would interpret it as
+ PTRACE_GETREGS, then the tracee will not make any progress
+ and this testcase will time out or the ptrace call will fail with
+ different errors. */
+
+ /* Ptrace request 12 is first done with data argument pointing to
+ a buffer:
+ -If request 12 is interpreted as PTRACE_GETREGS, it will store the regs
+ to buffer without an error.
+
+ -If request 12 is interpreted as PTRACE_SINGLEBLOCK, it will fail
+ as data argument is used as signal-number and the address of
+ buf is no valid signal.
+
+ -If request 12 is not implemented, it will also fail.
+
+ Here the test expects that the buffer is untouched and an error is
+ returned. */
+ memset (buf, 'a', MAX_CHARS_IN_BUF);
+ ret = ptrace (req_singleblock, pid, NULL, buf);
+ buf [MAX_CHARS_IN_BUF] = '\0';
+ buf_count = strspn (buf, "a");
+ TEST_VERIFY_EXIT (buf_count == MAX_CHARS_IN_BUF);
+ TEST_VERIFY_EXIT (ret == -1);
+
+ /* If request 12 is interpreted as PTRACE_GETREGS, the first ptrace
+ call will touch the buffer which is detected by this test. */
+ errno = 0;
+ ret = ptrace (req_singleblock, pid, NULL, NULL);
+ if (ret == 0)
+ {
+ /* The kernel has support for PTRACE_SINGLEBLOCK ptrace request. */
+ TEST_VERIFY_EXIT (errno == 0);
+ }
+ else
+ {
+ /* The kernel (< 3.15) has no support for PTRACE_SINGLEBLOCK ptrace
+ request. */
+ TEST_VERIFY_EXIT (errno == EIO);
+ TEST_VERIFY_EXIT (ret == -1);
+
+ /* Just continue tracee until it exits normally. */
+ TEST_VERIFY_EXIT (ptrace (PTRACE_CONT, pid, NULL, NULL) == 0);
+ }
+ }
+}
+
+static int
+do_test (void)
+{
+ int pid;
+ pid = xfork ();
+ if (pid)
+ tracer_func (pid);
+ else
+ tracee_func (getpid ());
+
+ return EXIT_SUCCESS;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/safe-fatal.h b/sysdeps/unix/sysv/linux/safe-fatal.h
index 2369c51bec..cdcdf52f10 100644
--- a/sysdeps/unix/sysv/linux/safe-fatal.h
+++ b/sysdeps/unix/sysv/linux/safe-fatal.h
@@ -1,5 +1,5 @@
/* Crash the process immediately, without possibility of deadlock. Linux.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/scandir64.c b/sysdeps/unix/sysv/linux/scandir64.c
new file mode 100644
index 0000000000..efb502f6e4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/scandir64.c
@@ -0,0 +1,139 @@
+/* Copyright (C) 2000-2018 Free Software 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 scandir __no_scandir_decl
+#include <dirent.h>
+#undef scandir
+
+int
+__scandir64 (const char *dir, struct dirent64 ***namelist,
+ int (*select) (const struct dirent64 *),
+ int (*cmp) (const struct dirent64 **, const struct dirent64 **))
+{
+ return __scandir64_tail (__opendir (dir), namelist, select, cmp);
+}
+
+#if _DIRENT_MATCHES_DIRENT64
+weak_alias (__scandir64, scandir64)
+weak_alias (__scandir64, scandir)
+#else
+# include <shlib-compat.h>
+versioned_symbol (libc, __scandir64, scandir64, GLIBC_2_2);
+# if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+# include <string.h>
+# include <errno.h>
+# include "olddirent.h"
+
+int
+__old_scandir64 (const char *dir, struct __old_dirent64 ***namelist,
+ int (*select) (const struct __old_dirent64 *),
+ int (*cmp) (const struct __old_dirent64 **,
+ const struct __old_dirent64 **))
+{
+ DIR *dp = __opendir (dir);
+ struct __old_dirent64 **v = NULL;
+ size_t vsize = 0;
+ struct scandir_cancel_struct c;
+ struct __old_dirent64 *d;
+ int save;
+
+ if (dp == NULL)
+ return -1;
+
+ save = errno;
+ __set_errno (0);
+
+ c.dp = dp;
+ c.v = NULL;
+ c.cnt = 0;
+ __libc_cleanup_push (__scandir_cancel_handler, &c);
+
+ while ((d = __old_readdir64 (dp)) != NULL)
+ {
+ int use_it = select == NULL;
+
+ if (! use_it)
+ {
+ use_it = select (d);
+ /* The select function might have changed errno. It was
+ zero before and it need to be again to make the latter
+ tests work. */
+ __set_errno (0);
+ }
+
+ if (use_it)
+ {
+ struct __old_dirent64 *vnew;
+ size_t dsize;
+
+ /* Ignore errors from select or readdir */
+ __set_errno (0);
+
+ if (__glibc_unlikely (c.cnt == vsize))
+ {
+ struct __old_dirent64 **new;
+ if (vsize == 0)
+ vsize = 10;
+ else
+ vsize *= 2;
+ new = (struct __old_dirent64 **) realloc (v,
+ vsize * sizeof (*v));
+ if (new == NULL)
+ break;
+ v = new;
+ c.v = (void *) v;
+ }
+
+ dsize = &d->d_name[_D_ALLOC_NAMLEN (d)] - (char *) d;
+ vnew = (struct __old_dirent64 *) malloc (dsize);
+ if (vnew == NULL)
+ break;
+
+ v[c.cnt++] = (struct __old_dirent64 *) memcpy (vnew, d, dsize);
+ }
+ }
+
+ if (__builtin_expect (errno, 0) != 0)
+ {
+ save = errno;
+
+ while (c.cnt > 0)
+ free (v[--c.cnt]);
+ free (v);
+ c.cnt = -1;
+ }
+ else
+ {
+ /* Sort the list if we have a comparison function to sort with. */
+ if (cmp != NULL)
+ qsort (v, c.cnt, sizeof (*v),
+ (int (*) (const void *, const void *)) cmp);
+
+ *namelist = v;
+ }
+
+ __libc_cleanup_pop (0);
+
+ (void) __closedir (dp);
+ __set_errno (save);
+
+ return c.cnt;
+}
+compat_symbol (libc, __old_scandir64, scandir64, GLIBC_2_1);
+
+# endif /* SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2) */
+#endif /* _DIRENT_MATCHES_DIRENT64 */
diff --git a/sysdeps/unix/sysv/linux/sched_getaffinity.c b/sysdeps/unix/sysv/linux/sched_getaffinity.c
index 75f1f920af..a046b3d33b 100644
--- a/sysdeps/unix/sysv/linux/sched_getaffinity.c
+++ b/sysdeps/unix/sysv/linux/sched_getaffinity.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sched_getcpu.c b/sysdeps/unix/sysv/linux/sched_getcpu.c
index 6a010c078b..b69eeda15c 100644
--- a/sysdeps/unix/sysv/linux/sched_getcpu.c
+++ b/sysdeps/unix/sysv/linux/sched_getcpu.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sched_setaffinity.c b/sysdeps/unix/sysv/linux/sched_setaffinity.c
index f3546fa8aa..89cfaa5542 100644
--- a/sysdeps/unix/sysv/linux/sched_setaffinity.c
+++ b/sysdeps/unix/sysv/linux/sched_setaffinity.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,9 @@
#ifdef __NR_sched_setaffinity
+extern int __sched_setaffinity_new (pid_t, size_t, const cpu_set_t *);
+libc_hidden_proto (__sched_setaffinity_new)
+
int
__sched_setaffinity_new (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
{
@@ -38,6 +41,7 @@ __sched_setaffinity_new (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
return result;
}
+libc_hidden_def (__sched_setaffinity_new)
versioned_symbol (libc, __sched_setaffinity_new, sched_setaffinity,
GLIBC_2_3_4);
diff --git a/sysdeps/unix/sysv/linux/scsi/scsi.h b/sysdeps/unix/sysv/linux/scsi/scsi.h
index ecee08c08d..38d362e31e 100644
--- a/sysdeps/unix/sysv/linux/scsi/scsi.h
+++ b/sysdeps/unix/sysv/linux/scsi/scsi.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/scsi/scsi_ioctl.h b/sysdeps/unix/sysv/linux/scsi/scsi_ioctl.h
index 529aade0d3..e3f9e34fcd 100644
--- a/sysdeps/unix/sysv/linux/scsi/scsi_ioctl.h
+++ b/sysdeps/unix/sysv/linux/scsi/scsi_ioctl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/scsi/sg.h b/sysdeps/unix/sysv/linux/scsi/sg.h
index e3b1c6a248..e5d979a9e9 100644
--- a/sysdeps/unix/sysv/linux/scsi/sg.h
+++ b/sysdeps/unix/sysv/linux/scsi/sg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/select.c b/sysdeps/unix/sysv/linux/select.c
new file mode 100644
index 0000000000..e4124a104e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/select.c
@@ -0,0 +1,71 @@
+/* Linux select implementation.
+ Copyright (C) 2017-2018 Free Software 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/time.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <errno.h>
+#include <sysdep-cancel.h>
+
+/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
+ readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
+ (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out
+ after waiting the interval specified therein. Returns the number of ready
+ descriptors, or -1 for errors. */
+
+#ifdef __NR__newselect
+# undef __NR_select
+# define __NR_select __NR__newselect
+#endif
+
+int
+__select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+ struct timeval *timeout)
+{
+#ifdef __NR_select
+ return SYSCALL_CANCEL (select, nfds, readfds, writefds, exceptfds,
+ timeout);
+#else
+ int result;
+ struct timespec ts, *tsp = NULL;
+
+ if (timeout)
+ {
+ TIMEVAL_TO_TIMESPEC (timeout, &ts);
+ tsp = &ts;
+ }
+
+ result = SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds, tsp,
+ NULL);
+
+ if (timeout)
+ {
+ /* Linux by default will update the timeout after a pselect6 syscall
+ (though the pselect() glibc call suppresses this behavior).
+ Since select() on Linux has the same behavior as the pselect6
+ syscall, we update the timeout here. */
+ TIMESPEC_TO_TIMEVAL (timeout, &ts);
+ }
+
+ return result;
+#endif
+}
+libc_hidden_def (__select)
+
+weak_alias (__select, select)
+weak_alias (__select, __libc_select)
diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
index ee84a1e316..e2925447eb 100644
--- a/sysdeps/unix/sysv/linux/semctl.c
+++ b/sysdeps/unix/sysv/linux/semctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -16,29 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <stdarg.h>
#include <sys/sem.h>
+#include <stdarg.h>
#include <ipc_priv.h>
-
#include <sysdep.h>
-#include <string.h>
-#include <sys/syscall.h>
#include <shlib-compat.h>
-
-#include <kernel-features.h>
-
-struct __old_semid_ds
-{
- struct __old_ipc_perm sem_perm; /* operation permission struct */
- __time_t sem_otime; /* last semop() time */
- __time_t sem_ctime; /* last time changed by semctl() */
- struct sem *__sembase; /* ptr to first semaphore in array */
- struct sem_queue *__sem_pending; /* pending operations */
- struct sem_queue *__sem_pending_last; /* last pending operation */
- struct sem_undo *__undo; /* ondo requests on this array */
- unsigned short int sem_nsems; /* number of semaphores in set */
-};
+#include <errno.h>
/* Define a `union semun' suitable for Linux here. */
union semun
@@ -47,26 +30,19 @@ union semun
struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
unsigned short int *array; /* array for GETALL & SETALL */
struct seminfo *__buf; /* buffer for IPC_INFO */
- struct __old_semid_ds *__old_buf;
};
-/* Return identifier for array of NSEMS semaphores associated with
- KEY. */
-#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
-int __old_semctl (int semid, int semnum, int cmd, ...);
+#ifndef DEFAULT_VERSION
+# define DEFAULT_VERSION GLIBC_2_2
#endif
-int __new_semctl (int semid, int semnum, int cmd, ...);
-#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
int
-attribute_compat_text_section
-__old_semctl (int semid, int semnum, int cmd, ...)
+__new_semctl (int semid, int semnum, int cmd, ...)
{
- union semun arg;
+ union semun arg = { 0 };
va_list ap;
/* Get the argument only if required. */
- arg.buf = NULL;
switch (cmd)
{
case SETVAL: /* arg.val */
@@ -83,20 +59,29 @@ __old_semctl (int semid, int semnum, int cmd, ...)
break;
}
- return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- &arg);
-}
-compat_symbol (libc, __old_semctl, semctl, GLIBC_2_0);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (semctl, semid, semnum, cmd | __IPC_64,
+ arg.array);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
+ SEMCTL_ARG_ADDRESS (arg));
#endif
+}
+versioned_symbol (libc, __new_semctl, semctl, DEFAULT_VERSION);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
+/* Since semctl use a variadic argument for semid_ds there is not need to
+ define and tie the compatibility symbol to the old 'union semun'
+ definition. */
int
-__new_semctl (int semid, int semnum, int cmd, ...)
+attribute_compat_text_section
+__old_semctl (int semid, int semnum, int cmd, ...)
{
- union semun arg;
+ union semun arg = { 0 };
va_list ap;
/* Get the argument only if required. */
- arg.buf = NULL;
switch (cmd)
{
case SETVAL: /* arg.val */
@@ -113,8 +98,12 @@ __new_semctl (int semid, int semnum, int cmd, ...)
break;
}
- return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
- &arg);
+# ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (semctl, semid, semnum, cmd, arg.array);
+# else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_semctl, semid, semnum, cmd,
+ SEMCTL_ARG_ADDRESS (arg));
+# endif
}
-
-versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);
+compat_symbol (libc, __old_semctl, semctl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/unix/sysv/linux/semget.c b/sysdeps/unix/sysv/linux/semget.c
index 52189fd693..e220b3a031 100644
--- a/sysdeps/unix/sysv/linux/semget.c
+++ b/sysdeps/unix/sysv/linux/semget.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -16,13 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/sem.h>
#include <ipc_priv.h>
-#include <stdlib.h> /* for definition of NULL */
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
@@ -30,5 +27,9 @@
int
semget (key_t key, int nsems, int semflg)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_semget, key, nsems, semflg, NULL);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (semget, key, nsems, semflg);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_semget, key, nsems, semflg, NULL);
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/semop.c b/sysdeps/unix/sysv/linux/semop.c
index 593eb4ce85..b5a08dfdaf 100644
--- a/sysdeps/unix/sysv/linux/semop.c
+++ b/sysdeps/unix/sysv/linux/semop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, August 1995.
@@ -16,17 +16,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/sem.h>
#include <ipc_priv.h>
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
/* Perform user-defined atomical operation of array of semaphores. */
int
semop (int semid, struct sembuf *sops, size_t nsops)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_semop, semid, (int) nsops, 0, sops);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (semop, semid, sops, nsops);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_semop, semid, nsops, 0, sops);
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/semtimedop.c b/sysdeps/unix/sysv/linux/semtimedop.c
index 30ee7fe39e..f7357d813a 100644
--- a/sysdeps/unix/sysv/linux/semtimedop.c
+++ b/sysdeps/unix/sysv/linux/semtimedop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, August 1995.
@@ -16,12 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/sem.h>
#include <ipc_priv.h>
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
/* Perform user-defined atomical operation of array of semaphores. */
@@ -29,7 +27,10 @@ int
semtimedop (int semid, struct sembuf *sops, size_t nsops,
const struct timespec *timeout)
{
- return INLINE_SYSCALL (ipc, 6, IPCOP_semtimedop,
- semid, (int) nsops, 0, sops,
- timeout);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (semtimedop, semid, sops, nsops, timeout);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, nsops, 0, sops,
+ timeout);
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/send.c b/sysdeps/unix/sysv/linux/send.c
index abb684c0f5..14ebd91fdf 100644
--- a/sysdeps/unix/sysv/linux/send.c
+++ b/sysdeps/unix/sysv/linux/send.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software 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,21 +15,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
#include <sys/socket.h>
-
#include <sysdep-cancel.h>
#include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
ssize_t
__libc_send (int fd, const void *buf, size_t len, int flags)
{
#ifdef __ASSUME_SEND_SYSCALL
return SYSCALL_CANCEL (send, fd, buf, len, flags);
-#elif defined __ASSUME_SENDTO_FOR_SEND_SYSCALL
+#elif defined __ASSUME_SENDTO_SYSCALL
return SYSCALL_CANCEL (sendto, fd, buf, len, flags, NULL, 0);
#else
return SOCKETCALL_CANCEL (send, fd, buf, len, flags);
@@ -37,4 +32,6 @@ __libc_send (int fd, const void *buf, size_t len, int flags)
}
weak_alias (__libc_send, send)
weak_alias (__libc_send, __send)
+#ifdef HAVE_INTERNAL_SEND_SYMBOL
libc_hidden_def (__send)
+#endif
diff --git a/sysdeps/unix/sysv/linux/sendmmsg.c b/sysdeps/unix/sysv/linux/sendmmsg.c
index 6e0d46be9e..5b9fac4d2f 100644
--- a/sysdeps/unix/sysv/linux/sendmmsg.c
+++ b/sysdeps/unix/sysv/linux/sendmmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -21,73 +21,17 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
+#include <socketcall.h>
#include <kernel-features.h>
-/* Do not use the sendmmsg syscall on socketcall architectures unless
- it was added at the same time as the socketcall support or can be
- assumed to be present. */
-#if defined __ASSUME_SOCKETCALL \
- && !defined __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL \
- && !defined __ASSUME_SENDMMSG_SYSCALL
-# undef __NR_sendmmsg
-#endif
-
-#ifdef __NR_sendmmsg
int
__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
{
+#ifdef __ASSUME_SENDMMSG_SYSCALL
return SYSCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
-}
-libc_hidden_def (__sendmmsg)
-weak_alias (__sendmmsg, sendmmsg)
-#elif defined __NR_socketcall
-# include <socketcall.h>
-# ifdef __ASSUME_SENDMMSG_SOCKETCALL
-int
-__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
-{
+#else
return SOCKETCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
+#endif
}
-# else
-static int have_sendmmsg;
-
-int
-__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
-{
- if (__glibc_likely (have_sendmmsg >= 0))
- {
- int ret = SOCKETCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
- /* The kernel returns -EINVAL for unknown socket operations.
- We need to convert that error to an ENOSYS error. */
- if (__builtin_expect (ret < 0, 0)
- && have_sendmmsg == 0
- && errno == EINVAL)
- {
- /* Try another call, this time with an invalid file
- descriptor and all other parameters cleared. This call
- will not cause any harm and it will return
- immediately. */
- ret = SOCKETCALL_CANCEL (invalid, -1);
- if (errno == EINVAL)
- {
- have_sendmmsg = -1;
- __set_errno (ENOSYS);
- }
- else
- {
- have_sendmmsg = 1;
- __set_errno (EINVAL);
- }
- return -1;
- }
- return ret;
- }
- __set_errno (ENOSYS);
- return -1;
-}
-# endif /* __ASSUME_SENDMMSG_SOCKETCALL */
libc_hidden_def (__sendmmsg)
weak_alias (__sendmmsg, sendmmsg)
-#else
-# include <socket/sendmmsg.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/sendmsg.c b/sysdeps/unix/sysv/linux/sendmsg.c
index 5b2741ace2..f8f1c5c2d8 100644
--- a/sysdeps/unix/sysv/linux/sendmsg.c
+++ b/sysdeps/unix/sysv/linux/sendmsg.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Compatibility implementation of sendmsg.
+ Copyright (C) 2016-2018 Free Software 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,23 +16,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
#include <sys/socket.h>
-
#include <sysdep-cancel.h>
#include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
+#include <shlib-compat.h>
ssize_t
__libc_sendmsg (int fd, const struct msghdr *msg, int flags)
{
-#ifdef __ASSUME_SENDMSG_SYSCALL
+# ifdef __ASSUME_SENDMSG_SYSCALL
return SYSCALL_CANCEL (sendmsg, fd, msg, flags);
-#else
+# else
return SOCKETCALL_CANCEL (sendmsg, fd, msg, flags);
-#endif
+# endif
}
weak_alias (__libc_sendmsg, sendmsg)
weak_alias (__libc_sendmsg, __sendmsg)
diff --git a/sysdeps/unix/sysv/linux/sendto.c b/sysdeps/unix/sysv/linux/sendto.c
index 8c5d36d7f4..7dbf214a26 100644
--- a/sysdeps/unix/sysv/linux/sendto.c
+++ b/sysdeps/unix/sysv/linux/sendto.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software 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,14 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
#include <sys/socket.h>
-
#include <sysdep-cancel.h>
#include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
ssize_t
__libc_sendto (int fd, const void *buf, size_t len, int flags,
diff --git a/sysdeps/unix/sysv/linux/setegid.c b/sysdeps/unix/sysv/linux/setegid.c
index f1ecdc6826..6ebd6bb7e8 100644
--- a/sysdeps/unix/sysv/linux/setegid.c
+++ b/sysdeps/unix/sysv/linux/setegid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,10 +26,7 @@ setegid (gid_t gid)
int result;
if (gid == (gid_t) ~0)
- {
- __set_errno (EINVAL);
- return -1;
- }
+ return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
#ifdef __NR_setresgid32
result = INLINE_SETXID_SYSCALL (setresgid32, 3, -1, gid, -1);
diff --git a/sysdeps/unix/sysv/linux/seteuid.c b/sysdeps/unix/sysv/linux/seteuid.c
index 9d13766fd9..a20bb795e4 100644
--- a/sysdeps/unix/sysv/linux/seteuid.c
+++ b/sysdeps/unix/sysv/linux/seteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,10 +26,7 @@ seteuid (uid_t uid)
int result;
if (uid == (uid_t) ~0)
- {
- __set_errno (EINVAL);
- return -1;
- }
+ return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
#ifdef __NR_setresuid32
result = INLINE_SETXID_SYSCALL (setresuid32, 3, -1, uid, -1);
diff --git a/sysdeps/unix/sysv/linux/setgid.c b/sysdeps/unix/sysv/linux/setgid.c
index 4836069ed4..ea12c95330 100644
--- a/sysdeps/unix/sysv/linux/setgid.c
+++ b/sysdeps/unix/sysv/linux/setgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,11 @@
int
__setgid (gid_t gid)
{
+#ifdef __NR_setgid32
+ return INLINE_SETXID_SYSCALL (setgid32, 1, gid);
+#else
return INLINE_SETXID_SYSCALL (setgid, 1, gid);
+#endif
}
#ifndef __setgid
weak_alias (__setgid, setgid)
diff --git a/sysdeps/unix/sysv/linux/setgroups.c b/sysdeps/unix/sysv/linux/setgroups.c
index ff27e79eaa..b46564a0db 100644
--- a/sysdeps/unix/sysv/linux/setgroups.c
+++ b/sysdeps/unix/sysv/linux/setgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,8 +28,9 @@ int
setgroups (size_t n, const gid_t *groups)
{
#ifdef __NR_setgroups32
-# error "wrong setgroups.c file used"
-#endif
+ return INLINE_SETXID_SYSCALL (setgroups32, 2, n, groups);
+#else
return INLINE_SETXID_SYSCALL (setgroups, 2, n, groups);
+#endif
}
libc_hidden_def (setgroups)
diff --git a/sysdeps/unix/sysv/linux/setipv4sourcefilter.c b/sysdeps/unix/sysv/linux/setipv4sourcefilter.c
index 0a656006c0..bf2c60ee97 100644
--- a/sysdeps/unix/sysv/linux/setipv4sourcefilter.c
+++ b/sysdeps/unix/sysv/linux/setipv4sourcefilter.c
@@ -1,5 +1,5 @@
/* Set IPv4 source filter. Linux version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
diff --git a/sysdeps/unix/sysv/linux/setregid.c b/sysdeps/unix/sysv/linux/setregid.c
index df5bd47142..6e63a01d56 100644
--- a/sysdeps/unix/sysv/linux/setregid.c
+++ b/sysdeps/unix/sysv/linux/setregid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,11 @@
int
__setregid (gid_t rgid, gid_t egid)
{
+#ifdef __NR_setregid32
+ return INLINE_SETXID_SYSCALL (setregid32, 2, rgid, egid);
+#else
return INLINE_SETXID_SYSCALL (setregid, 2, rgid, egid);
+#endif
}
#ifndef __setregid
weak_alias (__setregid, setregid)
diff --git a/sysdeps/unix/sysv/linux/setresgid.c b/sysdeps/unix/sysv/linux/setresgid.c
index 6cda359a2f..8b0e0e1541 100644
--- a/sysdeps/unix/sysv/linux/setresgid.c
+++ b/sysdeps/unix/sysv/linux/setresgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,11 @@
int
__setresgid (gid_t rgid, gid_t egid, gid_t sgid)
{
+#ifdef __NR_setresgid32
+ return INLINE_SETXID_SYSCALL (setresgid32, 3, rgid, egid, sgid);
+#else
return INLINE_SETXID_SYSCALL (setresgid, 3, rgid, egid, sgid);
+#endif
}
libc_hidden_def (__setresgid)
#ifndef __setresgid
diff --git a/sysdeps/unix/sysv/linux/setresuid.c b/sysdeps/unix/sysv/linux/setresuid.c
index 70855dea46..98675ddd84 100644
--- a/sysdeps/unix/sysv/linux/setresuid.c
+++ b/sysdeps/unix/sysv/linux/setresuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,11 @@
int
__setresuid (uid_t ruid, uid_t euid, uid_t suid)
{
+#ifdef __NR_setresuid32
+ return INLINE_SETXID_SYSCALL (setresuid32, 3, ruid, euid, suid);
+#else
return INLINE_SETXID_SYSCALL (setresuid, 3, ruid, euid, suid);
+#endif
}
libc_hidden_def (__setresuid)
#ifndef __setresuid
diff --git a/sysdeps/unix/sysv/linux/setreuid.c b/sysdeps/unix/sysv/linux/setreuid.c
index 481090afe5..2305c33639 100644
--- a/sysdeps/unix/sysv/linux/setreuid.c
+++ b/sysdeps/unix/sysv/linux/setreuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,11 @@
int
__setreuid (uid_t ruid, uid_t euid)
{
+#ifdef __NR_setreuid32
+ return INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid);
+#else
return INLINE_SETXID_SYSCALL (setreuid, 2, ruid, euid);
+#endif
}
#ifndef __setreuid
weak_alias (__setreuid, setreuid)
diff --git a/sysdeps/unix/sysv/linux/setrlimit.c b/sysdeps/unix/sysv/linux/setrlimit.c
new file mode 100644
index 0000000000..4ac38fdfe2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/setrlimit.c
@@ -0,0 +1,60 @@
+/* Linux setrlimit implementation (32 bits off_t).
+ Copyright (C) 2016-2018 Free Software 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/resource.h>
+#include <sys/types.h>
+#include <shlib-compat.h>
+
+#if !__RLIM_T_MATCHES_RLIM64_T
+
+/* The compatibility symbol is meant to match the old __NR_getrlimit syscall
+ (with broken RLIM_INFINITY definition). It should be provided iff
+ __NR_getrlimit and __NR_ugetrlimit are both defined. */
+# ifndef __NR_ugetrlimit
+# undef SHLIB_COMPAT
+# define SHLIB_COMPAT(a, b, c) 0
+# endif
+
+int
+__setrlimit (enum __rlimit_resource resource, const struct rlimit *rlim)
+{
+ struct rlimit64 rlim64;
+
+ if (rlim->rlim_cur == RLIM_INFINITY)
+ rlim64.rlim_cur = RLIM64_INFINITY;
+ else
+ rlim64.rlim_cur = rlim->rlim_cur;
+ if (rlim->rlim_max == RLIM_INFINITY)
+ rlim64.rlim_max = RLIM64_INFINITY;
+ else
+ rlim64.rlim_max = rlim->rlim_max;
+
+ return INLINE_SYSCALL_CALL (prlimit64, 0, resource, &rlim64, NULL);
+}
+
+libc_hidden_def (__setrlimit)
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
+strong_alias (__setrlimit, __setrlimit_1)
+compat_symbol (libc, __setrlimit, setrlimit, GLIBC_2_0);
+versioned_symbol (libc, __setrlimit_1, setrlimit, GLIBC_2_2);
+# else
+weak_alias (__setrlimit, setrlimit)
+# endif
+
+#endif /* __RLIM_T_MATCHES_RLIM64_T */
diff --git a/sysdeps/unix/sysv/linux/setrlimit64.c b/sysdeps/unix/sysv/linux/setrlimit64.c
index 5f444d2ae7..860fccb548 100644
--- a/sysdeps/unix/sysv/linux/setrlimit64.c
+++ b/sysdeps/unix/sysv/linux/setrlimit64.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Linux setrlimit64 implementation (64 bits off_t).
+ Copyright (C) 2010-2018 Free Software 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,36 +17,38 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
-#include <sys/resource.h>
#include <sys/types.h>
-#include <sysdep.h>
-#include <kernel-features.h>
+#include <shlib-compat.h>
+
+/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T
+ linking setrlimit64 to {__}setrlimit does not throw a type error. */
+#undef setrlimit
+#undef __setrlimit
+#define setrlimit setrlimit_redirect
+#define __setrlimit __setrlimit_redirect
+#include <sys/resource.h>
+#undef setrlimit
+#undef __setrlimit
/* Set the soft and hard limits for RESOURCE to *RLIMITS.
Only the super-user can increase hard limits.
Return 0 if successful, -1 if not (and sets errno). */
int
-setrlimit64 (enum __rlimit_resource resource, const struct rlimit64 *rlimits)
+__setrlimit64 (enum __rlimit_resource resource, const struct rlimit64 *rlimits)
{
-#ifdef __ASSUME_PRLIMIT64
- return INLINE_SYSCALL (prlimit64, 4, 0, resource, rlimits, NULL);
-#else
-# ifdef __NR_prlimit64
- int res = INLINE_SYSCALL (prlimit64, 4, 0, resource, rlimits, NULL);
- if (res == 0 || errno != ENOSYS)
- return res;
-# endif
- struct rlimit rlimits32;
-
- if (rlimits->rlim_cur >= RLIM_INFINITY)
- rlimits32.rlim_cur = RLIM_INFINITY;
- else
- rlimits32.rlim_cur = rlimits->rlim_cur;
- if (rlimits->rlim_max >= RLIM_INFINITY)
- rlimits32.rlim_max = RLIM_INFINITY;
- else
- rlimits32.rlim_max = rlimits->rlim_max;
+ return INLINE_SYSCALL_CALL (prlimit64, 0, resource, rlimits, NULL);
+}
+/* Alpha defines a versioned setrlimit{64}. */
+#ifndef USE_VERSIONED_RLIMIT
+weak_alias (__setrlimit64, setrlimit64)
+#endif
- return __setrlimit (resource, &rlimits32);
+#if __RLIM_T_MATCHES_RLIM64_T
+strong_alias (__setrlimit64, __setrlimit)
+# ifndef USE_VERSIONED_RLIMIT
+weak_alias (__setrlimit64, setrlimit)
+# endif
+# ifdef SHARED
+__hidden_ver1 (__setrlimit64, __GI___setrlimit, __setrlimit64);
+# endif
#endif
-}
diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c
index b72d794773..851fb5175c 100644
--- a/sysdeps/unix/sysv/linux/setsockopt.c
+++ b/sysdeps/unix/sysv/linux/setsockopt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/setsourcefilter.c b/sysdeps/unix/sysv/linux/setsourcefilter.c
index e59beda176..3abd666af0 100644
--- a/sysdeps/unix/sysv/linux/setsourcefilter.c
+++ b/sysdeps/unix/sysv/linux/setsourcefilter.c
@@ -1,5 +1,5 @@
/* Set source filter. Linux version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -24,10 +24,7 @@
#include <stdint.h>
#include <netinet/in.h>
#include <sys/socket.h>
-
-
-/* Defined in getsourcefilter.c. */
-extern int __get_sol (int af, socklen_t len);
+#include "getsourcefilter.h"
int
diff --git a/sysdeps/unix/sysv/linux/setuid.c b/sysdeps/unix/sysv/linux/setuid.c
index 8873c8a0be..bf3a79211a 100644
--- a/sysdeps/unix/sysv/linux/setuid.c
+++ b/sysdeps/unix/sysv/linux/setuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,11 @@
int
__setuid (uid_t uid)
{
+#ifdef __NR_setuid32
+ return INLINE_SETXID_SYSCALL (setuid32, 1, uid);
+#else
return INLINE_SETXID_SYSCALL (setuid, 1, uid);
+#endif
}
#ifndef __setuid
weak_alias (__setuid, setuid)
diff --git a/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S b/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
index f9aa33cb98..402c912078 100644
--- a/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/arch-fork.h b/sysdeps/unix/sysv/linux/sh/arch-fork.h
deleted file mode 100644
index 4b1523daba..0000000000
--- a/sysdeps/unix/sysv/linux/sh/arch-fork.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. SH version.
- 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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-/* TLS pointer argument is passed as the 5-th argument. */
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 5, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \
- NULL, &THREAD_SELF->tid, NULL)
diff --git a/sysdeps/unix/sysv/linux/sh/atomic-machine.h b/sysdeps/unix/sysv/linux/sh/atomic-machine.h
index 0a8e083545..798735527b 100644
--- a/sysdeps/unix/sysv/linux/sh/atomic-machine.h
+++ b/sysdeps/unix/sysv/linux/sh/atomic-machine.h
@@ -1,5 +1,5 @@
/* Atomic operations used inside libc. Linux/SH version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -47,6 +47,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
/* SH kernel has implemented a gUSA ("g" User Space Atomicity) support
for the user space atomicity. The atomicity macros use this scheme.
diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
index 6c989576fe..60478a94d2 100644
--- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/SH.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/bits/mman.h b/sysdeps/unix/sysv/linux/sh/bits/mman.h
index 45ea5b40f9..9015957e65 100644
--- a/sysdeps/unix/sysv/linux/sh/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/sh/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/SH version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,6 +34,10 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_SYNC 0x80000 /* Perform synchronous page
+ faults for the mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Include generic Linux declarations. */
diff --git a/sysdeps/unix/sysv/linux/sh/bits/shm.h b/sysdeps/unix/sysv/linux/sh/bits/shm.h
index 0bbea7c582..25ca3a2abb 100644
--- a/sysdeps/unix/sysv/linux/sh/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/sh/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,6 +66,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/sh/brk.c b/sysdeps/unix/sysv/linux/sh/brk.c
index 9ee79e92f5..f29199c6e8 100644
--- a/sysdeps/unix/sysv/linux/sh/brk.c
+++ b/sysdeps/unix/sysv/linux/sh/brk.c
@@ -1,5 +1,5 @@
/* brk system call for Linux/SH.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/clone.S b/sysdeps/unix/sysv/linux/sh/clone.S
index 53cc08b61e..4c39c99940 100644
--- a/sysdeps/unix/sysv/linux/sh/clone.S
+++ b/sysdeps/unix/sysv/linux/sh/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,61 +66,22 @@ ENTRY(__clone)
2:
/* terminate the stack frame */
mov #0, r14
- mov r4, r0
- shlr16 r0
- tst #1, r0 // CLONE_THREAD = (1 << 16)
- bf/s 4f
- mov r4, r0
- /* new pid */
- shlr8 r0
- tst #1, r0 // CLONE_VM = (1 << 8)
- bf/s 3f
- mov #-1, r0
- mov #+SYS_ify(getpid), r3
- trapa #0x15
-3:
- stc gbr, r1
- mov.w .Lpidoff, r2
- add r1, r2
- mov.l r0, @r2
- mov.w .Ltidoff, r2
- add r1, r2
- mov.l r0, @r2
-4:
+
/* thread starts */
mov.l @r15, r1
jsr @r1
mov.l @(4,r15), r4
/* we are done, passing the return value through r0 */
- mov.l .L3, r1
-#ifdef SHARED
- mov.l r12, @-r15
- sts.l pr, @-r15
- mov r0, r4
- mova .LG, r0
- mov.l .LG, r12
- add r0, r12
- mova .L3, r0
- add r0, r1
- jsr @r1
- nop
- lds.l @r15+, pr
- rts
- mov.l @r15+, r12
-#else
- jmp @r1
- mov r0, r4
-#endif
+ mov r0, r4
+ mov #+SYS_ify(exit), r3
+ trapa #0x15
.align 2
.LG:
.long _GLOBAL_OFFSET_TABLE_
.L3:
.long PLTJMP(C_SYMBOL_NAME(_exit))
-.Lpidoff:
- .word PID - TLS_PRE_TCB_SIZE
-.Ltidoff:
- .word TID - TLS_PRE_TCB_SIZE
PSEUDO_END (__clone)
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/sh/fcntl.c b/sysdeps/unix/sysv/linux/sh/fcntl.c
deleted file mode 100644
index ea951bc4f9..0000000000
--- a/sysdeps/unix/sysv/linux/sh/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/sh/getrlimit64.c b/sysdeps/unix/sysv/linux/sh/getrlimit64.c
deleted file mode 100644
index fef018f471..0000000000
--- a/sysdeps/unix/sysv/linux/sh/getrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h
new file mode 100644
index 0000000000..b2bc30db5d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 192
+#define SIGJMP_BUF_SIZE 192
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 60
+#define SAVED_MASK_OFFSET 64
diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h
index 037d6ff0d6..b8ccb01518 100644
--- a/sysdeps/unix/sysv/linux/sh/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number. SH version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software 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,52 +17,46 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef __KERNEL_FEATURES_SH__
+# define __KERNEL_FEATURES_SH__
+
/* SH uses socketcall. */
#define __ASSUME_SOCKETCALL 1
/* These syscalls were added for SH in 2.6.37. */
-#if __LINUX_KERNEL_VERSION >= 0x020625
-# define __ASSUME_SOCKET_SYSCALL 1
-# define __ASSUME_BIND_SYSCALL 1
-# define __ASSUME_CONNECT_SYSCALL 1
-# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT_SYSCALL 1
-# define __ASSUME_GETSOCKNAME_SYSCALL 1
-# define __ASSUME_GETPEERNAME_SYSCALL 1
-# define __ASSUME_SOCKETPAIR_SYSCALL 1
-# define __ASSUME_SEND_SYSCALL 1
-# define __ASSUME_SENDTO_SYSCALL 1
-# define __ASSUME_RECV_SYSCALL 1
-# define __ASSUME_RECVFROM_SYSCALL 1
-# define __ASSUME_SHUTDOWN_SYSCALL 1
-# define __ASSUME_GETSOCKOPT_SYSCALL 1
-# define __ASSUME_SETSOCKOPT_SYSCALL 1
-# define __ASSUME_SENDMSG_SYSCALL 1
-# define __ASSUME_RECVMSG_SYSCALL 1
-#endif
-
-/* The accept4 syscall was added for SH in 2.6.37. */
-#if __LINUX_KERNEL_VERSION >= 0x020625
-# define __ASSUME_ACCEPT4_SYSCALL 1
-#endif
-
-/* The recvmmsg syscall was added for SH in 2.6.37. */
-#if __LINUX_KERNEL_VERSION >= 0x020625
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
-
-/* The sendmmsg syscall was added for SH in 3.0. */
-#if __LINUX_KERNEL_VERSION >= 0x030000
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
-#define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL 1
+#define __ASSUME_SOCKET_SYSCALL 1
+#define __ASSUME_BIND_SYSCALL 1
+#define __ASSUME_CONNECT_SYSCALL 1
+#define __ASSUME_LISTEN_SYSCALL 1
+#define __ASSUME_GETSOCKNAME_SYSCALL 1
+#define __ASSUME_GETPEERNAME_SYSCALL 1
+#define __ASSUME_SOCKETPAIR_SYSCALL 1
+#define __ASSUME_SEND_SYSCALL 1
+#define __ASSUME_RECV_SYSCALL 1
+#define __ASSUME_SHUTDOWN_SYSCALL 1
+#define __ASSUME_GETSOCKOPT_SYSCALL 1
+#define __ASSUME_SETSOCKOPT_SYSCALL 1
#include_next <kernel-features.h>
/* 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
+
+/* sh only supports ipc syscall. */
+#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+
+/* Support for the renameat2 syscall was added in 4.8. */
+#if __LINUX_KERNEL_VERSION < 0x040800
+# undef __ASSUME_RENAMEAT2
+#endif
+
+/* sh does not support the statx system call. */
+#undef __ASSUME_STATX
-/* The prlimit64 syscall was added for SH in 2.6.37. */
-#if __LINUX_KERNEL_VERSION < 0x020625
-# undef __ASSUME_PRLIMIT64
#endif
diff --git a/sysdeps/unix/sysv/linux/sh/kernel_sigaction.h b/sysdeps/unix/sysv/linux/sh/kernel_sigaction.h
new file mode 100644
index 0000000000..7ebcd08d62
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sh/kernel_sigaction.h
@@ -0,0 +1,8 @@
+/* SH uses the generic Linux UAPI but defines SA_RESTORER. */
+#define SA_RESTORER 0x04000000
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
+
+#define SET_SA_RESTORER(kact, act) \
+ (kact)->sa_restorer = (act)->sa_restorer
+#define RESET_SA_RESTORER(act, kact) \
+ (act)->sa_restorer = (kact)->sa_restorer
diff --git a/sysdeps/unix/sysv/linux/sh/ld.abilist b/sysdeps/unix/sysv/linux/sh/ld.abilist
index dc3ebf48c5..0387614d8f 100644
--- a/sysdeps/unix/sysv/linux/sh/ld.abilist
+++ b/sysdeps/unix/sysv/linux/sh/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
-GLIBC_2.2 __libc_memalign F
GLIBC_2.2 __libc_stack_end D 0x4
GLIBC_2.2 _dl_mcount F
GLIBC_2.2 _r_debug D 0x14
@@ -7,7 +5,5 @@ GLIBC_2.2 calloc F
GLIBC_2.2 free F
GLIBC_2.2 malloc F
GLIBC_2.2 realloc F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/unix/sysv/linux/sh/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/sh/libBrokenLocale.abilist
index 21343df781..0e4d814909 100644
--- a/sysdeps/unix/sysv/linux/sh/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/sh/libanl.abilist b/sysdeps/unix/sysv/linux/sh/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/sh/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/sh/libc.abilist b/sysdeps/unix/sysv/linux/sh/libc.abilist
index e1286921e5..1f4e648baa 100644
--- a/sysdeps/unix/sysv/linux/sh/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -29,7 +27,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -37,25 +34,21 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x21c
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x21c
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -64,7 +57,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -76,16 +68,13 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _Exit F
GLIBC_2.2 _IO_2_1_stderr_ D 0x98
GLIBC_2.2 _IO_2_1_stdin_ D 0x98
@@ -1830,33 +1819,71 @@ GLIBC_2.2 xdrstdio_create F
GLIBC_2.2 xencrypt F
GLIBC_2.2 xprt_register F
GLIBC_2.2 xprt_unregister F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -1950,7 +1977,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -1963,7 +1989,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x104
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -1984,7 +2009,6 @@ GLIBC_2.3.3 sched_setaffinity F
GLIBC_2.3.3 semtimedop F
GLIBC_2.3.3 sys_sigabbrev D 0x104
GLIBC_2.3.3 sys_siglist D 0x104
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2014,7 +2038,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2091,7 +2114,6 @@ GLIBC_2.4 sys_errlist D 0x210
GLIBC_2.4 sys_nerr D 0x4
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2109,7 +2131,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2117,7 +2138,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2144,7 +2164,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2155,7 +2174,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/sh/libcrypt.abilist b/sysdeps/unix/sysv/linux/sh/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/sh/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/sh/libdl.abilist b/sysdeps/unix/sysv/linux/sh/libdl.abilist
index 5536f6e0a9..7826fde951 100644
--- a/sysdeps/unix/sysv/linux/sh/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 dlopen F
GLIBC_2.1 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/sh/libm.abilist b/sysdeps/unix/sysv/linux/sh/libm.abilist
index 93b84713d8..43525fccf6 100644
--- a/sysdeps/unix/sysv/linux/sh/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -53,10 +52,8 @@ GLIBC_2.15 __y1_finite F
GLIBC_2.15 __y1f_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _LIB_VERSION D 0x4
GLIBC_2.2 __clog10 F
GLIBC_2.2 __clog10f F
@@ -368,10 +365,403 @@ GLIBC_2.2 y1l F
GLIBC_2.2 yn F
GLIBC_2.2 ynf F
GLIBC_2.2 ynl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.4 exp2l F
diff --git a/sysdeps/unix/sysv/linux/sh/libnsl.abilist b/sysdeps/unix/sysv/linux/sh/libnsl.abilist
index a23db2aeaf..add3d66a7a 100644
--- a/sysdeps/unix/sysv/linux/sh/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __free_fdresult F
GLIBC_2.1 __nis_default_access F
GLIBC_2.1 __nis_default_group F
@@ -120,5 +118,4 @@ GLIBC_2.1 readColdStartFile F
GLIBC_2.1 writeColdStartFile F
GLIBC_2.1 xdr_cback_data F
GLIBC_2.1 xdr_obj_p F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 xdr_ypall F
diff --git a/sysdeps/unix/sysv/linux/sh/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/libpthread.abilist
index a73aa43c55..bcba07f575 100644
--- a/sysdeps/unix/sysv/linux/sh/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libpthread.abilist
@@ -1,15 +1,11 @@
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_flockfile F
GLIBC_2.2 _IO_ftrylockfile F
GLIBC_2.2 _IO_funlockfile F
@@ -200,18 +196,35 @@ GLIBC_2.2 vfork F
GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -227,13 +240,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/sh/libresolv.abilist b/sysdeps/unix/sysv/linux/sh/libresolv.abilist
index 4d50e7c8c6..157a33ce35 100644
--- a/sysdeps/unix/sysv/linux/sh/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/sh/librt.abilist b/sysdeps/unix/sysv/linux/sh/librt.abilist
index 15e4418863..595f1b712a 100644
--- a/sysdeps/unix/sysv/linux/sh/librt.abilist
+++ b/sysdeps/unix/sysv/linux/sh/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 aio_cancel F
GLIBC_2.1 aio_cancel64 F
GLIBC_2.1 aio_error F
@@ -16,7 +15,6 @@ GLIBC_2.1 aio_write F
GLIBC_2.1 aio_write64 F
GLIBC_2.1 lio_listio F
GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 clock_getcpuclockid F
GLIBC_2.2 clock_getres F
GLIBC_2.2 clock_gettime F
@@ -29,7 +27,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -40,8 +37,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/sh/libthread_db.abilist b/sysdeps/unix/sysv/linux/sh/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/sh/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/sh/libutil.abilist b/sysdeps/unix/sysv/linux/sh/libutil.abilist
index 89c67755c4..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/sh/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
diff --git a/sysdeps/unix/sysv/linux/sh/localplt.data b/sysdeps/unix/sysv/linux/sh/localplt.data
new file mode 100644
index 0000000000..babb19d717
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sh/localplt.data
@@ -0,0 +1,25 @@
+# See scripts/check-localplt.awk for how this file is processed.
+# PLT use is required for the malloc family and for matherr because
+# users can define their own functions and have library internals call them.
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libc.so: _Unwind_Find_FDE
+libc.so: _exit
+libc.so: __errno_location
+libm.so: matherr
+# Generated by the compiler because there is no trap insn pattern.
+libc.so: abort ?
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h b/sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h
index 0fbc456e19..d6fd1cbef9 100644
--- a/sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h
+++ b/sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/makecontext.S b/sysdeps/unix/sysv/linux/sh/makecontext.S
index bd5990dcd5..d55792a177 100644
--- a/sysdeps/unix/sysv/linux/sh/makecontext.S
+++ b/sysdeps/unix/sysv/linux/sh/makecontext.S
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
#include "ucontext_i.h"
-/* void __makecontext (struct ucontext *ucp, void (*func)(), int argc, ...);
+/* void __makecontext (ucontext_t *ucp, void (*func)(), int argc, ...);
__makecontext sets up a stack and registers for context to run a given
function. The registers are set up like this:
r4-r7: parameters 1 to 4
diff --git a/sysdeps/unix/sysv/linux/sh/pipe.S b/sysdeps/unix/sysv/linux/sh/pipe.S
index 36bee9acde..0f6409a1ef 100644
--- a/sysdeps/unix/sysv/linux/sh/pipe.S
+++ b/sysdeps/unix/sysv/linux/sh/pipe.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/pread.c b/sysdeps/unix/sysv/linux/sh/pread.c
deleted file mode 100644
index 8afada56d2..0000000000
--- a/sysdeps/unix/sysv/linux/sh/pread.c
+++ /dev/null
@@ -1,43 +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/>. */
-
-#include <assert.h>
-#include <errno.h>
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pread
-# error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
- return SYSCALL_CANCEL (pread, fd, buf, count, 0,
- __LONG_LONG_PAIR (offset >> 31, offset));
-}
-
-strong_alias (__libc_pread, __pread)
-weak_alias (__libc_pread, pread)
diff --git a/sysdeps/unix/sysv/linux/sh/pread64.c b/sysdeps/unix/sysv/linux/sh/pread64.c
deleted file mode 100644
index cfc751d811..0000000000
--- a/sysdeps/unix/sysv/linux/sh/pread64.c
+++ /dev/null
@@ -1,43 +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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pread
-# error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
-
-ssize_t
-__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
- return SYSCALL_CANCEL (pread, fd, buf, count, 0,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
-}
-
-weak_alias (__libc_pread64, __pread64)
-weak_alias (__libc_pread64, pread64)
diff --git a/sysdeps/unix/sysv/linux/sh/profil-counter.h b/sysdeps/unix/sysv/linux/sh/profil-counter.h
index a9df613a72..8c7545bef5 100644
--- a/sysdeps/unix/sysv/linux/sh/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/sh/profil-counter.h
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Linux/SH version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/pwrite.c b/sysdeps/unix/sysv/linux/sh/pwrite.c
deleted file mode 100644
index c27d356cce..0000000000
--- a/sysdeps/unix/sysv/linux/sh/pwrite.c
+++ /dev/null
@@ -1,43 +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/>. */
-
-#include <assert.h>
-#include <errno.h>
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pwrite
-# error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
- return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
- __LONG_LONG_PAIR (offset >> 31, offset));
-}
-
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__libc_pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/sh/pwrite64.c b/sysdeps/unix/sysv/linux/sh/pwrite64.c
deleted file mode 100644
index 7948cefd63..0000000000
--- a/sysdeps/unix/sysv/linux/sh/pwrite64.c
+++ /dev/null
@@ -1,44 +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/>. */
-
-#include <errno.h>
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */
-# ifdef __NR_pwrite
-# error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
-
-ssize_t
-__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
- return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
- __LONG_LONG_PAIR ((off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff)));
-}
-
-weak_alias (__libc_pwrite64, __pwrite64)
-libc_hidden_weak (__pwrite64)
-weak_alias (__libc_pwrite64, pwrite64)
diff --git a/sysdeps/unix/sysv/linux/sh/setegid.c b/sysdeps/unix/sysv/linux/sh/setegid.c
deleted file mode 100644
index 2e3a54c893..0000000000
--- a/sysdeps/unix/sysv/linux/sh/setegid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setegid.c>
diff --git a/sysdeps/unix/sysv/linux/sh/seteuid.c b/sysdeps/unix/sysv/linux/sh/seteuid.c
deleted file mode 100644
index 18e41d08c1..0000000000
--- a/sysdeps/unix/sysv/linux/sh/seteuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/seteuid.c>
diff --git a/sysdeps/unix/sysv/linux/sh/setgid.c b/sysdeps/unix/sysv/linux/sh/setgid.c
deleted file mode 100644
index 377021d9ec..0000000000
--- a/sysdeps/unix/sysv/linux/sh/setgid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setgid.c>
diff --git a/sysdeps/unix/sysv/linux/sh/setgroups.c b/sysdeps/unix/sysv/linux/sh/setgroups.c
deleted file mode 100644
index 0e7086278f..0000000000
--- a/sysdeps/unix/sysv/linux/sh/setgroups.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* We also have to rewrite the kernel gid_t to the user land type. */
-#include <sysdeps/unix/sysv/linux/i386/setgroups.c>
diff --git a/sysdeps/unix/sysv/linux/sh/setregid.c b/sysdeps/unix/sysv/linux/sh/setregid.c
deleted file mode 100644
index 99c57ad20f..0000000000
--- a/sysdeps/unix/sysv/linux/sh/setregid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setregid.c>
diff --git a/sysdeps/unix/sysv/linux/sh/setresgid.c b/sysdeps/unix/sysv/linux/sh/setresgid.c
deleted file mode 100644
index daca1a4833..0000000000
--- a/sysdeps/unix/sysv/linux/sh/setresgid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setresgid.c>
diff --git a/sysdeps/unix/sysv/linux/sh/setresuid.c b/sysdeps/unix/sysv/linux/sh/setresuid.c
deleted file mode 100644
index 3aeabe9ad7..0000000000
--- a/sysdeps/unix/sysv/linux/sh/setresuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setresuid.c>
diff --git a/sysdeps/unix/sysv/linux/sh/setreuid.c b/sysdeps/unix/sysv/linux/sh/setreuid.c
deleted file mode 100644
index 8ad61226e9..0000000000
--- a/sysdeps/unix/sysv/linux/sh/setreuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
diff --git a/sysdeps/unix/sysv/linux/sh/setuid.c b/sysdeps/unix/sysv/linux/sh/setuid.c
deleted file mode 100644
index de394379be..0000000000
--- a/sysdeps/unix/sysv/linux/sh/setuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setuid.c>
diff --git a/sysdeps/unix/sysv/linux/sh/sh3/getcontext.S b/sysdeps/unix/sysv/linux/sh/sh3/getcontext.S
index 951790a17d..acbd905ae8 100644
--- a/sysdeps/unix/sysv/linux/sh/sh3/getcontext.S
+++ b/sysdeps/unix/sysv/linux/sh/sh3/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/sh3/register-dump.h b/sysdeps/unix/sysv/linux/sh/sh3/register-dump.h
index a4f325cfbd..e4296f749b 100644
--- a/sysdeps/unix/sysv/linux/sh/sh3/register-dump.h
+++ b/sysdeps/unix/sysv/linux/sh/sh3/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S b/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S
index 95506bbf8a..634e4a4e6f 100644
--- a/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S
+++ b/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S b/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S
index 5c983a6536..2eaa6fd328 100644
--- a/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym b/sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym
index 17397c5511..25f914a93b 100644
--- a/sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym
+++ b/sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym
@@ -13,22 +13,22 @@ SIG_SETMASK
oLINK ucontext (uc_link)
oSS_SP ucontext (uc_stack.ss_sp)
oSS_SIZE ucontext (uc_stack.ss_size)
-oR0 mcontext (gregs[R0])
-oR1 mcontext (gregs[R1])
-oR2 mcontext (gregs[R2])
-oR3 mcontext (gregs[R3])
-oR4 mcontext (gregs[R4])
-oR5 mcontext (gregs[R5])
-oR6 mcontext (gregs[R6])
-oR7 mcontext (gregs[R7])
-oR8 mcontext (gregs[R8])
-oR9 mcontext (gregs[R9])
-oR10 mcontext (gregs[R10])
-oR11 mcontext (gregs[R11])
-oR12 mcontext (gregs[R12])
-oR13 mcontext (gregs[R13])
-oR14 mcontext (gregs[R14])
-oR15 mcontext (gregs[R15])
+oR0 mcontext (gregs[REG_R0])
+oR1 mcontext (gregs[REG_R1])
+oR2 mcontext (gregs[REG_R2])
+oR3 mcontext (gregs[REG_R3])
+oR4 mcontext (gregs[REG_R4])
+oR5 mcontext (gregs[REG_R5])
+oR6 mcontext (gregs[REG_R6])
+oR7 mcontext (gregs[REG_R7])
+oR8 mcontext (gregs[REG_R8])
+oR9 mcontext (gregs[REG_R9])
+oR10 mcontext (gregs[REG_R10])
+oR11 mcontext (gregs[REG_R11])
+oR12 mcontext (gregs[REG_R12])
+oR13 mcontext (gregs[REG_R13])
+oR14 mcontext (gregs[REG_R14])
+oR15 mcontext (gregs[REG_R15])
oPC mcontext (pc)
oPR mcontext (pr)
oSR mcontext (sr)
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S
index 4862a68134..972d0c92ed 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S
+++ b/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
index 4a642abed9..4a742ca9d0 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
+++ b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -56,7 +56,6 @@ static void
register_dump (int fd, struct sigcontext *ctx)
{
char regs[22][8];
- char fpregs[34][8];
struct iovec iov[22 * 2 + 34 * 2 + 2];
size_t nr = 0;
@@ -144,6 +143,7 @@ register_dump (int fd, struct sigcontext *ctx)
ADD_STRING ("\n");
#ifdef __SH_FPU_ANY__
+ char fpregs[34][8];
if (ctx->sc_ownedfp != 0)
{
hexvalue (ctx->sc_fpregs[0], fpregs[0], 8);
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S
index a517f87f87..050e8ade16 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S
+++ b/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S
index 35869ff4e0..015e9b19d7 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym b/sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym
index 65633fbcf4..130f60cd96 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym
+++ b/sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym
@@ -13,22 +13,22 @@ SIG_SETMASK
oLINK ucontext (uc_link)
oSS_SP ucontext (uc_stack.ss_sp)
oSS_SIZE ucontext (uc_stack.ss_size)
-oR0 mcontext (gregs[R0])
-oR1 mcontext (gregs[R1])
-oR2 mcontext (gregs[R2])
-oR3 mcontext (gregs[R3])
-oR4 mcontext (gregs[R4])
-oR5 mcontext (gregs[R5])
-oR6 mcontext (gregs[R6])
-oR7 mcontext (gregs[R7])
-oR8 mcontext (gregs[R8])
-oR9 mcontext (gregs[R9])
-oR10 mcontext (gregs[R10])
-oR11 mcontext (gregs[R11])
-oR12 mcontext (gregs[R12])
-oR13 mcontext (gregs[R13])
-oR14 mcontext (gregs[R14])
-oR15 mcontext (gregs[R15])
+oR0 mcontext (gregs[REG_R0])
+oR1 mcontext (gregs[REG_R1])
+oR2 mcontext (gregs[REG_R2])
+oR3 mcontext (gregs[REG_R3])
+oR4 mcontext (gregs[REG_R4])
+oR5 mcontext (gregs[REG_R5])
+oR6 mcontext (gregs[REG_R6])
+oR7 mcontext (gregs[REG_R7])
+oR8 mcontext (gregs[REG_R8])
+oR9 mcontext (gregs[REG_R9])
+oR10 mcontext (gregs[REG_R10])
+oR11 mcontext (gregs[REG_R11])
+oR12 mcontext (gregs[REG_R12])
+oR13 mcontext (gregs[REG_R13])
+oR14 mcontext (gregs[REG_R14])
+oR15 mcontext (gregs[REG_R15])
oPC mcontext (pc)
oPR mcontext (pr)
oSR mcontext (sr)
diff --git a/sysdeps/unix/sysv/linux/sh/sigcontextinfo.h b/sysdeps/unix/sysv/linux/sh/sigcontextinfo.h
index aa7d67607d..3f33b7f11c 100644
--- a/sysdeps/unix/sysv/linux/sh/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/sh/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>, 1999.
@@ -18,9 +18,4 @@
#define SIGCONTEXT int _a2, int _a3, int _a4, struct sigcontext
-#define SIGCONTEXT_EXTRA_ARGS _a2, _a3, _a4,
#define GET_PC(ctx) ((void *) ctx.sc_pc)
-#define GET_FRAME(ctx) ((void *) ctx.sc_regs[14])
-#define GET_STACK(ctx) ((void *) ctx.sc_regs[15])
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/sh/smp.h b/sysdeps/unix/sysv/linux/sh/smp.h
index 12d44fe24c..5db99ab8c1 100644
--- a/sysdeps/unix/sysv/linux/sh/smp.h
+++ b/sysdeps/unix/sysv/linux/sh/smp.h
@@ -1,5 +1,5 @@
/* Determine whether the host has multiple processors. SH version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/sys/procfs.h b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
index 4b1b29eb6b..43a42fa2bd 100644
--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -55,7 +55,7 @@ struct elf_prstatus
unsigned long int pr_sigpend; /* Set of pending signals. */
unsigned long int pr_sighold; /* Set of held signals. */
#if 0
- struct sigaltstack pr_altstack; /* Alternate stack info. */
+ stack_t pr_altstack; /* Alternate stack info. */
struct sigaction pr_action; /* Signal action for current sig. */
#endif
__pid_t pr_pid;
diff --git a/sysdeps/unix/sysv/linux/sh/sys/ucontext.h b/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
index ab9a7e66bf..17c5d68086 100644
--- a/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,109 +21,106 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
-#include <bits/sigcontext.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
typedef int greg_t;
/* Number of general registers. */
-#define NGPREG 16
+#define __NGREG 16
+#ifdef __USE_MISC
+# define NGREG __NGREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGPREG];
+typedef greg_t gregset_t[__NGREG];
-#ifdef __USE_GNU
+#ifdef __USE_MISC
/* Number of each register is the `gregset_t' array. */
enum
{
- R0 = 0,
-#define R0 R0
- R1 = 1,
-#define R1 R1
- R2 = 2,
-#define R2 R2
- R3 = 3,
-#define R3 R3
- R4 = 4,
-#define R4 R4
- R5 = 5,
-#define R5 R5
- R6 = 6,
-#define R6 R6
- R7 = 7,
-#define R7 R7
- R8 = 8,
-#define R8 R8
- R9 = 9,
-#define R9 R9
- R10 = 10,
-#define R10 R10
- R11 = 11,
-#define R11 R11
- R12 = 12,
-#define R12 R12
- R13 = 13,
-#define R13 R13
- R14 = 14,
-#define R14 R14
- R15 = 15,
-#define R15 R15
+ REG_R0 = 0,
+# define REG_R0 REG_R0
+ REG_R1 = 1,
+# define REG_R1 REG_R1
+ REG_R2 = 2,
+# define REG_R2 REG_R2
+ REG_R3 = 3,
+# define REG_R3 REG_R3
+ REG_R4 = 4,
+# define REG_R4 REG_R4
+ REG_R5 = 5,
+# define REG_R5 REG_R5
+ REG_R6 = 6,
+# define REG_R6 REG_R6
+ REG_R7 = 7,
+# define REG_R7 REG_R7
+ REG_R8 = 8,
+# define REG_R8 REG_R8
+ REG_R9 = 9,
+# define REG_R9 REG_R9
+ REG_R10 = 10,
+# define REG_R10 REG_R10
+ REG_R11 = 11,
+# define REG_R11 REG_R11
+ REG_R12 = 12,
+# define REG_R12 REG_R12
+ REG_R13 = 13,
+# define REG_R13 REG_R13
+ REG_R14 = 14,
+# define REG_R14 REG_R14
+ REG_R15 = 15,
+# define REG_R15 REG_R15
};
#endif
-#if (defined(__SH4__) || defined(__SH4A__))
typedef int freg_t;
/* Number of FPU registers. */
-#define NFPREG 16
+#define __NFPREG 16
+#ifdef __USE_MISC
+# define NFPREG __NFPREG
+#endif
/* Structure to describe FPU registers. */
-typedef freg_t fpregset_t[NFPREG];
+typedef freg_t fpregset_t[__NFPREG];
-/* Context to describe whole processor state. */
-typedef struct
- {
- unsigned int oldmask;
- gregset_t gregs;
- unsigned int pc;
- unsigned int pr;
- unsigned int sr;
- unsigned int gbr;
- unsigned int mach;
- unsigned int macl;
- fpregset_t fpregs;
- fpregset_t xfpregs;
- unsigned int fpscr;
- unsigned int fpul;
- unsigned int ownedfp;
- } mcontext_t;
+#ifdef __USE_MISC
+# define __ctx(fld) fld
#else
+# define __ctx(fld) __ ## fld
+#endif
+
/* Context to describe whole processor state. */
typedef struct
{
- unsigned int oldmask;
- gregset_t gregs;
- unsigned int pc;
- unsigned int pr;
- unsigned int sr;
- unsigned int gbr;
- unsigned int mach;
- unsigned int macl;
+ unsigned int __ctx(oldmask);
+ gregset_t __ctx(gregs);
+ unsigned int __ctx(pc);
+ unsigned int __ctx(pr);
+ unsigned int __ctx(sr);
+ unsigned int __ctx(gbr);
+ unsigned int __ctx(mach);
+ unsigned int __ctx(macl);
+ fpregset_t __ctx(fpregs);
+ fpregset_t __ctx(xfpregs);
+ unsigned int __ctx(fpscr);
+ unsigned int __ctx(fpul);
+ unsigned int __ctx(ownedfp);
} mcontext_t;
-#endif /* __SH_FPU_ANY__ */
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
+ sigset_t uc_sigmask;
} ucontext_t;
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/sh/sys/user.h b/sysdeps/unix/sysv/linux/sh/sys/user.h
index 47b87aede9..6bfe49240c 100644
--- a/sysdeps/unix/sysv/linux/sh/sys/user.h
+++ b/sysdeps/unix/sysv/linux/sh/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#define _SYS_USER_H 1
#include <asm/ptrace.h>
+#include <stddef.h>
/* asm/ptrace.h polutes the namespace. */
#undef PTRACE_GETREGS
diff --git a/sysdeps/unix/sysv/linux/sh/syscall.S b/sysdeps/unix/sysv/linux/sh/syscall.S
index 2263e25938..1990b203ee 100644
--- a/sysdeps/unix/sysv/linux/sh/syscall.S
+++ b/sysdeps/unix/sysv/linux/sh/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/syscalls.list b/sysdeps/unix/sysv/linux/sh/syscalls.list
index 169d40f074..32badd1ee0 100644
--- a/sysdeps/unix/sysv/linux/sh/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sh/syscalls.list
@@ -15,8 +15,6 @@ getgroups - getgroups32 i:ip __getgroups getgroups
setfsgid - setfsgid32 Ei:i setfsgid
setfsuid - setfsuid32 Ei:i setfsuid
-waitpid - waitpid Ci:ipi __waitpid waitpid
-
prlimit64 EXTRA prlimit64 i:iipp prlimit64
fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.16
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
deleted file mode 100644
index 15fc85cbbe..0000000000
--- a/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
+++ /dev/null
@@ -1,169 +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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# define _IMM12 #-12
-# define _IMM16 #-16
-# define _IMP16 #16
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY (name); \
- .Lpseudo_start: \
- SINGLE_THREAD_P; \
- bf .Lpseudo_cancel; \
- .type __##syscall_name##_nocancel,@function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- DO_CALL (syscall_name, args); \
- mov r0,r1; \
- mov _IMM12,r2; \
- shad r2,r1; \
- not r1,r1; \
- tst r1,r1; \
- bt .Lsyscall_error; \
- bra .Lpseudo_end; \
- nop; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
- .Lpseudo_cancel: \
- sts.l pr,@-r15; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (pr, 0); \
- add _IMM16,r15; \
- cfi_adjust_cfa_offset (16); \
- SAVE_ARGS_##args; \
- CENABLE; \
- LOAD_ARGS_##args; \
- add _IMP16,r15; \
- cfi_adjust_cfa_offset (-16); \
- lds.l @r15+,pr; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (pr); \
- DO_CALL(syscall_name, args); \
- SYSCALL_INST_PAD; \
- sts.l pr,@-r15; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (pr, 0); \
- mov.l r0,@-r15; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (r0, 0); \
- CDISABLE; \
- mov.l @r15+,r0; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (r0); \
- lds.l @r15+,pr; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (pr); \
- mov r0,r1; \
- mov _IMM12,r2; \
- shad r2,r1; \
- not r1,r1; \
- tst r1,r1; \
- bf .Lpseudo_end; \
- .Lsyscall_error: \
- SYSCALL_ERROR_HANDLER; \
- .Lpseudo_end:
-
-# undef PSEUDO_END
-# define PSEUDO_END(sym) \
- END (sym)
-
-# define SAVE_ARGS_0 /* Nothing. */
-# define SAVE_ARGS_1 SAVE_ARGS_0; mov.l r4,@(0,r15); cfi_offset (r4,-4)
-# define SAVE_ARGS_2 SAVE_ARGS_1; mov.l r5,@(4,r15); cfi_offset (r5,-8)
-# define SAVE_ARGS_3 SAVE_ARGS_2; mov.l r6,@(8,r15); cfi_offset (r6,-12)
-# define SAVE_ARGS_4 SAVE_ARGS_3; mov.l r7,@(12,r15); cfi_offset (r7,-16)
-# define SAVE_ARGS_5 SAVE_ARGS_4
-# define SAVE_ARGS_6 SAVE_ARGS_5
-
-# define LOAD_ARGS_0 /* Nothing. */
-# define LOAD_ARGS_1 LOAD_ARGS_0; mov.l @(0,r15),r4; cfi_restore (r4)
-# define LOAD_ARGS_2 LOAD_ARGS_1; mov.l @(4,r15),r5; cfi_restore (r5)
-# define LOAD_ARGS_3 LOAD_ARGS_2; mov.l @(8,r15),r6; cfi_restore (r6)
-# define LOAD_ARGS_4 LOAD_ARGS_3; mov.l @(12,r15),r7; cfi_restore (r7)
-# define LOAD_ARGS_5 LOAD_ARGS_4
-# define LOAD_ARGS_6 LOAD_ARGS_5
-
-# if IS_IN (libpthread)
-# define __local_enable_asynccancel __pthread_enable_asynccancel
-# define __local_disable_asynccancel __pthread_disable_asynccancel
-# elif IS_IN (libc)
-# define __local_enable_asynccancel __libc_enable_asynccancel
-# define __local_disable_asynccancel __libc_disable_asynccancel
-# elif IS_IN (librt)
-# define __local_enable_asynccancel __librt_enable_asynccancel
-# define __local_disable_asynccancel __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-# define CENABLE \
- mov.l 1f,r0; \
- bsrf r0; \
- nop; \
- 0: bra 2f; \
- mov r0,r2; \
- .align 2; \
- 1: .long __local_enable_asynccancel - 0b; \
- 2:
-
-# define CDISABLE \
- mov.l 1f,r0; \
- bsrf r0; \
- mov r2,r4; \
- 0: bra 2f; \
- nop; \
- .align 2; \
- 1: .long __local_disable_asynccancel - 0b; \
- 2:
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P \
- stc gbr,r0; \
- mov.w 0f,r1; \
- sub r1,r0; \
- mov.l @(MULTIPLE_THREADS_OFFSET,r0),r0; \
- bra 1f; \
- tst r0,r0; \
- 0: .word TLS_PRE_TCB_SIZE; \
- 1:
-
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S
index 0024d79402..c4e28ffb98 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep.S
+++ b/sysdeps/unix/sysv/linux/sh/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.h b/sysdeps/unix/sysv/linux/sh/sysdep.h
index 8618d12f5a..b521e788b6 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sh/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
diff --git a/sysdeps/unix/sysv/linux/sh/vfork.S b/sysdeps/unix/sysv/linux/sh/vfork.S
index 6895bc5491..7b556cf68f 100644
--- a/sysdeps/unix/sysv/linux/sh/vfork.S
+++ b/sysdeps/unix/sysv/linux/sh/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,30 +26,11 @@
and the process ID of the new process to the old process. */
ENTRY (__libc_vfork)
- /* Save the PID value. */
- stc gbr, r2
- mov.w .L2, r0
- mov.l @(r0,r2), r4
- neg r4, r1
- tst r1, r1
- bf 1f
- mov #1, r1
- rotr r1
-1:
- mov.l r1, @(r0,r2)
mov.w .L1, r3
trapa #0x10
mov r0, r1
- /* Restore the old PID value in the parent. */
- tst r0, r0
- bt.s 2f
- stc gbr, r2
- mov.w .L2, r0
- mov.l r4, @(r0,r2)
- mov r1, r0
-2:
mov #-12, r2
shad r2, r1
not r1, r1 // r1=0 means r0 = -1 to -4095
@@ -61,8 +42,6 @@ ENTRY (__libc_vfork)
nop
.L1:
.word __NR_vfork
-.L2:
- .word PID - TLS_PRE_TCB_SIZE
.align 2
PSEUDO_END (__libc_vfork)
diff --git a/sysdeps/unix/sysv/linux/shm-directory.c b/sysdeps/unix/sysv/linux/shm-directory.c
index 222b6e6a45..6a7c7fd182 100644
--- a/sysdeps/unix/sysv/linux/shm-directory.c
+++ b/sysdeps/unix/sysv/linux/shm-directory.c
@@ -1,5 +1,5 @@
/* Determine directory for shm/sem files. Linux version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -135,13 +135,13 @@ __shm_directory (size_t *len)
}
#if IS_IN (libpthread)
hidden_def (__shm_directory)
-#endif
-
/* Make sure the table is freed if we want to free everything before
exiting. */
-libc_freeres_fn (freeit)
+void
+__shm_directory_freeres (void)
{
if (mountpoint.dir != defaultdir)
free (mountpoint.dir);
}
+#endif
diff --git a/sysdeps/unix/sysv/linux/shmat.c b/sysdeps/unix/sysv/linux/shmat.c
index 5afc93c9a9..25fc34e801 100644
--- a/sysdeps/unix/sysv/linux/shmat.c
+++ b/sysdeps/unix/sysv/linux/shmat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -16,13 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <sys/shm.h>
+#include <sys/msg.h>
#include <ipc_priv.h>
-
#include <sysdep.h>
-#include <unistd.h>
-#include <sys/syscall.h>
+#include <errno.h>
/* Attach the shared memory segment associated with SHMID to the data
segment of the calling process. SHMADDR and SHMFLG determine how
@@ -31,17 +28,19 @@
void *
shmat (int shmid, const void *shmaddr, int shmflg)
{
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return (void*) INLINE_SYSCALL_CALL (shmat, shmid, shmaddr, shmflg);
+#else
INTERNAL_SYSCALL_DECL(err);
unsigned long resultvar;
void *raddr;
- resultvar = INTERNAL_SYSCALL (ipc, err, 5, IPCOP_shmat,
- shmid, shmflg,
- (long int) &raddr,
- (void *) shmaddr);
+ resultvar = INTERNAL_SYSCALL_CALL (ipc, err, IPCOP_shmat, shmid, shmflg,
+ &raddr, shmaddr);
if (INTERNAL_SYSCALL_ERROR_P (resultvar, err))
return (void *) INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (resultvar,
err));
return raddr;
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
index b2caf7543b..25c5152944 100644
--- a/sysdeps/unix/sysv/linux/shmctl.c
+++ b/sysdeps/unix/sysv/linux/shmctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -16,18 +16,34 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <sys/shm.h>
+#include <stdarg.h>
#include <ipc_priv.h>
-
#include <sysdep.h>
-#include <string.h>
-#include <sys/syscall.h>
-#include <bits/wordsize.h>
#include <shlib-compat.h>
+#include <errno.h>
+
+
+#ifndef DEFAULT_VERSION
+# define DEFAULT_VERSION GLIBC_2_2
+#endif
-#include <kernel-features.h>
+/* Provide operations to control over shared memory segments. */
+int
+__new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
+{
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (shmctl, shmid, cmd | __IPC_64, buf);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_shmctl, shmid, cmd | __IPC_64, 0,
+ buf);
+#endif
+}
+versioned_symbol (libc, __new_shmctl, shmctl, DEFAULT_VERSION);
+
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
struct __old_shmid_ds
{
struct __old_ipc_perm shm_perm; /* operation permission struct */
@@ -43,36 +59,15 @@ struct __old_shmid_ds
struct vm_area_struct *__attaches; /* descriptors for attaches */
};
-struct __old_shminfo
-{
- int shmmax;
- int shmmin;
- int shmmni;
- int shmseg;
- int shmall;
-};
-
-/* Provide operations to control over shared memory segments. */
-#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
-int __old_shmctl (int, int, struct __old_shmid_ds *);
-#endif
-int __new_shmctl (int, int, struct shmid_ds *);
-
-#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
int
attribute_compat_text_section
__old_shmctl (int shmid, int cmd, struct __old_shmid_ds *buf)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, buf);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (shmctl, shmid, cmd, buf);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_shmctl, shmid, cmd, 0, buf);
+#endif
}
compat_symbol (libc, __old_shmctl, shmctl, GLIBC_2_0);
#endif
-
-int
-__new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
-{
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd | __IPC_64, 0,
- buf);
-}
-
-versioned_symbol (libc, __new_shmctl, shmctl, GLIBC_2_2);
diff --git a/sysdeps/unix/sysv/linux/shmdt.c b/sysdeps/unix/sysv/linux/shmdt.c
index 7224d6fc17..58b722aa5b 100644
--- a/sysdeps/unix/sysv/linux/shmdt.c
+++ b/sysdeps/unix/sysv/linux/shmdt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -16,12 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <sys/shm.h>
+#include <sys/msg.h>
#include <ipc_priv.h>
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
/* Detach shared memory segment starting at address specified by SHMADDR
from the caller's data segment. */
@@ -29,5 +27,9 @@
int
shmdt (const void *shmaddr)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmdt, 0, 0, 0, (void *) shmaddr);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (shmdt, shmaddr);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_shmdt, 0, 0, 0, shmaddr);
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/shmget.c b/sysdeps/unix/sysv/linux/shmget.c
index bd624fc40b..52dd1f7b4c 100644
--- a/sysdeps/unix/sysv/linux/shmget.c
+++ b/sysdeps/unix/sysv/linux/shmget.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, August 1995.
@@ -16,13 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <sys/shm.h>
+#include <sys/msg.h>
#include <ipc_priv.h>
-#include <stdlib.h> /* for definition of NULL */
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
/* Return an identifier for an shared memory segment of at least size SIZE
which is associated with KEY. */
@@ -30,5 +27,9 @@
int
shmget (key_t key, size_t size, int shmflg)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmget, key, size, shmflg, NULL);
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return INLINE_SYSCALL_CALL (shmget, key, size, shmflg, NULL);
+#else
+ return INLINE_SYSCALL_CALL (ipc, IPCOP_shmget, key, size, shmflg, NULL);
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/shutdown.c b/sysdeps/unix/sysv/linux/shutdown.c
index 6ccb1eb9cf..a1ec452642 100644
--- a/sysdeps/unix/sysv/linux/shutdown.c
+++ b/sysdeps/unix/sysv/linux/shutdown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sigaction.c b/sysdeps/unix/sysv/linux/sigaction.c
index 20f4d0ff4f..0e6851a148 100644
--- a/sysdeps/unix/sysv/linux/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sigaction.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,11 +22,19 @@
#include <sysdep.h>
#include <sys/syscall.h>
-/* The difference here is that the sigaction structure used in the
- kernel is not the same as we use in the libc. Therefore we must
- translate it here. */
+/* New ports should not define the obsolete SA_RESTORER, however some
+ architecture requires for compat mode and/or due old ABI. */
#include <kernel_sigaction.h>
+#ifndef SA_RESTORER
+# define SET_SA_RESTORER(kact, act)
+# define RESET_SA_RESTORER(act, kact)
+#endif
+
+/* SPARC passes the restore function as an argument to rt_sigaction. */
+#ifndef STUB
+# define STUB(act)
+#endif
/* If ACT is not NULL, change the action for SIG to *ACT.
If OACT is not NULL, put the old action for SIG in *OACT. */
@@ -42,25 +50,21 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
kact.k_sa_handler = act->sa_handler;
memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
kact.sa_flags = act->sa_flags;
-#ifdef HAVE_SA_RESTORER
- kact.sa_restorer = act->sa_restorer;
-#endif
+ SET_SA_RESTORER (&kact, act);
}
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- result = INLINE_SYSCALL (rt_sigaction, 4, sig,
- act ? &kact : NULL,
- oact ? &koact : NULL, _NSIG / 8);
+ result = INLINE_SYSCALL_CALL (rt_sigaction, sig,
+ act ? &kact : NULL,
+ oact ? &koact : NULL, STUB(act) _NSIG / 8);
if (oact && result >= 0)
{
oact->sa_handler = koact.k_sa_handler;
memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
oact->sa_flags = koact.sa_flags;
-#ifdef HAVE_SA_RESTORER
- oact->sa_restorer = koact.sa_restorer;
-#endif
+ RESET_SA_RESTORER (oact, &koact);
}
return result;
}
diff --git a/sysdeps/unix/sysv/linux/siglist.h b/sysdeps/unix/sysv/linux/siglist.h
index 868851eb8d..1debf789b4 100644
--- a/sysdeps/unix/sysv/linux/siglist.h
+++ b/sysdeps/unix/sysv/linux/siglist.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/signalfd.c b/sysdeps/unix/sysv/linux/signalfd.c
index ba64dad801..a0422bec1c 100644
--- a/sysdeps/unix/sysv/linux/signalfd.c
+++ b/sysdeps/unix/sysv/linux/signalfd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,34 +19,10 @@
#include <signal.h>
#include <sys/signalfd.h>
#include <sysdep.h>
-#include <kernel-features.h>
int
signalfd (int fd, const sigset_t *mask, int flags)
{
-#ifdef __NR_signalfd4
- int res = INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
-# ifndef __ASSUME_SIGNALFD4
- if (res != -1 || errno != ENOSYS)
-# endif
- return res;
-#endif
-
-#ifndef __ASSUME_SIGNALFD4
- /* The old system call has no flag parameter which is bad. So we have
- to wait until we have to support to pass additional values to the
- kernel (sys_indirect) before implementing setting flags like
- O_NONBLOCK etc. */
- if (flags != 0)
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-
-# ifdef __NR_signalfd
- return INLINE_SYSCALL (signalfd, 3, fd, mask, _NSIG / 8);
-# else
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-# endif
-#elif !defined __NR_signalfd4
-# error "__ASSUME_SIGNALFD4 defined but not __NR_signalfd4"
-#endif
+ return INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
}
diff --git a/sysdeps/unix/sysv/linux/sigpending.c b/sysdeps/unix/sysv/linux/sigpending.c
index 53b7e78ff5..4fc0e1f2b0 100644
--- a/sysdeps/unix/sysv/linux/sigpending.c
+++ b/sysdeps/unix/sysv/linux/sigpending.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
index 2fae62bfb7..d13bfd8ff9 100644
--- a/sysdeps/unix/sysv/linux/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sigprocmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,27 +30,21 @@
int
__sigprocmask (int how, const sigset_t *set, sigset_t *oset)
{
-#ifdef SIGCANCEL
sigset_t local_newmask;
/* The only thing we have to make sure here is that SIGCANCEL and
SIGSETXID are not blocked. */
if (set != NULL
&& (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
-# ifdef SIGSETXID
- || __builtin_expect (__sigismember (set, SIGSETXID), 0)
-# endif
- ))
+ || __builtin_expect (__sigismember (set, SIGSETXID), 0)))
{
local_newmask = *set;
__sigdelset (&local_newmask, SIGCANCEL);
-# ifdef SIGSETXID
__sigdelset (&local_newmask, SIGSETXID);
-# endif
set = &local_newmask;
}
-#endif
return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
+libc_hidden_def (__sigprocmask)
weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/sigqueue.c b/sysdeps/unix/sysv/linux/sigqueue.c
index f59bac9473..f3562b018b 100644
--- a/sysdeps/unix/sysv/linux/sigqueue.c
+++ b/sysdeps/unix/sysv/linux/sigqueue.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software 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,13 +17,10 @@
#include <errno.h>
#include <signal.h>
-#include <unistd.h>
#include <string.h>
-
+#include <unistd.h>
#include <sysdep.h>
-#include <sys/syscall.h>
-#ifdef __NR_rt_sigqueueinfo
/* Return any pending signal or wait for one for the given time. */
int
__sigqueue (pid_t pid, int sig, const union sigval val)
@@ -40,9 +37,6 @@ __sigqueue (pid_t pid, int sig, const union sigval val)
info.si_uid = __getuid ();
info.si_value = val;
- return INLINE_SYSCALL (rt_sigqueueinfo, 3, pid, sig, &info);
+ return INLINE_SYSCALL_CALL (rt_sigqueueinfo, pid, sig, &info);
}
weak_alias (__sigqueue, sigqueue)
-#else
-# include <signal/sigqueue.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/sigset-cvt-mask.h b/sysdeps/unix/sysv/linux/sigset-cvt-mask.h
index 5d7b3848a7..91c12a6ac5 100644
--- a/sysdeps/unix/sysv/linux/sigset-cvt-mask.h
+++ b/sysdeps/unix/sysv/linux/sigset-cvt-mask.h
@@ -1,6 +1,6 @@
/* Convert between lowlevel sigmask and libc representation of sigset_t.
Linux version.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Joe Keane <jgk@jgk.org>.
diff --git a/sysdeps/unix/sysv/linux/sigsetops.h b/sysdeps/unix/sysv/linux/sigsetops.h
new file mode 100644
index 0000000000..6fcfd4cf7e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sigsetops.h
@@ -0,0 +1,108 @@
+/* __sigset_t manipulators. Linux version.
+ Copyright (C) 1991-2018 Free Software 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 _SIGSETOPS_H
+#define _SIGSETOPS_H 1
+
+#include <signal.h>
+
+/* Return a mask that includes the bit for SIG only. */
+# define __sigmask(sig) \
+ (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int))))
+
+/* Return the word index for SIG. */
+# define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int)))
+
+# define __sigemptyset(set) \
+ (__extension__ ({ \
+ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__set = (set); \
+ while (--__cnt >= 0) \
+ __set->__val[__cnt] = 0; \
+ (void)0; \
+ }))
+
+# define __sigfillset(set) \
+ (__extension__ ({ \
+ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__set = (set); \
+ while (--__cnt >= 0) \
+ __set->__val[__cnt] = ~0UL; \
+ (void)0; \
+ }))
+
+# define __sigisemptyset(set) \
+ (__extension__ ({ \
+ int __cnt = _SIGSET_NWORDS; \
+ const sigset_t *__set = (set); \
+ int __ret = __set->__val[--__cnt]; \
+ while (!__ret && --__cnt >= 0) \
+ __ret = __set->__val[__cnt]; \
+ __ret == 0; \
+ }))
+
+# define __sigandset(dest, left, right) \
+ (__extension__ ({ \
+ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__dest = (dest); \
+ const sigset_t *__left = (left); \
+ const sigset_t *__right = (right); \
+ while (--__cnt >= 0) \
+ __dest->__val[__cnt] = (__left->__val[__cnt] \
+ & __right->__val[__cnt]); \
+ (void)0; \
+ }))
+
+# define __sigorset(dest, left, right) \
+ (__extension__ ({ \
+ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__dest = (dest); \
+ const sigset_t *__left = (left); \
+ const sigset_t *__right = (right); \
+ while (--__cnt >= 0) \
+ __dest->__val[__cnt] = (__left->__val[__cnt] \
+ | __right->__val[__cnt]); \
+ (void)0; \
+ }))
+
+/* These macros needn't check for a bogus signal number;
+ error checking is done in the non-__ versions. */
+# define __sigismember(set, sig) \
+ (__extension__ ({ \
+ unsigned long int __mask = __sigmask (sig); \
+ unsigned long int __word = __sigword (sig); \
+ (set)->__val[__word] & __mask ? 1 : 0; \
+ }))
+
+# define __sigaddset(set, sig) \
+ (__extension__ ({ \
+ unsigned long int __mask = __sigmask (sig); \
+ unsigned long int __word = __sigword (sig); \
+ (set)->__val[__word] |= __mask; \
+ (void)0; \
+ }))
+
+# define __sigdelset(set, sig) \
+ (__extension__ ({ \
+ unsigned long int __mask = __sigmask (sig); \
+ unsigned long int __word = __sigword (sig); \
+ (set)->__val[__word] &= ~__mask; \
+ (void)0; \
+ }))
+
+#endif /* bits/sigsetops.h */
diff --git a/sysdeps/unix/sysv/linux/sigstack.c b/sysdeps/unix/sysv/linux/sigstack.c
index b134d8e5b9..44916f7c42 100644
--- a/sysdeps/unix/sysv/linux/sigstack.c
+++ b/sysdeps/unix/sysv/linux/sigstack.c
@@ -1,5 +1,5 @@
/* Emulate sigstack function using sigaltstack.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
diff --git a/sysdeps/unix/sysv/linux/sigsuspend.c b/sysdeps/unix/sysv/linux/sigsuspend.c
index fa871111d4..744e75d9c9 100644
--- a/sysdeps/unix/sysv/linux/sigsuspend.c
+++ b/sysdeps/unix/sysv/linux/sigsuspend.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software 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,12 +15,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <signal.h>
-#include <unistd.h>
-
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
/* Change the set of blocked signals to SET,
wait until a signal arrives, and restore the set of blocked signals. */
diff --git a/sysdeps/unix/sysv/linux/sigtimedwait.c b/sysdeps/unix/sysv/linux/sigtimedwait.c
index e752215f71..b4de8856dd 100644
--- a/sysdeps/unix/sysv/linux/sigtimedwait.c
+++ b/sysdeps/unix/sysv/linux/sigtimedwait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,39 +18,14 @@
#include <errno.h>
#include <signal.h>
#include <string.h>
-
-#include <nptl/pthreadP.h>
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_rt_sigtimedwait
int
__sigtimedwait (const sigset_t *set, siginfo_t *info,
const struct timespec *timeout)
{
-#ifdef SIGCANCEL
- sigset_t tmpset;
- if (set != NULL
- && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
-# ifdef SIGSETXID
- || __builtin_expect (__sigismember (set, SIGSETXID), 0)
-# endif
- ))
- {
- /* Create a temporary mask without the bit for SIGCANCEL set. */
- // We are not copying more than we have to.
- memcpy (&tmpset, set, _NSIG / 8);
- __sigdelset (&tmpset, SIGCANCEL);
-# ifdef SIGSETXID
- __sigdelset (&tmpset, SIGSETXID);
-# endif
- set = &tmpset;
- }
-#endif
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
+ /* XXX The size argument hopefully will have to be changed to the
+ real size of the user-level sigset_t. */
int result = SYSCALL_CANCEL (rt_sigtimedwait, set, info, timeout, _NSIG / 8);
/* The kernel generates a SI_TKILL code in si_code in case tkill is
@@ -64,6 +39,3 @@ __sigtimedwait (const sigset_t *set, siginfo_t *info,
}
libc_hidden_def (__sigtimedwait)
weak_alias (__sigtimedwait, sigtimedwait)
-#else
-# include <signal/sigtimedwait.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/sigwait.c b/sysdeps/unix/sysv/linux/sigwait.c
index d79f017db9..920c924c9c 100644
--- a/sysdeps/unix/sysv/linux/sigwait.c
+++ b/sysdeps/unix/sysv/linux/sigwait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software 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,93 +15,28 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <signal.h>
-#define __need_NULL
-#include <stddef.h>
-#include <string.h>
-
-#include <nptl/pthreadP.h>
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_rt_sigtimedwait
-
-/* Return any pending signal or wait for one for the given time. */
-static int
-do_sigwait (const sigset_t *set, int *sig)
-{
- int ret;
-
-#ifdef SIGCANCEL
- sigset_t tmpset;
- if (set != NULL
- && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
-# ifdef SIGSETXID
- || __builtin_expect (__sigismember (set, SIGSETXID), 0)
-# endif
- ))
- {
- /* Create a temporary mask without the bit for SIGCANCEL set. */
- // We are not copying more than we have to.
- memcpy (&tmpset, set, _NSIG / 8);
- __sigdelset (&tmpset, SIGCANCEL);
-# ifdef SIGSETXID
- __sigdelset (&tmpset, SIGSETXID);
-# endif
- set = &tmpset;
- }
-#endif
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
-#ifdef INTERNAL_SYSCALL
- INTERNAL_SYSCALL_DECL (err);
- do
- ret = INTERNAL_SYSCALL (rt_sigtimedwait, err, 4, set,
- NULL, NULL, _NSIG / 8);
- while (INTERNAL_SYSCALL_ERROR_P (ret, err)
- && INTERNAL_SYSCALL_ERRNO (ret, err) == EINTR);
- if (! INTERNAL_SYSCALL_ERROR_P (ret, err))
- {
- *sig = ret;
- ret = 0;
- }
- else
- ret = INTERNAL_SYSCALL_ERRNO (ret, err);
-#else
- do
- ret = INLINE_SYSCALL (rt_sigtimedwait, 4, set, NULL, NULL, _NSIG / 8);
- while (ret == -1 && errno == EINTR);
- if (ret != -1)
- {
- *sig = ret;
- ret = 0;
- }
- else
- ret = errno;
-#endif
-
- return ret;
-}
+#include <errno.h>
int
__sigwait (const sigset_t *set, int *sig)
{
- if (SINGLE_THREAD_P)
- return do_sigwait (set, sig);
-
- int oldtype = LIBC_CANCEL_ASYNC ();
-
- int result = do_sigwait (set, sig);
-
- LIBC_CANCEL_RESET (oldtype);
-
- return result;
+ siginfo_t si;
+ int ret;
+ do
+ ret = __sigtimedwait (set, &si, 0);
+ /* Applications do not expect sigwait to return with EINTR, and the
+ error code is not specified by POSIX. */
+ while (ret < 0 && errno == EINTR);
+ if (ret < 0)
+ return errno;
+ *sig = si.si_signo;
+ return 0;
}
libc_hidden_def (__sigwait)
weak_alias (__sigwait, sigwait)
-#else
-# include <sysdeps/posix/sigwait.c>
-#endif
strong_alias (__sigwait, __libc_sigwait)
+
+/* __sigtimedwait handles cancellation. */
+LIBC_CANCEL_HANDLED ();
diff --git a/sysdeps/unix/sysv/linux/sigwaitinfo.c b/sysdeps/unix/sysv/linux/sigwaitinfo.c
index 5bb2bf1de6..55003fc516 100644
--- a/sysdeps/unix/sysv/linux/sigwaitinfo.c
+++ b/sysdeps/unix/sysv/linux/sigwaitinfo.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software 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,59 +15,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <signal.h>
-#define __need_NULL
-#include <stddef.h>
-#include <string.h>
-
-#include <nptl/pthreadP.h>
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_rt_sigtimedwait
/* Return any pending signal or wait for one for the given time. */
int
__sigwaitinfo (const sigset_t *set, siginfo_t *info)
{
-#ifdef SIGCANCEL
- sigset_t tmpset;
- if (set != NULL
- && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
-# ifdef SIGSETXID
- || __builtin_expect (__sigismember (set, SIGSETXID), 0)
-# endif
- ))
- {
- /* Create a temporary mask without the bit for SIGCANCEL set. */
- // We are not copying more than we have to.
- memcpy (&tmpset, set, _NSIG / 8);
- __sigdelset (&tmpset, SIGCANCEL);
-# ifdef SIGSETXID
- __sigdelset (&tmpset, SIGSETXID);
-# endif
- set = &tmpset;
- }
-#endif
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- int result = SYSCALL_CANCEL (rt_sigtimedwait, set, info, NULL, _NSIG / 8);
-
- /* The kernel generates a SI_TKILL code in si_code in case tkill is
- used. tkill is transparently used in raise(). Since having
- SI_TKILL as a code is useful in general we fold the results
- here. */
- if (result != -1 && info != NULL && info->si_code == SI_TKILL)
- info->si_code = SI_USER;
-
- return result;
+ return __sigtimedwait (set, info, 0);
}
libc_hidden_def (__sigwaitinfo)
weak_alias (__sigwaitinfo, sigwaitinfo)
-#else
-# include <signal/sigwaitinfo.c>
-#endif
strong_alias (__sigwaitinfo, __libc_sigwaitinfo)
+
+/* __sigtimedwait handles cancellation. */
+LIBC_CANCEL_HANDLED ();
diff --git a/sysdeps/unix/sysv/linux/sizes.h b/sysdeps/unix/sysv/linux/sizes.h
index 2b8c911cfe..f7e9161d58 100644
--- a/sysdeps/unix/sysv/linux/sizes.h
+++ b/sysdeps/unix/sysv/linux/sizes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/socket.c b/sysdeps/unix/sysv/linux/socket.c
index 9d14507082..e4cf7d0ff6 100644
--- a/sysdeps/unix/sysv/linux/socket.c
+++ b/sysdeps/unix/sysv/linux/socket.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/socketcall.h b/sysdeps/unix/sysv/linux/socketcall.h
index 85ae7631e9..bbae6f85e9 100644
--- a/sysdeps/unix/sysv/linux/socketcall.h
+++ b/sysdeps/unix/sysv/linux/socketcall.h
@@ -1,5 +1,5 @@
/* ID for functions called via socketcall system call.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/socketpair.c b/sysdeps/unix/sysv/linux/socketpair.c
index 6523a8aa73..6cf4ea247c 100644
--- a/sysdeps/unix/sysv/linux/socketpair.c
+++ b/sysdeps/unix/sysv/linux/socketpair.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/Makefile b/sysdeps/unix/sysv/linux/sparc/Makefile
index e67aecf8f0..b0d182a439 100644
--- a/sysdeps/unix/sysv/linux/sparc/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/Makefile
@@ -1,11 +1,10 @@
abi-variants := 32 64
-abi-32-options := -U__sparc_v9__ -U__arch64__
abi-32-condition := __WORDSIZE == 32
-abi-64-options := -D__sparc_v9__ -D__arch64__
abi-64-condition := __WORDSIZE == 64
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
endif
ifeq ($(subdir),sysvipc)
@@ -15,4 +14,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/arch-fork.h b/sysdeps/unix/sysv/linux/sparc/arch-fork.h
deleted file mode 100644
index 465a4b2fa0..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/arch-fork.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. SPARC version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-#define ARCH_FORK() \
- INLINE_CLONE_SYSCALL (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
- 0, NULL, NULL, &THREAD_SELF->tid)
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/environments.h b/sysdeps/unix/sysv/linux/sparc/bits/environments.h
index edee623127..10542c95e1 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/environments.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/environments.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/epoll.h b/sysdeps/unix/sysv/linux/sparc/bits/epoll.h
index bfeb704dbd..2dd8b0ea69 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/errno.h b/sysdeps/unix/sysv/linux/sparc/bits/errno.h
index 30fce10de9..4fab9acc00 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/errno.h
@@ -1,5 +1,5 @@
/* Error constants. Linux/Sparc specific version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,23 +16,29 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _ERRNO_H
+#ifndef _BITS_ERRNO_H
+#define _BITS_ERRNO_H 1
+
+#if !defined _ERRNO_H
+# error "Never include <bits/errno.h> directly; use <errno.h> instead."
+#endif
-# undef EDOM
-# undef EILSEQ
-# undef ERANGE
# include <linux/errno.h>
-/* Linux has no ENOTSUP error code. */
-# define ENOTSUP EOPNOTSUPP
+/* Older Linux headers do not define these constants. */
+# ifndef ENOTSUP
+# define ENOTSUP EOPNOTSUPP
+# endif
# ifndef ECANCELED
-# define ECANCELED 127
+# define ECANCELED 127
# endif
-/* Support for error codes to support robust mutexes was added later, too. */
# ifndef EOWNERDEAD
# define EOWNERDEAD 132
+# endif
+
+# ifndef ENOTRECOVERABLE
# define ENOTRECOVERABLE 133
# endif
@@ -44,22 +50,4 @@
# define EHWPOISON 135
# endif
-# ifndef __ASSEMBLER__
-/* Function to get address of global `errno' variable. */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
-
-# if !defined _LIBC || defined _LIBC_REENTRANT
-/* When using threads, errno is a per-thread value. */
-# define errno (*__errno_location ())
-# endif
-# endif /* !__ASSEMBLER__ */
-#endif /* _ERRNO_H */
-
-#if !defined _ERRNO_H && defined __need_Emath
-/* This is ugly but the kernel header is not clean enough. We must
- define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
- defined. */
-# define EDOM 33 /* Math argument out of domain of function. */
-# define EILSEQ 122 /* Illegal byte sequence. */
-# define ERANGE 34 /* Math result not representable. */
-#endif /* !_ERRNO_H && __need_Emath */
+#endif /* bits/errno.h. */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/eventfd.h b/sysdeps/unix/sysv/linux/sparc/bits/eventfd.h
index d99b511753..575736bbcf 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/eventfd.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/eventfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index 4f3cb3cd5b..cac4cdbaaa 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/SPARC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/inotify.h b/sysdeps/unix/sysv/linux/sparc/bits/inotify.h
index 2f762715d2..540ea61638 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/inotify.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h b/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h
index 48ab969db3..61c2f1f01f 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/ipc.h b/sysdeps/unix/sysv/linux/sparc/bits/ipc.h
index 4404740338..d455c57520 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h b/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h
index 9450b426ec..a7ec88e191 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Linux/SPARC version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/bits/mman.h
index bc5ccac69e..3a3ffb9946 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/SPARC version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,6 +36,8 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Flags for `mlockall'. */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/msq.h b/sysdeps/unix/sysv/linux/sparc/bits/msq.h
index 7eb7d1c6c8..68a280c1ae 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -67,6 +67,7 @@ struct msqid_ds
/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12
+# define MSG_STAT_ANY 13
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/poll.h b/sysdeps/unix/sysv/linux/sparc/bits/poll.h
index 5b4551cc64..415b3a6d17 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/poll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/resource.h b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
index 305ca5ef93..ee5c26e8c4 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
@@ -1,5 +1,5 @@
/* Bit values & structures for resource limits. Linux/SPARC version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -191,51 +191,8 @@ enum __rusage_who
#endif
};
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
-
-/* Structure which says how much of each resource has been used. */
-struct rusage
- {
- /* Total amount of user time used. */
- struct timeval ru_utime;
- /* Total amount of system time used. */
- struct timeval ru_stime;
- /* Maximum resident set size (in kilobytes). */
- long int ru_maxrss;
- /* Amount of sharing of text segment memory
- with other processes (kilobyte-seconds). */
- long int ru_ixrss;
- /* Amount of data segment memory used (kilobyte-seconds). */
- long int ru_idrss;
- /* Amount of stack memory used (kilobyte-seconds). */
- long int ru_isrss;
- /* Number of soft page faults (i.e. those serviced by reclaiming
- a page from the list of pages awaiting reallocation. */
- long int ru_minflt;
- /* Number of hard page faults (i.e. those that required I/O). */
- long int ru_majflt;
- /* Number of times a process was swapped out of physical memory. */
- long int ru_nswap;
- /* Number of input operations via the file system. Note: This
- and `ru_oublock' do not include operations with the cache. */
- long int ru_inblock;
- /* Number of output operations via the file system. */
- long int ru_oublock;
- /* Number of IPC messages sent. */
- long int ru_msgsnd;
- /* Number of IPC messages received. */
- long int ru_msgrcv;
- /* Number of signals delivered. */
- long int ru_nsignals;
- /* Number of voluntary context switches, i.e. because the process
- gave up the process before it had to (usually to wait for some
- resource to be available). */
- long int ru_nvcsw;
- /* Number of involuntary context switches, i.e. a higher priority process
- became runnable or the current process used up its time slice. */
- long int ru_nivcsw;
- };
+#include <bits/types/struct_timeval.h>
+#include <bits/types/struct_rusage.h>
/* Priority limits. */
#define PRIO_MIN -20 /* Minimum priority a process can have. */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sem.h b/sysdeps/unix/sysv/linux/sparc/bits/sem.h
index f4a59c9e67..f5b2654eec 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -73,6 +73,7 @@ struct semid_ds
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
+# define SEM_STAT_ANY 20
struct seminfo
{
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h b/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
index f2b680bfbc..14089fca96 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,30 +29,30 @@
#ifndef _ASM
typedef struct __sparc64_jmp_buf
{
- struct __sparc64_jmp_buf *uc_link;
- unsigned long uc_flags;
- unsigned long uc_sigmask;
+ struct __sparc64_jmp_buf *__uc_link;
+ unsigned long __uc_flags;
+ unsigned long __uc_sigmask;
struct __sparc64_jmp_buf_mcontext
{
- unsigned long mc_gregs[19];
- unsigned long mc_fp;
- unsigned long mc_i7;
+ unsigned long __mc_gregs[19];
+ unsigned long __mc_fp;
+ unsigned long __mc_i7;
struct __sparc64_jmp_buf_fpu
{
union
{
- unsigned int sregs[32];
- unsigned long dregs[32];
- long double qregs[16];
- } mcfpu_fpregs;
- unsigned long mcfpu_fprs;
- unsigned long mcfpu_gsr;
- void *mcfpu_fq;
- unsigned char mcfpu_qcnt;
- unsigned char mcfpu_qentsz;
- unsigned char mcfpu_enab;
- } mc_fpregs;
- } uc_mcontext;
+ unsigned int __sregs[32];
+ unsigned long __dregs[32];
+ long double __qregs[16];
+ } __mcfpu_fpregs;
+ unsigned long __mcfpu_fprs;
+ unsigned long __mcfpu_gsr;
+ void *__mcfpu_fq;
+ unsigned char __mcfpu_qcnt;
+ unsigned char __mcfpu_qentsz;
+ unsigned char __mcfpu_enab;
+ } __mc_fpregs;
+ } __uc_mcontext;
} __jmp_buf[1];
#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/shm.h b/sysdeps/unix/sysv/linux/sparc/bits/shm.h
index 45e9e348ff..d967f167d9 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -75,6 +75,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
index bf99148b60..8d4665a607 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
@@ -1,5 +1,5 @@
/* The proper definitions for Linux/SPARC sigaction.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGACTION_H
+#define _BITS_SIGACTION_H 1
+
#ifndef _SIGNAL_H
# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
#endif
@@ -26,7 +29,7 @@
struct sigaction
{
/* Signal handler. */
-#ifdef __USE_POSIX199309
+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
union
{
/* Used if SA_SIGINFO is not set. */
@@ -60,19 +63,21 @@ struct sigaction
#define SA_NOCLDWAIT 0x00000100 /* Don't create zombie on child death. */
#define SA_SIGINFO 0x00000200 /* Invoke signal-catching function with
three arguments instead of one. */
-#if defined __USE_UNIX98 || defined __USE_MISC
+#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
# define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
#endif
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
# define SA_RESTART 0x00000002 /* Restart syscall on signal return. */
-# define SA_INTERRUPT 0x00000010 /* Historical no-op. */
-# define SA_NOMASK 0x00000020 /* Don't automatically block the signal when
+# define SA_NODEFER 0x00000020 /* Don't automatically block the signal when
its handler is being executed. */
-# define SA_ONESHOT 0x00000004 /* Reset to SIG_DFL on entry to handler. */
+# define SA_RESETHAND 0x00000004 /* Reset to SIG_DFL on entry to handler. */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x00000010 /* Historical no-op. */
/* Some aliases for the SA_ constants. */
-# define SA_NODEFER SA_NOMASK
-# define SA_RESETHAND SA_ONESHOT
+# define SA_NOMASK SA_NODEFER
+# define SA_ONESHOT SA_RESETHAND
# define SA_STACK SA_ONSTACK
#endif
@@ -80,3 +85,5 @@ struct sigaction
#define SIG_BLOCK 1 /* Block signals. */
#define SIG_UNBLOCK 2 /* Unblock signals. */
#define SIG_SETMASK 4 /* Set the set of blocked signals. */
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h b/sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h
index 43253f2c99..a9cfcf562b 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software 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,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/siginfo-arch.h b/sysdeps/unix/sysv/linux/sparc/bits/siginfo-arch.h
new file mode 100644
index 0000000000..9f79715ebe
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/bits/siginfo-arch.h
@@ -0,0 +1,12 @@
+/* Architecture-specific adjustments to siginfo_t. SPARC version. */
+#ifndef _BITS_SIGINFO_ARCH_H
+#define _BITS_SIGINFO_ARCH_H 1
+
+#define __SI_BAND_TYPE int
+
+#define __SI_SIGFAULT_ADDL \
+ int _si_trapno;
+
+#define si_trapno _sifields._sigfault._si_trapno
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/siginfo-consts-arch.h b/sysdeps/unix/sysv/linux/sparc/bits/siginfo-consts-arch.h
new file mode 100644
index 0000000000..721dc9cd43
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/bits/siginfo-consts-arch.h
@@ -0,0 +1,12 @@
+/* Architecture-specific additional siginfo constants. SPARC version. */
+#ifndef _BITS_SIGINFO_CONSTS_ARCH_H
+#define _BITS_SIGINFO_CONSTS_ARCH_H 1
+
+/* `si_code' values for SIGEMT signal. */
+enum
+{
+ EMT_TAGOVF = 1 /* Tag overflow. */
+#define EMT_TAGOVF EMT_TAGOVF
+};
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h b/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h
deleted file mode 100644
index 6908f36e5e..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h
+++ /dev/null
@@ -1,352 +0,0 @@
-/* siginfo_t, sigevent and constants. Linux/SPARC version.
- 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/>. */
-
-#if !defined _SIGNAL_H && !defined __need_siginfo_t \
- && !defined __need_sigevent_t
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-#if (!defined __have_sigval_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t \
- || defined __need_sigevent_t))
-# define __have_sigval_t 1
-
-/* Type for data associated with a signal. */
-typedef union sigval
- {
- int sival_int;
- void *sival_ptr;
- } sigval_t;
-#endif
-
-#if (!defined __have_siginfo_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t))
-# define __have_siginfo_t 1
-
-# define __SI_MAX_SIZE 128
-# if __WORDSIZE == 64
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-typedef struct
- {
- int si_signo; /* Signal number. */
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int si_code; /* Signal code. */
-
- union
- {
- int _pad[__SI_PAD_SIZE];
-
- /* kill(). */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- } _kill;
-
- /* POSIX.1b timers. */
- struct
- {
- int si_tid; /* Timer ID. */
- int si_overrun; /* Overrun count. */
- sigval_t si_sigval; /* Signal value. */
- } _timer;
-
- /* POSIX.1b signals. */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- sigval_t si_sigval; /* Signal value. */
- } _rt;
-
- /* SIGCHLD. */
- struct
- {
- __pid_t si_pid; /* Which child. */
- __uid_t si_uid; /* Real user ID of sending process. */
- int si_status; /* Exit value or signal. */
- __clock_t si_utime;
- __clock_t si_stime;
- } _sigchld;
-
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
- struct
- {
- void *si_addr; /* Faulting insn/memory ref. */
- int si_trapno;
- short int si_addr_lsb; /* Valid LSB of the reported address. */
- } _sigfault;
-
- /* SIGPOLL. */
- struct
- {
- int si_band; /* Band event for SIGPOLL. */
- int si_fd;
- } _sigpoll;
-
- /* SIGSYS. */
- struct
- {
- void *_call_addr; /* Calling user insn. */
- int _syscall; /* Triggering system call number. */
- unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
- } _sigsys;
- } _sifields;
- } siginfo_t;
-
-
-/* X/Open requires some more fields with fixed names. */
-# define si_pid _sifields._kill.si_pid
-# define si_uid _sifields._kill.si_uid
-# define si_timerid _sifields._timer.si_tid
-# define si_overrun _sifields._timer.si_overrun
-# define si_status _sifields._sigchld.si_status
-# define si_utime _sifields._sigchld.si_utime
-# define si_stime _sifields._sigchld.si_stime
-# define si_value _sifields._rt.si_sigval
-# define si_int _sifields._rt.si_sigval.sival_int
-# define si_ptr _sifields._rt.si_sigval.sival_ptr
-# define si_addr _sifields._sigfault.si_addr
-# define si_trapno _sifields._sigfault.si_trapno
-# define si_addr_lsb _sifields._sigfault.si_addr_lsb
-# define si_band _sifields._sigpoll.si_band
-# define si_fd _sifields._sigpoll.si_fd
-# define si_call_addr _sifields._sigsys._call_addr
-# define si_syscall _sifields._sigsys._syscall
-# define si_arch _sifields._sigsys._arch
-
-
-/* Values for `si_code'. Positive values are reserved for kernel-generated
- signals. */
-enum
-{
- SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
-# define SI_ASYNCNL SI_ASYNCNL
- SI_TKILL = -6, /* Sent by tkill. */
-# define SI_TKILL SI_TKILL
- SI_SIGIO, /* Sent by queued SIGIO. */
-# define SI_SIGIO SI_SIGIO
- SI_ASYNCIO, /* Sent by AIO completion. */
-# define SI_ASYNCIO SI_ASYNCIO
- SI_MESGQ, /* Sent by real time mesq state change. */
-# define SI_MESGQ SI_MESGQ
- SI_TIMER, /* Sent by timer expiration. */
-# define SI_TIMER SI_TIMER
- SI_QUEUE, /* Sent by sigqueue. */
-# define SI_QUEUE SI_QUEUE
- SI_USER, /* Sent by kill, sigsend. */
-# define SI_USER SI_USER
- SI_KERNEL = 0x80 /* Send by kernel. */
-#define SI_KERNEL SI_KERNEL
-};
-
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGILL signal. */
-enum
-{
- ILL_ILLOPC = 1, /* Illegal opcode. */
-# define ILL_ILLOPC ILL_ILLOPC
- ILL_ILLOPN, /* Illegal operand. */
-# define ILL_ILLOPN ILL_ILLOPN
- ILL_ILLADR, /* Illegal addressing mode. */
-# define ILL_ILLADR ILL_ILLADR
- ILL_ILLTRP, /* Illegal trap. */
-# define ILL_ILLTRP ILL_ILLTRP
- ILL_PRVOPC, /* Privileged opcode. */
-# define ILL_PRVOPC ILL_PRVOPC
- ILL_PRVREG, /* Privileged register. */
-# define ILL_PRVREG ILL_PRVREG
- ILL_COPROC, /* Coprocessor error. */
-# define ILL_COPROC ILL_COPROC
- ILL_BADSTK /* Internal stack error. */
-# define ILL_BADSTK ILL_BADSTK
-};
-
-/* `si_code' values for SIGFPE signal. */
-enum
-{
- FPE_INTDIV = 1, /* Integer divide by zero. */
-# define FPE_INTDIV FPE_INTDIV
- FPE_INTOVF, /* Integer overflow. */
-# define FPE_INTOVF FPE_INTOVF
- FPE_FLTDIV, /* Floating point divide by zero. */
-# define FPE_FLTDIV FPE_FLTDIV
- FPE_FLTOVF, /* Floating point overflow. */
-# define FPE_FLTOVF FPE_FLTOVF
- FPE_FLTUND, /* Floating point underflow. */
-# define FPE_FLTUND FPE_FLTUND
- FPE_FLTRES, /* Floating point inexact result. */
-# define FPE_FLTRES FPE_FLTRES
- FPE_FLTINV, /* Floating point invalid operation. */
-# define FPE_FLTINV FPE_FLTINV
- FPE_FLTSUB /* Subscript out of range. */
-# define FPE_FLTSUB FPE_FLTSUB
-};
-
-/* `si_code' values for SIGSEGV signal. */
-enum
-{
- SEGV_MAPERR = 1, /* Address not mapped to object. */
-# define SEGV_MAPERR SEGV_MAPERR
- SEGV_ACCERR /* Invalid permissions for mapped object. */
-# define SEGV_ACCERR SEGV_ACCERR
-};
-
-/* `si_code' values for SIGBUS signal. */
-enum
-{
- BUS_ADRALN = 1, /* Invalid address alignment. */
-# define BUS_ADRALN BUS_ADRALN
- BUS_ADRERR, /* Non-existant physical address. */
-# define BUS_ADRERR BUS_ADRERR
- BUS_OBJERR, /* Object specific hardware error. */
-# define BUS_OBJERR BUS_OBJERR
- BUS_MCEERR_AR, /* Hardware memory error: action required. */
-# define BUS_MCEERR_AR BUS_MCEERR_AR
- BUS_MCEERR_AO /* Hardware memory error: action optional. */
-# define BUS_MCEERR_AO BUS_MCEERR_AO
-};
-# endif
-
-# ifdef __USE_XOPEN_EXTENDED
-/* `si_code' values for SIGTRAP signal. */
-enum
-{
- TRAP_BRKPT = 1, /* Process breakpoint. */
-# define TRAP_BRKPT TRAP_BRKPT
- TRAP_TRACE /* Process trace trap. */
-# define TRAP_TRACE TRAP_TRACE
-};
-# endif
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGCHLD signal. */
-enum
-{
- CLD_EXITED = 1, /* Child has exited. */
-# define CLD_EXITED CLD_EXITED
- CLD_KILLED, /* Child was killed. */
-# define CLD_KILLED CLD_KILLED
- CLD_DUMPED, /* Child terminated abnormally. */
-# define CLD_DUMPED CLD_DUMPED
- CLD_TRAPPED, /* Traced child has trapped. */
-# define CLD_TRAPPED CLD_TRAPPED
- CLD_STOPPED, /* Child has stopped. */
-# define CLD_STOPPED CLD_STOPPED
- CLD_CONTINUED /* Stopped child has continued. */
-# define CLD_CONTINUED CLD_CONTINUED
-};
-
-/* `si_code' values for SIGPOLL signal. */
-enum
-{
- POLL_IN = 1, /* Data input available. */
-# define POLL_IN POLL_IN
- POLL_OUT, /* Output buffers available. */
-# define POLL_OUT POLL_OUT
- POLL_MSG, /* Input message available. */
-# define POLL_MSG POLL_MSG
- POLL_ERR, /* I/O error. */
-# define POLL_ERR POLL_ERR
- POLL_PRI, /* High priority input available. */
-# define POLL_PRI POLL_PRI
- POLL_HUP /* Device disconnected. */
-# define POLL_HUP POLL_HUP
-};
-# endif
-
-# if defined __USE_GNU
-/* `si_code' values for SIGEMT signal. */
-enum
-{
- EMT_TAGOVF = 1 /* Tag overflow. */
-# define EMT_TAGOVF EMT_TAGOVF
-};
-# endif
-
-# undef __need_siginfo_t
-#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
-
-
-#if (defined _SIGNAL_H || defined __need_sigevent_t) \
- && !defined __have_sigevent_t
-# define __have_sigevent_t 1
-
-/* Structure to transport application-defined values with signals. */
-# define __SIGEV_MAX_SIZE 64
-# if __WORDSIZE == 64
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-/* Forward declaration. */
-# ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-# endif
-
-typedef struct sigevent
- {
- sigval_t sigev_value;
- int sigev_signo;
- int sigev_notify;
-
- union
- {
- int _pad[__SIGEV_PAD_SIZE];
-
- /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
- thread to receive the signal. */
- __pid_t _tid;
-
- struct
- {
- void (*_function) (sigval_t); /* Function to start. */
- pthread_attr_t *_attribute; /* Thread attributes. */
- } _sigev_thread;
- } _sigev_un;
- } sigevent_t;
-
-/* POSIX names to access some of the members. */
-# define sigev_notify_function _sigev_un._sigev_thread._function
-# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
-
-/* `sigev_notify' values. */
-enum
-{
- SIGEV_SIGNAL = 0, /* Notify via signal. */
-# define SIGEV_SIGNAL SIGEV_SIGNAL
- SIGEV_NONE, /* Other notification: meaningless. */
-# define SIGEV_NONE SIGEV_NONE
- SIGEV_THREAD, /* Deliver via thread creation. */
-# define SIGEV_THREAD SIGEV_THREAD
-
- SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
-#define SIGEV_THREAD_ID SIGEV_THREAD_ID
-};
-
-#endif /* have _SIGNAL_H. */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/signalfd.h b/sysdeps/unix/sysv/linux/sparc/bits/signalfd.h
index 43e74a1b20..4eb20c808d 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/signalfd.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/signalfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/signum.h b/sysdeps/unix/sysv/linux/sparc/bits/signum.h
index 40cdd549be..32b87c323b 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/signum.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/signum.h
@@ -1,5 +1,5 @@
/* Signal number definitions. Linux/SPARC version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software 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,68 +16,24 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef _SIGNAL_H
+#ifndef _BITS_SIGNUM_H
+#define _BITS_SIGNUM_H 1
-/* Fake signal functions. */
-#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
-#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
-#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
-
-#ifdef __USE_UNIX98
-# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+#ifndef _SIGNAL_H
+#error "Never include <bits/signum.h> directly; use <signal.h> instead."
#endif
-/*
- * Linux/SPARC has different signal numbers that Linux/i386: I'm trying
- * to make it OSF/1 binary compatible, at least for normal binaries.
- */
-#define SIGHUP 1
-#define SIGINT 2
-#define SIGQUIT 3
-#define SIGILL 4
-#define SIGTRAP 5
-#define SIGABRT 6
-#define SIGIOT 6
-#define SIGEMT 7
-#define SIGFPE 8
-#define SIGKILL 9
-#define SIGBUS 10
-#define SIGSEGV 11
-#define SIGSYS 12
-#define SIGPIPE 13
-#define SIGALRM 14
-#define SIGTERM 15
-#define SIGURG 16
-
-/* SunOS values which deviate from the Linux/i386 ones */
-#define SIGSTOP 17
-#define SIGTSTP 18
-#define SIGCONT 19
-#define SIGCHLD 20
-#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
-#define SIGTTIN 21
-#define SIGTTOU 22
-#define SIGIO 23
-#define SIGPOLL SIGIO /* SysV name for SIGIO */
-#define SIGXCPU 24
-#define SIGXFSZ 25
-#define SIGVTALRM 26
-#define SIGPROF 27
-#define SIGWINCH 28
-#define SIGLOST 29
-#define SIGPWR SIGLOST
-#define SIGUSR1 30
-#define SIGUSR2 31
+#include <bits/signum-generic.h>
-#define _NSIG 65 /* Biggest signal number + 1
- (including real-time signals). */
+/* Adjustments and additions to the signal number constants for
+ Linux/SPARC systems. Signal values on this platform were chosen
+ for SunOS binary compatibility. */
-#define SIGRTMIN (__libc_current_sigrtmin ())
-#define SIGRTMAX (__libc_current_sigrtmax ())
+#define SIGEMT 7 /* Emulator trap. */
+#define SIGLOST 29 /* Resource lost (Sun); server died (GNU). */
+#define SIGPWR SIGLOST /* Power failure imminent (SysV). */
-/* These are the hard limits of the kernel. These values should not be
- used directly at user level. */
-#define __SIGRTMIN 32
-#define __SIGRTMAX (_NSIG - 1)
+#undef __SIGRTMAX
+#define __SIGRTMAX 64
#endif /* <signal.h> included. */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigstack.h b/sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
index 5b9c0c1be9..cb01b0938d 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
@@ -1,5 +1,5 @@
/* sigstack, sigaltstack definitions.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software 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,39 +16,17 @@
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
-
-/* Structure describing a signal stack (obsolete). */
-struct sigstack
- {
- void *ss_sp; /* Signal stack pointer. */
- int ss_onstack; /* Nonzero if executing on this stack. */
- };
-
-
-/* Possible values for `ss_flags.'. */
-enum
-{
- SS_ONSTACK = 1,
-#define SS_ONSTACK SS_ONSTACK
- SS_DISABLE
-#define SS_DISABLE SS_DISABLE
-};
-
/* Minimum stack size for a signal handler. */
#define MINSIGSTKSZ 4096
/* 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/socket_type.h b/sysdeps/unix/sysv/linux/sparc/bits/socket_type.h
index 18e32b9901..925caf83a1 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/socket_type.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/socket_type.h
@@ -1,5 +1,5 @@
/* Define enum __socket_type for Linux/SPARC.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/stat.h b/sysdeps/unix/sysv/linux/sparc/bits/stat.h
index 8240c63b6a..8c8f38c5c2 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h
index 65673aafdc..4489b6c2fd 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h
@@ -1,5 +1,5 @@
/* termios type and macro definitions. Linux/SPARC version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -181,7 +181,7 @@ struct termios
/* c_lflag bits */
#define ISIG 0x00000001
#define ICANON 0x00000002
-#if defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
# define XCASE 0x00000004
#endif
#define ECHO 0x00000008
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/timerfd.h b/sysdeps/unix/sysv/linux/sparc/bits/timerfd.h
index 11091ab06c..99274682f9 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/timerfd.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/timerfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
index f98dd83f93..b59f2ced75 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -69,6 +69,11 @@
/* Same for ino_t and ino64_t. */
# define __INO_T_MATCHES_INO64_T 1
+
+/* And for __rlim_t and __rlim64_t. */
+# define __RLIM_T_MATCHES_RLIM64_T 1
+#else
+# define __RLIM_T_MATCHES_RLIM64_T 0
#endif
/* Number of descriptors that can fit in an `fd_set'. */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
index 2d958d29e5..7562875ee2 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
@@ -2,19 +2,10 @@
#if defined __arch64__ || defined __sparcv9
# define __WORDSIZE 64
+# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
-#endif
-
-#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
-
-# if __WORDSIZE == 32
-/* Signal that in 32bit ABI we didn't used to have a `long double'.
- The changes all the `long double' function variants to be redirects
- to the double functions. */
-# define __LONG_DOUBLE_MATH_OPTIONAL 1
-# ifndef __LONG_DOUBLE_128__
-# define __NO_LONG_DOUBLE_MATH 1
-# endif
-# endif
+# define __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
+# define __WORDSIZE_TIME64_COMPAT32 0
#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/dl-cache.h b/sysdeps/unix/sysv/linux/sparc/dl-cache.h
index b94693140a..84ef02f42e 100644
--- a/sysdeps/unix/sysv/linux/sparc/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/sparc/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/getrlimit64.c b/sysdeps/unix/sysv/linux/sparc/getrlimit64.c
new file mode 100644
index 0000000000..b152b3b378
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/getrlimit64.c
@@ -0,0 +1,24 @@
+/* Linux getrlimit64 sparc32 implementation (64 bits rlim_t).
+ Copyright (C) 2016-2018 Free Software 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 <shlib-compat.h>
+
+#undef SHLIB_COMPAT
+#define SHLIB_COMPAT(a,b,c) 0
+
+#include <sysdeps/unix/sysv/linux/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/getshmlba.c b/sysdeps/unix/sysv/linux/sparc/getshmlba.c
index 3047d2d74a..7f34ed778e 100644
--- a/sysdeps/unix/sysv/linux/sparc/getshmlba.c
+++ b/sysdeps/unix/sysv/linux/sparc/getshmlba.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/getsysstats.c b/sysdeps/unix/sysv/linux/sparc/getsysstats.c
index 7fc1ec841f..a695e87a8c 100644
--- a/sysdeps/unix/sysv/linux/sparc/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/sparc/getsysstats.c
@@ -1,5 +1,5 @@
/* Determine various system internal values, Linux/Sparc version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@suse.de> and
Jakub Jelinek <jj@ultra.linux.cz>
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
index abcef75852..91990a716f 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number. SPARC version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,28 +20,42 @@
/* SPARC uses socketcall. */
#define __ASSUME_SOCKETCALL 1
-/* The accept4 syscall was added for SPARC in 2.6.28. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-#define __ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL 1
-
-/* The recvmmsg syscall was added for SPARC in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
-#define __ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL 1
-
-/* The sendmmsg syscall was added for SPARC in 3.0. */
-#if __LINUX_KERNEL_VERSION >= 0x030000
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
-#define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL 1
-
#include_next <kernel-features.h>
/* 32-bit SPARC kernels do not support
futex_atomic_cmpxchg_inatomic. */
#if !defined __arch64__ && !defined __sparc_v9__
-# undef __ASSUME_FUTEX_LOCK_PI
-# undef __ASSUME_REQUEUE_PI
# undef __ASSUME_SET_ROBUST_LIST
#endif
+
+#if !defined __arch64__
+# undef __ASSUME_ACCEPT_SYSCALL
+# undef __ASSUME_CONNECT_SYSCALL
+# undef __ASSUME_RECVFROM_SYSCALL
+#else
+/* sparc64 defines __NR_pause, however it is not supported (ENOSYS).
+ Undefine so pause.c can use a correct alternative. */
+# undef __NR_pause
+#endif
+
+/* sparc only supports ipc syscall. */
+#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+
+/* Support for the renameat2 syscall was added in 3.16. */
+#if __LINUX_KERNEL_VERSION < 0x031000
+# undef __ASSUME_RENAMEAT2
+#endif
+
+/* SPARC kernel Kconfig does not define CONFIG_CLONE_BACKWARDS, however it
+ has the same ABI as if it did, implemented by sparc-specific code
+ (sparc_do_fork).
+
+ It also has a unique return value convention:
+
+ Parent --> %o0 == child's pid, %o1 == 0
+ Child --> %o0 == parent's pid, %o1 == 1
+
+ Which required a special macro to correct issue the syscall
+ (INLINE_CLONE_SYSCALL). */
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h b/sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h
new file mode 100644
index 0000000000..bee7e9cd03
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h
@@ -0,0 +1,10 @@
+/* SPARC 'struct __new_sigaction' is similar to generic Linux UAPI with
+ a sa_restorer field, even though function is passed as an argument
+ to rt_sigaction syscall. */
+#define SA_RESTORER 0x04000000
+#include <sysdeps/unix/sysv/linux/kernel_sigaction.h>
+
+#define SET_SA_RESTORER(kact, act) \
+ (kact)->sa_restorer = NULL
+#define RESET_SA_RESTORER(act, kact) \
+ (act)->sa_restorer = (kact)->sa_restorer
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel_termios.h b/sysdeps/unix/sysv/linux/sparc/kernel_termios.h
index cb733a2129..31c717ea9d 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel_termios.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel_termios.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/lowlevellock.h b/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
index 263aece33f..e2c0b2abaa 100644
--- a/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -46,7 +46,6 @@ __lll_cond_trylock (int *futex)
extern void __lll_lock_wait_private (int *futex) attribute_hidden;
extern void __lll_lock_wait (int *futex, int private) attribute_hidden;
-extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
static inline void
__attribute__ ((always_inline))
@@ -64,18 +63,6 @@ __lll_lock (int *futex, int private)
}
#define lll_lock(futex, private) __lll_lock (&(futex), private)
-static inline int
-__attribute__ ((always_inline))
-__lll_robust_lock (int *futex, int id, int private)
-{
- int result = 0;
- if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
- result = __lll_robust_lock_wait (futex, private);
- return result;
-}
-#define lll_robust_lock(futex, id, private) \
- __lll_robust_lock (&(futex), id, private)
-
static inline void
__attribute__ ((always_inline))
__lll_cond_lock (int *futex, int private)
@@ -87,14 +74,9 @@ __lll_cond_lock (int *futex, int private)
}
#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
-#define lll_robust_cond_lock(futex, id, private) \
- __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private)
-
extern int __lll_timedlock_wait (int *futex, const struct timespec *,
int private) attribute_hidden;
-extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
- int private) attribute_hidden;
static inline int
__attribute__ ((always_inline))
@@ -110,19 +92,6 @@ __lll_timedlock (int *futex, const struct timespec *abstime, int private)
#define lll_timedlock(futex, abstime, private) \
__lll_timedlock (&(futex), abstime, private)
-static inline int
-__attribute__ ((always_inline))
-__lll_robust_timedlock (int *futex, const struct timespec *abstime,
- int id, int private)
-{
- int result = 0;
- if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
- result = __lll_robust_timedlock_wait (futex, abstime, private);
- return result;
-}
-#define lll_robust_timedlock(futex, abstime, id, private) \
- __lll_robust_timedlock (&(futex), abstime, id, private)
-
#define lll_unlock(lock, private) \
((void) ({ \
int *__futex = &(lock); \
@@ -132,15 +101,6 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
lll_futex_wake (__futex, 1, __private); \
}))
-#define lll_robust_unlock(lock, private) \
- ((void) ({ \
- int *__futex = &(lock); \
- int __private = (private); \
- int __val = atomic_exchange_rel (__futex, 0); \
- if (__glibc_unlikely (__val & FUTEX_WAITERS)) \
- lll_futex_wake (__futex, 1, __private); \
- }))
-
#define lll_islocked(futex) \
(futex != 0)
diff --git a/sysdeps/unix/sysv/linux/sparc/readelflib.c b/sysdeps/unix/sysv/linux/sparc/readelflib.c
index eb1093ce19..2af8608341 100644
--- a/sysdeps/unix/sysv/linux/sparc/readelflib.c
+++ b/sysdeps/unix/sysv/linux/sparc/readelflib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
Jakub Jelinek <jakub@redhat.com>, 1999.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S b/sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S
index 66255a4de3..d4bfef855b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/alphasort64.c b/sysdeps/unix/sysv/linux/sparc/sparc32/alphasort64.c
new file mode 100644
index 0000000000..39700869fc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/alphasort64.c
@@ -0,0 +1,3 @@
+/* Although sparc32 define _DIRENT_MATCHES_DIRENT64=0 and have compat
+ mode for 2.1, it does have a compat symbol for alphasort64. */
+#include <dirent/alphasort64.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h
new file mode 100644
index 0000000000..41595400f6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h
@@ -0,0 +1,26 @@
+/* Properties of long double type. SPARC version.
+ Copyright (C) 2016-2018 Free Software 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 published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <bits/wordsize.h>
+
+#if !defined __NO_LONG_DOUBLE_MATH && __WORDSIZE == 32
+# define __LONG_DOUBLE_MATH_OPTIONAL 1
+# ifndef __LONG_DOUBLE_128__
+# define __NO_LONG_DOUBLE_MATH 1
+# endif
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c b/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c
index da9bd8609d..f75f4c9dd7 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c
@@ -1,5 +1,5 @@
/* brk system call for Linux/SPARC.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza (miguel@nuclecu.unam.mx)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
index 6f41f0f55a..49028d544a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu).
@@ -24,9 +24,6 @@
#include <tcb-offsets.h>
#include <sysdep.h>
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
pid_t *ptid, void *tls, pid_t *ctid); */
@@ -49,7 +46,6 @@ ENTRY (__clone)
expects. */
sub %o1, 96, %o1
mov %i3, %g3
- mov %i2, %g4
/* ptid */
mov %i4,%o2
@@ -80,24 +76,14 @@ END(__clone)
.type __thread_start,@function
__thread_start:
- sethi %hi(CLONE_THREAD), %l0
- andcc %g4, %l0, %g0
- bne 1f
- andcc %g4, CLONE_VM, %g0
- bne,a 2f
- mov -1,%o0
- set __NR_getpid,%g1
- ta 0x10
-2:
- st %o0,[%g7 + PID]
- st %o0,[%g7 + TID]
-1:
mov %g0, %fp /* terminate backtrace */
call %g2
mov %g3,%o0
- call HIDDEN_JUMPTARGET(_exit),0
+ set __NR_exit, %g1
+ ta 0x10
nop
.size __thread_start, .-__thread_start
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/fcntl.c b/sysdeps/unix/sysv/linux/sparc/sparc32/fcntl.c
deleted file mode 100644
index ea951bc4f9..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/fcntl.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/getcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc32/getcontext.S
index 615a2c1909..0276478cab 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/getcontext.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2008.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/getdents64.c b/sysdeps/unix/sysv/linux/sparc/sparc32/getdents64.c
deleted file mode 100644
index 0c75fb5a06..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/getdents64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getdents64.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c b/sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c
deleted file mode 100644
index 82a9a296a7..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/glob64.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h
new file mode 100644
index 0000000000..388533f88a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 144
+#define SIGJMP_BUF_SIZE 144
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 12
+#define SAVED_MASK_OFFSET 16
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
index 5b894b83f9..a4416009f1 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
@@ -30,3 +30,6 @@ struct kernel_stat
#define _HAVE_STAT64___PAD2
#define _HAVE_STAT_NSEC
#define _HAVE_STAT64_NSEC
+
+#define XSTAT_IS_XSTAT64 0
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
index 3acaae2290..fd0b33f86d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
@@ -1,13 +1,8 @@
-GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
GLIBC_2.0 _r_debug D 0x14
GLIBC_2.0 calloc F
GLIBC_2.0 free F
GLIBC_2.0 malloc F
GLIBC_2.0 realloc F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_stack_end D 0x4
GLIBC_2.1 _dl_mcount F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libBrokenLocale.abilist
index 4a56bb68a3..54395f3c8d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index eb141132cd..d308ac8b05 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -1,4 +1,3 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
@@ -9,7 +8,6 @@ GLIBC_2.0 .rem F
GLIBC_2.0 .udiv F
GLIBC_2.0 .umul F
GLIBC_2.0 .urem F
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_adjust_column F
GLIBC_2.0 _IO_default_doallocate F
GLIBC_2.0 _IO_default_finish F
@@ -367,6 +365,7 @@ GLIBC_2.0 confstr F
GLIBC_2.0 connect F
GLIBC_2.0 copysign F
GLIBC_2.0 copysignf F
+GLIBC_2.0 copysignl F
GLIBC_2.0 creat F
GLIBC_2.0 create_module F
GLIBC_2.0 ctermid F
@@ -1315,7 +1314,6 @@ GLIBC_2.0 xdrstdio_create F
GLIBC_2.0 xencrypt F
GLIBC_2.0 xprt_register F
GLIBC_2.0 xprt_unregister F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 _IO_2_1_stderr_ D 0xa0
GLIBC_2.1 _IO_2_1_stdin_ D 0xa0
GLIBC_2.1 _IO_2_1_stdout_ D 0xa0
@@ -1615,7 +1613,6 @@ GLIBC_2.1 xdr_uint16_t F
GLIBC_2.1 xdr_uint32_t F
GLIBC_2.1 xdr_uint8_t F
GLIBC_2.1 xdr_unixcred F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 _Exit F
GLIBC_2.1.1 __mempcpy_small F
GLIBC_2.1.1 __stpcpy_small F
@@ -1645,7 +1642,6 @@ GLIBC_2.1.1 xdr_longlong_t F
GLIBC_2.1.1 xdr_u_hyper F
GLIBC_2.1.1 xdr_u_longlong_t F
GLIBC_2.1.1 xdr_uint64_t F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
GLIBC_2.1.2 getaliasbyname_r F
GLIBC_2.1.2 getaliasent_r F
@@ -1673,11 +1669,9 @@ GLIBC_2.1.2 getservbyport_r F
GLIBC_2.1.2 getservent_r F
GLIBC_2.1.2 getspent_r F
GLIBC_2.1.2 getspnam_r F
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 __cxa_atexit F
GLIBC_2.1.3 __cxa_finalize F
GLIBC_2.1.3 __sigsuspend F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -1703,7 +1697,6 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 fallocate64 F
@@ -1711,26 +1704,22 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x21c
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x21c
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -1739,7 +1728,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __getshmlba F
GLIBC_2.16 __poll_chk F
@@ -1755,16 +1743,13 @@ GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 sys_errlist D 0x220
GLIBC_2.16 sys_nerr D 0x4
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_adjust_wcolumn F
GLIBC_2.2 _IO_fgetpos F
GLIBC_2.2 _IO_fgetpos64 F
@@ -1936,33 +1921,81 @@ GLIBC_2.2 wcsftime F
GLIBC_2.2 wmempcpy F
GLIBC_2.2 wprintf F
GLIBC_2.2 wscanf F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf128 F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof128 F
+GLIBC_2.27 strtof128_l F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof128 F
+GLIBC_2.27 wcstof128_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2056,7 +2089,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2069,7 +2101,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x104
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2090,7 +2121,6 @@ GLIBC_2.3.3 sched_setaffinity F
GLIBC_2.3.3 semtimedop F
GLIBC_2.3.3 sys_sigabbrev D 0x104
GLIBC_2.3.3 sys_siglist D 0x104
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2120,7 +2150,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _IO_fprintf F
GLIBC_2.4 _IO_printf F
GLIBC_2.4 _IO_sprintf F
@@ -2374,7 +2403,6 @@ GLIBC_2.4 wcstold F
GLIBC_2.4 wcstold_l F
GLIBC_2.4 wprintf F
GLIBC_2.4 wscanf F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2392,7 +2420,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2400,7 +2427,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2439,7 +2465,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __nldbl___asprintf_chk F
@@ -2456,7 +2481,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libcrypt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libdl.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libdl.abilist
index 5536f6e0a9..7826fde951 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 dlopen F
GLIBC_2.1 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
index 185ab0917a..fd973676e2 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _LIB_VERSION D 0x4
GLIBC_2.0 acos F
GLIBC_2.0 acosf F
@@ -29,6 +28,7 @@ GLIBC_2.0 ceilf F
GLIBC_2.0 ceill F
GLIBC_2.0 copysign F
GLIBC_2.0 copysignf F
+GLIBC_2.0 copysignl F
GLIBC_2.0 cos F
GLIBC_2.0 cosf F
GLIBC_2.0 cosh F
@@ -52,6 +52,7 @@ GLIBC_2.0 expm1f F
GLIBC_2.0 expm1l F
GLIBC_2.0 fabs F
GLIBC_2.0 fabsf F
+GLIBC_2.0 fabsl F
GLIBC_2.0 finite F
GLIBC_2.0 finitef F
GLIBC_2.0 finitel F
@@ -137,6 +138,7 @@ GLIBC_2.0 sinhl F
GLIBC_2.0 sinl F
GLIBC_2.0 sqrt F
GLIBC_2.0 sqrtf F
+GLIBC_2.0 sqrtl F
GLIBC_2.0 tan F
GLIBC_2.0 tanf F
GLIBC_2.0 tanh F
@@ -152,7 +154,6 @@ GLIBC_2.0 y1l F
GLIBC_2.0 yn F
GLIBC_2.0 ynf F
GLIBC_2.0 ynl F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __clog10 F
GLIBC_2.1 __clog10f F
GLIBC_2.1 __clog10l F
@@ -253,6 +254,7 @@ GLIBC_2.1 fetestexcept F
GLIBC_2.1 feupdateenv F
GLIBC_2.1 fma F
GLIBC_2.1 fmaf F
+GLIBC_2.1 fmal F
GLIBC_2.1 fmax F
GLIBC_2.1 fmaxf F
GLIBC_2.1 fmaxl F
@@ -304,7 +306,6 @@ GLIBC_2.1 tgammal F
GLIBC_2.1 trunc F
GLIBC_2.1 truncf F
GLIBC_2.1 truncl F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -385,11 +386,9 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 feclearexcept F
GLIBC_2.2 fedisableexcept F
GLIBC_2.2 feenableexcept F
@@ -400,13 +399,647 @@ GLIBC_2.2 feraiseexcept F
GLIBC_2.2 fesetenv F
GLIBC_2.2 fesetexceptflag F
GLIBC_2.2 feupdateenv F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 __sqrtl_finite F
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl 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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf128 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf128 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf128 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f128 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf128 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf128 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf128 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf128 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf128 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef128 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf128 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf128 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf128 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf128 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf128 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf128 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf128 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf128 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf128 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf128 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf128 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f128 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf128 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf128 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf128 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf128 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf128 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf128 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf128 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf128 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf128 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf128 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf128 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf128 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf128 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf128 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff128 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f128 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f128 F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf128 F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f128 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf128 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf128 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf128 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf128 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf128 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf128 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf128 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf128 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf128 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf128 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf128 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf128 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf128 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf128 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf128 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f128 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f128 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf128 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf128 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf128 F
+GLIBC_2.27 lgammaf128_r F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf128 F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf128 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf128 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f128 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf128 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f128 F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf128 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf128 F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf128 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf128 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff128 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf128 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf128 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf128 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf128 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf128 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf128 F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf128 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof128 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf128 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf128 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf128 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf128 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf128 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf128 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf128 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf128 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf128 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf128 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf128 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf128 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf128 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf128 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf128 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf128 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf128 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf128 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf128 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f128 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f128 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf128 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 __nldbl_daddl F
+GLIBC_2.28 __nldbl_ddivl F
+GLIBC_2.28 __nldbl_dmull F
+GLIBC_2.28 __nldbl_dsubl F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libnsl.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libnsl.abilist
index a23db2aeaf..add3d66a7a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __free_fdresult F
GLIBC_2.1 __nis_default_access F
GLIBC_2.1 __nis_default_group F
@@ -120,5 +118,4 @@ GLIBC_2.1 readColdStartFile F
GLIBC_2.1 writeColdStartFile F
GLIBC_2.1 xdr_cback_data F
GLIBC_2.1 xdr_obj_p F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 xdr_ypall F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
index 7e121d45f8..b413007ccb 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 _IO_flockfile F
GLIBC_2.0 _IO_ftrylockfile F
GLIBC_2.0 _IO_funlockfile F
@@ -119,7 +118,6 @@ GLIBC_2.0 vfork F
GLIBC_2.0 wait F
GLIBC_2.0 waitpid F
GLIBC_2.0 write F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __libc_allocate_rtsig F
GLIBC_2.1 __libc_current_sigrtmax F
GLIBC_2.1 __libc_current_sigrtmin F
@@ -154,24 +152,18 @@ GLIBC_2.1 sem_init F
GLIBC_2.1 sem_post F
GLIBC_2.1 sem_trywait F
GLIBC_2.1 sem_wait F
-GLIBC_2.1.1 GLIBC_2.1.1 A
GLIBC_2.1.1 sem_close F
GLIBC_2.1.1 sem_open F
GLIBC_2.1.1 sem_unlink F
-GLIBC_2.1.2 GLIBC_2.1.2 A
GLIBC_2.1.2 __vfork F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __open64 F
GLIBC_2.2 __pread64 F
GLIBC_2.2 __pthread_rwlock_destroy F
@@ -212,18 +204,35 @@ GLIBC_2.2 pthread_yield F
GLIBC_2.2 pwrite F
GLIBC_2.2 pwrite64 F
GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -241,13 +250,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libresolv.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libresolv.abilist
index 4d50e7c8c6..157a33ce35 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
index 07056199bc..cb874f4147 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 aio_cancel F
GLIBC_2.1 aio_cancel64 F
GLIBC_2.1 aio_error F
@@ -16,7 +15,6 @@ GLIBC_2.1 aio_write F
GLIBC_2.1 aio_write64 F
GLIBC_2.1 lio_listio F
GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 clock_getcpuclockid F
GLIBC_2.2 clock_getres F
GLIBC_2.2 clock_gettime F
@@ -29,10 +27,8 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 aio_cancel F
GLIBC_2.3 aio_cancel64 F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -43,8 +39,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libthread_db.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist
index 89c67755c4..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data b/sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data
index a208adff31..1668f4017e 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data
@@ -3,6 +3,7 @@ libc.so: _Q_cmp ?
libc.so: _Q_div ?
libc.so: _Q_feq ?
libc.so: _Q_fge ?
+libc.so: _Q_fgt ?
libc.so: _Q_fle ?
libc.so: _Q_flt ?
libc.so: _Q_fne ?
@@ -16,11 +17,14 @@ libc.so: malloc
libc.so: memalign
libc.so: realloc
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
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c b/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c
index 3a9f70cc59..4bec31489a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2008.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S
index 32cb9ae0a4..1b0a5362dd 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, 1997.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h b/sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h
index 1c06b311f2..1e38cf0f5e 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Linux/SPARC version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c b/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c
deleted file mode 100644
index 2ea26dd409..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/readdir64.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c b/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c
deleted file mode 100644
index 9f54f897e3..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h b/sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h
index c4eb4ad5de..f6d9bb373e 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 1999.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/scandir64.c b/sysdeps/unix/sysv/linux/sparc/sparc32/scandir64.c
deleted file mode 100644
index 506fd8877c..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/scandir64.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/scandir64.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S
index 47d8c5bc82..283aef1b30 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2008.
@@ -95,6 +95,19 @@ END(__setcontext)
weak_alias (__setcontext, setcontext)
+/* We add an NOP here to separate between __setcontext/__startcontext. The
+ wanted behavior that happens is: when unwinding from a function called
+ inside a makecontext() context, FDE lookup will use '&__startcontext - 1',
+ then returns NULL for no FDE found, and immediately ends the unwind, in
+ a normal fashion.
+
+ If this NOP word does not exist, FDE lookup just repeatedly finds
+ __setcontext's FDE in an infinite loop, due to the convention of using
+ 'address - 1' for FDE lookup. Modifiying/deleting the below
+ __startcontext's FDE has no help on this. */
+
+ nop
+
/* This is the helper code which gets called if a function which is
registered with 'makecontext' returns. In this case we have to
install the context listed in the uc_link element of the context
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c
deleted file mode 100644
index 2e3a54c893..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setegid.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c
deleted file mode 100644
index 18e41d08c1..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/seteuid.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setgid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setgid.c
deleted file mode 100644
index 377021d9ec..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/setgid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setgid.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setgroups.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setgroups.c
deleted file mode 100644
index 0e7086278f..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/setgroups.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* We also have to rewrite the kernel gid_t to the user land type. */
-#include <sysdeps/unix/sysv/linux/i386/setgroups.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c
deleted file mode 100644
index 99c57ad20f..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setregid.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c
deleted file mode 100644
index daca1a4833..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setresgid.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c
deleted file mode 100644
index 3aeabe9ad7..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setresuid.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c
deleted file mode 100644
index 8ad61226e9..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setuid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setuid.c
deleted file mode 100644
index de394379be..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/setuid.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/setuid.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
index 5aa3c3516e..191f58729e 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
@@ -1,5 +1,5 @@
/* POSIX.1 sigaction call for Linux/SPARC.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza <miguel@nuclecu.unam.mx>, 1997.
@@ -27,45 +27,17 @@
static void __rt_sigreturn_stub (void);
static void __sigreturn_stub (void);
-int
-__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
-{
- struct kernel_sigaction kact, koact;
- unsigned long stub = 0;
- int ret;
-
- if (act)
- {
- kact.k_sa_handler = act->sa_handler;
- memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
- if (((kact.sa_flags = act->sa_flags) & SA_SIGINFO) != 0)
- stub = (unsigned long) &__rt_sigreturn_stub;
- else
- stub = (unsigned long) &__sigreturn_stub;
- stub -= 8;
- kact.sa_restorer = NULL;
- }
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- ret = INLINE_SYSCALL (rt_sigaction, 5, sig, act ? &kact : 0,
- oact ? &koact : 0, stub, _NSIG / 8);
-
- if (oact && ret >= 0)
- {
- oact->sa_handler = koact.k_sa_handler;
- memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
- oact->sa_flags = koact.sa_flags;
- oact->sa_restorer = koact.sa_restorer;
- }
- return ret;
-}
-libc_hidden_def (__libc_sigaction)
-
-#include <nptl/sigaction.c>
+#define STUB(act) \
+ (act) ? ((unsigned long)((act->sa_flags & SA_SIGINFO) \
+ ? &__rt_sigreturn_stub \
+ : &__sigreturn_stub) - 8) \
+ : 0,
+#include <sysdeps/unix/sysv/linux/sigaction.c>
-static void
+static
+inhibit_stack_protector
+void
__rt_sigreturn_stub (void)
{
__asm__ ("mov %0, %%g1\n\t"
@@ -74,7 +46,9 @@ __rt_sigreturn_stub (void)
: "i" (__NR_rt_sigreturn));
}
-static void
+static
+inhibit_stack_protector
+void
__sigreturn_stub (void)
{
__asm__ ("mov %0, %%g1\n\t"
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sigcontextinfo.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sigcontextinfo.h
index 21dd78bd3e..1c32abfbc2 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 1999.
@@ -17,15 +17,4 @@
<http://www.gnu.org/licenses/>. */
#define SIGCONTEXT struct sigcontext *
-#define SIGCONTEXT_EXTRA_ARGS
#define GET_PC(__ctx) ((void *) ((__ctx)->si_regs.pc))
-#define FIRST_FRAME_POINTER \
- ({ void *ret; \
- asm volatile ("ta 3; add %%fp, 56, %0" : "=r" (ret)); ret; })
-#define ADVANCE_STACK_FRAME(__next) \
- ((void *) (((unsigned *)(__next))+14))
-
-#define GET_STACK(__ctx) ((void *) (__ctx)->si_regs.u_regs[14])
-#define GET_FRAME(__ctx) ADVANCE_STACK_FRAME (GET_STACK(__ctx))
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/swapcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc32/swapcontext.S
index 80fcedab09..2e2e448954 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2008.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
index fbb86af486..9542282f7d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
index 6240cd3a52..0b6095ffab 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
@@ -4,8 +4,6 @@ chown - chown32 i:sii __chown chown
lchown - lchown32 i:sii __lchown lchown
fchown - fchown32 i:iii __fchown fchown
-setrlimit - setrlimit 2 __setrlimit setrlimit
-getrlimit - getrlimit 2 __getrlimit getrlimit
getegid - getegid32 Ei: __getegid getegid
geteuid - geteuid32 Ei: __geteuid geteuid
getgid - getgid32 Ei: __getgid getgid
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
deleted file mode 100644
index b106b0c86d..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
- .globl __syscall_error; \
-ENTRY(name) \
- ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
- cmp %g1, 0; \
- bne 1f; \
-.type __##syscall_name##_nocancel,@function; \
-.globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x10; \
- bcc 8f; \
- mov %o7, %g1; \
- call __syscall_error; \
- mov %g1, %o7; \
-8: jmpl %o7 + 8, %g0; \
- nop; \
-.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
-1: save %sp, -96, %sp; \
- cfi_def_cfa_register(%fp); \
- cfi_window_save; \
- cfi_register(%o7, %i7); \
- CENABLE; \
- nop; \
- mov %o0, %l0; \
- COPY_ARGS_##args \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x10; \
- bcc 1f; \
- mov %o0, %l1; \
- CDISABLE; \
- mov %l0, %o0; \
- call __syscall_error; \
- mov %l1, %o0; \
- b 2f; \
- mov -1, %l1; \
-1: CDISABLE; \
- mov %l0, %o0; \
-2: jmpl %i7 + 8, %g0; \
- restore %g0, %l1, %o0;
-
-
-# if IS_IN (libpthread)
-# define CENABLE call __pthread_enable_asynccancel
-# define CDISABLE call __pthread_disable_asynccancel
-# elif IS_IN (libc)
-# define CENABLE call __libc_enable_asynccancel
-# define CDISABLE call __libc_disable_asynccancel
-# elif IS_IN (librt)
-# define CENABLE call __librt_enable_asynccancel
-# define CDISABLE call __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-#define COPY_ARGS_0 /* Nothing */
-#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
-#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
-#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
-#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
-#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
-#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index b3c3384fca..09bfd805fc 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/ucontext_i.sym b/sysdeps/unix/sysv/linux/sparc/sparc32/ucontext_i.sym
index 544030ce8b..8a7cb5ab84 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/ucontext_i.sym
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/ucontext_i.sym
@@ -16,7 +16,6 @@ MC_GREGS offsetof (mcontext_t, gregs)
MC_GWINS offsetof (mcontext_t, gwins)
MC_FPREGS offsetof (mcontext_t, fpregs)
MC_XRS offsetof (mcontext_t, xrs)
-MC_FILLER offsetof (mcontext_t, filler)
GREG_PSR (REG_PSR * sizeof(greg_t))
GREG_PC (REG_PC * sizeof(greg_t))
GREG_NPC (REG_nPC * sizeof(greg_t))
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/versionsort64.c b/sysdeps/unix/sysv/linux/sparc/sparc32/versionsort64.c
new file mode 100644
index 0000000000..b195442ce1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/versionsort64.c
@@ -0,0 +1,3 @@
+/* Although sparc32 define _DIRENT_MATCHES_DIRENT64=0 and have compat
+ mode for 2.1, it does have a compat symbol for alphasort64. */
+#include <dirent/versionsort64.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
index dc32e0af67..f34c95ad07 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
@@ -21,29 +21,21 @@
.text
.globl __syscall_error
-ENTRY(__vfork)
- ld [%g7 + PID], %o5
- cmp %o5, 0
- bne 1f
- sub %g0, %o5, %o4
- sethi %hi(0x80000000), %o4
-1: st %o4, [%g7 + PID]
-
+ENTRY(__libc_vfork)
LOADSYSCALL(vfork)
ta 0x10
bcc 2f
mov %o7, %g1
- st %o5, [%g7 + PID]
call __syscall_error
mov %g1, %o7
2: sub %o1, 1, %o1
andcc %o0, %o1, %o0
- bne,a 1f
- st %o5, [%g7 + PID]
1: retl
nop
-END(__vfork)
+END(__libc_vfork)
+#if IS_IN (libc)
+weak_alias (__libc_vfork, vfork)
+strong_alias (__libc_vfork, __vfork)
libc_hidden_def (__vfork)
-weak_alias (__vfork, vfork)
-strong_alias (__vfork, __libc_vfork)
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile b/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
index 7ea433f21f..715af3df7b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
@@ -7,8 +7,3 @@ LD += -melf64_sparc
ifeq ($(subdir),stdlib)
sysdep_routines += __start_context
endif
-
-ifeq ($(subdir),nptl)
-CFLAGS-pause.c += -fexceptions
-CFLAGS-sigsuspend.c += -fexceptions
-endif
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/sparc/sparc64/____longjmp_chk.S
index 1132eda7a3..50b5d0543c 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/__start_context.S b/sysdeps/unix/sysv/linux/sparc/sparc64/__start_context.S
index d7542a6c2e..3f1e3f64da 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/__start_context.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/__start_context.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h
new file mode 100644
index 0000000000..41595400f6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h
@@ -0,0 +1,26 @@
+/* Properties of long double type. SPARC version.
+ Copyright (C) 2016-2018 Free Software 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 published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <bits/wordsize.h>
+
+#if !defined __NO_LONG_DOUBLE_MATH && __WORDSIZE == 32
+# define __LONG_DOUBLE_MATH_OPTIONAL 1
+# ifndef __LONG_DOUBLE_128__
+# define __NO_LONG_DOUBLE_MATH 1
+# endif
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
index 9efdb2a925..d8f8115758 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
index e2d3914358..81812c689f 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu).
@@ -24,9 +24,6 @@
#include <tcb-offsets.h>
#include <sysdep.h>
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
pid_t *ptid, void *tls, pid_t *ctid); */
@@ -52,7 +49,6 @@ ENTRY (__clone)
expects. Also, subtract STACK_BIAS. */
sub %i1, 192 + 0x7ff, %o1
mov %i3, %g3
- mov %i2, %g4
mov %i4,%o2 /* PTID */
mov %i5,%o3 /* TLS */
@@ -77,23 +73,14 @@ END(__clone)
.type __thread_start,@function
__thread_start:
- sethi %hi(CLONE_THREAD), %l0
- andcc %g4, %l0, %g0
- bne,pt %icc, 1f
- andcc %g4, CLONE_VM, %g0
- bne,a,pn %icc, 2f
- mov -1,%o0
- set __NR_getpid,%g1
- ta 0x6d
-2: st %o0,[%g7 + PID]
- st %o0,[%g7 + TID]
-1:
mov %g0, %fp /* terminate backtrace */
call %g2
mov %g3,%o0
- call HIDDEN_JUMPTARGET(_exit),0
+ set __NR_exit, %g1
+ ta 0x6d
nop
.size __thread_start, .-__thread_start
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/configure b/sysdeps/unix/sysv/linux/sparc/sparc64/configure
index 8f88eff4a3..4b92a40bd2 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/configure
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/configure
@@ -4,8 +4,8 @@
test -n "$libc_cv_slibdir" ||
case "$prefix" in
/usr | /usr/)
- libc_cv_slibdir=/lib64
- libc_cv_rtlddir=/lib64
+ libc_cv_slibdir='/lib64'
+ libc_cv_rtlddir='/lib64'
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
# Locale data can be shared between 32-bit and 64-bit libraries.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/dl-cache.h b/sysdeps/unix/sysv/linux/sparc/sparc64/dl-cache.h
index 0711f387d1..ce605a50d1 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c b/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c
index 10420ae70e..6838a77a76 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c
@@ -1,5 +1,5 @@
/* Get frequency of the system processor. sparc64 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,6 @@
#include <stdlib.h>
#include <inttypes.h>
#include <sys/ioctl.h>
-#include <libc-internal.h>
#include <asm/openpromio.h>
static hp_timing_t
@@ -91,12 +90,12 @@ __get_clockfreq_via_proc_openprom (void)
if (obp_fd != -1)
{
unsigned long int buf[4096 / sizeof (unsigned long int)];
- struct dirent *dirp = (struct dirent *) buf;
+ struct dirent64 *dirp = (struct dirent64 *) buf;
ssize_t len;
- while ((len = __getdents (obp_fd, (char *) dirp, sizeof (buf))) > 0)
+ while ((len = __getdents64 (obp_fd, (char *) dirp, sizeof (buf))) > 0)
{
- struct dirent *this_dirp = dirp;
+ struct dirent64 *this_dirp = dirp;
while (len > 0)
{
@@ -141,7 +140,7 @@ __get_clockfreq_via_proc_openprom (void)
break;
len -= this_dirp->d_reclen;
- this_dirp = (struct dirent *)
+ this_dirp = (struct dirent64 *)
((char *) this_dirp + this_dirp->d_reclen);
}
if (result != 0)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S
index 02a22bfe66..e186fe350f 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu).
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h
new file mode 100644
index 0000000000..9d7ad3e8a6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h
@@ -0,0 +1,41 @@
+/* Old SysV permission definition for Linux. x86_64 version.
+ Copyright (C) 2016-2018 Free Software 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/ipc.h> /* For __key_t */
+
+#define __IPC_64 0x0
+
+struct __old_ipc_perm
+{
+ __key_t __key; /* Key. */
+ unsigned int uid; /* Owner's user ID. */
+ unsigned int gid; /* Owner's group ID. */
+ unsigned int cuid; /* Creator's user ID. */
+ unsigned int cgid; /* Creator's group ID. */
+ unsigned int mode; /* Read/write permission. */
+ unsigned short int __seq; /* Sequence number. */
+};
+
+/* SPARC semctl multiplex syscall expects the union pointed address, not
+ the union address itself. */
+#define SEMCTL_ARG_ADDRESS(__arg) __arg.array
+
+/* Also for msgrcv it does not use the kludge on final 2 arguments. */
+#define MSGRCV_ARGS(__msgp, __msgtyp) __msgp, __msgtyp
+
+#include <ipc_ops.h>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h
new file mode 100644
index 0000000000..e86afd7b3d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 640
+#define SIGJMP_BUF_SIZE 640
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 496
+#define SAVED_MASK_OFFSET 504
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
index 2a26a78d9c..30afb553b9 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
@@ -45,3 +45,4 @@ struct kernel_stat64
};
#define XSTAT_IS_XSTAT64 1
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
index 9041ccbe60..82042472c3 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.2 GLIBC_2.2 A
-GLIBC_2.2 __libc_memalign F
GLIBC_2.2 __libc_stack_end D 0x8
GLIBC_2.2 _dl_mcount F
GLIBC_2.2 _r_debug D 0x28
@@ -7,6 +5,4 @@ GLIBC_2.2 calloc F
GLIBC_2.2 free F
GLIBC_2.2 malloc F
GLIBC_2.2 realloc F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libBrokenLocale.abilist
index 21343df781..0e4d814909 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libanl.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libanl.abilist
index edabfb436e..d9a5ed015d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 gai_cancel F
GLIBC_2.2.3 gai_error F
GLIBC_2.2.3 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 91b97ef1c8..6731ebfc28 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -1,9 +1,7 @@
-GCC_3.0 GCC_3.0 A
GCC_3.0 _Unwind_Find_FDE F
GCC_3.0 __deregister_frame_info_bases F
GCC_3.0 __register_frame_info_bases F
GCC_3.0 __register_frame_info_table_bases F
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -30,33 +28,28 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x438
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x438
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 name_to_handle_at F
GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -65,7 +58,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __getshmlba F
GLIBC_2.16 __poll_chk F
@@ -81,16 +73,13 @@ GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 sys_errlist D 0x440
GLIBC_2.16 sys_nerr D 0x4
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _Exit F
GLIBC_2.2 _IO_2_1_stderr_ D 0xe0
GLIBC_2.2 _IO_2_1_stdin_ D 0xe0
@@ -1873,34 +1862,81 @@ GLIBC_2.2 xdrstdio_create F
GLIBC_2.2 xencrypt F
GLIBC_2.2 xprt_register F
GLIBC_2.2 xprt_unregister F
-GLIBC_2.2.1 GLIBC_2.2.1 A
GLIBC_2.2.1 pivot_root F
GLIBC_2.2.1 posix_openpt F
-GLIBC_2.2.2 GLIBC_2.2.2 A
GLIBC_2.2.2 __nss_hostname_digits_dots F
GLIBC_2.2.2 wordexp F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 __rpc_thread_createerr F
GLIBC_2.2.3 __rpc_thread_svc_fdset F
GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
GLIBC_2.2.3 __rpc_thread_svc_pollfd F
GLIBC_2.2.3 fnmatch F
GLIBC_2.2.3 sprofil F
-GLIBC_2.2.4 GLIBC_2.2.4 A
GLIBC_2.2.4 dl_iterate_phdr F
GLIBC_2.2.4 getgrouplist F
GLIBC_2.2.4 sockatmark F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf128 F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof128 F
+GLIBC_2.27 strtof128_l F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof128 F
+GLIBC_2.27 wcstof128_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -1992,7 +2028,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -2005,7 +2040,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x208
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -2026,7 +2060,6 @@ GLIBC_2.3.3 strtoll_l F
GLIBC_2.3.3 strtoull_l F
GLIBC_2.3.3 sys_sigabbrev D 0x208
GLIBC_2.3.3 sys_siglist D 0x208
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2056,7 +2089,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2133,7 +2165,6 @@ GLIBC_2.4 sys_errlist D 0x430
GLIBC_2.4 sys_nerr D 0x4
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2151,7 +2182,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2159,7 +2189,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2186,7 +2215,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2197,7 +2225,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libcrypt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libcrypt.abilist
index 4db2639336..cd6ba95280 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 crypt F
GLIBC_2.0 crypt_r F
GLIBC_2.0 encrypt F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libdl.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libdl.abilist
index 5536f6e0a9..7826fde951 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libdl.abilist
@@ -1,14 +1,10 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 dladdr F
GLIBC_2.0 dlclose F
GLIBC_2.0 dlerror F
GLIBC_2.0 dlopen F
GLIBC_2.0 dlsym F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 dlopen F
GLIBC_2.1 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
index b56add357b..470e64f4ef 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -80,11 +79,9 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _LIB_VERSION D 0x4
GLIBC_2.2 __clog10 F
GLIBC_2.2 __clog10f F
@@ -399,9 +396,639 @@ GLIBC_2.2 y1l F
GLIBC_2.2 yn F
GLIBC_2.2 ynf F
GLIBC_2.2 ynl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl 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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.27 acosf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf128 F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf128 F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf128 F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f128 F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf128 F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf128 F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf128 F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf128 F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf128 F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef128 F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf128 F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf128 F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf128 F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf128 F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf128 F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf128 F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf128 F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf128 F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf128 F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf128 F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf128 F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f128 F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf128 F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf128 F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf128 F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf128 F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf128 F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf128 F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf128 F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf128 F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf128 F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf128 F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf128 F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf128 F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf128 F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf128 F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff128 F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f128 F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f128 F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf128 F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f128 F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf128 F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf128 F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf128 F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf128 F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf128 F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf128 F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf128 F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf128 F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf128 F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf128 F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf128 F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf128 F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf128 F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf128 F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf128 F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f128 F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f128 F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf128 F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf128 F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf128 F
+GLIBC_2.27 lgammaf128_r F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf128 F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf128 F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf128 F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f128 F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf128 F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f128 F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf128 F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf128 F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf128 F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf128 F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff128 F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf128 F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf128 F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf128 F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf128 F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf128 F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf128 F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf128 F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof128 F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf128 F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf128 F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf128 F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf128 F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf128 F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf128 F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf128 F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf128 F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf128 F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf128 F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf128 F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf128 F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf128 F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf128 F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf128 F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf128 F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf128 F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf128 F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf128 F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f128 F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f128 F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf128 F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libnsl.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libnsl.abilist
index a23db2aeaf..add3d66a7a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __yp_check F
GLIBC_2.0 xdr_domainname F
GLIBC_2.0 xdr_keydat F
@@ -42,7 +41,6 @@ GLIBC_2.0 yp_update F
GLIBC_2.0 ypbinderr_string F
GLIBC_2.0 yperr_string F
GLIBC_2.0 ypprot_err F
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 __free_fdresult F
GLIBC_2.1 __nis_default_access F
GLIBC_2.1 __nis_default_group F
@@ -120,5 +118,4 @@ GLIBC_2.1 readColdStartFile F
GLIBC_2.1 writeColdStartFile F
GLIBC_2.1 xdr_cback_data F
GLIBC_2.1 xdr_obj_p F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 xdr_ypall F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
index d4c8dedd6c..ccc9449826 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
@@ -1,15 +1,11 @@
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 _IO_flockfile F
GLIBC_2.2 _IO_ftrylockfile F
GLIBC_2.2 _IO_funlockfile F
@@ -200,18 +196,35 @@ GLIBC_2.2 vfork F
GLIBC_2.2 wait F
GLIBC_2.2 waitpid F
GLIBC_2.2 write F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 pthread_getattr_np F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -229,13 +242,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libresolv.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libresolv.abilist
index 2d92a35e81..06f995151c 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 __b64_ntop F
GLIBC_2.0 __b64_pton F
GLIBC_2.0 __dn_comp F
@@ -57,7 +56,6 @@ GLIBC_2.0 res_querydomain F
GLIBC_2.0 res_search F
GLIBC_2.0 res_send_setqhook F
GLIBC_2.0 res_send_setrhook F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 __dn_expand F
GLIBC_2.2 __res_hostalias F
GLIBC_2.2 __res_mkquery F
@@ -69,9 +67,7 @@ GLIBC_2.2 __res_nsend F
GLIBC_2.2 __res_query F
GLIBC_2.2 __res_querydomain F
GLIBC_2.2 __res_search F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
index 8699f6ccc4..d7a049cf60 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1 GLIBC_2.1 A
GLIBC_2.1 aio_cancel F
GLIBC_2.1 aio_cancel64 F
GLIBC_2.1 aio_error F
@@ -16,7 +15,6 @@ GLIBC_2.1 aio_write F
GLIBC_2.1 aio_write64 F
GLIBC_2.1 lio_listio F
GLIBC_2.1 lio_listio64 F
-GLIBC_2.2 GLIBC_2.2 A
GLIBC_2.2 clock_getcpuclockid F
GLIBC_2.2 clock_getres F
GLIBC_2.2 clock_gettime F
@@ -29,16 +27,13 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 aio_cancel F
GLIBC_2.3 aio_cancel64 F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 timer_create F
GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -49,8 +44,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libthread_db.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libthread_db.abilist
index a8a8c2c68d..2db0992737 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.1.3 GLIBC_2.1.3 A
GLIBC_2.1.3 td_init F
GLIBC_2.1.3 td_log F
GLIBC_2.1.3 td_ta_clear_event F
@@ -36,9 +35,6 @@ GLIBC_2.1.3 td_thr_setxregs F
GLIBC_2.1.3 td_thr_sigsetmask F
GLIBC_2.1.3 td_thr_tsd F
GLIBC_2.1.3 td_thr_validate F
-GLIBC_2.2.3 GLIBC_2.2.3 A
GLIBC_2.2.3 td_symbol_list F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist
index 89c67755c4..aa2d35b323 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.0 GLIBC_2.0 A
GLIBC_2.0 forkpty F
GLIBC_2.0 login F
GLIBC_2.0 login_tty F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data b/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data
index 633cfe4493..b881b9096d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data
@@ -1,4 +1,5 @@
libc.so: _Qp_add ?
+libc.so: _Qp_cmp ?
libc.so: _Qp_div ?
libc.so: _Qp_feq ?
libc.so: _Qp_fge ?
@@ -17,11 +18,14 @@ libc.so: malloc
libc.so: memalign
libc.so: realloc
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
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc
ld.so: calloc
ld.so: realloc
ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S
index 37511ffd9e..5937396fc7 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu).
@@ -45,7 +45,6 @@ END(__libc_siglongjmp)
strong_alias(__libc_siglongjmp, __longjmp)
strong_alias(__libc_siglongjmp, __libc_longjmp)
-libc_hidden_def (__libc_longjmp)
weak_alias (__libc_siglongjmp, longjmp)
weak_alias (__libc_siglongjmp, _longjmp)
weak_alias (__libc_siglongjmp, siglongjmp)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c b/sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c
index 89c5343175..3f02c9361b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <ucontext.h>
-extern void __start_context (struct ucontext *ucp);
+extern void __start_context (ucontext_t *ucp);
void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c b/sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c
deleted file mode 100644
index ccaa4eeddb..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2010-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/msg.h>
-#include <ipc_priv.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp,
- int msgflg)
-{
- return SYSCALL_CANCEL (ipc, IPCOP_msgrcv, msqid, msgsz, msgflg,
- msgp, msgtyp);
-}
-weak_alias (__libc_msgrcv, msgrcv)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pause.c b/sysdeps/unix/sysv/linux/sparc/sparc64/pause.c
deleted file mode 100644
index e399e7c7eb..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/pause.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-#include <sysdep-cancel.h>
-
-#define __sigprocmask(how, set, oset) \
- INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8)
-
-#include <sysdeps/posix/pause.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S
index 48493330a0..a6e530d4fc 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, 1997.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h b/sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h
index ccef57d029..6cf82147dc 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Linux/Sparc64 version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h b/sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h
index 6cfe4f3696..b05897751d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c b/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c
deleted file mode 100644
index a9ae4c6076..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <stdarg.h>
-#include <sys/sem.h>
-#include <ipc_priv.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Define a `union semun' suitable for Linux here. */
-union semun
-{
- int val; /* value for SETVAL */
- struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
- unsigned short int *array; /* array for GETALL & SETALL */
- struct seminfo *__buf; /* buffer for IPC_INFO */
-};
-
-/* Return identifier for array of NSEMS semaphores associated with
- KEY. */
-
-int
-semctl (int semid, int semnum, int cmd, ...)
-{
- union semun arg;
- va_list ap;
-
- va_start (ap, cmd);
-
- /* Get the argument. */
- arg = va_arg (ap, union semun);
-
- va_end (ap);
-
- return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- arg.array);
-}
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
index f7d30c7e30..02ed090b11 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu).
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S
index 1be32d917a..bd01ba379c 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu).
@@ -61,6 +61,7 @@ __sigsetjmp_local:
mov %g1, %o0
END(__sigsetjmp)
+hidden_def (__sigsetjmp)
weak_extern(_setjmp)
weak_extern(setjmp)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
index 50c444c72d..cfbbc6e7b4 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
@@ -1,5 +1,5 @@
/* POSIX.1 sigaction call for Linux/SPARC64.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza <miguel@nuclecu.unam.mx> and
Jakub Jelinek <jj@ultra.linux.cz>.
@@ -21,52 +21,17 @@
#include <string.h>
#include <syscall.h>
#include <sysdep.h>
-#include <sys/signal.h>
-#include <errno.h>
-
-#include <kernel_sigaction.h>
-
-/* SPARC 64bit userland requires a kernel that has rt signals anyway. */
static void __rt_sigreturn_stub (void);
-int
-__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
-{
- int ret;
- struct kernel_sigaction kact, koact;
- unsigned long stub = ((unsigned long) &__rt_sigreturn_stub) - 8;
-
- if (act)
- {
- kact.k_sa_handler = act->sa_handler;
- memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
- kact.sa_flags = act->sa_flags;
- kact.sa_restorer = NULL;
- }
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- ret = INLINE_SYSCALL (rt_sigaction, 5, sig,
- act ? &kact : 0,
- oact ? &koact : 0, stub, _NSIG / 8);
-
- if (oact && ret >= 0)
- {
- oact->sa_handler = koact.k_sa_handler;
- memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
- oact->sa_flags = koact.sa_flags;
- oact->sa_restorer = koact.sa_restorer;
- }
-
- return ret;
-}
-libc_hidden_def (__libc_sigaction)
-
-#include <nptl/sigaction.c>
+#define STUB(act) \
+ (((unsigned long) &__rt_sigreturn_stub) - 8),
+#include <sysdeps/unix/sysv/linux/sigaction.c>
-static void
+static
+inhibit_stack_protector
+void
__rt_sigreturn_stub (void)
{
__asm__ ("mov %0, %%g1\n\t"
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigcontextinfo.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sigcontextinfo.h
index ab2233d911..32066eb3a3 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -20,12 +20,4 @@
#define STACK_BIAS 2047
#endif
#define SIGCONTEXT struct sigcontext *
-#define SIGCONTEXT_EXTRA_ARGS
#define GET_PC(__ctx) ((void *) ((__ctx)->sigc_regs.tpc))
-#define ADVANCE_STACK_FRAME(__next) \
- ((void *) (((unsigned long *) (((unsigned long int) (__next)) \
- + STACK_BIAS))+14))
-#define GET_STACK(__ctx) ((void *) ((__ctx)->sigc_regs.u_regs[14]))
-#define GET_FRAME(__ctx) ADVANCE_STACK_FRAME (GET_STACK (__ctx))
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
deleted file mode 100644
index 0deaafccd5..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* 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 <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Change the set of blocked signals to SET,
- wait until a signal arrives, and restore the set of blocked signals. */
-int
-sigpending (sigset_t *set)
-{
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
-}
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
index 5732db4169..a31f831417 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,4 +30,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
real size of the user-level sigset_t. */
return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
+libc_hidden_def (__sigprocmask)
weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sizes.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sizes.h
index bc0aad6e22..888859d86a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sizes.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sizes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/swapcontext.c b/sysdeps/unix/sysv/linux/sparc/sparc64/swapcontext.c
index 6e5ecc8fa7..d2eaef4cf8 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/swapcontext.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/swapcontext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S b/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
index 4e530b8b56..e358a8bff0 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
index 3d1c1daac9..33082f31eb 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
@@ -1,20 +1,10 @@
# File name Caller Syscall name # args Strong name Weak names
-# Override select.S in parent directory:
-select - select C:5 __select select
-accept - accept C:3 __libc_accept __accept accept
bind - bind 3 __bind bind
-connect - connect C:3 __libc_connect __connect connect
getpeername - getpeername 3 __getpeername getpeername
getsockname - getsockname 3 __getsockname getsockname
getsockopt - getsockopt 5 __getsockopt getsockopt
listen - listen 2 __listen listen
-recv - recv C:4 __libc_recv __recv recv
-recvfrom - recvfrom C:6 __libc_recvfrom __recvfrom recvfrom
-recvmsg - recvmsg C:3 __libc_recvmsg __recvmsg recvmsg
-send - send C:4 __libc_send __send send
-sendmsg - sendmsg C:3 __libc_sendmsg __sendmsg sendmsg
-sendto - sendto C:6 __libc_sendto __sendto sendto
setsockopt - setsockopt 5 __setsockopt setsockopt
shutdown - shutdown 2 __shutdown shutdown
socketpair - socketpair 4 __socketpair socketpair
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
deleted file mode 100644
index 919682d7b5..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
- .globl __syscall_error; \
-ENTRY(name) \
- ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
- brnz,pn %g1, 1f; \
-.type __##syscall_name##_nocancel,@function; \
-.globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x6d; \
- bcc,pt %xcc, 8f; \
- mov %o7, %g1; \
- call __syscall_error; \
- mov %g1, %o7; \
-8: jmpl %o7 + 8, %g0; \
- nop; \
-.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
-1: save %sp, -192, %sp; \
- cfi_def_cfa_register(%fp); \
- cfi_window_save; \
- cfi_register(%o7, %i7); \
- CENABLE; \
- nop; \
- mov %o0, %l0; \
- COPY_ARGS_##args \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x6d; \
- bcc,pt %xcc, 1f; \
- mov %o0, %l1; \
- CDISABLE; \
- mov %l0, %o0; \
- call __syscall_error; \
- mov %l1, %o0; \
- ba,pt %xcc, 2f; \
- mov -1, %l1; \
-1: CDISABLE; \
- mov %l0, %o0; \
-2: jmpl %i7 + 8, %g0; \
- restore %g0, %l1, %o0;
-
-# if IS_IN (libpthread)
-# define CENABLE call __pthread_enable_asynccancel
-# define CDISABLE call __pthread_disable_asynccancel
-# elif IS_IN (libc)
-# define CENABLE call __libc_enable_asynccancel
-# define CDISABLE call __libc_disable_asynccancel
-# elif IS_IN (librt)
-# define CENABLE call __librt_enable_asynccancel
-# define CDISABLE call __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-#define COPY_ARGS_0 /* Nothing */
-#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
-#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
-#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
-#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
-#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
-#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
index 5d11799e34..0fb2e427f8 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ucontext_i.h b/sysdeps/unix/sysv/linux/sparc/sparc64/ucontext_i.h
index 80180a4da8..7d1276aa00 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/ucontext_i.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ucontext_i.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
index 05be3c2809..eb1db699fe 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
@@ -21,29 +21,21 @@
.text
.globl __syscall_error
-ENTRY(__vfork)
- ld [%g7 + PID], %o5
- sethi %hi(0x80000000), %o3
- cmp %o5, 0
- sub %g0, %o5, %o4
- move %icc, %o3, %o4
- st %o4, [%g7 + PID]
-
+ENTRY(__libc_vfork)
LOADSYSCALL(vfork)
ta 0x6d
bcc,pt %xcc, 2f
mov %o7, %g1
- st %o5, [%g7 + PID]
call __syscall_error
mov %g1, %o7
2: sub %o1, 1, %o1
andcc %o0, %o1, %o0
- bne,a,pt %icc, 1f
- st %o5, [%g7 + PID]
1: retl
nop
-END(__vfork)
+END(__libc_vfork)
+#if IS_IN (libc)
+weak_alias (__libc_vfork, vfork)
+strong_alias (__libc_vfork, __vfork)
libc_hidden_def (__vfork)
-weak_alias (__vfork, vfork)
-strong_alias (__vfork, __libc_vfork)
+#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c b/sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c
index 9d3ae12196..142d30cd64 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/xstatconv.c b/sysdeps/unix/sysv/linux/sparc/sparc64/xstatconv.c
index 2c127721b2..76b9296f05 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/xstatconv.c
@@ -1,5 +1,5 @@
/* Convert between the kernel's `struct stat' format, and libc's.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/procfs.h b/sysdeps/unix/sysv/linux/sparc/sys/procfs.h
index 7dae67dcf9..38ce6792ff 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
index 4b8815275e..c037734666 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Linux/SPARC version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -78,8 +78,7 @@ enum __ptrace_request
PTRACE_KILL = 8,
#define PT_KILL PTRACE_KILL
- /* Single step the process.
- This is not supported on all machines. */
+ /* Single step the process. */
PTRACE_SINGLESTEP = 9,
#define PT_STEP PTRACE_SINGLESTEP
@@ -146,7 +145,7 @@ enum __ptrace_request
#endif
- /* Continue and stop at the next (return from) syscall. */
+ /* Continue and stop at the next entry to or return from syscall. */
PTRACE_SYSCALL = 24,
#define PTRACE_SYSCALL PTRACE_SYSCALL
@@ -201,78 +200,29 @@ enum __ptrace_request
PTRACE_LISTEN = 0x4208,
#define PTRACE_LISTEN PTRACE_LISTEN
+ /* Retrieve siginfo_t structures without removing signals from a queue. */
PTRACE_PEEKSIGINFO = 0x4209,
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+ /* Get the mask of blocked signals. */
PTRACE_GETSIGMASK = 0x420a,
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
+ /* Change the mask of blocked signals. */
PTRACE_SETSIGMASK = 0x420b,
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
- PTRACE_SECCOMP_GET_FILTER = 0x420c
+ /* Get seccomp BPF filters. */
+ PTRACE_SECCOMP_GET_FILTER = 0x420c,
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
-};
-
-
-/* Flag for PTRACE_LISTEN. */
-enum __ptrace_flags
-{
- PTRACE_SEIZE_DEVEL = 0x80000000
-};
-
-/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions
-{
- PTRACE_O_TRACESYSGOOD = 0x00000001,
- PTRACE_O_TRACEFORK = 0x00000002,
- PTRACE_O_TRACEVFORK = 0x00000004,
- PTRACE_O_TRACECLONE = 0x00000008,
- PTRACE_O_TRACEEXEC = 0x00000010,
- PTRACE_O_TRACEVFORKDONE = 0x00000020,
- PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_EXITKILL = 0x00100000,
- PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
- PTRACE_O_MASK = 0x003000ff
-};
-
-/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes
-{
- PTRACE_EVENT_FORK = 1,
- PTRACE_EVENT_VFORK = 2,
- PTRACE_EVENT_CLONE = 3,
- PTRACE_EVENT_EXEC = 4,
- PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6,
- PTRACE_EVENT_SECCOMP = 7
-};
-/* Arguments for PTRACE_PEEKSIGINFO. */
-struct __ptrace_peeksiginfo_args
-{
- __uint64_t off; /* From which siginfo to start. */
- __uint32_t flags; /* Flags for peeksiginfo. */
- __int32_t nr; /* How many siginfos to take. */
-};
-
-enum __ptrace_peeksiginfo_flags
-{
- /* Read signals from a shared (process wide) queue. */
- PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
+ /* Get seccomp BPF filter metadata. */
+ PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
};
-/* Perform process tracing functions. REQUEST is one of the values
- above, and determines the action to be taken.
- For all requests except PTRACE_TRACEME, PID specifies the process to be
- traced.
- PID and the other arguments described above for the various requests should
- appear (those that are used for the particular request) as:
- pid_t PID, void *ADDR, int DATA, void *ADDR2
- after REQUEST. */
-extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+#include <bits/ptrace-shared.h>
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h b/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
index d7bf2aedb9..adab2d9715 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,71 +19,85 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
#include <bits/wordsize.h>
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
#if __WORDSIZE == 64
-#define MC_TSTATE 0
-#define MC_PC 1
-#define MC_NPC 2
-#define MC_Y 3
-#define MC_G1 4
-#define MC_G2 5
-#define MC_G3 6
-#define MC_G4 7
-#define MC_G5 8
-#define MC_G6 9
-#define MC_G7 10
-#define MC_O0 11
-#define MC_O1 12
-#define MC_O2 13
-#define MC_O3 14
-#define MC_O4 15
-#define MC_O5 16
-#define MC_O6 17
-#define MC_O7 18
-#define MC_NGREG 19
+#define __MC_NGREG 19
+#ifdef __USE_MISC
+# define MC_TSTATE 0
+# define MC_PC 1
+# define MC_NPC 2
+# define MC_Y 3
+# define MC_G1 4
+# define MC_G2 5
+# define MC_G3 6
+# define MC_G4 7
+# define MC_G5 8
+# define MC_G6 9
+# define MC_G7 10
+# define MC_O0 11
+# define MC_O1 12
+# define MC_O2 13
+# define MC_O3 14
+# define MC_O4 15
+# define MC_O5 16
+# define MC_O6 17
+# define MC_O7 18
+# define MC_NGREG __MC_NGREG
+#endif
typedef unsigned long mc_greg_t;
-typedef mc_greg_t mc_gregset_t[MC_NGREG];
-
-#define MC_MAXFPQ 16
-struct mc_fq {
- unsigned long *mcfq_addr;
- unsigned int mcfq_insn;
+typedef mc_greg_t mc_gregset_t[__MC_NGREG];
+
+#ifdef __USE_MISC
+# define MC_MAXFPQ 16
+#endif
+struct __mc_fq {
+ unsigned long *__ctx(mcfq_addr);
+ unsigned int __ctx(mcfq_insn);
};
-struct mc_fpu {
+typedef struct {
union {
- unsigned int sregs[32];
- unsigned long dregs[32];
- long double qregs[16];
- } mcfpu_fregs;
- unsigned long mcfpu_fsr;
- unsigned long mcfpu_fprs;
- unsigned long mcfpu_gsr;
- struct mc_fq *mcfpu_fq;
- unsigned char mcfpu_qcnt;
- unsigned char mcfpu_qentsz;
- unsigned char mcfpu_enab;
-};
-typedef struct mc_fpu mc_fpu_t;
+ unsigned int __ctx(sregs)[32];
+ unsigned long __ctx(dregs)[32];
+ long double __ctx(qregs)[16];
+ } __ctx(mcfpu_fregs);
+ unsigned long __ctx(mcfpu_fsr);
+ unsigned long __ctx(mcfpu_fprs);
+ unsigned long __ctx(mcfpu_gsr);
+ struct __mc_fq *__ctx(mcfpu_fq);
+ unsigned char __ctx(mcfpu_qcnt);
+ unsigned char __ctx(mcfpu_qentsz);
+ unsigned char __ctx(mcfpu_enab);
+} mc_fpu_t;
typedef struct {
- mc_gregset_t mc_gregs;
- mc_greg_t mc_fp;
- mc_greg_t mc_i7;
- mc_fpu_t mc_fpregs;
+ mc_gregset_t __ctx(mc_gregs);
+ mc_greg_t __ctx(mc_fp);
+ mc_greg_t __ctx(mc_i7);
+ mc_fpu_t __ctx(mc_fpregs);
} mcontext_t;
-typedef struct ucontext {
- struct ucontext *uc_link;
- unsigned long uc_flags;
+typedef struct ucontext_t {
+ struct ucontext_t *uc_link;
+ unsigned long __ctx(uc_flags);
unsigned long __uc_sigmask;
mcontext_t uc_mcontext;
stack_t uc_stack;
- __sigset_t uc_sigmask;
+ sigset_t uc_sigmask;
} ucontext_t;
#endif /* __WORDISIZE == 64 */
@@ -92,25 +106,27 @@ typedef struct ucontext {
* Location of the users' stored registers relative to R0.
* Usage is as an index into a gregset_t array or as u.u_ar0[XX].
*/
-#define REG_PSR (0)
-#define REG_PC (1)
-#define REG_nPC (2)
-#define REG_Y (3)
-#define REG_G1 (4)
-#define REG_G2 (5)
-#define REG_G3 (6)
-#define REG_G4 (7)
-#define REG_G5 (8)
-#define REG_G6 (9)
-#define REG_G7 (10)
-#define REG_O0 (11)
-#define REG_O1 (12)
-#define REG_O2 (13)
-#define REG_O3 (14)
-#define REG_O4 (15)
-#define REG_O5 (16)
-#define REG_O6 (17)
-#define REG_O7 (18)
+#ifdef __USE_MISC
+# define REG_PSR (0)
+# define REG_PC (1)
+# define REG_nPC (2)
+# define REG_Y (3)
+# define REG_G1 (4)
+# define REG_G2 (5)
+# define REG_G3 (6)
+# define REG_G4 (7)
+# define REG_G5 (8)
+# define REG_G6 (9)
+# define REG_G7 (10)
+# define REG_O0 (11)
+# define REG_O1 (12)
+# define REG_O2 (13)
+# define REG_O3 (14)
+# define REG_O4 (15)
+# define REG_O5 (16)
+# define REG_O6 (17)
+# define REG_O7 (18)
+#endif
/*
* A gregset_t is defined as an array type for compatibility with the reference
@@ -123,20 +139,26 @@ typedef struct ucontext {
#if __WORDSIZE == 64
-#define REG_ASI (19)
-#define REG_FPRS (20)
+# define __NGREG 21
+# ifdef __USE_MISC
+# define REG_ASI (19)
+# define REG_FPRS (20)
-#define NGREG 21
+# define NGREG __NGREG
+# endif
typedef long greg_t;
#else /* __WORDSIZE == 32 */
-#define NGREG 19
+# define __NGREG 19
+# ifdef __USE_MISC
+# define NGREG __NGREG
+# endif
typedef int greg_t;
#endif /* __WORDSIZE == 32 */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
/*
* The following structures define how a register window can appear on the
@@ -145,28 +167,35 @@ typedef greg_t gregset_t[NGREG];
* maximum number of outstanding regiters window defined in the SPARC
* architecture (*not* implementation).
*/
-#define SPARC_MAXREGWINDOW 31 /* max windows in SPARC arch. */
-struct rwindow
+# define __SPARC_MAXREGWINDOW 31 /* max windows in SPARC arch. */
+#ifdef __USE_MISC
+# define SPARC_MAXREGWINDOW __SPARC_MAXREGWINDOW
+#endif
+struct __rwindow
{
- greg_t rw_local[8]; /* locals */
- greg_t rw_in[8]; /* ins */
+ greg_t __ctx(rw_local)[8]; /* locals */
+ greg_t __ctx(rw_in)[8]; /* ins */
};
-#define rw_fp rw_in[6] /* frame pointer */
-#define rw_rtn rw_in[7] /* return address */
+#ifdef __USE_MISC
+# define rw_fp __ctx(rw_in)[6] /* frame pointer */
+# define rw_rtn __ctx(rw_in)[7] /* return address */
+#endif
-typedef struct gwindows
+typedef struct
{
- int wbcnt;
- int *spbuf[SPARC_MAXREGWINDOW];
- struct rwindow wbuf[SPARC_MAXREGWINDOW];
+ int __ctx(wbcnt);
+ int *__ctx(spbuf)[__SPARC_MAXREGWINDOW];
+ struct __rwindow __ctx(wbuf)[__SPARC_MAXREGWINDOW];
} gwindows_t;
/*
* Floating point definitions.
*/
-#define MAXFPQ 16 /* max # of fpu queue entries currently supported */
+#ifdef __USE_MISC
+# define MAXFPQ 16 /* max # of fpu queue entries currently supported */
+#endif
/*
* struct fq defines the minimal format of a floating point instruction queue
@@ -175,56 +204,58 @@ typedef struct gwindows
* conformant system implementation. Any additional fields provided by an
* implementation should not be used applications designed to be ABI conformant. */
-struct fpq
+struct __fpq
{
- unsigned long *fpq_addr; /* address */
- unsigned long fpq_instr; /* instruction */
+ unsigned long *__ctx(fpq_addr); /* address */
+ unsigned long __ctx(fpq_instr); /* instruction */
};
-struct fq
+struct __fq
{
union /* FPU inst/addr queue */
{
- double whole;
- struct fpq fpq;
- } FQu;
+ double __ctx(whole);
+ struct __fpq __ctx(fpq);
+ } __ctx(FQu);
};
-#define FPU_REGS_TYPE unsigned
-#define FPU_DREGS_TYPE unsigned long long
-#define V7_FPU_FSR_TYPE unsigned
-#define V9_FPU_FSR_TYPE unsigned long long
-#define V9_FPU_FPRS_TYPE unsigned
+#ifdef __USE_MISC
+# define FPU_REGS_TYPE unsigned
+# define FPU_DREGS_TYPE unsigned long long
+# define V7_FPU_FSR_TYPE unsigned
+# define V9_FPU_FSR_TYPE unsigned long long
+# define V9_FPU_FPRS_TYPE unsigned
+#endif
#if __WORDSIZE == 64
-typedef struct fpu
+typedef struct
{
union { /* FPU floating point regs */
- unsigned fpu_regs[32]; /* 32 singles */
- double fpu_dregs[32]; /* 32 doubles */
- long double fpu_qregs[16]; /* 16 quads */
- } fpu_fr;
- struct fq *fpu_q; /* ptr to array of FQ entries */
- unsigned long fpu_fsr; /* FPU status register */
- unsigned char fpu_qcnt; /* # of entries in saved FQ */
- unsigned char fpu_q_entrysize; /* # of bytes per FQ entry */
- unsigned char fpu_en; /* flag signifying fpu in use */
+ unsigned __ctx(fpu_regs)[32]; /* 32 singles */
+ double __ctx(fpu_dregs)[32]; /* 32 doubles */
+ long double __ctx(fpu_qregs)[16]; /* 16 quads */
+ } __ctx(fpu_fr);
+ struct __fq *__ctx(fpu_q); /* ptr to array of FQ entries */
+ unsigned long __ctx(fpu_fsr); /* FPU status register */
+ unsigned char __ctx(fpu_qcnt); /* # of entries in saved FQ */
+ unsigned char __ctx(fpu_q_entrysize); /* # of bytes per FQ entry */
+ unsigned char __ctx(fpu_en); /* flag signifying fpu in use */
} fpregset_t;
#else /* __WORDSIZE == 32 */
-typedef struct fpu
+typedef struct
{
union { /* FPU floating point regs */
- __extension__ unsigned long long fpu_regs[32]; /* 32 singles */
- double fpu_dregs[16]; /* 16 doubles */
- } fpu_fr;
- struct fq *fpu_q; /* ptr to array of FQ entries */
- unsigned fpu_fsr; /* FPU status register */
- unsigned char fpu_qcnt; /* # of entries in saved FQ */
- unsigned char fpu_q_entrysize; /* # of bytes per FQ entry */
- unsigned char fpu_en; /* flag signifying fpu in use */
+ __extension__ unsigned long long __ctx(fpu_regs)[32]; /* 32 singles */
+ double __ctx(fpu_dregs)[16]; /* 16 doubles */
+ } __ctx(fpu_fr);
+ struct __fq *__ctx(fpu_q); /* ptr to array of FQ entries */
+ unsigned __ctx(fpu_fsr); /* FPU status register */
+ unsigned char __ctx(fpu_qcnt); /* # of entries in saved FQ */
+ unsigned char __ctx(fpu_q_entrysize); /* # of bytes per FQ entry */
+ unsigned char __ctx(fpu_en); /* flag signifying fpu in use */
} fpregset_t;
/*
@@ -239,28 +270,32 @@ typedef struct fpu
*/
typedef struct
{
- unsigned int xrs_id; /* indicates xrs_ptr validity */
- void * xrs_ptr; /* ptr to extra reg state */
+ unsigned int __ctx(xrs_id); /* indicates xrs_ptr validity */
+ void * __ctx(xrs_ptr); /* ptr to extra reg state */
} xrs_t;
-#define XRS_ID 0x78727300 /* the string "xrs" */
+#ifdef __USE_MISC
+# define XRS_ID 0x78727300 /* the string "xrs" */
+#endif
typedef struct
{
- gregset_t gregs; /* general register set */
- gwindows_t *gwins; /* POSSIBLE pointer to register windows */
- fpregset_t fpregs; /* floating point register set */
- xrs_t xrs; /* POSSIBLE extra register state association */
- long filler[19];
+ gregset_t __ctx(gregs); /* general register set */
+ gwindows_t *__ctx(gwins); /* POSSIBLE pointer to register
+ windows */
+ fpregset_t __ctx(fpregs); /* floating point register set */
+ xrs_t __ctx(xrs); /* POSSIBLE extra register state
+ association */
+ long __glibc_reserved1[19];
} mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long uc_flags;
- struct ucontext *uc_link;
- __sigset_t uc_sigmask;
+ unsigned long __ctx(uc_flags);
+ struct ucontext_t *uc_link;
+ sigset_t uc_sigmask;
stack_t uc_stack;
mcontext_t uc_mcontext;
} ucontext_t;
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/user.h b/sysdeps/unix/sysv/linux/sparc/sys/user.h
index fddf87227b..48278bf883 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/user.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/sparc/syscalls.list b/sysdeps/unix/sysv/linux/sparc/syscalls.list
deleted file mode 100644
index 4f821e9b01..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/syscalls.list
+++ /dev/null
@@ -1,3 +0,0 @@
-# File name Caller Syscall name # args Strong name Weak names
-
-waitpid - waitpid Ci:ipi __waitpid waitpid
diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sysdep.h
index cb197b6dae..fd06a4349e 100644
--- a/sysdeps/unix/sysv/linux/sparc/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
diff --git a/sysdeps/unix/sysv/linux/sparc/system.c b/sysdeps/unix/sysv/linux/sparc/system.c
index c822eb732a..1f65c83399 100644
--- a/sysdeps/unix/sysv/linux/sparc/system.c
+++ b/sysdeps/unix/sysv/linux/sparc/system.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
new file mode 100644
index 0000000000..cf0213ece5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/spawni.c
@@ -0,0 +1,411 @@
+/* POSIX spawn interface. Linux version.
+ Copyright (C) 2016-2018 Free Software 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 <spawn.h>
+#include <fcntl.h>
+#include <paths.h>
+#include <string.h>
+#include <sys/resource.h>
+#include <sys/wait.h>
+#include <sys/param.h>
+#include <sys/mman.h>
+#include <not-cancel.h>
+#include <local-setxid.h>
+#include <shlib-compat.h>
+#include <nptl/pthreadP.h>
+#include <dl-sysdep.h>
+#include <libc-pointer-arith.h>
+#include <ldsodefs.h>
+#include "spawn_int.h"
+
+/* The Linux implementation of posix_spawn{p} uses the clone syscall directly
+ with CLONE_VM and CLONE_VFORK flags and an allocated stack. The new stack
+ and start function solves most the vfork limitation (possible parent
+ clobber due stack spilling). The remaining issue are:
+
+ 1. That no signal handlers must run in child context, to avoid corrupting
+ parent's state.
+ 2. The parent must ensure child's stack freeing.
+ 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 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
+ an error after the fork() was successful. Since no new wait status
+ was wanted there is no way to signal an error using one of the
+ available methods. The committee chose to signal an error by a
+ normal program exit with the exit code 127. */
+#define SPAWN_ERROR 127
+
+#ifdef __ia64__
+# define CLONE(__fn, __stackbase, __stacksize, __flags, __args) \
+ __clone2 (__fn, __stackbase, __stacksize, __flags, __args, 0, 0, 0)
+#else
+# define CLONE(__fn, __stack, __stacksize, __flags, __args) \
+ __clone (__fn, __stack, __flags, __args)
+#endif
+
+/* Since ia64 wants the stackbase w/clone2, re-use the grows-up macro. */
+#if _STACK_GROWS_UP || defined (__ia64__)
+# define STACK(__stack, __stack_size) (__stack)
+#elif _STACK_GROWS_DOWN
+# define STACK(__stack, __stack_size) (__stack + __stack_size)
+#endif
+
+
+struct posix_spawn_args
+{
+ sigset_t oldmask;
+ const char *file;
+ int (*exec) (const char *, char *const *, char *const *);
+ const posix_spawn_file_actions_t *fa;
+ const posix_spawnattr_t *restrict attr;
+ char *const *argv;
+ ptrdiff_t argc;
+ char *const *envp;
+ int xflags;
+ int err;
+};
+
+/* Older version requires that shell script without shebang definition
+ to be called explicitly using /bin/sh (_PATH_BSHELL). */
+static void
+maybe_script_execute (struct posix_spawn_args *args)
+{
+ if (SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_15)
+ && (args->xflags & SPAWN_XFLAGS_TRY_SHELL) && errno == ENOEXEC)
+ {
+ char *const *argv = args->argv;
+ ptrdiff_t argc = args->argc;
+
+ /* Construct an argument list for the shell. */
+ char *new_argv[argc + 1];
+ new_argv[0] = (char *) _PATH_BSHELL;
+ new_argv[1] = (char *) args->file;
+ if (argc > 1)
+ memcpy (new_argv + 2, argv + 1, argc * sizeof(char *));
+ else
+ new_argv[2] = NULL;
+
+ /* Execute the shell. */
+ args->exec (new_argv[0], new_argv, args->envp);
+ }
+}
+
+/* Function used in the clone call to setup the signals mask, posix_spawn
+ attributes, and file actions. It run on its own stack (provided by the
+ posix_spawn call). */
+static int
+__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;
+
+ /* 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
+ possibly be more optimized (by tracking which signal potentially have a
+ signal handler), it might requires system specific solutions (since the
+ sigset_t data type can be very different on different architectures). */
+ struct sigaction sa;
+ memset (&sa, '\0', sizeof (sa));
+
+ sigset_t hset;
+ __sigprocmask (SIG_BLOCK, 0, &hset);
+ for (int sig = 1; sig < _NSIG; ++sig)
+ {
+ if ((attr->__flags & POSIX_SPAWN_SETSIGDEF)
+ && sigismember (&attr->__sd, sig))
+ {
+ sa.sa_handler = SIG_DFL;
+ }
+ else if (sigismember (&hset, sig))
+ {
+ if (__is_internal_signal (sig))
+ sa.sa_handler = SIG_IGN;
+ else
+ {
+ __libc_sigaction (sig, 0, &sa);
+ if (sa.sa_handler == SIG_IGN)
+ continue;
+ sa.sa_handler = SIG_DFL;
+ }
+ }
+ else
+ continue;
+
+ __libc_sigaction (sig, &sa, 0);
+ }
+
+#ifdef _POSIX_PRIORITY_SCHEDULING
+ /* Set the scheduling algorithm and parameters. */
+ if ((attr->__flags & (POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER))
+ == POSIX_SPAWN_SETSCHEDPARAM)
+ {
+ if (__sched_setparam (0, &attr->__sp) == -1)
+ goto fail;
+ }
+ else if ((attr->__flags & POSIX_SPAWN_SETSCHEDULER) != 0)
+ {
+ if (__sched_setscheduler (0, attr->__policy, &attr->__sp) == -1)
+ goto fail;
+ }
+#endif
+
+ if ((attr->__flags & POSIX_SPAWN_SETSID) != 0
+ && __setsid () < 0)
+ goto fail;
+
+ /* Set the process group ID. */
+ if ((attr->__flags & POSIX_SPAWN_SETPGROUP) != 0
+ && __setpgid (0, attr->__pgrp) != 0)
+ goto fail;
+
+ /* Set the effective user and group IDs. */
+ if ((attr->__flags & POSIX_SPAWN_RESETIDS) != 0
+ && (local_seteuid (__getuid ()) != 0
+ || local_setegid (__getgid ()) != 0))
+ goto fail;
+
+ /* Execute the file actions. */
+ if (file_actions != 0)
+ {
+ int cnt;
+ struct rlimit64 fdlimit;
+ bool have_fdlimit = false;
+
+ for (cnt = 0; cnt < file_actions->__used; ++cnt)
+ {
+ struct __spawn_action *action = &file_actions->__actions[cnt];
+
+ switch (action->tag)
+ {
+ case spawn_do_close:
+ if (__close_nocancel (action->action.close_action.fd) != 0)
+ {
+ if (!have_fdlimit)
+ {
+ __getrlimit64 (RLIMIT_NOFILE, &fdlimit);
+ have_fdlimit = true;
+ }
+
+ /* Signal errors only for file descriptors out of range. */
+ if (action->action.close_action.fd < 0
+ || action->action.close_action.fd >= fdlimit.rlim_cur)
+ goto fail;
+ }
+ break;
+
+ 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_nocancel (action->action.open_action.fd);
+
+ int ret = __open_nocancel (action->action.open_action.path,
+ action->action.
+ open_action.oflag | O_LARGEFILE,
+ action->action.open_action.mode);
+
+ if (ret == -1)
+ goto fail;
+
+ int new_fd = ret;
+
+ /* Make sure the desired file descriptor is used. */
+ if (ret != action->action.open_action.fd)
+ {
+ if (__dup2 (new_fd, action->action.open_action.fd)
+ != action->action.open_action.fd)
+ goto fail;
+
+ if (__close_nocancel (new_fd) != 0)
+ goto fail;
+ }
+ }
+ break;
+
+ case spawn_do_dup2:
+ if (__dup2 (action->action.dup2_action.fd,
+ action->action.dup2_action.newfd)
+ != action->action.dup2_action.newfd)
+ goto fail;
+ break;
+ }
+ }
+ }
+
+ /* Set the initial signal mask of the child if POSIX_SPAWN_SETSIGMASK
+ is set, otherwise restore the previous one. */
+ __sigprocmask (SIG_SETMASK, (attr->__flags & POSIX_SPAWN_SETSIGMASK)
+ ? &attr->__ss : &args->oldmask, 0);
+
+ args->exec (args->file, args->argv, args->envp);
+
+ /* This is compatibility function required to enable posix_spawn run
+ script without shebang definition for older posix_spawn versions
+ (2.15). */
+ maybe_script_execute (args);
+
+fail:
+ /* 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);
+}
+
+/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
+ Before running the process perform the actions described in FILE-ACTIONS. */
+static int
+__spawnix (pid_t * pid, const char *file,
+ const posix_spawn_file_actions_t * file_actions,
+ const posix_spawnattr_t * attrp, char *const argv[],
+ char *const envp[], int xflags,
+ int (*exec) (const char *, char *const *, char *const *))
+{
+ pid_t new_pid;
+ struct posix_spawn_args args;
+ int ec;
+
+ /* 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. */
+ ptrdiff_t argc = 0;
+ /* Linux allows at most max (0x7FFFFFFF, 1/4 stack size) arguments
+ to be used in a execve call. We limit to INT_MAX minus one due the
+ compatiblity code that may execute a shell script (maybe_script_execute)
+ where it will construct another argument list with an additional
+ argument. */
+ ptrdiff_t limit = INT_MAX - 1;
+ while (argv[argc++] != NULL)
+ if (argc == limit)
+ {
+ errno = E2BIG;
+ return errno;
+ }
+
+ int prot = (PROT_READ | PROT_WRITE
+ | ((GL (dl_stack_flags) & PF_X) ? PROT_EXEC : 0));
+
+ /* Add a slack area for child's stack. */
+ size_t argv_size = (argc * sizeof (void *)) + 512;
+ /* We need at least a few pages in case the compiler's stack checking is
+ enabled. In some configs, it is known to use at least 24KiB. We use
+ 32KiB to be "safe" from anything the compiler might do. Besides, the
+ extra pages won't actually be allocated unless they get used. */
+ argv_size += (32 * 1024);
+ size_t stack_size = ALIGN_UP (argv_size, GLRO(dl_pagesize));
+ void *stack = __mmap (NULL, stack_size, prot,
+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
+ if (__glibc_unlikely (stack == MAP_FAILED))
+ return errno;
+
+ /* Disable asynchronous cancellation. */
+ 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 = 0;
+ args.file = file;
+ args.exec = exec;
+ args.fa = file_actions;
+ args.attr = attrp ? attrp : &(const posix_spawnattr_t) { 0 };
+ args.argv = argv;
+ args.argc = argc;
+ args.envp = envp;
+ args.xflags = xflags;
+
+ __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.
+
+ 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
+ for instance). */
+ new_pid = CLONE (__spawni_child, STACK (stack, stack_size), stack_size,
+ CLONE_VM | CLONE_VFORK | SIGCHLD, &args);
+
+ /* It needs to collect the case where the auxiliary process was created
+ but failed to execute the file (due either any preparation step or
+ for execve itself). */
+ if (new_pid > 0)
+ {
+ /* Also, it handles the unlikely case where the auxiliary process was
+ terminated before calling execve as if it was successfully. The
+ args.err is set to 0 as default and changed to a positive value
+ only in case of failure, so in case of premature termination
+ due a signal args.err will remain zeroed and it will be up to
+ caller to actually collect it. */
+ ec = args.err;
+ if (ec > 0)
+ /* There still an unlikely case where the child is cancelled after
+ setting args.err, due to a positive error value. Also there is
+ possible pid reuse race (where the kernel allocated the same pid
+ to an unrelated process). Unfortunately due synchronization
+ issues where the kernel might not have the process collected
+ the waitpid below can not use WNOHANG. */
+ __waitpid (new_pid, NULL, 0);
+ }
+ else
+ ec = -new_pid;
+
+ __munmap (stack, stack_size);
+
+ if ((ec == 0) && (pid != NULL))
+ *pid = new_pid;
+
+ __libc_signal_restore_set (&args.oldmask);
+
+ __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+
+ return ec;
+}
+
+/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
+ Before running the process perform the actions described in FILE-ACTIONS. */
+int
+__spawni (pid_t * pid, const char *file,
+ const posix_spawn_file_actions_t * acts,
+ const posix_spawnattr_t * attrp, char *const argv[],
+ char *const envp[], int xflags)
+{
+ /* It uses __execvpex to avoid run ENOEXEC in non compatibility mode (it
+ will be handled by maybe_script_execute). */
+ return __spawnix (pid, file, acts, attrp, argv, envp, xflags,
+ xflags & SPAWN_XFLAGS_USE_PATH ? __execvpex :__execve);
+}
diff --git a/sysdeps/unix/sysv/linux/speed.c b/sysdeps/unix/sysv/linux/speed.c
index 6967a0bdf2..7db9e998c3 100644
--- a/sysdeps/unix/sysv/linux/speed.c
+++ b/sysdeps/unix/sysv/linux/speed.c
@@ -1,5 +1,5 @@
/* `struct termios' speed frobnication functions. Linux version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/splice.c b/sysdeps/unix/sysv/linux/splice.c
new file mode 100644
index 0000000000..11f724f69c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/splice.c
@@ -0,0 +1,27 @@
+/* Splice data to/from a pipe Linux implementation.
+ Copyright (C) 2017-2018 Free Software 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-cancel.h>
+
+ssize_t
+splice (int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len,
+ unsigned int flags)
+{
+ return SYSCALL_CANCEL (splice, fd_in, off_in, fd_out, off_out, len, flags);
+}
diff --git a/sysdeps/unix/sysv/linux/statfs64.c b/sysdeps/unix/sysv/linux/statfs64.c
index de422618fe..01c1f08d88 100644
--- a/sysdeps/unix/sysv/linux/statfs64.c
+++ b/sysdeps/unix/sysv/linux/statfs64.c
@@ -1,5 +1,5 @@
/* Return information about the filesystem on which FILE resides.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,9 +18,21 @@
#include <errno.h>
#include <string.h>
-#include <sys/statfs.h>
#include <stddef.h>
#include <sysdep.h>
+#include <kernel_stat.h>
+
+/* Hide the prototypes for __statfs and statfs so that GCC will not
+ complain about the different function signatures if they are aliased
+ to __stat64. If STATFS_IS_STATFS64 is not zero then the statfs and
+ statfs64 structures have an identical layout but different type names. */
+
+#if STATFS_IS_STATFS64
+# define __statfs __statfs_disable
+# define statfs statfs_disable
+#endif
+#include <sys/statfs.h>
+
#include <kernel-features.h>
@@ -72,3 +84,12 @@ __statfs64 (const char *file, struct statfs64 *buf)
#endif
}
weak_alias (__statfs64, statfs64)
+
+#undef __statfs
+#undef statfs
+
+#if STATFS_IS_STATFS64
+weak_alias (__statfs64, __statfs)
+weak_alias (__statfs64, statfs)
+libc_hidden_ver (__statfs64, __statfs)
+#endif
diff --git a/sysdeps/unix/sysv/linux/statvfs.c b/sysdeps/unix/sysv/linux/statvfs.c
index aaf275e3ed..67f9a67fd7 100644
--- a/sysdeps/unix/sysv/linux/statvfs.c
+++ b/sysdeps/unix/sysv/linux/statvfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -19,11 +19,7 @@
#include <stddef.h>
#include <sys/stat.h>
#include <sys/statfs.h>
-#include <sys/statvfs.h>
-
-extern void __internal_statvfs (const char *name, struct statvfs *buf,
- struct statfs *fsbuf, int fd);
-
+#include "internal_statvfs.h"
int
__statvfs (const char *file, struct statvfs *buf)
diff --git a/sysdeps/unix/sysv/linux/statvfs64.c b/sysdeps/unix/sysv/linux/statvfs64.c
index 00d39890f7..44d6d4acf7 100644
--- a/sysdeps/unix/sysv/linux/statvfs64.c
+++ b/sysdeps/unix/sysv/linux/statvfs64.c
@@ -1,5 +1,5 @@
/* Return information about the filesystem on which FILE resides.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,14 +21,9 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/statfs.h>
-#include <sys/statvfs.h>
+#include "internal_statvfs.h"
#include <kernel-features.h>
-
-extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf,
- struct statfs64 *fsbuf, int fd);
-
-
/* Return information about the filesystem on which FILE resides. */
int
__statvfs64 (const char *file, struct statvfs64 *buf)
diff --git a/sysdeps/unix/sysv/linux/statx.c b/sysdeps/unix/sysv/linux/statx.c
new file mode 100644
index 0000000000..76761d6ef2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/statx.c
@@ -0,0 +1,41 @@
+/* Linux statx implementation.
+ Copyright (C) 2018 Free Software 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/stat.h>
+
+#include "statx_generic.c"
+
+int
+statx (int fd, const char *path, int flags,
+ unsigned int mask, struct statx *buf)
+{
+#ifdef __NR_statx
+ int ret = INLINE_SYSCALL_CALL (statx, fd, path, flags, mask, buf);
+# ifdef __ASSUME_STATX
+ return ret;
+# else
+ if (ret == 0 || errno != ENOSYS)
+ /* Preserve non-error/non-ENOSYS return values. */
+ return ret;
+# endif
+#endif
+#ifndef __ASSUME_STATX
+ return statx_generic (fd, path, flags, mask, buf);
+#endif
+}
diff --git a/sysdeps/unix/sysv/linux/sync_file_range.c b/sysdeps/unix/sysv/linux/sync_file_range.c
index a8f42146a7..2ed0d53068 100644
--- a/sysdeps/unix/sysv/linux/sync_file_range.c
+++ b/sysdeps/unix/sysv/linux/sync_file_range.c
@@ -1,5 +1,5 @@
/* Selective file content synch'ing.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software 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,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..3f93393558 100644
--- a/sysdeps/unix/sysv/linux/sys/acct.h
+++ b/sysdeps/unix/sysv/linux/sys/acct.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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/epoll.h b/sysdeps/unix/sysv/linux/sys/epoll.h
index 72ec211b95..2937774da5 100644
--- a/sysdeps/unix/sysv/linux/sys/epoll.h
+++ b/sysdeps/unix/sysv/linux/sys/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,13 +21,7 @@
#include <stdint.h>
#include <sys/types.h>
-/* Get __sigset_t. */
-#include <bits/sigset.h>
-
-#ifndef __sigset_t_defined
-# define __sigset_t_defined
-typedef __sigset_t sigset_t;
-#endif
+#include <bits/types/sigset_t.h>
/* Get the platform-dependent flags. */
#include <bits/epoll.h>
@@ -61,6 +55,8 @@ enum EPOLL_EVENTS
#define EPOLLHUP EPOLLHUP
EPOLLRDHUP = 0x2000,
#define EPOLLRDHUP EPOLLRDHUP
+ EPOLLEXCLUSIVE = 1u << 28,
+#define EPOLLEXCLUSIVE EPOLLEXCLUSIVE
EPOLLWAKEUP = 1u << 29,
#define EPOLLWAKEUP EPOLLWAKEUP
EPOLLONESHOT = 1u << 30,
diff --git a/sysdeps/unix/sysv/linux/sys/eventfd.h b/sysdeps/unix/sysv/linux/sys/eventfd.h
index 8f8a518245..616a9d331b 100644
--- a/sysdeps/unix/sysv/linux/sys/eventfd.h
+++ b/sysdeps/unix/sysv/linux/sys/eventfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/fanotify.h b/sysdeps/unix/sysv/linux/sys/fanotify.h
index d79ef5e7c4..84b9efede1 100644
--- a/sysdeps/unix/sysv/linux/sys/fanotify.h
+++ b/sysdeps/unix/sysv/linux/sys/fanotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/fsuid.h b/sysdeps/unix/sysv/linux/sys/fsuid.h
index ac7f286c0e..6b891e9c15 100644
--- a/sysdeps/unix/sysv/linux/sys/fsuid.h
+++ b/sysdeps/unix/sysv/linux/sys/fsuid.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/inotify.h b/sysdeps/unix/sysv/linux/sys/inotify.h
index e42dba0f3b..49cc374851 100644
--- a/sysdeps/unix/sysv/linux/sys/inotify.h
+++ b/sysdeps/unix/sysv/linux/sys/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/kd.h b/sysdeps/unix/sysv/linux/sys/kd.h
index bb20603290..6c929c45b6 100644
--- a/sysdeps/unix/sysv/linux/sys/kd.h
+++ b/sysdeps/unix/sysv/linux/sys/kd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/klog.h b/sysdeps/unix/sysv/linux/sys/klog.h
index 21c3950616..11dc07c028 100644
--- a/sysdeps/unix/sysv/linux/sys/klog.h
+++ b/sysdeps/unix/sysv/linux/sys/klog.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
index 3b667ed34b..ce2838e3a7 100644
--- a/sysdeps/unix/sysv/linux/sys/mount.h
+++ b/sysdeps/unix/sysv/linux/sys/mount.h
@@ -1,5 +1,5 @@
/* Header file for mounting/unmount Linux filesystems.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/pci.h b/sysdeps/unix/sysv/linux/sys/pci.h
index 331f2e1669..e420933d78 100644
--- a/sysdeps/unix/sysv/linux/sys/pci.h
+++ b/sysdeps/unix/sysv/linux/sys/pci.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/personality.h b/sysdeps/unix/sysv/linux/sys/personality.h
index af2ece6cf9..956f318e0a 100644
--- a/sysdeps/unix/sysv/linux/sys/personality.h
+++ b/sysdeps/unix/sysv/linux/sys/personality.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,7 +26,9 @@
These occupy the top three bytes. */
enum
{
+ UNAME26 = 0x0020000,
ADDR_NO_RANDOMIZE = 0x0040000,
+ FDPIC_FUNCPTRS = 0x0080000,
MMAP_PAGE_ZERO = 0x0100000,
ADDR_COMPAT_LAYOUT = 0x0200000,
READ_IMPLIES_EXEC = 0x0400000,
@@ -45,6 +47,7 @@ enum
{
PER_LINUX = 0x0000,
PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
+ PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE,
diff --git a/sysdeps/unix/sysv/linux/sys/prctl.h b/sysdeps/unix/sysv/linux/sys/prctl.h
index 83049d5fe2..683d16748f 100644
--- a/sysdeps/unix/sysv/linux/sys/prctl.h
+++ b/sysdeps/unix/sysv/linux/sys/prctl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/procfs.h b/sysdeps/unix/sysv/linux/sys/procfs.h
index 4e16346b07..3c417bab29 100644
--- a/sysdeps/unix/sysv/linux/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,7 +58,7 @@ struct elf_prstatus
unsigned long int pr_sigpend; /* Set of pending signals. */
unsigned long int pr_sighold; /* Set of held signals. */
#if 0
- struct sigaltstack pr_altstack; /* Alternate stack info. */
+ stack_t pr_altstack; /* Alternate stack info. */
struct sigaction pr_action; /* Signal action for current sig. */
#endif
__pid_t pr_pid;
diff --git a/sysdeps/unix/sysv/linux/sys/ptrace.h b/sysdeps/unix/sysv/linux/sys/ptrace.h
index ee88271e0e..3c71a0ebd6 100644
--- a/sysdeps/unix/sysv/linux/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/sys/ptrace.h
@@ -1,5 +1,6 @@
/* `ptrace' debugger support interface. Linux version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
+
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -65,29 +66,28 @@ enum __ptrace_request
PTRACE_KILL = 8,
#define PT_KILL PTRACE_KILL
- /* Single step the process.
- This is not supported on all machines. */
+ /* Single step the process. */
PTRACE_SINGLESTEP = 9,
#define PT_STEP PTRACE_SINGLESTEP
/* Get all general purpose registers used by a processes.
This is not supported on all machines. */
- PTRACE_GETREGS = 12,
+ PTRACE_GETREGS = 12,
#define PT_GETREGS PTRACE_GETREGS
/* Set all general purpose registers used by a processes.
This is not supported on all machines. */
- PTRACE_SETREGS = 13,
+ PTRACE_SETREGS = 13,
#define PT_SETREGS PTRACE_SETREGS
/* Get all floating point registers used by a processes.
This is not supported on all machines. */
- PTRACE_GETFPREGS = 14,
+ PTRACE_GETFPREGS = 14,
#define PT_GETFPREGS PTRACE_GETFPREGS
/* Set all floating point registers used by a processes.
This is not supported on all machines. */
- PTRACE_SETFPREGS = 15,
+ PTRACE_SETFPREGS = 15,
#define PT_SETFPREGS PTRACE_SETFPREGS
/* Attach to a process that is already running. */
@@ -100,15 +100,15 @@ enum __ptrace_request
/* Get all extended floating point registers used by a processes.
This is not supported on all machines. */
- PTRACE_GETFPXREGS = 18,
+ PTRACE_GETFPXREGS = 18,
#define PT_GETFPXREGS PTRACE_GETFPXREGS
/* Set all extended floating point registers used by a processes.
This is not supported on all machines. */
- PTRACE_SETFPXREGS = 19,
+ PTRACE_SETFPXREGS = 19,
#define PT_SETFPXREGS PTRACE_SETFPXREGS
- /* Continue and stop at the next (return from) syscall. */
+ /* Continue and stop at the next entry to or return from syscall. */
PTRACE_SYSCALL = 24,
#define PT_SYSCALL PTRACE_SYSCALL
@@ -149,78 +149,29 @@ enum __ptrace_request
PTRACE_LISTEN = 0x4208,
#define PTRACE_LISTEN PTRACE_LISTEN
+ /* Retrieve siginfo_t structures without removing signals from a queue. */
PTRACE_PEEKSIGINFO = 0x4209,
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+ /* Get the mask of blocked signals. */
PTRACE_GETSIGMASK = 0x420a,
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
+ /* Change the mask of blocked signals. */
PTRACE_SETSIGMASK = 0x420b,
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
- PTRACE_SECCOMP_GET_FILTER = 0x420c
+ /* Get seccomp BPF filters. */
+ PTRACE_SECCOMP_GET_FILTER = 0x420c,
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
-};
-
-/* Flag for PTRACE_LISTEN. */
-enum __ptrace_flags
-{
- PTRACE_SEIZE_DEVEL = 0x80000000
-};
-
-/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions
-{
- PTRACE_O_TRACESYSGOOD = 0x00000001,
- PTRACE_O_TRACEFORK = 0x00000002,
- PTRACE_O_TRACEVFORK = 0x00000004,
- PTRACE_O_TRACECLONE = 0x00000008,
- PTRACE_O_TRACEEXEC = 0x00000010,
- PTRACE_O_TRACEVFORKDONE = 0x00000020,
- PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_EXITKILL = 0x00100000,
- PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
- PTRACE_O_MASK = 0x003000ff
-};
-
-/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes
-{
- PTRACE_EVENT_FORK = 1,
- PTRACE_EVENT_VFORK = 2,
- PTRACE_EVENT_CLONE = 3,
- PTRACE_EVENT_EXEC = 4,
- PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6,
- PTRACE_EVENT_SECCOMP = 7
-};
-
-/* Arguments for PTRACE_PEEKSIGINFO. */
-struct __ptrace_peeksiginfo_args
-{
- __uint64_t off; /* From which siginfo to start. */
- __uint32_t flags; /* Flags for peeksiginfo. */
- __int32_t nr; /* How many siginfos to take. */
-};
-
-enum __ptrace_peeksiginfo_flags
-{
- /* Read signals from a shared (process wide) queue. */
- PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
+ /* Get seccomp BPF filter metadata. */
+ PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
};
-/* Perform process tracing functions. REQUEST is one of the values
- above, and determines the action to be taken.
- For all requests except PTRACE_TRACEME, PID specifies the process to be
- traced.
- PID and the other arguments described above for the various requests should
- appear (those that are used for the particular request) as:
- pid_t PID, void *ADDR, int DATA, void *ADDR2
- after REQUEST. */
-extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+#include <bits/ptrace-shared.h>
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/sys/quota.h b/sysdeps/unix/sysv/linux/sys/quota.h
index 5aa0ec07d2..23f569ee9a 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-2018 Free Software 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,154 +81,54 @@
#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 */
-#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
#define dq_btime dq_dqb.dqb_btime
#define dq_itime dq_dqb.dqb_itime
-#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)
+#define dqoff(UID) ((__loff_t)((UID) * sizeof (struct dqblk)))
+/* 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/raw.h b/sysdeps/unix/sysv/linux/sys/raw.h
index bd7266df5c..7069c7a426 100644
--- a/sysdeps/unix/sysv/linux/sys/raw.h
+++ b/sysdeps/unix/sysv/linux/sys/raw.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/reboot.h b/sysdeps/unix/sysv/linux/sys/reboot.h
index df1076fe58..98249674f6 100644
--- a/sysdeps/unix/sysv/linux/sys/reboot.h
+++ b/sysdeps/unix/sysv/linux/sys/reboot.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/signalfd.h b/sysdeps/unix/sysv/linux/sys/signalfd.h
index 6f75bc0aa9..f39eed5f12 100644
--- a/sysdeps/unix/sysv/linux/sys/signalfd.h
+++ b/sysdeps/unix/sysv/linux/sys/signalfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,9 +18,8 @@
#ifndef _SYS_SIGNALFD_H
#define _SYS_SIGNALFD_H 1
-#define __need_sigset_t
-#include <signal.h>
#include <stdint.h>
+#include <bits/types/sigset_t.h>
/* Get the platform-dependent flags. */
#include <bits/signalfd.h>
diff --git a/sysdeps/unix/sysv/linux/sys/swap.h b/sysdeps/unix/sysv/linux/sys/swap.h
index 469907b7c4..c79e9378cd 100644
--- a/sysdeps/unix/sysv/linux/sys/swap.h
+++ b/sysdeps/unix/sysv/linux/sys/swap.h
@@ -1,5 +1,5 @@
/* Calls to enable and disable swapping on specified locations. Linux version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/syscall.h b/sysdeps/unix/sysv/linux/sys/syscall.h
index d925a1de45..6434dde604 100644
--- a/sysdeps/unix/sysv/linux/sys/syscall.h
+++ b/sysdeps/unix/sysv/linux/sys/syscall.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/sysctl.h b/sysdeps/unix/sysv/linux/sys/sysctl.h
index 687d1a2b4d..d125a83450 100644
--- a/sysdeps/unix/sysv/linux/sys/sysctl.h
+++ b/sysdeps/unix/sysv/linux/sys/sysctl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/sysinfo.h b/sysdeps/unix/sysv/linux/sys/sysinfo.h
index 4fc51860e1..80e2d096d8 100644
--- a/sysdeps/unix/sysv/linux/sys/sysinfo.h
+++ b/sysdeps/unix/sysv/linux/sys/sysinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/sysmacros.h b/sysdeps/unix/sysv/linux/sys/sysmacros.h
deleted file mode 100644
index 4c4a6978b5..0000000000
--- a/sysdeps/unix/sysv/linux/sys/sysmacros.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Definitions of macros to access `dev_t' values.
- 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/>. */
-
-#ifndef _SYS_SYSMACROS_H
-#define _SYS_SYSMACROS_H 1
-
-#include <features.h>
-
-__BEGIN_DECLS
-
-__extension__
-extern unsigned int gnu_dev_major (unsigned long long int __dev)
- __THROW __attribute_const__;
-__extension__
-extern unsigned int gnu_dev_minor (unsigned long long int __dev)
- __THROW __attribute_const__;
-__extension__
-extern unsigned long long int gnu_dev_makedev (unsigned int __major,
- unsigned int __minor)
- __THROW __attribute_const__;
-
-#ifdef __USE_EXTERN_INLINES
-__extension__ __extern_inline __attribute_const__ unsigned int
-__NTH (gnu_dev_major (unsigned long long int __dev))
-{
- return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
-}
-
-__extension__ __extern_inline __attribute_const__ unsigned int
-__NTH (gnu_dev_minor (unsigned long long int __dev))
-{
- return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
-}
-
-__extension__ __extern_inline __attribute_const__ unsigned long long int
-__NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor))
-{
- return ((__minor & 0xff) | ((__major & 0xfff) << 8)
- | (((unsigned long long int) (__minor & ~0xff)) << 12)
- | (((unsigned long long int) (__major & ~0xfff)) << 32));
-}
-#endif
-__END_DECLS
-
-/* Access the functions with their traditional names. */
-#define major(dev) gnu_dev_major (dev)
-#define minor(dev) gnu_dev_minor (dev)
-#define makedev(maj, min) gnu_dev_makedev (maj, min)
-
-#endif /* sys/sysmacros.h */
diff --git a/sysdeps/unix/sysv/linux/sys/timerfd.h b/sysdeps/unix/sysv/linux/sys/timerfd.h
index 3286997cc0..4d75e150a1 100644
--- a/sysdeps/unix/sysv/linux/sys/timerfd.h
+++ b/sysdeps/unix/sysv/linux/sys/timerfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,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>
@@ -27,15 +28,17 @@
/* Bits to be set in the FLAGS parameter of `timerfd_settime'. */
enum
{
- TFD_TIMER_ABSTIME = 1 << 0
+ TFD_TIMER_ABSTIME = 1 << 0,
#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
+ TFD_TIMER_CANCEL_ON_SET = 1 << 1
+#define TFD_TIMER_CANCEL_ON_SET TFD_TIMER_CANCEL_ON_SET
};
__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/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h
index 75e86ddfb7..0d652c8aeb 100644
--- a/sysdeps/unix/sysv/linux/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/sys/timex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sys/ultrasound.h b/sysdeps/unix/sysv/linux/sys/ultrasound.h
deleted file mode 100644
index a65c385bc0..0000000000
--- a/sysdeps/unix/sysv/linux/sys/ultrasound.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <linux/ultrasound.h>
diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list
new file mode 100644
index 0000000000..5306d538e6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/syscall-names.list
@@ -0,0 +1,602 @@
+# List of all known Linux system calls.
+# Copyright (C) 2017-2018 Free Software 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 file contains the list of system call names names. It has to
+# remain in alphabetica order. Lines which start with # are treated
+# as comments. This file can list all potential system calls. The
+# names are only used if the installed kernel headers also provide
+# them.
+
+# The list of system calls is current as of Linux 4.17.
+kernel 4.17
+
+FAST_atomic_update
+FAST_cmpxchg
+FAST_cmpxchg64
+_llseek
+_newselect
+_sysctl
+accept
+accept4
+access
+acct
+acl_get
+acl_set
+add_key
+adjtimex
+afs_syscall
+alarm
+alloc_hugepages
+arch_prctl
+arm_fadvise64_64
+arm_sync_file_range
+atomic_barrier
+atomic_cmpxchg_32
+attrctl
+bdflush
+bind
+bpf
+break
+brk
+cachectl
+cacheflush
+capget
+capset
+chdir
+chmod
+chown
+chown32
+chroot
+clock_adjtime
+clock_getres
+clock_gettime
+clock_nanosleep
+clock_settime
+clone
+clone2
+close
+cmpxchg_badaddr
+connect
+copy_file_range
+creat
+create_module
+delete_module
+dipc
+dup
+dup2
+dup3
+epoll_create
+epoll_create1
+epoll_ctl
+epoll_ctl_old
+epoll_pwait
+epoll_wait
+epoll_wait_old
+eventfd
+eventfd2
+exec_with_loader
+execv
+execve
+execveat
+exit
+exit_group
+faccessat
+fadvise64
+fadvise64_64
+fallocate
+fanotify_init
+fanotify_mark
+fchdir
+fchmod
+fchmodat
+fchown
+fchown32
+fchownat
+fcntl
+fcntl64
+fdatasync
+fgetxattr
+finit_module
+flistxattr
+flock
+fork
+free_hugepages
+fremovexattr
+fsetxattr
+fstat
+fstat64
+fstatat64
+fstatfs
+fstatfs64
+fsync
+ftime
+ftruncate
+ftruncate64
+futex
+futimesat
+get_kernel_syms
+get_mempolicy
+get_robust_list
+get_thread_area
+getcpu
+getcwd
+getdents
+getdents64
+getdomainname
+getdtablesize
+getegid
+getegid32
+geteuid
+geteuid32
+getgid
+getgid32
+getgroups
+getgroups32
+gethostname
+getitimer
+getpagesize
+getpeername
+getpgid
+getpgrp
+getpid
+getpmsg
+getppid
+getpriority
+getrandom
+getresgid
+getresgid32
+getresuid
+getresuid32
+getrlimit
+getrusage
+getsid
+getsockname
+getsockopt
+gettid
+gettimeofday
+getuid
+getuid32
+getunwind
+getxattr
+getxgid
+getxpid
+getxuid
+gtty
+idle
+init_module
+inotify_add_watch
+inotify_init
+inotify_init1
+inotify_rm_watch
+io_cancel
+io_destroy
+io_getevents
+io_setup
+io_submit
+ioctl
+ioperm
+iopl
+ioprio_get
+ioprio_set
+ipc
+kcmp
+kern_features
+kexec_file_load
+kexec_load
+keyctl
+kill
+lchown
+lchown32
+lgetxattr
+link
+linkat
+listen
+listxattr
+llistxattr
+llseek
+lock
+lookup_dcookie
+lremovexattr
+lseek
+lsetxattr
+lstat
+lstat64
+madvise
+mbind
+membarrier
+memfd_create
+memory_ordering
+migrate_pages
+mincore
+mkdir
+mkdirat
+mknod
+mknodat
+mlock
+mlock2
+mlockall
+mmap
+mmap2
+modify_ldt
+mount
+move_pages
+mprotect
+mpx
+mq_getsetattr
+mq_notify
+mq_open
+mq_timedreceive
+mq_timedsend
+mq_unlink
+mremap
+msgctl
+msgget
+msgrcv
+msgsnd
+msync
+multiplexer
+munlock
+munlockall
+munmap
+name_to_handle_at
+nanosleep
+newfstatat
+nfsservctl
+ni_syscall
+nice
+old_adjtimex
+oldfstat
+oldlstat
+oldolduname
+oldstat
+oldumount
+olduname
+open
+open_by_handle_at
+openat
+osf_adjtime
+osf_afs_syscall
+osf_alt_plock
+osf_alt_setsid
+osf_alt_sigpending
+osf_asynch_daemon
+osf_audcntl
+osf_audgen
+osf_chflags
+osf_execve
+osf_exportfs
+osf_fchflags
+osf_fdatasync
+osf_fpathconf
+osf_fstat
+osf_fstatfs
+osf_fstatfs64
+osf_fuser
+osf_getaddressconf
+osf_getdirentries
+osf_getdomainname
+osf_getfh
+osf_getfsstat
+osf_gethostid
+osf_getitimer
+osf_getlogin
+osf_getmnt
+osf_getrusage
+osf_getsysinfo
+osf_gettimeofday
+osf_kloadcall
+osf_kmodcall
+osf_lstat
+osf_memcntl
+osf_mincore
+osf_mount
+osf_mremap
+osf_msfs_syscall
+osf_msleep
+osf_mvalid
+osf_mwakeup
+osf_naccept
+osf_nfssvc
+osf_ngetpeername
+osf_ngetsockname
+osf_nrecvfrom
+osf_nrecvmsg
+osf_nsendmsg
+osf_ntp_adjtime
+osf_ntp_gettime
+osf_old_creat
+osf_old_fstat
+osf_old_getpgrp
+osf_old_killpg
+osf_old_lstat
+osf_old_open
+osf_old_sigaction
+osf_old_sigblock
+osf_old_sigreturn
+osf_old_sigsetmask
+osf_old_sigvec
+osf_old_stat
+osf_old_vadvise
+osf_old_vtrace
+osf_old_wait
+osf_oldquota
+osf_pathconf
+osf_pid_block
+osf_pid_unblock
+osf_plock
+osf_priocntlset
+osf_profil
+osf_proplist_syscall
+osf_reboot
+osf_revoke
+osf_sbrk
+osf_security
+osf_select
+osf_set_program_attributes
+osf_set_speculative
+osf_sethostid
+osf_setitimer
+osf_setlogin
+osf_setsysinfo
+osf_settimeofday
+osf_shmat
+osf_signal
+osf_sigprocmask
+osf_sigsendset
+osf_sigstack
+osf_sigwaitprim
+osf_sstk
+osf_stat
+osf_statfs
+osf_statfs64
+osf_subsys_info
+osf_swapctl
+osf_swapon
+osf_syscall
+osf_sysinfo
+osf_table
+osf_uadmin
+osf_usleep_thread
+osf_uswitch
+osf_utc_adjtime
+osf_utc_gettime
+osf_utimes
+osf_utsname
+osf_wait4
+osf_waitid
+pause
+pciconfig_iobase
+pciconfig_read
+pciconfig_write
+perf_event_open
+perfctr
+perfmonctl
+personality
+pipe
+pipe2
+pivot_root
+pkey_alloc
+pkey_free
+pkey_mprotect
+poll
+ppoll
+prctl
+pread64
+preadv
+preadv2
+prlimit64
+process_vm_readv
+process_vm_writev
+prof
+profil
+pselect6
+ptrace
+putpmsg
+pwrite64
+pwritev
+pwritev2
+query_module
+quotactl
+read
+readahead
+readdir
+readlink
+readlinkat
+readv
+reboot
+recv
+recvfrom
+recvmmsg
+recvmsg
+remap_file_pages
+removexattr
+rename
+renameat
+renameat2
+request_key
+restart_syscall
+rmdir
+rt_sigaction
+rt_sigpending
+rt_sigprocmask
+rt_sigqueueinfo
+rt_sigreturn
+rt_sigsuspend
+rt_sigtimedwait
+rt_tgsigqueueinfo
+rtas
+s390_guarded_storage
+s390_pci_mmio_read
+s390_pci_mmio_write
+s390_runtime_instr
+s390_sthyi
+sched_get_affinity
+sched_get_priority_max
+sched_get_priority_min
+sched_getaffinity
+sched_getattr
+sched_getparam
+sched_getscheduler
+sched_rr_get_interval
+sched_set_affinity
+sched_setaffinity
+sched_setattr
+sched_setparam
+sched_setscheduler
+sched_yield
+seccomp
+security
+select
+semctl
+semget
+semop
+semtimedop
+send
+sendfile
+sendfile64
+sendmmsg
+sendmsg
+sendto
+set_mempolicy
+set_robust_list
+set_thread_area
+set_tid_address
+setdomainname
+setfsgid
+setfsgid32
+setfsuid
+setfsuid32
+setgid
+setgid32
+setgroups
+setgroups32
+sethae
+sethostname
+setitimer
+setns
+setpgid
+setpgrp
+setpriority
+setregid
+setregid32
+setresgid
+setresgid32
+setresuid
+setresuid32
+setreuid
+setreuid32
+setrlimit
+setsid
+setsockopt
+settimeofday
+setuid
+setuid32
+setxattr
+sgetmask
+shmat
+shmctl
+shmdt
+shmget
+shutdown
+sigaction
+sigaltstack
+signal
+signalfd
+signalfd4
+sigpending
+sigprocmask
+sigreturn
+sigsuspend
+socket
+socketcall
+socketpair
+splice
+spu_create
+spu_run
+ssetmask
+stat
+stat64
+statfs
+statfs64
+statx
+stime
+stty
+subpage_prot
+swapcontext
+swapoff
+swapon
+switch_endian
+symlink
+symlinkat
+sync
+sync_file_range
+sync_file_range2
+syncfs
+sys_debug_setcontext
+sys_epoll_create
+sys_epoll_ctl
+sys_epoll_wait
+syscall
+sysfs
+sysinfo
+syslog
+sysmips
+tee
+tgkill
+time
+timer_create
+timer_delete
+timer_getoverrun
+timer_gettime
+timer_settime
+timerfd
+timerfd_create
+timerfd_gettime
+timerfd_settime
+times
+tkill
+truncate
+truncate64
+tuxcall
+ugetrlimit
+ulimit
+umask
+umount
+umount2
+uname
+unlink
+unlinkat
+unshare
+uselib
+userfaultfd
+ustat
+utime
+utimensat
+utimes
+utrap_install
+vfork
+vhangup
+vm86
+vm86old
+vmsplice
+vserver
+wait4
+waitid
+waitpid
+write
+writev
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index afaf0337bd..e24ea29e35 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -6,17 +6,16 @@ bdflush EXTRA bdflush i:ii __compat_bdflush bdflush@GLIBC_2.0:GLIBC_2.23
capget EXTRA capget i:pp capget
capset EXTRA capset i:pp capset
clock_adjtime EXTRA clock_adjtime i:ip clock_adjtime
-creat - creat Ci:si creat
create_module EXTRA create_module 3 __compat_create_module create_module@GLIBC_2.0:GLIBC_2.23
delete_module EXTRA delete_module 3 delete_module
epoll_create EXTRA epoll_create i:i epoll_create
epoll_create1 EXTRA epoll_create1 i:i epoll_create1
epoll_ctl EXTRA epoll_ctl i:iiip epoll_ctl
-epoll_wait EXTRA epoll_wait Ci:ipii epoll_wait
+eventfd EXTRA eventfd2 i:ii eventfd
execve - execve i:spp __execve execve
-fdatasync - fdatasync Ci:i fdatasync
flock - flock i:ii __flock flock
get_kernel_syms EXTRA get_kernel_syms i:p __compat_get_kernel_syms get_kernel_syms@GLIBC_2.0:GLIBC_2.23
+getpid - getpid Ei: __getpid getpid
getegid - getegid Ei: __getegid getegid
geteuid - geteuid Ei: __geteuid geteuid
getpgid - getpgid i:i __getpgid getpgid
@@ -25,7 +24,6 @@ getpmsg - getpmsg i:ipppp getpmsg
getppid - getppid Ei: __getppid getppid
getresuid - getresuid i:ppp getresuid
getresgid - getresgid i:ppp getresgid
-getrlimit - ugetrlimit i:ip __new_getrlimit __getrlimit getrlimit@@GLIBC_2.2
getsid - getsid i:i getsid
init_module EXTRA init_module 5 init_module
inotify_add_watch EXTRA inotify_add_watch i:isi inotify_add_watch
@@ -43,13 +41,10 @@ mount EXTRA mount i:sssip __mount mount
mremap EXTRA mremap b:ainip __mremap mremap
munlock - munlock i:ai munlock
munlockall - munlockall i: munlockall
-nanosleep - nanosleep Ci:pp __nanosleep nanosleep
-nfsservctl EXTRA nfsservctl i:ipp nfsservctl
-pause - pause Ci: __libc_pause pause
+nfsservctl EXTRA nfsservctl i:ipp __compat_nfsservctl nfsservctl@GLIBC_2.0:GLIBC_2.28
pipe - pipe i:f __pipe pipe
pipe2 - pipe2 i:fi __pipe2 pipe2
pivot_root EXTRA pivot_root i:ss pivot_root
-poll - poll Ci:pii __libc_poll __poll poll
prctl EXTRA prctl i:iiiii __prctl prctl
putpmsg - putpmsg i:ippii putpmsg
query_module EXTRA query_module i:sipip __compat_query_module query_module@GLIBC_2.0:GLIBC_2.23
@@ -63,23 +58,19 @@ sched_rr_gi - sched_rr_get_interval i:ip __sched_rr_get_interval sched_rr_get_in
sched_setp - sched_setparam i:ip __sched_setparam sched_setparam
sched_sets - sched_setscheduler i:iip __sched_setscheduler sched_setscheduler
sched_yield - sched_yield i: __sched_yield sched_yield
-select - _newselect Ci:iPPPP __select __libc_select select
sendfile - sendfile i:iipi sendfile
sendfile64 - sendfile64 i:iipi sendfile64
setfsgid EXTRA setfsgid i:i setfsgid
setfsuid EXTRA setfsuid i:i setfsuid
setpgid - setpgid i:ii __setpgid setpgid
sigaltstack - sigaltstack i:PP __sigaltstack sigaltstack
-splice EXTRA splice Ci:iPiPii splice
stime - stime i:p stime
sysinfo EXTRA sysinfo i:p __sysinfo sysinfo
swapon - swapon i:si __swapon swapon
swapoff - swapoff i:s __swapoff swapoff
-tee EXTRA tee Ci:iiii tee
unshare EXTRA unshare i:i unshare
uselib EXTRA uselib i:s __compat_uselib uselib@GLIBC_2.0:GLIBC_2.23
utime - utime i:sP utime
-vmsplice EXTRA vmsplice Ci:iPii vmsplice
wait4 - wait4 i:iWiP __wait4 wait4
chown - chown i:sii __libc_chown __chown chown
@@ -88,7 +79,6 @@ fchownat - fchownat i:isiii fchownat
linkat - linkat i:isisi linkat
mkdirat - mkdirat i:isi mkdirat
readlinkat - readlinkat i:issi readlinkat
-renameat - renameat i:isis renameat
symlinkat - symlinkat i:sis symlinkat
unlinkat - unlinkat i:isi unlinkat
@@ -105,8 +95,6 @@ removexattr - removexattr i:ss removexattr
lremovexattr - lremovexattr i:ss lremovexattr
fremovexattr - fremovexattr i:is fremovexattr
-mq_timedsend - mq_timedsend Ci:ipiip __mq_timedsend mq_timedsend
-mq_timedreceive - mq_timedreceive Ci:ipipp __mq_timedreceive mq_timedreceive
mq_setattr - mq_getsetattr i:ipp mq_setattr
timerfd_create EXTRA timerfd_create i:ii timerfd_create
@@ -116,9 +104,11 @@ timerfd_gettime EXTRA timerfd_gettime i:ip timerfd_gettime
fanotify_init EXTRA fanotify_init i:ii fanotify_init
name_to_handle_at EXTRA name_to_handle_at i:isppi name_to_handle_at
-open_by_handle_at EXTRA open_by_handle_at Ci:ipi open_by_handle_at
setns EXTRA setns i:ii setns
process_vm_readv EXTRA process_vm_readv i:ipipii process_vm_readv
process_vm_writev EXTRA process_vm_writev i:ipipii process_vm_writev
+memfd_create EXTRA memfd_create i:si memfd_create
+pkey_alloc EXTRA pkey_alloc i:ii pkey_alloc
+pkey_free EXTRA pkey_free i:i pkey_free
diff --git a/sysdeps/unix/sysv/linux/sysconf.c b/sysdeps/unix/sysv/linux/sysconf.c
index 4de2cfe6a6..4e49ebaa7a 100644
--- a/sysdeps/unix/sysv/linux/sysconf.c
+++ b/sysdeps/unix/sysv/linux/sysconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -115,14 +115,14 @@ __sysconf (int name)
if (procfname != NULL)
{
- int fd = open_not_cancel_2 (procfname, O_RDONLY);
+ int fd = __open_nocancel (procfname, O_RDONLY);
if (fd != -1)
{
/* This is more than enough, the file contains a single integer. */
char buf[32];
ssize_t n;
- n = TEMP_FAILURE_RETRY (read_not_cancel (fd, buf, sizeof (buf) - 1));
- close_not_cancel_no_status (fd);
+ n = TEMP_FAILURE_RETRY (__read_nocancel (fd, buf, sizeof (buf) - 1));
+ __close_nocancel_nostatus (fd);
if (n > 0)
{
diff --git a/sysdeps/unix/sysv/linux/sysctl.c b/sysdeps/unix/sysv/linux/sysctl.c
index 542abccdbe..bb5e31a200 100644
--- a/sysdeps/unix/sysv/linux/sysctl.c
+++ b/sysdeps/unix/sysv/linux/sysctl.c
@@ -1,5 +1,5 @@
/* Read or write system information. Linux version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sysdep-cancel.h b/sysdeps/unix/sysv/linux/sysdep-cancel.h
new file mode 100644
index 0000000000..e320d513a7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sysdep-cancel.h
@@ -0,0 +1,64 @@
+/* Single-thread optimization definitions. Linux version.
+ Copyright (C) 2017-2018 Free Software 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>
+#include <tls.h>
+#include <nptl/pthreadP.h>
+
+/* The default way to check if the process is single thread is by using the
+ pthread_t 'multiple_threads' field. However for some architectures it
+ is faster to either use an extra field on TCB or global varibles
+ (the TCB field is also used on x86 for some single-thread atomic
+ optimizations).
+
+ The ABI might define SINGLE_THREAD_BY_GLOBAL to enable the single
+ thread check to use global variables instead of the pthread_t
+ field. */
+
+#ifdef SINGLE_THREAD_BY_GLOBAL
+# if IS_IN (libc)
+extern int __libc_multiple_threads;
+# define SINGLE_THREAD_P \
+ __glibc_likely (__libc_multiple_threads == 0)
+# elif IS_IN (libpthread)
+extern int __pthread_multiple_threads;
+# define SINGLE_THREAD_P \
+ __glibc_likely (__pthread_multiple_threads == 0)
+# elif IS_IN (librt)
+# define SINGLE_THREAD_P \
+ __glibc_likely (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0)
+# else
+/* For rtld, et cetera. */
+# define SINGLE_THREAD_P (1)
+# endif
+#else /* SINGLE_THREAD_BY_GLOBAL */
+# if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
+# define SINGLE_THREAD_P \
+ __glibc_likely (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0)
+# else
+/* For rtld, et cetera. */
+# define SINGLE_THREAD_P (1)
+# endif
+#endif /* SINGLE_THREAD_BY_GLOBAL */
+
+#define RTLD_SINGLE_THREAD_P \
+ __glibc_likely (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0)
diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
index e8c4a7b8ff..1912c1c156 100644
--- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
+++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
@@ -1,5 +1,5 @@
/* vDSO common definition for Linux.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h
index c98fc3afcb..4fd0a9bae3 100644
--- a/sysdeps/unix/sysv/linux/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software 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,6 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <bits/wordsize.h>
+#include <kernel-features.h>
+
/* Set error number and return -1. A target may choose to return the
internal function, __syscall_error, which sets errno and returns -1.
We use -1l, instead of -1, so that it can be casted to (void *). */
@@ -23,3 +26,43 @@
__set_errno (err); \
-1l; \
})
+
+/* Provide a dummy argument that can be used to force register
+ alignment for register pairs if required by the syscall ABI. */
+#ifdef __ASSUME_ALIGNED_REGISTER_PAIRS
+#define __ALIGNMENT_ARG 0,
+#define __ALIGNMENT_COUNT(a,b) b
+#else
+#define __ALIGNMENT_ARG
+#define __ALIGNMENT_COUNT(a,b) a
+#endif
+
+/* Provide a common macro to pass 64-bit value on syscalls. */
+#if __WORDSIZE == 64 || defined __ASSUME_WORDSIZE64_ILP32
+# define SYSCALL_LL(val) (val)
+# define SYSCALL_LL64(val) (val)
+#else
+#define SYSCALL_LL(val) \
+ __LONG_LONG_PAIR ((val) >> 31, (val))
+#define SYSCALL_LL64(val) \
+ __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), \
+ (long) (((uint64_t) (val)) >> 32)
+
+/* Exports the __send symbol on send.c linux implementation (some ABI have
+ it missing due the usage of a old generic version without it). */
+#define HAVE_INTERNAL_SEND_SYMBOL 1
diff --git a/sysdeps/unix/sysv/linux/system.c b/sysdeps/unix/sysv/linux/system.c
index 541c565c99..7cc68a1528 100644
--- a/sysdeps/unix/sysv/linux/system.c
+++ b/sysdeps/unix/sysv/linux/system.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tcdrain.c b/sysdeps/unix/sysv/linux/tcdrain.c
index 8455ef946e..b6c110b828 100644
--- a/sysdeps/unix/sysv/linux/tcdrain.c
+++ b/sysdeps/unix/sysv/linux/tcdrain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tcflow.c b/sysdeps/unix/sysv/linux/tcflow.c
index 4a784ab7e8..218cc8594e 100644
--- a/sysdeps/unix/sysv/linux/tcflow.c
+++ b/sysdeps/unix/sysv/linux/tcflow.c
@@ -1,5 +1,5 @@
/* tcflow -- Suspend or restart transmission on termios file descriptor.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tcflush.c b/sysdeps/unix/sysv/linux/tcflush.c
index b2509bd0c2..b5a447d6e8 100644
--- a/sysdeps/unix/sysv/linux/tcflush.c
+++ b/sysdeps/unix/sysv/linux/tcflush.c
@@ -1,5 +1,5 @@
/* tcflush -- Flush pending data on termios file descriptor. Linux version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tcgetattr.c b/sysdeps/unix/sysv/linux/tcgetattr.c
index 57f06f5da4..9748bc8cc4 100644
--- a/sysdeps/unix/sysv/linux/tcgetattr.c
+++ b/sysdeps/unix/sysv/linux/tcgetattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -76,4 +76,5 @@ __tcgetattr (int fd, struct termios *termios_p)
return retval;
}
+libc_hidden_def (__tcgetattr)
weak_alias (__tcgetattr, tcgetattr)
diff --git a/sysdeps/unix/sysv/linux/tcsendbrk.c b/sysdeps/unix/sysv/linux/tcsendbrk.c
index 1ff6c51aed..36ff933ccf 100644
--- a/sysdeps/unix/sysv/linux/tcsendbrk.c
+++ b/sysdeps/unix/sysv/linux/tcsendbrk.c
@@ -1,5 +1,5 @@
/* Send break to terminal.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tcsetattr.c b/sysdeps/unix/sysv/linux/tcsetattr.c
index f5fbb276dd..a916e70253 100644
--- a/sysdeps/unix/sysv/linux/tcsetattr.c
+++ b/sysdeps/unix/sysv/linux/tcsetattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -41,7 +41,7 @@
/* Set the state of FD to *TERMIOS_P. */
int
-tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
+__tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
{
struct __kernel_termios k_termios;
unsigned long int cmd;
@@ -77,4 +77,5 @@ tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
return INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios);
}
+weak_alias (__tcsetattr, tcsetattr)
libc_hidden_def (tcsetattr)
diff --git a/sysdeps/unix/sysv/linux/tee.c b/sysdeps/unix/sysv/linux/tee.c
new file mode 100644
index 0000000000..14294442c7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tee.c
@@ -0,0 +1,26 @@
+/* Linux duplicating pipe content implementation.
+ Copyright (C) 2017-2018 Free Software 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-cancel.h>
+
+ssize_t
+tee (int src, int dest, size_t len, unsigned int flags)
+{
+ return SYSCALL_CANCEL (tee, src, dest, len, flags);
+}
diff --git a/sysdeps/unix/sysv/linux/test-errno-linux.c b/sysdeps/unix/sysv/linux/test-errno-linux.c
new file mode 100644
index 0000000000..be1135351d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/test-errno-linux.c
@@ -0,0 +1,181 @@
+/* Test that failing system calls do set errno to the correct value.
+ Linux sycalls version.
+
+ Copyright (C) 2017-2018 Free Software 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 <array_length.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <mqueue.h>
+#include <sched.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#include <sys/epoll.h>
+#include <sys/eventfd.h>
+#include <sys/file.h>
+#include <sys/fsuid.h>
+#include <sys/inotify.h>
+#include <sys/mman.h>
+#include <sys/poll.h>
+#include <sys/quota.h>
+#include <sys/resource.h>
+#include <sys/select.h>
+#include <sys/sendfile.h>
+#include <sys/swap.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+/* This is not an exhaustive test: only system calls that can be
+ persuaded to fail with a consistent error code and no side effects
+ are included. Usually these are failures due to invalid arguments,
+ with errno code EBADF or EINVAL. The order of argument checks is
+ unspecified, so we must take care to provide arguments that only
+ allow _one_ failure mode.
+
+ Note that all system calls that can fail with EFAULT are permitted
+ to deliver a SIGSEGV signal instead, so we avoid supplying invalid
+ pointers in general, and we do not attempt to test system calls
+ that can only fail with EFAULT (e.g. gettimeofday, gethostname).
+
+ Also note that root-only system calls (e.g. acct, reboot) may, when
+ the test is run as an unprivileged user, fail due to insufficient
+ privileges before bothering to do argument checks, so those are not
+ tested either.
+
+ Also, system calls that take enum or a set of flags as argument is
+ not tested if POSIX doesn't specify exact binary values for all
+ flags, and so any value passed to flags may become valid.
+
+ Some tests assume "/bin/sh" names a file that exists and is not a
+ directory. */
+
+/* Evalutes to the arguments in a list initializer which can be used
+ as a single macro argument. */
+#define LIST(...) { __VA_ARGS__ }
+
+/* This macro is necessary to forward the output of LIST as a macro
+ argument. */
+#define LIST_FORWARD(...) __VA_ARGS__
+
+/* Return true if CODE is contained in the array [CODES, CODES +
+ COUNT]. */
+static bool
+check_error_in_list (int code, int *codes, size_t count)
+{
+ for (size_t i = 0; i < count; ++i)
+ if (codes[i] == code)
+ return true;
+ return false;
+}
+
+#define test_wrp_rv(rtype, prtype, experr_list, syscall, ...) \
+ (__extension__ ({ \
+ errno = 0xdead; \
+ int experr[] = experr_list; \
+ rtype ret = syscall (__VA_ARGS__); \
+ int err = errno; \
+ int fail; \
+ if ((ret == (rtype) -1) \
+ && check_error_in_list (err, experr, array_length (experr))) \
+ fail = 0; \
+ else \
+ { \
+ fail = 1; \
+ if (ret != (rtype) -1) \
+ printf ("FAIL: " #syscall ": didn't fail as expected" \
+ " (return "prtype")\n", ret); \
+ else if (err == 0xdead) \
+ puts ("FAIL: " #syscall ": didn't update errno"); \
+ else \
+ printf ("FAIL: " #syscall \
+ ": errno is: %d (%s) expected one of %s\n", \
+ err, strerror (err), #experr_list); \
+ } \
+ fail; \
+ }))
+
+#define test_wrp(experr, syscall, ...) \
+ test_wrp_rv(int, "%d", LIST (experr), syscall, __VA_ARGS__)
+
+#define test_wrp2(experr, syscall, ...) \
+ test_wrp_rv(int, "%d", LIST_FORWARD (experr), syscall, __VA_ARGS__)
+
+static int
+do_test (void)
+{
+ fd_set rs, ws, es;
+ int status;
+ off_t off;
+ stack_t ss;
+ struct dqblk dqblk;
+ struct epoll_event epoll_event;
+ struct pollfd pollfd;
+ struct sched_param sch_param;
+ struct timespec ts;
+ struct timeval tv;
+ unsigned char vec[16];
+ ss.ss_flags = ~SS_DISABLE;
+ ts.tv_sec = -1;
+
+ int fails = 0;
+ fails |= test_wrp (EINVAL, epoll_create, -1);
+ fails |= test_wrp (EINVAL, epoll_create1, EPOLL_CLOEXEC + 1);
+ fails |= test_wrp (EBADF, epoll_ctl, -1, EPOLL_CTL_ADD, 0, &epoll_event);
+ fails |= test_wrp (EBADF, epoll_wait, -1, &epoll_event, 1, 1);
+ fails |= test_wrp (EBADF, fdatasync, -1);
+ fails |= test_wrp (EBADF, flock, -1, LOCK_SH);
+ fails |= test_wrp (ESRCH, getpgid, -1);
+ /* Linux v3.8 (676a0675c) removed the test to check at least one valid
+ bit in flags (to return EINVAL). It was later added back in v3.9
+ (04df32fa1). */
+ fails |= test_wrp2 (LIST (EINVAL, EBADF), inotify_add_watch, -1, "/", 0);
+ fails |= test_wrp (EINVAL, mincore, (void *) -1, 0, vec);
+ /* mlock fails if the result of the addition addr+len was less than addr
+ (which indicates final address overflow), however on 32 bits binaries
+ running on 64 bits kernels, internal syscall address check won't result
+ in an invalid address and thus syscalls fails later in vma
+ allocation. */
+ fails |= test_wrp2 (LIST (EINVAL, ENOMEM), mlock, (void *) -1, 1);
+ fails |= test_wrp (EINVAL, nanosleep, &ts, &ts);
+ fails |= test_wrp (EINVAL, poll, &pollfd, -1, 0);
+ /* quotactl returns ENOSYS for kernels not configured with
+ CONFIG_QUOTA, and may return EPERM if called within certain types
+ of containers. */
+ fails |= test_wrp2 (LIST (ENODEV, ENOSYS, EPERM),
+ quotactl, Q_GETINFO, NULL, -1, (caddr_t) &dqblk);
+ fails |= test_wrp (EINVAL, sched_getparam, -1, &sch_param);
+ fails |= test_wrp (EINVAL, sched_getscheduler, -1);
+ fails |= test_wrp (EINVAL, sched_get_priority_max, -1);
+ fails |= test_wrp (EINVAL, sched_get_priority_min, -1);
+ fails |= test_wrp (EINVAL, sched_rr_get_interval, -1, &ts);
+ fails |= test_wrp (EINVAL, sched_setparam, -1, &sch_param);
+ fails |= test_wrp (EINVAL, sched_setscheduler, -1, 0, &sch_param);
+ fails |= test_wrp (EINVAL, select, -1, &rs, &ws, &es, &tv);
+ fails |= test_wrp (EBADF, sendfile, -1, -1, &off, 0);
+ fails |= test_wrp (EINVAL, sigaltstack, &ss, NULL);
+ fails |= test_wrp (ECHILD, wait4, -1, &status, 0, NULL);
+
+ return fails;
+}
+
+#include "support/test-driver.c"
diff --git a/sysdeps/unix/sysv/linux/tile/Implies b/sysdeps/unix/sysv/linux/tile/Implies
deleted file mode 100644
index e050152859..0000000000
--- a/sysdeps/unix/sysv/linux/tile/Implies
+++ /dev/null
@@ -1 +0,0 @@
-tile/nptl
diff --git a/sysdeps/unix/sysv/linux/tile/Makefile b/sysdeps/unix/sysv/linux/tile/Makefile
deleted file mode 100644
index 1c1cfff280..0000000000
--- a/sysdeps/unix/sysv/linux/tile/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-ifeq ($(subdir),misc)
-
-# <sys/reg.h> provides something like x86 compatibility.
-# New code should probably use <arch/abi.h> instead.
-sysdep_headers += sys/reg.h
-
-# MIPS-style cacheflush routine
-sysdep_headers += sys/cachectl.h
-sysdep_routines += cacheflush
-
-# Control dataplane properties of current thread.
-sysdep_headers += sys/dataplane.h
-sysdep_routines += set_dataplane
-
-endif
-
-ifeq ($(subdir),elf)
-sysdep_routines += dl-vdso
-ifeq ($(build-shared),yes)
-# This is needed for DSO loading from static binaries.
-sysdep-dl-routines += dl-static
-endif
-endif
-
-ifeq ($(subdir),nptl)
-# pull in __syscall_error routine
-libpthread-routines += sysdep
-endif
diff --git a/sysdeps/unix/sysv/linux/tile/Versions b/sysdeps/unix/sysv/linux/tile/Versions
deleted file mode 100644
index 13da68fa79..0000000000
--- a/sysdeps/unix/sysv/linux/tile/Versions
+++ /dev/null
@@ -1,18 +0,0 @@
-ld {
- GLIBC_PRIVATE {
- # used for loading by static libraries
- _dl_var_init;
- }
-}
-libc {
- GLIBC_2.12 {
- _flush_cache;
- cacheflush;
- fallocate64;
- set_dataplane;
- }
- GLIBC_PRIVATE {
- __syscall_error;
- __vdso_clock_gettime;
- }
-}
diff --git a/sysdeps/unix/sysv/linux/tile/arch-fork.h b/sysdeps/unix/sysv/linux/tile/arch-fork.h
deleted file mode 100644
index fec5910c69..0000000000
--- a/sysdeps/unix/sysv/linux/tile/arch-fork.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* ARCH_FORK definition for Linux fork implementation. Tile* version.
- 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.
- Based on work 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 <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 4, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
- 0, NULL, &THREAD_SELF->tid)
diff --git a/sysdeps/unix/sysv/linux/tile/bits/environments.h b/sysdeps/unix/sysv/linux/tile/bits/environments.h
deleted file mode 100644
index abe56505f0..0000000000
--- a/sysdeps/unix/sysv/linux/tile/bits/environments.h
+++ /dev/null
@@ -1,100 +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/>. */
-
-#ifndef _UNISTD_H
-# error "Never include this file directly. Use <unistd.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-/* This header should define the following symbols under the described
- situations. A value `1' means that the model is always supported,
- `-1' means it is never supported. Undefined means it cannot be
- statically decided.
-
- _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type
- _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type
-
- _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type
- _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type
-
- The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
- _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
- _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
- used in previous versions of the Unix standard and are available
- only for compatibility.
-*/
-
-#if __WORDSIZE == 64
-
-/* Environments with 32-bit wide pointers are optionally provided.
- Therefore following macros aren't defined:
- # undef _POSIX_V7_ILP32_OFF32
- # undef _POSIX_V7_ILP32_OFFBIG
- # undef _POSIX_V6_ILP32_OFF32
- # undef _POSIX_V6_ILP32_OFFBIG
- # undef _XBS5_ILP32_OFF32
- # undef _XBS5_ILP32_OFFBIG
- and users need to check at runtime. */
-
-/* We also have no use (for now) for an environment with bigger pointers
- and offsets. */
-# define _POSIX_V7_LPBIG_OFFBIG -1
-# define _POSIX_V6_LPBIG_OFFBIG -1
-# define _XBS5_LPBIG_OFFBIG -1
-
-/* By default we have 64-bit wide `long int', pointers and `off_t'. */
-# define _POSIX_V7_LP64_OFF64 1
-# define _POSIX_V6_LP64_OFF64 1
-# define _XBS5_LP64_OFF64 1
-
-#else /* __WORDSIZE == 32 */
-
-/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
- and all platforms support LFS. */
-# define _POSIX_V7_ILP32_OFF32 1
-# define _POSIX_V7_ILP32_OFFBIG 1
-# define _POSIX_V6_ILP32_OFF32 1
-# define _POSIX_V6_ILP32_OFFBIG 1
-# define _XBS5_ILP32_OFF32 1
-# define _XBS5_ILP32_OFFBIG 1
-
-/* We optionally provide an environment with the above size but an 64-bit
- side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */
-
-/* Environments with 64-bit wide pointers can be provided,
- so these macros aren't defined:
- # undef _POSIX_V7_LP64_OFF64
- # undef _POSIX_V7_LPBIG_OFFBIG
- # undef _POSIX_V6_LP64_OFF64
- # undef _POSIX_V6_LPBIG_OFFBIG
- # undef _XBS5_LP64_OFF64
- # undef _XBS5_LPBIG_OFFBIG
- and sysconf tests for it at runtime. */
-
-#endif /* __WORDSIZE == 32 */
-
-#ifdef __tilegx__
-/* Only TILE-Gx has the ability to choose 32- or 64-bit. */
-#define __ILP32_OFF32_CFLAGS "-m32"
-#define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-#define __ILP32_OFF32_LDFLAGS "-m32"
-#define __ILP32_OFFBIG_LDFLAGS "-m32"
-#define __LP64_OFF64_CFLAGS "-m64"
-#define __LP64_OFF64_LDFLAGS "-m64"
-#endif
diff --git a/sysdeps/unix/sysv/linux/tile/bits/local_lim.h b/sysdeps/unix/sysv/linux/tile/bits/local_lim.h
deleted file mode 100644
index b27e3de97c..0000000000
--- a/sysdeps/unix/sysv/linux/tile/bits/local_lim.h
+++ /dev/null
@@ -1,100 +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/>. */
-
-/* The kernel header pollutes the namespace with the NR_OPEN symbol
- and defines LINK_MAX although filesystems have different maxima. A
- similar thing is true for OPEN_MAX: the limit can be changed at
- runtime and therefore the macro must not be defined. Remove this
- after including the header if necessary. */
-#ifndef NR_OPEN
-# define __undef_NR_OPEN
-#endif
-#ifndef LINK_MAX
-# define __undef_LINK_MAX
-#endif
-#ifndef OPEN_MAX
-# define __undef_OPEN_MAX
-#endif
-#ifndef ARG_MAX
-# define __undef_ARG_MAX
-#endif
-
-/* The kernel sources contain a file with all the needed information. */
-#include <linux/limits.h>
-
-/* Have to remove NR_OPEN? */
-#ifdef __undef_NR_OPEN
-# undef NR_OPEN
-# undef __undef_NR_OPEN
-#endif
-/* Have to remove LINK_MAX? */
-#ifdef __undef_LINK_MAX
-# undef LINK_MAX
-# undef __undef_LINK_MAX
-#endif
-/* Have to remove OPEN_MAX? */
-#ifdef __undef_OPEN_MAX
-# undef OPEN_MAX
-# undef __undef_OPEN_MAX
-#endif
-/* Have to remove ARG_MAX? */
-#ifdef __undef_ARG_MAX
-# undef ARG_MAX
-# undef __undef_ARG_MAX
-#endif
-
-/* The number of data keys per process. */
-#define _POSIX_THREAD_KEYS_MAX 128
-/* This is the value this implementation supports. */
-#define PTHREAD_KEYS_MAX 1024
-
-/* Controlling the iterations of destructors for thread-specific data. */
-#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
-/* Number of iterations this implementation does. */
-#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
-
-/* The number of threads per process. */
-#define _POSIX_THREAD_THREADS_MAX 64
-/* We have no predefined limit on the number of threads. */
-#undef PTHREAD_THREADS_MAX
-
-/* Maximum amount by which a process can descrease its asynchronous I/O
- priority level. */
-#define AIO_PRIO_DELTA_MAX 20
-
-/* Minimum size for a thread. At least two pages for systems with 64k
- pages. */
-#define PTHREAD_STACK_MIN 131072
-
-/* Maximum number of timer expiration overruns. */
-#define DELAYTIMER_MAX 2147483647
-
-/* Maximum tty name length. */
-#define TTY_NAME_MAX 32
-
-/* Maximum login name length. This is arbitrary. */
-#define LOGIN_NAME_MAX 256
-
-/* Maximum host name length. */
-#define HOST_NAME_MAX 64
-
-/* Maximum message queue priority level. */
-#define MQ_PRIO_MAX 32768
-
-/* Maximum value the semaphore can have. */
-#define SEM_VALUE_MAX (2147483647)
diff --git a/sysdeps/unix/sysv/linux/tile/bits/mman.h b/sysdeps/unix/sysv/linux/tile/bits/mman.h
deleted file mode 100644
index efb6d7deec..0000000000
--- a/sysdeps/unix/sysv/linux/tile/bits/mman.h
+++ /dev/null
@@ -1,40 +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/>. */
-
-#ifndef _SYS_MMAN_H
-# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
-#endif
-
-/* The following definitions basically come from the kernel headers.
- But the kernel header is not namespace clean. */
-
-#ifdef __USE_MISC
-/* These are Linux-specific. */
-# define MAP_NONBLOCK 0x00080 /* Do not block on IO. */
-# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
-# define MAP_STACK MAP_GROWSDOWN /* Provide convenience alias. */
-# define MAP_LOCKED 0x00200 /* Lock the mapping. */
-# define MAP_NORESERVE 0x00400 /* Don't check for reservations. */
-# define MAP_DENYWRITE 0x00800 /* ETXTBSY */
-# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
-# define MAP_POPULATE 0x00040 /* Populate (prefault) pagetables. */
-# define MAP_HUGETLB 0x04000 /* Create huge page mapping. */
-#endif
-
-/* Include generic Linux declarations. */
-#include <bits/mman-linux.h>
diff --git a/sysdeps/unix/sysv/linux/tile/bits/sigaction.h b/sysdeps/unix/sysv/linux/tile/bits/sigaction.h
deleted file mode 100644
index 04e6b05b1a..0000000000
--- a/sysdeps/unix/sysv/linux/tile/bits/sigaction.h
+++ /dev/null
@@ -1,77 +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/>. */
-
-#ifndef _SIGNAL_H
-# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
-#endif
-
-/* Structure describing the action to be taken when a signal arrives. */
-struct sigaction
- {
- /* Signal handler. */
-#ifdef __USE_POSIX199309
- union
- {
- /* Used if SA_SIGINFO is not set. */
- __sighandler_t sa_handler;
- /* Used if SA_SIGINFO is set. */
- void (*sa_sigaction) (int, siginfo_t *, void *);
- }
- __sigaction_handler;
-# define sa_handler __sigaction_handler.sa_handler
-# define sa_sigaction __sigaction_handler.sa_sigaction
-#else
- __sighandler_t sa_handler;
-#endif
-
- /* Additional set of signals to be blocked. */
- __sigset_t sa_mask;
-
- /* Special flags. */
- int sa_flags;
-
- /* Restore handler. */
- void (*sa_restorer) (void);
- };
-
-/* Bits in `sa_flags'. */
-#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */
-#define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */
-#define SA_SIGINFO 4 /* Invoke signal-catching function with
- three arguments instead of one. */
-#if defined __USE_UNIX98 || defined __USE_MISC
-# define SA_NOPTRACE 0x02000000 /* Don't ptrace this signal. */
-# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
-# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
-# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
- its handler is being executed. */
-# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
-#endif
-#ifdef __USE_MISC
-# define SA_INTERRUPT 0x20000000 /* Historical no-op. */
-
-/* Some aliases for the SA_ constants. */
-# define SA_NOMASK SA_NODEFER
-# define SA_ONESHOT SA_RESETHAND
-# define SA_STACK SA_ONSTACK
-#endif
-
-/* Values for the HOW argument to `sigprocmask'. */
-#define SIG_BLOCK 0 /* Block signals. */
-#define SIG_UNBLOCK 1 /* Unblock signals. */
-#define SIG_SETMASK 2 /* Set the set of blocked signals. */
diff --git a/sysdeps/unix/sysv/linux/tile/bits/siginfo.h b/sysdeps/unix/sysv/linux/tile/bits/siginfo.h
deleted file mode 100644
index 17df7633b3..0000000000
--- a/sysdeps/unix/sysv/linux/tile/bits/siginfo.h
+++ /dev/null
@@ -1,347 +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/>. */
-
-#if !defined _SIGNAL_H && !defined __need_siginfo_t \
- && !defined __need_sigevent_t
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-#if (!defined __have_sigval_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t \
- || defined __need_sigevent_t))
-# define __have_sigval_t 1
-
-/* Type for data associated with a signal. */
-typedef union sigval
- {
- int sival_int;
- void *sival_ptr;
- } sigval_t;
-#endif
-
-#if (!defined __have_siginfo_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t))
-# define __have_siginfo_t 1
-
-# define __SI_MAX_SIZE 128
-# if __WORDSIZE == 64
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-typedef struct
- {
- int si_signo; /* Signal number. */
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int si_code; /* Signal code. */
-
- union
- {
- int _pad[__SI_PAD_SIZE];
-
- /* kill(). */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- } _kill;
-
- /* POSIX.1b timers. */
- struct
- {
- int si_tid; /* Timer ID. */
- int si_overrun; /* Overrun count. */
- sigval_t si_sigval; /* Signal value. */
- } _timer;
-
- /* POSIX.1b signals. */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- sigval_t si_sigval; /* Signal value. */
- } _rt;
-
- /* SIGCHLD. */
- struct
- {
- __pid_t si_pid; /* Which child. */
- __uid_t si_uid; /* Real user ID of sending process. */
- int si_status; /* Exit value or signal. */
- __clock_t si_utime;
- __clock_t si_stime;
- } _sigchld;
-
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
- struct
- {
- void *si_addr; /* Faulting insn/memory ref. */
- int si_trapno; /* TRAP # which caused the signal. */
- short int si_addr_lsb; /* Valid LSB of the reported address. */
- } _sigfault;
-
- /* SIGPOLL. */
- struct
- {
- long int si_band; /* Band event for SIGPOLL. */
- int si_fd;
- } _sigpoll;
-
- /* SIGSYS. */
- struct
- {
- void *_call_addr; /* Calling user insn. */
- int _syscall; /* Triggering system call number. */
- unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
- } _sigsys;
- } _sifields;
- } siginfo_t;
-
-
-/* X/Open requires some more fields with fixed names. */
-# define si_pid _sifields._kill.si_pid
-# define si_uid _sifields._kill.si_uid
-# define si_timerid _sifields._timer.si_tid
-# define si_overrun _sifields._timer.si_overrun
-# define si_status _sifields._sigchld.si_status
-# define si_utime _sifields._sigchld.si_utime
-# define si_stime _sifields._sigchld.si_stime
-# define si_value _sifields._rt.si_sigval
-# define si_int _sifields._rt.si_sigval.sival_int
-# define si_ptr _sifields._rt.si_sigval.sival_ptr
-# define si_addr _sifields._sigfault.si_addr
-# define si_trapno _sifields._sigfault.si_trapno
-# define si_addr_lsb _sifields._sigfault.si_addr_lsb
-# define si_band _sifields._sigpoll.si_band
-# define si_fd _sifields._sigpoll.si_fd
-# define si_call_addr _sifields._sigsys._call_addr
-# define si_syscall _sifields._sigsys._syscall
-# define si_arch _sifields._sigsys._arch
-
-
-/* Values for `si_code'. Positive values are reserved for kernel-generated
- signals. */
-enum
-{
- SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
-# define SI_ASYNCNL SI_ASYNCNL
- SI_TKILL = -6, /* Sent by tkill. */
-# define SI_TKILL SI_TKILL
- SI_SIGIO, /* Sent by queued SIGIO. */
-# define SI_SIGIO SI_SIGIO
- SI_ASYNCIO, /* Sent by AIO completion. */
-# define SI_ASYNCIO SI_ASYNCIO
- SI_MESGQ, /* Sent by real time mesq state change. */
-# define SI_MESGQ SI_MESGQ
- SI_TIMER, /* Sent by timer expiration. */
-# define SI_TIMER SI_TIMER
- SI_QUEUE, /* Sent by sigqueue. */
-# define SI_QUEUE SI_QUEUE
- SI_USER, /* Sent by kill, sigsend, raise. */
-# define SI_USER SI_USER
- SI_KERNEL = 0x80 /* Send by kernel. */
-#define SI_KERNEL SI_KERNEL
-};
-
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGILL signal. */
-enum
-{
- ILL_ILLOPC = 1, /* Illegal opcode. */
-# define ILL_ILLOPC ILL_ILLOPC
- ILL_ILLOPN, /* Illegal operand. */
-# define ILL_ILLOPN ILL_ILLOPN
- ILL_ILLADR, /* Illegal addressing mode. */
-# define ILL_ILLADR ILL_ILLADR
- ILL_ILLTRP, /* Illegal trap. */
-# define ILL_ILLTRP ILL_ILLTRP
- ILL_PRVOPC, /* Privileged opcode. */
-# define ILL_PRVOPC ILL_PRVOPC
- ILL_PRVREG, /* Privileged register. */
-# define ILL_PRVREG ILL_PRVREG
- ILL_COPROC, /* Coprocessor error. */
-# define ILL_COPROC ILL_COPROC
- ILL_BADSTK, /* Internal stack error. */
-# define ILL_BADSTK ILL_BADSTK
- ILL_DBLFLT, /* Double fault. */
-# define ILL_DBLFLT ILL_DBLFLT
- ILL_HARDWALL /* User networks hardwall violation. */
-# define ILL_HARDWALL ILL_HARDWALL
-};
-
-/* `si_code' values for SIGFPE signal. */
-enum
-{
- FPE_INTDIV = 1, /* Integer divide by zero. */
-# define FPE_INTDIV FPE_INTDIV
- FPE_INTOVF, /* Integer overflow. */
-# define FPE_INTOVF FPE_INTOVF
- FPE_FLTDIV, /* Floating point divide by zero. */
-# define FPE_FLTDIV FPE_FLTDIV
- FPE_FLTOVF, /* Floating point overflow. */
-# define FPE_FLTOVF FPE_FLTOVF
- FPE_FLTUND, /* Floating point underflow. */
-# define FPE_FLTUND FPE_FLTUND
- FPE_FLTRES, /* Floating point inexact result. */
-# define FPE_FLTRES FPE_FLTRES
- FPE_FLTINV, /* Floating point invalid operation. */
-# define FPE_FLTINV FPE_FLTINV
- FPE_FLTSUB /* Subscript out of range. */
-# define FPE_FLTSUB FPE_FLTSUB
-};
-
-/* `si_code' values for SIGSEGV signal. */
-enum
-{
- SEGV_MAPERR = 1, /* Address not mapped to object. */
-# define SEGV_MAPERR SEGV_MAPERR
- SEGV_ACCERR /* Invalid permissions for mapped object. */
-# define SEGV_ACCERR SEGV_ACCERR
-};
-
-/* `si_code' values for SIGBUS signal. */
-enum
-{
- BUS_ADRALN = 1, /* Invalid address alignment. */
-# define BUS_ADRALN BUS_ADRALN
- BUS_ADRERR, /* Non-existant physical address. */
-# define BUS_ADRERR BUS_ADRERR
- BUS_OBJERR, /* Object specific hardware error. */
-# define BUS_OBJERR BUS_OBJERR
- BUS_MCEERR_AR, /* Hardware memory error: action required. */
-# define BUS_MCEERR_AR BUS_MCEERR_AR
- BUS_MCEERR_AO /* Hardware memory error: action optional. */
-# define BUS_MCEERR_AO BUS_MCEERR_AO
-};
-# endif
-
-# ifdef __USE_XOPEN_EXTENDED
-/* `si_code' values for SIGTRAP signal. */
-enum
-{
- TRAP_BRKPT = 1, /* Process breakpoint. */
-# define TRAP_BRKPT TRAP_BRKPT
- TRAP_TRACE /* Process trace trap. */
-# define TRAP_TRACE TRAP_TRACE
-};
-# endif
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGCHLD signal. */
-enum
-{
- CLD_EXITED = 1, /* Child has exited. */
-# define CLD_EXITED CLD_EXITED
- CLD_KILLED, /* Child was killed. */
-# define CLD_KILLED CLD_KILLED
- CLD_DUMPED, /* Child terminated abnormally. */
-# define CLD_DUMPED CLD_DUMPED
- CLD_TRAPPED, /* Traced child has trapped. */
-# define CLD_TRAPPED CLD_TRAPPED
- CLD_STOPPED, /* Child has stopped. */
-# define CLD_STOPPED CLD_STOPPED
- CLD_CONTINUED /* Stopped child has continued. */
-# define CLD_CONTINUED CLD_CONTINUED
-};
-
-/* `si_code' values for SIGPOLL signal. */
-enum
-{
- POLL_IN = 1, /* Data input available. */
-# define POLL_IN POLL_IN
- POLL_OUT, /* Output buffers available. */
-# define POLL_OUT POLL_OUT
- POLL_MSG, /* Input message available. */
-# define POLL_MSG POLL_MSG
- POLL_ERR, /* I/O error. */
-# define POLL_ERR POLL_ERR
- POLL_PRI, /* High priority input available. */
-# define POLL_PRI POLL_PRI
- POLL_HUP /* Device disconnected. */
-# define POLL_HUP POLL_HUP
-};
-# endif
-
-# undef __need_siginfo_t
-#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
-
-
-#if (defined _SIGNAL_H || defined __need_sigevent_t) \
- && !defined __have_sigevent_t
-# define __have_sigevent_t 1
-
-/* Structure to transport application-defined values with signals. */
-# define __SIGEV_MAX_SIZE 64
-# if __WORDSIZE == 64
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-/* Forward declaration. */
-# ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-# endif
-
-typedef struct sigevent
- {
- sigval_t sigev_value;
- int sigev_signo;
- int sigev_notify;
-
- union
- {
- int _pad[__SIGEV_PAD_SIZE];
-
- /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
- thread to receive the signal. */
- __pid_t _tid;
-
- struct
- {
- void (*_function) (sigval_t); /* Function to start. */
- pthread_attr_t *_attribute; /* Thread attributes. */
- } _sigev_thread;
- } _sigev_un;
- } sigevent_t;
-
-/* POSIX names to access some of the members. */
-# define sigev_notify_function _sigev_un._sigev_thread._function
-# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
-
-/* `sigev_notify' values. */
-enum
-{
- SIGEV_SIGNAL = 0, /* Notify via signal. */
-# define SIGEV_SIGNAL SIGEV_SIGNAL
- SIGEV_NONE, /* Other notification: meaningless. */
-# define SIGEV_NONE SIGEV_NONE
- SIGEV_THREAD, /* Deliver via thread creation. */
-# define SIGEV_THREAD SIGEV_THREAD
-
- SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
-#define SIGEV_THREAD_ID SIGEV_THREAD_ID
-};
-
-#endif /* have _SIGNAL_H. */
diff --git a/sysdeps/unix/sysv/linux/tile/cacheflush.c b/sysdeps/unix/sysv/linux/tile/cacheflush.c
deleted file mode 100644
index 5398f05936..0000000000
--- a/sysdeps/unix/sysv/linux/tile/cacheflush.c
+++ /dev/null
@@ -1,34 +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 <stddef.h>
-#include <unistd.h>
-
-/* Flush cache(s). */
-int
-_flush_cache (char *addr, const int nbytes, const int op)
-{
-#ifdef __NR_cacheflush
- return INLINE_SYSCALL (cacheflush, 3, addr, nbytes, op);
-#else
- __set_errno (ENOSYS);
- return -1;
-#endif
-}
-weak_alias (_flush_cache, cacheflush)
diff --git a/sysdeps/unix/sysv/linux/tile/clone.S b/sysdeps/unix/sysv/linux/tile/clone.S
deleted file mode 100644
index 02fe3a8670..0000000000
--- a/sysdeps/unix/sysv/linux/tile/clone.S
+++ /dev/null
@@ -1,222 +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/>. */
-
-/* clone() is even more special than fork() as it mucks with stacks
- and invokes a function in the right context after it's all over. */
-
-#include <sysdep.h>
-#define _ERRNO_H 1
-#include <bits/errno.h>
-
-#include <asm/unistd.h>
-#include <arch/abi.h>
-#include <tls.h>
-#include <linux/sched.h>
-
-/* What we save where in the stack frame; must include all callee-saves. */
-#define FRAME_NEXT_LR (0 * REGSIZE) /* reserved by ABI; not used here */
-#define FRAME_SP (1 * REGSIZE)
-#define FRAME_R30 (2 * REGSIZE)
-#define FRAME_R31 (3 * REGSIZE)
-#define FRAME_R32 (4 * REGSIZE)
-#define FRAME_SIZE (5 * REGSIZE)
-
-/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
- pid_t *ptid, struct user_desc *tls, pid_t *ctid); */
-
- .text
-ENTRY (__clone)
- /* Create a stack frame so we can pass callee-saves to new task. */
- {
- move r10, sp
- ST sp, lr
- ADDI_PTR sp, sp, -FRAME_SIZE
- }
- cfi_offset (lr, 0)
- cfi_def_cfa_offset (FRAME_SIZE)
- ADDI_PTR r11, sp, FRAME_SP
- {
- ST r11, r10
- ADDI_PTR r11, sp, FRAME_R30
- }
- {
- ST r11, r30
- ADDI_PTR r11, sp, FRAME_R31
- }
- cfi_offset (r30, FRAME_R30 - FRAME_SIZE)
- {
- ST r11, r31
- ADDI_PTR r11, sp, FRAME_R32
- }
- cfi_offset (r31, FRAME_R31 - FRAME_SIZE)
- ST r11, r32
- cfi_offset (r32, FRAME_R32 - FRAME_SIZE)
-
- /* sanity check arguments */
- BEQZ r0, .Linvalid
- BEQZ r1, .Linvalid
-
- /* Make sure child stack is properly aligned, and set up the
- top frame so that we can call out of it immediately in the
- child. Setting it up here means we fault in the parent if
- it's bogus, which is probably cleaner than faulting first
- thing in the child. */
- ADDI_PTR r1, r1, -C_ABI_SAVE_AREA_SIZE
- andi r1, r1, -C_ABI_SAVE_AREA_SIZE
- ADDI_PTR r9, r1, REGSIZE /* sp of this frame on entry, i.e. zero */
- ST r9, zero
-
- /* We need to switch the argument convention around from
- libc to kernel:
-
- libc:
- r0 fn
- r1 child_stack
- r2 flags
- r3 arg
- r4 ptid
- r5 tls
- r6 ctid
-
- kernel:
- r0 flags
- r1 child_stack [same as libc]
- r2 ptid
- r3 ctid
- r4 tls
-
- Plus the callee-saves as described at .Lthread_start, below. */
- {
- move r32, r0
- move r0, r2
- }
- {
- move r31, r3
- move r3, r6
- }
- {
- move r30, r2
- move r2, r4
- }
- {
- move r4, r5
- moveli TREG_SYSCALL_NR_NAME, __NR_clone
- }
- swint1
- BEQZ r0, .Lthread_start /* If in child task. */
-
-.Ldone:
- /* Restore the callee-saved registers and return. */
- ADDLI_PTR lr, sp, FRAME_SIZE
- {
- LD lr, lr
- ADDLI_PTR r30, sp, FRAME_R30
- }
- {
- LD r30, r30
- ADDLI_PTR r31, sp, FRAME_R31
- }
- {
- LD r31, r31
- ADDLI_PTR r32, sp, FRAME_R32
- }
- {
- LD r32, r32
- ADDI_PTR sp, sp, FRAME_SIZE
- }
- cfi_def_cfa_offset (0)
-
- BNEZ r1, .Lerror
- jrp lr
-
-.Lerror:
- j SYSCALL_ERROR_NAME
-
-.Linvalid:
- {
- movei r1, EINVAL
- j .Ldone
- }
-
-/* This function expects to receive:
-
- sp: the top of a valid stack area
- r30: clone() flags
- r31: the argument to pass to the user function
- r32: the user function pointer */
-
-.Lthread_start:
- cfi_def_cfa_offset (FRAME_SIZE)
- cfi_undefined (lr)
- /* Check and see if we need to reset the PID, which we do if
- CLONE_THREAD isn't set, i.e. we're not staying in the thread group.
- If CLONE_VM is set, we're doing some kind of thread-like clone,
- so we set the tid/pid to -1 to disable using the cached values
- in getpid(). Otherwise (if CLONE_VM isn't set), it's a
- fork-like clone, and we go ahead and write the cached values
- from the true system pid (retrieved via __NR_getpid syscall). */
-#ifdef __tilegx__
- {
- moveli r0, hw1_last(CLONE_VM)
- moveli r1, hw1_last(CLONE_THREAD)
- }
- {
- shl16insli r0, r0, hw0(CLONE_VM)
- shl16insli r1, r1, hw0(CLONE_THREAD)
- }
-#else
- {
- moveli r0, lo16(CLONE_VM)
- moveli r1, lo16(CLONE_THREAD)
- }
- {
- auli r0, r0, ha16(CLONE_VM)
- auli r1, r1, ha16(CLONE_THREAD)
- }
-#endif
- {
- and r0, r30, r0
- and r1, r30, r1
- }
- BNEZ r1, .Lno_reset_pid /* CLONE_THREAD is set */
- {
- movei r0, -1
- BNEZ r0, .Lgotpid /* CLONE_VM is set */
- }
- moveli TREG_SYSCALL_NR_NAME, __NR_getpid
- swint1
-.Lgotpid:
- ADDLI_PTR r2, tp, PID_OFFSET
- {
- ST4 r2, r0
- ADDLI_PTR r2, tp, TID_OFFSET
- }
- ST4 r2, r0
-.Lno_reset_pid:
- {
- /* Invoke user function with specified argument. */
- move r0, r31
- jalr r32
- }
- {
- j HIDDEN_JUMPTARGET(_exit)
- info INFO_OP_CANNOT_BACKTRACE /* Notify backtracer to stop. */
- }
-PSEUDO_END (__clone)
-
-weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/tile/getcontext.S b/sysdeps/unix/sysv/linux/tile/getcontext.S
deleted file mode 100644
index ae349dda3e..0000000000
--- a/sysdeps/unix/sysv/linux/tile/getcontext.S
+++ /dev/null
@@ -1,95 +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 <sysdep.h>
-#include <arch/abi.h>
-
-#include "ucontext_i.h"
-
-/* int getcontext (ucontext_t *ucp) */
-
- .text
-ENTRY (__getcontext)
- FEEDBACK_ENTER(__getcontext)
-
- /* Save the callee-saved GPRs. There's no need to save the
- caller-saved GPRs since the eventual setcontext() or
- swapcontext() will assume those registers are all dead.
- Save value "1" to uc_flags to later recognize getcontext(). */
- { movei r11, 1; ADDI_PTR r10, r0, UC_FLAGS_OFFSET }
- { ST_PTR r10, r11; addli r10, r0, UC_REG(30) }
- { ST r10, r30; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r31; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r32; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r33; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r34; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r35; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r36; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r37; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r38; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r39; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r40; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r41; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r42; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r43; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r44; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r45; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r46; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r47; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r48; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r49; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r50; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r51; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, r52; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, tp; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, sp; ADDI_PTR r10, r10, REGSIZE }
- { ST r10, lr; ADDI_PTR r10, r10, REGSIZE }
- lnk r11 /* Point PC at the "jrp lr" instruction. */
- addli r11, r11, .Lreturn - .
- { ST r10, r11; ADDI_PTR r10, r10, REGSIZE }
- mfspr r11, INTERRUPT_CRITICAL_SECTION
- {
- ST r10, r11
- movei r1, 0
- }
-
- /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG / 8) */
- {
- movei r3, _NSIG / 8
- addli r2, r0, UC_SIGMASK_OFFSET
- }
- {
- movei r0, SIG_BLOCK
- moveli TREG_SYSCALL_NR_NAME, __NR_rt_sigprocmask
- }
- swint1
- BNEZ r1, .Lsyscall_error
-
-.Lreturn:
- {
- movei r0, 0
- jrp lr
- }
-
-.Lsyscall_error:
- j SYSCALL_ERROR_NAME
-
-END (__getcontext)
-.hidden __getcontext
-
-weak_alias (__getcontext, getcontext)
diff --git a/sysdeps/unix/sysv/linux/tile/init-first.c b/sysdeps/unix/sysv/linux/tile/init-first.c
deleted file mode 100644
index 8210ca50f4..0000000000
--- a/sysdeps/unix/sysv/linux/tile/init-first.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* 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/>. */
-
-#ifdef SHARED
-#include <dl-vdso.h>
-#include <libc-vdso.h>
-
-struct syscall_return_value (*VDSO_SYMBOL(gettimeofday)) (struct timeval *,
- void *)
- attribute_hidden;
-
-struct syscall_return_value (*VDSO_SYMBOL(clock_gettime)) (clockid_t,
- struct timespec *)
- __attribute__ ((nocommon));
-
-
-static inline void
-_libc_vdso_platform_setup (void)
-{
- PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
-
- void *p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux26);
- PTR_MANGLE (p);
- VDSO_SYMBOL (gettimeofday) = p;
-
- p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux26);
- PTR_MANGLE (p);
- VDSO_SYMBOL (clock_gettime) = p;
-}
-
-#define VDSO_SETUP _libc_vdso_platform_setup
-#endif
-
-#include <csu/init-first.c>
diff --git a/sysdeps/unix/sysv/linux/tile/kernel-features.h b/sysdeps/unix/sysv/linux/tile/kernel-features.h
deleted file mode 100644
index 5e9229585a..0000000000
--- a/sysdeps/unix/sysv/linux/tile/kernel-features.h
+++ /dev/null
@@ -1,33 +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/>. */
-
-
-/* TILE glibc support starts with 2.6.36, guaranteeing many kernel features. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-#define __ASSUME_RECVMMSG_SYSCALL 1
-
-/* Support for the sendmmsg syscall was added in 3.0. */
-#if __LINUX_KERNEL_VERSION >= 0x030000
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
-
-#include_next <kernel-features.h>
-
-/* 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
diff --git a/sysdeps/unix/sysv/linux/tile/ldsodefs.h b/sysdeps/unix/sysv/linux/tile/ldsodefs.h
deleted file mode 100644
index 4392b527e1..0000000000
--- a/sysdeps/unix/sysv/linux/tile/ldsodefs.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Run-time dynamic linker data structures for loaded ELF shared objects. Tile.
- Copyright (C) 2001-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 _LDSODEFS_H
-
-/* Get the real definitions. */
-#include_next <ldsodefs.h>
-
-/* Now define our stuff. */
-
-/* We need special support to initialize DSO loaded for statically linked
- binaries. */
-extern void _dl_static_init (struct link_map *map);
-#undef DL_STATIC_INIT
-#define DL_STATIC_INIT(map) _dl_static_init (map)
-
-#endif /* ldsodefs.h */
diff --git a/sysdeps/unix/sysv/linux/tile/libc-vdso.h b/sysdeps/unix/sysv/linux/tile/libc-vdso.h
deleted file mode 100644
index 02a179ce1d..0000000000
--- a/sysdeps/unix/sysv/linux/tile/libc-vdso.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Resolve function pointers to VDSO 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/>. */
-
-
-#ifndef _LIBC_VDSO_H
-#define _LIBC_VDSO_H
-
-#ifdef SHARED
-
-#include <sysdep-vdso.h>
-
-struct syscall_return_value
-{
- long int value;
- long int error;
-};
-
-extern struct syscall_return_value (*VDSO_SYMBOL (gettimeofday)) (struct
- timeval *,
- void *)
- attribute_hidden;
-
-extern struct syscall_return_value (*VDSO_SYMBOL (clock_gettime)) (clockid_t,
- struct
- timespec *);
-#endif
-#endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/tile/makecontext.c b/sysdeps/unix/sysv/linux/tile/makecontext.c
deleted file mode 100644
index 92c9ccb893..0000000000
--- a/sysdeps/unix/sysv/linux/tile/makecontext.c
+++ /dev/null
@@ -1,67 +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 <stdarg.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <ucontext.h>
-#include <arch/abi.h>
-
-void
-__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
-{
- extern void __startcontext (void);
- uint_reg_t *sp, *args;
- va_list ap;
- int i;
-
- /* Initialize the top of stack. */
- sp = (uint_reg_t *) ((((intptr_t) ucp->uc_stack.ss_sp
- + ucp->uc_stack.ss_size) & -16L) - 16);
-
- /* Allow room for memory-passed arguments if necessary. */
- if (argc > 10)
- sp -= 2 + (argc - 10);
-
- sp[0] = sp[1] = 0;
-
- /* Set parameters. */
- va_start (ap, argc);
- args = &ucp->uc_mcontext.gregs[0];
- for (i = 0; i < argc; i++)
- {
- if (i == 10)
- args = &sp[2];
- *args++ = va_arg (ap, long);
- }
- va_end (ap);
-
- /* Start in the trampoline. */
- ucp->uc_mcontext.pc = (long) __startcontext;
-
- /* Set stack pointer. */
- ucp->uc_mcontext.sp = (long) sp;
-
- /* Pass FUNC to __startcontext in r31. */
- ucp->uc_mcontext.gregs[31] = (long) func;
-
- /* Pass ucp->uc_link to __startcontext in r30. */
- ucp->uc_mcontext.gregs[30] = (long) ucp->uc_link;
-}
-weak_alias (__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/tile/profil-counter.h b/sysdeps/unix/sysv/linux/tile/profil-counter.h
deleted file mode 100644
index 64f30e8755..0000000000
--- a/sysdeps/unix/sysv/linux/tile/profil-counter.h
+++ /dev/null
@@ -1,26 +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 <signal.h>
-#include <sigcontextinfo.h>
-
-static void
-__profil_counter (int signo, SIGCONTEXT scp)
-{
- profil_count ((void *) GET_PC (scp));
-}
diff --git a/sysdeps/unix/sysv/linux/tile/pt-vfork.c b/sysdeps/unix/sysv/linux/tile/pt-vfork.c
deleted file mode 100644
index 5fbc6526aa..0000000000
--- a/sysdeps/unix/sysv/linux/tile/pt-vfork.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/aarch64/pt-vfork.c>
diff --git a/sysdeps/unix/sysv/linux/tile/set_dataplane.c b/sysdeps/unix/sysv/linux/tile/set_dataplane.c
deleted file mode 100644
index 5a4bffe4f3..0000000000
--- a/sysdeps/unix/sysv/linux/tile/set_dataplane.c
+++ /dev/null
@@ -1,36 +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 <stddef.h>
-#include <unistd.h>
-#ifdef __NR_set_dataplane
-#include <sys/dataplane.h>
-#endif
-
-/* Request dataplane modes from the kernel. */
-int
-set_dataplane (int flags)
-{
-#ifdef __NR_set_dataplane
- return INLINE_SYSCALL (set_dataplane, 1, flags);
-#else
- __set_errno (ENOSYS);
- return -1;
-#endif
-}
diff --git a/sysdeps/unix/sysv/linux/tile/setcontext.S b/sysdeps/unix/sysv/linux/tile/setcontext.S
deleted file mode 100644
index a6011744e9..0000000000
--- a/sysdeps/unix/sysv/linux/tile/setcontext.S
+++ /dev/null
@@ -1,206 +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 <sysdep.h>
-#include <asm/errno.h>
-#include <arch/spr_def.h>
-#include <arch/abi.h>
-
-#include "ucontext_i.h"
-
-/* PL to return to via iret in setcontext */
-#define RETURN_PL 0
-
-/* int setcontext (const ucontext_t *ucp) */
-
- .text
-ENTRY (__setcontext)
- FEEDBACK_ENTER(__setcontext)
-
- /* See if this is a true signal context (flags == 0).
- If so, restore by invoking rt_sigreturn(). */
-#if UC_FLAGS_OFFSET != 0
-# error "Add offset to r0 prior to load."
-#endif
- LD_PTR r10, r0
- {
- BEQZ r10, .Lsigreturn
- addi r10, r10, -1 /* Confirm that it has value "1". */
- }
- BNEZ r10, .Lbadcontext
-
- /* Save lr and r0 briefly on the stack and set the signal mask:
- rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG / 8). */
- {
- ST sp, lr
- ADDI_PTR r11, sp, -(2 * REGSIZE)
- move r10, sp
- }
- ADDI_PTR sp, sp, -(3 * REGSIZE)
- cfi_def_cfa_offset (3 * REGSIZE)
- cfi_offset (lr, 0)
- {
- ST r11, r10
- ADDI_PTR r10, sp, (2 * REGSIZE)
- }
- {
- ST r10, r0
- ADDLI_PTR r1, r0, UC_SIGMASK_OFFSET
- }
- cfi_offset (r0, -REGSIZE)
- {
- movei r3, _NSIG / 8
- movei r2, 0
- }
- {
- movei r0, SIG_SETMASK
- moveli TREG_SYSCALL_NR_NAME, __NR_rt_sigprocmask
- }
- swint1
- ADDI_PTR r11, sp, 2 * REGSIZE /* Restore uc_context to r11. */
- {
- LD r11, r11
- ADDI_PTR sp, sp, 3 * REGSIZE
- }
- cfi_def_cfa_offset (0)
- LD lr, sp
- {
- ADDI_PTR r10, r11, UC_REG(0)
- BNEZ r1, .Lsyscall_error
- }
-
- /* Restore the argument registers; note they will be random
- unless makecontext() has been called. */
- { LD r0, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r1, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r2, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r3, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r4, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r5, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r6, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r7, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r8, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r9, r10; ADDLI_PTR r10, r10, UC_REG(30) - UC_REG(9) }
-
- /* Restore the callee-saved GPRs. */
- { LD r30, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r31, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r32, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r33, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r34, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r35, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r36, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r37, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r38, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r39, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r40, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r41, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r42, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r43, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r44, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r45, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r46, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r47, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r48, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r49, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r50, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r51, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r52, r10; ADDI_PTR r10, r10, REGSIZE * 2 }
- /* Skip tp since it must not change for a given thread. */
- { LD sp, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD lr, r10; ADDI_PTR r10, r10, REGSIZE }
- { LD r11, r10; ADDI_PTR r10, r10, REGSIZE }
-
- /* Construct an iret context; we set ICS so we can validly load
- EX_CONTEXT for iret without being interrupted halfway through. */
- {
- LD r12, r10
- movei r13, 1
- }
- {
- mtspr INTERRUPT_CRITICAL_SECTION, r13
- shli r12, r12, SPR_EX_CONTEXT_0_1__ICS_SHIFT
- }
- {
- mtspr EX_CONTEXT_0_0, r11
- ori r12, r12, RETURN_PL
- }
- mtspr EX_CONTEXT_0_1, r12
- iret
- jrp lr /* keep the backtracer happy */
-
-.Lsigreturn:
- /* This is a context obtained from a signal handler.
- Perform a full restore by pushing the context
- passed onto a simulated signal frame on the stack
- and call the signal return syscall as if a signal
- handler exited normally. */
- {
- ADDLI_PTR sp, sp, -(C_ABI_SAVE_AREA_SIZE + SI_MAX_SIZE + UC_SIZE)
- ADDLI_PTR r1, sp, -UC_SIZE
- }
- cfi_def_cfa_offset (C_ABI_SAVE_AREA_SIZE + SI_MAX_SIZE + UC_SIZE)
- moveli r2, UC_SIZE / REGSIZE
-0: {
- LD r10, r0
- ADDI_PTR r0, r0, REGSIZE
- }
- {
- ST r1, r10
- ADDI_PTR r1, r1, REGSIZE
- addi r2, r2, -1
- }
- BNEZ r2, 0b
- moveli TREG_SYSCALL_NR_NAME, __NR_rt_sigreturn
- swint1
-
- /* Restore the stack and fall through to the error
- path. Successful rt_sigreturn never returns to
- its calling place. */
- ADDLI_PTR sp, sp, (C_ABI_SAVE_AREA_SIZE + SI_MAX_SIZE + UC_SIZE)
- cfi_def_cfa_offset (0)
-
-.Lsyscall_error:
- j SYSCALL_ERROR_NAME
-
-.Lbadcontext:
- {
- movei r1, EINVAL
- j SYSCALL_ERROR_NAME
- }
-
-END (__setcontext)
-
-.hidden __setcontext
-weak_alias (__setcontext, setcontext)
-
-ENTRY (__startcontext)
- cfi_undefined (lr)
- FEEDBACK_ENTER(__startcontext)
- jalr r31
- BEQZ r30, 1f
- {
- move r0, r30
- jal __setcontext
- }
-1: {
- movei r0, 0
- j HIDDEN_JUMPTARGET(exit)
- }
-END (__startcontext)
-.hidden __startcontext
diff --git a/sysdeps/unix/sysv/linux/tile/shlib-versions b/sysdeps/unix/sysv/linux/tile/shlib-versions
deleted file mode 100644
index b4360d35e1..0000000000
--- a/sysdeps/unix/sysv/linux/tile/shlib-versions
+++ /dev/null
@@ -1,2 +0,0 @@
-# glibc 2.12 was released to customers; 2.15 was the first community version.
-DEFAULT GLIBC_2.12 GLIBC_2.15
diff --git a/sysdeps/unix/sysv/linux/tile/sigcontextinfo.h b/sysdeps/unix/sysv/linux/tile/sigcontextinfo.h
deleted file mode 100644
index babb53b8f3..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sigcontextinfo.h
+++ /dev/null
@@ -1,27 +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 <arch/abi.h>
-
-#define SIGCONTEXT siginfo_t *_si, struct ucontext *
-#define SIGCONTEXT_EXTRA_ARGS _si,
-#define GET_PC(ctx) ((void *) (long) ctx->uc_mcontext.pc)
-#define GET_FRAME(ctx) ((void *) (long) ctx->uc_mcontext.regs[TREG_FP])
-#define GET_STACK(ctx) ((void *) (long) ctx->uc_mcontext.sp)
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/tile/swapcontext.S b/sysdeps/unix/sysv/linux/tile/swapcontext.S
deleted file mode 100644
index dd5a36dabf..0000000000
--- a/sysdeps/unix/sysv/linux/tile/swapcontext.S
+++ /dev/null
@@ -1,89 +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 <sysdep.h>
-
-#include "ucontext_i.h"
-
-/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
-
- .text
-ENTRY (__swapcontext)
- FEEDBACK_ENTER(__swapcontext)
- /* Set up a frame and save r0 and r1. */
- {
- ST sp, lr
- ADDI_PTR r11, sp, -(3 * REGSIZE)
- move r10, sp
- }
- ADDI_PTR sp, sp, -(4 * REGSIZE)
- cfi_def_cfa_offset (4 * REGSIZE)
- cfi_offset (lr, 0)
- {
- ST r11, r10
- ADDI_PTR r10, sp, (2 * REGSIZE)
- }
- {
- ST r10, r0
- ADDI_PTR r10, sp, (3 * REGSIZE)
- }
- ST r10, r1
-
- /* Save the current context. */
- jal __getcontext
-
- /* Tear down the frame and restore r0, r1, and lr. */
- {
- BNEZ r0, .Lerror
- ADDI_PTR r1, sp, 3 * REGSIZE
- }
- {
- LD r1, r1
- ADDI_PTR r0, sp, 2 * REGSIZE
- }
- {
- LD r0, r0
- ADDI_PTR sp, sp, 4 * REGSIZE
- }
- cfi_def_cfa_offset (0)
- {
- LD lr, sp
- ADDLI_PTR r10, r0, UC_REG(54)
- }
-
- /* Update the stored sp and lr. */
- {
- ST r10, sp
- ADDLI_PTR r10, r0, UC_REG(55)
- }
- ST r10, lr
-
- /* Tail-call setcontext to finish up. */
- {
- move r0, r1
- j __setcontext
- }
-
-.Lerror:
- ADDI_PTR sp, sp, 4 * REGSIZE
- cfi_def_cfa_offset (0)
- LD lr, sp
- jrp lr
-END (__swapcontext)
-
-weak_alias (__swapcontext, swapcontext)
diff --git a/sysdeps/unix/sysv/linux/tile/sys/cachectl.h b/sysdeps/unix/sysv/linux/tile/sys/cachectl.h
deleted file mode 100644
index 9bc75ec1ea..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sys/cachectl.h
+++ /dev/null
@@ -1,36 +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/>. */
-
-#ifndef _SYS_CACHECTL_H
-#define _SYS_CACHECTL_H 1
-
-#include <features.h>
-
-/* Get the kernel definition for the op bits. */
-#include <asm/cachectl.h>
-
-__BEGIN_DECLS
-
-#ifdef __USE_MISC
-extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW;
-#endif
-extern int _flush_cache (char *__addr, const int __nbytes, const int __op) __THROW;
-
-__END_DECLS
-
-#endif /* sys/cachectl.h */
diff --git a/sysdeps/unix/sysv/linux/tile/sys/dataplane.h b/sysdeps/unix/sysv/linux/tile/sys/dataplane.h
deleted file mode 100644
index 82677f1f5f..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sys/dataplane.h
+++ /dev/null
@@ -1,33 +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/>. */
-
-#ifndef _SYS_DATAPLANE_H
-#define _SYS_DATAPLANE_H 1
-
-#include <features.h>
-
-/* Get the kernel definition for the flag bits. */
-#include <asm/dataplane.h>
-
-__BEGIN_DECLS
-
-extern int set_dataplane (int flags);
-
-__END_DECLS
-
-#endif /* sys/dataplane.h */
diff --git a/sysdeps/unix/sysv/linux/tile/sys/procfs.h b/sysdeps/unix/sysv/linux/tile/sys/procfs.h
deleted file mode 100644
index 40c3ff5268..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sys/procfs.h
+++ /dev/null
@@ -1,128 +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/>. */
-
-#ifndef _SYS_PROCFS_H
-#define _SYS_PROCFS_H 1
-
-/* This is somewhat modelled after the file of the same name on SVR4
- systems. It provides a definition of the core file format for ELF
- used on Linux. It doesn't have anything to do with the /proc file
- system, even though Linux has one.
-
- Anyway, 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 you know what you are doing. */
-
-#include <features.h>
-#include <sys/time.h>
-#include <sys/types.h>
-
-#define __need_int_reg_t
-#include <arch/abi.h>
-
-__BEGIN_DECLS
-
-/* Type for a general-purpose register. */
-typedef __uint_reg_t elf_greg_t;
-
-/* And the whole bunch of them. We could have used `struct pt_regs'
- from <asm/ptrace.h> directly in the typedef, but tradition says that
- the register set is an array, which does have some peculiar
- semantics, so leave it that way. */
-#define ELF_NGREG 64
-#define ELF_NFPREG 0
-typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-typedef elf_greg_t elf_fpregset_t[ELF_NFPREG];
-
-/* Signal info. */
-struct elf_siginfo
- {
- int si_signo; /* Signal number. */
- int si_code; /* Extra code. */
- int si_errno; /* Errno. */
- };
-
-
-/* Definitions to generate Intel SVR4-like core files. These mostly
- have the same names as the SVR4 types with "elf_" tacked on the
- front to prevent clashes with Linux definitions, and the typedef
- forms have been avoided. This is mostly like the SVR4 structure,
- but more Linuxy, with things that Linux does not support and which
- GDB doesn't really use excluded. */
-
-struct elf_prstatus
- {
- struct elf_siginfo pr_info; /* Info associated with signal. */
- short int pr_cursig; /* Current signal. */
- unsigned long int pr_sigpend; /* Set of pending signals. */
- unsigned long int pr_sighold; /* Set of held signals. */
- __pid_t pr_pid;
- __pid_t pr_ppid;
- __pid_t pr_pgrp;
- __pid_t pr_sid;
- struct timeval pr_utime; /* User time. */
- struct timeval pr_stime; /* System time. */
- struct timeval pr_cutime; /* Cumulative user time. */
- struct timeval pr_cstime; /* Cumulative system time. */
- elf_gregset_t pr_reg; /* GP registers. */
- int pr_fpvalid; /* True if math copro being used. */
- };
-
-
-#define ELF_PRARGSZ (80) /* Number of chars for args. */
-
-struct elf_prpsinfo
- {
- char pr_state; /* Numeric process state. */
- char pr_sname; /* Char for pr_state. */
- char pr_zomb; /* Zombie. */
- char pr_nice; /* Nice val. */
- unsigned long int pr_flag; /* Flags. */
- unsigned int pr_uid;
- unsigned int pr_gid;
- int pr_pid, pr_ppid, pr_pgrp, pr_sid;
- /* Lots missing */
- char pr_fname[16]; /* Filename of executable. */
- char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
- };
-
-
-/* The rest of this file provides the types for emulation of the
- Solaris <proc_service.h> interfaces that should be implemented by
- users of libthread_db. */
-
-/* Addresses. */
-typedef void *psaddr_t;
-
-/* Register sets. Linux has different names. */
-typedef elf_gregset_t prgregset_t;
-
-/* Provide dummy declaration here; we don't have FP registers. */
-typedef elf_fpregset_t prfpregset_t;
-
-/* We don't have any differences between processes and threads,
- therefore have only one PID type. */
-typedef __pid_t lwpid_t;
-
-/* Process status and info. In the end we do provide typedefs for them. */
-typedef struct elf_prstatus prstatus_t;
-typedef struct elf_prpsinfo prpsinfo_t;
-
-__END_DECLS
-
-#endif /* sys/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/tile/sys/ptrace.h b/sysdeps/unix/sysv/linux/tile/sys/ptrace.h
deleted file mode 100644
index 46b5efaa7a..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sys/ptrace.h
+++ /dev/null
@@ -1,194 +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/>. */
-
-#ifndef _SYS_PTRACE_H
-#define _SYS_PTRACE_H 1
-
-#include <features.h>
-#include <bits/types.h>
-
-__BEGIN_DECLS
-
-/* Type of the REQUEST argument to `ptrace.' */
-enum __ptrace_request
-{
- /* Indicate that the process making this request should be traced.
- All signals received by this process can be intercepted by its
- parent, and its parent can use the other `ptrace' requests. */
- PTRACE_TRACEME = 0,
-#define PT_TRACE_ME PTRACE_TRACEME
-
- /* Return the word in the process's text space at address ADDR. */
- PTRACE_PEEKTEXT = 1,
-#define PT_READ_I PTRACE_PEEKTEXT
-
- /* Return the word in the process's data space at address ADDR. */
- PTRACE_PEEKDATA = 2,
-#define PT_READ_D PTRACE_PEEKDATA
-
- /* Return the word in the process's user area at offset ADDR. */
- PTRACE_PEEKUSER = 3,
-#define PT_READ_U PTRACE_PEEKUSER
-
- /* Write the word DATA into the process's text space at address ADDR. */
- PTRACE_POKETEXT = 4,
-#define PT_WRITE_I PTRACE_POKETEXT
-
- /* Write the word DATA into the process's data space at address ADDR. */
- PTRACE_POKEDATA = 5,
-#define PT_WRITE_D PTRACE_POKEDATA
-
- /* Write the word DATA into the process's user area at offset ADDR. */
- PTRACE_POKEUSER = 6,
-#define PT_WRITE_U PTRACE_POKEUSER
-
- /* Continue the process. */
- PTRACE_CONT = 7,
-#define PT_CONTINUE PTRACE_CONT
-
- /* Kill the process. */
- PTRACE_KILL = 8,
-#define PT_KILL PTRACE_KILL
-
- /* Single step the process. */
- PTRACE_SINGLESTEP = 9,
-#define PT_STEP PTRACE_SINGLESTEP
-
- /* Get all general purpose registers used by a processes. */
- PTRACE_GETREGS = 12,
-#define PT_GETREGS PTRACE_GETREGS
-
- /* Set all general purpose registers used by a processes. */
- PTRACE_SETREGS = 13,
-#define PT_SETREGS PTRACE_SETREGS
-
- /* Attach to a process that is already running. */
- PTRACE_ATTACH = 16,
-#define PT_ATTACH PTRACE_ATTACH
-
- /* Detach from a process attached to with PTRACE_ATTACH. */
- PTRACE_DETACH = 17,
-#define PT_DETACH PTRACE_DETACH
-
- /* Continue and stop at the next (return from) syscall. */
- PTRACE_SYSCALL = 24,
-#define PT_SYSCALL PTRACE_SYSCALL
-
- /* Set ptrace filter options. */
- PTRACE_SETOPTIONS = 0x4200,
-#define PT_SETOPTIONS PTRACE_SETOPTIONS
-
- /* Get last ptrace message. */
- PTRACE_GETEVENTMSG = 0x4201,
-#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
-
- /* Get siginfo for process. */
- PTRACE_GETSIGINFO = 0x4202,
-#define PT_GETSIGINFO PTRACE_GETSIGINFO
-
- /* Set new siginfo for process. */
- PTRACE_SETSIGINFO = 0x4203,
-#define PT_SETSIGINFO PTRACE_SETSIGINFO
-
- /* Set register content. */
- PTRACE_SETREGSET = 0x4205,
-#define PTRACE_SETREGSET PTRACE_SETREGSET
-
- /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
- signal or group stop state. */
- PTRACE_SEIZE = 0x4206,
-#define PTRACE_SEIZE PTRACE_SEIZE
-
- /* Trap seized tracee. */
- PTRACE_INTERRUPT = 0x4207,
-#define PTRACE_INTERRUPT PTRACE_INTERRUPT
-
- /* Wait for next group event. */
- PTRACE_LISTEN = 0x4208,
-#define PTRACE_LISTEN PTRACE_LISTEN
-
- PTRACE_PEEKSIGINFO = 0x4209,
-#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
-
- PTRACE_GETSIGMASK = 0x420a,
-#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
-
- PTRACE_SETSIGMASK = 0x420b,
-#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
-
- PTRACE_SECCOMP_GET_FILTER = 0x420c
-#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
-};
-
-
-/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions
-{
- PTRACE_O_TRACESYSGOOD = 0x00000001,
- PTRACE_O_TRACEFORK = 0x00000002,
- PTRACE_O_TRACEVFORK = 0x00000004,
- PTRACE_O_TRACECLONE = 0x00000008,
- PTRACE_O_TRACEEXEC = 0x00000010,
- PTRACE_O_TRACEVFORKDONE = 0x00000020,
- PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_EXITKILL = 0x00100000,
- PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
- PTRACE_O_MASK = 0x003000ff
-};
-
-/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes
-{
- PTRACE_EVENT_FORK = 1,
- PTRACE_EVENT_VFORK = 2,
- PTRACE_EVENT_CLONE = 3,
- PTRACE_EVENT_EXEC = 4,
- PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6,
- PTRACE_EVENT_SECCOMP = 7
-};
-
-/* Arguments for PTRACE_PEEKSIGINFO. */
-struct __ptrace_peeksiginfo_args
-{
- __uint64_t off; /* From which siginfo to start. */
- __uint32_t flags; /* Flags for peeksiginfo. */
- __int32_t nr; /* How many siginfos to take. */
-};
-
-enum __ptrace_peeksiginfo_flags
-{
- /* Read signals from a shared (process wide) queue. */
- PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
-};
-
-/* Perform process tracing functions. REQUEST is one of the values
- above, and determines the action to be taken.
- For all requests except PTRACE_TRACEME, PID specifies the process to be
- traced.
-
- PID and the other arguments described above for the various requests should
- appear (those that are used for the particular request) as:
- pid_t PID, void *ADDR, int DATA, void *ADDR2
- after REQUEST. */
-extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
-
-__END_DECLS
-
-#endif /* _SYS_PTRACE_H */
diff --git a/sysdeps/unix/sysv/linux/tile/sys/reg.h b/sysdeps/unix/sysv/linux/tile/sys/reg.h
deleted file mode 100644
index 1ab17ce82a..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sys/reg.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* The traditional purpose of "sys/reg.h" is satisfied by "arch/abi.h". */
-#include <arch/abi.h>
diff --git a/sysdeps/unix/sysv/linux/tile/sys/ucontext.h b/sysdeps/unix/sysv/linux/tile/sys/ucontext.h
deleted file mode 100644
index d930a1fea6..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sys/ucontext.h
+++ /dev/null
@@ -1,70 +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/>. */
-
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
-
-#include <features.h>
-#include <signal.h>
-
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
-#include <bits/sigcontext.h>
-
-/* Get register type and register names. */
-#include <arch/abi.h>
-
-/* Type for general register. */
-typedef uint_reg_t greg_t;
-
-/* Number of general registers. Must agree with <asm/ptrace.h>. */
-#define NGREG 64
-
-/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
-
-#ifdef __USE_GNU
-/* Names for interesting registers in the `gregset_t' array. */
-enum
-{
- /* ... r0 through r51 are just 0 through 51 ... */
- REG_FP = TREG_FP,
-# define REG_FP REG_FP
- REG_TP = TREG_TP,
-# define REG_TP REG_TP
- REG_SP = TREG_SP,
-# define REG_SP REG_SP
- REG_LR = TREG_LR,
-# define REG_LR REG_LR
-};
-#endif
-
-/* A machine context is exactly a sigcontext. */
-typedef struct sigcontext mcontext_t;
-
-/* Userlevel context. */
-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/tile/sys/user.h b/sysdeps/unix/sysv/linux/tile/sys/user.h
deleted file mode 100644
index c871f1a03d..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sys/user.h
+++ /dev/null
@@ -1 +0,0 @@
-/* This file is not needed, but in practice gdb might try to include it. */
diff --git a/sysdeps/unix/sysv/linux/tile/syscall.S b/sysdeps/unix/sysv/linux/tile/syscall.S
deleted file mode 100644
index 0531e65b28..0000000000
--- a/sysdeps/unix/sysv/linux/tile/syscall.S
+++ /dev/null
@@ -1,32 +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 <sysdep.h>
-#include <arch/abi.h>
-
- .text
-ENTRY (syscall)
- FEEDBACK_ENTER(syscall)
- { move TREG_SYSCALL_NR_NAME, r0; move r0, r1 }
- { move r1, r2; move r2, r3 }
- { move r3, r4; move r4, r5 }
- { move r5, r6; move r6, r7 }
- swint1
- BNEZ r1, 0f
- jrp lr
-PSEUDO_END (syscall)
diff --git a/sysdeps/unix/sysv/linux/tile/sysconf.c b/sysdeps/unix/sysv/linux/tile/sysconf.c
deleted file mode 100644
index 6baa19eb91..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sysconf.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Copyright (C) 2014-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 <sys/sysinfo.h>
-#include <arch/chip.h>
-
-static long int linux_sysconf (int name);
-
-/* Get the value of the system variable NAME. */
-long int
-__sysconf (int name)
-{
- /* Currently we support only tilepro and tilegx, which have
- statically-known cache sizes. */
- switch (name)
- {
- /* Level 1 cache. */
- case _SC_LEVEL1_ICACHE_SIZE:
- return CHIP_L1I_CACHE_SIZE();
- case _SC_LEVEL1_ICACHE_ASSOC:
- return CHIP_L1I_ASSOC();
- case _SC_LEVEL1_ICACHE_LINESIZE:
- return CHIP_L1I_LINE_SIZE();
- case _SC_LEVEL1_DCACHE_SIZE:
- return CHIP_L1D_CACHE_SIZE();
- case _SC_LEVEL1_DCACHE_ASSOC:
- return CHIP_L1D_ASSOC();
- case _SC_LEVEL1_DCACHE_LINESIZE:
- return CHIP_L1D_LINE_SIZE();
-
- /* Level 2 cache. */
- case _SC_LEVEL2_CACHE_SIZE:
- return CHIP_L2_CACHE_SIZE();
- case _SC_LEVEL2_CACHE_ASSOC:
- return CHIP_L2_ASSOC();
- case _SC_LEVEL2_CACHE_LINESIZE:
- return CHIP_L2_LINE_SIZE();
-
- /* Level 3 cache is layered on level 2 cache. */
- case _SC_LEVEL3_CACHE_SIZE:
- return CHIP_L2_CACHE_SIZE() * __get_nprocs();
- case _SC_LEVEL3_CACHE_ASSOC:
- return CHIP_L2_ASSOC();
- case _SC_LEVEL3_CACHE_LINESIZE:
- return CHIP_L2_LINE_SIZE();
-
- /* No level 4 cache. */
- case _SC_LEVEL4_CACHE_SIZE:
- case _SC_LEVEL4_CACHE_ASSOC:
- case _SC_LEVEL4_CACHE_LINESIZE:
- return -1;
- }
-
- return linux_sysconf (name);
-}
-
-/* Now the generic Linux version. */
-#undef __sysconf
-#define __sysconf static linux_sysconf
-#include <sysdeps/unix/sysv/linux/sysconf.c>
diff --git a/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h b/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
deleted file mode 100644
index 3d847bbac1..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
+++ /dev/null
@@ -1,154 +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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-/* Allow hacking in some extra code if desired. */
-#ifndef PSEUDO_EXTRA
-#define PSEUDO_EXTRA
-#endif
-
-#undef PSEUDO
-#define PSEUDO(name, syscall_name, args) \
- ENTRY(__##syscall_name##_nocancel); \
- PSEUDO_EXTRA \
- moveli TREG_SYSCALL_NR_NAME, SYS_ify(syscall_name); \
- swint1; \
- BNEZ r1, 0f; \
- jrp lr; \
- END(__##syscall_name##_nocancel); \
- ENTRY (name) \
- SINGLE_THREAD_P(r11); \
- BEQZ r11, L(pseudo_cancel); \
- PSEUDO_EXTRA \
- moveli TREG_SYSCALL_NR_NAME, SYS_ify(syscall_name); \
- swint1; \
- BNEZ r1, 0f; \
- jrp lr; \
- L(pseudo_cancel): \
- { \
- move r11, sp; \
- ST sp, lr; \
- ADDI_PTR sp, sp, -STKSPACE; \
- }; \
- cfi_offset (lr, 0); \
- cfi_def_cfa_offset (STKSPACE); \
- { \
- ADDI_PTR r12, sp, REGSIZE; \
- ADDI_PTR r13, sp, 2 * REGSIZE; /* set up for PUSHARGS_0 */ \
- }; \
- ST r12, r11; \
- PUSHARGS_##args /* save syscall args */ \
- CENABLE; \
- ADDI_PTR r12, sp, 10 * REGSIZE; \
- { \
- ST r12, r0; /* save mask */ \
- ADDI_PTR r13, sp, 2 * REGSIZE; /* set up for POPARGS_0 */ \
- }; \
- POPARGS_##args /* restore syscall args */ \
- PSEUDO_EXTRA \
- moveli TREG_SYSCALL_NR_NAME, SYS_ify(syscall_name); \
- swint1; \
- ADDI_PTR r12, sp, 12 * REGSIZE; \
- { \
- ST r12, r1; /* save syscall result */ \
- ADDI_PTR r12, sp, 11 * REGSIZE; \
- }; \
- { \
- ST r12, r0; \
- ADDI_PTR r13, sp, 10 * REGSIZE; \
- }; \
- LD r0, r13; /* pass mask as arg1 */ \
- CDISABLE; \
- { \
- ADDI_PTR lr, sp, STKSPACE; \
- ADDI_PTR r0, sp, 11 * REGSIZE; \
- }; \
- { \
- LD r0, r0; \
- ADDI_PTR r1, sp, 12 * REGSIZE; \
- }; \
- LD r1, r1; \
- { \
- LD lr, lr; \
- ADDI_PTR sp, sp, STKSPACE; \
- }; \
- cfi_def_cfa_offset (0); \
- BNEZ r1, 0f
-
-# define PUSHARGS_0 /* nothing to do */
-# define PUSHARGS_1 PUSHARGS_0 { ADDI_PTR r14, sp, 3 * REGSIZE; ST r13, r0 };
-# define PUSHARGS_2 PUSHARGS_1 { ADDI_PTR r13, sp, 4 * REGSIZE; ST r14, r1 };
-# define PUSHARGS_3 PUSHARGS_2 { ADDI_PTR r14, sp, 5 * REGSIZE; ST r13, r2 };
-# define PUSHARGS_4 PUSHARGS_3 { ADDI_PTR r13, sp, 6 * REGSIZE; ST r14, r3 };
-# define PUSHARGS_5 PUSHARGS_4 { ADDI_PTR r14, sp, 7 * REGSIZE; ST r13, r4 };
-# define PUSHARGS_6 PUSHARGS_5 { ADDI_PTR r13, sp, 8 * REGSIZE; ST r14, r5 };
-# define PUSHARGS_7 PUSHARGS_6 { ADDI_PTR r14, sp, 9 * REGSIZE; ST r13, r6 };
-
-# define POPARGS_0 /* nothing to do */
-# define POPARGS_1 POPARGS_0 { ADDI_PTR r14, sp, 3 * REGSIZE; LD r0, r13 };
-# define POPARGS_2 POPARGS_1 { ADDI_PTR r13, sp, 4 * REGSIZE; LD r1, r14 };
-# define POPARGS_3 POPARGS_2 { ADDI_PTR r14, sp, 5 * REGSIZE; LD r2, r13 };
-# define POPARGS_4 POPARGS_3 { ADDI_PTR r13, sp, 6 * REGSIZE; LD r3, r14 };
-# define POPARGS_5 POPARGS_4 { ADDI_PTR r14, sp, 7 * REGSIZE; LD r4, r13 };
-# define POPARGS_6 POPARGS_5 { ADDI_PTR r13, sp, 8 * REGSIZE; LD r5, r14 };
-# define POPARGS_7 POPARGS_6 { ADDI_PTR r14, sp, 9 * REGSIZE; LD r6, r13 };
-
-# define STKSPACE (13 * REGSIZE)
-
-# if IS_IN (libpthread)
-# define CENABLE jal __pthread_enable_asynccancel
-# define CDISABLE jal __pthread_disable_asynccancel
-# elif IS_IN (librt)
-# define CENABLE jal __librt_enable_asynccancel
-# define CDISABLE jal __librt_disable_asynccancel
-# else
-# define CENABLE jal __libc_enable_asynccancel
-# define CDISABLE jal __libc_disable_asynccancel
-# endif
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) \
- == 0, 1)
-# else
-# define SINGLE_THREAD_P(reg) \
- ADDLI_PTR reg, tp, MULTIPLE_THREADS_OFFSET; \
- LD reg, reg; \
- CMPEQI reg, reg, 0
-#endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/tile/sysdep.c b/sysdeps/unix/sysv/linux/tile/sysdep.c
deleted file mode 100644
index 4d4dbcb4e1..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sysdep.c
+++ /dev/null
@@ -1,33 +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 <sysdep.h>
-#include <errno.h>
-
-int __syscall_error (int dummy, int err);
-hidden_proto (__syscall_error)
-
-/* This routine is jumped to by all the syscall handlers, to stash
- an error number into errno. */
-int
-__syscall_error (int dummy, int err)
-{
- __set_errno (err);
- return -1;
-}
-hidden_def (__syscall_error)
diff --git a/sysdeps/unix/sysv/linux/tile/sysdep.h b/sysdeps/unix/sysv/linux/tile/sysdep.h
deleted file mode 100644
index f5cacb6e00..0000000000
--- a/sysdeps/unix/sysv/linux/tile/sysdep.h
+++ /dev/null
@@ -1,239 +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 <asm/unistd.h>
-#include <sysdeps/tile/sysdep.h>
-#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
-#include <sys/syscall.h>
-
-#undef SYS_ify
-#define SYS_ify(syscall_name) __NR_##syscall_name
-
-
-#ifdef __ASSEMBLER__
-
-/* The actual implementation of doing a syscall. */
-#define DO_CALL(syscall_name, args) \
- moveli TREG_SYSCALL_NR_NAME, SYS_ify(syscall_name); \
- swint1
-
-/* TILE Linux returns the result in r0 (or a negative errno).
- The kernel "owns" the code to decide if a given value is an error,
- and puts errno in r1 if so, or otherwise zero. */
-#define PSEUDO(name, syscall_name, args) \
- ENTRY (name); \
- DO_CALL(syscall_name, args); \
- BNEZ r1, 0f
-
-#define ret jrp lr
-
-#ifndef PIC
-/* For static code, on error jump to __syscall_error directly. */
-# define SYSCALL_ERROR_NAME __syscall_error
-#elif IS_IN (libc) || IS_IN (libpthread)
-/* Use the internal name for libc/libpthread shared objects. */
-# define SYSCALL_ERROR_NAME __GI___syscall_error
-#else
-/* Otherwise, on error do a full PLT jump. */
-# define SYSCALL_ERROR_NAME plt(__syscall_error)
-#endif
-
-#undef PSEUDO_END
-#define PSEUDO_END(name) \
-0: \
- j SYSCALL_ERROR_NAME; \
- END (name)
-
-#undef PSEUDO_NOERRNO
-#define PSEUDO_NOERRNO(name, syscall_name, args) \
- ENTRY (name); \
- DO_CALL(syscall_name, args)
-
-#define ret_NOERRNO jrp lr
-
-#undef PSEUDO_END_NOERRNO
-#define PSEUDO_END_NOERRNO(name) \
- END (name)
-
-/* Convenience wrappers. */
-#define SYSCALL__(name, args) PSEUDO (__##name, name, args)
-#define SYSCALL(name, args) PSEUDO (name, name, args)
-
-#else /* not __ASSEMBLER__ */
-
-#include <errno.h>
-
-/* Define a macro which expands inline into the wrapper code for a system
- call. */
-# undef INLINE_SYSCALL
-# define INLINE_SYSCALL(name, nr, args...) \
- ({ \
- INTERNAL_SYSCALL_DECL (_sc_err); \
- unsigned long _sc_val = INTERNAL_SYSCALL (name, _sc_err, nr, args); \
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sc_val, _sc_err), 0)) \
- { \
- __set_errno (INTERNAL_SYSCALL_ERRNO (_sc_val, _sc_err)); \
- _sc_val = -1; \
- } \
- (long) _sc_val; \
- })
-
-#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
- internal_syscall##nr (SYS_ify (name), err, args)
-
-#undef INTERNAL_SYSCALL_NCS
-#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
- internal_syscall##nr (number, err, args)
-
-#undef INTERNAL_SYSCALL_DECL
-#define INTERNAL_SYSCALL_DECL(err) int err
-
-#undef INTERNAL_SYSCALL_ERROR_P
-#define INTERNAL_SYSCALL_ERROR_P(val, err) ({ (void) (val); (err) != 0; })
-
-#undef INTERNAL_SYSCALL_ERRNO
-#define INTERNAL_SYSCALL_ERRNO(val, err) ({ (void) (val); (err); })
-
-#define internal_syscall0(num, err, dummy...) \
- ({ \
- long _sys_result, __SYSCALL_CLOBBER_DECLS; \
- __asm__ __volatile__ ( \
- "swint1" \
- : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \
- : "R10" (num) \
- : __SYSCALL_CLOBBERS); \
- _sys_result; \
- })
-
-#define internal_syscall1(num, err, arg0) \
- ({ \
- long _sys_result, __SYSCALL_CLOBBER_DECLS; \
- __asm__ __volatile__ ( \
- "swint1" \
- : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \
- : "R10" (num), "R00" (arg0) \
- : __SYSCALL_CLOBBERS); \
- _sys_result; \
- })
-
-#define internal_syscall2(num, err, arg0, arg1) \
- ({ \
- long _sys_result, __SYSCALL_CLOBBER_DECLS; \
- __asm__ __volatile__ ( \
- "swint1" \
- : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \
- : "R10" (num), "R00" (arg0), "R01" (arg1) \
- : __SYSCALL_CLOBBERS); \
- _sys_result; \
- })
-
-#define internal_syscall3(num, err, arg0, arg1, arg2) \
- ({ \
- long _sys_result, __SYSCALL_CLOBBER_DECLS; \
- __asm__ __volatile__ ( \
- "swint1" \
- : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \
- : "R10" (num), "R00" (arg0), "R01" (arg1), "R02" (arg2) \
- : __SYSCALL_CLOBBERS); \
- _sys_result; \
- })
-
-#define internal_syscall4(num, err, arg0, arg1, arg2, arg3) \
- ({ \
- long _sys_result, __SYSCALL_CLOBBER_DECLS; \
- __asm__ __volatile__ ( \
- "swint1" \
- : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \
- : "R10" (num), "R00" (arg0), "R01" (arg1), "R02" (arg2), \
- "R03" (arg3) \
- : __SYSCALL_CLOBBERS); \
- _sys_result; \
- })
-
-#define internal_syscall5(num, err, arg0, arg1, arg2, arg3, arg4) \
- ({ \
- long _sys_result, __SYSCALL_CLOBBER_DECLS; \
- __asm__ __volatile__ ( \
- "swint1" \
- : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \
- : "R10" (num), "R00" (arg0), "R01" (arg1), "R02" (arg2), \
- "R03" (arg3), "R04" (arg4) \
- : __SYSCALL_CLOBBERS); \
- _sys_result; \
- })
-
-#define internal_syscall6(num, err, arg0, arg1, arg2, arg3, arg4, arg5) \
- ({ \
- long _sys_result, __SYSCALL_CLOBBER_DECLS; \
- __asm__ __volatile__ ( \
- "swint1" \
- : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \
- : "R10" (num), "R00" (arg0), "R01" (arg1), "R02" (arg2), \
- "R03" (arg3), "R04" (arg4), "R05" (arg5) \
- : __SYSCALL_CLOBBERS); \
- _sys_result; \
- })
-
-#undef __SYSCALL_CLOBBERS
-#define __SYSCALL_CLOBBERS \
- "r6", "r7", \
- "r8", "r9", "r11", "r12", "r13", "r14", "r15", \
- "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
- "r24", "r25", "r26", "r27", "r28", "r29", "memory"
-
-/* gcc doesn't seem to allow an input operand to be clobbered, so we
- fake it with dummy outputs. */
-#define __SYSCALL_CLOBBER_DECLS \
- _clobber_r2, _clobber_r3, _clobber_r4, _clobber_r5, _clobber_r10
-
-#define __SYSCALL_CLOBBER_OUTPUTS \
- "=R02" (_clobber_r2), "=R03" (_clobber_r3), "=R04" (_clobber_r4), \
- "=R05" (_clobber_r5), "=R10" (_clobber_r10)
-
-
-#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \
- ({ \
- struct syscall_return_value _sc_rv = funcptr (args); \
- err = _sc_rv.error; \
- _sc_rv.value; \
- })
-
-/* List of system calls which are supported as vsyscalls. */
-#define HAVE_CLOCK_GETTIME_VSYSCALL 1
-#define HAVE_GETTIMEOFDAY_VSYSCALL 1
-
-#endif /* __ASSEMBLER__ */
-
-/* Pointer mangling support. */
-#if IS_IN (rtld)
-/* We cannot use the thread descriptor because in ld.so we use setjmp
- earlier than the descriptor is initialized. */
-#else
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg, tmpreg) \
- ADDLI_PTR tmpreg, pt, POINTER_GUARD; \
- LD tmpreg, tmpreg; \
- xor reg, tmpreg, reg
-# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
-# else
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# endif
-#endif
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/Makefile b/sysdeps/unix/sysv/linux/tile/tilegx/Makefile
deleted file mode 100644
index 4f101f334a..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# Provide biarch definitions.
-abi-variants := 64 32
-abi-64-options := -D__LP64__
-abi-64-condition := __WORDSIZE == 64
-abi-32-options := -U__LP64__
-abi-32-condition := __WORDSIZE == 32
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/configure b/sysdeps/unix/sysv/linux/tile/tilegx/configure
deleted file mode 100644
index 0a6a63ff99..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/configure
+++ /dev/null
@@ -1,4 +0,0 @@
-# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
- # Local configure fragment for sysdeps/unix/sysv/linux/tile/tilegx
-
-ldd_rewrite_script=$dir/ldd-rewrite.sed
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/configure.ac b/sysdeps/unix/sysv/linux/tile/tilegx/configure.ac
deleted file mode 100644
index 87d86bd4c0..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/configure.ac
+++ /dev/null
@@ -1,4 +0,0 @@
-GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
-# Local configure fragment for sysdeps/unix/sysv/linux/tile/tilegx
-
-ldd_rewrite_script=$dir/ldd-rewrite.sed
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S b/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S
deleted file mode 100644
index 6f6a071b90..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S
+++ /dev/null
@@ -1,41 +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/>. */
-
-
-/* TILE-Gx specifies that "unsigned int" is sign extended in the high
- 32 bits. But since the userspace API claims to be "unsigned long",
- calls into __ioctl() will not be sign extended, but rather pass all
- 64 bits of the argument. Therefore, when we pass the "request"
- value to the kernel, we must explicitly sign-extend it to match the
- kernel's internal use of "unsigned int" as the second argument,
- which we do by casting to "unsigned int". */
-
-#include <sysdep.h>
-
- .text
-ENTRY (__ioctl)
- FEEDBACK_ENTER(__ioctl)
- {
- addxi r1, r1, 0
- moveli TREG_SYSCALL_NR_NAME, __NR_ioctl
- }
- swint1
- BNEZ r1, 0f
- jrp lr
-PSEUDO_END (__ioctl)
-weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/ldconfig.h b/sysdeps/unix/sysv/linux/tile/tilegx/ldconfig.h
deleted file mode 100644
index 40448ae760..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/ldconfig.h
+++ /dev/null
@@ -1,26 +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 <sysdeps/generic/ldconfig.h>
-
-#define SYSDEP_KNOWN_INTERPRETER_NAMES \
- { "/lib/ld.so.1", FLAG_ELF_LIBC6 }, \
- { "/lib32/ld.so.1", FLAG_ELF_LIBC6 },
-#define SYSDEP_KNOWN_LIBRARY_NAMES \
- { "libc.so.6", FLAG_ELF_LIBC6 }, \
- { "libm.so.6", FLAG_ELF_LIBC6 },
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/ldd-rewrite.sed b/sysdeps/unix/sysv/linux/tile/tilegx/ldd-rewrite.sed
deleted file mode 100644
index 8b0bb691cc..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/ldd-rewrite.sed
+++ /dev/null
@@ -1 +0,0 @@
-s_^\(RTLDLIST=\)\(.*lib\)\(\|32\)\(/[^/]*\.so\.[0-9.]*\)[ ]*$_\1"\2\4 \232\4"_
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/register-dump.h b/sysdeps/unix/sysv/linux/tile/tilegx/register-dump.h
deleted file mode 100644
index 715204bb76..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/register-dump.h
+++ /dev/null
@@ -1,123 +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 <sys/uio.h>
-#include <_itoa.h>
-
-/* We will print the register dump in this format:
-
- R0: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R4: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R8: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R12: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R16: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R20: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R24: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R28: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R32: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R36: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R40: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R44: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R48: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
- R52: XXXXXXXXXXXXXXXX TP: XXXXXXXXXXXXXXXX
- SP: XXXXXXXXXXXXXXXX LR: XXXXXXXXXXXXXXXX
-
- PC: XXXXXXXXXXXXXXXX ICS: X FAULTNUM: XX
-
- */
-
-static void
-hexvalue (unsigned long int value, char *buf, size_t len)
-{
- char *cp = _itoa_word (value, buf + len, 16, 0);
- while (cp > buf)
- *--cp = '0';
-}
-
-static void
-register_dump (int fd, mcontext_t *ctx)
-{
- char regs[59][16];
- struct iovec iov[132];
- size_t nr = 0;
- unsigned int i;
-
-#define ADD_STRING(str) \
- iov[nr].iov_base = (char *) str; \
- iov[nr].iov_len = strlen (str); \
- ++nr
-#define ADD_MEM(str, len) \
- iov[nr].iov_base = str; \
- iov[nr].iov_len = len; \
- ++nr
-
- /* Generate strings of register contents. */
- for (i = 0; i < 56; ++i)
- hexvalue (ctx->gregs[i], regs[i], 16);
- hexvalue (ctx->pc, regs[56], 16);
- hexvalue (ctx->ics, regs[57], 1);
- hexvalue (ctx->faultnum, regs[58], 2);
-
- /* Generate the output. */
- for (i = 0; i < 56;)
- {
- const char *prefixes[] = {
- "Register dump:\n\n R0: ",
- "\n R4: ",
- "\n R8: ",
- "\n R12: ",
- "\n R16: ",
- "\n R20: ",
- "\n R24: ",
- "\n R28: ",
- "\n R32: ",
- "\n R36: ",
- "\n R40: ",
- "\n R44: ",
- "\n R48: "
- };
- ADD_STRING (prefixes[i / 4]);
- do
- {
- ADD_MEM (regs[i], 16);
- ADD_STRING (" ");
- }
- while (++i % 4);
- }
- ADD_STRING ("\n R52: ");
- ADD_MEM (regs[52], 16);
- ADD_STRING (" TP: ");
- ADD_MEM (regs[53], 16);
- ADD_STRING ("\n SP: ");
- ADD_MEM (regs[54], 16);
- ADD_STRING (" LR: ");
- ADD_MEM (regs[55], 16);
- ADD_STRING ("\n\n PC: ");
- ADD_MEM (regs[56], 16);
- ADD_STRING (" ICS: ");
- ADD_MEM (regs[57], 1);
- ADD_STRING (" FAULTNUM: ");
- ADD_MEM (regs[58], 2);
- ADD_STRING ("\n");
-
- /* Write the stuff out. */
- writev (fd, iov, nr);
-}
-
-
-#define REGISTER_DUMP register_dump (fd, &ctx->uc_mcontext)
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/sched_getcpu.c b/sysdeps/unix/sysv/linux/tile/tilegx/sched_getcpu.c
deleted file mode 100644
index 4564cae3f2..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/sched_getcpu.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* 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/>. */
-
-#include <errno.h>
-#include <stddef.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sched.h>
-#include <sysdep.h>
-#include <arch/spr_def.h>
-
-
-/* The count of cores horizontally (X dimension) on the chip. */
-static int chip_width;
-
-/* Read the chip "width" from the /sys filesystem. */
-static int
-initialize_chip_width (void)
-{
- int w = 0;
- int fd;
-
- fd = __open ("/sys/devices/system/cpu/chip_width", O_RDONLY);
- if (fd >= 0)
- {
- char buf[64];
- ssize_t n;
- int i;
-
- n = __read (fd, buf, sizeof (buf));
- __close (fd);
-
- for (i = 0; i < n; ++i)
- {
- if (buf[i] < '0' || buf[i] > '9')
- break;
- w = (w * 10) + (buf[i] - '0');
- }
- }
-
- /* Store a negative value so we don't try again. */
- if (w == 0)
- w = -1;
-
- /* Using an atomic idempotent write here makes this thread-safe. */
- chip_width = w;
- return w;
-}
-
-int
-sched_getcpu (void)
-{
- unsigned int coord;
- int w = chip_width;
-
- if (__builtin_expect (w <= 0, 0))
- {
- if (w == 0)
- w = initialize_chip_width ();
- if (w < 0)
- {
- unsigned int cpu;
- int r = INLINE_SYSCALL (getcpu, 3, &cpu, NULL, NULL);
- return r == -1 ? r : cpu;
- }
- }
-
- /* Assign 64-bit value to a 32-bit variable to ensure 32-bit multiply. */
- coord = __insn_mfspr (SPR_TILE_COORD);
-
- /* Extract Y coord from bits 7..10 and X coord from bits 18..21. */
- return ((coord >> 7) & 0xf) * w + ((coord >> 18) & 0xf);
-}
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Implies b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Implies
deleted file mode 100644
index 9090d3fb8b..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Implies
+++ /dev/null
@@ -1,4 +0,0 @@
-unix/sysv/linux/tile/tilegx
-unix/sysv/linux/tile
-unix/sysv/linux/generic/wordsize-32
-unix/sysv/linux/generic
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Makefile b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Makefile
deleted file mode 100644
index 1e9d29be31..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-default-abi := 32
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/c++-types.data b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/c++-types.data
deleted file mode 100644
index 1a7bcb38d3..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/c++-types.data
+++ /dev/null
@@ -1,67 +0,0 @@
-blkcnt64_t:x
-blkcnt_t:l
-blksize_t:i
-caddr_t:Pc
-clockid_t:i
-clock_t:l
-daddr_t:i
-dev_t:y
-fd_mask:l
-fsblkcnt64_t:y
-fsblkcnt_t:m
-fsfilcnt64_t:y
-fsfilcnt_t:m
-fsid_t:8__fsid_t
-gid_t:j
-id_t:j
-ino64_t:y
-ino_t:m
-int16_t:s
-int32_t:i
-int64_t:x
-int8_t:a
-intptr_t:i
-key_t:i
-loff_t:x
-mode_t:j
-nlink_t:j
-off64_t:x
-off_t:l
-pid_t:i
-pthread_attr_t:14pthread_attr_t
-pthread_barrier_t:17pthread_barrier_t
-pthread_barrierattr_t:21pthread_barrierattr_t
-pthread_cond_t:14pthread_cond_t
-pthread_condattr_t:18pthread_condattr_t
-pthread_key_t:j
-pthread_mutex_t:15pthread_mutex_t
-pthread_mutexattr_t:19pthread_mutexattr_t
-pthread_once_t:i
-pthread_rwlock_t:16pthread_rwlock_t
-pthread_rwlockattr_t:20pthread_rwlockattr_t
-pthread_spinlock_t:i
-pthread_t:m
-quad_t:x
-register_t:x
-rlim64_t:y
-rlim_t:m
-sigset_t:10__sigset_t
-size_t:j
-socklen_t:j
-ssize_t:i
-suseconds_t:l
-time_t:l
-u_char:h
-uid_t:j
-uint:j
-u_int:j
-u_int16_t:t
-u_int32_t:j
-u_int64_t:y
-u_int8_t:h
-ulong:m
-u_long:m
-u_quad_t:y
-useconds_t:j
-ushort:t
-u_short:t
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/ld.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/ld.abilist
deleted file mode 100644
index 3ab170cc91..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/ld.abilist
+++ /dev/null
@@ -1,10 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __libc_memalign F
-GLIBC_2.12 __libc_stack_end D 0x4
-GLIBC_2.12 __tls_get_addr F
-GLIBC_2.12 _dl_mcount F
-GLIBC_2.12 _r_debug D 0x14
-GLIBC_2.12 calloc F
-GLIBC_2.12 free F
-GLIBC_2.12 malloc F
-GLIBC_2.12 realloc F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libBrokenLocale.abilist
deleted file mode 100644
index 0d64827515..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libBrokenLocale.abilist
+++ /dev/null
@@ -1,2 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libanl.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libanl.abilist
deleted file mode 100644
index a3b1cc08bf..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libanl.abilist
+++ /dev/null
@@ -1,5 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 gai_cancel F
-GLIBC_2.12 gai_error F
-GLIBC_2.12 gai_suspend F
-GLIBC_2.12 getaddrinfo_a F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist
deleted file mode 100644
index ffcc4a0a2b..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist
+++ /dev/null
@@ -1,2096 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 _Exit F
-GLIBC_2.12 _IO_2_1_stderr_ D 0xa0
-GLIBC_2.12 _IO_2_1_stdin_ D 0xa0
-GLIBC_2.12 _IO_2_1_stdout_ D 0xa0
-GLIBC_2.12 _IO_adjust_column F
-GLIBC_2.12 _IO_adjust_wcolumn F
-GLIBC_2.12 _IO_default_doallocate F
-GLIBC_2.12 _IO_default_finish F
-GLIBC_2.12 _IO_default_pbackfail F
-GLIBC_2.12 _IO_default_uflow F
-GLIBC_2.12 _IO_default_xsgetn F
-GLIBC_2.12 _IO_default_xsputn F
-GLIBC_2.12 _IO_do_write F
-GLIBC_2.12 _IO_doallocbuf F
-GLIBC_2.12 _IO_fclose F
-GLIBC_2.12 _IO_fdopen F
-GLIBC_2.12 _IO_feof F
-GLIBC_2.12 _IO_ferror F
-GLIBC_2.12 _IO_fflush F
-GLIBC_2.12 _IO_fgetpos F
-GLIBC_2.12 _IO_fgetpos64 F
-GLIBC_2.12 _IO_fgets F
-GLIBC_2.12 _IO_file_attach F
-GLIBC_2.12 _IO_file_close F
-GLIBC_2.12 _IO_file_close_it F
-GLIBC_2.12 _IO_file_doallocate F
-GLIBC_2.12 _IO_file_finish F
-GLIBC_2.12 _IO_file_fopen F
-GLIBC_2.12 _IO_file_init F
-GLIBC_2.12 _IO_file_jumps D 0x54
-GLIBC_2.12 _IO_file_open F
-GLIBC_2.12 _IO_file_overflow F
-GLIBC_2.12 _IO_file_read F
-GLIBC_2.12 _IO_file_seek F
-GLIBC_2.12 _IO_file_seekoff F
-GLIBC_2.12 _IO_file_setbuf F
-GLIBC_2.12 _IO_file_stat F
-GLIBC_2.12 _IO_file_sync F
-GLIBC_2.12 _IO_file_underflow F
-GLIBC_2.12 _IO_file_write F
-GLIBC_2.12 _IO_file_xsputn F
-GLIBC_2.12 _IO_flockfile F
-GLIBC_2.12 _IO_flush_all F
-GLIBC_2.12 _IO_flush_all_linebuffered F
-GLIBC_2.12 _IO_fopen F
-GLIBC_2.12 _IO_fprintf F
-GLIBC_2.12 _IO_fputs F
-GLIBC_2.12 _IO_fread F
-GLIBC_2.12 _IO_free_backup_area F
-GLIBC_2.12 _IO_free_wbackup_area F
-GLIBC_2.12 _IO_fsetpos F
-GLIBC_2.12 _IO_fsetpos64 F
-GLIBC_2.12 _IO_ftell F
-GLIBC_2.12 _IO_ftrylockfile F
-GLIBC_2.12 _IO_funlockfile F
-GLIBC_2.12 _IO_fwrite F
-GLIBC_2.12 _IO_getc F
-GLIBC_2.12 _IO_getline F
-GLIBC_2.12 _IO_getline_info F
-GLIBC_2.12 _IO_gets F
-GLIBC_2.12 _IO_init F
-GLIBC_2.12 _IO_init_marker F
-GLIBC_2.12 _IO_init_wmarker F
-GLIBC_2.12 _IO_iter_begin F
-GLIBC_2.12 _IO_iter_end F
-GLIBC_2.12 _IO_iter_file F
-GLIBC_2.12 _IO_iter_next F
-GLIBC_2.12 _IO_least_wmarker F
-GLIBC_2.12 _IO_link_in F
-GLIBC_2.12 _IO_list_all D 0x4
-GLIBC_2.12 _IO_list_lock F
-GLIBC_2.12 _IO_list_resetlock F
-GLIBC_2.12 _IO_list_unlock F
-GLIBC_2.12 _IO_marker_delta F
-GLIBC_2.12 _IO_marker_difference F
-GLIBC_2.12 _IO_padn F
-GLIBC_2.12 _IO_peekc_locked F
-GLIBC_2.12 _IO_popen F
-GLIBC_2.12 _IO_printf F
-GLIBC_2.12 _IO_proc_close F
-GLIBC_2.12 _IO_proc_open F
-GLIBC_2.12 _IO_putc F
-GLIBC_2.12 _IO_puts F
-GLIBC_2.12 _IO_remove_marker F
-GLIBC_2.12 _IO_seekmark F
-GLIBC_2.12 _IO_seekoff F
-GLIBC_2.12 _IO_seekpos F
-GLIBC_2.12 _IO_seekwmark F
-GLIBC_2.12 _IO_setb F
-GLIBC_2.12 _IO_setbuffer F
-GLIBC_2.12 _IO_setvbuf F
-GLIBC_2.12 _IO_sgetn F
-GLIBC_2.12 _IO_sprintf F
-GLIBC_2.12 _IO_sputbackc F
-GLIBC_2.12 _IO_sputbackwc F
-GLIBC_2.12 _IO_sscanf F
-GLIBC_2.12 _IO_str_init_readonly F
-GLIBC_2.12 _IO_str_init_static F
-GLIBC_2.12 _IO_str_overflow F
-GLIBC_2.12 _IO_str_pbackfail F
-GLIBC_2.12 _IO_str_seekoff F
-GLIBC_2.12 _IO_str_underflow F
-GLIBC_2.12 _IO_sungetc F
-GLIBC_2.12 _IO_sungetwc F
-GLIBC_2.12 _IO_switch_to_get_mode F
-GLIBC_2.12 _IO_switch_to_main_wget_area F
-GLIBC_2.12 _IO_switch_to_wbackup_area F
-GLIBC_2.12 _IO_switch_to_wget_mode F
-GLIBC_2.12 _IO_un_link F
-GLIBC_2.12 _IO_ungetc F
-GLIBC_2.12 _IO_unsave_markers F
-GLIBC_2.12 _IO_unsave_wmarkers F
-GLIBC_2.12 _IO_vfprintf F
-GLIBC_2.12 _IO_vfscanf F
-GLIBC_2.12 _IO_vsprintf F
-GLIBC_2.12 _IO_wdefault_doallocate F
-GLIBC_2.12 _IO_wdefault_finish F
-GLIBC_2.12 _IO_wdefault_pbackfail F
-GLIBC_2.12 _IO_wdefault_uflow F
-GLIBC_2.12 _IO_wdefault_xsgetn F
-GLIBC_2.12 _IO_wdefault_xsputn F
-GLIBC_2.12 _IO_wdo_write F
-GLIBC_2.12 _IO_wdoallocbuf F
-GLIBC_2.12 _IO_wfile_jumps D 0x54
-GLIBC_2.12 _IO_wfile_overflow F
-GLIBC_2.12 _IO_wfile_seekoff F
-GLIBC_2.12 _IO_wfile_sync F
-GLIBC_2.12 _IO_wfile_underflow F
-GLIBC_2.12 _IO_wfile_xsputn F
-GLIBC_2.12 _IO_wmarker_delta F
-GLIBC_2.12 _IO_wsetb F
-GLIBC_2.12 ___brk_addr D 0x4
-GLIBC_2.12 __adjtimex F
-GLIBC_2.12 __after_morecore_hook D 0x4
-GLIBC_2.12 __argz_count F
-GLIBC_2.12 __argz_next F
-GLIBC_2.12 __argz_stringify F
-GLIBC_2.12 __asprintf F
-GLIBC_2.12 __asprintf_chk F
-GLIBC_2.12 __assert F
-GLIBC_2.12 __assert_fail F
-GLIBC_2.12 __assert_perror_fail F
-GLIBC_2.12 __backtrace F
-GLIBC_2.12 __backtrace_symbols F
-GLIBC_2.12 __backtrace_symbols_fd F
-GLIBC_2.12 __bsd_getpgrp F
-GLIBC_2.12 __bzero F
-GLIBC_2.12 __check_rhosts_file D 0x4
-GLIBC_2.12 __chk_fail F
-GLIBC_2.12 __clone F
-GLIBC_2.12 __close F
-GLIBC_2.12 __cmsg_nxthdr F
-GLIBC_2.12 __confstr_chk F
-GLIBC_2.12 __connect F
-GLIBC_2.12 __ctype_b_loc F
-GLIBC_2.12 __ctype_get_mb_cur_max F
-GLIBC_2.12 __ctype_tolower_loc F
-GLIBC_2.12 __ctype_toupper_loc F
-GLIBC_2.12 __curbrk D 0x4
-GLIBC_2.12 __cxa_at_quick_exit F
-GLIBC_2.12 __cxa_atexit F
-GLIBC_2.12 __cxa_finalize F
-GLIBC_2.12 __cyg_profile_func_enter F
-GLIBC_2.12 __cyg_profile_func_exit F
-GLIBC_2.12 __daylight D 0x4
-GLIBC_2.12 __dcgettext F
-GLIBC_2.12 __default_morecore F
-GLIBC_2.12 __dgettext F
-GLIBC_2.12 __dprintf_chk F
-GLIBC_2.12 __dup2 F
-GLIBC_2.12 __duplocale F
-GLIBC_2.12 __endmntent F
-GLIBC_2.12 __environ D 0x4
-GLIBC_2.12 __errno_location F
-GLIBC_2.12 __fbufsize F
-GLIBC_2.12 __fcntl F
-GLIBC_2.12 __ffs F
-GLIBC_2.12 __fgets_chk F
-GLIBC_2.12 __fgets_unlocked_chk F
-GLIBC_2.12 __fgetws_chk F
-GLIBC_2.12 __fgetws_unlocked_chk F
-GLIBC_2.12 __finite F
-GLIBC_2.12 __finitef F
-GLIBC_2.12 __flbf F
-GLIBC_2.12 __fork F
-GLIBC_2.12 __fpending F
-GLIBC_2.12 __fprintf_chk F
-GLIBC_2.12 __fpu_control D 0x4
-GLIBC_2.12 __fpurge F
-GLIBC_2.12 __fread_chk F
-GLIBC_2.12 __fread_unlocked_chk F
-GLIBC_2.12 __freadable F
-GLIBC_2.12 __freading F
-GLIBC_2.12 __free_hook D 0x4
-GLIBC_2.12 __freelocale F
-GLIBC_2.12 __fsetlocking F
-GLIBC_2.12 __fwprintf_chk F
-GLIBC_2.12 __fwritable F
-GLIBC_2.12 __fwriting F
-GLIBC_2.12 __fxstat F
-GLIBC_2.12 __fxstat64 F
-GLIBC_2.12 __fxstatat F
-GLIBC_2.12 __fxstatat64 F
-GLIBC_2.12 __getcwd_chk F
-GLIBC_2.12 __getdelim F
-GLIBC_2.12 __getdomainname_chk F
-GLIBC_2.12 __getgroups_chk F
-GLIBC_2.12 __gethostname_chk F
-GLIBC_2.12 __getlogin_r_chk F
-GLIBC_2.12 __getmntent_r F
-GLIBC_2.12 __getpagesize F
-GLIBC_2.12 __getpgid F
-GLIBC_2.12 __getpid F
-GLIBC_2.12 __gets_chk F
-GLIBC_2.12 __gettimeofday F
-GLIBC_2.12 __getwd_chk F
-GLIBC_2.12 __gmtime_r F
-GLIBC_2.12 __h_errno_location F
-GLIBC_2.12 __isalnum_l F
-GLIBC_2.12 __isalpha_l F
-GLIBC_2.12 __isascii_l F
-GLIBC_2.12 __isblank_l F
-GLIBC_2.12 __iscntrl_l F
-GLIBC_2.12 __isctype F
-GLIBC_2.12 __isdigit_l F
-GLIBC_2.12 __isgraph_l F
-GLIBC_2.12 __isinf F
-GLIBC_2.12 __isinff F
-GLIBC_2.12 __islower_l F
-GLIBC_2.12 __isnan F
-GLIBC_2.12 __isnanf F
-GLIBC_2.12 __isoc99_fscanf F
-GLIBC_2.12 __isoc99_fwscanf F
-GLIBC_2.12 __isoc99_scanf F
-GLIBC_2.12 __isoc99_sscanf F
-GLIBC_2.12 __isoc99_swscanf F
-GLIBC_2.12 __isoc99_vfscanf F
-GLIBC_2.12 __isoc99_vfwscanf F
-GLIBC_2.12 __isoc99_vscanf F
-GLIBC_2.12 __isoc99_vsscanf F
-GLIBC_2.12 __isoc99_vswscanf F
-GLIBC_2.12 __isoc99_vwscanf F
-GLIBC_2.12 __isoc99_wscanf F
-GLIBC_2.12 __isprint_l F
-GLIBC_2.12 __ispunct_l F
-GLIBC_2.12 __isspace_l F
-GLIBC_2.12 __isupper_l F
-GLIBC_2.12 __iswalnum_l F
-GLIBC_2.12 __iswalpha_l F
-GLIBC_2.12 __iswblank_l F
-GLIBC_2.12 __iswcntrl_l F
-GLIBC_2.12 __iswctype F
-GLIBC_2.12 __iswctype_l F
-GLIBC_2.12 __iswdigit_l F
-GLIBC_2.12 __iswgraph_l F
-GLIBC_2.12 __iswlower_l F
-GLIBC_2.12 __iswprint_l F
-GLIBC_2.12 __iswpunct_l F
-GLIBC_2.12 __iswspace_l F
-GLIBC_2.12 __iswupper_l F
-GLIBC_2.12 __iswxdigit_l F
-GLIBC_2.12 __isxdigit_l F
-GLIBC_2.12 __ivaliduser F
-GLIBC_2.12 __key_decryptsession_pk_LOCAL D 0x4
-GLIBC_2.12 __key_encryptsession_pk_LOCAL D 0x4
-GLIBC_2.12 __key_gendes_LOCAL D 0x4
-GLIBC_2.12 __libc_allocate_rtsig F
-GLIBC_2.12 __libc_calloc F
-GLIBC_2.12 __libc_current_sigrtmax F
-GLIBC_2.12 __libc_current_sigrtmin F
-GLIBC_2.12 __libc_free F
-GLIBC_2.12 __libc_freeres F
-GLIBC_2.12 __libc_init_first F
-GLIBC_2.12 __libc_mallinfo F
-GLIBC_2.12 __libc_malloc F
-GLIBC_2.12 __libc_mallopt F
-GLIBC_2.12 __libc_memalign F
-GLIBC_2.12 __libc_pvalloc F
-GLIBC_2.12 __libc_realloc F
-GLIBC_2.12 __libc_sa_len F
-GLIBC_2.12 __libc_start_main F
-GLIBC_2.12 __libc_valloc F
-GLIBC_2.12 __longjmp_chk F
-GLIBC_2.12 __lseek F
-GLIBC_2.12 __lxstat F
-GLIBC_2.12 __lxstat64 F
-GLIBC_2.12 __malloc_hook D 0x4
-GLIBC_2.12 __malloc_initialize_hook D 0x4
-GLIBC_2.12 __mbrlen F
-GLIBC_2.12 __mbrtowc F
-GLIBC_2.12 __mbsnrtowcs_chk F
-GLIBC_2.12 __mbsrtowcs_chk F
-GLIBC_2.12 __mbstowcs_chk F
-GLIBC_2.12 __mcount F
-GLIBC_2.12 __memalign_hook D 0x4
-GLIBC_2.12 __memcpy_chk F
-GLIBC_2.12 __memmove_chk F
-GLIBC_2.12 __mempcpy F
-GLIBC_2.12 __mempcpy_chk F
-GLIBC_2.12 __mempcpy_small F
-GLIBC_2.12 __memset_chk F
-GLIBC_2.12 __monstartup F
-GLIBC_2.12 __morecore D 0x4
-GLIBC_2.12 __nanosleep F
-GLIBC_2.12 __newlocale F
-GLIBC_2.12 __nl_langinfo_l F
-GLIBC_2.12 __nss_configure_lookup F
-GLIBC_2.12 __nss_database_lookup F
-GLIBC_2.12 __nss_group_lookup F
-GLIBC_2.12 __nss_hostname_digits_dots F
-GLIBC_2.12 __nss_hosts_lookup F
-GLIBC_2.12 __nss_next F
-GLIBC_2.12 __nss_passwd_lookup F
-GLIBC_2.12 __obstack_printf_chk F
-GLIBC_2.12 __obstack_vprintf_chk F
-GLIBC_2.12 __open F
-GLIBC_2.12 __open64 F
-GLIBC_2.12 __open64_2 F
-GLIBC_2.12 __open_2 F
-GLIBC_2.12 __openat64_2 F
-GLIBC_2.12 __openat_2 F
-GLIBC_2.12 __overflow F
-GLIBC_2.12 __pipe F
-GLIBC_2.12 __poll F
-GLIBC_2.12 __posix_getopt F
-GLIBC_2.12 __pread64 F
-GLIBC_2.12 __pread64_chk F
-GLIBC_2.12 __pread_chk F
-GLIBC_2.12 __printf_chk F
-GLIBC_2.12 __printf_fp F
-GLIBC_2.12 __profile_frequency F
-GLIBC_2.12 __progname D 0x4
-GLIBC_2.12 __progname_full D 0x4
-GLIBC_2.12 __ptsname_r_chk F
-GLIBC_2.12 __pwrite64 F
-GLIBC_2.12 __rawmemchr F
-GLIBC_2.12 __rcmd_errstr D 0x4
-GLIBC_2.12 __read F
-GLIBC_2.12 __read_chk F
-GLIBC_2.12 __readlink_chk F
-GLIBC_2.12 __readlinkat_chk F
-GLIBC_2.12 __realloc_hook D 0x4
-GLIBC_2.12 __realpath_chk F
-GLIBC_2.12 __recv_chk F
-GLIBC_2.12 __recvfrom_chk F
-GLIBC_2.12 __register_atfork F
-GLIBC_2.12 __res_init F
-GLIBC_2.12 __res_nclose F
-GLIBC_2.12 __res_ninit F
-GLIBC_2.12 __res_randomid F
-GLIBC_2.12 __res_state F
-GLIBC_2.12 __rpc_thread_createerr F
-GLIBC_2.12 __rpc_thread_svc_fdset F
-GLIBC_2.12 __rpc_thread_svc_max_pollfd F
-GLIBC_2.12 __rpc_thread_svc_pollfd F
-GLIBC_2.12 __sbrk F
-GLIBC_2.12 __sched_cpualloc F
-GLIBC_2.12 __sched_cpucount F
-GLIBC_2.12 __sched_cpufree F
-GLIBC_2.12 __sched_get_priority_max F
-GLIBC_2.12 __sched_get_priority_min F
-GLIBC_2.12 __sched_getparam F
-GLIBC_2.12 __sched_getscheduler F
-GLIBC_2.12 __sched_setscheduler F
-GLIBC_2.12 __sched_yield F
-GLIBC_2.12 __secure_getenv F
-GLIBC_2.12 __select F
-GLIBC_2.12 __setmntent F
-GLIBC_2.12 __setpgid F
-GLIBC_2.12 __sigaction F
-GLIBC_2.12 __sigaddset F
-GLIBC_2.12 __sigdelset F
-GLIBC_2.12 __sigismember F
-GLIBC_2.12 __signbit F
-GLIBC_2.12 __signbitf F
-GLIBC_2.12 __sigpause F
-GLIBC_2.12 __sigsetjmp F
-GLIBC_2.12 __sigsuspend F
-GLIBC_2.12 __snprintf_chk F
-GLIBC_2.12 __sprintf_chk F
-GLIBC_2.12 __stack_chk_fail F
-GLIBC_2.12 __statfs F
-GLIBC_2.12 __stpcpy F
-GLIBC_2.12 __stpcpy_chk F
-GLIBC_2.12 __stpcpy_small F
-GLIBC_2.12 __stpncpy F
-GLIBC_2.12 __stpncpy_chk F
-GLIBC_2.12 __strcasecmp F
-GLIBC_2.12 __strcasecmp_l F
-GLIBC_2.12 __strcasestr F
-GLIBC_2.12 __strcat_chk F
-GLIBC_2.12 __strcoll_l F
-GLIBC_2.12 __strcpy_chk F
-GLIBC_2.12 __strcpy_small F
-GLIBC_2.12 __strcspn_c1 F
-GLIBC_2.12 __strcspn_c2 F
-GLIBC_2.12 __strcspn_c3 F
-GLIBC_2.12 __strdup F
-GLIBC_2.12 __strerror_r F
-GLIBC_2.12 __strfmon_l F
-GLIBC_2.12 __strftime_l F
-GLIBC_2.12 __strncasecmp_l F
-GLIBC_2.12 __strncat_chk F
-GLIBC_2.12 __strncpy_chk F
-GLIBC_2.12 __strndup F
-GLIBC_2.12 __strpbrk_c2 F
-GLIBC_2.12 __strpbrk_c3 F
-GLIBC_2.12 __strsep_1c F
-GLIBC_2.12 __strsep_2c F
-GLIBC_2.12 __strsep_3c F
-GLIBC_2.12 __strsep_g F
-GLIBC_2.12 __strspn_c1 F
-GLIBC_2.12 __strspn_c2 F
-GLIBC_2.12 __strspn_c3 F
-GLIBC_2.12 __strtod_internal F
-GLIBC_2.12 __strtod_l F
-GLIBC_2.12 __strtof_internal F
-GLIBC_2.12 __strtof_l F
-GLIBC_2.12 __strtok_r F
-GLIBC_2.12 __strtok_r_1c F
-GLIBC_2.12 __strtol_internal F
-GLIBC_2.12 __strtol_l F
-GLIBC_2.12 __strtold_internal F
-GLIBC_2.12 __strtold_l F
-GLIBC_2.12 __strtoll_internal F
-GLIBC_2.12 __strtoll_l F
-GLIBC_2.12 __strtoul_internal F
-GLIBC_2.12 __strtoul_l F
-GLIBC_2.12 __strtoull_internal F
-GLIBC_2.12 __strtoull_l F
-GLIBC_2.12 __strverscmp F
-GLIBC_2.12 __strxfrm_l F
-GLIBC_2.12 __swprintf_chk F
-GLIBC_2.12 __sysconf F
-GLIBC_2.12 __syslog_chk F
-GLIBC_2.12 __sysv_signal F
-GLIBC_2.12 __timezone D 0x4
-GLIBC_2.12 __toascii_l F
-GLIBC_2.12 __tolower_l F
-GLIBC_2.12 __toupper_l F
-GLIBC_2.12 __towctrans F
-GLIBC_2.12 __towctrans_l F
-GLIBC_2.12 __towlower_l F
-GLIBC_2.12 __towupper_l F
-GLIBC_2.12 __ttyname_r_chk F
-GLIBC_2.12 __tzname D 0x8
-GLIBC_2.12 __uflow F
-GLIBC_2.12 __underflow F
-GLIBC_2.12 __uselocale F
-GLIBC_2.12 __vasprintf_chk F
-GLIBC_2.12 __vdprintf_chk F
-GLIBC_2.12 __vfork F
-GLIBC_2.12 __vfprintf_chk F
-GLIBC_2.12 __vfscanf F
-GLIBC_2.12 __vfwprintf_chk F
-GLIBC_2.12 __vprintf_chk F
-GLIBC_2.12 __vsnprintf F
-GLIBC_2.12 __vsnprintf_chk F
-GLIBC_2.12 __vsprintf_chk F
-GLIBC_2.12 __vsscanf F
-GLIBC_2.12 __vswprintf_chk F
-GLIBC_2.12 __vsyslog_chk F
-GLIBC_2.12 __vwprintf_chk F
-GLIBC_2.12 __wait F
-GLIBC_2.12 __waitpid F
-GLIBC_2.12 __wcpcpy_chk F
-GLIBC_2.12 __wcpncpy_chk F
-GLIBC_2.12 __wcrtomb_chk F
-GLIBC_2.12 __wcscasecmp_l F
-GLIBC_2.12 __wcscat_chk F
-GLIBC_2.12 __wcscoll_l F
-GLIBC_2.12 __wcscpy_chk F
-GLIBC_2.12 __wcsftime_l F
-GLIBC_2.12 __wcsncasecmp_l F
-GLIBC_2.12 __wcsncat_chk F
-GLIBC_2.12 __wcsncpy_chk F
-GLIBC_2.12 __wcsnrtombs_chk F
-GLIBC_2.12 __wcsrtombs_chk F
-GLIBC_2.12 __wcstod_internal F
-GLIBC_2.12 __wcstod_l F
-GLIBC_2.12 __wcstof_internal F
-GLIBC_2.12 __wcstof_l F
-GLIBC_2.12 __wcstol_internal F
-GLIBC_2.12 __wcstol_l F
-GLIBC_2.12 __wcstold_internal F
-GLIBC_2.12 __wcstold_l F
-GLIBC_2.12 __wcstoll_internal F
-GLIBC_2.12 __wcstoll_l F
-GLIBC_2.12 __wcstombs_chk F
-GLIBC_2.12 __wcstoul_internal F
-GLIBC_2.12 __wcstoul_l F
-GLIBC_2.12 __wcstoull_internal F
-GLIBC_2.12 __wcstoull_l F
-GLIBC_2.12 __wcsxfrm_l F
-GLIBC_2.12 __wctomb_chk F
-GLIBC_2.12 __wctrans_l F
-GLIBC_2.12 __wctype_l F
-GLIBC_2.12 __wmemcpy_chk F
-GLIBC_2.12 __wmemmove_chk F
-GLIBC_2.12 __wmempcpy_chk F
-GLIBC_2.12 __wmemset_chk F
-GLIBC_2.12 __woverflow F
-GLIBC_2.12 __wprintf_chk F
-GLIBC_2.12 __write F
-GLIBC_2.12 __wuflow F
-GLIBC_2.12 __wunderflow F
-GLIBC_2.12 __xmknod F
-GLIBC_2.12 __xmknodat F
-GLIBC_2.12 __xpg_basename F
-GLIBC_2.12 __xpg_sigpause F
-GLIBC_2.12 __xpg_strerror_r F
-GLIBC_2.12 __xstat F
-GLIBC_2.12 __xstat64 F
-GLIBC_2.12 _authenticate F
-GLIBC_2.12 _dl_mcount_wrapper F
-GLIBC_2.12 _dl_mcount_wrapper_check F
-GLIBC_2.12 _environ D 0x4
-GLIBC_2.12 _exit F
-GLIBC_2.12 _flush_cache F
-GLIBC_2.12 _flushlbf F
-GLIBC_2.12 _libc_intl_domainname D 0x5
-GLIBC_2.12 _longjmp F
-GLIBC_2.12 _mcleanup F
-GLIBC_2.12 _mcount F
-GLIBC_2.12 _nl_default_dirname D 0x12
-GLIBC_2.12 _nl_domain_bindings D 0x4
-GLIBC_2.12 _nl_msg_cat_cntr D 0x4
-GLIBC_2.12 _null_auth D 0xc
-GLIBC_2.12 _obstack_allocated_p F
-GLIBC_2.12 _obstack_begin F
-GLIBC_2.12 _obstack_begin_1 F
-GLIBC_2.12 _obstack_free F
-GLIBC_2.12 _obstack_memory_used F
-GLIBC_2.12 _obstack_newchunk F
-GLIBC_2.12 _res D 0x200
-GLIBC_2.12 _res_hconf D 0x30
-GLIBC_2.12 _rpc_dtablesize F
-GLIBC_2.12 _seterr_reply F
-GLIBC_2.12 _setjmp F
-GLIBC_2.12 _sys_errlist D 0x21c
-GLIBC_2.12 _sys_nerr D 0x4
-GLIBC_2.12 _sys_siglist D 0x104
-GLIBC_2.12 _tolower F
-GLIBC_2.12 _toupper F
-GLIBC_2.12 a64l F
-GLIBC_2.12 abort F
-GLIBC_2.12 abs F
-GLIBC_2.12 accept F
-GLIBC_2.12 accept4 F
-GLIBC_2.12 access F
-GLIBC_2.12 acct F
-GLIBC_2.12 addmntent F
-GLIBC_2.12 addseverity F
-GLIBC_2.12 adjtime F
-GLIBC_2.12 adjtimex F
-GLIBC_2.12 advance F
-GLIBC_2.12 alarm F
-GLIBC_2.12 alphasort F
-GLIBC_2.12 alphasort64 F
-GLIBC_2.12 argp_err_exit_status D 0x4
-GLIBC_2.12 argp_error F
-GLIBC_2.12 argp_failure F
-GLIBC_2.12 argp_help F
-GLIBC_2.12 argp_parse F
-GLIBC_2.12 argp_program_bug_address D 0x4
-GLIBC_2.12 argp_program_version D 0x4
-GLIBC_2.12 argp_program_version_hook D 0x4
-GLIBC_2.12 argp_state_help F
-GLIBC_2.12 argp_usage F
-GLIBC_2.12 argz_add F
-GLIBC_2.12 argz_add_sep F
-GLIBC_2.12 argz_append F
-GLIBC_2.12 argz_count F
-GLIBC_2.12 argz_create F
-GLIBC_2.12 argz_create_sep F
-GLIBC_2.12 argz_delete F
-GLIBC_2.12 argz_extract F
-GLIBC_2.12 argz_insert F
-GLIBC_2.12 argz_next F
-GLIBC_2.12 argz_replace F
-GLIBC_2.12 argz_stringify F
-GLIBC_2.12 asctime F
-GLIBC_2.12 asctime_r F
-GLIBC_2.12 asprintf F
-GLIBC_2.12 atof F
-GLIBC_2.12 atoi F
-GLIBC_2.12 atol F
-GLIBC_2.12 atoll F
-GLIBC_2.12 authdes_create F
-GLIBC_2.12 authdes_getucred F
-GLIBC_2.12 authdes_pk_create F
-GLIBC_2.12 authnone_create F
-GLIBC_2.12 authunix_create F
-GLIBC_2.12 authunix_create_default F
-GLIBC_2.12 backtrace F
-GLIBC_2.12 backtrace_symbols F
-GLIBC_2.12 backtrace_symbols_fd F
-GLIBC_2.12 basename F
-GLIBC_2.12 bcmp F
-GLIBC_2.12 bcopy F
-GLIBC_2.12 bdflush F
-GLIBC_2.12 bind F
-GLIBC_2.12 bind_textdomain_codeset F
-GLIBC_2.12 bindresvport F
-GLIBC_2.12 bindtextdomain F
-GLIBC_2.12 brk F
-GLIBC_2.12 bsd_signal F
-GLIBC_2.12 bsearch F
-GLIBC_2.12 btowc F
-GLIBC_2.12 bzero F
-GLIBC_2.12 cacheflush F
-GLIBC_2.12 calloc F
-GLIBC_2.12 callrpc F
-GLIBC_2.12 canonicalize_file_name F
-GLIBC_2.12 capget F
-GLIBC_2.12 capset F
-GLIBC_2.12 catclose F
-GLIBC_2.12 catgets F
-GLIBC_2.12 catopen F
-GLIBC_2.12 cbc_crypt F
-GLIBC_2.12 cfgetispeed F
-GLIBC_2.12 cfgetospeed F
-GLIBC_2.12 cfmakeraw F
-GLIBC_2.12 cfree F
-GLIBC_2.12 cfsetispeed F
-GLIBC_2.12 cfsetospeed F
-GLIBC_2.12 cfsetspeed F
-GLIBC_2.12 chdir F
-GLIBC_2.12 chflags F
-GLIBC_2.12 chmod F
-GLIBC_2.12 chown F
-GLIBC_2.12 chroot F
-GLIBC_2.12 clearenv F
-GLIBC_2.12 clearerr F
-GLIBC_2.12 clearerr_unlocked F
-GLIBC_2.12 clnt_broadcast F
-GLIBC_2.12 clnt_create F
-GLIBC_2.12 clnt_pcreateerror F
-GLIBC_2.12 clnt_perrno F
-GLIBC_2.12 clnt_perror F
-GLIBC_2.12 clnt_spcreateerror F
-GLIBC_2.12 clnt_sperrno F
-GLIBC_2.12 clnt_sperror F
-GLIBC_2.12 clntraw_create F
-GLIBC_2.12 clnttcp_create F
-GLIBC_2.12 clntudp_bufcreate F
-GLIBC_2.12 clntudp_create F
-GLIBC_2.12 clntunix_create F
-GLIBC_2.12 clock F
-GLIBC_2.12 clone F
-GLIBC_2.12 close F
-GLIBC_2.12 closedir F
-GLIBC_2.12 closelog F
-GLIBC_2.12 confstr F
-GLIBC_2.12 connect F
-GLIBC_2.12 copysign F
-GLIBC_2.12 copysignf F
-GLIBC_2.12 copysignl F
-GLIBC_2.12 creat F
-GLIBC_2.12 creat64 F
-GLIBC_2.12 create_module F
-GLIBC_2.12 ctermid F
-GLIBC_2.12 ctime F
-GLIBC_2.12 ctime_r F
-GLIBC_2.12 cuserid F
-GLIBC_2.12 daemon F
-GLIBC_2.12 daylight D 0x4
-GLIBC_2.12 dcgettext F
-GLIBC_2.12 dcngettext F
-GLIBC_2.12 delete_module F
-GLIBC_2.12 des_setparity F
-GLIBC_2.12 dgettext F
-GLIBC_2.12 difftime F
-GLIBC_2.12 dirfd F
-GLIBC_2.12 dirname F
-GLIBC_2.12 div F
-GLIBC_2.12 dl_iterate_phdr F
-GLIBC_2.12 dngettext F
-GLIBC_2.12 dprintf F
-GLIBC_2.12 drand48 F
-GLIBC_2.12 drand48_r F
-GLIBC_2.12 dup F
-GLIBC_2.12 dup2 F
-GLIBC_2.12 dup3 F
-GLIBC_2.12 duplocale F
-GLIBC_2.12 dysize F
-GLIBC_2.12 eaccess F
-GLIBC_2.12 ecb_crypt F
-GLIBC_2.12 ecvt F
-GLIBC_2.12 ecvt_r F
-GLIBC_2.12 endaliasent F
-GLIBC_2.12 endfsent F
-GLIBC_2.12 endgrent F
-GLIBC_2.12 endhostent F
-GLIBC_2.12 endmntent F
-GLIBC_2.12 endnetent F
-GLIBC_2.12 endnetgrent F
-GLIBC_2.12 endprotoent F
-GLIBC_2.12 endpwent F
-GLIBC_2.12 endrpcent F
-GLIBC_2.12 endservent F
-GLIBC_2.12 endsgent F
-GLIBC_2.12 endspent F
-GLIBC_2.12 endttyent F
-GLIBC_2.12 endusershell F
-GLIBC_2.12 endutent F
-GLIBC_2.12 endutxent F
-GLIBC_2.12 environ D 0x4
-GLIBC_2.12 envz_add F
-GLIBC_2.12 envz_entry F
-GLIBC_2.12 envz_get F
-GLIBC_2.12 envz_merge F
-GLIBC_2.12 envz_remove F
-GLIBC_2.12 envz_strip F
-GLIBC_2.12 epoll_create F
-GLIBC_2.12 epoll_create1 F
-GLIBC_2.12 epoll_ctl F
-GLIBC_2.12 epoll_pwait F
-GLIBC_2.12 epoll_wait F
-GLIBC_2.12 erand48 F
-GLIBC_2.12 erand48_r F
-GLIBC_2.12 err F
-GLIBC_2.12 error F
-GLIBC_2.12 error_at_line F
-GLIBC_2.12 error_message_count D 0x4
-GLIBC_2.12 error_one_per_line D 0x4
-GLIBC_2.12 error_print_progname D 0x4
-GLIBC_2.12 errx F
-GLIBC_2.12 ether_aton F
-GLIBC_2.12 ether_aton_r F
-GLIBC_2.12 ether_hostton F
-GLIBC_2.12 ether_line F
-GLIBC_2.12 ether_ntoa F
-GLIBC_2.12 ether_ntoa_r F
-GLIBC_2.12 ether_ntohost F
-GLIBC_2.12 euidaccess F
-GLIBC_2.12 eventfd F
-GLIBC_2.12 eventfd_read F
-GLIBC_2.12 eventfd_write F
-GLIBC_2.12 execl F
-GLIBC_2.12 execle F
-GLIBC_2.12 execlp F
-GLIBC_2.12 execv F
-GLIBC_2.12 execve F
-GLIBC_2.12 execvp F
-GLIBC_2.12 execvpe F
-GLIBC_2.12 exit F
-GLIBC_2.12 faccessat F
-GLIBC_2.12 fallocate F
-GLIBC_2.12 fallocate64 F
-GLIBC_2.12 fattach F
-GLIBC_2.12 fchdir F
-GLIBC_2.12 fchflags F
-GLIBC_2.12 fchmod F
-GLIBC_2.12 fchmodat F
-GLIBC_2.12 fchown F
-GLIBC_2.12 fchownat F
-GLIBC_2.12 fclose F
-GLIBC_2.12 fcloseall F
-GLIBC_2.12 fcntl F
-GLIBC_2.12 fcvt F
-GLIBC_2.12 fcvt_r F
-GLIBC_2.12 fdatasync F
-GLIBC_2.12 fdetach F
-GLIBC_2.12 fdopen F
-GLIBC_2.12 fdopendir F
-GLIBC_2.12 feof F
-GLIBC_2.12 feof_unlocked F
-GLIBC_2.12 ferror F
-GLIBC_2.12 ferror_unlocked F
-GLIBC_2.12 fexecve F
-GLIBC_2.12 fflush F
-GLIBC_2.12 fflush_unlocked F
-GLIBC_2.12 ffs F
-GLIBC_2.12 ffsl F
-GLIBC_2.12 ffsll F
-GLIBC_2.12 fgetc F
-GLIBC_2.12 fgetc_unlocked F
-GLIBC_2.12 fgetgrent F
-GLIBC_2.12 fgetgrent_r F
-GLIBC_2.12 fgetpos F
-GLIBC_2.12 fgetpos64 F
-GLIBC_2.12 fgetpwent F
-GLIBC_2.12 fgetpwent_r F
-GLIBC_2.12 fgets F
-GLIBC_2.12 fgets_unlocked F
-GLIBC_2.12 fgetsgent F
-GLIBC_2.12 fgetsgent_r F
-GLIBC_2.12 fgetspent F
-GLIBC_2.12 fgetspent_r F
-GLIBC_2.12 fgetwc F
-GLIBC_2.12 fgetwc_unlocked F
-GLIBC_2.12 fgetws F
-GLIBC_2.12 fgetws_unlocked F
-GLIBC_2.12 fgetxattr F
-GLIBC_2.12 fileno F
-GLIBC_2.12 fileno_unlocked F
-GLIBC_2.12 finite F
-GLIBC_2.12 finitef F
-GLIBC_2.12 finitel F
-GLIBC_2.12 flistxattr F
-GLIBC_2.12 flock F
-GLIBC_2.12 flockfile F
-GLIBC_2.12 fmemopen F
-GLIBC_2.12 fmtmsg F
-GLIBC_2.12 fnmatch F
-GLIBC_2.12 fopen F
-GLIBC_2.12 fopen64 F
-GLIBC_2.12 fopencookie F
-GLIBC_2.12 fork F
-GLIBC_2.12 fpathconf F
-GLIBC_2.12 fprintf F
-GLIBC_2.12 fputc F
-GLIBC_2.12 fputc_unlocked F
-GLIBC_2.12 fputs F
-GLIBC_2.12 fputs_unlocked F
-GLIBC_2.12 fputwc F
-GLIBC_2.12 fputwc_unlocked F
-GLIBC_2.12 fputws F
-GLIBC_2.12 fputws_unlocked F
-GLIBC_2.12 fread F
-GLIBC_2.12 fread_unlocked F
-GLIBC_2.12 free F
-GLIBC_2.12 freeaddrinfo F
-GLIBC_2.12 freeifaddrs F
-GLIBC_2.12 freelocale F
-GLIBC_2.12 fremovexattr F
-GLIBC_2.12 freopen F
-GLIBC_2.12 freopen64 F
-GLIBC_2.12 frexp F
-GLIBC_2.12 frexpf F
-GLIBC_2.12 frexpl F
-GLIBC_2.12 fscanf F
-GLIBC_2.12 fseek F
-GLIBC_2.12 fseeko F
-GLIBC_2.12 fseeko64 F
-GLIBC_2.12 fsetpos F
-GLIBC_2.12 fsetpos64 F
-GLIBC_2.12 fsetxattr F
-GLIBC_2.12 fstatfs F
-GLIBC_2.12 fstatfs64 F
-GLIBC_2.12 fstatvfs F
-GLIBC_2.12 fstatvfs64 F
-GLIBC_2.12 fsync F
-GLIBC_2.12 ftell F
-GLIBC_2.12 ftello F
-GLIBC_2.12 ftello64 F
-GLIBC_2.12 ftime F
-GLIBC_2.12 ftok F
-GLIBC_2.12 ftruncate F
-GLIBC_2.12 ftruncate64 F
-GLIBC_2.12 ftrylockfile F
-GLIBC_2.12 fts_children F
-GLIBC_2.12 fts_close F
-GLIBC_2.12 fts_open F
-GLIBC_2.12 fts_read F
-GLIBC_2.12 fts_set F
-GLIBC_2.12 ftw F
-GLIBC_2.12 ftw64 F
-GLIBC_2.12 funlockfile F
-GLIBC_2.12 futimens F
-GLIBC_2.12 futimes F
-GLIBC_2.12 futimesat F
-GLIBC_2.12 fwide F
-GLIBC_2.12 fwprintf F
-GLIBC_2.12 fwrite F
-GLIBC_2.12 fwrite_unlocked F
-GLIBC_2.12 fwscanf F
-GLIBC_2.12 gai_strerror F
-GLIBC_2.12 gcvt F
-GLIBC_2.12 get_avphys_pages F
-GLIBC_2.12 get_current_dir_name F
-GLIBC_2.12 get_kernel_syms F
-GLIBC_2.12 get_myaddress F
-GLIBC_2.12 get_nprocs F
-GLIBC_2.12 get_nprocs_conf F
-GLIBC_2.12 get_phys_pages F
-GLIBC_2.12 getaddrinfo F
-GLIBC_2.12 getaliasbyname F
-GLIBC_2.12 getaliasbyname_r F
-GLIBC_2.12 getaliasent F
-GLIBC_2.12 getaliasent_r F
-GLIBC_2.12 getc F
-GLIBC_2.12 getc_unlocked F
-GLIBC_2.12 getchar F
-GLIBC_2.12 getchar_unlocked F
-GLIBC_2.12 getcontext F
-GLIBC_2.12 getcwd F
-GLIBC_2.12 getdate F
-GLIBC_2.12 getdate_err D 0x4
-GLIBC_2.12 getdate_r F
-GLIBC_2.12 getdelim F
-GLIBC_2.12 getdirentries F
-GLIBC_2.12 getdirentries64 F
-GLIBC_2.12 getdomainname F
-GLIBC_2.12 getdtablesize F
-GLIBC_2.12 getegid F
-GLIBC_2.12 getenv F
-GLIBC_2.12 geteuid F
-GLIBC_2.12 getfsent F
-GLIBC_2.12 getfsfile F
-GLIBC_2.12 getfsspec F
-GLIBC_2.12 getgid F
-GLIBC_2.12 getgrent F
-GLIBC_2.12 getgrent_r F
-GLIBC_2.12 getgrgid F
-GLIBC_2.12 getgrgid_r F
-GLIBC_2.12 getgrnam F
-GLIBC_2.12 getgrnam_r F
-GLIBC_2.12 getgrouplist F
-GLIBC_2.12 getgroups F
-GLIBC_2.12 gethostbyaddr F
-GLIBC_2.12 gethostbyaddr_r F
-GLIBC_2.12 gethostbyname F
-GLIBC_2.12 gethostbyname2 F
-GLIBC_2.12 gethostbyname2_r F
-GLIBC_2.12 gethostbyname_r F
-GLIBC_2.12 gethostent F
-GLIBC_2.12 gethostent_r F
-GLIBC_2.12 gethostid F
-GLIBC_2.12 gethostname F
-GLIBC_2.12 getifaddrs F
-GLIBC_2.12 getipv4sourcefilter F
-GLIBC_2.12 getitimer F
-GLIBC_2.12 getline F
-GLIBC_2.12 getloadavg F
-GLIBC_2.12 getlogin F
-GLIBC_2.12 getlogin_r F
-GLIBC_2.12 getmntent F
-GLIBC_2.12 getmntent_r F
-GLIBC_2.12 getmsg F
-GLIBC_2.12 getnameinfo F
-GLIBC_2.12 getnetbyaddr F
-GLIBC_2.12 getnetbyaddr_r F
-GLIBC_2.12 getnetbyname F
-GLIBC_2.12 getnetbyname_r F
-GLIBC_2.12 getnetent F
-GLIBC_2.12 getnetent_r F
-GLIBC_2.12 getnetgrent F
-GLIBC_2.12 getnetgrent_r F
-GLIBC_2.12 getnetname F
-GLIBC_2.12 getopt F
-GLIBC_2.12 getopt_long F
-GLIBC_2.12 getopt_long_only F
-GLIBC_2.12 getpagesize F
-GLIBC_2.12 getpass F
-GLIBC_2.12 getpeername F
-GLIBC_2.12 getpgid F
-GLIBC_2.12 getpgrp F
-GLIBC_2.12 getpid F
-GLIBC_2.12 getpmsg F
-GLIBC_2.12 getppid F
-GLIBC_2.12 getpriority F
-GLIBC_2.12 getprotobyname F
-GLIBC_2.12 getprotobyname_r F
-GLIBC_2.12 getprotobynumber F
-GLIBC_2.12 getprotobynumber_r F
-GLIBC_2.12 getprotoent F
-GLIBC_2.12 getprotoent_r F
-GLIBC_2.12 getpt F
-GLIBC_2.12 getpublickey F
-GLIBC_2.12 getpw F
-GLIBC_2.12 getpwent F
-GLIBC_2.12 getpwent_r F
-GLIBC_2.12 getpwnam F
-GLIBC_2.12 getpwnam_r F
-GLIBC_2.12 getpwuid F
-GLIBC_2.12 getpwuid_r F
-GLIBC_2.12 getresgid F
-GLIBC_2.12 getresuid F
-GLIBC_2.12 getrlimit F
-GLIBC_2.12 getrlimit64 F
-GLIBC_2.12 getrpcbyname F
-GLIBC_2.12 getrpcbyname_r F
-GLIBC_2.12 getrpcbynumber F
-GLIBC_2.12 getrpcbynumber_r F
-GLIBC_2.12 getrpcent F
-GLIBC_2.12 getrpcent_r F
-GLIBC_2.12 getrpcport F
-GLIBC_2.12 getrusage F
-GLIBC_2.12 gets F
-GLIBC_2.12 getsecretkey F
-GLIBC_2.12 getservbyname F
-GLIBC_2.12 getservbyname_r F
-GLIBC_2.12 getservbyport F
-GLIBC_2.12 getservbyport_r F
-GLIBC_2.12 getservent F
-GLIBC_2.12 getservent_r F
-GLIBC_2.12 getsgent F
-GLIBC_2.12 getsgent_r F
-GLIBC_2.12 getsgnam F
-GLIBC_2.12 getsgnam_r F
-GLIBC_2.12 getsid F
-GLIBC_2.12 getsockname F
-GLIBC_2.12 getsockopt F
-GLIBC_2.12 getsourcefilter F
-GLIBC_2.12 getspent F
-GLIBC_2.12 getspent_r F
-GLIBC_2.12 getspnam F
-GLIBC_2.12 getspnam_r F
-GLIBC_2.12 getsubopt F
-GLIBC_2.12 gettext F
-GLIBC_2.12 gettimeofday F
-GLIBC_2.12 getttyent F
-GLIBC_2.12 getttynam F
-GLIBC_2.12 getuid F
-GLIBC_2.12 getusershell F
-GLIBC_2.12 getutent F
-GLIBC_2.12 getutent_r F
-GLIBC_2.12 getutid F
-GLIBC_2.12 getutid_r F
-GLIBC_2.12 getutline F
-GLIBC_2.12 getutline_r F
-GLIBC_2.12 getutmp F
-GLIBC_2.12 getutmpx F
-GLIBC_2.12 getutxent F
-GLIBC_2.12 getutxid F
-GLIBC_2.12 getutxline F
-GLIBC_2.12 getw F
-GLIBC_2.12 getwc F
-GLIBC_2.12 getwc_unlocked F
-GLIBC_2.12 getwchar F
-GLIBC_2.12 getwchar_unlocked F
-GLIBC_2.12 getwd F
-GLIBC_2.12 getxattr F
-GLIBC_2.12 glob F
-GLIBC_2.12 glob64 F
-GLIBC_2.12 glob_pattern_p F
-GLIBC_2.12 globfree F
-GLIBC_2.12 globfree64 F
-GLIBC_2.12 gmtime F
-GLIBC_2.12 gmtime_r F
-GLIBC_2.12 gnu_dev_major F
-GLIBC_2.12 gnu_dev_makedev F
-GLIBC_2.12 gnu_dev_minor F
-GLIBC_2.12 gnu_get_libc_release F
-GLIBC_2.12 gnu_get_libc_version F
-GLIBC_2.12 grantpt F
-GLIBC_2.12 group_member F
-GLIBC_2.12 gsignal F
-GLIBC_2.12 gtty F
-GLIBC_2.12 h_errlist D 0x14
-GLIBC_2.12 h_nerr D 0x4
-GLIBC_2.12 hasmntopt F
-GLIBC_2.12 hcreate F
-GLIBC_2.12 hcreate_r F
-GLIBC_2.12 hdestroy F
-GLIBC_2.12 hdestroy_r F
-GLIBC_2.12 herror F
-GLIBC_2.12 host2netname F
-GLIBC_2.12 hsearch F
-GLIBC_2.12 hsearch_r F
-GLIBC_2.12 hstrerror F
-GLIBC_2.12 htonl F
-GLIBC_2.12 htons F
-GLIBC_2.12 iconv F
-GLIBC_2.12 iconv_close F
-GLIBC_2.12 iconv_open F
-GLIBC_2.12 if_freenameindex F
-GLIBC_2.12 if_indextoname F
-GLIBC_2.12 if_nameindex F
-GLIBC_2.12 if_nametoindex F
-GLIBC_2.12 imaxabs F
-GLIBC_2.12 imaxdiv F
-GLIBC_2.12 in6addr_any D 0x10
-GLIBC_2.12 in6addr_loopback D 0x10
-GLIBC_2.12 index F
-GLIBC_2.12 inet6_opt_append F
-GLIBC_2.12 inet6_opt_find F
-GLIBC_2.12 inet6_opt_finish F
-GLIBC_2.12 inet6_opt_get_val F
-GLIBC_2.12 inet6_opt_init F
-GLIBC_2.12 inet6_opt_next F
-GLIBC_2.12 inet6_opt_set_val F
-GLIBC_2.12 inet6_option_alloc F
-GLIBC_2.12 inet6_option_append F
-GLIBC_2.12 inet6_option_find F
-GLIBC_2.12 inet6_option_init F
-GLIBC_2.12 inet6_option_next F
-GLIBC_2.12 inet6_option_space F
-GLIBC_2.12 inet6_rth_add F
-GLIBC_2.12 inet6_rth_getaddr F
-GLIBC_2.12 inet6_rth_init F
-GLIBC_2.12 inet6_rth_reverse F
-GLIBC_2.12 inet6_rth_segments F
-GLIBC_2.12 inet6_rth_space F
-GLIBC_2.12 inet_addr F
-GLIBC_2.12 inet_aton F
-GLIBC_2.12 inet_lnaof F
-GLIBC_2.12 inet_makeaddr F
-GLIBC_2.12 inet_netof F
-GLIBC_2.12 inet_network F
-GLIBC_2.12 inet_nsap_addr F
-GLIBC_2.12 inet_nsap_ntoa F
-GLIBC_2.12 inet_ntoa F
-GLIBC_2.12 inet_ntop F
-GLIBC_2.12 inet_pton F
-GLIBC_2.12 init_module F
-GLIBC_2.12 initgroups F
-GLIBC_2.12 initstate F
-GLIBC_2.12 initstate_r F
-GLIBC_2.12 innetgr F
-GLIBC_2.12 inotify_add_watch F
-GLIBC_2.12 inotify_init F
-GLIBC_2.12 inotify_init1 F
-GLIBC_2.12 inotify_rm_watch F
-GLIBC_2.12 insque F
-GLIBC_2.12 ioctl F
-GLIBC_2.12 iruserok F
-GLIBC_2.12 iruserok_af F
-GLIBC_2.12 isalnum F
-GLIBC_2.12 isalnum_l F
-GLIBC_2.12 isalpha F
-GLIBC_2.12 isalpha_l F
-GLIBC_2.12 isascii F
-GLIBC_2.12 isastream F
-GLIBC_2.12 isatty F
-GLIBC_2.12 isblank F
-GLIBC_2.12 isblank_l F
-GLIBC_2.12 iscntrl F
-GLIBC_2.12 iscntrl_l F
-GLIBC_2.12 isctype F
-GLIBC_2.12 isdigit F
-GLIBC_2.12 isdigit_l F
-GLIBC_2.12 isfdtype F
-GLIBC_2.12 isgraph F
-GLIBC_2.12 isgraph_l F
-GLIBC_2.12 isinf F
-GLIBC_2.12 isinff F
-GLIBC_2.12 isinfl F
-GLIBC_2.12 islower F
-GLIBC_2.12 islower_l F
-GLIBC_2.12 isnan F
-GLIBC_2.12 isnanf F
-GLIBC_2.12 isnanl F
-GLIBC_2.12 isprint F
-GLIBC_2.12 isprint_l F
-GLIBC_2.12 ispunct F
-GLIBC_2.12 ispunct_l F
-GLIBC_2.12 isspace F
-GLIBC_2.12 isspace_l F
-GLIBC_2.12 isupper F
-GLIBC_2.12 isupper_l F
-GLIBC_2.12 iswalnum F
-GLIBC_2.12 iswalnum_l F
-GLIBC_2.12 iswalpha F
-GLIBC_2.12 iswalpha_l F
-GLIBC_2.12 iswblank F
-GLIBC_2.12 iswblank_l F
-GLIBC_2.12 iswcntrl F
-GLIBC_2.12 iswcntrl_l F
-GLIBC_2.12 iswctype F
-GLIBC_2.12 iswctype_l F
-GLIBC_2.12 iswdigit F
-GLIBC_2.12 iswdigit_l F
-GLIBC_2.12 iswgraph F
-GLIBC_2.12 iswgraph_l F
-GLIBC_2.12 iswlower F
-GLIBC_2.12 iswlower_l F
-GLIBC_2.12 iswprint F
-GLIBC_2.12 iswprint_l F
-GLIBC_2.12 iswpunct F
-GLIBC_2.12 iswpunct_l F
-GLIBC_2.12 iswspace F
-GLIBC_2.12 iswspace_l F
-GLIBC_2.12 iswupper F
-GLIBC_2.12 iswupper_l F
-GLIBC_2.12 iswxdigit F
-GLIBC_2.12 iswxdigit_l F
-GLIBC_2.12 isxdigit F
-GLIBC_2.12 isxdigit_l F
-GLIBC_2.12 jrand48 F
-GLIBC_2.12 jrand48_r F
-GLIBC_2.12 key_decryptsession F
-GLIBC_2.12 key_decryptsession_pk F
-GLIBC_2.12 key_encryptsession F
-GLIBC_2.12 key_encryptsession_pk F
-GLIBC_2.12 key_gendes F
-GLIBC_2.12 key_get_conv F
-GLIBC_2.12 key_secretkey_is_set F
-GLIBC_2.12 key_setnet F
-GLIBC_2.12 key_setsecret F
-GLIBC_2.12 kill F
-GLIBC_2.12 killpg F
-GLIBC_2.12 klogctl F
-GLIBC_2.12 l64a F
-GLIBC_2.12 labs F
-GLIBC_2.12 lchmod F
-GLIBC_2.12 lchown F
-GLIBC_2.12 lckpwdf F
-GLIBC_2.12 lcong48 F
-GLIBC_2.12 lcong48_r F
-GLIBC_2.12 ldexp F
-GLIBC_2.12 ldexpf F
-GLIBC_2.12 ldexpl F
-GLIBC_2.12 ldiv F
-GLIBC_2.12 lfind F
-GLIBC_2.12 lgetxattr F
-GLIBC_2.12 link F
-GLIBC_2.12 linkat F
-GLIBC_2.12 listen F
-GLIBC_2.12 listxattr F
-GLIBC_2.12 llabs F
-GLIBC_2.12 lldiv F
-GLIBC_2.12 llistxattr F
-GLIBC_2.12 llseek F
-GLIBC_2.12 loc1 D 0x4
-GLIBC_2.12 loc2 D 0x4
-GLIBC_2.12 localeconv F
-GLIBC_2.12 localtime F
-GLIBC_2.12 localtime_r F
-GLIBC_2.12 lockf F
-GLIBC_2.12 lockf64 F
-GLIBC_2.12 locs D 0x4
-GLIBC_2.12 longjmp F
-GLIBC_2.12 lrand48 F
-GLIBC_2.12 lrand48_r F
-GLIBC_2.12 lremovexattr F
-GLIBC_2.12 lsearch F
-GLIBC_2.12 lseek F
-GLIBC_2.12 lseek64 F
-GLIBC_2.12 lsetxattr F
-GLIBC_2.12 lutimes F
-GLIBC_2.12 madvise F
-GLIBC_2.12 makecontext F
-GLIBC_2.12 mallinfo F
-GLIBC_2.12 malloc F
-GLIBC_2.12 malloc_get_state F
-GLIBC_2.12 malloc_info F
-GLIBC_2.12 malloc_set_state F
-GLIBC_2.12 malloc_stats F
-GLIBC_2.12 malloc_trim F
-GLIBC_2.12 malloc_usable_size F
-GLIBC_2.12 mallopt F
-GLIBC_2.12 mallwatch D 0x4
-GLIBC_2.12 mblen F
-GLIBC_2.12 mbrlen F
-GLIBC_2.12 mbrtowc F
-GLIBC_2.12 mbsinit F
-GLIBC_2.12 mbsnrtowcs F
-GLIBC_2.12 mbsrtowcs F
-GLIBC_2.12 mbstowcs F
-GLIBC_2.12 mbtowc F
-GLIBC_2.12 mcheck F
-GLIBC_2.12 mcheck_check_all F
-GLIBC_2.12 mcheck_pedantic F
-GLIBC_2.12 mcount F
-GLIBC_2.12 memalign F
-GLIBC_2.12 memccpy F
-GLIBC_2.12 memchr F
-GLIBC_2.12 memcmp F
-GLIBC_2.12 memcpy F
-GLIBC_2.12 memfrob F
-GLIBC_2.12 memmem F
-GLIBC_2.12 memmove F
-GLIBC_2.12 mempcpy F
-GLIBC_2.12 memrchr F
-GLIBC_2.12 memset F
-GLIBC_2.12 mincore F
-GLIBC_2.12 mkdir F
-GLIBC_2.12 mkdirat F
-GLIBC_2.12 mkdtemp F
-GLIBC_2.12 mkfifo F
-GLIBC_2.12 mkfifoat F
-GLIBC_2.12 mkostemp F
-GLIBC_2.12 mkostemp64 F
-GLIBC_2.12 mkostemps F
-GLIBC_2.12 mkostemps64 F
-GLIBC_2.12 mkstemp F
-GLIBC_2.12 mkstemp64 F
-GLIBC_2.12 mkstemps F
-GLIBC_2.12 mkstemps64 F
-GLIBC_2.12 mktemp F
-GLIBC_2.12 mktime F
-GLIBC_2.12 mlock F
-GLIBC_2.12 mlockall F
-GLIBC_2.12 mmap F
-GLIBC_2.12 mmap64 F
-GLIBC_2.12 modf F
-GLIBC_2.12 modff F
-GLIBC_2.12 modfl F
-GLIBC_2.12 moncontrol F
-GLIBC_2.12 monstartup F
-GLIBC_2.12 mount F
-GLIBC_2.12 mprobe F
-GLIBC_2.12 mprotect F
-GLIBC_2.12 mrand48 F
-GLIBC_2.12 mrand48_r F
-GLIBC_2.12 mremap F
-GLIBC_2.12 msgctl F
-GLIBC_2.12 msgget F
-GLIBC_2.12 msgrcv F
-GLIBC_2.12 msgsnd F
-GLIBC_2.12 msync F
-GLIBC_2.12 mtrace F
-GLIBC_2.12 munlock F
-GLIBC_2.12 munlockall F
-GLIBC_2.12 munmap F
-GLIBC_2.12 muntrace F
-GLIBC_2.12 nanosleep F
-GLIBC_2.12 netname2host F
-GLIBC_2.12 netname2user F
-GLIBC_2.12 newlocale F
-GLIBC_2.12 nfsservctl F
-GLIBC_2.12 nftw F
-GLIBC_2.12 nftw64 F
-GLIBC_2.12 ngettext F
-GLIBC_2.12 nice F
-GLIBC_2.12 nl_langinfo F
-GLIBC_2.12 nl_langinfo_l F
-GLIBC_2.12 nrand48 F
-GLIBC_2.12 nrand48_r F
-GLIBC_2.12 ntohl F
-GLIBC_2.12 ntohs F
-GLIBC_2.12 ntp_adjtime F
-GLIBC_2.12 ntp_gettime F
-GLIBC_2.12 ntp_gettimex F
-GLIBC_2.12 obstack_alloc_failed_handler D 0x4
-GLIBC_2.12 obstack_exit_failure D 0x4
-GLIBC_2.12 obstack_free F
-GLIBC_2.12 obstack_printf F
-GLIBC_2.12 obstack_vprintf F
-GLIBC_2.12 on_exit F
-GLIBC_2.12 open F
-GLIBC_2.12 open64 F
-GLIBC_2.12 open_memstream F
-GLIBC_2.12 open_wmemstream F
-GLIBC_2.12 openat F
-GLIBC_2.12 openat64 F
-GLIBC_2.12 opendir F
-GLIBC_2.12 openlog F
-GLIBC_2.12 optarg D 0x4
-GLIBC_2.12 opterr D 0x4
-GLIBC_2.12 optind D 0x4
-GLIBC_2.12 optopt D 0x4
-GLIBC_2.12 parse_printf_format F
-GLIBC_2.12 passwd2des F
-GLIBC_2.12 pathconf F
-GLIBC_2.12 pause F
-GLIBC_2.12 pclose F
-GLIBC_2.12 perror F
-GLIBC_2.12 personality F
-GLIBC_2.12 pipe F
-GLIBC_2.12 pipe2 F
-GLIBC_2.12 pivot_root F
-GLIBC_2.12 pmap_getmaps F
-GLIBC_2.12 pmap_getport F
-GLIBC_2.12 pmap_rmtcall F
-GLIBC_2.12 pmap_set F
-GLIBC_2.12 pmap_unset F
-GLIBC_2.12 poll F
-GLIBC_2.12 popen F
-GLIBC_2.12 posix_fadvise F
-GLIBC_2.12 posix_fadvise64 F
-GLIBC_2.12 posix_fallocate F
-GLIBC_2.12 posix_fallocate64 F
-GLIBC_2.12 posix_madvise F
-GLIBC_2.12 posix_memalign F
-GLIBC_2.12 posix_openpt F
-GLIBC_2.12 posix_spawn F
-GLIBC_2.12 posix_spawn_file_actions_addclose F
-GLIBC_2.12 posix_spawn_file_actions_adddup2 F
-GLIBC_2.12 posix_spawn_file_actions_addopen F
-GLIBC_2.12 posix_spawn_file_actions_destroy F
-GLIBC_2.12 posix_spawn_file_actions_init F
-GLIBC_2.12 posix_spawnattr_destroy F
-GLIBC_2.12 posix_spawnattr_getflags F
-GLIBC_2.12 posix_spawnattr_getpgroup F
-GLIBC_2.12 posix_spawnattr_getschedparam F
-GLIBC_2.12 posix_spawnattr_getschedpolicy F
-GLIBC_2.12 posix_spawnattr_getsigdefault F
-GLIBC_2.12 posix_spawnattr_getsigmask F
-GLIBC_2.12 posix_spawnattr_init F
-GLIBC_2.12 posix_spawnattr_setflags F
-GLIBC_2.12 posix_spawnattr_setpgroup F
-GLIBC_2.12 posix_spawnattr_setschedparam F
-GLIBC_2.12 posix_spawnattr_setschedpolicy F
-GLIBC_2.12 posix_spawnattr_setsigdefault F
-GLIBC_2.12 posix_spawnattr_setsigmask F
-GLIBC_2.12 posix_spawnp F
-GLIBC_2.12 ppoll F
-GLIBC_2.12 prctl F
-GLIBC_2.12 pread F
-GLIBC_2.12 pread64 F
-GLIBC_2.12 preadv F
-GLIBC_2.12 preadv64 F
-GLIBC_2.12 printf F
-GLIBC_2.12 printf_size F
-GLIBC_2.12 printf_size_info F
-GLIBC_2.12 profil F
-GLIBC_2.12 program_invocation_name D 0x4
-GLIBC_2.12 program_invocation_short_name D 0x4
-GLIBC_2.12 pselect F
-GLIBC_2.12 psiginfo F
-GLIBC_2.12 psignal F
-GLIBC_2.12 pthread_attr_destroy F
-GLIBC_2.12 pthread_attr_getdetachstate F
-GLIBC_2.12 pthread_attr_getinheritsched F
-GLIBC_2.12 pthread_attr_getschedparam F
-GLIBC_2.12 pthread_attr_getschedpolicy F
-GLIBC_2.12 pthread_attr_getscope F
-GLIBC_2.12 pthread_attr_init F
-GLIBC_2.12 pthread_attr_setdetachstate F
-GLIBC_2.12 pthread_attr_setinheritsched F
-GLIBC_2.12 pthread_attr_setschedparam F
-GLIBC_2.12 pthread_attr_setschedpolicy F
-GLIBC_2.12 pthread_attr_setscope F
-GLIBC_2.12 pthread_cond_broadcast F
-GLIBC_2.12 pthread_cond_destroy F
-GLIBC_2.12 pthread_cond_init F
-GLIBC_2.12 pthread_cond_signal F
-GLIBC_2.12 pthread_cond_timedwait F
-GLIBC_2.12 pthread_cond_wait F
-GLIBC_2.12 pthread_condattr_destroy F
-GLIBC_2.12 pthread_condattr_init F
-GLIBC_2.12 pthread_equal F
-GLIBC_2.12 pthread_exit F
-GLIBC_2.12 pthread_getschedparam F
-GLIBC_2.12 pthread_mutex_destroy F
-GLIBC_2.12 pthread_mutex_init F
-GLIBC_2.12 pthread_mutex_lock F
-GLIBC_2.12 pthread_mutex_unlock F
-GLIBC_2.12 pthread_self F
-GLIBC_2.12 pthread_setcancelstate F
-GLIBC_2.12 pthread_setcanceltype F
-GLIBC_2.12 pthread_setschedparam F
-GLIBC_2.12 ptrace F
-GLIBC_2.12 ptsname F
-GLIBC_2.12 ptsname_r F
-GLIBC_2.12 putc F
-GLIBC_2.12 putc_unlocked F
-GLIBC_2.12 putchar F
-GLIBC_2.12 putchar_unlocked F
-GLIBC_2.12 putenv F
-GLIBC_2.12 putgrent F
-GLIBC_2.12 putmsg F
-GLIBC_2.12 putpmsg F
-GLIBC_2.12 putpwent F
-GLIBC_2.12 puts F
-GLIBC_2.12 putsgent F
-GLIBC_2.12 putspent F
-GLIBC_2.12 pututline F
-GLIBC_2.12 pututxline F
-GLIBC_2.12 putw F
-GLIBC_2.12 putwc F
-GLIBC_2.12 putwc_unlocked F
-GLIBC_2.12 putwchar F
-GLIBC_2.12 putwchar_unlocked F
-GLIBC_2.12 pvalloc F
-GLIBC_2.12 pwrite F
-GLIBC_2.12 pwrite64 F
-GLIBC_2.12 pwritev F
-GLIBC_2.12 pwritev64 F
-GLIBC_2.12 qecvt F
-GLIBC_2.12 qecvt_r F
-GLIBC_2.12 qfcvt F
-GLIBC_2.12 qfcvt_r F
-GLIBC_2.12 qgcvt F
-GLIBC_2.12 qsort F
-GLIBC_2.12 qsort_r F
-GLIBC_2.12 query_module F
-GLIBC_2.12 quick_exit F
-GLIBC_2.12 quotactl F
-GLIBC_2.12 raise F
-GLIBC_2.12 rand F
-GLIBC_2.12 rand_r F
-GLIBC_2.12 random F
-GLIBC_2.12 random_r F
-GLIBC_2.12 rawmemchr F
-GLIBC_2.12 rcmd F
-GLIBC_2.12 rcmd_af F
-GLIBC_2.12 re_comp F
-GLIBC_2.12 re_compile_fastmap F
-GLIBC_2.12 re_compile_pattern F
-GLIBC_2.12 re_exec F
-GLIBC_2.12 re_match F
-GLIBC_2.12 re_match_2 F
-GLIBC_2.12 re_search F
-GLIBC_2.12 re_search_2 F
-GLIBC_2.12 re_set_registers F
-GLIBC_2.12 re_set_syntax F
-GLIBC_2.12 re_syntax_options D 0x4
-GLIBC_2.12 read F
-GLIBC_2.12 readahead F
-GLIBC_2.12 readdir F
-GLIBC_2.12 readdir64 F
-GLIBC_2.12 readdir64_r F
-GLIBC_2.12 readdir_r F
-GLIBC_2.12 readlink F
-GLIBC_2.12 readlinkat F
-GLIBC_2.12 readv F
-GLIBC_2.12 realloc F
-GLIBC_2.12 realpath F
-GLIBC_2.12 reboot F
-GLIBC_2.12 recv F
-GLIBC_2.12 recvfrom F
-GLIBC_2.12 recvmmsg F
-GLIBC_2.12 recvmsg F
-GLIBC_2.12 regcomp F
-GLIBC_2.12 regerror F
-GLIBC_2.12 regexec F
-GLIBC_2.12 regfree F
-GLIBC_2.12 register_printf_function F
-GLIBC_2.12 register_printf_modifier F
-GLIBC_2.12 register_printf_specifier F
-GLIBC_2.12 register_printf_type F
-GLIBC_2.12 registerrpc F
-GLIBC_2.12 remap_file_pages F
-GLIBC_2.12 remove F
-GLIBC_2.12 removexattr F
-GLIBC_2.12 remque F
-GLIBC_2.12 rename F
-GLIBC_2.12 renameat F
-GLIBC_2.12 revoke F
-GLIBC_2.12 rewind F
-GLIBC_2.12 rewinddir F
-GLIBC_2.12 rexec F
-GLIBC_2.12 rexec_af F
-GLIBC_2.12 rexecoptions D 0x4
-GLIBC_2.12 rindex F
-GLIBC_2.12 rmdir F
-GLIBC_2.12 rpc_createerr D 0x10
-GLIBC_2.12 rpmatch F
-GLIBC_2.12 rresvport F
-GLIBC_2.12 rresvport_af F
-GLIBC_2.12 rtime F
-GLIBC_2.12 ruserok F
-GLIBC_2.12 ruserok_af F
-GLIBC_2.12 ruserpass F
-GLIBC_2.12 sbrk F
-GLIBC_2.12 scalbn F
-GLIBC_2.12 scalbnf F
-GLIBC_2.12 scalbnl F
-GLIBC_2.12 scandir F
-GLIBC_2.12 scandir64 F
-GLIBC_2.12 scanf F
-GLIBC_2.12 sched_get_priority_max F
-GLIBC_2.12 sched_get_priority_min F
-GLIBC_2.12 sched_getaffinity F
-GLIBC_2.12 sched_getcpu F
-GLIBC_2.12 sched_getparam F
-GLIBC_2.12 sched_getscheduler F
-GLIBC_2.12 sched_rr_get_interval F
-GLIBC_2.12 sched_setaffinity F
-GLIBC_2.12 sched_setparam F
-GLIBC_2.12 sched_setscheduler F
-GLIBC_2.12 sched_yield F
-GLIBC_2.12 seed48 F
-GLIBC_2.12 seed48_r F
-GLIBC_2.12 seekdir F
-GLIBC_2.12 select F
-GLIBC_2.12 semctl F
-GLIBC_2.12 semget F
-GLIBC_2.12 semop F
-GLIBC_2.12 semtimedop F
-GLIBC_2.12 send F
-GLIBC_2.12 sendfile F
-GLIBC_2.12 sendfile64 F
-GLIBC_2.12 sendmsg F
-GLIBC_2.12 sendto F
-GLIBC_2.12 set_dataplane F
-GLIBC_2.12 setaliasent F
-GLIBC_2.12 setbuf F
-GLIBC_2.12 setbuffer F
-GLIBC_2.12 setcontext F
-GLIBC_2.12 setdomainname F
-GLIBC_2.12 setegid F
-GLIBC_2.12 setenv F
-GLIBC_2.12 seteuid F
-GLIBC_2.12 setfsent F
-GLIBC_2.12 setfsgid F
-GLIBC_2.12 setfsuid F
-GLIBC_2.12 setgid F
-GLIBC_2.12 setgrent F
-GLIBC_2.12 setgroups F
-GLIBC_2.12 sethostent F
-GLIBC_2.12 sethostid F
-GLIBC_2.12 sethostname F
-GLIBC_2.12 setipv4sourcefilter F
-GLIBC_2.12 setitimer F
-GLIBC_2.12 setjmp F
-GLIBC_2.12 setlinebuf F
-GLIBC_2.12 setlocale F
-GLIBC_2.12 setlogin F
-GLIBC_2.12 setlogmask F
-GLIBC_2.12 setmntent F
-GLIBC_2.12 setnetent F
-GLIBC_2.12 setnetgrent F
-GLIBC_2.12 setpgid F
-GLIBC_2.12 setpgrp F
-GLIBC_2.12 setpriority F
-GLIBC_2.12 setprotoent F
-GLIBC_2.12 setpwent F
-GLIBC_2.12 setregid F
-GLIBC_2.12 setresgid F
-GLIBC_2.12 setresuid F
-GLIBC_2.12 setreuid F
-GLIBC_2.12 setrlimit F
-GLIBC_2.12 setrlimit64 F
-GLIBC_2.12 setrpcent F
-GLIBC_2.12 setservent F
-GLIBC_2.12 setsgent F
-GLIBC_2.12 setsid F
-GLIBC_2.12 setsockopt F
-GLIBC_2.12 setsourcefilter F
-GLIBC_2.12 setspent F
-GLIBC_2.12 setstate F
-GLIBC_2.12 setstate_r F
-GLIBC_2.12 settimeofday F
-GLIBC_2.12 setttyent F
-GLIBC_2.12 setuid F
-GLIBC_2.12 setusershell F
-GLIBC_2.12 setutent F
-GLIBC_2.12 setutxent F
-GLIBC_2.12 setvbuf F
-GLIBC_2.12 setxattr F
-GLIBC_2.12 sgetsgent F
-GLIBC_2.12 sgetsgent_r F
-GLIBC_2.12 sgetspent F
-GLIBC_2.12 sgetspent_r F
-GLIBC_2.12 shmat F
-GLIBC_2.12 shmctl F
-GLIBC_2.12 shmdt F
-GLIBC_2.12 shmget F
-GLIBC_2.12 shutdown F
-GLIBC_2.12 sigaction F
-GLIBC_2.12 sigaddset F
-GLIBC_2.12 sigaltstack F
-GLIBC_2.12 sigandset F
-GLIBC_2.12 sigblock F
-GLIBC_2.12 sigdelset F
-GLIBC_2.12 sigemptyset F
-GLIBC_2.12 sigfillset F
-GLIBC_2.12 siggetmask F
-GLIBC_2.12 sighold F
-GLIBC_2.12 sigignore F
-GLIBC_2.12 siginterrupt F
-GLIBC_2.12 sigisemptyset F
-GLIBC_2.12 sigismember F
-GLIBC_2.12 siglongjmp F
-GLIBC_2.12 signal F
-GLIBC_2.12 signalfd F
-GLIBC_2.12 sigorset F
-GLIBC_2.12 sigpause F
-GLIBC_2.12 sigpending F
-GLIBC_2.12 sigprocmask F
-GLIBC_2.12 sigqueue F
-GLIBC_2.12 sigrelse F
-GLIBC_2.12 sigreturn F
-GLIBC_2.12 sigset F
-GLIBC_2.12 sigsetmask F
-GLIBC_2.12 sigstack F
-GLIBC_2.12 sigsuspend F
-GLIBC_2.12 sigtimedwait F
-GLIBC_2.12 sigvec F
-GLIBC_2.12 sigwait F
-GLIBC_2.12 sigwaitinfo F
-GLIBC_2.12 sleep F
-GLIBC_2.12 snprintf F
-GLIBC_2.12 sockatmark F
-GLIBC_2.12 socket F
-GLIBC_2.12 socketpair F
-GLIBC_2.12 splice F
-GLIBC_2.12 sprintf F
-GLIBC_2.12 sprofil F
-GLIBC_2.12 srand F
-GLIBC_2.12 srand48 F
-GLIBC_2.12 srand48_r F
-GLIBC_2.12 srandom F
-GLIBC_2.12 srandom_r F
-GLIBC_2.12 sscanf F
-GLIBC_2.12 ssignal F
-GLIBC_2.12 sstk F
-GLIBC_2.12 statfs F
-GLIBC_2.12 statfs64 F
-GLIBC_2.12 statvfs F
-GLIBC_2.12 statvfs64 F
-GLIBC_2.12 stderr D 0x4
-GLIBC_2.12 stdin D 0x4
-GLIBC_2.12 stdout D 0x4
-GLIBC_2.12 step F
-GLIBC_2.12 stime F
-GLIBC_2.12 stpcpy F
-GLIBC_2.12 stpncpy F
-GLIBC_2.12 strcasecmp F
-GLIBC_2.12 strcasecmp_l F
-GLIBC_2.12 strcasestr F
-GLIBC_2.12 strcat F
-GLIBC_2.12 strchr F
-GLIBC_2.12 strchrnul F
-GLIBC_2.12 strcmp F
-GLIBC_2.12 strcoll F
-GLIBC_2.12 strcoll_l F
-GLIBC_2.12 strcpy F
-GLIBC_2.12 strcspn F
-GLIBC_2.12 strdup F
-GLIBC_2.12 strerror F
-GLIBC_2.12 strerror_l F
-GLIBC_2.12 strerror_r F
-GLIBC_2.12 strfmon F
-GLIBC_2.12 strfmon_l F
-GLIBC_2.12 strfry F
-GLIBC_2.12 strftime F
-GLIBC_2.12 strftime_l F
-GLIBC_2.12 strlen F
-GLIBC_2.12 strncasecmp F
-GLIBC_2.12 strncasecmp_l F
-GLIBC_2.12 strncat F
-GLIBC_2.12 strncmp F
-GLIBC_2.12 strncpy F
-GLIBC_2.12 strndup F
-GLIBC_2.12 strnlen F
-GLIBC_2.12 strpbrk F
-GLIBC_2.12 strptime F
-GLIBC_2.12 strptime_l F
-GLIBC_2.12 strrchr F
-GLIBC_2.12 strsep F
-GLIBC_2.12 strsignal F
-GLIBC_2.12 strspn F
-GLIBC_2.12 strstr F
-GLIBC_2.12 strtod F
-GLIBC_2.12 strtod_l F
-GLIBC_2.12 strtof F
-GLIBC_2.12 strtof_l F
-GLIBC_2.12 strtoimax F
-GLIBC_2.12 strtok F
-GLIBC_2.12 strtok_r F
-GLIBC_2.12 strtol F
-GLIBC_2.12 strtol_l F
-GLIBC_2.12 strtold F
-GLIBC_2.12 strtold_l F
-GLIBC_2.12 strtoll F
-GLIBC_2.12 strtoll_l F
-GLIBC_2.12 strtoq F
-GLIBC_2.12 strtoul F
-GLIBC_2.12 strtoul_l F
-GLIBC_2.12 strtoull F
-GLIBC_2.12 strtoull_l F
-GLIBC_2.12 strtoumax F
-GLIBC_2.12 strtouq F
-GLIBC_2.12 strverscmp F
-GLIBC_2.12 strxfrm F
-GLIBC_2.12 strxfrm_l F
-GLIBC_2.12 stty F
-GLIBC_2.12 svc_exit F
-GLIBC_2.12 svc_fdset D 0x80
-GLIBC_2.12 svc_getreq F
-GLIBC_2.12 svc_getreq_common F
-GLIBC_2.12 svc_getreq_poll F
-GLIBC_2.12 svc_getreqset F
-GLIBC_2.12 svc_max_pollfd D 0x4
-GLIBC_2.12 svc_pollfd D 0x4
-GLIBC_2.12 svc_register F
-GLIBC_2.12 svc_run F
-GLIBC_2.12 svc_sendreply F
-GLIBC_2.12 svc_unregister F
-GLIBC_2.12 svcauthdes_stats D 0xc
-GLIBC_2.12 svcerr_auth F
-GLIBC_2.12 svcerr_decode F
-GLIBC_2.12 svcerr_noproc F
-GLIBC_2.12 svcerr_noprog F
-GLIBC_2.12 svcerr_progvers F
-GLIBC_2.12 svcerr_systemerr F
-GLIBC_2.12 svcerr_weakauth F
-GLIBC_2.12 svcfd_create F
-GLIBC_2.12 svcraw_create F
-GLIBC_2.12 svctcp_create F
-GLIBC_2.12 svcudp_bufcreate F
-GLIBC_2.12 svcudp_create F
-GLIBC_2.12 svcudp_enablecache F
-GLIBC_2.12 svcunix_create F
-GLIBC_2.12 svcunixfd_create F
-GLIBC_2.12 swab F
-GLIBC_2.12 swapcontext F
-GLIBC_2.12 swapoff F
-GLIBC_2.12 swapon F
-GLIBC_2.12 swprintf F
-GLIBC_2.12 swscanf F
-GLIBC_2.12 symlink F
-GLIBC_2.12 symlinkat F
-GLIBC_2.12 sync F
-GLIBC_2.12 sync_file_range F
-GLIBC_2.12 sys_errlist D 0x21c
-GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.12 sys_sigabbrev D 0x104
-GLIBC_2.12 sys_siglist D 0x104
-GLIBC_2.12 syscall F
-GLIBC_2.12 sysconf F
-GLIBC_2.12 sysctl F
-GLIBC_2.12 sysinfo F
-GLIBC_2.12 syslog F
-GLIBC_2.12 system F
-GLIBC_2.12 sysv_signal F
-GLIBC_2.12 tcdrain F
-GLIBC_2.12 tcflow F
-GLIBC_2.12 tcflush F
-GLIBC_2.12 tcgetattr F
-GLIBC_2.12 tcgetpgrp F
-GLIBC_2.12 tcgetsid F
-GLIBC_2.12 tcsendbreak F
-GLIBC_2.12 tcsetattr F
-GLIBC_2.12 tcsetpgrp F
-GLIBC_2.12 tdelete F
-GLIBC_2.12 tdestroy F
-GLIBC_2.12 tee F
-GLIBC_2.12 telldir F
-GLIBC_2.12 tempnam F
-GLIBC_2.12 textdomain F
-GLIBC_2.12 tfind F
-GLIBC_2.12 time F
-GLIBC_2.12 timegm F
-GLIBC_2.12 timelocal F
-GLIBC_2.12 timerfd_create F
-GLIBC_2.12 timerfd_gettime F
-GLIBC_2.12 timerfd_settime F
-GLIBC_2.12 times F
-GLIBC_2.12 timezone D 0x4
-GLIBC_2.12 tmpfile F
-GLIBC_2.12 tmpfile64 F
-GLIBC_2.12 tmpnam F
-GLIBC_2.12 tmpnam_r F
-GLIBC_2.12 toascii F
-GLIBC_2.12 tolower F
-GLIBC_2.12 tolower_l F
-GLIBC_2.12 toupper F
-GLIBC_2.12 toupper_l F
-GLIBC_2.12 towctrans F
-GLIBC_2.12 towctrans_l F
-GLIBC_2.12 towlower F
-GLIBC_2.12 towlower_l F
-GLIBC_2.12 towupper F
-GLIBC_2.12 towupper_l F
-GLIBC_2.12 tr_break F
-GLIBC_2.12 truncate F
-GLIBC_2.12 truncate64 F
-GLIBC_2.12 tsearch F
-GLIBC_2.12 ttyname F
-GLIBC_2.12 ttyname_r F
-GLIBC_2.12 ttyslot F
-GLIBC_2.12 twalk F
-GLIBC_2.12 tzname D 0x8
-GLIBC_2.12 tzset F
-GLIBC_2.12 ualarm F
-GLIBC_2.12 ulckpwdf F
-GLIBC_2.12 ulimit F
-GLIBC_2.12 umask F
-GLIBC_2.12 umount F
-GLIBC_2.12 umount2 F
-GLIBC_2.12 uname F
-GLIBC_2.12 ungetc F
-GLIBC_2.12 ungetwc F
-GLIBC_2.12 unlink F
-GLIBC_2.12 unlinkat F
-GLIBC_2.12 unlockpt F
-GLIBC_2.12 unsetenv F
-GLIBC_2.12 unshare F
-GLIBC_2.12 updwtmp F
-GLIBC_2.12 updwtmpx F
-GLIBC_2.12 uselib F
-GLIBC_2.12 uselocale F
-GLIBC_2.12 user2netname F
-GLIBC_2.12 usleep F
-GLIBC_2.12 ustat F
-GLIBC_2.12 utime F
-GLIBC_2.12 utimensat F
-GLIBC_2.12 utimes F
-GLIBC_2.12 utmpname F
-GLIBC_2.12 utmpxname F
-GLIBC_2.12 valloc F
-GLIBC_2.12 vasprintf F
-GLIBC_2.12 vdprintf F
-GLIBC_2.12 verr F
-GLIBC_2.12 verrx F
-GLIBC_2.12 versionsort F
-GLIBC_2.12 versionsort64 F
-GLIBC_2.12 vfork F
-GLIBC_2.12 vfprintf F
-GLIBC_2.12 vfscanf F
-GLIBC_2.12 vfwprintf F
-GLIBC_2.12 vfwscanf F
-GLIBC_2.12 vhangup F
-GLIBC_2.12 vlimit F
-GLIBC_2.12 vmsplice F
-GLIBC_2.12 vprintf F
-GLIBC_2.12 vscanf F
-GLIBC_2.12 vsnprintf F
-GLIBC_2.12 vsprintf F
-GLIBC_2.12 vsscanf F
-GLIBC_2.12 vswprintf F
-GLIBC_2.12 vswscanf F
-GLIBC_2.12 vsyslog F
-GLIBC_2.12 vtimes F
-GLIBC_2.12 vwarn F
-GLIBC_2.12 vwarnx F
-GLIBC_2.12 vwprintf F
-GLIBC_2.12 vwscanf F
-GLIBC_2.12 wait F
-GLIBC_2.12 wait3 F
-GLIBC_2.12 wait4 F
-GLIBC_2.12 waitid F
-GLIBC_2.12 waitpid F
-GLIBC_2.12 warn F
-GLIBC_2.12 warnx F
-GLIBC_2.12 wcpcpy F
-GLIBC_2.12 wcpncpy F
-GLIBC_2.12 wcrtomb F
-GLIBC_2.12 wcscasecmp F
-GLIBC_2.12 wcscasecmp_l F
-GLIBC_2.12 wcscat F
-GLIBC_2.12 wcschr F
-GLIBC_2.12 wcschrnul F
-GLIBC_2.12 wcscmp F
-GLIBC_2.12 wcscoll F
-GLIBC_2.12 wcscoll_l F
-GLIBC_2.12 wcscpy F
-GLIBC_2.12 wcscspn F
-GLIBC_2.12 wcsdup F
-GLIBC_2.12 wcsftime F
-GLIBC_2.12 wcsftime_l F
-GLIBC_2.12 wcslen F
-GLIBC_2.12 wcsncasecmp F
-GLIBC_2.12 wcsncasecmp_l F
-GLIBC_2.12 wcsncat F
-GLIBC_2.12 wcsncmp F
-GLIBC_2.12 wcsncpy F
-GLIBC_2.12 wcsnlen F
-GLIBC_2.12 wcsnrtombs F
-GLIBC_2.12 wcspbrk F
-GLIBC_2.12 wcsrchr F
-GLIBC_2.12 wcsrtombs F
-GLIBC_2.12 wcsspn F
-GLIBC_2.12 wcsstr F
-GLIBC_2.12 wcstod F
-GLIBC_2.12 wcstod_l F
-GLIBC_2.12 wcstof F
-GLIBC_2.12 wcstof_l F
-GLIBC_2.12 wcstoimax F
-GLIBC_2.12 wcstok F
-GLIBC_2.12 wcstol F
-GLIBC_2.12 wcstol_l F
-GLIBC_2.12 wcstold F
-GLIBC_2.12 wcstold_l F
-GLIBC_2.12 wcstoll F
-GLIBC_2.12 wcstoll_l F
-GLIBC_2.12 wcstombs F
-GLIBC_2.12 wcstoq F
-GLIBC_2.12 wcstoul F
-GLIBC_2.12 wcstoul_l F
-GLIBC_2.12 wcstoull F
-GLIBC_2.12 wcstoull_l F
-GLIBC_2.12 wcstoumax F
-GLIBC_2.12 wcstouq F
-GLIBC_2.12 wcswcs F
-GLIBC_2.12 wcswidth F
-GLIBC_2.12 wcsxfrm F
-GLIBC_2.12 wcsxfrm_l F
-GLIBC_2.12 wctob F
-GLIBC_2.12 wctomb F
-GLIBC_2.12 wctrans F
-GLIBC_2.12 wctrans_l F
-GLIBC_2.12 wctype F
-GLIBC_2.12 wctype_l F
-GLIBC_2.12 wcwidth F
-GLIBC_2.12 wmemchr F
-GLIBC_2.12 wmemcmp F
-GLIBC_2.12 wmemcpy F
-GLIBC_2.12 wmemmove F
-GLIBC_2.12 wmempcpy F
-GLIBC_2.12 wmemset F
-GLIBC_2.12 wordexp F
-GLIBC_2.12 wordfree F
-GLIBC_2.12 wprintf F
-GLIBC_2.12 write F
-GLIBC_2.12 writev F
-GLIBC_2.12 wscanf F
-GLIBC_2.12 xdecrypt F
-GLIBC_2.12 xdr_accepted_reply F
-GLIBC_2.12 xdr_array F
-GLIBC_2.12 xdr_authdes_cred F
-GLIBC_2.12 xdr_authdes_verf F
-GLIBC_2.12 xdr_authunix_parms F
-GLIBC_2.12 xdr_bool F
-GLIBC_2.12 xdr_bytes F
-GLIBC_2.12 xdr_callhdr F
-GLIBC_2.12 xdr_callmsg F
-GLIBC_2.12 xdr_char F
-GLIBC_2.12 xdr_cryptkeyarg F
-GLIBC_2.12 xdr_cryptkeyarg2 F
-GLIBC_2.12 xdr_cryptkeyres F
-GLIBC_2.12 xdr_des_block F
-GLIBC_2.12 xdr_double F
-GLIBC_2.12 xdr_enum F
-GLIBC_2.12 xdr_float F
-GLIBC_2.12 xdr_free F
-GLIBC_2.12 xdr_getcredres F
-GLIBC_2.12 xdr_hyper F
-GLIBC_2.12 xdr_int F
-GLIBC_2.12 xdr_int16_t F
-GLIBC_2.12 xdr_int32_t F
-GLIBC_2.12 xdr_int64_t F
-GLIBC_2.12 xdr_int8_t F
-GLIBC_2.12 xdr_key_netstarg F
-GLIBC_2.12 xdr_key_netstres F
-GLIBC_2.12 xdr_keybuf F
-GLIBC_2.12 xdr_keystatus F
-GLIBC_2.12 xdr_long F
-GLIBC_2.12 xdr_longlong_t F
-GLIBC_2.12 xdr_netnamestr F
-GLIBC_2.12 xdr_netobj F
-GLIBC_2.12 xdr_opaque F
-GLIBC_2.12 xdr_opaque_auth F
-GLIBC_2.12 xdr_pmap F
-GLIBC_2.12 xdr_pmaplist F
-GLIBC_2.12 xdr_pointer F
-GLIBC_2.12 xdr_quad_t F
-GLIBC_2.12 xdr_reference F
-GLIBC_2.12 xdr_rejected_reply F
-GLIBC_2.12 xdr_replymsg F
-GLIBC_2.12 xdr_rmtcall_args F
-GLIBC_2.12 xdr_rmtcallres F
-GLIBC_2.12 xdr_short F
-GLIBC_2.12 xdr_sizeof F
-GLIBC_2.12 xdr_string F
-GLIBC_2.12 xdr_u_char F
-GLIBC_2.12 xdr_u_hyper F
-GLIBC_2.12 xdr_u_int F
-GLIBC_2.12 xdr_u_long F
-GLIBC_2.12 xdr_u_longlong_t F
-GLIBC_2.12 xdr_u_quad_t F
-GLIBC_2.12 xdr_u_short F
-GLIBC_2.12 xdr_uint16_t F
-GLIBC_2.12 xdr_uint32_t F
-GLIBC_2.12 xdr_uint64_t F
-GLIBC_2.12 xdr_uint8_t F
-GLIBC_2.12 xdr_union F
-GLIBC_2.12 xdr_unixcred F
-GLIBC_2.12 xdr_vector F
-GLIBC_2.12 xdr_void F
-GLIBC_2.12 xdr_wrapstring F
-GLIBC_2.12 xdrmem_create F
-GLIBC_2.12 xdrrec_create F
-GLIBC_2.12 xdrrec_endofrecord F
-GLIBC_2.12 xdrrec_eof F
-GLIBC_2.12 xdrrec_skiprecord F
-GLIBC_2.12 xdrstdio_create F
-GLIBC_2.12 xencrypt F
-GLIBC_2.12 xprt_register F
-GLIBC_2.12 xprt_unregister F
-GLIBC_2.15 GLIBC_2.15 A
-GLIBC_2.15 __fdelt_chk F
-GLIBC_2.15 __fdelt_warn F
-GLIBC_2.15 clock_adjtime F
-GLIBC_2.15 fanotify_init F
-GLIBC_2.15 fanotify_mark F
-GLIBC_2.15 name_to_handle_at F
-GLIBC_2.15 open_by_handle_at F
-GLIBC_2.15 posix_spawn F
-GLIBC_2.15 posix_spawnp F
-GLIBC_2.15 prlimit F
-GLIBC_2.15 prlimit64 F
-GLIBC_2.15 process_vm_readv F
-GLIBC_2.15 process_vm_writev F
-GLIBC_2.15 scandirat F
-GLIBC_2.15 scandirat64 F
-GLIBC_2.15 sendmmsg F
-GLIBC_2.15 setns F
-GLIBC_2.15 syncfs F
-GLIBC_2.16 GLIBC_2.16 A
-GLIBC_2.16 __getauxval F
-GLIBC_2.16 __poll_chk F
-GLIBC_2.16 __ppoll_chk F
-GLIBC_2.16 aligned_alloc F
-GLIBC_2.16 c16rtomb F
-GLIBC_2.16 c32rtomb F
-GLIBC_2.16 getauxval F
-GLIBC_2.16 mbrtoc16 F
-GLIBC_2.16 mbrtoc32 F
-GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
-GLIBC_2.17 clock_getcpuclockid F
-GLIBC_2.17 clock_getres F
-GLIBC_2.17 clock_gettime F
-GLIBC_2.17 clock_nanosleep F
-GLIBC_2.17 clock_settime F
-GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
-GLIBC_2.23 fts64_children F
-GLIBC_2.23 fts64_close F
-GLIBC_2.23 fts64_open F
-GLIBC_2.23 fts64_read F
-GLIBC_2.23 fts64_set F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libcrypt.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libcrypt.abilist
deleted file mode 100644
index d5643802b7..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libcrypt.abilist
+++ /dev/null
@@ -1,8 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 crypt F
-GLIBC_2.12 crypt_r F
-GLIBC_2.12 encrypt F
-GLIBC_2.12 encrypt_r F
-GLIBC_2.12 fcrypt F
-GLIBC_2.12 setkey F
-GLIBC_2.12 setkey_r F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libdl.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libdl.abilist
deleted file mode 100644
index cabc30c239..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libdl.abilist
+++ /dev/null
@@ -1,10 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 dladdr F
-GLIBC_2.12 dladdr1 F
-GLIBC_2.12 dlclose F
-GLIBC_2.12 dlerror F
-GLIBC_2.12 dlinfo F
-GLIBC_2.12 dlmopen F
-GLIBC_2.12 dlopen F
-GLIBC_2.12 dlsym F
-GLIBC_2.12 dlvsym F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist
deleted file mode 100644
index 18b8d00bec..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist
+++ /dev/null
@@ -1,375 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 _LIB_VERSION D 0x4
-GLIBC_2.12 __clog10 F
-GLIBC_2.12 __clog10f F
-GLIBC_2.12 __clog10l F
-GLIBC_2.12 __finite F
-GLIBC_2.12 __finitef F
-GLIBC_2.12 __fpclassify F
-GLIBC_2.12 __fpclassifyf F
-GLIBC_2.12 __signbit F
-GLIBC_2.12 __signbitf F
-GLIBC_2.12 acos F
-GLIBC_2.12 acosf F
-GLIBC_2.12 acosh F
-GLIBC_2.12 acoshf F
-GLIBC_2.12 acoshl F
-GLIBC_2.12 acosl F
-GLIBC_2.12 asin F
-GLIBC_2.12 asinf F
-GLIBC_2.12 asinh F
-GLIBC_2.12 asinhf F
-GLIBC_2.12 asinhl F
-GLIBC_2.12 asinl F
-GLIBC_2.12 atan F
-GLIBC_2.12 atan2 F
-GLIBC_2.12 atan2f F
-GLIBC_2.12 atan2l F
-GLIBC_2.12 atanf F
-GLIBC_2.12 atanh F
-GLIBC_2.12 atanhf F
-GLIBC_2.12 atanhl F
-GLIBC_2.12 atanl F
-GLIBC_2.12 cabs F
-GLIBC_2.12 cabsf F
-GLIBC_2.12 cabsl F
-GLIBC_2.12 cacos F
-GLIBC_2.12 cacosf F
-GLIBC_2.12 cacosh F
-GLIBC_2.12 cacoshf F
-GLIBC_2.12 cacoshl F
-GLIBC_2.12 cacosl F
-GLIBC_2.12 carg F
-GLIBC_2.12 cargf F
-GLIBC_2.12 cargl F
-GLIBC_2.12 casin F
-GLIBC_2.12 casinf F
-GLIBC_2.12 casinh F
-GLIBC_2.12 casinhf F
-GLIBC_2.12 casinhl F
-GLIBC_2.12 casinl F
-GLIBC_2.12 catan F
-GLIBC_2.12 catanf F
-GLIBC_2.12 catanh F
-GLIBC_2.12 catanhf F
-GLIBC_2.12 catanhl F
-GLIBC_2.12 catanl F
-GLIBC_2.12 cbrt F
-GLIBC_2.12 cbrtf F
-GLIBC_2.12 cbrtl F
-GLIBC_2.12 ccos F
-GLIBC_2.12 ccosf F
-GLIBC_2.12 ccosh F
-GLIBC_2.12 ccoshf F
-GLIBC_2.12 ccoshl F
-GLIBC_2.12 ccosl F
-GLIBC_2.12 ceil F
-GLIBC_2.12 ceilf F
-GLIBC_2.12 ceill F
-GLIBC_2.12 cexp F
-GLIBC_2.12 cexpf F
-GLIBC_2.12 cexpl F
-GLIBC_2.12 cimag F
-GLIBC_2.12 cimagf F
-GLIBC_2.12 cimagl F
-GLIBC_2.12 clog F
-GLIBC_2.12 clog10 F
-GLIBC_2.12 clog10f F
-GLIBC_2.12 clog10l F
-GLIBC_2.12 clogf F
-GLIBC_2.12 clogl F
-GLIBC_2.12 conj F
-GLIBC_2.12 conjf F
-GLIBC_2.12 conjl F
-GLIBC_2.12 copysign F
-GLIBC_2.12 copysignf F
-GLIBC_2.12 copysignl F
-GLIBC_2.12 cos F
-GLIBC_2.12 cosf F
-GLIBC_2.12 cosh F
-GLIBC_2.12 coshf F
-GLIBC_2.12 coshl F
-GLIBC_2.12 cosl F
-GLIBC_2.12 cpow F
-GLIBC_2.12 cpowf F
-GLIBC_2.12 cpowl F
-GLIBC_2.12 cproj F
-GLIBC_2.12 cprojf F
-GLIBC_2.12 cprojl F
-GLIBC_2.12 creal F
-GLIBC_2.12 crealf F
-GLIBC_2.12 creall F
-GLIBC_2.12 csin F
-GLIBC_2.12 csinf F
-GLIBC_2.12 csinh F
-GLIBC_2.12 csinhf F
-GLIBC_2.12 csinhl F
-GLIBC_2.12 csinl F
-GLIBC_2.12 csqrt F
-GLIBC_2.12 csqrtf F
-GLIBC_2.12 csqrtl F
-GLIBC_2.12 ctan F
-GLIBC_2.12 ctanf F
-GLIBC_2.12 ctanh F
-GLIBC_2.12 ctanhf F
-GLIBC_2.12 ctanhl F
-GLIBC_2.12 ctanl F
-GLIBC_2.12 drem F
-GLIBC_2.12 dremf F
-GLIBC_2.12 dreml F
-GLIBC_2.12 erf F
-GLIBC_2.12 erfc F
-GLIBC_2.12 erfcf F
-GLIBC_2.12 erfcl F
-GLIBC_2.12 erff F
-GLIBC_2.12 erfl F
-GLIBC_2.12 exp F
-GLIBC_2.12 exp10 F
-GLIBC_2.12 exp10f F
-GLIBC_2.12 exp10l F
-GLIBC_2.12 exp2 F
-GLIBC_2.12 exp2f F
-GLIBC_2.12 exp2l F
-GLIBC_2.12 expf F
-GLIBC_2.12 expl F
-GLIBC_2.12 expm1 F
-GLIBC_2.12 expm1f F
-GLIBC_2.12 expm1l F
-GLIBC_2.12 fabs F
-GLIBC_2.12 fabsf F
-GLIBC_2.12 fabsl F
-GLIBC_2.12 fdim F
-GLIBC_2.12 fdimf F
-GLIBC_2.12 fdiml F
-GLIBC_2.12 feclearexcept F
-GLIBC_2.12 fedisableexcept F
-GLIBC_2.12 feenableexcept F
-GLIBC_2.12 fegetenv F
-GLIBC_2.12 fegetexcept F
-GLIBC_2.12 fegetexceptflag F
-GLIBC_2.12 fegetround F
-GLIBC_2.12 feholdexcept F
-GLIBC_2.12 feraiseexcept F
-GLIBC_2.12 fesetenv F
-GLIBC_2.12 fesetexceptflag F
-GLIBC_2.12 fesetround F
-GLIBC_2.12 fetestexcept F
-GLIBC_2.12 feupdateenv F
-GLIBC_2.12 finite F
-GLIBC_2.12 finitef F
-GLIBC_2.12 finitel F
-GLIBC_2.12 floor F
-GLIBC_2.12 floorf F
-GLIBC_2.12 floorl F
-GLIBC_2.12 fma F
-GLIBC_2.12 fmaf F
-GLIBC_2.12 fmal F
-GLIBC_2.12 fmax F
-GLIBC_2.12 fmaxf F
-GLIBC_2.12 fmaxl F
-GLIBC_2.12 fmin F
-GLIBC_2.12 fminf F
-GLIBC_2.12 fminl F
-GLIBC_2.12 fmod F
-GLIBC_2.12 fmodf F
-GLIBC_2.12 fmodl F
-GLIBC_2.12 frexp F
-GLIBC_2.12 frexpf F
-GLIBC_2.12 frexpl F
-GLIBC_2.12 gamma F
-GLIBC_2.12 gammaf F
-GLIBC_2.12 gammal F
-GLIBC_2.12 hypot F
-GLIBC_2.12 hypotf F
-GLIBC_2.12 hypotl F
-GLIBC_2.12 ilogb F
-GLIBC_2.12 ilogbf F
-GLIBC_2.12 ilogbl F
-GLIBC_2.12 j0 F
-GLIBC_2.12 j0f F
-GLIBC_2.12 j0l F
-GLIBC_2.12 j1 F
-GLIBC_2.12 j1f F
-GLIBC_2.12 j1l F
-GLIBC_2.12 jn F
-GLIBC_2.12 jnf F
-GLIBC_2.12 jnl F
-GLIBC_2.12 ldexp F
-GLIBC_2.12 ldexpf F
-GLIBC_2.12 ldexpl F
-GLIBC_2.12 lgamma F
-GLIBC_2.12 lgamma_r F
-GLIBC_2.12 lgammaf F
-GLIBC_2.12 lgammaf_r F
-GLIBC_2.12 lgammal F
-GLIBC_2.12 lgammal_r F
-GLIBC_2.12 llrint F
-GLIBC_2.12 llrintf F
-GLIBC_2.12 llrintl F
-GLIBC_2.12 llround F
-GLIBC_2.12 llroundf F
-GLIBC_2.12 llroundl F
-GLIBC_2.12 log F
-GLIBC_2.12 log10 F
-GLIBC_2.12 log10f F
-GLIBC_2.12 log10l F
-GLIBC_2.12 log1p F
-GLIBC_2.12 log1pf F
-GLIBC_2.12 log1pl F
-GLIBC_2.12 log2 F
-GLIBC_2.12 log2f F
-GLIBC_2.12 log2l F
-GLIBC_2.12 logb F
-GLIBC_2.12 logbf F
-GLIBC_2.12 logbl F
-GLIBC_2.12 logf F
-GLIBC_2.12 logl F
-GLIBC_2.12 lrint F
-GLIBC_2.12 lrintf F
-GLIBC_2.12 lrintl F
-GLIBC_2.12 lround F
-GLIBC_2.12 lroundf F
-GLIBC_2.12 lroundl F
-GLIBC_2.12 matherr F
-GLIBC_2.12 modf F
-GLIBC_2.12 modff F
-GLIBC_2.12 modfl F
-GLIBC_2.12 nan F
-GLIBC_2.12 nanf F
-GLIBC_2.12 nanl F
-GLIBC_2.12 nearbyint F
-GLIBC_2.12 nearbyintf F
-GLIBC_2.12 nearbyintl F
-GLIBC_2.12 nextafter F
-GLIBC_2.12 nextafterf F
-GLIBC_2.12 nextafterl F
-GLIBC_2.12 nexttoward F
-GLIBC_2.12 nexttowardf F
-GLIBC_2.12 nexttowardl F
-GLIBC_2.12 pow F
-GLIBC_2.12 pow10 F
-GLIBC_2.12 pow10f F
-GLIBC_2.12 pow10l F
-GLIBC_2.12 powf F
-GLIBC_2.12 powl F
-GLIBC_2.12 remainder F
-GLIBC_2.12 remainderf F
-GLIBC_2.12 remainderl F
-GLIBC_2.12 remquo F
-GLIBC_2.12 remquof F
-GLIBC_2.12 remquol F
-GLIBC_2.12 rint F
-GLIBC_2.12 rintf F
-GLIBC_2.12 rintl F
-GLIBC_2.12 round F
-GLIBC_2.12 roundf F
-GLIBC_2.12 roundl F
-GLIBC_2.12 scalb F
-GLIBC_2.12 scalbf F
-GLIBC_2.12 scalbl F
-GLIBC_2.12 scalbln F
-GLIBC_2.12 scalblnf F
-GLIBC_2.12 scalblnl F
-GLIBC_2.12 scalbn F
-GLIBC_2.12 scalbnf F
-GLIBC_2.12 scalbnl F
-GLIBC_2.12 signgam D 0x4
-GLIBC_2.12 significand F
-GLIBC_2.12 significandf F
-GLIBC_2.12 significandl F
-GLIBC_2.12 sin F
-GLIBC_2.12 sincos F
-GLIBC_2.12 sincosf F
-GLIBC_2.12 sincosl F
-GLIBC_2.12 sinf F
-GLIBC_2.12 sinh F
-GLIBC_2.12 sinhf F
-GLIBC_2.12 sinhl F
-GLIBC_2.12 sinl F
-GLIBC_2.12 sqrt F
-GLIBC_2.12 sqrtf F
-GLIBC_2.12 sqrtl F
-GLIBC_2.12 tan F
-GLIBC_2.12 tanf F
-GLIBC_2.12 tanh F
-GLIBC_2.12 tanhf F
-GLIBC_2.12 tanhl F
-GLIBC_2.12 tanl F
-GLIBC_2.12 tgamma F
-GLIBC_2.12 tgammaf F
-GLIBC_2.12 tgammal F
-GLIBC_2.12 trunc F
-GLIBC_2.12 truncf F
-GLIBC_2.12 truncl F
-GLIBC_2.12 y0 F
-GLIBC_2.12 y0f F
-GLIBC_2.12 y0l F
-GLIBC_2.12 y1 F
-GLIBC_2.12 y1f F
-GLIBC_2.12 y1l F
-GLIBC_2.12 yn F
-GLIBC_2.12 ynf F
-GLIBC_2.12 ynl F
-GLIBC_2.15 GLIBC_2.15 A
-GLIBC_2.15 __acos_finite F
-GLIBC_2.15 __acosf_finite F
-GLIBC_2.15 __acosh_finite F
-GLIBC_2.15 __acoshf_finite F
-GLIBC_2.15 __asin_finite F
-GLIBC_2.15 __asinf_finite F
-GLIBC_2.15 __atan2_finite F
-GLIBC_2.15 __atan2f_finite F
-GLIBC_2.15 __atanh_finite F
-GLIBC_2.15 __atanhf_finite F
-GLIBC_2.15 __cosh_finite F
-GLIBC_2.15 __coshf_finite F
-GLIBC_2.15 __exp10_finite F
-GLIBC_2.15 __exp10f_finite F
-GLIBC_2.15 __exp2_finite F
-GLIBC_2.15 __exp2f_finite F
-GLIBC_2.15 __exp_finite F
-GLIBC_2.15 __expf_finite F
-GLIBC_2.15 __fmod_finite F
-GLIBC_2.15 __fmodf_finite F
-GLIBC_2.15 __gamma_r_finite F
-GLIBC_2.15 __gammaf_r_finite F
-GLIBC_2.15 __hypot_finite F
-GLIBC_2.15 __hypotf_finite F
-GLIBC_2.15 __j0_finite F
-GLIBC_2.15 __j0f_finite F
-GLIBC_2.15 __j1_finite F
-GLIBC_2.15 __j1f_finite F
-GLIBC_2.15 __jn_finite F
-GLIBC_2.15 __jnf_finite F
-GLIBC_2.15 __lgamma_r_finite F
-GLIBC_2.15 __lgammaf_r_finite F
-GLIBC_2.15 __log10_finite F
-GLIBC_2.15 __log10f_finite F
-GLIBC_2.15 __log2_finite F
-GLIBC_2.15 __log2f_finite F
-GLIBC_2.15 __log_finite F
-GLIBC_2.15 __logf_finite F
-GLIBC_2.15 __pow_finite F
-GLIBC_2.15 __powf_finite F
-GLIBC_2.15 __remainder_finite F
-GLIBC_2.15 __remainderf_finite F
-GLIBC_2.15 __scalb_finite F
-GLIBC_2.15 __scalbf_finite F
-GLIBC_2.15 __sinh_finite F
-GLIBC_2.15 __sinhf_finite F
-GLIBC_2.15 __sqrt_finite F
-GLIBC_2.15 __sqrtf_finite F
-GLIBC_2.15 __y0_finite F
-GLIBC_2.15 __y0f_finite F
-GLIBC_2.15 __y1_finite F
-GLIBC_2.15 __y1f_finite F
-GLIBC_2.15 __yn_finite F
-GLIBC_2.15 __ynf_finite F
-GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 __issignaling F
-GLIBC_2.18 __issignalingf F
-GLIBC_2.23 GLIBC_2.23 A
-GLIBC_2.23 __signgam D 0x4
-GLIBC_2.23 lgamma F
-GLIBC_2.23 lgammaf F
-GLIBC_2.23 lgammal F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libnsl.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libnsl.abilist
deleted file mode 100644
index 0277e5c1a8..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libnsl.abilist
+++ /dev/null
@@ -1,122 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __free_fdresult F
-GLIBC_2.12 __nis_default_access F
-GLIBC_2.12 __nis_default_group F
-GLIBC_2.12 __nis_default_owner F
-GLIBC_2.12 __nis_default_ttl F
-GLIBC_2.12 __nis_finddirectory F
-GLIBC_2.12 __nis_hash F
-GLIBC_2.12 __nisbind_connect F
-GLIBC_2.12 __nisbind_create F
-GLIBC_2.12 __nisbind_destroy F
-GLIBC_2.12 __nisbind_next F
-GLIBC_2.12 __yp_check F
-GLIBC_2.12 nis_add F
-GLIBC_2.12 nis_add_entry F
-GLIBC_2.12 nis_addmember F
-GLIBC_2.12 nis_checkpoint F
-GLIBC_2.12 nis_clone_directory F
-GLIBC_2.12 nis_clone_object F
-GLIBC_2.12 nis_clone_result F
-GLIBC_2.12 nis_creategroup F
-GLIBC_2.12 nis_destroy_object F
-GLIBC_2.12 nis_destroygroup F
-GLIBC_2.12 nis_dir_cmp F
-GLIBC_2.12 nis_domain_of F
-GLIBC_2.12 nis_domain_of_r F
-GLIBC_2.12 nis_first_entry F
-GLIBC_2.12 nis_free_directory F
-GLIBC_2.12 nis_free_object F
-GLIBC_2.12 nis_free_request F
-GLIBC_2.12 nis_freenames F
-GLIBC_2.12 nis_freeresult F
-GLIBC_2.12 nis_freeservlist F
-GLIBC_2.12 nis_freetags F
-GLIBC_2.12 nis_getnames F
-GLIBC_2.12 nis_getservlist F
-GLIBC_2.12 nis_ismember F
-GLIBC_2.12 nis_leaf_of F
-GLIBC_2.12 nis_leaf_of_r F
-GLIBC_2.12 nis_lerror F
-GLIBC_2.12 nis_list F
-GLIBC_2.12 nis_local_directory F
-GLIBC_2.12 nis_local_group F
-GLIBC_2.12 nis_local_host F
-GLIBC_2.12 nis_local_principal F
-GLIBC_2.12 nis_lookup F
-GLIBC_2.12 nis_mkdir F
-GLIBC_2.12 nis_modify F
-GLIBC_2.12 nis_modify_entry F
-GLIBC_2.12 nis_name_of F
-GLIBC_2.12 nis_name_of_r F
-GLIBC_2.12 nis_next_entry F
-GLIBC_2.12 nis_perror F
-GLIBC_2.12 nis_ping F
-GLIBC_2.12 nis_print_directory F
-GLIBC_2.12 nis_print_entry F
-GLIBC_2.12 nis_print_group F
-GLIBC_2.12 nis_print_group_entry F
-GLIBC_2.12 nis_print_link F
-GLIBC_2.12 nis_print_object F
-GLIBC_2.12 nis_print_result F
-GLIBC_2.12 nis_print_rights F
-GLIBC_2.12 nis_print_table F
-GLIBC_2.12 nis_read_obj F
-GLIBC_2.12 nis_remove F
-GLIBC_2.12 nis_remove_entry F
-GLIBC_2.12 nis_removemember F
-GLIBC_2.12 nis_rmdir F
-GLIBC_2.12 nis_servstate F
-GLIBC_2.12 nis_sperrno F
-GLIBC_2.12 nis_sperror F
-GLIBC_2.12 nis_sperror_r F
-GLIBC_2.12 nis_stats F
-GLIBC_2.12 nis_verifygroup F
-GLIBC_2.12 nis_write_obj F
-GLIBC_2.12 readColdStartFile F
-GLIBC_2.12 writeColdStartFile F
-GLIBC_2.12 xdr_cback_data F
-GLIBC_2.12 xdr_domainname F
-GLIBC_2.12 xdr_keydat F
-GLIBC_2.12 xdr_mapname F
-GLIBC_2.12 xdr_obj_p F
-GLIBC_2.12 xdr_peername F
-GLIBC_2.12 xdr_valdat F
-GLIBC_2.12 xdr_yp_buf F
-GLIBC_2.12 xdr_ypall F
-GLIBC_2.12 xdr_ypbind_binding F
-GLIBC_2.12 xdr_ypbind_resp F
-GLIBC_2.12 xdr_ypbind_resptype F
-GLIBC_2.12 xdr_ypbind_setdom F
-GLIBC_2.12 xdr_ypdelete_args F
-GLIBC_2.12 xdr_ypmap_parms F
-GLIBC_2.12 xdr_ypmaplist F
-GLIBC_2.12 xdr_yppush_status F
-GLIBC_2.12 xdr_yppushresp_xfr F
-GLIBC_2.12 xdr_ypreq_key F
-GLIBC_2.12 xdr_ypreq_nokey F
-GLIBC_2.12 xdr_ypreq_xfr F
-GLIBC_2.12 xdr_ypresp_all F
-GLIBC_2.12 xdr_ypresp_key_val F
-GLIBC_2.12 xdr_ypresp_maplist F
-GLIBC_2.12 xdr_ypresp_master F
-GLIBC_2.12 xdr_ypresp_order F
-GLIBC_2.12 xdr_ypresp_val F
-GLIBC_2.12 xdr_ypresp_xfr F
-GLIBC_2.12 xdr_ypstat F
-GLIBC_2.12 xdr_ypupdate_args F
-GLIBC_2.12 xdr_ypxfrstat F
-GLIBC_2.12 yp_all F
-GLIBC_2.12 yp_bind F
-GLIBC_2.12 yp_first F
-GLIBC_2.12 yp_get_default_domain F
-GLIBC_2.12 yp_maplist F
-GLIBC_2.12 yp_master F
-GLIBC_2.12 yp_match F
-GLIBC_2.12 yp_next F
-GLIBC_2.12 yp_order F
-GLIBC_2.12 yp_unbind F
-GLIBC_2.12 yp_update F
-GLIBC_2.12 ypbinderr_string F
-GLIBC_2.12 yperr_string F
-GLIBC_2.12 ypprot_err F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libpthread.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libpthread.abilist
deleted file mode 100644
index d16158f938..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libpthread.abilist
+++ /dev/null
@@ -1,226 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 _IO_flockfile F
-GLIBC_2.12 _IO_ftrylockfile F
-GLIBC_2.12 _IO_funlockfile F
-GLIBC_2.12 __close F
-GLIBC_2.12 __connect F
-GLIBC_2.12 __errno_location F
-GLIBC_2.12 __fcntl F
-GLIBC_2.12 __fork F
-GLIBC_2.12 __h_errno_location F
-GLIBC_2.12 __libc_allocate_rtsig F
-GLIBC_2.12 __libc_current_sigrtmax F
-GLIBC_2.12 __libc_current_sigrtmin F
-GLIBC_2.12 __lseek F
-GLIBC_2.12 __nanosleep F
-GLIBC_2.12 __open F
-GLIBC_2.12 __open64 F
-GLIBC_2.12 __pread64 F
-GLIBC_2.12 __pthread_cleanup_routine F
-GLIBC_2.12 __pthread_getspecific F
-GLIBC_2.12 __pthread_key_create F
-GLIBC_2.12 __pthread_mutex_destroy F
-GLIBC_2.12 __pthread_mutex_init F
-GLIBC_2.12 __pthread_mutex_lock F
-GLIBC_2.12 __pthread_mutex_trylock F
-GLIBC_2.12 __pthread_mutex_unlock F
-GLIBC_2.12 __pthread_mutexattr_destroy F
-GLIBC_2.12 __pthread_mutexattr_init F
-GLIBC_2.12 __pthread_mutexattr_settype F
-GLIBC_2.12 __pthread_once F
-GLIBC_2.12 __pthread_register_cancel F
-GLIBC_2.12 __pthread_register_cancel_defer F
-GLIBC_2.12 __pthread_rwlock_destroy F
-GLIBC_2.12 __pthread_rwlock_init F
-GLIBC_2.12 __pthread_rwlock_rdlock F
-GLIBC_2.12 __pthread_rwlock_tryrdlock F
-GLIBC_2.12 __pthread_rwlock_trywrlock F
-GLIBC_2.12 __pthread_rwlock_unlock F
-GLIBC_2.12 __pthread_rwlock_wrlock F
-GLIBC_2.12 __pthread_setspecific F
-GLIBC_2.12 __pthread_unregister_cancel F
-GLIBC_2.12 __pthread_unregister_cancel_restore F
-GLIBC_2.12 __pthread_unwind_next F
-GLIBC_2.12 __pwrite64 F
-GLIBC_2.12 __read F
-GLIBC_2.12 __res_state F
-GLIBC_2.12 __send F
-GLIBC_2.12 __sigaction F
-GLIBC_2.12 __vfork F
-GLIBC_2.12 __wait F
-GLIBC_2.12 __write F
-GLIBC_2.12 _pthread_cleanup_pop F
-GLIBC_2.12 _pthread_cleanup_pop_restore F
-GLIBC_2.12 _pthread_cleanup_push F
-GLIBC_2.12 _pthread_cleanup_push_defer F
-GLIBC_2.12 accept F
-GLIBC_2.12 close F
-GLIBC_2.12 connect F
-GLIBC_2.12 fcntl F
-GLIBC_2.12 flockfile F
-GLIBC_2.12 fork F
-GLIBC_2.12 fsync F
-GLIBC_2.12 ftrylockfile F
-GLIBC_2.12 funlockfile F
-GLIBC_2.12 longjmp F
-GLIBC_2.12 lseek F
-GLIBC_2.12 lseek64 F
-GLIBC_2.12 msync F
-GLIBC_2.12 nanosleep F
-GLIBC_2.12 open F
-GLIBC_2.12 open64 F
-GLIBC_2.12 pause F
-GLIBC_2.12 pread F
-GLIBC_2.12 pread64 F
-GLIBC_2.12 pthread_attr_destroy F
-GLIBC_2.12 pthread_attr_getaffinity_np F
-GLIBC_2.12 pthread_attr_getdetachstate F
-GLIBC_2.12 pthread_attr_getguardsize F
-GLIBC_2.12 pthread_attr_getinheritsched F
-GLIBC_2.12 pthread_attr_getschedparam F
-GLIBC_2.12 pthread_attr_getschedpolicy F
-GLIBC_2.12 pthread_attr_getscope F
-GLIBC_2.12 pthread_attr_getstack F
-GLIBC_2.12 pthread_attr_getstackaddr F
-GLIBC_2.12 pthread_attr_getstacksize F
-GLIBC_2.12 pthread_attr_init F
-GLIBC_2.12 pthread_attr_setaffinity_np F
-GLIBC_2.12 pthread_attr_setdetachstate F
-GLIBC_2.12 pthread_attr_setguardsize F
-GLIBC_2.12 pthread_attr_setinheritsched F
-GLIBC_2.12 pthread_attr_setschedparam F
-GLIBC_2.12 pthread_attr_setschedpolicy F
-GLIBC_2.12 pthread_attr_setscope F
-GLIBC_2.12 pthread_attr_setstack F
-GLIBC_2.12 pthread_attr_setstackaddr F
-GLIBC_2.12 pthread_attr_setstacksize F
-GLIBC_2.12 pthread_barrier_destroy F
-GLIBC_2.12 pthread_barrier_init F
-GLIBC_2.12 pthread_barrier_wait F
-GLIBC_2.12 pthread_barrierattr_destroy F
-GLIBC_2.12 pthread_barrierattr_getpshared F
-GLIBC_2.12 pthread_barrierattr_init F
-GLIBC_2.12 pthread_barrierattr_setpshared F
-GLIBC_2.12 pthread_cancel F
-GLIBC_2.12 pthread_cond_broadcast F
-GLIBC_2.12 pthread_cond_destroy F
-GLIBC_2.12 pthread_cond_init F
-GLIBC_2.12 pthread_cond_signal F
-GLIBC_2.12 pthread_cond_timedwait F
-GLIBC_2.12 pthread_cond_wait F
-GLIBC_2.12 pthread_condattr_destroy F
-GLIBC_2.12 pthread_condattr_getclock F
-GLIBC_2.12 pthread_condattr_getpshared F
-GLIBC_2.12 pthread_condattr_init F
-GLIBC_2.12 pthread_condattr_setclock F
-GLIBC_2.12 pthread_condattr_setpshared F
-GLIBC_2.12 pthread_create F
-GLIBC_2.12 pthread_detach F
-GLIBC_2.12 pthread_equal F
-GLIBC_2.12 pthread_exit F
-GLIBC_2.12 pthread_getaffinity_np F
-GLIBC_2.12 pthread_getattr_np F
-GLIBC_2.12 pthread_getconcurrency F
-GLIBC_2.12 pthread_getcpuclockid F
-GLIBC_2.12 pthread_getname_np F
-GLIBC_2.12 pthread_getschedparam F
-GLIBC_2.12 pthread_getspecific F
-GLIBC_2.12 pthread_join F
-GLIBC_2.12 pthread_key_create F
-GLIBC_2.12 pthread_key_delete F
-GLIBC_2.12 pthread_kill F
-GLIBC_2.12 pthread_kill_other_threads_np F
-GLIBC_2.12 pthread_mutex_consistent F
-GLIBC_2.12 pthread_mutex_consistent_np F
-GLIBC_2.12 pthread_mutex_destroy F
-GLIBC_2.12 pthread_mutex_getprioceiling F
-GLIBC_2.12 pthread_mutex_init F
-GLIBC_2.12 pthread_mutex_lock F
-GLIBC_2.12 pthread_mutex_setprioceiling F
-GLIBC_2.12 pthread_mutex_timedlock F
-GLIBC_2.12 pthread_mutex_trylock F
-GLIBC_2.12 pthread_mutex_unlock F
-GLIBC_2.12 pthread_mutexattr_destroy F
-GLIBC_2.12 pthread_mutexattr_getkind_np F
-GLIBC_2.12 pthread_mutexattr_getprioceiling F
-GLIBC_2.12 pthread_mutexattr_getprotocol F
-GLIBC_2.12 pthread_mutexattr_getpshared F
-GLIBC_2.12 pthread_mutexattr_getrobust F
-GLIBC_2.12 pthread_mutexattr_getrobust_np F
-GLIBC_2.12 pthread_mutexattr_gettype F
-GLIBC_2.12 pthread_mutexattr_init F
-GLIBC_2.12 pthread_mutexattr_setkind_np F
-GLIBC_2.12 pthread_mutexattr_setprioceiling F
-GLIBC_2.12 pthread_mutexattr_setprotocol F
-GLIBC_2.12 pthread_mutexattr_setpshared F
-GLIBC_2.12 pthread_mutexattr_setrobust F
-GLIBC_2.12 pthread_mutexattr_setrobust_np F
-GLIBC_2.12 pthread_mutexattr_settype F
-GLIBC_2.12 pthread_once F
-GLIBC_2.12 pthread_rwlock_destroy F
-GLIBC_2.12 pthread_rwlock_init F
-GLIBC_2.12 pthread_rwlock_rdlock F
-GLIBC_2.12 pthread_rwlock_timedrdlock F
-GLIBC_2.12 pthread_rwlock_timedwrlock F
-GLIBC_2.12 pthread_rwlock_tryrdlock F
-GLIBC_2.12 pthread_rwlock_trywrlock F
-GLIBC_2.12 pthread_rwlock_unlock F
-GLIBC_2.12 pthread_rwlock_wrlock F
-GLIBC_2.12 pthread_rwlockattr_destroy F
-GLIBC_2.12 pthread_rwlockattr_getkind_np F
-GLIBC_2.12 pthread_rwlockattr_getpshared F
-GLIBC_2.12 pthread_rwlockattr_init F
-GLIBC_2.12 pthread_rwlockattr_setkind_np F
-GLIBC_2.12 pthread_rwlockattr_setpshared F
-GLIBC_2.12 pthread_self F
-GLIBC_2.12 pthread_setaffinity_np F
-GLIBC_2.12 pthread_setcancelstate F
-GLIBC_2.12 pthread_setcanceltype F
-GLIBC_2.12 pthread_setconcurrency F
-GLIBC_2.12 pthread_setname_np F
-GLIBC_2.12 pthread_setschedparam F
-GLIBC_2.12 pthread_setschedprio F
-GLIBC_2.12 pthread_setspecific F
-GLIBC_2.12 pthread_sigmask F
-GLIBC_2.12 pthread_sigqueue F
-GLIBC_2.12 pthread_spin_destroy F
-GLIBC_2.12 pthread_spin_init F
-GLIBC_2.12 pthread_spin_lock F
-GLIBC_2.12 pthread_spin_trylock F
-GLIBC_2.12 pthread_spin_unlock F
-GLIBC_2.12 pthread_testcancel F
-GLIBC_2.12 pthread_timedjoin_np F
-GLIBC_2.12 pthread_tryjoin_np F
-GLIBC_2.12 pthread_yield F
-GLIBC_2.12 pwrite F
-GLIBC_2.12 pwrite64 F
-GLIBC_2.12 raise F
-GLIBC_2.12 read F
-GLIBC_2.12 recv F
-GLIBC_2.12 recvfrom F
-GLIBC_2.12 recvmsg F
-GLIBC_2.12 sem_close F
-GLIBC_2.12 sem_destroy F
-GLIBC_2.12 sem_getvalue F
-GLIBC_2.12 sem_init F
-GLIBC_2.12 sem_open F
-GLIBC_2.12 sem_post F
-GLIBC_2.12 sem_timedwait F
-GLIBC_2.12 sem_trywait F
-GLIBC_2.12 sem_unlink F
-GLIBC_2.12 sem_wait F
-GLIBC_2.12 send F
-GLIBC_2.12 sendmsg F
-GLIBC_2.12 sendto F
-GLIBC_2.12 sigaction F
-GLIBC_2.12 siglongjmp F
-GLIBC_2.12 sigwait F
-GLIBC_2.12 system F
-GLIBC_2.12 tcdrain F
-GLIBC_2.12 vfork F
-GLIBC_2.12 wait F
-GLIBC_2.12 waitpid F
-GLIBC_2.12 write F
-GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 pthread_getattr_default_np F
-GLIBC_2.18 pthread_setattr_default_np F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libresolv.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libresolv.abilist
deleted file mode 100644
index aa2fefa6e4..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libresolv.abilist
+++ /dev/null
@@ -1,92 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __b64_ntop F
-GLIBC_2.12 __b64_pton F
-GLIBC_2.12 __dn_comp F
-GLIBC_2.12 __dn_count_labels F
-GLIBC_2.12 __dn_expand F
-GLIBC_2.12 __dn_skipname F
-GLIBC_2.12 __fp_nquery F
-GLIBC_2.12 __fp_query F
-GLIBC_2.12 __fp_resstat F
-GLIBC_2.12 __hostalias F
-GLIBC_2.12 __loc_aton F
-GLIBC_2.12 __loc_ntoa F
-GLIBC_2.12 __p_cdname F
-GLIBC_2.12 __p_cdnname F
-GLIBC_2.12 __p_class F
-GLIBC_2.12 __p_class_syms D 0x54
-GLIBC_2.12 __p_fqname F
-GLIBC_2.12 __p_fqnname F
-GLIBC_2.12 __p_option F
-GLIBC_2.12 __p_query F
-GLIBC_2.12 __p_rcode F
-GLIBC_2.12 __p_secstodate F
-GLIBC_2.12 __p_time F
-GLIBC_2.12 __p_type F
-GLIBC_2.12 __p_type_syms D 0x228
-GLIBC_2.12 __putlong F
-GLIBC_2.12 __putshort F
-GLIBC_2.12 __res_close F
-GLIBC_2.12 __res_dnok F
-GLIBC_2.12 __res_hnok F
-GLIBC_2.12 __res_hostalias F
-GLIBC_2.12 __res_isourserver F
-GLIBC_2.12 __res_mailok F
-GLIBC_2.12 __res_mkquery F
-GLIBC_2.12 __res_nameinquery F
-GLIBC_2.12 __res_nmkquery F
-GLIBC_2.12 __res_nquery F
-GLIBC_2.12 __res_nquerydomain F
-GLIBC_2.12 __res_nsearch F
-GLIBC_2.12 __res_nsend F
-GLIBC_2.12 __res_ownok F
-GLIBC_2.12 __res_queriesmatch F
-GLIBC_2.12 __res_query F
-GLIBC_2.12 __res_querydomain F
-GLIBC_2.12 __res_search F
-GLIBC_2.12 __res_send F
-GLIBC_2.12 __sym_ntop F
-GLIBC_2.12 __sym_ntos F
-GLIBC_2.12 __sym_ston F
-GLIBC_2.12 _gethtbyaddr F
-GLIBC_2.12 _gethtbyname F
-GLIBC_2.12 _gethtbyname2 F
-GLIBC_2.12 _gethtent F
-GLIBC_2.12 _getlong F
-GLIBC_2.12 _getshort F
-GLIBC_2.12 _res_opcodes D 0x40
-GLIBC_2.12 _sethtent F
-GLIBC_2.12 inet_net_ntop F
-GLIBC_2.12 inet_net_pton F
-GLIBC_2.12 inet_neta F
-GLIBC_2.12 ns_datetosecs F
-GLIBC_2.12 ns_format_ttl F
-GLIBC_2.12 ns_get16 F
-GLIBC_2.12 ns_get32 F
-GLIBC_2.12 ns_initparse F
-GLIBC_2.12 ns_makecanon F
-GLIBC_2.12 ns_msg_getflag F
-GLIBC_2.12 ns_name_compress F
-GLIBC_2.12 ns_name_ntol F
-GLIBC_2.12 ns_name_ntop F
-GLIBC_2.12 ns_name_pack F
-GLIBC_2.12 ns_name_pton F
-GLIBC_2.12 ns_name_rollback F
-GLIBC_2.12 ns_name_skip F
-GLIBC_2.12 ns_name_uncompress F
-GLIBC_2.12 ns_name_unpack F
-GLIBC_2.12 ns_parse_ttl F
-GLIBC_2.12 ns_parserr F
-GLIBC_2.12 ns_put16 F
-GLIBC_2.12 ns_put32 F
-GLIBC_2.12 ns_samedomain F
-GLIBC_2.12 ns_samename F
-GLIBC_2.12 ns_skiprr F
-GLIBC_2.12 ns_sprintrr F
-GLIBC_2.12 ns_sprintrrf F
-GLIBC_2.12 ns_subdomain F
-GLIBC_2.12 res_gethostbyaddr F
-GLIBC_2.12 res_gethostbyname F
-GLIBC_2.12 res_gethostbyname2 F
-GLIBC_2.12 res_send_setqhook F
-GLIBC_2.12 res_send_setrhook F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/librt.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/librt.abilist
deleted file mode 100644
index 14f5c8245d..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/librt.abilist
+++ /dev/null
@@ -1,41 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __mq_open_2 F
-GLIBC_2.12 aio_cancel F
-GLIBC_2.12 aio_cancel64 F
-GLIBC_2.12 aio_error F
-GLIBC_2.12 aio_error64 F
-GLIBC_2.12 aio_fsync F
-GLIBC_2.12 aio_fsync64 F
-GLIBC_2.12 aio_init F
-GLIBC_2.12 aio_read F
-GLIBC_2.12 aio_read64 F
-GLIBC_2.12 aio_return F
-GLIBC_2.12 aio_return64 F
-GLIBC_2.12 aio_suspend F
-GLIBC_2.12 aio_suspend64 F
-GLIBC_2.12 aio_write F
-GLIBC_2.12 aio_write64 F
-GLIBC_2.12 clock_getcpuclockid F
-GLIBC_2.12 clock_getres F
-GLIBC_2.12 clock_gettime F
-GLIBC_2.12 clock_nanosleep F
-GLIBC_2.12 clock_settime F
-GLIBC_2.12 lio_listio F
-GLIBC_2.12 lio_listio64 F
-GLIBC_2.12 mq_close F
-GLIBC_2.12 mq_getattr F
-GLIBC_2.12 mq_notify F
-GLIBC_2.12 mq_open F
-GLIBC_2.12 mq_receive F
-GLIBC_2.12 mq_send F
-GLIBC_2.12 mq_setattr F
-GLIBC_2.12 mq_timedreceive F
-GLIBC_2.12 mq_timedsend F
-GLIBC_2.12 mq_unlink F
-GLIBC_2.12 shm_open F
-GLIBC_2.12 shm_unlink F
-GLIBC_2.12 timer_create F
-GLIBC_2.12 timer_delete F
-GLIBC_2.12 timer_getoverrun F
-GLIBC_2.12 timer_gettime F
-GLIBC_2.12 timer_settime F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libthread_db.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libthread_db.abilist
deleted file mode 100644
index 4aade0b7e0..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libthread_db.abilist
+++ /dev/null
@@ -1,41 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 td_init F
-GLIBC_2.12 td_log F
-GLIBC_2.12 td_symbol_list F
-GLIBC_2.12 td_ta_clear_event F
-GLIBC_2.12 td_ta_delete F
-GLIBC_2.12 td_ta_enable_stats F
-GLIBC_2.12 td_ta_event_addr F
-GLIBC_2.12 td_ta_event_getmsg F
-GLIBC_2.12 td_ta_get_nthreads F
-GLIBC_2.12 td_ta_get_ph F
-GLIBC_2.12 td_ta_get_stats F
-GLIBC_2.12 td_ta_map_id2thr F
-GLIBC_2.12 td_ta_map_lwp2thr F
-GLIBC_2.12 td_ta_new F
-GLIBC_2.12 td_ta_reset_stats F
-GLIBC_2.12 td_ta_set_event F
-GLIBC_2.12 td_ta_setconcurrency F
-GLIBC_2.12 td_ta_thr_iter F
-GLIBC_2.12 td_ta_tsd_iter F
-GLIBC_2.12 td_thr_clear_event F
-GLIBC_2.12 td_thr_dbresume F
-GLIBC_2.12 td_thr_dbsuspend F
-GLIBC_2.12 td_thr_event_enable F
-GLIBC_2.12 td_thr_event_getmsg F
-GLIBC_2.12 td_thr_get_info F
-GLIBC_2.12 td_thr_getfpregs F
-GLIBC_2.12 td_thr_getgregs F
-GLIBC_2.12 td_thr_getxregs F
-GLIBC_2.12 td_thr_getxregsize F
-GLIBC_2.12 td_thr_set_event F
-GLIBC_2.12 td_thr_setfpregs F
-GLIBC_2.12 td_thr_setgregs F
-GLIBC_2.12 td_thr_setprio F
-GLIBC_2.12 td_thr_setsigpending F
-GLIBC_2.12 td_thr_setxregs F
-GLIBC_2.12 td_thr_sigsetmask F
-GLIBC_2.12 td_thr_tls_get_addr F
-GLIBC_2.12 td_thr_tlsbase F
-GLIBC_2.12 td_thr_tsd F
-GLIBC_2.12 td_thr_validate F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libutil.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libutil.abilist
deleted file mode 100644
index e4d432643c..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libutil.abilist
+++ /dev/null
@@ -1,7 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 forkpty F
-GLIBC_2.12 login F
-GLIBC_2.12 login_tty F
-GLIBC_2.12 logout F
-GLIBC_2.12 logwtmp F
-GLIBC_2.12 openpty F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Implies b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Implies
deleted file mode 100644
index e4e0800c0a..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Implies
+++ /dev/null
@@ -1,4 +0,0 @@
-unix/sysv/linux/tile/tilegx
-unix/sysv/linux/tile
-unix/sysv/linux/generic
-unix/sysv/linux/wordsize-64
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Makefile b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Makefile
deleted file mode 100644
index c8991d31e4..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-default-abi := 64
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/ld.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/ld.abilist
deleted file mode 100644
index aa6cbabfc3..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/ld.abilist
+++ /dev/null
@@ -1,10 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __libc_memalign F
-GLIBC_2.12 __libc_stack_end D 0x8
-GLIBC_2.12 __tls_get_addr F
-GLIBC_2.12 _dl_mcount F
-GLIBC_2.12 _r_debug D 0x28
-GLIBC_2.12 calloc F
-GLIBC_2.12 free F
-GLIBC_2.12 malloc F
-GLIBC_2.12 realloc F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libBrokenLocale.abilist
deleted file mode 100644
index 0d64827515..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libBrokenLocale.abilist
+++ /dev/null
@@ -1,2 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libanl.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libanl.abilist
deleted file mode 100644
index a3b1cc08bf..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libanl.abilist
+++ /dev/null
@@ -1,5 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 gai_cancel F
-GLIBC_2.12 gai_error F
-GLIBC_2.12 gai_suspend F
-GLIBC_2.12 getaddrinfo_a F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist
deleted file mode 100644
index a66e8ec877..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist
+++ /dev/null
@@ -1,2096 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 _Exit F
-GLIBC_2.12 _IO_2_1_stderr_ D 0xe0
-GLIBC_2.12 _IO_2_1_stdin_ D 0xe0
-GLIBC_2.12 _IO_2_1_stdout_ D 0xe0
-GLIBC_2.12 _IO_adjust_column F
-GLIBC_2.12 _IO_adjust_wcolumn F
-GLIBC_2.12 _IO_default_doallocate F
-GLIBC_2.12 _IO_default_finish F
-GLIBC_2.12 _IO_default_pbackfail F
-GLIBC_2.12 _IO_default_uflow F
-GLIBC_2.12 _IO_default_xsgetn F
-GLIBC_2.12 _IO_default_xsputn F
-GLIBC_2.12 _IO_do_write F
-GLIBC_2.12 _IO_doallocbuf F
-GLIBC_2.12 _IO_fclose F
-GLIBC_2.12 _IO_fdopen F
-GLIBC_2.12 _IO_feof F
-GLIBC_2.12 _IO_ferror F
-GLIBC_2.12 _IO_fflush F
-GLIBC_2.12 _IO_fgetpos F
-GLIBC_2.12 _IO_fgetpos64 F
-GLIBC_2.12 _IO_fgets F
-GLIBC_2.12 _IO_file_attach F
-GLIBC_2.12 _IO_file_close F
-GLIBC_2.12 _IO_file_close_it F
-GLIBC_2.12 _IO_file_doallocate F
-GLIBC_2.12 _IO_file_finish F
-GLIBC_2.12 _IO_file_fopen F
-GLIBC_2.12 _IO_file_init F
-GLIBC_2.12 _IO_file_jumps D 0xa8
-GLIBC_2.12 _IO_file_open F
-GLIBC_2.12 _IO_file_overflow F
-GLIBC_2.12 _IO_file_read F
-GLIBC_2.12 _IO_file_seek F
-GLIBC_2.12 _IO_file_seekoff F
-GLIBC_2.12 _IO_file_setbuf F
-GLIBC_2.12 _IO_file_stat F
-GLIBC_2.12 _IO_file_sync F
-GLIBC_2.12 _IO_file_underflow F
-GLIBC_2.12 _IO_file_write F
-GLIBC_2.12 _IO_file_xsputn F
-GLIBC_2.12 _IO_flockfile F
-GLIBC_2.12 _IO_flush_all F
-GLIBC_2.12 _IO_flush_all_linebuffered F
-GLIBC_2.12 _IO_fopen F
-GLIBC_2.12 _IO_fprintf F
-GLIBC_2.12 _IO_fputs F
-GLIBC_2.12 _IO_fread F
-GLIBC_2.12 _IO_free_backup_area F
-GLIBC_2.12 _IO_free_wbackup_area F
-GLIBC_2.12 _IO_fsetpos F
-GLIBC_2.12 _IO_fsetpos64 F
-GLIBC_2.12 _IO_ftell F
-GLIBC_2.12 _IO_ftrylockfile F
-GLIBC_2.12 _IO_funlockfile F
-GLIBC_2.12 _IO_fwrite F
-GLIBC_2.12 _IO_getc F
-GLIBC_2.12 _IO_getline F
-GLIBC_2.12 _IO_getline_info F
-GLIBC_2.12 _IO_gets F
-GLIBC_2.12 _IO_init F
-GLIBC_2.12 _IO_init_marker F
-GLIBC_2.12 _IO_init_wmarker F
-GLIBC_2.12 _IO_iter_begin F
-GLIBC_2.12 _IO_iter_end F
-GLIBC_2.12 _IO_iter_file F
-GLIBC_2.12 _IO_iter_next F
-GLIBC_2.12 _IO_least_wmarker F
-GLIBC_2.12 _IO_link_in F
-GLIBC_2.12 _IO_list_all D 0x8
-GLIBC_2.12 _IO_list_lock F
-GLIBC_2.12 _IO_list_resetlock F
-GLIBC_2.12 _IO_list_unlock F
-GLIBC_2.12 _IO_marker_delta F
-GLIBC_2.12 _IO_marker_difference F
-GLIBC_2.12 _IO_padn F
-GLIBC_2.12 _IO_peekc_locked F
-GLIBC_2.12 _IO_popen F
-GLIBC_2.12 _IO_printf F
-GLIBC_2.12 _IO_proc_close F
-GLIBC_2.12 _IO_proc_open F
-GLIBC_2.12 _IO_putc F
-GLIBC_2.12 _IO_puts F
-GLIBC_2.12 _IO_remove_marker F
-GLIBC_2.12 _IO_seekmark F
-GLIBC_2.12 _IO_seekoff F
-GLIBC_2.12 _IO_seekpos F
-GLIBC_2.12 _IO_seekwmark F
-GLIBC_2.12 _IO_setb F
-GLIBC_2.12 _IO_setbuffer F
-GLIBC_2.12 _IO_setvbuf F
-GLIBC_2.12 _IO_sgetn F
-GLIBC_2.12 _IO_sprintf F
-GLIBC_2.12 _IO_sputbackc F
-GLIBC_2.12 _IO_sputbackwc F
-GLIBC_2.12 _IO_sscanf F
-GLIBC_2.12 _IO_str_init_readonly F
-GLIBC_2.12 _IO_str_init_static F
-GLIBC_2.12 _IO_str_overflow F
-GLIBC_2.12 _IO_str_pbackfail F
-GLIBC_2.12 _IO_str_seekoff F
-GLIBC_2.12 _IO_str_underflow F
-GLIBC_2.12 _IO_sungetc F
-GLIBC_2.12 _IO_sungetwc F
-GLIBC_2.12 _IO_switch_to_get_mode F
-GLIBC_2.12 _IO_switch_to_main_wget_area F
-GLIBC_2.12 _IO_switch_to_wbackup_area F
-GLIBC_2.12 _IO_switch_to_wget_mode F
-GLIBC_2.12 _IO_un_link F
-GLIBC_2.12 _IO_ungetc F
-GLIBC_2.12 _IO_unsave_markers F
-GLIBC_2.12 _IO_unsave_wmarkers F
-GLIBC_2.12 _IO_vfprintf F
-GLIBC_2.12 _IO_vfscanf F
-GLIBC_2.12 _IO_vsprintf F
-GLIBC_2.12 _IO_wdefault_doallocate F
-GLIBC_2.12 _IO_wdefault_finish F
-GLIBC_2.12 _IO_wdefault_pbackfail F
-GLIBC_2.12 _IO_wdefault_uflow F
-GLIBC_2.12 _IO_wdefault_xsgetn F
-GLIBC_2.12 _IO_wdefault_xsputn F
-GLIBC_2.12 _IO_wdo_write F
-GLIBC_2.12 _IO_wdoallocbuf F
-GLIBC_2.12 _IO_wfile_jumps D 0xa8
-GLIBC_2.12 _IO_wfile_overflow F
-GLIBC_2.12 _IO_wfile_seekoff F
-GLIBC_2.12 _IO_wfile_sync F
-GLIBC_2.12 _IO_wfile_underflow F
-GLIBC_2.12 _IO_wfile_xsputn F
-GLIBC_2.12 _IO_wmarker_delta F
-GLIBC_2.12 _IO_wsetb F
-GLIBC_2.12 ___brk_addr D 0x8
-GLIBC_2.12 __adjtimex F
-GLIBC_2.12 __after_morecore_hook D 0x8
-GLIBC_2.12 __argz_count F
-GLIBC_2.12 __argz_next F
-GLIBC_2.12 __argz_stringify F
-GLIBC_2.12 __asprintf F
-GLIBC_2.12 __asprintf_chk F
-GLIBC_2.12 __assert F
-GLIBC_2.12 __assert_fail F
-GLIBC_2.12 __assert_perror_fail F
-GLIBC_2.12 __backtrace F
-GLIBC_2.12 __backtrace_symbols F
-GLIBC_2.12 __backtrace_symbols_fd F
-GLIBC_2.12 __bsd_getpgrp F
-GLIBC_2.12 __bzero F
-GLIBC_2.12 __check_rhosts_file D 0x4
-GLIBC_2.12 __chk_fail F
-GLIBC_2.12 __clone F
-GLIBC_2.12 __close F
-GLIBC_2.12 __cmsg_nxthdr F
-GLIBC_2.12 __confstr_chk F
-GLIBC_2.12 __connect F
-GLIBC_2.12 __ctype_b_loc F
-GLIBC_2.12 __ctype_get_mb_cur_max F
-GLIBC_2.12 __ctype_tolower_loc F
-GLIBC_2.12 __ctype_toupper_loc F
-GLIBC_2.12 __curbrk D 0x8
-GLIBC_2.12 __cxa_at_quick_exit F
-GLIBC_2.12 __cxa_atexit F
-GLIBC_2.12 __cxa_finalize F
-GLIBC_2.12 __cyg_profile_func_enter F
-GLIBC_2.12 __cyg_profile_func_exit F
-GLIBC_2.12 __daylight D 0x4
-GLIBC_2.12 __dcgettext F
-GLIBC_2.12 __default_morecore F
-GLIBC_2.12 __dgettext F
-GLIBC_2.12 __dprintf_chk F
-GLIBC_2.12 __dup2 F
-GLIBC_2.12 __duplocale F
-GLIBC_2.12 __endmntent F
-GLIBC_2.12 __environ D 0x8
-GLIBC_2.12 __errno_location F
-GLIBC_2.12 __fbufsize F
-GLIBC_2.12 __fcntl F
-GLIBC_2.12 __ffs F
-GLIBC_2.12 __fgets_chk F
-GLIBC_2.12 __fgets_unlocked_chk F
-GLIBC_2.12 __fgetws_chk F
-GLIBC_2.12 __fgetws_unlocked_chk F
-GLIBC_2.12 __finite F
-GLIBC_2.12 __finitef F
-GLIBC_2.12 __flbf F
-GLIBC_2.12 __fork F
-GLIBC_2.12 __fpending F
-GLIBC_2.12 __fprintf_chk F
-GLIBC_2.12 __fpu_control D 0x4
-GLIBC_2.12 __fpurge F
-GLIBC_2.12 __fread_chk F
-GLIBC_2.12 __fread_unlocked_chk F
-GLIBC_2.12 __freadable F
-GLIBC_2.12 __freading F
-GLIBC_2.12 __free_hook D 0x8
-GLIBC_2.12 __freelocale F
-GLIBC_2.12 __fsetlocking F
-GLIBC_2.12 __fwprintf_chk F
-GLIBC_2.12 __fwritable F
-GLIBC_2.12 __fwriting F
-GLIBC_2.12 __fxstat F
-GLIBC_2.12 __fxstat64 F
-GLIBC_2.12 __fxstatat F
-GLIBC_2.12 __fxstatat64 F
-GLIBC_2.12 __getcwd_chk F
-GLIBC_2.12 __getdelim F
-GLIBC_2.12 __getdomainname_chk F
-GLIBC_2.12 __getgroups_chk F
-GLIBC_2.12 __gethostname_chk F
-GLIBC_2.12 __getlogin_r_chk F
-GLIBC_2.12 __getmntent_r F
-GLIBC_2.12 __getpagesize F
-GLIBC_2.12 __getpgid F
-GLIBC_2.12 __getpid F
-GLIBC_2.12 __gets_chk F
-GLIBC_2.12 __gettimeofday F
-GLIBC_2.12 __getwd_chk F
-GLIBC_2.12 __gmtime_r F
-GLIBC_2.12 __h_errno_location F
-GLIBC_2.12 __isalnum_l F
-GLIBC_2.12 __isalpha_l F
-GLIBC_2.12 __isascii_l F
-GLIBC_2.12 __isblank_l F
-GLIBC_2.12 __iscntrl_l F
-GLIBC_2.12 __isctype F
-GLIBC_2.12 __isdigit_l F
-GLIBC_2.12 __isgraph_l F
-GLIBC_2.12 __isinf F
-GLIBC_2.12 __isinff F
-GLIBC_2.12 __islower_l F
-GLIBC_2.12 __isnan F
-GLIBC_2.12 __isnanf F
-GLIBC_2.12 __isoc99_fscanf F
-GLIBC_2.12 __isoc99_fwscanf F
-GLIBC_2.12 __isoc99_scanf F
-GLIBC_2.12 __isoc99_sscanf F
-GLIBC_2.12 __isoc99_swscanf F
-GLIBC_2.12 __isoc99_vfscanf F
-GLIBC_2.12 __isoc99_vfwscanf F
-GLIBC_2.12 __isoc99_vscanf F
-GLIBC_2.12 __isoc99_vsscanf F
-GLIBC_2.12 __isoc99_vswscanf F
-GLIBC_2.12 __isoc99_vwscanf F
-GLIBC_2.12 __isoc99_wscanf F
-GLIBC_2.12 __isprint_l F
-GLIBC_2.12 __ispunct_l F
-GLIBC_2.12 __isspace_l F
-GLIBC_2.12 __isupper_l F
-GLIBC_2.12 __iswalnum_l F
-GLIBC_2.12 __iswalpha_l F
-GLIBC_2.12 __iswblank_l F
-GLIBC_2.12 __iswcntrl_l F
-GLIBC_2.12 __iswctype F
-GLIBC_2.12 __iswctype_l F
-GLIBC_2.12 __iswdigit_l F
-GLIBC_2.12 __iswgraph_l F
-GLIBC_2.12 __iswlower_l F
-GLIBC_2.12 __iswprint_l F
-GLIBC_2.12 __iswpunct_l F
-GLIBC_2.12 __iswspace_l F
-GLIBC_2.12 __iswupper_l F
-GLIBC_2.12 __iswxdigit_l F
-GLIBC_2.12 __isxdigit_l F
-GLIBC_2.12 __ivaliduser F
-GLIBC_2.12 __key_decryptsession_pk_LOCAL D 0x8
-GLIBC_2.12 __key_encryptsession_pk_LOCAL D 0x8
-GLIBC_2.12 __key_gendes_LOCAL D 0x8
-GLIBC_2.12 __libc_allocate_rtsig F
-GLIBC_2.12 __libc_calloc F
-GLIBC_2.12 __libc_current_sigrtmax F
-GLIBC_2.12 __libc_current_sigrtmin F
-GLIBC_2.12 __libc_free F
-GLIBC_2.12 __libc_freeres F
-GLIBC_2.12 __libc_init_first F
-GLIBC_2.12 __libc_mallinfo F
-GLIBC_2.12 __libc_malloc F
-GLIBC_2.12 __libc_mallopt F
-GLIBC_2.12 __libc_memalign F
-GLIBC_2.12 __libc_pvalloc F
-GLIBC_2.12 __libc_realloc F
-GLIBC_2.12 __libc_sa_len F
-GLIBC_2.12 __libc_start_main F
-GLIBC_2.12 __libc_valloc F
-GLIBC_2.12 __longjmp_chk F
-GLIBC_2.12 __lseek F
-GLIBC_2.12 __lxstat F
-GLIBC_2.12 __lxstat64 F
-GLIBC_2.12 __malloc_hook D 0x8
-GLIBC_2.12 __malloc_initialize_hook D 0x8
-GLIBC_2.12 __mbrlen F
-GLIBC_2.12 __mbrtowc F
-GLIBC_2.12 __mbsnrtowcs_chk F
-GLIBC_2.12 __mbsrtowcs_chk F
-GLIBC_2.12 __mbstowcs_chk F
-GLIBC_2.12 __mcount F
-GLIBC_2.12 __memalign_hook D 0x8
-GLIBC_2.12 __memcpy_chk F
-GLIBC_2.12 __memmove_chk F
-GLIBC_2.12 __mempcpy F
-GLIBC_2.12 __mempcpy_chk F
-GLIBC_2.12 __mempcpy_small F
-GLIBC_2.12 __memset_chk F
-GLIBC_2.12 __monstartup F
-GLIBC_2.12 __morecore D 0x8
-GLIBC_2.12 __nanosleep F
-GLIBC_2.12 __newlocale F
-GLIBC_2.12 __nl_langinfo_l F
-GLIBC_2.12 __nss_configure_lookup F
-GLIBC_2.12 __nss_database_lookup F
-GLIBC_2.12 __nss_group_lookup F
-GLIBC_2.12 __nss_hostname_digits_dots F
-GLIBC_2.12 __nss_hosts_lookup F
-GLIBC_2.12 __nss_next F
-GLIBC_2.12 __nss_passwd_lookup F
-GLIBC_2.12 __obstack_printf_chk F
-GLIBC_2.12 __obstack_vprintf_chk F
-GLIBC_2.12 __open F
-GLIBC_2.12 __open64 F
-GLIBC_2.12 __open64_2 F
-GLIBC_2.12 __open_2 F
-GLIBC_2.12 __openat64_2 F
-GLIBC_2.12 __openat_2 F
-GLIBC_2.12 __overflow F
-GLIBC_2.12 __pipe F
-GLIBC_2.12 __poll F
-GLIBC_2.12 __posix_getopt F
-GLIBC_2.12 __pread64 F
-GLIBC_2.12 __pread64_chk F
-GLIBC_2.12 __pread_chk F
-GLIBC_2.12 __printf_chk F
-GLIBC_2.12 __printf_fp F
-GLIBC_2.12 __profile_frequency F
-GLIBC_2.12 __progname D 0x8
-GLIBC_2.12 __progname_full D 0x8
-GLIBC_2.12 __ptsname_r_chk F
-GLIBC_2.12 __pwrite64 F
-GLIBC_2.12 __rawmemchr F
-GLIBC_2.12 __rcmd_errstr D 0x8
-GLIBC_2.12 __read F
-GLIBC_2.12 __read_chk F
-GLIBC_2.12 __readlink_chk F
-GLIBC_2.12 __readlinkat_chk F
-GLIBC_2.12 __realloc_hook D 0x8
-GLIBC_2.12 __realpath_chk F
-GLIBC_2.12 __recv_chk F
-GLIBC_2.12 __recvfrom_chk F
-GLIBC_2.12 __register_atfork F
-GLIBC_2.12 __res_init F
-GLIBC_2.12 __res_nclose F
-GLIBC_2.12 __res_ninit F
-GLIBC_2.12 __res_randomid F
-GLIBC_2.12 __res_state F
-GLIBC_2.12 __rpc_thread_createerr F
-GLIBC_2.12 __rpc_thread_svc_fdset F
-GLIBC_2.12 __rpc_thread_svc_max_pollfd F
-GLIBC_2.12 __rpc_thread_svc_pollfd F
-GLIBC_2.12 __sbrk F
-GLIBC_2.12 __sched_cpualloc F
-GLIBC_2.12 __sched_cpucount F
-GLIBC_2.12 __sched_cpufree F
-GLIBC_2.12 __sched_get_priority_max F
-GLIBC_2.12 __sched_get_priority_min F
-GLIBC_2.12 __sched_getparam F
-GLIBC_2.12 __sched_getscheduler F
-GLIBC_2.12 __sched_setscheduler F
-GLIBC_2.12 __sched_yield F
-GLIBC_2.12 __secure_getenv F
-GLIBC_2.12 __select F
-GLIBC_2.12 __setmntent F
-GLIBC_2.12 __setpgid F
-GLIBC_2.12 __sigaction F
-GLIBC_2.12 __sigaddset F
-GLIBC_2.12 __sigdelset F
-GLIBC_2.12 __sigismember F
-GLIBC_2.12 __signbit F
-GLIBC_2.12 __signbitf F
-GLIBC_2.12 __sigpause F
-GLIBC_2.12 __sigsetjmp F
-GLIBC_2.12 __sigsuspend F
-GLIBC_2.12 __snprintf_chk F
-GLIBC_2.12 __sprintf_chk F
-GLIBC_2.12 __stack_chk_fail F
-GLIBC_2.12 __statfs F
-GLIBC_2.12 __stpcpy F
-GLIBC_2.12 __stpcpy_chk F
-GLIBC_2.12 __stpcpy_small F
-GLIBC_2.12 __stpncpy F
-GLIBC_2.12 __stpncpy_chk F
-GLIBC_2.12 __strcasecmp F
-GLIBC_2.12 __strcasecmp_l F
-GLIBC_2.12 __strcasestr F
-GLIBC_2.12 __strcat_chk F
-GLIBC_2.12 __strcoll_l F
-GLIBC_2.12 __strcpy_chk F
-GLIBC_2.12 __strcpy_small F
-GLIBC_2.12 __strcspn_c1 F
-GLIBC_2.12 __strcspn_c2 F
-GLIBC_2.12 __strcspn_c3 F
-GLIBC_2.12 __strdup F
-GLIBC_2.12 __strerror_r F
-GLIBC_2.12 __strfmon_l F
-GLIBC_2.12 __strftime_l F
-GLIBC_2.12 __strncasecmp_l F
-GLIBC_2.12 __strncat_chk F
-GLIBC_2.12 __strncpy_chk F
-GLIBC_2.12 __strndup F
-GLIBC_2.12 __strpbrk_c2 F
-GLIBC_2.12 __strpbrk_c3 F
-GLIBC_2.12 __strsep_1c F
-GLIBC_2.12 __strsep_2c F
-GLIBC_2.12 __strsep_3c F
-GLIBC_2.12 __strsep_g F
-GLIBC_2.12 __strspn_c1 F
-GLIBC_2.12 __strspn_c2 F
-GLIBC_2.12 __strspn_c3 F
-GLIBC_2.12 __strtod_internal F
-GLIBC_2.12 __strtod_l F
-GLIBC_2.12 __strtof_internal F
-GLIBC_2.12 __strtof_l F
-GLIBC_2.12 __strtok_r F
-GLIBC_2.12 __strtok_r_1c F
-GLIBC_2.12 __strtol_internal F
-GLIBC_2.12 __strtol_l F
-GLIBC_2.12 __strtold_internal F
-GLIBC_2.12 __strtold_l F
-GLIBC_2.12 __strtoll_internal F
-GLIBC_2.12 __strtoll_l F
-GLIBC_2.12 __strtoul_internal F
-GLIBC_2.12 __strtoul_l F
-GLIBC_2.12 __strtoull_internal F
-GLIBC_2.12 __strtoull_l F
-GLIBC_2.12 __strverscmp F
-GLIBC_2.12 __strxfrm_l F
-GLIBC_2.12 __swprintf_chk F
-GLIBC_2.12 __sysconf F
-GLIBC_2.12 __syslog_chk F
-GLIBC_2.12 __sysv_signal F
-GLIBC_2.12 __timezone D 0x8
-GLIBC_2.12 __toascii_l F
-GLIBC_2.12 __tolower_l F
-GLIBC_2.12 __toupper_l F
-GLIBC_2.12 __towctrans F
-GLIBC_2.12 __towctrans_l F
-GLIBC_2.12 __towlower_l F
-GLIBC_2.12 __towupper_l F
-GLIBC_2.12 __ttyname_r_chk F
-GLIBC_2.12 __tzname D 0x10
-GLIBC_2.12 __uflow F
-GLIBC_2.12 __underflow F
-GLIBC_2.12 __uselocale F
-GLIBC_2.12 __vasprintf_chk F
-GLIBC_2.12 __vdprintf_chk F
-GLIBC_2.12 __vfork F
-GLIBC_2.12 __vfprintf_chk F
-GLIBC_2.12 __vfscanf F
-GLIBC_2.12 __vfwprintf_chk F
-GLIBC_2.12 __vprintf_chk F
-GLIBC_2.12 __vsnprintf F
-GLIBC_2.12 __vsnprintf_chk F
-GLIBC_2.12 __vsprintf_chk F
-GLIBC_2.12 __vsscanf F
-GLIBC_2.12 __vswprintf_chk F
-GLIBC_2.12 __vsyslog_chk F
-GLIBC_2.12 __vwprintf_chk F
-GLIBC_2.12 __wait F
-GLIBC_2.12 __waitpid F
-GLIBC_2.12 __wcpcpy_chk F
-GLIBC_2.12 __wcpncpy_chk F
-GLIBC_2.12 __wcrtomb_chk F
-GLIBC_2.12 __wcscasecmp_l F
-GLIBC_2.12 __wcscat_chk F
-GLIBC_2.12 __wcscoll_l F
-GLIBC_2.12 __wcscpy_chk F
-GLIBC_2.12 __wcsftime_l F
-GLIBC_2.12 __wcsncasecmp_l F
-GLIBC_2.12 __wcsncat_chk F
-GLIBC_2.12 __wcsncpy_chk F
-GLIBC_2.12 __wcsnrtombs_chk F
-GLIBC_2.12 __wcsrtombs_chk F
-GLIBC_2.12 __wcstod_internal F
-GLIBC_2.12 __wcstod_l F
-GLIBC_2.12 __wcstof_internal F
-GLIBC_2.12 __wcstof_l F
-GLIBC_2.12 __wcstol_internal F
-GLIBC_2.12 __wcstol_l F
-GLIBC_2.12 __wcstold_internal F
-GLIBC_2.12 __wcstold_l F
-GLIBC_2.12 __wcstoll_internal F
-GLIBC_2.12 __wcstoll_l F
-GLIBC_2.12 __wcstombs_chk F
-GLIBC_2.12 __wcstoul_internal F
-GLIBC_2.12 __wcstoul_l F
-GLIBC_2.12 __wcstoull_internal F
-GLIBC_2.12 __wcstoull_l F
-GLIBC_2.12 __wcsxfrm_l F
-GLIBC_2.12 __wctomb_chk F
-GLIBC_2.12 __wctrans_l F
-GLIBC_2.12 __wctype_l F
-GLIBC_2.12 __wmemcpy_chk F
-GLIBC_2.12 __wmemmove_chk F
-GLIBC_2.12 __wmempcpy_chk F
-GLIBC_2.12 __wmemset_chk F
-GLIBC_2.12 __woverflow F
-GLIBC_2.12 __wprintf_chk F
-GLIBC_2.12 __write F
-GLIBC_2.12 __wuflow F
-GLIBC_2.12 __wunderflow F
-GLIBC_2.12 __xmknod F
-GLIBC_2.12 __xmknodat F
-GLIBC_2.12 __xpg_basename F
-GLIBC_2.12 __xpg_sigpause F
-GLIBC_2.12 __xpg_strerror_r F
-GLIBC_2.12 __xstat F
-GLIBC_2.12 __xstat64 F
-GLIBC_2.12 _authenticate F
-GLIBC_2.12 _dl_mcount_wrapper F
-GLIBC_2.12 _dl_mcount_wrapper_check F
-GLIBC_2.12 _environ D 0x8
-GLIBC_2.12 _exit F
-GLIBC_2.12 _flush_cache F
-GLIBC_2.12 _flushlbf F
-GLIBC_2.12 _libc_intl_domainname D 0x5
-GLIBC_2.12 _longjmp F
-GLIBC_2.12 _mcleanup F
-GLIBC_2.12 _mcount F
-GLIBC_2.12 _nl_default_dirname D 0x12
-GLIBC_2.12 _nl_domain_bindings D 0x8
-GLIBC_2.12 _nl_msg_cat_cntr D 0x4
-GLIBC_2.12 _null_auth D 0x18
-GLIBC_2.12 _obstack_allocated_p F
-GLIBC_2.12 _obstack_begin F
-GLIBC_2.12 _obstack_begin_1 F
-GLIBC_2.12 _obstack_free F
-GLIBC_2.12 _obstack_memory_used F
-GLIBC_2.12 _obstack_newchunk F
-GLIBC_2.12 _res D 0x238
-GLIBC_2.12 _res_hconf D 0x48
-GLIBC_2.12 _rpc_dtablesize F
-GLIBC_2.12 _seterr_reply F
-GLIBC_2.12 _setjmp F
-GLIBC_2.12 _sys_errlist D 0x438
-GLIBC_2.12 _sys_nerr D 0x4
-GLIBC_2.12 _sys_siglist D 0x208
-GLIBC_2.12 _tolower F
-GLIBC_2.12 _toupper F
-GLIBC_2.12 a64l F
-GLIBC_2.12 abort F
-GLIBC_2.12 abs F
-GLIBC_2.12 accept F
-GLIBC_2.12 accept4 F
-GLIBC_2.12 access F
-GLIBC_2.12 acct F
-GLIBC_2.12 addmntent F
-GLIBC_2.12 addseverity F
-GLIBC_2.12 adjtime F
-GLIBC_2.12 adjtimex F
-GLIBC_2.12 advance F
-GLIBC_2.12 alarm F
-GLIBC_2.12 alphasort F
-GLIBC_2.12 alphasort64 F
-GLIBC_2.12 argp_err_exit_status D 0x4
-GLIBC_2.12 argp_error F
-GLIBC_2.12 argp_failure F
-GLIBC_2.12 argp_help F
-GLIBC_2.12 argp_parse F
-GLIBC_2.12 argp_program_bug_address D 0x8
-GLIBC_2.12 argp_program_version D 0x8
-GLIBC_2.12 argp_program_version_hook D 0x8
-GLIBC_2.12 argp_state_help F
-GLIBC_2.12 argp_usage F
-GLIBC_2.12 argz_add F
-GLIBC_2.12 argz_add_sep F
-GLIBC_2.12 argz_append F
-GLIBC_2.12 argz_count F
-GLIBC_2.12 argz_create F
-GLIBC_2.12 argz_create_sep F
-GLIBC_2.12 argz_delete F
-GLIBC_2.12 argz_extract F
-GLIBC_2.12 argz_insert F
-GLIBC_2.12 argz_next F
-GLIBC_2.12 argz_replace F
-GLIBC_2.12 argz_stringify F
-GLIBC_2.12 asctime F
-GLIBC_2.12 asctime_r F
-GLIBC_2.12 asprintf F
-GLIBC_2.12 atof F
-GLIBC_2.12 atoi F
-GLIBC_2.12 atol F
-GLIBC_2.12 atoll F
-GLIBC_2.12 authdes_create F
-GLIBC_2.12 authdes_getucred F
-GLIBC_2.12 authdes_pk_create F
-GLIBC_2.12 authnone_create F
-GLIBC_2.12 authunix_create F
-GLIBC_2.12 authunix_create_default F
-GLIBC_2.12 backtrace F
-GLIBC_2.12 backtrace_symbols F
-GLIBC_2.12 backtrace_symbols_fd F
-GLIBC_2.12 basename F
-GLIBC_2.12 bcmp F
-GLIBC_2.12 bcopy F
-GLIBC_2.12 bdflush F
-GLIBC_2.12 bind F
-GLIBC_2.12 bind_textdomain_codeset F
-GLIBC_2.12 bindresvport F
-GLIBC_2.12 bindtextdomain F
-GLIBC_2.12 brk F
-GLIBC_2.12 bsd_signal F
-GLIBC_2.12 bsearch F
-GLIBC_2.12 btowc F
-GLIBC_2.12 bzero F
-GLIBC_2.12 cacheflush F
-GLIBC_2.12 calloc F
-GLIBC_2.12 callrpc F
-GLIBC_2.12 canonicalize_file_name F
-GLIBC_2.12 capget F
-GLIBC_2.12 capset F
-GLIBC_2.12 catclose F
-GLIBC_2.12 catgets F
-GLIBC_2.12 catopen F
-GLIBC_2.12 cbc_crypt F
-GLIBC_2.12 cfgetispeed F
-GLIBC_2.12 cfgetospeed F
-GLIBC_2.12 cfmakeraw F
-GLIBC_2.12 cfree F
-GLIBC_2.12 cfsetispeed F
-GLIBC_2.12 cfsetospeed F
-GLIBC_2.12 cfsetspeed F
-GLIBC_2.12 chdir F
-GLIBC_2.12 chflags F
-GLIBC_2.12 chmod F
-GLIBC_2.12 chown F
-GLIBC_2.12 chroot F
-GLIBC_2.12 clearenv F
-GLIBC_2.12 clearerr F
-GLIBC_2.12 clearerr_unlocked F
-GLIBC_2.12 clnt_broadcast F
-GLIBC_2.12 clnt_create F
-GLIBC_2.12 clnt_pcreateerror F
-GLIBC_2.12 clnt_perrno F
-GLIBC_2.12 clnt_perror F
-GLIBC_2.12 clnt_spcreateerror F
-GLIBC_2.12 clnt_sperrno F
-GLIBC_2.12 clnt_sperror F
-GLIBC_2.12 clntraw_create F
-GLIBC_2.12 clnttcp_create F
-GLIBC_2.12 clntudp_bufcreate F
-GLIBC_2.12 clntudp_create F
-GLIBC_2.12 clntunix_create F
-GLIBC_2.12 clock F
-GLIBC_2.12 clone F
-GLIBC_2.12 close F
-GLIBC_2.12 closedir F
-GLIBC_2.12 closelog F
-GLIBC_2.12 confstr F
-GLIBC_2.12 connect F
-GLIBC_2.12 copysign F
-GLIBC_2.12 copysignf F
-GLIBC_2.12 copysignl F
-GLIBC_2.12 creat F
-GLIBC_2.12 creat64 F
-GLIBC_2.12 create_module F
-GLIBC_2.12 ctermid F
-GLIBC_2.12 ctime F
-GLIBC_2.12 ctime_r F
-GLIBC_2.12 cuserid F
-GLIBC_2.12 daemon F
-GLIBC_2.12 daylight D 0x4
-GLIBC_2.12 dcgettext F
-GLIBC_2.12 dcngettext F
-GLIBC_2.12 delete_module F
-GLIBC_2.12 des_setparity F
-GLIBC_2.12 dgettext F
-GLIBC_2.12 difftime F
-GLIBC_2.12 dirfd F
-GLIBC_2.12 dirname F
-GLIBC_2.12 div F
-GLIBC_2.12 dl_iterate_phdr F
-GLIBC_2.12 dngettext F
-GLIBC_2.12 dprintf F
-GLIBC_2.12 drand48 F
-GLIBC_2.12 drand48_r F
-GLIBC_2.12 dup F
-GLIBC_2.12 dup2 F
-GLIBC_2.12 dup3 F
-GLIBC_2.12 duplocale F
-GLIBC_2.12 dysize F
-GLIBC_2.12 eaccess F
-GLIBC_2.12 ecb_crypt F
-GLIBC_2.12 ecvt F
-GLIBC_2.12 ecvt_r F
-GLIBC_2.12 endaliasent F
-GLIBC_2.12 endfsent F
-GLIBC_2.12 endgrent F
-GLIBC_2.12 endhostent F
-GLIBC_2.12 endmntent F
-GLIBC_2.12 endnetent F
-GLIBC_2.12 endnetgrent F
-GLIBC_2.12 endprotoent F
-GLIBC_2.12 endpwent F
-GLIBC_2.12 endrpcent F
-GLIBC_2.12 endservent F
-GLIBC_2.12 endsgent F
-GLIBC_2.12 endspent F
-GLIBC_2.12 endttyent F
-GLIBC_2.12 endusershell F
-GLIBC_2.12 endutent F
-GLIBC_2.12 endutxent F
-GLIBC_2.12 environ D 0x8
-GLIBC_2.12 envz_add F
-GLIBC_2.12 envz_entry F
-GLIBC_2.12 envz_get F
-GLIBC_2.12 envz_merge F
-GLIBC_2.12 envz_remove F
-GLIBC_2.12 envz_strip F
-GLIBC_2.12 epoll_create F
-GLIBC_2.12 epoll_create1 F
-GLIBC_2.12 epoll_ctl F
-GLIBC_2.12 epoll_pwait F
-GLIBC_2.12 epoll_wait F
-GLIBC_2.12 erand48 F
-GLIBC_2.12 erand48_r F
-GLIBC_2.12 err F
-GLIBC_2.12 error F
-GLIBC_2.12 error_at_line F
-GLIBC_2.12 error_message_count D 0x4
-GLIBC_2.12 error_one_per_line D 0x4
-GLIBC_2.12 error_print_progname D 0x8
-GLIBC_2.12 errx F
-GLIBC_2.12 ether_aton F
-GLIBC_2.12 ether_aton_r F
-GLIBC_2.12 ether_hostton F
-GLIBC_2.12 ether_line F
-GLIBC_2.12 ether_ntoa F
-GLIBC_2.12 ether_ntoa_r F
-GLIBC_2.12 ether_ntohost F
-GLIBC_2.12 euidaccess F
-GLIBC_2.12 eventfd F
-GLIBC_2.12 eventfd_read F
-GLIBC_2.12 eventfd_write F
-GLIBC_2.12 execl F
-GLIBC_2.12 execle F
-GLIBC_2.12 execlp F
-GLIBC_2.12 execv F
-GLIBC_2.12 execve F
-GLIBC_2.12 execvp F
-GLIBC_2.12 execvpe F
-GLIBC_2.12 exit F
-GLIBC_2.12 faccessat F
-GLIBC_2.12 fallocate F
-GLIBC_2.12 fallocate64 F
-GLIBC_2.12 fattach F
-GLIBC_2.12 fchdir F
-GLIBC_2.12 fchflags F
-GLIBC_2.12 fchmod F
-GLIBC_2.12 fchmodat F
-GLIBC_2.12 fchown F
-GLIBC_2.12 fchownat F
-GLIBC_2.12 fclose F
-GLIBC_2.12 fcloseall F
-GLIBC_2.12 fcntl F
-GLIBC_2.12 fcvt F
-GLIBC_2.12 fcvt_r F
-GLIBC_2.12 fdatasync F
-GLIBC_2.12 fdetach F
-GLIBC_2.12 fdopen F
-GLIBC_2.12 fdopendir F
-GLIBC_2.12 feof F
-GLIBC_2.12 feof_unlocked F
-GLIBC_2.12 ferror F
-GLIBC_2.12 ferror_unlocked F
-GLIBC_2.12 fexecve F
-GLIBC_2.12 fflush F
-GLIBC_2.12 fflush_unlocked F
-GLIBC_2.12 ffs F
-GLIBC_2.12 ffsl F
-GLIBC_2.12 ffsll F
-GLIBC_2.12 fgetc F
-GLIBC_2.12 fgetc_unlocked F
-GLIBC_2.12 fgetgrent F
-GLIBC_2.12 fgetgrent_r F
-GLIBC_2.12 fgetpos F
-GLIBC_2.12 fgetpos64 F
-GLIBC_2.12 fgetpwent F
-GLIBC_2.12 fgetpwent_r F
-GLIBC_2.12 fgets F
-GLIBC_2.12 fgets_unlocked F
-GLIBC_2.12 fgetsgent F
-GLIBC_2.12 fgetsgent_r F
-GLIBC_2.12 fgetspent F
-GLIBC_2.12 fgetspent_r F
-GLIBC_2.12 fgetwc F
-GLIBC_2.12 fgetwc_unlocked F
-GLIBC_2.12 fgetws F
-GLIBC_2.12 fgetws_unlocked F
-GLIBC_2.12 fgetxattr F
-GLIBC_2.12 fileno F
-GLIBC_2.12 fileno_unlocked F
-GLIBC_2.12 finite F
-GLIBC_2.12 finitef F
-GLIBC_2.12 finitel F
-GLIBC_2.12 flistxattr F
-GLIBC_2.12 flock F
-GLIBC_2.12 flockfile F
-GLIBC_2.12 fmemopen F
-GLIBC_2.12 fmtmsg F
-GLIBC_2.12 fnmatch F
-GLIBC_2.12 fopen F
-GLIBC_2.12 fopen64 F
-GLIBC_2.12 fopencookie F
-GLIBC_2.12 fork F
-GLIBC_2.12 fpathconf F
-GLIBC_2.12 fprintf F
-GLIBC_2.12 fputc F
-GLIBC_2.12 fputc_unlocked F
-GLIBC_2.12 fputs F
-GLIBC_2.12 fputs_unlocked F
-GLIBC_2.12 fputwc F
-GLIBC_2.12 fputwc_unlocked F
-GLIBC_2.12 fputws F
-GLIBC_2.12 fputws_unlocked F
-GLIBC_2.12 fread F
-GLIBC_2.12 fread_unlocked F
-GLIBC_2.12 free F
-GLIBC_2.12 freeaddrinfo F
-GLIBC_2.12 freeifaddrs F
-GLIBC_2.12 freelocale F
-GLIBC_2.12 fremovexattr F
-GLIBC_2.12 freopen F
-GLIBC_2.12 freopen64 F
-GLIBC_2.12 frexp F
-GLIBC_2.12 frexpf F
-GLIBC_2.12 frexpl F
-GLIBC_2.12 fscanf F
-GLIBC_2.12 fseek F
-GLIBC_2.12 fseeko F
-GLIBC_2.12 fseeko64 F
-GLIBC_2.12 fsetpos F
-GLIBC_2.12 fsetpos64 F
-GLIBC_2.12 fsetxattr F
-GLIBC_2.12 fstatfs F
-GLIBC_2.12 fstatfs64 F
-GLIBC_2.12 fstatvfs F
-GLIBC_2.12 fstatvfs64 F
-GLIBC_2.12 fsync F
-GLIBC_2.12 ftell F
-GLIBC_2.12 ftello F
-GLIBC_2.12 ftello64 F
-GLIBC_2.12 ftime F
-GLIBC_2.12 ftok F
-GLIBC_2.12 ftruncate F
-GLIBC_2.12 ftruncate64 F
-GLIBC_2.12 ftrylockfile F
-GLIBC_2.12 fts_children F
-GLIBC_2.12 fts_close F
-GLIBC_2.12 fts_open F
-GLIBC_2.12 fts_read F
-GLIBC_2.12 fts_set F
-GLIBC_2.12 ftw F
-GLIBC_2.12 ftw64 F
-GLIBC_2.12 funlockfile F
-GLIBC_2.12 futimens F
-GLIBC_2.12 futimes F
-GLIBC_2.12 futimesat F
-GLIBC_2.12 fwide F
-GLIBC_2.12 fwprintf F
-GLIBC_2.12 fwrite F
-GLIBC_2.12 fwrite_unlocked F
-GLIBC_2.12 fwscanf F
-GLIBC_2.12 gai_strerror F
-GLIBC_2.12 gcvt F
-GLIBC_2.12 get_avphys_pages F
-GLIBC_2.12 get_current_dir_name F
-GLIBC_2.12 get_kernel_syms F
-GLIBC_2.12 get_myaddress F
-GLIBC_2.12 get_nprocs F
-GLIBC_2.12 get_nprocs_conf F
-GLIBC_2.12 get_phys_pages F
-GLIBC_2.12 getaddrinfo F
-GLIBC_2.12 getaliasbyname F
-GLIBC_2.12 getaliasbyname_r F
-GLIBC_2.12 getaliasent F
-GLIBC_2.12 getaliasent_r F
-GLIBC_2.12 getc F
-GLIBC_2.12 getc_unlocked F
-GLIBC_2.12 getchar F
-GLIBC_2.12 getchar_unlocked F
-GLIBC_2.12 getcontext F
-GLIBC_2.12 getcwd F
-GLIBC_2.12 getdate F
-GLIBC_2.12 getdate_err D 0x4
-GLIBC_2.12 getdate_r F
-GLIBC_2.12 getdelim F
-GLIBC_2.12 getdirentries F
-GLIBC_2.12 getdirentries64 F
-GLIBC_2.12 getdomainname F
-GLIBC_2.12 getdtablesize F
-GLIBC_2.12 getegid F
-GLIBC_2.12 getenv F
-GLIBC_2.12 geteuid F
-GLIBC_2.12 getfsent F
-GLIBC_2.12 getfsfile F
-GLIBC_2.12 getfsspec F
-GLIBC_2.12 getgid F
-GLIBC_2.12 getgrent F
-GLIBC_2.12 getgrent_r F
-GLIBC_2.12 getgrgid F
-GLIBC_2.12 getgrgid_r F
-GLIBC_2.12 getgrnam F
-GLIBC_2.12 getgrnam_r F
-GLIBC_2.12 getgrouplist F
-GLIBC_2.12 getgroups F
-GLIBC_2.12 gethostbyaddr F
-GLIBC_2.12 gethostbyaddr_r F
-GLIBC_2.12 gethostbyname F
-GLIBC_2.12 gethostbyname2 F
-GLIBC_2.12 gethostbyname2_r F
-GLIBC_2.12 gethostbyname_r F
-GLIBC_2.12 gethostent F
-GLIBC_2.12 gethostent_r F
-GLIBC_2.12 gethostid F
-GLIBC_2.12 gethostname F
-GLIBC_2.12 getifaddrs F
-GLIBC_2.12 getipv4sourcefilter F
-GLIBC_2.12 getitimer F
-GLIBC_2.12 getline F
-GLIBC_2.12 getloadavg F
-GLIBC_2.12 getlogin F
-GLIBC_2.12 getlogin_r F
-GLIBC_2.12 getmntent F
-GLIBC_2.12 getmntent_r F
-GLIBC_2.12 getmsg F
-GLIBC_2.12 getnameinfo F
-GLIBC_2.12 getnetbyaddr F
-GLIBC_2.12 getnetbyaddr_r F
-GLIBC_2.12 getnetbyname F
-GLIBC_2.12 getnetbyname_r F
-GLIBC_2.12 getnetent F
-GLIBC_2.12 getnetent_r F
-GLIBC_2.12 getnetgrent F
-GLIBC_2.12 getnetgrent_r F
-GLIBC_2.12 getnetname F
-GLIBC_2.12 getopt F
-GLIBC_2.12 getopt_long F
-GLIBC_2.12 getopt_long_only F
-GLIBC_2.12 getpagesize F
-GLIBC_2.12 getpass F
-GLIBC_2.12 getpeername F
-GLIBC_2.12 getpgid F
-GLIBC_2.12 getpgrp F
-GLIBC_2.12 getpid F
-GLIBC_2.12 getpmsg F
-GLIBC_2.12 getppid F
-GLIBC_2.12 getpriority F
-GLIBC_2.12 getprotobyname F
-GLIBC_2.12 getprotobyname_r F
-GLIBC_2.12 getprotobynumber F
-GLIBC_2.12 getprotobynumber_r F
-GLIBC_2.12 getprotoent F
-GLIBC_2.12 getprotoent_r F
-GLIBC_2.12 getpt F
-GLIBC_2.12 getpublickey F
-GLIBC_2.12 getpw F
-GLIBC_2.12 getpwent F
-GLIBC_2.12 getpwent_r F
-GLIBC_2.12 getpwnam F
-GLIBC_2.12 getpwnam_r F
-GLIBC_2.12 getpwuid F
-GLIBC_2.12 getpwuid_r F
-GLIBC_2.12 getresgid F
-GLIBC_2.12 getresuid F
-GLIBC_2.12 getrlimit F
-GLIBC_2.12 getrlimit64 F
-GLIBC_2.12 getrpcbyname F
-GLIBC_2.12 getrpcbyname_r F
-GLIBC_2.12 getrpcbynumber F
-GLIBC_2.12 getrpcbynumber_r F
-GLIBC_2.12 getrpcent F
-GLIBC_2.12 getrpcent_r F
-GLIBC_2.12 getrpcport F
-GLIBC_2.12 getrusage F
-GLIBC_2.12 gets F
-GLIBC_2.12 getsecretkey F
-GLIBC_2.12 getservbyname F
-GLIBC_2.12 getservbyname_r F
-GLIBC_2.12 getservbyport F
-GLIBC_2.12 getservbyport_r F
-GLIBC_2.12 getservent F
-GLIBC_2.12 getservent_r F
-GLIBC_2.12 getsgent F
-GLIBC_2.12 getsgent_r F
-GLIBC_2.12 getsgnam F
-GLIBC_2.12 getsgnam_r F
-GLIBC_2.12 getsid F
-GLIBC_2.12 getsockname F
-GLIBC_2.12 getsockopt F
-GLIBC_2.12 getsourcefilter F
-GLIBC_2.12 getspent F
-GLIBC_2.12 getspent_r F
-GLIBC_2.12 getspnam F
-GLIBC_2.12 getspnam_r F
-GLIBC_2.12 getsubopt F
-GLIBC_2.12 gettext F
-GLIBC_2.12 gettimeofday F
-GLIBC_2.12 getttyent F
-GLIBC_2.12 getttynam F
-GLIBC_2.12 getuid F
-GLIBC_2.12 getusershell F
-GLIBC_2.12 getutent F
-GLIBC_2.12 getutent_r F
-GLIBC_2.12 getutid F
-GLIBC_2.12 getutid_r F
-GLIBC_2.12 getutline F
-GLIBC_2.12 getutline_r F
-GLIBC_2.12 getutmp F
-GLIBC_2.12 getutmpx F
-GLIBC_2.12 getutxent F
-GLIBC_2.12 getutxid F
-GLIBC_2.12 getutxline F
-GLIBC_2.12 getw F
-GLIBC_2.12 getwc F
-GLIBC_2.12 getwc_unlocked F
-GLIBC_2.12 getwchar F
-GLIBC_2.12 getwchar_unlocked F
-GLIBC_2.12 getwd F
-GLIBC_2.12 getxattr F
-GLIBC_2.12 glob F
-GLIBC_2.12 glob64 F
-GLIBC_2.12 glob_pattern_p F
-GLIBC_2.12 globfree F
-GLIBC_2.12 globfree64 F
-GLIBC_2.12 gmtime F
-GLIBC_2.12 gmtime_r F
-GLIBC_2.12 gnu_dev_major F
-GLIBC_2.12 gnu_dev_makedev F
-GLIBC_2.12 gnu_dev_minor F
-GLIBC_2.12 gnu_get_libc_release F
-GLIBC_2.12 gnu_get_libc_version F
-GLIBC_2.12 grantpt F
-GLIBC_2.12 group_member F
-GLIBC_2.12 gsignal F
-GLIBC_2.12 gtty F
-GLIBC_2.12 h_errlist D 0x28
-GLIBC_2.12 h_nerr D 0x4
-GLIBC_2.12 hasmntopt F
-GLIBC_2.12 hcreate F
-GLIBC_2.12 hcreate_r F
-GLIBC_2.12 hdestroy F
-GLIBC_2.12 hdestroy_r F
-GLIBC_2.12 herror F
-GLIBC_2.12 host2netname F
-GLIBC_2.12 hsearch F
-GLIBC_2.12 hsearch_r F
-GLIBC_2.12 hstrerror F
-GLIBC_2.12 htonl F
-GLIBC_2.12 htons F
-GLIBC_2.12 iconv F
-GLIBC_2.12 iconv_close F
-GLIBC_2.12 iconv_open F
-GLIBC_2.12 if_freenameindex F
-GLIBC_2.12 if_indextoname F
-GLIBC_2.12 if_nameindex F
-GLIBC_2.12 if_nametoindex F
-GLIBC_2.12 imaxabs F
-GLIBC_2.12 imaxdiv F
-GLIBC_2.12 in6addr_any D 0x10
-GLIBC_2.12 in6addr_loopback D 0x10
-GLIBC_2.12 index F
-GLIBC_2.12 inet6_opt_append F
-GLIBC_2.12 inet6_opt_find F
-GLIBC_2.12 inet6_opt_finish F
-GLIBC_2.12 inet6_opt_get_val F
-GLIBC_2.12 inet6_opt_init F
-GLIBC_2.12 inet6_opt_next F
-GLIBC_2.12 inet6_opt_set_val F
-GLIBC_2.12 inet6_option_alloc F
-GLIBC_2.12 inet6_option_append F
-GLIBC_2.12 inet6_option_find F
-GLIBC_2.12 inet6_option_init F
-GLIBC_2.12 inet6_option_next F
-GLIBC_2.12 inet6_option_space F
-GLIBC_2.12 inet6_rth_add F
-GLIBC_2.12 inet6_rth_getaddr F
-GLIBC_2.12 inet6_rth_init F
-GLIBC_2.12 inet6_rth_reverse F
-GLIBC_2.12 inet6_rth_segments F
-GLIBC_2.12 inet6_rth_space F
-GLIBC_2.12 inet_addr F
-GLIBC_2.12 inet_aton F
-GLIBC_2.12 inet_lnaof F
-GLIBC_2.12 inet_makeaddr F
-GLIBC_2.12 inet_netof F
-GLIBC_2.12 inet_network F
-GLIBC_2.12 inet_nsap_addr F
-GLIBC_2.12 inet_nsap_ntoa F
-GLIBC_2.12 inet_ntoa F
-GLIBC_2.12 inet_ntop F
-GLIBC_2.12 inet_pton F
-GLIBC_2.12 init_module F
-GLIBC_2.12 initgroups F
-GLIBC_2.12 initstate F
-GLIBC_2.12 initstate_r F
-GLIBC_2.12 innetgr F
-GLIBC_2.12 inotify_add_watch F
-GLIBC_2.12 inotify_init F
-GLIBC_2.12 inotify_init1 F
-GLIBC_2.12 inotify_rm_watch F
-GLIBC_2.12 insque F
-GLIBC_2.12 ioctl F
-GLIBC_2.12 iruserok F
-GLIBC_2.12 iruserok_af F
-GLIBC_2.12 isalnum F
-GLIBC_2.12 isalnum_l F
-GLIBC_2.12 isalpha F
-GLIBC_2.12 isalpha_l F
-GLIBC_2.12 isascii F
-GLIBC_2.12 isastream F
-GLIBC_2.12 isatty F
-GLIBC_2.12 isblank F
-GLIBC_2.12 isblank_l F
-GLIBC_2.12 iscntrl F
-GLIBC_2.12 iscntrl_l F
-GLIBC_2.12 isctype F
-GLIBC_2.12 isdigit F
-GLIBC_2.12 isdigit_l F
-GLIBC_2.12 isfdtype F
-GLIBC_2.12 isgraph F
-GLIBC_2.12 isgraph_l F
-GLIBC_2.12 isinf F
-GLIBC_2.12 isinff F
-GLIBC_2.12 isinfl F
-GLIBC_2.12 islower F
-GLIBC_2.12 islower_l F
-GLIBC_2.12 isnan F
-GLIBC_2.12 isnanf F
-GLIBC_2.12 isnanl F
-GLIBC_2.12 isprint F
-GLIBC_2.12 isprint_l F
-GLIBC_2.12 ispunct F
-GLIBC_2.12 ispunct_l F
-GLIBC_2.12 isspace F
-GLIBC_2.12 isspace_l F
-GLIBC_2.12 isupper F
-GLIBC_2.12 isupper_l F
-GLIBC_2.12 iswalnum F
-GLIBC_2.12 iswalnum_l F
-GLIBC_2.12 iswalpha F
-GLIBC_2.12 iswalpha_l F
-GLIBC_2.12 iswblank F
-GLIBC_2.12 iswblank_l F
-GLIBC_2.12 iswcntrl F
-GLIBC_2.12 iswcntrl_l F
-GLIBC_2.12 iswctype F
-GLIBC_2.12 iswctype_l F
-GLIBC_2.12 iswdigit F
-GLIBC_2.12 iswdigit_l F
-GLIBC_2.12 iswgraph F
-GLIBC_2.12 iswgraph_l F
-GLIBC_2.12 iswlower F
-GLIBC_2.12 iswlower_l F
-GLIBC_2.12 iswprint F
-GLIBC_2.12 iswprint_l F
-GLIBC_2.12 iswpunct F
-GLIBC_2.12 iswpunct_l F
-GLIBC_2.12 iswspace F
-GLIBC_2.12 iswspace_l F
-GLIBC_2.12 iswupper F
-GLIBC_2.12 iswupper_l F
-GLIBC_2.12 iswxdigit F
-GLIBC_2.12 iswxdigit_l F
-GLIBC_2.12 isxdigit F
-GLIBC_2.12 isxdigit_l F
-GLIBC_2.12 jrand48 F
-GLIBC_2.12 jrand48_r F
-GLIBC_2.12 key_decryptsession F
-GLIBC_2.12 key_decryptsession_pk F
-GLIBC_2.12 key_encryptsession F
-GLIBC_2.12 key_encryptsession_pk F
-GLIBC_2.12 key_gendes F
-GLIBC_2.12 key_get_conv F
-GLIBC_2.12 key_secretkey_is_set F
-GLIBC_2.12 key_setnet F
-GLIBC_2.12 key_setsecret F
-GLIBC_2.12 kill F
-GLIBC_2.12 killpg F
-GLIBC_2.12 klogctl F
-GLIBC_2.12 l64a F
-GLIBC_2.12 labs F
-GLIBC_2.12 lchmod F
-GLIBC_2.12 lchown F
-GLIBC_2.12 lckpwdf F
-GLIBC_2.12 lcong48 F
-GLIBC_2.12 lcong48_r F
-GLIBC_2.12 ldexp F
-GLIBC_2.12 ldexpf F
-GLIBC_2.12 ldexpl F
-GLIBC_2.12 ldiv F
-GLIBC_2.12 lfind F
-GLIBC_2.12 lgetxattr F
-GLIBC_2.12 link F
-GLIBC_2.12 linkat F
-GLIBC_2.12 listen F
-GLIBC_2.12 listxattr F
-GLIBC_2.12 llabs F
-GLIBC_2.12 lldiv F
-GLIBC_2.12 llistxattr F
-GLIBC_2.12 llseek F
-GLIBC_2.12 loc1 D 0x8
-GLIBC_2.12 loc2 D 0x8
-GLIBC_2.12 localeconv F
-GLIBC_2.12 localtime F
-GLIBC_2.12 localtime_r F
-GLIBC_2.12 lockf F
-GLIBC_2.12 lockf64 F
-GLIBC_2.12 locs D 0x8
-GLIBC_2.12 longjmp F
-GLIBC_2.12 lrand48 F
-GLIBC_2.12 lrand48_r F
-GLIBC_2.12 lremovexattr F
-GLIBC_2.12 lsearch F
-GLIBC_2.12 lseek F
-GLIBC_2.12 lseek64 F
-GLIBC_2.12 lsetxattr F
-GLIBC_2.12 lutimes F
-GLIBC_2.12 madvise F
-GLIBC_2.12 makecontext F
-GLIBC_2.12 mallinfo F
-GLIBC_2.12 malloc F
-GLIBC_2.12 malloc_get_state F
-GLIBC_2.12 malloc_info F
-GLIBC_2.12 malloc_set_state F
-GLIBC_2.12 malloc_stats F
-GLIBC_2.12 malloc_trim F
-GLIBC_2.12 malloc_usable_size F
-GLIBC_2.12 mallopt F
-GLIBC_2.12 mallwatch D 0x8
-GLIBC_2.12 mblen F
-GLIBC_2.12 mbrlen F
-GLIBC_2.12 mbrtowc F
-GLIBC_2.12 mbsinit F
-GLIBC_2.12 mbsnrtowcs F
-GLIBC_2.12 mbsrtowcs F
-GLIBC_2.12 mbstowcs F
-GLIBC_2.12 mbtowc F
-GLIBC_2.12 mcheck F
-GLIBC_2.12 mcheck_check_all F
-GLIBC_2.12 mcheck_pedantic F
-GLIBC_2.12 mcount F
-GLIBC_2.12 memalign F
-GLIBC_2.12 memccpy F
-GLIBC_2.12 memchr F
-GLIBC_2.12 memcmp F
-GLIBC_2.12 memcpy F
-GLIBC_2.12 memfrob F
-GLIBC_2.12 memmem F
-GLIBC_2.12 memmove F
-GLIBC_2.12 mempcpy F
-GLIBC_2.12 memrchr F
-GLIBC_2.12 memset F
-GLIBC_2.12 mincore F
-GLIBC_2.12 mkdir F
-GLIBC_2.12 mkdirat F
-GLIBC_2.12 mkdtemp F
-GLIBC_2.12 mkfifo F
-GLIBC_2.12 mkfifoat F
-GLIBC_2.12 mkostemp F
-GLIBC_2.12 mkostemp64 F
-GLIBC_2.12 mkostemps F
-GLIBC_2.12 mkostemps64 F
-GLIBC_2.12 mkstemp F
-GLIBC_2.12 mkstemp64 F
-GLIBC_2.12 mkstemps F
-GLIBC_2.12 mkstemps64 F
-GLIBC_2.12 mktemp F
-GLIBC_2.12 mktime F
-GLIBC_2.12 mlock F
-GLIBC_2.12 mlockall F
-GLIBC_2.12 mmap F
-GLIBC_2.12 mmap64 F
-GLIBC_2.12 modf F
-GLIBC_2.12 modff F
-GLIBC_2.12 modfl F
-GLIBC_2.12 moncontrol F
-GLIBC_2.12 monstartup F
-GLIBC_2.12 mount F
-GLIBC_2.12 mprobe F
-GLIBC_2.12 mprotect F
-GLIBC_2.12 mrand48 F
-GLIBC_2.12 mrand48_r F
-GLIBC_2.12 mremap F
-GLIBC_2.12 msgctl F
-GLIBC_2.12 msgget F
-GLIBC_2.12 msgrcv F
-GLIBC_2.12 msgsnd F
-GLIBC_2.12 msync F
-GLIBC_2.12 mtrace F
-GLIBC_2.12 munlock F
-GLIBC_2.12 munlockall F
-GLIBC_2.12 munmap F
-GLIBC_2.12 muntrace F
-GLIBC_2.12 nanosleep F
-GLIBC_2.12 netname2host F
-GLIBC_2.12 netname2user F
-GLIBC_2.12 newlocale F
-GLIBC_2.12 nfsservctl F
-GLIBC_2.12 nftw F
-GLIBC_2.12 nftw64 F
-GLIBC_2.12 ngettext F
-GLIBC_2.12 nice F
-GLIBC_2.12 nl_langinfo F
-GLIBC_2.12 nl_langinfo_l F
-GLIBC_2.12 nrand48 F
-GLIBC_2.12 nrand48_r F
-GLIBC_2.12 ntohl F
-GLIBC_2.12 ntohs F
-GLIBC_2.12 ntp_adjtime F
-GLIBC_2.12 ntp_gettime F
-GLIBC_2.12 ntp_gettimex F
-GLIBC_2.12 obstack_alloc_failed_handler D 0x8
-GLIBC_2.12 obstack_exit_failure D 0x4
-GLIBC_2.12 obstack_free F
-GLIBC_2.12 obstack_printf F
-GLIBC_2.12 obstack_vprintf F
-GLIBC_2.12 on_exit F
-GLIBC_2.12 open F
-GLIBC_2.12 open64 F
-GLIBC_2.12 open_memstream F
-GLIBC_2.12 open_wmemstream F
-GLIBC_2.12 openat F
-GLIBC_2.12 openat64 F
-GLIBC_2.12 opendir F
-GLIBC_2.12 openlog F
-GLIBC_2.12 optarg D 0x8
-GLIBC_2.12 opterr D 0x4
-GLIBC_2.12 optind D 0x4
-GLIBC_2.12 optopt D 0x4
-GLIBC_2.12 parse_printf_format F
-GLIBC_2.12 passwd2des F
-GLIBC_2.12 pathconf F
-GLIBC_2.12 pause F
-GLIBC_2.12 pclose F
-GLIBC_2.12 perror F
-GLIBC_2.12 personality F
-GLIBC_2.12 pipe F
-GLIBC_2.12 pipe2 F
-GLIBC_2.12 pivot_root F
-GLIBC_2.12 pmap_getmaps F
-GLIBC_2.12 pmap_getport F
-GLIBC_2.12 pmap_rmtcall F
-GLIBC_2.12 pmap_set F
-GLIBC_2.12 pmap_unset F
-GLIBC_2.12 poll F
-GLIBC_2.12 popen F
-GLIBC_2.12 posix_fadvise F
-GLIBC_2.12 posix_fadvise64 F
-GLIBC_2.12 posix_fallocate F
-GLIBC_2.12 posix_fallocate64 F
-GLIBC_2.12 posix_madvise F
-GLIBC_2.12 posix_memalign F
-GLIBC_2.12 posix_openpt F
-GLIBC_2.12 posix_spawn F
-GLIBC_2.12 posix_spawn_file_actions_addclose F
-GLIBC_2.12 posix_spawn_file_actions_adddup2 F
-GLIBC_2.12 posix_spawn_file_actions_addopen F
-GLIBC_2.12 posix_spawn_file_actions_destroy F
-GLIBC_2.12 posix_spawn_file_actions_init F
-GLIBC_2.12 posix_spawnattr_destroy F
-GLIBC_2.12 posix_spawnattr_getflags F
-GLIBC_2.12 posix_spawnattr_getpgroup F
-GLIBC_2.12 posix_spawnattr_getschedparam F
-GLIBC_2.12 posix_spawnattr_getschedpolicy F
-GLIBC_2.12 posix_spawnattr_getsigdefault F
-GLIBC_2.12 posix_spawnattr_getsigmask F
-GLIBC_2.12 posix_spawnattr_init F
-GLIBC_2.12 posix_spawnattr_setflags F
-GLIBC_2.12 posix_spawnattr_setpgroup F
-GLIBC_2.12 posix_spawnattr_setschedparam F
-GLIBC_2.12 posix_spawnattr_setschedpolicy F
-GLIBC_2.12 posix_spawnattr_setsigdefault F
-GLIBC_2.12 posix_spawnattr_setsigmask F
-GLIBC_2.12 posix_spawnp F
-GLIBC_2.12 ppoll F
-GLIBC_2.12 prctl F
-GLIBC_2.12 pread F
-GLIBC_2.12 pread64 F
-GLIBC_2.12 preadv F
-GLIBC_2.12 preadv64 F
-GLIBC_2.12 printf F
-GLIBC_2.12 printf_size F
-GLIBC_2.12 printf_size_info F
-GLIBC_2.12 profil F
-GLIBC_2.12 program_invocation_name D 0x8
-GLIBC_2.12 program_invocation_short_name D 0x8
-GLIBC_2.12 pselect F
-GLIBC_2.12 psiginfo F
-GLIBC_2.12 psignal F
-GLIBC_2.12 pthread_attr_destroy F
-GLIBC_2.12 pthread_attr_getdetachstate F
-GLIBC_2.12 pthread_attr_getinheritsched F
-GLIBC_2.12 pthread_attr_getschedparam F
-GLIBC_2.12 pthread_attr_getschedpolicy F
-GLIBC_2.12 pthread_attr_getscope F
-GLIBC_2.12 pthread_attr_init F
-GLIBC_2.12 pthread_attr_setdetachstate F
-GLIBC_2.12 pthread_attr_setinheritsched F
-GLIBC_2.12 pthread_attr_setschedparam F
-GLIBC_2.12 pthread_attr_setschedpolicy F
-GLIBC_2.12 pthread_attr_setscope F
-GLIBC_2.12 pthread_cond_broadcast F
-GLIBC_2.12 pthread_cond_destroy F
-GLIBC_2.12 pthread_cond_init F
-GLIBC_2.12 pthread_cond_signal F
-GLIBC_2.12 pthread_cond_timedwait F
-GLIBC_2.12 pthread_cond_wait F
-GLIBC_2.12 pthread_condattr_destroy F
-GLIBC_2.12 pthread_condattr_init F
-GLIBC_2.12 pthread_equal F
-GLIBC_2.12 pthread_exit F
-GLIBC_2.12 pthread_getschedparam F
-GLIBC_2.12 pthread_mutex_destroy F
-GLIBC_2.12 pthread_mutex_init F
-GLIBC_2.12 pthread_mutex_lock F
-GLIBC_2.12 pthread_mutex_unlock F
-GLIBC_2.12 pthread_self F
-GLIBC_2.12 pthread_setcancelstate F
-GLIBC_2.12 pthread_setcanceltype F
-GLIBC_2.12 pthread_setschedparam F
-GLIBC_2.12 ptrace F
-GLIBC_2.12 ptsname F
-GLIBC_2.12 ptsname_r F
-GLIBC_2.12 putc F
-GLIBC_2.12 putc_unlocked F
-GLIBC_2.12 putchar F
-GLIBC_2.12 putchar_unlocked F
-GLIBC_2.12 putenv F
-GLIBC_2.12 putgrent F
-GLIBC_2.12 putmsg F
-GLIBC_2.12 putpmsg F
-GLIBC_2.12 putpwent F
-GLIBC_2.12 puts F
-GLIBC_2.12 putsgent F
-GLIBC_2.12 putspent F
-GLIBC_2.12 pututline F
-GLIBC_2.12 pututxline F
-GLIBC_2.12 putw F
-GLIBC_2.12 putwc F
-GLIBC_2.12 putwc_unlocked F
-GLIBC_2.12 putwchar F
-GLIBC_2.12 putwchar_unlocked F
-GLIBC_2.12 pvalloc F
-GLIBC_2.12 pwrite F
-GLIBC_2.12 pwrite64 F
-GLIBC_2.12 pwritev F
-GLIBC_2.12 pwritev64 F
-GLIBC_2.12 qecvt F
-GLIBC_2.12 qecvt_r F
-GLIBC_2.12 qfcvt F
-GLIBC_2.12 qfcvt_r F
-GLIBC_2.12 qgcvt F
-GLIBC_2.12 qsort F
-GLIBC_2.12 qsort_r F
-GLIBC_2.12 query_module F
-GLIBC_2.12 quick_exit F
-GLIBC_2.12 quotactl F
-GLIBC_2.12 raise F
-GLIBC_2.12 rand F
-GLIBC_2.12 rand_r F
-GLIBC_2.12 random F
-GLIBC_2.12 random_r F
-GLIBC_2.12 rawmemchr F
-GLIBC_2.12 rcmd F
-GLIBC_2.12 rcmd_af F
-GLIBC_2.12 re_comp F
-GLIBC_2.12 re_compile_fastmap F
-GLIBC_2.12 re_compile_pattern F
-GLIBC_2.12 re_exec F
-GLIBC_2.12 re_match F
-GLIBC_2.12 re_match_2 F
-GLIBC_2.12 re_search F
-GLIBC_2.12 re_search_2 F
-GLIBC_2.12 re_set_registers F
-GLIBC_2.12 re_set_syntax F
-GLIBC_2.12 re_syntax_options D 0x8
-GLIBC_2.12 read F
-GLIBC_2.12 readahead F
-GLIBC_2.12 readdir F
-GLIBC_2.12 readdir64 F
-GLIBC_2.12 readdir64_r F
-GLIBC_2.12 readdir_r F
-GLIBC_2.12 readlink F
-GLIBC_2.12 readlinkat F
-GLIBC_2.12 readv F
-GLIBC_2.12 realloc F
-GLIBC_2.12 realpath F
-GLIBC_2.12 reboot F
-GLIBC_2.12 recv F
-GLIBC_2.12 recvfrom F
-GLIBC_2.12 recvmmsg F
-GLIBC_2.12 recvmsg F
-GLIBC_2.12 regcomp F
-GLIBC_2.12 regerror F
-GLIBC_2.12 regexec F
-GLIBC_2.12 regfree F
-GLIBC_2.12 register_printf_function F
-GLIBC_2.12 register_printf_modifier F
-GLIBC_2.12 register_printf_specifier F
-GLIBC_2.12 register_printf_type F
-GLIBC_2.12 registerrpc F
-GLIBC_2.12 remap_file_pages F
-GLIBC_2.12 remove F
-GLIBC_2.12 removexattr F
-GLIBC_2.12 remque F
-GLIBC_2.12 rename F
-GLIBC_2.12 renameat F
-GLIBC_2.12 revoke F
-GLIBC_2.12 rewind F
-GLIBC_2.12 rewinddir F
-GLIBC_2.12 rexec F
-GLIBC_2.12 rexec_af F
-GLIBC_2.12 rexecoptions D 0x4
-GLIBC_2.12 rindex F
-GLIBC_2.12 rmdir F
-GLIBC_2.12 rpc_createerr D 0x20
-GLIBC_2.12 rpmatch F
-GLIBC_2.12 rresvport F
-GLIBC_2.12 rresvport_af F
-GLIBC_2.12 rtime F
-GLIBC_2.12 ruserok F
-GLIBC_2.12 ruserok_af F
-GLIBC_2.12 ruserpass F
-GLIBC_2.12 sbrk F
-GLIBC_2.12 scalbn F
-GLIBC_2.12 scalbnf F
-GLIBC_2.12 scalbnl F
-GLIBC_2.12 scandir F
-GLIBC_2.12 scandir64 F
-GLIBC_2.12 scanf F
-GLIBC_2.12 sched_get_priority_max F
-GLIBC_2.12 sched_get_priority_min F
-GLIBC_2.12 sched_getaffinity F
-GLIBC_2.12 sched_getcpu F
-GLIBC_2.12 sched_getparam F
-GLIBC_2.12 sched_getscheduler F
-GLIBC_2.12 sched_rr_get_interval F
-GLIBC_2.12 sched_setaffinity F
-GLIBC_2.12 sched_setparam F
-GLIBC_2.12 sched_setscheduler F
-GLIBC_2.12 sched_yield F
-GLIBC_2.12 seed48 F
-GLIBC_2.12 seed48_r F
-GLIBC_2.12 seekdir F
-GLIBC_2.12 select F
-GLIBC_2.12 semctl F
-GLIBC_2.12 semget F
-GLIBC_2.12 semop F
-GLIBC_2.12 semtimedop F
-GLIBC_2.12 send F
-GLIBC_2.12 sendfile F
-GLIBC_2.12 sendfile64 F
-GLIBC_2.12 sendmsg F
-GLIBC_2.12 sendto F
-GLIBC_2.12 set_dataplane F
-GLIBC_2.12 setaliasent F
-GLIBC_2.12 setbuf F
-GLIBC_2.12 setbuffer F
-GLIBC_2.12 setcontext F
-GLIBC_2.12 setdomainname F
-GLIBC_2.12 setegid F
-GLIBC_2.12 setenv F
-GLIBC_2.12 seteuid F
-GLIBC_2.12 setfsent F
-GLIBC_2.12 setfsgid F
-GLIBC_2.12 setfsuid F
-GLIBC_2.12 setgid F
-GLIBC_2.12 setgrent F
-GLIBC_2.12 setgroups F
-GLIBC_2.12 sethostent F
-GLIBC_2.12 sethostid F
-GLIBC_2.12 sethostname F
-GLIBC_2.12 setipv4sourcefilter F
-GLIBC_2.12 setitimer F
-GLIBC_2.12 setjmp F
-GLIBC_2.12 setlinebuf F
-GLIBC_2.12 setlocale F
-GLIBC_2.12 setlogin F
-GLIBC_2.12 setlogmask F
-GLIBC_2.12 setmntent F
-GLIBC_2.12 setnetent F
-GLIBC_2.12 setnetgrent F
-GLIBC_2.12 setpgid F
-GLIBC_2.12 setpgrp F
-GLIBC_2.12 setpriority F
-GLIBC_2.12 setprotoent F
-GLIBC_2.12 setpwent F
-GLIBC_2.12 setregid F
-GLIBC_2.12 setresgid F
-GLIBC_2.12 setresuid F
-GLIBC_2.12 setreuid F
-GLIBC_2.12 setrlimit F
-GLIBC_2.12 setrlimit64 F
-GLIBC_2.12 setrpcent F
-GLIBC_2.12 setservent F
-GLIBC_2.12 setsgent F
-GLIBC_2.12 setsid F
-GLIBC_2.12 setsockopt F
-GLIBC_2.12 setsourcefilter F
-GLIBC_2.12 setspent F
-GLIBC_2.12 setstate F
-GLIBC_2.12 setstate_r F
-GLIBC_2.12 settimeofday F
-GLIBC_2.12 setttyent F
-GLIBC_2.12 setuid F
-GLIBC_2.12 setusershell F
-GLIBC_2.12 setutent F
-GLIBC_2.12 setutxent F
-GLIBC_2.12 setvbuf F
-GLIBC_2.12 setxattr F
-GLIBC_2.12 sgetsgent F
-GLIBC_2.12 sgetsgent_r F
-GLIBC_2.12 sgetspent F
-GLIBC_2.12 sgetspent_r F
-GLIBC_2.12 shmat F
-GLIBC_2.12 shmctl F
-GLIBC_2.12 shmdt F
-GLIBC_2.12 shmget F
-GLIBC_2.12 shutdown F
-GLIBC_2.12 sigaction F
-GLIBC_2.12 sigaddset F
-GLIBC_2.12 sigaltstack F
-GLIBC_2.12 sigandset F
-GLIBC_2.12 sigblock F
-GLIBC_2.12 sigdelset F
-GLIBC_2.12 sigemptyset F
-GLIBC_2.12 sigfillset F
-GLIBC_2.12 siggetmask F
-GLIBC_2.12 sighold F
-GLIBC_2.12 sigignore F
-GLIBC_2.12 siginterrupt F
-GLIBC_2.12 sigisemptyset F
-GLIBC_2.12 sigismember F
-GLIBC_2.12 siglongjmp F
-GLIBC_2.12 signal F
-GLIBC_2.12 signalfd F
-GLIBC_2.12 sigorset F
-GLIBC_2.12 sigpause F
-GLIBC_2.12 sigpending F
-GLIBC_2.12 sigprocmask F
-GLIBC_2.12 sigqueue F
-GLIBC_2.12 sigrelse F
-GLIBC_2.12 sigreturn F
-GLIBC_2.12 sigset F
-GLIBC_2.12 sigsetmask F
-GLIBC_2.12 sigstack F
-GLIBC_2.12 sigsuspend F
-GLIBC_2.12 sigtimedwait F
-GLIBC_2.12 sigvec F
-GLIBC_2.12 sigwait F
-GLIBC_2.12 sigwaitinfo F
-GLIBC_2.12 sleep F
-GLIBC_2.12 snprintf F
-GLIBC_2.12 sockatmark F
-GLIBC_2.12 socket F
-GLIBC_2.12 socketpair F
-GLIBC_2.12 splice F
-GLIBC_2.12 sprintf F
-GLIBC_2.12 sprofil F
-GLIBC_2.12 srand F
-GLIBC_2.12 srand48 F
-GLIBC_2.12 srand48_r F
-GLIBC_2.12 srandom F
-GLIBC_2.12 srandom_r F
-GLIBC_2.12 sscanf F
-GLIBC_2.12 ssignal F
-GLIBC_2.12 sstk F
-GLIBC_2.12 statfs F
-GLIBC_2.12 statfs64 F
-GLIBC_2.12 statvfs F
-GLIBC_2.12 statvfs64 F
-GLIBC_2.12 stderr D 0x8
-GLIBC_2.12 stdin D 0x8
-GLIBC_2.12 stdout D 0x8
-GLIBC_2.12 step F
-GLIBC_2.12 stime F
-GLIBC_2.12 stpcpy F
-GLIBC_2.12 stpncpy F
-GLIBC_2.12 strcasecmp F
-GLIBC_2.12 strcasecmp_l F
-GLIBC_2.12 strcasestr F
-GLIBC_2.12 strcat F
-GLIBC_2.12 strchr F
-GLIBC_2.12 strchrnul F
-GLIBC_2.12 strcmp F
-GLIBC_2.12 strcoll F
-GLIBC_2.12 strcoll_l F
-GLIBC_2.12 strcpy F
-GLIBC_2.12 strcspn F
-GLIBC_2.12 strdup F
-GLIBC_2.12 strerror F
-GLIBC_2.12 strerror_l F
-GLIBC_2.12 strerror_r F
-GLIBC_2.12 strfmon F
-GLIBC_2.12 strfmon_l F
-GLIBC_2.12 strfry F
-GLIBC_2.12 strftime F
-GLIBC_2.12 strftime_l F
-GLIBC_2.12 strlen F
-GLIBC_2.12 strncasecmp F
-GLIBC_2.12 strncasecmp_l F
-GLIBC_2.12 strncat F
-GLIBC_2.12 strncmp F
-GLIBC_2.12 strncpy F
-GLIBC_2.12 strndup F
-GLIBC_2.12 strnlen F
-GLIBC_2.12 strpbrk F
-GLIBC_2.12 strptime F
-GLIBC_2.12 strptime_l F
-GLIBC_2.12 strrchr F
-GLIBC_2.12 strsep F
-GLIBC_2.12 strsignal F
-GLIBC_2.12 strspn F
-GLIBC_2.12 strstr F
-GLIBC_2.12 strtod F
-GLIBC_2.12 strtod_l F
-GLIBC_2.12 strtof F
-GLIBC_2.12 strtof_l F
-GLIBC_2.12 strtoimax F
-GLIBC_2.12 strtok F
-GLIBC_2.12 strtok_r F
-GLIBC_2.12 strtol F
-GLIBC_2.12 strtol_l F
-GLIBC_2.12 strtold F
-GLIBC_2.12 strtold_l F
-GLIBC_2.12 strtoll F
-GLIBC_2.12 strtoll_l F
-GLIBC_2.12 strtoq F
-GLIBC_2.12 strtoul F
-GLIBC_2.12 strtoul_l F
-GLIBC_2.12 strtoull F
-GLIBC_2.12 strtoull_l F
-GLIBC_2.12 strtoumax F
-GLIBC_2.12 strtouq F
-GLIBC_2.12 strverscmp F
-GLIBC_2.12 strxfrm F
-GLIBC_2.12 strxfrm_l F
-GLIBC_2.12 stty F
-GLIBC_2.12 svc_exit F
-GLIBC_2.12 svc_fdset D 0x80
-GLIBC_2.12 svc_getreq F
-GLIBC_2.12 svc_getreq_common F
-GLIBC_2.12 svc_getreq_poll F
-GLIBC_2.12 svc_getreqset F
-GLIBC_2.12 svc_max_pollfd D 0x4
-GLIBC_2.12 svc_pollfd D 0x8
-GLIBC_2.12 svc_register F
-GLIBC_2.12 svc_run F
-GLIBC_2.12 svc_sendreply F
-GLIBC_2.12 svc_unregister F
-GLIBC_2.12 svcauthdes_stats D 0x18
-GLIBC_2.12 svcerr_auth F
-GLIBC_2.12 svcerr_decode F
-GLIBC_2.12 svcerr_noproc F
-GLIBC_2.12 svcerr_noprog F
-GLIBC_2.12 svcerr_progvers F
-GLIBC_2.12 svcerr_systemerr F
-GLIBC_2.12 svcerr_weakauth F
-GLIBC_2.12 svcfd_create F
-GLIBC_2.12 svcraw_create F
-GLIBC_2.12 svctcp_create F
-GLIBC_2.12 svcudp_bufcreate F
-GLIBC_2.12 svcudp_create F
-GLIBC_2.12 svcudp_enablecache F
-GLIBC_2.12 svcunix_create F
-GLIBC_2.12 svcunixfd_create F
-GLIBC_2.12 swab F
-GLIBC_2.12 swapcontext F
-GLIBC_2.12 swapoff F
-GLIBC_2.12 swapon F
-GLIBC_2.12 swprintf F
-GLIBC_2.12 swscanf F
-GLIBC_2.12 symlink F
-GLIBC_2.12 symlinkat F
-GLIBC_2.12 sync F
-GLIBC_2.12 sync_file_range F
-GLIBC_2.12 sys_errlist D 0x438
-GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.12 sys_sigabbrev D 0x208
-GLIBC_2.12 sys_siglist D 0x208
-GLIBC_2.12 syscall F
-GLIBC_2.12 sysconf F
-GLIBC_2.12 sysctl F
-GLIBC_2.12 sysinfo F
-GLIBC_2.12 syslog F
-GLIBC_2.12 system F
-GLIBC_2.12 sysv_signal F
-GLIBC_2.12 tcdrain F
-GLIBC_2.12 tcflow F
-GLIBC_2.12 tcflush F
-GLIBC_2.12 tcgetattr F
-GLIBC_2.12 tcgetpgrp F
-GLIBC_2.12 tcgetsid F
-GLIBC_2.12 tcsendbreak F
-GLIBC_2.12 tcsetattr F
-GLIBC_2.12 tcsetpgrp F
-GLIBC_2.12 tdelete F
-GLIBC_2.12 tdestroy F
-GLIBC_2.12 tee F
-GLIBC_2.12 telldir F
-GLIBC_2.12 tempnam F
-GLIBC_2.12 textdomain F
-GLIBC_2.12 tfind F
-GLIBC_2.12 time F
-GLIBC_2.12 timegm F
-GLIBC_2.12 timelocal F
-GLIBC_2.12 timerfd_create F
-GLIBC_2.12 timerfd_gettime F
-GLIBC_2.12 timerfd_settime F
-GLIBC_2.12 times F
-GLIBC_2.12 timezone D 0x8
-GLIBC_2.12 tmpfile F
-GLIBC_2.12 tmpfile64 F
-GLIBC_2.12 tmpnam F
-GLIBC_2.12 tmpnam_r F
-GLIBC_2.12 toascii F
-GLIBC_2.12 tolower F
-GLIBC_2.12 tolower_l F
-GLIBC_2.12 toupper F
-GLIBC_2.12 toupper_l F
-GLIBC_2.12 towctrans F
-GLIBC_2.12 towctrans_l F
-GLIBC_2.12 towlower F
-GLIBC_2.12 towlower_l F
-GLIBC_2.12 towupper F
-GLIBC_2.12 towupper_l F
-GLIBC_2.12 tr_break F
-GLIBC_2.12 truncate F
-GLIBC_2.12 truncate64 F
-GLIBC_2.12 tsearch F
-GLIBC_2.12 ttyname F
-GLIBC_2.12 ttyname_r F
-GLIBC_2.12 ttyslot F
-GLIBC_2.12 twalk F
-GLIBC_2.12 tzname D 0x10
-GLIBC_2.12 tzset F
-GLIBC_2.12 ualarm F
-GLIBC_2.12 ulckpwdf F
-GLIBC_2.12 ulimit F
-GLIBC_2.12 umask F
-GLIBC_2.12 umount F
-GLIBC_2.12 umount2 F
-GLIBC_2.12 uname F
-GLIBC_2.12 ungetc F
-GLIBC_2.12 ungetwc F
-GLIBC_2.12 unlink F
-GLIBC_2.12 unlinkat F
-GLIBC_2.12 unlockpt F
-GLIBC_2.12 unsetenv F
-GLIBC_2.12 unshare F
-GLIBC_2.12 updwtmp F
-GLIBC_2.12 updwtmpx F
-GLIBC_2.12 uselib F
-GLIBC_2.12 uselocale F
-GLIBC_2.12 user2netname F
-GLIBC_2.12 usleep F
-GLIBC_2.12 ustat F
-GLIBC_2.12 utime F
-GLIBC_2.12 utimensat F
-GLIBC_2.12 utimes F
-GLIBC_2.12 utmpname F
-GLIBC_2.12 utmpxname F
-GLIBC_2.12 valloc F
-GLIBC_2.12 vasprintf F
-GLIBC_2.12 vdprintf F
-GLIBC_2.12 verr F
-GLIBC_2.12 verrx F
-GLIBC_2.12 versionsort F
-GLIBC_2.12 versionsort64 F
-GLIBC_2.12 vfork F
-GLIBC_2.12 vfprintf F
-GLIBC_2.12 vfscanf F
-GLIBC_2.12 vfwprintf F
-GLIBC_2.12 vfwscanf F
-GLIBC_2.12 vhangup F
-GLIBC_2.12 vlimit F
-GLIBC_2.12 vmsplice F
-GLIBC_2.12 vprintf F
-GLIBC_2.12 vscanf F
-GLIBC_2.12 vsnprintf F
-GLIBC_2.12 vsprintf F
-GLIBC_2.12 vsscanf F
-GLIBC_2.12 vswprintf F
-GLIBC_2.12 vswscanf F
-GLIBC_2.12 vsyslog F
-GLIBC_2.12 vtimes F
-GLIBC_2.12 vwarn F
-GLIBC_2.12 vwarnx F
-GLIBC_2.12 vwprintf F
-GLIBC_2.12 vwscanf F
-GLIBC_2.12 wait F
-GLIBC_2.12 wait3 F
-GLIBC_2.12 wait4 F
-GLIBC_2.12 waitid F
-GLIBC_2.12 waitpid F
-GLIBC_2.12 warn F
-GLIBC_2.12 warnx F
-GLIBC_2.12 wcpcpy F
-GLIBC_2.12 wcpncpy F
-GLIBC_2.12 wcrtomb F
-GLIBC_2.12 wcscasecmp F
-GLIBC_2.12 wcscasecmp_l F
-GLIBC_2.12 wcscat F
-GLIBC_2.12 wcschr F
-GLIBC_2.12 wcschrnul F
-GLIBC_2.12 wcscmp F
-GLIBC_2.12 wcscoll F
-GLIBC_2.12 wcscoll_l F
-GLIBC_2.12 wcscpy F
-GLIBC_2.12 wcscspn F
-GLIBC_2.12 wcsdup F
-GLIBC_2.12 wcsftime F
-GLIBC_2.12 wcsftime_l F
-GLIBC_2.12 wcslen F
-GLIBC_2.12 wcsncasecmp F
-GLIBC_2.12 wcsncasecmp_l F
-GLIBC_2.12 wcsncat F
-GLIBC_2.12 wcsncmp F
-GLIBC_2.12 wcsncpy F
-GLIBC_2.12 wcsnlen F
-GLIBC_2.12 wcsnrtombs F
-GLIBC_2.12 wcspbrk F
-GLIBC_2.12 wcsrchr F
-GLIBC_2.12 wcsrtombs F
-GLIBC_2.12 wcsspn F
-GLIBC_2.12 wcsstr F
-GLIBC_2.12 wcstod F
-GLIBC_2.12 wcstod_l F
-GLIBC_2.12 wcstof F
-GLIBC_2.12 wcstof_l F
-GLIBC_2.12 wcstoimax F
-GLIBC_2.12 wcstok F
-GLIBC_2.12 wcstol F
-GLIBC_2.12 wcstol_l F
-GLIBC_2.12 wcstold F
-GLIBC_2.12 wcstold_l F
-GLIBC_2.12 wcstoll F
-GLIBC_2.12 wcstoll_l F
-GLIBC_2.12 wcstombs F
-GLIBC_2.12 wcstoq F
-GLIBC_2.12 wcstoul F
-GLIBC_2.12 wcstoul_l F
-GLIBC_2.12 wcstoull F
-GLIBC_2.12 wcstoull_l F
-GLIBC_2.12 wcstoumax F
-GLIBC_2.12 wcstouq F
-GLIBC_2.12 wcswcs F
-GLIBC_2.12 wcswidth F
-GLIBC_2.12 wcsxfrm F
-GLIBC_2.12 wcsxfrm_l F
-GLIBC_2.12 wctob F
-GLIBC_2.12 wctomb F
-GLIBC_2.12 wctrans F
-GLIBC_2.12 wctrans_l F
-GLIBC_2.12 wctype F
-GLIBC_2.12 wctype_l F
-GLIBC_2.12 wcwidth F
-GLIBC_2.12 wmemchr F
-GLIBC_2.12 wmemcmp F
-GLIBC_2.12 wmemcpy F
-GLIBC_2.12 wmemmove F
-GLIBC_2.12 wmempcpy F
-GLIBC_2.12 wmemset F
-GLIBC_2.12 wordexp F
-GLIBC_2.12 wordfree F
-GLIBC_2.12 wprintf F
-GLIBC_2.12 write F
-GLIBC_2.12 writev F
-GLIBC_2.12 wscanf F
-GLIBC_2.12 xdecrypt F
-GLIBC_2.12 xdr_accepted_reply F
-GLIBC_2.12 xdr_array F
-GLIBC_2.12 xdr_authdes_cred F
-GLIBC_2.12 xdr_authdes_verf F
-GLIBC_2.12 xdr_authunix_parms F
-GLIBC_2.12 xdr_bool F
-GLIBC_2.12 xdr_bytes F
-GLIBC_2.12 xdr_callhdr F
-GLIBC_2.12 xdr_callmsg F
-GLIBC_2.12 xdr_char F
-GLIBC_2.12 xdr_cryptkeyarg F
-GLIBC_2.12 xdr_cryptkeyarg2 F
-GLIBC_2.12 xdr_cryptkeyres F
-GLIBC_2.12 xdr_des_block F
-GLIBC_2.12 xdr_double F
-GLIBC_2.12 xdr_enum F
-GLIBC_2.12 xdr_float F
-GLIBC_2.12 xdr_free F
-GLIBC_2.12 xdr_getcredres F
-GLIBC_2.12 xdr_hyper F
-GLIBC_2.12 xdr_int F
-GLIBC_2.12 xdr_int16_t F
-GLIBC_2.12 xdr_int32_t F
-GLIBC_2.12 xdr_int64_t F
-GLIBC_2.12 xdr_int8_t F
-GLIBC_2.12 xdr_key_netstarg F
-GLIBC_2.12 xdr_key_netstres F
-GLIBC_2.12 xdr_keybuf F
-GLIBC_2.12 xdr_keystatus F
-GLIBC_2.12 xdr_long F
-GLIBC_2.12 xdr_longlong_t F
-GLIBC_2.12 xdr_netnamestr F
-GLIBC_2.12 xdr_netobj F
-GLIBC_2.12 xdr_opaque F
-GLIBC_2.12 xdr_opaque_auth F
-GLIBC_2.12 xdr_pmap F
-GLIBC_2.12 xdr_pmaplist F
-GLIBC_2.12 xdr_pointer F
-GLIBC_2.12 xdr_quad_t F
-GLIBC_2.12 xdr_reference F
-GLIBC_2.12 xdr_rejected_reply F
-GLIBC_2.12 xdr_replymsg F
-GLIBC_2.12 xdr_rmtcall_args F
-GLIBC_2.12 xdr_rmtcallres F
-GLIBC_2.12 xdr_short F
-GLIBC_2.12 xdr_sizeof F
-GLIBC_2.12 xdr_string F
-GLIBC_2.12 xdr_u_char F
-GLIBC_2.12 xdr_u_hyper F
-GLIBC_2.12 xdr_u_int F
-GLIBC_2.12 xdr_u_long F
-GLIBC_2.12 xdr_u_longlong_t F
-GLIBC_2.12 xdr_u_quad_t F
-GLIBC_2.12 xdr_u_short F
-GLIBC_2.12 xdr_uint16_t F
-GLIBC_2.12 xdr_uint32_t F
-GLIBC_2.12 xdr_uint64_t F
-GLIBC_2.12 xdr_uint8_t F
-GLIBC_2.12 xdr_union F
-GLIBC_2.12 xdr_unixcred F
-GLIBC_2.12 xdr_vector F
-GLIBC_2.12 xdr_void F
-GLIBC_2.12 xdr_wrapstring F
-GLIBC_2.12 xdrmem_create F
-GLIBC_2.12 xdrrec_create F
-GLIBC_2.12 xdrrec_endofrecord F
-GLIBC_2.12 xdrrec_eof F
-GLIBC_2.12 xdrrec_skiprecord F
-GLIBC_2.12 xdrstdio_create F
-GLIBC_2.12 xencrypt F
-GLIBC_2.12 xprt_register F
-GLIBC_2.12 xprt_unregister F
-GLIBC_2.15 GLIBC_2.15 A
-GLIBC_2.15 __fdelt_chk F
-GLIBC_2.15 __fdelt_warn F
-GLIBC_2.15 clock_adjtime F
-GLIBC_2.15 fanotify_init F
-GLIBC_2.15 fanotify_mark F
-GLIBC_2.15 name_to_handle_at F
-GLIBC_2.15 open_by_handle_at F
-GLIBC_2.15 posix_spawn F
-GLIBC_2.15 posix_spawnp F
-GLIBC_2.15 prlimit F
-GLIBC_2.15 prlimit64 F
-GLIBC_2.15 process_vm_readv F
-GLIBC_2.15 process_vm_writev F
-GLIBC_2.15 scandirat F
-GLIBC_2.15 scandirat64 F
-GLIBC_2.15 sendmmsg F
-GLIBC_2.15 setns F
-GLIBC_2.15 syncfs F
-GLIBC_2.16 GLIBC_2.16 A
-GLIBC_2.16 __getauxval F
-GLIBC_2.16 __poll_chk F
-GLIBC_2.16 __ppoll_chk F
-GLIBC_2.16 aligned_alloc F
-GLIBC_2.16 c16rtomb F
-GLIBC_2.16 c32rtomb F
-GLIBC_2.16 getauxval F
-GLIBC_2.16 mbrtoc16 F
-GLIBC_2.16 mbrtoc32 F
-GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
-GLIBC_2.17 clock_getcpuclockid F
-GLIBC_2.17 clock_getres F
-GLIBC_2.17 clock_gettime F
-GLIBC_2.17 clock_nanosleep F
-GLIBC_2.17 clock_settime F
-GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
-GLIBC_2.23 fts64_children F
-GLIBC_2.23 fts64_close F
-GLIBC_2.23 fts64_open F
-GLIBC_2.23 fts64_read F
-GLIBC_2.23 fts64_set F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libcrypt.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libcrypt.abilist
deleted file mode 100644
index d5643802b7..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libcrypt.abilist
+++ /dev/null
@@ -1,8 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 crypt F
-GLIBC_2.12 crypt_r F
-GLIBC_2.12 encrypt F
-GLIBC_2.12 encrypt_r F
-GLIBC_2.12 fcrypt F
-GLIBC_2.12 setkey F
-GLIBC_2.12 setkey_r F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libdl.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libdl.abilist
deleted file mode 100644
index cabc30c239..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libdl.abilist
+++ /dev/null
@@ -1,10 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 dladdr F
-GLIBC_2.12 dladdr1 F
-GLIBC_2.12 dlclose F
-GLIBC_2.12 dlerror F
-GLIBC_2.12 dlinfo F
-GLIBC_2.12 dlmopen F
-GLIBC_2.12 dlopen F
-GLIBC_2.12 dlsym F
-GLIBC_2.12 dlvsym F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist
deleted file mode 100644
index 18b8d00bec..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist
+++ /dev/null
@@ -1,375 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 _LIB_VERSION D 0x4
-GLIBC_2.12 __clog10 F
-GLIBC_2.12 __clog10f F
-GLIBC_2.12 __clog10l F
-GLIBC_2.12 __finite F
-GLIBC_2.12 __finitef F
-GLIBC_2.12 __fpclassify F
-GLIBC_2.12 __fpclassifyf F
-GLIBC_2.12 __signbit F
-GLIBC_2.12 __signbitf F
-GLIBC_2.12 acos F
-GLIBC_2.12 acosf F
-GLIBC_2.12 acosh F
-GLIBC_2.12 acoshf F
-GLIBC_2.12 acoshl F
-GLIBC_2.12 acosl F
-GLIBC_2.12 asin F
-GLIBC_2.12 asinf F
-GLIBC_2.12 asinh F
-GLIBC_2.12 asinhf F
-GLIBC_2.12 asinhl F
-GLIBC_2.12 asinl F
-GLIBC_2.12 atan F
-GLIBC_2.12 atan2 F
-GLIBC_2.12 atan2f F
-GLIBC_2.12 atan2l F
-GLIBC_2.12 atanf F
-GLIBC_2.12 atanh F
-GLIBC_2.12 atanhf F
-GLIBC_2.12 atanhl F
-GLIBC_2.12 atanl F
-GLIBC_2.12 cabs F
-GLIBC_2.12 cabsf F
-GLIBC_2.12 cabsl F
-GLIBC_2.12 cacos F
-GLIBC_2.12 cacosf F
-GLIBC_2.12 cacosh F
-GLIBC_2.12 cacoshf F
-GLIBC_2.12 cacoshl F
-GLIBC_2.12 cacosl F
-GLIBC_2.12 carg F
-GLIBC_2.12 cargf F
-GLIBC_2.12 cargl F
-GLIBC_2.12 casin F
-GLIBC_2.12 casinf F
-GLIBC_2.12 casinh F
-GLIBC_2.12 casinhf F
-GLIBC_2.12 casinhl F
-GLIBC_2.12 casinl F
-GLIBC_2.12 catan F
-GLIBC_2.12 catanf F
-GLIBC_2.12 catanh F
-GLIBC_2.12 catanhf F
-GLIBC_2.12 catanhl F
-GLIBC_2.12 catanl F
-GLIBC_2.12 cbrt F
-GLIBC_2.12 cbrtf F
-GLIBC_2.12 cbrtl F
-GLIBC_2.12 ccos F
-GLIBC_2.12 ccosf F
-GLIBC_2.12 ccosh F
-GLIBC_2.12 ccoshf F
-GLIBC_2.12 ccoshl F
-GLIBC_2.12 ccosl F
-GLIBC_2.12 ceil F
-GLIBC_2.12 ceilf F
-GLIBC_2.12 ceill F
-GLIBC_2.12 cexp F
-GLIBC_2.12 cexpf F
-GLIBC_2.12 cexpl F
-GLIBC_2.12 cimag F
-GLIBC_2.12 cimagf F
-GLIBC_2.12 cimagl F
-GLIBC_2.12 clog F
-GLIBC_2.12 clog10 F
-GLIBC_2.12 clog10f F
-GLIBC_2.12 clog10l F
-GLIBC_2.12 clogf F
-GLIBC_2.12 clogl F
-GLIBC_2.12 conj F
-GLIBC_2.12 conjf F
-GLIBC_2.12 conjl F
-GLIBC_2.12 copysign F
-GLIBC_2.12 copysignf F
-GLIBC_2.12 copysignl F
-GLIBC_2.12 cos F
-GLIBC_2.12 cosf F
-GLIBC_2.12 cosh F
-GLIBC_2.12 coshf F
-GLIBC_2.12 coshl F
-GLIBC_2.12 cosl F
-GLIBC_2.12 cpow F
-GLIBC_2.12 cpowf F
-GLIBC_2.12 cpowl F
-GLIBC_2.12 cproj F
-GLIBC_2.12 cprojf F
-GLIBC_2.12 cprojl F
-GLIBC_2.12 creal F
-GLIBC_2.12 crealf F
-GLIBC_2.12 creall F
-GLIBC_2.12 csin F
-GLIBC_2.12 csinf F
-GLIBC_2.12 csinh F
-GLIBC_2.12 csinhf F
-GLIBC_2.12 csinhl F
-GLIBC_2.12 csinl F
-GLIBC_2.12 csqrt F
-GLIBC_2.12 csqrtf F
-GLIBC_2.12 csqrtl F
-GLIBC_2.12 ctan F
-GLIBC_2.12 ctanf F
-GLIBC_2.12 ctanh F
-GLIBC_2.12 ctanhf F
-GLIBC_2.12 ctanhl F
-GLIBC_2.12 ctanl F
-GLIBC_2.12 drem F
-GLIBC_2.12 dremf F
-GLIBC_2.12 dreml F
-GLIBC_2.12 erf F
-GLIBC_2.12 erfc F
-GLIBC_2.12 erfcf F
-GLIBC_2.12 erfcl F
-GLIBC_2.12 erff F
-GLIBC_2.12 erfl F
-GLIBC_2.12 exp F
-GLIBC_2.12 exp10 F
-GLIBC_2.12 exp10f F
-GLIBC_2.12 exp10l F
-GLIBC_2.12 exp2 F
-GLIBC_2.12 exp2f F
-GLIBC_2.12 exp2l F
-GLIBC_2.12 expf F
-GLIBC_2.12 expl F
-GLIBC_2.12 expm1 F
-GLIBC_2.12 expm1f F
-GLIBC_2.12 expm1l F
-GLIBC_2.12 fabs F
-GLIBC_2.12 fabsf F
-GLIBC_2.12 fabsl F
-GLIBC_2.12 fdim F
-GLIBC_2.12 fdimf F
-GLIBC_2.12 fdiml F
-GLIBC_2.12 feclearexcept F
-GLIBC_2.12 fedisableexcept F
-GLIBC_2.12 feenableexcept F
-GLIBC_2.12 fegetenv F
-GLIBC_2.12 fegetexcept F
-GLIBC_2.12 fegetexceptflag F
-GLIBC_2.12 fegetround F
-GLIBC_2.12 feholdexcept F
-GLIBC_2.12 feraiseexcept F
-GLIBC_2.12 fesetenv F
-GLIBC_2.12 fesetexceptflag F
-GLIBC_2.12 fesetround F
-GLIBC_2.12 fetestexcept F
-GLIBC_2.12 feupdateenv F
-GLIBC_2.12 finite F
-GLIBC_2.12 finitef F
-GLIBC_2.12 finitel F
-GLIBC_2.12 floor F
-GLIBC_2.12 floorf F
-GLIBC_2.12 floorl F
-GLIBC_2.12 fma F
-GLIBC_2.12 fmaf F
-GLIBC_2.12 fmal F
-GLIBC_2.12 fmax F
-GLIBC_2.12 fmaxf F
-GLIBC_2.12 fmaxl F
-GLIBC_2.12 fmin F
-GLIBC_2.12 fminf F
-GLIBC_2.12 fminl F
-GLIBC_2.12 fmod F
-GLIBC_2.12 fmodf F
-GLIBC_2.12 fmodl F
-GLIBC_2.12 frexp F
-GLIBC_2.12 frexpf F
-GLIBC_2.12 frexpl F
-GLIBC_2.12 gamma F
-GLIBC_2.12 gammaf F
-GLIBC_2.12 gammal F
-GLIBC_2.12 hypot F
-GLIBC_2.12 hypotf F
-GLIBC_2.12 hypotl F
-GLIBC_2.12 ilogb F
-GLIBC_2.12 ilogbf F
-GLIBC_2.12 ilogbl F
-GLIBC_2.12 j0 F
-GLIBC_2.12 j0f F
-GLIBC_2.12 j0l F
-GLIBC_2.12 j1 F
-GLIBC_2.12 j1f F
-GLIBC_2.12 j1l F
-GLIBC_2.12 jn F
-GLIBC_2.12 jnf F
-GLIBC_2.12 jnl F
-GLIBC_2.12 ldexp F
-GLIBC_2.12 ldexpf F
-GLIBC_2.12 ldexpl F
-GLIBC_2.12 lgamma F
-GLIBC_2.12 lgamma_r F
-GLIBC_2.12 lgammaf F
-GLIBC_2.12 lgammaf_r F
-GLIBC_2.12 lgammal F
-GLIBC_2.12 lgammal_r F
-GLIBC_2.12 llrint F
-GLIBC_2.12 llrintf F
-GLIBC_2.12 llrintl F
-GLIBC_2.12 llround F
-GLIBC_2.12 llroundf F
-GLIBC_2.12 llroundl F
-GLIBC_2.12 log F
-GLIBC_2.12 log10 F
-GLIBC_2.12 log10f F
-GLIBC_2.12 log10l F
-GLIBC_2.12 log1p F
-GLIBC_2.12 log1pf F
-GLIBC_2.12 log1pl F
-GLIBC_2.12 log2 F
-GLIBC_2.12 log2f F
-GLIBC_2.12 log2l F
-GLIBC_2.12 logb F
-GLIBC_2.12 logbf F
-GLIBC_2.12 logbl F
-GLIBC_2.12 logf F
-GLIBC_2.12 logl F
-GLIBC_2.12 lrint F
-GLIBC_2.12 lrintf F
-GLIBC_2.12 lrintl F
-GLIBC_2.12 lround F
-GLIBC_2.12 lroundf F
-GLIBC_2.12 lroundl F
-GLIBC_2.12 matherr F
-GLIBC_2.12 modf F
-GLIBC_2.12 modff F
-GLIBC_2.12 modfl F
-GLIBC_2.12 nan F
-GLIBC_2.12 nanf F
-GLIBC_2.12 nanl F
-GLIBC_2.12 nearbyint F
-GLIBC_2.12 nearbyintf F
-GLIBC_2.12 nearbyintl F
-GLIBC_2.12 nextafter F
-GLIBC_2.12 nextafterf F
-GLIBC_2.12 nextafterl F
-GLIBC_2.12 nexttoward F
-GLIBC_2.12 nexttowardf F
-GLIBC_2.12 nexttowardl F
-GLIBC_2.12 pow F
-GLIBC_2.12 pow10 F
-GLIBC_2.12 pow10f F
-GLIBC_2.12 pow10l F
-GLIBC_2.12 powf F
-GLIBC_2.12 powl F
-GLIBC_2.12 remainder F
-GLIBC_2.12 remainderf F
-GLIBC_2.12 remainderl F
-GLIBC_2.12 remquo F
-GLIBC_2.12 remquof F
-GLIBC_2.12 remquol F
-GLIBC_2.12 rint F
-GLIBC_2.12 rintf F
-GLIBC_2.12 rintl F
-GLIBC_2.12 round F
-GLIBC_2.12 roundf F
-GLIBC_2.12 roundl F
-GLIBC_2.12 scalb F
-GLIBC_2.12 scalbf F
-GLIBC_2.12 scalbl F
-GLIBC_2.12 scalbln F
-GLIBC_2.12 scalblnf F
-GLIBC_2.12 scalblnl F
-GLIBC_2.12 scalbn F
-GLIBC_2.12 scalbnf F
-GLIBC_2.12 scalbnl F
-GLIBC_2.12 signgam D 0x4
-GLIBC_2.12 significand F
-GLIBC_2.12 significandf F
-GLIBC_2.12 significandl F
-GLIBC_2.12 sin F
-GLIBC_2.12 sincos F
-GLIBC_2.12 sincosf F
-GLIBC_2.12 sincosl F
-GLIBC_2.12 sinf F
-GLIBC_2.12 sinh F
-GLIBC_2.12 sinhf F
-GLIBC_2.12 sinhl F
-GLIBC_2.12 sinl F
-GLIBC_2.12 sqrt F
-GLIBC_2.12 sqrtf F
-GLIBC_2.12 sqrtl F
-GLIBC_2.12 tan F
-GLIBC_2.12 tanf F
-GLIBC_2.12 tanh F
-GLIBC_2.12 tanhf F
-GLIBC_2.12 tanhl F
-GLIBC_2.12 tanl F
-GLIBC_2.12 tgamma F
-GLIBC_2.12 tgammaf F
-GLIBC_2.12 tgammal F
-GLIBC_2.12 trunc F
-GLIBC_2.12 truncf F
-GLIBC_2.12 truncl F
-GLIBC_2.12 y0 F
-GLIBC_2.12 y0f F
-GLIBC_2.12 y0l F
-GLIBC_2.12 y1 F
-GLIBC_2.12 y1f F
-GLIBC_2.12 y1l F
-GLIBC_2.12 yn F
-GLIBC_2.12 ynf F
-GLIBC_2.12 ynl F
-GLIBC_2.15 GLIBC_2.15 A
-GLIBC_2.15 __acos_finite F
-GLIBC_2.15 __acosf_finite F
-GLIBC_2.15 __acosh_finite F
-GLIBC_2.15 __acoshf_finite F
-GLIBC_2.15 __asin_finite F
-GLIBC_2.15 __asinf_finite F
-GLIBC_2.15 __atan2_finite F
-GLIBC_2.15 __atan2f_finite F
-GLIBC_2.15 __atanh_finite F
-GLIBC_2.15 __atanhf_finite F
-GLIBC_2.15 __cosh_finite F
-GLIBC_2.15 __coshf_finite F
-GLIBC_2.15 __exp10_finite F
-GLIBC_2.15 __exp10f_finite F
-GLIBC_2.15 __exp2_finite F
-GLIBC_2.15 __exp2f_finite F
-GLIBC_2.15 __exp_finite F
-GLIBC_2.15 __expf_finite F
-GLIBC_2.15 __fmod_finite F
-GLIBC_2.15 __fmodf_finite F
-GLIBC_2.15 __gamma_r_finite F
-GLIBC_2.15 __gammaf_r_finite F
-GLIBC_2.15 __hypot_finite F
-GLIBC_2.15 __hypotf_finite F
-GLIBC_2.15 __j0_finite F
-GLIBC_2.15 __j0f_finite F
-GLIBC_2.15 __j1_finite F
-GLIBC_2.15 __j1f_finite F
-GLIBC_2.15 __jn_finite F
-GLIBC_2.15 __jnf_finite F
-GLIBC_2.15 __lgamma_r_finite F
-GLIBC_2.15 __lgammaf_r_finite F
-GLIBC_2.15 __log10_finite F
-GLIBC_2.15 __log10f_finite F
-GLIBC_2.15 __log2_finite F
-GLIBC_2.15 __log2f_finite F
-GLIBC_2.15 __log_finite F
-GLIBC_2.15 __logf_finite F
-GLIBC_2.15 __pow_finite F
-GLIBC_2.15 __powf_finite F
-GLIBC_2.15 __remainder_finite F
-GLIBC_2.15 __remainderf_finite F
-GLIBC_2.15 __scalb_finite F
-GLIBC_2.15 __scalbf_finite F
-GLIBC_2.15 __sinh_finite F
-GLIBC_2.15 __sinhf_finite F
-GLIBC_2.15 __sqrt_finite F
-GLIBC_2.15 __sqrtf_finite F
-GLIBC_2.15 __y0_finite F
-GLIBC_2.15 __y0f_finite F
-GLIBC_2.15 __y1_finite F
-GLIBC_2.15 __y1f_finite F
-GLIBC_2.15 __yn_finite F
-GLIBC_2.15 __ynf_finite F
-GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 __issignaling F
-GLIBC_2.18 __issignalingf F
-GLIBC_2.23 GLIBC_2.23 A
-GLIBC_2.23 __signgam D 0x4
-GLIBC_2.23 lgamma F
-GLIBC_2.23 lgammaf F
-GLIBC_2.23 lgammal F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libnsl.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libnsl.abilist
deleted file mode 100644
index 0277e5c1a8..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libnsl.abilist
+++ /dev/null
@@ -1,122 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __free_fdresult F
-GLIBC_2.12 __nis_default_access F
-GLIBC_2.12 __nis_default_group F
-GLIBC_2.12 __nis_default_owner F
-GLIBC_2.12 __nis_default_ttl F
-GLIBC_2.12 __nis_finddirectory F
-GLIBC_2.12 __nis_hash F
-GLIBC_2.12 __nisbind_connect F
-GLIBC_2.12 __nisbind_create F
-GLIBC_2.12 __nisbind_destroy F
-GLIBC_2.12 __nisbind_next F
-GLIBC_2.12 __yp_check F
-GLIBC_2.12 nis_add F
-GLIBC_2.12 nis_add_entry F
-GLIBC_2.12 nis_addmember F
-GLIBC_2.12 nis_checkpoint F
-GLIBC_2.12 nis_clone_directory F
-GLIBC_2.12 nis_clone_object F
-GLIBC_2.12 nis_clone_result F
-GLIBC_2.12 nis_creategroup F
-GLIBC_2.12 nis_destroy_object F
-GLIBC_2.12 nis_destroygroup F
-GLIBC_2.12 nis_dir_cmp F
-GLIBC_2.12 nis_domain_of F
-GLIBC_2.12 nis_domain_of_r F
-GLIBC_2.12 nis_first_entry F
-GLIBC_2.12 nis_free_directory F
-GLIBC_2.12 nis_free_object F
-GLIBC_2.12 nis_free_request F
-GLIBC_2.12 nis_freenames F
-GLIBC_2.12 nis_freeresult F
-GLIBC_2.12 nis_freeservlist F
-GLIBC_2.12 nis_freetags F
-GLIBC_2.12 nis_getnames F
-GLIBC_2.12 nis_getservlist F
-GLIBC_2.12 nis_ismember F
-GLIBC_2.12 nis_leaf_of F
-GLIBC_2.12 nis_leaf_of_r F
-GLIBC_2.12 nis_lerror F
-GLIBC_2.12 nis_list F
-GLIBC_2.12 nis_local_directory F
-GLIBC_2.12 nis_local_group F
-GLIBC_2.12 nis_local_host F
-GLIBC_2.12 nis_local_principal F
-GLIBC_2.12 nis_lookup F
-GLIBC_2.12 nis_mkdir F
-GLIBC_2.12 nis_modify F
-GLIBC_2.12 nis_modify_entry F
-GLIBC_2.12 nis_name_of F
-GLIBC_2.12 nis_name_of_r F
-GLIBC_2.12 nis_next_entry F
-GLIBC_2.12 nis_perror F
-GLIBC_2.12 nis_ping F
-GLIBC_2.12 nis_print_directory F
-GLIBC_2.12 nis_print_entry F
-GLIBC_2.12 nis_print_group F
-GLIBC_2.12 nis_print_group_entry F
-GLIBC_2.12 nis_print_link F
-GLIBC_2.12 nis_print_object F
-GLIBC_2.12 nis_print_result F
-GLIBC_2.12 nis_print_rights F
-GLIBC_2.12 nis_print_table F
-GLIBC_2.12 nis_read_obj F
-GLIBC_2.12 nis_remove F
-GLIBC_2.12 nis_remove_entry F
-GLIBC_2.12 nis_removemember F
-GLIBC_2.12 nis_rmdir F
-GLIBC_2.12 nis_servstate F
-GLIBC_2.12 nis_sperrno F
-GLIBC_2.12 nis_sperror F
-GLIBC_2.12 nis_sperror_r F
-GLIBC_2.12 nis_stats F
-GLIBC_2.12 nis_verifygroup F
-GLIBC_2.12 nis_write_obj F
-GLIBC_2.12 readColdStartFile F
-GLIBC_2.12 writeColdStartFile F
-GLIBC_2.12 xdr_cback_data F
-GLIBC_2.12 xdr_domainname F
-GLIBC_2.12 xdr_keydat F
-GLIBC_2.12 xdr_mapname F
-GLIBC_2.12 xdr_obj_p F
-GLIBC_2.12 xdr_peername F
-GLIBC_2.12 xdr_valdat F
-GLIBC_2.12 xdr_yp_buf F
-GLIBC_2.12 xdr_ypall F
-GLIBC_2.12 xdr_ypbind_binding F
-GLIBC_2.12 xdr_ypbind_resp F
-GLIBC_2.12 xdr_ypbind_resptype F
-GLIBC_2.12 xdr_ypbind_setdom F
-GLIBC_2.12 xdr_ypdelete_args F
-GLIBC_2.12 xdr_ypmap_parms F
-GLIBC_2.12 xdr_ypmaplist F
-GLIBC_2.12 xdr_yppush_status F
-GLIBC_2.12 xdr_yppushresp_xfr F
-GLIBC_2.12 xdr_ypreq_key F
-GLIBC_2.12 xdr_ypreq_nokey F
-GLIBC_2.12 xdr_ypreq_xfr F
-GLIBC_2.12 xdr_ypresp_all F
-GLIBC_2.12 xdr_ypresp_key_val F
-GLIBC_2.12 xdr_ypresp_maplist F
-GLIBC_2.12 xdr_ypresp_master F
-GLIBC_2.12 xdr_ypresp_order F
-GLIBC_2.12 xdr_ypresp_val F
-GLIBC_2.12 xdr_ypresp_xfr F
-GLIBC_2.12 xdr_ypstat F
-GLIBC_2.12 xdr_ypupdate_args F
-GLIBC_2.12 xdr_ypxfrstat F
-GLIBC_2.12 yp_all F
-GLIBC_2.12 yp_bind F
-GLIBC_2.12 yp_first F
-GLIBC_2.12 yp_get_default_domain F
-GLIBC_2.12 yp_maplist F
-GLIBC_2.12 yp_master F
-GLIBC_2.12 yp_match F
-GLIBC_2.12 yp_next F
-GLIBC_2.12 yp_order F
-GLIBC_2.12 yp_unbind F
-GLIBC_2.12 yp_update F
-GLIBC_2.12 ypbinderr_string F
-GLIBC_2.12 yperr_string F
-GLIBC_2.12 ypprot_err F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libpthread.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libpthread.abilist
deleted file mode 100644
index d16158f938..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libpthread.abilist
+++ /dev/null
@@ -1,226 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 _IO_flockfile F
-GLIBC_2.12 _IO_ftrylockfile F
-GLIBC_2.12 _IO_funlockfile F
-GLIBC_2.12 __close F
-GLIBC_2.12 __connect F
-GLIBC_2.12 __errno_location F
-GLIBC_2.12 __fcntl F
-GLIBC_2.12 __fork F
-GLIBC_2.12 __h_errno_location F
-GLIBC_2.12 __libc_allocate_rtsig F
-GLIBC_2.12 __libc_current_sigrtmax F
-GLIBC_2.12 __libc_current_sigrtmin F
-GLIBC_2.12 __lseek F
-GLIBC_2.12 __nanosleep F
-GLIBC_2.12 __open F
-GLIBC_2.12 __open64 F
-GLIBC_2.12 __pread64 F
-GLIBC_2.12 __pthread_cleanup_routine F
-GLIBC_2.12 __pthread_getspecific F
-GLIBC_2.12 __pthread_key_create F
-GLIBC_2.12 __pthread_mutex_destroy F
-GLIBC_2.12 __pthread_mutex_init F
-GLIBC_2.12 __pthread_mutex_lock F
-GLIBC_2.12 __pthread_mutex_trylock F
-GLIBC_2.12 __pthread_mutex_unlock F
-GLIBC_2.12 __pthread_mutexattr_destroy F
-GLIBC_2.12 __pthread_mutexattr_init F
-GLIBC_2.12 __pthread_mutexattr_settype F
-GLIBC_2.12 __pthread_once F
-GLIBC_2.12 __pthread_register_cancel F
-GLIBC_2.12 __pthread_register_cancel_defer F
-GLIBC_2.12 __pthread_rwlock_destroy F
-GLIBC_2.12 __pthread_rwlock_init F
-GLIBC_2.12 __pthread_rwlock_rdlock F
-GLIBC_2.12 __pthread_rwlock_tryrdlock F
-GLIBC_2.12 __pthread_rwlock_trywrlock F
-GLIBC_2.12 __pthread_rwlock_unlock F
-GLIBC_2.12 __pthread_rwlock_wrlock F
-GLIBC_2.12 __pthread_setspecific F
-GLIBC_2.12 __pthread_unregister_cancel F
-GLIBC_2.12 __pthread_unregister_cancel_restore F
-GLIBC_2.12 __pthread_unwind_next F
-GLIBC_2.12 __pwrite64 F
-GLIBC_2.12 __read F
-GLIBC_2.12 __res_state F
-GLIBC_2.12 __send F
-GLIBC_2.12 __sigaction F
-GLIBC_2.12 __vfork F
-GLIBC_2.12 __wait F
-GLIBC_2.12 __write F
-GLIBC_2.12 _pthread_cleanup_pop F
-GLIBC_2.12 _pthread_cleanup_pop_restore F
-GLIBC_2.12 _pthread_cleanup_push F
-GLIBC_2.12 _pthread_cleanup_push_defer F
-GLIBC_2.12 accept F
-GLIBC_2.12 close F
-GLIBC_2.12 connect F
-GLIBC_2.12 fcntl F
-GLIBC_2.12 flockfile F
-GLIBC_2.12 fork F
-GLIBC_2.12 fsync F
-GLIBC_2.12 ftrylockfile F
-GLIBC_2.12 funlockfile F
-GLIBC_2.12 longjmp F
-GLIBC_2.12 lseek F
-GLIBC_2.12 lseek64 F
-GLIBC_2.12 msync F
-GLIBC_2.12 nanosleep F
-GLIBC_2.12 open F
-GLIBC_2.12 open64 F
-GLIBC_2.12 pause F
-GLIBC_2.12 pread F
-GLIBC_2.12 pread64 F
-GLIBC_2.12 pthread_attr_destroy F
-GLIBC_2.12 pthread_attr_getaffinity_np F
-GLIBC_2.12 pthread_attr_getdetachstate F
-GLIBC_2.12 pthread_attr_getguardsize F
-GLIBC_2.12 pthread_attr_getinheritsched F
-GLIBC_2.12 pthread_attr_getschedparam F
-GLIBC_2.12 pthread_attr_getschedpolicy F
-GLIBC_2.12 pthread_attr_getscope F
-GLIBC_2.12 pthread_attr_getstack F
-GLIBC_2.12 pthread_attr_getstackaddr F
-GLIBC_2.12 pthread_attr_getstacksize F
-GLIBC_2.12 pthread_attr_init F
-GLIBC_2.12 pthread_attr_setaffinity_np F
-GLIBC_2.12 pthread_attr_setdetachstate F
-GLIBC_2.12 pthread_attr_setguardsize F
-GLIBC_2.12 pthread_attr_setinheritsched F
-GLIBC_2.12 pthread_attr_setschedparam F
-GLIBC_2.12 pthread_attr_setschedpolicy F
-GLIBC_2.12 pthread_attr_setscope F
-GLIBC_2.12 pthread_attr_setstack F
-GLIBC_2.12 pthread_attr_setstackaddr F
-GLIBC_2.12 pthread_attr_setstacksize F
-GLIBC_2.12 pthread_barrier_destroy F
-GLIBC_2.12 pthread_barrier_init F
-GLIBC_2.12 pthread_barrier_wait F
-GLIBC_2.12 pthread_barrierattr_destroy F
-GLIBC_2.12 pthread_barrierattr_getpshared F
-GLIBC_2.12 pthread_barrierattr_init F
-GLIBC_2.12 pthread_barrierattr_setpshared F
-GLIBC_2.12 pthread_cancel F
-GLIBC_2.12 pthread_cond_broadcast F
-GLIBC_2.12 pthread_cond_destroy F
-GLIBC_2.12 pthread_cond_init F
-GLIBC_2.12 pthread_cond_signal F
-GLIBC_2.12 pthread_cond_timedwait F
-GLIBC_2.12 pthread_cond_wait F
-GLIBC_2.12 pthread_condattr_destroy F
-GLIBC_2.12 pthread_condattr_getclock F
-GLIBC_2.12 pthread_condattr_getpshared F
-GLIBC_2.12 pthread_condattr_init F
-GLIBC_2.12 pthread_condattr_setclock F
-GLIBC_2.12 pthread_condattr_setpshared F
-GLIBC_2.12 pthread_create F
-GLIBC_2.12 pthread_detach F
-GLIBC_2.12 pthread_equal F
-GLIBC_2.12 pthread_exit F
-GLIBC_2.12 pthread_getaffinity_np F
-GLIBC_2.12 pthread_getattr_np F
-GLIBC_2.12 pthread_getconcurrency F
-GLIBC_2.12 pthread_getcpuclockid F
-GLIBC_2.12 pthread_getname_np F
-GLIBC_2.12 pthread_getschedparam F
-GLIBC_2.12 pthread_getspecific F
-GLIBC_2.12 pthread_join F
-GLIBC_2.12 pthread_key_create F
-GLIBC_2.12 pthread_key_delete F
-GLIBC_2.12 pthread_kill F
-GLIBC_2.12 pthread_kill_other_threads_np F
-GLIBC_2.12 pthread_mutex_consistent F
-GLIBC_2.12 pthread_mutex_consistent_np F
-GLIBC_2.12 pthread_mutex_destroy F
-GLIBC_2.12 pthread_mutex_getprioceiling F
-GLIBC_2.12 pthread_mutex_init F
-GLIBC_2.12 pthread_mutex_lock F
-GLIBC_2.12 pthread_mutex_setprioceiling F
-GLIBC_2.12 pthread_mutex_timedlock F
-GLIBC_2.12 pthread_mutex_trylock F
-GLIBC_2.12 pthread_mutex_unlock F
-GLIBC_2.12 pthread_mutexattr_destroy F
-GLIBC_2.12 pthread_mutexattr_getkind_np F
-GLIBC_2.12 pthread_mutexattr_getprioceiling F
-GLIBC_2.12 pthread_mutexattr_getprotocol F
-GLIBC_2.12 pthread_mutexattr_getpshared F
-GLIBC_2.12 pthread_mutexattr_getrobust F
-GLIBC_2.12 pthread_mutexattr_getrobust_np F
-GLIBC_2.12 pthread_mutexattr_gettype F
-GLIBC_2.12 pthread_mutexattr_init F
-GLIBC_2.12 pthread_mutexattr_setkind_np F
-GLIBC_2.12 pthread_mutexattr_setprioceiling F
-GLIBC_2.12 pthread_mutexattr_setprotocol F
-GLIBC_2.12 pthread_mutexattr_setpshared F
-GLIBC_2.12 pthread_mutexattr_setrobust F
-GLIBC_2.12 pthread_mutexattr_setrobust_np F
-GLIBC_2.12 pthread_mutexattr_settype F
-GLIBC_2.12 pthread_once F
-GLIBC_2.12 pthread_rwlock_destroy F
-GLIBC_2.12 pthread_rwlock_init F
-GLIBC_2.12 pthread_rwlock_rdlock F
-GLIBC_2.12 pthread_rwlock_timedrdlock F
-GLIBC_2.12 pthread_rwlock_timedwrlock F
-GLIBC_2.12 pthread_rwlock_tryrdlock F
-GLIBC_2.12 pthread_rwlock_trywrlock F
-GLIBC_2.12 pthread_rwlock_unlock F
-GLIBC_2.12 pthread_rwlock_wrlock F
-GLIBC_2.12 pthread_rwlockattr_destroy F
-GLIBC_2.12 pthread_rwlockattr_getkind_np F
-GLIBC_2.12 pthread_rwlockattr_getpshared F
-GLIBC_2.12 pthread_rwlockattr_init F
-GLIBC_2.12 pthread_rwlockattr_setkind_np F
-GLIBC_2.12 pthread_rwlockattr_setpshared F
-GLIBC_2.12 pthread_self F
-GLIBC_2.12 pthread_setaffinity_np F
-GLIBC_2.12 pthread_setcancelstate F
-GLIBC_2.12 pthread_setcanceltype F
-GLIBC_2.12 pthread_setconcurrency F
-GLIBC_2.12 pthread_setname_np F
-GLIBC_2.12 pthread_setschedparam F
-GLIBC_2.12 pthread_setschedprio F
-GLIBC_2.12 pthread_setspecific F
-GLIBC_2.12 pthread_sigmask F
-GLIBC_2.12 pthread_sigqueue F
-GLIBC_2.12 pthread_spin_destroy F
-GLIBC_2.12 pthread_spin_init F
-GLIBC_2.12 pthread_spin_lock F
-GLIBC_2.12 pthread_spin_trylock F
-GLIBC_2.12 pthread_spin_unlock F
-GLIBC_2.12 pthread_testcancel F
-GLIBC_2.12 pthread_timedjoin_np F
-GLIBC_2.12 pthread_tryjoin_np F
-GLIBC_2.12 pthread_yield F
-GLIBC_2.12 pwrite F
-GLIBC_2.12 pwrite64 F
-GLIBC_2.12 raise F
-GLIBC_2.12 read F
-GLIBC_2.12 recv F
-GLIBC_2.12 recvfrom F
-GLIBC_2.12 recvmsg F
-GLIBC_2.12 sem_close F
-GLIBC_2.12 sem_destroy F
-GLIBC_2.12 sem_getvalue F
-GLIBC_2.12 sem_init F
-GLIBC_2.12 sem_open F
-GLIBC_2.12 sem_post F
-GLIBC_2.12 sem_timedwait F
-GLIBC_2.12 sem_trywait F
-GLIBC_2.12 sem_unlink F
-GLIBC_2.12 sem_wait F
-GLIBC_2.12 send F
-GLIBC_2.12 sendmsg F
-GLIBC_2.12 sendto F
-GLIBC_2.12 sigaction F
-GLIBC_2.12 siglongjmp F
-GLIBC_2.12 sigwait F
-GLIBC_2.12 system F
-GLIBC_2.12 tcdrain F
-GLIBC_2.12 vfork F
-GLIBC_2.12 wait F
-GLIBC_2.12 waitpid F
-GLIBC_2.12 write F
-GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 pthread_getattr_default_np F
-GLIBC_2.18 pthread_setattr_default_np F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libresolv.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libresolv.abilist
deleted file mode 100644
index bd81642e3d..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libresolv.abilist
+++ /dev/null
@@ -1,92 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __b64_ntop F
-GLIBC_2.12 __b64_pton F
-GLIBC_2.12 __dn_comp F
-GLIBC_2.12 __dn_count_labels F
-GLIBC_2.12 __dn_expand F
-GLIBC_2.12 __dn_skipname F
-GLIBC_2.12 __fp_nquery F
-GLIBC_2.12 __fp_query F
-GLIBC_2.12 __fp_resstat F
-GLIBC_2.12 __hostalias F
-GLIBC_2.12 __loc_aton F
-GLIBC_2.12 __loc_ntoa F
-GLIBC_2.12 __p_cdname F
-GLIBC_2.12 __p_cdnname F
-GLIBC_2.12 __p_class F
-GLIBC_2.12 __p_class_syms D 0xa8
-GLIBC_2.12 __p_fqname F
-GLIBC_2.12 __p_fqnname F
-GLIBC_2.12 __p_option F
-GLIBC_2.12 __p_query F
-GLIBC_2.12 __p_rcode F
-GLIBC_2.12 __p_secstodate F
-GLIBC_2.12 __p_time F
-GLIBC_2.12 __p_type F
-GLIBC_2.12 __p_type_syms D 0x450
-GLIBC_2.12 __putlong F
-GLIBC_2.12 __putshort F
-GLIBC_2.12 __res_close F
-GLIBC_2.12 __res_dnok F
-GLIBC_2.12 __res_hnok F
-GLIBC_2.12 __res_hostalias F
-GLIBC_2.12 __res_isourserver F
-GLIBC_2.12 __res_mailok F
-GLIBC_2.12 __res_mkquery F
-GLIBC_2.12 __res_nameinquery F
-GLIBC_2.12 __res_nmkquery F
-GLIBC_2.12 __res_nquery F
-GLIBC_2.12 __res_nquerydomain F
-GLIBC_2.12 __res_nsearch F
-GLIBC_2.12 __res_nsend F
-GLIBC_2.12 __res_ownok F
-GLIBC_2.12 __res_queriesmatch F
-GLIBC_2.12 __res_query F
-GLIBC_2.12 __res_querydomain F
-GLIBC_2.12 __res_search F
-GLIBC_2.12 __res_send F
-GLIBC_2.12 __sym_ntop F
-GLIBC_2.12 __sym_ntos F
-GLIBC_2.12 __sym_ston F
-GLIBC_2.12 _gethtbyaddr F
-GLIBC_2.12 _gethtbyname F
-GLIBC_2.12 _gethtbyname2 F
-GLIBC_2.12 _gethtent F
-GLIBC_2.12 _getlong F
-GLIBC_2.12 _getshort F
-GLIBC_2.12 _res_opcodes D 0x80
-GLIBC_2.12 _sethtent F
-GLIBC_2.12 inet_net_ntop F
-GLIBC_2.12 inet_net_pton F
-GLIBC_2.12 inet_neta F
-GLIBC_2.12 ns_datetosecs F
-GLIBC_2.12 ns_format_ttl F
-GLIBC_2.12 ns_get16 F
-GLIBC_2.12 ns_get32 F
-GLIBC_2.12 ns_initparse F
-GLIBC_2.12 ns_makecanon F
-GLIBC_2.12 ns_msg_getflag F
-GLIBC_2.12 ns_name_compress F
-GLIBC_2.12 ns_name_ntol F
-GLIBC_2.12 ns_name_ntop F
-GLIBC_2.12 ns_name_pack F
-GLIBC_2.12 ns_name_pton F
-GLIBC_2.12 ns_name_rollback F
-GLIBC_2.12 ns_name_skip F
-GLIBC_2.12 ns_name_uncompress F
-GLIBC_2.12 ns_name_unpack F
-GLIBC_2.12 ns_parse_ttl F
-GLIBC_2.12 ns_parserr F
-GLIBC_2.12 ns_put16 F
-GLIBC_2.12 ns_put32 F
-GLIBC_2.12 ns_samedomain F
-GLIBC_2.12 ns_samename F
-GLIBC_2.12 ns_skiprr F
-GLIBC_2.12 ns_sprintrr F
-GLIBC_2.12 ns_sprintrrf F
-GLIBC_2.12 ns_subdomain F
-GLIBC_2.12 res_gethostbyaddr F
-GLIBC_2.12 res_gethostbyname F
-GLIBC_2.12 res_gethostbyname2 F
-GLIBC_2.12 res_send_setqhook F
-GLIBC_2.12 res_send_setrhook F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/librt.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/librt.abilist
deleted file mode 100644
index 14f5c8245d..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/librt.abilist
+++ /dev/null
@@ -1,41 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __mq_open_2 F
-GLIBC_2.12 aio_cancel F
-GLIBC_2.12 aio_cancel64 F
-GLIBC_2.12 aio_error F
-GLIBC_2.12 aio_error64 F
-GLIBC_2.12 aio_fsync F
-GLIBC_2.12 aio_fsync64 F
-GLIBC_2.12 aio_init F
-GLIBC_2.12 aio_read F
-GLIBC_2.12 aio_read64 F
-GLIBC_2.12 aio_return F
-GLIBC_2.12 aio_return64 F
-GLIBC_2.12 aio_suspend F
-GLIBC_2.12 aio_suspend64 F
-GLIBC_2.12 aio_write F
-GLIBC_2.12 aio_write64 F
-GLIBC_2.12 clock_getcpuclockid F
-GLIBC_2.12 clock_getres F
-GLIBC_2.12 clock_gettime F
-GLIBC_2.12 clock_nanosleep F
-GLIBC_2.12 clock_settime F
-GLIBC_2.12 lio_listio F
-GLIBC_2.12 lio_listio64 F
-GLIBC_2.12 mq_close F
-GLIBC_2.12 mq_getattr F
-GLIBC_2.12 mq_notify F
-GLIBC_2.12 mq_open F
-GLIBC_2.12 mq_receive F
-GLIBC_2.12 mq_send F
-GLIBC_2.12 mq_setattr F
-GLIBC_2.12 mq_timedreceive F
-GLIBC_2.12 mq_timedsend F
-GLIBC_2.12 mq_unlink F
-GLIBC_2.12 shm_open F
-GLIBC_2.12 shm_unlink F
-GLIBC_2.12 timer_create F
-GLIBC_2.12 timer_delete F
-GLIBC_2.12 timer_getoverrun F
-GLIBC_2.12 timer_gettime F
-GLIBC_2.12 timer_settime F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libthread_db.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libthread_db.abilist
deleted file mode 100644
index 4aade0b7e0..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libthread_db.abilist
+++ /dev/null
@@ -1,41 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 td_init F
-GLIBC_2.12 td_log F
-GLIBC_2.12 td_symbol_list F
-GLIBC_2.12 td_ta_clear_event F
-GLIBC_2.12 td_ta_delete F
-GLIBC_2.12 td_ta_enable_stats F
-GLIBC_2.12 td_ta_event_addr F
-GLIBC_2.12 td_ta_event_getmsg F
-GLIBC_2.12 td_ta_get_nthreads F
-GLIBC_2.12 td_ta_get_ph F
-GLIBC_2.12 td_ta_get_stats F
-GLIBC_2.12 td_ta_map_id2thr F
-GLIBC_2.12 td_ta_map_lwp2thr F
-GLIBC_2.12 td_ta_new F
-GLIBC_2.12 td_ta_reset_stats F
-GLIBC_2.12 td_ta_set_event F
-GLIBC_2.12 td_ta_setconcurrency F
-GLIBC_2.12 td_ta_thr_iter F
-GLIBC_2.12 td_ta_tsd_iter F
-GLIBC_2.12 td_thr_clear_event F
-GLIBC_2.12 td_thr_dbresume F
-GLIBC_2.12 td_thr_dbsuspend F
-GLIBC_2.12 td_thr_event_enable F
-GLIBC_2.12 td_thr_event_getmsg F
-GLIBC_2.12 td_thr_get_info F
-GLIBC_2.12 td_thr_getfpregs F
-GLIBC_2.12 td_thr_getgregs F
-GLIBC_2.12 td_thr_getxregs F
-GLIBC_2.12 td_thr_getxregsize F
-GLIBC_2.12 td_thr_set_event F
-GLIBC_2.12 td_thr_setfpregs F
-GLIBC_2.12 td_thr_setgregs F
-GLIBC_2.12 td_thr_setprio F
-GLIBC_2.12 td_thr_setsigpending F
-GLIBC_2.12 td_thr_setxregs F
-GLIBC_2.12 td_thr_sigsetmask F
-GLIBC_2.12 td_thr_tls_get_addr F
-GLIBC_2.12 td_thr_tlsbase F
-GLIBC_2.12 td_thr_tsd F
-GLIBC_2.12 td_thr_validate F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libutil.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libutil.abilist
deleted file mode 100644
index e4d432643c..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libutil.abilist
+++ /dev/null
@@ -1,7 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 forkpty F
-GLIBC_2.12 login F
-GLIBC_2.12 login_tty F
-GLIBC_2.12 logout F
-GLIBC_2.12 logwtmp F
-GLIBC_2.12 openpty F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/Implies b/sysdeps/unix/sysv/linux/tile/tilepro/Implies
deleted file mode 100644
index 0023bb77aa..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/Implies
+++ /dev/null
@@ -1,3 +0,0 @@
-unix/sysv/linux/tile
-unix/sysv/linux/generic/wordsize-32
-unix/sysv/linux/generic
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/c++-types.data b/sysdeps/unix/sysv/linux/tile/tilepro/c++-types.data
deleted file mode 100644
index 303f4570c8..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/c++-types.data
+++ /dev/null
@@ -1,67 +0,0 @@
-blkcnt64_t:x
-blkcnt_t:l
-blksize_t:i
-caddr_t:Pc
-clockid_t:i
-clock_t:l
-daddr_t:i
-dev_t:y
-fd_mask:l
-fsblkcnt64_t:y
-fsblkcnt_t:m
-fsfilcnt64_t:y
-fsfilcnt_t:m
-fsid_t:8__fsid_t
-gid_t:j
-id_t:j
-ino64_t:y
-ino_t:m
-int16_t:s
-int32_t:i
-int64_t:x
-int8_t:a
-intptr_t:i
-key_t:i
-loff_t:x
-mode_t:j
-nlink_t:j
-off64_t:x
-off_t:l
-pid_t:i
-pthread_attr_t:14pthread_attr_t
-pthread_barrier_t:17pthread_barrier_t
-pthread_barrierattr_t:21pthread_barrierattr_t
-pthread_cond_t:14pthread_cond_t
-pthread_condattr_t:18pthread_condattr_t
-pthread_key_t:j
-pthread_mutex_t:15pthread_mutex_t
-pthread_mutexattr_t:19pthread_mutexattr_t
-pthread_once_t:i
-pthread_rwlock_t:16pthread_rwlock_t
-pthread_rwlockattr_t:20pthread_rwlockattr_t
-pthread_spinlock_t:i
-pthread_t:m
-quad_t:x
-register_t:i
-rlim64_t:y
-rlim_t:m
-sigset_t:10__sigset_t
-size_t:j
-socklen_t:j
-ssize_t:i
-suseconds_t:l
-time_t:l
-u_char:h
-uid_t:j
-uint:j
-u_int:j
-u_int16_t:t
-u_int32_t:j
-u_int64_t:y
-u_int8_t:h
-ulong:m
-u_long:m
-u_quad_t:y
-useconds_t:j
-ushort:t
-u_short:t
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/ld.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/ld.abilist
deleted file mode 100644
index 3ab170cc91..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/ld.abilist
+++ /dev/null
@@ -1,10 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __libc_memalign F
-GLIBC_2.12 __libc_stack_end D 0x4
-GLIBC_2.12 __tls_get_addr F
-GLIBC_2.12 _dl_mcount F
-GLIBC_2.12 _r_debug D 0x14
-GLIBC_2.12 calloc F
-GLIBC_2.12 free F
-GLIBC_2.12 malloc F
-GLIBC_2.12 realloc F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/ldconfig.h b/sysdeps/unix/sysv/linux/tile/tilepro/ldconfig.h
deleted file mode 100644
index 2bfc451d85..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/ldconfig.h
+++ /dev/null
@@ -1,25 +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 <sysdeps/generic/ldconfig.h>
-
-#define SYSDEP_KNOWN_INTERPRETER_NAMES \
- { "/lib/ld.so.1", FLAG_ELF_LIBC6 },
-#define SYSDEP_KNOWN_LIBRARY_NAMES \
- { "libc.so.6", FLAG_ELF_LIBC6 }, \
- { "libm.so.6", FLAG_ELF_LIBC6 },
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libBrokenLocale.abilist
deleted file mode 100644
index 0d64827515..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libBrokenLocale.abilist
+++ /dev/null
@@ -1,2 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libanl.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libanl.abilist
deleted file mode 100644
index a3b1cc08bf..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libanl.abilist
+++ /dev/null
@@ -1,5 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 gai_cancel F
-GLIBC_2.12 gai_error F
-GLIBC_2.12 gai_suspend F
-GLIBC_2.12 getaddrinfo_a F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist
deleted file mode 100644
index ffcc4a0a2b..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist
+++ /dev/null
@@ -1,2096 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 _Exit F
-GLIBC_2.12 _IO_2_1_stderr_ D 0xa0
-GLIBC_2.12 _IO_2_1_stdin_ D 0xa0
-GLIBC_2.12 _IO_2_1_stdout_ D 0xa0
-GLIBC_2.12 _IO_adjust_column F
-GLIBC_2.12 _IO_adjust_wcolumn F
-GLIBC_2.12 _IO_default_doallocate F
-GLIBC_2.12 _IO_default_finish F
-GLIBC_2.12 _IO_default_pbackfail F
-GLIBC_2.12 _IO_default_uflow F
-GLIBC_2.12 _IO_default_xsgetn F
-GLIBC_2.12 _IO_default_xsputn F
-GLIBC_2.12 _IO_do_write F
-GLIBC_2.12 _IO_doallocbuf F
-GLIBC_2.12 _IO_fclose F
-GLIBC_2.12 _IO_fdopen F
-GLIBC_2.12 _IO_feof F
-GLIBC_2.12 _IO_ferror F
-GLIBC_2.12 _IO_fflush F
-GLIBC_2.12 _IO_fgetpos F
-GLIBC_2.12 _IO_fgetpos64 F
-GLIBC_2.12 _IO_fgets F
-GLIBC_2.12 _IO_file_attach F
-GLIBC_2.12 _IO_file_close F
-GLIBC_2.12 _IO_file_close_it F
-GLIBC_2.12 _IO_file_doallocate F
-GLIBC_2.12 _IO_file_finish F
-GLIBC_2.12 _IO_file_fopen F
-GLIBC_2.12 _IO_file_init F
-GLIBC_2.12 _IO_file_jumps D 0x54
-GLIBC_2.12 _IO_file_open F
-GLIBC_2.12 _IO_file_overflow F
-GLIBC_2.12 _IO_file_read F
-GLIBC_2.12 _IO_file_seek F
-GLIBC_2.12 _IO_file_seekoff F
-GLIBC_2.12 _IO_file_setbuf F
-GLIBC_2.12 _IO_file_stat F
-GLIBC_2.12 _IO_file_sync F
-GLIBC_2.12 _IO_file_underflow F
-GLIBC_2.12 _IO_file_write F
-GLIBC_2.12 _IO_file_xsputn F
-GLIBC_2.12 _IO_flockfile F
-GLIBC_2.12 _IO_flush_all F
-GLIBC_2.12 _IO_flush_all_linebuffered F
-GLIBC_2.12 _IO_fopen F
-GLIBC_2.12 _IO_fprintf F
-GLIBC_2.12 _IO_fputs F
-GLIBC_2.12 _IO_fread F
-GLIBC_2.12 _IO_free_backup_area F
-GLIBC_2.12 _IO_free_wbackup_area F
-GLIBC_2.12 _IO_fsetpos F
-GLIBC_2.12 _IO_fsetpos64 F
-GLIBC_2.12 _IO_ftell F
-GLIBC_2.12 _IO_ftrylockfile F
-GLIBC_2.12 _IO_funlockfile F
-GLIBC_2.12 _IO_fwrite F
-GLIBC_2.12 _IO_getc F
-GLIBC_2.12 _IO_getline F
-GLIBC_2.12 _IO_getline_info F
-GLIBC_2.12 _IO_gets F
-GLIBC_2.12 _IO_init F
-GLIBC_2.12 _IO_init_marker F
-GLIBC_2.12 _IO_init_wmarker F
-GLIBC_2.12 _IO_iter_begin F
-GLIBC_2.12 _IO_iter_end F
-GLIBC_2.12 _IO_iter_file F
-GLIBC_2.12 _IO_iter_next F
-GLIBC_2.12 _IO_least_wmarker F
-GLIBC_2.12 _IO_link_in F
-GLIBC_2.12 _IO_list_all D 0x4
-GLIBC_2.12 _IO_list_lock F
-GLIBC_2.12 _IO_list_resetlock F
-GLIBC_2.12 _IO_list_unlock F
-GLIBC_2.12 _IO_marker_delta F
-GLIBC_2.12 _IO_marker_difference F
-GLIBC_2.12 _IO_padn F
-GLIBC_2.12 _IO_peekc_locked F
-GLIBC_2.12 _IO_popen F
-GLIBC_2.12 _IO_printf F
-GLIBC_2.12 _IO_proc_close F
-GLIBC_2.12 _IO_proc_open F
-GLIBC_2.12 _IO_putc F
-GLIBC_2.12 _IO_puts F
-GLIBC_2.12 _IO_remove_marker F
-GLIBC_2.12 _IO_seekmark F
-GLIBC_2.12 _IO_seekoff F
-GLIBC_2.12 _IO_seekpos F
-GLIBC_2.12 _IO_seekwmark F
-GLIBC_2.12 _IO_setb F
-GLIBC_2.12 _IO_setbuffer F
-GLIBC_2.12 _IO_setvbuf F
-GLIBC_2.12 _IO_sgetn F
-GLIBC_2.12 _IO_sprintf F
-GLIBC_2.12 _IO_sputbackc F
-GLIBC_2.12 _IO_sputbackwc F
-GLIBC_2.12 _IO_sscanf F
-GLIBC_2.12 _IO_str_init_readonly F
-GLIBC_2.12 _IO_str_init_static F
-GLIBC_2.12 _IO_str_overflow F
-GLIBC_2.12 _IO_str_pbackfail F
-GLIBC_2.12 _IO_str_seekoff F
-GLIBC_2.12 _IO_str_underflow F
-GLIBC_2.12 _IO_sungetc F
-GLIBC_2.12 _IO_sungetwc F
-GLIBC_2.12 _IO_switch_to_get_mode F
-GLIBC_2.12 _IO_switch_to_main_wget_area F
-GLIBC_2.12 _IO_switch_to_wbackup_area F
-GLIBC_2.12 _IO_switch_to_wget_mode F
-GLIBC_2.12 _IO_un_link F
-GLIBC_2.12 _IO_ungetc F
-GLIBC_2.12 _IO_unsave_markers F
-GLIBC_2.12 _IO_unsave_wmarkers F
-GLIBC_2.12 _IO_vfprintf F
-GLIBC_2.12 _IO_vfscanf F
-GLIBC_2.12 _IO_vsprintf F
-GLIBC_2.12 _IO_wdefault_doallocate F
-GLIBC_2.12 _IO_wdefault_finish F
-GLIBC_2.12 _IO_wdefault_pbackfail F
-GLIBC_2.12 _IO_wdefault_uflow F
-GLIBC_2.12 _IO_wdefault_xsgetn F
-GLIBC_2.12 _IO_wdefault_xsputn F
-GLIBC_2.12 _IO_wdo_write F
-GLIBC_2.12 _IO_wdoallocbuf F
-GLIBC_2.12 _IO_wfile_jumps D 0x54
-GLIBC_2.12 _IO_wfile_overflow F
-GLIBC_2.12 _IO_wfile_seekoff F
-GLIBC_2.12 _IO_wfile_sync F
-GLIBC_2.12 _IO_wfile_underflow F
-GLIBC_2.12 _IO_wfile_xsputn F
-GLIBC_2.12 _IO_wmarker_delta F
-GLIBC_2.12 _IO_wsetb F
-GLIBC_2.12 ___brk_addr D 0x4
-GLIBC_2.12 __adjtimex F
-GLIBC_2.12 __after_morecore_hook D 0x4
-GLIBC_2.12 __argz_count F
-GLIBC_2.12 __argz_next F
-GLIBC_2.12 __argz_stringify F
-GLIBC_2.12 __asprintf F
-GLIBC_2.12 __asprintf_chk F
-GLIBC_2.12 __assert F
-GLIBC_2.12 __assert_fail F
-GLIBC_2.12 __assert_perror_fail F
-GLIBC_2.12 __backtrace F
-GLIBC_2.12 __backtrace_symbols F
-GLIBC_2.12 __backtrace_symbols_fd F
-GLIBC_2.12 __bsd_getpgrp F
-GLIBC_2.12 __bzero F
-GLIBC_2.12 __check_rhosts_file D 0x4
-GLIBC_2.12 __chk_fail F
-GLIBC_2.12 __clone F
-GLIBC_2.12 __close F
-GLIBC_2.12 __cmsg_nxthdr F
-GLIBC_2.12 __confstr_chk F
-GLIBC_2.12 __connect F
-GLIBC_2.12 __ctype_b_loc F
-GLIBC_2.12 __ctype_get_mb_cur_max F
-GLIBC_2.12 __ctype_tolower_loc F
-GLIBC_2.12 __ctype_toupper_loc F
-GLIBC_2.12 __curbrk D 0x4
-GLIBC_2.12 __cxa_at_quick_exit F
-GLIBC_2.12 __cxa_atexit F
-GLIBC_2.12 __cxa_finalize F
-GLIBC_2.12 __cyg_profile_func_enter F
-GLIBC_2.12 __cyg_profile_func_exit F
-GLIBC_2.12 __daylight D 0x4
-GLIBC_2.12 __dcgettext F
-GLIBC_2.12 __default_morecore F
-GLIBC_2.12 __dgettext F
-GLIBC_2.12 __dprintf_chk F
-GLIBC_2.12 __dup2 F
-GLIBC_2.12 __duplocale F
-GLIBC_2.12 __endmntent F
-GLIBC_2.12 __environ D 0x4
-GLIBC_2.12 __errno_location F
-GLIBC_2.12 __fbufsize F
-GLIBC_2.12 __fcntl F
-GLIBC_2.12 __ffs F
-GLIBC_2.12 __fgets_chk F
-GLIBC_2.12 __fgets_unlocked_chk F
-GLIBC_2.12 __fgetws_chk F
-GLIBC_2.12 __fgetws_unlocked_chk F
-GLIBC_2.12 __finite F
-GLIBC_2.12 __finitef F
-GLIBC_2.12 __flbf F
-GLIBC_2.12 __fork F
-GLIBC_2.12 __fpending F
-GLIBC_2.12 __fprintf_chk F
-GLIBC_2.12 __fpu_control D 0x4
-GLIBC_2.12 __fpurge F
-GLIBC_2.12 __fread_chk F
-GLIBC_2.12 __fread_unlocked_chk F
-GLIBC_2.12 __freadable F
-GLIBC_2.12 __freading F
-GLIBC_2.12 __free_hook D 0x4
-GLIBC_2.12 __freelocale F
-GLIBC_2.12 __fsetlocking F
-GLIBC_2.12 __fwprintf_chk F
-GLIBC_2.12 __fwritable F
-GLIBC_2.12 __fwriting F
-GLIBC_2.12 __fxstat F
-GLIBC_2.12 __fxstat64 F
-GLIBC_2.12 __fxstatat F
-GLIBC_2.12 __fxstatat64 F
-GLIBC_2.12 __getcwd_chk F
-GLIBC_2.12 __getdelim F
-GLIBC_2.12 __getdomainname_chk F
-GLIBC_2.12 __getgroups_chk F
-GLIBC_2.12 __gethostname_chk F
-GLIBC_2.12 __getlogin_r_chk F
-GLIBC_2.12 __getmntent_r F
-GLIBC_2.12 __getpagesize F
-GLIBC_2.12 __getpgid F
-GLIBC_2.12 __getpid F
-GLIBC_2.12 __gets_chk F
-GLIBC_2.12 __gettimeofday F
-GLIBC_2.12 __getwd_chk F
-GLIBC_2.12 __gmtime_r F
-GLIBC_2.12 __h_errno_location F
-GLIBC_2.12 __isalnum_l F
-GLIBC_2.12 __isalpha_l F
-GLIBC_2.12 __isascii_l F
-GLIBC_2.12 __isblank_l F
-GLIBC_2.12 __iscntrl_l F
-GLIBC_2.12 __isctype F
-GLIBC_2.12 __isdigit_l F
-GLIBC_2.12 __isgraph_l F
-GLIBC_2.12 __isinf F
-GLIBC_2.12 __isinff F
-GLIBC_2.12 __islower_l F
-GLIBC_2.12 __isnan F
-GLIBC_2.12 __isnanf F
-GLIBC_2.12 __isoc99_fscanf F
-GLIBC_2.12 __isoc99_fwscanf F
-GLIBC_2.12 __isoc99_scanf F
-GLIBC_2.12 __isoc99_sscanf F
-GLIBC_2.12 __isoc99_swscanf F
-GLIBC_2.12 __isoc99_vfscanf F
-GLIBC_2.12 __isoc99_vfwscanf F
-GLIBC_2.12 __isoc99_vscanf F
-GLIBC_2.12 __isoc99_vsscanf F
-GLIBC_2.12 __isoc99_vswscanf F
-GLIBC_2.12 __isoc99_vwscanf F
-GLIBC_2.12 __isoc99_wscanf F
-GLIBC_2.12 __isprint_l F
-GLIBC_2.12 __ispunct_l F
-GLIBC_2.12 __isspace_l F
-GLIBC_2.12 __isupper_l F
-GLIBC_2.12 __iswalnum_l F
-GLIBC_2.12 __iswalpha_l F
-GLIBC_2.12 __iswblank_l F
-GLIBC_2.12 __iswcntrl_l F
-GLIBC_2.12 __iswctype F
-GLIBC_2.12 __iswctype_l F
-GLIBC_2.12 __iswdigit_l F
-GLIBC_2.12 __iswgraph_l F
-GLIBC_2.12 __iswlower_l F
-GLIBC_2.12 __iswprint_l F
-GLIBC_2.12 __iswpunct_l F
-GLIBC_2.12 __iswspace_l F
-GLIBC_2.12 __iswupper_l F
-GLIBC_2.12 __iswxdigit_l F
-GLIBC_2.12 __isxdigit_l F
-GLIBC_2.12 __ivaliduser F
-GLIBC_2.12 __key_decryptsession_pk_LOCAL D 0x4
-GLIBC_2.12 __key_encryptsession_pk_LOCAL D 0x4
-GLIBC_2.12 __key_gendes_LOCAL D 0x4
-GLIBC_2.12 __libc_allocate_rtsig F
-GLIBC_2.12 __libc_calloc F
-GLIBC_2.12 __libc_current_sigrtmax F
-GLIBC_2.12 __libc_current_sigrtmin F
-GLIBC_2.12 __libc_free F
-GLIBC_2.12 __libc_freeres F
-GLIBC_2.12 __libc_init_first F
-GLIBC_2.12 __libc_mallinfo F
-GLIBC_2.12 __libc_malloc F
-GLIBC_2.12 __libc_mallopt F
-GLIBC_2.12 __libc_memalign F
-GLIBC_2.12 __libc_pvalloc F
-GLIBC_2.12 __libc_realloc F
-GLIBC_2.12 __libc_sa_len F
-GLIBC_2.12 __libc_start_main F
-GLIBC_2.12 __libc_valloc F
-GLIBC_2.12 __longjmp_chk F
-GLIBC_2.12 __lseek F
-GLIBC_2.12 __lxstat F
-GLIBC_2.12 __lxstat64 F
-GLIBC_2.12 __malloc_hook D 0x4
-GLIBC_2.12 __malloc_initialize_hook D 0x4
-GLIBC_2.12 __mbrlen F
-GLIBC_2.12 __mbrtowc F
-GLIBC_2.12 __mbsnrtowcs_chk F
-GLIBC_2.12 __mbsrtowcs_chk F
-GLIBC_2.12 __mbstowcs_chk F
-GLIBC_2.12 __mcount F
-GLIBC_2.12 __memalign_hook D 0x4
-GLIBC_2.12 __memcpy_chk F
-GLIBC_2.12 __memmove_chk F
-GLIBC_2.12 __mempcpy F
-GLIBC_2.12 __mempcpy_chk F
-GLIBC_2.12 __mempcpy_small F
-GLIBC_2.12 __memset_chk F
-GLIBC_2.12 __monstartup F
-GLIBC_2.12 __morecore D 0x4
-GLIBC_2.12 __nanosleep F
-GLIBC_2.12 __newlocale F
-GLIBC_2.12 __nl_langinfo_l F
-GLIBC_2.12 __nss_configure_lookup F
-GLIBC_2.12 __nss_database_lookup F
-GLIBC_2.12 __nss_group_lookup F
-GLIBC_2.12 __nss_hostname_digits_dots F
-GLIBC_2.12 __nss_hosts_lookup F
-GLIBC_2.12 __nss_next F
-GLIBC_2.12 __nss_passwd_lookup F
-GLIBC_2.12 __obstack_printf_chk F
-GLIBC_2.12 __obstack_vprintf_chk F
-GLIBC_2.12 __open F
-GLIBC_2.12 __open64 F
-GLIBC_2.12 __open64_2 F
-GLIBC_2.12 __open_2 F
-GLIBC_2.12 __openat64_2 F
-GLIBC_2.12 __openat_2 F
-GLIBC_2.12 __overflow F
-GLIBC_2.12 __pipe F
-GLIBC_2.12 __poll F
-GLIBC_2.12 __posix_getopt F
-GLIBC_2.12 __pread64 F
-GLIBC_2.12 __pread64_chk F
-GLIBC_2.12 __pread_chk F
-GLIBC_2.12 __printf_chk F
-GLIBC_2.12 __printf_fp F
-GLIBC_2.12 __profile_frequency F
-GLIBC_2.12 __progname D 0x4
-GLIBC_2.12 __progname_full D 0x4
-GLIBC_2.12 __ptsname_r_chk F
-GLIBC_2.12 __pwrite64 F
-GLIBC_2.12 __rawmemchr F
-GLIBC_2.12 __rcmd_errstr D 0x4
-GLIBC_2.12 __read F
-GLIBC_2.12 __read_chk F
-GLIBC_2.12 __readlink_chk F
-GLIBC_2.12 __readlinkat_chk F
-GLIBC_2.12 __realloc_hook D 0x4
-GLIBC_2.12 __realpath_chk F
-GLIBC_2.12 __recv_chk F
-GLIBC_2.12 __recvfrom_chk F
-GLIBC_2.12 __register_atfork F
-GLIBC_2.12 __res_init F
-GLIBC_2.12 __res_nclose F
-GLIBC_2.12 __res_ninit F
-GLIBC_2.12 __res_randomid F
-GLIBC_2.12 __res_state F
-GLIBC_2.12 __rpc_thread_createerr F
-GLIBC_2.12 __rpc_thread_svc_fdset F
-GLIBC_2.12 __rpc_thread_svc_max_pollfd F
-GLIBC_2.12 __rpc_thread_svc_pollfd F
-GLIBC_2.12 __sbrk F
-GLIBC_2.12 __sched_cpualloc F
-GLIBC_2.12 __sched_cpucount F
-GLIBC_2.12 __sched_cpufree F
-GLIBC_2.12 __sched_get_priority_max F
-GLIBC_2.12 __sched_get_priority_min F
-GLIBC_2.12 __sched_getparam F
-GLIBC_2.12 __sched_getscheduler F
-GLIBC_2.12 __sched_setscheduler F
-GLIBC_2.12 __sched_yield F
-GLIBC_2.12 __secure_getenv F
-GLIBC_2.12 __select F
-GLIBC_2.12 __setmntent F
-GLIBC_2.12 __setpgid F
-GLIBC_2.12 __sigaction F
-GLIBC_2.12 __sigaddset F
-GLIBC_2.12 __sigdelset F
-GLIBC_2.12 __sigismember F
-GLIBC_2.12 __signbit F
-GLIBC_2.12 __signbitf F
-GLIBC_2.12 __sigpause F
-GLIBC_2.12 __sigsetjmp F
-GLIBC_2.12 __sigsuspend F
-GLIBC_2.12 __snprintf_chk F
-GLIBC_2.12 __sprintf_chk F
-GLIBC_2.12 __stack_chk_fail F
-GLIBC_2.12 __statfs F
-GLIBC_2.12 __stpcpy F
-GLIBC_2.12 __stpcpy_chk F
-GLIBC_2.12 __stpcpy_small F
-GLIBC_2.12 __stpncpy F
-GLIBC_2.12 __stpncpy_chk F
-GLIBC_2.12 __strcasecmp F
-GLIBC_2.12 __strcasecmp_l F
-GLIBC_2.12 __strcasestr F
-GLIBC_2.12 __strcat_chk F
-GLIBC_2.12 __strcoll_l F
-GLIBC_2.12 __strcpy_chk F
-GLIBC_2.12 __strcpy_small F
-GLIBC_2.12 __strcspn_c1 F
-GLIBC_2.12 __strcspn_c2 F
-GLIBC_2.12 __strcspn_c3 F
-GLIBC_2.12 __strdup F
-GLIBC_2.12 __strerror_r F
-GLIBC_2.12 __strfmon_l F
-GLIBC_2.12 __strftime_l F
-GLIBC_2.12 __strncasecmp_l F
-GLIBC_2.12 __strncat_chk F
-GLIBC_2.12 __strncpy_chk F
-GLIBC_2.12 __strndup F
-GLIBC_2.12 __strpbrk_c2 F
-GLIBC_2.12 __strpbrk_c3 F
-GLIBC_2.12 __strsep_1c F
-GLIBC_2.12 __strsep_2c F
-GLIBC_2.12 __strsep_3c F
-GLIBC_2.12 __strsep_g F
-GLIBC_2.12 __strspn_c1 F
-GLIBC_2.12 __strspn_c2 F
-GLIBC_2.12 __strspn_c3 F
-GLIBC_2.12 __strtod_internal F
-GLIBC_2.12 __strtod_l F
-GLIBC_2.12 __strtof_internal F
-GLIBC_2.12 __strtof_l F
-GLIBC_2.12 __strtok_r F
-GLIBC_2.12 __strtok_r_1c F
-GLIBC_2.12 __strtol_internal F
-GLIBC_2.12 __strtol_l F
-GLIBC_2.12 __strtold_internal F
-GLIBC_2.12 __strtold_l F
-GLIBC_2.12 __strtoll_internal F
-GLIBC_2.12 __strtoll_l F
-GLIBC_2.12 __strtoul_internal F
-GLIBC_2.12 __strtoul_l F
-GLIBC_2.12 __strtoull_internal F
-GLIBC_2.12 __strtoull_l F
-GLIBC_2.12 __strverscmp F
-GLIBC_2.12 __strxfrm_l F
-GLIBC_2.12 __swprintf_chk F
-GLIBC_2.12 __sysconf F
-GLIBC_2.12 __syslog_chk F
-GLIBC_2.12 __sysv_signal F
-GLIBC_2.12 __timezone D 0x4
-GLIBC_2.12 __toascii_l F
-GLIBC_2.12 __tolower_l F
-GLIBC_2.12 __toupper_l F
-GLIBC_2.12 __towctrans F
-GLIBC_2.12 __towctrans_l F
-GLIBC_2.12 __towlower_l F
-GLIBC_2.12 __towupper_l F
-GLIBC_2.12 __ttyname_r_chk F
-GLIBC_2.12 __tzname D 0x8
-GLIBC_2.12 __uflow F
-GLIBC_2.12 __underflow F
-GLIBC_2.12 __uselocale F
-GLIBC_2.12 __vasprintf_chk F
-GLIBC_2.12 __vdprintf_chk F
-GLIBC_2.12 __vfork F
-GLIBC_2.12 __vfprintf_chk F
-GLIBC_2.12 __vfscanf F
-GLIBC_2.12 __vfwprintf_chk F
-GLIBC_2.12 __vprintf_chk F
-GLIBC_2.12 __vsnprintf F
-GLIBC_2.12 __vsnprintf_chk F
-GLIBC_2.12 __vsprintf_chk F
-GLIBC_2.12 __vsscanf F
-GLIBC_2.12 __vswprintf_chk F
-GLIBC_2.12 __vsyslog_chk F
-GLIBC_2.12 __vwprintf_chk F
-GLIBC_2.12 __wait F
-GLIBC_2.12 __waitpid F
-GLIBC_2.12 __wcpcpy_chk F
-GLIBC_2.12 __wcpncpy_chk F
-GLIBC_2.12 __wcrtomb_chk F
-GLIBC_2.12 __wcscasecmp_l F
-GLIBC_2.12 __wcscat_chk F
-GLIBC_2.12 __wcscoll_l F
-GLIBC_2.12 __wcscpy_chk F
-GLIBC_2.12 __wcsftime_l F
-GLIBC_2.12 __wcsncasecmp_l F
-GLIBC_2.12 __wcsncat_chk F
-GLIBC_2.12 __wcsncpy_chk F
-GLIBC_2.12 __wcsnrtombs_chk F
-GLIBC_2.12 __wcsrtombs_chk F
-GLIBC_2.12 __wcstod_internal F
-GLIBC_2.12 __wcstod_l F
-GLIBC_2.12 __wcstof_internal F
-GLIBC_2.12 __wcstof_l F
-GLIBC_2.12 __wcstol_internal F
-GLIBC_2.12 __wcstol_l F
-GLIBC_2.12 __wcstold_internal F
-GLIBC_2.12 __wcstold_l F
-GLIBC_2.12 __wcstoll_internal F
-GLIBC_2.12 __wcstoll_l F
-GLIBC_2.12 __wcstombs_chk F
-GLIBC_2.12 __wcstoul_internal F
-GLIBC_2.12 __wcstoul_l F
-GLIBC_2.12 __wcstoull_internal F
-GLIBC_2.12 __wcstoull_l F
-GLIBC_2.12 __wcsxfrm_l F
-GLIBC_2.12 __wctomb_chk F
-GLIBC_2.12 __wctrans_l F
-GLIBC_2.12 __wctype_l F
-GLIBC_2.12 __wmemcpy_chk F
-GLIBC_2.12 __wmemmove_chk F
-GLIBC_2.12 __wmempcpy_chk F
-GLIBC_2.12 __wmemset_chk F
-GLIBC_2.12 __woverflow F
-GLIBC_2.12 __wprintf_chk F
-GLIBC_2.12 __write F
-GLIBC_2.12 __wuflow F
-GLIBC_2.12 __wunderflow F
-GLIBC_2.12 __xmknod F
-GLIBC_2.12 __xmknodat F
-GLIBC_2.12 __xpg_basename F
-GLIBC_2.12 __xpg_sigpause F
-GLIBC_2.12 __xpg_strerror_r F
-GLIBC_2.12 __xstat F
-GLIBC_2.12 __xstat64 F
-GLIBC_2.12 _authenticate F
-GLIBC_2.12 _dl_mcount_wrapper F
-GLIBC_2.12 _dl_mcount_wrapper_check F
-GLIBC_2.12 _environ D 0x4
-GLIBC_2.12 _exit F
-GLIBC_2.12 _flush_cache F
-GLIBC_2.12 _flushlbf F
-GLIBC_2.12 _libc_intl_domainname D 0x5
-GLIBC_2.12 _longjmp F
-GLIBC_2.12 _mcleanup F
-GLIBC_2.12 _mcount F
-GLIBC_2.12 _nl_default_dirname D 0x12
-GLIBC_2.12 _nl_domain_bindings D 0x4
-GLIBC_2.12 _nl_msg_cat_cntr D 0x4
-GLIBC_2.12 _null_auth D 0xc
-GLIBC_2.12 _obstack_allocated_p F
-GLIBC_2.12 _obstack_begin F
-GLIBC_2.12 _obstack_begin_1 F
-GLIBC_2.12 _obstack_free F
-GLIBC_2.12 _obstack_memory_used F
-GLIBC_2.12 _obstack_newchunk F
-GLIBC_2.12 _res D 0x200
-GLIBC_2.12 _res_hconf D 0x30
-GLIBC_2.12 _rpc_dtablesize F
-GLIBC_2.12 _seterr_reply F
-GLIBC_2.12 _setjmp F
-GLIBC_2.12 _sys_errlist D 0x21c
-GLIBC_2.12 _sys_nerr D 0x4
-GLIBC_2.12 _sys_siglist D 0x104
-GLIBC_2.12 _tolower F
-GLIBC_2.12 _toupper F
-GLIBC_2.12 a64l F
-GLIBC_2.12 abort F
-GLIBC_2.12 abs F
-GLIBC_2.12 accept F
-GLIBC_2.12 accept4 F
-GLIBC_2.12 access F
-GLIBC_2.12 acct F
-GLIBC_2.12 addmntent F
-GLIBC_2.12 addseverity F
-GLIBC_2.12 adjtime F
-GLIBC_2.12 adjtimex F
-GLIBC_2.12 advance F
-GLIBC_2.12 alarm F
-GLIBC_2.12 alphasort F
-GLIBC_2.12 alphasort64 F
-GLIBC_2.12 argp_err_exit_status D 0x4
-GLIBC_2.12 argp_error F
-GLIBC_2.12 argp_failure F
-GLIBC_2.12 argp_help F
-GLIBC_2.12 argp_parse F
-GLIBC_2.12 argp_program_bug_address D 0x4
-GLIBC_2.12 argp_program_version D 0x4
-GLIBC_2.12 argp_program_version_hook D 0x4
-GLIBC_2.12 argp_state_help F
-GLIBC_2.12 argp_usage F
-GLIBC_2.12 argz_add F
-GLIBC_2.12 argz_add_sep F
-GLIBC_2.12 argz_append F
-GLIBC_2.12 argz_count F
-GLIBC_2.12 argz_create F
-GLIBC_2.12 argz_create_sep F
-GLIBC_2.12 argz_delete F
-GLIBC_2.12 argz_extract F
-GLIBC_2.12 argz_insert F
-GLIBC_2.12 argz_next F
-GLIBC_2.12 argz_replace F
-GLIBC_2.12 argz_stringify F
-GLIBC_2.12 asctime F
-GLIBC_2.12 asctime_r F
-GLIBC_2.12 asprintf F
-GLIBC_2.12 atof F
-GLIBC_2.12 atoi F
-GLIBC_2.12 atol F
-GLIBC_2.12 atoll F
-GLIBC_2.12 authdes_create F
-GLIBC_2.12 authdes_getucred F
-GLIBC_2.12 authdes_pk_create F
-GLIBC_2.12 authnone_create F
-GLIBC_2.12 authunix_create F
-GLIBC_2.12 authunix_create_default F
-GLIBC_2.12 backtrace F
-GLIBC_2.12 backtrace_symbols F
-GLIBC_2.12 backtrace_symbols_fd F
-GLIBC_2.12 basename F
-GLIBC_2.12 bcmp F
-GLIBC_2.12 bcopy F
-GLIBC_2.12 bdflush F
-GLIBC_2.12 bind F
-GLIBC_2.12 bind_textdomain_codeset F
-GLIBC_2.12 bindresvport F
-GLIBC_2.12 bindtextdomain F
-GLIBC_2.12 brk F
-GLIBC_2.12 bsd_signal F
-GLIBC_2.12 bsearch F
-GLIBC_2.12 btowc F
-GLIBC_2.12 bzero F
-GLIBC_2.12 cacheflush F
-GLIBC_2.12 calloc F
-GLIBC_2.12 callrpc F
-GLIBC_2.12 canonicalize_file_name F
-GLIBC_2.12 capget F
-GLIBC_2.12 capset F
-GLIBC_2.12 catclose F
-GLIBC_2.12 catgets F
-GLIBC_2.12 catopen F
-GLIBC_2.12 cbc_crypt F
-GLIBC_2.12 cfgetispeed F
-GLIBC_2.12 cfgetospeed F
-GLIBC_2.12 cfmakeraw F
-GLIBC_2.12 cfree F
-GLIBC_2.12 cfsetispeed F
-GLIBC_2.12 cfsetospeed F
-GLIBC_2.12 cfsetspeed F
-GLIBC_2.12 chdir F
-GLIBC_2.12 chflags F
-GLIBC_2.12 chmod F
-GLIBC_2.12 chown F
-GLIBC_2.12 chroot F
-GLIBC_2.12 clearenv F
-GLIBC_2.12 clearerr F
-GLIBC_2.12 clearerr_unlocked F
-GLIBC_2.12 clnt_broadcast F
-GLIBC_2.12 clnt_create F
-GLIBC_2.12 clnt_pcreateerror F
-GLIBC_2.12 clnt_perrno F
-GLIBC_2.12 clnt_perror F
-GLIBC_2.12 clnt_spcreateerror F
-GLIBC_2.12 clnt_sperrno F
-GLIBC_2.12 clnt_sperror F
-GLIBC_2.12 clntraw_create F
-GLIBC_2.12 clnttcp_create F
-GLIBC_2.12 clntudp_bufcreate F
-GLIBC_2.12 clntudp_create F
-GLIBC_2.12 clntunix_create F
-GLIBC_2.12 clock F
-GLIBC_2.12 clone F
-GLIBC_2.12 close F
-GLIBC_2.12 closedir F
-GLIBC_2.12 closelog F
-GLIBC_2.12 confstr F
-GLIBC_2.12 connect F
-GLIBC_2.12 copysign F
-GLIBC_2.12 copysignf F
-GLIBC_2.12 copysignl F
-GLIBC_2.12 creat F
-GLIBC_2.12 creat64 F
-GLIBC_2.12 create_module F
-GLIBC_2.12 ctermid F
-GLIBC_2.12 ctime F
-GLIBC_2.12 ctime_r F
-GLIBC_2.12 cuserid F
-GLIBC_2.12 daemon F
-GLIBC_2.12 daylight D 0x4
-GLIBC_2.12 dcgettext F
-GLIBC_2.12 dcngettext F
-GLIBC_2.12 delete_module F
-GLIBC_2.12 des_setparity F
-GLIBC_2.12 dgettext F
-GLIBC_2.12 difftime F
-GLIBC_2.12 dirfd F
-GLIBC_2.12 dirname F
-GLIBC_2.12 div F
-GLIBC_2.12 dl_iterate_phdr F
-GLIBC_2.12 dngettext F
-GLIBC_2.12 dprintf F
-GLIBC_2.12 drand48 F
-GLIBC_2.12 drand48_r F
-GLIBC_2.12 dup F
-GLIBC_2.12 dup2 F
-GLIBC_2.12 dup3 F
-GLIBC_2.12 duplocale F
-GLIBC_2.12 dysize F
-GLIBC_2.12 eaccess F
-GLIBC_2.12 ecb_crypt F
-GLIBC_2.12 ecvt F
-GLIBC_2.12 ecvt_r F
-GLIBC_2.12 endaliasent F
-GLIBC_2.12 endfsent F
-GLIBC_2.12 endgrent F
-GLIBC_2.12 endhostent F
-GLIBC_2.12 endmntent F
-GLIBC_2.12 endnetent F
-GLIBC_2.12 endnetgrent F
-GLIBC_2.12 endprotoent F
-GLIBC_2.12 endpwent F
-GLIBC_2.12 endrpcent F
-GLIBC_2.12 endservent F
-GLIBC_2.12 endsgent F
-GLIBC_2.12 endspent F
-GLIBC_2.12 endttyent F
-GLIBC_2.12 endusershell F
-GLIBC_2.12 endutent F
-GLIBC_2.12 endutxent F
-GLIBC_2.12 environ D 0x4
-GLIBC_2.12 envz_add F
-GLIBC_2.12 envz_entry F
-GLIBC_2.12 envz_get F
-GLIBC_2.12 envz_merge F
-GLIBC_2.12 envz_remove F
-GLIBC_2.12 envz_strip F
-GLIBC_2.12 epoll_create F
-GLIBC_2.12 epoll_create1 F
-GLIBC_2.12 epoll_ctl F
-GLIBC_2.12 epoll_pwait F
-GLIBC_2.12 epoll_wait F
-GLIBC_2.12 erand48 F
-GLIBC_2.12 erand48_r F
-GLIBC_2.12 err F
-GLIBC_2.12 error F
-GLIBC_2.12 error_at_line F
-GLIBC_2.12 error_message_count D 0x4
-GLIBC_2.12 error_one_per_line D 0x4
-GLIBC_2.12 error_print_progname D 0x4
-GLIBC_2.12 errx F
-GLIBC_2.12 ether_aton F
-GLIBC_2.12 ether_aton_r F
-GLIBC_2.12 ether_hostton F
-GLIBC_2.12 ether_line F
-GLIBC_2.12 ether_ntoa F
-GLIBC_2.12 ether_ntoa_r F
-GLIBC_2.12 ether_ntohost F
-GLIBC_2.12 euidaccess F
-GLIBC_2.12 eventfd F
-GLIBC_2.12 eventfd_read F
-GLIBC_2.12 eventfd_write F
-GLIBC_2.12 execl F
-GLIBC_2.12 execle F
-GLIBC_2.12 execlp F
-GLIBC_2.12 execv F
-GLIBC_2.12 execve F
-GLIBC_2.12 execvp F
-GLIBC_2.12 execvpe F
-GLIBC_2.12 exit F
-GLIBC_2.12 faccessat F
-GLIBC_2.12 fallocate F
-GLIBC_2.12 fallocate64 F
-GLIBC_2.12 fattach F
-GLIBC_2.12 fchdir F
-GLIBC_2.12 fchflags F
-GLIBC_2.12 fchmod F
-GLIBC_2.12 fchmodat F
-GLIBC_2.12 fchown F
-GLIBC_2.12 fchownat F
-GLIBC_2.12 fclose F
-GLIBC_2.12 fcloseall F
-GLIBC_2.12 fcntl F
-GLIBC_2.12 fcvt F
-GLIBC_2.12 fcvt_r F
-GLIBC_2.12 fdatasync F
-GLIBC_2.12 fdetach F
-GLIBC_2.12 fdopen F
-GLIBC_2.12 fdopendir F
-GLIBC_2.12 feof F
-GLIBC_2.12 feof_unlocked F
-GLIBC_2.12 ferror F
-GLIBC_2.12 ferror_unlocked F
-GLIBC_2.12 fexecve F
-GLIBC_2.12 fflush F
-GLIBC_2.12 fflush_unlocked F
-GLIBC_2.12 ffs F
-GLIBC_2.12 ffsl F
-GLIBC_2.12 ffsll F
-GLIBC_2.12 fgetc F
-GLIBC_2.12 fgetc_unlocked F
-GLIBC_2.12 fgetgrent F
-GLIBC_2.12 fgetgrent_r F
-GLIBC_2.12 fgetpos F
-GLIBC_2.12 fgetpos64 F
-GLIBC_2.12 fgetpwent F
-GLIBC_2.12 fgetpwent_r F
-GLIBC_2.12 fgets F
-GLIBC_2.12 fgets_unlocked F
-GLIBC_2.12 fgetsgent F
-GLIBC_2.12 fgetsgent_r F
-GLIBC_2.12 fgetspent F
-GLIBC_2.12 fgetspent_r F
-GLIBC_2.12 fgetwc F
-GLIBC_2.12 fgetwc_unlocked F
-GLIBC_2.12 fgetws F
-GLIBC_2.12 fgetws_unlocked F
-GLIBC_2.12 fgetxattr F
-GLIBC_2.12 fileno F
-GLIBC_2.12 fileno_unlocked F
-GLIBC_2.12 finite F
-GLIBC_2.12 finitef F
-GLIBC_2.12 finitel F
-GLIBC_2.12 flistxattr F
-GLIBC_2.12 flock F
-GLIBC_2.12 flockfile F
-GLIBC_2.12 fmemopen F
-GLIBC_2.12 fmtmsg F
-GLIBC_2.12 fnmatch F
-GLIBC_2.12 fopen F
-GLIBC_2.12 fopen64 F
-GLIBC_2.12 fopencookie F
-GLIBC_2.12 fork F
-GLIBC_2.12 fpathconf F
-GLIBC_2.12 fprintf F
-GLIBC_2.12 fputc F
-GLIBC_2.12 fputc_unlocked F
-GLIBC_2.12 fputs F
-GLIBC_2.12 fputs_unlocked F
-GLIBC_2.12 fputwc F
-GLIBC_2.12 fputwc_unlocked F
-GLIBC_2.12 fputws F
-GLIBC_2.12 fputws_unlocked F
-GLIBC_2.12 fread F
-GLIBC_2.12 fread_unlocked F
-GLIBC_2.12 free F
-GLIBC_2.12 freeaddrinfo F
-GLIBC_2.12 freeifaddrs F
-GLIBC_2.12 freelocale F
-GLIBC_2.12 fremovexattr F
-GLIBC_2.12 freopen F
-GLIBC_2.12 freopen64 F
-GLIBC_2.12 frexp F
-GLIBC_2.12 frexpf F
-GLIBC_2.12 frexpl F
-GLIBC_2.12 fscanf F
-GLIBC_2.12 fseek F
-GLIBC_2.12 fseeko F
-GLIBC_2.12 fseeko64 F
-GLIBC_2.12 fsetpos F
-GLIBC_2.12 fsetpos64 F
-GLIBC_2.12 fsetxattr F
-GLIBC_2.12 fstatfs F
-GLIBC_2.12 fstatfs64 F
-GLIBC_2.12 fstatvfs F
-GLIBC_2.12 fstatvfs64 F
-GLIBC_2.12 fsync F
-GLIBC_2.12 ftell F
-GLIBC_2.12 ftello F
-GLIBC_2.12 ftello64 F
-GLIBC_2.12 ftime F
-GLIBC_2.12 ftok F
-GLIBC_2.12 ftruncate F
-GLIBC_2.12 ftruncate64 F
-GLIBC_2.12 ftrylockfile F
-GLIBC_2.12 fts_children F
-GLIBC_2.12 fts_close F
-GLIBC_2.12 fts_open F
-GLIBC_2.12 fts_read F
-GLIBC_2.12 fts_set F
-GLIBC_2.12 ftw F
-GLIBC_2.12 ftw64 F
-GLIBC_2.12 funlockfile F
-GLIBC_2.12 futimens F
-GLIBC_2.12 futimes F
-GLIBC_2.12 futimesat F
-GLIBC_2.12 fwide F
-GLIBC_2.12 fwprintf F
-GLIBC_2.12 fwrite F
-GLIBC_2.12 fwrite_unlocked F
-GLIBC_2.12 fwscanf F
-GLIBC_2.12 gai_strerror F
-GLIBC_2.12 gcvt F
-GLIBC_2.12 get_avphys_pages F
-GLIBC_2.12 get_current_dir_name F
-GLIBC_2.12 get_kernel_syms F
-GLIBC_2.12 get_myaddress F
-GLIBC_2.12 get_nprocs F
-GLIBC_2.12 get_nprocs_conf F
-GLIBC_2.12 get_phys_pages F
-GLIBC_2.12 getaddrinfo F
-GLIBC_2.12 getaliasbyname F
-GLIBC_2.12 getaliasbyname_r F
-GLIBC_2.12 getaliasent F
-GLIBC_2.12 getaliasent_r F
-GLIBC_2.12 getc F
-GLIBC_2.12 getc_unlocked F
-GLIBC_2.12 getchar F
-GLIBC_2.12 getchar_unlocked F
-GLIBC_2.12 getcontext F
-GLIBC_2.12 getcwd F
-GLIBC_2.12 getdate F
-GLIBC_2.12 getdate_err D 0x4
-GLIBC_2.12 getdate_r F
-GLIBC_2.12 getdelim F
-GLIBC_2.12 getdirentries F
-GLIBC_2.12 getdirentries64 F
-GLIBC_2.12 getdomainname F
-GLIBC_2.12 getdtablesize F
-GLIBC_2.12 getegid F
-GLIBC_2.12 getenv F
-GLIBC_2.12 geteuid F
-GLIBC_2.12 getfsent F
-GLIBC_2.12 getfsfile F
-GLIBC_2.12 getfsspec F
-GLIBC_2.12 getgid F
-GLIBC_2.12 getgrent F
-GLIBC_2.12 getgrent_r F
-GLIBC_2.12 getgrgid F
-GLIBC_2.12 getgrgid_r F
-GLIBC_2.12 getgrnam F
-GLIBC_2.12 getgrnam_r F
-GLIBC_2.12 getgrouplist F
-GLIBC_2.12 getgroups F
-GLIBC_2.12 gethostbyaddr F
-GLIBC_2.12 gethostbyaddr_r F
-GLIBC_2.12 gethostbyname F
-GLIBC_2.12 gethostbyname2 F
-GLIBC_2.12 gethostbyname2_r F
-GLIBC_2.12 gethostbyname_r F
-GLIBC_2.12 gethostent F
-GLIBC_2.12 gethostent_r F
-GLIBC_2.12 gethostid F
-GLIBC_2.12 gethostname F
-GLIBC_2.12 getifaddrs F
-GLIBC_2.12 getipv4sourcefilter F
-GLIBC_2.12 getitimer F
-GLIBC_2.12 getline F
-GLIBC_2.12 getloadavg F
-GLIBC_2.12 getlogin F
-GLIBC_2.12 getlogin_r F
-GLIBC_2.12 getmntent F
-GLIBC_2.12 getmntent_r F
-GLIBC_2.12 getmsg F
-GLIBC_2.12 getnameinfo F
-GLIBC_2.12 getnetbyaddr F
-GLIBC_2.12 getnetbyaddr_r F
-GLIBC_2.12 getnetbyname F
-GLIBC_2.12 getnetbyname_r F
-GLIBC_2.12 getnetent F
-GLIBC_2.12 getnetent_r F
-GLIBC_2.12 getnetgrent F
-GLIBC_2.12 getnetgrent_r F
-GLIBC_2.12 getnetname F
-GLIBC_2.12 getopt F
-GLIBC_2.12 getopt_long F
-GLIBC_2.12 getopt_long_only F
-GLIBC_2.12 getpagesize F
-GLIBC_2.12 getpass F
-GLIBC_2.12 getpeername F
-GLIBC_2.12 getpgid F
-GLIBC_2.12 getpgrp F
-GLIBC_2.12 getpid F
-GLIBC_2.12 getpmsg F
-GLIBC_2.12 getppid F
-GLIBC_2.12 getpriority F
-GLIBC_2.12 getprotobyname F
-GLIBC_2.12 getprotobyname_r F
-GLIBC_2.12 getprotobynumber F
-GLIBC_2.12 getprotobynumber_r F
-GLIBC_2.12 getprotoent F
-GLIBC_2.12 getprotoent_r F
-GLIBC_2.12 getpt F
-GLIBC_2.12 getpublickey F
-GLIBC_2.12 getpw F
-GLIBC_2.12 getpwent F
-GLIBC_2.12 getpwent_r F
-GLIBC_2.12 getpwnam F
-GLIBC_2.12 getpwnam_r F
-GLIBC_2.12 getpwuid F
-GLIBC_2.12 getpwuid_r F
-GLIBC_2.12 getresgid F
-GLIBC_2.12 getresuid F
-GLIBC_2.12 getrlimit F
-GLIBC_2.12 getrlimit64 F
-GLIBC_2.12 getrpcbyname F
-GLIBC_2.12 getrpcbyname_r F
-GLIBC_2.12 getrpcbynumber F
-GLIBC_2.12 getrpcbynumber_r F
-GLIBC_2.12 getrpcent F
-GLIBC_2.12 getrpcent_r F
-GLIBC_2.12 getrpcport F
-GLIBC_2.12 getrusage F
-GLIBC_2.12 gets F
-GLIBC_2.12 getsecretkey F
-GLIBC_2.12 getservbyname F
-GLIBC_2.12 getservbyname_r F
-GLIBC_2.12 getservbyport F
-GLIBC_2.12 getservbyport_r F
-GLIBC_2.12 getservent F
-GLIBC_2.12 getservent_r F
-GLIBC_2.12 getsgent F
-GLIBC_2.12 getsgent_r F
-GLIBC_2.12 getsgnam F
-GLIBC_2.12 getsgnam_r F
-GLIBC_2.12 getsid F
-GLIBC_2.12 getsockname F
-GLIBC_2.12 getsockopt F
-GLIBC_2.12 getsourcefilter F
-GLIBC_2.12 getspent F
-GLIBC_2.12 getspent_r F
-GLIBC_2.12 getspnam F
-GLIBC_2.12 getspnam_r F
-GLIBC_2.12 getsubopt F
-GLIBC_2.12 gettext F
-GLIBC_2.12 gettimeofday F
-GLIBC_2.12 getttyent F
-GLIBC_2.12 getttynam F
-GLIBC_2.12 getuid F
-GLIBC_2.12 getusershell F
-GLIBC_2.12 getutent F
-GLIBC_2.12 getutent_r F
-GLIBC_2.12 getutid F
-GLIBC_2.12 getutid_r F
-GLIBC_2.12 getutline F
-GLIBC_2.12 getutline_r F
-GLIBC_2.12 getutmp F
-GLIBC_2.12 getutmpx F
-GLIBC_2.12 getutxent F
-GLIBC_2.12 getutxid F
-GLIBC_2.12 getutxline F
-GLIBC_2.12 getw F
-GLIBC_2.12 getwc F
-GLIBC_2.12 getwc_unlocked F
-GLIBC_2.12 getwchar F
-GLIBC_2.12 getwchar_unlocked F
-GLIBC_2.12 getwd F
-GLIBC_2.12 getxattr F
-GLIBC_2.12 glob F
-GLIBC_2.12 glob64 F
-GLIBC_2.12 glob_pattern_p F
-GLIBC_2.12 globfree F
-GLIBC_2.12 globfree64 F
-GLIBC_2.12 gmtime F
-GLIBC_2.12 gmtime_r F
-GLIBC_2.12 gnu_dev_major F
-GLIBC_2.12 gnu_dev_makedev F
-GLIBC_2.12 gnu_dev_minor F
-GLIBC_2.12 gnu_get_libc_release F
-GLIBC_2.12 gnu_get_libc_version F
-GLIBC_2.12 grantpt F
-GLIBC_2.12 group_member F
-GLIBC_2.12 gsignal F
-GLIBC_2.12 gtty F
-GLIBC_2.12 h_errlist D 0x14
-GLIBC_2.12 h_nerr D 0x4
-GLIBC_2.12 hasmntopt F
-GLIBC_2.12 hcreate F
-GLIBC_2.12 hcreate_r F
-GLIBC_2.12 hdestroy F
-GLIBC_2.12 hdestroy_r F
-GLIBC_2.12 herror F
-GLIBC_2.12 host2netname F
-GLIBC_2.12 hsearch F
-GLIBC_2.12 hsearch_r F
-GLIBC_2.12 hstrerror F
-GLIBC_2.12 htonl F
-GLIBC_2.12 htons F
-GLIBC_2.12 iconv F
-GLIBC_2.12 iconv_close F
-GLIBC_2.12 iconv_open F
-GLIBC_2.12 if_freenameindex F
-GLIBC_2.12 if_indextoname F
-GLIBC_2.12 if_nameindex F
-GLIBC_2.12 if_nametoindex F
-GLIBC_2.12 imaxabs F
-GLIBC_2.12 imaxdiv F
-GLIBC_2.12 in6addr_any D 0x10
-GLIBC_2.12 in6addr_loopback D 0x10
-GLIBC_2.12 index F
-GLIBC_2.12 inet6_opt_append F
-GLIBC_2.12 inet6_opt_find F
-GLIBC_2.12 inet6_opt_finish F
-GLIBC_2.12 inet6_opt_get_val F
-GLIBC_2.12 inet6_opt_init F
-GLIBC_2.12 inet6_opt_next F
-GLIBC_2.12 inet6_opt_set_val F
-GLIBC_2.12 inet6_option_alloc F
-GLIBC_2.12 inet6_option_append F
-GLIBC_2.12 inet6_option_find F
-GLIBC_2.12 inet6_option_init F
-GLIBC_2.12 inet6_option_next F
-GLIBC_2.12 inet6_option_space F
-GLIBC_2.12 inet6_rth_add F
-GLIBC_2.12 inet6_rth_getaddr F
-GLIBC_2.12 inet6_rth_init F
-GLIBC_2.12 inet6_rth_reverse F
-GLIBC_2.12 inet6_rth_segments F
-GLIBC_2.12 inet6_rth_space F
-GLIBC_2.12 inet_addr F
-GLIBC_2.12 inet_aton F
-GLIBC_2.12 inet_lnaof F
-GLIBC_2.12 inet_makeaddr F
-GLIBC_2.12 inet_netof F
-GLIBC_2.12 inet_network F
-GLIBC_2.12 inet_nsap_addr F
-GLIBC_2.12 inet_nsap_ntoa F
-GLIBC_2.12 inet_ntoa F
-GLIBC_2.12 inet_ntop F
-GLIBC_2.12 inet_pton F
-GLIBC_2.12 init_module F
-GLIBC_2.12 initgroups F
-GLIBC_2.12 initstate F
-GLIBC_2.12 initstate_r F
-GLIBC_2.12 innetgr F
-GLIBC_2.12 inotify_add_watch F
-GLIBC_2.12 inotify_init F
-GLIBC_2.12 inotify_init1 F
-GLIBC_2.12 inotify_rm_watch F
-GLIBC_2.12 insque F
-GLIBC_2.12 ioctl F
-GLIBC_2.12 iruserok F
-GLIBC_2.12 iruserok_af F
-GLIBC_2.12 isalnum F
-GLIBC_2.12 isalnum_l F
-GLIBC_2.12 isalpha F
-GLIBC_2.12 isalpha_l F
-GLIBC_2.12 isascii F
-GLIBC_2.12 isastream F
-GLIBC_2.12 isatty F
-GLIBC_2.12 isblank F
-GLIBC_2.12 isblank_l F
-GLIBC_2.12 iscntrl F
-GLIBC_2.12 iscntrl_l F
-GLIBC_2.12 isctype F
-GLIBC_2.12 isdigit F
-GLIBC_2.12 isdigit_l F
-GLIBC_2.12 isfdtype F
-GLIBC_2.12 isgraph F
-GLIBC_2.12 isgraph_l F
-GLIBC_2.12 isinf F
-GLIBC_2.12 isinff F
-GLIBC_2.12 isinfl F
-GLIBC_2.12 islower F
-GLIBC_2.12 islower_l F
-GLIBC_2.12 isnan F
-GLIBC_2.12 isnanf F
-GLIBC_2.12 isnanl F
-GLIBC_2.12 isprint F
-GLIBC_2.12 isprint_l F
-GLIBC_2.12 ispunct F
-GLIBC_2.12 ispunct_l F
-GLIBC_2.12 isspace F
-GLIBC_2.12 isspace_l F
-GLIBC_2.12 isupper F
-GLIBC_2.12 isupper_l F
-GLIBC_2.12 iswalnum F
-GLIBC_2.12 iswalnum_l F
-GLIBC_2.12 iswalpha F
-GLIBC_2.12 iswalpha_l F
-GLIBC_2.12 iswblank F
-GLIBC_2.12 iswblank_l F
-GLIBC_2.12 iswcntrl F
-GLIBC_2.12 iswcntrl_l F
-GLIBC_2.12 iswctype F
-GLIBC_2.12 iswctype_l F
-GLIBC_2.12 iswdigit F
-GLIBC_2.12 iswdigit_l F
-GLIBC_2.12 iswgraph F
-GLIBC_2.12 iswgraph_l F
-GLIBC_2.12 iswlower F
-GLIBC_2.12 iswlower_l F
-GLIBC_2.12 iswprint F
-GLIBC_2.12 iswprint_l F
-GLIBC_2.12 iswpunct F
-GLIBC_2.12 iswpunct_l F
-GLIBC_2.12 iswspace F
-GLIBC_2.12 iswspace_l F
-GLIBC_2.12 iswupper F
-GLIBC_2.12 iswupper_l F
-GLIBC_2.12 iswxdigit F
-GLIBC_2.12 iswxdigit_l F
-GLIBC_2.12 isxdigit F
-GLIBC_2.12 isxdigit_l F
-GLIBC_2.12 jrand48 F
-GLIBC_2.12 jrand48_r F
-GLIBC_2.12 key_decryptsession F
-GLIBC_2.12 key_decryptsession_pk F
-GLIBC_2.12 key_encryptsession F
-GLIBC_2.12 key_encryptsession_pk F
-GLIBC_2.12 key_gendes F
-GLIBC_2.12 key_get_conv F
-GLIBC_2.12 key_secretkey_is_set F
-GLIBC_2.12 key_setnet F
-GLIBC_2.12 key_setsecret F
-GLIBC_2.12 kill F
-GLIBC_2.12 killpg F
-GLIBC_2.12 klogctl F
-GLIBC_2.12 l64a F
-GLIBC_2.12 labs F
-GLIBC_2.12 lchmod F
-GLIBC_2.12 lchown F
-GLIBC_2.12 lckpwdf F
-GLIBC_2.12 lcong48 F
-GLIBC_2.12 lcong48_r F
-GLIBC_2.12 ldexp F
-GLIBC_2.12 ldexpf F
-GLIBC_2.12 ldexpl F
-GLIBC_2.12 ldiv F
-GLIBC_2.12 lfind F
-GLIBC_2.12 lgetxattr F
-GLIBC_2.12 link F
-GLIBC_2.12 linkat F
-GLIBC_2.12 listen F
-GLIBC_2.12 listxattr F
-GLIBC_2.12 llabs F
-GLIBC_2.12 lldiv F
-GLIBC_2.12 llistxattr F
-GLIBC_2.12 llseek F
-GLIBC_2.12 loc1 D 0x4
-GLIBC_2.12 loc2 D 0x4
-GLIBC_2.12 localeconv F
-GLIBC_2.12 localtime F
-GLIBC_2.12 localtime_r F
-GLIBC_2.12 lockf F
-GLIBC_2.12 lockf64 F
-GLIBC_2.12 locs D 0x4
-GLIBC_2.12 longjmp F
-GLIBC_2.12 lrand48 F
-GLIBC_2.12 lrand48_r F
-GLIBC_2.12 lremovexattr F
-GLIBC_2.12 lsearch F
-GLIBC_2.12 lseek F
-GLIBC_2.12 lseek64 F
-GLIBC_2.12 lsetxattr F
-GLIBC_2.12 lutimes F
-GLIBC_2.12 madvise F
-GLIBC_2.12 makecontext F
-GLIBC_2.12 mallinfo F
-GLIBC_2.12 malloc F
-GLIBC_2.12 malloc_get_state F
-GLIBC_2.12 malloc_info F
-GLIBC_2.12 malloc_set_state F
-GLIBC_2.12 malloc_stats F
-GLIBC_2.12 malloc_trim F
-GLIBC_2.12 malloc_usable_size F
-GLIBC_2.12 mallopt F
-GLIBC_2.12 mallwatch D 0x4
-GLIBC_2.12 mblen F
-GLIBC_2.12 mbrlen F
-GLIBC_2.12 mbrtowc F
-GLIBC_2.12 mbsinit F
-GLIBC_2.12 mbsnrtowcs F
-GLIBC_2.12 mbsrtowcs F
-GLIBC_2.12 mbstowcs F
-GLIBC_2.12 mbtowc F
-GLIBC_2.12 mcheck F
-GLIBC_2.12 mcheck_check_all F
-GLIBC_2.12 mcheck_pedantic F
-GLIBC_2.12 mcount F
-GLIBC_2.12 memalign F
-GLIBC_2.12 memccpy F
-GLIBC_2.12 memchr F
-GLIBC_2.12 memcmp F
-GLIBC_2.12 memcpy F
-GLIBC_2.12 memfrob F
-GLIBC_2.12 memmem F
-GLIBC_2.12 memmove F
-GLIBC_2.12 mempcpy F
-GLIBC_2.12 memrchr F
-GLIBC_2.12 memset F
-GLIBC_2.12 mincore F
-GLIBC_2.12 mkdir F
-GLIBC_2.12 mkdirat F
-GLIBC_2.12 mkdtemp F
-GLIBC_2.12 mkfifo F
-GLIBC_2.12 mkfifoat F
-GLIBC_2.12 mkostemp F
-GLIBC_2.12 mkostemp64 F
-GLIBC_2.12 mkostemps F
-GLIBC_2.12 mkostemps64 F
-GLIBC_2.12 mkstemp F
-GLIBC_2.12 mkstemp64 F
-GLIBC_2.12 mkstemps F
-GLIBC_2.12 mkstemps64 F
-GLIBC_2.12 mktemp F
-GLIBC_2.12 mktime F
-GLIBC_2.12 mlock F
-GLIBC_2.12 mlockall F
-GLIBC_2.12 mmap F
-GLIBC_2.12 mmap64 F
-GLIBC_2.12 modf F
-GLIBC_2.12 modff F
-GLIBC_2.12 modfl F
-GLIBC_2.12 moncontrol F
-GLIBC_2.12 monstartup F
-GLIBC_2.12 mount F
-GLIBC_2.12 mprobe F
-GLIBC_2.12 mprotect F
-GLIBC_2.12 mrand48 F
-GLIBC_2.12 mrand48_r F
-GLIBC_2.12 mremap F
-GLIBC_2.12 msgctl F
-GLIBC_2.12 msgget F
-GLIBC_2.12 msgrcv F
-GLIBC_2.12 msgsnd F
-GLIBC_2.12 msync F
-GLIBC_2.12 mtrace F
-GLIBC_2.12 munlock F
-GLIBC_2.12 munlockall F
-GLIBC_2.12 munmap F
-GLIBC_2.12 muntrace F
-GLIBC_2.12 nanosleep F
-GLIBC_2.12 netname2host F
-GLIBC_2.12 netname2user F
-GLIBC_2.12 newlocale F
-GLIBC_2.12 nfsservctl F
-GLIBC_2.12 nftw F
-GLIBC_2.12 nftw64 F
-GLIBC_2.12 ngettext F
-GLIBC_2.12 nice F
-GLIBC_2.12 nl_langinfo F
-GLIBC_2.12 nl_langinfo_l F
-GLIBC_2.12 nrand48 F
-GLIBC_2.12 nrand48_r F
-GLIBC_2.12 ntohl F
-GLIBC_2.12 ntohs F
-GLIBC_2.12 ntp_adjtime F
-GLIBC_2.12 ntp_gettime F
-GLIBC_2.12 ntp_gettimex F
-GLIBC_2.12 obstack_alloc_failed_handler D 0x4
-GLIBC_2.12 obstack_exit_failure D 0x4
-GLIBC_2.12 obstack_free F
-GLIBC_2.12 obstack_printf F
-GLIBC_2.12 obstack_vprintf F
-GLIBC_2.12 on_exit F
-GLIBC_2.12 open F
-GLIBC_2.12 open64 F
-GLIBC_2.12 open_memstream F
-GLIBC_2.12 open_wmemstream F
-GLIBC_2.12 openat F
-GLIBC_2.12 openat64 F
-GLIBC_2.12 opendir F
-GLIBC_2.12 openlog F
-GLIBC_2.12 optarg D 0x4
-GLIBC_2.12 opterr D 0x4
-GLIBC_2.12 optind D 0x4
-GLIBC_2.12 optopt D 0x4
-GLIBC_2.12 parse_printf_format F
-GLIBC_2.12 passwd2des F
-GLIBC_2.12 pathconf F
-GLIBC_2.12 pause F
-GLIBC_2.12 pclose F
-GLIBC_2.12 perror F
-GLIBC_2.12 personality F
-GLIBC_2.12 pipe F
-GLIBC_2.12 pipe2 F
-GLIBC_2.12 pivot_root F
-GLIBC_2.12 pmap_getmaps F
-GLIBC_2.12 pmap_getport F
-GLIBC_2.12 pmap_rmtcall F
-GLIBC_2.12 pmap_set F
-GLIBC_2.12 pmap_unset F
-GLIBC_2.12 poll F
-GLIBC_2.12 popen F
-GLIBC_2.12 posix_fadvise F
-GLIBC_2.12 posix_fadvise64 F
-GLIBC_2.12 posix_fallocate F
-GLIBC_2.12 posix_fallocate64 F
-GLIBC_2.12 posix_madvise F
-GLIBC_2.12 posix_memalign F
-GLIBC_2.12 posix_openpt F
-GLIBC_2.12 posix_spawn F
-GLIBC_2.12 posix_spawn_file_actions_addclose F
-GLIBC_2.12 posix_spawn_file_actions_adddup2 F
-GLIBC_2.12 posix_spawn_file_actions_addopen F
-GLIBC_2.12 posix_spawn_file_actions_destroy F
-GLIBC_2.12 posix_spawn_file_actions_init F
-GLIBC_2.12 posix_spawnattr_destroy F
-GLIBC_2.12 posix_spawnattr_getflags F
-GLIBC_2.12 posix_spawnattr_getpgroup F
-GLIBC_2.12 posix_spawnattr_getschedparam F
-GLIBC_2.12 posix_spawnattr_getschedpolicy F
-GLIBC_2.12 posix_spawnattr_getsigdefault F
-GLIBC_2.12 posix_spawnattr_getsigmask F
-GLIBC_2.12 posix_spawnattr_init F
-GLIBC_2.12 posix_spawnattr_setflags F
-GLIBC_2.12 posix_spawnattr_setpgroup F
-GLIBC_2.12 posix_spawnattr_setschedparam F
-GLIBC_2.12 posix_spawnattr_setschedpolicy F
-GLIBC_2.12 posix_spawnattr_setsigdefault F
-GLIBC_2.12 posix_spawnattr_setsigmask F
-GLIBC_2.12 posix_spawnp F
-GLIBC_2.12 ppoll F
-GLIBC_2.12 prctl F
-GLIBC_2.12 pread F
-GLIBC_2.12 pread64 F
-GLIBC_2.12 preadv F
-GLIBC_2.12 preadv64 F
-GLIBC_2.12 printf F
-GLIBC_2.12 printf_size F
-GLIBC_2.12 printf_size_info F
-GLIBC_2.12 profil F
-GLIBC_2.12 program_invocation_name D 0x4
-GLIBC_2.12 program_invocation_short_name D 0x4
-GLIBC_2.12 pselect F
-GLIBC_2.12 psiginfo F
-GLIBC_2.12 psignal F
-GLIBC_2.12 pthread_attr_destroy F
-GLIBC_2.12 pthread_attr_getdetachstate F
-GLIBC_2.12 pthread_attr_getinheritsched F
-GLIBC_2.12 pthread_attr_getschedparam F
-GLIBC_2.12 pthread_attr_getschedpolicy F
-GLIBC_2.12 pthread_attr_getscope F
-GLIBC_2.12 pthread_attr_init F
-GLIBC_2.12 pthread_attr_setdetachstate F
-GLIBC_2.12 pthread_attr_setinheritsched F
-GLIBC_2.12 pthread_attr_setschedparam F
-GLIBC_2.12 pthread_attr_setschedpolicy F
-GLIBC_2.12 pthread_attr_setscope F
-GLIBC_2.12 pthread_cond_broadcast F
-GLIBC_2.12 pthread_cond_destroy F
-GLIBC_2.12 pthread_cond_init F
-GLIBC_2.12 pthread_cond_signal F
-GLIBC_2.12 pthread_cond_timedwait F
-GLIBC_2.12 pthread_cond_wait F
-GLIBC_2.12 pthread_condattr_destroy F
-GLIBC_2.12 pthread_condattr_init F
-GLIBC_2.12 pthread_equal F
-GLIBC_2.12 pthread_exit F
-GLIBC_2.12 pthread_getschedparam F
-GLIBC_2.12 pthread_mutex_destroy F
-GLIBC_2.12 pthread_mutex_init F
-GLIBC_2.12 pthread_mutex_lock F
-GLIBC_2.12 pthread_mutex_unlock F
-GLIBC_2.12 pthread_self F
-GLIBC_2.12 pthread_setcancelstate F
-GLIBC_2.12 pthread_setcanceltype F
-GLIBC_2.12 pthread_setschedparam F
-GLIBC_2.12 ptrace F
-GLIBC_2.12 ptsname F
-GLIBC_2.12 ptsname_r F
-GLIBC_2.12 putc F
-GLIBC_2.12 putc_unlocked F
-GLIBC_2.12 putchar F
-GLIBC_2.12 putchar_unlocked F
-GLIBC_2.12 putenv F
-GLIBC_2.12 putgrent F
-GLIBC_2.12 putmsg F
-GLIBC_2.12 putpmsg F
-GLIBC_2.12 putpwent F
-GLIBC_2.12 puts F
-GLIBC_2.12 putsgent F
-GLIBC_2.12 putspent F
-GLIBC_2.12 pututline F
-GLIBC_2.12 pututxline F
-GLIBC_2.12 putw F
-GLIBC_2.12 putwc F
-GLIBC_2.12 putwc_unlocked F
-GLIBC_2.12 putwchar F
-GLIBC_2.12 putwchar_unlocked F
-GLIBC_2.12 pvalloc F
-GLIBC_2.12 pwrite F
-GLIBC_2.12 pwrite64 F
-GLIBC_2.12 pwritev F
-GLIBC_2.12 pwritev64 F
-GLIBC_2.12 qecvt F
-GLIBC_2.12 qecvt_r F
-GLIBC_2.12 qfcvt F
-GLIBC_2.12 qfcvt_r F
-GLIBC_2.12 qgcvt F
-GLIBC_2.12 qsort F
-GLIBC_2.12 qsort_r F
-GLIBC_2.12 query_module F
-GLIBC_2.12 quick_exit F
-GLIBC_2.12 quotactl F
-GLIBC_2.12 raise F
-GLIBC_2.12 rand F
-GLIBC_2.12 rand_r F
-GLIBC_2.12 random F
-GLIBC_2.12 random_r F
-GLIBC_2.12 rawmemchr F
-GLIBC_2.12 rcmd F
-GLIBC_2.12 rcmd_af F
-GLIBC_2.12 re_comp F
-GLIBC_2.12 re_compile_fastmap F
-GLIBC_2.12 re_compile_pattern F
-GLIBC_2.12 re_exec F
-GLIBC_2.12 re_match F
-GLIBC_2.12 re_match_2 F
-GLIBC_2.12 re_search F
-GLIBC_2.12 re_search_2 F
-GLIBC_2.12 re_set_registers F
-GLIBC_2.12 re_set_syntax F
-GLIBC_2.12 re_syntax_options D 0x4
-GLIBC_2.12 read F
-GLIBC_2.12 readahead F
-GLIBC_2.12 readdir F
-GLIBC_2.12 readdir64 F
-GLIBC_2.12 readdir64_r F
-GLIBC_2.12 readdir_r F
-GLIBC_2.12 readlink F
-GLIBC_2.12 readlinkat F
-GLIBC_2.12 readv F
-GLIBC_2.12 realloc F
-GLIBC_2.12 realpath F
-GLIBC_2.12 reboot F
-GLIBC_2.12 recv F
-GLIBC_2.12 recvfrom F
-GLIBC_2.12 recvmmsg F
-GLIBC_2.12 recvmsg F
-GLIBC_2.12 regcomp F
-GLIBC_2.12 regerror F
-GLIBC_2.12 regexec F
-GLIBC_2.12 regfree F
-GLIBC_2.12 register_printf_function F
-GLIBC_2.12 register_printf_modifier F
-GLIBC_2.12 register_printf_specifier F
-GLIBC_2.12 register_printf_type F
-GLIBC_2.12 registerrpc F
-GLIBC_2.12 remap_file_pages F
-GLIBC_2.12 remove F
-GLIBC_2.12 removexattr F
-GLIBC_2.12 remque F
-GLIBC_2.12 rename F
-GLIBC_2.12 renameat F
-GLIBC_2.12 revoke F
-GLIBC_2.12 rewind F
-GLIBC_2.12 rewinddir F
-GLIBC_2.12 rexec F
-GLIBC_2.12 rexec_af F
-GLIBC_2.12 rexecoptions D 0x4
-GLIBC_2.12 rindex F
-GLIBC_2.12 rmdir F
-GLIBC_2.12 rpc_createerr D 0x10
-GLIBC_2.12 rpmatch F
-GLIBC_2.12 rresvport F
-GLIBC_2.12 rresvport_af F
-GLIBC_2.12 rtime F
-GLIBC_2.12 ruserok F
-GLIBC_2.12 ruserok_af F
-GLIBC_2.12 ruserpass F
-GLIBC_2.12 sbrk F
-GLIBC_2.12 scalbn F
-GLIBC_2.12 scalbnf F
-GLIBC_2.12 scalbnl F
-GLIBC_2.12 scandir F
-GLIBC_2.12 scandir64 F
-GLIBC_2.12 scanf F
-GLIBC_2.12 sched_get_priority_max F
-GLIBC_2.12 sched_get_priority_min F
-GLIBC_2.12 sched_getaffinity F
-GLIBC_2.12 sched_getcpu F
-GLIBC_2.12 sched_getparam F
-GLIBC_2.12 sched_getscheduler F
-GLIBC_2.12 sched_rr_get_interval F
-GLIBC_2.12 sched_setaffinity F
-GLIBC_2.12 sched_setparam F
-GLIBC_2.12 sched_setscheduler F
-GLIBC_2.12 sched_yield F
-GLIBC_2.12 seed48 F
-GLIBC_2.12 seed48_r F
-GLIBC_2.12 seekdir F
-GLIBC_2.12 select F
-GLIBC_2.12 semctl F
-GLIBC_2.12 semget F
-GLIBC_2.12 semop F
-GLIBC_2.12 semtimedop F
-GLIBC_2.12 send F
-GLIBC_2.12 sendfile F
-GLIBC_2.12 sendfile64 F
-GLIBC_2.12 sendmsg F
-GLIBC_2.12 sendto F
-GLIBC_2.12 set_dataplane F
-GLIBC_2.12 setaliasent F
-GLIBC_2.12 setbuf F
-GLIBC_2.12 setbuffer F
-GLIBC_2.12 setcontext F
-GLIBC_2.12 setdomainname F
-GLIBC_2.12 setegid F
-GLIBC_2.12 setenv F
-GLIBC_2.12 seteuid F
-GLIBC_2.12 setfsent F
-GLIBC_2.12 setfsgid F
-GLIBC_2.12 setfsuid F
-GLIBC_2.12 setgid F
-GLIBC_2.12 setgrent F
-GLIBC_2.12 setgroups F
-GLIBC_2.12 sethostent F
-GLIBC_2.12 sethostid F
-GLIBC_2.12 sethostname F
-GLIBC_2.12 setipv4sourcefilter F
-GLIBC_2.12 setitimer F
-GLIBC_2.12 setjmp F
-GLIBC_2.12 setlinebuf F
-GLIBC_2.12 setlocale F
-GLIBC_2.12 setlogin F
-GLIBC_2.12 setlogmask F
-GLIBC_2.12 setmntent F
-GLIBC_2.12 setnetent F
-GLIBC_2.12 setnetgrent F
-GLIBC_2.12 setpgid F
-GLIBC_2.12 setpgrp F
-GLIBC_2.12 setpriority F
-GLIBC_2.12 setprotoent F
-GLIBC_2.12 setpwent F
-GLIBC_2.12 setregid F
-GLIBC_2.12 setresgid F
-GLIBC_2.12 setresuid F
-GLIBC_2.12 setreuid F
-GLIBC_2.12 setrlimit F
-GLIBC_2.12 setrlimit64 F
-GLIBC_2.12 setrpcent F
-GLIBC_2.12 setservent F
-GLIBC_2.12 setsgent F
-GLIBC_2.12 setsid F
-GLIBC_2.12 setsockopt F
-GLIBC_2.12 setsourcefilter F
-GLIBC_2.12 setspent F
-GLIBC_2.12 setstate F
-GLIBC_2.12 setstate_r F
-GLIBC_2.12 settimeofday F
-GLIBC_2.12 setttyent F
-GLIBC_2.12 setuid F
-GLIBC_2.12 setusershell F
-GLIBC_2.12 setutent F
-GLIBC_2.12 setutxent F
-GLIBC_2.12 setvbuf F
-GLIBC_2.12 setxattr F
-GLIBC_2.12 sgetsgent F
-GLIBC_2.12 sgetsgent_r F
-GLIBC_2.12 sgetspent F
-GLIBC_2.12 sgetspent_r F
-GLIBC_2.12 shmat F
-GLIBC_2.12 shmctl F
-GLIBC_2.12 shmdt F
-GLIBC_2.12 shmget F
-GLIBC_2.12 shutdown F
-GLIBC_2.12 sigaction F
-GLIBC_2.12 sigaddset F
-GLIBC_2.12 sigaltstack F
-GLIBC_2.12 sigandset F
-GLIBC_2.12 sigblock F
-GLIBC_2.12 sigdelset F
-GLIBC_2.12 sigemptyset F
-GLIBC_2.12 sigfillset F
-GLIBC_2.12 siggetmask F
-GLIBC_2.12 sighold F
-GLIBC_2.12 sigignore F
-GLIBC_2.12 siginterrupt F
-GLIBC_2.12 sigisemptyset F
-GLIBC_2.12 sigismember F
-GLIBC_2.12 siglongjmp F
-GLIBC_2.12 signal F
-GLIBC_2.12 signalfd F
-GLIBC_2.12 sigorset F
-GLIBC_2.12 sigpause F
-GLIBC_2.12 sigpending F
-GLIBC_2.12 sigprocmask F
-GLIBC_2.12 sigqueue F
-GLIBC_2.12 sigrelse F
-GLIBC_2.12 sigreturn F
-GLIBC_2.12 sigset F
-GLIBC_2.12 sigsetmask F
-GLIBC_2.12 sigstack F
-GLIBC_2.12 sigsuspend F
-GLIBC_2.12 sigtimedwait F
-GLIBC_2.12 sigvec F
-GLIBC_2.12 sigwait F
-GLIBC_2.12 sigwaitinfo F
-GLIBC_2.12 sleep F
-GLIBC_2.12 snprintf F
-GLIBC_2.12 sockatmark F
-GLIBC_2.12 socket F
-GLIBC_2.12 socketpair F
-GLIBC_2.12 splice F
-GLIBC_2.12 sprintf F
-GLIBC_2.12 sprofil F
-GLIBC_2.12 srand F
-GLIBC_2.12 srand48 F
-GLIBC_2.12 srand48_r F
-GLIBC_2.12 srandom F
-GLIBC_2.12 srandom_r F
-GLIBC_2.12 sscanf F
-GLIBC_2.12 ssignal F
-GLIBC_2.12 sstk F
-GLIBC_2.12 statfs F
-GLIBC_2.12 statfs64 F
-GLIBC_2.12 statvfs F
-GLIBC_2.12 statvfs64 F
-GLIBC_2.12 stderr D 0x4
-GLIBC_2.12 stdin D 0x4
-GLIBC_2.12 stdout D 0x4
-GLIBC_2.12 step F
-GLIBC_2.12 stime F
-GLIBC_2.12 stpcpy F
-GLIBC_2.12 stpncpy F
-GLIBC_2.12 strcasecmp F
-GLIBC_2.12 strcasecmp_l F
-GLIBC_2.12 strcasestr F
-GLIBC_2.12 strcat F
-GLIBC_2.12 strchr F
-GLIBC_2.12 strchrnul F
-GLIBC_2.12 strcmp F
-GLIBC_2.12 strcoll F
-GLIBC_2.12 strcoll_l F
-GLIBC_2.12 strcpy F
-GLIBC_2.12 strcspn F
-GLIBC_2.12 strdup F
-GLIBC_2.12 strerror F
-GLIBC_2.12 strerror_l F
-GLIBC_2.12 strerror_r F
-GLIBC_2.12 strfmon F
-GLIBC_2.12 strfmon_l F
-GLIBC_2.12 strfry F
-GLIBC_2.12 strftime F
-GLIBC_2.12 strftime_l F
-GLIBC_2.12 strlen F
-GLIBC_2.12 strncasecmp F
-GLIBC_2.12 strncasecmp_l F
-GLIBC_2.12 strncat F
-GLIBC_2.12 strncmp F
-GLIBC_2.12 strncpy F
-GLIBC_2.12 strndup F
-GLIBC_2.12 strnlen F
-GLIBC_2.12 strpbrk F
-GLIBC_2.12 strptime F
-GLIBC_2.12 strptime_l F
-GLIBC_2.12 strrchr F
-GLIBC_2.12 strsep F
-GLIBC_2.12 strsignal F
-GLIBC_2.12 strspn F
-GLIBC_2.12 strstr F
-GLIBC_2.12 strtod F
-GLIBC_2.12 strtod_l F
-GLIBC_2.12 strtof F
-GLIBC_2.12 strtof_l F
-GLIBC_2.12 strtoimax F
-GLIBC_2.12 strtok F
-GLIBC_2.12 strtok_r F
-GLIBC_2.12 strtol F
-GLIBC_2.12 strtol_l F
-GLIBC_2.12 strtold F
-GLIBC_2.12 strtold_l F
-GLIBC_2.12 strtoll F
-GLIBC_2.12 strtoll_l F
-GLIBC_2.12 strtoq F
-GLIBC_2.12 strtoul F
-GLIBC_2.12 strtoul_l F
-GLIBC_2.12 strtoull F
-GLIBC_2.12 strtoull_l F
-GLIBC_2.12 strtoumax F
-GLIBC_2.12 strtouq F
-GLIBC_2.12 strverscmp F
-GLIBC_2.12 strxfrm F
-GLIBC_2.12 strxfrm_l F
-GLIBC_2.12 stty F
-GLIBC_2.12 svc_exit F
-GLIBC_2.12 svc_fdset D 0x80
-GLIBC_2.12 svc_getreq F
-GLIBC_2.12 svc_getreq_common F
-GLIBC_2.12 svc_getreq_poll F
-GLIBC_2.12 svc_getreqset F
-GLIBC_2.12 svc_max_pollfd D 0x4
-GLIBC_2.12 svc_pollfd D 0x4
-GLIBC_2.12 svc_register F
-GLIBC_2.12 svc_run F
-GLIBC_2.12 svc_sendreply F
-GLIBC_2.12 svc_unregister F
-GLIBC_2.12 svcauthdes_stats D 0xc
-GLIBC_2.12 svcerr_auth F
-GLIBC_2.12 svcerr_decode F
-GLIBC_2.12 svcerr_noproc F
-GLIBC_2.12 svcerr_noprog F
-GLIBC_2.12 svcerr_progvers F
-GLIBC_2.12 svcerr_systemerr F
-GLIBC_2.12 svcerr_weakauth F
-GLIBC_2.12 svcfd_create F
-GLIBC_2.12 svcraw_create F
-GLIBC_2.12 svctcp_create F
-GLIBC_2.12 svcudp_bufcreate F
-GLIBC_2.12 svcudp_create F
-GLIBC_2.12 svcudp_enablecache F
-GLIBC_2.12 svcunix_create F
-GLIBC_2.12 svcunixfd_create F
-GLIBC_2.12 swab F
-GLIBC_2.12 swapcontext F
-GLIBC_2.12 swapoff F
-GLIBC_2.12 swapon F
-GLIBC_2.12 swprintf F
-GLIBC_2.12 swscanf F
-GLIBC_2.12 symlink F
-GLIBC_2.12 symlinkat F
-GLIBC_2.12 sync F
-GLIBC_2.12 sync_file_range F
-GLIBC_2.12 sys_errlist D 0x21c
-GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.12 sys_sigabbrev D 0x104
-GLIBC_2.12 sys_siglist D 0x104
-GLIBC_2.12 syscall F
-GLIBC_2.12 sysconf F
-GLIBC_2.12 sysctl F
-GLIBC_2.12 sysinfo F
-GLIBC_2.12 syslog F
-GLIBC_2.12 system F
-GLIBC_2.12 sysv_signal F
-GLIBC_2.12 tcdrain F
-GLIBC_2.12 tcflow F
-GLIBC_2.12 tcflush F
-GLIBC_2.12 tcgetattr F
-GLIBC_2.12 tcgetpgrp F
-GLIBC_2.12 tcgetsid F
-GLIBC_2.12 tcsendbreak F
-GLIBC_2.12 tcsetattr F
-GLIBC_2.12 tcsetpgrp F
-GLIBC_2.12 tdelete F
-GLIBC_2.12 tdestroy F
-GLIBC_2.12 tee F
-GLIBC_2.12 telldir F
-GLIBC_2.12 tempnam F
-GLIBC_2.12 textdomain F
-GLIBC_2.12 tfind F
-GLIBC_2.12 time F
-GLIBC_2.12 timegm F
-GLIBC_2.12 timelocal F
-GLIBC_2.12 timerfd_create F
-GLIBC_2.12 timerfd_gettime F
-GLIBC_2.12 timerfd_settime F
-GLIBC_2.12 times F
-GLIBC_2.12 timezone D 0x4
-GLIBC_2.12 tmpfile F
-GLIBC_2.12 tmpfile64 F
-GLIBC_2.12 tmpnam F
-GLIBC_2.12 tmpnam_r F
-GLIBC_2.12 toascii F
-GLIBC_2.12 tolower F
-GLIBC_2.12 tolower_l F
-GLIBC_2.12 toupper F
-GLIBC_2.12 toupper_l F
-GLIBC_2.12 towctrans F
-GLIBC_2.12 towctrans_l F
-GLIBC_2.12 towlower F
-GLIBC_2.12 towlower_l F
-GLIBC_2.12 towupper F
-GLIBC_2.12 towupper_l F
-GLIBC_2.12 tr_break F
-GLIBC_2.12 truncate F
-GLIBC_2.12 truncate64 F
-GLIBC_2.12 tsearch F
-GLIBC_2.12 ttyname F
-GLIBC_2.12 ttyname_r F
-GLIBC_2.12 ttyslot F
-GLIBC_2.12 twalk F
-GLIBC_2.12 tzname D 0x8
-GLIBC_2.12 tzset F
-GLIBC_2.12 ualarm F
-GLIBC_2.12 ulckpwdf F
-GLIBC_2.12 ulimit F
-GLIBC_2.12 umask F
-GLIBC_2.12 umount F
-GLIBC_2.12 umount2 F
-GLIBC_2.12 uname F
-GLIBC_2.12 ungetc F
-GLIBC_2.12 ungetwc F
-GLIBC_2.12 unlink F
-GLIBC_2.12 unlinkat F
-GLIBC_2.12 unlockpt F
-GLIBC_2.12 unsetenv F
-GLIBC_2.12 unshare F
-GLIBC_2.12 updwtmp F
-GLIBC_2.12 updwtmpx F
-GLIBC_2.12 uselib F
-GLIBC_2.12 uselocale F
-GLIBC_2.12 user2netname F
-GLIBC_2.12 usleep F
-GLIBC_2.12 ustat F
-GLIBC_2.12 utime F
-GLIBC_2.12 utimensat F
-GLIBC_2.12 utimes F
-GLIBC_2.12 utmpname F
-GLIBC_2.12 utmpxname F
-GLIBC_2.12 valloc F
-GLIBC_2.12 vasprintf F
-GLIBC_2.12 vdprintf F
-GLIBC_2.12 verr F
-GLIBC_2.12 verrx F
-GLIBC_2.12 versionsort F
-GLIBC_2.12 versionsort64 F
-GLIBC_2.12 vfork F
-GLIBC_2.12 vfprintf F
-GLIBC_2.12 vfscanf F
-GLIBC_2.12 vfwprintf F
-GLIBC_2.12 vfwscanf F
-GLIBC_2.12 vhangup F
-GLIBC_2.12 vlimit F
-GLIBC_2.12 vmsplice F
-GLIBC_2.12 vprintf F
-GLIBC_2.12 vscanf F
-GLIBC_2.12 vsnprintf F
-GLIBC_2.12 vsprintf F
-GLIBC_2.12 vsscanf F
-GLIBC_2.12 vswprintf F
-GLIBC_2.12 vswscanf F
-GLIBC_2.12 vsyslog F
-GLIBC_2.12 vtimes F
-GLIBC_2.12 vwarn F
-GLIBC_2.12 vwarnx F
-GLIBC_2.12 vwprintf F
-GLIBC_2.12 vwscanf F
-GLIBC_2.12 wait F
-GLIBC_2.12 wait3 F
-GLIBC_2.12 wait4 F
-GLIBC_2.12 waitid F
-GLIBC_2.12 waitpid F
-GLIBC_2.12 warn F
-GLIBC_2.12 warnx F
-GLIBC_2.12 wcpcpy F
-GLIBC_2.12 wcpncpy F
-GLIBC_2.12 wcrtomb F
-GLIBC_2.12 wcscasecmp F
-GLIBC_2.12 wcscasecmp_l F
-GLIBC_2.12 wcscat F
-GLIBC_2.12 wcschr F
-GLIBC_2.12 wcschrnul F
-GLIBC_2.12 wcscmp F
-GLIBC_2.12 wcscoll F
-GLIBC_2.12 wcscoll_l F
-GLIBC_2.12 wcscpy F
-GLIBC_2.12 wcscspn F
-GLIBC_2.12 wcsdup F
-GLIBC_2.12 wcsftime F
-GLIBC_2.12 wcsftime_l F
-GLIBC_2.12 wcslen F
-GLIBC_2.12 wcsncasecmp F
-GLIBC_2.12 wcsncasecmp_l F
-GLIBC_2.12 wcsncat F
-GLIBC_2.12 wcsncmp F
-GLIBC_2.12 wcsncpy F
-GLIBC_2.12 wcsnlen F
-GLIBC_2.12 wcsnrtombs F
-GLIBC_2.12 wcspbrk F
-GLIBC_2.12 wcsrchr F
-GLIBC_2.12 wcsrtombs F
-GLIBC_2.12 wcsspn F
-GLIBC_2.12 wcsstr F
-GLIBC_2.12 wcstod F
-GLIBC_2.12 wcstod_l F
-GLIBC_2.12 wcstof F
-GLIBC_2.12 wcstof_l F
-GLIBC_2.12 wcstoimax F
-GLIBC_2.12 wcstok F
-GLIBC_2.12 wcstol F
-GLIBC_2.12 wcstol_l F
-GLIBC_2.12 wcstold F
-GLIBC_2.12 wcstold_l F
-GLIBC_2.12 wcstoll F
-GLIBC_2.12 wcstoll_l F
-GLIBC_2.12 wcstombs F
-GLIBC_2.12 wcstoq F
-GLIBC_2.12 wcstoul F
-GLIBC_2.12 wcstoul_l F
-GLIBC_2.12 wcstoull F
-GLIBC_2.12 wcstoull_l F
-GLIBC_2.12 wcstoumax F
-GLIBC_2.12 wcstouq F
-GLIBC_2.12 wcswcs F
-GLIBC_2.12 wcswidth F
-GLIBC_2.12 wcsxfrm F
-GLIBC_2.12 wcsxfrm_l F
-GLIBC_2.12 wctob F
-GLIBC_2.12 wctomb F
-GLIBC_2.12 wctrans F
-GLIBC_2.12 wctrans_l F
-GLIBC_2.12 wctype F
-GLIBC_2.12 wctype_l F
-GLIBC_2.12 wcwidth F
-GLIBC_2.12 wmemchr F
-GLIBC_2.12 wmemcmp F
-GLIBC_2.12 wmemcpy F
-GLIBC_2.12 wmemmove F
-GLIBC_2.12 wmempcpy F
-GLIBC_2.12 wmemset F
-GLIBC_2.12 wordexp F
-GLIBC_2.12 wordfree F
-GLIBC_2.12 wprintf F
-GLIBC_2.12 write F
-GLIBC_2.12 writev F
-GLIBC_2.12 wscanf F
-GLIBC_2.12 xdecrypt F
-GLIBC_2.12 xdr_accepted_reply F
-GLIBC_2.12 xdr_array F
-GLIBC_2.12 xdr_authdes_cred F
-GLIBC_2.12 xdr_authdes_verf F
-GLIBC_2.12 xdr_authunix_parms F
-GLIBC_2.12 xdr_bool F
-GLIBC_2.12 xdr_bytes F
-GLIBC_2.12 xdr_callhdr F
-GLIBC_2.12 xdr_callmsg F
-GLIBC_2.12 xdr_char F
-GLIBC_2.12 xdr_cryptkeyarg F
-GLIBC_2.12 xdr_cryptkeyarg2 F
-GLIBC_2.12 xdr_cryptkeyres F
-GLIBC_2.12 xdr_des_block F
-GLIBC_2.12 xdr_double F
-GLIBC_2.12 xdr_enum F
-GLIBC_2.12 xdr_float F
-GLIBC_2.12 xdr_free F
-GLIBC_2.12 xdr_getcredres F
-GLIBC_2.12 xdr_hyper F
-GLIBC_2.12 xdr_int F
-GLIBC_2.12 xdr_int16_t F
-GLIBC_2.12 xdr_int32_t F
-GLIBC_2.12 xdr_int64_t F
-GLIBC_2.12 xdr_int8_t F
-GLIBC_2.12 xdr_key_netstarg F
-GLIBC_2.12 xdr_key_netstres F
-GLIBC_2.12 xdr_keybuf F
-GLIBC_2.12 xdr_keystatus F
-GLIBC_2.12 xdr_long F
-GLIBC_2.12 xdr_longlong_t F
-GLIBC_2.12 xdr_netnamestr F
-GLIBC_2.12 xdr_netobj F
-GLIBC_2.12 xdr_opaque F
-GLIBC_2.12 xdr_opaque_auth F
-GLIBC_2.12 xdr_pmap F
-GLIBC_2.12 xdr_pmaplist F
-GLIBC_2.12 xdr_pointer F
-GLIBC_2.12 xdr_quad_t F
-GLIBC_2.12 xdr_reference F
-GLIBC_2.12 xdr_rejected_reply F
-GLIBC_2.12 xdr_replymsg F
-GLIBC_2.12 xdr_rmtcall_args F
-GLIBC_2.12 xdr_rmtcallres F
-GLIBC_2.12 xdr_short F
-GLIBC_2.12 xdr_sizeof F
-GLIBC_2.12 xdr_string F
-GLIBC_2.12 xdr_u_char F
-GLIBC_2.12 xdr_u_hyper F
-GLIBC_2.12 xdr_u_int F
-GLIBC_2.12 xdr_u_long F
-GLIBC_2.12 xdr_u_longlong_t F
-GLIBC_2.12 xdr_u_quad_t F
-GLIBC_2.12 xdr_u_short F
-GLIBC_2.12 xdr_uint16_t F
-GLIBC_2.12 xdr_uint32_t F
-GLIBC_2.12 xdr_uint64_t F
-GLIBC_2.12 xdr_uint8_t F
-GLIBC_2.12 xdr_union F
-GLIBC_2.12 xdr_unixcred F
-GLIBC_2.12 xdr_vector F
-GLIBC_2.12 xdr_void F
-GLIBC_2.12 xdr_wrapstring F
-GLIBC_2.12 xdrmem_create F
-GLIBC_2.12 xdrrec_create F
-GLIBC_2.12 xdrrec_endofrecord F
-GLIBC_2.12 xdrrec_eof F
-GLIBC_2.12 xdrrec_skiprecord F
-GLIBC_2.12 xdrstdio_create F
-GLIBC_2.12 xencrypt F
-GLIBC_2.12 xprt_register F
-GLIBC_2.12 xprt_unregister F
-GLIBC_2.15 GLIBC_2.15 A
-GLIBC_2.15 __fdelt_chk F
-GLIBC_2.15 __fdelt_warn F
-GLIBC_2.15 clock_adjtime F
-GLIBC_2.15 fanotify_init F
-GLIBC_2.15 fanotify_mark F
-GLIBC_2.15 name_to_handle_at F
-GLIBC_2.15 open_by_handle_at F
-GLIBC_2.15 posix_spawn F
-GLIBC_2.15 posix_spawnp F
-GLIBC_2.15 prlimit F
-GLIBC_2.15 prlimit64 F
-GLIBC_2.15 process_vm_readv F
-GLIBC_2.15 process_vm_writev F
-GLIBC_2.15 scandirat F
-GLIBC_2.15 scandirat64 F
-GLIBC_2.15 sendmmsg F
-GLIBC_2.15 setns F
-GLIBC_2.15 syncfs F
-GLIBC_2.16 GLIBC_2.16 A
-GLIBC_2.16 __getauxval F
-GLIBC_2.16 __poll_chk F
-GLIBC_2.16 __ppoll_chk F
-GLIBC_2.16 aligned_alloc F
-GLIBC_2.16 c16rtomb F
-GLIBC_2.16 c32rtomb F
-GLIBC_2.16 getauxval F
-GLIBC_2.16 mbrtoc16 F
-GLIBC_2.16 mbrtoc32 F
-GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
-GLIBC_2.17 clock_getcpuclockid F
-GLIBC_2.17 clock_getres F
-GLIBC_2.17 clock_gettime F
-GLIBC_2.17 clock_nanosleep F
-GLIBC_2.17 clock_settime F
-GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
-GLIBC_2.23 fts64_children F
-GLIBC_2.23 fts64_close F
-GLIBC_2.23 fts64_open F
-GLIBC_2.23 fts64_read F
-GLIBC_2.23 fts64_set F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libcrypt.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libcrypt.abilist
deleted file mode 100644
index d5643802b7..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libcrypt.abilist
+++ /dev/null
@@ -1,8 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 crypt F
-GLIBC_2.12 crypt_r F
-GLIBC_2.12 encrypt F
-GLIBC_2.12 encrypt_r F
-GLIBC_2.12 fcrypt F
-GLIBC_2.12 setkey F
-GLIBC_2.12 setkey_r F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libdl.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libdl.abilist
deleted file mode 100644
index cabc30c239..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libdl.abilist
+++ /dev/null
@@ -1,10 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 dladdr F
-GLIBC_2.12 dladdr1 F
-GLIBC_2.12 dlclose F
-GLIBC_2.12 dlerror F
-GLIBC_2.12 dlinfo F
-GLIBC_2.12 dlmopen F
-GLIBC_2.12 dlopen F
-GLIBC_2.12 dlsym F
-GLIBC_2.12 dlvsym F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist
deleted file mode 100644
index 18b8d00bec..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist
+++ /dev/null
@@ -1,375 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 _LIB_VERSION D 0x4
-GLIBC_2.12 __clog10 F
-GLIBC_2.12 __clog10f F
-GLIBC_2.12 __clog10l F
-GLIBC_2.12 __finite F
-GLIBC_2.12 __finitef F
-GLIBC_2.12 __fpclassify F
-GLIBC_2.12 __fpclassifyf F
-GLIBC_2.12 __signbit F
-GLIBC_2.12 __signbitf F
-GLIBC_2.12 acos F
-GLIBC_2.12 acosf F
-GLIBC_2.12 acosh F
-GLIBC_2.12 acoshf F
-GLIBC_2.12 acoshl F
-GLIBC_2.12 acosl F
-GLIBC_2.12 asin F
-GLIBC_2.12 asinf F
-GLIBC_2.12 asinh F
-GLIBC_2.12 asinhf F
-GLIBC_2.12 asinhl F
-GLIBC_2.12 asinl F
-GLIBC_2.12 atan F
-GLIBC_2.12 atan2 F
-GLIBC_2.12 atan2f F
-GLIBC_2.12 atan2l F
-GLIBC_2.12 atanf F
-GLIBC_2.12 atanh F
-GLIBC_2.12 atanhf F
-GLIBC_2.12 atanhl F
-GLIBC_2.12 atanl F
-GLIBC_2.12 cabs F
-GLIBC_2.12 cabsf F
-GLIBC_2.12 cabsl F
-GLIBC_2.12 cacos F
-GLIBC_2.12 cacosf F
-GLIBC_2.12 cacosh F
-GLIBC_2.12 cacoshf F
-GLIBC_2.12 cacoshl F
-GLIBC_2.12 cacosl F
-GLIBC_2.12 carg F
-GLIBC_2.12 cargf F
-GLIBC_2.12 cargl F
-GLIBC_2.12 casin F
-GLIBC_2.12 casinf F
-GLIBC_2.12 casinh F
-GLIBC_2.12 casinhf F
-GLIBC_2.12 casinhl F
-GLIBC_2.12 casinl F
-GLIBC_2.12 catan F
-GLIBC_2.12 catanf F
-GLIBC_2.12 catanh F
-GLIBC_2.12 catanhf F
-GLIBC_2.12 catanhl F
-GLIBC_2.12 catanl F
-GLIBC_2.12 cbrt F
-GLIBC_2.12 cbrtf F
-GLIBC_2.12 cbrtl F
-GLIBC_2.12 ccos F
-GLIBC_2.12 ccosf F
-GLIBC_2.12 ccosh F
-GLIBC_2.12 ccoshf F
-GLIBC_2.12 ccoshl F
-GLIBC_2.12 ccosl F
-GLIBC_2.12 ceil F
-GLIBC_2.12 ceilf F
-GLIBC_2.12 ceill F
-GLIBC_2.12 cexp F
-GLIBC_2.12 cexpf F
-GLIBC_2.12 cexpl F
-GLIBC_2.12 cimag F
-GLIBC_2.12 cimagf F
-GLIBC_2.12 cimagl F
-GLIBC_2.12 clog F
-GLIBC_2.12 clog10 F
-GLIBC_2.12 clog10f F
-GLIBC_2.12 clog10l F
-GLIBC_2.12 clogf F
-GLIBC_2.12 clogl F
-GLIBC_2.12 conj F
-GLIBC_2.12 conjf F
-GLIBC_2.12 conjl F
-GLIBC_2.12 copysign F
-GLIBC_2.12 copysignf F
-GLIBC_2.12 copysignl F
-GLIBC_2.12 cos F
-GLIBC_2.12 cosf F
-GLIBC_2.12 cosh F
-GLIBC_2.12 coshf F
-GLIBC_2.12 coshl F
-GLIBC_2.12 cosl F
-GLIBC_2.12 cpow F
-GLIBC_2.12 cpowf F
-GLIBC_2.12 cpowl F
-GLIBC_2.12 cproj F
-GLIBC_2.12 cprojf F
-GLIBC_2.12 cprojl F
-GLIBC_2.12 creal F
-GLIBC_2.12 crealf F
-GLIBC_2.12 creall F
-GLIBC_2.12 csin F
-GLIBC_2.12 csinf F
-GLIBC_2.12 csinh F
-GLIBC_2.12 csinhf F
-GLIBC_2.12 csinhl F
-GLIBC_2.12 csinl F
-GLIBC_2.12 csqrt F
-GLIBC_2.12 csqrtf F
-GLIBC_2.12 csqrtl F
-GLIBC_2.12 ctan F
-GLIBC_2.12 ctanf F
-GLIBC_2.12 ctanh F
-GLIBC_2.12 ctanhf F
-GLIBC_2.12 ctanhl F
-GLIBC_2.12 ctanl F
-GLIBC_2.12 drem F
-GLIBC_2.12 dremf F
-GLIBC_2.12 dreml F
-GLIBC_2.12 erf F
-GLIBC_2.12 erfc F
-GLIBC_2.12 erfcf F
-GLIBC_2.12 erfcl F
-GLIBC_2.12 erff F
-GLIBC_2.12 erfl F
-GLIBC_2.12 exp F
-GLIBC_2.12 exp10 F
-GLIBC_2.12 exp10f F
-GLIBC_2.12 exp10l F
-GLIBC_2.12 exp2 F
-GLIBC_2.12 exp2f F
-GLIBC_2.12 exp2l F
-GLIBC_2.12 expf F
-GLIBC_2.12 expl F
-GLIBC_2.12 expm1 F
-GLIBC_2.12 expm1f F
-GLIBC_2.12 expm1l F
-GLIBC_2.12 fabs F
-GLIBC_2.12 fabsf F
-GLIBC_2.12 fabsl F
-GLIBC_2.12 fdim F
-GLIBC_2.12 fdimf F
-GLIBC_2.12 fdiml F
-GLIBC_2.12 feclearexcept F
-GLIBC_2.12 fedisableexcept F
-GLIBC_2.12 feenableexcept F
-GLIBC_2.12 fegetenv F
-GLIBC_2.12 fegetexcept F
-GLIBC_2.12 fegetexceptflag F
-GLIBC_2.12 fegetround F
-GLIBC_2.12 feholdexcept F
-GLIBC_2.12 feraiseexcept F
-GLIBC_2.12 fesetenv F
-GLIBC_2.12 fesetexceptflag F
-GLIBC_2.12 fesetround F
-GLIBC_2.12 fetestexcept F
-GLIBC_2.12 feupdateenv F
-GLIBC_2.12 finite F
-GLIBC_2.12 finitef F
-GLIBC_2.12 finitel F
-GLIBC_2.12 floor F
-GLIBC_2.12 floorf F
-GLIBC_2.12 floorl F
-GLIBC_2.12 fma F
-GLIBC_2.12 fmaf F
-GLIBC_2.12 fmal F
-GLIBC_2.12 fmax F
-GLIBC_2.12 fmaxf F
-GLIBC_2.12 fmaxl F
-GLIBC_2.12 fmin F
-GLIBC_2.12 fminf F
-GLIBC_2.12 fminl F
-GLIBC_2.12 fmod F
-GLIBC_2.12 fmodf F
-GLIBC_2.12 fmodl F
-GLIBC_2.12 frexp F
-GLIBC_2.12 frexpf F
-GLIBC_2.12 frexpl F
-GLIBC_2.12 gamma F
-GLIBC_2.12 gammaf F
-GLIBC_2.12 gammal F
-GLIBC_2.12 hypot F
-GLIBC_2.12 hypotf F
-GLIBC_2.12 hypotl F
-GLIBC_2.12 ilogb F
-GLIBC_2.12 ilogbf F
-GLIBC_2.12 ilogbl F
-GLIBC_2.12 j0 F
-GLIBC_2.12 j0f F
-GLIBC_2.12 j0l F
-GLIBC_2.12 j1 F
-GLIBC_2.12 j1f F
-GLIBC_2.12 j1l F
-GLIBC_2.12 jn F
-GLIBC_2.12 jnf F
-GLIBC_2.12 jnl F
-GLIBC_2.12 ldexp F
-GLIBC_2.12 ldexpf F
-GLIBC_2.12 ldexpl F
-GLIBC_2.12 lgamma F
-GLIBC_2.12 lgamma_r F
-GLIBC_2.12 lgammaf F
-GLIBC_2.12 lgammaf_r F
-GLIBC_2.12 lgammal F
-GLIBC_2.12 lgammal_r F
-GLIBC_2.12 llrint F
-GLIBC_2.12 llrintf F
-GLIBC_2.12 llrintl F
-GLIBC_2.12 llround F
-GLIBC_2.12 llroundf F
-GLIBC_2.12 llroundl F
-GLIBC_2.12 log F
-GLIBC_2.12 log10 F
-GLIBC_2.12 log10f F
-GLIBC_2.12 log10l F
-GLIBC_2.12 log1p F
-GLIBC_2.12 log1pf F
-GLIBC_2.12 log1pl F
-GLIBC_2.12 log2 F
-GLIBC_2.12 log2f F
-GLIBC_2.12 log2l F
-GLIBC_2.12 logb F
-GLIBC_2.12 logbf F
-GLIBC_2.12 logbl F
-GLIBC_2.12 logf F
-GLIBC_2.12 logl F
-GLIBC_2.12 lrint F
-GLIBC_2.12 lrintf F
-GLIBC_2.12 lrintl F
-GLIBC_2.12 lround F
-GLIBC_2.12 lroundf F
-GLIBC_2.12 lroundl F
-GLIBC_2.12 matherr F
-GLIBC_2.12 modf F
-GLIBC_2.12 modff F
-GLIBC_2.12 modfl F
-GLIBC_2.12 nan F
-GLIBC_2.12 nanf F
-GLIBC_2.12 nanl F
-GLIBC_2.12 nearbyint F
-GLIBC_2.12 nearbyintf F
-GLIBC_2.12 nearbyintl F
-GLIBC_2.12 nextafter F
-GLIBC_2.12 nextafterf F
-GLIBC_2.12 nextafterl F
-GLIBC_2.12 nexttoward F
-GLIBC_2.12 nexttowardf F
-GLIBC_2.12 nexttowardl F
-GLIBC_2.12 pow F
-GLIBC_2.12 pow10 F
-GLIBC_2.12 pow10f F
-GLIBC_2.12 pow10l F
-GLIBC_2.12 powf F
-GLIBC_2.12 powl F
-GLIBC_2.12 remainder F
-GLIBC_2.12 remainderf F
-GLIBC_2.12 remainderl F
-GLIBC_2.12 remquo F
-GLIBC_2.12 remquof F
-GLIBC_2.12 remquol F
-GLIBC_2.12 rint F
-GLIBC_2.12 rintf F
-GLIBC_2.12 rintl F
-GLIBC_2.12 round F
-GLIBC_2.12 roundf F
-GLIBC_2.12 roundl F
-GLIBC_2.12 scalb F
-GLIBC_2.12 scalbf F
-GLIBC_2.12 scalbl F
-GLIBC_2.12 scalbln F
-GLIBC_2.12 scalblnf F
-GLIBC_2.12 scalblnl F
-GLIBC_2.12 scalbn F
-GLIBC_2.12 scalbnf F
-GLIBC_2.12 scalbnl F
-GLIBC_2.12 signgam D 0x4
-GLIBC_2.12 significand F
-GLIBC_2.12 significandf F
-GLIBC_2.12 significandl F
-GLIBC_2.12 sin F
-GLIBC_2.12 sincos F
-GLIBC_2.12 sincosf F
-GLIBC_2.12 sincosl F
-GLIBC_2.12 sinf F
-GLIBC_2.12 sinh F
-GLIBC_2.12 sinhf F
-GLIBC_2.12 sinhl F
-GLIBC_2.12 sinl F
-GLIBC_2.12 sqrt F
-GLIBC_2.12 sqrtf F
-GLIBC_2.12 sqrtl F
-GLIBC_2.12 tan F
-GLIBC_2.12 tanf F
-GLIBC_2.12 tanh F
-GLIBC_2.12 tanhf F
-GLIBC_2.12 tanhl F
-GLIBC_2.12 tanl F
-GLIBC_2.12 tgamma F
-GLIBC_2.12 tgammaf F
-GLIBC_2.12 tgammal F
-GLIBC_2.12 trunc F
-GLIBC_2.12 truncf F
-GLIBC_2.12 truncl F
-GLIBC_2.12 y0 F
-GLIBC_2.12 y0f F
-GLIBC_2.12 y0l F
-GLIBC_2.12 y1 F
-GLIBC_2.12 y1f F
-GLIBC_2.12 y1l F
-GLIBC_2.12 yn F
-GLIBC_2.12 ynf F
-GLIBC_2.12 ynl F
-GLIBC_2.15 GLIBC_2.15 A
-GLIBC_2.15 __acos_finite F
-GLIBC_2.15 __acosf_finite F
-GLIBC_2.15 __acosh_finite F
-GLIBC_2.15 __acoshf_finite F
-GLIBC_2.15 __asin_finite F
-GLIBC_2.15 __asinf_finite F
-GLIBC_2.15 __atan2_finite F
-GLIBC_2.15 __atan2f_finite F
-GLIBC_2.15 __atanh_finite F
-GLIBC_2.15 __atanhf_finite F
-GLIBC_2.15 __cosh_finite F
-GLIBC_2.15 __coshf_finite F
-GLIBC_2.15 __exp10_finite F
-GLIBC_2.15 __exp10f_finite F
-GLIBC_2.15 __exp2_finite F
-GLIBC_2.15 __exp2f_finite F
-GLIBC_2.15 __exp_finite F
-GLIBC_2.15 __expf_finite F
-GLIBC_2.15 __fmod_finite F
-GLIBC_2.15 __fmodf_finite F
-GLIBC_2.15 __gamma_r_finite F
-GLIBC_2.15 __gammaf_r_finite F
-GLIBC_2.15 __hypot_finite F
-GLIBC_2.15 __hypotf_finite F
-GLIBC_2.15 __j0_finite F
-GLIBC_2.15 __j0f_finite F
-GLIBC_2.15 __j1_finite F
-GLIBC_2.15 __j1f_finite F
-GLIBC_2.15 __jn_finite F
-GLIBC_2.15 __jnf_finite F
-GLIBC_2.15 __lgamma_r_finite F
-GLIBC_2.15 __lgammaf_r_finite F
-GLIBC_2.15 __log10_finite F
-GLIBC_2.15 __log10f_finite F
-GLIBC_2.15 __log2_finite F
-GLIBC_2.15 __log2f_finite F
-GLIBC_2.15 __log_finite F
-GLIBC_2.15 __logf_finite F
-GLIBC_2.15 __pow_finite F
-GLIBC_2.15 __powf_finite F
-GLIBC_2.15 __remainder_finite F
-GLIBC_2.15 __remainderf_finite F
-GLIBC_2.15 __scalb_finite F
-GLIBC_2.15 __scalbf_finite F
-GLIBC_2.15 __sinh_finite F
-GLIBC_2.15 __sinhf_finite F
-GLIBC_2.15 __sqrt_finite F
-GLIBC_2.15 __sqrtf_finite F
-GLIBC_2.15 __y0_finite F
-GLIBC_2.15 __y0f_finite F
-GLIBC_2.15 __y1_finite F
-GLIBC_2.15 __y1f_finite F
-GLIBC_2.15 __yn_finite F
-GLIBC_2.15 __ynf_finite F
-GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 __issignaling F
-GLIBC_2.18 __issignalingf F
-GLIBC_2.23 GLIBC_2.23 A
-GLIBC_2.23 __signgam D 0x4
-GLIBC_2.23 lgamma F
-GLIBC_2.23 lgammaf F
-GLIBC_2.23 lgammal F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libnsl.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libnsl.abilist
deleted file mode 100644
index 0277e5c1a8..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libnsl.abilist
+++ /dev/null
@@ -1,122 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __free_fdresult F
-GLIBC_2.12 __nis_default_access F
-GLIBC_2.12 __nis_default_group F
-GLIBC_2.12 __nis_default_owner F
-GLIBC_2.12 __nis_default_ttl F
-GLIBC_2.12 __nis_finddirectory F
-GLIBC_2.12 __nis_hash F
-GLIBC_2.12 __nisbind_connect F
-GLIBC_2.12 __nisbind_create F
-GLIBC_2.12 __nisbind_destroy F
-GLIBC_2.12 __nisbind_next F
-GLIBC_2.12 __yp_check F
-GLIBC_2.12 nis_add F
-GLIBC_2.12 nis_add_entry F
-GLIBC_2.12 nis_addmember F
-GLIBC_2.12 nis_checkpoint F
-GLIBC_2.12 nis_clone_directory F
-GLIBC_2.12 nis_clone_object F
-GLIBC_2.12 nis_clone_result F
-GLIBC_2.12 nis_creategroup F
-GLIBC_2.12 nis_destroy_object F
-GLIBC_2.12 nis_destroygroup F
-GLIBC_2.12 nis_dir_cmp F
-GLIBC_2.12 nis_domain_of F
-GLIBC_2.12 nis_domain_of_r F
-GLIBC_2.12 nis_first_entry F
-GLIBC_2.12 nis_free_directory F
-GLIBC_2.12 nis_free_object F
-GLIBC_2.12 nis_free_request F
-GLIBC_2.12 nis_freenames F
-GLIBC_2.12 nis_freeresult F
-GLIBC_2.12 nis_freeservlist F
-GLIBC_2.12 nis_freetags F
-GLIBC_2.12 nis_getnames F
-GLIBC_2.12 nis_getservlist F
-GLIBC_2.12 nis_ismember F
-GLIBC_2.12 nis_leaf_of F
-GLIBC_2.12 nis_leaf_of_r F
-GLIBC_2.12 nis_lerror F
-GLIBC_2.12 nis_list F
-GLIBC_2.12 nis_local_directory F
-GLIBC_2.12 nis_local_group F
-GLIBC_2.12 nis_local_host F
-GLIBC_2.12 nis_local_principal F
-GLIBC_2.12 nis_lookup F
-GLIBC_2.12 nis_mkdir F
-GLIBC_2.12 nis_modify F
-GLIBC_2.12 nis_modify_entry F
-GLIBC_2.12 nis_name_of F
-GLIBC_2.12 nis_name_of_r F
-GLIBC_2.12 nis_next_entry F
-GLIBC_2.12 nis_perror F
-GLIBC_2.12 nis_ping F
-GLIBC_2.12 nis_print_directory F
-GLIBC_2.12 nis_print_entry F
-GLIBC_2.12 nis_print_group F
-GLIBC_2.12 nis_print_group_entry F
-GLIBC_2.12 nis_print_link F
-GLIBC_2.12 nis_print_object F
-GLIBC_2.12 nis_print_result F
-GLIBC_2.12 nis_print_rights F
-GLIBC_2.12 nis_print_table F
-GLIBC_2.12 nis_read_obj F
-GLIBC_2.12 nis_remove F
-GLIBC_2.12 nis_remove_entry F
-GLIBC_2.12 nis_removemember F
-GLIBC_2.12 nis_rmdir F
-GLIBC_2.12 nis_servstate F
-GLIBC_2.12 nis_sperrno F
-GLIBC_2.12 nis_sperror F
-GLIBC_2.12 nis_sperror_r F
-GLIBC_2.12 nis_stats F
-GLIBC_2.12 nis_verifygroup F
-GLIBC_2.12 nis_write_obj F
-GLIBC_2.12 readColdStartFile F
-GLIBC_2.12 writeColdStartFile F
-GLIBC_2.12 xdr_cback_data F
-GLIBC_2.12 xdr_domainname F
-GLIBC_2.12 xdr_keydat F
-GLIBC_2.12 xdr_mapname F
-GLIBC_2.12 xdr_obj_p F
-GLIBC_2.12 xdr_peername F
-GLIBC_2.12 xdr_valdat F
-GLIBC_2.12 xdr_yp_buf F
-GLIBC_2.12 xdr_ypall F
-GLIBC_2.12 xdr_ypbind_binding F
-GLIBC_2.12 xdr_ypbind_resp F
-GLIBC_2.12 xdr_ypbind_resptype F
-GLIBC_2.12 xdr_ypbind_setdom F
-GLIBC_2.12 xdr_ypdelete_args F
-GLIBC_2.12 xdr_ypmap_parms F
-GLIBC_2.12 xdr_ypmaplist F
-GLIBC_2.12 xdr_yppush_status F
-GLIBC_2.12 xdr_yppushresp_xfr F
-GLIBC_2.12 xdr_ypreq_key F
-GLIBC_2.12 xdr_ypreq_nokey F
-GLIBC_2.12 xdr_ypreq_xfr F
-GLIBC_2.12 xdr_ypresp_all F
-GLIBC_2.12 xdr_ypresp_key_val F
-GLIBC_2.12 xdr_ypresp_maplist F
-GLIBC_2.12 xdr_ypresp_master F
-GLIBC_2.12 xdr_ypresp_order F
-GLIBC_2.12 xdr_ypresp_val F
-GLIBC_2.12 xdr_ypresp_xfr F
-GLIBC_2.12 xdr_ypstat F
-GLIBC_2.12 xdr_ypupdate_args F
-GLIBC_2.12 xdr_ypxfrstat F
-GLIBC_2.12 yp_all F
-GLIBC_2.12 yp_bind F
-GLIBC_2.12 yp_first F
-GLIBC_2.12 yp_get_default_domain F
-GLIBC_2.12 yp_maplist F
-GLIBC_2.12 yp_master F
-GLIBC_2.12 yp_match F
-GLIBC_2.12 yp_next F
-GLIBC_2.12 yp_order F
-GLIBC_2.12 yp_unbind F
-GLIBC_2.12 yp_update F
-GLIBC_2.12 ypbinderr_string F
-GLIBC_2.12 yperr_string F
-GLIBC_2.12 ypprot_err F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libpthread.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libpthread.abilist
deleted file mode 100644
index d16158f938..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libpthread.abilist
+++ /dev/null
@@ -1,226 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 _IO_flockfile F
-GLIBC_2.12 _IO_ftrylockfile F
-GLIBC_2.12 _IO_funlockfile F
-GLIBC_2.12 __close F
-GLIBC_2.12 __connect F
-GLIBC_2.12 __errno_location F
-GLIBC_2.12 __fcntl F
-GLIBC_2.12 __fork F
-GLIBC_2.12 __h_errno_location F
-GLIBC_2.12 __libc_allocate_rtsig F
-GLIBC_2.12 __libc_current_sigrtmax F
-GLIBC_2.12 __libc_current_sigrtmin F
-GLIBC_2.12 __lseek F
-GLIBC_2.12 __nanosleep F
-GLIBC_2.12 __open F
-GLIBC_2.12 __open64 F
-GLIBC_2.12 __pread64 F
-GLIBC_2.12 __pthread_cleanup_routine F
-GLIBC_2.12 __pthread_getspecific F
-GLIBC_2.12 __pthread_key_create F
-GLIBC_2.12 __pthread_mutex_destroy F
-GLIBC_2.12 __pthread_mutex_init F
-GLIBC_2.12 __pthread_mutex_lock F
-GLIBC_2.12 __pthread_mutex_trylock F
-GLIBC_2.12 __pthread_mutex_unlock F
-GLIBC_2.12 __pthread_mutexattr_destroy F
-GLIBC_2.12 __pthread_mutexattr_init F
-GLIBC_2.12 __pthread_mutexattr_settype F
-GLIBC_2.12 __pthread_once F
-GLIBC_2.12 __pthread_register_cancel F
-GLIBC_2.12 __pthread_register_cancel_defer F
-GLIBC_2.12 __pthread_rwlock_destroy F
-GLIBC_2.12 __pthread_rwlock_init F
-GLIBC_2.12 __pthread_rwlock_rdlock F
-GLIBC_2.12 __pthread_rwlock_tryrdlock F
-GLIBC_2.12 __pthread_rwlock_trywrlock F
-GLIBC_2.12 __pthread_rwlock_unlock F
-GLIBC_2.12 __pthread_rwlock_wrlock F
-GLIBC_2.12 __pthread_setspecific F
-GLIBC_2.12 __pthread_unregister_cancel F
-GLIBC_2.12 __pthread_unregister_cancel_restore F
-GLIBC_2.12 __pthread_unwind_next F
-GLIBC_2.12 __pwrite64 F
-GLIBC_2.12 __read F
-GLIBC_2.12 __res_state F
-GLIBC_2.12 __send F
-GLIBC_2.12 __sigaction F
-GLIBC_2.12 __vfork F
-GLIBC_2.12 __wait F
-GLIBC_2.12 __write F
-GLIBC_2.12 _pthread_cleanup_pop F
-GLIBC_2.12 _pthread_cleanup_pop_restore F
-GLIBC_2.12 _pthread_cleanup_push F
-GLIBC_2.12 _pthread_cleanup_push_defer F
-GLIBC_2.12 accept F
-GLIBC_2.12 close F
-GLIBC_2.12 connect F
-GLIBC_2.12 fcntl F
-GLIBC_2.12 flockfile F
-GLIBC_2.12 fork F
-GLIBC_2.12 fsync F
-GLIBC_2.12 ftrylockfile F
-GLIBC_2.12 funlockfile F
-GLIBC_2.12 longjmp F
-GLIBC_2.12 lseek F
-GLIBC_2.12 lseek64 F
-GLIBC_2.12 msync F
-GLIBC_2.12 nanosleep F
-GLIBC_2.12 open F
-GLIBC_2.12 open64 F
-GLIBC_2.12 pause F
-GLIBC_2.12 pread F
-GLIBC_2.12 pread64 F
-GLIBC_2.12 pthread_attr_destroy F
-GLIBC_2.12 pthread_attr_getaffinity_np F
-GLIBC_2.12 pthread_attr_getdetachstate F
-GLIBC_2.12 pthread_attr_getguardsize F
-GLIBC_2.12 pthread_attr_getinheritsched F
-GLIBC_2.12 pthread_attr_getschedparam F
-GLIBC_2.12 pthread_attr_getschedpolicy F
-GLIBC_2.12 pthread_attr_getscope F
-GLIBC_2.12 pthread_attr_getstack F
-GLIBC_2.12 pthread_attr_getstackaddr F
-GLIBC_2.12 pthread_attr_getstacksize F
-GLIBC_2.12 pthread_attr_init F
-GLIBC_2.12 pthread_attr_setaffinity_np F
-GLIBC_2.12 pthread_attr_setdetachstate F
-GLIBC_2.12 pthread_attr_setguardsize F
-GLIBC_2.12 pthread_attr_setinheritsched F
-GLIBC_2.12 pthread_attr_setschedparam F
-GLIBC_2.12 pthread_attr_setschedpolicy F
-GLIBC_2.12 pthread_attr_setscope F
-GLIBC_2.12 pthread_attr_setstack F
-GLIBC_2.12 pthread_attr_setstackaddr F
-GLIBC_2.12 pthread_attr_setstacksize F
-GLIBC_2.12 pthread_barrier_destroy F
-GLIBC_2.12 pthread_barrier_init F
-GLIBC_2.12 pthread_barrier_wait F
-GLIBC_2.12 pthread_barrierattr_destroy F
-GLIBC_2.12 pthread_barrierattr_getpshared F
-GLIBC_2.12 pthread_barrierattr_init F
-GLIBC_2.12 pthread_barrierattr_setpshared F
-GLIBC_2.12 pthread_cancel F
-GLIBC_2.12 pthread_cond_broadcast F
-GLIBC_2.12 pthread_cond_destroy F
-GLIBC_2.12 pthread_cond_init F
-GLIBC_2.12 pthread_cond_signal F
-GLIBC_2.12 pthread_cond_timedwait F
-GLIBC_2.12 pthread_cond_wait F
-GLIBC_2.12 pthread_condattr_destroy F
-GLIBC_2.12 pthread_condattr_getclock F
-GLIBC_2.12 pthread_condattr_getpshared F
-GLIBC_2.12 pthread_condattr_init F
-GLIBC_2.12 pthread_condattr_setclock F
-GLIBC_2.12 pthread_condattr_setpshared F
-GLIBC_2.12 pthread_create F
-GLIBC_2.12 pthread_detach F
-GLIBC_2.12 pthread_equal F
-GLIBC_2.12 pthread_exit F
-GLIBC_2.12 pthread_getaffinity_np F
-GLIBC_2.12 pthread_getattr_np F
-GLIBC_2.12 pthread_getconcurrency F
-GLIBC_2.12 pthread_getcpuclockid F
-GLIBC_2.12 pthread_getname_np F
-GLIBC_2.12 pthread_getschedparam F
-GLIBC_2.12 pthread_getspecific F
-GLIBC_2.12 pthread_join F
-GLIBC_2.12 pthread_key_create F
-GLIBC_2.12 pthread_key_delete F
-GLIBC_2.12 pthread_kill F
-GLIBC_2.12 pthread_kill_other_threads_np F
-GLIBC_2.12 pthread_mutex_consistent F
-GLIBC_2.12 pthread_mutex_consistent_np F
-GLIBC_2.12 pthread_mutex_destroy F
-GLIBC_2.12 pthread_mutex_getprioceiling F
-GLIBC_2.12 pthread_mutex_init F
-GLIBC_2.12 pthread_mutex_lock F
-GLIBC_2.12 pthread_mutex_setprioceiling F
-GLIBC_2.12 pthread_mutex_timedlock F
-GLIBC_2.12 pthread_mutex_trylock F
-GLIBC_2.12 pthread_mutex_unlock F
-GLIBC_2.12 pthread_mutexattr_destroy F
-GLIBC_2.12 pthread_mutexattr_getkind_np F
-GLIBC_2.12 pthread_mutexattr_getprioceiling F
-GLIBC_2.12 pthread_mutexattr_getprotocol F
-GLIBC_2.12 pthread_mutexattr_getpshared F
-GLIBC_2.12 pthread_mutexattr_getrobust F
-GLIBC_2.12 pthread_mutexattr_getrobust_np F
-GLIBC_2.12 pthread_mutexattr_gettype F
-GLIBC_2.12 pthread_mutexattr_init F
-GLIBC_2.12 pthread_mutexattr_setkind_np F
-GLIBC_2.12 pthread_mutexattr_setprioceiling F
-GLIBC_2.12 pthread_mutexattr_setprotocol F
-GLIBC_2.12 pthread_mutexattr_setpshared F
-GLIBC_2.12 pthread_mutexattr_setrobust F
-GLIBC_2.12 pthread_mutexattr_setrobust_np F
-GLIBC_2.12 pthread_mutexattr_settype F
-GLIBC_2.12 pthread_once F
-GLIBC_2.12 pthread_rwlock_destroy F
-GLIBC_2.12 pthread_rwlock_init F
-GLIBC_2.12 pthread_rwlock_rdlock F
-GLIBC_2.12 pthread_rwlock_timedrdlock F
-GLIBC_2.12 pthread_rwlock_timedwrlock F
-GLIBC_2.12 pthread_rwlock_tryrdlock F
-GLIBC_2.12 pthread_rwlock_trywrlock F
-GLIBC_2.12 pthread_rwlock_unlock F
-GLIBC_2.12 pthread_rwlock_wrlock F
-GLIBC_2.12 pthread_rwlockattr_destroy F
-GLIBC_2.12 pthread_rwlockattr_getkind_np F
-GLIBC_2.12 pthread_rwlockattr_getpshared F
-GLIBC_2.12 pthread_rwlockattr_init F
-GLIBC_2.12 pthread_rwlockattr_setkind_np F
-GLIBC_2.12 pthread_rwlockattr_setpshared F
-GLIBC_2.12 pthread_self F
-GLIBC_2.12 pthread_setaffinity_np F
-GLIBC_2.12 pthread_setcancelstate F
-GLIBC_2.12 pthread_setcanceltype F
-GLIBC_2.12 pthread_setconcurrency F
-GLIBC_2.12 pthread_setname_np F
-GLIBC_2.12 pthread_setschedparam F
-GLIBC_2.12 pthread_setschedprio F
-GLIBC_2.12 pthread_setspecific F
-GLIBC_2.12 pthread_sigmask F
-GLIBC_2.12 pthread_sigqueue F
-GLIBC_2.12 pthread_spin_destroy F
-GLIBC_2.12 pthread_spin_init F
-GLIBC_2.12 pthread_spin_lock F
-GLIBC_2.12 pthread_spin_trylock F
-GLIBC_2.12 pthread_spin_unlock F
-GLIBC_2.12 pthread_testcancel F
-GLIBC_2.12 pthread_timedjoin_np F
-GLIBC_2.12 pthread_tryjoin_np F
-GLIBC_2.12 pthread_yield F
-GLIBC_2.12 pwrite F
-GLIBC_2.12 pwrite64 F
-GLIBC_2.12 raise F
-GLIBC_2.12 read F
-GLIBC_2.12 recv F
-GLIBC_2.12 recvfrom F
-GLIBC_2.12 recvmsg F
-GLIBC_2.12 sem_close F
-GLIBC_2.12 sem_destroy F
-GLIBC_2.12 sem_getvalue F
-GLIBC_2.12 sem_init F
-GLIBC_2.12 sem_open F
-GLIBC_2.12 sem_post F
-GLIBC_2.12 sem_timedwait F
-GLIBC_2.12 sem_trywait F
-GLIBC_2.12 sem_unlink F
-GLIBC_2.12 sem_wait F
-GLIBC_2.12 send F
-GLIBC_2.12 sendmsg F
-GLIBC_2.12 sendto F
-GLIBC_2.12 sigaction F
-GLIBC_2.12 siglongjmp F
-GLIBC_2.12 sigwait F
-GLIBC_2.12 system F
-GLIBC_2.12 tcdrain F
-GLIBC_2.12 vfork F
-GLIBC_2.12 wait F
-GLIBC_2.12 waitpid F
-GLIBC_2.12 write F
-GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 pthread_getattr_default_np F
-GLIBC_2.18 pthread_setattr_default_np F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libresolv.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libresolv.abilist
deleted file mode 100644
index aa2fefa6e4..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libresolv.abilist
+++ /dev/null
@@ -1,92 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __b64_ntop F
-GLIBC_2.12 __b64_pton F
-GLIBC_2.12 __dn_comp F
-GLIBC_2.12 __dn_count_labels F
-GLIBC_2.12 __dn_expand F
-GLIBC_2.12 __dn_skipname F
-GLIBC_2.12 __fp_nquery F
-GLIBC_2.12 __fp_query F
-GLIBC_2.12 __fp_resstat F
-GLIBC_2.12 __hostalias F
-GLIBC_2.12 __loc_aton F
-GLIBC_2.12 __loc_ntoa F
-GLIBC_2.12 __p_cdname F
-GLIBC_2.12 __p_cdnname F
-GLIBC_2.12 __p_class F
-GLIBC_2.12 __p_class_syms D 0x54
-GLIBC_2.12 __p_fqname F
-GLIBC_2.12 __p_fqnname F
-GLIBC_2.12 __p_option F
-GLIBC_2.12 __p_query F
-GLIBC_2.12 __p_rcode F
-GLIBC_2.12 __p_secstodate F
-GLIBC_2.12 __p_time F
-GLIBC_2.12 __p_type F
-GLIBC_2.12 __p_type_syms D 0x228
-GLIBC_2.12 __putlong F
-GLIBC_2.12 __putshort F
-GLIBC_2.12 __res_close F
-GLIBC_2.12 __res_dnok F
-GLIBC_2.12 __res_hnok F
-GLIBC_2.12 __res_hostalias F
-GLIBC_2.12 __res_isourserver F
-GLIBC_2.12 __res_mailok F
-GLIBC_2.12 __res_mkquery F
-GLIBC_2.12 __res_nameinquery F
-GLIBC_2.12 __res_nmkquery F
-GLIBC_2.12 __res_nquery F
-GLIBC_2.12 __res_nquerydomain F
-GLIBC_2.12 __res_nsearch F
-GLIBC_2.12 __res_nsend F
-GLIBC_2.12 __res_ownok F
-GLIBC_2.12 __res_queriesmatch F
-GLIBC_2.12 __res_query F
-GLIBC_2.12 __res_querydomain F
-GLIBC_2.12 __res_search F
-GLIBC_2.12 __res_send F
-GLIBC_2.12 __sym_ntop F
-GLIBC_2.12 __sym_ntos F
-GLIBC_2.12 __sym_ston F
-GLIBC_2.12 _gethtbyaddr F
-GLIBC_2.12 _gethtbyname F
-GLIBC_2.12 _gethtbyname2 F
-GLIBC_2.12 _gethtent F
-GLIBC_2.12 _getlong F
-GLIBC_2.12 _getshort F
-GLIBC_2.12 _res_opcodes D 0x40
-GLIBC_2.12 _sethtent F
-GLIBC_2.12 inet_net_ntop F
-GLIBC_2.12 inet_net_pton F
-GLIBC_2.12 inet_neta F
-GLIBC_2.12 ns_datetosecs F
-GLIBC_2.12 ns_format_ttl F
-GLIBC_2.12 ns_get16 F
-GLIBC_2.12 ns_get32 F
-GLIBC_2.12 ns_initparse F
-GLIBC_2.12 ns_makecanon F
-GLIBC_2.12 ns_msg_getflag F
-GLIBC_2.12 ns_name_compress F
-GLIBC_2.12 ns_name_ntol F
-GLIBC_2.12 ns_name_ntop F
-GLIBC_2.12 ns_name_pack F
-GLIBC_2.12 ns_name_pton F
-GLIBC_2.12 ns_name_rollback F
-GLIBC_2.12 ns_name_skip F
-GLIBC_2.12 ns_name_uncompress F
-GLIBC_2.12 ns_name_unpack F
-GLIBC_2.12 ns_parse_ttl F
-GLIBC_2.12 ns_parserr F
-GLIBC_2.12 ns_put16 F
-GLIBC_2.12 ns_put32 F
-GLIBC_2.12 ns_samedomain F
-GLIBC_2.12 ns_samename F
-GLIBC_2.12 ns_skiprr F
-GLIBC_2.12 ns_sprintrr F
-GLIBC_2.12 ns_sprintrrf F
-GLIBC_2.12 ns_subdomain F
-GLIBC_2.12 res_gethostbyaddr F
-GLIBC_2.12 res_gethostbyname F
-GLIBC_2.12 res_gethostbyname2 F
-GLIBC_2.12 res_send_setqhook F
-GLIBC_2.12 res_send_setrhook F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/librt.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/librt.abilist
deleted file mode 100644
index 14f5c8245d..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/librt.abilist
+++ /dev/null
@@ -1,41 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __mq_open_2 F
-GLIBC_2.12 aio_cancel F
-GLIBC_2.12 aio_cancel64 F
-GLIBC_2.12 aio_error F
-GLIBC_2.12 aio_error64 F
-GLIBC_2.12 aio_fsync F
-GLIBC_2.12 aio_fsync64 F
-GLIBC_2.12 aio_init F
-GLIBC_2.12 aio_read F
-GLIBC_2.12 aio_read64 F
-GLIBC_2.12 aio_return F
-GLIBC_2.12 aio_return64 F
-GLIBC_2.12 aio_suspend F
-GLIBC_2.12 aio_suspend64 F
-GLIBC_2.12 aio_write F
-GLIBC_2.12 aio_write64 F
-GLIBC_2.12 clock_getcpuclockid F
-GLIBC_2.12 clock_getres F
-GLIBC_2.12 clock_gettime F
-GLIBC_2.12 clock_nanosleep F
-GLIBC_2.12 clock_settime F
-GLIBC_2.12 lio_listio F
-GLIBC_2.12 lio_listio64 F
-GLIBC_2.12 mq_close F
-GLIBC_2.12 mq_getattr F
-GLIBC_2.12 mq_notify F
-GLIBC_2.12 mq_open F
-GLIBC_2.12 mq_receive F
-GLIBC_2.12 mq_send F
-GLIBC_2.12 mq_setattr F
-GLIBC_2.12 mq_timedreceive F
-GLIBC_2.12 mq_timedsend F
-GLIBC_2.12 mq_unlink F
-GLIBC_2.12 shm_open F
-GLIBC_2.12 shm_unlink F
-GLIBC_2.12 timer_create F
-GLIBC_2.12 timer_delete F
-GLIBC_2.12 timer_getoverrun F
-GLIBC_2.12 timer_gettime F
-GLIBC_2.12 timer_settime F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libthread_db.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libthread_db.abilist
deleted file mode 100644
index 4aade0b7e0..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libthread_db.abilist
+++ /dev/null
@@ -1,41 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 td_init F
-GLIBC_2.12 td_log F
-GLIBC_2.12 td_symbol_list F
-GLIBC_2.12 td_ta_clear_event F
-GLIBC_2.12 td_ta_delete F
-GLIBC_2.12 td_ta_enable_stats F
-GLIBC_2.12 td_ta_event_addr F
-GLIBC_2.12 td_ta_event_getmsg F
-GLIBC_2.12 td_ta_get_nthreads F
-GLIBC_2.12 td_ta_get_ph F
-GLIBC_2.12 td_ta_get_stats F
-GLIBC_2.12 td_ta_map_id2thr F
-GLIBC_2.12 td_ta_map_lwp2thr F
-GLIBC_2.12 td_ta_new F
-GLIBC_2.12 td_ta_reset_stats F
-GLIBC_2.12 td_ta_set_event F
-GLIBC_2.12 td_ta_setconcurrency F
-GLIBC_2.12 td_ta_thr_iter F
-GLIBC_2.12 td_ta_tsd_iter F
-GLIBC_2.12 td_thr_clear_event F
-GLIBC_2.12 td_thr_dbresume F
-GLIBC_2.12 td_thr_dbsuspend F
-GLIBC_2.12 td_thr_event_enable F
-GLIBC_2.12 td_thr_event_getmsg F
-GLIBC_2.12 td_thr_get_info F
-GLIBC_2.12 td_thr_getfpregs F
-GLIBC_2.12 td_thr_getgregs F
-GLIBC_2.12 td_thr_getxregs F
-GLIBC_2.12 td_thr_getxregsize F
-GLIBC_2.12 td_thr_set_event F
-GLIBC_2.12 td_thr_setfpregs F
-GLIBC_2.12 td_thr_setgregs F
-GLIBC_2.12 td_thr_setprio F
-GLIBC_2.12 td_thr_setsigpending F
-GLIBC_2.12 td_thr_setxregs F
-GLIBC_2.12 td_thr_sigsetmask F
-GLIBC_2.12 td_thr_tls_get_addr F
-GLIBC_2.12 td_thr_tlsbase F
-GLIBC_2.12 td_thr_tsd F
-GLIBC_2.12 td_thr_validate F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libutil.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libutil.abilist
deleted file mode 100644
index e4d432643c..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libutil.abilist
+++ /dev/null
@@ -1,7 +0,0 @@
-GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 forkpty F
-GLIBC_2.12 login F
-GLIBC_2.12 login_tty F
-GLIBC_2.12 logout F
-GLIBC_2.12 logwtmp F
-GLIBC_2.12 openpty F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/register-dump.h b/sysdeps/unix/sysv/linux/tile/tilepro/register-dump.h
deleted file mode 100644
index 59f9a9b617..0000000000
--- a/sysdeps/unix/sysv/linux/tile/tilepro/register-dump.h
+++ /dev/null
@@ -1,111 +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.
- Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 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/>. */
-
-#include <sys/uio.h>
-#include <_itoa.h>
-
-/* We will print the register dump in this format:
-
- R0: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
- R8: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
- R16: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
- R24: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
- R32: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
- R40: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
- R48: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
- R52: XXXXXXXX TP: XXXXXXXX SP: XXXXXXXX LR: XXXXXXXX
-
- PC: XXXXXXXX ICS: X FAULTNUM: XX
-
- */
-
-static void
-hexvalue (unsigned long int value, char *buf, size_t len)
-{
- char *cp = _itoa_word (value, buf + len, 16, 0);
- while (cp > buf)
- *--cp = '0';
-}
-
-static void
-register_dump (int fd, mcontext_t *ctx)
-{
- char regs[59][8];
- struct iovec iov[143];
- size_t nr = 0;
- unsigned int i;
-
-#define ADD_STRING(str) \
- iov[nr].iov_base = (char *) str; \
- iov[nr].iov_len = strlen (str); \
- ++nr
-#define ADD_MEM(str, len) \
- iov[nr].iov_base = str; \
- iov[nr].iov_len = len; \
- ++nr
-
- /* Generate strings of register contents. */
- for (i = 0; i < 56; ++i)
- hexvalue (ctx->gregs[i], regs[i], 8);
- hexvalue (ctx->pc, regs[56], 8);
- hexvalue (ctx->ics, regs[57], 1);
- hexvalue (ctx->faultnum, regs[58], 2);
-
- /* Generate the output. */
- for (i = 0; i < 52;)
- {
- const char *prefixes[] = {
- "Register dump:\n\n R0: ",
- "\n R8: ",
- "\n R16: ",
- "\n R24: ",
- "\n R32: ",
- "\n R40: ",
- "\n R48: "
- };
- ADD_STRING (prefixes[i / 8]);
- do
- {
- ADD_MEM (regs[i], 8);
- ADD_STRING (" ");
- }
- while (++i % 8 && i < 52);
- }
- ADD_STRING ("\n R52: ");
- ADD_MEM (regs[52], 8);
- ADD_STRING (" TP: ");
- ADD_MEM (regs[53], 8);
- ADD_STRING (" SP: ");
- ADD_MEM (regs[54], 8);
- ADD_STRING (" LR: ");
- ADD_MEM (regs[55], 8);
- ADD_STRING ("\n\n PC: ");
- ADD_MEM (regs[56], 8);
- ADD_STRING (" ICS: ");
- ADD_MEM (regs[57], 1);
- ADD_STRING (" FAULTNUM: ");
- ADD_MEM (regs[58], 2);
- ADD_STRING ("\n");
-
- /* Write the stuff out. */
- writev (fd, iov, nr);
-}
-
-
-#define REGISTER_DUMP register_dump (fd, &ctx->uc_mcontext)
diff --git a/sysdeps/unix/sysv/linux/tile/ucontext_i.h b/sysdeps/unix/sysv/linux/tile/ucontext_i.h
deleted file mode 100644
index c267742225..0000000000
--- a/sysdeps/unix/sysv/linux/tile/ucontext_i.h
+++ /dev/null
@@ -1,42 +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/>. */
-
-/* Definitions of offsets within the ucontext_t structure. Note
- that for convenience we use __SIZEOF_POINTER__ for "long" and
- "ssize_t" fields (and their unsigned counterparts) as well. */
-
-#define UC_FLAGS_OFFSET 0
-#define UC_LINK_OFFSET (UC_FLAGS_OFFSET + __SIZEOF_POINTER__)
-#define UC_STACK_SP_OFFSET (UC_LINK_OFFSET + __SIZEOF_POINTER__)
-#define UC_STACK_FLAGS_OFFSET (UC_STACK_SP_OFFSET + __SIZEOF_POINTER__)
-#define UC_STACK_SIZE_OFFSET (UC_STACK_FLAGS_OFFSET + __SIZEOF_POINTER__)
-#define UC_STACK_MCONTEXT_OFFSET \
- ((UC_STACK_SIZE_OFFSET + __SIZEOF_POINTER__ + REGSIZE - 1) & -REGSIZE)
-#define UC_REG(i) (UC_STACK_MCONTEXT_OFFSET + ((i) * REGSIZE))
-#define UC_NREGS 64
-#define UC_SIGMASK_OFFSET UC_REG(UC_NREGS)
-#define UC_SIZE (UC_SIGMASK_OFFSET + (_NSIG / 8))
-
-/* From <asm/siginfo.h> */
-#define SI_MAX_SIZE 128
-
-/* From <asm/signal.h> */
-#define _NSIG 64
-#define SIG_BLOCK 0 /* for blocking signals */
-#define SIG_UNBLOCK 1 /* for unblocking signals */
-#define SIG_SETMASK 2 /* for setting the signal mask */
diff --git a/sysdeps/unix/sysv/linux/tile/vfork.S b/sysdeps/unix/sysv/linux/tile/vfork.S
deleted file mode 100644
index d8c5ce3e24..0000000000
--- a/sysdeps/unix/sysv/linux/tile/vfork.S
+++ /dev/null
@@ -1,77 +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 <sysdep.h>
-#define __ASSEMBLY__ /* for kernel headers */
-#include <linux/sched.h>
-#include <asm/signal.h>
-#include <tcb-offsets.h>
-
-/* Clone the calling process, but without copying the whole address space.
- The calling process is suspended until the new process exits or is
- replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
- and the process ID of the new process to the old process. */
-
- .text
-ENTRY (__vfork)
- {
- addli r11, tp, PID_OFFSET /* Point at PID. */
- movei r13, 1
- }
- {
- LD4U r12, r11 /* Load the saved PID. */
- shli r13, r13, 31 /* Build 0x80000000. */
- }
- sub r12, zero, r12 /* Negate it. */
- CMOVEQZ r12, r12, r13 /* Replace zero pids. */
- ST4 r11, r12 /* Store the temporary PID. */
-
- {
- moveli r0, CLONE_VFORK | CLONE_VM | SIGCHLD
- move r1, zero
- }
- {
- move r2, zero
- move r3, zero
- }
- moveli TREG_SYSCALL_NR_NAME, __NR_clone
- swint1
-
- BEQZ r0, 1f /* If we are the parent... */
- {
- addli r11, tp, PID_OFFSET /* Point at PID. */
- movei r13, 1
- }
- {
- LD4U r12, r11 /* Load the saved PID. */
- shli r13, r13, 31 /* Build 0x80000000. */
- }
- {
- CMPEQ r13, r12, r12 /* Test for that value. */
- sub r12, zero, r12 /* Re-negate it. */
- }
- CMOVNEZ r12, r13, zero /* Replace zero pids. */
- ST4 r11, r12 /* Restore the PID. */
-1:
- BNEZ r1, 0f
- jrp lr
-PSEUDO_END (__vfork)
-libc_hidden_def (__vfork)
-
-weak_alias (__vfork, vfork)
-strong_alias (__vfork, __libc_vfork)
diff --git a/sysdeps/unix/sysv/linux/tile/waitpid.S b/sysdeps/unix/sysv/linux/tile/waitpid.S
deleted file mode 100644
index dee1b0cce1..0000000000
--- a/sysdeps/unix/sysv/linux/tile/waitpid.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-extern pid_t __waitpid_nocancel (pid_t, int *, int) attribute_hidden;
-*/
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-/* Call __NR_wait4, providing fourth argument (struct rusage *) as NULL. */
-#define PSEUDO_EXTRA move r3, zero;
-#include <sysdep-cancel.h>
-
-PSEUDO (__waitpid, wait4, 3)
-ret
-PSEUDO_END(__waitpid)
-
-libc_hidden_def (__waitpid)
-weak_alias (__waitpid, waitpid)
-libc_hidden_weak (waitpid)
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/time.c b/sysdeps/unix/sysv/linux/time.c
index 7660b381ac..69116af059 100644
--- a/sysdeps/unix/sysv/linux/time.c
+++ b/sysdeps/unix/sysv/linux/time.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/timer_create.c b/sysdeps/unix/sysv/linux/timer_create.c
index c2fddef348..a49a546e71 100644
--- a/sysdeps/unix/sysv/linux/timer_create.c
+++ b/sysdeps/unix/sysv/linux/timer_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/timer_delete.c b/sysdeps/unix/sysv/linux/timer_delete.c
index 9f38b7a6c8..e1eb1db593 100644
--- a/sysdeps/unix/sysv/linux/timer_delete.c
+++ b/sysdeps/unix/sysv/linux/timer_delete.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/timer_getoverr.c b/sysdeps/unix/sysv/linux/timer_getoverr.c
index 31b1771d18..26f23e1d8a 100644
--- a/sysdeps/unix/sysv/linux/timer_getoverr.c
+++ b/sysdeps/unix/sysv/linux/timer_getoverr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/timer_gettime.c b/sysdeps/unix/sysv/linux/timer_gettime.c
index 0402a8629d..10a19d9ee7 100644
--- a/sysdeps/unix/sysv/linux/timer_gettime.c
+++ b/sysdeps/unix/sysv/linux/timer_gettime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/timer_routines.c b/sysdeps/unix/sysv/linux/timer_routines.c
index 0f9598d57d..5fcc91572b 100644
--- a/sysdeps/unix/sysv/linux/timer_routines.c
+++ b/sysdeps/unix/sysv/linux/timer_routines.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/timer_settime.c b/sysdeps/unix/sysv/linux/timer_settime.c
index 2f7836ed61..7c938bd4a4 100644
--- a/sysdeps/unix/sysv/linux/timer_settime.c
+++ b/sysdeps/unix/sysv/linux/timer_settime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/times.c b/sysdeps/unix/sysv/linux/times.c
index 8f3033bdea..e9c93428c4 100644
--- a/sysdeps/unix/sysv/linux/times.c
+++ b/sysdeps/unix/sysv/linux/times.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,11 +29,13 @@ __times (struct tms *buf)
&& __builtin_expect (INTERNAL_SYSCALL_ERRNO (ret, err) == EFAULT, 0)
&& buf)
{
- /* This might be an error or not. For architectures which have
- no separate return value and error indicators we cannot
- distinguish a return value of -1 from an error. Do it the
- hard way. We crash applications which pass in an invalid
- non-NULL BUF pointer. Linux allows BUF to be NULL. */
+ /* This might be an error or not. For architectures which have no
+ separate return value and error indicators we cannot
+ distinguish a return value of e.g. (clock_t) -14 from -EFAULT.
+ Therefore the only course of action is to dereference the user
+ -supplied structure on a return of (clock_t) -14. This will crash
+ applications which pass in an invalid non-NULL BUF pointer.
+ Note that Linux allows BUF to be NULL in which case we skip this. */
#define touch(v) \
do { \
clock_t temp = v; \
@@ -45,13 +47,18 @@ __times (struct tms *buf)
touch (buf->tms_cutime);
touch (buf->tms_cstime);
- /* If we come here the memory is valid (or BUF is NULL, which is
- a valid condition for the kernel syscall) and the kernel did not
- return an EFAULT error. Return the value given by the kernel. */
+ /* If we come here the memory is valid and the kernel did not
+ return an EFAULT error, but rather e.g. (clock_t) -14.
+ Return the value given by the kernel. */
}
- /* Return value (clock_t) -1 signals an error, but if there wasn't any,
- return the following value. */
+ /* On Linux this function never fails except with EFAULT.
+ POSIX says that returning a value (clock_t) -1 indicates an error,
+ but on Linux this is simply one of the valid clock values after
+ clock_t wraps. Therefore when we would return (clock_t) -1, we
+ instead return (clock_t) 0, and loose a tick of accuracy (having
+ returned 0 for two consecutive calls even though the clock
+ advanced). */
if (ret == (clock_t) -1)
return (clock_t) 0;
diff --git a/sysdeps/unix/sysv/linux/timespec_get.c b/sysdeps/unix/sysv/linux/timespec_get.c
index 63f087e2cb..b14a302ee9 100644
--- a/sysdeps/unix/sysv/linux/timespec_get.c
+++ b/sysdeps/unix/sysv/linux/timespec_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/truncate.c b/sysdeps/unix/sysv/linux/truncate.c
new file mode 100644
index 0000000000..9aab095a64
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/truncate.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 2016-2018 Free Software 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 <sysdep.h>
+#include <errno.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
+/* Truncate PATH to LENGTH bytes. */
+int
+__truncate (const char *path, off_t length)
+{
+# ifndef __NR_truncate
+ return INLINE_SYSCALL_CALL (truncate64, path,
+ __ALIGNMENT_ARG SYSCALL_LL (length));
+# else
+ return INLINE_SYSCALL_CALL (truncate, path, length);
+# endif
+}
+weak_alias (__truncate, truncate)
+#endif
diff --git a/sysdeps/unix/sysv/linux/truncate64.c b/sysdeps/unix/sysv/linux/truncate64.c
index 92a6bc4ee6..fe0db280d7 100644
--- a/sysdeps/unix/sysv/linux/truncate64.c
+++ b/sysdeps/unix/sysv/linux/truncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software 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,21 +15,23 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sys/types.h>
-#include <endian.h>
-#include <errno.h>
#include <unistd.h>
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
-/* Truncate the file referenced by FD to LENGTH bytes. */
+#ifndef __NR_truncate64
+# define __NR_truncate64 __NR_truncate
+#endif
+
+/* Truncate PATH to LENGTH bytes. */
int
-truncate64 (const char *path, off64_t length)
+__truncate64 (const char *path, off64_t length)
{
- unsigned int low = length & 0xffffffff;
- unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (truncate64, 3, path,
- __LONG_LONG_PAIR (high, low));
- return result;
+ return INLINE_SYSCALL_CALL (truncate64, path,
+ __ALIGNMENT_ARG SYSCALL_LL64 (length));
}
+weak_alias (__truncate64, truncate64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (__truncate64, truncate);
+#endif
diff --git a/sysdeps/unix/sysv/linux/tst-affinity-pid.c b/sysdeps/unix/sysv/linux/tst-affinity-pid.c
index 67402bf7ff..2550c5998e 100644
--- a/sysdeps/unix/sysv/linux/tst-affinity-pid.c
+++ b/sysdeps/unix/sysv/linux/tst-affinity-pid.c
@@ -1,5 +1,5 @@
/* Test for sched_getaffinity and sched_setaffinity, PID version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tst-affinity.c b/sysdeps/unix/sysv/linux/tst-affinity.c
index 29b6e52803..5a71587978 100644
--- a/sysdeps/unix/sysv/linux/tst-affinity.c
+++ b/sysdeps/unix/sysv/linux/tst-affinity.c
@@ -1,5 +1,5 @@
/* Single-threaded test for sched_getaffinity and sched_setaffinity.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tst-align-clone.c b/sysdeps/unix/sysv/linux/tst-align-clone.c
index a72412ea0f..0aaf1364e5 100644
--- a/sysdeps/unix/sysv/linux/tst-align-clone.c
+++ b/sysdeps/unix/sysv/linux/tst-align-clone.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tst-clone.c b/sysdeps/unix/sysv/linux/tst-clone.c
index 01251a1216..6c24d517b0 100644
--- a/sysdeps/unix/sysv/linux/tst-clone.c
+++ b/sysdeps/unix/sysv/linux/tst-clone.c
@@ -1,5 +1,5 @@
/* Test for proper error/errno handling in clone.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,11 @@
#include <unistd.h>
#include <sched.h>
+#ifdef __ia64__
+extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
+ size_t __child_stack_size, int __flags, void *__arg, ...);
+#endif
+
int child_fn(void *arg)
{
puts ("FAIL: in child_fn(); should not be here");
diff --git a/sysdeps/unix/sysv/linux/tst-clone2.c b/sysdeps/unix/sysv/linux/tst-clone2.c
new file mode 100644
index 0000000000..1f525ac618
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-clone2.c
@@ -0,0 +1,146 @@
+/* Test if CLONE_VM does not change pthread pid/tid field (BZ #19957)
+ Copyright (C) 2016-2018 Free Software 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 <sched.h>
+#include <signal.h>
+#include <string.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stddef.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/syscall.h>
+
+#include <stackinfo.h> /* For _STACK_GROWS_{UP,DOWN}. */
+
+#include <support/check.h>
+
+static int sig;
+static int pipefd[2];
+
+static int
+f (void *a)
+{
+ close (pipefd[0]);
+
+ pid_t ppid = getppid ();
+ pid_t pid = getpid ();
+ pid_t tid = syscall (__NR_gettid);
+
+ if (write (pipefd[1], &ppid, sizeof ppid) != sizeof (ppid))
+ FAIL_EXIT1 ("write ppid failed\n");
+ if (write (pipefd[1], &pid, sizeof pid) != sizeof (pid))
+ FAIL_EXIT1 ("write pid failed\n");
+ if (write (pipefd[1], &tid, sizeof tid) != sizeof (tid))
+ FAIL_EXIT1 ("write tid failed\n");
+
+ return 0;
+}
+
+
+static int
+do_test (void)
+{
+ sig = SIGRTMIN;
+ sigset_t ss;
+ sigemptyset (&ss);
+ sigaddset (&ss, sig);
+ if (sigprocmask (SIG_BLOCK, &ss, NULL) != 0)
+ FAIL_EXIT1 ("sigprocmask failed: %m");
+
+ if (pipe2 (pipefd, O_CLOEXEC))
+ FAIL_EXIT1 ("pipe failed: %m");
+
+ int clone_flags = 0;
+#ifdef __ia64__
+ extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
+ size_t __child_stack_size, int __flags,
+ void *__arg, ...);
+ char st[256 * 1024] __attribute__ ((aligned));
+ pid_t p = __clone2 (f, st, sizeof (st), clone_flags, 0);
+#else
+ char st[128 * 1024] __attribute__ ((aligned));
+#if _STACK_GROWS_DOWN
+ pid_t p = clone (f, st + sizeof (st), clone_flags, 0);
+#elif _STACK_GROWS_UP
+ pid_t p = clone (f, st, clone_flags, 0);
+#else
+#error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
+#endif
+#endif
+
+ close (pipefd[1]);
+
+ if (p == -1)
+ FAIL_EXIT1("clone failed: %m");
+
+ pid_t ppid, pid, tid;
+ if (read (pipefd[0], &ppid, sizeof pid) != sizeof pid)
+ {
+ kill (p, SIGKILL);
+ FAIL_EXIT1 ("read ppid failed: %m");
+ }
+ if (read (pipefd[0], &pid, sizeof pid) != sizeof pid)
+ {
+ kill (p, SIGKILL);
+ FAIL_EXIT1 ("read pid failed: %m");
+ }
+ if (read (pipefd[0], &tid, sizeof tid) != sizeof tid)
+ {
+ kill (p, SIGKILL);
+ FAIL_EXIT1 ("read tid failed: %m");
+ }
+
+ close (pipefd[0]);
+
+ int ret = 0;
+
+ pid_t own_pid = getpid ();
+ pid_t own_tid = syscall (__NR_gettid);
+
+ /* Some sanity checks for clone syscall: returned ppid should be current
+ pid and both returned tid/pid should be different from current one. */
+ if ((ppid != own_pid) || (pid == own_pid) || (tid == own_tid))
+ FAIL_RET ("ppid=%i pid=%i tid=%i | own_pid=%i own_tid=%i",
+ (int)ppid, (int)pid, (int)tid, (int)own_pid, (int)own_tid);
+
+ int e;
+ if (waitpid (p, &e, __WCLONE) != p)
+ {
+ kill (p, SIGKILL);
+ FAIL_EXIT1 ("waitpid failed");
+ }
+ if (!WIFEXITED (e))
+ {
+ if (WIFSIGNALED (e))
+ printf ("died from signal %s\n", strsignal (WTERMSIG (e)));
+ else
+ puts ("did not terminate correctly");
+ exit (EXIT_FAILURE);
+ }
+ if (WEXITSTATUS (e) != 0)
+ FAIL_EXIT1 ("exit code %d", WEXITSTATUS (e));
+
+ return ret;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-clone3.c b/sysdeps/unix/sysv/linux/tst-clone3.c
new file mode 100644
index 0000000000..784ce18f53
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-clone3.c
@@ -0,0 +1,96 @@
+/* Check if clone (CLONE_THREAD) does not call exit_group (BZ #21512)
+ Copyright (C) 2017-2018 Free Software 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 <string.h>
+#include <sched.h>
+#include <signal.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <sys/wait.h>
+#include <sys/types.h>
+#include <linux/futex.h>
+
+#include <stackinfo.h> /* For _STACK_GROWS_{UP,DOWN}. */
+#include <support/check.h>
+
+/* Test if clone call with CLONE_THREAD does not call exit_group. The 'f'
+ function returns '1', which will be used by clone thread to call the
+ 'exit' syscall directly. If _exit is used instead, exit_group will be
+ used and thus the thread group will finish with return value of '1'
+ (where '2' from main thread is expected. */
+
+static int
+f (void *a)
+{
+ return 1;
+}
+
+/* Futex wait for TID argument, similar to pthread_join internal
+ implementation. */
+#define wait_tid(tid) \
+ do { \
+ __typeof (tid) __tid; \
+ while ((__tid = (tid)) != 0) \
+ futex_wait (&(tid), __tid); \
+ } while (0)
+
+static inline int
+futex_wait (int *futexp, int val)
+{
+ return syscall (__NR_futex, futexp, FUTEX_WAIT, val);
+}
+
+static int
+do_test (void)
+{
+ char st[1024] __attribute__ ((aligned));
+ int clone_flags = CLONE_THREAD;
+ /* Minimum required flags to used along with CLONE_THREAD. */
+ clone_flags |= CLONE_VM | CLONE_SIGHAND;
+ /* We will used ctid to call on futex to wait for thread exit. */
+ clone_flags |= CLONE_CHILD_CLEARTID;
+ pid_t ctid, tid;
+
+#ifdef __ia64__
+ extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
+ size_t __child_stack_size, int __flags,
+ void *__arg, ...);
+ tid = __clone2 (f, st, sizeof (st), clone_flags, NULL, /* ptid */ NULL,
+ /* tls */ NULL, &ctid);
+#else
+#if _STACK_GROWS_DOWN
+ tid = clone (f, st + sizeof (st), clone_flags, NULL, /* ptid */ NULL,
+ /* tls */ NULL, &ctid);
+#elif _STACK_GROWS_UP
+ tid = clone (f, st, clone_flags, NULL, /* ptid */ NULL, /* tls */ NULL,
+ &ctid);
+#else
+#error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
+#endif
+#endif
+ if (tid == -1)
+ FAIL_EXIT1 ("clone failed: %m");
+
+ ctid = tid;
+ wait_tid (ctid);
+
+ return 2;
+}
+
+#define EXPECTED_STATUS 2
+#include <support/test-driver.c>
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..a6ba403c62
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-fallocate-common.c
@@ -0,0 +1,98 @@
+/* Basic fallocate test (no specific flags is checked).
+ Copyright (C) 2016-2018 Free Software 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 <limits.h>
+#include <stdint.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <support/support.h>
+#include <support/check.h>
+#include <support/temp_file.h>
+
+#define XSTR(s) STR(S)
+#define STR(s) #s
+
+static char *temp_filename;
+static int temp_fd;
+
+static void
+do_prepare (int argc, char **argv)
+{
+ temp_fd = create_temp_file ("tst-fallocate.", &temp_filename);
+ if (temp_fd == -1)
+ FAIL_EXIT1 ("cannot create temporary file: %m");
+}
+#define PREPARE do_prepare
+
+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;
+}
+
+/* This function is defined by the individual tests. */
+static int do_test (void);
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-fallocate.c b/sysdeps/unix/sysv/linux/tst-fallocate.c
new file mode 100644
index 0000000000..e25a97e712
--- /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-2018 Free Software 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..e51fa0152a
--- /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-2018 Free Software 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-fanotify.c b/sysdeps/unix/sysv/linux/tst-fanotify.c
index 8e8c10bf47..33f70362ca 100644
--- a/sysdeps/unix/sysv/linux/tst-fanotify.c
+++ b/sysdeps/unix/sysv/linux/tst-fanotify.c
@@ -1,5 +1,5 @@
/* Basic fanotify test.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,18 +20,6 @@
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
-
-#ifndef HAVE_LINUX_FANOTIFY_H
-
-static int
-do_test (void)
-{
- puts ("SKIP: missing support for fanotify due to old kernel headers");
- return 0;
-}
-
-#else
-
#include <sys/fanotify.h>
static int
@@ -69,7 +57,5 @@ do_test (void)
return 0;
}
-#endif
-
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
diff --git a/sysdeps/unix/sysv/linux/tst-getpid2.c b/sysdeps/unix/sysv/linux/tst-getpid2.c
deleted file mode 100644
index fc98cb60db..0000000000
--- a/sysdeps/unix/sysv/linux/tst-getpid2.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define TEST_CLONE_FLAGS CLONE_VM
-#include "tst-getpid1.c"
diff --git a/sysdeps/unix/sysv/linux/tst-memfd_create.c b/sysdeps/unix/sysv/linux/tst-memfd_create.c
new file mode 100644
index 0000000000..62d3bad5ca
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-memfd_create.c
@@ -0,0 +1,121 @@
+/* Test for the memfd_create system call.
+ Copyright (C) 2017-2018 Free Software 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 <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <support/check.h>
+#include <support/support.h>
+#include <support/test-driver.h>
+#include <support/xunistd.h>
+#include <sys/mman.h>
+
+/* Return true if the descriptor has the FD_CLOEXEC flag set. */
+static bool
+is_cloexec (int fd)
+{
+ int flags = fcntl (fd, F_GETFD);
+ TEST_VERIFY (flags >= 0);
+ return flags & FD_CLOEXEC;
+}
+
+/* Return the seals set on FD. */
+static int
+get_seals (int fd)
+{
+ int flags = fcntl (fd, F_GET_SEALS);
+ TEST_VERIFY (flags >= 0);
+ return flags;
+}
+
+/* Return true if the F_SEAL_SEAL flag is set on the descriptor. */
+static bool
+is_sealed (int fd)
+{
+ return get_seals (fd) & F_SEAL_SEAL;
+}
+
+static int
+do_test (void)
+{
+ /* Initialized by the first call to memfd_create to 0 (memfd_create
+ unsupported) or 1 (memfd_create is implemented in the kernel).
+ Subsequent iterations check that the success/failure state is
+ consistent. */
+ int supported = -1;
+
+ for (int do_cloexec = 0; do_cloexec < 2; ++do_cloexec)
+ for (int do_sealing = 0; do_sealing < 2; ++do_sealing)
+ {
+ int flags = 0;
+ if (do_cloexec)
+ flags |= MFD_CLOEXEC;
+ if (do_sealing)
+ flags |= MFD_ALLOW_SEALING;
+ if (test_verbose > 0)
+ printf ("info: memfd_create with flags=0x%x\n", flags);
+ int fd = memfd_create ("tst-memfd_create", flags);
+ if (fd < 0)
+ {
+ if (errno == ENOSYS)
+ {
+ if (supported < 0)
+ {
+ printf ("warning: memfd_create is unsupported\n");
+ supported = 0;
+ continue;
+ }
+ TEST_VERIFY (supported == 0);
+ continue;
+ }
+ else
+ FAIL_EXIT1 ("memfd_create: %m");
+ }
+ if (supported < 0)
+ supported = 1;
+ TEST_VERIFY (supported > 0);
+
+ char *fd_path = xasprintf ("/proc/self/fd/%d", fd);
+ char *link = xreadlink (fd_path);
+ if (test_verbose > 0)
+ printf ("info: memfd link: %s\n", link);
+ TEST_VERIFY (strcmp (link, "memfd:tst-memfd_create (deleted)"));
+ TEST_VERIFY (is_cloexec (fd) == do_cloexec);
+ TEST_VERIFY (is_sealed (fd) == !do_sealing);
+ if (do_sealing)
+ {
+ TEST_VERIFY (fcntl (fd, F_ADD_SEALS, F_SEAL_WRITE) == 0);
+ TEST_VERIFY (!is_sealed (fd));
+ TEST_VERIFY (get_seals (fd) & F_SEAL_WRITE);
+ TEST_VERIFY (fcntl (fd, F_ADD_SEALS, F_SEAL_SEAL) == 0);
+ TEST_VERIFY (is_sealed (fd));
+ }
+ xclose (fd);
+ free (fd_path);
+ free (link);
+ }
+
+ if (supported == 0)
+ return EXIT_UNSUPPORTED;
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-mlock2.c b/sysdeps/unix/sysv/linux/tst-mlock2.c
new file mode 100644
index 0000000000..54da2b3f61
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-mlock2.c
@@ -0,0 +1,66 @@
+/* Test the mlock2 function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <stdio.h>
+#include <support/check.h>
+#include <support/xunistd.h>
+#include <sys/mman.h>
+
+/* Allocate a page using mmap. */
+static void *
+get_page (void)
+{
+ return xmmap (NULL, 1, PROT_READ | PROT_WRITE,
+ MAP_ANONYMOUS | MAP_PRIVATE, -1);
+}
+
+static int
+do_test (void)
+{
+ /* Current kernels have a small reserve of locked memory, so this
+ test does not need any privileges to run. */
+
+ void *page = get_page ();
+ if (mlock (page, 1) != 0)
+ FAIL_EXIT1 ("mlock: %m\n");
+ xmunmap (page, 1);
+
+ page = get_page ();
+ if (mlock2 (page, 1, 0) != 0)
+ /* Should be implemented using mlock if necessary. */
+ FAIL_EXIT1 ("mlock2 (0): %m\n");
+ xmunmap (page, 1);
+
+ page = get_page ();
+ int ret = mlock2 (page, 1, MLOCK_ONFAULT);
+ if (ret != 0)
+ {
+ TEST_VERIFY (ret == -1);
+ if (errno != EINVAL)
+ /* EINVAL means the system does not support the mlock2 system
+ call. */
+ FAIL_EXIT1 ("mlock2 (0): %m\n");
+ else
+ puts ("warning: mlock2 system call not supported");
+ }
+ xmunmap (page, 1);
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c b/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c
new file mode 100644
index 0000000000..aaf65af0db
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c
@@ -0,0 +1,97 @@
+/* Check non representable OFD locks regions in non-LFS mode for compat
+ mode (BZ #20251)
+ Copyright (C) 2018 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <errno.h>
+
+#include <support/temp_file.h>
+#include <support/check.h>
+
+#include <shlib-compat.h>
+#if TEST_COMPAT (libc, GLIBC_2_0, GLIBC_2_28)
+compat_symbol_reference (libc, fcntl, fcntl, GLIBC_2_0);
+
+static char *temp_filename;
+static int temp_fd;
+
+static void
+do_prepare (int argc, char **argv)
+{
+ temp_fd = create_temp_file ("tst-ofdlocks-compat.", &temp_filename);
+ TEST_VERIFY_EXIT (temp_fd != -1);
+}
+
+#define PREPARE do_prepare
+
+/* Linux between 4.13 and 4.15 return EOVERFLOW for LFS OFD locks usage
+ in compat mode (non-LFS ABI running on a LFS default kernel, such as
+ i386 on a x86_64 kernel or s390-32 on a s390-64 kernel) [1]. This is
+ a kernel issue because __NR_fcntl64 is the expected way to use OFD locks
+ (used on GLIBC for both fcntl and fcntl64).
+
+ [1] https://sourceware.org/ml/libc-alpha/2018-07/msg00243.html */
+
+static int
+do_test (void)
+{
+ /* The compat fcntl version for architectures which support non-LFS
+ operations does not wrap the flock OFD argument, so the struct is passed
+ unmodified to kernel. It means no EOVERFLOW is returned, so operations
+ with LFS should not incur in failure. */
+
+ struct flock64 lck64 = {
+ .l_type = F_WRLCK,
+ .l_whence = SEEK_SET,
+ .l_start = (off64_t)INT32_MAX + 1024,
+ .l_len = 1024,
+ };
+ int ret = fcntl (temp_fd, F_OFD_SETLKW, &lck64);
+ if (ret == -1 && errno == EINVAL)
+ /* OFD locks are only available on Linux 3.15. */
+ FAIL_UNSUPPORTED ("fcntl (F_OFD_SETLKW) not supported");
+
+ TEST_VERIFY_EXIT (ret == 0);
+
+ /* Open file description locks placed through the same open file description
+ (either by same file descriptor or a duplicated one created by fork,
+ dup, fcntl F_DUPFD, etc.) overwrites then old lock. To force a
+ conflicting lock combination, it creates a new file descriptor. */
+ int fd = open64 (temp_filename, O_RDWR, 0666);
+ TEST_VERIFY_EXIT (fd != -1);
+
+ struct flock64 lck = {
+ .l_type = F_WRLCK,
+ .l_whence = SEEK_SET,
+ .l_start = INT32_MAX - 1024,
+ .l_len = 4 * 1024,
+ };
+ TEST_VERIFY (fcntl (fd, F_OFD_GETLK, &lck) == 0);
+
+ return 0;
+}
+#else
+static int
+do_test (void)
+{
+ return 77;
+}
+#endif
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-ofdlocks.c b/sysdeps/unix/sysv/linux/tst-ofdlocks.c
new file mode 100644
index 0000000000..a660bab6dd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-ofdlocks.c
@@ -0,0 +1,81 @@
+/* Check non representable OFD locks regions in non-LFS mode (BZ #20251)
+ Copyright (C) 2018 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <errno.h>
+
+#include <support/temp_file.h>
+#include <support/check.h>
+
+static char *temp_filename;
+static int temp_fd;
+
+static void
+do_prepare (int argc, char **argv)
+{
+ temp_fd = create_temp_file ("tst-ofdlocks.", &temp_filename);
+ TEST_VERIFY_EXIT (temp_fd != -1);
+}
+
+#define PREPARE do_prepare
+
+static int
+do_test (void)
+{
+ /* It first allocates a open file description lock range which can not
+ be represented in a 32 bit struct flock. */
+ struct flock64 lck64 = {
+ .l_type = F_WRLCK,
+ .l_whence = SEEK_SET,
+ .l_start = (off64_t)INT32_MAX + 1024,
+ .l_len = 1024,
+ };
+ int ret = fcntl64 (temp_fd, F_OFD_SETLKW, &lck64);
+ if (ret == -1 && errno == EINVAL)
+ /* OFD locks are only available on Linux 3.15. */
+ FAIL_UNSUPPORTED ("fcntl (F_OFD_SETLKW) not supported");
+
+ TEST_VERIFY_EXIT (ret == 0);
+
+ /* Open file description locks placed through the same open file description
+ (either by same file descriptor or a duplicated one created by fork,
+ dup, fcntl F_DUPFD, etc.) overwrites then old lock. To force a
+ conflicting lock combination, it creates a new file descriptor. */
+ int fd = open64 (temp_filename, O_RDWR, 0666);
+ TEST_VERIFY_EXIT (fd != -1);
+
+ /* It tries then to allocate another open file descriptior with a valid
+ non-LFS bits struct flock but which will result in a conflicted region
+ which can not be represented in a non-LFS struct flock. */
+ struct flock lck = {
+ .l_type = F_WRLCK,
+ .l_whence = SEEK_SET,
+ .l_start = INT32_MAX - 1024,
+ .l_len = 4 * 1024,
+ };
+ int r = fcntl (fd, F_OFD_GETLK, &lck);
+ if (sizeof (off_t) != sizeof (off64_t))
+ TEST_VERIFY (r == -1 && errno == EOVERFLOW);
+ else
+ TEST_VERIFY (r == 0);
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-personality.c b/sysdeps/unix/sysv/linux/tst-personality.c
index 57b4923d31..c14df891de 100644
--- a/sysdeps/unix/sysv/linux/tst-personality.c
+++ b/sysdeps/unix/sysv/linux/tst-personality.c
@@ -1,6 +1,6 @@
/* BZ #19408 linux personality syscall wrapper test.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tst-pkey.c b/sysdeps/unix/sysv/linux/tst-pkey.c
new file mode 100644
index 0000000000..5f721d4444
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-pkey.c
@@ -0,0 +1,399 @@
+/* Tests for memory protection keys.
+ Copyright (C) 2017-2018 Free Software 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 <inttypes.h>
+#include <setjmp.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <support/check.h>
+#include <support/support.h>
+#include <support/test-driver.h>
+#include <support/xsignal.h>
+#include <support/xthread.h>
+#include <support/xunistd.h>
+#include <sys/mman.h>
+
+/* Used to force threads to wait until the main thread has set up the
+ keys as intended. */
+static pthread_barrier_t barrier;
+
+/* The keys used for testing. These have been allocated with access
+ rights set based on their array index. */
+enum { key_count = 4 };
+static int keys[key_count];
+static volatile int *pages[key_count];
+
+/* Used to report results from the signal handler. */
+static volatile void *sigsegv_addr;
+static volatile int sigsegv_code;
+static volatile int sigsegv_pkey;
+static sigjmp_buf sigsegv_jmp;
+
+/* Used to handle expected read or write faults. */
+static void
+sigsegv_handler (int signum, siginfo_t *info, void *context)
+{
+ sigsegv_addr = info->si_addr;
+ sigsegv_code = info->si_code;
+ sigsegv_pkey = info->si_pkey;
+ siglongjmp (sigsegv_jmp, 2);
+}
+
+static const struct sigaction sigsegv_sigaction =
+ {
+ .sa_flags = SA_RESETHAND | SA_SIGINFO,
+ .sa_sigaction = &sigsegv_handler,
+ };
+
+/* Check if PAGE is readable (if !WRITE) or writable (if WRITE). */
+static bool
+check_page_access (int page, bool write)
+{
+ /* This is needed to work around bug 22396: On x86-64, siglongjmp
+ does not restore the protection key access rights for the current
+ thread. We restore only the access rights for the keys under
+ test. (This is not a general solution to this problem, but it
+ allows testing to proceed after a fault.) */
+ unsigned saved_rights[key_count];
+ for (int i = 0; i < key_count; ++i)
+ saved_rights[i] = pkey_get (keys[i]);
+
+ volatile int *addr = pages[page];
+ if (test_verbose > 0)
+ {
+ printf ("info: checking access at %p (page %d) for %s\n",
+ addr, page, write ? "writing" : "reading");
+ }
+ int result = sigsetjmp (sigsegv_jmp, 1);
+ if (result == 0)
+ {
+ xsigaction (SIGSEGV, &sigsegv_sigaction, NULL);
+ if (write)
+ *addr = 3;
+ else
+ (void) *addr;
+ xsignal (SIGSEGV, SIG_DFL);
+ if (test_verbose > 0)
+ puts (" --> access allowed");
+ return true;
+ }
+ else
+ {
+ xsignal (SIGSEGV, SIG_DFL);
+ if (test_verbose > 0)
+ puts (" --> access denied");
+ TEST_COMPARE (result, 2);
+ TEST_COMPARE ((uintptr_t) sigsegv_addr, (uintptr_t) addr);
+ TEST_COMPARE (sigsegv_code, SEGV_PKUERR);
+ TEST_COMPARE (sigsegv_pkey, keys[page]);
+ for (int i = 0; i < key_count; ++i)
+ TEST_COMPARE (pkey_set (keys[i], saved_rights[i]), 0);
+ return false;
+ }
+}
+
+static volatile sig_atomic_t sigusr1_handler_ran;
+
+/* Used to check that access is revoked in signal handlers. */
+static void
+sigusr1_handler (int signum)
+{
+ TEST_COMPARE (signum, SIGUSR1);
+ for (int i = 0; i < key_count; ++i)
+ TEST_COMPARE (pkey_get (keys[i]), PKEY_DISABLE_ACCESS);
+ sigusr1_handler_ran = 1;
+}
+
+/* Used to report results from other threads. */
+struct thread_result
+{
+ int access_rights[key_count];
+ pthread_t next_thread;
+};
+
+/* Return the thread's access rights for the keys under test. */
+static void *
+get_thread_func (void *closure)
+{
+ struct thread_result *result = xmalloc (sizeof (*result));
+ for (int i = 0; i < key_count; ++i)
+ result->access_rights[i] = pkey_get (keys[i]);
+ memset (&result->next_thread, 0, sizeof (result->next_thread));
+ return result;
+}
+
+/* Wait for initialization and then check that the current thread does
+ not have access through the keys under test. */
+static void *
+delayed_thread_func (void *closure)
+{
+ bool check_access = *(bool *) closure;
+ pthread_barrier_wait (&barrier);
+ struct thread_result *result = get_thread_func (NULL);
+
+ if (check_access)
+ {
+ /* Also check directly. This code should not run with other
+ threads in parallel because of the SIGSEGV handler which is
+ installed by check_page_access. */
+ for (int i = 0; i < key_count; ++i)
+ {
+ TEST_VERIFY (!check_page_access (i, false));
+ TEST_VERIFY (!check_page_access (i, true));
+ }
+ }
+
+ result->next_thread = xpthread_create (NULL, get_thread_func, NULL);
+ return result;
+}
+
+static int
+do_test (void)
+{
+ long pagesize = xsysconf (_SC_PAGESIZE);
+
+ /* pkey_mprotect with key -1 should work even when there is no
+ protection key support. */
+ {
+ int *page = xmmap (NULL, pagesize, PROT_NONE,
+ MAP_ANONYMOUS | MAP_PRIVATE, -1);
+ TEST_COMPARE (pkey_mprotect (page, pagesize, PROT_READ | PROT_WRITE, -1),
+ 0);
+ volatile int *vpage = page;
+ *vpage = 5;
+ TEST_COMPARE (*vpage, 5);
+ xmunmap (page, pagesize);
+ }
+
+ xpthread_barrier_init (&barrier, NULL, 2);
+ bool delayed_thread_check_access = true;
+ pthread_t delayed_thread = xpthread_create
+ (NULL, &delayed_thread_func, &delayed_thread_check_access);
+
+ keys[0] = pkey_alloc (0, 0);
+ if (keys[0] < 0)
+ {
+ if (errno == ENOSYS)
+ FAIL_UNSUPPORTED
+ ("kernel does not support memory protection keys");
+ if (errno == EINVAL)
+ FAIL_UNSUPPORTED
+ ("CPU does not support memory protection keys: %m");
+ FAIL_EXIT1 ("pkey_alloc: %m");
+ }
+ TEST_COMPARE (pkey_get (keys[0]), 0);
+ for (int i = 1; i < key_count; ++i)
+ {
+ keys[i] = pkey_alloc (0, i);
+ if (keys[i] < 0)
+ FAIL_EXIT1 ("pkey_alloc (0, %d): %m", i);
+ /* pkey_alloc is supposed to change the current thread's access
+ rights for the new key. */
+ TEST_COMPARE (pkey_get (keys[i]), i);
+ }
+ /* Check that all the keys have the expected access rights for the
+ current thread. */
+ for (int i = 0; i < key_count; ++i)
+ TEST_COMPARE (pkey_get (keys[i]), i);
+
+ /* Allocate a test page for each key. */
+ for (int i = 0; i < key_count; ++i)
+ {
+ pages[i] = xmmap (NULL, pagesize, PROT_READ | PROT_WRITE,
+ MAP_ANONYMOUS | MAP_PRIVATE, -1);
+ TEST_COMPARE (pkey_mprotect ((void *) pages[i], pagesize,
+ PROT_READ | PROT_WRITE, keys[i]), 0);
+ }
+
+ /* Check that the initial thread does not have access to the new
+ keys. */
+ {
+ pthread_barrier_wait (&barrier);
+ struct thread_result *result = xpthread_join (delayed_thread);
+ for (int i = 0; i < key_count; ++i)
+ TEST_COMPARE (result->access_rights[i],
+ PKEY_DISABLE_ACCESS);
+ struct thread_result *result2 = xpthread_join (result->next_thread);
+ for (int i = 0; i < key_count; ++i)
+ TEST_COMPARE (result->access_rights[i],
+ PKEY_DISABLE_ACCESS);
+ free (result);
+ free (result2);
+ }
+
+ /* Check that the current thread access rights are inherited by new
+ threads. */
+ {
+ pthread_t get_thread = xpthread_create (NULL, get_thread_func, NULL);
+ struct thread_result *result = xpthread_join (get_thread);
+ for (int i = 0; i < key_count; ++i)
+ TEST_COMPARE (result->access_rights[i], i);
+ free (result);
+ }
+
+ for (int i = 0; i < key_count; ++i)
+ TEST_COMPARE (pkey_get (keys[i]), i);
+
+ /* Check that in a signal handler, there is no access. */
+ xsignal (SIGUSR1, &sigusr1_handler);
+ xraise (SIGUSR1);
+ xsignal (SIGUSR1, SIG_DFL);
+ TEST_COMPARE (sigusr1_handler_ran, 1);
+
+ /* The first key results in a writable page. */
+ TEST_VERIFY (check_page_access (0, false));
+ TEST_VERIFY (check_page_access (0, true));
+
+ /* The other keys do not. */
+ for (int i = 1; i < key_count; ++i)
+ {
+ if (test_verbose)
+ printf ("info: checking access for key %d, bits 0x%x\n",
+ i, pkey_get (keys[i]));
+ for (int j = 0; j < key_count; ++j)
+ TEST_COMPARE (pkey_get (keys[j]), j);
+ if (i & PKEY_DISABLE_ACCESS)
+ {
+ TEST_VERIFY (!check_page_access (i, false));
+ TEST_VERIFY (!check_page_access (i, true));
+ }
+ else
+ {
+ TEST_VERIFY (i & PKEY_DISABLE_WRITE);
+ TEST_VERIFY (check_page_access (i, false));
+ TEST_VERIFY (!check_page_access (i, true));
+ }
+ }
+
+ /* But if we set the current thread's access rights, we gain
+ access. */
+ for (int do_write = 0; do_write < 2; ++do_write)
+ for (int allowed_key = 0; allowed_key < key_count; ++allowed_key)
+ {
+ for (int i = 0; i < key_count; ++i)
+ if (i == allowed_key)
+ {
+ if (do_write)
+ TEST_COMPARE (pkey_set (keys[i], 0), 0);
+ else
+ TEST_COMPARE (pkey_set (keys[i], PKEY_DISABLE_WRITE), 0);
+ }
+ else
+ TEST_COMPARE (pkey_set (keys[i], PKEY_DISABLE_ACCESS), 0);
+
+ if (test_verbose)
+ printf ("info: key %d is allowed access for %s\n",
+ allowed_key, do_write ? "writing" : "reading");
+ for (int i = 0; i < key_count; ++i)
+ if (i == allowed_key)
+ {
+ TEST_VERIFY (check_page_access (i, false));
+ TEST_VERIFY (check_page_access (i, true) == do_write);
+ }
+ else
+ {
+ TEST_VERIFY (!check_page_access (i, false));
+ TEST_VERIFY (!check_page_access (i, true));
+ }
+ }
+
+ /* Restore access to all keys, and launch a thread which should
+ inherit that access. */
+ for (int i = 0; i < key_count; ++i)
+ {
+ TEST_COMPARE (pkey_set (keys[i], 0), 0);
+ TEST_VERIFY (check_page_access (i, false));
+ TEST_VERIFY (check_page_access (i, true));
+ }
+ delayed_thread_check_access = false;
+ delayed_thread = xpthread_create
+ (NULL, delayed_thread_func, &delayed_thread_check_access);
+
+ TEST_COMPARE (pkey_free (keys[0]), 0);
+ /* Second pkey_free will fail because the key has already been
+ freed. */
+ TEST_COMPARE (pkey_free (keys[0]),-1);
+ TEST_COMPARE (errno, EINVAL);
+ for (int i = 1; i < key_count; ++i)
+ TEST_COMPARE (pkey_free (keys[i]), 0);
+
+ /* Check what happens to running threads which have access to
+ previously allocated protection keys. The implemented behavior
+ is somewhat dubious: Ideally, pkey_free should revoke access to
+ that key and pkey_alloc of the same (numeric) key should not
+ implicitly confer access to already-running threads, but this is
+ not what happens in practice. */
+ {
+ /* The limit is in place to avoid running indefinitely in case
+ there many keys available. */
+ int *keys_array = xcalloc (100000, sizeof (*keys_array));
+ int keys_allocated = 0;
+ while (keys_allocated < 100000)
+ {
+ int new_key = pkey_alloc (0, PKEY_DISABLE_WRITE);
+ if (new_key < 0)
+ {
+ /* No key reuse observed before running out of keys. */
+ TEST_COMPARE (errno, ENOSPC);
+ break;
+ }
+ for (int i = 0; i < key_count; ++i)
+ if (new_key == keys[i])
+ {
+ /* We allocated the key with disabled write access.
+ This should affect the protection state of the
+ existing page. */
+ TEST_VERIFY (check_page_access (i, false));
+ TEST_VERIFY (!check_page_access (i, true));
+
+ xpthread_barrier_wait (&barrier);
+ struct thread_result *result = xpthread_join (delayed_thread);
+ /* The thread which was launched before should still have
+ access to the key. */
+ TEST_COMPARE (result->access_rights[i], 0);
+ struct thread_result *result2
+ = xpthread_join (result->next_thread);
+ /* Same for a thread which is launched afterwards from
+ the old thread. */
+ TEST_COMPARE (result2->access_rights[i], 0);
+ free (result);
+ free (result2);
+ keys_array[keys_allocated++] = new_key;
+ goto after_key_search;
+ }
+ /* Save key for later deallocation. */
+ keys_array[keys_allocated++] = new_key;
+ }
+ after_key_search:
+ /* Deallocate the keys allocated for testing purposes. */
+ for (int j = 0; j < keys_allocated; ++j)
+ TEST_COMPARE (pkey_free (keys_array[j]), 0);
+ free (keys_array);
+ }
+
+ for (int i = 0; i < key_count; ++i)
+ xmunmap ((void *) pages[i], pagesize);
+
+ xpthread_barrier_destroy (&barrier);
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-quota.c b/sysdeps/unix/sysv/linux/tst-quota.c
new file mode 100644
index 0000000000..84fd208c56
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-quota.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2016-2018 Free Software 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-rlimit-infinity.c b/sysdeps/unix/sysv/linux/tst-rlimit-infinity.c
new file mode 100644
index 0000000000..9460f6ca83
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-rlimit-infinity.c
@@ -0,0 +1,173 @@
+/* Copyright (C) 2018 Free Software 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 <stdio.h>
+#include <sys/resource.h>
+#include <support/check.h>
+
+static int resources[] = {
+ /* The following 7 limits are part of POSIX and must exist. */
+ RLIMIT_CORE,
+ RLIMIT_CPU,
+ RLIMIT_DATA,
+ RLIMIT_FSIZE,
+ RLIMIT_NOFILE,
+ RLIMIT_STACK,
+ RLIMIT_AS
+};
+
+#define nresources (sizeof (resources) / sizeof (resources[0]))
+
+/* Assume that the prlimit64 function calls the prlimit64 syscall without
+ mangling the arguments. */
+#define PRLIMIT64_INFINITY ((rlim64_t) -1)
+
+/* As we don't know which limit will be modified, use a sufficiently high
+ value to not shoot ourself in the foot. Use a 32-bit value to test
+ both the 32- and 64-bit versions, and keep the highest bit clear to
+ avoid sign extension. */
+#define PRLIMIT64_TESTVAL ((rlim64_t) 0x42420000)
+
+static void
+test_getrlimit (int resource, rlim_t exp_cur, rlim_t exp_max)
+{
+ struct rlimit r;
+ TEST_VERIFY_EXIT (getrlimit (resource, &r) == 0);
+ TEST_COMPARE (r.rlim_cur, exp_cur);
+ TEST_COMPARE (r.rlim_max, exp_max);
+}
+
+static void
+test_getrlimit64 (int resource, rlim64_t exp_cur, rlim64_t exp_max)
+{
+ struct rlimit64 r;
+ TEST_VERIFY_EXIT (getrlimit64 (resource, &r) == 0);
+ TEST_COMPARE (r.rlim_cur, exp_cur);
+ TEST_COMPARE (r.rlim_max, exp_max);
+}
+
+static void
+test_prlimit_get (int resource, rlim_t exp_cur, rlim_t exp_max)
+{
+ struct rlimit r;
+ TEST_VERIFY_EXIT (prlimit (0, resource, NULL, &r) == 0);
+ TEST_COMPARE (r.rlim_cur, exp_cur);
+ TEST_COMPARE (r.rlim_max, exp_max);
+}
+
+static void
+test_prlimit64_get (int resource, rlim64_t exp_cur, rlim64_t exp_max)
+{
+ struct rlimit64 r;
+ TEST_COMPARE (prlimit64 (0, resource, NULL, &r), 0);
+ TEST_COMPARE (r.rlim_cur, exp_cur);
+ TEST_COMPARE (r.rlim_max, exp_max);
+}
+
+static void
+test_setrlimit (int resource, rlim_t new_cur, rlim_t new_max)
+{
+ struct rlimit r = { new_cur, new_max };
+ TEST_COMPARE (setrlimit (resource, &r), 0);
+}
+
+static void
+test_setrlimit64 (int resource, rlim64_t new_cur, rlim64_t new_max)
+{
+ struct rlimit64 r = { new_cur, new_max };
+ TEST_COMPARE (setrlimit64 (resource, &r), 0);
+}
+
+static void
+test_prlimit_set (int resource, rlim_t new_cur, rlim_t new_max)
+{
+ struct rlimit r = { new_cur, new_max };
+ TEST_COMPARE (prlimit (0, resource, &r, NULL), 0);
+}
+
+static void
+test_prlimit64_set (int resource, rlim64_t new_cur, rlim64_t new_max)
+{
+ struct rlimit64 r = { new_cur, new_max };
+ TEST_COMPARE (prlimit64 (0, resource, &r, NULL), 0);
+}
+
+static int
+do_test (void)
+{
+ int resource = -1;
+
+ /* Find a resource with hard limit set to infinity, so that the soft limit
+ can be manipulated to any value. */
+ for (int i = 0; i < nresources; ++i)
+ {
+ struct rlimit64 r64;
+ int res = prlimit64 (0, resources[i], NULL, &r64);
+ if ((res == 0) && (r64.rlim_max == PRLIMIT64_INFINITY))
+ {
+ resource = resources[i];
+ break;
+ }
+ }
+
+ if (resource == -1)
+ FAIL_UNSUPPORTED
+ ("Could not find and limit with hard limit set to infinity.");
+
+ /* First check that the get functions work correctly with the test value. */
+ test_prlimit64_set (resource, PRLIMIT64_TESTVAL, PRLIMIT64_INFINITY);
+ test_getrlimit (resource, PRLIMIT64_TESTVAL, RLIM_INFINITY);
+ test_getrlimit64 (resource, PRLIMIT64_TESTVAL, RLIM64_INFINITY);
+ test_prlimit_get (resource, PRLIMIT64_TESTVAL, RLIM_INFINITY);
+ test_prlimit64_get (resource, PRLIMIT64_TESTVAL, RLIM64_INFINITY);
+
+ /* Then check that the get functions work correctly with infinity. */
+ test_prlimit64_set (resource, PRLIMIT64_INFINITY, PRLIMIT64_INFINITY);
+ test_getrlimit (resource, RLIM_INFINITY, RLIM_INFINITY);
+ test_getrlimit64 (resource, RLIM64_INFINITY, RLIM64_INFINITY);
+ test_prlimit_get (resource, RLIM_INFINITY, RLIM_INFINITY);
+ test_prlimit64_get (resource, RLIM64_INFINITY, RLIM64_INFINITY);
+
+ /* Then check that setrlimit works correctly with the test value. */
+ test_setrlimit (resource, PRLIMIT64_TESTVAL, RLIM_INFINITY);
+ test_prlimit64_get (resource, PRLIMIT64_TESTVAL, PRLIMIT64_INFINITY);
+
+ /* Then check that setrlimit works correctly with infinity. */
+ test_setrlimit (resource, RLIM_INFINITY, RLIM_INFINITY);
+ test_prlimit64_get (resource, PRLIMIT64_INFINITY, PRLIMIT64_INFINITY);
+
+ /* Then check that setrlimit64 works correctly with the test value. */
+ test_setrlimit64 (resource, PRLIMIT64_TESTVAL, RLIM64_INFINITY);
+ test_prlimit64_get (resource, PRLIMIT64_TESTVAL, PRLIMIT64_INFINITY);
+
+ /* Then check that setrlimit64 works correctly with infinity. */
+ test_setrlimit64 (resource, RLIM64_INFINITY, RLIM64_INFINITY);
+ test_prlimit64_get (resource, PRLIMIT64_INFINITY, PRLIMIT64_INFINITY);
+
+ /* Then check that prlimit works correctly with the test value. */
+ test_prlimit_set (resource, RLIM_INFINITY, RLIM_INFINITY);
+ test_prlimit64_get (resource, PRLIMIT64_INFINITY, PRLIMIT64_INFINITY);
+
+ /* Finally check that prlimit works correctly with infinity. */
+ test_prlimit_set (resource, PRLIMIT64_TESTVAL, RLIM_INFINITY);
+ test_prlimit64_get (resource, PRLIMIT64_TESTVAL, PRLIMIT64_INFINITY);
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-setgetname.c b/sysdeps/unix/sysv/linux/tst-setgetname.c
index f490d8354c..b80ff59074 100644
--- a/sysdeps/unix/sysv/linux/tst-setgetname.c
+++ b/sysdeps/unix/sysv/linux/tst-setgetname.c
@@ -1,5 +1,5 @@
/* Test pthread_setname_np and pthread_getname_np.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,6 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#include <kernel-features.h>
/* New name of process. */
#define NEW_NAME "setname"
@@ -56,7 +55,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);
@@ -101,18 +100,6 @@ do_test (int argc, char **argv)
{
res = get_self_comm (gettid (), name_check, TASK_COMM_LEN);
-#ifndef __ASSUME_PROC_PID_TASK_COMM
- /* On this first test we look for ENOENT to be returned from
- get_self_comm to indicate that the kernel is older than
- 2.6.33 and doesn't contain comm within the proc structure.
- In that case we skip the entire test. */
- if (res == ENOENT)
- {
- printf ("SKIP: The kernel does not have /proc/self/task/%%lu/comm.\n");
- return 0;
- }
-#endif
-
if (res == 0)
{
if (strncmp (name, name_check, strlen (BIG_NAME)) == 0)
diff --git a/sysdeps/unix/sysv/linux/tst-signal-numbers.sh b/sysdeps/unix/sysv/linux/tst-signal-numbers.sh
new file mode 100644
index 0000000000..e1f7be0337
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-signal-numbers.sh
@@ -0,0 +1,86 @@
+#! /bin/sh
+# Test that glibc's signal numbers match the kernel's.
+# Copyright (C) 2017-2018 Free Software 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/>.
+
+set -e
+if [ -n "$BASH_VERSION" ]; then set -o pipefail; fi
+LC_ALL=C; export LC_ALL
+
+# We cannot use Linux's asm/signal.h to define signal numbers, because
+# it isn't sufficiently namespace-clean. Instead, this test checks
+# that our signal numbers match the kernel's. This script expects
+# "$@" to be $(CC) $(CPPFLAGS) as set by glibc's Makefiles, and $AWK
+# to be set in the environment.
+
+# Before doing anything else, fail if the compiler doesn't work.
+"$@" -E -xc -dM - < /dev/null > /dev/null
+
+tmpG=`mktemp -t signums_glibc.XXXXXXXXX`
+tmpK=`mktemp -t signums_kernel.XXXXXXXXX`
+trap "rm -f '$tmpG' '$tmpK'" 0
+
+# Filter out constants that aren't signal numbers.
+# If SIGPOLL is defined as SIGIO, swap it around so SIGIO is defined as
+# SIGPOLL. Similarly for SIGABRT and SIGIOT.
+# Discard obsolete signal numbers and unrelated constants:
+# SIGCLD, SIGIOT, SIGSWI, SIGUNUSED.
+# SIGSTKSZ, SIGRTMIN, SIGRTMAX.
+# Then sort the list.
+filter_defines ()
+{
+ $AWK '
+/^#define SIG[A-Z]+ ([0-9]+|SIG[A-Z0-9]+)$/ { signals[$2] = $3 }
+END {
+ if ("SIGPOLL" in signals && "SIGIO" in signals &&
+ signals["SIGPOLL"] == "SIGIO") {
+ signals["SIGPOLL"] = signals["SIGIO"]
+ signals["SIGIO"] = "SIGPOLL"
+ }
+ if ("SIGABRT" in signals && "SIGIOT" in signals &&
+ signals["SIGABRT"] == "SIGIOT") {
+ signals["SIGABRT"] = signals["SIGIOT"]
+ signals["SIGIOT"] = "SIGABRT"
+ }
+ for (sig in signals) {
+ if (sig !~ /^SIG(CLD|IOT|RT(MIN|MAX)|STKSZ|SWI|UNUSED)$/) {
+ printf("#define %s %s\n", sig, signals[sig])
+ }
+ }
+}' | sort
+}
+
+# $CC may contain command-line switches, so it should be word-split.
+printf '%s' '#define _GNU_SOURCE 1
+#include <signal.h>
+' |
+ "$@" -E -xc -dM - |
+ filter_defines > "$tmpG"
+
+printf '%s' '#define _GNU_SOURCE 1
+#define __ASSEMBLER__ 1
+#include <asm/signal.h>
+' |
+ "$@" -E -xc -dM - |
+ filter_defines > "$tmpK"
+
+if cmp -s "$tmpG" "$tmpK"; then
+ exit 0
+else
+ diff -u "$tmpG" "$tmpK"
+ exit 1
+fi
diff --git a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
index af4ea44c5b..695c1ccdbd 100644
--- a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
+++ b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
@@ -1,5 +1,5 @@
/* Generic test case for CPU affinity functions.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tst-skeleton-thread-affinity.c b/sysdeps/unix/sysv/linux/tst-skeleton-thread-affinity.c
index d9677436d6..8aea14ab15 100644
--- a/sysdeps/unix/sysv/linux/tst-skeleton-thread-affinity.c
+++ b/sysdeps/unix/sysv/linux/tst-skeleton-thread-affinity.c
@@ -1,5 +1,5 @@
/* Generic test for CPU affinity functions, multi-threaded variant.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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..680ccde219
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-sync_file_range.c
@@ -0,0 +1,132 @@
+/* Basic sync_file_range (not specific flag is checked).
+ Copyright (C) 2016-2018 Free Software 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 <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+
+#include <support/temp_file.h>
+#include <support/check.h>
+
+#define XSTR(s) STR(S)
+#define STR(s) #s
+
+static char *temp_filename;
+static int temp_fd;
+
+static char fifoname[] = "/tmp/tst-posix_fadvise-fifo-XXXXXX";
+static int fifofd;
+
+void
+do_prepare (int argc, char **argv)
+{
+ 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");
+}
+#define PREPARE do_prepare
+
+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;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-syscall-list.sh b/sysdeps/unix/sysv/linux/tst-syscall-list.sh
new file mode 100644
index 0000000000..d97662e810
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-syscall-list.sh
@@ -0,0 +1,99 @@
+#!/bin/bash
+# Consistency checks for the system call list
+# Copyright (C) 2017-2018 Free Software 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/>.
+
+export LC_ALL=C
+set -e
+set -o pipefail
+
+if test $# != 4; then
+ echo "error: wrong number of arguments: $#"
+ exit 1
+fi
+
+macros="$1"
+list_nr="$2"
+list_sys="$3"
+GAWK="$4"
+
+linux_version="$("$GAWK" \
+ '/#define LINUX_VERSION_CODE / {print $3}' < "$macros")"
+glibc_linux_version="$("$GAWK" \
+ '/#define __GLIBC_LINUX_VERSION_CODE / {print $3}' < "$macros")"
+
+echo "info: LINUX_VERSION_CODE: $linux_version"
+echo "info: __GLIBC_LINUX_VERSION_CODE: $glibc_linux_version"
+# Ignore the subrelease in the comparison.
+if test $(expr "$glibc_linux_version" / 256) \
+ -lt $(expr "$linux_version" / 256); then
+ echo "info: The kernel major/minor version is newer than the glibc version"
+ kernel_newer=true
+else
+ kernel_newer=false
+fi
+echo
+
+errors=0
+
+# Use getpid as a system call which is expected to be always defined.
+# alpha uses getxpid instead, so it is permitted as an alternative.
+if ! grep -E -q '^getx?pid$' -- "$list_nr"; then
+ echo "error: __NR_getpid not defined"
+ errors=1
+fi
+if ! grep -E -q '^getx?pid$' -- "$list_sys"; then
+ echo "error: SYS_getpid not defined"
+ errors=1
+fi
+
+comm_1="$(mktemp)"
+comm_2="$(mktemp)"
+comm_result="$(mktemp)"
+cleanup () {
+ rm -f -- "$comm_1" "$comm_2" "$comm_result"
+}
+trap cleanup 0
+
+sort -o "$comm_1" -- "$list_nr"
+sort -o "$comm_2" -- "$list_sys"
+
+# Check for missing SYS_* macros.
+comm --check-order -2 -3 -- "$comm_1" "$comm_2" > "$comm_result"
+if test -s "$comm_result"; then
+ echo "error: These system calls need to be added to syscall-names.list:"
+ cat -- "$comm_result"
+ # This is only an error if our version is older than the kernel
+ # version because we cannot predict future kernel development.
+ if $kernel_newer; then
+ echo
+ echo "warning: This error has been ignored because the glibc"
+ echo "warning: system call list is older than the kernel version."
+ else
+ errors=1
+ fi
+fi
+
+# Check for additional SYS_* macros.
+comm --check-order -1 -3 -- "$comm_1" "$comm_2" > "$comm_result"
+if test -s "$comm_result"; then
+ echo "error: The following system calls have unexpected SYS_* macros:"
+ cat -- "$comm_result"
+ errors=1
+fi
+
+exit "$errors"
diff --git a/sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c b/sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c
new file mode 100644
index 0000000000..c5ced1d86b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c
@@ -0,0 +1,27 @@
+/* Check IOV_MAX definition: Helper function to capture UAPI header value.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* Use a separate function to avoid header compatibility issues. */
+
+#include <linux/uio.h>
+
+long
+uio_maxiov_value (void)
+{
+ return UIO_MAXIOV;
+}
diff --git a/sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c b/sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c
new file mode 100644
index 0000000000..315a1dcf43
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c
@@ -0,0 +1,40 @@
+/* Check IOV_MAX definition for consistency (bug 22321).
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* Defined in tst-sysconf-iov_max-uapi.c. */
+long uio_maxiov_value (void);
+
+
+#include <limits.h>
+#include <support/check.h>
+#include <sys/uio.h>
+#include <unistd.h>
+
+static int
+do_test (void)
+{
+ TEST_VERIFY (_XOPEN_IOV_MAX == 16); /* Value required by POSIX. */
+ TEST_VERIFY (uio_maxiov_value () >= _XOPEN_IOV_MAX);
+ TEST_VERIFY (IOV_MAX == uio_maxiov_value ());
+ TEST_VERIFY (UIO_MAXIOV == uio_maxiov_value ());
+ TEST_VERIFY (sysconf (_SC_UIO_MAXIOV) == uio_maxiov_value ());
+ TEST_VERIFY (sysconf (_SC_IOV_MAX) == uio_maxiov_value ());
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread.c b/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread.c
index 145770a5d7..f8f96befd6 100644
--- a/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread.c
+++ b/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread.c
@@ -1,5 +1,5 @@
/* Multi-threaded test for pthread_getaffinity_np, pthread_setaffinity_np.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread2.c b/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread2.c
index 282359a6cd..ebd573d399 100644
--- a/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread2.c
+++ b/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread2.c
@@ -1,5 +1,5 @@
/* Separate thread test for pthread_getaffinity_np, pthread_setaffinity_np.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tst-thread-affinity-sched.c b/sysdeps/unix/sysv/linux/tst-thread-affinity-sched.c
index 4c27c85670..b8944a5ca5 100644
--- a/sysdeps/unix/sysv/linux/tst-thread-affinity-sched.c
+++ b/sysdeps/unix/sysv/linux/tst-thread-affinity-sched.c
@@ -1,5 +1,5 @@
/* Multi-threaded test for sched_getaffinity_np, sched_setaffinity_np.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/tst-ttyname.c b/sysdeps/unix/sysv/linux/tst-ttyname.c
new file mode 100644
index 0000000000..35450e1c62
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-ttyname.c
@@ -0,0 +1,577 @@
+/* Copyright (C) 2017-2018 Free Software 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 <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <sched.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mount.h>
+#include <sys/prctl.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include <support/check.h>
+#include <support/namespace.h>
+#include <support/support.h>
+#include <support/temp_file.h>
+#include <support/test-driver.h>
+#include <support/xunistd.h>
+
+/* generic utilities */
+
+#define VERIFY(expr) \
+ do { \
+ if (!(expr)) \
+ { \
+ printf ("error: %s:%d: %s: %m\n", \
+ __FILE__, __LINE__, #expr); \
+ exit (1); \
+ } \
+ } while (0)
+
+static void
+touch (const char *path, mode_t mode)
+{
+ xclose (xopen (path, O_WRONLY|O_CREAT|O_NOCTTY, mode));
+}
+
+static size_t
+trim_prefix (char *str, size_t str_len, const char *prefix)
+{
+ size_t prefix_len = strlen (prefix);
+ if (str_len > prefix_len && memcmp (str, prefix, prefix_len) == 0)
+ {
+ memmove (str, str + prefix_len, str_len - prefix_len);
+ return str_len - prefix_len;
+ }
+ return str_len;
+}
+
+/* returns a pointer to static storage */
+static char *
+proc_fd_readlink (const char *linkname)
+{
+ static char target[PATH_MAX+1];
+ ssize_t target_len = readlink (linkname, target, PATH_MAX);
+ VERIFY (target_len > 0);
+ target_len = trim_prefix (target, target_len, "(unreachable)");
+ target[target_len] = '\0';
+ return target;
+}
+
+/* plain ttyname runner */
+
+struct result
+{
+ const char *name;
+ int err;
+};
+
+/* strings in result structure are in static storage */
+static struct result
+run_ttyname (int fd)
+{
+ struct result ret;
+ errno = 0;
+ ret.name = ttyname (fd);
+ ret.err = errno;
+ return ret;
+}
+
+static bool
+eq_ttyname (struct result actual, struct result expected)
+{
+ char *actual_name, *expected_name;
+
+ if ((actual.err == expected.err) &&
+ (!actual.name == !expected.name) &&
+ (actual.name ? strcmp (actual.name, expected.name) == 0 : true))
+ {
+ if (expected.name)
+ expected_name = xasprintf ("\"%s\"", expected.name);
+ else
+ expected_name = xstrdup ("NULL");
+
+ printf ("info: ttyname: PASS {name=%s, errno=%d}\n",
+ expected_name, expected.err);
+
+ free (expected_name);
+ return true;
+ }
+
+ if (actual.name)
+ actual_name = xasprintf ("\"%s\"", actual.name);
+ else
+ actual_name = xstrdup ("NULL");
+
+ if (expected.name)
+ expected_name = xasprintf ("\"%s\"", expected.name);
+ else
+ expected_name = xstrdup ("NULL");
+
+ printf ("error: ttyname: actual {name=%s, errno=%d} != expected {name=%s, errno=%d}\n",
+ actual_name, actual.err,
+ expected_name, expected.err);
+
+ free (actual_name);
+ free (expected_name);
+ return false;
+}
+
+/* ttyname_r runner */
+
+struct result_r
+{
+ const char *name;
+ int ret;
+ int err;
+};
+
+/* strings in result structure are in static storage */
+static struct result_r
+run_ttyname_r (int fd)
+{
+ static char buf[TTY_NAME_MAX];
+
+ struct result_r ret;
+ errno = 0;
+ ret.ret = ttyname_r (fd, buf, TTY_NAME_MAX);
+ ret.err = errno;
+ if (ret.ret == 0)
+ ret.name = buf;
+ else
+ ret.name = NULL;
+ return ret;
+}
+
+static bool
+eq_ttyname_r (struct result_r actual, struct result_r expected)
+{
+ char *actual_name, *expected_name;
+
+ if ((actual.err == expected.err) &&
+ (actual.ret == expected.ret) &&
+ (!actual.name == !expected.name) &&
+ (actual.name ? strcmp (actual.name, expected.name) == 0 : true))
+ {
+ if (expected.name)
+ expected_name = xasprintf ("\"%s\"", expected.name);
+ else
+ expected_name = xstrdup ("NULL");
+
+ printf ("info: ttyname_r: PASS {name=%s, ret=%d, errno=%d}\n",
+ expected_name, expected.ret, expected.err);
+
+ free (expected_name);
+ return true;
+ }
+
+ if (actual.name)
+ actual_name = xasprintf ("\"%s\"", actual.name);
+ else
+ actual_name = xstrdup ("NULL");
+
+ if (expected.name)
+ expected_name = xasprintf ("\"%s\"", expected.name);
+ else
+ expected_name = xstrdup ("NULL");
+
+ printf ("error: ttyname_r: actual {name=%s, ret=%d, errno=%d} != expected {name=%s, ret=%d, errno=%d}\n",
+ actual_name, actual.ret, actual.err,
+ expected_name, expected.ret, expected.err);
+
+ free (actual_name);
+ free (expected_name);
+ return false;
+}
+
+/* combined runner */
+
+static bool
+doit (int fd, const char *testname, struct result_r expected_r)
+{
+ struct result expected = {.name=expected_r.name, .err=expected_r.ret};
+ bool ret = true;
+
+ printf ("info: testcase: %s\n", testname);
+
+ if (!eq_ttyname (run_ttyname (fd), expected))
+ ret = false;
+ if (!eq_ttyname_r (run_ttyname_r (fd), expected_r))
+ ret = false;
+
+ if (!ret)
+ support_record_failure ();
+
+ return ret;
+}
+
+/* chroot setup */
+
+static char *chrootdir;
+
+static void
+prepare (int argc, char **argv)
+{
+ chrootdir = xasprintf ("%s/tst-ttyname-XXXXXX", test_dir);
+ if (mkdtemp (chrootdir) == NULL)
+ FAIL_EXIT1 ("mkdtemp (\"%s\"): %m", chrootdir);
+ add_temp_file (chrootdir);
+}
+#define PREPARE prepare
+
+/* These chroot setup functions put the TTY at at "/console" (where it
+ won't be found by ttyname), and create "/dev/console" as an
+ ordinary file. This way, it's easier to write test-cases that
+ expect ttyname to fail; test-cases that expect it to succeed need
+ to explicitly remount it at "/dev/console". */
+
+static int
+do_in_chroot_1 (int (*cb)(const char *, int))
+{
+ printf ("info: entering chroot 1\n");
+
+ /* Open the PTS that we'll be testing on. */
+ int master;
+ char *slavename;
+ master = posix_openpt (O_RDWR|O_NOCTTY|O_NONBLOCK);
+ if (master < 0)
+ {
+ if (errno == ENOENT)
+ FAIL_UNSUPPORTED ("posix_openpt: %m");
+ else
+ FAIL_EXIT1 ("posix_openpt: %m");
+ }
+ VERIFY ((slavename = ptsname (master)));
+ VERIFY (unlockpt (master) == 0);
+ if (strncmp (slavename, "/dev/pts/", 9) != 0)
+ FAIL_UNSUPPORTED ("slave pseudo-terminal is not under /dev/pts/: %s",
+ slavename);
+ int slave = xopen (slavename, O_RDWR, 0);
+ if (!doit (slave, "basic smoketest",
+ (struct result_r){.name=slavename, .ret=0, .err=0}))
+ return 1;
+
+ pid_t pid = xfork ();
+ if (pid == 0)
+ {
+ xclose (master);
+
+ if (!support_enter_mount_namespace ())
+ FAIL_UNSUPPORTED ("could not enter new mount namespace");
+
+ VERIFY (mount ("tmpfs", chrootdir, "tmpfs", 0, "mode=755") == 0);
+ VERIFY (chdir (chrootdir) == 0);
+
+ xmkdir ("proc", 0755);
+ xmkdir ("dev", 0755);
+ xmkdir ("dev/pts", 0755);
+
+ VERIFY (mount ("/proc", "proc", NULL, MS_BIND|MS_REC, NULL) == 0);
+ VERIFY (mount ("devpts", "dev/pts", "devpts",
+ MS_NOSUID|MS_NOEXEC,
+ "newinstance,ptmxmode=0666,mode=620") == 0);
+ VERIFY (symlink ("pts/ptmx", "dev/ptmx") == 0);
+
+ touch ("console", 0);
+ touch ("dev/console", 0);
+ VERIFY (mount (slavename, "console", NULL, MS_BIND, NULL) == 0);
+
+ xchroot (".");
+
+ char *linkname = xasprintf ("/proc/self/fd/%d", slave);
+ char *target = proc_fd_readlink (linkname);
+ VERIFY (strcmp (target, slavename) == 0);
+ free (linkname);
+
+ _exit (cb (slavename, slave));
+ }
+ int status;
+ xwaitpid (pid, &status, 0);
+ VERIFY (WIFEXITED (status));
+ xclose (master);
+ xclose (slave);
+ return WEXITSTATUS (status);
+}
+
+static int
+do_in_chroot_2 (int (*cb)(const char *, int))
+{
+ printf ("info: entering chroot 2\n");
+
+ int pid_pipe[2];
+ xpipe (pid_pipe);
+ int exit_pipe[2];
+ xpipe (exit_pipe);
+
+ /* Open the PTS that we'll be testing on. */
+ int master;
+ char *slavename;
+ VERIFY ((master = posix_openpt (O_RDWR|O_NOCTTY|O_NONBLOCK)) >= 0);
+ VERIFY ((slavename = ptsname (master)));
+ VERIFY (unlockpt (master) == 0);
+ if (strncmp (slavename, "/dev/pts/", 9) != 0)
+ FAIL_UNSUPPORTED ("slave pseudo-terminal is not under /dev/pts/: %s",
+ slavename);
+ /* wait until in a new mount ns to open the slave */
+
+ /* enable `wait`ing on grandchildren */
+ VERIFY (prctl (PR_SET_CHILD_SUBREAPER, 1) == 0);
+
+ pid_t pid = xfork (); /* outer child */
+ if (pid == 0)
+ {
+ xclose (master);
+ xclose (pid_pipe[0]);
+ xclose (exit_pipe[1]);
+
+ if (!support_enter_mount_namespace ())
+ FAIL_UNSUPPORTED ("could not enter new mount namespace");
+
+ int slave = xopen (slavename, O_RDWR, 0);
+ if (!doit (slave, "basic smoketest",
+ (struct result_r){.name=slavename, .ret=0, .err=0}))
+ _exit (1);
+
+ VERIFY (mount ("tmpfs", chrootdir, "tmpfs", 0, "mode=755") == 0);
+ VERIFY (chdir (chrootdir) == 0);
+
+ xmkdir ("proc", 0755);
+ xmkdir ("dev", 0755);
+ xmkdir ("dev/pts", 0755);
+
+ VERIFY (mount ("devpts", "dev/pts", "devpts",
+ MS_NOSUID|MS_NOEXEC,
+ "newinstance,ptmxmode=0666,mode=620") == 0);
+ VERIFY (symlink ("pts/ptmx", "dev/ptmx") == 0);
+
+ touch ("console", 0);
+ touch ("dev/console", 0);
+ VERIFY (mount (slavename, "console", NULL, MS_BIND, NULL) == 0);
+
+ xchroot (".");
+
+ if (unshare (CLONE_NEWNS | CLONE_NEWPID) < 0)
+ FAIL_UNSUPPORTED ("could not enter new PID namespace");
+ pid = xfork (); /* inner child */
+ if (pid == 0)
+ {
+ xclose (pid_pipe[1]);
+
+ /* wait until the outer child has exited */
+ char c;
+ VERIFY (read (exit_pipe[0], &c, 1) == 0);
+ xclose (exit_pipe[0]);
+
+ VERIFY (mount ("proc", "/proc", "proc",
+ MS_NOSUID|MS_NOEXEC|MS_NODEV, NULL) == 0);
+
+ char *linkname = xasprintf ("/proc/self/fd/%d", slave);
+ char *target = proc_fd_readlink (linkname);
+ VERIFY (strcmp (target, strrchr (slavename, '/')) == 0);
+ free (linkname);
+
+ _exit (cb (slavename, slave));
+ }
+ xwrite (pid_pipe[1], &pid, sizeof pid);
+ _exit (0);
+ }
+ xclose (pid_pipe[1]);
+ xclose (exit_pipe[0]);
+ xclose (exit_pipe[1]);
+
+ /* wait for the outer child */
+ int status;
+ xwaitpid (pid, &status, 0);
+ VERIFY (WIFEXITED (status));
+ int ret = WEXITSTATUS (status);
+ if (ret != 0)
+ return ret;
+
+ /* set 'pid' to the inner child */
+ VERIFY (read (pid_pipe[0], &pid, sizeof pid) == sizeof pid);
+ xclose (pid_pipe[0]);
+
+ /* wait for the inner child */
+ xwaitpid (pid, &status, 0);
+ VERIFY (WIFEXITED (status));
+ xclose (master);
+ return WEXITSTATUS (status);
+}
+
+/* main test */
+
+static int
+run_chroot_tests (const char *slavename, int slave)
+{
+ struct stat st;
+ bool ok = true;
+
+ /* There are 3 groups of tests here. The first group fairly
+ generically does things known to mess up ttyname, and verifies
+ that ttyname copes correctly. The remaining groups are
+ increasingly convoluted, as we target specific parts of ttyname
+ to try to confuse. */
+
+ /* Basic tests that it doesn't get confused by multiple devpts
+ instances. */
+ {
+ VERIFY (stat (slavename, &st) < 0); /* sanity check */
+ if (!doit (slave, "no conflict, no match",
+ (struct result_r){.name=NULL, .ret=ENODEV, .err=ENODEV}))
+ ok = false;
+ VERIFY (mount ("/console", "/dev/console", NULL, MS_BIND, NULL) == 0);
+ if (!doit (slave, "no conflict, console",
+ (struct result_r){.name="/dev/console", .ret=0, .err=0}))
+ ok = false;
+ VERIFY (umount ("/dev/console") == 0);
+
+ /* keep creating PTYs until we we get a name collision */
+ while (stat (slavename, &st) < 0)
+ posix_openpt (O_RDWR|O_NOCTTY|O_NONBLOCK);
+ VERIFY (stat (slavename, &st) == 0);
+
+ if (!doit (slave, "conflict, no match",
+ (struct result_r){.name=NULL, .ret=ENODEV, .err=ENODEV}))
+ ok = false;
+ VERIFY (mount ("/console", "/dev/console", NULL, MS_BIND, NULL) == 0);
+ if (!doit (slave, "conflict, console",
+ (struct result_r){.name="/dev/console", .ret=0, .err=0}))
+ ok = false;
+ VERIFY (umount ("/dev/console") == 0);
+ }
+
+ /* The first tests kinda assumed that they hit certain code-paths
+ based on assuming that the readlink target is 'slavename', but
+ that's not quite always true. They're still a good preliminary
+ sanity check, so keep them, but let's add tests that make sure
+ that those code-paths are hit by doing a readlink ourself. */
+ {
+ char *linkname = xasprintf ("/proc/self/fd/%d", slave);
+ char *target = proc_fd_readlink (linkname);
+ free (linkname);
+ /* Depeding on how we set up the chroot, the kernel may or may not
+ trim the leading path to the target (it may give us "/6",
+ instead of "/dev/pts/6"). We test it both ways (do_in_chroot_1
+ and do_in_chroot_2). This test group relies on the target
+ existing, so guarantee that it does exist by creating it if
+ necessary. */
+ if (stat (target, &st) < 0)
+ {
+ VERIFY (errno == ENOENT);
+ touch (target, 0);
+ }
+
+ VERIFY (mount ("/console", "/dev/console", NULL, MS_BIND, NULL) == 0);
+ VERIFY (mount ("/console", target, NULL, MS_BIND, NULL) == 0);
+ if (!doit (slave, "with readlink target",
+ (struct result_r){.name=target, .ret=0, .err=0}))
+ ok = false;
+ VERIFY (umount (target) == 0);
+ VERIFY (umount ("/dev/console") == 0);
+
+ VERIFY (mount ("/console", "/dev/console", NULL, MS_BIND, NULL) == 0);
+ VERIFY (mount (slavename, target, NULL, MS_BIND, NULL) == 0);
+ if (!doit (slave, "with readlink trap; fallback",
+ (struct result_r){.name="/dev/console", .ret=0, .err=0}))
+ ok = false;
+ VERIFY (umount (target) == 0);
+ VERIFY (umount ("/dev/console") == 0);
+
+ VERIFY (mount (slavename, target, NULL, MS_BIND, NULL) == 0);
+ if (!doit (slave, "with readlink trap; no fallback",
+ (struct result_r){.name=NULL, .ret=ENODEV, .err=ENODEV}))
+ ok = false;
+ VERIFY (umount (target) == 0);
+ }
+
+ /* This test makes sure that everything still works OK if readdir
+ finds a pseudo-match before and/or after the actual match. Now,
+ to do that, we need to control that readdir finds the
+ pseudo-matches before and after the actual match; and there's no
+ good way to control that order in absence of whitebox testing.
+ So, just create 3 files, then use opendir/readdir to see what
+ order they are in, and assign meaning based on that order, not by
+ name; assigning the first to be a pseudo-match, the second to be
+ the actual match, and the third to be a pseudo-match. This
+ assumes that (on tmpfs) ordering within the directory is stable
+ in the absence of modification, which seems reasonably safe. */
+ {
+ /* since we're testing the fallback search, disable the readlink
+ happy-path */
+ VERIFY (umount2 ("/proc", MNT_DETACH) == 0);
+
+ touch ("/dev/console1", 0);
+ touch ("/dev/console2", 0);
+ touch ("/dev/console3", 0);
+
+ char *c[3];
+ int ci = 0;
+ DIR *dirstream = opendir ("/dev");
+ VERIFY (dirstream != NULL);
+ struct dirent *d;
+ while ((d = readdir (dirstream)) != NULL && ci < 3)
+ {
+ if (strcmp (d->d_name, "console1") &&
+ strcmp (d->d_name, "console2") &&
+ strcmp (d->d_name, "console3") )
+ continue;
+ c[ci++] = xasprintf ("/dev/%s", d->d_name);
+ }
+ VERIFY (ci == 3);
+ VERIFY (closedir (dirstream) == 0);
+
+ VERIFY (mount (slavename, c[0], NULL, MS_BIND, NULL) == 0);
+ VERIFY (mount ("/console", c[1], NULL, MS_BIND, NULL) == 0);
+ VERIFY (mount (slavename, c[2], NULL, MS_BIND, NULL) == 0);
+ VERIFY (umount2 ("/dev/pts", MNT_DETACH) == 0);
+ if (!doit (slave, "with search-path trap",
+ (struct result_r){.name=c[1], .ret=0, .err=0}))
+ ok = false;
+ for (int i = 0; i < 3; i++)
+ {
+ VERIFY (umount (c[i]) == 0);
+ VERIFY (unlink (c[i]) == 0);
+ free (c[i]);
+ }
+ }
+
+ return ok ? 0 : 1;
+}
+
+static int
+do_test (void)
+{
+ support_become_root ();
+
+ int ret1 = do_in_chroot_1 (run_chroot_tests);
+ if (ret1 == EXIT_UNSUPPORTED)
+ return ret1;
+
+ int ret2 = do_in_chroot_2 (run_chroot_tests);
+ if (ret2 == EXIT_UNSUPPORTED)
+ return ret2;
+
+ return ret1 | ret2;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/ttyname.c b/sysdeps/unix/sysv/linux/ttyname.c
index 7a001b4445..f18b4ba333 100644
--- a/sysdeps/unix/sysv/linux/ttyname.c
+++ b/sysdeps/unix/sysv/linux/ttyname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,21 +28,21 @@
#include <_itoa.h>
+#include "ttyname.h"
+
#if 0
/* Is this used anywhere? It is not exported. */
char *__ttyname;
#endif
-static char *getttyname (const char *dev, dev_t mydev,
- ino64_t myino, int save, int *dostat)
- internal_function;
-
+static char *getttyname (const char *dev, const struct stat64 *mytty,
+ int save, int *dostat);
libc_freeres_ptr (static char *getttyname_name);
static char *
-internal_function attribute_compat_text_section
-getttyname (const char *dev, dev_t mydev, ino64_t myino, int save, int *dostat)
+attribute_compat_text_section
+getttyname (const char *dev, const struct stat64 *mytty, int save, int *dostat)
{
static size_t namelen;
struct stat64 st;
@@ -63,7 +63,7 @@ getttyname (const char *dev, dev_t mydev, ino64_t myino, int save, int *dostat)
*((char *) __mempcpy (getttyname_name, dev, devlen - 1)) = '/';
while ((d = __readdir64 (dirstream)) != NULL)
- if ((d->d_fileno == myino || *dostat)
+ if ((d->d_fileno == mytty->st_ino || *dostat)
&& strcmp (d->d_name, "stdin")
&& strcmp (d->d_name, "stdout")
&& strcmp (d->d_name, "stderr"))
@@ -85,12 +85,7 @@ getttyname (const char *dev, dev_t mydev, ino64_t myino, int save, int *dostat)
}
memcpy (&getttyname_name[devlen], d->d_name, dlen);
if (__xstat64 (_STAT_VER, getttyname_name, &st) == 0
-#ifdef _STATBUF_ST_RDEV
- && S_ISCHR (st.st_mode) && st.st_rdev == mydev
-#else
- && d->d_fileno == myino && st.st_dev == mydev
-#endif
- )
+ && is_mytty (mytty, &st))
{
(void) __closedir (dirstream);
#if 0
@@ -120,6 +115,7 @@ ttyname (int fd)
char procname[30];
struct stat64 st, st1;
int dostat = 0;
+ int doispty = 0;
char *name;
int save = errno;
struct termios term;
@@ -167,24 +163,15 @@ ttyname (int fd)
/* Verify readlink result, fall back on iterating through devices. */
if (ttyname_buf[0] == '/'
&& __xstat64 (_STAT_VER, ttyname_buf, &st1) == 0
-#ifdef _STATBUF_ST_RDEV
- && S_ISCHR (st1.st_mode)
- && st1.st_rdev == st.st_rdev
-#else
- && st1.st_ino == st.st_ino
- && st1.st_dev == st.st_dev
-#endif
- )
+ && is_mytty (&st, &st1))
return ttyname_buf;
+
+ doispty = 1;
}
if (__xstat64 (_STAT_VER, "/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode))
{
-#ifdef _STATBUF_ST_RDEV
- name = getttyname ("/dev/pts", st.st_rdev, st.st_ino, save, &dostat);
-#else
- name = getttyname ("/dev/pts", st.st_dev, st.st_ino, save, &dostat);
-#endif
+ name = getttyname ("/dev/pts", &st, save, &dostat);
}
else
{
@@ -194,21 +181,23 @@ ttyname (int fd)
if (!name && dostat != -1)
{
-#ifdef _STATBUF_ST_RDEV
- name = getttyname ("/dev", st.st_rdev, st.st_ino, save, &dostat);
-#else
- name = getttyname ("/dev", st.st_dev, st.st_ino, save, &dostat);
-#endif
+ name = getttyname ("/dev", &st, save, &dostat);
}
if (!name && dostat != -1)
{
dostat = 1;
-#ifdef _STATBUF_ST_RDEV
- name = getttyname ("/dev", st.st_rdev, st.st_ino, save, &dostat);
-#else
- name = getttyname ("/dev", st.st_dev, st.st_ino, save, &dostat);
-#endif
+ name = getttyname ("/dev", &st, save, &dostat);
+ }
+
+ if (!name && doispty && is_pty (&st))
+ {
+ /* We failed to figure out the TTY's name, but we can at least
+ signal that we did verify that it really is a PTY slave.
+ This happens when we have inherited the file descriptor from
+ a different mount namespace. */
+ __set_errno (ENODEV);
+ return NULL;
}
return name;
diff --git a/sysdeps/unix/sysv/linux/ttyname.h b/sysdeps/unix/sysv/linux/ttyname.h
new file mode 100644
index 0000000000..8ef0a16101
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ttyname.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 2016-2018 Free Software 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 <unistd.h>
+#include <stdbool.h>
+#include <sys/sysmacros.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+/* Return true if this is a UNIX98 pty device, as defined in
+ linux/Documentation/devices.txt (on linux < 4.10) or
+ linux/Documentation/admin-guide/devices.txt (on linux >= 4.10). */
+static inline bool
+is_pty (struct stat64 *sb)
+{
+#ifdef _STATBUF_ST_RDEV
+ int m = __gnu_dev_major (sb->st_rdev);
+ return (136 <= m && m <= 143);
+#else
+ return false;
+#endif
+}
+
+static inline bool
+is_mytty (const struct stat64 *mytty, const struct stat64 *maybe)
+{
+ return (maybe->st_ino == mytty->st_ino
+ && maybe->st_dev == mytty->st_dev
+#ifdef _STATBUF_ST_RDEV
+ && S_ISCHR (maybe->st_mode)
+ && maybe->st_rdev == mytty->st_rdev
+#endif
+ );
+}
diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c b/sysdeps/unix/sysv/linux/ttyname_r.c
index d15bc746d9..66dcbde318 100644
--- a/sysdeps/unix/sysv/linux/ttyname_r.c
+++ b/sysdeps/unix/sysv/linux/ttyname_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,13 +28,15 @@
#include <_itoa.h>
+#include "ttyname.h"
+
static int getttyname_r (char *buf, size_t buflen,
- dev_t mydev, ino64_t myino, int save,
- int *dostat) internal_function;
+ const struct stat64 *mytty, int save,
+ int *dostat);
static int
-internal_function attribute_compat_text_section
-getttyname_r (char *buf, size_t buflen, dev_t mydev, ino64_t myino,
+attribute_compat_text_section
+getttyname_r (char *buf, size_t buflen, const struct stat64 *mytty,
int save, int *dostat)
{
struct stat64 st;
@@ -50,7 +52,7 @@ getttyname_r (char *buf, size_t buflen, dev_t mydev, ino64_t myino,
}
while ((d = __readdir64 (dirstream)) != NULL)
- if ((d->d_fileno == myino || *dostat)
+ if ((d->d_fileno == mytty->st_ino || *dostat)
&& strcmp (d->d_name, "stdin")
&& strcmp (d->d_name, "stdout")
&& strcmp (d->d_name, "stderr"))
@@ -70,12 +72,7 @@ getttyname_r (char *buf, size_t buflen, dev_t mydev, ino64_t myino,
cp[0] = '\0';
if (__xstat64 (_STAT_VER, buf, &st) == 0
-#ifdef _STATBUF_ST_RDEV
- && S_ISCHR (st.st_mode) && st.st_rdev == mydev
-#else
- && d->d_fileno == myino && st.st_dev == mydev
-#endif
- )
+ && is_mytty (mytty, &st))
{
(void) __closedir (dirstream);
__set_errno (save);
@@ -98,6 +95,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
char procname[30];
struct stat64 st, st1;
int dostat = 0;
+ int doispty = 0;
int save = errno;
/* Test for the absolute minimal size. This makes life easier inside
@@ -149,15 +147,10 @@ __ttyname_r (int fd, char *buf, size_t buflen)
/* Verify readlink result, fall back on iterating through devices. */
if (buf[0] == '/'
&& __xstat64 (_STAT_VER, buf, &st1) == 0
-#ifdef _STATBUF_ST_RDEV
- && S_ISCHR (st1.st_mode)
- && st1.st_rdev == st.st_rdev
-#else
- && st1.st_ino == st.st_ino
- && st1.st_dev == st.st_dev
-#endif
- )
+ && is_mytty (&st, &st1))
return 0;
+
+ doispty = 1;
}
/* Prepare the result buffer. */
@@ -166,13 +159,8 @@ __ttyname_r (int fd, char *buf, size_t buflen)
if (__xstat64 (_STAT_VER, buf, &st1) == 0 && S_ISDIR (st1.st_mode))
{
-#ifdef _STATBUF_ST_RDEV
- ret = getttyname_r (buf, buflen, st.st_rdev, st.st_ino, save,
+ ret = getttyname_r (buf, buflen, &st, save,
&dostat);
-#else
- ret = getttyname_r (buf, buflen, st.st_dev, st.st_ino, save,
- &dostat);
-#endif
}
else
{
@@ -184,26 +172,26 @@ __ttyname_r (int fd, char *buf, size_t buflen)
{
buf[sizeof ("/dev/") - 1] = '\0';
buflen += sizeof ("pts/") - 1;
-#ifdef _STATBUF_ST_RDEV
- ret = getttyname_r (buf, buflen, st.st_rdev, st.st_ino, save,
- &dostat);
-#else
- ret = getttyname_r (buf, buflen, st.st_dev, st.st_ino, save,
+ ret = getttyname_r (buf, buflen, &st, save,
&dostat);
-#endif
}
if (ret && dostat != -1)
{
buf[sizeof ("/dev/") - 1] = '\0';
dostat = 1;
-#ifdef _STATBUF_ST_RDEV
- ret = getttyname_r (buf, buflen, st.st_rdev, st.st_ino,
+ ret = getttyname_r (buf, buflen, &st,
save, &dostat);
-#else
- ret = getttyname_r (buf, buflen, st.st_dev, st.st_ino,
- save, &dostat);
-#endif
+ }
+
+ if (ret && doispty && is_pty (&st))
+ {
+ /* We failed to figure out the TTY's name, but we can at least
+ signal that we did verify that it really is a PTY slave.
+ This happens when we have inherited the file descriptor from
+ a different mount namespace. */
+ __set_errno (ENODEV);
+ return ENODEV;
}
return ret;
diff --git a/sysdeps/unix/sysv/linux/umount.S b/sysdeps/unix/sysv/linux/umount.S
deleted file mode 100644
index e18463e2e6..0000000000
--- a/sysdeps/unix/sysv/linux/umount.S
+++ /dev/null
@@ -1,12 +0,0 @@
-/* This hack is necessary since the kernel people are making "strange"
- changes. They simply rename old system calls. */
-
-#include <sysdep.h>
-#ifdef __NR_oldumount
-PSEUDO (__umount, oldumount, 1)
-#else
-PSEUDO (__umount, umount, 1)
-#endif
- ret
-PSEUDO_END(__umount)
-weak_alias (__umount, umount)
diff --git a/sysdeps/unix/sysv/linux/umount.c b/sysdeps/unix/sysv/linux/umount.c
new file mode 100644
index 0000000000..1c8bea55e0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/umount.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2011-2018 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/>. */
+
+/* Since the generic Linux syscall ABI doesn't have an oldumount system call,
+ do what the kernel does down here. */
+
+extern long int __umount2 (const char *name, int flags);
+
+long int
+__umount (const char *name)
+{
+ return __umount2 (name, 0);
+}
+
+weak_alias (__umount, umount);
diff --git a/sysdeps/unix/sysv/linux/unlockpt.c b/sysdeps/unix/sysv/linux/unlockpt.c
index 608534d32d..916fc41687 100644
--- a/sysdeps/unix/sysv/linux/unlockpt.c
+++ b/sysdeps/unix/sysv/linux/unlockpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
diff --git a/sysdeps/unix/sysv/linux/updwtmp.c b/sysdeps/unix/sysv/linux/updwtmp.c
index b4fd08b6ef..3f97b037b2 100644
--- a/sysdeps/unix/sysv/linux/updwtmp.c
+++ b/sysdeps/unix/sysv/linux/updwtmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
diff --git a/sysdeps/unix/sysv/linux/ustat.c b/sysdeps/unix/sysv/linux/ustat.c
index 178c000cb6..50204e4953 100644
--- a/sysdeps/unix/sysv/linux/ustat.c
+++ b/sysdeps/unix/sysv/linux/ustat.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Get filesystem statistics (deprecated). Linux version.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -16,22 +17,41 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <sys/ustat.h>
-#include <sys/sysmacros.h>
+#include <shlib-compat.h>
-#include <sysdep.h>
-#include <sys/syscall.h>
+/* This deprecated syscall is no longer used (replaced with {f}statfs). */
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_28)
-int
-ustat (dev_t dev, struct ustat *ubuf)
-{
- unsigned long long int k_dev;
+# include <sysdep.h>
+# include <errno.h>
+
+# ifndef DEV_TO_KDEV
+# define DEV_TO_KDEV(__dev) \
+ ({ \
+ unsigned long long int k_dev; \
+ k_dev = dev & ((1ULL << 32) - 1); \
+ if (k_dev != dev) \
+ return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); \
+ (unsigned int) k_dev; \
+ })
+# endif
- /* We must convert the value to dev_t type used by the kernel. */
- k_dev = dev & ((1ULL << 32) - 1);
- if (k_dev != dev)
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
+struct ustat
+{
+ __daddr_t f_tfree; /* Number of free blocks. */
+ __ino_t f_tinode; /* Number of free inodes. */
+ char f_fname[6];
+ char f_fpack[6];
+};
- return INLINE_SYSCALL (ustat, 2, (unsigned int) k_dev, ubuf);
+int
+__old_ustat (dev_t dev, struct ustat *ubuf)
+{
+# ifdef __NR_ustat
+ return INLINE_SYSCALL_CALL (ustat, DEV_TO_KDEV (dev), ubuf);
+# else
+ return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
+# endif
}
+compat_symbol (libc, __old_ustat, ustat, GLIBC_2_0);
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_28) */
diff --git a/sysdeps/unix/sysv/linux/utimensat.c b/sysdeps/unix/sysv/linux/utimensat.c
index f3a9697a17..108d3bc55b 100644
--- a/sysdeps/unix/sysv/linux/utimensat.c
+++ b/sysdeps/unix/sysv/linux/utimensat.c
@@ -1,5 +1,5 @@
/* Change access and modification times of open file. Linux version.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,13 +31,6 @@ utimensat (int fd, const char *file, const struct timespec tsp[2],
{
if (file == NULL)
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-#ifdef __NR_utimensat
/* Avoid implicit array coercion in syscall macros. */
return INLINE_SYSCALL (utimensat, 4, fd, file, &tsp[0], flags);
-#else
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-#endif
}
-#ifndef __NR_utimensat
-stub_warning (utimensat)
-#endif
diff --git a/sysdeps/unix/sysv/linux/utimes.c b/sysdeps/unix/sysv/linux/utimes.c
index 6ba8b4dba7..e37c16729f 100644
--- a/sysdeps/unix/sysv/linux/utimes.c
+++ b/sysdeps/unix/sysv/linux/utimes.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* utimes -- Change access and modification times of file. Linux version.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/utmp_file.c b/sysdeps/unix/sysv/linux/utmp_file.c
index 06cd1666a9..dd1a92c265 100644
--- a/sysdeps/unix/sysv/linux/utmp_file.c
+++ b/sysdeps/unix/sysv/linux/utmp_file.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
diff --git a/sysdeps/unix/sysv/linux/versionsort64.c b/sysdeps/unix/sysv/linux/versionsort64.c
new file mode 100644
index 0000000000..a3a3a6655a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/versionsort64.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1992-2018 Free Software 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 versionsort __no_versionsort_decl
+#include <dirent.h>
+#undef versionsort
+#include <string.h>
+
+int
+__versionsort64 (const struct dirent64 **a, const struct dirent64 **b)
+{
+ return __strverscmp ((*a)->d_name, (*b)->d_name);
+}
+
+#if _DIRENT_MATCHES_DIRENT64
+weak_alias (__versionsort64, versionsort64)
+weak_alias (__versionsort64, versionsort)
+#else
+# include <shlib-compat.h>
+versioned_symbol (libc, __versionsort64, versionsort64, GLIBC_2_2);
+# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+# include <olddirent.h>
+
+int
+attribute_compat_text_section
+__old_versionsort64 (const struct __old_dirent64 **a,
+ const struct __old_dirent64 **b)
+{
+ return __strverscmp ((*a)->d_name, (*b)->d_name);
+}
+
+compat_symbol (libc, __old_versionsort64, versionsort64, GLIBC_2_1);
+# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */
+#endif /* _DIRENT_MATCHES_DIRENT64 */
diff --git a/sysdeps/unix/sysv/linux/vmsplice.c b/sysdeps/unix/sysv/linux/vmsplice.c
new file mode 100644
index 0000000000..d305895ebc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/vmsplice.c
@@ -0,0 +1,27 @@
+/* Splice user pages into a pipe Linux implementation.
+ Copyright (C) 2017-2018 Free Software 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/uio.h>
+#include <sysdep-cancel.h>
+
+ssize_t
+vmsplice (int fd, const struct iovec *iov, size_t count, unsigned int flags)
+{
+ return SYSCALL_CANCEL (vmsplice, fd, iov, count, flags);
+}
diff --git a/sysdeps/unix/sysv/linux/wait.c b/sysdeps/unix/sysv/linux/wait.c
index 71f9044b60..3c95e6e3af 100644
--- a/sysdeps/unix/sysv/linux/wait.c
+++ b/sysdeps/unix/sysv/linux/wait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
/* Wait for a child to die. When one does, put its status in *STAT_LOC
and return its process ID. For errors, return (pid_t) -1. */
pid_t
-__libc_wait (__WAIT_STATUS_DEFN stat_loc)
+__libc_wait (int *stat_loc)
{
pid_t result = SYSCALL_CANCEL (wait4, WAIT_ANY, stat_loc, 0,
(struct rusage *) NULL);
diff --git a/sysdeps/unix/sysv/linux/waitid.c b/sysdeps/unix/sysv/linux/waitid.c
index 275a6a2509..86728929f5 100644
--- a/sysdeps/unix/sysv/linux/waitid.c
+++ b/sysdeps/unix/sysv/linux/waitid.c
@@ -1,5 +1,5 @@
/* Linux implementation of waitid.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/waitpid.c b/sysdeps/unix/sysv/linux/waitpid.c
index 9de9ce1d51..8cf00e4efd 100644
--- a/sysdeps/unix/sysv/linux/waitpid.c
+++ b/sysdeps/unix/sysv/linux/waitpid.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Linux waitpid syscall implementation.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/waitpid_nocancel.c b/sysdeps/unix/sysv/linux/waitpid_nocancel.c
new file mode 100644
index 0000000000..ff1ef3d241
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/waitpid_nocancel.c
@@ -0,0 +1,34 @@
+/* Linux waitpid syscall implementation -- non-cancellable.
+ Copyright (C) 2018 Free Software 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 <sysdep-cancel.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+#include <not-cancel.h>
+
+__pid_t
+__waitpid_nocancel (__pid_t pid, int *stat_loc, int options)
+{
+#ifdef __NR_waitpid
+ return INLINE_SYSCALL_CALL (waitpid, pid, stat_loc, options);
+#else
+ return INLINE_SYSCALL_CALL (wait4, pid, stat_loc, options, NULL);
+#endif
+}
+libc_hidden_def (__waitpid_nocancel)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/creat64.c b/sysdeps/unix/sysv/linux/wordsize-64/creat64.c
deleted file mode 100644
index c106e2b362..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/creat64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined as alias for the syscall. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c b/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
deleted file mode 100644
index c1dd0b4093..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
+++ /dev/null
@@ -1,34 +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
-}
-strong_alias (fallocate, fallocate64)
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/ftruncate64.c b/sysdeps/unix/sysv/linux/wordsize-64/ftruncate64.c
deleted file mode 100644
index 673a8b525a..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/ftruncate64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* ftruncate64 is the same as ftruncate. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fxstat.c b/sysdeps/unix/sysv/linux/wordsize-64/fxstat.c
index 507e68a8d8..f5f1376fe2 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/fxstat.c
+++ b/sysdeps/unix/sysv/linux/wordsize-64/fxstat.c
@@ -1,5 +1,5 @@
/* fxstat using old-style Unix fstat system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c b/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
index 981ba4189d..99050dce0a 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/getdents.c b/sysdeps/unix/sysv/linux/wordsize-64/getdents.c
deleted file mode 100644
index 5ea4c572a3..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/getdents.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#define __getdents64 __no___getdents64_decl
-#include <sysdeps/unix/sysv/linux/getdents.c>
-#undef __getdents64
-weak_alias (__getdents, __getdents64);
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/getdents64.c b/sysdeps/unix/sysv/linux/wordsize-64/getdents64.c
deleted file mode 100644
index 0df2c8f4c6..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/getdents64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* getdents64 is in getdents.c */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/getdirentries.c b/sysdeps/unix/sysv/linux/wordsize-64/getdirentries.c
deleted file mode 100644
index 298d1e9e91..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/getdirentries.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../getdirentries.c"
-
-weak_alias (getdirentries, getdirentries64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/getdirentries64.c b/sysdeps/unix/sysv/linux/wordsize-64/getdirentries64.c
deleted file mode 100644
index 622baf0c87..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/getdirentries64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in getdirentries.c. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c b/sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c
deleted file mode 100644
index 9feab0e6b8..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* getrlimit64 is the same as getrlimit. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/glob64.c b/sysdeps/unix/sysv/linux/wordsize-64/glob64.c
deleted file mode 100644
index eab7703d5c..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/glob64.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* This file is here so sysdeps/gnu/glob64.c doesn't take precedence. */
-#include <sysdeps/wordsize-64/glob64.c>
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/lxstat.c b/sysdeps/unix/sysv/linux/wordsize-64/lxstat.c
index 8b25fa31fc..6cb4f92a5c 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/lxstat.c
+++ b/sysdeps/unix/sysv/linux/wordsize-64/lxstat.c
@@ -1,5 +1,5 @@
/* lxstat using old-style Unix lstat system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/mmap.c b/sysdeps/unix/sysv/linux/wordsize-64/mmap.c
deleted file mode 100644
index 090e1deb68..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/mmap.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Linux mmap system call. 64-bit version.
- Copyright (C) 2015-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/types.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <sysdep.h>
-
-/* An architecture may override this. */
-#ifndef MMAP_PREPARE
-# define MMAP_PREPARE(addr, len, prot, flags, fd, offset)
-#endif
-
-__ptr_t
-__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
-{
- MMAP_PREPARE (addr, len, prot, flags, fd, offset);
- return (__ptr_t) INLINE_SYSCALL (mmap, 6, addr, len, prot, flags,
- fd, offset);
-}
-
-weak_alias (__mmap, mmap)
-weak_alias (__mmap, mmap64)
-weak_alias (__mmap, __mmap64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/mmap64.c b/sysdeps/unix/sysv/linux/wordsize-64/mmap64.c
deleted file mode 100644
index 0dbd384a6a..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/mmap64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* mmap64 is the same as mmap. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/open64.c b/sysdeps/unix/sysv/linux/wordsize-64/open64.c
deleted file mode 100644
index 0abe30ef62..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/open64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in open syscall. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/openat.c b/sysdeps/unix/sysv/linux/wordsize-64/openat.c
deleted file mode 100644
index be31a35105..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/openat.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#define __openat64 __rename___openat64
-#define openat64 __rename_openat64
-
-#include "../openat.c"
-
-#undef __openat64
-#undef openat64
-
-strong_alias (__openat, __openat64)
-hidden_ver (__openat, __openat64)
-weak_alias (openat, openat64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/openat64.c b/sysdeps/unix/sysv/linux/wordsize-64/openat64.c
deleted file mode 100644
index b4a864b040..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/openat64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in openat.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 36c7e40e12..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
+++ /dev/null
@@ -1,66 +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 <kernel-features.h>
-#include <sysdep.h>
-
-#define posix_fallocate static internal_fallocate
-#include <sysdeps/posix/posix_fallocate.c>
-#undef posix_fallocate
-
-/* The alpha architecture introduced the fallocate system call in
- 2.6.33-rc1, so we still need the fallback code. */
-#if !defined __ASSUME_FALLOCATE && defined __NR_fallocate
-static int __have_fallocate;
-#endif
-
-
-/* Reserve storage for the data of the file associated with FD. */
-int
-posix_fallocate (int fd, __off_t offset, __off_t len)
-{
-#ifdef __NR_fallocate
-# ifndef __ASSUME_FALLOCATE
- if (__glibc_likely (__have_fallocate >= 0))
-# endif
- {
- 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;
-
-# ifndef __ASSUME_FALLOCATE
- if (__glibc_unlikely (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS))
- __have_fallocate = -1;
- else
-# endif
- if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP)
- return INTERNAL_SYSCALL_ERRNO (res, err);
- }
-#endif
-
- 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/pread64.c b/sysdeps/unix/sysv/linux/wordsize-64/pread64.c
deleted file mode 100644
index b7f298dea8..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/pread64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty since the pread syscall is equivalent. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/preadv.c b/sysdeps/unix/sysv/linux/wordsize-64/preadv.c
deleted file mode 100644
index e2924acbb9..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/preadv.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* 64-bit preadv.
- 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/>. */
-
-#include <errno.h>
-#include <stddef.h>
-#include <sys/param.h>
-/* Hide the preadv64 declaration. */
-#define preadv64 __redirect_preadv64
-#include <sys/uio.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#include <kernel-features.h>
-
-#ifndef __ASSUME_PREADV
-static ssize_t __atomic_preadv_replacement (int, const struct iovec *,
- int, off_t) internal_function;
-#endif
-
-ssize_t
-preadv (int fd, const struct iovec *vector, int count, off_t offset)
-{
-#ifdef __NR_preadv
- ssize_t result;
-
- result = SYSCALL_CANCEL (preadv, fd, vector, count, offset);
-# ifdef __ASSUME_PREADV
- return result;
-# endif
-#endif
-
-#ifndef __ASSUME_PREADV
-# ifdef __NR_preadv
- if (result >= 0 || errno != ENOSYS)
- return result;
-# endif
-
- return __atomic_preadv_replacement (fd, vector, count, offset);
-#endif
-}
-#undef preadv64
-strong_alias (preadv, preadv64)
-
-#ifndef __ASSUME_PREADV
-# define PREADV static internal_function __atomic_preadv_replacement
-# define PREAD __pread
-# define OFF_T off_t
-# include <sysdeps/posix/preadv.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/preadv64.c b/sysdeps/unix/sysv/linux/wordsize-64/preadv64.c
deleted file mode 100644
index fd9320cfc7..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/preadv64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty since the preadv syscall is equivalent. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c b/sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c
deleted file mode 100644
index b7f298dea8..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty since the pread syscall is equivalent. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/pwritev.c b/sysdeps/unix/sysv/linux/wordsize-64/pwritev.c
deleted file mode 100644
index 1fa6eb3459..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/pwritev.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* 64-bit pwritev.
- 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/>. */
-
-#include <errno.h>
-#include <stddef.h>
-#include <sys/param.h>
-/* Hide the pwritev64 declaration. */
-#define pwritev64 __redirect_pwritev64
-#include <sys/uio.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#include <kernel-features.h>
-
-#ifndef __ASSUME_PWRITEV
-static ssize_t __atomic_pwritev_replacement (int, const struct iovec *,
- int, off_t) internal_function;
-#endif
-
-ssize_t
-pwritev (int fd, const struct iovec *vector, int count, off_t offset)
-{
-#ifdef __NR_pwritev
- ssize_t result;
-
- result = SYSCALL_CANCEL (pwritev, fd, vector, count, offset);
-# ifdef __ASSUME_PWRITEV
- return result;
-# endif
-#endif
-
-#ifndef __ASSUME_PWRITEV
-# ifdef __NR_pwritev
- if (result >= 0 || errno != ENOSYS)
- return result;
-# endif
-
- return __atomic_pwritev_replacement (fd, vector, count, offset);
-#endif
-}
-#undef pwritev64
-strong_alias (pwritev, pwritev64)
-
-#ifndef __ASSUME_PWRITEV
-# define PWRITE __pwrite
-# define PWRITEV static internal_function __atomic_pwritev_replacement
-# define OFF_T off_t
-# include <sysdeps/posix/pwritev.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/pwritev64.c b/sysdeps/unix/sysv/linux/wordsize-64/pwritev64.c
deleted file mode 100644
index 8b72a2928b..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/pwritev64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty since the pwritev syscall is equivalent. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir.c
deleted file mode 100644
index e197d93b00..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/readdir.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#define readdir64 __no_readdir64_decl
-#define __readdir64 __no___readdir64_decl
-#include <sysdeps/posix/readdir.c>
-#undef __readdir64
-strong_alias (__readdir, __readdir64)
-#undef readdir64
-weak_alias (__readdir, readdir64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir64.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir64.c
deleted file mode 100644
index 9796431dc4..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/readdir64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* readdir64 is in readdir.c */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c
deleted file mode 100644
index b8fe9a31b4..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c
+++ /dev/null
@@ -1 +0,0 @@
-/* readdir64_r is in readdir_r.c */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
deleted file mode 100644
index 290f2c8f6c..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#define readdir64_r __no_readdir64_r_decl
-#include <sysdeps/posix/readdir_r.c>
-#undef readdir64_r
-weak_alias (__readdir_r, readdir64_r)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c b/sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c
deleted file mode 100644
index 8edcff0086..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* setrlimit64 is the same as setrlimit. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
index 19cc6d9833..5de6ec823a 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
@@ -1,22 +1,8 @@
# 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 -
-pread - pread Ci:ibni __libc_pread __libc_pread64 __pread pread __pread64 pread64
-pwrite - pwrite Ci:ibni __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64
statfs - statfs i:sp __statfs statfs statfs64
-mmap - mmap b:aniiii __mmap mmap __mmap64 mmap64
-ftruncate - ftruncate i:ii __ftruncate ftruncate ftruncate64 __ftruncate64
-truncate - truncate i:si truncate truncate64
-getrlimit - getrlimit i:ip __getrlimit getrlimit getrlimit64 __getrlimit64
-setrlimit - setrlimit i:ip __setrlimit setrlimit setrlimit64
-readahead - readahead i:iii __readahead readahead
sendfile - sendfile i:iipi sendfile sendfile64
-sync_file_range - sync_file_range Ci:iiii sync_file_range
-creat - creat Ci:si creat creat64
-open - open Ci:siv __libc_open __open open __open64 open64
prlimit EXTRA prlimit64 i:iipp prlimit prlimit64
fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/truncate64.c b/sysdeps/unix/sysv/linux/wordsize-64/truncate64.c
deleted file mode 100644
index 8999768874..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/truncate64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* truncate64 is the same as truncate. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/xstat.c b/sysdeps/unix/sysv/linux/wordsize-64/xstat.c
index ad53daedb8..6450902b5f 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/xstat.c
+++ b/sysdeps/unix/sysv/linux/wordsize-64/xstat.c
@@ -1,5 +1,5 @@
/* xstat using old-style Unix stat system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/nacl/write.c b/sysdeps/unix/sysv/linux/write.c
index f452f446c1..558639d471 100644
--- a/sysdeps/nacl/write.c
+++ b/sysdeps/unix/sysv/linux/write.c
@@ -1,5 +1,5 @@
-/* write -- Write data to a file descriptor. NaCl version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Linux write syscall implementation.
+ Copyright (C) 2017-2018 Free Software 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,17 +17,17 @@
<http://www.gnu.org/licenses/>. */
#include <unistd.h>
-#include <nacl-interfaces.h>
+#include <sysdep-cancel.h>
/* Write NBYTES of BUF to FD. Return the number written, or -1. */
ssize_t
__libc_write (int fd, const void *buf, size_t nbytes)
{
- size_t wrote;
- return NACL_CALL (__nacl_irt_fdio.write (fd, buf, nbytes, &wrote), wrote);
+ return SYSCALL_CANCEL (write, fd, buf, nbytes);
}
libc_hidden_def (__libc_write)
weak_alias (__libc_write, __write)
libc_hidden_weak (__write)
weak_alias (__libc_write, write)
+libc_hidden_weak (write)
diff --git a/sysdeps/unix/sysv/linux/write_nocancel.c b/sysdeps/unix/sysv/linux/write_nocancel.c
new file mode 100644
index 0000000000..6fe1ea2aaa
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/write_nocancel.c
@@ -0,0 +1,28 @@
+/* Linux write syscall implementation -- non-cancellable.
+ Copyright (C) 2018 Free Software 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 <sysdep-cancel.h>
+#include <not-cancel.h>
+
+ssize_t
+__write_nocancel (int fd, const void *buf, size_t nbytes)
+{
+ return INLINE_SYSCALL_CALL (write, fd, buf, nbytes);
+}
+hidden_def (__write_nocancel)
diff --git a/sysdeps/unix/sysv/linux/writev.c b/sysdeps/unix/sysv/linux/writev.c
new file mode 100644
index 0000000000..c9ae502c3b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/writev.c
@@ -0,0 +1,29 @@
+/* Linux writev syscall implementation.
+ Copyright (C) 2017-2018 Free Software 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 <sys/uio.h>
+#include <sysdep-cancel.h>
+
+ssize_t
+__writev (int fd, const struct iovec *iov, int iovcnt)
+{
+ return SYSCALL_CANCEL (writev, fd, iov, iovcnt);
+}
+libc_hidden_def (__writev)
+weak_alias (__writev, writev)
diff --git a/sysdeps/unix/sysv/linux/x86/Implies b/sysdeps/unix/sysv/linux/x86/Implies
new file mode 100644
index 0000000000..e454b288aa
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/Implies
@@ -0,0 +1 @@
+x86/nptl
diff --git a/sysdeps/unix/sysv/linux/x86/Makefile b/sysdeps/unix/sysv/linux/x86/Makefile
index 9e6ec44b3a..7dc4e61756 100644
--- a/sysdeps/unix/sysv/linux/x86/Makefile
+++ b/sysdeps/unix/sysv/linux/x86/Makefile
@@ -3,11 +3,8 @@ abi-includes :=
abi-variants := 32 64 x32
-abi-32-options := -D__i386__ -U__x86_64__
abi-32-condition := !defined __x86_64__
-abi-64-options := -U__i386__ -D__x86_64__ -U__ILP32__ -D__LP64__
abi-64-condition := defined __x86_64__ && defined __LP64__
-abi-x32-options := -U__i386__ -D__x86_64__ -D__ILP32__ -U__LP64__
abi-x32-condition := defined __x86_64__ && defined __ILP32__
ifeq ($(subdir),misc)
@@ -22,3 +19,29 @@ endif
ifeq ($(subdir),elf)
sysdep_routines += dl-vdso
endif
+
+ifeq ($(subdir),setjmp)
+tests += tst-saved_mask-1
+endif
+
+ifeq ($(enable-cet),yes)
+ifeq ($(subdir),elf)
+tests += tst-cet-property-1 tst-cet-property-2
+
+CFLAGS-tst-cet-property-1.o += -fcf-protection
+ASFLAGS-tst-cet-property-dep-2.o += -fcf-protection
+
+$(objpfx)tst-cet-property-2: $(objpfx)tst-cet-property-dep-2.o
+$(objpfx)tst-cet-property-2.out: $(objpfx)tst-cet-property-2 \
+ $(objpfx)tst-cet-property-1.out
+ env $(run-program-env) $(test-via-rtld-prefix) \
+ $(objpfx)tst-cet-property-2 \
+ < $(objpfx)tst-cet-property-1.out > $@; \
+ $(evaluate-test)
+endif
+
+ifeq ($(subdir),stdlib)
+tests += tst-cet-setcontext-1
+CFLAGS-tst-cet-setcontext-1.c += -mshstk
+endif
+endif
diff --git a/sysdeps/unix/sysv/linux/x86/arch-pkey.h b/sysdeps/unix/sysv/linux/x86/arch-pkey.h
new file mode 100644
index 0000000000..b33956b6a2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/arch-pkey.h
@@ -0,0 +1,40 @@
+/* Helper functions for manipulating memory protection keys.
+ Copyright (C) 2017-2018 Free Software 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 _ARCH_PKEY_H
+#define _ARCH_PKEY_H
+
+/* Return the value of the PKRU register. */
+static inline unsigned int
+pkey_read (void)
+{
+ unsigned int result;
+ __asm__ volatile (".byte 0x0f, 0x01, 0xee"
+ : "=a" (result) : "c" (0) : "rdx");
+ return result;
+}
+
+/* Overwrite the PKRU register with VALUE. */
+static inline void
+pkey_write (unsigned int value)
+{
+ __asm__ volatile (".byte 0x0f, 0x01, 0xef"
+ : : "a" (value), "c" (0), "d" (0));
+}
+
+#endif /* _ARCH_PKEY_H */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/environments.h b/sysdeps/unix/sysv/linux/x86/bits/environments.h
index a7e8fb00e6..478c1cb718 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/environments.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/environments.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/bits/epoll.h b/sysdeps/unix/sysv/linux/x86/bits/epoll.h
index 84a24da650..577899c3db 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86/bits/fcntl.h
index 0a01a67081..f26077c9cb 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/x86.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/bits/ipctypes.h b/sysdeps/unix/sysv/linux/x86/bits/ipctypes.h
index aeb00903b6..be0fc92cae 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/ipctypes.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/ipctypes.h
@@ -1,5 +1,5 @@
/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/bits/mman.h b/sysdeps/unix/sysv/linux/x86/bits/mman.h
index c1d3147d0b..d897b8a2b2 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/x86_64 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,6 +39,10 @@
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
+# define MAP_SYNC 0x80000 /* Perform synchronous page
+ faults for the mapping. */
+# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
+ underlying mapping. */
#endif
/* Include generic Linux declarations. */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/msq.h b/sysdeps/unix/sysv/linux/x86/bits/msq.h
index 467419486f..bc2e3bd13d 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -65,6 +65,7 @@ struct msqid_ds
/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12
+# define MSG_STAT_ANY 13
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
diff --git a/sysdeps/unix/sysv/linux/x86/bits/sem.h b/sysdeps/unix/sysv/linux/x86/bits/sem.h
index fe757dcae9..6771966a06 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -68,6 +68,7 @@ struct semid_ds
/* ipcs ctl cmds */
# define SEM_STAT 18
# define SEM_INFO 19
+# define SEM_STAT_ANY 20
struct seminfo
{
diff --git a/sysdeps/unix/sysv/linux/x86/bits/shm.h b/sysdeps/unix/sysv/linux/x86/bits/shm.h
index e593cbeb6b..767bb78573 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -74,6 +74,7 @@ struct shmid_ds
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
+# define SHM_STAT_ANY 15
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h b/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
index 255738d7b2..5f19c48817 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,8 @@
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif
+#include <bits/types.h>
+
#define FP_XSTATE_MAGIC1 0x46505853U
#define FP_XSTATE_MAGIC2 0x46505845U
#define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
@@ -32,7 +34,7 @@ struct _fpx_sw_bytes
__uint32_t extended_size;
__uint64_t xstate_bv;
__uint32_t xstate_size;
- __uint32_t padding[7];
+ __uint32_t __glibc_reserved1[7];
};
struct _fpreg
@@ -45,7 +47,7 @@ struct _fpxreg
{
unsigned short significand[4];
unsigned short exponent;
- unsigned short padding[3];
+ unsigned short __glibc_reserved1[3];
};
struct _xmmreg
@@ -74,10 +76,10 @@ struct _fpstate
/* FXSR FPU environment. */
__uint32_t _fxsr_env[6];
__uint32_t mxcsr;
- __uint32_t reserved;
+ __uint32_t __glibc_reserved1;
struct _fpxreg _fxsr_st[8];
struct _xmmreg _xmm[8];
- __uint32_t padding[56];
+ __uint32_t __glibc_reserved2[56];
};
#ifndef sigcontext_struct
@@ -131,7 +133,7 @@ struct _fpstate
__uint32_t mxcr_mask;
struct _fpxreg _st[8];
struct _xmmreg _xmm[16];
- __uint32_t padding[24];
+ __uint32_t __glibc_reserved1[24];
};
struct sigcontext
@@ -175,8 +177,8 @@ struct sigcontext
struct _xsave_hdr
{
__uint64_t xstate_bv;
- __uint64_t reserved1[2];
- __uint64_t reserved2[5];
+ __uint64_t __glibc_reserved1[2];
+ __uint64_t __glibc_reserved2[5];
};
struct _ymmh_state
diff --git a/sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h b/sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h
new file mode 100644
index 0000000000..7688a8d66d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h
@@ -0,0 +1,17 @@
+/* Architecture-specific adjustments to siginfo_t. x86 version. */
+#ifndef _BITS_SIGINFO_ARCH_H
+#define _BITS_SIGINFO_ARCH_H 1
+
+#if defined __x86_64__ && __WORDSIZE == 32
+/* si_utime and si_stime must be 4 byte aligned for x32 to match the
+ kernel. We align siginfo_t to 8 bytes so that si_utime and
+ si_stime are actually aligned to 8 bytes since their offsets are
+ multiple of 8 bytes. Note: with some compilers, the alignment
+ attribute would be ignored if it were put in __SI_CLOCK_T instead
+ of encapsulated in a typedef. */
+typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t;
+# define __SI_ALIGNMENT __attribute__ ((__aligned__ (8)))
+# define __SI_CLOCK_T __sigchld_clock_t
+#endif
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/x86/bits/siginfo.h b/sysdeps/unix/sysv/linux/x86/bits/siginfo.h
deleted file mode 100644
index dbf253a3bc..0000000000
--- a/sysdeps/unix/sysv/linux/x86/bits/siginfo.h
+++ /dev/null
@@ -1,360 +0,0 @@
-/* siginfo_t, sigevent and constants. Linux x86-64 version.
- 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/>. */
-
-#if !defined _SIGNAL_H && !defined __need_siginfo_t \
- && !defined __need_sigevent_t
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-#if (!defined __have_sigval_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t \
- || defined __need_sigevent_t))
-# define __have_sigval_t 1
-
-/* Type for data associated with a signal. */
-typedef union sigval
- {
- int sival_int;
- void *sival_ptr;
- } sigval_t;
-#endif
-
-#if (!defined __have_siginfo_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t))
-# define __have_siginfo_t 1
-
-# define __SI_MAX_SIZE 128
-# if __WORDSIZE == 64
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-# if defined __x86_64__ && __WORDSIZE == 32
-/* si_utime and si_stime must be 4 byte aligned for x32 to match the
- kernel. We align siginfo_t to 8 bytes so that si_utime and si_stime
- are actually aligned to 8 bytes since their offsets are multiple of
- 8 bytes. */
-typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t;
-# define __SI_ALIGNMENT __attribute__ ((__aligned__ (8)))
-# else
-typedef __clock_t __sigchld_clock_t;
-# define __SI_ALIGNMENT
-# endif
-
-typedef struct
- {
- int si_signo; /* Signal number. */
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int si_code; /* Signal code. */
-
- union
- {
- int _pad[__SI_PAD_SIZE];
-
- /* kill(). */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- } _kill;
-
- /* POSIX.1b timers. */
- struct
- {
- int si_tid; /* Timer ID. */
- int si_overrun; /* Overrun count. */
- sigval_t si_sigval; /* Signal value. */
- } _timer;
-
- /* POSIX.1b signals. */
- struct
- {
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- sigval_t si_sigval; /* Signal value. */
- } _rt;
-
- /* SIGCHLD. */
- struct
- {
- __pid_t si_pid; /* Which child. */
- __uid_t si_uid; /* Real user ID of sending process. */
- int si_status; /* Exit value or signal. */
- __sigchld_clock_t si_utime;
- __sigchld_clock_t si_stime;
- } _sigchld;
-
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
- struct
- {
- void *si_addr; /* Faulting insn/memory ref. */
- short int si_addr_lsb; /* Valid LSB of the reported address. */
- struct
- {
- void *_lower;
- void *_upper;
- } si_addr_bnd;
- } _sigfault;
-
- /* SIGPOLL. */
- struct
- {
- long int si_band; /* Band event for SIGPOLL. */
- int si_fd;
- } _sigpoll;
-
- /* SIGSYS. */
- struct
- {
- void *_call_addr; /* Calling user insn. */
- int _syscall; /* Triggering system call number. */
- unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
- } _sigsys;
- } _sifields;
- } siginfo_t __SI_ALIGNMENT;
-
-
-/* X/Open requires some more fields with fixed names. */
-# define si_pid _sifields._kill.si_pid
-# define si_uid _sifields._kill.si_uid
-# define si_timerid _sifields._timer.si_tid
-# define si_overrun _sifields._timer.si_overrun
-# define si_status _sifields._sigchld.si_status
-# define si_utime _sifields._sigchld.si_utime
-# define si_stime _sifields._sigchld.si_stime
-# define si_value _sifields._rt.si_sigval
-# define si_int _sifields._rt.si_sigval.sival_int
-# define si_ptr _sifields._rt.si_sigval.sival_ptr
-# define si_addr _sifields._sigfault.si_addr
-# define si_addr_lsb _sifields._sigfault.si_addr_lsb
-# define si_lower _sifields._sigfault.si_addr_bnd._lower
-# define si_upper _sifields._sigfault.si_addr_bnd._upper
-# define si_band _sifields._sigpoll.si_band
-# define si_fd _sifields._sigpoll.si_fd
-# define si_call_addr _sifields._sigsys._call_addr
-# define si_syscall _sifields._sigsys._syscall
-# define si_arch _sifields._sigsys._arch
-
-
-/* Values for `si_code'. Positive values are reserved for kernel-generated
- signals. */
-enum
-{
- SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
-# define SI_ASYNCNL SI_ASYNCNL
- SI_TKILL = -6, /* Sent by tkill. */
-# define SI_TKILL SI_TKILL
- SI_SIGIO, /* Sent by queued SIGIO. */
-# define SI_SIGIO SI_SIGIO
- SI_ASYNCIO, /* Sent by AIO completion. */
-# define SI_ASYNCIO SI_ASYNCIO
- SI_MESGQ, /* Sent by real time mesq state change. */
-# define SI_MESGQ SI_MESGQ
- SI_TIMER, /* Sent by timer expiration. */
-# define SI_TIMER SI_TIMER
- SI_QUEUE, /* Sent by sigqueue. */
-# define SI_QUEUE SI_QUEUE
- SI_USER, /* Sent by kill, sigsend. */
-# define SI_USER SI_USER
- SI_KERNEL = 0x80 /* Send by kernel. */
-#define SI_KERNEL SI_KERNEL
-};
-
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGILL signal. */
-enum
-{
- ILL_ILLOPC = 1, /* Illegal opcode. */
-# define ILL_ILLOPC ILL_ILLOPC
- ILL_ILLOPN, /* Illegal operand. */
-# define ILL_ILLOPN ILL_ILLOPN
- ILL_ILLADR, /* Illegal addressing mode. */
-# define ILL_ILLADR ILL_ILLADR
- ILL_ILLTRP, /* Illegal trap. */
-# define ILL_ILLTRP ILL_ILLTRP
- ILL_PRVOPC, /* Privileged opcode. */
-# define ILL_PRVOPC ILL_PRVOPC
- ILL_PRVREG, /* Privileged register. */
-# define ILL_PRVREG ILL_PRVREG
- ILL_COPROC, /* Coprocessor error. */
-# define ILL_COPROC ILL_COPROC
- ILL_BADSTK /* Internal stack error. */
-# define ILL_BADSTK ILL_BADSTK
-};
-
-/* `si_code' values for SIGFPE signal. */
-enum
-{
- FPE_INTDIV = 1, /* Integer divide by zero. */
-# define FPE_INTDIV FPE_INTDIV
- FPE_INTOVF, /* Integer overflow. */
-# define FPE_INTOVF FPE_INTOVF
- FPE_FLTDIV, /* Floating point divide by zero. */
-# define FPE_FLTDIV FPE_FLTDIV
- FPE_FLTOVF, /* Floating point overflow. */
-# define FPE_FLTOVF FPE_FLTOVF
- FPE_FLTUND, /* Floating point underflow. */
-# define FPE_FLTUND FPE_FLTUND
- FPE_FLTRES, /* Floating point inexact result. */
-# define FPE_FLTRES FPE_FLTRES
- FPE_FLTINV, /* Floating point invalid operation. */
-# define FPE_FLTINV FPE_FLTINV
- FPE_FLTSUB /* Subscript out of range. */
-# define FPE_FLTSUB FPE_FLTSUB
-};
-
-/* `si_code' values for SIGSEGV signal. */
-enum
-{
- SEGV_MAPERR = 1, /* Address not mapped to object. */
-# define SEGV_MAPERR SEGV_MAPERR
- SEGV_ACCERR /* Invalid permissions for mapped object. */
-# define SEGV_ACCERR SEGV_ACCERR
-};
-
-/* `si_code' values for SIGBUS signal. */
-enum
-{
- BUS_ADRALN = 1, /* Invalid address alignment. */
-# define BUS_ADRALN BUS_ADRALN
- BUS_ADRERR, /* Non-existant physical address. */
-# define BUS_ADRERR BUS_ADRERR
- BUS_OBJERR, /* Object specific hardware error. */
-# define BUS_OBJERR BUS_OBJERR
- BUS_MCEERR_AR, /* Hardware memory error: action required. */
-# define BUS_MCEERR_AR BUS_MCEERR_AR
- BUS_MCEERR_AO /* Hardware memory error: action optional. */
-# define BUS_MCEERR_AO BUS_MCEERR_AO
-};
-# endif
-
-# ifdef __USE_XOPEN_EXTENDED
-/* `si_code' values for SIGTRAP signal. */
-enum
-{
- TRAP_BRKPT = 1, /* Process breakpoint. */
-# define TRAP_BRKPT TRAP_BRKPT
- TRAP_TRACE /* Process trace trap. */
-# define TRAP_TRACE TRAP_TRACE
-};
-# endif
-
-# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-/* `si_code' values for SIGCHLD signal. */
-enum
-{
- CLD_EXITED = 1, /* Child has exited. */
-# define CLD_EXITED CLD_EXITED
- CLD_KILLED, /* Child was killed. */
-# define CLD_KILLED CLD_KILLED
- CLD_DUMPED, /* Child terminated abnormally. */
-# define CLD_DUMPED CLD_DUMPED
- CLD_TRAPPED, /* Traced child has trapped. */
-# define CLD_TRAPPED CLD_TRAPPED
- CLD_STOPPED, /* Child has stopped. */
-# define CLD_STOPPED CLD_STOPPED
- CLD_CONTINUED /* Stopped child has continued. */
-# define CLD_CONTINUED CLD_CONTINUED
-};
-
-/* `si_code' values for SIGPOLL signal. */
-enum
-{
- POLL_IN = 1, /* Data input available. */
-# define POLL_IN POLL_IN
- POLL_OUT, /* Output buffers available. */
-# define POLL_OUT POLL_OUT
- POLL_MSG, /* Input message available. */
-# define POLL_MSG POLL_MSG
- POLL_ERR, /* I/O error. */
-# define POLL_ERR POLL_ERR
- POLL_PRI, /* High priority input available. */
-# define POLL_PRI POLL_PRI
- POLL_HUP /* Device disconnected. */
-# define POLL_HUP POLL_HUP
-};
-# endif
-
-# undef __need_siginfo_t
-#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
-
-
-#if (defined _SIGNAL_H || defined __need_sigevent_t) \
- && !defined __have_sigevent_t
-# define __have_sigevent_t 1
-
-/* Structure to transport application-defined values with signals. */
-# define __SIGEV_MAX_SIZE 64
-# if __WORDSIZE == 64
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
-# else
-# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
-# endif
-
-/* Forward declaration. */
-# ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-# endif
-
-typedef struct sigevent
- {
- sigval_t sigev_value;
- int sigev_signo;
- int sigev_notify;
-
- union
- {
- int _pad[__SIGEV_PAD_SIZE];
-
- /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
- thread to receive the signal. */
- __pid_t _tid;
-
- struct
- {
- void (*_function) (sigval_t); /* Function to start. */
- pthread_attr_t *_attribute; /* Thread attributes. */
- } _sigev_thread;
- } _sigev_un;
- } sigevent_t;
-
-/* POSIX names to access some of the members. */
-# define sigev_notify_function _sigev_un._sigev_thread._function
-# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
-
-/* `sigev_notify' values. */
-enum
-{
- SIGEV_SIGNAL = 0, /* Notify via signal. */
-# define SIGEV_SIGNAL SIGEV_SIGNAL
- SIGEV_NONE, /* Other notification: meaningless. */
-# define SIGEV_NONE SIGEV_NONE
- SIGEV_THREAD, /* Deliver via thread creation. */
-# define SIGEV_THREAD SIGEV_THREAD
-
- SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
-#define SIGEV_THREAD_ID SIGEV_THREAD_ID
-};
-
-#endif /* have _SIGNAL_H. */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/stat.h b/sysdeps/unix/sysv/linux/x86/bits/stat.h
index 5ea0d2a711..2ae248691d 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/bits/sysctl.h b/sysdeps/unix/sysv/linux/x86/bits/sysctl.h
index 6133da0458..8d76ed89db 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/sysctl.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/sysctl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
index 5817ef3f86..e6f7481a19 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -81,6 +81,11 @@
/* Same for ino_t and ino64_t. */
# define __INO_T_MATCHES_INO64_T 1
+
+/* And for __rlim_t and __rlim64_t. */
+# define __RLIM_T_MATCHES_RLIM64_T 1
+#else
+# define __RLIM_T_MATCHES_RLIM64_T 0
#endif
/* Number of descriptors that can fit in an `fd_set'. */
diff --git a/sysdeps/unix/sysv/linux/x86/cpu-features.c b/sysdeps/unix/sysv/linux/x86/cpu-features.c
new file mode 100644
index 0000000000..8566a265b8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/cpu-features.c
@@ -0,0 +1,46 @@
+/* Initialize CPU feature data for Linux/x86.
+ This file is part of the GNU C Library.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/>. */
+
+#if CET_ENABLED
+# include <sys/prctl.h>
+# include <asm/prctl.h>
+
+static inline int __attribute__ ((always_inline))
+get_cet_status (void)
+{
+ unsigned long long cet_status[3];
+ INTERNAL_SYSCALL_DECL (err);
+ if (INTERNAL_SYSCALL (arch_prctl, err, 2, ARCH_CET_STATUS,
+ cet_status) == 0)
+ return cet_status[0];
+ return 0;
+}
+
+# ifndef SHARED
+static inline void
+x86_setup_tls (void)
+{
+ __libc_setup_tls ();
+ THREAD_SETMEM (THREAD_SELF, header.feature_1, GL(dl_x86_feature_1)[0]);
+}
+
+# define ARCH_SETUP_TLS() x86_setup_tls ()
+# endif
+#endif
+
+#include <sysdeps/x86/cpu-features.c>
diff --git a/sysdeps/unix/sysv/linux/x86/dl-cet.h b/sysdeps/unix/sysv/linux/x86/dl-cet.h
new file mode 100644
index 0000000000..3fbcfebed5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/dl-cet.h
@@ -0,0 +1,55 @@
+/* Linux/x86 CET initializers function.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/prctl.h>
+#include <asm/prctl.h>
+
+static inline int __attribute__ ((always_inline))
+dl_cet_allocate_legacy_bitmap (unsigned long *legacy_bitmap)
+{
+ /* Allocate legacy bitmap. */
+ INTERNAL_SYSCALL_DECL (err);
+#ifdef __LP64__
+ return (int) INTERNAL_SYSCALL (arch_prctl, err, 2,
+ ARCH_CET_LEGACY_BITMAP, legacy_bitmap);
+#else
+ unsigned long long legacy_bitmap_u64[2];
+ int res = INTERNAL_SYSCALL (arch_prctl, err, 2,
+ ARCH_CET_LEGACY_BITMAP, legacy_bitmap_u64);
+ if (res == 0)
+ {
+ legacy_bitmap[0] = legacy_bitmap_u64[0];
+ legacy_bitmap[1] = legacy_bitmap_u64[1];
+ }
+ return res;
+#endif
+}
+
+static inline int __attribute__ ((always_inline))
+dl_cet_disable_cet (unsigned int cet_feature)
+{
+ INTERNAL_SYSCALL_DECL (err);
+ return (int) INTERNAL_SYSCALL (arch_prctl, err, 2, ARCH_CET_DISABLE,
+ cet_feature);
+}
+
+static inline int __attribute__ ((always_inline))
+dl_cet_lock_cet (void)
+{
+ INTERNAL_SYSCALL_DECL (err);
+ return (int) INTERNAL_SYSCALL (arch_prctl, err, 2, ARCH_CET_LOCK, 0);
+}
diff --git a/sysdeps/unix/sysv/linux/x86/dl-sysdep.c b/sysdeps/unix/sysv/linux/x86/dl-sysdep.c
new file mode 100644
index 0000000000..f4478b1389
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/dl-sysdep.c
@@ -0,0 +1,21 @@
+/* Operating system support for run-time dynamic linker. X86 version.
+ Copyright (C) 2017-2018 Free Software 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 <config.h>
+#include <sysdeps/x86/cpu-tunables.c>
+#include <sysdeps/unix/sysv/linux/dl-sysdep.c>
diff --git a/sysdeps/unix/sysv/linux/x86/elision-conf.c b/sysdeps/unix/sysv/linux/x86/elision-conf.c
index 0d98133804..22af294426 100644
--- a/sysdeps/unix/sysv/linux/x86/elision-conf.c
+++ b/sysdeps/unix/sysv/linux/x86/elision-conf.c
@@ -1,5 +1,5 @@
/* elision-conf.c: Lock elision tunable parameters.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,11 @@
#include <elision-conf.h>
#include <unistd.h>
+#if HAVE_TUNABLES
+# define TUNABLE_NAMESPACE elision
+#endif
+#include <elf/dl-tunables.h>
+
/* Reasonable initial tuning values, may be revised in the future.
This is a conservative initial value. */
@@ -43,31 +48,81 @@ struct elision_config __elision_aconf =
.skip_trylock_internal_abort = 3,
};
-/* Set when the CPU supports elision. When false elision is never attempted.
- */
-
-int __elision_available attribute_hidden;
-
/* Force elision for all new locks. This is used to decide whether existing
DEFAULT locks should be automatically upgraded to elision in
pthread_mutex_lock(). Disabled for suid programs. Only used when elision
is available. */
-int __pthread_force_elision attribute_hidden;
+int __pthread_force_elision attribute_hidden = 0;
-/* Initialize elison. */
+#if HAVE_TUNABLES
+static inline void
+__always_inline
+do_set_elision_enable (int32_t elision_enable)
+{
+ /* Enable elision if it's avaliable in hardware. It's not necessary to check
+ if __libc_enable_secure isn't enabled since elision_enable will be set
+ according to the default, which is disabled. */
+ if (elision_enable == 1)
+ __pthread_force_elision = HAS_CPU_FEATURE (RTM) ? 1 : 0;
+}
+
+/* The pthread->elision_enable tunable is 0 or 1 indicating that elision
+ should be disabled or enabled respectively. The feature will only be used
+ if it's supported by the hardware. */
+
+void
+TUNABLE_CALLBACK (set_elision_enable) (tunable_val_t *valp)
+{
+ int32_t elision_enable = (int32_t) valp->numval;
+ do_set_elision_enable (elision_enable);
+}
+
+#define TUNABLE_CALLBACK_FNDECL(__name, __type) \
+static inline void \
+__always_inline \
+do_set_elision_ ## __name (__type value) \
+{ \
+ __elision_aconf.__name = value; \
+} \
+void \
+TUNABLE_CALLBACK (set_elision_ ## __name) (tunable_val_t *valp) \
+{ \
+ __type value = (__type) (valp)->numval; \
+ do_set_elision_ ## __name (value); \
+}
+
+TUNABLE_CALLBACK_FNDECL (skip_lock_busy, int32_t);
+TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
+TUNABLE_CALLBACK_FNDECL (retry_try_xbegin, int32_t);
+TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
+#endif
+
+/* Initialize elision. */
static void
elision_init (int argc __attribute__ ((unused)),
char **argv __attribute__ ((unused)),
char **environ)
{
- __elision_available = HAS_CPU_FEATURE (RTM);
-#ifdef ENABLE_LOCK_ELISION
- __pthread_force_elision = __libc_enable_secure ? 0 : __elision_available;
+#if HAVE_TUNABLES
+ /* Elision depends on tunables and must be explicitly turned on by setting
+ the appropriate tunable on a supported platform. */
+
+ TUNABLE_GET (enable, int32_t,
+ TUNABLE_CALLBACK (set_elision_enable));
+ TUNABLE_GET (skip_lock_busy, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_lock_busy));
+ TUNABLE_GET (skip_lock_internal_abort, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_lock_internal_abort));
+ TUNABLE_GET (tries, int32_t,
+ TUNABLE_CALLBACK (set_elision_retry_try_xbegin));
+ TUNABLE_GET (skip_trylock_internal_abort, int32_t,
+ TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
#endif
- if (!HAS_CPU_FEATURE (RTM))
- __elision_aconf.retry_try_xbegin = 0; /* Disable elision on rwlocks */
+
+ if (!__pthread_force_elision)
+ __elision_aconf.retry_try_xbegin = 0; /* Disable elision on rwlocks. */
}
#ifdef SHARED
diff --git a/sysdeps/unix/sysv/linux/x86/elision-conf.h b/sysdeps/unix/sysv/linux/x86/elision-conf.h
index 6c479b31e7..0979d95086 100644
--- a/sysdeps/unix/sysv/linux/x86/elision-conf.h
+++ b/sysdeps/unix/sysv/linux/x86/elision-conf.h
@@ -1,5 +1,5 @@
/* elision-conf.h: Lock elision tunable parameters.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,6 @@ struct elision_config
extern struct elision_config __elision_aconf attribute_hidden;
-extern int __elision_available attribute_hidden;
extern int __pthread_force_elision attribute_hidden;
/* Tell the test suite to test elision for this architecture. */
diff --git a/sysdeps/unix/sysv/linux/x86/elision-lock.c b/sysdeps/unix/sysv/linux/x86/elision-lock.c
index 5e66960123..c534131ab4 100644
--- a/sysdeps/unix/sysv/linux/x86/elision-lock.c
+++ b/sysdeps/unix/sysv/linux/x86/elision-lock.c
@@ -1,5 +1,5 @@
/* elision-lock.c: Elided pthread mutex lock.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,7 +44,13 @@
int
__lll_lock_elision (int *futex, short *adapt_count, EXTRAARG int private)
{
- if (*adapt_count <= 0)
+ /* adapt_count can be accessed concurrently; these accesses can be both
+ inside of transactions (if critical sections are nested and the outer
+ critical section uses lock elision) and outside of transactions. Thus,
+ we need to use atomic accesses to avoid data races. However, the
+ value of adapt_count is just a hint, so relaxed MO accesses are
+ sufficient. */
+ if (atomic_load_relaxed (adapt_count) <= 0)
{
unsigned status;
int try_xbegin;
@@ -70,15 +76,20 @@ __lll_lock_elision (int *futex, short *adapt_count, EXTRAARG int private)
&& _XABORT_CODE (status) == _ABORT_LOCK_BUSY)
{
/* Right now we skip here. Better would be to wait a bit
- and retry. This likely needs some spinning. */
- if (*adapt_count != aconf.skip_lock_busy)
- *adapt_count = aconf.skip_lock_busy;
+ and retry. This likely needs some spinning. See
+ above for why relaxed MO is sufficient. */
+ if (atomic_load_relaxed (adapt_count)
+ != aconf.skip_lock_busy)
+ atomic_store_relaxed (adapt_count, aconf.skip_lock_busy);
}
/* Internal abort. There is no chance for retry.
Use the normal locking and next time use lock.
- Be careful to avoid writing to the lock. */
- else if (*adapt_count != aconf.skip_lock_internal_abort)
- *adapt_count = aconf.skip_lock_internal_abort;
+ Be careful to avoid writing to the lock. See above for why
+ relaxed MO is sufficient. */
+ else if (atomic_load_relaxed (adapt_count)
+ != aconf.skip_lock_internal_abort)
+ atomic_store_relaxed (adapt_count,
+ aconf.skip_lock_internal_abort);
break;
}
}
@@ -87,7 +98,8 @@ __lll_lock_elision (int *futex, short *adapt_count, EXTRAARG int private)
{
/* Use a normal lock until the threshold counter runs out.
Lost updates possible. */
- (*adapt_count)--;
+ atomic_store_relaxed (adapt_count,
+ atomic_load_relaxed (adapt_count) - 1);
}
/* Use a normal lock here. */
diff --git a/sysdeps/unix/sysv/linux/x86/elision-timed.c b/sysdeps/unix/sysv/linux/x86/elision-timed.c
index 2e7d1efa76..f0be3ea6a5 100644
--- a/sysdeps/unix/sysv/linux/x86/elision-timed.c
+++ b/sysdeps/unix/sysv/linux/x86/elision-timed.c
@@ -1,5 +1,5 @@
/* elision-timed.c: Lock elision timed lock.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/elision-trylock.c b/sysdeps/unix/sysv/linux/x86/elision-trylock.c
index 65d9c18584..7c55fb878e 100644
--- a/sysdeps/unix/sysv/linux/x86/elision-trylock.c
+++ b/sysdeps/unix/sysv/linux/x86/elision-trylock.c
@@ -1,5 +1,5 @@
/* elision-trylock.c: Lock eliding trylock for pthreads.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,8 +36,10 @@ __lll_trylock_elision (int *futex, short *adapt_count)
return an error. */
_xabort (_ABORT_NESTED_TRYLOCK);
- /* Only try a transaction if it's worth it. */
- if (*adapt_count <= 0)
+ /* Only try a transaction if it's worth it. See __lll_lock_elision for
+ why we need atomic accesses. Relaxed MO is sufficient because this is
+ just a hint. */
+ if (atomic_load_relaxed (adapt_count) <= 0)
{
unsigned status;
@@ -55,16 +57,18 @@ __lll_trylock_elision (int *futex, short *adapt_count)
if (!(status & _XABORT_RETRY))
{
/* Internal abort. No chance for retry. For future
- locks don't try speculation for some time. */
- if (*adapt_count != aconf.skip_trylock_internal_abort)
- *adapt_count = aconf.skip_trylock_internal_abort;
+ locks don't try speculation for some time. See above for MO. */
+ if (atomic_load_relaxed (adapt_count)
+ != aconf.skip_lock_internal_abort)
+ atomic_store_relaxed (adapt_count, aconf.skip_lock_internal_abort);
}
/* Could do some retries here. */
}
else
{
- /* Lost updates are possible, but harmless. */
- (*adapt_count)--;
+ /* Lost updates are possible but harmless (see above). */
+ atomic_store_relaxed (adapt_count,
+ atomic_load_relaxed (adapt_count) - 1);
}
return lll_trylock (*futex);
diff --git a/sysdeps/unix/sysv/linux/x86/elision-unlock.c b/sysdeps/unix/sysv/linux/x86/elision-unlock.c
index 8ce5d79acd..bdf6386bd6 100644
--- a/sysdeps/unix/sysv/linux/x86/elision-unlock.c
+++ b/sysdeps/unix/sysv/linux/x86/elision-unlock.c
@@ -1,5 +1,5 @@
/* elision-unlock.c: Commit an elided pthread lock.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/force-elision.h b/sysdeps/unix/sysv/linux/x86/force-elision.h
index 19298b2af9..dd659c908f 100644
--- a/sysdeps/unix/sysv/linux/x86/force-elision.h
+++ b/sysdeps/unix/sysv/linux/x86/force-elision.h
@@ -1,5 +1,5 @@
/* force-elision.h: Automatic enabling of elision for mutexes
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/gettimeofday.c b/sysdeps/unix/sysv/linux/x86/gettimeofday.c
index 36f7c26ffb..e125859c1a 100644
--- a/sysdeps/unix/sysv/linux/x86/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/x86/gettimeofday.c
@@ -1,5 +1,5 @@
/* gettimeofday - get the time. Linux/x86 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,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/include/asm/prctl.h b/sysdeps/unix/sysv/linux/x86/include/asm/prctl.h
new file mode 100644
index 0000000000..f67f3299b9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/include/asm/prctl.h
@@ -0,0 +1,32 @@
+/* FIXME: CET arch_prctl bits should come from the kernel header files.
+ This file should be removed if <asm/prctl.h> from the required kernel
+ header files contains CET arch_prctl bits. */
+
+#include_next <asm/prctl.h>
+
+#ifndef ARCH_CET_STATUS
+/* CET features:
+ IBT: GNU_PROPERTY_X86_FEATURE_1_IBT
+ SHSTK: GNU_PROPERTY_X86_FEATURE_1_SHSTK
+ */
+/* Return CET features in unsigned long long *addr:
+ features: addr[0].
+ shadow stack base address: addr[1].
+ shadow stack size: addr[2].
+ */
+# define ARCH_CET_STATUS 0x3001
+/* Disable CET features in unsigned int features. */
+# define ARCH_CET_DISABLE 0x3002
+/* Lock all CET features. */
+# define ARCH_CET_LOCK 0x3003
+/* Allocate a new shadow stack with unsigned long long *addr:
+ IN: requested shadow stack size: *addr.
+ OUT: allocated shadow stack address: *addr.
+ */
+# define ARCH_CET_ALLOC_SHSTK 0x3004
+/* Return legacy region bitmap info in unsigned long long *addr:
+ address: addr[0].
+ size: addr[1].
+ */
+# define ARCH_CET_LEGACY_BITMAP 0x3005
+#endif /* ARCH_CET_STATUS */
diff --git a/sysdeps/unix/sysv/linux/x86/jmp_buf-ssp.sym b/sysdeps/unix/sysv/linux/x86/jmp_buf-ssp.sym
new file mode 100644
index 0000000000..12829196db
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/jmp_buf-ssp.sym
@@ -0,0 +1,5 @@
+#include <setjmpP.h>
+#undef __saved_mask
+
+--
+SHADOW_STACK_POINTER_OFFSET offsetof(struct __jmp_buf_tag, __saved_mask.__saved.__shadow_stack_pointer)
diff --git a/sysdeps/unix/sysv/linux/x86/libc-vdso.h b/sysdeps/unix/sysv/linux/x86/libc-vdso.h
index f1a1b13a92..6f86073dae 100644
--- a/sysdeps/unix/sysv/linux/x86/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/x86/libc-vdso.h
@@ -1,5 +1,5 @@
/* Resolve function pointers to VDSO functions.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,7 +29,8 @@
extern long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
attribute_hidden;
-extern long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *);
+extern long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
+ attribute_hidden;
#endif
diff --git a/sysdeps/unix/sysv/linux/x86/pkey_get.c b/sysdeps/unix/sysv/linux/x86/pkey_get.c
new file mode 100644
index 0000000000..da05ba7f84
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/pkey_get.c
@@ -0,0 +1,33 @@
+/* Reading the per-thread memory protection key, x86_64 version.
+ Copyright (C) 2017-2018 Free Software 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 <arch-pkey.h>
+#include <errno.h>
+
+int
+pkey_get (int key)
+{
+ if (key < 0 || key > 15)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+ unsigned int pkru = pkey_read ();
+ return (pkru >> (2 * key)) & 3;
+ return 0;
+}
diff --git a/sysdeps/unix/sysv/linux/x86/pkey_set.c b/sysdeps/unix/sysv/linux/x86/pkey_set.c
new file mode 100644
index 0000000000..ea061d6dd7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/pkey_set.c
@@ -0,0 +1,35 @@
+/* Changing the per-thread memory protection key, x86_64 version.
+ Copyright (C) 2017-2018 Free Software 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 <arch-pkey.h>
+#include <errno.h>
+
+int
+pkey_set (int key, unsigned int rights)
+{
+ if (key < 0 || key > 15 || rights > 3)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+ unsigned int mask = 3 << (2 * key);
+ unsigned int pkru = pkey_read ();
+ pkru = (pkru & ~mask) | (rights << (2 * key));
+ pkey_write (pkru);
+ return 0;
+}
diff --git a/sysdeps/unix/sysv/linux/x86/pthread_mutex_cond_lock.c b/sysdeps/unix/sysv/linux/x86/pthread_mutex_cond_lock.c
index 5d9b14c2a5..967d00748d 100644
--- a/sysdeps/unix/sysv/linux/x86/pthread_mutex_cond_lock.c
+++ b/sysdeps/unix/sysv/linux/x86/pthread_mutex_cond_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/pthread_mutex_lock.c b/sysdeps/unix/sysv/linux/x86/pthread_mutex_lock.c
index ea0769e74a..c23678f922 100644
--- a/sysdeps/unix/sysv/linux/x86/pthread_mutex_lock.c
+++ b/sysdeps/unix/sysv/linux/x86/pthread_mutex_lock.c
@@ -1,5 +1,5 @@
/* Elided version of pthread_mutex_lock.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c b/sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c
index 009a6cfea7..7997580178 100644
--- a/sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c
+++ b/sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c
@@ -1,5 +1,5 @@
/* Elided version of pthread_mutex_timedlock.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/pthread_mutex_trylock.c b/sysdeps/unix/sysv/linux/x86/pthread_mutex_trylock.c
index b9cebe47e5..03db974095 100644
--- a/sysdeps/unix/sysv/linux/x86/pthread_mutex_trylock.c
+++ b/sysdeps/unix/sysv/linux/x86/pthread_mutex_trylock.c
@@ -1,5 +1,5 @@
/* Elided version of pthread_mutex_trylock.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/setjmpP.h b/sysdeps/unix/sysv/linux/x86/setjmpP.h
new file mode 100644
index 0000000000..6b2608453d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/setjmpP.h
@@ -0,0 +1,128 @@
+/* Internal header file for <setjmp.h>. Linux/x86 version.
+ Copyright (C) 2017-2018 Free Software 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 _SETJMPP_H
+#define _SETJMPP_H 1
+
+#include <bits/types/__sigset_t.h>
+#include <libc-pointer-arith.h>
+
+/* <setjmp/setjmp.h> has
+
+struct __jmp_buf_tag
+ {
+ __jmp_buf __jmpbuf;
+ int __mask_was_saved;
+ __sigset_t __saved_mask;
+ };
+
+ struct __jmp_buf_tag is 32 bits aligned on i386 and is 64 bits
+ aligned on x32 and x86-64. __saved_mask is aligned to 32 bits
+ on i386/x32 without padding and is aligned to 64 bits on x86-64
+ with 32 bit padding.
+
+ and <nptl/descr.h> has
+
+struct pthread_unwind_buf
+{
+ struct
+ {
+ __jmp_buf jmp_buf;
+ int mask_was_saved;
+ } cancel_jmp_buf[1];
+
+ union
+ {
+ void *pad[4];
+ struct
+ {
+ struct pthread_unwind_buf *prev;
+ struct _pthread_cleanup_buffer *cleanup;
+ int canceltype;
+ } data;
+ } priv;
+};
+
+ struct pthread_unwind_buf is 32 bits aligned on i386 and 64 bits
+ aligned on x32/x86-64. cancel_jmp_buf is aligned to 32 bits on
+ i386 and is aligned to 64 bits on x32/x86-64.
+
+ The pad array in struct pthread_unwind_buf is used by setjmp to save
+ shadow stack register. The usable space in __saved_mask for sigset
+ and shadow stack pointer:
+ 1. i386: The 4x4 byte pad array which can be used for 4 byte shadow
+ stack pointer and maximum 12 byte sigset.
+ 2. x32: 4 byte padding + the 4x4 byte pad array which can be used
+ for 8 byte shadow stack pointer and maximum 12 byte sigset.
+ 3. x86-64: The 4x8 byte pad array which can be used for 8 byte
+ shadow stack pointer and maximum 24 byte sigset.
+
+ NB: We use setjmp in thread cancellation and this saves the shadow
+ stack register, but __libc_unwind_longjmp doesn't restore the shadow
+ stack register since cancellation never returns after longjmp. */
+
+/* Number of bits per long. */
+#define _JUMP_BUF_SIGSET_BITS_PER_WORD (8 * sizeof (unsigned long int))
+/* The biggest signal number. As of kernel 4.14, x86 _NSIG is 64. The
+ common maximum sigset for i386, x32 and x86-64 is 12 bytes (96 bits).
+ Define it to 96 to leave some rooms for future use. */
+#define _JUMP_BUF_SIGSET_NSIG 96
+/* Number of longs to hold all signals. */
+#define _JUMP_BUF_SIGSET_NWORDS \
+ (ALIGN_UP (_JUMP_BUF_SIGSET_NSIG, _JUMP_BUF_SIGSET_BITS_PER_WORD) \
+ / _JUMP_BUF_SIGSET_BITS_PER_WORD)
+
+typedef struct
+ {
+ unsigned long int __val[_JUMP_BUF_SIGSET_NWORDS];
+ } __jmp_buf_sigset_t;
+
+typedef union
+ {
+ __sigset_t __saved_mask_compat;
+ struct
+ {
+ __jmp_buf_sigset_t __saved_mask;
+ /* Used for shadow stack pointer. NB: Shadow stack pointer
+ must have the same alignment as __saved_mask. Otherwise
+ offset of __saved_mask will be changed. */
+ unsigned long int __shadow_stack_pointer;
+ } __saved;
+ } __jmpbuf_arch_t;
+
+#undef __sigset_t
+#define __sigset_t __jmpbuf_arch_t
+#include <setjmp.h>
+#undef __saved_mask
+#define __saved_mask __saved_mask.__saved.__saved_mask
+
+#include <signal.h>
+
+#define _SIGPROCMASK_NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int)))
+
+typedef struct
+ {
+ unsigned long int __val[_SIGPROCMASK_NSIG_WORDS];
+ } __sigprocmask_sigset_t;
+
+extern jmp_buf ___buf;
+extern __typeof (___buf[0].__saved_mask) ___saved_mask;
+_Static_assert (sizeof (___saved_mask) >= sizeof (__sigprocmask_sigset_t),
+ "size of ___saved_mask < size of __sigprocmask_sigset_t");
+
+#endif /* setjmpP.h */
diff --git a/sysdeps/unix/sysv/linux/x86/sys/debugreg.h b/sysdeps/unix/sysv/linux/x86/sys/debugreg.h
index 6054c5f731..b8bbb31117 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/debugreg.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/debugreg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/sys/elf.h b/sysdeps/unix/sysv/linux/x86/sys/elf.h
index 29842e2b91..2e5b2489f9 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/elf.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/elf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/sys/io.h b/sysdeps/unix/sysv/linux/x86/sys/io.h
index d3dc885979..34bfea53a1 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/io.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/io.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/sys/perm.h b/sysdeps/unix/sysv/linux/x86/sys/perm.h
index a6f139d7d6..d9a241775d 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/perm.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/perm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/sys/procfs.h b/sysdeps/unix/sysv/linux/x86/sys/procfs.h
index 7616243c2e..9203963afe 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/sys/ptrace.h b/sysdeps/unix/sysv/linux/x86/sys/ptrace.h
new file mode 100644
index 0000000000..6d4605b6ed
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/sys/ptrace.h
@@ -0,0 +1,198 @@
+/* `ptrace' debugger support interface. Linux/x86 version.
+ Copyright (C) 1996-2018 Free Software 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 _SYS_PTRACE_H
+#define _SYS_PTRACE_H 1
+
+#include <features.h>
+#include <bits/types.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.' */
+enum __ptrace_request
+{
+ /* Indicate that the process making this request should be traced.
+ All signals received by this process can be intercepted by its
+ parent, and its parent can use the other `ptrace' requests. */
+ PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+ /* Return the word in the process's text space at address ADDR. */
+ PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+ /* Return the word in the process's data space at address ADDR. */
+ PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+ /* Return the word in the process's user area at offset ADDR. */
+ PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+ /* Write the word DATA into the process's text space at address ADDR. */
+ PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+ /* Write the word DATA into the process's data space at address ADDR. */
+ PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+ /* Write the word DATA into the process's user area at offset ADDR. */
+ PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+ /* Continue the process. */
+ PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+ /* Kill the process. */
+ PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+ /* Single step the process. */
+ PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+ /* Get all general purpose registers used by a processes. */
+ PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+ /* Set all general purpose registers used by a processes. */
+ PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+ /* Get all floating point registers used by a processes. */
+ PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+ /* Set all floating point registers used by a processes. */
+ PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+ /* Attach to a process that is already running. */
+ PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+ /* Detach from a process attached to with PTRACE_ATTACH. */
+ PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+ /* Get all extended floating point registers used by a processes. */
+ PTRACE_GETFPXREGS = 18,
+#define PT_GETFPXREGS PTRACE_GETFPXREGS
+
+ /* Set all extended floating point registers used by a processes. */
+ PTRACE_SETFPXREGS = 19,
+#define PT_SETFPXREGS PTRACE_SETFPXREGS
+
+ /* Continue and stop at the next entry to or return from syscall. */
+ PTRACE_SYSCALL = 24,
+#define PT_SYSCALL PTRACE_SYSCALL
+
+ /* Get a TLS entry in the GDT. */
+ PTRACE_GET_THREAD_AREA = 25,
+#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
+
+ /* Change a TLS entry in the GDT. */
+ PTRACE_SET_THREAD_AREA = 26,
+#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
+
+#ifdef __x86_64__
+ /* Access TLS data. */
+ PTRACE_ARCH_PRCTL = 30,
+# define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
+#endif
+
+ /* Continue and stop at the next syscall, it will not be executed. */
+ PTRACE_SYSEMU = 31,
+#define PT_SYSEMU PTRACE_SYSEMU
+
+ /* Single step the process, the next syscall will not be executed. */
+ PTRACE_SYSEMU_SINGLESTEP = 32,
+#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
+
+ /* Execute process until next taken branch. */
+ PTRACE_SINGLEBLOCK = 33,
+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
+
+ /* Set ptrace filter options. */
+ PTRACE_SETOPTIONS = 0x4200,
+#define PT_SETOPTIONS PTRACE_SETOPTIONS
+
+ /* Get last ptrace message. */
+ PTRACE_GETEVENTMSG = 0x4201,
+#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
+
+ /* Get siginfo for process. */
+ PTRACE_GETSIGINFO = 0x4202,
+#define PT_GETSIGINFO PTRACE_GETSIGINFO
+
+ /* Set new siginfo for process. */
+ PTRACE_SETSIGINFO = 0x4203,
+#define PT_SETSIGINFO PTRACE_SETSIGINFO
+
+ /* Get register content. */
+ PTRACE_GETREGSET = 0x4204,
+#define PTRACE_GETREGSET PTRACE_GETREGSET
+
+ /* Set register content. */
+ PTRACE_SETREGSET = 0x4205,
+#define PTRACE_SETREGSET PTRACE_SETREGSET
+
+ /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
+ signal or group stop state. */
+ PTRACE_SEIZE = 0x4206,
+#define PTRACE_SEIZE PTRACE_SEIZE
+
+ /* Trap seized tracee. */
+ PTRACE_INTERRUPT = 0x4207,
+#define PTRACE_INTERRUPT PTRACE_INTERRUPT
+
+ /* Wait for next group event. */
+ PTRACE_LISTEN = 0x4208,
+#define PTRACE_LISTEN PTRACE_LISTEN
+
+ /* Retrieve siginfo_t structures without removing signals from a queue. */
+ PTRACE_PEEKSIGINFO = 0x4209,
+#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+
+ /* Get the mask of blocked signals. */
+ PTRACE_GETSIGMASK = 0x420a,
+#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
+
+ /* Change the mask of blocked signals. */
+ PTRACE_SETSIGMASK = 0x420b,
+#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
+
+ /* Get seccomp BPF filters. */
+ PTRACE_SECCOMP_GET_FILTER = 0x420c,
+#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+ /* Get seccomp BPF filter metadata. */
+ PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
+};
+
+
+#include <bits/ptrace-shared.h>
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/sysdeps/unix/sysv/linux/x86/sys/reg.h b/sysdeps/unix/sysv/linux/x86/sys/reg.h
index 980468114e..0a543b502e 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/reg.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/reg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/sys/ucontext.h b/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
index 062063526b..7367726a50 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,11 +19,17 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
-#include <bits/sigcontext.h>
+#include <bits/types.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
#ifdef __x86_64__
@@ -31,10 +37,13 @@
__extension__ typedef long long int greg_t;
/* Number of general registers. */
-#define NGREG 23
+#define __NGREG 23
+#ifdef __USE_MISC
+# define NGREG __NGREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
#ifdef __USE_GNU
/* Number of each register in the `gregset_t' array. */
@@ -91,30 +100,30 @@ enum
struct _libc_fpxreg
{
- unsigned short int significand[4];
- unsigned short int exponent;
- unsigned short int padding[3];
+ unsigned short int __ctx(significand)[4];
+ unsigned short int __ctx(exponent);
+ unsigned short int __glibc_reserved1[3];
};
struct _libc_xmmreg
{
- __uint32_t element[4];
+ __uint32_t __ctx(element)[4];
};
struct _libc_fpstate
{
/* 64-bit FXSAVE format. */
- __uint16_t cwd;
- __uint16_t swd;
- __uint16_t ftw;
- __uint16_t fop;
- __uint64_t rip;
- __uint64_t rdp;
- __uint32_t mxcsr;
- __uint32_t mxcr_mask;
+ __uint16_t __ctx(cwd);
+ __uint16_t __ctx(swd);
+ __uint16_t __ctx(ftw);
+ __uint16_t __ctx(fop);
+ __uint64_t __ctx(rip);
+ __uint64_t __ctx(rdp);
+ __uint32_t __ctx(mxcsr);
+ __uint32_t __ctx(mxcr_mask);
struct _libc_fpxreg _st[8];
struct _libc_xmmreg _xmm[16];
- __uint32_t padding[24];
+ __uint32_t __glibc_reserved1[24];
};
/* Structure to describe FPU registers. */
@@ -123,21 +132,22 @@ typedef struct _libc_fpstate *fpregset_t;
/* Context to describe whole processor state. */
typedef struct
{
- gregset_t gregs;
+ gregset_t __ctx(gregs);
/* Note that fpregs is a pointer. */
- fpregset_t fpregs;
+ fpregset_t __ctx(fpregs);
__extension__ unsigned long long __reserved1 [8];
} mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
+ sigset_t uc_sigmask;
struct _libc_fpstate __fpregs_mem;
+ __extension__ unsigned long long int __ssp[4];
} ucontext_t;
#else /* !__x86_64__ */
@@ -146,10 +156,13 @@ typedef struct ucontext
typedef int greg_t;
/* Number of general registers. */
-#define NGREG 19
+#define __NGREG 19
+#ifdef __USE_MISC
+# define NGREG __NGREG
+#endif
/* Container for all general registers. */
-typedef greg_t gregset_t[NGREG];
+typedef greg_t gregset_t[__NGREG];
#ifdef __USE_GNU
/* Number of each register is the `gregset_t' array. */
@@ -199,21 +212,21 @@ enum
/* Definitions taken from the kernel headers. */
struct _libc_fpreg
{
- unsigned short int significand[4];
- unsigned short int exponent;
+ unsigned short int __ctx(significand)[4];
+ unsigned short int __ctx(exponent);
};
struct _libc_fpstate
{
- unsigned long int cw;
- unsigned long int sw;
- unsigned long int tag;
- unsigned long int ipoff;
- unsigned long int cssel;
- unsigned long int dataoff;
- unsigned long int datasel;
+ unsigned long int __ctx(cw);
+ unsigned long int __ctx(sw);
+ unsigned long int __ctx(tag);
+ unsigned long int __ctx(ipoff);
+ unsigned long int __ctx(cssel);
+ unsigned long int __ctx(dataoff);
+ unsigned long int __ctx(datasel);
struct _libc_fpreg _st[8];
- unsigned long int status;
+ unsigned long int __ctx(status);
};
/* Structure to describe FPU registers. */
@@ -222,25 +235,28 @@ typedef struct _libc_fpstate *fpregset_t;
/* Context to describe whole processor state. */
typedef struct
{
- gregset_t gregs;
+ gregset_t __ctx(gregs);
/* Due to Linux's history we have to use a pointer here. The SysV/i386
ABI requires a struct with the values. */
- fpregset_t fpregs;
- unsigned long int oldmask;
- unsigned long int cr2;
+ fpregset_t __ctx(fpregs);
+ unsigned long int __ctx(oldmask);
+ unsigned long int __ctx(cr2);
} mcontext_t;
/* Userlevel context. */
-typedef struct ucontext
+typedef struct ucontext_t
{
- unsigned long int uc_flags;
- struct ucontext *uc_link;
+ unsigned long int __ctx(uc_flags);
+ struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
+ sigset_t uc_sigmask;
struct _libc_fpstate __fpregs_mem;
+ unsigned long int __ssp[4];
} ucontext_t;
#endif /* !__x86_64__ */
+#undef __ctx
+
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/x86/sys/user.h b/sysdeps/unix/sysv/linux/x86/sys/user.h
index 7ead5b30b5..03c80fbb20 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/user.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/sys/vm86.h b/sysdeps/unix/sysv/linux/x86/sys/vm86.h
index e9c5307e9f..3919812dfa 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/vm86.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/vm86.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/sysconf.c b/sysdeps/unix/sysv/linux/x86/sysconf.c
index 18aaac8122..199b3c4178 100644
--- a/sysdeps/unix/sysv/linux/x86/sysconf.c
+++ b/sysdeps/unix/sysv/linux/x86/sysconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86/time.c b/sysdeps/unix/sysv/linux/x86/time.c
index f5f7f918c9..d19cccd6f6 100644
--- a/sysdeps/unix/sysv/linux/x86/time.c
+++ b/sysdeps/unix/sysv/linux/x86/time.c
@@ -1,5 +1,5 @@
/* time -- Get number of seconds since Epoch. Linux/x86 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,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/tst-cet-property-1.c b/sysdeps/unix/sysv/linux/x86/tst-cet-property-1.c
new file mode 100644
index 0000000000..21130faefc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/tst-cet-property-1.c
@@ -0,0 +1,44 @@
+/* Test CET property note parser.
+ Copyright (C) 2018 Free Software 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 <elf.h>
+#include <tcb-offsets.h>
+
+/* This test prints out "IBT" if Intel indirect branch tracking (IBT)
+ is enabled at run-time, which is checked by tst-cet-property-2 to
+ verify that the IBT violation is caught on IBT machines. */
+
+static int
+do_test (void)
+{
+ unsigned int feature_1;
+#ifdef __x86_64__
+# define SEG_REG "fs"
+#else
+# define SEG_REG "gs"
+#endif
+ asm ("movl %%" SEG_REG ":%P1, %0"
+ : "=r" (feature_1) : "i" (FEATURE_1_OFFSET));
+ if ((feature_1 & GNU_PROPERTY_X86_FEATURE_1_IBT) != 0)
+ printf ("IBT\n");
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c b/sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c
new file mode 100644
index 0000000000..0531074ceb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c
@@ -0,0 +1,63 @@
+/* Test CET property note parser for [BZ #23467].
+ Copyright (C) 2018 Free Software 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 <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
+#include <support/check.h>
+
+extern void bar (void);
+
+void
+__attribute__ ((noclone, noinline))
+test (void (*func_p) (void))
+{
+ func_p ();
+}
+
+/* bar contains an IBT violation if it is called indirectly via a
+ function pointer. On IBT machines, it should lead to segfault
+ unless IBT is disabled by error. */
+
+static void
+sig_handler (int signo)
+{
+ exit (EXIT_SUCCESS);
+}
+
+static int
+do_test (void)
+{
+ char buf[20];
+
+ if (scanf ("%20s", buf) != 1)
+ FAIL_UNSUPPORTED ("IBT not supported");
+
+ if (strcmp (buf, "IBT") != 0)
+ FAIL_UNSUPPORTED ("IBT not supported");
+
+ TEST_VERIFY_EXIT (signal (SIGSEGV, &sig_handler) != SIG_ERR);
+
+ /* Call bar via a function pointer to force an IBT violation. */
+ test (bar);
+
+ return EXIT_FAILURE;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/x86/tst-cet-property-dep-2.S b/sysdeps/unix/sysv/linux/x86/tst-cet-property-dep-2.S
new file mode 100644
index 0000000000..5f5cad34d9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/tst-cet-property-dep-2.S
@@ -0,0 +1,63 @@
+/* Test CET property note parser.
+ Copyright (C) 2018 Free Software 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 <cet.h>
+
+ .text
+ .p2align 4,,15
+ .globl bar
+ .type bar, @function
+/* Since this function doesn't start with ENDBR, it should lead to the
+ IBT violation when called indirectly. */
+bar:
+ .cfi_startproc
+ ret
+ .cfi_endproc
+ .size bar, .-bar
+
+#if __SIZEOF_PTRDIFF_T__ == 8
+# define ALIGN 3
+#elif __SIZEOF_PTRDIFF_T__ == 4
+# define ALIGN 2
+#endif
+
+/* In NT_GNU_PROPERTY_TYPE_0 note, add a GNU_PROPERTY_STACK_SIZE property
+ before the GNU_PROPERTY_X86_FEATURE_1_AND property. */
+ .section ".note.gnu.property", "a"
+ .p2align ALIGN
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long 5 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align ALIGN
+2:
+ .long 1 /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+#if __SIZEOF_PTRDIFF_T__ == 8
+ .long 0x800
+ .long 0x800
+#else
+ .long 0x08000800
+#endif
+4:
+ .p2align ALIGN
+5:
+
+ .section .note.GNU-stack,"",@progbits
diff --git a/sysdeps/unix/sysv/linux/x86/tst-cet-setcontext-1.c b/sysdeps/unix/sysv/linux/x86/tst-cet-setcontext-1.c
new file mode 100644
index 0000000000..ecf86a9e16
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/tst-cet-setcontext-1.c
@@ -0,0 +1,127 @@
+/* Check getcontext and setcontext on the context from makecontext
+ with shadow stack.
+ Copyright (C) 2018 Free Software 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 <stdint.h>
+#include <stdlib.h>
+#include <ucontext.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <stdatomic.h>
+#include <x86intrin.h>
+
+static ucontext_t ctx[5];
+static atomic_int done;
+
+static void
+__attribute__((noinline, noclone))
+f2 (void)
+{
+ printf ("start f2\n");
+ done++;
+ if (setcontext (&ctx[2]) != 0)
+ {
+ printf ("%s: setcontext: %m\n", __FUNCTION__);
+ exit (EXIT_FAILURE);
+ }
+}
+
+static void
+f1 (void)
+{
+ printf ("start f1\n");
+ if (getcontext (&ctx[2]) != 0)
+ {
+ printf ("%s: getcontext: %m\n", __FUNCTION__);
+ exit (EXIT_FAILURE);
+ }
+ if (done)
+ exit (EXIT_SUCCESS);
+ f2 ();
+}
+
+static int
+do_test (void)
+{
+ char st1[32768];
+ puts ("making contexts");
+ if (getcontext (&ctx[0]) != 0)
+ {
+ printf ("%s: getcontext: %m\n", __FUNCTION__);
+ exit (EXIT_FAILURE);
+ }
+ if (getcontext (&ctx[1]) != 0)
+ {
+ printf ("%s: getcontext: %m\n", __FUNCTION__);
+ exit (EXIT_FAILURE);
+ }
+
+ ctx[3].uc_stack.ss_sp = st1;
+ ctx[3].uc_stack.ss_size = sizeof st1;
+ ctx[3].uc_link = &ctx[0];
+ makecontext (&ctx[3], (void (*) (void)) f1, 0);
+
+ ctx[1].uc_stack.ss_sp = st1;
+ ctx[1].uc_stack.ss_size = sizeof st1;
+ ctx[1].uc_link = &ctx[0];
+ makecontext (&ctx[1], (void (*) (void)) f1, 0);
+
+ ctx[4].uc_stack.ss_sp = st1;
+ ctx[4].uc_stack.ss_size = sizeof st1;
+ ctx[4].uc_link = &ctx[0];
+ makecontext (&ctx[4], (void (*) (void)) f1, 0);
+
+ /* NB: When shadow stack is enabled, makecontext calls arch_prctl
+ with ARCH_CET_ALLOC_SHSTK to allocate a new shadow stack which
+ can be unmapped. The base address and size of the new shadow
+ stack are returned in __ssp[1] and __ssp[2]. makecontext is
+ called for CTX1, CTX3 and CTX4. But only CTX1 is used. New
+ shadow stacks are allocated in the order of CTX3, CTX1, CTX4.
+ It is very likely that CTX1's shadow stack is placed between
+ CTX3 and CTX4. We munmap CTX3's and CTX4's shadow stacks to
+ create gaps above and below CTX1's shadow stack. We check
+ that setcontext CTX1 works correctly in this case. */
+ if (_get_ssp () != 0)
+ {
+ if (ctx[3].__ssp[1] != 0
+ && munmap ((void *) (uintptr_t) ctx[3].__ssp[1],
+ (size_t) ctx[3].__ssp[2]) != 0)
+ {
+ printf ("%s: munmap: %m\n", __FUNCTION__);
+ exit (EXIT_FAILURE);
+ }
+
+ if (ctx[4].__ssp[1] != 0
+ && munmap ((void *) (uintptr_t) ctx[4].__ssp[1],
+ (size_t) ctx[4].__ssp[2]) != 0)
+ {
+ printf ("%s: munmap: %m\n", __FUNCTION__);
+ exit (EXIT_FAILURE);
+ }
+ }
+
+ if (setcontext (&ctx[1]) != 0)
+ {
+ printf ("%s: setcontext: %m\n", __FUNCTION__);
+ exit (EXIT_FAILURE);
+ }
+ exit (EXIT_FAILURE);
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/x86/tst-saved_mask-1.c b/sysdeps/unix/sysv/linux/x86/tst-saved_mask-1.c
new file mode 100644
index 0000000000..56e680527c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/tst-saved_mask-1.c
@@ -0,0 +1,55 @@
+/* Test that sigprocmask does not read from the unused part of jmpbuf.
+ Copyright (C) 2017-2018 Free Software 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 <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <errno.h>
+#include <setjmpP.h>
+#include <support/next_to_fault.h>
+
+#define SIZEOF_SIGSET_T sizeof (__jmp_buf_sigset_t)
+
+static int
+do_test (void)
+{
+ sigjmp_buf sj;
+ struct support_next_to_fault sigset_t_buf
+ = support_next_to_fault_allocate (SIZEOF_SIGSET_T);
+ sigset_t *m_p = (sigset_t *) sigset_t_buf.buffer;
+ sigset_t m;
+
+ sigemptyset (&m);
+ memcpy (m_p, &m, SIZEOF_SIGSET_T);
+ sigprocmask (SIG_SETMASK, m_p, NULL);
+ memcpy (&m, m_p, SIZEOF_SIGSET_T);
+ if (sigsetjmp (sj, 0) == 0)
+ {
+ sigaddset (&m, SIGUSR1);
+ memcpy (m_p, &m, SIZEOF_SIGSET_T);
+ sigprocmask (SIG_SETMASK, m_p, NULL);
+ memcpy (&m, m_p, SIZEOF_SIGSET_T);
+ siglongjmp (sj, 1);
+ return EXIT_FAILURE;
+ }
+ sigprocmask (SIG_SETMASK, NULL, m_p);
+ memcpy (&m, m_p, SIZEOF_SIGSET_T);
+ return sigismember (&m, SIGUSR1) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/configure b/sysdeps/unix/sysv/linux/x86_64/64/configure
index 9d1a8d271d..9d298faba7 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/configure
+++ b/sysdeps/unix/sysv/linux/x86_64/64/configure
@@ -4,8 +4,8 @@
test -n "$libc_cv_slibdir" ||
case "$prefix" in
/usr | /usr/)
- libc_cv_slibdir=/lib64
- libc_cv_rtlddir=/lib64
+ libc_cv_slibdir='/lib64'
+ libc_cv_rtlddir='/lib64'
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
# Locale data can be shared between 32-bit and 64-bit libraries.
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h b/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
index c9db5ea777..194369174d 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
+++ b/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
@@ -1,5 +1,5 @@
/* Optional code to distinguish library flavours. x86-64 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,10 +30,10 @@
is always disabled for SUID programs and can be enabled by setting
environment variable, LD_PREFER_MAP_32BIT_EXEC. */
#define EXTRA_LD_ENVVARS \
- case 21: \
- if (memcmp (envline, "PREFER_MAP_32BIT_EXEC", 21) == 0) \
- GLRO(dl_x86_cpu_features).feature[index_Prefer_MAP_32BIT_EXEC] \
- = bit_Prefer_MAP_32BIT_EXEC; \
+ case 21: \
+ if (memcmp (envline, "PREFER_MAP_32BIT_EXEC", 21) == 0) \
+ GLRO(dl_x86_cpu_features).feature[index_arch_Prefer_MAP_32BIT_EXEC] \
+ |= bit_arch_Prefer_MAP_32BIT_EXEC; \
break;
/* Extra unsecure variables. The names are all stuffed in a single
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h
new file mode 100644
index 0000000000..3ae63ab5c5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 200
+#define SIGJMP_BUF_SIZE 200
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 64
+#define SAVED_MASK_OFFSET 72
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
index 9e09ac6936..0dc9430611 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.2.5 GLIBC_2.2.5 A
-GLIBC_2.2.5 __libc_memalign F
GLIBC_2.2.5 __libc_stack_end D 0x8
GLIBC_2.2.5 _dl_mcount F
GLIBC_2.2.5 _r_debug D 0x28
@@ -7,6 +5,4 @@ GLIBC_2.2.5 calloc F
GLIBC_2.2.5 free F
GLIBC_2.2.5 malloc F
GLIBC_2.2.5 realloc F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libBrokenLocale.abilist
index 907c72986f..f1d93631d0 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libanl.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libanl.abilist
index a104f7562a..8d025f86b9 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 gai_cancel F
GLIBC_2.2.5 gai_error F
GLIBC_2.2.5 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index c6e3cd4257..816e4a7426 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.10 GLIBC_2.10 A
GLIBC_2.10 __cxa_at_quick_exit F
GLIBC_2.10 __posix_getopt F
GLIBC_2.10 accept4 F
@@ -25,27 +24,23 @@ GLIBC_2.10 register_printf_type F
GLIBC_2.10 setsgent F
GLIBC_2.10 sgetsgent F
GLIBC_2.10 sgetsgent_r F
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 __longjmp_chk F
GLIBC_2.11 execvpe F
GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 _sys_errlist D 0x438
GLIBC_2.12 _sys_nerr D 0x4
GLIBC_2.12 ntp_gettimex F
GLIBC_2.12 recvmmsg F
GLIBC_2.12 sys_errlist D 0x438
GLIBC_2.12 sys_nerr D 0x4
-GLIBC_2.13 GLIBC_2.13 A
GLIBC_2.13 __fentry__ F
GLIBC_2.13 fanotify_init F
GLIBC_2.13 fanotify_mark F
GLIBC_2.13 prlimit F
GLIBC_2.13 prlimit64 F
-GLIBC_2.14 GLIBC_2.14 A
GLIBC_2.14 clock_adjtime F
GLIBC_2.14 memcpy F
GLIBC_2.14 name_to_handle_at F
@@ -53,7 +48,6 @@ GLIBC_2.14 open_by_handle_at F
GLIBC_2.14 sendmmsg F
GLIBC_2.14 setns F
GLIBC_2.14 syncfs F
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __fdelt_chk F
GLIBC_2.15 __fdelt_warn F
GLIBC_2.15 posix_spawn F
@@ -62,7 +56,6 @@ GLIBC_2.15 process_vm_readv F
GLIBC_2.15 process_vm_writev F
GLIBC_2.15 scandirat F
GLIBC_2.15 scandirat64 F
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __getauxval F
GLIBC_2.16 __poll_chk F
GLIBC_2.16 __ppoll_chk F
@@ -73,16 +66,13 @@ GLIBC_2.16 getauxval F
GLIBC_2.16 mbrtoc16 F
GLIBC_2.16 mbrtoc32 F
GLIBC_2.16 timespec_get F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 _Exit F
GLIBC_2.2.5 _IO_2_1_stderr_ D 0xe0
GLIBC_2.2.5 _IO_2_1_stdin_ D 0xe0
@@ -1841,17 +1831,70 @@ GLIBC_2.2.5 xdrstdio_create F
GLIBC_2.2.5 xencrypt F
GLIBC_2.2.5 xprt_register F
GLIBC_2.2.5 xprt_unregister F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
-GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 __strtof128_internal F
+GLIBC_2.26 __wcstof128_internal F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.26 strfromf128 F
+GLIBC_2.26 strtof128 F
+GLIBC_2.26 strtof128_l F
+GLIBC_2.26 wcstof128 F
+GLIBC_2.26 wcstof128_l F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -1943,7 +1986,6 @@ GLIBC_2.3 wcstoull_l F
GLIBC_2.3 wcsxfrm_l F
GLIBC_2.3 wctrans_l F
GLIBC_2.3 wctype_l F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __register_atfork F
GLIBC_2.3.2 epoll_create F
GLIBC_2.3.2 epoll_ctl F
@@ -1956,7 +1998,6 @@ GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
GLIBC_2.3.2 strptime_l F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 _sys_siglist D 0x208
GLIBC_2.3.3 gnu_dev_major F
GLIBC_2.3.3 gnu_dev_makedev F
@@ -1977,7 +2018,6 @@ GLIBC_2.3.3 strtoll_l F
GLIBC_2.3.3 strtoull_l F
GLIBC_2.3.3 sys_sigabbrev D 0x208
GLIBC_2.3.3 sys_siglist D 0x208
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __chk_fail F
GLIBC_2.3.4 __fprintf_chk F
GLIBC_2.3.4 __gets_chk F
@@ -2007,7 +2047,6 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
@@ -2084,7 +2123,6 @@ GLIBC_2.4 sys_errlist D 0x420
GLIBC_2.4 sys_nerr D 0x4
GLIBC_2.4 unlinkat F
GLIBC_2.4 unshare F
-GLIBC_2.5 GLIBC_2.5 A
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
@@ -2102,7 +2140,6 @@ GLIBC_2.5 inet6_rth_space F
GLIBC_2.5 splice F
GLIBC_2.5 tee F
GLIBC_2.5 vmsplice F
-GLIBC_2.6 GLIBC_2.6 A
GLIBC_2.6 __sched_cpucount F
GLIBC_2.6 epoll_pwait F
GLIBC_2.6 futimens F
@@ -2110,7 +2147,6 @@ GLIBC_2.6 sched_getcpu F
GLIBC_2.6 strerror_l F
GLIBC_2.6 sync_file_range F
GLIBC_2.6 utimensat F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __fread_chk F
GLIBC_2.7 __fread_unlocked_chk F
GLIBC_2.7 __isoc99_fscanf F
@@ -2137,7 +2173,6 @@ GLIBC_2.7 eventfd_write F
GLIBC_2.7 mkostemp F
GLIBC_2.7 mkostemp64 F
GLIBC_2.7 signalfd F
-GLIBC_2.8 GLIBC_2.8 A
GLIBC_2.8 __asprintf_chk F
GLIBC_2.8 __dprintf_chk F
GLIBC_2.8 __obstack_printf_chk F
@@ -2148,7 +2183,6 @@ GLIBC_2.8 qsort_r F
GLIBC_2.8 timerfd_create F
GLIBC_2.8 timerfd_gettime F
GLIBC_2.8 timerfd_settime F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 dup3 F
GLIBC_2.9 epoll_create1 F
GLIBC_2.9 inotify_init1 F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libcrypt.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libcrypt.abilist
index df20c0f259..ae5c7af6c3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 crypt F
GLIBC_2.2.5 crypt_r F
GLIBC_2.2.5 encrypt F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libdl.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libdl.abilist
index ca3d1f7936..c5cd25d424 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libdl.abilist
@@ -1,12 +1,9 @@
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 dladdr F
GLIBC_2.2.5 dlclose F
GLIBC_2.2.5 dlerror F
GLIBC_2.2.5 dlopen F
GLIBC_2.2.5 dlsym F
GLIBC_2.2.5 dlvsym F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 dladdr1 F
GLIBC_2.3.3 dlinfo F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 dlmopen F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
index b911aff114..4a442c3989 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.15 GLIBC_2.15 A
GLIBC_2.15 __acos_finite F
GLIBC_2.15 __acosf_finite F
GLIBC_2.15 __acosh_finite F
@@ -80,11 +79,9 @@ GLIBC_2.15 __y1l_finite F
GLIBC_2.15 __yn_finite F
GLIBC_2.15 __ynf_finite F
GLIBC_2.15 __ynl_finite F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 _LIB_VERSION D 0x4
GLIBC_2.2.5 __clog10 F
GLIBC_2.2.5 __clog10f F
@@ -399,9 +396,673 @@ GLIBC_2.2.5 y1l F
GLIBC_2.2.5 yn F
GLIBC_2.2.5 ynf F
GLIBC_2.2.5 ynl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
-GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.26 __acosf128_finite F
+GLIBC_2.26 __acoshf128_finite F
+GLIBC_2.26 __asinf128_finite F
+GLIBC_2.26 __atan2f128_finite F
+GLIBC_2.26 __atanhf128_finite F
+GLIBC_2.26 __coshf128_finite F
+GLIBC_2.26 __exp10f128_finite F
+GLIBC_2.26 __exp2f128_finite F
+GLIBC_2.26 __expf128_finite F
+GLIBC_2.26 __finitef128 F
+GLIBC_2.26 __fmodf128_finite F
+GLIBC_2.26 __fpclassifyf128 F
+GLIBC_2.26 __gammaf128_r_finite F
+GLIBC_2.26 __hypotf128_finite F
+GLIBC_2.26 __iseqsigf128 F
+GLIBC_2.26 __isinff128 F
+GLIBC_2.26 __isnanf128 F
+GLIBC_2.26 __issignalingf128 F
+GLIBC_2.26 __j0f128_finite F
+GLIBC_2.26 __j1f128_finite F
+GLIBC_2.26 __jnf128_finite F
+GLIBC_2.26 __lgammaf128_r_finite F
+GLIBC_2.26 __log10f128_finite F
+GLIBC_2.26 __log2f128_finite F
+GLIBC_2.26 __logf128_finite F
+GLIBC_2.26 __powf128_finite F
+GLIBC_2.26 __remainderf128_finite F
+GLIBC_2.26 __signbitf128 F
+GLIBC_2.26 __sinhf128_finite F
+GLIBC_2.26 __sqrtf128_finite F
+GLIBC_2.26 __y0f128_finite F
+GLIBC_2.26 __y1f128_finite F
+GLIBC_2.26 __ynf128_finite F
+GLIBC_2.26 acosf128 F
+GLIBC_2.26 acoshf128 F
+GLIBC_2.26 asinf128 F
+GLIBC_2.26 asinhf128 F
+GLIBC_2.26 atan2f128 F
+GLIBC_2.26 atanf128 F
+GLIBC_2.26 atanhf128 F
+GLIBC_2.26 cabsf128 F
+GLIBC_2.26 cacosf128 F
+GLIBC_2.26 cacoshf128 F
+GLIBC_2.26 canonicalizef128 F
+GLIBC_2.26 cargf128 F
+GLIBC_2.26 casinf128 F
+GLIBC_2.26 casinhf128 F
+GLIBC_2.26 catanf128 F
+GLIBC_2.26 catanhf128 F
+GLIBC_2.26 cbrtf128 F
+GLIBC_2.26 ccosf128 F
+GLIBC_2.26 ccoshf128 F
+GLIBC_2.26 ceilf128 F
+GLIBC_2.26 cexpf128 F
+GLIBC_2.26 cimagf128 F
+GLIBC_2.26 clog10f128 F
+GLIBC_2.26 clogf128 F
+GLIBC_2.26 conjf128 F
+GLIBC_2.26 copysignf128 F
+GLIBC_2.26 cosf128 F
+GLIBC_2.26 coshf128 F
+GLIBC_2.26 cpowf128 F
+GLIBC_2.26 cprojf128 F
+GLIBC_2.26 crealf128 F
+GLIBC_2.26 csinf128 F
+GLIBC_2.26 csinhf128 F
+GLIBC_2.26 csqrtf128 F
+GLIBC_2.26 ctanf128 F
+GLIBC_2.26 ctanhf128 F
+GLIBC_2.26 erfcf128 F
+GLIBC_2.26 erff128 F
+GLIBC_2.26 exp10f128 F
+GLIBC_2.26 exp2f128 F
+GLIBC_2.26 expf128 F
+GLIBC_2.26 expm1f128 F
+GLIBC_2.26 fabsf128 F
+GLIBC_2.26 fdimf128 F
+GLIBC_2.26 floorf128 F
+GLIBC_2.26 fmaf128 F
+GLIBC_2.26 fmaxf128 F
+GLIBC_2.26 fmaxmagf128 F
+GLIBC_2.26 fminf128 F
+GLIBC_2.26 fminmagf128 F
+GLIBC_2.26 fmodf128 F
+GLIBC_2.26 frexpf128 F
+GLIBC_2.26 fromfpf128 F
+GLIBC_2.26 fromfpxf128 F
+GLIBC_2.26 getpayloadf128 F
+GLIBC_2.26 hypotf128 F
+GLIBC_2.26 ilogbf128 F
+GLIBC_2.26 j0f128 F
+GLIBC_2.26 j1f128 F
+GLIBC_2.26 jnf128 F
+GLIBC_2.26 ldexpf128 F
+GLIBC_2.26 lgammaf128 F
+GLIBC_2.26 lgammaf128_r F
+GLIBC_2.26 llogbf128 F
+GLIBC_2.26 llrintf128 F
+GLIBC_2.26 llroundf128 F
+GLIBC_2.26 log10f128 F
+GLIBC_2.26 log1pf128 F
+GLIBC_2.26 log2f128 F
+GLIBC_2.26 logbf128 F
+GLIBC_2.26 logf128 F
+GLIBC_2.26 lrintf128 F
+GLIBC_2.26 lroundf128 F
+GLIBC_2.26 modff128 F
+GLIBC_2.26 nanf128 F
+GLIBC_2.26 nearbyintf128 F
+GLIBC_2.26 nextafterf128 F
+GLIBC_2.26 nextdownf128 F
+GLIBC_2.26 nextupf128 F
+GLIBC_2.26 powf128 F
+GLIBC_2.26 remainderf128 F
+GLIBC_2.26 remquof128 F
+GLIBC_2.26 rintf128 F
+GLIBC_2.26 roundevenf128 F
+GLIBC_2.26 roundf128 F
+GLIBC_2.26 scalblnf128 F
+GLIBC_2.26 scalbnf128 F
+GLIBC_2.26 setpayloadf128 F
+GLIBC_2.26 setpayloadsigf128 F
+GLIBC_2.26 sincosf128 F
+GLIBC_2.26 sinf128 F
+GLIBC_2.26 sinhf128 F
+GLIBC_2.26 sqrtf128 F
+GLIBC_2.26 tanf128 F
+GLIBC_2.26 tanhf128 F
+GLIBC_2.26 tgammaf128 F
+GLIBC_2.26 totalorderf128 F
+GLIBC_2.26 totalordermagf128 F
+GLIBC_2.26 truncf128 F
+GLIBC_2.26 ufromfpf128 F
+GLIBC_2.26 ufromfpxf128 F
+GLIBC_2.26 y0f128 F
+GLIBC_2.26 y1f128 F
+GLIBC_2.26 ynf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libnsl.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libnsl.abilist
index 571fe97d88..cac82ee6b3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 __free_fdresult F
GLIBC_2.2.5 __nis_default_access F
GLIBC_2.2.5 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
index 85365c057c..931c8277a8 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
@@ -1,15 +1,11 @@
-GLIBC_2.11 GLIBC_2.11 A
GLIBC_2.11 pthread_sigqueue F
-GLIBC_2.12 GLIBC_2.12 A
GLIBC_2.12 pthread_getname_np F
GLIBC_2.12 pthread_mutex_consistent F
GLIBC_2.12 pthread_mutexattr_getrobust F
GLIBC_2.12 pthread_mutexattr_setrobust F
GLIBC_2.12 pthread_setname_np F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 _IO_flockfile F
GLIBC_2.2.5 _IO_ftrylockfile F
GLIBC_2.2.5 _IO_funlockfile F
@@ -201,16 +197,34 @@ GLIBC_2.2.5 vfork F
GLIBC_2.2.5 wait F
GLIBC_2.2.5 waitpid F
GLIBC_2.2.5 write F
-GLIBC_2.2.6 GLIBC_2.2.6 A
GLIBC_2.2.6 __nanosleep F
-GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
GLIBC_2.3.2 pthread_cond_broadcast F
GLIBC_2.3.2 pthread_cond_destroy F
GLIBC_2.3.2 pthread_cond_init F
GLIBC_2.3.2 pthread_cond_signal F
GLIBC_2.3.2 pthread_cond_timedwait F
GLIBC_2.3.2 pthread_cond_wait F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 __pthread_cleanup_routine F
GLIBC_2.3.3 __pthread_register_cancel F
GLIBC_2.3.3 __pthread_register_cancel_defer F
@@ -226,13 +240,11 @@ GLIBC_2.3.3 pthread_getaffinity_np F
GLIBC_2.3.3 pthread_setaffinity_np F
GLIBC_2.3.3 pthread_timedjoin_np F
GLIBC_2.3.3 pthread_tryjoin_np F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
GLIBC_2.3.4 pthread_getaffinity_np F
GLIBC_2.3.4 pthread_setaffinity_np F
GLIBC_2.3.4 pthread_setschedprio F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 pthread_mutex_consistent_np F
GLIBC_2.4 pthread_mutex_getprioceiling F
GLIBC_2.4 pthread_mutex_setprioceiling F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libresolv.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libresolv.abilist
index a111ccc488..61d6b2b853 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 __b64_ntop F
GLIBC_2.2.5 __b64_pton F
GLIBC_2.2.5 __dn_comp F
@@ -63,9 +62,7 @@ GLIBC_2.2.5 res_gethostbyname F
GLIBC_2.2.5 res_gethostbyname2 F
GLIBC_2.2.5 res_send_setqhook F
GLIBC_2.2.5 res_send_setrhook F
-GLIBC_2.3.2 GLIBC_2.3.2 A
GLIBC_2.3.2 __p_rcode F
-GLIBC_2.9 GLIBC_2.9 A
GLIBC_2.9 ns_datetosecs F
GLIBC_2.9 ns_format_ttl F
GLIBC_2.9 ns_get16 F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist b/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
index d626758434..e2e8b60bf8 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 aio_cancel F
GLIBC_2.2.5 aio_cancel64 F
GLIBC_2.2.5 aio_error F
@@ -28,13 +27,11 @@ GLIBC_2.2.5 timer_delete F
GLIBC_2.2.5 timer_getoverrun F
GLIBC_2.2.5 timer_gettime F
GLIBC_2.2.5 timer_settime F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 timer_create F
GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
-GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
@@ -45,8 +42,6 @@ GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 mq_timedreceive F
GLIBC_2.3.4 mq_timedsend F
GLIBC_2.3.4 mq_unlink F
-GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 lio_listio F
GLIBC_2.4 lio_listio64 F
-GLIBC_2.7 GLIBC_2.7 A
GLIBC_2.7 __mq_open_2 F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libthread_db.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libthread_db.abilist
index 291a19132d..0a9b5d2537 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 td_init F
GLIBC_2.2.5 td_log F
GLIBC_2.2.5 td_symbol_list F
@@ -37,7 +36,5 @@ GLIBC_2.2.5 td_thr_setxregs F
GLIBC_2.2.5 td_thr_sigsetmask F
GLIBC_2.2.5 td_thr_tsd F
GLIBC_2.2.5 td_thr_validate F
-GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 td_thr_tls_get_addr F
-GLIBC_2.3.3 GLIBC_2.3.3 A
GLIBC_2.3.3 td_thr_tlsbase F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist
index 98d06aa9f6..1356ed4115 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.2.5 GLIBC_2.2.5 A
GLIBC_2.2.5 forkpty F
GLIBC_2.2.5 login F
GLIBC_2.2.5 login_tty F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/mmap.c b/sysdeps/unix/sysv/linux/x86_64/64/mmap.c
deleted file mode 100644
index 0115065c3a..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/64/mmap.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Linux mmap system call. x86-64 version.
- Copyright (C) 2015-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 <ldsodefs.h>
-
-/* If the Prefer_MAP_32BIT_EXEC bit is set, try to map executable pages
- with MAP_32BIT first. */
-#define MMAP_PREPARE(addr, len, prot, flags, fd, offset) \
- if ((addr) == NULL \
- && ((prot) & PROT_EXEC) != 0 \
- && HAS_ARCH_FEATURE (Prefer_MAP_32BIT_EXEC)) \
- { \
- __ptr_t ret = (__ptr_t) INLINE_SYSCALL (mmap, 6, (addr), (len), \
- (prot), \
- (flags) | MAP_32BIT, \
- (fd), (offset)); \
- if (ret != MAP_FAILED) \
- return ret; \
- }
-
-#include <sysdeps/unix/sysv/linux/wordsize-64/mmap.c>
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/mmap_internal.h b/sysdeps/unix/sysv/linux/x86_64/64/mmap_internal.h
new file mode 100644
index 0000000000..cab9494559
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/64/mmap_internal.h
@@ -0,0 +1,42 @@
+/* Linux mmap system call. x86-64 version.
+ Copyright (C) 2015-2018 Free Software 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 MMAP_X86_64_INTERNAL_H
+#define MMAP_X86_64_INTERNAL_H
+
+#include <ldsodefs.h>
+
+/* If the Prefer_MAP_32BIT_EXEC bit is set, try to map executable pages
+ with MAP_32BIT first. */
+#define MMAP_PREPARE(addr, len, prot, flags, fd, offset) \
+ if ((addr) == NULL \
+ && ((prot) & PROT_EXEC) != 0 \
+ && HAS_ARCH_FEATURE (Prefer_MAP_32BIT_EXEC)) \
+ { \
+ void *ret = (void*) INLINE_SYSCALL_CALL (mmap, (addr), (len), \
+ (prot), \
+ (flags) | MAP_32BIT, \
+ (fd), (offset)); \
+ if (ret != MAP_FAILED) \
+ return ret; \
+ }
+
+#include_next <mmap_internal.h>
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
index fca9dc08e2..5d2d275721 100644
--- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,8 +19,13 @@
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
#include <stap-probe.h>
-
#include <sigaltstack-offsets.h>
+#include <jmp_buf-ssp.h>
+
+/* Don't restore shadow stack register if shadow stack isn't enabled. */
+#if !SHSTK_ENABLED
+# undef SHADOW_STACK_POINTER_OFFSET
+#endif
.section .rodata.str1.1,"aMS",@progbits,1
.type longjmp_msg,@object
@@ -105,6 +110,38 @@ ENTRY(____longjmp_chk)
cfi_restore (%rsi)
.Lok:
+#ifdef SHADOW_STACK_POINTER_OFFSET
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+ /* Check if Shadow Stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %fs:FEATURE_1_OFFSET
+ jz L(skip_ssp)
+# else
+ xorl %eax, %eax
+# endif
+ /* Check and adjust the Shadow-Stack-Pointer. */
+ rdsspq %rax
+ /* And compare it with the saved ssp value. */
+ subq SHADOW_STACK_POINTER_OFFSET(%rdi), %rax
+ je L(skip_ssp)
+ /* Count the number of frames to adjust and adjust it
+ with incssp instruction. The instruction can adjust
+ the ssp by [0..255] value only thus use a loop if
+ the number of frames is bigger than 255. */
+ negq %rax
+ shrq $3, %rax
+ /* NB: We saved Shadow-Stack-Pointer of setjmp. Since we are
+ restoring Shadow-Stack-Pointer of setjmp's caller, we
+ need to unwind shadow stack by one more frame. */
+ addq $1, %rax
+ movl $255, %ebx
+L(loop):
+ cmpq %rbx, %rax
+ cmovb %rax, %rbx
+ incsspq %rbx
+ subq %rbx, %rax
+ ja L(loop)
+L(skip_ssp):
+#endif
LIBC_PROBE (longjmp, 3, LP_SIZE@%RDI_LP, -4@%esi, LP_SIZE@%RDX_LP)
/* We add unwind information for the target here. */
cfi_def_cfa(%rdi, 0)
diff --git a/sysdeps/unix/sysv/linux/x86_64/__start_context.S b/sysdeps/unix/sysv/linux/x86_64/__start_context.S
index 408d30d53d..87de0e5996 100644
--- a/sysdeps/unix/sysv/linux/x86_64/__start_context.S
+++ b/sysdeps/unix/sysv/linux/x86_64/__start_context.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -18,6 +18,80 @@
#include <sysdep.h>
+#if SHSTK_ENABLED
+# include <asm/prctl.h>
+# include "ucontext_i.h"
+
+/* Use CALL to push __start_context onto the new stack as well as the new
+ shadow stack. RDI points to ucontext:
+ Incoming:
+ __ssp[0]: The original caller's shadow stack pointer.
+ __ssp[1]: The size of the new shadow stack.
+ __ssp[2]: The size of the new shadow stack.
+ Outgoing:
+ __ssp[0]: The new shadow stack pointer.
+ __ssp[1]: The base address of the new shadow stack.
+ __ssp[2]: The size of the new shadow stack.
+ */
+
+ENTRY(__push___start_context)
+ /* Save the pointer to ucontext. */
+ movq %rdi, %r9
+ /* Get the original shadow stack pointer. */
+ rdsspq %r8
+ /* Save the original stack pointer. */
+ movq %rsp, %rdx
+ /* Load the top of the new stack into RSI. */
+ movq oRSP(%rdi), %rsi
+ /* Add 8 bytes to RSI since CALL will push the 8-byte return
+ address onto stack. */
+ leaq 8(%rsi), %rsp
+ /* Allocate the new shadow stack. The size of the new shadow
+ stack is passed in __ssp[1]. */
+ lea (oSSP + 8)(%rdi), %RSI_LP
+ movl $ARCH_CET_ALLOC_SHSTK, %edi
+ movl $__NR_arch_prctl, %eax
+ /* The new shadow stack base is returned in __ssp[1]. */
+ syscall
+ testq %rax, %rax
+ jne L(hlt) /* This should never happen. */
+
+ /* Get the size of the new shadow stack. */
+ movq 8(%rsi), %rdi
+
+ /* Get the base address of the new shadow stack. */
+ movq (%rsi), %rsi
+
+ /* Use the restore stoken to restore the new shadow stack. */
+ rstorssp -8(%rsi, %rdi)
+
+ /* Save the restore token on the original shadow stack. */
+ saveprevssp
+
+ /* Push the address of "jmp __start_context" onto the new stack
+ as well as the new shadow stack. */
+ call 1f
+ jmp __start_context
+1:
+
+ /* Get the new shadow stack pointer. */
+ rdsspq %rdi
+
+ /* Use the restore stoken to restore the original shadow stack. */
+ rstorssp -8(%r8)
+
+ /* Save the restore token on the new shadow stack. */
+ saveprevssp
+
+ /* Store the new shadow stack pointer in __ssp[0]. */
+ movq %rdi, oSSP(%r9)
+
+ /* Restore the original stack. */
+ mov %rdx, %rsp
+ ret
+END(__push___start_context)
+#endif
+
/* This is the helper code which gets called if a function which is
registered with 'makecontext' returns. In this case we have to
install the context listed in the uc_link element of the context
@@ -36,7 +110,7 @@ ENTRY(__start_context)
testq %rdi, %rdi
je 2f /* If it is zero exit. */
- call JUMPTARGET(__setcontext)
+ call __setcontext
/* If this returns (which can happen if the syscall fails) we'll
exit the program with the return error value (-1). */
movq %rax,%rdi
@@ -45,5 +119,6 @@ ENTRY(__start_context)
call HIDDEN_JUMPTARGET(exit)
/* The 'exit' call should never return. In case it does cause
the process to terminate. */
+L(hlt):
hlt
END(__start_context)
diff --git a/sysdeps/unix/sysv/linux/x86_64/arch-fork.h b/sysdeps/unix/sysv/linux/x86_64/arch-fork.h
deleted file mode 100644
index 159bfece99..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/arch-fork.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Internal definitions for thread-friendly fork implementation. Linux/x86_64.
- 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.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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 <sched.h>
-#include <sysdep.h>
-#include <tls.h>
-
-#define ARCH_FORK() \
- INLINE_SYSCALL (clone, 4, \
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \
- NULL, &THREAD_SELF->tid)
diff --git a/sysdeps/unix/sysv/linux/x86_64/brk.c b/sysdeps/unix/sysv/linux/x86_64/brk.c
index ab1b1765d0..aa1e151c5b 100644
--- a/sysdeps/unix/sysv/linux/x86_64/brk.c
+++ b/sysdeps/unix/sysv/linux/x86_64/brk.c
@@ -1,5 +1,5 @@
/* brk system call for Linux/x86_64.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/sysdeps/unix/sysv/linux/x86_64/cancellation.S
index 687057dba3..53dbabd6d2 100644
--- a/sysdeps/unix/sysv/linux/x86_64/cancellation.S
+++ b/sysdeps/unix/sysv/linux/x86_64/cancellation.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
@@ -21,9 +21,11 @@
#include <kernel-features.h>
#include "lowlevellock.h"
+#define PTHREAD_UNWIND JUMPTARGET(__pthread_unwind)
#if IS_IN (libpthread)
# if defined SHARED && !defined NO_HIDDEN
-# define __pthread_unwind __GI___pthread_unwind
+# undef PTHREAD_UNWIND
+# define PTHREAD_UNWIND __GI___pthread_unwind
# endif
#else
# ifndef SHARED
@@ -32,19 +34,8 @@
#endif
-#ifdef __ASSUME_PRIVATE_FUTEX
-# define LOAD_PRIVATE_FUTEX_WAIT(reg) \
+#define LOAD_PRIVATE_FUTEX_WAIT(reg) \
movl $(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
-#else
-# if FUTEX_WAIT == 0
-# define LOAD_PRIVATE_FUTEX_WAIT(reg) \
- movl %fs:PRIVATE_FUTEX, reg
-# else
-# define LOAD_PRIVATE_FUTEX_WAIT(reg) \
- movl %fs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAIT, reg
-# endif
-#endif
/* It is crucial that the functions in this file don't modify registers
other than %rax and %r11. The syscall wrapper code depends on this
@@ -76,11 +67,7 @@ ENTRY(__pthread_enable_asynccancel)
lock
orl $TCB_EXITING_BITMASK, %fs:CANCELHANDLING
mov %fs:CLEANUP_JMP_BUF, %RDI_LP
-#ifdef SHARED
- call __pthread_unwind@PLT
-#else
- call __pthread_unwind
-#endif
+ call PTHREAD_UNWIND
hlt
END(__pthread_enable_asynccancel)
diff --git a/sysdeps/unix/sysv/linux/x86_64/clone.S b/sysdeps/unix/sysv/linux/x86_64/clone.S
index 382568a3e9..34bebe0c00 100644
--- a/sysdeps/unix/sysv/linux/x86_64/clone.S
+++ b/sysdeps/unix/sysv/linux/x86_64/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,9 +23,6 @@
#include <bits/errno.h>
#include <asm-syntax.h>
-#define CLONE_VM 0x00000100
-#define CLONE_THREAD 0x00010000
-
/* The userland implementation is:
int clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg),
the kernel entry is:
@@ -92,27 +89,18 @@ L(thread_start):
the outermost frame obviously. */
xorl %ebp, %ebp
- testq $CLONE_THREAD, %rdi
- jne 1f
- testq $CLONE_VM, %rdi
- movl $-1, %eax
- jne 2f
- movl $SYS_ify(getpid), %eax
- syscall
-2: movl %eax, %fs:PID
- movl %eax, %fs:TID
-1:
-
/* Set up arguments for the function call. */
popq %rax /* Function to call. */
popq %rdi /* Argument. */
call *%rax
/* Call exit with return value from function call. */
movq %rax, %rdi
- call HIDDEN_JUMPTARGET (_exit)
+ movl $SYS_ify(exit), %eax
+ syscall
cfi_endproc;
cfi_startproc;
PSEUDO_END (__clone)
+libc_hidden_def (__clone)
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/x86_64/compat-timer.h b/sysdeps/unix/sysv/linux/x86_64/compat-timer.h
index 17c5339e88..ba4f0b39da 100644
--- a/sysdeps/unix/sysv/linux/x86_64/compat-timer.h
+++ b/sysdeps/unix/sysv/linux/x86_64/compat-timer.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/x86_64/dl-cache.h b/sysdeps/unix/sysv/linux/x86_64/dl-cache.h
index 01a20cb5c1..c3c138b7c4 100644
--- a/sysdeps/unix/sysv/linux/x86_64/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/x86_64/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h b/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h
index 7829e1cd67..7b45fe4bf8 100644
--- a/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h
@@ -1,5 +1,5 @@
#if IS_IN (ldconfig)
# include <sysdeps/unix/sysv/linux/i386/dl-procinfo.h>
#else
-# include <sysdeps/generic/dl-procinfo.h>
+# include <sysdeps/x86/dl-procinfo.h>
#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/getcontext.S b/sysdeps/unix/sysv/linux/x86_64/getcontext.S
index 79bdc018ec..84b986ca98 100644
--- a/sysdeps/unix/sysv/linux/x86_64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/x86_64/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <asm/prctl.h>
#include "ucontext_i.h"
@@ -53,6 +54,55 @@ ENTRY(__getcontext)
leaq 8(%rsp), %rcx /* Exclude the return address. */
movq %rcx, oRSP(%rdi)
+#if SHSTK_ENABLED
+ /* Check if shadow stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %fs:FEATURE_1_OFFSET
+ jz L(no_shstk)
+
+ /* Save RDI in RDX which won't be clobbered by syscall. */
+ movq %rdi, %rdx
+
+ xorl %eax, %eax
+ cmpq %fs:SSP_BASE_OFFSET, %rax
+ jnz L(shadow_stack_bound_recorded)
+
+ /* Get the base address and size of the default shadow stack
+ which must be the current shadow stack since nothing has
+ been recorded yet. */
+ sub $24, %RSP_LP
+ mov %RSP_LP, %RSI_LP
+ movl $ARCH_CET_STATUS, %edi
+ movl $__NR_arch_prctl, %eax
+ syscall
+ testq %rax, %rax
+ jz L(continue_no_err)
+
+ /* This should never happen. */
+ hlt
+
+L(continue_no_err):
+ /* Record the base of the current shadow stack. */
+ movq 8(%rsp), %rax
+ movq %rax, %fs:SSP_BASE_OFFSET
+ add $24, %RSP_LP
+
+ /* Restore RDI. */
+ movq %rdx, %rdi
+
+L(shadow_stack_bound_recorded):
+ /* Get the current shadow stack pointer. */
+ rdsspq %rax
+ /* NB: Save the caller's shadow stack so that we can jump back
+ to the caller directly. */
+ addq $8, %rax
+ movq %rax, oSSP(%rdx)
+
+ /* Save the current shadow stack base in ucontext. */
+ movq %fs:SSP_BASE_OFFSET, %rax
+ movq %rax, (oSSP + 8)(%rdi)
+
+L(no_shstk):
+#endif
/* We have separate floating-point register content memory on the
stack. We use the __fpregs_mem block in the context. Set the
links up correctly. */
diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index 6d69fd836c..2320505804 100644
--- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. Linux/x86-64.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,7 @@ long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
attribute_hidden;
-extern long int __syscall_clock_gettime (clockid_t, struct timespec *);
+extern __typeof (clock_gettime) __syscall_clock_gettime attribute_hidden;
static inline void
diff --git a/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h b/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h
new file mode 100644
index 0000000000..945028920c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h
@@ -0,0 +1,32 @@
+/* Old SysV permission definition for Linux. x86_64 version.
+ Copyright (C) 2016-2018 Free Software 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/ipc.h> /* For __key_t */
+
+#define __IPC_64 0x0
+
+struct __old_ipc_perm
+{
+ __key_t __key; /* Key. */
+ unsigned short uid; /* Owner's user ID. */
+ unsigned short gid; /* Owner's group ID. */
+ unsigned short cuid; /* Creator's user ID. */
+ unsigned short cgid; /* Creator's group ID. */
+ unsigned short mode; /* Read/write permission. */
+ unsigned short int __seq; /* Sequence number. */
+};
diff --git a/sysdeps/unix/sysv/linux/x86_64/kernel-features.h b/sysdeps/unix/sysv/linux/x86_64/kernel-features.h
index 0b84f113af..a6a1202e69 100644
--- a/sysdeps/unix/sysv/linux/x86_64/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/x86_64/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number. x86-64 version.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software 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,22 +17,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* The accept4 syscall was added for x86-64 in 2.6.28. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-
-/* The recvmmsg syscall was added for x86-64 in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
-
-/* The sendmmsg syscall was added for x86-64 in 3.0. */
-#if __LINUX_KERNEL_VERSION >= 0x030000
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
-
-/* getcpu is a syscall for x86-64 since 3.1. */
-#if __LINUX_KERNEL_VERSION >= 0x030100
-# define __ASSUME_GETCPU_SYSCALL 1
+/* Define that x32 is a ILP32 ABI to set the correct interface to pass
+ 64-bits values through syscalls. */
+#ifdef __ILP32__
+# define __ASSUME_WORDSIZE64_ILP32 1
#endif
#include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/x86_64/kernel_stat.h b/sysdeps/unix/sysv/linux/x86_64/kernel_stat.h
index 2f6fbb22dd..98adda41fc 100644
--- a/sysdeps/unix/sysv/linux/x86_64/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/x86_64/kernel_stat.h
@@ -1,5 +1,5 @@
/* Definition of `struct stat' used in the kernel.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,3 +18,4 @@
#define STAT_IS_KERNEL_STAT 1
#define XSTAT_IS_XSTAT64 1
+#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
index d2ba5bdafe..c7e9ad674d 100644
--- a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S b/sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S
index 731ab7758b..ed7af0db3c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S
+++ b/sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
diff --git a/sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S b/sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S
index 575d064f1f..a1ddaaf77a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/unix/sysv/linux/x86_64/libmvec.abilist b/sysdeps/unix/sysv/linux/x86_64/libmvec.abilist
index 80d028a61c..363d4ace1e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/libmvec.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/libmvec.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 _ZGVbN2v_cos F
GLIBC_2.22 _ZGVbN2v_exp F
GLIBC_2.22 _ZGVbN2v_log F
diff --git a/sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S b/sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S
index d0b3c7c3df..d0f0ee441b 100644
--- a/sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S
+++ b/sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index 4f9483e0be..71dd740202 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -25,48 +25,16 @@
.text
-#ifdef __ASSUME_PRIVATE_FUTEX
-# define LOAD_PRIVATE_FUTEX_WAIT(reg) \
+#define LOAD_PRIVATE_FUTEX_WAIT(reg) \
movl $(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
-# define LOAD_PRIVATE_FUTEX_WAKE(reg) \
+#define LOAD_PRIVATE_FUTEX_WAKE(reg) \
movl $(FUTEX_WAKE | FUTEX_PRIVATE_FLAG), reg
-# define LOAD_FUTEX_WAIT(reg) \
+#define LOAD_FUTEX_WAIT(reg) \
xorl $(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
-# define LOAD_FUTEX_WAIT_ABS(reg) \
+#define LOAD_FUTEX_WAIT_ABS(reg) \
xorl $(FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME), reg
-# define LOAD_FUTEX_WAKE(reg) \
+#define LOAD_FUTEX_WAKE(reg) \
xorl $(FUTEX_WAKE | FUTEX_PRIVATE_FLAG), reg
-#else
-# if FUTEX_WAIT == 0
-# define LOAD_PRIVATE_FUTEX_WAIT(reg) \
- movl %fs:PRIVATE_FUTEX, reg
-# else
-# define LOAD_PRIVATE_FUTEX_WAIT(reg) \
- movl %fs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAIT, reg
-# endif
-# define LOAD_PRIVATE_FUTEX_WAKE(reg) \
- movl %fs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAKE, reg
-# if FUTEX_WAIT == 0
-# define LOAD_FUTEX_WAIT(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %fs:PRIVATE_FUTEX, reg
-# else
-# define LOAD_FUTEX_WAIT(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %fs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAIT, reg
-# endif
-# define LOAD_FUTEX_WAIT_ABS(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %fs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, reg
-# define LOAD_FUTEX_WAKE(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %fs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAKE, reg
-#endif
.globl __lll_lock_wait_private
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index de753fd4de..eedb6fc990 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -26,7 +26,6 @@
# include <sys/param.h>
# include <bits/pthreadtypes.h>
# include <kernel-features.h>
-# include <tcb-offsets.h>
# ifndef LOCK_INSTR
# ifdef UP
@@ -136,23 +135,6 @@
: "cx", "r11", "cc", "memory"); \
}) \
-#define lll_robust_lock(futex, id, private) \
- ({ int result, ignore1, ignore2; \
- __asm __volatile (LOCK_INSTR "cmpxchgl %4, %2\n\t" \
- "jz 24f\n" \
- "1:\tlea %2, %%" RDI_LP "\n" \
- "2:\tsub $128, %%" RSP_LP "\n" \
- ".cfi_adjust_cfa_offset 128\n" \
- "3:\tcallq __lll_robust_lock_wait\n" \
- "4:\tadd $128, %%" RSP_LP "\n" \
- ".cfi_adjust_cfa_offset -128\n" \
- "24:" \
- : "=S" (ignore1), "=D" (ignore2), "=m" (futex), \
- "=a" (result) \
- : "1" (id), "m" (futex), "3" (0), "0" (private) \
- : "cx", "r11", "cc", "memory"); \
- result; })
-
#define lll_cond_lock(futex, private) \
(void) \
({ int ignore1, ignore2, ignore3; \
@@ -171,24 +153,6 @@
: "cx", "r11", "cc", "memory"); \
})
-#define lll_robust_cond_lock(futex, id, private) \
- ({ int result, ignore1, ignore2; \
- __asm __volatile (LOCK_INSTR "cmpxchgl %4, %2\n\t" \
- "jz 24f\n" \
- "1:\tlea %2, %%" RDI_LP "\n" \
- "2:\tsub $128, %%" RSP_LP "\n" \
- ".cfi_adjust_cfa_offset 128\n" \
- "3:\tcallq __lll_robust_lock_wait\n" \
- "4:\tadd $128, %%" RSP_LP "\n" \
- ".cfi_adjust_cfa_offset -128\n" \
- "24:" \
- : "=S" (ignore1), "=D" (ignore2), "=m" (futex), \
- "=a" (result) \
- : "1" (id | FUTEX_WAITERS), "m" (futex), "3" (0), \
- "0" (private) \
- : "cx", "r11", "cc", "memory"); \
- result; })
-
#define lll_timedlock(futex, timeout, private) \
({ int result, ignore1, ignore2, ignore3; \
__asm __volatile (LOCK_INSTR "cmpxchgl %1, %4\n\t" \
@@ -215,25 +179,6 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
#define lll_timedlock_elision(futex, adapt_count, timeout, private) \
__lll_timedlock_elision(&(futex), &(adapt_count), timeout, private)
-#define lll_robust_timedlock(futex, timeout, id, private) \
- ({ int result, ignore1, ignore2, ignore3; \
- __asm __volatile (LOCK_INSTR "cmpxchgl %1, %4\n\t" \
- "jz 24f\n\t" \
- "1:\tlea %4, %%" RDI_LP "\n" \
- "0:\tmov %8, %%" RDX_LP "\n" \
- "2:\tsub $128, %%" RSP_LP "\n" \
- ".cfi_adjust_cfa_offset 128\n" \
- "3:\tcallq __lll_robust_timedlock_wait\n" \
- "4:\tadd $128, %%" RSP_LP "\n" \
- ".cfi_adjust_cfa_offset -128\n" \
- "24:" \
- : "=a" (result), "=D" (ignore1), "=S" (ignore2), \
- "=&d" (ignore3), "=m" (futex) \
- : "0" (0), "1" (id), "m" (futex), "m" (timeout), \
- "2" (private) \
- : "memory", "cx", "cc", "r10", "r11"); \
- result; })
-
#if !IS_IN (libc) || defined UP
# define __lll_unlock_asm_start LOCK_INSTR "decl %0\n\t" \
"je 24f\n\t"
@@ -276,26 +221,6 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
: "ax", "cx", "r11", "cc", "memory"); \
})
-#define lll_robust_unlock(futex, private) \
- do \
- { \
- int ignore; \
- __asm __volatile (LOCK_INSTR "andl %2, %0\n\t" \
- "je 24f\n\t" \
- "1:\tlea %0, %%" RDI_LP "\n" \
- "2:\tsub $128, %%" RSP_LP "\n" \
- ".cfi_adjust_cfa_offset 128\n" \
- "3:\tcallq __lll_unlock_wake\n" \
- "4:\tadd $128, %%" RSP_LP "\n" \
- ".cfi_adjust_cfa_offset -128\n" \
- "24:" \
- : "=m" (futex), "=&D" (ignore) \
- : "i" (FUTEX_WAITERS), "m" (futex), \
- "S" (private) \
- : "ax", "cx", "r11", "cc", "memory"); \
- } \
- while (0)
-
#define lll_islocked(futex) \
(futex != LLL_LOCK_INITIALIZER)
@@ -323,12 +248,7 @@ extern int __lll_timedwait_tid (int *, const struct timespec *)
({ \
int __result = 0; \
if ((tid) != 0) \
- { \
- if ((abstime)->tv_nsec < 0 || (abstime)->tv_nsec >= 1000000000) \
- __result = EINVAL; \
- else \
- __result = __lll_timedwait_tid (&(tid), (abstime)); \
- } \
+ __result = __lll_timedwait_tid (&(tid), (abstime)); \
__result; })
extern int __lll_lock_elision (int *futex, short *adapt_count, int private)
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
deleted file mode 100644
index b08d8992fd..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
+++ /dev/null
@@ -1,306 +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 <sysdep.h>
-#include <pthread-errnos.h>
-#include <lowlevellock.h>
-#include <lowlevelrobustlock.h>
-#include <kernel-features.h>
-
- .text
-
-#define FUTEX_WAITERS 0x80000000
-#define FUTEX_OWNER_DIED 0x40000000
-
-#ifdef __ASSUME_PRIVATE_FUTEX
-# define LOAD_FUTEX_WAIT(reg) \
- xorl $(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
-# define LOAD_FUTEX_WAIT_ABS(reg) \
- xorl $(FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME), reg
-#else
-# if FUTEX_WAIT == 0
-# define LOAD_FUTEX_WAIT(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %fs:PRIVATE_FUTEX, reg
-# else
-# define LOAD_FUTEX_WAIT(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %fs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAIT, reg
-# endif
-# define LOAD_FUTEX_WAIT_ABS(reg) \
- xorl $FUTEX_PRIVATE_FLAG, reg ; \
- andl %fs:PRIVATE_FUTEX, reg ; \
- orl $FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, reg
-#endif
-
-
- .globl __lll_robust_lock_wait
- .type __lll_robust_lock_wait,@function
- .hidden __lll_robust_lock_wait
- .align 16
-__lll_robust_lock_wait:
- cfi_startproc
- pushq %r10
- cfi_adjust_cfa_offset(8)
- pushq %rdx
- cfi_adjust_cfa_offset(8)
- cfi_offset(%r10, -16)
- cfi_offset(%rdx, -24)
-
- xorq %r10, %r10 /* No timeout. */
- LOAD_FUTEX_WAIT (%esi)
-
-4: movl %eax, %edx
- orl $FUTEX_WAITERS, %edx
-
- testl $FUTEX_OWNER_DIED, %eax
- jnz 3f
-
- cmpl %edx, %eax
- je 1f
-
- LOCK
- cmpxchgl %edx, (%rdi)
- jnz 2f
-
-1: movl $SYS_futex, %eax
- syscall
-
- movl (%rdi), %eax
-
-2: testl %eax, %eax
- jne 4b
-
- movl %fs:TID, %edx
- orl $FUTEX_WAITERS, %edx
- LOCK
- cmpxchgl %edx, (%rdi)
- jnz 4b
- /* NB: %rax == 0 */
-
-3: popq %rdx
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%rdx)
- popq %r10
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r10)
- retq
- cfi_endproc
- .size __lll_robust_lock_wait,.-__lll_robust_lock_wait
-
-
- .globl __lll_robust_timedlock_wait
- .type __lll_robust_timedlock_wait,@function
- .hidden __lll_robust_timedlock_wait
- .align 16
-__lll_robust_timedlock_wait:
- cfi_startproc
-# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
-# ifdef PIC
- cmpl $0, __have_futex_clock_realtime(%rip)
-# else
- cmpl $0, __have_futex_clock_realtime
-# endif
- je .Lreltmo
-# endif
-
- cmpq $0, (%rdx)
- js 7f
-
- pushq %r9
- cfi_adjust_cfa_offset(8)
- cfi_rel_offset(%r9, 0)
- movq %rdx, %r10
- movl $0xffffffff, %r9d
- LOAD_FUTEX_WAIT_ABS (%esi)
-
-1: testl $FUTEX_OWNER_DIED, %eax
- jnz 3f
-
- movl %eax, %edx
- orl $FUTEX_WAITERS, %edx
-
- cmpl %eax, %edx
- je 5f
-
- LOCK
- cmpxchgl %edx, (%rdi)
- movq $0, %rcx /* Must use mov to avoid changing cc. */
- jnz 6f
-
-5: movl $SYS_futex, %eax
- syscall
- movl %eax, %ecx
-
- movl (%rdi), %eax
-
-6: testl %eax, %eax
- jne 2f
-
- movl %fs:TID, %edx
- orl $FUTEX_WAITERS, %edx
- LOCK
- cmpxchgl %edx, (%rdi)
- jnz 2f
-
-3: popq %r9
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r9)
- retq
-
- cfi_adjust_cfa_offset(8)
- cfi_rel_offset(%r9, 0)
- /* Check whether the time expired. */
-2: cmpl $-ETIMEDOUT, %ecx
- je 4f
- cmpl $-EINVAL, %ecx
- jne 1b
-
-4: movl %ecx, %eax
- negl %eax
- jmp 3b
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r9)
-
-7: movl $ETIMEDOUT, %eax
- retq
-
-
-# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
-.Lreltmo:
- /* Check for a valid timeout value. */
- cmpq $1000000000, 8(%rdx)
- jae 3f
-
- pushq %r8
- cfi_adjust_cfa_offset(8)
- pushq %r9
- cfi_adjust_cfa_offset(8)
- pushq %r12
- cfi_adjust_cfa_offset(8)
- pushq %r13
- cfi_adjust_cfa_offset(8)
- cfi_offset(%r8, -16)
- cfi_offset(%r9, -24)
- cfi_offset(%r12, -32)
- cfi_offset(%r13, -40)
- pushq %rsi
- cfi_adjust_cfa_offset(8)
-
- /* Stack frame for the timespec and timeval structs. */
- subq $32, %rsp
- cfi_adjust_cfa_offset(32)
-
- movq %rdi, %r12
- movq %rdx, %r13
-
-1: movq %rax, 16(%rsp)
-
- /* Get current time. */
- movq %rsp, %rdi
- xorl %esi, %esi
- /* This call works because we directly jump to a system call entry
- which preserves all the registers. */
- call JUMPTARGET(__gettimeofday)
-
- /* Compute relative timeout. */
- movq 8(%rsp), %rax
- movl $1000, %edi
- mul %rdi /* Milli seconds to nano seconds. */
- movq (%r13), %rdi
- movq 8(%r13), %rsi
- subq (%rsp), %rdi
- subq %rax, %rsi
- jns 4f
- addq $1000000000, %rsi
- decq %rdi
-4: testq %rdi, %rdi
- js 8f /* Time is already up. */
-
- /* Futex call. */
- movq %rdi, (%rsp) /* Store relative timeout. */
- movq %rsi, 8(%rsp)
-
- movq 16(%rsp), %rdx
- movl %edx, %eax
- orl $FUTEX_WAITERS, %edx
-
- testl $FUTEX_OWNER_DIED, %eax
- jnz 6f
-
- cmpl %eax, %edx
- je 2f
-
- LOCK
- cmpxchgl %edx, (%r12)
- movq $0, %rcx /* Must use mov to avoid changing cc. */
- jnz 5f
-
-2: movq %rsp, %r10
- movl 32(%rsp), %esi
- LOAD_FUTEX_WAIT (%esi)
- movq %r12, %rdi
- movl $SYS_futex, %eax
- syscall
- movq %rax, %rcx
-
- movl (%r12), %eax
-
-5: testl %eax, %eax
- jne 7f
-
- movl %fs:TID, %edx
- orl $FUTEX_WAITERS, %edx
- LOCK
- cmpxchgl %edx, (%r12)
- jnz 7f
-
-6: addq $40, %rsp
- cfi_adjust_cfa_offset(-40)
- popq %r13
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r13)
- popq %r12
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r12)
- popq %r9
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r9)
- popq %r8
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r8)
- retq
-
-3: movl $EINVAL, %eax
- retq
-
- cfi_adjust_cfa_offset(72)
- cfi_offset(%r8, -16)
- cfi_offset(%r9, -24)
- cfi_offset(%r12, -32)
- cfi_offset(%r13, -40)
- /* Check whether the time expired. */
-7: cmpl $-ETIMEDOUT, %ecx
- jne 1b
-
-8: movl $ETIMEDOUT, %eax
- jmp 6b
-#endif
- cfi_endproc
- .size __lll_robust_timedlock_wait,.-__lll_robust_timedlock_wait
diff --git a/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
index f20a21d522..3eb4c59a5d 100644
--- a/sysdeps/unix/sysv/linux/x86_64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -21,6 +21,11 @@
#include <stdarg.h>
#include <stdint.h>
#include <ucontext.h>
+#if SHSTK_ENABLED
+# include <pthread.h>
+# include <libc-pointer-arith.h>
+# include <sys/prctl.h>
+#endif
#include "ucontext_i.h"
@@ -51,7 +56,9 @@
void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
- extern void __start_context (void);
+ extern void __start_context (void) attribute_hidden;
+ extern void __push___start_context (ucontext_t *)
+ attribute_hidden;
greg_t *sp;
unsigned int idx_uc_link;
va_list ap;
@@ -74,7 +81,36 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
ucp->uc_mcontext.gregs[REG_RSP] = (uintptr_t) sp;
/* Setup stack. */
- sp[0] = (uintptr_t) &__start_context;
+#if SHSTK_ENABLED
+ struct pthread *self = THREAD_SELF;
+ unsigned int feature_1 = THREAD_GETMEM (self, header.feature_1);
+ /* NB: We must check feature_1 before accessing __ssp since caller
+ may be compiled against ucontext_t without __ssp. */
+ if ((feature_1 & X86_FEATURE_1_SHSTK) != 0)
+ {
+ /* Shadow stack is enabled. We need to allocate a new shadow
+ stack. */
+ unsigned long ssp_size = (((uintptr_t) sp
+ - (uintptr_t) ucp->uc_stack.ss_sp)
+ >> STACK_SIZE_TO_SHADOW_STACK_SIZE_SHIFT);
+ /* Align shadow stack to 8 bytes. */
+ ssp_size = ALIGN_UP (ssp_size, 8);
+
+ ucp->__ssp[1] = ssp_size;
+ ucp->__ssp[2] = ssp_size;
+
+ /* Call __push___start_context to allocate a new shadow stack,
+ push __start_context onto the new stack as well as the new
+ shadow stack. NB: After __push___start_context returns,
+ ucp->__ssp[0]: The new shadow stack pointer.
+ ucp->__ssp[1]: The base address of the new shadow stack.
+ ucp->__ssp[2]: The size of the new shadow stack.
+ */
+ __push___start_context (ucp);
+ }
+ else
+#endif
+ sp[0] = (uintptr_t) &__start_context;
sp[idx_uc_link] = (uintptr_t) ucp->uc_link;
va_start (ap, argc);
diff --git a/sysdeps/unix/sysv/linux/x86_64/profil-counter.h b/sysdeps/unix/sysv/linux/x86_64/profil-counter.h
index f559feaca8..13b579ac2c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/x86_64/profil-counter.h
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Linux/x86-64 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
deleted file mode 100644
index de455dda4f..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
+++ /dev/null
@@ -1,177 +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 <sysdep.h>
-#include <shlib-compat.h>
-#include <lowlevellock.h>
-#include <lowlevelcond.h>
-#include <kernel-features.h>
-#include <pthread-pi-defines.h>
-#include <pthread-errnos.h>
-#include <stap-probe.h>
-
- .text
-
- /* int pthread_cond_broadcast (pthread_cond_t *cond) */
-ENTRY(__pthread_cond_broadcast)
-
- LIBC_PROBE (cond_broadcast, 1, %rdi)
-
- /* Get internal lock. */
- movl $1, %esi
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %esi, (%rdi)
-#else
- cmpxchgl %esi, cond_lock(%rdi)
-#endif
- jnz 1f
-
-2: addq $cond_futex, %rdi
- movq total_seq-cond_futex(%rdi), %r9
- cmpq wakeup_seq-cond_futex(%rdi), %r9
- jna 4f
-
- /* Cause all currently waiting threads to recognize they are
- woken up. */
- movq %r9, wakeup_seq-cond_futex(%rdi)
- movq %r9, woken_seq-cond_futex(%rdi)
- addq %r9, %r9
- movl %r9d, (%rdi)
- incl broadcast_seq-cond_futex(%rdi)
-
- /* Get the address of the mutex used. */
- mov dep_mutex-cond_futex(%rdi), %R8_LP
-
- /* Unlock. */
- LOCK
- decl cond_lock-cond_futex(%rdi)
- jne 7f
-
-8: cmp $-1, %R8_LP
- je 9f
-
- /* Do not use requeue for pshared condvars. */
- testl $PS_BIT, MUTEX_KIND(%r8)
- jne 9f
-
- /* Requeue to a PI mutex if the PI bit is set. */
- movl MUTEX_KIND(%r8), %eax
- andl $(ROBUST_BIT|PI_BIT), %eax
- cmpl $PI_BIT, %eax
- je 81f
-
- /* Wake up all threads. */
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $(FUTEX_CMP_REQUEUE|FUTEX_PRIVATE_FLAG), %esi
-#else
- movl %fs:PRIVATE_FUTEX, %esi
- orl $FUTEX_CMP_REQUEUE, %esi
-#endif
- movl $SYS_futex, %eax
- movl $1, %edx
- movl $0x7fffffff, %r10d
- syscall
-
- /* For any kind of error, which mainly is EAGAIN, we try again
- with WAKE. The general test also covers running on old
- kernels. */
- cmpq $-4095, %rax
- jae 9f
-
-10: xorl %eax, %eax
- retq
-
- /* Wake up all threads. */
-81: movl $(FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
- movl $SYS_futex, %eax
- movl $1, %edx
- movl $0x7fffffff, %r10d
- syscall
-
- /* For any kind of error, which mainly is EAGAIN, we try again
- with WAKE. The general test also covers running on old
- kernels. */
- cmpq $-4095, %rax
- jb 10b
- jmp 9f
-
- .align 16
- /* Unlock. */
-4: LOCK
- decl cond_lock-cond_futex(%rdi)
- jne 5f
-
-6: xorl %eax, %eax
- retq
-
- /* Initial locking failed. */
-1:
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_lock_wait
-#if cond_lock != 0
- subq $cond_lock, %rdi
-#endif
- jmp 2b
-
- /* Unlock in loop requires wakeup. */
-5: addq $cond_lock-cond_futex, %rdi
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_unlock_wake
- jmp 6b
-
- /* Unlock in loop requires wakeup. */
-7: addq $cond_lock-cond_futex, %rdi
- cmp $-1, %R8_LP
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_unlock_wake
- subq $cond_lock-cond_futex, %rdi
- jmp 8b
-
-9: /* The futex requeue functionality is not available. */
- cmp $-1, %R8_LP
- movl $0x7fffffff, %edx
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $FUTEX_WAKE, %eax
- movl $(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
- cmove %eax, %esi
-#else
- movl $0, %eax
- movl %fs:PRIVATE_FUTEX, %esi
- cmove %eax, %esi
- orl $FUTEX_WAKE, %esi
-#endif
- movl $SYS_futex, %eax
- syscall
- jmp 10b
-END(__pthread_cond_broadcast)
-
-versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
- GLIBC_2_3_2)
diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
deleted file mode 100644
index da14bc30bc..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
+++ /dev/null
@@ -1,161 +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 <sysdep.h>
-#include <shlib-compat.h>
-#include <lowlevellock.h>
-#include <lowlevelcond.h>
-#include <pthread-pi-defines.h>
-#include <kernel-features.h>
-#include <pthread-errnos.h>
-#include <stap-probe.h>
-
-
- .text
-
-ENTRY(__pthread_cond_signal)
-
- LIBC_PROBE (cond_signal, 1, %rdi)
-
- /* Get internal lock. */
- movq %rdi, %r8
- movl $1, %esi
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %esi, (%rdi)
-#else
- cmpxchgl %esi, cond_lock(%rdi)
-#endif
- jnz 1f
-
-2: addq $cond_futex, %rdi
- movq total_seq(%r8), %rcx
- cmpq wakeup_seq(%r8), %rcx
- jbe 4f
-
- /* Bump the wakeup number. */
- addq $1, wakeup_seq(%r8)
- addl $1, (%rdi)
-
- /* Wake up one thread. */
- LP_OP(cmp) $-1, dep_mutex(%r8)
- movl $FUTEX_WAKE_OP, %esi
- movl $1, %edx
- movl $SYS_futex, %eax
- je 8f
-
- /* Get the address of the mutex used. */
- mov dep_mutex(%r8), %RCX_LP
- movl MUTEX_KIND(%rcx), %r11d
- andl $(ROBUST_BIT|PI_BIT), %r11d
- cmpl $PI_BIT, %r11d
- je 9f
-
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $(FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG), %esi
-#else
- orl %fs:PRIVATE_FUTEX, %esi
-#endif
-
-8: movl $1, %r10d
-#if cond_lock != 0
- addq $cond_lock, %r8
-#endif
- movl $FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, %r9d
- syscall
-#if cond_lock != 0
- subq $cond_lock, %r8
-#endif
- /* For any kind of error, we try again with WAKE.
- The general test also covers running on old kernels. */
- cmpq $-4095, %rax
- jae 7f
-
- xorl %eax, %eax
- retq
-
- /* Wake up one thread and requeue none in the PI Mutex case. */
-9: movl $(FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
- movq %rcx, %r8
- xorq %r10, %r10
- movl (%rdi), %r9d // XXX Can this be right?
- syscall
-
- leaq -cond_futex(%rdi), %r8
-
- /* For any kind of error, we try again with WAKE.
- The general test also covers running on old kernels. */
- cmpq $-4095, %rax
- jb 4f
-
-7:
-#ifdef __ASSUME_PRIVATE_FUTEX
- andl $FUTEX_PRIVATE_FLAG, %esi
-#else
- andl %fs:PRIVATE_FUTEX, %esi
-#endif
- orl $FUTEX_WAKE, %esi
- movl $SYS_futex, %eax
- /* %rdx should be 1 already from $FUTEX_WAKE_OP syscall.
- movl $1, %edx */
- syscall
-
- /* Unlock. */
-4: LOCK
-#if cond_lock == 0
- decl (%r8)
-#else
- decl cond_lock(%r8)
-#endif
- jne 5f
-
-6: xorl %eax, %eax
- retq
-
- /* Initial locking failed. */
-1:
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_lock_wait
-#if cond_lock != 0
- subq $cond_lock, %rdi
-#endif
- jmp 2b
-
- /* Unlock in loop requires wakeup. */
-5:
- movq %r8, %rdi
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_unlock_wake
- jmp 6b
-END(__pthread_cond_signal)
-
-versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal,
- GLIBC_2_3_2)
diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
deleted file mode 100644
index 9a63314b6e..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ /dev/null
@@ -1,623 +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 <sysdep.h>
-#include <shlib-compat.h>
-#include <lowlevellock.h>
-#include <lowlevelcond.h>
-#include <pthread-pi-defines.h>
-#include <pthread-errnos.h>
-#include <stap-probe.h>
-
-#include <kernel-features.h>
-
-
- .text
-
-
-/* int pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
- const struct timespec *abstime) */
- .globl __pthread_cond_timedwait
- .type __pthread_cond_timedwait, @function
- .align 16
-__pthread_cond_timedwait:
-.LSTARTCODE:
- cfi_startproc
-#ifdef SHARED
- cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
- DW.ref.__gcc_personality_v0)
- cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
-#else
- cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
- cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
-#endif
-
- pushq %r12
- cfi_adjust_cfa_offset(8)
- cfi_rel_offset(%r12, 0)
- pushq %r13
- cfi_adjust_cfa_offset(8)
- cfi_rel_offset(%r13, 0)
- pushq %r14
- cfi_adjust_cfa_offset(8)
- cfi_rel_offset(%r14, 0)
- pushq %r15
- cfi_adjust_cfa_offset(8)
- cfi_rel_offset(%r15, 0)
-#define FRAME_SIZE (32+8)
- subq $FRAME_SIZE, %rsp
- cfi_adjust_cfa_offset(FRAME_SIZE)
- cfi_remember_state
-
- LIBC_PROBE (cond_timedwait, 3, %rdi, %rsi, %rdx)
-
- cmpq $1000000000, 8(%rdx)
- movl $EINVAL, %eax
- jae 48f
-
- /* Stack frame:
-
- rsp + 48
- +--------------------------+
- rsp + 32 | timeout value |
- +--------------------------+
- rsp + 24 | old wake_seq value |
- +--------------------------+
- rsp + 16 | mutex pointer |
- +--------------------------+
- rsp + 8 | condvar pointer |
- +--------------------------+
- rsp + 4 | old broadcast_seq value |
- +--------------------------+
- rsp + 0 | old cancellation mode |
- +--------------------------+
- */
-
- LP_OP(cmp) $-1, dep_mutex(%rdi)
-
- /* Prepare structure passed to cancellation handler. */
- movq %rdi, 8(%rsp)
- movq %rsi, 16(%rsp)
- movq %rdx, %r13
-
- je 22f
- mov %RSI_LP, dep_mutex(%rdi)
-
-22:
- xorb %r15b, %r15b
-
- /* Get internal lock. */
- movl $1, %esi
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %esi, (%rdi)
-#else
- cmpxchgl %esi, cond_lock(%rdi)
-#endif
- jnz 31f
-
- /* Unlock the mutex. */
-32: movq 16(%rsp), %rdi
- xorl %esi, %esi
- callq __pthread_mutex_unlock_usercnt
-
- testl %eax, %eax
- jne 46f
-
- movq 8(%rsp), %rdi
- incq total_seq(%rdi)
- incl cond_futex(%rdi)
- addl $(1 << nwaiters_shift), cond_nwaiters(%rdi)
-
- /* Get and store current wakeup_seq value. */
- movq 8(%rsp), %rdi
- movq wakeup_seq(%rdi), %r9
- movl broadcast_seq(%rdi), %edx
- movq %r9, 24(%rsp)
- movl %edx, 4(%rsp)
-
- cmpq $0, (%r13)
- movq $-ETIMEDOUT, %r14
- js 36f
-
-38: movl cond_futex(%rdi), %r12d
-
- /* Unlock. */
- LOCK
-#if cond_lock == 0
- decl (%rdi)
-#else
- decl cond_lock(%rdi)
-#endif
- jne 33f
-
-.LcleanupSTART1:
-34: callq __pthread_enable_asynccancel
- movl %eax, (%rsp)
-
- movq %r13, %r10
- movl $FUTEX_WAIT_BITSET, %esi
- LP_OP(cmp) $-1, dep_mutex(%rdi)
- je 60f
-
- mov dep_mutex(%rdi), %R8_LP
- /* Requeue to a non-robust PI mutex if the PI bit is set and
- the robust bit is not set. */
- movl MUTEX_KIND(%r8), %eax
- andl $(ROBUST_BIT|PI_BIT), %eax
- cmpl $PI_BIT, %eax
- jne 61f
-
- movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
- xorl %eax, %eax
- /* The following only works like this because we only support
- two clocks, represented using a single bit. */
- testl $1, cond_nwaiters(%rdi)
- movl $FUTEX_CLOCK_REALTIME, %edx
- cmove %edx, %eax
- orl %eax, %esi
- movq %r12, %rdx
- addq $cond_futex, %rdi
- movl $SYS_futex, %eax
- syscall
-
- cmpl $0, %eax
- sete %r15b
-
-#ifdef __ASSUME_REQUEUE_PI
- jmp 62f
-#else
- je 62f
-
- /* When a futex syscall with FUTEX_WAIT_REQUEUE_PI returns
- successfully, it has already locked the mutex for us and the
- pi_flag (%r15b) is set to denote that fact. However, if another
- thread changed the futex value before we entered the wait, the
- syscall may return an EAGAIN and the mutex is not locked. We go
- ahead with a success anyway since later we look at the pi_flag to
- decide if we got the mutex or not. The sequence numbers then make
- sure that only one of the threads actually wake up. We retry using
- normal FUTEX_WAIT only if the kernel returned ENOSYS, since normal
- and PI futexes don't mix.
-
- Note that we don't check for EAGAIN specifically; we assume that the
- only other error the futex function could return is EAGAIN (barring
- the ETIMEOUT of course, for the timeout case in futex) since
- anything else would mean an error in our function. It is too
- expensive to do that check for every call (which is quite common in
- case of a large number of threads), so it has been skipped. */
- cmpl $-ENOSYS, %eax
- jne 62f
-
- subq $cond_futex, %rdi
-#endif
-
-61: movl $(FUTEX_WAIT_BITSET|FUTEX_PRIVATE_FLAG), %esi
-60: xorb %r15b, %r15b
- xorl %eax, %eax
- /* The following only works like this because we only support
- two clocks, represented using a single bit. */
- testl $1, cond_nwaiters(%rdi)
- movl $FUTEX_CLOCK_REALTIME, %edx
- movl $0xffffffff, %r9d
- cmove %edx, %eax
- orl %eax, %esi
- movq %r12, %rdx
- addq $cond_futex, %rdi
- movl $SYS_futex, %eax
- syscall
-62: movq %rax, %r14
-
- movl (%rsp), %edi
- callq __pthread_disable_asynccancel
-.LcleanupEND1:
-
- /* Lock. */
- movq 8(%rsp), %rdi
- movl $1, %esi
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %esi, (%rdi)
-#else
- cmpxchgl %esi, cond_lock(%rdi)
-#endif
- jne 35f
-
-36: movl broadcast_seq(%rdi), %edx
-
- movq woken_seq(%rdi), %rax
-
- movq wakeup_seq(%rdi), %r9
-
- cmpl 4(%rsp), %edx
- jne 53f
-
- cmpq 24(%rsp), %r9
- jbe 45f
-
- cmpq %rax, %r9
- ja 39f
-
-45: cmpq $-ETIMEDOUT, %r14
- je 99f
-
- /* We need to go back to futex_wait. If we're using requeue_pi, then
- release the mutex we had acquired and go back. */
- test %r15b, %r15b
- jz 38b
-
- /* Adjust the mutex values first and then unlock it. The unlock
- should always succeed or else the kernel did not lock the
- mutex correctly. */
- movq %r8, %rdi
- callq __pthread_mutex_cond_lock_adjust
- xorl %esi, %esi
- callq __pthread_mutex_unlock_usercnt
- /* Reload cond_var. */
- movq 8(%rsp), %rdi
- jmp 38b
-
-99: incq wakeup_seq(%rdi)
- incl cond_futex(%rdi)
- movl $ETIMEDOUT, %r14d
- jmp 44f
-
-53: xorq %r14, %r14
- jmp 54f
-
-39: xorq %r14, %r14
-44: incq woken_seq(%rdi)
-
-54: subl $(1 << nwaiters_shift), cond_nwaiters(%rdi)
-
- /* Wake up a thread which wants to destroy the condvar object. */
- cmpq $0xffffffffffffffff, total_seq(%rdi)
- jne 55f
- movl cond_nwaiters(%rdi), %eax
- andl $~((1 << nwaiters_shift) - 1), %eax
- jne 55f
-
- addq $cond_nwaiters, %rdi
- LP_OP(cmp) $-1, dep_mutex-cond_nwaiters(%rdi)
- movl $1, %edx
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $FUTEX_WAKE, %eax
- movl $(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
- cmove %eax, %esi
-#else
- movl $0, %eax
- movl %fs:PRIVATE_FUTEX, %esi
- cmove %eax, %esi
- orl $FUTEX_WAKE, %esi
-#endif
- movl $SYS_futex, %eax
- syscall
- subq $cond_nwaiters, %rdi
-
-55: LOCK
-#if cond_lock == 0
- decl (%rdi)
-#else
- decl cond_lock(%rdi)
-#endif
- jne 40f
-
- /* If requeue_pi is used the kernel performs the locking of the
- mutex. */
-41: movq 16(%rsp), %rdi
- testb %r15b, %r15b
- jnz 64f
-
- callq __pthread_mutex_cond_lock
-
-63: testq %rax, %rax
- cmoveq %r14, %rax
-
-48: addq $FRAME_SIZE, %rsp
- cfi_adjust_cfa_offset(-FRAME_SIZE)
- popq %r15
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r15)
- popq %r14
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r14)
- popq %r13
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r13)
- popq %r12
- cfi_adjust_cfa_offset(-8)
- cfi_restore(%r12)
-
- retq
-
- cfi_restore_state
-
-64: callq __pthread_mutex_cond_lock_adjust
- movq %r14, %rax
- jmp 48b
-
- /* Initial locking failed. */
-31:
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_lock_wait
- jmp 32b
-
- /* Unlock in loop requires wakeup. */
-33:
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_unlock_wake
- jmp 34b
-
- /* Locking in loop failed. */
-35:
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_lock_wait
-#if cond_lock != 0
- subq $cond_lock, %rdi
-#endif
- jmp 36b
-
- /* Unlock after loop requires wakeup. */
-40:
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_unlock_wake
- jmp 41b
-
- /* The initial unlocking of the mutex failed. */
-46: movq 8(%rsp), %rdi
- movq %rax, (%rsp)
- LOCK
-#if cond_lock == 0
- decl (%rdi)
-#else
- decl cond_lock(%rdi)
-#endif
- jne 47f
-
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_unlock_wake
-
-47: movq (%rsp), %rax
- jmp 48b
-
- .size __pthread_cond_timedwait, .-__pthread_cond_timedwait
-versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
- GLIBC_2_3_2)
-
-
- .align 16
- .type __condvar_cleanup2, @function
-__condvar_cleanup2:
- /* Stack frame:
-
- rsp + 72
- +--------------------------+
- rsp + 64 | %r12 |
- +--------------------------+
- rsp + 56 | %r13 |
- +--------------------------+
- rsp + 48 | %r14 |
- +--------------------------+
- rsp + 24 | unused |
- +--------------------------+
- rsp + 16 | mutex pointer |
- +--------------------------+
- rsp + 8 | condvar pointer |
- +--------------------------+
- rsp + 4 | old broadcast_seq value |
- +--------------------------+
- rsp + 0 | old cancellation mode |
- +--------------------------+
- */
-
- movq %rax, 24(%rsp)
-
- /* Get internal lock. */
- movq 8(%rsp), %rdi
- movl $1, %esi
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %esi, (%rdi)
-#else
- cmpxchgl %esi, cond_lock(%rdi)
-#endif
- jz 1f
-
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_lock_wait
-#if cond_lock != 0
- subq $cond_lock, %rdi
-#endif
-
-1: movl broadcast_seq(%rdi), %edx
- cmpl 4(%rsp), %edx
- jne 3f
-
- /* We increment the wakeup_seq counter only if it is lower than
- total_seq. If this is not the case the thread was woken and
- then canceled. In this case we ignore the signal. */
- movq total_seq(%rdi), %rax
- cmpq wakeup_seq(%rdi), %rax
- jbe 6f
- incq wakeup_seq(%rdi)
- incl cond_futex(%rdi)
-6: incq woken_seq(%rdi)
-
-3: subl $(1 << nwaiters_shift), cond_nwaiters(%rdi)
-
- /* Wake up a thread which wants to destroy the condvar object. */
- xorq %r12, %r12
- cmpq $0xffffffffffffffff, total_seq(%rdi)
- jne 4f
- movl cond_nwaiters(%rdi), %eax
- andl $~((1 << nwaiters_shift) - 1), %eax
- jne 4f
-
- LP_OP(cmp) $-1, dep_mutex(%rdi)
- leaq cond_nwaiters(%rdi), %rdi
- movl $1, %edx
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $FUTEX_WAKE, %eax
- movl $(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
- cmove %eax, %esi
-#else
- movl $0, %eax
- movl %fs:PRIVATE_FUTEX, %esi
- cmove %eax, %esi
- orl $FUTEX_WAKE, %esi
-#endif
- movl $SYS_futex, %eax
- syscall
- subq $cond_nwaiters, %rdi
- movl $1, %r12d
-
-4: LOCK
-#if cond_lock == 0
- decl (%rdi)
-#else
- decl cond_lock(%rdi)
-#endif
- je 2f
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_unlock_wake
-
- /* Wake up all waiters to make sure no signal gets lost. */
-2: testq %r12, %r12
- jnz 5f
- addq $cond_futex, %rdi
- LP_OP(cmp) $-1, dep_mutex-cond_futex(%rdi)
- movl $0x7fffffff, %edx
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $FUTEX_WAKE, %eax
- movl $(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
- cmove %eax, %esi
-#else
- movl $0, %eax
- movl %fs:PRIVATE_FUTEX, %esi
- cmove %eax, %esi
- orl $FUTEX_WAKE, %esi
-#endif
- movl $SYS_futex, %eax
- syscall
-
- /* Lock the mutex only if we don't own it already. This only happens
- in case of PI mutexes, if we got cancelled after a successful
- return of the futex syscall and before disabling async
- cancellation. */
-5: movq 16(%rsp), %rdi
- movl MUTEX_KIND(%rdi), %eax
- andl $(ROBUST_BIT|PI_BIT), %eax
- cmpl $PI_BIT, %eax
- jne 7f
-
- movl (%rdi), %eax
- andl $TID_MASK, %eax
- cmpl %eax, %fs:TID
- jne 7f
- /* We managed to get the lock. Fix it up before returning. */
- callq __pthread_mutex_cond_lock_adjust
- jmp 8f
-
-7: callq __pthread_mutex_cond_lock
-
-8: movq 24(%rsp), %rdi
- movq FRAME_SIZE(%rsp), %r15
- movq FRAME_SIZE+8(%rsp), %r14
- movq FRAME_SIZE+16(%rsp), %r13
- movq FRAME_SIZE+24(%rsp), %r12
-.LcallUR:
- call _Unwind_Resume@PLT
- hlt
-.LENDCODE:
- cfi_endproc
- .size __condvar_cleanup2, .-__condvar_cleanup2
-
-
- .section .gcc_except_table,"a",@progbits
-.LexceptSTART:
- .byte DW_EH_PE_omit # @LPStart format
- .byte DW_EH_PE_omit # @TType format
- .byte DW_EH_PE_uleb128 # call-site format
- .uleb128 .Lcstend-.Lcstbegin
-.Lcstbegin:
- .uleb128 .LcleanupSTART1-.LSTARTCODE
- .uleb128 .LcleanupEND1-.LcleanupSTART1
- .uleb128 __condvar_cleanup2-.LSTARTCODE
- .uleb128 0
- .uleb128 .LcallUR-.LSTARTCODE
- .uleb128 .LENDCODE-.LcallUR
- .uleb128 0
- .uleb128 0
-.Lcstend:
-
-
-#ifdef SHARED
- .hidden DW.ref.__gcc_personality_v0
- .weak DW.ref.__gcc_personality_v0
- .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
- .align LP_SIZE
- .type DW.ref.__gcc_personality_v0, @object
- .size DW.ref.__gcc_personality_v0, LP_SIZE
-DW.ref.__gcc_personality_v0:
- ASM_ADDR __gcc_personality_v0
-#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
deleted file mode 100644
index ed93d5d29c..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
+++ /dev/null
@@ -1,555 +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 <sysdep.h>
-#include <shlib-compat.h>
-#include <lowlevellock.h>
-#include <lowlevelcond.h>
-#include <tcb-offsets.h>
-#include <pthread-pi-defines.h>
-#include <pthread-errnos.h>
-#include <stap-probe.h>
-
-#include <kernel-features.h>
-
-
- .text
-
-/* int pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex) */
- .globl __pthread_cond_wait
- .type __pthread_cond_wait, @function
- .align 16
-__pthread_cond_wait:
-.LSTARTCODE:
- cfi_startproc
-#ifdef SHARED
- cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
- DW.ref.__gcc_personality_v0)
- cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
-#else
- cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
- cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
-#endif
-
-#define FRAME_SIZE (32+8)
- leaq -FRAME_SIZE(%rsp), %rsp
- cfi_adjust_cfa_offset(FRAME_SIZE)
-
- /* Stack frame:
-
- rsp + 32
- +--------------------------+
- rsp + 24 | old wake_seq value |
- +--------------------------+
- rsp + 16 | mutex pointer |
- +--------------------------+
- rsp + 8 | condvar pointer |
- +--------------------------+
- rsp + 4 | old broadcast_seq value |
- +--------------------------+
- rsp + 0 | old cancellation mode |
- +--------------------------+
- */
-
- LIBC_PROBE (cond_wait, 2, %rdi, %rsi)
-
- LP_OP(cmp) $-1, dep_mutex(%rdi)
-
- /* Prepare structure passed to cancellation handler. */
- movq %rdi, 8(%rsp)
- movq %rsi, 16(%rsp)
-
- je 15f
- mov %RSI_LP, dep_mutex(%rdi)
-
- /* Get internal lock. */
-15: movl $1, %esi
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %esi, (%rdi)
-#else
- cmpxchgl %esi, cond_lock(%rdi)
-#endif
- jne 1f
-
- /* Unlock the mutex. */
-2: movq 16(%rsp), %rdi
- xorl %esi, %esi
- callq __pthread_mutex_unlock_usercnt
-
- testl %eax, %eax
- jne 12f
-
- movq 8(%rsp), %rdi
- incq total_seq(%rdi)
- incl cond_futex(%rdi)
- addl $(1 << nwaiters_shift), cond_nwaiters(%rdi)
-
- /* Get and store current wakeup_seq value. */
- movq 8(%rsp), %rdi
- movq wakeup_seq(%rdi), %r9
- movl broadcast_seq(%rdi), %edx
- movq %r9, 24(%rsp)
- movl %edx, 4(%rsp)
-
- /* Unlock. */
-8: movl cond_futex(%rdi), %edx
- LOCK
-#if cond_lock == 0
- decl (%rdi)
-#else
- decl cond_lock(%rdi)
-#endif
- jne 3f
-
-.LcleanupSTART:
-4: callq __pthread_enable_asynccancel
- movl %eax, (%rsp)
-
- xorq %r10, %r10
- LP_OP(cmp) $-1, dep_mutex(%rdi)
- leaq cond_futex(%rdi), %rdi
- movl $FUTEX_WAIT, %esi
- je 60f
-
- mov dep_mutex-cond_futex(%rdi), %R8_LP
- /* Requeue to a non-robust PI mutex if the PI bit is set and
- the robust bit is not set. */
- movl MUTEX_KIND(%r8), %eax
- andl $(ROBUST_BIT|PI_BIT), %eax
- cmpl $PI_BIT, %eax
- jne 61f
-
- movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
- movl $SYS_futex, %eax
- syscall
-
- cmpl $0, %eax
- sete %r8b
-
-#ifdef __ASSUME_REQUEUE_PI
- jmp 62f
-#else
- je 62f
-
- /* When a futex syscall with FUTEX_WAIT_REQUEUE_PI returns
- successfully, it has already locked the mutex for us and the
- pi_flag (%r8b) is set to denote that fact. However, if another
- thread changed the futex value before we entered the wait, the
- syscall may return an EAGAIN and the mutex is not locked. We go
- ahead with a success anyway since later we look at the pi_flag to
- decide if we got the mutex or not. The sequence numbers then make
- sure that only one of the threads actually wake up. We retry using
- normal FUTEX_WAIT only if the kernel returned ENOSYS, since normal
- and PI futexes don't mix.
-
- Note that we don't check for EAGAIN specifically; we assume that the
- only other error the futex function could return is EAGAIN since
- anything else would mean an error in our function. It is too
- expensive to do that check for every call (which is quite common in
- case of a large number of threads), so it has been skipped. */
- cmpl $-ENOSYS, %eax
- jne 62f
-
-# ifndef __ASSUME_PRIVATE_FUTEX
- movl $FUTEX_WAIT, %esi
-# endif
-#endif
-
-61:
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $(FUTEX_WAIT|FUTEX_PRIVATE_FLAG), %esi
-#else
- orl %fs:PRIVATE_FUTEX, %esi
-#endif
-60: xorb %r8b, %r8b
- movl $SYS_futex, %eax
- syscall
-
-62: movl (%rsp), %edi
- callq __pthread_disable_asynccancel
-.LcleanupEND:
-
- /* Lock. */
- movq 8(%rsp), %rdi
- movl $1, %esi
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %esi, (%rdi)
-#else
- cmpxchgl %esi, cond_lock(%rdi)
-#endif
- jnz 5f
-
-6: movl broadcast_seq(%rdi), %edx
-
- movq woken_seq(%rdi), %rax
-
- movq wakeup_seq(%rdi), %r9
-
- cmpl 4(%rsp), %edx
- jne 16f
-
- cmpq 24(%rsp), %r9
- jbe 19f
-
- cmpq %rax, %r9
- jna 19f
-
- incq woken_seq(%rdi)
-
- /* Unlock */
-16: subl $(1 << nwaiters_shift), cond_nwaiters(%rdi)
-
- /* Wake up a thread which wants to destroy the condvar object. */
- cmpq $0xffffffffffffffff, total_seq(%rdi)
- jne 17f
- movl cond_nwaiters(%rdi), %eax
- andl $~((1 << nwaiters_shift) - 1), %eax
- jne 17f
-
- addq $cond_nwaiters, %rdi
- LP_OP(cmp) $-1, dep_mutex-cond_nwaiters(%rdi)
- movl $1, %edx
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $FUTEX_WAKE, %eax
- movl $(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
- cmove %eax, %esi
-#else
- movl $0, %eax
- movl %fs:PRIVATE_FUTEX, %esi
- cmove %eax, %esi
- orl $FUTEX_WAKE, %esi
-#endif
- movl $SYS_futex, %eax
- syscall
- subq $cond_nwaiters, %rdi
-
-17: LOCK
-#if cond_lock == 0
- decl (%rdi)
-#else
- decl cond_lock(%rdi)
-#endif
- jne 10f
-
- /* If requeue_pi is used the kernel performs the locking of the
- mutex. */
-11: movq 16(%rsp), %rdi
- testb %r8b, %r8b
- jnz 18f
-
- callq __pthread_mutex_cond_lock
-
-14: leaq FRAME_SIZE(%rsp), %rsp
- cfi_adjust_cfa_offset(-FRAME_SIZE)
-
- /* We return the result of the mutex_lock operation. */
- retq
-
- cfi_adjust_cfa_offset(FRAME_SIZE)
-
-18: callq __pthread_mutex_cond_lock_adjust
- xorl %eax, %eax
- jmp 14b
-
- /* We need to go back to futex_wait. If we're using requeue_pi, then
- release the mutex we had acquired and go back. */
-19: testb %r8b, %r8b
- jz 8b
-
- /* Adjust the mutex values first and then unlock it. The unlock
- should always succeed or else the kernel did not lock the mutex
- correctly. */
- movq 16(%rsp), %rdi
- callq __pthread_mutex_cond_lock_adjust
- movq %rdi, %r8
- xorl %esi, %esi
- callq __pthread_mutex_unlock_usercnt
- /* Reload cond_var. */
- movq 8(%rsp), %rdi
- jmp 8b
-
- /* Initial locking failed. */
-1:
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_lock_wait
- jmp 2b
-
- /* Unlock in loop requires wakeup. */
-3:
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- /* The call preserves %rdx. */
- callq __lll_unlock_wake
-#if cond_lock != 0
- subq $cond_lock, %rdi
-#endif
- jmp 4b
-
- /* Locking in loop failed. */
-5:
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_lock_wait
-#if cond_lock != 0
- subq $cond_lock, %rdi
-#endif
- jmp 6b
-
- /* Unlock after loop requires wakeup. */
-10:
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_unlock_wake
- jmp 11b
-
- /* The initial unlocking of the mutex failed. */
-12: movq %rax, %r10
- movq 8(%rsp), %rdi
- LOCK
-#if cond_lock == 0
- decl (%rdi)
-#else
- decl cond_lock(%rdi)
-#endif
- je 13f
-
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_unlock_wake
-
-13: movq %r10, %rax
- jmp 14b
-
- .size __pthread_cond_wait, .-__pthread_cond_wait
-versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
- GLIBC_2_3_2)
-
-
- .align 16
- .type __condvar_cleanup1, @function
- .globl __condvar_cleanup1
- .hidden __condvar_cleanup1
-__condvar_cleanup1:
- /* Stack frame:
-
- rsp + 32
- +--------------------------+
- rsp + 24 | unused |
- +--------------------------+
- rsp + 16 | mutex pointer |
- +--------------------------+
- rsp + 8 | condvar pointer |
- +--------------------------+
- rsp + 4 | old broadcast_seq value |
- +--------------------------+
- rsp + 0 | old cancellation mode |
- +--------------------------+
- */
-
- movq %rax, 24(%rsp)
-
- /* Get internal lock. */
- movq 8(%rsp), %rdi
- movl $1, %esi
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %esi, (%rdi)
-#else
- cmpxchgl %esi, cond_lock(%rdi)
-#endif
- jz 1f
-
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_lock_wait
-#if cond_lock != 0
- subq $cond_lock, %rdi
-#endif
-
-1: movl broadcast_seq(%rdi), %edx
- cmpl 4(%rsp), %edx
- jne 3f
-
- /* We increment the wakeup_seq counter only if it is lower than
- total_seq. If this is not the case the thread was woken and
- then canceled. In this case we ignore the signal. */
- movq total_seq(%rdi), %rax
- cmpq wakeup_seq(%rdi), %rax
- jbe 6f
- incq wakeup_seq(%rdi)
- incl cond_futex(%rdi)
-6: incq woken_seq(%rdi)
-
-3: subl $(1 << nwaiters_shift), cond_nwaiters(%rdi)
-
- /* Wake up a thread which wants to destroy the condvar object. */
- xorl %ecx, %ecx
- cmpq $0xffffffffffffffff, total_seq(%rdi)
- jne 4f
- movl cond_nwaiters(%rdi), %eax
- andl $~((1 << nwaiters_shift) - 1), %eax
- jne 4f
-
- LP_OP(cmp) $-1, dep_mutex(%rdi)
- leaq cond_nwaiters(%rdi), %rdi
- movl $1, %edx
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $FUTEX_WAKE, %eax
- movl $(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
- cmove %eax, %esi
-#else
- movl $0, %eax
- movl %fs:PRIVATE_FUTEX, %esi
- cmove %eax, %esi
- orl $FUTEX_WAKE, %esi
-#endif
- movl $SYS_futex, %eax
- syscall
- subq $cond_nwaiters, %rdi
- movl $1, %ecx
-
-4: LOCK
-#if cond_lock == 0
- decl (%rdi)
-#else
- decl cond_lock(%rdi)
-#endif
- je 2f
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- /* The call preserves %rcx. */
- callq __lll_unlock_wake
-
- /* Wake up all waiters to make sure no signal gets lost. */
-2: testl %ecx, %ecx
- jnz 5f
- addq $cond_futex, %rdi
- LP_OP(cmp) $-1, dep_mutex-cond_futex(%rdi)
- movl $0x7fffffff, %edx
-#ifdef __ASSUME_PRIVATE_FUTEX
- movl $FUTEX_WAKE, %eax
- movl $(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
- cmove %eax, %esi
-#else
- movl $0, %eax
- movl %fs:PRIVATE_FUTEX, %esi
- cmove %eax, %esi
- orl $FUTEX_WAKE, %esi
-#endif
- movl $SYS_futex, %eax
- syscall
-
- /* Lock the mutex only if we don't own it already. This only happens
- in case of PI mutexes, if we got cancelled after a successful
- return of the futex syscall and before disabling async
- cancellation. */
-5: movq 16(%rsp), %rdi
- movl MUTEX_KIND(%rdi), %eax
- andl $(ROBUST_BIT|PI_BIT), %eax
- cmpl $PI_BIT, %eax
- jne 7f
-
- movl (%rdi), %eax
- andl $TID_MASK, %eax
- cmpl %eax, %fs:TID
- jne 7f
- /* We managed to get the lock. Fix it up before returning. */
- callq __pthread_mutex_cond_lock_adjust
- jmp 8f
-
-
-7: callq __pthread_mutex_cond_lock
-
-8: movq 24(%rsp), %rdi
-.LcallUR:
- call _Unwind_Resume@PLT
- hlt
-.LENDCODE:
- cfi_endproc
- .size __condvar_cleanup1, .-__condvar_cleanup1
-
-
- .section .gcc_except_table,"a",@progbits
-.LexceptSTART:
- .byte DW_EH_PE_omit # @LPStart format
- .byte DW_EH_PE_omit # @TType format
- .byte DW_EH_PE_uleb128 # call-site format
- .uleb128 .Lcstend-.Lcstbegin
-.Lcstbegin:
- .uleb128 .LcleanupSTART-.LSTARTCODE
- .uleb128 .LcleanupEND-.LcleanupSTART
- .uleb128 __condvar_cleanup1-.LSTARTCODE
- .uleb128 0
- .uleb128 .LcallUR-.LSTARTCODE
- .uleb128 .LENDCODE-.LcallUR
- .uleb128 0
- .uleb128 0
-.Lcstend:
-
-
-#ifdef SHARED
- .hidden DW.ref.__gcc_personality_v0
- .weak DW.ref.__gcc_personality_v0
- .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
- .align LP_SIZE
- .type DW.ref.__gcc_personality_v0, @object
- .size DW.ref.__gcc_personality_v0, LP_SIZE
-DW.ref.__gcc_personality_v0:
- ASM_ADDR __gcc_personality_v0
-#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/recv.c b/sysdeps/unix/sysv/linux/x86_64/recv.c
deleted file mode 100644
index 4e8b2ea26a..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/recv.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2001-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/socket.h>
-#include <sysdep-cancel.h>
-
-/* Read N bytes into BUF from socket FD.
- Returns the number read or -1 for errors. */
-
-ssize_t
-__libc_recv (int fd, void *buf, size_t n, int flags)
-{
- return SYSCALL_CANCEL (recvfrom, fd, buf, n, flags, NULL, NULL);
-}
-
-weak_alias (__libc_recv, __recv)
-libc_hidden_weak (__recv)
-weak_alias (__recv, recv)
diff --git a/sysdeps/unix/sysv/linux/x86_64/register-dump.h b/sysdeps/unix/sysv/linux/x86_64/register-dump.h
index a450b9476f..64d022a77c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/register-dump.h
+++ b/sysdeps/unix/sysv/linux/x86_64/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -64,7 +64,7 @@ hexvalue (unsigned long int value, char *buf, size_t len)
}
static void
-register_dump (int fd, struct ucontext *ctx)
+register_dump (int fd, ucontext_t *ctx)
{
char regs[25][16];
char fpregs[30][8];
diff --git a/sysdeps/unix/sysv/linux/x86_64/send.c b/sysdeps/unix/sysv/linux/x86_64/send.c
deleted file mode 100644
index fec59c9c8d..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/send.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (C) 2001-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/socket.h>
-#include <sysdep-cancel.h>
-
-/* Send N bytes of BUF to socket FD. Returns the number sent or -1. */
-ssize_t
-__libc_send (int fd, const void *buf, size_t n, int flags)
-{
- return SYSCALL_CANCEL (sendto, fd, buf, n, flags, NULL, (size_t) 0);
-}
-
-weak_alias (__libc_send, __send)
-libc_hidden_weak (__send)
-weak_alias (__send, send)
diff --git a/sysdeps/unix/sysv/linux/x86_64/setcontext.S b/sysdeps/unix/sysv/linux/x86_64/setcontext.S
index 56e0856858..0afdf8ce0a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/x86_64/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <asm/prctl.h>
#include "ucontext_i.h"
@@ -44,21 +45,24 @@ ENTRY(__setcontext)
movl $_NSIG8,%r10d
movl $__NR_rt_sigprocmask, %eax
syscall
- popq %rdi /* Reload %rdi, adjust stack. */
+ /* Pop the pointer into RDX. The choice is arbitrary, but
+ leaving RDI and RSI available for use later can avoid
+ shuffling values. */
+ popq %rdx
cfi_adjust_cfa_offset(-8)
cmpq $-4095, %rax /* Check %rax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
/* Restore the floating-point context. Not the registers, only the
rest. */
- movq oFPREGS(%rdi), %rcx
+ movq oFPREGS(%rdx), %rcx
fldenv (%rcx)
- ldmxcsr oMXCSR(%rdi)
+ ldmxcsr oMXCSR(%rdx)
/* Load the new stack pointer, the preserved registers and
registers used for passing args. */
- cfi_def_cfa(%rdi, 0)
+ cfi_def_cfa(%rdx, 0)
cfi_offset(%rbx,oRBX)
cfi_offset(%rbp,oRBP)
cfi_offset(%r12,oR12)
@@ -68,27 +72,118 @@ ENTRY(__setcontext)
cfi_offset(%rsp,oRSP)
cfi_offset(%rip,oRIP)
- movq oRSP(%rdi), %rsp
- movq oRBX(%rdi), %rbx
- movq oRBP(%rdi), %rbp
- movq oR12(%rdi), %r12
- movq oR13(%rdi), %r13
- movq oR14(%rdi), %r14
- movq oR15(%rdi), %r15
+ movq oRSP(%rdx), %rsp
+ movq oRBX(%rdx), %rbx
+ movq oRBP(%rdx), %rbp
+ movq oR12(%rdx), %r12
+ movq oR13(%rdx), %r13
+ movq oR14(%rdx), %r14
+ movq oR15(%rdx), %r15
+
+#if SHSTK_ENABLED
+ /* Check if shadow stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %fs:FEATURE_1_OFFSET
+ jz L(no_shstk)
+
+ /* If the base of the target shadow stack is the same as the
+ base of the current shadow stack, we unwind the shadow
+ stack. Otherwise it is a stack switch and we look for a
+ restore token. */
+ movq oSSP(%rdx), %rsi
+ movq %rsi, %rdi
+
+ /* Get the base of the target shadow stack. */
+ movq (oSSP + 8)(%rdx), %rcx
+ cmpq %fs:SSP_BASE_OFFSET, %rcx
+ je L(unwind_shadow_stack)
+
+L(find_restore_token_loop):
+ /* Look for a restore token. */
+ movq -8(%rsi), %rax
+ andq $-8, %rax
+ cmpq %rsi, %rax
+ je L(restore_shadow_stack)
+
+ /* Try the next slot. */
+ subq $8, %rsi
+ jmp L(find_restore_token_loop)
+
+L(restore_shadow_stack):
+ /* Pop return address from the shadow stack since setcontext
+ will not return. */
+ movq $1, %rax
+ incsspq %rax
+
+ /* Use the restore stoken to restore the target shadow stack. */
+ rstorssp -8(%rsi)
+
+ /* Save the restore token on the old shadow stack. NB: This
+ restore token may be checked by setcontext or swapcontext
+ later. */
+ saveprevssp
+
+ /* Record the new shadow stack base that was switched to. */
+ movq (oSSP + 8)(%rdx), %rax
+ movq %rax, %fs:SSP_BASE_OFFSET
+
+L(unwind_shadow_stack):
+ rdsspq %rcx
+ subq %rdi, %rcx
+ je L(skip_unwind_shadow_stack)
+ negq %rcx
+ shrq $3, %rcx
+ movl $255, %esi
+L(loop):
+ cmpq %rsi, %rcx
+ cmovb %rcx, %rsi
+ incsspq %rsi
+ subq %rsi, %rcx
+ ja L(loop)
+
+L(skip_unwind_shadow_stack):
+ movq oRSI(%rdx), %rsi
+ movq oRDI(%rdx), %rdi
+ movq oRCX(%rdx), %rcx
+ movq oR8(%rdx), %r8
+ movq oR9(%rdx), %r9
+
+ /* Get the return address set with getcontext. */
+ movq oRIP(%rdx), %r10
+
+ /* Setup finally %rdx. */
+ movq oRDX(%rdx), %rdx
+
+ /* Check if return address is valid for the case when setcontext
+ is invoked from __start_context with linked context. */
+ rdsspq %rax
+ cmpq (%rax), %r10
+ /* Clear RAX to indicate success. NB: Don't use xorl to keep
+ EFLAGS for jne. */
+ movl $0, %eax
+ jne L(jmp)
+ /* Return to the new context if return address valid. */
+ pushq %r10
+ ret
+
+L(jmp):
+ /* Jump to the new context directly. */
+ jmp *%r10
+L(no_shstk):
+#endif
/* The following ret should return to the address set with
getcontext. Therefore push the address on the stack. */
- movq oRIP(%rdi), %rcx
+ movq oRIP(%rdx), %rcx
pushq %rcx
- movq oRSI(%rdi), %rsi
- movq oRDX(%rdi), %rdx
- movq oRCX(%rdi), %rcx
- movq oR8(%rdi), %r8
- movq oR9(%rdi), %r9
+ movq oRSI(%rdx), %rsi
+ movq oRDI(%rdx), %rdi
+ movq oRCX(%rdx), %rcx
+ movq oR8(%rdx), %r8
+ movq oR9(%rdx), %r9
- /* Setup finally %rdi. */
- movq oRDI(%rdi), %rdi
+ /* Setup finally %rdx. */
+ movq oRDX(%rdx), %rdx
/* End FDE here, we fall into another context. */
cfi_endproc
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigaction.c b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
index 71ac05c4bc..4e6d9cc32e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sigaction.c
+++ b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
@@ -1,5 +1,5 @@
/* POSIX.1 `sigaction' call for Linux/x86-64.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software 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,65 +16,20 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <errno.h>
-#include <stddef.h>
#include <signal.h>
-#include <string.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* The difference here is that the sigaction structure used in the
- kernel is not the same as we use in the libc. Therefore we must
- translate it here. */
-#include <kernel_sigaction.h>
-
-#include "ucontext_i.h"
-
-/* We do not globally define the SA_RESTORER flag so do it here. */
#define SA_RESTORER 0x04000000
+#include <kernel_sigaction.h>
-/* Using the hidden attribute here does not change the code but it
- helps to avoid warnings. */
extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
+#define SET_SA_RESTORER(kact, act) \
+ (kact)->sa_flags = (act)->sa_flags | SA_RESTORER; \
+ (kact)->sa_restorer = &restore_rt
-/* If ACT is not NULL, change the action for SIG to *ACT.
- If OACT is not NULL, put the old action for SIG in *OACT. */
-int
-__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
-{
- int result;
- struct kernel_sigaction kact, koact;
-
- if (act)
- {
- kact.k_sa_handler = act->sa_handler;
- memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
- kact.sa_flags = act->sa_flags | SA_RESTORER;
-
- kact.sa_restorer = &restore_rt;
- }
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- result = INLINE_SYSCALL (rt_sigaction, 4,
- sig, act ? &kact : NULL,
- oact ? &koact : NULL, _NSIG / 8);
- if (oact && result >= 0)
- {
- oact->sa_handler = koact.k_sa_handler;
- memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
- oact->sa_flags = koact.sa_flags;
- oact->sa_restorer = koact.sa_restorer;
- }
- return result;
-}
-libc_hidden_def (__libc_sigaction)
-
-#include <nptl/sigaction.c>
+#define RESET_SA_RESTORER(act, kact) \
+ (act)->sa_restorer = (kact)->sa_restorer
+#include <sysdeps/unix/sysv/linux/sigaction.c>
/* NOTE: Please think twice before making any changes to the bits of
code below. GDB needs some intimate knowledge about it to
@@ -93,6 +48,8 @@ libc_hidden_def (__libc_sigaction)
a bit tricky. We don't use the gas cfi directives, so that we can
reliably add .cfi_signal_frame. */
+#include "ucontext_i.h"
+
#define do_cfa_expr \
" .byte 0x0f\n" /* DW_CFA_def_cfa_expression */ \
" .uleb128 2f-1f\n" /* length */ \
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h b/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h
index a02ef3bfdb..165d6b0ead 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software 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,14 +17,6 @@
#include <stdint.h>
-#define SIGCONTEXT siginfo_t *_si, struct ucontext *
-#define SIGCONTEXT_EXTRA_ARGS _si,
+#define SIGCONTEXT siginfo_t *_si, ucontext_t *
#define GET_PC(ctx) \
((void *) (uintptr_t) (ctx)->uc_mcontext.gregs[REG_RIP])
-#define GET_FRAME(ctx) \
- ((void *) (uintptr_t) (ctx)->uc_mcontext.gregs[REG_RBP])
-#define GET_STACK(ctx) \
- ((void *) (uintptr_t) (ctx)->uc_mcontext.gregs[REG_RSP])
-
-#define CALL_SIGHANDLER(handler, signo, ctx) \
- (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigpending.c b/sysdeps/unix/sysv/linux/x86_64/sigpending.c
deleted file mode 100644
index 060d56bba1..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/sigpending.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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/>. */
-
-/* Linux/x86_64 only has rt signals, thus we do not even want to try falling
- back to the old style signals as the default Linux handler does. */
-
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Change the set of blocked signals to SET,
- wait until a signal arrives, and restore the set of blocked signals. */
-int
-sigpending (sigset_t *set)
-{
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
-}
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c b/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
index 2b8651755f..dee282947f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
@@ -35,4 +35,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
real size of the user-level sigset_t. */
return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
+libc_hidden_def (__sigprocmask)
weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/x86_64/swapcontext.S b/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
index b201244933..92d3371807 100644
--- a/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <asm/prctl.h>
#include "ucontext_i.h"
@@ -67,6 +68,7 @@ ENTRY(__swapcontext)
/* The syscall destroys some registers, save them. */
movq %rsi, %r12
+ movq %rdi, %r9
/* Save the current signal mask and install the new one with
rt_sigprocmask (SIG_BLOCK, newset, oldset,_NSIG/8). */
@@ -79,38 +81,167 @@ ENTRY(__swapcontext)
cmpq $-4095, %rax /* Check %rax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
- /* Restore destroyed registers. */
- movq %r12, %rsi
+ /* Restore destroyed register into RDX. The choice is arbitrary,
+ but leaving RDI and RSI available for use later can avoid
+ shuffling values. */
+ movq %r12, %rdx
/* Restore the floating-point context. Not the registers, only the
rest. */
- movq oFPREGS(%rsi), %rcx
+ movq oFPREGS(%rdx), %rcx
fldenv (%rcx)
- ldmxcsr oMXCSR(%rsi)
+ ldmxcsr oMXCSR(%rdx)
/* Load the new stack pointer and the preserved registers. */
- movq oRSP(%rsi), %rsp
- movq oRBX(%rsi), %rbx
- movq oRBP(%rsi), %rbp
- movq oR12(%rsi), %r12
- movq oR13(%rsi), %r13
- movq oR14(%rsi), %r14
- movq oR15(%rsi), %r15
+ movq oRSP(%rdx), %rsp
+ movq oRBX(%rdx), %rbx
+ movq oRBP(%rdx), %rbp
+ movq oR12(%rdx), %r12
+ movq oR13(%rdx), %r13
+ movq oR14(%rdx), %r14
+ movq oR15(%rdx), %r15
+
+#if SHSTK_ENABLED
+ /* Check if shadow stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %fs:FEATURE_1_OFFSET
+ jz L(no_shstk)
+ xorl %eax, %eax
+ cmpq %fs:SSP_BASE_OFFSET, %rax
+ jnz L(shadow_stack_bound_recorded)
+
+ /* Get the base address and size of the default shadow stack
+ which must be the current shadow stack since nothing has
+ been recorded yet. */
+ sub $24, %RSP_LP
+ mov %RSP_LP, %RSI_LP
+ movl $ARCH_CET_STATUS, %edi
+ movl $__NR_arch_prctl, %eax
+ syscall
+ testq %rax, %rax
+ jz L(continue_no_err)
+
+ /* This should never happen. */
+ hlt
+
+L(continue_no_err):
+ /* Record the base of the current shadow stack. */
+ movq 8(%rsp), %rax
+ movq %rax, %fs:SSP_BASE_OFFSET
+ add $24, %RSP_LP
+
+L(shadow_stack_bound_recorded):
+ /* If we unwind the stack, we can't undo stack unwinding. Just
+ save the target shadow stack pointer as the current shadow
+ stack pointer. */
+ movq oSSP(%rdx), %rcx
+ movq %rcx, oSSP(%r9)
+
+ /* Save the base of the current shadow stack. */
+ movq %fs:SSP_BASE_OFFSET, %rax
+ movq %rax, (oSSP + 8)(%r9)
+
+ /* If the base of the target shadow stack is the same as the
+ base of the current shadow stack, we unwind the shadow
+ stack. Otherwise it is a stack switch and we look for a
+ restore token. */
+ movq oSSP(%rdx), %rsi
+ movq %rsi, %rdi
+
+ /* Get the base of the target shadow stack. */
+ movq (oSSP + 8)(%rdx), %rcx
+ cmpq %fs:SSP_BASE_OFFSET, %rcx
+ je L(unwind_shadow_stack)
+
+L(find_restore_token_loop):
+ /* Look for a restore token. */
+ movq -8(%rsi), %rax
+ andq $-8, %rax
+ cmpq %rsi, %rax
+ je L(restore_shadow_stack)
+
+ /* Try the next slot. */
+ subq $8, %rsi
+ jmp L(find_restore_token_loop)
+
+L(restore_shadow_stack):
+ /* The target shadow stack will be restored. Save the current
+ shadow stack pointer. */
+ rdsspq %rcx
+ movq %rcx, oSSP(%r9)
+
+ /* Restore the target shadow stack. */
+ rstorssp -8(%rsi)
+
+ /* Save the restore token on the old shadow stack. NB: This
+ restore token may be checked by setcontext or swapcontext
+ later. */
+ saveprevssp
+
+ /* Record the new shadow stack base that was switched to. */
+ movq (oSSP + 8)(%rdx), %rax
+ movq %rax, %fs:SSP_BASE_OFFSET
+
+L(unwind_shadow_stack):
+ rdsspq %rcx
+ subq %rdi, %rcx
+ je L(skip_unwind_shadow_stack)
+ negq %rcx
+ shrq $3, %rcx
+ movl $255, %esi
+L(loop):
+ cmpq %rsi, %rcx
+ cmovb %rcx, %rsi
+ incsspq %rsi
+ subq %rsi, %rcx
+ ja L(loop)
+
+L(skip_unwind_shadow_stack):
+ /* Setup registers used for passing args. */
+ movq oRDI(%rdx), %rdi
+ movq oRSI(%rdx), %rsi
+ movq oRCX(%rdx), %rcx
+ movq oR8(%rdx), %r8
+ movq oR9(%rdx), %r9
+
+ /* Get the return address set with getcontext. */
+ movq oRIP(%rdx), %r10
+
+ /* Setup finally %rdx. */
+ movq oRDX(%rdx), %rdx
+
+ /* Check if return address is valid for the case when setcontext
+ is invoked from __start_context with linked context. */
+ rdsspq %rax
+ cmpq (%rax), %r10
+ /* Clear rax to indicate success. NB: Don't use xorl to keep
+ EFLAGS for jne. */
+ movl $0, %eax
+ jne L(jmp)
+ /* Return to the new context if return address valid. */
+ pushq %r10
+ ret
+
+L(jmp):
+ /* Jump to the new context directly. */
+ jmp *%r10
+
+L(no_shstk):
+#endif
/* The following ret should return to the address set with
getcontext. Therefore push the address on the stack. */
- movq oRIP(%rsi), %rcx
+ movq oRIP(%rdx), %rcx
pushq %rcx
/* Setup registers used for passing args. */
- movq oRDI(%rsi), %rdi
- movq oRDX(%rsi), %rdx
- movq oRCX(%rsi), %rcx
- movq oR8(%rsi), %r8
- movq oR9(%rsi), %r9
-
- /* Setup finally %rsi. */
- movq oRSI(%rsi), %rsi
+ movq oRDI(%rdx), %rdi
+ movq oRSI(%rdx), %rsi
+ movq oRCX(%rdx), %rcx
+ movq oR8(%rdx), %r8
+ movq oR9(%rdx), %r9
+
+ /* Setup finally %rdx. */
+ movq oRDX(%rdx), %rdx
/* Clear rax to indicate success. */
xorl %eax, %eax
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscall.S b/sysdeps/unix/sysv/linux/x86_64/syscall.S
index 62437a1cca..df63874e93 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscall.S
+++ b/sysdeps/unix/sysv/linux/x86_64/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index 2e4135f50a..d46524eff3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -2,33 +2,15 @@
arch_prctl EXTRA arch_prctl i:ii __arch_prctl arch_prctl
modify_ldt EXTRA modify_ldt i:ipi __modify_ldt modify_ldt
-msgctl - msgctl i:iip __msgctl msgctl
-msgget - msgget i:ii __msgget msgget
-msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
-msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
-shmat - shmat i:ipi __shmat shmat
-shmctl - shmctl i:iip __shmctl shmctl
-shmdt - shmdt i:s __shmdt shmdt
-shmget - shmget i:iii __shmget shmget
-semop - semop i:ipi __semop semop
-semtimedop - semtimedop i:ipip semtimedop
-semget - semget i:iii __semget semget
-semctl - semctl i:iiii __semctl semctl
syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime
# proper socket implementations:
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
-connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
-recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom
-recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg
-sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg
-sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
deleted file mode 100644
index 6f0e01fe20..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@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 <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
-
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-
-/* The code to disable cancellation depends on the fact that the called
- functions are special. They don't modify registers other than %rax
- and %r11 if they return. Therefore we don't have to preserve other
- registers around these calls. */
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY (name) \
- SINGLE_THREAD_P; \
- jne L(pseudo_cancel); \
- .type __##syscall_name##_nocancel,@function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- DO_CALL (syscall_name, args); \
- cmpq $-4095, %rax; \
- jae SYSCALL_ERROR_LABEL; \
- ret; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
- L(pseudo_cancel): \
- /* We always have to align the stack before calling a function. */ \
- subq $8, %rsp; cfi_adjust_cfa_offset (8); \
- CENABLE \
- /* The return value from CENABLE is argument for CDISABLE. */ \
- movq %rax, (%rsp); \
- DO_CALL (syscall_name, args); \
- movq (%rsp), %rdi; \
- /* Save %rax since it's the error code from the syscall. */ \
- movq %rax, %rdx; \
- CDISABLE \
- movq %rdx, %rax; \
- addq $8,%rsp; cfi_adjust_cfa_offset (-8); \
- cmpq $-4095, %rax; \
- jae SYSCALL_ERROR_LABEL
-
-
-# if IS_IN (libpthread)
-# define CENABLE call __pthread_enable_asynccancel;
-# define CDISABLE call __pthread_disable_asynccancel;
-# define __local_multiple_threads __pthread_multiple_threads
-# elif IS_IN (libc)
-# define CENABLE call __libc_enable_asynccancel;
-# define CDISABLE call __libc_disable_asynccancel;
-# define __local_multiple_threads __libc_multiple_threads
-# elif IS_IN (librt)
-# define CENABLE call __librt_enable_asynccancel;
-# define CDISABLE call __librt_disable_asynccancel;
-# else
-# error Unsupported library
-# endif
-
-# if IS_IN (libpthread) || IS_IN (libc)
-# ifndef __ASSEMBLER__
-extern int __local_multiple_threads attribute_hidden;
-# define SINGLE_THREAD_P \
- __builtin_expect (__local_multiple_threads == 0, 1)
-# else
-# define SINGLE_THREAD_P cmpl $0, __local_multiple_threads(%rip)
-# endif
-
-# else
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P cmpl $0, %fs:MULTIPLE_THREADS_OFFSET
-# endif
-
-# endif
-
-#elif !defined __ASSEMBLER__
-
-# define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
-
-#endif
-
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.S b/sysdeps/unix/sysv/linux/x86_64/sysdep.S
index 24d9b50ecc..756376f853 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.S
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index d023d68174..f07eb04962 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,9 +23,8 @@
#include <sysdeps/unix/x86_64/sysdep.h>
#include <tls.h>
-#if IS_IN (rtld)
-# include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */
-#endif
+/* Defines RTLD_PRIVATE_ERRNO. */
+#include <dl-sysdep.h>
/* For Linux we can use the system call table in the header file
/usr/include/asm/unistd.h
@@ -110,7 +109,7 @@
# define ret_ERRVAL ret
-# if defined PIC && defined RTLD_PRIVATE_ERRNO
+# if defined PIC && RTLD_PRIVATE_ERRNO
# define SYSCALL_SET_ERRNO \
lea rtld_errno(%rip), %RCX_LP; \
neg %eax; \
@@ -221,33 +220,148 @@
/* Registers clobbered by syscall. */
# define REGISTERS_CLOBBERED_BY_SYSCALL "cc", "r11", "cx"
-# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
- ({ \
- unsigned long int resultvar; \
- LOAD_ARGS_##nr (args) \
- LOAD_REGS_##nr \
- asm volatile ( \
- "syscall\n\t" \
- : "=a" (resultvar) \
- : "0" (name) ASM_ARGS_##nr : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
- (long int) resultvar; })
-# undef INTERNAL_SYSCALL
-# define INTERNAL_SYSCALL(name, err, nr, args...) \
- INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
-
-# define INTERNAL_SYSCALL_NCS_TYPES(name, err, nr, args...) \
- ({ \
- unsigned long int resultvar; \
- LOAD_ARGS_TYPES_##nr (args) \
- LOAD_REGS_TYPES_##nr (args) \
- asm volatile ( \
- "syscall\n\t" \
- : "=a" (resultvar) \
- : "0" (name) ASM_ARGS_##nr : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
- (long int) resultvar; })
-# undef INTERNAL_SYSCALL_TYPES
-# define INTERNAL_SYSCALL_TYPES(name, err, nr, args...) \
- INTERNAL_SYSCALL_NCS_TYPES (__NR_##name, err, nr, ##args)
+/* Create a variable 'name' based on type 'X' to avoid explicit types.
+ This is mainly used set use 64-bits arguments in x32. */
+#define TYPEFY(X, name) __typeof__ ((X) - (X)) name
+/* Explicit cast the argument to avoid integer from pointer warning on
+ x32. */
+#define ARGIFY(X) ((__typeof__ ((X) - (X))) (X))
+
+#undef INTERNAL_SYSCALL
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ internal_syscall##nr (SYS_ify (name), err, args)
+
+#undef INTERNAL_SYSCALL_NCS
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ internal_syscall##nr (number, err, args)
+
+#undef internal_syscall0
+#define internal_syscall0(number, err, dummy...) \
+({ \
+ unsigned long int resultvar; \
+ asm volatile ( \
+ "syscall\n\t" \
+ : "=a" (resultvar) \
+ : "0" (number) \
+ : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
+ (long int) resultvar; \
+})
+
+#undef internal_syscall1
+#define internal_syscall1(number, err, arg1) \
+({ \
+ unsigned long int resultvar; \
+ TYPEFY (arg1, __arg1) = ARGIFY (arg1); \
+ register TYPEFY (arg1, _a1) asm ("rdi") = __arg1; \
+ asm volatile ( \
+ "syscall\n\t" \
+ : "=a" (resultvar) \
+ : "0" (number), "r" (_a1) \
+ : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
+ (long int) resultvar; \
+})
+
+#undef internal_syscall2
+#define internal_syscall2(number, err, arg1, arg2) \
+({ \
+ unsigned long int resultvar; \
+ TYPEFY (arg2, __arg2) = ARGIFY (arg2); \
+ TYPEFY (arg1, __arg1) = ARGIFY (arg1); \
+ register TYPEFY (arg2, _a2) asm ("rsi") = __arg2; \
+ register TYPEFY (arg1, _a1) asm ("rdi") = __arg1; \
+ asm volatile ( \
+ "syscall\n\t" \
+ : "=a" (resultvar) \
+ : "0" (number), "r" (_a1), "r" (_a2) \
+ : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
+ (long int) resultvar; \
+})
+
+#undef internal_syscall3
+#define internal_syscall3(number, err, arg1, arg2, arg3) \
+({ \
+ unsigned long int resultvar; \
+ TYPEFY (arg3, __arg3) = ARGIFY (arg3); \
+ TYPEFY (arg2, __arg2) = ARGIFY (arg2); \
+ TYPEFY (arg1, __arg1) = ARGIFY (arg1); \
+ register TYPEFY (arg3, _a3) asm ("rdx") = __arg3; \
+ register TYPEFY (arg2, _a2) asm ("rsi") = __arg2; \
+ register TYPEFY (arg1, _a1) asm ("rdi") = __arg1; \
+ asm volatile ( \
+ "syscall\n\t" \
+ : "=a" (resultvar) \
+ : "0" (number), "r" (_a1), "r" (_a2), "r" (_a3) \
+ : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
+ (long int) resultvar; \
+})
+
+#undef internal_syscall4
+#define internal_syscall4(number, err, arg1, arg2, arg3, arg4) \
+({ \
+ unsigned long int resultvar; \
+ TYPEFY (arg4, __arg4) = ARGIFY (arg4); \
+ TYPEFY (arg3, __arg3) = ARGIFY (arg3); \
+ TYPEFY (arg2, __arg2) = ARGIFY (arg2); \
+ TYPEFY (arg1, __arg1) = ARGIFY (arg1); \
+ register TYPEFY (arg4, _a4) asm ("r10") = __arg4; \
+ register TYPEFY (arg3, _a3) asm ("rdx") = __arg3; \
+ register TYPEFY (arg2, _a2) asm ("rsi") = __arg2; \
+ register TYPEFY (arg1, _a1) asm ("rdi") = __arg1; \
+ asm volatile ( \
+ "syscall\n\t" \
+ : "=a" (resultvar) \
+ : "0" (number), "r" (_a1), "r" (_a2), "r" (_a3), "r" (_a4) \
+ : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
+ (long int) resultvar; \
+})
+
+#undef internal_syscall5
+#define internal_syscall5(number, err, arg1, arg2, arg3, arg4, arg5) \
+({ \
+ unsigned long int resultvar; \
+ TYPEFY (arg5, __arg5) = ARGIFY (arg5); \
+ TYPEFY (arg4, __arg4) = ARGIFY (arg4); \
+ TYPEFY (arg3, __arg3) = ARGIFY (arg3); \
+ TYPEFY (arg2, __arg2) = ARGIFY (arg2); \
+ TYPEFY (arg1, __arg1) = ARGIFY (arg1); \
+ register TYPEFY (arg5, _a5) asm ("r8") = __arg5; \
+ register TYPEFY (arg4, _a4) asm ("r10") = __arg4; \
+ register TYPEFY (arg3, _a3) asm ("rdx") = __arg3; \
+ register TYPEFY (arg2, _a2) asm ("rsi") = __arg2; \
+ register TYPEFY (arg1, _a1) asm ("rdi") = __arg1; \
+ asm volatile ( \
+ "syscall\n\t" \
+ : "=a" (resultvar) \
+ : "0" (number), "r" (_a1), "r" (_a2), "r" (_a3), "r" (_a4), \
+ "r" (_a5) \
+ : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
+ (long int) resultvar; \
+})
+
+#undef internal_syscall6
+#define internal_syscall6(number, err, arg1, arg2, arg3, arg4, arg5, arg6) \
+({ \
+ unsigned long int resultvar; \
+ TYPEFY (arg6, __arg6) = ARGIFY (arg6); \
+ TYPEFY (arg5, __arg5) = ARGIFY (arg5); \
+ TYPEFY (arg4, __arg4) = ARGIFY (arg4); \
+ TYPEFY (arg3, __arg3) = ARGIFY (arg3); \
+ TYPEFY (arg2, __arg2) = ARGIFY (arg2); \
+ TYPEFY (arg1, __arg1) = ARGIFY (arg1); \
+ register TYPEFY (arg6, _a6) asm ("r9") = __arg6; \
+ register TYPEFY (arg5, _a5) asm ("r8") = __arg5; \
+ register TYPEFY (arg4, _a4) asm ("r10") = __arg4; \
+ register TYPEFY (arg3, _a3) asm ("rdx") = __arg3; \
+ register TYPEFY (arg2, _a2) asm ("rsi") = __arg2; \
+ register TYPEFY (arg1, _a1) asm ("rdi") = __arg1; \
+ asm volatile ( \
+ "syscall\n\t" \
+ : "=a" (resultvar) \
+ : "0" (number), "r" (_a1), "r" (_a2), "r" (_a3), "r" (_a4), \
+ "r" (_a5), "r" (_a6) \
+ : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
+ (long int) resultvar; \
+})
# undef INTERNAL_SYSCALL_ERROR_P
# define INTERNAL_SYSCALL_ERROR_P(val, err) \
@@ -261,87 +375,7 @@
# define HAVE_GETTIMEOFDAY_VSYSCALL 1
# define HAVE_GETCPU_VSYSCALL 1
-# define LOAD_ARGS_0()
-# define LOAD_REGS_0
-# define ASM_ARGS_0
-
-# define LOAD_ARGS_TYPES_1(t1, a1) \
- t1 __arg1 = (t1) (a1); \
- LOAD_ARGS_0 ()
-# define LOAD_REGS_TYPES_1(t1, a1) \
- register t1 _a1 asm ("rdi") = __arg1; \
- LOAD_REGS_0
-# define ASM_ARGS_1 ASM_ARGS_0, "r" (_a1)
-# define LOAD_ARGS_1(a1) \
- LOAD_ARGS_TYPES_1 (long int, a1)
-# define LOAD_REGS_1 \
- LOAD_REGS_TYPES_1 (long int, a1)
-
-# define LOAD_ARGS_TYPES_2(t1, a1, t2, a2) \
- t2 __arg2 = (t2) (a2); \
- LOAD_ARGS_TYPES_1 (t1, a1)
-# define LOAD_REGS_TYPES_2(t1, a1, t2, a2) \
- register t2 _a2 asm ("rsi") = __arg2; \
- LOAD_REGS_TYPES_1(t1, a1)
-# define ASM_ARGS_2 ASM_ARGS_1, "r" (_a2)
-# define LOAD_ARGS_2(a1, a2) \
- LOAD_ARGS_TYPES_2 (long int, a1, long int, a2)
-# define LOAD_REGS_2 \
- LOAD_REGS_TYPES_2 (long int, a1, long int, a2)
-
-# define LOAD_ARGS_TYPES_3(t1, a1, t2, a2, t3, a3) \
- t3 __arg3 = (t3) (a3); \
- LOAD_ARGS_TYPES_2 (t1, a1, t2, a2)
-# define LOAD_REGS_TYPES_3(t1, a1, t2, a2, t3, a3) \
- register t3 _a3 asm ("rdx") = __arg3; \
- LOAD_REGS_TYPES_2(t1, a1, t2, a2)
-# define ASM_ARGS_3 ASM_ARGS_2, "r" (_a3)
-# define LOAD_ARGS_3(a1, a2, a3) \
- LOAD_ARGS_TYPES_3 (long int, a1, long int, a2, long int, a3)
-# define LOAD_REGS_3 \
- LOAD_REGS_TYPES_3 (long int, a1, long int, a2, long int, a3)
-
-# define LOAD_ARGS_TYPES_4(t1, a1, t2, a2, t3, a3, t4, a4) \
- t4 __arg4 = (t4) (a4); \
- LOAD_ARGS_TYPES_3 (t1, a1, t2, a2, t3, a3)
-# define LOAD_REGS_TYPES_4(t1, a1, t2, a2, t3, a3, t4, a4) \
- register t4 _a4 asm ("r10") = __arg4; \
- LOAD_REGS_TYPES_3(t1, a2, t2, a2, t3, a3)
-# define ASM_ARGS_4 ASM_ARGS_3, "r" (_a4)
-# define LOAD_ARGS_4(a1, a2, a3, a4) \
- LOAD_ARGS_TYPES_4 (long int, a1, long int, a2, long int, a3, \
- long int, a4)
-# define LOAD_REGS_4 \
- LOAD_REGS_TYPES_4 (long int, a1, long int, a2, long int, a3, \
- long int, a4)
-
-# define LOAD_ARGS_TYPES_5(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5) \
- t5 __arg5 = (t5) (a5); \
- LOAD_ARGS_TYPES_4 (t1, a1, t2, a2, t3, a3, t4, a4)
-# define LOAD_REGS_TYPES_5(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5) \
- register t5 _a5 asm ("r8") = __arg5; \
- LOAD_REGS_TYPES_4 (t1, a1, t2, a2, t3, a3, t4, a4)
-# define ASM_ARGS_5 ASM_ARGS_4, "r" (_a5)
-# define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
- LOAD_ARGS_TYPES_5 (long int, a1, long int, a2, long int, a3, \
- long int, a4, long int, a5)
-# define LOAD_REGS_5 \
- LOAD_REGS_TYPES_5 (long int, a1, long int, a2, long int, a3, \
- long int, a4, long int, a5)
-
-# define LOAD_ARGS_TYPES_6(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5, t6, a6) \
- t6 __arg6 = (t6) (a6); \
- LOAD_ARGS_TYPES_5 (t1, a1, t2, a2, t3, a3, t4, a4, t5, a5)
-# define LOAD_REGS_TYPES_6(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5, t6, a6) \
- register t6 _a6 asm ("r9") = __arg6; \
- LOAD_REGS_TYPES_5 (t1, a1, t2, a2, t3, a3, t4, a4, t5, a5)
-# define ASM_ARGS_6 ASM_ARGS_5, "r" (_a6)
-# define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
- LOAD_ARGS_TYPES_6 (long int, a1, long int, a2, long int, a3, \
- long int, a4, long int, a5, long int, a6)
-# define LOAD_REGS_6 \
- LOAD_REGS_TYPES_6 (long int, a1, long int, a2, long int, a3, \
- long int, a4, long int, a5, long int, a6)
+# define SINGLE_THREAD_BY_GLOBAL 1
#endif /* __ASSEMBLER__ */
@@ -385,4 +419,13 @@
# endif
#endif
+/* How to pass the off{64}_t argument on p{readv,writev}{64}. */
+#undef LO_HI_LONG
+#define LO_HI_LONG(val) (val), 0
+
+/* Each shadow stack slot takes 8 bytes. Assuming that each stack
+ frame takes 256 bytes, this is used to compute shadow stack size
+ from stack size. */
+#define STACK_SIZE_TO_SHADOW_STACK_SIZE_SHIFT 5
+
#endif /* linux/x86_64/sysdep.h */
diff --git a/sysdeps/unix/sysv/linux/x86_64/timer_create.c b/sysdeps/unix/sysv/linux/x86_64/timer_create.c
index 43bcb4d4d0..b96b2b49d3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/timer_create.c
+++ b/sysdeps/unix/sysv/linux/x86_64/timer_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/x86_64/timer_delete.c b/sysdeps/unix/sysv/linux/x86_64/timer_delete.c
index 0ff932006d..f0fc3a4a78 100644
--- a/sysdeps/unix/sysv/linux/x86_64/timer_delete.c
+++ b/sysdeps/unix/sysv/linux/x86_64/timer_delete.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c b/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c
index 5a06d6700e..b027f56df3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c
+++ b/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c b/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
index 13cac45278..7730bc9447 100644
--- a/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
+++ b/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/x86_64/timer_settime.c b/sysdeps/unix/sysv/linux/x86_64/timer_settime.c
index b4a64dfbc8..26178a8020 100644
--- a/sysdeps/unix/sysv/linux/x86_64/timer_settime.c
+++ b/sysdeps/unix/sysv/linux/x86_64/timer_settime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
diff --git a/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym b/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym
index af3e0e544b..c08b3b8b47 100644
--- a/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym
+++ b/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym
@@ -35,3 +35,4 @@ oFPREGS mcontext (fpregs)
oSIGMASK ucontext (uc_sigmask)
oFPREGSMEM ucontext (__fpregs_mem)
oMXCSR ucontext (__fpregs_mem.mxcsr)
+oSSP ucontext (__ssp)
diff --git a/sysdeps/unix/sysv/linux/x86_64/umount.c b/sysdeps/unix/sysv/linux/x86_64/umount.c
deleted file mode 100644
index e6b78afbef..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/umount.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Huggins-Daines <dhd@debian.org>, 2000.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License 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/>. */
-
-/* Since we don't have an oldumount system call, do what the kernel
- does down here. */
-
-extern long int __umount2 (const char *name, int flags);
-
-long int
-__umount (const char *name)
-{
- return __umount2 (name, 0);
-}
-
-weak_alias (__umount, umount);
diff --git a/sysdeps/unix/sysv/linux/x86_64/vfork.S b/sysdeps/unix/sysv/linux/x86_64/vfork.S
index 8332ade9fb..8f1ca9f836 100644
--- a/sysdeps/unix/sysv/linux/x86_64/vfork.S
+++ b/sysdeps/unix/sysv/linux/x86_64/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,21 @@
#include <bits/errno.h>
#include <tcb-offsets.h>
+#if SHSTK_ENABLED
+/* The shadow stack prevents us from pushing the saved return PC onto
+ the stack and returning normally. Instead we pop the shadow stack
+ and return directly. This is the safest way to return and ensures
+ any stack manipulations done by the vfork'd child doesn't cause the
+ parent to terminate when CET is enabled. */
+# undef SYSCALL_ERROR_HANDLER
+# define SYSCALL_ERROR_HANDLER \
+0: \
+ SYSCALL_SET_ERRNO; \
+ or $-1, %RAX_LP; \
+ jmp 1b;
+# undef SYSCALL_ERROR_LABEL
+# define SYSCALL_ERROR_LABEL 0f
+#endif
/* Clone the calling process, but without copying the whole address space.
The calling process is suspended until the new process exits or is
@@ -34,35 +49,40 @@ ENTRY (__vfork)
cfi_adjust_cfa_offset(-8)
cfi_register(%rip, %rdi)
- /* Save the TCB-cached PID away in %esi, and then negate the TCB
- field. But if it's zero, set it to 0x80000000 instead. See
- raise.c for the logic that relies on this value. */
- movl %fs:PID, %esi
- movl $0x80000000, %ecx
- movl %esi, %edx
- negl %edx
- cmove %ecx, %edx
- movl %edx, %fs:PID
-
/* Stuff the syscall number in RAX and enter into the kernel. */
movl $SYS_ify (vfork), %eax
syscall
+#if !SHSTK_ENABLED
/* Push back the return PC. */
pushq %rdi
cfi_adjust_cfa_offset(8)
-
- /* Restore the original value of the TCB cache of the PID, if we're
- the parent. But in the child (syscall return value equals zero),
- leave things as they are. */
- testq %rax, %rax
- je 1f
- movl %esi, %fs:PID
-1:
+#endif
cmpl $-4095, %eax
jae SYSCALL_ERROR_LABEL /* Branch forward if it failed. */
+#if SHSTK_ENABLED
+1:
+ /* Check if shadow stack is in use. */
+ xorl %esi, %esi
+ rdsspq %rsi
+ testq %rsi, %rsi
+ /* Normal return if shadow stack isn't in use. */
+ je L(no_shstk)
+
+ /* Pop return address from shadow stack and jump back to caller
+ directly. */
+ movl $1, %esi
+ incsspq %rsi
+ jmp *%rdi
+
+L(no_shstk):
+ /* Push back the return PC. */
+ pushq %rdi
+ cfi_adjust_cfa_offset(8)
+#endif
+
/* Normal return. */
ret
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/Makefile b/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
index 8c3253bc90..16b768d8ba 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
@@ -4,3 +4,8 @@ default-abi := x32
ifeq ($(subdir),misc)
sysdep_routines += arch_prctl
endif
+
+ifeq ($(subdir),conform)
+# For bugs 16437 and 21279.
+conformtest-xfail-conds += x86_64-x32-linux
+endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c b/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c
index 6a4379c8d8..86328814c5 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c
@@ -1,5 +1,5 @@
/* arch_prctl call for Linux/x32.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/configure b/sysdeps/unix/sysv/linux/x86_64/x32/configure
index 1417da4785..4837a308ce 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/configure
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/configure
@@ -6,8 +6,8 @@ arch_minimum_kernel=3.4.0
test -n "$libc_cv_slibdir" ||
case "$prefix" in
/usr | /usr/)
- libc_cv_slibdir=/libx32
- libc_cv_rtlddir=/libx32
+ libc_cv_slibdir='/libx32'
+ libc_cv_rtlddir='/libx32'
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/libx32';
# Locale data can be shared between 32-bit and 64-bit libraries.
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/dl-cache.h b/sysdeps/unix/sysv/linux/x86_64/x32/dl-cache.h
index 457e97c1eb..8f28509b2d 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/dl-cache.h
@@ -1,5 +1,5 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/getcpu.c b/sysdeps/unix/sysv/linux/x86_64/x32/getcpu.c
deleted file mode 100644
index cbac4b3273..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/x32/getcpu.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 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/>. */
-
-#ifdef SHARED
-# include <dl-vdso.h>
-
-void *getcpu_ifunc (void) __asm__ ("__getcpu");
-
-void *
-getcpu_ifunc (void)
-{
- PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
-
- return _dl_vdso_vsym ("__vdso_getcpu", &linux26);
-}
-__asm (".type __getcpu, %gnu_indirect_function");
-#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/glob.c b/sysdeps/unix/sysv/linux/x86_64/x32/glob.c
deleted file mode 100644
index e5427475f6..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/x32/glob.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/wordsize-64/glob.c>
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h
new file mode 100644
index 0000000000..2fa8e9ec38
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 200
+#define SIGJMP_BUF_SIZE 200
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 64
+#define SAVED_MASK_OFFSET 68
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
index d595038b2b..80f3161586 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
@@ -1,5 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
-GLIBC_2.16 __libc_memalign F
GLIBC_2.16 __libc_stack_end D 0x4
GLIBC_2.16 __tls_get_addr F
GLIBC_2.16 _dl_mcount F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libBrokenLocale.abilist
index 0c8f428e3b..6c9d9289b1 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libBrokenLocale.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libBrokenLocale.abilist
@@ -1,2 +1 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libanl.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libanl.abilist
index 695118b9d5..067013555a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libanl.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libanl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 gai_cancel F
GLIBC_2.16 gai_error F
GLIBC_2.16 gai_suspend F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 04dc8e4520..6fee16a850 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 _Exit F
GLIBC_2.16 _IO_2_1_stderr_ D 0xa0
GLIBC_2.16 _IO_2_1_stdin_ D 0xa0
@@ -2077,20 +2076,73 @@ GLIBC_2.16 xdrstdio_create F
GLIBC_2.16 xencrypt F
GLIBC_2.16 xprt_register F
GLIBC_2.16 xprt_unregister F
-GLIBC_2.17 GLIBC_2.17 A
GLIBC_2.17 clock_getcpuclockid F
GLIBC_2.17 clock_getres F
GLIBC_2.17 clock_gettime F
GLIBC_2.17 clock_nanosleep F
GLIBC_2.17 clock_settime F
GLIBC_2.17 secure_getenv F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __cxa_thread_atexit_impl F
-GLIBC_2.22 GLIBC_2.22 A
GLIBC_2.22 fmemopen F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 fts64_children F
GLIBC_2.23 fts64_close F
GLIBC_2.23 fts64_open F
GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.26 __strtof128_internal F
+GLIBC_2.26 __wcstof128_internal F
+GLIBC_2.26 preadv2 F
+GLIBC_2.26 preadv64v2 F
+GLIBC_2.26 pwritev2 F
+GLIBC_2.26 pwritev64v2 F
+GLIBC_2.26 reallocarray F
+GLIBC_2.26 strfromf128 F
+GLIBC_2.26 strtof128 F
+GLIBC_2.26 strtof128_l F
+GLIBC_2.26 wcstof128 F
+GLIBC_2.26 wcstof128_l F
+GLIBC_2.27 copy_file_range F
+GLIBC_2.27 glob F
+GLIBC_2.27 glob64 F
+GLIBC_2.27 memfd_create F
+GLIBC_2.27 mlock2 F
+GLIBC_2.27 pkey_alloc F
+GLIBC_2.27 pkey_free F
+GLIBC_2.27 pkey_get F
+GLIBC_2.27 pkey_mprotect F
+GLIBC_2.27 pkey_set F
+GLIBC_2.27 strfromf32 F
+GLIBC_2.27 strfromf32x F
+GLIBC_2.27 strfromf64 F
+GLIBC_2.27 strfromf64x F
+GLIBC_2.27 strtof32 F
+GLIBC_2.27 strtof32_l F
+GLIBC_2.27 strtof32x F
+GLIBC_2.27 strtof32x_l F
+GLIBC_2.27 strtof64 F
+GLIBC_2.27 strtof64_l F
+GLIBC_2.27 strtof64x F
+GLIBC_2.27 strtof64x_l F
+GLIBC_2.27 wcstof32 F
+GLIBC_2.27 wcstof32_l F
+GLIBC_2.27 wcstof32x F
+GLIBC_2.27 wcstof32x_l F
+GLIBC_2.27 wcstof64 F
+GLIBC_2.27 wcstof64_l F
+GLIBC_2.27 wcstof64x F
+GLIBC_2.27 wcstof64x_l F
+GLIBC_2.28 fcntl64 F
+GLIBC_2.28 renameat2 F
+GLIBC_2.28 statx F
+GLIBC_2.28 thrd_current F
+GLIBC_2.28 thrd_equal F
+GLIBC_2.28 thrd_sleep F
+GLIBC_2.28 thrd_yield F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libcrypt.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libcrypt.abilist
index d0f5c3b25d..5e9789b32e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libcrypt.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libcrypt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 crypt F
GLIBC_2.16 crypt_r F
GLIBC_2.16 encrypt F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libdl.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libdl.abilist
index e4d2e7935d..c947cd4375 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libdl.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libdl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 dladdr F
GLIBC_2.16 dladdr1 F
GLIBC_2.16 dlclose F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
index 168c0d87cf..f1fc0e9f4d 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 _LIB_VERSION D 0x4
GLIBC_2.16 __acos_finite F
GLIBC_2.16 __acosf_finite F
@@ -394,12 +393,676 @@ GLIBC_2.16 y1l F
GLIBC_2.16 yn F
GLIBC_2.16 ynf F
GLIBC_2.16 ynl F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 __issignaling F
GLIBC_2.18 __issignalingf F
GLIBC_2.18 __issignalingl F
-GLIBC_2.23 GLIBC_2.23 A
GLIBC_2.23 __signgam D 0x4
GLIBC_2.23 lgamma F
GLIBC_2.23 lgammaf F
GLIBC_2.23 lgammal F
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+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 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl 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.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.26 __acosf128_finite F
+GLIBC_2.26 __acoshf128_finite F
+GLIBC_2.26 __asinf128_finite F
+GLIBC_2.26 __atan2f128_finite F
+GLIBC_2.26 __atanhf128_finite F
+GLIBC_2.26 __coshf128_finite F
+GLIBC_2.26 __exp10f128_finite F
+GLIBC_2.26 __exp2f128_finite F
+GLIBC_2.26 __expf128_finite F
+GLIBC_2.26 __finitef128 F
+GLIBC_2.26 __fmodf128_finite F
+GLIBC_2.26 __fpclassifyf128 F
+GLIBC_2.26 __gammaf128_r_finite F
+GLIBC_2.26 __hypotf128_finite F
+GLIBC_2.26 __iseqsigf128 F
+GLIBC_2.26 __isinff128 F
+GLIBC_2.26 __isnanf128 F
+GLIBC_2.26 __issignalingf128 F
+GLIBC_2.26 __j0f128_finite F
+GLIBC_2.26 __j1f128_finite F
+GLIBC_2.26 __jnf128_finite F
+GLIBC_2.26 __lgammaf128_r_finite F
+GLIBC_2.26 __log10f128_finite F
+GLIBC_2.26 __log2f128_finite F
+GLIBC_2.26 __logf128_finite F
+GLIBC_2.26 __powf128_finite F
+GLIBC_2.26 __remainderf128_finite F
+GLIBC_2.26 __signbitf128 F
+GLIBC_2.26 __sinhf128_finite F
+GLIBC_2.26 __sqrtf128_finite F
+GLIBC_2.26 __y0f128_finite F
+GLIBC_2.26 __y1f128_finite F
+GLIBC_2.26 __ynf128_finite F
+GLIBC_2.26 acosf128 F
+GLIBC_2.26 acoshf128 F
+GLIBC_2.26 asinf128 F
+GLIBC_2.26 asinhf128 F
+GLIBC_2.26 atan2f128 F
+GLIBC_2.26 atanf128 F
+GLIBC_2.26 atanhf128 F
+GLIBC_2.26 cabsf128 F
+GLIBC_2.26 cacosf128 F
+GLIBC_2.26 cacoshf128 F
+GLIBC_2.26 canonicalizef128 F
+GLIBC_2.26 cargf128 F
+GLIBC_2.26 casinf128 F
+GLIBC_2.26 casinhf128 F
+GLIBC_2.26 catanf128 F
+GLIBC_2.26 catanhf128 F
+GLIBC_2.26 cbrtf128 F
+GLIBC_2.26 ccosf128 F
+GLIBC_2.26 ccoshf128 F
+GLIBC_2.26 ceilf128 F
+GLIBC_2.26 cexpf128 F
+GLIBC_2.26 cimagf128 F
+GLIBC_2.26 clog10f128 F
+GLIBC_2.26 clogf128 F
+GLIBC_2.26 conjf128 F
+GLIBC_2.26 copysignf128 F
+GLIBC_2.26 cosf128 F
+GLIBC_2.26 coshf128 F
+GLIBC_2.26 cpowf128 F
+GLIBC_2.26 cprojf128 F
+GLIBC_2.26 crealf128 F
+GLIBC_2.26 csinf128 F
+GLIBC_2.26 csinhf128 F
+GLIBC_2.26 csqrtf128 F
+GLIBC_2.26 ctanf128 F
+GLIBC_2.26 ctanhf128 F
+GLIBC_2.26 erfcf128 F
+GLIBC_2.26 erff128 F
+GLIBC_2.26 exp10f128 F
+GLIBC_2.26 exp2f128 F
+GLIBC_2.26 expf128 F
+GLIBC_2.26 expm1f128 F
+GLIBC_2.26 fabsf128 F
+GLIBC_2.26 fdimf128 F
+GLIBC_2.26 floorf128 F
+GLIBC_2.26 fmaf128 F
+GLIBC_2.26 fmaxf128 F
+GLIBC_2.26 fmaxmagf128 F
+GLIBC_2.26 fminf128 F
+GLIBC_2.26 fminmagf128 F
+GLIBC_2.26 fmodf128 F
+GLIBC_2.26 frexpf128 F
+GLIBC_2.26 fromfpf128 F
+GLIBC_2.26 fromfpxf128 F
+GLIBC_2.26 getpayloadf128 F
+GLIBC_2.26 hypotf128 F
+GLIBC_2.26 ilogbf128 F
+GLIBC_2.26 j0f128 F
+GLIBC_2.26 j1f128 F
+GLIBC_2.26 jnf128 F
+GLIBC_2.26 ldexpf128 F
+GLIBC_2.26 lgammaf128 F
+GLIBC_2.26 lgammaf128_r F
+GLIBC_2.26 llogbf128 F
+GLIBC_2.26 llrintf128 F
+GLIBC_2.26 llroundf128 F
+GLIBC_2.26 log10f128 F
+GLIBC_2.26 log1pf128 F
+GLIBC_2.26 log2f128 F
+GLIBC_2.26 logbf128 F
+GLIBC_2.26 logf128 F
+GLIBC_2.26 lrintf128 F
+GLIBC_2.26 lroundf128 F
+GLIBC_2.26 modff128 F
+GLIBC_2.26 nanf128 F
+GLIBC_2.26 nearbyintf128 F
+GLIBC_2.26 nextafterf128 F
+GLIBC_2.26 nextdownf128 F
+GLIBC_2.26 nextupf128 F
+GLIBC_2.26 powf128 F
+GLIBC_2.26 remainderf128 F
+GLIBC_2.26 remquof128 F
+GLIBC_2.26 rintf128 F
+GLIBC_2.26 roundevenf128 F
+GLIBC_2.26 roundf128 F
+GLIBC_2.26 scalblnf128 F
+GLIBC_2.26 scalbnf128 F
+GLIBC_2.26 setpayloadf128 F
+GLIBC_2.26 setpayloadsigf128 F
+GLIBC_2.26 sincosf128 F
+GLIBC_2.26 sinf128 F
+GLIBC_2.26 sinhf128 F
+GLIBC_2.26 sqrtf128 F
+GLIBC_2.26 tanf128 F
+GLIBC_2.26 tanhf128 F
+GLIBC_2.26 tgammaf128 F
+GLIBC_2.26 totalorderf128 F
+GLIBC_2.26 totalordermagf128 F
+GLIBC_2.26 truncf128 F
+GLIBC_2.26 ufromfpf128 F
+GLIBC_2.26 ufromfpxf128 F
+GLIBC_2.26 y0f128 F
+GLIBC_2.26 y1f128 F
+GLIBC_2.26 ynf128 F
+GLIBC_2.27 acosf32 F
+GLIBC_2.27 acosf32x F
+GLIBC_2.27 acosf64 F
+GLIBC_2.27 acosf64x F
+GLIBC_2.27 acoshf32 F
+GLIBC_2.27 acoshf32x F
+GLIBC_2.27 acoshf64 F
+GLIBC_2.27 acoshf64x F
+GLIBC_2.27 asinf32 F
+GLIBC_2.27 asinf32x F
+GLIBC_2.27 asinf64 F
+GLIBC_2.27 asinf64x F
+GLIBC_2.27 asinhf32 F
+GLIBC_2.27 asinhf32x F
+GLIBC_2.27 asinhf64 F
+GLIBC_2.27 asinhf64x F
+GLIBC_2.27 atan2f32 F
+GLIBC_2.27 atan2f32x F
+GLIBC_2.27 atan2f64 F
+GLIBC_2.27 atan2f64x F
+GLIBC_2.27 atanf32 F
+GLIBC_2.27 atanf32x F
+GLIBC_2.27 atanf64 F
+GLIBC_2.27 atanf64x F
+GLIBC_2.27 atanhf32 F
+GLIBC_2.27 atanhf32x F
+GLIBC_2.27 atanhf64 F
+GLIBC_2.27 atanhf64x F
+GLIBC_2.27 cabsf32 F
+GLIBC_2.27 cabsf32x F
+GLIBC_2.27 cabsf64 F
+GLIBC_2.27 cabsf64x F
+GLIBC_2.27 cacosf32 F
+GLIBC_2.27 cacosf32x F
+GLIBC_2.27 cacosf64 F
+GLIBC_2.27 cacosf64x F
+GLIBC_2.27 cacoshf32 F
+GLIBC_2.27 cacoshf32x F
+GLIBC_2.27 cacoshf64 F
+GLIBC_2.27 cacoshf64x F
+GLIBC_2.27 canonicalizef32 F
+GLIBC_2.27 canonicalizef32x F
+GLIBC_2.27 canonicalizef64 F
+GLIBC_2.27 canonicalizef64x F
+GLIBC_2.27 cargf32 F
+GLIBC_2.27 cargf32x F
+GLIBC_2.27 cargf64 F
+GLIBC_2.27 cargf64x F
+GLIBC_2.27 casinf32 F
+GLIBC_2.27 casinf32x F
+GLIBC_2.27 casinf64 F
+GLIBC_2.27 casinf64x F
+GLIBC_2.27 casinhf32 F
+GLIBC_2.27 casinhf32x F
+GLIBC_2.27 casinhf64 F
+GLIBC_2.27 casinhf64x F
+GLIBC_2.27 catanf32 F
+GLIBC_2.27 catanf32x F
+GLIBC_2.27 catanf64 F
+GLIBC_2.27 catanf64x F
+GLIBC_2.27 catanhf32 F
+GLIBC_2.27 catanhf32x F
+GLIBC_2.27 catanhf64 F
+GLIBC_2.27 catanhf64x F
+GLIBC_2.27 cbrtf32 F
+GLIBC_2.27 cbrtf32x F
+GLIBC_2.27 cbrtf64 F
+GLIBC_2.27 cbrtf64x F
+GLIBC_2.27 ccosf32 F
+GLIBC_2.27 ccosf32x F
+GLIBC_2.27 ccosf64 F
+GLIBC_2.27 ccosf64x F
+GLIBC_2.27 ccoshf32 F
+GLIBC_2.27 ccoshf32x F
+GLIBC_2.27 ccoshf64 F
+GLIBC_2.27 ccoshf64x F
+GLIBC_2.27 ceilf32 F
+GLIBC_2.27 ceilf32x F
+GLIBC_2.27 ceilf64 F
+GLIBC_2.27 ceilf64x F
+GLIBC_2.27 cexpf32 F
+GLIBC_2.27 cexpf32x F
+GLIBC_2.27 cexpf64 F
+GLIBC_2.27 cexpf64x F
+GLIBC_2.27 cimagf32 F
+GLIBC_2.27 cimagf32x F
+GLIBC_2.27 cimagf64 F
+GLIBC_2.27 cimagf64x F
+GLIBC_2.27 clog10f32 F
+GLIBC_2.27 clog10f32x F
+GLIBC_2.27 clog10f64 F
+GLIBC_2.27 clog10f64x F
+GLIBC_2.27 clogf32 F
+GLIBC_2.27 clogf32x F
+GLIBC_2.27 clogf64 F
+GLIBC_2.27 clogf64x F
+GLIBC_2.27 conjf32 F
+GLIBC_2.27 conjf32x F
+GLIBC_2.27 conjf64 F
+GLIBC_2.27 conjf64x F
+GLIBC_2.27 copysignf32 F
+GLIBC_2.27 copysignf32x F
+GLIBC_2.27 copysignf64 F
+GLIBC_2.27 copysignf64x F
+GLIBC_2.27 cosf32 F
+GLIBC_2.27 cosf32x F
+GLIBC_2.27 cosf64 F
+GLIBC_2.27 cosf64x F
+GLIBC_2.27 coshf32 F
+GLIBC_2.27 coshf32x F
+GLIBC_2.27 coshf64 F
+GLIBC_2.27 coshf64x F
+GLIBC_2.27 cpowf32 F
+GLIBC_2.27 cpowf32x F
+GLIBC_2.27 cpowf64 F
+GLIBC_2.27 cpowf64x F
+GLIBC_2.27 cprojf32 F
+GLIBC_2.27 cprojf32x F
+GLIBC_2.27 cprojf64 F
+GLIBC_2.27 cprojf64x F
+GLIBC_2.27 crealf32 F
+GLIBC_2.27 crealf32x F
+GLIBC_2.27 crealf64 F
+GLIBC_2.27 crealf64x F
+GLIBC_2.27 csinf32 F
+GLIBC_2.27 csinf32x F
+GLIBC_2.27 csinf64 F
+GLIBC_2.27 csinf64x F
+GLIBC_2.27 csinhf32 F
+GLIBC_2.27 csinhf32x F
+GLIBC_2.27 csinhf64 F
+GLIBC_2.27 csinhf64x F
+GLIBC_2.27 csqrtf32 F
+GLIBC_2.27 csqrtf32x F
+GLIBC_2.27 csqrtf64 F
+GLIBC_2.27 csqrtf64x F
+GLIBC_2.27 ctanf32 F
+GLIBC_2.27 ctanf32x F
+GLIBC_2.27 ctanf64 F
+GLIBC_2.27 ctanf64x F
+GLIBC_2.27 ctanhf32 F
+GLIBC_2.27 ctanhf32x F
+GLIBC_2.27 ctanhf64 F
+GLIBC_2.27 ctanhf64x F
+GLIBC_2.27 erfcf32 F
+GLIBC_2.27 erfcf32x F
+GLIBC_2.27 erfcf64 F
+GLIBC_2.27 erfcf64x F
+GLIBC_2.27 erff32 F
+GLIBC_2.27 erff32x F
+GLIBC_2.27 erff64 F
+GLIBC_2.27 erff64x F
+GLIBC_2.27 exp10f32 F
+GLIBC_2.27 exp10f32x F
+GLIBC_2.27 exp10f64 F
+GLIBC_2.27 exp10f64x F
+GLIBC_2.27 exp2f F
+GLIBC_2.27 exp2f32 F
+GLIBC_2.27 exp2f32x F
+GLIBC_2.27 exp2f64 F
+GLIBC_2.27 exp2f64x F
+GLIBC_2.27 expf F
+GLIBC_2.27 expf32 F
+GLIBC_2.27 expf32x F
+GLIBC_2.27 expf64 F
+GLIBC_2.27 expf64x F
+GLIBC_2.27 expm1f32 F
+GLIBC_2.27 expm1f32x F
+GLIBC_2.27 expm1f64 F
+GLIBC_2.27 expm1f64x F
+GLIBC_2.27 fabsf32 F
+GLIBC_2.27 fabsf32x F
+GLIBC_2.27 fabsf64 F
+GLIBC_2.27 fabsf64x F
+GLIBC_2.27 fdimf32 F
+GLIBC_2.27 fdimf32x F
+GLIBC_2.27 fdimf64 F
+GLIBC_2.27 fdimf64x F
+GLIBC_2.27 floorf32 F
+GLIBC_2.27 floorf32x F
+GLIBC_2.27 floorf64 F
+GLIBC_2.27 floorf64x F
+GLIBC_2.27 fmaf32 F
+GLIBC_2.27 fmaf32x F
+GLIBC_2.27 fmaf64 F
+GLIBC_2.27 fmaf64x F
+GLIBC_2.27 fmaxf32 F
+GLIBC_2.27 fmaxf32x F
+GLIBC_2.27 fmaxf64 F
+GLIBC_2.27 fmaxf64x F
+GLIBC_2.27 fmaxmagf32 F
+GLIBC_2.27 fmaxmagf32x F
+GLIBC_2.27 fmaxmagf64 F
+GLIBC_2.27 fmaxmagf64x F
+GLIBC_2.27 fminf32 F
+GLIBC_2.27 fminf32x F
+GLIBC_2.27 fminf64 F
+GLIBC_2.27 fminf64x F
+GLIBC_2.27 fminmagf32 F
+GLIBC_2.27 fminmagf32x F
+GLIBC_2.27 fminmagf64 F
+GLIBC_2.27 fminmagf64x F
+GLIBC_2.27 fmodf32 F
+GLIBC_2.27 fmodf32x F
+GLIBC_2.27 fmodf64 F
+GLIBC_2.27 fmodf64x F
+GLIBC_2.27 frexpf32 F
+GLIBC_2.27 frexpf32x F
+GLIBC_2.27 frexpf64 F
+GLIBC_2.27 frexpf64x F
+GLIBC_2.27 fromfpf32 F
+GLIBC_2.27 fromfpf32x F
+GLIBC_2.27 fromfpf64 F
+GLIBC_2.27 fromfpf64x F
+GLIBC_2.27 fromfpxf32 F
+GLIBC_2.27 fromfpxf32x F
+GLIBC_2.27 fromfpxf64 F
+GLIBC_2.27 fromfpxf64x F
+GLIBC_2.27 getpayloadf32 F
+GLIBC_2.27 getpayloadf32x F
+GLIBC_2.27 getpayloadf64 F
+GLIBC_2.27 getpayloadf64x F
+GLIBC_2.27 hypotf32 F
+GLIBC_2.27 hypotf32x F
+GLIBC_2.27 hypotf64 F
+GLIBC_2.27 hypotf64x F
+GLIBC_2.27 ilogbf32 F
+GLIBC_2.27 ilogbf32x F
+GLIBC_2.27 ilogbf64 F
+GLIBC_2.27 ilogbf64x F
+GLIBC_2.27 j0f32 F
+GLIBC_2.27 j0f32x F
+GLIBC_2.27 j0f64 F
+GLIBC_2.27 j0f64x F
+GLIBC_2.27 j1f32 F
+GLIBC_2.27 j1f32x F
+GLIBC_2.27 j1f64 F
+GLIBC_2.27 j1f64x F
+GLIBC_2.27 jnf32 F
+GLIBC_2.27 jnf32x F
+GLIBC_2.27 jnf64 F
+GLIBC_2.27 jnf64x F
+GLIBC_2.27 ldexpf32 F
+GLIBC_2.27 ldexpf32x F
+GLIBC_2.27 ldexpf64 F
+GLIBC_2.27 ldexpf64x F
+GLIBC_2.27 lgammaf32 F
+GLIBC_2.27 lgammaf32_r F
+GLIBC_2.27 lgammaf32x F
+GLIBC_2.27 lgammaf32x_r F
+GLIBC_2.27 lgammaf64 F
+GLIBC_2.27 lgammaf64_r F
+GLIBC_2.27 lgammaf64x F
+GLIBC_2.27 lgammaf64x_r F
+GLIBC_2.27 llogbf32 F
+GLIBC_2.27 llogbf32x F
+GLIBC_2.27 llogbf64 F
+GLIBC_2.27 llogbf64x F
+GLIBC_2.27 llrintf32 F
+GLIBC_2.27 llrintf32x F
+GLIBC_2.27 llrintf64 F
+GLIBC_2.27 llrintf64x F
+GLIBC_2.27 llroundf32 F
+GLIBC_2.27 llroundf32x F
+GLIBC_2.27 llroundf64 F
+GLIBC_2.27 llroundf64x F
+GLIBC_2.27 log10f32 F
+GLIBC_2.27 log10f32x F
+GLIBC_2.27 log10f64 F
+GLIBC_2.27 log10f64x F
+GLIBC_2.27 log1pf32 F
+GLIBC_2.27 log1pf32x F
+GLIBC_2.27 log1pf64 F
+GLIBC_2.27 log1pf64x F
+GLIBC_2.27 log2f F
+GLIBC_2.27 log2f32 F
+GLIBC_2.27 log2f32x F
+GLIBC_2.27 log2f64 F
+GLIBC_2.27 log2f64x F
+GLIBC_2.27 logbf32 F
+GLIBC_2.27 logbf32x F
+GLIBC_2.27 logbf64 F
+GLIBC_2.27 logbf64x F
+GLIBC_2.27 logf F
+GLIBC_2.27 logf32 F
+GLIBC_2.27 logf32x F
+GLIBC_2.27 logf64 F
+GLIBC_2.27 logf64x F
+GLIBC_2.27 lrintf32 F
+GLIBC_2.27 lrintf32x F
+GLIBC_2.27 lrintf64 F
+GLIBC_2.27 lrintf64x F
+GLIBC_2.27 lroundf32 F
+GLIBC_2.27 lroundf32x F
+GLIBC_2.27 lroundf64 F
+GLIBC_2.27 lroundf64x F
+GLIBC_2.27 modff32 F
+GLIBC_2.27 modff32x F
+GLIBC_2.27 modff64 F
+GLIBC_2.27 modff64x F
+GLIBC_2.27 nanf32 F
+GLIBC_2.27 nanf32x F
+GLIBC_2.27 nanf64 F
+GLIBC_2.27 nanf64x F
+GLIBC_2.27 nearbyintf32 F
+GLIBC_2.27 nearbyintf32x F
+GLIBC_2.27 nearbyintf64 F
+GLIBC_2.27 nearbyintf64x F
+GLIBC_2.27 nextafterf32 F
+GLIBC_2.27 nextafterf32x F
+GLIBC_2.27 nextafterf64 F
+GLIBC_2.27 nextafterf64x F
+GLIBC_2.27 nextdownf32 F
+GLIBC_2.27 nextdownf32x F
+GLIBC_2.27 nextdownf64 F
+GLIBC_2.27 nextdownf64x F
+GLIBC_2.27 nextupf32 F
+GLIBC_2.27 nextupf32x F
+GLIBC_2.27 nextupf64 F
+GLIBC_2.27 nextupf64x F
+GLIBC_2.27 powf F
+GLIBC_2.27 powf32 F
+GLIBC_2.27 powf32x F
+GLIBC_2.27 powf64 F
+GLIBC_2.27 powf64x F
+GLIBC_2.27 remainderf32 F
+GLIBC_2.27 remainderf32x F
+GLIBC_2.27 remainderf64 F
+GLIBC_2.27 remainderf64x F
+GLIBC_2.27 remquof32 F
+GLIBC_2.27 remquof32x F
+GLIBC_2.27 remquof64 F
+GLIBC_2.27 remquof64x F
+GLIBC_2.27 rintf32 F
+GLIBC_2.27 rintf32x F
+GLIBC_2.27 rintf64 F
+GLIBC_2.27 rintf64x F
+GLIBC_2.27 roundevenf32 F
+GLIBC_2.27 roundevenf32x F
+GLIBC_2.27 roundevenf64 F
+GLIBC_2.27 roundevenf64x F
+GLIBC_2.27 roundf32 F
+GLIBC_2.27 roundf32x F
+GLIBC_2.27 roundf64 F
+GLIBC_2.27 roundf64x F
+GLIBC_2.27 scalblnf32 F
+GLIBC_2.27 scalblnf32x F
+GLIBC_2.27 scalblnf64 F
+GLIBC_2.27 scalblnf64x F
+GLIBC_2.27 scalbnf32 F
+GLIBC_2.27 scalbnf32x F
+GLIBC_2.27 scalbnf64 F
+GLIBC_2.27 scalbnf64x F
+GLIBC_2.27 setpayloadf32 F
+GLIBC_2.27 setpayloadf32x F
+GLIBC_2.27 setpayloadf64 F
+GLIBC_2.27 setpayloadf64x F
+GLIBC_2.27 setpayloadsigf32 F
+GLIBC_2.27 setpayloadsigf32x F
+GLIBC_2.27 setpayloadsigf64 F
+GLIBC_2.27 setpayloadsigf64x F
+GLIBC_2.27 sincosf32 F
+GLIBC_2.27 sincosf32x F
+GLIBC_2.27 sincosf64 F
+GLIBC_2.27 sincosf64x F
+GLIBC_2.27 sinf32 F
+GLIBC_2.27 sinf32x F
+GLIBC_2.27 sinf64 F
+GLIBC_2.27 sinf64x F
+GLIBC_2.27 sinhf32 F
+GLIBC_2.27 sinhf32x F
+GLIBC_2.27 sinhf64 F
+GLIBC_2.27 sinhf64x F
+GLIBC_2.27 sqrtf32 F
+GLIBC_2.27 sqrtf32x F
+GLIBC_2.27 sqrtf64 F
+GLIBC_2.27 sqrtf64x F
+GLIBC_2.27 tanf32 F
+GLIBC_2.27 tanf32x F
+GLIBC_2.27 tanf64 F
+GLIBC_2.27 tanf64x F
+GLIBC_2.27 tanhf32 F
+GLIBC_2.27 tanhf32x F
+GLIBC_2.27 tanhf64 F
+GLIBC_2.27 tanhf64x F
+GLIBC_2.27 tgammaf32 F
+GLIBC_2.27 tgammaf32x F
+GLIBC_2.27 tgammaf64 F
+GLIBC_2.27 tgammaf64x F
+GLIBC_2.27 totalorderf32 F
+GLIBC_2.27 totalorderf32x F
+GLIBC_2.27 totalorderf64 F
+GLIBC_2.27 totalorderf64x F
+GLIBC_2.27 totalordermagf32 F
+GLIBC_2.27 totalordermagf32x F
+GLIBC_2.27 totalordermagf64 F
+GLIBC_2.27 totalordermagf64x F
+GLIBC_2.27 truncf32 F
+GLIBC_2.27 truncf32x F
+GLIBC_2.27 truncf64 F
+GLIBC_2.27 truncf64x F
+GLIBC_2.27 ufromfpf32 F
+GLIBC_2.27 ufromfpf32x F
+GLIBC_2.27 ufromfpf64 F
+GLIBC_2.27 ufromfpf64x F
+GLIBC_2.27 ufromfpxf32 F
+GLIBC_2.27 ufromfpxf32x F
+GLIBC_2.27 ufromfpxf64 F
+GLIBC_2.27 ufromfpxf64x F
+GLIBC_2.27 y0f32 F
+GLIBC_2.27 y0f32x F
+GLIBC_2.27 y0f64 F
+GLIBC_2.27 y0f64x F
+GLIBC_2.27 y1f32 F
+GLIBC_2.27 y1f32x F
+GLIBC_2.27 y1f64 F
+GLIBC_2.27 y1f64x F
+GLIBC_2.27 ynf32 F
+GLIBC_2.27 ynf32x F
+GLIBC_2.27 ynf64 F
+GLIBC_2.27 ynf64x F
+GLIBC_2.28 daddl F
+GLIBC_2.28 ddivl F
+GLIBC_2.28 dmull F
+GLIBC_2.28 dsubl F
+GLIBC_2.28 f32addf128 F
+GLIBC_2.28 f32addf32x F
+GLIBC_2.28 f32addf64 F
+GLIBC_2.28 f32addf64x F
+GLIBC_2.28 f32divf128 F
+GLIBC_2.28 f32divf32x F
+GLIBC_2.28 f32divf64 F
+GLIBC_2.28 f32divf64x F
+GLIBC_2.28 f32mulf128 F
+GLIBC_2.28 f32mulf32x F
+GLIBC_2.28 f32mulf64 F
+GLIBC_2.28 f32mulf64x F
+GLIBC_2.28 f32subf128 F
+GLIBC_2.28 f32subf32x F
+GLIBC_2.28 f32subf64 F
+GLIBC_2.28 f32subf64x F
+GLIBC_2.28 f32xaddf128 F
+GLIBC_2.28 f32xaddf64 F
+GLIBC_2.28 f32xaddf64x F
+GLIBC_2.28 f32xdivf128 F
+GLIBC_2.28 f32xdivf64 F
+GLIBC_2.28 f32xdivf64x F
+GLIBC_2.28 f32xmulf128 F
+GLIBC_2.28 f32xmulf64 F
+GLIBC_2.28 f32xmulf64x F
+GLIBC_2.28 f32xsubf128 F
+GLIBC_2.28 f32xsubf64 F
+GLIBC_2.28 f32xsubf64x F
+GLIBC_2.28 f64addf128 F
+GLIBC_2.28 f64addf64x F
+GLIBC_2.28 f64divf128 F
+GLIBC_2.28 f64divf64x F
+GLIBC_2.28 f64mulf128 F
+GLIBC_2.28 f64mulf64x F
+GLIBC_2.28 f64subf128 F
+GLIBC_2.28 f64subf64x F
+GLIBC_2.28 f64xaddf128 F
+GLIBC_2.28 f64xdivf128 F
+GLIBC_2.28 f64xmulf128 F
+GLIBC_2.28 f64xsubf128 F
+GLIBC_2.28 fadd F
+GLIBC_2.28 faddl F
+GLIBC_2.28 fdiv F
+GLIBC_2.28 fdivl F
+GLIBC_2.28 fmul F
+GLIBC_2.28 fmull F
+GLIBC_2.28 fsub F
+GLIBC_2.28 fsubl F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libnsl.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libnsl.abilist
index a0499d3c94..997142e8c3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libnsl.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libnsl.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __free_fdresult F
GLIBC_2.16 __nis_default_access F
GLIBC_2.16 __nis_default_group F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
index 6cd0fc3487..c09c9b015a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 _IO_flockfile F
GLIBC_2.16 _IO_ftrylockfile F
GLIBC_2.16 _IO_funlockfile F
@@ -221,6 +220,26 @@ GLIBC_2.16 vfork F
GLIBC_2.16 wait F
GLIBC_2.16 waitpid F
GLIBC_2.16 write F
-GLIBC_2.18 GLIBC_2.18 A
GLIBC_2.18 pthread_getattr_default_np F
GLIBC_2.18 pthread_setattr_default_np F
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libresolv.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libresolv.abilist
index 28abb0307e..2457bc9d49 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libresolv.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __b64_ntop F
GLIBC_2.16 __b64_pton F
GLIBC_2.16 __dn_comp F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist
index ea7b40ab56..94e84e4dcf 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 __mq_open_2 F
GLIBC_2.16 aio_cancel F
GLIBC_2.16 aio_cancel64 F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libthread_db.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libthread_db.abilist
index 5d7031cf2f..d6eace6bfa 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libthread_db.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libthread_db.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 td_init F
GLIBC_2.16 td_log F
GLIBC_2.16 td_symbol_list F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist
index 30353d06c2..cff23106f5 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist
@@ -1,4 +1,3 @@
-GLIBC_2.16 GLIBC_2.16 A
GLIBC_2.16 forkpty F
GLIBC_2.16 login F
GLIBC_2.16 login_tty F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/llseek.S b/sysdeps/unix/sysv/linux/x86_64/x32/llseek.S
deleted file mode 100644
index 5084d0ebd2..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/x32/llseek.S
+++ /dev/null
@@ -1 +0,0 @@
-/* No llseek for x32. */
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/lseek.S b/sysdeps/unix/sysv/linux/x86_64/x32/lseek.S
index bdefadfd1b..58afc5ed97 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/lseek.S
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/lseek.S
@@ -1,5 +1,5 @@
/* The lseek system call with 64-bit offset. Linux/x32 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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 c98ac74d46..b44f6f99e9 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list
@@ -1,9 +1,6 @@
# File name Caller Syscall name # args Strong name Weak names
-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
-preadv - preadv Ci:ipii preadv preadv64
-pwritev - pwritev Ci:ipii pwritev pwritev64
+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/x86_64/x32/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h
index dd4fabcb06..7f978c77ac 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,4 +22,8 @@
#include <sysdeps/unix/sysv/linux/x86_64/sysdep.h>
#include <sysdeps/x86_64/x32/sysdep.h>
+/* How to pass the off{64}_t argument on p{readv,writev}{64}. */
+#undef LO_HI_LONG
+#define LO_HI_LONG(val) (val)
+
#endif /* linux/x86_64/x32/sysdep.h */
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/times.c b/sysdeps/unix/sysv/linux/x86_64/x32/times.c
index c7d8c09e52..4b469128b1 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/times.c
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/times.c
@@ -1,5 +1,5 @@
/* Linux times. X32 version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,17 +19,19 @@
#include <sysdep.h>
/* Linux times system call returns 64-bit integer. */
-#undef INTERNAL_SYSCALL_NCS
-#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
- ({ \
- unsigned long long int resultvar; \
- LOAD_ARGS_##nr (args) \
- LOAD_REGS_##nr \
- asm volatile ( \
- "syscall\n\t" \
- : "=a" (resultvar) \
- : "0" (name) ASM_ARGS_##nr : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
- (long long int) resultvar; })
+#undef internal_syscall1
+#define internal_syscall1(number, err, arg1) \
+({ \
+ unsigned long long int resultvar; \
+ TYPEFY (arg1, __arg1) = ARGIFY (arg1); \
+ register TYPEFY (arg1, _a1) asm ("rdi") = __arg1; \
+ asm volatile ( \
+ "syscall\n\t" \
+ : "=a" (resultvar) \
+ : "0" (number), "r" (_a1) \
+ : "memory", REGISTERS_CLOBBERED_BY_SYSCALL); \
+ (long long int) resultvar; \
+})
#undef INTERNAL_SYSCALL_ERROR_P
#define INTERNAL_SYSCALL_ERROR_P(val, err) \
diff --git a/sysdeps/unix/sysv/linux/xmknod.c b/sysdeps/unix/sysv/linux/xmknod.c
index 4564674b85..c7c4895a9e 100644
--- a/sysdeps/unix/sysv/linux/xmknod.c
+++ b/sysdeps/unix/sysv/linux/xmknod.c
@@ -1,5 +1,5 @@
/* xmknod call using old-style Unix mknod system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/xmknodat.c b/sysdeps/unix/sysv/linux/xmknodat.c
index 031f140bb4..a42267879a 100644
--- a/sysdeps/unix/sysv/linux/xmknodat.c
+++ b/sysdeps/unix/sysv/linux/xmknodat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/sysv/linux/xstat.c b/sysdeps/unix/sysv/linux/xstat.c
index b8b075023c..52fb62d8b7 100644
--- a/sysdeps/unix/sysv/linux/xstat.c
+++ b/sysdeps/unix/sysv/linux/xstat.c
@@ -1,5 +1,5 @@
/* xstat using old-style Unix stat system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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);
@@ -52,7 +52,7 @@ __xstat (int vers, const char *name, struct stat *buf)
}
hidden_def (__xstat)
weak_alias (__xstat, _xstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
#undef __xstat64
strong_alias (__xstat, __xstat64);
hidden_ver (__xstat, __xstat64)
diff --git a/sysdeps/unix/sysv/linux/xstat64.c b/sysdeps/unix/sysv/linux/xstat64.c
index 2075383ddf..afc9ba2cb7 100644
--- a/sysdeps/unix/sysv/linux/xstat64.c
+++ b/sysdeps/unix/sysv/linux/xstat64.c
@@ -1,5 +1,5 @@
/* xstat64 using Linux stat64 system call.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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..3c32da70b1 100644
--- a/sysdeps/unix/sysv/linux/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/xstatconv.c
@@ -1,5 +1,5 @@
/* Convert between the kernel's `struct stat' format, and libc's.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ struct kernel_stat;
#include <string.h>
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
int
__xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
{
@@ -106,7 +106,7 @@ __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
int
__xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
{
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
return __xstat_conv (vers, kbuf, ubuf);
#else
switch (vers)
@@ -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/unix/sysv/linux/xstatconv.h b/sysdeps/unix/sysv/linux/xstatconv.h
index b96dbb8e50..d38dcad199 100644
--- a/sysdeps/unix/sysv/linux/xstatconv.h
+++ b/sysdeps/unix/sysv/linux/xstatconv.h
@@ -1,5 +1,5 @@
/* Convert between the kernel's `struct stat' format, and libc's.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/x86_64/sysdep.S b/sysdeps/unix/x86_64/sysdep.S
index 1a1ae7a5b8..dd953bdd3f 100644
--- a/sysdeps/unix/x86_64/sysdep.S
+++ b/sysdeps/unix/x86_64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/unix/x86_64/sysdep.h b/sysdeps/unix/x86_64/sysdep.h
index dad63649b2..9f7938ea55 100644
--- a/sysdeps/unix/x86_64/sysdep.h
+++ b/sysdeps/unix/x86_64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/wordsize-32/Makefile b/sysdeps/wordsize-32/Makefile
deleted file mode 100644
index 82beac44ed..0000000000
--- a/sysdeps/wordsize-32/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-ifeq ($(subdir),csu)
-ifeq (yes,$(build-shared))
-sysdep_routines += divdi3
-shared-only-routines += divdi3
-CPPFLAGS-divdi3.c = -Din_divdi3_c
-endif
-endif
diff --git a/sysdeps/wordsize-32/bits/wordsize.h b/sysdeps/wordsize-32/bits/wordsize.h
index 2aa16bcde5..8ef7ddbd82 100644
--- a/sysdeps/wordsize-32/bits/wordsize.h
+++ b/sysdeps/wordsize-32/bits/wordsize.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software 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,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-32/divdi3-symbol-hacks.h b/sysdeps/wordsize-32/divdi3-symbol-hacks.h
new file mode 100644
index 0000000000..8d49aacaeb
--- /dev/null
+++ b/sysdeps/wordsize-32/divdi3-symbol-hacks.h
@@ -0,0 +1,31 @@
+/* Hacks needed for divdi3 symbol manipulation.
+ Copyright (C) 2004-2018 Free Software 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/>. */
+
+/* A very dirty trick: gcc emits references to __divdi3, __udivdi3,
+ __moddi3, and __umoddi3. These functions are exported and
+ therefore we get PLTs. Unnecessarily so. Changing gcc is a big
+ task which might not be worth it so we play tricks with the
+ assembler.
+ Note: in_divdi3_c is only used to avoid symbol alias on divdi3
+ build itself. */
+#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) && defined SHARED
+asm ("__divdi3 = __divdi3_internal");
+asm ("__udivdi3 = __udivdi3_internal");
+asm ("__moddi3 = __moddi3_internal");
+asm ("__umoddi3 = __umoddi3_internal");
+#endif
diff --git a/sysdeps/wordsize-32/divdi3.c b/sysdeps/wordsize-32/divdi3.c
index c20fdf5125..257d93cc37 100644
--- a/sysdeps/wordsize-32/divdi3.c
+++ b/sysdeps/wordsize-32/divdi3.c
@@ -1,5 +1,5 @@
/* 64-bit multiplication and division
- Copyright (C) 1989, 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/wordsize-32/llabs.c b/sysdeps/wordsize-32/llabs.c
index e7a36e3501..f668f1f6b0 100644
--- a/sysdeps/wordsize-32/llabs.c
+++ b/sysdeps/wordsize-32/llabs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/wordsize-32/lldiv.c b/sysdeps/wordsize-32/lldiv.c
index 6115a731fa..74776d61b0 100644
--- a/sysdeps/wordsize-32/lldiv.c
+++ b/sysdeps/wordsize-32/lldiv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/wordsize-32/strtoimax.c b/sysdeps/wordsize-32/strtoimax.c
index 7d2f5162c7..84fce82d90 100644
--- a/sysdeps/wordsize-32/strtoimax.c
+++ b/sysdeps/wordsize-32/strtoimax.c
@@ -1,5 +1,5 @@
/* Convert string to maximal integer.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/wordsize-32/strtoumax.c b/sysdeps/wordsize-32/strtoumax.c
index dacfbdb9b7..cabd4d8c8d 100644
--- a/sysdeps/wordsize-32/strtoumax.c
+++ b/sysdeps/wordsize-32/strtoumax.c
@@ -1,5 +1,5 @@
/* Convert string to maximal unsigned integer.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -25,3 +25,4 @@ strtoumax (const char *__restrict nptr, char **__restrict endptr, int base)
{
return __strtoull_internal (nptr, endptr, base, 0);
}
+libc_hidden_def (strtoumax)
diff --git a/sysdeps/wordsize-32/symbol-hacks.h b/sysdeps/wordsize-32/symbol-hacks.h
deleted file mode 100644
index 266b795040..0000000000
--- a/sysdeps/wordsize-32/symbol-hacks.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Hacks needed for symbol manipulation.
- Copyright (C) 2004-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_next "symbol-hacks.h"
-
-/* A very dirty trick: gcc emits references to __divdi3, __udivdi3,
- __moddi3, and __umoddi3. These functions are exported and
- therefore we get PLTs. Unnecessarily so. Changing gcc is a big
- task which might not be worth it so we play tricks with the
- assembler. */
-#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) && defined SHARED
-asm ("__divdi3 = __divdi3_internal");
-asm ("__udivdi3 = __udivdi3_internal");
-asm ("__moddi3 = __moddi3_internal");
-asm ("__umoddi3 = __umoddi3_internal");
-#endif
diff --git a/sysdeps/wordsize-32/wcstoimax.c b/sysdeps/wordsize-32/wcstoimax.c
index 3fd4e71fa6..48e433eb42 100644
--- a/sysdeps/wordsize-32/wcstoimax.c
+++ b/sysdeps/wordsize-32/wcstoimax.c
@@ -1,5 +1,5 @@
/* Convert wide-character string to maximal integer.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/wordsize-32/wcstoumax.c b/sysdeps/wordsize-32/wcstoumax.c
index 2fb1eb43c6..8c3a35983b 100644
--- a/sysdeps/wordsize-32/wcstoumax.c
+++ b/sysdeps/wordsize-32/wcstoumax.c
@@ -1,5 +1,5 @@
/* Convert wide-character string to maximal unsigned integer.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/wordsize-64/bits/wordsize.h b/sysdeps/wordsize-64/bits/wordsize.h
index 0944f9e267..d0a97e7598 100644
--- a/sysdeps/wordsize-64/bits/wordsize.h
+++ b/sysdeps/wordsize-64/bits/wordsize.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software 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,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/wordsize-64/glob.c b/sysdeps/wordsize-64/glob.c
deleted file mode 100644
index 082faf1c70..0000000000
--- a/sysdeps/wordsize-64/glob.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#define glob64 __no_glob64_decl
-#define globfree64 __no_globfree64_decl
-#include <posix/glob.c>
-#undef glob64
-#undef globfree64
-weak_alias (glob, glob64)
-weak_alias (globfree, globfree64)
-libc_hidden_ver (globfree, globfree64)
diff --git a/sysdeps/wordsize-64/glob64.c b/sysdeps/wordsize-64/glob64.c
deleted file mode 100644
index 33918ea6a5..0000000000
--- a/sysdeps/wordsize-64/glob64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* glob64 is in glob.c */
diff --git a/sysdeps/wordsize-64/labs.c b/sysdeps/wordsize-64/labs.c
index b852b96541..80721c296c 100644
--- a/sysdeps/wordsize-64/labs.c
+++ b/sysdeps/wordsize-64/labs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/wordsize-64/ldiv.c b/sysdeps/wordsize-64/ldiv.c
index 71e108c671..a32d288405 100644
--- a/sysdeps/wordsize-64/ldiv.c
+++ b/sysdeps/wordsize-64/ldiv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/wordsize-64/strtoimax.c b/sysdeps/wordsize-64/strtoimax.c
index 390e9e58eb..d22c4e8f7d 100644
--- a/sysdeps/wordsize-64/strtoimax.c
+++ b/sysdeps/wordsize-64/strtoimax.c
@@ -1,5 +1,5 @@
/* Convert string to maximal integer.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/wordsize-64/strtoumax.c b/sysdeps/wordsize-64/strtoumax.c
index 365a74a5a7..04468458df 100644
--- a/sysdeps/wordsize-64/strtoumax.c
+++ b/sysdeps/wordsize-64/strtoumax.c
@@ -1,5 +1,5 @@
/* Convert string to maximal unsigned integer.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -25,3 +25,4 @@ strtoumax (const char *__restrict nptr, char **__restrict endptr, int base)
{
return __strtoul_internal (nptr, endptr, base, 0);
}
+libc_hidden_def (strtoumax)
diff --git a/sysdeps/wordsize-64/tst-writev.c b/sysdeps/wordsize-64/tst-writev.c
index 1d6b8c87ef..bc4b1f95b2 100644
--- a/sysdeps/wordsize-64/tst-writev.c
+++ b/sysdeps/wordsize-64/tst-writev.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ryan S. Arnold <rsa@us.ibm.com>, 2011.
@@ -17,8 +17,10 @@
<http://www.gnu.org/licenses/>. */
#include <fcntl.h>
+#include <limits.h>
#include <paths.h>
#include <stdio.h>
+#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/uio.h>
diff --git a/sysdeps/wordsize-64/wcstoimax.c b/sysdeps/wordsize-64/wcstoimax.c
index 5eaf4d200e..888f8fe584 100644
--- a/sysdeps/wordsize-64/wcstoimax.c
+++ b/sysdeps/wordsize-64/wcstoimax.c
@@ -1,5 +1,5 @@
/* Convert wide-character string to maximal integer.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/wordsize-64/wcstoumax.c b/sysdeps/wordsize-64/wcstoumax.c
index 754163ff64..197d342452 100644
--- a/sysdeps/wordsize-64/wcstoumax.c
+++ b/sysdeps/wordsize-64/wcstoumax.c
@@ -1,5 +1,5 @@
/* Convert wide-character string to maximal unsigned integer.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/x86/Makeconfig b/sysdeps/x86/Makeconfig
new file mode 100644
index 0000000000..d701f8294d
--- /dev/null
+++ b/sysdeps/x86/Makeconfig
@@ -0,0 +1 @@
+float64x-alias-fcts = yes
diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 0de4f42168..337b0b63dc 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -1,10 +1,95 @@
ifeq ($(subdir),csu)
-gen-as-const-headers += cpu-features-offsets.sym rtld-global-offsets.sym
+gen-as-const-headers += cpu-features-offsets.sym
endif
ifeq ($(subdir),elf)
sysdep-dl-routines += dl-get-cpu-features
-tests += tst-get-cpu-features
+tests += tst-get-cpu-features tst-get-cpu-features-static
tests-static += tst-get-cpu-features-static
endif
+
+ifeq ($(subdir),setjmp)
+gen-as-const-headers += jmp_buf-ssp.sym
+sysdep_routines += __longjmp_cancel
+endif
+
+ifeq ($(enable-cet),yes)
+ifeq ($(subdir),elf)
+sysdep-dl-routines += dl-cet
+
+tests += tst-cet-legacy-1 tst-cet-legacy-2 tst-cet-legacy-2a \
+ tst-cet-legacy-3 tst-cet-legacy-4
+ifneq (no,$(have-tunables))
+tests += tst-cet-legacy-4a tst-cet-legacy-4b tst-cet-legacy-4c
+endif
+modules-names += tst-cet-legacy-mod-1 tst-cet-legacy-mod-2 \
+ tst-cet-legacy-mod-4
+
+CFLAGS-tst-cet-legacy-2.c += -fcf-protection=branch
+CFLAGS-tst-cet-legacy-2a.c += -fcf-protection
+CFLAGS-tst-cet-legacy-mod-1.c += -fcf-protection=none
+CFLAGS-tst-cet-legacy-mod-2.c += -fcf-protection=none
+CFLAGS-tst-cet-legacy-3.c += -fcf-protection=none
+CFLAGS-tst-cet-legacy-4.c += -fcf-protection=branch
+CFLAGS-tst-cet-legacy-4a.c += -fcf-protection
+CFLAGS-tst-cet-legacy-4b.c += -fcf-protection
+CFLAGS-tst-cet-legacy-mod-4.c += -fcf-protection=none
+
+$(objpfx)tst-cet-legacy-1: $(objpfx)tst-cet-legacy-mod-1.so \
+ $(objpfx)tst-cet-legacy-mod-2.so
+$(objpfx)tst-cet-legacy-2: $(objpfx)tst-cet-legacy-mod-2.so $(libdl)
+$(objpfx)tst-cet-legacy-2.out: $(objpfx)tst-cet-legacy-mod-1.so
+$(objpfx)tst-cet-legacy-2a: $(objpfx)tst-cet-legacy-mod-2.so $(libdl)
+$(objpfx)tst-cet-legacy-2a.out: $(objpfx)tst-cet-legacy-mod-1.so
+$(objpfx)tst-cet-legacy-4: $(libdl)
+$(objpfx)tst-cet-legacy-4.out: $(objpfx)tst-cet-legacy-mod-4.so
+ifneq (no,$(have-tunables))
+$(objpfx)tst-cet-legacy-4a: $(libdl)
+$(objpfx)tst-cet-legacy-4a.out: $(objpfx)tst-cet-legacy-mod-4.so
+tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.tune.x86_shstk=permissive
+$(objpfx)tst-cet-legacy-4b: $(libdl)
+$(objpfx)tst-cet-legacy-4b.out: $(objpfx)tst-cet-legacy-mod-4.so
+tst-cet-legacy-4b-ENV = GLIBC_TUNABLES=glibc.tune.x86_shstk=on
+$(objpfx)tst-cet-legacy-4c: $(libdl)
+$(objpfx)tst-cet-legacy-4c.out: $(objpfx)tst-cet-legacy-mod-4.so
+tst-cet-legacy-4c-ENV = GLIBC_TUNABLES=glibc.tune.x86_shstk=off
+endif
+endif
+
+# Add -fcf-protection to CFLAGS when CET is enabled.
+CFLAGS-.o += -fcf-protection
+CFLAGS-.os += -fcf-protection
+CFLAGS-.op += -fcf-protection
+CFLAGS-.oS += -fcf-protection
+
+# Compile assembly codes with <cet.h> when CET is enabled.
+asm-CPPFLAGS += -fcf-protection -include cet.h
+
+ifeq ($(subdir),elf)
+ifeq (yes,$(build-shared))
+tests-special += $(objpfx)check-cet.out
+endif
+
+# FIXME: Can't use all-built-dso in elf/Makefile since this file is
+# processed before elf/Makefile. Duplicate it here.
+cet-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
+ $(filter-out $(common-objpfx)linkobj/libc.so, \
+ $(sort $(wildcard $(addprefix $(common-objpfx), \
+ */lib*.so \
+ iconvdata/*.so))))
+
+$(cet-built-dso:=.note): %.note: %
+ @rm -f $@T
+ LC_ALL=C $(READELF) -n $< > $@T
+ test -s $@T
+ mv -f $@T $@
+common-generated += $(cet-built-dso:$(common-objpfx)%=%.note)
+
+$(objpfx)check-cet.out: $(..)sysdeps/x86/check-cet.awk \
+ $(cet-built-dso:=.note)
+ LC_ALL=C $(AWK) -f $^ > $@; \
+ $(evaluate-test)
+generated += check-cet.out
+endif
+endif
diff --git a/sysdeps/x86/__longjmp_cancel.S b/sysdeps/x86/__longjmp_cancel.S
new file mode 100644
index 0000000000..b57dbfa376
--- /dev/null
+++ b/sysdeps/x86/__longjmp_cancel.S
@@ -0,0 +1,20 @@
+/* __longjmp_cancel for x86.
+ Copyright (C) 2018 Free Software 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 __longjmp __longjmp_cancel
+#include <__longjmp.S>
diff --git a/sysdeps/x86/bits/byteswap-16.h b/sysdeps/x86/bits/byteswap-16.h
deleted file mode 100644
index e922e20b49..0000000000
--- a/sysdeps/x86/bits/byteswap-16.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Macros to swap the order of bytes in 16-bit integer values.
- 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/>. */
-
-#ifndef _BITS_BYTESWAP_H
-# error "Never use <bits/byteswap-16.h> directly; include <byteswap.h> instead."
-#endif
-
-#ifdef __GNUC__
-# if __GNUC__ >= 2
-# define __bswap_16(x) \
- (__extension__ \
- ({ unsigned short int __v, __x = (unsigned short int) (x); \
- if (__builtin_constant_p (__x)) \
- __v = __bswap_constant_16 (__x); \
- else \
- __asm__ ("rorw $8, %w0" \
- : "=r" (__v) \
- : "0" (__x) \
- : "cc"); \
- __v; }))
-# else
-/* This is better than nothing. */
-# define __bswap_16(x) \
- (__extension__ \
- ({ unsigned short int __x = (unsigned short int) (x); \
- __bswap_constant_16 (__x); }))
-# endif
-#else
-static __inline unsigned short int
-__bswap_16 (unsigned short int __bsx)
-{
- return __bswap_constant_16 (__bsx);
-}
-#endif
diff --git a/sysdeps/x86/bits/byteswap.h b/sysdeps/x86/bits/byteswap.h
deleted file mode 100644
index f783aeab1d..0000000000
--- a/sysdeps/x86/bits/byteswap.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Macros to swap the order of bytes in integer values.
- 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/>. */
-
-#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
-# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
-#endif
-
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H 1
-
-#include <features.h>
-#include <bits/types.h>
-#include <bits/wordsize.h>
-
-/* Swap bytes in 16 bit value. */
-#define __bswap_constant_16(x) \
- ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
-
-/* Get __bswap_16. */
-#include <bits/byteswap-16.h>
-
-/* Swap bytes in 32 bit value. */
-#define __bswap_constant_32(x) \
- ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
- (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
-
-#ifdef __GNUC__
-# if __GNUC_PREREQ (4, 3)
-static __inline unsigned int
-__bswap_32 (unsigned int __bsx)
-{
- return __builtin_bswap32 (__bsx);
-}
-# elif __GNUC__ >= 2
-# if __WORDSIZE == 64 || (defined __i486__ || defined __pentium__ \
- || defined __pentiumpro__ || defined __pentium4__ \
- || defined __k8__ || defined __athlon__ \
- || defined __k6__ || defined __nocona__ \
- || defined __core2__ || defined __geode__ \
- || defined __amdfam10__)
-/* To swap the bytes in a word the i486 processors and up provide the
- `bswap' opcode. On i386 we have to use three instructions. */
-# define __bswap_32(x) \
- (__extension__ \
- ({ unsigned int __v, __x = (x); \
- if (__builtin_constant_p (__x)) \
- __v = __bswap_constant_32 (__x); \
- else \
- __asm__ ("bswap %0" : "=r" (__v) : "0" (__x)); \
- __v; }))
-# else
-# define __bswap_32(x) \
- (__extension__ \
- ({ unsigned int __v, __x = (x); \
- if (__builtin_constant_p (__x)) \
- __v = __bswap_constant_32 (__x); \
- else \
- __asm__ ("rorw $8, %w0;" \
- "rorl $16, %0;" \
- "rorw $8, %w0" \
- : "=r" (__v) \
- : "0" (__x) \
- : "cc"); \
- __v; }))
-# endif
-# else
-# define __bswap_32(x) \
- (__extension__ \
- ({ unsigned int __x = (x); __bswap_constant_32 (__x); }))
-# endif
-#else
-static __inline unsigned int
-__bswap_32 (unsigned int __bsx)
-{
- return __bswap_constant_32 (__bsx);
-}
-#endif
-
-
-#if __GNUC_PREREQ (2, 0)
-/* Swap bytes in 64 bit value. */
-# define __bswap_constant_64(x) \
- (__extension__ ((((x) & 0xff00000000000000ull) >> 56) \
- | (((x) & 0x00ff000000000000ull) >> 40) \
- | (((x) & 0x0000ff0000000000ull) >> 24) \
- | (((x) & 0x000000ff00000000ull) >> 8) \
- | (((x) & 0x00000000ff000000ull) << 8) \
- | (((x) & 0x0000000000ff0000ull) << 24) \
- | (((x) & 0x000000000000ff00ull) << 40) \
- | (((x) & 0x00000000000000ffull) << 56)))
-
-# if __GNUC_PREREQ (4, 3)
-static __inline __uint64_t
-__bswap_64 (__uint64_t __bsx)
-{
- return __builtin_bswap64 (__bsx);
-}
-# elif __WORDSIZE == 64
-# define __bswap_64(x) \
- (__extension__ \
- ({ __uint64_t __v, __x = (x); \
- if (__builtin_constant_p (__x)) \
- __v = __bswap_constant_64 (__x); \
- else \
- __asm__ ("bswap %q0" : "=r" (__v) : "0" (__x)); \
- __v; }))
-# else
-# define __bswap_64(x) \
- (__extension__ \
- ({ union { __extension__ __uint64_t __ll; \
- unsigned int __l[2]; } __w, __r; \
- if (__builtin_constant_p (x)) \
- __r.__ll = __bswap_constant_64 (x); \
- else \
- { \
- __w.__ll = (x); \
- __r.__l[0] = __bswap_32 (__w.__l[1]); \
- __r.__l[1] = __bswap_32 (__w.__l[0]); \
- } \
- __r.__ll; }))
-# endif
-#else
-# define __bswap_constant_64(x) \
- ((((x) & 0xff00000000000000ull) >> 56) \
- | (((x) & 0x00ff000000000000ull) >> 40) \
- | (((x) & 0x0000ff0000000000ull) >> 24) \
- | (((x) & 0x000000ff00000000ull) >> 8) \
- | (((x) & 0x00000000ff000000ull) << 8) \
- | (((x) & 0x0000000000ff0000ull) << 24) \
- | (((x) & 0x000000000000ff00ull) << 40) \
- | (((x) & 0x00000000000000ffull) << 56))
-
-static __inline __uint64_t
-__bswap_64 (__uint64_t __bsx)
-{
- return __bswap_constant_64 (__bsx);
-}
-#endif
-
-#endif /* _BITS_BYTESWAP_H */
diff --git a/sysdeps/x86/bits/floatn.h b/sysdeps/x86/bits/floatn.h
new file mode 100644
index 0000000000..49c75f26c5
--- /dev/null
+++ b/sysdeps/x86/bits/floatn.h
@@ -0,0 +1,121 @@
+/* Macros to control TS 18661-3 glibc features on x86.
+ Copyright (C) 2017-2018 Free Software 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 _BITS_FLOATN_H
+#define _BITS_FLOATN_H
+
+#include <features.h>
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the IEEE 754 binary128 format, and this
+ glibc includes corresponding *f128 interfaces for it. The required
+ libgcc support was added some time after the basic compiler
+ support, for x86_64 and x86. */
+#if (defined __x86_64__ \
+ ? __GNUC_PREREQ (4, 3) \
+ : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4)))
+# define __HAVE_FLOAT128 1
+#else
+# define __HAVE_FLOAT128 0
+#endif
+
+/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
+ from the default float, double and long double types in this glibc. */
+#if __HAVE_FLOAT128
+# define __HAVE_DISTINCT_FLOAT128 1
+#else
+# define __HAVE_DISTINCT_FLOAT128 0
+#endif
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the right format for _Float64x, and this
+ glibc includes corresponding *f64x interfaces for it. */
+#define __HAVE_FLOAT64X 1
+
+/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
+ of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
+ the format of _Float128, which must be different from that of long
+ double. */
+#define __HAVE_FLOAT64X_LONG_DOUBLE 1
+
+#ifndef __ASSEMBLER__
+
+/* Defined to concatenate the literal suffix to be used with _Float128
+ types, if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* The literal suffix f128 exists only since GCC 7.0. */
+# define __f128(x) x##q
+# else
+# define __f128(x) x##f128
+# endif
+# endif
+
+/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* Add a typedef for older GCC compilers which don't natively support
+ _Complex _Float128. */
+typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
+# define __CFLOAT128 __cfloat128
+# else
+# define __CFLOAT128 _Complex _Float128
+# endif
+# endif
+
+/* The remaining of this file provides support for older compilers. */
+# if __HAVE_FLOAT128
+
+/* The type _Float128 exists only since GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+typedef __float128 _Float128;
+# endif
+
+/* __builtin_huge_valf128 doesn't exist before GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())
+# endif
+
+/* Older GCC has only a subset of built-in functions for _Float128 on
+ x86, and __builtin_infq is not usable in static initializers.
+ Converting a narrower sNaN to _Float128 produces a quiet NaN, so
+ attempts to use _Float128 sNaNs will not work properly with older
+ compilers. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_copysignf128 __builtin_copysignq
+# define __builtin_fabsf128 __builtin_fabsq
+# define __builtin_inff128() ((_Float128) __builtin_inf ())
+# define __builtin_nanf128(x) ((_Float128) __builtin_nan (x))
+# define __builtin_nansf128(x) ((_Float128) __builtin_nans (x))
+# endif
+
+/* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
+ e.g.: __builtin_signbitf128, before GCC 6. However, there has never
+ been a __builtin_signbitf128 in GCC and the type-generic builtin is
+ only available since GCC 6. */
+# if !__GNUC_PREREQ (6, 0)
+# define __builtin_signbitf128 __signbitf128
+# endif
+
+# endif
+
+#endif /* !__ASSEMBLER__. */
+
+#include <bits/floatn-common.h>
+
+#endif /* _BITS_FLOATN_H */
diff --git a/sysdeps/x86/bits/flt-eval-method.h b/sysdeps/x86/bits/flt-eval-method.h
new file mode 100644
index 0000000000..a6134a455f
--- /dev/null
+++ b/sysdeps/x86/bits/flt-eval-method.h
@@ -0,0 +1,33 @@
+/* Define __GLIBC_FLT_EVAL_METHOD. x86 version.
+ Copyright (C) 2016-2018 Free Software 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/flt-eval-method.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __FLT_EVAL_METHOD__
+# if __FLT_EVAL_METHOD__ == -1
+# define __GLIBC_FLT_EVAL_METHOD 2
+# else
+# define __GLIBC_FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+# endif
+#elif defined __x86_64__
+# define __GLIBC_FLT_EVAL_METHOD 0
+#else
+# define __GLIBC_FLT_EVAL_METHOD 2
+#endif
diff --git a/sysdeps/x86/bits/fp-logb.h b/sysdeps/x86/bits/fp-logb.h
new file mode 100644
index 0000000000..267c7ec1e1
--- /dev/null
+++ b/sysdeps/x86/bits/fp-logb.h
@@ -0,0 +1,24 @@
+/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. x86 version.
+ Copyright (C) 2016-2018 Free Software 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/fp-logb.h> directly; include <math.h> instead."
+#endif
+
+#define __FP_LOGB0_IS_MIN 1
+#define __FP_LOGBNAN_IS_MIN 1
diff --git a/sysdeps/x86/bits/huge_vall.h b/sysdeps/x86/bits/huge_vall.h
deleted file mode 100644
index b19e0b4ec2..0000000000
--- a/sysdeps/x86/bits/huge_vall.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* `HUGE_VALL' constant for ix86 (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992-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/huge_vall.h> directly; include <math.h> instead."
-#endif
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VALL (__builtin_huge_vall())
-#elif __GNUC_PREREQ(2,96)
-# define HUGE_VALL (__extension__ 0x1.0p32767L)
-#else
-
-# define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 }
-
-# define __huge_vall_t union { unsigned char __c[12]; long double __ld; }
-# ifdef __GNUC__
-# define HUGE_VALL (__extension__ \
- ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld)
-# else /* Not GCC. */
-static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
-# define HUGE_VALL (__huge_vall.__ld)
-# endif /* GCC. */
-
-#endif /* GCC 2.95 */
diff --git a/sysdeps/x86/bits/indirect-return.h b/sysdeps/x86/bits/indirect-return.h
new file mode 100644
index 0000000000..d1acaca3b9
--- /dev/null
+++ b/sysdeps/x86/bits/indirect-return.h
@@ -0,0 +1,37 @@
+/* Definition of __INDIRECT_RETURN. x86 version.
+ Copyright (C) 2018 Free Software 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 _UCONTEXT_H
+# error "Never include <bits/indirect-return.h> directly; use <ucontext.h> instead."
+#endif
+
+/* On x86, swapcontext returns via indirect branch when the shadow stack
+ is enabled. Define __INDIRECT_RETURN to indicate whether swapcontext
+ returns via indirect branch. */
+#if defined __CET__ && (__CET__ & 2) != 0
+# if __glibc_has_attribute (__indirect_return__)
+# define __INDIRECT_RETURN __attribute__ ((__indirect_return__))
+# else
+/* Newer compilers provide the indirect_return attribute, but without
+ it we can use returns_twice to affect the optimizer in the same
+ way and avoid unsafe optimizations. */
+# define __INDIRECT_RETURN __attribute__ ((__returns_twice__))
+# endif
+#else
+# define __INDIRECT_RETURN
+#endif
diff --git a/sysdeps/x86/bits/link.h b/sysdeps/x86/bits/link.h
index 8dd11c2d24..a97c41162c 100644
--- a/sysdeps/x86/bits/link.h
+++ b/sysdeps/x86/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86/bits/mathdef.h b/sysdeps/x86/bits/mathdef.h
deleted file mode 100644
index e61c28aea3..0000000000
--- a/sysdeps/x86/bits/mathdef.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright (C) 2001-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/>. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-# if defined __x86_64__ || (defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 0)
-/* The x86-64 architecture computes values with the precission of the
- used type. Similarly for -m32 -mfpmath=sse. */
-typedef float float_t; /* `float' expressions are evaluated as `float'. */
-typedef double double_t; /* `double' expressions are evaluated
- as `double'. */
-# else
-/* The ix87 FPUs evaluate all values in the 80 bit floating-point format
- which is also available for the user as `long double'. Therefore we
- define: */
-typedef long double float_t; /* `float' expressions are evaluated as
- `long double'. */
-typedef long double double_t; /* `double' expressions are evaluated as
- `long double'. */
-# endif
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647 - 1)
-# define FP_ILOGBNAN (-2147483647 - 1)
-
-/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l}
- builtins are supported. */
-# ifdef __FP_FAST_FMA
-# define FP_FAST_FMA 1
-# endif
-
-# ifdef __FP_FAST_FMAF
-# define FP_FAST_FMAF 1
-# endif
-
-# ifdef __FP_FAST_FMAL
-# define FP_FAST_FMAL 1
-# endif
-
-#endif /* ISO C99 */
diff --git a/sysdeps/x86/bits/pthreadtypes.h b/sysdeps/x86/bits/pthreadtypes.h
deleted file mode 100644
index 16b8f4fbb1..0000000000
--- a/sysdeps/x86/bits/pthreadtypes.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/* Copyright (C) 2002-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 _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#include <bits/wordsize.h>
-
-#ifdef __x86_64__
-# if __WORDSIZE == 64
-# define __SIZEOF_PTHREAD_ATTR_T 56
-# define __SIZEOF_PTHREAD_MUTEX_T 40
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 56
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 32
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-# else
-# define __SIZEOF_PTHREAD_ATTR_T 32
-# define __SIZEOF_PTHREAD_MUTEX_T 32
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 44
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 20
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-# endif
-#else
-# define __SIZEOF_PTHREAD_ATTR_T 36
-# define __SIZEOF_PTHREAD_MUTEX_T 24
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 32
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 20
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
-#endif
-
-
-/* Thread identifiers. The structure of the attribute type is not
- exposed on purpose. */
-typedef unsigned long int pthread_t;
-
-
-union pthread_attr_t
-{
- char __size[__SIZEOF_PTHREAD_ATTR_T];
- long int __align;
-};
-#ifndef __have_pthread_attr_t
-typedef union pthread_attr_t pthread_attr_t;
-# define __have_pthread_attr_t 1
-#endif
-
-
-#ifdef __x86_64__
-typedef struct __pthread_internal_list
-{
- struct __pthread_internal_list *__prev;
- struct __pthread_internal_list *__next;
-} __pthread_list_t;
-#else
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-#endif
-
-
-/* Data structures for mutex handling. The structure of the attribute
- type is not exposed on purpose. */
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
-#ifdef __x86_64__
- unsigned int __nusers;
-#endif
- /* KIND must stay at this position in the structure to maintain
- binary compatibility. */
- int __kind;
-#ifdef __x86_64__
- short __spins;
- short __elision;
- __pthread_list_t __list;
-# define __PTHREAD_MUTEX_HAVE_PREV 1
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */
-# define __PTHREAD_SPINS 0, 0
-#else
- unsigned int __nusers;
- __extension__ union
- {
- struct
- {
- short __espins;
- short __elision;
-# define __spins __elision_data.__espins
-# define __elision __elision_data.__elision
-# define __PTHREAD_SPINS { 0, 0 }
- } __elision_data;
- __pthread_slist_t __list;
- };
-#endif
- } __data;
- char __size[__SIZEOF_PTHREAD_MUTEX_T];
- long int __align;
-} pthread_mutex_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
- int __align;
-} pthread_mutexattr_t;
-
-
-/* Data structure for conditional variable handling. The structure of
- the attribute type is not exposed on purpose. */
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[__SIZEOF_PTHREAD_COND_T];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_CONDATTR_T];
- int __align;
-} pthread_condattr_t;
-
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Data structure for read-write lock variable handling. The
- structure of the attribute type is not exposed on purpose. */
-typedef union
-{
-# ifdef __x86_64__
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- int __writer;
- int __shared;
- signed char __rwelision;
-# ifdef __ILP32__
- unsigned char __pad1[3];
-# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 }
-# else
- unsigned char __pad1[7];
-# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 }
-# endif
- unsigned long int __pad2;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned int __flags;
-# define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1
- } __data;
-# else
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- unsigned char __shared;
- signed char __rwelision;
-# define __PTHREAD_RWLOCK_ELISION_EXTRA 0
- unsigned char __pad2;
- int __writer;
- } __data;
-# endif
- char __size[__SIZEOF_PTHREAD_RWLOCK_T];
- long int __align;
-} pthread_rwlock_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
- long int __align;
-} pthread_rwlockattr_t;
-#endif
-
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef volatile int pthread_spinlock_t;
-
-
-/* POSIX barriers data type. The structure of the type is
- deliberately not exposed. */
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIER_T];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
- int __align;
-} pthread_barrierattr_t;
-#endif
-
-
-#ifndef __x86_64__
-/* Extra attributes for the cleanup functions. */
-# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
-#endif
-
-#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/x86/bits/select.h b/sysdeps/x86/bits/select.h
index 6f090f14df..2c0a2b5eb3 100644
--- a/sysdeps/x86/bits/select.h
+++ b/sysdeps/x86/bits/select.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86/bits/semaphore.h b/sysdeps/x86/bits/semaphore.h
index c86dc6366c..1b8daf98be 100644
--- a/sysdeps/x86/bits/semaphore.h
+++ b/sysdeps/x86/bits/semaphore.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/x86/bits/setjmp.h b/sysdeps/x86/bits/setjmp.h
index bc72814f44..e0c22ac78f 100644
--- a/sysdeps/x86/bits/setjmp.h
+++ b/sysdeps/x86/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86/bits/string.h b/sysdeps/x86/bits/string.h
deleted file mode 100644
index e4e019f1fc..0000000000
--- a/sysdeps/x86/bits/string.h
+++ /dev/null
@@ -1,1994 +0,0 @@
-/* Optimized, inlined string functions. i486/x86-64 version.
- Copyright (C) 2001-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 _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* Use the unaligned string inline ABI. */
-#define _STRING_INLINE_unaligned 1
-
-/* Enable inline functions only for i486 or better when compiling for
- ia32. */
-#if !defined __x86_64__ && (defined __i486__ || defined __pentium__ \
- || defined __pentiumpro__ || defined __pentium4__ \
- || defined __nocona__ || defined __atom__ \
- || defined __core2__ || defined __corei7__ \
- || defined __sandybridge__ || defined __haswell__ \
- || defined __bonnell__ || defined __silvermont__ \
- || defined __k6__ || defined __geode__ \
- || defined __k8__ || defined __athlon__ \
- || defined __amdfam10__ || defined __bdver1__ \
- || defined __bdver2__ || defined __bdver3__ \
- || defined __bdver4__ || defined __btver1__ \
- || defined __btver2__)
-
-/* We only provide optimizations if the user selects them and if
- GNU CC is used. */
-# if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \
- && defined __GNUC__ && __GNUC__ >= 2
-
-# ifndef __STRING_INLINE
-# ifndef __extern_inline
-# define __STRING_INLINE inline
-# else
-# define __STRING_INLINE __extern_inline
-# endif
-# endif
-
-/* The macros are used in some of the optimized implementations below. */
-# define __STRING_SMALL_GET16(src, idx) \
- ((((const unsigned char *) (src))[idx + 1] << 8) \
- | ((const unsigned char *) (src))[idx])
-# define __STRING_SMALL_GET32(src, idx) \
- (((((const unsigned char *) (src))[idx + 3] << 8 \
- | ((const unsigned char *) (src))[idx + 2]) << 8 \
- | ((const unsigned char *) (src))[idx + 1]) << 8 \
- | ((const unsigned char *) (src))[idx])
-
-
-/* Copy N bytes of SRC to DEST. */
-# define _HAVE_STRING_ARCH_memcpy 1
-# define memcpy(dest, src, n) \
- (__extension__ (__builtin_constant_p (n) \
- ? __memcpy_c ((dest), (src), (n)) \
- : __memcpy_g ((dest), (src), (n))))
-# define __memcpy_c(dest, src, n) \
- ((n) == 0 \
- ? (dest) \
- : (((n) % 4 == 0) \
- ? __memcpy_by4 (dest, src, n) \
- : (((n) % 2 == 0) \
- ? __memcpy_by2 (dest, src, n) \
- : __memcpy_g (dest, src, n))))
-
-__STRING_INLINE void *__memcpy_by4 (void *__dest, const void *__src,
- size_t __n);
-
-__STRING_INLINE void *
-__memcpy_by4 (void *__dest, const void *__src, size_t __n)
-{
- register unsigned long int __d0, __d1;
- register void *__tmp = __dest;
- __asm__ __volatile__
- ("1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b"
- : "=&r" (__d0), "=&r" (__tmp), "=&r" (__src), "=&r" (__d1)
- : "1" (__tmp), "2" (__src), "3" (__n / 4)
- : "memory", "cc");
- return __dest;
-}
-
-__STRING_INLINE void *__memcpy_by2 (void *__dest, const void *__src,
- size_t __n);
-
-__STRING_INLINE void *
-__memcpy_by2 (void *__dest, const void *__src, size_t __n)
-{
- register unsigned long int __d0, __d1;
- register void *__tmp = __dest;
- __asm__ __volatile__
- ("shrl $1,%3\n\t"
- "jz 2f\n" /* only a word */
- "1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b\n"
- "2:\n\t"
- "movw (%2),%w0\n\t"
- "movw %w0,(%1)"
- : "=&q" (__d0), "=&r" (__tmp), "=&r" (__src), "=&r" (__d1)
- : "1" (__tmp), "2" (__src), "3" (__n / 2)
- : "memory", "cc");
- return __dest;
-}
-
-__STRING_INLINE void *__memcpy_g (void *__dest, const void *__src, size_t __n);
-
-__STRING_INLINE void *
-__memcpy_g (void *__dest, const void *__src, size_t __n)
-{
- register unsigned long int __d0, __d1, __d2;
- register void *__tmp = __dest;
- __asm__ __volatile__
- ("cld\n\t"
- "shrl $1,%%ecx\n\t"
- "jnc 1f\n\t"
- "movsb\n"
- "1:\n\t"
- "shrl $1,%%ecx\n\t"
- "jnc 2f\n\t"
- "movsw\n"
- "2:\n\t"
- "rep; movsl"
- : "=&c" (__d0), "=&D" (__d1), "=&S" (__d2),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
- : "0" (__n), "1" (__tmp), "2" (__src),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__src)
- : "cc");
- return __dest;
-}
-
-# define _HAVE_STRING_ARCH_memmove 1
-# ifndef _FORCE_INLINES
-/* Copy N bytes of SRC to DEST, guaranteeing
- correct behavior for overlapping strings. */
-# define memmove(dest, src, n) __memmove_g (dest, src, n)
-
-__STRING_INLINE void *__memmove_g (void *, const void *, size_t)
- __asm__ ("memmove");
-
-__STRING_INLINE void *
-__memmove_g (void *__dest, const void *__src, size_t __n)
-{
- register unsigned long int __d0, __d1, __d2;
- register void *__tmp = __dest;
- if (__dest < __src)
- __asm__ __volatile__
- ("cld\n\t"
- "rep; movsb"
- : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
- : "0" (__n), "1" (__src), "2" (__tmp),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__src));
- else
- __asm__ __volatile__
- ("decl %1\n\t"
- "decl %2\n\t"
- "std\n\t"
- "rep; movsb\n\t"
- "cld"
- : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
- : "0" (__n), "1" (__n + (const char *) __src),
- "2" (__n + (char *) __tmp),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__src));
- return __dest;
-}
-# endif
-
-/* Compare N bytes of S1 and S2. */
-# define _HAVE_STRING_ARCH_memcmp 1
-# ifndef _FORCE_INLINES
-# ifndef __PIC__
-/* gcc has problems to spill registers when using PIC. */
-__STRING_INLINE int
-memcmp (const void *__s1, const void *__s2, size_t __n)
-{
- register unsigned long int __d0, __d1, __d2;
- register int __res;
- __asm__ __volatile__
- ("cld\n\t"
- "testl %3,%3\n\t"
- "repe; cmpsb\n\t"
- "je 1f\n\t"
- "sbbl %0,%0\n\t"
- "orl $1,%0\n"
- "1:"
- : "=&a" (__res), "=&S" (__d0), "=&D" (__d1), "=&c" (__d2)
- : "0" (0), "1" (__s1), "2" (__s2), "3" (__n),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s1),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s2)
- : "cc");
- return __res;
-}
-# endif
-# endif
-
-/* Set N bytes of S to C. */
-# define _HAVE_STRING_ARCH_memset 1
-# define _USE_STRING_ARCH_memset 1
-# define memset(s, c, n) \
- (__extension__ (__builtin_constant_p (n) && (n) <= 16 \
- ? ((n) == 1 \
- ? __memset_c1 ((s), (c)) \
- : __memset_gc ((s), (c), (n))) \
- : (__builtin_constant_p (c) \
- ? (__builtin_constant_p (n) \
- ? __memset_ccn ((s), (c), (n)) \
- : memset ((s), (c), (n))) \
- : (__builtin_constant_p (n) \
- ? __memset_gcn ((s), (c), (n)) \
- : memset ((s), (c), (n))))))
-
-# define __memset_c1(s, c) ({ void *__s = (s); \
- *((unsigned char *) __s) = (unsigned char) (c); \
- __s; })
-
-# define __memset_gc(s, c, n) \
- ({ void *__s = (s); \
- union { \
- unsigned int __ui; \
- unsigned short int __usi; \
- unsigned char __uc; \
- } *__u = __s; \
- unsigned int __c = ((unsigned int) ((unsigned char) (c))) * 0x01010101; \
- \
- /* We apply a trick here. `gcc' would implement the following \
- assignments using immediate operands. But this uses to much \
- memory (7, instead of 4 bytes). So we force the value in a \
- registers. */ \
- if ((n) == 3 || (n) >= 5) \
- __asm__ __volatile__ ("" : "=r" (__c) : "0" (__c)); \
- \
- /* This `switch' statement will be removed at compile-time. */ \
- switch (n) \
- { \
- case 15: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 11: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 7: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 3: \
- __u->__usi = (unsigned short int) __c; \
- __u = __extension__ ((void *) __u + 2); \
- __u->__uc = (unsigned char) __c; \
- break; \
- \
- case 14: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 10: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 6: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 2: \
- __u->__usi = (unsigned short int) __c; \
- break; \
- \
- case 13: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 9: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 5: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 1: \
- __u->__uc = (unsigned char) __c; \
- break; \
- \
- case 16: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 12: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 8: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 4: \
- __u->__ui = __c; \
- case 0: \
- break; \
- } \
- \
- __s; })
-
-# define __memset_ccn(s, c, n) \
- (((n) % 4 == 0) \
- ? __memset_ccn_by4 (s, ((unsigned int) ((unsigned char) (c))) * 0x01010101,\
- n) \
- : (((n) % 2 == 0) \
- ? __memset_ccn_by2 (s, \
- ((unsigned int) ((unsigned char) (c))) * 0x01010101,\
- n) \
- : memset (s, c, n)))
-
-__STRING_INLINE void *__memset_ccn_by4 (void *__s, unsigned int __c,
- size_t __n);
-
-__STRING_INLINE void *
-__memset_ccn_by4 (void *__s, unsigned int __c, size_t __n)
-{
- register void *__tmp = __s;
- register unsigned long int __d0;
-# ifdef __i686__
- __asm__ __volatile__
- ("cld\n\t"
- "rep; stosl"
- : "=&a" (__c), "=&D" (__tmp), "=&c" (__d0),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
-# else
- __asm__ __volatile__
- ("1:\n\t"
- "movl %0,(%1)\n\t"
- "addl $4,%1\n\t"
- "decl %2\n\t"
- "jnz 1b\n"
- : "=&r" (__c), "=&r" (__tmp), "=&r" (__d0),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
-# endif
- return __s;
-}
-
-__STRING_INLINE void *__memset_ccn_by2 (void *__s, unsigned int __c,
- size_t __n);
-
-__STRING_INLINE void *
-__memset_ccn_by2 (void *__s, unsigned int __c, size_t __n)
-{
- register unsigned long int __d0, __d1;
- register void *__tmp = __s;
-# ifdef __i686__
- __asm__ __volatile__
- ("cld\n\t"
- "rep; stosl\n"
- "stosw"
- : "=&a" (__d0), "=&D" (__tmp), "=&c" (__d1),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
-# else
- __asm__ __volatile__
- ("1:\tmovl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %2\n\t"
- "jnz 1b\n"
- "movw %w0,(%1)"
- : "=&q" (__d0), "=&r" (__tmp), "=&r" (__d1),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
-#endif
- return __s;
-}
-
-# define __memset_gcn(s, c, n) \
- (((n) % 4 == 0) \
- ? __memset_gcn_by4 (s, c, n) \
- : (((n) % 2 == 0) \
- ? __memset_gcn_by2 (s, c, n) \
- : memset (s, c, n)))
-
-__STRING_INLINE void *__memset_gcn_by4 (void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memset_gcn_by4 (void *__s, int __c, size_t __n)
-{
- register void *__tmp = __s;
- register unsigned long int __d0;
- __asm__ __volatile__
- ("movb %b0,%h0\n"
- "pushw %w0\n\t"
- "shll $16,%0\n\t"
- "popw %w0\n"
- "1:\n\t"
- "movl %0,(%1)\n\t"
- "addl $4,%1\n\t"
- "decl %2\n\t"
- "jnz 1b\n"
- : "=&q" (__c), "=&r" (__tmp), "=&r" (__d0),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
- return __s;
-}
-
-__STRING_INLINE void *__memset_gcn_by2 (void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memset_gcn_by2 (void *__s, int __c, size_t __n)
-{
- register unsigned long int __d0, __d1;
- register void *__tmp = __s;
- __asm__ __volatile__
- ("movb %b0,%h0\n\t"
- "pushw %w0\n\t"
- "shll $16,%0\n\t"
- "popw %w0\n"
- "1:\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %2\n\t"
- "jnz 1b\n"
- "movw %w0,(%1)"
- : "=&q" (__d0), "=&r" (__tmp), "=&r" (__d1),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
- return __s;
-}
-
-
-/* Search N bytes of S for C. */
-# define _HAVE_STRING_ARCH_memchr 1
-# ifndef _FORCE_INLINES
-__STRING_INLINE void *
-memchr (const void *__s, int __c, size_t __n)
-{
- register unsigned long int __d0;
-# ifdef __i686__
- register unsigned long int __d1;
-# endif
- register unsigned char *__res;
- if (__n == 0)
- return NULL;
-# ifdef __i686__
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "cmovne %2,%0"
- : "=D" (__res), "=&c" (__d0), "=&r" (__d1)
- : "a" (__c), "0" (__s), "1" (__n), "2" (1),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "cc");
-# else
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "je 1f\n\t"
- "movl $1,%0\n"
- "1:"
- : "=D" (__res), "=&c" (__d0)
- : "a" (__c), "0" (__s), "1" (__n),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "cc");
-# endif
- return __res - 1;
-}
-# endif
-
-# define _HAVE_STRING_ARCH_memrchr 1
-# ifndef _FORCE_INLINES
-__STRING_INLINE void *__memrchr (const void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memrchr (const void *__s, int __c, size_t __n)
-{
- register unsigned long int __d0;
-# ifdef __i686__
- register unsigned long int __d1;
-# endif
- register void *__res;
- if (__n == 0)
- return NULL;
-# ifdef __i686__
- __asm__ __volatile__
- ("std\n\t"
- "repne; scasb\n\t"
- "cmovne %2,%0\n\t"
- "cld\n\t"
- "incl %0"
- : "=D" (__res), "=&c" (__d0), "=&r" (__d1)
- : "a" (__c), "0" (__s + __n - 1), "1" (__n), "2" (-1),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "cc");
-# else
- __asm__ __volatile__
- ("std\n\t"
- "repne; scasb\n\t"
- "je 1f\n\t"
- "orl $-1,%0\n"
- "1:\tcld\n\t"
- "incl %0"
- : "=D" (__res), "=&c" (__d0)
- : "a" (__c), "0" (__s + __n - 1), "1" (__n),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "cc");
-# endif
- return __res;
-}
-# ifdef __USE_GNU
-# define memrchr(s, c, n) __memrchr ((s), (c), (n))
-# endif
-# endif
-
-/* Return pointer to C in S. */
-# define _HAVE_STRING_ARCH_rawmemchr 1
-__STRING_INLINE void *__rawmemchr (const void *__s, int __c);
-
-# ifndef _FORCE_INLINES
-__STRING_INLINE void *
-__rawmemchr (const void *__s, int __c)
-{
- register unsigned long int __d0;
- register unsigned char *__res;
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- : "=D" (__res), "=&c" (__d0)
- : "a" (__c), "0" (__s), "1" (0xffffffff),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res - 1;
-}
-# ifdef __USE_GNU
-__STRING_INLINE void *
-rawmemchr (const void *__s, int __c)
-{
- return __rawmemchr (__s, __c);
-}
-# endif /* use GNU */
-# endif
-
-
-/* Return the length of S. */
-# define _HAVE_STRING_ARCH_strlen 1
-# define strlen(str) \
- (__extension__ (__builtin_constant_p (str) \
- ? __builtin_strlen (str) \
- : __strlen_g (str)))
-__STRING_INLINE size_t __strlen_g (const char *__str);
-
-__STRING_INLINE size_t
-__strlen_g (const char *__str)
-{
- register char __dummy;
- register const char *__tmp = __str;
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%b1\n\t"
- "leal 1(%0),%0\n\t"
- "testb %b1,%b1\n\t"
- "jne 1b"
- : "=r" (__tmp), "=&q" (__dummy)
- : "0" (__str),
- "m" ( *(struct { char __x[0xfffffff]; } *)__str)
- : "cc" );
- return __tmp - __str - 1;
-}
-
-
-/* Copy SRC to DEST. */
-# define _HAVE_STRING_ARCH_strcpy 1
-# define strcpy(dest, src) \
- (__extension__ (__builtin_constant_p (src) \
- ? (sizeof ((src)[0]) == 1 && strlen (src) + 1 <= 8 \
- ? __strcpy_a_small ((dest), (src), strlen (src) + 1) \
- : (char *) memcpy ((char *) (dest), \
- (const char *) (src), \
- strlen (src) + 1)) \
- : __strcpy_g ((dest), (src))))
-
-# define __strcpy_a_small(dest, src, srclen) \
- (__extension__ ({ char *__dest = (dest); \
- union { \
- unsigned int __ui; \
- unsigned short int __usi; \
- unsigned char __uc; \
- char __c; \
- } *__u = (void *) __dest; \
- switch (srclen) \
- { \
- case 1: \
- __u->__uc = '\0'; \
- break; \
- case 2: \
- __u->__usi = __STRING_SMALL_GET16 (src, 0); \
- break; \
- case 3: \
- __u->__usi = __STRING_SMALL_GET16 (src, 0); \
- __u = __extension__ ((void *) __u + 2); \
- __u->__uc = '\0'; \
- break; \
- case 4: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- break; \
- case 5: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__uc = '\0'; \
- break; \
- case 6: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__usi = __STRING_SMALL_GET16 (src, 4); \
- break; \
- case 7: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__usi = __STRING_SMALL_GET16 (src, 4); \
- __u = __extension__ ((void *) __u + 2); \
- __u->__uc = '\0'; \
- break; \
- case 8: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__ui = __STRING_SMALL_GET32 (src, 4); \
- break; \
- } \
- (char *) __dest; }))
-
-__STRING_INLINE char *__strcpy_g (char *__dest, const char *__src);
-
-__STRING_INLINE char *
-__strcpy_g (char *__dest, const char *__src)
-{
- register char *__tmp = __dest;
- register char __dummy;
- __asm__ __volatile__
- (
- "1:\n\t"
- "movb (%0),%b2\n\t"
- "leal 1(%0),%0\n\t"
- "movb %b2,(%1)\n\t"
- "leal 1(%1),%1\n\t"
- "testb %b2,%b2\n\t"
- "jne 1b"
- : "=&r" (__src), "=&r" (__tmp), "=&q" (__dummy),
- "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
- : "0" (__src), "1" (__tmp),
- "m" ( *(struct { char __x[0xfffffff]; } *)__src)
- : "cc");
- return __dest;
-}
-
-
-# ifdef __USE_GNU
-# define _HAVE_STRING_ARCH_stpcpy 1
-/* Copy SRC to DEST. */
-# define __stpcpy(dest, src) \
- (__extension__ (__builtin_constant_p (src) \
- ? (strlen (src) + 1 <= 8 \
- ? __stpcpy_a_small ((dest), (src), strlen (src) + 1) \
- : __stpcpy_c ((dest), (src), strlen (src) + 1)) \
- : __stpcpy_g ((dest), (src))))
-# define __stpcpy_c(dest, src, srclen) \
- ((srclen) % 4 == 0 \
- ? __mempcpy_by4 (dest, src, srclen) - 1 \
- : ((srclen) % 2 == 0 \
- ? __mempcpy_by2 (dest, src, srclen) - 1 \
- : __mempcpy_byn (dest, src, srclen) - 1))
-
-/* In glibc itself we use this symbol for namespace reasons. */
-# define stpcpy(dest, src) __stpcpy ((dest), (src))
-
-# define __stpcpy_a_small(dest, src, srclen) \
- (__extension__ ({ union { \
- unsigned int __ui; \
- unsigned short int __usi; \
- unsigned char __uc; \
- char __c; \
- } *__u = (void *) (dest); \
- switch (srclen) \
- { \
- case 1: \
- __u->__uc = '\0'; \
- break; \
- case 2: \
- __u->__usi = __STRING_SMALL_GET16 (src, 0); \
- __u = __extension__ ((void *) __u + 1); \
- break; \
- case 3: \
- __u->__usi = __STRING_SMALL_GET16 (src, 0); \
- __u = __extension__ ((void *) __u + 2); \
- __u->__uc = '\0'; \
- break; \
- case 4: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 3); \
- break; \
- case 5: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__uc = '\0'; \
- break; \
- case 6: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__usi = __STRING_SMALL_GET16 (src, 4); \
- __u = __extension__ ((void *) __u + 1); \
- break; \
- case 7: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__usi = __STRING_SMALL_GET16 (src, 4); \
- __u = __extension__ ((void *) __u + 2); \
- __u->__uc = '\0'; \
- break; \
- case 8: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__ui = __STRING_SMALL_GET32 (src, 4); \
- __u = __extension__ ((void *) __u + 3); \
- break; \
- } \
- (char *) __u; }))
-
-__STRING_INLINE char *__mempcpy_by4 (char *__dest, const char *__src,
- size_t __srclen);
-
-__STRING_INLINE char *
-__mempcpy_by4 (char *__dest, const char *__src, size_t __srclen)
-{
- register char *__tmp = __dest;
- register unsigned long int __d0, __d1;
- __asm__ __volatile__
- ("1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b"
- : "=&r" (__d0), "=r" (__tmp), "=&r" (__src), "=&r" (__d1)
- : "1" (__tmp), "2" (__src), "3" (__srclen / 4)
- : "memory", "cc");
- return __tmp;
-}
-
-__STRING_INLINE char *__mempcpy_by2 (char *__dest, const char *__src,
- size_t __srclen);
-
-__STRING_INLINE char *
-__mempcpy_by2 (char *__dest, const char *__src, size_t __srclen)
-{
- register char *__tmp = __dest;
- register unsigned long int __d0, __d1;
- __asm__ __volatile__
- ("shrl $1,%3\n\t"
- "jz 2f\n" /* only a word */
- "1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b\n"
- "2:\n\t"
- "movw (%2),%w0\n\t"
- "movw %w0,(%1)"
- : "=&q" (__d0), "=r" (__tmp), "=&r" (__src), "=&r" (__d1),
- "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
- : "1" (__tmp), "2" (__src), "3" (__srclen / 2),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- return __tmp + 2;
-}
-
-__STRING_INLINE char *__mempcpy_byn (char *__dest, const char *__src,
- size_t __srclen);
-
-__STRING_INLINE char *
-__mempcpy_byn (char *__dest, const char *__src, size_t __srclen)
-{
- register unsigned long __d0, __d1;
- register char *__tmp = __dest;
- __asm__ __volatile__
- ("cld\n\t"
- "shrl $1,%%ecx\n\t"
- "jnc 1f\n\t"
- "movsb\n"
- "1:\n\t"
- "shrl $1,%%ecx\n\t"
- "jnc 2f\n\t"
- "movsw\n"
- "2:\n\t"
- "rep; movsl"
- : "=D" (__tmp), "=&c" (__d0), "=&S" (__d1),
- "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
- : "0" (__tmp), "1" (__srclen), "2" (__src),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- return __tmp;
-}
-
-__STRING_INLINE char *__stpcpy_g (char *__dest, const char *__src);
-
-__STRING_INLINE char *
-__stpcpy_g (char *__dest, const char *__src)
-{
- register char *__tmp = __dest;
- register char __dummy;
- __asm__ __volatile__
- (
- "1:\n\t"
- "movb (%0),%b2\n\t"
- "leal 1(%0),%0\n\t"
- "movb %b2,(%1)\n\t"
- "leal 1(%1),%1\n\t"
- "testb %b2,%b2\n\t"
- "jne 1b"
- : "=&r" (__src), "=r" (__tmp), "=&q" (__dummy),
- "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
- : "0" (__src), "1" (__tmp),
- "m" ( *(struct { char __x[0xfffffff]; } *)__src)
- : "cc");
- return __tmp - 1;
-}
-# endif
-
-
-/* Copy no more than N characters of SRC to DEST. */
-# define _HAVE_STRING_ARCH_strncpy 1
-# define strncpy(dest, src, n) \
- (__extension__ (__builtin_constant_p (src) \
- ? ((strlen (src) + 1 >= ((size_t) (n)) \
- ? (char *) memcpy ((char *) (dest), \
- (const char *) (src), n) \
- : __strncpy_cg ((dest), (src), strlen (src) + 1, n))) \
- : __strncpy_gg ((dest), (src), n)))
-# define __strncpy_cg(dest, src, srclen, n) \
- (((srclen) % 4 == 0) \
- ? __strncpy_by4 (dest, src, srclen, n) \
- : (((srclen) % 2 == 0) \
- ? __strncpy_by2 (dest, src, srclen, n) \
- : __strncpy_byn (dest, src, srclen, n)))
-
-__STRING_INLINE char *__strncpy_by4 (char *__dest, const char __src[],
- size_t __srclen, size_t __n);
-
-__STRING_INLINE char *
-__strncpy_by4 (char *__dest, const char __src[], size_t __srclen, size_t __n)
-{
- register char *__tmp = __dest;
- register int __dummy1, __dummy2;
- __asm__ __volatile__
- ("1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b"
- : "=&r" (__dummy1), "=r" (__tmp), "=&r" (__src), "=&r" (__dummy2),
- "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
- : "1" (__tmp), "2" (__src), "3" (__srclen / 4),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- (void) memset (__tmp, '\0', __n - __srclen);
- return __dest;
-}
-
-__STRING_INLINE char *__strncpy_by2 (char *__dest, const char __src[],
- size_t __srclen, size_t __n);
-
-__STRING_INLINE char *
-__strncpy_by2 (char *__dest, const char __src[], size_t __srclen, size_t __n)
-{
- register char *__tmp = __dest;
- register int __dummy1, __dummy2;
- __asm__ __volatile__
- ("shrl $1,%3\n\t"
- "jz 2f\n" /* only a word */
- "1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b\n"
- "2:\n\t"
- "movw (%2),%w0\n\t"
- "movw %w0,(%1)\n\t"
- : "=&q" (__dummy1), "=r" (__tmp), "=&r" (__src), "=&r" (__dummy2),
- "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
- : "1" (__tmp), "2" (__src), "3" (__srclen / 2),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- (void) memset (__tmp + 2, '\0', __n - __srclen);
- return __dest;
-}
-
-__STRING_INLINE char *__strncpy_byn (char *__dest, const char __src[],
- size_t __srclen, size_t __n);
-
-__STRING_INLINE char *
-__strncpy_byn (char *__dest, const char __src[], size_t __srclen, size_t __n)
-{
- register unsigned long int __d0, __d1;
- register char *__tmp = __dest;
- __asm__ __volatile__
- ("cld\n\t"
- "shrl $1,%1\n\t"
- "jnc 1f\n\t"
- "movsb\n"
- "1:\n\t"
- "shrl $1,%1\n\t"
- "jnc 2f\n\t"
- "movsw\n"
- "2:\n\t"
- "rep; movsl"
- : "=D" (__tmp), "=&c" (__d0), "=&S" (__d1),
- "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
- : "1" (__srclen), "0" (__tmp),"2" (__src),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- (void) memset (__tmp, '\0', __n - __srclen);
- return __dest;
-}
-
-__STRING_INLINE char *__strncpy_gg (char *__dest, const char *__src,
- size_t __n);
-
-__STRING_INLINE char *
-__strncpy_gg (char *__dest, const char *__src, size_t __n)
-{
- register char *__tmp = __dest;
- register char __dummy;
- if (__n > 0)
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%2\n\t"
- "incl %0\n\t"
- "movb %2,(%1)\n\t"
- "incl %1\n\t"
- "decl %3\n\t"
- "je 3f\n\t"
- "testb %2,%2\n\t"
- "jne 1b\n\t"
- "2:\n\t"
- "movb %2,(%1)\n\t"
- "incl %1\n\t"
- "decl %3\n\t"
- "jne 2b\n\t"
- "3:"
- : "=&r" (__src), "=&r" (__tmp), "=&q" (__dummy), "=&r" (__n)
- : "0" (__src), "1" (__tmp), "3" (__n)
- : "memory", "cc");
-
- return __dest;
-}
-
-
-/* Append SRC onto DEST. */
-# define _HAVE_STRING_ARCH_strcat 1
-# define strcat(dest, src) \
- (__extension__ (__builtin_constant_p (src) \
- ? __strcat_c ((dest), (src), strlen (src) + 1) \
- : __strcat_g ((dest), (src))))
-
-__STRING_INLINE char *__strcat_c (char *__dest, const char __src[],
- size_t __srclen);
-
-__STRING_INLINE char *
-__strcat_c (char *__dest, const char __src[], size_t __srclen)
-{
-# ifdef __i686__
- register unsigned long int __d0;
- register char *__tmp;
- __asm__ __volatile__
- ("repne; scasb"
- : "=D" (__tmp), "=&c" (__d0),
- "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
- : "0" (__dest), "1" (0xffffffff), "a" (0),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- --__tmp;
-# else
- register char *__tmp = __dest;
- __asm__ __volatile__
- ("decl %0\n\t"
- "1:\n\t"
- "incl %0\n\t"
- "cmpb $0,(%0)\n\t"
- "jne 1b\n"
- : "=r" (__tmp),
- "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
- : "0" (__tmp),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
-# endif
- (void) memcpy (__tmp, __src, __srclen);
- return __dest;
-}
-
-__STRING_INLINE char *__strcat_g (char *__dest, const char *__src);
-
-__STRING_INLINE char *
-__strcat_g (char *__dest, const char *__src)
-{
- register char *__tmp = __dest;
- register char __dummy;
- __asm__ __volatile__
- ("decl %1\n\t"
- "1:\n\t"
- "incl %1\n\t"
- "cmpb $0,(%1)\n\t"
- "jne 1b\n"
- "2:\n\t"
- "movb (%2),%b0\n\t"
- "incl %2\n\t"
- "movb %b0,(%1)\n\t"
- "incl %1\n\t"
- "testb %b0,%b0\n\t"
- "jne 2b\n"
- : "=&q" (__dummy), "=&r" (__tmp), "=&r" (__src),
- "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
- : "1" (__tmp), "2" (__src),
- "m" ( *(struct { char __x[0xfffffff]; } *)__src)
- : "memory", "cc");
- return __dest;
-}
-
-
-/* Append no more than N characters from SRC onto DEST. */
-# define _HAVE_STRING_ARCH_strncat 1
-# define strncat(dest, src, n) \
- (__extension__ ({ char *__dest = (dest); \
- __builtin_constant_p (src) && __builtin_constant_p (n) \
- ? (strlen (src) < ((size_t) (n)) \
- ? strcat (__dest, (src)) \
- : (*(char *)__mempcpy (strchr (__dest, '\0'), \
- (const char *) (src), \
- (n)) = 0, __dest)) \
- : __strncat_g (__dest, (src), (n)); }))
-
-__STRING_INLINE char *__strncat_g (char *__dest, const char __src[],
- size_t __n);
-
-__STRING_INLINE char *
-__strncat_g (char *__dest, const char __src[], size_t __n)
-{
- register char *__tmp = __dest;
- register char __dummy;
-# ifdef __i686__
- __asm__ __volatile__
- ("repne; scasb\n"
- "movl %4, %3\n\t"
- "decl %1\n\t"
- "1:\n\t"
- "subl $1,%3\n\t"
- "jc 2f\n\t"
- "movb (%2),%b0\n\t"
- "movsb\n\t"
- "testb %b0,%b0\n\t"
- "jne 1b\n\t"
- "decl %1\n"
- "2:\n\t"
- "movb $0,(%1)"
- : "=&a" (__dummy), "=&D" (__tmp), "=&S" (__src), "=&c" (__n)
- : "g" (__n), "0" (0), "1" (__tmp), "2" (__src), "3" (0xffffffff)
- : "memory", "cc");
-# else
- --__tmp;
- __asm__ __volatile__
- ("1:\n\t"
- "cmpb $0,1(%1)\n\t"
- "leal 1(%1),%1\n\t"
- "jne 1b\n"
- "2:\n\t"
- "subl $1,%3\n\t"
- "jc 3f\n\t"
- "movb (%2),%b0\n\t"
- "leal 1(%2),%2\n\t"
- "movb %b0,(%1)\n\t"
- "leal 1(%1),%1\n\t"
- "testb %b0,%b0\n\t"
- "jne 2b\n\t"
- "decl %1\n"
- "3:\n\t"
- "movb $0,(%1)"
- : "=&q" (__dummy), "=&r" (__tmp), "=&r" (__src), "=&r" (__n)
- : "1" (__tmp), "2" (__src), "3" (__n)
- : "memory", "cc");
-#endif
- return __dest;
-}
-
-
-/* Compare S1 and S2. */
-# define _HAVE_STRING_ARCH_strcmp 1
-# define strcmp(s1, s2) \
- (__extension__ (__builtin_constant_p (s1) && __builtin_constant_p (s2) \
- && (sizeof ((s1)[0]) != 1 || strlen (s1) >= 4) \
- && (sizeof ((s2)[0]) != 1 || strlen (s2) >= 4) \
- ? memcmp ((const char *) (s1), (const char *) (s2), \
- (strlen (s1) < strlen (s2) \
- ? strlen (s1) : strlen (s2)) + 1) \
- : (__builtin_constant_p (s1) && sizeof ((s1)[0]) == 1 \
- && sizeof ((s2)[0]) == 1 && strlen (s1) < 4 \
- ? (__builtin_constant_p (s2) && sizeof ((s2)[0]) == 1 \
- ? __strcmp_cc ((const unsigned char *) (s1), \
- (const unsigned char *) (s2), \
- strlen (s1)) \
- : __strcmp_cg ((const unsigned char *) (s1), \
- (const unsigned char *) (s2), \
- strlen (s1))) \
- : (__builtin_constant_p (s2) && sizeof ((s1)[0]) == 1 \
- && sizeof ((s2)[0]) == 1 && strlen (s2) < 4 \
- ? (__builtin_constant_p (s1) \
- ? __strcmp_cc ((const unsigned char *) (s1), \
- (const unsigned char *) (s2), \
- strlen (s2)) \
- : __strcmp_gc ((const unsigned char *) (s1), \
- (const unsigned char *) (s2), \
- strlen (s2))) \
- : __strcmp_gg ((s1), (s2))))))
-
-# define __strcmp_cc(s1, s2, l) \
- (__extension__ ({ register int __result = (s1)[0] - (s2)[0]; \
- if (l > 0 && __result == 0) \
- { \
- __result = (s1)[1] - (s2)[1]; \
- if (l > 1 && __result == 0) \
- { \
- __result = (s1)[2] - (s2)[2]; \
- if (l > 2 && __result == 0) \
- __result = (s1)[3] - (s2)[3]; \
- } \
- } \
- __result; }))
-
-# define __strcmp_cg(s1, s2, l1) \
- (__extension__ ({ const unsigned char *__s2 = (s2); \
- register int __result = (s1)[0] - __s2[0]; \
- if (l1 > 0 && __result == 0) \
- { \
- __result = (s1)[1] - __s2[1]; \
- if (l1 > 1 && __result == 0) \
- { \
- __result = (s1)[2] - __s2[2]; \
- if (l1 > 2 && __result == 0) \
- __result = (s1)[3] - __s2[3]; \
- } \
- } \
- __result; }))
-
-# define __strcmp_gc(s1, s2, l2) \
- (__extension__ ({ const unsigned char *__s1 = (s1); \
- register int __result = __s1[0] - (s2)[0]; \
- if (l2 > 0 && __result == 0) \
- { \
- __result = __s1[1] - (s2)[1]; \
- if (l2 > 1 && __result == 0) \
- { \
- __result = __s1[2] - (s2)[2]; \
- if (l2 > 2 && __result == 0) \
- __result = __s1[3] - (s2)[3]; \
- } \
- } \
- __result; }))
-
-__STRING_INLINE int __strcmp_gg (const char *__s1, const char *__s2);
-
-__STRING_INLINE int
-__strcmp_gg (const char *__s1, const char *__s2)
-{
- register int __res;
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%1),%b0\n\t"
- "leal 1(%1),%1\n\t"
- "cmpb %b0,(%2)\n\t"
- "jne 2f\n\t"
- "leal 1(%2),%2\n\t"
- "testb %b0,%b0\n\t"
- "jne 1b\n\t"
- "xorl %0,%0\n\t"
- "jmp 3f\n"
- "2:\n\t"
- "movl $1,%0\n\t"
- "jb 3f\n\t"
- "negl %0\n"
- "3:"
- : "=q" (__res), "=&r" (__s1), "=&r" (__s2)
- : "1" (__s1), "2" (__s2),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s1),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s2)
- : "cc");
- return __res;
-}
-
-
-/* Compare N characters of S1 and S2. */
-# define _HAVE_STRING_ARCH_strncmp 1
-# define strncmp(s1, s2, n) \
- (__extension__ (__builtin_constant_p (s1) && strlen (s1) < ((size_t) (n)) \
- ? strcmp ((s1), (s2)) \
- : (__builtin_constant_p (s2) && strlen (s2) < ((size_t) (n))\
- ? strcmp ((s1), (s2)) \
- : __strncmp_g ((s1), (s2), (n)))))
-
-__STRING_INLINE int __strncmp_g (const char *__s1, const char *__s2,
- size_t __n);
-
-__STRING_INLINE int
-__strncmp_g (const char *__s1, const char *__s2, size_t __n)
-{
- register int __res;
- __asm__ __volatile__
- ("1:\n\t"
- "subl $1,%3\n\t"
- "jc 2f\n\t"
- "movb (%1),%b0\n\t"
- "incl %1\n\t"
- "cmpb %b0,(%2)\n\t"
- "jne 3f\n\t"
- "incl %2\n\t"
- "testb %b0,%b0\n\t"
- "jne 1b\n"
- "2:\n\t"
- "xorl %0,%0\n\t"
- "jmp 4f\n"
- "3:\n\t"
- "movl $1,%0\n\t"
- "jb 4f\n\t"
- "negl %0\n"
- "4:"
- : "=q" (__res), "=&r" (__s1), "=&r" (__s2), "=&r" (__n)
- : "1" (__s1), "2" (__s2), "3" (__n),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s1),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s2)
- : "cc");
- return __res;
-}
-
-
-/* Find the first occurrence of C in S. */
-# define _HAVE_STRING_ARCH_strchr 1
-# define _USE_STRING_ARCH_strchr 1
-# define strchr(s, c) \
- (__extension__ (__builtin_constant_p (c) \
- ? ((c) == '\0' \
- ? (char *) __rawmemchr ((s), (c)) \
- : __strchr_c ((s), ((c) & 0xff) << 8)) \
- : __strchr_g ((s), (c))))
-
-__STRING_INLINE char *__strchr_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchr_c (const char *__s, int __c)
-{
- register unsigned long int __d0;
- register char *__res;
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%%al\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "leal 1(%0),%0\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n\t"
- "xorl %0,%0\n"
- "2:"
- : "=r" (__res), "=&a" (__d0)
- : "0" (__s), "1" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-
-__STRING_INLINE char *__strchr_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchr_g (const char *__s, int __c)
-{
- register unsigned long int __d0;
- register char *__res;
- __asm__ __volatile__
- ("movb %%al,%%ah\n"
- "1:\n\t"
- "movb (%0),%%al\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "leal 1(%0),%0\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n\t"
- "xorl %0,%0\n"
- "2:"
- : "=r" (__res), "=&a" (__d0)
- : "0" (__s), "1" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-
-
-/* Find the first occurrence of C in S or the final NUL byte. */
-# define _HAVE_STRING_ARCH_strchrnul 1
-# define __strchrnul(s, c) \
- (__extension__ (__builtin_constant_p (c) \
- ? ((c) == '\0' \
- ? (char *) __rawmemchr ((s), c) \
- : __strchrnul_c ((s), ((c) & 0xff) << 8)) \
- : __strchrnul_g ((s), c)))
-
-__STRING_INLINE char *__strchrnul_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchrnul_c (const char *__s, int __c)
-{
- register unsigned long int __d0;
- register char *__res;
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%%al\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "leal 1(%0),%0\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n\t"
- "decl %0\n"
- "2:"
- : "=r" (__res), "=&a" (__d0)
- : "0" (__s), "1" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-
-__STRING_INLINE char *__strchrnul_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchrnul_g (const char *__s, int __c)
-{
- register unsigned long int __d0;
- register char *__res;
- __asm__ __volatile__
- ("movb %%al,%%ah\n"
- "1:\n\t"
- "movb (%0),%%al\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "leal 1(%0),%0\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n\t"
- "decl %0\n"
- "2:"
- : "=r" (__res), "=&a" (__d0)
- : "0" (__s), "1" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-# ifdef __USE_GNU
-# define strchrnul(s, c) __strchrnul ((s), (c))
-# endif
-
-
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
-/* Find the first occurrence of C in S. This is the BSD name. */
-# define _HAVE_STRING_ARCH_index 1
-# define index(s, c) \
- (__extension__ (__builtin_constant_p (c) \
- ? __strchr_c ((s), ((c) & 0xff) << 8) \
- : __strchr_g ((s), (c))))
-# endif
-
-
-/* Find the last occurrence of C in S. */
-# define _HAVE_STRING_ARCH_strrchr 1
-# define strrchr(s, c) \
- (__extension__ (__builtin_constant_p (c) \
- ? __strrchr_c ((s), ((c) & 0xff) << 8) \
- : __strrchr_g ((s), (c))))
-
-# ifdef __i686__
-__STRING_INLINE char *__strrchr_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_c (const char *__s, int __c)
-{
- register unsigned long int __d0, __d1;
- register char *__res;
- __asm__ __volatile__
- ("cld\n"
- "1:\n\t"
- "lodsb\n\t"
- "cmpb %h2,%b2\n\t"
- "cmove %1,%0\n\t"
- "testb %b2,%b2\n\t"
- "jne 1b"
- : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
- : "0" (1), "1" (__s), "2" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res - 1;
-}
-
-__STRING_INLINE char *__strrchr_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_g (const char *__s, int __c)
-{
- register unsigned long int __d0, __d1;
- register char *__res;
- __asm__ __volatile__
- ("movb %b2,%h2\n"
- "cld\n\t"
- "1:\n\t"
- "lodsb\n\t"
- "cmpb %h2,%b2\n\t"
- "cmove %1,%0\n\t"
- "testb %b2,%b2\n\t"
- "jne 1b"
- : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
- : "0" (1), "1" (__s), "2" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res - 1;
-}
-# else
-__STRING_INLINE char *__strrchr_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_c (const char *__s, int __c)
-{
- register unsigned long int __d0, __d1;
- register char *__res;
- __asm__ __volatile__
- ("cld\n"
- "1:\n\t"
- "lodsb\n\t"
- "cmpb %%ah,%%al\n\t"
- "jne 2f\n\t"
- "leal -1(%%esi),%0\n"
- "2:\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b"
- : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
- : "0" (0), "1" (__s), "2" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-
-__STRING_INLINE char *__strrchr_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_g (const char *__s, int __c)
-{
- register unsigned long int __d0, __d1;
- register char *__res;
- __asm__ __volatile__
- ("movb %%al,%%ah\n"
- "cld\n\t"
- "1:\n\t"
- "lodsb\n\t"
- "cmpb %%ah,%%al\n\t"
- "jne 2f\n\t"
- "leal -1(%%esi),%0\n"
- "2:\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b"
- : "=r" (__res), "=&S" (__d0), "=&a" (__d1)
- : "0" (0), "1" (__s), "2" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-# endif
-
-
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
-/* Find the last occurrence of C in S. This is the BSD name. */
-# define _HAVE_STRING_ARCH_rindex 1
-# define rindex(s, c) \
- (__extension__ (__builtin_constant_p (c) \
- ? __strrchr_c ((s), ((c) & 0xff) << 8) \
- : __strrchr_g ((s), (c))))
-# endif
-
-
-/* Return the length of the initial segment of S which
- consists entirely of characters not in REJECT. */
-# define _HAVE_STRING_ARCH_strcspn 1
-# define strcspn(s, reject) \
- (__extension__ (__builtin_constant_p (reject) && sizeof ((reject)[0]) == 1 \
- ? ((reject)[0] == '\0' \
- ? strlen (s) \
- : ((reject)[1] == '\0' \
- ? __strcspn_c1 ((s), (((reject)[0] << 8) & 0xff00)) \
- : __strcspn_cg ((s), (reject), strlen (reject)))) \
- : __strcspn_g ((s), (reject))))
-
-__STRING_INLINE size_t __strcspn_c1 (const char *__s, int __reject);
-
-# ifndef _FORCE_INLINES
-__STRING_INLINE size_t
-__strcspn_c1 (const char *__s, int __reject)
-{
- register unsigned long int __d0;
- register char *__res;
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%%al\n\t"
- "leal 1(%0),%0\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n"
- "2:"
- : "=r" (__res), "=&a" (__d0)
- : "0" (__s), "1" (__reject),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return (__res - 1) - __s;
-}
-# endif
-
-__STRING_INLINE size_t __strcspn_cg (const char *__s, const char __reject[],
- size_t __reject_len);
-
-__STRING_INLINE size_t
-__strcspn_cg (const char *__s, const char __reject[], size_t __reject_len)
-{
- register unsigned long int __d0, __d1, __d2;
- register const char *__res;
- __asm__ __volatile__
- ("cld\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %5,%%edi\n\t"
- "movl %6,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n"
- "2:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "0" (__s), "d" (__reject), "g" (__reject_len)
- : "memory", "cc");
- return (__res - 1) - __s;
-}
-
-__STRING_INLINE size_t __strcspn_g (const char *__s, const char *__reject);
-# ifdef __PIC__
-
-__STRING_INLINE size_t
-__strcspn_g (const char *__s, const char *__reject)
-{
- register unsigned long int __d0, __d1, __d2;
- register const char *__res;
- __asm__ __volatile__
- ("pushl %%ebx\n\t"
- "movl %4,%%edi\n\t"
- "cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%ebx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %4,%%edi\n\t"
- "movl %%ebx,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n"
- "2:\n\t"
- "popl %%ebx"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "r" (__reject), "0" (__s), "1" (0), "2" (0xffffffff)
- : "memory", "cc");
- return (__res - 1) - __s;
-}
-# else
-__STRING_INLINE size_t
-__strcspn_g (const char *__s, const char *__reject)
-{
- register unsigned long int __d0, __d1, __d2, __d3;
- register const char *__res;
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%edx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %%ebx,%%edi\n\t"
- "movl %%edx,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n"
- "2:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2), "=&d" (__d3)
- : "0" (__s), "1" (0), "2" (0xffffffff), "3" (__reject), "b" (__reject)
- /* Clobber memory, otherwise GCC cannot handle this. */
- : "memory", "cc");
- return (__res - 1) - __s;
-}
-# endif
-
-
-/* Return the length of the initial segment of S which
- consists entirely of characters in ACCEPT. */
-# define _HAVE_STRING_ARCH_strspn 1
-# define strspn(s, accept) \
- (__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
- ? ((accept)[0] == '\0' \
- ? ((void) (s), 0) \
- : ((accept)[1] == '\0' \
- ? __strspn_c1 ((s), (((accept)[0] << 8 ) & 0xff00)) \
- : __strspn_cg ((s), (accept), strlen (accept)))) \
- : __strspn_g ((s), (accept))))
-
-# ifndef _FORCE_INLINES
-__STRING_INLINE size_t __strspn_c1 (const char *__s, int __accept);
-
-__STRING_INLINE size_t
-__strspn_c1 (const char *__s, int __accept)
-{
- register unsigned long int __d0;
- register char *__res;
- /* Please note that __accept never can be '\0'. */
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%b1\n\t"
- "leal 1(%0),%0\n\t"
- "cmpb %h1,%b1\n\t"
- "je 1b"
- : "=r" (__res), "=&q" (__d0)
- : "0" (__s), "1" (__accept),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return (__res - 1) - __s;
-}
-# endif
-
-__STRING_INLINE size_t __strspn_cg (const char *__s, const char __accept[],
- size_t __accept_len);
-
-__STRING_INLINE size_t
-__strspn_cg (const char *__s, const char __accept[], size_t __accept_len)
-{
- register unsigned long int __d0, __d1, __d2;
- register const char *__res;
- __asm__ __volatile__
- ("cld\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %5,%%edi\n\t"
- "movl %6,%%ecx\n\t"
- "repne; scasb\n\t"
- "je 1b\n"
- "2:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "0" (__s), "g" (__accept), "g" (__accept_len),
- /* Since we do not know how large the memory we access it, use a
- really large amount. */
- "m" ( *(struct { char __x[0xfffffff]; } *)__s),
- "m" ( *(struct { __extension__ char __x[__accept_len]; } *)__accept)
- : "cc");
- return (__res - 1) - __s;
-}
-
-__STRING_INLINE size_t __strspn_g (const char *__s, const char *__accept);
-# ifdef __PIC__
-
-__STRING_INLINE size_t
-__strspn_g (const char *__s, const char *__accept)
-{
- register unsigned long int __d0, __d1, __d2;
- register const char *__res;
- __asm__ __volatile__
- ("pushl %%ebx\n\t"
- "cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%ebx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %%edx,%%edi\n\t"
- "movl %%ebx,%%ecx\n\t"
- "repne; scasb\n\t"
- "je 1b\n"
- "2:\n\t"
- "popl %%ebx"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "d" (__accept), "0" (__s), "1" (0), "2" (0xffffffff), "3" (__accept)
- : "memory", "cc");
- return (__res - 1) - __s;
-}
-# else
-__STRING_INLINE size_t
-__strspn_g (const char *__s, const char *__accept)
-{
- register unsigned long int __d0, __d1, __d2, __d3;
- register const char *__res;
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%edx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %%ebx,%%edi\n\t"
- "movl %%edx,%%ecx\n\t"
- "repne; scasb\n\t"
- "je 1b\n"
- "2:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2), "=&d" (__d3)
- : "0" (__s), "1" (0), "2" (0xffffffff), "3" (__accept), "b" (__accept)
- : "memory", "cc");
- return (__res - 1) - __s;
-}
-# endif
-
-
-/* Find the first occurrence in S of any character in ACCEPT. */
-# define _HAVE_STRING_ARCH_strpbrk 1
-# define strpbrk(s, accept) \
- (__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
- ? ((accept)[0] == '\0' \
- ? ((void) (s), (char *) 0) \
- : ((accept)[1] == '\0' \
- ? strchr ((s), (accept)[0]) \
- : __strpbrk_cg ((s), (accept), strlen (accept)))) \
- : __strpbrk_g ((s), (accept))))
-
-__STRING_INLINE char *__strpbrk_cg (const char *__s, const char __accept[],
- size_t __accept_len);
-
-__STRING_INLINE char *
-__strpbrk_cg (const char *__s, const char __accept[], size_t __accept_len)
-{
- register unsigned long int __d0, __d1, __d2;
- register char *__res;
- __asm__ __volatile__
- ("cld\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %5,%%edi\n\t"
- "movl %6,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n\t"
- "decl %0\n\t"
- "jmp 3f\n"
- "2:\n\t"
- "xorl %0,%0\n"
- "3:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "0" (__s), "d" (__accept), "g" (__accept_len)
- : "memory", "cc");
- return __res;
-}
-
-__STRING_INLINE char *__strpbrk_g (const char *__s, const char *__accept);
-# ifdef __PIC__
-
-__STRING_INLINE char *
-__strpbrk_g (const char *__s, const char *__accept)
-{
- register unsigned long int __d0, __d1, __d2;
- register char *__res;
- __asm__ __volatile__
- ("pushl %%ebx\n\t"
- "movl %%edx,%%edi\n\t"
- "cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%ebx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %%edx,%%edi\n\t"
- "movl %%ebx,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n\t"
- "decl %0\n\t"
- "jmp 3f\n"
- "2:\n\t"
- "xorl %0,%0\n"
- "3:\n\t"
- "popl %%ebx"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "d" (__accept), "0" (__s), "1" (0), "2" (0xffffffff)
- : "memory", "cc");
- return __res;
-}
-# else
-__STRING_INLINE char *
-__strpbrk_g (const char *__s, const char *__accept)
-{
- register unsigned long int __d0, __d1, __d2, __d3;
- register char *__res;
- __asm__ __volatile__
- ("movl %%ebx,%%edi\n\t"
- "cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%edx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %%ebx,%%edi\n\t"
- "movl %%edx,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n\t"
- "decl %0\n\t"
- "jmp 3f\n"
- "2:\n\t"
- "xorl %0,%0\n"
- "3:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&d" (__d2), "=&D" (__d3)
- : "0" (__s), "1" (0), "2" (0xffffffff), "b" (__accept)
- : "memory", "cc");
- return __res;
-}
-# endif
-
-
-/* Find the first occurrence of NEEDLE in HAYSTACK. */
-# define _HAVE_STRING_ARCH_strstr 1
-# define strstr(haystack, needle) \
- (__extension__ (__builtin_constant_p (needle) && sizeof ((needle)[0]) == 1 \
- ? ((needle)[0] == '\0' \
- ? (haystack) \
- : ((needle)[1] == '\0' \
- ? strchr ((haystack), (needle)[0]) \
- : __strstr_cg ((haystack), (needle), \
- strlen (needle)))) \
- : __strstr_g ((haystack), (needle))))
-
-/* Please note that this function need not handle NEEDLEs with a
- length shorter than two. */
-__STRING_INLINE char *__strstr_cg (const char *__haystack,
- const char __needle[],
- size_t __needle_len);
-
-__STRING_INLINE char *
-__strstr_cg (const char *__haystack, const char __needle[],
- size_t __needle_len)
-{
- register unsigned long int __d0, __d1, __d2;
- register char *__res;
- __asm__ __volatile__
- ("cld\n" \
- "1:\n\t"
- "movl %6,%%edi\n\t"
- "movl %5,%%eax\n\t"
- "movl %4,%%ecx\n\t"
- "repe; cmpsb\n\t"
- "je 2f\n\t"
- "cmpb $0,-1(%%esi)\n\t"
- "leal 1(%%eax),%5\n\t"
- "jne 1b\n\t"
- "xorl %%eax,%%eax\n"
- "2:"
- : "=&a" (__res), "=&S" (__d0), "=&D" (__d1), "=&c" (__d2)
- : "g" (__needle_len), "1" (__haystack), "d" (__needle)
- : "memory", "cc");
- return __res;
-}
-
-__STRING_INLINE char *__strstr_g (const char *__haystack,
- const char *__needle);
-# ifdef __PIC__
-
-__STRING_INLINE char *
-__strstr_g (const char *__haystack, const char *__needle)
-{
- register unsigned long int __d0, __d1, __d2;
- register char *__res;
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "pushl %%ebx\n\t"
- "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */
- "movl %%ecx,%%ebx\n"
- "1:\n\t"
- "movl %%edx,%%edi\n\t"
- "movl %%esi,%%eax\n\t"
- "movl %%ebx,%%ecx\n\t"
- "repe; cmpsb\n\t"
- "je 2f\n\t" /* also works for empty string, see above */
- "cmpb $0,-1(%%esi)\n\t"
- "leal 1(%%eax),%%esi\n\t"
- "jne 1b\n\t"
- "xorl %%eax,%%eax\n"
- "2:\n\t"
- "popl %%ebx"
- : "=&a" (__res), "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
- : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (__needle),
- "d" (__needle)
- : "memory", "cc");
- return __res;
-}
-# else
-__STRING_INLINE char *
-__strstr_g (const char *__haystack, const char *__needle)
-{
- register unsigned long int __d0, __d1, __d2, __d3;
- register char *__res;
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */
- "movl %%ecx,%%edx\n"
- "1:\n\t"
- "movl %%ebx,%%edi\n\t"
- "movl %%esi,%%eax\n\t"
- "movl %%edx,%%ecx\n\t"
- "repe; cmpsb\n\t"
- "je 2f\n\t" /* also works for empty string, see above */
- "cmpb $0,-1(%%esi)\n\t"
- "leal 1(%%eax),%%esi\n\t"
- "jne 1b\n\t"
- "xorl %%eax,%%eax\n"
- "2:"
- : "=&a" (__res), "=&c" (__d0), "=&S" (__d1), "=&D" (__d2), "=&d" (__d3)
- : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (__needle),
- "b" (__needle)
- : "memory", "cc");
- return __res;
-}
-# endif
-
-
-/* Bit find functions. We define only the i686 version since for the other
- processors gcc generates good code. */
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
-# ifdef __i686__
-# define _HAVE_STRING_ARCH_ffs 1
-# define ffs(word) (__builtin_constant_p (word) \
- ? __builtin_ffs (word) \
- : ({ int __cnt, __tmp; \
- __asm__ __volatile__ \
- ("bsfl %2,%0\n\t" \
- "cmovel %1,%0" \
- : "=&r" (__cnt), "=r" (__tmp) \
- : "rm" (word), "1" (-1)); \
- __cnt + 1; }))
-
-# ifndef ffsl
-# define ffsl(word) ffs(word)
-# endif
-# endif /* i686 */
-# endif /* Misc || X/Open */
-
-# ifndef _FORCE_INLINES
-# undef __STRING_INLINE
-# endif
-
-# endif /* use string inlines && GNU CC */
-
-#endif
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/bits/xtitypes.h b/sysdeps/x86/bits/xtitypes.h
index 31c1210edd..4fd0fe788b 100644
--- a/sysdeps/x86/bits/xtitypes.h
+++ b/sysdeps/x86/bits/xtitypes.h
@@ -1,5 +1,5 @@
/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>. x86-64.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c
new file mode 100644
index 0000000000..b9444ddd52
--- /dev/null
+++ b/sysdeps/x86/cacheinfo.c
@@ -0,0 +1,791 @@
+/* x86_64 cache info.
+ Copyright (C) 2003-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+#include <assert.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <cpuid.h>
+#include <init-arch.h>
+
+static const struct intel_02_cache_info
+{
+ unsigned char idx;
+ unsigned char assoc;
+ unsigned char linesize;
+ unsigned char rel_name;
+ unsigned int size;
+} intel_02_known [] =
+ {
+#define M(sc) ((sc) - _SC_LEVEL1_ICACHE_SIZE)
+ { 0x06, 4, 32, M(_SC_LEVEL1_ICACHE_SIZE), 8192 },
+ { 0x08, 4, 32, M(_SC_LEVEL1_ICACHE_SIZE), 16384 },
+ { 0x09, 4, 32, M(_SC_LEVEL1_ICACHE_SIZE), 32768 },
+ { 0x0a, 2, 32, M(_SC_LEVEL1_DCACHE_SIZE), 8192 },
+ { 0x0c, 4, 32, M(_SC_LEVEL1_DCACHE_SIZE), 16384 },
+ { 0x0d, 4, 64, M(_SC_LEVEL1_DCACHE_SIZE), 16384 },
+ { 0x0e, 6, 64, M(_SC_LEVEL1_DCACHE_SIZE), 24576 },
+ { 0x21, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
+ { 0x22, 4, 64, M(_SC_LEVEL3_CACHE_SIZE), 524288 },
+ { 0x23, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 1048576 },
+ { 0x25, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
+ { 0x29, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
+ { 0x2c, 8, 64, M(_SC_LEVEL1_DCACHE_SIZE), 32768 },
+ { 0x30, 8, 64, M(_SC_LEVEL1_ICACHE_SIZE), 32768 },
+ { 0x39, 4, 64, M(_SC_LEVEL2_CACHE_SIZE), 131072 },
+ { 0x3a, 6, 64, M(_SC_LEVEL2_CACHE_SIZE), 196608 },
+ { 0x3b, 2, 64, M(_SC_LEVEL2_CACHE_SIZE), 131072 },
+ { 0x3c, 4, 64, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
+ { 0x3d, 6, 64, M(_SC_LEVEL2_CACHE_SIZE), 393216 },
+ { 0x3e, 4, 64, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
+ { 0x3f, 2, 64, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
+ { 0x41, 4, 32, M(_SC_LEVEL2_CACHE_SIZE), 131072 },
+ { 0x42, 4, 32, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
+ { 0x43, 4, 32, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
+ { 0x44, 4, 32, M(_SC_LEVEL2_CACHE_SIZE), 1048576 },
+ { 0x45, 4, 32, M(_SC_LEVEL2_CACHE_SIZE), 2097152 },
+ { 0x46, 4, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
+ { 0x47, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
+ { 0x48, 12, 64, M(_SC_LEVEL2_CACHE_SIZE), 3145728 },
+ { 0x49, 16, 64, M(_SC_LEVEL2_CACHE_SIZE), 4194304 },
+ { 0x4a, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 6291456 },
+ { 0x4b, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
+ { 0x4c, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
+ { 0x4d, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 16777216 },
+ { 0x4e, 24, 64, M(_SC_LEVEL2_CACHE_SIZE), 6291456 },
+ { 0x60, 8, 64, M(_SC_LEVEL1_DCACHE_SIZE), 16384 },
+ { 0x66, 4, 64, M(_SC_LEVEL1_DCACHE_SIZE), 8192 },
+ { 0x67, 4, 64, M(_SC_LEVEL1_DCACHE_SIZE), 16384 },
+ { 0x68, 4, 64, M(_SC_LEVEL1_DCACHE_SIZE), 32768 },
+ { 0x78, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 1048576 },
+ { 0x79, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 131072 },
+ { 0x7a, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
+ { 0x7b, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
+ { 0x7c, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 1048576 },
+ { 0x7d, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 2097152 },
+ { 0x7f, 2, 64, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
+ { 0x80, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
+ { 0x82, 8, 32, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
+ { 0x83, 8, 32, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
+ { 0x84, 8, 32, M(_SC_LEVEL2_CACHE_SIZE), 1048576 },
+ { 0x85, 8, 32, M(_SC_LEVEL2_CACHE_SIZE), 2097152 },
+ { 0x86, 4, 64, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
+ { 0x87, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 1048576 },
+ { 0xd0, 4, 64, M(_SC_LEVEL3_CACHE_SIZE), 524288 },
+ { 0xd1, 4, 64, M(_SC_LEVEL3_CACHE_SIZE), 1048576 },
+ { 0xd2, 4, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
+ { 0xd6, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 1048576 },
+ { 0xd7, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
+ { 0xd8, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
+ { 0xdc, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
+ { 0xdd, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
+ { 0xde, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
+ { 0xe2, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
+ { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
+ { 0xe4, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
+ { 0xea, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
+ { 0xeb, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 18874368 },
+ { 0xec, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 25165824 },
+ };
+
+#define nintel_02_known (sizeof (intel_02_known) / sizeof (intel_02_known [0]))
+
+static int
+intel_02_known_compare (const void *p1, const void *p2)
+{
+ const struct intel_02_cache_info *i1;
+ const struct intel_02_cache_info *i2;
+
+ i1 = (const struct intel_02_cache_info *) p1;
+ i2 = (const struct intel_02_cache_info *) p2;
+
+ if (i1->idx == i2->idx)
+ return 0;
+
+ return i1->idx < i2->idx ? -1 : 1;
+}
+
+
+static long int
+__attribute__ ((noinline))
+intel_check_word (int name, unsigned int value, bool *has_level_2,
+ bool *no_level_2_or_3,
+ const struct cpu_features *cpu_features)
+{
+ if ((value & 0x80000000) != 0)
+ /* The register value is reserved. */
+ return 0;
+
+ /* Fold the name. The _SC_ constants are always in the order SIZE,
+ ASSOC, LINESIZE. */
+ int folded_rel_name = (M(name) / 3) * 3;
+
+ while (value != 0)
+ {
+ unsigned int byte = value & 0xff;
+
+ if (byte == 0x40)
+ {
+ *no_level_2_or_3 = true;
+
+ if (folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE))
+ /* No need to look further. */
+ break;
+ }
+ else if (byte == 0xff)
+ {
+ /* CPUID leaf 0x4 contains all the information. We need to
+ iterate over it. */
+ unsigned int eax;
+ unsigned int ebx;
+ unsigned int ecx;
+ unsigned int edx;
+
+ unsigned int round = 0;
+ while (1)
+ {
+ __cpuid_count (4, round, eax, ebx, ecx, edx);
+
+ enum { null = 0, data = 1, inst = 2, uni = 3 } type = eax & 0x1f;
+ if (type == null)
+ /* That was the end. */
+ break;
+
+ unsigned int level = (eax >> 5) & 0x7;
+
+ if ((level == 1 && type == data
+ && folded_rel_name == M(_SC_LEVEL1_DCACHE_SIZE))
+ || (level == 1 && type == inst
+ && folded_rel_name == M(_SC_LEVEL1_ICACHE_SIZE))
+ || (level == 2 && folded_rel_name == M(_SC_LEVEL2_CACHE_SIZE))
+ || (level == 3 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE))
+ || (level == 4 && folded_rel_name == M(_SC_LEVEL4_CACHE_SIZE)))
+ {
+ unsigned int offset = M(name) - folded_rel_name;
+
+ if (offset == 0)
+ /* Cache size. */
+ return (((ebx >> 22) + 1)
+ * (((ebx >> 12) & 0x3ff) + 1)
+ * ((ebx & 0xfff) + 1)
+ * (ecx + 1));
+ if (offset == 1)
+ return (ebx >> 22) + 1;
+
+ assert (offset == 2);
+ return (ebx & 0xfff) + 1;
+ }
+
+ ++round;
+ }
+ /* There is no other cache information anywhere else. */
+ break;
+ }
+ else
+ {
+ if (byte == 0x49 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE))
+ {
+ /* Intel reused this value. For family 15, model 6 it
+ specifies the 3rd level cache. Otherwise the 2nd
+ level cache. */
+ unsigned int family = cpu_features->family;
+ unsigned int model = cpu_features->model;
+
+ if (family == 15 && model == 6)
+ {
+ /* The level 3 cache is encoded for this model like
+ the level 2 cache is for other models. Pretend
+ the caller asked for the level 2 cache. */
+ name = (_SC_LEVEL2_CACHE_SIZE
+ + (name - _SC_LEVEL3_CACHE_SIZE));
+ folded_rel_name = M(_SC_LEVEL2_CACHE_SIZE);
+ }
+ }
+
+ struct intel_02_cache_info *found;
+ struct intel_02_cache_info search;
+
+ search.idx = byte;
+ found = bsearch (&search, intel_02_known, nintel_02_known,
+ sizeof (intel_02_known[0]), intel_02_known_compare);
+ if (found != NULL)
+ {
+ if (found->rel_name == folded_rel_name)
+ {
+ unsigned int offset = M(name) - folded_rel_name;
+
+ if (offset == 0)
+ /* Cache size. */
+ return found->size;
+ if (offset == 1)
+ return found->assoc;
+
+ assert (offset == 2);
+ return found->linesize;
+ }
+
+ if (found->rel_name == M(_SC_LEVEL2_CACHE_SIZE))
+ *has_level_2 = true;
+ }
+ }
+
+ /* Next byte for the next round. */
+ value >>= 8;
+ }
+
+ /* Nothing found. */
+ return 0;
+}
+
+
+static long int __attribute__ ((noinline))
+handle_intel (int name, const struct cpu_features *cpu_features)
+{
+ unsigned int maxidx = cpu_features->max_cpuid;
+
+ /* Return -1 for older CPUs. */
+ if (maxidx < 2)
+ return -1;
+
+ /* OK, we can use the CPUID instruction to get all info about the
+ caches. */
+ unsigned int cnt = 0;
+ unsigned int max = 1;
+ long int result = 0;
+ bool no_level_2_or_3 = false;
+ bool has_level_2 = false;
+
+ while (cnt++ < max)
+ {
+ unsigned int eax;
+ unsigned int ebx;
+ unsigned int ecx;
+ unsigned int edx;
+ __cpuid (2, eax, ebx, ecx, edx);
+
+ /* The low byte of EAX in the first round contain the number of
+ rounds we have to make. At least one, the one we are already
+ doing. */
+ if (cnt == 1)
+ {
+ max = eax & 0xff;
+ eax &= 0xffffff00;
+ }
+
+ /* Process the individual registers' value. */
+ result = intel_check_word (name, eax, &has_level_2,
+ &no_level_2_or_3, cpu_features);
+ if (result != 0)
+ return result;
+
+ result = intel_check_word (name, ebx, &has_level_2,
+ &no_level_2_or_3, cpu_features);
+ if (result != 0)
+ return result;
+
+ result = intel_check_word (name, ecx, &has_level_2,
+ &no_level_2_or_3, cpu_features);
+ if (result != 0)
+ return result;
+
+ result = intel_check_word (name, edx, &has_level_2,
+ &no_level_2_or_3, cpu_features);
+ if (result != 0)
+ return result;
+ }
+
+ if (name >= _SC_LEVEL2_CACHE_SIZE && name <= _SC_LEVEL3_CACHE_LINESIZE
+ && no_level_2_or_3)
+ return -1;
+
+ return 0;
+}
+
+
+static long int __attribute__ ((noinline))
+handle_amd (int name)
+{
+ unsigned int eax;
+ unsigned int ebx;
+ unsigned int ecx;
+ unsigned int edx;
+ __cpuid (0x80000000, eax, ebx, ecx, edx);
+
+ /* No level 4 cache (yet). */
+ if (name > _SC_LEVEL3_CACHE_LINESIZE)
+ return 0;
+
+ unsigned int fn = 0x80000005 + (name >= _SC_LEVEL2_CACHE_SIZE);
+ if (eax < fn)
+ return 0;
+
+ __cpuid (fn, eax, ebx, ecx, edx);
+
+ if (name < _SC_LEVEL1_DCACHE_SIZE)
+ {
+ name += _SC_LEVEL1_DCACHE_SIZE - _SC_LEVEL1_ICACHE_SIZE;
+ ecx = edx;
+ }
+
+ switch (name)
+ {
+ case _SC_LEVEL1_DCACHE_SIZE:
+ return (ecx >> 14) & 0x3fc00;
+
+ case _SC_LEVEL1_DCACHE_ASSOC:
+ ecx >>= 16;
+ if ((ecx & 0xff) == 0xff)
+ /* Fully associative. */
+ return (ecx << 2) & 0x3fc00;
+ return ecx & 0xff;
+
+ case _SC_LEVEL1_DCACHE_LINESIZE:
+ return ecx & 0xff;
+
+ case _SC_LEVEL2_CACHE_SIZE:
+ return (ecx & 0xf000) == 0 ? 0 : (ecx >> 6) & 0x3fffc00;
+
+ case _SC_LEVEL2_CACHE_ASSOC:
+ switch ((ecx >> 12) & 0xf)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ return (ecx >> 12) & 0xf;
+ case 6:
+ return 8;
+ case 8:
+ return 16;
+ case 10:
+ return 32;
+ case 11:
+ return 48;
+ case 12:
+ return 64;
+ case 13:
+ return 96;
+ case 14:
+ return 128;
+ case 15:
+ return ((ecx >> 6) & 0x3fffc00) / (ecx & 0xff);
+ default:
+ return 0;
+ }
+ /* NOTREACHED */
+
+ case _SC_LEVEL2_CACHE_LINESIZE:
+ return (ecx & 0xf000) == 0 ? 0 : ecx & 0xff;
+
+ case _SC_LEVEL3_CACHE_SIZE:
+ return (edx & 0xf000) == 0 ? 0 : (edx & 0x3ffc0000) << 1;
+
+ case _SC_LEVEL3_CACHE_ASSOC:
+ switch ((edx >> 12) & 0xf)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ return (edx >> 12) & 0xf;
+ case 6:
+ return 8;
+ case 8:
+ return 16;
+ case 10:
+ return 32;
+ case 11:
+ return 48;
+ case 12:
+ return 64;
+ case 13:
+ return 96;
+ case 14:
+ return 128;
+ case 15:
+ return ((edx & 0x3ffc0000) << 1) / (edx & 0xff);
+ default:
+ return 0;
+ }
+ /* NOTREACHED */
+
+ case _SC_LEVEL3_CACHE_LINESIZE:
+ return (edx & 0xf000) == 0 ? 0 : edx & 0xff;
+
+ default:
+ assert (! "cannot happen");
+ }
+ return -1;
+}
+
+
+/* Get the value of the system variable NAME. */
+long int
+attribute_hidden
+__cache_sysconf (int name)
+{
+ const struct cpu_features *cpu_features = __get_cpu_features ();
+
+ if (cpu_features->kind == arch_kind_intel)
+ return handle_intel (name, cpu_features);
+
+ if (cpu_features->kind == arch_kind_amd)
+ return handle_amd (name);
+
+ // XXX Fill in more vendors.
+
+ /* CPU not known, we have no information. */
+ return 0;
+}
+
+
+/* Data cache size for use in memory and string routines, typically
+ L1 size, rounded to multiple of 256 bytes. */
+long int __x86_data_cache_size_half attribute_hidden = 32 * 1024 / 2;
+long int __x86_data_cache_size attribute_hidden = 32 * 1024;
+/* Similar to __x86_data_cache_size_half, but not rounded. */
+long int __x86_raw_data_cache_size_half attribute_hidden = 32 * 1024 / 2;
+/* Similar to __x86_data_cache_size, but not rounded. */
+long int __x86_raw_data_cache_size attribute_hidden = 32 * 1024;
+/* Shared cache size for use in memory and string routines, typically
+ L2 or L3 size, rounded to multiple of 256 bytes. */
+long int __x86_shared_cache_size_half attribute_hidden = 1024 * 1024 / 2;
+long int __x86_shared_cache_size attribute_hidden = 1024 * 1024;
+/* Similar to __x86_shared_cache_size_half, but not rounded. */
+long int __x86_raw_shared_cache_size_half attribute_hidden = 1024 * 1024 / 2;
+/* Similar to __x86_shared_cache_size, but not rounded. */
+long int __x86_raw_shared_cache_size attribute_hidden = 1024 * 1024;
+
+/* Threshold to use non temporal store. */
+long int __x86_shared_non_temporal_threshold attribute_hidden;
+
+#ifndef DISABLE_PREFETCHW
+/* PREFETCHW support flag for use in memory and string routines. */
+int __x86_prefetchw attribute_hidden;
+#endif
+
+
+static void
+__attribute__((constructor))
+init_cacheinfo (void)
+{
+ /* Find out what brand of processor. */
+ unsigned int eax;
+ unsigned int ebx;
+ unsigned int ecx;
+ unsigned int edx;
+ int max_cpuid_ex;
+ long int data = -1;
+ long int shared = -1;
+ unsigned int level;
+ unsigned int threads = 0;
+ const struct cpu_features *cpu_features = __get_cpu_features ();
+ int max_cpuid = cpu_features->max_cpuid;
+
+ if (cpu_features->kind == arch_kind_intel)
+ {
+ data = handle_intel (_SC_LEVEL1_DCACHE_SIZE, cpu_features);
+
+ long int core = handle_intel (_SC_LEVEL2_CACHE_SIZE, cpu_features);
+ bool inclusive_cache = true;
+
+ /* Try L3 first. */
+ level = 3;
+ shared = handle_intel (_SC_LEVEL3_CACHE_SIZE, cpu_features);
+
+ /* Number of logical processors sharing L2 cache. */
+ int threads_l2;
+
+ /* Number of logical processors sharing L3 cache. */
+ int threads_l3;
+
+ if (shared <= 0)
+ {
+ /* Try L2 otherwise. */
+ level = 2;
+ shared = core;
+ threads_l2 = 0;
+ threads_l3 = -1;
+ }
+ else
+ {
+ threads_l2 = 0;
+ threads_l3 = 0;
+ }
+
+ /* A value of 0 for the HTT bit indicates there is only a single
+ logical processor. */
+ if (HAS_CPU_FEATURE (HTT))
+ {
+ /* Figure out the number of logical threads that share the
+ highest cache level. */
+ if (max_cpuid >= 4)
+ {
+ unsigned int family = cpu_features->family;
+ unsigned int model = cpu_features->model;
+
+ int i = 0;
+
+ /* Query until cache level 2 and 3 are enumerated. */
+ int check = 0x1 | (threads_l3 == 0) << 1;
+ do
+ {
+ __cpuid_count (4, i++, eax, ebx, ecx, edx);
+
+ /* There seems to be a bug in at least some Pentium Ds
+ which sometimes fail to iterate all cache parameters.
+ Do not loop indefinitely here, stop in this case and
+ assume there is no such information. */
+ if ((eax & 0x1f) == 0)
+ goto intel_bug_no_cache_info;
+
+ switch ((eax >> 5) & 0x7)
+ {
+ default:
+ break;
+ case 2:
+ if ((check & 0x1))
+ {
+ /* Get maximum number of logical processors
+ sharing L2 cache. */
+ threads_l2 = (eax >> 14) & 0x3ff;
+ check &= ~0x1;
+ }
+ break;
+ case 3:
+ if ((check & (0x1 << 1)))
+ {
+ /* Get maximum number of logical processors
+ sharing L3 cache. */
+ threads_l3 = (eax >> 14) & 0x3ff;
+
+ /* Check if L2 and L3 caches are inclusive. */
+ inclusive_cache = (edx & 0x2) != 0;
+ check &= ~(0x1 << 1);
+ }
+ break;
+ }
+ }
+ while (check);
+
+ /* If max_cpuid >= 11, THREADS_L2/THREADS_L3 are the maximum
+ numbers of addressable IDs for logical processors sharing
+ the cache, instead of the maximum number of threads
+ sharing the cache. */
+ if (max_cpuid >= 11)
+ {
+ /* Find the number of logical processors shipped in
+ one core and apply count mask. */
+ i = 0;
+
+ /* Count SMT only if there is L3 cache. Always count
+ core if there is no L3 cache. */
+ int count = ((threads_l2 > 0 && level == 3)
+ | ((threads_l3 > 0
+ || (threads_l2 > 0 && level == 2)) << 1));
+
+ while (count)
+ {
+ __cpuid_count (11, i++, eax, ebx, ecx, edx);
+
+ int shipped = ebx & 0xff;
+ int type = ecx & 0xff00;
+ if (shipped == 0 || type == 0)
+ break;
+ else if (type == 0x100)
+ {
+ /* Count SMT. */
+ if ((count & 0x1))
+ {
+ int count_mask;
+
+ /* Compute count mask. */
+ asm ("bsr %1, %0"
+ : "=r" (count_mask) : "g" (threads_l2));
+ count_mask = ~(-1 << (count_mask + 1));
+ threads_l2 = (shipped - 1) & count_mask;
+ count &= ~0x1;
+ }
+ }
+ else if (type == 0x200)
+ {
+ /* Count core. */
+ if ((count & (0x1 << 1)))
+ {
+ int count_mask;
+ int threads_core
+ = (level == 2 ? threads_l2 : threads_l3);
+
+ /* Compute count mask. */
+ asm ("bsr %1, %0"
+ : "=r" (count_mask) : "g" (threads_core));
+ count_mask = ~(-1 << (count_mask + 1));
+ threads_core = (shipped - 1) & count_mask;
+ if (level == 2)
+ threads_l2 = threads_core;
+ else
+ threads_l3 = threads_core;
+ count &= ~(0x1 << 1);
+ }
+ }
+ }
+ }
+ if (threads_l2 > 0)
+ threads_l2 += 1;
+ if (threads_l3 > 0)
+ threads_l3 += 1;
+ if (level == 2)
+ {
+ if (threads_l2)
+ {
+ threads = threads_l2;
+ if (threads > 2 && family == 6)
+ switch (model)
+ {
+ case 0x37:
+ case 0x4a:
+ case 0x4d:
+ case 0x5a:
+ case 0x5d:
+ /* Silvermont has L2 cache shared by 2 cores. */
+ threads = 2;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ else if (threads_l3)
+ threads = threads_l3;
+ }
+ else
+ {
+intel_bug_no_cache_info:
+ /* Assume that all logical threads share the highest cache
+ level. */
+
+ threads
+ = ((cpu_features->cpuid[COMMON_CPUID_INDEX_1].ebx
+ >> 16) & 0xff);
+ }
+
+ /* Cap usage of highest cache level to the number of supported
+ threads. */
+ if (shared > 0 && threads > 0)
+ shared /= threads;
+ }
+
+ /* Account for non-inclusive L2 and L3 caches. */
+ if (!inclusive_cache)
+ {
+ if (threads_l2 > 0)
+ core /= threads_l2;
+ shared += core;
+ }
+ }
+ else if (cpu_features->kind == arch_kind_amd)
+ {
+ data = handle_amd (_SC_LEVEL1_DCACHE_SIZE);
+ long int core = handle_amd (_SC_LEVEL2_CACHE_SIZE);
+ shared = handle_amd (_SC_LEVEL3_CACHE_SIZE);
+
+ /* Get maximum extended function. */
+ __cpuid (0x80000000, max_cpuid_ex, ebx, ecx, edx);
+
+ if (shared <= 0)
+ /* No shared L3 cache. All we have is the L2 cache. */
+ shared = core;
+ else
+ {
+ /* Figure out the number of logical threads that share L3. */
+ if (max_cpuid_ex >= 0x80000008)
+ {
+ /* Get width of APIC ID. */
+ __cpuid (0x80000008, max_cpuid_ex, ebx, ecx, edx);
+ threads = 1 << ((ecx >> 12) & 0x0f);
+ }
+
+ if (threads == 0)
+ {
+ /* If APIC ID width is not available, use logical
+ processor count. */
+ __cpuid (0x00000001, max_cpuid_ex, ebx, ecx, edx);
+
+ if ((edx & (1 << 28)) != 0)
+ threads = (ebx >> 16) & 0xff;
+ }
+
+ /* Cap usage of highest cache level to the number of
+ supported threads. */
+ if (threads > 0)
+ shared /= threads;
+
+ /* Account for exclusive L2 and L3 caches. */
+ shared += core;
+ }
+
+#ifndef DISABLE_PREFETCHW
+ if (max_cpuid_ex >= 0x80000001)
+ {
+ __cpuid (0x80000001, eax, ebx, ecx, edx);
+ /* PREFETCHW || 3DNow! */
+ if ((ecx & 0x100) || (edx & 0x80000000))
+ __x86_prefetchw = -1;
+ }
+#endif
+ }
+
+ if (cpu_features->data_cache_size != 0)
+ data = cpu_features->data_cache_size;
+
+ if (data > 0)
+ {
+ __x86_raw_data_cache_size_half = data / 2;
+ __x86_raw_data_cache_size = data;
+ /* Round data cache size to multiple of 256 bytes. */
+ data = data & ~255L;
+ __x86_data_cache_size_half = data / 2;
+ __x86_data_cache_size = data;
+ }
+
+ if (cpu_features->shared_cache_size != 0)
+ shared = cpu_features->shared_cache_size;
+
+ if (shared > 0)
+ {
+ __x86_raw_shared_cache_size_half = shared / 2;
+ __x86_raw_shared_cache_size = shared;
+ /* Round shared cache size to multiple of 256 bytes. */
+ shared = shared & ~255L;
+ __x86_shared_cache_size_half = shared / 2;
+ __x86_shared_cache_size = shared;
+ }
+
+ /* The large memcpy micro benchmark in glibc shows that 6 times of
+ shared cache size is the approximate value above which non-temporal
+ store becomes faster on a 8-core processor. This is the 3/4 of the
+ total shared cache size. */
+ __x86_shared_non_temporal_threshold
+ = (cpu_features->non_temporal_threshold != 0
+ ? cpu_features->non_temporal_threshold
+ : __x86_shared_cache_size * threads * 3 / 4);
+}
+
+#endif
diff --git a/sysdeps/x86/cet-tunables.h b/sysdeps/x86/cet-tunables.h
new file mode 100644
index 0000000000..ca023053ee
--- /dev/null
+++ b/sysdeps/x86/cet-tunables.h
@@ -0,0 +1,29 @@
+/* x86 CET tuning.
+ This file is part of the GNU C Library.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/>. */
+
+/* Valid control values:
+ 0: Enable CET features based on ELF property note.
+ 1: Always disable CET features.
+ 2: Always enable CET features.
+ 3: Enable CET features permissively.
+ */
+#define CET_ELF_PROPERTY 0
+#define CET_ALWAYS_OFF 1
+#define CET_ALWAYS_ON 2
+#define CET_PERMISSIVE 3
+#define CET_MAX CET_PERMISSIVE
diff --git a/sysdeps/x86/check-cet.awk b/sysdeps/x86/check-cet.awk
new file mode 100644
index 0000000000..380d998caf
--- /dev/null
+++ b/sysdeps/x86/check-cet.awk
@@ -0,0 +1,53 @@
+# Verify that all shared objects contain the CET property.
+# Copyright (C) 2018 Free Software 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 awk script expects to get command-line files that are each
+# the output of 'readelf -n' on a single shared object.
+# It exits successfully (0) if all of them contained the CET property.
+# It fails (1) if any didn't contain the CET property
+# It fails (2) if the input did not take the expected form.
+
+BEGIN { result = cet = sanity = 0 }
+
+function check_one(name) {
+ if (!sanity) {
+ print name ": *** input did not look like readelf -n output";
+ result = 2;
+ } else if (cet) {
+ print name ": OK";
+ } else {
+ print name ": *** no CET property found";
+ result = result ? result : 1;
+ }
+
+ cet = sanity = 0;
+}
+
+FILENAME != lastfile {
+ if (lastfile)
+ check_one(lastfile);
+ lastfile = FILENAME;
+}
+
+index ($0, "Displaying notes") != 0 { sanity = 1 }
+index ($0, "IBT") != 0 && index ($0, "SHSTK") != 0 { cet = 1 }
+
+END {
+ check_one(lastfile);
+ exit(result);
+}
diff --git a/sysdeps/x86/configure b/sysdeps/x86/configure
new file mode 100644
index 0000000000..b1ff281249
--- /dev/null
+++ b/sysdeps/x86/configure
@@ -0,0 +1,69 @@
+# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/x86.
+
+if test x"$enable_cet" = xyes; then
+ # Check if CET can be enabled.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CET can be enabled" >&5
+$as_echo_n "checking whether CET can be enabled... " >&6; }
+if ${libc_cv_x86_cet_available+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.c <<EOF
+#if !defined __CET__ || __CET__ != 3
+# error CET isn't available.
+#endif
+EOF
+ if { ac_try='${CC-cc} -c $CFLAGS -fcf-protection -include cet.h conftest.c 1>&5'
+ { { 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_x86_cet_available=yes
+ else
+ libc_cv_x86_cet_available=no
+ fi
+ rm -rf conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_x86_cet_available" >&5
+$as_echo "$libc_cv_x86_cet_available" >&6; }
+ if test $libc_cv_x86_cet_available = yes; then
+ enable_cet=yes
+ else
+ if test x"$enable_cet" = xdefault; then
+ enable_cet=no
+ else
+ as_fn_error $? "$CC doesn't support CET" "$LINENO" 5
+ fi
+ fi
+fi
+if test $enable_cet = yes; then
+ # Check if assembler supports CET.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $AS supports CET" >&5
+$as_echo_n "checking whether $AS supports CET... " >&6; }
+if ${libc_cv_x86_cet_as+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.s <<EOF
+ incsspd %ecx
+EOF
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s -o conftest.o 1>&5'
+ { { 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_x86_cet_as=yes
+ else
+ libc_cv_x86_cet_as=no
+ fi
+ rm -rf conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_x86_cet_as" >&5
+$as_echo "$libc_cv_x86_cet_as" >&6; }
+ if test $libc_cv_x86_cet_as = no; then
+ as_fn_error $? "$AS doesn't support CET" "$LINENO" 5
+ fi
+fi
+config_vars="$config_vars
+enable-cet = $enable_cet"
diff --git a/sysdeps/x86/configure.ac b/sysdeps/x86/configure.ac
new file mode 100644
index 0000000000..a909b073af
--- /dev/null
+++ b/sysdeps/x86/configure.ac
@@ -0,0 +1,46 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/x86.
+
+if test x"$enable_cet" = xyes; then
+ # Check if CET can be enabled.
+ AC_CACHE_CHECK(whether CET can be enabled,
+ libc_cv_x86_cet_available, [dnl
+cat > conftest.c <<EOF
+#if !defined __CET__ || __CET__ != 3
+# error CET isn't available.
+#endif
+EOF
+ if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS -fcf-protection -include cet.h conftest.c 1>&AS_MESSAGE_LOG_FD); then
+ libc_cv_x86_cet_available=yes
+ else
+ libc_cv_x86_cet_available=no
+ fi
+ rm -rf conftest*])
+ if test $libc_cv_x86_cet_available = yes; then
+ enable_cet=yes
+ else
+ if test x"$enable_cet" = xdefault; then
+ enable_cet=no
+ else
+ AC_MSG_ERROR([$CC doesn't support CET])
+ fi
+ fi
+fi
+if test $enable_cet = yes; then
+ # Check if assembler supports CET.
+ AC_CACHE_CHECK(whether $AS supports CET,
+ libc_cv_x86_cet_as, [dnl
+cat > conftest.s <<EOF
+ incsspd %ecx
+EOF
+ if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s -o conftest.o 1>&AS_MESSAGE_LOG_FD); then
+ libc_cv_x86_cet_as=yes
+ else
+ libc_cv_x86_cet_as=no
+ fi
+ rm -rf conftest*])
+ if test $libc_cv_x86_cet_as = no; then
+ AC_MSG_ERROR([$AS doesn't support CET])
+ fi
+fi
+LIBC_CONFIG_VAR([enable-cet], [$enable_cet])
diff --git a/sysdeps/x86/cpu-features-offsets.sym b/sysdeps/x86/cpu-features-offsets.sym
index a9d53d195f..33dd094e37 100644
--- a/sysdeps/x86/cpu-features-offsets.sym
+++ b/sysdeps/x86/cpu-features-offsets.sym
@@ -5,3 +5,20 @@
#define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem)
RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET rtld_global_ro_offsetof (_dl_x86_cpu_features)
+
+CPU_FEATURES_SIZE sizeof (struct cpu_features)
+CPUID_OFFSET offsetof (struct cpu_features, cpuid)
+CPUID_SIZE sizeof (struct cpuid_registers)
+CPUID_EAX_OFFSET offsetof (struct cpuid_registers, eax)
+CPUID_EBX_OFFSET offsetof (struct cpuid_registers, ebx)
+CPUID_ECX_OFFSET offsetof (struct cpuid_registers, ecx)
+CPUID_EDX_OFFSET offsetof (struct cpuid_registers, edx)
+FAMILY_OFFSET offsetof (struct cpu_features, family)
+MODEL_OFFSET offsetof (struct cpu_features, model)
+XSAVE_STATE_SIZE_OFFSET offsetof (struct cpu_features, xsave_state_size)
+FEATURE_OFFSET offsetof (struct cpu_features, feature)
+FEATURE_SIZE sizeof (unsigned int)
+
+COMMON_CPUID_INDEX_1
+COMMON_CPUID_INDEX_7
+FEATURE_INDEX_1
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 218ff2bd86..ea0b64fdb9 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -1,6 +1,6 @@
/* Initialize CPU feature data.
This file is part of the GNU C Library.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,24 +18,195 @@
#include <cpuid.h>
#include <cpu-features.h>
+#include <dl-hwcap.h>
+#include <libc-pointer-arith.h>
-static inline void
+#if HAVE_TUNABLES
+# define TUNABLE_NAMESPACE tune
+# include <unistd.h> /* Get STDOUT_FILENO for _dl_printf. */
+# include <elf/dl-tunables.h>
+
+extern void TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *)
+ attribute_hidden;
+
+# if CET_ENABLED
+extern void TUNABLE_CALLBACK (set_x86_ibt) (tunable_val_t *)
+ attribute_hidden;
+extern void TUNABLE_CALLBACK (set_x86_shstk) (tunable_val_t *)
+ attribute_hidden;
+# endif
+#endif
+
+#if CET_ENABLED
+# include <dl-cet.h>
+# include <cet-tunables.h>
+#endif
+
+static void
+get_extended_indices (struct cpu_features *cpu_features)
+{
+ unsigned int eax, ebx, ecx, edx;
+ __cpuid (0x80000000, eax, ebx, ecx, edx);
+ if (eax >= 0x80000001)
+ __cpuid (0x80000001,
+ cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].eax,
+ cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].ebx,
+ cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].ecx,
+ cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].edx);
+
+}
+
+static void
get_common_indeces (struct cpu_features *cpu_features,
unsigned int *family, unsigned int *model,
- unsigned int *extended_model)
+ unsigned int *extended_model, unsigned int *stepping)
{
- unsigned int eax;
- __cpuid (1, eax, cpu_features->cpuid[COMMON_CPUID_INDEX_1].ebx,
- cpu_features->cpuid[COMMON_CPUID_INDEX_1].ecx,
- cpu_features->cpuid[COMMON_CPUID_INDEX_1].edx);
- GLRO(dl_x86_cpu_features).cpuid[COMMON_CPUID_INDEX_1].eax = eax;
- *family = (eax >> 8) & 0x0f;
- *model = (eax >> 4) & 0x0f;
- *extended_model = (eax >> 12) & 0xf0;
- if (*family == 0x0f)
+ if (family)
{
- *family += (eax >> 20) & 0xff;
- *model += *extended_model;
+ unsigned int eax;
+ __cpuid (1, eax, cpu_features->cpuid[COMMON_CPUID_INDEX_1].ebx,
+ cpu_features->cpuid[COMMON_CPUID_INDEX_1].ecx,
+ cpu_features->cpuid[COMMON_CPUID_INDEX_1].edx);
+ cpu_features->cpuid[COMMON_CPUID_INDEX_1].eax = eax;
+ *family = (eax >> 8) & 0x0f;
+ *model = (eax >> 4) & 0x0f;
+ *extended_model = (eax >> 12) & 0xf0;
+ *stepping = eax & 0x0f;
+ if (*family == 0x0f)
+ {
+ *family += (eax >> 20) & 0xff;
+ *model += *extended_model;
+ }
+ }
+
+ if (cpu_features->max_cpuid >= 7)
+ __cpuid_count (7, 0,
+ cpu_features->cpuid[COMMON_CPUID_INDEX_7].eax,
+ cpu_features->cpuid[COMMON_CPUID_INDEX_7].ebx,
+ cpu_features->cpuid[COMMON_CPUID_INDEX_7].ecx,
+ cpu_features->cpuid[COMMON_CPUID_INDEX_7].edx);
+
+ /* Can we call xgetbv? */
+ if (CPU_FEATURES_CPU_P (cpu_features, OSXSAVE))
+ {
+ unsigned int xcrlow;
+ unsigned int xcrhigh;
+ asm ("xgetbv" : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
+ /* Is YMM and XMM state usable? */
+ if ((xcrlow & (bit_YMM_state | bit_XMM_state)) ==
+ (bit_YMM_state | bit_XMM_state))
+ {
+ /* Determine if AVX is usable. */
+ if (CPU_FEATURES_CPU_P (cpu_features, AVX))
+ {
+ 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;
+
+ /* Unaligned load with 256-bit AVX registers are faster on
+ Intel/AMD processors with AVX2. */
+ cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load]
+ |= bit_arch_AVX_Fast_Unaligned_Load;
+ }
+ /* 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
+ | bit_ZMM16_31_state)) ==
+ (bit_Opmask_state | bit_ZMM0_15_state | bit_ZMM16_31_state))
+ {
+ /* Determine if AVX512F is usable. */
+ if (CPU_FEATURES_CPU_P (cpu_features, AVX512F))
+ {
+ cpu_features->feature[index_arch_AVX512F_Usable]
+ |= bit_arch_AVX512F_Usable;
+ /* Determine if AVX512DQ is usable. */
+ if (CPU_FEATURES_CPU_P (cpu_features, AVX512DQ))
+ cpu_features->feature[index_arch_AVX512DQ_Usable]
+ |= bit_arch_AVX512DQ_Usable;
+ }
+ }
+ }
+
+ /* For _dl_runtime_resolve, set xsave_state_size to xsave area
+ size + integer register save size and align it to 64 bytes. */
+ if (cpu_features->max_cpuid >= 0xd)
+ {
+ unsigned int eax, ebx, ecx, edx;
+
+ __cpuid_count (0xd, 0, eax, ebx, ecx, edx);
+ if (ebx != 0)
+ {
+ unsigned int xsave_state_full_size
+ = ALIGN_UP (ebx + STATE_SAVE_OFFSET, 64);
+
+ cpu_features->xsave_state_size
+ = xsave_state_full_size;
+ cpu_features->xsave_state_full_size
+ = xsave_state_full_size;
+
+ __cpuid_count (0xd, 1, eax, ebx, ecx, edx);
+
+ /* Check if XSAVEC is available. */
+ if ((eax & (1 << 1)) != 0)
+ {
+ unsigned int xstate_comp_offsets[32];
+ unsigned int xstate_comp_sizes[32];
+ unsigned int i;
+
+ xstate_comp_offsets[0] = 0;
+ xstate_comp_offsets[1] = 160;
+ xstate_comp_offsets[2] = 576;
+ xstate_comp_sizes[0] = 160;
+ xstate_comp_sizes[1] = 256;
+
+ for (i = 2; i < 32; i++)
+ {
+ if ((STATE_SAVE_MASK & (1 << i)) != 0)
+ {
+ __cpuid_count (0xd, i, eax, ebx, ecx, edx);
+ xstate_comp_sizes[i] = eax;
+ }
+ else
+ {
+ ecx = 0;
+ xstate_comp_sizes[i] = 0;
+ }
+
+ if (i > 2)
+ {
+ xstate_comp_offsets[i]
+ = (xstate_comp_offsets[i - 1]
+ + xstate_comp_sizes[i -1]);
+ if ((ecx & (1 << 1)) != 0)
+ xstate_comp_offsets[i]
+ = ALIGN_UP (xstate_comp_offsets[i], 64);
+ }
+ }
+
+ /* Use XSAVEC. */
+ unsigned int size
+ = xstate_comp_offsets[31] + xstate_comp_sizes[31];
+ if (size)
+ {
+ cpu_features->xsave_state_size
+ = ALIGN_UP (size + STATE_SAVE_OFFSET, 64);
+ cpu_features->feature[index_arch_XSAVEC_Usable]
+ |= bit_arch_XSAVEC_Usable;
+ }
+ }
+ }
+ }
}
}
@@ -60,28 +231,37 @@ init_cpu_features (struct cpu_features *cpu_features)
/* This spells out "GenuineIntel". */
if (ebx == 0x756e6547 && ecx == 0x6c65746e && edx == 0x49656e69)
{
- unsigned int extended_model;
+ unsigned int extended_model, stepping;
kind = arch_kind_intel;
- get_common_indeces (cpu_features, &family, &model, &extended_model);
+ get_common_indeces (cpu_features, &family, &model, &extended_model,
+ &stepping);
+
+ get_extended_indices (cpu_features);
if (family == 0x06)
{
- ecx = cpu_features->cpuid[COMMON_CPUID_INDEX_1].ecx;
model += extended_model;
switch (model)
{
case 0x1c:
case 0x26:
/* BSF is slow on Atom. */
- cpu_features->feature[index_Slow_BSF] |= bit_Slow_BSF;
+ cpu_features->feature[index_arch_Slow_BSF]
+ |= bit_arch_Slow_BSF;
break;
case 0x57:
/* Knights Landing. Enable Silvermont optimizations. */
- cpu_features->feature[index_Prefer_No_VZEROUPPER]
- |= bit_Prefer_No_VZEROUPPER;
+
+ case 0x5c:
+ case 0x5f:
+ /* Unaligned load versions are faster than SSSE3
+ on Goldmont. */
+
+ case 0x4c:
+ /* Airmont is a die shrink of Silvermont. */
case 0x37:
case 0x4a:
@@ -90,22 +270,26 @@ init_cpu_features (struct cpu_features *cpu_features)
case 0x5d:
/* Unaligned load versions are faster than SSSE3
on Silvermont. */
-#if index_Fast_Unaligned_Load != index_Prefer_PMINUB_for_stringop
-# error index_Fast_Unaligned_Load != index_Prefer_PMINUB_for_stringop
+#if index_arch_Fast_Unaligned_Load != index_arch_Prefer_PMINUB_for_stringop
+# error index_arch_Fast_Unaligned_Load != index_arch_Prefer_PMINUB_for_stringop
+#endif
+#if index_arch_Fast_Unaligned_Load != index_arch_Slow_SSE4_2
+# error index_arch_Fast_Unaligned_Load != index_arch_Slow_SSE4_2
#endif
-#if index_Fast_Unaligned_Load != index_Slow_SSE4_2
-# error index_Fast_Unaligned_Load != index_Slow_SSE4_2
+#if index_arch_Fast_Unaligned_Load != index_arch_Fast_Unaligned_Copy
+# error index_arch_Fast_Unaligned_Load != index_arch_Fast_Unaligned_Copy
#endif
- cpu_features->feature[index_Fast_Unaligned_Load]
- |= (bit_Fast_Unaligned_Load
- | bit_Prefer_PMINUB_for_stringop
- | bit_Slow_SSE4_2);
+ cpu_features->feature[index_arch_Fast_Unaligned_Load]
+ |= (bit_arch_Fast_Unaligned_Load
+ | bit_arch_Fast_Unaligned_Copy
+ | bit_arch_Prefer_PMINUB_for_stringop
+ | bit_arch_Slow_SSE4_2);
break;
default:
/* Unknown family 0x06 processors. Assuming this is one
of Core i3/i5/i7 processors if AVX is available. */
- if ((ecx & bit_AVX) == 0)
+ if (!CPU_FEATURES_CPU_P (cpu_features, AVX))
break;
case 0x1a:
@@ -115,124 +299,226 @@ init_cpu_features (struct cpu_features *cpu_features)
case 0x2c:
case 0x2e:
case 0x2f:
- /* Rep string instructions, copy backward, unaligned loads
+ /* Rep string instructions, unaligned load, unaligned copy,
and pminub are fast on Intel Core i3, i5 and i7. */
-#if index_Fast_Rep_String != index_Fast_Copy_Backward
-# error index_Fast_Rep_String != index_Fast_Copy_Backward
+#if index_arch_Fast_Rep_String != index_arch_Fast_Unaligned_Load
+# error index_arch_Fast_Rep_String != index_arch_Fast_Unaligned_Load
#endif
-#if index_Fast_Rep_String != index_Fast_Unaligned_Load
-# error index_Fast_Rep_String != index_Fast_Unaligned_Load
+#if index_arch_Fast_Rep_String != index_arch_Prefer_PMINUB_for_stringop
+# error index_arch_Fast_Rep_String != index_arch_Prefer_PMINUB_for_stringop
#endif
-#if index_Fast_Rep_String != index_Prefer_PMINUB_for_stringop
-# error index_Fast_Rep_String != index_Prefer_PMINUB_for_stringop
+#if index_arch_Fast_Rep_String != index_arch_Fast_Unaligned_Copy
+# error index_arch_Fast_Rep_String != index_arch_Fast_Unaligned_Copy
#endif
- cpu_features->feature[index_Fast_Rep_String]
- |= (bit_Fast_Rep_String
- | bit_Fast_Copy_Backward
- | bit_Fast_Unaligned_Load
- | bit_Prefer_PMINUB_for_stringop);
+ cpu_features->feature[index_arch_Fast_Rep_String]
+ |= (bit_arch_Fast_Rep_String
+ | bit_arch_Fast_Unaligned_Load
+ | bit_arch_Fast_Unaligned_Copy
+ | bit_arch_Prefer_PMINUB_for_stringop);
+ break;
+
+ case 0x3f:
+ /* Xeon E7 v3 with stepping >= 4 has working TSX. */
+ if (stepping >= 4)
+ break;
+ case 0x3c:
+ case 0x45:
+ case 0x46:
+ /* Disable Intel TSX on Haswell processors (except Xeon E7 v3
+ with stepping >= 4) to avoid TSX on kernels that weren't
+ updated with the latest microcode package (which disables
+ broken feature by default). */
+ cpu_features->cpuid[index_cpu_RTM].reg_RTM &= ~bit_cpu_RTM;
break;
}
}
+
+
+ /* Since AVX512ER is unique to Xeon Phi, set Prefer_No_VZEROUPPER
+ if AVX512ER is available. Don't use AVX512 to avoid lower CPU
+ frequency if AVX512ER isn't available. */
+ if (CPU_FEATURES_CPU_P (cpu_features, AVX512ER))
+ cpu_features->feature[index_arch_Prefer_No_VZEROUPPER]
+ |= bit_arch_Prefer_No_VZEROUPPER;
+ else
+ cpu_features->feature[index_arch_Prefer_No_AVX512]
+ |= bit_arch_Prefer_No_AVX512;
}
/* This spells out "AuthenticAMD". */
else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
{
- unsigned int extended_model;
+ unsigned int extended_model, stepping;
kind = arch_kind_amd;
- get_common_indeces (cpu_features, &family, &model, &extended_model);
+ get_common_indeces (cpu_features, &family, &model, &extended_model,
+ &stepping);
+
+ get_extended_indices (cpu_features);
ecx = cpu_features->cpuid[COMMON_CPUID_INDEX_1].ecx;
- unsigned int eax;
- __cpuid (0x80000000, eax, ebx, ecx, edx);
- if (eax >= 0x80000001)
- __cpuid (0x80000001,
- cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].eax,
- cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].ebx,
- cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].ecx,
- cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].edx);
+ if (HAS_ARCH_FEATURE (AVX_Usable))
+ {
+ /* Since the FMA4 bit is in COMMON_CPUID_INDEX_80000001 and
+ FMA4 requires AVX, determine if FMA4 is usable here. */
+ if (CPU_FEATURES_CPU_P (cpu_features, FMA4))
+ cpu_features->feature[index_arch_FMA4_Usable]
+ |= bit_arch_FMA4_Usable;
+ }
if (family == 0x15)
{
+#if index_arch_Fast_Unaligned_Load != index_arch_Fast_Copy_Backward
+# error index_arch_Fast_Unaligned_Load != index_arch_Fast_Copy_Backward
+#endif
/* "Excavator" */
if (model >= 0x60 && model <= 0x7f)
- cpu_features->feature[index_Fast_Unaligned_Load]
- |= bit_Fast_Unaligned_Load;
+ {
+ cpu_features->feature[index_arch_Fast_Unaligned_Load]
+ |= (bit_arch_Fast_Unaligned_Load
+ | bit_arch_Fast_Copy_Backward);
+
+ /* Unaligned AVX loads are slower.*/
+ cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load]
+ &= ~bit_arch_AVX_Fast_Unaligned_Load;
+ }
}
}
else
- kind = arch_kind_other;
+ {
+ kind = arch_kind_other;
+ get_common_indeces (cpu_features, NULL, NULL, NULL, NULL);
+ }
/* Support i586 if CX8 is available. */
- if (HAS_CPU_FEATURE (CX8))
- cpu_features->feature[index_I586] |= bit_I586;
+ if (CPU_FEATURES_CPU_P (cpu_features, CX8))
+ cpu_features->feature[index_arch_I586] |= bit_arch_I586;
/* Support i686 if CMOV is available. */
- if (HAS_CPU_FEATURE (CMOV))
- cpu_features->feature[index_I686] |= bit_I686;
+ if (CPU_FEATURES_CPU_P (cpu_features, CMOV))
+ cpu_features->feature[index_arch_I686] |= bit_arch_I686;
- if (cpu_features->max_cpuid >= 7)
- __cpuid_count (7, 0,
- cpu_features->cpuid[COMMON_CPUID_INDEX_7].eax,
- cpu_features->cpuid[COMMON_CPUID_INDEX_7].ebx,
- cpu_features->cpuid[COMMON_CPUID_INDEX_7].ecx,
- cpu_features->cpuid[COMMON_CPUID_INDEX_7].edx);
+#if !HAS_CPUID
+no_cpuid:
+#endif
- /* Can we call xgetbv? */
- if (HAS_CPU_FEATURE (OSXSAVE))
+ cpu_features->family = family;
+ cpu_features->model = model;
+ cpu_features->kind = kind;
+
+#if HAVE_TUNABLES
+ TUNABLE_GET (hwcaps, tunable_val_t *, TUNABLE_CALLBACK (set_hwcaps));
+ cpu_features->non_temporal_threshold
+ = TUNABLE_GET (x86_non_temporal_threshold, long int, NULL);
+ cpu_features->data_cache_size
+ = TUNABLE_GET (x86_data_cache_size, long int, NULL);
+ cpu_features->shared_cache_size
+ = TUNABLE_GET (x86_shared_cache_size, long int, NULL);
+#endif
+
+ /* Reuse dl_platform, dl_hwcap and dl_hwcap_mask for x86. */
+#if !HAVE_TUNABLES && defined SHARED
+ /* The glibc.tune.hwcap_mask tunable is initialized already, so no need to do
+ this. */
+ GLRO(dl_hwcap_mask) = HWCAP_IMPORTANT;
+#endif
+
+#ifdef __x86_64__
+ GLRO(dl_hwcap) = HWCAP_X86_64;
+ if (cpu_features->kind == arch_kind_intel)
{
- unsigned int xcrlow;
- unsigned int xcrhigh;
- asm ("xgetbv" : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
- /* Is YMM and XMM state usable? */
- if ((xcrlow & (bit_YMM_state | bit_XMM_state)) ==
- (bit_YMM_state | bit_XMM_state))
+ const char *platform = NULL;
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
+ && CPU_FEATURES_CPU_P (cpu_features, AVX512CD))
{
- /* Determine if AVX is usable. */
- if (HAS_CPU_FEATURE (AVX))
- cpu_features->feature[index_AVX_Usable] |= bit_AVX_Usable;
-#if index_AVX2_Usable != index_AVX_Fast_Unaligned_Load
-# error index_AVX2_Usable != index_AVX_Fast_Unaligned_Load
-#endif
- /* Determine if AVX2 is usable. Unaligned load with 256-bit
- AVX registers are faster on processors with AVX2. */
- if (HAS_CPU_FEATURE (AVX2))
- cpu_features->feature[index_AVX2_Usable]
- |= bit_AVX2_Usable | bit_AVX_Fast_Unaligned_Load;
- /* 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
- | bit_ZMM16_31_state)) ==
- (bit_Opmask_state | bit_ZMM0_15_state | bit_ZMM16_31_state))
+ if (CPU_FEATURES_CPU_P (cpu_features, AVX512ER))
{
- /* Determine if AVX512F is usable. */
- if (HAS_CPU_FEATURE (AVX512F))
- {
- cpu_features->feature[index_AVX512F_Usable]
- |= bit_AVX512F_Usable;
- /* Determine if AVX512DQ is usable. */
- if (HAS_CPU_FEATURE (AVX512DQ))
- cpu_features->feature[index_AVX512DQ_Usable]
- |= bit_AVX512DQ_Usable;
- }
+ if (CPU_FEATURES_CPU_P (cpu_features, AVX512PF))
+ platform = "xeon_phi";
+ }
+ else
+ {
+ if (CPU_FEATURES_CPU_P (cpu_features, AVX512BW)
+ && CPU_FEATURES_CPU_P (cpu_features, AVX512DQ)
+ && CPU_FEATURES_CPU_P (cpu_features, AVX512VL))
+ GLRO(dl_hwcap) |= HWCAP_X86_AVX512_1;
}
- /* Determine if FMA is usable. */
- if (HAS_CPU_FEATURE (FMA))
- cpu_features->feature[index_FMA_Usable] |= bit_FMA_Usable;
- /* Determine if FMA4 is usable. */
- if (HAS_CPU_FEATURE (FMA4))
- cpu_features->feature[index_FMA4_Usable] |= bit_FMA4_Usable;
}
+
+ if (platform == NULL
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, FMA_Usable)
+ && CPU_FEATURES_CPU_P (cpu_features, BMI1)
+ && CPU_FEATURES_CPU_P (cpu_features, BMI2)
+ && CPU_FEATURES_CPU_P (cpu_features, LZCNT)
+ && CPU_FEATURES_CPU_P (cpu_features, MOVBE)
+ && CPU_FEATURES_CPU_P (cpu_features, POPCNT))
+ platform = "haswell";
+
+ if (platform != NULL)
+ GLRO(dl_platform) = platform;
}
+#else
+ GLRO(dl_hwcap) = 0;
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE2))
+ GLRO(dl_hwcap) |= HWCAP_X86_SSE2;
-#if !HAS_CPUID
-no_cpuid:
+ if (CPU_FEATURES_ARCH_P (cpu_features, I686))
+ GLRO(dl_platform) = "i686";
+ else if (CPU_FEATURES_ARCH_P (cpu_features, I586))
+ GLRO(dl_platform) = "i586";
#endif
- cpu_features->family = family;
- cpu_features->model = model;
- cpu_features->kind = kind;
+#if CET_ENABLED
+# if HAVE_TUNABLES
+ TUNABLE_GET (x86_ibt, tunable_val_t *,
+ TUNABLE_CALLBACK (set_x86_ibt));
+ TUNABLE_GET (x86_shstk, tunable_val_t *,
+ TUNABLE_CALLBACK (set_x86_shstk));
+# endif
+
+ /* Check CET status. */
+ unsigned int cet_status = get_cet_status ();
+
+ if (cet_status)
+ {
+ GL(dl_x86_feature_1)[0] = cet_status;
+
+# ifndef SHARED
+ /* Check if IBT and SHSTK are enabled by kernel. */
+ if ((cet_status & GNU_PROPERTY_X86_FEATURE_1_IBT)
+ || (cet_status & GNU_PROPERTY_X86_FEATURE_1_SHSTK))
+ {
+ /* Disable IBT and/or SHSTK if they are enabled by kernel, but
+ disabled by environment variable:
+
+ GLIBC_TUNABLES=glibc.tune.hwcaps=-IBT,-SHSTK
+ */
+ unsigned int cet_feature = 0;
+ if (!HAS_CPU_FEATURE (IBT))
+ cet_feature |= GNU_PROPERTY_X86_FEATURE_1_IBT;
+ if (!HAS_CPU_FEATURE (SHSTK))
+ cet_feature |= GNU_PROPERTY_X86_FEATURE_1_SHSTK;
+
+ if (cet_feature)
+ {
+ int res = dl_cet_disable_cet (cet_feature);
+
+ /* Clear the disabled bits in dl_x86_feature_1. */
+ if (res == 0)
+ GL(dl_x86_feature_1)[0] &= ~cet_feature;
+ }
+
+ /* Lock CET if IBT or SHSTK is enabled in executable. Don't
+ lock CET if SHSTK is enabled permissively. */
+ if (((GL(dl_x86_feature_1)[1] >> CET_MAX)
+ & ((1 << CET_MAX) - 1))
+ != CET_PERMISSIVE)
+ dl_cet_lock_cet ();
+ }
+# endif
+ }
+#endif
}
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
index e354920d5d..347a4b118d 100644
--- a/sysdeps/x86/cpu-features.h
+++ b/sysdeps/x86/cpu-features.h
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,48 +18,70 @@
#ifndef cpu_features_h
#define cpu_features_h
-#define bit_Fast_Rep_String (1 << 0)
-#define bit_Fast_Copy_Backward (1 << 1)
-#define bit_Slow_BSF (1 << 2)
-#define bit_Fast_Unaligned_Load (1 << 4)
-#define bit_Prefer_PMINUB_for_stringop (1 << 5)
-#define bit_AVX_Usable (1 << 6)
-#define bit_FMA_Usable (1 << 7)
-#define bit_FMA4_Usable (1 << 8)
-#define bit_Slow_SSE4_2 (1 << 9)
-#define bit_AVX2_Usable (1 << 10)
-#define bit_AVX_Fast_Unaligned_Load (1 << 11)
-#define bit_AVX512F_Usable (1 << 12)
-#define bit_AVX512DQ_Usable (1 << 13)
-#define bit_I586 (1 << 14)
-#define bit_I686 (1 << 15)
-#define bit_Prefer_MAP_32BIT_EXEC (1 << 16)
-#define bit_Prefer_No_VZEROUPPER (1 << 17)
+#define bit_arch_Fast_Rep_String (1 << 0)
+#define bit_arch_Fast_Copy_Backward (1 << 1)
+#define bit_arch_Slow_BSF (1 << 2)
+#define bit_arch_Fast_Unaligned_Load (1 << 4)
+#define bit_arch_Prefer_PMINUB_for_stringop (1 << 5)
+#define bit_arch_AVX_Usable (1 << 6)
+#define bit_arch_FMA_Usable (1 << 7)
+#define bit_arch_FMA4_Usable (1 << 8)
+#define bit_arch_Slow_SSE4_2 (1 << 9)
+#define bit_arch_AVX2_Usable (1 << 10)
+#define bit_arch_AVX_Fast_Unaligned_Load (1 << 11)
+#define bit_arch_AVX512F_Usable (1 << 12)
+#define bit_arch_AVX512DQ_Usable (1 << 13)
+#define bit_arch_I586 (1 << 14)
+#define bit_arch_I686 (1 << 15)
+#define bit_arch_Prefer_MAP_32BIT_EXEC (1 << 16)
+#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_Prefer_No_AVX512 (1 << 20)
+#define bit_arch_MathVec_Prefer_No_AVX512 (1 << 21)
+#define bit_arch_XSAVEC_Usable (1 << 22)
+#define bit_arch_Prefer_FSRM (1 << 23)
/* CPUID Feature flags. */
/* COMMON_CPUID_INDEX_1. */
-#define bit_CX8 (1 << 8)
-#define bit_CMOV (1 << 15)
-#define bit_SSE2 (1 << 26)
-#define bit_SSSE3 (1 << 9)
-#define bit_SSE4_1 (1 << 19)
-#define bit_SSE4_2 (1 << 20)
-#define bit_OSXSAVE (1 << 27)
-#define bit_AVX (1 << 28)
-#define bit_POPCOUNT (1 << 23)
-#define bit_FMA (1 << 12)
-#define bit_FMA4 (1 << 16)
+#define bit_cpu_CX8 (1 << 8)
+#define bit_cpu_CMOV (1 << 15)
+#define bit_cpu_SSE (1 << 25)
+#define bit_cpu_SSE2 (1 << 26)
+#define bit_cpu_SSSE3 (1 << 9)
+#define bit_cpu_SSE4_1 (1 << 19)
+#define bit_cpu_SSE4_2 (1 << 20)
+#define bit_cpu_OSXSAVE (1 << 27)
+#define bit_cpu_AVX (1 << 28)
+#define bit_cpu_POPCOUNT (1 << 23)
+#define bit_cpu_FMA (1 << 12)
+#define bit_cpu_FMA4 (1 << 16)
+#define bit_cpu_HTT (1 << 28)
+#define bit_cpu_LZCNT (1 << 5)
+#define bit_cpu_MOVBE (1 << 22)
+#define bit_cpu_POPCNT (1 << 23)
/* COMMON_CPUID_INDEX_7. */
-#define bit_RTM (1 << 11)
-#define bit_AVX2 (1 << 5)
-#define bit_AVX512F (1 << 16)
-#define bit_AVX512DQ (1 << 17)
+#define bit_cpu_BMI1 (1 << 3)
+#define bit_cpu_BMI2 (1 << 8)
+#define bit_cpu_ERMS (1 << 9)
+#define bit_cpu_RTM (1 << 11)
+#define bit_cpu_AVX2 (1 << 5)
+#define bit_cpu_AVX512F (1 << 16)
+#define bit_cpu_AVX512DQ (1 << 17)
+#define bit_cpu_AVX512PF (1 << 26)
+#define bit_cpu_AVX512ER (1 << 27)
+#define bit_cpu_AVX512CD (1 << 28)
+#define bit_cpu_AVX512BW (1 << 30)
+#define bit_cpu_AVX512VL (1u << 31)
+#define bit_cpu_IBT (1u << 20)
+#define bit_cpu_SHSTK (1u << 7)
+#define bit_cpu_FSRM (1 << 4)
/* XCR0 Feature flags. */
-#define bit_XMM_state (1 << 1)
-#define bit_YMM_state (2 << 1)
+#define bit_XMM_state (1 << 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)
@@ -70,98 +92,23 @@
/* The current maximum size of the feature integer bit array. */
#define FEATURE_INDEX_MAX 1
-#ifdef __ASSEMBLER__
-
-# include <ifunc-defines.h>
-# include <rtld-global-offsets.h>
-
-# define index_CX8 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_EDX_OFFSET
-# define index_CMOV COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_EDX_OFFSET
-# define index_SSE2 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_EDX_OFFSET
-# define index_SSSE3 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET
-# define index_SSE4_1 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET
-# define index_SSE4_2 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET
-# define index_AVX COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET
-# define index_AVX2 COMMON_CPUID_INDEX_7*CPUID_SIZE+CPUID_EBX_OFFSET
-
-# define index_Fast_Rep_String FEATURE_INDEX_1*FEATURE_SIZE
-# define index_Fast_Copy_Backward FEATURE_INDEX_1*FEATURE_SIZE
-# define index_Slow_BSF FEATURE_INDEX_1*FEATURE_SIZE
-# define index_Fast_Unaligned_Load FEATURE_INDEX_1*FEATURE_SIZE
-# define index_Prefer_PMINUB_for_stringop FEATURE_INDEX_1*FEATURE_SIZE
-# define index_AVX_Usable FEATURE_INDEX_1*FEATURE_SIZE
-# define index_FMA_Usable FEATURE_INDEX_1*FEATURE_SIZE
-# define index_FMA4_Usable FEATURE_INDEX_1*FEATURE_SIZE
-# define index_Slow_SSE4_2 FEATURE_INDEX_1*FEATURE_SIZE
-# define index_AVX2_Usable FEATURE_INDEX_1*FEATURE_SIZE
-# define index_AVX_Fast_Unaligned_Load FEATURE_INDEX_1*FEATURE_SIZE
-# define index_AVX512F_Usable FEATURE_INDEX_1*FEATURE_SIZE
-# define index_AVX512DQ_Usable FEATURE_INDEX_1*FEATURE_SIZE
-# define index_I586 FEATURE_INDEX_1*FEATURE_SIZE
-# define index_I686 FEATURE_INDEX_1*FEATURE_SIZE
-# define index_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1*FEATURE_SIZE
-# define index_Prefer_No_VZEROUPPER FEATURE_INDEX_1*FEATURE_SIZE
-
-
-# if defined (_LIBC) && !IS_IN (nonlib)
-# ifdef __x86_64__
-# ifdef SHARED
-# if IS_IN (rtld)
-# define LOAD_RTLD_GLOBAL_RO_RDX
-# define HAS_FEATURE(offset, name) \
- testl $(bit_##name), _rtld_local_ro+offset+(index_##name)(%rip)
-# else
-# define LOAD_RTLD_GLOBAL_RO_RDX \
- mov _rtld_global_ro@GOTPCREL(%rip), %RDX_LP
-# define HAS_FEATURE(offset, name) \
- testl $(bit_##name), \
- RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET+offset+(index_##name)(%rdx)
-# endif
-# else /* SHARED */
-# define LOAD_RTLD_GLOBAL_RO_RDX
-# define HAS_FEATURE(offset, name) \
- testl $(bit_##name), _dl_x86_cpu_features+offset+(index_##name)(%rip)
-# endif /* !SHARED */
-# else /* __x86_64__ */
-# ifdef SHARED
-# define LOAD_FUNC_GOT_EAX(func) \
- leal func@GOTOFF(%edx), %eax
-# if IS_IN (rtld)
-# define LOAD_GOT_AND_RTLD_GLOBAL_RO \
- LOAD_PIC_REG(dx)
-# define HAS_FEATURE(offset, name) \
- testl $(bit_##name), offset+(index_##name)+_rtld_local_ro@GOTOFF(%edx)
-# else
-# define LOAD_GOT_AND_RTLD_GLOBAL_RO \
- LOAD_PIC_REG(dx); \
- mov _rtld_global_ro@GOT(%edx), %ecx
-# define HAS_FEATURE(offset, name) \
- testl $(bit_##name), \
- RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET+offset+(index_##name)(%ecx)
-# endif
-# else /* SHARED */
-# define LOAD_FUNC_GOT_EAX(func) \
- leal func, %eax
-# define LOAD_GOT_AND_RTLD_GLOBAL_RO
-# define HAS_FEATURE(offset, name) \
- testl $(bit_##name), _dl_x86_cpu_features+offset+(index_##name)
-# endif /* !SHARED */
-# endif /* !__x86_64__ */
-# else /* _LIBC && !nonlib */
-# error "Sorry, <cpu-features.h> is unimplemented for assembler"
-# endif /* !_LIBC || nonlib */
+/* Offset for fxsave/xsave area used by _dl_runtime_resolve. Also need
+ space to preserve RCX, RDX, RSI, RDI, R8, R9 and RAX. It must be
+ aligned to 16 bytes for fxsave and 64 bytes for xsave. */
+#define STATE_SAVE_OFFSET (8 * 7 + 8)
-/* HAS_* evaluates to true if we may use the feature at runtime. */
-# define HAS_CPU_FEATURE(name) HAS_FEATURE (CPUID_OFFSET, name)
-# define HAS_ARCH_FEATURE(name) HAS_FEATURE (FEATURE_OFFSET, name)
+/* Save SSE, AVX, AVX512, mask and bound registers. */
+#define STATE_SAVE_MASK \
+ ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5) | (1 << 6) | (1 << 7))
+#ifdef __ASSEMBLER__
+# include <cpu-features-offsets.h>
#else /* __ASSEMBLER__ */
-
enum
{
COMMON_CPUID_INDEX_1 = 0,
COMMON_CPUID_INDEX_7,
- COMMON_CPUID_INDEX_80000001, /* for AMD */
+ COMMON_CPUID_INDEX_80000001,
/* Keep the following line at the end. */
COMMON_CPUID_INDEX_MAX
};
@@ -185,7 +132,27 @@ struct cpu_features
} cpuid[COMMON_CPUID_INDEX_MAX];
unsigned int family;
unsigned int model;
+ /* The state size for XSAVEC or XSAVE. The type must be unsigned long
+ int so that we use
+
+ sub xsave_state_size_offset(%rip) %RSP_LP
+
+ in _dl_runtime_resolve. */
+ unsigned long int xsave_state_size;
+ /* The full state size for XSAVE when XSAVEC is disabled by
+
+ GLIBC_TUNABLES=glibc.tune.hwcaps=-XSAVEC_Usable
+ */
+ unsigned int xsave_state_full_size;
unsigned int feature[FEATURE_INDEX_MAX];
+ /* Data cache size for use in memory and string routines, typically
+ L1 size. */
+ unsigned long int data_cache_size;
+ /* Shared cache size for use in memory and string routines, typically
+ L2 or L3 size. */
+ unsigned long int shared_cache_size;
+ /* Threshold to use non temporal store. */
+ unsigned long int non_temporal_threshold;
};
/* Used from outside of glibc to get access to the CPU features
@@ -200,30 +167,53 @@ extern const struct cpu_features *__get_cpu_features (void)
# endif
+/* Only used directly in cpu-features.c. */
+# define CPU_FEATURES_CPU_P(ptr, name) \
+ ((ptr->cpuid[index_cpu_##name].reg_##name & (bit_cpu_##name)) != 0)
+# define CPU_FEATURES_ARCH_P(ptr, name) \
+ ((ptr->feature[index_arch_##name] & (bit_arch_##name)) != 0)
+
/* HAS_* evaluates to true if we may use the feature at runtime. */
# define HAS_CPU_FEATURE(name) \
- ((__get_cpu_features ()->cpuid[index_##name].reg_##name & (bit_##name)) != 0)
+ CPU_FEATURES_CPU_P (__get_cpu_features (), name)
# define HAS_ARCH_FEATURE(name) \
- ((__get_cpu_features ()->feature[index_##name] & (bit_##name)) != 0)
+ CPU_FEATURES_ARCH_P (__get_cpu_features (), name)
-# define index_CX8 COMMON_CPUID_INDEX_1
-# define index_CMOV COMMON_CPUID_INDEX_1
-# define index_SSE2 COMMON_CPUID_INDEX_1
-# define index_SSSE3 COMMON_CPUID_INDEX_1
-# define index_SSE4_1 COMMON_CPUID_INDEX_1
-# define index_SSE4_2 COMMON_CPUID_INDEX_1
-# define index_AVX COMMON_CPUID_INDEX_1
-# define index_AVX2 COMMON_CPUID_INDEX_7
-# define index_AVX512F COMMON_CPUID_INDEX_7
-# define index_AVX512DQ COMMON_CPUID_INDEX_7
-# define index_RTM COMMON_CPUID_INDEX_7
-# define index_FMA COMMON_CPUID_INDEX_1
-# define index_FMA4 COMMON_CPUID_INDEX_80000001
-# define index_POPCOUNT COMMON_CPUID_INDEX_1
-# define index_OSXSAVE COMMON_CPUID_INDEX_1
+# define index_cpu_CX8 COMMON_CPUID_INDEX_1
+# define index_cpu_CMOV COMMON_CPUID_INDEX_1
+# define index_cpu_SSE COMMON_CPUID_INDEX_1
+# define index_cpu_SSE2 COMMON_CPUID_INDEX_1
+# define index_cpu_SSSE3 COMMON_CPUID_INDEX_1
+# define index_cpu_SSE4_1 COMMON_CPUID_INDEX_1
+# define index_cpu_SSE4_2 COMMON_CPUID_INDEX_1
+# define index_cpu_AVX COMMON_CPUID_INDEX_1
+# define index_cpu_AVX2 COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512F COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512DQ COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512PF COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512ER COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512CD COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512BW COMMON_CPUID_INDEX_7
+# define index_cpu_AVX512VL COMMON_CPUID_INDEX_7
+# define index_cpu_ERMS COMMON_CPUID_INDEX_7
+# define index_cpu_RTM COMMON_CPUID_INDEX_7
+# define index_cpu_FMA COMMON_CPUID_INDEX_1
+# define index_cpu_FMA4 COMMON_CPUID_INDEX_80000001
+# define index_cpu_POPCOUNT COMMON_CPUID_INDEX_1
+# define index_cpu_OSXSAVE COMMON_CPUID_INDEX_1
+# define index_cpu_HTT COMMON_CPUID_INDEX_1
+# define index_cpu_BMI1 COMMON_CPUID_INDEX_7
+# define index_cpu_BMI2 COMMON_CPUID_INDEX_7
+# define index_cpu_LZCNT COMMON_CPUID_INDEX_80000001
+# define index_cpu_MOVBE COMMON_CPUID_INDEX_1
+# define index_cpu_POPCNT COMMON_CPUID_INDEX_1
+# define index_cpu_IBT COMMON_CPUID_INDEX_7
+# define index_cpu_SHSTK COMMON_CPUID_INDEX_7
+# define index_cpu_FSRM COMMON_CPUID_INDEX_7
# define reg_CX8 edx
# define reg_CMOV edx
+# define reg_SSE edx
# define reg_SSE2 edx
# define reg_SSSE3 ecx
# define reg_SSE4_1 ecx
@@ -232,29 +222,50 @@ extern const struct cpu_features *__get_cpu_features (void)
# define reg_AVX2 ebx
# define reg_AVX512F ebx
# define reg_AVX512DQ ebx
+# define reg_AVX512PF ebx
+# define reg_AVX512ER ebx
+# define reg_AVX512CD ebx
+# define reg_AVX512BW ebx
+# define reg_AVX512VL ebx
+# define reg_ERMS ebx
# define reg_RTM ebx
# define reg_FMA ecx
# define reg_FMA4 ecx
# define reg_POPCOUNT ecx
# define reg_OSXSAVE ecx
+# define reg_HTT edx
+# define reg_BMI1 ebx
+# define reg_BMI2 ebx
+# define reg_LZCNT ecx
+# define reg_MOVBE ecx
+# define reg_POPCNT ecx
+# define reg_IBT edx
+# define reg_SHSTK ecx
+# define reg_FSRM edx
-# define index_Fast_Rep_String FEATURE_INDEX_1
-# define index_Fast_Copy_Backward FEATURE_INDEX_1
-# define index_Slow_BSF FEATURE_INDEX_1
-# define index_Fast_Unaligned_Load FEATURE_INDEX_1
-# define index_Prefer_PMINUB_for_stringop FEATURE_INDEX_1
-# define index_AVX_Usable FEATURE_INDEX_1
-# define index_FMA_Usable FEATURE_INDEX_1
-# define index_FMA4_Usable FEATURE_INDEX_1
-# define index_Slow_SSE4_2 FEATURE_INDEX_1
-# define index_AVX2_Usable FEATURE_INDEX_1
-# define index_AVX_Fast_Unaligned_Load FEATURE_INDEX_1
-# define index_AVX512F_Usable FEATURE_INDEX_1
-# define index_AVX512DQ_Usable FEATURE_INDEX_1
-# define index_I586 FEATURE_INDEX_1
-# define index_I686 FEATURE_INDEX_1
-# define index_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1
-# define index_Prefer_No_VZEROUPPER FEATURE_INDEX_1
+# define index_arch_Fast_Rep_String FEATURE_INDEX_1
+# define index_arch_Fast_Copy_Backward FEATURE_INDEX_1
+# define index_arch_Slow_BSF FEATURE_INDEX_1
+# define index_arch_Fast_Unaligned_Load FEATURE_INDEX_1
+# define index_arch_Prefer_PMINUB_for_stringop FEATURE_INDEX_1
+# define index_arch_AVX_Usable FEATURE_INDEX_1
+# define index_arch_FMA_Usable FEATURE_INDEX_1
+# define index_arch_FMA4_Usable FEATURE_INDEX_1
+# define index_arch_Slow_SSE4_2 FEATURE_INDEX_1
+# define index_arch_AVX2_Usable FEATURE_INDEX_1
+# define index_arch_AVX_Fast_Unaligned_Load FEATURE_INDEX_1
+# define index_arch_AVX512F_Usable FEATURE_INDEX_1
+# define index_arch_AVX512DQ_Usable FEATURE_INDEX_1
+# define index_arch_I586 FEATURE_INDEX_1
+# define index_arch_I686 FEATURE_INDEX_1
+# define index_arch_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1
+# 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_Prefer_No_AVX512 FEATURE_INDEX_1
+# define index_arch_MathVec_Prefer_No_AVX512 FEATURE_INDEX_1
+# define index_arch_XSAVEC_Usable FEATURE_INDEX_1
+# define index_arch_Prefer_FSRM FEATURE_INDEX_1
#endif /* !__ASSEMBLER__ */
diff --git a/sysdeps/x86/cpu-tunables.c b/sysdeps/x86/cpu-tunables.c
new file mode 100644
index 0000000000..69155a8f44
--- /dev/null
+++ b/sysdeps/x86/cpu-tunables.c
@@ -0,0 +1,385 @@
+/* x86 CPU feature tuning.
+ This file is part of the GNU C Library.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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/>. */
+
+#if HAVE_TUNABLES
+# define TUNABLE_NAMESPACE tune
+# include <stdbool.h>
+# include <stdint.h>
+# include <unistd.h> /* Get STDOUT_FILENO for _dl_printf. */
+# include <elf/dl-tunables.h>
+# include <string.h>
+# include <cpu-features.h>
+# include <ldsodefs.h>
+
+/* We can't use IFUNC memcmp nor strlen in init_cpu_features from libc.a
+ since IFUNC must be set up by init_cpu_features. */
+# if defined USE_MULTIARCH && !defined SHARED
+# ifdef __x86_64__
+# define DEFAULT_MEMCMP __memcmp_sse2
+# else
+# define DEFAULT_MEMCMP __memcmp_ia32
+# endif
+extern __typeof (memcmp) DEFAULT_MEMCMP;
+# else
+# define DEFAULT_MEMCMP memcmp
+# endif
+
+# define CHECK_GLIBC_IFUNC_CPU_OFF(f, cpu_features, name, len) \
+ _Static_assert (sizeof (#name) - 1 == len, #name " != " #len); \
+ if (!DEFAULT_MEMCMP (f, #name, len)) \
+ { \
+ cpu_features->cpuid[index_cpu_##name].reg_##name \
+ &= ~bit_cpu_##name; \
+ break; \
+ }
+
+/* Disable an ARCH feature NAME. We don't enable an ARCH feature which
+ isn't available. */
+# define CHECK_GLIBC_IFUNC_ARCH_OFF(f, cpu_features, name, len) \
+ _Static_assert (sizeof (#name) - 1 == len, #name " != " #len); \
+ if (!DEFAULT_MEMCMP (f, #name, len)) \
+ { \
+ cpu_features->feature[index_arch_##name] \
+ &= ~bit_arch_##name; \
+ break; \
+ }
+
+/* Enable/disable an ARCH feature NAME. */
+# define CHECK_GLIBC_IFUNC_ARCH_BOTH(f, cpu_features, name, disable, \
+ len) \
+ _Static_assert (sizeof (#name) - 1 == len, #name " != " #len); \
+ if (!DEFAULT_MEMCMP (f, #name, len)) \
+ { \
+ if (disable) \
+ cpu_features->feature[index_arch_##name] \
+ &= ~bit_arch_##name; \
+ else \
+ cpu_features->feature[index_arch_##name] \
+ |= bit_arch_##name; \
+ break; \
+ }
+
+/* Enable/disable an ARCH feature NAME. Enable an ARCH feature only
+ if the ARCH feature NEED is also enabled. */
+# define CHECK_GLIBC_IFUNC_ARCH_NEED_ARCH_BOTH(f, cpu_features, name, \
+ need, disable, len) \
+ _Static_assert (sizeof (#name) - 1 == len, #name " != " #len); \
+ if (!DEFAULT_MEMCMP (f, #name, len)) \
+ { \
+ if (disable) \
+ cpu_features->feature[index_arch_##name] \
+ &= ~bit_arch_##name; \
+ else if (CPU_FEATURES_ARCH_P (cpu_features, need)) \
+ cpu_features->feature[index_arch_##name] \
+ |= bit_arch_##name; \
+ break; \
+ }
+
+/* Enable/disable an ARCH feature NAME. Enable an ARCH feature only
+ if the CPU feature NEED is also enabled. */
+# define CHECK_GLIBC_IFUNC_ARCH_NEED_CPU_BOTH(f, cpu_features, name, \
+ need, disable, len) \
+ _Static_assert (sizeof (#name) - 1 == len, #name " != " #len); \
+ if (!DEFAULT_MEMCMP (f, #name, len)) \
+ { \
+ if (disable) \
+ cpu_features->feature[index_arch_##name] \
+ &= ~bit_arch_##name; \
+ else if (CPU_FEATURES_CPU_P (cpu_features, need)) \
+ cpu_features->feature[index_arch_##name] \
+ |= bit_arch_##name; \
+ break; \
+ }
+
+attribute_hidden
+void
+TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *valp)
+{
+ /* The current IFUNC selection is based on microbenchmarks in glibc.
+ It should give the best performance for most workloads. But other
+ choices may have better performance for a particular workload or on
+ the hardware which wasn't available when the selection was made.
+ The environment variable:
+
+ GLIBC_TUNABLES=glibc.tune.hwcaps=-xxx,yyy,-zzz,....
+
+ can be used to enable CPU/ARCH feature yyy, disable CPU/ARCH feature
+ yyy and zzz, where the feature name is case-sensitive and has to
+ match the ones in cpu-features.h. It can be used by glibc developers
+ to tune for a new processor or override the IFUNC selection to
+ improve performance for a particular workload.
+
+ NOTE: the IFUNC selection may change over time. Please check all
+ multiarch implementations when experimenting. */
+
+ const char *p = valp->strval;
+ struct cpu_features *cpu_features = &GLRO(dl_x86_cpu_features);
+ size_t len;
+
+ do
+ {
+ const char *c, *n;
+ bool disable;
+ size_t nl;
+
+ for (c = p; *c != ','; c++)
+ if (*c == '\0')
+ break;
+
+ len = c - p;
+ disable = *p == '-';
+ if (disable)
+ {
+ n = p + 1;
+ nl = len - 1;
+ }
+ else
+ {
+ n = p;
+ nl = len;
+ }
+ switch (nl)
+ {
+ default:
+ break;
+ case 3:
+ if (disable)
+ {
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, AVX, 3);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, CX8, 3);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, FMA, 3);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, HTT, 3);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, IBT, 3);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, RTM, 3);
+ }
+ break;
+ case 4:
+ if (disable)
+ {
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, AVX2, 4);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, BMI1, 4);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, BMI2, 4);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, CMOV, 4);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, ERMS, 4);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, FMA4, 4);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, SSE2, 4);
+ CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features, I586, 4);
+ CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features, I686, 4);
+ }
+ break;
+ case 5:
+ if (disable)
+ {
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, LZCNT, 5);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, MOVBE, 5);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, SHSTK, 5);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, SSSE3, 5);
+ }
+ break;
+ case 6:
+ if (disable)
+ {
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, POPCNT, 6);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, SSE4_1, 6);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, SSE4_2, 6);
+ }
+ break;
+ case 7:
+ if (disable)
+ {
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, AVX512F, 7);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, OSXSAVE, 7);
+ }
+ break;
+ case 8:
+ if (disable)
+ {
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, AVX512CD, 8);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, AVX512BW, 8);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, AVX512DQ, 8);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, AVX512ER, 8);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, AVX512PF, 8);
+ CHECK_GLIBC_IFUNC_CPU_OFF (n, cpu_features, AVX512VL, 8);
+ }
+ CHECK_GLIBC_IFUNC_ARCH_BOTH (n, cpu_features, Slow_BSF,
+ disable, 8);
+ break;
+ case 10:
+ if (disable)
+ {
+ CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features, AVX_Usable,
+ 10);
+ CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features, FMA_Usable,
+ 10);
+ }
+ break;
+ case 11:
+ if (disable)
+ {
+ CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features, AVX2_Usable,
+ 11);
+ CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features, FMA4_Usable,
+ 11);
+ }
+ CHECK_GLIBC_IFUNC_ARCH_BOTH (n, cpu_features, Prefer_ERMS,
+ disable, 11);
+ CHECK_GLIBC_IFUNC_ARCH_NEED_CPU_BOTH (n, cpu_features,
+ Slow_SSE4_2, SSE4_2,
+ disable, 11);
+ CHECK_GLIBC_IFUNC_ARCH_BOTH (n, cpu_features, Prefer_FSRM,
+ disable, 11);
+ break;
+ case 13:
+ if (disable)
+ {
+ /* Update xsave_state_size to XSAVE state size. */
+ cpu_features->xsave_state_size
+ = cpu_features->xsave_state_full_size;
+ CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features,
+ XSAVEC_Usable, 13);
+ }
+ break;
+ case 14:
+ if (disable)
+ {
+ CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features,
+ AVX512F_Usable, 14);
+ }
+ break;
+ case 15:
+ if (disable)
+ {
+ CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features,
+ AVX512DQ_Usable, 15);
+ }
+ CHECK_GLIBC_IFUNC_ARCH_BOTH (n, cpu_features, Fast_Rep_String,
+ disable, 15);
+ break;
+ case 16:
+ {
+ CHECK_GLIBC_IFUNC_ARCH_NEED_ARCH_BOTH
+ (n, cpu_features, Prefer_No_AVX512, AVX512F_Usable,
+ disable, 16);
+ }
+ break;
+ case 18:
+ {
+ CHECK_GLIBC_IFUNC_ARCH_BOTH (n, cpu_features,
+ Fast_Copy_Backward, disable,
+ 18);
+ }
+ break;
+ case 19:
+ {
+ CHECK_GLIBC_IFUNC_ARCH_BOTH (n, cpu_features,
+ Fast_Unaligned_Load, disable,
+ 19);
+ CHECK_GLIBC_IFUNC_ARCH_BOTH (n, cpu_features,
+ Fast_Unaligned_Copy, disable,
+ 19);
+ }
+ break;
+ case 20:
+ {
+ CHECK_GLIBC_IFUNC_ARCH_NEED_ARCH_BOTH
+ (n, cpu_features, Prefer_No_VZEROUPPER, AVX_Usable,
+ disable, 20);
+ }
+ break;
+ case 21:
+ {
+ CHECK_GLIBC_IFUNC_ARCH_BOTH (n, cpu_features,
+ Prefer_MAP_32BIT_EXEC, disable,
+ 21);
+ }
+ break;
+ case 23:
+ {
+ CHECK_GLIBC_IFUNC_ARCH_NEED_ARCH_BOTH
+ (n, cpu_features, AVX_Fast_Unaligned_Load, AVX_Usable,
+ disable, 23);
+ }
+ break;
+ case 24:
+ {
+ CHECK_GLIBC_IFUNC_ARCH_NEED_ARCH_BOTH
+ (n, cpu_features, MathVec_Prefer_No_AVX512,
+ AVX512F_Usable, disable, 24);
+ }
+ break;
+ case 26:
+ {
+ CHECK_GLIBC_IFUNC_ARCH_NEED_CPU_BOTH
+ (n, cpu_features, Prefer_PMINUB_for_stringop, SSE2,
+ disable, 26);
+ }
+ break;
+ }
+ p += len + 1;
+ }
+ while (*p != '\0');
+}
+
+# if CET_ENABLED
+# include <cet-tunables.h>
+
+attribute_hidden
+void
+TUNABLE_CALLBACK (set_x86_ibt) (tunable_val_t *valp)
+{
+ if (DEFAULT_MEMCMP (valp->strval, "on", sizeof ("on")) == 0)
+ {
+ GL(dl_x86_feature_1)[1] &= ~((1 << CET_MAX) - 1);
+ GL(dl_x86_feature_1)[1] |= CET_ALWAYS_ON;
+ }
+ else if (DEFAULT_MEMCMP (valp->strval, "off", sizeof ("off")) == 0)
+ {
+ GL(dl_x86_feature_1)[1] &= ~((1 << CET_MAX) - 1);
+ GL(dl_x86_feature_1)[1] |= CET_ALWAYS_OFF;
+ }
+ else if (DEFAULT_MEMCMP (valp->strval, "permissive",
+ sizeof ("permissive")) == 0)
+ {
+ GL(dl_x86_feature_1)[1] &= ~((1 << CET_MAX) - 1);
+ GL(dl_x86_feature_1)[1] |= CET_PERMISSIVE;
+ }
+}
+
+attribute_hidden
+void
+TUNABLE_CALLBACK (set_x86_shstk) (tunable_val_t *valp)
+{
+ if (DEFAULT_MEMCMP (valp->strval, "on", sizeof ("on")) == 0)
+ {
+ GL(dl_x86_feature_1)[1] &= ~(((1 << CET_MAX) - 1) << CET_MAX);
+ GL(dl_x86_feature_1)[1] |= (CET_ALWAYS_ON << CET_MAX);
+ }
+ else if (DEFAULT_MEMCMP (valp->strval, "off", sizeof ("off")) == 0)
+ {
+ GL(dl_x86_feature_1)[1] &= ~(((1 << CET_MAX) - 1) << CET_MAX);
+ GL(dl_x86_feature_1)[1] |= (CET_ALWAYS_OFF << CET_MAX);
+ }
+ else if (DEFAULT_MEMCMP (valp->strval, "permissive",
+ sizeof ("permissive")) == 0)
+ {
+ GL(dl_x86_feature_1)[1] &= ~(((1 << CET_MAX) - 1) << CET_MAX);
+ GL(dl_x86_feature_1)[1] |= (CET_PERMISSIVE << CET_MAX);
+ }
+}
+# endif
+#endif
diff --git a/sysdeps/x86/dl-cet.c b/sysdeps/x86/dl-cet.c
new file mode 100644
index 0000000000..b82ba14e75
--- /dev/null
+++ b/sysdeps/x86/dl-cet.c
@@ -0,0 +1,346 @@
+/* x86 CET initializers function.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <errno.h>
+#include <libintl.h>
+#include <ldsodefs.h>
+#include <dl-cet.h>
+#include <cet-tunables.h>
+
+/* GNU_PROPERTY_X86_FEATURE_1_IBT and GNU_PROPERTY_X86_FEATURE_1_SHSTK
+ are defined in <elf.h>, which are only available for C sources.
+ X86_FEATURE_1_IBT and X86_FEATURE_1_SHSTK are defined in <sysdep.h>
+ which are available for both C and asm sources. They must match. */
+#if GNU_PROPERTY_X86_FEATURE_1_IBT != X86_FEATURE_1_IBT
+# error GNU_PROPERTY_X86_FEATURE_1_IBT != X86_FEATURE_1_IBT
+#endif
+#if GNU_PROPERTY_X86_FEATURE_1_SHSTK != X86_FEATURE_1_SHSTK
+# error GNU_PROPERTY_X86_FEATURE_1_SHSTK != X86_FEATURE_1_SHSTK
+#endif
+
+static int
+dl_cet_mark_legacy_region (struct link_map *l)
+{
+ /* Mark PT_LOAD segments with PF_X in legacy code page bitmap. */
+ size_t i, phnum = l->l_phnum;
+ const ElfW(Phdr) *phdr = l->l_phdr;
+#ifdef __x86_64__
+ typedef unsigned long long word_t;
+#else
+ typedef unsigned long word_t;
+#endif
+ unsigned int bits_to_set;
+ word_t mask_to_set;
+#define BITS_PER_WORD (sizeof (word_t) * 8)
+#define BITMAP_FIRST_WORD_MASK(start) \
+ (~((word_t) 0) << ((start) & (BITS_PER_WORD - 1)))
+#define BITMAP_LAST_WORD_MASK(nbits) \
+ (~((word_t) 0) >> (-(nbits) & (BITS_PER_WORD - 1)))
+
+ word_t *bitmap = (word_t *) GL(dl_x86_legacy_bitmap)[0];
+ word_t bitmap_size = GL(dl_x86_legacy_bitmap)[1];
+ word_t *p;
+ size_t page_size = GLRO(dl_pagesize);
+
+ for (i = 0; i < phnum; i++)
+ if (phdr[i].p_type == PT_LOAD && (phdr[i].p_flags & PF_X))
+ {
+ /* One bit in legacy bitmap represents a page. */
+ ElfW(Addr) start = (phdr[i].p_vaddr + l->l_addr) / page_size;
+ ElfW(Addr) len = (phdr[i].p_memsz + page_size - 1) / page_size;
+ ElfW(Addr) end = start + len;
+
+ if ((end / 8) > bitmap_size)
+ return -EINVAL;
+
+ p = bitmap + (start / BITS_PER_WORD);
+ bits_to_set = BITS_PER_WORD - (start % BITS_PER_WORD);
+ mask_to_set = BITMAP_FIRST_WORD_MASK (start);
+
+ while (len >= bits_to_set)
+ {
+ *p |= mask_to_set;
+ len -= bits_to_set;
+ bits_to_set = BITS_PER_WORD;
+ mask_to_set = ~((word_t) 0);
+ p++;
+ }
+ if (len)
+ {
+ mask_to_set &= BITMAP_LAST_WORD_MASK (end);
+ *p |= mask_to_set;
+ }
+ }
+
+ return 0;
+}
+
+/* Check if object M is compatible with CET. */
+
+static void
+dl_cet_check (struct link_map *m, const char *program)
+{
+ /* Check how IBT should be enabled. */
+ unsigned int enable_ibt_type
+ = GL(dl_x86_feature_1)[1] & ((1 << CET_MAX) - 1);
+ /* Check how SHSTK should be enabled. */
+ unsigned int enable_shstk_type
+ = ((GL(dl_x86_feature_1)[1] >> CET_MAX) & ((1 << CET_MAX) - 1));
+
+ /* No legacy object check if both IBT and SHSTK are always on. */
+ if (enable_ibt_type == CET_ALWAYS_ON
+ && enable_shstk_type == CET_ALWAYS_ON)
+ return;
+
+ /* Check if IBT is enabled by kernel. */
+ bool ibt_enabled
+ = (GL(dl_x86_feature_1)[0] & GNU_PROPERTY_X86_FEATURE_1_IBT) != 0;
+ /* Check if SHSTK is enabled by kernel. */
+ bool shstk_enabled
+ = (GL(dl_x86_feature_1)[0] & GNU_PROPERTY_X86_FEATURE_1_SHSTK) != 0;
+
+ if (ibt_enabled || shstk_enabled)
+ {
+ struct link_map *l = NULL;
+
+ /* Check if IBT and SHSTK are enabled in object. */
+ bool enable_ibt = (ibt_enabled
+ && enable_ibt_type != CET_ALWAYS_OFF);
+ bool enable_shstk = (shstk_enabled
+ && enable_shstk_type != CET_ALWAYS_OFF);
+ if (program)
+ {
+ /* Enable IBT and SHSTK only if they are enabled in executable.
+ NB: IBT and SHSTK may be disabled by environment variable:
+
+ GLIBC_TUNABLES=glibc.tune.hwcaps=-IBT,-SHSTK
+ */
+ enable_ibt &= (HAS_CPU_FEATURE (IBT)
+ && (enable_ibt_type == CET_ALWAYS_ON
+ || (m->l_cet & lc_ibt) != 0));
+ enable_shstk &= (HAS_CPU_FEATURE (SHSTK)
+ && (enable_shstk_type == CET_ALWAYS_ON
+ || (m->l_cet & lc_shstk) != 0));
+ }
+
+ /* ld.so is CET-enabled by kernel. But shared objects may not
+ support IBT nor SHSTK. */
+ if (enable_ibt || enable_shstk)
+ {
+ int res;
+ unsigned int i;
+ unsigned int first_legacy, last_legacy;
+ bool need_legacy_bitmap = false;
+
+ i = m->l_searchlist.r_nlist;
+ while (i-- > 0)
+ {
+ /* Check each shared object to see if IBT and SHSTK are
+ enabled. */
+ l = m->l_initfini[i];
+
+ if (l->l_init_called)
+ continue;
+
+#ifdef SHARED
+ /* Skip CET check for ld.so since ld.so is CET-enabled.
+ CET will be disabled later if CET isn't enabled in
+ executable. */
+ if (l == &GL(dl_rtld_map)
+ || l->l_real == &GL(dl_rtld_map)
+ || (program && l == m))
+ continue;
+#endif
+
+ if (enable_ibt
+ && enable_ibt_type != CET_ALWAYS_ON
+ && !(l->l_cet & lc_ibt))
+ {
+ /* Remember the first and last legacy objects. */
+ if (!need_legacy_bitmap)
+ last_legacy = i;
+ first_legacy = i;
+ need_legacy_bitmap = true;
+ }
+
+ /* SHSTK is enabled only if it is enabled in executable as
+ well as all shared objects. */
+ enable_shstk &= (enable_shstk_type == CET_ALWAYS_ON
+ || (l->l_cet & lc_shstk) != 0);
+ }
+
+ if (need_legacy_bitmap)
+ {
+ if (GL(dl_x86_legacy_bitmap)[0])
+ {
+ /* Change legacy bitmap to writable. */
+ if (__mprotect ((void *) GL(dl_x86_legacy_bitmap)[0],
+ GL(dl_x86_legacy_bitmap)[1],
+ PROT_READ | PROT_WRITE) < 0)
+ {
+mprotect_failure:
+ if (program)
+ _dl_fatal_printf ("%s: mprotect legacy bitmap failed\n",
+ l->l_name);
+ else
+ _dl_signal_error (EINVAL, l->l_name, "dlopen",
+ N_("mprotect legacy bitmap failed"));
+ }
+ }
+ else
+ {
+ /* Allocate legacy bitmap. */
+ int res = dl_cet_allocate_legacy_bitmap
+ (GL(dl_x86_legacy_bitmap));
+ if (res != 0)
+ {
+ if (program)
+ _dl_fatal_printf ("%s: legacy bitmap isn't available\n",
+ l->l_name);
+ else
+ _dl_signal_error (EINVAL, l->l_name, "dlopen",
+ N_("legacy bitmap isn't available"));
+ }
+ }
+
+ /* Put legacy shared objects in legacy bitmap. */
+ for (i = first_legacy; i <= last_legacy; i++)
+ {
+ l = m->l_initfini[i];
+
+ if (l->l_init_called || (l->l_cet & lc_ibt))
+ continue;
+
+#ifdef SHARED
+ if (l == &GL(dl_rtld_map)
+ || l->l_real == &GL(dl_rtld_map)
+ || (program && l == m))
+ continue;
+#endif
+
+ /* If IBT is enabled in executable and IBT isn't enabled
+ in this shard object, mark PT_LOAD segments with PF_X
+ in legacy code page bitmap. */
+ res = dl_cet_mark_legacy_region (l);
+ if (res != 0)
+ {
+ if (program)
+ _dl_fatal_printf ("%s: failed to mark legacy code region\n",
+ l->l_name);
+ else
+ _dl_signal_error (-res, l->l_name, "dlopen",
+ N_("failed to mark legacy code region"));
+ }
+ }
+
+ /* Change legacy bitmap to read-only. */
+ if (__mprotect ((void *) GL(dl_x86_legacy_bitmap)[0],
+ GL(dl_x86_legacy_bitmap)[1], PROT_READ) < 0)
+ goto mprotect_failure;
+ }
+ }
+
+ bool cet_feature_changed = false;
+
+ if (enable_ibt != ibt_enabled || enable_shstk != shstk_enabled)
+ {
+ if (!program
+ && enable_shstk_type != CET_PERMISSIVE)
+ {
+ /* When SHSTK is enabled, we can't dlopening a shared
+ object without SHSTK. */
+ if (enable_shstk != shstk_enabled)
+ _dl_signal_error (EINVAL, l->l_name, "dlopen",
+ N_("shadow stack isn't enabled"));
+ return;
+ }
+
+ /* Disable IBT and/or SHSTK if they are enabled by kernel, but
+ disabled in executable or shared objects. */
+ unsigned int cet_feature = 0;
+
+ /* Disable IBT only during program startup. */
+ if (program && !enable_ibt)
+ cet_feature |= GNU_PROPERTY_X86_FEATURE_1_IBT;
+ if (!enable_shstk)
+ cet_feature |= GNU_PROPERTY_X86_FEATURE_1_SHSTK;
+
+ int res = dl_cet_disable_cet (cet_feature);
+ if (res != 0)
+ {
+ if (program)
+ _dl_fatal_printf ("%s: can't disable CET\n", program);
+ else
+ _dl_signal_error (-res, l->l_name, "dlopen",
+ N_("can't disable CET"));
+ }
+
+ /* Clear the disabled bits in dl_x86_feature_1. */
+ GL(dl_x86_feature_1)[0] &= ~cet_feature;
+
+ cet_feature_changed = true;
+ }
+
+#ifdef SHARED
+ if (program
+ && (!shstk_enabled
+ || enable_shstk_type != CET_PERMISSIVE)
+ && (ibt_enabled || shstk_enabled))
+ {
+ /* Lock CET if IBT or SHSTK is enabled in executable. Don't
+ lock CET if SHSTK is enabled permissively. */
+ int res = dl_cet_lock_cet ();
+ if (res != 0)
+ _dl_fatal_printf ("%s: can't lock CET\n", program);
+
+ cet_feature_changed = true;
+ }
+#endif
+
+ if (cet_feature_changed)
+ {
+ unsigned int feature_1 = 0;
+ if (enable_ibt)
+ feature_1 |= GNU_PROPERTY_X86_FEATURE_1_IBT;
+ if (enable_shstk)
+ feature_1 |= GNU_PROPERTY_X86_FEATURE_1_SHSTK;
+ struct pthread *self = THREAD_SELF;
+ THREAD_SETMEM (self, header.feature_1, feature_1);
+ }
+ }
+}
+
+void
+_dl_cet_open_check (struct link_map *l)
+{
+ dl_cet_check (l, NULL);
+}
+
+#ifdef SHARED
+
+# ifndef LINKAGE
+# define LINKAGE
+# endif
+
+LINKAGE
+void
+_dl_cet_check (struct link_map *main_map, const char *program)
+{
+ dl_cet_check (main_map, program);
+}
+#endif /* SHARED */
diff --git a/sysdeps/x86/dl-get-cpu-features.c b/sysdeps/x86/dl-get-cpu-features.c
index 839c2a4bba..49593f19c6 100644
--- a/sysdeps/x86/dl-get-cpu-features.c
+++ b/sysdeps/x86/dl-get-cpu-features.c
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/sysdeps/x86/dl-hwcap.h b/sysdeps/x86/dl-hwcap.h
new file mode 100644
index 0000000000..f5e9d542ca
--- /dev/null
+++ b/sysdeps/x86/dl-hwcap.h
@@ -0,0 +1,77 @@
+/* x86 version of hardware capability information handling macros.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 _DL_HWCAP_H
+#define _DL_HWCAP_H
+
+#if IS_IN (ldconfig)
+/* Since ldconfig processes both i386 and x86-64 libraries, it needs
+ to cover all platforms and hardware capabilities. */
+# define HWCAP_PLATFORMS_START 0
+# define HWCAP_PLATFORMS_COUNT 4
+# define HWCAP_START 0
+# define HWCAP_COUNT 3
+# define HWCAP_IMPORTANT \
+ (HWCAP_X86_SSE2 | HWCAP_X86_64 | HWCAP_X86_AVX512_1)
+#elif defined __x86_64__
+/* For 64 bit, only cover x86-64 platforms and capabilities. */
+# define HWCAP_PLATFORMS_START 2
+# define HWCAP_PLATFORMS_COUNT 4
+# define HWCAP_START 1
+# define HWCAP_COUNT 3
+# define HWCAP_IMPORTANT (HWCAP_X86_64 | HWCAP_X86_AVX512_1)
+#else
+/* For 32 bit, only cover i586, i686 and SSE2. */
+# define HWCAP_PLATFORMS_START 0
+# define HWCAP_PLATFORMS_COUNT 2
+# define HWCAP_START 0
+# define HWCAP_COUNT 1
+# define HWCAP_IMPORTANT (HWCAP_X86_SSE2)
+#endif
+
+enum
+{
+ HWCAP_X86_SSE2 = 1 << 0,
+ HWCAP_X86_64 = 1 << 1,
+ HWCAP_X86_AVX512_1 = 1 << 2
+};
+
+static inline const char *
+__attribute__ ((unused))
+_dl_hwcap_string (int idx)
+{
+ return GLRO(dl_x86_hwcap_flags)[idx];
+};
+
+static inline int
+__attribute__ ((unused, always_inline))
+_dl_string_hwcap (const char *str)
+{
+ int i;
+
+ for (i = HWCAP_START; i < HWCAP_COUNT; i++)
+ {
+ if (strcmp (str, GLRO(dl_x86_hwcap_flags)[i]) == 0)
+ return i;
+ }
+ return -1;
+};
+
+/* We cannot provide a general printing function. */
+#define _dl_procinfo(type, word) -1
+
+#endif /* dl-hwcap.h */
diff --git a/sysdeps/x86/dl-procinfo.c b/sysdeps/x86/dl-procinfo.c
new file mode 100644
index 0000000000..4b0538ede8
--- /dev/null
+++ b/sysdeps/x86/dl-procinfo.c
@@ -0,0 +1,88 @@
+/* Data for x86 version of processor capability information.
+ Copyright (C) 2017-2018 Free Software 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 information must be kept in sync with the _DL_HWCAP_COUNT,
+ HWCAP_PLATFORMS_START and HWCAP_PLATFORMS_COUNT definitions in
+ dl-hwcap.h.
+
+ If anything should be added here check whether the size of each string
+ is still ok with the given array size.
+
+ All the #ifdefs in the definitions are quite irritating but
+ necessary if we want to avoid duplicating the information. There
+ are three different modes:
+
+ - PROCINFO_DECL is defined. This means we are only interested in
+ declarations.
+
+ - PROCINFO_DECL is not defined:
+
+ + if SHARED is defined the file is included in an array
+ initializer. The .element = { ... } syntax is needed.
+
+ + if SHARED is not defined a normal array initialization is
+ needed.
+ */
+
+#if !IS_IN (ldconfig)
+# if !defined PROCINFO_DECL && defined SHARED
+ ._dl_x86_cpu_features
+# else
+PROCINFO_CLASS struct cpu_features _dl_x86_cpu_features
+# endif
+# ifndef PROCINFO_DECL
+= { }
+# endif
+# if !defined SHARED || defined PROCINFO_DECL
+;
+# else
+,
+# endif
+#endif
+
+#if !defined PROCINFO_DECL && defined SHARED
+ ._dl_x86_hwcap_flags
+#else
+PROCINFO_CLASS const char _dl_x86_hwcap_flags[3][9]
+#endif
+#ifndef PROCINFO_DECL
+= {
+ "sse2", "x86_64", "avx512_1"
+ }
+#endif
+#if !defined SHARED || defined PROCINFO_DECL
+;
+#else
+,
+#endif
+
+#if !defined PROCINFO_DECL && defined SHARED
+ ._dl_x86_platforms
+#else
+PROCINFO_CLASS const char _dl_x86_platforms[4][9]
+#endif
+#ifndef PROCINFO_DECL
+= {
+ "i586", "i686", "haswell", "xeon_phi"
+ }
+#endif
+#if !defined SHARED || defined PROCINFO_DECL
+;
+#else
+,
+#endif
diff --git a/sysdeps/x86/dl-procinfo.h b/sysdeps/x86/dl-procinfo.h
new file mode 100644
index 0000000000..55cafc26e2
--- /dev/null
+++ b/sysdeps/x86/dl-procinfo.h
@@ -0,0 +1,48 @@
+/* x86 version of processor capability information handling macros.
+ Copyright (C) 2017-2018 Free Software 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 _DL_PROCINFO_H
+#define _DL_PROCINFO_H 1
+#include <ldsodefs.h>
+#include <dl-hwcap.h>
+
+#define _DL_HWCAP_COUNT HWCAP_COUNT
+#define _DL_PLATFORMS_COUNT HWCAP_PLATFORMS_COUNT
+
+/* Start at 48 to reserve spaces for hardware capabilities. */
+#define _DL_FIRST_PLATFORM 48
+/* Mask to filter out platforms. */
+#define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \
+ << _DL_FIRST_PLATFORM)
+
+static inline int
+__attribute__ ((unused, always_inline))
+_dl_string_platform (const char *str)
+{
+ int i;
+
+ if (str != NULL)
+ for (i = HWCAP_PLATFORMS_START; i < HWCAP_PLATFORMS_COUNT; ++i)
+ {
+ if (strcmp (str, GLRO(dl_x86_platforms)[i]) == 0)
+ return _DL_FIRST_PLATFORM + i;
+ }
+ return -1;
+};
+
+#endif /* dl-procinfo.h */
diff --git a/sysdeps/x86/dl-procruntime.c b/sysdeps/x86/dl-procruntime.c
new file mode 100644
index 0000000000..eddbde6a31
--- /dev/null
+++ b/sysdeps/x86/dl-procruntime.c
@@ -0,0 +1,68 @@
+/* Data for processor runtime information. x86 version.
+ Copyright (C) 2018 Free Software 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 information must be kept in sync with the _DL_HWCAP_COUNT,
+ HWCAP_PLATFORMS_START and HWCAP_PLATFORMS_COUNT definitions in
+ dl-hwcap.h.
+
+ If anything should be added here check whether the size of each string
+ is still ok with the given array size.
+
+ All the #ifdefs in the definitions are quite irritating but
+ necessary if we want to avoid duplicating the information. There
+ are three different modes:
+
+ - PROCINFO_DECL is defined. This means we are only interested in
+ declarations.
+
+ - PROCINFO_DECL is not defined:
+
+ + if SHARED is defined the file is included in an array
+ initializer. The .element = { ... } syntax is needed.
+
+ + if SHARED is not defined a normal array initialization is
+ needed.
+ */
+
+#ifndef PROCINFO_CLASS
+# define PROCINFO_CLASS
+#endif
+
+#if !IS_IN (ldconfig)
+# if !defined PROCINFO_DECL && defined SHARED
+ ._dl_x86_feature_1
+# else
+PROCINFO_CLASS unsigned int _dl_x86_feature_1[2]
+# endif
+# if !defined SHARED || defined PROCINFO_DECL
+;
+# else
+,
+# endif
+
+# if !defined PROCINFO_DECL && defined SHARED
+ ._dl_x86_legacy_bitmap
+# else
+PROCINFO_CLASS unsigned long _dl_x86_legacy_bitmap[2]
+# endif
+# if !defined SHARED || defined PROCINFO_DECL
+;
+# else
+,
+# endif
+#endif
diff --git a/sysdeps/x86/dl-prop.h b/sysdeps/x86/dl-prop.h
new file mode 100644
index 0000000000..26c3131ac5
--- /dev/null
+++ b/sysdeps/x86/dl-prop.h
@@ -0,0 +1,164 @@
+/* Support for GNU properties. x86 version.
+ Copyright (C) 2018 Free Software 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 _DL_PROP_H
+#define _DL_PROP_H
+
+#include <not-cancel.h>
+
+extern void _dl_cet_check (struct link_map *, const char *)
+ attribute_hidden;
+extern void _dl_cet_open_check (struct link_map *)
+ attribute_hidden;
+
+static inline void __attribute__ ((always_inline))
+_rtld_main_check (struct link_map *m, const char *program)
+{
+#if CET_ENABLED
+ _dl_cet_check (m, program);
+#endif
+}
+
+static inline void __attribute__ ((always_inline))
+_dl_open_check (struct link_map *m)
+{
+#if CET_ENABLED
+ _dl_cet_open_check (m);
+#endif
+}
+
+static inline void __attribute__ ((unused))
+_dl_process_cet_property_note (struct link_map *l,
+ const ElfW(Nhdr) *note,
+ const ElfW(Addr) size,
+ const ElfW(Addr) align)
+{
+#if CET_ENABLED
+ /* The NT_GNU_PROPERTY_TYPE_0 note must be aliged to 4 bytes in
+ 32-bit objects and to 8 bytes in 64-bit objects. Skip notes
+ with incorrect alignment. */
+ if (align != (__ELF_NATIVE_CLASS / 8))
+ return;
+
+ const ElfW(Addr) start = (ElfW(Addr)) note;
+
+ while ((ElfW(Addr)) (note + 1) - start < size)
+ {
+ /* Find the NT_GNU_PROPERTY_TYPE_0 note. */
+ if (note->n_namesz == 4
+ && note->n_type == NT_GNU_PROPERTY_TYPE_0
+ && memcmp (note + 1, "GNU", 4) == 0)
+ {
+ /* Check for invalid property. */
+ if (note->n_descsz < 8
+ || (note->n_descsz % sizeof (ElfW(Addr))) != 0)
+ break;
+
+ /* Start and end of property array. */
+ unsigned char *ptr = (unsigned char *) (note + 1) + 4;
+ unsigned char *ptr_end = ptr + note->n_descsz;
+
+ do
+ {
+ unsigned int type = *(unsigned int *) ptr;
+ unsigned int datasz = *(unsigned int *) (ptr + 4);
+
+ ptr += 8;
+ if ((ptr + datasz) > ptr_end)
+ break;
+
+ if (type == GNU_PROPERTY_X86_FEATURE_1_AND)
+ {
+ /* The size of GNU_PROPERTY_X86_FEATURE_1_AND is 4
+ bytes. When seeing GNU_PROPERTY_X86_FEATURE_1_AND,
+ we stop the search regardless if its size is correct
+ or not. There is no point to continue if this note
+ is ill-formed. */
+ if (datasz == 4)
+ {
+ unsigned int feature_1 = *(unsigned int *) ptr;
+ if ((feature_1 & GNU_PROPERTY_X86_FEATURE_1_IBT))
+ l->l_cet |= lc_ibt;
+ if ((feature_1 & GNU_PROPERTY_X86_FEATURE_1_SHSTK))
+ l->l_cet |= lc_shstk;
+ }
+ return;
+ }
+
+ /* Check the next property item. */
+ ptr += ALIGN_UP (datasz, sizeof (ElfW(Addr)));
+ }
+ while ((ptr_end - ptr) >= 8);
+ }
+
+ /* NB: Note sections like .note.ABI-tag and .note.gnu.build-id are
+ aligned to 4 bytes in 64-bit ELF objects. */
+ note = ((const void *) note
+ + ELF_NOTE_NEXT_OFFSET (note->n_namesz, note->n_descsz,
+ align));
+ }
+#endif
+}
+
+#ifdef FILEBUF_SIZE
+static inline int __attribute__ ((unused))
+_dl_process_pt_note (struct link_map *l, const ElfW(Phdr) *ph,
+ int fd, struct filebuf *fbp)
+{
+# if CET_ENABLED
+ const ElfW(Nhdr) *note;
+ ElfW(Nhdr) *note_malloced = NULL;
+ ElfW(Addr) size = ph->p_filesz;
+
+ if (ph->p_offset + size <= (size_t) fbp->len)
+ note = (const void *) (fbp->buf + ph->p_offset);
+ else
+ {
+ if (size < __MAX_ALLOCA_CUTOFF)
+ note = alloca (size);
+ else
+ {
+ note_malloced = malloc (size);
+ note = note_malloced;
+ }
+ __lseek (fd, ph->p_offset, SEEK_SET);
+ if (__read_nocancel (fd, (void *) note, size) != size)
+ {
+ if (note_malloced)
+ free (note_malloced);
+ return -1;
+ }
+ }
+
+ _dl_process_cet_property_note (l, note, size, ph->p_align);
+ if (note_malloced)
+ free (note_malloced);
+# endif
+ return 0;
+}
+#endif
+
+static inline int __attribute__ ((unused))
+_rtld_process_pt_note (struct link_map *l, const ElfW(Phdr) *ph)
+{
+ const ElfW(Nhdr) *note = (const void *) (ph->p_vaddr + l->l_addr);
+ _dl_process_cet_property_note (l, note, ph->p_memsz, ph->p_align);
+ return 0;
+}
+
+#endif /* _DL_PROP_H */
diff --git a/sysdeps/x86/dl-tunables.list b/sysdeps/x86/dl-tunables.list
new file mode 100644
index 0000000000..73886b1352
--- /dev/null
+++ b/sysdeps/x86/dl-tunables.list
@@ -0,0 +1,40 @@
+# x86 specific tunables.
+# Copyright (C) 2017-2018 Free Software 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/>.
+
+glibc {
+ tune {
+ hwcaps {
+ type: STRING
+ }
+ x86_ibt {
+ type: STRING
+ }
+ x86_shstk {
+ type: STRING
+ }
+ x86_non_temporal_threshold {
+ type: SIZE_T
+ }
+ x86_data_cache_size {
+ type: SIZE_T
+ }
+ x86_shared_cache_size {
+ type: SIZE_T
+ }
+ }
+}
diff --git a/sysdeps/x86/elide.h b/sysdeps/x86/elide.h
index 8691e6673d..8d5589902f 100644
--- a/sysdeps/x86/elide.h
+++ b/sysdeps/x86/elide.h
@@ -1,5 +1,5 @@
/* elide.h: Generic lock elision support.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,8 +20,8 @@
#include <hle.h>
#include <elision-conf.h>
+#include <atomic.h>
-#define ACCESS_ONCE(x) (* (volatile typeof(x) *) &(x))
/* Adapt elision with ADAPT_COUNT and STATUS and decide retries. */
@@ -35,28 +35,35 @@ elision_adapt(signed char *adapt_count, unsigned int status)
{
/* Right now we skip here. Better would be to wait a bit
and retry. This likely needs some spinning. Be careful
- to avoid writing the lock. */
- if (*adapt_count != __elision_aconf.skip_lock_busy)
- ACCESS_ONCE (*adapt_count) = __elision_aconf.skip_lock_busy;
+ to avoid writing the lock.
+ Using relaxed MO and separate atomic accesses is sufficient because
+ adapt_count is just a hint. */
+ if (atomic_load_relaxed (adapt_count) != __elision_aconf.skip_lock_busy)
+ atomic_store_relaxed (adapt_count, __elision_aconf.skip_lock_busy);
}
/* Internal abort. There is no chance for retry.
Use the normal locking and next time use lock.
- Be careful to avoid writing to the lock. */
- else if (*adapt_count != __elision_aconf.skip_lock_internal_abort)
- ACCESS_ONCE (*adapt_count) = __elision_aconf.skip_lock_internal_abort;
+ Be careful to avoid writing to the lock. See above for MO. */
+ else if (atomic_load_relaxed (adapt_count)
+ != __elision_aconf.skip_lock_internal_abort)
+ atomic_store_relaxed (adapt_count,
+ __elision_aconf.skip_lock_internal_abort);
return true;
}
/* is_lock_free must be executed inside the transaction */
/* Returns true if lock defined by IS_LOCK_FREE was elided.
- ADAPT_COUNT is a pointer to per-lock state variable. */
+ ADAPT_COUNT is a per-lock state variable; it must be accessed atomically
+ to avoid data races but is just a hint, so using relaxed MO and separate
+ atomic loads and stores instead of atomic read-modify-write operations is
+ sufficient. */
#define ELIDE_LOCK(adapt_count, is_lock_free) \
({ \
int ret = 0; \
\
- if ((adapt_count) <= 0) \
+ if (atomic_load_relaxed (&(adapt_count)) <= 0) \
{ \
for (int i = __elision_aconf.retry_try_xbegin; i > 0; i--) \
{ \
@@ -75,12 +82,13 @@ elision_adapt(signed char *adapt_count, unsigned int status)
} \
} \
else \
- (adapt_count)--; /* missing updates ok */ \
+ atomic_store_relaxed (&(adapt_count), \
+ atomic_load_relaxed (&(adapt_count)) - 1); \
ret; \
})
/* Returns true if lock defined by IS_LOCK_FREE was try-elided.
- ADAPT_COUNT is a pointer to per-lock state variable. */
+ ADAPT_COUNT is a per-lock state variable. */
#define ELIDE_TRYLOCK(adapt_count, is_lock_free, write) ({ \
int ret = 0; \
diff --git a/sysdeps/x86/float128-abi.h b/sysdeps/x86/float128-abi.h
new file mode 100644
index 0000000000..6b954cc673
--- /dev/null
+++ b/sysdeps/x86/float128-abi.h
@@ -0,0 +1,2 @@
+/* ABI version for _Float128 ABI introduction. */
+#define FLOAT128_VERSION GLIBC_2.26
diff --git a/sysdeps/x86/fpu/Makefile b/sysdeps/x86/fpu/Makefile
index b561995658..600e42c3db 100644
--- a/sysdeps/x86/fpu/Makefile
+++ b/sysdeps/x86/fpu/Makefile
@@ -1,7 +1,14 @@
ifeq ($(subdir),math)
+# sqrtf128 requires soft-fp.
+CPPFLAGS += -I../soft-fp
+
libm-support += powl_helper
-tests += test-fenv-sse test-fenv-clear-sse test-fenv-x87 test-fenv-sse-2
+tests += test-fenv-sse test-fenv-clear-sse test-fenv-x87 test-fenv-sse-2 \
+ test-flt-eval-method-387 test-flt-eval-method-sse
CFLAGS-test-fenv-sse.c += -msse2 -mfpmath=sse
CFLAGS-test-fenv-clear-sse.c += -msse2 -mfpmath=sse
CFLAGS-test-fenv-sse-2.c += -msse2 -mfpmath=sse
+CFLAGS-test-flt-eval-method-387.c += -fexcess-precision=standard -mfpmath=387
+CFLAGS-test-flt-eval-method-sse.c += -fexcess-precision=standard -msse2 \
+ -mfpmath=sse
endif
diff --git a/sysdeps/x86/fpu/bits/fenv.h b/sysdeps/x86/fpu/bits/fenv.h
index 8c8503bd7e..4103982d8c 100644
--- a/sysdeps/x86/fpu/bits/fenv.h
+++ b/sysdeps/x86/fpu/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -101,12 +101,28 @@ 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
/* Optimized versions. */
+#ifndef _LIBC
extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept);
+#endif
__extern_always_inline void
__NTH (__feraiseexcept_invalid_divbyzero (int __excepts))
{
diff --git a/sysdeps/x86/fpu/bits/math-vector.h b/sysdeps/x86/fpu/bits/math-vector.h
index ca43cf4b9e..3d229d8705 100644
--- a/sysdeps/x86/fpu/bits/math-vector.h
+++ b/sysdeps/x86/fpu/bits/math-vector.h
@@ -1,5 +1,5 @@
/* Platform-specific SIMD declarations of math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86/fpu/bits/mathinline.h b/sysdeps/x86/fpu/bits/mathinline.h
index 0ff1aa4cec..91ece8dfb8 100644
--- a/sysdeps/x86/fpu/bits/mathinline.h
+++ b/sysdeps/x86/fpu/bits/mathinline.h
@@ -1,5 +1,5 @@
/* Inline math functions for i387 and SSE.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,364 +26,6 @@
# define __MATH_INLINE __extern_always_inline
#endif
-
-#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
-/* GCC 2.97 and up have builtins that actually can be used. */
-# if !__GNUC_PREREQ (2,97)
-/* ISO C99 defines some macros to perform unordered comparisons. The
- ix87 FPU supports this with special opcodes and we should use them.
- These must not be inline functions since we have to be able to handle
- all floating-point types. */
-# undef isgreater
-# undef isgreaterequal
-# undef isless
-# undef islessequal
-# undef islessgreater
-# undef isunordered
-# ifdef __i686__
-/* For the PentiumPro and more recent processors we can provide
- better code. */
-# define isgreater(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; seta %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
- __result; })
-# define isgreaterequal(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; setae %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
- __result; })
-
-# define isless(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; seta %%al" \
- : "=a" (__result) : "u" (x), "t" (y) : "cc", "st"); \
- __result; })
-
-# define islessequal(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; setae %%al" \
- : "=a" (__result) : "u" (x), "t" (y) : "cc", "st"); \
- __result; })
-
-# define islessgreater(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; setne %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
- __result; })
-
-# define isunordered(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; setp %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
- __result; })
-# else
-/* This is the dumb, portable code for i386 and above. */
-# define isgreater(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
- __result; })
-
-# define isgreaterequal(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
- __result; })
-
-# define isless(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \
- : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
- __result; })
-
-# define islessequal(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \
- : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
- __result; })
-
-# define islessgreater(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
- __result; })
-
-# define isunordered(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; sahf; setp %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
- __result; })
-# endif /* __i686__ */
-# endif /* GCC 2.97 */
-
-/* The gcc, version 2.7 or below, has problems with all this inlining
- code. So disable it for this version of the compiler. */
-# if __GNUC_PREREQ (2, 8)
-__BEGIN_NAMESPACE_C99
-
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-# ifdef __SSE2_MATH__
- int __m;
- __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
- return (__m & 0x8) != 0;
-# else
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
-# endif
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-# ifdef __SSE2_MATH__
- int __m;
- __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
- return (__m & 0x80) != 0;
-# else
- __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
- return __u.__i[1] < 0;
-# endif
-}
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
- return (__u.__i[2] & 0x8000) != 0;
-}
-
-__END_NAMESPACE_C99
-# endif
-#endif
-
-
-/* The gcc, version 2.7 or below, has problems with all this inlining
- code. So disable it for this version of the compiler. */
-#if __GNUC_PREREQ (2, 8)
-# if !__GNUC_PREREQ (3, 4) && !defined __NO_MATH_INLINES \
- && defined __OPTIMIZE__
-/* GCC 3.4 introduced builtins for all functions below, so
- there's no need to define any of these inline functions. */
-
-# ifdef __USE_ISOC99
-__BEGIN_NAMESPACE_C99
-
-/* Round to nearest integer. */
-# ifdef __SSE_MATH__
-__MATH_INLINE long int
-__NTH (lrintf (float __x))
-{
- long int __res;
- /* Mark as volatile since the result is dependent on the state of
- the SSE control register (the rounding mode). Otherwise GCC might
- remove these assembler instructions since it does not know about
- the rounding mode change and cannot currently be told. */
- __asm __volatile__ ("cvtss2si %1, %0" : "=r" (__res) : "xm" (__x));
- return __res;
-}
-# endif
-# ifdef __SSE2_MATH__
-__MATH_INLINE long int
-__NTH (lrint (double __x))
-{
- long int __res;
- /* Mark as volatile since the result is dependent on the state of
- the SSE control register (the rounding mode). Otherwise GCC might
- remove these assembler instructions since it does not know about
- the rounding mode change and cannot currently be told. */
- __asm __volatile__ ("cvtsd2si %1, %0" : "=r" (__res) : "xm" (__x));
- return __res;
-}
-# endif
-# ifdef __x86_64__
-__extension__
-__MATH_INLINE long long int
-__NTH (llrintf (float __x))
-{
- long long int __res;
- /* Mark as volatile since the result is dependent on the state of
- the SSE control register (the rounding mode). Otherwise GCC might
- remove these assembler instructions since it does not know about
- the rounding mode change and cannot currently be told. */
- __asm __volatile__ ("cvtss2si %1, %0" : "=r" (__res) : "xm" (__x));
- return __res;
-}
-__extension__
-__MATH_INLINE long long int
-__NTH (llrint (double __x))
-{
- long long int __res;
- /* Mark as volatile since the result is dependent on the state of
- the SSE control register (the rounding mode). Otherwise GCC might
- remove these assembler instructions since it does not know about
- the rounding mode change and cannot currently be told. */
- __asm __volatile__ ("cvtsd2si %1, %0" : "=r" (__res) : "xm" (__x));
- return __res;
-}
-# endif
-
-# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 \
- && defined __SSE2_MATH__
-/* Determine maximum of two values. */
-__MATH_INLINE float
-__NTH (fmaxf (float __x, float __y))
-{
-# ifdef __AVX__
- float __res;
- __asm ("vmaxss %2, %1, %0" : "=x" (__res) : "x" (x), "xm" (__y));
- return __res;
-# else
- __asm ("maxss %1, %0" : "+x" (__x) : "xm" (__y));
- return __x;
-# endif
-}
-__MATH_INLINE double
-__NTH (fmax (double __x, double __y))
-{
-# ifdef __AVX__
- float __res;
- __asm ("vmaxsd %2, %1, %0" : "=x" (__res) : "x" (x), "xm" (__y));
- return __res;
-# else
- __asm ("maxsd %1, %0" : "+x" (__x) : "xm" (__y));
- return __x;
-# endif
-}
-
-/* Determine minimum of two values. */
-__MATH_INLINE float
-__NTH (fminf (float __x, float __y))
-{
-# ifdef __AVX__
- float __res;
- __asm ("vminss %2, %1, %0" : "=x" (__res) : "x" (x), "xm" (__y));
- return __res;
-# else
- __asm ("minss %1, %0" : "+x" (__x) : "xm" (__y));
- return __x;
-# endif
-}
-__MATH_INLINE double
-__NTH (fmin (double __x, double __y))
-{
-# ifdef __AVX__
- float __res;
- __asm ("vminsd %2, %1, %0" : "=x" (__res) : "x" (x), "xm" (__y));
- return __res;
-# else
- __asm ("minsd %1, %0" : "+x" (__x) : "xm" (__y));
- return __x;
-# endif
-}
-# endif
-
-__END_NAMESPACE_C99
-# endif
-
-# if defined __SSE4_1__ && defined __SSE2_MATH__
-# if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
-__BEGIN_NAMESPACE_C99
-
-/* Round to nearest integer. */
-__MATH_INLINE double
-__NTH (rint (double __x))
-{
- double __res;
- /* Mark as volatile since the result is dependent on the state of
- the SSE control register (the rounding mode). Otherwise GCC might
- remove these assembler instructions since it does not know about
- the rounding mode change and cannot currently be told. */
- __asm __volatile__ ("roundsd $4, %1, %0" : "=x" (__res) : "xm" (__x));
- return __res;
-}
-__MATH_INLINE float
-__NTH (rintf (float __x))
-{
- float __res;
- /* Mark as volatile since the result is dependent on the state of
- the SSE control register (the rounding mode). Otherwise GCC might
- remove these assembler instructions since it does not know about
- the rounding mode change and cannot currently be told. */
- __asm __volatile__ ("roundss $4, %1, %0" : "=x" (__res) : "xm" (__x));
- return __res;
-}
-
-# ifdef __USE_ISOC99
-/* Round to nearest integer without raising inexact exception. */
-__MATH_INLINE double
-__NTH (nearbyint (double __x))
-{
- double __res;
- /* Mark as volatile since the result is dependent on the state of
- the SSE control register (the rounding mode). Otherwise GCC might
- remove these assembler instructions since it does not know about
- the rounding mode change and cannot currently be told. */
- __asm __volatile__ ("roundsd $0xc, %1, %0" : "=x" (__res) : "xm" (__x));
- return __res;
-}
-__MATH_INLINE float
-__NTH (nearbyintf (float __x))
-{
- float __res;
- /* Mark as volatile since the result is dependent on the state of
- the SSE control register (the rounding mode). Otherwise GCC might
- remove these assembler instructions since it does not know about
- the rounding mode change and cannot currently be told. */
- __asm __volatile__ ("roundss $0xc, %1, %0" : "=x" (__res) : "xm" (__x));
- return __res;
-}
-# endif
-
-__END_NAMESPACE_C99
-# endif
-
-__BEGIN_NAMESPACE_STD
-/* Smallest integral value not less than X. */
-__MATH_INLINE double
-__NTH (ceil (double __x))
-{
- double __res;
- __asm ("roundsd $2, %1, %0" : "=x" (__res) : "xm" (__x));
- return __res;
-}
-__END_NAMESPACE_STD
-
-__BEGIN_NAMESPACE_C99
-__MATH_INLINE float
-__NTH (ceilf (float __x))
-{
- float __res;
- __asm ("roundss $2, %1, %0" : "=x" (__res) : "xm" (__x));
- return __res;
-}
-__END_NAMESPACE_C99
-
-__BEGIN_NAMESPACE_STD
-/* Largest integer not greater than X. */
-__MATH_INLINE double
-__NTH (floor (double __x))
-{
- double __res;
- __asm ("roundsd $1, %1, %0" : "=x" (__res) : "xm" (__x));
- return __res;
-}
-__END_NAMESPACE_STD
-
-__BEGIN_NAMESPACE_C99
-__MATH_INLINE float
-__NTH (floorf (float __x))
-{
- float __res;
- __asm ("roundss $1, %1, %0" : "=x" (__res) : "xm" (__x));
- return __res;
-}
-__END_NAMESPACE_C99
-# endif
-# endif
-#endif
-
/* Disable x87 inlines when -fpmath=sse is passed and also when we're building
on x86_64. Older gcc (gcc-3.2 for example) does not define __SSE2_MATH__
for x86_64. */
@@ -532,50 +174,6 @@ __END_NAMESPACE_C99
/* __FAST_MATH__ is defined by gcc -ffast-math. */
# ifdef __FAST_MATH__
-# ifdef __USE_GNU
-# define __sincos_code \
- register long double __cosr; \
- register long double __sinr; \
- register unsigned int __swtmp; \
- __asm __volatile__ \
- ("fsincos\n\t" \
- "fnstsw %w2\n\t" \
- "testl $0x400, %2\n\t" \
- "jz 1f\n\t" \
- "fldpi\n\t" \
- "fadd %%st(0)\n\t" \
- "fxch %%st(1)\n\t" \
- "2: fprem1\n\t" \
- "fnstsw %w2\n\t" \
- "testl $0x400, %2\n\t" \
- "jnz 2b\n\t" \
- "fstp %%st(1)\n\t" \
- "fsincos\n\t" \
- "1:" \
- : "=t" (__cosr), "=u" (__sinr), "=a" (__swtmp) : "0" (__x)); \
- *__sinx = __sinr; \
- *__cosx = __cosr
-
-__MATH_INLINE void
-__NTH (__sincos (double __x, double *__sinx, double *__cosx))
-{
- __sincos_code;
-}
-
-__MATH_INLINE void
-__NTH (__sincosf (float __x, float *__sinx, float *__cosx))
-{
- __sincos_code;
-}
-
-__MATH_INLINE void
-__NTH (__sincosl (long double __x, long double *__sinx, long double *__cosx))
-{
- __sincos_code;
-}
-# endif
-
-
/* Optimized inline implementation, sometimes with reduced precision
and/or argument range. */
@@ -631,50 +229,9 @@ __inline_mathcodeNP_ (long double, __expl, __x, return __builtin_expl (__x))
__inline_mathcodeNP (exp, __x, __exp_code)
__inline_mathcodeNP_ (long double, __expl, __x, __exp_code)
# endif
-
-
-# if !__GNUC_PREREQ (3, 5)
-__inline_mathcodeNP (tan, __x, \
- register long double __value; \
- register long double __value2 __attribute__ ((__unused__)); \
- __asm __volatile__ \
- ("fptan" \
- : "=t" (__value2), "=u" (__value) : "0" (__x)); \
- return __value)
-# endif
# endif /* __FAST_MATH__ */
-# if __GNUC_PREREQ (3, 4)
-__inline_mathcodeNP2_ (long double, __atan2l, __y, __x,
- return __builtin_atan2l (__y, __x))
-# else
-# define __atan2_code \
- register long double __value; \
- __asm __volatile__ \
- ("fpatan" \
- : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); \
- return __value
-# ifdef __FAST_MATH__
-__inline_mathcodeNP2 (atan2, __y, __x, __atan2_code)
-# endif
-__inline_mathcodeNP2_ (long double, __atan2l, __y, __x, __atan2_code)
-# endif
-
-
-# if defined __FAST_MATH__ && !__GNUC_PREREQ (3, 5)
-__inline_mathcodeNP2 (fmod, __x, __y, \
- register long double __value; \
- __asm __volatile__ \
- ("1: fprem\n\t" \
- "fnstsw %%ax\n\t" \
- "sahf\n\t" \
- "jp 1b" \
- : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); \
- return __value)
-# endif
-
-
# ifdef __FAST_MATH__
# if !__GNUC_PREREQ (3,3)
__inline_mathopNP (sqrt, "fsqrt")
@@ -697,28 +254,6 @@ __inline_mathop (fabs, "fabs")
__inline_mathop_ (long double, __fabsl, "fabs")
# endif
-# ifdef __FAST_MATH__
-# if !__GNUC_PREREQ (3, 4)
-/* The argument range of this inline version is reduced. */
-__inline_mathopNP (sin, "fsin")
-/* The argument range of this inline version is reduced. */
-__inline_mathopNP (cos, "fcos")
-
-__inline_mathop_declNP (log, "fldln2; fxch; fyl2x", "0" (__x) : "st(1)")
-# endif
-
-# if !__GNUC_PREREQ (3, 5)
-__inline_mathop_declNP (log10, "fldlg2; fxch; fyl2x", "0" (__x) : "st(1)")
-
-__inline_mathcodeNP (asin, __x, return __atan2l (__x, __libc_sqrtl (1.0 - __x * __x)))
-__inline_mathcodeNP (acos, __x, return __atan2l (__libc_sqrtl (1.0 - __x * __x), __x))
-# endif
-
-# if !__GNUC_PREREQ (3, 4)
-__inline_mathop_declNP (atan, "fld1; fpatan", "0" (__x) : "st(1)")
-# endif
-# endif /* __FAST_MATH__ */
-
__inline_mathcode_ (long double, __sgn1l, __x, \
__extension__ union { long double __xld; unsigned int __xi[3]; } __n = \
{ __xld: __x }; \
@@ -743,57 +278,6 @@ __inline_mathcodeNP (tanh, __x, \
return __exm1 / (__exm1 + 2.0) * __sgn1l (-__x))
# endif
-__inline_mathcodeNP (floor, __x, \
- register long double __value; \
- register int __ignore; \
- unsigned short int __cw; \
- unsigned short int __cwtmp; \
- __asm __volatile ("fnstcw %3\n\t" \
- "movzwl %3, %1\n\t" \
- "andl $0xf3ff, %1\n\t" \
- "orl $0x0400, %1\n\t" /* rounding down */ \
- "movw %w1, %2\n\t" \
- "fldcw %2\n\t" \
- "frndint\n\t" \
- "fldcw %3" \
- : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), \
- "=m" (__cw) \
- : "0" (__x)); \
- return __value)
-
-__inline_mathcodeNP (ceil, __x, \
- register long double __value; \
- register int __ignore; \
- unsigned short int __cw; \
- unsigned short int __cwtmp; \
- __asm __volatile ("fnstcw %3\n\t" \
- "movzwl %3, %1\n\t" \
- "andl $0xf3ff, %1\n\t" \
- "orl $0x0800, %1\n\t" /* rounding up */ \
- "movw %w1, %2\n\t" \
- "fldcw %2\n\t" \
- "frndint\n\t" \
- "fldcw %3" \
- : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), \
- "=m" (__cw) \
- : "0" (__x)); \
- return __value)
-
-# ifdef __FAST_MATH__
-# define __ldexp_code \
- register long double __value; \
- __asm __volatile__ \
- ("fscale" \
- : "=t" (__value) : "0" (__x), "u" ((long double) __y)); \
- return __value
-
-__MATH_INLINE double
-__NTH (ldexp (double __x, int __y))
-{
- __ldexp_code;
-}
-# endif
-
/* Optimized versions for some non-standardized functions. */
# ifdef __USE_ISOC99
@@ -801,25 +285,6 @@ __NTH (ldexp (double __x, int __y))
# ifdef __FAST_MATH__
__inline_mathcodeNP (expm1, __x, __expm1_code)
-/* We cannot rely on M_SQRT being defined. So we do it for ourself
- here. */
-# define __M_SQRT2 1.41421356237309504880L /* sqrt(2) */
-
-# if !__GNUC_PREREQ (3, 5)
-__inline_mathcodeNP (log1p, __x, \
- register long double __value; \
- if (__fabsl (__x) >= 1.0 - 0.5 * __M_SQRT2) \
- __value = logl (1.0 + __x); \
- else \
- __asm __volatile__ \
- ("fldln2\n\t" \
- "fxch\n\t" \
- "fyl2xp1" \
- : "=t" (__value) : "0" (__x) : "st(1)"); \
- return __value)
-# endif
-
-
/* The argument range of the inline version of asinhl is slightly reduced. */
__inline_mathcodeNP (asinh, __x, \
register long double __y = __fabsl (__x); \
@@ -837,126 +302,14 @@ __inline_mathcodeNP (atanh, __x, \
__inline_mathcodeNP2 (hypot, __x, __y,
return __libc_sqrtl (__x * __x + __y * __y))
-# if !__GNUC_PREREQ (3, 5)
-__inline_mathcodeNP(logb, __x, \
- register long double __value; \
- register long double __junk; \
- __asm __volatile__ \
- ("fxtract\n\t" \
- : "=t" (__junk), "=u" (__value) : "0" (__x)); \
- return __value)
-# endif
-
# endif
# endif
-# ifdef __USE_ISOC99
-# ifdef __FAST_MATH__
-
-# if !__GNUC_PREREQ (3, 5)
-__inline_mathop_declNP (log2, "fld1; fxch; fyl2x", "0" (__x) : "st(1)")
-# endif
-
-__MATH_INLINE float
-__NTH (ldexpf (float __x, int __y))
-{
- __ldexp_code;
-}
-
-__MATH_INLINE long double
-__NTH (ldexpl (long double __x, int __y))
-{
- __ldexp_code;
-}
-
-__inline_mathopNP (rint, "frndint")
-# endif /* __FAST_MATH__ */
-
-# define __lrint_code \
- long int __lrintres; \
- __asm__ __volatile__ \
- ("fistpl %0" \
- : "=m" (__lrintres) : "t" (__x) : "st"); \
- return __lrintres
-__MATH_INLINE long int
-__NTH (lrintf (float __x))
-{
- __lrint_code;
-}
-__MATH_INLINE long int
-__NTH (lrint (double __x))
-{
- __lrint_code;
-}
-__MATH_INLINE long int
-__NTH (lrintl (long double __x))
-{
- __lrint_code;
-}
-# undef __lrint_code
-
-# define __llrint_code \
- long long int __llrintres; \
- __asm__ __volatile__ \
- ("fistpll %0" \
- : "=m" (__llrintres) : "t" (__x) : "st"); \
- return __llrintres
-__extension__
-__MATH_INLINE long long int
-__NTH (llrintf (float __x))
-{
- __llrint_code;
-}
-__extension__
-__MATH_INLINE long long int
-__NTH (llrint (double __x))
-{
- __llrint_code;
-}
-__extension__
-__MATH_INLINE long long int
-__NTH (llrintl (long double __x))
-{
- __llrint_code;
-}
-# undef __llrint_code
-
-# endif
-
-
-# ifdef __USE_MISC
-
-# if defined __FAST_MATH__ && !__GNUC_PREREQ (3, 5)
-__inline_mathcodeNP2 (drem, __x, __y, \
- register double __value; \
- register int __clobbered; \
- __asm __volatile__ \
- ("1: fprem1\n\t" \
- "fstsw %%ax\n\t" \
- "sahf\n\t" \
- "jp 1b" \
- : "=t" (__value), "=&a" (__clobbered) : "0" (__x), "u" (__y) : "cc"); \
- return __value)
-# endif
-
-
-/* This function is used in the `isfinite' macro. */
-__MATH_INLINE int
-__NTH (__finite (double __x))
-{
- return (__extension__
- (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1]
- | 0x800fffffu) + 1) >> 31));
-}
-
-# endif /* __USE_MISC */
/* Undefine some of the large macros which are not used anymore. */
-# undef __atan2_code
# ifdef __FAST_MATH__
# undef __expm1_code
# undef __exp_code
-# undef __sincos_code
# endif /* __FAST_MATH__ */
# endif /* __NO_MATH_INLINES */
@@ -964,7 +317,6 @@ __NTH (__finite (double __x))
/* This code is used internally in the GNU libc. */
# ifdef __LIBC_INTERNAL_MATH_INLINES
-__inline_mathop (__ieee754_sqrt, "fsqrt")
__inline_mathcode2_ (long double, __ieee754_atan2l, __y, __x,
register long double __value;
__asm __volatile__ ("fpatan\n\t"
diff --git a/sysdeps/x86/fpu/e_sqrtf128.c b/sysdeps/x86/fpu/e_sqrtf128.c
new file mode 100644
index 0000000000..cac5f63527
--- /dev/null
+++ b/sysdeps/x86/fpu/e_sqrtf128.c
@@ -0,0 +1,47 @@
+/* soft-fp sqrt for _Float128
+ Return sqrt(a)
+ Copyright (C) 2017-2018 Free Software 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 <quad.h>
+
+__float128
+__ieee754_sqrtf128 (__float128 a)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (A);
+ FP_DECL_Q (R);
+ __float128 r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (A, a);
+ FP_SQRT_Q (R, A);
+ FP_PACK_Q (r, R);
+ FP_HANDLE_EXCEPTIONS;
+ return r;
+}
+strong_alias (__ieee754_sqrtf128, __sqrtf128_finite)
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..6bad27d0fa
--- /dev/null
+++ b/sysdeps/x86/fpu/fix-fp-int-compare-invalid.h
@@ -0,0 +1,32 @@
+/* Fix for missing "invalid" exceptions from floating-point
+ comparisons. x86 version.
+ Copyright (C) 2016-2018 Free Software 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
+
+/* Before GCC 8, 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>. */
+#if __GNUC_PREREQ (8, 0)
+# define FIX_COMPARE_INVALID 0
+#else
+# define FIX_COMPARE_INVALID 1
+#endif
+
+#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..3d2483b0bf 100644
--- a/sysdeps/x86/fpu/include/bits/fenv.h
+++ b/sysdeps/x86/fpu/include/bits/fenv.h
@@ -1,5 +1,5 @@
/* Wrapper for x86 bits/fenv.h for use when building glibc.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software 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,8 +16,20 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_FENV_H
+
+#if defined _LIBC && defined __USE_EXTERN_INLINES
+# if defined SHARED && !defined NO_HIDDEN && IS_IN (libm)
+extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), __GI_feraiseexcept);
+# else
+extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept);
+# endif
+#endif
+
#include_next <bits/fenv.h>
+# ifndef _ISOMAC
+
/* Ensure __feraiseexcept calls in glibc are optimized the same as
feraiseexcept calls. */
@@ -40,3 +52,6 @@ __NTH (__feraiseexcept (int __excepts))
__END_DECLS
#endif
+
+# endif /* _ISOMAC */
+#endif /* bits/fenv.h */
diff --git a/sysdeps/x86/fpu/math-barriers.h b/sysdeps/x86/fpu/math-barriers.h
new file mode 100644
index 0000000000..1e1fabdb92
--- /dev/null
+++ b/sysdeps/x86/fpu/math-barriers.h
@@ -0,0 +1,61 @@
+/* Control when floating-point expressions are evaluated. x86 version.
+ Copyright (C) 2007-2018 Free Software 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 X86_MATH_BARRIERS_H
+#define X86_MATH_BARRIERS_H 1
+
+#ifdef __SSE2_MATH__
+# define math_opt_barrier(x) \
+ ({ __typeof(x) __x; \
+ if (sizeof (x) <= sizeof (double) \
+ || __builtin_types_compatible_p (__typeof (x), _Float128)) \
+ __asm ("" : "=x" (__x) : "0" (x)); \
+ else \
+ __asm ("" : "=t" (__x) : "0" (x)); \
+ __x; })
+# define math_force_eval(x) \
+ do { \
+ if (sizeof (x) <= sizeof (double) \
+ || __builtin_types_compatible_p (__typeof (x), _Float128)) \
+ __asm __volatile ("" : : "x" (x)); \
+ else \
+ __asm __volatile ("" : : "f" (x)); \
+ } while (0)
+#else
+# define math_opt_barrier(x) \
+ ({ __typeof (x) __x; \
+ if (__builtin_types_compatible_p (__typeof (x), _Float128)) \
+ { \
+ __x = (x); \
+ __asm ("" : "+m" (__x)); \
+ } \
+ else \
+ __asm ("" : "=t" (__x) : "0" (x)); \
+ __x; })
+# define math_force_eval(x) \
+ do { \
+ __typeof (x) __x = (x); \
+ if (sizeof (x) <= sizeof (double) \
+ || __builtin_types_compatible_p (__typeof (x), _Float128)) \
+ __asm __volatile ("" : : "m" (__x)); \
+ else \
+ __asm __volatile ("" : : "f" (__x)); \
+ } while (0)
+#endif
+
+#endif
diff --git a/sysdeps/x86/fpu/powl_helper.c b/sysdeps/x86/fpu/powl_helper.c
index 7c5d2d1492..651eedd792 100644
--- a/sysdeps/x86/fpu/powl_helper.c
+++ b/sysdeps/x86/fpu/powl_helper.c
@@ -1,5 +1,5 @@
/* Implement powl for x86 using extra-precision log.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <stdbool.h>
/* High parts and low parts of -log (k/16), for integer k from 12 to
@@ -120,7 +121,7 @@ __powl_helper (long double x, long double y)
corrected for by adding log2 (e) * X_FRAC_LOW to the final
result. */
int32_t se;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x_frac);
x_frac_low = x_frac;
i1 &= 0xffffffe0;
@@ -139,7 +140,7 @@ __powl_helper (long double x, long double y)
long double w = x_frac - 1;
long double w_hi, w_lo;
int32_t se;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, w);
i0 &= 0xffff0000;
i1 = 0;
diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h
new file mode 100644
index 0000000000..df8906acb4
--- /dev/null
+++ b/sysdeps/x86/fpu/sfp-machine.h
@@ -0,0 +1,209 @@
+/* Configure soft-fp for building sqrtf128. Based on sfp-machine.h in
+ libgcc, with soft-float and other irrelevant parts removed. */
+
+/* The type of the result of a floating point comparison. This must
+ match `__libgcc_cmp_return__' in GCC for the target. */
+typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
+#define CMPtype __gcc_CMPtype
+
+#ifdef __x86_64__
+# define _FP_W_TYPE_SIZE 64
+# define _FP_W_TYPE unsigned long long
+# define _FP_WS_TYPE signed long long
+# define _FP_I_TYPE long long
+
+typedef int TItype __attribute__ ((mode (TI)));
+typedef unsigned int UTItype __attribute__ ((mode (TI)));
+
+# define TI_BITS (__CHAR_BIT__ * (int)sizeof(TItype))
+
+# define _FP_MUL_MEAT_Q(R,X,Y) \
+ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+# define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
+
+# define _FP_NANFRAC_S _FP_QNANBIT_S
+# define _FP_NANFRAC_D _FP_QNANBIT_D
+# define _FP_NANFRAC_E _FP_QNANBIT_E, 0
+# define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0
+
+# define FP_EX_SHIFT 7
+
+# define _FP_DECL_EX \
+ unsigned int _fcw __attribute__ ((unused)) = FP_RND_NEAREST;
+
+# define FP_RND_NEAREST 0
+# define FP_RND_ZERO 0x6000
+# define FP_RND_PINF 0x4000
+# define FP_RND_MINF 0x2000
+
+# define FP_RND_MASK 0x6000
+
+# define FP_INIT_ROUNDMODE \
+ do { \
+ __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \
+ } while (0)
+#else
+# define _FP_W_TYPE_SIZE 32
+# define _FP_W_TYPE unsigned int
+# define _FP_WS_TYPE signed int
+# define _FP_I_TYPE int
+
+# define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
+ __asm__ ("add{l} {%11,%3|%3,%11}\n\t" \
+ "adc{l} {%9,%2|%2,%9}\n\t" \
+ "adc{l} {%7,%1|%1,%7}\n\t" \
+ "adc{l} {%5,%0|%0,%5}" \
+ : "=r" ((USItype) (r3)), \
+ "=&r" ((USItype) (r2)), \
+ "=&r" ((USItype) (r1)), \
+ "=&r" ((USItype) (r0)) \
+ : "%0" ((USItype) (x3)), \
+ "g" ((USItype) (y3)), \
+ "%1" ((USItype) (x2)), \
+ "g" ((USItype) (y2)), \
+ "%2" ((USItype) (x1)), \
+ "g" ((USItype) (y1)), \
+ "%3" ((USItype) (x0)), \
+ "g" ((USItype) (y0)))
+# define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
+ __asm__ ("add{l} {%8,%2|%2,%8}\n\t" \
+ "adc{l} {%6,%1|%1,%6}\n\t" \
+ "adc{l} {%4,%0|%0,%4}" \
+ : "=r" ((USItype) (r2)), \
+ "=&r" ((USItype) (r1)), \
+ "=&r" ((USItype) (r0)) \
+ : "%0" ((USItype) (x2)), \
+ "g" ((USItype) (y2)), \
+ "%1" ((USItype) (x1)), \
+ "g" ((USItype) (y1)), \
+ "%2" ((USItype) (x0)), \
+ "g" ((USItype) (y0)))
+# define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
+ __asm__ ("sub{l} {%11,%3|%3,%11}\n\t" \
+ "sbb{l} {%9,%2|%2,%9}\n\t" \
+ "sbb{l} {%7,%1|%1,%7}\n\t" \
+ "sbb{l} {%5,%0|%0,%5}" \
+ : "=r" ((USItype) (r3)), \
+ "=&r" ((USItype) (r2)), \
+ "=&r" ((USItype) (r1)), \
+ "=&r" ((USItype) (r0)) \
+ : "0" ((USItype) (x3)), \
+ "g" ((USItype) (y3)), \
+ "1" ((USItype) (x2)), \
+ "g" ((USItype) (y2)), \
+ "2" ((USItype) (x1)), \
+ "g" ((USItype) (y1)), \
+ "3" ((USItype) (x0)), \
+ "g" ((USItype) (y0)))
+# define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
+ __asm__ ("sub{l} {%8,%2|%2,%8}\n\t" \
+ "sbb{l} {%6,%1|%1,%6}\n\t" \
+ "sbb{l} {%4,%0|%0,%4}" \
+ : "=r" ((USItype) (r2)), \
+ "=&r" ((USItype) (r1)), \
+ "=&r" ((USItype) (r0)) \
+ : "0" ((USItype) (x2)), \
+ "g" ((USItype) (y2)), \
+ "1" ((USItype) (x1)), \
+ "g" ((USItype) (y1)), \
+ "2" ((USItype) (x0)), \
+ "g" ((USItype) (y0)))
+# define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i) \
+ __asm__ ("add{l} {%4,%3|%3,%4}\n\t" \
+ "adc{l} {$0,%2|%2,0}\n\t" \
+ "adc{l} {$0,%1|%1,0}\n\t" \
+ "adc{l} {$0,%0|%0,0}" \
+ : "+r" ((USItype) (x3)), \
+ "+&r" ((USItype) (x2)), \
+ "+&r" ((USItype) (x1)), \
+ "+&r" ((USItype) (x0)) \
+ : "g" ((USItype) (i)))
+
+
+# define _FP_MUL_MEAT_S(R,X,Y) \
+ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+# define _FP_MUL_MEAT_D(R,X,Y) \
+ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+# define _FP_MUL_MEAT_Q(R,X,Y) \
+ _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+# define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
+# define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
+# define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
+
+# define _FP_NANFRAC_S _FP_QNANBIT_S
+# define _FP_NANFRAC_D _FP_QNANBIT_D, 0
+/* Even if XFmode is 12byte, we have to pad it to
+ 16byte since soft-fp emulation is done in 16byte. */
+# define _FP_NANFRAC_E _FP_QNANBIT_E, 0, 0, 0
+# define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0, 0, 0
+
+# define FP_EX_SHIFT 0
+
+# define _FP_DECL_EX \
+ unsigned short _fcw __attribute__ ((unused)) = FP_RND_NEAREST;
+
+# define FP_RND_NEAREST 0
+# define FP_RND_ZERO 0xc00
+# define FP_RND_PINF 0x800
+# define FP_RND_MINF 0x400
+
+# define FP_RND_MASK 0xc00
+
+# define FP_INIT_ROUNDMODE \
+ do { \
+ __asm__ __volatile__ ("fnstcw\t%0" : "=m" (_fcw)); \
+ } while (0)
+#endif
+
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
+
+#define _FP_NANSIGN_S 1
+#define _FP_NANSIGN_D 1
+#define _FP_NANSIGN_E 1
+#define _FP_NANSIGN_Q 1
+
+/* Here is something Intel misdesigned: the specs don't define
+ the case where we have two NaNs with same mantissas, but
+ different sign. Different operations pick up different NaNs. */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do { \
+ if (_FP_FRAC_GT_##wc(X, Y) \
+ || (_FP_FRAC_EQ_##wc(X,Y) && (OP == '+' || OP == '*'))) \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc(R,X); \
+ } \
+ else \
+ { \
+ R##_s = Y##_s; \
+ _FP_FRAC_COPY_##wc(R,Y); \
+ } \
+ R##_c = FP_CLS_NAN; \
+ } while (0)
+
+#define FP_EX_INVALID 0x01
+#define FP_EX_DENORM 0x02
+#define FP_EX_DIVZERO 0x04
+#define FP_EX_OVERFLOW 0x08
+#define FP_EX_UNDERFLOW 0x10
+#define FP_EX_INEXACT 0x20
+#define FP_EX_ALL \
+ (FP_EX_INVALID | FP_EX_DENORM | FP_EX_DIVZERO | FP_EX_OVERFLOW \
+ | FP_EX_UNDERFLOW | FP_EX_INEXACT)
+
+void __sfp_handle_exceptions (int);
+
+#define FP_HANDLE_EXCEPTIONS \
+ do { \
+ if (__builtin_expect (_fex, 0)) \
+ __sfp_handle_exceptions (_fex); \
+ } while (0);
+
+#define FP_TRAPPING_EXCEPTIONS ((~_fcw >> FP_EX_SHIFT) & FP_EX_ALL)
+
+#define FP_ROUNDMODE (_fcw & FP_RND_MASK)
+
+#define _FP_TININESS_AFTER_ROUNDING 1
diff --git a/sysdeps/x86/fpu/test-fenv-clear-sse.c b/sysdeps/x86/fpu/test-fenv-clear-sse.c
index cc4b3f04c7..c67a3ba7c9 100644
--- a/sysdeps/x86/fpu/test-fenv-clear-sse.c
+++ b/sysdeps/x86/fpu/test-fenv-clear-sse.c
@@ -1,6 +1,6 @@
/* Test fesetenv (FE_DFL_ENV) and fesetenv (FE_NOMASK_ENV) clear
exceptions (bug 19181). SSE version.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86/fpu/test-fenv-sse-2.c b/sysdeps/x86/fpu/test-fenv-sse-2.c
index d3197c3339..fcb1011555 100644
--- a/sysdeps/x86/fpu/test-fenv-sse-2.c
+++ b/sysdeps/x86/fpu/test-fenv-sse-2.c
@@ -1,5 +1,5 @@
/* Test x86-specific floating-point environment (bug 16068): SSE part.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86/fpu/test-fenv-sse.c b/sysdeps/x86/fpu/test-fenv-sse.c
index 4f4ff6a0a6..5462315811 100644
--- a/sysdeps/x86/fpu/test-fenv-sse.c
+++ b/sysdeps/x86/fpu/test-fenv-sse.c
@@ -1,5 +1,5 @@
/* Test floating-point environment includes SSE state (bug 16064).
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86/fpu/test-fenv-x87.c b/sysdeps/x86/fpu/test-fenv-x87.c
index b6f0b6af78..c9cd84e9c7 100644
--- a/sysdeps/x86/fpu/test-fenv-x87.c
+++ b/sysdeps/x86/fpu/test-fenv-x87.c
@@ -1,5 +1,5 @@
/* Test x86-specific floating-point environment (bug 16068): x87 part.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86/fpu/test-flt-eval-method-387.c b/sysdeps/x86/fpu/test-flt-eval-method-387.c
new file mode 100644
index 0000000000..2fb7acfb76
--- /dev/null
+++ b/sysdeps/x86/fpu/test-flt-eval-method-387.c
@@ -0,0 +1 @@
+#include <test-flt-eval-method.c>
diff --git a/sysdeps/x86/fpu/test-flt-eval-method-sse.c b/sysdeps/x86/fpu/test-flt-eval-method-sse.c
new file mode 100644
index 0000000000..2fb7acfb76
--- /dev/null
+++ b/sysdeps/x86/fpu/test-flt-eval-method-sse.c
@@ -0,0 +1 @@
+#include <test-flt-eval-method.c>
diff --git a/sysdeps/x86/fpu/test-math-vector-sincos.h b/sysdeps/x86/fpu/test-math-vector-sincos.h
new file mode 100644
index 0000000000..d422ffa4a7
--- /dev/null
+++ b/sysdeps/x86/fpu/test-math-vector-sincos.h
@@ -0,0 +1,98 @@
+/* Wrappers definitions for tests of ABI of vector sincos/sincosf having
+ vector declaration "#pragma omp declare simd notinbranch".
+ Copyright (C) 2016-2018 Free Software 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 INIT_VEC_PTRS_LOOP(vec, val, len) \
+ do \
+ { \
+ union { VEC_INT_TYPE v; __typeof__ ((val)[0]) *a[(len)]; } u; \
+ for (i = 0; i < len; i++) \
+ u.a[i] = &(val)[i]; \
+ (vec) = u.v; \
+ } \
+ while (0)
+
+/* Wrapper for vector sincos/sincosf compatible with x86_64 and x32 variants
+ of _ZGVbN2vvv_sincos, _ZGVdN4vvv_sincos, _ZGVeN8vvv_sincos;
+ x32 variants of _ZGVbN4vvv_sincosf, _ZGVcN4vvv_sincos, _ZGVdN8vvv_sincosf,
+ _ZGVeN16vvv_sincosf. */
+#define VECTOR_WRAPPER_fFF_2(scalar_func, vector_func) \
+extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE); \
+void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \
+{ \
+ int i; \
+ FLOAT r_loc[VEC_LEN], r1_loc[VEC_LEN]; \
+ VEC_TYPE mx; \
+ VEC_INT_TYPE mr, mr1; \
+ INIT_VEC_LOOP (mx, x, VEC_LEN); \
+ INIT_VEC_PTRS_LOOP (mr, r_loc, VEC_LEN); \
+ INIT_VEC_PTRS_LOOP (mr1, r1_loc, VEC_LEN); \
+ vector_func (mx, mr, mr1); \
+ TEST_VEC_LOOP (r_loc, VEC_LEN); \
+ TEST_VEC_LOOP (r1_loc, VEC_LEN); \
+ *r = r_loc[0]; \
+ *r1 = r1_loc[0]; \
+ return; \
+}
+
+/* Wrapper for vector sincos/sincosf compatible with x86_64 variants of
+ _ZGVcN4vvv_sincos, _ZGVeN16vvv_sincosf, _ZGVbN4vvv_sincosf,
+ _ZGVdN8vvv_sincosf, _ZGVcN8vvv_sincosf. */
+#define VECTOR_WRAPPER_fFF_3(scalar_func, vector_func) \
+extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE, \
+ VEC_INT_TYPE, VEC_INT_TYPE); \
+void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \
+{ \
+ int i; \
+ FLOAT r_loc[VEC_LEN/2], r1_loc[VEC_LEN/2]; \
+ VEC_TYPE mx; \
+ VEC_INT_TYPE mr, mr1; \
+ INIT_VEC_LOOP (mx, x, VEC_LEN); \
+ INIT_VEC_PTRS_LOOP (mr, r_loc, VEC_LEN/2); \
+ INIT_VEC_PTRS_LOOP (mr1, r1_loc, VEC_LEN/2); \
+ vector_func (mx, mr, mr, mr1, mr1); \
+ TEST_VEC_LOOP (r_loc, VEC_LEN/2); \
+ TEST_VEC_LOOP (r1_loc, VEC_LEN/2); \
+ *r = r_loc[0]; \
+ *r1 = r1_loc[0]; \
+ return; \
+}
+
+/* Wrapper for vector sincosf compatible with x86_64 variant of
+ _ZGVcN8vvv_sincosf. */
+#define VECTOR_WRAPPER_fFF_4(scalar_func, vector_func) \
+extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE, \
+ VEC_INT_TYPE, VEC_INT_TYPE, \
+ VEC_INT_TYPE, VEC_INT_TYPE, \
+ VEC_INT_TYPE, VEC_INT_TYPE); \
+void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \
+{ \
+ int i; \
+ FLOAT r_loc[VEC_LEN/4], r1_loc[VEC_LEN/4]; \
+ VEC_TYPE mx; \
+ VEC_INT_TYPE mr, mr1; \
+ INIT_VEC_LOOP (mx, x, VEC_LEN); \
+ INIT_VEC_PTRS_LOOP (mr, r_loc, VEC_LEN/4); \
+ INIT_VEC_PTRS_LOOP (mr1, r1_loc, VEC_LEN/4); \
+ vector_func (mx, mr, mr, mr, mr, mr1, mr1, mr1, mr1); \
+ TEST_VEC_LOOP (r_loc, VEC_LEN/4); \
+ TEST_VEC_LOOP (r1_loc, VEC_LEN/4); \
+ *r = r_loc[0]; \
+ *r1 = r1_loc[0]; \
+ return; \
+}
diff --git a/sysdeps/x86/fpu_control.h b/sysdeps/x86/fpu_control.h
index 4c960580a3..4cb98c5679 100644
--- a/sysdeps/x86/fpu_control.h
+++ b/sysdeps/x86/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word bits. x86 version.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Olaf Flebbe.
diff --git a/sysdeps/x86/init-arch.h b/sysdeps/x86/init-arch.h
index 17a38d2967..a81ca8a4eb 100644
--- a/sysdeps/x86/init-arch.h
+++ b/sysdeps/x86/init-arch.h
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@
#else
# include <ldsodefs.h>
#endif
+#include <ifunc-init.h>
#ifndef __x86_64__
/* Due to the reordering and the other nifty extensions in i686, it is
diff --git a/sysdeps/x86/jmp_buf-ssp.sym b/sysdeps/x86/jmp_buf-ssp.sym
new file mode 100644
index 0000000000..1aaaedc9ec
--- /dev/null
+++ b/sysdeps/x86/jmp_buf-ssp.sym
@@ -0,0 +1 @@
+-- FIXME: Define SHADOW_STACK_POINTER_OFFSET to support shadow stack.
diff --git a/sysdeps/x86/ldsodefs.h b/sysdeps/x86/ldsodefs.h
new file mode 100644
index 0000000000..0616215b7a
--- /dev/null
+++ b/sysdeps/x86/ldsodefs.h
@@ -0,0 +1,66 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+ X86 version.
+ Copyright (C) 1995-2018 Free Software 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 _X86_LDSODEFS_H
+#define _X86_LDSODEFS_H 1
+
+#include <elf.h>
+#include <cpu-features.h>
+
+struct La_i86_regs;
+struct La_i86_retval;
+struct La_x86_64_regs;
+struct La_x86_64_retval;
+struct La_x32_regs;
+struct La_x32_retval;
+
+#define ARCH_PLTENTER_MEMBERS \
+ Elf32_Addr (*i86_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, struct La_i86_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep); \
+ Elf64_Addr (*x86_64_gnu_pltenter) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, \
+ uintptr_t *, struct La_x86_64_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep); \
+ Elf32_Addr (*x32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, struct La_x32_regs *, \
+ unsigned int *, const char *name, \
+ long int *framesizep)
+
+#define ARCH_PLTEXIT_MEMBERS \
+ unsigned int (*i86_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, const struct La_i86_regs *, \
+ struct La_i86_retval *, const char *); \
+ unsigned int (*x86_64_gnu_pltexit) (Elf64_Sym *, unsigned int, \
+ uintptr_t *, \
+ uintptr_t *, \
+ const struct La_x86_64_regs *, \
+ struct La_x86_64_retval *, \
+ const char *); \
+ unsigned int (*x32_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *, \
+ uintptr_t *, \
+ const struct La_x32_regs *, \
+ struct La_x86_64_retval *, \
+ const char *)
+
+#include_next <ldsodefs.h>
+
+#endif
diff --git a/sysdeps/x86/libc-start.c b/sysdeps/x86/libc-start.c
index 3b5ea6e933..eb5335c154 100644
--- a/sysdeps/x86/libc-start.c
+++ b/sysdeps/x86/libc-start.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2018 Free Software 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,27 +15,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef SHARED
-# include <csu/libc-start.c>
-# else
-/* The main work is done in the generic function. */
-# define LIBC_START_DISABLE_INLINE
-# define LIBC_START_MAIN generic_start_main
-# include <csu/libc-start.c>
+#ifndef SHARED
+/* Define I386_USE_SYSENTER to support syscall during startup in static
+ PIE. */
+# include <startup.h>
+# include <ldsodefs.h>
# include <cpu-features.h>
# include <cpu-features.c>
extern struct cpu_features _dl_x86_cpu_features;
-int
-__libc_start_main (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
- int argc, char **argv,
- __typeof (main) init,
- void (*fini) (void),
- void (*rtld_fini) (void), void *stack_end)
-{
- init_cpu_features (&_dl_x86_cpu_features);
- return generic_start_main (main, argc, argv, init, fini, rtld_fini,
- stack_end);
-}
-#endif
+# define ARCH_INIT_CPU_FEATURES() init_cpu_features (&_dl_x86_cpu_features)
+
+#endif /* !SHARED */
+#include <csu/libc-start.c>
diff --git a/sysdeps/x86/libc-start.h b/sysdeps/x86/libc-start.h
new file mode 100644
index 0000000000..6f44262bf4
--- /dev/null
+++ b/sysdeps/x86/libc-start.h
@@ -0,0 +1,25 @@
+/* X86 definitions for libc main startup.
+ Copyright (C) 2018 Free Software 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 SHARED
+# define ARCH_SETUP_IREL() apply_irel ()
+# define ARCH_APPLY_IREL()
+# ifndef ARCH_SETUP_TLS
+# define ARCH_SETUP_TLS() __libc_setup_tls ()
+# endif
+#endif /* !SHARED */
diff --git a/sysdeps/x86/link_map.h b/sysdeps/x86/link_map.h
new file mode 100644
index 0000000000..ef1206a9d2
--- /dev/null
+++ b/sysdeps/x86/link_map.h
@@ -0,0 +1,26 @@
+/* Additional fields in struct link_map. Linux/x86 version.
+ Copyright (C) 2018 Free Software 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/>. */
+
+/* If this object is enabled with CET. */
+enum
+ {
+ lc_none = 0, /* Not enabled with CET. */
+ lc_ibt = 1 << 0, /* Enabled with IBT. */
+ lc_shstk = 1 << 1, /* Enabled with STSHK. */
+ lc_ibt_and_shstk = lc_ibt | lc_shstk /* Enabled with both. */
+ } l_cet:2;
diff --git a/sysdeps/x86/longjmp.c b/sysdeps/x86/longjmp.c
new file mode 100644
index 0000000000..a53f31e1dd
--- /dev/null
+++ b/sysdeps/x86/longjmp.c
@@ -0,0 +1,45 @@
+/* __libc_siglongjmp for x86.
+ Copyright (C) 2018 Free Software 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 __libc_longjmp __redirect___libc_longjmp
+#include <setjmp/longjmp.c>
+#undef __libc_longjmp
+
+extern void __longjmp_cancel (__jmp_buf __env, int __val)
+ __attribute__ ((__noreturn__)) attribute_hidden;
+
+/* Since __libc_longjmp is a private interface for cancellation
+ implementation in libpthread, there is no need to restore shadow
+ stack register. */
+
+void
+__libc_longjmp (sigjmp_buf env, int val)
+{
+ /* Perform any cleanups needed by the frames being unwound. */
+ _longjmp_unwind (env, val);
+
+ if (env[0].__mask_was_saved)
+ /* Restore the saved signal mask. */
+ (void) __sigprocmask (SIG_SETMASK,
+ (sigset_t *) &env[0].__saved_mask,
+ (sigset_t *) NULL);
+
+ /* Call the machine-dependent function to restore machine state
+ without shadow stack. */
+ __longjmp_cancel (env[0].__jmpbuf, val ?: 1);
+}
diff --git a/sysdeps/x86/math-tests.h b/sysdeps/x86/math-tests.h
new file mode 100644
index 0000000000..43c7ebe337
--- /dev/null
+++ b/sysdeps/x86/math-tests.h
@@ -0,0 +1,25 @@
+/* Configuration for math tests. x86 version.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+/* Before GCC 7, there is no built-in function to provide a __float128
+ sNaN, so most sNaN tests for this type cannot work. */
+#if !__GNUC_PREREQ (7, 0)
+# define SNAN_TESTS_float128 0
+#endif
+
+#include_next <math-tests.h>
diff --git a/sysdeps/x86/nptl/bits/pthreadtypes-arch.h b/sysdeps/x86/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000000..290f2f4640
--- /dev/null
+++ b/sysdeps/x86/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,106 @@
+/* Copyright (C) 2002-2018 Free Software 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 _BITS_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H 1
+
+#include <bits/wordsize.h>
+
+#ifdef __x86_64__
+# if __WORDSIZE == 64
+# define __SIZEOF_PTHREAD_MUTEX_T 40
+# define __SIZEOF_PTHREAD_ATTR_T 56
+# define __SIZEOF_PTHREAD_MUTEX_T 40
+# define __SIZEOF_PTHREAD_RWLOCK_T 56
+# define __SIZEOF_PTHREAD_BARRIER_T 32
+# else
+# define __SIZEOF_PTHREAD_MUTEX_T 32
+# define __SIZEOF_PTHREAD_ATTR_T 32
+# define __SIZEOF_PTHREAD_MUTEX_T 32
+# define __SIZEOF_PTHREAD_RWLOCK_T 44
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+# endif
+#else
+# define __SIZEOF_PTHREAD_MUTEX_T 24
+# define __SIZEOF_PTHREAD_ATTR_T 36
+# define __SIZEOF_PTHREAD_MUTEX_T 24
+# define __SIZEOF_PTHREAD_RWLOCK_T 32
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+#endif
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+/* Definitions for internal mutex struct. */
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION 1
+#ifdef __x86_64__
+# define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
+# define __PTHREAD_MUTEX_USE_UNION 0
+#else
+# define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1
+# define __PTHREAD_MUTEX_USE_UNION 1
+#endif
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+#ifdef __x86_64__
+ int __cur_writer;
+ int __shared;
+ signed char __rwelision;
+# ifdef __ILP32__
+ unsigned char __pad1[3];
+# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 }
+# else
+ unsigned char __pad1[7];
+# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 }
+# endif
+ unsigned long int __pad2;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned int __flags;
+# define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1
+#else
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ unsigned char __shared;
+ signed char __rwelision;
+# define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+ unsigned char __pad2;
+ int __cur_writer;
+#endif
+};
+
+#ifndef __x86_64__
+/* Extra attributes for the cleanup functions. */
+# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
+#endif
+
+#endif /* bits/pthreadtypes.h */
diff --git a/sysdeps/x86/nptl/pt-longjmp.c b/sysdeps/x86/nptl/pt-longjmp.c
new file mode 100644
index 0000000000..6165c7d4a7
--- /dev/null
+++ b/sysdeps/x86/nptl/pt-longjmp.c
@@ -0,0 +1,71 @@
+/* ABI compatibility for 'longjmp' and 'siglongjmp' symbols in libpthread ABI.
+ X86 version.
+ Copyright (C) 18 Free Software 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 <pthreadP.h>
+#include <jmp_buf-ssp.h>
+
+#ifdef __x86_64__
+# define SHADOW_STACK_POINTER_SIZE 8
+#else
+# define SHADOW_STACK_POINTER_SIZE 4
+#endif
+
+/* Assert that the priv field in struct pthread_unwind_buf has space
+ to store shadow stack pointer. */
+_Static_assert ((offsetof (struct pthread_unwind_buf, priv)
+ <= SHADOW_STACK_POINTER_OFFSET)
+ && ((offsetof (struct pthread_unwind_buf, priv)
+ + sizeof (((struct pthread_unwind_buf *) 0)->priv))
+ >= (SHADOW_STACK_POINTER_OFFSET
+ + SHADOW_STACK_POINTER_SIZE)),
+ "Shadow stack pointer is not within private storage "
+ "of pthread_unwind_buf.");
+
+#include <shlib-compat.h>
+
+/* libpthread once had its own longjmp (and siglongjmp alias), though there
+ was no apparent reason for it. There is no use in having a separate
+ symbol in libpthread, but the historical ABI requires it. For static
+ linking, there is no need to provide anything here--the libc version
+ will be linked in. For shared library ABI compatibility, there must be
+ longjmp and siglongjmp symbols in libpthread.so.
+
+ With an IFUNC resolver, it would be possible to avoid the indirection,
+ but the IFUNC resolver might run before the __libc_longjmp symbol has
+ been relocated, in which case the IFUNC resolver would not be able to
+ provide the correct address. */
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
+
+static void __attribute__ ((noreturn, used))
+longjmp_compat (jmp_buf env, int val)
+{
+ /* NB: We call __libc_siglongjmp, instead of __libc_longjmp, since
+ __libc_longjmp is a private interface for cancellation which
+ doesn't restore shadow stack register. */
+ __libc_siglongjmp (env, val);
+}
+
+strong_alias (longjmp_compat, longjmp_alias)
+compat_symbol (libpthread, longjmp_alias, longjmp, GLIBC_2_0);
+
+strong_alias (longjmp_alias, siglongjmp_alias)
+compat_symbol (libpthread, siglongjmp_alias, siglongjmp, GLIBC_2_0);
+
+#endif
diff --git a/sysdeps/x86/nptl/tls-setup.h b/sysdeps/x86/nptl/tls-setup.h
new file mode 100644
index 0000000000..ef5a4df78c
--- /dev/null
+++ b/sysdeps/x86/nptl/tls-setup.h
@@ -0,0 +1,23 @@
+/* Definitions to set up thread-local data. x86 version.
+ Copyright (C) 2018 Free Software 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/>. */
+
+static inline void __attribute__ ((always_inline))
+tls_setup_tcbhead (struct pthread *pd)
+{
+ pd->header.feature_1 = THREAD_GETMEM (THREAD_SELF, header.feature_1);
+}
diff --git a/sysdeps/x86/rtld-global-offsets.sym b/sysdeps/x86/rtld-global-offsets.sym
deleted file mode 100644
index a9d53d195f..0000000000
--- a/sysdeps/x86/rtld-global-offsets.sym
+++ /dev/null
@@ -1,7 +0,0 @@
-#define SHARED 1
-
-#include <ldsodefs.h>
-
-#define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem)
-
-RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET rtld_global_ro_offsetof (_dl_x86_cpu_features)
diff --git a/sysdeps/x86/string_private.h b/sysdeps/x86/string_private.h
index e7281eb4ea..4bc45f63d8 100644
--- a/sysdeps/x86/string_private.h
+++ b/sysdeps/x86/string_private.h
@@ -1,5 +1,5 @@
/* Define _STRING_ARCH_unaligned. i486/x86-64 version.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86/sysdep.h b/sysdeps/x86/sysdep.h
new file mode 100644
index 0000000000..8776ad8374
--- /dev/null
+++ b/sysdeps/x86/sysdep.h
@@ -0,0 +1,104 @@
+/* Assembler macros for x86.
+ Copyright (C) 2017-2018 Free Software 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 _X86_SYSDEP_H
+#define _X86_SYSDEP_H 1
+
+#include <sysdeps/generic/sysdep.h>
+
+/* __CET__ is defined by GCC with Control-Flow Protection values:
+
+enum cf_protection_level
+{
+ CF_NONE = 0,
+ CF_BRANCH = 1 << 0,
+ CF_RETURN = 1 << 1,
+ CF_FULL = CF_BRANCH | CF_RETURN,
+ CF_SET = 1 << 2
+};
+*/
+
+/* Set if CF_BRANCH (IBT) is enabled. */
+#define X86_FEATURE_1_IBT (1U << 0)
+/* Set if CF_RETURN (SHSTK) is enabled. */
+#define X86_FEATURE_1_SHSTK (1U << 1)
+
+#ifdef __CET__
+# define CET_ENABLED 1
+# define IBT_ENABLED (__CET__ & X86_FEATURE_1_IBT)
+# define SHSTK_ENABLED (__CET__ & X86_FEATURE_1_SHSTK)
+#else
+# define CET_ENABLED 0
+# define IBT_ENABLED 0
+# define SHSTK_ENABLED 0
+#endif
+
+#ifdef __ASSEMBLER__
+
+/* Syntactic details of assembler. */
+
+#ifdef _CET_ENDBR
+# define _CET_NOTRACK notrack
+#else
+# define _CET_ENDBR
+# define _CET_NOTRACK
+#endif
+
+/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */
+#define ALIGNARG(log2) 1<<log2
+#define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
+
+/* Define an entry point visible from C. */
+#define ENTRY(name) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),@function; \
+ .align ALIGNARG(4); \
+ C_LABEL(name) \
+ cfi_startproc; \
+ _CET_ENDBR; \
+ CALL_MCOUNT
+
+#undef END
+#define END(name) \
+ cfi_endproc; \
+ ASM_SIZE_DIRECTIVE(name)
+
+#define ENTRY_CHK(name) ENTRY (name)
+#define END_CHK(name) END (name)
+
+/* Since C identifiers are not normally prefixed with an underscore
+ on this system, the asm identifier `syscall_error' intrudes on the
+ C name space. Make sure we use an innocuous name. */
+#define syscall_error __syscall_error
+#define mcount _mcount
+
+#undef PSEUDO_END
+#define PSEUDO_END(name) \
+ END (name)
+
+/* Local label name for asm code. */
+#ifndef L
+/* ELF-like local names start with `.L'. */
+# define L(name) .L##name
+#endif
+
+#define atom_text_section .section ".text.atom", "ax"
+
+#endif /* __ASSEMBLER__ */
+
+#endif /* _X86_SYSDEP_H */
diff --git a/sysdeps/x86/tst-cet-legacy-1.c b/sysdeps/x86/tst-cet-legacy-1.c
new file mode 100644
index 0000000000..861c09a26e
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-1.c
@@ -0,0 +1,44 @@
+/* Check compatibility of CET-enabled executable linked with legacy
+ shared object.
+ Copyright (C) 2018 Free Software 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>
+
+extern int in_dso_1 (void);
+extern int in_dso_2 (void);
+
+static int
+do_test (void)
+{
+ if (in_dso_1 () != 0x1234678)
+ {
+ puts ("in_dso_1 () != 0x1234678");
+ exit (1);
+ }
+
+ if (in_dso_2 () != 0xbadbeef)
+ {
+ puts ("in_dso_2 () != 0xbadbeef");
+ exit (1);
+ }
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/x86/tst-cet-legacy-2.c b/sysdeps/x86/tst-cet-legacy-2.c
new file mode 100644
index 0000000000..e039a16797
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-2.c
@@ -0,0 +1,64 @@
+/* Check compatibility of CET-enabled executable with dlopened legacy
+ shared object.
+ Copyright (C) 2018 Free Software 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 <stdlib.h>
+
+extern int in_dso_2 (void);
+
+static int
+do_test (void)
+{
+ static const char modname[] = "tst-cet-legacy-mod-1.so";
+ int (*fp) (void);
+ void *h;
+
+ h = dlopen (modname, RTLD_LAZY);
+ if (h == NULL)
+ {
+ printf ("cannot open '%s': %s\n", modname, dlerror ());
+ exit (1);
+ }
+
+ fp = dlsym (h, "in_dso_1");
+ if (fp == NULL)
+ {
+ printf ("cannot get symbol 'in_dso': %s\n", dlerror ());
+ exit (1);
+ }
+
+ if (fp () != 0x1234678)
+ {
+ puts ("in_dso_1 () != 0x1234678");
+ exit (1);
+ }
+
+ if (in_dso_2 () != 0xbadbeef)
+ {
+ puts ("in_dso_2 () != 0xbadbeef");
+ exit (1);
+ }
+
+ dlclose (h);
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/x86/tst-cet-legacy-2a.c b/sysdeps/x86/tst-cet-legacy-2a.c
new file mode 100644
index 0000000000..d5aead4303
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-2a.c
@@ -0,0 +1 @@
+#include "tst-cet-legacy-2.c"
diff --git a/sysdeps/x86/tst-cet-legacy-3.c b/sysdeps/x86/tst-cet-legacy-3.c
new file mode 100644
index 0000000000..bab9faa8b0
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-3.c
@@ -0,0 +1,37 @@
+/* Check compatibility of CET-enabled executable with dlopened legacy
+ shared object.
+ Copyright (C) 2018 Free Software 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>
+
+int
+test (void)
+{
+ printf ("PASS\n");
+ return 0;
+}
+
+#ifndef TEST_MODULE
+static int
+do_test (void)
+{
+ return test ();
+}
+
+#include <support/test-driver.c>
+#endif
diff --git a/sysdeps/x86/tst-cet-legacy-4.c b/sysdeps/x86/tst-cet-legacy-4.c
new file mode 100644
index 0000000000..3ead63dd24
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-4.c
@@ -0,0 +1,56 @@
+/* Check compatibility of CET-enabled executable with dlopened legacy
+ shared object.
+ Copyright (C) 2018 Free Software 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 <stdlib.h>
+
+static int
+do_test (void)
+{
+ static const char modname[] = "tst-cet-legacy-mod-4.so";
+ int (*fp) (void);
+ void *h;
+
+ h = dlopen (modname, RTLD_LAZY);
+ if (h == NULL)
+ {
+ printf ("cannot open '%s': %s\n", modname, dlerror ());
+ exit (1);
+ }
+
+ fp = dlsym (h, "test");
+ if (fp == NULL)
+ {
+ printf ("cannot get symbol 'test': %s\n", dlerror ());
+ exit (1);
+ }
+
+ if (fp () != 0)
+ {
+ puts ("test () != 0");
+ exit (1);
+ }
+
+ dlclose (h);
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/x86/tst-cet-legacy-4a.c b/sysdeps/x86/tst-cet-legacy-4a.c
new file mode 100644
index 0000000000..b9bb18c36b
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-4a.c
@@ -0,0 +1 @@
+#include "tst-cet-legacy-4.c"
diff --git a/sysdeps/x86/tst-cet-legacy-4b.c b/sysdeps/x86/tst-cet-legacy-4b.c
new file mode 100644
index 0000000000..b9bb18c36b
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-4b.c
@@ -0,0 +1 @@
+#include "tst-cet-legacy-4.c"
diff --git a/sysdeps/x86/tst-cet-legacy-4c.c b/sysdeps/x86/tst-cet-legacy-4c.c
new file mode 100644
index 0000000000..b9bb18c36b
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-4c.c
@@ -0,0 +1 @@
+#include "tst-cet-legacy-4.c"
diff --git a/sysdeps/x86/tst-cet-legacy-mod-1.c b/sysdeps/x86/tst-cet-legacy-mod-1.c
new file mode 100644
index 0000000000..09762bce13
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-mod-1.c
@@ -0,0 +1,24 @@
+/* Check compatibility of CET-enabled executable with legacy shared
+ object.
+ Copyright (C) 2018 Free Software 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/>. */
+
+int
+in_dso_1 (void)
+{
+ return 0x1234678;
+}
diff --git a/sysdeps/x86/tst-cet-legacy-mod-2.c b/sysdeps/x86/tst-cet-legacy-mod-2.c
new file mode 100644
index 0000000000..1c8de443f6
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-mod-2.c
@@ -0,0 +1,24 @@
+/* Check compatibility of CET-enabled executable with legacy shared
+ object.
+ Copyright (C) 2018 Free Software 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/>. */
+
+int
+in_dso_2 (void)
+{
+ return 0xbadbeef;
+}
diff --git a/sysdeps/x86/tst-cet-legacy-mod-4.c b/sysdeps/x86/tst-cet-legacy-mod-4.c
new file mode 100644
index 0000000000..a93c2fe4a7
--- /dev/null
+++ b/sysdeps/x86/tst-cet-legacy-mod-4.c
@@ -0,0 +1,2 @@
+#define TEST_MODULE
+#include "tst-cet-legacy-3.c"
diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c
index da20063a00..b2fac197da 100644
--- a/sysdeps/x86/tst-get-cpu-features.c
+++ b/sysdeps/x86/tst-get-cpu-features.c
@@ -1,5 +1,5 @@
/* Test case for x86 __get_cpu_features interface
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/Implies b/sysdeps/x86_64/Implies
index 811c19a8f2..3d7ded70d2 100644
--- a/sysdeps/x86_64/Implies
+++ b/sysdeps/x86_64/Implies
@@ -1,4 +1,5 @@
x86
+ieee754/float128
ieee754/ldbl-96
ieee754/dbl-64/wordsize-64
ieee754/dbl-64
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index 67ed5ba213..9f1562f1b2 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -7,6 +7,10 @@ endif
ifeq ($(subdir),gmon)
sysdep_routines += _mcount
+# We cannot compile _mcount.S with -pg because that would create
+# recursive calls when ENTRY is used. Just copy the normal static
+# object.
+sysdep_noprof += _mcount
endif
ifeq ($(subdir),malloc)
@@ -23,7 +27,7 @@ ifeq ($(subdir),elf)
CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
-mno-mmx)
-sysdep-dl-routines += tlsdesc dl-tlsdesc
+sysdep-dl-routines += tlsdesc dl-tlsdesc tls_get_addr
tests += ifuncmain8
modules-names += ifuncmod8
@@ -39,28 +43,66 @@ $(objpfx)tst-quad2: $(objpfx)tst-quadmod2.so
quad-pie-test += tst-quad1pie tst-quad2pie
tests += $(quad-pie-test)
tests-pie += $(quad-pie-test)
+test-extras += tst-quadmod1pie tst-quadmod2pie
+extra-test-objs += tst-quadmod1pie.o tst-quadmod2pie.o
$(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o
$(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
-tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 tst-audit10
+CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
+CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
+tests += tst-x86_64-1
+modules-names += x86_64/tst-x86_64mod-1
+LDFLAGS-tst-x86_64mod-1.so = -Wl,-soname,tst-x86_64mod-1.so
+ifneq (no,$(have-tunables))
+# Test the state size for XSAVE when XSAVEC is disabled.
+tst-x86_64-1-ENV = GLIBC_TUNABLES=glibc.tune.hwcaps=-XSAVEC_Usable
+endif
+
+$(objpfx)tst-x86_64-1: $(objpfx)x86_64/tst-x86_64mod-1.so
+
+ifneq (no,$(have-tunables))
+tests += tst-platform-1
+modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
+CFLAGS-tst-platform-1.c = -mno-avx
+CFLAGS-tst-platformmod-1.c = -mno-avx
+CFLAGS-tst-platformmod-2.c = -mno-avx
+LDFLAGS-tst-platformmod-2.so = -Wl,-soname,tst-platformmod-2.so
+$(objpfx)tst-platform-1: $(objpfx)tst-platformmod-1.so
+$(objpfx)tst-platform-1.out: $(objpfx)x86_64/tst-platformmod-2.so
+# Turn off AVX512F_Usable and AVX2_Usable so that GLRO(dl_platform) is
+# always set to x86_64.
+tst-platform-1-ENV = LD_PRELOAD=$(objpfx)\$$PLATFORM/tst-platformmod-2.so \
+ GLIBC_TUNABLES=glibc.tune.hwcaps=-AVX512F_Usable,-AVX2_Usable
+endif
+
+tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 \
+ tst-audit10 tst-sse tst-avx tst-avx512
+test-extras += tst-audit4-aux tst-audit10-aux \
+ tst-avx-aux tst-avx512-aux
+extra-test-objs += tst-audit4-aux.o tst-audit10-aux.o \
+ tst-avx-aux.o tst-avx512-aux.o
+
+ifeq ($(have-insert),yes)
tests += tst-split-dynreloc
LDFLAGS-tst-split-dynreloc = -Wl,-T,$(..)sysdeps/x86_64/tst-split-dynreloc.lds
tst-split-dynreloc-ENV = LD_BIND_NOW=1
+endif
modules-names += tst-auditmod3a tst-auditmod3b \
tst-auditmod4a tst-auditmod4b \
tst-auditmod5a tst-auditmod5b \
tst-auditmod6a tst-auditmod6b tst-auditmod6c \
tst-auditmod7a tst-auditmod7b \
- tst-auditmod10a tst-auditmod10b
+ tst-auditmod10a tst-auditmod10b \
+ tst-ssemod tst-avxmod tst-avx512mod
$(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so
$(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so
tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so
-$(objpfx)tst-audit4: $(objpfx)tst-auditmod4a.so
+$(objpfx)tst-audit4: $(objpfx)tst-audit4-aux.o $(objpfx)tst-auditmod4a.so
$(objpfx)tst-audit4.out: $(objpfx)tst-auditmod4b.so
tst-audit4-ENV = LD_AUDIT=$(objpfx)tst-auditmod4b.so
@@ -77,25 +119,49 @@ $(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so
$(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so
tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so
-$(objpfx)tst-audit10: $(objpfx)tst-auditmod10a.so
+$(objpfx)tst-audit10: $(objpfx)tst-audit10-aux.o $(objpfx)tst-auditmod10a.so
$(objpfx)tst-audit10.out: $(objpfx)tst-auditmod10b.so
tst-audit10-ENV = LD_AUDIT=$(objpfx)tst-auditmod10b.so
+$(objpfx)tst-sse: $(objpfx)tst-ssemod.so
+$(objpfx)tst-avx: $(objpfx)tst-avx-aux.o $(objpfx)tst-avxmod.so
+$(objpfx)tst-avx512: $(objpfx)tst-avx512-aux.o $(objpfx)tst-avx512mod.so
+
AVX-CFLAGS=-mavx -mno-vzeroupper
-CFLAGS-tst-audit4.c += $(AVX-CFLAGS)
+CFLAGS-tst-audit4-aux.c += $(AVX-CFLAGS)
CFLAGS-tst-auditmod4a.c += $(AVX-CFLAGS)
CFLAGS-tst-auditmod4b.c += $(AVX-CFLAGS)
CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS)
CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
+CFLAGS-tst-avx-aux.c += $(AVX-CFLAGS)
+CFLAGS-tst-avxmod.c += $(AVX-CFLAGS)
ifeq (yes,$(config-cflags-avx512))
AVX512-CFLAGS = -mavx512f
-CFLAGS-tst-audit10.c += $(AVX512-CFLAGS)
+CFLAGS-tst-audit10-aux.c += $(AVX512-CFLAGS)
CFLAGS-tst-auditmod10a.c += $(AVX512-CFLAGS)
CFLAGS-tst-auditmod10b.c += $(AVX512-CFLAGS)
+CFLAGS-tst-avx512-aux.c += $(AVX512-CFLAGS)
+CFLAGS-tst-avx512mod.c += $(AVX512-CFLAGS)
endif
endif
ifeq ($(subdir),csu)
-gen-as-const-headers += tlsdesc.sym
+gen-as-const-headers += tlsdesc.sym rtld-offsets.sym
endif
+
+$(objpfx)x86_64/tst-x86_64mod-1.os: $(objpfx)tst-x86_64mod-1.os
+ $(make-target-directory)
+ rm -f $@
+ ln $< $@
+
+do-tests-clean common-mostlyclean: tst-x86_64-1-clean
+
+.PHONY: tst-x86_64-1-clean
+tst-x86_64-1-clean:
+ -rm -rf $(objpfx)x86_64
+
+$(objpfx)x86_64/tst-platformmod-2.os: $(objpfx)tst-platformmod-2.os
+ $(make-target-directory)
+ rm -f $@
+ ln $< $@
diff --git a/sysdeps/x86_64/__longjmp.S b/sysdeps/x86_64/__longjmp.S
index c164626577..d7d123e4bc 100644
--- a/sysdeps/x86_64/__longjmp.S
+++ b/sysdeps/x86_64/__longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software 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,9 +17,18 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
+#include <jmp_buf-ssp.h>
#include <asm-syntax.h>
#include <stap-probe.h>
+/* Don't restore shadow stack register if
+ 1. Shadow stack isn't enabled. Or
+ 2. __longjmp is defined for __longjmp_cancel.
+ */
+#if !SHSTK_ENABLED || defined __longjmp
+# undef SHADOW_STACK_POINTER_OFFSET
+#endif
+
/* Jump to the position specified by ENV, causing the
setjmp call there to return VAL, or 1 if VAL is 0.
void __longjmp (__jmp_buf env, int val). */
@@ -42,6 +51,41 @@ ENTRY(__longjmp)
orq %rax, %r9
# endif
#endif
+#ifdef SHADOW_STACK_POINTER_OFFSET
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+ /* Check if Shadow Stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %fs:FEATURE_1_OFFSET
+ jz L(skip_ssp)
+# else
+ xorl %eax, %eax
+# endif
+ /* Check and adjust the Shadow-Stack-Pointer. */
+ /* Get the current ssp. */
+ rdsspq %rax
+ /* And compare it with the saved ssp value. */
+ subq SHADOW_STACK_POINTER_OFFSET(%rdi), %rax
+ je L(skip_ssp)
+ /* Count the number of frames to adjust and adjust it
+ with incssp instruction. The instruction can adjust
+ the ssp by [0..255] value only thus use a loop if
+ the number of frames is bigger than 255. */
+ negq %rax
+ shrq $3, %rax
+ /* NB: We saved Shadow-Stack-Pointer of setjmp. Since we are
+ restoring Shadow-Stack-Pointer of setjmp's caller, we
+ need to unwind shadow stack by one more frame. */
+ addq $1, %rax
+
+ movl $255, %ebx
+L(loop):
+ cmpq %rbx, %rax
+ cmovb %rax, %rbx
+ incsspq %rbx
+ subq %rbx, %rax
+ ja L(loop)
+
+L(skip_ssp):
+#endif
LIBC_PROBE (longjmp, 3, LP_SIZE@%RDI_LP, -4@%esi, LP_SIZE@%RDX_LP)
/* We add unwind information for the target here. */
cfi_def_cfa(%rdi, 0)
diff --git a/sysdeps/x86_64/_mcount.S b/sysdeps/x86_64/_mcount.S
index 5d7edd2a29..a2f4068b61 100644
--- a/sysdeps/x86_64/_mcount.S
+++ b/sysdeps/x86_64/_mcount.S
@@ -1,5 +1,5 @@
/* Machine-specific calling sequence for `mcount' profiling function. x86-64 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Andreas Jaeger <aj@suse.de>.
This file is part of the GNU C Library.
@@ -24,81 +24,102 @@
#include <sysdep.h>
- .globl C_SYMBOL_NAME(_mcount)
- .type C_SYMBOL_NAME(_mcount), @function
- .align ALIGNARG(4)
-C_LABEL(_mcount)
+ENTRY(_mcount)
/* Allocate space for 7 registers. */
subq $56,%rsp
+ cfi_adjust_cfa_offset (56)
movq %rax,(%rsp)
+ cfi_rel_offset (rax, 0)
movq %rcx,8(%rsp)
+ cfi_rel_offset (rcx, 8)
movq %rdx,16(%rsp)
+ cfi_rel_offset (rdx, 16)
movq %rsi,24(%rsp)
+ cfi_rel_offset (rsi, 24)
movq %rdi,32(%rsp)
+ cfi_rel_offset (rdi, 32)
movq %r8,40(%rsp)
+ cfi_rel_offset (r8, 40)
movq %r9,48(%rsp)
+ cfi_rel_offset (r9, 48)
/* Setup parameter for __mcount_internal. */
/* selfpc is the return address on the stack. */
movq 56(%rsp),%rsi
/* Get frompc via the frame pointer. */
movq 8(%rbp),%rdi
-#ifdef PIC
- call C_SYMBOL_NAME(__mcount_internal)@PLT
-#else
call C_SYMBOL_NAME(__mcount_internal)
-#endif
/* Pop the saved registers. Please note that `mcount' has no
return value. */
movq 48(%rsp),%r9
+ cfi_restore (r9)
movq 40(%rsp),%r8
+ cfi_restore (r8)
movq 32(%rsp),%rdi
+ cfi_restore (rdi)
movq 24(%rsp),%rsi
+ cfi_restore (rsi)
movq 16(%rsp),%rdx
+ cfi_restore (rdx)
movq 8(%rsp),%rcx
+ cfi_restore (rcx)
movq (%rsp),%rax
+ cfi_restore (rax)
addq $56,%rsp
+ cfi_adjust_cfa_offset (-56)
ret
-
- ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
+END(_mcount)
#undef mcount
weak_alias (_mcount, mcount)
- .globl C_SYMBOL_NAME(__fentry__)
- .type C_SYMBOL_NAME(__fentry__), @function
- .align ALIGNARG(4)
-C_LABEL(__fentry__)
- /* Allocate space for 7 registers. */
+/* __fentry__ is different from _mcount in that it is called before
+ function prolog. This means (among other things) that it has non-standard
+ stack alignment on entry: (%RSP & 0xF) == 0. */
+
+ENTRY(__fentry__)
+ /* Allocate space for 7 registers
+ (+8 bytes for proper stack alignment). */
subq $64,%rsp
+ cfi_adjust_cfa_offset (64)
movq %rax,(%rsp)
+ cfi_rel_offset (rax, 0)
movq %rcx,8(%rsp)
+ cfi_rel_offset (rcx, 8)
movq %rdx,16(%rsp)
+ cfi_rel_offset (rdx, 16)
movq %rsi,24(%rsp)
+ cfi_rel_offset (rsi, 24)
movq %rdi,32(%rsp)
+ cfi_rel_offset (rdi, 32)
movq %r8,40(%rsp)
+ cfi_rel_offset (r8, 40)
movq %r9,48(%rsp)
+ cfi_rel_offset (r9, 48)
/* Setup parameter for __mcount_internal. */
/* selfpc is the return address on the stack. */
movq 64(%rsp),%rsi
/* caller is the return address above it */
movq 72(%rsp),%rdi
-#ifdef PIC
- call C_SYMBOL_NAME(__mcount_internal)@PLT
-#else
call C_SYMBOL_NAME(__mcount_internal)
-#endif
/* Pop the saved registers. Please note that `__fentry__' has no
return value. */
movq 48(%rsp),%r9
+ cfi_restore (r9)
movq 40(%rsp),%r8
+ cfi_restore (r8)
movq 32(%rsp),%rdi
+ cfi_restore (rdi)
movq 24(%rsp),%rsi
+ cfi_restore (rsi)
movq 16(%rsp),%rdx
+ cfi_restore (rdx)
movq 8(%rsp),%rcx
+ cfi_restore (rcx)
movq (%rsp),%rax
+ cfi_restore (rax)
addq $64,%rsp
+ cfi_adjust_cfa_offset (-64)
ret
-
- ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(__fentry__))
+END(__fentry__)
diff --git a/sysdeps/x86_64/add_n.S b/sysdeps/x86_64/add_n.S
index fc99811476..ba9699a2f0 100644
--- a/sysdeps/x86_64/add_n.S
+++ b/sysdeps/x86_64/add_n.S
@@ -1,6 +1,6 @@
/* x86-64 __mpn_add_n -- Add two limb vectors of the same length > 0 and store
sum in a third limb vector.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/x86_64/addmul_1.S b/sysdeps/x86_64/addmul_1.S
index ab7c2fa701..eefe8004b0 100644
--- a/sysdeps/x86_64/addmul_1.S
+++ b/sysdeps/x86_64/addmul_1.S
@@ -1,6 +1,6 @@
/* x86-64 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
the result to a second limb vector.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/x86_64/atomic-machine.h b/sysdeps/x86_64/atomic-machine.h
index a5b86eb3ce..9d31c64962 100644
--- a/sysdeps/x86_64/atomic-machine.h
+++ b/sysdeps/x86_64/atomic-machine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -16,10 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <stdint.h>
-#include <tls.h> /* For tcbhead_t. */
-#include <libc-internal.h>
+#ifndef _X86_64_ATOMIC_MACHINE_H
+#define _X86_64_ATOMIC_MACHINE_H 1
+#include <stdint.h>
+#include <tls.h> /* For tcbhead_t. */
+#include <libc-pointer-arith.h> /* For cast_to_integer. */
typedef int8_t atomic8_t;
typedef uint8_t uatomic8_t;
@@ -57,6 +59,7 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 1
#define USE_ATOMIC_COMPILER_BUILTINS 1
+#define ATOMIC_EXCHANGE_USES_CAS 0
#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
__sync_val_compare_and_swap (mem, oldval, newval)
@@ -475,3 +478,5 @@ typedef uintmax_t uatomic_max_t;
__asm __volatile (LOCK_PREFIX "orl $0, (%%rsp)" ::: "memory")
#define atomic_read_barrier() __asm ("" ::: "memory")
#define atomic_write_barrier() __asm ("" ::: "memory")
+
+#endif /* atomic-machine.h */
diff --git a/sysdeps/x86_64/backtrace.c b/sysdeps/x86_64/backtrace.c
deleted file mode 100644
index e04407c516..0000000000
--- a/sysdeps/x86_64/backtrace.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Return backtrace of current program state.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.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 <libc-lock.h>
-#include <dlfcn.h>
-#include <execinfo.h>
-#include <stdlib.h>
-#include <unwind.h>
-
-struct trace_arg
-{
- void **array;
- _Unwind_Word cfa;
- int cnt;
- int size;
-};
-
-#ifdef SHARED
-static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *);
-static _Unwind_Ptr (*unwind_getip) (struct _Unwind_Context *);
-static _Unwind_Word (*unwind_getcfa) (struct _Unwind_Context *);
-static void *libgcc_handle;
-
-
-/* Dummy version in case libgcc_s does not contain the real code. */
-static _Unwind_Word
-dummy_getcfa (struct _Unwind_Context *ctx __attribute__ ((unused)))
-{
- return 0;
-}
-
-
-static void
-init (void)
-{
- libgcc_handle = __libc_dlopen ("libgcc_s.so.1");
-
- if (libgcc_handle == NULL)
- return;
-
- unwind_backtrace = __libc_dlsym (libgcc_handle, "_Unwind_Backtrace");
- unwind_getip = __libc_dlsym (libgcc_handle, "_Unwind_GetIP");
- if (unwind_getip == NULL)
- unwind_backtrace = NULL;
- unwind_getcfa = (__libc_dlsym (libgcc_handle, "_Unwind_GetCFA")
- ?: dummy_getcfa);
-}
-#else
-# define unwind_backtrace _Unwind_Backtrace
-# define unwind_getip _Unwind_GetIP
-# define unwind_getcfa _Unwind_GetCFA
-#endif
-
-static _Unwind_Reason_Code
-backtrace_helper (struct _Unwind_Context *ctx, void *a)
-{
- struct trace_arg *arg = a;
-
- /* We are first called with address in the __backtrace function.
- Skip it. */
- if (arg->cnt != -1)
- {
- arg->array[arg->cnt] = (void *) unwind_getip (ctx);
-
- /* Check whether we make any progress. */
- _Unwind_Word cfa = unwind_getcfa (ctx);
-
- if (arg->cnt > 0 && arg->array[arg->cnt - 1] == arg->array[arg->cnt]
- && cfa == arg->cfa)
- return _URC_END_OF_STACK;
- arg->cfa = cfa;
- }
- if (++arg->cnt == arg->size)
- return _URC_END_OF_STACK;
- return _URC_NO_REASON;
-}
-
-int
-__backtrace (void **array, int size)
-{
- struct trace_arg arg = { .array = array, .cfa = 0, .size = size, .cnt = -1 };
-
- if (size <= 0)
- return 0;
-
-#ifdef SHARED
- __libc_once_define (static, once);
-
- __libc_once (once, init);
- if (unwind_backtrace == NULL)
- return 0;
-#endif
-
- unwind_backtrace (backtrace_helper, &arg);
-
- /* _Unwind_Backtrace seems to put NULL address above
- _start. Fix it up here. */
- if (arg.cnt > 1 && arg.array[arg.cnt - 1] == NULL)
- --arg.cnt;
- return arg.cnt != -1 ? arg.cnt : 0;
-}
-weak_alias (__backtrace, backtrace)
-libc_hidden_def (__backtrace)
-
-
-#ifdef SHARED
-/* Free all resources if necessary. */
-libc_freeres_fn (free_mem)
-{
- unwind_backtrace = NULL;
- if (libgcc_handle != NULL)
- {
- __libc_dlclose (libgcc_handle);
- libgcc_handle = NULL;
- }
-}
-#endif
diff --git a/sysdeps/x86_64/bsd-_setjmp.S b/sysdeps/x86_64/bsd-_setjmp.S
index 1a2a94f1a6..58c997de59 100644
--- a/sysdeps/x86_64/bsd-_setjmp.S
+++ b/sysdeps/x86_64/bsd-_setjmp.S
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. x86-64 version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/bsd-setjmp.S b/sysdeps/x86_64/bsd-setjmp.S
index 11d9d8daa0..8e3c430dac 100644
--- a/sysdeps/x86_64/bsd-setjmp.S
+++ b/sysdeps/x86_64/bsd-setjmp.S
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. x86-64 version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/cacheinfo.c b/sysdeps/x86_64/cacheinfo.c
deleted file mode 100644
index 96463df064..0000000000
--- a/sysdeps/x86_64/cacheinfo.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/* x86_64 cache info.
- 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 <assert.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <cpuid.h>
-#include <init-arch.h>
-
-#define is_intel GLRO(dl_x86_cpu_features).kind == arch_kind_intel
-#define is_amd GLRO(dl_x86_cpu_features).kind == arch_kind_amd
-#define max_cpuid GLRO(dl_x86_cpu_features).max_cpuid
-
-static const struct intel_02_cache_info
-{
- unsigned char idx;
- unsigned char assoc;
- unsigned char linesize;
- unsigned char rel_name;
- unsigned int size;
-} intel_02_known [] =
- {
-#define M(sc) ((sc) - _SC_LEVEL1_ICACHE_SIZE)
- { 0x06, 4, 32, M(_SC_LEVEL1_ICACHE_SIZE), 8192 },
- { 0x08, 4, 32, M(_SC_LEVEL1_ICACHE_SIZE), 16384 },
- { 0x09, 4, 32, M(_SC_LEVEL1_ICACHE_SIZE), 32768 },
- { 0x0a, 2, 32, M(_SC_LEVEL1_DCACHE_SIZE), 8192 },
- { 0x0c, 4, 32, M(_SC_LEVEL1_DCACHE_SIZE), 16384 },
- { 0x0d, 4, 64, M(_SC_LEVEL1_DCACHE_SIZE), 16384 },
- { 0x0e, 6, 64, M(_SC_LEVEL1_DCACHE_SIZE), 24576 },
- { 0x21, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
- { 0x22, 4, 64, M(_SC_LEVEL3_CACHE_SIZE), 524288 },
- { 0x23, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 1048576 },
- { 0x25, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
- { 0x29, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
- { 0x2c, 8, 64, M(_SC_LEVEL1_DCACHE_SIZE), 32768 },
- { 0x30, 8, 64, M(_SC_LEVEL1_ICACHE_SIZE), 32768 },
- { 0x39, 4, 64, M(_SC_LEVEL2_CACHE_SIZE), 131072 },
- { 0x3a, 6, 64, M(_SC_LEVEL2_CACHE_SIZE), 196608 },
- { 0x3b, 2, 64, M(_SC_LEVEL2_CACHE_SIZE), 131072 },
- { 0x3c, 4, 64, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
- { 0x3d, 6, 64, M(_SC_LEVEL2_CACHE_SIZE), 393216 },
- { 0x3e, 4, 64, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
- { 0x3f, 2, 64, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
- { 0x41, 4, 32, M(_SC_LEVEL2_CACHE_SIZE), 131072 },
- { 0x42, 4, 32, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
- { 0x43, 4, 32, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
- { 0x44, 4, 32, M(_SC_LEVEL2_CACHE_SIZE), 1048576 },
- { 0x45, 4, 32, M(_SC_LEVEL2_CACHE_SIZE), 2097152 },
- { 0x46, 4, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
- { 0x47, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
- { 0x48, 12, 64, M(_SC_LEVEL2_CACHE_SIZE), 3145728 },
- { 0x49, 16, 64, M(_SC_LEVEL2_CACHE_SIZE), 4194304 },
- { 0x4a, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 6291456 },
- { 0x4b, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
- { 0x4c, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
- { 0x4d, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 16777216 },
- { 0x4e, 24, 64, M(_SC_LEVEL2_CACHE_SIZE), 6291456 },
- { 0x60, 8, 64, M(_SC_LEVEL1_DCACHE_SIZE), 16384 },
- { 0x66, 4, 64, M(_SC_LEVEL1_DCACHE_SIZE), 8192 },
- { 0x67, 4, 64, M(_SC_LEVEL1_DCACHE_SIZE), 16384 },
- { 0x68, 4, 64, M(_SC_LEVEL1_DCACHE_SIZE), 32768 },
- { 0x78, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 1048576 },
- { 0x79, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 131072 },
- { 0x7a, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
- { 0x7b, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
- { 0x7c, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 1048576 },
- { 0x7d, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 2097152 },
- { 0x7f, 2, 64, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
- { 0x80, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
- { 0x82, 8, 32, M(_SC_LEVEL2_CACHE_SIZE), 262144 },
- { 0x83, 8, 32, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
- { 0x84, 8, 32, M(_SC_LEVEL2_CACHE_SIZE), 1048576 },
- { 0x85, 8, 32, M(_SC_LEVEL2_CACHE_SIZE), 2097152 },
- { 0x86, 4, 64, M(_SC_LEVEL2_CACHE_SIZE), 524288 },
- { 0x87, 8, 64, M(_SC_LEVEL2_CACHE_SIZE), 1048576 },
- { 0xd0, 4, 64, M(_SC_LEVEL3_CACHE_SIZE), 524288 },
- { 0xd1, 4, 64, M(_SC_LEVEL3_CACHE_SIZE), 1048576 },
- { 0xd2, 4, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
- { 0xd6, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 1048576 },
- { 0xd7, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
- { 0xd8, 8, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
- { 0xdc, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
- { 0xdd, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
- { 0xde, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
- { 0xe2, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
- { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
- { 0xe4, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
- { 0xea, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
- { 0xeb, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 18874368 },
- { 0xec, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 25165824 },
- };
-
-#define nintel_02_known (sizeof (intel_02_known) / sizeof (intel_02_known [0]))
-
-static int
-intel_02_known_compare (const void *p1, const void *p2)
-{
- const struct intel_02_cache_info *i1;
- const struct intel_02_cache_info *i2;
-
- i1 = (const struct intel_02_cache_info *) p1;
- i2 = (const struct intel_02_cache_info *) p2;
-
- if (i1->idx == i2->idx)
- return 0;
-
- return i1->idx < i2->idx ? -1 : 1;
-}
-
-
-static long int
-__attribute__ ((noinline))
-intel_check_word (int name, unsigned int value, bool *has_level_2,
- bool *no_level_2_or_3)
-{
- if ((value & 0x80000000) != 0)
- /* The register value is reserved. */
- return 0;
-
- /* Fold the name. The _SC_ constants are always in the order SIZE,
- ASSOC, LINESIZE. */
- int folded_rel_name = (M(name) / 3) * 3;
-
- while (value != 0)
- {
- unsigned int byte = value & 0xff;
-
- if (byte == 0x40)
- {
- *no_level_2_or_3 = true;
-
- if (folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE))
- /* No need to look further. */
- break;
- }
- else if (byte == 0xff)
- {
- /* CPUID leaf 0x4 contains all the information. We need to
- iterate over it. */
- unsigned int eax;
- unsigned int ebx;
- unsigned int ecx;
- unsigned int edx;
-
- unsigned int round = 0;
- while (1)
- {
- __cpuid_count (4, round, eax, ebx, ecx, edx);
-
- enum { null = 0, data = 1, inst = 2, uni = 3 } type = eax & 0x1f;
- if (type == null)
- /* That was the end. */
- break;
-
- unsigned int level = (eax >> 5) & 0x7;
-
- if ((level == 1 && type == data
- && folded_rel_name == M(_SC_LEVEL1_DCACHE_SIZE))
- || (level == 1 && type == inst
- && folded_rel_name == M(_SC_LEVEL1_ICACHE_SIZE))
- || (level == 2 && folded_rel_name == M(_SC_LEVEL2_CACHE_SIZE))
- || (level == 3 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE))
- || (level == 4 && folded_rel_name == M(_SC_LEVEL4_CACHE_SIZE)))
- {
- unsigned int offset = M(name) - folded_rel_name;
-
- if (offset == 0)
- /* Cache size. */
- return (((ebx >> 22) + 1)
- * (((ebx >> 12) & 0x3ff) + 1)
- * ((ebx & 0xfff) + 1)
- * (ecx + 1));
- if (offset == 1)
- return (ebx >> 22) + 1;
-
- assert (offset == 2);
- return (ebx & 0xfff) + 1;
- }
-
- ++round;
- }
- /* There is no other cache information anywhere else. */
- break;
- }
- else
- {
- if (byte == 0x49 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE))
- {
- /* Intel reused this value. For family 15, model 6 it
- specifies the 3rd level cache. Otherwise the 2nd
- level cache. */
- unsigned int family = GLRO(dl_x86_cpu_features).family;
- unsigned int model = GLRO(dl_x86_cpu_features).model;
-
- if (family == 15 && model == 6)
- {
- /* The level 3 cache is encoded for this model like
- the level 2 cache is for other models. Pretend
- the caller asked for the level 2 cache. */
- name = (_SC_LEVEL2_CACHE_SIZE
- + (name - _SC_LEVEL3_CACHE_SIZE));
- folded_rel_name = M(_SC_LEVEL2_CACHE_SIZE);
- }
- }
-
- struct intel_02_cache_info *found;
- struct intel_02_cache_info search;
-
- search.idx = byte;
- found = bsearch (&search, intel_02_known, nintel_02_known,
- sizeof (intel_02_known[0]), intel_02_known_compare);
- if (found != NULL)
- {
- if (found->rel_name == folded_rel_name)
- {
- unsigned int offset = M(name) - folded_rel_name;
-
- if (offset == 0)
- /* Cache size. */
- return found->size;
- if (offset == 1)
- return found->assoc;
-
- assert (offset == 2);
- return found->linesize;
- }
-
- if (found->rel_name == M(_SC_LEVEL2_CACHE_SIZE))
- *has_level_2 = true;
- }
- }
-
- /* Next byte for the next round. */
- value >>= 8;
- }
-
- /* Nothing found. */
- return 0;
-}
-
-
-static long int __attribute__ ((noinline))
-handle_intel (int name, unsigned int maxidx)
-{
- assert (maxidx >= 2);
-
- /* OK, we can use the CPUID instruction to get all info about the
- caches. */
- unsigned int cnt = 0;
- unsigned int max = 1;
- long int result = 0;
- bool no_level_2_or_3 = false;
- bool has_level_2 = false;
-
- while (cnt++ < max)
- {
- unsigned int eax;
- unsigned int ebx;
- unsigned int ecx;
- unsigned int edx;
- __cpuid (2, eax, ebx, ecx, edx);
-
- /* The low byte of EAX in the first round contain the number of
- rounds we have to make. At least one, the one we are already
- doing. */
- if (cnt == 1)
- {
- max = eax & 0xff;
- eax &= 0xffffff00;
- }
-
- /* Process the individual registers' value. */
- result = intel_check_word (name, eax, &has_level_2, &no_level_2_or_3);
- if (result != 0)
- return result;
-
- result = intel_check_word (name, ebx, &has_level_2, &no_level_2_or_3);
- if (result != 0)
- return result;
-
- result = intel_check_word (name, ecx, &has_level_2, &no_level_2_or_3);
- if (result != 0)
- return result;
-
- result = intel_check_word (name, edx, &has_level_2, &no_level_2_or_3);
- if (result != 0)
- return result;
- }
-
- if (name >= _SC_LEVEL2_CACHE_SIZE && name <= _SC_LEVEL3_CACHE_LINESIZE
- && no_level_2_or_3)
- return -1;
-
- return 0;
-}
-
-
-static long int __attribute__ ((noinline))
-handle_amd (int name)
-{
- unsigned int eax;
- unsigned int ebx;
- unsigned int ecx;
- unsigned int edx;
- __cpuid (0x80000000, eax, ebx, ecx, edx);
-
- /* No level 4 cache (yet). */
- if (name > _SC_LEVEL3_CACHE_LINESIZE)
- return 0;
-
- unsigned int fn = 0x80000005 + (name >= _SC_LEVEL2_CACHE_SIZE);
- if (eax < fn)
- return 0;
-
- __cpuid (fn, eax, ebx, ecx, edx);
-
- if (name < _SC_LEVEL1_DCACHE_SIZE)
- {
- name += _SC_LEVEL1_DCACHE_SIZE - _SC_LEVEL1_ICACHE_SIZE;
- ecx = edx;
- }
-
- switch (name)
- {
- case _SC_LEVEL1_DCACHE_SIZE:
- return (ecx >> 14) & 0x3fc00;
-
- case _SC_LEVEL1_DCACHE_ASSOC:
- ecx >>= 16;
- if ((ecx & 0xff) == 0xff)
- /* Fully associative. */
- return (ecx << 2) & 0x3fc00;
- return ecx & 0xff;
-
- case _SC_LEVEL1_DCACHE_LINESIZE:
- return ecx & 0xff;
-
- case _SC_LEVEL2_CACHE_SIZE:
- return (ecx & 0xf000) == 0 ? 0 : (ecx >> 6) & 0x3fffc00;
-
- case _SC_LEVEL2_CACHE_ASSOC:
- switch ((ecx >> 12) & 0xf)
- {
- case 0:
- case 1:
- case 2:
- case 4:
- return (ecx >> 12) & 0xf;
- case 6:
- return 8;
- case 8:
- return 16;
- case 10:
- return 32;
- case 11:
- return 48;
- case 12:
- return 64;
- case 13:
- return 96;
- case 14:
- return 128;
- case 15:
- return ((ecx >> 6) & 0x3fffc00) / (ecx & 0xff);
- default:
- return 0;
- }
- /* NOTREACHED */
-
- case _SC_LEVEL2_CACHE_LINESIZE:
- return (ecx & 0xf000) == 0 ? 0 : ecx & 0xff;
-
- case _SC_LEVEL3_CACHE_SIZE:
- return (edx & 0xf000) == 0 ? 0 : (edx & 0x3ffc0000) << 1;
-
- case _SC_LEVEL3_CACHE_ASSOC:
- switch ((edx >> 12) & 0xf)
- {
- case 0:
- case 1:
- case 2:
- case 4:
- return (edx >> 12) & 0xf;
- case 6:
- return 8;
- case 8:
- return 16;
- case 10:
- return 32;
- case 11:
- return 48;
- case 12:
- return 64;
- case 13:
- return 96;
- case 14:
- return 128;
- case 15:
- return ((edx & 0x3ffc0000) << 1) / (edx & 0xff);
- default:
- return 0;
- }
- /* NOTREACHED */
-
- case _SC_LEVEL3_CACHE_LINESIZE:
- return (edx & 0xf000) == 0 ? 0 : edx & 0xff;
-
- default:
- assert (! "cannot happen");
- }
- return -1;
-}
-
-
-/* Get the value of the system variable NAME. */
-long int
-attribute_hidden
-__cache_sysconf (int name)
-{
- if (is_intel)
- return handle_intel (name, max_cpuid);
-
- if (is_amd)
- return handle_amd (name);
-
- // XXX Fill in more vendors.
-
- /* CPU not known, we have no information. */
- return 0;
-}
-
-
-/* Data cache size for use in memory and string routines, typically
- L1 size, rounded to multiple of 256 bytes. */
-long int __x86_data_cache_size_half attribute_hidden = 32 * 1024 / 2;
-long int __x86_data_cache_size attribute_hidden = 32 * 1024;
-/* Similar to __x86_data_cache_size_half, but not rounded. */
-long int __x86_raw_data_cache_size_half attribute_hidden = 32 * 1024 / 2;
-/* Similar to __x86_data_cache_size, but not rounded. */
-long int __x86_raw_data_cache_size attribute_hidden = 32 * 1024;
-/* Shared cache size for use in memory and string routines, typically
- L2 or L3 size, rounded to multiple of 256 bytes. */
-long int __x86_shared_cache_size_half attribute_hidden = 1024 * 1024 / 2;
-long int __x86_shared_cache_size attribute_hidden = 1024 * 1024;
-/* Similar to __x86_shared_cache_size_half, but not rounded. */
-long int __x86_raw_shared_cache_size_half attribute_hidden = 1024 * 1024 / 2;
-/* Similar to __x86_shared_cache_size, but not rounded. */
-long int __x86_raw_shared_cache_size attribute_hidden = 1024 * 1024;
-
-#ifndef DISABLE_PREFETCHW
-/* PREFETCHW support flag for use in memory and string routines. */
-int __x86_prefetchw attribute_hidden;
-#endif
-
-
-static void
-__attribute__((constructor))
-init_cacheinfo (void)
-{
- /* Find out what brand of processor. */
- unsigned int eax;
- unsigned int ebx;
- unsigned int ecx;
- unsigned int edx;
- int max_cpuid_ex;
- long int data = -1;
- long int shared = -1;
- unsigned int level;
- unsigned int threads = 0;
-
- if (is_intel)
- {
- data = handle_intel (_SC_LEVEL1_DCACHE_SIZE, max_cpuid);
-
- /* Try L3 first. */
- level = 3;
- shared = handle_intel (_SC_LEVEL3_CACHE_SIZE, max_cpuid);
-
- if (shared <= 0)
- {
- /* Try L2 otherwise. */
- level = 2;
- shared = handle_intel (_SC_LEVEL2_CACHE_SIZE, max_cpuid);
- }
-
- /* Figure out the number of logical threads that share the
- highest cache level. */
- if (max_cpuid >= 4)
- {
- unsigned int family = GLRO(dl_x86_cpu_features).family;
- unsigned int model = GLRO(dl_x86_cpu_features).model;
-
- int i = 0;
-
- /* Query until desired cache level is enumerated. */
- do
- {
- __cpuid_count (4, i++, eax, ebx, ecx, edx);
-
- /* There seems to be a bug in at least some Pentium Ds
- which sometimes fail to iterate all cache parameters.
- Do not loop indefinitely here, stop in this case and
- assume there is no such information. */
- if ((eax & 0x1f) == 0)
- goto intel_bug_no_cache_info;
- }
- while (((eax >> 5) & 0x7) != level);
-
- threads = (eax >> 14) & 0x3ff;
-
- /* If max_cpuid >= 11, THREADS is the maximum number of
- addressable IDs for logical processors sharing the
- cache, instead of the maximum number of threads
- sharing the cache. */
- if (threads && max_cpuid >= 11)
- {
- /* Find the number of logical processors shipped in
- one core and apply count mask. */
- i = 0;
- while (1)
- {
- __cpuid_count (11, i++, eax, ebx, ecx, edx);
-
- int shipped = ebx & 0xff;
- int type = ecx & 0xff0;
- if (shipped == 0 || type == 0)
- break;
- else if (type == 0x200)
- {
- int count_mask;
-
- /* Compute count mask. */
- asm ("bsr %1, %0"
- : "=r" (count_mask) : "g" (threads));
- count_mask = ~(-1 << (count_mask + 1));
- threads = (shipped - 1) & count_mask;
- break;
- }
- }
- }
- threads += 1;
- if (threads > 2 && level == 2 && family == 6)
- {
- switch (model)
- {
- case 0x57:
- /* Knights Landing has L2 cache shared by 2 cores. */
- case 0x37:
- case 0x4a:
- case 0x4d:
- case 0x5a:
- case 0x5d:
- /* Silvermont has L2 cache shared by 2 cores. */
- threads = 2;
- break;
- default:
- break;
- }
- }
- }
- else
- {
- intel_bug_no_cache_info:
- /* Assume that all logical threads share the highest cache level. */
-
- threads
- = ((GLRO(dl_x86_cpu_features).cpuid[COMMON_CPUID_INDEX_1].ebx
- >> 16) & 0xff);
- }
-
- /* Cap usage of highest cache level to the number of supported
- threads. */
- if (shared > 0 && threads > 0)
- shared /= threads;
- }
- /* This spells out "AuthenticAMD". */
- else if (is_amd)
- {
- data = handle_amd (_SC_LEVEL1_DCACHE_SIZE);
- long int core = handle_amd (_SC_LEVEL2_CACHE_SIZE);
- shared = handle_amd (_SC_LEVEL3_CACHE_SIZE);
-
- /* Get maximum extended function. */
- __cpuid (0x80000000, max_cpuid_ex, ebx, ecx, edx);
-
- if (shared <= 0)
- /* No shared L3 cache. All we have is the L2 cache. */
- shared = core;
- else
- {
- /* Figure out the number of logical threads that share L3. */
- if (max_cpuid_ex >= 0x80000008)
- {
- /* Get width of APIC ID. */
- __cpuid (0x80000008, max_cpuid_ex, ebx, ecx, edx);
- threads = 1 << ((ecx >> 12) & 0x0f);
- }
-
- if (threads == 0)
- {
- /* If APIC ID width is not available, use logical
- processor count. */
- __cpuid (0x00000001, max_cpuid_ex, ebx, ecx, edx);
-
- if ((edx & (1 << 28)) != 0)
- threads = (ebx >> 16) & 0xff;
- }
-
- /* Cap usage of highest cache level to the number of
- supported threads. */
- if (threads > 0)
- shared /= threads;
-
- /* Account for exclusive L2 and L3 caches. */
- shared += core;
- }
-
-#ifndef DISABLE_PREFETCHW
- if (max_cpuid_ex >= 0x80000001)
- {
- __cpuid (0x80000001, eax, ebx, ecx, edx);
- /* PREFETCHW || 3DNow! */
- if ((ecx & 0x100) || (edx & 0x80000000))
- __x86_prefetchw = -1;
- }
-#endif
- }
-
- if (data > 0)
- {
- __x86_raw_data_cache_size_half = data / 2;
- __x86_raw_data_cache_size = data;
- /* Round data cache size to multiple of 256 bytes. */
- data = data & ~255L;
- __x86_data_cache_size_half = data / 2;
- __x86_data_cache_size = data;
- }
-
- if (shared > 0)
- {
- __x86_raw_shared_cache_size_half = shared / 2;
- __x86_raw_shared_cache_size = shared;
- /* Round shared cache size to multiple of 256 bytes. */
- shared = shared & ~255L;
- __x86_shared_cache_size_half = shared / 2;
- __x86_shared_cache_size = shared;
- }
-}
diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
index c72b9d3184..8674d14569 100644
--- a/sysdeps/x86_64/configure
+++ b/sysdeps/x86_64/configure
@@ -1,13 +1,12 @@
# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/x86_64.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512 support in assembler" >&5
-$as_echo_n "checking for AVX512 support in assembler... " >&6; }
-if ${libc_cv_asm_avx512+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512DQ support in assembler" >&5
+$as_echo_n "checking for AVX512DQ support in assembler... " >&6; }
+if ${libc_cv_asm_avx512dq+:} false; then :
$as_echo_n "(cached) " >&6
else
cat > conftest.s <<\EOF
- vmovdqu64 %zmm0, (%rsp)
vandpd (%rax), %zmm6, %zmm1
EOF
if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5'
@@ -16,16 +15,16 @@ if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5'
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
- libc_cv_asm_avx512=yes
+ libc_cv_asm_avx512dq=yes
else
- libc_cv_asm_avx512=no
+ libc_cv_asm_avx512dq=no
fi
rm -f conftest*
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_avx512" >&5
-$as_echo "$libc_cv_asm_avx512" >&6; }
-if test $libc_cv_asm_avx512 == yes; then
- $as_echo "#define HAVE_AVX512_ASM_SUPPORT 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_avx512dq" >&5
+$as_echo "$libc_cv_asm_avx512dq" >&6; }
+if test $libc_cv_asm_avx512dq = yes; then
+ $as_echo "#define HAVE_AVX512DQ_ASM_SUPPORT 1" >>confdefs.h
fi
@@ -40,7 +39,7 @@ else
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then :
- libc_cv_cc_avx512=$libc_cv_asm_avx512
+ libc_cv_cc_avx512=$libc_cv_asm_avx512dq
else
libc_cv_cc_avx512=no
fi
@@ -77,7 +76,7 @@ rm -f conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_mpx" >&5
$as_echo "$libc_cv_asm_mpx" >&6; }
-if test $libc_cv_asm_mpx == yes; then
+if test $libc_cv_asm_mpx = yes; then
$as_echo "#define HAVE_MPX_SUPPORT 1" >>confdefs.h
fi
@@ -86,6 +85,41 @@ if test x"$build_mathvec" = xnotset; then
build_mathvec=yes
fi
+if test "$static_pie" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker static PIE support" >&5
+$as_echo_n "checking for linker static PIE support... " >&6; }
+if ${libc_cv_ld_static_pie+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.s <<\EOF
+ .text
+ .global _start
+ .weak foo
+_start:
+ leaq foo(%rip), %rax
+EOF
+ libc_cv_pie_option="-Wl,-pie"
+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostartfiles -nostdlib $no_ssp $libc_cv_pie_option -o conftest conftest.s 1>&5'
+ { { 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_ld_static_pie=yes
+ else
+ libc_cv_ld_static_pie=no
+ fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ld_static_pie" >&5
+$as_echo "$libc_cv_ld_static_pie" >&6; }
+ if test "$libc_cv_ld_static_pie" != yes; then
+ as_fn_error $? "linker support for static PIE needed" "$LINENO" 5
+ fi
+fi
+
$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
-# work around problem with autoconf and empty lines at the end of files
+
+test -n "$critic_missing" && as_fn_error $? "
+*** $critic_missing" "$LINENO" 5
diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
index 37b1059af3..b7d2c0124f 100644
--- a/sysdeps/x86_64/configure.ac
+++ b/sysdeps/x86_64/configure.ac
@@ -1,25 +1,24 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/x86_64.
-dnl Check if asm supports AVX512.
-AC_CACHE_CHECK(for AVX512 support in assembler, libc_cv_asm_avx512, [dnl
+dnl Check if asm supports AVX512DQ.
+AC_CACHE_CHECK(for AVX512DQ support in assembler, libc_cv_asm_avx512dq, [dnl
cat > conftest.s <<\EOF
- vmovdqu64 %zmm0, (%rsp)
vandpd (%rax), %zmm6, %zmm1
EOF
if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_asm_avx512=yes
+ libc_cv_asm_avx512dq=yes
else
- libc_cv_asm_avx512=no
+ libc_cv_asm_avx512dq=no
fi
rm -f conftest*])
-if test $libc_cv_asm_avx512 == yes; then
- AC_DEFINE(HAVE_AVX512_ASM_SUPPORT)
+if test $libc_cv_asm_avx512dq = yes; then
+ AC_DEFINE(HAVE_AVX512DQ_ASM_SUPPORT)
fi
dnl Check if -mavx512f works.
AC_CACHE_CHECK(for AVX512 support, libc_cv_cc_avx512, [dnl
-LIBC_TRY_CC_OPTION([-mavx512f], [libc_cv_cc_avx512=$libc_cv_asm_avx512], [libc_cv_cc_avx512=no])
+LIBC_TRY_CC_OPTION([-mavx512f], [libc_cv_cc_avx512=$libc_cv_asm_avx512dq], [libc_cv_cc_avx512=no])
])
if test $libc_cv_cc_avx512 = yes; then
AC_DEFINE(HAVE_AVX512_SUPPORT)
@@ -37,7 +36,7 @@ else
libc_cv_asm_mpx=no
fi
rm -f conftest*])
-if test $libc_cv_asm_mpx == yes; then
+if test $libc_cv_asm_mpx = yes; then
AC_DEFINE(HAVE_MPX_SUPPORT)
fi
@@ -45,7 +44,34 @@ if test x"$build_mathvec" = xnotset; then
build_mathvec=yes
fi
+dnl Check if linker supports static PIE with the fix for
+dnl
+dnl https://sourceware.org/bugzilla/show_bug.cgi?id=21782
+dnl
+if test "$static_pie" = yes; then
+ AC_CACHE_CHECK(for linker static PIE support, libc_cv_ld_static_pie, [dnl
+cat > conftest.s <<\EOF
+ .text
+ .global _start
+ .weak foo
+_start:
+ leaq foo(%rip), %rax
+EOF
+ libc_cv_pie_option="-Wl,-pie"
+ if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostartfiles -nostdlib $no_ssp $libc_cv_pie_option -o conftest conftest.s 1>&AS_MESSAGE_LOG_FD); then
+ libc_cv_ld_static_pie=yes
+ else
+ libc_cv_ld_static_pie=no
+ fi
+rm -f conftest*])
+ if test "$libc_cv_ld_static_pie" != yes; then
+ AC_MSG_ERROR([linker support for static PIE needed])
+ fi
+fi
+
dnl It is always possible to access static and hidden symbols in an
dnl position independent way.
AC_DEFINE(PI_STATIC_AND_HIDDEN)
-# work around problem with autoconf and empty lines at the end of files
+
+test -n "$critic_missing" && AC_MSG_ERROR([
+*** $critic_missing])
diff --git a/sysdeps/x86_64/crti.S b/sysdeps/x86_64/crti.S
index a34525974a..067ac14884 100644
--- a/sysdeps/x86_64/crti.S
+++ b/sysdeps/x86_64/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for x86-64.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,15 +58,17 @@
.section .init,"ax",@progbits
.p2align 2
.globl _init
+ .hidden _init
.type _init, @function
_init:
+ _CET_ENDBR
/* Maintain 16-byte stack alignment for called functions. */
subq $8, %rsp
#if PREINIT_FUNCTION_WEAK
movq PREINIT_FUNCTION@GOTPCREL(%rip), %rax
testq %rax, %rax
je .Lno_weak_fn
- call PREINIT_FUNCTION@PLT
+ call *%rax
.Lno_weak_fn:
#else
call PREINIT_FUNCTION
@@ -75,6 +77,8 @@ _init:
.section .fini,"ax",@progbits
.p2align 2
.globl _fini
+ .hidden _fini
.type _fini, @function
_fini:
+ _CET_ENDBR
subq $8, %rsp
diff --git a/sysdeps/x86_64/crtn.S b/sysdeps/x86_64/crtn.S
index b2fa0c6765..2463d742fd 100644
--- a/sysdeps/x86_64/crtn.S
+++ b/sysdeps/x86_64/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for x86-64.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/dl-irel.h b/sysdeps/x86_64/dl-irel.h
index 80d7d1dd78..6ecc50fb42 100644
--- a/sysdeps/x86_64/dl-irel.h
+++ b/sysdeps/x86_64/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
x86-64 version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/dl-lookupcfg.h b/sysdeps/x86_64/dl-lookupcfg.h
index 033b475889..5399cf25ab 100644
--- a/sysdeps/x86_64/dl-lookupcfg.h
+++ b/sysdeps/x86_64/dl-lookupcfg.h
@@ -1,5 +1,5 @@
/* Configuration of lookup functions.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,7 +26,6 @@
struct link_map;
-extern void _dl_unmap (struct link_map *map)
- internal_function attribute_hidden;
+extern void _dl_unmap (struct link_map *map) attribute_hidden;
#define DL_UNMAP(map) _dl_unmap (map)
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 980ca73cf2..1942ed5061 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. x86-64 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>.
@@ -66,9 +66,9 @@ static inline int __attribute__ ((unused, always_inline))
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_avx512 (ElfW(Word)) attribute_hidden;
+ extern void _dl_runtime_resolve_fxsave (ElfW(Word)) attribute_hidden;
+ extern void _dl_runtime_resolve_xsave (ElfW(Word)) attribute_hidden;
+ extern void _dl_runtime_resolve_xsavec (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;
@@ -117,12 +117,14 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
/* This function will get called to fix up the GOT entry
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;
- else if (HAS_ARCH_FEATURE (AVX_Usable))
- *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_avx;
+ if (GLRO(dl_x86_cpu_features).xsave_state_size != 0)
+ *(ElfW(Addr) *) (got + 2)
+ = (HAS_ARCH_FEATURE (XSAVEC_Usable)
+ ? (ElfW(Addr)) &_dl_runtime_resolve_xsavec
+ : (ElfW(Addr)) &_dl_runtime_resolve_xsave);
else
- *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_sse;
+ *(ElfW(Addr) *) (got + 2)
+ = (ElfW(Addr)) &_dl_runtime_resolve_fxsave;
}
}
@@ -220,15 +222,20 @@ _dl_start_user:\n\
static inline void __attribute__ ((unused))
dl_platform_init (void)
{
+#if IS_IN (rtld)
+ /* init_cpu_features has been called early from __libc_start_main in
+ static executable. */
+ init_cpu_features (&GLRO(dl_x86_cpu_features));
+#else
if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
/* Avoid an empty string which would disturb us. */
GLRO(dl_platform) = NULL;
-
- init_cpu_features (&GLRO(dl_x86_cpu_features));
+#endif
}
static inline ElfW(Addr)
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const ElfW(Rela) *reloc,
ElfW(Addr) *reloc_addr, ElfW(Addr) value)
{
@@ -299,15 +306,29 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
const ElfW(Sym) *const refsym = sym;
# endif
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- ElfW(Addr) value = (sym == NULL ? 0
- : (ElfW(Addr)) sym_map->l_addr + sym->st_value);
+ ElfW(Addr) value = SYMBOL_ADDRESS (sym_map, sym, true);
if (sym != NULL
- && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
- 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
- && __builtin_expect (!skip_ifunc, 1))
- value = ((ElfW(Addr) (*) (void)) value) ();
+ && __glibc_unlikely (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC)
+ && __glibc_likely (sym->st_shndx != SHN_UNDEF)
+ && __glibc_likely (!skip_ifunc))
+ {
+# 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_error_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)
{
@@ -477,8 +498,8 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
break;
memcpy (reloc_addr_arg, (void *) value,
MIN (sym->st_size, refsym->st_size));
- if (__builtin_expect (sym->st_size > refsym->st_size, 0)
- || (__builtin_expect (sym->st_size < refsym->st_size, 0)
+ if (__glibc_unlikely (sym->st_size > refsym->st_size)
+ || (__glibc_unlikely (sym->st_size < refsym->st_size)
&& GLRO(dl_verbose)))
{
fmt = "\
@@ -531,7 +552,8 @@ elf_machine_lazy_rel (struct link_map *map,
/* Check for unexpected PLT reloc type. */
if (__glibc_likely (r_type == R_X86_64_JUMP_SLOT))
{
- if (__builtin_expect (map->l_mach.plt, 0) == 0)
+ /* Prelink has been deprecated. */
+ if (__glibc_likely (map->l_mach.plt == 0))
*reloc_addr += l_addr;
else
*reloc_addr =
diff --git a/sysdeps/x86_64/dl-procinfo.c b/sysdeps/x86_64/dl-procinfo.c
index 4625695dfb..269ce7e87d 100644
--- a/sysdeps/x86_64/dl-procinfo.c
+++ b/sysdeps/x86_64/dl-procinfo.c
@@ -1,5 +1,5 @@
/* Data for x86-64 version of processor capability information.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,19 +39,7 @@
# define PROCINFO_CLASS
#endif
-#if !defined PROCINFO_DECL && defined SHARED
- ._dl_x86_cpu_features
-#else
-PROCINFO_CLASS struct cpu_features _dl_x86_cpu_features
-#endif
-#ifndef PROCINFO_DECL
-= { }
-#endif
-#if !defined SHARED || defined PROCINFO_DECL
-;
-#else
-,
-#endif
+#include <sysdeps/x86/dl-procinfo.c>
#undef PROCINFO_DECL
#undef PROCINFO_CLASS
diff --git a/sysdeps/x86_64/dl-tls.c b/sysdeps/x86_64/dl-tls.c
new file mode 100644
index 0000000000..533ee2b3a6
--- /dev/null
+++ b/sysdeps/x86_64/dl-tls.c
@@ -0,0 +1,53 @@
+/* Thread-local storage handling in the ELF dynamic linker. x86-64 version.
+ Copyright (C) 2017-2018 Free Software 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 SHARED
+/* Work around GCC PR58066, due to which __tls_get_addr may be called
+ with an unaligned stack. The compat implementation is in
+ tls_get_addr-compat.S. */
+
+# include <dl-tls.h>
+
+/* Define __tls_get_addr within elf/dl-tls.c under a different
+ name. */
+extern __typeof__ (__tls_get_addr) ___tls_get_addr;
+
+# define __tls_get_addr ___tls_get_addr
+# include <elf/dl-tls.c>
+# undef __tls_get_addr
+
+hidden_ver (___tls_get_addr, __tls_get_addr)
+
+/* Only handle slow paths for __tls_get_addr. */
+attribute_hidden
+void *
+__tls_get_addr_slow (GET_ADDR_ARGS)
+{
+ dtv_t *dtv = THREAD_DTV ();
+
+ if (__glibc_unlikely (dtv[0].counter != GL(dl_tls_generation)))
+ return update_get_addr (GET_ADDR_PARAM);
+
+ return tls_get_addr_tail (GET_ADDR_PARAM, dtv, NULL);
+}
+#else
+
+/* No compatibility symbol needed. */
+# include <elf/dl-tls.c>
+
+#endif
diff --git a/sysdeps/x86_64/dl-tls.h b/sysdeps/x86_64/dl-tls.h
index 0f101e6ac6..bc18e70b23 100644
--- a/sysdeps/x86_64/dl-tls.h
+++ b/sysdeps/x86_64/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. x86-64 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software 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,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _X86_64_DL_TLS_H
+#define _X86_64_DL_TLS_H
+
#include <stdint.h>
/* Type used for the representation of TLS information in the GOT. */
@@ -28,5 +31,4 @@ typedef struct dl_tls_index
extern void *__tls_get_addr (tls_index *ti);
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#endif /* _X86_64_DL_TLS_H */
diff --git a/sysdeps/x86_64/dl-tlsdesc.S b/sysdeps/x86_64/dl-tlsdesc.S
index 3cb7c3d031..80d771cd88 100644
--- a/sysdeps/x86_64/dl-tlsdesc.S
+++ b/sysdeps/x86_64/dl-tlsdesc.S
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. x86_64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,6 +37,7 @@
cfi_startproc
.align 16
_dl_tlsdesc_return:
+ _CET_ENDBR
movq 8(%rax), %rax
ret
cfi_endproc
@@ -58,6 +59,7 @@ _dl_tlsdesc_return:
cfi_startproc
.align 16
_dl_tlsdesc_undefweak:
+ _CET_ENDBR
movq 8(%rax), %rax
subq %fs:0, %rax
ret
@@ -96,6 +98,7 @@ _dl_tlsdesc_dynamic (register struct tlsdesc *tdp asm ("%rax"))
cfi_startproc
.align 16
_dl_tlsdesc_dynamic:
+ _CET_ENDBR
/* Preserve call-clobbered registers that we modify.
We need two scratch regs anyway. */
movq %rsi, -16(%rsp)
@@ -128,7 +131,11 @@ _dl_tlsdesc_dynamic:
movq %r10, 40(%rsp)
movq %r11, 48(%rsp)
/* %rdi already points to the tlsinfo data structure. */
+#ifdef NO_RTLD_HIDDEN
+ call JUMPTARGET (__tls_get_addr)
+#else
call HIDDEN_JUMPTARGET (__tls_get_addr)
+#endif
movq 8(%rsp), %rdx
movq 16(%rsp), %rcx
movq 24(%rsp), %r8
@@ -162,15 +169,17 @@ _dl_tlsdesc_dynamic:
.align 16
/* The PLT entry will have pushed the link_map pointer. */
_dl_tlsdesc_resolve_rela:
+ _CET_ENDBR
cfi_adjust_cfa_offset (8)
- /* Save all call-clobbered registers. */
- subq $72, %rsp
- cfi_adjust_cfa_offset (72)
+ /* Save all call-clobbered registers. Add 8 bytes for push in
+ the PLT entry to align the stack. */
+ subq $80, %rsp
+ cfi_adjust_cfa_offset (80)
movq %rax, (%rsp)
movq %rdi, 8(%rsp)
movq %rax, %rdi /* Pass tlsdesc* in %rdi. */
movq %rsi, 16(%rsp)
- movq 72(%rsp), %rsi /* Pass link_map* in %rsi. */
+ movq 80(%rsp), %rsi /* Pass link_map* in %rsi. */
movq %r8, 24(%rsp)
movq %r9, 32(%rsp)
movq %r10, 40(%rsp)
@@ -187,8 +196,8 @@ _dl_tlsdesc_resolve_rela:
movq 48(%rsp), %r11
movq 56(%rsp), %rdx
movq 64(%rsp), %rcx
- addq $80, %rsp
- cfi_adjust_cfa_offset (-80)
+ addq $88, %rsp
+ cfi_adjust_cfa_offset (-88)
jmp *(%rax)
cfi_endproc
.size _dl_tlsdesc_resolve_rela, .-_dl_tlsdesc_resolve_rela
@@ -211,6 +220,7 @@ _dl_tlsdesc_resolve_rela:
.align 16
_dl_tlsdesc_resolve_hold:
0:
+ _CET_ENDBR
/* Save all call-clobbered registers. */
subq $72, %rsp
cfi_adjust_cfa_offset (72)
diff --git a/sysdeps/x86_64/dl-tlsdesc.h b/sysdeps/x86_64/dl-tlsdesc.h
index 11e1a50b8f..66e659bb5c 100644
--- a/sysdeps/x86_64/dl-tlsdesc.h
+++ b/sysdeps/x86_64/dl-tlsdesc.h
@@ -1,6 +1,6 @@
/* Thread-local storage descriptor handling in the ELF dynamic linker.
x86_64 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -62,7 +62,7 @@ extern ptrdiff_t attribute_hidden
# ifdef SHARED
extern void *_dl_make_tlsdesc_dynamic (struct link_map *map,
size_t ti_offset)
- internal_function attribute_hidden;
+ attribute_hidden;
extern ptrdiff_t attribute_hidden _dl_tlsdesc_dynamic(struct tlsdesc *);
# endif
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index 9fb6b13983..ef1425cbb9 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. x86-64 version.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <config.h>
#include <sysdep.h>
+#include <cpu-features.h>
#include <link-defines.h>
#ifndef DL_STACK_ALIGNMENT
@@ -33,37 +34,24 @@
# define DL_STACK_ALIGNMENT 8
#endif
-#ifndef DL_RUNIME_UNALIGNED_VEC_SIZE
-/* The maximum size of unaligned vector load and store. */
-# define DL_RUNIME_UNALIGNED_VEC_SIZE 16
-#endif
-
-/* True if _dl_runtime_resolve should align stack to VEC_SIZE bytes. */
-#define DL_RUNIME_RESOLVE_REALIGN_STACK \
- (VEC_SIZE > DL_STACK_ALIGNMENT \
- && VEC_SIZE > DL_RUNIME_UNALIGNED_VEC_SIZE)
-
-/* Align vector register save area to 16 bytes. */
-#define REGISTER_SAVE_VEC_OFF 0
+/* True if _dl_runtime_resolve should align stack for STATE_SAVE or align
+ stack to 16 bytes before calling _dl_fixup. */
+#define DL_RUNTIME_RESOLVE_REALIGN_STACK \
+ (STATE_SAVE_ALIGNMENT > DL_STACK_ALIGNMENT \
+ || 16 > DL_STACK_ALIGNMENT)
/* Area on stack to save and restore registers used for parameter
passing when calling _dl_fixup. */
#ifdef __ILP32__
-# define REGISTER_SAVE_RAX (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 8)
# define PRESERVE_BND_REGS_PREFIX
#else
-/* Align bound register save area to 16 bytes. */
-# define REGISTER_SAVE_BND0 (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 8)
-# define REGISTER_SAVE_BND1 (REGISTER_SAVE_BND0 + 16)
-# define REGISTER_SAVE_BND2 (REGISTER_SAVE_BND1 + 16)
-# define REGISTER_SAVE_BND3 (REGISTER_SAVE_BND2 + 16)
-# define REGISTER_SAVE_RAX (REGISTER_SAVE_BND3 + 16)
# ifdef HAVE_MPX_SUPPORT
# define PRESERVE_BND_REGS_PREFIX bnd
# else
# define PRESERVE_BND_REGS_PREFIX .byte 0xf2
# endif
#endif
+#define REGISTER_SAVE_RAX 0
#define REGISTER_SAVE_RCX (REGISTER_SAVE_RAX + 8)
#define REGISTER_SAVE_RDX (REGISTER_SAVE_RCX + 8)
#define REGISTER_SAVE_RSI (REGISTER_SAVE_RDX + 8)
@@ -73,59 +61,58 @@
#define RESTORE_AVX
-#ifdef HAVE_AVX512_ASM_SUPPORT
-# define VEC_SIZE 64
-# define VMOVA vmovdqa64
-# if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
-# define VMOV vmovdqa64
-# else
-# define VMOV vmovdqu64
-# endif
-# define VEC(i) zmm##i
-# define _dl_runtime_resolve _dl_runtime_resolve_avx512
-# define _dl_runtime_profile _dl_runtime_profile_avx512
-# include "dl-trampoline.h"
-# undef _dl_runtime_resolve
-# undef _dl_runtime_profile
-# undef VEC
-# undef VMOV
-# undef VMOVA
-# undef VEC_SIZE
-#else
-strong_alias (_dl_runtime_resolve_avx, _dl_runtime_resolve_avx512)
- .hidden _dl_runtime_resolve_avx512
-strong_alias (_dl_runtime_profile_avx, _dl_runtime_profile_avx512)
- .hidden _dl_runtime_profile_avx512
-#endif
+#define VEC_SIZE 64
+#define VMOVA vmovdqa64
+#define VEC(i) zmm##i
+#define _dl_runtime_profile _dl_runtime_profile_avx512
+#include "dl-trampoline.h"
+#undef _dl_runtime_profile
+#undef VEC
+#undef VMOVA
+#undef VEC_SIZE
#define VEC_SIZE 32
#define VMOVA vmovdqa
-#if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
-# define VMOV vmovdqa
-#else
-# define VMOV vmovdqu
-#endif
#define VEC(i) ymm##i
-#define _dl_runtime_resolve _dl_runtime_resolve_avx
#define _dl_runtime_profile _dl_runtime_profile_avx
#include "dl-trampoline.h"
-#undef _dl_runtime_resolve
#undef _dl_runtime_profile
#undef VEC
-#undef VMOV
#undef VMOVA
#undef VEC_SIZE
/* movaps/movups is 1-byte shorter. */
#define VEC_SIZE 16
#define VMOVA movaps
-#if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
-# define VMOV movaps
-#else
-# define VMOV movups
-#endif
#define VEC(i) xmm##i
-#define _dl_runtime_resolve _dl_runtime_resolve_sse
#define _dl_runtime_profile _dl_runtime_profile_sse
#undef RESTORE_AVX
#include "dl-trampoline.h"
+#undef _dl_runtime_profile
+#undef VEC
+#undef VMOVA
+#undef VEC_SIZE
+
+#define USE_FXSAVE
+#define STATE_SAVE_ALIGNMENT 16
+#define _dl_runtime_resolve _dl_runtime_resolve_fxsave
+#include "dl-trampoline.h"
+#undef _dl_runtime_resolve
+#undef USE_FXSAVE
+#undef STATE_SAVE_ALIGNMENT
+
+#define USE_XSAVE
+#define STATE_SAVE_ALIGNMENT 64
+#define _dl_runtime_resolve _dl_runtime_resolve_xsave
+#include "dl-trampoline.h"
+#undef _dl_runtime_resolve
+#undef USE_XSAVE
+#undef STATE_SAVE_ALIGNMENT
+
+#define USE_XSAVEC
+#define STATE_SAVE_ALIGNMENT 64
+#define _dl_runtime_resolve _dl_runtime_resolve_xsavec
+#include "dl-trampoline.h"
+#undef _dl_runtime_resolve
+#undef USE_XSAVEC
+#undef STATE_SAVE_ALIGNMENT
diff --git a/sysdeps/x86_64/dl-trampoline.h b/sysdeps/x86_64/dl-trampoline.h
index f4191833ab..a28b1e73a4 100644
--- a/sysdeps/x86_64/dl-trampoline.h
+++ b/sysdeps/x86_64/dl-trampoline.h
@@ -1,5 +1,5 @@
/* PLT trampolines. x86-64 version.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software 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,40 +16,47 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#undef REGISTER_SAVE_AREA_RAW
-#ifdef __ILP32__
-/* X32 saves RCX, RDX, RSI, RDI, R8 and R9 plus RAX as well as VEC0 to
- VEC7. */
-# define REGISTER_SAVE_AREA_RAW (8 * 7 + VEC_SIZE * 8)
-#else
-/* X86-64 saves RCX, RDX, RSI, RDI, R8 and R9 plus RAX as well as
- BND0, BND1, BND2, BND3 and VEC0 to VEC7. */
-# define REGISTER_SAVE_AREA_RAW (8 * 7 + 16 * 4 + VEC_SIZE * 8)
-#endif
+ .text
+#ifdef _dl_runtime_resolve
-#undef REGISTER_SAVE_AREA
-#undef LOCAL_STORAGE_AREA
-#undef BASE
-#if DL_RUNIME_RESOLVE_REALIGN_STACK
-# define REGISTER_SAVE_AREA (REGISTER_SAVE_AREA_RAW + 8)
-/* Local stack area before jumping to function address: RBX. */
-# define LOCAL_STORAGE_AREA 8
-# define BASE rbx
-# if (REGISTER_SAVE_AREA % VEC_SIZE) != 0
-# error REGISTER_SAVE_AREA must be multples of VEC_SIZE
+# undef REGISTER_SAVE_AREA
+# undef LOCAL_STORAGE_AREA
+# undef BASE
+
+# if (STATE_SAVE_ALIGNMENT % 16) != 0
+# error STATE_SAVE_ALIGNMENT must be multples of 16
+# endif
+
+# if (STATE_SAVE_OFFSET % STATE_SAVE_ALIGNMENT) != 0
+# error STATE_SAVE_OFFSET must be multples of STATE_SAVE_ALIGNMENT
# endif
-#else
-# define REGISTER_SAVE_AREA REGISTER_SAVE_AREA_RAW
+
+# if DL_RUNTIME_RESOLVE_REALIGN_STACK
+/* Local stack area before jumping to function address: RBX. */
+# define LOCAL_STORAGE_AREA 8
+# define BASE rbx
+# ifdef USE_FXSAVE
+/* Use fxsave to save XMM registers. */
+# define REGISTER_SAVE_AREA (512 + STATE_SAVE_OFFSET)
+# if (REGISTER_SAVE_AREA % 16) != 0
+# error REGISTER_SAVE_AREA must be multples of 16
+# endif
+# endif
+# else
+# ifndef USE_FXSAVE
+# error USE_FXSAVE must be defined
+# endif
+/* Use fxsave to save XMM registers. */
+# define REGISTER_SAVE_AREA (512 + STATE_SAVE_OFFSET + 8)
/* Local stack area before jumping to function address: All saved
registers. */
-# define LOCAL_STORAGE_AREA REGISTER_SAVE_AREA
-# define BASE rsp
-# if (REGISTER_SAVE_AREA % 16) != 8
-# error REGISTER_SAVE_AREA must be odd multples of 8
+# define LOCAL_STORAGE_AREA REGISTER_SAVE_AREA
+# define BASE rsp
+# if (REGISTER_SAVE_AREA % 16) != 8
+# error REGISTER_SAVE_AREA must be odd multples of 8
+# endif
# endif
-#endif
- .text
.globl _dl_runtime_resolve
.hidden _dl_runtime_resolve
.type _dl_runtime_resolve, @function
@@ -57,19 +64,31 @@
cfi_startproc
_dl_runtime_resolve:
cfi_adjust_cfa_offset(16) # Incorporate PLT
-#if DL_RUNIME_RESOLVE_REALIGN_STACK
-# if LOCAL_STORAGE_AREA != 8
-# error LOCAL_STORAGE_AREA must be 8
-# endif
+ _CET_ENDBR
+# if DL_RUNTIME_RESOLVE_REALIGN_STACK
+# if LOCAL_STORAGE_AREA != 8
+# error LOCAL_STORAGE_AREA must be 8
+# endif
pushq %rbx # push subtracts stack by 8.
cfi_adjust_cfa_offset(8)
cfi_rel_offset(%rbx, 0)
mov %RSP_LP, %RBX_LP
cfi_def_cfa_register(%rbx)
- and $-VEC_SIZE, %RSP_LP
-#endif
+ and $-STATE_SAVE_ALIGNMENT, %RSP_LP
+# endif
+# ifdef REGISTER_SAVE_AREA
sub $REGISTER_SAVE_AREA, %RSP_LP
+# if !DL_RUNTIME_RESOLVE_REALIGN_STACK
cfi_adjust_cfa_offset(REGISTER_SAVE_AREA)
+# endif
+# else
+ # Allocate stack space of the required size to save the state.
+# if IS_IN (rtld)
+ sub _rtld_local_ro+RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET+XSAVE_STATE_SIZE_OFFSET(%rip), %RSP_LP
+# else
+ sub _dl_x86_cpu_features+XSAVE_STATE_SIZE_OFFSET(%rip), %RSP_LP
+# endif
+# endif
# Preserve registers otherwise clobbered.
movq %rax, REGISTER_SAVE_RAX(%rsp)
movq %rcx, REGISTER_SAVE_RCX(%rsp)
@@ -78,59 +97,42 @@ _dl_runtime_resolve:
movq %rdi, REGISTER_SAVE_RDI(%rsp)
movq %r8, REGISTER_SAVE_R8(%rsp)
movq %r9, REGISTER_SAVE_R9(%rsp)
- VMOV %VEC(0), (REGISTER_SAVE_VEC_OFF)(%rsp)
- VMOV %VEC(1), (REGISTER_SAVE_VEC_OFF + VEC_SIZE)(%rsp)
- VMOV %VEC(2), (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 2)(%rsp)
- VMOV %VEC(3), (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 3)(%rsp)
- VMOV %VEC(4), (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 4)(%rsp)
- VMOV %VEC(5), (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 5)(%rsp)
- VMOV %VEC(6), (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 6)(%rsp)
- VMOV %VEC(7), (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 7)(%rsp)
-#ifndef __ILP32__
- # We also have to preserve bound registers. These are nops if
- # Intel MPX isn't available or disabled.
-# ifdef HAVE_MPX_SUPPORT
- bndmov %bnd0, REGISTER_SAVE_BND0(%rsp)
- bndmov %bnd1, REGISTER_SAVE_BND1(%rsp)
- bndmov %bnd2, REGISTER_SAVE_BND2(%rsp)
- bndmov %bnd3, REGISTER_SAVE_BND3(%rsp)
+# ifdef USE_FXSAVE
+ fxsave STATE_SAVE_OFFSET(%rsp)
# else
-# if REGISTER_SAVE_BND0 == 0
- .byte 0x66,0x0f,0x1b,0x04,0x24
+ movl $STATE_SAVE_MASK, %eax
+ xorl %edx, %edx
+ # Clear the XSAVE Header.
+# ifdef USE_XSAVE
+ movq %rdx, (STATE_SAVE_OFFSET + 512)(%rsp)
+ movq %rdx, (STATE_SAVE_OFFSET + 512 + 8)(%rsp)
+# endif
+ movq %rdx, (STATE_SAVE_OFFSET + 512 + 8 * 2)(%rsp)
+ movq %rdx, (STATE_SAVE_OFFSET + 512 + 8 * 3)(%rsp)
+ movq %rdx, (STATE_SAVE_OFFSET + 512 + 8 * 4)(%rsp)
+ movq %rdx, (STATE_SAVE_OFFSET + 512 + 8 * 5)(%rsp)
+ movq %rdx, (STATE_SAVE_OFFSET + 512 + 8 * 6)(%rsp)
+ movq %rdx, (STATE_SAVE_OFFSET + 512 + 8 * 7)(%rsp)
+# ifdef USE_XSAVE
+ xsave STATE_SAVE_OFFSET(%rsp)
# else
- .byte 0x66,0x0f,0x1b,0x44,0x24,REGISTER_SAVE_BND0
+ xsavec STATE_SAVE_OFFSET(%rsp)
# endif
- .byte 0x66,0x0f,0x1b,0x4c,0x24,REGISTER_SAVE_BND1
- .byte 0x66,0x0f,0x1b,0x54,0x24,REGISTER_SAVE_BND2
- .byte 0x66,0x0f,0x1b,0x5c,0x24,REGISTER_SAVE_BND3
# endif
-#endif
# Copy args pushed by PLT in register.
# %rdi: link_map, %rsi: reloc_index
mov (LOCAL_STORAGE_AREA + 8)(%BASE), %RSI_LP
mov LOCAL_STORAGE_AREA(%BASE), %RDI_LP
call _dl_fixup # Call resolver.
mov %RAX_LP, %R11_LP # Save return value
-#ifndef __ILP32__
- # Restore bound registers. These are nops if Intel MPX isn't
- # avaiable or disabled.
-# ifdef HAVE_MPX_SUPPORT
- bndmov REGISTER_SAVE_BND3(%rsp), %bnd3
- bndmov REGISTER_SAVE_BND2(%rsp), %bnd2
- bndmov REGISTER_SAVE_BND1(%rsp), %bnd1
- bndmov REGISTER_SAVE_BND0(%rsp), %bnd0
+ # Get register content back.
+# ifdef USE_FXSAVE
+ fxrstor STATE_SAVE_OFFSET(%rsp)
# else
- .byte 0x66,0x0f,0x1a,0x5c,0x24,REGISTER_SAVE_BND3
- .byte 0x66,0x0f,0x1a,0x54,0x24,REGISTER_SAVE_BND2
- .byte 0x66,0x0f,0x1a,0x4c,0x24,REGISTER_SAVE_BND1
-# if REGISTER_SAVE_BND0 == 0
- .byte 0x66,0x0f,0x1a,0x04,0x24
-# else
- .byte 0x66,0x0f,0x1a,0x44,0x24,REGISTER_SAVE_BND0
-# endif
+ movl $STATE_SAVE_MASK, %eax
+ xorl %edx, %edx
+ xrstor STATE_SAVE_OFFSET(%rsp)
# endif
-#endif
- # Get register content back.
movq REGISTER_SAVE_R9(%rsp), %r9
movq REGISTER_SAVE_R8(%rsp), %r8
movq REGISTER_SAVE_RDI(%rsp), %rdi
@@ -138,20 +140,12 @@ _dl_runtime_resolve:
movq REGISTER_SAVE_RDX(%rsp), %rdx
movq REGISTER_SAVE_RCX(%rsp), %rcx
movq REGISTER_SAVE_RAX(%rsp), %rax
- VMOV (REGISTER_SAVE_VEC_OFF)(%rsp), %VEC(0)
- VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE)(%rsp), %VEC(1)
- VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 2)(%rsp), %VEC(2)
- VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 3)(%rsp), %VEC(3)
- VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 4)(%rsp), %VEC(4)
- VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 5)(%rsp), %VEC(5)
- VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 6)(%rsp), %VEC(6)
- VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 7)(%rsp), %VEC(7)
-#if DL_RUNIME_RESOLVE_REALIGN_STACK
+# if DL_RUNTIME_RESOLVE_REALIGN_STACK
mov %RBX_LP, %RSP_LP
cfi_def_cfa_register(%rsp)
movq (%rsp), %rbx
cfi_restore(%rbx)
-#endif
+# endif
# Adjust stack(PLT did 2 pushes)
add $(LOCAL_STORAGE_AREA + 16), %RSP_LP
cfi_adjust_cfa_offset(-(LOCAL_STORAGE_AREA + 16))
@@ -160,9 +154,10 @@ _dl_runtime_resolve:
jmp *%r11 # Jump to function address.
cfi_endproc
.size _dl_runtime_resolve, .-_dl_runtime_resolve
+#endif
-#ifndef PROF
+#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
@@ -174,6 +169,7 @@ _dl_runtime_resolve:
_dl_runtime_profile:
cfi_startproc
cfi_adjust_cfa_offset(16) # Incorporate PLT
+ _CET_ENDBR
/* The La_x86_64_regs data structure pointed to by the
fourth paramater must be VEC_SIZE-byte aligned. This must
be explicitly enforced. We have the set up a dynamically
@@ -446,8 +442,16 @@ _dl_runtime_profile:
# ifdef RESTORE_AVX
/* sizeof(La_x86_64_retval). Need extra space for 2 SSE
registers to detect if xmm0/xmm1 registers are changed
- by audit module. */
- sub $(LRV_SIZE + XMM_SIZE*2), %RSP_LP
+ by audit module. Since rsp is aligned to VEC_SIZE, we
+ need to make sure that the address of La_x86_64_retval +
+ LRV_VECTOR0_OFFSET is aligned to VEC_SIZE. */
+# define LRV_SPACE (LRV_SIZE + XMM_SIZE*2)
+# define LRV_MISALIGNED ((LRV_SIZE + LRV_VECTOR0_OFFSET) & (VEC_SIZE - 1))
+# if LRV_MISALIGNED == 0
+ sub $LRV_SPACE, %RSP_LP
+# else
+ sub $(LRV_SPACE + VEC_SIZE - LRV_MISALIGNED), %RSP_LP
+# endif
# else
sub $LRV_SIZE, %RSP_LP # sizeof(La_x86_64_retval)
# endif
diff --git a/sysdeps/x86_64/ffs.c b/sysdeps/x86_64/ffs.c
index be5b6c8589..fa5b20544d 100644
--- a/sysdeps/x86_64/ffs.c
+++ b/sysdeps/x86_64/ffs.c
@@ -1,7 +1,7 @@
/* ffs -- find first set bit in a word, counted from least significant end.
For AMD x86-64.
This file is part of the GNU C Library.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/ffsll.c b/sysdeps/x86_64/ffsll.c
index c0f5abc446..206deb6810 100644
--- a/sysdeps/x86_64/ffsll.c
+++ b/sysdeps/x86_64/ffsll.c
@@ -1,7 +1,7 @@
/* ffsll -- find first set bit in a word, counted from least significant end.
For AMD x86-64.
This file is part of the GNU C Library.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile
index 88742faff1..2b7d69bb50 100644
--- a/sysdeps/x86_64/fpu/Makefile
+++ b/sysdeps/x86_64/fpu/Makefile
@@ -30,11 +30,171 @@ ifeq ($(subdir),math)
ifeq ($(build-mathvec),yes)
libmvec-tests += double-vlen2 double-vlen4 double-vlen4-avx2 \
float-vlen4 float-vlen8 float-vlen8-avx2
+tests += test-double-libmvec-alias test-double-libmvec-alias-avx \
+ test-double-libmvec-alias-avx2 test-double-libmvec-alias-main \
+ test-double-libmvec-alias-avx-main test-double-libmvec-alias-avx2-main \
+ test-float-libmvec-alias test-float-libmvec-alias-avx \
+ test-float-libmvec-alias-avx2 test-float-libmvec-alias-main \
+ test-float-libmvec-alias-avx-main test-float-libmvec-alias-avx2-main \
+ test-double-libmvec-sincos test-double-libmvec-sincos-avx \
+ test-double-libmvec-sincos-avx2 test-float-libmvec-sincosf \
+ test-float-libmvec-sincosf-avx test-float-libmvec-sincosf-avx2
+modules-names += test-double-libmvec-alias-mod \
+ test-double-libmvec-alias-avx-mod \
+ test-double-libmvec-alias-avx2-mod \
+ test-float-libmvec-alias-mod \
+ test-float-libmvec-alias-avx-mod \
+ test-float-libmvec-alias-avx2-mod
+modules-names-tests += test-double-libmvec-alias-mod \
+ test-double-libmvec-alias-avx-mod \
+ test-double-libmvec-alias-avx2-mod \
+ test-float-libmvec-alias-mod \
+ test-float-libmvec-alias-avx-mod \
+ test-float-libmvec-alias-avx2-mod
+extra-test-objs += test-double-libmvec-sincos-avx-main.o \
+ test-double-libmvec-sincos-avx2-main.o \
+ test-double-libmvec-sincos-main.o \
+ test-float-libmvec-sincosf-avx-main.o \
+ test-float-libmvec-sincosf-avx2-main.o\
+ test-float-libmvec-sincosf-main.o
+test-double-libmvec-alias-mod.so-no-z-defs = yes
+test-double-libmvec-alias-avx-mod.so-no-z-defs = yes
+test-double-libmvec-alias-avx2-mod.so-no-z-defs = yes
+test-float-libmvec-alias-mod.so-no-z-defs = yes
+test-float-libmvec-alias-avx-mod.so-no-z-defs = yes
+test-float-libmvec-alias-avx2-mod.so-no-z-defs = yes
+
+$(objpfx)test-double-libmvec-alias: \
+ $(objpfx)test-double-libmvec-alias-mod.so
+$(objpfx)test-double-libmvec-alias-mod.so: \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-double-libmvec-alias-avx: \
+ $(objpfx)test-double-libmvec-alias-avx-mod.so
+$(objpfx)test-double-libmvec-alias-avx-mod.so: \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-double-libmvec-alias-avx2: \
+ $(objpfx)test-double-libmvec-alias-avx2-mod.so
+$(objpfx)test-double-libmvec-alias-avx2-mod.so: \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-double-libmvec-alias-main: \
+ $(objpfx)test-double-libmvec-alias-mod.os \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-double-libmvec-alias-avx-main: \
+ $(objpfx)test-double-libmvec-alias-avx-mod.os \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-double-libmvec-alias-avx2-main: \
+ $(objpfx)test-double-libmvec-alias-avx2-mod.os \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-float-libmvec-alias: \
+ $(objpfx)test-float-libmvec-alias-mod.so
+$(objpfx)test-float-libmvec-alias-mod.so: \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-float-libmvec-alias-avx: \
+ $(objpfx)test-float-libmvec-alias-avx-mod.so
+$(objpfx)test-float-libmvec-alias-avx-mod.so: \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-float-libmvec-alias-avx2: \
+ $(objpfx)test-float-libmvec-alias-avx2-mod.so
+$(objpfx)test-float-libmvec-alias-avx2-mod.so: \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-float-libmvec-alias-main: \
+ $(objpfx)test-float-libmvec-alias-mod.os \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-float-libmvec-alias-avx-main: \
+ $(objpfx)test-float-libmvec-alias-avx-mod.os \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-float-libmvec-alias-avx2-main: \
+ $(objpfx)test-float-libmvec-alias-avx2-mod.os \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-double-libmvec-sincos: \
+ $(objpfx)test-double-libmvec-sincos.o \
+ $(objpfx)test-double-libmvec-sincos-main.o $(libmvec)
+
+$(objpfx)test-double-libmvec-sincos-avx: \
+ $(objpfx)test-double-libmvec-sincos-avx.o \
+ $(objpfx)test-double-libmvec-sincos-avx-main.o $(libmvec)
+
+$(objpfx)test-double-libmvec-sincos-avx2: \
+ $(objpfx)test-double-libmvec-sincos-avx2.o \
+ $(objpfx)test-double-libmvec-sincos-avx2-main.o $(libmvec)
+
+$(objpfx)test-float-libmvec-sincosf: \
+ $(objpfx)test-float-libmvec-sincosf.o \
+ $(objpfx)test-float-libmvec-sincosf-main.o $(libmvec)
+
+$(objpfx)test-float-libmvec-sincosf-avx: \
+ $(objpfx)test-float-libmvec-sincosf-avx.o \
+ $(objpfx)test-float-libmvec-sincosf-avx-main.o $(libmvec)
+
+$(objpfx)test-float-libmvec-sincosf-avx2: \
+ $(objpfx)test-float-libmvec-sincosf-avx2.o \
+ $(objpfx)test-float-libmvec-sincosf-avx2-main.o $(libmvec)
ifeq (yes,$(config-cflags-avx512))
libmvec-tests += double-vlen8 float-vlen16
+tests += test-double-libmvec-alias-avx512 \
+ test-float-libmvec-alias-avx512 \
+ test-double-libmvec-alias-avx512-main \
+ test-float-libmvec-alias-avx512-main \
+ test-double-libmvec-sincos-avx512 \
+ test-float-libmvec-sincosf-avx512
+modules-names += test-double-libmvec-alias-avx512-mod \
+ test-float-libmvec-alias-avx512-mod
+modules-names-tests += test-double-libmvec-alias-avx512-mod \
+ test-float-libmvec-alias-avx512-mod
+extra-test-objs += test-double-libmvec-sincos-avx512-main.o \
+ test-float-libmvec-sincosf-avx512-main.o
+test-double-libmvec-alias-avx512-mod.so-no-z-defs = yes
+test-float-libmvec-alias-avx512-mod.so-no-z-defs = yes
+
+$(objpfx)test-double-libmvec-alias-avx512: \
+ $(objpfx)test-double-libmvec-alias-avx512-mod.so
+$(objpfx)test-double-libmvec-alias-avx512-mod.so: \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-double-libmvec-alias-avx512-main: \
+ $(objpfx)test-double-libmvec-alias-avx512-mod.os \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-float-libmvec-alias-avx512: \
+ $(objpfx)test-float-libmvec-alias-avx512-mod.so
+$(objpfx)test-float-libmvec-alias-avx512-mod.so: \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-float-libmvec-alias-avx512-main: \
+ $(objpfx)test-float-libmvec-alias-avx512-mod.os \
+ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec)
+
+$(objpfx)test-double-libmvec-sincos-avx512: \
+ $(objpfx)test-double-libmvec-sincos-avx512.o \
+ $(objpfx)test-double-libmvec-sincos-avx512-main.o $(libmvec)
+
+$(objpfx)test-float-libmvec-sincosf-avx512: \
+ $(objpfx)test-float-libmvec-sincosf-avx512.o \
+ $(objpfx)test-float-libmvec-sincosf-avx512-main.o $(libmvec)
endif
+double-vlen2-funcs = cos exp log pow sin sincos
+double-vlen4-funcs = cos exp log pow sin sincos
+double-vlen4-avx2-funcs = cos exp log pow sin sincos
+double-vlen8-funcs = cos exp log pow sin sincos
+float-vlen4-funcs = cos exp log pow sin sincos
+float-vlen8-funcs = cos exp log pow sin sincos
+float-vlen8-avx2-funcs = cos exp log pow sin sincos
+float-vlen16-funcs = cos exp log pow sin sincos
+
double-vlen4-arch-ext-cflags = -mavx
double-vlen4-arch-ext2-cflags = -mavx2
double-vlen8-arch-ext-cflags = -mavx512f
@@ -43,11 +203,37 @@ float-vlen8-arch-ext-cflags = -mavx
float-vlen8-arch-ext2-cflags = -mavx2
float-vlen16-arch-ext-cflags = -mavx512f
-CFLAGS-test-double-vlen4-avx2.c = $(libm-test-vec-cflags)
+libmvec-sincos-cflags = $(libm-test-fast-math-cflags) -fno-inline -fopenmp -Wno-unknown-pragmas
+libmvec-alias-cflags = $(libmvec-sincos-cflags) -ffloat-store -ffinite-math-only
+
+CFLAGS-test-double-libmvec-alias-mod.c = $(libmvec-alias-cflags)
+CFLAGS-test-double-libmvec-alias-avx-mod.c = $(double-vlen4-arch-ext-cflags) $(libmvec-alias-cflags) -DREQUIRE_AVX
+CFLAGS-test-double-libmvec-alias-avx2-mod.c = $(double-vlen4-arch-ext2-cflags) $(libmvec-alias-cflags) -DREQUIRE_AVX2
+CFLAGS-test-double-libmvec-alias-avx512-mod.c = $(double-vlen8-arch-ext-cflags) $(libmvec-alias-cflags) -DREQUIRE_AVX512F
+
+CFLAGS-test-float-libmvec-alias-mod.c = $(libmvec-alias-cflags)
+CFLAGS-test-float-libmvec-alias-avx-mod.c = $(double-vlen4-arch-ext-cflags) $(libmvec-alias-cflags) -DREQUIRE_AVX
+CFLAGS-test-float-libmvec-alias-avx2-mod.c = $(double-vlen4-arch-ext2-cflags) $(libmvec-alias-cflags) -DREQUIRE_AVX2
+CFLAGS-test-float-libmvec-alias-avx512-mod.c = $(double-vlen8-arch-ext-cflags) $(libmvec-alias-cflags) -DREQUIRE_AVX512F
+
CFLAGS-test-double-vlen4-avx2-wrappers.c = $(double-vlen4-arch-ext2-cflags)
-CFLAGS-test-float-vlen8-avx2.c = $(libm-test-vec-cflags)
CFLAGS-test-float-vlen8-avx2-wrappers.c = $(float-vlen8-arch-ext2-cflags)
+CFLAGS-test-double-libmvec-sincos-main.c = $(libmvec-sincos-cflags)
+CFLAGS-test-double-libmvec-sincos-avx.c = -DREQUIRE_AVX
+CFLAGS-test-double-libmvec-sincos-avx-main.c = $(libmvec-sincos-cflags) $(double-vlen4-arch-ext-cflags)
+CFLAGS-test-double-libmvec-sincos-avx2.c = -DREQUIRE_AVX2
+CFLAGS-test-double-libmvec-sincos-avx2-main.c = $(libmvec-sincos-cflags) $(double-vlen4-arch-ext2-cflags)
+CFLAGS-test-double-libmvec-sincos-avx512.c = -DREQUIRE_AVX512F
+CFLAGS-test-double-libmvec-sincos-avx512-main.c = $(libmvec-sincos-cflags) $(double-vlen8-arch-ext-cflags)
+
+CFLAGS-test-float-libmvec-sincosf-main.c = $(libmvec-sincos-cflags)
+CFLAGS-test-float-libmvec-sincosf-avx.c = -DREQUIRE_AVX
+CFLAGS-test-float-libmvec-sincosf-avx-main.c = $(libmvec-sincos-cflags) $(float-vlen8-arch-ext-cflags)
+CFLAGS-test-float-libmvec-sincosf-avx2.c = -DREQUIRE_AVX2
+CFLAGS-test-float-libmvec-sincosf-avx2-main.c = $(libmvec-sincos-cflags) $(float-vlen8-arch-ext2-cflags)
+CFLAGS-test-float-libmvec-sincosf-avx512.c = -DREQUIRE_AVX512F
+CFLAGS-test-float-libmvec-sincosf-avx512-main.c = $(libmvec-sincos-cflags) $(float-vlen16-arch-ext-cflags)
endif
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/sysdeps/x86_64/fpu/e_expf.S b/sysdeps/x86_64/fpu/e_expf.S
deleted file mode 100644
index d4b63a8d8e..0000000000
--- a/sysdeps/x86_64/fpu/e_expf.S
+++ /dev/null
@@ -1,339 +0,0 @@
-/* Optimized __ieee754_expf function.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-
-/* Short algorithm description:
- *
- * Let K = 64 (table size).
- * e^x = 2^(x/log(2)) = 2^n * T[j] * (1 + P(y))
- * where
- * x = m*log(2)/K + y, y in [0.0..log(2)/K]
- * m = n*K + j, m,n,j - signed integer, j in [0..K-1]
- * values of 2^(j/K) are tabulated as T[j].
- *
- * P(y) is a minimax polynomial approximation of expf(x)-1
- * on small interval [0.0..log(2)/K].
- *
- * P(y) = P3*y*y*y*y + P2*y*y*y + P1*y*y + P0*y, calculated as
- * z = y*y; P(y) = (P3*z + P1)*z + (P2*z + P0)*y
- *
- * Special cases:
- * expf(NaN) = NaN
- * expf(+INF) = +INF
- * expf(-INF) = 0
- * expf(x) = 1 for subnormals
- * for finite argument, only expf(0)=1 is exact
- * expf(x) overflows if x>88.7228317260742190
- * expf(x) underflows if x<-103.972076416015620
- */
-
- .text
-ENTRY(__ieee754_expf)
- /* Input: single precision x in %xmm0 */
- cvtss2sd %xmm0, %xmm1 /* Convert x to double precision */
- movd %xmm0, %ecx /* Copy x */
- movsd L(DP_KLN2)(%rip), %xmm2 /* DP K/log(2) */
- movsd L(DP_P2)(%rip), %xmm3 /* DP P2 */
- movl %ecx, %eax /* x */
- mulsd %xmm1, %xmm2 /* DP x*K/log(2) */
- andl $0x7fffffff, %ecx /* |x| */
- lea L(DP_T)(%rip), %rsi /* address of table T[j] */
- cmpl $0x42ad496b, %ecx /* |x|<125*log(2) ? */
- movsd L(DP_P3)(%rip), %xmm4 /* DP P3 */
- addsd L(DP_RS)(%rip), %xmm2 /* DP x*K/log(2)+RS */
- jae L(special_paths)
-
- /* Here if |x|<125*log(2) */
- cmpl $0x31800000, %ecx /* |x|<2^(-28) ? */
- jb L(small_arg)
-
- /* Main path: here if 2^(-28)<=|x|<125*log(2) */
- cvtsd2ss %xmm2, %xmm2 /* SP x*K/log(2)+RS */
- movd %xmm2, %eax /* bits of n*K+j with trash */
- subss L(SP_RS)(%rip), %xmm2 /* SP t=round(x*K/log(2)) */
- movl %eax, %edx /* n*K+j with trash */
- cvtss2sd %xmm2, %xmm2 /* DP t */
- andl $0x3f, %eax /* bits of j */
- mulsd L(DP_NLN2K)(%rip), %xmm2/* DP -t*log(2)/K */
- andl $0xffffffc0, %edx /* bits of n */
-#ifdef __AVX__
- vaddsd %xmm1, %xmm2, %xmm0 /* DP y=x-t*log(2)/K */
- vmulsd %xmm0, %xmm0, %xmm2 /* DP z=y*y */
-#else
- addsd %xmm1, %xmm2 /* DP y=x-t*log(2)/K */
- movaps %xmm2, %xmm0 /* DP y */
- mulsd %xmm2, %xmm2 /* DP z=y*y */
-#endif
- mulsd %xmm2, %xmm4 /* DP P3*z */
- addl $0x1fc0, %edx /* bits of n + SP exponent bias */
- mulsd %xmm2, %xmm3 /* DP P2*z */
- shll $17, %edx /* SP 2^n */
- addsd L(DP_P1)(%rip), %xmm4 /* DP P3*z+P1 */
- addsd L(DP_P0)(%rip), %xmm3 /* DP P2*z+P0 */
- movd %edx, %xmm1 /* SP 2^n */
- mulsd %xmm2, %xmm4 /* DP (P3*z+P1)*z */
- mulsd %xmm3, %xmm0 /* DP (P2*z+P0)*y */
- addsd %xmm4, %xmm0 /* DP P(y) */
- mulsd (%rsi,%rax,8), %xmm0 /* DP P(y)*T[j] */
- addsd (%rsi,%rax,8), %xmm0 /* DP T[j]*(P(y)+1) */
- cvtsd2ss %xmm0, %xmm0 /* SP T[j]*(P(y)+1) */
- mulss %xmm1, %xmm0 /* SP result=2^n*(T[j]*(P(y)+1)) */
- ret
-
- .p2align 4
-L(small_arg):
- /* Here if 0<=|x|<2^(-28) */
- addss L(SP_ONE)(%rip), %xmm0 /* 1.0 + x */
- /* Return 1.0 with inexact raised, except for x==0 */
- ret
-
- .p2align 4
-L(special_paths):
- /* Here if 125*log(2)<=|x| */
- shrl $31, %eax /* Get sign bit of x, and depending on it: */
- lea L(SP_RANGE)(%rip), %rdx /* load over/underflow bound */
- cmpl (%rdx,%rax,4), %ecx /* |x|<under/overflow bound ? */
- jbe L(near_under_or_overflow)
-
- /* Here if |x|>under/overflow bound */
- cmpl $0x7f800000, %ecx /* |x| is finite ? */
- jae L(arg_inf_or_nan)
-
- /* Here if |x|>under/overflow bound, and x is finite */
- testq %rax, %rax /* sign of x nonzero ? */
- je L(res_overflow)
-
- /* Here if -inf<x<underflow bound (x<0) */
- movss L(SP_SMALL)(%rip), %xmm0/* load small value 2^(-100) */
- mulss %xmm0, %xmm0 /* Return underflowed result (zero or subnormal) */
- ret
-
- .p2align 4
-L(res_overflow):
- /* Here if overflow bound<x<inf (x>0) */
- movss L(SP_LARGE)(%rip), %xmm0/* load large value 2^100 */
- mulss %xmm0, %xmm0 /* Return overflowed result (Inf or max normal) */
- ret
-
- .p2align 4
-L(arg_inf_or_nan):
- /* Here if |x| is Inf or NAN */
- jne L(arg_nan) /* |x| is Inf ? */
-
- /* Here if |x| is Inf */
- lea L(SP_INF_0)(%rip), %rdx /* depending on sign of x: */
- movss (%rdx,%rax,4), %xmm0 /* return zero or Inf */
- ret
-
- .p2align 4
-L(arg_nan):
- /* Here if |x| is NaN */
- addss %xmm0, %xmm0 /* Return x+x (raise invalid) */
- ret
-
- .p2align 4
-L(near_under_or_overflow):
- /* Here if 125*log(2)<=|x|<under/overflow bound */
- cvtsd2ss %xmm2, %xmm2 /* SP x*K/log(2)+RS */
- movd %xmm2, %eax /* bits of n*K+j with trash */
- subss L(SP_RS)(%rip), %xmm2 /* SP t=round(x*K/log(2)) */
- movl %eax, %edx /* n*K+j with trash */
- cvtss2sd %xmm2, %xmm2 /* DP t */
- andl $0x3f, %eax /* bits of j */
- mulsd L(DP_NLN2K)(%rip), %xmm2/* DP -t*log(2)/K */
- andl $0xffffffc0, %edx /* bits of n */
-#ifdef __AVX__
- vaddsd %xmm1, %xmm2, %xmm0 /* DP y=x-t*log(2)/K */
- vmulsd %xmm0, %xmm0, %xmm2 /* DP z=y*y */
-#else
- addsd %xmm1, %xmm2 /* DP y=x-t*log(2)/K */
- movaps %xmm2, %xmm0 /* DP y */
- mulsd %xmm2, %xmm2 /* DP z=y*y */
-#endif
- mulsd %xmm2, %xmm4 /* DP P3*z */
- addl $0xffc0, %edx /* bits of n + DP exponent bias */
- mulsd %xmm2, %xmm3 /* DP P2*z */
- shlq $46, %rdx /* DP 2^n */
- addsd L(DP_P1)(%rip), %xmm4 /* DP P3*z+P1 */
- addsd L(DP_P0)(%rip), %xmm3 /* DP P2*z+P0 */
- movd %rdx, %xmm1 /* DP 2^n */
- mulsd %xmm2, %xmm4 /* DP (P3*z+P1)*z */
- mulsd %xmm3, %xmm0 /* DP (P2*z+P0)*y */
- addsd %xmm4, %xmm0 /* DP P(y) */
- mulsd (%rsi,%rax,8), %xmm0 /* DP P(y)*T[j] */
- addsd (%rsi,%rax,8), %xmm0 /* DP T[j]*(P(y)+1) */
- mulsd %xmm1, %xmm0 /* DP result=2^n*(T[j]*(P(y)+1)) */
- cvtsd2ss %xmm0, %xmm0 /* convert result to single precision */
- ret
-END(__ieee754_expf)
-
- .section .rodata, "a"
- .p2align 3
-L(DP_T): /* table of double precision values 2^(j/K) for j=[0..K-1] */
- .long 0x00000000, 0x3ff00000
- .long 0x3e778061, 0x3ff02c9a
- .long 0xd3158574, 0x3ff059b0
- .long 0x18759bc8, 0x3ff08745
- .long 0x6cf9890f, 0x3ff0b558
- .long 0x32d3d1a2, 0x3ff0e3ec
- .long 0xd0125b51, 0x3ff11301
- .long 0xaea92de0, 0x3ff1429a
- .long 0x3c7d517b, 0x3ff172b8
- .long 0xeb6fcb75, 0x3ff1a35b
- .long 0x3168b9aa, 0x3ff1d487
- .long 0x88628cd6, 0x3ff2063b
- .long 0x6e756238, 0x3ff2387a
- .long 0x65e27cdd, 0x3ff26b45
- .long 0xf51fdee1, 0x3ff29e9d
- .long 0xa6e4030b, 0x3ff2d285
- .long 0x0a31b715, 0x3ff306fe
- .long 0xb26416ff, 0x3ff33c08
- .long 0x373aa9cb, 0x3ff371a7
- .long 0x34e59ff7, 0x3ff3a7db
- .long 0x4c123422, 0x3ff3dea6
- .long 0x21f72e2a, 0x3ff4160a
- .long 0x6061892d, 0x3ff44e08
- .long 0xb5c13cd0, 0x3ff486a2
- .long 0xd5362a27, 0x3ff4bfda
- .long 0x769d2ca7, 0x3ff4f9b2
- .long 0x569d4f82, 0x3ff5342b
- .long 0x36b527da, 0x3ff56f47
- .long 0xdd485429, 0x3ff5ab07
- .long 0x15ad2148, 0x3ff5e76f
- .long 0xb03a5585, 0x3ff6247e
- .long 0x82552225, 0x3ff66238
- .long 0x667f3bcd, 0x3ff6a09e
- .long 0x3c651a2f, 0x3ff6dfb2
- .long 0xe8ec5f74, 0x3ff71f75
- .long 0x564267c9, 0x3ff75feb
- .long 0x73eb0187, 0x3ff7a114
- .long 0x36cf4e62, 0x3ff7e2f3
- .long 0x994cce13, 0x3ff82589
- .long 0x9b4492ed, 0x3ff868d9
- .long 0x422aa0db, 0x3ff8ace5
- .long 0x99157736, 0x3ff8f1ae
- .long 0xb0cdc5e5, 0x3ff93737
- .long 0x9fde4e50, 0x3ff97d82
- .long 0x82a3f090, 0x3ff9c491
- .long 0x7b5de565, 0x3ffa0c66
- .long 0xb23e255d, 0x3ffa5503
- .long 0x5579fdbf, 0x3ffa9e6b
- .long 0x995ad3ad, 0x3ffae89f
- .long 0xb84f15fb, 0x3ffb33a2
- .long 0xf2fb5e47, 0x3ffb7f76
- .long 0x904bc1d2, 0x3ffbcc1e
- .long 0xdd85529c, 0x3ffc199b
- .long 0x2e57d14b, 0x3ffc67f1
- .long 0xdcef9069, 0x3ffcb720
- .long 0x4a07897c, 0x3ffd072d
- .long 0xdcfba487, 0x3ffd5818
- .long 0x03db3285, 0x3ffda9e6
- .long 0x337b9b5f, 0x3ffdfc97
- .long 0xe78b3ff6, 0x3ffe502e
- .long 0xa2a490da, 0x3ffea4af
- .long 0xee615a27, 0x3ffefa1b
- .long 0x5b6e4540, 0x3fff5076
- .long 0x819e90d8, 0x3fffa7c1
- .type L(DP_T), @object
- ASM_SIZE_DIRECTIVE(L(DP_T))
-
- .section .rodata.cst8,"aM",@progbits,8
- .p2align 3
-L(DP_KLN2): /* double precision K/log(2) */
- .long 0x652b82fe, 0x40571547
- .type L(DP_KLN2), @object
- ASM_SIZE_DIRECTIVE(L(DP_KLN2))
-
- .p2align 3
-L(DP_NLN2K): /* double precision -log(2)/K */
- .long 0xfefa39ef, 0xbf862e42
- .type L(DP_NLN2K), @object
- ASM_SIZE_DIRECTIVE(L(DP_NLN2K))
-
- .p2align 3
-L(DP_RS): /* double precision 2^23+2^22 */
- .long 0x00000000, 0x41680000
- .type L(DP_RS), @object
- ASM_SIZE_DIRECTIVE(L(DP_RS))
-
- .p2align 3
-L(DP_P3): /* double precision polynomial coefficient P3 */
- .long 0xeb78fa85, 0x3fa56420
- .type L(DP_P3), @object
- ASM_SIZE_DIRECTIVE(L(DP_P3))
-
- .p2align 3
-L(DP_P1): /* double precision polynomial coefficient P1 */
- .long 0x008d6118, 0x3fe00000
- .type L(DP_P1), @object
- ASM_SIZE_DIRECTIVE(L(DP_P1))
-
- .p2align 3
-L(DP_P2): /* double precision polynomial coefficient P2 */
- .long 0xda752d4f, 0x3fc55550
- .type L(DP_P2), @object
- ASM_SIZE_DIRECTIVE(L(DP_P2))
-
- .p2align 3
-L(DP_P0): /* double precision polynomial coefficient P0 */
- .long 0xffffe7c6, 0x3fefffff
- .type L(DP_P0), @object
- ASM_SIZE_DIRECTIVE(L(DP_P0))
-
- .p2align 2
-L(SP_RANGE): /* single precision overflow/underflow bounds */
- .long 0x42b17217 /* if x>this bound, then result overflows */
- .long 0x42cff1b4 /* if x<this bound, then result underflows */
- .type L(SP_RANGE), @object
- ASM_SIZE_DIRECTIVE(L(SP_RANGE))
-
- .p2align 2
-L(SP_INF_0):
- .long 0x7f800000 /* single precision Inf */
- .long 0 /* single precision zero */
- .type L(SP_INF_0), @object
- ASM_SIZE_DIRECTIVE(L(SP_INF_0))
-
- .section .rodata.cst4,"aM",@progbits,4
- .p2align 2
-L(SP_RS): /* single precision 2^23+2^22 */
- .long 0x4b400000
- .type L(SP_RS), @object
- ASM_SIZE_DIRECTIVE(L(SP_RS))
-
- .p2align 2
-L(SP_SMALL): /* single precision small value 2^(-100) */
- .long 0x0d800000
- .type L(SP_SMALL), @object
- ASM_SIZE_DIRECTIVE(L(SP_SMALL))
-
- .p2align 2
-L(SP_LARGE): /* single precision large value 2^100 */
- .long 0x71800000
- .type L(SP_LARGE), @object
- ASM_SIZE_DIRECTIVE(L(SP_LARGE))
-
- .p2align 2
-L(SP_ONE): /* single precision 1.0 */
- .long 0x3f800000
- .type L(SP_ONE), @object
- ASM_SIZE_DIRECTIVE(L(SP_ONE))
-
-strong_alias (__ieee754_expf, __expf_finite)
diff --git a/sysdeps/x86_64/fpu/e_expl.S b/sysdeps/x86_64/fpu/e_expl.S
index 8b3ddaec59..b75a103803 100644
--- a/sysdeps/x86_64/fpu/e_expl.S
+++ b/sysdeps/x86_64/fpu/e_expl.S
@@ -22,6 +22,7 @@
* -- moshier@na-net.ornl.gov
*/
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
#include <x86_64-math-asm.h>
@@ -99,7 +100,7 @@ ENTRY(IEEE754_EXPL)
/* Below -64.0 (may be -NaN or -Inf). */
andb %ah, %dh
cmpb $0x01, %dh
- je 2f /* Is +-NaN, jump. */
+ je 6f /* Is +-NaN, jump. */
jmp 1f /* -large, possibly -Inf. */
4: /* In range -64.0 to 64.0 (may be +-0 but not NaN or +-Inf). */
@@ -141,7 +142,7 @@ ENTRY(IEEE754_EXPL)
cmpb $0x05, %dh
je 1f /* Is +-Inf, jump. */
cmpb $0x01, %dh
- je 2f /* Is +-NaN, jump. */
+ je 6f /* Is +-NaN, jump. */
/* Overflow or underflow; saturate. */
fstp %st
fldt MO(csat)
@@ -207,10 +208,13 @@ ENTRY(IEEE754_EXPL)
fldz /* Set result to 0. */
#endif
2: ret
+6: /* NaN argument. */
+ fadd %st
+ ret
END(IEEE754_EXPL)
#ifdef USE_AS_EXPM1L
libm_hidden_def (__expm1l)
-weak_alias (__expm1l, expm1l)
+libm_alias_ldouble (__expm1, expm1)
#else
strong_alias (IEEE754_EXPL, EXPL_FINITE)
#endif
diff --git a/sysdeps/x86_64/fpu/e_log10l.S b/sysdeps/x86_64/fpu/e_log10l.S
index 8fa61644c1..e0cb88e32e 100644
--- a/sysdeps/x86_64/fpu/e_log10l.S
+++ b/sysdeps/x86_64/fpu/e_log10l.S
@@ -64,6 +64,7 @@ ENTRY(__ieee754_log10l)
jnz 4b // in case x is ±Inf
fstp %st(1)
fstp %st(1)
+ fadd %st(0)
ret
END(__ieee754_log10l)
diff --git a/sysdeps/x86_64/fpu/e_log2l.S b/sysdeps/x86_64/fpu/e_log2l.S
index a063255ddd..023ec29164 100644
--- a/sysdeps/x86_64/fpu/e_log2l.S
+++ b/sysdeps/x86_64/fpu/e_log2l.S
@@ -63,6 +63,7 @@ ENTRY(__ieee754_log2l)
jnz 4b // in case x is ±Inf
fstp %st(1)
fstp %st(1)
+ fadd %st(0)
ret
END (__ieee754_log2l)
diff --git a/sysdeps/x86_64/fpu/e_logl.S b/sysdeps/x86_64/fpu/e_logl.S
index dbe6fd59dc..0d3576f48b 100644
--- a/sysdeps/x86_64/fpu/e_logl.S
+++ b/sysdeps/x86_64/fpu/e_logl.S
@@ -66,6 +66,7 @@ ENTRY(__ieee754_logl)
jnz 4b // in case x is +-Inf
fstp %st(1)
fstp %st(1)
+ fadd %st(0)
ret
END (__ieee754_logl)
diff --git a/sysdeps/x86_64/fpu/e_powl.S b/sysdeps/x86_64/fpu/e_powl.S
index 1f68cf0102..f32228104e 100644
--- a/sysdeps/x86_64/fpu/e_powl.S
+++ b/sysdeps/x86_64/fpu/e_powl.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of pow function.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -26,9 +26,9 @@
.type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- .type p3,@object
-p3: .byte 0, 0, 0, 0, 0, 0, 0x20, 0x40
- ASM_SIZE_DIRECTIVE(p3)
+ .type p2,@object
+p2: .byte 0, 0, 0, 0, 0, 0, 0x10, 0x40
+ ASM_SIZE_DIRECTIVE(p2)
.type p63,@object
p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
ASM_SIZE_DIRECTIVE(p63)
@@ -136,12 +136,12 @@ ENTRY(__ieee754_powl)
jmp 3f
9: /* OK, we have an integer value for y. Unless very small
- (we use < 8), use the algorithm for real exponent to avoid
+ (we use < 4), use the algorithm for real exponent to avoid
accumulation of errors. */
- fldl MO(p3) // 8 : y : x
- fld %st(1) // y : 8 : y : x
- fabs // |y| : 8 : y : x
- fcomip %st(1), %st // 8 : y : x
+ fldl MO(p2) // 4 : y : x
+ fld %st(1) // y : 4 : y : x
+ fabs // |y| : 4 : y : x
+ fcomip %st(1), %st // 4 : y : x
fstp %st(0) // y : x
jnc 3f
mov -8(%rsp),%eax
@@ -184,9 +184,15 @@ ENTRY(__ieee754_powl)
30: fldt 8(%rsp) // x : y
fldl MO(one) // 1.0 : x : y
fucomip %st(1),%st // x : y
- je 31f
- fxch // y : x
-31: fstp %st(1)
+ je 32f
+31: /* At least one argument NaN, and result should be NaN. */
+ faddp
+ ret
+32: jc 31b
+ /* pow (1, NaN); check if the NaN signaling. */
+ testb $0x40, 31(%rsp)
+ jz 31b
+ fstp %st(1)
ret
.align ALIGNARG(4)
@@ -217,12 +223,24 @@ ENTRY(__ieee754_powl)
cfi_adjust_cfa_offset (-40)
ret
- // pow(x,±0) = 1
+ // pow(x,±0) = 1, unless x is sNaN
.align ALIGNARG(4)
11: fstp %st(0) // pop y
+ fldt 8(%rsp) // x
+ fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 112f // x is NaN
+111: fstp %st(0)
fldl MO(one)
ret
+112: testb $0x40, 15(%rsp)
+ jnz 111b
+ fadd %st(0)
+ ret
+
// y == ±inf
.align ALIGNARG(4)
12: fstp %st(0) // pop y
@@ -255,6 +273,7 @@ ENTRY(__ieee754_powl)
.align ALIGNARG(4)
13: fldt 8(%rsp) // load x == NaN
+ fadd %st(0)
ret
.align ALIGNARG(4)
diff --git a/sysdeps/x86_64/fpu/e_scalbl.S b/sysdeps/x86_64/fpu/e_scalbl.S
index 331bee580c..2982dc3b9e 100644
--- a/sysdeps/x86_64/fpu/e_scalbl.S
+++ b/sysdeps/x86_64/fpu/e_scalbl.S
@@ -44,7 +44,7 @@ ENTRY(__ieee754_scalbl)
fnstsw
andl $0x4500, %eax
cmpl $0x0100, %eax
- je 3f
+ je 2f
fld %st(1)
frndint
fcomip %st(2), %st
@@ -75,15 +75,8 @@ ENTRY(__ieee754_scalbl)
#endif
ret
- /* The result is NaN, but we must not raise an exception.
- So use a variable. */
-2: fstp %st
- fstp %st
- fldl MO(nan)
- ret
-
- /* The first parameter is a NaN. Return it. */
-3: fstp %st(1)
+ /* The result is NaN; raise an exception for sNaN arguments. */
+2: faddp
ret
/* Return NaN and raise the invalid exception. */
diff --git a/sysdeps/x86_64/fpu/e_sqrt.c b/sysdeps/x86_64/fpu/e_sqrt.c
index 4b86434913..f4c2e5fd7c 100644
--- a/sysdeps/x86_64/fpu/e_sqrt.c
+++ b/sysdeps/x86_64/fpu/e_sqrt.c
@@ -1,5 +1,5 @@
/* Square root of floating point number.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/e_sqrtf.c b/sysdeps/x86_64/fpu/e_sqrtf.c
index 639137b735..8f76ccb530 100644
--- a/sysdeps/x86_64/fpu/e_sqrtf.c
+++ b/sysdeps/x86_64/fpu/e_sqrtf.c
@@ -1,5 +1,5 @@
/* Square root of floating point number.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/fclrexcpt.c b/sysdeps/x86_64/fpu/fclrexcpt.c
index a8e00c0141..e7f6aa341f 100644
--- a/sysdeps/x86_64/fpu/fclrexcpt.c
+++ b/sysdeps/x86_64/fpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/fedisblxcpt.c b/sysdeps/x86_64/fpu/fedisblxcpt.c
index f1ea6cfa97..9153f997ed 100644
--- a/sysdeps/x86_64/fpu/fedisblxcpt.c
+++ b/sysdeps/x86_64/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2001.
diff --git a/sysdeps/x86_64/fpu/feenablxcpt.c b/sysdeps/x86_64/fpu/feenablxcpt.c
index df4c628b8d..7a3e26b3f9 100644
--- a/sysdeps/x86_64/fpu/feenablxcpt.c
+++ b/sysdeps/x86_64/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2001.
diff --git a/sysdeps/x86_64/fpu/fegetenv.c b/sysdeps/x86_64/fpu/fegetenv.c
index a28efb36f3..9461af7575 100644
--- a/sysdeps/x86_64/fpu/fegetenv.c
+++ b/sysdeps/x86_64/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/fegetexcept.c b/sysdeps/x86_64/fpu/fegetexcept.c
index 8acd0382a0..ce54c251ba 100644
--- a/sysdeps/x86_64/fpu/fegetexcept.c
+++ b/sysdeps/x86_64/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get enabled floating-point exceptions.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2001.
diff --git a/sysdeps/x86_64/fpu/fegetmode.c b/sysdeps/x86_64/fpu/fegetmode.c
new file mode 100644
index 0000000000..cc4f12649b
--- /dev/null
+++ b/sysdeps/x86_64/fpu/fegetmode.c
@@ -0,0 +1,28 @@
+/* Store current floating-point control modes. x86_64 version.
+ Copyright (C) 2016-2018 Free Software 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->__control_word);
+ __asm__ ("stmxcsr %0" : "=m" (modep->__mxcsr));
+ return 0;
+}
diff --git a/sysdeps/x86_64/fpu/fegetround.c b/sysdeps/x86_64/fpu/fegetround.c
index 296d366560..0f31cafedd 100644
--- a/sysdeps/x86_64/fpu/fegetround.c
+++ b/sysdeps/x86_64/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/x86_64/fpu/feholdexcpt.c b/sysdeps/x86_64/fpu/feholdexcpt.c
index a040c3dea5..dec689beb2 100644
--- a/sysdeps/x86_64/fpu/feholdexcpt.c
+++ b/sysdeps/x86_64/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/fesetenv.c b/sysdeps/x86_64/fpu/fesetenv.c
index 355d02aaa6..c12dba5101 100644
--- a/sysdeps/x86_64/fpu/fesetenv.c
+++ b/sysdeps/x86_64/fpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/fesetexcept.c b/sysdeps/x86_64/fpu/fesetexcept.c
new file mode 100644
index 0000000000..122a7629dc
--- /dev/null
+++ b/sysdeps/x86_64/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. x86_64 version.
+ Copyright (C) 2016-2018 Free Software 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..0771e4c10a
--- /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-2018 Free Software 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/fesetround.c b/sysdeps/x86_64/fpu/fesetround.c
index 475d63f4db..e5afc1d57a 100644
--- a/sysdeps/x86_64/fpu/fesetround.c
+++ b/sysdeps/x86_64/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/feupdateenv.c b/sysdeps/x86_64/fpu/feupdateenv.c
index f035d57ca8..00da535e64 100644
--- a/sysdeps/x86_64/fpu/feupdateenv.c
+++ b/sysdeps/x86_64/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/x86_64/fpu/fgetexcptflg.c b/sysdeps/x86_64/fpu/fgetexcptflg.c
index 938cf3e62b..16719ceb5e 100644
--- a/sysdeps/x86_64/fpu/fgetexcptflg.c
+++ b/sysdeps/x86_64/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/fraiseexcpt.c b/sysdeps/x86_64/fpu/fraiseexcpt.c
index e2abbbec33..ca1c223053 100644
--- a/sysdeps/x86_64/fpu/fraiseexcpt.c
+++ b/sysdeps/x86_64/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/fsetexcptflg.c b/sysdeps/x86_64/fpu/fsetexcptflg.c
index 76f7bad9a8..821dd9d786 100644
--- a/sysdeps/x86_64/fpu/fsetexcptflg.c
+++ b/sysdeps/x86_64/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/ftestexcept.c b/sysdeps/x86_64/fpu/ftestexcept.c
index c8f2c01c67..63167c68df 100644
--- a/sysdeps/x86_64/fpu/ftestexcept.c
+++ b/sysdeps/x86_64/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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 b/sysdeps/x86_64/fpu/libm-test-ulps
index 445b47527d..912db318b6 100644
--- a/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/sysdeps/x86_64/fpu/libm-test-ulps
@@ -3,1015 +3,1293 @@
# Maximal error of functions:
Function: "acos":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "acos_downward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "acos_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "acos_upward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "acosh":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "acosh_downward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "acosh_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "acosh_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "asin":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "asin_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "asin_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "asin_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "asinh":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "asinh_downward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "asinh_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "asinh_upward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "atan":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan2":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan2_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atan2_towardzero":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "atan2_upward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atan_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atan_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "atan_upward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "atanh":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "atanh_downward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "atanh_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "atanh_upward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "cabs":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_downward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cabs_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "cacos":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 3
+idouble: 3
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos_downward":
double: 5
float: 3
+float128: 6
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 6
+ldouble: 6
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 3
+idouble: 3
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos_towardzero":
double: 5
float: 3
+float128: 5
idouble: 5
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Real part of "cacos_upward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+float128: 7
+idouble: 5
+ifloat: 7
+ifloat128: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "cacosh":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "cacosh_downward":
double: 5
float: 3
+float128: 5
idouble: 5
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
-ildouble: 2
-ldouble: 2
+double: 3
+float: 3
+float128: 4
+idouble: 3
+ifloat: 3
+ifloat128: 4
+ildouble: 3
+ldouble: 3
Function: Real part of "cacosh_towardzero":
double: 5
float: 3
+float128: 5
idouble: 5
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 3
+idouble: 3
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Real part of "cacosh_upward":
double: 4
float: 4
+float128: 6
idouble: 4
ifloat: 4
+ifloat128: 6
ildouble: 5
ldouble: 5
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 4
+idouble: 3
ifloat: 2
-ildouble: 2
-ldouble: 2
+ifloat128: 4
+ildouble: 3
+ldouble: 3
Function: "carg":
float: 1
+float128: 2
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "carg_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "carg_towardzero":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "carg_upward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "casin":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
+float128: 3
idouble: 3
-ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "casin_downward":
double: 5
float: 3
+float128: 6
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 6
+ldouble: 6
Function: Real part of "casin_towardzero":
double: 3
float: 1
+float128: 3
idouble: 3
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "casin_towardzero":
double: 5
float: 3
+float128: 5
idouble: 5
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+float128: 3
+idouble: 3
+ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+float128: 7
+idouble: 5
+ifloat: 7
+ifloat128: 7
+ildouble: 7
+ldouble: 7
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+float128: 2
+idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "casinh":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "casinh_downward":
double: 5
float: 3
+float128: 6
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ifloat128: 6
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
+float128: 3
idouble: 3
-ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Real part of "casinh_towardzero":
double: 5
float: 3
+float128: 5
idouble: 5
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: Imaginary part of "casinh_towardzero":
double: 3
float: 1
+float128: 3
idouble: 3
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 3
+ildouble: 3
+ldouble: 3
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 5
-ldouble: 5
+double: 5
+float: 7
+float128: 7
+idouble: 5
+ifloat: 7
+ifloat128: 7
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+float128: 3
+idouble: 3
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Real part of "catan":
+double: 1
float: 1
+float128: 1
+idouble: 1
ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "catan":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
+float128: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "catan_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
+float128: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
+float128: 2
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Real part of "catan_upward":
+double: 1
float: 1
+float128: 2
+idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "catan_upward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "catanh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "catanh":
+double: 1
float: 1
+float128: 1
+idouble: 1
ifloat: 1
+ifloat128: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "catanh_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
+float128: 2
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_towardzero":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
+float128: 4
idouble: 4
-ifloat: 3
+ifloat: 4
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+float128: 2
+idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "cbrt":
double: 3
float: 1
+float128: 1
idouble: 3
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cbrt_downward":
double: 4
float: 1
+float128: 1
idouble: 4
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cbrt_towardzero":
double: 3
float: 1
+float128: 1
idouble: 3
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cbrt_upward":
double: 5
float: 1
+float128: 1
idouble: 5
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "ccos":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "ccos":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "ccos_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccos_downward":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccos_towardzero":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccos_towardzero":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccos_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "ccos_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "ccosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "ccosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "ccosh_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccosh_downward":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccosh_towardzero":
double: 1
float: 3
+float128: 2
idouble: 1
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "ccosh_towardzero":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "ccosh_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "ccosh_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "cexp":
double: 2
float: 1
+float128: 1
idouble: 2
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "cexp":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "cexp_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "cexp_downward":
double: 1
float: 3
+float128: 2
idouble: 1
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "cexp_towardzero":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "cexp_towardzero":
double: 1
float: 3
+float128: 2
idouble: 1
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "cexp_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cexp_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog":
double: 3
float: 3
+float128: 2
idouble: 3
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "clog":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "clog10":
double: 3
float: 4
+float128: 2
idouble: 3
ifloat: 4
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: Imaginary part of "clog10":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "clog10_downward":
double: 5
-float: 4
+float: 5
+float128: 3
idouble: 5
-ifloat: 4
+ifloat: 5
+ifloat128: 3
ildouble: 8
ldouble: 8
Function: Imaginary part of "clog10_downward":
double: 2
float: 4
+float128: 3
idouble: 2
ifloat: 4
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog10_towardzero":
double: 5
float: 5
+float128: 4
idouble: 5
ifloat: 5
+ifloat128: 4
ildouble: 8
ldouble: 8
Function: Imaginary part of "clog10_towardzero":
double: 2
float: 4
+float128: 3
idouble: 2
ifloat: 4
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog10_upward":
double: 6
float: 5
+float128: 4
idouble: 6
ifloat: 5
+ifloat128: 4
ildouble: 8
ldouble: 8
Function: Imaginary part of "clog10_upward":
double: 2
float: 4
+float128: 3
idouble: 2
ifloat: 4
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "clog_downward":
double: 4
float: 3
+float128: 3
idouble: 4
ifloat: 3
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Imaginary part of "clog_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "clog_towardzero":
double: 4
float: 4
+float128: 3
idouble: 4
ifloat: 4
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: Imaginary part of "clog_towardzero":
double: 1
float: 3
+float128: 2
idouble: 1
ifloat: 3
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "clog_upward":
double: 4
float: 3
+float128: 4
idouble: 4
ifloat: 3
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Imaginary part of "clog_upward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "cos":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "cos_downward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "cos_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cos_upward":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
@@ -1029,7 +1307,7 @@ Function: "cos_vlen4_avx2":
double: 2
Function: "cos_vlen8":
-double: 1
+double: 2
float: 1
Function: "cos_vlen8_avx2":
@@ -1038,546 +1316,690 @@ float: 1
Function: "cosh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cosh_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 3
Function: "cosh_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "cosh_upward":
double: 1
float: 2
+float128: 3
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 3
Function: Real part of "cpow":
double: 2
float: 5
+float128: 4
idouble: 2
ifloat: 5
+ifloat128: 4
ildouble: 3
ldouble: 3
Function: Imaginary part of "cpow":
float: 2
+float128: 1
ifloat: 2
+ifloat128: 1
ildouble: 4
ldouble: 4
Function: Real part of "cpow_downward":
double: 4
float: 8
+float128: 6
idouble: 4
ifloat: 8
+ifloat128: 6
ildouble: 7
ldouble: 7
Function: Imaginary part of "cpow_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "cpow_towardzero":
double: 4
float: 8
+float128: 6
idouble: 4
ifloat: 8
+ifloat128: 6
ildouble: 7
ldouble: 7
Function: Imaginary part of "cpow_towardzero":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: Real part of "cpow_upward":
double: 4
float: 1
+float128: 3
idouble: 4
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "cpow_upward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "csin":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
+Function: Imaginary part of "csin":
+float128: 1
+ifloat128: 1
+
Function: Real part of "csin_downward":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csin_downward":
double: 1
float: 2
+float128: 2
idouble: 1
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csin_towardzero":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csin_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csin_upward":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csin_upward":
double: 1
float: 3
+float128: 3
idouble: 1
ifloat: 3
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "csinh":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "csinh":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: Real part of "csinh_downward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csinh_downward":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csinh_towardzero":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Imaginary part of "csinh_towardzero":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csinh_upward":
double: 1
float: 3
+float128: 3
idouble: 1
ifloat: 3
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Imaginary part of "csinh_upward":
double: 2
float: 3
+float128: 2
idouble: 2
ifloat: 3
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: Real part of "csqrt":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Imaginary part of "csqrt":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: Real part of "csqrt_downward":
double: 5
float: 4
+float128: 4
idouble: 5
ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "csqrt_downward":
double: 4
float: 3
+float128: 3
idouble: 4
ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Real part of "csqrt_towardzero":
double: 4
float: 3
+float128: 3
idouble: 4
ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Imaginary part of "csqrt_towardzero":
double: 4
float: 3
+float128: 3
idouble: 4
ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Real part of "csqrt_upward":
double: 5
float: 4
+float128: 4
idouble: 5
ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "csqrt_upward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: Real part of "ctan":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Imaginary part of "ctan":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: Real part of "ctan_downward":
double: 6
float: 5
+float128: 4
idouble: 6
ifloat: 5
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "ctan_downward":
double: 2
float: 2
+float128: 5
idouble: 2
ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Real part of "ctan_towardzero":
double: 5
float: 3
+float128: 4
idouble: 5
ifloat: 3
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: Imaginary part of "ctan_towardzero":
double: 2
float: 2
+float128: 5
idouble: 2
ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Real part of "ctan_upward":
double: 2
float: 4
+float128: 5
idouble: 2
ifloat: 4
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: Imaginary part of "ctan_upward":
double: 2
-float: 1
+float: 2
+float128: 5
idouble: 2
-ifloat: 1
+ifloat: 2
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: Real part of "ctanh":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: Imaginary part of "ctanh":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: Real part of "ctanh_downward":
double: 4
float: 2
+float128: 5
idouble: 4
ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Imaginary part of "ctanh_downward":
double: 6
float: 5
+float128: 4
idouble: 6
ifloat: 5
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: Real part of "ctanh_towardzero":
double: 2
float: 2
+float128: 5
idouble: 2
ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: Imaginary part of "ctanh_towardzero":
double: 5
float: 3
+float128: 3
idouble: 5
ifloat: 3
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: Real part of "ctanh_upward":
double: 2
float: 2
+float128: 5
idouble: 2
ifloat: 2
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: Imaginary part of "ctanh_upward":
double: 2
float: 3
+float128: 5
idouble: 2
ifloat: 3
+ifloat128: 5
ildouble: 3
ldouble: 3
Function: "erf":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "erf_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "erf_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "erf_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "erfc":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "erfc_downward":
double: 5
float: 6
+float128: 5
idouble: 5
ifloat: 6
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "erfc_towardzero":
double: 3
float: 4
+float128: 4
idouble: 3
ifloat: 4
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "erfc_upward":
double: 5
float: 6
+float128: 5
idouble: 5
ifloat: 6
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "exp":
+float128: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp10":
double: 2
+float128: 2
idouble: 2
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "exp10_downward":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "exp10_towardzero":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "exp10_upward":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 2
ldouble: 2
Function: "exp2":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp2_downward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp2_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "exp2_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 2
ldouble: 2
@@ -1612,32 +2034,40 @@ float: 1
Function: "expm1":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "expm1_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "expm1_towardzero":
double: 1
float: 2
+float128: 4
idouble: 1
ifloat: 2
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "expm1_upward":
double: 1
float: 1
+float128: 3
idouble: 1
ifloat: 1
+ifloat128: 3
ildouble: 4
ldouble: 4
@@ -1675,275 +2105,347 @@ ldouble: 6
Function: "hypot":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "hypot_downward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "hypot_towardzero":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "hypot_upward":
double: 1
+float128: 1
idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "j0":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "j0_downward":
double: 2
float: 4
+float128: 4
idouble: 2
ifloat: 4
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "j0_towardzero":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: "j0_upward":
double: 3
float: 2
+float128: 5
idouble: 3
ifloat: 2
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "j1":
double: 1
float: 2
+float128: 4
idouble: 1
ifloat: 2
+ifloat128: 4
ildouble: 1
ldouble: 1
Function: "j1_downward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "j1_towardzero":
double: 3
float: 2
+float128: 4
idouble: 3
ifloat: 2
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "j1_upward":
double: 3
float: 5
+float128: 3
idouble: 3
ifloat: 5
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "jn":
double: 4
float: 4
+float128: 7
idouble: 4
ifloat: 4
+ifloat128: 7
ildouble: 4
ldouble: 4
Function: "jn_downward":
double: 5
float: 5
+float128: 8
idouble: 5
ifloat: 5
+ifloat128: 8
ildouble: 4
ldouble: 4
Function: "jn_towardzero":
double: 5
float: 5
+float128: 8
idouble: 5
ifloat: 5
+ifloat128: 8
ildouble: 5
ldouble: 5
Function: "jn_upward":
double: 5
float: 5
+float128: 7
idouble: 5
ifloat: 5
+ifloat128: 7
ildouble: 5
ldouble: 5
Function: "lgamma":
double: 4
float: 4
+float128: 5
idouble: 4
ifloat: 4
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "lgamma_downward":
double: 5
float: 4
+float128: 8
idouble: 5
ifloat: 4
+ifloat128: 8
ildouble: 7
ldouble: 7
Function: "lgamma_towardzero":
double: 5
float: 4
+float128: 5
idouble: 5
ifloat: 4
+ifloat128: 5
ildouble: 7
ldouble: 7
Function: "lgamma_upward":
double: 5
float: 5
+float128: 8
idouble: 5
ifloat: 5
+ifloat128: 8
ildouble: 6
ldouble: 6
Function: "log":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log10":
double: 2
float: 2
+float128: 1
idouble: 2
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log10_downward":
double: 2
float: 3
+float128: 1
idouble: 2
ifloat: 3
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "log10_towardzero":
double: 2
float: 2
+float128: 1
idouble: 2
ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "log10_upward":
double: 2
float: 2
+float128: 1
idouble: 2
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log1p":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "log1p_downward":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "log1p_towardzero":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "log1p_upward":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "log2":
double: 2
float: 1
+float128: 2
idouble: 2
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
Function: "log2_downward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "log2_towardzero":
double: 2
float: 2
+float128: 1
idouble: 2
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log2_upward":
double: 3
float: 3
+float128: 1
idouble: 3
ifloat: 3
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "log_downward":
float: 2
+float128: 1
ifloat: 2
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "log_towardzero":
float: 2
+float128: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "log_upward":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 1
ldouble: 1
@@ -1965,67 +2467,47 @@ double: 1
float: 3
Function: "log_vlen8_avx2":
-float: 2
+float: 3
Function: "pow":
+double: 1
float: 1
+float128: 2
+idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 1
ldouble: 1
-Function: "pow10":
-double: 2
-idouble: 2
-ildouble: 1
-ldouble: 1
-
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 2
-ldouble: 2
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 2
-ldouble: 2
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 2
-ldouble: 2
-
Function: "pow_downward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
+ifloat128: 2
ildouble: 4
ldouble: 4
Function: "pow_towardzero":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ifloat128: 2
+ildouble: 4
+ldouble: 4
Function: "pow_upward":
double: 1
float: 1
+float128: 2
idouble: 1
ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat128: 2
+ildouble: 4
+ldouble: 4
Function: "pow_vlen16":
float: 3
@@ -2048,24 +2530,34 @@ Function: "pow_vlen8_avx2":
float: 3
Function: "sin":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "sin_downward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "sin_towardzero":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "sin_upward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
@@ -2090,24 +2582,34 @@ Function: "sin_vlen8_avx2":
float: 1
Function: "sincos":
+double: 1
+float128: 1
+idouble: 1
+ifloat128: 1
ildouble: 1
ldouble: 1
Function: "sincos_downward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "sincos_towardzero":
double: 1
+float128: 2
idouble: 1
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "sincos_upward":
double: 1
+float128: 3
idouble: 1
+ifloat128: 3
ildouble: 3
ldouble: 3
@@ -2125,7 +2627,7 @@ Function: "sincos_vlen4_avx2":
double: 2
Function: "sincos_vlen8":
-double: 1
+double: 2
float: 1
Function: "sincos_vlen8_avx2":
@@ -2134,222 +2636,278 @@ float: 1
Function: "sinh":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "sinh_downward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: "sinh_towardzero":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "sinh_upward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "tan":
float: 1
+float128: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "tan_downward":
double: 1
float: 2
+float128: 1
idouble: 1
ifloat: 2
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "tan_towardzero":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 3
ldouble: 3
Function: "tan_upward":
double: 1
float: 1
+float128: 1
idouble: 1
ifloat: 1
+ifloat128: 1
ildouble: 2
ldouble: 2
Function: "tanh":
double: 2
float: 2
+float128: 2
idouble: 2
ifloat: 2
+ifloat128: 2
ildouble: 3
ldouble: 3
Function: "tanh_downward":
double: 3
float: 3
+float128: 4
idouble: 3
ifloat: 3
+ifloat128: 4
ildouble: 4
ldouble: 4
Function: "tanh_towardzero":
double: 2
float: 2
+float128: 3
idouble: 2
ifloat: 2
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "tanh_upward":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 4
ldouble: 4
Function: "tgamma":
double: 5
float: 5
+float128: 4
idouble: 5
ifloat: 5
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "tgamma_downward":
double: 5
float: 5
+float128: 5
idouble: 5
ifloat: 5
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "tgamma_towardzero":
double: 5
float: 5
+float128: 5
idouble: 5
ifloat: 5
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "tgamma_upward":
double: 5
float: 5
+float128: 4
idouble: 5
ifloat: 5
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "y0":
double: 2
float: 1
+float128: 3
idouble: 2
ifloat: 1
+ifloat128: 3
ildouble: 1
ldouble: 1
Function: "y0_downward":
double: 3
float: 4
+float128: 4
idouble: 3
ifloat: 4
+ifloat128: 4
ildouble: 5
ldouble: 5
Function: "y0_towardzero":
double: 3
float: 3
+float128: 3
idouble: 3
ifloat: 3
+ifloat128: 3
ildouble: 5
ldouble: 5
Function: "y0_upward":
double: 3
float: 5
+float128: 3
idouble: 3
ifloat: 5
+ifloat128: 3
ildouble: 3
ldouble: 3
Function: "y1":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 2
ldouble: 2
Function: "y1_downward":
double: 3
float: 2
+float128: 4
idouble: 3
ifloat: 2
+ifloat128: 4
ildouble: 7
ldouble: 7
Function: "y1_towardzero":
double: 3
float: 2
+float128: 2
idouble: 3
ifloat: 2
+ifloat128: 2
ildouble: 5
ldouble: 5
Function: "y1_upward":
double: 7
float: 2
+float128: 5
idouble: 7
ifloat: 2
+ifloat128: 5
ildouble: 7
ldouble: 7
Function: "yn":
double: 3
float: 3
+float128: 5
idouble: 3
ifloat: 3
+ifloat128: 5
ildouble: 4
ldouble: 4
Function: "yn_downward":
double: 3
float: 4
+float128: 5
idouble: 3
ifloat: 4
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "yn_towardzero":
double: 3
float: 3
+float128: 5
idouble: 3
ifloat: 3
+ifloat128: 5
ildouble: 5
ldouble: 5
Function: "yn_upward":
double: 4
float: 5
+float128: 5
idouble: 4
ifloat: 5
+ifloat128: 5
ildouble: 4
ldouble: 4
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/sysdeps/x86_64/fpu/math-tests-arch.h b/sysdeps/x86_64/fpu/math-tests-arch.h
index 867152046e..a5df133292 100644
--- a/sysdeps/x86_64/fpu/math-tests-arch.h
+++ b/sysdeps/x86_64/fpu/math-tests-arch.h
@@ -1,5 +1,5 @@
/* Runtime architecture check for math tests. x86_64 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,11 +16,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <cpu-features.h>
+
#if defined REQUIRE_AVX
-# include <init-arch.h>
# define INIT_ARCH_EXT
-
# define CHECK_ARCH_EXT \
do \
{ \
@@ -29,10 +29,8 @@
while (0)
#elif defined REQUIRE_AVX2
-# include <init-arch.h>
# define INIT_ARCH_EXT
-
# define CHECK_ARCH_EXT \
do \
{ \
@@ -41,10 +39,8 @@
while (0)
#elif defined REQUIRE_AVX512F
-# include <init-arch.h>
# define INIT_ARCH_EXT
-
# define CHECK_ARCH_EXT \
do \
{ \
diff --git a/sysdeps/x86_64/fpu/math_ldbl.h b/sysdeps/x86_64/fpu/math_ldbl.h
index b9ff8dadaf..27f8fce904 100644
--- a/sysdeps/x86_64/fpu/math_ldbl.h
+++ b/sysdeps/x86_64/fpu/math_ldbl.h
@@ -1,6 +1,25 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+/* Manipulation of the bit representation of 'long double' quantities.
+ Copyright (C) 2001-2018 Free Software 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_LDBL_H_
+#define _MATH_LDBL_H_ 1
+
+#include <stdint.h>
/* A union which permits us to convert between a long double and
three 32 bit ints. */
@@ -10,8 +29,8 @@ typedef union
long double value;
struct
{
- u_int32_t lsw;
- u_int32_t msw;
+ uint32_t lsw;
+ uint32_t msw;
int sign_exponent:16;
unsigned int empty1:16;
unsigned int empty0:32;
@@ -77,3 +96,5 @@ do { \
se_u.parts.sign_exponent = (exp); \
(d) = se_u.value; \
} while (0)
+
+#endif /* math_ldbl.h */
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
index 027a6a3a4d..13052893ef 100644
--- a/sysdeps/x86_64/fpu/math_private.h
+++ b/sysdeps/x86_64/fpu/math_private.h
@@ -48,38 +48,6 @@
#include <sysdeps/i386/fpu/fenv_private.h>
#include_next <math_private.h>
-extern __always_inline double
-__ieee754_sqrt (double d)
-{
- double res;
-#if defined __AVX__ || defined SSE2AVX
- asm ("vsqrtsd %1, %0, %0" : "=x" (res) : "xm" (d));
-#else
- asm ("sqrtsd %1, %0" : "=x" (res) : "xm" (d));
-#endif
- return res;
-}
-
-extern __always_inline float
-__ieee754_sqrtf (float d)
-{
- float res;
-#if defined __AVX__ || defined SSE2AVX
- asm ("vsqrtss %1, %0, %0" : "=x" (res) : "xm" (d));
-#else
- asm ("sqrtss %1, %0" : "=x" (res) : "xm" (d));
-#endif
- return res;
-}
-
-extern __always_inline long double
-__ieee754_sqrtl (long double d)
-{
- long double res;
- asm ("fsqrt" : "=t" (res) : "0" (d));
- return res;
-}
-
#ifdef __SSE4_1__
extern __always_inline double
__rint (double d)
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 34542155aa..9f387248aa 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -1,12 +1,54 @@
ifeq ($(subdir),math)
libm-sysdep_routines += s_floor-c s_ceil-c s_floorf-c s_ceilf-c \
- s_rint-c s_rintf-c s_nearbyint-c s_nearbyintf-c
+ s_rint-c s_rintf-c s_nearbyint-c s_nearbyintf-c \
+ s_trunc-c s_truncf-c
+
+libm-sysdep_routines += s_ceil-sse4_1 s_ceilf-sse4_1 s_floor-sse4_1 \
+ s_floorf-sse4_1 s_nearbyint-sse4_1 \
+ s_nearbyintf-sse4_1 s_rint-sse4_1 s_rintf-sse4_1 \
+ s_trunc-sse4_1 s_truncf-sse4_1
+
+libm-sysdep_routines += e_exp-fma e_log-fma e_pow-fma s_atan-fma \
+ e_asin-fma e_atan2-fma s_sin-fma s_tan-fma \
+ mpa-fma \
+ sincos32-fma doasin-fma dosincos-fma \
+ mpatan2-fma mpatan-fma mpsqrt-fma mptan-fma
+
+CFLAGS-doasin-fma.c = -mfma -mavx2
+CFLAGS-dosincos-fma.c = -mfma -mavx2
+CFLAGS-e_asin-fma.c = -mfma -mavx2
+CFLAGS-e_atan2-fma.c = -mfma -mavx2
+CFLAGS-e_exp-fma.c = -mfma -mavx2
+CFLAGS-e_log-fma.c = -mfma -mavx2
+CFLAGS-e_pow-fma.c = -mfma -mavx2 $(config-cflags-nofma)
+CFLAGS-mpa-fma.c = -mfma -mavx2
+CFLAGS-mpatan-fma.c = -mfma -mavx2
+CFLAGS-mpatan2-fma.c = -mfma -mavx2
+CFLAGS-mpsqrt-fma.c = -mfma -mavx2
+CFLAGS-mptan-fma.c = -mfma -mavx2
+CFLAGS-s_atan-fma.c = -mfma -mavx2
+CFLAGS-sincos32-fma.c = -mfma -mavx2
+CFLAGS-s_sin-fma.c = -mfma -mavx2
+CFLAGS-s_tan-fma.c = -mfma -mavx2
+
+libm-sysdep_routines += s_sinf-sse2 s_cosf-sse2 s_sincosf-sse2
+
+libm-sysdep_routines += e_exp2f-fma e_expf-fma e_log2f-fma e_logf-fma \
+ e_powf-fma s_sinf-fma s_cosf-fma s_sincosf-fma
+
+CFLAGS-e_exp2f-fma.c = -mfma -mavx2
+CFLAGS-e_expf-fma.c = -mfma -mavx2
+CFLAGS-e_log2f-fma.c = -mfma -mavx2
+CFLAGS-e_logf-fma.c = -mfma -mavx2
+CFLAGS-e_powf-fma.c = -mfma -mavx2
+CFLAGS-s_sinf-fma.c = -mfma -mavx2
+CFLAGS-s_cosf-fma.c = -mfma -mavx2
+CFLAGS-s_sincosf-fma.c = -mfma -mavx2
libm-sysdep_routines += e_exp-fma4 e_log-fma4 e_pow-fma4 s_atan-fma4 \
e_asin-fma4 e_atan2-fma4 s_sin-fma4 s_tan-fma4 \
- mplog-fma4 mpa-fma4 slowexp-fma4 slowpow-fma4 \
+ mpa-fma4 \
sincos32-fma4 doasin-fma4 dosincos-fma4 \
- halfulp-fma4 mpexp-fma4 \
mpatan2-fma4 mpatan-fma4 mpsqrt-fma4 mptan-fma4
CFLAGS-doasin-fma4.c = -mfma4
@@ -16,35 +58,26 @@ CFLAGS-e_atan2-fma4.c = -mfma4
CFLAGS-e_exp-fma4.c = -mfma4
CFLAGS-e_log-fma4.c = -mfma4
CFLAGS-e_pow-fma4.c = -mfma4 $(config-cflags-nofma)
-CFLAGS-halfulp-fma4.c = -mfma4
CFLAGS-mpa-fma4.c = -mfma4
CFLAGS-mpatan-fma4.c = -mfma4
CFLAGS-mpatan2-fma4.c = -mfma4
-CFLAGS-mpexp-fma4.c = -mfma4
-CFLAGS-mplog-fma4.c = -mfma4
CFLAGS-mpsqrt-fma4.c = -mfma4
CFLAGS-mptan-fma4.c = -mfma4
CFLAGS-s_atan-fma4.c = -mfma4
CFLAGS-sincos32-fma4.c = -mfma4
-CFLAGS-slowexp-fma4.c = -mfma4
-CFLAGS-slowpow-fma4.c = -mfma4
CFLAGS-s_sin-fma4.c = -mfma4
CFLAGS-s_tan-fma4.c = -mfma4
libm-sysdep_routines += e_exp-avx e_log-avx s_atan-avx \
e_atan2-avx s_sin-avx s_tan-avx \
- mplog-avx mpa-avx slowexp-avx \
- mpexp-avx
+ mpa-avx
CFLAGS-e_atan2-avx.c = -msse2avx -DSSE2AVX
CFLAGS-e_exp-avx.c = -msse2avx -DSSE2AVX
CFLAGS-e_log-avx.c = -msse2avx -DSSE2AVX
CFLAGS-mpa-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-mpexp-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-mplog-avx.c = -msse2avx -DSSE2AVX
CFLAGS-s_atan-avx.c = -msse2avx -DSSE2AVX
CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-slowexp-avx.c = -msse2avx -DSSE2AVX
CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX
endif
@@ -66,5 +99,35 @@ libmvec-sysdep_routines += svml_d_cos2_core_sse4 svml_d_cos4_core_avx2 \
svml_d_pow4_core_avx2 svml_d_pow8_core_avx512 \
svml_s_powf4_core_sse4 svml_s_powf8_core_avx2 \
svml_s_powf16_core_avx512 svml_s_sincosf4_core_sse4 \
- svml_s_sincosf8_core_avx2 svml_s_sincosf16_core_avx512
+ svml_s_sincosf8_core_avx2 \
+ svml_s_sincosf16_core_avx512 \
+ svml_d_cos2_core-sse2 svml_d_cos4_core-sse \
+ svml_d_cos8_core-avx2 svml_d_exp2_core-sse2 \
+ svml_d_exp4_core-sse svml_d_exp8_core-avx2 \
+ svml_d_log2_core-sse2 svml_d_log4_core-sse \
+ svml_d_log8_core-avx2 svml_d_pow2_core-sse2 \
+ svml_d_pow4_core-sse svml_d_pow8_core-avx2 \
+ svml_d_sin2_core-sse2 svml_d_sin4_core-sse \
+ svml_d_sin8_core-avx2 \
+ svml_d_sincos2_core-sse2 \
+ svml_d_sincos4_core-sse \
+ svml_d_sincos8_core-avx2 \
+ svml_s_cosf16_core-avx2 \
+ svml_s_cosf4_core-sse2 \
+ svml_s_cosf8_core-sse \
+ svml_s_expf16_core-avx2 \
+ svml_s_expf4_core-sse2 \
+ svml_s_expf8_core-sse \
+ svml_s_logf16_core-avx2 \
+ svml_s_logf4_core-sse2 \
+ svml_s_logf8_core-sse \
+ svml_s_powf16_core-avx2 \
+ svml_s_powf4_core-sse2 \
+ svml_s_powf8_core-sse \
+ svml_s_sincosf16_core-avx2 \
+ svml_s_sincosf4_core-sse2 \
+ svml_s_sincosf8_core-sse \
+ svml_s_sinf16_core-avx2 \
+ svml_s_sinf4_core-sse2 \
+ svml_s_sinf8_core-sse
endif
diff --git a/sysdeps/x86_64/fpu/multiarch/doasin-fma.c b/sysdeps/x86_64/fpu/multiarch/doasin-fma.c
new file mode 100644
index 0000000000..7a09865fca
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/doasin-fma.c
@@ -0,0 +1,4 @@
+#define __doasin __doasin_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/doasin.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/dosincos-fma.c b/sysdeps/x86_64/fpu/multiarch/dosincos-fma.c
new file mode 100644
index 0000000000..5744586bdb
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/dosincos-fma.c
@@ -0,0 +1,6 @@
+#define __docos __docos_fma
+#define __dubcos __dubcos_fma
+#define __dubsin __dubsin_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/dosincos.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_asin-fma.c b/sysdeps/x86_64/fpu/multiarch/e_asin-fma.c
new file mode 100644
index 0000000000..50e9c64247
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_asin-fma.c
@@ -0,0 +1,11 @@
+#define __ieee754_acos __ieee754_acos_fma
+#define __ieee754_asin __ieee754_asin_fma
+#define __cos32 __cos32_fma
+#define __doasin __doasin_fma
+#define __docos __docos_fma
+#define __dubcos __dubcos_fma
+#define __dubsin __dubsin_fma
+#define __sin32 __sin32_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/e_asin.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_asin.c b/sysdeps/x86_64/fpu/multiarch/e_asin.c
index 111a5b99bd..8d47004e4f 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_asin.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_asin.c
@@ -1,26 +1,40 @@
-#include <init-arch.h>
-#include <math.h>
-#include <math_private.h>
-
-extern double __ieee754_acos_sse2 (double);
-extern double __ieee754_asin_sse2 (double);
-extern double __ieee754_acos_fma4 (double);
-extern double __ieee754_asin_fma4 (double);
-
-libm_ifunc (__ieee754_acos,
- HAS_ARCH_FEATURE (FMA4_Usable)
- ? __ieee754_acos_fma4
- : __ieee754_acos_sse2);
-strong_alias (__ieee754_acos, __acos_finite)
+/* Multiple versions of IEEE 754 asin and acos.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+extern double __redirect_ieee754_asin (double);
+extern double __redirect_ieee754_acos (double);
+
+#define SYMBOL_NAME ieee754_asin
+#include "ifunc-fma4.h"
-libm_ifunc (__ieee754_asin,
- HAS_ARCH_FEATURE (FMA4_Usable)
- ? __ieee754_asin_fma4
- : __ieee754_asin_sse2);
+libc_ifunc_redirected (__redirect_ieee754_asin, __ieee754_asin,
+ IFUNC_SELECTOR ());
strong_alias (__ieee754_asin, __asin_finite)
-#define __ieee754_acos __ieee754_acos_sse2
-#define __ieee754_asin __ieee754_asin_sse2
+#undef SYMBOL_NAME
+#define SYMBOL_NAME ieee754_acos
+#include "ifunc-fma4.h"
+
+libc_ifunc_redirected (__redirect_ieee754_acos, __ieee754_acos,
+ IFUNC_SELECTOR ());
+strong_alias (__ieee754_acos, __acos_finite)
+#define __ieee754_acos __ieee754_acos_sse2
+#define __ieee754_asin __ieee754_asin_sse2
#include <sysdeps/ieee754/dbl-64/e_asin.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_atan2-fma.c b/sysdeps/x86_64/fpu/multiarch/e_atan2-fma.c
new file mode 100644
index 0000000000..caba686496
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_atan2-fma.c
@@ -0,0 +1,10 @@
+#define __ieee754_atan2 __ieee754_atan2_fma
+#define __add __add_fma
+#define __dbl_mp __dbl_mp_fma
+#define __dvd __dvd_fma
+#define __mpatan2 __mpatan2_fma
+#define __mul __mul_fma
+#define __sub __sub_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/e_atan2.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_atan2.c b/sysdeps/x86_64/fpu/multiarch/e_atan2.c
index 9ca3c02a44..6c2dd5af37 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_atan2.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_atan2.c
@@ -1,18 +1,29 @@
-#include <init-arch.h>
-#include <math.h>
-#include <math_private.h>
+/* Multiple versions of IEEE 754 atan.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-extern double __ieee754_atan2_sse2 (double, double);
-extern double __ieee754_atan2_avx (double, double);
-extern double __ieee754_atan2_fma4 (double, double);
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-libm_ifunc (__ieee754_atan2,
- HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_atan2_fma4
- : (HAS_ARCH_FEATURE (AVX_Usable)
- ? __ieee754_atan2_avx : __ieee754_atan2_sse2));
-strong_alias (__ieee754_atan2, __atan2_finite)
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#define __ieee754_atan2 __ieee754_atan2_sse2
+ 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/>. */
+
+extern double __redirect_ieee754_atan2 (double, double);
+#define SYMBOL_NAME ieee754_atan2
+#include "ifunc-avx-fma4.h"
+libc_ifunc_redirected (__redirect_ieee754_atan2,
+ __ieee754_atan2, IFUNC_SELECTOR ());
+strong_alias (__ieee754_atan2, __atan2_finite)
+
+#define __ieee754_atan2 __ieee754_atan2_sse2
#include <sysdeps/ieee754/dbl-64/e_atan2.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp-avx.c b/sysdeps/x86_64/fpu/multiarch/e_exp-avx.c
index ee5dd6d2dc..afd917442a 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_exp-avx.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_exp-avx.c
@@ -1,6 +1,5 @@
#define __ieee754_exp __ieee754_exp_avx
#define __exp1 __exp1_avx
-#define __slowexp __slowexp_avx
#define SECTION __attribute__ ((section (".text.avx")))
#include <sysdeps/ieee754/dbl-64/e_exp.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp-fma.c b/sysdeps/x86_64/fpu/multiarch/e_exp-fma.c
new file mode 100644
index 0000000000..765b1b9dd3
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_exp-fma.c
@@ -0,0 +1,5 @@
+#define __ieee754_exp __ieee754_exp_fma
+#define __exp1 __exp1_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/e_exp.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c b/sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c
index ae6eb67603..9ac7acad28 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c
@@ -1,6 +1,5 @@
#define __ieee754_exp __ieee754_exp_fma4
#define __exp1 __exp1_fma4
-#define __slowexp __slowexp_fma4
#define SECTION __attribute__ ((section (".text.fma4")))
#include <sysdeps/ieee754/dbl-64/e_exp.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp.c b/sysdeps/x86_64/fpu/multiarch/e_exp.c
index b7d7b5ff27..7cd7d1729c 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_exp.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_exp.c
@@ -1,18 +1,29 @@
-#include <init-arch.h>
-#include <math.h>
-#include <math_private.h>
+/* Multiple versions of IEEE 754 exp.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-extern double __ieee754_exp_sse2 (double);
-extern double __ieee754_exp_avx (double);
-extern double __ieee754_exp_fma4 (double);
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-libm_ifunc (__ieee754_exp,
- HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_exp_fma4
- : (HAS_ARCH_FEATURE (AVX_Usable)
- ? __ieee754_exp_avx : __ieee754_exp_sse2));
-strong_alias (__ieee754_exp, __exp_finite)
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#define __ieee754_exp __ieee754_exp_sse2
+ 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/>. */
+
+extern double __redirect_ieee754_exp (double);
+#define SYMBOL_NAME ieee754_exp
+#include "ifunc-avx-fma4.h"
+libc_ifunc_redirected (__redirect_ieee754_exp, __ieee754_exp,
+ IFUNC_SELECTOR ());
+strong_alias (__ieee754_exp, __exp_finite)
+
+#define __ieee754_exp __ieee754_exp_sse2
#include <sysdeps/ieee754/dbl-64/e_exp.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp2f-fma.c b/sysdeps/x86_64/fpu/multiarch/e_exp2f-fma.c
new file mode 100644
index 0000000000..c915a50794
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_exp2f-fma.c
@@ -0,0 +1,3 @@
+#define __exp2f __exp2f_fma
+
+#include <sysdeps/ieee754/flt-32/e_exp2f.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp2f.c b/sysdeps/x86_64/fpu/multiarch/e_exp2f.c
new file mode 100644
index 0000000000..e3a0706839
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_exp2f.c
@@ -0,0 +1,40 @@
+/* Multiple versions of exp2f.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+extern float __redirect_exp2f (float);
+
+#define SYMBOL_NAME exp2f
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_exp2f, __exp2f, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+# include <shlib-compat.h>
+versioned_symbol (libm, __exp2f, exp2f, GLIBC_2_27);
+libm_alias_float_other (__exp2, exp2)
+#else
+libm_alias_float (__exp2, exp2)
+#endif
+
+strong_alias (__exp2f, __ieee754_exp2f)
+strong_alias (__exp2f, __exp2f_finite)
+
+#define __exp2f __exp2f_sse2
+#include <sysdeps/ieee754/flt-32/e_exp2f.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_expf-fma.c b/sysdeps/x86_64/fpu/multiarch/e_expf-fma.c
new file mode 100644
index 0000000000..4e01cd6a82
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_expf-fma.c
@@ -0,0 +1,3 @@
+#define __expf __expf_fma
+
+#include <sysdeps/ieee754/flt-32/e_expf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_expf.c b/sysdeps/x86_64/fpu/multiarch/e_expf.c
new file mode 100644
index 0000000000..2b7c7ccbd0
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_expf.c
@@ -0,0 +1,43 @@
+/* Multiple versions of expf.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+extern float __redirect_expf (float);
+
+#define SYMBOL_NAME expf
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_expf, __expf, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__expf, __GI___expf, __redirect_expf)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __expf, expf, GLIBC_2_27);
+libm_alias_float_other (__exp, exp)
+#else
+libm_alias_float (__exp, exp)
+#endif
+
+strong_alias (__expf, __ieee754_expf)
+strong_alias (__expf, __expf_finite)
+
+#define __expf __expf_sse2
+#include <sysdeps/ieee754/flt-32/e_expf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_log-avx.c b/sysdeps/x86_64/fpu/multiarch/e_log-avx.c
index c669019bc2..b22a5767be 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_log-avx.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_log-avx.c
@@ -1,8 +1,4 @@
#define __ieee754_log __ieee754_log_avx
-#define __mplog __mplog_avx
-#define __add __add_avx
-#define __dbl_mp __dbl_mp_avx
-#define __sub __sub_avx
#define SECTION __attribute__ ((section (".text.avx")))
#include <sysdeps/ieee754/dbl-64/e_log.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_log-fma.c b/sysdeps/x86_64/fpu/multiarch/e_log-fma.c
new file mode 100644
index 0000000000..bce0ee03c2
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_log-fma.c
@@ -0,0 +1,4 @@
+#define __ieee754_log __ieee754_log_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/e_log.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_log-fma4.c b/sysdeps/x86_64/fpu/multiarch/e_log-fma4.c
index a2346cc618..f458f9c23c 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_log-fma4.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_log-fma4.c
@@ -1,8 +1,4 @@
#define __ieee754_log __ieee754_log_fma4
-#define __mplog __mplog_fma4
-#define __add __add_fma4
-#define __dbl_mp __dbl_mp_fma4
-#define __sub __sub_fma4
#define SECTION __attribute__ ((section (".text.fma4")))
#include <sysdeps/ieee754/dbl-64/e_log.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_log.c b/sysdeps/x86_64/fpu/multiarch/e_log.c
index cf9533d6c0..e0a1b02fae 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_log.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_log.c
@@ -1,18 +1,29 @@
-#include <init-arch.h>
-#include <math.h>
-#include <math_private.h>
+/* Multiple versions of IEEE 754 log.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-extern double __ieee754_log_sse2 (double);
-extern double __ieee754_log_avx (double);
-extern double __ieee754_log_fma4 (double);
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-libm_ifunc (__ieee754_log,
- HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_log_fma4
- : (HAS_ARCH_FEATURE (AVX_Usable)
- ? __ieee754_log_avx : __ieee754_log_sse2));
-strong_alias (__ieee754_log, __log_finite)
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#define __ieee754_log __ieee754_log_sse2
+ 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/>. */
+
+extern double __redirect_ieee754_log (double);
+#define SYMBOL_NAME ieee754_log
+#include "ifunc-avx-fma4.h"
+libc_ifunc_redirected (__redirect_ieee754_log, __ieee754_log,
+ IFUNC_SELECTOR ());
+strong_alias (__ieee754_log, __log_finite)
+
+#define __ieee754_log __ieee754_log_sse2
#include <sysdeps/ieee754/dbl-64/e_log.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_log2f-fma.c b/sysdeps/x86_64/fpu/multiarch/e_log2f-fma.c
new file mode 100644
index 0000000000..8a76b836fb
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_log2f-fma.c
@@ -0,0 +1,3 @@
+#define __log2f __log2f_fma
+
+#include <sysdeps/ieee754/flt-32/e_log2f.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_log2f.c b/sysdeps/x86_64/fpu/multiarch/e_log2f.c
new file mode 100644
index 0000000000..12d0c30dd3
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_log2f.c
@@ -0,0 +1,43 @@
+/* Multiple versions of log2f.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+extern float __redirect_log2f (float);
+
+#define SYMBOL_NAME log2f
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_log2f, __log2f, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__log2f, __GI___log2f, __redirect_log2f)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __log2f, log2f, GLIBC_2_27);
+libm_alias_float_other (__log2, log2)
+#else
+libm_alias_float (__log2, log2)
+#endif
+
+strong_alias (__log2f, __ieee754_log2f)
+strong_alias (__log2f, __log2f_finite)
+
+#define __log2f __log2f_sse2
+#include <sysdeps/ieee754/flt-32/e_log2f.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_logf-fma.c b/sysdeps/x86_64/fpu/multiarch/e_logf-fma.c
new file mode 100644
index 0000000000..a47fd8195f
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_logf-fma.c
@@ -0,0 +1,3 @@
+#define __logf __logf_fma
+
+#include <sysdeps/ieee754/flt-32/e_logf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_logf.c b/sysdeps/x86_64/fpu/multiarch/e_logf.c
new file mode 100644
index 0000000000..224d40a1e4
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_logf.c
@@ -0,0 +1,43 @@
+/* Multiple versions of logf.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+extern float __redirect_logf (float);
+
+#define SYMBOL_NAME logf
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_logf, __logf, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__logf, __GI___logf, __redirect_logf)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __logf, logf, GLIBC_2_27);
+libm_alias_float_other (__log, log)
+#else
+libm_alias_float (__log, log)
+#endif
+
+strong_alias (__logf, __ieee754_logf)
+strong_alias (__logf, __logf_finite)
+
+#define __logf __logf_sse2
+#include <sysdeps/ieee754/flt-32/e_logf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_pow-fma.c b/sysdeps/x86_64/fpu/multiarch/e_pow-fma.c
new file mode 100644
index 0000000000..73c1e7fb89
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_pow-fma.c
@@ -0,0 +1,5 @@
+#define __ieee754_pow __ieee754_pow_fma
+#define __exp1 __exp1_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/e_pow.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c b/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c
index 5b3ea8e103..8971b655ca 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c
@@ -1,6 +1,5 @@
#define __ieee754_pow __ieee754_pow_fma4
#define __exp1 __exp1_fma4
-#define __slowpow __slowpow_fma4
#define SECTION __attribute__ ((section (".text.fma4")))
#include <sysdeps/ieee754/dbl-64/e_pow.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_pow.c b/sysdeps/x86_64/fpu/multiarch/e_pow.c
index a5c5d89c3e..084073c936 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_pow.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_pow.c
@@ -1,17 +1,29 @@
-#include <init-arch.h>
-#include <math.h>
-#include <math_private.h>
+/* Multiple versions of IEEE 754 pow.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-extern double __ieee754_pow_sse2 (double, double);
-extern double __ieee754_pow_fma4 (double, double);
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-libm_ifunc (__ieee754_pow,
- HAS_ARCH_FEATURE (FMA4_Usable)
- ? __ieee754_pow_fma4
- : __ieee754_pow_sse2);
-strong_alias (__ieee754_pow, __pow_finite)
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#define __ieee754_pow __ieee754_pow_sse2
+ 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/>. */
+
+extern double __redirect_ieee754_pow (double, double);
+#define SYMBOL_NAME ieee754_pow
+#include "ifunc-fma4.h"
+libc_ifunc_redirected (__redirect_ieee754_pow,
+ __ieee754_pow, IFUNC_SELECTOR ());
+strong_alias (__ieee754_pow, __pow_finite)
+
+#define __ieee754_pow __ieee754_pow_sse2
#include <sysdeps/ieee754/dbl-64/e_pow.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_powf-fma.c b/sysdeps/x86_64/fpu/multiarch/e_powf-fma.c
new file mode 100644
index 0000000000..fdf5dcc56a
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_powf-fma.c
@@ -0,0 +1,3 @@
+#define __powf __powf_fma
+
+#include <sysdeps/ieee754/flt-32/e_powf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_powf.c b/sysdeps/x86_64/fpu/multiarch/e_powf.c
new file mode 100644
index 0000000000..a185006f40
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_powf.c
@@ -0,0 +1,46 @@
+/* Multiple versions of powf.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+#define powf __redirect_powf
+#define __DECL_SIMD___redirect_powf
+#include <math.h>
+#undef powf
+
+#define SYMBOL_NAME powf
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_powf, __powf, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__powf, __GI___powf, __redirect_powf)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __powf, powf, GLIBC_2_27);
+libm_alias_float_other (__pow, pow)
+#else
+libm_alias_float (__pow, pow)
+#endif
+
+strong_alias (__powf, __ieee754_powf)
+strong_alias (__powf, __powf_finite)
+
+#define __powf __powf_sse2
+#include <sysdeps/ieee754/flt-32/e_powf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c b/sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c
deleted file mode 100644
index a00c17c016..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#define __halfulp __halfulp_fma4
-#define SECTION __attribute__ ((section (".text.fma4")))
-
-#include <sysdeps/ieee754/dbl-64/halfulp.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h b/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h
new file mode 100644
index 0000000000..a5f9375afc
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h
@@ -0,0 +1,43 @@
+/* Common definition for ifunc selections optimized with AVX, AVX2/FMA
+ and FMA4.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (fma) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (fma4) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, FMA_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable))
+ return OPTIMIZE (fma);
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, FMA4_Usable))
+ return OPTIMIZE (fma4);
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX_Usable))
+ return OPTIMIZE (avx);
+
+ return OPTIMIZE (sse2);
+}
diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-fma.h b/sysdeps/x86_64/fpu/multiarch/ifunc-fma.h
new file mode 100644
index 0000000000..63a8cd221f
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/ifunc-fma.h
@@ -0,0 +1,34 @@
+/* Common definition for ifunc selections optimized with AVX2/FMA.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (fma) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, FMA_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable))
+ return OPTIMIZE (fma);
+
+ return OPTIMIZE (sse2);
+}
diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
new file mode 100644
index 0000000000..a2526a2ee0
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
@@ -0,0 +1,39 @@
+/* Common definition for ifunc selections optimized with AVX2/FMA and
+ FMA4.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (fma) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (fma4) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, FMA_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable))
+ return OPTIMIZE (fma);
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, FMA4_Usable))
+ return OPTIMIZE (fma4);
+
+ return OPTIMIZE (sse2);
+}
diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h b/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h
new file mode 100644
index 0000000000..bd2d32e418
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h
@@ -0,0 +1,39 @@
+/* Common definition for libmathvec ifunc selections optimized with
+ AVX2.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+#undef PASTER2
+#define PASTER2(x,y) x##_##y
+
+extern void REDIRECT_NAME (void);
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse_wrapper) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, FMA_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable))
+ return OPTIMIZE (avx2);
+
+ return OPTIMIZE (sse_wrapper);
+}
diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h b/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h
new file mode 100644
index 0000000000..174e462cfb
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h
@@ -0,0 +1,45 @@
+/* Common definition for libmathvec ifunc selections optimized with
+ AVX512.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+#undef PASTER2
+#define PASTER2(x,y) x##_##y
+
+extern void REDIRECT_NAME (void);
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_wrapper) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (knl) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (skx) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (!CPU_FEATURES_ARCH_P (cpu_features, MathVec_Prefer_No_AVX512))
+ {
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX512DQ_Usable))
+ return OPTIMIZE (skx);
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable))
+ return OPTIMIZE (knl);
+ }
+
+ return OPTIMIZE (avx2_wrapper);
+}
diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-sse4_1.h b/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-sse4_1.h
new file mode 100644
index 0000000000..c1e70ebfc1
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-sse4_1.h
@@ -0,0 +1,38 @@
+/* Common definition for libmathvec ifunc selections optimized with
+ SSE4.1.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+#undef PASTER2
+#define PASTER2(x,y) x##_##y
+
+extern void REDIRECT_NAME (void);
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse4) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE4_1))
+ return OPTIMIZE (sse4);
+
+ return OPTIMIZE (sse2);
+}
diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-sse4_1.h b/sysdeps/x86_64/fpu/multiarch/ifunc-sse4_1.h
new file mode 100644
index 0000000000..a8710ba802
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/ifunc-sse4_1.h
@@ -0,0 +1,33 @@
+/* Common definition for ifunc selections optimized with SSE4.1.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (c) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse41) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE4_1))
+ return OPTIMIZE (sse41);
+
+ return OPTIMIZE (c);
+}
diff --git a/sysdeps/x86_64/fpu/multiarch/mpa-fma.c b/sysdeps/x86_64/fpu/multiarch/mpa-fma.c
new file mode 100644
index 0000000000..177cc2517f
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/mpa-fma.c
@@ -0,0 +1,14 @@
+#define __add __add_fma
+#define __mul __mul_fma
+#define __sqr __sqr_fma
+#define __sub __sub_fma
+#define __dbl_mp __dbl_mp_fma
+#define __dvd __dvd_fma
+
+#define NO___CPY 1
+#define NO___MP_DBL 1
+#define NO___ACR 1
+#define NO__CONST 1
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/mpa.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/mpatan-fma.c b/sysdeps/x86_64/fpu/multiarch/mpatan-fma.c
new file mode 100644
index 0000000000..d216f9142d
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/mpatan-fma.c
@@ -0,0 +1,10 @@
+#define __mpatan __mpatan_fma
+#define __add __add_fma
+#define __dvd __dvd_fma
+#define __mpsqrt __mpsqrt_fma
+#define __mul __mul_fma
+#define __sub __sub_fma
+#define AVOID_MPATAN_H 1
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/mpatan.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/mpatan2-fma.c b/sysdeps/x86_64/fpu/multiarch/mpatan2-fma.c
new file mode 100644
index 0000000000..98df336f79
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/mpatan2-fma.c
@@ -0,0 +1,9 @@
+#define __mpatan2 __mpatan2_fma
+#define __add __add_fma
+#define __dvd __dvd_fma
+#define __mpatan __mpatan_fma
+#define __mpsqrt __mpsqrt_fma
+#define __mul __mul_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/mpatan2.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/mpexp-avx.c b/sysdeps/x86_64/fpu/multiarch/mpexp-avx.c
deleted file mode 100644
index 87f29c96c9..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/mpexp-avx.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#define __mpexp __mpexp_avx
-#define __add __add_avx
-#define __dbl_mp __dbl_mp_avx
-#define __dvd __dvd_avx
-#define __mul __mul_avx
-#define AVOID_MPEXP_H 1
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/mpexp.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c b/sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c
deleted file mode 100644
index 07ca6e9ad0..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#define __mpexp __mpexp_fma4
-#define __add __add_fma4
-#define __dbl_mp __dbl_mp_fma4
-#define __dvd __dvd_fma4
-#define __mul __mul_fma4
-#define AVOID_MPEXP_H 1
-#define SECTION __attribute__ ((section (".text.fma4")))
-
-#include <sysdeps/ieee754/dbl-64/mpexp.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/mplog-avx.c b/sysdeps/x86_64/fpu/multiarch/mplog-avx.c
deleted file mode 100644
index fd783d9a67..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/mplog-avx.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#define __mplog __mplog_avx
-#define __add __add_avx
-#define __mpexp __mpexp_avx
-#define __mul __mul_avx
-#define __sub __sub_avx
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/mplog.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/mplog-fma4.c b/sysdeps/x86_64/fpu/multiarch/mplog-fma4.c
deleted file mode 100644
index b4733118d7..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/mplog-fma4.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#define __mplog __mplog_fma4
-#define __add __add_fma4
-#define __mpexp __mpexp_fma4
-#define __mul __mul_fma4
-#define __sub __sub_fma4
-#define SECTION __attribute__ ((section (".text.fma4")))
-
-#include <sysdeps/ieee754/dbl-64/mplog.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/mpsqrt-fma.c b/sysdeps/x86_64/fpu/multiarch/mpsqrt-fma.c
new file mode 100644
index 0000000000..44d7a23ae3
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/mpsqrt-fma.c
@@ -0,0 +1,8 @@
+#define __mpsqrt __mpsqrt_fma
+#define __dbl_mp __dbl_mp_fma
+#define __mul __mul_fma
+#define __sub __sub_fma
+#define AVOID_MPSQRT_H 1
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/mpsqrt.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/mptan-fma.c b/sysdeps/x86_64/fpu/multiarch/mptan-fma.c
new file mode 100644
index 0000000000..d1a691413c
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/mptan-fma.c
@@ -0,0 +1,7 @@
+#define __mptan __mptan_fma
+#define __c32 __c32_fma
+#define __dvd __dvd_fma
+#define __mpranred __mpranred_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/mptan.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_atan-avx.c b/sysdeps/x86_64/fpu/multiarch/s_atan-avx.c
index b5cb9c3a75..41816bfe6c 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_atan-avx.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_atan-avx.c
@@ -1,4 +1,4 @@
-#define atan __atan_avx
+#define __atan __atan_avx
#define __add __add_avx
#define __dbl_mp __dbl_mp_avx
#define __mul __mul_avx
diff --git a/sysdeps/x86_64/fpu/multiarch/s_atan-fma.c b/sysdeps/x86_64/fpu/multiarch/s_atan-fma.c
new file mode 100644
index 0000000000..363e32bcbd
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_atan-fma.c
@@ -0,0 +1,9 @@
+#define __atan __atan_fma
+#define __add __add_fma
+#define __dbl_mp __dbl_mp_fma
+#define __mpatan __mpatan_fma
+#define __mul __mul_fma
+#define __sub __sub_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/s_atan.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c b/sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c
index 9e83e6cdab..ad8d3af579 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c
@@ -1,4 +1,4 @@
-#define atan __atan_fma4
+#define __atan __atan_fma4
#define __add __add_fma4
#define __dbl_mp __dbl_mp_fma4
#define __mpatan __mpatan_fma4
diff --git a/sysdeps/x86_64/fpu/multiarch/s_atan.c b/sysdeps/x86_64/fpu/multiarch/s_atan.c
index 742e95cb96..f9ce8549ab 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_atan.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_atan.c
@@ -1,15 +1,30 @@
-#include <init-arch.h>
-#include <math.h>
+/* Multiple versions of atan.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-extern double __atan_sse2 (double);
-extern double __atan_avx (double);
-extern double __atan_fma4 (double);
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-libm_ifunc (atan, (HAS_ARCH_FEATURE (FMA4_Usable) ? __atan_fma4 :
- HAS_ARCH_FEATURE (AVX_Usable)
- ? __atan_avx : __atan_sse2));
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#define atan __atan_sse2
+ 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 <libm-alias-double.h>
+extern double __redirect_atan (double);
+
+#define SYMBOL_NAME atan
+#include "ifunc-avx-fma4.h"
+
+libc_ifunc_redirected (__redirect_atan, __atan, IFUNC_SELECTOR ());
+libm_alias_double (__atan, atan)
+
+#define __atan __atan_sse2
#include <sysdeps/ieee754/dbl-64/s_atan.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_ceil-sse4_1.S b/sysdeps/x86_64/fpu/multiarch/s_ceil-sse4_1.S
new file mode 100644
index 0000000000..e90f05b42f
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_ceil-sse4_1.S
@@ -0,0 +1,25 @@
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ .section .text.sse4.1,"ax",@progbits
+ENTRY(__ceil_sse41)
+ roundsd $10, %xmm0, %xmm0
+ ret
+END(__ceil_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_ceil.S b/sysdeps/x86_64/fpu/multiarch/s_ceil.S
deleted file mode 100644
index 40fa729955..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/s_ceil.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include <init-arch.h>
-
-
-ENTRY(__ceil)
- .type __ceil, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __ceil_sse41(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jnz 2f
- leaq __ceil_c(%rip), %rax
-2: ret
-END(__ceil)
-weak_alias (__ceil, ceil)
-
-
-ENTRY(__ceil_sse41)
- roundsd $2, %xmm0, %xmm0
- ret
-END(__ceil_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_ceil.c b/sysdeps/x86_64/fpu/multiarch/s_ceil.c
new file mode 100644
index 0000000000..070fcdddea
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_ceil.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __ceil.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+
+#define ceil __redirect_ceil
+#define __ceil __redirect___ceil
+#include <math.h>
+#undef ceil
+#undef __ceil
+
+#define SYMBOL_NAME ceil
+#include "ifunc-sse4_1.h"
+
+libc_ifunc_redirected (__redirect_ceil, __ceil, IFUNC_SELECTOR ());
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_ceilf-sse4_1.S b/sysdeps/x86_64/fpu/multiarch/s_ceilf-sse4_1.S
new file mode 100644
index 0000000000..c3bd24c5ae
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_ceilf-sse4_1.S
@@ -0,0 +1,25 @@
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ .section .text.sse4.1,"ax",@progbits
+ENTRY(__ceilf_sse41)
+ roundss $10, %xmm0, %xmm0
+ ret
+END(__ceilf_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_ceilf.S b/sysdeps/x86_64/fpu/multiarch/s_ceilf.S
deleted file mode 100644
index 9a06a5c174..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/s_ceilf.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include <init-arch.h>
-
-
-ENTRY(__ceilf)
- .type __ceilf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __ceilf_sse41(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jnz 2f
- leaq __ceilf_c(%rip), %rax
-2: ret
-END(__ceilf)
-weak_alias (__ceilf, ceilf)
-
-
-ENTRY(__ceilf_sse41)
- roundss $2, %xmm0, %xmm0
- ret
-END(__ceilf_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_ceilf.c b/sysdeps/x86_64/fpu/multiarch/s_ceilf.c
new file mode 100644
index 0000000000..db0c6c4bc3
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_ceilf.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __ceilf.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+#define ceilf __redirect_ceilf
+#define __ceilf __redirect___ceilf
+#include <math.h>
+#undef ceilf
+#undef __ceilf
+
+#define SYMBOL_NAME ceilf
+#include "ifunc-sse4_1.h"
+
+libc_ifunc_redirected (__redirect_ceilf, __ceilf, IFUNC_SELECTOR ());
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_cosf-fma.c b/sysdeps/x86_64/fpu/multiarch/s_cosf-fma.c
new file mode 100644
index 0000000000..5f9191aef9
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_cosf-fma.c
@@ -0,0 +1,2 @@
+#define COSF __cosf_fma
+#include <sysdeps/ieee754/flt-32/s_cosf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_cosf-sse2.c b/sysdeps/x86_64/fpu/multiarch/s_cosf-sse2.c
new file mode 100644
index 0000000000..87cf42a82a
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_cosf-sse2.c
@@ -0,0 +1,2 @@
+#define COSF __cosf_sse2
+#include <sysdeps/ieee754/flt-32/s_cosf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_cosf.c b/sysdeps/x86_64/fpu/multiarch/s_cosf.c
new file mode 100644
index 0000000000..33959d3d01
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_cosf.c
@@ -0,0 +1,28 @@
+/* Multiple versions of cosf.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+extern float __redirect_cosf (float);
+
+#define SYMBOL_NAME cosf
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_cosf, __cosf, IFUNC_SELECTOR ());
+
+libm_alias_float (__cos, cos)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_floor-sse4_1.S b/sysdeps/x86_64/fpu/multiarch/s_floor-sse4_1.S
new file mode 100644
index 0000000000..b3c7aa29ff
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_floor-sse4_1.S
@@ -0,0 +1,25 @@
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ .section .text.sse4.1,"ax",@progbits
+ENTRY(__floor_sse41)
+ roundsd $9, %xmm0, %xmm0
+ ret
+END(__floor_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_floor.S b/sysdeps/x86_64/fpu/multiarch/s_floor.S
deleted file mode 100644
index 57a0eee5ba..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/s_floor.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include <init-arch.h>
-
-
-ENTRY(__floor)
- .type __floor, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __floor_sse41(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jnz 2f
- leaq __floor_c(%rip), %rax
-2: ret
-END(__floor)
-weak_alias (__floor, floor)
-
-
-ENTRY(__floor_sse41)
- roundsd $1, %xmm0, %xmm0
- ret
-END(__floor_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_floor.c b/sysdeps/x86_64/fpu/multiarch/s_floor.c
new file mode 100644
index 0000000000..58f8ed8eaf
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_floor.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __floor.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+
+#define floor __redirect_floor
+#define __floor __redirect___floor
+#include <math.h>
+#undef floor
+#undef __floor
+
+#define SYMBOL_NAME floor
+#include "ifunc-sse4_1.h"
+
+libc_ifunc_redirected (__redirect_floor, __floor, IFUNC_SELECTOR ());
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_floorf-sse4_1.S b/sysdeps/x86_64/fpu/multiarch/s_floorf-sse4_1.S
new file mode 100644
index 0000000000..43461d3e6b
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_floorf-sse4_1.S
@@ -0,0 +1,25 @@
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ .section .text.sse4.1,"ax",@progbits
+ENTRY(__floorf_sse41)
+ roundss $9, %xmm0, %xmm0
+ ret
+END(__floorf_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_floorf.S b/sysdeps/x86_64/fpu/multiarch/s_floorf.S
deleted file mode 100644
index 74a149a950..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/s_floorf.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include <init-arch.h>
-
-
-ENTRY(__floorf)
- .type __floorf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __floorf_sse41(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jnz 2f
- leaq __floorf_c(%rip), %rax
-2: ret
-END(__floorf)
-weak_alias (__floorf, floorf)
-
-
-ENTRY(__floorf_sse41)
- roundss $1, %xmm0, %xmm0
- ret
-END(__floorf_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_floorf.c b/sysdeps/x86_64/fpu/multiarch/s_floorf.c
new file mode 100644
index 0000000000..5ef2fec2e3
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_floorf.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __floorf.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+#define floorf __redirect_floorf
+#define __floorf __redirect___floorf
+#include <math.h>
+#undef floorf
+#undef __floorf
+
+#define SYMBOL_NAME floorf
+#include "ifunc-sse4_1.h"
+
+libc_ifunc_redirected (__redirect_floorf, __floorf, IFUNC_SELECTOR ());
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_fma.c b/sysdeps/x86_64/fpu/multiarch/s_fma.c
index 1de1a84cbe..875c76d372 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_fma.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_fma.c
@@ -1,5 +1,5 @@
/* FMA version of fma.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -20,6 +20,7 @@
#include <config.h>
#include <math.h>
#include <init-arch.h>
+#include <libm-alias-double.h>
extern double __fma_sse2 (double x, double y, double z) attribute_hidden;
@@ -43,7 +44,7 @@ __fma_fma4 (double x, double y, double z)
libm_ifunc (__fma, HAS_ARCH_FEATURE (FMA_Usable)
? __fma_fma3 : (HAS_ARCH_FEATURE (FMA4_Usable)
? __fma_fma4 : __fma_sse2));
-weak_alias (__fma, fma)
+libm_alias_double (__fma, fma)
#define __fma __fma_sse2
diff --git a/sysdeps/x86_64/fpu/multiarch/s_fmaf.c b/sysdeps/x86_64/fpu/multiarch/s_fmaf.c
index 8905e4b54f..5f4c2ec0be 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_fmaf.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_fmaf.c
@@ -1,5 +1,5 @@
/* FMA version of fmaf.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <config.h>
#include <math.h>
#include <init-arch.h>
+#include <libm-alias-float.h>
extern float __fmaf_sse2 (float x, float y, float z) attribute_hidden;
@@ -42,7 +43,7 @@ __fmaf_fma4 (float x, float y, float z)
libm_ifunc (__fmaf, HAS_ARCH_FEATURE (FMA_Usable)
? __fmaf_fma3 : (HAS_ARCH_FEATURE (FMA4_Usable)
? __fmaf_fma4 : __fmaf_sse2));
-weak_alias (__fmaf, fmaf)
+libm_alias_float (__fma, fma)
#define __fmaf __fmaf_sse2
diff --git a/sysdeps/x86_64/fpu/multiarch/s_nearbyint-sse4_1.S b/sysdeps/x86_64/fpu/multiarch/s_nearbyint-sse4_1.S
new file mode 100644
index 0000000000..f9ac36e4f0
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_nearbyint-sse4_1.S
@@ -0,0 +1,25 @@
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ .section .text.sse4.1,"ax",@progbits
+ENTRY(__nearbyint_sse41)
+ roundsd $0xc, %xmm0, %xmm0
+ ret
+END(__nearbyint_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S b/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S
deleted file mode 100644
index 5091cf5813..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include <init-arch.h>
-
-
-ENTRY(__nearbyint)
- .type __nearbyint, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __nearbyint_sse41(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jnz 2f
- leaq __nearbyint_c(%rip), %rax
-2: ret
-END(__nearbyint)
-weak_alias (__nearbyint, nearbyint)
-
-
-ENTRY(__nearbyint_sse41)
- roundsd $0xc, %xmm0, %xmm0
- ret
-END(__nearbyint_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_nearbyint.c b/sysdeps/x86_64/fpu/multiarch/s_nearbyint.c
new file mode 100644
index 0000000000..d92945fd14
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_nearbyint.c
@@ -0,0 +1,32 @@
+/* Multiple versions of __nearbyint.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+
+#define nearbyint __redirect_nearbyint
+#define __nearbyint __redirect___nearbyint
+#include <math.h>
+#undef nearbyint
+#undef __nearbyint
+
+#define SYMBOL_NAME nearbyint
+#include "ifunc-sse4_1.h"
+
+libc_ifunc_redirected (__redirect_nearbyint, __nearbyint,
+ IFUNC_SELECTOR ());
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_nearbyintf-sse4_1.S b/sysdeps/x86_64/fpu/multiarch/s_nearbyintf-sse4_1.S
new file mode 100644
index 0000000000..2f427da778
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_nearbyintf-sse4_1.S
@@ -0,0 +1,25 @@
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ .section .text.sse4.1,"ax",@progbits
+ENTRY(__nearbyintf_sse41)
+ roundss $0xc, %xmm0, %xmm0
+ ret
+END(__nearbyintf_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S b/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S
deleted file mode 100644
index 4a13700001..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include <init-arch.h>
-
-
-ENTRY(__nearbyintf)
- .type __nearbyintf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __nearbyintf_sse41(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jnz 2f
- leaq __nearbyintf_c(%rip), %rax
-2: ret
-END(__nearbyintf)
-weak_alias (__nearbyintf, nearbyintf)
-
-
-ENTRY(__nearbyintf_sse41)
- roundss $0xc, %xmm0, %xmm0
- ret
-END(__nearbyintf_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c b/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c
new file mode 100644
index 0000000000..ba7be27956
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of __nearbyintf.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+#define nearbyintf __redirect_nearbyintf
+#define __nearbyintf __redirect___nearbyintf
+#include <math.h>
+#undef nearbyintf
+#undef __nearbyintf
+
+#define SYMBOL_NAME nearbyintf
+#include "ifunc-sse4_1.h"
+
+libc_ifunc_redirected (__redirect_nearbyintf, __nearbyintf,
+ IFUNC_SELECTOR ());
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_rint-sse4_1.S b/sysdeps/x86_64/fpu/multiarch/s_rint-sse4_1.S
new file mode 100644
index 0000000000..7d7568a1a0
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_rint-sse4_1.S
@@ -0,0 +1,25 @@
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ .section .text.sse4.1,"ax",@progbits
+ENTRY(__rint_sse41)
+ roundsd $4, %xmm0, %xmm0
+ ret
+END(__rint_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_rint.S b/sysdeps/x86_64/fpu/multiarch/s_rint.S
deleted file mode 100644
index 1c0d1e14b7..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/s_rint.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include <init-arch.h>
-
-
-ENTRY(__rint)
- .type __rint, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __rint_sse41(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jnz 2f
- leaq __rint_c(%rip), %rax
-2: ret
-END(__rint)
-weak_alias (__rint, rint)
-
-
-ENTRY(__rint_sse41)
- roundsd $4, %xmm0, %xmm0
- ret
-END(__rint_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_rint.c b/sysdeps/x86_64/fpu/multiarch/s_rint.c
new file mode 100644
index 0000000000..f1cb2fed0c
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_rint.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __rint.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+
+#define rint __redirect_rint
+#define __rint __redirect___rint
+#include <math.h>
+#undef rint
+#undef __rint
+
+#define SYMBOL_NAME rint
+#include "ifunc-sse4_1.h"
+
+libc_ifunc_redirected (__redirect_rint, __rint, IFUNC_SELECTOR ());
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_rintf-sse4_1.S b/sysdeps/x86_64/fpu/multiarch/s_rintf-sse4_1.S
new file mode 100644
index 0000000000..ef5d896f55
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_rintf-sse4_1.S
@@ -0,0 +1,25 @@
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ .section .text.sse4.1,"ax",@progbits
+ENTRY(__rintf_sse41)
+ roundss $4, %xmm0, %xmm0
+ ret
+END(__rintf_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_rintf.S b/sysdeps/x86_64/fpu/multiarch/s_rintf.S
deleted file mode 100644
index 8e42fa561f..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/s_rintf.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include <init-arch.h>
-
-
-ENTRY(__rintf)
- .type __rintf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __rintf_sse41(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jnz 2f
- leaq __rintf_c(%rip), %rax
-2: ret
-END(__rintf)
-weak_alias (__rintf, rintf)
-
-
-ENTRY(__rintf_sse41)
- roundss $4, %xmm0, %xmm0
- ret
-END(__rintf_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_rintf.c b/sysdeps/x86_64/fpu/multiarch/s_rintf.c
new file mode 100644
index 0000000000..41323b3b5b
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_rintf.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __rintf.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+#define rintf __redirect_rintf
+#define __rintf __redirect___rintf
+#include <math.h>
+#undef rintf
+#undef __rintf
+
+#define SYMBOL_NAME rintf
+#include "ifunc-sse4_1.h"
+
+libc_ifunc_redirected (__redirect_rintf, __rintf, IFUNC_SELECTOR ());
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin-fma.c b/sysdeps/x86_64/fpu/multiarch/s_sin-fma.c
new file mode 100644
index 0000000000..15f3c394d5
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_sin-fma.c
@@ -0,0 +1,11 @@
+#define __cos __cos_fma
+#define __sin __sin_fma
+#define __docos __docos_fma
+#define __dubsin __dubsin_fma
+#define __mpcos __mpcos_fma
+#define __mpcos1 __mpcos1_fma
+#define __mpsin __mpsin_fma
+#define __mpsin1 __mpsin1_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/s_sin.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin.c b/sysdeps/x86_64/fpu/multiarch/s_sin.c
index 8ffd3e7125..b289269240 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_sin.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_sin.c
@@ -1,26 +1,39 @@
-#include <init-arch.h>
-#include <math.h>
-#undef NAN
-
-extern double __cos_sse2 (double);
-extern double __sin_sse2 (double);
-extern double __cos_avx (double);
-extern double __sin_avx (double);
-extern double __cos_fma4 (double);
-extern double __sin_fma4 (double);
-
-libm_ifunc (__cos, (HAS_ARCH_FEATURE (FMA4_Usable) ? __cos_fma4 :
- HAS_ARCH_FEATURE (AVX_Usable)
- ? __cos_avx : __cos_sse2));
-weak_alias (__cos, cos)
-
-libm_ifunc (__sin, (HAS_ARCH_FEATURE (FMA4_Usable) ? __sin_fma4 :
- HAS_ARCH_FEATURE (AVX_Usable)
- ? __sin_avx : __sin_sse2));
-weak_alias (__sin, sin)
+/* Multiple versions of sin and cos.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#define __cos __cos_sse2
-#define __sin __sin_sse2
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License 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 <libm-alias-double.h>
+
+extern double __redirect_sin (double);
+extern double __redirect_cos (double);
+#define SYMBOL_NAME sin
+#include "ifunc-avx-fma4.h"
+libc_ifunc_redirected (__redirect_sin, __sin, IFUNC_SELECTOR ());
+libm_alias_double (__sin, sin)
+
+#undef SYMBOL_NAME
+#define SYMBOL_NAME cos
+#include "ifunc-avx-fma4.h"
+
+libc_ifunc_redirected (__redirect_cos, __cos, IFUNC_SELECTOR ());
+libm_alias_double (__cos, cos)
+
+#define __cos __cos_sse2
+#define __sin __sin_sse2
#include <sysdeps/ieee754/dbl-64/s_sin.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_sincosf-fma.c b/sysdeps/x86_64/fpu/multiarch/s_sincosf-fma.c
new file mode 100644
index 0000000000..64abe7abca
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_sincosf-fma.c
@@ -0,0 +1,240 @@
+/* Compute sine and cosine of argument optimized with vector.
+ Copyright (C) 2017 Free Software 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 <math.h>
+#include <math_private.h>
+#include <x86intrin.h>
+#include <libm-alias-float.h>
+#include "s_sincosf.h"
+
+#define SINCOSF __sincosf_fma
+
+#ifndef SINCOSF
+# define SINCOSF_FUNC __sincosf
+#else
+# define SINCOSF_FUNC SINCOSF
+#endif
+
+/* Chebyshev constants for sin and cos, range -PI/4 - PI/4. */
+static const __v2df V0 = { -0x1.5555555551cd9p-3, -0x1.ffffffffe98aep-2};
+static const __v2df V1 = { 0x1.1111110c2688bp-7, 0x1.55555545c50c7p-5 };
+static const __v2df V2 = { -0x1.a019f8b4bd1f9p-13, -0x1.6c16b348b6874p-10 };
+static const __v2df V3 = { 0x1.71d7264e6b5b4p-19, 0x1.a00eb9ac43ccp-16 };
+static const __v2df V4 = { -0x1.a947e1674b58ap-26, -0x1.23c97dd8844d7p-22 };
+
+/* Chebyshev constants for sin and cos, range 2^-27 - 2^-5. */
+static const __v2df VC0 = { -0x1.555555543d49dp-3, -0x1.fffffff5cc6fdp-2 };
+static const __v2df VC1 = { 0x1.110f475cec8c5p-7, 0x1.55514b178dac5p-5 };
+
+static const __v2df v2ones = { 1.0, 1.0 };
+
+/* Compute the sine and cosine values using Chebyshev polynomials where
+ THETA is the range reduced absolute value of the input
+ and it is less than Pi/4,
+ N is calculated as trunc(|x|/(Pi/4)) + 1 and it is used to decide
+ whether a sine or cosine approximation is more accurate and
+ SIGNBIT is used to add the correct sign after the Chebyshev
+ polynomial is computed. */
+static void
+reduced_sincos (const double theta, const unsigned int n,
+ const unsigned int signbit, float *sinx, float *cosx)
+{
+ __v2df v2x, v2sx, v2cx;
+ const __v2df v2theta = { theta, theta };
+ const __v2df v2theta2 = v2theta * v2theta;
+ /* Here sinf() and cosf() are calculated using sin Chebyshev polynomial:
+ x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))). */
+ v2x = V3 + v2theta2 * V4; /* S3+x^2*S4. */
+ v2x = V2 + v2theta2 * v2x; /* S2+x^2*(S3+x^2*S4). */
+ v2x = V1 + v2theta2 * v2x; /* S1+x^2*(S2+x^2*(S3+x^2*S4)). */
+ v2x = V0 + v2theta2 * v2x; /* S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4))). */
+ v2x = v2theta2 * v2x;
+ v2cx = v2ones + v2x;
+ v2sx = v2theta + v2theta * v2x;
+ /* We are operating on |x|, so we need to add back the original
+ signbit for sinf. */
+ /* Determine positive or negative primary interval. */
+ /* Are we in the primary interval of sin or cos? */
+ if ((n & 2) == 0)
+ {
+ const __v2df v2sign =
+ {
+ ones[((n >> 2) & 1) ^ signbit],
+ ones[((n + 2) >> 2) & 1]
+ };
+ v2cx[0] = v2sx[0];
+ v2cx *= v2sign;
+ __v4sf v4sx = _mm_cvtpd_ps (v2cx);
+ *sinx = v4sx[0];
+ *cosx = v4sx[1];
+ }
+ else
+ {
+ const __v2df v2sign =
+ {
+ ones[((n + 2) >> 2) & 1],
+ ones[((n >> 2) & 1) ^ signbit]
+ };
+ v2cx[0] = v2sx[0];
+ v2cx *= v2sign;
+ __v4sf v4sx = _mm_cvtpd_ps (v2cx);
+ *sinx = v4sx[1];
+ *cosx = v4sx[0];
+ }
+}
+
+void
+SINCOSF_FUNC (float x, float *sinx, float *cosx)
+{
+ double theta = x;
+ double abstheta = fabs (theta);
+ uint32_t ix, xi;
+ GET_FLOAT_WORD (xi, x);
+ /* |x| */
+ ix = xi & 0x7fffffff;
+ /* If |x|< Pi/4. */
+ if (ix < 0x3f490fdb)
+ {
+ if (ix >= 0x3d000000) /* |x| >= 2^-5. */
+ {
+ __v2df v2x, v2sx, v2cx;
+ const __v2df v2theta = { theta, theta };
+ const __v2df v2theta2 = v2theta * v2theta;
+ /* Chebyshev polynomial of the form for sin and cos. */
+ v2x = V3 + v2theta2 * V4;
+ v2x = V2 + v2theta2 * v2x;
+ v2x = V1 + v2theta2 * v2x;
+ v2x = V0 + v2theta2 * v2x;
+ v2x = v2theta2 * v2x;
+ v2cx = v2ones + v2x;
+ v2sx = v2theta + v2theta * v2x;
+ v2cx[0] = v2sx[0];
+ __v4sf v4sx = _mm_cvtpd_ps (v2cx);
+ *sinx = v4sx[0];
+ *cosx = v4sx[1];
+ }
+ else if (ix >= 0x32000000) /* |x| >= 2^-27. */
+ {
+ /* A simpler Chebyshev approximation is close enough for this range:
+ for sin: x+x^3*(SS0+x^2*SS1)
+ for cos: 1.0+x^2*(CC0+x^3*CC1). */
+ __v2df v2x, v2sx, v2cx;
+ const __v2df v2theta = { theta, theta };
+ const __v2df v2theta2 = v2theta * v2theta;
+ v2x = VC0 + v2theta * v2theta2 * VC1;
+ v2x = v2theta2 * v2x;
+ v2cx = v2ones + v2x;
+ v2sx = v2theta + v2theta * v2x;
+ v2cx[0] = v2sx[0];
+ __v4sf v4sx = _mm_cvtpd_ps (v2cx);
+ *sinx = v4sx[0];
+ *cosx = v4sx[1];
+ }
+ else
+ {
+ /* Handle some special cases. */
+ if (ix)
+ *sinx = theta - (theta * SMALL);
+ else
+ *sinx = theta;
+ *cosx = 1.0 - abstheta;
+ }
+ }
+ else /* |x| >= Pi/4. */
+ {
+ unsigned int signbit = xi >> 31;
+ if (ix < 0x40e231d6) /* |x| < 9*Pi/4. */
+ {
+ /* There are cases where FE_UPWARD rounding mode can
+ produce a result of abstheta * inv_PI_4 == 9,
+ where abstheta < 9pi/4, so the domain for
+ pio2_table must go to 5 (9 / 2 + 1). */
+ unsigned int n = (abstheta * inv_PI_4) + 1;
+ theta = abstheta - pio2_table[n / 2];
+ reduced_sincos (theta, n, signbit, sinx, cosx);
+ }
+ else if (ix < 0x7f800000)
+ {
+ if (ix < 0x4b000000) /* |x| < 2^23. */
+ {
+ unsigned int n = ((unsigned int) (abstheta * inv_PI_4)) + 1;
+ double x = n / 2;
+ theta = (abstheta - x * PI_2_hi) - x * PI_2_lo;
+ /* Argument reduction needed. */
+ reduced_sincos (theta, n, signbit, sinx, cosx);
+ }
+ else /* |x| >= 2^23. */
+ {
+ x = fabsf (x);
+ int exponent
+ = (ix >> FLOAT_EXPONENT_SHIFT) - FLOAT_EXPONENT_BIAS;
+ exponent += 3;
+ exponent /= 28;
+ double a = invpio4_table[exponent] * x;
+ double b = invpio4_table[exponent + 1] * x;
+ double c = invpio4_table[exponent + 2] * x;
+ double d = invpio4_table[exponent + 3] * x;
+ uint64_t l = a;
+ l &= ~0x7;
+ a -= l;
+ double e = a + b;
+ l = e;
+ e = a - l;
+ if (l & 1)
+ {
+ e -= 1.0;
+ e += b;
+ e += c;
+ e += d;
+ e *= M_PI_4;
+ reduced_sincos (e, l + 1, signbit, sinx, cosx);
+ }
+ else
+ {
+ e += b;
+ e += c;
+ e += d;
+ if (e <= 1.0)
+ {
+ e *= M_PI_4;
+ reduced_sincos (e, l + 1, signbit, sinx, cosx);
+ }
+ else
+ {
+ l++;
+ e -= 2.0;
+ e *= M_PI_4;
+ reduced_sincos (e, l + 1, signbit, sinx, cosx);
+ }
+ }
+ }
+ }
+ else
+ {
+ if (ix == 0x7f800000)
+ __set_errno (EDOM);
+ /* sin/cos(Inf or NaN) is NaN. */
+ *sinx = *cosx = x - x;
+ }
+ }
+}
+
+#ifndef SINCOSF
+libm_alias_float (__sincos, sincos)
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/s_sincosf-sse2.S b/sysdeps/x86_64/fpu/multiarch/s_sincosf-sse2.S
new file mode 100644
index 0000000000..51d012bb12
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_sincosf-sse2.S
@@ -0,0 +1,2 @@
+#define __sincosf __sincosf_sse2
+#include <sysdeps/x86_64/fpu/s_sincosf.S>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_sincosf.c b/sysdeps/x86_64/fpu/multiarch/s_sincosf.c
new file mode 100644
index 0000000000..6cb4295558
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_sincosf.c
@@ -0,0 +1,28 @@
+/* Multiple versions of sincosf.
+ Copyright (C) 2017 Free Software 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 <libm-alias-float.h>
+
+extern void __redirect_sincosf (float, float *, float *);
+
+#define SYMBOL_NAME sincosf
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_sincosf, __sincosf, IFUNC_SELECTOR ());
+
+libm_alias_float (__sincos, sincos)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_sinf-fma.c b/sysdeps/x86_64/fpu/multiarch/s_sinf-fma.c
new file mode 100644
index 0000000000..34440ebf4a
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_sinf-fma.c
@@ -0,0 +1,2 @@
+#define SINF __sinf_fma
+#include <sysdeps/ieee754/flt-32/s_sinf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_sinf-sse2.c b/sysdeps/x86_64/fpu/multiarch/s_sinf-sse2.c
new file mode 100644
index 0000000000..74e32c98db
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_sinf-sse2.c
@@ -0,0 +1,2 @@
+#define SINF __sinf_sse2
+#include <sysdeps/ieee754/flt-32/s_sinf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_sinf.c b/sysdeps/x86_64/fpu/multiarch/s_sinf.c
new file mode 100644
index 0000000000..4fdfbd8d3e
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_sinf.c
@@ -0,0 +1,28 @@
+/* Multiple versions of sinf.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+extern float __redirect_sinf (float);
+
+#define SYMBOL_NAME sinf
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_sinf, __sinf, IFUNC_SELECTOR ());
+
+libm_alias_float (__sin, sin)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan-avx.c b/sysdeps/x86_64/fpu/multiarch/s_tan-avx.c
index 53de5d3c98..5ee29a9a06 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_tan-avx.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_tan-avx.c
@@ -1,4 +1,4 @@
-#define tan __tan_avx
+#define __tan __tan_avx
#define __dbl_mp __dbl_mp_avx
#define __sub __sub_avx
#define SECTION __attribute__ ((section (".text.avx")))
diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan-fma.c b/sysdeps/x86_64/fpu/multiarch/s_tan-fma.c
new file mode 100644
index 0000000000..1a1b9d2490
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_tan-fma.c
@@ -0,0 +1,8 @@
+#define __tan __tan_fma
+#define __dbl_mp __dbl_mp_fma
+#define __mpranred __mpranred_fma
+#define __mptan __mptan_fma
+#define __sub __sub_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/s_tan.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c b/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c
index a805440b46..e4e9f6cb85 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c
@@ -1,4 +1,4 @@
-#define tan __tan_fma4
+#define __tan __tan_fma4
#define __dbl_mp __dbl_mp_fma4
#define __mpranred __mpranred_fma4
#define __mptan __mptan_fma4
diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan.c b/sysdeps/x86_64/fpu/multiarch/s_tan.c
index 25f3bca07e..bb75d8d0bc 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_tan.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_tan.c
@@ -1,15 +1,30 @@
-#include <init-arch.h>
-#include <math.h>
+/* Multiple versions of tan.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-extern double __tan_sse2 (double);
-extern double __tan_avx (double);
-extern double __tan_fma4 (double);
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-libm_ifunc (tan, (HAS_ARCH_FEATURE (FMA4_Usable) ? __tan_fma4 :
- HAS_ARCH_FEATURE (AVX_Usable)
- ? __tan_avx : __tan_sse2));
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#define tan __tan_sse2
+ 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 <libm-alias-double.h>
+extern double __redirect_tan (double);
+
+#define SYMBOL_NAME tan
+#include "ifunc-avx-fma4.h"
+
+libc_ifunc_redirected (__redirect_tan, __tan, IFUNC_SELECTOR ());
+libm_alias_double (__tan, tan)
+
+#define __tan __tan_sse2
#include <sysdeps/ieee754/dbl-64/s_tan.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_trunc-c.c b/sysdeps/x86_64/fpu/multiarch/s_trunc-c.c
new file mode 100644
index 0000000000..6204ae3c77
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_trunc-c.c
@@ -0,0 +1,2 @@
+#define __trunc __trunc_c
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_trunc-sse4_1.S b/sysdeps/x86_64/fpu/multiarch/s_trunc-sse4_1.S
new file mode 100644
index 0000000000..b8046bfa0c
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_trunc-sse4_1.S
@@ -0,0 +1,25 @@
+/* trunc for SSE4.1.
+ Copyright (C) 2017-2018 Free Software 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>
+
+ .section .text.sse4.1,"ax",@progbits
+ENTRY(__trunc_sse41)
+ roundsd $11, %xmm0, %xmm0
+ ret
+END(__trunc_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_trunc.c b/sysdeps/x86_64/fpu/multiarch/s_trunc.c
new file mode 100644
index 0000000000..a1b0c60630
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_trunc.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __trunc.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-double.h>
+
+#define trunc __redirect_trunc
+#define __trunc __redirect___trunc
+#include <math.h>
+#undef trunc
+#undef __trunc
+
+#define SYMBOL_NAME trunc
+#include "ifunc-sse4_1.h"
+
+libc_ifunc_redirected (__redirect_trunc, __trunc, IFUNC_SELECTOR ());
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_truncf-c.c b/sysdeps/x86_64/fpu/multiarch/s_truncf-c.c
new file mode 100644
index 0000000000..7a5ac7da1f
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_truncf-c.c
@@ -0,0 +1,2 @@
+#define __truncf __truncf_c
+#include <sysdeps/ieee754/flt-32/s_truncf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_truncf-sse4_1.S b/sysdeps/x86_64/fpu/multiarch/s_truncf-sse4_1.S
new file mode 100644
index 0000000000..2dabc0be57
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_truncf-sse4_1.S
@@ -0,0 +1,25 @@
+/* truncf for SSE4.1.
+ Copyright (C) 2017-2018 Free Software 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>
+
+ .section .text.sse4.1,"ax",@progbits
+ENTRY(__truncf_sse41)
+ roundss $11, %xmm0, %xmm0
+ ret
+END(__truncf_sse41)
diff --git a/sysdeps/x86_64/fpu/multiarch/s_truncf.c b/sysdeps/x86_64/fpu/multiarch/s_truncf.c
new file mode 100644
index 0000000000..a7e220bd0c
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/s_truncf.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __truncf.
+ Copyright (C) 2017-2018 Free Software 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 <libm-alias-float.h>
+
+#define truncf __redirect_truncf
+#define __truncf __redirect___truncf
+#include <math.h>
+#undef truncf
+#undef __truncf
+
+#define SYMBOL_NAME truncf
+#include "ifunc-sse4_1.h"
+
+libc_ifunc_redirected (__redirect_truncf, __truncf, IFUNC_SELECTOR ());
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/x86_64/fpu/multiarch/sincos32-fma.c b/sysdeps/x86_64/fpu/multiarch/sincos32-fma.c
new file mode 100644
index 0000000000..dcd44bc5e8
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/sincos32-fma.c
@@ -0,0 +1,15 @@
+#define __cos32 __cos32_fma
+#define __sin32 __sin32_fma
+#define __c32 __c32_fma
+#define __mpsin __mpsin_fma
+#define __mpsin1 __mpsin1_fma
+#define __mpcos __mpcos_fma
+#define __mpcos1 __mpcos1_fma
+#define __mpranred __mpranred_fma
+#define __add __add_fma
+#define __dbl_mp __dbl_mp_fma
+#define __mul __mul_fma
+#define __sub __sub_fma
+#define SECTION __attribute__ ((section (".text.fma")))
+
+#include <sysdeps/ieee754/dbl-64/sincos32.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/slowexp-avx.c b/sysdeps/x86_64/fpu/multiarch/slowexp-avx.c
deleted file mode 100644
index d01c6d71a4..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/slowexp-avx.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#define __slowexp __slowexp_avx
-#define __add __add_avx
-#define __dbl_mp __dbl_mp_avx
-#define __mpexp __mpexp_avx
-#define __mul __mul_avx
-#define __sub __sub_avx
-#define SECTION __attribute__ ((section (".text.avx")))
-
-#include <sysdeps/ieee754/dbl-64/slowexp.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c b/sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c
deleted file mode 100644
index 3bcde84233..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#define __slowexp __slowexp_fma4
-#define __add __add_fma4
-#define __dbl_mp __dbl_mp_fma4
-#define __mpexp __mpexp_fma4
-#define __mul __mul_fma4
-#define __sub __sub_fma4
-#define SECTION __attribute__ ((section (".text.fma4")))
-
-#include <sysdeps/ieee754/dbl-64/slowexp.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c b/sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c
deleted file mode 100644
index 69d69823bb..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#define __slowpow __slowpow_fma4
-#define __add __add_fma4
-#define __dbl_mp __dbl_mp_fma4
-#define __mpexp __mpexp_fma4
-#define __mplog __mplog_fma4
-#define __mul __mul_fma4
-#define __sub __sub_fma4
-#define __halfulp __halfulp_fma4
-#define SECTION __attribute__ ((section (".text.fma4")))
-
-#include <sysdeps/ieee754/dbl-64/slowpow.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core-sse2.S
new file mode 100644
index 0000000000..a85729807f
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized cos, vector length is 2.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN2v_cos _ZGVbN2v_cos_sse2
+#include "../svml_d_cos2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core.S
deleted file mode 100644
index 7d720e2fcb..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized cos, vector length is 2.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN2v_cos)
- .type _ZGVbN2v_cos, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN2v_cos_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN2v_cos_sse2(%rip), %rax
- ret
-END (_ZGVbN2v_cos)
-libmvec_hidden_def (_ZGVbN2v_cos)
-
-#define _ZGVbN2v_cos _ZGVbN2v_cos_sse2
-#include "../svml_d_cos2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core.c
new file mode 100644
index 0000000000..3ff39eecd7
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized cos, vector length is 2.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN2v_cos
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN2v_cos, __GI__ZGVbN2v_cos, __redirect__ZGVbN2v_cos)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core_sse4.S
index 088fcae067..10be76e207 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_cos2_core_sse4.S
@@ -1,5 +1,5 @@
/* Function cos vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -205,7 +205,7 @@ ENTRY (_ZGVbN2v_cos_sse4)
shlq $4, %r15
movsd 200(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
movsd %xmm0, 264(%rsp,%r15)
jmp .LBL_1_8
@@ -215,7 +215,7 @@ ENTRY (_ZGVbN2v_cos_sse4)
shlq $4, %r15
movsd 192(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
movsd %xmm0, 256(%rsp,%r15)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core-sse.S
new file mode 100644
index 0000000000..9f406ea7c9
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized cos, vector length is 4.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN4v_cos _ZGVdN4v_cos_sse_wrapper
+#include "../svml_d_cos4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core.S
deleted file mode 100644
index 65a3570d2e..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized cos, vector length is 4.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN4v_cos)
- .type _ZGVdN4v_cos, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN4v_cos_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN4v_cos_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN4v_cos)
-libmvec_hidden_def (_ZGVdN4v_cos)
-
-#define _ZGVdN4v_cos _ZGVdN4v_cos_sse_wrapper
-#include "../svml_d_cos4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core.c
new file mode 100644
index 0000000000..cb8405201a
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized cos, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN4v_cos
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN4v_cos, __GI__ZGVdN4v_cos, __redirect__ZGVdN4v_cos)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core_avx2.S
index 4e653216d9..38cdc6bb03 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_cos4_core_avx2.S
@@ -1,5 +1,5 @@
/* Function cos vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -188,7 +188,7 @@ ENTRY (_ZGVdN4v_cos_avx2)
vmovsd 328(%rsp,%r15), %xmm0
vzeroupper
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 392(%rsp,%r15)
jmp .LBL_1_8
@@ -199,7 +199,7 @@ ENTRY (_ZGVdN4v_cos_avx2)
vmovsd 320(%rsp,%r15), %xmm0
vzeroupper
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 384(%rsp,%r15)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core-avx2.S
new file mode 100644
index 0000000000..081baeeff5
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core-avx2.S
@@ -0,0 +1,20 @@
+/* AVX2 version of vectorized cos, vector length is 8.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVeN8v_cos _ZGVeN8v_cos_avx2_wrapper
+#include "../svml_d_cos8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.S
deleted file mode 100644
index 3e7f16d44e..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized cos, vector length is 8.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN8v_cos)
- .type _ZGVeN8v_cos, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
-1: leaq _ZGVeN8v_cos_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN8v_cos_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN8v_cos_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN8v_cos)
-
-#define _ZGVeN8v_cos _ZGVeN8v_cos_avx2_wrapper
-#include "../svml_d_cos8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.c
new file mode 100644
index 0000000000..4aa12595bc
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized cos, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN8v_cos
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN8v_cos, __GI__ZGVeN8v_cos, __redirect__ZGVeN8v_cos)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core_avx512.S
index 1cac1d827a..24e3b36357 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core_avx512.S
@@ -1,5 +1,5 @@
/* Function cos vectorized with AVX-512, KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
.text
ENTRY (_ZGVeN8v_cos_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN4v_cos
#else
/*
@@ -221,7 +221,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_cos
movzbl %r12b, %r15d
shlq $4, %r15
vmovsd 1160(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 1224(%rsp,%r15)
jmp .LBL_1_8
@@ -229,14 +229,14 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_cos
movzbl %r12b, %r15d
shlq $4, %r15
vmovsd 1152(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 1216(%rsp,%r15)
jmp .LBL_1_7
#endif
END (_ZGVeN8v_cos_knl)
ENTRY (_ZGVeN8v_cos_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN4v_cos
#else
/*
@@ -438,7 +438,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_cos
vzeroupper
vmovsd 1160(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 1224(%rsp,%r15)
jmp .LBL_2_8
@@ -450,7 +450,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_cos
vzeroupper
vmovsd 1152(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 1216(%rsp,%r15)
jmp .LBL_2_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core-sse2.S
new file mode 100644
index 0000000000..3591eb1f19
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized exp.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN2v_exp _ZGVbN2v_exp_sse2
+#include "../svml_d_exp2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core.S
deleted file mode 100644
index 136c67a550..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized exp.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN2v_exp)
- .type _ZGVbN2v_exp, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN2v_exp_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN2v_exp_sse2(%rip), %rax
- ret
-END (_ZGVbN2v_exp)
-libmvec_hidden_def (_ZGVbN2v_exp)
-
-#define _ZGVbN2v_exp _ZGVbN2v_exp_sse2
-#include "../svml_d_exp2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core.c
new file mode 100644
index 0000000000..2cfe8937c9
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized exp, vector length is 2.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN2v_exp
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN2v_exp, __GI__ZGVbN2v_exp, __redirect__ZGVbN2v_exp)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core_sse4.S
index 445b230152..e98d11b311 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core_sse4.S
@@ -1,5 +1,5 @@
/* Function exp vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -207,7 +207,7 @@ ENTRY (_ZGVbN2v_exp_sse4)
shlq $4, %r15
movsd 200(%rsp,%r15), %xmm0
- call exp@PLT
+ call JUMPTARGET(__exp_finite)
movsd %xmm0, 264(%rsp,%r15)
jmp .LBL_1_8
@@ -217,7 +217,7 @@ ENTRY (_ZGVbN2v_exp_sse4)
shlq $4, %r15
movsd 192(%rsp,%r15), %xmm0
- call exp@PLT
+ call JUMPTARGET(__exp_finite)
movsd %xmm0, 256(%rsp,%r15)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core-sse.S
new file mode 100644
index 0000000000..f8e0b5517a
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized exp.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN4v_exp _ZGVdN4v_exp_sse_wrapper
+#include "../svml_d_exp4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core.S
deleted file mode 100644
index 9d6a47be0a..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized exp.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN4v_exp)
- .type _ZGVdN4v_exp, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN4v_exp_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN4v_exp_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN4v_exp)
-libmvec_hidden_def (_ZGVdN4v_exp)
-
-#define _ZGVdN4v_exp _ZGVdN4v_exp_sse_wrapper
-#include "../svml_d_exp4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core.c
new file mode 100644
index 0000000000..59bb36984a
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized exp, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN4v_exp
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN4v_exp, __GI__ZGVdN4v_exp, __redirect__ZGVdN4v_exp)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core_avx2.S
index 25f9e28941..87990f8ad7 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core_avx2.S
@@ -1,5 +1,5 @@
/* Function exp vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -193,7 +193,7 @@ ENTRY (_ZGVdN4v_exp_avx2)
vmovsd 328(%rsp,%r15), %xmm0
vzeroupper
- call exp@PLT
+ call JUMPTARGET(__exp_finite)
vmovsd %xmm0, 392(%rsp,%r15)
jmp .LBL_1_8
@@ -204,7 +204,7 @@ ENTRY (_ZGVdN4v_exp_avx2)
vmovsd 320(%rsp,%r15), %xmm0
vzeroupper
- call exp@PLT
+ call JUMPTARGET(__exp_finite)
vmovsd %xmm0, 384(%rsp,%r15)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core-avx2.S
new file mode 100644
index 0000000000..b1d3cad0e1
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core-avx2.S
@@ -0,0 +1,20 @@
+/* AVX2 version of vectorized exp.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVeN8v_exp _ZGVeN8v_exp_avx2_wrapper
+#include "../svml_d_exp8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.S
deleted file mode 100644
index 317ee36e61..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized exp.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN8v_exp)
- .type _ZGVeN8v_exp, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN8v_exp_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN8v_exp_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN8v_exp_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN8v_exp)
-
-#define _ZGVeN8v_exp _ZGVeN8v_exp_avx2_wrapper
-#include "../svml_d_exp8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.c
new file mode 100644
index 0000000000..cfdc96ec86
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized exp, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN8v_exp
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN8v_exp, __GI__ZGVeN8v_exp, __redirect__ZGVeN8v_exp)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S
index 74f1d2ce7b..8dd8a03e4b 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S
@@ -1,5 +1,5 @@
/* Function exp vectorized with AVX-512. KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
.text
ENTRY (_ZGVeN8v_exp_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN4v_exp
#else
/*
@@ -223,7 +223,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_exp
movzbl %r12b, %r15d
shlq $4, %r15
vmovsd 1160(%rsp,%r15), %xmm0
- call exp@PLT
+ call JUMPTARGET(__exp_finite)
vmovsd %xmm0, 1224(%rsp,%r15)
jmp .LBL_1_8
@@ -231,14 +231,14 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_exp
movzbl %r12b, %r15d
shlq $4, %r15
vmovsd 1152(%rsp,%r15), %xmm0
- call exp@PLT
+ call JUMPTARGET(__exp_finite)
vmovsd %xmm0, 1216(%rsp,%r15)
jmp .LBL_1_7
#endif
END (_ZGVeN8v_exp_knl)
ENTRY (_ZGVeN8v_exp_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN4v_exp
#else
/*
@@ -438,7 +438,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_exp
vmovsd 1160(%rsp,%r15), %xmm0
vzeroupper
vmovsd 1160(%rsp,%r15), %xmm0
- call exp@PLT
+ call JUMPTARGET(__exp_finite)
vmovsd %xmm0, 1224(%rsp,%r15)
jmp .LBL_2_8
@@ -448,7 +448,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_exp
vmovsd 1152(%rsp,%r15), %xmm0
vzeroupper
vmovsd 1152(%rsp,%r15), %xmm0
- call exp@PLT
+ call JUMPTARGET(__exp_finite)
vmovsd %xmm0, 1216(%rsp,%r15)
jmp .LBL_2_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core-sse2.S
new file mode 100644
index 0000000000..761a1a537d
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized log.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN2v_log _ZGVbN2v_log_sse2
+#include "../svml_d_log2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core.S
deleted file mode 100644
index 03d86a3e63..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized log.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN2v_log)
- .type _ZGVbN2v_log, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN2v_log_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN2v_log_sse2(%rip), %rax
- ret
-END (_ZGVbN2v_log)
-libmvec_hidden_def (_ZGVbN2v_log)
-
-#define _ZGVbN2v_log _ZGVbN2v_log_sse2
-#include "../svml_d_log2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core.c
new file mode 100644
index 0000000000..c24437a3be
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized log, vector length is 2.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN2v_log
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN2v_log, __GI__ZGVbN2v_log, __redirect__ZGVbN2v_log)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core_sse4.S
index 5d254288f6..eb854c68d6 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core_sse4.S
@@ -1,5 +1,5 @@
/* Function log vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -211,7 +211,7 @@ ENTRY (_ZGVbN2v_log_sse4)
shlq $4, %r15
movsd 200(%rsp,%r15), %xmm0
- call log@PLT
+ call JUMPTARGET(__log_finite)
movsd %xmm0, 264(%rsp,%r15)
jmp .LBL_1_8
@@ -221,7 +221,7 @@ ENTRY (_ZGVbN2v_log_sse4)
shlq $4, %r15
movsd 192(%rsp,%r15), %xmm0
- call log@PLT
+ call JUMPTARGET(__log_finite)
movsd %xmm0, 256(%rsp,%r15)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core-sse.S
new file mode 100644
index 0000000000..2460512f78
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized log.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN4v_log _ZGVdN4v_log_sse_wrapper
+#include "../svml_d_log4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core.S
deleted file mode 100644
index 9f6ddbef15..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized log.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN4v_log)
- .type _ZGVdN4v_log, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN4v_log_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN4v_log_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN4v_log)
-libmvec_hidden_def (_ZGVdN4v_log)
-
-#define _ZGVdN4v_log _ZGVdN4v_log_sse_wrapper
-#include "../svml_d_log4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core.c
new file mode 100644
index 0000000000..5751370d65
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized log, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN4v_log
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN4v_log, __GI__ZGVdN4v_log, __redirect__ZGVdN4v_log)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core_avx2.S
index 5da298747d..81515850e1 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core_avx2.S
@@ -1,5 +1,5 @@
/* Function log vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -191,7 +191,7 @@ ENTRY (_ZGVdN4v_log_avx2)
vmovsd 328(%rsp,%r15), %xmm0
vzeroupper
- call log@PLT
+ call JUMPTARGET(__log_finite)
vmovsd %xmm0, 392(%rsp,%r15)
jmp .LBL_1_8
@@ -202,7 +202,7 @@ ENTRY (_ZGVdN4v_log_avx2)
vmovsd 320(%rsp,%r15), %xmm0
vzeroupper
- call log@PLT
+ call JUMPTARGET(__log_finite)
vmovsd %xmm0, 384(%rsp,%r15)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core-avx2.S
new file mode 100644
index 0000000000..ecfbeafb23
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core-avx2.S
@@ -0,0 +1,20 @@
+/* AVX2 version of vectorized log.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVeN8v_log _ZGVeN8v_log_avx2_wrapper
+#include "../svml_d_log8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.S
deleted file mode 100644
index 2e1a1da1a5..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized log.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN8v_log)
- .type _ZGVeN8v_log, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN8v_log_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN8v_log_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN8v_log_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN8v_log)
-
-#define _ZGVeN8v_log _ZGVeN8v_log_avx2_wrapper
-#include "../svml_d_log8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.c
new file mode 100644
index 0000000000..1e796dcfdd
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized log, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN8v_log
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN8v_log, __GI__ZGVeN8v_log, __redirect__ZGVeN8v_log)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S
index dca8e61f34..ae8af8d861 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S
@@ -1,5 +1,5 @@
/* Function log vectorized with AVX-512. KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
.text
ENTRY (_ZGVeN8v_log_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN4v_log
#else
/*
@@ -222,7 +222,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_log
movzbl %r12b, %r15d
shlq $4, %r15
vmovsd 1160(%rsp,%r15), %xmm0
- call log@PLT
+ call JUMPTARGET(__log_finite)
vmovsd %xmm0, 1224(%rsp,%r15)
jmp .LBL_1_8
@@ -230,14 +230,14 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_log
movzbl %r12b, %r15d
shlq $4, %r15
vmovsd 1152(%rsp,%r15), %xmm0
- call log@PLT
+ call JUMPTARGET(__log_finite)
vmovsd %xmm0, 1216(%rsp,%r15)
jmp .LBL_1_7
#endif
END (_ZGVeN8v_log_knl)
ENTRY (_ZGVeN8v_log_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN4v_log
#else
/*
@@ -443,7 +443,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_log
vzeroupper
vmovsd 1160(%rsp,%r15), %xmm0
- call log@PLT
+ call JUMPTARGET(__log_finite)
vmovsd %xmm0, 1224(%rsp,%r15)
jmp .LBL_2_8
@@ -455,7 +455,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_log
vzeroupper
vmovsd 1152(%rsp,%r15), %xmm0
- call log@PLT
+ call JUMPTARGET(__log_finite)
vmovsd %xmm0, 1216(%rsp,%r15)
jmp .LBL_2_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core-sse2.S
new file mode 100644
index 0000000000..2d8ad50681
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized pow.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN2vv_pow _ZGVbN2vv_pow_sse2
+#include "../svml_d_pow2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core.S
deleted file mode 100644
index 4a50246889..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized pow.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN2vv_pow)
- .type _ZGVbN2vv_pow, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN2vv_pow_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN2vv_pow_sse2(%rip), %rax
- ret
-END (_ZGVbN2vv_pow)
-libmvec_hidden_def (_ZGVbN2vv_pow)
-
-#define _ZGVbN2vv_pow _ZGVbN2vv_pow_sse2
-#include "../svml_d_pow2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core.c
new file mode 100644
index 0000000000..3424c0e326
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized pow, vector length is 2.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN2vv_pow
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN2vv_pow, __GI__ZGVbN2vv_pow,
+ __redirect__ZGVbN2vv_pow)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core_sse4.S
index 064d170878..77828b44d5 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core_sse4.S
@@ -1,5 +1,5 @@
/* Function pow vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -413,7 +413,7 @@ ENTRY (_ZGVbN2vv_pow_sse4)
movsd 72(%rsp,%r15), %xmm0
movsd 136(%rsp,%r15), %xmm1
- call pow@PLT
+ call JUMPTARGET(__pow_finite)
movsd %xmm0, 200(%rsp,%r15)
jmp .LBL_1_8
@@ -424,7 +424,7 @@ ENTRY (_ZGVbN2vv_pow_sse4)
movsd 64(%rsp,%r15), %xmm0
movsd 128(%rsp,%r15), %xmm1
- call pow@PLT
+ call JUMPTARGET(__pow_finite)
movsd %xmm0, 192(%rsp,%r15)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core-sse.S
new file mode 100644
index 0000000000..4dcd14ff20
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized pow.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN4vv_pow _ZGVdN4vv_pow_sse_wrapper
+#include "../svml_d_pow4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core.S
deleted file mode 100644
index fb9f989adc..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized pow.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN4vv_pow)
- .type _ZGVdN4vv_pow, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN4vv_pow_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN4vv_pow_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN4vv_pow)
-libmvec_hidden_def (_ZGVdN4vv_pow)
-
-#define _ZGVdN4vv_pow _ZGVdN4vv_pow_sse_wrapper
-#include "../svml_d_pow4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core.c
new file mode 100644
index 0000000000..447be39401
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized pow, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN4vv_pow
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN4vv_pow, __GI__ZGVdN4vv_pow,
+ __redirect__ZGVdN4vv_pow)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core_avx2.S
index f2a73ffe1e..c43d62f202 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core_avx2.S
@@ -1,5 +1,5 @@
/* Function pow vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -367,7 +367,7 @@ ENTRY (_ZGVdN4vv_pow_avx2)
vmovsd 264(%rsp,%r15), %xmm1
vzeroupper
- call pow@PLT
+ call JUMPTARGET(__pow_finite)
vmovsd %xmm0, 328(%rsp,%r15)
jmp .LBL_1_8
@@ -379,7 +379,7 @@ ENTRY (_ZGVdN4vv_pow_avx2)
vmovsd 256(%rsp,%r15), %xmm1
vzeroupper
- call pow@PLT
+ call JUMPTARGET(__pow_finite)
vmovsd %xmm0, 320(%rsp,%r15)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core-avx2.S
new file mode 100644
index 0000000000..8acf700e76
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core-avx2.S
@@ -0,0 +1,20 @@
+/* AVX2 version of vectorized pow.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVeN8vv_pow _ZGVeN8vv_pow_avx2_wrapper
+#include "../svml_d_pow8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.S
deleted file mode 100644
index 30bc53f2f7..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized pow.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN8vv_pow)
- .type _ZGVeN8vv_pow, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN8vv_pow_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN8vv_pow_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN8vv_pow_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN8vv_pow)
-
-#define _ZGVeN8vv_pow _ZGVeN8vv_pow_avx2_wrapper
-#include "../svml_d_pow8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.c
new file mode 100644
index 0000000000..62f96965bb
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized pow, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN8vv_pow
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN8vv_pow, __GI__ZGVeN8vv_pow,
+ __redirect__ZGVeN8vv_pow)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S
index 4a515233fc..a28c39b73d 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S
@@ -1,5 +1,5 @@
/* Function pow vectorized with AVX-512. KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -82,7 +82,7 @@
.text
ENTRY (_ZGVeN8vv_pow_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow
#else
pushq %rbp
@@ -392,7 +392,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow
shlq $4, %r15
vmovsd 1160(%rsp,%r15), %xmm0
vmovsd 1224(%rsp,%r15), %xmm1
- call pow@PLT
+ call JUMPTARGET(__pow_finite)
vmovsd %xmm0, 1288(%rsp,%r15)
jmp .LBL_1_8
@@ -401,7 +401,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow
shlq $4, %r15
vmovsd 1152(%rsp,%r15), %xmm0
vmovsd 1216(%rsp,%r15), %xmm1
- call pow@PLT
+ call JUMPTARGET(__pow_finite)
vmovsd %xmm0, 1280(%rsp,%r15)
jmp .LBL_1_7
@@ -409,7 +409,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow
END (_ZGVeN8vv_pow_knl)
ENTRY (_ZGVeN8vv_pow_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow
#else
pushq %rbp
@@ -720,7 +720,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow
vzeroupper
vmovsd 1160(%rsp,%r15), %xmm0
- call pow@PLT
+ call JUMPTARGET(__pow_finite)
vmovsd %xmm0, 1288(%rsp,%r15)
jmp .LBL_2_8
@@ -732,7 +732,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow
vzeroupper
vmovsd 1152(%rsp,%r15), %xmm0
- call pow@PLT
+ call JUMPTARGET(__pow_finite)
vmovsd %xmm0, 1280(%rsp,%r15)
jmp .LBL_2_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core-sse2.S
new file mode 100644
index 0000000000..cb7b31aa1c
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized sin.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN2v_sin _ZGVbN2v_sin_sse2
+#include "../svml_d_sin2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.S
deleted file mode 100644
index 112bec2224..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized sin.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN2v_sin)
- .type _ZGVbN2v_sin, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN2v_sin_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN2v_sin_sse2(%rip), %rax
- ret
-END (_ZGVbN2v_sin)
-libmvec_hidden_def (_ZGVbN2v_sin)
-
-#define _ZGVbN2v_sin _ZGVbN2v_sin_sse2
-#include "../svml_d_sin2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.c
new file mode 100644
index 0000000000..1c5788f205
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized sin, vector length is 2.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN2v_sin
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN2v_sin, __GI__ZGVbN2v_sin, __redirect__ZGVbN2v_sin)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core_sse4.S
index 5755ce6f74..15980e9eeb 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sin2_core_sse4.S
@@ -1,5 +1,5 @@
/* Function sin vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -211,7 +211,7 @@ ENTRY (_ZGVbN2v_sin_sse4)
shlq $4, %r15
movsd 200(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
movsd %xmm0, 264(%rsp,%r15)
jmp .LBL_1_8
@@ -221,7 +221,7 @@ ENTRY (_ZGVbN2v_sin_sse4)
shlq $4, %r15
movsd 192(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
movsd %xmm0, 256(%rsp,%r15)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core-sse.S
new file mode 100644
index 0000000000..07fae6f3b4
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized sin, vector length is 4.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN4v_sin _ZGVdN4v_sin_sse_wrapper
+#include "../svml_d_sin4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.S
deleted file mode 100644
index 700a1c629d..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized sin, vector length is 4.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN4v_sin)
- .type _ZGVdN4v_sin, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN4v_sin_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN4v_sin_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN4v_sin)
-libmvec_hidden_def (_ZGVdN4v_sin)
-
-#define _ZGVdN4v_sin _ZGVdN4v_sin_sse_wrapper
-#include "../svml_d_sin4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.c
new file mode 100644
index 0000000000..b5933914aa
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized sin, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN4v_sin
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN4v_sin, __GI__ZGVdN4v_sin, __redirect__ZGVdN4v_sin)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core_avx2.S
index 46b557158a..4f0917c56d 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sin4_core_avx2.S
@@ -1,5 +1,5 @@
/* Function sin vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -191,7 +191,7 @@ ENTRY (_ZGVdN4v_sin_avx2)
vmovsd 328(%rsp,%r15), %xmm0
vzeroupper
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 392(%rsp,%r15)
jmp .LBL_1_8
@@ -202,7 +202,7 @@ ENTRY (_ZGVdN4v_sin_avx2)
vmovsd 320(%rsp,%r15), %xmm0
vzeroupper
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 384(%rsp,%r15)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core-avx2.S
new file mode 100644
index 0000000000..b64c3390d6
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core-avx2.S
@@ -0,0 +1,23 @@
+/* AVX2 version of vectorized sin.
+ Copyright (C) 2014-2018 Free Software 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>
+#include <init-arch.h>
+
+#define _ZGVeN8v_sin _ZGVeN8v_sin_avx2_wrapper
+#include "../svml_d_sin8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.S
deleted file mode 100644
index 5afce0ed88..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized sin.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN8v_sin)
- .type _ZGVeN8v_sin, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN8v_sin_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN8v_sin_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN8v_sin_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN8v_sin)
-
-#define _ZGVeN8v_sin _ZGVeN8v_sin_avx2_wrapper
-#include "../svml_d_sin8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.c
new file mode 100644
index 0000000000..57023d8494
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.c
@@ -0,0 +1,27 @@
+/* Multiple versions of vectorized sin, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN8v_sin
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN8v_sin, __GI__ZGVeN8v_sin, __redirect__ZGVeN8v_sin)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core_avx512.S
index 6c565f3861..2d4b14fd1b 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core_avx512.S
@@ -1,5 +1,5 @@
/* Function sin vectorized with AVX-512, KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
.text
ENTRY (_ZGVeN8v_sin_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN4v_sin
#else
/*
@@ -222,7 +222,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_sin
movzbl %r12b, %r15d
shlq $4, %r15
vmovsd 1160(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 1224(%rsp,%r15)
jmp .LBL_1_8
@@ -230,14 +230,14 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_sin
movzbl %r12b, %r15d
shlq $4, %r15
vmovsd 1152(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 1216(%rsp,%r15)
jmp .LBL_1_7
#endif
END (_ZGVeN8v_sin_knl)
ENTRY (_ZGVeN8v_sin_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN4v_sin
#else
/*
@@ -440,7 +440,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_sin
vzeroupper
vmovsd 1160(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 1224(%rsp,%r15)
jmp .LBL_2_8
@@ -452,7 +452,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_sin
vzeroupper
vmovsd 1152(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 1216(%rsp,%r15)
jmp .LBL_2_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core-sse2.S
new file mode 100644
index 0000000000..ab7f9c500d
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized sincos.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN2vvv_sincos _ZGVbN2vvv_sincos_sse2
+#include "../svml_d_sincos2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core.S
deleted file mode 100644
index 883d7d33a4..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized sincos.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN2vvv_sincos)
- .type _ZGVbN2vvv_sincos, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN2vvv_sincos_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN2vvv_sincos_sse2(%rip), %rax
- ret
-END (_ZGVbN2vvv_sincos)
-libmvec_hidden_def (_ZGVbN2vvv_sincos)
-
-#define _ZGVbN2vvv_sincos _ZGVbN2vvv_sincos_sse2
-#include "../svml_d_sincos2_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core.c
new file mode 100644
index 0000000000..f373bb40a3
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized sincos, vector length is 2.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN2vvv_sincos
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN2vvv_sincos, __GI__ZGVbN2vvv_sincos,
+ __redirect__ZGVbN2vvv_sincos)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S
index 65ad540122..b4dfa37898 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S
@@ -1,5 +1,5 @@
/* Function sincos vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
#include "svml_d_trig_data.h"
.text
-ENTRY (_ZGVbN2vvv_sincos_sse4)
+ENTRY (_ZGVbN2vl8l8_sincos_sse4)
/*
ALGORITHM DESCRIPTION:
@@ -287,12 +287,12 @@ ENTRY (_ZGVbN2vvv_sincos_sse4)
shlq $4, %r15
movsd 136(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
movsd %xmm0, 200(%rsp,%r15)
movsd 136(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
movsd %xmm0, 264(%rsp,%r15)
jmp .LBL_1_8
@@ -302,13 +302,67 @@ ENTRY (_ZGVbN2vvv_sincos_sse4)
shlq $4, %r15
movsd 128(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
movsd %xmm0, 192(%rsp,%r15)
movsd 128(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
movsd %xmm0, 256(%rsp,%r15)
jmp .LBL_1_7
+END (_ZGVbN2vl8l8_sincos_sse4)
+libmvec_hidden_def(_ZGVbN2vl8l8_sincos_sse4)
+
+/* vvv version implemented with wrapper to vl8l8 variant. */
+ENTRY (_ZGVbN2vvv_sincos_sse4)
+#ifndef __ILP32__
+ subq $72, %rsp
+ .cfi_def_cfa_offset 80
+ movdqu %xmm1, 32(%rsp)
+ lea (%rsp), %rdi
+ movdqu %xmm2, 48(%rdi)
+ lea 16(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(_ZGVbN2vl8l8_sincos_sse4)
+ movq 32(%rsp), %rdx
+ movq 48(%rsp), %rsi
+ movq 40(%rsp), %r8
+ movq 56(%rsp), %r10
+ movq (%rsp), %rax
+ movq 16(%rsp), %rcx
+ movq 8(%rsp), %rdi
+ movq 24(%rsp), %r9
+ movq %rax, (%rdx)
+ movq %rcx, (%rsi)
+ movq %rdi, (%r8)
+ movq %r9, (%r10)
+ addq $72, %rsp
+ .cfi_def_cfa_offset 8
+ ret
+#else
+ subl $72, %esp
+ .cfi_def_cfa_offset 80
+ leal 48(%rsp), %esi
+ movaps %xmm1, 16(%esp)
+ leal 32(%rsp), %edi
+ movaps %xmm2, (%esp)
+ call HIDDEN_JUMPTARGET(_ZGVbN2vl8l8_sincos_sse4)
+ movdqa 16(%esp), %xmm1
+ movsd 32(%esp), %xmm0
+ movq %xmm1, %rax
+ movdqa (%esp), %xmm2
+ movsd %xmm0, (%eax)
+ movsd 40(%esp), %xmm0
+ pextrd $1, %xmm1, %eax
+ movsd %xmm0, (%eax)
+ movsd 48(%esp), %xmm0
+ movq %xmm2, %rax
+ movsd %xmm0, (%eax)
+ movsd 56(%esp), %xmm0
+ pextrd $1, %xmm2, %eax
+ movsd %xmm0, (%eax)
+ addl $72, %esp
+ .cfi_def_cfa_offset 8
+ ret
+#endif
END (_ZGVbN2vvv_sincos_sse4)
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core-sse.S
new file mode 100644
index 0000000000..10b4a2cf16
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized sincos.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN4vvv_sincos _ZGVdN4vvv_sincos_sse_wrapper
+#include "../svml_d_sincos4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core.S
deleted file mode 100644
index 69a3f74650..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized sincos.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN4vvv_sincos)
- .type _ZGVdN4vvv_sincos, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN4vvv_sincos_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN4vvv_sincos_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN4vvv_sincos)
-libmvec_hidden_def (_ZGVdN4vvv_sincos)
-
-#define _ZGVdN4vvv_sincos _ZGVdN4vvv_sincos_sse_wrapper
-#include "../svml_d_sincos4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core.c
new file mode 100644
index 0000000000..1fabd7b471
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized sincos, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN4vvv_sincos
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN4vvv_sincos, __GI__ZGVdN4vvv_sincos,
+ __redirect__ZGVdN4vvv_sincos)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S
index 60d03e9f8b..d56aa96ac9 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S
@@ -1,5 +1,5 @@
/* Function sincos vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
#include "svml_d_trig_data.h"
.text
-ENTRY (_ZGVdN4vvv_sincos_avx2)
+ENTRY (_ZGVdN4vl8l8_sincos_avx2)
/*
ALGORITHM DESCRIPTION:
@@ -248,12 +248,12 @@ ENTRY (_ZGVdN4vvv_sincos_avx2)
vmovsd 264(%rsp,%r15), %xmm0
vzeroupper
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 328(%rsp,%r15)
vmovsd 264(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 392(%rsp,%r15)
jmp .LBL_1_8
@@ -264,14 +264,110 @@ ENTRY (_ZGVdN4vvv_sincos_avx2)
vmovsd 256(%rsp,%r15), %xmm0
vzeroupper
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 320(%rsp,%r15)
vmovsd 256(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 384(%rsp,%r15)
jmp .LBL_1_7
+END (_ZGVdN4vl8l8_sincos_avx2)
+libmvec_hidden_def(_ZGVdN4vl8l8_sincos_avx2)
+
+/* vvv version implemented with wrapper to vl8l8 variant. */
+ENTRY (_ZGVdN4vvv_sincos_avx2)
+#ifndef __ILP32__
+ pushq %rbp
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (%rbp, 0)
+ movq %rsp, %rbp
+ cfi_def_cfa_register (%rbp)
+ andq $-32, %rsp
+ subq $128, %rsp
+ vmovdqu %ymm1, 64(%rsp)
+ lea (%rsp), %rdi
+ vmovdqu %ymm2, 96(%rdi)
+ lea 32(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(_ZGVdN4vl8l8_sincos_avx2)
+ movq 64(%rsp), %rdx
+ movq 96(%rsp), %rsi
+ movq 72(%rsp), %r8
+ movq 104(%rsp), %r10
+ movq (%rsp), %rax
+ movq 32(%rsp), %rcx
+ movq 8(%rsp), %rdi
+ movq 40(%rsp), %r9
+ movq %rax, (%rdx)
+ movq %rcx, (%rsi)
+ movq 80(%rsp), %rax
+ movq 112(%rsp), %rcx
+ movq %rdi, (%r8)
+ movq %r9, (%r10)
+ movq 88(%rsp), %rdi
+ movq 120(%rsp), %r9
+ movq 16(%rsp), %r11
+ movq 48(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 56(%rsp), %r8
+ movq %r11, (%rax)
+ movq %rdx, (%rcx)
+ movq %rsi, (%rdi)
+ movq %r8, (%r9)
+ movq %rbp, %rsp
+ cfi_def_cfa_register (%rsp)
+ popq %rbp
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (%rbp)
+ ret
+#else
+ leal 8(%rsp), %r10d
+ .cfi_def_cfa 10, 0
+ andl $-32, %esp
+ pushq -8(%r10d)
+ pushq %rbp
+ .cfi_escape 0x10,0x6,0x2,0x76,0
+ movl %esp, %ebp
+ pushq %r10
+ .cfi_escape 0xf,0x3,0x76,0x78,0x6
+ leal -48(%rbp), %esi
+ leal -80(%rbp), %edi
+ subl $104, %esp
+ vmovaps %xmm1, -96(%ebp)
+ vmovaps %xmm2, -112(%ebp)
+ call HIDDEN_JUMPTARGET(_ZGVdN4vl8l8_sincos_avx2)
+ movl -96(%ebp), %eax
+ vmovsd -80(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -92(%ebp), %eax
+ vmovsd -72(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -88(%ebp), %eax
+ vmovsd -64(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -84(%ebp), %eax
+ vmovsd -56(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -112(%ebp), %eax
+ vmovsd -48(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -108(%ebp), %eax
+ vmovsd -40(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -104(%ebp), %eax
+ vmovsd -32(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -100(%ebp), %eax
+ vmovsd -24(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ addl $104, %esp
+ popq %r10
+ .cfi_def_cfa 10, 0
+ popq %rbp
+ leal -8(%r10), %esp
+ .cfi_def_cfa 7, 8
+ ret
+#endif
END (_ZGVdN4vvv_sincos_avx2)
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core-avx2.S
new file mode 100644
index 0000000000..8cf88f6461
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core-avx2.S
@@ -0,0 +1,20 @@
+/* AVX2 version of vectorized sincos.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVeN8vvv_sincos _ZGVeN8vvv_sincos_avx2_wrapper
+#include "../svml_d_sincos8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.S
deleted file mode 100644
index 64cb08c5d1..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized sincos.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN8vvv_sincos)
- .type _ZGVeN8vvv_sincos, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN8vvv_sincos_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN8vvv_sincos_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN8vvv_sincos_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN8vvv_sincos)
-
-#define _ZGVeN8vvv_sincos _ZGVeN8vvv_sincos_avx2_wrapper
-#include "../svml_d_sincos8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.c
new file mode 100644
index 0000000000..1409872ed2
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized sincos, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN8vvv_sincos
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN8vvv_sincos, __GI__ZGVeN8vvv_sincos,
+ __redirect__ZGVeN8vvv_sincos)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S
index 44700f90b8..2df626c0c1 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S
@@ -1,5 +1,5 @@
/* Function sincos vectorized with AVX-512. KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,9 +36,9 @@
sin(R), sin(R') are approximated by corresponding polynomial. */
.text
-ENTRY (_ZGVeN8vvv_sincos_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
-WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos
+ENTRY (_ZGVeN8vl8l8_sincos_knl)
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
+WRAPPER_IMPL_AVX512_fFF _ZGVdN4vl8l8_sincos
#else
pushq %rbp
cfi_adjust_cfa_offset (8)
@@ -278,12 +278,12 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos
shlq $4, %r15
vmovsd 1160(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 1224(%rsp,%r15)
vmovsd 1160(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 1288(%rsp,%r15)
jmp .LBL_1_8
@@ -293,22 +293,23 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos
shlq $4, %r15
vmovsd 1152(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 1216(%rsp,%r15)
vmovsd 1152(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 1280(%rsp,%r15)
jmp .LBL_1_7
#endif
-END (_ZGVeN8vvv_sincos_knl)
+END (_ZGVeN8vl8l8_sincos_knl)
+libmvec_hidden_def(_ZGVeN8vl8l8_sincos_knl)
-ENTRY (_ZGVeN8vvv_sincos_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
-WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos
+ENTRY (_ZGVeN8vl8l8_sincos_skx)
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
+WRAPPER_IMPL_AVX512_fFF _ZGVdN4vl8l8_sincos
#else
pushq %rbp
cfi_adjust_cfa_offset (8)
@@ -557,12 +558,12 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos
vzeroupper
vmovsd 1160(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 1224(%rsp,%r15)
vmovsd 1160(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 1288(%rsp,%r15)
jmp .LBL_2_8
@@ -574,17 +575,171 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos
vzeroupper
vmovsd 1152(%rsp,%r15), %xmm0
- call sin@PLT
+ call JUMPTARGET(sin)
vmovsd %xmm0, 1216(%rsp,%r15)
vmovsd 1152(%rsp,%r15), %xmm0
- call cos@PLT
+ call JUMPTARGET(cos)
vmovsd %xmm0, 1280(%rsp,%r15)
jmp .LBL_2_7
#endif
+END (_ZGVeN8vl8l8_sincos_skx)
+libmvec_hidden_def(_ZGVeN8vl8l8_sincos_skx)
+
+/* Wrapper between vvv and vl8l8 vector variants. */
+.macro WRAPPER_AVX512_vvv_vl8l8 callee
+#ifndef __ILP32__
+ pushq %rbp
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (%rbp, 0)
+ movq %rsp, %rbp
+ cfi_def_cfa_register (%rbp)
+ andq $-64, %rsp
+ subq $256, %rsp
+ vmovups %zmm1, 128(%rsp)
+ lea (%rsp), %rdi
+ vmovups %zmm2, 192(%rdi)
+ lea 64(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq 128(%rsp), %rdx
+ movq 136(%rsp), %rsi
+ movq 144(%rsp), %r8
+ movq 152(%rsp), %r10
+ movq (%rsp), %rax
+ movq 8(%rsp), %rcx
+ movq 16(%rsp), %rdi
+ movq 24(%rsp), %r9
+ movq %rax, (%rdx)
+ movq %rcx, (%rsi)
+ movq 160(%rsp), %rax
+ movq 168(%rsp), %rcx
+ movq %rdi, (%r8)
+ movq %r9, (%r10)
+ movq 176(%rsp), %rdi
+ movq 184(%rsp), %r9
+ movq 32(%rsp), %r11
+ movq 40(%rsp), %rdx
+ movq 48(%rsp), %rsi
+ movq 56(%rsp), %r8
+ movq %r11, (%rax)
+ movq %rdx, (%rcx)
+ movq 192(%rsp), %r11
+ movq 200(%rsp), %rdx
+ movq %rsi, (%rdi)
+ movq %r8, (%r9)
+ movq 208(%rsp), %rsi
+ movq 216(%rsp), %r8
+ movq 64(%rsp), %r10
+ movq 72(%rsp), %rax
+ movq 80(%rsp), %rcx
+ movq 88(%rsp), %rdi
+ movq %r10, (%r11)
+ movq %rax, (%rdx)
+ movq 224(%rsp), %r10
+ movq 232(%rsp), %rax
+ movq %rcx, (%rsi)
+ movq %rdi, (%r8)
+ movq 240(%rsp), %rcx
+ movq 248(%rsp), %rdi
+ movq 96(%rsp), %r9
+ movq 104(%rsp), %r11
+ movq 112(%rsp), %rdx
+ movq 120(%rsp), %rsi
+ movq %r9, (%r10)
+ movq %r11, (%rax)
+ movq %rdx, (%rcx)
+ movq %rsi, (%rdi)
+ movq %rbp, %rsp
+ cfi_def_cfa_register (%rsp)
+ popq %rbp
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (%rbp)
+ ret
+#else
+ leal 8(%rsp), %r10d
+ .cfi_def_cfa 10, 0
+ andl $-64, %esp
+ pushq -8(%r10d)
+ pushq %rbp
+ .cfi_escape 0x10,0x6,0x2,0x76,0
+ movl %esp, %ebp
+ pushq %r10
+ .cfi_escape 0xf,0x3,0x76,0x78,0x6
+ leal -112(%rbp), %esi
+ leal -176(%rbp), %edi
+ subl $232, %esp
+ vmovdqa %ymm1, -208(%ebp)
+ vmovdqa %ymm2, -240(%ebp)
+ call HIDDEN_JUMPTARGET(\callee)
+ vmovdqa -208(%ebp), %xmm0
+ vmovq %xmm0, %rax
+ vmovsd -176(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ shrq $32, %rax
+ vmovsd -168(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movq -200(%ebp), %rax
+ vmovsd -160(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ shrq $32, %rax
+ vmovsd -152(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movq -192(%ebp), %rax
+ vmovsd -144(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ shrq $32, %rax
+ vmovsd -136(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movq -184(%ebp), %rax
+ vmovsd -128(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ shrq $32, %rax
+ vmovsd -120(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ vmovdqa -240(%ebp), %xmm0
+ vmovq %xmm0, %rax
+ vmovsd -112(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ shrq $32, %rax
+ vmovsd -104(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movq -232(%ebp), %rax
+ vmovsd -96(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ shrq $32, %rax
+ vmovsd -88(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movq -224(%ebp), %rax
+ vmovsd -80(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ shrq $32, %rax
+ vmovsd -72(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movq -216(%ebp), %rax
+ vmovsd -64(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ shrq $32, %rax
+ vmovsd -56(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ addl $232, %esp
+ popq %r10
+ .cfi_def_cfa 10, 0
+ popq %rbp
+ leal -8(%r10), %esp
+ .cfi_def_cfa 7, 8
+ ret
+#endif
+.endm
+
+ENTRY (_ZGVeN8vvv_sincos_knl)
+WRAPPER_AVX512_vvv_vl8l8 _ZGVeN8vl8l8_sincos_knl
+END (_ZGVeN8vvv_sincos_knl)
+
+ENTRY (_ZGVeN8vvv_sincos_skx)
+WRAPPER_AVX512_vvv_vl8l8 _ZGVeN8vl8l8_sincos_skx
END (_ZGVeN8vvv_sincos_skx)
.section .rodata, "a"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core-avx2.S
new file mode 100644
index 0000000000..f01f89f294
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core-avx2.S
@@ -0,0 +1,20 @@
+/* AVX2 version of vectorized cosf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVeN16v_cosf _ZGVeN16v_cosf_avx2_wrapper
+#include "../svml_s_cosf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core.S
deleted file mode 100644
index 755254a280..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized cosf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN16v_cosf)
- .type _ZGVeN16v_cosf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN16v_cosf_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN16v_cosf_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN16v_cosf_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN16v_cosf)
-
-#define _ZGVeN16v_cosf _ZGVeN16v_cosf_avx2_wrapper
-#include "../svml_s_cosf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core.c
new file mode 100644
index 0000000000..5bd0441b16
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized cosf, vector length is 16.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN16v_cosf
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN16v_cosf, __GI__ZGVeN16v_cosf,
+ __redirect__ZGVeN16v_cosf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core_avx512.S
index 5004cd4758..6ea1137b42 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core_avx512.S
@@ -1,5 +1,5 @@
/* Function cosf vectorized with AVX-512. KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
.text
ENTRY (_ZGVeN16v_cosf_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN8v_cosf
#else
/*
@@ -225,21 +225,21 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_cosf
cfi_restore_state
movzbl %r12b, %r15d
vmovss 1156(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 1220(%rsp,%r15,8)
jmp .LBL_1_8
.LBL_1_12:
movzbl %r12b, %r15d
vmovss 1152(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 1216(%rsp,%r15,8)
jmp .LBL_1_7
#endif
END (_ZGVeN16v_cosf_knl)
ENTRY (_ZGVeN16v_cosf_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN8v_cosf
#else
/*
@@ -440,7 +440,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_cosf
vmovss 1156(%rsp,%r15,8), %xmm0
vzeroupper
vmovss 1156(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 1220(%rsp,%r15,8)
jmp .LBL_2_8
.LBL_2_12:
@@ -448,7 +448,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_cosf
vmovss 1152(%rsp,%r15,8), %xmm0
vzeroupper
vmovss 1152(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 1216(%rsp,%r15,8)
jmp .LBL_2_7
#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core-sse2.S
new file mode 100644
index 0000000000..727189f8e6
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized cosf, vector length is 4.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN4v_cosf _ZGVbN4v_cosf_sse2
+#include "../svml_s_cosf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core.S
deleted file mode 100644
index ad7de18851..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized cosf, vector length is 4.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN4v_cosf)
- .type _ZGVbN4v_cosf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN4v_cosf_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN4v_cosf_sse2(%rip), %rax
- ret
-END (_ZGVbN4v_cosf)
-libmvec_hidden_def (_ZGVbN4v_cosf)
-
-#define _ZGVbN4v_cosf _ZGVbN4v_cosf_sse2
-#include "../svml_s_cosf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core.c
new file mode 100644
index 0000000000..dde470af5d
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized cosf, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN4v_cosf
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN4v_cosf, __GI__ZGVbN4v_cosf,
+ __redirect__ZGVbN4v_cosf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core_sse4.S
index d23ff72a30..f4e0553bb3 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf4_core_sse4.S
@@ -1,5 +1,5 @@
/* Function cosf vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -211,7 +211,7 @@ ENTRY (_ZGVbN4v_cosf_sse4)
movzbl %r12b, %r15d
movss 196(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
movss %xmm0, 260(%rsp,%r15,8)
jmp .LBL_1_8
@@ -220,7 +220,7 @@ ENTRY (_ZGVbN4v_cosf_sse4)
movzbl %r12b, %r15d
movss 192(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
movss %xmm0, 256(%rsp,%r15,8)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core-sse.S
new file mode 100644
index 0000000000..1e1a5540c3
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized cosf, vector length is 8.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN8v_cosf _ZGVdN8v_cosf_sse_wrapper
+#include "../svml_s_cosf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core.S
deleted file mode 100644
index 602c70e324..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized cosf, vector length is 8.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN8v_cosf)
- .type _ZGVdN8v_cosf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN8v_cosf_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN8v_cosf_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN8v_cosf)
-libmvec_hidden_def (_ZGVdN8v_cosf)
-
-#define _ZGVdN8v_cosf _ZGVdN8v_cosf_sse_wrapper
-#include "../svml_s_cosf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core.c
new file mode 100644
index 0000000000..56531b215a
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized cosf, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN8v_cosf
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN8v_cosf, __GI__ZGVdN8v_cosf,
+ __redirect__ZGVdN8v_cosf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core_avx2.S
index 513f3c0a29..dbff4a7b7e 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf8_core_avx2.S
@@ -1,5 +1,5 @@
/* Function cosf vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -197,7 +197,7 @@ ENTRY (_ZGVdN8v_cosf_avx2)
vmovss 324(%rsp,%r15,8), %xmm0
vzeroupper
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 388(%rsp,%r15,8)
jmp .LBL_1_8
@@ -207,7 +207,7 @@ ENTRY (_ZGVdN8v_cosf_avx2)
vmovss 320(%rsp,%r15,8), %xmm0
vzeroupper
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 384(%rsp,%r15,8)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core-avx2.S
new file mode 100644
index 0000000000..e0b7fd787f
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core-avx2.S
@@ -0,0 +1,23 @@
+/* AVX2 version of vectorized expf.
+ Copyright (C) 2014-2018 Free Software 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>
+#include <init-arch.h>
+
+#define _ZGVeN16v_expf _ZGVeN16v_expf_avx2_wrapper
+#include "../svml_s_expf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core.S
deleted file mode 100644
index f990d36483..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized expf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN16v_expf)
- .type _ZGVeN16v_expf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN16v_expf_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN16v_expf_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN16v_expf_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN16v_expf)
-
-#define _ZGVeN16v_expf _ZGVeN16v_expf_avx2_wrapper
-#include "../svml_s_expf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core.c
new file mode 100644
index 0000000000..d358d93546
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized expf, vector length is 16.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN16v_expf
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN16v_expf, __GI__ZGVeN16v_expf,
+ __redirect__ZGVeN16v_expf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S
index 7eb7a1b775..89ba0df28f 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S
@@ -1,5 +1,5 @@
/* Function expf vectorized with AVX-512. KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
.text
ENTRY (_ZGVeN16v_expf_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN8v_expf
#else
/*
@@ -212,14 +212,14 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_expf
cfi_restore_state
movzbl %r12b, %r15d
vmovss 1156(%rsp,%r15,8), %xmm0
- call expf@PLT
+ call JUMPTARGET(__expf_finite)
vmovss %xmm0, 1220(%rsp,%r15,8)
jmp .LBL_1_8
.LBL_1_12:
movzbl %r12b, %r15d
vmovss 1152(%rsp,%r15,8), %xmm0
- call expf@PLT
+ call JUMPTARGET(__expf_finite)
vmovss %xmm0, 1216(%rsp,%r15,8)
jmp .LBL_1_7
@@ -227,7 +227,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_expf
END (_ZGVeN16v_expf_knl)
ENTRY (_ZGVeN16v_expf_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN8v_expf
#else
/*
@@ -422,7 +422,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_expf
vzeroupper
vmovss 1156(%rsp,%r15,8), %xmm0
- call expf@PLT
+ call JUMPTARGET(__expf_finite)
vmovss %xmm0, 1220(%rsp,%r15,8)
jmp .LBL_2_8
@@ -433,7 +433,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_expf
vzeroupper
vmovss 1152(%rsp,%r15,8), %xmm0
- call expf@PLT
+ call JUMPTARGET(__expf_finite)
vmovss %xmm0, 1216(%rsp,%r15,8)
jmp .LBL_2_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core-sse2.S
new file mode 100644
index 0000000000..8f57e4bbd9
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized expf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN4v_expf _ZGVbN4v_expf_sse2
+#include "../svml_s_expf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core.S
deleted file mode 100644
index 2fbe6d475e..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized expf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN4v_expf)
- .type _ZGVbN4v_expf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN4v_expf_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN4v_expf_sse2(%rip), %rax
- ret
-END (_ZGVbN4v_expf)
-libmvec_hidden_def (_ZGVbN4v_expf)
-
-#define _ZGVbN4v_expf _ZGVbN4v_expf_sse2
-#include "../svml_s_expf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core.c
new file mode 100644
index 0000000000..82befe0b5d
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized expf, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN4v_expf
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN4v_expf, __GI__ZGVbN4v_expf,
+ __redirect__ZGVbN4v_expf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core_sse4.S
index c6f91e8dc1..254ec94096 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core_sse4.S
@@ -1,5 +1,5 @@
/* Function expf vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -195,7 +195,7 @@ ENTRY (_ZGVbN4v_expf_sse4)
movzbl %r12b, %r15d
movss 196(%rsp,%r15,8), %xmm0
- call expf@PLT
+ call JUMPTARGET(__expf_finite)
movss %xmm0, 260(%rsp,%r15,8)
jmp .LBL_1_8
@@ -204,7 +204,7 @@ ENTRY (_ZGVbN4v_expf_sse4)
movzbl %r12b, %r15d
movss 192(%rsp,%r15,8), %xmm0
- call expf@PLT
+ call JUMPTARGET(__expf_finite)
movss %xmm0, 256(%rsp,%r15,8)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core-sse.S
new file mode 100644
index 0000000000..459699c80c
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized expf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN8v_expf _ZGVdN8v_expf_sse_wrapper
+#include "../svml_s_expf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core.S
deleted file mode 100644
index 7d19bb423d..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized expf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN8v_expf)
- .type _ZGVdN8v_expf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN8v_expf_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN8v_expf_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN8v_expf)
-libmvec_hidden_def (_ZGVdN8v_expf)
-
-#define _ZGVdN8v_expf _ZGVdN8v_expf_sse_wrapper
-#include "../svml_s_expf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core.c
new file mode 100644
index 0000000000..0b8a47ede0
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized expf, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN8v_expf
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN8v_expf, __GI__ZGVdN8v_expf,
+ __redirect__ZGVdN8v_expf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core_avx2.S
index c6be6954f7..ae1d5317e4 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core_avx2.S
@@ -1,5 +1,5 @@
/* Function expf vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -184,7 +184,7 @@ ENTRY(_ZGVdN8v_expf_avx2)
vmovss 324(%rsp,%r15,8), %xmm0
vzeroupper
- call expf@PLT
+ call JUMPTARGET(__expf_finite)
vmovss %xmm0, 388(%rsp,%r15,8)
jmp .LBL_1_8
@@ -194,7 +194,7 @@ ENTRY(_ZGVdN8v_expf_avx2)
vmovss 320(%rsp,%r15,8), %xmm0
vzeroupper
- call expf@PLT
+ call JUMPTARGET(__expf_finite)
vmovss %xmm0, 384(%rsp,%r15,8)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core-avx2.S
new file mode 100644
index 0000000000..b23bd12fa0
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core-avx2.S
@@ -0,0 +1,20 @@
+/* AVX2 version of vectorized logf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVeN16v_logf _ZGVeN16v_logf_avx2_wrapper
+#include "../svml_s_logf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core.S
deleted file mode 100644
index 9efb2fb7df..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized logf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN16v_logf)
- .type _ZGVeN16v_logf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN16v_logf_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN16v_logf_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN16v_logf_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN16v_logf)
-
-#define _ZGVeN16v_logf _ZGVeN16v_logf_avx2_wrapper
-#include "../svml_s_logf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core.c
new file mode 100644
index 0000000000..fec61883b4
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized logf, vector length is 16.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN16v_logf
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN16v_logf, __GI__ZGVeN16v_logf,
+ __redirect__ZGVeN16v_logf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S
index 6209058381..4cf0a96fe4 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S
@@ -1,5 +1,5 @@
/* Function logf vectorized with AVX-512. KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
.text
ENTRY (_ZGVeN16v_logf_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN8v_logf
#else
/*
@@ -197,21 +197,21 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_logf
cfi_restore_state
movzbl %r12b, %r15d
vmovss 1156(%rsp,%r15,8), %xmm0
- call logf@PLT
+ call JUMPTARGET(__logf_finite)
vmovss %xmm0, 1220(%rsp,%r15,8)
jmp .LBL_1_8
.LBL_1_12:
movzbl %r12b, %r15d
vmovss 1152(%rsp,%r15,8), %xmm0
- call logf@PLT
+ call JUMPTARGET(__logf_finite)
vmovss %xmm0, 1216(%rsp,%r15,8)
jmp .LBL_1_7
#endif
END (_ZGVeN16v_logf_knl)
ENTRY (_ZGVeN16v_logf_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN8v_logf
#else
/*
@@ -391,7 +391,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_logf
vzeroupper
vmovss 1156(%rsp,%r15,8), %xmm0
- call logf@PLT
+ call JUMPTARGET(__logf_finite)
vmovss %xmm0, 1220(%rsp,%r15,8)
jmp .LBL_2_8
@@ -402,7 +402,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_logf
vzeroupper
vmovss 1152(%rsp,%r15,8), %xmm0
- call logf@PLT
+ call JUMPTARGET(__logf_finite)
vmovss %xmm0, 1216(%rsp,%r15,8)
jmp .LBL_2_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core-sse2.S
new file mode 100644
index 0000000000..2c2331e1d8
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized logf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN4v_logf _ZGVbN4v_logf_sse2
+#include "../svml_s_logf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core.S
deleted file mode 100644
index c85615ac25..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized logf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN4v_logf)
- .type _ZGVbN4v_logf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN4v_logf_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN4v_logf_sse2(%rip), %rax
- ret
-END (_ZGVbN4v_logf)
-libmvec_hidden_def (_ZGVbN4v_logf)
-
-#define _ZGVbN4v_logf _ZGVbN4v_logf_sse2
-#include "../svml_s_logf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core.c
new file mode 100644
index 0000000000..f249c351bd
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized logf, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN4v_logf
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN4v_logf, __GI__ZGVbN4v_logf,
+ __redirect__ZGVbN4v_logf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core_sse4.S
index 1ce9838513..651eb5eb1a 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core_sse4.S
@@ -1,5 +1,5 @@
/* Function logf vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -177,7 +177,7 @@ ENTRY (_ZGVbN4v_logf_sse4)
movzbl %r12b, %r15d
movss 196(%rsp,%r15,8), %xmm0
- call logf@PLT
+ call JUMPTARGET(__logf_finite)
movss %xmm0, 260(%rsp,%r15,8)
jmp .LBL_1_8
@@ -186,7 +186,7 @@ ENTRY (_ZGVbN4v_logf_sse4)
movzbl %r12b, %r15d
movss 192(%rsp,%r15,8), %xmm0
- call logf@PLT
+ call JUMPTARGET(__logf_finite)
movss %xmm0, 256(%rsp,%r15,8)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core-sse.S
new file mode 100644
index 0000000000..862379277b
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized logf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN8v_logf _ZGVdN8v_logf_sse_wrapper
+#include "../svml_s_logf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core.S
deleted file mode 100644
index 8f6d83dd56..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized logf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN8v_logf)
- .type _ZGVdN8v_logf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN8v_logf_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN8v_logf_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN8v_logf)
-libmvec_hidden_def (_ZGVdN8v_logf)
-
-#define _ZGVdN8v_logf _ZGVdN8v_logf_sse_wrapper
-#include "../svml_s_logf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core.c
new file mode 100644
index 0000000000..dbd29657ca
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized logf, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN8v_logf
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN8v_logf, __GI__ZGVdN8v_logf,
+ __redirect__ZGVdN8v_logf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core_avx2.S
index 91fb549ce6..c7f5448fcb 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core_avx2.S
@@ -1,5 +1,5 @@
/* Function logf vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -166,7 +166,7 @@ ENTRY(_ZGVdN8v_logf_avx2)
vmovss 324(%rsp,%r15,8), %xmm0
vzeroupper
- call logf@PLT
+ call JUMPTARGET(__logf_finite)
vmovss %xmm0, 388(%rsp,%r15,8)
jmp .LBL_1_8
@@ -176,7 +176,7 @@ ENTRY(_ZGVdN8v_logf_avx2)
vmovss 320(%rsp,%r15,8), %xmm0
vzeroupper
- call logf@PLT
+ call JUMPTARGET(__logf_finite)
vmovss %xmm0, 384(%rsp,%r15,8)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core-avx2.S
new file mode 100644
index 0000000000..de705c8632
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core-avx2.S
@@ -0,0 +1,20 @@
+/* AVX2 version of vectorized powf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVeN16vv_powf _ZGVeN16vv_powf_avx2_wrapper
+#include "../svml_s_powf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core.S
deleted file mode 100644
index 80048ce977..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized powf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN16vv_powf)
- .type _ZGVeN16vv_powf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN16vv_powf_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN16vv_powf_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN16vv_powf_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN16vv_powf)
-
-#define _ZGVeN16vv_powf _ZGVeN16vv_powf_avx2_wrapper
-#include "../svml_s_powf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core.c
new file mode 100644
index 0000000000..91ea810441
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized powf, vector length is 16.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN16vv_powf
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN16vv_powf, __GI__ZGVeN16vv_powf,
+ __redirect__ZGVeN16vv_powf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S
index 45d48723af..bdcd50afe1 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S
@@ -1,5 +1,5 @@
/* Function powf vectorized with AVX-512. KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -82,7 +82,7 @@
.text
ENTRY (_ZGVeN16vv_powf_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf
#else
pushq %rbp
@@ -344,7 +344,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf
movzbl %r12b, %r15d
vmovss 1156(%rsp,%r15,8), %xmm0
vmovss 1220(%rsp,%r15,8), %xmm1
- call powf@PLT
+ call JUMPTARGET(__powf_finite)
vmovss %xmm0, 1284(%rsp,%r15,8)
jmp .LBL_1_8
@@ -352,14 +352,14 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf
movzbl %r12b, %r15d
vmovss 1152(%rsp,%r15,8), %xmm0
vmovss 1216(%rsp,%r15,8), %xmm1
- call powf@PLT
+ call JUMPTARGET(__powf_finite)
vmovss %xmm0, 1280(%rsp,%r15,8)
jmp .LBL_1_7
#endif
END (_ZGVeN16vv_powf_knl)
ENTRY (_ZGVeN16vv_powf_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf
#else
pushq %rbp
@@ -629,7 +629,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf
vmovss 1156(%rsp,%r15,8), %xmm1
vzeroupper
vmovss 1092(%rsp,%r15,8), %xmm0
- call powf@PLT
+ call JUMPTARGET(__powf_finite)
vmovss %xmm0, 1220(%rsp,%r15,8)
jmp .LBL_2_8
@@ -638,7 +638,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf
vmovss 1152(%rsp,%r15,8), %xmm1
vzeroupper
vmovss 1088(%rsp,%r15,8), %xmm0
- call powf@PLT
+ call JUMPTARGET(__powf_finite)
vmovss %xmm0, 1216(%rsp,%r15,8)
jmp .LBL_2_7
#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core-sse2.S
new file mode 100644
index 0000000000..b6789a621d
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized powf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN4vv_powf _ZGVbN4vv_powf_sse2
+#include "../svml_s_powf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core.S
deleted file mode 100644
index b46821189b..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized powf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN4vv_powf)
- .type _ZGVbN4vv_powf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN4vv_powf_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN4vv_powf_sse2(%rip), %rax
- ret
-END (_ZGVbN4vv_powf)
-libmvec_hidden_def (_ZGVbN4vv_powf)
-
-#define _ZGVbN4vv_powf _ZGVbN4vv_powf_sse2
-#include "../svml_s_powf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core.c
new file mode 100644
index 0000000000..8149d7c991
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized powf, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN4vv_powf
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN4vv_powf, __GI__ZGVbN4vv_powf,
+ __redirect__ZGVbN4vv_powf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core_sse4.S
index 420f98c6a6..bc59545c98 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core_sse4.S
@@ -1,5 +1,5 @@
/* Function powf vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -356,7 +356,7 @@ ENTRY (_ZGVbN4vv_powf_sse4)
movss 68(%rsp,%r15,8), %xmm0
movss 132(%rsp,%r15,8), %xmm1
- call powf@PLT
+ call JUMPTARGET(__powf_finite)
movss %xmm0, 196(%rsp,%r15,8)
jmp .LBL_1_8
@@ -366,7 +366,7 @@ ENTRY (_ZGVbN4vv_powf_sse4)
movss 64(%rsp,%r15,8), %xmm0
movss 128(%rsp,%r15,8), %xmm1
- call powf@PLT
+ call JUMPTARGET(__powf_finite)
movss %xmm0, 192(%rsp,%r15,8)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core-sse.S
new file mode 100644
index 0000000000..48da6d25c7
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized powf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN8vv_powf _ZGVdN8vv_powf_sse_wrapper
+#include "../svml_s_powf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core.S
deleted file mode 100644
index 945908a2ff..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized powf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN8vv_powf)
- .type _ZGVdN8vv_powf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN8vv_powf_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN8vv_powf_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN8vv_powf)
-libmvec_hidden_def (_ZGVdN8vv_powf)
-
-#define _ZGVdN8vv_powf _ZGVdN8vv_powf_sse_wrapper
-#include "../svml_s_powf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core.c
new file mode 100644
index 0000000000..0da188180e
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized sinf, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN8vv_powf
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN8vv_powf, __GI__ZGVdN8vv_powf,
+ __redirect__ZGVdN8vv_powf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core_avx2.S
index 4446859130..53a4b4bc2b 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core_avx2.S
@@ -1,5 +1,5 @@
/* Function powf vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -317,7 +317,7 @@ ENTRY(_ZGVdN8vv_powf_avx2)
vmovss 132(%rsp,%r15,8), %xmm1
vzeroupper
- call powf@PLT
+ call JUMPTARGET(__powf_finite)
vmovss %xmm0, 196(%rsp,%r15,8)
jmp .LBL_1_8
@@ -328,7 +328,7 @@ ENTRY(_ZGVdN8vv_powf_avx2)
vmovss 128(%rsp,%r15,8), %xmm1
vzeroupper
- call powf@PLT
+ call JUMPTARGET(__powf_finite)
vmovss %xmm0, 192(%rsp,%r15,8)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core-avx2.S
new file mode 100644
index 0000000000..c677e3f1cf
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core-avx2.S
@@ -0,0 +1,20 @@
+/* AVX2 version of vectorized sincosf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVeN16vvv_sincosf _ZGVeN16vvv_sincosf_avx2_wrapper
+#include "../svml_s_sincosf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core.S
deleted file mode 100644
index 16cee0c676..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized sincosf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN16vvv_sincosf)
- .type _ZGVeN16vvv_sincosf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN16vvv_sincosf_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN16vvv_sincosf_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN16vvv_sincosf_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN16vvv_sincosf)
-
-#define _ZGVeN16vvv_sincosf _ZGVeN16vvv_sincosf_avx2_wrapper
-#include "../svml_s_sincosf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core.c
new file mode 100644
index 0000000000..b753be6bbd
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized sincosf, vector length is 16.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN16vvv_sincosf
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN16vvv_sincosf, __GI__ZGVeN16vvv_sincosf,
+ __redirect__ZGVeN16vvv_sincosf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S
index 758aeeaeed..5fa4bc412a 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S
@@ -1,5 +1,5 @@
/* Function sincosf vectorized with AVX-512. KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -41,7 +41,7 @@
b) Calculate 2 polynomials for sin and cos:
RS = X * ( A0 + X^2 * (A1 + x^2 * (A2 + x^2 * (A3))));
RC = B0 + X^2 * (B1 + x^2 * (B2 + x^2 * (B3 + x^2 * (B4))));
- c) Swap RS & RC if if first bit of obtained value after
+ c) Swap RS & RC if first bit of obtained value after
Right Shifting is set to 1. Using And, Andnot & Or operations.
3) Destination sign setting
a) Set shifted destination sign using XOR operation:
@@ -49,9 +49,9 @@
R2 = XOR( RC, SC ). */
.text
-ENTRY (_ZGVeN16vvv_sincosf_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
-WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf
+ENTRY (_ZGVeN16vl4l4_sincosf_knl)
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
+WRAPPER_IMPL_AVX512_fFF _ZGVdN8vl4l4_sincosf
#else
pushq %rbp
cfi_adjust_cfa_offset (8)
@@ -243,12 +243,12 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf
movzbl %r12b, %r15d
vmovss 1156(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 1220(%rsp,%r15,8)
vmovss 1156(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 1284(%rsp,%r15,8)
jmp .LBL_1_8
@@ -257,20 +257,21 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf
movzbl %r12b, %r15d
vmovss 1152(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 1216(%rsp,%r15,8)
vmovss 1152(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 1280(%rsp,%r15,8)
jmp .LBL_1_7
#endif
-END (_ZGVeN16vvv_sincosf_knl)
+END (_ZGVeN16vl4l4_sincosf_knl)
+libmvec_hidden_def(_ZGVeN16vl4l4_sincosf_knl)
-ENTRY (_ZGVeN16vvv_sincosf_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+ENTRY (_ZGVeN16vl4l4_sincosf_skx)
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf
#else
pushq %rbp
@@ -470,12 +471,12 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf
vzeroupper
vmovss 1156(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 1220(%rsp,%r15,8)
vmovss 1156(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 1284(%rsp,%r15,8)
jmp .LBL_2_8
@@ -486,16 +487,266 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf
vzeroupper
vmovss 1152(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 1216(%rsp,%r15,8)
vmovss 1152(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 1280(%rsp,%r15,8)
jmp .LBL_2_7
#endif
+END (_ZGVeN16vl4l4_sincosf_skx)
+libmvec_hidden_def(_ZGVeN16vl4l4_sincosf_skx)
+
+/* Wrapper between vvv and vl4l4 vector variants. */
+.macro WRAPPER_AVX512_vvv_vl4l4 callee
+#ifndef __ILP32__
+ pushq %rbp
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (%rbp, 0)
+ movq %rsp, %rbp
+ cfi_def_cfa_register (%rbp)
+ andq $-64, %rsp
+ subq $384, %rsp
+ vmovups %zmm1, 128(%rsp)
+ lea (%rsp), %rdi
+ vmovups %zmm2, 192(%rdi)
+ vmovups %zmm3, 256(%rdi)
+ vmovups %zmm4, 320(%rdi)
+ lea 64(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq 128(%rsp), %rdx
+ movq 136(%rsp), %rsi
+ movq 144(%rsp), %r8
+ movq 152(%rsp), %r10
+ movl (%rsp), %eax
+ movl 4(%rsp), %ecx
+ movl 8(%rsp), %edi
+ movl 12(%rsp), %r9d
+ movl %eax, (%rdx)
+ movl %ecx, (%rsi)
+ movq 160(%rsp), %rax
+ movq 168(%rsp), %rcx
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movq 176(%rsp), %rdi
+ movq 184(%rsp), %r9
+ movl 16(%rsp), %r11d
+ movl 20(%rsp), %edx
+ movl 24(%rsp), %esi
+ movl 28(%rsp), %r8d
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movq 192(%rsp), %r11
+ movq 200(%rsp), %rdx
+ movl %esi, (%rdi)
+ movl %r8d, (%r9)
+ movq 208(%rsp), %rsi
+ movq 216(%rsp), %r8
+ movl 32(%rsp), %r10d
+ movl 36(%rsp), %eax
+ movl 40(%rsp), %ecx
+ movl 44(%rsp), %edi
+ movl %r10d, (%r11)
+ movl %eax, (%rdx)
+ movq 224(%rsp), %r10
+ movq 232(%rsp), %rax
+ movl %ecx, (%rsi)
+ movl %edi, (%r8)
+ movq 240(%rsp), %rcx
+ movq 248(%rsp), %rdi
+ movl 48(%rsp), %r9d
+ movl 52(%rsp), %r11d
+ movl 56(%rsp), %edx
+ movl 60(%rsp), %esi
+ movl %r9d, (%r10)
+ movl %r11d, (%rax)
+ movq 256(%rsp), %r9
+ movq 264(%rsp), %r11
+ movl %edx, (%rcx)
+ movl %esi, (%rdi)
+ movq 272(%rsp), %rdx
+ movq 280(%rsp), %rsi
+ movl 64(%rsp), %r8d
+ movl 68(%rsp), %r10d
+ movl 72(%rsp), %eax
+ movl 76(%rsp), %ecx
+ movl %r8d, (%r9)
+ movl %r10d, (%r11)
+ movq 288(%rsp), %r8
+ movq 296(%rsp), %r10
+ movl %eax, (%rdx)
+ movl %ecx, (%rsi)
+ movq 304(%rsp), %rax
+ movq 312(%rsp), %rcx
+ movl 80(%rsp), %edi
+ movl 84(%rsp), %r9d
+ movl 88(%rsp), %r11d
+ movl 92(%rsp), %edx
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movq 320(%rsp), %rdi
+ movq 328(%rsp), %r9
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movq 336(%rsp), %r11
+ movq 344(%rsp), %rdx
+ movl 96(%rsp), %esi
+ movl 100(%rsp), %r8d
+ movl 104(%rsp), %r10d
+ movl 108(%rsp), %eax
+ movl %esi, (%rdi)
+ movl %r8d, (%r9)
+ movq 352(%rsp), %rsi
+ movq 360(%rsp), %r8
+ movl %r10d, (%r11)
+ movl %eax, (%rdx)
+ movq 368(%rsp), %r10
+ movq 376(%rsp), %rax
+ movl 112(%rsp), %ecx
+ movl 116(%rsp), %edi
+ movl 120(%rsp), %r9d
+ movl 124(%rsp), %r11d
+ movl %ecx, (%rsi)
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movl %r11d, (%rax)
+ movq %rbp, %rsp
+ cfi_def_cfa_register (%rsp)
+ popq %rbp
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (%rbp)
+ ret
+#else
+ leal 8(%rsp), %r10d
+ .cfi_def_cfa 10, 0
+ andl $-64, %esp
+ pushq -8(%r10d)
+ pushq %rbp
+ .cfi_escape 0x10,0x6,0x2,0x76,0
+ movl %esp, %ebp
+ pushq %r10
+ .cfi_escape 0xf,0x3,0x76,0x78,0x6
+ leal -112(%rbp), %esi
+ leal -176(%rbp), %edi
+ subl $296, %esp
+ vmovdqa64 %zmm1, -240(%ebp)
+ vmovdqa64 %zmm2, -304(%ebp)
+ call HIDDEN_JUMPTARGET(\callee)
+ movl -240(%ebp), %eax
+ vmovss -176(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -236(%ebp), %eax
+ vmovss -172(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -232(%ebp), %eax
+ vmovss -168(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -228(%ebp), %eax
+ vmovss -164(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -224(%ebp), %eax
+ vmovss -160(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -220(%ebp), %eax
+ vmovss -156(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -216(%ebp), %eax
+ vmovss -152(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -212(%ebp), %eax
+ vmovss -148(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -208(%ebp), %eax
+ vmovss -144(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -204(%ebp), %eax
+ vmovss -140(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -200(%ebp), %eax
+ vmovss -136(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -196(%ebp), %eax
+ vmovss -132(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -192(%ebp), %eax
+ vmovss -128(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -188(%ebp), %eax
+ vmovss -124(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -184(%ebp), %eax
+ vmovss -120(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -180(%ebp), %eax
+ vmovss -116(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -304(%ebp), %eax
+ vmovss -112(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -300(%ebp), %eax
+ vmovss -108(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -296(%ebp), %eax
+ vmovss -104(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -292(%ebp), %eax
+ vmovss -100(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -288(%ebp), %eax
+ vmovss -96(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -284(%ebp), %eax
+ vmovss -92(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -280(%ebp), %eax
+ vmovss -88(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -276(%ebp), %eax
+ vmovss -84(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -272(%ebp), %eax
+ vmovss -80(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -268(%ebp), %eax
+ vmovss -76(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -264(%ebp), %eax
+ vmovss -72(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -260(%ebp), %eax
+ vmovss -68(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -256(%ebp), %eax
+ vmovss -64(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -252(%ebp), %eax
+ vmovss -60(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -248(%ebp), %eax
+ vmovss -56(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -244(%ebp), %eax
+ vmovss -52(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ addl $296, %esp
+ popq %r10
+ .cfi_def_cfa 10, 0
+ popq %rbp
+ leal -8(%r10), %esp
+ .cfi_def_cfa 7, 8
+ ret
+#endif
+.endm
+
+ENTRY (_ZGVeN16vvv_sincosf_knl)
+WRAPPER_AVX512_vvv_vl4l4 _ZGVeN16vl4l4_sincosf_knl
+END (_ZGVeN16vvv_sincosf_knl)
+
+ENTRY (_ZGVeN16vvv_sincosf_skx)
+WRAPPER_AVX512_vvv_vl4l4 _ZGVeN16vl4l4_sincosf_skx
END (_ZGVeN16vvv_sincosf_skx)
.section .rodata, "a"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core-sse2.S
new file mode 100644
index 0000000000..cc718b3a2e
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized sincosf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN4vvv_sincosf _ZGVbN4vvv_sincosf_sse2
+#include "../svml_s_sincosf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core.S
deleted file mode 100644
index d72b4049e2..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized sincosf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN4vvv_sincosf)
- .type _ZGVbN4vvv_sincosf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN4vvv_sincosf_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN4vvv_sincosf_sse2(%rip), %rax
- ret
-END (_ZGVbN4vvv_sincosf)
-libmvec_hidden_def (_ZGVbN4vvv_sincosf)
-
-#define _ZGVbN4vvv_sincosf _ZGVbN4vvv_sincosf_sse2
-#include "../svml_s_sincosf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core.c
new file mode 100644
index 0000000000..705d96a8fb
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized sincosf, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN4vvv_sincosf
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN4vvv_sincosf, __GI__ZGVbN4vvv_sincosf,
+ __redirect__ZGVbN4vvv_sincosf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S
index 643fc0ca3b..d758ceeb30 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S
@@ -1,5 +1,5 @@
/* Function sincosf vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
#include "svml_s_trig_data.h"
.text
-ENTRY (_ZGVbN4vvv_sincosf_sse4)
+ENTRY (_ZGVbN4vl4l4_sincosf_sse4)
/*
ALGORITHM DESCRIPTION:
@@ -42,7 +42,7 @@ ENTRY (_ZGVbN4vvv_sincosf_sse4)
b) Calculate 2 polynomials for sin and cos:
RS = X * ( A0 + X^2 * (A1 + x^2 * (A2 + x^2 * (A3))));
RC = B0 + X^2 * (B1 + x^2 * (B2 + x^2 * (B3 + x^2 * (B4))));
- c) Swap RS & RC if if first bit of obtained value after
+ c) Swap RS & RC if first bit of obtained value after
Right Shifting is set to 1. Using And, Andnot & Or operations.
3) Destination sign setting
a) Set shifted destination sign using XOR operation:
@@ -241,12 +241,12 @@ ENTRY (_ZGVbN4vvv_sincosf_sse4)
movzbl %r12b, %r15d
movss 132(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
movss %xmm0, 196(%rsp,%r15,8)
movss 132(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
movss %xmm0, 260(%rsp,%r15,8)
jmp .LBL_1_8
@@ -255,14 +255,92 @@ ENTRY (_ZGVbN4vvv_sincosf_sse4)
movzbl %r12b, %r15d
movss 128(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
movss %xmm0, 192(%rsp,%r15,8)
movss 128(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
movss %xmm0, 256(%rsp,%r15,8)
jmp .LBL_1_7
+END (_ZGVbN4vl4l4_sincosf_sse4)
+libmvec_hidden_def(_ZGVbN4vl4l4_sincosf_sse4)
+
+/* vvv version implemented with wrapper to vl4l4 variant. */
+ENTRY (_ZGVbN4vvv_sincosf_sse4)
+#ifndef __ILP32__
+ subq $104, %rsp
+ .cfi_def_cfa_offset 112
+ movdqu %xmm1, 32(%rsp)
+ lea (%rsp), %rdi
+ movdqu %xmm2, 48(%rdi)
+ lea 16(%rsp), %rsi
+ movdqu %xmm3, 48(%rsi)
+ movdqu %xmm4, 64(%rsi)
+ call HIDDEN_JUMPTARGET(_ZGVbN4vl4l4_sincosf_sse4)
+ movq 32(%rsp), %rdx
+ movq 40(%rsp), %rsi
+ movq 48(%rsp), %r8
+ movq 56(%rsp), %r10
+ movl (%rsp), %eax
+ movl 4(%rsp), %ecx
+ movl 8(%rsp), %edi
+ movl 12(%rsp), %r9d
+ movl %eax, (%rdx)
+ movl %ecx, (%rsi)
+ movq 64(%rsp), %rax
+ movq 72(%rsp), %rcx
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movq 80(%rsp), %rdi
+ movq 88(%rsp), %r9
+ movl 16(%rsp), %r11d
+ movl 20(%rsp), %edx
+ movl 24(%rsp), %esi
+ movl 28(%rsp), %r8d
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movl %esi, (%rdi)
+ movl %r8d, (%r9)
+ addq $104, %rsp
+ .cfi_def_cfa_offset 8
+ ret
+#else
+ subl $72, %esp
+ .cfi_def_cfa_offset 80
+ leal 48(%rsp), %esi
+ movaps %xmm1, 16(%esp)
+ leal 32(%rsp), %edi
+ movaps %xmm2, (%esp)
+ call HIDDEN_JUMPTARGET(_ZGVbN4vl4l4_sincosf_sse4)
+ movl 16(%esp), %eax
+ movss 32(%esp), %xmm0
+ movss %xmm0, (%eax)
+ movl 20(%esp), %eax
+ movss 36(%esp), %xmm0
+ movss %xmm0, (%eax)
+ movl 24(%esp), %eax
+ movss 40(%esp), %xmm0
+ movss %xmm0, (%eax)
+ movl 28(%esp), %eax
+ movss 44(%esp), %xmm0
+ movss %xmm0, (%eax)
+ movl (%esp), %eax
+ movss 48(%esp), %xmm0
+ movss %xmm0, (%eax)
+ movl 4(%esp), %eax
+ movss 52(%esp), %xmm0
+ movss %xmm0, (%eax)
+ movl 8(%esp), %eax
+ movss 56(%esp), %xmm0
+ movss %xmm0, (%eax)
+ movl 12(%esp), %eax
+ movss 60(%esp), %xmm0
+ movss %xmm0, (%eax)
+ addl $72, %esp
+ .cfi_def_cfa_offset 8
+ ret
+#endif
END (_ZGVbN4vvv_sincosf_sse4)
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core-sse.S
new file mode 100644
index 0000000000..348d1e6619
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized sincosf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN8vvv_sincosf _ZGVdN8vvv_sincosf_sse_wrapper
+#include "../svml_s_sincosf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core.S
deleted file mode 100644
index 0123b8024e..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized sincosf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN8vvv_sincosf)
- .type _ZGVdN8vvv_sincosf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVdN8vvv_sincosf_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN8vvv_sincosf_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN8vvv_sincosf)
-libmvec_hidden_def (_ZGVdN8vvv_sincosf)
-
-#define _ZGVdN8vvv_sincosf _ZGVdN8vvv_sincosf_sse_wrapper
-#include "../svml_s_sincosf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core.c
new file mode 100644
index 0000000000..74f3d3f041
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized sincosf, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN8vvv_sincosf
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN8vvv_sincosf, __GI__ZGVdN8vvv_sincosf,
+ __redirect__ZGVdN8vvv_sincosf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S
index f2a0ba7116..8b4b92dd94 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S
@@ -1,5 +1,5 @@
/* Function sincosf vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
#include "svml_s_trig_data.h"
.text
-ENTRY(_ZGVdN8vvv_sincosf_avx2)
+ENTRY (_ZGVdN8vl4l4_sincosf_avx2)
/*
ALGORITHM DESCRIPTION:
@@ -42,7 +42,7 @@ ENTRY(_ZGVdN8vvv_sincosf_avx2)
b) Calculate 2 polynomials for sin and cos:
RS = X * ( A0 + X^2 * (A1 + x^2 * (A2 + x^2 * (A3))));
RC = B0 + X^2 * (B1 + x^2 * (B2 + x^2 * (B3 + x^2 * (B4))));
- c) Swap RS & RC if if first bit of obtained value after
+ c) Swap RS & RC if first bit of obtained value after
Right Shifting is set to 1. Using And, Andnot & Or operations.
3) Destination sign setting
a) Set shifted destination sign using XOR operation:
@@ -213,12 +213,12 @@ ENTRY(_ZGVdN8vvv_sincosf_avx2)
vmovss 260(%rsp,%r15,8), %xmm0
vzeroupper
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 324(%rsp,%r15,8)
vmovss 260(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 388(%rsp,%r15,8)
jmp .LBL_1_8
@@ -228,14 +228,162 @@ ENTRY(_ZGVdN8vvv_sincosf_avx2)
vmovss 256(%rsp,%r15,8), %xmm0
vzeroupper
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 320(%rsp,%r15,8)
vmovss 256(%rsp,%r15,8), %xmm0
- call cosf@PLT
+ call JUMPTARGET(cosf)
vmovss %xmm0, 384(%rsp,%r15,8)
jmp .LBL_1_7
-END(_ZGVdN8vvv_sincosf_avx2)
+END (_ZGVdN8vl4l4_sincosf_avx2)
+libmvec_hidden_def(_ZGVdN8vl4l4_sincosf_avx2)
+
+/* vvv version implemented with wrapper to vl4l4 variant. */
+ENTRY (_ZGVdN8vvv_sincosf_avx2)
+#ifndef __ILP32__
+ pushq %rbp
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (%rbp, 0)
+ movq %rsp, %rbp
+ cfi_def_cfa_register (%rbp)
+ andq $-32, %rsp
+ subq $192, %rsp
+ vmovdqu %ymm1, 64(%rsp)
+ lea (%rsp), %rdi
+ vmovdqu %ymm2, 96(%rdi)
+ vmovdqu %ymm3, 128(%rdi)
+ vmovdqu %ymm4, 160(%rdi)
+ lea 32(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(_ZGVdN8vl4l4_sincosf_avx2)
+ movq 64(%rsp), %rdx
+ movq 72(%rsp), %rsi
+ movq 80(%rsp), %r8
+ movq 88(%rsp), %r10
+ movl (%rsp), %eax
+ movl 4(%rsp), %ecx
+ movl 8(%rsp), %edi
+ movl 12(%rsp), %r9d
+ movl %eax, (%rdx)
+ movl %ecx, (%rsi)
+ movq 96(%rsp), %rax
+ movq 104(%rsp), %rcx
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movq 112(%rsp), %rdi
+ movq 120(%rsp), %r9
+ movl 16(%rsp), %r11d
+ movl 20(%rsp), %edx
+ movl 24(%rsp), %esi
+ movl 28(%rsp), %r8d
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movq 128(%rsp), %r11
+ movq 136(%rsp), %rdx
+ movl %esi, (%rdi)
+ movl %r8d, (%r9)
+ movq 144(%rsp), %rsi
+ movq 152(%rsp), %r8
+ movl 32(%rsp), %r10d
+ movl 36(%rsp), %eax
+ movl 40(%rsp), %ecx
+ movl 44(%rsp), %edi
+ movl %r10d, (%r11)
+ movl %eax, (%rdx)
+ movq 160(%rsp), %r10
+ movq 168(%rsp), %rax
+ movl %ecx, (%rsi)
+ movl %edi, (%r8)
+ movq 176(%rsp), %rcx
+ movq 184(%rsp), %rdi
+ movl 48(%rsp), %r9d
+ movl 52(%rsp), %r11d
+ movl 56(%rsp), %edx
+ movl 60(%rsp), %esi
+ movl %r9d, (%r10)
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movl %esi, (%rdi)
+ movq %rbp, %rsp
+ cfi_def_cfa_register (%rsp)
+ popq %rbp
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (%rbp)
+ ret
+#else
+ leal 8(%rsp), %r10d
+ .cfi_def_cfa 10, 0
+ andl $-32, %esp
+ pushq -8(%r10d)
+ pushq %rbp
+ .cfi_escape 0x10,0x6,0x2,0x76,0
+ movl %esp, %ebp
+ pushq %r10
+ .cfi_escape 0xf,0x3,0x76,0x78,0x6
+ leal -48(%rbp), %esi
+ leal -80(%rbp), %edi
+ subl $136, %esp
+ vmovdqa %ymm1, -112(%ebp)
+ vmovdqa %ymm2, -144(%ebp)
+ call HIDDEN_JUMPTARGET(_ZGVdN8vl4l4_sincosf_avx2)
+ vmovdqa -112(%ebp), %xmm0
+ vmovq %xmm0, %rax
+ vmovss -80(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -76(%ebp), %xmm0
+ shrq $32, %rax
+ vmovss %xmm0, (%eax)
+ movq -104(%ebp), %rax
+ vmovss -72(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -68(%ebp), %xmm0
+ shrq $32, %rax
+ vmovss %xmm0, (%eax)
+ movq -96(%ebp), %rax
+ vmovss -64(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -60(%ebp), %xmm0
+ shrq $32, %rax
+ vmovss %xmm0, (%eax)
+ movq -88(%ebp), %rax
+ vmovss -56(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -52(%ebp), %xmm0
+ shrq $32, %rax
+ vmovss %xmm0, (%eax)
+ vmovdqa -144(%ebp), %xmm0
+ vmovq %xmm0, %rax
+ vmovss -48(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -44(%ebp), %xmm0
+ shrq $32, %rax
+ vmovss %xmm0, (%eax)
+ movq -136(%ebp), %rax
+ vmovss -40(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -36(%ebp), %xmm0
+ shrq $32, %rax
+ vmovss %xmm0, (%eax)
+ movq -128(%ebp), %rax
+ vmovss -32(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -28(%ebp), %xmm0
+ shrq $32, %rax
+ vmovss %xmm0, (%eax)
+ movq -120(%ebp), %rax
+ vmovss -24(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -20(%ebp), %xmm0
+ shrq $32, %rax
+ vmovss %xmm0, (%eax)
+ addl $136, %esp
+ popq %r10
+ .cfi_def_cfa 10, 0
+ popq %rbp
+ leal -8(%r10), %esp
+ .cfi_def_cfa 7, 8
+ ret
+#endif
+END (_ZGVdN8vvv_sincosf_avx2)
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core-avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core-avx2.S
new file mode 100644
index 0000000000..fa521b9dac
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core-avx2.S
@@ -0,0 +1,20 @@
+/* AVX2 version of vectorized sinf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVeN16v_sinf _ZGVeN16v_sinf_avx2_wrapper
+#include "../svml_s_sinf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core.S
deleted file mode 100644
index 2212cdd94d..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of vectorized sinf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVeN16v_sinf)
- .type _ZGVeN16v_sinf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVeN16v_sinf_skx(%rip), %rax
- HAS_ARCH_FEATURE (AVX512DQ_Usable)
- jnz 2f
- leaq _ZGVeN16v_sinf_knl(%rip), %rax
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jnz 2f
- leaq _ZGVeN16v_sinf_avx2_wrapper(%rip), %rax
-2: ret
-END (_ZGVeN16v_sinf)
-
-#define _ZGVeN16v_sinf _ZGVeN16v_sinf_avx2_wrapper
-#include "../svml_s_sinf16_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core.c
new file mode 100644
index 0000000000..97e5b58284
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized sinf, vector length is 16.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVeN16v_sinf
+#include "ifunc-mathvec-avx512.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVeN16v_sinf, __GI__ZGVeN16v_sinf,
+ __redirect__ZGVeN16v_sinf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core_avx512.S
index 61d8d3793a..141f747eb5 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core_avx512.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core_avx512.S
@@ -1,5 +1,5 @@
/* Function sinf vectorized with AVX-512. KNL and SKX versions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
.text
ENTRY(_ZGVeN16v_sinf_knl)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN8v_sinf
#else
/*
@@ -229,21 +229,21 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_sinf
cfi_restore_state
movzbl %r12b, %r15d
vmovss 1156(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 1220(%rsp,%r15,8)
jmp .LBL_1_8
.LBL_1_12:
movzbl %r12b, %r15d
vmovss 1152(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 1216(%rsp,%r15,8)
jmp .LBL_1_7
#endif
END(_ZGVeN16v_sinf_knl)
ENTRY (_ZGVeN16v_sinf_skx)
-#ifndef HAVE_AVX512_ASM_SUPPORT
+#ifndef HAVE_AVX512DQ_ASM_SUPPORT
WRAPPER_IMPL_AVX512 _ZGVdN8v_sinf
#else
/*
@@ -455,7 +455,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_sinf
vzeroupper
vmovss 1156(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 1220(%rsp,%r15,8)
jmp .LBL_2_8
@@ -466,7 +466,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_sinf
vzeroupper
vmovss 1152(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 1216(%rsp,%r15,8)
jmp .LBL_2_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core-sse2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core-sse2.S
new file mode 100644
index 0000000000..1d2e65c39d
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core-sse2.S
@@ -0,0 +1,20 @@
+/* SSE2 version of vectorized sinf.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVbN4v_sinf _ZGVbN4v_sinf_sse2
+#include "../svml_s_sinf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core.S
deleted file mode 100644
index b31554730d..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized sinf.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVbN4v_sinf)
- .type _ZGVbN4v_sinf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq _ZGVbN4v_sinf_sse4(%rip), %rax
- HAS_CPU_FEATURE (SSE4_1)
- jz 2f
- ret
-2: leaq _ZGVbN4v_sinf_sse2(%rip), %rax
- ret
-END (_ZGVbN4v_sinf)
-libmvec_hidden_def (_ZGVbN4v_sinf)
-
-#define _ZGVbN4v_sinf _ZGVbN4v_sinf_sse2
-#include "../svml_s_sinf4_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core.c
new file mode 100644
index 0000000000..93b8bfebbf
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized sinf, vector length is 4.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVbN4v_sinf
+#include "ifunc-mathvec-sse4_1.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVbN4v_sinf, __GI__ZGVbN4v_sinf,
+ __redirect__ZGVbN4v_sinf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core_sse4.S
index 5268ab1f09..39a4c92235 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core_sse4.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf4_core_sse4.S
@@ -1,5 +1,5 @@
/* Function sinf vectorized with SSE4.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -207,7 +207,7 @@ ENTRY(_ZGVbN4v_sinf_sse4)
movzbl %r12b, %r15d
movss 196(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
movss %xmm0, 260(%rsp,%r15,8)
jmp .LBL_1_8
@@ -216,7 +216,7 @@ ENTRY(_ZGVbN4v_sinf_sse4)
movzbl %r12b, %r15d
movss 192(%rsp,%r15,8), %xmm0
- call sinf@PLT
+ call JUMPTARGET(sinf)
movss %xmm0, 256(%rsp,%r15,8)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core-sse.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core-sse.S
new file mode 100644
index 0000000000..f2af3a0b4b
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core-sse.S
@@ -0,0 +1,20 @@
+/* SSE version of vectorized sinf, vector length is 8.
+ Copyright (C) 2014-2018 Free Software 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 _ZGVdN8v_sinf _ZGVdN8v_sinf_sse_wrapper
+#include "../svml_s_sinf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core.S
deleted file mode 100644
index 47fe0a4adc..0000000000
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Multiple versions of vectorized sinf, vector length is 8.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
- .text
-ENTRY (_ZGVdN8v_sinf)
- .type _ZGVdN8v_sinf, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
-1: leaq _ZGVdN8v_sinf_avx2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- ret
-2: leaq _ZGVdN8v_sinf_sse_wrapper(%rip), %rax
- ret
-END (_ZGVdN8v_sinf)
-libmvec_hidden_def (_ZGVdN8v_sinf)
-
-#define _ZGVdN8v_sinf _ZGVdN8v_sinf_sse_wrapper
-#include "../svml_s_sinf8_core.S"
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core.c b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core.c
new file mode 100644
index 0000000000..cf13b6647c
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core.c
@@ -0,0 +1,28 @@
+/* Multiple versions of vectorized sinf, vector length is 8.
+ Copyright (C) 2017-2018 Free Software 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 SYMBOL_NAME _ZGVdN8v_sinf
+#include "ifunc-mathvec-avx2.h"
+
+libc_ifunc_redirected (REDIRECT_NAME, SYMBOL_NAME, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (_ZGVdN8v_sinf, __GI__ZGVdN8v_sinf,
+ __redirect__ZGVdN8v_sinf)
+ __attribute__ ((visibility ("hidden")));
+#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core_avx2.S
index 9fdaadb2e8..5f7a95e9ad 100644
--- a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core_avx2.S
+++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf8_core_avx2.S
@@ -1,5 +1,5 @@
/* Function sinf vectorized with AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -201,7 +201,7 @@ ENTRY(_ZGVdN8v_sinf_avx2)
vmovss 324(%rsp,%r15,8), %xmm0
vzeroupper
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 388(%rsp,%r15,8)
jmp .LBL_1_8
@@ -211,7 +211,7 @@ ENTRY(_ZGVdN8v_sinf_avx2)
vmovss 320(%rsp,%r15,8), %xmm0
vzeroupper
- call sinf@PLT
+ call JUMPTARGET(sinf)
vmovss %xmm0, 384(%rsp,%r15,8)
jmp .LBL_1_7
diff --git a/sysdeps/x86_64/fpu/printf_fphex.c b/sysdeps/x86_64/fpu/printf_fphex.c
index 0fbaa3748e..62efed10da 100644
--- a/sysdeps/x86_64/fpu/printf_fphex.c
+++ b/sysdeps/x86_64/fpu/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/s_ceill.S b/sysdeps/x86_64/fpu/s_ceill.S
index 910c371d58..8f2bd351f6 100644
--- a/sysdeps/x86_64/fpu/s_ceill.S
+++ b/sysdeps/x86_64/fpu/s_ceill.S
@@ -5,27 +5,33 @@
* Public domain.
*/
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
ENTRY(__ceill)
fldt 8(%rsp)
- fstcw -4(%rsp) /* store fpu control word */
+ fnstenv -28(%rsp) /* store fpu environment */
/* We use here %edx although only the low 1 bits are defined.
But none of the operations should care and they are faster
than the 16 bit operations. */
movl $0x0800,%edx /* round towards +oo */
- orl -4(%rsp),%edx
+ orl -28(%rsp),%edx
andl $0xfbff,%edx
- movl %edx,-8(%rsp)
- fldcw -8(%rsp) /* load modified control word */
+ movl %edx,-32(%rsp)
+ fldcw -32(%rsp) /* load modified control word */
frndint /* round */
- fldcw -4(%rsp) /* restore original control word */
+ /* Preserve "invalid" exceptions from sNaN input. */
+ fnstsw
+ andl $0x1, %eax
+ orl %eax, -24(%rsp)
+
+ fldenv -28(%rsp) /* restore original environment */
ret
END (__ceill)
-weak_alias (__ceill, ceill)
+libm_alias_ldouble (__ceil, ceil)
diff --git a/sysdeps/x86_64/fpu/s_copysign.S b/sysdeps/x86_64/fpu/s_copysign.S
index 18f568f46f..e2921ce770 100644
--- a/sysdeps/x86_64/fpu/s_copysign.S
+++ b/sysdeps/x86_64/fpu/s_copysign.S
@@ -1,5 +1,5 @@
/* copy sign, double version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
+#include <libm-alias-double.h>
.section .rodata.cst16,"aM",@progbits,16
@@ -47,4 +48,4 @@ ENTRY(__copysign)
ret
END (__copysign)
-weak_alias (__copysign, copysign)
+libm_alias_double (__copysign, copysign)
diff --git a/sysdeps/x86_64/fpu/s_copysignf.S b/sysdeps/x86_64/fpu/s_copysignf.S
index 00a1fabaee..4093e781fe 100644
--- a/sysdeps/x86_64/fpu/s_copysignf.S
+++ b/sysdeps/x86_64/fpu/s_copysignf.S
@@ -1,5 +1,5 @@
/* copy sign, double version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
+#include <libm-alias-float.h>
.section .rodata
@@ -42,4 +43,4 @@ ENTRY(__copysignf)
retq
END (__copysignf)
-weak_alias (__copysignf, copysignf)
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/x86_64/fpu/s_copysignl.S b/sysdeps/x86_64/fpu/s_copysignl.S
index 2ffd612d65..8616205d38 100644
--- a/sysdeps/x86_64/fpu/s_copysignl.S
+++ b/sysdeps/x86_64/fpu/s_copysignl.S
@@ -5,6 +5,7 @@
* Public domain.
*/
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
RCSID("$NetBSD: $")
@@ -19,4 +20,4 @@ ENTRY(__copysignl)
fldt 8(%rsp)
ret
END (__copysignl)
-weak_alias (__copysignl, copysignl)
+libm_alias_ldouble (__copysign, copysign)
diff --git a/sysdeps/x86_64/fpu/s_cosf.S b/sysdeps/x86_64/fpu/s_cosf.S
deleted file mode 100644
index 31968e498f..0000000000
--- a/sysdeps/x86_64/fpu/s_cosf.S
+++ /dev/null
@@ -1,533 +0,0 @@
-/* Optimized cosf function.
- 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/>. */
-
-#include <sysdep.h>
-#define __need_Emath
-#include <bits/errno.h>
-
-/* Short algorithm description:
- *
- * 1) if |x| == 0: return 1.0-|x|.
- * 2) if |x| < 2^-27: return 1.0-|x|.
- * 3) if |x| < 2^-5 : return 1.0+x^2*DP_COS2_0+x^5*DP_COS2_1.
- * 4) if |x| < Pi/4: return 1.0+x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))).
- * 5) if |x| < 9*Pi/4:
- * 5.1) Range reduction: k=trunc(|x|/(Pi/4)), j=(k+1)&0x0e, n=k+3,
- * t=|x|-j*Pi/4.
- * 5.2) Reconstruction:
- * s = (-1.0)^((n>>2)&1)
- * if(n&2 != 0) {
- * using cos(t) polynomial for |t|<Pi/4, result is
- * s * (1.0+t^2*(C0+t^2*(C1+t^2*(C2+t^2*(C3+t^2*C4))))).
- * } else {
- * using sin(t) polynomial for |t|<Pi/4, result is
- * s * t * (1.0+t^2*(S0+t^2*(S1+t^2*(S2+t^2*(S3+t^2*S4))))).
- * }
- * 6) if |x| < 2^23, large args:
- * 6.1) Range reduction: k=trunc(|x|/(Pi/4)), j=(k+1)&0xfffffffe, n=k+3,
- * t=|x|-j*Pi/4.
- * 6.2) Reconstruction same as (5.2).
- * 7) if |x| >= 2^23, very large args:
- * 7.1) Range reduction: k=trunc(|x|/(Pi/4)), j=(k+1)&0xfffffffe, n=k+3,
- * t=|x|-j*Pi/4.
- * 7.2) Reconstruction same as (5.2).
- * 8) if x is Inf, return x-x, and set errno=EDOM.
- * 9) if x is NaN, return x-x.
- *
- * Special cases:
- * cos(+-0) = 1 not raising inexact,
- * cos(subnormal) raises inexact,
- * cos(min_normalized) raises inexact,
- * cos(normalized) raises inexact,
- * cos(Inf) = NaN, raises invalid, sets errno to EDOM,
- * cos(NaN) = NaN.
- */
-
- .text
-ENTRY(__cosf)
- /* Input: single precision x in %xmm0 */
-
- movd %xmm0, %eax /* Bits of x */
- movaps %xmm0, %xmm7 /* Copy of x */
- cvtss2sd %xmm0, %xmm0 /* DP x */
- movss L(SP_ABS_MASK)(%rip), %xmm3
- andl $0x7fffffff, %eax /* |x| */
-
- cmpl $0x3f490fdb, %eax /* |x|<Pi/4? */
- jb L(arg_less_pio4)
-
- /* Here if |x|>=Pi/4 */
- andps %xmm7, %xmm3 /* SP |x| */
- andpd L(DP_ABS_MASK)(%rip), %xmm0 /* DP |x| */
- movss L(SP_INVPIO4)(%rip), %xmm2 /* SP 1/(Pi/4) */
-
- cmpl $0x40e231d6, %eax /* |x|<9*Pi/4? */
- jae L(large_args)
-
- /* Here if Pi/4<=|x|<9*Pi/4 */
- mulss %xmm3, %xmm2 /* SP |x|/(Pi/4) */
- cvttss2si %xmm2, %eax /* k, number of Pi/4 in x */
- lea L(PIO4J)(%rip), %rsi
- addl $1, %eax /* k+1 */
- movl $0x0e, %edx
- andl %eax, %edx /* j = (k+1)&0x0e */
- addl $2, %eax /* n */
- subsd (%rsi,%rdx,8), %xmm0 /* t = |x| - j * Pi/4 */
-
-L(reconstruction):
- /* Input: %eax=n, %xmm0=t */
- testl $2, %eax /* n&2 != 0? */
- jz L(sin_poly)
-
-/*L(cos_poly):*/
- /* Here if cos(x) calculated using cos(t) polynomial for |t|<Pi/4:
- * y = t*t; z = y*y;
- * s = sign(x) * (-1.0)^((n>>2)&1)
- * result = s * (1.0+t^2*(C0+t^2*(C1+t^2*(C2+t^2*(C3+t^2*C4)))))
- */
- shrl $2, %eax /* n>>2 */
- mulsd %xmm0, %xmm0 /* y=t^2 */
- andl $1, %eax /* (n>>2)&1 */
- movaps %xmm0, %xmm1 /* y */
- mulsd %xmm0, %xmm0 /* z=t^4 */
-
- movsd L(DP_C4)(%rip), %xmm4 /* C4 */
- mulsd %xmm0, %xmm4 /* z*C4 */
- movsd L(DP_C3)(%rip), %xmm3 /* C3 */
- mulsd %xmm0, %xmm3 /* z*C3 */
- lea L(DP_ONES)(%rip), %rsi
- addsd L(DP_C2)(%rip), %xmm4 /* C2+z*C4 */
- mulsd %xmm0, %xmm4 /* z*(C2+z*C4) */
- addsd L(DP_C1)(%rip), %xmm3 /* C1+z*C3 */
- mulsd %xmm0, %xmm3 /* z*(C1+z*C3) */
- addsd L(DP_C0)(%rip), %xmm4 /* C0+z*(C2+z*C4) */
- mulsd %xmm1, %xmm4 /* y*(C0+z*(C2+z*C4)) */
-
- addsd %xmm4, %xmm3 /* y*(C0+y*(C1+y*(C2+y*(C3+y*C4)))) */
- /* 1.0+y*(C0+y*(C1+y*(C2+y*(C3+y*C4)))) */
- addsd L(DP_ONES)(%rip), %xmm3
-
- mulsd (%rsi,%rax,8), %xmm3 /* DP result */
- cvtsd2ss %xmm3, %xmm0 /* SP result */
- ret
-
- .p2align 4
-L(sin_poly):
- /* Here if cos(x) calculated using sin(t) polynomial for |t|<Pi/4:
- * y = t*t; z = y*y;
- * s = sign(x) * (-1.0)^((n>>2)&1)
- * result = s * t * (1.0+t^2*(S0+t^2*(S1+t^2*(S2+t^2*(S3+t^2*S4)))))
- */
-
- movaps %xmm0, %xmm4 /* t */
- shrl $2, %eax /* n>>2 */
- mulsd %xmm0, %xmm0 /* y=t^2 */
- andl $1, %eax /* (n>>2)&1 */
- movaps %xmm0, %xmm1 /* y */
- mulsd %xmm0, %xmm0 /* z=t^4 */
-
- movsd L(DP_S4)(%rip), %xmm2 /* S4 */
- mulsd %xmm0, %xmm2 /* z*S4 */
- movsd L(DP_S3)(%rip), %xmm3 /* S3 */
- mulsd %xmm0, %xmm3 /* z*S3 */
- lea L(DP_ONES)(%rip), %rsi
- addsd L(DP_S2)(%rip), %xmm2 /* S2+z*S4 */
- mulsd %xmm0, %xmm2 /* z*(S2+z*S4) */
- addsd L(DP_S1)(%rip), %xmm3 /* S1+z*S3 */
- mulsd %xmm0, %xmm3 /* z*(S1+z*S3) */
- addsd L(DP_S0)(%rip), %xmm2 /* S0+z*(S2+z*S4) */
- mulsd %xmm1, %xmm2 /* y*(S0+z*(S2+z*S4)) */
- /* t*s, where s = sign(x) * (-1.0)^((n>>2)&1) */
- mulsd (%rsi,%rax,8), %xmm4
- /* y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
- addsd %xmm2, %xmm3
- /* t*s*y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
- mulsd %xmm4, %xmm3
- /* t*s*(1.0+y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
- addsd %xmm4, %xmm3
- cvtsd2ss %xmm3, %xmm0 /* SP result */
- ret
-
- .p2align 4
-L(large_args):
- /* Here if |x|>=9*Pi/4 */
- cmpl $0x7f800000, %eax /* x is Inf or NaN? */
- jae L(arg_inf_or_nan)
-
- /* Here if finite |x|>=9*Pi/4 */
- cmpl $0x4b000000, %eax /* |x|<2^23? */
- jae L(very_large_args)
-
- /* Here if 9*Pi/4<=|x|<2^23 */
- movsd L(DP_INVPIO4)(%rip), %xmm1 /* 1/(Pi/4) */
- mulsd %xmm0, %xmm1 /* |x|/(Pi/4) */
- cvttsd2si %xmm1, %eax /* k=trunc(|x|/(Pi/4)) */
- addl $1, %eax /* k+1 */
- movl %eax, %edx
- andl $0xfffffffe, %edx /* j=(k+1)&0xfffffffe */
- cvtsi2sdl %edx, %xmm4 /* DP j */
- movsd L(DP_PIO4HI)(%rip), %xmm2 /* -PIO4HI = high part of -Pi/4 */
- mulsd %xmm4, %xmm2 /* -j*PIO4HI */
- movsd L(DP_PIO4LO)(%rip), %xmm3 /* -PIO4LO = low part of -Pi/4 */
- addsd %xmm2, %xmm0 /* |x| - j*PIO4HI */
- addl $2, %eax /* n */
- mulsd %xmm3, %xmm4 /* j*PIO4LO */
- addsd %xmm4, %xmm0 /* t = |x| - j*PIO4HI - j*PIO4LO */
- jmp L(reconstruction)
-
- .p2align 4
-L(very_large_args):
- /* Here if finite |x|>=2^23 */
-
- /* bitpos = (ix>>23) - BIAS_32 + 59; */
- shrl $23, %eax /* eb = biased exponent of x */
- /* bitpos = eb - 0x7f + 59, where 0x7f is exponent bias */
- subl $68, %eax
- movl $28, %ecx /* %cl=28 */
- movl %eax, %edx /* bitpos copy */
-
- /* j = bitpos/28; */
- div %cl /* j in register %al=%ax/%cl */
- movapd %xmm0, %xmm3 /* |x| */
- /* clear unneeded remainder from %ah */
- andl $0xff, %eax
-
- imull $28, %eax, %ecx /* j*28 */
- lea L(_FPI)(%rip), %rsi
- movsd L(DP_HI_MASK)(%rip), %xmm4 /* DP_HI_MASK */
- movapd %xmm0, %xmm5 /* |x| */
- mulsd -16(%rsi,%rax,8), %xmm3 /* tmp3 = FPI[j-2]*|x| */
- movapd %xmm0, %xmm1 /* |x| */
- mulsd -8(%rsi,%rax,8), %xmm5 /* tmp2 = FPI[j-1]*|x| */
- mulsd (%rsi,%rax,8), %xmm0 /* tmp0 = FPI[j]*|x| */
- addl $19, %ecx /* j*28+19 */
- mulsd 8(%rsi,%rax,8), %xmm1 /* tmp1 = FPI[j+1]*|x| */
- cmpl %ecx, %edx /* bitpos>=j*28+19? */
- jl L(very_large_skip1)
-
- /* Here if bitpos>=j*28+19 */
- andpd %xmm3, %xmm4 /* HI(tmp3) */
- subsd %xmm4, %xmm3 /* tmp3 = tmp3 - HI(tmp3) */
-L(very_large_skip1):
-
- movsd L(DP_2POW52)(%rip), %xmm6
- movapd %xmm5, %xmm2 /* tmp2 copy */
- addsd %xmm3, %xmm5 /* tmp5 = tmp3 + tmp2 */
- movl $1, %edx
- addsd %xmm5, %xmm6 /* tmp6 = tmp5 + 2^52 */
- movsd 8+L(DP_2POW52)(%rip), %xmm4
- movd %xmm6, %eax /* k = I64_LO(tmp6); */
- addsd %xmm6, %xmm4 /* tmp4 = tmp6 - 2^52 */
- comisd %xmm5, %xmm4 /* tmp4 > tmp5? */
- jbe L(very_large_skip2)
-
- /* Here if tmp4 > tmp5 */
- subl $1, %eax /* k-- */
- addsd 8+L(DP_ONES)(%rip), %xmm4 /* tmp4 -= 1.0 */
-L(very_large_skip2):
-
- andl %eax, %edx /* k&1 */
- lea L(DP_ZERONE)(%rip), %rsi
- subsd %xmm4, %xmm3 /* tmp3 -= tmp4 */
- addsd (%rsi,%rdx,8), %xmm3 /* t = DP_ZERONE[k&1] + tmp3 */
- addsd %xmm2, %xmm3 /* t += tmp2 */
- addsd %xmm3, %xmm0 /* t += tmp0 */
- addl $3, %eax /* n=k+3 */
- addsd %xmm1, %xmm0 /* t += tmp1 */
- mulsd L(DP_PIO4)(%rip), %xmm0 /* t *= PI04 */
-
- jmp L(reconstruction) /* end of very_large_args peth */
-
- .p2align 4
-L(arg_less_pio4):
- /* Here if |x|<Pi/4 */
- cmpl $0x3d000000, %eax /* |x|<2^-5? */
- jl L(arg_less_2pn5)
-
- /* Here if 2^-5<=|x|<Pi/4 */
- mulsd %xmm0, %xmm0 /* y=x^2 */
- movaps %xmm0, %xmm1 /* y */
- mulsd %xmm0, %xmm0 /* z=x^4 */
- movsd L(DP_C4)(%rip), %xmm3 /* C4 */
- mulsd %xmm0, %xmm3 /* z*C4 */
- movsd L(DP_C3)(%rip), %xmm5 /* C3 */
- mulsd %xmm0, %xmm5 /* z*C3 */
- addsd L(DP_C2)(%rip), %xmm3 /* C2+z*C4 */
- mulsd %xmm0, %xmm3 /* z*(C2+z*C4) */
- addsd L(DP_C1)(%rip), %xmm5 /* C1+z*C3 */
- mulsd %xmm0, %xmm5 /* z*(C1+z*C3) */
- addsd L(DP_C0)(%rip), %xmm3 /* C0+z*(C2+z*C4) */
- mulsd %xmm1, %xmm3 /* y*(C0+z*(C2+z*C4)) */
- /* y*(C0+y*(C1+y*(C2+y*(C3+y*C4)))) */
- addsd %xmm5, %xmm3
- /* 1.0 + y*(C0+y*(C1+y*(C2+y*(C3+y*C4)))) */
- addsd L(DP_ONES)(%rip), %xmm3
- cvtsd2ss %xmm3, %xmm0 /* SP result */
- ret
-
- .p2align 4
-L(arg_less_2pn5):
- /* Here if |x|<2^-5 */
- cmpl $0x32000000, %eax /* |x|<2^-27? */
- jl L(arg_less_2pn27)
-
- /* Here if 2^-27<=|x|<2^-5 */
- mulsd %xmm0, %xmm0 /* DP x^2 */
- movsd L(DP_COS2_1)(%rip), %xmm3 /* DP DP_COS2_1 */
- mulsd %xmm0, %xmm3 /* DP x^2*DP_COS2_1 */
- addsd L(DP_COS2_0)(%rip), %xmm3 /* DP DP_COS2_0+x^2*DP_COS2_1 */
- mulsd %xmm0, %xmm3 /* DP x^2*DP_COS2_0+x^4*DP_COS2_1 */
- /* DP 1.0+x^2*DP_COS2_0+x^4*DP_COS2_1 */
- addsd L(DP_ONES)(%rip), %xmm3
- cvtsd2ss %xmm3, %xmm0 /* SP result */
- ret
-
- .p2align 4
-L(arg_less_2pn27):
- /* Here if |x|<2^-27 */
- andps L(SP_ABS_MASK)(%rip),%xmm7 /* |x| */
- movss L(SP_ONE)(%rip), %xmm0 /* 1.0 */
- subss %xmm7, %xmm0 /* result is 1.0-|x| */
- ret
-
- .p2align 4
-L(arg_inf_or_nan):
- /* Here if |x| is Inf or NAN */
- jne L(skip_errno_setting) /* in case of x is NaN */
-
- /* Align stack to 16 bytes. */
- subq $8, %rsp
- cfi_adjust_cfa_offset (8)
- /* Here if x is Inf. Set errno to EDOM. */
- call JUMPTARGET(__errno_location)
- addq $8, %rsp
- cfi_adjust_cfa_offset (-8)
-
- movl $EDOM, (%rax)
-
- .p2align 4
-L(skip_errno_setting):
- /* Here if |x| is Inf or NAN. Continued. */
- movaps %xmm7, %xmm0 /* load x */
- subss %xmm0, %xmm0 /* Result is NaN */
- ret
-END(__cosf)
-
- .section .rodata, "a"
- .p2align 3
-L(PIO4J): /* Table of j*Pi/4, for j=0,1,..,10 */
- .long 0x00000000,0x00000000
- .long 0x54442d18,0x3fe921fb
- .long 0x54442d18,0x3ff921fb
- .long 0x7f3321d2,0x4002d97c
- .long 0x54442d18,0x400921fb
- .long 0x2955385e,0x400f6a7a
- .long 0x7f3321d2,0x4012d97c
- .long 0xe9bba775,0x4015fdbb
- .long 0x54442d18,0x401921fb
- .long 0xbeccb2bb,0x401c463a
- .long 0x2955385e,0x401f6a7a
- .type L(PIO4J), @object
- ASM_SIZE_DIRECTIVE(L(PIO4J))
-
- .p2align 3
-L(_FPI): /* 4/Pi broken into sum of positive DP values */
- .long 0x00000000,0x00000000
- .long 0x6c000000,0x3ff45f30
- .long 0x2a000000,0x3e3c9c88
- .long 0xa8000000,0x3c54fe13
- .long 0xd0000000,0x3aaf47d4
- .long 0x6c000000,0x38fbb81b
- .long 0xe0000000,0x3714acc9
- .long 0x7c000000,0x3560e410
- .long 0x56000000,0x33bca2c7
- .long 0xac000000,0x31fbd778
- .long 0xe0000000,0x300b7246
- .long 0xe8000000,0x2e5d2126
- .long 0x48000000,0x2c970032
- .long 0xe8000000,0x2ad77504
- .long 0xe0000000,0x290921cf
- .long 0xb0000000,0x274deb1c
- .long 0xe0000000,0x25829a73
- .long 0xbe000000,0x23fd1046
- .long 0x10000000,0x2224baed
- .long 0x8e000000,0x20709d33
- .long 0x80000000,0x1e535a2f
- .long 0x64000000,0x1cef904e
- .long 0x30000000,0x1b0d6398
- .long 0x24000000,0x1964ce7d
- .long 0x16000000,0x17b908bf
- .type L(_FPI), @object
- ASM_SIZE_DIRECTIVE(L(_FPI))
-
-/* Coefficients of polynomial
- for cos(x)~=1.0+x^2*DP_COS2_0+x^4*DP_COS2_1, |x|<2^-5. */
- .p2align 3
-L(DP_COS2_0):
- .long 0xff5cc6fd,0xbfdfffff
- .type L(DP_COS2_0), @object
- ASM_SIZE_DIRECTIVE(L(DP_COS2_0))
-
- .p2align 3
-L(DP_COS2_1):
- .long 0xb178dac5,0x3fa55514
- .type L(DP_COS2_1), @object
- ASM_SIZE_DIRECTIVE(L(DP_COS2_1))
-
- .p2align 3
-L(DP_ZERONE):
- .long 0x00000000,0x00000000 /* 0.0 */
- .long 0x00000000,0xbff00000 /* 1.0 */
- .type L(DP_ZERONE), @object
- ASM_SIZE_DIRECTIVE(L(DP_ZERONE))
-
- .p2align 3
-L(DP_ONES):
- .long 0x00000000,0x3ff00000 /* +1.0 */
- .long 0x00000000,0xbff00000 /* -1.0 */
- .type L(DP_ONES), @object
- ASM_SIZE_DIRECTIVE(L(DP_ONES))
-
-/* Coefficients of polynomial
- for sin(t)~=t+t^3*(S0+t^2*(S1+t^2*(S2+t^2*(S3+t^2*S4)))), |t|<Pi/4. */
- .p2align 3
-L(DP_S3):
- .long 0x64e6b5b4,0x3ec71d72
- .type L(DP_S3), @object
- ASM_SIZE_DIRECTIVE(L(DP_S3))
-
- .p2align 3
-L(DP_S1):
- .long 0x10c2688b,0x3f811111
- .type L(DP_S1), @object
- ASM_SIZE_DIRECTIVE(L(DP_S1))
-
- .p2align 3
-L(DP_S4):
- .long 0x1674b58a,0xbe5a947e
- .type L(DP_S4), @object
- ASM_SIZE_DIRECTIVE(L(DP_S4))
-
- .p2align 3
-L(DP_S2):
- .long 0x8b4bd1f9,0xbf2a019f
- .type L(DP_S2),@object
- ASM_SIZE_DIRECTIVE(L(DP_S2))
-
- .p2align 3
-L(DP_S0):
- .long 0x55551cd9,0xbfc55555
- .type L(DP_S0), @object
- ASM_SIZE_DIRECTIVE(L(DP_S0))
-
-/* Coefficients of polynomial
- for cos(t)~=1.0+t^2*(C0+t^2*(C1+t^2*(C2+t^2*(C3+t^2*C4)))), |t|<Pi/4. */
- .p2align 3
-L(DP_C3):
- .long 0x9ac43cc0,0x3efa00eb
- .type L(DP_C3), @object
- ASM_SIZE_DIRECTIVE(L(DP_C3))
-
- .p2align 3
-L(DP_C1):
- .long 0x545c50c7,0x3fa55555
- .type L(DP_C1), @object
- ASM_SIZE_DIRECTIVE(L(DP_C1))
-
- .p2align 3
-L(DP_C4):
- .long 0xdd8844d7,0xbe923c97
- .type L(DP_C4), @object
- ASM_SIZE_DIRECTIVE(L(DP_C4))
-
- .p2align 3
-L(DP_C2):
- .long 0x348b6874,0xbf56c16b
- .type L(DP_C2), @object
- ASM_SIZE_DIRECTIVE(L(DP_C2))
-
- .p2align 3
-L(DP_C0):
- .long 0xfffe98ae,0xbfdfffff
- .type L(DP_C0), @object
- ASM_SIZE_DIRECTIVE(L(DP_C0))
-
- .p2align 3
-L(DP_PIO4):
- .long 0x54442d18,0x3fe921fb /* Pi/4 */
- .type L(DP_PIO4), @object
- ASM_SIZE_DIRECTIVE(L(DP_PIO4))
-
- .p2align 3
-L(DP_2POW52):
- .long 0x00000000,0x43300000 /* +2^52 */
- .long 0x00000000,0xc3300000 /* -2^52 */
- .type L(DP_2POW52), @object
- ASM_SIZE_DIRECTIVE(L(DP_2POW52))
-
- .p2align 3
-L(DP_INVPIO4):
- .long 0x6dc9c883,0x3ff45f30 /* 4/Pi */
- .type L(DP_INVPIO4), @object
- ASM_SIZE_DIRECTIVE(L(DP_INVPIO4))
-
- .p2align 3
-L(DP_PIO4HI):
- .long 0x54000000,0xbfe921fb /* High part of Pi/4 */
- .type L(DP_PIO4HI), @object
- ASM_SIZE_DIRECTIVE(L(DP_PIO4HI))
-
- .p2align 3
-L(DP_PIO4LO):
- .long 0x11A62633,0xbe010b46 /* Low part of Pi/4 */
- .type L(DP_PIO4LO), @object
- ASM_SIZE_DIRECTIVE(L(DP_PIO4LO))
-
- .p2align 2
-L(SP_INVPIO4):
- .long 0x3fa2f983 /* 4/Pi */
- .type L(SP_INVPIO4), @object
- ASM_SIZE_DIRECTIVE(L(SP_INVPIO4))
-
- .p2align 4
-L(DP_ABS_MASK): /* Mask for getting DP absolute value */
- .long 0xffffffff,0x7fffffff
- .long 0xffffffff,0x7fffffff
- .type L(DP_ABS_MASK), @object
- ASM_SIZE_DIRECTIVE(L(DP_ABS_MASK))
-
- .p2align 3
-L(DP_HI_MASK): /* Mask for getting high 21 bits of DP value */
- .long 0x00000000,0xffffffff
- .type L(DP_HI_MASK), @object
- ASM_SIZE_DIRECTIVE(L(DP_HI_MASK))
-
- .p2align 4
-L(SP_ABS_MASK): /* Mask for getting SP absolute value */
- .long 0x7fffffff,0x7fffffff
- .long 0x7fffffff,0x7fffffff
- .type L(SP_ABS_MASK), @object
- ASM_SIZE_DIRECTIVE(L(SP_ABS_MASK))
-
- .p2align 2
-L(SP_ONE):
- .long 0x3f800000 /* 1.0 */
- .type L(SP_ONE), @object
- ASM_SIZE_DIRECTIVE(L(SP_ONE))
-
-weak_alias(__cosf, cosf)
diff --git a/sysdeps/x86_64/fpu/s_fabs.c b/sysdeps/x86_64/fpu/s_fabs.c
index d3a313fdf5..d1e17878d4 100644
--- a/sysdeps/x86_64/fpu/s_fabs.c
+++ b/sysdeps/x86_64/fpu/s_fabs.c
@@ -1,5 +1,5 @@
/* Absolute value of floating point number.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software 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,10 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-double.h>
double
__fabs (double x)
{
return __builtin_fabs (x);
}
-weak_alias (__fabs, fabs)
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/x86_64/fpu/s_fabsf.c b/sysdeps/x86_64/fpu/s_fabsf.c
index e6dcda9433..2f39228560 100644
--- a/sysdeps/x86_64/fpu/s_fabsf.c
+++ b/sysdeps/x86_64/fpu/s_fabsf.c
@@ -1,5 +1,5 @@
/* Absolute value of floating point number.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software 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,10 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <libm-alias-float.h>
float
__fabsf (float x)
{
return __builtin_fabsf (x);
}
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/x86_64/fpu/s_fabsl.S b/sysdeps/x86_64/fpu/s_fabsl.S
index 6881ff11c7..7f03ecdccb 100644
--- a/sysdeps/x86_64/fpu/s_fabsl.S
+++ b/sysdeps/x86_64/fpu/s_fabsl.S
@@ -1,5 +1,5 @@
/* Absolute value of floating point number.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-ldouble.h>
.text
ENTRY(__fabsl)
@@ -24,4 +25,4 @@ ENTRY(__fabsl)
fabs
ret
END(__fabsl)
-weak_alias (__fabsl, fabsl)
+libm_alias_ldouble (__fabs, fabs)
diff --git a/sysdeps/x86_64/fpu/s_fdiml.S b/sysdeps/x86_64/fpu/s_fdiml.S
deleted file mode 100644
index f9f1e20259..0000000000
--- a/sysdeps/x86_64/fpu/s_fdiml.S
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Compute positive difference.
- 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 <sysdep.h>
-
- .text
-ENTRY(__fdiml)
- fldt 8(%rsp) // x
- fldt 24(%rsp) // x : y
-
- fucomi %st(1), %st
- jp 1f
-
- jc 3f
- fstp %st(1)
- fldz
- jmp 2f
-
-3: fsubrp %st, %st(1)
- ret
-
-1: fucomi %st(0), %st
- fcmovnu %st(1), %st
-2: fstp %st(1)
- ret
-END(__fdiml)
-weak_alias (__fdiml, fdiml)
diff --git a/sysdeps/x86_64/fpu/s_floorl.S b/sysdeps/x86_64/fpu/s_floorl.S
index f9ecc388df..75f8255648 100644
--- a/sysdeps/x86_64/fpu/s_floorl.S
+++ b/sysdeps/x86_64/fpu/s_floorl.S
@@ -5,26 +5,32 @@
* Public domain.
*/
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
ENTRY(__floorl)
fldt 8(%rsp)
- fstcw -4(%rsp) /* store fpu control word */
+ fnstenv -28(%rsp) /* store fpu environment */
/* We use here %edx although only the low 1 bits are defined.
But none of the operations should care and they are faster
than the 16 bit operations. */
movl $0x400,%edx /* round towards -oo */
- orl -4(%rsp),%edx
+ orl -28(%rsp),%edx
andl $0xf7ff,%edx
- movl %edx,-8(%rsp)
- fldcw -8(%rsp) /* load modified control word */
+ movl %edx,-32(%rsp)
+ fldcw -32(%rsp) /* load modified control word */
frndint /* round */
- fldcw -4(%rsp) /* restore original control word */
+ /* Preserve "invalid" exceptions from sNaN input. */
+ fnstsw
+ andl $0x1, %eax
+ orl %eax, -24(%rsp)
+
+ fldenv -28(%rsp) /* restore original environment */
ret
END (__floorl)
-weak_alias (__floorl, floorl)
+libm_alias_ldouble (__floor, floor)
diff --git a/sysdeps/x86_64/fpu/s_fmax.S b/sysdeps/x86_64/fpu/s_fmax.S
index 02096c0aea..7cd8f1ed10 100644
--- a/sysdeps/x86_64/fpu/s_fmax.S
+++ b/sysdeps/x86_64/fpu/s_fmax.S
@@ -1,5 +1,5 @@
/* Compute maximum of two numbers, regarding NaN as missing argument.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__fmax)
@@ -27,9 +28,26 @@ ENTRY(__fmax)
jmp 2f
1: ucomisd %xmm1, %xmm1 // Is xmm1 a NaN?
- jp 2f // then return xmm0
+ jp 3f
+ // xmm0 is a NaN; xmm1 is not. Test if xmm0 is signaling.
+ movsd %xmm0, -8(%rsp)
+ testb $0x8, -2(%rsp)
+ jz 4f
movsd %xmm1, %xmm0 // otherwise return xmm1
+ ret
+
+3: // xmm1 is a NaN; xmm0 may or may not be.
+ ucomisd %xmm0, %xmm0
+ jp 4f
+ // xmm1 is a NaN; xmm0 is not. Test if xmm1 is signaling.
+ movsd %xmm1, -8(%rsp)
+ testb $0x8, -2(%rsp)
+ jz 4f
+ ret
+
+4: // Both arguments are NaNs, or one is a signaling NaN.
+ addsd %xmm1, %xmm0
2: ret
END(__fmax)
-weak_alias (__fmax, fmax)
+libm_alias_double (__fmax, fmax)
diff --git a/sysdeps/x86_64/fpu/s_fmaxf.S b/sysdeps/x86_64/fpu/s_fmaxf.S
index 28e129701e..9b932fddc2 100644
--- a/sysdeps/x86_64/fpu/s_fmaxf.S
+++ b/sysdeps/x86_64/fpu/s_fmaxf.S
@@ -1,5 +1,5 @@
/* Compute maximum of two numbers, regarding NaN as missing argument.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__fmaxf)
@@ -27,9 +28,26 @@ ENTRY(__fmaxf)
jmp 2f
1: ucomiss %xmm1, %xmm1 // Is xmm1 a NaN?
- jp 2f // then return xmm0
+ jp 3f
+ // xmm0 is a NaN; xmm1 is not. Test if xmm0 is signaling.
+ movss %xmm0, -4(%rsp)
+ testb $0x40, -2(%rsp)
+ jz 4f
movss %xmm1, %xmm0 // otherwise return xmm1
+ ret
+
+3: // xmm1 is a NaN; xmm0 may or may not be.
+ ucomiss %xmm0, %xmm0
+ jp 4f
+ // xmm1 is a NaN; xmm0 is not. Test if xmm1 is signaling.
+ movss %xmm1, -4(%rsp)
+ testb $0x40, -2(%rsp)
+ jz 4f
+ ret
+
+4: // Both arguments are NaNs, or one is a signaling NaN.
+ addss %xmm1, %xmm0
2: ret
END(__fmaxf)
-weak_alias (__fmaxf, fmaxf)
+libm_alias_float (__fmax, fmax)
diff --git a/sysdeps/x86_64/fpu/s_fmaxl.S b/sysdeps/x86_64/fpu/s_fmaxl.S
index f0c2bc0d56..3463a07083 100644
--- a/sysdeps/x86_64/fpu/s_fmaxl.S
+++ b/sysdeps/x86_64/fpu/s_fmaxl.S
@@ -1,5 +1,5 @@
/* Compute maximum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,22 +18,42 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-ldouble.h>
.text
ENTRY(__fmaxl)
fldt 8(%rsp) // x
fldt 24(%rsp) // x : y
- fucomi %st(0), %st
- fcmovu %st(1), %st // now %st contains y if not NaN, x otherwise
-
- fxch
-
fucomi %st(1), %st
+ jp 2f
fcmovb %st(1), %st
fstp %st(1)
ret
+
+2: // Unordered.
+ fucomi %st(0), %st
+ jp 3f
+ // st(1) is a NaN; st(0) is not. Test if st(1) is signaling.
+ testb $0x40, 15(%rsp)
+ jz 4f
+ fstp %st(1)
+ ret
+
+3: // st(0) is a NaN; st(1) may or may not be.
+ fxch
+ fucomi %st(0), %st
+ jp 4f
+ // st(1) is a NaN; st(0) is not. Test if st(1) is signaling.
+ testb $0x40, 31(%rsp)
+ jz 4f
+ fstp %st(1)
+ ret
+
+4: // Both arguments are NaNs, or one is a signaling NaN.
+ faddp
+ ret
END(__fmaxl)
-weak_alias (__fmaxl, fmaxl)
+libm_alias_ldouble (__fmax, fmax)
diff --git a/sysdeps/x86_64/fpu/s_fmin.S b/sysdeps/x86_64/fpu/s_fmin.S
index fb14e2f3ed..15b6eaed90 100644
--- a/sysdeps/x86_64/fpu/s_fmin.S
+++ b/sysdeps/x86_64/fpu/s_fmin.S
@@ -1,5 +1,5 @@
/* Compute minimum of two numbers, regarding NaN as missing argument.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__fmin)
@@ -27,9 +28,26 @@ ENTRY(__fmin)
jmp 2f
1: ucomisd %xmm1, %xmm1 // Is xmm1 a NaN?
- jp 2f // then return xmm0
+ jp 3f
+ // xmm0 is a NaN; xmm1 is not. Test if xmm0 is signaling.
+ movsd %xmm0, -8(%rsp)
+ testb $0x8, -2(%rsp)
+ jz 4f
movsd %xmm1, %xmm0 // otherwise return xmm1
+ ret
+
+3: // xmm1 is a NaN; xmm0 may or may not be.
+ ucomisd %xmm0, %xmm0
+ jp 4f
+ // xmm1 is a NaN; xmm0 is not. Test if xmm1 is signaling.
+ movsd %xmm1, -8(%rsp)
+ testb $0x8, -2(%rsp)
+ jz 4f
+ ret
+
+4: // Both arguments are NaNs, or one is a signaling NaN.
+ addsd %xmm1, %xmm0
2: ret
END(__fmin)
-weak_alias (__fmin, fmin)
+libm_alias_double (__fmin, fmin)
diff --git a/sysdeps/x86_64/fpu/s_fminf.S b/sysdeps/x86_64/fpu/s_fminf.S
index c8d6d0fd33..28e26aead5 100644
--- a/sysdeps/x86_64/fpu/s_fminf.S
+++ b/sysdeps/x86_64/fpu/s_fminf.S
@@ -1,5 +1,5 @@
/* Compute minimum of two numbers, regarding NaN as missing argument.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__fminf)
@@ -27,9 +28,26 @@ ENTRY(__fminf)
jmp 2f
1: ucomiss %xmm1, %xmm1 // Is xmm1 a NaN?
- jp 2f // then return xmm0
+ jp 3f
+ // xmm0 is a NaN; xmm1 is not. Test if xmm0 is signaling.
+ movss %xmm0, -4(%rsp)
+ testb $0x40, -2(%rsp)
+ jz 4f
movss %xmm1, %xmm0 // otherwise return xmm1
+ ret
+
+3: // xmm1 is a NaN; xmm0 may or may not be.
+ ucomiss %xmm0, %xmm0
+ jp 4f
+ // xmm1 is a NaN; xmm0 is not. Test if xmm1 is signaling.
+ movss %xmm1, -4(%rsp)
+ testb $0x40, -2(%rsp)
+ jz 4f
+ ret
+
+4: // Both arguments are NaNs, or one is a signaling NaN.
+ addss %xmm1, %xmm0
2: ret
END(__fminf)
-weak_alias (__fminf, fminf)
+libm_alias_float (__fmin, fmin)
diff --git a/sysdeps/x86_64/fpu/s_fminl.S b/sysdeps/x86_64/fpu/s_fminl.S
index f1a06d29d7..df81762449 100644
--- a/sysdeps/x86_64/fpu/s_fminl.S
+++ b/sysdeps/x86_64/fpu/s_fminl.S
@@ -1,5 +1,5 @@
/* Compute minimum of two numbers, regarding NaN as missing argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,20 +18,42 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-ldouble.h>
.text
ENTRY(__fminl)
fldt 8(%rsp) // x
fldt 24(%rsp) // x : y
- fucomi %st(0), %st
- fcmovu %st(1), %st // now %st contains y if not NaN, x otherwise
-
fucomi %st(1), %st
+ jp 2f
fcmovnb %st(1), %st
fstp %st(1)
ret
+
+2: // Unordered.
+ fucomi %st(0), %st
+ jp 3f
+ // st(1) is a NaN; st(0) is not. Test if st(1) is signaling.
+ testb $0x40, 15(%rsp)
+ jz 4f
+ fstp %st(1)
+ ret
+
+3: // st(0) is a NaN; st(1) may or may not be.
+ fxch
+ fucomi %st(0), %st
+ jp 4f
+ // st(1) is a NaN; st(0) is not. Test if st(1) is signaling.
+ testb $0x40, 31(%rsp)
+ jz 4f
+ fstp %st(1)
+ ret
+
+4: // Both arguments are NaNs, or one is a signaling NaN.
+ faddp
+ ret
END(__fminl)
-weak_alias (__fminl, fminl)
+libm_alias_ldouble (__fmin, fmin)
diff --git a/sysdeps/x86_64/fpu/s_llrint.S b/sysdeps/x86_64/fpu/s_llrint.S
index 6634c653ea..7b93724e46 100644
--- a/sysdeps/x86_64/fpu/s_llrint.S
+++ b/sysdeps/x86_64/fpu/s_llrint.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.d>, 2002.
@@ -19,14 +19,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__llrint)
cvtsd2si %xmm0,%rax
ret
END(__llrint)
-weak_alias (__llrint, llrint)
+libm_alias_double (__llrint, llrint)
#ifndef __ILP32__
strong_alias (__llrint, __lrint)
-weak_alias (__llrint, lrint)
+libm_alias_double (__llrint, lrint)
#endif
diff --git a/sysdeps/x86_64/fpu/s_llrintf.S b/sysdeps/x86_64/fpu/s_llrintf.S
index 5ac03dffd9..b6088de1ff 100644
--- a/sysdeps/x86_64/fpu/s_llrintf.S
+++ b/sysdeps/x86_64/fpu/s_llrintf.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.d>, 2002.
@@ -19,14 +19,15 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__llrintf)
cvtss2si %xmm0,%rax
ret
END(__llrintf)
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
#ifndef __ILP32__
strong_alias (__llrintf, __lrintf)
-weak_alias (__llrintf, lrintf)
+libm_alias_float (__llrint, lrint)
#endif
diff --git a/sysdeps/x86_64/fpu/s_llrintl.S b/sysdeps/x86_64/fpu/s_llrintl.S
index 5f4d827dff..49f6ff1961 100644
--- a/sysdeps/x86_64/fpu/s_llrintl.S
+++ b/sysdeps/x86_64/fpu/s_llrintl.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-ldouble.h>
.text
ENTRY(__llrintl)
@@ -27,8 +28,8 @@ ENTRY(__llrintl)
movq -8(%rsp),%rax
ret
END(__llrintl)
-weak_alias (__llrintl, llrintl)
+libm_alias_ldouble (__llrint, llrint)
#ifndef __ILP32__
strong_alias (__llrintl, __lrintl)
-weak_alias (__llrintl, lrintl)
+libm_alias_ldouble (__llrint, lrint)
#endif
diff --git a/sysdeps/x86_64/fpu/s_log1pl.S b/sysdeps/x86_64/fpu/s_log1pl.S
index e83f64d3c0..947e5e4552 100644
--- a/sysdeps/x86_64/fpu/s_log1pl.S
+++ b/sysdeps/x86_64/fpu/s_log1pl.S
@@ -68,6 +68,7 @@ ENTRY(__log1pl)
jnz 4b // in case x is ±Inf
fstp %st(1)
fstp %st(1)
+ fadd %st(0)
ret
END (__log1pl)
diff --git a/sysdeps/x86_64/fpu/s_nearbyintl.S b/sysdeps/x86_64/fpu/s_nearbyintl.S
index 76d41bdd52..80508bdbee 100644
--- a/sysdeps/x86_64/fpu/s_nearbyintl.S
+++ b/sysdeps/x86_64/fpu/s_nearbyintl.S
@@ -4,15 +4,12 @@
*/
/* Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. */
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
ENTRY(__nearbyintl)
fldt 8(%rsp)
fnstenv -28(%rsp)
- movl -28(%rsp), %eax
- orl $0x20, %eax
- movl %eax, -32(%rsp)
- fldcw -32(%rsp)
frndint
fnstsw
andl $0x1, %eax
@@ -20,4 +17,4 @@ ENTRY(__nearbyintl)
fldenv -28(%rsp)
ret
END (__nearbyintl)
-weak_alias (__nearbyintl, nearbyintl)
+libm_alias_ldouble (__nearbyint, nearbyint)
diff --git a/sysdeps/x86_64/fpu/s_signbit.S b/sysdeps/x86_64/fpu/s_signbit.S
index 92a79d3123..becfc646cb 100644
--- a/sysdeps/x86_64/fpu/s_signbit.S
+++ b/sysdeps/x86_64/fpu/s_signbit.S
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redha.com>, 2009.
diff --git a/sysdeps/x86_64/fpu/s_signbitf.S b/sysdeps/x86_64/fpu/s_signbitf.S
index 885645372e..c7be6a6329 100644
--- a/sysdeps/x86_64/fpu/s_signbitf.S
+++ b/sysdeps/x86_64/fpu/s_signbitf.S
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redha.com>, 2009.
diff --git a/sysdeps/x86_64/fpu/s_sincosf.S b/sysdeps/x86_64/fpu/s_sincosf.S
index 5e7cbe57e3..2086e8ca5c 100644
--- a/sysdeps/x86_64/fpu/s_sincosf.S
+++ b/sysdeps/x86_64/fpu/s_sincosf.S
@@ -1,5 +1,5 @@
/* Optimized sincosf function.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software 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,8 +17,8 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#define __need_Emath
-#include <bits/errno.h>
+#include <errno.h>
+#include <libm-alias-float.h>
/* Short algorithm description:
*
@@ -561,4 +561,6 @@ L(SP_ONE):
.type L(SP_ONE), @object
ASM_SIZE_DIRECTIVE(L(SP_ONE))
-weak_alias(__sincosf, sincosf)
+#ifndef __sincosf
+libm_alias_float (__sincos, sincos)
+#endif
diff --git a/sysdeps/x86_64/fpu/s_sinf.S b/sysdeps/x86_64/fpu/s_sinf.S
deleted file mode 100644
index c980c6e207..0000000000
--- a/sysdeps/x86_64/fpu/s_sinf.S
+++ /dev/null
@@ -1,559 +0,0 @@
-/* Optimized sinf function.
- 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/>. */
-
-#include <sysdep.h>
-#define __need_Emath
-#include <bits/errno.h>
-
-/* Short algorithm description:
- *
- * 1) if |x| == 0: return x.
- * 2) if |x| < 2^-27: return x-x*DP_SMALL, raise underflow only when needed.
- * 3) if |x| < 2^-5 : return x+x^3*DP_SIN2_0+x^5*DP_SIN2_1.
- * 4) if |x| < Pi/4: return x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))).
- * 5) if |x| < 9*Pi/4:
- * 5.1) Range reduction: k=trunc(|x|/(Pi/4)), j=(k+1)&0x0e, n=k+1,
- * t=|x|-j*Pi/4.
- * 5.2) Reconstruction:
- * s = sign(x) * (-1.0)^((n>>2)&1)
- * if(n&2 != 0) {
- * using cos(t) polynomial for |t|<Pi/4, result is
- * s * (1.0+t^2*(C0+t^2*(C1+t^2*(C2+t^2*(C3+t^2*C4))))).
- * } else {
- * using sin(t) polynomial for |t|<Pi/4, result is
- * s * t * (1.0+t^2*(S0+t^2*(S1+t^2*(S2+t^2*(S3+t^2*S4))))).
- * }
- * 6) if |x| < 2^23, large args:
- * 6.1) Range reduction: k=trunc(|x|/(Pi/4)), j=(k+1)&0xfffffffe, n=k+1,
- * t=|x|-j*Pi/4.
- * 6.2) Reconstruction same as (5.2).
- * 7) if |x| >= 2^23, very large args:
- * 7.1) Range reduction: k=trunc(|x|/(Pi/4)), j=(k+1)&0xfffffffe, n=k+1,
- * t=|x|-j*Pi/4.
- * 7.2) Reconstruction same as (5.2).
- * 8) if x is Inf, return x-x, and set errno=EDOM.
- * 9) if x is NaN, return x-x.
- *
- * Special cases:
- * sin(+-0) = +-0 not raising inexact/underflow,
- * sin(subnormal) raises inexact/underflow,
- * sin(min_normalized) raises inexact/underflow,
- * sin(normalized) raises inexact,
- * sin(Inf) = NaN, raises invalid, sets errno to EDOM,
- * sin(NaN) = NaN.
- */
-
- .text
-ENTRY(__sinf)
- /* Input: single precision x in %xmm0 */
-
- movd %xmm0, %eax /* Bits of x */
- movaps %xmm0, %xmm7 /* Copy of x */
- cvtss2sd %xmm0, %xmm0 /* DP x */
- movss L(SP_ABS_MASK)(%rip), %xmm3
- movl %eax, %edi /* Copy of x bits */
- andl $0x7fffffff, %eax /* |x| */
-
- cmpl $0x3f490fdb, %eax /* |x|<Pi/4? */
- jb L(arg_less_pio4)
-
- /* Here if |x|>=Pi/4 */
- andps %xmm7, %xmm3 /* SP |x| */
- andpd L(DP_ABS_MASK)(%rip),%xmm0 /* DP |x| */
- movss L(SP_INVPIO4)(%rip), %xmm2 /* SP 1/(Pi/4) */
-
- cmpl $0x40e231d6, %eax /* |x|<9*Pi/4? */
- jae L(large_args)
-
- /* Here if Pi/4<=|x|<9*Pi/4 */
- mulss %xmm3, %xmm2 /* SP |x|/(Pi/4) */
- movl %edi, %ecx /* Load x */
- cvttss2si %xmm2, %eax /* k, number of Pi/4 in x */
- lea L(PIO4J)(%rip), %rsi
- shrl $31, %ecx /* sign of x */
- addl $1, %eax /* k+1 */
- movl $0x0e, %edx
- andl %eax, %edx /* j = (k+1)&0x0e */
- subsd (%rsi,%rdx,8), %xmm0 /* t = |x| - j * Pi/4 */
-
-L(reconstruction):
- /* Input: %eax=n, %xmm0=t, %ecx=sign(x) */
- testl $2, %eax /* n&2 != 0? */
- jz L(sin_poly)
-
-/*L(cos_poly):*/
- /* Here if sin(x) calculated using cos(t) polynomial for |t|<Pi/4:
- * y = t*t; z = y*y;
- * s = sign(x) * (-1.0)^((n>>2)&1)
- * result = s * (1.0+t^2*(C0+t^2*(C1+t^2*(C2+t^2*(C3+t^2*C4)))))
- */
- shrl $2, %eax /* n>>2 */
- mulsd %xmm0, %xmm0 /* y=t^2 */
- andl $1, %eax /* (n>>2)&1 */
- movaps %xmm0, %xmm1 /* y */
- mulsd %xmm0, %xmm0 /* z=t^4 */
-
- movsd L(DP_C4)(%rip), %xmm4 /* C4 */
- mulsd %xmm0, %xmm4 /* z*C4 */
- xorl %eax, %ecx /* (-1.0)^((n>>2)&1) XOR sign(x) */
- movsd L(DP_C3)(%rip), %xmm3 /* C3 */
- mulsd %xmm0, %xmm3 /* z*C3 */
- lea L(DP_ONES)(%rip), %rsi
- addsd L(DP_C2)(%rip), %xmm4 /* C2+z*C4 */
- mulsd %xmm0, %xmm4 /* z*(C2+z*C4) */
- addsd L(DP_C1)(%rip), %xmm3 /* C1+z*C3 */
- mulsd %xmm0, %xmm3 /* z*(C1+z*C3) */
- addsd L(DP_C0)(%rip), %xmm4 /* C0+z*(C2+z*C4) */
- mulsd %xmm1, %xmm4 /* y*(C0+z*(C2+z*C4)) */
-
- /* y*(C0+y*(C1+y*(C2+y*(C3+y*C4)))) */
- addsd %xmm4, %xmm3
- /* 1.0+y*(C0+y*(C1+y*(C2+y*(C3+y*C4)))) */
- addsd L(DP_ONES)(%rip), %xmm3
-
- mulsd (%rsi,%rcx,8), %xmm3 /* DP result */
- cvtsd2ss %xmm3, %xmm0 /* SP result */
- ret
-
- .p2align 4
-L(sin_poly):
- /* Here if sin(x) calculated using sin(t) polynomial for |t|<Pi/4:
- * y = t*t; z = y*y;
- * s = sign(x) * (-1.0)^((n>>2)&1)
- * result = s * t * (1.0+t^2*(S0+t^2*(S1+t^2*(S2+t^2*(S3+t^2*S4)))))
- */
-
- movaps %xmm0, %xmm4 /* t */
- shrl $2, %eax /* n>>2 */
- mulsd %xmm0, %xmm0 /* y=t^2 */
- andl $1, %eax /* (n>>2)&1 */
- movaps %xmm0, %xmm1 /* y */
- xorl %eax, %ecx /* (-1.0)^((n>>2)&1) XOR sign(x) */
- mulsd %xmm0, %xmm0 /* z=t^4 */
-
- movsd L(DP_S4)(%rip), %xmm2 /* S4 */
- mulsd %xmm0, %xmm2 /* z*S4 */
- movsd L(DP_S3)(%rip), %xmm3 /* S3 */
- mulsd %xmm0, %xmm3 /* z*S3 */
- lea L(DP_ONES)(%rip), %rsi
- addsd L(DP_S2)(%rip), %xmm2 /* S2+z*S4 */
- mulsd %xmm0, %xmm2 /* z*(S2+z*S4) */
- addsd L(DP_S1)(%rip), %xmm3 /* S1+z*S3 */
- mulsd %xmm0, %xmm3 /* z*(S1+z*S3) */
- addsd L(DP_S0)(%rip), %xmm2 /* S0+z*(S2+z*S4) */
- mulsd %xmm1, %xmm2 /* y*(S0+z*(S2+z*S4)) */
- /* t*s, where s = sign(x) * (-1.0)^((n>>2)&1) */
- mulsd (%rsi,%rcx,8), %xmm4
- /* y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
- addsd %xmm2, %xmm3
- /* t*s*y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
- mulsd %xmm4, %xmm3
- /* t*s*(1.0+y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
- addsd %xmm4, %xmm3
- cvtsd2ss %xmm3, %xmm0 /* SP result */
- ret
-
- .p2align 4
-L(large_args):
- /* Here if |x|>=9*Pi/4 */
- cmpl $0x7f800000, %eax /* x is Inf or NaN? */
- jae L(arg_inf_or_nan)
-
- /* Here if finite |x|>=9*Pi/4 */
- cmpl $0x4b000000, %eax /* |x|<2^23? */
- jae L(very_large_args)
-
- /* Here if 9*Pi/4<=|x|<2^23 */
- movsd L(DP_INVPIO4)(%rip), %xmm1 /* 1/(Pi/4) */
- mulsd %xmm0, %xmm1 /* |x|/(Pi/4) */
- cvttsd2si %xmm1, %eax /* k=trunc(|x|/(Pi/4)) */
- addl $1, %eax /* k+1 */
- movl %eax, %edx
- andl $0xfffffffe, %edx /* j=(k+1)&0xfffffffe */
- cvtsi2sdl %edx, %xmm4 /* DP j */
- movl %edi, %ecx /* Load x */
- movsd L(DP_PIO4HI)(%rip), %xmm2 /* -PIO4HI = high part of -Pi/4 */
- shrl $31, %ecx /* sign bit of x */
- mulsd %xmm4, %xmm2 /* -j*PIO4HI */
- movsd L(DP_PIO4LO)(%rip), %xmm3 /* -PIO4LO = low part of -Pi/4 */
- addsd %xmm2, %xmm0 /* |x| - j*PIO4HI */
- mulsd %xmm3, %xmm4 /* j*PIO4LO */
- addsd %xmm4, %xmm0 /* t = |x| - j*PIO4HI - j*PIO4LO */
- jmp L(reconstruction)
-
- .p2align 4
-L(very_large_args):
- /* Here if finite |x|>=2^23 */
-
- /* bitpos = (ix>>23) - BIAS_32 + 59; */
- shrl $23, %eax /* eb = biased exponent of x */
- /* bitpos = eb - 0x7f + 59, where 0x7f is exponent bias */
- subl $68, %eax
- movl $28, %ecx /* %cl=28 */
- movl %eax, %edx /* bitpos copy */
-
- /* j = bitpos/28; */
- div %cl /* j in register %al=%ax/%cl */
- movapd %xmm0, %xmm3 /* |x| */
- /* clear unneeded remainder from %ah */
- andl $0xff, %eax
-
- imull $28, %eax, %ecx /* j*28 */
- lea L(_FPI)(%rip), %rsi
- movsd L(DP_HI_MASK)(%rip), %xmm4 /* DP_HI_MASK */
- movapd %xmm0, %xmm5 /* |x| */
- mulsd -16(%rsi,%rax,8), %xmm3 /* tmp3 = FPI[j-2]*|x| */
- movapd %xmm0, %xmm1 /* |x| */
- mulsd -8(%rsi,%rax,8), %xmm5 /* tmp2 = FPI[j-1]*|x| */
- mulsd (%rsi,%rax,8), %xmm0 /* tmp0 = FPI[j]*|x| */
- addl $19, %ecx /* j*28+19 */
- mulsd 8(%rsi,%rax,8), %xmm1 /* tmp1 = FPI[j+1]*|x| */
- cmpl %ecx, %edx /* bitpos>=j*28+19? */
- jl L(very_large_skip1)
-
- /* Here if bitpos>=j*28+19 */
- andpd %xmm3, %xmm4 /* HI(tmp3) */
- subsd %xmm4, %xmm3 /* tmp3 = tmp3 - HI(tmp3) */
-L(very_large_skip1):
-
- movsd L(DP_2POW52)(%rip), %xmm6
- movapd %xmm5, %xmm2 /* tmp2 copy */
- addsd %xmm3, %xmm5 /* tmp5 = tmp3 + tmp2 */
- movl $1, %edx
- addsd %xmm5, %xmm6 /* tmp6 = tmp5 + 2^52 */
- movsd 8+L(DP_2POW52)(%rip), %xmm4
- movd %xmm6, %eax /* k = I64_LO(tmp6); */
- addsd %xmm6, %xmm4 /* tmp4 = tmp6 - 2^52 */
- movl %edi, %ecx /* Load x */
- comisd %xmm5, %xmm4 /* tmp4 > tmp5? */
- jbe L(very_large_skip2)
-
- /* Here if tmp4 > tmp5 */
- subl $1, %eax /* k-- */
- addsd 8+L(DP_ONES)(%rip), %xmm4 /* tmp4 -= 1.0 */
-L(very_large_skip2):
-
- andl %eax, %edx /* k&1 */
- lea L(DP_ZERONE)(%rip), %rsi
- subsd %xmm4, %xmm3 /* tmp3 -= tmp4 */
- addsd (%rsi,%rdx,8), %xmm3 /* t = DP_ZERONE[k&1] + tmp3 */
- addsd %xmm2, %xmm3 /* t += tmp2 */
- shrl $31, %ecx /* sign of x */
- addsd %xmm3, %xmm0 /* t += tmp0 */
- addl $1, %eax /* n=k+1 */
- addsd %xmm1, %xmm0 /* t += tmp1 */
- mulsd L(DP_PIO4)(%rip), %xmm0 /* t *= PI04 */
-
- jmp L(reconstruction) /* end of very_large_args peth */
-
- .p2align 4
-L(arg_less_pio4):
- /* Here if |x|<Pi/4 */
- cmpl $0x3d000000, %eax /* |x|<2^-5? */
- jl L(arg_less_2pn5)
-
- /* Here if 2^-5<=|x|<Pi/4 */
- movaps %xmm0, %xmm3 /* x */
- mulsd %xmm0, %xmm0 /* y=x^2 */
- movaps %xmm0, %xmm1 /* y */
- mulsd %xmm0, %xmm0 /* z=x^4 */
- movsd L(DP_S4)(%rip), %xmm4 /* S4 */
- mulsd %xmm0, %xmm4 /* z*S4 */
- movsd L(DP_S3)(%rip), %xmm5 /* S3 */
- mulsd %xmm0, %xmm5 /* z*S3 */
- addsd L(DP_S2)(%rip), %xmm4 /* S2+z*S4 */
- mulsd %xmm0, %xmm4 /* z*(S2+z*S4) */
- addsd L(DP_S1)(%rip), %xmm5 /* S1+z*S3 */
- mulsd %xmm0, %xmm5 /* z*(S1+z*S3) */
- addsd L(DP_S0)(%rip), %xmm4 /* S0+z*(S2+z*S4) */
- mulsd %xmm1, %xmm4 /* y*(S0+z*(S2+z*S4)) */
- mulsd %xmm3, %xmm5 /* x*z*(S1+z*S3) */
- mulsd %xmm3, %xmm4 /* x*y*(S0+z*(S2+z*S4)) */
- /* x*y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
- addsd %xmm5, %xmm4
- /* x + x*y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
- addsd %xmm4, %xmm3
- cvtsd2ss %xmm3, %xmm0 /* SP result */
- ret
-
- .p2align 4
-L(arg_less_2pn5):
- /* Here if |x|<2^-5 */
- cmpl $0x32000000, %eax /* |x|<2^-27? */
- jl L(arg_less_2pn27)
-
- /* Here if 2^-27<=|x|<2^-5 */
- movaps %xmm0, %xmm1 /* DP x */
- mulsd %xmm0, %xmm0 /* DP x^2 */
- movsd L(DP_SIN2_1)(%rip), %xmm3 /* DP DP_SIN2_1 */
- mulsd %xmm0, %xmm3 /* DP x^2*DP_SIN2_1 */
- addsd L(DP_SIN2_0)(%rip), %xmm3 /* DP DP_SIN2_0+x^2*DP_SIN2_1 */
- mulsd %xmm0, %xmm3 /* DP x^2*DP_SIN2_0+x^4*DP_SIN2_1 */
- mulsd %xmm1, %xmm3 /* DP x^3*DP_SIN2_0+x^5*DP_SIN2_1 */
- addsd %xmm1, %xmm3 /* DP x+x^3*DP_SIN2_0+x^5*DP_SIN2_1 */
- cvtsd2ss %xmm3, %xmm0 /* SP result */
- ret
-
- .p2align 4
-L(arg_less_2pn27):
- cmpl $0, %eax /* x=0? */
- je L(arg_zero) /* in case x=0 return sin(+-0)==+-0 */
- /* Here if |x|<2^-27 */
- /*
- * Special cases here:
- * sin(subnormal) raises inexact/underflow
- * sin(min_normalized) raises inexact/underflow
- * sin(normalized) raises inexact
- */
- movaps %xmm0, %xmm3 /* Copy of DP x */
- mulsd L(DP_SMALL)(%rip), %xmm0 /* x*DP_SMALL */
- subsd %xmm0, %xmm3 /* Result is x-x*DP_SMALL */
- cvtsd2ss %xmm3, %xmm0 /* Result converted to SP */
- ret
-
- .p2align 4
-L(arg_zero):
- movaps %xmm7, %xmm0 /* SP x */
- ret
-
- .p2align 4
-L(arg_inf_or_nan):
- /* Here if |x| is Inf or NAN */
- jne L(skip_errno_setting) /* in case of x is NaN */
-
- /* Align stack to 16 bytes. */
- subq $8, %rsp
- cfi_adjust_cfa_offset (8)
- /* Here if x is Inf. Set errno to EDOM. */
- call JUMPTARGET(__errno_location)
- addq $8, %rsp
- cfi_adjust_cfa_offset (-8)
-
- movl $EDOM, (%rax)
-
- .p2align 4
-L(skip_errno_setting):
- /* Here if |x| is Inf or NAN. Continued. */
- movaps %xmm7, %xmm0 /* load x */
- subss %xmm0, %xmm0 /* Result is NaN */
- ret
-END(__sinf)
-
- .section .rodata, "a"
- .p2align 3
-L(PIO4J): /* Table of j*Pi/4, for j=0,1,..,10 */
- .long 0x00000000,0x00000000
- .long 0x54442d18,0x3fe921fb
- .long 0x54442d18,0x3ff921fb
- .long 0x7f3321d2,0x4002d97c
- .long 0x54442d18,0x400921fb
- .long 0x2955385e,0x400f6a7a
- .long 0x7f3321d2,0x4012d97c
- .long 0xe9bba775,0x4015fdbb
- .long 0x54442d18,0x401921fb
- .long 0xbeccb2bb,0x401c463a
- .long 0x2955385e,0x401f6a7a
- .type L(PIO4J), @object
- ASM_SIZE_DIRECTIVE(L(PIO4J))
-
- .p2align 3
-L(_FPI): /* 4/Pi broken into sum of positive DP values */
- .long 0x00000000,0x00000000
- .long 0x6c000000,0x3ff45f30
- .long 0x2a000000,0x3e3c9c88
- .long 0xa8000000,0x3c54fe13
- .long 0xd0000000,0x3aaf47d4
- .long 0x6c000000,0x38fbb81b
- .long 0xe0000000,0x3714acc9
- .long 0x7c000000,0x3560e410
- .long 0x56000000,0x33bca2c7
- .long 0xac000000,0x31fbd778
- .long 0xe0000000,0x300b7246
- .long 0xe8000000,0x2e5d2126
- .long 0x48000000,0x2c970032
- .long 0xe8000000,0x2ad77504
- .long 0xe0000000,0x290921cf
- .long 0xb0000000,0x274deb1c
- .long 0xe0000000,0x25829a73
- .long 0xbe000000,0x23fd1046
- .long 0x10000000,0x2224baed
- .long 0x8e000000,0x20709d33
- .long 0x80000000,0x1e535a2f
- .long 0x64000000,0x1cef904e
- .long 0x30000000,0x1b0d6398
- .long 0x24000000,0x1964ce7d
- .long 0x16000000,0x17b908bf
- .type L(_FPI), @object
- ASM_SIZE_DIRECTIVE(L(_FPI))
-
-/* Coefficients of polynomial
- for sin(x)~=x+x^3*DP_SIN2_0+x^5*DP_SIN2_1, |x|<2^-5. */
- .p2align 3
-L(DP_SIN2_0):
- .long 0x5543d49d,0xbfc55555
- .type L(DP_SIN2_0), @object
- ASM_SIZE_DIRECTIVE(L(DP_SIN2_0))
-
- .p2align 3
-L(DP_SIN2_1):
- .long 0x75cec8c5,0x3f8110f4
- .type L(DP_SIN2_1), @object
- ASM_SIZE_DIRECTIVE(L(DP_SIN2_1))
-
- .p2align 3
-L(DP_ZERONE):
- .long 0x00000000,0x00000000 /* 0.0 */
- .long 0x00000000,0xbff00000 /* 1.0 */
- .type L(DP_ZERONE), @object
- ASM_SIZE_DIRECTIVE(L(DP_ZERONE))
-
- .p2align 3
-L(DP_ONES):
- .long 0x00000000,0x3ff00000 /* +1.0 */
- .long 0x00000000,0xbff00000 /* -1.0 */
- .type L(DP_ONES), @object
- ASM_SIZE_DIRECTIVE(L(DP_ONES))
-
-/* Coefficients of polynomial
- for sin(t)~=t+t^3*(S0+t^2*(S1+t^2*(S2+t^2*(S3+t^2*S4)))), |t|<Pi/4. */
- .p2align 3
-L(DP_S3):
- .long 0x64e6b5b4,0x3ec71d72
- .type L(DP_S3), @object
- ASM_SIZE_DIRECTIVE(L(DP_S3))
-
- .p2align 3
-L(DP_S1):
- .long 0x10c2688b,0x3f811111
- .type L(DP_S1), @object
- ASM_SIZE_DIRECTIVE(L(DP_S1))
-
- .p2align 3
-L(DP_S4):
- .long 0x1674b58a,0xbe5a947e
- .type L(DP_S4), @object
- ASM_SIZE_DIRECTIVE(L(DP_S4))
-
- .p2align 3
-L(DP_S2):
- .long 0x8b4bd1f9,0xbf2a019f
- .type L(DP_S2), @object
- ASM_SIZE_DIRECTIVE(L(DP_S2))
-
- .p2align 3
-L(DP_S0):
- .long 0x55551cd9,0xbfc55555
- .type L(DP_S0), @object
- ASM_SIZE_DIRECTIVE(L(DP_S0))
-
- .p2align 3
-L(DP_SMALL):
- .long 0x00000000,0x3cd00000 /* 2^(-50) */
- .type L(DP_SMALL), @object
- ASM_SIZE_DIRECTIVE(L(DP_SMALL))
-
-/* Coefficients of polynomial
- for cos(t)~=1.0+t^2*(C0+t^2*(C1+t^2*(C2+t^2*(C3+t^2*C4)))), |t|<Pi/4. */
- .p2align 3
-L(DP_C3):
- .long 0x9ac43cc0,0x3efa00eb
- .type L(DP_C3), @object
- ASM_SIZE_DIRECTIVE(L(DP_C3))
-
- .p2align 3
-L(DP_C1):
- .long 0x545c50c7,0x3fa55555
- .type L(DP_C1), @object
- ASM_SIZE_DIRECTIVE(L(DP_C1))
-
- .p2align 3
-L(DP_C4):
- .long 0xdd8844d7,0xbe923c97
- .type L(DP_C4), @object
- ASM_SIZE_DIRECTIVE(L(DP_C4))
-
- .p2align 3
-L(DP_C2):
- .long 0x348b6874,0xbf56c16b
- .type L(DP_C2), @object
- ASM_SIZE_DIRECTIVE(L(DP_C2))
-
- .p2align 3
-L(DP_C0):
- .long 0xfffe98ae,0xbfdfffff
- .type L(DP_C0), @object
- ASM_SIZE_DIRECTIVE(L(DP_C0))
-
- .p2align 3
-L(DP_PIO4):
- .long 0x54442d18,0x3fe921fb /* Pi/4 */
- .type L(DP_PIO4), @object
- ASM_SIZE_DIRECTIVE(L(DP_PIO4))
-
- .p2align 3
-L(DP_2POW52):
- .long 0x00000000,0x43300000 /* +2^52 */
- .long 0x00000000,0xc3300000 /* -2^52 */
- .type L(DP_2POW52), @object
- ASM_SIZE_DIRECTIVE(L(DP_2POW52))
-
- .p2align 3
-L(DP_INVPIO4):
- .long 0x6dc9c883,0x3ff45f30 /* 4/Pi */
- .type L(DP_INVPIO4), @object
- ASM_SIZE_DIRECTIVE(L(DP_INVPIO4))
-
- .p2align 3
-L(DP_PIO4HI):
- .long 0x54000000,0xbfe921fb /* High part of Pi/4 */
- .type L(DP_PIO4HI), @object
- ASM_SIZE_DIRECTIVE(L(DP_PIO4HI))
-
- .p2align 3
-L(DP_PIO4LO):
- .long 0x11A62633,0xbe010b46 /* Low part of Pi/4 */
- .type L(DP_PIO4LO), @object
- ASM_SIZE_DIRECTIVE(L(DP_PIO4LO))
-
- .p2align 2
-L(SP_INVPIO4):
- .long 0x3fa2f983 /* 4/Pi */
- .type L(SP_INVPIO4), @object
- ASM_SIZE_DIRECTIVE(L(SP_INVPIO4))
-
- .p2align 4
-L(DP_ABS_MASK): /* Mask for getting DP absolute value */
- .long 0xffffffff,0x7fffffff
- .long 0xffffffff,0x7fffffff
- .type L(DP_ABS_MASK), @object
- ASM_SIZE_DIRECTIVE(L(DP_ABS_MASK))
-
- .p2align 3
-L(DP_HI_MASK): /* Mask for getting high 21 bits of DP value */
- .long 0x00000000,0xffffffff
- .type L(DP_HI_MASK),@object
- ASM_SIZE_DIRECTIVE(L(DP_HI_MASK))
-
- .p2align 4
-L(SP_ABS_MASK): /* Mask for getting SP absolute value */
- .long 0x7fffffff,0x7fffffff
- .long 0x7fffffff,0x7fffffff
- .type L(SP_ABS_MASK), @object
- ASM_SIZE_DIRECTIVE(L(SP_ABS_MASK))
-
-weak_alias(__sinf, sinf)
diff --git a/sysdeps/x86_64/fpu/s_truncl.S b/sysdeps/x86_64/fpu/s_truncl.S
index c37cf00241..22427ece00 100644
--- a/sysdeps/x86_64/fpu/s_truncl.S
+++ b/sysdeps/x86_64/fpu/s_truncl.S
@@ -1,5 +1,5 @@
/* Truncate long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -17,17 +17,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <libm-alias-ldouble.h>
#include <machine/asm.h>
ENTRY(__truncl)
fldt 8(%rsp)
- fstcw -4(%rsp)
+ fnstenv -28(%rsp)
movl $0xc00, %edx
- orl -4(%rsp), %edx
- movl %edx, -8(%rsp)
- fldcw -8(%rsp)
+ orl -28(%rsp), %edx
+ movl %edx, -32(%rsp)
+ fldcw -32(%rsp)
frndint
- fldcw -4(%rsp)
+ fnstsw
+ andl $0x1, %eax
+ orl %eax, -24(%rsp)
+ fldenv -28(%rsp)
ret
END(__truncl)
-weak_alias (__truncl, truncl)
+libm_alias_ldouble (__trunc, trunc)
diff --git a/sysdeps/x86_64/fpu/svml_d_cos2_core.S b/sysdeps/x86_64/fpu/svml_d_cos2_core.S
index 7f62d29917..111548367b 100644
--- a/sysdeps/x86_64/fpu/svml_d_cos2_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_cos2_core.S
@@ -1,5 +1,5 @@
/* Function cos vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_cos4_core.S b/sysdeps/x86_64/fpu/svml_d_cos4_core.S
index b92ff13b86..28b31d510c 100644
--- a/sysdeps/x86_64/fpu/svml_d_cos4_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_cos4_core.S
@@ -1,5 +1,5 @@
/* Function cos vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_cos4_core_avx.S b/sysdeps/x86_64/fpu/svml_d_cos4_core_avx.S
index a3da721e35..988d0650ca 100644
--- a/sysdeps/x86_64/fpu/svml_d_cos4_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_d_cos4_core_avx.S
@@ -1,5 +1,5 @@
/* Function cos vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_cos8_core.S b/sysdeps/x86_64/fpu/svml_d_cos8_core.S
index e5d986d11a..830776b5d2 100644
--- a/sysdeps/x86_64/fpu/svml_d_cos8_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_cos8_core.S
@@ -1,5 +1,5 @@
/* Function cos vectorized with AVX-512, wrapper to AVX2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_exp2_core.S b/sysdeps/x86_64/fpu/svml_d_exp2_core.S
index 9e511037a1..e19ddb7f3b 100644
--- a/sysdeps/x86_64/fpu/svml_d_exp2_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_exp2_core.S
@@ -1,5 +1,5 @@
/* Function exp vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
.text
ENTRY (_ZGVbN2v_exp)
-WRAPPER_IMPL_SSE2 exp
+WRAPPER_IMPL_SSE2 __exp_finite
END (_ZGVbN2v_exp)
#ifndef USE_MULTIARCH
diff --git a/sysdeps/x86_64/fpu/svml_d_exp4_core.S b/sysdeps/x86_64/fpu/svml_d_exp4_core.S
index 8cac8adbc7..341fea8f30 100644
--- a/sysdeps/x86_64/fpu/svml_d_exp4_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_exp4_core.S
@@ -1,5 +1,5 @@
/* Function exp vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_exp4_core_avx.S b/sysdeps/x86_64/fpu/svml_d_exp4_core_avx.S
index 1a0fbf574a..39e6fcf228 100644
--- a/sysdeps/x86_64/fpu/svml_d_exp4_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_d_exp4_core_avx.S
@@ -1,5 +1,5 @@
/* Function exp vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_exp8_core.S b/sysdeps/x86_64/fpu/svml_d_exp8_core.S
index 2486e888a4..94edc01fcb 100644
--- a/sysdeps/x86_64/fpu/svml_d_exp8_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_exp8_core.S
@@ -1,5 +1,5 @@
/* Function exp vectorized with AVX-512. Wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_exp_data.S b/sysdeps/x86_64/fpu/svml_d_exp_data.S
index 6d1acbdd21..5e229c9bcc 100644
--- a/sysdeps/x86_64/fpu/svml_d_exp_data.S
+++ b/sysdeps/x86_64/fpu/svml_d_exp_data.S
@@ -1,5 +1,5 @@
/* Data for vector function exp.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_exp_data.h b/sysdeps/x86_64/fpu/svml_d_exp_data.h
index f993403d47..a3721ce137 100644
--- a/sysdeps/x86_64/fpu/svml_d_exp_data.h
+++ b/sysdeps/x86_64/fpu/svml_d_exp_data.h
@@ -1,5 +1,5 @@
/* Offsets for data table for function exp.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_log2_core.S b/sysdeps/x86_64/fpu/svml_d_log2_core.S
index 8ea40fee56..41522f2069 100644
--- a/sysdeps/x86_64/fpu/svml_d_log2_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_log2_core.S
@@ -1,5 +1,5 @@
/* Function log vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
.text
ENTRY (_ZGVbN2v_log)
-WRAPPER_IMPL_SSE2 log
+WRAPPER_IMPL_SSE2 __log_finite
END (_ZGVbN2v_log)
#ifndef USE_MULTIARCH
diff --git a/sysdeps/x86_64/fpu/svml_d_log4_core.S b/sysdeps/x86_64/fpu/svml_d_log4_core.S
index 72813d8921..5857b45aa0 100644
--- a/sysdeps/x86_64/fpu/svml_d_log4_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_log4_core.S
@@ -1,5 +1,5 @@
/* Function log vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_log4_core_avx.S b/sysdeps/x86_64/fpu/svml_d_log4_core_avx.S
index 6ca1139931..bab3ba9877 100644
--- a/sysdeps/x86_64/fpu/svml_d_log4_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_d_log4_core_avx.S
@@ -1,5 +1,5 @@
/* Function log vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_log8_core.S b/sysdeps/x86_64/fpu/svml_d_log8_core.S
index 6850fd9a44..bb3523ee0d 100644
--- a/sysdeps/x86_64/fpu/svml_d_log8_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_log8_core.S
@@ -1,5 +1,5 @@
/* Function log vectorized with AVX-512. Wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_log_data.S b/sysdeps/x86_64/fpu/svml_d_log_data.S
index 9ab541b23f..0514551ccf 100644
--- a/sysdeps/x86_64/fpu/svml_d_log_data.S
+++ b/sysdeps/x86_64/fpu/svml_d_log_data.S
@@ -1,5 +1,5 @@
/* Data for function log.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_log_data.h b/sysdeps/x86_64/fpu/svml_d_log_data.h
index 30c2b54a4b..a317c7b845 100644
--- a/sysdeps/x86_64/fpu/svml_d_log_data.h
+++ b/sysdeps/x86_64/fpu/svml_d_log_data.h
@@ -1,5 +1,5 @@
/* Offsets for data table for function log.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_pow2_core.S b/sysdeps/x86_64/fpu/svml_d_pow2_core.S
index b25515c825..b2451b2ed5 100644
--- a/sysdeps/x86_64/fpu/svml_d_pow2_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_pow2_core.S
@@ -1,5 +1,5 @@
/* Function pow vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
.text
ENTRY (_ZGVbN2vv_pow)
-WRAPPER_IMPL_SSE2_ff pow
+WRAPPER_IMPL_SSE2_ff __pow_finite
END (_ZGVbN2vv_pow)
#ifndef USE_MULTIARCH
diff --git a/sysdeps/x86_64/fpu/svml_d_pow4_core.S b/sysdeps/x86_64/fpu/svml_d_pow4_core.S
index 547993799e..1520ba1d45 100644
--- a/sysdeps/x86_64/fpu/svml_d_pow4_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_pow4_core.S
@@ -1,5 +1,5 @@
/* Function pow vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_pow4_core_avx.S b/sysdeps/x86_64/fpu/svml_d_pow4_core_avx.S
index 4e4e9867b4..d4b265c91a 100644
--- a/sysdeps/x86_64/fpu/svml_d_pow4_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_d_pow4_core_avx.S
@@ -1,5 +1,5 @@
/* Function pow vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_pow8_core.S b/sysdeps/x86_64/fpu/svml_d_pow8_core.S
index 372e5a9c83..15292ccebd 100644
--- a/sysdeps/x86_64/fpu/svml_d_pow8_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_pow8_core.S
@@ -1,5 +1,5 @@
/* Function pow vectorized with AVX-512. Wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_pow_data.S b/sysdeps/x86_64/fpu/svml_d_pow_data.S
index 8481f95455..9e5f99c25e 100644
--- a/sysdeps/x86_64/fpu/svml_d_pow_data.S
+++ b/sysdeps/x86_64/fpu/svml_d_pow_data.S
@@ -1,5 +1,5 @@
/* Data for function pow.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_pow_data.h b/sysdeps/x86_64/fpu/svml_d_pow_data.h
index 239ba96984..55b573b2a7 100644
--- a/sysdeps/x86_64/fpu/svml_d_pow_data.h
+++ b/sysdeps/x86_64/fpu/svml_d_pow_data.h
@@ -1,5 +1,5 @@
/* Offsets for data table for function pow.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_sin2_core.S b/sysdeps/x86_64/fpu/svml_d_sin2_core.S
index f6ec13104b..6485e0819f 100644
--- a/sysdeps/x86_64/fpu/svml_d_sin2_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_sin2_core.S
@@ -1,5 +1,5 @@
/* Function sin vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_sin4_core.S b/sysdeps/x86_64/fpu/svml_d_sin4_core.S
index 95a1dec6f6..7c7c426451 100644
--- a/sysdeps/x86_64/fpu/svml_d_sin4_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_sin4_core.S
@@ -1,5 +1,5 @@
/* Function sin vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_sin4_core_avx.S b/sysdeps/x86_64/fpu/svml_d_sin4_core_avx.S
index 29d1526a12..a8200dfc58 100644
--- a/sysdeps/x86_64/fpu/svml_d_sin4_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_d_sin4_core_avx.S
@@ -1,5 +1,5 @@
/* Function sin vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_sin8_core.S b/sysdeps/x86_64/fpu/svml_d_sin8_core.S
index abd86b3d98..7f07a41ba1 100644
--- a/sysdeps/x86_64/fpu/svml_d_sin8_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_sin8_core.S
@@ -1,5 +1,5 @@
/* Function sin vectorized with AVX-512, wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_sincos2_core.S b/sysdeps/x86_64/fpu/svml_d_sincos2_core.S
index 74afa0a677..ebf9e25aca 100644
--- a/sysdeps/x86_64/fpu/svml_d_sincos2_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_sincos2_core.S
@@ -1,5 +1,5 @@
/* Function sincos vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,8 +20,89 @@
#include "svml_d_wrapper_impl.h"
.text
-ENTRY (_ZGVbN2vvv_sincos)
+ENTRY (_ZGVbN2vl8l8_sincos)
WRAPPER_IMPL_SSE2_fFF sincos
+END (_ZGVbN2vl8l8_sincos)
+libmvec_hidden_def (_ZGVbN2vl8l8_sincos)
+
+/* SSE2 ISA version as wrapper to scalar (for vector
+ function declared with #pragma omp declare simd notinbranch). */
+.macro WRAPPER_IMPL_SSE2_fFF_vvv callee
+#ifndef __ILP32__
+ subq $88, %rsp
+ cfi_adjust_cfa_offset(88)
+ movaps %xmm0, 64(%rsp)
+ lea (%rsp), %rdi
+ movdqa %xmm1, 32(%rdi)
+ lea 16(%rsp), %rsi
+ movdqa %xmm2, 32(%rsi)
+ call JUMPTARGET(\callee)
+ movsd 72(%rsp), %xmm0
+ lea 8(%rsp), %rdi
+ lea 24(%rsp), %rsi
+ call JUMPTARGET(\callee)
+ movq 32(%rsp), %rdx
+ movq 48(%rsp), %rsi
+ movq 40(%rsp), %r8
+ movq 56(%rsp), %r10
+ movq (%rsp), %rax
+ movq 16(%rsp), %rcx
+ movq 8(%rsp), %rdi
+ movq 24(%rsp), %r9
+ movq %rax, (%rdx)
+ movq %rcx, (%rsi)
+ movq %rdi, (%r8)
+ movq %r9, (%r10)
+ addq $88, %rsp
+ cfi_adjust_cfa_offset(-88)
+ ret
+#else
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset 6, -16
+ pushq %rbx
+ .cfi_def_cfa_offset 24
+ .cfi_offset 3, -24
+ subl $88, %esp
+ .cfi_def_cfa_offset 112
+ leal 64(%rsp), %esi
+ movaps %xmm1, 32(%esp)
+ leal 48(%rsp), %edi
+ movaps %xmm2, 16(%esp)
+ movq %rsi, %rbp
+ movq %rdi, %rbx
+ movaps %xmm0, (%esp)
+ call JUMPTARGET(\callee)
+ movupd 8(%esp), %xmm0
+ leal 8(%rbp), %esi
+ leal 8(%rbx), %edi
+ call JUMPTARGET(\callee)
+ movdqa 32(%esp), %xmm1
+ movsd 48(%esp), %xmm0
+ movq %xmm1, %rax
+ movdqa 16(%esp), %xmm2
+ movsd %xmm0, (%eax)
+ movsd 56(%esp), %xmm0
+ pextrd $1, %xmm1, %eax
+ movsd %xmm0, (%eax)
+ movsd 64(%esp), %xmm0
+ movq %xmm2, %rax
+ movsd %xmm0, (%eax)
+ movsd 72(%esp), %xmm0
+ pextrd $1, %xmm2, %eax
+ movsd %xmm0, (%eax)
+ addl $88, %esp
+ .cfi_def_cfa_offset 24
+ popq %rbx
+ .cfi_def_cfa_offset 16
+ popq %rbp
+ .cfi_def_cfa_offset 8
+ ret
+#endif
+.endm
+
+ENTRY (_ZGVbN2vvv_sincos)
+WRAPPER_IMPL_SSE2_fFF_vvv sincos
END (_ZGVbN2vvv_sincos)
#ifndef USE_MULTIARCH
diff --git a/sysdeps/x86_64/fpu/svml_d_sincos4_core.S b/sysdeps/x86_64/fpu/svml_d_sincos4_core.S
index 2c0b011fb3..626a2b3a7b 100644
--- a/sysdeps/x86_64/fpu/svml_d_sincos4_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_sincos4_core.S
@@ -1,5 +1,5 @@
/* Function sincos vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,8 +20,131 @@
#include "svml_d_wrapper_impl.h"
.text
+ENTRY (_ZGVdN4vl8l8_sincos)
+WRAPPER_IMPL_AVX_fFF _ZGVbN2vl8l8_sincos
+END (_ZGVdN4vl8l8_sincos)
+libmvec_hidden_def (_ZGVdN4vl8l8_sincos)
+
+/* AVX2 ISA version as wrapper to SSE ISA version (for vector
+ function declared with #pragma omp declare simd notinbranch). */
+.macro WRAPPER_IMPL_AVX2_fFF_vvv callee
+#ifndef __ILP32__
+ pushq %rbp
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (%rbp, 0)
+ movq %rsp, %rbp
+ cfi_def_cfa_register (%rbp)
+ andq $-32, %rsp
+ subq $160, %rsp
+ vmovupd %ymm0, 128(%rsp)
+ lea (%rsp), %rdi
+ vmovdqu %ymm1, 64(%rdi)
+ vmovdqu %ymm2, 96(%rdi)
+ lea 32(%rsp), %rsi
+ vzeroupper
+ call HIDDEN_JUMPTARGET(\callee)
+ vmovupd 144(%rsp), %xmm0
+ lea 16(%rsp), %rdi
+ lea 48(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq 64(%rsp), %rdx
+ movq 96(%rsp), %rsi
+ movq 72(%rsp), %r8
+ movq 104(%rsp), %r10
+ movq (%rsp), %rax
+ movq 32(%rsp), %rcx
+ movq 8(%rsp), %rdi
+ movq 40(%rsp), %r9
+ movq %rax, (%rdx)
+ movq %rcx, (%rsi)
+ movq 80(%rsp), %rax
+ movq 112(%rsp), %rcx
+ movq %rdi, (%r8)
+ movq %r9, (%r10)
+ movq 88(%rsp), %rdi
+ movq 120(%rsp), %r9
+ movq 16(%rsp), %r11
+ movq 48(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 56(%rsp), %r8
+ movq %r11, (%rax)
+ movq %rdx, (%rcx)
+ movq %rsi, (%rdi)
+ movq %r8, (%r9)
+ movq %rbp, %rsp
+ cfi_def_cfa_register (%rsp)
+ popq %rbp
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (%rbp)
+ ret
+#else
+ leal 8(%rsp), %r10d
+ .cfi_def_cfa 10, 0
+ andl $-32, %esp
+ pushq -8(%r10d)
+ pushq %rbp
+ .cfi_escape 0x10,0x6,0x2,0x76,0
+ movl %esp, %ebp
+ pushq %r12
+ leal -80(%rbp), %esi
+ pushq %r10
+ .cfi_escape 0xf,0x3,0x76,0x70,0x6
+ .cfi_escape 0x10,0xc,0x2,0x76,0x78
+ leal -112(%rbp), %edi
+ movq %rsi, %r12
+ pushq %rbx
+ .cfi_escape 0x10,0x3,0x2,0x76,0x68
+ movq %rdi, %rbx
+ subl $152, %esp
+ vmovaps %xmm1, -128(%ebp)
+ vmovaps %xmm2, -144(%ebp)
+ vmovapd %ymm0, -176(%ebp)
+ vzeroupper
+ call HIDDEN_JUMPTARGET(\callee)
+ leal 16(%r12), %esi
+ vmovapd -160(%ebp), %xmm0
+ leal 16(%rbx), %edi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq -128(%ebp), %rax
+ vmovsd -112(%ebp), %xmm0
+ vmovdqa -128(%ebp), %xmm5
+ vmovdqa -144(%ebp), %xmm1
+ vmovsd %xmm0, (%eax)
+ vmovsd -104(%ebp), %xmm0
+ vpextrd $1, %xmm5, %eax
+ vmovsd %xmm0, (%eax)
+ movq -120(%ebp), %rax
+ vmovsd -96(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ vmovsd -88(%ebp), %xmm0
+ vpextrd $3, %xmm5, %eax
+ vmovsd %xmm0, (%eax)
+ movq -144(%ebp), %rax
+ vmovsd -80(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ vmovsd -72(%ebp), %xmm0
+ vpextrd $1, %xmm1, %eax
+ vmovsd %xmm0, (%eax)
+ movq -136(%ebp), %rax
+ vmovsd -64(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ vmovsd -56(%ebp), %xmm0
+ vpextrd $3, %xmm1, %eax
+ vmovsd %xmm0, (%eax)
+ addl $152, %esp
+ popq %rbx
+ popq %r10
+ .cfi_def_cfa 10, 0
+ popq %r12
+ popq %rbp
+ leal -8(%r10), %esp
+ .cfi_def_cfa 7, 8
+ ret
+#endif
+.endm
+
ENTRY (_ZGVdN4vvv_sincos)
-WRAPPER_IMPL_AVX_fFF _ZGVbN2vvv_sincos
+WRAPPER_IMPL_AVX2_fFF_vvv _ZGVbN2vl8l8_sincos
END (_ZGVdN4vvv_sincos)
#ifndef USE_MULTIARCH
diff --git a/sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S b/sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S
index e4320a97c7..4a5d4f637a 100644
--- a/sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S
@@ -1,5 +1,5 @@
/* Function sincos vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,124 @@
#include "svml_d_wrapper_impl.h"
.text
+ENTRY (_ZGVcN4vl8l8_sincos)
+WRAPPER_IMPL_AVX_fFF _ZGVbN2vl8l8_sincos
+END (_ZGVcN4vl8l8_sincos)
+
+/* AVX ISA version as wrapper to SSE ISA version (for vector
+ function declared with #pragma omp declare simd notinbranch). */
+.macro WRAPPER_IMPL_AVX_fFF_vvv callee
+#ifndef __ILP32__
+ pushq %rbp
+ movq %rsp, %rbp
+ andq $-32, %rsp
+ subq $160, %rsp
+ vmovupd %ymm0, 64(%rsp)
+ lea (%rsp), %rdi
+ vmovdqu %xmm1, 96(%rdi)
+ vmovdqu %xmm2, 112(%rdi)
+ vmovdqu %xmm3, 128(%rdi)
+ vmovdqu %xmm4, 144(%rdi)
+ lea 32(%rsp), %rsi
+ vzeroupper
+ call HIDDEN_JUMPTARGET(\callee)
+ vmovdqu 80(%rsp), %xmm0
+ lea 16(%rsp), %rdi
+ lea 48(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq 96(%rsp), %rdx
+ movq 104(%rsp), %rsi
+ movq 112(%rsp), %r8
+ movq 120(%rsp), %r10
+ movq (%rsp), %rax
+ movq 8(%rsp), %rcx
+ movq 16(%rsp), %rdi
+ movq 24(%rsp), %r9
+ movq %rax, (%rdx)
+ movq %rcx, (%rsi)
+ movq 128(%rsp), %rax
+ movq 136(%rsp), %rcx
+ movq %rdi, (%r8)
+ movq %r9, (%r10)
+ movq 144(%rsp), %rdi
+ movq 152(%rsp), %r9
+ movq 32(%rsp), %r11
+ movq 40(%rsp), %rdx
+ movq 48(%rsp), %rsi
+ movq 56(%rsp), %r8
+ movq %r11, (%rax)
+ movq %rdx, (%rcx)
+ movq %rsi, (%rdi)
+ movq %r8, (%r9)
+ movq %rbp, %rsp
+ popq %rbp
+ ret
+#else
+ leal 8(%rsp), %r10d
+ .cfi_def_cfa 10, 0
+ andl $-32, %esp
+ pushq -8(%r10d)
+ pushq %rbp
+ .cfi_escape 0x10,0x6,0x2,0x76,0
+ movl %esp, %ebp
+ pushq %r12
+ leal -80(%rbp), %esi
+ pushq %r10
+ .cfi_escape 0xf,0x3,0x76,0x70,0x6
+ .cfi_escape 0x10,0xc,0x2,0x76,0x78
+ leal -112(%rbp), %edi
+ movq %rsi, %r12
+ pushq %rbx
+ .cfi_escape 0x10,0x3,0x2,0x76,0x68
+ movq %rdi, %rbx
+ subl $152, %esp
+ vmovaps %xmm1, -128(%ebp)
+ vmovaps %xmm2, -144(%ebp)
+ vmovapd %ymm0, -176(%ebp)
+ vzeroupper
+ call HIDDEN_JUMPTARGET(\callee)
+ leal 16(%r12), %esi
+ vmovupd -160(%ebp), %xmm0
+ leal 16(%rbx), %edi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq -128(%ebp), %rax
+ vmovsd -112(%ebp), %xmm0
+ vmovdqa -128(%ebp), %xmm5
+ vmovdqa -144(%ebp), %xmm1
+ vmovsd %xmm0, (%eax)
+ vmovsd -104(%ebp), %xmm0
+ vpextrd $1, %xmm5, %eax
+ vmovsd %xmm0, (%eax)
+ movq -120(%ebp), %rax
+ vmovsd -96(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ vmovsd -88(%ebp), %xmm0
+ vpextrd $3, %xmm5, %eax
+ vmovsd %xmm0, (%eax)
+ movq -144(%ebp), %rax
+ vmovsd -80(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ vmovsd -72(%ebp), %xmm0
+ vpextrd $1, %xmm1, %eax
+ vmovsd %xmm0, (%eax)
+ movq -136(%ebp), %rax
+ vmovsd -64(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ vmovsd -56(%ebp), %xmm0
+ vpextrd $3, %xmm1, %eax
+ vmovsd %xmm0, (%eax)
+ addl $152, %esp
+ popq %rbx
+ popq %r10
+ .cfi_def_cfa 10, 0
+ popq %r12
+ popq %rbp
+ leal -8(%r10), %esp
+ .cfi_def_cfa 7, 8
+ ret
+#endif
+.endm
+
ENTRY (_ZGVcN4vvv_sincos)
-WRAPPER_IMPL_AVX_fFF _ZGVbN2vvv_sincos
+WRAPPER_IMPL_AVX_fFF_vvv _ZGVbN2vl8l8_sincos
END (_ZGVcN4vvv_sincos)
diff --git a/sysdeps/x86_64/fpu/svml_d_sincos8_core.S b/sysdeps/x86_64/fpu/svml_d_sincos8_core.S
index 68d490e5bc..7cf453872b 100644
--- a/sysdeps/x86_64/fpu/svml_d_sincos8_core.S
+++ b/sysdeps/x86_64/fpu/svml_d_sincos8_core.S
@@ -1,5 +1,5 @@
/* Function sincos vectorized with AVX-512. Wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,172 @@
#include "svml_d_wrapper_impl.h"
.text
+ENTRY (_ZGVeN8vl8l8_sincos)
+WRAPPER_IMPL_AVX512_fFF _ZGVdN4vl8l8_sincos
+END (_ZGVeN8vl8l8_sincos)
+
+/* AVX512 ISA version as wrapper to AVX2 ISA version (for vector
+ function declared with #pragma omp declare simd notinbranch). */
+.macro WRAPPER_IMPL_AVX512_fFF_vvv callee
+#ifndef __ILP32__
+ pushq %rbp
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (%rbp, 0)
+ movq %rsp, %rbp
+ cfi_def_cfa_register (%rbp)
+ andq $-64, %rsp
+ subq $320, %rsp
+ vmovups %zmm0, 256(%rsp)
+ lea (%rsp), %rdi
+ vmovups %zmm1, 128(%rdi)
+ vmovups %zmm2, 192(%rdi)
+ lea 64(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(\callee)
+ vmovdqu 288(%rsp), %ymm0
+ lea 32(%rsp), %rdi
+ lea 96(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq 128(%rsp), %rdx
+ movq 192(%rsp), %rsi
+ movq 136(%rsp), %r8
+ movq 200(%rsp), %r10
+ movq (%rsp), %rax
+ movq 64(%rsp), %rcx
+ movq 8(%rsp), %rdi
+ movq 72(%rsp), %r9
+ movq %rax, (%rdx)
+ movq %rcx, (%rsi)
+ movq 144(%rsp), %rax
+ movq 208(%rsp), %rcx
+ movq %rdi, (%r8)
+ movq %r9, (%r10)
+ movq 152(%rsp), %rdi
+ movq 216(%rsp), %r9
+ movq 16(%rsp), %r11
+ movq 80(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 88(%rsp), %r8
+ movq %r11, (%rax)
+ movq %rdx, (%rcx)
+ movq 160(%rsp), %r11
+ movq 224(%rsp), %rdx
+ movq %rsi, (%rdi)
+ movq %r8, (%r9)
+ movq 168(%rsp), %rsi
+ movq 232(%rsp), %r8
+ movq 32(%rsp), %r10
+ movq 96(%rsp), %rax
+ movq 40(%rsp), %rcx
+ movq 104(%rsp), %rdi
+ movq %r10, (%r11)
+ movq %rax, (%rdx)
+ movq 176(%rsp), %r10
+ movq 240(%rsp), %rax
+ movq %rcx, (%rsi)
+ movq %rdi, (%r8)
+ movq 184(%rsp), %rcx
+ movq 248(%rsp), %rdi
+ movq 48(%rsp), %r9
+ movq 112(%rsp), %r11
+ movq 56(%rsp), %rdx
+ movq 120(%rsp), %rsi
+ movq %r9, (%r10)
+ movq %r11, (%rax)
+ movq %rdx, (%rcx)
+ movq %rsi, (%rdi)
+ movq %rbp, %rsp
+ cfi_def_cfa_register (%rsp)
+ popq %rbp
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (%rbp)
+ ret
+#else
+ leal 8(%rsp), %r10d
+ .cfi_def_cfa 10, 0
+ andl $-64, %esp
+ pushq -8(%r10d)
+ pushq %rbp
+ .cfi_escape 0x10,0x6,0x2,0x76,0
+ movl %esp, %ebp
+ pushq %r12
+ leal -112(%rbp), %esi
+ pushq %r10
+ .cfi_escape 0xf,0x3,0x76,0x70,0x6
+ .cfi_escape 0x10,0xc,0x2,0x76,0x78
+ leal -176(%rbp), %edi
+ movq %rsi, %r12
+ pushq %rbx
+ .cfi_escape 0x10,0x3,0x2,0x76,0x68
+ movq %rdi, %rbx
+ subl $280, %esp
+ vmovdqa %ymm1, -208(%ebp)
+ vmovdqa %ymm2, -240(%ebp)
+ vmovapd %zmm0, -304(%ebp)
+ call HIDDEN_JUMPTARGET(\callee)
+ leal 32(%r12), %esi
+ vmovupd -272(%ebp), %ymm0
+ leal 32(%rbx), %edi
+ call HIDDEN_JUMPTARGET(\callee)
+ movl -208(%ebp), %eax
+ vmovsd -176(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -204(%ebp), %eax
+ vmovsd -168(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -200(%ebp), %eax
+ vmovsd -160(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -196(%ebp), %eax
+ vmovsd -152(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -192(%ebp), %eax
+ vmovsd -144(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -188(%ebp), %eax
+ vmovsd -136(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -184(%ebp), %eax
+ vmovsd -128(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -180(%ebp), %eax
+ vmovsd -120(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -240(%ebp), %eax
+ vmovsd -112(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -236(%ebp), %eax
+ vmovsd -104(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -232(%ebp), %eax
+ vmovsd -96(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -228(%ebp), %eax
+ vmovsd -88(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -224(%ebp), %eax
+ vmovsd -80(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -220(%ebp), %eax
+ vmovsd -72(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -216(%ebp), %eax
+ vmovsd -64(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ movl -212(%ebp), %eax
+ vmovsd -56(%ebp), %xmm0
+ vmovsd %xmm0, (%eax)
+ addl $280, %esp
+ popq %rbx
+ popq %r10
+ .cfi_def_cfa 10, 0
+ popq %r12
+ popq %rbp
+ leal -8(%r10), %esp
+ .cfi_def_cfa 7, 8
+ ret
+#endif
+.endm
+
ENTRY (_ZGVeN8vvv_sincos)
-WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos
+WRAPPER_IMPL_AVX512_fFF_vvv _ZGVdN4vl8l8_sincos
END (_ZGVeN8vvv_sincos)
diff --git a/sysdeps/x86_64/fpu/svml_d_trig_data.S b/sysdeps/x86_64/fpu/svml_d_trig_data.S
index 887dacee91..2b148325fc 100644
--- a/sysdeps/x86_64/fpu/svml_d_trig_data.S
+++ b/sysdeps/x86_64/fpu/svml_d_trig_data.S
@@ -1,5 +1,5 @@
/* Data for vectorized sin, cos, sincos.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_trig_data.h b/sysdeps/x86_64/fpu/svml_d_trig_data.h
index 4617b5e0c3..b9bb5dc6af 100644
--- a/sysdeps/x86_64/fpu/svml_d_trig_data.h
+++ b/sysdeps/x86_64/fpu/svml_d_trig_data.h
@@ -1,5 +1,5 @@
/* Offsets for data table for vectorized sin, cos, sincos.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_d_wrapper_impl.h b/sysdeps/x86_64/fpu/svml_d_wrapper_impl.h
index 54f4f58371..d8452e0c2b 100644
--- a/sysdeps/x86_64/fpu/svml_d_wrapper_impl.h
+++ b/sysdeps/x86_64/fpu/svml_d_wrapper_impl.h
@@ -1,5 +1,5 @@
/* Wrapper implementations of vector math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,10 +21,10 @@
subq $40, %rsp
cfi_adjust_cfa_offset(40)
movaps %xmm0, (%rsp)
- call \callee@PLT
+ call JUMPTARGET(\callee)
movsd %xmm0, 16(%rsp)
movsd 8(%rsp), %xmm0
- call \callee@PLT
+ call JUMPTARGET(\callee)
movsd 16(%rsp), %xmm1
movsd %xmm0, 24(%rsp)
unpcklpd %xmm0, %xmm1
@@ -40,11 +40,11 @@
cfi_adjust_cfa_offset(56)
movaps %xmm0, (%rsp)
movaps %xmm1, 16(%rsp)
- call \callee@PLT
+ call JUMPTARGET(\callee)
movsd %xmm0, 32(%rsp)
movsd 8(%rsp), %xmm0
movsd 24(%rsp), %xmm1
- call \callee@PLT
+ call JUMPTARGET(\callee)
movsd 32(%rsp), %xmm1
movsd %xmm0, 40(%rsp)
unpcklpd %xmm0, %xmm1
@@ -69,7 +69,7 @@
leaq 16(%rsp), %rsi
leaq 24(%rsp), %rdi
movaps %xmm0, (%rsp)
- call \callee@PLT
+ call JUMPTARGET(\callee)
leaq 16(%rsp), %rsi
leaq 24(%rsp), %rdi
movsd 24(%rsp), %xmm0
@@ -79,7 +79,7 @@
movsd 16(%rsp), %xmm0
movsd %xmm0, (%rbx)
movapd %xmm1, %xmm0
- call \callee@PLT
+ call JUMPTARGET(\callee)
movsd 24(%rsp), %xmm0
movsd %xmm0, 8(%rbp)
movsd 16(%rsp), %xmm0
@@ -201,29 +201,14 @@
cfi_def_cfa_register (%rbp)
andq $-64, %rsp
subq $128, %rsp
-/* Below is encoding for vmovups %zmm0, (%rsp). */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x11
- .byte 0x04
- .byte 0x24
+ vmovups %zmm0, (%rsp)
vmovupd (%rsp), %ymm0
call HIDDEN_JUMPTARGET(\callee)
vmovupd %ymm0, 64(%rsp)
vmovupd 32(%rsp), %ymm0
call HIDDEN_JUMPTARGET(\callee)
vmovupd %ymm0, 96(%rsp)
-/* Below is encoding for vmovups 64(%rsp), %zmm0. */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x10
- .byte 0x44
- .byte 0x24
- .byte 0x01
+ vmovups 64(%rsp), %zmm0
movq %rbp, %rsp
cfi_def_cfa_register (%rsp)
popq %rbp
@@ -241,23 +226,8 @@
cfi_def_cfa_register (%rbp)
andq $-64, %rsp
subq $192, %rsp
-/* Below is encoding for vmovups %zmm0, (%rsp). */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x11
- .byte 0x04
- .byte 0x24
-/* Below is encoding for vmovups %zmm1, 64(%rsp). */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x11
- .byte 0x4c
- .byte 0x24
- .byte 0x01
+ vmovups %zmm0, (%rsp)
+ vmovups %zmm1, 64(%rsp)
vmovupd (%rsp), %ymm0
vmovupd 64(%rsp), %ymm1
call HIDDEN_JUMPTARGET(\callee)
@@ -266,15 +236,7 @@
vmovupd 96(%rsp), %ymm1
call HIDDEN_JUMPTARGET(\callee)
vmovupd %ymm0, 160(%rsp)
-/* Below is encoding for vmovups 128(%rsp), %zmm0. */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x10
- .byte 0x44
- .byte 0x24
- .byte 0x02
+ vmovups 128(%rsp), %zmm0
movq %rbp, %rsp
cfi_def_cfa_register (%rsp)
popq %rbp
@@ -299,14 +261,7 @@
cfi_rel_offset (%r13, 0)
subq $176, %rsp
movq %rsi, %r13
-/* Below is encoding for vmovups %zmm0, (%rsp). */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x11
- .byte 0x04
- .byte 0x24
+ vmovups %zmm0, (%rsp)
movq %rdi, %r12
vmovupd (%rsp), %ymm0
call HIDDEN_JUMPTARGET(\callee)
diff --git a/sysdeps/x86_64/fpu/svml_finite_alias.S b/sysdeps/x86_64/fpu/svml_finite_alias.S
index 2dcfc37590..21a9d6d2ee 100644
--- a/sysdeps/x86_64/fpu/svml_finite_alias.S
+++ b/sysdeps/x86_64/fpu/svml_finite_alias.S
@@ -2,7 +2,7 @@
aliases in libmvec.so while compiler creates the vector names
based on scalar asm name. Corresponding discussion is at
<https://gcc.gnu.org/ml/gcc/2015-06/msg00173.html>.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_cosf16_core.S b/sysdeps/x86_64/fpu/svml_s_cosf16_core.S
index 9ca4fbfaa8..d1a4647082 100644
--- a/sysdeps/x86_64/fpu/svml_s_cosf16_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_cosf16_core.S
@@ -1,5 +1,5 @@
/* Function cosf vectorized with AVX-512. Wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_cosf4_core.S b/sysdeps/x86_64/fpu/svml_s_cosf4_core.S
index 363090c54a..d58ccecc09 100644
--- a/sysdeps/x86_64/fpu/svml_s_cosf4_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_cosf4_core.S
@@ -1,5 +1,5 @@
/* Function cosf vectorized with SSE2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_cosf8_core.S b/sysdeps/x86_64/fpu/svml_s_cosf8_core.S
index 26a6a4e4d6..f9dc74fc49 100644
--- a/sysdeps/x86_64/fpu/svml_s_cosf8_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_cosf8_core.S
@@ -1,5 +1,5 @@
/* Function cosf vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_cosf8_core_avx.S b/sysdeps/x86_64/fpu/svml_s_cosf8_core_avx.S
index 6c210d98ce..45f14e23df 100644
--- a/sysdeps/x86_64/fpu/svml_s_cosf8_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_s_cosf8_core_avx.S
@@ -1,5 +1,5 @@
/* Function cosf vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_expf16_core.S b/sysdeps/x86_64/fpu/svml_s_expf16_core.S
index d8eecac674..4e18b6f544 100644
--- a/sysdeps/x86_64/fpu/svml_s_expf16_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_expf16_core.S
@@ -1,5 +1,5 @@
/* Function expf vectorized with AVX-512. Wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_expf4_core.S b/sysdeps/x86_64/fpu/svml_s_expf4_core.S
index 65b5d1a3ce..a2a6209621 100644
--- a/sysdeps/x86_64/fpu/svml_s_expf4_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_expf4_core.S
@@ -1,5 +1,5 @@
/* Function expf vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
.text
ENTRY (_ZGVbN4v_expf)
-WRAPPER_IMPL_SSE2 expf
+WRAPPER_IMPL_SSE2 __expf_finite
END (_ZGVbN4v_expf)
#ifndef USE_MULTIARCH
diff --git a/sysdeps/x86_64/fpu/svml_s_expf8_core.S b/sysdeps/x86_64/fpu/svml_s_expf8_core.S
index e3cf975bf6..46297208cd 100644
--- a/sysdeps/x86_64/fpu/svml_s_expf8_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_expf8_core.S
@@ -1,5 +1,5 @@
/* Function expf vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_expf8_core_avx.S b/sysdeps/x86_64/fpu/svml_s_expf8_core_avx.S
index 90469d7dcf..1210dcf885 100644
--- a/sysdeps/x86_64/fpu/svml_s_expf8_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_s_expf8_core_avx.S
@@ -1,5 +1,5 @@
/* Function expf vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_expf_data.S b/sysdeps/x86_64/fpu/svml_s_expf_data.S
index 4b644082b6..a1cb6e7591 100644
--- a/sysdeps/x86_64/fpu/svml_s_expf_data.S
+++ b/sysdeps/x86_64/fpu/svml_s_expf_data.S
@@ -1,5 +1,5 @@
/* Data for function expf.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_expf_data.h b/sysdeps/x86_64/fpu/svml_s_expf_data.h
index 3610633c96..56a1d8bdf6 100644
--- a/sysdeps/x86_64/fpu/svml_s_expf_data.h
+++ b/sysdeps/x86_64/fpu/svml_s_expf_data.h
@@ -1,5 +1,5 @@
/* Offsets for data table for vector function expf.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_logf16_core.S b/sysdeps/x86_64/fpu/svml_s_logf16_core.S
index cc2e97df78..e1f4b0cf0c 100644
--- a/sysdeps/x86_64/fpu/svml_s_logf16_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_logf16_core.S
@@ -1,5 +1,5 @@
/* Function logf vectorized with AVX-512. Wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_logf4_core.S b/sysdeps/x86_64/fpu/svml_s_logf4_core.S
index 195f328d92..496b93ffa6 100644
--- a/sysdeps/x86_64/fpu/svml_s_logf4_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_logf4_core.S
@@ -1,5 +1,5 @@
/* Function logf vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
.text
ENTRY (_ZGVbN4v_logf)
-WRAPPER_IMPL_SSE2 logf
+WRAPPER_IMPL_SSE2 __logf_finite
END (_ZGVbN4v_logf)
#ifndef USE_MULTIARCH
diff --git a/sysdeps/x86_64/fpu/svml_s_logf8_core.S b/sysdeps/x86_64/fpu/svml_s_logf8_core.S
index 8bb6926667..f0ccee7205 100644
--- a/sysdeps/x86_64/fpu/svml_s_logf8_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_logf8_core.S
@@ -1,5 +1,5 @@
/* Function logf vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_logf8_core_avx.S b/sysdeps/x86_64/fpu/svml_s_logf8_core_avx.S
index c2efba23f2..1ddd0381cd 100644
--- a/sysdeps/x86_64/fpu/svml_s_logf8_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_s_logf8_core_avx.S
@@ -1,5 +1,5 @@
/* Function logf vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_logf_data.S b/sysdeps/x86_64/fpu/svml_s_logf_data.S
index a5675f5c7a..154f98c2e0 100644
--- a/sysdeps/x86_64/fpu/svml_s_logf_data.S
+++ b/sysdeps/x86_64/fpu/svml_s_logf_data.S
@@ -1,5 +1,5 @@
/* Data for vector function logf.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_logf_data.h b/sysdeps/x86_64/fpu/svml_s_logf_data.h
index 619d5c4bd1..82a9903b10 100644
--- a/sysdeps/x86_64/fpu/svml_s_logf_data.h
+++ b/sysdeps/x86_64/fpu/svml_s_logf_data.h
@@ -1,5 +1,5 @@
/* Offsets for data table for vectorized function logf.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_powf16_core.S b/sysdeps/x86_64/fpu/svml_s_powf16_core.S
index cb52af0c6b..0859996d0a 100644
--- a/sysdeps/x86_64/fpu/svml_s_powf16_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_powf16_core.S
@@ -1,5 +1,5 @@
/* Function powf vectorized with AVX-512. Wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_powf4_core.S b/sysdeps/x86_64/fpu/svml_s_powf4_core.S
index 88fae60892..4276e6ea28 100644
--- a/sysdeps/x86_64/fpu/svml_s_powf4_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_powf4_core.S
@@ -1,5 +1,5 @@
/* Function powf vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
.text
ENTRY (_ZGVbN4vv_powf)
-WRAPPER_IMPL_SSE2_ff powf
+WRAPPER_IMPL_SSE2_ff __powf_finite
END (_ZGVbN4vv_powf)
#ifndef USE_MULTIARCH
diff --git a/sysdeps/x86_64/fpu/svml_s_powf8_core.S b/sysdeps/x86_64/fpu/svml_s_powf8_core.S
index 8ea44897c1..764dc99ee7 100644
--- a/sysdeps/x86_64/fpu/svml_s_powf8_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_powf8_core.S
@@ -1,5 +1,5 @@
/* Function powf vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_powf8_core_avx.S b/sysdeps/x86_64/fpu/svml_s_powf8_core_avx.S
index b5e4e5e6ef..8bb1ef22fd 100644
--- a/sysdeps/x86_64/fpu/svml_s_powf8_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_s_powf8_core_avx.S
@@ -1,5 +1,5 @@
/* Function powf vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_powf_data.S b/sysdeps/x86_64/fpu/svml_s_powf_data.S
index fc1a3d9390..74a31abd1e 100644
--- a/sysdeps/x86_64/fpu/svml_s_powf_data.S
+++ b/sysdeps/x86_64/fpu/svml_s_powf_data.S
@@ -1,5 +1,5 @@
/* Data for function powf.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_powf_data.h b/sysdeps/x86_64/fpu/svml_s_powf_data.h
index 514004238a..5d3270cf27 100644
--- a/sysdeps/x86_64/fpu/svml_s_powf_data.h
+++ b/sysdeps/x86_64/fpu/svml_s_powf_data.h
@@ -1,5 +1,5 @@
/* Offsets for data table for function powf.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_sincosf16_core.S b/sysdeps/x86_64/fpu/svml_s_sincosf16_core.S
index 5cbf10b8da..40eb974a74 100644
--- a/sysdeps/x86_64/fpu/svml_s_sincosf16_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_sincosf16_core.S
@@ -1,5 +1,5 @@
/* Function sincosf vectorized with AVX-512. Wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,270 @@
#include "svml_s_wrapper_impl.h"
.text
+ENTRY (_ZGVeN16vl4l4_sincosf)
+WRAPPER_IMPL_AVX512_fFF _ZGVdN8vl4l4_sincosf
+END (_ZGVeN16vl4l4_sincosf)
+
+/* AVX512 ISA version as wrapper to AVX2 ISA version (for vector
+ function declared with #pragma omp declare simd notinbranch). */
+.macro WRAPPER_IMPL_AVX512_fFF_vvv callee
+#ifndef __ILP32__
+ pushq %rbp
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (%rbp, 0)
+ movq %rsp, %rbp
+ cfi_def_cfa_register (%rbp)
+ andq $-64, %rsp
+ subq $448, %rsp
+ vmovups %zmm0, 384(%rsp)
+ lea (%rsp), %rdi
+ vmovups %zmm1, 128(%rdi)
+ vmovups %zmm2, 192(%rdi)
+ vmovups %zmm3, 256(%rdi)
+ vmovups %zmm4, 320(%rdi)
+ lea 64(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(\callee)
+ vmovdqu 416(%rsp), %ymm0
+ lea 32(%rsp), %rdi
+ lea 96(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq 128(%rsp), %rdx
+ movq 136(%rsp), %rsi
+ movq 144(%rsp), %r8
+ movq 152(%rsp), %r10
+ movl (%rsp), %eax
+ movl 4(%rsp), %ecx
+ movl 8(%rsp), %edi
+ movl 12(%rsp), %r9d
+ movl %eax, (%rdx)
+ movl %ecx, (%rsi)
+ movq 160(%rsp), %rax
+ movq 168(%rsp), %rcx
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movq 176(%rsp), %rdi
+ movq 184(%rsp), %r9
+ movl 16(%rsp), %r11d
+ movl 20(%rsp), %edx
+ movl 24(%rsp), %esi
+ movl 28(%rsp), %r8d
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movq 192(%rsp), %r11
+ movq 200(%rsp), %rdx
+ movl %esi, (%rdi)
+ movl %r8d, (%r9)
+ movq 208(%rsp), %rsi
+ movq 216(%rsp), %r8
+ movl 32(%rsp), %r10d
+ movl 36(%rsp), %eax
+ movl 40(%rsp), %ecx
+ movl 44(%rsp), %edi
+ movl %r10d, (%r11)
+ movl %eax, (%rdx)
+ movq 224(%rsp), %r10
+ movq 232(%rsp), %rax
+ movl %ecx, (%rsi)
+ movl %edi, (%r8)
+ movq 240(%rsp), %rcx
+ movq 248(%rsp), %rdi
+ movl 48(%rsp), %r9d
+ movl 52(%rsp), %r11d
+ movl 56(%rsp), %edx
+ movl 60(%rsp), %esi
+ movl %r9d, (%r10)
+ movl %r11d, (%rax)
+ movq 256(%rsp), %r9
+ movq 264(%rsp), %r11
+ movl %edx, (%rcx)
+ movl %esi, (%rdi)
+ movq 272(%rsp), %rdx
+ movq 280(%rsp), %rsi
+ movl 64(%rsp), %r8d
+ movl 68(%rsp), %r10d
+ movl 72(%rsp), %eax
+ movl 76(%rsp), %ecx
+ movl %r8d, (%r9)
+ movl %r10d, (%r11)
+ movq 288(%rsp), %r8
+ movq 296(%rsp), %r10
+ movl %eax, (%rdx)
+ movl %ecx, (%rsi)
+ movq 304(%rsp), %rax
+ movq 312(%rsp), %rcx
+ movl 80(%rsp), %edi
+ movl 84(%rsp), %r9d
+ movl 88(%rsp), %r11d
+ movl 92(%rsp), %edx
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movq 320(%rsp), %rdi
+ movq 328(%rsp), %r9
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movq 336(%rsp), %r11
+ movq 344(%rsp), %rdx
+ movl 96(%rsp), %esi
+ movl 100(%rsp), %r8d
+ movl 104(%rsp), %r10d
+ movl 108(%rsp), %eax
+ movl %esi, (%rdi)
+ movl %r8d, (%r9)
+ movq 352(%rsp), %rsi
+ movq 360(%rsp), %r8
+ movl %r10d, (%r11)
+ movl %eax, (%rdx)
+ movq 368(%rsp), %r10
+ movq 376(%rsp), %rax
+ movl 112(%rsp), %ecx
+ movl 116(%rsp), %edi
+ movl 120(%rsp), %r9d
+ movl 124(%rsp), %r11d
+ movl %ecx, (%rsi)
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movl %r11d, (%rax)
+ movq %rbp, %rsp
+ cfi_def_cfa_register (%rsp)
+ popq %rbp
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (%rbp)
+ ret
+#else
+ leal 8(%rsp), %r10d
+ .cfi_def_cfa 10, 0
+ andl $-64, %esp
+ pushq -8(%r10d)
+ pushq %rbp
+ .cfi_escape 0x10,0x6,0x2,0x76,0
+ movl %esp, %ebp
+ pushq %r12
+ leal -112(%rbp), %esi
+ pushq %r10
+ .cfi_escape 0xf,0x3,0x76,0x70,0x6
+ .cfi_escape 0x10,0xc,0x2,0x76,0x78
+ leal -176(%rbp), %edi
+ movq %rsi, %r12
+ pushq %rbx
+ .cfi_escape 0x10,0x3,0x2,0x76,0x68
+ movq %rdi, %rbx
+ subl $344, %esp
+ vmovdqa64 %zmm1, -240(%ebp)
+ vmovdqa64 %zmm2, -304(%ebp)
+ vmovaps %zmm0, -368(%ebp)
+ call HIDDEN_JUMPTARGET(\callee)
+ leal 32(%r12), %esi
+ vmovups -336(%ebp), %ymm0
+ leal 32(%rbx), %edi
+ call HIDDEN_JUMPTARGET(\callee)
+ movl -240(%ebp), %eax
+ vmovss -176(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -236(%ebp), %eax
+ vmovss -172(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -232(%ebp), %eax
+ vmovss -168(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -228(%ebp), %eax
+ vmovss -164(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -224(%ebp), %eax
+ vmovss -160(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -220(%ebp), %eax
+ vmovss -156(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -216(%ebp), %eax
+ vmovss -152(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -212(%ebp), %eax
+ vmovss -148(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -208(%ebp), %eax
+ vmovss -144(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -204(%ebp), %eax
+ vmovss -140(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -200(%ebp), %eax
+ vmovss -136(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -196(%ebp), %eax
+ vmovss -132(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -192(%ebp), %eax
+ vmovss -128(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -188(%ebp), %eax
+ vmovss -124(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -184(%ebp), %eax
+ vmovss -120(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -180(%ebp), %eax
+ vmovss -116(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -304(%ebp), %eax
+ vmovss -112(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -300(%ebp), %eax
+ vmovss -108(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -296(%ebp), %eax
+ vmovss -104(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -292(%ebp), %eax
+ vmovss -100(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -288(%ebp), %eax
+ vmovss -96(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -284(%ebp), %eax
+ vmovss -92(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -280(%ebp), %eax
+ vmovss -88(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -276(%ebp), %eax
+ vmovss -84(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -272(%ebp), %eax
+ vmovss -80(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -268(%ebp), %eax
+ vmovss -76(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -264(%ebp), %eax
+ vmovss -72(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -260(%ebp), %eax
+ vmovss -68(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -256(%ebp), %eax
+ vmovss -64(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -252(%ebp), %eax
+ vmovss -60(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -248(%ebp), %eax
+ vmovss -56(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -244(%ebp), %eax
+ vmovss -52(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ addl $344, %esp
+ popq %rbx
+ popq %r10
+ .cfi_def_cfa 10, 0
+ popq %r12
+ popq %rbp
+ leal -8(%r10), %esp
+ .cfi_def_cfa 7, 8
+ ret
+#endif
+.endm
+
ENTRY (_ZGVeN16vvv_sincosf)
-WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf
+WRAPPER_IMPL_AVX512_fFF_vvv _ZGVdN8vl4l4_sincosf
END (_ZGVeN16vvv_sincosf)
diff --git a/sysdeps/x86_64/fpu/svml_s_sincosf4_core.S b/sysdeps/x86_64/fpu/svml_s_sincosf4_core.S
index 1a7d2733af..5daa5118d6 100644
--- a/sysdeps/x86_64/fpu/svml_s_sincosf4_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_sincosf4_core.S
@@ -1,5 +1,5 @@
/* Function sincosf vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,135 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-
#include <sysdep.h>
#include "svml_s_wrapper_impl.h"
.text
-ENTRY (_ZGVbN4vvv_sincosf)
+ENTRY (_ZGVbN4vl4l4_sincosf)
WRAPPER_IMPL_SSE2_fFF sincosf
+END (_ZGVbN4vl4l4_sincosf)
+libmvec_hidden_def (_ZGVbN4vl4l4_sincosf)
+
+/* SSE2 ISA version as wrapper to scalar (for vector
+ function declared with #pragma omp declare simd notinbranch). */
+.macro WRAPPER_IMPL_SSE2_fFF_vvv callee
+#ifndef __ILP32__
+ subq $120, %rsp
+ cfi_adjust_cfa_offset(120)
+ movaps %xmm0, 96(%rsp)
+ lea (%rsp), %rdi
+ movdqa %xmm1, 32(%rdi)
+ lea 16(%rsp), %rsi
+ movdqa %xmm2, 32(%rsi)
+ movdqa %xmm3, 48(%rsi)
+ movdqa %xmm4, 64(%rsi)
+ call JUMPTARGET(\callee)
+ movss 100(%rsp), %xmm0
+ lea 4(%rsp), %rdi
+ lea 20(%rsp), %rsi
+ call JUMPTARGET(\callee)
+ movss 104(%rsp), %xmm0
+ lea 8(%rsp), %rdi
+ lea 24(%rsp), %rsi
+ call JUMPTARGET(\callee)
+ movss 108(%rsp), %xmm0
+ lea 12(%rsp), %rdi
+ lea 28(%rsp), %rsi
+ call JUMPTARGET(\callee)
+ movq 32(%rsp), %rdx
+ movq 40(%rsp), %rsi
+ movq 48(%rsp), %r8
+ movq 56(%rsp), %r10
+ movl (%rsp), %eax
+ movl 4(%rsp), %ecx
+ movl 8(%rsp), %edi
+ movl 12(%rsp), %r9d
+ movl %eax, (%rdx)
+ movl %ecx, (%rsi)
+ movq 64(%rsp), %rax
+ movq 72(%rsp), %rcx
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movq 80(%rsp), %rdi
+ movq 88(%rsp), %r9
+ movl 16(%rsp), %r11d
+ movl 20(%rsp), %edx
+ movl 24(%rsp), %esi
+ movl 28(%rsp), %r8d
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movl %esi, (%rdi)
+ movl %r8d, (%r9)
+ addq $120, %rsp
+ cfi_adjust_cfa_offset(-120)
+ ret
+#else
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset 6, -16
+ pushq %rbx
+ .cfi_def_cfa_offset 24
+ .cfi_offset 3, -24
+ subl $88, %esp
+ .cfi_def_cfa_offset 112
+ leal 64(%rsp), %esi
+ movaps %xmm1, (%esp)
+ leal 48(%rsp), %edi
+ movaps %xmm2, 16(%esp)
+ movq %rsi, %rbp
+ movq %rdi, %rbx
+ movaps %xmm0, 32(%esp)
+ call JUMPTARGET(\callee)
+ movups 36(%esp), %xmm0
+ leal 4(%rbp), %esi
+ leal 4(%rbx), %edi
+ call JUMPTARGET(\callee)
+ movups 40(%esp), %xmm0
+ leal 8(%rbp), %esi
+ leal 8(%rbx), %edi
+ call JUMPTARGET(\callee)
+ movups 44(%esp), %xmm0
+ leal 12(%rbp), %esi
+ leal 12(%rbx), %edi
+ call JUMPTARGET(\callee)
+ movq (%esp), %rax
+ movss 48(%esp), %xmm0
+ movdqa (%esp), %xmm4
+ movdqa 16(%esp), %xmm7
+ movss %xmm0, (%eax)
+ movss 52(%esp), %xmm0
+ pextrd $1, %xmm4, %eax
+ movss %xmm0, (%eax)
+ movq 8(%esp), %rax
+ movss 56(%esp), %xmm0
+ movss %xmm0, (%eax)
+ movss 60(%esp), %xmm0
+ pextrd $3, %xmm4, %eax
+ movss %xmm0, (%eax)
+ movq 16(%esp), %rax
+ movss 64(%esp), %xmm0
+ movss %xmm0, (%eax)
+ movss 68(%esp), %xmm0
+ pextrd $1, %xmm7, %eax
+ movss %xmm0, (%eax)
+ movq 24(%esp), %rax
+ movss 72(%esp), %xmm0
+ movss %xmm0, (%eax)
+ movss 76(%esp), %xmm0
+ pextrd $3, %xmm7, %eax
+ movss %xmm0, (%eax)
+ addl $88, %esp
+ .cfi_def_cfa_offset 24
+ popq %rbx
+ .cfi_def_cfa_offset 16
+ popq %rbp
+ .cfi_def_cfa_offset 8
+ ret
+#endif
+.endm
+
+ENTRY (_ZGVbN4vvv_sincosf)
+WRAPPER_IMPL_SSE2_fFF_vvv sincosf
END (_ZGVbN4vvv_sincosf)
#ifndef USE_MULTIARCH
diff --git a/sysdeps/x86_64/fpu/svml_s_sincosf8_core.S b/sysdeps/x86_64/fpu/svml_s_sincosf8_core.S
index 74d1dfd1a8..d6d4600d10 100644
--- a/sysdeps/x86_64/fpu/svml_s_sincosf8_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_sincosf8_core.S
@@ -1,5 +1,5 @@
/* Function sincosf vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,8 +20,179 @@
#include "svml_s_wrapper_impl.h"
.text
+ENTRY (_ZGVdN8vl4l4_sincosf)
+WRAPPER_IMPL_AVX_fFF _ZGVbN4vl4l4_sincosf
+END (_ZGVdN8vl4l4_sincosf)
+libmvec_hidden_def (_ZGVdN8vl4l4_sincosf)
+
+/* AVX2 ISA version as wrapper to SSE ISA version (for vector
+ function declared with #pragma omp declare simd notinbranch). */
+.macro WRAPPER_IMPL_AVX2_fFF_vvv callee
+#ifndef __ILP32__
+ pushq %rbp
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (%rbp, 0)
+ movq %rsp, %rbp
+ cfi_def_cfa_register (%rbp)
+ andq $-32, %rsp
+ subq $224, %rsp
+ vmovups %ymm0, 192(%rsp)
+ lea (%rsp), %rdi
+ vmovdqu %ymm1, 64(%rdi)
+ vmovdqu %ymm2, 96(%rdi)
+ vmovdqu %ymm3, 128(%rdi)
+ vmovdqu %ymm4, 160(%rdi)
+ lea 32(%rsp), %rsi
+ vzeroupper
+ call HIDDEN_JUMPTARGET(\callee)
+ vmovups 208(%rsp), %xmm0
+ lea 16(%rsp), %rdi
+ lea 48(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq 64(%rsp), %rdx
+ movq 72(%rsp), %rsi
+ movq 80(%rsp), %r8
+ movq 88(%rsp), %r10
+ movl (%rsp), %eax
+ movl 4(%rsp), %ecx
+ movl 8(%rsp), %edi
+ movl 12(%rsp), %r9d
+ movl %eax, (%rdx)
+ movl %ecx, (%rsi)
+ movq 96(%rsp), %rax
+ movq 104(%rsp), %rcx
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movq 112(%rsp), %rdi
+ movq 120(%rsp), %r9
+ movl 16(%rsp), %r11d
+ movl 20(%rsp), %edx
+ movl 24(%rsp), %esi
+ movl 28(%rsp), %r8d
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movq 128(%rsp), %r11
+ movq 136(%rsp), %rdx
+ movl %esi, (%rdi)
+ movl %r8d, (%r9)
+ movq 144(%rsp), %rsi
+ movq 152(%rsp), %r8
+ movl 32(%rsp), %r10d
+ movl 36(%rsp), %eax
+ movl 40(%rsp), %ecx
+ movl 44(%rsp), %edi
+ movl %r10d, (%r11)
+ movl %eax, (%rdx)
+ movq 160(%rsp), %r10
+ movq 168(%rsp), %rax
+ movl %ecx, (%rsi)
+ movl %edi, (%r8)
+ movq 176(%rsp), %rcx
+ movq 184(%rsp), %rdi
+ movl 48(%rsp), %r9d
+ movl 52(%rsp), %r11d
+ movl 56(%rsp), %edx
+ movl 60(%rsp), %esi
+ movl %r9d, (%r10)
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movl %esi, (%rdi)
+ movq %rbp, %rsp
+ cfi_def_cfa_register (%rsp)
+ popq %rbp
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (%rbp)
+ ret
+#else
+ leal 8(%rsp), %r10d
+ .cfi_def_cfa 10, 0
+ andl $-32, %esp
+ pushq -8(%r10d)
+ pushq %rbp
+ .cfi_escape 0x10,0x6,0x2,0x76,0
+ movl %esp, %ebp
+ pushq %r12
+ leal -80(%rbp), %esi
+ pushq %r10
+ .cfi_escape 0xf,0x3,0x76,0x70,0x6
+ .cfi_escape 0x10,0xc,0x2,0x76,0x78
+ leal -112(%rbp), %edi
+ movq %rsi, %r12
+ pushq %rbx
+ .cfi_escape 0x10,0x3,0x2,0x76,0x68
+ movq %rdi, %rbx
+ subl $184, %esp
+ vmovdqa %ymm1, -144(%ebp)
+ vmovdqa %ymm2, -176(%ebp)
+ vmovaps %ymm0, -208(%ebp)
+ vzeroupper
+ call HIDDEN_JUMPTARGET(\callee)
+ leal 16(%r12), %esi
+ vmovups -192(%ebp), %xmm0
+ leal 16(%rbx), %edi
+ call HIDDEN_JUMPTARGET(\callee)
+ movl -144(%ebp), %eax
+ vmovss -112(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -140(%ebp), %eax
+ vmovss -108(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -136(%ebp), %eax
+ vmovss -104(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -132(%ebp), %eax
+ vmovss -100(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -128(%ebp), %eax
+ vmovss -96(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -124(%ebp), %eax
+ vmovss -92(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -120(%ebp), %eax
+ vmovss -88(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -116(%ebp), %eax
+ vmovss -84(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -176(%ebp), %eax
+ vmovss -80(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -172(%ebp), %eax
+ vmovss -76(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -168(%ebp), %eax
+ vmovss -72(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -164(%ebp), %eax
+ vmovss -68(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -160(%ebp), %eax
+ vmovss -64(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -156(%ebp), %eax
+ vmovss -60(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -152(%ebp), %eax
+ vmovss -56(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ movl -148(%ebp), %eax
+ vmovss -52(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ addl $184, %esp
+ popq %rbx
+ popq %r10
+ .cfi_def_cfa 10, 0
+ popq %r12
+ popq %rbp
+ leal -8(%r10), %esp
+ .cfi_def_cfa 7, 8
+ ret
+#endif
+.endm
+
ENTRY (_ZGVdN8vvv_sincosf)
-WRAPPER_IMPL_AVX_fFF _ZGVbN4vvv_sincosf
+WRAPPER_IMPL_AVX2_fFF_vvv _ZGVbN4vl4l4_sincosf
END (_ZGVdN8vvv_sincosf)
#ifndef USE_MULTIARCH
diff --git a/sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S b/sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S
index 55b8b2d768..585e6d87c4 100644
--- a/sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S
@@ -1,5 +1,5 @@
/* Function sincosf vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,179 @@
#include "svml_s_wrapper_impl.h"
.text
-ENTRY(_ZGVcN8vvv_sincosf)
-WRAPPER_IMPL_AVX_fFF _ZGVbN4vvv_sincosf
-END(_ZGVcN8vvv_sincosf)
+ENTRY (_ZGVcN8vl4l4_sincosf)
+WRAPPER_IMPL_AVX_fFF _ZGVbN4vl4l4_sincosf
+END (_ZGVcN8vl4l4_sincosf)
+
+/* AVX ISA version as wrapper to SSE ISA version (for vector
+ function declared with #pragma omp declare simd notinbranch). */
+.macro WRAPPER_IMPL_AVX_fFF_vvv callee
+#ifndef __ILP32__
+ pushq %rbp
+ movq %rsp, %rbp
+ andq $-32, %rsp
+ subq $224, %rsp
+ vmovups %ymm0, 64(%rsp)
+ lea (%rsp), %rdi
+ vmovdqu %xmm1, 96(%rdi)
+ vmovdqu %xmm2, 112(%rdi)
+ vmovdqu %xmm3, 128(%rdi)
+ vmovdqu %xmm4, 144(%rdi)
+ vmovdqu %xmm5, 160(%rdi)
+ lea 32(%rsp), %rsi
+ vmovdqu %xmm6, 144(%rsi)
+ vmovdqu %xmm7, 160(%rsi)
+ vzeroupper
+ call HIDDEN_JUMPTARGET(\callee)
+ vmovdqu 80(%rsp), %xmm0
+ lea 16(%rsp), %rdi
+ lea 48(%rsp), %rsi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq 96(%rsp), %rdx
+ movq 104(%rsp), %rsi
+ movq 112(%rsp), %r8
+ movq 120(%rsp), %r10
+ movl (%rsp), %eax
+ movl 4(%rsp), %ecx
+ movl 8(%rsp), %edi
+ movl 12(%rsp), %r9d
+ movl %eax, (%rdx)
+ movl %ecx, (%rsi)
+ movq 128(%rsp), %rax
+ movq 136(%rsp), %rcx
+ movl %edi, (%r8)
+ movl %r9d, (%r10)
+ movq 144(%rsp), %rdi
+ movq 152(%rsp), %r9
+ movl 16(%rsp), %r11d
+ movl 20(%rsp), %edx
+ movl 24(%rsp), %esi
+ movl 28(%rsp), %r8d
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movq 160(%rsp), %r11
+ movq 168(%rsp), %rdx
+ movl %esi, (%rdi)
+ movl %r8d, (%r9)
+ movq 176(%rsp), %rsi
+ movq 184(%rsp), %r8
+ movl 32(%rsp), %r10d
+ movl 36(%rsp), %eax
+ movl 40(%rsp), %ecx
+ movl 44(%rsp), %edi
+ movl %r10d, (%r11)
+ movl %eax, (%rdx)
+ movq 192(%rsp), %r10
+ movq 200(%rsp), %rax
+ movl %ecx, (%rsi)
+ movl %edi, (%r8)
+ movq 16(%rbp), %rcx
+ movq 24(%rbp), %rdi
+ movl 48(%rsp), %r9d
+ movl 52(%rsp), %r11d
+ movl 56(%rsp), %edx
+ movl 60(%rsp), %esi
+ movl %r9d, (%r10)
+ movl %r11d, (%rax)
+ movl %edx, (%rcx)
+ movl %esi, (%rdi)
+ movq %rbp, %rsp
+ popq %rbp
+ ret
+#else
+ leal 8(%rsp), %r10d
+ .cfi_def_cfa 10, 0
+ andl $-32, %esp
+ pushq -8(%r10d)
+ pushq %rbp
+ .cfi_escape 0x10,0x6,0x2,0x76,0
+ movl %esp, %ebp
+ pushq %r12
+ leal -80(%rbp), %esi
+ pushq %r10
+ .cfi_escape 0xf,0x3,0x76,0x70,0x6
+ .cfi_escape 0x10,0xc,0x2,0x76,0x78
+ leal -112(%rbp), %edi
+ movq %rsi, %r12
+ pushq %rbx
+ .cfi_escape 0x10,0x3,0x2,0x76,0x68
+ movq %rdi, %rbx
+ subl $184, %esp
+ vmovaps %xmm1, -128(%ebp)
+ vmovaps %xmm2, -144(%ebp)
+ vmovaps %xmm3, -160(%ebp)
+ vmovaps %xmm4, -176(%ebp)
+ vmovaps %ymm0, -208(%ebp)
+ vzeroupper
+ call HIDDEN_JUMPTARGET(\callee)
+ leal 16(%r12), %esi
+ vmovups -192(%ebp), %xmm0
+ leal 16(%rbx), %edi
+ call HIDDEN_JUMPTARGET(\callee)
+ movq -128(%ebp), %rax
+ vmovss -112(%ebp), %xmm0
+ vmovdqa -128(%ebp), %xmm7
+ vmovdqa -144(%ebp), %xmm3
+ vmovss %xmm0, (%eax)
+ vmovss -108(%ebp), %xmm0
+ vpextrd $1, %xmm7, %eax
+ vmovss %xmm0, (%eax)
+ movq -120(%ebp), %rax
+ vmovss -104(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -100(%ebp), %xmm0
+ vpextrd $3, %xmm7, %eax
+ vmovdqa -160(%ebp), %xmm7
+ vmovss %xmm0, (%eax)
+ movq -144(%ebp), %rax
+ vmovss -96(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -92(%ebp), %xmm0
+ vpextrd $1, %xmm3, %eax
+ vmovss %xmm0, (%eax)
+ movq -136(%ebp), %rax
+ vmovss -88(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -84(%ebp), %xmm0
+ vpextrd $3, %xmm3, %eax
+ vmovss %xmm0, (%eax)
+ movq -160(%ebp), %rax
+ vmovss -80(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -76(%ebp), %xmm0
+ vpextrd $1, %xmm7, %eax
+ vmovss %xmm0, (%eax)
+ movq -152(%ebp), %rax
+ vmovss -72(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -68(%ebp), %xmm0
+ vpextrd $3, %xmm7, %eax
+ vmovss %xmm0, (%eax)
+ movq -176(%ebp), %rax
+ vmovss -64(%ebp), %xmm0
+ vmovdqa -176(%ebp), %xmm3
+ vmovss %xmm0, (%eax)
+ vmovss -60(%ebp), %xmm0
+ vpextrd $1, %xmm3, %eax
+ vmovss %xmm0, (%eax)
+ movq -168(%ebp), %rax
+ vmovss -56(%ebp), %xmm0
+ vmovss %xmm0, (%eax)
+ vmovss -52(%ebp), %xmm0
+ vpextrd $3, %xmm3, %eax
+ vmovss %xmm0, (%eax)
+ addl $184, %esp
+ popq %rbx
+ popq %r10
+ .cfi_def_cfa 10, 0
+ popq %r12
+ popq %rbp
+ leal -8(%r10), %esp
+ .cfi_def_cfa 7, 8
+ ret
+#endif
+.endm
+
+ENTRY (_ZGVcN8vvv_sincosf)
+WRAPPER_IMPL_AVX_fFF_vvv _ZGVbN4vl4l4_sincosf
+END (_ZGVcN8vvv_sincosf)
diff --git a/sysdeps/x86_64/fpu/svml_s_sinf16_core.S b/sysdeps/x86_64/fpu/svml_s_sinf16_core.S
index d7a31e1ea6..8c5547e26f 100644
--- a/sysdeps/x86_64/fpu/svml_s_sinf16_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_sinf16_core.S
@@ -1,5 +1,5 @@
/* Function sinf vectorized with AVX-512. Wrapper to AVX2 version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_sinf4_core.S b/sysdeps/x86_64/fpu/svml_s_sinf4_core.S
index 6f10137134..d56137b32a 100644
--- a/sysdeps/x86_64/fpu/svml_s_sinf4_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_sinf4_core.S
@@ -1,5 +1,5 @@
/* Function sinf vectorized with SSE2.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_sinf8_core.S b/sysdeps/x86_64/fpu/svml_s_sinf8_core.S
index c459658688..e39392243e 100644
--- a/sysdeps/x86_64/fpu/svml_s_sinf8_core.S
+++ b/sysdeps/x86_64/fpu/svml_s_sinf8_core.S
@@ -1,5 +1,5 @@
/* Function sinf vectorized with AVX2, wrapper version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_sinf8_core_avx.S b/sysdeps/x86_64/fpu/svml_s_sinf8_core_avx.S
index 5e95aa2e02..9984e6f9f7 100644
--- a/sysdeps/x86_64/fpu/svml_s_sinf8_core_avx.S
+++ b/sysdeps/x86_64/fpu/svml_s_sinf8_core_avx.S
@@ -1,5 +1,5 @@
/* Function sinf vectorized in AVX ISA as wrapper to SSE4 ISA version.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_trig_data.S b/sysdeps/x86_64/fpu/svml_s_trig_data.S
index b61aa6abb9..8f1e1f60b8 100644
--- a/sysdeps/x86_64/fpu/svml_s_trig_data.S
+++ b/sysdeps/x86_64/fpu/svml_s_trig_data.S
@@ -1,5 +1,5 @@
/* Data for function cosf.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_trig_data.h b/sysdeps/x86_64/fpu/svml_s_trig_data.h
index 2e469a918a..0faf161c08 100644
--- a/sysdeps/x86_64/fpu/svml_s_trig_data.h
+++ b/sysdeps/x86_64/fpu/svml_s_trig_data.h
@@ -1,5 +1,5 @@
/* Offsets for data table for vectorized sinf, cosf, sincosf.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/fpu/svml_s_wrapper_impl.h b/sysdeps/x86_64/fpu/svml_s_wrapper_impl.h
index b1a03be3d9..937afb5cbc 100644
--- a/sysdeps/x86_64/fpu/svml_s_wrapper_impl.h
+++ b/sysdeps/x86_64/fpu/svml_s_wrapper_impl.h
@@ -1,5 +1,5 @@
/* Wrapper implementations of vector math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,16 +21,16 @@
subq $40, %rsp
cfi_adjust_cfa_offset(40)
movaps %xmm0, (%rsp)
- call \callee@PLT
+ call JUMPTARGET(\callee)
movss %xmm0, 16(%rsp)
movss 4(%rsp), %xmm0
- call \callee@PLT
+ call JUMPTARGET(\callee)
movss %xmm0, 20(%rsp)
movss 8(%rsp), %xmm0
- call \callee@PLT
+ call JUMPTARGET(\callee)
movss %xmm0, 24(%rsp)
movss 12(%rsp), %xmm0
- call \callee@PLT
+ call JUMPTARGET(\callee)
movss 16(%rsp), %xmm3
movss 20(%rsp), %xmm2
movss 24(%rsp), %xmm1
@@ -50,19 +50,19 @@
cfi_adjust_cfa_offset(56)
movaps %xmm0, (%rsp)
movaps %xmm1, 16(%rsp)
- call \callee@PLT
+ call JUMPTARGET(\callee)
movss %xmm0, 32(%rsp)
movss 4(%rsp), %xmm0
movss 20(%rsp), %xmm1
- call \callee@PLT
+ call JUMPTARGET(\callee)
movss %xmm0, 36(%rsp)
movss 8(%rsp), %xmm0
movss 24(%rsp), %xmm1
- call \callee@PLT
+ call JUMPTARGET(\callee)
movss %xmm0, 40(%rsp)
movss 12(%rsp), %xmm0
movss 28(%rsp), %xmm1
- call \callee@PLT
+ call JUMPTARGET(\callee)
movss 32(%rsp), %xmm3
movss 36(%rsp), %xmm2
movss 40(%rsp), %xmm1
@@ -91,7 +91,7 @@
leaq 24(%rsp), %rsi
leaq 28(%rsp), %rdi
movaps %xmm0, (%rsp)
- call \callee@PLT
+ call JUMPTARGET(\callee)
leaq 24(%rsp), %rsi
leaq 28(%rsp), %rdi
movss 28(%rsp), %xmm0
@@ -101,7 +101,7 @@
movss %xmm0, (%rbx)
movaps %xmm1, %xmm0
shufps $85, %xmm1, %xmm0
- call \callee@PLT
+ call JUMPTARGET(\callee)
movss 28(%rsp), %xmm0
leaq 24(%rsp), %rsi
movss %xmm0, 4(%rbp)
@@ -111,7 +111,7 @@
movss %xmm0, 4(%rbx)
movaps %xmm1, %xmm0
unpckhps %xmm1, %xmm0
- call \callee@PLT
+ call JUMPTARGET(\callee)
movaps (%rsp), %xmm1
leaq 24(%rsp), %rsi
leaq 28(%rsp), %rdi
@@ -121,7 +121,7 @@
movss 24(%rsp), %xmm0
movss %xmm0, 8(%rbx)
movaps %xmm1, %xmm0
- call \callee@PLT
+ call JUMPTARGET(\callee)
movss 28(%rsp), %xmm0
movss %xmm0, 12(%rbp)
movss 24(%rsp), %xmm0
@@ -246,29 +246,14 @@
cfi_def_cfa_register (%rbp)
andq $-64, %rsp
subq $128, %rsp
-/* Below is encoding for vmovups %zmm0, (%rsp). */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x11
- .byte 0x04
- .byte 0x24
+ vmovups %zmm0, (%rsp)
vmovupd (%rsp), %ymm0
call HIDDEN_JUMPTARGET(\callee)
vmovupd %ymm0, 64(%rsp)
vmovupd 32(%rsp), %ymm0
call HIDDEN_JUMPTARGET(\callee)
vmovupd %ymm0, 96(%rsp)
-/* Below is encoding for vmovups 64(%rsp), %zmm0. */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x10
- .byte 0x44
- .byte 0x24
- .byte 0x01
+ vmovups 64(%rsp), %zmm0
movq %rbp, %rsp
cfi_def_cfa_register (%rsp)
popq %rbp
@@ -286,23 +271,8 @@
cfi_def_cfa_register (%rbp)
andq $-64, %rsp
subq $192, %rsp
-/* Below is encoding for vmovups %zmm0, (%rsp). */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x11
- .byte 0x04
- .byte 0x24
-/* Below is encoding for vmovups %zmm1, 64(%rsp). */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x11
- .byte 0x4c
- .byte 0x24
- .byte 0x01
+ vmovups %zmm0, (%rsp)
+ vmovups %zmm1, 64(%rsp)
vmovups (%rsp), %ymm0
vmovups 64(%rsp), %ymm1
call HIDDEN_JUMPTARGET(\callee)
@@ -311,15 +281,7 @@
vmovups 96(%rsp), %ymm1
call HIDDEN_JUMPTARGET(\callee)
vmovups %ymm0, 160(%rsp)
-/* Below is encoding for vmovups 128(%rsp), %zmm0. */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x10
- .byte 0x44
- .byte 0x24
- .byte 0x02
+ vmovups 128(%rsp), %zmm0
movq %rbp, %rsp
cfi_def_cfa_register (%rsp)
popq %rbp
@@ -340,14 +302,7 @@
pushq %r13
subq $176, %rsp
movq %rsi, %r13
-/* Below is encoding for vmovaps %zmm0, (%rsp). */
- .byte 0x62
- .byte 0xf1
- .byte 0x7c
- .byte 0x48
- .byte 0x29
- .byte 0x04
- .byte 0x24
+ vmovaps %zmm0, (%rsp)
movq %rdi, %r12
vmovaps (%rsp), %ymm0
call HIDDEN_JUMPTARGET(\callee)
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx-main.c
new file mode 100644
index 0000000000..43914ef0e7
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx-main.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx-mod.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx-mod.c
new file mode 100644
index 0000000000..514883dcf9
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx-mod.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-alias-mod.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx.c
new file mode 100644
index 0000000000..43914ef0e7
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2-main.c
new file mode 100644
index 0000000000..43914ef0e7
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2-main.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2-mod.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2-mod.c
new file mode 100644
index 0000000000..514883dcf9
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2-mod.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-alias-mod.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2.c
new file mode 100644
index 0000000000..43914ef0e7
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx2.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512-main.c
new file mode 100644
index 0000000000..43914ef0e7
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512-main.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512-mod.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512-mod.c
new file mode 100644
index 0000000000..514883dcf9
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512-mod.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-alias-mod.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512.c
new file mode 100644
index 0000000000..43914ef0e7
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-avx512.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-main.c
new file mode 100644
index 0000000000..43914ef0e7
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-main.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias-mod.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias-mod.c
new file mode 100644
index 0000000000..6f2e588021
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias-mod.c
@@ -0,0 +1,25 @@
+/* Part of test to build shared library to ensure link against
+ *_finite aliases from libmvec.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <math-tests-arch.h>
+
+#include "test-double.h"
+#include "test-libmvec-alias-mod.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-alias.c b/sysdeps/x86_64/fpu/test-double-libmvec-alias.c
new file mode 100644
index 0000000000..d38b49d6c8
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-alias.c
@@ -0,0 +1,29 @@
+/* Part of test to ensure link against *_finite aliases from libmvec.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+extern int
+test_finite_alias (void);
+
+static int
+do_test (void)
+{
+ return test_finite_alias ();
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../../../test-skeleton.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx-main.c
new file mode 100644
index 0000000000..fc2ffea314
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx-main.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-sincos-main.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c
new file mode 100644
index 0000000000..896f1bcbaf
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-sincos.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2-main.c
new file mode 100644
index 0000000000..fc2ffea314
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2-main.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-sincos-main.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c
new file mode 100644
index 0000000000..896f1bcbaf
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-sincos.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512-main.c
new file mode 100644
index 0000000000..fc2ffea314
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512-main.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-sincos-main.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c
new file mode 100644
index 0000000000..896f1bcbaf
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c
@@ -0,0 +1 @@
+#include "test-double-libmvec-sincos.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c
new file mode 100644
index 0000000000..2e52fddf5d
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c
@@ -0,0 +1,43 @@
+/* Test for vector sincos ABI.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define N 1000
+double x[N], s[N], c[N];
+double* s_ptrs[N];
+double* c_ptrs[N];
+
+int
+test_sincos_abi (void)
+{
+ int i;
+
+ for(i = 0; i < N; i++)
+ {
+ x[i] = i / 3;
+ s_ptrs[i] = &s[i];
+ c_ptrs[i] = &c[i];
+ }
+
+#pragma omp simd
+ for(i = 0; i < N; i++)
+ sincos (x[i], s_ptrs[i], c_ptrs[i]);
+
+ return 0;
+}
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c
new file mode 100644
index 0000000000..cffaa73135
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c
@@ -0,0 +1,44 @@
+/* Test for vector sincos ABI.
+ Copyright (C) 2016-2018 Free Software 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-tests-arch.h>
+
+extern int test_sincos_abi (void);
+
+int arch_check = 1;
+
+static void
+check_arch (void)
+{
+ CHECK_ARCH_EXT;
+ arch_check = 0;
+}
+
+static int
+do_test (void)
+{
+ check_arch ();
+
+ if (arch_check)
+ return 77;
+
+ return test_sincos_abi ();
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../../../test-skeleton.c"
diff --git a/sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c b/sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c
index a9d15979aa..4ff1439f9c 100644
--- a/sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c
+++ b/sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c
@@ -1,5 +1,5 @@
/* Wrapper part of tests for SSE ISA versions of vector math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,13 +17,17 @@
<http://www.gnu.org/licenses/>. */
#include "test-double-vlen2.h"
+#include "test-math-vector-sincos.h"
#include <immintrin.h>
#define VEC_TYPE __m128d
VECTOR_WRAPPER (WRAPPER_NAME (cos), _ZGVbN2v_cos)
VECTOR_WRAPPER (WRAPPER_NAME (sin), _ZGVbN2v_sin)
-VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincos), _ZGVbN2vvv_sincos)
VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVbN2v_log)
VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVbN2v_exp)
VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVbN2vv_pow)
+
+#define VEC_INT_TYPE __m128i
+
+VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincos), _ZGVbN2vvv_sincos)
diff --git a/sysdeps/x86_64/fpu/test-double-vlen2.c b/sysdeps/x86_64/fpu/test-double-vlen2.c
deleted file mode 100644
index c7a3dff747..0000000000
--- a/sysdeps/x86_64/fpu/test-double-vlen2.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Tests for SSE ISA versions of vector math functions.
- Copyright (C) 2014-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 "test-double-vlen2.h"
-
-#define TEST_VECTOR_cos 1
-#define TEST_VECTOR_sin 1
-#define TEST_VECTOR_sincos 1
-#define TEST_VECTOR_log 1
-#define TEST_VECTOR_exp 1
-#define TEST_VECTOR_pow 1
-
-#include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c b/sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c
index eb6a531502..c7bdad517b 100644
--- a/sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c
+++ b/sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c
@@ -1,5 +1,5 @@
/* Wrapper part of tests for AVX2 ISA versions of vector math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include "test-double-vlen4.h"
+#include "test-math-vector-sincos.h"
#include <immintrin.h>
#undef VEC_SUFF
@@ -26,7 +27,14 @@
VECTOR_WRAPPER (WRAPPER_NAME (cos), _ZGVdN4v_cos)
VECTOR_WRAPPER (WRAPPER_NAME (sin), _ZGVdN4v_sin)
-VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincos), _ZGVdN4vvv_sincos)
VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVdN4v_log)
VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVdN4v_exp)
VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVdN4vv_pow)
+
+#ifndef __ILP32__
+# define VEC_INT_TYPE __m256i
+#else
+# define VEC_INT_TYPE __m128i
+#endif
+
+VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincos), _ZGVdN4vvv_sincos)
diff --git a/sysdeps/x86_64/fpu/test-double-vlen4-avx2.c b/sysdeps/x86_64/fpu/test-double-vlen4-avx2.c
deleted file mode 100644
index 0cadef03d6..0000000000
--- a/sysdeps/x86_64/fpu/test-double-vlen4-avx2.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Tests for AVX2 ISA versions of vector math functions.
- Copyright (C) 2014-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 "test-double-vlen4.h"
-
-#undef VEC_SUFF
-#define VEC_SUFF _vlen4_avx2
-
-#define TEST_VECTOR_cos 1
-#define TEST_VECTOR_sin 1
-#define TEST_VECTOR_sincos 1
-#define TEST_VECTOR_log 1
-#define TEST_VECTOR_exp 1
-#define TEST_VECTOR_pow 1
-
-#define REQUIRE_AVX2
-
-#include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-double-vlen4-avx2.h b/sysdeps/x86_64/fpu/test-double-vlen4-avx2.h
new file mode 100644
index 0000000000..4b196e66fc
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-vlen4-avx2.h
@@ -0,0 +1,25 @@
+/* Tests for AVX2 ISA versions of vector math functions.
+ Copyright (C) 2014-2018 Free Software 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 <test-double-vlen4.h>
+
+#undef VEC_SUFF
+#define VEC_SUFF _vlen4_avx2
+
+#undef REQUIRE_AVX
+#define REQUIRE_AVX2
diff --git a/sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c b/sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c
index 52b81da3ee..2bb0085700 100644
--- a/sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c
+++ b/sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c
@@ -1,5 +1,5 @@
/* Wrapper part of tests for AVX ISA versions of vector math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,13 +17,21 @@
<http://www.gnu.org/licenses/>. */
#include "test-double-vlen4.h"
+#include "test-math-vector-sincos.h"
#include <immintrin.h>
#define VEC_TYPE __m256d
VECTOR_WRAPPER (WRAPPER_NAME (cos), _ZGVcN4v_cos)
VECTOR_WRAPPER (WRAPPER_NAME (sin), _ZGVcN4v_sin)
-VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincos), _ZGVcN4vvv_sincos)
VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVcN4v_log)
VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVcN4v_exp)
VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVcN4vv_pow)
+
+#define VEC_INT_TYPE __m128i
+
+#ifndef __ILP32__
+VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincos), _ZGVcN4vvv_sincos)
+#else
+VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincos), _ZGVcN4vvv_sincos)
+#endif
diff --git a/sysdeps/x86_64/fpu/test-double-vlen4.c b/sysdeps/x86_64/fpu/test-double-vlen4.c
deleted file mode 100644
index 9ae97f1388..0000000000
--- a/sysdeps/x86_64/fpu/test-double-vlen4.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Tests for AVX ISA versions of vector math functions.
- Copyright (C) 2014-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 "test-double-vlen4.h"
-
-#define TEST_VECTOR_cos 1
-#define TEST_VECTOR_sin 1
-#define TEST_VECTOR_sincos 1
-#define TEST_VECTOR_log 1
-#define TEST_VECTOR_exp 1
-#define TEST_VECTOR_pow 1
-
-#define REQUIRE_AVX
-
-#include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-double-vlen4.h b/sysdeps/x86_64/fpu/test-double-vlen4.h
new file mode 100644
index 0000000000..316340cb59
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-vlen4.h
@@ -0,0 +1,21 @@
+/* Tests for AVX ISA versions of vector math functions.
+ Copyright (C) 2014-2018 Free Software 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_next <test-double-vlen4.h>
+
+#define REQUIRE_AVX
diff --git a/sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c b/sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c
index c10bb9cb4a..ea179284ed 100644
--- a/sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c
+++ b/sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c
@@ -1,5 +1,5 @@
/* Wrapper part of tests for AVX-512 versions of vector math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,13 +17,21 @@
<http://www.gnu.org/licenses/>. */
#include "test-double-vlen8.h"
+#include "test-math-vector-sincos.h"
#include <immintrin.h>
#define VEC_TYPE __m512d
VECTOR_WRAPPER (WRAPPER_NAME (cos), _ZGVeN8v_cos)
VECTOR_WRAPPER (WRAPPER_NAME (sin), _ZGVeN8v_sin)
-VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincos), _ZGVeN8vvv_sincos)
VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVeN8v_log)
VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVeN8v_exp)
VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVeN8vv_pow)
+
+#ifndef __ILP32__
+# define VEC_INT_TYPE __m512i
+#else
+# define VEC_INT_TYPE __m256i
+#endif
+
+VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincos), _ZGVeN8vvv_sincos)
diff --git a/sysdeps/x86_64/fpu/test-double-vlen8.c b/sysdeps/x86_64/fpu/test-double-vlen8.c
deleted file mode 100644
index 4fb6c8d196..0000000000
--- a/sysdeps/x86_64/fpu/test-double-vlen8.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Tests for AVX-512 versions of vector math functions.
- Copyright (C) 2014-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 "test-double-vlen8.h"
-
-#define TEST_VECTOR_cos 1
-#define TEST_VECTOR_sin 1
-#define TEST_VECTOR_sincos 1
-#define TEST_VECTOR_log 1
-#define TEST_VECTOR_exp 1
-#define TEST_VECTOR_pow 1
-
-#define REQUIRE_AVX512F
-
-#include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-double-vlen8.h b/sysdeps/x86_64/fpu/test-double-vlen8.h
new file mode 100644
index 0000000000..41d188081e
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-double-vlen8.h
@@ -0,0 +1,21 @@
+/* Tests for AVX-512 versions of vector math functions.
+ Copyright (C) 2014-2018 Free Software 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_next <test-double-vlen8.h>
+
+#define REQUIRE_AVX512F
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx-main.c
new file mode 100644
index 0000000000..f3691cc8e6
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx-main.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx-mod.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx-mod.c
new file mode 100644
index 0000000000..7fc3d8aedd
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx-mod.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-alias-mod.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx.c
new file mode 100644
index 0000000000..f3691cc8e6
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2-main.c
new file mode 100644
index 0000000000..f3691cc8e6
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2-main.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2-mod.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2-mod.c
new file mode 100644
index 0000000000..7fc3d8aedd
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2-mod.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-alias-mod.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2.c
new file mode 100644
index 0000000000..f3691cc8e6
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx2.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512-main.c
new file mode 100644
index 0000000000..f3691cc8e6
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512-main.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512-mod.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512-mod.c
new file mode 100644
index 0000000000..7fc3d8aedd
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512-mod.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-alias-mod.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512.c
new file mode 100644
index 0000000000..f3691cc8e6
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-avx512.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-main.c
new file mode 100644
index 0000000000..f3691cc8e6
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-main.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-alias.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias-mod.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias-mod.c
new file mode 100644
index 0000000000..5e6a587a94
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias-mod.c
@@ -0,0 +1,25 @@
+/* Part of test to build shared library to ensure link against
+ *_finite aliases from libmvec.
+ Copyright (C) 2016-2018 Free Software 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 <stdlib.h>
+#include <math-tests-arch.h>
+
+#include "test-float.h"
+#include "test-libmvec-alias-mod.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-alias.c b/sysdeps/x86_64/fpu/test-float-libmvec-alias.c
new file mode 100644
index 0000000000..d38b49d6c8
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-alias.c
@@ -0,0 +1,29 @@
+/* Part of test to ensure link against *_finite aliases from libmvec.
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+extern int
+test_finite_alias (void);
+
+static int
+do_test (void)
+{
+ return test_finite_alias ();
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../../../test-skeleton.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx-main.c
new file mode 100644
index 0000000000..558e2ac649
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx-main.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-sincosf-main.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c
new file mode 100644
index 0000000000..5b45f0a055
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-sincosf.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2-main.c
new file mode 100644
index 0000000000..558e2ac649
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2-main.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-sincosf-main.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c
new file mode 100644
index 0000000000..5b45f0a055
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-sincosf.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512-main.c
new file mode 100644
index 0000000000..558e2ac649
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512-main.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-sincosf-main.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c
new file mode 100644
index 0000000000..5b45f0a055
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c
@@ -0,0 +1 @@
+#include "test-float-libmvec-sincosf.c"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c
new file mode 100644
index 0000000000..ce1dd1a8a4
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c
@@ -0,0 +1,42 @@
+/* Test for vector sincosf ABI.
+ Copyright (C) 2016-2018 Free Software 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>
+
+#define N 1000
+float x[N], s[N], c[N];
+float *s_ptrs[N];
+float *c_ptrs[N];
+
+int
+test_sincosf_abi (void)
+{
+ int i;
+ for(i = 0; i < N; i++)
+ {
+ x[i] = i / 3;
+ s_ptrs[i] = &s[i];
+ c_ptrs[i] = &c[i];
+ }
+
+#pragma omp simd
+ for(i = 0; i < N; i++)
+ sincosf (x[i], s_ptrs[i], c_ptrs[i]);
+
+ return 0;
+}
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c
new file mode 100644
index 0000000000..a56d9680a0
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c
@@ -0,0 +1,44 @@
+/* Test for vector sincosf ABI.
+ Copyright (C) 2016-2018 Free Software 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-tests-arch.h>
+
+extern int test_sincosf_abi (void);
+
+int arch_check = 1;
+
+static void
+check_arch (void)
+{
+ CHECK_ARCH_EXT;
+ arch_check = 0;
+}
+
+static int
+do_test (void)
+{
+ check_arch ();
+
+ if (arch_check)
+ return 77;
+
+ return test_sincosf_abi ();
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../../../test-skeleton.c"
diff --git a/sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c b/sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c
index dc09e4a338..d2a81ecf53 100644
--- a/sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c
+++ b/sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c
@@ -1,5 +1,5 @@
/* Wrapper part of tests for AVX-512 ISA versions of vector math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,13 +17,21 @@
<http://www.gnu.org/licenses/>. */
#include "test-float-vlen16.h"
+#include "test-math-vector-sincos.h"
#include <immintrin.h>
#define VEC_TYPE __m512
VECTOR_WRAPPER (WRAPPER_NAME (cosf), _ZGVeN16v_cosf)
VECTOR_WRAPPER (WRAPPER_NAME (sinf), _ZGVeN16v_sinf)
-VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincosf), _ZGVeN16vvv_sincosf)
VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVeN16v_logf)
VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVeN16v_expf)
VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVeN16vv_powf)
+
+#define VEC_INT_TYPE __m512i
+
+#ifndef __ILP32__
+VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincosf), _ZGVeN16vvv_sincosf)
+#else
+VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincosf), _ZGVeN16vvv_sincosf)
+#endif
diff --git a/sysdeps/x86_64/fpu/test-float-vlen16.c b/sysdeps/x86_64/fpu/test-float-vlen16.c
deleted file mode 100644
index 882bfc840d..0000000000
--- a/sysdeps/x86_64/fpu/test-float-vlen16.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Tests for AVX-512 ISA versions of vector math functions.
- Copyright (C) 2014-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 "test-float-vlen16.h"
-
-#define TEST_VECTOR_cosf 1
-#define TEST_VECTOR_sinf 1
-#define TEST_VECTOR_sincosf 1
-#define TEST_VECTOR_logf 1
-#define TEST_VECTOR_expf 1
-#define TEST_VECTOR_powf 1
-
-#define REQUIRE_AVX512F
-
-#include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-float-vlen16.h b/sysdeps/x86_64/fpu/test-float-vlen16.h
new file mode 100644
index 0000000000..ffe27866b5
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-vlen16.h
@@ -0,0 +1,21 @@
+/* Tests for AVX-512 ISA versions of vector math functions.
+ Copyright (C) 2014-2018 Free Software 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_next <test-float-vlen16.h>
+
+#define REQUIRE_AVX512F
diff --git a/sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c b/sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c
index 0bb9818146..afa7da26f6 100644
--- a/sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c
+++ b/sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c
@@ -1,5 +1,5 @@
/* Wrapper part of tests for SSE ISA versions of vector math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,13 +17,21 @@
<http://www.gnu.org/licenses/>. */
#include "test-float-vlen4.h"
+#include "test-math-vector-sincos.h"
#include <immintrin.h>
#define VEC_TYPE __m128
VECTOR_WRAPPER (WRAPPER_NAME (cosf), _ZGVbN4v_cosf)
VECTOR_WRAPPER (WRAPPER_NAME (sinf), _ZGVbN4v_sinf)
-VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincosf), _ZGVbN4vvv_sincosf)
VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVbN4v_logf)
VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVbN4v_expf)
VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVbN4vv_powf)
+
+#define VEC_INT_TYPE __m128i
+
+#ifndef __ILP32__
+VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincosf), _ZGVbN4vvv_sincosf)
+#else
+VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincosf), _ZGVbN4vvv_sincosf)
+#endif
diff --git a/sysdeps/x86_64/fpu/test-float-vlen4.c b/sysdeps/x86_64/fpu/test-float-vlen4.c
deleted file mode 100644
index f6a4cf5c1e..0000000000
--- a/sysdeps/x86_64/fpu/test-float-vlen4.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Tests for SSE ISA versions of vector math functions.
- Copyright (C) 2014-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 "test-float-vlen4.h"
-
-#define TEST_VECTOR_cosf 1
-#define TEST_VECTOR_sinf 1
-#define TEST_VECTOR_sincosf 1
-#define TEST_VECTOR_logf 1
-#define TEST_VECTOR_expf 1
-#define TEST_VECTOR_powf 1
-
-#include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c b/sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c
index 4985ac2379..d7e79a3f37 100644
--- a/sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c
+++ b/sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c
@@ -1,5 +1,5 @@
/* Wrapper part of tests for AVX2 ISA versions of vector math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include "test-float-vlen8.h"
+#include "test-math-vector-sincos.h"
#include <immintrin.h>
#undef VEC_SUFF
@@ -26,7 +27,17 @@
VECTOR_WRAPPER (WRAPPER_NAME (cosf), _ZGVdN8v_cosf)
VECTOR_WRAPPER (WRAPPER_NAME (sinf), _ZGVdN8v_sinf)
-VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincosf), _ZGVdN8vvv_sincosf)
VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVdN8v_logf)
VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVdN8v_expf)
VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVdN8vv_powf)
+
+/* Redefinition of wrapper to be compatible with _ZGVdN8vvv_sincosf. */
+#undef VECTOR_WRAPPER_fFF
+
+#define VEC_INT_TYPE __m256i
+
+#ifndef __ILP32__
+VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincosf), _ZGVdN8vvv_sincosf)
+#else
+VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincosf), _ZGVdN8vvv_sincosf)
+#endif
diff --git a/sysdeps/x86_64/fpu/test-float-vlen8-avx2.c b/sysdeps/x86_64/fpu/test-float-vlen8-avx2.c
deleted file mode 100644
index 7a416385b6..0000000000
--- a/sysdeps/x86_64/fpu/test-float-vlen8-avx2.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Tests for AVX2 ISA versions of vector math functions.
- Copyright (C) 2014-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 "test-float-vlen8.h"
-
-#undef VEC_SUFF
-#define VEC_SUFF _vlen8_avx2
-
-#define TEST_VECTOR_cosf 1
-#define TEST_VECTOR_sinf 1
-#define TEST_VECTOR_sincosf 1
-#define TEST_VECTOR_logf 1
-#define TEST_VECTOR_expf 1
-#define TEST_VECTOR_powf 1
-
-#define REQUIRE_AVX2
-
-#include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-float-vlen8-avx2.h b/sysdeps/x86_64/fpu/test-float-vlen8-avx2.h
new file mode 100644
index 0000000000..c468dd6e69
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-vlen8-avx2.h
@@ -0,0 +1,25 @@
+/* Tests for AVX2 ISA versions of vector math functions.
+ Copyright (C) 2014-2018 Free Software 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 <test-float-vlen8.h>
+
+#undef VEC_SUFF
+#define VEC_SUFF _vlen8_avx2
+
+#undef REQUIRE_AVX
+#define REQUIRE_AVX2
diff --git a/sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c b/sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c
index 9cc2883399..6f7869ba3d 100644
--- a/sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c
+++ b/sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c
@@ -1,5 +1,5 @@
/* Wrapper part of tests for AVX ISA versions of vector math functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2018 Free Software 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,13 +17,21 @@
<http://www.gnu.org/licenses/>. */
#include "test-float-vlen8.h"
+#include "test-math-vector-sincos.h"
#include <immintrin.h>
#define VEC_TYPE __m256
VECTOR_WRAPPER (WRAPPER_NAME (cosf), _ZGVcN8v_cosf)
VECTOR_WRAPPER (WRAPPER_NAME (sinf), _ZGVcN8v_sinf)
-VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincosf), _ZGVcN8vvv_sincosf)
VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVcN8v_logf)
VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVcN8v_expf)
VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVcN8vv_powf)
+
+#define VEC_INT_TYPE __m128i
+
+#ifndef __ILP32__
+VECTOR_WRAPPER_fFF_4 (WRAPPER_NAME (sincosf), _ZGVcN8vvv_sincosf)
+#else
+VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincosf), _ZGVcN8vvv_sincosf)
+#endif
diff --git a/sysdeps/x86_64/fpu/test-float-vlen8.c b/sysdeps/x86_64/fpu/test-float-vlen8.c
deleted file mode 100644
index c92a50ae7e..0000000000
--- a/sysdeps/x86_64/fpu/test-float-vlen8.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Tests for AVX ISA versions of vector math functions.
- Copyright (C) 2014-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 "test-float-vlen8.h"
-
-#define TEST_VECTOR_cosf 1
-#define TEST_VECTOR_sinf 1
-#define TEST_VECTOR_sincosf 1
-#define TEST_VECTOR_logf 1
-#define TEST_VECTOR_expf 1
-#define TEST_VECTOR_powf 1
-
-#define REQUIRE_AVX
-
-#include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-float-vlen8.h b/sysdeps/x86_64/fpu/test-float-vlen8.h
new file mode 100644
index 0000000000..153820ecc2
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-float-vlen8.h
@@ -0,0 +1,21 @@
+/* Tests for AVX ISA versions of vector math functions.
+ Copyright (C) 2014-2018 Free Software 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_next <test-float-vlen8.h>
+
+#define REQUIRE_AVX
diff --git a/sysdeps/x86_64/fpu/test-libmvec-alias-mod.c b/sysdeps/x86_64/fpu/test-libmvec-alias-mod.c
new file mode 100644
index 0000000000..6d70844147
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-libmvec-alias-mod.c
@@ -0,0 +1,66 @@
+/* Part of test to build shared library to ensure link against
+ *_finite aliases from libmvec.
+ Copyright (C) 2016-2018 Free Software 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 N 4000
+FLOAT log_arg[N];
+FLOAT exp_arg[N];
+FLOAT log_res[N];
+FLOAT exp_res[N];
+FLOAT pow_res[N];
+int arch_check = 1;
+
+static void
+init_arg (void)
+{
+ int i;
+
+ CHECK_ARCH_EXT;
+
+ arch_check = 0;
+
+ for (i = 0; i < N; i += 1)
+ {
+ log_arg[i] = 1.0;
+ exp_arg[i] = 0.0;
+ }
+}
+
+int
+test_finite_alias (void)
+{
+ int i;
+
+ init_arg ();
+
+ if (arch_check) return 77;
+
+#pragma omp simd
+ for (i = 0; i < N; i += 1)
+ {
+ log_res[i] = FUNC (log) (log_arg[i]);
+ exp_res[i] = FUNC (exp) (exp_arg[i]);
+ pow_res[i] = FUNC (pow) (log_arg[i], log_arg[i]);
+ }
+
+ if (log_res[0] != 0.0) return 1;
+ if (exp_res[0] != 1.0) return 1;
+ if (pow_res[0] != 1.0) return 1;
+
+ return 0;
+}
diff --git a/sysdeps/x86_64/fpu/x86_64-math-asm.h b/sysdeps/x86_64/fpu/x86_64-math-asm.h
index db3f9f78b0..597b967b7b 100644
--- a/sysdeps/x86_64/fpu/x86_64-math-asm.h
+++ b/sysdeps/x86_64/fpu/x86_64-math-asm.h
@@ -1,5 +1,5 @@
/* Helper macros for x86_64 libm functions.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/hp-timing.h b/sysdeps/x86_64/hp-timing.h
index 65381b314d..ec543bef03 100644
--- a/sysdeps/x86_64/hp-timing.h
+++ b/sysdeps/x86_64/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. x86-64 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/htonl.S b/sysdeps/x86_64/htonl.S
index c92fae8791..23e2046caa 100644
--- a/sysdeps/x86_64/htonl.S
+++ b/sysdeps/x86_64/htonl.S
@@ -1,5 +1,5 @@
/* Change byte order in word. For AMD x86-64.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/ifuncmain8.c b/sysdeps/x86_64/ifuncmain8.c
index 448ab96bfa..449998df50 100644
--- a/sysdeps/x86_64/ifuncmain8.c
+++ b/sysdeps/x86_64/ifuncmain8.c
@@ -1,5 +1,5 @@
/* Test IFUNC selector with floating-point parameters.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/ifuncmod8.c b/sysdeps/x86_64/ifuncmod8.c
index c00436799c..8225c4da12 100644
--- a/sysdeps/x86_64/ifuncmod8.c
+++ b/sysdeps/x86_64/ifuncmod8.c
@@ -1,5 +1,5 @@
/* Test IFUNC selector with floating-point parameters.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,6 +28,7 @@ foo_impl (float x)
}
void *
+inhibit_stack_protector
foo_ifunc (void)
{
__m128i xmm = _mm_set1_epi32 (-1);
diff --git a/sysdeps/x86_64/jmpbuf-offsets.h b/sysdeps/x86_64/jmpbuf-offsets.h
index da71e555f7..6d1ee5e812 100644
--- a/sysdeps/x86_64/jmpbuf-offsets.h
+++ b/sysdeps/x86_64/jmpbuf-offsets.h
@@ -1,5 +1,5 @@
/* Private macros for accessing __jmp_buf contents. x86-64 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/jmpbuf-unwind.h b/sysdeps/x86_64/jmpbuf-unwind.h
index aa0642b54a..49208bdd9e 100644
--- a/sysdeps/x86_64/jmpbuf-unwind.h
+++ b/sysdeps/x86_64/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
diff --git a/sysdeps/x86_64/ldsodefs.h b/sysdeps/x86_64/ldsodefs.h
deleted file mode 100644
index 6a96c53721..0000000000
--- a/sysdeps/x86_64/ldsodefs.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Run-time dynamic linker data structures for loaded ELF shared objects.
- 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/>. */
-
-#ifndef _X86_64_LDSODEFS_H
-#define _X86_64_LDSODEFS_H 1
-
-#include <elf.h>
-#include <cpu-features.h>
-
-struct La_x86_64_regs;
-struct La_x86_64_retval;
-struct La_x32_regs;
-struct La_x32_retval;
-
-#define ARCH_PLTENTER_MEMBERS \
- Elf64_Addr (*x86_64_gnu_pltenter) (Elf64_Sym *, unsigned int, \
- uintptr_t *, \
- uintptr_t *, struct La_x86_64_regs *, \
- unsigned int *, const char *name, \
- long int *framesizep); \
- Elf32_Addr (*x32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \
- uintptr_t *, struct La_x32_regs *, \
- unsigned int *, const char *name, \
- long int *framesizep)
-
-#define ARCH_PLTEXIT_MEMBERS \
- unsigned int (*x86_64_gnu_pltexit) (Elf64_Sym *, unsigned int, \
- uintptr_t *, \
- uintptr_t *, \
- const struct La_x86_64_regs *, \
- struct La_x86_64_retval *, \
- const char *); \
- unsigned int (*x32_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *, \
- uintptr_t *, \
- const struct La_x32_regs *, \
- struct La_x86_64_retval *, \
- const char *)
-
-#include_next <ldsodefs.h>
-
-#endif
diff --git a/sysdeps/x86_64/localplt.data b/sysdeps/x86_64/localplt.data
index f168b143ff..c27a02b66a 100644
--- a/sysdeps/x86_64/localplt.data
+++ b/sysdeps/x86_64/localplt.data
@@ -8,12 +8,15 @@ libc.so: free + RELA R_X86_64_GLOB_DAT
libc.so: malloc + RELA R_X86_64_GLOB_DAT
libc.so: memalign + RELA R_X86_64_GLOB_DAT
libc.so: realloc + RELA R_X86_64_GLOB_DAT
-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 + RELA R_X86_64_GLOB_DAT
+libm.so: matherr + RELA R_X86_64_GLOB_DAT
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
ld.so: malloc + RELA R_X86_64_GLOB_DAT
ld.so: calloc + RELA R_X86_64_GLOB_DAT
ld.so: realloc + RELA R_X86_64_GLOB_DAT
ld.so: free + RELA R_X86_64_GLOB_DAT
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error + RELA R_X86_64_GLOB_DAT
+ld.so: _dl_catch_error + RELA R_X86_64_GLOB_DAT
+ld.so: _dl_signal_exception + RELA R_X86_64_GLOB_DAT
+ld.so: _dl_catch_exception + RELA R_X86_64_GLOB_DAT
diff --git a/sysdeps/x86_64/lshift.S b/sysdeps/x86_64/lshift.S
index 49cbfbaf3d..af568768d0 100644
--- a/sysdeps/x86_64/lshift.S
+++ b/sysdeps/x86_64/lshift.S
@@ -1,5 +1,5 @@
/* x86-64 __mpn_lshift --
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/x86_64/machine-gmon.h b/sysdeps/x86_64/machine-gmon.h
index 3d9ce5c44e..8bc111612c 100644
--- a/sysdeps/x86_64/machine-gmon.h
+++ b/sysdeps/x86_64/machine-gmon.h
@@ -1,5 +1,5 @@
/* x86-64-specific implementation of profiling support.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
diff --git a/sysdeps/x86_64/memchr.S b/sysdeps/x86_64/memchr.S
index 132eacba8f..feef5d4f24 100644
--- a/sysdeps/x86_64/memchr.S
+++ b/sysdeps/x86_64/memchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -18,26 +18,40 @@
#include <sysdep.h>
+#ifdef USE_AS_WMEMCHR
+# define MEMCHR wmemchr
+# define PCMPEQ pcmpeqd
+#else
+# define MEMCHR memchr
+# define PCMPEQ pcmpeqb
+#endif
+
/* fast SSE2 version with using pmaxub and 64 byte loop */
.text
-ENTRY(memchr)
- movd %rsi, %xmm1
- mov %rdi, %rcx
+ENTRY(MEMCHR)
+ movd %esi, %xmm1
+ mov %edi, %ecx
+#ifdef USE_AS_WMEMCHR
+ test %rdx, %rdx
+ jz L(return_null)
+ shl $2, %rdx
+#else
punpcklbw %xmm1, %xmm1
test %rdx, %rdx
jz L(return_null)
punpcklbw %xmm1, %xmm1
+#endif
- and $63, %rcx
+ and $63, %ecx
pshufd $0, %xmm1, %xmm1
- cmp $48, %rcx
+ cmp $48, %ecx
ja L(crosscache)
movdqu (%rdi), %xmm0
- pcmpeqb %xmm1, %xmm0
+ PCMPEQ %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
@@ -45,7 +59,7 @@ ENTRY(memchr)
sub $16, %rdx
jbe L(return_null)
add $16, %rdi
- and $15, %rcx
+ and $15, %ecx
and $-16, %rdi
add %rcx, %rdx
sub $64, %rdx
@@ -54,11 +68,11 @@ ENTRY(memchr)
.p2align 4
L(crosscache):
- and $15, %rcx
+ and $15, %ecx
and $-16, %rdi
movdqa (%rdi), %xmm0
- pcmpeqb %xmm1, %xmm0
+ PCMPEQ %xmm1, %xmm0
/* Check if there is a match. */
pmovmskb %xmm0, %eax
/* Remove the leading bytes. */
@@ -76,8 +90,12 @@ L(crosscache):
.p2align 4
L(unaligned_no_match):
- add %rcx, %rdx
- sub $16, %rdx
+ /* "rcx" is less than 16. Calculate "rdx + rcx - 16" by using
+ "rdx - (16 - rcx)" instead of "(rdx + rcx) - 16" to void
+ possible addition overflow. */
+ neg %rcx
+ add $16, %rcx
+ sub %rcx, %rdx
jbe L(return_null)
add $16, %rdi
sub $64, %rdx
@@ -86,25 +104,25 @@ L(unaligned_no_match):
.p2align 4
L(loop_prolog):
movdqa (%rdi), %xmm0
- pcmpeqb %xmm1, %xmm0
+ PCMPEQ %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches)
movdqa 16(%rdi), %xmm2
- pcmpeqb %xmm1, %xmm2
+ PCMPEQ %xmm1, %xmm2
pmovmskb %xmm2, %eax
test %eax, %eax
jnz L(matches16)
movdqa 32(%rdi), %xmm3
- pcmpeqb %xmm1, %xmm3
+ PCMPEQ %xmm1, %xmm3
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(matches32)
movdqa 48(%rdi), %xmm4
- pcmpeqb %xmm1, %xmm4
+ PCMPEQ %xmm1, %xmm4
add $64, %rdi
pmovmskb %xmm4, %eax
test %eax, %eax
@@ -117,25 +135,25 @@ L(loop_prolog):
jbe L(exit_loop)
movdqa (%rdi), %xmm0
- pcmpeqb %xmm1, %xmm0
+ PCMPEQ %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches)
movdqa 16(%rdi), %xmm2
- pcmpeqb %xmm1, %xmm2
+ PCMPEQ %xmm1, %xmm2
pmovmskb %xmm2, %eax
test %eax, %eax
jnz L(matches16)
movdqa 32(%rdi), %xmm3
- pcmpeqb %xmm1, %xmm3
+ PCMPEQ %xmm1, %xmm3
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(matches32)
movdqa 48(%rdi), %xmm3
- pcmpeqb %xmm1, %xmm3
+ PCMPEQ %xmm1, %xmm3
pmovmskb %xmm3, %eax
add $64, %rdi
@@ -144,7 +162,7 @@ L(loop_prolog):
mov %rdi, %rcx
and $-64, %rdi
- and $63, %rcx
+ and $63, %ecx
add %rcx, %rdx
.p2align 4
@@ -156,10 +174,10 @@ L(align64_loop):
movdqa 32(%rdi), %xmm3
movdqa 48(%rdi), %xmm4
- pcmpeqb %xmm1, %xmm0
- pcmpeqb %xmm1, %xmm2
- pcmpeqb %xmm1, %xmm3
- pcmpeqb %xmm1, %xmm4
+ PCMPEQ %xmm1, %xmm0
+ PCMPEQ %xmm1, %xmm2
+ PCMPEQ %xmm1, %xmm3
+ PCMPEQ %xmm1, %xmm4
pmaxub %xmm0, %xmm3
pmaxub %xmm2, %xmm4
@@ -182,9 +200,9 @@ L(align64_loop):
jnz L(matches16)
movdqa 32(%rdi), %xmm3
- pcmpeqb %xmm1, %xmm3
+ PCMPEQ %xmm1, %xmm3
- pcmpeqb 48(%rdi), %xmm1
+ PCMPEQ 48(%rdi), %xmm1
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(matches32)
@@ -196,52 +214,52 @@ L(align64_loop):
.p2align 4
L(exit_loop):
- add $32, %rdx
+ add $32, %edx
jle L(exit_loop_32)
movdqa (%rdi), %xmm0
- pcmpeqb %xmm1, %xmm0
+ PCMPEQ %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches)
movdqa 16(%rdi), %xmm2
- pcmpeqb %xmm1, %xmm2
+ PCMPEQ %xmm1, %xmm2
pmovmskb %xmm2, %eax
test %eax, %eax
jnz L(matches16)
movdqa 32(%rdi), %xmm3
- pcmpeqb %xmm1, %xmm3
+ PCMPEQ %xmm1, %xmm3
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(matches32_1)
- sub $16, %rdx
+ sub $16, %edx
jle L(return_null)
- pcmpeqb 48(%rdi), %xmm1
+ PCMPEQ 48(%rdi), %xmm1
pmovmskb %xmm1, %eax
test %eax, %eax
jnz L(matches48_1)
- xor %rax, %rax
+ xor %eax, %eax
ret
.p2align 4
L(exit_loop_32):
- add $32, %rdx
+ add $32, %edx
movdqa (%rdi), %xmm0
- pcmpeqb %xmm1, %xmm0
+ PCMPEQ %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches_1)
- sub $16, %rdx
+ sub $16, %edx
jbe L(return_null)
- pcmpeqb 16(%rdi), %xmm1
+ PCMPEQ 16(%rdi), %xmm1
pmovmskb %xmm1, %eax
test %eax, %eax
jnz L(matches16_1)
- xor %rax, %rax
+ xor %eax, %eax
ret
.p2align 4
@@ -302,10 +320,11 @@ L(matches48_1):
.p2align 4
L(return_null):
- xor %rax, %rax
+ xor %eax, %eax
ret
-END(memchr)
+END(MEMCHR)
+#ifndef USE_AS_WMEMCHR
strong_alias (memchr, __memchr)
-
libc_hidden_builtin_def(memchr)
+#endif
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 3fb018a772..bcb4a2e88d 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -1,5 +1,5 @@
/* memcmp with SSE2
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/memcopy.h b/sysdeps/x86_64/memcopy.h
new file mode 100644
index 0000000000..590b6cb16b
--- /dev/null
+++ b/sysdeps/x86_64/memcopy.h
@@ -0,0 +1 @@
+/* X86-64 doesn't use memory copy functions. */
diff --git a/sysdeps/x86_64/memcpy.S b/sysdeps/x86_64/memcpy.S
index f6e3d9396c..d98500a78a 100644
--- a/sysdeps/x86_64/memcpy.S
+++ b/sysdeps/x86_64/memcpy.S
@@ -1,584 +1 @@
-/*
- Optimized memcpy for x86-64.
-
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
- Contributed by Evandro Menezes <evandro.menezes@amd.com>, 2007.
-
- 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>
-#include "asm-syntax.h"
-
-/* Stack slots in the red-zone. */
-
-#ifdef USE_AS_MEMPCPY
-# define RETVAL (0)
-#else
-# define RETVAL (-8)
-# if defined SHARED && !defined USE_MULTIARCH && IS_IN (libc)
-# define memcpy __memcpy
-# undef libc_hidden_builtin_def
-# define libc_hidden_builtin_def(name) \
- .globl __GI_memcpy; __GI_memcpy = __memcpy
-# endif
-#endif
-#define SAVE0 (RETVAL - 8)
-#define SAVE1 (SAVE0 - 8)
-#define SAVE2 (SAVE1 - 8)
-#define SAVE3 (SAVE2 - 8)
-
- .text
-
-#if defined PIC && IS_IN (libc)
-ENTRY_CHK (__memcpy_chk)
-
- cmpq %rdx, %rcx
- jb HIDDEN_JUMPTARGET (__chk_fail)
-
-END_CHK (__memcpy_chk)
-#endif
-
-ENTRY(memcpy) /* (void *, const void*, size_t) */
-
-/* Handle tiny blocks. */
-
-L(1try): /* up to 32B */
- cmpq $32, %rdx
-#ifndef USE_AS_MEMPCPY
- movq %rdi, %rax /* save return value */
-#endif
- jae L(1after)
-
-L(1): /* 1-byte once */
- testb $1, %dl
- jz L(1a)
-
- movzbl (%rsi), %ecx
- movb %cl, (%rdi)
-
- incq %rsi
- incq %rdi
-
- .p2align 4,, 4
-
-L(1a): /* 2-byte once */
- testb $2, %dl
- jz L(1b)
-
- movzwl (%rsi), %ecx
- movw %cx, (%rdi)
-
- addq $2, %rsi
- addq $2, %rdi
-
- .p2align 4,, 4
-
-L(1b): /* 4-byte once */
- testb $4, %dl
- jz L(1c)
-
- movl (%rsi), %ecx
- movl %ecx, (%rdi)
-
- addq $4, %rsi
- addq $4, %rdi
-
- .p2align 4,, 4
-
-L(1c): /* 8-byte once */
- testb $8, %dl
- jz L(1d)
-
- movq (%rsi), %rcx
- movq %rcx, (%rdi)
-
- addq $8, %rsi
- addq $8, %rdi
-
- .p2align 4,, 4
-
-L(1d): /* 16-byte loop */
- andl $0xf0, %edx
- jz L(exit)
-
- .p2align 4
-
-L(1loop):
- movq (%rsi), %rcx
- movq 8(%rsi), %r8
- movq %rcx, (%rdi)
- movq %r8, 8(%rdi)
-
- subl $16, %edx
-
- leaq 16(%rsi), %rsi
- leaq 16(%rdi), %rdi
-
- jnz L(1loop)
-
- .p2align 4,, 4
-
-L(exit): /* exit */
-#ifdef USE_AS_MEMPCPY
- movq %rdi, %rax /* return value */
-#else
- rep
-#endif
- retq
-
- .p2align 4
-
-L(1after):
-#ifndef USE_AS_MEMPCPY
- movq %rax, RETVAL(%rsp) /* save return value */
-#endif
-
-/* Align to the natural word size. */
-
-L(aligntry):
- movl %esi, %ecx /* align by source */
-
- andl $7, %ecx
- jz L(alignafter) /* already aligned */
-
-L(align): /* align */
- leaq -8(%rcx, %rdx), %rdx /* calculate remaining bytes */
- subl $8, %ecx
-
- .p2align 4
-
-L(alignloop): /* 1-byte alignment loop */
- movzbl (%rsi), %eax
- movb %al, (%rdi)
-
- incl %ecx
-
- leaq 1(%rsi), %rsi
- leaq 1(%rdi), %rdi
-
- jnz L(alignloop)
-
- .p2align 4
-
-L(alignafter):
-
-/* Handle mid-sized blocks. */
-
-L(32try): /* up to 1KB */
- cmpq $1024, %rdx
- ja L(32after)
-
-L(32): /* 32-byte loop */
- movl %edx, %ecx
- shrl $5, %ecx
- jz L(32skip)
-
- .p2align 4
-
-L(32loop):
- decl %ecx
-
- movq (%rsi), %rax
- movq 8(%rsi), %r8
- movq 16(%rsi), %r9
- movq 24(%rsi), %r10
-
- movq %rax, (%rdi)
- movq %r8, 8(%rdi)
- movq %r9, 16(%rdi)
- movq %r10, 24(%rdi)
-
- leaq 32(%rsi), %rsi
- leaq 32(%rdi), %rdi
-
- jz L(32skip) /* help out smaller blocks */
-
- decl %ecx
-
- movq (%rsi), %rax
- movq 8(%rsi), %r8
- movq 16(%rsi), %r9
- movq 24(%rsi), %r10
-
- movq %rax, (%rdi)
- movq %r8, 8(%rdi)
- movq %r9, 16(%rdi)
- movq %r10, 24(%rdi)
-
- leaq 32(%rsi), %rsi
- leaq 32(%rdi), %rdi
-
- jnz L(32loop)
-
- .p2align 4
-
-L(32skip):
- andl $31, %edx /* check for left overs */
-#ifdef USE_AS_MEMPCPY
- jnz L(1)
-
- movq %rdi, %rax
-#else
- movq RETVAL(%rsp), %rax
- jnz L(1)
-
- rep
-#endif
- retq /* exit */
-
- .p2align 4
-
-L(32after):
-
-/*
- In order to minimize code-size in RTLD, algorithms specific for
- larger blocks are excluded when building for RTLD.
-*/
-
-/* Handle blocks smaller than 1/2 L1. */
-
-L(fasttry): /* first 1/2 L1 */
-#if IS_IN (libc) /* only up to this algorithm outside of libc.so */
- mov __x86_data_cache_size_half(%rip), %R11_LP
- cmpq %rdx, %r11 /* calculate the smaller of */
- cmovaq %rdx, %r11 /* remaining bytes and 1/2 L1 */
-#endif
-
-L(fast): /* good ol' MOVS */
-#if IS_IN (libc)
- movq %r11, %rcx
- andq $-8, %r11
-#else
- movq %rdx, %rcx
-#endif
- shrq $3, %rcx
- jz L(fastskip)
-
- rep
- movsq
-
- .p2align 4,, 4
-
-L(fastskip):
-#if IS_IN (libc)
- subq %r11, %rdx /* check for more */
- testq $-8, %rdx
- jnz L(fastafter)
-#endif
-
- andl $7, %edx /* check for left overs */
-#ifdef USE_AS_MEMPCPY
- jnz L(1)
-
- movq %rdi, %rax
-#else
- movq RETVAL(%rsp), %rax
- jnz L(1)
-
- rep
-#endif
- retq /* exit */
-
-#if IS_IN (libc) /* none of the algorithms below for RTLD */
-
- .p2align 4
-
-L(fastafter):
-
-/* Handle large blocks smaller than 1/2 L2. */
-
-L(pretry): /* first 1/2 L2 */
- mov __x86_shared_cache_size_half (%rip), %R8_LP
- cmpq %rdx, %r8 /* calculate the lesser of */
- cmovaq %rdx, %r8 /* remaining bytes and 1/2 L2 */
-
-L(pre): /* 64-byte with prefetching */
- movq %r8, %rcx
- andq $-64, %r8
- shrq $6, %rcx
- jz L(preskip)
-
- movq %r14, SAVE0(%rsp)
- cfi_rel_offset (%r14, SAVE0)
- movq %r13, SAVE1(%rsp)
- cfi_rel_offset (%r13, SAVE1)
- movq %r12, SAVE2(%rsp)
- cfi_rel_offset (%r12, SAVE2)
- movq %rbx, SAVE3(%rsp)
- cfi_rel_offset (%rbx, SAVE3)
-
- cmpl $0, __x86_prefetchw(%rip)
- jz L(preloop) /* check if PREFETCHW OK */
-
- .p2align 4
-
-/* ... when PREFETCHW is available (less cache-probe traffic in MP systems). */
-
-L(prewloop): /* cache-line in state M */
- decq %rcx
-
- movq (%rsi), %rax
- movq 8 (%rsi), %rbx
- movq 16 (%rsi), %r9
- movq 24 (%rsi), %r10
- movq 32 (%rsi), %r11
- movq 40 (%rsi), %r12
- movq 48 (%rsi), %r13
- movq 56 (%rsi), %r14
-
- prefetcht0 0 + 896 (%rsi)
- prefetcht0 64 + 896 (%rsi)
-
- movq %rax, (%rdi)
- movq %rbx, 8(%rdi)
- movq %r9, 16(%rdi)
- movq %r10, 24(%rdi)
- movq %r11, 32(%rdi)
- movq %r12, 40(%rdi)
- movq %r13, 48(%rdi)
- movq %r14, 56(%rdi)
-
- leaq 64(%rsi), %rsi
- leaq 64(%rdi), %rdi
-
- jz L(prebail)
-
- decq %rcx
-
- movq (%rsi), %rax
- movq 8(%rsi), %rbx
- movq 16(%rsi), %r9
- movq 24(%rsi), %r10
- movq 32(%rsi), %r11
- movq 40(%rsi), %r12
- movq 48(%rsi), %r13
- movq 56(%rsi), %r14
-
- movq %rax, (%rdi)
- movq %rbx, 8(%rdi)
- movq %r9, 16(%rdi)
- movq %r10, 24(%rdi)
- movq %r11, 32(%rdi)
- movq %r12, 40(%rdi)
- movq %r13, 48(%rdi)
- movq %r14, 56(%rdi)
-
- prefetchw 896 - 64(%rdi)
- prefetchw 896 - 0(%rdi)
-
- leaq 64(%rsi), %rsi
- leaq 64(%rdi), %rdi
-
- jnz L(prewloop)
- jmp L(prebail)
-
- .p2align 4
-
-/* ... when PREFETCHW is not available. */
-
-L(preloop): /* cache-line in state E */
- decq %rcx
-
- movq (%rsi), %rax
- movq 8(%rsi), %rbx
- movq 16(%rsi), %r9
- movq 24(%rsi), %r10
- movq 32(%rsi), %r11
- movq 40(%rsi), %r12
- movq 48(%rsi), %r13
- movq 56(%rsi), %r14
-
- prefetcht0 896 + 0(%rsi)
- prefetcht0 896 + 64(%rsi)
-
- movq %rax, (%rdi)
- movq %rbx, 8(%rdi)
- movq %r9, 16(%rdi)
- movq %r10, 24(%rdi)
- movq %r11, 32(%rdi)
- movq %r12, 40(%rdi)
- movq %r13, 48(%rdi)
- movq %r14, 56(%rdi)
-
- leaq 64 (%rsi), %rsi
- leaq 64 (%rdi), %rdi
-
- jz L(prebail)
-
- decq %rcx
-
- movq (%rsi), %rax
- movq 8(%rsi), %rbx
- movq 16(%rsi), %r9
- movq 24(%rsi), %r10
- movq 32(%rsi), %r11
- movq 40(%rsi), %r12
- movq 48(%rsi), %r13
- movq 56(%rsi), %r14
-
- prefetcht0 896 - 64(%rdi)
- prefetcht0 896 - 0(%rdi)
-
- movq %rax, (%rdi)
- movq %rbx, 8(%rdi)
- movq %r9, 16(%rdi)
- movq %r10, 24(%rdi)
- movq %r11, 32(%rdi)
- movq %r12, 40(%rdi)
- movq %r13, 48(%rdi)
- movq %r14, 56(%rdi)
-
- leaq 64(%rsi), %rsi
- leaq 64(%rdi), %rdi
-
- jnz L(preloop)
-
-L(prebail):
- movq SAVE3(%rsp), %rbx
- cfi_restore (%rbx)
- movq SAVE2(%rsp), %r12
- cfi_restore (%r12)
- movq SAVE1(%rsp), %r13
- cfi_restore (%r13)
- movq SAVE0(%rsp), %r14
- cfi_restore (%r14)
-
-/* .p2align 4 */
-
-L(preskip):
- subq %r8, %rdx /* check for more */
- testq $-64, %rdx
- jnz L(preafter)
-
- andl $63, %edx /* check for left overs */
-#ifdef USE_AS_MEMPCPY
- jnz L(1)
-
- movq %rdi, %rax
-#else
- movq RETVAL(%rsp), %rax
- jnz L(1)
-
- rep
-#endif
- retq /* exit */
-
- .p2align 4
-
-L(preafter):
-
-/* Handle huge blocks. */
-
-L(NTtry):
-
-L(NT): /* non-temporal 128-byte */
- movq %rdx, %rcx
- shrq $7, %rcx
- jz L(NTskip)
-
- movq %r14, SAVE0(%rsp)
- cfi_rel_offset (%r14, SAVE0)
- movq %r13, SAVE1(%rsp)
- cfi_rel_offset (%r13, SAVE1)
- movq %r12, SAVE2(%rsp)
- cfi_rel_offset (%r12, SAVE2)
-
- .p2align 4
-
-L(NTloop):
- prefetchnta 768(%rsi)
- prefetchnta 832(%rsi)
-
- decq %rcx
-
- movq (%rsi), %rax
- movq 8(%rsi), %r8
- movq 16(%rsi), %r9
- movq 24(%rsi), %r10
- movq 32(%rsi), %r11
- movq 40(%rsi), %r12
- movq 48(%rsi), %r13
- movq 56(%rsi), %r14
-
- movntiq %rax, (%rdi)
- movntiq %r8, 8(%rdi)
- movntiq %r9, 16(%rdi)
- movntiq %r10, 24(%rdi)
- movntiq %r11, 32(%rdi)
- movntiq %r12, 40(%rdi)
- movntiq %r13, 48(%rdi)
- movntiq %r14, 56(%rdi)
-
- movq 64(%rsi), %rax
- movq 72(%rsi), %r8
- movq 80(%rsi), %r9
- movq 88(%rsi), %r10
- movq 96(%rsi), %r11
- movq 104(%rsi), %r12
- movq 112(%rsi), %r13
- movq 120(%rsi), %r14
-
- movntiq %rax, 64(%rdi)
- movntiq %r8, 72(%rdi)
- movntiq %r9, 80(%rdi)
- movntiq %r10, 88(%rdi)
- movntiq %r11, 96(%rdi)
- movntiq %r12, 104(%rdi)
- movntiq %r13, 112(%rdi)
- movntiq %r14, 120(%rdi)
-
- leaq 128(%rsi), %rsi
- leaq 128(%rdi), %rdi
-
- jnz L(NTloop)
-
- sfence /* serialize memory stores */
-
- movq SAVE2(%rsp), %r12
- cfi_restore (%r12)
- movq SAVE1(%rsp), %r13
- cfi_restore (%r13)
- movq SAVE0(%rsp), %r14
- cfi_restore (%r14)
-
-L(NTskip):
- andl $127, %edx /* check for left overs */
-#ifdef USE_AS_MEMPCPY
- jnz L(1)
-
- movq %rdi, %rax
-#else
- movq RETVAL(%rsp), %rax
- jnz L(1)
-
- rep
-#endif
- retq /* exit */
-
-#endif /* IS_IN (libc) */
-
-END(memcpy)
-
-#ifndef USE_AS_MEMPCPY
-libc_hidden_builtin_def (memcpy)
-# if defined SHARED && !defined USE_MULTIARCH && IS_IN (libc)
-# undef memcpy
-# include <shlib-compat.h>
-versioned_symbol (libc, __memcpy, memcpy, GLIBC_2_14);
-# endif
-#endif
+/* Implemented in memcpy.S. */
diff --git a/sysdeps/x86_64/memcpy_chk.S b/sysdeps/x86_64/memcpy_chk.S
index 2296b55119..aa33cd5fc1 100644
--- a/sysdeps/x86_64/memcpy_chk.S
+++ b/sysdeps/x86_64/memcpy_chk.S
@@ -1,5 +1,5 @@
/* Checking memcpy for x86-64.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#ifndef PIC
+#ifndef SHARED
/* For libc.so this is defined in memcpy.S.
For libc.a, this is a separate source to avoid
memcpy bringing in __chk_fail and all routines
diff --git a/sysdeps/x86_64/memmove.S b/sysdeps/x86_64/memmove.S
new file mode 100644
index 0000000000..9cc92ff9a9
--- /dev/null
+++ b/sysdeps/x86_64/memmove.S
@@ -0,0 +1,71 @@
+/* Optimized memmove for x86-64.
+ Copyright (C) 2016-2018 Free Software 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 VEC_SIZE 16
+#define VEC(i) xmm##i
+#define PREFETCHNT prefetchnta
+#define VMOVNT movntdq
+/* Use movups and movaps for smaller code sizes. */
+#define VMOVU movups
+#define VMOVA movaps
+
+#define SECTION(p) p
+
+#ifdef USE_MULTIARCH
+# if !IS_IN (libc)
+# define MEMCPY_SYMBOL(p,s) memcpy
+# endif
+#else
+# if defined SHARED && IS_IN (libc)
+# define MEMCPY_SYMBOL(p,s) __memcpy
+# else
+# define MEMCPY_SYMBOL(p,s) memcpy
+# endif
+#endif
+#if !defined USE_MULTIARCH || !IS_IN (libc)
+# define MEMPCPY_SYMBOL(p,s) __mempcpy
+#endif
+#ifndef MEMMOVE_SYMBOL
+# define MEMMOVE_CHK_SYMBOL(p,s) p
+# define MEMMOVE_SYMBOL(p,s) memmove
+#endif
+
+#include "multiarch/memmove-vec-unaligned-erms.S"
+
+#ifndef USE_MULTIARCH
+libc_hidden_builtin_def (memmove)
+# if defined SHARED && IS_IN (libc)
+strong_alias (memmove, __memcpy)
+libc_hidden_ver (memmove, memcpy)
+# endif
+libc_hidden_def (__mempcpy)
+weak_alias (__mempcpy, mempcpy)
+libc_hidden_builtin_def (mempcpy)
+
+# if defined SHARED && IS_IN (libc)
+# undef memcpy
+# include <shlib-compat.h>
+versioned_symbol (libc, __memcpy, memcpy, GLIBC_2_14);
+
+# if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
+compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
+# endif
+# endif
+#endif
diff --git a/sysdeps/x86_64/memmove.c b/sysdeps/x86_64/memmove.c
deleted file mode 100644
index 07f81852d6..0000000000
--- a/sysdeps/x86_64/memmove.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (C) 2011-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 "string/memmove.c"
-
-#if !defined memmove && IS_IN (libc)
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
-compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
-#endif
-#endif
diff --git a/sysdeps/x86_64/memmove_chk.S b/sysdeps/x86_64/memmove_chk.S
new file mode 100644
index 0000000000..39b56dde65
--- /dev/null
+++ b/sysdeps/x86_64/memmove_chk.S
@@ -0,0 +1,33 @@
+/* Checking memmove for x86-64.
+ Copyright (C) 2016-2018 Free Software 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>
+#include "asm-syntax.h"
+
+#ifndef SHARED
+ /* For libc.so this is defined in memmove.S.
+ For libc.a, this is a separate source to avoid
+ memmove bringing in __chk_fail and all routines
+ it calls. */
+ .text
+ENTRY (__memmove_chk)
+ cmpq %rdx, %rcx
+ jb __chk_fail
+ jmp memmove
+END (__memmove_chk)
+#endif
diff --git a/sysdeps/x86_64/mempcpy.S b/sysdeps/x86_64/mempcpy.S
index acee5e56b1..d98500a78a 100644
--- a/sysdeps/x86_64/mempcpy.S
+++ b/sysdeps/x86_64/mempcpy.S
@@ -1,8 +1 @@
-#define USE_AS_MEMPCPY
-#define memcpy __mempcpy
-#define __memcpy_chk __mempcpy_chk
-#include <sysdeps/x86_64/memcpy.S>
-
-libc_hidden_def (__mempcpy)
-weak_alias (__mempcpy, mempcpy)
-libc_hidden_builtin_def (mempcpy)
+/* Implemented in memcpy.S. */
diff --git a/sysdeps/x86_64/mempcpy_chk.S b/sysdeps/x86_64/mempcpy_chk.S
index 390abc68dd..0e9e24db00 100644
--- a/sysdeps/x86_64/mempcpy_chk.S
+++ b/sysdeps/x86_64/mempcpy_chk.S
@@ -1,5 +1,5 @@
/* Checking mempcpy for x86-64.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#ifndef PIC
+#ifndef SHARED
/* For libc.so this is defined in memcpy.S.
For libc.a, this is a separate source to avoid
mempcpy bringing in __chk_fail and all routines
diff --git a/sysdeps/x86_64/memrchr.S b/sysdeps/x86_64/memrchr.S
index 840de30cd7..b8e3fa1d87 100644
--- a/sysdeps/x86_64/memrchr.S
+++ b/sysdeps/x86_64/memrchr.S
@@ -1,6 +1,6 @@
/* fast SSE2 memrchr with 64 byte loop and pmaxub instruction using
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -22,7 +22,7 @@
.text
ENTRY (__memrchr)
- movd %rsi, %xmm1
+ movd %esi, %xmm1
sub $16, %rdx
jbe L(length_less16)
@@ -42,8 +42,8 @@ ENTRY (__memrchr)
jnz L(matches0)
sub $64, %rdi
- mov %rdi, %rcx
- and $15, %rcx
+ mov %edi, %ecx
+ and $15, %ecx
jz L(loop_prolog)
add $16, %rdi
@@ -108,8 +108,8 @@ L(loop_prolog):
test %eax, %eax
jnz L(matches0)
- mov %rdi, %rcx
- and $63, %rcx
+ mov %edi, %ecx
+ and $63, %ecx
jz L(align64_loop)
add $64, %rdi
@@ -166,8 +166,8 @@ L(align64_loop):
.p2align 4
L(exit_loop):
- add $64, %rdx
- cmp $32, %rdx
+ add $64, %edx
+ cmp $32, %edx
jbe L(exit_loop_32)
movdqa 48(%rdi), %xmm0
@@ -187,7 +187,7 @@ L(exit_loop):
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(matches16_1)
- cmp $48, %rdx
+ cmp $48, %edx
jbe L(return_null)
pcmpeqb (%rdi), %xmm1
@@ -204,7 +204,7 @@ L(exit_loop_32):
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches48_1)
- cmp $16, %rdx
+ cmp $16, %edx
jbe L(return_null)
pcmpeqb 32(%rdi), %xmm1
@@ -276,7 +276,7 @@ L(matches48_1):
.p2align 4
L(return_null):
- xor %rax, %rax
+ xor %eax, %eax
ret
.p2align 4
@@ -306,18 +306,16 @@ L(length_less16):
punpcklbw %xmm1, %xmm1
punpcklbw %xmm1, %xmm1
- add $16, %rdx
+ add $16, %edx
pshufd $0, %xmm1, %xmm1
- mov %rdi, %rcx
- and $15, %rcx
+ mov %edi, %ecx
+ and $15, %ecx
jz L(length_less16_offset0)
- mov %rdi, %rcx
- and $15, %rcx
mov %cl, %dh
- mov %rcx, %r8
+ mov %ecx, %esi
add %dl, %dh
and $-16, %rdi
@@ -340,7 +338,7 @@ L(length_less16):
bsr %eax, %eax
add %rdi, %rax
- add %r8, %rax
+ add %rsi, %rax
ret
.p2align 4
@@ -362,14 +360,14 @@ L(length_less16_part2):
pcmpeqb (%rdi), %xmm1
pmovmskb %xmm1, %eax
- mov %r8, %rcx
+ mov %esi, %ecx
sar %cl, %eax
test %eax, %eax
jz L(return_null)
bsr %eax, %eax
add %rdi, %rax
- add %r8, %rax
+ add %rsi, %rax
ret
.p2align 4
diff --git a/sysdeps/x86_64/memset.S b/sysdeps/x86_64/memset.S
index 4cf0da0fb8..b342679576 100644
--- a/sysdeps/x86_64/memset.S
+++ b/sysdeps/x86_64/memset.S
@@ -1,6 +1,6 @@
/* memset/bzero -- set memory area to CH/0
Optimized version for x86-64.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,114 +19,43 @@
#include <sysdep.h>
- .text
-#if IS_IN (libc)
-ENTRY(__bzero)
- movq %rdi, %rax /* Set return value. */
- movq %rsi, %rdx /* Set n. */
- pxor %xmm0, %xmm0
- jmp L(entry_from_bzero)
-END(__bzero)
-weak_alias (__bzero, bzero)
-
-/* Like memset but takes additional parameter with return value. */
-ENTRY(__memset_tail)
- movq %rcx, %rax /* Set return value. */
-
- movd %esi, %xmm0
- punpcklbw %xmm0, %xmm0
- punpcklwd %xmm0, %xmm0
- pshufd $0, %xmm0, %xmm0
-
- jmp L(entry_from_bzero)
-END(__memset_tail)
+#define VEC_SIZE 16
+#define VEC(i) xmm##i
+/* Don't use movups and movaps since it will get larger nop paddings for
+ alignment. */
+#define VMOVU movdqu
+#define VMOVA movdqa
+
+#define MEMSET_VDUP_TO_VEC0_AND_SET_RETURN(d, r) \
+ movd d, %xmm0; \
+ movq r, %rax; \
+ punpcklbw %xmm0, %xmm0; \
+ punpcklwd %xmm0, %xmm0; \
+ pshufd $0, %xmm0, %xmm0
+
+#define WMEMSET_VDUP_TO_VEC0_AND_SET_RETURN(d, r) \
+ movd d, %xmm0; \
+ movq r, %rax; \
+ pshufd $0, %xmm0, %xmm0
+
+#define SECTION(p) p
+
+#ifndef MEMSET_SYMBOL
+# define MEMSET_CHK_SYMBOL(p,s) p
+# define MEMSET_SYMBOL(p,s) memset
#endif
-#if defined PIC && IS_IN (libc)
-ENTRY_CHK (__memset_chk)
- cmpq %rdx, %rcx
- jb HIDDEN_JUMPTARGET (__chk_fail)
-END_CHK (__memset_chk)
+#ifndef WMEMSET_SYMBOL
+# define WMEMSET_CHK_SYMBOL(p,s) p
+# define WMEMSET_SYMBOL(p,s) __wmemset
#endif
-ENTRY (memset)
- movd %esi, %xmm0
- movq %rdi, %rax
- punpcklbw %xmm0, %xmm0
- punpcklwd %xmm0, %xmm0
- pshufd $0, %xmm0, %xmm0
-L(entry_from_bzero):
- cmpq $64, %rdx
- ja L(loop_start)
- cmpq $16, %rdx
- jbe L(less_16_bytes)
- cmpq $32, %rdx
- movdqu %xmm0, (%rdi)
- movdqu %xmm0, -16(%rdi,%rdx)
- ja L(between_32_64_bytes)
-L(return):
- rep
- ret
- .p2align 4
-L(between_32_64_bytes):
- movdqu %xmm0, 16(%rdi)
- movdqu %xmm0, -32(%rdi,%rdx)
- ret
- .p2align 4
-L(loop_start):
- leaq 64(%rdi), %rcx
- movdqu %xmm0, (%rdi)
- andq $-64, %rcx
- movdqu %xmm0, -16(%rdi,%rdx)
- movdqu %xmm0, 16(%rdi)
- movdqu %xmm0, -32(%rdi,%rdx)
- movdqu %xmm0, 32(%rdi)
- movdqu %xmm0, -48(%rdi,%rdx)
- movdqu %xmm0, 48(%rdi)
- movdqu %xmm0, -64(%rdi,%rdx)
- addq %rdi, %rdx
- andq $-64, %rdx
- cmpq %rdx, %rcx
- je L(return)
- .p2align 4
-L(loop):
- movdqa %xmm0, (%rcx)
- movdqa %xmm0, 16(%rcx)
- movdqa %xmm0, 32(%rcx)
- movdqa %xmm0, 48(%rcx)
- addq $64, %rcx
- cmpq %rcx, %rdx
- jne L(loop)
- rep
- ret
-L(less_16_bytes):
- movq %xmm0, %rcx
- testb $24, %dl
- jne L(between8_16bytes)
- testb $4, %dl
- jne L(between4_7bytes)
- testb $1, %dl
- je L(odd_byte)
- movb %cl, (%rdi)
-L(odd_byte):
- testb $2, %dl
- je L(return)
- movw %cx, -2(%rax,%rdx)
- ret
-L(between4_7bytes):
- movl %ecx, (%rdi)
- movl %ecx, -4(%rdi,%rdx)
- ret
-L(between8_16bytes):
- movq %rcx, (%rdi)
- movq %rcx, -8(%rdi,%rdx)
- ret
+#include "multiarch/memset-vec-unaligned-erms.S"
-END (memset)
libc_hidden_builtin_def (memset)
-#if defined PIC && IS_IN (libc) && !defined USE_MULTIARCH
-strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
- .section .gnu.warning.__memset_zero_constant_len_parameter
- .string "memset used with constant zero length parameter; this could be due to transposed parameters"
+#if IS_IN (libc)
+libc_hidden_def (__wmemset)
+weak_alias (__wmemset, wmemset)
+libc_hidden_weak (wmemset)
#endif
diff --git a/sysdeps/x86_64/memset_chk.S b/sysdeps/x86_64/memset_chk.S
index 95bb5d0e94..4ecf914fbe 100644
--- a/sysdeps/x86_64/memset_chk.S
+++ b/sysdeps/x86_64/memset_chk.S
@@ -1,5 +1,5 @@
/* Checking memset for x86-64.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/memusage.h b/sysdeps/x86_64/memusage.h
index fc102c4252..45fd920b52 100644
--- a/sysdeps/x86_64/memusage.h
+++ b/sysdeps/x86_64/memusage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/mul_1.S b/sysdeps/x86_64/mul_1.S
index 88b8f920a1..c38927b5a0 100644
--- a/sysdeps/x86_64/mul_1.S
+++ b/sysdeps/x86_64/mul_1.S
@@ -1,6 +1,6 @@
/* AMD64 __mpn_mul_1 -- Multiply a limb vector with a limb and store
the result in a second limb vector.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/x86_64/multiarch/Makefile b/sysdeps/x86_64/multiarch/Makefile
index d234f4ab66..bb5e970735 100644
--- a/sysdeps/x86_64/multiarch/Makefile
+++ b/sysdeps/x86_64/multiarch/Makefile
@@ -1,26 +1,46 @@
ifeq ($(subdir),csu)
tests += test-multiarch
-gen-as-const-headers += ifunc-defines.sym
endif
ifeq ($(subdir),string)
-sysdep_routines += strncat-c stpncpy-c strncpy-c strcmp-ssse3 \
- strcmp-sse2-unaligned strncmp-ssse3 \
- memcmp-sse4 memcpy-ssse3 memcpy-sse2-unaligned \
- memcpy-avx512-no-vzeroupper mempcpy-ssse3 memmove-ssse3 \
- memcpy-ssse3-back mempcpy-ssse3-back memmove-avx-unaligned \
- memcpy-avx-unaligned mempcpy-avx-unaligned \
- mempcpy-avx512-no-vzeroupper memmove-ssse3-back \
- memmove-avx512-no-vzeroupper strcasecmp_l-ssse3 \
- strncase_l-ssse3 strcat-ssse3 strncat-ssse3\
+sysdep_routines += strncat-c stpncpy-c strncpy-c \
+ strcmp-sse2 strcmp-sse2-unaligned strcmp-ssse3 \
+ strcmp-sse4_2 strcmp-avx2 \
+ strncmp-sse2 strncmp-ssse3 strncmp-sse4_2 strncmp-avx2 \
+ memchr-sse2 rawmemchr-sse2 memchr-avx2 rawmemchr-avx2 \
+ memrchr-sse2 memrchr-avx2 \
+ memcmp-sse2 \
+ memcmp-avx2-movbe \
+ memcmp-sse4 memcpy-ssse3 \
+ memmove-ssse3 \
+ memcpy-ssse3-back \
+ memmove-ssse3-back \
+ memmove-avx512-no-vzeroupper \
+ strcasecmp_l-sse2 strcasecmp_l-ssse3 \
+ strcasecmp_l-sse4_2 strcasecmp_l-avx \
+ strncase_l-sse2 strncase_l-ssse3 \
+ strncase_l-sse4_2 strncase_l-avx \
+ strchr-sse2 strchrnul-sse2 strchr-avx2 strchrnul-avx2 \
+ strrchr-sse2 strrchr-avx2 \
+ strlen-sse2 strnlen-sse2 strlen-avx2 strnlen-avx2 \
+ strcat-ssse3 strncat-ssse3\
+ strcpy-sse2 stpcpy-sse2 \
strcpy-ssse3 strncpy-ssse3 stpcpy-ssse3 stpncpy-ssse3 \
strcpy-sse2-unaligned strncpy-sse2-unaligned \
stpcpy-sse2-unaligned stpncpy-sse2-unaligned \
+ strcat-sse2 \
strcat-sse2-unaligned strncat-sse2-unaligned \
strchr-sse2-no-bsf memcmp-ssse3 strstr-sse2-unaligned \
- strcspn-c strpbrk-c strspn-c varshift memset-avx2 \
- memset-avx512-no-vzeroupper
+ strcspn-sse2 strpbrk-sse2 strspn-sse2 \
+ strcspn-c strpbrk-c strspn-c varshift \
+ memset-avx512-no-vzeroupper \
+ memmove-sse2-unaligned-erms \
+ memmove-avx-unaligned-erms \
+ memmove-avx512-unaligned-erms \
+ memset-sse2-unaligned-erms \
+ memset-avx2-unaligned-erms \
+ memset-avx512-unaligned-erms
CFLAGS-varshift.c += -msse4
CFLAGS-strcspn-c.c += -msse4
CFLAGS-strpbrk-c.c += -msse4
@@ -28,5 +48,20 @@ CFLAGS-strspn-c.c += -msse4
endif
ifeq ($(subdir),wcsmbs)
-sysdep_routines += wmemcmp-sse4 wmemcmp-ssse3 wmemcmp-c wcscpy-ssse3 wcscpy-c
+sysdep_routines += wmemcmp-sse4 wmemcmp-ssse3 wmemcmp-c \
+ wmemcmp-avx2-movbe \
+ wmemchr-sse2 wmemchr-avx2 \
+ wcscmp-sse2 wcscmp-avx2 \
+ wcsncmp-sse2 wcsncmp-avx2 \
+ wcscpy-ssse3 wcscpy-c \
+ wcschr-sse2 wcschr-avx2 \
+ wcsrchr-sse2 wcsrchr-avx2 \
+ wcsnlen-sse4_1 wcsnlen-c \
+ wcslen-sse2 wcslen-avx2 wcsnlen-avx2
+endif
+
+ifeq ($(subdir),debug)
+sysdep_routines += memcpy_chk-nonshared mempcpy_chk-nonshared \
+ memmove_chk-nonshared memset_chk-nonshared \
+ wmemset_chk-nonshared
endif
diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h
new file mode 100644
index 0000000000..9cab837642
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h
@@ -0,0 +1,36 @@
+/* Common definition for ifunc selections optimized with SSE2 and AVX2.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (!CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX_Fast_Unaligned_Load))
+ return OPTIMIZE (avx2);
+
+ return OPTIMIZE (sse2);
+}
diff --git a/sysdeps/x86_64/multiarch/ifunc-defines.sym b/sysdeps/x86_64/multiarch/ifunc-defines.sym
deleted file mode 100644
index 3df946f343..0000000000
--- a/sysdeps/x86_64/multiarch/ifunc-defines.sym
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "init-arch.h"
-#include <stddef.h>
-
---
-
-CPU_FEATURES_SIZE sizeof (struct cpu_features)
-CPUID_OFFSET offsetof (struct cpu_features, cpuid)
-CPUID_SIZE sizeof (struct cpuid_registers)
-CPUID_EAX_OFFSET offsetof (struct cpuid_registers, eax)
-CPUID_EBX_OFFSET offsetof (struct cpuid_registers, ebx)
-CPUID_ECX_OFFSET offsetof (struct cpuid_registers, ecx)
-CPUID_EDX_OFFSET offsetof (struct cpuid_registers, edx)
-FAMILY_OFFSET offsetof (struct cpu_features, family)
-MODEL_OFFSET offsetof (struct cpu_features, model)
-FEATURE_OFFSET offsetof (struct cpu_features, feature)
-FEATURE_SIZE sizeof (unsigned int)
-
-COMMON_CPUID_INDEX_1
-COMMON_CPUID_INDEX_7
-FEATURE_INDEX_1
diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
index 188b6d36c6..9aaaef7251 100644
--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
@@ -1,5 +1,5 @@
/* Enumerate available IFUNC implementations of a function. x86-64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,77 +38,164 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
size_t i = 0;
- /* Support sysdeps/x86_64/multiarch/memcmp.S. */
+ /* Support sysdeps/x86_64/multiarch/memchr.c. */
+ IFUNC_IMPL (i, name, memchr,
+ IFUNC_IMPL_ADD (array, i, memchr,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __memchr_avx2)
+ IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/memcmp.c. */
IFUNC_IMPL (i, name, memcmp,
+ IFUNC_IMPL_ADD (array, i, memcmp,
+ (HAS_ARCH_FEATURE (AVX2_Usable)
+ && HAS_CPU_FEATURE (MOVBE)),
+ __memcmp_avx2_movbe)
IFUNC_IMPL_ADD (array, i, memcmp, HAS_CPU_FEATURE (SSE4_1),
__memcmp_sse4_1)
IFUNC_IMPL_ADD (array, i, memcmp, HAS_CPU_FEATURE (SSSE3),
__memcmp_ssse3)
IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_sse2))
+#ifdef SHARED
/* Support sysdeps/x86_64/multiarch/memmove_chk.c. */
IFUNC_IMPL (i, name, __memmove_chk,
-#ifdef HAVE_AVX512_ASM_SUPPORT
IFUNC_IMPL_ADD (array, i, __memmove_chk,
HAS_ARCH_FEATURE (AVX512F_Usable),
__memmove_chk_avx512_no_vzeroupper)
-#endif
+ IFUNC_IMPL_ADD (array, i, __memmove_chk,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memmove_chk_avx512_unaligned)
+ IFUNC_IMPL_ADD (array, i, __memmove_chk,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memmove_chk_avx512_unaligned_erms)
IFUNC_IMPL_ADD (array, i, __memmove_chk,
HAS_ARCH_FEATURE (AVX_Usable),
__memmove_chk_avx_unaligned)
IFUNC_IMPL_ADD (array, i, __memmove_chk,
+ HAS_ARCH_FEATURE (AVX_Usable),
+ __memmove_chk_avx_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, __memmove_chk,
HAS_CPU_FEATURE (SSSE3),
__memmove_chk_ssse3_back)
IFUNC_IMPL_ADD (array, i, __memmove_chk,
HAS_CPU_FEATURE (SSSE3),
__memmove_chk_ssse3)
IFUNC_IMPL_ADD (array, i, __memmove_chk, 1,
- __memmove_chk_sse2))
+ __memmove_chk_sse2_unaligned)
+ IFUNC_IMPL_ADD (array, i, __memmove_chk, 1,
+ __memmove_chk_sse2_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, __memmove_chk, 1,
+ __memmove_chk_erms))
+#endif
- /* Support sysdeps/x86_64/multiarch/memmove.S. */
+ /* Support sysdeps/x86_64/multiarch/memmove.c. */
IFUNC_IMPL (i, name, memmove,
IFUNC_IMPL_ADD (array, i, memmove,
HAS_ARCH_FEATURE (AVX_Usable),
__memmove_avx_unaligned)
-#ifdef HAVE_AVX512_ASM_SUPPORT
+ IFUNC_IMPL_ADD (array, i, memmove,
+ HAS_ARCH_FEATURE (AVX_Usable),
+ __memmove_avx_unaligned_erms)
IFUNC_IMPL_ADD (array, i, memmove,
HAS_ARCH_FEATURE (AVX512F_Usable),
__memmove_avx512_no_vzeroupper)
-#endif
+ IFUNC_IMPL_ADD (array, i, memmove,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memmove_avx512_unaligned)
+ IFUNC_IMPL_ADD (array, i, memmove,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memmove_avx512_unaligned_erms)
IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3),
__memmove_ssse3_back)
IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3),
__memmove_ssse3)
- IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_sse2))
+ IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_erms)
+ IFUNC_IMPL_ADD (array, i, memmove, 1,
+ __memmove_sse2_unaligned)
+ IFUNC_IMPL_ADD (array, i, memmove, 1,
+ __memmove_sse2_unaligned_erms))
+
+ /* Support sysdeps/x86_64/multiarch/memrchr.c. */
+ IFUNC_IMPL (i, name, memrchr,
+ IFUNC_IMPL_ADD (array, i, memrchr,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __memrchr_avx2)
+ IFUNC_IMPL_ADD (array, i, memrchr, 1, __memrchr_sse2))
- /* Support sysdeps/x86_64/multiarch/memset_chk.S. */
+#ifdef SHARED
+ /* Support sysdeps/x86_64/multiarch/memset_chk.c. */
IFUNC_IMPL (i, name, __memset_chk,
IFUNC_IMPL_ADD (array, i, __memset_chk, 1,
- __memset_chk_sse2)
+ __memset_chk_erms)
+ IFUNC_IMPL_ADD (array, i, __memset_chk, 1,
+ __memset_chk_sse2_unaligned)
+ IFUNC_IMPL_ADD (array, i, __memset_chk, 1,
+ __memset_chk_sse2_unaligned_erms)
IFUNC_IMPL_ADD (array, i, __memset_chk,
HAS_ARCH_FEATURE (AVX2_Usable),
- __memset_chk_avx2)
-#ifdef HAVE_AVX512_ASM_SUPPORT
+ __memset_chk_avx2_unaligned)
+ IFUNC_IMPL_ADD (array, i, __memset_chk,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __memset_chk_avx2_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, __memset_chk,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memset_chk_avx512_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, __memset_chk,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memset_chk_avx512_unaligned)
IFUNC_IMPL_ADD (array, i, __memset_chk,
HAS_ARCH_FEATURE (AVX512F_Usable),
__memset_chk_avx512_no_vzeroupper)
-#endif
)
+#endif
- /* Support sysdeps/x86_64/multiarch/memset.S. */
+ /* Support sysdeps/x86_64/multiarch/memset.c. */
IFUNC_IMPL (i, name, memset,
- IFUNC_IMPL_ADD (array, i, memset, 1, __memset_sse2)
+ IFUNC_IMPL_ADD (array, i, memset, 1,
+ __memset_sse2_unaligned)
+ IFUNC_IMPL_ADD (array, i, memset, 1,
+ __memset_sse2_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, memset, 1, __memset_erms)
+ IFUNC_IMPL_ADD (array, i, memset,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __memset_avx2_unaligned)
IFUNC_IMPL_ADD (array, i, memset,
HAS_ARCH_FEATURE (AVX2_Usable),
- __memset_avx2)
-#ifdef HAVE_AVX512_ASM_SUPPORT
+ __memset_avx2_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, memset,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memset_avx512_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, memset,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memset_avx512_unaligned)
IFUNC_IMPL_ADD (array, i, memset,
HAS_ARCH_FEATURE (AVX512F_Usable),
__memset_avx512_no_vzeroupper)
-#endif
)
- /* Support sysdeps/x86_64/multiarch/stpncpy.S. */
+ /* Support sysdeps/x86_64/multiarch/rawmemchr.c. */
+ IFUNC_IMPL (i, name, rawmemchr,
+ IFUNC_IMPL_ADD (array, i, rawmemchr,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __rawmemchr_avx2)
+ IFUNC_IMPL_ADD (array, i, rawmemchr, 1, __rawmemchr_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/strlen.c. */
+ IFUNC_IMPL (i, name, strlen,
+ IFUNC_IMPL_ADD (array, i, strlen,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __strlen_avx2)
+ IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/strnlen.c. */
+ IFUNC_IMPL (i, name, strnlen,
+ IFUNC_IMPL_ADD (array, i, strnlen,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __strnlen_avx2)
+ IFUNC_IMPL_ADD (array, i, strnlen, 1, __strnlen_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/stpncpy.c. */
IFUNC_IMPL (i, name, stpncpy,
IFUNC_IMPL_ADD (array, i, stpncpy, HAS_CPU_FEATURE (SSSE3),
__stpncpy_ssse3)
@@ -116,14 +203,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__stpncpy_sse2_unaligned)
IFUNC_IMPL_ADD (array, i, stpncpy, 1, __stpncpy_sse2))
- /* Support sysdeps/x86_64/multiarch/stpcpy.S. */
+ /* Support sysdeps/x86_64/multiarch/stpcpy.c. */
IFUNC_IMPL (i, name, stpcpy,
IFUNC_IMPL_ADD (array, i, stpcpy, HAS_CPU_FEATURE (SSSE3),
__stpcpy_ssse3)
IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_sse2_unaligned)
IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_sse2))
- /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S. */
+ /* Support sysdeps/x86_64/multiarch/strcasecmp_l.c. */
IFUNC_IMPL (i, name, strcasecmp,
IFUNC_IMPL_ADD (array, i, strcasecmp,
HAS_ARCH_FEATURE (AVX_Usable),
@@ -136,7 +223,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strcasecmp_ssse3)
IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_sse2))
- /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S. */
+ /* Support sysdeps/x86_64/multiarch/strcasecmp_l.c. */
IFUNC_IMPL (i, name, strcasecmp_l,
IFUNC_IMPL_ADD (array, i, strcasecmp_l,
HAS_ARCH_FEATURE (AVX_Usable),
@@ -150,20 +237,40 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
__strcasecmp_l_sse2))
- /* Support sysdeps/x86_64/multiarch/strcat.S. */
+ /* Support sysdeps/x86_64/multiarch/strcat.c. */
IFUNC_IMPL (i, name, strcat,
IFUNC_IMPL_ADD (array, i, strcat, HAS_CPU_FEATURE (SSSE3),
__strcat_ssse3)
IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_sse2_unaligned)
IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_sse2))
- /* Support sysdeps/x86_64/multiarch/strchr.S. */
+ /* Support sysdeps/x86_64/multiarch/strchr.c. */
IFUNC_IMPL (i, name, strchr,
+ IFUNC_IMPL_ADD (array, i, strchr,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __strchr_avx2)
IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_sse2_no_bsf)
IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_sse2))
- /* Support sysdeps/x86_64/multiarch/strcmp.S. */
+ /* Support sysdeps/x86_64/multiarch/strchrnul.c. */
+ IFUNC_IMPL (i, name, strchrnul,
+ IFUNC_IMPL_ADD (array, i, strchrnul,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __strchrnul_avx2)
+ IFUNC_IMPL_ADD (array, i, strchrnul, 1, __strchrnul_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/strrchr.c. */
+ IFUNC_IMPL (i, name, strrchr,
+ IFUNC_IMPL_ADD (array, i, strrchr,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __strrchr_avx2)
+ IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/strcmp.c. */
IFUNC_IMPL (i, name, strcmp,
+ IFUNC_IMPL_ADD (array, i, strcmp,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __strcmp_avx2)
IFUNC_IMPL_ADD (array, i, strcmp, HAS_CPU_FEATURE (SSE4_2),
__strcmp_sse42)
IFUNC_IMPL_ADD (array, i, strcmp, HAS_CPU_FEATURE (SSSE3),
@@ -171,20 +278,20 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_sse2_unaligned)
IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_sse2))
- /* Support sysdeps/x86_64/multiarch/strcpy.S. */
+ /* Support sysdeps/x86_64/multiarch/strcpy.c. */
IFUNC_IMPL (i, name, strcpy,
IFUNC_IMPL_ADD (array, i, strcpy, HAS_CPU_FEATURE (SSSE3),
__strcpy_ssse3)
IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_sse2_unaligned)
IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_sse2))
- /* Support sysdeps/x86_64/multiarch/strcspn.S. */
+ /* Support sysdeps/x86_64/multiarch/strcspn.c. */
IFUNC_IMPL (i, name, strcspn,
IFUNC_IMPL_ADD (array, i, strcspn, HAS_CPU_FEATURE (SSE4_2),
__strcspn_sse42)
IFUNC_IMPL_ADD (array, i, strcspn, 1, __strcspn_sse2))
- /* Support sysdeps/x86_64/multiarch/strncase_l.S. */
+ /* Support sysdeps/x86_64/multiarch/strncase_l.c. */
IFUNC_IMPL (i, name, strncasecmp,
IFUNC_IMPL_ADD (array, i, strncasecmp,
HAS_ARCH_FEATURE (AVX_Usable),
@@ -198,7 +305,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strncasecmp, 1,
__strncasecmp_sse2))
- /* Support sysdeps/x86_64/multiarch/strncase_l.S. */
+ /* Support sysdeps/x86_64/multiarch/strncase_l.c. */
IFUNC_IMPL (i, name, strncasecmp_l,
IFUNC_IMPL_ADD (array, i, strncasecmp_l,
HAS_ARCH_FEATURE (AVX_Usable),
@@ -212,7 +319,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
__strncasecmp_l_sse2))
- /* Support sysdeps/x86_64/multiarch/strncat.S. */
+ /* Support sysdeps/x86_64/multiarch/strncat.c. */
IFUNC_IMPL (i, name, strncat,
IFUNC_IMPL_ADD (array, i, strncat, HAS_CPU_FEATURE (SSSE3),
__strncat_ssse3)
@@ -220,7 +327,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strncat_sse2_unaligned)
IFUNC_IMPL_ADD (array, i, strncat, 1, __strncat_sse2))
- /* Support sysdeps/x86_64/multiarch/strncpy.S. */
+ /* Support sysdeps/x86_64/multiarch/strncpy.c. */
IFUNC_IMPL (i, name, strncpy,
IFUNC_IMPL_ADD (array, i, strncpy, HAS_CPU_FEATURE (SSSE3),
__strncpy_ssse3)
@@ -228,14 +335,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__strncpy_sse2_unaligned)
IFUNC_IMPL_ADD (array, i, strncpy, 1, __strncpy_sse2))
- /* Support sysdeps/x86_64/multiarch/strpbrk.S. */
+ /* Support sysdeps/x86_64/multiarch/strpbrk.c. */
IFUNC_IMPL (i, name, strpbrk,
IFUNC_IMPL_ADD (array, i, strpbrk, HAS_CPU_FEATURE (SSE4_2),
__strpbrk_sse42)
IFUNC_IMPL_ADD (array, i, strpbrk, 1, __strpbrk_sse2))
- /* Support sysdeps/x86_64/multiarch/strspn.S. */
+ /* Support sysdeps/x86_64/multiarch/strspn.c. */
IFUNC_IMPL (i, name, strspn,
IFUNC_IMPL_ADD (array, i, strspn, HAS_CPU_FEATURE (SSE4_2),
__strspn_sse42)
@@ -246,99 +353,226 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_IMPL_ADD (array, i, strstr, 1, __strstr_sse2_unaligned)
IFUNC_IMPL_ADD (array, i, strstr, 1, __strstr_sse2))
- /* Support sysdeps/x86_64/multiarch/wcscpy.S. */
+ /* Support sysdeps/x86_64/multiarch/wcschr.c. */
+ IFUNC_IMPL (i, name, wcschr,
+ IFUNC_IMPL_ADD (array, i, wcschr,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __wcschr_avx2)
+ IFUNC_IMPL_ADD (array, i, wcschr, 1, __wcschr_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/wcsrchr.c. */
+ IFUNC_IMPL (i, name, wcsrchr,
+ IFUNC_IMPL_ADD (array, i, wcsrchr,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __wcsrchr_avx2)
+ IFUNC_IMPL_ADD (array, i, wcsrchr, 1, __wcsrchr_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/wcscmp.c. */
+ IFUNC_IMPL (i, name, wcscmp,
+ IFUNC_IMPL_ADD (array, i, wcscmp,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __wcscmp_avx2)
+ IFUNC_IMPL_ADD (array, i, wcscmp, 1, __wcscmp_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/wcsncmp.c. */
+ IFUNC_IMPL (i, name, wcsncmp,
+ IFUNC_IMPL_ADD (array, i, wcsncmp,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __wcsncmp_avx2)
+ IFUNC_IMPL_ADD (array, i, wcsncmp, 1, __wcsncmp_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/wcscpy.c. */
IFUNC_IMPL (i, name, wcscpy,
IFUNC_IMPL_ADD (array, i, wcscpy, HAS_CPU_FEATURE (SSSE3),
__wcscpy_ssse3)
IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_sse2))
- /* Support sysdeps/x86_64/multiarch/wmemcmp.S. */
+ /* Support sysdeps/x86_64/multiarch/wcslen.c. */
+ IFUNC_IMPL (i, name, wcslen,
+ IFUNC_IMPL_ADD (array, i, wcslen,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __wcslen_avx2)
+ IFUNC_IMPL_ADD (array, i, wcslen, 1, __wcslen_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/wcsnlen.c. */
+ IFUNC_IMPL (i, name, wcsnlen,
+ IFUNC_IMPL_ADD (array, i, wcsnlen,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __wcsnlen_avx2)
+ IFUNC_IMPL_ADD (array, i, wcsnlen,
+ HAS_CPU_FEATURE (SSE4_1),
+ __wcsnlen_sse4_1)
+ IFUNC_IMPL_ADD (array, i, wcsnlen, 1, __wcsnlen_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/wmemchr.c. */
+ IFUNC_IMPL (i, name, wmemchr,
+ IFUNC_IMPL_ADD (array, i, wmemchr,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __wmemchr_avx2)
+ IFUNC_IMPL_ADD (array, i, wmemchr, 1, __wmemchr_sse2))
+
+ /* Support sysdeps/x86_64/multiarch/wmemcmp.c. */
IFUNC_IMPL (i, name, wmemcmp,
+ IFUNC_IMPL_ADD (array, i, wmemcmp,
+ (HAS_ARCH_FEATURE (AVX2_Usable)
+ && HAS_CPU_FEATURE (MOVBE)),
+ __wmemcmp_avx2_movbe)
IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_CPU_FEATURE (SSE4_1),
__wmemcmp_sse4_1)
IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_CPU_FEATURE (SSSE3),
__wmemcmp_ssse3)
IFUNC_IMPL_ADD (array, i, wmemcmp, 1, __wmemcmp_sse2))
+ /* Support sysdeps/x86_64/multiarch/wmemset.c. */
+ IFUNC_IMPL (i, name, wmemset,
+ IFUNC_IMPL_ADD (array, i, wmemset, 1,
+ __wmemset_sse2_unaligned)
+ IFUNC_IMPL_ADD (array, i, wmemset,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __wmemset_avx2_unaligned)
+ IFUNC_IMPL_ADD (array, i, wmemset,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __wmemset_avx512_unaligned))
+
#ifdef SHARED
- /* Support sysdeps/x86_64/multiarch/memcpy_chk.S. */
+ /* Support sysdeps/x86_64/multiarch/memcpy_chk.c. */
IFUNC_IMPL (i, name, __memcpy_chk,
-#ifdef HAVE_AVX512_ASM_SUPPORT
IFUNC_IMPL_ADD (array, i, __memcpy_chk,
HAS_ARCH_FEATURE (AVX512F_Usable),
__memcpy_chk_avx512_no_vzeroupper)
-#endif
+ IFUNC_IMPL_ADD (array, i, __memcpy_chk,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memcpy_chk_avx512_unaligned)
+ IFUNC_IMPL_ADD (array, i, __memcpy_chk,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memcpy_chk_avx512_unaligned_erms)
IFUNC_IMPL_ADD (array, i, __memcpy_chk,
HAS_ARCH_FEATURE (AVX_Usable),
__memcpy_chk_avx_unaligned)
IFUNC_IMPL_ADD (array, i, __memcpy_chk,
+ HAS_ARCH_FEATURE (AVX_Usable),
+ __memcpy_chk_avx_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, __memcpy_chk,
HAS_CPU_FEATURE (SSSE3),
__memcpy_chk_ssse3_back)
IFUNC_IMPL_ADD (array, i, __memcpy_chk,
HAS_CPU_FEATURE (SSSE3),
__memcpy_chk_ssse3)
IFUNC_IMPL_ADD (array, i, __memcpy_chk, 1,
- __memcpy_chk_sse2))
+ __memcpy_chk_sse2_unaligned)
+ IFUNC_IMPL_ADD (array, i, __memcpy_chk, 1,
+ __memcpy_chk_sse2_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, __memcpy_chk, 1,
+ __memcpy_chk_erms))
+#endif
- /* Support sysdeps/x86_64/multiarch/memcpy.S. */
+ /* Support sysdeps/x86_64/multiarch/memcpy.c. */
IFUNC_IMPL (i, name, memcpy,
IFUNC_IMPL_ADD (array, i, memcpy,
HAS_ARCH_FEATURE (AVX_Usable),
__memcpy_avx_unaligned)
+ IFUNC_IMPL_ADD (array, i, memcpy,
+ HAS_ARCH_FEATURE (AVX_Usable),
+ __memcpy_avx_unaligned_erms)
IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3),
__memcpy_ssse3_back)
IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3),
__memcpy_ssse3)
-#ifdef HAVE_AVX512_ASM_SUPPORT
IFUNC_IMPL_ADD (array, i, memcpy,
HAS_ARCH_FEATURE (AVX512F_Usable),
__memcpy_avx512_no_vzeroupper)
-#endif
+ IFUNC_IMPL_ADD (array, i, memcpy,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memcpy_avx512_unaligned)
+ IFUNC_IMPL_ADD (array, i, memcpy,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __memcpy_avx512_unaligned_erms)
IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2_unaligned)
- IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2))
+ IFUNC_IMPL_ADD (array, i, memcpy, 1,
+ __memcpy_sse2_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_erms))
- /* Support sysdeps/x86_64/multiarch/mempcpy_chk.S. */
+#ifdef SHARED
+ /* Support sysdeps/x86_64/multiarch/mempcpy_chk.c. */
IFUNC_IMPL (i, name, __mempcpy_chk,
-#ifdef HAVE_AVX512_ASM_SUPPORT
IFUNC_IMPL_ADD (array, i, __mempcpy_chk,
HAS_ARCH_FEATURE (AVX512F_Usable),
__mempcpy_chk_avx512_no_vzeroupper)
-#endif
+ IFUNC_IMPL_ADD (array, i, __mempcpy_chk,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __mempcpy_chk_avx512_unaligned)
+ IFUNC_IMPL_ADD (array, i, __mempcpy_chk,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __mempcpy_chk_avx512_unaligned_erms)
IFUNC_IMPL_ADD (array, i, __mempcpy_chk,
HAS_ARCH_FEATURE (AVX_Usable),
__mempcpy_chk_avx_unaligned)
IFUNC_IMPL_ADD (array, i, __mempcpy_chk,
+ HAS_ARCH_FEATURE (AVX_Usable),
+ __mempcpy_chk_avx_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, __mempcpy_chk,
HAS_CPU_FEATURE (SSSE3),
__mempcpy_chk_ssse3_back)
IFUNC_IMPL_ADD (array, i, __mempcpy_chk,
HAS_CPU_FEATURE (SSSE3),
__mempcpy_chk_ssse3)
IFUNC_IMPL_ADD (array, i, __mempcpy_chk, 1,
- __mempcpy_chk_sse2))
+ __mempcpy_chk_sse2_unaligned)
+ IFUNC_IMPL_ADD (array, i, __mempcpy_chk, 1,
+ __mempcpy_chk_sse2_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, __mempcpy_chk, 1,
+ __mempcpy_chk_erms))
+#endif
- /* Support sysdeps/x86_64/multiarch/mempcpy.S. */
+ /* Support sysdeps/x86_64/multiarch/mempcpy.c. */
IFUNC_IMPL (i, name, mempcpy,
-#ifdef HAVE_AVX512_ASM_SUPPORT
IFUNC_IMPL_ADD (array, i, mempcpy,
HAS_ARCH_FEATURE (AVX512F_Usable),
__mempcpy_avx512_no_vzeroupper)
-#endif
+ IFUNC_IMPL_ADD (array, i, mempcpy,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __mempcpy_avx512_unaligned)
+ IFUNC_IMPL_ADD (array, i, mempcpy,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __mempcpy_avx512_unaligned_erms)
IFUNC_IMPL_ADD (array, i, mempcpy,
HAS_ARCH_FEATURE (AVX_Usable),
__mempcpy_avx_unaligned)
+ IFUNC_IMPL_ADD (array, i, mempcpy,
+ HAS_ARCH_FEATURE (AVX_Usable),
+ __mempcpy_avx_unaligned_erms)
IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3),
__mempcpy_ssse3_back)
IFUNC_IMPL_ADD (array, i, mempcpy, HAS_CPU_FEATURE (SSSE3),
__mempcpy_ssse3)
- IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_sse2))
+ IFUNC_IMPL_ADD (array, i, mempcpy, 1,
+ __mempcpy_sse2_unaligned)
+ IFUNC_IMPL_ADD (array, i, mempcpy, 1,
+ __mempcpy_sse2_unaligned_erms)
+ IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_erms))
- /* Support sysdeps/x86_64/multiarch/strncmp.S. */
+ /* Support sysdeps/x86_64/multiarch/strncmp.c. */
IFUNC_IMPL (i, name, strncmp,
+ IFUNC_IMPL_ADD (array, i, strncmp,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __strncmp_avx2)
IFUNC_IMPL_ADD (array, i, strncmp, HAS_CPU_FEATURE (SSE4_2),
__strncmp_sse42)
IFUNC_IMPL_ADD (array, i, strncmp, HAS_CPU_FEATURE (SSSE3),
__strncmp_ssse3)
IFUNC_IMPL_ADD (array, i, strncmp, 1, __strncmp_sse2))
+
+#ifdef SHARED
+ /* Support sysdeps/x86_64/multiarch/wmemset_chk.c. */
+ IFUNC_IMPL (i, name, __wmemset_chk,
+ IFUNC_IMPL_ADD (array, i, __wmemset_chk, 1,
+ __wmemset_chk_sse2_unaligned)
+ IFUNC_IMPL_ADD (array, i, __wmemset_chk,
+ HAS_ARCH_FEATURE (AVX2_Usable),
+ __wmemset_chk_avx2_unaligned)
+ IFUNC_IMPL_ADD (array, i, __wmemset_chk,
+ HAS_ARCH_FEATURE (AVX512F_Usable),
+ __wmemset_chk_avx512_unaligned))
#endif
return i;
diff --git a/sysdeps/x86_64/multiarch/ifunc-memcmp.h b/sysdeps/x86_64/multiarch/ifunc-memcmp.h
new file mode 100644
index 0000000000..bf5ab8eb7f
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/ifunc-memcmp.h
@@ -0,0 +1,45 @@
+/* Common definition for memcmp/wmemcmp ifunc selections.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse4_1) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_movbe) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (!CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)
+ && CPU_FEATURES_CPU_P (cpu_features, MOVBE)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX_Fast_Unaligned_Load))
+ return OPTIMIZE (avx2_movbe);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE4_1))
+ return OPTIMIZE (sse4_1);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+ return OPTIMIZE (ssse3);
+
+ return OPTIMIZE (sse2);
+}
diff --git a/sysdeps/x86_64/multiarch/ifunc-memmove.h b/sysdeps/x86_64/multiarch/ifunc-memmove.h
new file mode 100644
index 0000000000..5b1eb1c92c
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/ifunc-memmove.h
@@ -0,0 +1,81 @@
+/* Common definition for memcpy, mempcpy and memmove implementation.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (erms) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned_erms)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3_back) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx_unaligned) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx_unaligned_erms)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx512_unaligned)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx512_unaligned_erms)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx512_no_vzeroupper)
+ attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, Prefer_ERMS)
+ || CPU_FEATURES_ARCH_P (cpu_features, Prefer_FSRM))
+ return OPTIMIZE (erms);
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
+ && !CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_AVX512))
+ {
+ if (CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER))
+ return OPTIMIZE (avx512_no_vzeroupper);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, ERMS))
+ return OPTIMIZE (avx512_unaligned_erms);
+
+ return OPTIMIZE (avx512_unaligned);
+ }
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX_Fast_Unaligned_Load))
+ {
+ if (CPU_FEATURES_CPU_P (cpu_features, ERMS))
+ return OPTIMIZE (avx_unaligned_erms);
+
+ return OPTIMIZE (avx_unaligned);
+ }
+
+ if (!CPU_FEATURES_CPU_P (cpu_features, SSSE3)
+ || CPU_FEATURES_ARCH_P (cpu_features, Fast_Unaligned_Copy))
+ {
+ if (CPU_FEATURES_CPU_P (cpu_features, ERMS))
+ return OPTIMIZE (sse2_unaligned_erms);
+
+ return OPTIMIZE (sse2_unaligned);
+ }
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Copy_Backward))
+ return OPTIMIZE (ssse3_back);
+
+ return OPTIMIZE (ssse3);
+}
diff --git a/sysdeps/x86_64/multiarch/ifunc-memset.h b/sysdeps/x86_64/multiarch/ifunc-memset.h
new file mode 100644
index 0000000000..19b5ae676c
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/ifunc-memset.h
@@ -0,0 +1,69 @@
+/* Common definition for memset/memset_chk ifunc selections.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (erms) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned_erms)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_unaligned) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_unaligned_erms)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx512_unaligned)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx512_unaligned_erms)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx512_no_vzeroupper)
+ attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, Prefer_ERMS))
+ return OPTIMIZE (erms);
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
+ && !CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_AVX512))
+ {
+ if (CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER))
+ return OPTIMIZE (avx512_no_vzeroupper);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, ERMS))
+ return OPTIMIZE (avx512_unaligned_erms);
+
+ return OPTIMIZE (avx512_unaligned);
+ }
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable))
+ {
+ if (CPU_FEATURES_CPU_P (cpu_features, ERMS))
+ return OPTIMIZE (avx2_unaligned_erms);
+ else
+ return OPTIMIZE (avx2_unaligned);
+ }
+
+ if (CPU_FEATURES_CPU_P (cpu_features, ERMS))
+ return OPTIMIZE (sse2_unaligned_erms);
+
+ return OPTIMIZE (sse2_unaligned);
+}
diff --git a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h
new file mode 100644
index 0000000000..f2b791cccf
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h
@@ -0,0 +1,34 @@
+/* Common definition for ifunc selections optimized with SSE2 and SSE4.2.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE4_2))
+ return OPTIMIZE (sse42);
+
+ return OPTIMIZE (sse2);
+}
diff --git a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
new file mode 100644
index 0000000000..1ca170b663
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h
@@ -0,0 +1,43 @@
+/* Common definition for strcasecmp famly ifunc selections.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX_Usable))
+ return OPTIMIZE (avx);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE4_2)
+ && !CPU_FEATURES_ARCH_P (cpu_features, Slow_SSE4_2))
+ return OPTIMIZE (sse42);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+ return OPTIMIZE (ssse3);
+
+ return OPTIMIZE (sse2);
+}
diff --git a/sysdeps/x86_64/multiarch/ifunc-unaligned-ssse3.h b/sysdeps/x86_64/multiarch/ifunc-unaligned-ssse3.h
new file mode 100644
index 0000000000..81805f9832
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/ifunc-unaligned-ssse3.h
@@ -0,0 +1,40 @@
+/* Common definition for ifunc selections optimized with SSE2, unaligned
+ SSE2 and SSSE3.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned)
+ attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Unaligned_Load))
+ return OPTIMIZE (sse2_unaligned);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+ return OPTIMIZE (ssse3);
+
+ return OPTIMIZE (sse2);
+}
diff --git a/sysdeps/x86_64/multiarch/ifunc-wmemset.h b/sysdeps/x86_64/multiarch/ifunc-wmemset.h
new file mode 100644
index 0000000000..2f1085f5fc
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/ifunc-wmemset.h
@@ -0,0 +1,42 @@
+/* Common definition for wmemset/wmemset_chk ifunc selections.
+ Copyright (C) 2017-2018 Free Software 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_unaligned) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx512_unaligned) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (!CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX_Fast_Unaligned_Load))
+ {
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
+ && !CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_AVX512))
+ return OPTIMIZE (avx512_unaligned);
+ else
+ return OPTIMIZE (avx2_unaligned);
+ }
+
+ return OPTIMIZE (sse2_unaligned);
+}
diff --git a/sysdeps/x86_64/multiarch/memchr-avx2.S b/sysdeps/x86_64/multiarch/memchr-avx2.S
new file mode 100644
index 0000000000..5f5e772554
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memchr-avx2.S
@@ -0,0 +1,340 @@
+/* memchr/wmemchr optimized with AVX2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+
+# ifndef MEMCHR
+# define MEMCHR __memchr_avx2
+# endif
+
+# ifdef USE_AS_WMEMCHR
+# define VPCMPEQ vpcmpeqd
+# else
+# define VPCMPEQ vpcmpeqb
+# endif
+
+# ifndef VZEROUPPER
+# define VZEROUPPER vzeroupper
+# endif
+
+# define VEC_SIZE 32
+
+ .section .text.avx,"ax",@progbits
+ENTRY (MEMCHR)
+# ifndef USE_AS_RAWMEMCHR
+ /* Check for zero length. */
+ testq %rdx, %rdx
+ jz L(null)
+# endif
+ movl %edi, %ecx
+ /* Broadcast CHAR to YMM0. */
+ vmovd %esi, %xmm0
+# ifdef USE_AS_WMEMCHR
+ shl $2, %rdx
+ vpbroadcastd %xmm0, %ymm0
+# else
+ vpbroadcastb %xmm0, %ymm0
+# endif
+ /* Check if we may cross page boundary with one vector load. */
+ andl $(2 * VEC_SIZE - 1), %ecx
+ cmpl $VEC_SIZE, %ecx
+ ja L(cros_page_boundary)
+
+ /* Check the first VEC_SIZE bytes. */
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+
+# ifndef USE_AS_RAWMEMCHR
+ jnz L(first_vec_x0_check)
+ /* Adjust length and check the end of data. */
+ subq $VEC_SIZE, %rdx
+ jbe L(zero)
+# else
+ jnz L(first_vec_x0)
+# endif
+
+ /* Align data for aligned loads in the loop. */
+ addq $VEC_SIZE, %rdi
+ andl $(VEC_SIZE - 1), %ecx
+ andq $-VEC_SIZE, %rdi
+
+# ifndef USE_AS_RAWMEMCHR
+ /* Adjust length. */
+ addq %rcx, %rdx
+
+ subq $(VEC_SIZE * 4), %rdx
+ jbe L(last_4x_vec_or_less)
+# endif
+ jmp L(more_4x_vec)
+
+ .p2align 4
+L(cros_page_boundary):
+ andl $(VEC_SIZE - 1), %ecx
+ andq $-VEC_SIZE, %rdi
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ /* Remove the leading bytes. */
+ sarl %cl, %eax
+ testl %eax, %eax
+ jz L(aligned_more)
+ tzcntl %eax, %eax
+# ifndef USE_AS_RAWMEMCHR
+ /* Check the end of data. */
+ cmpq %rax, %rdx
+ jbe L(zero)
+# endif
+ addq %rdi, %rax
+ addq %rcx, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(aligned_more):
+# ifndef USE_AS_RAWMEMCHR
+ /* Calculate "rdx + rcx - VEC_SIZE" with "rdx - (VEC_SIZE - rcx)"
+ instead of "(rdx + rcx) - VEC_SIZE" to void possible addition
+ overflow. */
+ negq %rcx
+ addq $VEC_SIZE, %rcx
+
+ /* Check the end of data. */
+ subq %rcx, %rdx
+ jbe L(zero)
+# endif
+
+ addq $VEC_SIZE, %rdi
+
+# ifndef USE_AS_RAWMEMCHR
+ subq $(VEC_SIZE * 4), %rdx
+ jbe L(last_4x_vec_or_less)
+# endif
+
+L(more_4x_vec):
+ /* Check the first 4 * VEC_SIZE. Only one VEC_SIZE at a time
+ since data is only aligned to VEC_SIZE. */
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x0)
+
+ VPCMPEQ VEC_SIZE(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x1)
+
+ VPCMPEQ (VEC_SIZE * 2)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x2)
+
+ VPCMPEQ (VEC_SIZE * 3)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x3)
+
+ addq $(VEC_SIZE * 4), %rdi
+
+# ifndef USE_AS_RAWMEMCHR
+ subq $(VEC_SIZE * 4), %rdx
+ jbe L(last_4x_vec_or_less)
+# endif
+
+ /* Align data to 4 * VEC_SIZE. */
+ movq %rdi, %rcx
+ andl $(4 * VEC_SIZE - 1), %ecx
+ andq $-(4 * VEC_SIZE), %rdi
+
+# ifndef USE_AS_RAWMEMCHR
+ /* Adjust length. */
+ addq %rcx, %rdx
+# endif
+
+ .p2align 4
+L(loop_4x_vec):
+ /* Compare 4 * VEC at a time forward. */
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ VPCMPEQ VEC_SIZE(%rdi), %ymm0, %ymm2
+ VPCMPEQ (VEC_SIZE * 2)(%rdi), %ymm0, %ymm3
+ VPCMPEQ (VEC_SIZE * 3)(%rdi), %ymm0, %ymm4
+
+ vpor %ymm1, %ymm2, %ymm5
+ vpor %ymm3, %ymm4, %ymm6
+ vpor %ymm5, %ymm6, %ymm5
+
+ vpmovmskb %ymm5, %eax
+ testl %eax, %eax
+ jnz L(4x_vec_end)
+
+ addq $(VEC_SIZE * 4), %rdi
+
+# ifdef USE_AS_RAWMEMCHR
+ jmp L(loop_4x_vec)
+# else
+ subq $(VEC_SIZE * 4), %rdx
+ ja L(loop_4x_vec)
+
+L(last_4x_vec_or_less):
+ /* Less than 4 * VEC and aligned to VEC_SIZE. */
+ addl $(VEC_SIZE * 2), %edx
+ jle L(last_2x_vec)
+
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x0)
+
+ VPCMPEQ VEC_SIZE(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x1)
+
+ VPCMPEQ (VEC_SIZE * 2)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+
+ jnz L(first_vec_x2_check)
+ subl $VEC_SIZE, %edx
+ jle L(zero)
+
+ VPCMPEQ (VEC_SIZE * 3)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+
+ jnz L(first_vec_x3_check)
+ xorl %eax, %eax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_2x_vec):
+ addl $(VEC_SIZE * 2), %edx
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+
+ jnz L(first_vec_x0_check)
+ subl $VEC_SIZE, %edx
+ jle L(zero)
+
+ VPCMPEQ VEC_SIZE(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x1_check)
+ xorl %eax, %eax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x0_check):
+ tzcntl %eax, %eax
+ /* Check the end of data. */
+ cmpq %rax, %rdx
+ jbe L(zero)
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x1_check):
+ tzcntl %eax, %eax
+ /* Check the end of data. */
+ cmpq %rax, %rdx
+ jbe L(zero)
+ addq $VEC_SIZE, %rax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x2_check):
+ tzcntl %eax, %eax
+ /* Check the end of data. */
+ cmpq %rax, %rdx
+ jbe L(zero)
+ addq $(VEC_SIZE * 2), %rax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x3_check):
+ tzcntl %eax, %eax
+ /* Check the end of data. */
+ cmpq %rax, %rdx
+ jbe L(zero)
+ addq $(VEC_SIZE * 3), %rax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(zero):
+ VZEROUPPER
+L(null):
+ xorl %eax, %eax
+ ret
+# endif
+
+ .p2align 4
+L(first_vec_x0):
+ tzcntl %eax, %eax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x1):
+ tzcntl %eax, %eax
+ addq $VEC_SIZE, %rax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x2):
+ tzcntl %eax, %eax
+ addq $(VEC_SIZE * 2), %rax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(4x_vec_end):
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x0)
+ vpmovmskb %ymm2, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x1)
+ vpmovmskb %ymm3, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x2)
+ vpmovmskb %ymm4, %eax
+ testl %eax, %eax
+L(first_vec_x3):
+ tzcntl %eax, %eax
+ addq $(VEC_SIZE * 3), %rax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+END (MEMCHR)
+#endif
diff --git a/sysdeps/x86_64/multiarch/memchr-sse2.S b/sysdeps/x86_64/multiarch/memchr-sse2.S
new file mode 100644
index 0000000000..8a5e7fd1c5
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memchr-sse2.S
@@ -0,0 +1,28 @@
+/* memchr optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define memchr __memchr_sse2
+
+# undef strong_alias
+# define strong_alias(memchr, __memchr)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(memchr)
+#endif
+
+#include "../memchr.S"
diff --git a/sysdeps/x86_64/multiarch/memchr.c b/sysdeps/x86_64/multiarch/memchr.c
new file mode 100644
index 0000000000..016f57846a
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memchr.c
@@ -0,0 +1,35 @@
+/* Multiple versions of memchr
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define memchr __redirect_memchr
+# include <string.h>
+# undef memchr
+
+# define SYMBOL_NAME memchr
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_memchr, memchr, IFUNC_SELECTOR ());
+strong_alias (memchr, __memchr)
+# ifdef SHARED
+__hidden_ver1 (memchr, __GI_memchr, __redirect_memchr)
+ __attribute__((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S b/sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S
new file mode 100644
index 0000000000..30f764c393
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S
@@ -0,0 +1,429 @@
+/* memcmp/wmemcmp optimized with AVX2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+/* memcmp/wmemcmp is implemented as:
+ 1. For size from 2 to 7 bytes, load as big endian with movbe and bswap
+ to avoid branches.
+ 2. Use overlapping compare to avoid branch.
+ 3. Use vector compare when size >= 4 bytes for memcmp or size >= 8
+ bytes for wmemcmp.
+ 4. If size is 8 * VEC_SIZE or less, unroll the loop.
+ 5. Compare 4 * VEC_SIZE at a time with the aligned first memory
+ area.
+ 6. Use 2 vector compares when size is 2 * VEC_SIZE or less.
+ 7. Use 4 vector compares when size is 4 * VEC_SIZE or less.
+ 8. Use 8 vector compares when size is 8 * VEC_SIZE or less. */
+
+# include <sysdep.h>
+
+# ifndef MEMCMP
+# define MEMCMP __memcmp_avx2_movbe
+# endif
+
+# ifdef USE_AS_WMEMCMP
+# define VPCMPEQ vpcmpeqd
+# else
+# define VPCMPEQ vpcmpeqb
+# endif
+
+# ifndef VZEROUPPER
+# define VZEROUPPER vzeroupper
+# endif
+
+# define VEC_SIZE 32
+# define VEC_MASK ((1 << VEC_SIZE) - 1)
+
+/* Warning!
+ wmemcmp has to use SIGNED comparison for elements.
+ memcmp has to use UNSIGNED comparison for elemnts.
+*/
+
+ .section .text.avx,"ax",@progbits
+ENTRY (MEMCMP)
+# ifdef USE_AS_WMEMCMP
+ shl $2, %rdx
+# endif
+ cmpq $VEC_SIZE, %rdx
+ jb L(less_vec)
+
+ /* From VEC to 2 * VEC. No branch when size == VEC_SIZE. */
+ vmovdqu (%rsi), %ymm2
+ VPCMPEQ (%rdi), %ymm2, %ymm2
+ vpmovmskb %ymm2, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec)
+
+ cmpq $(VEC_SIZE * 2), %rdx
+ jbe L(last_vec)
+
+ VPCMPEQ %ymm0, %ymm0, %ymm0
+ /* More than 2 * VEC. */
+ cmpq $(VEC_SIZE * 8), %rdx
+ ja L(more_8x_vec)
+ cmpq $(VEC_SIZE * 4), %rdx
+ jb L(last_4x_vec)
+
+ /* From 4 * VEC to 8 * VEC, inclusively. */
+ vmovdqu (%rsi), %ymm1
+ VPCMPEQ (%rdi), %ymm1, %ymm1
+
+ vmovdqu VEC_SIZE(%rsi), %ymm2
+ VPCMPEQ VEC_SIZE(%rdi), %ymm2, %ymm2
+
+ vmovdqu (VEC_SIZE * 2)(%rsi), %ymm3
+ VPCMPEQ (VEC_SIZE * 2)(%rdi), %ymm3, %ymm3
+
+ vmovdqu (VEC_SIZE * 3)(%rsi), %ymm4
+ VPCMPEQ (VEC_SIZE * 3)(%rdi), %ymm4, %ymm4
+
+ vpand %ymm1, %ymm2, %ymm5
+ vpand %ymm3, %ymm4, %ymm6
+ vpand %ymm5, %ymm6, %ymm5
+
+ vptest %ymm0, %ymm5
+ jnc L(4x_vec_end)
+
+ leaq -(4 * VEC_SIZE)(%rdi, %rdx), %rdi
+ leaq -(4 * VEC_SIZE)(%rsi, %rdx), %rsi
+ vmovdqu (%rsi), %ymm1
+ VPCMPEQ (%rdi), %ymm1, %ymm1
+
+ vmovdqu VEC_SIZE(%rsi), %ymm2
+ VPCMPEQ VEC_SIZE(%rdi), %ymm2, %ymm2
+ vpand %ymm2, %ymm1, %ymm5
+
+ vmovdqu (VEC_SIZE * 2)(%rsi), %ymm3
+ VPCMPEQ (VEC_SIZE * 2)(%rdi), %ymm3, %ymm3
+ vpand %ymm3, %ymm5, %ymm5
+
+ vmovdqu (VEC_SIZE * 3)(%rsi), %ymm4
+ VPCMPEQ (VEC_SIZE * 3)(%rdi), %ymm4, %ymm4
+ vpand %ymm4, %ymm5, %ymm5
+
+ vptest %ymm0, %ymm5
+ jnc L(4x_vec_end)
+ xorl %eax, %eax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_2x_vec):
+ /* From VEC to 2 * VEC. No branch when size == VEC_SIZE. */
+ vmovdqu (%rsi), %ymm2
+ VPCMPEQ (%rdi), %ymm2, %ymm2
+ vpmovmskb %ymm2, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec)
+
+L(last_vec):
+ /* Use overlapping loads to avoid branches. */
+ leaq -VEC_SIZE(%rdi, %rdx), %rdi
+ leaq -VEC_SIZE(%rsi, %rdx), %rsi
+ vmovdqu (%rsi), %ymm2
+ VPCMPEQ (%rdi), %ymm2, %ymm2
+ vpmovmskb %ymm2, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec)
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec):
+ /* A byte or int32 is different within 16 or 32 bytes. */
+ tzcntl %eax, %ecx
+# ifdef USE_AS_WMEMCMP
+ xorl %eax, %eax
+ movl (%rdi, %rcx), %edx
+ cmpl (%rsi, %rcx), %edx
+L(wmemcmp_return):
+ setl %al
+ negl %eax
+ orl $1, %eax
+# else
+ movzbl (%rdi, %rcx), %eax
+ movzbl (%rsi, %rcx), %edx
+ sub %edx, %eax
+# endif
+ VZEROUPPER
+ ret
+
+# ifdef USE_AS_WMEMCMP
+ .p2align 4
+L(4):
+ xorl %eax, %eax
+ movl (%rdi), %edx
+ cmpl (%rsi), %edx
+ jne L(wmemcmp_return)
+ ret
+# else
+ .p2align 4
+L(between_4_7):
+ /* Load as big endian with overlapping movbe to avoid branches. */
+ movbe (%rdi), %eax
+ movbe (%rsi), %ecx
+ shlq $32, %rax
+ shlq $32, %rcx
+ movbe -4(%rdi, %rdx), %edi
+ movbe -4(%rsi, %rdx), %esi
+ orq %rdi, %rax
+ orq %rsi, %rcx
+ subq %rcx, %rax
+ je L(exit)
+ sbbl %eax, %eax
+ orl $1, %eax
+ ret
+
+ .p2align 4
+L(exit):
+ ret
+
+ .p2align 4
+L(between_2_3):
+ /* Load as big endian to avoid branches. */
+ movzwl (%rdi), %eax
+ movzwl (%rsi), %ecx
+ shll $8, %eax
+ shll $8, %ecx
+ bswap %eax
+ bswap %ecx
+ movb -1(%rdi, %rdx), %al
+ movb -1(%rsi, %rdx), %cl
+ /* Subtraction is okay because the upper 8 bits are zero. */
+ subl %ecx, %eax
+ ret
+
+ .p2align 4
+L(1):
+ movzbl (%rdi), %eax
+ movzbl (%rsi), %ecx
+ subl %ecx, %eax
+ ret
+# endif
+
+ .p2align 4
+L(zero):
+ xorl %eax, %eax
+ ret
+
+ .p2align 4
+L(less_vec):
+# ifdef USE_AS_WMEMCMP
+ /* It can only be 0, 4, 8, 12, 16, 20, 24, 28 bytes. */
+ cmpb $4, %dl
+ je L(4)
+ jb L(zero)
+# else
+ cmpb $1, %dl
+ je L(1)
+ jb L(zero)
+ cmpb $4, %dl
+ jb L(between_2_3)
+ cmpb $8, %dl
+ jb L(between_4_7)
+# endif
+ cmpb $16, %dl
+ jae L(between_16_31)
+ /* It is between 8 and 15 bytes. */
+ vmovq (%rdi), %xmm1
+ vmovq (%rsi), %xmm2
+ VPCMPEQ %xmm1, %xmm2, %xmm2
+ vpmovmskb %xmm2, %eax
+ subl $0xffff, %eax
+ jnz L(first_vec)
+ /* Use overlapping loads to avoid branches. */
+ leaq -8(%rdi, %rdx), %rdi
+ leaq -8(%rsi, %rdx), %rsi
+ vmovq (%rdi), %xmm1
+ vmovq (%rsi), %xmm2
+ VPCMPEQ %xmm1, %xmm2, %xmm2
+ vpmovmskb %xmm2, %eax
+ subl $0xffff, %eax
+ jnz L(first_vec)
+ ret
+
+ .p2align 4
+L(between_16_31):
+ /* From 16 to 31 bytes. No branch when size == 16. */
+ vmovdqu (%rsi), %xmm2
+ VPCMPEQ (%rdi), %xmm2, %xmm2
+ vpmovmskb %xmm2, %eax
+ subl $0xffff, %eax
+ jnz L(first_vec)
+
+ /* Use overlapping loads to avoid branches. */
+ leaq -16(%rdi, %rdx), %rdi
+ leaq -16(%rsi, %rdx), %rsi
+ vmovdqu (%rsi), %xmm2
+ VPCMPEQ (%rdi), %xmm2, %xmm2
+ vpmovmskb %xmm2, %eax
+ subl $0xffff, %eax
+ jnz L(first_vec)
+ ret
+
+ .p2align 4
+L(more_8x_vec):
+ /* More than 8 * VEC. Check the first VEC. */
+ vmovdqu (%rsi), %ymm2
+ VPCMPEQ (%rdi), %ymm2, %ymm2
+ vpmovmskb %ymm2, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec)
+
+ /* Align the first memory area for aligned loads in the loop.
+ Compute how much the first memory area is misaligned. */
+ movq %rdi, %rcx
+ andl $(VEC_SIZE - 1), %ecx
+ /* Get the negative of offset for alignment. */
+ subq $VEC_SIZE, %rcx
+ /* Adjust the second memory area. */
+ subq %rcx, %rsi
+ /* Adjust the first memory area which should be aligned now. */
+ subq %rcx, %rdi
+ /* Adjust length. */
+ addq %rcx, %rdx
+
+L(loop_4x_vec):
+ /* Compare 4 * VEC at a time forward. */
+ vmovdqu (%rsi), %ymm1
+ VPCMPEQ (%rdi), %ymm1, %ymm1
+
+ vmovdqu VEC_SIZE(%rsi), %ymm2
+ VPCMPEQ VEC_SIZE(%rdi), %ymm2, %ymm2
+ vpand %ymm2, %ymm1, %ymm5
+
+ vmovdqu (VEC_SIZE * 2)(%rsi), %ymm3
+ VPCMPEQ (VEC_SIZE * 2)(%rdi), %ymm3, %ymm3
+ vpand %ymm3, %ymm5, %ymm5
+
+ vmovdqu (VEC_SIZE * 3)(%rsi), %ymm4
+ VPCMPEQ (VEC_SIZE * 3)(%rdi), %ymm4, %ymm4
+ vpand %ymm4, %ymm5, %ymm5
+
+ vptest %ymm0, %ymm5
+ jnc L(4x_vec_end)
+
+ addq $(VEC_SIZE * 4), %rdi
+ addq $(VEC_SIZE * 4), %rsi
+
+ subq $(VEC_SIZE * 4), %rdx
+ cmpq $(VEC_SIZE * 4), %rdx
+ jae L(loop_4x_vec)
+
+ /* Less than 4 * VEC. */
+ cmpq $VEC_SIZE, %rdx
+ jbe L(last_vec)
+ cmpq $(VEC_SIZE * 2), %rdx
+ jbe L(last_2x_vec)
+
+L(last_4x_vec):
+ /* From 2 * VEC to 4 * VEC. */
+ vmovdqu (%rsi), %ymm2
+ VPCMPEQ (%rdi), %ymm2, %ymm2
+ vpmovmskb %ymm2, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec)
+
+ addq $VEC_SIZE, %rdi
+ addq $VEC_SIZE, %rsi
+ vmovdqu (%rsi), %ymm2
+ VPCMPEQ (%rdi), %ymm2, %ymm2
+ vpmovmskb %ymm2, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec)
+
+ /* Use overlapping loads to avoid branches. */
+ leaq -(3 * VEC_SIZE)(%rdi, %rdx), %rdi
+ leaq -(3 * VEC_SIZE)(%rsi, %rdx), %rsi
+ vmovdqu (%rsi), %ymm2
+ VPCMPEQ (%rdi), %ymm2, %ymm2
+ vpmovmskb %ymm2, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec)
+
+ addq $VEC_SIZE, %rdi
+ addq $VEC_SIZE, %rsi
+ vmovdqu (%rsi), %ymm2
+ VPCMPEQ (%rdi), %ymm2, %ymm2
+ vpmovmskb %ymm2, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec)
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(4x_vec_end):
+ vpmovmskb %ymm1, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec)
+ vpmovmskb %ymm2, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec_x1)
+ vpmovmskb %ymm3, %eax
+ subl $VEC_MASK, %eax
+ jnz L(first_vec_x2)
+ vpmovmskb %ymm4, %eax
+ subl $VEC_MASK, %eax
+ tzcntl %eax, %ecx
+# ifdef USE_AS_WMEMCMP
+ xorl %eax, %eax
+ movl (VEC_SIZE * 3)(%rdi, %rcx), %edx
+ cmpl (VEC_SIZE * 3)(%rsi, %rcx), %edx
+ jmp L(wmemcmp_return)
+# else
+ movzbl (VEC_SIZE * 3)(%rdi, %rcx), %eax
+ movzbl (VEC_SIZE * 3)(%rsi, %rcx), %edx
+ sub %edx, %eax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x1):
+ tzcntl %eax, %ecx
+# ifdef USE_AS_WMEMCMP
+ xorl %eax, %eax
+ movl VEC_SIZE(%rdi, %rcx), %edx
+ cmpl VEC_SIZE(%rsi, %rcx), %edx
+ jmp L(wmemcmp_return)
+# else
+ movzbl VEC_SIZE(%rdi, %rcx), %eax
+ movzbl VEC_SIZE(%rsi, %rcx), %edx
+ sub %edx, %eax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x2):
+ tzcntl %eax, %ecx
+# ifdef USE_AS_WMEMCMP
+ xorl %eax, %eax
+ movl (VEC_SIZE * 2)(%rdi, %rcx), %edx
+ cmpl (VEC_SIZE * 2)(%rsi, %rcx), %edx
+ jmp L(wmemcmp_return)
+# else
+ movzbl (VEC_SIZE * 2)(%rdi, %rcx), %eax
+ movzbl (VEC_SIZE * 2)(%rsi, %rcx), %edx
+ sub %edx, %eax
+# endif
+ VZEROUPPER
+ ret
+END (MEMCMP)
+#endif
diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
new file mode 100644
index 0000000000..6058aa751e
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
@@ -0,0 +1,31 @@
+/* memcmp with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define memcmp __memcmp_sse2
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# endif
+
+# undef weak_alias
+# define weak_alias(ignored1, ignored2)
+#endif
+
+#include <sysdeps/x86_64/memcmp.S>
diff --git a/sysdeps/x86_64/multiarch/memcmp-sse4.S b/sysdeps/x86_64/multiarch/memcmp-sse4.S
index 786f87282c..8e164f2cb6 100644
--- a/sysdeps/x86_64/multiarch/memcmp-sse4.S
+++ b/sysdeps/x86_64/multiarch/memcmp-sse4.S
@@ -1,5 +1,5 @@
/* memcmp with SSE4.1, wmemcmp with SSE4.1
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -31,7 +31,7 @@
lea TABLE(%rip), %r11; \
movslq (%r11, INDEX, SCALE), %rcx; \
add %r11, %rcx; \
- jmp *%rcx; \
+ _CET_NOTRACK jmp *%rcx; \
ud2
/* Warning!
diff --git a/sysdeps/x86_64/multiarch/memcmp-ssse3.S b/sysdeps/x86_64/multiarch/memcmp-ssse3.S
index a22f399e02..6f76c64123 100644
--- a/sysdeps/x86_64/multiarch/memcmp-ssse3.S
+++ b/sysdeps/x86_64/multiarch/memcmp-ssse3.S
@@ -1,5 +1,5 @@
/* memcmp with SSSE3, wmemcmp with SSSE3
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/multiarch/memcmp.S b/sysdeps/x86_64/multiarch/memcmp.S
deleted file mode 100644
index b5a1cc202e..0000000000
--- a/sysdeps/x86_64/multiarch/memcmp.S
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Multiple versions of memcmp
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
- .text
-ENTRY(memcmp)
- .type memcmp, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- HAS_CPU_FEATURE (SSSE3)
- jnz 2f
- leaq __memcmp_sse2(%rip), %rax
- ret
-
-2: HAS_CPU_FEATURE (SSE4_1)
- jz 3f
- leaq __memcmp_sse4_1(%rip), %rax
- ret
-
-3: leaq __memcmp_ssse3(%rip), %rax
- ret
-
-END(memcmp)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __memcmp_sse2, @function; \
- .p2align 4; \
- .globl __memcmp_sse2; \
- .hidden __memcmp_sse2; \
- __memcmp_sse2: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __memcmp_sse2, .-__memcmp_sse2
-
-# ifdef SHARED
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
- they will be called without setting up EBX needed for PLT which is
- used by IFUNC. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_memcmp; __GI_memcmp = __memcmp_sse2
-# endif
-#endif
-
-#include "../memcmp.S"
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
new file mode 100644
index 0000000000..6f3ca43128
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -0,0 +1,37 @@
+/* Multiple versions of memcmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define memcmp __redirect_memcmp
+# include <string.h>
+# undef memcmp
+
+# define SYMBOL_NAME memcmp
+# include "ifunc-memcmp.h"
+
+libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
+# undef bcmp
+weak_alias (memcmp, bcmp)
+
+# ifdef SHARED
+__hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S b/sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S
deleted file mode 100644
index 74fed186e9..0000000000
--- a/sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S
+++ /dev/null
@@ -1,376 +0,0 @@
-/* memcpy with AVX
- Copyright (C) 2014-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>
-
-#if IS_IN (libc) \
- && (defined SHARED \
- || defined USE_AS_MEMMOVE \
- || !defined USE_MULTIARCH)
-
-#include "asm-syntax.h"
-#ifndef MEMCPY
-# define MEMCPY __memcpy_avx_unaligned
-# define MEMCPY_CHK __memcpy_chk_avx_unaligned
-#endif
-
- .section .text.avx,"ax",@progbits
-#if !defined USE_AS_BCOPY
-ENTRY (MEMCPY_CHK)
- cmpq %rdx, %rcx
- jb HIDDEN_JUMPTARGET (__chk_fail)
-END (MEMCPY_CHK)
-#endif
-
-ENTRY (MEMCPY)
- mov %rdi, %rax
-#ifdef USE_AS_MEMPCPY
- add %rdx, %rax
-#endif
- cmp $256, %rdx
- jae L(256bytesormore)
- cmp $16, %dl
- jb L(less_16bytes)
- cmp $128, %dl
- jb L(less_128bytes)
- vmovdqu (%rsi), %xmm0
- lea (%rsi, %rdx), %rcx
- vmovdqu 0x10(%rsi), %xmm1
- vmovdqu 0x20(%rsi), %xmm2
- vmovdqu 0x30(%rsi), %xmm3
- vmovdqu 0x40(%rsi), %xmm4
- vmovdqu 0x50(%rsi), %xmm5
- vmovdqu 0x60(%rsi), %xmm6
- vmovdqu 0x70(%rsi), %xmm7
- vmovdqu -0x80(%rcx), %xmm8
- vmovdqu -0x70(%rcx), %xmm9
- vmovdqu -0x60(%rcx), %xmm10
- vmovdqu -0x50(%rcx), %xmm11
- vmovdqu -0x40(%rcx), %xmm12
- vmovdqu -0x30(%rcx), %xmm13
- vmovdqu -0x20(%rcx), %xmm14
- vmovdqu -0x10(%rcx), %xmm15
- lea (%rdi, %rdx), %rdx
- vmovdqu %xmm0, (%rdi)
- vmovdqu %xmm1, 0x10(%rdi)
- vmovdqu %xmm2, 0x20(%rdi)
- vmovdqu %xmm3, 0x30(%rdi)
- vmovdqu %xmm4, 0x40(%rdi)
- vmovdqu %xmm5, 0x50(%rdi)
- vmovdqu %xmm6, 0x60(%rdi)
- vmovdqu %xmm7, 0x70(%rdi)
- vmovdqu %xmm8, -0x80(%rdx)
- vmovdqu %xmm9, -0x70(%rdx)
- vmovdqu %xmm10, -0x60(%rdx)
- vmovdqu %xmm11, -0x50(%rdx)
- vmovdqu %xmm12, -0x40(%rdx)
- vmovdqu %xmm13, -0x30(%rdx)
- vmovdqu %xmm14, -0x20(%rdx)
- vmovdqu %xmm15, -0x10(%rdx)
- ret
- .p2align 4
-L(less_128bytes):
- cmp $64, %dl
- jb L(less_64bytes)
- vmovdqu (%rsi), %xmm0
- lea (%rsi, %rdx), %rcx
- vmovdqu 0x10(%rsi), %xmm1
- vmovdqu 0x20(%rsi), %xmm2
- lea (%rdi, %rdx), %rdx
- vmovdqu 0x30(%rsi), %xmm3
- vmovdqu -0x40(%rcx), %xmm4
- vmovdqu -0x30(%rcx), %xmm5
- vmovdqu -0x20(%rcx), %xmm6
- vmovdqu -0x10(%rcx), %xmm7
- vmovdqu %xmm0, (%rdi)
- vmovdqu %xmm1, 0x10(%rdi)
- vmovdqu %xmm2, 0x20(%rdi)
- vmovdqu %xmm3, 0x30(%rdi)
- vmovdqu %xmm4, -0x40(%rdx)
- vmovdqu %xmm5, -0x30(%rdx)
- vmovdqu %xmm6, -0x20(%rdx)
- vmovdqu %xmm7, -0x10(%rdx)
- ret
-
- .p2align 4
-L(less_64bytes):
- cmp $32, %dl
- jb L(less_32bytes)
- vmovdqu (%rsi), %xmm0
- vmovdqu 0x10(%rsi), %xmm1
- vmovdqu -0x20(%rsi, %rdx), %xmm6
- vmovdqu -0x10(%rsi, %rdx), %xmm7
- vmovdqu %xmm0, (%rdi)
- vmovdqu %xmm1, 0x10(%rdi)
- vmovdqu %xmm6, -0x20(%rdi, %rdx)
- vmovdqu %xmm7, -0x10(%rdi, %rdx)
- ret
-
- .p2align 4
-L(less_32bytes):
- vmovdqu (%rsi), %xmm0
- vmovdqu -0x10(%rsi, %rdx), %xmm7
- vmovdqu %xmm0, (%rdi)
- vmovdqu %xmm7, -0x10(%rdi, %rdx)
- ret
-
- .p2align 4
-L(less_16bytes):
- cmp $8, %dl
- jb L(less_8bytes)
- movq -0x08(%rsi, %rdx), %rcx
- movq (%rsi), %rsi
- movq %rsi, (%rdi)
- movq %rcx, -0x08(%rdi, %rdx)
- ret
-
- .p2align 4
-L(less_8bytes):
- cmp $4, %dl
- jb L(less_4bytes)
- mov -0x04(%rsi, %rdx), %ecx
- mov (%rsi), %esi
- mov %esi, (%rdi)
- mov %ecx, -0x04(%rdi, %rdx)
- ret
-
-L(less_4bytes):
- cmp $1, %dl
- jbe L(less_2bytes)
- mov -0x02(%rsi, %rdx), %cx
- mov (%rsi), %si
- mov %si, (%rdi)
- mov %cx, -0x02(%rdi, %rdx)
- ret
-
-L(less_2bytes):
- jb L(less_0bytes)
- mov (%rsi), %cl
- mov %cl, (%rdi)
-L(less_0bytes):
- ret
-
- .p2align 4
-L(256bytesormore):
-#ifdef USE_AS_MEMMOVE
- mov %rdi, %rcx
- sub %rsi, %rcx
- cmp %rdx, %rcx
- jc L(copy_backward)
-#endif
- cmp $2048, %rdx
- jae L(gobble_data_movsb)
- mov %rax, %r8
- lea (%rsi, %rdx), %rcx
- mov %rdi, %r10
- vmovdqu -0x80(%rcx), %xmm5
- vmovdqu -0x70(%rcx), %xmm6
- mov $0x80, %rax
- and $-32, %rdi
- add $32, %rdi
- vmovdqu -0x60(%rcx), %xmm7
- vmovdqu -0x50(%rcx), %xmm8
- mov %rdi, %r11
- sub %r10, %r11
- vmovdqu -0x40(%rcx), %xmm9
- vmovdqu -0x30(%rcx), %xmm10
- sub %r11, %rdx
- vmovdqu -0x20(%rcx), %xmm11
- vmovdqu -0x10(%rcx), %xmm12
- vmovdqu (%rsi), %ymm4
- add %r11, %rsi
- sub %eax, %edx
-L(goble_128_loop):
- vmovdqu (%rsi), %ymm0
- vmovdqu 0x20(%rsi), %ymm1
- vmovdqu 0x40(%rsi), %ymm2
- vmovdqu 0x60(%rsi), %ymm3
- add %rax, %rsi
- vmovdqa %ymm0, (%rdi)
- vmovdqa %ymm1, 0x20(%rdi)
- vmovdqa %ymm2, 0x40(%rdi)
- vmovdqa %ymm3, 0x60(%rdi)
- add %rax, %rdi
- sub %eax, %edx
- jae L(goble_128_loop)
- add %eax, %edx
- add %rdi, %rdx
- vmovdqu %ymm4, (%r10)
- vzeroupper
- vmovdqu %xmm5, -0x80(%rdx)
- vmovdqu %xmm6, -0x70(%rdx)
- vmovdqu %xmm7, -0x60(%rdx)
- vmovdqu %xmm8, -0x50(%rdx)
- vmovdqu %xmm9, -0x40(%rdx)
- vmovdqu %xmm10, -0x30(%rdx)
- vmovdqu %xmm11, -0x20(%rdx)
- vmovdqu %xmm12, -0x10(%rdx)
- mov %r8, %rax
- ret
-
- .p2align 4
-L(gobble_data_movsb):
-#ifdef SHARED_CACHE_SIZE_HALF
- mov $SHARED_CACHE_SIZE_HALF, %rcx
-#else
- mov __x86_shared_cache_size_half(%rip), %rcx
-#endif
- shl $3, %rcx
- cmp %rcx, %rdx
- jae L(gobble_big_data_fwd)
- mov %rdx, %rcx
- mov %rdx, %rcx
- rep movsb
- ret
-
- .p2align 4
-L(gobble_big_data_fwd):
- lea (%rsi, %rdx), %rcx
- vmovdqu (%rsi), %ymm4
- vmovdqu -0x80(%rsi,%rdx), %xmm5
- vmovdqu -0x70(%rcx), %xmm6
- vmovdqu -0x60(%rcx), %xmm7
- vmovdqu -0x50(%rcx), %xmm8
- vmovdqu -0x40(%rcx), %xmm9
- vmovdqu -0x30(%rcx), %xmm10
- vmovdqu -0x20(%rcx), %xmm11
- vmovdqu -0x10(%rcx), %xmm12
- mov %rdi, %r8
- and $-32, %rdi
- add $32, %rdi
- mov %rdi, %r10
- sub %r8, %r10
- sub %r10, %rdx
- add %r10, %rsi
- lea (%rdi, %rdx), %rcx
- add $-0x80, %rdx
-L(gobble_mem_fwd_loop):
- prefetchnta 0x1c0(%rsi)
- prefetchnta 0x280(%rsi)
- vmovdqu (%rsi), %ymm0
- vmovdqu 0x20(%rsi), %ymm1
- vmovdqu 0x40(%rsi), %ymm2
- vmovdqu 0x60(%rsi), %ymm3
- sub $-0x80, %rsi
- vmovntdq %ymm0, (%rdi)
- vmovntdq %ymm1, 0x20(%rdi)
- vmovntdq %ymm2, 0x40(%rdi)
- vmovntdq %ymm3, 0x60(%rdi)
- sub $-0x80, %rdi
- add $-0x80, %rdx
- jb L(gobble_mem_fwd_loop)
- sfence
- vmovdqu %ymm4, (%r8)
- vzeroupper
- vmovdqu %xmm5, -0x80(%rcx)
- vmovdqu %xmm6, -0x70(%rcx)
- vmovdqu %xmm7, -0x60(%rcx)
- vmovdqu %xmm8, -0x50(%rcx)
- vmovdqu %xmm9, -0x40(%rcx)
- vmovdqu %xmm10, -0x30(%rcx)
- vmovdqu %xmm11, -0x20(%rcx)
- vmovdqu %xmm12, -0x10(%rcx)
- ret
-
-#ifdef USE_AS_MEMMOVE
- .p2align 4
-L(copy_backward):
-#ifdef SHARED_CACHE_SIZE_HALF
- mov $SHARED_CACHE_SIZE_HALF, %rcx
-#else
- mov __x86_shared_cache_size_half(%rip), %rcx
-#endif
- shl $3, %rcx
- vmovdqu (%rsi), %xmm5
- vmovdqu 0x10(%rsi), %xmm6
- add %rdx, %rdi
- vmovdqu 0x20(%rsi), %xmm7
- vmovdqu 0x30(%rsi), %xmm8
- lea -0x20(%rdi), %r10
- mov %rdi, %r11
- vmovdqu 0x40(%rsi), %xmm9
- vmovdqu 0x50(%rsi), %xmm10
- and $0x1f, %r11
- vmovdqu 0x60(%rsi), %xmm11
- vmovdqu 0x70(%rsi), %xmm12
- xor %r11, %rdi
- add %rdx, %rsi
- vmovdqu -0x20(%rsi), %ymm4
- sub %r11, %rsi
- sub %r11, %rdx
- cmp %rcx, %rdx
- ja L(gobble_big_data_bwd)
- add $-0x80, %rdx
-L(gobble_mem_bwd_llc):
- vmovdqu -0x20(%rsi), %ymm0
- vmovdqu -0x40(%rsi), %ymm1
- vmovdqu -0x60(%rsi), %ymm2
- vmovdqu -0x80(%rsi), %ymm3
- lea -0x80(%rsi), %rsi
- vmovdqa %ymm0, -0x20(%rdi)
- vmovdqa %ymm1, -0x40(%rdi)
- vmovdqa %ymm2, -0x60(%rdi)
- vmovdqa %ymm3, -0x80(%rdi)
- lea -0x80(%rdi), %rdi
- add $-0x80, %rdx
- jb L(gobble_mem_bwd_llc)
- vmovdqu %ymm4, (%r10)
- vzeroupper
- vmovdqu %xmm5, (%rax)
- vmovdqu %xmm6, 0x10(%rax)
- vmovdqu %xmm7, 0x20(%rax)
- vmovdqu %xmm8, 0x30(%rax)
- vmovdqu %xmm9, 0x40(%rax)
- vmovdqu %xmm10, 0x50(%rax)
- vmovdqu %xmm11, 0x60(%rax)
- vmovdqu %xmm12, 0x70(%rax)
- ret
-
- .p2align 4
-L(gobble_big_data_bwd):
- add $-0x80, %rdx
-L(gobble_mem_bwd_loop):
- prefetchnta -0x1c0(%rsi)
- prefetchnta -0x280(%rsi)
- vmovdqu -0x20(%rsi), %ymm0
- vmovdqu -0x40(%rsi), %ymm1
- vmovdqu -0x60(%rsi), %ymm2
- vmovdqu -0x80(%rsi), %ymm3
- lea -0x80(%rsi), %rsi
- vmovntdq %ymm0, -0x20(%rdi)
- vmovntdq %ymm1, -0x40(%rdi)
- vmovntdq %ymm2, -0x60(%rdi)
- vmovntdq %ymm3, -0x80(%rdi)
- lea -0x80(%rdi), %rdi
- add $-0x80, %rdx
- jb L(gobble_mem_bwd_loop)
- sfence
- vmovdqu %ymm4, (%r10)
- vzeroupper
- vmovdqu %xmm5, (%rax)
- vmovdqu %xmm6, 0x10(%rax)
- vmovdqu %xmm7, 0x20(%rax)
- vmovdqu %xmm8, 0x30(%rax)
- vmovdqu %xmm9, 0x40(%rax)
- vmovdqu %xmm10, 0x50(%rax)
- vmovdqu %xmm11, 0x60(%rax)
- vmovdqu %xmm12, 0x70(%rax)
- ret
-#endif
-END (MEMCPY)
-#endif
diff --git a/sysdeps/x86_64/multiarch/memcpy-avx512-no-vzeroupper.S b/sysdeps/x86_64/multiarch/memcpy-avx512-no-vzeroupper.S
deleted file mode 100644
index 1bb12e81b0..0000000000
--- a/sysdeps/x86_64/multiarch/memcpy-avx512-no-vzeroupper.S
+++ /dev/null
@@ -1,408 +0,0 @@
-/* memcpy optimized with AVX512 for KNL hardware.
- 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 <sysdep.h>
-
-#if defined HAVE_AVX512_ASM_SUPPORT && IS_IN (libc) \
- && (defined SHARED \
- || defined USE_AS_MEMMOVE \
- || !defined USE_MULTIARCH)
-
-#include "asm-syntax.h"
-#ifndef MEMCPY
-# define MEMCPY __memcpy_avx512_no_vzeroupper
-# define MEMCPY_CHK __memcpy_chk_avx512_no_vzeroupper
-#endif
-
- .section .text,"ax",@progbits
-#if !defined USE_AS_BCOPY
-ENTRY (MEMCPY_CHK)
- cmpq %rdx, %rcx
- jb HIDDEN_JUMPTARGET (__chk_fail)
-END (MEMCPY_CHK)
-#endif
-
-ENTRY (MEMCPY)
- mov %rdi, %rax
-#ifdef USE_AS_MEMPCPY
- add %rdx, %rax
-#endif
- lea (%rsi, %rdx), %rcx
- lea (%rdi, %rdx), %r9
- cmp $512, %rdx
- ja L(512bytesormore)
-
-L(check):
- cmp $16, %rdx
- jbe L(less_16bytes)
- cmp $256, %rdx
- jb L(less_256bytes)
- vmovups (%rsi), %zmm0
- vmovups 0x40(%rsi), %zmm1
- vmovups 0x80(%rsi), %zmm2
- vmovups 0xC0(%rsi), %zmm3
- vmovups -0x100(%rcx), %zmm4
- vmovups -0xC0(%rcx), %zmm5
- vmovups -0x80(%rcx), %zmm6
- vmovups -0x40(%rcx), %zmm7
- vmovups %zmm0, (%rdi)
- vmovups %zmm1, 0x40(%rdi)
- vmovups %zmm2, 0x80(%rdi)
- vmovups %zmm3, 0xC0(%rdi)
- vmovups %zmm4, -0x100(%r9)
- vmovups %zmm5, -0xC0(%r9)
- vmovups %zmm6, -0x80(%r9)
- vmovups %zmm7, -0x40(%r9)
- ret
-
-L(less_256bytes):
- cmp $128, %dl
- jb L(less_128bytes)
- vmovups (%rsi), %zmm0
- vmovups 0x40(%rsi), %zmm1
- vmovups -0x80(%rcx), %zmm2
- vmovups -0x40(%rcx), %zmm3
- vmovups %zmm0, (%rdi)
- vmovups %zmm1, 0x40(%rdi)
- vmovups %zmm2, -0x80(%r9)
- vmovups %zmm3, -0x40(%r9)
- ret
-
-L(less_128bytes):
- cmp $64, %dl
- jb L(less_64bytes)
- vmovdqu (%rsi), %ymm0
- vmovdqu 0x20(%rsi), %ymm1
- vmovdqu -0x40(%rcx), %ymm2
- vmovdqu -0x20(%rcx), %ymm3
- vmovdqu %ymm0, (%rdi)
- vmovdqu %ymm1, 0x20(%rdi)
- vmovdqu %ymm2, -0x40(%r9)
- vmovdqu %ymm3, -0x20(%r9)
- ret
-
-L(less_64bytes):
- cmp $32, %dl
- jb L(less_32bytes)
- vmovdqu (%rsi), %ymm0
- vmovdqu -0x20(%rcx), %ymm1
- vmovdqu %ymm0, (%rdi)
- vmovdqu %ymm1, -0x20(%r9)
- ret
-
-L(less_32bytes):
- vmovdqu (%rsi), %xmm0
- vmovdqu -0x10(%rcx), %xmm1
- vmovdqu %xmm0, (%rdi)
- vmovdqu %xmm1, -0x10(%r9)
- ret
-
-L(less_16bytes):
- cmp $8, %dl
- jb L(less_8bytes)
- movq (%rsi), %rsi
- movq -0x8(%rcx), %rcx
- movq %rsi, (%rdi)
- movq %rcx, -0x8(%r9)
- ret
-
-L(less_8bytes):
- cmp $4, %dl
- jb L(less_4bytes)
- mov (%rsi), %esi
- mov -0x4(%rcx), %ecx
- mov %esi, (%rdi)
- mov %ecx, -0x4(%r9)
- ret
-
-L(less_4bytes):
- cmp $2, %dl
- jb L(less_2bytes)
- mov (%rsi), %si
- mov -0x2(%rcx), %cx
- mov %si, (%rdi)
- mov %cx, -0x2(%r9)
- ret
-
-L(less_2bytes):
- cmp $1, %dl
- jb L(less_1bytes)
- mov (%rsi), %cl
- mov %cl, (%rdi)
-L(less_1bytes):
- ret
-
-L(512bytesormore):
-#ifdef SHARED_CACHE_SIZE_HALF
- mov $SHARED_CACHE_SIZE_HALF, %r8
-#else
- mov __x86_shared_cache_size_half(%rip), %r8
-#endif
- cmp %r8, %rdx
- jae L(preloop_large)
- cmp $1024, %rdx
- ja L(1024bytesormore)
- prefetcht1 (%rsi)
- prefetcht1 0x40(%rsi)
- prefetcht1 0x80(%rsi)
- prefetcht1 0xC0(%rsi)
- prefetcht1 0x100(%rsi)
- prefetcht1 0x140(%rsi)
- prefetcht1 0x180(%rsi)
- prefetcht1 0x1C0(%rsi)
- prefetcht1 -0x200(%rcx)
- prefetcht1 -0x1C0(%rcx)
- prefetcht1 -0x180(%rcx)
- prefetcht1 -0x140(%rcx)
- prefetcht1 -0x100(%rcx)
- prefetcht1 -0xC0(%rcx)
- prefetcht1 -0x80(%rcx)
- prefetcht1 -0x40(%rcx)
- vmovups (%rsi), %zmm0
- vmovups 0x40(%rsi), %zmm1
- vmovups 0x80(%rsi), %zmm2
- vmovups 0xC0(%rsi), %zmm3
- vmovups 0x100(%rsi), %zmm4
- vmovups 0x140(%rsi), %zmm5
- vmovups 0x180(%rsi), %zmm6
- vmovups 0x1C0(%rsi), %zmm7
- vmovups -0x200(%rcx), %zmm8
- vmovups -0x1C0(%rcx), %zmm9
- vmovups -0x180(%rcx), %zmm10
- vmovups -0x140(%rcx), %zmm11
- vmovups -0x100(%rcx), %zmm12
- vmovups -0xC0(%rcx), %zmm13
- vmovups -0x80(%rcx), %zmm14
- vmovups -0x40(%rcx), %zmm15
- vmovups %zmm0, (%rdi)
- vmovups %zmm1, 0x40(%rdi)
- vmovups %zmm2, 0x80(%rdi)
- vmovups %zmm3, 0xC0(%rdi)
- vmovups %zmm4, 0x100(%rdi)
- vmovups %zmm5, 0x140(%rdi)
- vmovups %zmm6, 0x180(%rdi)
- vmovups %zmm7, 0x1C0(%rdi)
- vmovups %zmm8, -0x200(%r9)
- vmovups %zmm9, -0x1C0(%r9)
- vmovups %zmm10, -0x180(%r9)
- vmovups %zmm11, -0x140(%r9)
- vmovups %zmm12, -0x100(%r9)
- vmovups %zmm13, -0xC0(%r9)
- vmovups %zmm14, -0x80(%r9)
- vmovups %zmm15, -0x40(%r9)
- ret
-
-L(1024bytesormore):
- cmp %rsi, %rdi
- ja L(1024bytesormore_bkw)
- sub $512, %r9
- vmovups -0x200(%rcx), %zmm8
- vmovups -0x1C0(%rcx), %zmm9
- vmovups -0x180(%rcx), %zmm10
- vmovups -0x140(%rcx), %zmm11
- vmovups -0x100(%rcx), %zmm12
- vmovups -0xC0(%rcx), %zmm13
- vmovups -0x80(%rcx), %zmm14
- vmovups -0x40(%rcx), %zmm15
- prefetcht1 (%rsi)
- prefetcht1 0x40(%rsi)
- prefetcht1 0x80(%rsi)
- prefetcht1 0xC0(%rsi)
- prefetcht1 0x100(%rsi)
- prefetcht1 0x140(%rsi)
- prefetcht1 0x180(%rsi)
- prefetcht1 0x1C0(%rsi)
-
-/* Loop with unaligned memory access. */
-L(gobble_512bytes_loop):
- vmovups (%rsi), %zmm0
- vmovups 0x40(%rsi), %zmm1
- vmovups 0x80(%rsi), %zmm2
- vmovups 0xC0(%rsi), %zmm3
- vmovups 0x100(%rsi), %zmm4
- vmovups 0x140(%rsi), %zmm5
- vmovups 0x180(%rsi), %zmm6
- vmovups 0x1C0(%rsi), %zmm7
- add $512, %rsi
- prefetcht1 (%rsi)
- prefetcht1 0x40(%rsi)
- prefetcht1 0x80(%rsi)
- prefetcht1 0xC0(%rsi)
- prefetcht1 0x100(%rsi)
- prefetcht1 0x140(%rsi)
- prefetcht1 0x180(%rsi)
- prefetcht1 0x1C0(%rsi)
- vmovups %zmm0, (%rdi)
- vmovups %zmm1, 0x40(%rdi)
- vmovups %zmm2, 0x80(%rdi)
- vmovups %zmm3, 0xC0(%rdi)
- vmovups %zmm4, 0x100(%rdi)
- vmovups %zmm5, 0x140(%rdi)
- vmovups %zmm6, 0x180(%rdi)
- vmovups %zmm7, 0x1C0(%rdi)
- add $512, %rdi
- cmp %r9, %rdi
- jb L(gobble_512bytes_loop)
- vmovups %zmm8, (%r9)
- vmovups %zmm9, 0x40(%r9)
- vmovups %zmm10, 0x80(%r9)
- vmovups %zmm11, 0xC0(%r9)
- vmovups %zmm12, 0x100(%r9)
- vmovups %zmm13, 0x140(%r9)
- vmovups %zmm14, 0x180(%r9)
- vmovups %zmm15, 0x1C0(%r9)
- ret
-
-L(1024bytesormore_bkw):
- add $512, %rdi
- vmovups 0x1C0(%rsi), %zmm8
- vmovups 0x180(%rsi), %zmm9
- vmovups 0x140(%rsi), %zmm10
- vmovups 0x100(%rsi), %zmm11
- vmovups 0xC0(%rsi), %zmm12
- vmovups 0x80(%rsi), %zmm13
- vmovups 0x40(%rsi), %zmm14
- vmovups (%rsi), %zmm15
- prefetcht1 -0x40(%rcx)
- prefetcht1 -0x80(%rcx)
- prefetcht1 -0xC0(%rcx)
- prefetcht1 -0x100(%rcx)
- prefetcht1 -0x140(%rcx)
- prefetcht1 -0x180(%rcx)
- prefetcht1 -0x1C0(%rcx)
- prefetcht1 -0x200(%rcx)
-
-/* Backward loop with unaligned memory access. */
-L(gobble_512bytes_loop_bkw):
- vmovups -0x40(%rcx), %zmm0
- vmovups -0x80(%rcx), %zmm1
- vmovups -0xC0(%rcx), %zmm2
- vmovups -0x100(%rcx), %zmm3
- vmovups -0x140(%rcx), %zmm4
- vmovups -0x180(%rcx), %zmm5
- vmovups -0x1C0(%rcx), %zmm6
- vmovups -0x200(%rcx), %zmm7
- sub $512, %rcx
- prefetcht1 -0x40(%rcx)
- prefetcht1 -0x80(%rcx)
- prefetcht1 -0xC0(%rcx)
- prefetcht1 -0x100(%rcx)
- prefetcht1 -0x140(%rcx)
- prefetcht1 -0x180(%rcx)
- prefetcht1 -0x1C0(%rcx)
- prefetcht1 -0x200(%rcx)
- vmovups %zmm0, -0x40(%r9)
- vmovups %zmm1, -0x80(%r9)
- vmovups %zmm2, -0xC0(%r9)
- vmovups %zmm3, -0x100(%r9)
- vmovups %zmm4, -0x140(%r9)
- vmovups %zmm5, -0x180(%r9)
- vmovups %zmm6, -0x1C0(%r9)
- vmovups %zmm7, -0x200(%r9)
- sub $512, %r9
- cmp %rdi, %r9
- ja L(gobble_512bytes_loop_bkw)
- vmovups %zmm8, -0x40(%rdi)
- vmovups %zmm9, -0x80(%rdi)
- vmovups %zmm10, -0xC0(%rdi)
- vmovups %zmm11, -0x100(%rdi)
- vmovups %zmm12, -0x140(%rdi)
- vmovups %zmm13, -0x180(%rdi)
- vmovups %zmm14, -0x1C0(%rdi)
- vmovups %zmm15, -0x200(%rdi)
- ret
-
-L(preloop_large):
- cmp %rsi, %rdi
- ja L(preloop_large_bkw)
- vmovups (%rsi), %zmm4
- vmovups 0x40(%rsi), %zmm5
-
-/* Align destination for access with non-temporal stores in the loop. */
- mov %rdi, %r8
- and $-0x80, %rdi
- add $0x80, %rdi
- sub %rdi, %r8
- sub %r8, %rsi
- add %r8, %rdx
-L(gobble_256bytes_nt_loop):
- prefetcht1 0x200(%rsi)
- prefetcht1 0x240(%rsi)
- prefetcht1 0x280(%rsi)
- prefetcht1 0x2C0(%rsi)
- prefetcht1 0x300(%rsi)
- prefetcht1 0x340(%rsi)
- prefetcht1 0x380(%rsi)
- prefetcht1 0x3C0(%rsi)
- vmovdqu64 (%rsi), %zmm0
- vmovdqu64 0x40(%rsi), %zmm1
- vmovdqu64 0x80(%rsi), %zmm2
- vmovdqu64 0xC0(%rsi), %zmm3
- vmovntdq %zmm0, (%rdi)
- vmovntdq %zmm1, 0x40(%rdi)
- vmovntdq %zmm2, 0x80(%rdi)
- vmovntdq %zmm3, 0xC0(%rdi)
- sub $256, %rdx
- add $256, %rsi
- add $256, %rdi
- cmp $256, %rdx
- ja L(gobble_256bytes_nt_loop)
- sfence
- vmovups %zmm4, (%rax)
- vmovups %zmm5, 0x40(%rax)
- jmp L(check)
-
-L(preloop_large_bkw):
- vmovups -0x80(%rcx), %zmm4
- vmovups -0x40(%rcx), %zmm5
-
-/* Align end of destination for access with non-temporal stores. */
- mov %r9, %r8
- and $-0x80, %r9
- sub %r9, %r8
- sub %r8, %rcx
- sub %r8, %rdx
- add %r9, %r8
-L(gobble_256bytes_nt_loop_bkw):
- prefetcht1 -0x400(%rcx)
- prefetcht1 -0x3C0(%rcx)
- prefetcht1 -0x380(%rcx)
- prefetcht1 -0x340(%rcx)
- prefetcht1 -0x300(%rcx)
- prefetcht1 -0x2C0(%rcx)
- prefetcht1 -0x280(%rcx)
- prefetcht1 -0x240(%rcx)
- vmovdqu64 -0x100(%rcx), %zmm0
- vmovdqu64 -0xC0(%rcx), %zmm1
- vmovdqu64 -0x80(%rcx), %zmm2
- vmovdqu64 -0x40(%rcx), %zmm3
- vmovntdq %zmm0, -0x100(%r9)
- vmovntdq %zmm1, -0xC0(%r9)
- vmovntdq %zmm2, -0x80(%r9)
- vmovntdq %zmm3, -0x40(%r9)
- sub $256, %rdx
- sub $256, %rcx
- sub $256, %r9
- cmp $256, %rdx
- ja L(gobble_256bytes_nt_loop_bkw)
- sfence
- vmovups %zmm4, -0x80(%r8)
- vmovups %zmm5, -0x40(%r8)
- jmp L(check)
-END (MEMCPY)
-#endif
diff --git a/sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S b/sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S
deleted file mode 100644
index c4509831fa..0000000000
--- a/sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S
+++ /dev/null
@@ -1,175 +0,0 @@
-/* memcpy with unaliged loads
- 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/>. */
-
-#if IS_IN (libc)
-
-#include <sysdep.h>
-
-#include "asm-syntax.h"
-
-
-ENTRY(__memcpy_sse2_unaligned)
- movq %rsi, %rax
- leaq (%rdx,%rdx), %rcx
- subq %rdi, %rax
- subq %rdx, %rax
- cmpq %rcx, %rax
- jb L(overlapping)
- cmpq $16, %rdx
- jbe L(less_16)
- movdqu (%rsi), %xmm8
- cmpq $32, %rdx
- movdqu %xmm8, (%rdi)
- movdqu -16(%rsi,%rdx), %xmm8
- movdqu %xmm8, -16(%rdi,%rdx)
- ja .L31
-L(return):
- movq %rdi, %rax
- ret
- .p2align 4,,10
- .p2align 4
-.L31:
- movdqu 16(%rsi), %xmm8
- cmpq $64, %rdx
- movdqu %xmm8, 16(%rdi)
- movdqu -32(%rsi,%rdx), %xmm8
- movdqu %xmm8, -32(%rdi,%rdx)
- jbe L(return)
- movdqu 32(%rsi), %xmm8
- cmpq $128, %rdx
- movdqu %xmm8, 32(%rdi)
- movdqu -48(%rsi,%rdx), %xmm8
- movdqu %xmm8, -48(%rdi,%rdx)
- movdqu 48(%rsi), %xmm8
- movdqu %xmm8, 48(%rdi)
- movdqu -64(%rsi,%rdx), %xmm8
- movdqu %xmm8, -64(%rdi,%rdx)
- jbe L(return)
- leaq 64(%rdi), %rcx
- addq %rdi, %rdx
- andq $-64, %rdx
- andq $-64, %rcx
- movq %rcx, %rax
- subq %rdi, %rax
- addq %rax, %rsi
- cmpq %rdx, %rcx
- je L(return)
- movq %rsi, %r10
- subq %rcx, %r10
- leaq 16(%r10), %r9
- leaq 32(%r10), %r8
- leaq 48(%r10), %rax
- .p2align 4,,10
- .p2align 4
-L(loop):
- movdqu (%rcx,%r10), %xmm8
- movdqa %xmm8, (%rcx)
- movdqu (%rcx,%r9), %xmm8
- movdqa %xmm8, 16(%rcx)
- movdqu (%rcx,%r8), %xmm8
- movdqa %xmm8, 32(%rcx)
- movdqu (%rcx,%rax), %xmm8
- movdqa %xmm8, 48(%rcx)
- addq $64, %rcx
- cmpq %rcx, %rdx
- jne L(loop)
- jmp L(return)
-L(overlapping):
- cmpq %rsi, %rdi
- jae .L3
- testq %rdx, %rdx
- .p2align 4,,5
- je L(return)
- movq %rdx, %r9
- leaq 16(%rsi), %rcx
- leaq 16(%rdi), %r8
- shrq $4, %r9
- movq %r9, %rax
- salq $4, %rax
- cmpq %rcx, %rdi
- setae %cl
- cmpq %r8, %rsi
- setae %r8b
- orl %r8d, %ecx
- cmpq $15, %rdx
- seta %r8b
- testb %r8b, %cl
- je .L16
- testq %rax, %rax
- je .L16
- xorl %ecx, %ecx
- xorl %r8d, %r8d
-.L7:
- movdqu (%rsi,%rcx), %xmm8
- addq $1, %r8
- movdqu %xmm8, (%rdi,%rcx)
- addq $16, %rcx
- cmpq %r8, %r9
- ja .L7
- cmpq %rax, %rdx
- je L(return)
-.L21:
- movzbl (%rsi,%rax), %ecx
- movb %cl, (%rdi,%rax)
- addq $1, %rax
- cmpq %rax, %rdx
- ja .L21
- jmp L(return)
-L(less_16):
- testb $24, %dl
- jne L(between_9_16)
- testb $4, %dl
- .p2align 4,,5
- jne L(between_5_8)
- testq %rdx, %rdx
- .p2align 4,,2
- je L(return)
- movzbl (%rsi), %eax
- testb $2, %dl
- movb %al, (%rdi)
- je L(return)
- movzwl -2(%rsi,%rdx), %eax
- movw %ax, -2(%rdi,%rdx)
- jmp L(return)
-.L3:
- leaq -1(%rdx), %rax
- .p2align 4,,10
- .p2align 4
-.L11:
- movzbl (%rsi,%rax), %edx
- movb %dl, (%rdi,%rax)
- subq $1, %rax
- jmp .L11
-L(between_9_16):
- movq (%rsi), %rax
- movq %rax, (%rdi)
- movq -8(%rsi,%rdx), %rax
- movq %rax, -8(%rdi,%rdx)
- jmp L(return)
-.L16:
- xorl %eax, %eax
- jmp .L21
-L(between_5_8):
- movl (%rsi), %eax
- movl %eax, (%rdi)
- movl -4(%rsi,%rdx), %eax
- movl %eax, -4(%rdi,%rdx)
- jmp L(return)
-END(__memcpy_sse2_unaligned)
-
-#endif
diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
index 08b41e9e5a..3cd1123326 100644
--- a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
+++ b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
@@ -1,5 +1,5 @@
/* memcpy with SSSE3 and REP string
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -19,16 +19,15 @@
#include <sysdep.h>
-#if IS_IN (libc) \
- && (defined SHARED \
- || defined USE_AS_MEMMOVE \
- || !defined USE_MULTIARCH)
+#if IS_IN (libc)
#include "asm-syntax.h"
#ifndef MEMCPY
# define MEMCPY __memcpy_ssse3_back
# define MEMCPY_CHK __memcpy_chk_ssse3_back
+# define MEMPCPY __mempcpy_ssse3_back
+# define MEMPCPY_CHK __mempcpy_chk_ssse3_back
#endif
#define JMPTBL(I, B) I - B
@@ -40,10 +39,23 @@
lea TABLE(%rip), %r11; \
movslq (%r11, INDEX, SCALE), INDEX; \
lea (%r11, INDEX), INDEX; \
- jmp *INDEX; \
+ _CET_NOTRACK jmp *INDEX; \
ud2
.section .text.ssse3,"ax",@progbits
+#if !defined USE_AS_MEMPCPY && !defined USE_AS_MEMMOVE
+ENTRY (MEMPCPY_CHK)
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (MEMPCPY_CHK)
+
+ENTRY (MEMPCPY)
+ movq %rdi, %rax
+ addq %rdx, %rax
+ jmp L(start)
+END (MEMPCPY)
+#endif
+
#if !defined USE_AS_BCOPY
ENTRY (MEMCPY_CHK)
cmpq %rdx, %rcx
@@ -66,6 +78,7 @@ ENTRY (MEMCPY)
BRANCH_TO_JMPTBL_ENTRY (L(table_144_bytes_bwd), %rdx, 4)
L(copy_forward):
#endif
+L(start):
cmp $144, %rdx
jae L(144bytesormore)
@@ -112,7 +125,7 @@ L(144bytesormore):
sub $0x80, %rdx
movslq (%r11, %r9, 4), %r9
add %r11, %r9
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
.p2align 4
@@ -142,7 +155,7 @@ L(copy_backward):
sub $0x80, %rdx
movslq (%r11, %r9, 4), %r9
add %r11, %r9
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
.p2align 4
diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3.S b/sysdeps/x86_64/multiarch/memcpy-ssse3.S
index 95de9695f9..0240bfa309 100644
--- a/sysdeps/x86_64/multiarch/memcpy-ssse3.S
+++ b/sysdeps/x86_64/multiarch/memcpy-ssse3.S
@@ -1,5 +1,5 @@
/* memcpy with SSSE3
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -19,16 +19,15 @@
#include <sysdep.h>
-#if IS_IN (libc) \
- && (defined SHARED \
- || defined USE_AS_MEMMOVE \
- || !defined USE_MULTIARCH)
+#if IS_IN (libc)
#include "asm-syntax.h"
#ifndef MEMCPY
# define MEMCPY __memcpy_ssse3
# define MEMCPY_CHK __memcpy_chk_ssse3
+# define MEMPCPY __mempcpy_ssse3
+# define MEMPCPY_CHK __mempcpy_chk_ssse3
#endif
#define JMPTBL(I, B) I - B
@@ -40,10 +39,23 @@
lea TABLE(%rip), %r11; \
movslq (%r11, INDEX, SCALE), INDEX; \
lea (%r11, INDEX), INDEX; \
- jmp *INDEX; \
+ _CET_NOTRACK jmp *INDEX; \
ud2
.section .text.ssse3,"ax",@progbits
+#if !defined USE_AS_MEMPCPY && !defined USE_AS_MEMMOVE
+ENTRY (MEMPCPY_CHK)
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (MEMPCPY_CHK)
+
+ENTRY (MEMPCPY)
+ movq %rdi, %rax
+ addq %rdx, %rax
+ jmp L(start)
+END (MEMPCPY)
+#endif
+
#if !defined USE_AS_BCOPY
ENTRY (MEMCPY_CHK)
cmpq %rdx, %rcx
@@ -66,6 +78,7 @@ ENTRY (MEMCPY)
jmp L(copy_backward)
L(copy_forward):
#endif
+L(start):
cmp $79, %rdx
lea L(table_less_80bytes)(%rip), %r11
ja L(80bytesormore)
@@ -73,7 +86,7 @@ L(copy_forward):
add %rdx, %rsi
add %rdx, %rdi
add %r11, %r9
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
.p2align 4
@@ -428,7 +441,7 @@ L(shl_1):
lea (L(shl_1_loop_L2)-L(shl_1_loop_L1))(%r9), %r9
L(L1_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_1_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -451,7 +464,7 @@ L(shl_1_loop_L1):
jb L(shl_1_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_1_end):
movaps %xmm4, -0x20(%rdi)
@@ -471,7 +484,7 @@ L(shl_1_bwd):
lea (L(shl_1_bwd_loop_L2)-L(shl_1_bwd_loop_L1))(%r9), %r9
L(L1_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_1_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -496,7 +509,7 @@ L(shl_1_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_1_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_1_bwd_end):
movaps %xmm4, (%rdi)
@@ -513,7 +526,7 @@ L(shl_2):
lea (L(shl_2_loop_L2)-L(shl_2_loop_L1))(%r9), %r9
L(L2_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_2_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -536,7 +549,7 @@ L(shl_2_loop_L1):
jb L(shl_2_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_2_end):
movaps %xmm4, -0x20(%rdi)
@@ -556,7 +569,7 @@ L(shl_2_bwd):
lea (L(shl_2_bwd_loop_L2)-L(shl_2_bwd_loop_L1))(%r9), %r9
L(L2_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_2_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -581,7 +594,7 @@ L(shl_2_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_2_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_2_bwd_end):
movaps %xmm4, (%rdi)
@@ -598,7 +611,7 @@ L(shl_3):
lea (L(shl_3_loop_L2)-L(shl_3_loop_L1))(%r9), %r9
L(L3_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_3_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -621,7 +634,7 @@ L(shl_3_loop_L1):
jb L(shl_3_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_3_end):
movaps %xmm4, -0x20(%rdi)
@@ -641,7 +654,7 @@ L(shl_3_bwd):
lea (L(shl_3_bwd_loop_L2)-L(shl_3_bwd_loop_L1))(%r9), %r9
L(L3_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_3_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -666,7 +679,7 @@ L(shl_3_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_3_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_3_bwd_end):
movaps %xmm4, (%rdi)
@@ -683,7 +696,7 @@ L(shl_4):
lea (L(shl_4_loop_L2)-L(shl_4_loop_L1))(%r9), %r9
L(L4_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_4_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -706,7 +719,7 @@ L(shl_4_loop_L1):
jb L(shl_4_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_4_end):
movaps %xmm4, -0x20(%rdi)
@@ -726,7 +739,7 @@ L(shl_4_bwd):
lea (L(shl_4_bwd_loop_L2)-L(shl_4_bwd_loop_L1))(%r9), %r9
L(L4_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_4_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -751,7 +764,7 @@ L(shl_4_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_4_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_4_bwd_end):
movaps %xmm4, (%rdi)
@@ -768,7 +781,7 @@ L(shl_5):
lea (L(shl_5_loop_L2)-L(shl_5_loop_L1))(%r9), %r9
L(L5_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_5_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -791,7 +804,7 @@ L(shl_5_loop_L1):
jb L(shl_5_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_5_end):
movaps %xmm4, -0x20(%rdi)
@@ -811,7 +824,7 @@ L(shl_5_bwd):
lea (L(shl_5_bwd_loop_L2)-L(shl_5_bwd_loop_L1))(%r9), %r9
L(L5_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_5_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -836,7 +849,7 @@ L(shl_5_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_5_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_5_bwd_end):
movaps %xmm4, (%rdi)
@@ -853,7 +866,7 @@ L(shl_6):
lea (L(shl_6_loop_L2)-L(shl_6_loop_L1))(%r9), %r9
L(L6_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_6_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -876,7 +889,7 @@ L(shl_6_loop_L1):
jb L(shl_6_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_6_end):
movaps %xmm4, -0x20(%rdi)
@@ -896,7 +909,7 @@ L(shl_6_bwd):
lea (L(shl_6_bwd_loop_L2)-L(shl_6_bwd_loop_L1))(%r9), %r9
L(L6_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_6_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -921,7 +934,7 @@ L(shl_6_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_6_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_6_bwd_end):
movaps %xmm4, (%rdi)
@@ -938,7 +951,7 @@ L(shl_7):
lea (L(shl_7_loop_L2)-L(shl_7_loop_L1))(%r9), %r9
L(L7_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_7_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -961,7 +974,7 @@ L(shl_7_loop_L1):
jb L(shl_7_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_7_end):
movaps %xmm4, -0x20(%rdi)
@@ -981,7 +994,7 @@ L(shl_7_bwd):
lea (L(shl_7_bwd_loop_L2)-L(shl_7_bwd_loop_L1))(%r9), %r9
L(L7_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_7_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -1006,7 +1019,7 @@ L(shl_7_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_7_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_7_bwd_end):
movaps %xmm4, (%rdi)
@@ -1023,7 +1036,7 @@ L(shl_8):
lea (L(shl_8_loop_L2)-L(shl_8_loop_L1))(%r9), %r9
L(L8_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
L(shl_8_loop_L2):
prefetchnta 0x1c0(%rsi)
L(shl_8_loop_L1):
@@ -1045,7 +1058,7 @@ L(shl_8_loop_L1):
jb L(shl_8_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
.p2align 4
L(shl_8_end):
@@ -1066,7 +1079,7 @@ L(shl_8_bwd):
lea (L(shl_8_bwd_loop_L2)-L(shl_8_bwd_loop_L1))(%r9), %r9
L(L8_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_8_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -1091,7 +1104,7 @@ L(shl_8_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_8_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_8_bwd_end):
movaps %xmm4, (%rdi)
@@ -1108,7 +1121,7 @@ L(shl_9):
lea (L(shl_9_loop_L2)-L(shl_9_loop_L1))(%r9), %r9
L(L9_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_9_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -1131,7 +1144,7 @@ L(shl_9_loop_L1):
jb L(shl_9_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_9_end):
movaps %xmm4, -0x20(%rdi)
@@ -1151,7 +1164,7 @@ L(shl_9_bwd):
lea (L(shl_9_bwd_loop_L2)-L(shl_9_bwd_loop_L1))(%r9), %r9
L(L9_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_9_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -1176,7 +1189,7 @@ L(shl_9_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_9_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_9_bwd_end):
movaps %xmm4, (%rdi)
@@ -1193,7 +1206,7 @@ L(shl_10):
lea (L(shl_10_loop_L2)-L(shl_10_loop_L1))(%r9), %r9
L(L10_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_10_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -1216,7 +1229,7 @@ L(shl_10_loop_L1):
jb L(shl_10_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_10_end):
movaps %xmm4, -0x20(%rdi)
@@ -1236,7 +1249,7 @@ L(shl_10_bwd):
lea (L(shl_10_bwd_loop_L2)-L(shl_10_bwd_loop_L1))(%r9), %r9
L(L10_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_10_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -1261,7 +1274,7 @@ L(shl_10_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_10_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_10_bwd_end):
movaps %xmm4, (%rdi)
@@ -1278,7 +1291,7 @@ L(shl_11):
lea (L(shl_11_loop_L2)-L(shl_11_loop_L1))(%r9), %r9
L(L11_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_11_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -1301,7 +1314,7 @@ L(shl_11_loop_L1):
jb L(shl_11_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_11_end):
movaps %xmm4, -0x20(%rdi)
@@ -1321,7 +1334,7 @@ L(shl_11_bwd):
lea (L(shl_11_bwd_loop_L2)-L(shl_11_bwd_loop_L1))(%r9), %r9
L(L11_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_11_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -1346,7 +1359,7 @@ L(shl_11_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_11_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_11_bwd_end):
movaps %xmm4, (%rdi)
@@ -1363,7 +1376,7 @@ L(shl_12):
lea (L(shl_12_loop_L2)-L(shl_12_loop_L1))(%r9), %r9
L(L12_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_12_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -1386,7 +1399,7 @@ L(shl_12_loop_L1):
jb L(shl_12_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_12_end):
movaps %xmm4, -0x20(%rdi)
@@ -1406,7 +1419,7 @@ L(shl_12_bwd):
lea (L(shl_12_bwd_loop_L2)-L(shl_12_bwd_loop_L1))(%r9), %r9
L(L12_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_12_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -1431,7 +1444,7 @@ L(shl_12_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_12_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_12_bwd_end):
movaps %xmm4, (%rdi)
@@ -1448,7 +1461,7 @@ L(shl_13):
lea (L(shl_13_loop_L2)-L(shl_13_loop_L1))(%r9), %r9
L(L13_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_13_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -1471,7 +1484,7 @@ L(shl_13_loop_L1):
jb L(shl_13_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_13_end):
movaps %xmm4, -0x20(%rdi)
@@ -1491,7 +1504,7 @@ L(shl_13_bwd):
lea (L(shl_13_bwd_loop_L2)-L(shl_13_bwd_loop_L1))(%r9), %r9
L(L13_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_13_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -1516,7 +1529,7 @@ L(shl_13_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_13_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_13_bwd_end):
movaps %xmm4, (%rdi)
@@ -1533,7 +1546,7 @@ L(shl_14):
lea (L(shl_14_loop_L2)-L(shl_14_loop_L1))(%r9), %r9
L(L14_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_14_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -1556,7 +1569,7 @@ L(shl_14_loop_L1):
jb L(shl_14_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_14_end):
movaps %xmm4, -0x20(%rdi)
@@ -1576,7 +1589,7 @@ L(shl_14_bwd):
lea (L(shl_14_bwd_loop_L2)-L(shl_14_bwd_loop_L1))(%r9), %r9
L(L14_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_14_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -1601,7 +1614,7 @@ L(shl_14_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_14_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_14_bwd_end):
movaps %xmm4, (%rdi)
@@ -1618,7 +1631,7 @@ L(shl_15):
lea (L(shl_15_loop_L2)-L(shl_15_loop_L1))(%r9), %r9
L(L15_fwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_15_loop_L2):
prefetchnta 0x1c0(%rsi)
@@ -1641,7 +1654,7 @@ L(shl_15_loop_L1):
jb L(shl_15_end)
movaps %xmm4, -0x20(%rdi)
movaps %xmm5, -0x10(%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_15_end):
movaps %xmm4, -0x20(%rdi)
@@ -1661,7 +1674,7 @@ L(shl_15_bwd):
lea (L(shl_15_bwd_loop_L2)-L(shl_15_bwd_loop_L1))(%r9), %r9
L(L15_bwd):
lea -64(%rdx), %rdx
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_15_bwd_loop_L2):
prefetchnta -0x1c0(%rsi)
@@ -1686,7 +1699,7 @@ L(shl_15_bwd_loop_L1):
movaps %xmm3, 0x10(%rdi)
jb L(shl_15_bwd_end)
movaps %xmm4, (%rdi)
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
L(shl_15_bwd_end):
movaps %xmm4, (%rdi)
diff --git a/sysdeps/x86_64/multiarch/memcpy.S b/sysdeps/x86_64/multiarch/memcpy.S
deleted file mode 100644
index 64a1bcd137..0000000000
--- a/sysdeps/x86_64/multiarch/memcpy.S
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Multiple versions of memcpy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <shlib-compat.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
- DSO. In static binaries we need memcpy before the initialization
- happened. */
-#if defined SHARED && IS_IN (libc)
- .text
-ENTRY(__new_memcpy)
- .type __new_memcpy, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
-#ifdef HAVE_AVX512_ASM_SUPPORT
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jz 1f
- HAS_ARCH_FEATURE (Prefer_No_VZEROUPPER)
- jz 1f
- leaq __memcpy_avx512_no_vzeroupper(%rip), %rax
- ret
-#endif
-1: leaq __memcpy_avx_unaligned(%rip), %rax
- HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load)
- jz 2f
- ret
-2: leaq __memcpy_sse2(%rip), %rax
- HAS_ARCH_FEATURE (Slow_BSF)
- jnz 3f
- leaq __memcpy_sse2_unaligned(%rip), %rax
- ret
-3: HAS_CPU_FEATURE (SSSE3)
- jz 4f
- leaq __memcpy_ssse3(%rip), %rax
-4: ret
-END(__new_memcpy)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __memcpy_sse2, @function; \
- .globl __memcpy_sse2; \
- .hidden __memcpy_sse2; \
- .p2align 4; \
- __memcpy_sse2: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __memcpy_sse2, .-__memcpy_sse2
-
-# undef ENTRY_CHK
-# define ENTRY_CHK(name) \
- .type __memcpy_chk_sse2, @function; \
- .globl __memcpy_chk_sse2; \
- .p2align 4; \
- __memcpy_chk_sse2: cfi_startproc; \
- CALL_MCOUNT
-# undef END_CHK
-# define END_CHK(name) \
- cfi_endproc; .size __memcpy_chk_sse2, .-__memcpy_chk_sse2
-
-# undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal memcpy calls through a PLT.
- The speedup we get from using SSSE3 instruction is likely eaten away
- by the indirect call in the PLT. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_memcpy; __GI_memcpy = __memcpy_sse2
-
-versioned_symbol (libc, __new_memcpy, memcpy, GLIBC_2_14);
-#endif
-
-#include "../memcpy.S"
diff --git a/sysdeps/x86_64/multiarch/memcpy.c b/sysdeps/x86_64/multiarch/memcpy.c
new file mode 100644
index 0000000000..419f76aefc
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memcpy.c
@@ -0,0 +1,39 @@
+/* Multiple versions of memcpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define memcpy __redirect_memcpy
+# include <string.h>
+# undef memcpy
+
+# define SYMBOL_NAME memcpy
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_memcpy, __new_memcpy,
+ IFUNC_SELECTOR ());
+
+# ifdef SHARED
+__hidden_ver1 (__new_memcpy, __GI_memcpy, __redirect_memcpy)
+ __attribute__ ((visibility ("hidden")));
+# endif
+
+# include <shlib-compat.h>
+versioned_symbol (libc, __new_memcpy, memcpy, GLIBC_2_14);
+#endif
diff --git a/sysdeps/x86_64/multiarch/memcpy_chk-nonshared.S b/sysdeps/x86_64/multiarch/memcpy_chk-nonshared.S
new file mode 100644
index 0000000000..84c8842ce7
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memcpy_chk-nonshared.S
@@ -0,0 +1,21 @@
+/* Non-shared version of memcpy_chk for x86-64.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/x86_64/memcpy_chk.S>
+#endif
diff --git a/sysdeps/x86_64/multiarch/memcpy_chk.S b/sysdeps/x86_64/multiarch/memcpy_chk.S
deleted file mode 100644
index 648217e971..0000000000
--- a/sysdeps/x86_64/multiarch/memcpy_chk.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Multiple versions of __memcpy_chk
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
- DSO. There are no multiarch memcpy functions for static binaries.
- */
-#if IS_IN (libc)
-# ifdef SHARED
- .text
-ENTRY(__memcpy_chk)
- .type __memcpy_chk, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
-#ifdef HAVE_AVX512_ASM_SUPPORT
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jz 1f
- HAS_ARCH_FEATURE (Prefer_No_VZEROUPPER)
- jz 1f
- leaq __memcpy_chk_avx512_no_vzeroupper(%rip), %rax
- ret
-#endif
-1: leaq __memcpy_chk_sse2(%rip), %rax
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- leaq __memcpy_chk_ssse3(%rip), %rax
- HAS_ARCH_FEATURE (Fast_Copy_Backward)
- jz 2f
- leaq __memcpy_chk_ssse3_back(%rip), %rax
- HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load)
- jz 2f
- leaq __memcpy_chk_avx_unaligned(%rip), %rax
-2: ret
-END(__memcpy_chk)
-# else
-# include "../memcpy_chk.S"
-# endif
-#endif
diff --git a/sysdeps/x86_64/multiarch/memcpy_chk.c b/sysdeps/x86_64/multiarch/memcpy_chk.c
new file mode 100644
index 0000000000..c9b901a6dd
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memcpy_chk.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __memcpy_chk
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __memcpy_chk __redirect_memcpy_chk
+# include <string.h>
+# undef __memcpy_chk
+
+# define SYMBOL_NAME memcpy_chk
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_memcpy_chk, __memcpy_chk,
+ IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms.S
new file mode 100644
index 0000000000..e195e93f15
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms.S
@@ -0,0 +1,12 @@
+#if IS_IN (libc)
+# define VEC_SIZE 32
+# define VEC(i) ymm##i
+# define VMOVNT vmovntdq
+# define VMOVU vmovdqu
+# define VMOVA vmovdqa
+
+# define SECTION(p) p##.avx
+# define MEMMOVE_SYMBOL(p,s) p##_avx_##s
+
+# include "memmove-vec-unaligned-erms.S"
+#endif
diff --git a/sysdeps/x86_64/multiarch/memmove-avx-unaligned.S b/sysdeps/x86_64/multiarch/memmove-avx-unaligned.S
deleted file mode 100644
index 75e35f2957..0000000000
--- a/sysdeps/x86_64/multiarch/memmove-avx-unaligned.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* memmove with AVX
- Copyright (C) 2014-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 USE_AS_MEMMOVE
-#define MEMCPY __memmove_avx_unaligned
-#define MEMCPY_CHK __memmove_chk_avx_unaligned
-#include "memcpy-avx-unaligned.S"
diff --git a/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S b/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S
index 518d1fec35..effc3ac2de 100644
--- a/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S
+++ b/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S
@@ -1,5 +1,5 @@
-/* memmove optimized with AVX512 for KNL hardware.
- Copyright (C) 2016 Free Software Foundation, Inc.
+/* memmove/memcpy/mempcpy optimized with AVX512 for KNL hardware.
+ Copyright (C) 2016-2018 Free Software 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,7 +16,400 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define USE_AS_MEMMOVE
-#define MEMCPY __memmove_avx512_no_vzeroupper
-#define MEMCPY_CHK __memmove_chk_avx512_no_vzeroupper
-#include "memcpy-avx512-no-vzeroupper.S"
+#include <sysdep.h>
+
+#if IS_IN (libc)
+
+# include "asm-syntax.h"
+
+ .section .text.avx512,"ax",@progbits
+ENTRY (__mempcpy_chk_avx512_no_vzeroupper)
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (__mempcpy_chk_avx512_no_vzeroupper)
+
+ENTRY (__mempcpy_avx512_no_vzeroupper)
+ movq %rdi, %rax
+ addq %rdx, %rax
+ jmp L(start)
+END (__mempcpy_avx512_no_vzeroupper)
+
+ENTRY (__memmove_chk_avx512_no_vzeroupper)
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (__memmove_chk_avx512_no_vzeroupper)
+
+ENTRY (__memmove_avx512_no_vzeroupper)
+ mov %rdi, %rax
+# ifdef USE_AS_MEMPCPY
+ add %rdx, %rax
+# endif
+L(start):
+ lea (%rsi, %rdx), %rcx
+ lea (%rdi, %rdx), %r9
+ cmp $512, %rdx
+ ja L(512bytesormore)
+
+L(check):
+ cmp $16, %rdx
+ jbe L(less_16bytes)
+ cmp $256, %rdx
+ jb L(less_256bytes)
+ vmovups (%rsi), %zmm0
+ vmovups 0x40(%rsi), %zmm1
+ vmovups 0x80(%rsi), %zmm2
+ vmovups 0xC0(%rsi), %zmm3
+ vmovups -0x100(%rcx), %zmm4
+ vmovups -0xC0(%rcx), %zmm5
+ vmovups -0x80(%rcx), %zmm6
+ vmovups -0x40(%rcx), %zmm7
+ vmovups %zmm0, (%rdi)
+ vmovups %zmm1, 0x40(%rdi)
+ vmovups %zmm2, 0x80(%rdi)
+ vmovups %zmm3, 0xC0(%rdi)
+ vmovups %zmm4, -0x100(%r9)
+ vmovups %zmm5, -0xC0(%r9)
+ vmovups %zmm6, -0x80(%r9)
+ vmovups %zmm7, -0x40(%r9)
+ ret
+
+L(less_256bytes):
+ cmp $128, %dl
+ jb L(less_128bytes)
+ vmovups (%rsi), %zmm0
+ vmovups 0x40(%rsi), %zmm1
+ vmovups -0x80(%rcx), %zmm2
+ vmovups -0x40(%rcx), %zmm3
+ vmovups %zmm0, (%rdi)
+ vmovups %zmm1, 0x40(%rdi)
+ vmovups %zmm2, -0x80(%r9)
+ vmovups %zmm3, -0x40(%r9)
+ ret
+
+L(less_128bytes):
+ cmp $64, %dl
+ jb L(less_64bytes)
+ vmovdqu (%rsi), %ymm0
+ vmovdqu 0x20(%rsi), %ymm1
+ vmovdqu -0x40(%rcx), %ymm2
+ vmovdqu -0x20(%rcx), %ymm3
+ vmovdqu %ymm0, (%rdi)
+ vmovdqu %ymm1, 0x20(%rdi)
+ vmovdqu %ymm2, -0x40(%r9)
+ vmovdqu %ymm3, -0x20(%r9)
+ ret
+
+L(less_64bytes):
+ cmp $32, %dl
+ jb L(less_32bytes)
+ vmovdqu (%rsi), %ymm0
+ vmovdqu -0x20(%rcx), %ymm1
+ vmovdqu %ymm0, (%rdi)
+ vmovdqu %ymm1, -0x20(%r9)
+ ret
+
+L(less_32bytes):
+ vmovdqu (%rsi), %xmm0
+ vmovdqu -0x10(%rcx), %xmm1
+ vmovdqu %xmm0, (%rdi)
+ vmovdqu %xmm1, -0x10(%r9)
+ ret
+
+L(less_16bytes):
+ cmp $8, %dl
+ jb L(less_8bytes)
+ movq (%rsi), %rsi
+ movq -0x8(%rcx), %rcx
+ movq %rsi, (%rdi)
+ movq %rcx, -0x8(%r9)
+ ret
+
+L(less_8bytes):
+ cmp $4, %dl
+ jb L(less_4bytes)
+ mov (%rsi), %esi
+ mov -0x4(%rcx), %ecx
+ mov %esi, (%rdi)
+ mov %ecx, -0x4(%r9)
+ ret
+
+L(less_4bytes):
+ cmp $2, %dl
+ jb L(less_2bytes)
+ mov (%rsi), %si
+ mov -0x2(%rcx), %cx
+ mov %si, (%rdi)
+ mov %cx, -0x2(%r9)
+ ret
+
+L(less_2bytes):
+ cmp $1, %dl
+ jb L(less_1bytes)
+ mov (%rsi), %cl
+ mov %cl, (%rdi)
+L(less_1bytes):
+ ret
+
+L(512bytesormore):
+# ifdef SHARED_CACHE_SIZE_HALF
+ mov $SHARED_CACHE_SIZE_HALF, %r8
+# else
+ mov __x86_shared_cache_size_half(%rip), %r8
+# endif
+ cmp %r8, %rdx
+ jae L(preloop_large)
+ cmp $1024, %rdx
+ ja L(1024bytesormore)
+ prefetcht1 (%rsi)
+ prefetcht1 0x40(%rsi)
+ prefetcht1 0x80(%rsi)
+ prefetcht1 0xC0(%rsi)
+ prefetcht1 0x100(%rsi)
+ prefetcht1 0x140(%rsi)
+ prefetcht1 0x180(%rsi)
+ prefetcht1 0x1C0(%rsi)
+ prefetcht1 -0x200(%rcx)
+ prefetcht1 -0x1C0(%rcx)
+ prefetcht1 -0x180(%rcx)
+ prefetcht1 -0x140(%rcx)
+ prefetcht1 -0x100(%rcx)
+ prefetcht1 -0xC0(%rcx)
+ prefetcht1 -0x80(%rcx)
+ prefetcht1 -0x40(%rcx)
+ vmovups (%rsi), %zmm0
+ vmovups 0x40(%rsi), %zmm1
+ vmovups 0x80(%rsi), %zmm2
+ vmovups 0xC0(%rsi), %zmm3
+ vmovups 0x100(%rsi), %zmm4
+ vmovups 0x140(%rsi), %zmm5
+ vmovups 0x180(%rsi), %zmm6
+ vmovups 0x1C0(%rsi), %zmm7
+ vmovups -0x200(%rcx), %zmm8
+ vmovups -0x1C0(%rcx), %zmm9
+ vmovups -0x180(%rcx), %zmm10
+ vmovups -0x140(%rcx), %zmm11
+ vmovups -0x100(%rcx), %zmm12
+ vmovups -0xC0(%rcx), %zmm13
+ vmovups -0x80(%rcx), %zmm14
+ vmovups -0x40(%rcx), %zmm15
+ vmovups %zmm0, (%rdi)
+ vmovups %zmm1, 0x40(%rdi)
+ vmovups %zmm2, 0x80(%rdi)
+ vmovups %zmm3, 0xC0(%rdi)
+ vmovups %zmm4, 0x100(%rdi)
+ vmovups %zmm5, 0x140(%rdi)
+ vmovups %zmm6, 0x180(%rdi)
+ vmovups %zmm7, 0x1C0(%rdi)
+ vmovups %zmm8, -0x200(%r9)
+ vmovups %zmm9, -0x1C0(%r9)
+ vmovups %zmm10, -0x180(%r9)
+ vmovups %zmm11, -0x140(%r9)
+ vmovups %zmm12, -0x100(%r9)
+ vmovups %zmm13, -0xC0(%r9)
+ vmovups %zmm14, -0x80(%r9)
+ vmovups %zmm15, -0x40(%r9)
+ ret
+
+L(1024bytesormore):
+ cmp %rsi, %rdi
+ ja L(1024bytesormore_bkw)
+ sub $512, %r9
+ vmovups -0x200(%rcx), %zmm8
+ vmovups -0x1C0(%rcx), %zmm9
+ vmovups -0x180(%rcx), %zmm10
+ vmovups -0x140(%rcx), %zmm11
+ vmovups -0x100(%rcx), %zmm12
+ vmovups -0xC0(%rcx), %zmm13
+ vmovups -0x80(%rcx), %zmm14
+ vmovups -0x40(%rcx), %zmm15
+ prefetcht1 (%rsi)
+ prefetcht1 0x40(%rsi)
+ prefetcht1 0x80(%rsi)
+ prefetcht1 0xC0(%rsi)
+ prefetcht1 0x100(%rsi)
+ prefetcht1 0x140(%rsi)
+ prefetcht1 0x180(%rsi)
+ prefetcht1 0x1C0(%rsi)
+
+/* Loop with unaligned memory access. */
+L(gobble_512bytes_loop):
+ vmovups (%rsi), %zmm0
+ vmovups 0x40(%rsi), %zmm1
+ vmovups 0x80(%rsi), %zmm2
+ vmovups 0xC0(%rsi), %zmm3
+ vmovups 0x100(%rsi), %zmm4
+ vmovups 0x140(%rsi), %zmm5
+ vmovups 0x180(%rsi), %zmm6
+ vmovups 0x1C0(%rsi), %zmm7
+ add $512, %rsi
+ prefetcht1 (%rsi)
+ prefetcht1 0x40(%rsi)
+ prefetcht1 0x80(%rsi)
+ prefetcht1 0xC0(%rsi)
+ prefetcht1 0x100(%rsi)
+ prefetcht1 0x140(%rsi)
+ prefetcht1 0x180(%rsi)
+ prefetcht1 0x1C0(%rsi)
+ vmovups %zmm0, (%rdi)
+ vmovups %zmm1, 0x40(%rdi)
+ vmovups %zmm2, 0x80(%rdi)
+ vmovups %zmm3, 0xC0(%rdi)
+ vmovups %zmm4, 0x100(%rdi)
+ vmovups %zmm5, 0x140(%rdi)
+ vmovups %zmm6, 0x180(%rdi)
+ vmovups %zmm7, 0x1C0(%rdi)
+ add $512, %rdi
+ cmp %r9, %rdi
+ jb L(gobble_512bytes_loop)
+ vmovups %zmm8, (%r9)
+ vmovups %zmm9, 0x40(%r9)
+ vmovups %zmm10, 0x80(%r9)
+ vmovups %zmm11, 0xC0(%r9)
+ vmovups %zmm12, 0x100(%r9)
+ vmovups %zmm13, 0x140(%r9)
+ vmovups %zmm14, 0x180(%r9)
+ vmovups %zmm15, 0x1C0(%r9)
+ ret
+
+L(1024bytesormore_bkw):
+ add $512, %rdi
+ vmovups 0x1C0(%rsi), %zmm8
+ vmovups 0x180(%rsi), %zmm9
+ vmovups 0x140(%rsi), %zmm10
+ vmovups 0x100(%rsi), %zmm11
+ vmovups 0xC0(%rsi), %zmm12
+ vmovups 0x80(%rsi), %zmm13
+ vmovups 0x40(%rsi), %zmm14
+ vmovups (%rsi), %zmm15
+ prefetcht1 -0x40(%rcx)
+ prefetcht1 -0x80(%rcx)
+ prefetcht1 -0xC0(%rcx)
+ prefetcht1 -0x100(%rcx)
+ prefetcht1 -0x140(%rcx)
+ prefetcht1 -0x180(%rcx)
+ prefetcht1 -0x1C0(%rcx)
+ prefetcht1 -0x200(%rcx)
+
+/* Backward loop with unaligned memory access. */
+L(gobble_512bytes_loop_bkw):
+ vmovups -0x40(%rcx), %zmm0
+ vmovups -0x80(%rcx), %zmm1
+ vmovups -0xC0(%rcx), %zmm2
+ vmovups -0x100(%rcx), %zmm3
+ vmovups -0x140(%rcx), %zmm4
+ vmovups -0x180(%rcx), %zmm5
+ vmovups -0x1C0(%rcx), %zmm6
+ vmovups -0x200(%rcx), %zmm7
+ sub $512, %rcx
+ prefetcht1 -0x40(%rcx)
+ prefetcht1 -0x80(%rcx)
+ prefetcht1 -0xC0(%rcx)
+ prefetcht1 -0x100(%rcx)
+ prefetcht1 -0x140(%rcx)
+ prefetcht1 -0x180(%rcx)
+ prefetcht1 -0x1C0(%rcx)
+ prefetcht1 -0x200(%rcx)
+ vmovups %zmm0, -0x40(%r9)
+ vmovups %zmm1, -0x80(%r9)
+ vmovups %zmm2, -0xC0(%r9)
+ vmovups %zmm3, -0x100(%r9)
+ vmovups %zmm4, -0x140(%r9)
+ vmovups %zmm5, -0x180(%r9)
+ vmovups %zmm6, -0x1C0(%r9)
+ vmovups %zmm7, -0x200(%r9)
+ sub $512, %r9
+ cmp %rdi, %r9
+ ja L(gobble_512bytes_loop_bkw)
+ vmovups %zmm8, -0x40(%rdi)
+ vmovups %zmm9, -0x80(%rdi)
+ vmovups %zmm10, -0xC0(%rdi)
+ vmovups %zmm11, -0x100(%rdi)
+ vmovups %zmm12, -0x140(%rdi)
+ vmovups %zmm13, -0x180(%rdi)
+ vmovups %zmm14, -0x1C0(%rdi)
+ vmovups %zmm15, -0x200(%rdi)
+ ret
+
+L(preloop_large):
+ cmp %rsi, %rdi
+ ja L(preloop_large_bkw)
+ vmovups (%rsi), %zmm4
+ vmovups 0x40(%rsi), %zmm5
+
+ mov %rdi, %r11
+/* Align destination for access with non-temporal stores in the loop. */
+ mov %rdi, %r8
+ and $-0x80, %rdi
+ add $0x80, %rdi
+ sub %rdi, %r8
+ sub %r8, %rsi
+ add %r8, %rdx
+L(gobble_256bytes_nt_loop):
+ prefetcht1 0x200(%rsi)
+ prefetcht1 0x240(%rsi)
+ prefetcht1 0x280(%rsi)
+ prefetcht1 0x2C0(%rsi)
+ prefetcht1 0x300(%rsi)
+ prefetcht1 0x340(%rsi)
+ prefetcht1 0x380(%rsi)
+ prefetcht1 0x3C0(%rsi)
+ vmovdqu64 (%rsi), %zmm0
+ vmovdqu64 0x40(%rsi), %zmm1
+ vmovdqu64 0x80(%rsi), %zmm2
+ vmovdqu64 0xC0(%rsi), %zmm3
+ vmovntdq %zmm0, (%rdi)
+ vmovntdq %zmm1, 0x40(%rdi)
+ vmovntdq %zmm2, 0x80(%rdi)
+ vmovntdq %zmm3, 0xC0(%rdi)
+ sub $256, %rdx
+ add $256, %rsi
+ add $256, %rdi
+ cmp $256, %rdx
+ ja L(gobble_256bytes_nt_loop)
+ sfence
+ vmovups %zmm4, (%r11)
+ vmovups %zmm5, 0x40(%r11)
+ jmp L(check)
+
+L(preloop_large_bkw):
+ vmovups -0x80(%rcx), %zmm4
+ vmovups -0x40(%rcx), %zmm5
+
+/* Align end of destination for access with non-temporal stores. */
+ mov %r9, %r8
+ and $-0x80, %r9
+ sub %r9, %r8
+ sub %r8, %rcx
+ sub %r8, %rdx
+ add %r9, %r8
+L(gobble_256bytes_nt_loop_bkw):
+ prefetcht1 -0x400(%rcx)
+ prefetcht1 -0x3C0(%rcx)
+ prefetcht1 -0x380(%rcx)
+ prefetcht1 -0x340(%rcx)
+ prefetcht1 -0x300(%rcx)
+ prefetcht1 -0x2C0(%rcx)
+ prefetcht1 -0x280(%rcx)
+ prefetcht1 -0x240(%rcx)
+ vmovdqu64 -0x100(%rcx), %zmm0
+ vmovdqu64 -0xC0(%rcx), %zmm1
+ vmovdqu64 -0x80(%rcx), %zmm2
+ vmovdqu64 -0x40(%rcx), %zmm3
+ vmovntdq %zmm0, -0x100(%r9)
+ vmovntdq %zmm1, -0xC0(%r9)
+ vmovntdq %zmm2, -0x80(%r9)
+ vmovntdq %zmm3, -0x40(%r9)
+ sub $256, %rdx
+ sub $256, %rcx
+ sub $256, %r9
+ cmp $256, %rdx
+ ja L(gobble_256bytes_nt_loop_bkw)
+ sfence
+ vmovups %zmm4, -0x80(%r8)
+ vmovups %zmm5, -0x40(%r8)
+ jmp L(check)
+END (__memmove_avx512_no_vzeroupper)
+
+strong_alias (__memmove_avx512_no_vzeroupper, __memcpy_avx512_no_vzeroupper)
+strong_alias (__memmove_chk_avx512_no_vzeroupper, __memcpy_chk_avx512_no_vzeroupper)
+#endif
diff --git a/sysdeps/x86_64/multiarch/memmove-avx512-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-avx512-unaligned-erms.S
new file mode 100644
index 0000000000..aac1515cf6
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memmove-avx512-unaligned-erms.S
@@ -0,0 +1,12 @@
+#if IS_IN (libc)
+# define VEC_SIZE 64
+# define VEC(i) zmm##i
+# define VMOVNT vmovntdq
+# define VMOVU vmovdqu64
+# define VMOVA vmovdqa64
+
+# define SECTION(p) p##.avx512
+# define MEMMOVE_SYMBOL(p,s) p##_avx512_##s
+
+# include "memmove-vec-unaligned-erms.S"
+#endif
diff --git a/sysdeps/x86_64/multiarch/memmove-sse2-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-sse2-unaligned-erms.S
new file mode 100644
index 0000000000..7c6163ddcb
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memmove-sse2-unaligned-erms.S
@@ -0,0 +1,33 @@
+/* memmove with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define MEMMOVE_SYMBOL(p,s) p##_sse2_##s
+#else
+weak_alias (__mempcpy, mempcpy)
+#endif
+
+#include <sysdeps/x86_64/memmove.S>
+
+#if defined SHARED && IS_IN (libc)
+# include <shlib-compat.h>
+# if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
+/* Use __memmove_sse2_unaligned to support overlapping addresses. */
+compat_symbol (libc, __memmove_sse2_unaligned, memcpy, GLIBC_2_2_5);
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
new file mode 100644
index 0000000000..e2ede45e9f
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
@@ -0,0 +1,565 @@
+/* memmove/memcpy/mempcpy with unaligned load/store and rep movsb
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+/* memmove/memcpy/mempcpy is implemented as:
+ 1. Use overlapping load and store to avoid branch.
+ 2. Load all sources into registers and store them together to avoid
+ possible address overlap between source and destination.
+ 3. If size is 8 * VEC_SIZE or less, load all sources into registers
+ and store them together.
+ 4. If address of destination > address of source, backward copy
+ 4 * VEC_SIZE at a time with unaligned load and aligned store.
+ Load the first 4 * VEC and last VEC before the loop and store
+ them after the loop to support overlapping addresses.
+ 5. Otherwise, forward copy 4 * VEC_SIZE at a time with unaligned
+ load and aligned store. Load the last 4 * VEC and first VEC
+ before the loop and store them after the loop to support
+ overlapping addresses.
+ 6. If size >= __x86_shared_non_temporal_threshold and there is no
+ overlap between destination and source, use non-temporal store
+ instead of aligned store. */
+
+#include <sysdep.h>
+
+#ifndef MEMCPY_SYMBOL
+# define MEMCPY_SYMBOL(p,s) MEMMOVE_SYMBOL(p, s)
+#endif
+
+#ifndef MEMPCPY_SYMBOL
+# define MEMPCPY_SYMBOL(p,s) MEMMOVE_SYMBOL(p, s)
+#endif
+
+#ifndef MEMMOVE_CHK_SYMBOL
+# define MEMMOVE_CHK_SYMBOL(p,s) MEMMOVE_SYMBOL(p, s)
+#endif
+
+#ifndef VZEROUPPER
+# if VEC_SIZE > 16
+# define VZEROUPPER vzeroupper
+# else
+# define VZEROUPPER
+# endif
+#endif
+
+/* Threshold to use Enhanced REP MOVSB. Since there is overhead to set
+ up REP MOVSB operation, REP MOVSB isn't faster on short data. The
+ memcpy micro benchmark in glibc shows that 2KB is the approximate
+ value above which REP MOVSB becomes faster than SSE2 optimization
+ on processors with Enhanced REP MOVSB. Since larger register size
+ can move more data with a single load and store, the threshold is
+ higher with larger register size. */
+#ifndef REP_MOVSB_THRESHOLD
+# define REP_MOVSB_THRESHOLD (2048 * (VEC_SIZE / 16))
+#endif
+
+#ifndef PREFETCH
+# define PREFETCH(addr) prefetcht0 addr
+#endif
+
+/* Assume 64-byte prefetch size. */
+#ifndef PREFETCH_SIZE
+# define PREFETCH_SIZE 64
+#endif
+
+#define PREFETCHED_LOAD_SIZE (VEC_SIZE * 4)
+
+#if PREFETCH_SIZE == 64
+# if PREFETCHED_LOAD_SIZE == PREFETCH_SIZE
+# define PREFETCH_ONE_SET(dir, base, offset) \
+ PREFETCH ((offset)base)
+# elif PREFETCHED_LOAD_SIZE == 2 * PREFETCH_SIZE
+# define PREFETCH_ONE_SET(dir, base, offset) \
+ PREFETCH ((offset)base); \
+ PREFETCH ((offset + dir * PREFETCH_SIZE)base)
+# elif PREFETCHED_LOAD_SIZE == 4 * PREFETCH_SIZE
+# define PREFETCH_ONE_SET(dir, base, offset) \
+ PREFETCH ((offset)base); \
+ PREFETCH ((offset + dir * PREFETCH_SIZE)base); \
+ PREFETCH ((offset + dir * PREFETCH_SIZE * 2)base); \
+ PREFETCH ((offset + dir * PREFETCH_SIZE * 3)base)
+# else
+# error Unsupported PREFETCHED_LOAD_SIZE!
+# endif
+#else
+# error Unsupported PREFETCH_SIZE!
+#endif
+
+#ifndef SECTION
+# error SECTION is not defined!
+#endif
+
+ .section SECTION(.text),"ax",@progbits
+#if defined SHARED && IS_IN (libc)
+ENTRY (MEMMOVE_CHK_SYMBOL (__mempcpy_chk, unaligned))
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (MEMMOVE_CHK_SYMBOL (__mempcpy_chk, unaligned))
+#endif
+
+ENTRY (MEMPCPY_SYMBOL (__mempcpy, unaligned))
+ movq %rdi, %rax
+ addq %rdx, %rax
+ jmp L(start)
+END (MEMPCPY_SYMBOL (__mempcpy, unaligned))
+
+#if defined SHARED && IS_IN (libc)
+ENTRY (MEMMOVE_CHK_SYMBOL (__memmove_chk, unaligned))
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (MEMMOVE_CHK_SYMBOL (__memmove_chk, unaligned))
+#endif
+
+ENTRY (MEMMOVE_SYMBOL (__memmove, unaligned))
+ movq %rdi, %rax
+L(start):
+ cmpq $VEC_SIZE, %rdx
+ jb L(less_vec)
+ cmpq $(VEC_SIZE * 2), %rdx
+ ja L(more_2x_vec)
+#if !defined USE_MULTIARCH || !IS_IN (libc)
+L(last_2x_vec):
+#endif
+ /* From VEC and to 2 * VEC. No branch when size == VEC_SIZE. */
+ VMOVU (%rsi), %VEC(0)
+ VMOVU -VEC_SIZE(%rsi,%rdx), %VEC(1)
+ VMOVU %VEC(0), (%rdi)
+ VMOVU %VEC(1), -VEC_SIZE(%rdi,%rdx)
+ VZEROUPPER
+#if !defined USE_MULTIARCH || !IS_IN (libc)
+L(nop):
+#endif
+ ret
+#if defined USE_MULTIARCH && IS_IN (libc)
+END (MEMMOVE_SYMBOL (__memmove, unaligned))
+
+# if VEC_SIZE == 16
+ENTRY (__mempcpy_chk_erms)
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (__mempcpy_chk_erms)
+
+/* Only used to measure performance of REP MOVSB. */
+ENTRY (__mempcpy_erms)
+ movq %rdi, %rax
+ /* Skip zero length. */
+ testq %rdx, %rdx
+ jz 2f
+ addq %rdx, %rax
+ jmp L(start_movsb)
+END (__mempcpy_erms)
+
+ENTRY (__memmove_chk_erms)
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (__memmove_chk_erms)
+
+ENTRY (__memmove_erms)
+ movq %rdi, %rax
+ /* Skip zero length. */
+ testq %rdx, %rdx
+ jz 2f
+L(start_movsb):
+ movq %rdx, %rcx
+ cmpq %rsi, %rdi
+ jb 1f
+ /* Source == destination is less common. */
+ je 2f
+ leaq (%rsi,%rcx), %rdx
+ cmpq %rdx, %rdi
+ jb L(movsb_backward)
+1:
+ rep movsb
+2:
+ ret
+L(movsb_backward):
+ leaq -1(%rdi,%rcx), %rdi
+ leaq -1(%rsi,%rcx), %rsi
+ std
+ rep movsb
+ cld
+ ret
+END (__memmove_erms)
+strong_alias (__memmove_erms, __memcpy_erms)
+strong_alias (__memmove_chk_erms, __memcpy_chk_erms)
+# endif
+
+# ifdef SHARED
+ENTRY (MEMMOVE_CHK_SYMBOL (__mempcpy_chk, unaligned_erms))
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (MEMMOVE_CHK_SYMBOL (__mempcpy_chk, unaligned_erms))
+# endif
+
+ENTRY (MEMMOVE_SYMBOL (__mempcpy, unaligned_erms))
+ movq %rdi, %rax
+ addq %rdx, %rax
+ jmp L(start_erms)
+END (MEMMOVE_SYMBOL (__mempcpy, unaligned_erms))
+
+# ifdef SHARED
+ENTRY (MEMMOVE_CHK_SYMBOL (__memmove_chk, unaligned_erms))
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (MEMMOVE_CHK_SYMBOL (__memmove_chk, unaligned_erms))
+# endif
+
+ENTRY (MEMMOVE_SYMBOL (__memmove, unaligned_erms))
+ movq %rdi, %rax
+L(start_erms):
+ cmpq $VEC_SIZE, %rdx
+ jb L(less_vec)
+ cmpq $(VEC_SIZE * 2), %rdx
+ ja L(movsb_more_2x_vec)
+L(last_2x_vec):
+ /* From VEC and to 2 * VEC. No branch when size == VEC_SIZE. */
+ VMOVU (%rsi), %VEC(0)
+ VMOVU -VEC_SIZE(%rsi,%rdx), %VEC(1)
+ VMOVU %VEC(0), (%rdi)
+ VMOVU %VEC(1), -VEC_SIZE(%rdi,%rdx)
+L(return):
+ VZEROUPPER
+ ret
+
+L(movsb):
+ cmpq __x86_shared_non_temporal_threshold(%rip), %rdx
+ jae L(more_8x_vec)
+ cmpq %rsi, %rdi
+ jb 1f
+ /* Source == destination is less common. */
+ je L(nop)
+ leaq (%rsi,%rdx), %r9
+ cmpq %r9, %rdi
+ /* Avoid slow backward REP MOVSB. */
+# if REP_MOVSB_THRESHOLD <= (VEC_SIZE * 8)
+# error Unsupported REP_MOVSB_THRESHOLD and VEC_SIZE!
+# endif
+ jb L(more_8x_vec_backward)
+1:
+ movq %rdx, %rcx
+ rep movsb
+L(nop):
+ ret
+#endif
+
+L(less_vec):
+ /* Less than 1 VEC. */
+#if VEC_SIZE != 16 && VEC_SIZE != 32 && VEC_SIZE != 64
+# error Unsupported VEC_SIZE!
+#endif
+#if VEC_SIZE > 32
+ cmpb $32, %dl
+ jae L(between_32_63)
+#endif
+#if VEC_SIZE > 16
+ cmpb $16, %dl
+ jae L(between_16_31)
+#endif
+ cmpb $8, %dl
+ jae L(between_8_15)
+ cmpb $4, %dl
+ jae L(between_4_7)
+ cmpb $1, %dl
+ ja L(between_2_3)
+ jb 1f
+ movzbl (%rsi), %ecx
+ movb %cl, (%rdi)
+1:
+ ret
+#if VEC_SIZE > 32
+L(between_32_63):
+ /* From 32 to 63. No branch when size == 32. */
+ vmovdqu (%rsi), %ymm0
+ vmovdqu -32(%rsi,%rdx), %ymm1
+ vmovdqu %ymm0, (%rdi)
+ vmovdqu %ymm1, -32(%rdi,%rdx)
+ VZEROUPPER
+ ret
+#endif
+#if VEC_SIZE > 16
+ /* From 16 to 31. No branch when size == 16. */
+L(between_16_31):
+ vmovdqu (%rsi), %xmm0
+ vmovdqu -16(%rsi,%rdx), %xmm1
+ vmovdqu %xmm0, (%rdi)
+ vmovdqu %xmm1, -16(%rdi,%rdx)
+ ret
+#endif
+L(between_8_15):
+ /* From 8 to 15. No branch when size == 8. */
+ movq -8(%rsi,%rdx), %rcx
+ movq (%rsi), %rsi
+ movq %rcx, -8(%rdi,%rdx)
+ movq %rsi, (%rdi)
+ ret
+L(between_4_7):
+ /* From 4 to 7. No branch when size == 4. */
+ movl -4(%rsi,%rdx), %ecx
+ movl (%rsi), %esi
+ movl %ecx, -4(%rdi,%rdx)
+ movl %esi, (%rdi)
+ ret
+L(between_2_3):
+ /* From 2 to 3. No branch when size == 2. */
+ movzwl -2(%rsi,%rdx), %ecx
+ movzwl (%rsi), %esi
+ movw %cx, -2(%rdi,%rdx)
+ movw %si, (%rdi)
+ ret
+
+#if defined USE_MULTIARCH && IS_IN (libc)
+L(movsb_more_2x_vec):
+ cmpq $REP_MOVSB_THRESHOLD, %rdx
+ ja L(movsb)
+#endif
+L(more_2x_vec):
+ /* More than 2 * VEC and there may be overlap between destination
+ and source. */
+ cmpq $(VEC_SIZE * 8), %rdx
+ ja L(more_8x_vec)
+ cmpq $(VEC_SIZE * 4), %rdx
+ jb L(last_4x_vec)
+ /* Copy from 4 * VEC to 8 * VEC, inclusively. */
+ VMOVU (%rsi), %VEC(0)
+ VMOVU VEC_SIZE(%rsi), %VEC(1)
+ VMOVU (VEC_SIZE * 2)(%rsi), %VEC(2)
+ VMOVU (VEC_SIZE * 3)(%rsi), %VEC(3)
+ VMOVU -VEC_SIZE(%rsi,%rdx), %VEC(4)
+ VMOVU -(VEC_SIZE * 2)(%rsi,%rdx), %VEC(5)
+ VMOVU -(VEC_SIZE * 3)(%rsi,%rdx), %VEC(6)
+ VMOVU -(VEC_SIZE * 4)(%rsi,%rdx), %VEC(7)
+ VMOVU %VEC(0), (%rdi)
+ VMOVU %VEC(1), VEC_SIZE(%rdi)
+ VMOVU %VEC(2), (VEC_SIZE * 2)(%rdi)
+ VMOVU %VEC(3), (VEC_SIZE * 3)(%rdi)
+ VMOVU %VEC(4), -VEC_SIZE(%rdi,%rdx)
+ VMOVU %VEC(5), -(VEC_SIZE * 2)(%rdi,%rdx)
+ VMOVU %VEC(6), -(VEC_SIZE * 3)(%rdi,%rdx)
+ VMOVU %VEC(7), -(VEC_SIZE * 4)(%rdi,%rdx)
+ VZEROUPPER
+ ret
+L(last_4x_vec):
+ /* Copy from 2 * VEC to 4 * VEC. */
+ VMOVU (%rsi), %VEC(0)
+ VMOVU VEC_SIZE(%rsi), %VEC(1)
+ VMOVU -VEC_SIZE(%rsi,%rdx), %VEC(2)
+ VMOVU -(VEC_SIZE * 2)(%rsi,%rdx), %VEC(3)
+ VMOVU %VEC(0), (%rdi)
+ VMOVU %VEC(1), VEC_SIZE(%rdi)
+ VMOVU %VEC(2), -VEC_SIZE(%rdi,%rdx)
+ VMOVU %VEC(3), -(VEC_SIZE * 2)(%rdi,%rdx)
+ VZEROUPPER
+ ret
+
+L(more_8x_vec):
+ cmpq %rsi, %rdi
+ ja L(more_8x_vec_backward)
+ /* Source == destination is less common. */
+ je L(nop)
+ /* Load the first VEC and last 4 * VEC to support overlapping
+ addresses. */
+ VMOVU (%rsi), %VEC(4)
+ VMOVU -VEC_SIZE(%rsi, %rdx), %VEC(5)
+ VMOVU -(VEC_SIZE * 2)(%rsi, %rdx), %VEC(6)
+ VMOVU -(VEC_SIZE * 3)(%rsi, %rdx), %VEC(7)
+ VMOVU -(VEC_SIZE * 4)(%rsi, %rdx), %VEC(8)
+ /* Save start and stop of the destination buffer. */
+ movq %rdi, %r11
+ leaq -VEC_SIZE(%rdi, %rdx), %rcx
+ /* Align destination for aligned stores in the loop. Compute
+ how much destination is misaligned. */
+ movq %rdi, %r8
+ andq $(VEC_SIZE - 1), %r8
+ /* Get the negative of offset for alignment. */
+ subq $VEC_SIZE, %r8
+ /* Adjust source. */
+ subq %r8, %rsi
+ /* Adjust destination which should be aligned now. */
+ subq %r8, %rdi
+ /* Adjust length. */
+ addq %r8, %rdx
+#if (defined USE_MULTIARCH || VEC_SIZE == 16) && IS_IN (libc)
+ /* Check non-temporal store threshold. */
+ cmpq __x86_shared_non_temporal_threshold(%rip), %rdx
+ ja L(large_forward)
+#endif
+L(loop_4x_vec_forward):
+ /* Copy 4 * VEC a time forward. */
+ VMOVU (%rsi), %VEC(0)
+ VMOVU VEC_SIZE(%rsi), %VEC(1)
+ VMOVU (VEC_SIZE * 2)(%rsi), %VEC(2)
+ VMOVU (VEC_SIZE * 3)(%rsi), %VEC(3)
+ addq $(VEC_SIZE * 4), %rsi
+ subq $(VEC_SIZE * 4), %rdx
+ VMOVA %VEC(0), (%rdi)
+ VMOVA %VEC(1), VEC_SIZE(%rdi)
+ VMOVA %VEC(2), (VEC_SIZE * 2)(%rdi)
+ VMOVA %VEC(3), (VEC_SIZE * 3)(%rdi)
+ addq $(VEC_SIZE * 4), %rdi
+ cmpq $(VEC_SIZE * 4), %rdx
+ ja L(loop_4x_vec_forward)
+ /* Store the last 4 * VEC. */
+ VMOVU %VEC(5), (%rcx)
+ VMOVU %VEC(6), -VEC_SIZE(%rcx)
+ VMOVU %VEC(7), -(VEC_SIZE * 2)(%rcx)
+ VMOVU %VEC(8), -(VEC_SIZE * 3)(%rcx)
+ /* Store the first VEC. */
+ VMOVU %VEC(4), (%r11)
+ VZEROUPPER
+ ret
+
+L(more_8x_vec_backward):
+ /* Load the first 4 * VEC and last VEC to support overlapping
+ addresses. */
+ VMOVU (%rsi), %VEC(4)
+ VMOVU VEC_SIZE(%rsi), %VEC(5)
+ VMOVU (VEC_SIZE * 2)(%rsi), %VEC(6)
+ VMOVU (VEC_SIZE * 3)(%rsi), %VEC(7)
+ VMOVU -VEC_SIZE(%rsi,%rdx), %VEC(8)
+ /* Save stop of the destination buffer. */
+ leaq -VEC_SIZE(%rdi, %rdx), %r11
+ /* Align destination end for aligned stores in the loop. Compute
+ how much destination end is misaligned. */
+ leaq -VEC_SIZE(%rsi, %rdx), %rcx
+ movq %r11, %r9
+ movq %r11, %r8
+ andq $(VEC_SIZE - 1), %r8
+ /* Adjust source. */
+ subq %r8, %rcx
+ /* Adjust the end of destination which should be aligned now. */
+ subq %r8, %r9
+ /* Adjust length. */
+ subq %r8, %rdx
+#if (defined USE_MULTIARCH || VEC_SIZE == 16) && IS_IN (libc)
+ /* Check non-temporal store threshold. */
+ cmpq __x86_shared_non_temporal_threshold(%rip), %rdx
+ ja L(large_backward)
+#endif
+L(loop_4x_vec_backward):
+ /* Copy 4 * VEC a time backward. */
+ VMOVU (%rcx), %VEC(0)
+ VMOVU -VEC_SIZE(%rcx), %VEC(1)
+ VMOVU -(VEC_SIZE * 2)(%rcx), %VEC(2)
+ VMOVU -(VEC_SIZE * 3)(%rcx), %VEC(3)
+ subq $(VEC_SIZE * 4), %rcx
+ subq $(VEC_SIZE * 4), %rdx
+ VMOVA %VEC(0), (%r9)
+ VMOVA %VEC(1), -VEC_SIZE(%r9)
+ VMOVA %VEC(2), -(VEC_SIZE * 2)(%r9)
+ VMOVA %VEC(3), -(VEC_SIZE * 3)(%r9)
+ subq $(VEC_SIZE * 4), %r9
+ cmpq $(VEC_SIZE * 4), %rdx
+ ja L(loop_4x_vec_backward)
+ /* Store the first 4 * VEC. */
+ VMOVU %VEC(4), (%rdi)
+ VMOVU %VEC(5), VEC_SIZE(%rdi)
+ VMOVU %VEC(6), (VEC_SIZE * 2)(%rdi)
+ VMOVU %VEC(7), (VEC_SIZE * 3)(%rdi)
+ /* Store the last VEC. */
+ VMOVU %VEC(8), (%r11)
+ VZEROUPPER
+ ret
+
+#if (defined USE_MULTIARCH || VEC_SIZE == 16) && IS_IN (libc)
+L(large_forward):
+ /* Don't use non-temporal store if there is overlap between
+ destination and source since destination may be in cache
+ when source is loaded. */
+ leaq (%rdi, %rdx), %r10
+ cmpq %r10, %rsi
+ jb L(loop_4x_vec_forward)
+L(loop_large_forward):
+ /* Copy 4 * VEC a time forward with non-temporal stores. */
+ PREFETCH_ONE_SET (1, (%rsi), PREFETCHED_LOAD_SIZE * 2)
+ PREFETCH_ONE_SET (1, (%rsi), PREFETCHED_LOAD_SIZE * 3)
+ VMOVU (%rsi), %VEC(0)
+ VMOVU VEC_SIZE(%rsi), %VEC(1)
+ VMOVU (VEC_SIZE * 2)(%rsi), %VEC(2)
+ VMOVU (VEC_SIZE * 3)(%rsi), %VEC(3)
+ addq $PREFETCHED_LOAD_SIZE, %rsi
+ subq $PREFETCHED_LOAD_SIZE, %rdx
+ VMOVNT %VEC(0), (%rdi)
+ VMOVNT %VEC(1), VEC_SIZE(%rdi)
+ VMOVNT %VEC(2), (VEC_SIZE * 2)(%rdi)
+ VMOVNT %VEC(3), (VEC_SIZE * 3)(%rdi)
+ addq $PREFETCHED_LOAD_SIZE, %rdi
+ cmpq $PREFETCHED_LOAD_SIZE, %rdx
+ ja L(loop_large_forward)
+ sfence
+ /* Store the last 4 * VEC. */
+ VMOVU %VEC(5), (%rcx)
+ VMOVU %VEC(6), -VEC_SIZE(%rcx)
+ VMOVU %VEC(7), -(VEC_SIZE * 2)(%rcx)
+ VMOVU %VEC(8), -(VEC_SIZE * 3)(%rcx)
+ /* Store the first VEC. */
+ VMOVU %VEC(4), (%r11)
+ VZEROUPPER
+ ret
+
+L(large_backward):
+ /* Don't use non-temporal store if there is overlap between
+ destination and source since destination may be in cache
+ when source is loaded. */
+ leaq (%rcx, %rdx), %r10
+ cmpq %r10, %r9
+ jb L(loop_4x_vec_backward)
+L(loop_large_backward):
+ /* Copy 4 * VEC a time backward with non-temporal stores. */
+ PREFETCH_ONE_SET (-1, (%rcx), -PREFETCHED_LOAD_SIZE * 2)
+ PREFETCH_ONE_SET (-1, (%rcx), -PREFETCHED_LOAD_SIZE * 3)
+ VMOVU (%rcx), %VEC(0)
+ VMOVU -VEC_SIZE(%rcx), %VEC(1)
+ VMOVU -(VEC_SIZE * 2)(%rcx), %VEC(2)
+ VMOVU -(VEC_SIZE * 3)(%rcx), %VEC(3)
+ subq $PREFETCHED_LOAD_SIZE, %rcx
+ subq $PREFETCHED_LOAD_SIZE, %rdx
+ VMOVNT %VEC(0), (%r9)
+ VMOVNT %VEC(1), -VEC_SIZE(%r9)
+ VMOVNT %VEC(2), -(VEC_SIZE * 2)(%r9)
+ VMOVNT %VEC(3), -(VEC_SIZE * 3)(%r9)
+ subq $PREFETCHED_LOAD_SIZE, %r9
+ cmpq $PREFETCHED_LOAD_SIZE, %rdx
+ ja L(loop_large_backward)
+ sfence
+ /* Store the first 4 * VEC. */
+ VMOVU %VEC(4), (%rdi)
+ VMOVU %VEC(5), VEC_SIZE(%rdi)
+ VMOVU %VEC(6), (VEC_SIZE * 2)(%rdi)
+ VMOVU %VEC(7), (VEC_SIZE * 3)(%rdi)
+ /* Store the last VEC. */
+ VMOVU %VEC(8), (%r11)
+ VZEROUPPER
+ ret
+#endif
+END (MEMMOVE_SYMBOL (__memmove, unaligned_erms))
+
+#if IS_IN (libc)
+# ifdef USE_MULTIARCH
+strong_alias (MEMMOVE_SYMBOL (__memmove, unaligned_erms),
+ MEMMOVE_SYMBOL (__memcpy, unaligned_erms))
+# ifdef SHARED
+strong_alias (MEMMOVE_SYMBOL (__memmove_chk, unaligned_erms),
+ MEMMOVE_SYMBOL (__memcpy_chk, unaligned_erms))
+# endif
+# endif
+# ifdef SHARED
+strong_alias (MEMMOVE_CHK_SYMBOL (__memmove_chk, unaligned),
+ MEMMOVE_CHK_SYMBOL (__memcpy_chk, unaligned))
+# endif
+#endif
+strong_alias (MEMMOVE_SYMBOL (__memmove, unaligned),
+ MEMCPY_SYMBOL (__memcpy, unaligned))
diff --git a/sysdeps/x86_64/multiarch/memmove.c b/sysdeps/x86_64/multiarch/memmove.c
index 8da5640bb0..d512228eae 100644
--- a/sysdeps/x86_64/multiarch/memmove.c
+++ b/sysdeps/x86_64/multiarch/memmove.c
@@ -1,6 +1,6 @@
-/* Multiple versions of memmove.
+/* Multiple versions of memmmove.
All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2016-2018 Free Software 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,57 +17,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* Define multiple versions only for the definition in libc. */
#if IS_IN (libc)
-# define MEMMOVE __memmove_sse2
-# ifdef SHARED
-# undef libc_hidden_builtin_def
-# define libc_hidden_builtin_def(name) \
- __hidden_ver1 (__memmove_sse2, __GI_memmove, __memmove_sse2);
-# endif
-
-/* Redefine memmove so that the compiler won't complain about the type
- mismatch with the IFUNC selector in strong_alias, below. */
-# undef memmove
# define memmove __redirect_memmove
# include <string.h>
# undef memmove
-extern __typeof (__redirect_memmove) __memmove_sse2 attribute_hidden;
-extern __typeof (__redirect_memmove) __memmove_ssse3 attribute_hidden;
-extern __typeof (__redirect_memmove) __memmove_ssse3_back attribute_hidden;
-extern __typeof (__redirect_memmove) __memmove_avx_unaligned attribute_hidden;
-# ifdef HAVE_AVX512_ASM_SUPPORT
- extern __typeof (__redirect_memmove) __memmove_avx512_no_vzeroupper attribute_hidden;
-# endif
-
-#endif
+# define SYMBOL_NAME memmove
+# include "ifunc-memmove.h"
-#include "string/memmove.c"
+libc_ifunc_redirected (__redirect_memmove, __libc_memmove,
+ IFUNC_SELECTOR ());
-#if IS_IN (libc)
-# include <shlib-compat.h>
-# include "init-arch.h"
-
-/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
- ifunc symbol properly. */
-extern __typeof (__redirect_memmove) __libc_memmove;
-libc_ifunc (__libc_memmove,
-#ifdef HAVE_AVX512_ASM_SUPPORT
- HAS_ARCH_FEATURE (AVX512F_Usable)
- && HAS_ARCH_FEATURE (Prefer_No_VZEROUPPER)
- ? __memmove_avx512_no_vzeroupper
- :
-#endif
- (HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load)
- ? __memmove_avx_unaligned
- : (HAS_CPU_FEATURE (SSSE3)
- ? (HAS_ARCH_FEATURE (Fast_Copy_Backward)
- ? __memmove_ssse3_back : __memmove_ssse3)
- : __memmove_sse2)));
-
-strong_alias (__libc_memmove, memmove)
-
-# if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
-compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
+strong_alias (__libc_memmove, memmove);
+# ifdef SHARED
+__hidden_ver1 (__libc_memmove, __GI_memmove, __redirect_memmove)
+ __attribute__ ((visibility ("hidden")));
# endif
#endif
diff --git a/sysdeps/x86_64/multiarch/memmove_chk-nonshared.S b/sysdeps/x86_64/multiarch/memmove_chk-nonshared.S
new file mode 100644
index 0000000000..c362a3324d
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memmove_chk-nonshared.S
@@ -0,0 +1,21 @@
+/* Non-shared version of memmove_chk for x86-64.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/x86_64/memmove_chk.S>
+#endif
diff --git a/sysdeps/x86_64/multiarch/memmove_chk.c b/sysdeps/x86_64/multiarch/memmove_chk.c
index f64da63180..0e9dc7e07f 100644
--- a/sysdeps/x86_64/multiarch/memmove_chk.c
+++ b/sysdeps/x86_64/multiarch/memmove_chk.c
@@ -1,6 +1,6 @@
-/* Multiple versions of __memmove_chk.
+/* Multiple versions of __memmove_chk
All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2017-2018 Free Software 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,30 +17,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <string.h>
-#include "init-arch.h"
+/* Define multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __memmove_chk __redirect_memmove_chk
+# include <string.h>
+# undef __memmove_chk
-#define MEMMOVE_CHK __memmove_chk_sse2
+# define SYMBOL_NAME memmove_chk
+# include "ifunc-memmove.h"
-extern __typeof (__memmove_chk) __memmove_chk_sse2 attribute_hidden;
-extern __typeof (__memmove_chk) __memmove_chk_ssse3 attribute_hidden;
-extern __typeof (__memmove_chk) __memmove_chk_ssse3_back attribute_hidden;
-extern __typeof (__memmove_chk) __memmove_chk_avx_unaligned attribute_hidden;
-# ifdef HAVE_AVX512_ASM_SUPPORT
- extern __typeof (__memmove_chk) __memmove_chk_avx512_no_vzeroupper attribute_hidden;
-# endif
-
-#include "debug/memmove_chk.c"
-
-libc_ifunc (__memmove_chk,
-#ifdef HAVE_AVX512_ASM_SUPPORT
- HAS_ARCH_FEATURE (AVX512F_Usable)
- && HAS_ARCH_FEATURE (Prefer_No_VZEROUPPER)
- ? __memmove_chk_avx512_no_vzeroupper
- :
+libc_ifunc_redirected (__redirect_memmove_chk, __memmove_chk,
+ IFUNC_SELECTOR ());
#endif
- HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load) ? __memmove_chk_avx_unaligned :
- (HAS_CPU_FEATURE (SSSE3)
- ? (HAS_ARCH_FEATURE (Fast_Copy_Backward)
- ? __memmove_chk_ssse3_back : __memmove_chk_ssse3)
- : __memmove_chk_sse2));
diff --git a/sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S b/sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S
deleted file mode 100644
index 241378e770..0000000000
--- a/sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* mempcpy with AVX
- Copyright (C) 2014-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 USE_AS_MEMPCPY
-#define MEMCPY __mempcpy_avx_unaligned
-#define MEMCPY_CHK __mempcpy_chk_avx_unaligned
-#include "memcpy-avx-unaligned.S"
diff --git a/sysdeps/x86_64/multiarch/mempcpy-avx512-no-vzeroupper.S b/sysdeps/x86_64/multiarch/mempcpy-avx512-no-vzeroupper.S
deleted file mode 100644
index fcc0945ea7..0000000000
--- a/sysdeps/x86_64/multiarch/mempcpy-avx512-no-vzeroupper.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* mempcpy optimized with AVX512 for KNL hardware.
- 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 USE_AS_MEMPCPY
-#define MEMCPY __mempcpy_avx512_no_vzeroupper
-#define MEMCPY_CHK __mempcpy_chk_avx512_no_vzeroupper
-#include "memcpy-avx512-no-vzeroupper.S"
diff --git a/sysdeps/x86_64/multiarch/mempcpy-ssse3-back.S b/sysdeps/x86_64/multiarch/mempcpy-ssse3-back.S
deleted file mode 100644
index 82ffacb8fb..0000000000
--- a/sysdeps/x86_64/multiarch/mempcpy-ssse3-back.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#define USE_AS_MEMPCPY
-#define MEMCPY __mempcpy_ssse3_back
-#define MEMCPY_CHK __mempcpy_chk_ssse3_back
-#include "memcpy-ssse3-back.S"
diff --git a/sysdeps/x86_64/multiarch/mempcpy-ssse3.S b/sysdeps/x86_64/multiarch/mempcpy-ssse3.S
deleted file mode 100644
index 822d98e954..0000000000
--- a/sysdeps/x86_64/multiarch/mempcpy-ssse3.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#define USE_AS_MEMPCPY
-#define MEMCPY __mempcpy_ssse3
-#define MEMCPY_CHK __mempcpy_chk_ssse3
-#include "memcpy-ssse3.S"
diff --git a/sysdeps/x86_64/multiarch/mempcpy.S b/sysdeps/x86_64/multiarch/mempcpy.S
deleted file mode 100644
index ed78623565..0000000000
--- a/sysdeps/x86_64/multiarch/mempcpy.S
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Multiple versions of mempcpy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
- DSO. In static binaries we need mempcpy before the initialization
- happened. */
-#if defined SHARED && IS_IN (libc)
-ENTRY(__mempcpy)
- .type __mempcpy, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
-#ifdef HAVE_AVX512_ASM_SUPPORT
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jz 1f
- HAS_ARCH_FEATURE (Prefer_No_VZEROUPPER)
- jz 1f
- leaq __mempcpy_avx512_no_vzeroupper(%rip), %rax
- ret
-#endif
-1: leaq __mempcpy_sse2(%rip), %rax
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- leaq __mempcpy_ssse3(%rip), %rax
- HAS_ARCH_FEATURE (Fast_Copy_Backward)
- jz 2f
- leaq __mempcpy_ssse3_back(%rip), %rax
- HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load)
- jz 2f
- leaq __mempcpy_avx_unaligned(%rip), %rax
-2: ret
-END(__mempcpy)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __mempcpy_sse2, @function; \
- .p2align 4; \
- .globl __mempcpy_sse2; \
- .hidden __mempcpy_sse2; \
- __mempcpy_sse2: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __mempcpy_sse2, .-__mempcpy_sse2
-
-# undef ENTRY_CHK
-# define ENTRY_CHK(name) \
- .type __mempcpy_chk_sse2, @function; \
- .globl __mempcpy_chk_sse2; \
- .p2align 4; \
- __mempcpy_chk_sse2: cfi_startproc; \
- CALL_MCOUNT
-# undef END_CHK
-# define END_CHK(name) \
- cfi_endproc; .size __mempcpy_chk_sse2, .-__mempcpy_chk_sse2
-
-# undef libc_hidden_def
-# undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal mempcpy calls through a PLT.
- The speedup we get from using SSSE3 instruction is likely eaten away
- by the indirect call in the PLT. */
-# define libc_hidden_def(name) \
- .globl __GI_mempcpy; __GI_mempcpy = __mempcpy_sse2
-# define libc_hidden_builtin_def(name) \
- .globl __GI___mempcpy; __GI___mempcpy = __mempcpy_sse2
-#endif
-
-#include "../mempcpy.S"
diff --git a/sysdeps/x86_64/multiarch/mempcpy.c b/sysdeps/x86_64/multiarch/mempcpy.c
new file mode 100644
index 0000000000..9fe41dda82
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/mempcpy.c
@@ -0,0 +1,42 @@
+/* Multiple versions of mempcpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
+# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
+# include <string.h>
+# undef mempcpy
+# undef __mempcpy
+
+# define SYMBOL_NAME mempcpy
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_mempcpy, __mempcpy, IFUNC_SELECTOR ());
+
+weak_alias (__mempcpy, mempcpy)
+# ifdef SHARED
+__hidden_ver1 (__mempcpy, __GI___mempcpy, __redirect___mempcpy)
+ __attribute__ ((visibility ("hidden")));
+__hidden_ver1 (mempcpy, __GI_mempcpy, __redirect_mempcpy)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/mempcpy_chk-nonshared.S b/sysdeps/x86_64/multiarch/mempcpy_chk-nonshared.S
new file mode 100644
index 0000000000..7133246a1d
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/mempcpy_chk-nonshared.S
@@ -0,0 +1,21 @@
+/* Non-shared version of mempcpy_chk for x86-64.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/x86_64/mempcpy_chk.S>
+#endif
diff --git a/sysdeps/x86_64/multiarch/mempcpy_chk.S b/sysdeps/x86_64/multiarch/mempcpy_chk.S
deleted file mode 100644
index 6e8a89d38c..0000000000
--- a/sysdeps/x86_64/multiarch/mempcpy_chk.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Multiple versions of __mempcpy_chk
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
- DSO. There are no multiarch mempcpy functions for static binaries.
- */
-#if IS_IN (libc)
-# ifdef SHARED
- .text
-ENTRY(__mempcpy_chk)
- .type __mempcpy_chk, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
-#ifdef HAVE_AVX512_ASM_SUPPORT
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jz 1f
- HAS_ARCH_FEATURE (Prefer_No_VZEROUPPER)
- jz 1f
- leaq __mempcpy_chk_avx512_no_vzeroupper(%rip), %rax
- ret
-#endif
-1: leaq __mempcpy_chk_sse2(%rip), %rax
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- leaq __mempcpy_chk_ssse3(%rip), %rax
- HAS_ARCH_FEATURE (Fast_Copy_Backward)
- jz 2f
- leaq __mempcpy_chk_ssse3_back(%rip), %rax
- HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load)
- jz 2f
- leaq __mempcpy_chk_avx_unaligned(%rip), %rax
-2: ret
-END(__mempcpy_chk)
-# else
-# include "../mempcpy_chk.S"
-# endif
-#endif
diff --git a/sysdeps/x86_64/multiarch/mempcpy_chk.c b/sysdeps/x86_64/multiarch/mempcpy_chk.c
new file mode 100644
index 0000000000..956918b3a1
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/mempcpy_chk.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __mempcpy_chk
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __mempcpy_chk __redirect_mempcpy_chk
+# include <string.h>
+# undef __mempcpy_chk
+
+# define SYMBOL_NAME mempcpy_chk
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_mempcpy_chk, __mempcpy_chk,
+ IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/x86_64/multiarch/memrchr-avx2.S b/sysdeps/x86_64/multiarch/memrchr-avx2.S
new file mode 100644
index 0000000000..b41a58bcba
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memrchr-avx2.S
@@ -0,0 +1,359 @@
+/* memrchr optimized with AVX2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+
+# ifndef VZEROUPPER
+# define VZEROUPPER vzeroupper
+# endif
+
+# define VEC_SIZE 32
+
+ .section .text.avx,"ax",@progbits
+ENTRY (__memrchr_avx2)
+ /* Broadcast CHAR to YMM0. */
+ vmovd %esi, %xmm0
+ vpbroadcastb %xmm0, %ymm0
+
+ subq $VEC_SIZE, %rdx
+ jbe L(last_vec_or_less)
+
+ addq %rdx, %rdi
+
+ /* Check the last VEC_SIZE bytes. */
+ vpcmpeqb (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x0)
+
+ subq $(VEC_SIZE * 4), %rdi
+ movl %edi, %ecx
+ andl $(VEC_SIZE - 1), %ecx
+ jz L(aligned_more)
+
+ /* Align data for aligned loads in the loop. */
+ addq $VEC_SIZE, %rdi
+ addq $VEC_SIZE, %rdx
+ andq $-VEC_SIZE, %rdi
+ subq %rcx, %rdx
+
+ .p2align 4
+L(aligned_more):
+ subq $(VEC_SIZE * 4), %rdx
+ jbe L(last_4x_vec_or_less)
+
+ /* Check the last 4 * VEC_SIZE. Only one VEC_SIZE at a time
+ since data is only aligned to VEC_SIZE. */
+ vpcmpeqb (VEC_SIZE * 3)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x3)
+
+ vpcmpeqb (VEC_SIZE * 2)(%rdi), %ymm0, %ymm2
+ vpmovmskb %ymm2, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x2)
+
+ vpcmpeqb VEC_SIZE(%rdi), %ymm0, %ymm3
+ vpmovmskb %ymm3, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x1)
+
+ vpcmpeqb (%rdi), %ymm0, %ymm4
+ vpmovmskb %ymm4, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x0)
+
+ /* Align data to 4 * VEC_SIZE for loop with fewer branches.
+ There are some overlaps with above if data isn't aligned
+ to 4 * VEC_SIZE. */
+ movl %edi, %ecx
+ andl $(VEC_SIZE * 4 - 1), %ecx
+ jz L(loop_4x_vec)
+
+ addq $(VEC_SIZE * 4), %rdi
+ addq $(VEC_SIZE * 4), %rdx
+ andq $-(VEC_SIZE * 4), %rdi
+ subq %rcx, %rdx
+
+ .p2align 4
+L(loop_4x_vec):
+ /* Compare 4 * VEC at a time forward. */
+ subq $(VEC_SIZE * 4), %rdi
+ subq $(VEC_SIZE * 4), %rdx
+ jbe L(last_4x_vec_or_less)
+
+ vmovdqa (%rdi), %ymm1
+ vmovdqa VEC_SIZE(%rdi), %ymm2
+ vmovdqa (VEC_SIZE * 2)(%rdi), %ymm3
+ vmovdqa (VEC_SIZE * 3)(%rdi), %ymm4
+
+ vpcmpeqb %ymm1, %ymm0, %ymm1
+ vpcmpeqb %ymm2, %ymm0, %ymm2
+ vpcmpeqb %ymm3, %ymm0, %ymm3
+ vpcmpeqb %ymm4, %ymm0, %ymm4
+
+ vpor %ymm1, %ymm2, %ymm5
+ vpor %ymm3, %ymm4, %ymm6
+ vpor %ymm5, %ymm6, %ymm5
+
+ vpmovmskb %ymm5, %eax
+ testl %eax, %eax
+ jz L(loop_4x_vec)
+
+ /* There is a match. */
+ vpmovmskb %ymm4, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x3)
+
+ vpmovmskb %ymm3, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x2)
+
+ vpmovmskb %ymm2, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x1)
+
+ vpmovmskb %ymm1, %eax
+ bsrl %eax, %eax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_4x_vec_or_less):
+ addl $(VEC_SIZE * 4), %edx
+ cmpl $(VEC_SIZE * 2), %edx
+ jbe L(last_2x_vec)
+
+ vpcmpeqb (VEC_SIZE * 3)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x3)
+
+ vpcmpeqb (VEC_SIZE * 2)(%rdi), %ymm0, %ymm2
+ vpmovmskb %ymm2, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x2)
+
+ vpcmpeqb VEC_SIZE(%rdi), %ymm0, %ymm3
+ vpmovmskb %ymm3, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x1_check)
+ cmpl $(VEC_SIZE * 3), %edx
+ jbe L(zero)
+
+ vpcmpeqb (%rdi), %ymm0, %ymm4
+ vpmovmskb %ymm4, %eax
+ testl %eax, %eax
+ jz L(zero)
+ bsrl %eax, %eax
+ subq $(VEC_SIZE * 4), %rdx
+ addq %rax, %rdx
+ jl L(zero)
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_2x_vec):
+ vpcmpeqb (VEC_SIZE * 3)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(last_vec_x3_check)
+ cmpl $VEC_SIZE, %edx
+ jbe L(zero)
+
+ vpcmpeqb (VEC_SIZE * 2)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jz L(zero)
+ bsrl %eax, %eax
+ subq $(VEC_SIZE * 2), %rdx
+ addq %rax, %rdx
+ jl L(zero)
+ addl $(VEC_SIZE * 2), %eax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_vec_x0):
+ bsrl %eax, %eax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_vec_x1):
+ bsrl %eax, %eax
+ addl $VEC_SIZE, %eax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_vec_x2):
+ bsrl %eax, %eax
+ addl $(VEC_SIZE * 2), %eax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_vec_x3):
+ bsrl %eax, %eax
+ addl $(VEC_SIZE * 3), %eax
+ addq %rdi, %rax
+ ret
+
+ .p2align 4
+L(last_vec_x1_check):
+ bsrl %eax, %eax
+ subq $(VEC_SIZE * 3), %rdx
+ addq %rax, %rdx
+ jl L(zero)
+ addl $VEC_SIZE, %eax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_vec_x3_check):
+ bsrl %eax, %eax
+ subq $VEC_SIZE, %rdx
+ addq %rax, %rdx
+ jl L(zero)
+ addl $(VEC_SIZE * 3), %eax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(zero):
+ VZEROUPPER
+L(null):
+ xorl %eax, %eax
+ ret
+
+ .p2align 4
+L(last_vec_or_less_aligned):
+ movl %edx, %ecx
+
+ vpcmpeqb (%rdi), %ymm0, %ymm1
+
+ movl $1, %edx
+ /* Support rdx << 32. */
+ salq %cl, %rdx
+ subq $1, %rdx
+
+ vpmovmskb %ymm1, %eax
+
+ /* Remove the trailing bytes. */
+ andl %edx, %eax
+ testl %eax, %eax
+ jz L(zero)
+
+ bsrl %eax, %eax
+ addq %rdi, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_vec_or_less):
+ addl $VEC_SIZE, %edx
+
+ /* Check for zero length. */
+ testl %edx, %edx
+ jz L(null)
+
+ movl %edi, %ecx
+ andl $(VEC_SIZE - 1), %ecx
+ jz L(last_vec_or_less_aligned)
+
+ movl %ecx, %esi
+ movl %ecx, %r8d
+ addl %edx, %esi
+ andq $-VEC_SIZE, %rdi
+
+ subl $VEC_SIZE, %esi
+ ja L(last_vec_2x_aligned)
+
+ /* Check the last VEC. */
+ vpcmpeqb (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+
+ /* Remove the leading and trailing bytes. */
+ sarl %cl, %eax
+ movl %edx, %ecx
+
+ movl $1, %edx
+ sall %cl, %edx
+ subl $1, %edx
+
+ andl %edx, %eax
+ testl %eax, %eax
+ jz L(zero)
+
+ bsrl %eax, %eax
+ addq %rdi, %rax
+ addq %r8, %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_vec_2x_aligned):
+ movl %esi, %ecx
+
+ /* Check the last VEC. */
+ vpcmpeqb VEC_SIZE(%rdi), %ymm0, %ymm1
+
+ movl $1, %edx
+ sall %cl, %edx
+ subl $1, %edx
+
+ vpmovmskb %ymm1, %eax
+
+ /* Remove the trailing bytes. */
+ andl %edx, %eax
+
+ testl %eax, %eax
+ jnz L(last_vec_x1)
+
+ /* Check the second last VEC. */
+ vpcmpeqb (%rdi), %ymm0, %ymm1
+
+ movl %r8d, %ecx
+
+ vpmovmskb %ymm1, %eax
+
+ /* Remove the leading bytes. Must use unsigned right shift for
+ bsrl below. */
+ shrl %cl, %eax
+ testl %eax, %eax
+ jz L(zero)
+
+ bsrl %eax, %eax
+ addq %rdi, %rax
+ addq %r8, %rax
+ VZEROUPPER
+ ret
+END (__memrchr_avx2)
+#endif
diff --git a/sysdeps/x86_64/multiarch/memrchr-sse2.S b/sysdeps/x86_64/multiarch/memrchr-sse2.S
new file mode 100644
index 0000000000..12281663ec
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memrchr-sse2.S
@@ -0,0 +1,26 @@
+/* memrchr optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define __memrchr __memrchr_sse2
+
+# undef weak_alias
+# define weak_alias(__memrchr, memrchr)
+#endif
+
+#include "../memrchr.S"
diff --git a/sysdeps/x86_64/multiarch/memrchr.c b/sysdeps/x86_64/multiarch/memrchr.c
new file mode 100644
index 0000000000..d227fe7819
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memrchr.c
@@ -0,0 +1,31 @@
+/* Multiple versions of memrchr
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define memrchr __redirect_memrchr
+# include <string.h>
+# undef memrchr
+
+# define SYMBOL_NAME memrchr
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_memrchr, __memrchr, IFUNC_SELECTOR ());
+weak_alias (__memrchr, memrchr)
+#endif
diff --git a/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms.S
new file mode 100644
index 0000000000..7ab3d89849
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memset-avx2-unaligned-erms.S
@@ -0,0 +1,22 @@
+#if IS_IN (libc)
+# define VEC_SIZE 32
+# define VEC(i) ymm##i
+# define VMOVU vmovdqu
+# define VMOVA vmovdqa
+
+# define MEMSET_VDUP_TO_VEC0_AND_SET_RETURN(d, r) \
+ vmovd d, %xmm0; \
+ movq r, %rax; \
+ vpbroadcastb %xmm0, %ymm0
+
+# define WMEMSET_VDUP_TO_VEC0_AND_SET_RETURN(d, r) \
+ vmovd d, %xmm0; \
+ movq r, %rax; \
+ vpbroadcastd %xmm0, %ymm0
+
+# define SECTION(p) p##.avx
+# define MEMSET_SYMBOL(p,s) p##_avx2_##s
+# define WMEMSET_SYMBOL(p,s) p##_avx2_##s
+
+# include "memset-vec-unaligned-erms.S"
+#endif
diff --git a/sysdeps/x86_64/multiarch/memset-avx2.S b/sysdeps/x86_64/multiarch/memset-avx2.S
deleted file mode 100644
index df634728d4..0000000000
--- a/sysdeps/x86_64/multiarch/memset-avx2.S
+++ /dev/null
@@ -1,168 +0,0 @@
-/* memset with AVX2
- Copyright (C) 2014-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>
-
-#if IS_IN (libc)
-
-#include "asm-syntax.h"
-#ifndef MEMSET
-# define MEMSET __memset_avx2
-# define MEMSET_CHK __memset_chk_avx2
-#endif
-
- .section .text.avx2,"ax",@progbits
-#if defined PIC
-ENTRY (MEMSET_CHK)
- cmpq %rdx, %rcx
- jb HIDDEN_JUMPTARGET (__chk_fail)
-END (MEMSET_CHK)
-#endif
-
-ENTRY (MEMSET)
- vpxor %xmm0, %xmm0, %xmm0
- vmovd %esi, %xmm1
- lea (%rdi, %rdx), %rsi
- mov %rdi, %rax
- vpshufb %xmm0, %xmm1, %xmm0
- cmp $16, %rdx
- jb L(less_16bytes)
- cmp $256, %rdx
- jae L(256bytesormore)
- cmp $128, %dl
- jb L(less_128bytes)
- vmovdqu %xmm0, (%rdi)
- vmovdqu %xmm0, 0x10(%rdi)
- vmovdqu %xmm0, 0x20(%rdi)
- vmovdqu %xmm0, 0x30(%rdi)
- vmovdqu %xmm0, 0x40(%rdi)
- vmovdqu %xmm0, 0x50(%rdi)
- vmovdqu %xmm0, 0x60(%rdi)
- vmovdqu %xmm0, 0x70(%rdi)
- vmovdqu %xmm0, -0x80(%rsi)
- vmovdqu %xmm0, -0x70(%rsi)
- vmovdqu %xmm0, -0x60(%rsi)
- vmovdqu %xmm0, -0x50(%rsi)
- vmovdqu %xmm0, -0x40(%rsi)
- vmovdqu %xmm0, -0x30(%rsi)
- vmovdqu %xmm0, -0x20(%rsi)
- vmovdqu %xmm0, -0x10(%rsi)
- ret
-
- .p2align 4
-L(less_128bytes):
- cmp $64, %dl
- jb L(less_64bytes)
- vmovdqu %xmm0, (%rdi)
- vmovdqu %xmm0, 0x10(%rdi)
- vmovdqu %xmm0, 0x20(%rdi)
- vmovdqu %xmm0, 0x30(%rdi)
- vmovdqu %xmm0, -0x40(%rsi)
- vmovdqu %xmm0, -0x30(%rsi)
- vmovdqu %xmm0, -0x20(%rsi)
- vmovdqu %xmm0, -0x10(%rsi)
- ret
-
- .p2align 4
-L(less_64bytes):
- cmp $32, %dl
- jb L(less_32bytes)
- vmovdqu %xmm0, (%rdi)
- vmovdqu %xmm0, 0x10(%rdi)
- vmovdqu %xmm0, -0x20(%rsi)
- vmovdqu %xmm0, -0x10(%rsi)
- ret
-
- .p2align 4
-L(less_32bytes):
- vmovdqu %xmm0, (%rdi)
- vmovdqu %xmm0, -0x10(%rsi)
- ret
-
- .p2align 4
-L(less_16bytes):
- cmp $8, %dl
- jb L(less_8bytes)
- vmovq %xmm0, (%rdi)
- vmovq %xmm0, -0x08(%rsi)
- ret
-
- .p2align 4
-L(less_8bytes):
- vmovd %xmm0, %ecx
- cmp $4, %dl
- jb L(less_4bytes)
- mov %ecx, (%rdi)
- mov %ecx, -0x04(%rsi)
- ret
-
- .p2align 4
-L(less_4bytes):
- cmp $2, %dl
- jb L(less_2bytes)
- mov %cx, (%rdi)
- mov %cx, -0x02(%rsi)
- ret
-
- .p2align 4
-L(less_2bytes):
- cmp $1, %dl
- jb L(less_1bytes)
- mov %cl, (%rdi)
-L(less_1bytes):
- ret
-
- .p2align 4
-L(256bytesormore):
- vinserti128 $1, %xmm0, %ymm0, %ymm0
- and $-0x20, %rdi
- add $0x20, %rdi
- vmovdqu %ymm0, (%rax)
- sub %rdi, %rax
- lea -0x80(%rax, %rdx), %rcx
- cmp $4096, %rcx
- ja L(gobble_data)
-L(gobble_128_loop):
- vmovdqa %ymm0, (%rdi)
- vmovdqa %ymm0, 0x20(%rdi)
- vmovdqa %ymm0, 0x40(%rdi)
- vmovdqa %ymm0, 0x60(%rdi)
- sub $-0x80, %rdi
- add $-0x80, %ecx
- jb L(gobble_128_loop)
- mov %rsi, %rax
- vmovdqu %ymm0, -0x80(%rsi)
- vmovdqu %ymm0, -0x60(%rsi)
- vmovdqu %ymm0, -0x40(%rsi)
- vmovdqu %ymm0, -0x20(%rsi)
- sub %rdx, %rax
- vzeroupper
- ret
-
- .p2align 4
-L(gobble_data):
- sub $-0x80, %rcx
- vmovd %xmm0, %eax
- rep stosb
- mov %rsi, %rax
- sub %rdx, %rax
- vzeroupper
- ret
-
-END (MEMSET)
-#endif
diff --git a/sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S b/sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S
index 1e638d7ac2..689cc1199c 100644
--- a/sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S
+++ b/sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S
@@ -1,5 +1,5 @@
/* memset optimized with AVX512 for KNL hardware.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <sysdep.h>
-#if defined HAVE_AVX512_ASM_SUPPORT && IS_IN (libc)
+#if IS_IN (libc)
#include "asm-syntax.h"
#ifndef MEMSET
@@ -26,7 +26,7 @@
# define MEMSET_CHK __memset_chk_avx512_no_vzeroupper
#endif
- .section .text,"ax",@progbits
+ .section .text.avx512,"ax",@progbits
#if defined PIC
ENTRY (MEMSET_CHK)
cmpq %rdx, %rcx
diff --git a/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S
new file mode 100644
index 0000000000..0783979ca5
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S
@@ -0,0 +1,24 @@
+#if IS_IN (libc)
+# define VEC_SIZE 64
+# define VEC(i) zmm##i
+# define VMOVU vmovdqu64
+# define VMOVA vmovdqa64
+
+# define MEMSET_VDUP_TO_VEC0_AND_SET_RETURN(d, r) \
+ vmovd d, %xmm0; \
+ movq r, %rax; \
+ vpbroadcastb %xmm0, %xmm0; \
+ vpbroadcastq %xmm0, %zmm0
+
+# define WMEMSET_VDUP_TO_VEC0_AND_SET_RETURN(d, r) \
+ vmovd d, %xmm0; \
+ movq r, %rax; \
+ vpbroadcastd %xmm0, %xmm0; \
+ vpbroadcastq %xmm0, %zmm0
+
+# define SECTION(p) p##.avx512
+# define MEMSET_SYMBOL(p,s) p##_avx512_##s
+# define WMEMSET_SYMBOL(p,s) p##_avx512_##s
+
+# include "memset-vec-unaligned-erms.S"
+#endif
diff --git a/sysdeps/x86_64/multiarch/memset-sse2-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-sse2-unaligned-erms.S
new file mode 100644
index 0000000000..be6671759b
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memset-sse2-unaligned-erms.S
@@ -0,0 +1,41 @@
+/* memset with SSE2.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2014-2018 Free Software 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>
+#include <shlib-compat.h>
+#include <init-arch.h>
+
+#if IS_IN (libc)
+# define MEMSET_SYMBOL(p,s) p##_sse2_##s
+# define WMEMSET_SYMBOL(p,s) p##_sse2_##s
+
+# ifdef SHARED
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# endif
+
+# undef weak_alias
+# define weak_alias(original, alias) \
+ .weak bzero; bzero = __bzero
+
+# undef strong_alias
+# define strong_alias(ignored1, ignored2)
+#endif
+
+#include <sysdeps/x86_64/memset.S>
diff --git a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S
new file mode 100644
index 0000000000..dc9cb88b37
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S
@@ -0,0 +1,274 @@
+/* memset/bzero with unaligned store and rep stosb
+ Copyright (C) 2016-2018 Free Software 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/>. */
+
+/* memset is implemented as:
+ 1. Use overlapping store to avoid branch.
+ 2. If size is less than VEC, use integer register stores.
+ 3. If size is from VEC_SIZE to 2 * VEC_SIZE, use 2 VEC stores.
+ 4. If size is from 2 * VEC_SIZE to 4 * VEC_SIZE, use 4 VEC stores.
+ 5. If size is more to 4 * VEC_SIZE, align to 4 * VEC_SIZE with
+ 4 VEC stores and store 4 * VEC at a time until done. */
+
+#include <sysdep.h>
+
+#ifndef MEMSET_CHK_SYMBOL
+# define MEMSET_CHK_SYMBOL(p,s) MEMSET_SYMBOL(p, s)
+#endif
+
+#ifndef WMEMSET_CHK_SYMBOL
+# define WMEMSET_CHK_SYMBOL(p,s) WMEMSET_SYMBOL(p, s)
+#endif
+
+#ifndef VZEROUPPER
+# if VEC_SIZE > 16
+# define VZEROUPPER vzeroupper
+# else
+# define VZEROUPPER
+# endif
+#endif
+
+#ifndef VZEROUPPER_SHORT_RETURN
+# if VEC_SIZE > 16
+# define VZEROUPPER_SHORT_RETURN vzeroupper
+# else
+# define VZEROUPPER_SHORT_RETURN rep
+# endif
+#endif
+
+#ifndef MOVQ
+# if VEC_SIZE > 16
+# define MOVQ vmovq
+# else
+# define MOVQ movq
+# endif
+#endif
+
+/* Threshold to use Enhanced REP STOSB. Since there is overhead to set
+ up REP STOSB operation, REP STOSB isn't faster on short data. The
+ memset micro benchmark in glibc shows that 2KB is the approximate
+ value above which REP STOSB becomes faster on processors with
+ Enhanced REP STOSB. Since the stored value is fixed, larger register
+ size has minimal impact on threshold. */
+#ifndef REP_STOSB_THRESHOLD
+# define REP_STOSB_THRESHOLD 2048
+#endif
+
+#ifndef SECTION
+# error SECTION is not defined!
+#endif
+
+ .section SECTION(.text),"ax",@progbits
+#if VEC_SIZE == 16 && IS_IN (libc)
+ENTRY (__bzero)
+ movq %rdi, %rax /* Set return value. */
+ movq %rsi, %rdx /* Set n. */
+ pxor %xmm0, %xmm0
+ jmp L(entry_from_bzero)
+END (__bzero)
+weak_alias (__bzero, bzero)
+#endif
+
+#if IS_IN (libc)
+# if defined SHARED
+ENTRY_CHK (WMEMSET_CHK_SYMBOL (__wmemset_chk, unaligned))
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END_CHK (WMEMSET_CHK_SYMBOL (__wmemset_chk, unaligned))
+# endif
+
+ENTRY (WMEMSET_SYMBOL (__wmemset, unaligned))
+ shlq $2, %rdx
+ WMEMSET_VDUP_TO_VEC0_AND_SET_RETURN (%esi, %rdi)
+ jmp L(entry_from_bzero)
+END (WMEMSET_SYMBOL (__wmemset, unaligned))
+#endif
+
+#if defined SHARED && IS_IN (libc)
+ENTRY_CHK (MEMSET_CHK_SYMBOL (__memset_chk, unaligned))
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END_CHK (MEMSET_CHK_SYMBOL (__memset_chk, unaligned))
+#endif
+
+ENTRY (MEMSET_SYMBOL (__memset, unaligned))
+ MEMSET_VDUP_TO_VEC0_AND_SET_RETURN (%esi, %rdi)
+L(entry_from_bzero):
+ cmpq $VEC_SIZE, %rdx
+ jb L(less_vec)
+ cmpq $(VEC_SIZE * 2), %rdx
+ ja L(more_2x_vec)
+ /* From VEC and to 2 * VEC. No branch when size == VEC_SIZE. */
+ VMOVU %VEC(0), -VEC_SIZE(%rdi,%rdx)
+ VMOVU %VEC(0), (%rdi)
+ VZEROUPPER
+ ret
+#if defined USE_MULTIARCH && IS_IN (libc)
+END (MEMSET_SYMBOL (__memset, unaligned))
+
+# if VEC_SIZE == 16
+ENTRY (__memset_chk_erms)
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (__memset_chk_erms)
+
+/* Only used to measure performance of REP STOSB. */
+ENTRY (__memset_erms)
+ /* Skip zero length. */
+ testq %rdx, %rdx
+ jnz L(stosb)
+ movq %rdi, %rax
+ ret
+# else
+/* Provide a hidden symbol to debugger. */
+ .hidden MEMSET_SYMBOL (__memset, erms)
+ENTRY (MEMSET_SYMBOL (__memset, erms))
+# endif
+L(stosb):
+ /* Issue vzeroupper before rep stosb. */
+ VZEROUPPER
+ movq %rdx, %rcx
+ movzbl %sil, %eax
+ movq %rdi, %rdx
+ rep stosb
+ movq %rdx, %rax
+ ret
+# if VEC_SIZE == 16
+END (__memset_erms)
+# else
+END (MEMSET_SYMBOL (__memset, erms))
+# endif
+
+# if defined SHARED && IS_IN (libc)
+ENTRY_CHK (MEMSET_CHK_SYMBOL (__memset_chk, unaligned_erms))
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END_CHK (MEMSET_CHK_SYMBOL (__memset_chk, unaligned_erms))
+# endif
+
+ENTRY (MEMSET_SYMBOL (__memset, unaligned_erms))
+ MEMSET_VDUP_TO_VEC0_AND_SET_RETURN (%esi, %rdi)
+ cmpq $VEC_SIZE, %rdx
+ jb L(less_vec)
+ cmpq $(VEC_SIZE * 2), %rdx
+ ja L(stosb_more_2x_vec)
+ /* From VEC and to 2 * VEC. No branch when size == VEC_SIZE. */
+ VMOVU %VEC(0), -VEC_SIZE(%rdi,%rdx)
+ VMOVU %VEC(0), (%rdi)
+ VZEROUPPER
+ ret
+
+L(stosb_more_2x_vec):
+ cmpq $REP_STOSB_THRESHOLD, %rdx
+ ja L(stosb)
+#endif
+L(more_2x_vec):
+ cmpq $(VEC_SIZE * 4), %rdx
+ ja L(loop_start)
+ VMOVU %VEC(0), (%rdi)
+ VMOVU %VEC(0), VEC_SIZE(%rdi)
+ VMOVU %VEC(0), -VEC_SIZE(%rdi,%rdx)
+ VMOVU %VEC(0), -(VEC_SIZE * 2)(%rdi,%rdx)
+L(return):
+ VZEROUPPER
+ ret
+
+L(loop_start):
+ leaq (VEC_SIZE * 4)(%rdi), %rcx
+ VMOVU %VEC(0), (%rdi)
+ andq $-(VEC_SIZE * 4), %rcx
+ VMOVU %VEC(0), -VEC_SIZE(%rdi,%rdx)
+ VMOVU %VEC(0), VEC_SIZE(%rdi)
+ VMOVU %VEC(0), -(VEC_SIZE * 2)(%rdi,%rdx)
+ VMOVU %VEC(0), (VEC_SIZE * 2)(%rdi)
+ VMOVU %VEC(0), -(VEC_SIZE * 3)(%rdi,%rdx)
+ VMOVU %VEC(0), (VEC_SIZE * 3)(%rdi)
+ VMOVU %VEC(0), -(VEC_SIZE * 4)(%rdi,%rdx)
+ addq %rdi, %rdx
+ andq $-(VEC_SIZE * 4), %rdx
+ cmpq %rdx, %rcx
+ je L(return)
+L(loop):
+ VMOVA %VEC(0), (%rcx)
+ VMOVA %VEC(0), VEC_SIZE(%rcx)
+ VMOVA %VEC(0), (VEC_SIZE * 2)(%rcx)
+ VMOVA %VEC(0), (VEC_SIZE * 3)(%rcx)
+ addq $(VEC_SIZE * 4), %rcx
+ cmpq %rcx, %rdx
+ jne L(loop)
+ VZEROUPPER_SHORT_RETURN
+ ret
+L(less_vec):
+ /* Less than 1 VEC. */
+# if VEC_SIZE != 16 && VEC_SIZE != 32 && VEC_SIZE != 64
+# error Unsupported VEC_SIZE!
+# endif
+# if VEC_SIZE > 32
+ cmpb $32, %dl
+ jae L(between_32_63)
+# endif
+# if VEC_SIZE > 16
+ cmpb $16, %dl
+ jae L(between_16_31)
+# endif
+ MOVQ %xmm0, %rcx
+ cmpb $8, %dl
+ jae L(between_8_15)
+ cmpb $4, %dl
+ jae L(between_4_7)
+ cmpb $1, %dl
+ ja L(between_2_3)
+ jb 1f
+ movb %cl, (%rdi)
+1:
+ VZEROUPPER
+ ret
+# if VEC_SIZE > 32
+ /* From 32 to 63. No branch when size == 32. */
+L(between_32_63):
+ vmovdqu %ymm0, -32(%rdi,%rdx)
+ vmovdqu %ymm0, (%rdi)
+ VZEROUPPER
+ ret
+# endif
+# if VEC_SIZE > 16
+ /* From 16 to 31. No branch when size == 16. */
+L(between_16_31):
+ vmovdqu %xmm0, -16(%rdi,%rdx)
+ vmovdqu %xmm0, (%rdi)
+ VZEROUPPER
+ ret
+# endif
+ /* From 8 to 15. No branch when size == 8. */
+L(between_8_15):
+ movq %rcx, -8(%rdi,%rdx)
+ movq %rcx, (%rdi)
+ VZEROUPPER
+ ret
+L(between_4_7):
+ /* From 4 to 7. No branch when size == 4. */
+ movl %ecx, -4(%rdi,%rdx)
+ movl %ecx, (%rdi)
+ VZEROUPPER
+ ret
+L(between_2_3):
+ /* From 2 to 3. No branch when size == 2. */
+ movw %cx, -2(%rdi,%rdx)
+ movw %cx, (%rdi)
+ VZEROUPPER
+ ret
+END (MEMSET_SYMBOL (__memset, unaligned_erms))
diff --git a/sysdeps/x86_64/multiarch/memset.S b/sysdeps/x86_64/multiarch/memset.S
deleted file mode 100644
index 8e3b9b9764..0000000000
--- a/sysdeps/x86_64/multiarch/memset.S
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Multiple versions of memset
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2014-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>
-#include <shlib-compat.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib. */
-#if IS_IN (libc)
-ENTRY(memset)
- .type memset, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __memset_sse2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- leaq __memset_avx2(%rip), %rax
-#ifdef HAVE_AVX512_ASM_SUPPORT
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jz 2f
- HAS_ARCH_FEATURE (Prefer_No_VZEROUPPER)
- jz 2f
- leaq __memset_avx512_no_vzeroupper(%rip), %rax
-#endif
-2: ret
-END(memset)
-#endif
-
-#if IS_IN (libc)
-# undef memset
-# define memset __memset_sse2
-
-# undef __memset_chk
-# define __memset_chk __memset_chk_sse2
-
-# ifdef SHARED
-# undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal memset calls through a PLT.
- The speedup we get from using GPR instruction is likely eaten away
- by the indirect call in the PLT. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_memset; __GI_memset = __memset_sse2
-# endif
-
-# undef strong_alias
-# define strong_alias(original, alias)
-#endif
-
-#include "../memset.S"
diff --git a/sysdeps/x86_64/multiarch/memset.c b/sysdeps/x86_64/multiarch/memset.c
new file mode 100644
index 0000000000..064841d5fc
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memset.c
@@ -0,0 +1,35 @@
+/* Multiple versions of memset.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define memset __redirect_memset
+# include <string.h>
+# undef memset
+
+# define SYMBOL_NAME memset
+# include "ifunc-memset.h"
+
+libc_ifunc_redirected (__redirect_memset, memset, IFUNC_SELECTOR ());
+
+# ifdef SHARED
+__hidden_ver1 (memset, __GI_memset, __redirect_memset)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/memset_chk-nonshared.S b/sysdeps/x86_64/multiarch/memset_chk-nonshared.S
new file mode 100644
index 0000000000..dcc2384a27
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memset_chk-nonshared.S
@@ -0,0 +1,21 @@
+/* Non-shared version of memcpy_chk for x86-64.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/x86_64/memset_chk.S>
+#endif
diff --git a/sysdeps/x86_64/multiarch/memset_chk.S b/sysdeps/x86_64/multiarch/memset_chk.S
deleted file mode 100644
index 9a7b270274..0000000000
--- a/sysdeps/x86_64/multiarch/memset_chk.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Multiple versions of memset_chk
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2014-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>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib. */
-#if IS_IN (libc)
-# ifdef SHARED
-ENTRY(__memset_chk)
- .type __memset_chk, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __memset_chk_sse2(%rip), %rax
- HAS_ARCH_FEATURE (AVX2_Usable)
- jz 2f
- leaq __memset_chk_avx2(%rip), %rax
-#ifdef HAVE_AVX512_ASM_SUPPORT
- HAS_ARCH_FEATURE (AVX512F_Usable)
- jz 2f
- HAS_ARCH_FEATURE (Prefer_No_VZEROUPPER)
- jz 2f
- leaq __memset_chk_avx512_no_vzeroupper(%rip), %rax
-#endif
-2: ret
-END(__memset_chk)
-
-strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
- .section .gnu.warning.__memset_zero_constant_len_parameter
- .string "memset used with constant zero length parameter; this could be due to transposed parameters"
-# else
-# include "../memset_chk.S"
-# endif
-#endif
diff --git a/sysdeps/x86_64/multiarch/memset_chk.c b/sysdeps/x86_64/multiarch/memset_chk.c
new file mode 100644
index 0000000000..f9c05b364e
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memset_chk.c
@@ -0,0 +1,31 @@
+/* Multiple versions of __memset_chk
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __memset_chk __redirect_memset_chk
+# include <string.h>
+# undef __memset_chk
+
+# define SYMBOL_NAME memset_chk
+# include "ifunc-memset.h"
+
+libc_ifunc_redirected (__redirect_memset_chk, __memset_chk,
+ IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/x86_64/multiarch/rawmemchr-avx2.S b/sysdeps/x86_64/multiarch/rawmemchr-avx2.S
new file mode 100644
index 0000000000..128f9ea637
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/rawmemchr-avx2.S
@@ -0,0 +1,4 @@
+#define MEMCHR __rawmemchr_avx2
+#define USE_AS_RAWMEMCHR 1
+
+#include "memchr-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/rawmemchr-sse2.S b/sysdeps/x86_64/multiarch/rawmemchr-sse2.S
new file mode 100644
index 0000000000..c681d84037
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/rawmemchr-sse2.S
@@ -0,0 +1,29 @@
+/* rawmemchr optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define __rawmemchr __rawmemchr_sse2
+
+# undef weak_alias
+# define weak_alias(__rawmemchr, rawmemchr)
+# undef libc_hidden_def
+# define libc_hidden_def(__rawmemchr)
+#endif
+
+#include "../rawmemchr.S"
diff --git a/sysdeps/x86_64/multiarch/rawmemchr.c b/sysdeps/x86_64/multiarch/rawmemchr.c
new file mode 100644
index 0000000000..8a0bc3137e
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/rawmemchr.c
@@ -0,0 +1,38 @@
+/* Multiple versions of rawmemchr
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define rawmemchr __redirect_rawmemchr
+# define __rawmemchr __redirect___rawmemchr
+# include <string.h>
+# undef rawmemchr
+# undef __rawmemchr
+
+# define SYMBOL_NAME rawmemchr
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_rawmemchr, __rawmemchr,
+ IFUNC_SELECTOR ());
+weak_alias (__rawmemchr, rawmemchr)
+# ifdef SHARED
+__hidden_ver1 (__rawmemchr, __GI___rawmemchr, __redirect___rawmemchr)
+ __attribute__((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/sched_cpucount.c b/sysdeps/x86_64/multiarch/sched_cpucount.c
index b75aeb79b2..d10d74ae21 100644
--- a/sysdeps/x86_64/multiarch/sched_cpucount.c
+++ b/sysdeps/x86_64/multiarch/sched_cpucount.c
@@ -1,6 +1,6 @@
/* Count bits in CPU set. x86-64 multi-arch version.
This file is part of the GNU C Library.
- Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@redhat.com>.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/multiarch/stpcpy-sse2.S b/sysdeps/x86_64/multiarch/stpcpy-sse2.S
new file mode 100644
index 0000000000..b91a988399
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/stpcpy-sse2.S
@@ -0,0 +1,33 @@
+/* stpcpy optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+# define __stpcpy __stpcpy_sse2
+
+# undef weak_alias
+# define weak_alias(ignored1, ignored2)
+# undef libc_hidden_def
+# define libc_hidden_def(__stpcpy)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(stpcpy)
+#endif
+
+#define USE_AS_STPCPY
+#include <sysdeps/x86_64/stpcpy.S>
diff --git a/sysdeps/x86_64/multiarch/stpcpy.S b/sysdeps/x86_64/multiarch/stpcpy.S
deleted file mode 100644
index ee81ab6ae3..0000000000
--- a/sysdeps/x86_64/multiarch/stpcpy.S
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Multiple versions of stpcpy
- All versions must be listed in ifunc-impl-list.c. */
-#define USE_AS_STPCPY
-#define STRCPY __stpcpy
-#include "strcpy.S"
-
-weak_alias (__stpcpy, stpcpy)
-libc_hidden_def (__stpcpy)
-libc_hidden_builtin_def (stpcpy)
diff --git a/sysdeps/x86_64/multiarch/stpcpy.c b/sysdeps/x86_64/multiarch/stpcpy.c
new file mode 100644
index 0000000000..1e340fca99
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/stpcpy.c
@@ -0,0 +1,42 @@
+/* Multiple versions of stpcpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define stpcpy __redirect_stpcpy
+# define __stpcpy __redirect___stpcpy
+# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
+# include <string.h>
+# undef stpcpy
+# undef __stpcpy
+
+# define SYMBOL_NAME stpcpy
+# include "ifunc-unaligned-ssse3.h"
+
+libc_ifunc_redirected (__redirect_stpcpy, __stpcpy, IFUNC_SELECTOR ());
+
+weak_alias (__stpcpy, stpcpy)
+# ifdef SHARED
+__hidden_ver1 (__stpcpy, __GI___stpcpy, __redirect___stpcpy)
+ __attribute__ ((visibility ("hidden")));
+__hidden_ver1 (stpcpy, __GI_stpcpy, __redirect_stpcpy)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/stpncpy-c.c b/sysdeps/x86_64/multiarch/stpncpy-c.c
index 2fde77dcab..b016e487e1 100644
--- a/sysdeps/x86_64/multiarch/stpncpy-c.c
+++ b/sysdeps/x86_64/multiarch/stpncpy-c.c
@@ -1,8 +1,7 @@
#define STPNCPY __stpncpy_sse2
-#ifdef SHARED
+#undef weak_alias
+#define weak_alias(ignored1, ignored2)
#undef libc_hidden_def
-#define libc_hidden_def(name) \
- __hidden_ver1 (__stpncpy_sse2, __GI___stpncpy, __stpncpy_sse2);
-#endif
+#define libc_hidden_def(stpncpy)
-#include "stpncpy.c"
+#include <string/stpncpy.c>
diff --git a/sysdeps/x86_64/multiarch/stpncpy.S b/sysdeps/x86_64/multiarch/stpncpy.S
deleted file mode 100644
index 2698ca6a8c..0000000000
--- a/sysdeps/x86_64/multiarch/stpncpy.S
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Multiple versions of stpncpy
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCPY __stpncpy
-#define USE_AS_STPCPY
-#define USE_AS_STRNCPY
-#include "strcpy.S"
-
-weak_alias (__stpncpy, stpncpy)
diff --git a/sysdeps/x86_64/multiarch/stpncpy.c b/sysdeps/x86_64/multiarch/stpncpy.c
new file mode 100644
index 0000000000..28842ece2b
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/stpncpy.c
@@ -0,0 +1,38 @@
+/* Multiple versions of stpncpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define stpncpy __redirect_stpncpy
+# define __stpncpy __redirect___stpncpy
+# include <string.h>
+# undef stpncpy
+# undef __stpncpy
+
+# define SYMBOL_NAME stpncpy
+# include "ifunc-unaligned-ssse3.h"
+
+libc_ifunc_redirected (__redirect_stpncpy, __stpncpy, IFUNC_SELECTOR ());
+
+weak_alias (__stpncpy, stpncpy)
+# ifdef SHARED
+__hidden_ver1 (__stpncpy, __GI___stpncpy, __redirect___stpncpy)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strcasecmp.c b/sysdeps/x86_64/multiarch/strcasecmp.c
new file mode 100644
index 0000000000..8676a621c6
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcasecmp.c
@@ -0,0 +1,39 @@
+/* Multiple versions of strcasecmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcasecmp __redirect_strcasecmp
+# define __strcasecmp __redirect___strcasecmp
+# include <string.h>
+# undef strcasecmp
+# undef __strcasecmp
+
+# define SYMBOL_NAME strcasecmp
+# include "ifunc-strcasecmp.h"
+
+libc_ifunc_redirected (__redirect_strcasecmp, __strcasecmp,
+ IFUNC_SELECTOR ());
+
+weak_alias (__strcasecmp, strcasecmp)
+# ifdef SHARED
+__hidden_ver1 (__strcasecmp, __GI___strcasecmp, __redirect___strcasecmp)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strcasecmp_l-avx.S b/sysdeps/x86_64/multiarch/strcasecmp_l-avx.S
new file mode 100644
index 0000000000..56a03547eb
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcasecmp_l-avx.S
@@ -0,0 +1,22 @@
+/* strcasecmp_l optimized with AVX.
+ Copyright (C) 2017-2018 Free Software 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 STRCMP_SSE42 __strcasecmp_l_avx
+#define USE_AVX 1
+#define USE_AS_STRCASECMP_L
+#include "strcmp-sse42.S"
diff --git a/sysdeps/x86_64/multiarch/strcasecmp_l-sse2.S b/sysdeps/x86_64/multiarch/strcasecmp_l-sse2.S
new file mode 100644
index 0000000000..2984640405
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcasecmp_l-sse2.S
@@ -0,0 +1,23 @@
+/* strcasecmp_l optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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 STRCMP __strcasecmp_l_sse2
+#define USE_AS_STRCASECMP_L
+#define NO_NOLOCALE_ALIAS
+#define __strcasecmp __strcasecmp_sse2
+#include <sysdeps/x86_64/strcmp.S>
diff --git a/sysdeps/x86_64/multiarch/strcasecmp_l-sse4_2.S b/sysdeps/x86_64/multiarch/strcasecmp_l-sse4_2.S
new file mode 100644
index 0000000000..31e2f9075d
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcasecmp_l-sse4_2.S
@@ -0,0 +1,21 @@
+/* strcasecmp_l optimized with SSE4.2.
+ Copyright (C) 2017-2018 Free Software 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 STRCMP_SSE42 __strcasecmp_l_sse42
+#define USE_AS_STRCASECMP_L
+#include "strcmp-sse42.S"
diff --git a/sysdeps/x86_64/multiarch/strcasecmp_l.S b/sysdeps/x86_64/multiarch/strcasecmp_l.S
deleted file mode 100644
index 49f5b9fd95..0000000000
--- a/sysdeps/x86_64/multiarch/strcasecmp_l.S
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Multiple versions of strcasecmp and strcasecmp_l
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCMP __strcasecmp_l
-#define USE_AS_STRCASECMP_L
-#include "strcmp.S"
-
-weak_alias (__strcasecmp_l, strcasecmp_l)
-libc_hidden_def (strcasecmp_l)
diff --git a/sysdeps/x86_64/multiarch/strcasecmp_l.c b/sysdeps/x86_64/multiarch/strcasecmp_l.c
new file mode 100644
index 0000000000..dc674510df
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcasecmp_l.c
@@ -0,0 +1,40 @@
+/* Multiple versions of strcasecmp_l.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcasecmp_l __redirect_strcasecmp_l
+# define __strcasecmp_l __redirect___strcasecmp_l
+# include <string.h>
+# undef strcasecmp_l
+# undef __strcasecmp_l
+
+# define SYMBOL_NAME strcasecmp_l
+# include "ifunc-strcasecmp.h"
+
+libc_ifunc_redirected (__redirect_strcasecmp_l, __strcasecmp_l,
+ IFUNC_SELECTOR ());
+
+weak_alias (__strcasecmp_l, strcasecmp_l)
+# ifdef SHARED
+__hidden_ver1 (__strcasecmp_l, __GI___strcasecmp_l,
+ __redirect___strcasecmp_l)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S b/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S
index 3a694d45c2..852f179bf4 100644
--- a/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S
+++ b/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S
@@ -1,5 +1,5 @@
/* strcat with SSE2
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/multiarch/strcat-sse2.S b/sysdeps/x86_64/multiarch/strcat-sse2.S
new file mode 100644
index 0000000000..8eb64e104c
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcat-sse2.S
@@ -0,0 +1,28 @@
+/* strcat optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+# define strcat __strcat_sse2
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strcat)
+#endif
+
+#include <sysdeps/x86_64/strcat.S>
diff --git a/sysdeps/x86_64/multiarch/strcat-ssse3.S b/sysdeps/x86_64/multiarch/strcat-ssse3.S
index 96184d0f0f..2d4fd78f99 100644
--- a/sysdeps/x86_64/multiarch/strcat-ssse3.S
+++ b/sysdeps/x86_64/multiarch/strcat-ssse3.S
@@ -1,5 +1,5 @@
/* strcat with SSSE3
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/multiarch/strcat.S b/sysdeps/x86_64/multiarch/strcat.S
deleted file mode 100644
index 7bb38e68ad..0000000000
--- a/sysdeps/x86_64/multiarch/strcat.S
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Multiple versions of strcat
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#ifndef USE_AS_STRNCAT
-# ifndef STRCAT
-# define STRCAT strcat
-# endif
-#endif
-
-#ifdef USE_AS_STRNCAT
-# define STRCAT_SSSE3 __strncat_ssse3
-# define STRCAT_SSE2 __strncat_sse2
-# define STRCAT_SSE2_UNALIGNED __strncat_sse2_unaligned
-# define __GI_STRCAT __GI_strncat
-# define __GI___STRCAT __GI___strncat
-#else
-# define STRCAT_SSSE3 __strcat_ssse3
-# define STRCAT_SSE2 __strcat_sse2
-# define STRCAT_SSE2_UNALIGNED __strcat_sse2_unaligned
-# define __GI_STRCAT __GI_strcat
-# define __GI___STRCAT __GI___strcat
-#endif
-
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
- .text
-ENTRY(STRCAT)
- .type STRCAT, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq STRCAT_SSE2_UNALIGNED(%rip), %rax
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- leaq STRCAT_SSE2(%rip), %rax
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- leaq STRCAT_SSSE3(%rip), %rax
-2: ret
-END(STRCAT)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type STRCAT_SSE2, @function; \
- .align 16; \
- .globl STRCAT_SSE2; \
- .hidden STRCAT_SSE2; \
- STRCAT_SSE2: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size STRCAT_SSE2, .-STRCAT_SSE2
-# undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal strcat calls through a PLT.
- The speedup we get from using SSSE3 instruction is likely eaten away
- by the indirect call in the PLT. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_STRCAT; __GI_STRCAT = STRCAT_SSE2
-# undef libc_hidden_def
-# define libc_hidden_def(name) \
- .globl __GI___STRCAT; __GI___STRCAT = STRCAT_SSE2
-#endif
-
-#ifndef USE_AS_STRNCAT
-# include "../strcat.S"
-#endif
diff --git a/sysdeps/x86_64/multiarch/strcat.c b/sysdeps/x86_64/multiarch/strcat.c
new file mode 100644
index 0000000000..1f7f6263f3
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcat.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strcat.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcat __redirect_strcat
+# include <string.h>
+# undef strcat
+
+# define SYMBOL_NAME strcat
+# include "ifunc-unaligned-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strcat, strcat, IFUNC_SELECTOR ());
+
+# ifdef SHARED
+__hidden_ver1 (strcat, __GI_strcat, __redirect_strcat)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strchr-avx2.S b/sysdeps/x86_64/multiarch/strchr-avx2.S
new file mode 100644
index 0000000000..47bc3c9949
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strchr-avx2.S
@@ -0,0 +1,254 @@
+/* strchr/strchrnul optimized with AVX2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+
+# ifndef STRCHR
+# define STRCHR __strchr_avx2
+# endif
+
+# ifdef USE_AS_WCSCHR
+# define VPBROADCAST vpbroadcastd
+# define VPCMPEQ vpcmpeqd
+# define CHAR_REG esi
+# else
+# define VPBROADCAST vpbroadcastb
+# define VPCMPEQ vpcmpeqb
+# define CHAR_REG sil
+# endif
+
+# ifndef VZEROUPPER
+# define VZEROUPPER vzeroupper
+# endif
+
+# define VEC_SIZE 32
+
+ .section .text.avx,"ax",@progbits
+ENTRY (STRCHR)
+ movl %edi, %ecx
+ /* Broadcast CHAR to YMM0. */
+ vmovd %esi, %xmm0
+ vpxor %xmm9, %xmm9, %xmm9
+ VPBROADCAST %xmm0, %ymm0
+ /* Check if we may cross page boundary with one vector load. */
+ andl $(2 * VEC_SIZE - 1), %ecx
+ cmpl $VEC_SIZE, %ecx
+ ja L(cros_page_boundary)
+
+ /* Check the first VEC_SIZE bytes. Search for both CHAR and the
+ null byte. */
+ vmovdqu (%rdi), %ymm8
+ VPCMPEQ %ymm8, %ymm0, %ymm1
+ VPCMPEQ %ymm8, %ymm9, %ymm2
+ vpor %ymm1, %ymm2, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x0)
+
+ /* Align data for aligned loads in the loop. */
+ addq $VEC_SIZE, %rdi
+ andl $(VEC_SIZE - 1), %ecx
+ andq $-VEC_SIZE, %rdi
+
+ jmp L(more_4x_vec)
+
+ .p2align 4
+L(cros_page_boundary):
+ andl $(VEC_SIZE - 1), %ecx
+ andq $-VEC_SIZE, %rdi
+ vmovdqu (%rdi), %ymm8
+ VPCMPEQ %ymm8, %ymm0, %ymm1
+ VPCMPEQ %ymm8, %ymm9, %ymm2
+ vpor %ymm1, %ymm2, %ymm1
+ vpmovmskb %ymm1, %eax
+ /* Remove the leading bytes. */
+ sarl %cl, %eax
+ testl %eax, %eax
+ jz L(aligned_more)
+ /* Found CHAR or the null byte. */
+ tzcntl %eax, %eax
+ addq %rcx, %rax
+# ifdef USE_AS_STRCHRNUL
+ addq %rdi, %rax
+# else
+ xorl %edx, %edx
+ leaq (%rdi, %rax), %rax
+ cmp (%rax), %CHAR_REG
+ cmovne %rdx, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(aligned_more):
+ addq $VEC_SIZE, %rdi
+
+L(more_4x_vec):
+ /* Check the first 4 * VEC_SIZE. Only one VEC_SIZE at a time
+ since data is only aligned to VEC_SIZE. */
+ vmovdqa (%rdi), %ymm8
+ VPCMPEQ %ymm8, %ymm0, %ymm1
+ VPCMPEQ %ymm8, %ymm9, %ymm2
+ vpor %ymm1, %ymm2, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x0)
+
+ vmovdqa VEC_SIZE(%rdi), %ymm8
+ VPCMPEQ %ymm8, %ymm0, %ymm1
+ VPCMPEQ %ymm8, %ymm9, %ymm2
+ vpor %ymm1, %ymm2, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x1)
+
+ vmovdqa (VEC_SIZE * 2)(%rdi), %ymm8
+ VPCMPEQ %ymm8, %ymm0, %ymm1
+ VPCMPEQ %ymm8, %ymm9, %ymm2
+ vpor %ymm1, %ymm2, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x2)
+
+ vmovdqa (VEC_SIZE * 3)(%rdi), %ymm8
+ VPCMPEQ %ymm8, %ymm0, %ymm1
+ VPCMPEQ %ymm8, %ymm9, %ymm2
+ vpor %ymm1, %ymm2, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x3)
+
+ addq $(VEC_SIZE * 4), %rdi
+
+ /* Align data to 4 * VEC_SIZE. */
+ movq %rdi, %rcx
+ andl $(4 * VEC_SIZE - 1), %ecx
+ andq $-(4 * VEC_SIZE), %rdi
+
+ .p2align 4
+L(loop_4x_vec):
+ /* Compare 4 * VEC at a time forward. */
+ vmovdqa (%rdi), %ymm5
+ vmovdqa VEC_SIZE(%rdi), %ymm6
+ vmovdqa (VEC_SIZE * 2)(%rdi), %ymm7
+ vmovdqa (VEC_SIZE * 3)(%rdi), %ymm8
+
+ VPCMPEQ %ymm5, %ymm0, %ymm1
+ VPCMPEQ %ymm6, %ymm0, %ymm2
+ VPCMPEQ %ymm7, %ymm0, %ymm3
+ VPCMPEQ %ymm8, %ymm0, %ymm4
+
+ VPCMPEQ %ymm5, %ymm9, %ymm5
+ VPCMPEQ %ymm6, %ymm9, %ymm6
+ VPCMPEQ %ymm7, %ymm9, %ymm7
+ VPCMPEQ %ymm8, %ymm9, %ymm8
+
+ vpor %ymm1, %ymm5, %ymm1
+ vpor %ymm2, %ymm6, %ymm2
+ vpor %ymm3, %ymm7, %ymm3
+ vpor %ymm4, %ymm8, %ymm4
+
+ vpor %ymm1, %ymm2, %ymm5
+ vpor %ymm3, %ymm4, %ymm6
+
+ vpor %ymm5, %ymm6, %ymm5
+
+ vpmovmskb %ymm5, %eax
+ testl %eax, %eax
+ jnz L(4x_vec_end)
+
+ addq $(VEC_SIZE * 4), %rdi
+
+ jmp L(loop_4x_vec)
+
+ .p2align 4
+L(first_vec_x0):
+ /* Found CHAR or the null byte. */
+ tzcntl %eax, %eax
+# ifdef USE_AS_STRCHRNUL
+ addq %rdi, %rax
+# else
+ xorl %edx, %edx
+ leaq (%rdi, %rax), %rax
+ cmp (%rax), %CHAR_REG
+ cmovne %rdx, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x1):
+ tzcntl %eax, %eax
+# ifdef USE_AS_STRCHRNUL
+ addq $VEC_SIZE, %rax
+ addq %rdi, %rax
+# else
+ xorl %edx, %edx
+ leaq VEC_SIZE(%rdi, %rax), %rax
+ cmp (%rax), %CHAR_REG
+ cmovne %rdx, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x2):
+ tzcntl %eax, %eax
+# ifdef USE_AS_STRCHRNUL
+ addq $(VEC_SIZE * 2), %rax
+ addq %rdi, %rax
+# else
+ xorl %edx, %edx
+ leaq (VEC_SIZE * 2)(%rdi, %rax), %rax
+ cmp (%rax), %CHAR_REG
+ cmovne %rdx, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(4x_vec_end):
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x0)
+ vpmovmskb %ymm2, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x1)
+ vpmovmskb %ymm3, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x2)
+ vpmovmskb %ymm4, %eax
+ testl %eax, %eax
+L(first_vec_x3):
+ tzcntl %eax, %eax
+# ifdef USE_AS_STRCHRNUL
+ addq $(VEC_SIZE * 3), %rax
+ addq %rdi, %rax
+# else
+ xorl %edx, %edx
+ leaq (VEC_SIZE * 3)(%rdi, %rax), %rax
+ cmp (%rax), %CHAR_REG
+ cmovne %rdx, %rax
+# endif
+ VZEROUPPER
+ ret
+
+END (STRCHR)
+#endif
diff --git a/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S b/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
index 979d112b28..93fb661da2 100644
--- a/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
+++ b/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
@@ -1,5 +1,5 @@
/* strchr with SSE2 without bsf
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/multiarch/strchr-sse2.S b/sysdeps/x86_64/multiarch/strchr-sse2.S
new file mode 100644
index 0000000000..8a6e77195c
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strchr-sse2.S
@@ -0,0 +1,28 @@
+/* strchr optimized with SSE2.
+ Copyright (C) 2009-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strchr __strchr_sse2
+
+# undef weak_alias
+# define weak_alias(strchr, index)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strchr)
+#endif
+
+#include "../strchr.S"
diff --git a/sysdeps/x86_64/multiarch/strchr.S b/sysdeps/x86_64/multiarch/strchr.S
deleted file mode 100644
index 40683ad32b..0000000000
--- a/sysdeps/x86_64/multiarch/strchr.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Multiple versions of strchr
- Copyright (C) 2009-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>
-#include <init-arch.h>
-
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
- .text
-ENTRY(strchr)
- .type strchr, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __strchr_sse2(%rip), %rax
-2: HAS_ARCH_FEATURE (Slow_BSF)
- jz 3f
- leaq __strchr_sse2_no_bsf(%rip), %rax
-3: ret
-END(strchr)
-
-
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __strchr_sse2, @function; \
- .align 16; \
- .globl __strchr_sse2; \
- .hidden __strchr_sse2; \
- __strchr_sse2: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __strchr_sse2, .-__strchr_sse2
-# undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal strchr calls through a PLT.
- The speedup we get from using SSE4.2 instruction is likely eaten away
- by the indirect call in the PLT. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_strchr; __GI_strchr = __strchr_sse2
-#endif
-
-#include "../strchr.S"
diff --git a/sysdeps/x86_64/multiarch/strchr.c b/sysdeps/x86_64/multiarch/strchr.c
new file mode 100644
index 0000000000..76d64fb378
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strchr.c
@@ -0,0 +1,55 @@
+/* Multiple versions of strchr.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2009-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strchr __redirect_strchr
+# include <string.h>
+# undef strchr
+
+# define SYMBOL_NAME strchr
+# include <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_no_bsf) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (!CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX_Fast_Unaligned_Load))
+ return OPTIMIZE (avx2);
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, Slow_BSF))
+ return OPTIMIZE (sse2_no_bsf);
+
+ return OPTIMIZE (sse2);
+}
+
+libc_ifunc_redirected (__redirect_strchr, strchr, IFUNC_SELECTOR ());
+weak_alias (strchr, index)
+# ifdef SHARED
+__hidden_ver1 (strchr, __GI_strchr, __redirect_strchr)
+ __attribute__((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strchrnul-avx2.S b/sysdeps/x86_64/multiarch/strchrnul-avx2.S
new file mode 100644
index 0000000000..fa0cc09760
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strchrnul-avx2.S
@@ -0,0 +1,3 @@
+#define STRCHR __strchrnul_avx2
+#define USE_AS_STRCHRNUL 1
+#include "strchr-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/strchrnul-sse2.S b/sysdeps/x86_64/multiarch/strchrnul-sse2.S
new file mode 100644
index 0000000000..d4a2be118e
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strchrnul-sse2.S
@@ -0,0 +1,26 @@
+/* strchrnul optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define __strchrnul __strchrnul_sse2
+
+# undef weak_alias
+# define weak_alias(__strchrnul, strchrnul)
+#endif
+
+#include "../strchrnul.S"
diff --git a/sysdeps/x86_64/multiarch/strchrnul.c b/sysdeps/x86_64/multiarch/strchrnul.c
new file mode 100644
index 0000000000..7514999341
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strchrnul.c
@@ -0,0 +1,34 @@
+/* Multiple versions of strchrnul.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strchrnul __redirect_strchrnul
+# define __strchrnul __redirect___strchrnul
+# include <string.h>
+# undef __strchrnul
+# undef strchrnul
+
+# define SYMBOL_NAME strchrnul
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_strchrnul, __strchrnul,
+ IFUNC_SELECTOR ());
+weak_alias (__strchrnul, strchrnul)
+#endif
diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S
new file mode 100644
index 0000000000..e8397f3b05
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S
@@ -0,0 +1,847 @@
+/* strcmp/wcscmp/strncmp/wcsncmp optimized with AVX2.
+ Copyright (C) 2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+
+# ifndef STRCMP
+# define STRCMP __strcmp_avx2
+# endif
+
+# define PAGE_SIZE 4096
+
+/* VEC_SIZE = Number of bytes in a ymm register */
+# define VEC_SIZE 32
+
+/* Shift for dividing by (VEC_SIZE * 4). */
+# define DIVIDE_BY_VEC_4_SHIFT 7
+# if (VEC_SIZE * 4) != (1 << DIVIDE_BY_VEC_4_SHIFT)
+# error (VEC_SIZE * 4) != (1 << DIVIDE_BY_VEC_4_SHIFT)
+# endif
+
+# ifdef USE_AS_WCSCMP
+/* Compare packed dwords. */
+# define VPCMPEQ vpcmpeqd
+/* Compare packed dwords and store minimum. */
+# define VPMINU vpminud
+/* 1 dword char == 4 bytes. */
+# define SIZE_OF_CHAR 4
+# else
+/* Compare packed bytes. */
+# define VPCMPEQ vpcmpeqb
+/* Compare packed bytes and store minimum. */
+# define VPMINU vpminub
+/* 1 byte char == 1 byte. */
+# define SIZE_OF_CHAR 1
+# endif
+
+# ifndef VZEROUPPER
+# define VZEROUPPER vzeroupper
+# endif
+
+/* Warning!
+ wcscmp/wcsncmp have to use SIGNED comparison for elements.
+ strcmp/strncmp have to use UNSIGNED comparison for elements.
+*/
+
+/* The main idea of the string comparison (byte or dword) using AVX2
+ consists of comparing (VPCMPEQ) two ymm vectors. The latter can be on
+ either packed bytes or dwords depending on USE_AS_WCSCMP. In order
+ to check the null char, algorithm keeps the matched bytes/dwords,
+ requiring two more AVX2 instructions (VPMINU and VPCMPEQ). In general,
+ the costs of comparing VEC_SIZE bytes (32-bytes) are two VPCMPEQ and
+ one VPMINU instructions, together with movdqu and testl instructions.
+ Main loop (away from from page boundary) compares 4 vectors are a time,
+ effectively comparing 4 x VEC_SIZE bytes (128 bytes) on each loop.
+
+ The routine strncmp/wcsncmp (enabled by defining USE_AS_STRNCMP) logic
+ is the same as strcmp, except that an a maximum offset is tracked. If
+ the maximum offset is reached before a difference is found, zero is
+ returned. */
+
+ .section .text.avx,"ax",@progbits
+ENTRY (STRCMP)
+# ifdef USE_AS_STRNCMP
+ /* Check for simple cases (0 or 1) in offset. */
+ cmp $1, %rdx
+ je L(char0)
+ jb L(zero)
+# ifdef USE_AS_WCSCMP
+ /* Convert units: from wide to byte char. */
+ shl $2, %rdx
+# endif
+ /* Register %r11 tracks the maximum offset. */
+ movq %rdx, %r11
+# endif
+ movl %edi, %eax
+ xorl %edx, %edx
+ /* Make %ymm7 all zeros in this function. */
+ vpxor %ymm7, %ymm7, %ymm7
+ orl %esi, %eax
+ andl $(PAGE_SIZE - 1), %eax
+ cmpl $(PAGE_SIZE - (VEC_SIZE * 4)), %eax
+ jg L(cross_page)
+ /* Start comparing 4 vectors. */
+ vmovdqu (%rdi), %ymm1
+ VPCMPEQ (%rsi), %ymm1, %ymm0
+ VPMINU %ymm1, %ymm0, %ymm0
+ VPCMPEQ %ymm7, %ymm0, %ymm0
+ vpmovmskb %ymm0, %ecx
+ testl %ecx, %ecx
+ je L(next_3_vectors)
+ tzcntl %ecx, %edx
+# ifdef USE_AS_STRNCMP
+ /* Return 0 if the mismatched index (%rdx) is after the maximum
+ offset (%r11). */
+ cmpq %r11, %rdx
+ jae L(zero)
+# endif
+# ifdef USE_AS_WCSCMP
+ xorl %eax, %eax
+ movl (%rdi, %rdx), %ecx
+ cmpl (%rsi, %rdx), %ecx
+ je L(return)
+L(wcscmp_return):
+ setl %al
+ negl %eax
+ orl $1, %eax
+L(return):
+# else
+ movzbl (%rdi, %rdx), %eax
+ movzbl (%rsi, %rdx), %edx
+ subl %edx, %eax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(return_vec_size):
+ tzcntl %ecx, %edx
+# ifdef USE_AS_STRNCMP
+ /* Return 0 if the mismatched index (%rdx + VEC_SIZE) is after
+ the maximum offset (%r11). */
+ addq $VEC_SIZE, %rdx
+ cmpq %r11, %rdx
+ jae L(zero)
+# ifdef USE_AS_WCSCMP
+ xorl %eax, %eax
+ movl (%rdi, %rdx), %ecx
+ cmpl (%rsi, %rdx), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl (%rdi, %rdx), %eax
+ movzbl (%rsi, %rdx), %edx
+ subl %edx, %eax
+# endif
+# else
+# ifdef USE_AS_WCSCMP
+ xorl %eax, %eax
+ movl VEC_SIZE(%rdi, %rdx), %ecx
+ cmpl VEC_SIZE(%rsi, %rdx), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl VEC_SIZE(%rdi, %rdx), %eax
+ movzbl VEC_SIZE(%rsi, %rdx), %edx
+ subl %edx, %eax
+# endif
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(return_2_vec_size):
+ tzcntl %ecx, %edx
+# ifdef USE_AS_STRNCMP
+ /* Return 0 if the mismatched index (%rdx + 2 * VEC_SIZE) is
+ after the maximum offset (%r11). */
+ addq $(VEC_SIZE * 2), %rdx
+ cmpq %r11, %rdx
+ jae L(zero)
+# ifdef USE_AS_WCSCMP
+ xorl %eax, %eax
+ movl (%rdi, %rdx), %ecx
+ cmpl (%rsi, %rdx), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl (%rdi, %rdx), %eax
+ movzbl (%rsi, %rdx), %edx
+ subl %edx, %eax
+# endif
+# else
+# ifdef USE_AS_WCSCMP
+ xorl %eax, %eax
+ movl (VEC_SIZE * 2)(%rdi, %rdx), %ecx
+ cmpl (VEC_SIZE * 2)(%rsi, %rdx), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl (VEC_SIZE * 2)(%rdi, %rdx), %eax
+ movzbl (VEC_SIZE * 2)(%rsi, %rdx), %edx
+ subl %edx, %eax
+# endif
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(return_3_vec_size):
+ tzcntl %ecx, %edx
+# ifdef USE_AS_STRNCMP
+ /* Return 0 if the mismatched index (%rdx + 3 * VEC_SIZE) is
+ after the maximum offset (%r11). */
+ addq $(VEC_SIZE * 3), %rdx
+ cmpq %r11, %rdx
+ jae L(zero)
+# ifdef USE_AS_WCSCMP
+ xorl %eax, %eax
+ movl (%rdi, %rdx), %ecx
+ cmpl (%rsi, %rdx), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl (%rdi, %rdx), %eax
+ movzbl (%rsi, %rdx), %edx
+ subl %edx, %eax
+# endif
+# else
+# ifdef USE_AS_WCSCMP
+ xorl %eax, %eax
+ movl (VEC_SIZE * 3)(%rdi, %rdx), %ecx
+ cmpl (VEC_SIZE * 3)(%rsi, %rdx), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl (VEC_SIZE * 3)(%rdi, %rdx), %eax
+ movzbl (VEC_SIZE * 3)(%rsi, %rdx), %edx
+ subl %edx, %eax
+# endif
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(next_3_vectors):
+ vmovdqu VEC_SIZE(%rdi), %ymm6
+ VPCMPEQ VEC_SIZE(%rsi), %ymm6, %ymm3
+ VPMINU %ymm6, %ymm3, %ymm3
+ VPCMPEQ %ymm7, %ymm3, %ymm3
+ vpmovmskb %ymm3, %ecx
+ testl %ecx, %ecx
+ jne L(return_vec_size)
+ vmovdqu (VEC_SIZE * 2)(%rdi), %ymm5
+ vmovdqu (VEC_SIZE * 3)(%rdi), %ymm4
+ vmovdqu (VEC_SIZE * 3)(%rsi), %ymm0
+ VPCMPEQ (VEC_SIZE * 2)(%rsi), %ymm5, %ymm2
+ VPMINU %ymm5, %ymm2, %ymm2
+ VPCMPEQ %ymm4, %ymm0, %ymm0
+ VPCMPEQ %ymm7, %ymm2, %ymm2
+ vpmovmskb %ymm2, %ecx
+ testl %ecx, %ecx
+ jne L(return_2_vec_size)
+ VPMINU %ymm4, %ymm0, %ymm0
+ VPCMPEQ %ymm7, %ymm0, %ymm0
+ vpmovmskb %ymm0, %ecx
+ testl %ecx, %ecx
+ jne L(return_3_vec_size)
+L(main_loop_header):
+ leaq (VEC_SIZE * 4)(%rdi), %rdx
+ movl $PAGE_SIZE, %ecx
+ /* Align load via RAX. */
+ andq $-(VEC_SIZE * 4), %rdx
+ subq %rdi, %rdx
+ leaq (%rdi, %rdx), %rax
+# ifdef USE_AS_STRNCMP
+ /* Starting from this point, the maximum offset, or simply the
+ 'offset', DECREASES by the same amount when base pointers are
+ moved forward. Return 0 when:
+ 1) On match: offset <= the matched vector index.
+ 2) On mistmach, offset is before the mistmatched index.
+ */
+ subq %rdx, %r11
+ jbe L(zero)
+# endif
+ addq %rsi, %rdx
+ movq %rdx, %rsi
+ andl $(PAGE_SIZE - 1), %esi
+ /* Number of bytes before page crossing. */
+ subq %rsi, %rcx
+ /* Number of VEC_SIZE * 4 blocks before page crossing. */
+ shrq $DIVIDE_BY_VEC_4_SHIFT, %rcx
+ /* ESI: Number of VEC_SIZE * 4 blocks before page crossing. */
+ movl %ecx, %esi
+ jmp L(loop_start)
+
+ .p2align 4
+L(loop):
+# ifdef USE_AS_STRNCMP
+ /* Base pointers are moved forward by 4 * VEC_SIZE. Decrease
+ the maximum offset (%r11) by the same amount. */
+ subq $(VEC_SIZE * 4), %r11
+ jbe L(zero)
+# endif
+ addq $(VEC_SIZE * 4), %rax
+ addq $(VEC_SIZE * 4), %rdx
+L(loop_start):
+ testl %esi, %esi
+ leal -1(%esi), %esi
+ je L(loop_cross_page)
+L(back_to_loop):
+ /* Main loop, comparing 4 vectors are a time. */
+ vmovdqa (%rax), %ymm0
+ vmovdqa VEC_SIZE(%rax), %ymm3
+ VPCMPEQ (%rdx), %ymm0, %ymm4
+ VPCMPEQ VEC_SIZE(%rdx), %ymm3, %ymm1
+ VPMINU %ymm0, %ymm4, %ymm4
+ VPMINU %ymm3, %ymm1, %ymm1
+ vmovdqa (VEC_SIZE * 2)(%rax), %ymm2
+ VPMINU %ymm1, %ymm4, %ymm0
+ vmovdqa (VEC_SIZE * 3)(%rax), %ymm3
+ VPCMPEQ (VEC_SIZE * 2)(%rdx), %ymm2, %ymm5
+ VPCMPEQ (VEC_SIZE * 3)(%rdx), %ymm3, %ymm6
+ VPMINU %ymm2, %ymm5, %ymm5
+ VPMINU %ymm3, %ymm6, %ymm6
+ VPMINU %ymm5, %ymm0, %ymm0
+ VPMINU %ymm6, %ymm0, %ymm0
+ VPCMPEQ %ymm7, %ymm0, %ymm0
+
+ /* Test each mask (32 bits) individually because for VEC_SIZE
+ == 32 is not possible to OR the four masks and keep all bits
+ in a 64-bit integer register, differing from SSE2 strcmp
+ where ORing is possible. */
+ vpmovmskb %ymm0, %ecx
+ testl %ecx, %ecx
+ je L(loop)
+ VPCMPEQ %ymm7, %ymm4, %ymm0
+ vpmovmskb %ymm0, %edi
+ testl %edi, %edi
+ je L(test_vec)
+ tzcntl %edi, %ecx
+# ifdef USE_AS_STRNCMP
+ cmpq %rcx, %r11
+ jbe L(zero)
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (%rsi, %rcx), %edi
+ cmpl (%rdx, %rcx), %edi
+ jne L(wcscmp_return)
+# else
+ movzbl (%rax, %rcx), %eax
+ movzbl (%rdx, %rcx), %edx
+ subl %edx, %eax
+# endif
+# else
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (%rsi, %rcx), %edi
+ cmpl (%rdx, %rcx), %edi
+ jne L(wcscmp_return)
+# else
+ movzbl (%rax, %rcx), %eax
+ movzbl (%rdx, %rcx), %edx
+ subl %edx, %eax
+# endif
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(test_vec):
+# ifdef USE_AS_STRNCMP
+ /* The first vector matched. Return 0 if the maximum offset
+ (%r11) <= VEC_SIZE. */
+ cmpq $VEC_SIZE, %r11
+ jbe L(zero)
+# endif
+ VPCMPEQ %ymm7, %ymm1, %ymm1
+ vpmovmskb %ymm1, %ecx
+ testl %ecx, %ecx
+ je L(test_2_vec)
+ tzcntl %ecx, %edi
+# ifdef USE_AS_STRNCMP
+ addq $VEC_SIZE, %rdi
+ cmpq %rdi, %r11
+ jbe L(zero)
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (%rsi, %rdi), %ecx
+ cmpl (%rdx, %rdi), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl (%rax, %rdi), %eax
+ movzbl (%rdx, %rdi), %edx
+ subl %edx, %eax
+# endif
+# else
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl VEC_SIZE(%rsi, %rdi), %ecx
+ cmpl VEC_SIZE(%rdx, %rdi), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl VEC_SIZE(%rax, %rdi), %eax
+ movzbl VEC_SIZE(%rdx, %rdi), %edx
+ subl %edx, %eax
+# endif
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(test_2_vec):
+# ifdef USE_AS_STRNCMP
+ /* The first 2 vectors matched. Return 0 if the maximum offset
+ (%r11) <= 2 * VEC_SIZE. */
+ cmpq $(VEC_SIZE * 2), %r11
+ jbe L(zero)
+# endif
+ VPCMPEQ %ymm7, %ymm5, %ymm5
+ vpmovmskb %ymm5, %ecx
+ testl %ecx, %ecx
+ je L(test_3_vec)
+ tzcntl %ecx, %edi
+# ifdef USE_AS_STRNCMP
+ addq $(VEC_SIZE * 2), %rdi
+ cmpq %rdi, %r11
+ jbe L(zero)
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (%rsi, %rdi), %ecx
+ cmpl (%rdx, %rdi), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl (%rax, %rdi), %eax
+ movzbl (%rdx, %rdi), %edx
+ subl %edx, %eax
+# endif
+# else
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (VEC_SIZE * 2)(%rsi, %rdi), %ecx
+ cmpl (VEC_SIZE * 2)(%rdx, %rdi), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl (VEC_SIZE * 2)(%rax, %rdi), %eax
+ movzbl (VEC_SIZE * 2)(%rdx, %rdi), %edx
+ subl %edx, %eax
+# endif
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(test_3_vec):
+# ifdef USE_AS_STRNCMP
+ /* The first 3 vectors matched. Return 0 if the maximum offset
+ (%r11) <= 3 * VEC_SIZE. */
+ cmpq $(VEC_SIZE * 3), %r11
+ jbe L(zero)
+# endif
+ VPCMPEQ %ymm7, %ymm6, %ymm6
+ vpmovmskb %ymm6, %esi
+ tzcntl %esi, %ecx
+# ifdef USE_AS_STRNCMP
+ addq $(VEC_SIZE * 3), %rcx
+ cmpq %rcx, %r11
+ jbe L(zero)
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (%rsi, %rcx), %esi
+ cmpl (%rdx, %rcx), %esi
+ jne L(wcscmp_return)
+# else
+ movzbl (%rax, %rcx), %eax
+ movzbl (%rdx, %rcx), %edx
+ subl %edx, %eax
+# endif
+# else
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (VEC_SIZE * 3)(%rsi, %rcx), %esi
+ cmpl (VEC_SIZE * 3)(%rdx, %rcx), %esi
+ jne L(wcscmp_return)
+# else
+ movzbl (VEC_SIZE * 3)(%rax, %rcx), %eax
+ movzbl (VEC_SIZE * 3)(%rdx, %rcx), %edx
+ subl %edx, %eax
+# endif
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(loop_cross_page):
+ xorl %r10d, %r10d
+ movq %rdx, %rcx
+ /* Align load via RDX. We load the extra ECX bytes which should
+ be ignored. */
+ andl $((VEC_SIZE * 4) - 1), %ecx
+ /* R10 is -RCX. */
+ subq %rcx, %r10
+
+ /* This works only if VEC_SIZE * 2 == 64. */
+# if (VEC_SIZE * 2) != 64
+# error (VEC_SIZE * 2) != 64
+# endif
+
+ /* Check if the first VEC_SIZE * 2 bytes should be ignored. */
+ cmpl $(VEC_SIZE * 2), %ecx
+ jge L(loop_cross_page_2_vec)
+
+ vmovdqu (%rax, %r10), %ymm2
+ vmovdqu VEC_SIZE(%rax, %r10), %ymm3
+ VPCMPEQ (%rdx, %r10), %ymm2, %ymm0
+ VPCMPEQ VEC_SIZE(%rdx, %r10), %ymm3, %ymm1
+ VPMINU %ymm2, %ymm0, %ymm0
+ VPMINU %ymm3, %ymm1, %ymm1
+ VPCMPEQ %ymm7, %ymm0, %ymm0
+ VPCMPEQ %ymm7, %ymm1, %ymm1
+
+ vpmovmskb %ymm0, %edi
+ vpmovmskb %ymm1, %esi
+
+ salq $32, %rsi
+ xorq %rsi, %rdi
+
+ /* Since ECX < VEC_SIZE * 2, simply skip the first ECX bytes. */
+ shrq %cl, %rdi
+
+ testq %rdi, %rdi
+ je L(loop_cross_page_2_vec)
+ tzcntq %rdi, %rcx
+# ifdef USE_AS_STRNCMP
+ cmpq %rcx, %r11
+ jbe L(zero)
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (%rsi, %rcx), %edi
+ cmpl (%rdx, %rcx), %edi
+ jne L(wcscmp_return)
+# else
+ movzbl (%rax, %rcx), %eax
+ movzbl (%rdx, %rcx), %edx
+ subl %edx, %eax
+# endif
+# else
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (%rsi, %rcx), %edi
+ cmpl (%rdx, %rcx), %edi
+ jne L(wcscmp_return)
+# else
+ movzbl (%rax, %rcx), %eax
+ movzbl (%rdx, %rcx), %edx
+ subl %edx, %eax
+# endif
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(loop_cross_page_2_vec):
+ /* The first VEC_SIZE * 2 bytes match or are ignored. */
+ vmovdqu (VEC_SIZE * 2)(%rax, %r10), %ymm2
+ vmovdqu (VEC_SIZE * 3)(%rax, %r10), %ymm3
+ VPCMPEQ (VEC_SIZE * 2)(%rdx, %r10), %ymm2, %ymm5
+ VPMINU %ymm2, %ymm5, %ymm5
+ VPCMPEQ (VEC_SIZE * 3)(%rdx, %r10), %ymm3, %ymm6
+ VPCMPEQ %ymm7, %ymm5, %ymm5
+ VPMINU %ymm3, %ymm6, %ymm6
+ VPCMPEQ %ymm7, %ymm6, %ymm6
+
+ vpmovmskb %ymm5, %edi
+ vpmovmskb %ymm6, %esi
+
+ salq $32, %rsi
+ xorq %rsi, %rdi
+
+ xorl %r8d, %r8d
+ /* If ECX > VEC_SIZE * 2, skip ECX - (VEC_SIZE * 2) bytes. */
+ subl $(VEC_SIZE * 2), %ecx
+ jle 1f
+ /* Skip ECX bytes. */
+ shrq %cl, %rdi
+ /* R8 has number of bytes skipped. */
+ movl %ecx, %r8d
+1:
+ /* Before jumping back to the loop, set ESI to the number of
+ VEC_SIZE * 4 blocks before page crossing. */
+ movl $(PAGE_SIZE / (VEC_SIZE * 4) - 1), %esi
+
+ testq %rdi, %rdi
+ je L(back_to_loop)
+ tzcntq %rdi, %rcx
+ addq %r10, %rcx
+ /* Adjust for number of bytes skipped. */
+ addq %r8, %rcx
+# ifdef USE_AS_STRNCMP
+ addq $(VEC_SIZE * 2), %rcx
+ subq %rcx, %r11
+ jbe L(zero)
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (%rsi, %rcx), %edi
+ cmpl (%rdx, %rcx), %edi
+ jne L(wcscmp_return)
+# else
+ movzbl (%rax, %rcx), %eax
+ movzbl (%rdx, %rcx), %edx
+ subl %edx, %eax
+# endif
+# else
+# ifdef USE_AS_WCSCMP
+ movq %rax, %rsi
+ xorl %eax, %eax
+ movl (VEC_SIZE * 2)(%rsi, %rcx), %edi
+ cmpl (VEC_SIZE * 2)(%rdx, %rcx), %edi
+ jne L(wcscmp_return)
+# else
+ movzbl (VEC_SIZE * 2)(%rax, %rcx), %eax
+ movzbl (VEC_SIZE * 2)(%rdx, %rcx), %edx
+ subl %edx, %eax
+# endif
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(cross_page_loop):
+ /* Check one byte/dword at a time. */
+# ifdef USE_AS_WCSCMP
+ cmpl %ecx, %eax
+# else
+ subl %ecx, %eax
+# endif
+ jne L(different)
+ addl $SIZE_OF_CHAR, %edx
+ cmpl $(VEC_SIZE * 4), %edx
+ je L(main_loop_header)
+# ifdef USE_AS_STRNCMP
+ cmpq %r11, %rdx
+ jae L(zero)
+# endif
+# ifdef USE_AS_WCSCMP
+ movl (%rdi, %rdx), %eax
+ movl (%rsi, %rdx), %ecx
+# else
+ movzbl (%rdi, %rdx), %eax
+ movzbl (%rsi, %rdx), %ecx
+# endif
+ /* Check null char. */
+ testl %eax, %eax
+ jne L(cross_page_loop)
+ /* Since %eax == 0, subtract is OK for both SIGNED and UNSIGNED
+ comparisons. */
+ subl %ecx, %eax
+# ifndef USE_AS_WCSCMP
+L(different):
+# endif
+ VZEROUPPER
+ ret
+
+# ifdef USE_AS_WCSCMP
+ .p2align 4
+L(different):
+ /* Use movl to avoid modifying EFLAGS. */
+ movl $0, %eax
+ setl %al
+ negl %eax
+ orl $1, %eax
+ VZEROUPPER
+ ret
+# endif
+
+# ifdef USE_AS_STRNCMP
+ .p2align 4
+L(zero):
+ xorl %eax, %eax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(char0):
+# ifdef USE_AS_WCSCMP
+ xorl %eax, %eax
+ movl (%rdi), %ecx
+ cmpl (%rsi), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl (%rsi), %ecx
+ movzbl (%rdi), %eax
+ subl %ecx, %eax
+# endif
+ VZEROUPPER
+ ret
+# endif
+
+ .p2align 4
+L(last_vector):
+ addq %rdx, %rdi
+ addq %rdx, %rsi
+# ifdef USE_AS_STRNCMP
+ subq %rdx, %r11
+# endif
+ tzcntl %ecx, %edx
+# ifdef USE_AS_STRNCMP
+ cmpq %r11, %rdx
+ jae L(zero)
+# endif
+# ifdef USE_AS_WCSCMP
+ xorl %eax, %eax
+ movl (%rdi, %rdx), %ecx
+ cmpl (%rsi, %rdx), %ecx
+ jne L(wcscmp_return)
+# else
+ movzbl (%rdi, %rdx), %eax
+ movzbl (%rsi, %rdx), %edx
+ subl %edx, %eax
+# endif
+ VZEROUPPER
+ ret
+
+ /* Comparing on page boundary region requires special treatment:
+ It must done one vector at the time, starting with the wider
+ ymm vector if possible, if not, with xmm. If fetching 16 bytes
+ (xmm) still passes the boundary, byte comparison must be done.
+ */
+ .p2align 4
+L(cross_page):
+ /* Try one ymm vector at a time. */
+ cmpl $(PAGE_SIZE - VEC_SIZE), %eax
+ jg L(cross_page_1_vector)
+L(loop_1_vector):
+ vmovdqu (%rdi, %rdx), %ymm1
+ VPCMPEQ (%rsi, %rdx), %ymm1, %ymm0
+ VPMINU %ymm1, %ymm0, %ymm0
+ VPCMPEQ %ymm7, %ymm0, %ymm0
+ vpmovmskb %ymm0, %ecx
+ testl %ecx, %ecx
+ jne L(last_vector)
+
+ addl $VEC_SIZE, %edx
+
+ addl $VEC_SIZE, %eax
+# ifdef USE_AS_STRNCMP
+ /* Return 0 if the current offset (%rdx) >= the maximum offset
+ (%r11). */
+ cmpq %r11, %rdx
+ jae L(zero)
+# endif
+ cmpl $(PAGE_SIZE - VEC_SIZE), %eax
+ jle L(loop_1_vector)
+L(cross_page_1_vector):
+ /* Less than 32 bytes to check, try one xmm vector. */
+ cmpl $(PAGE_SIZE - 16), %eax
+ jg L(cross_page_1_xmm)
+ vmovdqu (%rdi, %rdx), %xmm1
+ VPCMPEQ (%rsi, %rdx), %xmm1, %xmm0
+ VPMINU %xmm1, %xmm0, %xmm0
+ VPCMPEQ %xmm7, %xmm0, %xmm0
+ vpmovmskb %xmm0, %ecx
+ testl %ecx, %ecx
+ jne L(last_vector)
+
+ addl $16, %edx
+# ifndef USE_AS_WCSCMP
+ addl $16, %eax
+# endif
+# ifdef USE_AS_STRNCMP
+ /* Return 0 if the current offset (%rdx) >= the maximum offset
+ (%r11). */
+ cmpq %r11, %rdx
+ jae L(zero)
+# endif
+
+L(cross_page_1_xmm):
+# ifndef USE_AS_WCSCMP
+ /* Less than 16 bytes to check, try 8 byte vector. NB: No need
+ for wcscmp nor wcsncmp since wide char is 4 bytes. */
+ cmpl $(PAGE_SIZE - 8), %eax
+ jg L(cross_page_8bytes)
+ vmovq (%rdi, %rdx), %xmm1
+ vmovq (%rsi, %rdx), %xmm0
+ VPCMPEQ %xmm0, %xmm1, %xmm0
+ VPMINU %xmm1, %xmm0, %xmm0
+ VPCMPEQ %xmm7, %xmm0, %xmm0
+ vpmovmskb %xmm0, %ecx
+ /* Only last 8 bits are valid. */
+ andl $0xff, %ecx
+ testl %ecx, %ecx
+ jne L(last_vector)
+
+ addl $8, %edx
+ addl $8, %eax
+# ifdef USE_AS_STRNCMP
+ /* Return 0 if the current offset (%rdx) >= the maximum offset
+ (%r11). */
+ cmpq %r11, %rdx
+ jae L(zero)
+# endif
+
+L(cross_page_8bytes):
+ /* Less than 8 bytes to check, try 4 byte vector. */
+ cmpl $(PAGE_SIZE - 4), %eax
+ jg L(cross_page_4bytes)
+ vmovd (%rdi, %rdx), %xmm1
+ vmovd (%rsi, %rdx), %xmm0
+ VPCMPEQ %xmm0, %xmm1, %xmm0
+ VPMINU %xmm1, %xmm0, %xmm0
+ VPCMPEQ %xmm7, %xmm0, %xmm0
+ vpmovmskb %xmm0, %ecx
+ /* Only last 4 bits are valid. */
+ andl $0xf, %ecx
+ testl %ecx, %ecx
+ jne L(last_vector)
+
+ addl $4, %edx
+# ifdef USE_AS_STRNCMP
+ /* Return 0 if the current offset (%rdx) >= the maximum offset
+ (%r11). */
+ cmpq %r11, %rdx
+ jae L(zero)
+# endif
+
+L(cross_page_4bytes):
+# endif
+ /* Less than 4 bytes to check, try one byte/dword at a time. */
+# ifdef USE_AS_STRNCMP
+ cmpq %r11, %rdx
+ jae L(zero)
+# endif
+# ifdef USE_AS_WCSCMP
+ movl (%rdi, %rdx), %eax
+ movl (%rsi, %rdx), %ecx
+# else
+ movzbl (%rdi, %rdx), %eax
+ movzbl (%rsi, %rdx), %ecx
+# endif
+ testl %eax, %eax
+ jne L(cross_page_loop)
+ subl %ecx, %eax
+ VZEROUPPER
+ ret
+END (STRCMP)
+#endif
diff --git a/sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S b/sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S
index bf555b4066..a9b6267d15 100644
--- a/sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S
+++ b/sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S
@@ -1,5 +1,5 @@
/* strcmp with unaligned loads
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/multiarch/strcmp-sse2.S b/sysdeps/x86_64/multiarch/strcmp-sse2.S
new file mode 100644
index 0000000000..d173ded8c0
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcmp-sse2.S
@@ -0,0 +1,28 @@
+/* strcmp optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# include <sysdep.h>
+
+# define STRCMP __strcmp_sse2
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strcmp)
+#endif
+
+#include <sysdeps/x86_64/strcmp.S>
diff --git a/sysdeps/x86_64/multiarch/strcmp-sse42.S b/sysdeps/x86_64/multiarch/strcmp-sse42.S
index 70df84ae32..d3c07bd292 100644
--- a/sysdeps/x86_64/multiarch/strcmp-sse42.S
+++ b/sysdeps/x86_64/multiarch/strcmp-sse42.S
@@ -1,5 +1,5 @@
/* strcmp with SSE4.2
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -17,6 +17,40 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <sysdep.h>
+
+#ifndef STRCMP_SSE42
+# define STRCMP_SSE42 __strcmp_sse42
+#endif
+
+#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
+# include "locale-defines.h"
+#endif
+
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+/* Since the counter, %r11, is unsigned, we branch to strcmp_exitz
+ if the new counter > the old one or is 0. */
+# define UPDATE_STRNCMP_COUNTER \
+ /* calculate left number to compare */ \
+ lea -16(%rcx, %r11), %r9; \
+ cmp %r9, %r11; \
+ jb LABEL(strcmp_exitz); \
+ test %r9, %r9; \
+ je LABEL(strcmp_exitz); \
+ mov %r9, %r11
+#else
+# define UPDATE_STRNCMP_COUNTER
+#endif
+
+#ifdef USE_AVX
+# define SECTION avx
+# define GLABEL(l) l##_avx
+#else
+# define SECTION sse4.2
+# define GLABEL(l) l##_sse42
+#endif
+
+#define LABEL(l) .L##l
/* We use 0x1a:
_SIDD_SBYTE_OPS
@@ -92,6 +126,7 @@ END (GLABEL(__strncasecmp))
STRCMP_SSE42:
cfi_startproc
+ _CET_ENDBR
CALL_MCOUNT
/*
@@ -240,7 +275,7 @@ LABEL(bigger):
movslq (%r10, %r9,4), %r9
pcmpeqb %xmm1, D(%xmm0) /* Any null chars? */
lea (%r10, %r9), %r10
- jmp *%r10 /* jump to corresponding case */
+ _CET_NOTRACK jmp *%r10 /* jump to corresponding case */
/*
* The following cases will be handled by ashr_0
diff --git a/sysdeps/x86_64/multiarch/strcmp-sse4_2.S b/sysdeps/x86_64/multiarch/strcmp-sse4_2.S
new file mode 100644
index 0000000000..776e5e060f
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcmp-sse4_2.S
@@ -0,0 +1,21 @@
+/* strcmp optimized with SSE4.2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# include "strcmp-sse42.S"
+#endif
diff --git a/sysdeps/x86_64/multiarch/strcmp.S b/sysdeps/x86_64/multiarch/strcmp.S
deleted file mode 100644
index 0e4a113f61..0000000000
--- a/sysdeps/x86_64/multiarch/strcmp.S
+++ /dev/null
@@ -1,209 +0,0 @@
-/* Multiple versions of strcmp
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#ifdef USE_AS_STRNCMP
-/* Since the counter, %r11, is unsigned, we branch to strcmp_exitz
- if the new counter > the old one or is 0. */
-# define UPDATE_STRNCMP_COUNTER \
- /* calculate left number to compare */ \
- lea -16(%rcx, %r11), %r9; \
- cmp %r9, %r11; \
- jb LABEL(strcmp_exitz); \
- test %r9, %r9; \
- je LABEL(strcmp_exitz); \
- mov %r9, %r11
-
-# define STRCMP_SSE42 __strncmp_sse42
-# define STRCMP_SSSE3 __strncmp_ssse3
-# define STRCMP_SSE2 __strncmp_sse2
-# define __GI_STRCMP __GI_strncmp
-#elif defined USE_AS_STRCASECMP_L
-# include "locale-defines.h"
-
-# define UPDATE_STRNCMP_COUNTER
-
-# define STRCMP_AVX __strcasecmp_l_avx
-# define STRCMP_SSE42 __strcasecmp_l_sse42
-# define STRCMP_SSSE3 __strcasecmp_l_ssse3
-# define STRCMP_SSE2 __strcasecmp_l_sse2
-# define __GI_STRCMP __GI___strcasecmp_l
-#elif defined USE_AS_STRNCASECMP_L
-# include "locale-defines.h"
-
-/* Since the counter, %r11, is unsigned, we branch to strcmp_exitz
- if the new counter > the old one or is 0. */
-# define UPDATE_STRNCMP_COUNTER \
- /* calculate left number to compare */ \
- lea -16(%rcx, %r11), %r9; \
- cmp %r9, %r11; \
- jb LABEL(strcmp_exitz); \
- test %r9, %r9; \
- je LABEL(strcmp_exitz); \
- mov %r9, %r11
-
-# define STRCMP_AVX __strncasecmp_l_avx
-# define STRCMP_SSE42 __strncasecmp_l_sse42
-# define STRCMP_SSSE3 __strncasecmp_l_ssse3
-# define STRCMP_SSE2 __strncasecmp_l_sse2
-# define __GI_STRCMP __GI___strncasecmp_l
-#else
-# define USE_AS_STRCMP
-# define UPDATE_STRNCMP_COUNTER
-# ifndef STRCMP
-# define STRCMP strcmp
-# define STRCMP_SSE42 __strcmp_sse42
-# define STRCMP_SSSE3 __strcmp_ssse3
-# define STRCMP_SSE2 __strcmp_sse2
-# define __GI_STRCMP __GI_strcmp
-# endif
-#endif
-
-/* Define multiple versions only for the definition in libc. Don't
- define multiple versions for strncmp in static library since we
- need strncmp before the initialization happened. */
-#if (defined SHARED || !defined USE_AS_STRNCMP) && IS_IN (libc)
- .text
-ENTRY(STRCMP)
- .type STRCMP, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
-#ifdef USE_AS_STRCMP
- leaq __strcmp_sse2_unaligned(%rip), %rax
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 3f
-#else
- HAS_ARCH_FEATURE (Slow_SSE4_2)
- jnz 2f
- leaq STRCMP_SSE42(%rip), %rax
- HAS_CPU_FEATURE (SSE4_2)
- jnz 3f
-#endif
-2: leaq STRCMP_SSSE3(%rip), %rax
- HAS_CPU_FEATURE (SSSE3)
- jnz 3f
- leaq STRCMP_SSE2(%rip), %rax
-3: ret
-END(STRCMP)
-
-# ifdef USE_AS_STRCASECMP_L
-ENTRY(__strcasecmp)
- .type __strcasecmp, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __strcasecmp_avx(%rip), %rax
- HAS_ARCH_FEATURE (AVX_Usable)
- jnz 3f
- HAS_ARCH_FEATURE (Slow_SSE4_2)
- jnz 2f
- leaq __strcasecmp_sse42(%rip), %rax
- HAS_CPU_FEATURE (SSE4_2)
- jnz 3f
-2: leaq __strcasecmp_ssse3(%rip), %rax
- HAS_CPU_FEATURE (SSSE3)
- jnz 3f
- leaq __strcasecmp_sse2(%rip), %rax
-3: ret
-END(__strcasecmp)
-weak_alias (__strcasecmp, strcasecmp)
-# endif
-# ifdef USE_AS_STRNCASECMP_L
-ENTRY(__strncasecmp)
- .type __strncasecmp, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __strncasecmp_avx(%rip), %rax
- HAS_ARCH_FEATURE (AVX_Usable)
- jnz 3f
- HAS_ARCH_FEATURE (Slow_SSE4_2)
- jnz 2f
- leaq __strncasecmp_sse42(%rip), %rax
- HAS_CPU_FEATURE (SSE4_2)
- jnz 3f
-2: leaq __strncasecmp_ssse3(%rip), %rax
- HAS_CPU_FEATURE (SSSE3)
- jnz 3f
- leaq __strncasecmp_sse2(%rip), %rax
-3: ret
-END(__strncasecmp)
-weak_alias (__strncasecmp, strncasecmp)
-# endif
-
-# undef LABEL
-# define LABEL(l) .L##l##_sse42
-# define GLABEL(l) l##_sse42
-# define SECTION sse4.2
-# include "strcmp-sse42.S"
-
-
-# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
-# define LABEL(l) .L##l##_avx
-# define GLABEL(l) l##_avx
-# define USE_AVX 1
-# undef STRCMP_SSE42
-# define STRCMP_SSE42 STRCMP_AVX
-# define SECTION avx
-# include "strcmp-sse42.S"
-# endif
-
-
-# undef ENTRY
-# define ENTRY(name) \
- .type STRCMP_SSE2, @function; \
- .align 16; \
- .globl STRCMP_SSE2; \
- .hidden STRCMP_SSE2; \
- STRCMP_SSE2: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size STRCMP_SSE2, .-STRCMP_SSE2
-
-# ifdef USE_AS_STRCASECMP_L
-# define ENTRY2(name) \
- .type __strcasecmp_sse2, @function; \
- .align 16; \
- .globl __strcasecmp_sse2; \
- .hidden __strcasecmp_sse2; \
- __strcasecmp_sse2: cfi_startproc; \
- CALL_MCOUNT
-# define END2(name) \
- cfi_endproc; .size __strcasecmp_sse2, .-__strcasecmp_sse2
-# endif
-
-# ifdef USE_AS_STRNCASECMP_L
-# define ENTRY2(name) \
- .type __strncasecmp_sse2, @function; \
- .align 16; \
- .globl __strncasecmp_sse2; \
- .hidden __strncasecmp_sse2; \
- __strncasecmp_sse2: cfi_startproc; \
- CALL_MCOUNT
-# define END2(name) \
- cfi_endproc; .size __strncasecmp_sse2, .-__strncasecmp_sse2
-# endif
-
-# undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal strcmp calls through a PLT.
- The speedup we get from using SSE4.2 instruction is likely eaten away
- by the indirect call in the PLT. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_STRCMP; __GI_STRCMP = STRCMP_SSE2
-#endif
-
-#include "../strcmp.S"
diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c
new file mode 100644
index 0000000000..b903e418df
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcmp.c
@@ -0,0 +1,59 @@
+/* Multiple versions of strcmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcmp __redirect_strcmp
+# include <string.h>
+# undef strcmp
+
+# define SYMBOL_NAME strcmp
+# include <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (!CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX_Fast_Unaligned_Load))
+ return OPTIMIZE (avx2);
+
+ if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Unaligned_Load))
+ return OPTIMIZE (sse2_unaligned);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+ return OPTIMIZE (ssse3);
+
+ return OPTIMIZE (sse2);
+}
+
+libc_ifunc_redirected (__redirect_strcmp, strcmp, IFUNC_SELECTOR ());
+
+# ifdef SHARED
+__hidden_ver1 (strcmp, __GI_strcmp, __redirect_strcmp)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S b/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S
index caa74be2c2..72bf7e8586 100644
--- a/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S
+++ b/sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S
@@ -1,5 +1,5 @@
/* strcpy with SSE2 and unaligned load
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -33,7 +33,7 @@
lea TABLE(%rip), %r11; \
movslq (%r11, INDEX, SCALE), %rcx; \
lea (%r11, %rcx), %rcx; \
- jmp *%rcx
+ _CET_NOTRACK jmp *%rcx
# ifndef USE_AS_STRCAT
@@ -99,6 +99,8 @@ L(Unalign16Both):
sub %rcx, %rdi
# ifdef USE_AS_STRNCPY
add %rcx, %r8
+ sbb %rcx, %rcx
+ or %rcx, %r8
# endif
mov $16, %rcx
movdqa (%rsi, %rcx), %xmm1
diff --git a/sysdeps/x86_64/multiarch/strcpy-sse2.S b/sysdeps/x86_64/multiarch/strcpy-sse2.S
new file mode 100644
index 0000000000..70136017fa
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcpy-sse2.S
@@ -0,0 +1,28 @@
+/* strcpy optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+# define strcpy __strcpy_sse2
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strcpy)
+#endif
+
+#include <sysdeps/x86_64/strcpy.S>
diff --git a/sysdeps/x86_64/multiarch/strcpy-ssse3.S b/sysdeps/x86_64/multiarch/strcpy-ssse3.S
index 5bdb7671cf..9858d0c4d5 100644
--- a/sysdeps/x86_64/multiarch/strcpy-ssse3.S
+++ b/sysdeps/x86_64/multiarch/strcpy-ssse3.S
@@ -1,5 +1,5 @@
/* strcpy with SSSE3
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/multiarch/strcpy.S b/sysdeps/x86_64/multiarch/strcpy.S
deleted file mode 100644
index 024f6ef899..0000000000
--- a/sysdeps/x86_64/multiarch/strcpy.S
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Multiple versions of strcpy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if !defined (USE_AS_STPCPY) && !defined (USE_AS_STRNCPY)
-# ifndef STRCPY
-# define STRCPY strcpy
-# endif
-#endif
-
-#ifdef USE_AS_STPCPY
-# ifdef USE_AS_STRNCPY
-# define STRCPY_SSSE3 __stpncpy_ssse3
-# define STRCPY_SSE2 __stpncpy_sse2
-# define STRCPY_SSE2_UNALIGNED __stpncpy_sse2_unaligned
-# define __GI_STRCPY __GI_stpncpy
-# define __GI___STRCPY __GI___stpncpy
-# else
-# define STRCPY_SSSE3 __stpcpy_ssse3
-# define STRCPY_SSE2 __stpcpy_sse2
-# define STRCPY_SSE2_UNALIGNED __stpcpy_sse2_unaligned
-# define __GI_STRCPY __GI_stpcpy
-# define __GI___STRCPY __GI___stpcpy
-# endif
-#else
-# ifdef USE_AS_STRNCPY
-# define STRCPY_SSSE3 __strncpy_ssse3
-# define STRCPY_SSE2 __strncpy_sse2
-# define STRCPY_SSE2_UNALIGNED __strncpy_sse2_unaligned
-# define __GI_STRCPY __GI_strncpy
-# else
-# define STRCPY_SSSE3 __strcpy_ssse3
-# define STRCPY_SSE2 __strcpy_sse2
-# define STRCPY_SSE2_UNALIGNED __strcpy_sse2_unaligned
-# define __GI_STRCPY __GI_strcpy
-# endif
-#endif
-
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
- .text
-ENTRY(STRCPY)
- .type STRCPY, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq STRCPY_SSE2_UNALIGNED(%rip), %rax
- HAS_ARCH_FEATURE (Fast_Unaligned_Load)
- jnz 2f
- leaq STRCPY_SSE2(%rip), %rax
- HAS_CPU_FEATURE (SSSE3)
- jz 2f
- leaq STRCPY_SSSE3(%rip), %rax
-2: ret
-END(STRCPY)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type STRCPY_SSE2, @function; \
- .align 16; \
- .globl STRCPY_SSE2; \
- .hidden STRCPY_SSE2; \
- STRCPY_SSE2: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size STRCPY_SSE2, .-STRCPY_SSE2
-# undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal strcpy calls through a PLT.
- The speedup we get from using SSSE3 instruction is likely eaten away
- by the indirect call in the PLT. */
-# define libc_hidden_builtin_def(name) \
- .globl __GI_STRCPY; __GI_STRCPY = STRCPY_SSE2
-# undef libc_hidden_def
-# define libc_hidden_def(name) \
- .globl __GI___STRCPY; __GI___STRCPY = STRCPY_SSE2
-#endif
-
-#ifndef USE_AS_STRNCPY
-#include "../strcpy.S"
-#endif
diff --git a/sysdeps/x86_64/multiarch/strcpy.c b/sysdeps/x86_64/multiarch/strcpy.c
new file mode 100644
index 0000000000..12e0e3ffe2
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcpy.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strcpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcpy __redirect_strcpy
+# include <string.h>
+# undef strcpy
+
+# define SYMBOL_NAME strcpy
+# include "ifunc-unaligned-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strcpy, strcpy, IFUNC_SELECTOR ());
+
+# ifdef SHARED
+__hidden_ver1 (strcpy, __GI_strcpy, __redirect_strcpy)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strcspn-c.c b/sysdeps/x86_64/multiarch/strcspn-c.c
index 91b804ddd6..857af10486 100644
--- a/sysdeps/x86_64/multiarch/strcspn-c.c
+++ b/sysdeps/x86_64/multiarch/strcspn-c.c
@@ -1,5 +1,5 @@
/* strcspn with SSE4.2 intrinsics
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -70,7 +70,7 @@ char *
#else
size_t
#endif
-STRCSPN_SSE2 (const char *, const char *);
+STRCSPN_SSE2 (const char *, const char *) attribute_hidden;
#ifdef USE_AS_STRPBRK
diff --git a/sysdeps/x86_64/multiarch/strcspn-sse2.S b/sysdeps/x86_64/multiarch/strcspn-sse2.S
new file mode 100644
index 0000000000..8a0c69d7f5
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcspn-sse2.S
@@ -0,0 +1,28 @@
+/* strcspn optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+# define strcspn __strcspn_sse2
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strcspn)
+#endif
+
+#include <sysdeps/x86_64/strcspn.S>
diff --git a/sysdeps/x86_64/multiarch/strcspn.S b/sysdeps/x86_64/multiarch/strcspn.S
deleted file mode 100644
index 8e7ff1c663..0000000000
--- a/sysdeps/x86_64/multiarch/strcspn.S
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Multiple versions of strcspn
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-#include <sysdep.h>
-#include <init-arch.h>
-
-#ifdef USE_AS_STRPBRK
-#define STRCSPN_SSE42 __strpbrk_sse42
-#define STRCSPN_SSE2 __strpbrk_sse2
-#define __GI_STRCSPN __GI_strpbrk
-#else
-#ifndef STRCSPN
-#define STRCSPN strcspn
-#define STRCSPN_SSE42 __strcspn_sse42
-#define STRCSPN_SSE2 __strcspn_sse2
-#define __GI_STRCSPN __GI_strcspn
-#endif
-#endif
-
-/* Define multiple versions only for the definition in libc. Don't
- define multiple versions for strpbrk in static library since we
- need strpbrk before the initialization happened. */
-#if (defined SHARED || !defined USE_AS_STRPBRK) && IS_IN (libc)
- .text
-ENTRY(STRCSPN)
- .type STRCSPN, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq STRCSPN_SSE2(%rip), %rax
- HAS_CPU_FEATURE (SSE4_2)
- jz 2f
- leaq STRCSPN_SSE42(%rip), %rax
-2: ret
-END(STRCSPN)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type STRCSPN_SSE2, @function; \
- .globl STRCSPN_SSE2; \
- .align 16; \
- STRCSPN_SSE2: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size STRCSPN_SSE2, .-STRCSPN_SSE2
-#endif
-
-#ifdef USE_AS_STRPBRK
-#include "../strpbrk.S"
-#else
-#include "../strcspn.S"
-#endif
diff --git a/sysdeps/x86_64/multiarch/strcspn.c b/sysdeps/x86_64/multiarch/strcspn.c
new file mode 100644
index 0000000000..9712e8410c
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strcspn.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strcspn.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strcspn __redirect_strcspn
+# include <string.h>
+# undef strcspn
+
+# define SYMBOL_NAME strcspn
+# include "ifunc-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strcspn, strcspn, IFUNC_SELECTOR ());
+
+# ifdef SHARED
+__hidden_ver1 (strcspn, __GI_strcspn, __redirect_strcspn)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strlen-avx2.S b/sysdeps/x86_64/multiarch/strlen-avx2.S
new file mode 100644
index 0000000000..fb2418cddc
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strlen-avx2.S
@@ -0,0 +1,393 @@
+/* strlen/strnlen/wcslen/wcsnlen optimized with AVX2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+
+# ifndef STRLEN
+# define STRLEN __strlen_avx2
+# endif
+
+# ifdef USE_AS_WCSLEN
+# define VPCMPEQ vpcmpeqd
+# define VPMINU vpminud
+# else
+# define VPCMPEQ vpcmpeqb
+# define VPMINU vpminub
+# endif
+
+# ifndef VZEROUPPER
+# define VZEROUPPER vzeroupper
+# endif
+
+# define VEC_SIZE 32
+
+ .section .text.avx,"ax",@progbits
+ENTRY (STRLEN)
+# ifdef USE_AS_STRNLEN
+ /* Check for zero length. */
+ testq %rsi, %rsi
+ jz L(zero)
+# ifdef USE_AS_WCSLEN
+ shl $2, %rsi
+# endif
+ movq %rsi, %r8
+# endif
+ movl %edi, %ecx
+ movq %rdi, %rdx
+ vpxor %xmm0, %xmm0, %xmm0
+
+ /* Check if we may cross page boundary with one vector load. */
+ andl $(2 * VEC_SIZE - 1), %ecx
+ cmpl $VEC_SIZE, %ecx
+ ja L(cros_page_boundary)
+
+ /* Check the first VEC_SIZE bytes. */
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+
+# ifdef USE_AS_STRNLEN
+ jnz L(first_vec_x0_check)
+ /* Adjust length and check the end of data. */
+ subq $VEC_SIZE, %rsi
+ jbe L(max)
+# else
+ jnz L(first_vec_x0)
+# endif
+
+ /* Align data for aligned loads in the loop. */
+ addq $VEC_SIZE, %rdi
+ andl $(VEC_SIZE - 1), %ecx
+ andq $-VEC_SIZE, %rdi
+
+# ifdef USE_AS_STRNLEN
+ /* Adjust length. */
+ addq %rcx, %rsi
+
+ subq $(VEC_SIZE * 4), %rsi
+ jbe L(last_4x_vec_or_less)
+# endif
+ jmp L(more_4x_vec)
+
+ .p2align 4
+L(cros_page_boundary):
+ andl $(VEC_SIZE - 1), %ecx
+ andq $-VEC_SIZE, %rdi
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ /* Remove the leading bytes. */
+ sarl %cl, %eax
+ testl %eax, %eax
+ jz L(aligned_more)
+ tzcntl %eax, %eax
+# ifdef USE_AS_STRNLEN
+ /* Check the end of data. */
+ cmpq %rax, %rsi
+ jbe L(max)
+# endif
+ addq %rdi, %rax
+ addq %rcx, %rax
+ subq %rdx, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(aligned_more):
+# ifdef USE_AS_STRNLEN
+ /* "rcx" is less than VEC_SIZE. Calculate "rdx + rcx - VEC_SIZE"
+ with "rdx - (VEC_SIZE - rcx)" instead of "(rdx + rcx) - VEC_SIZE"
+ to void possible addition overflow. */
+ negq %rcx
+ addq $VEC_SIZE, %rcx
+
+ /* Check the end of data. */
+ subq %rcx, %rsi
+ jbe L(max)
+# endif
+
+ addq $VEC_SIZE, %rdi
+
+# ifdef USE_AS_STRNLEN
+ subq $(VEC_SIZE * 4), %rsi
+ jbe L(last_4x_vec_or_less)
+# endif
+
+L(more_4x_vec):
+ /* Check the first 4 * VEC_SIZE. Only one VEC_SIZE at a time
+ since data is only aligned to VEC_SIZE. */
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x0)
+
+ VPCMPEQ VEC_SIZE(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x1)
+
+ VPCMPEQ (VEC_SIZE * 2)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x2)
+
+ VPCMPEQ (VEC_SIZE * 3)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x3)
+
+ addq $(VEC_SIZE * 4), %rdi
+
+# ifdef USE_AS_STRNLEN
+ subq $(VEC_SIZE * 4), %rsi
+ jbe L(last_4x_vec_or_less)
+# endif
+
+ /* Align data to 4 * VEC_SIZE. */
+ movq %rdi, %rcx
+ andl $(4 * VEC_SIZE - 1), %ecx
+ andq $-(4 * VEC_SIZE), %rdi
+
+# ifdef USE_AS_STRNLEN
+ /* Adjust length. */
+ addq %rcx, %rsi
+# endif
+
+ .p2align 4
+L(loop_4x_vec):
+ /* Compare 4 * VEC at a time forward. */
+ vmovdqa (%rdi), %ymm1
+ vmovdqa VEC_SIZE(%rdi), %ymm2
+ vmovdqa (VEC_SIZE * 2)(%rdi), %ymm3
+ vmovdqa (VEC_SIZE * 3)(%rdi), %ymm4
+ VPMINU %ymm1, %ymm2, %ymm5
+ VPMINU %ymm3, %ymm4, %ymm6
+ VPMINU %ymm5, %ymm6, %ymm5
+
+ VPCMPEQ %ymm5, %ymm0, %ymm5
+ vpmovmskb %ymm5, %eax
+ testl %eax, %eax
+ jnz L(4x_vec_end)
+
+ addq $(VEC_SIZE * 4), %rdi
+
+# ifndef USE_AS_STRNLEN
+ jmp L(loop_4x_vec)
+# else
+ subq $(VEC_SIZE * 4), %rsi
+ ja L(loop_4x_vec)
+
+L(last_4x_vec_or_less):
+ /* Less than 4 * VEC and aligned to VEC_SIZE. */
+ addl $(VEC_SIZE * 2), %esi
+ jle L(last_2x_vec)
+
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x0)
+
+ VPCMPEQ VEC_SIZE(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x1)
+
+ VPCMPEQ (VEC_SIZE * 2)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+
+ jnz L(first_vec_x2_check)
+ subl $VEC_SIZE, %esi
+ jle L(max)
+
+ VPCMPEQ (VEC_SIZE * 3)(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+
+ jnz L(first_vec_x3_check)
+ movq %r8, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(last_2x_vec):
+ addl $(VEC_SIZE * 2), %esi
+ VPCMPEQ (%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+
+ jnz L(first_vec_x0_check)
+ subl $VEC_SIZE, %esi
+ jle L(max)
+
+ VPCMPEQ VEC_SIZE(%rdi), %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x1_check)
+ movq %r8, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x0_check):
+ tzcntl %eax, %eax
+ /* Check the end of data. */
+ cmpq %rax, %rsi
+ jbe L(max)
+ addq %rdi, %rax
+ subq %rdx, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x1_check):
+ tzcntl %eax, %eax
+ /* Check the end of data. */
+ cmpq %rax, %rsi
+ jbe L(max)
+ addq $VEC_SIZE, %rax
+ addq %rdi, %rax
+ subq %rdx, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x2_check):
+ tzcntl %eax, %eax
+ /* Check the end of data. */
+ cmpq %rax, %rsi
+ jbe L(max)
+ addq $(VEC_SIZE * 2), %rax
+ addq %rdi, %rax
+ subq %rdx, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x3_check):
+ tzcntl %eax, %eax
+ /* Check the end of data. */
+ cmpq %rax, %rsi
+ jbe L(max)
+ addq $(VEC_SIZE * 3), %rax
+ addq %rdi, %rax
+ subq %rdx, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(max):
+ movq %r8, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(zero):
+ xorl %eax, %eax
+ ret
+# endif
+
+ .p2align 4
+L(first_vec_x0):
+ tzcntl %eax, %eax
+ addq %rdi, %rax
+ subq %rdx, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x1):
+ tzcntl %eax, %eax
+ addq $VEC_SIZE, %rax
+ addq %rdi, %rax
+ subq %rdx, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(first_vec_x2):
+ tzcntl %eax, %eax
+ addq $(VEC_SIZE * 2), %rax
+ addq %rdi, %rax
+ subq %rdx, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(4x_vec_end):
+ VPCMPEQ %ymm1, %ymm0, %ymm1
+ vpmovmskb %ymm1, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x0)
+ VPCMPEQ %ymm2, %ymm0, %ymm2
+ vpmovmskb %ymm2, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x1)
+ VPCMPEQ %ymm3, %ymm0, %ymm3
+ vpmovmskb %ymm3, %eax
+ testl %eax, %eax
+ jnz L(first_vec_x2)
+ VPCMPEQ %ymm4, %ymm0, %ymm4
+ vpmovmskb %ymm4, %eax
+L(first_vec_x3):
+ tzcntl %eax, %eax
+ addq $(VEC_SIZE * 3), %rax
+ addq %rdi, %rax
+ subq %rdx, %rax
+# ifdef USE_AS_WCSLEN
+ shrq $2, %rax
+# endif
+ VZEROUPPER
+ ret
+
+END (STRLEN)
+#endif
diff --git a/sysdeps/x86_64/multiarch/strlen-sse2.S b/sysdeps/x86_64/multiarch/strlen-sse2.S
new file mode 100644
index 0000000000..7bc57b8d0f
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strlen-sse2.S
@@ -0,0 +1,23 @@
+/* strlen optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strlen __strlen_sse2
+#endif
+
+#include "../strlen.S"
diff --git a/sysdeps/x86_64/multiarch/strlen.c b/sysdeps/x86_64/multiarch/strlen.c
new file mode 100644
index 0000000000..1758d22b8f
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strlen.c
@@ -0,0 +1,34 @@
+/* Multiple versions of strlen.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strlen __redirect_strlen
+# include <string.h>
+# undef strlen
+
+# define SYMBOL_NAME strlen
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_strlen, strlen, IFUNC_SELECTOR ());
+# ifdef SHARED
+__hidden_ver1 (strlen, __GI_strlen, __redirect_strlen)
+ __attribute__((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strncase.c b/sysdeps/x86_64/multiarch/strncase.c
new file mode 100644
index 0000000000..798966cf3e
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncase.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strncasecmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strncasecmp __redirect_strncasecmp
+# define __strncasecmp __redirect___strncasecmp
+# include <string.h>
+# undef strncasecmp
+# undef __strncasecmp
+
+# define SYMBOL_NAME strncasecmp
+# include "ifunc-strcasecmp.h"
+
+libc_ifunc_redirected (__redirect_strncasecmp, __strncasecmp,
+ IFUNC_SELECTOR ());
+
+weak_alias (__strncasecmp, strncasecmp)
+#endif
diff --git a/sysdeps/x86_64/multiarch/strncase_l-avx.S b/sysdeps/x86_64/multiarch/strncase_l-avx.S
new file mode 100644
index 0000000000..0c4e525bd4
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncase_l-avx.S
@@ -0,0 +1,22 @@
+/* strncasecmp_l optimized with AVX.
+ Copyright (C) 2017-2018 Free Software 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 STRCMP_SSE42 __strncasecmp_l_avx
+#define USE_AVX 1
+#define USE_AS_STRNCASECMP_L
+#include "strcmp-sse42.S"
diff --git a/sysdeps/x86_64/multiarch/strncase_l-sse2.S b/sysdeps/x86_64/multiarch/strncase_l-sse2.S
new file mode 100644
index 0000000000..e7841334b7
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncase_l-sse2.S
@@ -0,0 +1,23 @@
+/* strncasecmp_l optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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 STRCMP __strncasecmp_l_sse2
+#define NO_NOLOCALE_ALIAS
+#define USE_AS_STRNCASECMP_L
+#define __strncasecmp __strncasecmp_sse2
+#include <sysdeps/x86_64/strcmp.S>
diff --git a/sysdeps/x86_64/multiarch/strncase_l-sse4_2.S b/sysdeps/x86_64/multiarch/strncase_l-sse4_2.S
new file mode 100644
index 0000000000..d2ea88c4ce
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncase_l-sse4_2.S
@@ -0,0 +1,21 @@
+/* strncasecmp_l optimized with SSE4.2.
+ Copyright (C) 2017-2018 Free Software 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 STRCMP_SSE42 __strncasecmp_l_sse42
+#define USE_AS_STRNCASECMP_L
+#include "strcmp-sse42.S"
diff --git a/sysdeps/x86_64/multiarch/strncase_l.S b/sysdeps/x86_64/multiarch/strncase_l.S
deleted file mode 100644
index 9c0149788e..0000000000
--- a/sysdeps/x86_64/multiarch/strncase_l.S
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Multiple versions of strncasecmp and strncasecmp_l
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCMP __strncasecmp_l
-#define USE_AS_STRNCASECMP_L
-#include "strcmp.S"
-
-weak_alias (__strncasecmp_l, strncasecmp_l)
-libc_hidden_def (strncasecmp_l)
diff --git a/sysdeps/x86_64/multiarch/strncase_l.c b/sysdeps/x86_64/multiarch/strncase_l.c
new file mode 100644
index 0000000000..97631cf401
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncase_l.c
@@ -0,0 +1,40 @@
+/* Multiple versions of strncasecmp_l.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strncasecmp_l __redirect_strncasecmp_l
+# define __strncasecmp_l __redirect___strncasecmp_l
+# include <string.h>
+# undef strncasecmp_l
+# undef __strncasecmp_l
+
+# define SYMBOL_NAME strncasecmp_l
+# include "ifunc-strcasecmp.h"
+
+libc_ifunc_redirected (__redirect_strncasecmp_l, __strncasecmp_l,
+ IFUNC_SELECTOR ());
+
+weak_alias (__strncasecmp_l, strncasecmp_l)
+# ifdef SHARED
+__hidden_ver1 (__strncasecmp_l, __GI___strncasecmp_l,
+ __redirect___strncasecmp_l)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strncat-c.c b/sysdeps/x86_64/multiarch/strncat-c.c
index a3cdbff689..93a7fab7ea 100644
--- a/sysdeps/x86_64/multiarch/strncat-c.c
+++ b/sysdeps/x86_64/multiarch/strncat-c.c
@@ -1,8 +1,2 @@
#define STRNCAT __strncat_sse2
-#ifdef SHARED
-#undef libc_hidden_def
-#define libc_hidden_def(name) \
- __hidden_ver1 (__strncat_sse2, __GI___strncat, __strncat_sse2);
-#endif
-
-#include "string/strncat.c"
+#include <string/strncat.c>
diff --git a/sysdeps/x86_64/multiarch/strncat.S b/sysdeps/x86_64/multiarch/strncat.S
deleted file mode 100644
index 5c1bf41453..0000000000
--- a/sysdeps/x86_64/multiarch/strncat.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strncat
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCAT strncat
-#define USE_AS_STRNCAT
-#include "strcat.S"
diff --git a/sysdeps/x86_64/multiarch/strncat.c b/sysdeps/x86_64/multiarch/strncat.c
new file mode 100644
index 0000000000..841c165565
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncat.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strncat.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strncat __redirect_strncat
+# include <string.h>
+# undef strncat
+
+# define SYMBOL_NAME strncat
+# include "ifunc-unaligned-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strncat, strncat, IFUNC_SELECTOR ());
+strong_alias (strncat, __strncat);
+# ifdef SHARED
+__hidden_ver1 (strncat, __GI___strncat, __redirect_strncat)
+ __attribute__((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strncmp-avx2.S b/sysdeps/x86_64/multiarch/strncmp-avx2.S
new file mode 100644
index 0000000000..1678bcc235
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncmp-avx2.S
@@ -0,0 +1,3 @@
+#define STRCMP __strncmp_avx2
+#define USE_AS_STRNCMP 1
+#include "strcmp-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/strncmp-sse2.S b/sysdeps/x86_64/multiarch/strncmp-sse2.S
new file mode 100644
index 0000000000..a5ecb82b13
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncmp-sse2.S
@@ -0,0 +1,30 @@
+/* strcmp optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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>
+
+#if IS_IN (libc)
+# define STRCMP __strncmp_sse2
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strcmp)
+#else
+# define STRCMP strncmp
+#endif
+
+#define USE_AS_STRNCMP
+#include <sysdeps/x86_64/strcmp.S>
diff --git a/sysdeps/x86_64/multiarch/strncmp-sse4_2.S b/sysdeps/x86_64/multiarch/strncmp-sse4_2.S
new file mode 100644
index 0000000000..b859c1eb74
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncmp-sse4_2.S
@@ -0,0 +1,21 @@
+/* strncmp optimized with SSE4.2.
+ Copyright (C) 2017-2018 Free Software 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 STRCMP_SSE42 __strncmp_sse42
+#define USE_AS_STRNCMP
+#include "strcmp-sse42.S"
diff --git a/sysdeps/x86_64/multiarch/strncmp-ssse3.S b/sysdeps/x86_64/multiarch/strncmp-ssse3.S
index 96380a46be..fa43484b54 100644
--- a/sysdeps/x86_64/multiarch/strncmp-ssse3.S
+++ b/sysdeps/x86_64/multiarch/strncmp-ssse3.S
@@ -1,6 +1,28 @@
-#ifdef SHARED
-# define USE_SSSE3 1
-# define STRCMP __strncmp_ssse3
-# define USE_AS_STRNCMP
-# include "../strcmp.S"
-#endif
+/* strcmp optimized with SSSE3.
+ Copyright (C) 2017-2018 Free Software 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 STRCMP __strncmp_ssse3
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(strcmp)
+
+#define USE_SSSE3 1
+#define USE_AS_STRNCMP
+#include <sysdeps/x86_64/strcmp.S>
diff --git a/sysdeps/x86_64/multiarch/strncmp.S b/sysdeps/x86_64/multiarch/strncmp.S
deleted file mode 100644
index fd5eb1397c..0000000000
--- a/sysdeps/x86_64/multiarch/strncmp.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strncmp
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCMP strncmp
-#define USE_AS_STRNCMP
-#include "strcmp.S"
diff --git a/sysdeps/x86_64/multiarch/strncmp.c b/sysdeps/x86_64/multiarch/strncmp.c
new file mode 100644
index 0000000000..02b6d0b6f5
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncmp.c
@@ -0,0 +1,60 @@
+/* Multiple versions of strncmp.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strncmp __redirect_strncmp
+# include <string.h>
+# undef strncmp
+
+# define SYMBOL_NAME strncmp
+# include <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (!CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX_Fast_Unaligned_Load))
+ return OPTIMIZE (avx2);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE4_2)
+ && !CPU_FEATURES_ARCH_P (cpu_features, Slow_SSE4_2))
+ return OPTIMIZE (sse42);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+ return OPTIMIZE (ssse3);
+
+ return OPTIMIZE (sse2);
+}
+
+libc_ifunc_redirected (__redirect_strncmp, strncmp, IFUNC_SELECTOR ());
+
+# ifdef SHARED
+__hidden_ver1 (strncmp, __GI_strncmp, __redirect_strncmp)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strncpy-c.c b/sysdeps/x86_64/multiarch/strncpy-c.c
index 296c32cb5d..57c45ac7ab 100644
--- a/sysdeps/x86_64/multiarch/strncpy-c.c
+++ b/sysdeps/x86_64/multiarch/strncpy-c.c
@@ -1,8 +1,5 @@
#define STRNCPY __strncpy_sse2
-#ifdef SHARED
#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name) \
- __hidden_ver1 (__strncpy_sse2, __GI_strncpy, __strncpy_sse2);
-#endif
+#define libc_hidden_builtin_def(strncpy)
-#include "strncpy.c"
+#include <string/strncpy.c>
diff --git a/sysdeps/x86_64/multiarch/strncpy.S b/sysdeps/x86_64/multiarch/strncpy.S
deleted file mode 100644
index 6d87a0ba35..0000000000
--- a/sysdeps/x86_64/multiarch/strncpy.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strncpy
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCPY strncpy
-#define USE_AS_STRNCPY
-#include "strcpy.S"
diff --git a/sysdeps/x86_64/multiarch/strncpy.c b/sysdeps/x86_64/multiarch/strncpy.c
new file mode 100644
index 0000000000..3c3de8b18e
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strncpy.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strncpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strncpy __redirect_strncpy
+# include <string.h>
+# undef strncpy
+
+# define SYMBOL_NAME strncpy
+# include "ifunc-unaligned-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strncpy, strncpy, IFUNC_SELECTOR ());
+
+# ifdef SHARED
+__hidden_ver1 (strncpy, __GI_strncpy, __redirect_strncpy)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strnlen-avx2.S b/sysdeps/x86_64/multiarch/strnlen-avx2.S
new file mode 100644
index 0000000000..c4062b22f7
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strnlen-avx2.S
@@ -0,0 +1,4 @@
+#define STRLEN __strnlen_avx2
+#define USE_AS_STRNLEN 1
+
+#include "strlen-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/strnlen-sse2.S b/sysdeps/x86_64/multiarch/strnlen-sse2.S
new file mode 100644
index 0000000000..41f33f6f6f
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strnlen-sse2.S
@@ -0,0 +1,28 @@
+/* strnlen optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define __strnlen __strnlen_sse2
+
+# undef weak_alias
+# define weak_alias(__strnlen, strnlen)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strnlen)
+#endif
+
+#include "../strnlen.S"
diff --git a/sysdeps/x86_64/multiarch/strnlen.c b/sysdeps/x86_64/multiarch/strnlen.c
new file mode 100644
index 0000000000..3ab94ce230
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strnlen.c
@@ -0,0 +1,39 @@
+/* Multiple versions of strnlen.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strnlen __redirect_strnlen
+# define __strnlen __redirect___strnlen
+# include <string.h>
+# undef __strnlen
+# undef strnlen
+
+# define SYMBOL_NAME strnlen
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_strnlen, __strnlen, IFUNC_SELECTOR ());
+weak_alias (__strnlen, strnlen);
+# ifdef SHARED
+__hidden_ver1 (__strnlen, __GI___strnlen, __redirect___strnlen)
+ __attribute__((visibility ("hidden")));
+__hidden_ver1 (strnlen, __GI_strnlen, __redirect_strnlen)
+ __attribute__((weak, visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strpbrk-c.c b/sysdeps/x86_64/multiarch/strpbrk-c.c
index bbf5c49d89..c58dcb5605 100644
--- a/sysdeps/x86_64/multiarch/strpbrk-c.c
+++ b/sysdeps/x86_64/multiarch/strpbrk-c.c
@@ -1,8 +1,4 @@
-/* Don't define multiple versions for strpbrk in static library since we
- need strpbrk before the initialization happened. */
-#ifdef SHARED
-# define USE_AS_STRPBRK
-# define STRCSPN_SSE2 __strpbrk_sse2
-# define STRCSPN_SSE42 __strpbrk_sse42
-# include "strcspn-c.c"
-#endif
+#define USE_AS_STRPBRK
+#define STRCSPN_SSE2 __strpbrk_sse2
+#define STRCSPN_SSE42 __strpbrk_sse42
+#include "strcspn-c.c"
diff --git a/sysdeps/x86_64/multiarch/strpbrk-sse2.S b/sysdeps/x86_64/multiarch/strpbrk-sse2.S
new file mode 100644
index 0000000000..3c6a74db29
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strpbrk-sse2.S
@@ -0,0 +1,29 @@
+/* strpbrk optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+# define strcspn __strpbrk_sse2
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strpbrk)
+#endif
+
+#define USE_AS_STRPBRK
+#include <sysdeps/x86_64/strcspn.S>
diff --git a/sysdeps/x86_64/multiarch/strpbrk.S b/sysdeps/x86_64/multiarch/strpbrk.S
deleted file mode 100644
index 7201d6376f..0000000000
--- a/sysdeps/x86_64/multiarch/strpbrk.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strpbrk
- All versions must be listed in ifunc-impl-list.c. */
-#define STRCSPN strpbrk
-#define USE_AS_STRPBRK
-#include "strcspn.S"
diff --git a/sysdeps/x86_64/multiarch/strpbrk.c b/sysdeps/x86_64/multiarch/strpbrk.c
new file mode 100644
index 0000000000..a0d435a504
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strpbrk.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strpbrk.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strpbrk __redirect_strpbrk
+# include <string.h>
+# undef strpbrk
+
+# define SYMBOL_NAME strpbrk
+# include "ifunc-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strpbrk, strpbrk, IFUNC_SELECTOR ());
+
+# ifdef SHARED
+__hidden_ver1 (strpbrk, __GI_strpbrk, __redirect_strpbrk)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strrchr-avx2.S b/sysdeps/x86_64/multiarch/strrchr-avx2.S
new file mode 100644
index 0000000000..4381e6ab3e
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strrchr-avx2.S
@@ -0,0 +1,235 @@
+/* strrchr/wcsrchr optimized with AVX2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+
+# ifndef STRRCHR
+# define STRRCHR __strrchr_avx2
+# endif
+
+# ifdef USE_AS_WCSRCHR
+# define VPBROADCAST vpbroadcastd
+# define VPCMPEQ vpcmpeqd
+# else
+# define VPBROADCAST vpbroadcastb
+# define VPCMPEQ vpcmpeqb
+# endif
+
+# ifndef VZEROUPPER
+# define VZEROUPPER vzeroupper
+# endif
+
+# define VEC_SIZE 32
+
+ .section .text.avx,"ax",@progbits
+ENTRY (STRRCHR)
+ movd %esi, %xmm4
+ movl %edi, %ecx
+ /* Broadcast CHAR to YMM4. */
+ VPBROADCAST %xmm4, %ymm4
+ vpxor %ymm0, %ymm0, %ymm0
+
+ /* Check if we may cross page boundary with one vector load. */
+ andl $(2 * VEC_SIZE - 1), %ecx
+ cmpl $VEC_SIZE, %ecx
+ ja L(cros_page_boundary)
+
+ vmovdqu (%rdi), %ymm1
+ VPCMPEQ %ymm1, %ymm0, %ymm2
+ VPCMPEQ %ymm1, %ymm4, %ymm3
+ vpmovmskb %ymm2, %ecx
+ vpmovmskb %ymm3, %eax
+ addq $VEC_SIZE, %rdi
+
+ testl %eax, %eax
+ jnz L(first_vec)
+
+ testl %ecx, %ecx
+ jnz L(return_null)
+
+ andq $-VEC_SIZE, %rdi
+ xorl %edx, %edx
+ jmp L(aligned_loop)
+
+ .p2align 4
+L(first_vec):
+ /* Check if there is a nul CHAR. */
+ testl %ecx, %ecx
+ jnz L(char_and_nul_in_first_vec)
+
+ /* Remember the match and keep searching. */
+ movl %eax, %edx
+ movq %rdi, %rsi
+ andq $-VEC_SIZE, %rdi
+ jmp L(aligned_loop)
+
+ .p2align 4
+L(cros_page_boundary):
+ andl $(VEC_SIZE - 1), %ecx
+ andq $-VEC_SIZE, %rdi
+ vmovdqa (%rdi), %ymm1
+ VPCMPEQ %ymm1, %ymm0, %ymm2
+ VPCMPEQ %ymm1, %ymm4, %ymm3
+ vpmovmskb %ymm2, %edx
+ vpmovmskb %ymm3, %eax
+ shrl %cl, %edx
+ shrl %cl, %eax
+ addq $VEC_SIZE, %rdi
+
+ /* Check if there is a CHAR. */
+ testl %eax, %eax
+ jnz L(found_char)
+
+ testl %edx, %edx
+ jnz L(return_null)
+
+ jmp L(aligned_loop)
+
+ .p2align 4
+L(found_char):
+ testl %edx, %edx
+ jnz L(char_and_nul)
+
+ /* Remember the match and keep searching. */
+ movl %eax, %edx
+ leaq (%rdi, %rcx), %rsi
+
+ .p2align 4
+L(aligned_loop):
+ vmovdqa (%rdi), %ymm1
+ VPCMPEQ %ymm1, %ymm0, %ymm2
+ addq $VEC_SIZE, %rdi
+ VPCMPEQ %ymm1, %ymm4, %ymm3
+ vpmovmskb %ymm2, %ecx
+ vpmovmskb %ymm3, %eax
+ orl %eax, %ecx
+ jnz L(char_nor_null)
+
+ vmovdqa (%rdi), %ymm1
+ VPCMPEQ %ymm1, %ymm0, %ymm2
+ add $VEC_SIZE, %rdi
+ VPCMPEQ %ymm1, %ymm4, %ymm3
+ vpmovmskb %ymm2, %ecx
+ vpmovmskb %ymm3, %eax
+ orl %eax, %ecx
+ jnz L(char_nor_null)
+
+ vmovdqa (%rdi), %ymm1
+ VPCMPEQ %ymm1, %ymm0, %ymm2
+ addq $VEC_SIZE, %rdi
+ VPCMPEQ %ymm1, %ymm4, %ymm3
+ vpmovmskb %ymm2, %ecx
+ vpmovmskb %ymm3, %eax
+ orl %eax, %ecx
+ jnz L(char_nor_null)
+
+ vmovdqa (%rdi), %ymm1
+ VPCMPEQ %ymm1, %ymm0, %ymm2
+ addq $VEC_SIZE, %rdi
+ VPCMPEQ %ymm1, %ymm4, %ymm3
+ vpmovmskb %ymm2, %ecx
+ vpmovmskb %ymm3, %eax
+ orl %eax, %ecx
+ jz L(aligned_loop)
+
+ .p2align 4
+L(char_nor_null):
+ /* Find a CHAR or a nul CHAR in a loop. */
+ testl %eax, %eax
+ jnz L(match)
+L(return_value):
+ testl %edx, %edx
+ jz L(return_null)
+ movl %edx, %eax
+ movq %rsi, %rdi
+
+# ifdef USE_AS_WCSRCHR
+ /* Keep the first bit for each matching CHAR for bsr. */
+ andl $0x11111111, %eax
+# endif
+ bsrl %eax, %eax
+ leaq -VEC_SIZE(%rdi, %rax), %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(match):
+ /* Find a CHAR. Check if there is a nul CHAR. */
+ vpmovmskb %ymm2, %ecx
+ testl %ecx, %ecx
+ jnz L(find_nul)
+
+ /* Remember the match and keep searching. */
+ movl %eax, %edx
+ movq %rdi, %rsi
+ jmp L(aligned_loop)
+
+ .p2align 4
+L(find_nul):
+# ifdef USE_AS_WCSRCHR
+ /* Keep the first bit for each matching CHAR for bsr. */
+ andl $0x11111111, %ecx
+ andl $0x11111111, %eax
+# endif
+ /* Mask out any matching bits after the nul CHAR. */
+ movl %ecx, %r8d
+ subl $1, %r8d
+ xorl %ecx, %r8d
+ andl %r8d, %eax
+ testl %eax, %eax
+ /* If there is no CHAR here, return the remembered one. */
+ jz L(return_value)
+ bsrl %eax, %eax
+ leaq -VEC_SIZE(%rdi, %rax), %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(char_and_nul):
+ /* Find both a CHAR and a nul CHAR. */
+ addq %rcx, %rdi
+ movl %edx, %ecx
+L(char_and_nul_in_first_vec):
+# ifdef USE_AS_WCSRCHR
+ /* Keep the first bit for each matching CHAR for bsr. */
+ andl $0x11111111, %ecx
+ andl $0x11111111, %eax
+# endif
+ /* Mask out any matching bits after the nul CHAR. */
+ movl %ecx, %r8d
+ subl $1, %r8d
+ xorl %ecx, %r8d
+ andl %r8d, %eax
+ testl %eax, %eax
+ /* Return null pointer if the nul CHAR comes first. */
+ jz L(return_null)
+ bsrl %eax, %eax
+ leaq -VEC_SIZE(%rdi, %rax), %rax
+ VZEROUPPER
+ ret
+
+ .p2align 4
+L(return_null):
+ xorl %eax, %eax
+ VZEROUPPER
+ ret
+
+END (STRRCHR)
+#endif
diff --git a/sysdeps/x86_64/multiarch/strrchr-sse2.S b/sysdeps/x86_64/multiarch/strrchr-sse2.S
new file mode 100644
index 0000000000..0ec76fe9cc
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strrchr-sse2.S
@@ -0,0 +1,28 @@
+/* strrchr optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define strrchr __strrchr_sse2
+
+# undef weak_alias
+# define weak_alias(strrchr, rindex)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strrchr)
+#endif
+
+#include "../strrchr.S"
diff --git a/sysdeps/x86_64/multiarch/strrchr.c b/sysdeps/x86_64/multiarch/strrchr.c
new file mode 100644
index 0000000000..a719edde10
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strrchr.c
@@ -0,0 +1,34 @@
+/* Multiple versions of strrchr.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strrchr __redirect_strrchr
+# include <string.h>
+# undef strrchr
+
+# define SYMBOL_NAME strrchr
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_strrchr, strrchr, IFUNC_SELECTOR ());
+weak_alias (strrchr, rindex);
+# ifdef SHARED
+__hidden_ver1 (strrchr, __GI_strrchr, __redirect_strrchr)
+ __attribute__((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strspn-c.c b/sysdeps/x86_64/multiarch/strspn-c.c
index 9675f9360e..4554cff0c2 100644
--- a/sysdeps/x86_64/multiarch/strspn-c.c
+++ b/sysdeps/x86_64/multiarch/strspn-c.c
@@ -1,5 +1,5 @@
/* strspn with SSE4.2 intrinsics
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -52,7 +52,7 @@
We exit from the loop for case 1. */
-extern size_t __strspn_sse2 (const char *, const char *);
+extern size_t __strspn_sse2 (const char *, const char *) attribute_hidden;
size_t
diff --git a/sysdeps/x86_64/multiarch/strspn-sse2.S b/sysdeps/x86_64/multiarch/strspn-sse2.S
new file mode 100644
index 0000000000..4686cdd55d
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strspn-sse2.S
@@ -0,0 +1,28 @@
+/* strspn optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+
+# include <sysdep.h>
+# define strspn __strspn_sse2
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strspn)
+#endif
+
+#include <sysdeps/x86_64/strspn.S>
diff --git a/sysdeps/x86_64/multiarch/strspn.S b/sysdeps/x86_64/multiarch/strspn.S
deleted file mode 100644
index 4942826b24..0000000000
--- a/sysdeps/x86_64/multiarch/strspn.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Multiple versions of strspn
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
- .text
-ENTRY(strspn)
- .type strspn, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- leaq __strspn_sse2(%rip), %rax
- HAS_CPU_FEATURE (SSE4_2)
- jz 2f
- leaq __strspn_sse42(%rip), %rax
-2: ret
-END(strspn)
-
-# undef ENTRY
-# define ENTRY(name) \
- .type __strspn_sse2, @function; \
- .globl __strspn_sse2; \
- .align 16; \
- __strspn_sse2: cfi_startproc; \
- CALL_MCOUNT
-# undef END
-# define END(name) \
- cfi_endproc; .size __strspn_sse2, .-__strspn_sse2
-#endif
-
-#include "../strspn.S"
diff --git a/sysdeps/x86_64/multiarch/strspn.c b/sysdeps/x86_64/multiarch/strspn.c
new file mode 100644
index 0000000000..56ab4d9558
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/strspn.c
@@ -0,0 +1,35 @@
+/* Multiple versions of strspn.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define strspn __redirect_strspn
+# include <string.h>
+# undef strspn
+
+# define SYMBOL_NAME strspn
+# include "ifunc-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strspn, strspn, IFUNC_SELECTOR ());
+
+# ifdef SHARED
+__hidden_ver1 (strspn, __GI_strspn, __redirect_strspn)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S b/sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S
index 4ead1dfaf5..8188b8f643 100644
--- a/sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S
+++ b/sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S
@@ -1,5 +1,5 @@
/* strstr with unaligned loads
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/multiarch/strstr.c b/sysdeps/x86_64/multiarch/strstr.c
index eecba2243e..30ce597a16 100644
--- a/sysdeps/x86_64/multiarch/strstr.c
+++ b/sysdeps/x86_64/multiarch/strstr.c
@@ -1,6 +1,6 @@
/* Multiple versions of strstr.
All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/multiarch/test-multiarch.c b/sysdeps/x86_64/multiarch/test-multiarch.c
index 4eb0c16cd8..aa872f27db 100644
--- a/sysdeps/x86_64/multiarch/test-multiarch.c
+++ b/sysdeps/x86_64/multiarch/test-multiarch.c
@@ -1,6 +1,6 @@
/* Test CPU feature data.
This file is part of the GNU C Library.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <init-arch.h>
+#include <cpu-features.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sysdeps/x86_64/multiarch/varshift.c b/sysdeps/x86_64/multiarch/varshift.c
index 7921be5b57..2838736544 100644
--- a/sysdeps/x86_64/multiarch/varshift.c
+++ b/sysdeps/x86_64/multiarch/varshift.c
@@ -1,5 +1,5 @@
/* Helper for variable shifts of SSE registers.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/multiarch/varshift.h b/sysdeps/x86_64/multiarch/varshift.h
index 7b27d0e9dd..76f2759874 100644
--- a/sysdeps/x86_64/multiarch/varshift.h
+++ b/sysdeps/x86_64/multiarch/varshift.h
@@ -1,5 +1,5 @@
/* Helper for variable shifts of SSE registers.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/multiarch/wcschr-avx2.S b/sysdeps/x86_64/multiarch/wcschr-avx2.S
new file mode 100644
index 0000000000..67726b6837
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcschr-avx2.S
@@ -0,0 +1,3 @@
+#define STRCHR __wcschr_avx2
+#define USE_AS_WCSCHR 1
+#include "strchr-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/wcschr-sse2.S b/sysdeps/x86_64/multiarch/wcschr-sse2.S
new file mode 100644
index 0000000000..67e4742ef1
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcschr-sse2.S
@@ -0,0 +1,30 @@
+/* wcschr optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define __wcschr __wcschr_sse2
+
+# undef weak_alias
+# define weak_alias(__wcschr, wcschr)
+# undef libc_hidden_def
+# define libc_hidden_def(__wcschr)
+# undef libc_hidden_weak
+# define libc_hidden_weak(wcschr)
+#endif
+
+#include "../wcschr.S"
diff --git a/sysdeps/x86_64/multiarch/wcschr.c b/sysdeps/x86_64/multiarch/wcschr.c
new file mode 100644
index 0000000000..20a03833b9
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcschr.c
@@ -0,0 +1,39 @@
+/* Multiple versions of wcschr.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wcschr __redirect_wcschr
+# define __wcschr __redirect___wcschr
+# include <wchar.h>
+# undef wcschr
+# undef __wcschr
+
+# define SYMBOL_NAME wcschr
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_wcschr, __wcschr, IFUNC_SELECTOR ());
+weak_alias (__wcschr, wcschr);
+# ifdef SHARED
+__hidden_ver1 (__wcschr, __GI___wcschr, __redirect___wcschr)
+ __attribute__((visibility ("hidden")));
+__hidden_ver1 (wcschr, __GI_wcschr, __redirect_wcschr)
+ __attribute__((weak, visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/wcscmp-avx2.S b/sysdeps/x86_64/multiarch/wcscmp-avx2.S
new file mode 100644
index 0000000000..e5da4da689
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcscmp-avx2.S
@@ -0,0 +1,4 @@
+#define STRCMP __wcscmp_avx2
+#define USE_AS_WCSCMP 1
+
+#include "strcmp-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/wcscmp-sse2.S b/sysdeps/x86_64/multiarch/wcscmp-sse2.S
new file mode 100644
index 0000000000..b129d1c073
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcscmp-sse2.S
@@ -0,0 +1,23 @@
+/* wcscmp optimized with SSE2.
+ Copyright (C) 2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define __wcscmp __wcscmp_sse2
+#endif
+
+#include "../wcscmp.S"
diff --git a/sysdeps/x86_64/multiarch/wcscmp.c b/sysdeps/x86_64/multiarch/wcscmp.c
new file mode 100644
index 0000000000..74d92cf0f9
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcscmp.c
@@ -0,0 +1,37 @@
+/* Multiple versions of wcscmp.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wcscmp __redirect_wcscmp
+# define __wcscmp __redirect___wcscmp
+# include <wchar.h>
+# undef wcscmp
+# undef __wcscmp
+
+# define SYMBOL_NAME wcscmp
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_wcscmp, __wcscmp, IFUNC_SELECTOR ());
+weak_alias (__wcscmp, wcscmp)
+
+# ifdef SHARED
+__hidden_ver1 (__wcscmp, __GI___wcscmp, __redirect_wcscmp)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/wcscpy-ssse3.S b/sysdeps/x86_64/multiarch/wcscpy-ssse3.S
index 341e57a5ca..ea1589052b 100644
--- a/sysdeps/x86_64/multiarch/wcscpy-ssse3.S
+++ b/sysdeps/x86_64/multiarch/wcscpy-ssse3.S
@@ -1,5 +1,5 @@
/* wcscpy with SSSE3
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/multiarch/wcscpy.S b/sysdeps/x86_64/multiarch/wcscpy.S
deleted file mode 100644
index 8e7270b9c7..0000000000
--- a/sysdeps/x86_64/multiarch/wcscpy.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Multiple versions of wcscpy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
-
- .text
-ENTRY(wcscpy)
- .type wcscpy, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- HAS_CPU_FEATURE (SSSE3)
- jnz 2f
- leaq __wcscpy_sse2(%rip), %rax
- ret
-
-2: leaq __wcscpy_ssse3(%rip), %rax
- ret
-
-END(wcscpy)
-#endif
diff --git a/sysdeps/x86_64/multiarch/wcscpy.c b/sysdeps/x86_64/multiarch/wcscpy.c
new file mode 100644
index 0000000000..f23b1fd853
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcscpy.c
@@ -0,0 +1,44 @@
+/* Multiple versions of wcscpy.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wcscpy __redirect_wcscpy
+# include <wchar.h>
+# undef wcscpy
+
+# define SYMBOL_NAME wcscpy
+# include <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+ return OPTIMIZE (ssse3);
+
+ return OPTIMIZE (sse2);
+}
+
+libc_ifunc_redirected (__redirect_wcscpy, wcscpy, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/x86_64/multiarch/wcslen-avx2.S b/sysdeps/x86_64/multiarch/wcslen-avx2.S
new file mode 100644
index 0000000000..c9224f1bc5
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcslen-avx2.S
@@ -0,0 +1,4 @@
+#define STRLEN __wcslen_avx2
+#define USE_AS_WCSLEN 1
+
+#include "strlen-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/wcslen-sse2.S b/sysdeps/x86_64/multiarch/wcslen-sse2.S
new file mode 100644
index 0000000000..6031978363
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcslen-sse2.S
@@ -0,0 +1,26 @@
+/* wcslen optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define __wcslen __wcslen_sse2
+
+# undef weak_alias
+# define weak_alias(__wcslen, wcslen)
+#endif
+
+#include "../wcslen.S"
diff --git a/sysdeps/x86_64/multiarch/wcslen.c b/sysdeps/x86_64/multiarch/wcslen.c
new file mode 100644
index 0000000000..6d06e47cbd
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcslen.c
@@ -0,0 +1,31 @@
+/* Multiple versions of wcslen.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define __wcslen __redirect_wcslen
+# include <wchar.h>
+# undef __wcslen
+
+# define SYMBOL_NAME wcslen
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_wcslen, __wcslen, IFUNC_SELECTOR ());
+weak_alias (__wcslen, wcslen);
+#endif
diff --git a/sysdeps/x86_64/multiarch/wcsncmp-avx2.S b/sysdeps/x86_64/multiarch/wcsncmp-avx2.S
new file mode 100644
index 0000000000..4fa1de4d3f
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcsncmp-avx2.S
@@ -0,0 +1,5 @@
+#define STRCMP __wcsncmp_avx2
+#define USE_AS_STRNCMP 1
+#define USE_AS_WCSCMP 1
+
+#include "strcmp-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/wcsncmp-sse2.c b/sysdeps/x86_64/multiarch/wcsncmp-sse2.c
new file mode 100644
index 0000000000..2bc7b4f693
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcsncmp-sse2.c
@@ -0,0 +1,20 @@
+/* wcsncmp optimized with SSE2.
+ Copyright (C) 2018 Free Software 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 WCSNCMP __wcsncmp_sse2
+#include <wcsmbs/wcsncmp.c>
diff --git a/sysdeps/x86_64/multiarch/wcsncmp.c b/sysdeps/x86_64/multiarch/wcsncmp.c
new file mode 100644
index 0000000000..90e9a352d9
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcsncmp.c
@@ -0,0 +1,31 @@
+/* Multiple versions of wcsncmp.
+ Copyright (C) 2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wcsncmp __redirect_wcsncmp
+# define __wcsncmp __redirect___wcsncmp
+# include <wchar.h>
+# undef wcsncmp
+# undef __wcsncmp
+
+# define SYMBOL_NAME wcsncmp
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_wcsncmp, wcsncmp, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/x86_64/multiarch/wcsnlen-avx2.S b/sysdeps/x86_64/multiarch/wcsnlen-avx2.S
new file mode 100644
index 0000000000..fac83546b5
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcsnlen-avx2.S
@@ -0,0 +1,5 @@
+#define STRLEN __wcsnlen_avx2
+#define USE_AS_WCSLEN 1
+#define USE_AS_STRNLEN 1
+
+#include "strlen-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/wcsnlen-c.c b/sysdeps/x86_64/multiarch/wcsnlen-c.c
new file mode 100644
index 0000000000..e1ec7cfbb5
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcsnlen-c.c
@@ -0,0 +1,9 @@
+#if IS_IN (libc)
+# include <wchar.h>
+
+# define WCSNLEN __wcsnlen_sse2
+
+extern __typeof (wcsnlen) __wcsnlen_sse2;
+#endif
+
+#include "wcsmbs/wcsnlen.c"
diff --git a/sysdeps/x86_64/multiarch/wcsnlen-sse4_1.S b/sysdeps/x86_64/multiarch/wcsnlen-sse4_1.S
new file mode 100644
index 0000000000..a8cab0cb00
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcsnlen-sse4_1.S
@@ -0,0 +1,5 @@
+#define AS_WCSLEN
+#define AS_STRNLEN
+#define strlen __wcsnlen_sse4_1
+
+#include "../strlen.S"
diff --git a/sysdeps/x86_64/multiarch/wcsnlen.c b/sysdeps/x86_64/multiarch/wcsnlen.c
new file mode 100644
index 0000000000..bd376057e3
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcsnlen.c
@@ -0,0 +1,51 @@
+/* Multiple versions of wcsnlen.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define __wcsnlen __redirect_wcsnlen
+# include <wchar.h>
+# undef __wcsnlen
+
+# define SYMBOL_NAME wcsnlen
+# include <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse4_1) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+ const struct cpu_features* cpu_features = __get_cpu_features ();
+
+ if (!CPU_FEATURES_ARCH_P (cpu_features, Prefer_No_VZEROUPPER)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)
+ && CPU_FEATURES_ARCH_P (cpu_features, AVX_Fast_Unaligned_Load))
+ return OPTIMIZE (avx2);
+
+ if (CPU_FEATURES_CPU_P (cpu_features, SSE4_1))
+ return OPTIMIZE (sse4_1);
+
+ return OPTIMIZE (sse2);
+}
+
+libc_ifunc_redirected (__redirect_wcsnlen, __wcsnlen, IFUNC_SELECTOR ());
+weak_alias (__wcsnlen, wcsnlen);
+#endif
diff --git a/sysdeps/x86_64/multiarch/wcsrchr-avx2.S b/sysdeps/x86_64/multiarch/wcsrchr-avx2.S
new file mode 100644
index 0000000000..cf8a239ab2
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcsrchr-avx2.S
@@ -0,0 +1,3 @@
+#define STRRCHR __wcsrchr_avx2
+#define USE_AS_WCSRCHR 1
+#include "strrchr-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/wcsrchr-sse2.S b/sysdeps/x86_64/multiarch/wcsrchr-sse2.S
new file mode 100644
index 0000000000..d015e95317
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcsrchr-sse2.S
@@ -0,0 +1,23 @@
+/* wcsrchr optimized with SSE2.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc)
+# define wcsrchr __wcsrchr_sse2
+#endif
+
+#include "../wcsrchr.S"
diff --git a/sysdeps/x86_64/multiarch/wcsrchr.c b/sysdeps/x86_64/multiarch/wcsrchr.c
new file mode 100644
index 0000000000..219fc828a6
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wcsrchr.c
@@ -0,0 +1,29 @@
+/* Multiple versions of wcsrchr.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wcsrchr __redirect_wcsrchr
+# include <wchar.h>
+# undef wcsrchr
+
+# define SYMBOL_NAME wcsrchr
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_wcsrchr, wcsrchr, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/x86_64/multiarch/wmemchr-avx2.S b/sysdeps/x86_64/multiarch/wmemchr-avx2.S
new file mode 100644
index 0000000000..282854f1a1
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wmemchr-avx2.S
@@ -0,0 +1,4 @@
+#define MEMCHR __wmemchr_avx2
+#define USE_AS_WMEMCHR 1
+
+#include "memchr-avx2.S"
diff --git a/sysdeps/x86_64/multiarch/wmemchr-sse2.S b/sysdeps/x86_64/multiarch/wmemchr-sse2.S
new file mode 100644
index 0000000000..70a965d552
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wmemchr-sse2.S
@@ -0,0 +1,4 @@
+#define USE_AS_WMEMCHR 1
+#define wmemchr __wmemchr_sse2
+
+#include "../memchr.S"
diff --git a/sysdeps/x86_64/multiarch/wmemchr.c b/sysdeps/x86_64/multiarch/wmemchr.c
new file mode 100644
index 0000000000..6d833702c6
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wmemchr.c
@@ -0,0 +1,39 @@
+/* Multiple versions of wmemchr
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wmemchr __redirect_wmemchr
+# define __wmemchr __redirect___wmemchr
+# include <wchar.h>
+# undef wmemchr
+# undef __wmemchr
+
+# define SYMBOL_NAME wmemchr
+# include "ifunc-avx2.h"
+
+libc_ifunc_redirected (__redirect_wmemchr, __wmemchr, IFUNC_SELECTOR ());
+weak_alias (__wmemchr, wmemchr)
+# ifdef SHARED
+__hidden_ver1 (__wmemchr, __GI___wmemchr, __redirect___wmemchr)
+ __attribute__((visibility ("hidden")));
+__hidden_ver1 (wmemchr, __GI_wmemchr, __redirect_wmemchr)
+ __attribute__((weak, visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/wmemcmp-avx2-movbe.S b/sysdeps/x86_64/multiarch/wmemcmp-avx2-movbe.S
new file mode 100644
index 0000000000..bfa1a16a35
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wmemcmp-avx2-movbe.S
@@ -0,0 +1,4 @@
+#define MEMCMP __wmemcmp_avx2_movbe
+#define USE_AS_WMEMCMP 1
+
+#include "memcmp-avx2-movbe.S"
diff --git a/sysdeps/x86_64/multiarch/wmemcmp.S b/sysdeps/x86_64/multiarch/wmemcmp.S
deleted file mode 100644
index b510f756e2..0000000000
--- a/sysdeps/x86_64/multiarch/wmemcmp.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Multiple versions of wmemcmp
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
- .text
-ENTRY(wmemcmp)
- .type wmemcmp, @gnu_indirect_function
- LOAD_RTLD_GLOBAL_RO_RDX
- HAS_CPU_FEATURE (SSSE3)
- jnz 2f
- leaq __wmemcmp_sse2(%rip), %rax
- ret
-
-2: HAS_CPU_FEATURE (SSE4_1)
- jz 3f
- leaq __wmemcmp_sse4_1(%rip), %rax
- ret
-
-3: leaq __wmemcmp_ssse3(%rip), %rax
- ret
-
-END(wmemcmp)
-#endif
diff --git a/sysdeps/x86_64/multiarch/wmemcmp.c b/sysdeps/x86_64/multiarch/wmemcmp.c
new file mode 100644
index 0000000000..3f4a7422f3
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wmemcmp.c
@@ -0,0 +1,30 @@
+/* Multiple versions of wmemcmp
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wmemcmp __redirect_wmemcmp
+# include <wchar.h>
+# undef wmemcmp
+
+# define SYMBOL_NAME wmemcmp
+# include "ifunc-memcmp.h"
+
+libc_ifunc_redirected (__redirect_wmemcmp, wmemcmp, IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/x86_64/multiarch/wmemset.c b/sysdeps/x86_64/multiarch/wmemset.c
new file mode 100644
index 0000000000..9fee77ea81
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wmemset.c
@@ -0,0 +1,40 @@
+/* Multiple versions of wmemset.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+# define wmemset __redirect_wmemset
+# define __wmemset __redirect___wmemset
+# include <wchar.h>
+# undef wmemset
+# undef __wmemset
+
+# define SYMBOL_NAME wmemset
+# include "ifunc-wmemset.h"
+
+libc_ifunc_redirected (__redirect_wmemset, __wmemset, IFUNC_SELECTOR ());
+weak_alias (__wmemset, wmemset)
+
+# ifdef SHARED
+__hidden_ver1 (__wmemset, __GI___wmemset, __redirect___wmemset)
+ __attribute__ ((visibility ("hidden")));
+__hidden_ver1 (wmemset, __GI_wmemset, __redirect_wmemset)
+ __attribute__ ((visibility ("hidden")));
+# endif
+#endif
diff --git a/sysdeps/x86_64/multiarch/wmemset_chk-nonshared.S b/sysdeps/x86_64/multiarch/wmemset_chk-nonshared.S
new file mode 100644
index 0000000000..140c93d6f0
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wmemset_chk-nonshared.S
@@ -0,0 +1,21 @@
+/* Non-shared version of wmemset_chk for x86-64.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/x86_64/wmemset_chk.S>
+#endif
diff --git a/sysdeps/x86_64/multiarch/wmemset_chk.c b/sysdeps/x86_64/multiarch/wmemset_chk.c
new file mode 100644
index 0000000000..88280192c5
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wmemset_chk.c
@@ -0,0 +1,31 @@
+/* Multiple versions of wmemset_chk.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2017-2018 Free Software 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 multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __wmemset_chk __redirect_wmemset_chk
+# include <wchar.h>
+# undef __wmemset_chk
+
+# define SYMBOL_NAME wmemset_chk
+# include "ifunc-wmemset.h"
+
+libc_ifunc_redirected (__redirect_wmemset_chk, __wmemset_chk,
+ IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/x86_64/nptl/Makefile b/sysdeps/x86_64/nptl/Makefile
index 9b64b533ee..73024033ee 100644
--- a/sysdeps/x86_64/nptl/Makefile
+++ b/sysdeps/x86_64/nptl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/nptl/pthread-offsets.h b/sysdeps/x86_64/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..16c6b0d9fd
--- /dev/null
+++ b/sysdeps/x86_64/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET 12
+#define __PTHREAD_MUTEX_KIND_OFFSET 16
+#define __PTHREAD_MUTEX_SPINS_OFFSET 20
+#define __PTHREAD_MUTEX_ELISION_OFFSET 22
+#define __PTHREAD_MUTEX_LIST_OFFSET 24
diff --git a/sysdeps/x86_64/nptl/pthread_spin_lock.S b/sysdeps/x86_64/nptl/pthread_spin_lock.S
index b871241617..730fd65034 100644
--- a/sysdeps/x86_64/nptl/pthread_spin_lock.S
+++ b/sysdeps/x86_64/nptl/pthread_spin_lock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/nptl/pthread_spin_trylock.S b/sysdeps/x86_64/nptl/pthread_spin_trylock.S
index c9c53171fe..a8f1b72d60 100644
--- a/sysdeps/x86_64/nptl/pthread_spin_trylock.S
+++ b/sysdeps/x86_64/nptl/pthread_spin_trylock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/x86_64/nptl/pthread_spin_unlock.S b/sysdeps/x86_64/nptl/pthread_spin_unlock.S
index 188de2e8cb..afd114e855 100644
--- a/sysdeps/x86_64/nptl/pthread_spin_unlock.S
+++ b/sysdeps/x86_64/nptl/pthread_spin_unlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/x86_64/nptl/pthreaddef.h b/sysdeps/x86_64/nptl/pthreaddef.h
index 9397efc631..036deb5772 100644
--- a/sysdeps/x86_64/nptl/pthreaddef.h
+++ b/sysdeps/x86_64/nptl/pthreaddef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/sysdeps/x86_64/nptl/tcb-offsets.sym b/sysdeps/x86_64/nptl/tcb-offsets.sym
index aeb752673a..ae8034743b 100644
--- a/sysdeps/x86_64/nptl/tcb-offsets.sym
+++ b/sysdeps/x86_64/nptl/tcb-offsets.sym
@@ -4,7 +4,6 @@
RESULT offsetof (struct pthread, result)
TID offsetof (struct pthread, tid)
-PID offsetof (struct pthread, pid)
CANCELHANDLING offsetof (struct pthread, cancelhandling)
CLEANUP_JMP_BUF offsetof (struct pthread, cleanup_jmp_buf)
CLEANUP offsetof (struct pthread, cleanup)
@@ -13,9 +12,8 @@ MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock)
MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
POINTER_GUARD offsetof (tcbhead_t, pointer_guard)
VGETCPU_CACHE_OFFSET offsetof (tcbhead_t, vgetcpu_cache)
-#ifndef __ASSUME_PRIVATE_FUTEX
-PRIVATE_FUTEX offsetof (tcbhead_t, private_futex)
-#endif
+FEATURE_1_OFFSET offsetof (tcbhead_t, feature_1)
+SSP_BASE_OFFSET offsetof (tcbhead_t, ssp_base)
-- Not strictly offsets, but these values are also used in the TCB.
TCB_CANCELSTATE_BITMASK CANCELSTATE_BITMASK
diff --git a/sysdeps/x86_64/nptl/tls.h b/sysdeps/x86_64/nptl/tls.h
index 2b061a07c6..e88561c934 100644
--- a/sysdeps/x86_64/nptl/tls.h
+++ b/sysdeps/x86_64/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. nptl/x86_64 version.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,8 +26,9 @@
# include <stdint.h>
# include <stdlib.h>
# include <sysdep.h>
-# include <libc-internal.h>
+# include <libc-pointer-arith.h> /* For cast_to_integer. */
# include <kernel-features.h>
+# include <dl-dtv.h>
/* Replacement type for __m128 since this file is included by ld.so,
which is compiled with -mno-sse. It must not change the alignment
@@ -38,18 +39,6 @@ typedef struct
} __128bits;
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
-
-
typedef struct
{
void *tcb; /* Pointer to the TCB. Not necessarily the
@@ -62,17 +51,17 @@ typedef struct
uintptr_t stack_guard;
uintptr_t pointer_guard;
unsigned long int vgetcpu_cache[2];
-# ifndef __ASSUME_PRIVATE_FUTEX
- int private_futex;
-# else
- int __glibc_reserved1;
-# endif
+ /* Bit 0: X86_FEATURE_1_IBT.
+ Bit 1: X86_FEATURE_1_SHSTK.
+ */
+ unsigned int feature_1;
int __glibc_unused1;
/* Reservation of some values for the TM ABI. */
void *__private_tm[4];
/* GCC split stack support. */
void *__private_ss;
- long int __glibc_reserved2;
+ /* The lowest address of shadow stack, */
+ unsigned long long int ssp_base;
/* Must be kept even if it is no longer used by glibc since programs,
like AddressSanitizer, depend on the size of tcbhead_t. */
__128bits __glibc_unused2[8][4] __attribute__ ((aligned (32)));
@@ -80,6 +69,23 @@ typedef struct
void *__padding[8];
} tcbhead_t;
+# ifdef __ILP32__
+/* morestack.S in libgcc uses offset 0x40 to access __private_ss, */
+_Static_assert (offsetof (tcbhead_t, __private_ss) == 0x40,
+ "offset of __private_ss != 0x40");
+/* NB: ssp_base used to be "long int __glibc_reserved2", which was
+ changed from 32 bits to 64 bits. Make sure that the offset of the
+ next field, __glibc_unused2, is unchanged. */
+_Static_assert (offsetof (tcbhead_t, __glibc_unused2) == 0x60,
+ "offset of __glibc_unused2 != 0x60");
+# else
+/* morestack.S in libgcc uses offset 0x70 to access __private_ss, */
+_Static_assert (offsetof (tcbhead_t, __private_ss) == 0x70,
+ "offset of __private_ss != 0x70");
+_Static_assert (offsetof (tcbhead_t, __glibc_unused2) == 0x80,
+ "offset of __glibc_unused2 != 0x80");
+# endif
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif
@@ -337,18 +343,6 @@ typedef struct
abort (); })
-# define CALL_THREAD_FCT(descr) \
- ({ void *__res; \
- asm volatile ("movq %%fs:%P2, %%rdi\n\t" \
- "callq *%%fs:%P1" \
- : "=a" (__res) \
- : "i" (offsetof (struct pthread, start_routine)), \
- "i" (offsetof (struct pthread, arg)) \
- : "di", "si", "cx", "dx", "r8", "r9", "r10", "r11", \
- "memory", "cc"); \
- __res; })
-
-
/* Set the stack guard field in TCB head. */
# define THREAD_SET_STACK_GUARD(value) \
THREAD_SETMEM (THREAD_SELF, header.stack_guard, value)
@@ -366,6 +360,7 @@ typedef struct
/* Get and set the global scope generation counter in the TCB head. */
+# define THREAD_GSCOPE_IN_TCB 1
# define THREAD_GSCOPE_FLAG_UNUSED 0
# define THREAD_GSCOPE_FLAG_USED 1
# define THREAD_GSCOPE_FLAG_WAIT 2
diff --git a/sysdeps/x86_64/rawmemchr.S b/sysdeps/x86_64/rawmemchr.S
index f90b7921a1..cf972768ec 100644
--- a/sysdeps/x86_64/rawmemchr.S
+++ b/sysdeps/x86_64/rawmemchr.S
@@ -1,6 +1,6 @@
/* fast SSE2 memchr with 64 byte loop and pmaxub instruction using
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -196,11 +196,6 @@ L(matches32):
lea 32(%rax, %rdi), %rax
ret
- .p2align 4
-L(return_null):
- xor %rax, %rax
- ret
-
END (__rawmemchr)
weak_alias (__rawmemchr, rawmemchr)
diff --git a/sysdeps/x86_64/rshift.S b/sysdeps/x86_64/rshift.S
index c88c6d82bb..1d018b857b 100644
--- a/sysdeps/x86_64/rshift.S
+++ b/sysdeps/x86_64/rshift.S
@@ -1,5 +1,5 @@
/* x86-64 __mpn_rshift --
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/x86_64/rtld-offsets.sym b/sysdeps/x86_64/rtld-offsets.sym
new file mode 100644
index 0000000000..fd41b51521
--- /dev/null
+++ b/sysdeps/x86_64/rtld-offsets.sym
@@ -0,0 +1,6 @@
+#define SHARED
+#include <ldsodefs.h>
+
+--
+
+GL_TLS_GENERATION_OFFSET offsetof (struct rtld_global, _dl_tls_generation)
diff --git a/sysdeps/x86_64/sched_cpucount.c b/sysdeps/x86_64/sched_cpucount.c
index 0834e711b3..af5bbcc044 100644
--- a/sysdeps/x86_64/sched_cpucount.c
+++ b/sysdeps/x86_64/sched_cpucount.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/setjmp.S b/sysdeps/x86_64/setjmp.S
index 3e93967c2f..78a8bf4644 100644
--- a/sysdeps/x86_64/setjmp.S
+++ b/sysdeps/x86_64/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for x86-64.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,9 +18,15 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
+#include <jmp_buf-ssp.h>
#include <asm-syntax.h>
#include <stap-probe.h>
+/* Don't save shadow stack register if shadow stack isn't enabled. */
+#if !SHSTK_ENABLED
+# undef SHADOW_STACK_POINTER_OFFSET
+#endif
+
ENTRY (__sigsetjmp)
/* Save registers. */
movq %rbx, (JB_RBX*8)(%rdi)
@@ -54,17 +60,28 @@ ENTRY (__sigsetjmp)
#endif
movq %rax, (JB_PC*8)(%rdi)
+#ifdef SHADOW_STACK_POINTER_OFFSET
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+ /* Check if Shadow Stack is enabled. */
+ testl $X86_FEATURE_1_SHSTK, %fs:FEATURE_1_OFFSET
+ jz L(skip_ssp)
+# else
+ xorl %eax, %eax
+# endif
+ /* Get the current Shadow-Stack-Pointer and save it. */
+ rdsspq %rax
+ movq %rax, SHADOW_STACK_POINTER_OFFSET(%rdi)
+# if IS_IN (libc) && defined SHARED && defined FEATURE_1_OFFSET
+L(skip_ssp):
+# endif
+#endif
#if IS_IN (rtld)
/* In ld.so we never save the signal mask. */
xorl %eax, %eax
retq
#else
/* Make a tail call to __sigjmp_save; it takes the same args. */
-# ifdef PIC
- jmp C_SYMBOL_NAME (__sigjmp_save)@PLT
-# else
jmp __sigjmp_save
-# endif
#endif
END (__sigsetjmp)
hidden_def (__sigsetjmp)
diff --git a/sysdeps/x86_64/stackinfo.h b/sysdeps/x86_64/stackinfo.h
index 848aa7754c..f7a5672f27 100644
--- a/sysdeps/x86_64/stackinfo.h
+++ b/sysdeps/x86_64/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/start.S b/sysdeps/x86_64/start.S
index 1374974307..354d2e6ec7 100644
--- a/sysdeps/x86_64/start.S
+++ b/sysdeps/x86_64/start.S
@@ -1,5 +1,5 @@
/* Startup code compliant to the ELF x86-64 ABI.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2001.
@@ -96,27 +96,28 @@ ENTRY (_start)
which grow downwards). */
pushq %rsp
-#ifdef SHARED
+#ifdef PIC
/* Pass address of our own entry points to .fini and .init. */
mov __libc_csu_fini@GOTPCREL(%rip), %R8_LP
mov __libc_csu_init@GOTPCREL(%rip), %RCX_LP
mov main@GOTPCREL(%rip), %RDI_LP
-
- /* Call the user's main function, and exit with its value.
- But let the libc call main. */
- call __libc_start_main@PLT
#else
/* Pass address of our own entry points to .fini and .init. */
mov $__libc_csu_fini, %R8_LP
mov $__libc_csu_init, %RCX_LP
mov $main, %RDI_LP
+#endif
/* Call the user's main function, and exit with its value.
- But let the libc call main. */
- call __libc_start_main
-#endif
+ But let the libc call main. Since __libc_start_main in
+ libc.so is called very early, lazy binding isn't relevant
+ here. Use indirect branch via GOT to avoid extra branch
+ to PLT slot. In case of static executable, ld in binutils
+ 2.26 or above can convert indirect branch into direct
+ branch. */
+ call *__libc_start_main@GOTPCREL(%rip)
hlt /* Crash if somehow `exit' does return. */
END (_start)
diff --git a/sysdeps/x86_64/strcasecmp_l-nonascii.c b/sysdeps/x86_64/strcasecmp_l-nonascii.c
index 30e8969603..9ba9bc808c 100644
--- a/sysdeps/x86_64/strcasecmp_l-nonascii.c
+++ b/sysdeps/x86_64/strcasecmp_l-nonascii.c
@@ -1,7 +1,7 @@
#include <string.h>
extern int __strcasecmp_l_nonascii (const char *__s1, const char *__s2,
- __locale_t __loc);
+ locale_t __loc);
#define __strcasecmp_l __strcasecmp_l_nonascii
#define USE_IN_EXTENDED_LOCALE_MODEL 1
diff --git a/sysdeps/x86_64/strcat.S b/sysdeps/x86_64/strcat.S
index dadf4c76b2..9a4a4e6feb 100644
--- a/sysdeps/x86_64/strcat.S
+++ b/sysdeps/x86_64/strcat.S
@@ -1,6 +1,6 @@
/* strcat(dest, src) -- Append SRC on the end of DEST.
Optimized for x86-64.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
diff --git a/sysdeps/x86_64/strchr.S b/sysdeps/x86_64/strchr.S
index 4431fee648..1d5112746f 100644
--- a/sysdeps/x86_64/strchr.S
+++ b/sysdeps/x86_64/strchr.S
@@ -1,6 +1,6 @@
/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For AMD x86-64.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/strchrnul.S b/sysdeps/x86_64/strchrnul.S
index 7b52d699ee..149f3a9ced 100644
--- a/sysdeps/x86_64/strchrnul.S
+++ b/sysdeps/x86_64/strchrnul.S
@@ -1,7 +1,7 @@
/* strchrnul (str, ch) -- Return pointer to first occurrence of CH in STR
or terminating NUL byte.
For AMD x86-64.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/strcmp.S b/sysdeps/x86_64/strcmp.S
index c5c44d4e27..e16945b961 100644
--- a/sysdeps/x86_64/strcmp.S
+++ b/sysdeps/x86_64/strcmp.S
@@ -1,5 +1,5 @@
/* Highly optimized version for x86-64.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on i686 version contributed by Ulrich Drepper
<drepper@cygnus.com>, 1999.
@@ -233,7 +233,7 @@ LABEL(bigger):
lea LABEL(unaligned_table)(%rip), %r10
movslq (%r10, %r9,4), %r9
lea (%r10, %r9), %r10
- jmp *%r10 /* jump to corresponding case */
+ _CET_NOTRACK jmp *%r10 /* jump to corresponding case */
/*
* The following cases will be handled by ashr_0
diff --git a/sysdeps/x86_64/strcpy.S b/sysdeps/x86_64/strcpy.S
index 3f90c0020a..66128a7cb5 100644
--- a/sysdeps/x86_64/strcpy.S
+++ b/sysdeps/x86_64/strcpy.S
@@ -1,5 +1,5 @@
/* strcpy/stpcpy implementation for x86-64.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
diff --git a/sysdeps/x86_64/strcspn.S b/sysdeps/x86_64/strcspn.S
index de526c8fdd..7f9202d656 100644
--- a/sysdeps/x86_64/strcspn.S
+++ b/sysdeps/x86_64/strcspn.S
@@ -1,7 +1,7 @@
/* strcspn (str, ss) -- Return the length of the initial segment of STR
which contains no characters from SS.
For AMD x86-64.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>.
Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>.
@@ -24,9 +24,6 @@
#include <sysdep.h>
#include "asm-syntax.h"
-/* BEWARE: `#ifdef strcspn' means that strcspn is redefined as `strpbrk' */
-#define STRPBRK_P (defined strcspn)
-
.text
ENTRY (strcspn)
@@ -111,7 +108,7 @@ L(5): incq %rax
L(4): addq $256, %rsp /* remove skipset */
cfi_adjust_cfa_offset(-256)
-#if STRPBRK_P
+#ifdef USE_AS_STRPBRK
xorl %edx,%edx
orb %cl, %cl /* was last character NUL? */
cmovzq %rdx, %rax /* Yes: return NULL */
diff --git a/sysdeps/x86_64/strlen.S b/sysdeps/x86_64/strlen.S
index 12f63ad1bb..01cb5fa846 100644
--- a/sysdeps/x86_64/strlen.S
+++ b/sysdeps/x86_64/strlen.S
@@ -1,5 +1,5 @@
-/* SSE2 version of strlen.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* SSE2 version of strlen/wcslen.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,16 @@
#include <sysdep.h>
+#ifdef AS_WCSLEN
+# define PMINU pminud
+# define PCMPEQ pcmpeqd
+# define SHIFT_RETURN shrq $2, %rax
+#else
+# define PMINU pminub
+# define PCMPEQ pcmpeqb
+# define SHIFT_RETURN
+#endif
+
/* Long lived register in strlen(s), strnlen(s, n) are:
%xmm3 - zero
@@ -32,10 +42,10 @@ ENTRY(strlen)
/* Test 64 bytes from %rax for zero. Save result as bitmask in %rdx. */
#define FIND_ZERO \
- pcmpeqb (%rax), %xmm0; \
- pcmpeqb 16(%rax), %xmm1; \
- pcmpeqb 32(%rax), %xmm2; \
- pcmpeqb 48(%rax), %xmm3; \
+ PCMPEQ (%rax), %xmm0; \
+ PCMPEQ 16(%rax), %xmm1; \
+ PCMPEQ 32(%rax), %xmm2; \
+ PCMPEQ 48(%rax), %xmm3; \
pmovmskb %xmm0, %esi; \
pmovmskb %xmm1, %edx; \
pmovmskb %xmm2, %r8d; \
@@ -54,6 +64,9 @@ ENTRY(strlen)
xor %rax, %rax
ret
L(n_nonzero):
+# ifdef AS_WCSLEN
+ shlq $2, %rsi
+# endif
/* Initialize long lived registers. */
@@ -96,6 +109,7 @@ L(n_nonzero):
test %rdx, %rdx; \
je L(lab); \
bsfq %rdx, %rax; \
+ SHIFT_RETURN; \
ret
#ifdef AS_STRNLEN
@@ -104,19 +118,20 @@ L(n_nonzero):
#else
/* Test first 16 bytes unaligned. */
movdqu (%rax), %xmm4
- pcmpeqb %xmm0, %xmm4
+ PCMPEQ %xmm0, %xmm4
pmovmskb %xmm4, %edx
test %edx, %edx
je L(next48_bytes)
bsf %edx, %eax /* If eax is zeroed 16bit bsf can be used. */
+ SHIFT_RETURN
ret
L(next48_bytes):
/* Same as FIND_ZERO except we do not check first 16 bytes. */
andq $-16, %rax
- pcmpeqb 16(%rax), %xmm1
- pcmpeqb 32(%rax), %xmm2
- pcmpeqb 48(%rax), %xmm3
+ PCMPEQ 16(%rax), %xmm1
+ PCMPEQ 32(%rax), %xmm2
+ PCMPEQ 48(%rax), %xmm3
pmovmskb %xmm1, %edx
pmovmskb %xmm2, %r8d
pmovmskb %xmm3, %ecx
@@ -145,6 +160,7 @@ L(strnlen_ret):
test %rdx, %rdx
je L(loop_init)
bsfq %rdx, %rax
+ SHIFT_RETURN
ret
#endif
.p2align 4
@@ -161,10 +177,10 @@ L(loop):
je L(exit_end)
movdqa (%rax), %xmm0
- pminub 16(%rax), %xmm0
- pminub 32(%rax), %xmm0
- pminub 48(%rax), %xmm0
- pcmpeqb %xmm3, %xmm0
+ PMINU 16(%rax), %xmm0
+ PMINU 32(%rax), %xmm0
+ PMINU 48(%rax), %xmm0
+ PCMPEQ %xmm3, %xmm0
pmovmskb %xmm0, %edx
testl %edx, %edx
jne L(exit)
@@ -182,6 +198,7 @@ L(first):
bsfq %rdx, %rdx
addq %rdx, %rax
subq %rdi, %rax
+ SHIFT_RETURN
ret
.p2align 4
@@ -192,6 +209,7 @@ L(exit):
bsfq %rdx, %rdx
addq %rdx, %rax
subq %rdi, %rax
+ SHIFT_RETURN
ret
#else
@@ -201,10 +219,10 @@ L(exit):
L(loop):
movdqa 64(%rax), %xmm0
- pminub 80(%rax), %xmm0
- pminub 96(%rax), %xmm0
- pminub 112(%rax), %xmm0
- pcmpeqb %xmm3, %xmm0
+ PMINU 80(%rax), %xmm0
+ PMINU 96(%rax), %xmm0
+ PMINU 112(%rax), %xmm0
+ PCMPEQ %xmm3, %xmm0
pmovmskb %xmm0, %edx
testl %edx, %edx
jne L(exit64)
@@ -212,10 +230,10 @@ L(loop):
subq $-128, %rax
movdqa (%rax), %xmm0
- pminub 16(%rax), %xmm0
- pminub 32(%rax), %xmm0
- pminub 48(%rax), %xmm0
- pcmpeqb %xmm3, %xmm0
+ PMINU 16(%rax), %xmm0
+ PMINU 32(%rax), %xmm0
+ PMINU 48(%rax), %xmm0
+ PCMPEQ %xmm3, %xmm0
pmovmskb %xmm0, %edx
testl %edx, %edx
jne L(exit0)
@@ -231,6 +249,7 @@ L(exit0):
bsfq %rdx, %rdx
addq %rdx, %rax
subq %rdi, %rax
+ SHIFT_RETURN
ret
#endif
diff --git a/sysdeps/x86_64/strncase_l-nonascii.c b/sysdeps/x86_64/strncase_l-nonascii.c
index 8664863778..e3d83a06cd 100644
--- a/sysdeps/x86_64/strncase_l-nonascii.c
+++ b/sysdeps/x86_64/strncase_l-nonascii.c
@@ -1,7 +1,7 @@
#include <string.h>
extern int __strncasecmp_l_nonascii (const char *__s1, const char *__s2,
- size_t __n, __locale_t __loc);
+ size_t __n, locale_t __loc);
#define __strncasecmp_l __strncasecmp_l_nonascii
#define USE_IN_EXTENDED_LOCALE_MODEL 1
diff --git a/sysdeps/x86_64/strpbrk.S b/sysdeps/x86_64/strpbrk.S
index 9b97ada84e..21888a5b92 100644
--- a/sysdeps/x86_64/strpbrk.S
+++ b/sysdeps/x86_64/strpbrk.S
@@ -1,2 +1,3 @@
#define strcspn strpbrk
+#define USE_AS_STRPBRK
#include <sysdeps/x86_64/strcspn.S>
diff --git a/sysdeps/x86_64/strrchr.S b/sysdeps/x86_64/strrchr.S
index de0be762ed..aca98e7eaa 100644
--- a/sysdeps/x86_64/strrchr.S
+++ b/sysdeps/x86_64/strrchr.S
@@ -1,5 +1,5 @@
/* strrchr (str, ch) -- Return pointer to last occurrence of CH in STR.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/strspn.S b/sysdeps/x86_64/strspn.S
index 49dd4ba9f5..635f1bc6ce 100644
--- a/sysdeps/x86_64/strspn.S
+++ b/sysdeps/x86_64/strspn.S
@@ -1,7 +1,7 @@
/* strspn (str, ss) -- Return the length of the initial segment of STR
which contains only characters from SS.
For AMD x86-64.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>.
Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>.
diff --git a/sysdeps/x86_64/strtok.S b/sysdeps/x86_64/strtok.S
deleted file mode 100644
index bd5b103d50..0000000000
--- a/sysdeps/x86_64/strtok.S
+++ /dev/null
@@ -1,208 +0,0 @@
-/* strtok (str, delim) -- Return next DELIM separated token from STR.
- For AMD x86-64.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Based on i686 version contributed by Ulrich Drepper
- <drepper@cygnus.com>, 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/>. */
-
-#include <sysdep.h>
-#include "asm-syntax.h"
-
-/* This file can be used for the strtok and strtok_r functions:
-
- strtok:
- INPUT PARAMETER:
- str %rdi
- delim %rsi
-
- strtok_r:
- INPUT PARAMETER:
- str %rdi
- delim %rsi
- save_ptr %rdx
-
- We do a common implementation here. */
-
-#ifdef USE_AS_STRTOK_R
-# define SAVE_PTR (%r9)
-#else
- .bss
- .local save_ptr
- .type save_ptr, @object
- .size save_ptr, LP_SIZE
-save_ptr:
- .space LP_SIZE
-
-# ifdef PIC
-# define SAVE_PTR save_ptr(%rip)
-# else
-# define SAVE_PTR save_ptr
-# endif
-
-# define FUNCTION strtok
-#endif
-
- .text
-ENTRY (FUNCTION)
- /* First we create a table with flags for all possible characters.
- For the ASCII (7bit/8bit) or ISO-8859-X character sets which are
- supported by the C string functions we have 256 characters.
- Before inserting marks for the stop characters we clear the whole
- table. */
- movq %rdi, %r8 /* Save value. */
- subq $256, %rsp /* Make space for 256 bytes. */
- cfi_adjust_cfa_offset(256)
- movl $32, %ecx /* 32*8 bytes = 256 bytes. */
- movq %rsp, %rdi
- xorl %eax, %eax /* We store 0s. */
- cld
- rep
- stosq
-
- /* Note: %rcx = 0 !!! */
-
-#ifdef USE_AS_STRTOK_R
- /* The value is stored in the third argument. */
- mov %RDX_LP, %R9_LP /* Save value - see def. of SAVE_PTR. */
- mov (%rdx), %RAX_LP
-#else
- /* The value is in the local variable defined above. But
- we have to take care for PIC code. */
- mov SAVE_PTR, %RAX_LP
-#endif
- movq %r8, %rdx /* Get start of string. */
-
- /* If the pointer is NULL we have to use the stored value of
- the last run. */
- cmpq $0, %rdx
- cmove %rax, %rdx
- testq %rdx, %rdx
- jz L(returnNULL)
- movq %rsi, %rax /* Get start of delimiter set. */
-
-/* For understanding the following code remember that %rcx == 0 now.
- Although all the following instruction only modify %cl we always
- have a correct zero-extended 64-bit value in %rcx. */
-
-L(2): movb (%rax), %cl /* get byte from stopset */
- testb %cl, %cl /* is NUL char? */
- jz L(1) /* yes => start compare loop */
- movb %cl, (%rsp,%rcx) /* set corresponding byte in stopset table */
-
- movb 1(%rax), %cl /* get byte from stopset */
- testb $0xff, %cl /* is NUL char? */
- jz L(1) /* yes => start compare loop */
- movb %cl, (%rsp,%rcx) /* set corresponding byte in stopset table */
-
- movb 2(%rax), %cl /* get byte from stopset */
- testb $0xff, %cl /* is NUL char? */
- jz L(1) /* yes => start compare loop */
- movb %cl, (%rsp,%rcx) /* set corresponding byte in stopset table */
-
- movb 3(%rax), %cl /* get byte from stopset */
- addq $4, %rax /* increment stopset pointer */
- movb %cl, (%rsp,%rcx) /* set corresponding byte in stopset table */
- testb $0xff, %cl /* is NUL char? */
- jnz L(2) /* no => process next dword from stopset */
-
-L(1):
-
- leaq -4(%rdx), %rax /* prepare loop */
-
- /* We use a neat trick for the following loop. Normally we would
- have to test for two termination conditions
- 1. a character in the stopset was found
- and
- 2. the end of the string was found
- As a sign that the character is in the stopset we store its
- value in the table. The value of NUL is NUL so the loop
- terminates for NUL in every case. */
-
-L(3): addq $4, %rax /* adjust pointer for full loop round */
-
- movb (%rax), %cl /* get byte from string */
- testb %cl, (%rsp,%rcx) /* is it contained in stopset? */
- jz L(4) /* no => start of token */
-
- movb 1(%rax), %cl /* get byte from string */
- testb %cl, (%rsp,%rcx) /* is it contained in stopset? */
- jz L(5) /* no => start of token */
-
- movb 2(%rax), %cl /* get byte from string */
- testb %cl, (%rsp,%rcx) /* is it contained in stopset? */
- jz L(6) /* no => start of token */
-
- movb 3(%rax), %cl /* get byte from string */
- testb %cl, (%rsp,%rcx) /* is it contained in stopset? */
- jnz L(3) /* yes => start of loop */
-
- incq %rax /* adjust pointer */
-L(6): incq %rax
-L(5): incq %rax
-
- /* Now we have to terminate the string. */
-
-L(4): leaq -4(%rax), %rdx /* We use %rDX for the next run. */
-
-L(7): addq $4, %rdx /* adjust pointer for full loop round */
-
- movb (%rdx), %cl /* get byte from string */
- cmpb %cl, (%rsp,%rcx) /* is it contained in skipset? */
- je L(8) /* yes => return */
-
- movb 1(%rdx), %cl /* get byte from string */
- cmpb %cl, (%rsp,%rcx) /* is it contained in skipset? */
- je L(9) /* yes => return */
-
- movb 2(%rdx), %cl /* get byte from string */
- cmpb %cl, (%rsp,%rcx) /* is it contained in skipset? */
- je L(10) /* yes => return */
-
- movb 3(%rdx), %cl /* get byte from string */
- cmpb %cl, (%rsp,%rcx) /* is it contained in skipset? */
- jne L(7) /* no => start loop again */
-
- incq %rdx /* adjust pointer */
-L(10): incq %rdx
-L(9): incq %rdx
-
-L(8): cmpq %rax, %rdx
- je L(returnNULL) /* There was no token anymore. */
-
- movb $0, (%rdx) /* Terminate string. */
-
- /* Are we at end of string? */
- cmpb $0, %cl
- leaq 1(%rdx), %rcx
- cmovne %rcx, %rdx
-
- /* Store the pointer to the next character. */
- mov %RDX_LP, SAVE_PTR
-
-L(epilogue):
- /* Remove the stopset table. */
- addq $256, %rsp
- cfi_adjust_cfa_offset(-256)
- retq
-
-L(returnNULL):
- xorl %eax, %eax
- /* Store the pointer to the next character. */
- mov %RDX_LP, SAVE_PTR
- jmp L(epilogue)
-
-END (FUNCTION)
diff --git a/sysdeps/x86_64/strtok_r.S b/sysdeps/x86_64/strtok_r.S
deleted file mode 100644
index f0db78c67a..0000000000
--- a/sysdeps/x86_64/strtok_r.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#define FUNCTION __strtok_r
-#define USE_AS_STRTOK_R 1
-#include <sysdeps/x86_64/strtok.S>
-weak_alias (__strtok_r, strtok_r)
-strong_alias (__strtok_r, __GI___strtok_r)
diff --git a/sysdeps/x86_64/sub_n.S b/sysdeps/x86_64/sub_n.S
index cc9bc48b01..e70d48ba47 100644
--- a/sysdeps/x86_64/sub_n.S
+++ b/sysdeps/x86_64/sub_n.S
@@ -1,6 +1,6 @@
/* x86-64 __mpn_sub_n -- Add two limb vectors of the same length > 0 and store
sum in a third limb vector.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/x86_64/submul_1.S b/sysdeps/x86_64/submul_1.S
index 3037cb9c45..ba1bf92bc5 100644
--- a/sysdeps/x86_64/submul_1.S
+++ b/sysdeps/x86_64/submul_1.S
@@ -1,6 +1,6 @@
/* x86-64 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
the result from a second limb vector.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h
index fbe3560588..1738d7f955 100644
--- a/sysdeps/x86_64/sysdep.h
+++ b/sysdeps/x86_64/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for x86-64.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
#ifndef _X86_64_SYSDEP_H
#define _X86_64_SYSDEP_H 1
-#include <sysdeps/generic/sysdep.h>
+#include <sysdeps/x86/sysdep.h>
#ifdef __ASSEMBLER__
@@ -32,28 +32,6 @@
#define cfi_offset_rel_rsp(regn, off) .cfi_escape 0x10, regn, 0x4, 0x13, \
0x77, off & 0x7F | 0x80, off >> 7
-/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */
-#define ALIGNARG(log2) 1<<log2
-#define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
-
-
-/* Define an entry point visible from C. */
-#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- .type C_SYMBOL_NAME(name),@function; \
- .align ALIGNARG(4); \
- C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- ASM_SIZE_DIRECTIVE(name)
-
-#define ENTRY_CHK(name) ENTRY (name)
-#define END_CHK(name) END (name)
-
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
/* The mcount code relies on a normal frame pointer being on the stack
@@ -70,12 +48,6 @@
#define CALL_MCOUNT /* Do nothing. */
#endif
-/* Since C identifiers are not normally prefixed with an underscore
- on this system, the asm identifier `syscall_error' intrudes on the
- C name space. Make sure we use an innocuous name. */
-#define syscall_error __syscall_error
-#define mcount _mcount
-
#define PSEUDO(name, syscall_name, args) \
lose: \
jmp JUMPTARGET(syscall_error) \
@@ -84,25 +56,18 @@ lose: \
DO_CALL (syscall_name, args); \
jb lose
-#undef PSEUDO_END
-#define PSEUDO_END(name) \
- END (name)
-
#undef JUMPTARGET
-#ifdef PIC
-#define JUMPTARGET(name) name##@PLT
+#ifdef SHARED
+# ifdef BIND_NOW
+# define JUMPTARGET(name) *name##@GOTPCREL(%rip)
+# else
+# define JUMPTARGET(name) name##@PLT
+# endif
#else
-#define JUMPTARGET(name) name
+/* For static archives, branch to target directly. */
+# define JUMPTARGET(name) name
#endif
-/* Local label name for asm code. */
-#ifndef L
-/* ELF-like local names start with `.L'. */
-# define L(name) .L##name
-#endif
-
-#define atom_text_section .section ".text.atom", "ax"
-
/* Long and pointer size in bytes. */
#define LP_SIZE 8
diff --git a/sysdeps/x86_64/tls_get_addr.S b/sysdeps/x86_64/tls_get_addr.S
new file mode 100644
index 0000000000..cf8c6d101b
--- /dev/null
+++ b/sysdeps/x86_64/tls_get_addr.S
@@ -0,0 +1,61 @@
+/* Stack-aligning implementation of __tls_get_addr. x86-64 version.
+ Copyright (C) 2017-2018 Free Software 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 SHARED
+
+# include <sysdep.h>
+# include "tlsdesc.h"
+# include "rtld-offsets.h"
+
+/* See __tls_get_addr and __tls_get_addr_slow in dl-tls.c. This function
+ call __tls_get_addr_slow on both slow paths. It realigns the stack
+ before the call to work around GCC PR58066. */
+
+ENTRY (__tls_get_addr)
+ mov %fs:DTV_OFFSET, %RDX_LP
+ mov GL_TLS_GENERATION_OFFSET+_rtld_local(%rip), %RAX_LP
+ /* GL(dl_tls_generation) == dtv[0].counter */
+ cmp %RAX_LP, (%rdx)
+ jne 1f
+ mov TI_MODULE_OFFSET(%rdi), %RAX_LP
+ /* dtv[ti->ti_module] */
+# ifdef __LP64__
+ salq $4, %rax
+ movq (%rdx,%rax), %rax
+# else
+ movl (%rdx,%rax, 8), %eax
+# endif
+ cmp $-1, %RAX_LP
+ je 1f
+ add TI_OFFSET_OFFSET(%rdi), %RAX_LP
+ ret
+1:
+ /* On the slow path, align the stack. */
+ pushq %rbp
+ cfi_def_cfa_offset (16)
+ cfi_offset (%rbp, -16)
+ mov %RSP_LP, %RBP_LP
+ cfi_def_cfa_register (%rbp)
+ and $-16, %RSP_LP
+ call __tls_get_addr_slow
+ mov %RBP_LP, %RSP_LP
+ popq %rbp
+ cfi_def_cfa (%rsp, 8)
+ ret
+END (__tls_get_addr)
+#endif /* SHARED */
diff --git a/sysdeps/x86_64/tlsdesc.c b/sysdeps/x86_64/tlsdesc.c
index aff8b67941..302d097dbb 100644
--- a/sysdeps/x86_64/tlsdesc.c
+++ b/sysdeps/x86_64/tlsdesc.c
@@ -1,5 +1,5 @@
/* Manage TLS descriptors. x86_64 version.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -134,7 +134,6 @@ _dl_tlsdesc_resolve_hold_fixup (struct tlsdesc volatile *td,
if there is one. */
void
-internal_function
_dl_unmap (struct link_map *map)
{
_dl_unmap_segments (map);
diff --git a/sysdeps/x86_64/tlsdesc.sym b/sysdeps/x86_64/tlsdesc.sym
index 33854975d0..fc897ab4b5 100644
--- a/sysdeps/x86_64/tlsdesc.sym
+++ b/sysdeps/x86_64/tlsdesc.sym
@@ -15,3 +15,6 @@ TLSDESC_ARG offsetof(struct tlsdesc, arg)
TLSDESC_GEN_COUNT offsetof(struct tlsdesc_dynamic_arg, gen_count)
TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
+
+TI_MODULE_OFFSET offsetof(tls_index, ti_module)
+TI_OFFSET_OFFSET offsetof(tls_index, ti_offset)
diff --git a/sysdeps/x86_64/tst-audit.h b/sysdeps/x86_64/tst-audit.h
index 94e9dd5282..623ef8920c 100644
--- a/sysdeps/x86_64/tst-audit.h
+++ b/sysdeps/x86_64/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. x86_64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/tst-audit10-aux.c b/sysdeps/x86_64/tst-audit10-aux.c
new file mode 100644
index 0000000000..e1b2d92f75
--- /dev/null
+++ b/sysdeps/x86_64/tst-audit10-aux.c
@@ -0,0 +1,41 @@
+/* Test case for preserved AVX512 registers in dynamic linker, -mavx512f part.
+ Copyright (C) 2012-2018 Free Software 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 <immintrin.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+tst_audit10_aux (void)
+{
+#ifdef __AVX512F__
+ extern __m512i audit_test (__m512i, __m512i, __m512i, __m512i,
+ __m512i, __m512i, __m512i, __m512i);
+
+ __m512i zmm = _mm512_setzero_si512 ();
+ __m512i ret = audit_test (zmm, zmm, zmm, zmm, zmm, zmm, zmm, zmm);
+
+ zmm = _mm512_set1_epi64 (0x12349876);
+
+ if (memcmp (&zmm, &ret, sizeof (ret)))
+ abort ();
+ return 0;
+#else /* __AVX512F__ */
+ return 77;
+#endif /* __AVX512F__ */
+}
diff --git a/sysdeps/x86_64/tst-audit10.c b/sysdeps/x86_64/tst-audit10.c
index d104341be8..568011cb96 100644
--- a/sysdeps/x86_64/tst-audit10.c
+++ b/sysdeps/x86_64/tst-audit10.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Test case for preserved AVX512 registers in dynamic linker.
+ Copyright (C) 2012-2018 Free Software 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,17 +16,14 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* Test case for x86-64 preserved registers in dynamic linker. */
-
-#ifdef __AVX512F__
-#include <stdlib.h>
-#include <string.h>
#include <cpuid.h>
-#include <immintrin.h>
+
+int tst_audit10_aux (void);
static int
avx512_enabled (void)
{
+#ifdef bit_AVX512F
unsigned int eax, ebx, ecx, edx;
if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
@@ -40,34 +38,20 @@ avx512_enabled (void)
/* Verify that ZMM, YMM and XMM states are enabled. */
return (eax & 0xe6) == 0xe6;
+#else
+ return 0;
+#endif
}
-
-extern __m512i audit_test (__m512i, __m512i, __m512i, __m512i,
- __m512i, __m512i, __m512i, __m512i);
static int
do_test (void)
{
/* Run AVX512 test only if AVX512 is supported. */
if (avx512_enabled ())
- {
- __m512i zmm = _mm512_setzero_si512 ();
- __m512i ret = audit_test (zmm, zmm, zmm, zmm, zmm, zmm, zmm, zmm);
-
- zmm = _mm512_set1_epi64 (0x12349876);
-
- if (memcmp (&zmm, &ret, sizeof (ret)))
- abort ();
- }
- return 0;
-}
-#else
-static int
-do_test (void)
-{
- return 0;
+ return tst_audit10_aux ();
+ else
+ return 77;
}
-#endif
#define TEST_FUNCTION do_test ()
#include "../../test-skeleton.c"
diff --git a/sysdeps/x86_64/tst-audit4-aux.c b/sysdeps/x86_64/tst-audit4-aux.c
new file mode 100644
index 0000000000..2770be5b5e
--- /dev/null
+++ b/sysdeps/x86_64/tst-audit4-aux.c
@@ -0,0 +1,39 @@
+/* Test case for preserved AVX registers in dynamic linker, -mavx part.
+ Copyright (C) 2009-2018 Free Software 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 <immintrin.h>
+#include <stdlib.h>
+#include <string.h>
+
+extern __m256i audit_test (__m256i, __m256i, __m256i, __m256i,
+ __m256i, __m256i, __m256i, __m256i);
+
+int
+tst_audit4_aux (void)
+{
+#ifdef __AVX__
+ __m256i ymm = _mm256_setzero_si256 ();
+ __m256i ret = audit_test (ymm, ymm, ymm, ymm, ymm, ymm, ymm, ymm);
+ ymm = _mm256_set1_epi32 (0x12349876);
+ if (memcmp (&ymm, &ret, sizeof (ret)))
+ abort ();
+ return 0;
+#else /* __AVX__ */
+ return 77;
+#endif /* __AVX__ */
+}
diff --git a/sysdeps/x86_64/tst-audit4.c b/sysdeps/x86_64/tst-audit4.c
index 44d51231e3..d7ca24ac2d 100644
--- a/sysdeps/x86_64/tst-audit4.c
+++ b/sysdeps/x86_64/tst-audit4.c
@@ -1,11 +1,24 @@
-/* Test case for x86-64 preserved registers in dynamic linker. */
+/* Test case for preserved AVX registers in dynamic linker.
+ Copyright (C) 2009-2018 Free Software 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 __AVX__
-#include <stdlib.h>
-#include <string.h>
#include <cpuid.h>
-#include <immintrin.h>
+int tst_audit4_aux (void);
static int
avx_enabled (void)
@@ -22,31 +35,15 @@ avx_enabled (void)
return (eax & 6) == 6;
}
-
-extern __m256i audit_test (__m256i, __m256i, __m256i, __m256i,
- __m256i, __m256i, __m256i, __m256i);
static int
do_test (void)
{
/* Run AVX test only if AVX is supported. */
if (avx_enabled ())
- {
- __m256i ymm = _mm256_setzero_si256 ();
- __m256i ret = audit_test (ymm, ymm, ymm, ymm, ymm, ymm, ymm, ymm);
-
- ymm = _mm256_set1_epi32 (0x12349876);
- if (memcmp (&ymm, &ret, sizeof (ret)))
- abort ();
- }
- return 0;
-}
-#else
-static int
-do_test (void)
-{
- return 0;
+ return tst_audit4_aux ();
+ else
+ return 77;
}
-#endif
#define TEST_FUNCTION do_test ()
#include "../../test-skeleton.c"
diff --git a/sysdeps/x86_64/tst-auditmod10a.c b/sysdeps/x86_64/tst-auditmod10a.c
index e94dbaf7fe..ff6021a79a 100644
--- a/sysdeps/x86_64/tst-auditmod10a.c
+++ b/sysdeps/x86_64/tst-auditmod10a.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/tst-auditmod10b.c b/sysdeps/x86_64/tst-auditmod10b.c
index ad6fcafdda..de1bbbb7fb 100644
--- a/sysdeps/x86_64/tst-auditmod10b.c
+++ b/sysdeps/x86_64/tst-auditmod10b.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,8 @@
function parameter passing/return. */
#include <dlfcn.h>
+#include <link.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sysdeps/x86_64/tst-auditmod3b.c b/sysdeps/x86_64/tst-auditmod3b.c
index 1a41ca80c0..7aad92382e 100644
--- a/sysdeps/x86_64/tst-auditmod3b.c
+++ b/sysdeps/x86_64/tst-auditmod3b.c
@@ -2,6 +2,8 @@
function parameter passing/return. */
#include <dlfcn.h>
+#include <link.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sysdeps/x86_64/tst-auditmod4b.c b/sysdeps/x86_64/tst-auditmod4b.c
index 2b0d827e88..1153ea442c 100644
--- a/sysdeps/x86_64/tst-auditmod4b.c
+++ b/sysdeps/x86_64/tst-auditmod4b.c
@@ -2,6 +2,8 @@
function parameter passing/return. */
#include <dlfcn.h>
+#include <link.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sysdeps/x86_64/tst-auditmod5b.c b/sysdeps/x86_64/tst-auditmod5b.c
index a74d261f03..6a280fd61b 100644
--- a/sysdeps/x86_64/tst-auditmod5b.c
+++ b/sysdeps/x86_64/tst-auditmod5b.c
@@ -2,6 +2,8 @@
function parameter passing/return. */
#include <dlfcn.h>
+#include <link.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sysdeps/x86_64/tst-auditmod6b.c b/sysdeps/x86_64/tst-auditmod6b.c
index 886fc33e9b..3533602c07 100644
--- a/sysdeps/x86_64/tst-auditmod6b.c
+++ b/sysdeps/x86_64/tst-auditmod6b.c
@@ -2,6 +2,8 @@
function parameter passing/return. */
#include <dlfcn.h>
+#include <link.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sysdeps/x86_64/tst-auditmod6c.c b/sysdeps/x86_64/tst-auditmod6c.c
index b2ee24d8bf..8000e89224 100644
--- a/sysdeps/x86_64/tst-auditmod6c.c
+++ b/sysdeps/x86_64/tst-auditmod6c.c
@@ -2,6 +2,8 @@
function parameter passing/return. */
#include <dlfcn.h>
+#include <link.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sysdeps/x86_64/tst-auditmod7b.c b/sysdeps/x86_64/tst-auditmod7b.c
index f27076d3bb..5abe6d1bc9 100644
--- a/sysdeps/x86_64/tst-auditmod7b.c
+++ b/sysdeps/x86_64/tst-auditmod7b.c
@@ -2,6 +2,8 @@
function parameter passing/return. */
#include <dlfcn.h>
+#include <link.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sysdeps/x86_64/tst-avx-aux.c b/sysdeps/x86_64/tst-avx-aux.c
new file mode 100644
index 0000000000..e6ae368fd8
--- /dev/null
+++ b/sysdeps/x86_64/tst-avx-aux.c
@@ -0,0 +1,47 @@
+/* Test case for preserved AVX registers in dynamic linker, -mavx part.
+ Copyright (C) 2017-2018 Free Software 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 <immintrin.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+tst_avx_aux (void)
+{
+#ifdef __AVX__
+ extern __m256i avx_test (__m256i, __m256i, __m256i, __m256i,
+ __m256i, __m256i, __m256i, __m256i);
+
+ __m256i ymm0 = _mm256_set1_epi32 (0);
+ __m256i ymm1 = _mm256_set1_epi32 (1);
+ __m256i ymm2 = _mm256_set1_epi32 (2);
+ __m256i ymm3 = _mm256_set1_epi32 (3);
+ __m256i ymm4 = _mm256_set1_epi32 (4);
+ __m256i ymm5 = _mm256_set1_epi32 (5);
+ __m256i ymm6 = _mm256_set1_epi32 (6);
+ __m256i ymm7 = _mm256_set1_epi32 (7);
+ __m256i ret = avx_test (ymm0, ymm1, ymm2, ymm3,
+ ymm4, ymm5, ymm6, ymm7);
+ ymm0 = _mm256_set1_epi32 (0x12349876);
+ if (memcmp (&ymm0, &ret, sizeof (ret)))
+ abort ();
+ return 0;
+#else /* __AVX__ */
+ return 77;
+#endif /* __AVX__ */
+}
diff --git a/sysdeps/x86_64/tst-avx.c b/sysdeps/x86_64/tst-avx.c
new file mode 100644
index 0000000000..9c52fc264a
--- /dev/null
+++ b/sysdeps/x86_64/tst-avx.c
@@ -0,0 +1,49 @@
+/* Test case for preserved AVX registers in dynamic linker.
+ Copyright (C) 2017-2018 Free Software 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 <cpuid.h>
+
+int tst_avx_aux (void);
+
+static int
+avx_enabled (void)
+{
+ unsigned int eax, ebx, ecx, edx;
+
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
+ || (ecx & (bit_AVX | bit_OSXSAVE)) != (bit_AVX | bit_OSXSAVE))
+ return 0;
+
+ /* Check the OS has AVX and SSE saving enabled. */
+ asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
+
+ return (eax & 6) == 6;
+}
+
+static int
+do_test (void)
+{
+ /* Run AVX test only if AVX is supported. */
+ if (avx_enabled ())
+ return tst_avx_aux ();
+ else
+ return 77;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../../test-skeleton.c"
diff --git a/sysdeps/x86_64/tst-avx512-aux.c b/sysdeps/x86_64/tst-avx512-aux.c
new file mode 100644
index 0000000000..87c4124398
--- /dev/null
+++ b/sysdeps/x86_64/tst-avx512-aux.c
@@ -0,0 +1,48 @@
+/* Test case for preserved AVX512 registers in dynamic linker,
+ -mavx512 part.
+ Copyright (C) 2017-2018 Free Software 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 <immintrin.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+tst_avx512_aux (void)
+{
+#ifdef __AVX512F__
+ extern __m512i avx512_test (__m512i, __m512i, __m512i, __m512i,
+ __m512i, __m512i, __m512i, __m512i);
+
+ __m512i zmm0 = _mm512_set1_epi32 (0);
+ __m512i zmm1 = _mm512_set1_epi32 (1);
+ __m512i zmm2 = _mm512_set1_epi32 (2);
+ __m512i zmm3 = _mm512_set1_epi32 (3);
+ __m512i zmm4 = _mm512_set1_epi32 (4);
+ __m512i zmm5 = _mm512_set1_epi32 (5);
+ __m512i zmm6 = _mm512_set1_epi32 (6);
+ __m512i zmm7 = _mm512_set1_epi32 (7);
+ __m512i ret = avx512_test (zmm0, zmm1, zmm2, zmm3,
+ zmm4, zmm5, zmm6, zmm7);
+ zmm0 = _mm512_set1_epi32 (0x12349876);
+ if (memcmp (&zmm0, &ret, sizeof (ret)))
+ abort ();
+ return 0;
+#else /* __AVX512F__ */
+ return 77;
+#endif /* __AVX512F__ */
+}
diff --git a/sysdeps/x86_64/tst-avx512.c b/sysdeps/x86_64/tst-avx512.c
new file mode 100644
index 0000000000..63d8bc9c27
--- /dev/null
+++ b/sysdeps/x86_64/tst-avx512.c
@@ -0,0 +1,57 @@
+/* Test case for preserved AVX512 registers in dynamic linker.
+ Copyright (C) 2017-2018 Free Software 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 <cpuid.h>
+
+int tst_avx512_aux (void);
+
+static int
+avx512_enabled (void)
+{
+#ifdef bit_AVX512F
+ unsigned int eax, ebx, ecx, edx;
+
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
+ || (ecx & (bit_AVX | bit_OSXSAVE)) != (bit_AVX | bit_OSXSAVE))
+ return 0;
+
+ __cpuid_count (7, 0, eax, ebx, ecx, edx);
+ if (!(ebx & bit_AVX512F))
+ return 0;
+
+ asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
+
+ /* Verify that ZMM, YMM and XMM states are enabled. */
+ return (eax & 0xe6) == 0xe6;
+#else
+ return 0;
+#endif
+}
+
+static int
+do_test (void)
+{
+ /* Run AVX512 test only if AVX512 is supported. */
+ if (avx512_enabled ())
+ return tst_avx512_aux ();
+ else
+ return 77;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../../test-skeleton.c"
diff --git a/sysdeps/x86_64/tst-avx512mod.c b/sysdeps/x86_64/tst-avx512mod.c
new file mode 100644
index 0000000000..4cfb3a2c3d
--- /dev/null
+++ b/sysdeps/x86_64/tst-avx512mod.c
@@ -0,0 +1,48 @@
+/* Test case for x86-64 preserved AVX512 registers in dynamic linker. */
+
+#ifdef __AVX512F__
+#include <stdlib.h>
+#include <string.h>
+#include <immintrin.h>
+
+__m512i
+avx512_test (__m512i x0, __m512i x1, __m512i x2, __m512i x3,
+ __m512i x4, __m512i x5, __m512i x6, __m512i x7)
+{
+ __m512i zmm;
+
+ zmm = _mm512_set1_epi32 (0);
+ if (memcmp (&zmm, &x0, sizeof (zmm)))
+ abort ();
+
+ zmm = _mm512_set1_epi32 (1);
+ if (memcmp (&zmm, &x1, sizeof (zmm)))
+ abort ();
+
+ zmm = _mm512_set1_epi32 (2);
+ if (memcmp (&zmm, &x2, sizeof (zmm)))
+ abort ();
+
+ zmm = _mm512_set1_epi32 (3);
+ if (memcmp (&zmm, &x3, sizeof (zmm)))
+ abort ();
+
+ zmm = _mm512_set1_epi32 (4);
+ if (memcmp (&zmm, &x4, sizeof (zmm)))
+ abort ();
+
+ zmm = _mm512_set1_epi32 (5);
+ if (memcmp (&zmm, &x5, sizeof (zmm)))
+ abort ();
+
+ zmm = _mm512_set1_epi32 (6);
+ if (memcmp (&zmm, &x6, sizeof (zmm)))
+ abort ();
+
+ zmm = _mm512_set1_epi32 (7);
+ if (memcmp (&zmm, &x7, sizeof (zmm)))
+ abort ();
+
+ return _mm512_set1_epi32 (0x12349876);
+}
+#endif
diff --git a/sysdeps/x86_64/tst-avxmod.c b/sysdeps/x86_64/tst-avxmod.c
new file mode 100644
index 0000000000..6e5b154997
--- /dev/null
+++ b/sysdeps/x86_64/tst-avxmod.c
@@ -0,0 +1,48 @@
+/* Test case for x86-64 preserved AVX registers in dynamic linker. */
+
+#ifdef __AVX__
+#include <stdlib.h>
+#include <string.h>
+#include <immintrin.h>
+
+__m256i
+avx_test (__m256i x0, __m256i x1, __m256i x2, __m256i x3,
+ __m256i x4, __m256i x5, __m256i x6, __m256i x7)
+{
+ __m256i ymm;
+
+ ymm = _mm256_set1_epi32 (0);
+ if (memcmp (&ymm, &x0, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (1);
+ if (memcmp (&ymm, &x1, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (2);
+ if (memcmp (&ymm, &x2, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (3);
+ if (memcmp (&ymm, &x3, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (4);
+ if (memcmp (&ymm, &x4, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (5);
+ if (memcmp (&ymm, &x5, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (6);
+ if (memcmp (&ymm, &x6, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (7);
+ if (memcmp (&ymm, &x7, sizeof (ymm)))
+ abort ();
+
+ return _mm256_set1_epi32 (0x12349876);
+}
+#endif
diff --git a/sysdeps/x86_64/tst-mallocalign1.c b/sysdeps/x86_64/tst-mallocalign1.c
index 3897af86c1..0f2e725e3b 100644
--- a/sysdeps/x86_64/tst-mallocalign1.c
+++ b/sysdeps/x86_64/tst-mallocalign1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/tst-platform-1.c b/sysdeps/x86_64/tst-platform-1.c
new file mode 100644
index 0000000000..91dbbb93db
--- /dev/null
+++ b/sysdeps/x86_64/tst-platform-1.c
@@ -0,0 +1,29 @@
+/* Test PRELOAD with $PLATFORM.
+ Copyright (C) 2017-2018 Free Software 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 <stdlib.h>
+
+extern int preload (void);
+
+static int
+do_test (void)
+{
+ return preload () == 0x1234 ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/x86_64/tst-platformmod-1.c b/sysdeps/x86_64/tst-platformmod-1.c
new file mode 100644
index 0000000000..be0e786e76
--- /dev/null
+++ b/sysdeps/x86_64/tst-platformmod-1.c
@@ -0,0 +1,23 @@
+/* Test PRELOAD with $PLATFORM.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+int
+preload (void)
+{
+ return 0;
+}
diff --git a/sysdeps/x86_64/tst-platformmod-2.c b/sysdeps/x86_64/tst-platformmod-2.c
new file mode 100644
index 0000000000..413d0bd94b
--- /dev/null
+++ b/sysdeps/x86_64/tst-platformmod-2.c
@@ -0,0 +1,23 @@
+/* Test PRELOAD with $PLATFORM.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+int
+preload (void)
+{
+ return 0x1234;
+}
diff --git a/sysdeps/x86_64/tst-quad1.c b/sysdeps/x86_64/tst-quad1.c
index 1cb63a748f..089b25d2df 100644
--- a/sysdeps/x86_64/tst-quad1.c
+++ b/sysdeps/x86_64/tst-quad1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/tst-quadmod1.S b/sysdeps/x86_64/tst-quadmod1.S
index 588c5016b6..c60f9dc89d 100644
--- a/sysdeps/x86_64/tst-quadmod1.S
+++ b/sysdeps/x86_64/tst-quadmod1.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,6 +28,9 @@
.type func, @function
func:
.cfi_startproc
+#if defined __CET__ && (__CET__ & 1) != 0
+ endbr64
+#endif
xorl %edi, %edi
jmp exit@PLT
.cfi_endproc
@@ -37,6 +40,9 @@ func:
foo:
.cfi_startproc
.cfi_def_cfa_register 6
+#if defined __CET__ && (__CET__ & 1) != 0
+ endbr64
+#endif
movq .Ljmp(%rip), %rax
subq $BIAS, %rax
jmp *%rax
diff --git a/sysdeps/x86_64/tst-quadmod2.S b/sysdeps/x86_64/tst-quadmod2.S
index 7409a9eaa3..af03444d4f 100644
--- a/sysdeps/x86_64/tst-quadmod2.S
+++ b/sysdeps/x86_64/tst-quadmod2.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,9 @@
.type func, @function
func:
.cfi_startproc
+#if defined __CET__ && (__CET__ & 1) != 0
+ endbr64
+#endif
xorl %edi, %edi
jmp exit@PLT
.cfi_endproc
@@ -36,6 +39,9 @@ func:
foo:
.cfi_startproc
.cfi_def_cfa_register 6
+#if defined __CET__ && (__CET__ & 1) != 0
+ endbr64
+#endif
movq .Ljmp(%rip), %rax
subq $BIAS, %rax
jmp *%rax
diff --git a/sysdeps/x86_64/tst-sse.c b/sysdeps/x86_64/tst-sse.c
new file mode 100644
index 0000000000..d219889d1f
--- /dev/null
+++ b/sysdeps/x86_64/tst-sse.c
@@ -0,0 +1,46 @@
+/* Test case for preserved SSE registers in dynamic linker.
+ Copyright (C) 2017-2018 Free Software 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 <immintrin.h>
+#include <stdlib.h>
+#include <string.h>
+
+extern __m128i sse_test (__m128i, __m128i, __m128i, __m128i,
+ __m128i, __m128i, __m128i, __m128i);
+
+static int
+do_test (void)
+{
+ __m128i xmm0 = _mm_set1_epi32 (0);
+ __m128i xmm1 = _mm_set1_epi32 (1);
+ __m128i xmm2 = _mm_set1_epi32 (2);
+ __m128i xmm3 = _mm_set1_epi32 (3);
+ __m128i xmm4 = _mm_set1_epi32 (4);
+ __m128i xmm5 = _mm_set1_epi32 (5);
+ __m128i xmm6 = _mm_set1_epi32 (6);
+ __m128i xmm7 = _mm_set1_epi32 (7);
+ __m128i ret = sse_test (xmm0, xmm1, xmm2, xmm3,
+ xmm4, xmm5, xmm6, xmm7);
+ xmm0 = _mm_set1_epi32 (0x12349876);
+ if (memcmp (&xmm0, &ret, sizeof (ret)))
+ abort ();
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../../test-skeleton.c"
diff --git a/sysdeps/x86_64/tst-ssemod.c b/sysdeps/x86_64/tst-ssemod.c
new file mode 100644
index 0000000000..907a64c69e
--- /dev/null
+++ b/sysdeps/x86_64/tst-ssemod.c
@@ -0,0 +1,46 @@
+/* Test case for x86-64 preserved SSE registers in dynamic linker. */
+
+#include <stdlib.h>
+#include <string.h>
+#include <immintrin.h>
+
+__m128i
+sse_test (__m128i x0, __m128i x1, __m128i x2, __m128i x3,
+ __m128i x4, __m128i x5, __m128i x6, __m128i x7)
+{
+ __m128i xmm;
+
+ xmm = _mm_set1_epi32 (0);
+ if (memcmp (&xmm, &x0, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (1);
+ if (memcmp (&xmm, &x1, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (2);
+ if (memcmp (&xmm, &x2, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (3);
+ if (memcmp (&xmm, &x3, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (4);
+ if (memcmp (&xmm, &x4, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (5);
+ if (memcmp (&xmm, &x5, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (6);
+ if (memcmp (&xmm, &x6, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (7);
+ if (memcmp (&xmm, &x7, sizeof (xmm)))
+ abort ();
+
+ return _mm_set1_epi32 (0x12349876);
+}
diff --git a/sysdeps/x86_64/tst-stack-align.h b/sysdeps/x86_64/tst-stack-align.h
index 24e8e61c35..b2ef77f65d 100644
--- a/sysdeps/x86_64/tst-stack-align.h
+++ b/sysdeps/x86_64/tst-stack-align.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/tst-x86_64-1.c b/sysdeps/x86_64/tst-x86_64-1.c
new file mode 100644
index 0000000000..801c866bdd
--- /dev/null
+++ b/sysdeps/x86_64/tst-x86_64-1.c
@@ -0,0 +1,26 @@
+/* Test searching the "x86_64" directory for shared libraries.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+extern void foo (void);
+
+int
+main (void)
+{
+ foo ();
+ return 0;
+}
diff --git a/sysdeps/x86_64/tst-x86_64mod-1.c b/sysdeps/x86_64/tst-x86_64mod-1.c
new file mode 100644
index 0000000000..57e955d5d9
--- /dev/null
+++ b/sysdeps/x86_64/tst-x86_64mod-1.c
@@ -0,0 +1,22 @@
+/* Test searching the "x86_64" directory for shared libraries.
+ Copyright (C) 2017-2018 Free Software 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/>. */
+
+void
+foo (void)
+{
+}
diff --git a/sysdeps/x86_64/wcschr.S b/sysdeps/x86_64/wcschr.S
index 8604289e46..29284662a1 100644
--- a/sysdeps/x86_64/wcschr.S
+++ b/sysdeps/x86_64/wcschr.S
@@ -1,5 +1,5 @@
/* wcschr with SSSE3
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/wcscmp.S b/sysdeps/x86_64/wcscmp.S
index 705a73b10e..0d506c8b5c 100644
--- a/sysdeps/x86_64/wcscmp.S
+++ b/sysdeps/x86_64/wcscmp.S
@@ -1,5 +1,5 @@
/* Optimized wcscmp for x86-64 with SSE2.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -946,5 +946,7 @@ L(equal):
ret
END (__wcscmp)
+#ifndef __wcscmp
libc_hidden_def (__wcscmp)
weak_alias (__wcscmp, wcscmp)
+#endif
diff --git a/sysdeps/x86_64/wcslen.S b/sysdeps/x86_64/wcslen.S
index 7a9175eefe..9f5f723227 100644
--- a/sysdeps/x86_64/wcslen.S
+++ b/sysdeps/x86_64/wcslen.S
@@ -1,5 +1,5 @@
/* Optimized wcslen for x86-64 with SSE2.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/wcsrchr.S b/sysdeps/x86_64/wcsrchr.S
index fb192f3ecf..2f38853727 100644
--- a/sysdeps/x86_64/wcsrchr.S
+++ b/sysdeps/x86_64/wcsrchr.S
@@ -1,5 +1,5 @@
/* wcsrchr with SSSE3
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
diff --git a/sysdeps/x86_64/wmemset.S b/sysdeps/x86_64/wmemset.S
new file mode 100644
index 0000000000..f96d567fd8
--- /dev/null
+++ b/sysdeps/x86_64/wmemset.S
@@ -0,0 +1 @@
+/* Implemented in memset.S. */
diff --git a/sysdeps/x86_64/wmemset_chk.S b/sysdeps/x86_64/wmemset_chk.S
new file mode 100644
index 0000000000..9275ebb40d
--- /dev/null
+++ b/sysdeps/x86_64/wmemset_chk.S
@@ -0,0 +1,33 @@
+/* Checking wmemset for x86-64.
+ Copyright (C) 2004-2018 Free Software 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>
+#include "asm-syntax.h"
+
+#ifndef SHARED
+ /* For libc.so this is defined in wmemset.S.
+ For libc.a, this is a separate source to avoid
+ wmemset bringing in __chk_fail and all routines
+ it calls. */
+ .text
+ENTRY (__wmemset_chk)
+ cmpq %rdx, %rcx
+ jb __chk_fail
+ jmp wmemset
+END (__wmemset_chk)
+#endif
diff --git a/sysdeps/x86_64/wordcopy.c b/sysdeps/x86_64/wordcopy.c
new file mode 100644
index 0000000000..590b6cb16b
--- /dev/null
+++ b/sysdeps/x86_64/wordcopy.c
@@ -0,0 +1 @@
+/* X86-64 doesn't use memory copy functions. */
diff --git a/sysdeps/x86_64/x32/dl-machine.h b/sysdeps/x86_64/x32/dl-machine.h
index 47132fcd96..2a612913ff 100644
--- a/sysdeps/x86_64/x32/dl-machine.h
+++ b/sysdeps/x86_64/x32/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. x32 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/x86_64/x32/fpu/s_lrint.S b/sysdeps/x86_64/x32/fpu/s_lrint.S
index aa68863553..381684583e 100644
--- a/sysdeps/x86_64/x32/fpu/s_lrint.S
+++ b/sysdeps/x86_64/x32/fpu/s_lrint.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,10 +18,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
.text
ENTRY(__lrint)
cvtsd2si %xmm0,%eax
ret
END(__lrint)
-weak_alias (__lrint, lrint)
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/x86_64/x32/fpu/s_lrintf.S b/sysdeps/x86_64/x32/fpu/s_lrintf.S
index bb5b1665bd..361d34a989 100644
--- a/sysdeps/x86_64/x32/fpu/s_lrintf.S
+++ b/sysdeps/x86_64/x32/fpu/s_lrintf.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,10 +18,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
.text
ENTRY(__lrintf)
cvtss2si %xmm0,%eax
ret
END(__lrintf)
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/x86_64/x32/fpu/s_lrintl.S b/sysdeps/x86_64/x32/fpu/s_lrintl.S
index 6bc8f6fdb9..b68313e916 100644
--- a/sysdeps/x86_64/x32/fpu/s_lrintl.S
+++ b/sysdeps/x86_64/x32/fpu/s_lrintl.S
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-ldouble.h>
.text
ENTRY(__lrintl)
@@ -27,4 +28,4 @@ ENTRY(__lrintl)
movl -4(%rsp),%eax
ret
END(__lrintl)
-weak_alias (__lrintl, lrintl)
+libm_alias_ldouble (__lrint, lrint)
diff --git a/sysdeps/x86_64/x32/gmp-mparam.h b/sysdeps/x86_64/x32/gmp-mparam.h
index df37442bfb..331c26d587 100644
--- a/sysdeps/x86_64/x32/gmp-mparam.h
+++ b/sysdeps/x86_64/x32/gmp-mparam.h
@@ -1,6 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright (C) 2012-2016 Free Software Foundation, Inc.
+Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
diff --git a/sysdeps/x86_64/x32/nptl/tls.h b/sysdeps/x86_64/x32/nptl/tls.h
deleted file mode 100644
index 245623494b..0000000000
--- a/sysdeps/x86_64/x32/nptl/tls.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Definition for thread-local data handling. nptl/x32 version.
- 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/>. */
-
-#ifndef _X32_TLS_H
-#define _X32_TLS_H 1
-
-#include_next <tls.h>
-
-#ifndef __ASSEMBLER__
-
-/* X32 doesn't support 32-bit indirect calls via memory. Instead, we
- load the 32-bit address from memory into the lower 32 bits of the
- return-value register, which will automatically zero-extend the upper
- 32 bits of the return-value register. We then do the indirect call
- via the 64-bit return-value register. */
-# undef CALL_THREAD_FCT
-# define CALL_THREAD_FCT(descr) \
- ({ void *__res; \
- asm volatile ("movl %%fs:%P2, %%edi\n\t" \
- "movl %%fs:%P1, %k0\n\t" \
- "callq *%q0" \
- : "=a" (__res) \
- : "i" (offsetof (struct pthread, start_routine)), \
- "i" (offsetof (struct pthread, arg)) \
- : "di", "si", "cx", "dx", "r8", "r9", "r10", "r11", \
- "memory", "cc"); \
- __res; })
-
-#endif /* __ASSEMBLER__ */
-
-#endif /* x32/tls.h */
diff --git a/sysdeps/x86_64/x32/sysdep.h b/sysdeps/x86_64/x32/sysdep.h
index 17a1446796..b40a438771 100644
--- a/sysdeps/x86_64/x32/sysdep.h
+++ b/sysdeps/x86_64/x32/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for x32.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or